summaryrefslogtreecommitdiff
path: root/gtk/gtkpaned.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-03-19 18:03:16 -0400
committerMatthias Clasen <mclasen@redhat.com>2020-03-19 18:03:16 -0400
commit31db61588543a1ba0935ac8ecb2ecac574c0a836 (patch)
treea2e2092e086a9c7d618e2c9ae1fc7b5a659e8a7a /gtk/gtkpaned.c
parent3ac4c76b18cc89a841ce09f0943539f16988fd21 (diff)
downloadgtk+-31db61588543a1ba0935ac8ecb2ecac574c0a836.tar.gz
Revert "Merge branch 'disable-window-test' into 'master'"
This reverts commit 3ac4c76b18cc89a841ce09f0943539f16988fd21, reversing changes made to 6ec96d2e989d029a303b8b20ec72b86f974c0e87.
Diffstat (limited to 'gtk/gtkpaned.c')
-rw-r--r--gtk/gtkpaned.c194
1 files changed, 97 insertions, 97 deletions
diff --git a/gtk/gtkpaned.c b/gtk/gtkpaned.c
index 96c937ca13..b396957906 100644
--- a/gtk/gtkpaned.c
+++ b/gtk/gtkpaned.c
@@ -26,6 +26,7 @@
#include "gtkpaned.h"
+#include "gtkbindings.h"
#include "gtkcontainerprivate.h"
#include "gtkcssnodeprivate.h"
#include "gtkcssstylepropertyprivate.h"
@@ -277,29 +278,24 @@ static guint signals[LAST_SIGNAL] = { 0 };
static GParamSpec *paned_props[LAST_PROP] = { NULL, };
static void
-add_tab_bindings (GtkWidgetClass *widget_class,
- GdkModifierType modifiers)
+add_tab_bindings (GtkBindingSet *binding_set,
+ GdkModifierType modifiers)
{
- gtk_widget_class_add_binding_signal (widget_class,
- GDK_KEY_Tab, modifiers,
- "toggle-handle-focus",
- NULL);
- gtk_widget_class_add_binding_signal (widget_class,
- GDK_KEY_KP_Tab, modifiers,
- "toggle-handle-focus",
- NULL);
+ gtk_binding_entry_add_signal (binding_set, GDK_KEY_Tab, modifiers,
+ "toggle-handle-focus", 0);
+ gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Tab, modifiers,
+ "toggle-handle-focus", 0);
}
static void
-add_move_binding (GtkWidgetClass *widget_class,
+add_move_binding (GtkBindingSet *binding_set,
guint keyval,
GdkModifierType mask,
GtkScrollType scroll)
{
- gtk_widget_class_add_binding_signal (widget_class,
- keyval, mask,
- "move-handle",
- "(i)", scroll);
+ gtk_binding_entry_add_signal (binding_set, keyval, mask,
+ "move-handle", 1,
+ GTK_TYPE_SCROLL_TYPE, scroll);
}
static void
@@ -341,9 +337,16 @@ gtk_paned_handle_contains (GtkGizmo *handle,
static void
gtk_paned_class_init (GtkPanedClass *class)
{
- GObjectClass *object_class = G_OBJECT_CLASS (class);
- GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
- GtkContainerClass *container_class = GTK_CONTAINER_CLASS (class);
+ GObjectClass *object_class;
+ GtkWidgetClass *widget_class;
+ GtkContainerClass *container_class;
+ GtkPanedClass *paned_class;
+ GtkBindingSet *binding_set;
+
+ object_class = (GObjectClass *) class;
+ widget_class = (GtkWidgetClass *) class;
+ container_class = (GtkContainerClass *) class;
+ paned_class = (GtkPanedClass *) class;
object_class->set_property = gtk_paned_set_property;
object_class->get_property = gtk_paned_get_property;
@@ -361,12 +364,12 @@ gtk_paned_class_init (GtkPanedClass *class)
container_class->child_type = gtk_paned_child_type;
container_class->set_focus_child = gtk_paned_set_focus_child;
- class->cycle_child_focus = gtk_paned_cycle_child_focus;
- class->toggle_handle_focus = gtk_paned_toggle_handle_focus;
- class->move_handle = gtk_paned_move_handle;
- class->cycle_handle_focus = gtk_paned_cycle_handle_focus;
- class->accept_position = gtk_paned_accept_position;
- class->cancel_position = gtk_paned_cancel_position;
+ paned_class->cycle_child_focus = gtk_paned_cycle_child_focus;
+ paned_class->toggle_handle_focus = gtk_paned_toggle_handle_focus;
+ paned_class->move_handle = gtk_paned_move_handle;
+ paned_class->cycle_handle_focus = gtk_paned_cycle_handle_focus;
+ paned_class->accept_position = gtk_paned_accept_position;
+ paned_class->cancel_position = gtk_paned_cancel_position;
paned_props[PROP_POSITION] =
@@ -604,87 +607,84 @@ gtk_paned_class_init (GtkPanedClass *class)
_gtk_marshal_BOOLEAN__VOID,
G_TYPE_BOOLEAN, 0);
+ binding_set = gtk_binding_set_by_class (class);
+
/* F6 and friends */
- gtk_widget_class_add_binding_signal (widget_class,
- GDK_KEY_F6, 0,
- "cycle-child-focus",
- "(b)", FALSE);
- gtk_widget_class_add_binding_signal (widget_class,
- GDK_KEY_F6, GDK_SHIFT_MASK,
- "cycle-child-focus",
- "(b)", TRUE);
+ gtk_binding_entry_add_signal (binding_set,
+ GDK_KEY_F6, 0,
+ "cycle-child-focus", 1,
+ G_TYPE_BOOLEAN, FALSE);
+ gtk_binding_entry_add_signal (binding_set,
+ GDK_KEY_F6, GDK_SHIFT_MASK,
+ "cycle-child-focus", 1,
+ G_TYPE_BOOLEAN, TRUE);
/* F8 and friends */
- gtk_widget_class_add_binding_signal (widget_class,
- GDK_KEY_F8, 0,
- "cycle-handle-focus",
- "(b)", FALSE);
- gtk_widget_class_add_binding_signal (widget_class,
- GDK_KEY_F8, GDK_SHIFT_MASK,
- "cycle-handle-focus",
- "(b)", TRUE);
+ gtk_binding_entry_add_signal (binding_set,
+ GDK_KEY_F8, 0,
+ "cycle-handle-focus", 1,
+ G_TYPE_BOOLEAN, FALSE);
+
+ gtk_binding_entry_add_signal (binding_set,
+ GDK_KEY_F8, GDK_SHIFT_MASK,
+ "cycle-handle-focus", 1,
+ G_TYPE_BOOLEAN, TRUE);
- add_tab_bindings (widget_class, 0);
- add_tab_bindings (widget_class, GDK_CONTROL_MASK);
- add_tab_bindings (widget_class, GDK_SHIFT_MASK);
- add_tab_bindings (widget_class, GDK_CONTROL_MASK | GDK_SHIFT_MASK);
+ add_tab_bindings (binding_set, 0);
+ add_tab_bindings (binding_set, GDK_CONTROL_MASK);
+ add_tab_bindings (binding_set, GDK_SHIFT_MASK);
+ add_tab_bindings (binding_set, GDK_CONTROL_MASK | GDK_SHIFT_MASK);
/* accept and cancel positions */
- gtk_widget_class_add_binding_signal (widget_class,
- GDK_KEY_Escape, 0,
- "cancel-position",
- NULL);
-
- gtk_widget_class_add_binding_signal (widget_class,
- GDK_KEY_Return, 0,
- "accept-position",
- NULL);
- gtk_widget_class_add_binding_signal (widget_class,
- GDK_KEY_ISO_Enter, 0,
- "accept-position",
- NULL);
- gtk_widget_class_add_binding_signal (widget_class,
- GDK_KEY_KP_Enter, 0,
- "accept-position",
- NULL);
- gtk_widget_class_add_binding_signal (widget_class,
- GDK_KEY_space, 0,
- "accept-position",
- NULL);
- gtk_widget_class_add_binding_signal (widget_class,
- GDK_KEY_KP_Space, 0,
- "accept-position",
- NULL);
+ gtk_binding_entry_add_signal (binding_set,
+ GDK_KEY_Escape, 0,
+ "cancel-position", 0);
+
+ gtk_binding_entry_add_signal (binding_set,
+ GDK_KEY_Return, 0,
+ "accept-position", 0);
+ gtk_binding_entry_add_signal (binding_set,
+ GDK_KEY_ISO_Enter, 0,
+ "accept-position", 0);
+ gtk_binding_entry_add_signal (binding_set,
+ GDK_KEY_KP_Enter, 0,
+ "accept-position", 0);
+ gtk_binding_entry_add_signal (binding_set,
+ GDK_KEY_space, 0,
+ "accept-position", 0);
+ gtk_binding_entry_add_signal (binding_set,
+ GDK_KEY_KP_Space, 0,
+ "accept-position", 0);
/* move handle */
- add_move_binding (widget_class, GDK_KEY_Left, 0, GTK_SCROLL_STEP_LEFT);
- add_move_binding (widget_class, GDK_KEY_KP_Left, 0, GTK_SCROLL_STEP_LEFT);
- add_move_binding (widget_class, GDK_KEY_Left, GDK_CONTROL_MASK, GTK_SCROLL_PAGE_LEFT);
- add_move_binding (widget_class, GDK_KEY_KP_Left, GDK_CONTROL_MASK, GTK_SCROLL_PAGE_LEFT);
-
- add_move_binding (widget_class, GDK_KEY_Right, 0, GTK_SCROLL_STEP_RIGHT);
- add_move_binding (widget_class, GDK_KEY_Right, GDK_CONTROL_MASK, GTK_SCROLL_PAGE_RIGHT);
- add_move_binding (widget_class, GDK_KEY_KP_Right, 0, GTK_SCROLL_STEP_RIGHT);
- add_move_binding (widget_class, GDK_KEY_KP_Right, GDK_CONTROL_MASK, GTK_SCROLL_PAGE_RIGHT);
-
- add_move_binding (widget_class, GDK_KEY_Up, 0, GTK_SCROLL_STEP_UP);
- add_move_binding (widget_class, GDK_KEY_Up, GDK_CONTROL_MASK, GTK_SCROLL_PAGE_UP);
- add_move_binding (widget_class, GDK_KEY_KP_Up, 0, GTK_SCROLL_STEP_UP);
- add_move_binding (widget_class, GDK_KEY_KP_Up, GDK_CONTROL_MASK, GTK_SCROLL_PAGE_UP);
- add_move_binding (widget_class, GDK_KEY_Page_Up, 0, GTK_SCROLL_PAGE_UP);
- add_move_binding (widget_class, GDK_KEY_KP_Page_Up, 0, GTK_SCROLL_PAGE_UP);
-
- add_move_binding (widget_class, GDK_KEY_Down, 0, GTK_SCROLL_STEP_DOWN);
- add_move_binding (widget_class, GDK_KEY_Down, GDK_CONTROL_MASK, GTK_SCROLL_PAGE_DOWN);
- add_move_binding (widget_class, GDK_KEY_KP_Down, 0, GTK_SCROLL_STEP_DOWN);
- add_move_binding (widget_class, GDK_KEY_KP_Down, GDK_CONTROL_MASK, GTK_SCROLL_PAGE_DOWN);
- add_move_binding (widget_class, GDK_KEY_Page_Down, 0, GTK_SCROLL_PAGE_RIGHT);
- add_move_binding (widget_class, GDK_KEY_KP_Page_Down, 0, GTK_SCROLL_PAGE_RIGHT);
-
- add_move_binding (widget_class, GDK_KEY_Home, 0, GTK_SCROLL_START);
- add_move_binding (widget_class, GDK_KEY_KP_Home, 0, GTK_SCROLL_START);
- add_move_binding (widget_class, GDK_KEY_End, 0, GTK_SCROLL_END);
- add_move_binding (widget_class, GDK_KEY_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);
gtk_widget_class_set_accessible_type (widget_class, GTK_TYPE_PANED_ACCESSIBLE);
gtk_widget_class_set_css_name (widget_class, I_("paned"));