Bug 468804 - casting to pointer explicitely in g_object_set_data() calls; r+sr=roc
authorWolfgang Rosenauer <wr@rosenauer.org>
Wed, 10 Dec 2008 16:53:28 +0100
changeset 22572 c901f771b072327faef29afa0ceed1427d114fee
parent 22571 72a4c2b4e1608f743e71f09565e52e98c2b34f8e
child 22573 cda0ae16a8a8ebf85d77dd807316e86552aa18ee
push idunknown
push userunknown
push dateunknown
bugs468804
milestone1.9.2a1pre
Bug 468804 - casting to pointer explicitely in g_object_set_data() calls; r+sr=roc
widget/src/gtk2/gtk2drawing.c
--- a/widget/src/gtk2/gtk2drawing.c
+++ b/widget/src/gtk2/gtk2drawing.c
@@ -137,17 +137,17 @@ setup_widget_prototype(GtkWidget* widget
     ensure_window_widget();
     if (!protoLayout) {
         protoLayout = gtk_fixed_new();
         gtk_container_add(GTK_CONTAINER(gProtoWindow), protoLayout);
     }
 
     gtk_container_add(GTK_CONTAINER(protoLayout), widget);
     gtk_widget_realize(widget);
-    g_object_set_data(G_OBJECT(widget), "transparent-bg-hint", TRUE);
+    g_object_set_data(G_OBJECT(widget), "transparent-bg-hint", GINT_TO_POINTER(TRUE));
     return MOZ_GTK_SUCCESS;
 }
 
 static gint
 ensure_button_widget()
 {
     if (!gButtonWidget) {
         gButtonWidget = gtk_button_new_with_label("M");
@@ -282,17 +282,17 @@ ensure_entry_widget()
 static void
 moz_gtk_get_combo_box_inner_button(GtkWidget *widget, gpointer client_data)
 {
     if (GTK_IS_TOGGLE_BUTTON(widget)) {
         gComboBoxButtonWidget = widget;
         g_object_add_weak_pointer(G_OBJECT(widget),
                                   (gpointer) &gComboBoxButtonWidget);
         gtk_widget_realize(widget);
-        g_object_set_data(G_OBJECT(widget), "transparent-bg-hint", TRUE);
+        g_object_set_data(G_OBJECT(widget), "transparent-bg-hint", GINT_TO_POINTER(TRUE));
     }
 }
 
 static void
 moz_gtk_get_combo_box_button_inner_widgets(GtkWidget *widget,
                                            gpointer client_data)
 {
     if (GTK_IS_SEPARATOR(widget)) {
@@ -301,17 +301,17 @@ moz_gtk_get_combo_box_button_inner_widge
                                   (gpointer) &gComboBoxSeparatorWidget);
     } else if (GTK_IS_ARROW(widget)) {
         gComboBoxArrowWidget = widget;
         g_object_add_weak_pointer(G_OBJECT(widget),
                                   (gpointer) &gComboBoxArrowWidget);
     } else
         return;
     gtk_widget_realize(widget);
-    g_object_set_data(G_OBJECT(widget), "transparent-bg-hint", TRUE);
+    g_object_set_data(G_OBJECT(widget), "transparent-bg-hint", GINT_TO_POINTER(TRUE));
 }
 
 static gint
 ensure_combo_box_widgets()
 {
     GtkWidget* buttonChild;
 
     if (gComboBoxButtonWidget && gComboBoxArrowWidget)
@@ -342,17 +342,17 @@ ensure_combo_box_widgets()
         } else if(GTK_IS_ARROW(buttonChild)) {
             /* appears-as-list = TRUE, or cell-view = FALSE;
              * the button only contains an arrow */
             gComboBoxArrowWidget = buttonChild;
             g_object_add_weak_pointer(G_OBJECT(buttonChild), (gpointer)
                                       &gComboBoxArrowWidget);
             gtk_widget_realize(gComboBoxArrowWidget);
             g_object_set_data(G_OBJECT(gComboBoxArrowWidget),
-                              "transparent-bg-hint", TRUE);
+                              "transparent-bg-hint", GINT_TO_POINTER(TRUE));
         }
     } else {
         /* Shouldn't be reached with current internal gtk implementation; we
          * use a generic toggle button as last resort fallback to avoid
          * crashing. */
         ensure_toggle_button_widget();
         gComboBoxButtonWidget = gToggleButtonWidget;
     }
@@ -392,28 +392,28 @@ moz_gtk_get_combo_box_entry_inner_widget
                                   (gpointer) &gComboBoxEntryButtonWidget);
     } else if (GTK_IS_ENTRY(widget)) {
         gComboBoxEntryTextareaWidget = widget;
         g_object_add_weak_pointer(G_OBJECT(widget),
                                   (gpointer) &gComboBoxEntryTextareaWidget);
     } else
         return;
     gtk_widget_realize(widget);
-    g_object_set_data(G_OBJECT(widget), "transparent-bg-hint", TRUE);
+    g_object_set_data(G_OBJECT(widget), "transparent-bg-hint", GINT_TO_POINTER(TRUE));
 }
 
 static void
 moz_gtk_get_combo_box_entry_arrow(GtkWidget *widget, gpointer client_data)
 {
     if (GTK_IS_ARROW(widget)) {
         gComboBoxEntryArrowWidget = widget;
         g_object_add_weak_pointer(G_OBJECT(widget),
                                   (gpointer) &gComboBoxEntryArrowWidget);
         gtk_widget_realize(widget);
-        g_object_set_data(G_OBJECT(widget), "transparent-bg-hint", TRUE);
+        g_object_set_data(G_OBJECT(widget), "transparent-bg-hint", GINT_TO_POINTER(TRUE));
     }
 }
 
 static gint
 ensure_combo_box_entry_widgets()
 {
     GtkWidget* buttonChild;
 
@@ -455,17 +455,17 @@ ensure_combo_box_entry_widgets()
         } else if(GTK_IS_ARROW(buttonChild)) {
             /* appears-as-list = TRUE, or cell-view = FALSE;
              * the button only contains an arrow */
             gComboBoxEntryArrowWidget = buttonChild;
             g_object_add_weak_pointer(G_OBJECT(buttonChild), (gpointer)
                                       &gComboBoxEntryArrowWidget);
             gtk_widget_realize(gComboBoxEntryArrowWidget);
             g_object_set_data(G_OBJECT(gComboBoxEntryArrowWidget),
-                              "transparent-bg-hint", TRUE);
+                              "transparent-bg-hint", GINT_TO_POINTER(TRUE));
         }
     } else {
         /* Shouldn't be reached with current internal gtk implementation;
          * we use a generic toggle button as last resort fallback to avoid
          * crashing. */
         ensure_toggle_button_widget();
         gComboBoxEntryButtonWidget = gToggleButtonWidget;
     }
@@ -495,17 +495,17 @@ ensure_handlebox_widget()
 static gint
 ensure_toolbar_widget()
 {
     if (!gToolbarWidget) {
         ensure_handlebox_widget();
         gToolbarWidget = gtk_toolbar_new();
         gtk_container_add(GTK_CONTAINER(gHandleBoxWidget), gToolbarWidget);
         gtk_widget_realize(gToolbarWidget);
-        g_object_set_data(G_OBJECT(gToolbarWidget), "transparent-bg-hint", TRUE);
+        g_object_set_data(G_OBJECT(gToolbarWidget), "transparent-bg-hint", GINT_TO_POINTER(TRUE));
     }
     return MOZ_GTK_SUCCESS;
 }
 
 static gint
 ensure_toolbar_separator_widget()
 {
     if (!gToolbarSeparatorWidget) {
@@ -584,92 +584,92 @@ ensure_menu_bar_item_widget()
 {
     if (!gMenuBarItemWidget) {
         ensure_menu_bar_widget();
         gMenuBarItemWidget = gtk_menu_item_new();
         gtk_menu_shell_append(GTK_MENU_SHELL(gMenuBarWidget),
                               gMenuBarItemWidget);
         gtk_widget_realize(gMenuBarItemWidget);
         g_object_set_data(G_OBJECT(gMenuBarItemWidget),
-                          "transparent-bg-hint", TRUE);
+                          "transparent-bg-hint", GINT_TO_POINTER(TRUE));
     }
     return MOZ_GTK_SUCCESS;
 }
 
 static gint
 ensure_menu_popup_widget()
 {
     if (!gMenuPopupWidget) {
         ensure_menu_bar_item_widget();
         gMenuPopupWidget = gtk_menu_new();
         gtk_menu_item_set_submenu(GTK_MENU_ITEM(gMenuBarItemWidget),
                                   gMenuPopupWidget);
         gtk_widget_realize(gMenuPopupWidget);
         g_object_set_data(G_OBJECT(gMenuPopupWidget),
-                          "transparent-bg-hint", TRUE);
+                          "transparent-bg-hint", GINT_TO_POINTER(TRUE));
     }
     return MOZ_GTK_SUCCESS;
 }
 
 static gint
 ensure_menu_item_widget()
 {
     if (!gMenuItemWidget) {
         ensure_menu_popup_widget();
         gMenuItemWidget = gtk_menu_item_new_with_label("M");
         gtk_menu_shell_append(GTK_MENU_SHELL(gMenuPopupWidget),
                               gMenuItemWidget);
         gtk_widget_realize(gMenuItemWidget);
         g_object_set_data(G_OBJECT(gMenuItemWidget),
-                          "transparent-bg-hint", TRUE);
+                          "transparent-bg-hint", GINT_TO_POINTER(TRUE));
     }
     return MOZ_GTK_SUCCESS;
 }
 
 static gint
 ensure_image_menu_item_widget()
 {
     if (!gImageMenuItemWidget) {
         ensure_menu_popup_widget();
         gImageMenuItemWidget = gtk_image_menu_item_new();
         gtk_menu_shell_append(GTK_MENU_SHELL(gMenuPopupWidget),
                               gImageMenuItemWidget);
         gtk_widget_realize(gImageMenuItemWidget);
         g_object_set_data(G_OBJECT(gImageMenuItemWidget),
-                          "transparent-bg-hint", TRUE);
+                          "transparent-bg-hint", GINT_TO_POINTER(TRUE));
     }
     return MOZ_GTK_SUCCESS;
 }
 
 static gint
 ensure_menu_separator_widget()
 {
     if (!gMenuSeparatorWidget) {
         ensure_menu_popup_widget();
         gMenuSeparatorWidget = gtk_separator_menu_item_new();
         gtk_menu_shell_append(GTK_MENU_SHELL(gMenuPopupWidget),
                               gMenuSeparatorWidget);
         gtk_widget_realize(gMenuSeparatorWidget);
         g_object_set_data(G_OBJECT(gMenuSeparatorWidget),
-                          "transparent-bg-hint", TRUE);
+                          "transparent-bg-hint", GINT_TO_POINTER(TRUE));
     }
     return MOZ_GTK_SUCCESS;
 }
 
 static gint
 ensure_check_menu_item_widget()
 {
     if (!gCheckMenuItemWidget) {
         ensure_menu_popup_widget();
         gCheckMenuItemWidget = gtk_check_menu_item_new_with_label("M");
         gtk_menu_shell_append(GTK_MENU_SHELL(gMenuPopupWidget),
                               gCheckMenuItemWidget);
         gtk_widget_realize(gCheckMenuItemWidget);
         g_object_set_data(G_OBJECT(gCheckMenuItemWidget),
-                          "transparent-bg-hint", TRUE);
+                          "transparent-bg-hint", GINT_TO_POINTER(TRUE));
     }
     return MOZ_GTK_SUCCESS;
 }
 
 static gint
 ensure_tree_view_widget()
 {
     if (!gTreeViewWidget) {
@@ -714,19 +714,19 @@ ensure_tree_header_cell_widget()
         lastTreeViewColumn = gtk_tree_view_column_new();
         gtk_tree_view_column_set_title(lastTreeViewColumn, "M");
         gtk_tree_view_append_column(GTK_TREE_VIEW(gTreeViewWidget), lastTreeViewColumn);
 
         /* Use the middle column's header for our button */
         gTreeHeaderCellWidget = GTK_TREE_VIEW_COLUMN(gMiddleTreeViewColumn)->button;
         gTreeHeaderSortArrowWidget = GTK_TREE_VIEW_COLUMN(gMiddleTreeViewColumn)->arrow;
         g_object_set_data(G_OBJECT(gTreeHeaderCellWidget),
-                          "transparent-bg-hint", TRUE);
+                          "transparent-bg-hint", GINT_TO_POINTER(TRUE));
         g_object_set_data(G_OBJECT(gTreeHeaderSortArrowWidget),
-                          "transparent-bg-hint", TRUE);
+                          "transparent-bg-hint", GINT_TO_POINTER(TRUE));
     }
     return MOZ_GTK_SUCCESS;
 }
 
 static gint
 ensure_expander_widget()
 {
     if (!gExpanderWidget) {
@@ -1528,21 +1528,21 @@ moz_gtk_entry_paint(GdkDrawable* drawabl
     /* GTK fills the outer widget window with the base color before drawing the widget.
      * Some older themes rely on this behavior, but many themes nowadays use rounded
      * corners on their widgets. While most GTK apps are blissfully unaware of this
      * problem due to their use of the default window background, we render widgets on
      * many kinds of backgrounds on the web.
      * If the theme is able to cope with transparency, then we can skip pre-filling
      * and notify the theme it will paint directly on the canvas. */
     if (theme_honors_transparency) {
-        g_object_set_data(G_OBJECT(widget), "transparent-bg-hint", TRUE);
+        g_object_set_data(G_OBJECT(widget), "transparent-bg-hint", GINT_TO_POINTER(TRUE));
     } else {
         gdk_draw_rectangle(drawable, style->base_gc[bg_state], TRUE,
                            cliprect->x, cliprect->y, cliprect->width, cliprect->height);
-        g_object_set_data(G_OBJECT(widget), "transparent-bg-hint", FALSE);
+        g_object_set_data(G_OBJECT(widget), "transparent-bg-hint", GINT_TO_POINTER(FALSE));
     }
 
     /* Get the position of the inner window, see _gtk_entry_get_borders */
     x = XTHICKNESS(style);
     y = YTHICKNESS(style);
 
     if (!interior_focus) {
         x += focus_width;