Mercurial > vim
comparison src/netbeans.c @ 2592:2c5e70e2858f v7.3.016
updated for version 7.3.016
Problem: Netbeans doesn't work under Athena.
Solution: Support Athena, just like Motif. (Xavier de Gaye)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Wed, 29 Sep 2010 17:27:01 +0200 |
parents | 073ff46fe397 |
children | bf9579ab26e5 |
comparison
equal
deleted
inserted
replaced
2591:88095f75d63b | 2592:2c5e70e2858f |
---|---|
85 static int getConnInfo __ARGS((char *file, char **host, char **port, char **password)); | 85 static int getConnInfo __ARGS((char *file, char **host, char **port, char **password)); |
86 | 86 |
87 static void nb_init_graphics __ARGS((void)); | 87 static void nb_init_graphics __ARGS((void)); |
88 static void coloncmd __ARGS((char *cmd, ...)); | 88 static void coloncmd __ARGS((char *cmd, ...)); |
89 static void nb_set_curbuf __ARGS((buf_T *buf)); | 89 static void nb_set_curbuf __ARGS((buf_T *buf)); |
90 #ifdef FEAT_GUI_MOTIF | 90 #ifdef FEAT_GUI_X11 |
91 static void messageFromNetbeans __ARGS((XtPointer, int *, XtInputId *)); | 91 static void messageFromNetbeans __ARGS((XtPointer, int *, XtInputId *)); |
92 #endif | 92 #endif |
93 #ifdef FEAT_GUI_GTK | 93 #ifdef FEAT_GUI_GTK |
94 static void messageFromNetbeans __ARGS((gpointer, gint, GdkInputCondition)); | 94 static void messageFromNetbeans __ARGS((gpointer, gint, GdkInputCondition)); |
95 #endif | 95 #endif |
110 #endif | 110 #endif |
111 | 111 |
112 static NBSOCK nbsock = -1; /* socket fd for Netbeans connection */ | 112 static NBSOCK nbsock = -1; /* socket fd for Netbeans connection */ |
113 #define NETBEANS_OPEN (nbsock != -1) | 113 #define NETBEANS_OPEN (nbsock != -1) |
114 | 114 |
115 #ifdef FEAT_GUI_MOTIF | 115 #ifdef FEAT_GUI_X11 |
116 static XtInputId inputHandler = (XtInputId)NULL; /* Cookie for input */ | 116 static XtInputId inputHandler = (XtInputId)NULL; /* Cookie for input */ |
117 #endif | 117 #endif |
118 #ifdef FEAT_GUI_GTK | 118 #ifdef FEAT_GUI_GTK |
119 static gint inputHandler = 0; /* Cookie for input */ | 119 static gint inputHandler = 0; /* Cookie for input */ |
120 #endif | 120 #endif |
141 if (!NETBEANS_OPEN) | 141 if (!NETBEANS_OPEN) |
142 return; | 142 return; |
143 | 143 |
144 netbeans_send_disconnect(); | 144 netbeans_send_disconnect(); |
145 | 145 |
146 #ifdef FEAT_GUI_MOTIF | 146 #ifdef FEAT_GUI_X11 |
147 if (inputHandler != (XtInputId)NULL) | 147 if (inputHandler != (XtInputId)NULL) |
148 { | 148 { |
149 XtRemoveInput(inputHandler); | 149 XtRemoveInput(inputHandler); |
150 inputHandler = (XtInputId)NULL; | 150 inputHandler = (XtInputId)NULL; |
151 } | 151 } |
698 #define MAXMSGSIZE 4096 | 698 #define MAXMSGSIZE 4096 |
699 | 699 |
700 /* | 700 /* |
701 * Read a command from netbeans. | 701 * Read a command from netbeans. |
702 */ | 702 */ |
703 #ifdef FEAT_GUI_MOTIF | 703 #ifdef FEAT_GUI_X11 |
704 static void | 704 static void |
705 messageFromNetbeans(XtPointer clientData UNUSED, | 705 messageFromNetbeans(XtPointer clientData UNUSED, |
706 int *unused1 UNUSED, | 706 int *unused1 UNUSED, |
707 XtInputId *unused2 UNUSED) | 707 XtInputId *unused2 UNUSED) |
708 { | 708 { |
2935 netbeans_gui_register(void) | 2935 netbeans_gui_register(void) |
2936 { | 2936 { |
2937 if (!NB_HAS_GUI || !NETBEANS_OPEN) | 2937 if (!NB_HAS_GUI || !NETBEANS_OPEN) |
2938 return; | 2938 return; |
2939 | 2939 |
2940 # ifdef FEAT_GUI_MOTIF | 2940 # ifdef FEAT_GUI_X11 |
2941 /* tell notifier we are interested in being called | 2941 /* tell notifier we are interested in being called |
2942 * when there is input on the editor connection socket | 2942 * when there is input on the editor connection socket |
2943 */ | 2943 */ |
2944 if (inputHandler == (XtInputId)NULL) | 2944 if (inputHandler == (XtInputId)NULL) |
2945 inputHandler = XtAppAddInput((XtAppContext)app_context, nbsock, | 2945 inputHandler = XtAppAddInput((XtAppContext)app_context, nbsock, |
3025 nbdebug(("EVT: %s", buf)); | 3025 nbdebug(("EVT: %s", buf)); |
3026 nb_send(buf, "netbeans_disconnect"); | 3026 nb_send(buf, "netbeans_disconnect"); |
3027 } | 3027 } |
3028 } | 3028 } |
3029 | 3029 |
3030 #if defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_W32) || defined(PROTO) | 3030 #if defined(FEAT_GUI_X11) || defined(FEAT_GUI_W32) || defined(PROTO) |
3031 /* | 3031 /* |
3032 * Tell netbeans that the window was moved or resized. | 3032 * Tell netbeans that the window was moved or resized. |
3033 */ | 3033 */ |
3034 void | 3034 void |
3035 netbeans_frame_moved(int new_x, int new_y) | 3035 netbeans_frame_moved(int new_x, int new_y) |
3456 return TRUE; | 3456 return TRUE; |
3457 | 3457 |
3458 return FALSE; | 3458 return FALSE; |
3459 } | 3459 } |
3460 | 3460 |
3461 #if defined(FEAT_GUI_MOTIF) || defined(PROTO) | 3461 #if defined(FEAT_GUI_X11) || defined(PROTO) |
3462 /* | 3462 /* |
3463 * We have multiple signs to draw at the same location. Draw the | 3463 * We have multiple signs to draw at the same location. Draw the |
3464 * multi-sign indicator instead. This is the Motif version. | 3464 * multi-sign indicator instead. This is the Motif version. |
3465 */ | 3465 */ |
3466 void | 3466 void |
3485 XDrawPoint(gui.dpy, gui.wid, gui.text_gc, x+1, y); | 3485 XDrawPoint(gui.dpy, gui.wid, gui.text_gc, x+1, y); |
3486 XDrawPoint(gui.dpy, gui.wid, gui.text_gc, x+2, y); | 3486 XDrawPoint(gui.dpy, gui.wid, gui.text_gc, x+2, y); |
3487 XDrawPoint(gui.dpy, gui.wid, gui.text_gc, x+3, y++); | 3487 XDrawPoint(gui.dpy, gui.wid, gui.text_gc, x+3, y++); |
3488 XDrawPoint(gui.dpy, gui.wid, gui.text_gc, x+2, y); | 3488 XDrawPoint(gui.dpy, gui.wid, gui.text_gc, x+2, y); |
3489 } | 3489 } |
3490 #endif /* FEAT_GUI_MOTIF */ | 3490 #endif /* FEAT_GUI_X11 */ |
3491 | 3491 |
3492 #if defined(FEAT_GUI_GTK) && !defined(PROTO) | 3492 #if defined(FEAT_GUI_GTK) && !defined(PROTO) |
3493 /* | 3493 /* |
3494 * We have multiple signs to draw at the same location. Draw the | 3494 * We have multiple signs to draw at the same location. Draw the |
3495 * multi-sign indicator instead. This is the GTK/Gnome version. | 3495 * multi-sign indicator instead. This is the GTK/Gnome version. |