[gtk/ebassi/activate-signal: 5/6] Add getter for WidgetClass.activate_signal
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/ebassi/activate-signal: 5/6] Add getter for WidgetClass.activate_signal
- Date: Sat, 5 Dec 2020 01:04:34 +0000 (UTC)
commit fe9c0db6039e501e45881e108497d3c60d043fa9
Author: Emmanuele Bassi <ebassi gnome org>
Date: Sat Dec 5 00:59:55 2020 +0000
Add getter for WidgetClass.activate_signal
Just like we have a setter.
docs/reference/gtk/gtk4-sections.txt | 1 +
gtk/gtkwidget.c | 18 ++++++++++++++++++
gtk/gtkwidget.h | 2 ++
3 files changed, 21 insertions(+)
---
diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt
index 66eae4da6a..c8e46d89a2 100644
--- a/docs/reference/gtk/gtk4-sections.txt
+++ b/docs/reference/gtk/gtk4-sections.txt
@@ -4368,6 +4368,7 @@ gtk_widget_class_set_layout_manager_type
gtk_widget_class_get_layout_manager_type
gtk_widget_class_set_activate_signal
gtk_widget_class_set_activate_signal_from_name
+gtk_widget_class_get_activate_signal
gtk_widget_activate
gtk_widget_is_focus
gtk_widget_grab_focus
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index e638b377aa..a9a46c3a1e 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -4582,6 +4582,24 @@ gtk_widget_event (GtkWidget *widget,
return return_val;
}
+/**
+ * gtk_widget_class_get_activate_signal:
+ * @widget_class: a #GtkWidgetClass
+ *
+ * Retrieves the signal id for the activation signal set using
+ * gtk_widget_class_set_activate_signal().
+ *
+ * Returns: a signal id, or 0 if the widget class does not
+ * specify an activation signal
+ */
+guint
+gtk_widget_class_get_activate_signal (GtkWidgetClass *widget_class)
+{
+ g_return_val_if_fail (GTK_IS_WIDGET_CLASS (widget_class), 0);
+
+ return widget_class->activate_signal;
+}
+
/**
* gtk_widget_class_set_activate_signal:
* @widget_class: a #GtkWidgetClass
diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h
index 8aa2403ac9..63ffca12b8 100644
--- a/gtk/gtkwidget.h
+++ b/gtk/gtkwidget.h
@@ -370,6 +370,8 @@ void gtk_widget_class_set_activate_signal (GtkWidgetClass
GDK_AVAILABLE_IN_ALL
void gtk_widget_class_set_activate_signal_from_name (GtkWidgetClass *widget_class,
const char *signal_name);
+GDK_AVAILABLE_IN_ALL
+guint gtk_widget_class_get_activate_signal (GtkWidgetClass *widget_class);
GDK_AVAILABLE_IN_ALL
gboolean gtk_widget_mnemonic_activate (GtkWidget *widget,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]