[gnome-builder] glade: add stubs for handling signal editing



commit 5cdb264361cf76c48aa0c5c92f4b7402e648158f
Author: Christian Hergert <chergert redhat com>
Date:   Mon Oct 22 17:52:43 2018 -0700

    glade: add stubs for handling signal editing

 src/plugins/glade/gbp-glade-view.c | 103 +++++++++++++++++++++++++++++++++++++
 1 file changed, 103 insertions(+)
---
diff --git a/src/plugins/glade/gbp-glade-view.c b/src/plugins/glade/gbp-glade-view.c
index 6fb0583cb..84072ca5e 100644
--- a/src/plugins/glade/gbp-glade-view.c
+++ b/src/plugins/glade/gbp-glade-view.c
@@ -325,6 +325,85 @@ gbp_glade_view_context_set (GtkWidget  *widget,
                            G_CONNECT_SWAPPED);
 }
 
+static void
+gbp_glade_view_add_signal_handler_cb (GbpGladeView      *self,
+                                      GladeWidget       *widget,
+                                      const GladeSignal *gsignal,
+                                      GladeProject      *project)
+{
+  IDE_ENTRY;
+
+  g_assert (GBP_IS_GLADE_VIEW (self));
+  g_assert (GLADE_IS_WIDGET (widget));
+  g_assert (GLADE_IS_SIGNAL (gsignal));
+  g_assert (GLADE_IS_PROJECT (project));
+
+  g_print ("add signal handler: %s\n",
+           glade_signal_get_handler (gsignal));
+
+  IDE_EXIT;
+}
+
+static void
+gbp_glade_view_remove_signal_handler_cb (GbpGladeView      *self,
+                                         GladeWidget       *widget,
+                                         const GladeSignal *gsignal,
+                                         GladeProject      *project)
+{
+  IDE_ENTRY;
+
+  g_assert (GBP_IS_GLADE_VIEW (self));
+  g_assert (GLADE_IS_WIDGET (widget));
+  g_assert (GLADE_IS_SIGNAL (gsignal));
+  g_assert (GLADE_IS_PROJECT (project));
+
+  g_print ("remove signal handler: %s\n",
+           glade_signal_get_handler (gsignal));
+
+  IDE_EXIT;
+}
+
+static void
+gbp_glade_view_change_signal_handler_cb (GbpGladeView      *self,
+                                         GladeWidget       *widget,
+                                         const GladeSignal *old_gsignal,
+                                         const GladeSignal *new_gsignal,
+                                         GladeProject      *project)
+{
+  IDE_ENTRY;
+
+  g_assert (GBP_IS_GLADE_VIEW (self));
+  g_assert (GLADE_IS_WIDGET (widget));
+  g_assert (GLADE_IS_SIGNAL (old_gsignal));
+  g_assert (GLADE_IS_SIGNAL (new_gsignal));
+  g_assert (GLADE_IS_PROJECT (project));
+
+  g_print ("change signal handler: %s => %s\n",
+           glade_signal_get_handler (old_gsignal),
+           glade_signal_get_handler (new_gsignal));
+
+  IDE_EXIT;
+}
+
+static void
+gbp_glade_view_activate_signal_handler_cb (GbpGladeView      *self,
+                                           GladeWidget       *widget,
+                                           const GladeSignal *gsignal,
+                                           GladeProject      *project)
+{
+  IDE_ENTRY;
+
+  g_assert (GBP_IS_GLADE_VIEW (self));
+  g_assert (GLADE_IS_WIDGET (widget));
+  g_assert (GLADE_IS_SIGNAL (gsignal));
+  g_assert (GLADE_IS_PROJECT (project));
+
+  g_print ("activate signal handler: %s\n",
+           glade_signal_get_handler (gsignal));
+
+  IDE_EXIT;
+}
+
 static void
 gbp_glade_view_dispose (GObject *object)
 {
@@ -424,6 +503,30 @@ gbp_glade_view_init (GbpGladeView *self)
                                    self,
                                    G_CONNECT_SWAPPED);
 
+  dzl_signal_group_connect_object (self->project_signals,
+                                   "add-signal-handler",
+                                   G_CALLBACK (gbp_glade_view_add_signal_handler_cb),
+                                   self,
+                                   G_CONNECT_SWAPPED);
+
+  dzl_signal_group_connect_object (self->project_signals,
+                                   "remove-signal-handler",
+                                   G_CALLBACK (gbp_glade_view_remove_signal_handler_cb),
+                                   self,
+                                   G_CONNECT_SWAPPED);
+
+  dzl_signal_group_connect_object (self->project_signals,
+                                   "change-signal-handler",
+                                   G_CALLBACK (gbp_glade_view_change_signal_handler_cb),
+                                   self,
+                                   G_CONNECT_SWAPPED);
+
+  dzl_signal_group_connect_object (self->project_signals,
+                                   "activate-signal-handler",
+                                   G_CALLBACK (gbp_glade_view_activate_signal_handler_cb),
+                                   self,
+                                   G_CONNECT_SWAPPED);
+
   ide_widget_set_context_handler (self, gbp_glade_view_context_set);
 
   project = glade_project_new ();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]