[gnome-netstatus] Fix -DGSEAL_ENABLE compilation issues. See bug 612476.



commit 597ff7e437b29f7e0f59159d40104f2b08989f3d
Author: Javier Jardón <jjardon gnome org>
Date:   Sun Jun 20 04:28:39 2010 +0200

    Fix -DGSEAL_ENABLE compilation issues. See bug 612476.
    
    Based in a patch from Andre Klapper

 configure.in           |    2 +-
 src/netstatus-applet.c |    2 +-
 src/netstatus-icon.c   |   52 ++++++++++++++++++++++++++++-------------------
 3 files changed, 33 insertions(+), 23 deletions(-)
---
diff --git a/configure.in b/configure.in
index 1ba42c1..40928ab 100644
--- a/configure.in
+++ b/configure.in
@@ -45,7 +45,7 @@ fi
 
 PKG_CHECK_MODULES(NETSTATUS,
 			     libpanelapplet-2.0 >= 2.0.0
-			     gtk+-2.0 >= 2.16.0)
+			     gtk+-2.0 >= 2.20)
 
 AC_CHECK_HEADERS(sys/sockio.h)
 
diff --git a/src/netstatus-applet.c b/src/netstatus-applet.c
index d43c156..af1e3fc 100644
--- a/src/netstatus-applet.c
+++ b/src/netstatus-applet.c
@@ -341,7 +341,7 @@ netstatus_applet_background_changed (NetstatusApplet		*applet,
 	case PANEL_PIXMAP_BACKGROUND: {
 		GtkStyle *style;
 
-		style = gtk_style_copy (GTK_WIDGET (applet)->style);
+		style = gtk_style_copy (gtk_widget_get_style (GTK_WIDGET (applet)));
 
 		if (style->bg_pixmap [GTK_STATE_NORMAL])
 			g_object_unref (style->bg_pixmap [GTK_STATE_NORMAL]);
diff --git a/src/netstatus-icon.c b/src/netstatus-icon.c
index 7b8114f..53bd82a 100644
--- a/src/netstatus-icon.c
+++ b/src/netstatus-icon.c
@@ -605,7 +605,8 @@ netstatus_icon_size_allocate (GtkWidget     *widget,
   NetstatusIcon *icon = (NetstatusIcon *) widget;
   GtkAllocation  child_allocation;
   GObjectClass  *klass;
-  int            size;
+  gint           size;
+  guint          border_width;
 
   if (icon->priv->orientation == GTK_ORIENTATION_HORIZONTAL)
     size = allocation->height;
@@ -619,43 +620,47 @@ netstatus_icon_size_allocate (GtkWidget     *widget,
       netstatus_icon_scale_icons (icon, size);
     }
 
-  if (GTK_WIDGET_REALIZED (widget))
+  if (gtk_widget_get_realized (widget))
     {
-      gdk_window_move_resize (widget->window,
-                              allocation->x + GTK_CONTAINER (widget)->border_width,
-                              allocation->y + GTK_CONTAINER (widget)->border_width,
-                              MAX (allocation->width - GTK_CONTAINER (widget)->border_width * 2, 0),
-			      MAX (allocation->height - GTK_CONTAINER (widget)->border_width * 2, 0));
+      border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
+      gdk_window_move_resize (gtk_widget_get_window (widget),
+                              allocation->x + border_width,
+                              allocation->y + border_width,
+                              MAX (allocation->width - border_width * 2, 0),
+                              MAX (allocation->height - border_width  * 2, 0));
     }
 
   klass = get_box_class (icon->priv->orientation);
 
   child_allocation.x = 0;
   child_allocation.y = 0;
-  child_allocation.width  = MAX (allocation->width  - GTK_CONTAINER (widget)->border_width * 2, 0);
-  child_allocation.height = MAX (allocation->height - GTK_CONTAINER (widget)->border_width * 2, 0);
+  child_allocation.width  = MAX (allocation->width  - border_width * 2, 0);
+  child_allocation.height = MAX (allocation->height - border_width * 2, 0);
 
   if (GTK_WIDGET_CLASS (klass)->size_allocate)
     GTK_WIDGET_CLASS (klass)->size_allocate (widget, &child_allocation);
 
-  widget->allocation = *allocation;
+  gtk_widget_set_allocation (widget, allocation);
 }
 
 static void
 netstatus_icon_realize (GtkWidget *widget)
 {
+  GdkWindow     *window;
   GdkWindowAttr attributes;
+  GtkAllocation allocation;
   int           attributes_mask;
   int           border_width;
 
-  GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
+  gtk_widget_set_realized (widget, TRUE);
   
-  border_width = GTK_CONTAINER (widget)->border_width;
+  border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
 
-  attributes.x = widget->allocation.x + border_width;
-  attributes.y = widget->allocation.y + border_width;
-  attributes.width = widget->allocation.width - 2 * border_width;
-  attributes.height = widget->allocation.height - 2 * border_width;
+  gtk_widget_get_allocation (widget, &allocation);
+  attributes.x = allocation.x + border_width;
+  attributes.y = allocation.y + border_width;
+  attributes.width = allocation.width - 2 * border_width;
+  attributes.height = allocation.height - 2 * border_width;
   attributes.window_type = GDK_WINDOW_CHILD;
   attributes.wclass = GDK_INPUT_OUTPUT;
   attributes.visual = gtk_widget_get_visual (widget);
@@ -670,11 +675,16 @@ netstatus_icon_realize (GtkWidget *widget)
 
   attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
 
-  widget->window = gdk_window_new (gtk_widget_get_parent_window (widget), &attributes, attributes_mask);
-  gdk_window_set_user_data (widget->window, widget);
+  window = gdk_window_new (gtk_widget_get_parent_window (widget),
+                           &attributes,
+                           attributes_mask);
+  gtk_widget_set_window (widget, window);
+  gdk_window_set_user_data (window, widget);
 
-  widget->style = gtk_style_attach (widget->style, widget->window);
-  gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
+  gtk_widget_style_attach (widget);
+  gtk_style_set_background (gtk_widget_get_style (widget),
+                            window,
+                            GTK_STATE_NORMAL);
 }
 
 static gboolean
@@ -850,7 +860,7 @@ netstatus_icon_instance_init (NetstatusIcon      *icon,
 {
   icon->priv = g_new0 (NetstatusIconPrivate, 1);
 
-  GTK_WIDGET_UNSET_FLAGS (icon, GTK_NO_WINDOW);
+  gtk_widget_set_has_window (GTK_WIDGET (icon), TRUE);
 
   icon->priv->iface            = NULL;
   icon->priv->state            = NETSTATUS_STATE_DISCONNECTED;



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