[gimp] Globally use GDK_KEY_foo, remove the compat defines from widgets-enums.h
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] Globally use GDK_KEY_foo, remove the compat defines from widgets-enums.h
- Date: Mon, 11 Apr 2011 21:44:23 +0000 (UTC)
commit 7e6c0267906f558242d546e799503c2a0cfaeb44
Author: Michael Natterer <mitch gimp org>
Date: Mon Apr 11 23:43:03 2011 +0200
Globally use GDK_KEY_foo, remove the compat defines from widgets-enums.h
app/widgets/widgets-types.h | 37 --------------------------------
libgimpwidgets/gimpcolorhexentry.c | 6 ++--
libgimpwidgets/gimphelpui.c | 6 ++--
libgimpwidgets/gimpnumberpairentry.c | 6 ++--
libgimpwidgets/gimppickbutton.c | 2 +-
plug-ins/common/screenshot.c | 4 +-
plug-ins/help-browser/dialog.c | 10 ++++----
plug-ins/imagemap/imap_main.c | 18 +++++++-------
plug-ins/script-fu/script-fu-console.c | 22 +++++++++---------
9 files changed, 37 insertions(+), 74 deletions(-)
---
diff --git a/app/widgets/widgets-types.h b/app/widgets/widgets-types.h
index b7e5310..7597f34 100644
--- a/app/widgets/widgets-types.h
+++ b/app/widgets/widgets-types.h
@@ -26,43 +26,6 @@
#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
-#define GDK_KEY_Delete GDK_Delete
-#define GDK_KEY_plus GDK_plus
-#endif
-
-
/* input devices & controllers */
typedef struct _GimpDeviceManager GimpDeviceManager;
diff --git a/libgimpwidgets/gimpcolorhexentry.c b/libgimpwidgets/gimpcolorhexentry.c
index 746dfcc..e5885d7 100644
--- a/libgimpwidgets/gimpcolorhexentry.c
+++ b/libgimpwidgets/gimpcolorhexentry.c
@@ -231,9 +231,9 @@ gimp_color_hex_entry_events (GtkWidget *widget,
{
GdkEventKey *kevent = (GdkEventKey *) event;
- if (kevent->keyval != GDK_Return &&
- kevent->keyval != GDK_KP_Enter &&
- kevent->keyval != GDK_ISO_Enter)
+ if (kevent->keyval != GDK_KEY_Return &&
+ kevent->keyval != GDK_KEY_KP_Enter &&
+ kevent->keyval != GDK_KEY_ISO_Enter)
break;
/* else fall through */
}
diff --git a/libgimpwidgets/gimphelpui.c b/libgimpwidgets/gimphelpui.c
index 999648f..4e6217e 100644
--- a/libgimpwidgets/gimphelpui.c
+++ b/libgimpwidgets/gimphelpui.c
@@ -178,11 +178,11 @@ gimp_help_connect (GtkWidget *widget,
binding_set =
gtk_binding_set_by_class (g_type_class_peek (GTK_TYPE_WIDGET));
- gtk_binding_entry_add_signal (binding_set, GDK_F1, 0,
+ gtk_binding_entry_add_signal (binding_set, GDK_KEY_F1, 0,
"show-help", 1,
GTK_TYPE_WIDGET_HELP_TYPE,
GIMP_WIDGET_HELP_TYPE_HELP);
- gtk_binding_entry_add_signal (binding_set, GDK_KP_F1, 0,
+ gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_F1, 0,
"show-help", 1,
GTK_TYPE_WIDGET_HELP_TYPE,
GIMP_WIDGET_HELP_TYPE_HELP);
@@ -532,7 +532,7 @@ gimp_context_help_key_press (GtkWidget *widget,
GdkEventKey *kevent,
gpointer data)
{
- if (kevent->keyval == GDK_Escape)
+ if (kevent->keyval == GDK_KEY_Escape)
{
GdkDisplay *display = gtk_widget_get_display (widget);
diff --git a/libgimpwidgets/gimpnumberpairentry.c b/libgimpwidgets/gimpnumberpairentry.c
index c47bba2..f085b96 100644
--- a/libgimpwidgets/gimpnumberpairentry.c
+++ b/libgimpwidgets/gimpnumberpairentry.c
@@ -834,9 +834,9 @@ gimp_number_pair_entry_events (GtkWidget *widget,
{
GdkEventKey *kevent = (GdkEventKey *) event;
- if (kevent->keyval != GDK_Return &&
- kevent->keyval != GDK_KP_Enter &&
- kevent->keyval != GDK_ISO_Enter)
+ if (kevent->keyval != GDK_KEY_Return &&
+ kevent->keyval != GDK_KEY_KP_Enter &&
+ kevent->keyval != GDK_KEY_ISO_Enter)
break;
/* If parsing was done due to widgets focus being lost, we only change
diff --git a/libgimpwidgets/gimppickbutton.c b/libgimpwidgets/gimppickbutton.c
index 4e6e3b3..81d5b3a 100644
--- a/libgimpwidgets/gimppickbutton.c
+++ b/libgimpwidgets/gimppickbutton.c
@@ -281,7 +281,7 @@ gimp_pick_button_key_press (GtkWidget *invisible,
GdkEventKey *event,
GimpPickButton *button)
{
- if (event->keyval == GDK_Escape)
+ if (event->keyval == GDK_KEY_Escape)
{
gimp_pick_button_shutdown (button);
diff --git a/plug-ins/common/screenshot.c b/plug-ins/common/screenshot.c
index 8528ad9..c25eb7d 100644
--- a/plug-ins/common/screenshot.c
+++ b/plug-ins/common/screenshot.c
@@ -445,7 +445,7 @@ select_window_x11 (GdkScreen *screen)
&gc_values);
}
- if (gdk_keymap_get_entries_for_keyval (NULL, GDK_Escape, &keys, &num_keys))
+ if (gdk_keymap_get_entries_for_keyval (NULL, GDK_KEY_Escape, &keys, &num_keys))
{
gdk_error_trap_push ();
@@ -554,7 +554,7 @@ select_window_x11 (GdkScreen *screen)
gint i;
for (i = 0; i < n && ! cancel; i++)
- if (keyvals[i] == GDK_Escape)
+ if (keyvals[i] == GDK_KEY_Escape)
cancel = TRUE;
g_free (keyvals);
diff --git a/plug-ins/help-browser/dialog.c b/plug-ins/help-browser/dialog.c
index fe98cdc..9cdeaea 100644
--- a/plug-ins/help-browser/dialog.c
+++ b/plug-ins/help-browser/dialog.c
@@ -1087,7 +1087,7 @@ static gboolean
view_key_press (GtkWidget *widget,
GdkEventKey *event)
{
- if (event->keyval == GDK_slash)
+ if (event->keyval == GDK_KEY_slash)
{
GtkAction *action;
@@ -1222,14 +1222,14 @@ search_entry_key_press (GtkWidget *entry,
{
switch (event->keyval)
{
- case GDK_Escape:
+ case GDK_KEY_Escape:
gtk_widget_hide (searchbar);
webkit_web_view_unmark_text_matches (WEBKIT_WEB_VIEW (view));
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:
search (gtk_entry_get_text (GTK_ENTRY (entry)), TRUE);
return TRUE;
}
diff --git a/plug-ins/imagemap/imap_main.c b/plug-ins/imagemap/imap_main.c
index dd30702..b6dbc7d 100644
--- a/plug-ins/imagemap/imap_main.c
+++ b/plug-ins/imagemap/imap_main.c
@@ -1015,10 +1015,10 @@ static gboolean
key_timeout_cb(gpointer data)
{
switch (_keyval) {
- 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:
command_list_add(move_selected_command_new(_shapes, _dx, _dy));
_dx = _dy = 0;
break;
@@ -1040,35 +1040,35 @@ key_press_cb(GtkWidget *widget, GdkEventKey *event)
_timeout = 0;
switch (event->keyval) {
- case GDK_Left:
+ case GDK_KEY_Left:
if (ctrl)
move_sash_selected_objects(-1, 0, shift);
else
move_selected_objects(-1, 0, shift);
handled = TRUE;
break;
- case GDK_Right:
+ case GDK_KEY_Right:
if (ctrl)
move_sash_selected_objects(1, 0, shift);
else
move_selected_objects(1, 0, shift);
handled = TRUE;
break;
- case GDK_Up:
+ case GDK_KEY_Up:
if (ctrl)
move_sash_selected_objects(0, -1, shift);
else
move_selected_objects(0, -1, shift);
handled = TRUE;
break;
- case GDK_Down:
+ case GDK_KEY_Down:
if (ctrl)
move_sash_selected_objects(0, 1, shift);
else
move_selected_objects(0, 1, shift);
handled = TRUE;
break;
- case GDK_Tab:
+ case GDK_KEY_Tab:
if (shift)
command = select_prev_command_new(_shapes);
else
diff --git a/plug-ins/script-fu/script-fu-console.c b/plug-ins/script-fu/script-fu-console.c
index da25bb5..37d5397 100644
--- a/plug-ins/script-fu/script-fu-console.c
+++ b/plug-ins/script-fu/script-fu-console.c
@@ -573,9 +573,9 @@ script_fu_cc_key_function (GtkWidget *widget,
switch (event->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 (script_fu_cc_is_empty (console))
return TRUE;
@@ -648,24 +648,24 @@ script_fu_cc_key_function (GtkWidget *widget,
return TRUE;
break;
- case GDK_KP_Up:
- case GDK_Up:
+ case GDK_KEY_KP_Up:
+ case GDK_KEY_Up:
direction = -1;
break;
- case GDK_KP_Down:
- case GDK_Down:
+ case GDK_KEY_KP_Down:
+ case GDK_KEY_Down:
direction = 1;
break;
- case GDK_P:
- case GDK_p:
+ case GDK_KEY_P:
+ case GDK_KEY_p:
if (event->state & GDK_CONTROL_MASK)
direction = -1;
break;
- case GDK_N:
- case GDK_n:
+ case GDK_KEY_N:
+ case GDK_KEY_n:
if (event->state & GDK_CONTROL_MASK)
direction = 1;
break;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]