inspector: Add ActionHolder::changed
authorMatthias Clasen <mclasen@redhat.com>
Fri, 7 Apr 2023 17:14:07 +0000 (13:14 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 21 Apr 2023 07:09:26 +0000 (09:09 +0200)
We will use this signal to communicate
action changes to the action list widgetry.

gtk/inspector/action-holder.c
gtk/inspector/action-holder.h

index 199741e3d2fe23fa88cbf5b19878f5ee71bc6499..4c3c43b9e5f959d3240127ef3b23ba7bcd812e23 100644 (file)
@@ -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);
+}
index a3294e835db305c06b8d9dfa443aa343315f08c8..e4cfeb917642e83c8cf69256b08300220fcb92ad 100644 (file)
@@ -13,5 +13,6 @@ 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);
 
 #endif /* __ACTION_HOLDER_H__ */