diff options
69 files changed, 690 insertions, 371 deletions
diff --git a/addressbook/gui/contact-list-editor/e-contact-list-editor.c b/addressbook/gui/contact-list-editor/e-contact-list-editor.c index edd8f003b9..2ffee04b91 100644 --- a/addressbook/gui/contact-list-editor/e-contact-list-editor.c +++ b/addressbook/gui/contact-list-editor/e-contact-list-editor.c @@ -26,7 +26,6 @@ #include <e-util/e-util-private.h> #include <e-util/e-alert-dialog.h> #include <e-util/e-selection.h> -#include <e-util/gtk-compat.h> #include "shell/e-shell.h" #include <string.h> @@ -48,6 +47,9 @@ #include "e-contact-list-model.h" #include "eab-contact-merging.h" +/* backward-compatibility cruft */ +#include <e-util/gtk-compat.h> + #define E_CONTACT_LIST_EDITOR_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), E_TYPE_CONTACT_LIST_EDITOR, EContactListEditorPrivate)) @@ -572,7 +574,7 @@ contact_list_editor_email_entry_key_press_event_cb (GtkWidget *widget, editor = contact_list_editor_extract (widget); - if (event->keyval == GDK_comma) { + if (event->keyval == GDK_KEY_comma) { GtkEntry *entry; gint cpos = -1; @@ -596,7 +598,7 @@ contact_list_editor_email_entry_key_press_event_cb (GtkWidget *widget, } } - if (can_comma || event->keyval == GDK_Return) { + if (can_comma || event->keyval == GDK_KEY_Return) { g_signal_emit_by_name (widget, "activate", 0); contact_list_editor_add_email (editor); @@ -827,7 +829,7 @@ contact_list_editor_tree_view_key_press_event_cb (GtkWidget *widget, editor = contact_list_editor_extract (widget); - if (event->keyval == GDK_Delete) { + if (event->keyval == GDK_KEY_Delete) { g_signal_emit_by_name (WIDGET (REMOVE_BUTTON), "clicked"); return TRUE; } diff --git a/addressbook/gui/widgets/e-minicard-label.c b/addressbook/gui/widgets/e-minicard-label.c index 35b0525e51..6b01750a87 100644 --- a/addressbook/gui/widgets/e-minicard-label.c +++ b/addressbook/gui/widgets/e-minicard-label.c @@ -33,6 +33,9 @@ #include <misc/e-canvas-utils.h> #include <gdk/gdkkeysyms.h> +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + static void e_minicard_label_init (EMinicardLabel *card); static void e_minicard_label_class_init (EMinicardLabelClass *klass); static void e_minicard_label_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); @@ -349,7 +352,7 @@ e_minicard_label_event (GnomeCanvasItem *item, GdkEvent *event) switch (event->type) { case GDK_KEY_PRESS: - if (event->key.keyval == GDK_Escape) { + if (event->key.keyval == GDK_KEY_Escape) { GnomeCanvasItem *parent; e_text_cancel_editing (E_TEXT (e_minicard_label->field)); diff --git a/addressbook/gui/widgets/e-minicard-view.c b/addressbook/gui/widgets/e-minicard-view.c index 5f542ae66e..d3a05e53a6 100644 --- a/addressbook/gui/widgets/e-minicard-view.c +++ b/addressbook/gui/widgets/e-minicard-view.c @@ -36,6 +36,9 @@ #include "e-util/e-util.h" #include "ea-addressbook.h" +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + static void e_minicard_view_drag_data_get (GtkWidget *widget, GdkDragContext *context, GtkSelectionData *selection_data, @@ -402,7 +405,7 @@ e_minicard_view_event (GnomeCanvasItem *item, GdkEvent *event) break; case GDK_KEY_PRESS: if (event->key.keyval & GDK_SHIFT_MASK && - event->key.keyval == GDK_F10) { + event->key.keyval == GDK_KEY_F10) { e_minicard_view_right_click (view, event); } break; diff --git a/addressbook/gui/widgets/e-minicard.c b/addressbook/gui/widgets/e-minicard.c index e5b5fa8310..5c2da9de01 100644 --- a/addressbook/gui/widgets/e-minicard.c +++ b/addressbook/gui/widgets/e-minicard.c @@ -40,6 +40,9 @@ #include <libebook/e-destination.h> #include "ea-addressbook.h" +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + static void e_minicard_init (EMinicard *card); static void e_minicard_class_init (EMinicardClass *class); static void e_minicard_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); @@ -637,9 +640,9 @@ e_minicard_event (GnomeCanvasItem *item, GdkEvent *event) } break; case GDK_KEY_PRESS: - if (event->key.keyval == GDK_Tab || - event->key.keyval == GDK_KP_Tab || - event->key.keyval == GDK_ISO_Left_Tab) { + if (event->key.keyval == GDK_KEY_Tab || + event->key.keyval == GDK_KEY_KP_Tab || + event->key.keyval == GDK_KEY_ISO_Left_Tab) { EMinicardView *view = E_MINICARD_VIEW (item->parent); EReflow *reflow = E_REFLOW (view); @@ -701,8 +704,8 @@ e_minicard_event (GnomeCanvasItem *item, GdkEvent *event) } } } - else if (event->key.keyval == GDK_Return || - event->key.keyval == GDK_KP_Enter) { + else if (event->key.keyval == GDK_KEY_Return || + event->key.keyval == GDK_KEY_KP_Enter) { e_minicard_activate_editor (e_minicard); return TRUE; } diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c index 69cb2f2479..6c3179cf2c 100644 --- a/calendar/gui/dialogs/comp-editor.c +++ b/calendar/gui/dialogs/comp-editor.c @@ -59,6 +59,9 @@ #include "e-util/e-alert-dialog.h" #include "e-util/e-ui-manager.h" +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + #define COMP_EDITOR_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), TYPE_COMP_EDITOR, CompEditorPrivate)) @@ -1456,7 +1459,7 @@ comp_editor_key_press_event (GtkWidget *widget, editor = COMP_EDITOR (widget); - if (event->keyval == GDK_Escape) { + if (event->keyval == GDK_KEY_Escape) { commit_all_fields (editor); if (prompt_and_save_changes (editor, TRUE)) diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c index e4e034fd16..bcbaf7cc3a 100644 --- a/calendar/gui/dialogs/event-page.c +++ b/calendar/gui/dialogs/event-page.c @@ -59,6 +59,9 @@ #include "event-page.h" #include "e-send-options-utils.h" +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + #define EVENT_PAGE_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), TYPE_EVENT_PAGE, EventPagePrivate)) @@ -1996,12 +1999,12 @@ list_view_event (EMeetingListView *list_view, GdkEvent *event, EventPage *epage) static gboolean list_key_press (EMeetingListView *list_view, GdkEventKey *event, EventPage *epage) { - if (event->keyval == GDK_Delete) { + if (event->keyval == GDK_KEY_Delete) { remove_clicked_cb (NULL, epage); return TRUE; - } else if (event->keyval == GDK_Insert) { + } else if (event->keyval == GDK_KEY_Insert) { add_clicked_cb (NULL, epage); return TRUE; diff --git a/calendar/gui/dialogs/task-page.c b/calendar/gui/dialogs/task-page.c index 7777f23dd0..0596d0d12c 100644 --- a/calendar/gui/dialogs/task-page.c +++ b/calendar/gui/dialogs/task-page.c @@ -55,6 +55,9 @@ #include "../e-meeting-store.h" #include "../e-meeting-list-view.h" +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + #define TASK_PAGE_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), TYPE_TASK_PAGE, TaskPagePrivate)) @@ -1288,12 +1291,12 @@ list_view_event (EMeetingListView *list_view, GdkEvent *event, TaskPage *page) { static gboolean list_key_press (EMeetingListView *list_view, GdkEventKey *event, TaskPage *page) { - if (event->keyval == GDK_Delete) { + if (event->keyval == GDK_KEY_Delete) { remove_clicked_cb (NULL, page); return TRUE; - } else if (event->keyval == GDK_Insert) { + } else if (event->keyval == GDK_KEY_Insert) { add_clicked_cb (NULL, page); return TRUE; diff --git a/calendar/gui/e-calendar-view.c b/calendar/gui/e-calendar-view.c index 4555ef9a81..5b047999cf 100644 --- a/calendar/gui/e-calendar-view.c +++ b/calendar/gui/e-calendar-view.c @@ -62,6 +62,9 @@ #include "goto.h" #include "misc.h" +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + #define E_CALENDAR_VIEW_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), E_TYPE_CALENDAR_VIEW, ECalendarViewPrivate)) @@ -875,7 +878,7 @@ e_calendar_view_class_init (ECalendarViewClass *class) binding_set = gtk_binding_set_by_class (class); gtk_binding_entry_add_signal ( - binding_set, GDK_o, GDK_CONTROL_MASK, "open-event", 0); + binding_set, GDK_KEY_o, GDK_CONTROL_MASK, "open-event", 0); /* init the accessibility support for e_day_view */ e_cal_view_a11y_init (); diff --git a/calendar/gui/e-day-view-main-item.c b/calendar/gui/e-day-view-main-item.c index 7914fc06b5..148843b397 100644 --- a/calendar/gui/e-day-view-main-item.c +++ b/calendar/gui/e-day-view-main-item.c @@ -41,6 +41,7 @@ #include "comp-util.h" #include "calendar-config.h" +/* backward-compatibility cruft */ #include "e-util/gtk-compat.h" #define E_DAY_VIEW_MAIN_ITEM_GET_PRIVATE(obj) \ diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index b685210a6e..25527765e1 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -62,6 +62,9 @@ #include "misc.h" #include <e-util/e-icon-factory.h> +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + /* The minimum amount of space wanted on each side of the date string. */ #define E_DAY_VIEW_DATE_X_PAD 4 @@ -5307,7 +5310,7 @@ e_day_view_do_key_press (GtkWidget *widget, GdkEventKey *event) /* The Escape key aborts a resize operation. */ if (day_view->resize_drag_pos != E_CALENDAR_VIEW_POS_NONE) { - if (keyval == GDK_Escape) { + if (keyval == GDK_KEY_Escape) { gdk_pointer_ungrab (event->time); e_day_view_abort_resize (day_view); } @@ -5318,25 +5321,25 @@ e_day_view_do_key_press (GtkWidget *widget, GdkEventKey *event) if (((event->state & GDK_SHIFT_MASK) != GDK_SHIFT_MASK) &&((event->state & GDK_CONTROL_MASK) != GDK_CONTROL_MASK) &&((event->state & GDK_MOD1_MASK) == GDK_MOD1_MASK)) { - if (keyval == GDK_Up || keyval == GDK_KP_Up) + if (keyval == GDK_KEY_Up || keyval == GDK_KEY_KP_Up) return e_day_view_event_move ((ECalendarView *) day_view, E_CAL_VIEW_MOVE_UP); - else if (keyval == GDK_Down || keyval == GDK_KP_Down) + else if (keyval == GDK_KEY_Down || keyval == GDK_KEY_KP_Down) return e_day_view_event_move ((ECalendarView *) day_view, E_CAL_VIEW_MOVE_DOWN); - else if (keyval == GDK_Left || keyval == GDK_KP_Left) + else if (keyval == GDK_KEY_Left || keyval == GDK_KEY_KP_Left) return e_day_view_event_move ((ECalendarView *) day_view, E_CAL_VIEW_MOVE_LEFT); - else if (keyval == GDK_Right || keyval == GDK_KP_Right) + else if (keyval == GDK_KEY_Right || keyval == GDK_KEY_KP_Right) return e_day_view_event_move ((ECalendarView *) day_view, E_CAL_VIEW_MOVE_RIGHT); } /*Go to the start/end of a work day*/ - if ((keyval == GDK_Home) + if ((keyval == GDK_KEY_Home) &&((event->state & GDK_SHIFT_MASK) != GDK_SHIFT_MASK) &&((event->state & GDK_CONTROL_MASK) != GDK_CONTROL_MASK) &&((event->state & GDK_MOD1_MASK) != GDK_MOD1_MASK)) { e_day_view_goto_start_of_work_day (day_view); return TRUE; } - if ((keyval == GDK_End) + if ((keyval == GDK_KEY_End) &&((event->state & GDK_SHIFT_MASK) != GDK_SHIFT_MASK) &&((event->state & GDK_CONTROL_MASK) != GDK_CONTROL_MASK) &&((event->state & GDK_MOD1_MASK) != GDK_MOD1_MASK)) { @@ -5345,14 +5348,14 @@ e_day_view_do_key_press (GtkWidget *widget, GdkEventKey *event) } /* In DayView, Shift+Home/End, Change the duration to the time that begins/ends the current work day */ - if ((keyval == GDK_Home) + if ((keyval == GDK_KEY_Home) &&((event->state & GDK_SHIFT_MASK) == GDK_SHIFT_MASK) &&((event->state & GDK_CONTROL_MASK) != GDK_CONTROL_MASK) &&((event->state & GDK_MOD1_MASK) != GDK_MOD1_MASK)) { e_day_view_change_duration_to_start_of_work_day (day_view); return TRUE; } - if ((keyval == GDK_End) + if ((keyval == GDK_KEY_End) &&((event->state & GDK_SHIFT_MASK) == GDK_SHIFT_MASK) &&((event->state & GDK_CONTROL_MASK) != GDK_CONTROL_MASK) &&((event->state & GDK_MOD1_MASK) != GDK_MOD1_MASK)) { @@ -5364,16 +5367,16 @@ e_day_view_do_key_press (GtkWidget *widget, GdkEventKey *event) stop_emission = TRUE; if (event->state & GDK_SHIFT_MASK) { switch (keyval) { - case GDK_Up: + case GDK_KEY_Up: e_day_view_cursor_key_up_shifted (day_view, event); break; - case GDK_Down: + case GDK_KEY_Down: e_day_view_cursor_key_down_shifted (day_view, event); break; - case GDK_Left: + case GDK_KEY_Left: e_day_view_cursor_key_left_shifted (day_view, event); break; - case GDK_Right: + case GDK_KEY_Right: e_day_view_cursor_key_right_shifted (day_view, event); break; default: @@ -5382,22 +5385,22 @@ e_day_view_do_key_press (GtkWidget *widget, GdkEventKey *event) } } else if (!(event->state & GDK_MOD1_MASK)) { switch (keyval) { - case GDK_Up: + case GDK_KEY_Up: e_day_view_cursor_key_up (day_view, event); break; - case GDK_Down: + case GDK_KEY_Down: e_day_view_cursor_key_down (day_view, event); break; - case GDK_Left: + case GDK_KEY_Left: e_day_view_cursor_key_left (day_view, event); break; - case GDK_Right: + case GDK_KEY_Right: e_day_view_cursor_key_right (day_view, event); break; - case GDK_Page_Up: + case GDK_KEY_Page_Up: e_day_view_scroll (day_view, E_DAY_VIEW_PAGE_STEP); break; - case GDK_Page_Down: + case GDK_KEY_Page_Down: e_day_view_scroll (day_view, -E_DAY_VIEW_PAGE_STEP); break; default: @@ -5415,11 +5418,11 @@ e_day_view_do_key_press (GtkWidget *widget, GdkEventKey *event) /* We only want to start an edit with a return key or a simple character. */ - if ((keyval != GDK_Return) && + if ((keyval != GDK_KEY_Return) && (((keyval >= 0x20) && (keyval <= 0xFF) && (event->state & (GDK_CONTROL_MASK | GDK_MOD1_MASK))) || (event->length == 0) - || (keyval == GDK_Tab))) { + || (keyval == GDK_KEY_Tab))) { return FALSE; } @@ -6285,7 +6288,7 @@ e_day_view_on_text_item_event (GnomeCanvasItem *item, switch (event->type) { case GDK_KEY_PRESS: tooltip_destroy (day_view, item); - if (!E_TEXT (item)->preedit_len && event && event->key.keyval == GDK_Return) { + if (!E_TEXT (item)->preedit_len && event && event->key.keyval == GDK_KEY_Return) { day_view->resize_event_num = -1; /* We set the keyboard focus to the EDayView, so the @@ -6296,19 +6299,19 @@ e_day_view_on_text_item_event (GnomeCanvasItem *item, other events getting to the EText item. */ g_signal_stop_emission_by_name (item, "event"); return TRUE; - } else if (event->key.keyval == GDK_Escape) { + } else if (event->key.keyval == GDK_KEY_Escape) { cancel_editing (day_view); g_signal_stop_emission_by_name (item, "event"); /* focus should go to day view when stop editing */ gtk_widget_grab_focus (GTK_WIDGET (day_view)); return TRUE; - } else if ((event->key.keyval == GDK_Up) + } else if ((event->key.keyval == GDK_KEY_Up) && (event->key.state & GDK_SHIFT_MASK) && (event->key.state & GDK_CONTROL_MASK) && !(event->key.state & GDK_MOD1_MASK)) { e_day_view_change_event_end_time_up (day_view); return TRUE; - } else if ((event->key.keyval == GDK_Down) + } else if ((event->key.keyval == GDK_KEY_Down) && (event->key.state & GDK_SHIFT_MASK) && (event->key.state & GDK_CONTROL_MASK) && !(event->key.state & GDK_MOD1_MASK)) { diff --git a/calendar/gui/e-week-view-event-item.c b/calendar/gui/e-week-view-event-item.c index 926bd1fe95..f2b3471e66 100644 --- a/calendar/gui/e-week-view-event-item.c +++ b/calendar/gui/e-week-view-event-item.c @@ -40,6 +40,7 @@ #include <text/e-text.h> +/* backward-compatibility cruft */ #include "e-util/gtk-compat.h" #define E_WEEK_VIEW_EVENT_ITEM_GET_PRIVATE(obj) \ diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c index 83b9fa2d59..9219548c92 100644 --- a/calendar/gui/e-week-view.c +++ b/calendar/gui/e-week-view.c @@ -65,6 +65,9 @@ /* Images */ #include "art/jump.xpm" +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + #define E_WEEK_VIEW_SMALL_FONT_PTSIZE 7 #define E_WEEK_VIEW_JUMP_BUTTON_WIDTH 16 @@ -3497,7 +3500,7 @@ e_week_view_on_text_item_event (GnomeCanvasItem *item, switch (gdkevent->type) { case GDK_KEY_PRESS: tooltip_destroy (week_view, item); - if (!E_TEXT (item)->preedit_len && gdkevent && gdkevent->key.keyval == GDK_Return) { + if (!E_TEXT (item)->preedit_len && gdkevent && gdkevent->key.keyval == GDK_KEY_Return) { /* We set the keyboard focus to the EDayView, so the EText item loses it and stops the edit. */ gtk_widget_grab_focus (GTK_WIDGET (week_view)); @@ -3506,7 +3509,7 @@ e_week_view_on_text_item_event (GnomeCanvasItem *item, other events getting to the EText item. */ g_signal_stop_emission_by_name (GTK_OBJECT (item), "event"); return TRUE; - } else if (gdkevent->key.keyval == GDK_Escape) { + } else if (gdkevent->key.keyval == GDK_KEY_Escape) { cancel_editing (week_view); g_signal_stop_emission_by_name (GTK_OBJECT (item), "event"); /* focus should go to week view when stop editing */ @@ -4368,7 +4371,7 @@ e_week_view_do_key_press (GtkWidget *widget, GdkEventKey *event) /* The Escape key aborts a resize operation. */ #if 0 if (week_view->resize_drag_pos != E_CALENDAR_VIEW_POS_NONE) { - if (event->keyval == GDK_Escape) { + if (event->keyval == GDK_KEY_Escape) { e_week_view_abort_resize (week_view, event->time); } return FALSE; @@ -4381,28 +4384,28 @@ e_week_view_do_key_press (GtkWidget *widget, GdkEventKey *event) && !(event->state & GDK_MOD1_MASK)) { stop_emission = TRUE; switch (keyval) { - case GDK_Page_Up: + case GDK_KEY_Page_Up: if (!week_view->multi_week_view) e_week_view_scroll_a_step (week_view, E_CAL_VIEW_MOVE_UP); else e_week_view_scroll_a_step (week_view, E_CAL_VIEW_MOVE_PAGE_UP); break; - case GDK_Page_Down: + case GDK_KEY_Page_Down: if (!week_view->multi_week_view) e_week_view_scroll_a_step (week_view, E_CAL_VIEW_MOVE_DOWN); else e_week_view_scroll_a_step (week_view, E_CAL_VIEW_MOVE_PAGE_DOWN); break; - case GDK_Up: + case GDK_KEY_Up: e_week_view_cursor_key_up (week_view); break; - case GDK_Down: + case GDK_KEY_Down: e_week_view_cursor_key_down (week_view); break; - case GDK_Left: + case GDK_KEY_Left: e_week_view_cursor_key_left (week_view); break; - case GDK_Right: + case GDK_KEY_Right: e_week_view_cursor_key_right (week_view); break; default: @@ -4417,13 +4420,13 @@ e_week_view_do_key_press (GtkWidget *widget, GdkEventKey *event) if (((event->state & GDK_SHIFT_MASK) != GDK_SHIFT_MASK) &&((event->state & GDK_CONTROL_MASK) != GDK_CONTROL_MASK) &&((event->state & GDK_MOD1_MASK) == GDK_MOD1_MASK)) { - if (keyval == GDK_Up || keyval == GDK_KP_Up) + if (keyval == GDK_KEY_Up || keyval == GDK_KEY_KP_Up) return e_week_view_event_move ((ECalendarView *) week_view, E_CAL_VIEW_MOVE_UP); - else if (keyval == GDK_Down || keyval == GDK_KP_Down) + else if (keyval == GDK_KEY_Down || keyval == GDK_KEY_KP_Down) return e_week_view_event_move ((ECalendarView *) week_view, E_CAL_VIEW_MOVE_DOWN); - else if (keyval == GDK_Left || keyval == GDK_KP_Left) + else if (keyval == GDK_KEY_Left || keyval == GDK_KEY_KP_Left) return e_week_view_event_move ((ECalendarView *) week_view, E_CAL_VIEW_MOVE_LEFT); - else if (keyval == GDK_Right || keyval == GDK_KP_Right) + else if (keyval == GDK_KEY_Right || keyval == GDK_KEY_KP_Right) return e_week_view_event_move ((ECalendarView *) week_view, E_CAL_VIEW_MOVE_RIGHT); } @@ -4432,12 +4435,12 @@ e_week_view_do_key_press (GtkWidget *widget, GdkEventKey *event) /* We only want to start an edit with a return key or a simple character. */ - if (event->keyval == GDK_Return) { + if (event->keyval == GDK_KEY_Return) { initial_text = NULL; } else if (((event->keyval >= 0x20) && (event->keyval <= 0xFF) && (event->state & (GDK_CONTROL_MASK | GDK_MOD1_MASK))) || (event->length == 0) - || (event->keyval == GDK_Tab)) { + || (event->keyval == GDK_KEY_Tab)) { return FALSE; } else initial_text = e_utf8_from_gtk_event_key (widget, event->keyval, event->string); @@ -4544,13 +4547,13 @@ e_week_view_on_jump_button_event (GnomeCanvasItem *item, } else if (event->type == GDK_KEY_PRESS) { /* return, if Tab, Control or Alt is pressed */ - if ((event->key.keyval == GDK_Tab) || + if ((event->key.keyval == GDK_KEY_Tab) || (event->key.state & (GDK_CONTROL_MASK | GDK_MOD1_MASK))) return FALSE; /* with a return key or a simple character (from 0x20 to 0xff), * jump to the day */ - if ((event->key.keyval == GDK_Return) || + if ((event->key.keyval == GDK_KEY_Return) || ((event->key.keyval >= 0x20) && (event->key.keyval <= 0xFF))) { e_week_view_jump_to_button_item (week_view, item); diff --git a/calendar/gui/ea-cal-view.c b/calendar/gui/ea-cal-view.c index 08dba44340..0d942f4a94 100644 --- a/calendar/gui/ea-cal-view.c +++ b/calendar/gui/ea-cal-view.c @@ -28,6 +28,7 @@ #include <glib.h> #include <glib/gi18n.h> +/* backward-compatibility cruft */ #include <e-util/gtk-compat.h> static void ea_cal_view_class_init (EaCalViewClass *klass); diff --git a/calendar/gui/ea-day-view.c b/calendar/gui/ea-day-view.c index e34eaa6366..2a972847c1 100644 --- a/calendar/gui/ea-day-view.c +++ b/calendar/gui/ea-day-view.c @@ -28,6 +28,7 @@ #include <glib.h> #include <glib/gi18n.h> +/* backward-compatibility cruft */ #include <e-util/gtk-compat.h> static void ea_day_view_class_init (EaDayViewClass *klass); diff --git a/calendar/gui/ea-gnome-calendar.c b/calendar/gui/ea-gnome-calendar.c index e7492a07ee..88c288c84d 100644 --- a/calendar/gui/ea-gnome-calendar.c +++ b/calendar/gui/ea-gnome-calendar.c @@ -29,6 +29,7 @@ #include <libedataserver/e-data-server-util.h> #include <glib/gi18n.h> +/* backward-compatibility cruft */ #include <e-util/gtk-compat.h> static void ea_gnome_calendar_class_init (EaGnomeCalendarClass *klass); diff --git a/calendar/gui/ea-week-view.c b/calendar/gui/ea-week-view.c index e34894f9ce..c598c4289f 100644 --- a/calendar/gui/ea-week-view.c +++ b/calendar/gui/ea-week-view.c @@ -27,6 +27,7 @@ #include <text/e-text.h> #include <glib/gi18n.h> +/* backward-compatibility cruft */ #include <e-util/gtk-compat.h> static void ea_week_view_class_init (EaWeekViewClass *klass); diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index 8feaa3f850..985c47857b 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -69,6 +69,9 @@ #include "e-memo-table.h" #include "e-task-table.h" +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + #define d(x) /* hash table define for non intrusive error dialog */ @@ -628,66 +631,66 @@ gnome_calendar_class_init (GnomeCalendarClass *class) binding_set = gtk_binding_set_new (G_OBJECT_CLASS_NAME (class)); /* Alt+PageUp/PageDown, go to the first/last day of the month */ - gtk_binding_entry_add_signal (binding_set, GDK_Page_Up, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Page_Up, GDK_MOD1_MASK, "goto_date", 1, G_TYPE_ENUM, GNOME_CAL_GOTO_FIRST_DAY_OF_MONTH); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Page_Up, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Page_Up, GDK_MOD1_MASK, "goto_date", 1, G_TYPE_ENUM, GNOME_CAL_GOTO_FIRST_DAY_OF_MONTH); - gtk_binding_entry_add_signal (binding_set, GDK_Page_Down, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Page_Down, GDK_MOD1_MASK, "goto_date", 1, G_TYPE_ENUM, GNOME_CAL_GOTO_LAST_DAY_OF_MONTH); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Page_Down, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Page_Down, GDK_MOD1_MASK, "goto_date", 1, G_TYPE_ENUM, GNOME_CAL_GOTO_LAST_DAY_OF_MONTH); /* Alt+Home/End, go to the first/last day of the week */ - gtk_binding_entry_add_signal (binding_set, GDK_Home, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Home, GDK_MOD1_MASK, "goto_date", 1, G_TYPE_ENUM, GNOME_CAL_GOTO_FIRST_DAY_OF_WEEK); - gtk_binding_entry_add_signal (binding_set, GDK_End, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_End, GDK_MOD1_MASK, "goto_date", 1, G_TYPE_ENUM, GNOME_CAL_GOTO_LAST_DAY_OF_WEEK); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Home, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Home, GDK_MOD1_MASK, "goto_date", 1, G_TYPE_ENUM, GNOME_CAL_GOTO_FIRST_DAY_OF_WEEK); - gtk_binding_entry_add_signal (binding_set, GDK_KP_End, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_End, GDK_MOD1_MASK, "goto_date", 1, G_TYPE_ENUM, GNOME_CAL_GOTO_LAST_DAY_OF_WEEK); /*Alt+Left/Right, go to the same day of the previous/next week*/ - gtk_binding_entry_add_signal (binding_set,GDK_Left, + gtk_binding_entry_add_signal (binding_set,GDK_KEY_Left, GDK_MOD1_MASK, "goto_date",1, G_TYPE_ENUM, GNOME_CAL_GOTO_SAME_DAY_OF_PREVIOUS_WEEK); - gtk_binding_entry_add_signal (binding_set,GDK_KP_Left, + gtk_binding_entry_add_signal (binding_set,GDK_KEY_KP_Left, GDK_MOD1_MASK, "goto_date",1, G_TYPE_ENUM, GNOME_CAL_GOTO_SAME_DAY_OF_PREVIOUS_WEEK); - gtk_binding_entry_add_signal (binding_set,GDK_Right, + gtk_binding_entry_add_signal (binding_set,GDK_KEY_Right, GDK_MOD1_MASK, "goto_date",1, G_TYPE_ENUM, GNOME_CAL_GOTO_SAME_DAY_OF_NEXT_WEEK); - gtk_binding_entry_add_signal (binding_set,GDK_KP_Right, + gtk_binding_entry_add_signal (binding_set,GDK_KEY_KP_Right, GDK_MOD1_MASK, "goto_date",1, G_TYPE_ENUM, @@ -695,27 +698,27 @@ gnome_calendar_class_init (GnomeCalendarClass *class) /* Ctrl+Y/J/K/M/L to switch between * DayView/WorkWeekView/WeekView/MonthView/ListView */ - gtk_binding_entry_add_signal (binding_set, GDK_y, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_y, GDK_CONTROL_MASK, "change_view", 1, G_TYPE_ENUM, GNOME_CAL_DAY_VIEW); - gtk_binding_entry_add_signal (binding_set, GDK_j, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_j, GDK_CONTROL_MASK, "change_view", 1, G_TYPE_ENUM, GNOME_CAL_WORK_WEEK_VIEW); - gtk_binding_entry_add_signal (binding_set, GDK_k, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_k, GDK_CONTROL_MASK, "change_view", 1, G_TYPE_ENUM, GNOME_CAL_WEEK_VIEW); - gtk_binding_entry_add_signal (binding_set, GDK_m, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_m, GDK_CONTROL_MASK, "change_view", 1, G_TYPE_ENUM, GNOME_CAL_MONTH_VIEW); - gtk_binding_entry_add_signal (binding_set, GDK_l, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_l, GDK_CONTROL_MASK, "change_view", 1, G_TYPE_ENUM, diff --git a/calendar/gui/weekday-picker.c b/calendar/gui/weekday-picker.c index 699bfb21b9..025c9df1ea 100644 --- a/calendar/gui/weekday-picker.c +++ b/calendar/gui/weekday-picker.c @@ -35,7 +35,8 @@ #include <e-util/e-util.h> #include "weekday-picker.h" - +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" #define PADDING 2 @@ -393,16 +394,16 @@ handle_key_press_event (WeekdayPicker *wp, GdkEvent *event) priv->focus_day = priv->week_start_day; switch (keyval) { - case GDK_Up: - case GDK_Right: + case GDK_KEY_Up: + case GDK_KEY_Right: priv->focus_day += 1; break; - case GDK_Down: - case GDK_Left: + case GDK_KEY_Down: + case GDK_KEY_Left: priv->focus_day -= 1; break; - case GDK_space: - case GDK_Return: + case GDK_KEY_space: + case GDK_KEY_Return: day_clicked (wp, priv->focus_day); return TRUE; default: diff --git a/capplet/settings/mail-capplet-shell.c b/capplet/settings/mail-capplet-shell.c index 8038f413ed..63f8625caa 100644 --- a/capplet/settings/mail-capplet-shell.c +++ b/capplet/settings/mail-capplet-shell.c @@ -42,6 +42,9 @@ #include <mail/mail-mt.h> #include <mail/e-mail-store.h> +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + enum { CTRL_W_PRESSED, CTRL_Q_PRESSED, @@ -141,10 +144,10 @@ mail_capplet_shell_class_init (MailCappletShellClass *klass) G_TYPE_NONE, 0); binding_set = gtk_binding_set_by_class (klass); - gtk_binding_entry_add_signal (binding_set, GDK_W, GDK_CONTROL_MASK, "ctrl_w_pressed", 0); - gtk_binding_entry_add_signal (binding_set, GDK_w, GDK_CONTROL_MASK, "ctrl_w_pressed", 0); - gtk_binding_entry_add_signal (binding_set, GDK_Q, GDK_CONTROL_MASK, "ctrl_q_pressed", 0); - gtk_binding_entry_add_signal (binding_set, GDK_Q, GDK_CONTROL_MASK, "ctrl_q_pressed", 0); + gtk_binding_entry_add_signal (binding_set, GDK_KEY_W, GDK_CONTROL_MASK, "ctrl_w_pressed", 0); + gtk_binding_entry_add_signal (binding_set, GDK_KEY_w, GDK_CONTROL_MASK, "ctrl_w_pressed", 0); + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Q, GDK_CONTROL_MASK, "ctrl_q_pressed", 0); + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Q, GDK_CONTROL_MASK, "ctrl_q_pressed", 0); }; diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index 480bfbe3bd..9f9aac9e19 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -67,6 +67,9 @@ #include <X11/XF86keysym.h> #endif +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + #define d(x) #define E_MSG_COMPOSER_GET_PRIVATE(obj) \ @@ -2008,17 +2011,17 @@ msg_composer_key_press_event (GtkWidget *widget, } #endif /* HAVE_XFREE */ - if (event->keyval == GDK_Escape) { + if (event->keyval == GDK_KEY_Escape) { gtk_action_activate (ACTION (CLOSE)); return TRUE; } - if (event->keyval == GDK_Tab && gtk_widget_is_focus (input_widget)) { + if (event->keyval == GDK_KEY_Tab && gtk_widget_is_focus (input_widget)) { gtkhtml_editor_run_command (editor, "grab-focus"); return TRUE; } - if (event->keyval == GDK_ISO_Left_Tab && + if (event->keyval == GDK_KEY_ISO_Left_Tab && gtk_widget_is_focus (GTK_WIDGET (html))) { gtk_widget_grab_focus (input_widget); return TRUE; diff --git a/e-util/e-text-event-processor-emacs-like.c b/e-util/e-text-event-processor-emacs-like.c index b5febfa89d..3851590f0f 100644 --- a/e-util/e-text-event-processor-emacs-like.c +++ b/e-util/e-text-event-processor-emacs-like.c @@ -29,6 +29,9 @@ #include "e-text-event-processor-emacs-like.h" #include "e-util.h" +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + static gint e_text_event_processor_emacs_like_event (ETextEventProcessor *tep, ETextEventProcessorEvent *event); @@ -200,60 +203,60 @@ e_text_event_processor_emacs_like_event (ETextEventProcessor *tep, else command.action = E_TEP_MOVE; switch (key.keyval) { - case GDK_Home: - case GDK_KP_Home: + case GDK_KEY_Home: + case GDK_KEY_KP_Home: if (key.state & GDK_CONTROL_MASK) command.position = E_TEP_START_OF_BUFFER; else command.position = E_TEP_START_OF_LINE; break; - case GDK_End: - case GDK_KP_End: + case GDK_KEY_End: + case GDK_KEY_KP_End: if (key.state & GDK_CONTROL_MASK) command.position = E_TEP_END_OF_BUFFER; else command.position = E_TEP_END_OF_LINE; break; - case GDK_Page_Up: - case GDK_KP_Page_Up: command.position = E_TEP_BACKWARD_PAGE; break; + case GDK_KEY_Page_Up: + case GDK_KEY_KP_Page_Up: command.position = E_TEP_BACKWARD_PAGE; break; - case GDK_Page_Down: - case GDK_KP_Page_Down: command.position = E_TEP_FORWARD_PAGE; break; + case GDK_KEY_Page_Down: + case GDK_KEY_KP_Page_Down: command.position = E_TEP_FORWARD_PAGE; break; /* CUA has Ctrl-Up/Ctrl-Down as paragraph up down */ - case GDK_Up: - case GDK_KP_Up: command.position = E_TEP_BACKWARD_LINE; break; + case GDK_KEY_Up: + case GDK_KEY_KP_Up: command.position = E_TEP_BACKWARD_LINE; break; - case GDK_Down: - case GDK_KP_Down: command.position = E_TEP_FORWARD_LINE; break; + case GDK_KEY_Down: + case GDK_KEY_KP_Down: command.position = E_TEP_FORWARD_LINE; break; - case GDK_Left: - case GDK_KP_Left: + case GDK_KEY_Left: + case GDK_KEY_KP_Left: if (key.state & GDK_CONTROL_MASK) command.position = E_TEP_BACKWARD_WORD; else command.position = E_TEP_BACKWARD_CHARACTER; break; - case GDK_Right: - case GDK_KP_Right: + case GDK_KEY_Right: + case GDK_KEY_KP_Right: if (key.state & GDK_CONTROL_MASK) command.position = E_TEP_FORWARD_WORD; else command.position = E_TEP_FORWARD_CHARACTER; break; - case GDK_BackSpace: + case GDK_KEY_BackSpace: command.action = E_TEP_DELETE; if (key.state & GDK_CONTROL_MASK) command.position = E_TEP_BACKWARD_WORD; else command.position = E_TEP_BACKWARD_CHARACTER; break; - case GDK_Clear: + case GDK_KEY_Clear: command.action = E_TEP_DELETE; command.position = E_TEP_END_OF_LINE; break; - case GDK_Insert: - case GDK_KP_Insert: + case GDK_KEY_Insert: + case GDK_KEY_KP_Insert: if (key.state & GDK_SHIFT_MASK) { command.action = E_TEP_PASTE; command.position = E_TEP_SELECTION; @@ -264,15 +267,15 @@ e_text_event_processor_emacs_like_event (ETextEventProcessor *tep, /* gtk_toggle_insert(text) -- IMPLEMENT -- FIXME */ } break; - case GDK_F16: + case GDK_KEY_F16: command.action = E_TEP_COPY; command.position = E_TEP_SELECTION; break; - case GDK_F18: + case GDK_KEY_F18: command.action = E_TEP_PASTE; command.position = E_TEP_SELECTION; break; - case GDK_F20: + case GDK_KEY_F20: command.action = E_TEP_COPY; command.position = E_TEP_SELECTION; g_signal_emit_by_name (tep, "command", &command); @@ -280,8 +283,8 @@ e_text_event_processor_emacs_like_event (ETextEventProcessor *tep, command.action = E_TEP_DELETE; command.position = E_TEP_SELECTION; break; - case GDK_Delete: - case GDK_KP_Delete: + case GDK_KEY_Delete: + case GDK_KEY_KP_Delete: if (key.state & GDK_CONTROL_MASK) { command.action = E_TEP_DELETE; command.position = E_TEP_FORWARD_WORD; @@ -297,16 +300,16 @@ e_text_event_processor_emacs_like_event (ETextEventProcessor *tep, command.position = E_TEP_FORWARD_CHARACTER; } break; - case GDK_Tab: - case GDK_KP_Tab: - case GDK_ISO_Left_Tab: - case GDK_3270_BackTab: + case GDK_KEY_Tab: + case GDK_KEY_KP_Tab: + case GDK_KEY_ISO_Left_Tab: + case GDK_KEY_3270_BackTab: /* Don't insert literally */ command.action = E_TEP_NOP; command.position = E_TEP_SELECTION; break; - case GDK_Return: - case GDK_KP_Enter: + case GDK_KEY_Return: + case GDK_KEY_KP_Enter: if (tep->allow_newlines) { if (key.state & GDK_CONTROL_MASK) { command.action = E_TEP_ACTIVATE; @@ -327,109 +330,109 @@ e_text_event_processor_emacs_like_event (ETextEventProcessor *tep, } } break; - case GDK_Escape: + case GDK_KEY_Escape: /* Don't insert literally */ command.action = E_TEP_NOP; command.position = E_TEP_SELECTION; break; - case GDK_KP_Space: + case GDK_KEY_KP_Space: command.action = E_TEP_INSERT; command.position = E_TEP_SELECTION; command.value = 1; command.string = " "; break; - case GDK_KP_Equal: + case GDK_KEY_KP_Equal: command.action = E_TEP_INSERT; command.position = E_TEP_SELECTION; command.value = 1; command.string = "="; break; - case GDK_KP_Multiply: + case GDK_KEY_KP_Multiply: command.action = E_TEP_INSERT; command.position = E_TEP_SELECTION; command.value = 1; command.string = "*"; break; - case GDK_KP_Add: + case GDK_KEY_KP_Add: command.action = E_TEP_INSERT; command.position = E_TEP_SELECTION; command.value = 1; command.string = "+"; break; - case GDK_KP_Subtract: + case GDK_KEY_KP_Subtract: command.action = E_TEP_INSERT; command.position = E_TEP_SELECTION; command.value = 1; command.string = "-"; break; - case GDK_KP_Decimal: + case GDK_KEY_KP_Decimal: command.action = E_TEP_INSERT; command.position = E_TEP_SELECTION; command.value = 1; command.string = "."; break; - case GDK_KP_Divide: + case GDK_KEY_KP_Divide: command.action = E_TEP_INSERT; command.position = E_TEP_SELECTION; command.value = 1; command.string = "/"; break; - case GDK_KP_0: + case GDK_KEY_KP_0: command.action = E_TEP_INSERT; command.position = E_TEP_SELECTION; command.value = 1; command.string = "0"; break; - case GDK_KP_1: + case GDK_KEY_KP_1: command.action = E_TEP_INSERT; command.position = E_TEP_SELECTION; command.value = 1; command.string = "1"; break; - case GDK_KP_2: + case GDK_KEY_KP_2: command.action = E_TEP_INSERT; command.position = E_TEP_SELECTION; command.value = 1; command.string = "2"; break; - case GDK_KP_3: + case GDK_KEY_KP_3: command.action = E_TEP_INSERT; command.position = E_TEP_SELECTION; command.value = 1; command.string = "3"; break; - case GDK_KP_4: + case GDK_KEY_KP_4: command.action = E_TEP_INSERT; command.position = E_TEP_SELECTION; command.value = 1; command.string = "4"; break; - case GDK_KP_5: + case GDK_KEY_KP_5: command.action = E_TEP_INSERT; command.position = E_TEP_SELECTION; command.value = 1; command.string = "5"; break; - case GDK_KP_6: + case GDK_KEY_KP_6: command.action = E_TEP_INSERT; command.position = E_TEP_SELECTION; command.value = 1; command.string = "6"; break; - case GDK_KP_7: + case GDK_KEY_KP_7: command.action = E_TEP_INSERT; command.position = E_TEP_SELECTION; command.value = 1; command.string = "7"; break; - case GDK_KP_8: + case GDK_KEY_KP_8: command.action = E_TEP_INSERT; command.position = E_TEP_SELECTION; command.value = 1; command.string = "8"; break; - case GDK_KP_9: + case GDK_KEY_KP_9: command.action = E_TEP_INSERT; command.position = E_TEP_SELECTION; command.value = 1; @@ -477,7 +480,7 @@ e_text_event_processor_emacs_like_event (ETextEventProcessor *tep, } else if (!(key.state & GDK_MOD1_MASK) && !(key.state & GDK_CONTROL_MASK) && key.length > 0) { - if (key.keyval >= GDK_KP_0 && key.keyval <= GDK_KP_9) { + if (key.keyval >= GDK_KEY_KP_0 && key.keyval <= GDK_KEY_KP_9) { key.keyval = '0'; key.string = "0"; } diff --git a/e-util/e-unicode.c b/e-util/e-unicode.c index 9d610bc5d8..59e94aa25e 100644 --- a/e-util/e-unicode.c +++ b/e-util/e-unicode.c @@ -39,6 +39,9 @@ #include <glib/gi18n.h> #include "e-unicode.h" +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + #define d(x) #define FONT_TESTING @@ -53,7 +56,7 @@ e_utf8_from_gtk_event_key (GtkWidget *widget, guint keyval, const gchar *string) gchar *utf; gint unilen; - if (keyval == GDK_VoidSymbol) { + if (keyval == GDK_KEY_VoidSymbol) { utf = e_utf8_from_locale_string_sized (string, strlen (string)); } else { unival = gdk_keyval_to_unicode (keyval); diff --git a/e-util/gtk-compat.h b/e-util/gtk-compat.h index 0bad301e69..0635fd5246 100644 --- a/e-util/gtk-compat.h +++ b/e-util/gtk-compat.h @@ -3,9 +3,165 @@ #include <gtk/gtk.h> -/* Provide a compatibility layer for accessor functions introduced - * in GTK+ 2.21.1 which we need to build with sealed GDK. That way it - * is still possible to build with GTK+ 2.20. */ +/* Provide a GTK+ compatibility layer. */ + +#if !GTK_CHECK_VERSION (2,21,8) + +#define GDK_KEY_3270_BackTab GDK_3270_BackTab +#define GDK_KEY_3270_Enter GDK_3270_Enter +#define GDK_KEY_BackSpace GDK_BackSpace +#define GDK_KEY_Caps_Lock GDK_Caps_Lock +#define GDK_KEY_Clear GDK_Clear +#define GDK_KEY_Delete GDK_Delete +#define GDK_KEY_Down GDK_Down +#define GDK_KEY_End GDK_End +#define GDK_KEY_Escape GDK_Escape +#define GDK_KEY_Home GDK_Home +#define GDK_KEY_ISO_Enter GDK_ISO_Enter +#define GDK_KEY_ISO_Left_Tab GDK_ISO_Left_Tab +#define GDK_KEY_ISO_Lock GDK_ISO_Lock +#define GDK_KEY_Insert GDK_Insert +#define GDK_KEY_Left GDK_Left +#define GDK_KEY_Page_Down GDK_Page_Down +#define GDK_KEY_Page_Up GDK_Page_Up +#define GDK_KEY_Return GDK_Return +#define GDK_KEY_Right GDK_Right +#define GDK_KEY_Scroll_Lock GDK_Scroll_Lock +#define GDK_KEY_Shift_Lock GDK_Shift_Lock +#define GDK_KEY_Sys_Req GDK_Sys_Req +#define GDK_KEY_Tab GDK_Tab +#define GDK_KEY_Up GDK_Up +#define GDK_KEY_VoidSymbol GDK_VoidSymbol +#define GDK_KEY_backslash GDK_backslash +#define GDK_KEY_bracketleft GDK_bracketleft +#define GDK_KEY_bracketright GDK_bracketright +#define GDK_KEY_comma GDK_comma +#define GDK_KEY_equal GDK_equal +#define GDK_KEY_exclam GDK_exclam +#define GDK_KEY_minus GDK_minus +#define GDK_KEY_period GDK_period +#define GDK_KEY_plus GDK_plus +#define GDK_KEY_space GDK_space +#define GDK_KEY_underscore GDK_underscore + +#define GDK_KEY_KP_0 GDK_KP_0 +#define GDK_KEY_KP_1 GDK_KP_1 +#define GDK_KEY_KP_2 GDK_KP_2 +#define GDK_KEY_KP_3 GDK_KP_3 +#define GDK_KEY_KP_4 GDK_KP_4 +#define GDK_KEY_KP_5 GDK_KP_5 +#define GDK_KEY_KP_6 GDK_KP_6 +#define GDK_KEY_KP_7 GDK_KP_7 +#define GDK_KEY_KP_8 GDK_KP_8 +#define GDK_KEY_KP_9 GDK_KP_9 +#define GDK_KEY_KP_Add GDK_KP_Add +#define GDK_KEY_KP_Decimal GDK_KP_Decimal +#define GDK_KEY_KP_Delete GDK_KP_Delete +#define GDK_KEY_KP_Divide GDK_KP_Divide +#define GDK_KEY_KP_Down GDK_KP_Down +#define GDK_KEY_KP_End GDK_KP_End +#define GDK_KEY_KP_Enter GDK_KP_Enter +#define GDK_KEY_KP_Equal GDK_KP_Equal +#define GDK_KEY_KP_Home GDK_KP_Home +#define GDK_KEY_KP_Insert GDK_KP_Insert +#define GDK_KEY_KP_Left GDK_KP_Left +#define GDK_KEY_KP_Multiply GDK_KP_Multiply +#define GDK_KEY_KP_Page_Down GDK_KP_Page_Down +#define GDK_KEY_KP_Page_Up GDK_KP_Page_Up +#define GDK_KEY_KP_Right GDK_KP_Right +#define GDK_KEY_KP_Space GDK_KP_Space +#define GDK_KEY_KP_Subtract GDK_KP_Subtract +#define GDK_KEY_KP_Tab GDK_KP_Tab +#define GDK_KEY_KP_Up GDK_KP_Up + +#define GDK_KEY_0 GDK_0 +#define GDK_KEY_1 GDK_1 +#define GDK_KEY_2 GDK_2 +#define GDK_KEY_3 GDK_3 +#define GDK_KEY_4 GDK_4 +#define GDK_KEY_5 GDK_5 +#define GDK_KEY_6 GDK_6 +#define GDK_KEY_7 GDK_7 +#define GDK_KEY_8 GDK_8 +#define GDK_KEY_9 GDK_9 +#define GDK_KEY_a GDK_a +#define GDK_KEY_b GDK_b +#define GDK_KEY_c GDK_c +#define GDK_KEY_d GDK_d +#define GDK_KEY_e GDK_e +#define GDK_KEY_f GDK_f +#define GDK_KEY_g GDK_g +#define GDK_KEY_h GDK_h +#define GDK_KEY_i GDK_i +#define GDK_KEY_j GDK_j +#define GDK_KEY_k GDK_k +#define GDK_KEY_l GDK_l +#define GDK_KEY_m GDK_m +#define GDK_KEY_n GDK_n +#define GDK_KEY_o GDK_o +#define GDK_KEY_p GDK_p +#define GDK_KEY_q GDK_q +#define GDK_KEY_r GDK_r +#define GDK_KEY_s GDK_s +#define GDK_KEY_t GDK_t +#define GDK_KEY_u GDK_u +#define GDK_KEY_v GDK_v +#define GDK_KEY_w GDK_w +#define GDK_KEY_x GDK_x +#define GDK_KEY_y GDK_y +#define GDK_KEY_z GDK_z +#define GDK_KEY_A GDK_A +#define GDK_KEY_B GDK_B +#define GDK_KEY_C GDK_C +#define GDK_KEY_D GDK_D +#define GDK_KEY_E GDK_E +#define GDK_KEY_F GDK_F +#define GDK_KEY_G GDK_G +#define GDK_KEY_H GDK_H +#define GDK_KEY_I GDK_I +#define GDK_KEY_J GDK_J +#define GDK_KEY_K GDK_K +#define GDK_KEY_L GDK_L +#define GDK_KEY_M GDK_M +#define GDK_KEY_N GDK_N +#define GDK_KEY_O GDK_O +#define GDK_KEY_P GDK_P +#define GDK_KEY_Q GDK_Q +#define GDK_KEY_R GDK_R +#define GDK_KEY_S GDK_S +#define GDK_KEY_T GDK_T +#define GDK_KEY_U GDK_U +#define GDK_KEY_V GDK_V +#define GDK_KEY_W GDK_W +#define GDK_KEY_X GDK_X +#define GDK_KEY_Y GDK_Y +#define GDK_KEY_Z GDK_Z + +#define GDK_KEY_F10 GDK_F10 +#define GDK_KEY_F14 GDK_F14 +#define GDK_KEY_F16 GDK_F16 +#define GDK_KEY_F18 GDK_F18 +#define GDK_KEY_F20 GDK_F20 + +#define GDK_KEY_Alt_L GDK_Alt_L +#define GDK_KEY_Alt_R GDK_Alt_R + +#define GDK_KEY_Control_L GDK_Control_L +#define GDK_KEY_Control_R GDK_Control_R + +#define GDK_KEY_Hyper_L GDK_Hyper_L +#define GDK_KEY_Hyper_R GDK_Hyper_R + +#define GDK_KEY_Meta_L GDK_Meta_L +#define GDK_KEY_Meta_R GDK_Meta_R + +#define GDK_KEY_Shift_L GDK_Shift_L +#define GDK_KEY_Shift_R GDK_Shift_R + +#define GDK_KEY_Super_L GDK_Super_L +#define GDK_KEY_Super_R GDK_Super_R + +#endif #if (GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION < 21) \ || (GTK_MINOR_VERSION == 21 && GTK_MICRO_VERSION < 1) diff --git a/libgnomecanvas/gailcanvas.c b/libgnomecanvas/gailcanvas.c index 06fca3e5d7..6857f1222f 100644 --- a/libgnomecanvas/gailcanvas.c +++ b/libgnomecanvas/gailcanvas.c @@ -29,6 +29,7 @@ #include "gailcanvasitemfactory.h" #include "gailcanvaswidgetfactory.h" +/* backward-compatibility cruft */ #include "e-util/gtk-compat.h" static void gail_canvas_class_init (GailCanvasClass *klass); diff --git a/libgnomecanvas/gnome-canvas-rich-text.c b/libgnomecanvas/gnome-canvas-rich-text.c index f5fb080af0..8b5b2030a0 100644 --- a/libgnomecanvas/gnome-canvas-rich-text.c +++ b/libgnomecanvas/gnome-canvas-rich-text.c @@ -34,6 +34,9 @@ #include "gnome-canvas-rich-text.h" #include "gnome-canvas-i18n.h" +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + struct _GnomeCanvasRichTextPrivate { GtkTextLayout *layout; GtkTextBuffer *buffer; @@ -1000,8 +1003,8 @@ gnome_canvas_rich_text_key_press_event (GnomeCanvasItem *item, extend_selection = TRUE; switch (event->keyval) { - case GDK_Return: - case GDK_KP_Enter: + case GDK_KEY_Return: + case GDK_KEY_KP_Enter: gtk_text_buffer_delete_selection ( get_buffer (text), TRUE, text->_priv->editable); gtk_text_buffer_insert_interactive_at_cursor ( @@ -1009,14 +1012,14 @@ gnome_canvas_rich_text_key_press_event (GnomeCanvasItem *item, handled = TRUE; break; - case GDK_Tab: + case GDK_KEY_Tab: gtk_text_buffer_insert_interactive_at_cursor ( get_buffer(text), "\t", 1, text->_priv->editable); handled = TRUE; break; /* MOVEMENT */ - case GDK_Right: + case GDK_KEY_Right: if (event->state & GDK_CONTROL_MASK) { gnome_canvas_rich_text_move_cursor ( text, GTK_MOVEMENT_WORDS, 1, @@ -1030,7 +1033,7 @@ gnome_canvas_rich_text_key_press_event (GnomeCanvasItem *item, handled = TRUE; } break; - case GDK_Left: + case GDK_KEY_Left: if (event->state & GDK_CONTROL_MASK) { gnome_canvas_rich_text_move_cursor ( text, GTK_MOVEMENT_WORDS, -1, @@ -1044,7 +1047,7 @@ gnome_canvas_rich_text_key_press_event (GnomeCanvasItem *item, handled = TRUE; } break; - case GDK_f: + case GDK_KEY_f: if (event->state & GDK_CONTROL_MASK) { gnome_canvas_rich_text_move_cursor ( text, GTK_MOVEMENT_LOGICAL_POSITIONS, 1, @@ -1058,7 +1061,7 @@ gnome_canvas_rich_text_key_press_event (GnomeCanvasItem *item, handled = TRUE; } break; - case GDK_b: + case GDK_KEY_b: if (event->state & GDK_CONTROL_MASK) { gnome_canvas_rich_text_move_cursor ( text, GTK_MOVEMENT_LOGICAL_POSITIONS, -1, @@ -1072,19 +1075,19 @@ gnome_canvas_rich_text_key_press_event (GnomeCanvasItem *item, handled = TRUE; } break; - case GDK_Up: + case GDK_KEY_Up: gnome_canvas_rich_text_move_cursor ( text, GTK_MOVEMENT_DISPLAY_LINES, -1, extend_selection); handled = TRUE; break; - case GDK_Down: + case GDK_KEY_Down: gnome_canvas_rich_text_move_cursor ( text, GTK_MOVEMENT_DISPLAY_LINES, 1, extend_selection); handled = TRUE; break; - case GDK_p: + case GDK_KEY_p: if (event->state & GDK_CONTROL_MASK) { gnome_canvas_rich_text_move_cursor ( text, GTK_MOVEMENT_DISPLAY_LINES, -1, @@ -1092,7 +1095,7 @@ gnome_canvas_rich_text_key_press_event (GnomeCanvasItem *item, handled = TRUE; } break; - case GDK_n: + case GDK_KEY_n: if (event->state & GDK_CONTROL_MASK) { gnome_canvas_rich_text_move_cursor ( text, GTK_MOVEMENT_DISPLAY_LINES, 1, @@ -1100,19 +1103,19 @@ gnome_canvas_rich_text_key_press_event (GnomeCanvasItem *item, handled = TRUE; } break; - case GDK_Home: + case GDK_KEY_Home: gnome_canvas_rich_text_move_cursor ( text, GTK_MOVEMENT_PARAGRAPH_ENDS, -1, extend_selection); handled = TRUE; break; - case GDK_End: + case GDK_KEY_End: gnome_canvas_rich_text_move_cursor ( text, GTK_MOVEMENT_PARAGRAPH_ENDS, 1, extend_selection); handled = TRUE; break; - case GDK_a: + case GDK_KEY_a: if (event->state & GDK_CONTROL_MASK) { gnome_canvas_rich_text_move_cursor ( text, GTK_MOVEMENT_PARAGRAPH_ENDS, -1, @@ -1120,7 +1123,7 @@ gnome_canvas_rich_text_key_press_event (GnomeCanvasItem *item, handled = TRUE; } break; - case GDK_e: + case GDK_KEY_e: if (event->state & GDK_CONTROL_MASK) { gnome_canvas_rich_text_move_cursor ( text, GTK_MOVEMENT_PARAGRAPH_ENDS, 1, @@ -1130,8 +1133,8 @@ gnome_canvas_rich_text_key_press_event (GnomeCanvasItem *item, break; /* DELETING TEXT */ - case GDK_Delete: - case GDK_KP_Delete: + case GDK_KEY_Delete: + case GDK_KEY_KP_Delete: if (event->state & GDK_CONTROL_MASK) { gnome_canvas_rich_text_delete_from_cursor ( text, GTK_DELETE_WORD_ENDS, 1); @@ -1143,7 +1146,7 @@ gnome_canvas_rich_text_key_press_event (GnomeCanvasItem *item, handled = TRUE; } break; - case GDK_d: + case GDK_KEY_d: if (event->state & GDK_CONTROL_MASK) { gnome_canvas_rich_text_delete_from_cursor ( text, GTK_DELETE_CHARS, 1); @@ -1155,7 +1158,7 @@ gnome_canvas_rich_text_key_press_event (GnomeCanvasItem *item, handled = TRUE; } break; - case GDK_BackSpace: + case GDK_KEY_BackSpace: if (event->state & GDK_CONTROL_MASK) { gnome_canvas_rich_text_delete_from_cursor ( text, GTK_DELETE_WORD_ENDS, -1); @@ -1167,28 +1170,28 @@ gnome_canvas_rich_text_key_press_event (GnomeCanvasItem *item, } handled = TRUE; break; - case GDK_k: + case GDK_KEY_k: if (event->state & GDK_CONTROL_MASK) { gnome_canvas_rich_text_delete_from_cursor ( text, GTK_DELETE_PARAGRAPH_ENDS, 1); handled = TRUE; } break; - case GDK_u: + case GDK_KEY_u: if (event->state & GDK_CONTROL_MASK) { gnome_canvas_rich_text_delete_from_cursor ( text, GTK_DELETE_PARAGRAPHS, 1); handled = TRUE; } break; - case GDK_space: + case GDK_KEY_space: if (event->state & GDK_MOD1_MASK) { gnome_canvas_rich_text_delete_from_cursor ( text, GTK_DELETE_WHITESPACE, 1); handled = TRUE; } break; - case GDK_backslash: + case GDK_KEY_backslash: if (event->state & GDK_MOD1_MASK) { gnome_canvas_rich_text_delete_from_cursor ( text, GTK_DELETE_WHITESPACE, 1); diff --git a/libgnomecanvas/gnome-canvas.c b/libgnomecanvas/gnome-canvas.c index 7188c77bcd..adc18621f9 100644 --- a/libgnomecanvas/gnome-canvas.c +++ b/libgnomecanvas/gnome-canvas.c @@ -94,6 +94,7 @@ #include "gnome-canvas-marshal.h" #include "gnome-canvas-marshal.c" +/* backward-compatibility cruft */ #include "e-util/gtk-compat.h" /* We must run our idle update handler *before* GDK wants to redraw. */ diff --git a/mail/e-mail-browser.c b/mail/e-mail-browser.c index 34b4313a6f..3ffc290ba4 100644 --- a/mail/e-mail-browser.c +++ b/mail/e-mail-browser.c @@ -38,6 +38,9 @@ #include "mail/em-format-html-display.h" #include "mail/message-list.h" +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + #define E_MAIL_BROWSER_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), E_TYPE_MAIL_BROWSER, EMailBrowserPrivate)) @@ -639,7 +642,7 @@ static gboolean mail_browser_key_press_event (GtkWidget *widget, GdkEventKey *event) { - if (event->keyval == GDK_Escape) { + if (event->keyval == GDK_KEY_Escape) { e_mail_browser_close (E_MAIL_BROWSER (widget)); return TRUE; } diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c index f628b657bf..68cae17828 100644 --- a/mail/e-mail-reader.c +++ b/mail/e-mail-reader.c @@ -59,6 +59,9 @@ #include <clutter-gtk/clutter-gtk.h> #endif +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + #define E_MAIL_READER_GET_PRIVATE(obj) \ ((EMailReaderPrivate *) g_object_get_qdata \ (G_OBJECT (obj), quark_private)) @@ -2075,24 +2078,24 @@ mail_reader_key_press_event_cb (EMailReader *reader, /* <keyval> alone */ switch (event->keyval) { - case GDK_Delete: - case GDK_KP_Delete: + case GDK_KEY_Delete: + case GDK_KEY_KP_Delete: action_name = "mail-delete"; break; - case GDK_Return: - case GDK_KP_Enter: - case GDK_ISO_Enter: + case GDK_KEY_Return: + case GDK_KEY_KP_Enter: + case GDK_KEY_ISO_Enter: action_name = "mail-message-open"; break; - case GDK_period: - case GDK_bracketright: + case GDK_KEY_period: + case GDK_KEY_bracketright: action_name = "mail-next-unread"; break; - case GDK_comma: - case GDK_bracketleft: + case GDK_KEY_comma: + case GDK_KEY_bracketleft: action_name = "mail-previous-unread"; break; @@ -2106,7 +2109,7 @@ mail_reader_key_press_event_cb (EMailReader *reader, break; #endif - case GDK_exclam: + case GDK_KEY_exclam: action_name = "mail-toggle-important"; break; @@ -2120,11 +2123,11 @@ ctrl: /* Ctrl + <keyval> */ switch (event->keyval) { - case GDK_period: + case GDK_KEY_period: action_name = "mail-next-unread"; break; - case GDK_comma: + case GDK_KEY_comma: action_name = "mail-previous-unread"; break; diff --git a/mail/em-folder-tree.c b/mail/em-folder-tree.c index 4fb1615a96..1c0e00d508 100644 --- a/mail/em-folder-tree.c +++ b/mail/em-folder-tree.c @@ -44,7 +44,6 @@ #include "e-util/e-icon-factory.h" #include "e-util/e-alert-dialog.h" #include "e-util/e-util.h" -#include "e-util/gtk-compat.h" #include "misc/e-selectable.h" @@ -66,6 +65,9 @@ #include "e-mail-local.h" +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + #define d(x) #define EM_FOLDER_TREE_GET_PRIVATE(obj) \ @@ -821,7 +823,7 @@ folder_tree_key_press_event (GtkWidget *widget, GtkTreeView *tree_view; if (event && event->type == GDK_KEY_PRESS && - (event->keyval == GDK_space || + (event->keyval == GDK_KEY_space || event->keyval == '.' || event->keyval == ',' || event->keyval == '[' || diff --git a/mail/message-list.c b/mail/message-list.c index 02881f8a05..ff7350a327 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -41,7 +41,6 @@ #include "e-util/e-profile-event.h" #include "e-util/e-util-private.h" #include "e-util/e-util.h" -#include "e-util/gtk-compat.h" #include "misc/e-selectable.h" @@ -68,6 +67,9 @@ #include "mail-tools.h" #include "message-list.h" +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + #if HAVE_CLUTTER #include <clutter/clutter.h> #include <mx/mx.h> diff --git a/modules/addressbook/e-book-shell-view-private.c b/modules/addressbook/e-book-shell-view-private.c index 4639d18682..542c4e1178 100644 --- a/modules/addressbook/e-book-shell-view-private.c +++ b/modules/addressbook/e-book-shell-view-private.c @@ -373,7 +373,7 @@ book_shell_view_selector_key_press_event_cb (EShellView *shell_view, /* Needed for the ACTION() macro. */ shell_window = e_shell_view_get_shell_window (shell_view); - if (event->keyval == GDK_Delete) { + if (event->keyval == GDK_KEY_Delete) { gtk_action_activate (ACTION (ADDRESS_BOOK_DELETE)); return TRUE; } diff --git a/modules/addressbook/e-book-shell-view-private.h b/modules/addressbook/e-book-shell-view-private.h index b719509b09..28ccae1359 100644 --- a/modules/addressbook/e-book-shell-view-private.h +++ b/modules/addressbook/e-book-shell-view-private.h @@ -56,6 +56,9 @@ #include "e-book-shell-sidebar.h" #include "e-book-shell-view-actions.h" +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + #define E_BOOK_SHELL_VIEW_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), E_TYPE_BOOK_SHELL_VIEW, EBookShellViewPrivate)) diff --git a/modules/mail/e-mail-shell-view-private.c b/modules/mail/e-mail-shell-view-private.c index 58ef47a1a8..8d4fa9922e 100644 --- a/modules/mail/e-mail-shell-view-private.c +++ b/modules/mail/e-mail-shell-view-private.c @@ -73,10 +73,10 @@ mail_shell_view_folder_tree_key_press_event_cb (EMailShellView *mail_shell_view, /* <keyval> alone */ switch (event->keyval) { - case GDK_period: - case GDK_comma: - case GDK_bracketleft: - case GDK_bracketright: + case GDK_KEY_period: + case GDK_KEY_comma: + case GDK_KEY_bracketleft: + case GDK_KEY_bracketright: goto emit; default: @@ -86,8 +86,8 @@ mail_shell_view_folder_tree_key_press_event_cb (EMailShellView *mail_shell_view, ctrl: /* Ctrl + <keyval> */ switch (event->keyval) { - case GDK_period: - case GDK_comma: + case GDK_KEY_period: + case GDK_KEY_comma: goto emit; default: @@ -178,11 +178,11 @@ mail_shell_view_key_press_event_cb (EMailShellView *mail_shell_view, return FALSE; switch (event->keyval) { - case GDK_space: + case GDK_KEY_space: action = ACTION (MAIL_SMART_FORWARD); break; - case GDK_BackSpace: + case GDK_KEY_BackSpace: action = ACTION (MAIL_SMART_BACKWARD); break; diff --git a/modules/mail/e-mail-shell-view-private.h b/modules/mail/e-mail-shell-view-private.h index a8a86c5054..f023e1b263 100644 --- a/modules/mail/e-mail-shell-view-private.h +++ b/modules/mail/e-mail-shell-view-private.h @@ -66,6 +66,9 @@ #include "e-mail-shell-sidebar.h" #include "e-mail-shell-view-actions.h" +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + #define E_MAIL_SHELL_VIEW_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), E_TYPE_MAIL_SHELL_VIEW, EMailShellViewPrivate)) diff --git a/plugins/external-editor/external-editor.c b/plugins/external-editor/external-editor.c index c1f787d2f4..b55623a0ce 100644 --- a/plugins/external-editor/external-editor.c +++ b/plugins/external-editor/external-editor.c @@ -48,6 +48,9 @@ #include <gconf/gconf-client.h> +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + #define d(x) #define EDITOR_GCONF_KEY_COMMAND "/apps/evolution/eplugin/external-editor/editor-command" @@ -393,12 +396,12 @@ key_press_cb (GtkWidget * widget, GdkEventKey * event, EMsgComposer *composer) /* we don't want to start the editor on any modifier keys */ switch (event->keyval) { - case GDK_Alt_L: - case GDK_Alt_R: - case GDK_Super_L: - case GDK_Super_R: - case GDK_Control_L: - case GDK_Control_R: + case GDK_KEY_Alt_L: + case GDK_KEY_Alt_R: + case GDK_KEY_Super_L: + case GDK_KEY_Super_R: + case GDK_KEY_Control_L: + case GDK_KEY_Control_R: return FALSE; default: break; diff --git a/shell/e-shell-searchbar.c b/shell/e-shell-searchbar.c index 9a7800fdab..ce433592b4 100644 --- a/shell/e-shell-searchbar.c +++ b/shell/e-shell-searchbar.c @@ -38,6 +38,9 @@ #include "e-shell-window-actions.h" +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + #define E_SHELL_SEARCHBAR_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), E_TYPE_SHELL_SEARCHBAR, EShellSearchbarPrivate)) @@ -416,7 +419,7 @@ shell_searchbar_entry_key_press_cb (EShellSearchbar *searchbar, if ((key_event->state & mask) != GDK_MOD1_MASK) return FALSE; - if (key_event->keyval != GDK_Down) + if (key_event->keyval != GDK_KEY_Down) return FALSE; shell_view = e_shell_searchbar_get_shell_view (searchbar); diff --git a/shell/e-shell-window-private.h b/shell/e-shell-window-private.h index 02a688503e..de2b32471a 100644 --- a/shell/e-shell-window-private.h +++ b/shell/e-shell-window-private.h @@ -43,6 +43,9 @@ #include <e-shell-window-actions.h> #include <e-shell-utils.h> +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + #define E_SHELL_WINDOW_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), E_TYPE_SHELL_WINDOW, EShellWindowPrivate)) diff --git a/shell/e-shell-window.c b/shell/e-shell-window.c index 5480903f6b..e8be087560 100644 --- a/shell/e-shell-window.c +++ b/shell/e-shell-window.c @@ -421,7 +421,7 @@ shell_window_construct_toolbar (EShellWindow *shell_window) gtk_widget_add_accelerator ( GTK_WIDGET (item), "clicked", gtk_ui_manager_get_accel_group (ui_manager), - GDK_N, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE); + GDK_KEY_N, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE); gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, 0); gtk_widget_show (GTK_WIDGET (item)); diff --git a/widgets/misc/e-account-manager.c b/widgets/misc/e-account-manager.c index 3186e6ffbc..b3b7f1861f 100644 --- a/widgets/misc/e-account-manager.c +++ b/widgets/misc/e-account-manager.c @@ -26,6 +26,9 @@ #include "e-util/e-binding.h" #include "e-account-tree-view.h" +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + #define E_ACCOUNT_MANAGER_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), E_TYPE_ACCOUNT_MANAGER, EAccountManagerPrivate)) @@ -81,7 +84,7 @@ static gboolean account_manager_key_press_event_cb (EAccountManager *manager, GdkEventKey *event) { - if (event->keyval == GDK_Delete) { + if (event->keyval == GDK_KEY_Delete) { e_account_manager_delete_account (manager); return TRUE; } diff --git a/widgets/misc/e-attachment-view.c b/widgets/misc/e-attachment-view.c index a80fe32ec0..f641f76f1d 100644 --- a/widgets/misc/e-attachment-view.c +++ b/widgets/misc/e-attachment-view.c @@ -29,12 +29,14 @@ #include "e-util/e-selection.h" #include "e-util/e-ui-manager.h" #include "e-util/e-util.h" -#include "e-util/gtk-compat.h" #include "e-attachment-dialog.h" #include "e-attachment-handler-image.h" #include "e-attachment-handler-sendto.h" +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + enum { UPDATE_ACTIONS, LAST_SIGNAL @@ -1323,7 +1325,7 @@ e_attachment_view_key_press_event (EAttachmentView *view, editable = e_attachment_view_get_editable (view); - if (event->keyval == GDK_Delete && editable) { + if (event->keyval == GDK_KEY_Delete && editable) { e_attachment_view_remove_selected (view, TRUE); return TRUE; } diff --git a/widgets/misc/e-buffer-tagger.c b/widgets/misc/e-buffer-tagger.c index 217ffdb05b..55a9e34e57 100644 --- a/widgets/misc/e-buffer-tagger.c +++ b/widgets/misc/e-buffer-tagger.c @@ -29,6 +29,9 @@ #include "e-util/e-util.h" #include "e-buffer-tagger.h" +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + enum EBufferTaggerState { E_BUFFER_TAGGER_STATE_NONE = 0, @@ -378,8 +381,8 @@ textview_key_press_event (GtkWidget *text_view, GdkEventKey *event) return FALSE; switch (event->keyval) { - case GDK_Return: - case GDK_KP_Enter: + case GDK_KEY_Return: + case GDK_KEY_KP_Enter: buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text_view)); gtk_text_buffer_get_iter_at_mark (buffer, &iter, gtk_text_buffer_get_insert (buffer)); if (invoke_link_if_present (buffer, &iter)) @@ -427,8 +430,8 @@ textview_event_after (GtkTextView *textview, GdkEvent *ev) GdkEventKey *event_key = (GdkEventKey *)ev; switch (event_key->keyval) { - case GDK_Control_L: - case GDK_Control_R: + case GDK_KEY_Control_L: + case GDK_KEY_Control_R: update_ctrl_state (textview, ev->type == GDK_KEY_PRESS); break; } diff --git a/widgets/misc/e-calendar-item.c b/widgets/misc/e-calendar-item.c index f362046ee3..f5d2f870af 100644 --- a/widgets/misc/e-calendar-item.c +++ b/widgets/misc/e-calendar-item.c @@ -38,6 +38,9 @@ #include <e-util/e-util.h> #include <e-util/e-extensible.h> +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + static const gint e_calendar_item_days_in_month[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; @@ -1869,24 +1872,24 @@ e_calendar_item_key_press_event (ECalendarItem *calitem, GdkEvent *event) multi_selection = event->key.state & GDK_SHIFT_MASK; switch (keyval) { - case GDK_Up: + case GDK_KEY_Up: e_calendar_item_selection_add_days (calitem, -7, multi_selection); break; - case GDK_Down: + case GDK_KEY_Down: e_calendar_item_selection_add_days (calitem, 7, multi_selection); break; - case GDK_Left: + case GDK_KEY_Left: e_calendar_item_selection_add_days (calitem, -1, multi_selection); break; - case GDK_Right: + case GDK_KEY_Right: e_calendar_item_selection_add_days (calitem, 1, multi_selection); break; - case GDK_space: - case GDK_Return: + case GDK_KEY_space: + case GDK_KEY_Return: e_calendar_item_stop_selecting (calitem, event->key.time); break; default: diff --git a/widgets/misc/e-canvas-vbox.c b/widgets/misc/e-canvas-vbox.c index a49f7e93be..c41cac160f 100644 --- a/widgets/misc/e-canvas-vbox.c +++ b/widgets/misc/e-canvas-vbox.c @@ -34,6 +34,9 @@ #include "e-canvas-utils.h" #include "e-canvas-vbox.h" +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + static void e_canvas_vbox_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); static void e_canvas_vbox_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); static void e_canvas_vbox_dispose (GObject *object); @@ -207,16 +210,16 @@ e_canvas_vbox_event (GnomeCanvasItem *item, GdkEvent *event) switch (event->type) { case GDK_KEY_PRESS: switch (event->key.keyval) { - case GDK_Left: - case GDK_KP_Left: - case GDK_Right: - case GDK_KP_Right: - case GDK_Down: - case GDK_KP_Down: - case GDK_Up: - case GDK_KP_Up: - case GDK_Return: - case GDK_KP_Enter: + case GDK_KEY_Left: + case GDK_KEY_KP_Left: + case GDK_KEY_Right: + case GDK_KEY_KP_Right: + case GDK_KEY_Down: + case GDK_KEY_KP_Down: + case GDK_KEY_Up: + case GDK_KEY_KP_Up: + case GDK_KEY_Return: + case GDK_KEY_KP_Enter: return_val = TRUE; break; default: diff --git a/widgets/misc/e-combo-cell-editable.c b/widgets/misc/e-combo-cell-editable.c index 675e499388..aa514630ee 100644 --- a/widgets/misc/e-combo-cell-editable.c +++ b/widgets/misc/e-combo-cell-editable.c @@ -25,6 +25,9 @@ #include "e-combo-cell-editable.h" +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + struct _EComboCellEditablePriv { GtkEntry *entry; GtkWidget *popup; @@ -61,13 +64,13 @@ static gboolean popup_key_press_cb (GtkWidget *widget, GdkEventKey *event, EComboCellEditable *ecce) { switch (event->keyval) { - case GDK_Escape: + case GDK_KEY_Escape: ecce->priv->cancelled = TRUE; kill_popup (ecce); break; - case GDK_Return: - case GDK_KP_Enter: + case GDK_KEY_Return: + case GDK_KEY_KP_Enter: ecce->priv->cancelled = FALSE; kill_popup (ecce); break; @@ -275,7 +278,7 @@ entry_activated_cb (GtkEntry *entry, EComboCellEditable *widget) static gboolean entry_key_press_event_cb (GtkEntry *entry, GdkEventKey *key_event, EComboCellEditable *ecce) { - if (key_event->keyval == GDK_Escape) { + if (key_event->keyval == GDK_KEY_Escape) { ecce->priv->cancelled = TRUE; gtk_cell_editable_editing_done (GTK_CELL_EDITABLE (ecce)); gtk_cell_editable_remove_widget (GTK_CELL_EDITABLE (ecce)); @@ -283,7 +286,7 @@ entry_key_press_event_cb (GtkEntry *entry, GdkEventKey *key_event, EComboCellEdi } if (key_event->state & GDK_MOD1_MASK - && key_event->keyval == GDK_Down) { + && key_event->keyval == GDK_KEY_Down) { if (!ecce->priv->popup) show_popup (ecce); diff --git a/widgets/misc/e-dateedit.c b/widgets/misc/e-dateedit.c index 8c870bb7ad..b976355801 100644 --- a/widgets/misc/e-dateedit.c +++ b/widgets/misc/e-dateedit.c @@ -44,6 +44,9 @@ #include <e-util/e-extensible.h> #include "e-calendar.h" +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + #define E_DATE_EDIT_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), E_TYPE_DATE_EDIT, EDateEditPrivate)) @@ -1496,7 +1499,7 @@ on_date_popup_key_press (GtkWidget *widget, window = gtk_widget_get_window (dedit->priv->cal_popup); - if (event->keyval != GDK_Escape) { + if (event->keyval != GDK_KEY_Escape) { gdk_keyboard_grab (window, TRUE, GDK_CURRENT_TIME); return FALSE; } @@ -1714,8 +1717,8 @@ on_date_entry_key_press (GtkWidget *widget, EDateEdit *dedit) { if (event->state & GDK_MOD1_MASK - && (event->keyval == GDK_Up || event->keyval == GDK_Down - || event->keyval == GDK_Return)) { + && (event->keyval == GDK_KEY_Up || event->keyval == GDK_KEY_Down + || event->keyval == GDK_KEY_Return)) { g_signal_stop_emission_by_name (widget, "key_press_event"); e_date_edit_show_date_popup (dedit); @@ -1724,7 +1727,7 @@ on_date_entry_key_press (GtkWidget *widget, /* If the user hits the return key emit a "date_changed" signal if needed. But let the signal carry on. */ - if (event->keyval == GDK_Return) { + if (event->keyval == GDK_KEY_Return) { e_date_edit_check_date_changed (dedit); return FALSE; } @@ -1745,9 +1748,9 @@ on_time_entry_key_press (GtkWidget *widget, but the combo steals any Up/Down keys, so we use Alt+Return. */ #if 0 if (event->state & GDK_MOD1_MASK - && (event->keyval == GDK_Up || event->keyval == GDK_Down)) { + && (event->keyval == GDK_KEY_Up || event->keyval == GDK_KEY_Down)) { #else - if (event->state & GDK_MOD1_MASK && event->keyval == GDK_Return) { + if (event->state & GDK_MOD1_MASK && event->keyval == GDK_KEY_Return) { #endif g_signal_stop_emission_by_name (widget, "key_press_event"); g_signal_emit_by_name (child, "activate", 0); @@ -1756,7 +1759,7 @@ on_time_entry_key_press (GtkWidget *widget, /* Stop the return key from emitting the activate signal, and check if we need to emit a "time_changed" signal. */ - if (event->keyval == GDK_Return) { + if (event->keyval == GDK_KEY_Return) { g_signal_stop_emission_by_name (widget, "key_press_event"); e_date_edit_check_time_changed (dedit); @@ -1780,7 +1783,7 @@ on_time_entry_key_release (GtkWidget *widget, GdkEventKey *event, EDateEdit *dedit) { - if (event->keyval == GDK_Up || event->keyval == GDK_Down) { + if (event->keyval == GDK_KEY_Up || event->keyval == GDK_KEY_Down) { g_signal_stop_emission_by_name (widget, "key_release_event"); e_date_edit_check_time_changed (dedit); diff --git a/widgets/misc/e-image-chooser.c b/widgets/misc/e-image-chooser.c index 0ddf08ccde..c01f35b3d7 100644 --- a/widgets/misc/e-image-chooser.c +++ b/widgets/misc/e-image-chooser.c @@ -29,6 +29,8 @@ #include "e-image-chooser.h" #include "e-util/e-util.h" #include "e-util/e-icon-factory.h" + +/* backward-compatibility cruft */ #include "e-util/gtk-compat.h" #define E_IMAGE_CHOOSER_GET_PRIVATE(obj) \ diff --git a/widgets/misc/e-import-assistant.c b/widgets/misc/e-import-assistant.c index 896e1fffa7..6a1e1f4787 100644 --- a/widgets/misc/e-import-assistant.c +++ b/widgets/misc/e-import-assistant.c @@ -33,6 +33,9 @@ #include <e-util/e-extensible.h> #include <e-util/e-util-private.h> +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + #define E_IMPORT_ASSISTANT_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), E_TYPE_IMPORT_ASSISTANT, EImportAssistantPrivate)) @@ -1166,7 +1169,7 @@ import_assistant_key_press_event (GtkWidget *widget, { GtkWidgetClass *parent_class; - if (event->keyval == GDK_Escape) { + if (event->keyval == GDK_KEY_Escape) { g_signal_emit_by_name (widget, "cancel"); return TRUE; } diff --git a/widgets/misc/e-map.c b/widgets/misc/e-map.c index 62e3571984..9167e85a86 100644 --- a/widgets/misc/e-map.c +++ b/widgets/misc/e-map.c @@ -33,6 +33,9 @@ #include "e-map.h" +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + /* Scroll step increment */ #define SCROLL_STEP_SIZE 32 @@ -473,25 +476,25 @@ e_map_key_press (GtkWidget *widget, GdkEventKey *event) switch (event->keyval) { - case GDK_Up: + case GDK_KEY_Up: do_scroll = TRUE; xofs = 0; yofs = -SCROLL_STEP_SIZE; break; - case GDK_Down: + case GDK_KEY_Down: do_scroll = TRUE; xofs = 0; yofs = SCROLL_STEP_SIZE; break; - case GDK_Left: + case GDK_KEY_Left: do_scroll = TRUE; xofs = -SCROLL_STEP_SIZE; yofs = 0; break; - case GDK_Right: + case GDK_KEY_Right: do_scroll = TRUE; xofs = SCROLL_STEP_SIZE; yofs = 0; diff --git a/widgets/misc/e-preferences-window.c b/widgets/misc/e-preferences-window.c index 5e9a28ede8..20f1c7a068 100644 --- a/widgets/misc/e-preferences-window.c +++ b/widgets/misc/e-preferences-window.c @@ -25,6 +25,9 @@ #include <gdk/gdkkeysyms.h> #include <e-util/e-util.h> +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + #define SWITCH_PAGE_INTERVAL 250 #define E_PREFERENCES_WINDOW_GET_PRIVATE(obj) \ @@ -353,7 +356,7 @@ e_preferences_window_init (EPreferencesWindow *window) accel_group = gtk_accel_group_new (); gtk_widget_add_accelerator ( widget, "activate", accel_group, - GDK_Escape, (GdkModifierType) 0, + GDK_KEY_Escape, (GdkModifierType) 0, GTK_ACCEL_VISIBLE); gtk_window_add_accel_group (GTK_WINDOW (window), accel_group); gtk_widget_grab_default (widget); diff --git a/widgets/misc/e-preview-pane.c b/widgets/misc/e-preview-pane.c index 973de3bdb0..bbbb94f81b 100644 --- a/widgets/misc/e-preview-pane.c +++ b/widgets/misc/e-preview-pane.c @@ -23,6 +23,9 @@ #include <gdk/gdkkeysyms.h> +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + #define E_PREVIEW_PANE_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), E_TYPE_PREVIEW_PANE, EPreviewPanePrivate)) @@ -205,7 +208,7 @@ e_preview_pane_class_init (EPreviewPaneClass *class) binding_set = gtk_binding_set_by_class (class); gtk_binding_entry_add_signal ( - binding_set, GDK_f, GDK_SHIFT_MASK | GDK_CONTROL_MASK, + binding_set, GDK_KEY_f, GDK_SHIFT_MASK | GDK_CONTROL_MASK, "show-search-bar", 0); } diff --git a/widgets/misc/e-search-bar.c b/widgets/misc/e-search-bar.c index c0b2d43e97..9846576a5e 100644 --- a/widgets/misc/e-search-bar.c +++ b/widgets/misc/e-search-bar.c @@ -27,6 +27,9 @@ #include "e-util/e-binding.h" +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + #define E_SEARCH_BAR_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), E_TYPE_SEARCH_BAR, ESearchBarPrivate)) @@ -416,7 +419,7 @@ search_bar_key_press_event (GtkWidget *widget, { GtkWidgetClass *widget_class; - if (event->keyval == GDK_Escape) { + if (event->keyval == GDK_KEY_Escape) { gtk_widget_hide (widget); return TRUE; } diff --git a/widgets/misc/e-selection-model.c b/widgets/misc/e-selection-model.c index f1b2c9bbf1..44a22d6eb3 100644 --- a/widgets/misc/e-selection-model.c +++ b/widgets/misc/e-selection-model.c @@ -29,6 +29,9 @@ #include "e-selection-model.h" +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + G_DEFINE_TYPE ( ESelectionModel, e_selection_model, @@ -704,14 +707,14 @@ e_selection_model_key_press (ESelectionModel *selection, selection->old_selection = -1; switch (key->keyval) { - case GDK_Up: - case GDK_KP_Up: + case GDK_KEY_Up: + case GDK_KEY_KP_Up: return move_selection (selection, TRUE, key->state); - case GDK_Down: - case GDK_KP_Down: + case GDK_KEY_Down: + case GDK_KEY_KP_Down: return move_selection (selection, FALSE, key->state); - case GDK_space: - case GDK_KP_Space: + case GDK_KEY_space: + case GDK_KEY_KP_Space: if (selection->mode != GTK_SELECTION_SINGLE) { gint row = e_selection_model_cursor_row (selection); gint col = e_selection_model_cursor_col (selection); @@ -725,8 +728,8 @@ e_selection_model_key_press (ESelectionModel *selection, return TRUE; } break; - case GDK_Return: - case GDK_KP_Enter: + case GDK_KEY_Return: + case GDK_KEY_KP_Enter: if (selection->mode != GTK_SELECTION_SINGLE) { gint row = e_selection_model_cursor_row (selection); gint col = e_selection_model_cursor_col (selection); @@ -737,8 +740,8 @@ e_selection_model_key_press (ESelectionModel *selection, return TRUE; } break; - case GDK_Home: - case GDK_KP_Home: + case GDK_KEY_Home: + case GDK_KEY_KP_Home: if (selection->cursor_mode == E_CURSOR_LINE) { gint row = 0; gint cursor_col = e_selection_model_cursor_col (selection); @@ -748,8 +751,8 @@ e_selection_model_key_press (ESelectionModel *selection, return TRUE; } break; - case GDK_End: - case GDK_KP_End: + case GDK_KEY_End: + case GDK_KEY_KP_End: if (selection->cursor_mode == E_CURSOR_LINE) { gint row = e_selection_model_row_count (selection) - 1; gint cursor_col = e_selection_model_cursor_col (selection); diff --git a/widgets/misc/e-signature-manager.c b/widgets/misc/e-signature-manager.c index e9a04b8641..d6d021cd3d 100644 --- a/widgets/misc/e-signature-manager.c +++ b/widgets/misc/e-signature-manager.c @@ -28,6 +28,9 @@ #include "e-signature-tree-view.h" #include "e-signature-script-dialog.h" +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + #define E_SIGNATURE_MANAGER_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), E_TYPE_SIGNATURE_MANAGER, ESignatureManagerPrivate)) @@ -81,7 +84,7 @@ static gboolean signature_manager_key_press_event_cb (ESignatureManager *manager, GdkEventKey *event) { - if (event->keyval == GDK_Delete) { + if (event->keyval == GDK_KEY_Delete) { e_signature_manager_remove_signature (manager); return TRUE; } diff --git a/widgets/table/e-cell-combo.c b/widgets/table/e-cell-combo.c index 186ae4dfed..6e8eb41762 100644 --- a/widgets/table/e-cell-combo.c +++ b/widgets/table/e-cell-combo.c @@ -68,6 +68,9 @@ #include "e-cell-combo.h" #include "e-cell-text.h" +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + #define d(x) /* The height to make the popup list if there aren't any items in it. */ @@ -628,14 +631,14 @@ e_cell_combo_key_press (GtkWidget *popup_window, ECellCombo *ecc) { /* If the Escape key is pressed we hide the popup. */ - if (event->keyval != GDK_Escape - && event->keyval != GDK_Return - && event->keyval != GDK_KP_Enter - && event->keyval != GDK_ISO_Enter - && event->keyval != GDK_3270_Enter) + if (event->keyval != GDK_KEY_Escape + && event->keyval != GDK_KEY_Return + && event->keyval != GDK_KEY_KP_Enter + && event->keyval != GDK_KEY_ISO_Enter + && event->keyval != GDK_KEY_3270_Enter) return FALSE; - if (event->keyval == GDK_Escape && (!ecc->popup_window||!gtk_widget_get_visible (ecc->popup_window))) + if (event->keyval == GDK_KEY_Escape && (!ecc->popup_window||!gtk_widget_get_visible (ecc->popup_window))) return FALSE; gtk_grab_remove (ecc->popup_window); @@ -646,7 +649,7 @@ e_cell_combo_key_press (GtkWidget *popup_window, e_cell_popup_set_shown (E_CELL_POPUP (ecc), FALSE); d(g_print("%s: popup_shown = FALSE\n", __FUNCTION__)); - if (event->keyval != GDK_Escape) + if (event->keyval != GDK_KEY_Escape) e_cell_combo_update_cell (ecc); e_cell_combo_restart_edit (ecc); diff --git a/widgets/table/e-cell-date-edit.c b/widgets/table/e-cell-date-edit.c index 4080172058..73a5d946b2 100644 --- a/widgets/table/e-cell-date-edit.c +++ b/widgets/table/e-cell-date-edit.c @@ -48,6 +48,9 @@ /* This depends on ECalendar which is why I didn't put it in gal. */ #include <misc/e-calendar.h> +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + static void e_cell_date_edit_get_property (GObject *object, guint property_id, GValue *value, @@ -726,7 +729,7 @@ e_cell_date_edit_key_press (GtkWidget *popup_window, ECellDateEdit *ecde) { /* If the Escape key is pressed we hide the popup. */ - if (event->keyval != GDK_Escape) + if (event->keyval != GDK_KEY_Escape) return FALSE; e_cell_date_edit_hide_popup (ecde); diff --git a/widgets/table/e-cell-popup.c b/widgets/table/e-cell-popup.c index e918e7fcc2..5b98a205f2 100644 --- a/widgets/table/e-cell-popup.c +++ b/widgets/table/e-cell-popup.c @@ -41,6 +41,9 @@ #include "e-table-item.h" #include <gtk/gtk.h> +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + #define E_CELL_POPUP_ARROW_WIDTH 16 #define E_CELL_POPUP_ARROW_XPAD 3 #define E_CELL_POPUP_ARROW_YPAD 3 @@ -340,7 +343,7 @@ ecp_event (ECellView *ecv, GdkEvent *event, gint model_col, gint view_col, case GDK_KEY_PRESS: if (e_table_model_is_cell_editable (ecv->e_table_model, model_col, row) && event->key.state & GDK_MOD1_MASK - && event->key.keyval == GDK_Down) { + && event->key.keyval == GDK_KEY_Down) { return e_cell_popup_do_popup (ecp_view, event, row, view_col); } break; diff --git a/widgets/table/e-cell-text.c b/widgets/table/e-cell-text.c index 51188aa101..011e334b21 100644 --- a/widgets/table/e-cell-text.c +++ b/widgets/table/e-cell-text.c @@ -54,11 +54,14 @@ #include "e-util/e-util.h" #include "misc/e-canvas.h" #include "e-util/e-unicode.h" -#include "e-util/gtk-compat.h" #include "e-table.h" #include "e-cell-text.h" #include "e-table-item.h" + +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + #define d(x) #define DO_SELECTION 1 #define VIEW_TO_CELL(view) E_CELL_TEXT (((ECellView *)view)->ecell) @@ -974,7 +977,7 @@ ect_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col return 1; } - if (event->key.keyval == GDK_Escape) { + if (event->key.keyval == GDK_KEY_Escape) { /* if not changed, then pass this even to parent */ return_val = text_view->edit != NULL && text_view->edit->text && text_view->edit->old_text && 0 != strcmp (text_view->edit->text, text_view->edit->old_text); ect_cancel_edit (text_view); @@ -992,7 +995,7 @@ ect_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col if (edit_display) { GdkEventKey key = event->key; if (key.type == GDK_KEY_PRESS && - (key.keyval == GDK_KP_Enter || key.keyval == GDK_Return)) { + (key.keyval == GDK_KEY_KP_Enter || key.keyval == GDK_KEY_Return)) { /* stop editing when it's only GDK_KEY_PRESS event */ e_table_item_leave_edit_ (text_view->cell_view.e_table_item_view); } else { diff --git a/widgets/table/e-cell-toggle.c b/widgets/table/e-cell-toggle.c index 35e06fbe79..2ae69c2ba4 100644 --- a/widgets/table/e-cell-toggle.c +++ b/widgets/table/e-cell-toggle.c @@ -38,6 +38,9 @@ #include "e-cell-toggle.h" #include "e-table-item.h" +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + #define E_CELL_TOGGLE_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), E_TYPE_CELL_TOGGLE, ECellTogglePrivate)) @@ -271,7 +274,7 @@ cell_toggle_event (ECellView *ecell_view, switch (event->type) { case GDK_KEY_PRESS: - if (event->key.keyval != GDK_space) + if (event->key.keyval != GDK_KEY_space) return FALSE; /* Fall through */ case GDK_BUTTON_PRESS: diff --git a/widgets/table/e-table-click-to-add.c b/widgets/table/e-table-click-to-add.c index 3d5a374382..ca564cbbcd 100644 --- a/widgets/table/e-table-click-to-add.c +++ b/widgets/table/e-table-click-to-add.c @@ -41,6 +41,9 @@ #include "e-table-header.h" #include "e-table-one.h" +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + enum { CURSOR_CHANGE, STYLE_SET, @@ -330,10 +333,10 @@ item_key_press (ETableItem *item, ETableClickToAdd *etcta) { switch (event->key.keyval) { - case GDK_Return: - case GDK_KP_Enter: - case GDK_ISO_Enter: - case GDK_3270_Enter: + case GDK_KEY_Return: + case GDK_KEY_KP_Enter: + case GDK_KEY_ISO_Enter: + case GDK_KEY_3270_Enter: finish_editing (etcta); return TRUE; } @@ -436,14 +439,14 @@ etcta_event (GnomeCanvasItem *item, GdkEvent *e) case GDK_KEY_PRESS: switch (e->key.keyval) { - case GDK_Tab: - case GDK_KP_Tab: - case GDK_ISO_Left_Tab: + case GDK_KEY_Tab: + case GDK_KEY_KP_Tab: + case GDK_KEY_ISO_Left_Tab: finish_editing (etcta); break; default: return FALSE; - case GDK_Escape: + case GDK_KEY_Escape: if (etcta->row) { e_table_item_leave_edit (E_TABLE_ITEM (etcta->row)); etcta_drop_one (etcta); diff --git a/widgets/table/e-table-group-container.c b/widgets/table/e-table-group-container.c index ba6ddf9476..a2b7be785c 100644 --- a/widgets/table/e-table-group-container.c +++ b/widgets/table/e-table-group-container.c @@ -39,6 +39,9 @@ #include "e-table-item.h" #include "e-table-sorting-utils.h" +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + #define TITLE_HEIGHT 16 /* workaround for avoiding API breakage */ @@ -212,37 +215,37 @@ etgc_event (GnomeCanvasItem *item, GdkEvent *event) switch (event->type) { case GDK_KEY_PRESS: - if (event->key.keyval == GDK_Tab || - event->key.keyval == GDK_KP_Tab || - event->key.keyval == GDK_ISO_Left_Tab) { + if (event->key.keyval == GDK_KEY_Tab || + event->key.keyval == GDK_KEY_KP_Tab || + event->key.keyval == GDK_KEY_ISO_Left_Tab) { change_focus = TRUE; use_col = TRUE; start_col = (event->key.state & GDK_SHIFT_MASK) ? -1 : 0; direction = (event->key.state & GDK_SHIFT_MASK) ? E_FOCUS_END : E_FOCUS_START; - } else if (event->key.keyval == GDK_Left || - event->key.keyval == GDK_KP_Left) { + } else if (event->key.keyval == GDK_KEY_Left || + event->key.keyval == GDK_KEY_KP_Left) { change_focus = TRUE; use_col = TRUE; start_col = -1; direction = E_FOCUS_END; - } else if (event->key.keyval == GDK_Right || - event->key.keyval == GDK_KP_Right) { + } else if (event->key.keyval == GDK_KEY_Right || + event->key.keyval == GDK_KEY_KP_Right) { change_focus = TRUE; use_col = TRUE; start_col = 0; direction = E_FOCUS_START; - } else if (event->key.keyval == GDK_Down || - event->key.keyval == GDK_KP_Down) { + } else if (event->key.keyval == GDK_KEY_Down || + event->key.keyval == GDK_KEY_KP_Down) { change_focus = TRUE; use_col = FALSE; direction = E_FOCUS_START; - } else if (event->key.keyval == GDK_Up || - event->key.keyval == GDK_KP_Up) { + } else if (event->key.keyval == GDK_KEY_Up || + event->key.keyval == GDK_KEY_KP_Up) { change_focus = TRUE; use_col = FALSE; direction = E_FOCUS_END; - } else if (event->key.keyval == GDK_Return || - event->key.keyval == GDK_KP_Enter) { + } else if (event->key.keyval == GDK_KEY_Return || + event->key.keyval == GDK_KEY_KP_Enter) { change_focus = TRUE; use_col = FALSE; direction = E_FOCUS_START; diff --git a/widgets/table/e-table-header-item.c b/widgets/table/e-table-header-item.c index 14597c943b..a550bbdda5 100644 --- a/widgets/table/e-table-header-item.c +++ b/widgets/table/e-table-header-item.c @@ -37,7 +37,6 @@ #include <glib/gi18n.h> #include "e-util/e-util.h" #include "e-util/e-xml-utils.h" -#include "e-util/gtk-compat.h" #include "misc/e-canvas.h" #include "misc/e-popup-menu.h" @@ -56,6 +55,9 @@ #include "arrow-up.xpm" #include "arrow-down.xpm" +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + enum { BUTTON_PRESSED, LAST_SIGNAL @@ -1939,7 +1941,7 @@ ethi_event (GnomeCanvasItem *item, GdkEvent *e) break; } case GDK_KEY_PRESS: - if ((e->key.keyval == GDK_F10) && (e->key.state & GDK_SHIFT_MASK)) { + if ((e->key.keyval == GDK_KEY_F10) && (e->key.state & GDK_SHIFT_MASK)) { EthiHeaderInfo *info = g_new (EthiHeaderInfo, 1); ETableCol *ecol; GtkMenu *popup; @@ -1962,12 +1964,12 @@ ethi_event (GnomeCanvasItem *item, GdkEvent *e) GTK_MENU (popup), NULL, NULL, NULL, NULL, 0, GDK_CURRENT_TIME); - } else if (e->key.keyval == GDK_space) { + } else if (e->key.keyval == GDK_KEY_space) { ETableCol *ecol; ecol = e_table_header_get_column (ethi->eth, ethi->selected_col); ethi_change_sort_state (ethi, ecol); - } else if ((e->key.keyval == GDK_Right) || (e->key.keyval == GDK_KP_Right)) { + } else if ((e->key.keyval == GDK_KEY_Right) || (e->key.keyval == GDK_KEY_KP_Right)) { ETableCol *ecol; if ((ethi->selected_col < 0) || (ethi->selected_col >= ethi->eth->col_count - 1)) @@ -1976,7 +1978,7 @@ ethi_event (GnomeCanvasItem *item, GdkEvent *e) ethi->selected_col++; ecol = e_table_header_get_column (ethi->eth, ethi->selected_col); ethi_change_sort_state (ethi, ecol); - } else if ((e->key.keyval == GDK_Left) || (e->key.keyval == GDK_KP_Left)) { + } else if ((e->key.keyval == GDK_KEY_Left) || (e->key.keyval == GDK_KEY_KP_Left)) { ETableCol *ecol; if ((ethi->selected_col <= 0) || (ethi->selected_col >= ethi->eth->col_count)) diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c index 48c51d8f75..390c207727 100644 --- a/widgets/table/e-table-item.c +++ b/widgets/table/e-table-item.c @@ -48,6 +48,9 @@ #include "e-table-item.h" #include "e-table-subset.h" +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + /* workaround for avoiding API breakage */ #define eti_get_type e_table_item_get_type G_DEFINE_TYPE (ETableItem, eti, GNOME_TYPE_CANVAS_ITEM) @@ -2524,8 +2527,8 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) eti->in_key_press = TRUE; switch (e->key.keyval) { - case GDK_Left: - case GDK_KP_Left: + case GDK_KEY_Left: + case GDK_KEY_KP_Left: if (eti_editing (eti)) { handled = FALSE; break; @@ -2540,8 +2543,8 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) return_val = 1; break; - case GDK_Right: - case GDK_KP_Right: + case GDK_KEY_Right: + case GDK_KEY_KP_Right: if (eti_editing (eti)) { handled = FALSE; break; @@ -2556,12 +2559,12 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) return_val = 1; break; - case GDK_Up: - case GDK_KP_Up: - case GDK_Down: - case GDK_KP_Down: + case GDK_KEY_Up: + case GDK_KEY_KP_Up: + case GDK_KEY_Down: + case GDK_KEY_KP_Down: if ((e->key.state & GDK_MOD1_MASK) - && ((e->key.keyval == GDK_Down ) || (e->key.keyval == GDK_KP_Down))) { + && ((e->key.keyval == GDK_KEY_Down ) || (e->key.keyval == GDK_KEY_KP_Down))) { gint view_col = model_to_view_col (eti, cursor_col); if ((view_col >= 0) && (view_col < eti->cols)) @@ -2570,8 +2573,8 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) } else return_val = e_selection_model_key_press (E_SELECTION_MODEL (eti->selection), (GdkEventKey *) e); break; - case GDK_Home: - case GDK_KP_Home: + case GDK_KEY_Home: + case GDK_KEY_KP_Home: if (eti_editing (eti)) { handled = FALSE; break; @@ -2583,8 +2586,8 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) } else return_val = e_selection_model_key_press (E_SELECTION_MODEL (eti->selection), (GdkEventKey *) e); break; - case GDK_End: - case GDK_KP_End: + case GDK_KEY_End: + case GDK_KEY_KP_End: if (eti_editing (eti)) { handled = FALSE; break; @@ -2596,9 +2599,9 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) } else return_val = e_selection_model_key_press (E_SELECTION_MODEL (eti->selection), (GdkEventKey *) e); break; - case GDK_Tab: - case GDK_KP_Tab: - case GDK_ISO_Left_Tab: + case GDK_KEY_Tab: + case GDK_KEY_KP_Tab: + case GDK_KEY_ISO_Left_Tab: if ((e->key.state & GDK_CONTROL_MASK) != 0) { return_val = FALSE; break; @@ -2636,10 +2639,10 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) break; } - case GDK_Return: - case GDK_KP_Enter: - case GDK_ISO_Enter: - case GDK_3270_Enter: + case GDK_KEY_Return: + case GDK_KEY_KP_Enter: + case GDK_KEY_ISO_Enter: + case GDK_KEY_3270_Enter: if (eti_editing (eti)) { ecell_view = eti->cell_views[eti->editing_col]; return_val = eti_e_cell_event (eti, ecell_view, e, e->key.time, @@ -2661,23 +2664,23 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) if (!handled) { switch (e->key.keyval) { - case GDK_Scroll_Lock: - case GDK_Sys_Req: - case GDK_Shift_L: - case GDK_Shift_R: - case GDK_Control_L: - case GDK_Control_R: - case GDK_Caps_Lock: - case GDK_Shift_Lock: - case GDK_Meta_L: - case GDK_Meta_R: - case GDK_Alt_L: - case GDK_Alt_R: - case GDK_Super_L: - case GDK_Super_R: - case GDK_Hyper_L: - case GDK_Hyper_R: - case GDK_ISO_Lock: + case GDK_KEY_Scroll_Lock: + case GDK_KEY_Sys_Req: + case GDK_KEY_Shift_L: + case GDK_KEY_Shift_R: + case GDK_KEY_Control_L: + case GDK_KEY_Control_R: + case GDK_KEY_Caps_Lock: + case GDK_KEY_Shift_Lock: + case GDK_KEY_Meta_L: + case GDK_KEY_Meta_R: + case GDK_KEY_Alt_L: + case GDK_KEY_Alt_R: + case GDK_KEY_Super_L: + case GDK_KEY_Super_R: + case GDK_KEY_Hyper_L: + case GDK_KEY_Hyper_R: + case GDK_KEY_ISO_Lock: break; default: diff --git a/widgets/table/e-table.c b/widgets/table/e-table.c index 254ea47046..23640b2d9f 100644 --- a/widgets/table/e-table.c +++ b/widgets/table/e-table.c @@ -53,6 +53,9 @@ #include "e-table-subset.h" #include "e-table-utils.h" +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + #define COLUMN_HEADER_HEIGHT 16 #define d(x) @@ -845,8 +848,8 @@ group_key_press (ETableGroup *etg, gint row, gint col, GdkEvent *event, ETable * adjustment = gtk_layout_get_vadjustment (layout); switch (key->keyval) { - case GDK_Page_Down: - case GDK_KP_Page_Down: + case GDK_KEY_Page_Down: + case GDK_KEY_KP_Page_Down: page_size = gtk_adjustment_get_page_size (adjustment); upper = gtk_adjustment_get_value (adjustment); value = gtk_adjustment_get_value (adjustment); @@ -865,8 +868,8 @@ group_key_press (ETableGroup *etg, gint row, gint col, GdkEvent *event, ETable * row_local, col_local, key->state); return_val = 1; break; - case GDK_Page_Up: - case GDK_KP_Page_Up: + case GDK_KEY_Page_Up: + case GDK_KEY_KP_Page_Up: page_size = gtk_adjustment_get_page_size (adjustment); upper = gtk_adjustment_get_upper (adjustment); value = gtk_adjustment_get_value (adjustment); @@ -885,7 +888,7 @@ group_key_press (ETableGroup *etg, gint row, gint col, GdkEvent *event, ETable * row_local, col_local, key->state); return_val = 1; break; - case GDK_BackSpace: + case GDK_KEY_BackSpace: init_search (et); if (e_table_search_backspace (et->search)) return TRUE; @@ -895,9 +898,9 @@ group_key_press (ETableGroup *etg, gint row, gint col, GdkEvent *event, ETable * if ((key->state & ~(GDK_SHIFT_MASK | GDK_LOCK_MASK | GDK_MOD1_MASK | GDK_MOD2_MASK | GDK_MOD3_MASK | GDK_MOD4_MASK | GDK_MOD5_MASK)) == 0 - && ((key->keyval >= GDK_a && key->keyval <= GDK_z) || - (key->keyval >= GDK_A && key->keyval <= GDK_Z) || - (key->keyval >= GDK_0 && key->keyval <= GDK_9))) + && ((key->keyval >= GDK_KEY_a && key->keyval <= GDK_KEY_z) || + (key->keyval >= GDK_KEY_A && key->keyval <= GDK_KEY_Z) || + (key->keyval >= GDK_KEY_0 && key->keyval <= GDK_KEY_9))) e_table_search_input_character (et->search, key->keyval); g_signal_emit (G_OBJECT (et), et_signals[KEY_PRESS], 0, row, col, event, &return_val); @@ -1223,9 +1226,9 @@ canvas_vbox_event (ECanvasVbox *vbox, GdkEventKey *key, ETable *etable) return FALSE; } switch (key->keyval) { - case GDK_Tab: - case GDK_KP_Tab: - case GDK_ISO_Left_Tab: + case GDK_KEY_Tab: + case GDK_KEY_KP_Tab: + case GDK_KEY_ISO_Left_Tab: if ((key->state & GDK_CONTROL_MASK) && etable->click_to_add) { gnome_canvas_item_grab_focus (etable->click_to_add); break; @@ -1245,9 +1248,9 @@ click_to_add_event (ETableClickToAdd *etcta, GdkEventKey *key, ETable *etable) return FALSE; } switch (key->keyval) { - case GDK_Tab: - case GDK_KP_Tab: - case GDK_ISO_Left_Tab: + case GDK_KEY_Tab: + case GDK_KEY_KP_Tab: + case GDK_KEY_ISO_Left_Tab: if (key->state & GDK_CONTROL_MASK) { if (etable->group) { if (e_table_model_row_count (etable->model) > 0) diff --git a/widgets/table/e-tree.c b/widgets/table/e-tree.c index be1f8937a6..b85475248a 100644 --- a/widgets/table/e-tree.c +++ b/widgets/table/e-tree.c @@ -52,6 +52,9 @@ #include "e-tree.h" #include "e-tree-table-adapter.h" +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + #define COLUMN_HEADER_HEIGHT 16 #define d(x) @@ -938,8 +941,8 @@ item_key_press (ETableItem *eti, gint row, gint col, GdkEvent *event, ETree *et) value = gtk_adjustment_get_value (adjustment); switch (key->keyval) { - case GDK_Page_Down: - case GDK_KP_Page_Down: + case GDK_KEY_Page_Down: + case GDK_KEY_KP_Page_Down: y = CLAMP (value + (2 * page_size - 50), 0, upper); y -= value; e_tree_get_cell_at (et, 30, y, &row_local, &col_local); @@ -956,8 +959,8 @@ item_key_press (ETableItem *eti, gint row, gint col, GdkEvent *event, ETree *et) return_val = 1; break; - case GDK_Page_Up: - case GDK_KP_Page_Up: + case GDK_KEY_Page_Up: + case GDK_KEY_KP_Page_Up: y = CLAMP (value - (page_size - 50), 0, upper); y -= value; e_tree_get_cell_at (et, 30, y, &row_local, &col_local); @@ -974,10 +977,10 @@ item_key_press (ETableItem *eti, gint row, gint col, GdkEvent *event, ETree *et) return_val = 1; break; - case GDK_plus: - case GDK_KP_Add: - case GDK_Right: - case GDK_KP_Right: + case GDK_KEY_plus: + case GDK_KEY_KP_Add: + case GDK_KEY_Right: + case GDK_KEY_KP_Right: /* Only allow if the Shift modifier is used. * eg. Ctrl-Equal shouldn't be handled. */ if ((key->state & (GDK_SHIFT_MASK | GDK_LOCK_MASK | @@ -990,10 +993,10 @@ item_key_press (ETableItem *eti, gint row, gint col, GdkEvent *event, ETree *et) } return_val = 1; break; - case GDK_underscore: - case GDK_KP_Subtract: - case GDK_Left: - case GDK_KP_Left: + case GDK_KEY_underscore: + case GDK_KEY_KP_Subtract: + case GDK_KEY_Left: + case GDK_KEY_KP_Left: /* Only allow if the Shift modifier is used. * eg. Ctrl-Minus shouldn't be handled. */ if ((key->state & (GDK_SHIFT_MASK | GDK_LOCK_MASK | @@ -1006,7 +1009,7 @@ item_key_press (ETableItem *eti, gint row, gint col, GdkEvent *event, ETree *et) } return_val = 1; break; - case GDK_BackSpace: + case GDK_KEY_BackSpace: if (e_table_search_backspace (et->priv->search)) return TRUE; /* Fallthrough */ @@ -1014,9 +1017,9 @@ item_key_press (ETableItem *eti, gint row, gint col, GdkEvent *event, ETree *et) if ((key->state & ~(GDK_SHIFT_MASK | GDK_LOCK_MASK | GDK_MOD1_MASK | GDK_MOD2_MASK | GDK_MOD3_MASK | GDK_MOD4_MASK | GDK_MOD5_MASK)) == 0 - && ((key->keyval >= GDK_a && key->keyval <= GDK_z) || - (key->keyval >= GDK_A && key->keyval <= GDK_Z) || - (key->keyval >= GDK_0 && key->keyval <= GDK_9))) { + && ((key->keyval >= GDK_KEY_a && key->keyval <= GDK_KEY_z) || + (key->keyval >= GDK_KEY_A && key->keyval <= GDK_KEY_Z) || + (key->keyval >= GDK_KEY_0 && key->keyval <= GDK_KEY_9))) { e_table_search_input_character (et->priv->search, key->keyval); } path = e_tree_table_adapter_node_at_row (et->priv->etta, row); diff --git a/widgets/table/gal-a11y-e-cell-popup.c b/widgets/table/gal-a11y-e-cell-popup.c index 755325d4f3..92ee3a8322 100644 --- a/widgets/table/gal-a11y-e-cell-popup.c +++ b/widgets/table/gal-a11y-e-cell-popup.c @@ -32,6 +32,9 @@ #include "gal-a11y-e-cell-popup.h" #include "gal-a11y-e-cell-registry.h" +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + static AtkObjectClass *parent_class = NULL; #define PARENT_TYPE (gal_a11y_e_cell_get_type ()) @@ -142,7 +145,7 @@ popup_cell_action (GalA11yECell *cell) event.key.send_event = TRUE; event.key.time = GDK_CURRENT_TIME; event.key.state = GDK_MOD1_MASK; - event.key.keyval = GDK_Down; + event.key.keyval = GDK_KEY_Down; g_signal_emit_by_name (cell->item, "event", &event, &finished); } diff --git a/widgets/table/gal-a11y-e-table.c b/widgets/table/gal-a11y-e-table.c index 6c68842415..1bf522767b 100644 --- a/widgets/table/gal-a11y-e-table.c +++ b/widgets/table/gal-a11y-e-table.c @@ -22,8 +22,6 @@ #include <config.h> -#include "e-util/gtk-compat.h" - #include "a11y/gal-a11y-util.h" #include "table/e-table.h" #include "table/e-table-click-to-add.h" @@ -35,6 +33,9 @@ #include "gal-a11y-e-table-factory.h" #include "gal-a11y-e-table-item.h" +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + #define CS_CLASS(a11y) (G_TYPE_INSTANCE_GET_CLASS ((a11y), C_TYPE_STREAM, GalA11yETableClass)) static AtkObjectClass *parent_class; static GType parent_type; diff --git a/widgets/table/gal-a11y-e-tree.c b/widgets/table/gal-a11y-e-tree.c index c65ed543c8..87dc8f1618 100644 --- a/widgets/table/gal-a11y-e-tree.c +++ b/widgets/table/gal-a11y-e-tree.c @@ -22,8 +22,6 @@ #include <config.h> -#include "e-util/gtk-compat.h" - #include "a11y/gal-a11y-util.h" #include "table/e-table-item.h" #include "table/e-tree.h" @@ -32,6 +30,9 @@ #include "gal-a11y-e-tree.h" #include "gal-a11y-e-tree-factory.h" +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + #define CS_CLASS(a11y) (G_TYPE_INSTANCE_GET_CLASS ((a11y), C_TYPE_STREAM, GalA11yETreeClass)) static AtkObjectClass *parent_class; static GType parent_type; diff --git a/widgets/text/e-reflow.c b/widgets/text/e-reflow.c index 7a0f7ad121..99b35f9225 100644 --- a/widgets/text/e-reflow.c +++ b/widgets/text/e-reflow.c @@ -927,7 +927,7 @@ e_reflow_event (GnomeCanvasItem *item, GdkEvent *event) break; #if 0 if (event->key.keyval == GDK_Tab || - event->key.keyval == GDK_KP_Tab || + event->key.keyval == GDK_KEY_KP_Tab || event->key.keyval == GDK_ISO_Left_Tab) { gint i; gint count; diff --git a/widgets/text/e-text.c b/widgets/text/e-text.c index 979cae72e0..67e29a84be 100644 --- a/widgets/text/e-text.c +++ b/widgets/text/e-text.c @@ -53,10 +53,12 @@ #include <glib/gi18n.h> #include "e-util/e-text-event-processor-emacs-like.h" #include "e-util/e-util.h" -#include "e-util/gtk-compat.h" #include "e-text.h" +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + G_DEFINE_TYPE (EText, e_text, GNOME_TYPE_CANVAS_ITEM) #define BORDER_INDENT 3 @@ -2113,7 +2115,7 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) /* Handle S-F10 key binding here. */ - if (event->key.keyval == GDK_F10 + if (event->key.keyval == GDK_KEY_F10 && (event->key.state & GDK_SHIFT_MASK) && text->handle_popup ) { |