diff options
author | Colin Walters <walters@verbum.org> | 2010-09-08 13:35:51 -0400 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2010-09-08 18:51:44 -0400 |
commit | 913cdf3be750a1e74c09b20edf55a57f9a919fcc (patch) | |
tree | 0d2129a167579c0d896bb9213503619b2ef44d1f /gtk | |
parent | 03c19e37af1f7aa9af8a48bcc9dc023397f8693f (diff) | |
download | gtk+-913cdf3be750a1e74c09b20edf55a57f9a919fcc.tar.gz |
GDK: Prefix key names with KEY_
The keysyms create a lot of potential namespace conflicts for
C, and are especially problematic for introspection, where we take
constants into the namespace, so GDK_Display conflicts with GdkDisplay.
For C application compatiblity, add gdkkeysyms-compat.h which uses
the old names.
Just one user in GTK+ continues to use gdkkeysyms-compat.h, which is
the gtkimcontextsimple.c, since porting that requires porting more
custom Perl code.
Diffstat (limited to 'gtk')
36 files changed, 636 insertions, 636 deletions
diff --git a/gtk/gtkaboutdialog.c b/gtk/gtkaboutdialog.c index 6a5925f551..1515eb8203 100644 --- a/gtk/gtkaboutdialog.c +++ b/gtk/gtkaboutdialog.c @@ -1878,9 +1878,9 @@ text_view_key_press_event (GtkWidget *text_view, switch (event->keyval) { - case GDK_Return: - case GDK_ISO_Enter: - case GDK_KP_Enter: + case GDK_KEY_Return: + case GDK_KEY_ISO_Enter: + 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)); diff --git a/gtk/gtkaccelgroup.c b/gtk/gtkaccelgroup.c index 79f28591e5..e9bbffee1a 100644 --- a/gtk/gtkaccelgroup.c +++ b/gtk/gtkaccelgroup.c @@ -963,22 +963,22 @@ gtk_accelerator_valid (guint keyval, GdkModifierType modifiers) { static const guint invalid_accelerator_vals[] = { - GDK_Shift_L, GDK_Shift_R, GDK_Shift_Lock, GDK_Caps_Lock, GDK_ISO_Lock, - GDK_Control_L, GDK_Control_R, GDK_Meta_L, GDK_Meta_R, - GDK_Alt_L, GDK_Alt_R, GDK_Super_L, GDK_Super_R, GDK_Hyper_L, GDK_Hyper_R, - GDK_ISO_Level3_Shift, GDK_ISO_Next_Group, GDK_ISO_Prev_Group, - GDK_ISO_First_Group, GDK_ISO_Last_Group, - GDK_Mode_switch, GDK_Num_Lock, GDK_Multi_key, - GDK_Scroll_Lock, GDK_Sys_Req, - GDK_Tab, GDK_ISO_Left_Tab, GDK_KP_Tab, - GDK_First_Virtual_Screen, GDK_Prev_Virtual_Screen, - GDK_Next_Virtual_Screen, GDK_Last_Virtual_Screen, - GDK_Terminate_Server, GDK_AudibleBell_Enable, + GDK_KEY_Shift_L, GDK_KEY_Shift_R, GDK_KEY_Shift_Lock, GDK_KEY_Caps_Lock, GDK_KEY_ISO_Lock, + GDK_KEY_Control_L, GDK_KEY_Control_R, GDK_KEY_Meta_L, GDK_KEY_Meta_R, + GDK_KEY_Alt_L, GDK_KEY_Alt_R, GDK_KEY_Super_L, GDK_KEY_Super_R, GDK_KEY_Hyper_L, GDK_KEY_Hyper_R, + GDK_KEY_ISO_Level3_Shift, GDK_KEY_ISO_Next_Group, GDK_KEY_ISO_Prev_Group, + GDK_KEY_ISO_First_Group, GDK_KEY_ISO_Last_Group, + GDK_KEY_Mode_switch, GDK_KEY_Num_Lock, GDK_KEY_Multi_key, + GDK_KEY_Scroll_Lock, GDK_KEY_Sys_Req, + GDK_KEY_Tab, GDK_KEY_ISO_Left_Tab, GDK_KEY_KP_Tab, + GDK_KEY_First_Virtual_Screen, GDK_KEY_Prev_Virtual_Screen, + GDK_KEY_Next_Virtual_Screen, GDK_KEY_Last_Virtual_Screen, + GDK_KEY_Terminate_Server, GDK_KEY_AudibleBell_Enable, 0 }; static const guint invalid_unmodified_vals[] = { - GDK_Up, GDK_Down, GDK_Left, GDK_Right, - GDK_KP_Up, GDK_KP_Down, GDK_KP_Left, GDK_KP_Right, + GDK_KEY_Up, GDK_KEY_Down, GDK_KEY_Left, GDK_KEY_Right, + GDK_KEY_KP_Up, GDK_KEY_KP_Down, GDK_KEY_KP_Left, GDK_KEY_KP_Right, 0 }; const guint *ac_val; diff --git a/gtk/gtkbindings.c b/gtk/gtkbindings.c index 406331392a..648e572144 100644 --- a/gtk/gtkbindings.c +++ b/gtk/gtkbindings.c @@ -131,8 +131,8 @@ binding_key_hash_insert_entry (GtkKeyHash *key_hash, */ if (entry->modifiers & GDK_SHIFT_MASK) { - if (keyval == GDK_Tab) - keyval = GDK_ISO_Left_Tab; + if (keyval == GDK_KEY_Tab) + keyval = GDK_KEY_ISO_Left_Tab; else keyval = gdk_keyval_to_upper (keyval); } diff --git a/gtk/gtkcalendar.c b/gtk/gtkcalendar.c index b9057eb3e8..2fe80ff781 100644 --- a/gtk/gtkcalendar.c +++ b/gtk/gtkcalendar.c @@ -3367,8 +3367,8 @@ gtk_calendar_key_press (GtkWidget *widget, switch (event->keyval) { - case GDK_KP_Left: - case GDK_Left: + case GDK_KEY_KP_Left: + case GDK_KEY_Left: return_val = TRUE; if (event->state & GDK_CONTROL_MASK) calendar_set_month_prev (calendar); @@ -3380,8 +3380,8 @@ gtk_calendar_key_press (GtkWidget *widget, priv->focus_col); } break; - case GDK_KP_Right: - case GDK_Right: + case GDK_KEY_KP_Right: + case GDK_KEY_Right: return_val = TRUE; if (event->state & GDK_CONTROL_MASK) calendar_set_month_next (calendar); @@ -3393,8 +3393,8 @@ gtk_calendar_key_press (GtkWidget *widget, priv->focus_col); } break; - case GDK_KP_Up: - case GDK_Up: + case GDK_KEY_KP_Up: + case GDK_KEY_Up: return_val = TRUE; if (event->state & GDK_CONTROL_MASK) calendar_set_year_prev (calendar); @@ -3411,8 +3411,8 @@ gtk_calendar_key_press (GtkWidget *widget, priv->focus_col); } break; - case GDK_KP_Down: - case GDK_Down: + case GDK_KEY_KP_Down: + case GDK_KEY_Down: return_val = TRUE; if (event->state & GDK_CONTROL_MASK) calendar_set_year_next (calendar); @@ -3427,8 +3427,8 @@ gtk_calendar_key_press (GtkWidget *widget, priv->focus_col); } break; - case GDK_KP_Space: - case GDK_space: + case GDK_KEY_KP_Space: + case GDK_KEY_space: row = priv->focus_row; col = priv->focus_col; diff --git a/gtk/gtkcellrendereraccel.c b/gtk/gtkcellrendereraccel.c index b5f58574f1..50dc502751 100644 --- a/gtk/gtkcellrendereraccel.c +++ b/gtk/gtkcellrendereraccel.c @@ -454,8 +454,8 @@ grab_key_callback (GtkWidget *widget, NULL, NULL, NULL, &consumed_modifiers); accel_key = gdk_keyval_to_lower (event->keyval); - if (accel_key == GDK_ISO_Left_Tab) - accel_key = GDK_Tab; + if (accel_key == GDK_KEY_ISO_Left_Tab) + accel_key = GDK_KEY_Tab; accel_mods = event->state & gtk_accelerator_get_default_mod_mask (); @@ -473,9 +473,9 @@ grab_key_callback (GtkWidget *widget, { switch (event->keyval) { - case GDK_Escape: + case GDK_KEY_Escape: goto out; /* cancel */ - case GDK_BackSpace: + case GDK_KEY_BackSpace: /* clear the accelerator on Backspace */ cleared = TRUE; goto out; diff --git a/gtk/gtkcellrendererspin.c b/gtk/gtkcellrendererspin.c index b7f589e285..7bac620607 100644 --- a/gtk/gtkcellrendererspin.c +++ b/gtk/gtkcellrendererspin.c @@ -259,12 +259,12 @@ gtk_cell_renderer_spin_key_press_event (GtkWidget *widget, { if (event->state == 0) { - if (event->keyval == GDK_Up) + if (event->keyval == GDK_KEY_Up) { gtk_spin_button_spin (GTK_SPIN_BUTTON (widget), GTK_SPIN_STEP_FORWARD, 1); return TRUE; } - else if (event->keyval == GDK_Down) + else if (event->keyval == GDK_KEY_Down) { gtk_spin_button_spin (GTK_SPIN_BUTTON (widget), GTK_SPIN_STEP_BACKWARD, 1); return TRUE; diff --git a/gtk/gtkcolorsel.c b/gtk/gtkcolorsel.c index 4d51bb86ef..117f72e477 100644 --- a/gtk/gtkcolorsel.c +++ b/gtk/gtkcolorsel.c @@ -1527,11 +1527,11 @@ palette_activate (GtkWidget *widget, gpointer data) { /* should have a drawing area subclass with an activate signal */ - if ((event->keyval == GDK_space) || - (event->keyval == GDK_Return) || - (event->keyval == GDK_ISO_Enter) || - (event->keyval == GDK_KP_Enter) || - (event->keyval == GDK_KP_Space)) + if ((event->keyval == GDK_KEY_space) || + (event->keyval == GDK_KEY_Return) || + (event->keyval == GDK_KEY_ISO_Enter) || + (event->keyval == GDK_KEY_KP_Enter) || + (event->keyval == GDK_KEY_KP_Space)) { if (GPOINTER_TO_INT (g_object_get_data (G_OBJECT (widget), "color_set")) != 0) { @@ -1811,15 +1811,15 @@ key_press (GtkWidget *invisible, switch (event->keyval) { - case GDK_space: - case GDK_Return: - case GDK_ISO_Enter: - case GDK_KP_Enter: - case GDK_KP_Space: + case GDK_KEY_space: + case GDK_KEY_Return: + case GDK_KEY_ISO_Enter: + case GDK_KEY_KP_Enter: + case GDK_KEY_KP_Space: grab_color_at_pointer (screen, pointer_device, x, y, data); /* fall through */ - case GDK_Escape: + case GDK_KEY_Escape: shutdown_eyedropper (data); g_signal_handlers_disconnect_by_func (invisible, @@ -1832,23 +1832,23 @@ key_press (GtkWidget *invisible, return TRUE; #if defined GDK_WINDOWING_X11 || defined GDK_WINDOWING_WIN32 - case GDK_Up: - case GDK_KP_Up: + case GDK_KEY_Up: + case GDK_KEY_KP_Up: dy = state == GDK_MOD1_MASK ? -BIG_STEP : -1; break; - case GDK_Down: - case GDK_KP_Down: + case GDK_KEY_Down: + case GDK_KEY_KP_Down: dy = state == GDK_MOD1_MASK ? BIG_STEP : 1; break; - case GDK_Left: - case GDK_KP_Left: + case GDK_KEY_Left: + case GDK_KEY_KP_Left: dx = state == GDK_MOD1_MASK ? -BIG_STEP : -1; break; - case GDK_Right: - case GDK_KP_Right: + case GDK_KEY_Right: + case GDK_KEY_KP_Right: dx = state == GDK_MOD1_MASK ? BIG_STEP : 1; break; #endif diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c index 99c9a88feb..629861c802 100644 --- a/gtk/gtkcombobox.c +++ b/gtk/gtkcombobox.c @@ -617,53 +617,53 @@ gtk_combo_box_class_init (GtkComboBoxClass *klass) /* key bindings */ binding_set = gtk_binding_set_by_class (widget_class); - gtk_binding_entry_add_signal (binding_set, GDK_Down, GDK_MOD1_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Down, GDK_MOD1_MASK, "popup", 0); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Down, GDK_MOD1_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Down, GDK_MOD1_MASK, "popup", 0); - gtk_binding_entry_add_signal (binding_set, GDK_Up, GDK_MOD1_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Up, GDK_MOD1_MASK, "popdown", 0); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Up, GDK_MOD1_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Up, GDK_MOD1_MASK, "popdown", 0); - gtk_binding_entry_add_signal (binding_set, GDK_Escape, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Escape, 0, "popdown", 0); - gtk_binding_entry_add_signal (binding_set, GDK_Up, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Up, 0, "move-active", 1, GTK_TYPE_SCROLL_TYPE, GTK_SCROLL_STEP_UP); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Up, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Up, 0, "move-active", 1, GTK_TYPE_SCROLL_TYPE, GTK_SCROLL_STEP_UP); - gtk_binding_entry_add_signal (binding_set, GDK_Page_Up, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Page_Up, 0, "move-active", 1, GTK_TYPE_SCROLL_TYPE, GTK_SCROLL_PAGE_UP); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Page_Up, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Page_Up, 0, "move-active", 1, GTK_TYPE_SCROLL_TYPE, GTK_SCROLL_PAGE_UP); - gtk_binding_entry_add_signal (binding_set, GDK_Home, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Home, 0, "move-active", 1, GTK_TYPE_SCROLL_TYPE, GTK_SCROLL_START); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Home, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Home, 0, "move-active", 1, GTK_TYPE_SCROLL_TYPE, GTK_SCROLL_START); - gtk_binding_entry_add_signal (binding_set, GDK_Down, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Down, 0, "move-active", 1, GTK_TYPE_SCROLL_TYPE, GTK_SCROLL_STEP_DOWN); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Down, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Down, 0, "move-active", 1, GTK_TYPE_SCROLL_TYPE, GTK_SCROLL_STEP_DOWN); - gtk_binding_entry_add_signal (binding_set, GDK_Page_Down, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Page_Down, 0, "move-active", 1, GTK_TYPE_SCROLL_TYPE, GTK_SCROLL_PAGE_DOWN); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Page_Down, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Page_Down, 0, "move-active", 1, GTK_TYPE_SCROLL_TYPE, GTK_SCROLL_PAGE_DOWN); - gtk_binding_entry_add_signal (binding_set, GDK_End, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_End, 0, "move-active", 1, GTK_TYPE_SCROLL_TYPE, GTK_SCROLL_END); - gtk_binding_entry_add_signal (binding_set, GDK_KP_End, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_End, 0, "move-active", 1, GTK_TYPE_SCROLL_TYPE, GTK_SCROLL_END); @@ -3986,8 +3986,8 @@ gtk_combo_box_list_key_press (GtkWidget *widget, GtkComboBox *combo_box = GTK_COMBO_BOX (data); GtkTreeIter iter; - if (event->keyval == GDK_Return || event->keyval == GDK_ISO_Enter || event->keyval == GDK_KP_Enter || - event->keyval == GDK_space || event->keyval == GDK_KP_Space) + if (event->keyval == GDK_KEY_Return || event->keyval == GDK_KEY_ISO_Enter || event->keyval == GDK_KEY_KP_Enter || + event->keyval == GDK_KEY_space || event->keyval == GDK_KEY_KP_Space) { GtkTreeModel *model = NULL; @@ -5503,7 +5503,7 @@ gtk_cell_editable_key_press (GtkWidget *widget, { GtkComboBox *combo_box = GTK_COMBO_BOX (data); - if (event->keyval == GDK_Escape) + if (event->keyval == GDK_KEY_Escape) { g_object_set (combo_box, "editing-canceled", TRUE, @@ -5513,9 +5513,9 @@ gtk_cell_editable_key_press (GtkWidget *widget, return TRUE; } - else if (event->keyval == GDK_Return || - event->keyval == GDK_ISO_Enter || - event->keyval == GDK_KP_Enter) + else if (event->keyval == GDK_KEY_Return || + event->keyval == GDK_KEY_ISO_Enter || + event->keyval == GDK_KEY_KP_Enter) { gtk_cell_editable_editing_done (GTK_CELL_EDITABLE (combo_box)); gtk_cell_editable_remove_widget (GTK_CELL_EDITABLE (combo_box)); diff --git a/gtk/gtkdialog.c b/gtk/gtkdialog.c index 1fb80344aa..169eb29214 100644 --- a/gtk/gtkdialog.c +++ b/gtk/gtkdialog.c @@ -206,7 +206,7 @@ gtk_dialog_class_init (GtkDialogClass *class) binding_set = gtk_binding_set_by_class (class); - gtk_binding_entry_add_signal (binding_set, GDK_Escape, 0, "close", 0); + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Escape, 0, "close", 0); } static void diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c index f190b3953a..8c10008cac 100644 --- a/gtk/gtkdnd.c +++ b/gtk/gtkdnd.c @@ -4219,36 +4219,36 @@ gtk_drag_key_cb (GtkWidget *widget, { switch (event->keyval) { - case GDK_Escape: + case GDK_KEY_Escape: gtk_drag_cancel (info, GTK_DRAG_RESULT_USER_CANCELLED, event->time); return TRUE; - case GDK_space: - case GDK_Return: - case GDK_ISO_Enter: - case GDK_KP_Enter: - case GDK_KP_Space: + case GDK_KEY_space: + case GDK_KEY_Return: + case GDK_KEY_ISO_Enter: + case GDK_KEY_KP_Enter: + case GDK_KEY_KP_Space: gtk_drag_end (info, event->time); gtk_drag_drop (info, event->time); return TRUE; - case GDK_Up: - case GDK_KP_Up: + case GDK_KEY_Up: + case GDK_KEY_KP_Up: dy = (state & GDK_MOD1_MASK) ? -BIG_STEP : -SMALL_STEP; break; - case GDK_Down: - case GDK_KP_Down: + case GDK_KEY_Down: + case GDK_KEY_KP_Down: dy = (state & GDK_MOD1_MASK) ? BIG_STEP : SMALL_STEP; break; - case GDK_Left: - case GDK_KP_Left: + case GDK_KEY_Left: + case GDK_KEY_KP_Left: dx = (state & GDK_MOD1_MASK) ? -BIG_STEP : -SMALL_STEP; break; - case GDK_Right: - case GDK_KP_Right: + case GDK_KEY_Right: + case GDK_KEY_KP_Right: dx = (state & GDK_MOD1_MASK) ? BIG_STEP : SMALL_STEP; break; } diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c index 548e42ca7f..7eb25a09aa 100644 --- a/gtk/gtkentry.c +++ b/gtk/gtkentry.c @@ -1581,85 +1581,85 @@ gtk_entry_class_init (GtkEntryClass *class) binding_set = gtk_binding_set_by_class (class); /* Moving the insertion point */ - add_move_binding (binding_set, GDK_Right, 0, + add_move_binding (binding_set, GDK_KEY_Right, 0, GTK_MOVEMENT_VISUAL_POSITIONS, 1); - add_move_binding (binding_set, GDK_Left, 0, + add_move_binding (binding_set, GDK_KEY_Left, 0, GTK_MOVEMENT_VISUAL_POSITIONS, -1); - add_move_binding (binding_set, GDK_KP_Right, 0, + add_move_binding (binding_set, GDK_KEY_KP_Right, 0, GTK_MOVEMENT_VISUAL_POSITIONS, 1); - add_move_binding (binding_set, GDK_KP_Left, 0, + add_move_binding (binding_set, GDK_KEY_KP_Left, 0, GTK_MOVEMENT_VISUAL_POSITIONS, -1); - add_move_binding (binding_set, GDK_Right, GDK_CONTROL_MASK, + add_move_binding (binding_set, GDK_KEY_Right, GDK_CONTROL_MASK, GTK_MOVEMENT_WORDS, 1); - add_move_binding (binding_set, GDK_Left, GDK_CONTROL_MASK, + add_move_binding (binding_set, GDK_KEY_Left, GDK_CONTROL_MASK, GTK_MOVEMENT_WORDS, -1); - add_move_binding (binding_set, GDK_KP_Right, GDK_CONTROL_MASK, + add_move_binding (binding_set, GDK_KEY_KP_Right, GDK_CONTROL_MASK, GTK_MOVEMENT_WORDS, 1); - add_move_binding (binding_set, GDK_KP_Left, GDK_CONTROL_MASK, + add_move_binding (binding_set, GDK_KEY_KP_Left, GDK_CONTROL_MASK, GTK_MOVEMENT_WORDS, -1); - add_move_binding (binding_set, GDK_Home, 0, + add_move_binding (binding_set, GDK_KEY_Home, 0, GTK_MOVEMENT_DISPLAY_LINE_ENDS, -1); - add_move_binding (binding_set, GDK_End, 0, + add_move_binding (binding_set, GDK_KEY_End, 0, GTK_MOVEMENT_DISPLAY_LINE_ENDS, 1); - add_move_binding (binding_set, GDK_KP_Home, 0, + add_move_binding (binding_set, GDK_KEY_KP_Home, 0, GTK_MOVEMENT_DISPLAY_LINE_ENDS, -1); - add_move_binding (binding_set, GDK_KP_End, 0, + add_move_binding (binding_set, GDK_KEY_KP_End, 0, GTK_MOVEMENT_DISPLAY_LINE_ENDS, 1); - add_move_binding (binding_set, GDK_Home, GDK_CONTROL_MASK, + add_move_binding (binding_set, GDK_KEY_Home, GDK_CONTROL_MASK, GTK_MOVEMENT_BUFFER_ENDS, -1); - add_move_binding (binding_set, GDK_End, GDK_CONTROL_MASK, + add_move_binding (binding_set, GDK_KEY_End, GDK_CONTROL_MASK, GTK_MOVEMENT_BUFFER_ENDS, 1); - add_move_binding (binding_set, GDK_KP_Home, GDK_CONTROL_MASK, + add_move_binding (binding_set, GDK_KEY_KP_Home, GDK_CONTROL_MASK, GTK_MOVEMENT_BUFFER_ENDS, -1); - add_move_binding (binding_set, GDK_KP_End, GDK_CONTROL_MASK, + add_move_binding (binding_set, GDK_KEY_KP_End, GDK_CONTROL_MASK, GTK_MOVEMENT_BUFFER_ENDS, 1); /* Select all */ - gtk_binding_entry_add_signal (binding_set, GDK_a, GDK_CONTROL_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_a, GDK_CONTROL_MASK, "move-cursor", 3, GTK_TYPE_MOVEMENT_STEP, GTK_MOVEMENT_BUFFER_ENDS, G_TYPE_INT, -1, G_TYPE_BOOLEAN, FALSE); - gtk_binding_entry_add_signal (binding_set, GDK_a, GDK_CONTROL_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_a, GDK_CONTROL_MASK, "move-cursor", 3, GTK_TYPE_MOVEMENT_STEP, GTK_MOVEMENT_BUFFER_ENDS, G_TYPE_INT, 1, G_TYPE_BOOLEAN, TRUE); - gtk_binding_entry_add_signal (binding_set, GDK_slash, GDK_CONTROL_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_slash, GDK_CONTROL_MASK, "move-cursor", 3, GTK_TYPE_MOVEMENT_STEP, GTK_MOVEMENT_BUFFER_ENDS, G_TYPE_INT, -1, G_TYPE_BOOLEAN, FALSE); - gtk_binding_entry_add_signal (binding_set, GDK_slash, GDK_CONTROL_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_slash, GDK_CONTROL_MASK, "move-cursor", 3, GTK_TYPE_MOVEMENT_STEP, GTK_MOVEMENT_BUFFER_ENDS, G_TYPE_INT, 1, G_TYPE_BOOLEAN, TRUE); /* Unselect all */ - gtk_binding_entry_add_signal (binding_set, GDK_backslash, GDK_CONTROL_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_backslash, GDK_CONTROL_MASK, "move-cursor", 3, GTK_TYPE_MOVEMENT_STEP, GTK_MOVEMENT_VISUAL_POSITIONS, G_TYPE_INT, 0, G_TYPE_BOOLEAN, FALSE); - gtk_binding_entry_add_signal (binding_set, GDK_a, GDK_SHIFT_MASK | GDK_CONTROL_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_a, GDK_SHIFT_MASK | GDK_CONTROL_MASK, "move-cursor", 3, GTK_TYPE_MOVEMENT_STEP, GTK_MOVEMENT_VISUAL_POSITIONS, G_TYPE_INT, 0, @@ -1667,66 +1667,66 @@ gtk_entry_class_init (GtkEntryClass *class) /* Activate */ - gtk_binding_entry_add_signal (binding_set, GDK_Return, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Return, 0, "activate", 0); - gtk_binding_entry_add_signal (binding_set, GDK_ISO_Enter, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_ISO_Enter, 0, "activate", 0); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Enter, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Enter, 0, "activate", 0); /* Deleting text */ - gtk_binding_entry_add_signal (binding_set, GDK_Delete, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Delete, 0, "delete-from-cursor", 2, G_TYPE_ENUM, GTK_DELETE_CHARS, G_TYPE_INT, 1); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Delete, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Delete, 0, "delete-from-cursor", 2, G_TYPE_ENUM, GTK_DELETE_CHARS, G_TYPE_INT, 1); - gtk_binding_entry_add_signal (binding_set, GDK_BackSpace, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_BackSpace, 0, "backspace", 0); /* Make this do the same as Backspace, to help with mis-typing */ - gtk_binding_entry_add_signal (binding_set, GDK_BackSpace, GDK_SHIFT_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_BackSpace, GDK_SHIFT_MASK, "backspace", 0); - gtk_binding_entry_add_signal (binding_set, GDK_Delete, GDK_CONTROL_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Delete, GDK_CONTROL_MASK, "delete-from-cursor", 2, G_TYPE_ENUM, GTK_DELETE_WORD_ENDS, G_TYPE_INT, 1); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Delete, GDK_CONTROL_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Delete, GDK_CONTROL_MASK, "delete-from-cursor", 2, G_TYPE_ENUM, GTK_DELETE_WORD_ENDS, G_TYPE_INT, 1); - gtk_binding_entry_add_signal (binding_set, GDK_BackSpace, GDK_CONTROL_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_BackSpace, GDK_CONTROL_MASK, "delete-from-cursor", 2, G_TYPE_ENUM, GTK_DELETE_WORD_ENDS, G_TYPE_INT, -1); /* Cut/copy/paste */ - gtk_binding_entry_add_signal (binding_set, GDK_x, GDK_CONTROL_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_x, GDK_CONTROL_MASK, "cut-clipboard", 0); - gtk_binding_entry_add_signal (binding_set, GDK_c, GDK_CONTROL_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_c, GDK_CONTROL_MASK, "copy-clipboard", 0); - gtk_binding_entry_add_signal (binding_set, GDK_v, GDK_CONTROL_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_v, GDK_CONTROL_MASK, "paste-clipboard", 0); - gtk_binding_entry_add_signal (binding_set, GDK_Delete, GDK_SHIFT_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Delete, GDK_SHIFT_MASK, "cut-clipboard", 0); - gtk_binding_entry_add_signal (binding_set, GDK_Insert, GDK_CONTROL_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Insert, GDK_CONTROL_MASK, "copy-clipboard", 0); - gtk_binding_entry_add_signal (binding_set, GDK_Insert, GDK_SHIFT_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Insert, GDK_SHIFT_MASK, "paste-clipboard", 0); /* Overwrite */ - gtk_binding_entry_add_signal (binding_set, GDK_Insert, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Insert, 0, "toggle-overwrite", 0); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Insert, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Insert, 0, "toggle-overwrite", 0); /** @@ -4104,10 +4104,10 @@ gtk_entry_key_press (GtkWidget *widget, } } - if (event->keyval == GDK_Return || - event->keyval == GDK_KP_Enter || - event->keyval == GDK_ISO_Enter || - event->keyval == GDK_Escape) + if (event->keyval == GDK_KEY_Return || + event->keyval == GDK_KEY_KP_Enter || + event->keyval == GDK_KEY_ISO_Enter || + event->keyval == GDK_KEY_Escape) { GtkEntryCompletion *completion = gtk_entry_get_completion (entry); @@ -4513,7 +4513,7 @@ gtk_cell_editable_key_press_event (GtkEntry *entry, GdkEventKey *key_event, gpointer data) { - if (key_event->keyval == GDK_Escape) + if (key_event->keyval == GDK_KEY_Escape) { entry->editing_canceled = TRUE; gtk_cell_editable_editing_done (GTK_CELL_EDITABLE (entry)); @@ -4523,7 +4523,7 @@ gtk_cell_editable_key_press_event (GtkEntry *entry, } /* override focus */ - if (key_event->keyval == GDK_Up || key_event->keyval == GDK_Down) + if (key_event->keyval == GDK_KEY_Up || key_event->keyval == GDK_KEY_Down) { gtk_cell_editable_editing_done (GTK_CELL_EDITABLE (entry)); gtk_cell_editable_remove_widget (GTK_CELL_EDITABLE (entry)); @@ -9215,16 +9215,16 @@ gtk_entry_completion_timeout (gpointer data) static inline gboolean keyval_is_cursor_move (guint keyval) { - if (keyval == GDK_Up || keyval == GDK_KP_Up) + if (keyval == GDK_KEY_Up || keyval == GDK_KEY_KP_Up) return TRUE; - if (keyval == GDK_Down || keyval == GDK_KP_Down) + if (keyval == GDK_KEY_Down || keyval == GDK_KEY_KP_Down) return TRUE; - if (keyval == GDK_Page_Up) + if (keyval == GDK_KEY_Page_Up) return TRUE; - if (keyval == GDK_Page_Down) + if (keyval == GDK_KEY_Page_Down) return TRUE; return FALSE; @@ -9250,21 +9250,21 @@ gtk_entry_completion_key_press (GtkWidget *widget, { GtkTreePath *path = NULL; - if (event->keyval == GDK_Up || event->keyval == GDK_KP_Up) + if (event->keyval == GDK_KEY_Up || event->keyval == GDK_KEY_KP_Up) { if (completion->priv->current_selected < 0) completion->priv->current_selected = matches + actions - 1; else completion->priv->current_selected--; } - else if (event->keyval == GDK_Down || event->keyval == GDK_KP_Down) + else if (event->keyval == GDK_KEY_Down || event->keyval == GDK_KEY_KP_Down) { if (completion->priv->current_selected < matches + actions - 1) completion->priv->current_selected++; else completion->priv->current_selected = -1; } - else if (event->keyval == GDK_Page_Up) + else if (event->keyval == GDK_KEY_Page_Up) { if (completion->priv->current_selected < 0) completion->priv->current_selected = matches + actions - 1; @@ -9283,7 +9283,7 @@ gtk_entry_completion_key_press (GtkWidget *widget, completion->priv->current_selected = matches - 1; } } - else if (event->keyval == GDK_Page_Down) + else if (event->keyval == GDK_KEY_Page_Down) { if (completion->priv->current_selected < 0) completion->priv->current_selected = 0; @@ -9370,11 +9370,11 @@ gtk_entry_completion_key_press (GtkWidget *widget, return TRUE; } - else if (event->keyval == GDK_Escape || - event->keyval == GDK_Left || - event->keyval == GDK_KP_Left || - event->keyval == GDK_Right || - event->keyval == GDK_KP_Right) + else if (event->keyval == GDK_KEY_Escape || + event->keyval == GDK_KEY_Left || + event->keyval == GDK_KEY_KP_Left || + event->keyval == GDK_KEY_Right || + event->keyval == GDK_KEY_KP_Right) { gboolean retval = TRUE; @@ -9389,7 +9389,7 @@ gtk_entry_completion_key_press (GtkWidget *widget, else if (completion->priv->inline_selection) { /* Escape rejects the tentative completion */ - if (event->keyval == GDK_Escape) + if (event->keyval == GDK_KEY_Escape) { if (completion->priv->completion_prefix) gtk_entry_set_text (GTK_ENTRY (completion->priv->entry), @@ -9400,9 +9400,9 @@ gtk_entry_completion_key_press (GtkWidget *widget, /* Move the cursor to the end for Right/Esc, to the beginning for Left */ - if (event->keyval == GDK_Right || - event->keyval == GDK_KP_Right || - event->keyval == GDK_Escape) + if (event->keyval == GDK_KEY_Right || + event->keyval == GDK_KEY_KP_Right || + event->keyval == GDK_KEY_Escape) gtk_editable_set_position (GTK_EDITABLE (widget), -1); else gtk_editable_set_position (GTK_EDITABLE (widget), 0); @@ -9417,11 +9417,11 @@ keypress_completion_out: return retval; } - else if (event->keyval == GDK_Tab || - event->keyval == GDK_KP_Tab || - event->keyval == GDK_ISO_Left_Tab) + else if (event->keyval == GDK_KEY_Tab || + event->keyval == GDK_KEY_KP_Tab || + event->keyval == GDK_KEY_ISO_Left_Tab) { - GtkDirectionType dir = event->keyval == GDK_ISO_Left_Tab ? + GtkDirectionType dir = event->keyval == GDK_KEY_ISO_Left_Tab ? GTK_DIR_TAB_BACKWARD : GTK_DIR_TAB_FORWARD; _gtk_entry_reset_im_context (GTK_ENTRY (widget)); @@ -9434,9 +9434,9 @@ keypress_completion_out: return TRUE; } - else if (event->keyval == GDK_ISO_Enter || - event->keyval == GDK_KP_Enter || - event->keyval == GDK_Return) + else if (event->keyval == GDK_KEY_ISO_Enter || + event->keyval == GDK_KEY_KP_Enter || + event->keyval == GDK_KEY_Return) { GtkTreeIter iter; GtkTreeModel *model = NULL; diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c index f413992599..d7cd8a3110 100644 --- a/gtk/gtkfilechooserdefault.c +++ b/gtk/gtkfilechooserdefault.c @@ -459,7 +459,7 @@ static void _gtk_file_chooser_default_class_init (GtkFileChooserDefaultClass *class) { static const guint quick_bookmark_keyvals[10] = { - GDK_1, GDK_2, GDK_3, GDK_4, GDK_5, GDK_6, GDK_7, GDK_8, GDK_9, GDK_0 + GDK_KEY_1, GDK_KEY_2, GDK_KEY_3, GDK_KEY_4, GDK_KEY_5, GDK_KEY_6, GDK_KEY_7, GDK_KEY_8, GDK_KEY_9, GDK_KEY_0 }; GObjectClass *gobject_class = G_OBJECT_CLASS (class); GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class); @@ -583,74 +583,74 @@ _gtk_file_chooser_default_class_init (GtkFileChooserDefaultClass *class) binding_set = gtk_binding_set_by_class (class); gtk_binding_entry_add_signal (binding_set, - GDK_l, GDK_CONTROL_MASK, + GDK_KEY_l, GDK_CONTROL_MASK, "location-toggle-popup", 0); gtk_binding_entry_add_signal (binding_set, - GDK_slash, 0, + GDK_KEY_slash, 0, "location-popup", 1, G_TYPE_STRING, "/"); gtk_binding_entry_add_signal (binding_set, - GDK_KP_Divide, 0, + GDK_KEY_KP_Divide, 0, "location-popup", 1, G_TYPE_STRING, "/"); #ifdef G_OS_UNIX gtk_binding_entry_add_signal (binding_set, - GDK_asciitilde, 0, + GDK_KEY_asciitilde, 0, "location-popup", 1, G_TYPE_STRING, "~"); #endif gtk_binding_entry_add_signal (binding_set, - GDK_v, GDK_CONTROL_MASK, + GDK_KEY_v, GDK_CONTROL_MASK, "location-popup-on-paste", 0); gtk_binding_entry_add_signal (binding_set, - GDK_Up, GDK_MOD1_MASK, + GDK_KEY_Up, GDK_MOD1_MASK, "up-folder", 0); gtk_binding_entry_add_signal (binding_set, - GDK_BackSpace, 0, + GDK_KEY_BackSpace, 0, "up-folder", 0); gtk_binding_entry_add_signal (binding_set, - GDK_KP_Up, GDK_MOD1_MASK, + GDK_KEY_KP_Up, GDK_MOD1_MASK, "up-folder", 0); gtk_binding_entry_add_signal (binding_set, - GDK_Down, GDK_MOD1_MASK, + GDK_KEY_Down, GDK_MOD1_MASK, "down-folder", 0); gtk_binding_entry_add_signal (binding_set, - GDK_KP_Down, GDK_MOD1_MASK, + GDK_KEY_KP_Down, GDK_MOD1_MASK, "down-folder", 0); gtk_binding_entry_add_signal (binding_set, - GDK_Home, GDK_MOD1_MASK, + GDK_KEY_Home, GDK_MOD1_MASK, "home-folder", 0); gtk_binding_entry_add_signal (binding_set, - GDK_KP_Home, GDK_MOD1_MASK, + GDK_KEY_KP_Home, GDK_MOD1_MASK, "home-folder", 0); gtk_binding_entry_add_signal (binding_set, - GDK_d, GDK_MOD1_MASK, + GDK_KEY_d, GDK_MOD1_MASK, "desktop-folder", 0); gtk_binding_entry_add_signal (binding_set, - GDK_h, GDK_CONTROL_MASK, + GDK_KEY_h, GDK_CONTROL_MASK, "show-hidden", 0); gtk_binding_entry_add_signal (binding_set, - GDK_s, GDK_MOD1_MASK, + GDK_KEY_s, GDK_MOD1_MASK, "search-shortcut", 0); gtk_binding_entry_add_signal (binding_set, - GDK_r, GDK_MOD1_MASK, + GDK_KEY_r, GDK_MOD1_MASK, "recent-shortcut", 0); @@ -3327,9 +3327,9 @@ shortcuts_key_press_event_after_cb (GtkWidget *tree_view, GtkWidget *entry; /* don't screw up focus switching with Tab */ - if (event->keyval == GDK_Tab - || event->keyval == GDK_KP_Tab - || event->keyval == GDK_ISO_Left_Tab + if (event->keyval == GDK_KEY_Tab + || event->keyval == GDK_KEY_KP_Tab + || event->keyval == GDK_KEY_ISO_Left_Tab || event->length < 1) return FALSE; @@ -3732,10 +3732,10 @@ key_is_left_or_right (GdkEventKey *event) modifiers = gtk_accelerator_get_default_mod_mask (); - return ((event->keyval == GDK_Right - || event->keyval == GDK_KP_Right - || event->keyval == GDK_Left - || event->keyval == GDK_KP_Left) + return ((event->keyval == GDK_KEY_Right + || event->keyval == GDK_KEY_KP_Right + || event->keyval == GDK_KEY_Left + || event->keyval == GDK_KEY_KP_Left) && (event->state & modifiers) == 0); } @@ -3755,10 +3755,10 @@ browse_files_key_press_event_cb (GtkWidget *widget, modifiers = gtk_accelerator_get_default_mod_mask (); - if ((event->keyval == GDK_slash - || event->keyval == GDK_KP_Divide + if ((event->keyval == GDK_KEY_slash + || event->keyval == GDK_KEY_KP_Divide #ifdef G_OS_UNIX - || event->keyval == GDK_asciitilde + || event->keyval == GDK_KEY_asciitilde #endif ) && ! (event->state & (~GDK_SHIFT_MASK & modifiers))) { @@ -3772,11 +3772,11 @@ browse_files_key_press_event_cb (GtkWidget *widget, return TRUE; } - if ((event->keyval == GDK_Return - || event->keyval == GDK_ISO_Enter - || event->keyval == GDK_KP_Enter - || event->keyval == GDK_space - || event->keyval == GDK_KP_Space) + if ((event->keyval == GDK_KEY_Return + || event->keyval == GDK_KEY_ISO_Enter + || event->keyval == GDK_KEY_KP_Enter + || event->keyval == GDK_KEY_space + || event->keyval == GDK_KEY_KP_Space) && ((event->state & modifiers) == 0) && !(impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER || impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER)) @@ -9693,16 +9693,16 @@ shortcuts_key_press_event_cb (GtkWidget *widget, return TRUE; } - if ((event->keyval == GDK_BackSpace - || event->keyval == GDK_Delete - || event->keyval == GDK_KP_Delete) + if ((event->keyval == GDK_KEY_BackSpace + || event->keyval == GDK_KEY_Delete + || event->keyval == GDK_KEY_KP_Delete) && (event->state & modifiers) == 0) { remove_selected_bookmarks (impl); return TRUE; } - if ((event->keyval == GDK_F2) + if ((event->keyval == GDK_KEY_F2) && (event->state & modifiers) == 0) { rename_selected_bookmark (impl); diff --git a/gtk/gtkfilechooserentry.c b/gtk/gtkfilechooserentry.c index 1f91dc393f..a79eece5bb 100644 --- a/gtk/gtkfilechooserentry.c +++ b/gtk/gtkfilechooserentry.c @@ -1248,7 +1248,7 @@ gtk_file_chooser_entry_key_press_event (GtkWidget *widget, /* This is a bit evil -- it makes Tab never leave the entry. It basically * makes it 'safe' for people to hit. */ - if (event->keyval == GDK_Tab && !control_pressed) + if (event->keyval == GDK_KEY_Tab && !control_pressed) { if (chooser_entry->has_completion) gtk_editable_set_position (editable, gtk_entry_get_text_length (entry)); diff --git a/gtk/gtkhsv.c b/gtk/gtkhsv.c index 9d936a0062..49a8122b54 100644 --- a/gtk/gtkhsv.c +++ b/gtk/gtkhsv.c @@ -166,32 +166,32 @@ gtk_hsv_class_init (GtkHSVClass *class) binding_set = gtk_binding_set_by_class (class); - gtk_binding_entry_add_signal (binding_set, GDK_Up, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Up, 0, "move", 1, G_TYPE_ENUM, GTK_DIR_UP); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Up, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Up, 0, "move", 1, G_TYPE_ENUM, GTK_DIR_UP); - gtk_binding_entry_add_signal (binding_set, GDK_Down, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Down, 0, "move", 1, G_TYPE_ENUM, GTK_DIR_DOWN); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Down, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Down, 0, "move", 1, G_TYPE_ENUM, GTK_DIR_DOWN); - gtk_binding_entry_add_signal (binding_set, GDK_Right, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Right, 0, "move", 1, G_TYPE_ENUM, GTK_DIR_RIGHT); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Right, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Right, 0, "move", 1, G_TYPE_ENUM, GTK_DIR_RIGHT); - gtk_binding_entry_add_signal (binding_set, GDK_Left, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Left, 0, "move", 1, G_TYPE_ENUM, GTK_DIR_LEFT); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Left, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Left, 0, "move", 1, G_TYPE_ENUM, GTK_DIR_LEFT); diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c index de2e84b339..84ce3f85e5 100644 --- a/gtk/gtkiconview.c +++ b/gtk/gtkiconview.c @@ -1010,70 +1010,70 @@ gtk_icon_view_class_init (GtkIconViewClass *klass) G_TYPE_INT); /* Key bindings */ - gtk_binding_entry_add_signal (binding_set, GDK_a, GDK_CONTROL_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_a, GDK_CONTROL_MASK, "select-all", 0); - gtk_binding_entry_add_signal (binding_set, GDK_a, GDK_CONTROL_MASK | GDK_SHIFT_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_a, GDK_CONTROL_MASK | GDK_SHIFT_MASK, "unselect-all", 0); - gtk_binding_entry_add_signal (binding_set, GDK_space, GDK_CONTROL_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_space, GDK_CONTROL_MASK, "toggle-cursor-item", 0); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Space, GDK_CONTROL_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Space, GDK_CONTROL_MASK, "toggle-cursor-item", 0); - gtk_binding_entry_add_signal (binding_set, GDK_space, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_space, 0, "activate-cursor-item", 0); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Space, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Space, 0, "activate-cursor-item", 0); - gtk_binding_entry_add_signal (binding_set, GDK_Return, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Return, 0, "activate-cursor-item", 0); - gtk_binding_entry_add_signal (binding_set, GDK_ISO_Enter, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_ISO_Enter, 0, "activate-cursor-item", 0); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Enter, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Enter, 0, "activate-cursor-item", 0); - gtk_icon_view_add_move_binding (binding_set, GDK_Up, 0, + gtk_icon_view_add_move_binding (binding_set, GDK_KEY_Up, 0, GTK_MOVEMENT_DISPLAY_LINES, -1); - gtk_icon_view_add_move_binding (binding_set, GDK_KP_Up, 0, + gtk_icon_view_add_move_binding (binding_set, GDK_KEY_KP_Up, 0, GTK_MOVEMENT_DISPLAY_LINES, -1); - gtk_icon_view_add_move_binding (binding_set, GDK_Down, 0, + gtk_icon_view_add_move_binding (binding_set, GDK_KEY_Down, 0, GTK_MOVEMENT_DISPLAY_LINES, 1); - gtk_icon_view_add_move_binding (binding_set, GDK_KP_Down, 0, + gtk_icon_view_add_move_binding (binding_set, GDK_KEY_KP_Down, 0, GTK_MOVEMENT_DISPLAY_LINES, 1); - gtk_icon_view_add_move_binding (binding_set, GDK_p, GDK_CONTROL_MASK, + gtk_icon_view_add_move_binding (binding_set, GDK_KEY_p, GDK_CONTROL_MASK, GTK_MOVEMENT_DISPLAY_LINES, -1); - gtk_icon_view_add_move_binding (binding_set, GDK_n, GDK_CONTROL_MASK, + gtk_icon_view_add_move_binding (binding_set, GDK_KEY_n, GDK_CONTROL_MASK, GTK_MOVEMENT_DISPLAY_LINES, 1); - gtk_icon_view_add_move_binding (binding_set, GDK_Home, 0, + gtk_icon_view_add_move_binding (binding_set, GDK_KEY_Home, 0, GTK_MOVEMENT_BUFFER_ENDS, -1); - gtk_icon_view_add_move_binding (binding_set, GDK_KP_Home, 0, + gtk_icon_view_add_move_binding (binding_set, GDK_KEY_KP_Home, 0, GTK_MOVEMENT_BUFFER_ENDS, -1); - gtk_icon_view_add_move_binding (binding_set, GDK_End, 0, + gtk_icon_view_add_move_binding (binding_set, GDK_KEY_End, 0, GTK_MOVEMENT_BUFFER_ENDS, 1); - gtk_icon_view_add_move_binding (binding_set, GDK_KP_End, 0, + gtk_icon_view_add_move_binding (binding_set, GDK_KEY_KP_End, 0, GTK_MOVEMENT_BUFFER_ENDS, 1); - gtk_icon_view_add_move_binding (binding_set, GDK_Page_Up, 0, + gtk_icon_view_add_move_binding (binding_set, GDK_KEY_Page_Up, 0, GTK_MOVEMENT_PAGES, -1); - gtk_icon_view_add_move_binding (binding_set, GDK_KP_Page_Up, 0, + gtk_icon_view_add_move_binding (binding_set, GDK_KEY_KP_Page_Up, 0, GTK_MOVEMENT_PAGES, -1); - gtk_icon_view_add_move_binding (binding_set, GDK_Page_Down, 0, + gtk_icon_view_add_move_binding (binding_set, GDK_KEY_Page_Down, 0, GTK_MOVEMENT_PAGES, 1); - gtk_icon_view_add_move_binding (binding_set, GDK_KP_Page_Down, 0, + gtk_icon_view_add_move_binding (binding_set, GDK_KEY_KP_Page_Down, 0, GTK_MOVEMENT_PAGES, 1); - gtk_icon_view_add_move_binding (binding_set, GDK_Right, 0, + gtk_icon_view_add_move_binding (binding_set, GDK_KEY_Right, 0, GTK_MOVEMENT_VISUAL_POSITIONS, 1); - gtk_icon_view_add_move_binding (binding_set, GDK_Left, 0, + gtk_icon_view_add_move_binding (binding_set, GDK_KEY_Left, 0, GTK_MOVEMENT_VISUAL_POSITIONS, -1); - gtk_icon_view_add_move_binding (binding_set, GDK_KP_Right, 0, + gtk_icon_view_add_move_binding (binding_set, GDK_KEY_KP_Right, 0, GTK_MOVEMENT_VISUAL_POSITIONS, 1); - gtk_icon_view_add_move_binding (binding_set, GDK_KP_Left, 0, + gtk_icon_view_add_move_binding (binding_set, GDK_KEY_KP_Left, 0, GTK_MOVEMENT_VISUAL_POSITIONS, -1); } @@ -2303,7 +2303,7 @@ gtk_icon_view_key_press (GtkWidget *widget, if (icon_view->priv->doing_rubberband) { - if (event->keyval == GDK_Escape) + if (event->keyval == GDK_KEY_Escape) gtk_icon_view_stop_rubberbanding (icon_view); return TRUE; diff --git a/gtk/gtkimcontextsimple.c b/gtk/gtkimcontextsimple.c index 27e8980b85..b5d5937c4b 100644 --- a/gtk/gtkimcontextsimple.c +++ b/gtk/gtkimcontextsimple.c @@ -21,7 +21,7 @@ #include <stdlib.h> #include <string.h> -#include <gdk/gdkkeysyms.h> +#include <gdk/gdkkeysyms-compat.h> #include "gtkprivate.h" #include "gtkaccelgroup.h" #include "gtkimcontextsimple.h" diff --git a/gtk/gtkinfobar.c b/gtk/gtkinfobar.c index 7de08fb5a5..0415c9165e 100644 --- a/gtk/gtkinfobar.c +++ b/gtk/gtkinfobar.c @@ -488,7 +488,7 @@ gtk_info_bar_class_init (GtkInfoBarClass *klass) binding_set = gtk_binding_set_by_class (klass); - gtk_binding_entry_add_signal (binding_set, GDK_Escape, 0, "close", 0); + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Escape, 0, "close", 0); g_type_class_add_private (object_class, sizeof (GtkInfoBarPrivate)); } diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c index 6e6a0d2484..ef885f4e57 100644 --- a/gtk/gtklabel.c +++ b/gtk/gtklabel.c @@ -628,7 +628,7 @@ gtk_label_class_init (GtkLabelClass *class) P_("The mnemonic accelerator key for this label"), 0, G_MAXUINT, - GDK_VoidSymbol, + GDK_KEY_VoidSymbol, GTK_PARAM_READABLE)); g_object_class_install_property (gobject_class, PROP_MNEMONIC_WIDGET, @@ -791,113 +791,113 @@ gtk_label_class_init (GtkLabelClass *class) binding_set = gtk_binding_set_by_class (class); /* Moving the insertion point */ - add_move_binding (binding_set, GDK_Right, 0, + add_move_binding (binding_set, GDK_KEY_Right, 0, GTK_MOVEMENT_VISUAL_POSITIONS, 1); - add_move_binding (binding_set, GDK_Left, 0, + add_move_binding (binding_set, GDK_KEY_Left, 0, GTK_MOVEMENT_VISUAL_POSITIONS, -1); - add_move_binding (binding_set, GDK_KP_Right, 0, + add_move_binding (binding_set, GDK_KEY_KP_Right, 0, GTK_MOVEMENT_VISUAL_POSITIONS, 1); - add_move_binding (binding_set, GDK_KP_Left, 0, + add_move_binding (binding_set, GDK_KEY_KP_Left, 0, GTK_MOVEMENT_VISUAL_POSITIONS, -1); - add_move_binding (binding_set, GDK_f, GDK_CONTROL_MASK, + add_move_binding (binding_set, GDK_KEY_f, GDK_CONTROL_MASK, GTK_MOVEMENT_LOGICAL_POSITIONS, 1); - add_move_binding (binding_set, GDK_b, GDK_CONTROL_MASK, + add_move_binding (binding_set, GDK_KEY_b, GDK_CONTROL_MASK, GTK_MOVEMENT_LOGICAL_POSITIONS, -1); - add_move_binding (binding_set, GDK_Right, GDK_CONTROL_MASK, + add_move_binding (binding_set, GDK_KEY_Right, GDK_CONTROL_MASK, GTK_MOVEMENT_WORDS, 1); - add_move_binding (binding_set, GDK_Left, GDK_CONTROL_MASK, + add_move_binding (binding_set, GDK_KEY_Left, GDK_CONTROL_MASK, GTK_MOVEMENT_WORDS, -1); - add_move_binding (binding_set, GDK_KP_Right, GDK_CONTROL_MASK, + add_move_binding (binding_set, GDK_KEY_KP_Right, GDK_CONTROL_MASK, GTK_MOVEMENT_WORDS, 1); - add_move_binding (binding_set, GDK_KP_Left, GDK_CONTROL_MASK, + add_move_binding (binding_set, GDK_KEY_KP_Left, GDK_CONTROL_MASK, GTK_MOVEMENT_WORDS, -1); /* select all */ - gtk_binding_entry_add_signal (binding_set, GDK_a, GDK_CONTROL_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_a, GDK_CONTROL_MASK, "move-cursor", 3, G_TYPE_ENUM, GTK_MOVEMENT_PARAGRAPH_ENDS, G_TYPE_INT, -1, G_TYPE_BOOLEAN, FALSE); - gtk_binding_entry_add_signal (binding_set, GDK_a, GDK_CONTROL_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_a, GDK_CONTROL_MASK, "move-cursor", 3, G_TYPE_ENUM, GTK_MOVEMENT_PARAGRAPH_ENDS, G_TYPE_INT, 1, G_TYPE_BOOLEAN, TRUE); - gtk_binding_entry_add_signal (binding_set, GDK_slash, GDK_CONTROL_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_slash, GDK_CONTROL_MASK, "move-cursor", 3, G_TYPE_ENUM, GTK_MOVEMENT_PARAGRAPH_ENDS, G_TYPE_INT, -1, G_TYPE_BOOLEAN, FALSE); - gtk_binding_entry_add_signal (binding_set, GDK_slash, GDK_CONTROL_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_slash, GDK_CONTROL_MASK, "move-cursor", 3, G_TYPE_ENUM, GTK_MOVEMENT_PARAGRAPH_ENDS, G_TYPE_INT, 1, G_TYPE_BOOLEAN, TRUE); /* unselect all */ - gtk_binding_entry_add_signal (binding_set, GDK_a, GDK_SHIFT_MASK | GDK_CONTROL_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_a, GDK_SHIFT_MASK | GDK_CONTROL_MASK, "move-cursor", 3, G_TYPE_ENUM, GTK_MOVEMENT_PARAGRAPH_ENDS, G_TYPE_INT, 0, G_TYPE_BOOLEAN, FALSE); - gtk_binding_entry_add_signal (binding_set, GDK_backslash, GDK_CONTROL_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_backslash, GDK_CONTROL_MASK, "move-cursor", 3, G_TYPE_ENUM, GTK_MOVEMENT_PARAGRAPH_ENDS, G_TYPE_INT, 0, G_TYPE_BOOLEAN, FALSE); - add_move_binding (binding_set, GDK_f, GDK_MOD1_MASK, + add_move_binding (binding_set, GDK_KEY_f, GDK_MOD1_MASK, GTK_MOVEMENT_WORDS, 1); - add_move_binding (binding_set, GDK_b, GDK_MOD1_MASK, + add_move_binding (binding_set, GDK_KEY_b, GDK_MOD1_MASK, GTK_MOVEMENT_WORDS, -1); - add_move_binding (binding_set, GDK_Home, 0, + add_move_binding (binding_set, GDK_KEY_Home, 0, GTK_MOVEMENT_DISPLAY_LINE_ENDS, -1); - add_move_binding (binding_set, GDK_End, 0, + add_move_binding (binding_set, GDK_KEY_End, 0, GTK_MOVEMENT_DISPLAY_LINE_ENDS, 1); - add_move_binding (binding_set, GDK_KP_Home, 0, + add_move_binding (binding_set, GDK_KEY_KP_Home, 0, GTK_MOVEMENT_DISPLAY_LINE_ENDS, -1); - add_move_binding (binding_set, GDK_KP_End, 0, + add_move_binding (binding_set, GDK_KEY_KP_End, 0, GTK_MOVEMENT_DISPLAY_LINE_ENDS, 1); - add_move_binding (binding_set, GDK_Home, GDK_CONTROL_MASK, + add_move_binding (binding_set, GDK_KEY_Home, GDK_CONTROL_MASK, GTK_MOVEMENT_BUFFER_ENDS, -1); - add_move_binding (binding_set, GDK_End, GDK_CONTROL_MASK, + add_move_binding (binding_set, GDK_KEY_End, GDK_CONTROL_MASK, GTK_MOVEMENT_BUFFER_ENDS, 1); - add_move_binding (binding_set, GDK_KP_Home, GDK_CONTROL_MASK, + add_move_binding (binding_set, GDK_KEY_KP_Home, GDK_CONTROL_MASK, GTK_MOVEMENT_BUFFER_ENDS, -1); - add_move_binding (binding_set, GDK_KP_End, GDK_CONTROL_MASK, + add_move_binding (binding_set, GDK_KEY_KP_End, GDK_CONTROL_MASK, GTK_MOVEMENT_BUFFER_ENDS, 1); /* copy */ - gtk_binding_entry_add_signal (binding_set, GDK_c, GDK_CONTROL_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_c, GDK_CONTROL_MASK, "copy-clipboard", 0); - gtk_binding_entry_add_signal (binding_set, GDK_Return, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Return, 0, "activate-current-link", 0); - gtk_binding_entry_add_signal (binding_set, GDK_ISO_Enter, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_ISO_Enter, 0, "activate-current-link", 0); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Enter, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Enter, 0, "activate-current-link", 0); gtk_settings_install_property (g_param_spec_boolean ("gtk-label-select-on-focus", @@ -1085,7 +1085,7 @@ gtk_label_init (GtkLabel *label) priv->pattern_set = FALSE; priv->track_links = TRUE; - priv->mnemonic_keyval = GDK_VoidSymbol; + priv->mnemonic_keyval = GDK_KEY_VoidSymbol; priv->layout = NULL; priv->text = NULL; priv->attrs = NULL; @@ -1527,7 +1527,7 @@ gtk_label_setup_mnemonic (GtkLabel *label, mnemonic_menu = g_object_get_data (G_OBJECT (label), "gtk-mnemonic-menu"); - if (last_key != GDK_VoidSymbol) + if (last_key != GDK_KEY_VoidSymbol) { if (priv->mnemonic_window) { @@ -1545,7 +1545,7 @@ gtk_label_setup_mnemonic (GtkLabel *label, } } - if (priv->mnemonic_keyval == GDK_VoidSymbol) + if (priv->mnemonic_keyval == GDK_KEY_VoidSymbol) goto done; connect_mnemonics_visible_notify (GTK_LABEL (widget)); @@ -1806,7 +1806,7 @@ gtk_label_get_mnemonic_widget (GtkLabel *label) guint gtk_label_get_mnemonic_keyval (GtkLabel *label) { - g_return_val_if_fail (GTK_IS_LABEL (label), GDK_VoidSymbol); + g_return_val_if_fail (GTK_IS_LABEL (label), GDK_KEY_VoidSymbol); return label->priv->mnemonic_keyval; } @@ -1945,7 +1945,7 @@ gtk_label_recalculate (GtkLabel *label) gtk_label_compose_effective_attrs (label); if (!priv->use_underline) - priv->mnemonic_keyval = GDK_VoidSymbol; + priv->mnemonic_keyval = GDK_KEY_VoidSymbol; if (keyval != priv->mnemonic_keyval) { @@ -2452,7 +2452,7 @@ gtk_label_set_markup_internal (GtkLabel *label, if (accel_char != 0) priv->mnemonic_keyval = gdk_keyval_to_lower (gdk_unicode_to_keyval (accel_char)); else - priv->mnemonic_keyval = GDK_VoidSymbol; + priv->mnemonic_keyval = GDK_KEY_VoidSymbol; } /** @@ -4232,7 +4232,7 @@ separate_uline_pattern (const gchar *str, gchar *dest; gchar *pattern_dest; - *accel_key = GDK_VoidSymbol; + *accel_key = GDK_KEY_VoidSymbol; *new_str = g_new (gchar, strlen (str) + 1); *pattern = g_new (gchar, g_utf8_strlen (str, -1) + 1); @@ -4265,7 +4265,7 @@ separate_uline_pattern (const gchar *str, else { *pattern_dest++ = '_'; - if (*accel_key == GDK_VoidSymbol) + if (*accel_key == GDK_KEY_VoidSymbol) *accel_key = gdk_keyval_to_lower (gdk_unicode_to_keyval (c)); } @@ -4302,7 +4302,7 @@ gtk_label_set_uline_text_internal (GtkLabel *label, const gchar *str) { GtkLabelPrivate *priv = label->priv; - guint accel_key = GDK_VoidSymbol; + guint accel_key = GDK_KEY_VoidSymbol; gchar *new_str; gchar *pattern; diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c index 6f3c5ea649..03f33c6946 100644 --- a/gtk/gtkmain.c +++ b/gtk/gtkmain.c @@ -1713,7 +1713,7 @@ gtk_main_do_event (GdkEvent *event) /* Catch alt press to enable auto-mnemonics; * menus are handled elsewhere */ - if ((event->key.keyval == GDK_Alt_L || event->key.keyval == GDK_Alt_R) && + if ((event->key.keyval == GDK_KEY_Alt_L || event->key.keyval == GDK_KEY_Alt_R) && !GTK_IS_MENU_SHELL (grab_widget)) { gboolean auto_mnemonics; diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c index 75bad7361b..0a4575cb8a 100644 --- a/gtk/gtkmenu.c +++ b/gtk/gtkmenu.c @@ -742,82 +742,82 @@ gtk_menu_class_init (GtkMenuClass *class) binding_set = gtk_binding_set_by_class (class); gtk_binding_entry_add_signal (binding_set, - GDK_Up, 0, + GDK_KEY_Up, 0, I_("move-current"), 1, GTK_TYPE_MENU_DIRECTION_TYPE, GTK_MENU_DIR_PREV); gtk_binding_entry_add_signal (binding_set, - GDK_KP_Up, 0, + GDK_KEY_KP_Up, 0, "move-current", 1, GTK_TYPE_MENU_DIRECTION_TYPE, GTK_MENU_DIR_PREV); gtk_binding_entry_add_signal (binding_set, - GDK_Down, 0, + GDK_KEY_Down, 0, "move-current", 1, GTK_TYPE_MENU_DIRECTION_TYPE, GTK_MENU_DIR_NEXT); gtk_binding_entry_add_signal (binding_set, - GDK_KP_Down, 0, + GDK_KEY_KP_Down, 0, "move-current", 1, GTK_TYPE_MENU_DIRECTION_TYPE, GTK_MENU_DIR_NEXT); gtk_binding_entry_add_signal (binding_set, - GDK_Left, 0, + GDK_KEY_Left, 0, "move-current", 1, GTK_TYPE_MENU_DIRECTION_TYPE, GTK_MENU_DIR_PARENT); gtk_binding_entry_add_signal (binding_set, - GDK_KP_Left, 0, + GDK_KEY_KP_Left, 0, "move-current", 1, GTK_TYPE_MENU_DIRECTION_TYPE, GTK_MENU_DIR_PARENT); gtk_binding_entry_add_signal (binding_set, - GDK_Right, 0, + GDK_KEY_Right, 0, "move-current", 1, GTK_TYPE_MENU_DIRECTION_TYPE, GTK_MENU_DIR_CHILD); gtk_binding_entry_add_signal (binding_set, - GDK_KP_Right, 0, + GDK_KEY_KP_Right, 0, "move-current", 1, GTK_TYPE_MENU_DIRECTION_TYPE, GTK_MENU_DIR_CHILD); gtk_binding_entry_add_signal (binding_set, - GDK_Home, 0, + GDK_KEY_Home, 0, "move-scroll", 1, GTK_TYPE_SCROLL_TYPE, GTK_SCROLL_START); gtk_binding_entry_add_signal (binding_set, - GDK_KP_Home, 0, + GDK_KEY_KP_Home, 0, "move-scroll", 1, GTK_TYPE_SCROLL_TYPE, GTK_SCROLL_START); gtk_binding_entry_add_signal (binding_set, - GDK_End, 0, + GDK_KEY_End, 0, "move-scroll", 1, GTK_TYPE_SCROLL_TYPE, GTK_SCROLL_END); gtk_binding_entry_add_signal (binding_set, - GDK_KP_End, 0, + GDK_KEY_KP_End, 0, "move-scroll", 1, GTK_TYPE_SCROLL_TYPE, GTK_SCROLL_END); gtk_binding_entry_add_signal (binding_set, - GDK_Page_Up, 0, + GDK_KEY_Page_Up, 0, "move-scroll", 1, GTK_TYPE_SCROLL_TYPE, GTK_SCROLL_PAGE_UP); gtk_binding_entry_add_signal (binding_set, - GDK_KP_Page_Up, 0, + GDK_KEY_KP_Page_Up, 0, "move-scroll", 1, GTK_TYPE_SCROLL_TYPE, GTK_SCROLL_PAGE_UP); gtk_binding_entry_add_signal (binding_set, - GDK_Page_Down, 0, + GDK_KEY_Page_Down, 0, "move-scroll", 1, GTK_TYPE_SCROLL_TYPE, GTK_SCROLL_PAGE_DOWN); gtk_binding_entry_add_signal (binding_set, - GDK_KP_Page_Down, 0, + GDK_KEY_KP_Page_Down, 0, "move-scroll", 1, GTK_TYPE_SCROLL_TYPE, GTK_SCROLL_PAGE_DOWN); @@ -3429,9 +3429,9 @@ gtk_menu_key_press (GtkWidget *widget, switch (event->keyval) { - case GDK_Delete: - case GDK_KP_Delete: - case GDK_BackSpace: + case GDK_KEY_Delete: + case GDK_KEY_KP_Delete: + case GDK_KEY_BackSpace: delete = TRUE; break; default: diff --git a/gtk/gtkmenubar.c b/gtk/gtkmenubar.c index b597c1c54c..1cc65e60e4 100644 --- a/gtk/gtkmenubar.c +++ b/gtk/gtkmenubar.c @@ -107,42 +107,42 @@ gtk_menu_bar_class_init (GtkMenuBarClass *class) binding_set = gtk_binding_set_by_class (class); gtk_binding_entry_add_signal (binding_set, - GDK_Left, 0, + GDK_KEY_Left, 0, "move-current", 1, GTK_TYPE_MENU_DIRECTION_TYPE, GTK_MENU_DIR_PREV); gtk_binding_entry_add_signal (binding_set, - GDK_KP_Left, 0, + GDK_KEY_KP_Left, 0, "move-current", 1, GTK_TYPE_MENU_DIRECTION_TYPE, GTK_MENU_DIR_PREV); gtk_binding_entry_add_signal (binding_set, - GDK_Right, 0, + GDK_KEY_Right, 0, "move-current", 1, GTK_TYPE_MENU_DIRECTION_TYPE, GTK_MENU_DIR_NEXT); gtk_binding_entry_add_signal (binding_set, - GDK_KP_Right, 0, + GDK_KEY_KP_Right, 0, "move-current", 1, GTK_TYPE_MENU_DIRECTION_TYPE, GTK_MENU_DIR_NEXT); gtk_binding_entry_add_signal (binding_set, - GDK_Up, 0, + GDK_KEY_Up, 0, "move-current", 1, GTK_TYPE_MENU_DIRECTION_TYPE, GTK_MENU_DIR_PARENT); gtk_binding_entry_add_signal (binding_set, - GDK_KP_Up, 0, + GDK_KEY_KP_Up, 0, "move-current", 1, GTK_TYPE_MENU_DIRECTION_TYPE, GTK_MENU_DIR_PARENT); gtk_binding_entry_add_signal (binding_set, - GDK_Down, 0, + GDK_KEY_Down, 0, "move-current", 1, GTK_TYPE_MENU_DIRECTION_TYPE, GTK_MENU_DIR_CHILD); gtk_binding_entry_add_signal (binding_set, - GDK_KP_Down, 0, + GDK_KEY_KP_Down, 0, "move-current", 1, GTK_TYPE_MENU_DIRECTION_TYPE, GTK_MENU_DIR_CHILD); diff --git a/gtk/gtkmenushell.c b/gtk/gtkmenushell.c index 763a6dbfbd..42542c8662 100644 --- a/gtk/gtkmenushell.c +++ b/gtk/gtkmenushell.c @@ -328,39 +328,39 @@ gtk_menu_shell_class_init (GtkMenuShellClass *klass) binding_set = gtk_binding_set_by_class (klass); gtk_binding_entry_add_signal (binding_set, - GDK_Escape, 0, + GDK_KEY_Escape, 0, "cancel", 0); gtk_binding_entry_add_signal (binding_set, - GDK_Return, 0, + GDK_KEY_Return, 0, "activate-current", 1, G_TYPE_BOOLEAN, TRUE); gtk_binding_entry_add_signal (binding_set, - GDK_ISO_Enter, 0, + GDK_KEY_ISO_Enter, 0, "activate-current", 1, G_TYPE_BOOLEAN, TRUE); gtk_binding_entry_add_signal (binding_set, - GDK_KP_Enter, 0, + GDK_KEY_KP_Enter, 0, "activate-current", 1, G_TYPE_BOOLEAN, TRUE); gtk_binding_entry_add_signal (binding_set, - GDK_space, 0, + GDK_KEY_space, 0, "activate-current", 1, G_TYPE_BOOLEAN, FALSE); gtk_binding_entry_add_signal (binding_set, - GDK_KP_Space, 0, + GDK_KEY_KP_Space, 0, "activate-current", 1, G_TYPE_BOOLEAN, FALSE); gtk_binding_entry_add_signal (binding_set, - GDK_F10, 0, + GDK_KEY_F10, 0, "cycle-focus", 1, GTK_TYPE_DIRECTION_TYPE, GTK_DIR_TAB_FORWARD); gtk_binding_entry_add_signal (binding_set, - GDK_F10, GDK_SHIFT_MASK, + GDK_KEY_F10, GDK_SHIFT_MASK, "cycle-focus", 1, GTK_TYPE_DIRECTION_TYPE, GTK_DIR_TAB_BACKWARD); diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index 86cdee42fa..5585d75433 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -482,10 +482,10 @@ add_tab_bindings (GtkBindingSet *binding_set, GdkModifierType modifiers, GtkDirectionType direction) { - gtk_binding_entry_add_signal (binding_set, GDK_Tab, modifiers, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Tab, modifiers, "move_focus_out", 1, GTK_TYPE_DIRECTION_TYPE, direction); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Tab, modifiers, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Tab, modifiers, "move_focus_out", 1, GTK_TYPE_DIRECTION_TYPE, direction); } @@ -495,7 +495,7 @@ add_arrow_bindings (GtkBindingSet *binding_set, guint keysym, GtkDirectionType direction) { - guint keypad_keysym = keysym - GDK_Left + GDK_KP_Left; + guint keypad_keysym = keysym - GDK_KEY_Left + GDK_KEY_KP_Left; gtk_binding_entry_add_signal (binding_set, keysym, GDK_CONTROL_MASK, "move_focus_out", 1, @@ -511,7 +511,7 @@ add_reorder_bindings (GtkBindingSet *binding_set, GtkDirectionType direction, gboolean move_to_last) { - guint keypad_keysym = keysym - GDK_Left + GDK_KP_Left; + guint keypad_keysym = keysym - GDK_KEY_Left + GDK_KEY_KP_Left; gtk_binding_entry_add_signal (binding_set, keysym, GDK_MOD1_MASK, "reorder_tab", 2, @@ -978,62 +978,62 @@ gtk_notebook_class_init (GtkNotebookClass *class) binding_set = gtk_binding_set_by_class (class); gtk_binding_entry_add_signal (binding_set, - GDK_space, 0, + GDK_KEY_space, 0, "select-page", 1, G_TYPE_BOOLEAN, FALSE); gtk_binding_entry_add_signal (binding_set, - GDK_KP_Space, 0, + GDK_KEY_KP_Space, 0, "select-page", 1, G_TYPE_BOOLEAN, FALSE); gtk_binding_entry_add_signal (binding_set, - GDK_Home, 0, + GDK_KEY_Home, 0, "focus-tab", 1, GTK_TYPE_NOTEBOOK_TAB, GTK_NOTEBOOK_TAB_FIRST); gtk_binding_entry_add_signal (binding_set, - GDK_KP_Home, 0, + GDK_KEY_KP_Home, 0, "focus-tab", 1, GTK_TYPE_NOTEBOOK_TAB, GTK_NOTEBOOK_TAB_FIRST); gtk_binding_entry_add_signal (binding_set, - GDK_End, 0, + GDK_KEY_End, 0, "focus-tab", 1, GTK_TYPE_NOTEBOOK_TAB, GTK_NOTEBOOK_TAB_LAST); gtk_binding_entry_add_signal (binding_set, - GDK_KP_End, 0, + GDK_KEY_KP_End, 0, "focus-tab", 1, GTK_TYPE_NOTEBOOK_TAB, GTK_NOTEBOOK_TAB_LAST); gtk_binding_entry_add_signal (binding_set, - GDK_Page_Up, GDK_CONTROL_MASK, + GDK_KEY_Page_Up, GDK_CONTROL_MASK, "change-current-page", 1, G_TYPE_INT, -1); gtk_binding_entry_add_signal (binding_set, - GDK_Page_Down, GDK_CONTROL_MASK, + GDK_KEY_Page_Down, GDK_CONTROL_MASK, "change-current-page", 1, G_TYPE_INT, 1); gtk_binding_entry_add_signal (binding_set, - GDK_Page_Up, GDK_CONTROL_MASK | GDK_MOD1_MASK, + GDK_KEY_Page_Up, GDK_CONTROL_MASK | GDK_MOD1_MASK, "change-current-page", 1, G_TYPE_INT, -1); gtk_binding_entry_add_signal (binding_set, - GDK_Page_Down, GDK_CONTROL_MASK | GDK_MOD1_MASK, + GDK_KEY_Page_Down, GDK_CONTROL_MASK | GDK_MOD1_MASK, "change-current-page", 1, G_TYPE_INT, 1); - add_arrow_bindings (binding_set, GDK_Up, GTK_DIR_UP); - add_arrow_bindings (binding_set, GDK_Down, GTK_DIR_DOWN); - add_arrow_bindings (binding_set, GDK_Left, GTK_DIR_LEFT); - add_arrow_bindings (binding_set, GDK_Right, GTK_DIR_RIGHT); - - add_reorder_bindings (binding_set, GDK_Up, GTK_DIR_UP, FALSE); - add_reorder_bindings (binding_set, GDK_Down, GTK_DIR_DOWN, FALSE); - add_reorder_bindings (binding_set, GDK_Left, GTK_DIR_LEFT, FALSE); - add_reorder_bindings (binding_set, GDK_Right, GTK_DIR_RIGHT, FALSE); - add_reorder_bindings (binding_set, GDK_Home, GTK_DIR_LEFT, TRUE); - add_reorder_bindings (binding_set, GDK_Home, GTK_DIR_UP, TRUE); - add_reorder_bindings (binding_set, GDK_End, GTK_DIR_RIGHT, TRUE); - add_reorder_bindings (binding_set, GDK_End, GTK_DIR_DOWN, TRUE); + add_arrow_bindings (binding_set, GDK_KEY_Up, GTK_DIR_UP); + add_arrow_bindings (binding_set, GDK_KEY_Down, GTK_DIR_DOWN); + add_arrow_bindings (binding_set, GDK_KEY_Left, GTK_DIR_LEFT); + add_arrow_bindings (binding_set, GDK_KEY_Right, GTK_DIR_RIGHT); + + add_reorder_bindings (binding_set, GDK_KEY_Up, GTK_DIR_UP, FALSE); + add_reorder_bindings (binding_set, GDK_KEY_Down, GTK_DIR_DOWN, FALSE); + add_reorder_bindings (binding_set, GDK_KEY_Left, GTK_DIR_LEFT, FALSE); + add_reorder_bindings (binding_set, GDK_KEY_Right, GTK_DIR_RIGHT, FALSE); + add_reorder_bindings (binding_set, GDK_KEY_Home, GTK_DIR_LEFT, TRUE); + add_reorder_bindings (binding_set, GDK_KEY_Home, GTK_DIR_UP, TRUE); + add_reorder_bindings (binding_set, GDK_KEY_End, GTK_DIR_RIGHT, TRUE); + add_reorder_bindings (binding_set, GDK_KEY_End, GTK_DIR_DOWN, TRUE); add_tab_bindings (binding_set, GDK_CONTROL_MASK, GTK_DIR_TAB_FORWARD); add_tab_bindings (binding_set, GDK_CONTROL_MASK | GDK_SHIFT_MASK, GTK_DIR_TAB_BACKWARD); diff --git a/gtk/gtkpaned.c b/gtk/gtkpaned.c index 6d95aa19e2..03f65846d8 100644 --- a/gtk/gtkpaned.c +++ b/gtk/gtkpaned.c @@ -191,9 +191,9 @@ static void add_tab_bindings (GtkBindingSet *binding_set, GdkModifierType modifiers) { - gtk_binding_entry_add_signal (binding_set, GDK_Tab, modifiers, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Tab, modifiers, "toggle-handle-focus", 0); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Tab, modifiers, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Tab, modifiers, "toggle-handle-focus", 0); } @@ -496,22 +496,22 @@ gtk_paned_class_init (GtkPanedClass *class) /* F6 and friends */ gtk_binding_entry_add_signal (binding_set, - GDK_F6, 0, + GDK_KEY_F6, 0, "cycle-child-focus", 1, G_TYPE_BOOLEAN, FALSE); gtk_binding_entry_add_signal (binding_set, - GDK_F6, GDK_SHIFT_MASK, + GDK_KEY_F6, GDK_SHIFT_MASK, "cycle-child-focus", 1, G_TYPE_BOOLEAN, TRUE); /* F8 and friends */ gtk_binding_entry_add_signal (binding_set, - GDK_F8, 0, + GDK_KEY_F8, 0, "cycle-handle-focus", 1, G_TYPE_BOOLEAN, FALSE); gtk_binding_entry_add_signal (binding_set, - GDK_F8, GDK_SHIFT_MASK, + GDK_KEY_F8, GDK_SHIFT_MASK, "cycle-handle-focus", 1, G_TYPE_BOOLEAN, TRUE); @@ -522,54 +522,54 @@ gtk_paned_class_init (GtkPanedClass *class) /* accept and cancel positions */ gtk_binding_entry_add_signal (binding_set, - GDK_Escape, 0, + GDK_KEY_Escape, 0, "cancel-position", 0); gtk_binding_entry_add_signal (binding_set, - GDK_Return, 0, + GDK_KEY_Return, 0, "accept-position", 0); gtk_binding_entry_add_signal (binding_set, - GDK_ISO_Enter, 0, + GDK_KEY_ISO_Enter, 0, "accept-position", 0); gtk_binding_entry_add_signal (binding_set, - GDK_KP_Enter, 0, + GDK_KEY_KP_Enter, 0, "accept-position", 0); gtk_binding_entry_add_signal (binding_set, - GDK_space, 0, + GDK_KEY_space, 0, "accept-position", 0); gtk_binding_entry_add_signal (binding_set, - GDK_KP_Space, 0, + GDK_KEY_KP_Space, 0, "accept-position", 0); /* move handle */ - add_move_binding (binding_set, GDK_Left, 0, GTK_SCROLL_STEP_LEFT); - add_move_binding (binding_set, GDK_KP_Left, 0, GTK_SCROLL_STEP_LEFT); - add_move_binding (binding_set, GDK_Left, GDK_CONTROL_MASK, GTK_SCROLL_PAGE_LEFT); - add_move_binding (binding_set, GDK_KP_Left, GDK_CONTROL_MASK, GTK_SCROLL_PAGE_LEFT); - - add_move_binding (binding_set, GDK_Right, 0, GTK_SCROLL_STEP_RIGHT); - add_move_binding (binding_set, GDK_Right, GDK_CONTROL_MASK, GTK_SCROLL_PAGE_RIGHT); - add_move_binding (binding_set, GDK_KP_Right, 0, GTK_SCROLL_STEP_RIGHT); - add_move_binding (binding_set, GDK_KP_Right, GDK_CONTROL_MASK, GTK_SCROLL_PAGE_RIGHT); - - add_move_binding (binding_set, GDK_Up, 0, GTK_SCROLL_STEP_UP); - add_move_binding (binding_set, GDK_Up, GDK_CONTROL_MASK, GTK_SCROLL_PAGE_UP); - add_move_binding (binding_set, GDK_KP_Up, 0, GTK_SCROLL_STEP_UP); - add_move_binding (binding_set, GDK_KP_Up, GDK_CONTROL_MASK, GTK_SCROLL_PAGE_UP); - add_move_binding (binding_set, GDK_Page_Up, 0, GTK_SCROLL_PAGE_UP); - add_move_binding (binding_set, GDK_KP_Page_Up, 0, GTK_SCROLL_PAGE_UP); - - add_move_binding (binding_set, GDK_Down, 0, GTK_SCROLL_STEP_DOWN); - add_move_binding (binding_set, GDK_Down, GDK_CONTROL_MASK, GTK_SCROLL_PAGE_DOWN); - add_move_binding (binding_set, GDK_KP_Down, 0, GTK_SCROLL_STEP_DOWN); - add_move_binding (binding_set, GDK_KP_Down, GDK_CONTROL_MASK, GTK_SCROLL_PAGE_DOWN); - add_move_binding (binding_set, GDK_Page_Down, 0, GTK_SCROLL_PAGE_RIGHT); - add_move_binding (binding_set, GDK_KP_Page_Down, 0, GTK_SCROLL_PAGE_RIGHT); - - add_move_binding (binding_set, GDK_Home, 0, GTK_SCROLL_START); - add_move_binding (binding_set, GDK_KP_Home, 0, GTK_SCROLL_START); - add_move_binding (binding_set, GDK_End, 0, GTK_SCROLL_END); - add_move_binding (binding_set, GDK_KP_End, 0, GTK_SCROLL_END); + add_move_binding (binding_set, GDK_KEY_Left, 0, GTK_SCROLL_STEP_LEFT); + add_move_binding (binding_set, GDK_KEY_KP_Left, 0, GTK_SCROLL_STEP_LEFT); + add_move_binding (binding_set, GDK_KEY_Left, GDK_CONTROL_MASK, GTK_SCROLL_PAGE_LEFT); + add_move_binding (binding_set, GDK_KEY_KP_Left, GDK_CONTROL_MASK, GTK_SCROLL_PAGE_LEFT); + + add_move_binding (binding_set, GDK_KEY_Right, 0, GTK_SCROLL_STEP_RIGHT); + add_move_binding (binding_set, GDK_KEY_Right, GDK_CONTROL_MASK, GTK_SCROLL_PAGE_RIGHT); + add_move_binding (binding_set, GDK_KEY_KP_Right, 0, GTK_SCROLL_STEP_RIGHT); + add_move_binding (binding_set, GDK_KEY_KP_Right, GDK_CONTROL_MASK, GTK_SCROLL_PAGE_RIGHT); + + add_move_binding (binding_set, GDK_KEY_Up, 0, GTK_SCROLL_STEP_UP); + add_move_binding (binding_set, GDK_KEY_Up, GDK_CONTROL_MASK, GTK_SCROLL_PAGE_UP); + add_move_binding (binding_set, GDK_KEY_KP_Up, 0, GTK_SCROLL_STEP_UP); + add_move_binding (binding_set, GDK_KEY_KP_Up, GDK_CONTROL_MASK, GTK_SCROLL_PAGE_UP); + add_move_binding (binding_set, GDK_KEY_Page_Up, 0, GTK_SCROLL_PAGE_UP); + add_move_binding (binding_set, GDK_KEY_KP_Page_Up, 0, GTK_SCROLL_PAGE_UP); + + add_move_binding (binding_set, GDK_KEY_Down, 0, GTK_SCROLL_STEP_DOWN); + add_move_binding (binding_set, GDK_KEY_Down, GDK_CONTROL_MASK, GTK_SCROLL_PAGE_DOWN); + add_move_binding (binding_set, GDK_KEY_KP_Down, 0, GTK_SCROLL_STEP_DOWN); + add_move_binding (binding_set, GDK_KEY_KP_Down, GDK_CONTROL_MASK, GTK_SCROLL_PAGE_DOWN); + add_move_binding (binding_set, GDK_KEY_Page_Down, 0, GTK_SCROLL_PAGE_RIGHT); + add_move_binding (binding_set, GDK_KEY_KP_Page_Down, 0, GTK_SCROLL_PAGE_RIGHT); + + add_move_binding (binding_set, GDK_KEY_Home, 0, GTK_SCROLL_START); + add_move_binding (binding_set, GDK_KEY_KP_Home, 0, GTK_SCROLL_START); + add_move_binding (binding_set, GDK_KEY_End, 0, GTK_SCROLL_END); + add_move_binding (binding_set, GDK_KEY_KP_End, 0, GTK_SCROLL_END); g_type_class_add_private (object_class, sizeof (GtkPanedPrivate)); } diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c index 119e506888..28e5e57780 100644 --- a/gtk/gtkrange.c +++ b/gtk/gtkrange.c @@ -2339,7 +2339,7 @@ gtk_range_key_press (GtkWidget *widget, device = gdk_device_get_associated_device (device); if (device == priv->grab_device && - event->keyval == GDK_Escape && + event->keyval == GDK_KEY_Escape && priv->grab_location != MOUSE_OUTSIDE) { stop_scrolling (range); diff --git a/gtk/gtkscale.c b/gtk/gtkscale.c index 853b1cf769..6babe29f8b 100644 --- a/gtk/gtkscale.c +++ b/gtk/gtkscale.c @@ -289,116 +289,116 @@ gtk_scale_class_init (GtkScaleClass *class) binding_set = gtk_binding_set_by_class (class); - add_slider_binding (binding_set, GDK_Left, 0, + add_slider_binding (binding_set, GDK_KEY_Left, 0, GTK_SCROLL_STEP_LEFT); - add_slider_binding (binding_set, GDK_Left, GDK_CONTROL_MASK, + add_slider_binding (binding_set, GDK_KEY_Left, GDK_CONTROL_MASK, GTK_SCROLL_PAGE_LEFT); - add_slider_binding (binding_set, GDK_KP_Left, 0, + add_slider_binding (binding_set, GDK_KEY_KP_Left, 0, GTK_SCROLL_STEP_LEFT); - add_slider_binding (binding_set, GDK_KP_Left, GDK_CONTROL_MASK, + add_slider_binding (binding_set, GDK_KEY_KP_Left, GDK_CONTROL_MASK, GTK_SCROLL_PAGE_LEFT); - add_slider_binding (binding_set, GDK_Right, 0, + add_slider_binding (binding_set, GDK_KEY_Right, 0, GTK_SCROLL_STEP_RIGHT); - add_slider_binding (binding_set, GDK_Right, GDK_CONTROL_MASK, + add_slider_binding (binding_set, GDK_KEY_Right, GDK_CONTROL_MASK, GTK_SCROLL_PAGE_RIGHT); - add_slider_binding (binding_set, GDK_KP_Right, 0, + add_slider_binding (binding_set, GDK_KEY_KP_Right, 0, GTK_SCROLL_STEP_RIGHT); - add_slider_binding (binding_set, GDK_KP_Right, GDK_CONTROL_MASK, + add_slider_binding (binding_set, GDK_KEY_KP_Right, GDK_CONTROL_MASK, GTK_SCROLL_PAGE_RIGHT); - add_slider_binding (binding_set, GDK_Up, 0, + add_slider_binding (binding_set, GDK_KEY_Up, 0, GTK_SCROLL_STEP_UP); - add_slider_binding (binding_set, GDK_Up, GDK_CONTROL_MASK, + add_slider_binding (binding_set, GDK_KEY_Up, GDK_CONTROL_MASK, GTK_SCROLL_PAGE_UP); - add_slider_binding (binding_set, GDK_KP_Up, 0, + add_slider_binding (binding_set, GDK_KEY_KP_Up, 0, GTK_SCROLL_STEP_UP); - add_slider_binding (binding_set, GDK_KP_Up, GDK_CONTROL_MASK, + add_slider_binding (binding_set, GDK_KEY_KP_Up, GDK_CONTROL_MASK, GTK_SCROLL_PAGE_UP); - add_slider_binding (binding_set, GDK_Down, 0, + add_slider_binding (binding_set, GDK_KEY_Down, 0, GTK_SCROLL_STEP_DOWN); - add_slider_binding (binding_set, GDK_Down, GDK_CONTROL_MASK, + add_slider_binding (binding_set, GDK_KEY_Down, GDK_CONTROL_MASK, GTK_SCROLL_PAGE_DOWN); - add_slider_binding (binding_set, GDK_KP_Down, 0, + add_slider_binding (binding_set, GDK_KEY_KP_Down, 0, GTK_SCROLL_STEP_DOWN); - add_slider_binding (binding_set, GDK_KP_Down, GDK_CONTROL_MASK, + add_slider_binding (binding_set, GDK_KEY_KP_Down, GDK_CONTROL_MASK, GTK_SCROLL_PAGE_DOWN); - add_slider_binding (binding_set, GDK_Page_Up, GDK_CONTROL_MASK, + add_slider_binding (binding_set, GDK_KEY_Page_Up, GDK_CONTROL_MASK, GTK_SCROLL_PAGE_LEFT); - add_slider_binding (binding_set, GDK_KP_Page_Up, GDK_CONTROL_MASK, + add_slider_binding (binding_set, GDK_KEY_KP_Page_Up, GDK_CONTROL_MASK, GTK_SCROLL_PAGE_LEFT); - add_slider_binding (binding_set, GDK_Page_Up, 0, + add_slider_binding (binding_set, GDK_KEY_Page_Up, 0, GTK_SCROLL_PAGE_UP); - add_slider_binding (binding_set, GDK_KP_Page_Up, 0, + add_slider_binding (binding_set, GDK_KEY_KP_Page_Up, 0, GTK_SCROLL_PAGE_UP); - add_slider_binding (binding_set, GDK_Page_Down, GDK_CONTROL_MASK, + add_slider_binding (binding_set, GDK_KEY_Page_Down, GDK_CONTROL_MASK, GTK_SCROLL_PAGE_RIGHT); - add_slider_binding (binding_set, GDK_KP_Page_Down, GDK_CONTROL_MASK, + add_slider_binding (binding_set, GDK_KEY_KP_Page_Down, GDK_CONTROL_MASK, GTK_SCROLL_PAGE_RIGHT); - add_slider_binding (binding_set, GDK_Page_Down, 0, + add_slider_binding (binding_set, GDK_KEY_Page_Down, 0, GTK_SCROLL_PAGE_DOWN); - add_slider_binding (binding_set, GDK_KP_Page_Down, 0, + add_slider_binding (binding_set, GDK_KEY_KP_Page_Down, 0, GTK_SCROLL_PAGE_DOWN); /* Logical bindings (vs. visual bindings above) */ - add_slider_binding (binding_set, GDK_plus, 0, + add_slider_binding (binding_set, GDK_KEY_plus, 0, GTK_SCROLL_STEP_FORWARD); - add_slider_binding (binding_set, GDK_minus, 0, + add_slider_binding (binding_set, GDK_KEY_minus, 0, GTK_SCROLL_STEP_BACKWARD); - add_slider_binding (binding_set, GDK_plus, GDK_CONTROL_MASK, + add_slider_binding (binding_set, GDK_KEY_plus, GDK_CONTROL_MASK, GTK_SCROLL_PAGE_FORWARD); - add_slider_binding (binding_set, GDK_minus, GDK_CONTROL_MASK, + add_slider_binding (binding_set, GDK_KEY_minus, GDK_CONTROL_MASK, GTK_SCROLL_PAGE_BACKWARD); - add_slider_binding (binding_set, GDK_KP_Add, 0, + add_slider_binding (binding_set, GDK_KEY_KP_Add, 0, GTK_SCROLL_STEP_FORWARD); - add_slider_binding (binding_set, GDK_KP_Subtract, 0, + add_slider_binding (binding_set, GDK_KEY_KP_Subtract, 0, GTK_SCROLL_STEP_BACKWARD); - add_slider_binding (binding_set, GDK_KP_Add, GDK_CONTROL_MASK, + add_slider_binding (binding_set, GDK_KEY_KP_Add, GDK_CONTROL_MASK, GTK_SCROLL_PAGE_FORWARD); - add_slider_binding (binding_set, GDK_KP_Subtract, GDK_CONTROL_MASK, + add_slider_binding (binding_set, GDK_KEY_KP_Subtract, GDK_CONTROL_MASK, GTK_SCROLL_PAGE_BACKWARD); - add_slider_binding (binding_set, GDK_Home, 0, + add_slider_binding (binding_set, GDK_KEY_Home, 0, GTK_SCROLL_START); - add_slider_binding (binding_set, GDK_KP_Home, 0, + add_slider_binding (binding_set, GDK_KEY_KP_Home, 0, GTK_SCROLL_START); - add_slider_binding (binding_set, GDK_End, 0, + add_slider_binding (binding_set, GDK_KEY_End, 0, GTK_SCROLL_END); - add_slider_binding (binding_set, GDK_KP_End, 0, + add_slider_binding (binding_set, GDK_KEY_KP_End, 0, GTK_SCROLL_END); g_type_class_add_private (gobject_class, sizeof (GtkScalePrivate)); diff --git a/gtk/gtkscalebutton.c b/gtk/gtkscalebutton.c index 5905d91ac0..7548cfd71c 100644 --- a/gtk/gtkscalebutton.c +++ b/gtk/gtkscalebutton.c @@ -334,17 +334,17 @@ gtk_scale_button_class_init (GtkScaleButtonClass *klass) /* Key bindings */ binding_set = gtk_binding_set_by_class (widget_class); - gtk_binding_entry_add_signal (binding_set, GDK_space, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_space, 0, "popup", 0); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Space, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Space, 0, "popup", 0); - gtk_binding_entry_add_signal (binding_set, GDK_Return, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Return, 0, "popup", 0); - gtk_binding_entry_add_signal (binding_set, GDK_ISO_Enter, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_ISO_Enter, 0, "popup", 0); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Enter, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Enter, 0, "popup", 0); - gtk_binding_entry_add_signal (binding_set, GDK_Escape, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Escape, 0, "popdown", 0); } @@ -1380,7 +1380,7 @@ cb_dock_key_release (GtkWidget *widget, GdkEventKey *event, gpointer user_data) { - if (event->keyval == GDK_Escape) + if (event->keyval == GDK_KEY_Escape) { gtk_scale_button_popdown (GTK_WIDGET (user_data)); return TRUE; diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c index 7a9a4a52fe..22beb1bc55 100644 --- a/gtk/gtkscrolledwindow.c +++ b/gtk/gtkscrolledwindow.c @@ -181,7 +181,7 @@ add_scroll_binding (GtkBindingSet *binding_set, GtkScrollType scroll, gboolean horizontal) { - guint keypad_keyval = keyval - GDK_Left + GDK_KP_Left; + guint keypad_keyval = keyval - GDK_KEY_Left + GDK_KEY_KP_Left; gtk_binding_entry_add_signal (binding_set, keyval, mask, "scroll-child", 2, @@ -198,10 +198,10 @@ add_tab_bindings (GtkBindingSet *binding_set, GdkModifierType modifiers, GtkDirectionType direction) { - gtk_binding_entry_add_signal (binding_set, GDK_Tab, modifiers, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Tab, modifiers, "move-focus-out", 1, GTK_TYPE_DIRECTION_TYPE, direction); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Tab, modifiers, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Tab, modifiers, "move-focus-out", 1, GTK_TYPE_DIRECTION_TYPE, direction); } @@ -365,20 +365,20 @@ gtk_scrolled_window_class_init (GtkScrolledWindowClass *class) binding_set = gtk_binding_set_by_class (class); - add_scroll_binding (binding_set, GDK_Left, GDK_CONTROL_MASK, GTK_SCROLL_STEP_BACKWARD, TRUE); - add_scroll_binding (binding_set, GDK_Right, GDK_CONTROL_MASK, GTK_SCROLL_STEP_FORWARD, TRUE); - add_scroll_binding (binding_set, GDK_Up, GDK_CONTROL_MASK, GTK_SCROLL_STEP_BACKWARD, FALSE); - add_scroll_binding (binding_set, GDK_Down, GDK_CONTROL_MASK, GTK_SCROLL_STEP_FORWARD, FALSE); + add_scroll_binding (binding_set, GDK_KEY_Left, GDK_CONTROL_MASK, GTK_SCROLL_STEP_BACKWARD, TRUE); + add_scroll_binding (binding_set, GDK_KEY_Right, GDK_CONTROL_MASK, GTK_SCROLL_STEP_FORWARD, TRUE); + add_scroll_binding (binding_set, GDK_KEY_Up, GDK_CONTROL_MASK, GTK_SCROLL_STEP_BACKWARD, FALSE); + add_scroll_binding (binding_set, GDK_KEY_Down, GDK_CONTROL_MASK, GTK_SCROLL_STEP_FORWARD, FALSE); - add_scroll_binding (binding_set, GDK_Page_Up, GDK_CONTROL_MASK, GTK_SCROLL_PAGE_BACKWARD, TRUE); - add_scroll_binding (binding_set, GDK_Page_Down, GDK_CONTROL_MASK, GTK_SCROLL_PAGE_FORWARD, TRUE); - add_scroll_binding (binding_set, GDK_Page_Up, 0, GTK_SCROLL_PAGE_BACKWARD, FALSE); - add_scroll_binding (binding_set, GDK_Page_Down, 0, GTK_SCROLL_PAGE_FORWARD, FALSE); + add_scroll_binding (binding_set, GDK_KEY_Page_Up, GDK_CONTROL_MASK, GTK_SCROLL_PAGE_BACKWARD, TRUE); + add_scroll_binding (binding_set, GDK_KEY_Page_Down, GDK_CONTROL_MASK, GTK_SCROLL_PAGE_FORWARD, TRUE); + add_scroll_binding (binding_set, GDK_KEY_Page_Up, 0, GTK_SCROLL_PAGE_BACKWARD, FALSE); + add_scroll_binding (binding_set, GDK_KEY_Page_Down, 0, GTK_SCROLL_PAGE_FORWARD, FALSE); - add_scroll_binding (binding_set, GDK_Home, GDK_CONTROL_MASK, GTK_SCROLL_START, TRUE); - add_scroll_binding (binding_set, GDK_End, GDK_CONTROL_MASK, GTK_SCROLL_END, TRUE); - add_scroll_binding (binding_set, GDK_Home, 0, GTK_SCROLL_START, FALSE); - add_scroll_binding (binding_set, GDK_End, 0, GTK_SCROLL_END, FALSE); + add_scroll_binding (binding_set, GDK_KEY_Home, GDK_CONTROL_MASK, GTK_SCROLL_START, TRUE); + add_scroll_binding (binding_set, GDK_KEY_End, GDK_CONTROL_MASK, GTK_SCROLL_END, TRUE); + add_scroll_binding (binding_set, GDK_KEY_Home, 0, GTK_SCROLL_START, FALSE); + add_scroll_binding (binding_set, GDK_KEY_End, 0, GTK_SCROLL_END, FALSE); add_tab_bindings (binding_set, GDK_CONTROL_MASK, GTK_DIR_TAB_FORWARD); add_tab_bindings (binding_set, GDK_CONTROL_MASK | GDK_SHIFT_MASK, GTK_DIR_TAB_BACKWARD); diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c index de910c1fb2..4576435eac 100644 --- a/gtk/gtkspinbutton.c +++ b/gtk/gtkspinbutton.c @@ -392,14 +392,14 @@ gtk_spin_button_class_init (GtkSpinButtonClass *class) binding_set = gtk_binding_set_by_class (class); - add_spin_binding (binding_set, GDK_Up, 0, GTK_SCROLL_STEP_UP); - add_spin_binding (binding_set, GDK_KP_Up, 0, GTK_SCROLL_STEP_UP); - add_spin_binding (binding_set, GDK_Down, 0, GTK_SCROLL_STEP_DOWN); - add_spin_binding (binding_set, GDK_KP_Down, 0, GTK_SCROLL_STEP_DOWN); - add_spin_binding (binding_set, GDK_Page_Up, 0, GTK_SCROLL_PAGE_UP); - add_spin_binding (binding_set, GDK_Page_Down, 0, GTK_SCROLL_PAGE_DOWN); - add_spin_binding (binding_set, GDK_Page_Up, GDK_CONTROL_MASK, GTK_SCROLL_END); - add_spin_binding (binding_set, GDK_Page_Down, GDK_CONTROL_MASK, GTK_SCROLL_START); + add_spin_binding (binding_set, GDK_KEY_Up, 0, GTK_SCROLL_STEP_UP); + add_spin_binding (binding_set, GDK_KEY_KP_Up, 0, GTK_SCROLL_STEP_UP); + add_spin_binding (binding_set, GDK_KEY_Down, 0, GTK_SCROLL_STEP_DOWN); + add_spin_binding (binding_set, GDK_KEY_KP_Down, 0, GTK_SCROLL_STEP_DOWN); + add_spin_binding (binding_set, GDK_KEY_Page_Up, 0, GTK_SCROLL_PAGE_UP); + add_spin_binding (binding_set, GDK_KEY_Page_Down, 0, GTK_SCROLL_PAGE_DOWN); + add_spin_binding (binding_set, GDK_KEY_Page_Up, GDK_CONTROL_MASK, GTK_SCROLL_END); + add_spin_binding (binding_set, GDK_KEY_Page_Down, GDK_CONTROL_MASK, GTK_SCROLL_START); g_type_class_add_private (class, sizeof (GtkSpinButtonPrivate)); } diff --git a/gtk/gtkstatusicon.c b/gtk/gtkstatusicon.c index e4f31d2017..89ce944f3a 100644 --- a/gtk/gtkstatusicon.c +++ b/gtk/gtkstatusicon.c @@ -1702,11 +1702,11 @@ gtk_status_icon_key_press (GtkStatusIcon *status_icon, state = event->state & gtk_accelerator_get_default_mod_mask (); keyval = event->keyval; if (state == 0 && - (keyval == GDK_Return || - keyval == GDK_KP_Enter || - keyval == GDK_ISO_Enter || - keyval == GDK_space || - keyval == GDK_KP_Space)) + (keyval == GDK_KEY_Return || + keyval == GDK_KEY_KP_Enter || + keyval == GDK_KEY_ISO_Enter || + keyval == GDK_KEY_space || + keyval == GDK_KEY_KP_Space)) { emit_activate_signal (status_icon); return TRUE; diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c index 5698199bc3..db1073a2f1 100644 --- a/gtk/gtktextview.c +++ b/gtk/gtktextview.c @@ -1135,206 +1135,206 @@ gtk_text_view_class_init (GtkTextViewClass *klass) binding_set = gtk_binding_set_by_class (klass); /* Moving the insertion point */ - add_move_binding (binding_set, GDK_Right, 0, + add_move_binding (binding_set, GDK_KEY_Right, 0, GTK_MOVEMENT_VISUAL_POSITIONS, 1); - add_move_binding (binding_set, GDK_KP_Right, 0, + add_move_binding (binding_set, GDK_KEY_KP_Right, 0, GTK_MOVEMENT_VISUAL_POSITIONS, 1); - add_move_binding (binding_set, GDK_Left, 0, + add_move_binding (binding_set, GDK_KEY_Left, 0, GTK_MOVEMENT_VISUAL_POSITIONS, -1); - add_move_binding (binding_set, GDK_KP_Left, 0, + add_move_binding (binding_set, GDK_KEY_KP_Left, 0, GTK_MOVEMENT_VISUAL_POSITIONS, -1); - add_move_binding (binding_set, GDK_Right, GDK_CONTROL_MASK, + add_move_binding (binding_set, GDK_KEY_Right, GDK_CONTROL_MASK, GTK_MOVEMENT_WORDS, 1); - add_move_binding (binding_set, GDK_KP_Right, GDK_CONTROL_MASK, + add_move_binding (binding_set, GDK_KEY_KP_Right, GDK_CONTROL_MASK, GTK_MOVEMENT_WORDS, 1); - add_move_binding (binding_set, GDK_Left, GDK_CONTROL_MASK, + add_move_binding (binding_set, GDK_KEY_Left, GDK_CONTROL_MASK, GTK_MOVEMENT_WORDS, -1); - add_move_binding (binding_set, GDK_KP_Left, GDK_CONTROL_MASK, + add_move_binding (binding_set, GDK_KEY_KP_Left, GDK_CONTROL_MASK, GTK_MOVEMENT_WORDS, -1); - add_move_binding (binding_set, GDK_Up, 0, + add_move_binding (binding_set, GDK_KEY_Up, 0, GTK_MOVEMENT_DISPLAY_LINES, -1); - add_move_binding (binding_set, GDK_KP_Up, 0, + add_move_binding (binding_set, GDK_KEY_KP_Up, 0, GTK_MOVEMENT_DISPLAY_LINES, -1); - add_move_binding (binding_set, GDK_Down, 0, + add_move_binding (binding_set, GDK_KEY_Down, 0, GTK_MOVEMENT_DISPLAY_LINES, 1); - add_move_binding (binding_set, GDK_KP_Down, 0, + add_move_binding (binding_set, GDK_KEY_KP_Down, 0, GTK_MOVEMENT_DISPLAY_LINES, 1); - add_move_binding (binding_set, GDK_Up, GDK_CONTROL_MASK, + add_move_binding (binding_set, GDK_KEY_Up, GDK_CONTROL_MASK, GTK_MOVEMENT_PARAGRAPHS, -1); - add_move_binding (binding_set, GDK_KP_Up, GDK_CONTROL_MASK, + add_move_binding (binding_set, GDK_KEY_KP_Up, GDK_CONTROL_MASK, GTK_MOVEMENT_PARAGRAPHS, -1); - add_move_binding (binding_set, GDK_Down, GDK_CONTROL_MASK, + add_move_binding (binding_set, GDK_KEY_Down, GDK_CONTROL_MASK, GTK_MOVEMENT_PARAGRAPHS, 1); - add_move_binding (binding_set, GDK_KP_Down, GDK_CONTROL_MASK, + add_move_binding (binding_set, GDK_KEY_KP_Down, GDK_CONTROL_MASK, GTK_MOVEMENT_PARAGRAPHS, 1); - add_move_binding (binding_set, GDK_Home, 0, + add_move_binding (binding_set, GDK_KEY_Home, 0, GTK_MOVEMENT_DISPLAY_LINE_ENDS, -1); - add_move_binding (binding_set, GDK_KP_Home, 0, + add_move_binding (binding_set, GDK_KEY_KP_Home, 0, GTK_MOVEMENT_DISPLAY_LINE_ENDS, -1); - add_move_binding (binding_set, GDK_End, 0, + add_move_binding (binding_set, GDK_KEY_End, 0, GTK_MOVEMENT_DISPLAY_LINE_ENDS, 1); - add_move_binding (binding_set, GDK_KP_End, 0, + add_move_binding (binding_set, GDK_KEY_KP_End, 0, GTK_MOVEMENT_DISPLAY_LINE_ENDS, 1); - add_move_binding (binding_set, GDK_Home, GDK_CONTROL_MASK, + add_move_binding (binding_set, GDK_KEY_Home, GDK_CONTROL_MASK, GTK_MOVEMENT_BUFFER_ENDS, -1); - add_move_binding (binding_set, GDK_KP_Home, GDK_CONTROL_MASK, + add_move_binding (binding_set, GDK_KEY_KP_Home, GDK_CONTROL_MASK, GTK_MOVEMENT_BUFFER_ENDS, -1); - add_move_binding (binding_set, GDK_End, GDK_CONTROL_MASK, + add_move_binding (binding_set, GDK_KEY_End, GDK_CONTROL_MASK, GTK_MOVEMENT_BUFFER_ENDS, 1); - add_move_binding (binding_set, GDK_KP_End, GDK_CONTROL_MASK, + add_move_binding (binding_set, GDK_KEY_KP_End, GDK_CONTROL_MASK, GTK_MOVEMENT_BUFFER_ENDS, 1); - add_move_binding (binding_set, GDK_Page_Up, 0, + add_move_binding (binding_set, GDK_KEY_Page_Up, 0, GTK_MOVEMENT_PAGES, -1); - add_move_binding (binding_set, GDK_KP_Page_Up, 0, + add_move_binding (binding_set, GDK_KEY_KP_Page_Up, 0, GTK_MOVEMENT_PAGES, -1); - add_move_binding (binding_set, GDK_Page_Down, 0, + add_move_binding (binding_set, GDK_KEY_Page_Down, 0, GTK_MOVEMENT_PAGES, 1); - add_move_binding (binding_set, GDK_KP_Page_Down, 0, + add_move_binding (binding_set, GDK_KEY_KP_Page_Down, 0, GTK_MOVEMENT_PAGES, 1); - add_move_binding (binding_set, GDK_Page_Up, GDK_CONTROL_MASK, + add_move_binding (binding_set, GDK_KEY_Page_Up, GDK_CONTROL_MASK, GTK_MOVEMENT_HORIZONTAL_PAGES, -1); - add_move_binding (binding_set, GDK_KP_Page_Up, GDK_CONTROL_MASK, + add_move_binding (binding_set, GDK_KEY_KP_Page_Up, GDK_CONTROL_MASK, GTK_MOVEMENT_HORIZONTAL_PAGES, -1); - add_move_binding (binding_set, GDK_Page_Down, GDK_CONTROL_MASK, + add_move_binding (binding_set, GDK_KEY_Page_Down, GDK_CONTROL_MASK, GTK_MOVEMENT_HORIZONTAL_PAGES, 1); - add_move_binding (binding_set, GDK_KP_Page_Down, GDK_CONTROL_MASK, + add_move_binding (binding_set, GDK_KEY_KP_Page_Down, GDK_CONTROL_MASK, GTK_MOVEMENT_HORIZONTAL_PAGES, 1); /* Select all */ - gtk_binding_entry_add_signal (binding_set, GDK_a, GDK_CONTROL_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_a, GDK_CONTROL_MASK, "select-all", 1, G_TYPE_BOOLEAN, TRUE); - gtk_binding_entry_add_signal (binding_set, GDK_slash, GDK_CONTROL_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_slash, GDK_CONTROL_MASK, "select-all", 1, G_TYPE_BOOLEAN, TRUE); /* Unselect all */ - gtk_binding_entry_add_signal (binding_set, GDK_backslash, GDK_CONTROL_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_backslash, GDK_CONTROL_MASK, "select-all", 1, G_TYPE_BOOLEAN, FALSE); - gtk_binding_entry_add_signal (binding_set, GDK_a, GDK_SHIFT_MASK | GDK_CONTROL_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_a, GDK_SHIFT_MASK | GDK_CONTROL_MASK, "select-all", 1, G_TYPE_BOOLEAN, FALSE); /* Deleting text */ - gtk_binding_entry_add_signal (binding_set, GDK_Delete, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Delete, 0, "delete-from-cursor", 2, G_TYPE_ENUM, GTK_DELETE_CHARS, G_TYPE_INT, 1); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Delete, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Delete, 0, "delete-from-cursor", 2, G_TYPE_ENUM, GTK_DELETE_CHARS, G_TYPE_INT, 1); - gtk_binding_entry_add_signal (binding_set, GDK_BackSpace, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_BackSpace, 0, "backspace", 0); /* Make this do the same as Backspace, to help with mis-typing */ - gtk_binding_entry_add_signal (binding_set, GDK_BackSpace, GDK_SHIFT_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_BackSpace, GDK_SHIFT_MASK, "backspace", 0); - gtk_binding_entry_add_signal (binding_set, GDK_Delete, GDK_CONTROL_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Delete, GDK_CONTROL_MASK, "delete-from-cursor", 2, G_TYPE_ENUM, GTK_DELETE_WORD_ENDS, G_TYPE_INT, 1); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Delete, GDK_CONTROL_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Delete, GDK_CONTROL_MASK, "delete-from-cursor", 2, G_TYPE_ENUM, GTK_DELETE_WORD_ENDS, G_TYPE_INT, 1); - gtk_binding_entry_add_signal (binding_set, GDK_BackSpace, GDK_CONTROL_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_BackSpace, GDK_CONTROL_MASK, "delete-from-cursor", 2, G_TYPE_ENUM, GTK_DELETE_WORD_ENDS, G_TYPE_INT, -1); - gtk_binding_entry_add_signal (binding_set, GDK_Delete, GDK_SHIFT_MASK | GDK_CONTROL_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Delete, GDK_SHIFT_MASK | GDK_CONTROL_MASK, "delete-from-cursor", 2, G_TYPE_ENUM, GTK_DELETE_PARAGRAPH_ENDS, G_TYPE_INT, 1); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Delete, GDK_SHIFT_MASK | GDK_CONTROL_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Delete, GDK_SHIFT_MASK | GDK_CONTROL_MASK, "delete-from-cursor", 2, G_TYPE_ENUM, GTK_DELETE_PARAGRAPH_ENDS, G_TYPE_INT, 1); - gtk_binding_entry_add_signal (binding_set, GDK_BackSpace, GDK_SHIFT_MASK | GDK_CONTROL_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_BackSpace, GDK_SHIFT_MASK | GDK_CONTROL_MASK, "delete-from-cursor", 2, G_TYPE_ENUM, GTK_DELETE_PARAGRAPH_ENDS, G_TYPE_INT, -1); /* Cut/copy/paste */ - gtk_binding_entry_add_signal (binding_set, GDK_x, GDK_CONTROL_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_x, GDK_CONTROL_MASK, "cut-clipboard", 0); - gtk_binding_entry_add_signal (binding_set, GDK_c, GDK_CONTROL_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_c, GDK_CONTROL_MASK, "copy-clipboard", 0); - gtk_binding_entry_add_signal (binding_set, GDK_v, GDK_CONTROL_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_v, GDK_CONTROL_MASK, "paste-clipboard", 0); - gtk_binding_entry_add_signal (binding_set, GDK_Delete, GDK_SHIFT_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Delete, GDK_SHIFT_MASK, "cut-clipboard", 0); - gtk_binding_entry_add_signal (binding_set, GDK_Insert, GDK_CONTROL_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Insert, GDK_CONTROL_MASK, "copy-clipboard", 0); - gtk_binding_entry_add_signal (binding_set, GDK_Insert, GDK_SHIFT_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Insert, GDK_SHIFT_MASK, "paste-clipboard", 0); /* Overwrite */ - gtk_binding_entry_add_signal (binding_set, GDK_Insert, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Insert, 0, "toggle-overwrite", 0); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Insert, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Insert, 0, "toggle-overwrite", 0); /* Caret mode */ - gtk_binding_entry_add_signal (binding_set, GDK_F7, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_F7, 0, "toggle-cursor-visible", 0); /* Control-tab focus motion */ - gtk_binding_entry_add_signal (binding_set, GDK_Tab, GDK_CONTROL_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Tab, GDK_CONTROL_MASK, "move-focus", 1, GTK_TYPE_DIRECTION_TYPE, GTK_DIR_TAB_FORWARD); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Tab, GDK_CONTROL_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Tab, GDK_CONTROL_MASK, "move-focus", 1, GTK_TYPE_DIRECTION_TYPE, GTK_DIR_TAB_FORWARD); - gtk_binding_entry_add_signal (binding_set, GDK_Tab, GDK_SHIFT_MASK | GDK_CONTROL_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Tab, GDK_SHIFT_MASK | GDK_CONTROL_MASK, "move-focus", 1, GTK_TYPE_DIRECTION_TYPE, GTK_DIR_TAB_BACKWARD); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Tab, GDK_SHIFT_MASK | GDK_CONTROL_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Tab, GDK_SHIFT_MASK | GDK_CONTROL_MASK, "move-focus", 1, GTK_TYPE_DIRECTION_TYPE, GTK_DIR_TAB_BACKWARD); @@ -4415,9 +4415,9 @@ gtk_text_view_key_press_event (GtkWidget *widget, GdkEventKey *event) } /* use overall editability not can_insert, more predictable for users */ else if (priv->editable && - (event->keyval == GDK_Return || - event->keyval == GDK_ISO_Enter || - event->keyval == GDK_KP_Enter)) + (event->keyval == GDK_KEY_Return || + event->keyval == GDK_KEY_ISO_Enter || + event->keyval == GDK_KEY_KP_Enter)) { /* this won't actually insert the newline if the cursor isn't * editable @@ -4429,9 +4429,9 @@ gtk_text_view_key_press_event (GtkWidget *widget, GdkEventKey *event) retval = TRUE; } /* Pass through Tab as literal tab, unless Control is held down */ - else if ((event->keyval == GDK_Tab || - event->keyval == GDK_KP_Tab || - event->keyval == GDK_ISO_Left_Tab) && + else if ((event->keyval == GDK_KEY_Tab || + event->keyval == GDK_KEY_KP_Tab || + event->keyval == GDK_KEY_ISO_Left_Tab) && !(event->state & GDK_CONTROL_MASK)) { /* If the text widget isn't editable overall, or if the application diff --git a/gtk/gtktoolbar.c b/gtk/gtktoolbar.c index 69938f1c9e..e3f207e805 100644 --- a/gtk/gtktoolbar.c +++ b/gtk/gtktoolbar.c @@ -298,7 +298,7 @@ add_arrow_bindings (GtkBindingSet *binding_set, guint keysym, GtkDirectionType dir) { - guint keypad_keysym = keysym - GDK_Left + GDK_KP_Left; + guint keypad_keysym = keysym - GDK_KEY_Left + GDK_KEY_KP_Left; gtk_binding_entry_add_signal (binding_set, keysym, 0, "move-focus", 1, @@ -314,11 +314,11 @@ add_ctrl_tab_bindings (GtkBindingSet *binding_set, GtkDirectionType direction) { gtk_binding_entry_add_signal (binding_set, - GDK_Tab, GDK_CONTROL_MASK | modifiers, + GDK_KEY_Tab, GDK_CONTROL_MASK | modifiers, "move-focus", 1, GTK_TYPE_DIRECTION_TYPE, direction); gtk_binding_entry_add_signal (binding_set, - GDK_KP_Tab, GDK_CONTROL_MASK | modifiers, + GDK_KEY_KP_Tab, GDK_CONTROL_MASK | modifiers, "move-focus", 1, GTK_TYPE_DIRECTION_TYPE, direction); } @@ -581,21 +581,21 @@ gtk_toolbar_class_init (GtkToolbarClass *klass) binding_set = gtk_binding_set_by_class (klass); - add_arrow_bindings (binding_set, GDK_Left, GTK_DIR_LEFT); - add_arrow_bindings (binding_set, GDK_Right, GTK_DIR_RIGHT); - add_arrow_bindings (binding_set, GDK_Up, GTK_DIR_UP); - add_arrow_bindings (binding_set, GDK_Down, GTK_DIR_DOWN); + add_arrow_bindings (binding_set, GDK_KEY_Left, GTK_DIR_LEFT); + add_arrow_bindings (binding_set, GDK_KEY_Right, GTK_DIR_RIGHT); + add_arrow_bindings (binding_set, GDK_KEY_Up, GTK_DIR_UP); + add_arrow_bindings (binding_set, GDK_KEY_Down, GTK_DIR_DOWN); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Home, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Home, 0, "focus-home-or-end", 1, G_TYPE_BOOLEAN, TRUE); - gtk_binding_entry_add_signal (binding_set, GDK_Home, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Home, 0, "focus-home-or-end", 1, G_TYPE_BOOLEAN, TRUE); - gtk_binding_entry_add_signal (binding_set, GDK_KP_End, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_End, 0, "focus-home-or-end", 1, G_TYPE_BOOLEAN, FALSE); - gtk_binding_entry_add_signal (binding_set, GDK_End, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_End, 0, "focus-home-or-end", 1, G_TYPE_BOOLEAN, FALSE); diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c index be971d3c25..f35e96daa3 100644 --- a/gtk/gtktreeview.c +++ b/gtk/gtktreeview.c @@ -1098,217 +1098,217 @@ gtk_tree_view_class_init (GtkTreeViewClass *class) G_TYPE_BOOLEAN, 0); /* Key bindings */ - gtk_tree_view_add_move_binding (binding_set, GDK_Up, 0, TRUE, + gtk_tree_view_add_move_binding (binding_set, GDK_KEY_Up, 0, TRUE, GTK_MOVEMENT_DISPLAY_LINES, -1); - gtk_tree_view_add_move_binding (binding_set, GDK_KP_Up, 0, TRUE, + gtk_tree_view_add_move_binding (binding_set, GDK_KEY_KP_Up, 0, TRUE, GTK_MOVEMENT_DISPLAY_LINES, -1); - gtk_tree_view_add_move_binding (binding_set, GDK_Down, 0, TRUE, + gtk_tree_view_add_move_binding (binding_set, GDK_KEY_Down, 0, TRUE, GTK_MOVEMENT_DISPLAY_LINES, 1); - gtk_tree_view_add_move_binding (binding_set, GDK_KP_Down, 0, TRUE, + gtk_tree_view_add_move_binding (binding_set, GDK_KEY_KP_Down, 0, TRUE, GTK_MOVEMENT_DISPLAY_LINES, 1); - gtk_tree_view_add_move_binding (binding_set, GDK_p, GDK_CONTROL_MASK, FALSE, + gtk_tree_view_add_move_binding (binding_set, GDK_KEY_p, GDK_CONTROL_MASK, FALSE, GTK_MOVEMENT_DISPLAY_LINES, -1); - gtk_tree_view_add_move_binding (binding_set, GDK_n, GDK_CONTROL_MASK, FALSE, + gtk_tree_view_add_move_binding (binding_set, GDK_KEY_n, GDK_CONTROL_MASK, FALSE, GTK_MOVEMENT_DISPLAY_LINES, 1); - gtk_tree_view_add_move_binding (binding_set, GDK_Home, 0, TRUE, + gtk_tree_view_add_move_binding (binding_set, GDK_KEY_Home, 0, TRUE, GTK_MOVEMENT_BUFFER_ENDS, -1); - gtk_tree_view_add_move_binding (binding_set, GDK_KP_Home, 0, TRUE, + gtk_tree_view_add_move_binding (binding_set, GDK_KEY_KP_Home, 0, TRUE, GTK_MOVEMENT_BUFFER_ENDS, -1); - gtk_tree_view_add_move_binding (binding_set, GDK_End, 0, TRUE, + gtk_tree_view_add_move_binding (binding_set, GDK_KEY_End, 0, TRUE, GTK_MOVEMENT_BUFFER_ENDS, 1); - gtk_tree_view_add_move_binding (binding_set, GDK_KP_End, 0, TRUE, + gtk_tree_view_add_move_binding (binding_set, GDK_KEY_KP_End, 0, TRUE, GTK_MOVEMENT_BUFFER_ENDS, 1); - gtk_tree_view_add_move_binding (binding_set, GDK_Page_Up, 0, TRUE, + gtk_tree_view_add_move_binding (binding_set, GDK_KEY_Page_Up, 0, TRUE, GTK_MOVEMENT_PAGES, -1); - gtk_tree_view_add_move_binding (binding_set, GDK_KP_Page_Up, 0, TRUE, + gtk_tree_view_add_move_binding (binding_set, GDK_KEY_KP_Page_Up, 0, TRUE, GTK_MOVEMENT_PAGES, -1); - gtk_tree_view_add_move_binding (binding_set, GDK_Page_Down, 0, TRUE, + gtk_tree_view_add_move_binding (binding_set, GDK_KEY_Page_Down, 0, TRUE, GTK_MOVEMENT_PAGES, 1); - gtk_tree_view_add_move_binding (binding_set, GDK_KP_Page_Down, 0, TRUE, + gtk_tree_view_add_move_binding (binding_set, GDK_KEY_KP_Page_Down, 0, TRUE, GTK_MOVEMENT_PAGES, 1); - gtk_binding_entry_add_signal (binding_set, GDK_Right, 0, "move-cursor", 2, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Right, 0, "move-cursor", 2, G_TYPE_ENUM, GTK_MOVEMENT_VISUAL_POSITIONS, G_TYPE_INT, 1); - gtk_binding_entry_add_signal (binding_set, GDK_Left, 0, "move-cursor", 2, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Left, 0, "move-cursor", 2, G_TYPE_ENUM, GTK_MOVEMENT_VISUAL_POSITIONS, G_TYPE_INT, -1); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Right, 0, "move-cursor", 2, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Right, 0, "move-cursor", 2, G_TYPE_ENUM, GTK_MOVEMENT_VISUAL_POSITIONS, G_TYPE_INT, 1); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Left, 0, "move-cursor", 2, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Left, 0, "move-cursor", 2, G_TYPE_ENUM, GTK_MOVEMENT_VISUAL_POSITIONS, G_TYPE_INT, -1); - gtk_binding_entry_add_signal (binding_set, GDK_Right, GDK_CONTROL_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Right, GDK_CONTROL_MASK, "move-cursor", 2, G_TYPE_ENUM, GTK_MOVEMENT_VISUAL_POSITIONS, G_TYPE_INT, 1); - gtk_binding_entry_add_signal (binding_set, GDK_Left, GDK_CONTROL_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Left, GDK_CONTROL_MASK, "move-cursor", 2, G_TYPE_ENUM, GTK_MOVEMENT_VISUAL_POSITIONS, G_TYPE_INT, -1); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Right, GDK_CONTROL_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Right, GDK_CONTROL_MASK, "move-cursor", 2, G_TYPE_ENUM, GTK_MOVEMENT_VISUAL_POSITIONS, G_TYPE_INT, 1); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Left, GDK_CONTROL_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Left, GDK_CONTROL_MASK, "move-cursor", 2, G_TYPE_ENUM, GTK_MOVEMENT_VISUAL_POSITIONS, G_TYPE_INT, -1); - gtk_binding_entry_add_signal (binding_set, GDK_space, GDK_CONTROL_MASK, "toggle-cursor-row", 0); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Space, GDK_CONTROL_MASK, "toggle-cursor-row", 0); + gtk_binding_entry_add_signal (binding_set, GDK_KEY_space, GDK_CONTROL_MASK, "toggle-cursor-row", 0); + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Space, GDK_CONTROL_MASK, "toggle-cursor-row", 0); - gtk_binding_entry_add_signal (binding_set, GDK_a, GDK_CONTROL_MASK, "select-all", 0); - gtk_binding_entry_add_signal (binding_set, GDK_slash, GDK_CONTROL_MASK, "select-all", 0); + gtk_binding_entry_add_signal (binding_set, GDK_KEY_a, GDK_CONTROL_MASK, "select-all", 0); + gtk_binding_entry_add_signal (binding_set, GDK_KEY_slash, GDK_CONTROL_MASK, "select-all", 0); - gtk_binding_entry_add_signal (binding_set, GDK_A, GDK_CONTROL_MASK | GDK_SHIFT_MASK, "unselect-all", 0); - gtk_binding_entry_add_signal (binding_set, GDK_backslash, GDK_CONTROL_MASK, "unselect-all", 0); + gtk_binding_entry_add_signal (binding_set, GDK_KEY_A, GDK_CONTROL_MASK | GDK_SHIFT_MASK, "unselect-all", 0); + gtk_binding_entry_add_signal (binding_set, GDK_KEY_backslash, GDK_CONTROL_MASK, "unselect-all", 0); - gtk_binding_entry_add_signal (binding_set, GDK_space, GDK_SHIFT_MASK, "select-cursor-row", 1, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_space, GDK_SHIFT_MASK, "select-cursor-row", 1, G_TYPE_BOOLEAN, TRUE); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Space, GDK_SHIFT_MASK, "select-cursor-row", 1, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Space, GDK_SHIFT_MASK, "select-cursor-row", 1, G_TYPE_BOOLEAN, TRUE); - gtk_binding_entry_add_signal (binding_set, GDK_space, 0, "select-cursor-row", 1, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_space, 0, "select-cursor-row", 1, G_TYPE_BOOLEAN, TRUE); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Space, 0, "select-cursor-row", 1, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Space, 0, "select-cursor-row", 1, G_TYPE_BOOLEAN, TRUE); - gtk_binding_entry_add_signal (binding_set, GDK_Return, 0, "select-cursor-row", 1, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Return, 0, "select-cursor-row", 1, G_TYPE_BOOLEAN, TRUE); - gtk_binding_entry_add_signal (binding_set, GDK_ISO_Enter, 0, "select-cursor-row", 1, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_ISO_Enter, 0, "select-cursor-row", 1, G_TYPE_BOOLEAN, TRUE); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Enter, 0, "select-cursor-row", 1, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Enter, 0, "select-cursor-row", 1, G_TYPE_BOOLEAN, TRUE); /* expand and collapse rows */ - gtk_binding_entry_add_signal (binding_set, GDK_plus, 0, "expand-collapse-cursor-row", 3, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_plus, 0, "expand-collapse-cursor-row", 3, G_TYPE_BOOLEAN, TRUE, G_TYPE_BOOLEAN, TRUE, G_TYPE_BOOLEAN, FALSE); - gtk_binding_entry_add_signal (binding_set, GDK_asterisk, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_asterisk, 0, "expand-collapse-cursor-row", 3, G_TYPE_BOOLEAN, TRUE, G_TYPE_BOOLEAN, TRUE, G_TYPE_BOOLEAN, TRUE); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Multiply, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Multiply, 0, "expand-collapse-cursor-row", 3, G_TYPE_BOOLEAN, TRUE, G_TYPE_BOOLEAN, TRUE, G_TYPE_BOOLEAN, TRUE); - gtk_binding_entry_add_signal (binding_set, GDK_slash, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_slash, 0, "expand-collapse-cursor-row", 3, G_TYPE_BOOLEAN, TRUE, G_TYPE_BOOLEAN, FALSE, G_TYPE_BOOLEAN, FALSE); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Divide, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Divide, 0, "expand-collapse-cursor-row", 3, G_TYPE_BOOLEAN, TRUE, G_TYPE_BOOLEAN, FALSE, G_TYPE_BOOLEAN, FALSE); /* Not doable on US keyboards */ - gtk_binding_entry_add_signal (binding_set, GDK_plus, GDK_SHIFT_MASK, "expand-collapse-cursor-row", 3, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_plus, GDK_SHIFT_MASK, "expand-collapse-cursor-row", 3, G_TYPE_BOOLEAN, TRUE, G_TYPE_BOOLEAN, TRUE, G_TYPE_BOOLEAN, TRUE); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Add, 0, "expand-collapse-cursor-row", 3, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Add, 0, "expand-collapse-cursor-row", 3, G_TYPE_BOOLEAN, TRUE, G_TYPE_BOOLEAN, TRUE, G_TYPE_BOOLEAN, FALSE); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Add, GDK_SHIFT_MASK, "expand-collapse-cursor-row", 3, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Add, GDK_SHIFT_MASK, "expand-collapse-cursor-row", 3, G_TYPE_BOOLEAN, TRUE, G_TYPE_BOOLEAN, TRUE, G_TYPE_BOOLEAN, TRUE); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Add, GDK_SHIFT_MASK, "expand-collapse-cursor-row", 3, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Add, GDK_SHIFT_MASK, "expand-collapse-cursor-row", 3, G_TYPE_BOOLEAN, TRUE, G_TYPE_BOOLEAN, TRUE, G_TYPE_BOOLEAN, TRUE); - gtk_binding_entry_add_signal (binding_set, GDK_Right, GDK_SHIFT_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Right, GDK_SHIFT_MASK, "expand-collapse-cursor-row", 3, G_TYPE_BOOLEAN, FALSE, G_TYPE_BOOLEAN, TRUE, G_TYPE_BOOLEAN, TRUE); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Right, GDK_SHIFT_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Right, GDK_SHIFT_MASK, "expand-collapse-cursor-row", 3, G_TYPE_BOOLEAN, FALSE, G_TYPE_BOOLEAN, TRUE, G_TYPE_BOOLEAN, TRUE); - gtk_binding_entry_add_signal (binding_set, GDK_Right, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Right, GDK_CONTROL_MASK | GDK_SHIFT_MASK, "expand-collapse-cursor-row", 3, G_TYPE_BOOLEAN, FALSE, G_TYPE_BOOLEAN, TRUE, G_TYPE_BOOLEAN, TRUE); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Right, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Right, GDK_CONTROL_MASK | GDK_SHIFT_MASK, "expand-collapse-cursor-row", 3, G_TYPE_BOOLEAN, FALSE, G_TYPE_BOOLEAN, TRUE, G_TYPE_BOOLEAN, TRUE); - gtk_binding_entry_add_signal (binding_set, GDK_minus, 0, "expand-collapse-cursor-row", 3, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_minus, 0, "expand-collapse-cursor-row", 3, G_TYPE_BOOLEAN, TRUE, G_TYPE_BOOLEAN, FALSE, G_TYPE_BOOLEAN, FALSE); - gtk_binding_entry_add_signal (binding_set, GDK_minus, GDK_SHIFT_MASK, "expand-collapse-cursor-row", 3, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_minus, GDK_SHIFT_MASK, "expand-collapse-cursor-row", 3, G_TYPE_BOOLEAN, TRUE, G_TYPE_BOOLEAN, FALSE, G_TYPE_BOOLEAN, TRUE); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Subtract, 0, "expand-collapse-cursor-row", 3, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Subtract, 0, "expand-collapse-cursor-row", 3, G_TYPE_BOOLEAN, TRUE, G_TYPE_BOOLEAN, FALSE, G_TYPE_BOOLEAN, FALSE); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Subtract, GDK_SHIFT_MASK, "expand-collapse-cursor-row", 3, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Subtract, GDK_SHIFT_MASK, "expand-collapse-cursor-row", 3, G_TYPE_BOOLEAN, TRUE, G_TYPE_BOOLEAN, FALSE, G_TYPE_BOOLEAN, TRUE); - gtk_binding_entry_add_signal (binding_set, GDK_Left, GDK_SHIFT_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Left, GDK_SHIFT_MASK, "expand-collapse-cursor-row", 3, G_TYPE_BOOLEAN, FALSE, G_TYPE_BOOLEAN, FALSE, G_TYPE_BOOLEAN, TRUE); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Left, GDK_SHIFT_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Left, GDK_SHIFT_MASK, "expand-collapse-cursor-row", 3, G_TYPE_BOOLEAN, FALSE, G_TYPE_BOOLEAN, FALSE, G_TYPE_BOOLEAN, TRUE); - gtk_binding_entry_add_signal (binding_set, GDK_Left, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Left, GDK_CONTROL_MASK | GDK_SHIFT_MASK, "expand-collapse-cursor-row", 3, G_TYPE_BOOLEAN, FALSE, G_TYPE_BOOLEAN, FALSE, G_TYPE_BOOLEAN, TRUE); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Left, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Left, GDK_CONTROL_MASK | GDK_SHIFT_MASK, "expand-collapse-cursor-row", 3, G_TYPE_BOOLEAN, FALSE, G_TYPE_BOOLEAN, FALSE, G_TYPE_BOOLEAN, TRUE); - gtk_binding_entry_add_signal (binding_set, GDK_BackSpace, 0, "select-cursor-parent", 0); - gtk_binding_entry_add_signal (binding_set, GDK_BackSpace, GDK_CONTROL_MASK, "select-cursor-parent", 0); + gtk_binding_entry_add_signal (binding_set, GDK_KEY_BackSpace, 0, "select-cursor-parent", 0); + gtk_binding_entry_add_signal (binding_set, GDK_KEY_BackSpace, GDK_CONTROL_MASK, "select-cursor-parent", 0); - gtk_binding_entry_add_signal (binding_set, GDK_f, GDK_CONTROL_MASK, "start-interactive-search", 0); + gtk_binding_entry_add_signal (binding_set, GDK_KEY_f, GDK_CONTROL_MASK, "start-interactive-search", 0); - gtk_binding_entry_add_signal (binding_set, GDK_F, GDK_CONTROL_MASK, "start-interactive-search", 0); + gtk_binding_entry_add_signal (binding_set, GDK_KEY_F, GDK_CONTROL_MASK, "start-interactive-search", 0); g_type_class_add_private (o_class, sizeof (GtkTreeViewPrivate)); } @@ -5332,7 +5332,7 @@ gtk_tree_view_key_press (GtkWidget *widget, if (tree_view->priv->rubber_band_status) { - if (event->keyval == GDK_Escape) + if (event->keyval == GDK_KEY_Escape) gtk_tree_view_stop_rubber_band (tree_view); return TRUE; @@ -5340,7 +5340,7 @@ gtk_tree_view_key_press (GtkWidget *widget, if (GTK_TREE_VIEW_FLAG_SET (tree_view, GTK_TREE_VIEW_IN_COLUMN_DRAG)) { - if (event->keyval == GDK_Escape) + if (event->keyval == GDK_KEY_Escape) { tree_view->priv->cur_reorder = NULL; gtk_tree_view_button_release_drag_column (widget, NULL); @@ -5367,8 +5367,8 @@ gtk_tree_view_key_press (GtkWidget *widget, if (focus_column && (event->state & GDK_SHIFT_MASK) && (event->state & GDK_MOD1_MASK) && - (event->keyval == GDK_Left || event->keyval == GDK_KP_Left - || event->keyval == GDK_Right || event->keyval == GDK_KP_Right)) + (event->keyval == GDK_KEY_Left || event->keyval == GDK_KEY_KP_Left + || event->keyval == GDK_KEY_Right || event->keyval == GDK_KEY_KP_Right)) { GtkTreeViewColumn *column = GTK_TREE_VIEW_COLUMN (focus_column->data); @@ -5378,8 +5378,8 @@ gtk_tree_view_key_press (GtkWidget *widget, return TRUE; } - if (event->keyval == (rtl ? GDK_Right : GDK_Left) - || event->keyval == (rtl ? GDK_KP_Right : GDK_KP_Left)) + if (event->keyval == (rtl ? GDK_KEY_Right : GDK_KEY_Left) + || event->keyval == (rtl ? GDK_KEY_KP_Right : GDK_KEY_KP_Left)) { GtkRequisition button_req; gint old_width = column->resized_width; @@ -5412,8 +5412,8 @@ gtk_tree_view_key_press (GtkWidget *widget, else gtk_widget_error_bell (widget); } - else if (event->keyval == (rtl ? GDK_Left : GDK_Right) - || event->keyval == (rtl ? GDK_KP_Left : GDK_KP_Right)) + else if (event->keyval == (rtl ? GDK_KEY_Left : GDK_KEY_Right) + || event->keyval == (rtl ? GDK_KEY_KP_Left : GDK_KEY_KP_Right)) { gint old_width = column->resized_width; @@ -5438,15 +5438,15 @@ gtk_tree_view_key_press (GtkWidget *widget, if (focus_column && (event->state & GDK_MOD1_MASK) && - (event->keyval == GDK_Left || event->keyval == GDK_KP_Left - || event->keyval == GDK_Right || event->keyval == GDK_KP_Right - || event->keyval == GDK_Home || event->keyval == GDK_KP_Home - || event->keyval == GDK_End || event->keyval == GDK_KP_End)) + (event->keyval == GDK_KEY_Left || event->keyval == GDK_KEY_KP_Left + || event->keyval == GDK_KEY_Right || event->keyval == GDK_KEY_KP_Right + || event->keyval == GDK_KEY_Home || event->keyval == GDK_KEY_KP_Home + || event->keyval == GDK_KEY_End || event->keyval == GDK_KEY_KP_End)) { GtkTreeViewColumn *column = GTK_TREE_VIEW_COLUMN (focus_column->data); - if (event->keyval == (rtl ? GDK_Right : GDK_Left) - || event->keyval == (rtl ? GDK_KP_Right : GDK_KP_Left)) + if (event->keyval == (rtl ? GDK_KEY_Right : GDK_KEY_Left) + || event->keyval == (rtl ? GDK_KEY_KP_Right : GDK_KEY_KP_Left)) { GtkTreeViewColumn *col; col = gtk_tree_view_get_drop_column (tree_view, column, DROP_LEFT); @@ -5455,8 +5455,8 @@ gtk_tree_view_key_press (GtkWidget *widget, else gtk_widget_error_bell (widget); } - else if (event->keyval == (rtl ? GDK_Left : GDK_Right) - || event->keyval == (rtl ? GDK_KP_Left : GDK_KP_Right)) + else if (event->keyval == (rtl ? GDK_KEY_Left : GDK_KEY_Right) + || event->keyval == (rtl ? GDK_KEY_KP_Left : GDK_KEY_KP_Right)) { GtkTreeViewColumn *col; col = gtk_tree_view_get_drop_column (tree_view, column, DROP_RIGHT); @@ -5465,7 +5465,7 @@ gtk_tree_view_key_press (GtkWidget *widget, else gtk_widget_error_bell (widget); } - else if (event->keyval == GDK_Home || event->keyval == GDK_KP_Home) + else if (event->keyval == GDK_KEY_Home || event->keyval == GDK_KEY_KP_Home) { GtkTreeViewColumn *col; col = gtk_tree_view_get_drop_column (tree_view, column, DROP_HOME); @@ -5474,7 +5474,7 @@ gtk_tree_view_key_press (GtkWidget *widget, else gtk_widget_error_bell (widget); } - else if (event->keyval == GDK_End || event->keyval == GDK_KP_End) + else if (event->keyval == GDK_KEY_End || event->keyval == GDK_KEY_KP_End) { GtkTreeViewColumn *col; col = gtk_tree_view_get_drop_column (tree_view, column, DROP_END); @@ -14439,10 +14439,10 @@ gtk_tree_view_search_key_press_event (GtkWidget *widget, /* close window and cancel the search */ if (!tree_view->priv->search_custom_entry_set - && (event->keyval == GDK_Escape || - event->keyval == GDK_Tab || - event->keyval == GDK_KP_Tab || - event->keyval == GDK_ISO_Left_Tab)) + && (event->keyval == GDK_KEY_Escape || + event->keyval == GDK_KEY_Tab || + event->keyval == GDK_KEY_KP_Tab || + event->keyval == GDK_KEY_ISO_Left_Tab)) { gtk_tree_view_search_dialog_hide (widget, tree_view, gdk_event_get_device ((GdkEvent *) event)); @@ -14450,7 +14450,7 @@ gtk_tree_view_search_key_press_event (GtkWidget *widget, } /* select previous matching iter */ - if (event->keyval == GDK_Up || event->keyval == GDK_KP_Up) + if (event->keyval == GDK_KEY_Up || event->keyval == GDK_KEY_KP_Up) { if (!gtk_tree_view_search_move (widget, tree_view, TRUE)) gtk_widget_error_bell (widget); @@ -14459,7 +14459,7 @@ gtk_tree_view_search_key_press_event (GtkWidget *widget, } if (((event->state & (GTK_DEFAULT_ACCEL_MOD_MASK | GDK_SHIFT_MASK)) == (GTK_DEFAULT_ACCEL_MOD_MASK | GDK_SHIFT_MASK)) - && (event->keyval == GDK_g || event->keyval == GDK_G)) + && (event->keyval == GDK_KEY_g || event->keyval == GDK_KEY_G)) { if (!gtk_tree_view_search_move (widget, tree_view, TRUE)) gtk_widget_error_bell (widget); @@ -14468,7 +14468,7 @@ gtk_tree_view_search_key_press_event (GtkWidget *widget, } /* select next matching iter */ - if (event->keyval == GDK_Down || event->keyval == GDK_KP_Down) + if (event->keyval == GDK_KEY_Down || event->keyval == GDK_KEY_KP_Down) { if (!gtk_tree_view_search_move (widget, tree_view, FALSE)) gtk_widget_error_bell (widget); @@ -14477,7 +14477,7 @@ gtk_tree_view_search_key_press_event (GtkWidget *widget, } if (((event->state & (GTK_DEFAULT_ACCEL_MOD_MASK | GDK_SHIFT_MASK)) == GTK_DEFAULT_ACCEL_MOD_MASK) - && (event->keyval == GDK_g || event->keyval == GDK_G)) + && (event->keyval == GDK_KEY_g || event->keyval == GDK_KEY_G)) { if (!gtk_tree_view_search_move (widget, tree_view, FALSE)) gtk_widget_error_bell (widget); diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index 358b03d569..e21a56902d 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -2469,24 +2469,24 @@ gtk_widget_class_init (GtkWidgetClass *klass) G_TYPE_BOOLEAN, 1, G_TYPE_UINT); binding_set = gtk_binding_set_by_class (klass); - gtk_binding_entry_add_signal (binding_set, GDK_F10, GDK_SHIFT_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_F10, GDK_SHIFT_MASK, "popup-menu", 0); - gtk_binding_entry_add_signal (binding_set, GDK_Menu, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Menu, 0, "popup-menu", 0); - gtk_binding_entry_add_signal (binding_set, GDK_F1, GDK_CONTROL_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_F1, GDK_CONTROL_MASK, "show-help", 1, GTK_TYPE_WIDGET_HELP_TYPE, GTK_WIDGET_HELP_TOOLTIP); - gtk_binding_entry_add_signal (binding_set, GDK_KP_F1, GDK_CONTROL_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_F1, GDK_CONTROL_MASK, "show-help", 1, GTK_TYPE_WIDGET_HELP_TYPE, GTK_WIDGET_HELP_TOOLTIP); - gtk_binding_entry_add_signal (binding_set, GDK_F1, GDK_SHIFT_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_F1, GDK_SHIFT_MASK, "show-help", 1, GTK_TYPE_WIDGET_HELP_TYPE, GTK_WIDGET_HELP_WHATS_THIS); - gtk_binding_entry_add_signal (binding_set, GDK_KP_F1, GDK_SHIFT_MASK, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_F1, GDK_SHIFT_MASK, "show-help", 1, GTK_TYPE_WIDGET_HELP_TYPE, GTK_WIDGET_HELP_WHATS_THIS); diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index 90b8b312f2..95223601a6 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -413,10 +413,10 @@ add_tab_bindings (GtkBindingSet *binding_set, GdkModifierType modifiers, GtkDirectionType direction) { - gtk_binding_entry_add_signal (binding_set, GDK_Tab, modifiers, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Tab, modifiers, "move-focus", 1, GTK_TYPE_DIRECTION_TYPE, direction); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Tab, modifiers, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Tab, modifiers, "move-focus", 1, GTK_TYPE_DIRECTION_TYPE, direction); } @@ -426,7 +426,7 @@ add_arrow_bindings (GtkBindingSet *binding_set, guint keysym, GtkDirectionType direction) { - guint keypad_keysym = keysym - GDK_Left + GDK_KP_Left; + guint keypad_keysym = keysym - GDK_KEY_Left + GDK_KEY_KP_Left; gtk_binding_entry_add_signal (binding_set, keysym, 0, "move-focus", 1, @@ -907,22 +907,22 @@ gtk_window_class_init (GtkWindowClass *klass) binding_set = gtk_binding_set_by_class (klass); - gtk_binding_entry_add_signal (binding_set, GDK_space, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_space, 0, "activate-focus", 0); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Space, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Space, 0, "activate-focus", 0); - gtk_binding_entry_add_signal (binding_set, GDK_Return, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Return, 0, "activate-default", 0); - gtk_binding_entry_add_signal (binding_set, GDK_ISO_Enter, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_ISO_Enter, 0, "activate-default", 0); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Enter, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Enter, 0, "activate-default", 0); - add_arrow_bindings (binding_set, GDK_Up, GTK_DIR_UP); - add_arrow_bindings (binding_set, GDK_Down, GTK_DIR_DOWN); - add_arrow_bindings (binding_set, GDK_Left, GTK_DIR_LEFT); - add_arrow_bindings (binding_set, GDK_Right, GTK_DIR_RIGHT); + add_arrow_bindings (binding_set, GDK_KEY_Up, GTK_DIR_UP); + add_arrow_bindings (binding_set, GDK_KEY_Down, GTK_DIR_DOWN); + add_arrow_bindings (binding_set, GDK_KEY_Left, GTK_DIR_LEFT); + add_arrow_bindings (binding_set, GDK_KEY_Right, GTK_DIR_RIGHT); add_tab_bindings (binding_set, 0, GTK_DIR_TAB_FORWARD); add_tab_bindings (binding_set, GDK_CONTROL_MASK, GTK_DIR_TAB_FORWARD); @@ -5129,8 +5129,8 @@ _gtk_window_query_nonaccels (GtkWindow *window, if (!accel_mods) { static const guint bindings[] = { - GDK_space, GDK_KP_Space, GDK_Return, GDK_ISO_Enter, GDK_KP_Enter, GDK_Up, GDK_KP_Up, GDK_Down, GDK_KP_Down, - GDK_Left, GDK_KP_Left, GDK_Right, GDK_KP_Right, GDK_Tab, GDK_KP_Tab, GDK_ISO_Left_Tab, + GDK_KEY_space, GDK_KEY_KP_Space, GDK_KEY_Return, GDK_KEY_ISO_Enter, GDK_KEY_KP_Enter, GDK_KEY_Up, GDK_KEY_KP_Up, GDK_KEY_Down, GDK_KEY_KP_Down, + GDK_KEY_Left, GDK_KEY_KP_Left, GDK_KEY_Right, GDK_KEY_KP_Right, GDK_KEY_Tab, GDK_KEY_KP_Tab, GDK_KEY_ISO_Left_Tab, }; guint i; @@ -8511,8 +8511,8 @@ add_to_key_hash (GtkWindow *window, */ if (modifiers & GDK_SHIFT_MASK) { - if (keyval == GDK_Tab) - keyval = GDK_ISO_Left_Tab; + if (keyval == GDK_KEY_Tab) + keyval = GDK_KEY_ISO_Left_Tab; else keyval = gdk_keyval_to_upper (keyval); } diff --git a/gtk/tests/testing.c b/gtk/tests/testing.c index c684555c15..155715228b 100644 --- a/gtk/tests/testing.c +++ b/gtk/tests/testing.c @@ -62,7 +62,7 @@ test_button_keys (void) g_assert (button != NULL); gtk_widget_grab_focus (button); g_assert (gtk_widget_has_focus (button)); - simsuccess = gtk_test_widget_send_key (button, GDK_Return, 0); + simsuccess = gtk_test_widget_send_key (button, GDK_KEY_Return, 0); g_assert (simsuccess == TRUE); while (gtk_events_pending ()) gtk_main_iteration (); |