drop gdkkeysyms-compat usage, use modern key names

This commit is contained in:
Monsta 2015-08-03 18:04:03 +03:00
parent 121e7b4f8a
commit 79c3e28490
8 changed files with 57 additions and 77 deletions

View File

@ -24,9 +24,6 @@
#include <pluma/pluma-plugin.h> #include <pluma/pluma-plugin.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h> #include <gdk/gdkkeysyms.h>
#if GTK_CHECK_VERSION (3, 0, 0)
#include <gdk/gdkkeysyms-compat.h>
#endif
#include "pluma-file-browser-store.h" #include "pluma-file-browser-store.h"
#include "pluma-file-bookmarks-store.h" #include "pluma-file-bookmarks-store.h"
@ -637,7 +634,7 @@ key_press_event (GtkWidget *widget,
modifiers = gtk_accelerator_get_default_mod_mask (); modifiers = gtk_accelerator_get_default_mod_mask ();
switch (event->keyval) { switch (event->keyval) {
case GDK_space: case GDK_KEY_space:
if (event->state & GDK_CONTROL_MASK) { if (event->state & GDK_CONTROL_MASK) {
handled = FALSE; handled = FALSE;
break; break;
@ -651,13 +648,13 @@ key_press_event (GtkWidget *widget,
handled = TRUE; handled = TRUE;
break; break;
case GDK_Return: case GDK_KEY_Return:
case GDK_KP_Enter: case GDK_KEY_KP_Enter:
activate_selected_items (view); activate_selected_items (view);
handled = TRUE; handled = TRUE;
break; break;
case GDK_h: case GDK_KEY_h:
if ((event->state & modifiers) == GDK_CONTROL_MASK) { if ((event->state & modifiers) == GDK_CONTROL_MASK) {
toggle_hidden_filter (view); toggle_hidden_filter (view);
handled = TRUE; handled = TRUE;

View File

@ -30,9 +30,7 @@
#include <glib/gi18n-lib.h> #include <glib/gi18n-lib.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h> #include <gdk/gdkkeysyms.h>
#if GTK_CHECK_VERSION (3, 0, 0)
#include <gdk/gdkkeysyms-compat.h>
#endif
#include <pluma/pluma-utils.h> #include <pluma/pluma-utils.h>
#include <pluma/pluma-plugin.h> #include <pluma/pluma-plugin.h>
@ -2756,7 +2754,7 @@ do_change_directory (PlumaFileBrowserWidget * obj,
if ((event->state & if ((event->state &
(~GDK_CONTROL_MASK & ~GDK_SHIFT_MASK & ~GDK_MOD1_MASK)) == (~GDK_CONTROL_MASK & ~GDK_SHIFT_MASK & ~GDK_MOD1_MASK)) ==
event->state && event->keyval == GDK_BackSpace) event->state && event->keyval == GDK_KEY_BackSpace)
action = gtk_action_group_get_action (obj->priv-> action = gtk_action_group_get_action (obj->priv->
action_group_sensitive, action_group_sensitive,
"DirectoryPrevious"); "DirectoryPrevious");
@ -2765,17 +2763,17 @@ do_change_directory (PlumaFileBrowserWidget * obj,
return FALSE; return FALSE;
switch (event->keyval) { switch (event->keyval) {
case GDK_Left: case GDK_KEY_Left:
action = gtk_action_group_get_action (obj->priv-> action = gtk_action_group_get_action (obj->priv->
action_group_sensitive, action_group_sensitive,
"DirectoryPrevious"); "DirectoryPrevious");
break; break;
case GDK_Right: case GDK_KEY_Right:
action = gtk_action_group_get_action (obj->priv-> action = gtk_action_group_get_action (obj->priv->
action_group_sensitive, action_group_sensitive,
"DirectoryNext"); "DirectoryNext");
break; break;
case GDK_Up: case GDK_KEY_Up:
action = gtk_action_group_get_action (obj->priv-> action = gtk_action_group_get_action (obj->priv->
action_group, action_group,
"DirectoryUp"); "DirectoryUp");
@ -2808,8 +2806,8 @@ on_treeview_key_press_event (PlumaFileBrowserView * treeview,
modifiers = gtk_accelerator_get_default_mod_mask (); modifiers = gtk_accelerator_get_default_mod_mask ();
if (event->keyval == GDK_Delete if (event->keyval == GDK_KEY_Delete
|| event->keyval == GDK_KP_Delete) { || event->keyval == GDK_KEY_KP_Delete) {
if ((event->state & modifiers) == GDK_SHIFT_MASK) { if ((event->state & modifiers) == GDK_SHIFT_MASK) {
if (obj->priv->enable_delete) { if (obj->priv->enable_delete) {
@ -2822,7 +2820,7 @@ on_treeview_key_press_event (PlumaFileBrowserView * treeview,
} }
} }
if ((event->keyval == GDK_F2) if ((event->keyval == GDK_KEY_F2)
&& (event->state & modifiers) == 0) { && (event->state & modifiers) == 0) {
rename_selected_file (obj); rename_selected_file (obj);

View File

@ -43,9 +43,6 @@
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h> #include <gdk/gdkkeysyms.h>
#if GTK_CHECK_VERSION (3, 0, 0)
#include <gdk/gdkkeysyms-compat.h>
#endif
#include <glib/gi18n.h> #include <glib/gi18n.h>
#define PLUMA_TAGLIST_PLUGIN_PANEL_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), \ #define PLUMA_TAGLIST_PLUGIN_PANEL_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), \
@ -277,7 +274,7 @@ tag_list_key_press_event_cb (GtkTreeView *tag_list,
grab_focus = (event->state & GDK_CONTROL_MASK) != 0; grab_focus = (event->state & GDK_CONTROL_MASK) != 0;
if (event->keyval == GDK_Return) if (event->keyval == GDK_KEY_Return)
{ {
GtkTreeModel *model; GtkTreeModel *model;
GtkTreeSelection *selection; GtkTreeSelection *selection;

View File

@ -36,9 +36,6 @@
#include <glib/gi18n.h> #include <glib/gi18n.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h> #include <gdk/gdkkeysyms.h>
#if GTK_CHECK_VERSION (3, 0, 0)
#include <gdk/gdkkeysyms-compat.h>
#endif
#include "pluma-search-dialog.h" #include "pluma-search-dialog.h"
#include "pluma-history-entry.h" #include "pluma-history-entry.h"
@ -182,8 +179,8 @@ pluma_search_dialog_class_init (PlumaSearchDialogClass *klass)
/* Note: we cannot use the keyval/modifier associated with the /* Note: we cannot use the keyval/modifier associated with the
* GTK_STOCK_FIND_AND_REPLACE stock item since MATE HIG suggests Ctrl+h * GTK_STOCK_FIND_AND_REPLACE stock item since MATE HIG suggests Ctrl+h
* for Replace while gtk+ uses Ctrl+r */ * for Replace while gtk+ uses Ctrl+r */
gtk_binding_entry_add_signal (binding_set, GDK_h, GDK_CONTROL_MASK, "show_replace", 0); gtk_binding_entry_add_signal (binding_set, GDK_KEY_h, GDK_CONTROL_MASK, "show_replace", 0);
gtk_binding_entry_add_signal (binding_set, GDK_H, GDK_CONTROL_MASK, "show_replace", 0); gtk_binding_entry_add_signal (binding_set, GDK_KEY_H, GDK_CONTROL_MASK, "show_replace", 0);
} }
static void static void

View File

@ -39,7 +39,6 @@
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h> #include <gdk/gdkkeysyms.h>
#if GTK_CHECK_VERSION (3, 0, 0) #if GTK_CHECK_VERSION (3, 0, 0)
#include <gdk/gdkkeysyms-compat.h>
#define GTK_OBJECT G_OBJECT #define GTK_OBJECT G_OBJECT
#endif #endif
@ -765,7 +764,7 @@ _pluma_cmd_search_goto_line (GtkAction *action,
* the corrisponding binding. * the corrisponding binding.
*/ */
gtk_bindings_activate (GTK_OBJECT (active_view), gtk_bindings_activate (GTK_OBJECT (active_view),
GDK_i, GDK_KEY_i,
GDK_CONTROL_MASK); GDK_CONTROL_MASK);
} }
@ -789,6 +788,6 @@ _pluma_cmd_search_incremental_search (GtkAction *action,
* the corrisponding binding. * the corrisponding binding.
*/ */
gtk_bindings_activate (GTK_OBJECT (active_view), gtk_bindings_activate (GTK_OBJECT (active_view),
GDK_k, GDK_KEY_k,
GDK_CONTROL_MASK); GDK_CONTROL_MASK);
} }

View File

@ -34,9 +34,6 @@
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <gdk/gdk.h> #include <gdk/gdk.h>
#include <gdk/gdkkeysyms.h> #include <gdk/gdkkeysyms.h>
#if GTK_CHECK_VERSION (3, 0, 0)
#include <gdk/gdkkeysyms-compat.h>
#endif
#include "pluma-close-button.h" #include "pluma-close-button.h"
#include "pluma-window.h" #include "pluma-window.h"
@ -245,12 +242,12 @@ pluma_panel_class_init (PlumaPanelClass *klass)
binding_set = gtk_binding_set_by_class (klass); binding_set = gtk_binding_set_by_class (klass);
gtk_binding_entry_add_signal (binding_set, gtk_binding_entry_add_signal (binding_set,
GDK_Escape, GDK_KEY_Escape,
0, 0,
"close", "close",
0); 0);
gtk_binding_entry_add_signal (binding_set, gtk_binding_entry_add_signal (binding_set,
GDK_Return, GDK_KEY_Return,
GDK_CONTROL_MASK, GDK_CONTROL_MASK,
"focus_document", "focus_document",
0); 0);

View File

@ -36,10 +36,6 @@
#include <glib/gi18n.h> #include <glib/gi18n.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h> #include <gdk/gdkkeysyms.h>
#if GTK_CHECK_VERSION (3, 0, 0)
#include <gdk/gdkkeysyms-compat.h>
#endif
#include <cairo-pdf.h> #include <cairo-pdf.h>
#include "pluma-print-preview.h" #include "pluma-print-preview.h"
@ -819,49 +815,49 @@ preview_layout_key_press (GtkWidget *widget,
break; break;
case '+': case '+':
case '=': case '=':
case GDK_KP_Add: case GDK_KEY_KP_Add:
zoom_in (preview); zoom_in (preview);
break; break;
case '-': case '-':
case '_': case '_':
case GDK_KP_Subtract: case GDK_KEY_KP_Subtract:
zoom_out (preview); zoom_out (preview);
break; break;
case GDK_KP_Right: case GDK_KEY_KP_Right:
case GDK_Right: case GDK_KEY_Right:
if (event->state & GDK_SHIFT_MASK) if (event->state & GDK_SHIFT_MASK)
x = hupper - hpage; x = hupper - hpage;
else else
x = MIN (hupper - hpage, x + hstep); x = MIN (hupper - hpage, x + hstep);
domove = TRUE; domove = TRUE;
break; break;
case GDK_KP_Left: case GDK_KEY_KP_Left:
case GDK_Left: case GDK_KEY_Left:
if (event->state & GDK_SHIFT_MASK) if (event->state & GDK_SHIFT_MASK)
x = hlower; x = hlower;
else else
x = MAX (hlower, x - hstep); x = MAX (hlower, x - hstep);
domove = TRUE; domove = TRUE;
break; break;
case GDK_KP_Up: case GDK_KEY_KP_Up:
case GDK_Up: case GDK_KEY_Up:
if (event->state & GDK_SHIFT_MASK) if (event->state & GDK_SHIFT_MASK)
goto page_up; goto page_up;
y = MAX (vlower, y - vstep); y = MAX (vlower, y - vstep);
domove = TRUE; domove = TRUE;
break; break;
case GDK_KP_Down: case GDK_KEY_KP_Down:
case GDK_Down: case GDK_KEY_Down:
if (event->state & GDK_SHIFT_MASK) if (event->state & GDK_SHIFT_MASK)
goto page_down; goto page_down;
y = MIN (vupper - vpage, y + vstep); y = MIN (vupper - vpage, y + vstep);
domove = TRUE; domove = TRUE;
break; break;
case GDK_KP_Page_Up: case GDK_KEY_KP_Page_Up:
case GDK_Page_Up: case GDK_KEY_Page_Up:
case GDK_Delete: case GDK_KEY_Delete:
case GDK_KP_Delete: case GDK_KEY_KP_Delete:
case GDK_BackSpace: case GDK_KEY_BackSpace:
page_up: page_up:
if (y <= vlower) if (y <= vlower)
{ {
@ -877,8 +873,8 @@ preview_layout_key_press (GtkWidget *widget,
} }
domove = TRUE; domove = TRUE;
break; break;
case GDK_KP_Page_Down: case GDK_KEY_KP_Page_Down:
case GDK_Page_Down: case GDK_KEY_Page_Down:
case ' ': case ' ':
page_down: page_down:
if (y >= (vupper - vpage)) if (y >= (vupper - vpage))
@ -895,19 +891,19 @@ preview_layout_key_press (GtkWidget *widget,
} }
domove = TRUE; domove = TRUE;
break; break;
case GDK_KP_Home: case GDK_KEY_KP_Home:
case GDK_Home: case GDK_KEY_Home:
goto_page (preview, 0); goto_page (preview, 0);
y = 0; y = 0;
domove = TRUE; domove = TRUE;
break; break;
case GDK_KP_End: case GDK_KEY_KP_End:
case GDK_End: case GDK_KEY_End:
goto_page (preview, preview->priv->n_pages - 1); goto_page (preview, preview->priv->n_pages - 1);
y = 0; y = 0;
domove = TRUE; domove = TRUE;
break; break;
case GDK_Escape: case GDK_KEY_Escape:
gtk_widget_destroy (GTK_WIDGET (preview)); gtk_widget_destroy (GTK_WIDGET (preview));
break; break;
case 'c': case 'c':

View File

@ -40,7 +40,6 @@
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h> #include <gdk/gdkkeysyms.h>
#if GTK_CHECK_VERSION (3, 0, 0) #if GTK_CHECK_VERSION (3, 0, 0)
#include <gdk/gdkkeysyms-compat.h>
#include <gtksourceview/gtksourceview.h> #include <gtksourceview/gtksourceview.h>
#endif #endif
@ -279,22 +278,22 @@ pluma_view_class_init (PlumaViewClass *klass)
binding_set = gtk_binding_set_by_class (klass); binding_set = gtk_binding_set_by_class (klass);
gtk_binding_entry_add_signal (binding_set, gtk_binding_entry_add_signal (binding_set,
GDK_k, GDK_KEY_k,
GDK_CONTROL_MASK, GDK_CONTROL_MASK,
"start_interactive_search", 0); "start_interactive_search", 0);
gtk_binding_entry_add_signal (binding_set, gtk_binding_entry_add_signal (binding_set,
GDK_i, GDK_KEY_i,
GDK_CONTROL_MASK, GDK_CONTROL_MASK,
"start_interactive_goto_line", 0); "start_interactive_goto_line", 0);
gtk_binding_entry_add_signal (binding_set, gtk_binding_entry_add_signal (binding_set,
GDK_k, GDK_KEY_k,
GDK_CONTROL_MASK | GDK_SHIFT_MASK, GDK_CONTROL_MASK | GDK_SHIFT_MASK,
"reset_searched_text", 0); "reset_searched_text", 0);
gtk_binding_entry_add_signal (binding_set, gtk_binding_entry_add_signal (binding_set,
GDK_d, GDK_KEY_d,
GDK_CONTROL_MASK, GDK_CONTROL_MASK,
"delete_from_cursor", 2, "delete_from_cursor", 2,
G_TYPE_ENUM, GTK_DELETE_PARAGRAPHS, G_TYPE_ENUM, GTK_DELETE_PARAGRAPHS,
@ -1084,14 +1083,14 @@ search_window_key_press_event (GtkWidget *widget,
modifiers = gtk_accelerator_get_default_mod_mask (); modifiers = gtk_accelerator_get_default_mod_mask ();
/* Close window */ /* Close window */
if (event->keyval == GDK_Tab) if (event->keyval == GDK_KEY_Tab)
{ {
hide_search_window (view, FALSE); hide_search_window (view, FALSE);
retval = TRUE; retval = TRUE;
} }
/* Close window and cancel the search */ /* Close window and cancel the search */
if (event->keyval == GDK_Escape) if (event->keyval == GDK_KEY_Escape)
{ {
if (view->priv->search_mode == SEARCH) if (view->priv->search_mode == SEARCH)
{ {
@ -1115,28 +1114,28 @@ search_window_key_press_event (GtkWidget *widget,
/* SEARCH mode */ /* SEARCH mode */
/* select previous matching iter */ /* 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)
{ {
search_again (view, TRUE); search_again (view, TRUE);
retval = TRUE; retval = TRUE;
} }
if (((event->state & modifiers) == (GDK_CONTROL_MASK | GDK_SHIFT_MASK)) && if (((event->state & modifiers) == (GDK_CONTROL_MASK | GDK_SHIFT_MASK)) &&
(event->keyval == GDK_g || event->keyval == GDK_G)) (event->keyval == GDK_KEY_g || event->keyval == GDK_KEY_G))
{ {
search_again (view, TRUE); search_again (view, TRUE);
retval = TRUE; retval = TRUE;
} }
/* select next matching iter */ /* 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)
{ {
search_again (view, FALSE); search_again (view, FALSE);
retval = TRUE; retval = TRUE;
} }
if (((event->state & modifiers) == GDK_CONTROL_MASK) && if (((event->state & modifiers) == GDK_CONTROL_MASK) &&
(event->keyval == GDK_g || event->keyval == GDK_G)) (event->keyval == GDK_KEY_g || event->keyval == GDK_KEY_G))
{ {
search_again (view, FALSE); search_again (view, FALSE);
retval = TRUE; retval = TRUE;