[gtk/wip/otte/listview: 140/145] gtk-demo: Use normal way to lookup up symbols



commit 1ca08c812ff1752f62ed3e2d30e2df2862a8df00
Author: Benjamin Otte <otte redhat com>
Date:   Fri Nov 29 08:48:48 2019 +0100

    gtk-demo: Use normal way to lookup up symbols
    
    We're a normal application, so we can use the normal way to hook up code
    into builder files, which is using dlsym() for the function pointers.
    
    There's no need to to extra work exporting static symbols.

 demos/gtk-demo/fishbowl.c          | 29 ++++++++++-----------------
 demos/gtk-demo/fishbowl.ui         |  8 ++++----
 demos/gtk-demo/font-features.ui    | 10 +++++-----
 demos/gtk-demo/font_features.c     | 33 ++++++++++++------------------
 demos/gtk-demo/iconscroll.c        | 19 +++++++-----------
 demos/gtk-demo/iconscroll.ui       |  4 ++--
 demos/gtk-demo/listview_settings.c | 13 +++++-------
 demos/gtk-demo/main.c              | 18 +++++------------
 demos/gtk-demo/main.ui             |  2 +-
 demos/gtk-demo/modelbutton.c       |  8 +++-----
 demos/gtk-demo/modelbutton.ui      |  6 +++---
 demos/gtk-demo/shortcuts.c         | 40 ++++++++++++++-----------------------
 demos/gtk-demo/shortcuts.ui        | 14 ++++++-------
 demos/gtk-demo/spinbutton.c        | 41 +++++++++++++++-----------------------
 demos/gtk-demo/spinbutton.ui       | 12 +++++------
 tests/teststackedheaders.c         |  6 ++----
 16 files changed, 104 insertions(+), 159 deletions(-)
---
diff --git a/demos/gtk-demo/fishbowl.c b/demos/gtk-demo/fishbowl.c
index 49e908781a..5e5e03670f 100644
--- a/demos/gtk-demo/fishbowl.c
+++ b/demos/gtk-demo/fishbowl.c
@@ -226,8 +226,8 @@ set_widget_type (GtkFishbowl *fishbowl,
 }
 
 void
-next_button_clicked_cb (GtkButton *source,
-                        gpointer   user_data)
+fishbowl_next_button_clicked_cb (GtkButton *source,
+                                 gpointer   user_data)
 {
   GtkFishbowl *fishbowl = user_data;
   int new_index;
@@ -241,8 +241,8 @@ next_button_clicked_cb (GtkButton *source,
 }
 
 void
-prev_button_clicked_cb (GtkButton *source,
-                        gpointer   user_data)
+fishbowl_prev_button_clicked_cb (GtkButton *source,
+                                 gpointer   user_data)
 {
   GtkFishbowl *fishbowl = user_data;
   int new_index;
@@ -256,8 +256,8 @@ prev_button_clicked_cb (GtkButton *source,
 }
 
 void
-changes_toggled_cb (GtkToggleButton *button,
-                    gpointer         user_data)
+fishbowl_changes_toggled_cb (GtkToggleButton *button,
+                             gpointer         user_data)
 {
   if (gtk_toggle_button_get_active (button))
     gtk_button_set_icon_name (GTK_BUTTON (button), "changes-prevent");
@@ -266,9 +266,9 @@ changes_toggled_cb (GtkToggleButton *button,
 }
 
 char *
-format_header_cb (GObject *object,
-                  guint    count,
-                  double   fps)
+fishbowl_format_header_cb (GObject *object,
+                           guint    count,
+                           double   fps)
 {
   return g_strdup_printf ("%u Icons, %.2f fps", count, fps);
 }
@@ -291,20 +291,11 @@ do_fishbowl (GtkWidget *do_widget)
   if (!window)
     {
       GtkBuilder *builder;
-      GError *error = NULL;
       GtkWidget *bowl;
 
       g_type_ensure (GTK_TYPE_FISHBOWL);
 
-      builder = gtk_builder_new ();
-      gtk_builder_add_callback_symbols (builder,
-                                        "next_button_clicked_cb", G_CALLBACK (next_button_clicked_cb),
-                                        "prev_button_clicked_cb", G_CALLBACK (prev_button_clicked_cb),
-                                        "changes_toggled_cb", G_CALLBACK (changes_toggled_cb),
-                                        "format_header_cb", G_CALLBACK (format_header_cb),
-                                        NULL);
-      gtk_builder_add_from_resource (builder, "/fishbowl/fishbowl.ui", &error);
-      g_assert_no_error (error);
+      builder = gtk_builder_new_from_resource ("/fishbowl/fishbowl.ui");
       window = GTK_WIDGET (gtk_builder_get_object (builder, "window"));
       g_signal_connect (window, "destroy",
                         G_CALLBACK (gtk_widget_destroyed), &window);
diff --git a/demos/gtk-demo/fishbowl.ui b/demos/gtk-demo/fishbowl.ui
index 2f8d3a69d0..c9caf7a0a7 100644
--- a/demos/gtk-demo/fishbowl.ui
+++ b/demos/gtk-demo/fishbowl.ui
@@ -15,13 +15,13 @@
             <child>
               <object class="GtkButton">
                 <property name="icon-name">pan-start-symbolic</property>
-                <signal name="clicked" handler="prev_button_clicked_cb" object="bowl" swapped="no"/>
+                <signal name="clicked" handler="fishbowl_prev_button_clicked_cb" object="bowl" swapped="no"/>
               </object>
             </child>
             <child>
               <object class="GtkButton">
                 <property name="icon-name">pan-end-symbolic</property>
-                <signal name="clicked" handler="next_button_clicked_cb" object="bowl" swapped="no"/>
+                <signal name="clicked" handler="fishbowl_next_button_clicked_cb" object="bowl" swapped="no"/>
               </object>
             </child>
           </object>
@@ -29,7 +29,7 @@
         <child type="end">
           <object class="GtkLabel">
             <binding name="label">
-              <closure type="gchararray" function="format_header_cb">
+              <closure type="gchararray" function="fishbowl_format_header_cb">
                 <lookup name="count">bowl</lookup>
                 <lookup name="framerate">bowl</lookup>
               </closure>
@@ -40,7 +40,7 @@
           <object class="GtkToggleButton" id="changes_allow">
             <property name="icon-name">changes-allow</property>
             <property name="relief">none</property>
-            <signal name="notify::active" handler="changes_toggled_cb"/>
+            <signal name="notify::active" handler="fishbowl_changes_toggled_cb"/>
           </object>
         </child>
       </object>
diff --git a/demos/gtk-demo/font-features.ui b/demos/gtk-demo/font-features.ui
index dbde04bf03..d9066c6ba6 100644
--- a/demos/gtk-demo/font-features.ui
+++ b/demos/gtk-demo/font-features.ui
@@ -13,7 +13,7 @@
             <property name="can-focus">1</property>
             <property name="receives-default">1</property>
             <property name="tooltip-text">Reset</property>
-            <signal name="clicked" handler="reset" swapped="no"/>
+            <signal name="clicked" handler="font_features_reset_features" swapped="no"/>
             <child>
               <object class="GtkImage">
                 <property name="icon-name">view-refresh-symbolic</property>
@@ -42,7 +42,7 @@
                         <property name="receives-default">1</property>
                         <property name="font">Sans 12</property>
                         <property name="level">family|style|size|variations|features</property>
-                        <signal name="font-set" handler="font_changed" swapped="no"/>
+                        <signal name="font-set" handler="font_features_font_changed" swapped="no"/>
                       </object>
                     </child>
                     <child>
@@ -63,7 +63,7 @@
                               <object class="GtkComboBox" id="script_lang">
                                 <property name="can-focus">1</property>
                                 <property name="margin-top">10</property>
-                                <signal name="changed" handler="script_changed" swapped="no"/>
+                                <signal name="changed" handler="font_features_script_changed" swapped="no"/>
                                 <child>
                                   <object class="GtkCellRendererText"/>
                                   <attributes>
@@ -137,7 +137,7 @@
 Разъяренный чтец эгоистично бьёт пятью жердями шустрого фехтовальщика. Наш банк вчера же выплатил Ф.Я. 
Эйхгольду комиссию за ценные вещи. Эх, чужак, общий съём цен шляп (юфть) – вдрызг! В чащах юга жил бы цитрус? 
Да, но фальшивый экземпляр!
 
 Τάχιστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ νωθρού κυνός</property>
-                        <signal name="activate" handler="stop_edit"/>
+                        <signal name="activate" handler="font_features_stop_edit"/>
                         <property name="valign">start</property>
                         <property name="width-chars">50</property>
                       </object>
@@ -181,7 +181,7 @@
                     <property name="icon-name">document-edit-symbolic</property>
                     <property name="halign">end</property>
                     <property name="valign">end</property>
-                    <signal name="toggled" handler="toggle_edit"/>
+                    <signal name="toggled" handler="font_features_toggle_edit"/>
                   </object>
                 </child>
               </object>
diff --git a/demos/gtk-demo/font_features.c b/demos/gtk-demo/font_features.c
index 3fdc0ec558..ec60ba4444 100644
--- a/demos/gtk-demo/font_features.c
+++ b/demos/gtk-demo/font_features.c
@@ -1109,23 +1109,23 @@ done:
   g_free (design_coords);
 }
 
-static void
-font_changed (void)
+void
+font_features_font_changed (void)
 {
   update_script_combo ();
   update_features ();
   update_font_variations ();
 }
 
-static void
-script_changed (void)
+void
+font_features_script_changed (void)
 {
   update_features ();
   update_display ();
 }
 
-static void
-reset_features (void)
+void
+font_features_reset_features (void)
 {
   GList *l;
 
@@ -1170,8 +1170,8 @@ switch_to_label (void)
   update_display ();
 }
 
-static void
-toggle_edit (void)
+void
+font_features_toggle_edit (void)
 {
   if (strcmp (gtk_stack_get_visible_child_name (GTK_STACK (stack)), "label") == 0)
     switch_to_entry ();
@@ -1179,8 +1179,8 @@ toggle_edit (void)
     switch_to_label ();
 }
 
-static void
-stop_edit (void)
+void
+font_features_stop_edit (void)
 {
   g_signal_emit_by_name (edit_toggle, "clicked");
 }
@@ -1195,7 +1195,7 @@ entry_key_press (GtkEventController *controller,
   if (keyval == GDK_KEY_Escape)
     {
       gtk_editable_set_text (GTK_EDITABLE (entry), text);
-      stop_edit ();
+      font_features_stop_edit ();
       return GDK_EVENT_STOP;
     }
 
@@ -1213,14 +1213,7 @@ do_font_features (GtkWidget *do_widget)
       GtkWidget *feature_list;
       GtkEventController *controller;
 
-      builder = gtk_builder_new ();
-      gtk_builder_add_callback_symbol (builder, "update_display", update_display);
-      gtk_builder_add_callback_symbol (builder, "font_changed", font_changed);
-      gtk_builder_add_callback_symbol (builder, "script_changed", script_changed);
-      gtk_builder_add_callback_symbol (builder, "reset", reset_features);
-      gtk_builder_add_callback_symbol (builder, "stop_edit", G_CALLBACK (stop_edit));
-      gtk_builder_add_callback_symbol (builder, "toggle_edit", G_CALLBACK (toggle_edit));
-      gtk_builder_add_from_resource (builder, "/font_features/font-features.ui", NULL);
+      builder = gtk_builder_new_from_resource ("/font_features/font-features.ui");
 
       window = GTK_WIDGET (gtk_builder_get_object (builder, "window"));
       feature_list = GTK_WIDGET (gtk_builder_get_object (builder, "feature_list"));
@@ -1338,7 +1331,7 @@ do_font_features (GtkWidget *do_widget)
       else
         g_hash_table_remove_all (axes);
 
-      font_changed ();
+      font_features_font_changed ();
 
       g_signal_connect (window, "destroy",
                         G_CALLBACK (gtk_widget_destroyed), &window);
diff --git a/demos/gtk-demo/iconscroll.c b/demos/gtk-demo/iconscroll.c
index c1c8c8e3d2..fafd51930e 100644
--- a/demos/gtk-demo/iconscroll.c
+++ b/demos/gtk-demo/iconscroll.c
@@ -169,9 +169,9 @@ set_widget_type (int type)
   tick_cb = gtk_widget_add_tick_callback (window, scroll_cb, NULL, NULL);
 }
 
-static void
-next_clicked_cb (GtkButton *source,
-                 gpointer   user_data)
+void
+iconscroll_next_clicked_cb (GtkButton *source,
+                            gpointer   user_data)
 {
   int new_index;
 
@@ -184,9 +184,9 @@ next_clicked_cb (GtkButton *source,
   set_widget_type (new_index);
 }
 
-static void
-prev_clicked_cb (GtkButton *source,
-                 gpointer   user_data)
+void
+iconscroll_prev_clicked_cb (GtkButton *source,
+                            gpointer   user_data)
 {
   int new_index;
 
@@ -205,12 +205,7 @@ do_iconscroll (GtkWidget *do_widget)
     {
       GtkBuilder *builder;
 
-      builder = gtk_builder_new ();
-      gtk_builder_add_callback_symbols (builder,
-                                        "next_clicked_cb", G_CALLBACK (next_clicked_cb),
-                                        "prev_clicked_cb", G_CALLBACK (prev_clicked_cb),
-                                        NULL);
-      gtk_builder_add_from_resource (builder, "/iconscroll/iconscroll.ui", NULL);
+      builder = gtk_builder_new_from_resource ("/iconscroll/iconscroll.ui");
       window = GTK_WIDGET (gtk_builder_get_object (builder, "window"));
       g_signal_connect (window, "destroy",
                         G_CALLBACK (gtk_widget_destroyed), &window);
diff --git a/demos/gtk-demo/iconscroll.ui b/demos/gtk-demo/iconscroll.ui
index e1ead1adc8..e9bf7d8a95 100644
--- a/demos/gtk-demo/iconscroll.ui
+++ b/demos/gtk-demo/iconscroll.ui
@@ -15,13 +15,13 @@
             <child>
               <object class="GtkButton">
                 <property name="icon-name">pan-start-symbolic</property>
-                <signal name="clicked" handler="prev_clicked_cb"/>
+                <signal name="clicked" handler="iconscroll_prev_clicked_cb"/>
               </object>
             </child>
             <child>
               <object class="GtkButton">
                 <property name="icon-name">pan-end-symbolic</property>
-                <signal name="clicked" handler="next_clicked_cb"/>
+                <signal name="clicked" handler="iconscroll_next_clicked_cb"/>
               </object>
             </child>
           </object>
diff --git a/demos/gtk-demo/listview_settings.c b/demos/gtk-demo/listview_settings.c
index 4b9df708a9..faee47319b 100644
--- a/demos/gtk-demo/listview_settings.c
+++ b/demos/gtk-demo/listview_settings.c
@@ -116,10 +116,10 @@ strvcmp (gconstpointer p1,
 }
 
 static gboolean
-transform_settings_to_keys (GBinding     *binding,
-                            const GValue *from_value,
-                            GValue       *to_value,
-                            gpointer      unused)
+settings_transform_settings_to_keys (GBinding     *binding,
+                                     const GValue *from_value,
+                                     GValue       *to_value,
+                                     gpointer      unused)
 {
   GtkTreeListRow *treelistrow;
   GSettings *settings;
@@ -219,9 +219,6 @@ do_listview_settings (GtkWidget *do_widget)
       g_type_ensure (SETTINGS_TYPE_KEY);
 
       builder = gtk_builder_new_from_resource ("/listview_settings/listview_settings.ui");
-      gtk_builder_add_callback_symbols (builder,
-                                        "transform_settings_to_keys", G_CALLBACK 
(transform_settings_to_keys),
-                                        NULL);
       window = GTK_WIDGET (gtk_builder_get_object (builder, "window"));
       gtk_window_set_display (GTK_WINDOW (window),
                               gtk_widget_get_display (do_widget));
@@ -241,7 +238,7 @@ do_listview_settings (GtkWidget *do_widget)
       g_object_bind_property_full (selection, "selected-item",
                                    columnview, "model",
                                    G_BINDING_SYNC_CREATE,
-                                   transform_settings_to_keys,
+                                   settings_transform_settings_to_keys,
                                    NULL,
                                    NULL, NULL);
       gtk_list_view_set_model (GTK_LIST_VIEW (listview), G_LIST_MODEL (selection));
diff --git a/demos/gtk-demo/main.c b/demos/gtk-demo/main.c
index 4d98db5f0e..fb56bdf6a0 100644
--- a/demos/gtk-demo/main.c
+++ b/demos/gtk-demo/main.c
@@ -1040,10 +1040,10 @@ scrollbar_popup (GtkWidget *scrollbar, GtkWidget *menu)
   return TRUE;
 }
 
-static void
-listview_activate_cb (GtkListView *listview,
-                      guint        position,
-                      gpointer     user_data)
+void
+gtk_demo_listview_activate_cb (GtkListView *listview,
+                               guint        position,
+                               gpointer     user_data)
 {
   GtkTreeListRow *row = g_list_model_get_item (gtk_list_view_get_model (listview), position);
   GtkDemo *demo = gtk_tree_list_row_get_item (row);
@@ -1055,7 +1055,6 @@ static void
 activate (GApplication *app)
 {
   GtkBuilder *builder;
-  GError *error = NULL;
   GtkWidget *sw;
   GtkWidget *scrollbar;
   GtkWidget *menu;
@@ -1067,14 +1066,7 @@ activate (GApplication *app)
     { "run", activate_run, NULL, NULL, NULL }
   };
 
-  builder = gtk_builder_new ();
-  gtk_builder_add_callback_symbol (builder, "listview_activate_cb", G_CALLBACK (listview_activate_cb));
-  gtk_builder_add_from_resource (builder, "/ui/main.ui", &error);
-  if (error != NULL)
-    {
-      g_critical ("%s", error->message);
-      exit (1);
-    }
+  builder = gtk_builder_new_from_resource ("/ui/main.ui");
 
   window = (GtkWidget *)gtk_builder_get_object (builder, "window");
   gtk_application_add_window (GTK_APPLICATION (app), GTK_WINDOW (window));
diff --git a/demos/gtk-demo/main.ui b/demos/gtk-demo/main.ui
index 3fc5c1559e..3b053a7587 100644
--- a/demos/gtk-demo/main.ui
+++ b/demos/gtk-demo/main.ui
@@ -68,7 +68,7 @@
 
                 <child>
                   <object class="GtkListView" id="listview">
-                    <signal name="activate" handler="listview_activate_cb" swapped="no" />
+                    <signal name="activate" handler="gtk_demo_listview_activate_cb" swapped="no" />
                     <property name="factory">
                       <object class="GtkBuilderListItemFactory">
                         <property name="resource">/ui/main-listitem.ui</property>
diff --git a/demos/gtk-demo/modelbutton.c b/demos/gtk-demo/modelbutton.c
index 0c17537844..a0299228b5 100644
--- a/demos/gtk-demo/modelbutton.c
+++ b/demos/gtk-demo/modelbutton.c
@@ -14,8 +14,8 @@
 
 #include <gtk/gtk.h>
 
-static void
-tool_clicked (GtkButton *button)
+void
+modelbutton_tool_clicked (GtkButton *button)
 {
   gboolean active;
 
@@ -39,9 +39,7 @@ do_modelbutton (GtkWidget *do_widget)
       GtkBuilder *builder;
       GActionGroup *actions;
 
-      builder = gtk_builder_new ();
-      gtk_builder_add_callback_symbol (builder, "tool_clicked", G_CALLBACK (tool_clicked));
-      gtk_builder_add_from_resource (builder, "/modelbutton/modelbutton.ui", NULL);
+      builder = gtk_builder_new_from_resource ("/modelbutton/modelbutton.ui");
       window = GTK_WIDGET (gtk_builder_get_object (builder, "window1"));
       gtk_window_set_display (GTK_WINDOW (window),
                               gtk_widget_get_display (do_widget));
diff --git a/demos/gtk-demo/modelbutton.ui b/demos/gtk-demo/modelbutton.ui
index 438433f09a..5a895e4cfd 100644
--- a/demos/gtk-demo/modelbutton.ui
+++ b/demos/gtk-demo/modelbutton.ui
@@ -101,21 +101,21 @@
           <object class="GtkModelButton">
             <property name="text">Hammer</property>
             <property name="role">check</property>
-            <signal name="clicked" handler="tool_clicked"/>
+            <signal name="clicked" handler="modelbutton_tool_clicked"/>
           </object>
         </child>
         <child>
           <object class="GtkModelButton">
             <property name="text">Screwdriver</property>
             <property name="role">check</property>
-            <signal name="clicked" handler="tool_clicked"/>
+            <signal name="clicked" handler="modelbutton_tool_clicked"/>
           </object>
         </child>
         <child>
           <object class="GtkModelButton">
             <property name="text">Drill</property>
             <property name="role">check</property>
-            <signal name="clicked" handler="tool_clicked"/>
+            <signal name="clicked" handler="modelbutton_tool_clicked"/>
           </object>
         </child>
       </object>
diff --git a/demos/gtk-demo/shortcuts.c b/demos/gtk-demo/shortcuts.c
index 548e052623..b0be7d11cc 100644
--- a/demos/gtk-demo/shortcuts.c
+++ b/demos/gtk-demo/shortcuts.c
@@ -25,44 +25,44 @@ show_shortcuts (GtkWidget   *window,
   g_object_unref (builder);
 }
 
-static void
-builder_shortcuts (GtkWidget *window)
+void
+shortcuts_builder_shortcuts (GtkWidget *window)
 {
   show_shortcuts (window, "shortcuts-builder", NULL);
 }
 
-static void
-gedit_shortcuts (GtkWidget *window)
+void
+shortcuts_gedit_shortcuts (GtkWidget *window)
 {
   show_shortcuts (window, "shortcuts-gedit", NULL);
 }
 
-static void
-clocks_shortcuts (GtkWidget *window)
+void
+shortcuts_clocks_shortcuts (GtkWidget *window)
 {
   show_shortcuts (window, "shortcuts-clocks", NULL);
 }
 
-static void
-clocks_shortcuts_stopwatch (GtkWidget *window)
+void
+shortcuts_clocks_shortcuts_stopwatch (GtkWidget *window)
 {
   show_shortcuts (window, "shortcuts-clocks", "stopwatch");
 }
 
-static void
-boxes_shortcuts (GtkWidget *window)
+void
+shortcuts_boxes_shortcuts (GtkWidget *window)
 {
   show_shortcuts (window, "shortcuts-boxes", NULL);
 }
 
-static void
-boxes_shortcuts_wizard (GtkWidget *window)
+void
+shortcuts_boxes_shortcuts_wizard (GtkWidget *window)
 {
   show_shortcuts (window, "shortcuts-boxes", "wizard");
 }
 
-static void
-boxes_shortcuts_display (GtkWidget *window)
+void
+shortcuts_boxes_shortcuts_display (GtkWidget *window)
 {
   show_shortcuts (window, "shortcuts-boxes", "display");
 }
@@ -85,17 +85,7 @@ do_shortcuts (GtkWidget *do_widget)
     {
       GtkBuilder *builder;
 
-      builder = gtk_builder_new ();
-      gtk_builder_add_callback_symbols (builder,
-                                        "builder_shortcuts", G_CALLBACK (builder_shortcuts),
-                                        "gedit_shortcuts", G_CALLBACK (gedit_shortcuts),
-                                        "clocks_shortcuts", G_CALLBACK (clocks_shortcuts),
-                                        "clocks_shortcuts_stopwatch", G_CALLBACK 
(clocks_shortcuts_stopwatch),
-                                        "boxes_shortcuts", G_CALLBACK (boxes_shortcuts),
-                                        "boxes_shortcuts_wizard", G_CALLBACK (boxes_shortcuts_wizard),
-                                        "boxes_shortcuts_display", G_CALLBACK (boxes_shortcuts_display),
-                                        NULL);
-      gtk_builder_add_from_resource (builder, "/shortcuts/shortcuts.ui", NULL);
+      builder = gtk_builder_new_from_resource ("/shortcuts/shortcuts.ui");
       window = GTK_WIDGET (gtk_builder_get_object (builder, "window1"));
       gtk_window_set_display (GTK_WINDOW (window),
                               gtk_widget_get_display (do_widget));
diff --git a/demos/gtk-demo/shortcuts.ui b/demos/gtk-demo/shortcuts.ui
index 00b885efeb..ca8d08c5bf 100644
--- a/demos/gtk-demo/shortcuts.ui
+++ b/demos/gtk-demo/shortcuts.ui
@@ -10,43 +10,43 @@
         <child>
           <object class="GtkButton">
             <property name="label">Builder</property>
-            <signal name="clicked" handler="builder_shortcuts" swapped="1" object="window1"/>
+            <signal name="clicked" handler="shortcuts_builder_shortcuts" swapped="1" object="window1"/>
           </object>
         </child>
         <child>
           <object class="GtkButton">
             <property name="label">GEdit</property>
-            <signal name="clicked" handler="gedit_shortcuts" swapped="1" object="window1"/>
+            <signal name="clicked" handler="shortcuts_gedit_shortcuts" swapped="1" object="window1"/>
           </object>
         </child>
         <child>
           <object class="GtkButton">
             <property name="label">Clocks - All</property>
-            <signal name="clicked" handler="clocks_shortcuts" swapped="1" object="window1"/>
+            <signal name="clicked" handler="shortcuts_clocks_shortcuts" swapped="1" object="window1"/>
           </object>
         </child>
         <child>
           <object class="GtkButton">
             <property name="label">Clocks - Stopwatch</property>
-            <signal name="clicked" handler="clocks_shortcuts_stopwatch" swapped="1" object="window1"/>
+            <signal name="clicked" handler="shortcuts_clocks_shortcuts_stopwatch" swapped="1" 
object="window1"/>
           </object>
         </child>
         <child>
           <object class="GtkButton">
             <property name="label">Boxes</property>
-            <signal name="clicked" handler="boxes_shortcuts" swapped="1" object="window1"/>
+            <signal name="clicked" handler="shortcuts_boxes_shortcuts" swapped="1" object="window1"/>
           </object>
         </child>
         <child>
           <object class="GtkButton">
             <property name="label">Boxes - Wizard</property>
-            <signal name="clicked" handler="boxes_shortcuts_wizard" swapped="1" object="window1"/>
+            <signal name="clicked" handler="shortcuts_boxes_shortcuts_wizard" swapped="1" object="window1"/>
           </object>
         </child>
         <child>
           <object class="GtkButton">
             <property name="label">Boxes - Display</property>
-            <signal name="clicked" handler="boxes_shortcuts_display" swapped="1" object="window1"/>
+            <signal name="clicked" handler="shortcuts_boxes_shortcuts_display" swapped="1" object="window1"/>
           </object>
         </child>
       </object>
diff --git a/demos/gtk-demo/spinbutton.c b/demos/gtk-demo/spinbutton.c
index b9cddc8434..43ecd9164b 100644
--- a/demos/gtk-demo/spinbutton.c
+++ b/demos/gtk-demo/spinbutton.c
@@ -11,9 +11,9 @@
 #include <math.h>
 #include <stdlib.h>
 
-static gint
-hex_spin_input (GtkSpinButton *spin_button,
-                gdouble       *new_val)
+gint
+spinbutton_hex_spin_input (GtkSpinButton *spin_button,
+                           gdouble       *new_val)
 {
   const gchar *buf;
   gchar *err;
@@ -28,8 +28,8 @@ hex_spin_input (GtkSpinButton *spin_button,
     return TRUE;
 }
 
-static gint
-hex_spin_output (GtkSpinButton *spin_button)
+gint
+spinbutton_hex_spin_output (GtkSpinButton *spin_button)
 {
   GtkAdjustment *adjustment;
   gchar *buf;
@@ -48,9 +48,9 @@ hex_spin_output (GtkSpinButton *spin_button)
   return TRUE;
 }
 
-static gint
-time_spin_input (GtkSpinButton *spin_button,
-                 gdouble       *new_val)
+gint
+spinbutton_time_spin_input (GtkSpinButton *spin_button,
+                            gdouble       *new_val)
 {
   const gchar *text;
   gchar **str;
@@ -87,8 +87,8 @@ time_spin_input (GtkSpinButton *spin_button,
   return TRUE;
 }
 
-static gint
-time_spin_output (GtkSpinButton *spin_button)
+gint
+spinbutton_time_spin_output (GtkSpinButton *spin_button)
 {
   GtkAdjustment *adjustment;
   gchar *buf;
@@ -121,9 +121,9 @@ static gchar *month[12] = {
   "December"
 };
 
-static gint
-month_spin_input (GtkSpinButton *spin_button,
-                  gdouble       *new_val)
+gint
+spinbutton_month_spin_input (GtkSpinButton *spin_button,
+                             gdouble       *new_val)
 {
   gint i;
   gchar *tmp1, *tmp2;
@@ -150,8 +150,8 @@ month_spin_input (GtkSpinButton *spin_button,
   return TRUE;
 }
 
-static gint
-month_spin_output (GtkSpinButton *spin_button)
+gint
+spinbutton_month_spin_output (GtkSpinButton *spin_button)
 {
   GtkAdjustment *adjustment;
   gdouble value;
@@ -190,16 +190,7 @@ do_spinbutton (GtkWidget *do_widget)
     GtkAdjustment *adj;
     GtkWidget *label;
 
-    builder = gtk_builder_new ();
-    gtk_builder_add_callback_symbols (builder,
-                                      "hex_spin_input", G_CALLBACK (hex_spin_input),
-                                      "hex_spin_output", G_CALLBACK (hex_spin_output),
-                                      "time_spin_input", G_CALLBACK (time_spin_input),
-                                      "time_spin_output", G_CALLBACK (time_spin_output),
-                                      "month_spin_input", G_CALLBACK (month_spin_input),
-                                      "month_spin_output", G_CALLBACK (month_spin_output),
-                                      NULL);
-    gtk_builder_add_from_resource (builder, "/spinbutton/spinbutton.ui", NULL);
+    builder = gtk_builder_new_from_resource ("/spinbutton/spinbutton.ui");
     window = GTK_WIDGET (gtk_builder_get_object (builder, "window"));
     gtk_window_set_display (GTK_WINDOW (window),
                             gtk_widget_get_display (do_widget));
diff --git a/demos/gtk-demo/spinbutton.ui b/demos/gtk-demo/spinbutton.ui
index d14058430c..44685f775a 100644
--- a/demos/gtk-demo/spinbutton.ui
+++ b/demos/gtk-demo/spinbutton.ui
@@ -83,8 +83,8 @@
             <property name="halign">start</property>
             <property name="width-chars">4</property>
             <property name="adjustment">hex_adjustment</property>
-            <signal name="input" handler="hex_spin_input"/>
-            <signal name="output" handler="hex_spin_output"/>
+            <signal name="input" handler="spinbutton_hex_spin_input"/>
+            <signal name="output" handler="spinbutton_hex_spin_output"/>
             <property name="wrap">1</property>
             <layout>
               <property name="left-attach">1</property>
@@ -119,8 +119,8 @@
             <property name="halign">start</property>
             <property name="width-chars">5</property>
             <property name="adjustment">time_adjustment</property>
-            <signal name="input" handler="time_spin_input"/>
-            <signal name="output" handler="time_spin_output"/>
+            <signal name="input" handler="spinbutton_time_spin_input"/>
+            <signal name="output" handler="spinbutton_time_spin_output"/>
             <property name="wrap">1</property>
             <layout>
               <property name="left-attach">1</property>
@@ -154,8 +154,8 @@
           <object class="GtkSpinButton" id="month_spin">
             <property name="halign">start</property>
             <property name="width-chars">9</property>
-            <signal name="input" handler="month_spin_input"/>
-            <signal name="output" handler="month_spin_output"/>
+            <signal name="input" handler="spinbutton_month_spin_input"/>
+            <signal name="output" handler="spinbutton_month_spin_output"/>
             <property name="adjustment">month_adjustment</property>
             <property name="wrap">1</property>
             <property name="update-policy">if-valid</property>
diff --git a/tests/teststackedheaders.c b/tests/teststackedheaders.c
index 40a9cb6ef1..7febdd6dea 100644
--- a/tests/teststackedheaders.c
+++ b/tests/teststackedheaders.c
@@ -4,14 +4,14 @@
 static GtkWidget *header_stack;
 static GtkWidget *page_stack;
 
-static void
+void
 back_to_main (GtkButton *button)
 {
   gtk_stack_set_visible_child_name (GTK_STACK (header_stack), "main");
   gtk_stack_set_visible_child_name (GTK_STACK (page_stack), "page1");
 }
 
-static void
+void
 go_to_secondary (GtkButton *button)
 {
   gtk_stack_set_visible_child_name (GTK_STACK (header_stack), "secondary");
@@ -31,8 +31,6 @@ main (int argc, char *argv[])
   gtk_init ();
 
   builder = gtk_builder_new ();
-  gtk_builder_add_callback_symbol (builder, "back_to_main", G_CALLBACK (back_to_main));
-  gtk_builder_add_callback_symbol (builder, "go_to_secondary", G_CALLBACK (go_to_secondary));
   gtk_builder_add_from_file (builder, "teststackedheaders.ui", NULL);
 
   win = (GtkWidget *)gtk_builder_get_object (builder, "window");


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