summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2023-04-07 13:14:07 -0400
committerMatthias Clasen <mclasen@redhat.com>2023-04-07 13:17:22 -0400
commit76640487799b6c88c84acc01e2dc1af3b754a9e1 (patch)
treec878fb6f10dd9eaa97596edcf3acece381a5303a
parent8648ecf8899247d998a13b1854e5abc4892121c3 (diff)
downloadgtk+-76640487799b6c88c84acc01e2dc1af3b754a9e1.tar.gz
inspector: Add ActionHolder::changed
We will use this signal to communicate action changes to the action list widgetry.
-rw-r--r--gtk/inspector/action-holder.c17
-rw-r--r--gtk/inspector/action-holder.h2
2 files changed, 18 insertions, 1 deletions
diff --git a/gtk/inspector/action-holder.c b/gtk/inspector/action-holder.c
index 199741e3d2..4c3c43b9e5 100644
--- a/gtk/inspector/action-holder.c
+++ b/gtk/inspector/action-holder.c
@@ -8,6 +8,8 @@ struct _ActionHolder {
char *name;
};
+static guint changed_signal;
+
G_DEFINE_TYPE (ActionHolder, action_holder, G_TYPE_OBJECT)
static void
@@ -32,6 +34,15 @@ action_holder_class_init (ActionHolderClass *class)
GObjectClass *object_class = G_OBJECT_CLASS (class);
object_class->finalize = action_holder_finalize;
+
+ changed_signal =
+ g_signal_new ("changed",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_FIRST,
+ 0,
+ NULL, NULL,
+ NULL,
+ G_TYPE_NONE, 0);
}
ActionHolder *
@@ -59,3 +70,9 @@ action_holder_get_name (ActionHolder *holder)
{
return holder->name;
}
+
+void
+action_holder_changed (ActionHolder *holder)
+{
+ g_signal_emit (holder, changed_signal, 0);
+}
diff --git a/gtk/inspector/action-holder.h b/gtk/inspector/action-holder.h
index fe30248784..593074225f 100644
--- a/gtk/inspector/action-holder.h
+++ b/gtk/inspector/action-holder.h
@@ -12,4 +12,4 @@ ActionHolder * action_holder_new (GObject *owner,
GObject *action_holder_get_owner (ActionHolder *holder);
const char *action_holder_get_name (ActionHolder *holder);
-
+void action_holder_changed (ActionHolder *holder);