[gtk+] Assign all g_signal_connect() and friends to gulong variables



commit d6a73fd5b0c8e30b22ed77f5ffa47bed2b506040
Author: Alberto Garcia <agarcia igalia com>
Date:   Fri Oct 8 02:37:23 2010 +0200

    Assign all g_signal_connect() and friends to gulong variables
    
    Fixes https://bugzilla.gnome.org/show_bug.cgi?id=87821

 gtk/gtkbutton.c                    |   14 +++++---------
 gtk/gtkcellrenderercombo.c         |    2 +-
 gtk/gtkclipboard.c                 |    2 +-
 gtk/gtkcombobox.c                  |    8 ++++----
 gtk/gtkimagemenuitem.c             |   14 +++++---------
 gtk/gtkpagesetupunixdialog.c       |    2 +-
 gtk/gtkprintunixdialog.c           |    2 +-
 gtk/gtktextview.c                  |    2 +-
 gtk/gtktoolpalette.c               |    2 +-
 gtk/gtktreemodelfilter.c           |   10 +++++-----
 gtk/gtktreemodelsort.h             |   10 +++++-----
 gtk/gtktreeprivate.h               |    2 +-
 gtk/gtktreeviewcolumn.h            |    6 +++---
 gtk/tests/filtermodel.c            |    2 +-
 modules/other/gail/gailcontainer.c |   23 ++++++-----------------
 modules/other/gail/gaillabel.h     |    2 +-
 tests/prop-editor.c                |    4 ++--
 tests/testcalendar.c               |    2 +-
 tests/testgtk.c                    |    8 ++++----
 19 files changed, 49 insertions(+), 68 deletions(-)
---
diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c
index 2b766e3..ab3fe77 100644
--- a/gtk/gtkbutton.c
+++ b/gtk/gtkbutton.c
@@ -2287,7 +2287,7 @@ gtk_button_screen_changed (GtkWidget *widget,
 {
   GtkButton *button;
   GtkSettings *settings;
-  guint show_image_connection;
+  gulong show_image_connection;
 
   if (!gtk_widget_has_screen (widget))
     return;
@@ -2305,18 +2305,14 @@ gtk_button_screen_changed (GtkWidget *widget,
   settings = gtk_widget_get_settings (widget);
 
   show_image_connection = 
-    GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (settings), 
-					 "gtk-button-connection"));
+    g_signal_handler_find (settings, G_SIGNAL_MATCH_FUNC, 0, 0,
+                           NULL, gtk_button_setting_changed, NULL);
   
   if (show_image_connection)
     return;
 
-  show_image_connection =
-    g_signal_connect (settings, "notify::gtk-button-images",
-		      G_CALLBACK (gtk_button_setting_changed), NULL);
-  g_object_set_data (G_OBJECT (settings), 
-		     I_("gtk-button-connection"),
-		     GUINT_TO_POINTER (show_image_connection));
+  g_signal_connect (settings, "notify::gtk-button-images",
+                    G_CALLBACK (gtk_button_setting_changed), NULL);
 
   show_image_change_notify (button);
 }
diff --git a/gtk/gtkcellrenderercombo.c b/gtk/gtkcellrenderercombo.c
index d23521d..ad154c4 100644
--- a/gtk/gtkcellrenderercombo.c
+++ b/gtk/gtkcellrenderercombo.c
@@ -40,7 +40,7 @@ struct _GtkCellRendererComboPrivate
 
   gint text_column;
 
-  guint focus_out_id;
+  gulong focus_out_id;
 };
 
 
diff --git a/gtk/gtkclipboard.c b/gtk/gtkclipboard.c
index e286d43..7273bd3 100644
--- a/gtk/gtkclipboard.c
+++ b/gtk/gtkclipboard.c
@@ -71,7 +71,7 @@ struct _GtkClipboard
   GdkAtom *cached_targets;
   gint     n_cached_targets;
 
-  guint      notify_signal_id;
+  gulong     notify_signal_id;
   gboolean   storing_selection;
   GMainLoop *store_loop;
   guint      store_timeout;
diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c
index 69f6078..96bb376 100644
--- a/gtk/gtkcombobox.c
+++ b/gtk/gtkcombobox.c
@@ -125,10 +125,10 @@ struct _GtkComboBoxPrivate
   GtkWidget *popup_window;
   GtkWidget *scrolled_window;
 
-  guint inserted_id;
-  guint deleted_id;
-  guint reordered_id;
-  guint changed_id;
+  gulong inserted_id;
+  gulong deleted_id;
+  gulong reordered_id;
+  gulong changed_id;
   guint popup_idle_id;
   guint activate_button;
   guint32 activate_time;
diff --git a/gtk/gtkimagemenuitem.c b/gtk/gtkimagemenuitem.c
index e39c3c1..be43532 100644
--- a/gtk/gtkimagemenuitem.c
+++ b/gtk/gtkimagemenuitem.c
@@ -1045,7 +1045,7 @@ gtk_image_menu_item_screen_changed (GtkWidget *widget,
 				    GdkScreen *previous_screen)
 {
   GtkSettings *settings;
-  guint show_image_connection;
+  gulong show_image_connection;
 
   if (!gtk_widget_has_screen (widget))
     return;
@@ -1053,18 +1053,14 @@ gtk_image_menu_item_screen_changed (GtkWidget *widget,
   settings = gtk_widget_get_settings (widget);
   
   show_image_connection = 
-    GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (settings), 
-					 "gtk-image-menu-item-connection"));
+    g_signal_handler_find (settings, G_SIGNAL_MATCH_FUNC, 0, 0,
+                           NULL, gtk_image_menu_item_setting_changed, NULL);
   
   if (show_image_connection)
     return;
 
-  show_image_connection =
-    g_signal_connect (settings, "notify::gtk-menu-images",
-		      G_CALLBACK (gtk_image_menu_item_setting_changed), NULL);
-  g_object_set_data (G_OBJECT (settings), 
-		     I_("gtk-image-menu-item-connection"),
-		     GUINT_TO_POINTER (show_image_connection));
+  g_signal_connect (settings, "notify::gtk-menu-images",
+                    G_CALLBACK (gtk_image_menu_item_setting_changed), NULL);
 
   show_image_change_notify (GTK_IMAGE_MENU_ITEM (widget));
 }
diff --git a/gtk/gtkpagesetupunixdialog.c b/gtk/gtkpagesetupunixdialog.c
index a7c75b5..3036f5c 100644
--- a/gtk/gtkpagesetupunixdialog.c
+++ b/gtk/gtkpagesetupunixdialog.c
@@ -87,7 +87,7 @@ struct _GtkPageSetupUnixDialogPrivate
   GtkWidget *landscape_radio;
   GtkWidget *reverse_landscape_radio;
 
-  guint request_details_tag;
+  gulong request_details_tag;
   GtkPrinter *request_details_printer;
   
   GtkPrintSettings *print_settings;
diff --git a/gtk/gtkprintunixdialog.c b/gtk/gtkprintunixdialog.c
index 23b4f20..032e1c2 100644
--- a/gtk/gtkprintunixdialog.c
+++ b/gtk/gtkprintunixdialog.c
@@ -248,7 +248,7 @@ struct GtkPrintUnixDialogPrivate
 
   GtkPrinter *current_printer;
   GtkPrinter *request_details_printer;
-  guint request_details_tag;
+  gulong request_details_tag;
   GtkPrinterOptionSet *options;
   gulong options_changed_handler;
   gulong mark_conflicts_id;
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c
index a801281..4b254a0 100644
--- a/gtk/gtktextview.c
+++ b/gtk/gtktextview.c
@@ -118,7 +118,7 @@ struct _GtkTextViewPrivate
   GdkDevice *grab_device;
   GdkDevice *dnd_device;
 
-  guint selection_drag_handler;
+  gulong selection_drag_handler;
   guint scroll_timeout;
 
   GtkTextWindow *text_window;
diff --git a/gtk/gtktoolpalette.c b/gtk/gtktoolpalette.c
index fa60619..a324ced 100644
--- a/gtk/gtktoolpalette.c
+++ b/gtk/gtktoolpalette.c
@@ -138,7 +138,7 @@ struct _GtkToolItemGroupInfo
 {
   GtkToolItemGroup *widget;
 
-  guint             notify_collapsed;
+  gulong            notify_collapsed;
   guint             pos;
   guint             exclusive : 1;
   guint             expand : 1;
diff --git a/gtk/gtktreemodelfilter.c b/gtk/gtktreemodelfilter.c
index 4dee08f..8699462 100644
--- a/gtk/gtktreemodelfilter.c
+++ b/gtk/gtktreemodelfilter.c
@@ -106,11 +106,11 @@ struct _GtkTreeModelFilterPrivate
   gboolean virtual_root_deleted;
 
   /* signal ids */
-  guint changed_id;
-  guint inserted_id;
-  guint has_child_toggled_id;
-  guint deleted_id;
-  guint reordered_id;
+  gulong changed_id;
+  gulong inserted_id;
+  gulong has_child_toggled_id;
+  gulong deleted_id;
+  gulong reordered_id;
 };
 
 /* properties */
diff --git a/gtk/gtktreemodelsort.h b/gtk/gtktreemodelsort.h
index e144b32..bb5910c 100644
--- a/gtk/gtktreemodelsort.h
+++ b/gtk/gtktreemodelsort.h
@@ -62,11 +62,11 @@ struct _GtkTreeModelSort
   GDestroyNotify GSEAL (default_sort_destroy);
 
   /* signal ids */
-  guint GSEAL (changed_id);
-  guint GSEAL (inserted_id);
-  guint GSEAL (has_child_toggled_id);
-  guint GSEAL (deleted_id);
-  guint GSEAL (reordered_id);
+  gulong GSEAL (changed_id);
+  gulong GSEAL (inserted_id);
+  gulong GSEAL (has_child_toggled_id);
+  gulong GSEAL (deleted_id);
+  gulong GSEAL (reordered_id);
 };
 
 struct _GtkTreeModelSortClass
diff --git a/gtk/gtktreeprivate.h b/gtk/gtktreeprivate.h
index 0519db7..1ac35a8 100644
--- a/gtk/gtktreeprivate.h
+++ b/gtk/gtktreeprivate.h
@@ -242,7 +242,7 @@ struct _GtkTreeViewPrivate
   GDestroyNotify search_position_destroy;
   GtkWidget *search_window;
   GtkWidget *search_entry;
-  guint search_entry_changed_id;
+  gulong search_entry_changed_id;
   guint typeselect_flush_timeout;
 
   /* Grid and tree lines */
diff --git a/gtk/gtktreeviewcolumn.h b/gtk/gtktreeviewcolumn.h
index 01f6a2d..a19adf2 100644
--- a/gtk/gtktreeviewcolumn.h
+++ b/gtk/gtktreeviewcolumn.h
@@ -68,7 +68,7 @@ struct _GtkTreeViewColumn
   GdkWindow *GSEAL (window);
   GtkCellEditable *GSEAL (editable_widget);
   gfloat GSEAL (xalign);
-  guint GSEAL (property_changed_signal);
+  gulong GSEAL (property_changed_signal);
   gint GSEAL (spacing);
 
   /* Sizing fields */
@@ -90,8 +90,8 @@ struct _GtkTreeViewColumn
   GList *GSEAL (cell_list);
 
   /* Sorting */
-  guint GSEAL (sort_clicked_signal);
-  guint GSEAL (sort_column_changed_signal);
+  gulong GSEAL (sort_clicked_signal);
+  gulong GSEAL (sort_column_changed_signal);
   gint GSEAL (sort_column_id);
   GtkSortType GSEAL (sort_order);
 
diff --git a/gtk/tests/filtermodel.c b/gtk/tests/filtermodel.c
index 22253e0..fdfc4a1 100644
--- a/gtk/tests/filtermodel.c
+++ b/gtk/tests/filtermodel.c
@@ -167,7 +167,7 @@ typedef struct
 {
   GQueue *queue;
   GtkTreeModel *client;
-  guint signal_ids[LAST_SIGNAL];
+  gulong signal_ids[LAST_SIGNAL];
 }
 SignalMonitor;
 
diff --git a/modules/other/gail/gailcontainer.c b/modules/other/gail/gailcontainer.c
index 8cb314a..81e0c05 100644
--- a/modules/other/gail/gailcontainer.c
+++ b/modules/other/gail/gailcontainer.c
@@ -214,28 +214,17 @@ gail_container_real_initialize (AtkObject *obj,
                                 gpointer  data)
 {
   GailContainer *container = GAIL_CONTAINER (obj);
-  guint handler_id;
 
   ATK_OBJECT_CLASS (gail_container_parent_class)->initialize (obj, data);
 
   container->children = gtk_container_get_children (GTK_CONTAINER (data));
 
-  /*
-   * We store the handler ids for these signals in case some objects
-   * need to remove these handlers.
-   */
-  handler_id = g_signal_connect (data,
-                                 "add",
-                                 G_CALLBACK (gail_container_add_gtk),
-                                 obj);
-  g_object_set_data (G_OBJECT (obj), "gail-add-handler-id", 
-                     GUINT_TO_POINTER (handler_id));
-  handler_id = g_signal_connect (data,
-                                 "remove",
-                                 G_CALLBACK (gail_container_remove_gtk),
-                                 obj);
-  g_object_set_data (G_OBJECT (obj), "gail-remove-handler-id", 
-                     GUINT_TO_POINTER (handler_id));
+  g_signal_connect (data, "add",
+                    G_CALLBACK (gail_container_add_gtk),
+                    obj);
+  g_signal_connect (data, "remove",
+                    G_CALLBACK (gail_container_remove_gtk),
+                    obj);
 
   if (GTK_IS_TOOLBAR (data))
     obj->role = ATK_ROLE_TOOL_BAR;
diff --git a/modules/other/gail/gaillabel.h b/modules/other/gail/gaillabel.h
index 1706aa5..f1012e6 100644
--- a/modules/other/gail/gaillabel.h
+++ b/modules/other/gail/gaillabel.h
@@ -43,7 +43,7 @@ struct _GailLabel
   gint           cursor_position;
   gint           selection_bound;
   gint           label_length;
-  guint          window_create_handler;
+  gulong         window_create_handler;
   gboolean       has_top_level;
 };
 
diff --git a/tests/prop-editor.c b/tests/prop-editor.c
index 0a9a3f8..62b9c7e 100644
--- a/tests/prop-editor.c
+++ b/tests/prop-editor.c
@@ -28,7 +28,7 @@ typedef struct
 {
   gpointer instance;
   GObject *alive_object;
-  guint id;
+  gulong id;
 } DisconnectData;
 
 static void
@@ -102,7 +102,7 @@ typedef struct
 {
   GObject *obj;
   GParamSpec *spec;
-  gint modified_id;
+  gulong modified_id;
 } ObjectProperty;
 
 static void
diff --git a/tests/testcalendar.c b/tests/testcalendar.c
index 2a78229..e490e8e 100644
--- a/tests/testcalendar.c
+++ b/tests/testcalendar.c
@@ -42,7 +42,7 @@ typedef struct _CalendarData
 
   GHashTable    *details_table;
   GtkTextBuffer *details_buffer;
-  guint          details_changed;
+  gulong         details_changed;
 } CalendarData;
 
 enum
diff --git a/tests/testgtk.c b/tests/testgtk.c
index 49a227e..eec04db 100644
--- a/tests/testgtk.c
+++ b/tests/testgtk.c
@@ -3711,7 +3711,7 @@ create_message_dialog (GtkWidget *widget)
 
 static GtkWidget *sw_parent = NULL;
 static GtkWidget *sw_float_parent;
-static guint sw_destroyed_handler = 0;
+static gulong sw_destroyed_handler = 0;
 
 static gboolean
 scrolled_windows_delete_cb (GtkWidget *widget, GdkEventAny *event, GtkWidget *scrollwin)
@@ -5673,8 +5673,8 @@ create_display_screen (GtkWidget *widget)
 
 /* Event Watcher
  */
-static gboolean event_watcher_enter_id = 0;
-static gboolean event_watcher_leave_id = 0;
+static gulong event_watcher_enter_id = 0;
+static gulong event_watcher_leave_id = 0;
 
 static gboolean
 event_watcher (GSignalInvocationHint *ihint,
@@ -8635,7 +8635,7 @@ struct PropertiesData {
   GtkWidget **window;
   GdkCursor *cursor;
   gboolean in_query;
-  gint handler;
+  gulong handler;
 };
 
 static void



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