[gtk/ebassi/activate-signal: 3/6] Use function setter for WidgetClass.activate_signal
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/ebassi/activate-signal: 3/6] Use function setter for WidgetClass.activate_signal
- Date: Sat, 5 Dec 2020 01:04:34 +0000 (UTC)
commit 213024a560b5523fe34822a92bf9722069ad07d4
Author: Emmanuele Bassi <ebassi gnome org>
Date: Fri Dec 4 23:12:20 2020 +0000
Use function setter for WidgetClass.activate_signal
gtk/gtkbutton.c | 5 +++--
gtk/gtkexpander.c | 4 +++-
gtk/gtkflowbox.c | 4 ++--
gtk/gtklistbox.c | 4 ++--
gtk/gtklistitemwidget.c | 2 +-
gtk/gtkmodelbutton.c | 3 +--
gtk/gtkpopovermenubar.c | 4 +++-
gtk/gtkswitch.c | 3 ++-
8 files changed, 17 insertions(+), 12 deletions(-)
---
diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c
index c4038765a4..dc7955ff63 100644
--- a/gtk/gtkbutton.c
+++ b/gtk/gtkbutton.c
@@ -282,9 +282,10 @@ gtk_button_class_init (GtkButtonClass *klass)
NULL, NULL,
NULL,
G_TYPE_NONE, 0);
- widget_class->activate_signal = button_signals[ACTIVATE];
- activate_action = gtk_signal_action_new ("activate");
+ gtk_widget_class_set_activate_signal (widget_class, button_signals[ACTIVATE]);
+
+ activate_action = gtk_signal_action_new ("activate");
for (guint i = 0; i < G_N_ELEMENTS (activate_keyvals); i++)
{
GtkShortcut *activate_shortcut = gtk_shortcut_new (gtk_keyval_trigger_new (activate_keyvals[i], 0),
diff --git a/gtk/gtkexpander.c b/gtk/gtkexpander.c
index 9b60db04a4..647ee68428 100644
--- a/gtk/gtkexpander.c
+++ b/gtk/gtkexpander.c
@@ -292,6 +292,7 @@ gtk_expander_class_init (GtkExpanderClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+ guint activate_signal;
gobject_class->dispose = gtk_expander_dispose;
gobject_class->set_property = gtk_expander_set_property;
@@ -368,7 +369,7 @@ gtk_expander_class_init (GtkExpanderClass *klass)
GTK_TYPE_WIDGET,
GTK_PARAM_READWRITE));
- widget_class->activate_signal =
+ activate_signal =
g_signal_new (I_("activate"),
G_TYPE_FROM_CLASS (gobject_class),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
@@ -377,6 +378,7 @@ gtk_expander_class_init (GtkExpanderClass *klass)
NULL,
G_TYPE_NONE, 0);
+ gtk_widget_class_set_activate_signal (widget_class, activate_signal);
gtk_widget_class_set_css_name (widget_class, I_("expander-widget"));
gtk_widget_class_set_accessible_role (widget_class, GTK_ACCESSIBLE_ROLE_BUTTON);
}
diff --git a/gtk/gtkflowbox.c b/gtk/gtkflowbox.c
index 7342369b6a..c2d92943f5 100644
--- a/gtk/gtkflowbox.c
+++ b/gtk/gtkflowbox.c
@@ -547,11 +547,11 @@ gtk_flow_box_child_class_init (GtkFlowBoxChildClass *class)
NULL, NULL,
NULL,
G_TYPE_NONE, 0);
- widget_class->activate_signal = child_signals[CHILD_ACTIVATE];
gtk_widget_class_set_layout_manager_type (widget_class, GTK_TYPE_BIN_LAYOUT);
gtk_widget_class_set_css_name (widget_class, I_("flowboxchild"));
gtk_widget_class_set_accessible_role (widget_class, GTK_ACCESSIBLE_ROLE_GRID_CELL);
+ gtk_widget_class_set_activate_signal (widget_class, child_signals[CHILD_ACTIVATE]);
}
static void
@@ -3837,7 +3837,7 @@ gtk_flow_box_class_init (GtkFlowBoxClass *class)
NULL,
G_TYPE_NONE, 0);
- widget_class->activate_signal = signals[ACTIVATE_CURSOR_CHILD];
+ gtk_widget_class_set_activate_signal (widget_class, signals[ACTIVATE_CURSOR_CHILD]);
gtk_flow_box_add_move_binding (widget_class, GDK_KEY_Home, 0,
GTK_MOVEMENT_BUFFER_ENDS, -1);
diff --git a/gtk/gtklistbox.c b/gtk/gtklistbox.c
index 1c256c0537..72bc7c8539 100644
--- a/gtk/gtklistbox.c
+++ b/gtk/gtklistbox.c
@@ -637,7 +637,7 @@ gtk_list_box_class_init (GtkListBoxClass *klass)
G_TYPE_FROM_CLASS (klass),
_gtk_marshal_VOID__ENUM_INT_BOOLEAN_BOOLEANv);
- widget_class->activate_signal = signals[ACTIVATE_CURSOR_ROW];
+ gtk_widget_class_set_activate_signal (widget_class, signals[ACTIVATE_CURSOR_ROW]);
gtk_list_box_add_move_binding (widget_class, GDK_KEY_Home, 0,
GTK_MOVEMENT_BUFFER_ENDS, -1);
@@ -3466,7 +3466,7 @@ gtk_list_box_row_class_init (GtkListBoxRowClass *klass)
NULL,
G_TYPE_NONE, 0);
- widget_class->activate_signal = row_signals[ROW__ACTIVATE];
+ gtk_widget_class_set_activate_signal (widget_class, row_signals[ROW__ACTIVATE]);
/**
* GtkListBoxRow:activatable:
diff --git a/gtk/gtklistitemwidget.c b/gtk/gtklistitemwidget.c
index ea601be4d5..abe6352688 100644
--- a/gtk/gtklistitemwidget.c
+++ b/gtk/gtklistitemwidget.c
@@ -263,7 +263,7 @@ gtk_list_item_widget_class_init (GtkListItemWidgetClass *klass)
NULL,
G_TYPE_NONE, 0);
- widget_class->activate_signal = signals[ACTIVATE_SIGNAL];
+ gtk_widget_class_set_activate_signal (widget_class, signals[ACTIVATE_SIGNAL]);
/**
* GtkListItem|listitem.select:
diff --git a/gtk/gtkmodelbutton.c b/gtk/gtkmodelbutton.c
index da9a3f5b52..6c6be9a123 100644
--- a/gtk/gtkmodelbutton.c
+++ b/gtk/gtkmodelbutton.c
@@ -1295,8 +1295,7 @@ gtk_model_button_class_init (GtkModelButtonClass *class)
NULL,
G_TYPE_NONE, 0);
- widget_class->activate_signal = signals[SIGNAL_CLICKED];
-
+ gtk_widget_class_set_activate_signal (widget_class, signals[SIGNAL_CLICKED]);
gtk_widget_class_set_layout_manager_type (widget_class, GTK_TYPE_BOX_LAYOUT);
gtk_widget_class_set_css_name (widget_class, I_("modelbutton"));
gtk_widget_class_set_accessible_role (widget_class, GTK_ACCESSIBLE_ROLE_MENU_ITEM);
diff --git a/gtk/gtkpopovermenubar.c b/gtk/gtkpopovermenubar.c
index 447dc5fa65..455f21ef65 100644
--- a/gtk/gtkpopovermenubar.c
+++ b/gtk/gtkpopovermenubar.c
@@ -354,6 +354,7 @@ gtk_popover_menu_bar_item_class_init (GtkPopoverMenuBarItemClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+ guint activate_signal;
object_class->dispose = gtk_popover_menu_bar_item_dispose;
object_class->finalize = gtk_popover_menu_bar_item_finalize;
@@ -364,7 +365,7 @@ gtk_popover_menu_bar_item_class_init (GtkPopoverMenuBarItemClass *klass)
klass->activate = gtk_popover_menu_bar_item_activate;
- widget_class->activate_signal =
+ activate_signal =
g_signal_new (I_("activate"),
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_FIRST,
@@ -375,6 +376,7 @@ gtk_popover_menu_bar_item_class_init (GtkPopoverMenuBarItemClass *klass)
gtk_widget_class_set_css_name (widget_class, I_("item"));
gtk_widget_class_set_accessible_role (widget_class, GTK_ACCESSIBLE_ROLE_MENU_ITEM);
+ gtk_widget_class_set_activate_signal (widget_class, activate_signal);
}
enum
{
diff --git a/gtk/gtkswitch.c b/gtk/gtkswitch.c
index bb681d9123..cff20c9aa8 100644
--- a/gtk/gtkswitch.c
+++ b/gtk/gtkswitch.c
@@ -570,7 +570,8 @@ gtk_switch_class_init (GtkSwitchClass *klass)
NULL, NULL,
NULL,
G_TYPE_NONE, 0);
- widget_class->activate_signal = signals[ACTIVATE];
+
+ gtk_widget_class_set_activate_signal (widget_class, signals[ACTIVATE]);
/**
* GtkSwitch::state-set:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]