4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
11 Problem: Some more compiler warnings when using gcc -Wextra.
12 Solution: Add UNUSED and type casts.
13 Files: src/if_mzsch.c, src/gui.c, src/gui_gtk.c, src/gui_gtk_x11.c,
14 src/gui_gtk_f.c, src/gui_beval.c, src/netbeans.c
17 *** ../vim-7.2.180/src/if_mzsch.c 2007-07-06 19:43:08.000000000 +0200
18 --- src/if_mzsch.c 2009-05-16 22:24:18.000000000 +0200
22 timer_proc(HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime)
23 # elif defined(FEAT_GUI_GTK)
26 ! timer_proc(gpointer data)
27 # elif defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA)
30 ! timer_proc(XtPointer timed_out, XtIntervalId *interval_id)
31 # elif defined(FEAT_GUI_MAC)
33 timer_proc(EventLoopTimerRef theTimer, void *userData)
36 timer_proc(HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime)
37 # elif defined(FEAT_GUI_GTK)
39 ! timer_proc(gpointer data UNUSED)
40 # elif defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA)
42 ! timer_proc(XtPointer timed_out UNUSED, XtIntervalId *interval_id UNUSED)
43 # elif defined(FEAT_GUI_MAC)
45 timer_proc(EventLoopTimerRef theTimer, void *userData)
46 *** ../vim-7.2.180/src/gui.c 2008-12-03 18:50:09.000000000 +0100
47 --- src/gui.c 2009-05-17 15:52:18.000000000 +0200
50 * Return OK when able to set the font. When it failed FAIL is returned and
51 * the fonts are unchanged.
55 gui_init_font(font_list, fontset)
60 char_u font_name[FONTLEN];
62 * Return OK when able to set the font. When it failed FAIL is returned and
63 * the fonts are unchanged.
66 gui_init_font(font_list, fontset)
71 char_u font_name[FONTLEN];
74 * Position the various GUI components (text area, menu). The vertical
75 * scrollbars are NOT handled here. See gui_update_scrollbars().
79 gui_position_components(total_width)
85 * Position the various GUI components (text area, menu). The vertical
86 * scrollbars are NOT handled here. See gui_update_scrollbars().
89 gui_position_components(total_width)
90 ! int total_width UNUSED;
96 * If "fit_to_display" is TRUE then the size may be reduced to fit the window
101 gui_set_shellsize(mustset, fit_to_display, direction)
102 ! int mustset; /* set by the user */
104 int direction; /* RESIZE_HOR, RESIZE_VER */
107 * If "fit_to_display" is TRUE then the size may be reduced to fit the window
111 gui_set_shellsize(mustset, fit_to_display, direction)
112 ! int mustset UNUSED; /* set by the user */
114 int direction; /* RESIZE_HOR, RESIZE_VER */
118 * If "oldval" is not NULL, "oldval" is the previous value, the new value is
123 gui_init_which_components(oldval)
128 if (curwin->w_p_wrap)
131 ! if (curwin->w_leftcol == scrollbar_value)
134 curwin->w_leftcol = (colnr_T)scrollbar_value;
136 if (curwin->w_p_wrap)
139 ! if ((long_u)curwin->w_leftcol == scrollbar_value)
142 curwin->w_leftcol = (colnr_T)scrollbar_value;
145 && longest_lnum < curwin->w_botline
146 && !virtual_active())
148 ! if (scrollbar_value > scroll_line_len(curwin->w_cursor.lnum))
150 curwin->w_cursor.lnum = longest_lnum;
151 curwin->w_cursor.col = 0;
153 && longest_lnum < curwin->w_botline
154 && !virtual_active())
156 ! if (scrollbar_value > (long_u)scroll_line_len(curwin->w_cursor.lnum))
158 curwin->w_cursor.lnum = longest_lnum;
159 curwin->w_cursor.col = 0;
163 * Find window where the mouse pointer "y" coordinate is in.
172 * of dropped files, they will be freed in this function, and caller can't use
173 * fnames after call this function.
177 gui_handle_drop(x, y, modifiers, fnames, count)
180 *** ../vim-7.2.180/src/gui_gtk.c 2008-07-31 22:29:28.000000000 +0200
181 --- src/gui_gtk.c 2009-05-17 16:06:30.000000000 +0200
189 ! toolbar_button_focus_in_event(GtkWidget *widget, GdkEventFocus *event, gpointer data)
191 ! /* When we're in a GtkPlug, we don't have window focus events, only widget focus.
192 ! * To emulate stand-alone gvim, if a button gets focus (e.g., <Tab> into GtkPlug)
193 ! * immediately pass it to mainwin.
195 if (gtk_socket_id != 0)
196 gtk_widget_grab_focus(gui.drawarea);
203 ! toolbar_button_focus_in_event(GtkWidget *widget UNUSED,
204 ! GdkEventFocus *event UNUSED,
205 ! gpointer data UNUSED)
207 ! /* When we're in a GtkPlug, we don't have window focus events, only widget
208 ! * focus. To emulate stand-alone gvim, if a button gets focus (e.g.,
209 ! * <Tab> into GtkPlug) immediately pass it to mainwin. */
210 if (gtk_socket_id != 0)
211 gtk_widget_grab_focus(gui.drawarea);
215 gtk_menu_prepend(GTK_MENU(menu->submenu_id), menu->tearoff_handle);
220 ! menu_item_activate(GtkWidget *widget, gpointer data)
222 gui_menu_cb((vimmenu_T *)data);
225 gtk_menu_prepend(GTK_MENU(menu->submenu_id), menu->tearoff_handle);
229 ! menu_item_activate(GtkWidget *widget UNUSED, gpointer data)
231 gui_menu_cb((vimmenu_T *)data);
237 #ifndef USE_FILE_CHOOSER
240 ! browse_ok_cb(GtkWidget *widget, gpointer cbdata)
242 gui_T *vw = (gui_T *)cbdata;
247 #ifndef USE_FILE_CHOOSER
249 ! browse_ok_cb(GtkWidget *widget UNUSED, gpointer cbdata)
251 gui_T *vw = (gui_T *)cbdata;
260 ! browse_cancel_cb(GtkWidget *widget, gpointer cbdata)
262 gui_T *vw = (gui_T *)cbdata;
269 ! browse_cancel_cb(GtkWidget *widget UNUSED, gpointer cbdata)
271 gui_T *vw = (gui_T *)cbdata;
280 ! browse_destroy_cb(GtkWidget * widget)
282 if (gui.browse_fname != NULL)
289 ! browse_destroy_cb(GtkWidget *widget UNUSED)
291 if (gui.browse_fname != NULL)
295 * initdir initial directory, NULL for current dir
296 * filter not used (file name filter)
300 ! gui_mch_browse(int saving,
307 #ifdef USE_FILE_CHOOSER
310 * initdir initial directory, NULL for current dir
311 * filter not used (file name filter)
314 ! gui_mch_browse(int saving UNUSED,
317 ! char_u *ext UNUSED,
319 ! char_u *filter UNUSED)
321 #ifdef USE_FILE_CHOOSER
326 * initdir initial directory, NULL for current dir
337 # ifdef FEAT_GUI_GNOME
340 gui_gnome_dialog( int type,
350 dlg_button_clicked(GtkWidget * widget, ButtonData *data)
356 * This makes the Escape key equivalent to the cancel button.
360 dlg_key_press_event(GtkWidget *widget, GdkEventKey *event, CancelData *data)
370 gui_mch_dialog( int type, /* type of dialog */
371 char_u *title, /* title of dialog */
375 GtkDialog *dialog; /* Widget of the dialog */
380 dialog_key_press_event_cb(GtkWidget *widget, GdkEventKey *event, gpointer data)
385 * Note: The push_in output argument seems to affect scrolling of huge
386 * menus that don't fit on the screen. Leave it at the default for now.
390 ! popup_menu_position_func(GtkMenu *menu,
395 ! gpointer user_data)
397 gdk_window_get_origin(gui.drawarea->window, x, y);
400 * Note: The push_in output argument seems to affect scrolling of huge
401 * menus that don't fit on the screen. Leave it at the default for now.
404 ! popup_menu_position_func(GtkMenu *menu UNUSED,
407 ! gboolean *push_in UNUSED,
409 ! gpointer user_data UNUSED)
411 gdk_window_get_origin(gui.drawarea->window, x, y);
415 GtkWidget *all; /* 'Replace All' action button */
418 ! static SharedFindReplace find_widgets = { NULL, };
419 ! static SharedFindReplace repl_widgets = { NULL, };
423 find_key_press_event(
426 SharedFindReplace *frdp)
429 GtkWidget *all; /* 'Replace All' action button */
432 ! static SharedFindReplace find_widgets = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL};
433 ! static SharedFindReplace repl_widgets = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL};
436 find_key_press_event(
437 ! GtkWidget *widget UNUSED,
439 SharedFindReplace *frdp)
444 * Callback for actions of the find and replace dialogs
448 ! find_replace_cb(GtkWidget *widget, gpointer data)
454 * Callback for actions of the find and replace dialogs
457 ! find_replace_cb(GtkWidget *widget UNUSED, gpointer data)
465 /* our usual callback function */
468 ! entry_activate_cb(GtkWidget *widget, gpointer data)
470 gtk_widget_grab_focus(GTK_WIDGET(data));
475 /* our usual callback function */
477 ! entry_activate_cb(GtkWidget *widget UNUSED, gpointer data)
479 gtk_widget_grab_focus(GTK_WIDGET(data));
491 /* This will fail when menus are not loaded. Well, it's only for
492 * backwards compatibility anyway. */
499 ! exarg_T *eap UNUSED;
501 /* This will fail when menus are not loaded. Well, it's only for
502 * backwards compatibility anyway. */
503 *** ../vim-7.2.180/src/gui_gtk_x11.c 2008-11-28 21:26:50.000000000 +0100
504 --- src/gui_gtk_x11.c 2009-05-17 15:53:02.000000000 +0200
507 * Doesn't seem possible, since check_copy_area() relies on
508 * this information. --danielk
512 ! visibility_event(GtkWidget *widget, GdkEventVisibility *event, gpointer data)
514 gui.visibility = event->state;
517 * Doesn't seem possible, since check_copy_area() relies on
518 * this information. --danielk
521 ! visibility_event(GtkWidget *widget UNUSED,
522 ! GdkEventVisibility *event,
523 ! gpointer data UNUSED)
525 gui.visibility = event->state;
530 * Redraw the corresponding portions of the screen.
534 ! expose_event(GtkWidget *widget, GdkEventExpose *event, gpointer data)
536 /* Skip this when the GUI isn't set up yet, will redraw later. */
540 * Redraw the corresponding portions of the screen.
543 ! expose_event(GtkWidget *widget UNUSED,
544 ! GdkEventExpose *event,
545 ! gpointer data UNUSED)
547 /* Skip this when the GUI isn't set up yet, will redraw later. */
552 * Handle changes to the "Comm" property
556 ! property_event(GtkWidget *widget, GdkEventProperty *event, gpointer data)
558 if (event->type == GDK_PROPERTY_NOTIFY
559 && event->state == (int)GDK_PROPERTY_NEW_VALUE
562 * Handle changes to the "Comm" property
565 ! property_event(GtkWidget *widget,
566 ! GdkEventProperty *event,
567 ! gpointer data UNUSED)
569 if (event->type == GDK_PROPERTY_NOTIFY
570 && event->state == (int)GDK_PROPERTY_NEW_VALUE
573 blink_state = BLINK_NONE;
578 ! blink_cb(gpointer data)
580 if (blink_state == BLINK_ON)
583 blink_state = BLINK_NONE;
587 ! blink_cb(gpointer data UNUSED)
589 if (blink_state == BLINK_ON)
598 ! enter_notify_event(GtkWidget *widget, GdkEventCrossing *event, gpointer data)
600 if (blink_state == BLINK_NONE)
601 gui_mch_start_blink();
607 ! enter_notify_event(GtkWidget *widget UNUSED,
608 ! GdkEventCrossing *event UNUSED,
609 ! gpointer data UNUSED)
611 if (blink_state == BLINK_NONE)
612 gui_mch_start_blink();
620 ! leave_notify_event(GtkWidget *widget, GdkEventCrossing *event, gpointer data)
622 if (blink_state != BLINK_NONE)
623 gui_mch_stop_blink();
629 ! leave_notify_event(GtkWidget *widget UNUSED,
630 ! GdkEventCrossing *event UNUSED,
631 ! gpointer data UNUSED)
633 if (blink_state != BLINK_NONE)
634 gui_mch_stop_blink();
642 ! focus_in_event(GtkWidget *widget, GdkEventFocus *event, gpointer data)
644 gui_focus_change(TRUE);
651 ! focus_in_event(GtkWidget *widget,
652 ! GdkEventFocus *event UNUSED,
653 ! gpointer data UNUSED)
655 gui_focus_change(TRUE);
664 ! focus_out_event(GtkWidget *widget, GdkEventFocus *event, gpointer data)
666 gui_focus_change(FALSE);
673 ! focus_out_event(GtkWidget *widget UNUSED,
674 ! GdkEventFocus *event UNUSED,
675 ! gpointer data UNUSED)
677 gui_focus_change(FALSE);
682 * Main keyboard handler:
686 ! key_press_event(GtkWidget *widget, GdkEventKey *event, gpointer data)
689 /* 256 bytes is way over the top, but for safety let's reduce it only
692 * Main keyboard handler:
695 ! key_press_event(GtkWidget *widget UNUSED,
696 ! GdkEventKey *event,
697 ! gpointer data UNUSED)
700 /* 256 bytes is way over the top, but for safety let's reduce it only
705 #if defined(FEAT_XIM) && defined(HAVE_GTK2)
708 ! key_release_event(GtkWidget *widget, GdkEventKey *event, gpointer data)
711 * GTK+ 2 input methods may do fancy stuff on key release events too.
715 #if defined(FEAT_XIM) && defined(HAVE_GTK2)
717 ! key_release_event(GtkWidget *widget UNUSED,
718 ! GdkEventKey *event,
719 ! gpointer data UNUSED)
722 * GTK+ 2 input methods may do fancy stuff on key release events too.
725 * Selection handlers:
730 ! selection_clear_event(GtkWidget *widget,
731 GdkEventSelection *event,
732 ! gpointer user_data)
734 if (event->selection == clip_plus.gtk_sel_atom)
735 clip_lose_selection(&clip_plus);
737 * Selection handlers:
741 ! selection_clear_event(GtkWidget *widget UNUSED,
742 GdkEventSelection *event,
743 ! gpointer user_data UNUSED)
745 if (event->selection == clip_plus.gtk_sel_atom)
746 clip_lose_selection(&clip_plus);
749 #define RS_FAIL 2 /* selection_received_cb() called and failed */
750 static int received_selection = RS_NONE;
754 ! selection_received_cb(GtkWidget *widget,
755 GtkSelectionData *data,
757 ! gpointer user_data)
762 #define RS_FAIL 2 /* selection_received_cb() called and failed */
763 static int received_selection = RS_NONE;
766 ! selection_received_cb(GtkWidget *widget UNUSED,
767 GtkSelectionData *data,
768 ! guint time_ UNUSED,
769 ! gpointer user_data UNUSED)
775 * Prepare our selection data for passing it to the external selection
780 ! selection_get_cb(GtkWidget *widget,
781 GtkSelectionData *selection_data,
784 ! gpointer user_data)
789 * Prepare our selection data for passing it to the external selection
793 ! selection_get_cb(GtkWidget *widget UNUSED,
794 GtkSelectionData *selection_data,
796 ! guint time_ UNUSED,
797 ! gpointer user_data UNUSED)
804 offshoot = dx > dy ? dx : dy;
806 ! /* Make a linearly declaying timer delay with a threshold of 5 at a
807 * distance of 127 pixels from the main window.
809 * One could think endlessly about the most ergonomic variant here.
812 offshoot = dx > dy ? dx : dy;
814 ! /* Make a linearly decaying timer delay with a threshold of 5 at a
815 * distance of 127 pixels from the main window.
817 * One could think endlessly about the most ergonomic variant here.
821 * Timer used to recognize multiple clicks of the mouse button.
825 ! motion_repeat_timer_cb(gpointer data)
831 * Timer used to recognize multiple clicks of the mouse button.
834 ! motion_repeat_timer_cb(gpointer data UNUSED)
845 ! motion_notify_event(GtkWidget *widget, GdkEventMotion *event, gpointer data)
854 ! motion_notify_event(GtkWidget *widget,
855 ! GdkEventMotion *event,
856 ! gpointer data UNUSED)
862 * by our own timeout mechanism instead of the one provided by GTK+ itself.
863 * This is due to the way the generic VIM code is recognizing multiple clicks.
867 ! button_press_event(GtkWidget *widget, GdkEventButton *event, gpointer data)
870 int repeated_click = FALSE;
872 * by our own timeout mechanism instead of the one provided by GTK+ itself.
873 * This is due to the way the generic VIM code is recognizing multiple clicks.
876 ! button_press_event(GtkWidget *widget,
877 ! GdkEventButton *event,
878 ! gpointer data UNUSED)
881 int repeated_click = FALSE;
884 * GTK+ 2 doesn't handle mouse buttons 4, 5, 6 and 7 the same way as GTK+ 1.
885 * Instead, it abstracts scrolling via the new GdkEventScroll.
889 ! scroll_event(GtkWidget *widget, GdkEventScroll *event, gpointer data)
894 * GTK+ 2 doesn't handle mouse buttons 4, 5, 6 and 7 the same way as GTK+ 1.
895 * Instead, it abstracts scrolling via the new GdkEventScroll.
898 ! scroll_event(GtkWidget *widget,
899 ! GdkEventScroll *event,
900 ! gpointer data UNUSED)
906 #endif /* HAVE_GTK2 */
911 ! button_release_event(GtkWidget *widget, GdkEventButton *event, gpointer data)
916 #endif /* HAVE_GTK2 */
920 ! button_release_event(GtkWidget *widget UNUSED,
921 ! GdkEventButton *event,
922 ! gpointer data UNUSED)
933 drag_data_received_cb(GtkWidget *widget,
934 GdkDragContext *context,
938 GtkSelectionData *data,
941 ! gpointer user_data)
943 GdkModifierType state;
946 GtkSelectionData *data,
949 ! gpointer user_data UNUSED)
951 GdkModifierType state;
955 * be abandoned and pop up a dialog asking the user for confirmation if
960 sm_client_check_changed_any(GnomeClient *client,
965 * for confirmation if necessary. Save the current editing session and tell
966 * the session manager how to restart Vim.
970 sm_client_save_yourself(GnomeClient *client,
975 * here since "save_yourself" has been emitted before (unless serious trouble
980 sm_client_die(GnomeClient *client, gpointer data)
986 * GTK tells us that XSMP needs attention
990 local_xsmp_handle_requests(source, condition, data)
991 ! GIOChannel *source;
992 GIOCondition condition;
997 * GTK tells us that XSMP needs attention
1000 local_xsmp_handle_requests(source, condition, data)
1001 ! GIOChannel *source UNUSED;
1002 GIOCondition condition;
1007 * WM_SAVE_YOURSELF hack it actually stores the session... And yes,
1008 * it should work with KDE as well.
1011 static GdkFilterReturn
1012 ! global_event_filter(GdkXEvent *xev, GdkEvent *event, gpointer data)
1014 XEvent *xevent = (XEvent *)xev;
1017 && xevent->type == ClientMessage
1018 && xevent->xclient.message_type == GET_X_ATOM(wm_protocols_atom)
1019 ! && xevent->xclient.data.l[0] == GET_X_ATOM(save_yourself_atom))
1022 ml_sync_all(FALSE, FALSE); /* preserve all swap files */
1024 * WM_SAVE_YOURSELF hack it actually stores the session... And yes,
1025 * it should work with KDE as well.
1027 static GdkFilterReturn
1028 ! global_event_filter(GdkXEvent *xev,
1029 ! GdkEvent *event UNUSED,
1030 ! gpointer data UNUSED)
1032 XEvent *xevent = (XEvent *)xev;
1035 && xevent->type == ClientMessage
1036 && xevent->xclient.message_type == GET_X_ATOM(wm_protocols_atom)
1037 ! && (long_u)xevent->xclient.data.l[0]
1038 ! == GET_X_ATOM(save_yourself_atom))
1041 ml_sync_all(FALSE, FALSE); /* preserve all swap files */
1045 * GDK handler for X ClientMessage events.
1048 static GdkFilterReturn
1049 gdk_wm_protocols_filter(GdkXEvent *xev, GdkEvent *event, gpointer data)
1055 * Setup the window icon & xcmdsrv comm after the main window has been realized.
1059 ! mainwin_realize(GtkWidget *widget, gpointer data)
1061 /* If you get an error message here, you still need to unpack the runtime
1065 * Setup the window icon & xcmdsrv comm after the main window has been realized.
1068 ! mainwin_realize(GtkWidget *widget UNUSED, gpointer data UNUSED)
1070 /* If you get an error message here, you still need to unpack the runtime
1076 #ifdef HAVE_GTK_MULTIHEAD
1079 mainwin_screen_changed_cb(GtkWidget *widget,
1080 ! GdkScreen *previous_screen,
1083 if (!gtk_widget_has_screen(widget))
1088 #ifdef HAVE_GTK_MULTIHEAD
1090 mainwin_screen_changed_cb(GtkWidget *widget,
1091 ! GdkScreen *previous_screen UNUSED,
1092 ! gpointer data UNUSED)
1094 if (!gtk_widget_has_screen(widget))
1098 * Don't try to set any VIM scrollbar sizes anywhere here. I'm relying on the
1099 * fact that the main VIM engine doesn't take them into account anywhere.
1103 ! drawarea_realize_cb(GtkWidget *widget, gpointer data)
1108 * Don't try to set any VIM scrollbar sizes anywhere here. I'm relying on the
1109 * fact that the main VIM engine doesn't take them into account anywhere.
1112 ! drawarea_realize_cb(GtkWidget *widget, gpointer data UNUSED)
1119 * Properly clean up on shutdown.
1123 ! drawarea_unrealize_cb(GtkWidget *widget, gpointer data)
1125 /* Don't write messages to the GUI anymore */
1126 full_screen = FALSE;
1129 * Properly clean up on shutdown.
1132 ! drawarea_unrealize_cb(GtkWidget *widget UNUSED, gpointer data UNUSED)
1134 /* Don't write messages to the GUI anymore */
1135 full_screen = FALSE;
1143 ! drawarea_style_set_cb(GtkWidget *widget,
1144 ! GtkStyle *previous_style,
1147 gui_mch_new_colors();
1154 ! drawarea_style_set_cb(GtkWidget *widget UNUSED,
1155 ! GtkStyle *previous_style UNUSED,
1156 ! gpointer data UNUSED)
1158 gui_mch_new_colors();
1162 * Callback routine for the "delete_event" signal on the toplevel window.
1163 * Tries to vim gracefully, or refuses to exit with changed buffers.
1167 ! delete_event_cb(GtkWidget *widget, GdkEventAny *event, gpointer data)
1172 * Callback routine for the "delete_event" signal on the toplevel window.
1173 * Tries to vim gracefully, or refuses to exit with changed buffers.
1176 ! delete_event_cb(GtkWidget *widget UNUSED,
1177 ! GdkEventAny *event UNUSED,
1178 ! gpointer data UNUSED)
1185 /* At start-up, don't try to set the hints until the initial
1186 * values have been used (those that dictate our initial size)
1187 ! * Let forced (i.e., correct) values thruogh always.
1189 if (!(force_width && force_height) && init_window_hints_state > 0)
1193 /* At start-up, don't try to set the hints until the initial
1194 * values have been used (those that dictate our initial size)
1195 ! * Let forced (i.e., correct) values through always.
1197 if (!(force_width && force_height) && init_window_hints_state > 0)
1202 * Handle selecting an item in the tab line popup menu.
1206 ! tabline_menu_handler(GtkMenuItem *item, gpointer user_data)
1208 /* Add the string cmd into input buffer */
1209 send_tabline_menu_event(clicked_page, (int)(long)user_data);
1212 * Handle selecting an item in the tab line popup menu.
1215 ! tabline_menu_handler(GtkMenuItem *item UNUSED, gpointer user_data)
1217 /* Add the string cmd into input buffer */
1218 send_tabline_menu_event(clicked_page, (int)(long)user_data);
1222 * Handle selecting one of the tabs.
1227 ! GtkNotebook *notebook,
1228 ! GtkNotebookPage *page,
1232 if (!ignore_tabline_evt)
1236 * Handle selecting one of the tabs.
1240 ! GtkNotebook *notebook UNUSED,
1241 ! GtkNotebookPage *page UNUSED,
1243 ! gpointer data UNUSED)
1245 if (!ignore_tabline_evt)
1251 if (gtk_socket_id != 0)
1252 ! /* make sure keybord input can go to the drawarea */
1253 GTK_WIDGET_SET_FLAGS(gui.drawarea, GTK_CAN_FOCUS);
1259 if (gtk_socket_id != 0)
1260 ! /* make sure keyboard input can go to the drawarea */
1261 GTK_WIDGET_SET_FLAGS(gui.drawarea, GTK_CAN_FOCUS);
1267 * This signal informs us about the need to rearrange our sub-widgets.
1271 ! form_configure_event(GtkWidget *widget, GdkEventConfigure *event,
1274 int usable_height = event->height;
1278 * This signal informs us about the need to rearrange our sub-widgets.
1281 ! form_configure_event(GtkWidget *widget UNUSED,
1282 ! GdkEventConfigure *event,
1283 ! gpointer data UNUSED)
1285 int usable_height = event->height;
1289 * We can't do much more here than to trying to preserve what had been done,
1290 * since the window is already inevitably going away.
1294 ! mainwin_destroy_cb(GtkObject *object, gpointer data)
1296 /* Don't write messages to the GUI anymore */
1297 full_screen = FALSE;
1299 * We can't do much more here than to trying to preserve what had been done,
1300 * since the window is already inevitably going away.
1303 ! mainwin_destroy_cb(GtkObject *object UNUSED, gpointer data UNUSED)
1305 /* Don't write messages to the GUI anymore */
1306 full_screen = FALSE;
1309 * scrollbar init.), actually do the standard hinst and stop the timer.
1310 * We'll not let the default hints be set while this timer's active.
1314 ! check_startup_plug_hints(gpointer data)
1316 if (init_window_hints_state == 1)
1319 * scrollbar init.), actually do the standard hinst and stop the timer.
1320 * We'll not let the default hints be set while this timer's active.
1323 ! check_startup_plug_hints(gpointer data UNUSED)
1325 if (init_window_hints_state == 1)
1330 if (mask & HeightValue)
1332 ! if (p_window > h - 1 || !option_was_set((char_u *)"window"))
1338 if (mask & HeightValue)
1340 ! if (p_window > (long)h - 1 || !option_was_set((char_u *)"window"))
1351 ! gui_mch_exit(int rc)
1353 if (gui.mainwin != NULL)
1354 gtk_widget_destroy(gui.mainwin);
1360 ! gui_mch_exit(int rc UNUSED)
1362 if (gui.mainwin != NULL)
1363 gtk_widget_destroy(gui.mainwin);
1366 * report the new size through form_configure_event(). That caused the window
1367 * layout to be messed up.
1371 force_shell_resize_idle(gpointer data)
1377 * Set the windows size.
1381 gui_mch_set_shellsize(int width, int height,
1382 ! int min_width, int min_height,
1383 ! int base_width, int base_height,
1387 /* Hack: When the form already is at the desired size, the window might
1390 * Set the windows size.
1393 gui_mch_set_shellsize(int width, int height,
1394 ! int min_width UNUSED, int min_height UNUSED,
1395 ! int base_width UNUSED, int base_height UNUSED,
1396 ! int direction UNUSED)
1399 /* Hack: When the form already is at the desired size, the window might
1404 #if defined(FEAT_TITLE) || defined(PROTO)
1407 ! gui_mch_settitle(char_u *title, char_u *icon)
1410 if (title != NULL && output_conv.vc_type != CONV_NONE)
1414 #if defined(FEAT_TITLE) || defined(PROTO)
1416 ! gui_mch_settitle(char_u *title, char_u *icon UNUSED)
1419 if (title != NULL && output_conv.vc_type != CONV_NONE)
1422 * Get a font structure for highlighting.
1423 * "cbdata" is a pointer to the global gui structure.
1427 font_sel_ok(GtkWidget *wgt, gpointer cbdata)
1437 font_sel_cancel(GtkWidget *wgt, gpointer cbdata)
1447 font_sel_destroy(GtkWidget *wgt, gpointer cbdata)
1453 * Try to load the requested fontset.
1457 gui_mch_get_fontset(char_u *name, int report_error, int fixed_width)
1462 styled_font[1] = &gui.ital_font;
1463 styled_font[2] = &gui.boldital_font;
1465 ! /* First free whatever was freviously there. */
1466 for (i = 0; i < 3; ++i)
1467 if (*styled_font[i])
1470 styled_font[1] = &gui.ital_font;
1471 styled_font[2] = &gui.boldital_font;
1473 ! /* First free whatever was previously there. */
1474 for (i = 0; i < 3; ++i)
1475 if (*styled_font[i])
1479 * Initialize Vim to use the font or fontset with the given name.
1480 * Return FAIL if the font could not be loaded, OK otherwise.
1484 ! gui_mch_init_font(char_u *font_name, int fontset)
1487 PangoFontDescription *font_desc;
1489 * Initialize Vim to use the font or fontset with the given name.
1490 * Return FAIL if the font could not be loaded, OK otherwise.
1493 ! gui_mch_init_font(char_u *font_name, int fontset UNUSED)
1496 PangoFontDescription *font_desc;
1500 * Return the name of font "font" in allocated memory.
1504 ! gui_mch_get_fontname(GuiFont font, char_u *name)
1510 * Return the name of font "font" in allocated memory.
1513 ! gui_mch_get_fontname(GuiFont font, char_u *name UNUSED)
1522 ! const static int val[8] = {1, 0, 0, 0, 1, 2, 2, 2 };
1523 int y = FILL_Y(row + 1) - 1;
1525 /* Undercurl: draw curl at the bottom of the character cell. */
1530 ! static const int val[8] = {1, 0, 0, 0, 1, 2, 2, 2 };
1531 int y = FILL_Y(row + 1) - 1;
1533 /* Undercurl: draw curl at the bottom of the character cell. */
1537 * Callback function, used when data is available on the SNiFF connection.
1547 * Disown the selection.
1551 ! clip_mch_lose_selection(VimClipboard *cbd)
1553 /* WEIRD: when using NULL to actually disown the selection, we lose the
1554 * selection the first time we own it. */
1557 * Disown the selection.
1560 ! clip_mch_lose_selection(VimClipboard *cbd UNUSED)
1562 /* WEIRD: when using NULL to actually disown the selection, we lose the
1563 * selection the first time we own it. */
1566 * Send the current selection to the clipboard. Do nothing for X because we
1567 * will fill in the selection only when requested by another app.
1571 ! clip_mch_set_selection(VimClipboard *cbd)
1576 * Send the current selection to the clipboard. Do nothing for X because we
1577 * will fill in the selection only when requested by another app.
1580 ! clip_mch_set_selection(VimClipboard *cbd UNUSED)
1587 id &= ~1; /* they are always even (why?) */
1589 ! else if (shape < sizeof(mshape_ids) / sizeof(int))
1590 id = mshape_ids[shape];
1595 id &= ~1; /* they are always even (why?) */
1597 ! else if (shape < (int)(sizeof(mshape_ids) / sizeof(int)))
1598 id = mshape_ids[shape];
1601 *** ../vim-7.2.180/src/gui_gtk_f.c 2007-05-10 19:50:33.000000000 +0200
1602 --- src/gui_gtk_f.c 2009-05-17 15:48:51.000000000 +0200
1608 ! GtkTypeInfo form_info =
1612 ! sizeof(GtkFormClass),
1613 ! (GtkClassInitFunc) gtk_form_class_init,
1614 ! (GtkObjectInitFunc) gtk_form_init
1617 form_type = gtk_type_unique(GTK_TYPE_CONTAINER, &form_info);
1623 ! GtkTypeInfo form_info;
1625 ! form_info.type_name = "GtkForm";
1626 ! form_info.object_size = sizeof(GtkForm);
1627 ! form_info.class_size = sizeof(GtkFormClass);
1628 ! form_info.class_init_func = (GtkClassInitFunc)gtk_form_class_init;
1629 ! form_info.object_init_func = (GtkObjectInitFunc)gtk_form_init;
1631 form_type = gtk_type_unique(GTK_TYPE_CONTAINER, &form_info);
1640 gtk_form_forall(GtkContainer *container,
1641 ! gboolean include_internals,
1642 GtkCallback callback,
1643 gpointer callback_data)
1650 gtk_form_forall(GtkContainer *container,
1651 ! gboolean include_internals UNUSED,
1652 GtkCallback callback,
1653 gpointer callback_data)
1657 * them or discards them, depending on whether we are obscured
1661 static GdkFilterReturn
1662 ! gtk_form_filter(GdkXEvent *gdk_xevent, GdkEvent *event, gpointer data)
1667 * them or discards them, depending on whether we are obscured
1670 static GdkFilterReturn
1671 ! gtk_form_filter(GdkXEvent *gdk_xevent, GdkEvent *event UNUSED, gpointer data)
1677 * there is no corresponding event in GTK, so we have
1678 * to get the events from a filter
1681 static GdkFilterReturn
1682 ! gtk_form_main_filter(GdkXEvent *gdk_xevent, GdkEvent *event, gpointer data)
1687 * there is no corresponding event in GTK, so we have
1688 * to get the events from a filter
1690 static GdkFilterReturn
1691 ! gtk_form_main_filter(GdkXEvent *gdk_xevent,
1692 ! GdkEvent *event UNUSED,
1704 ! gtk_form_child_map(GtkWidget *widget, gpointer user_data)
1706 GtkFormChild *child;
1713 ! gtk_form_child_map(GtkWidget *widget UNUSED, gpointer user_data)
1715 GtkFormChild *child;
1719 gdk_window_show(child->window);
1724 ! gtk_form_child_unmap(GtkWidget *widget, gpointer user_data)
1726 GtkFormChild *child;
1729 gdk_window_show(child->window);
1733 ! gtk_form_child_unmap(GtkWidget *widget UNUSED, gpointer user_data)
1735 GtkFormChild *child;
1737 *** ../vim-7.2.180/src/gui_beval.c 2009-03-18 12:20:35.000000000 +0100
1738 --- src/gui_beval.c 2009-05-17 15:53:22.000000000 +0200
1742 * Common code, invoked when the mouse is resting for a moment.
1746 general_beval_cb(beval, state)
1751 return FALSE; /* continue emission */
1756 ! mainwin_event_cb(GtkWidget *widget, GdkEvent *event, gpointer data)
1758 BalloonEval *beval = (BalloonEval *)data;
1761 return FALSE; /* continue emission */
1765 ! mainwin_event_cb(GtkWidget *widget UNUSED, GdkEvent *event, gpointer data)
1767 BalloonEval *beval = (BalloonEval *)data;
1771 return FALSE; /* don't call me again */
1776 ! balloon_expose_event_cb(GtkWidget *widget, GdkEventExpose *event, gpointer data)
1778 gtk_paint_flat_box(widget->style, widget->window,
1779 GTK_STATE_NORMAL, GTK_SHADOW_OUT,
1781 return FALSE; /* don't call me again */
1785 ! balloon_expose_event_cb(GtkWidget *widget,
1786 ! GdkEventExpose *event,
1787 ! gpointer data UNUSED)
1789 gtk_paint_flat_box(widget->style, widget->window,
1790 GTK_STATE_NORMAL, GTK_SHADOW_OUT,
1798 balloon_draw_cb(GtkWidget *widget, GdkRectangle *area, gpointer data)
1804 * The X event handler. All it does is call the real event handler.
1808 pointerEventEH(w, client_data, event, unused)
1818 timerRoutine(dx, id)
1821 *** ../vim-7.2.180/src/netbeans.c 2009-02-21 22:12:43.000000000 +0100
1822 --- src/netbeans.c 2009-05-17 15:51:14.000000000 +0200
1826 * Read and process a command from netbeans.
1829 #if defined(FEAT_GUI_W32) || defined(PROTO)
1830 /* Use this one when generating prototypes, the others are static. */
1836 # ifdef FEAT_GUI_MOTIF
1838 ! messageFromNetbeans(XtPointer clientData, int *unused1, XtInputId *unused2)
1840 # ifdef FEAT_GUI_GTK
1842 ! messageFromNetbeans(gpointer clientData, gint unused1,
1843 ! GdkInputCondition unused2)
1849 # ifdef FEAT_GUI_MOTIF
1851 ! messageFromNetbeans(XtPointer clientData UNUSED
1852 ! int *unused1 UNUSED,
1853 ! XtInputId *unused2 UNUSED)
1855 # ifdef FEAT_GUI_GTK
1857 ! messageFromNetbeans(gpointer clientData UNUSED,
1858 ! gint unused1 UNUSED,
1859 ! GdkInputCondition unused2 UNUSED)
1866 buf_delsign(buf->bufp, id);
1870 nbdebug((" No sign on line %d\n", i));
1874 nbdebug((" Deleting lines %d through %d\n", del_from_lnum, del_to_lnum));
1882 nbdebug((" BAD POSITION in setDot: %s\n", s));
1885 /* gui_update_cursor(TRUE, FALSE); */
1886 /* update_curbuf(NOT_VALID); */
1889 * cursor and sends it to the debugger for evaluation. The debugger should
1890 * respond with a showBalloon command when there is a useful result.
1901 * cursor and sends it to the debugger for evaluation. The debugger should
1902 * respond with a showBalloon command when there is a useful result.
1914 * Send netbeans an unmodufied command.
1918 ! netbeans_unmodified(buf_T *bufp)
1924 * Send netbeans an unmodufied command.
1927 ! netbeans_unmodified(buf_T *bufp UNUSED)
1933 * buf->signmapused[] maps buffer-local annotation IDs to an index in
1947 * buf->signmapused[] maps buffer-local annotation IDs to an index in
1955 ! char_u *tooltip UNUSED,
1959 *** ../vim-7.2.180/src/version.c 2009-05-17 13:30:58.000000000 +0200
1960 --- src/version.c 2009-05-17 16:07:26.000000000 +0200
1964 { /* Add new patch number below this line */
1970 I am always surprised in the Linux world how quickly solutions can be
1971 obtained. (Imagine sending an email to Bill Gates, asking why Windows
1972 crashed, and how to fix it... and then getting an answer that fixed the
1973 problem... <0>_<0> !) -- Mark Langdon
1975 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
1976 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
1977 \\\ download, build and distribute -- http://www.A-A-P.org ///
1978 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///