Commit 7e6c0267 authored by Michael Natterer's avatar Michael Natterer 😴

Globally use GDK_KEY_foo, remove the compat defines from widgets-enums.h

parent 3440f8c7
......@@ -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;
......
......@@ -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 */
}
......
......@@ -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);
......
......@@ -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
......
......@@ -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);
......
......@@ -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);
......
......@@ -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;
}
......
......@@ -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
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment