[gtk/wip/otte/listmodel: 21/23] inspector: Rename "Gestures" page to "Controllers"
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/otte/listmodel: 21/23] inspector: Rename "Gestures" page to "Controllers"
- Date: Wed, 12 Sep 2018 11:55:02 +0000 (UTC)
commit 04d13ded3050458244b07a6e95ef9a71d347b39b
Author: Benjamin Otte <otte redhat com>
Date: Tue Sep 11 02:25:37 2018 +0200
inspector: Rename "Gestures" page to "Controllers"
And rename GtkInspectorGestures => GtkInspectorControllers, too.
gtk/inspector/{gestures.c => controllers.c} | 47 ++++++++++++------------
gtk/inspector/controllers.h | 55 +++++++++++++++++++++++++++++
gtk/inspector/gestures.h | 54 ----------------------------
gtk/inspector/init.c | 4 +--
gtk/inspector/meson.build | 2 +-
gtk/inspector/window.c | 6 ++--
gtk/inspector/window.h | 2 +-
gtk/inspector/window.ui | 6 ++--
8 files changed, 89 insertions(+), 87 deletions(-)
---
diff --git a/gtk/inspector/gestures.c b/gtk/inspector/controllers.c
similarity index 82%
rename from gtk/inspector/gestures.c
rename to gtk/inspector/controllers.c
index 32f2fd44f9..e52ea45a3b 100644
--- a/gtk/inspector/gestures.c
+++ b/gtk/inspector/controllers.c
@@ -18,7 +18,7 @@
#include "config.h"
#include <glib/gi18n-lib.h>
-#include "gestures.h"
+#include "controllers.h"
#include "object-tree.h"
#include "gtksizegroup.h"
@@ -35,32 +35,32 @@ enum
PROP_OBJECT_TREE
};
-struct _GtkInspectorGesturesPrivate
+struct _GtkInspectorControllersPrivate
{
GtkWidget *listbox;
GtkSizeGroup *sizegroup;
GtkInspectorObjectTree *object_tree;
};
-G_DEFINE_TYPE_WITH_PRIVATE (GtkInspectorGestures, gtk_inspector_gestures, GTK_TYPE_BOX)
+G_DEFINE_TYPE_WITH_PRIVATE (GtkInspectorControllers, gtk_inspector_controllers, GTK_TYPE_BOX)
static void
-row_activated (GtkListBox *box,
- GtkListBoxRow *row,
- GtkInspectorGestures *sl)
+row_activated (GtkListBox *box,
+ GtkListBoxRow *row,
+ GtkInspectorControllers *sl)
{
- GObject *gesture;
+ GObject *controller;
- gesture = G_OBJECT (g_object_get_data (G_OBJECT (row), "gesture"));
- gtk_inspector_object_tree_select_object (sl->priv->object_tree, gesture);
+ controller = G_OBJECT (g_object_get_data (G_OBJECT (row), "controller"));
+ gtk_inspector_object_tree_select_object (sl->priv->object_tree, controller);
}
static void
-gtk_inspector_gestures_init (GtkInspectorGestures *sl)
+gtk_inspector_controllers_init (GtkInspectorControllers *sl)
{
GtkWidget *frame;
- sl->priv = gtk_inspector_gestures_get_instance_private (sl);
+ sl->priv = gtk_inspector_controllers_get_instance_private (sl);
sl->priv->sizegroup = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
g_object_set (sl,
"orientation", GTK_ORIENTATION_VERTICAL,
@@ -85,7 +85,7 @@ gtk_inspector_gestures_init (GtkInspectorGestures *sl)
}
static void
-clear_all (GtkInspectorGestures *sl)
+clear_all (GtkInspectorControllers *sl)
{
GList *children, *l;
GtkWidget *child;
@@ -100,7 +100,8 @@ clear_all (GtkInspectorGestures *sl)
}
static void
-phase_changed_cb (GtkComboBox *combo, GtkInspectorGestures *sl)
+phase_changed_cb (GtkComboBox *combo,
+ GtkInspectorControllers *sl)
{
GtkWidget *row;
GtkPropagationPhase phase;
@@ -108,14 +109,14 @@ phase_changed_cb (GtkComboBox *combo, GtkInspectorGestures *sl)
phase = gtk_combo_box_get_active (combo);
row = gtk_widget_get_ancestor (GTK_WIDGET (combo), GTK_TYPE_LIST_BOX_ROW);
- controller = GTK_EVENT_CONTROLLER (g_object_get_data (G_OBJECT (row), "gesture"));
+ controller = GTK_EVENT_CONTROLLER (g_object_get_data (G_OBJECT (row), "controller"));
gtk_event_controller_set_propagation_phase (controller, phase);
}
static void
-add_controller (GtkInspectorGestures *sl,
- GObject *object,
- GtkEventController *controller)
+add_controller (GtkInspectorControllers *sl,
+ GObject *object,
+ GtkEventController *controller)
{
GtkWidget *row;
GtkWidget *box;
@@ -147,13 +148,13 @@ add_controller (GtkInspectorGestures *sl,
gtk_widget_set_halign (label, GTK_ALIGN_END);
gtk_widget_set_valign (label, GTK_ALIGN_BASELINE);
- g_object_set_data (G_OBJECT (row), "gesture", controller);
+ g_object_set_data (G_OBJECT (row), "controller", controller);
g_signal_connect (combo, "changed", G_CALLBACK (phase_changed_cb), sl);
}
void
-gtk_inspector_gestures_set_object (GtkInspectorGestures *sl,
- GObject *object)
+gtk_inspector_controllers_set_object (GtkInspectorControllers *sl,
+ GObject *object)
{
GtkPropagationPhase phase;
GList *list, *l;
@@ -180,7 +181,7 @@ get_property (GObject *object,
GValue *value,
GParamSpec *pspec)
{
- GtkInspectorGestures *sl = GTK_INSPECTOR_GESTURES (object);
+ GtkInspectorControllers *sl = GTK_INSPECTOR_CONTROLLERS (object);
switch (param_id)
{
@@ -200,7 +201,7 @@ set_property (GObject *object,
const GValue *value,
GParamSpec *pspec)
{
- GtkInspectorGestures *sl = GTK_INSPECTOR_GESTURES (object);
+ GtkInspectorControllers *sl = GTK_INSPECTOR_CONTROLLERS (object);
switch (param_id)
{
@@ -215,7 +216,7 @@ set_property (GObject *object,
}
static void
-gtk_inspector_gestures_class_init (GtkInspectorGesturesClass *klass)
+gtk_inspector_controllers_class_init (GtkInspectorControllersClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
diff --git a/gtk/inspector/controllers.h b/gtk/inspector/controllers.h
new file mode 100644
index 0000000000..a0f9f8c265
--- /dev/null
+++ b/gtk/inspector/controllers.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2014 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _GTK_INSPECTOR_CONTROLLERS_H_
+#define _GTK_INSPECTOR_CONTROLLERS_H_
+
+#include <gtk/gtkbox.h>
+
+#define GTK_TYPE_INSPECTOR_CONTROLLERS (gtk_inspector_controllers_get_type())
+#define GTK_INSPECTOR_CONTROLLERS(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),
GTK_TYPE_INSPECTOR_CONTROLLERS, GtkInspectorControllers))
+#define GTK_INSPECTOR_CONTROLLERS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),
GTK_TYPE_INSPECTOR_CONTROLLERS, GtkInspectorControllersClass))
+#define GTK_INSPECTOR_IS_GESTURES(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),
GTK_TYPE_INSPECTOR_CONTROLLERS))
+#define GTK_INSPECTOR_IS_GESTURES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),
GTK_TYPE_INSPECTOR_CONTROLLERS))
+#define GTK_INSPECTOR_CONTROLLERS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj),
GTK_TYPE_INSPECTOR_CONTROLLERS, GtkInspectorControllersClass))
+
+
+typedef struct _GtkInspectorControllersPrivate GtkInspectorControllersPrivate;
+
+typedef struct _GtkInspectorControllers
+{
+ GtkBox parent;
+ GtkInspectorControllersPrivate *priv;
+} GtkInspectorControllers;
+
+typedef struct _GtkInspectorControllersClass
+{
+ GtkBoxClass parent;
+} GtkInspectorControllersClass;
+
+G_BEGIN_DECLS
+
+GType gtk_inspector_controllers_get_type (void);
+
+void gtk_inspector_controllers_set_object (GtkInspectorControllers *sl,
+ GObject *object);
+
+G_END_DECLS
+
+#endif // _GTK_INSPECTOR_CONTROLLERS_H_
+
+// vim: set et sw=2 ts=2:
diff --git a/gtk/inspector/init.c b/gtk/inspector/init.c
index d16c03eaf2..049126f401 100644
--- a/gtk/inspector/init.c
+++ b/gtk/inspector/init.c
@@ -26,11 +26,11 @@
#include "actions.h"
#include "cellrenderergraph.h"
+#include "controllers.h"
#include "css-editor.h"
#include "css-node-tree.h"
#include "data-list.h"
#include "general.h"
-#include "gestures.h"
#include "graphdata.h"
#include "logs.h"
#include "magnifier.h"
@@ -63,11 +63,11 @@ gtk_inspector_init (void)
g_type_ensure (GTK_TYPE_CELL_RENDERER_GRAPH);
g_type_ensure (GTK_TYPE_GRAPH_DATA);
g_type_ensure (GTK_TYPE_INSPECTOR_ACTIONS);
+ g_type_ensure (GTK_TYPE_INSPECTOR_CONTROLLERS);
g_type_ensure (GTK_TYPE_INSPECTOR_CSS_EDITOR);
g_type_ensure (GTK_TYPE_INSPECTOR_CSS_NODE_TREE);
g_type_ensure (GTK_TYPE_INSPECTOR_DATA_LIST);
g_type_ensure (GTK_TYPE_INSPECTOR_GENERAL);
- g_type_ensure (GTK_TYPE_INSPECTOR_GESTURES);
g_type_ensure (GTK_TYPE_INSPECTOR_LOGS);
g_type_ensure (GTK_TYPE_MAGNIFIER);
g_type_ensure (GTK_TYPE_INSPECTOR_MAGNIFIER);
diff --git a/gtk/inspector/meson.build b/gtk/inspector/meson.build
index 7176b92946..a134f8f278 100644
--- a/gtk/inspector/meson.build
+++ b/gtk/inspector/meson.build
@@ -2,12 +2,12 @@ inspector_sources = files(
'action-editor.c',
'actions.c',
'cellrenderergraph.c',
+ 'controllers.c',
'css-editor.c',
'css-node-tree.c',
'data-list.c',
'fpsoverlay.c',
'general.c',
- 'gestures.c',
'graphdata.c',
'gtkstackcombo.c',
'gtktreemodelcssnode.c',
diff --git a/gtk/inspector/window.c b/gtk/inspector/window.c
index eb7b34da31..5f4c1eb07f 100644
--- a/gtk/inspector/window.c
+++ b/gtk/inspector/window.c
@@ -29,6 +29,7 @@
#include "window.h"
#include "prop-list.h"
+#include "controllers.h"
#include "css-editor.h"
#include "css-node-tree.h"
#include "object-hierarchy.h"
@@ -40,7 +41,6 @@
#include "actions.h"
#include "menu.h"
#include "misc-info.h"
-#include "gestures.h"
#include "magnifier.h"
#include "recorder.h"
@@ -81,7 +81,7 @@ set_selected_object (GtkInspectorWindow *iw,
gtk_inspector_data_list_set_object (GTK_INSPECTOR_DATA_LIST (iw->data_list), selected);
gtk_inspector_actions_set_object (GTK_INSPECTOR_ACTIONS (iw->actions), selected);
gtk_inspector_menu_set_object (GTK_INSPECTOR_MENU (iw->menu), selected);
- gtk_inspector_gestures_set_object (GTK_INSPECTOR_GESTURES (iw->gestures), selected);
+ gtk_inspector_controllers_set_object (GTK_INSPECTOR_CONTROLLERS (iw->controllers), selected);
gtk_inspector_magnifier_set_object (GTK_INSPECTOR_MAGNIFIER (iw->magnifier), selected);
for (l = iw->extra_pages; l != NULL; l = l->next)
@@ -287,7 +287,7 @@ gtk_inspector_window_class_init (GtkInspectorWindowClass *klass)
gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, actions);
gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, menu);
gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, misc_info);
- gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, gestures);
+ gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, controllers);
gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, magnifier);
gtk_widget_class_bind_template_callback (widget_class, gtk_inspector_on_inspect);
diff --git a/gtk/inspector/window.h b/gtk/inspector/window.h
index 26ba277e6b..ed1adfa3df 100644
--- a/gtk/inspector/window.h
+++ b/gtk/inspector/window.h
@@ -69,7 +69,7 @@ typedef struct
GtkWidget *actions;
GtkWidget *menu;
GtkWidget *misc_info;
- GtkWidget *gestures;
+ GtkWidget *controllers;
GtkWidget *magnifier;
GtkWidget *invisible;
diff --git a/gtk/inspector/window.ui b/gtk/inspector/window.ui
index bd2d8d3bf4..67b97fb0cb 100644
--- a/gtk/inspector/window.ui
+++ b/gtk/inspector/window.ui
@@ -365,12 +365,12 @@
</packing>
</child>
<child>
- <object class="GtkInspectorGestures" id="gestures">
+ <object class="GtkInspectorControllers" id="controllers">
<property name="object-tree">object_tree</property>
</object>
<packing>
- <property name="name">gestures</property>
- <property name="title" translatable="yes">Gestures</property>
+ <property name="name">controllers</property>
+ <property name="title" translatable="yes">Controllers</property>
</packing>
</child>
<child>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]