[gimp] app: use more of the new GDK_KEY_foo key names



commit 7c60bb51813d12339640a7c826a677499afa02e9
Author: Michael Natterer <mitch gimp org>
Date:   Tue Mar 29 15:27:25 2011 +0200

    app: use more of the new GDK_KEY_foo key names
    
    and move the compat defines from display-enums.h to widgets-enums.h

 app/display/display-types.h          |   23 ------------
 app/display/gimpscalecombobox.c      |    8 ++--
 app/tools/gimpcagetool.c             |   10 +++---
 app/tools/gimpeditselectiontool.c    |   24 ++++++------
 app/tools/gimpforegroundselecttool.c |    8 ++--
 app/tools/gimpfreeselecttool.c       |   10 +++---
 app/tools/gimpimagemaptool.c         |   10 +++---
 app/tools/gimpiscissorstool.c        |    8 ++--
 app/tools/gimpmeasuretool.c          |    2 +-
 app/tools/gimpmovetool.c             |    1 -
 app/tools/gimprectangletool.c        |   16 ++++----
 app/tools/gimprotatetool.c           |    8 ++--
 app/tools/gimpselectiontool.c        |    1 -
 app/tools/gimptexttool-editor.c      |   14 ++++----
 app/tools/gimptransformtool.c        |   10 +++---
 app/tools/gimpvectortool.c           |   28 +++++++-------
 app/widgets/gimpcoloreditor.c        |    1 -
 app/widgets/gimpcontainergridview.c  |    8 ++--
 app/widgets/gimpcontainerpopup.c     |   12 +++---
 app/widgets/gimpcontainertreeview.c  |    2 +-
 app/widgets/gimpcontrollerkeyboard.c |   64 +++++++++++++++++-----------------
 app/widgets/gimpcurveview.c          |    6 ++--
 app/widgets/gimpdataeditor.c         |    2 +-
 app/widgets/gimpnavigationview.c     |    8 ++--
 app/widgets/gimpoverlaydialog.c      |    2 +-
 app/widgets/gimppaletteview.c        |   10 +++---
 app/widgets/gimptagentry.c           |   22 ++++++------
 app/widgets/gimptextproxy.c          |   12 +++---
 app/widgets/gimpuimanager.c          |    2 +-
 app/widgets/widgets-types.h          |   35 ++++++++++++++++++
 30 files changed, 188 insertions(+), 179 deletions(-)
---
diff --git a/app/display/display-types.h b/app/display/display-types.h
index e09f0b2..fd17145 100644
--- a/app/display/display-types.h
+++ b/app/display/display-types.h
@@ -41,29 +41,6 @@
 #endif
 
 
-#if ! GTK_CHECK_VERSION (2, 22, 0)
-#define GDK_KEY_Shift_L GDK_Shift_L
-#define GDK_KEY_Shift_R GDK_Shift_R
-#define GDK_KEY_Control_L GDK_Control_L
-#define GDK_KEY_Control_R GDK_Control_R
-#define GDK_KEY_Alt_L GDK_Alt_L
-#define GDK_KEY_Alt_R GDK_Alt_R
-#define GDK_KEY_Left GDK_Left
-#define GDK_KEY_Right GDK_Right
-#define GDK_KEY_Up GDK_Up
-#define GDK_KEY_Down GDK_Down
-#define GDK_KEY_Tab GDK_Tab
-#define GDK_KEY_ISO_Left_Tab GDK_ISO_Left_Tab
-#define GDK_KEY_space GDK_space
-#define GDK_KEY_KP_Space GDK_KP_Space
-#define GDK_KEY_Return GDK_Return
-#define GDK_KEY_KP_Enter GDK_KP_Enter
-#define GDK_KEY_ISO_Enter GDK_ISO_Enter
-#define GDK_KEY_BackSpace GDK_BackSpace
-#define GDK_KEY_Escape GDK_Escape
-#endif
-
-
 typedef struct _GimpCanvas            GimpCanvas;
 typedef struct _GimpCanvasItem        GimpCanvasItem;
 typedef struct _GimpCanvasGroup       GimpCanvasGroup;
diff --git a/app/display/gimpscalecombobox.c b/app/display/gimpscalecombobox.c
index 2529809..20db1c0 100644
--- a/app/display/gimpscalecombobox.c
+++ b/app/display/gimpscalecombobox.c
@@ -338,7 +338,7 @@ gimp_scale_combo_box_entry_key_press (GtkWidget         *entry,
                                       GdkEventKey       *event,
                                       GimpScaleComboBox *combo_box)
 {
-  if (event->keyval == GDK_Escape)
+  if (event->keyval == GDK_KEY_Escape)
     {
       gimp_scale_combo_box_set_scale (combo_box, combo_box->scale);
 
@@ -347,9 +347,9 @@ gimp_scale_combo_box_entry_key_press (GtkWidget         *entry,
       return TRUE;
     }
 
-  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)
     {
       gimp_scale_combo_box_entry_activate (entry, combo_box);
 
diff --git a/app/tools/gimpcagetool.c b/app/tools/gimpcagetool.c
index 31213b7..c66170f 100644
--- a/app/tools/gimpcagetool.c
+++ b/app/tools/gimpcagetool.c
@@ -381,14 +381,14 @@ gimp_cage_tool_key_press (GimpTool    *tool,
 
   switch (kevent->keyval)
     {
-    case GDK_BackSpace:
+    case GDK_KEY_BackSpace:
       if (! ct->cage_complete && ct->tool_state == CAGE_STATE_WAIT)
         gimp_cage_tool_remove_last_handle (ct);
       return TRUE;
 
-    case GDK_Return:
-    case GDK_KP_Enter:
-    case GDK_ISO_Enter:
+    case GDK_KEY_Return:
+    case GDK_KEY_KP_Enter:
+    case GDK_KEY_ISO_Enter:
       if (ct->tool_state == DEFORM_STATE_WAIT)
         {
           gimp_tool_control_set_preserve (tool->control, TRUE);
@@ -405,7 +405,7 @@ gimp_cage_tool_key_press (GimpTool    *tool,
         }
       return TRUE;
 
-    case GDK_Escape:
+    case GDK_KEY_Escape:
       gimp_cage_tool_halt (ct);
       return TRUE;
 
diff --git a/app/tools/gimpeditselectiontool.c b/app/tools/gimpeditselectiontool.c
index 6888215..5529677 100644
--- a/app/tools/gimpeditselectiontool.c
+++ b/app/tools/gimpeditselectiontool.c
@@ -1127,10 +1127,10 @@ gimp_edit_selection_tool_translate (GimpTool          *tool,
 
   /* bail out early if it is not an arrow key event */
 
-  if (kevent->keyval != GDK_Left &&
-      kevent->keyval != GDK_Right &&
-      kevent->keyval != GDK_Up &&
-      kevent->keyval != GDK_Down)
+  if (kevent->keyval != GDK_KEY_Left &&
+      kevent->keyval != GDK_KEY_Right &&
+      kevent->keyval != GDK_KEY_Up &&
+      kevent->keyval != GDK_KEY_Down)
     return FALSE;
 
   /*  adapt arrow velocity to the zoom factor when holding <shift>  */
@@ -1143,38 +1143,38 @@ gimp_edit_selection_tool_translate (GimpTool          *tool,
    *  them.
    */
   inc_x = process_event_queue_keys (kevent,
-                                    GDK_Left,
+                                    GDK_KEY_Left,
                                     kevent->state | GDK_SHIFT_MASK,
                                     -1 * velocity,
 
-                                    GDK_Left,
+                                    GDK_KEY_Left,
                                     kevent->state & ~GDK_SHIFT_MASK,
                                     -1,
 
-                                    GDK_Right,
+                                    GDK_KEY_Right,
                                     kevent->state | GDK_SHIFT_MASK,
                                     1 * velocity,
 
-                                    GDK_Right,
+                                    GDK_KEY_Right,
                                     kevent->state & ~GDK_SHIFT_MASK,
                                     1,
 
                                     0);
 
   inc_y = process_event_queue_keys (kevent,
-                                    GDK_Up,
+                                    GDK_KEY_Up,
                                     kevent->state | GDK_SHIFT_MASK,
                                     -1 * velocity,
 
-                                    GDK_Up,
+                                    GDK_KEY_Up,
                                     kevent->state & ~GDK_SHIFT_MASK,
                                     -1,
 
-                                    GDK_Down,
+                                    GDK_KEY_Down,
                                     kevent->state | GDK_SHIFT_MASK,
                                     1 * velocity,
 
-                                    GDK_Down,
+                                    GDK_KEY_Down,
                                     kevent->state & ~GDK_SHIFT_MASK,
                                     1,
 
diff --git a/app/tools/gimpforegroundselecttool.c b/app/tools/gimpforegroundselecttool.c
index b5bd8e1..a5237de 100644
--- a/app/tools/gimpforegroundselecttool.c
+++ b/app/tools/gimpforegroundselecttool.c
@@ -396,13 +396,13 @@ gimp_foreground_select_tool_key_press (GimpTool    *tool,
     {
       switch (kevent->keyval)
         {
-        case GDK_Return:
-        case GDK_KP_Enter:
-        case GDK_ISO_Enter:
+        case GDK_KEY_Return:
+        case GDK_KEY_KP_Enter:
+        case GDK_KEY_ISO_Enter:
           gimp_foreground_select_tool_apply (fg_select, display);
           return TRUE;
 
-        case GDK_Escape:
+        case GDK_KEY_Escape:
           gimp_tool_control (tool, GIMP_TOOL_ACTION_HALT, display);
           return TRUE;
 
diff --git a/app/tools/gimpfreeselecttool.c b/app/tools/gimpfreeselecttool.c
index d8870db..e205ce9 100644
--- a/app/tools/gimpfreeselecttool.c
+++ b/app/tools/gimpfreeselecttool.c
@@ -1435,17 +1435,17 @@ gimp_free_select_tool_key_press (GimpTool    *tool,
 
   switch (kevent->keyval)
     {
-    case GDK_BackSpace:
+    case GDK_KEY_BackSpace:
       gimp_free_select_tool_remove_last_segment (fst);
       return TRUE;
 
-    case GDK_Return:
-    case GDK_KP_Enter:
-    case GDK_ISO_Enter:
+    case GDK_KEY_Return:
+    case GDK_KEY_KP_Enter:
+    case GDK_KEY_ISO_Enter:
       gimp_free_select_tool_commit (fst, display);
       return TRUE;
 
-    case GDK_Escape:
+    case GDK_KEY_Escape:
       gimp_free_select_tool_halt (fst);
       return TRUE;
 
diff --git a/app/tools/gimpimagemaptool.c b/app/tools/gimpimagemaptool.c
index 1b663f4..66ddfb5 100644
--- a/app/tools/gimpimagemaptool.c
+++ b/app/tools/gimpimagemaptool.c
@@ -442,21 +442,21 @@ gimp_image_map_tool_key_press (GimpTool    *tool,
     {
       switch (kevent->keyval)
         {
-        case GDK_Return:
-        case GDK_KP_Enter:
-        case GDK_ISO_Enter:
+        case GDK_KEY_Return:
+        case GDK_KEY_KP_Enter:
+        case GDK_KEY_ISO_Enter:
           gimp_image_map_tool_response (image_map_tool->dialog,
                                         GTK_RESPONSE_OK,
                                         image_map_tool);
           return TRUE;
 
-        case GDK_BackSpace:
+        case GDK_KEY_BackSpace:
           gimp_image_map_tool_response (image_map_tool->dialog,
                                         RESPONSE_RESET,
                                         image_map_tool);
           return TRUE;
 
-        case GDK_Escape:
+        case GDK_KEY_Escape:
           gimp_image_map_tool_response (image_map_tool->dialog,
                                         GTK_RESPONSE_CANCEL,
                                         image_map_tool);
diff --git a/app/tools/gimpiscissorstool.c b/app/tools/gimpiscissorstool.c
index 9f079fc..8884272 100644
--- a/app/tools/gimpiscissorstool.c
+++ b/app/tools/gimpiscissorstool.c
@@ -1082,9 +1082,9 @@ gimp_iscissors_tool_key_press (GimpTool    *tool,
 
   switch (kevent->keyval)
     {
-    case GDK_Return:
-    case GDK_KP_Enter:
-    case GDK_ISO_Enter:
+    case GDK_KEY_Return:
+    case GDK_KEY_KP_Enter:
+    case GDK_KEY_ISO_Enter:
       if (iscissors->connected && iscissors->mask)
         {
           gimp_iscissors_tool_apply (iscissors, display);
@@ -1092,7 +1092,7 @@ gimp_iscissors_tool_key_press (GimpTool    *tool,
         }
       return FALSE;
 
-    case GDK_Escape:
+    case GDK_KEY_Escape:
       gimp_tool_control (tool, GIMP_TOOL_ACTION_HALT, display);
       return TRUE;
 
diff --git a/app/tools/gimpmeasuretool.c b/app/tools/gimpmeasuretool.c
index d3025d4..ab38d12 100644
--- a/app/tools/gimpmeasuretool.c
+++ b/app/tools/gimpmeasuretool.c
@@ -481,7 +481,7 @@ gimp_measure_tool_key_press (GimpTool    *tool,
     {
       switch (kevent->keyval)
         {
-        case GDK_Escape:
+        case GDK_KEY_Escape:
           gimp_measure_tool_halt (GIMP_MEASURE_TOOL (tool));
           return TRUE;
 
diff --git a/app/tools/gimpmovetool.c b/app/tools/gimpmovetool.c
index b03321a..db9e149 100644
--- a/app/tools/gimpmovetool.c
+++ b/app/tools/gimpmovetool.c
@@ -21,7 +21,6 @@
 
 #include <gegl.h>
 #include <gtk/gtk.h>
-#include <gdk/gdkkeysyms.h>
 
 #include "libgimpmath/gimpmath.h"
 #include "libgimpwidgets/gimpwidgets.h"
diff --git a/app/tools/gimprectangletool.c b/app/tools/gimprectangletool.c
index 4c2dbb6..63c61a1 100644
--- a/app/tools/gimprectangletool.c
+++ b/app/tools/gimprectangletool.c
@@ -1453,27 +1453,27 @@ gimp_rectangle_tool_key_press (GimpTool    *tool,
 
   switch (kevent->keyval)
     {
-    case GDK_Up:
+    case GDK_KEY_Up:
       dy = -1;
       break;
-    case GDK_Left:
+    case GDK_KEY_Left:
       dx = -1;
       break;
-    case GDK_Right:
+    case GDK_KEY_Right:
       dx = 1;
       break;
-    case GDK_Down:
+    case GDK_KEY_Down:
       dy = 1;
       break;
 
-    case GDK_Return:
-    case GDK_KP_Enter:
-    case GDK_ISO_Enter:
+    case GDK_KEY_Return:
+    case GDK_KEY_KP_Enter:
+    case GDK_KEY_ISO_Enter:
       if (gimp_rectangle_tool_execute (rect_tool))
         gimp_rectangle_tool_halt (rect_tool);
       return TRUE;
 
-    case GDK_Escape:
+    case GDK_KEY_Escape:
       gimp_rectangle_tool_cancel (rect_tool);
       gimp_rectangle_tool_halt (rect_tool);
       return TRUE;
diff --git a/app/tools/gimprotatetool.c b/app/tools/gimprotatetool.c
index dca28d2..f320541 100644
--- a/app/tools/gimprotatetool.c
+++ b/app/tools/gimprotatetool.c
@@ -139,19 +139,19 @@ gimp_rotate_tool_key_press (GimpTool    *tool,
 
       switch (kevent->keyval)
         {
-        case GDK_Up:
+        case GDK_KEY_Up:
           gtk_spin_button_spin (angle_spin, GTK_SPIN_STEP_FORWARD, 0.0);
           return TRUE;
 
-        case GDK_Down:
+        case GDK_KEY_Down:
           gtk_spin_button_spin (angle_spin, GTK_SPIN_STEP_BACKWARD, 0.0);
           return TRUE;
 
-        case GDK_Left:
+        case GDK_KEY_Left:
           gtk_spin_button_spin (angle_spin, GTK_SPIN_PAGE_FORWARD, 0.0);
           return TRUE;
 
-        case GDK_Right:
+        case GDK_KEY_Right:
           gtk_spin_button_spin (angle_spin, GTK_SPIN_PAGE_BACKWARD, 0.0);
           return TRUE;
 
diff --git a/app/tools/gimpselectiontool.c b/app/tools/gimpselectiontool.c
index 550bce4..e9b4696 100644
--- a/app/tools/gimpselectiontool.c
+++ b/app/tools/gimpselectiontool.c
@@ -19,7 +19,6 @@
 
 #include <gegl.h>
 #include <gtk/gtk.h>
-#include <gdk/gdkkeysyms.h>
 
 #include "libgimpwidgets/gimpwidgets.h"
 
diff --git a/app/tools/gimptexttool-editor.c b/app/tools/gimptexttool-editor.c
index 4707cbc..8d8b039 100644
--- a/app/tools/gimptexttool-editor.c
+++ b/app/tools/gimptexttool-editor.c
@@ -446,21 +446,21 @@ gimp_text_tool_editor_key_press (GimpTextTool *text_tool,
 
   switch (kevent->keyval)
     {
-    case GDK_Return:
-    case GDK_KP_Enter:
-    case GDK_ISO_Enter:
+    case GDK_KEY_Return:
+    case GDK_KEY_KP_Enter:
+    case GDK_KEY_ISO_Enter:
       gimp_text_tool_reset_im_context (text_tool);
       gimp_text_tool_enter_text (text_tool, "\n");
       break;
 
-    case GDK_Tab:
-    case GDK_KP_Tab:
-    case GDK_ISO_Left_Tab:
+    case GDK_KEY_Tab:
+    case GDK_KEY_KP_Tab:
+    case GDK_KEY_ISO_Left_Tab:
       gimp_text_tool_reset_im_context (text_tool);
       gimp_text_tool_enter_text (text_tool, "\t");
       break;
 
-    case GDK_Escape:
+    case GDK_KEY_Escape:
       gimp_rectangle_tool_cancel (GIMP_RECTANGLE_TOOL (text_tool));
       gimp_tool_control (GIMP_TOOL (text_tool), GIMP_TOOL_ACTION_HALT,
                          GIMP_TOOL (text_tool)->display);
diff --git a/app/tools/gimptransformtool.c b/app/tools/gimptransformtool.c
index ac7c180..325ee09 100644
--- a/app/tools/gimptransformtool.c
+++ b/app/tools/gimptransformtool.c
@@ -431,17 +431,17 @@ gimp_transform_tool_key_press (GimpTool    *tool,
     {
       switch (kevent->keyval)
         {
-        case GDK_Return:
-        case GDK_KP_Enter:
-        case GDK_ISO_Enter:
+        case GDK_KEY_Return:
+        case GDK_KEY_KP_Enter:
+        case GDK_KEY_ISO_Enter:
           gimp_transform_tool_response (NULL, GTK_RESPONSE_OK, trans_tool);
           return TRUE;
 
-        case GDK_BackSpace:
+        case GDK_KEY_BackSpace:
           gimp_transform_tool_response (NULL, RESPONSE_RESET, trans_tool);
           return TRUE;
 
-        case GDK_Escape:
+        case GDK_KEY_Escape:
           gimp_transform_tool_response (NULL, GTK_RESPONSE_CANCEL, trans_tool);
           return TRUE;
         }
diff --git a/app/tools/gimpvectortool.c b/app/tools/gimpvectortool.c
index 55de3b0..021dc4c 100644
--- a/app/tools/gimpvectortool.c
+++ b/app/tools/gimpvectortool.c
@@ -818,21 +818,21 @@ gimp_vector_tool_key_press (GimpTool     *tool,
 
   switch (kevent->keyval)
     {
-    case GDK_Return:
-    case GDK_KP_Enter:
-    case GDK_ISO_Enter:
+    case GDK_KEY_Return:
+    case GDK_KEY_KP_Enter:
+    case GDK_KEY_ISO_Enter:
       gimp_vector_tool_to_selection_extended (vector_tool, kevent->state);
       break;
 
-    case GDK_BackSpace:
-    case GDK_Delete:
+    case GDK_KEY_BackSpace:
+    case GDK_KEY_Delete:
       gimp_vector_tool_delete_selected_anchors (vector_tool);
       break;
 
-    case GDK_Left:
-    case GDK_Right:
-    case GDK_Up:
-    case GDK_Down:
+    case GDK_KEY_Left:
+    case GDK_KEY_Right:
+    case GDK_KEY_Up:
+    case GDK_KEY_Down:
       xdist = FUNSCALEX (shell, pixels);
       ydist = FUNSCALEY (shell, pixels);
 
@@ -842,19 +842,19 @@ gimp_vector_tool_key_press (GimpTool     *tool,
 
       switch (kevent->keyval)
         {
-        case GDK_Left:
+        case GDK_KEY_Left:
           gimp_vector_tool_move_selected_anchors (vector_tool, -xdist, 0);
           break;
 
-        case GDK_Right:
+        case GDK_KEY_Right:
           gimp_vector_tool_move_selected_anchors (vector_tool, xdist, 0);
           break;
 
-        case GDK_Up:
+        case GDK_KEY_Up:
           gimp_vector_tool_move_selected_anchors (vector_tool, 0, -ydist);
           break;
 
-        case GDK_Down:
+        case GDK_KEY_Down:
           gimp_vector_tool_move_selected_anchors (vector_tool, 0, ydist);
           break;
 
@@ -866,7 +866,7 @@ gimp_vector_tool_key_press (GimpTool     *tool,
       vector_tool->have_undo = FALSE;
       break;
 
-    case GDK_Escape:
+    case GDK_KEY_Escape:
       if (options->edit_mode != GIMP_VECTOR_MODE_DESIGN)
         g_object_set (options, "vectors-edit-mode",
                       GIMP_VECTOR_MODE_DESIGN, NULL);
diff --git a/app/widgets/gimpcoloreditor.c b/app/widgets/gimpcoloreditor.c
index dd85c8a..e3cc0d3 100644
--- a/app/widgets/gimpcoloreditor.c
+++ b/app/widgets/gimpcoloreditor.c
@@ -22,7 +22,6 @@
 
 #include <string.h>
 
-#include <gdk/gdkkeysyms.h>
 #include <gtk/gtk.h>
 
 #include "libgimpcolor/gimpcolor.h"
diff --git a/app/widgets/gimpcontainergridview.c b/app/widgets/gimpcontainergridview.c
index 428b464..8100ccc 100644
--- a/app/widgets/gimpcontainergridview.c
+++ b/app/widgets/gimpcontainergridview.c
@@ -139,19 +139,19 @@ gimp_container_grid_view_class_init (GimpContainerGridViewClass *klass)
                   GTK_TYPE_MOVEMENT_STEP,
                   G_TYPE_INT);
 
-  gtk_binding_entry_add_signal (binding_set, GDK_Home, 0,
+  gtk_binding_entry_add_signal (binding_set, GDK_KEY_Home, 0,
                                 "move-cursor", 2,
                                 G_TYPE_ENUM, GTK_MOVEMENT_BUFFER_ENDS,
                                 G_TYPE_INT, -1);
-  gtk_binding_entry_add_signal (binding_set, GDK_End, 0,
+  gtk_binding_entry_add_signal (binding_set, GDK_KEY_End, 0,
                                 "move-cursor", 2,
                                 G_TYPE_ENUM, GTK_MOVEMENT_BUFFER_ENDS,
                                 G_TYPE_INT, 1);
-  gtk_binding_entry_add_signal (binding_set, GDK_Page_Up, 0,
+  gtk_binding_entry_add_signal (binding_set, GDK_KEY_Page_Up, 0,
                                 "move-cursor", 2,
                                 G_TYPE_ENUM, GTK_MOVEMENT_PAGES,
                                 G_TYPE_INT, -1);
-  gtk_binding_entry_add_signal (binding_set, GDK_Page_Down, 0,
+  gtk_binding_entry_add_signal (binding_set, GDK_KEY_Page_Down, 0,
                                 "move-cursor", 2,
                                 G_TYPE_ENUM, GTK_MOVEMENT_PAGES,
                                 G_TYPE_INT, 1);
diff --git a/app/widgets/gimpcontainerpopup.c b/app/widgets/gimpcontainerpopup.c
index 9db8fdf..3791173 100644
--- a/app/widgets/gimpcontainerpopup.c
+++ b/app/widgets/gimpcontainerpopup.c
@@ -116,17 +116,17 @@ gimp_container_popup_class_init (GimpContainerPopupClass *klass)
 
   binding_set = gtk_binding_set_by_class (klass);
 
-  gtk_binding_entry_add_signal (binding_set, GDK_Escape, 0,
+  gtk_binding_entry_add_signal (binding_set, GDK_KEY_Escape, 0,
                                 "cancel", 0);
-  gtk_binding_entry_add_signal (binding_set, GDK_Return, 0,
+  gtk_binding_entry_add_signal (binding_set, GDK_KEY_Return, 0,
                                 "confirm", 0);
-  gtk_binding_entry_add_signal (binding_set, GDK_KP_Enter, 0,
+  gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Enter, 0,
                                 "confirm", 0);
-  gtk_binding_entry_add_signal (binding_set, GDK_ISO_Enter, 0,
+  gtk_binding_entry_add_signal (binding_set, GDK_KEY_ISO_Enter, 0,
                                 "confirm", 0);
-  gtk_binding_entry_add_signal (binding_set, GDK_space, 0,
+  gtk_binding_entry_add_signal (binding_set, GDK_KEY_space, 0,
                                 "confirm", 0);
-  gtk_binding_entry_add_signal (binding_set, GDK_KP_Space, 0,
+  gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Space, 0,
                                 "confirm", 0);
 }
 
diff --git a/app/widgets/gimpcontainertreeview.c b/app/widgets/gimpcontainertreeview.c
index 4673818..e9ac6df 100644
--- a/app/widgets/gimpcontainertreeview.c
+++ b/app/widgets/gimpcontainertreeview.c
@@ -161,7 +161,7 @@ gimp_container_tree_view_class_init (GimpContainerTreeViewClass *klass)
 
   binding_set = gtk_binding_set_by_class (klass);
 
-  gtk_binding_entry_add_signal (binding_set, GDK_F2, 0,
+  gtk_binding_entry_add_signal (binding_set, GDK_KEY_F2, 0,
                                 "edit-name", 0);
 
   g_type_class_add_private (klass, sizeof (GimpContainerTreeViewPriv));
diff --git a/app/widgets/gimpcontrollerkeyboard.c b/app/widgets/gimpcontrollerkeyboard.c
index 450cbdd..596092d 100644
--- a/app/widgets/gimpcontrollerkeyboard.c
+++ b/app/widgets/gimpcontrollerkeyboard.c
@@ -62,103 +62,103 @@ G_DEFINE_TYPE (GimpControllerKeyboard, gimp_controller_keyboard,
 
 static KeyboardEvent keyboard_events[] =
 {
-  { GDK_Up, GDK_MOD1_MASK | GDK_CONTROL_MASK | GDK_SHIFT_MASK,
+  { GDK_KEY_Up, GDK_MOD1_MASK | GDK_CONTROL_MASK | GDK_SHIFT_MASK,
     "cursor-up-shift-control-alt",
     N_("Cursor Up") },
-  { GDK_Up, GDK_MOD1_MASK | GDK_CONTROL_MASK,
+  { GDK_KEY_Up, GDK_MOD1_MASK | GDK_CONTROL_MASK,
     "cursor-up-control-alt",
     N_("Cursor Up") },
-  { GDK_Up, GDK_MOD1_MASK | GDK_SHIFT_MASK,
+  { GDK_KEY_Up, GDK_MOD1_MASK | GDK_SHIFT_MASK,
     "cursor-up-shift-alt",
     N_("Cursor Up") },
-  { GDK_Up, GDK_CONTROL_MASK | GDK_SHIFT_MASK,
+  { GDK_KEY_Up, GDK_CONTROL_MASK | GDK_SHIFT_MASK,
     "cursor-up-shift-control",
     N_("Cursor Up") },
-  { GDK_Up, GDK_MOD1_MASK,
+  { GDK_KEY_Up, GDK_MOD1_MASK,
     "cursor-up-alt",
     N_("Cursor Up") },
-  { GDK_Up, GDK_CONTROL_MASK,
+  { GDK_KEY_Up, GDK_CONTROL_MASK,
     "cursor-up-control",
     N_("Cursor Up") },
-  { GDK_Up, GDK_SHIFT_MASK,
+  { GDK_KEY_Up, GDK_SHIFT_MASK,
     "cursor-up-shift",
     N_("Cursor Up") },
-  { GDK_Up, 0,
+  { GDK_KEY_Up, 0,
     "cursor-up",
     N_("Cursor Up") },
 
-  { GDK_Down, GDK_MOD1_MASK | GDK_CONTROL_MASK | GDK_SHIFT_MASK,
+  { GDK_KEY_Down, GDK_MOD1_MASK | GDK_CONTROL_MASK | GDK_SHIFT_MASK,
     "cursor-down-shift-control-alt",
     N_("Cursor Down") },
-  { GDK_Down, GDK_MOD1_MASK | GDK_CONTROL_MASK,
+  { GDK_KEY_Down, GDK_MOD1_MASK | GDK_CONTROL_MASK,
     "cursor-down-control-alt",
     N_("Cursor Down") },
-  { GDK_Down, GDK_MOD1_MASK | GDK_SHIFT_MASK,
+  { GDK_KEY_Down, GDK_MOD1_MASK | GDK_SHIFT_MASK,
     "cursor-down-shift-alt",
     N_("Cursor Down") },
-  { GDK_Down, GDK_CONTROL_MASK | GDK_SHIFT_MASK,
+  { GDK_KEY_Down, GDK_CONTROL_MASK | GDK_SHIFT_MASK,
     "cursor-down-shift-control",
     N_("Cursor Down") },
-  { GDK_Down, GDK_MOD1_MASK,
+  { GDK_KEY_Down, GDK_MOD1_MASK,
     "cursor-down-alt",
     N_("Cursor Down") },
-  { GDK_Down, GDK_CONTROL_MASK,
+  { GDK_KEY_Down, GDK_CONTROL_MASK,
     "cursor-down-control",
     N_("Cursor Down") },
-  { GDK_Down, GDK_SHIFT_MASK,
+  { GDK_KEY_Down, GDK_SHIFT_MASK,
     "cursor-down-shift",
     N_("Cursor Down") },
-  { GDK_Down, 0,
+  { GDK_KEY_Down, 0,
     "cursor-down",
     N_("Cursor Down") },
 
-  { GDK_Left, GDK_MOD1_MASK | GDK_CONTROL_MASK | GDK_SHIFT_MASK,
+  { GDK_KEY_Left, GDK_MOD1_MASK | GDK_CONTROL_MASK | GDK_SHIFT_MASK,
     "cursor-left-shift-control-alt",
     N_("Cursor Left") },
-  { GDK_Left, GDK_MOD1_MASK | GDK_CONTROL_MASK,
+  { GDK_KEY_Left, GDK_MOD1_MASK | GDK_CONTROL_MASK,
     "cursor-left-control-alt",
     N_("Cursor Left") },
-  { GDK_Left, GDK_MOD1_MASK | GDK_SHIFT_MASK,
+  { GDK_KEY_Left, GDK_MOD1_MASK | GDK_SHIFT_MASK,
     "cursor-left-shift-alt",
     N_("Cursor Left") },
-  { GDK_Left, GDK_CONTROL_MASK | GDK_SHIFT_MASK,
+  { GDK_KEY_Left, GDK_CONTROL_MASK | GDK_SHIFT_MASK,
     "cursor-left-shift-control",
     N_("Cursor Left") },
-  { GDK_Left, GDK_MOD1_MASK,
+  { GDK_KEY_Left, GDK_MOD1_MASK,
     "cursor-left-alt",
     N_("Cursor Left") },
-  { GDK_Left, GDK_CONTROL_MASK,
+  { GDK_KEY_Left, GDK_CONTROL_MASK,
     "cursor-left-control",
     N_("Cursor Left") },
-  { GDK_Left, GDK_SHIFT_MASK,
+  { GDK_KEY_Left, GDK_SHIFT_MASK,
     "cursor-left-shift",
     N_("Cursor Left") },
-  { GDK_Left, 0,
+  { GDK_KEY_Left, 0,
     "cursor-left",
     N_("Cursor Left") },
 
-  { GDK_Right, GDK_MOD1_MASK | GDK_CONTROL_MASK | GDK_SHIFT_MASK,
+  { GDK_KEY_Right, GDK_MOD1_MASK | GDK_CONTROL_MASK | GDK_SHIFT_MASK,
     "cursor-right-shift-control-alt",
     N_("Cursor Right") },
-  { GDK_Right, GDK_MOD1_MASK | GDK_CONTROL_MASK,
+  { GDK_KEY_Right, GDK_MOD1_MASK | GDK_CONTROL_MASK,
     "cursor-right-control-alt",
     N_("Cursor Right") },
-  { GDK_Right, GDK_MOD1_MASK | GDK_SHIFT_MASK,
+  { GDK_KEY_Right, GDK_MOD1_MASK | GDK_SHIFT_MASK,
     "cursor-right-shift-alt",
     N_("Cursor Right") },
-  { GDK_Right, GDK_CONTROL_MASK | GDK_SHIFT_MASK,
+  { GDK_KEY_Right, GDK_CONTROL_MASK | GDK_SHIFT_MASK,
     "cursor-right-shift-control",
     N_("Cursor Right") },
-  { GDK_Right, GDK_MOD1_MASK,
+  { GDK_KEY_Right, GDK_MOD1_MASK,
     "cursor-right-alt",
     N_("Cursor Right") },
-  { GDK_Right, GDK_CONTROL_MASK,
+  { GDK_KEY_Right, GDK_CONTROL_MASK,
     "cursor-right-control",
     N_("Cursor Right") },
-  { GDK_Right, GDK_SHIFT_MASK,
+  { GDK_KEY_Right, GDK_SHIFT_MASK,
     "cursor-right-shift",
     N_("Cursor Right") },
-  { GDK_Right, 0,
+  { GDK_KEY_Right, 0,
     "cursor-right",
     N_("Cursor Right") }
 };
diff --git a/app/widgets/gimpcurveview.c b/app/widgets/gimpcurveview.c
index 3f5d4ff..ab50c05 100644
--- a/app/widgets/gimpcurveview.c
+++ b/app/widgets/gimpcurveview.c
@@ -184,11 +184,11 @@ gimp_curve_view_class_init (GimpCurveViewClass *klass)
 
   binding_set = gtk_binding_set_by_class (klass);
 
-  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);
 }
 
diff --git a/app/widgets/gimpdataeditor.c b/app/widgets/gimpdataeditor.c
index 381cc8e..598be43 100644
--- a/app/widgets/gimpdataeditor.c
+++ b/app/widgets/gimpdataeditor.c
@@ -558,7 +558,7 @@ gimp_data_editor_name_key_press (GtkWidget      *widget,
                                  GdkEventKey    *kevent,
                                  GimpDataEditor *editor)
 {
-  if (kevent->keyval == GDK_Escape)
+  if (kevent->keyval == GDK_KEY_Escape)
     {
       gtk_entry_set_text (GTK_ENTRY (editor->name_entry),
                           gimp_object_get_name (editor->data));
diff --git a/app/widgets/gimpnavigationview.c b/app/widgets/gimpnavigationview.c
index dbd85ad..298898b 100644
--- a/app/widgets/gimpnavigationview.c
+++ b/app/widgets/gimpnavigationview.c
@@ -404,19 +404,19 @@ gimp_navigation_view_key_press (GtkWidget   *widget,
 
   switch (kevent->keyval)
     {
-    case GDK_Up:
+    case GDK_KEY_Up:
       scroll_y = -1;
       break;
 
-    case GDK_Left:
+    case GDK_KEY_Left:
       scroll_x = -1;
       break;
 
-    case GDK_Right:
+    case GDK_KEY_Right:
       scroll_x = 1;
       break;
 
-    case GDK_Down:
+    case GDK_KEY_Down:
       scroll_y = 1;
       break;
 
diff --git a/app/widgets/gimpoverlaydialog.c b/app/widgets/gimpoverlaydialog.c
index ba72f66..1ef9e07 100644
--- a/app/widgets/gimpoverlaydialog.c
+++ b/app/widgets/gimpoverlaydialog.c
@@ -111,7 +111,7 @@ gimp_overlay_dialog_class_init (GimpOverlayDialogClass *klass)
                   G_TYPE_NONE, 0);
 
   gtk_binding_entry_add_signal (gtk_binding_set_by_class (klass),
-                                GDK_Escape, 0, "close", 0);
+                                GDK_KEY_Escape, 0, "close", 0);
 }
 
 static void
diff --git a/app/widgets/gimppaletteview.c b/app/widgets/gimppaletteview.c
index 6e6d856..aee96c2 100644
--- a/app/widgets/gimppaletteview.c
+++ b/app/widgets/gimppaletteview.c
@@ -271,11 +271,11 @@ gimp_palette_view_key_press (GtkWidget   *widget,
   GimpPaletteView *view = GIMP_PALETTE_VIEW (widget);
 
   if (view->selected &&
-      (kevent->keyval == GDK_space    ||
-       kevent->keyval == GDK_KP_Space ||
-       kevent->keyval == GDK_Return   ||
-       kevent->keyval == GDK_KP_Enter ||
-       kevent->keyval == GDK_ISO_Enter))
+      (kevent->keyval == GDK_KEY_space    ||
+       kevent->keyval == GDK_KEY_KP_Space ||
+       kevent->keyval == GDK_KEY_Return   ||
+       kevent->keyval == GDK_KEY_KP_Enter ||
+       kevent->keyval == GDK_KEY_ISO_Enter))
     {
       g_signal_emit (view, view_signals[ENTRY_CLICKED], 0,
                      view->selected, kevent->state);
diff --git a/app/widgets/gimptagentry.c b/app/widgets/gimptagentry.c
index 712907c..598be73 100644
--- a/app/widgets/gimptagentry.c
+++ b/app/widgets/gimptagentry.c
@@ -1341,9 +1341,9 @@ gimp_tag_entry_key_press (GtkWidget   *widget,
 
   switch (event->keyval)
     {
-    case GDK_Tab:
-    case GDK_KP_Tab:
-    case GDK_ISO_Left_Tab:
+    case GDK_KEY_Tab:
+    case GDK_KEY_KP_Tab:
+    case GDK_KEY_ISO_Left_Tab:
       /*  allow to leave the widget with Ctrl+Tab  */
       if (! (event->state & GDK_CONTROL_MASK))
         {
@@ -1360,21 +1360,21 @@ gimp_tag_entry_key_press (GtkWidget   *widget,
         }
       return TRUE;
 
-    case GDK_Return:
+    case GDK_KEY_Return:
       gimp_tag_entry_commit_tags (entry);
       break;
 
-    case GDK_Left:
+    case GDK_KEY_Left:
       gimp_tag_entry_previous_tag (entry,
                                    (event->state & GDK_SHIFT_MASK) ? TRUE : FALSE);
       return TRUE;
 
-    case GDK_Right:
+    case GDK_KEY_Right:
       gimp_tag_entry_next_tag (entry,
                                (event->state & GDK_SHIFT_MASK) ? TRUE : FALSE);
       return TRUE;
 
-    case GDK_BackSpace:
+    case GDK_KEY_BackSpace:
       {
         gint selection_start;
         gint selection_end;
@@ -1397,7 +1397,7 @@ gimp_tag_entry_key_press (GtkWidget   *widget,
       }
       break;
 
-    case GDK_Delete:
+    case GDK_KEY_Delete:
       {
         gint selection_start;
         gint selection_end;
@@ -1420,8 +1420,8 @@ gimp_tag_entry_key_press (GtkWidget   *widget,
       }
       break;
 
-    case GDK_Up:
-    case GDK_Down:
+    case GDK_KEY_Up:
+    case GDK_KEY_Down:
       if (entry->recent_list != NULL)
         {
           gchar *recent_item;
@@ -1431,7 +1431,7 @@ gimp_tag_entry_key_press (GtkWidget   *widget,
           gimp_tag_entry_add_to_recent (entry, very_recent_item, TRUE);
           g_free (very_recent_item);
 
-          if (event->keyval == GDK_Up)
+          if (event->keyval == GDK_KEY_Up)
             {
               recent_item = (gchar *) g_list_first (entry->recent_list)->data;
               entry->recent_list = g_list_remove (entry->recent_list, recent_item);
diff --git a/app/widgets/gimptextproxy.c b/app/widgets/gimptextproxy.c
index 6f0f2b7..d46d52e 100644
--- a/app/widgets/gimptextproxy.c
+++ b/app/widgets/gimptextproxy.c
@@ -105,24 +105,24 @@ gimp_text_proxy_class_init (GimpTextProxyClass *klass)
 
   binding_set = gtk_binding_set_by_class (klass);
 
-  gtk_binding_entry_add_signal (binding_set, GDK_plus, GDK_MOD1_MASK,
+  gtk_binding_entry_add_signal (binding_set, GDK_KEY_plus, GDK_MOD1_MASK,
 				"change-size", 1,
                                 G_TYPE_DOUBLE, 1.0);
-  gtk_binding_entry_add_signal (binding_set, GDK_minus, GDK_MOD1_MASK,
+  gtk_binding_entry_add_signal (binding_set, GDK_KEY_minus, GDK_MOD1_MASK,
 				"change-size", 1,
                                 G_TYPE_DOUBLE, -1.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,
 				"change-baseline", 1,
                                 G_TYPE_DOUBLE, 1.0);
-  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,
 				"change-baseline", 1,
                                 G_TYPE_DOUBLE, -1.0);
 
-  gtk_binding_entry_add_signal (binding_set, GDK_Left, GDK_MOD1_MASK,
+  gtk_binding_entry_add_signal (binding_set, GDK_KEY_Left, GDK_MOD1_MASK,
 				"change-kerning", 1,
                                 G_TYPE_DOUBLE, -1.0);
-  gtk_binding_entry_add_signal (binding_set, GDK_Right, GDK_MOD1_MASK,
+  gtk_binding_entry_add_signal (binding_set, GDK_KEY_Right, GDK_MOD1_MASK,
 				"change-kerning", 1,
                                 G_TYPE_DOUBLE, 1.0);
 }
diff --git a/app/widgets/gimpuimanager.c b/app/widgets/gimpuimanager.c
index 55bb8de..4ca07b5 100644
--- a/app/widgets/gimpuimanager.c
+++ b/app/widgets/gimpuimanager.c
@@ -1005,7 +1005,7 @@ gimp_ui_manager_item_key_press (GtkWidget     *widget,
    *  standard GtkMenuShell callback and assign a new shortcut, but
    *  don't assign a shortcut to the help menu entries ...
    */
-  if (kevent->keyval != GDK_F1)
+  if (kevent->keyval != GDK_KEY_F1)
     {
       if (help_id                                   &&
           gtk_accelerator_valid (kevent->keyval, 0) &&
diff --git a/app/widgets/widgets-types.h b/app/widgets/widgets-types.h
index 9735533..001e99f 100644
--- a/app/widgets/widgets-types.h
+++ b/app/widgets/widgets-types.h
@@ -26,6 +26,41 @@
 #include "widgets/widgets-enums.h"
 
 
+#if ! GTK_CHECK_VERSION (2, 22, 0)
+#define GDK_KEY_Shift_L GDK_Shift_L
+#define GDK_KEY_Shift_R GDK_Shift_R
+#define GDK_KEY_Control_L GDK_Control_L
+#define GDK_KEY_Control_R GDK_Control_R
+#define GDK_KEY_Alt_L GDK_Alt_L
+#define GDK_KEY_Alt_R GDK_Alt_R
+#define GDK_KEY_Left GDK_Left
+#define GDK_KEY_Right GDK_Right
+#define GDK_KEY_Up GDK_Up
+#define GDK_KEY_Down GDK_Down
+#define GDK_KEY_Tab GDK_Tab
+#define GDK_KEY_KP_Tab GDK_KP_Tab
+#define GDK_KEY_ISO_Left_Tab GDK_ISO_Left_Tab
+#define GDK_KEY_space GDK_space
+#define GDK_KEY_KP_Space GDK_KP_Space
+#define GDK_KEY_Return GDK_Return
+#define GDK_KEY_KP_Enter GDK_KP_Enter
+#define GDK_KEY_ISO_Enter GDK_ISO_Enter
+#define GDK_KEY_BackSpace GDK_BackSpace
+#define GDK_KEY_Escape GDK_Escape
+#define GDK_KEY_Home GDK_Home
+#define GDK_KEY_End GDK_End
+#define GDK_KEY_Page_Up GDK_Page_Up
+#define GDK_KEY_Page_Down GDK_Page_Down
+#define GDK_KEY_F1 GDK_F1
+#define GDK_KEY_F2 GDK_F2
+#define GDK_KEY_x GDK_x
+#define GDK_KEY_c GDK_c
+#define GDK_KEY_v GDK_v
+#define GDK_KEY_plus GDK_plus
+#define GDK_KEY_minus GDK_minus
+#endif
+
+
 /*  input devices & controllers  */
 
 typedef struct _GimpDeviceManager            GimpDeviceManager;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]