[gtk-engines] Do not use any sealed values.



commit 310623ab12e73b3578b7904b7332f33ded18d45a
Author: Benjamin Berg <benjamin sipsolutions net>
Date:   Tue Jun 29 21:51:37 2010 +0200

    Do not use any sealed values.

 engines/clearlooks/src/clearlooks_draw.c          |   16 ++--
 engines/clearlooks/src/clearlooks_draw_glossy.c   |   16 ++--
 engines/clearlooks/src/clearlooks_draw_gummy.c    |   16 ++--
 engines/clearlooks/src/clearlooks_draw_inverted.c |   16 ++--
 engines/clearlooks/src/clearlooks_style.c         |   55 ++---------
 engines/clearlooks/src/clearlooks_types.h         |    7 +-
 engines/clearlooks/src/support.c                  |  103 ++------------------
 engines/crux/src/crux-draw.c                      |   22 ++--
 engines/glide/src/glide_gtk2_drawing.c            |  106 ++++++++++++--------
 engines/glide/src/glide_gtk2_support.c            |   27 +++---
 engines/hc/src/hc-style.c                         |   20 ++--
 engines/hc/src/hc_gtk2_support.c                  |   26 +++---
 engines/industrial/src/industrial_style.c         |   23 +++--
 engines/mist/src/mist-style.c                     |   13 ++-
 engines/redmond/src/redmond_gtk2_drawing.c        |  109 +++++++++++---------
 engines/redmond/src/redmond_gtk2_misc.c           |   26 +++---
 engines/support/widget-information.h              |    2 +-
 themes/Clearlooks/gtk-3.0/gtkrc-common            |    1 +
 18 files changed, 264 insertions(+), 340 deletions(-)
---
diff --git a/engines/clearlooks/src/clearlooks_draw.c b/engines/clearlooks/src/clearlooks_draw.c
index 426f3e5..56a142e 100644
--- a/engines/clearlooks/src/clearlooks_draw.c
+++ b/engines/clearlooks/src/clearlooks_draw.c
@@ -1755,12 +1755,12 @@ clearlooks_draw_scrollbar_stepper (cairo_t *cr,
 
 	if (scrollbar->horizontal)
 	{
-		if (stepper->stepper == CL_STEPPER_A)
+		if (stepper->stepper == CL_STEPPER_START)
 			corners = CR_CORNER_TOPLEFT | CR_CORNER_BOTTOMLEFT;
-		else if (stepper->stepper == CL_STEPPER_D)
+		else if (stepper->stepper == CL_STEPPER_END)
 			corners = CR_CORNER_TOPRIGHT | CR_CORNER_BOTTOMRIGHT;
 
-		if (stepper->stepper == CL_STEPPER_B)
+/*		if (stepper->stepper == CL_STEPPER_B)
 		{
 			x -= 1;
 			width += 1;
@@ -1768,16 +1768,16 @@ clearlooks_draw_scrollbar_stepper (cairo_t *cr,
 		else if (stepper->stepper == CL_STEPPER_C)
 		{
 			width += 1;
-		}
+		}*/
 	}
 	else
 	{
-		if (stepper->stepper == CL_STEPPER_A)
+		if (stepper->stepper == CL_STEPPER_START)
 			corners = CR_CORNER_TOPLEFT | CR_CORNER_TOPRIGHT;
-		else if (stepper->stepper == CL_STEPPER_D)
+		else if (stepper->stepper == CL_STEPPER_END)
 			corners = CR_CORNER_BOTTOMLEFT | CR_CORNER_BOTTOMRIGHT;
 
-		if (stepper->stepper == CL_STEPPER_B)
+/*		if (stepper->stepper == CL_STEPPER_B)
 		{
 			y -= 1;
 			height += 1;
@@ -1785,7 +1785,7 @@ clearlooks_draw_scrollbar_stepper (cairo_t *cr,
 		else if (stepper->stepper == CL_STEPPER_C)
 		{
 			height += 1;
-		}
+		}*/
 	}
 
 	cairo_translate (cr, x, y);
diff --git a/engines/clearlooks/src/clearlooks_draw_glossy.c b/engines/clearlooks/src/clearlooks_draw_glossy.c
index 5c4bc64..232363e 100644
--- a/engines/clearlooks/src/clearlooks_draw_glossy.c
+++ b/engines/clearlooks/src/clearlooks_draw_glossy.c
@@ -928,12 +928,12 @@ clearlooks_glossy_draw_scrollbar_stepper (cairo_t *cr,
 	
 	if (scrollbar->horizontal)
 	{
-		if (stepper->stepper == CL_STEPPER_A)
+		if (stepper->stepper == CL_STEPPER_START)
 			corners = CR_CORNER_TOPLEFT | CR_CORNER_BOTTOMLEFT;
-		else if (stepper->stepper == CL_STEPPER_D)
+		else if (stepper->stepper == CL_STEPPER_END)
 			corners = CR_CORNER_TOPRIGHT | CR_CORNER_BOTTOMRIGHT;
 
-		if (stepper->stepper == CL_STEPPER_B)
+/*		if (stepper->stepper == CL_STEPPER_B)
 		{
 			x -= 1;
 			width += 1;
@@ -941,16 +941,16 @@ clearlooks_glossy_draw_scrollbar_stepper (cairo_t *cr,
 		else if (stepper->stepper == CL_STEPPER_C)
 		{
 			width += 1;
-		}
+		}*/
 	}
 	else
 	{
-		if (stepper->stepper == CL_STEPPER_A)
+		if (stepper->stepper == CL_STEPPER_START)
 			corners = CR_CORNER_TOPLEFT | CR_CORNER_TOPRIGHT;
-		else if (stepper->stepper == CL_STEPPER_D)
+		else if (stepper->stepper == CL_STEPPER_END)
 			corners = CR_CORNER_BOTTOMLEFT | CR_CORNER_BOTTOMRIGHT;
 
-		if (stepper->stepper == CL_STEPPER_B)
+/*		if (stepper->stepper == CL_STEPPER_B)
 		{
 			y -= 1;
 			height += 1;
@@ -958,7 +958,7 @@ clearlooks_glossy_draw_scrollbar_stepper (cairo_t *cr,
 		else if (stepper->stepper == CL_STEPPER_C)
 		{
 			height += 1;
-		}
+		}*/
 	}
 	
 	cairo_translate (cr, x, y);
diff --git a/engines/clearlooks/src/clearlooks_draw_gummy.c b/engines/clearlooks/src/clearlooks_draw_gummy.c
index 50a327a..7965c5d 100644
--- a/engines/clearlooks/src/clearlooks_draw_gummy.c
+++ b/engines/clearlooks/src/clearlooks_draw_gummy.c
@@ -992,12 +992,12 @@ clearlooks_gummy_draw_scrollbar_stepper (cairo_t                          *cr,
 
 	if (scrollbar->horizontal)
 	{
-		if (stepper->stepper == CL_STEPPER_A)
+		if (stepper->stepper == CL_STEPPER_START)
 			corners = CR_CORNER_TOPLEFT | CR_CORNER_BOTTOMLEFT;
-		else if (stepper->stepper == CL_STEPPER_D)
+		else if (stepper->stepper == CL_STEPPER_END)
 			corners = CR_CORNER_TOPRIGHT | CR_CORNER_BOTTOMRIGHT;
 
-		if (stepper->stepper == CL_STEPPER_B)
+/*		if (stepper->stepper == CL_STEPPER_B)
 		{
 			x -= 1;
 			width += 1;
@@ -1005,16 +1005,16 @@ clearlooks_gummy_draw_scrollbar_stepper (cairo_t                          *cr,
 		else if (stepper->stepper == CL_STEPPER_C)
 		{
 			width += 1;
-		}
+		}*/
 	}
 	else
 	{
-		if (stepper->stepper == CL_STEPPER_A)
+		if (stepper->stepper == CL_STEPPER_START)
 			corners = CR_CORNER_TOPLEFT | CR_CORNER_TOPRIGHT;
-		else if (stepper->stepper == CL_STEPPER_D)
+		else if (stepper->stepper == CL_STEPPER_END)
 			corners = CR_CORNER_BOTTOMLEFT | CR_CORNER_BOTTOMRIGHT;
 
-		if (stepper->stepper == CL_STEPPER_B)
+/*		if (stepper->stepper == CL_STEPPER_B)
 		{
 			y -= 1;
 			height += 1;
@@ -1022,7 +1022,7 @@ clearlooks_gummy_draw_scrollbar_stepper (cairo_t                          *cr,
 		else if (stepper->stepper == CL_STEPPER_C)
 		{
 			height += 1;
-		}
+		}*/
 	}
 
 	cairo_translate (cr, x, y);
diff --git a/engines/clearlooks/src/clearlooks_draw_inverted.c b/engines/clearlooks/src/clearlooks_draw_inverted.c
index 1bcf000..5ee14e4 100644
--- a/engines/clearlooks/src/clearlooks_draw_inverted.c
+++ b/engines/clearlooks/src/clearlooks_draw_inverted.c
@@ -768,12 +768,12 @@ clearlooks_inverted_draw_scrollbar_stepper (cairo_t *cr,
 
 	if (scrollbar->horizontal)
 	{
-		if (stepper->stepper == CL_STEPPER_A)
+		if (stepper->stepper == CL_STEPPER_START)
 			corners = CR_CORNER_TOPLEFT | CR_CORNER_BOTTOMLEFT;
-		else if (stepper->stepper == CL_STEPPER_D)
+		else if (stepper->stepper == CL_STEPPER_END)
 			corners = CR_CORNER_TOPRIGHT | CR_CORNER_BOTTOMRIGHT;
 
-		if (stepper->stepper == CL_STEPPER_B)
+/*		if (stepper->stepper == CL_STEPPER_B)
 		{
 			x -= 1;
 			width += 1;
@@ -781,16 +781,16 @@ clearlooks_inverted_draw_scrollbar_stepper (cairo_t *cr,
 		else if (stepper->stepper == CL_STEPPER_C)
 		{
 			width += 1;
-		}
+		}*/
 	}
 	else
 	{
-		if (stepper->stepper == CL_STEPPER_A)
+		if (stepper->stepper == CL_STEPPER_START)
 			corners = CR_CORNER_TOPLEFT | CR_CORNER_TOPRIGHT;
-		else if (stepper->stepper == CL_STEPPER_D)
+		else if (stepper->stepper == CL_STEPPER_END)
 			corners = CR_CORNER_BOTTOMLEFT | CR_CORNER_BOTTOMRIGHT;
 
-		if (stepper->stepper == CL_STEPPER_B)
+/*		if (stepper->stepper == CL_STEPPER_B)
 		{
 			y -= 1;
 			height += 1;
@@ -798,7 +798,7 @@ clearlooks_inverted_draw_scrollbar_stepper (cairo_t *cr,
 		else if (stepper->stepper == CL_STEPPER_C)
 		{
 			height += 1;
-		}
+		}*/
 	}
 	
 	cairo_translate (cr, x, y);
diff --git a/engines/clearlooks/src/clearlooks_style.c b/engines/clearlooks/src/clearlooks_style.c
index 7d2189a..3982e85 100644
--- a/engines/clearlooks/src/clearlooks_style.c
+++ b/engines/clearlooks/src/clearlooks_style.c
@@ -734,8 +734,6 @@ clearlooks_style_draw_box (DRAW_ARGS)
 	{
 		WidgetParameters params;
 		ScrollBarParameters scrollbar;
-		gboolean trough_under_steppers = TRUE;
-		ClearlooksStepper steppers;
 
 		clearlooks_set_widget_parameters (widget, style, state_type, &params);
 		params.corners = CR_CORNER_ALL;
@@ -743,8 +741,6 @@ clearlooks_style_draw_box (DRAW_ARGS)
 		scrollbar.horizontal = TRUE;
 		scrollbar.junction   = clearlooks_scrollbar_get_junction (widget);
 		
-		steppers = clearlooks_scrollbar_visible_steppers (widget);
-
 		if (CHECK_HINT (GE_HINT_HSCROLLBAR))
 			scrollbar.horizontal = TRUE;
 		else if (CHECK_HINT (GE_HINT_VSCROLLBAR))
@@ -752,44 +748,6 @@ clearlooks_style_draw_box (DRAW_ARGS)
 		else /* Fallback based on the size  ... */
 			scrollbar.horizontal = width >= height;
 
-		if (widget)
-			gtk_widget_style_get (widget,
-			                      "trough-under-steppers", &trough_under_steppers,
-			                      NULL);
-
-		if (trough_under_steppers && clearlooks_style->style != CL_STYLE_GNOME3)
-		{
-			/* If trough under steppers is set, then we decrease the size
-			 * slightly. The size is decreased so that the trough is not
-			 * visible underneath the steppers. This is not really needed
-			 * as one can use the trough-under-steppers style property,
-			 * but it needs to exist for backward compatibility. */
-			if (scrollbar.horizontal)
-			{
-				if (steppers & (CL_STEPPER_A | CL_STEPPER_B))
-				{
-					x += 2;
-					width -= 2;
-				}
-				if (steppers & (CL_STEPPER_C | CL_STEPPER_D))
-				{
-					width -= 2;
-				}
-			}
-			else
-			{
-				if (steppers & (CL_STEPPER_A | CL_STEPPER_B))
-				{
-					y += 2;
-					height -= 2;
-				}
-				if (steppers & (CL_STEPPER_C | CL_STEPPER_D))
-				{
-					height -= 2;
-				}
-			}
-		}
-
 		STYLE_FUNCTION(draw_scrollbar_trough) (cr, colors, &params, &scrollbar,
 		                                       x, y, width, height);
 	}
@@ -1041,7 +999,7 @@ clearlooks_style_draw_box (DRAW_ARGS)
 			STYLE_FUNCTION(draw_menuitem) (cr, colors, &params, x, y, width, height);
 		}
 	}
-	else if (DETAIL ("hscrollbar") || DETAIL ("vscrollbar")) /* This can't be "stepper" for scrollbars ... */
+	else if (detail && (g_str_has_prefix (detail, "hscrollbar") || g_str_has_prefix (detail, "vscrollbar"))) /* This can't be "stepper" for scrollbars ... */
 	{
 		WidgetParameters    params;
 		ScrollBarParameters scrollbar;
@@ -1063,9 +1021,16 @@ clearlooks_style_draw_box (DRAW_ARGS)
 		if (clearlooks_style->colorize_scrollbar || clearlooks_style->has_scrollbar_color)
 			scrollbar.has_color = TRUE;
 
-		scrollbar.horizontal = DETAIL ("hscrollbar");
+		scrollbar.horizontal = g_str_has_prefix (detail, "hscrollbar");
 
-		stepper.stepper = clearlooks_scrollbar_get_stepper (widget, &this_rectangle);
+		if (g_str_equal(detail + 10, "_start"))
+			stepper.stepper = CL_STEPPER_START;
+		else if (g_str_equal(detail + 10, "_end"))
+			stepper.stepper = CL_STEPPER_END;
+		else if (g_str_equal(detail + 10, "_middle"))
+			stepper.stepper = CL_STEPPER_MIDDLE;
+		else
+			stepper.stepper = CL_STEPPER_UNKNOWN;
 
 		STYLE_FUNCTION(draw_scrollbar_stepper) (cr, colors, &params, &scrollbar, &stepper,
 		                                        x, y, width, height);
diff --git a/engines/clearlooks/src/clearlooks_types.h b/engines/clearlooks/src/clearlooks_types.h
index fae088f..f1414d0 100644
--- a/engines/clearlooks/src/clearlooks_types.h
+++ b/engines/clearlooks/src/clearlooks_types.h
@@ -51,10 +51,9 @@ typedef enum
 typedef enum
 {
 	CL_STEPPER_UNKNOWN    = 0,
-	CL_STEPPER_A          = 1,
-	CL_STEPPER_B          = 2,
-	CL_STEPPER_C          = 4,
-	CL_STEPPER_D          = 8
+	CL_STEPPER_START      = 1,
+	CL_STEPPER_MIDDLE     = 2,
+	CL_STEPPER_END        = 4,
 } ClearlooksStepper;
 
 typedef enum
diff --git a/engines/clearlooks/src/support.c b/engines/clearlooks/src/support.c
index 540720d..916e815 100644
--- a/engines/clearlooks/src/support.c
+++ b/engines/clearlooks/src/support.c
@@ -93,94 +93,6 @@ clearlooks_get_parent_bg (const GtkWidget *widget, CairoColor *color)
 	ge_gdk_color_to_cairo (gcolor, color);
 }
 
-ClearlooksStepper
-clearlooks_scrollbar_get_stepper (GtkWidget    *widget,
-                       GdkRectangle *stepper)
-{
-	ClearlooksStepper value = CL_STEPPER_UNKNOWN;
-	GdkRectangle tmp;
-	GdkRectangle check_rectangle;
-	GtkOrientation orientation;
-	GtkAllocation allocation;
-
-	if (!GE_IS_RANGE (widget))
-		return CL_STEPPER_UNKNOWN;
-
-	gtk_widget_get_allocation (widget, &allocation);
-	check_rectangle.x      = allocation.x;
-	check_rectangle.y      = allocation.y;
-	check_rectangle.width  = stepper->width;
-	check_rectangle.height = stepper->height;
-	
-	orientation = gtk_orientable_get_orientation (GTK_ORIENTABLE (widget));
-	
-	if (allocation.x == -1 && allocation.y == -1)
-		return CL_STEPPER_UNKNOWN;
-		
-	if (gdk_rectangle_intersect (stepper, &check_rectangle, &tmp))
-		value = CL_STEPPER_A;
-
-	if (value == CL_STEPPER_UNKNOWN) /* Haven't found a match */
-	{
-		if (orientation == GTK_ORIENTATION_HORIZONTAL)
-			check_rectangle.x = allocation.x + stepper->width;
-		else
-			check_rectangle.y = allocation.y + stepper->height;
-		
-		if (gdk_rectangle_intersect (stepper, &check_rectangle, &tmp))
-			value = CL_STEPPER_B;
-	}
-
-	if (value == CL_STEPPER_UNKNOWN) /* Still haven't found a match */
-	{
-		if (orientation == GTK_ORIENTATION_HORIZONTAL)
-			check_rectangle.x = allocation.x + allocation.width - (stepper->width * 2);
-		else
-			check_rectangle.y = allocation.y + allocation.height - (stepper->height * 2);
-		
-		if (gdk_rectangle_intersect (stepper, &check_rectangle, &tmp))
-			value = CL_STEPPER_C;
-	}
-
-	if (value == CL_STEPPER_UNKNOWN) /* STILL haven't found a match */
-	{
-		if (orientation == GTK_ORIENTATION_HORIZONTAL)
-			check_rectangle.x = allocation.x + allocation.width - stepper->width;
-		else
-			check_rectangle.y = allocation.y + allocation.height - stepper->height;
-		
-		if (gdk_rectangle_intersect (stepper, &check_rectangle, &tmp))
-			value = CL_STEPPER_D;
-	}
-	
-	return value;
-}
-
-ClearlooksStepper
-clearlooks_scrollbar_visible_steppers (GtkWidget *widget)
-{
-	ClearlooksStepper steppers = 0;
-	
-	/* If this is not a range widget, assume that the primary steppers
-	 * are present. */
-	if (!GE_IS_RANGE (widget))
-		return CL_STEPPER_A | CL_STEPPER_D;
-	
-	if (GTK_RANGE (widget)->has_stepper_a)
-		steppers |= CL_STEPPER_A;
-	
-	if (GTK_RANGE (widget)->has_stepper_b)
-		steppers |= CL_STEPPER_B;
-
-	if (GTK_RANGE (widget)->has_stepper_c)
-		steppers |= CL_STEPPER_C;
-
-	if (GTK_RANGE (widget)->has_stepper_d)
-		steppers |= CL_STEPPER_D;
-
-	return steppers;
-}
-
 ClearlooksJunction
 clearlooks_scrollbar_get_junction (GtkWidget    *widget)
 {	
@@ -190,10 +102,11 @@ clearlooks_scrollbar_get_junction (GtkWidget    *widget)
 	if (!GE_IS_RANGE (widget))
 		return CL_JUNCTION_NONE;
 
-	adj = GTK_RANGE (widget)->adjustment;
-	
-	if (adj->value <= adj->lower &&
-		(GTK_RANGE (widget)->has_stepper_a || GTK_RANGE (widget)->has_stepper_b))
+	adj = gtk_range_get_adjustment(GTK_RANGE (widget));
+
+	/* XXX: fix the stepper detection, possibly by reading out the scrollbars style properties */
+	if (gtk_adjustment_get_value(adj) <= gtk_adjustment_get_lower(adj) /*&&
+		(GTK_RANGE (widget)->has_stepper_a || GTK_RANGE (widget)->has_stepper_b)*/)
 	{
 		if (!gtk_range_get_inverted (GTK_RANGE (widget)))
 			junction |= CL_JUNCTION_BEGIN;
@@ -201,8 +114,8 @@ clearlooks_scrollbar_get_junction (GtkWidget    *widget)
 			junction |= CL_JUNCTION_END;
 	}
 	
-	if (adj->value >= adj->upper - adj->page_size &&
-		(GTK_RANGE (widget)->has_stepper_c || GTK_RANGE (widget)->has_stepper_d))
+	if (gtk_adjustment_get_value(adj) >= gtk_adjustment_get_upper(adj) - gtk_adjustment_get_page_size(adj) /*&&
+		(GTK_RANGE (widget)->has_stepper_c || GTK_RANGE (widget)->has_stepper_d)*/)
 	{
 		if (!gtk_range_get_inverted (GTK_RANGE (widget)))
 			junction |= CL_JUNCTION_END;
@@ -227,7 +140,7 @@ clearlooks_set_toolbar_parameters (ToolbarParameters *toolbar,
 	if (x == 0 && y == 0) {
 		if (widget && allocation.x == 0 && allocation.y == 0)
 		{
-			if (widget->window == window && GE_IS_TOOLBAR (widget))
+			if (gtk_widget_get_window(widget) == window && GE_IS_TOOLBAR (widget))
 			{
 				toolbar->topmost = TRUE;
 			}
diff --git a/engines/crux/src/crux-draw.c b/engines/crux/src/crux-draw.c
index b587562..671d343 100644
--- a/engines/crux/src/crux-draw.c
+++ b/engines/crux/src/crux-draw.c
@@ -826,7 +826,7 @@ draw_shadow (GtkStyle *style,
 	if (widget != NULL && gtk_widget_has_focus (widget))
 		focused = TRUE;
 
-	if (widget && (GE_IS_COMBO (widget->parent) || GE_IS_COMBO_BOX_ENTRY (widget->parent)))
+	if (widget && (GE_IS_COMBO (gtk_widget_get_parent (widget)) || GE_IS_COMBO_BOX_ENTRY (gtk_widget_get_parent (widget))))
 	{
 		GtkWidget *button;
 		if (ge_widget_is_ltr (widget))
@@ -839,10 +839,10 @@ draw_shadow (GtkStyle *style,
 
 		if (area == NULL)
 			area = &area2;
-		g_object_set_data ((GObject*) widget->parent, "entry", widget);
-		button = g_object_get_data ((GObject*) widget->parent, "button");
+		g_object_set_data ((GObject*) gtk_widget_get_parent (widget), "entry", widget);
+		button = g_object_get_data ((GObject*) gtk_widget_get_parent (widget), "button");
 		if (GE_IS_WIDGET (button))
-			gtk_widget_queue_draw_area (button,  button->allocation.x, button->allocation.y, button->allocation.width,button->allocation.height);
+			gtk_widget_queue_draw (button);
 	}
 
 	if (widget && GTK_IS_SPIN_BUTTON (widget))
@@ -937,13 +937,13 @@ draw_box (GtkStyle *style,
 			extra_shadow = FALSE;
 		}
 
-		if (widget && (GE_IS_COMBO (widget->parent) || GE_IS_COMBO_BOX_ENTRY (widget->parent)))
+		if (widget && (GE_IS_COMBO (gtk_widget_get_parent (widget)) || GE_IS_COMBO_BOX_ENTRY (gtk_widget_get_parent (widget))))
 		{
 			/* Combobox buttons */
 			GtkWidget *entry;
 			gboolean entry_focused = FALSE;
 
-			if ((entry = g_object_get_data ((GObject*) widget->parent, "entry")))
+			if ((entry = g_object_get_data ((GObject*) gtk_widget_get_parent (widget), "entry")))
 			{
 				entry_focused = (gtk_widget_has_focus (entry));
 				state_type = gtk_widget_get_state (entry);
@@ -956,7 +956,7 @@ draw_box (GtkStyle *style,
 			cairo_rectangle (cr, x, y, width, height);
 			cairo_fill (cr);
 
-			g_object_set_data ((GObject*) widget->parent, "button", widget);
+			g_object_set_data ((GObject*) gtk_widget_get_parent (widget), "button", widget);
 
 			if (ge_widget_is_ltr (widget))
 				paint_entry_shadow (cr, style, state_type, entry_focused, x - 4, y, width + 4, height);
@@ -967,7 +967,7 @@ draw_box (GtkStyle *style,
 			width -= 6; height -= 6;
 			extra_shadow = FALSE;
 		}
-		if (widget && (GE_IS_TREE_VIEW (widget->parent)))
+		if (widget && (GE_IS_TREE_VIEW (gtk_widget_get_parent (widget))))
 		{
 			/* Add some extra padding for treeview column buttons */
 			if (state_type == GTK_STATE_INSENSITIVE)
@@ -1072,11 +1072,11 @@ draw_box (GtkStyle *style,
 			|| DETAIL ("handlebox_bin") || DETAIL ("dockitem"))
 		{
 			/* make the handle and child widget appear as one */
-			if (widget && widget->parent && GTK_IS_HANDLE_BOX (widget->parent))
+			if (widget && gtk_widget_get_parent (widget) && GTK_IS_HANDLE_BOX (gtk_widget_get_parent (widget)))
 			{
 				GtkPositionType position;
-				position = gtk_handle_box_get_handle_position (GTK_HANDLE_BOX (widget->parent));
-				if (!ge_widget_is_ltr (widget->parent))
+				position = gtk_handle_box_get_handle_position (GTK_HANDLE_BOX (gtk_widget_get_parent (widget)));
+				if (!ge_widget_is_ltr (gtk_widget_get_parent (widget)))
 				{
 					if (position == GTK_POS_TOP) position = GTK_POS_BOTTOM;
 					else if (position == GTK_POS_BOTTOM) position = GTK_POS_TOP;
diff --git a/engines/glide/src/glide_gtk2_drawing.c b/engines/glide/src/glide_gtk2_drawing.c
index 3d4cc3e..28afed5 100644
--- a/engines/glide/src/glide_gtk2_drawing.c
+++ b/engines/glide/src/glide_gtk2_drawing.c
@@ -489,8 +489,10 @@ glide_draw_shadow (GtkStyle * style,
 
 		if (GE_IS_WIDGET(button))
 		{
-			gtk_widget_queue_draw_area(button, button->allocation.x, button->allocation.y, 
-							button->allocation.width, button->allocation.height);
+			GtkAllocation allocation;
+			gtk_widget_get_allocation (button, &allocation);
+			gtk_widget_queue_draw_area(button, allocation.x, allocation.y, 
+							allocation.width, allocation.height);
 		}
 
 		g_object_set_data(combo_parent, "entry", widget);
@@ -617,7 +619,7 @@ glide_draw_combobox_button (GtkStyle * style,
   }
   else
   {
-		GList *child=NULL,*children = gtk_container_get_children (GTK_CONTAINER(widget->parent));
+		GList *child=NULL,*children = gtk_container_get_children (GTK_CONTAINER(gtk_widget_get_parent (widget)));
 
 		for (child = children; child; child = child->next)
 		{
@@ -652,12 +654,12 @@ glide_draw_combobox_button (GtkStyle * style,
         {
           if (!ge_is_combo_box_entry (widget))
             {
-              if ((widget->parent))
+              if ((gtk_widget_get_parent (widget)))
                 {
-                  gtk_widget_ensure_style(widget->parent);
+                  gtk_widget_ensure_style(gtk_widget_get_parent (widget));
 
-                  parent_style = widget->parent->style;
-                  parent_state = widget->parent->state;
+                  parent_style = gtk_widget_get_style (gtk_widget_get_parent (widget));
+                  parent_state = gtk_widget_get_state (gtk_widget_get_parent (widget));
                 }
 
 	      if (parent_state != GTK_STATE_INSENSITIVE)
@@ -685,15 +687,15 @@ glide_draw_combobox_button (GtkStyle * style,
         {
           GtkWidget *parent = widget;
       
-          if (widget->parent)
-            parent = widget->parent;
+          if (gtk_widget_get_parent (widget))
+            parent = gtk_widget_get_parent (widget);
         
           if ((parent))
             {
               gtk_widget_ensure_style(parent);
 
-              parent_style = parent->style;
-              parent_state = parent->state;
+              parent_style = gtk_widget_get_style (parent);
+              parent_state = gtk_widget_get_state (parent);
             }
 
           if (parent_state != GTK_STATE_INSENSITIVE)
@@ -738,12 +740,12 @@ glide_draw_combobox_button (GtkStyle * style,
         {
           if (!ge_is_combo_box_entry (widget))
             {
-              if ((widget->parent))
+              if ((gtk_widget_get_parent (widget)))
                 {
-                  gtk_widget_ensure_style(widget->parent);
+                  gtk_widget_ensure_style(gtk_widget_get_parent (widget));
 
-                  parent_style = widget->parent->style;
-                  parent_state = widget->parent->state;
+                  parent_style = gtk_widget_get_style (gtk_widget_get_parent (widget));
+                  parent_state = gtk_widget_get_state (gtk_widget_get_parent (widget));
                 }
 
               if (parent_state != GTK_STATE_INSENSITIVE)
@@ -777,15 +779,15 @@ glide_draw_combobox_button (GtkStyle * style,
         {
           GtkWidget *parent = widget;
       
-          if (widget->parent)
-            parent = widget->parent;
+          if (gtk_widget_get_parent (widget))
+            parent = gtk_widget_get_parent (widget);
         
           if ((parent))
             {
               gtk_widget_ensure_style(parent);
 
-              parent_style = parent->style;
-              parent_state = parent->state;
+              parent_style = gtk_widget_get_style (parent);
+              parent_state = gtk_widget_get_state (parent);
             }
 
           if (parent_state != GTK_STATE_INSENSITIVE)
@@ -890,6 +892,7 @@ glide_draw_spinbutton_stepper (GtkStyle * style,
 
   if ((!(widget)) || (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR))
    {
+      GtkRequisition requisition;
       if (CHECK_DETAIL (detail, "spinbutton_up"))
 	{
 	  glide_draw_flat_box (style, window, parent_state,
@@ -914,7 +917,12 @@ glide_draw_spinbutton_stepper (GtkStyle * style,
 	  glide_draw_shadow (style, window, state_type, shadow_type, area, widget, detail,
                                 x, y + thick + focus, width - thick - focus, height - thick - focus);
 
-	if (!widget || (widget->requisition.height / 2) != (widget->requisition.height + 1) / 2)
+	if (widget)
+	{
+		gtk_widget_get_requisition (widget, &requisition);
+	}
+
+	if (!widget || (requisition.height / 2) != (requisition.height + 1) / 2)
 	{
 		glide_draw_arrow (style, window, state_type, shadow_type, area, NULL, "spinbutton_arrow", GTK_ARROW_UP, TRUE,
 					x + thick/2, y + thick + 1, width - thick*2, height - thick*2 + 1);
@@ -955,7 +963,7 @@ glide_draw_spinbutton_stepper (GtkStyle * style,
 	  glide_draw_shadow (style, window, state_type, shadow_type, area, widget, detail,
 			    x, y , width - thick - focus, height - thick - focus);
 
-	if (!widget || (widget->requisition.height / 2) != (widget->requisition.height + 1) / 2)
+	if (!widget || (requisition.height / 2) != (requisition.height + 1) / 2)
 	{
 		glide_draw_arrow (style, window, state_type, shadow_type, area, NULL, "spinbutton_arrow", GTK_ARROW_DOWN, TRUE,
 					x + thick/2, y + thick/2 + 1 - focus, width - thick*2, height - thick*2 - 2);
@@ -977,6 +985,9 @@ glide_draw_spinbutton_stepper (GtkStyle * style,
     }
   else
     {
+      GtkRequisition requisition;
+      gtk_widget_get_requisition (widget, &requisition);
+
       if (CHECK_DETAIL (detail, "spinbutton_up"))
 	{
 	  glide_draw_flat_box (style, window, parent_state,
@@ -998,7 +1009,9 @@ glide_draw_spinbutton_stepper (GtkStyle * style,
 	  glide_draw_shadow (style, window, state_type, shadow_type, area, widget, detail, 
 				x + thick + focus, y + thick + focus , width - thick - focus, height - thick - focus);
 
-	if ((widget->requisition.height / 2) != (widget->requisition.height + 1) / 2)
+
+
+	if ((requisition.height / 2) != (requisition.height + 1) / 2)
 	{
 		glide_draw_arrow (style, window, state_type, shadow_type, area, NULL, "spinbutton_arrow", GTK_ARROW_UP, TRUE,
 					x + thick + focus, y + thick - 1 + focus, width - thick, height - thick + 1);
@@ -1036,7 +1049,7 @@ glide_draw_spinbutton_stepper (GtkStyle * style,
                                 x + thick + focus, y, width - thick - focus, height - thick - focus);
 
 
-	if ((widget->requisition.height / 2) != (widget->requisition.height + 1) / 2)
+	if ((requisition.height / 2) != (requisition.height + 1) / 2)
 	{
 		glide_draw_arrow (style, window, state_type, shadow_type, area, NULL, "spinbutton_arrow", GTK_ARROW_DOWN, TRUE,
 					x + thick + focus, y + 1 - focus, width - thick, height - thick - 2);
@@ -1198,14 +1211,14 @@ glide_draw_box (GtkStyle * style,
     {
       if (((CHECK_DETAIL (detail, "dockitem_bin")) && 
            (GE_IS_BONOBO_DOCK_ITEM(widget))) || 
-          ((widget) && (ge_is_bonobo_dock_item(widget->parent))))
+          ((widget) && (ge_is_bonobo_dock_item(gtk_widget_get_parent (widget)))))
 	{	  
 	  GList *children = NULL, *child = NULL;
 	  GtkWidget *dockitem = widget;
 	  gboolean has_grip = FALSE, ltr = TRUE;
 	  
 	  if ((!GE_IS_BONOBO_DOCK_ITEM(widget)) && (!GE_IS_BOX(widget)))
-	    dockitem = widget->parent;
+	    dockitem = gtk_widget_get_parent (widget);
 	    
 	  has_grip = GE_IS_CONTAINER(dockitem);
 	  
@@ -1219,11 +1232,13 @@ glide_draw_box (GtkStyle * style,
                           
             for (child = g_list_first(children); child; child = g_list_next(child))
               {
+                GtkAllocation allocation;
+                gtk_widget_get_allocation (GTK_WIDGET(child->data), &allocation);
 	        if (GE_IS_BONOBO_DOCK_ITEM_GRIP(child->data))
                   has_grip = (gtk_widget_get_visible (child->data) && 
                               gtk_widget_get_realized(child->data) && 
-                              GTK_WIDGET(child->data)->allocation.width > 1) &&
-                              (GTK_WIDGET(child->data)->allocation.height > 1);
+                              allocation.width > 1) &&
+                              (allocation.height > 1);
               }	            
  
             if (children)   
@@ -1273,7 +1288,7 @@ glide_draw_box (GtkStyle * style,
       /* If this is a menu embedded in the gnome-panel, we don't
        *  draw a border since it looks cleaner without one.
        */
-      if ((shadow_type != GTK_SHADOW_NONE) && (widget) && (widget->parent) &&
+      if ((shadow_type != GTK_SHADOW_NONE) && (widget) && (gtk_widget_get_parent (widget)) &&
 	  ((!((CHECK_DETAIL (detail, "menubar")) && 
 	  ge_is_panel_widget_item (widget)))))
         {
@@ -1304,7 +1319,7 @@ glide_draw_box (GtkStyle * style,
 	   && (widget && GE_IS_PROGRESS_BAR (widget)))
     { 
 gboolean vertical = TRUE;
-			switch (GTK_PROGRESS_BAR(widget)->orientation) 
+			switch (gtk_progress_bar_get_orientation (GTK_PROGRESS_BAR(widget))) 
 			{
 				case GTK_PROGRESS_LEFT_TO_RIGHT:
 				case GTK_PROGRESS_RIGHT_TO_LEFT:
@@ -1772,10 +1787,13 @@ glide_draw_extension (GtkStyle * style,
 
 	if (widget && (GE_IS_NOTEBOOK (widget)))
 	{
-		widget_x = (widget->allocation.x + GTK_CONTAINER (widget)->border_width);
-		widget_y = (widget->allocation.y + GTK_CONTAINER (widget)->border_width);
-		widget_width = (widget->allocation.width - 2*GTK_CONTAINER (widget)->border_width);
-		widget_height = (widget->allocation.height - 2*GTK_CONTAINER (widget)->border_width);
+		GtkAllocation allocation;
+		gtk_widget_get_allocation (widget, &allocation);
+
+		widget_x = (allocation.x + gtk_container_get_border_width (GTK_CONTAINER (widget)));
+		widget_y = (allocation.y + gtk_container_get_border_width (GTK_CONTAINER (widget)));
+		widget_width = (allocation.width - 2*gtk_container_get_border_width (GTK_CONTAINER (widget)));
+		widget_height = (allocation.height - 2*gtk_container_get_border_width (GTK_CONTAINER (widget)));
 	}
 
 	pattern = glide_style->bg_solid[state_type];
@@ -1959,10 +1977,14 @@ glide_draw_handle (GtkStyle * style,
      (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) && 
       orientation == (GTK_ORIENTATION_HORIZONTAL))
   {
-    x = widget->parent->allocation.width - widget->allocation.width;
-    y = widget->parent->allocation.height - widget->allocation.height;
-    width = widget->allocation.width;
-    height = widget->allocation.height;
+    GtkAllocation allocation, parent_allocation;
+    gtk_widget_get_allocation (widget, &allocation);
+    gtk_widget_get_allocation (gtk_widget_get_parent (widget), &parent_allocation);
+    
+    x = parent_allocation.width - allocation.width;
+    y = parent_allocation.height - allocation.height;
+    width = allocation.width;
+    height = allocation.height;
     
     area = NULL;
   }
@@ -2073,11 +2095,11 @@ glide_draw_handle (GtkStyle * style,
 
           if (GE_IS_BONOBO_DOCK_ITEM_GRIP(widget))
             {
-              if GE_IS_BOX(widget->parent)
+              if GE_IS_BOX(gtk_widget_get_parent (widget))
                 {
                   GList *children = NULL, *child = NULL;
  
-                  children = gtk_container_get_children(GTK_CONTAINER(widget->parent));
+                  children = gtk_container_get_children(GTK_CONTAINER(gtk_widget_get_parent (widget)));
               
                   for (child = g_list_first(children); child; child = g_list_next(child))
                     {
@@ -2181,8 +2203,10 @@ glide_draw_focus(GtkStyle *style,
 
 			if (GE_IS_WIDGET(button))
 			{
-				gtk_widget_queue_draw_area(button, button->allocation.x, button->allocation.y, 
-								button->allocation.width, button->allocation.height);
+				GtkAllocation allocation;
+				gtk_widget_get_allocation (button, &allocation);
+				gtk_widget_queue_draw_area(button, allocation.x, allocation.y, 
+								allocation.width, allocation.height);
 			}
 
 			if ((!widget) || (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR))
diff --git a/engines/glide/src/glide_gtk2_support.c b/engines/glide/src/glide_gtk2_support.c
index f2e2364..0a825df 100644
--- a/engines/glide/src/glide_gtk2_support.c
+++ b/engines/glide/src/glide_gtk2_support.c
@@ -1115,7 +1115,7 @@ glide_gtk2_engine_hack_menu_shell_motion(GtkWidget *widget,
       GdkModifierType pointer_mask;
       GList *children = NULL, *child = NULL;
      
-      gdk_window_get_pointer(widget->window, &pointer_x, &pointer_y, &pointer_mask);
+      gdk_window_get_pointer(gtk_widget_get_window (widget), &pointer_x, &pointer_y, &pointer_mask);
 	    
       if (GE_IS_CONTAINER(widget))
         {
@@ -1126,12 +1126,15 @@ glide_gtk2_engine_hack_menu_shell_motion(GtkWidget *widget,
 	      if ((child->data) && GE_IS_WIDGET(child->data) && 
                   (gtk_widget_get_state (GTK_WIDGET(child->data)) != GTK_STATE_INSENSITIVE))
 	        {
-	          if ((pointer_x >= GTK_WIDGET(child->data)->allocation.x) && 
-	              (pointer_y >= GTK_WIDGET(child->data)->allocation.y) &&
-	              (pointer_x < (GTK_WIDGET(child->data)->allocation.x + 
-	                              GTK_WIDGET(child->data)->allocation.width)) && 
-	              (pointer_y < (GTK_WIDGET(child->data)->allocation.y +
-	                              GTK_WIDGET(child->data)->allocation.height)))
+	          GtkAllocation allocation;
+	          gtk_widget_get_allocation (GTK_WIDGET (child->data), &allocation);
+
+	          if ((pointer_x >= allocation.x) && 
+	              (pointer_y >= allocation.y) &&
+	              (pointer_x < (allocation.x + 
+	                              allocation.width)) && 
+	              (pointer_y < (allocation.y +
+	                              allocation.height)))
 	            {
                       gtk_widget_set_state (GTK_WIDGET(child->data), GTK_STATE_PRELIGHT);
 	            }
@@ -1174,11 +1177,11 @@ glide_gtk2_engine_hack_menu_shell_leave(GtkWidget *widget,
 	      if ((child->data) && GE_IS_MENU_ITEM(child->data) && 
                   (gtk_widget_get_state (GTK_WIDGET(child->data)) != GTK_STATE_INSENSITIVE))
 	        {
-                  if ((!GE_IS_MENU(GTK_MENU_ITEM(child->data)->submenu)) || 
-                      (!(gtk_widget_get_realized(GTK_MENU_ITEM(child->data)->submenu) && 
-                         gtk_widget_get_visible (GTK_MENU_ITEM(child->data)->submenu) &&
-                         gtk_widget_get_realized(GTK_MENU(GTK_MENU_ITEM(child->data)->submenu)->toplevel) &&
-                         gtk_widget_get_visible (GTK_MENU(GTK_MENU_ITEM(child->data)->submenu)->toplevel))))
+	          GtkWidget *submenu;
+	          submenu = gtk_menu_item_get_submenu (GTK_MENU_ITEM (child->data));
+                  if ((!GE_IS_MENU(submenu)) || 
+                      (!(gtk_widget_get_realized(submenu) && 
+                         gtk_widget_get_visible (submenu))))
 	          {
                     gtk_widget_set_state (GTK_WIDGET(child->data), GTK_STATE_NORMAL);
                   }
diff --git a/engines/hc/src/hc-style.c b/engines/hc/src/hc-style.c
index a34bbc1..8e959fc 100644
--- a/engines/hc/src/hc-style.c
+++ b/engines/hc/src/hc-style.c
@@ -103,7 +103,7 @@ hc_draw_shadow(GtkStyle * style,
 		/* Force Border To Use Foreground Widget State */
 		if (widget)
 		{
-			foreground = HC_STYLE(style)->color_cube.fg[widget->state];
+			foreground = HC_STYLE(style)->color_cube.fg[gtk_widget_get_state(widget)];
 		}
 	}
 
@@ -111,7 +111,7 @@ hc_draw_shadow(GtkStyle * style,
 	/* Entry - Force Border To Use Foreground Matching Widget State */
 	if (CHECK_DETAIL(detail, "entry") && !ge_is_combo(widget))
 	{
-		foreground = HC_STYLE(style)->color_cube.fg[widget ? widget->state : GTK_STATE_NORMAL];
+		foreground = HC_STYLE(style)->color_cube.fg[widget ? gtk_widget_get_state(widget) : GTK_STATE_NORMAL];
 	}
 
 
@@ -131,10 +131,10 @@ hc_draw_shadow(GtkStyle * style,
 
 
 		/* Force Border To Use Foreground Matching Parent State */
-		if ((widget) && (widget->parent))
+		if ((widget) && (gtk_widget_get_parent(widget)))
 		{
-			gtk_widget_ensure_style(widget->parent);
-			ge_gdk_color_to_cairo(&widget->parent->style->fg[gtk_widget_get_state (widget)], &foreground);
+			gtk_widget_ensure_style(gtk_widget_get_parent(widget));
+			ge_gdk_color_to_cairo(&gtk_widget_get_style(gtk_widget_get_parent(widget))->fg[gtk_widget_get_state (widget)], &foreground);
 		}
 	}
 
@@ -281,10 +281,12 @@ hc_draw_extension (GtkStyle       *style,
 	 */
 	if (widget && (GE_IS_NOTEBOOK (widget)))
 	{
-		widget_x = (widget->allocation.x + GTK_CONTAINER (widget)->border_width);
-		widget_y = (widget->allocation.y + GTK_CONTAINER (widget)->border_width);
-		widget_width = (widget->allocation.width - 2*GTK_CONTAINER (widget)->border_width);
-		widget_height = (widget->allocation.height - 2*GTK_CONTAINER (widget)->border_width);
+		GtkAllocation allocation;
+		gtk_widget_get_allocation (widget, &allocation);
+		widget_x = (allocation.x + gtk_container_get_border_width (GTK_CONTAINER (widget)));
+		widget_y = (allocation.y + gtk_container_get_border_width (GTK_CONTAINER (widget)));
+		widget_width = (allocation.width - 2*gtk_container_get_border_width (GTK_CONTAINER (widget)));
+		widget_height = (allocation.height - 2*gtk_container_get_border_width (GTK_CONTAINER (widget)));
 	}
 
 	switch (gap_side)
diff --git a/engines/hc/src/hc_gtk2_support.c b/engines/hc/src/hc_gtk2_support.c
index e2657ed..f93d342 100644
--- a/engines/hc/src/hc_gtk2_support.c
+++ b/engines/hc/src/hc_gtk2_support.c
@@ -335,7 +335,7 @@ hc_gtk2_engine_hack_menu_shell_motion(GtkWidget *widget,
       GdkModifierType pointer_mask;
       GList *children = NULL, *child = NULL;
      
-      gdk_window_get_pointer(widget->window, &pointer_x, &pointer_y, &pointer_mask);
+      gdk_window_get_pointer(gtk_widget_get_window(widget), &pointer_x, &pointer_y, &pointer_mask);
 	    
       if (GE_IS_CONTAINER(widget))
         {
@@ -346,12 +346,15 @@ hc_gtk2_engine_hack_menu_shell_motion(GtkWidget *widget,
 	      if ((child->data) && GE_IS_WIDGET(child->data) && 
                   (gtk_widget_get_state (GTK_WIDGET(child->data)) != GTK_STATE_INSENSITIVE))
 	        {
-	          if ((pointer_x >= GTK_WIDGET(child->data)->allocation.x) && 
-	              (pointer_y >= GTK_WIDGET(child->data)->allocation.y) &&
-	              (pointer_x < (GTK_WIDGET(child->data)->allocation.x + 
-	                              GTK_WIDGET(child->data)->allocation.width)) && 
-	              (pointer_y < (GTK_WIDGET(child->data)->allocation.y +
-	                              GTK_WIDGET(child->data)->allocation.height)))
+	          GtkAllocation allocation;
+	          gtk_widget_get_allocation(GTK_WIDGET(child->data), &allocation);
+
+	          if ((pointer_x >= allocation.x) && 
+	              (pointer_y >= allocation.y) &&
+	              (pointer_x < (allocation.x + 
+	                              allocation.width)) && 
+	              (pointer_y < (allocation.y +
+	                              allocation.height)))
 	            {
                       gtk_widget_set_state (GTK_WIDGET(child->data), GTK_STATE_PRELIGHT);
 	            }
@@ -394,11 +397,10 @@ hc_gtk2_engine_hack_menu_shell_leave(GtkWidget *widget,
 	      if ((child->data) && GE_IS_MENU_ITEM(child->data) && 
                   (gtk_widget_get_state (GTK_WIDGET(child->data)) != GTK_STATE_INSENSITIVE))
 	        {
-                  if ((!GE_IS_MENU(GTK_MENU_ITEM(child->data)->submenu)) || 
-                      (!(gtk_widget_get_realized(GTK_MENU_ITEM(child->data)->submenu) && 
-                         gtk_widget_get_visible (GTK_MENU_ITEM(child->data)->submenu) &&
-                         gtk_widget_get_realized(GTK_MENU(GTK_MENU_ITEM(child->data)->submenu)->toplevel) &&
-                         gtk_widget_get_visible (GTK_MENU(GTK_MENU_ITEM(child->data)->submenu)->toplevel))))
+	          GtkWidget* submenu = gtk_menu_item_get_submenu(GTK_MENU_ITEM(child->data));
+                  if ((!GE_IS_MENU(submenu)) || 
+                      (!(gtk_widget_get_realized(submenu) && 
+                         gtk_widget_get_visible (submenu))))
 	          {
                     gtk_widget_set_state (GTK_WIDGET(child->data), GTK_STATE_NORMAL);
                   }
diff --git a/engines/industrial/src/industrial_style.c b/engines/industrial/src/industrial_style.c
index b34a5b8..ff0198c 100644
--- a/engines/industrial/src/industrial_style.c
+++ b/engines/industrial/src/industrial_style.c
@@ -526,17 +526,18 @@ draw_slider (GtkStyle      *style,
 	
 	/* This makes the slider overlay the stepper buttons at the sides. XXX */
 	if (widget && GE_IS_SCROLLBAR (widget)) {
-		GtkAdjustment *adjustment = GTK_RANGE (widget)->adjustment;
+		GtkAdjustment *adjustment = gtk_range_get_adjustment (GTK_RANGE (widget));
 
 		/* If all of these values are 0, don't do anything.  This fixes mozilla/galeon scrollbars. */
-		if (adjustment->value ||
-		    adjustment->lower ||
-		    adjustment->upper ||
-		    adjustment->step_increment ||
-		    adjustment->page_increment ||
-		    adjustment->page_size) {
-			if ((adjustment->value <= adjustment->lower) &&
-			    (GTK_RANGE (widget)->has_stepper_a || GTK_RANGE (widget)->has_stepper_b)) {
+		if (gtk_adjustment_get_value (adjustment) ||
+		    gtk_adjustment_get_lower (adjustment) ||
+		    gtk_adjustment_get_upper (adjustment) ||
+		    gtk_adjustment_get_step_increment (adjustment) ||
+		    gtk_adjustment_get_page_increment (adjustment) ||
+		    gtk_adjustment_get_page_size (adjustment)) {
+			/* XXX: Need a way to check whether there are any steppers at the top/bottom. */
+			if ((gtk_adjustment_get_value (adjustment) <= gtk_adjustment_get_lower (adjustment)) /*&&
+			    (GTK_RANGE (widget)->has_stepper_a || GTK_RANGE (widget)->has_stepper_b)*/) {
 				if (orientation == GTK_ORIENTATION_VERTICAL) {
 					if (!gtk_range_get_inverted (GTK_RANGE (widget)))
 						y--;
@@ -547,8 +548,8 @@ draw_slider (GtkStyle      *style,
 					width++;
 				}
 			}
-			if ((adjustment->value >= adjustment->upper - adjustment->page_size) &&
-			    (GTK_RANGE (widget)->has_stepper_a || GTK_RANGE (widget)->has_stepper_b)) {
+			if ((gtk_adjustment_get_value (adjustment) >= gtk_adjustment_get_upper (adjustment) - gtk_adjustment_get_page_size (adjustment)) /*&&
+			    (GTK_RANGE (widget)->has_stepper_a || GTK_RANGE (widget)->has_stepper_b)*/) {
 				if (orientation == GTK_ORIENTATION_VERTICAL) {
 					if (gtk_range_get_inverted (GTK_RANGE (widget)))
 						y--;
diff --git a/engines/mist/src/mist-style.c b/engines/mist/src/mist-style.c
index 47bd3bb..6d8f187 100644
--- a/engines/mist/src/mist-style.c
+++ b/engines/mist/src/mist-style.c
@@ -284,7 +284,7 @@ mist_style_draw_shadow(GtkStyle *style,
 		shadow_type = GTK_SHADOW_ETCHED_IN;
 	}
 	
-	if (CHECK_DETAIL(detail, "frame") && widget && widget->parent && GE_IS_STATUSBAR (widget->parent)) {
+	if (CHECK_DETAIL(detail, "frame") && widget && gtk_widget_get_parent (widget) && GE_IS_STATUSBAR (gtk_widget_get_parent (widget))) {
 		ge_cairo_set_color(cr, &mist_style->color_cube.dark[GTK_STATE_NORMAL]);	
 
 		cairo_move_to (cr, x + 0.5, y + 0.5);
@@ -603,10 +603,11 @@ mist_style_draw_box(GtkStyle *style,
 		/* Make sure stepper and slider outlines "overlap" - taken from
 		 * bluecurve */
 		if (CHECK_DETAIL(detail, "slider") && widget && GE_IS_RANGE (widget)) {
-			GtkAdjustment *adj = GTK_RANGE (widget)->adjustment;
-			if (adj->value <= adj->lower &&
+			GtkAdjustment *adj = gtk_range_get_adjustment (GTK_RANGE (widget));
+			/* XXX: Need a way to get figure out where steppers are for this hack to work properly. */
+			if (gtk_adjustment_get_value (adj) <= gtk_adjustment_get_lower (adj) /*&&
 			    (GTK_RANGE (widget)->has_stepper_a ||
-			     GTK_RANGE (widget)->has_stepper_b)) {
+			     GTK_RANGE (widget)->has_stepper_b)*/) {
 				if (GE_IS_VSCROLLBAR (widget)) {
 					height += 1;
 					if (!gtk_range_get_inverted (GTK_RANGE (widget)))
@@ -618,9 +619,9 @@ mist_style_draw_box(GtkStyle *style,
 				}
 			}
 			
-			if (adj->value >= adj->upper - adj->page_size &&
+			if (gtk_adjustment_get_value (adj) >= gtk_adjustment_get_upper (adj) - gtk_adjustment_get_page_size (adj) /*&&
 			    (GTK_RANGE (widget)->has_stepper_c ||
-			     GTK_RANGE (widget)->has_stepper_d)) {
+			     GTK_RANGE (widget)->has_stepper_d)*/) {
 				if (GE_IS_VSCROLLBAR (widget)) {
 					height += 1;
 					if (gtk_range_get_inverted (GTK_RANGE (widget)))
diff --git a/engines/redmond/src/redmond_gtk2_drawing.c b/engines/redmond/src/redmond_gtk2_drawing.c
index 31d8b3b..c3dc8e3 100644
--- a/engines/redmond/src/redmond_gtk2_drawing.c
+++ b/engines/redmond/src/redmond_gtk2_drawing.c
@@ -654,12 +654,12 @@ redmond_draw_combobox_button (GtkStyle * style,
         {
           if (!ge_is_combo_box_entry (widget))
             {
-              if ((widget->parent))
+              if ((gtk_widget_get_parent (widget)))
                 {
-                  gtk_widget_ensure_style(widget->parent);
+                  gtk_widget_ensure_style(gtk_widget_get_parent (widget));
 
-                  parent_style = widget->parent->style;
-                  parent_state = widget->parent->state;
+                  parent_style = gtk_widget_get_style (gtk_widget_get_parent (widget));
+                  parent_state = gtk_widget_get_state (gtk_widget_get_parent (widget));
                 }
 
 	      if (parent_state != GTK_STATE_INSENSITIVE)
@@ -682,15 +682,15 @@ redmond_draw_combobox_button (GtkStyle * style,
         {
           GtkWidget *parent = widget;
       
-          if (widget->parent)
-            parent = widget->parent;
+          if (gtk_widget_get_parent (widget))
+            parent = gtk_widget_get_parent (widget);
         
           if ((parent))
             {
               gtk_widget_ensure_style(parent);
 
-              parent_style = parent->style;
-              parent_state = parent->state;
+              parent_style = gtk_widget_get_style (parent);
+              parent_state = gtk_widget_get_state (parent);
             }
 
           if (parent_state != GTK_STATE_INSENSITIVE)
@@ -723,12 +723,12 @@ redmond_draw_combobox_button (GtkStyle * style,
         {
           if (!ge_is_combo_box_entry (widget))
             {
-              if ((widget->parent))
+              if ((gtk_widget_get_parent (widget)))
                 {
-                  gtk_widget_ensure_style(widget->parent);
+                  gtk_widget_ensure_style(gtk_widget_get_parent (widget));
 
-                  parent_style = widget->parent->style;
-                  parent_state = widget->parent->state;
+                  parent_style = gtk_widget_get_style (gtk_widget_get_parent (widget));
+                  parent_state = gtk_widget_get_state (gtk_widget_get_parent (widget));
                 }
 
               if (parent_state != GTK_STATE_INSENSITIVE)
@@ -750,15 +750,15 @@ redmond_draw_combobox_button (GtkStyle * style,
         {
           GtkWidget *parent = widget;
       
-          if (widget->parent)
-            parent = widget->parent;
+          if (gtk_widget_get_parent (widget))
+            parent = gtk_widget_get_parent (widget);
         
           if ((parent))
             {
               gtk_widget_ensure_style(parent);
 
-              parent_style = parent->style;
-              parent_state = parent->state;
+              parent_style = gtk_widget_get_style (parent);
+              parent_state = gtk_widget_get_state (parent);
             }
 
           if (parent_state != GTK_STATE_INSENSITIVE)
@@ -1004,14 +1004,14 @@ redmond_draw_box (GtkStyle * style,
  
       if (((CHECK_DETAIL (detail, "dockitem_bin")) && 
            (GE_IS_BONOBO_DOCK_ITEM(widget))) || 
-          ((widget) && (ge_is_bonobo_dock_item(widget->parent))))
+          ((widget) && (ge_is_bonobo_dock_item(gtk_widget_get_parent (widget)))))
 	{	  
 	  GList *children = NULL, *child = NULL;
 	  GtkWidget *dockitem = widget;
 	  gboolean has_grip = FALSE, ltr = TRUE;
 	  
 	  if ((!GE_IS_BONOBO_DOCK_ITEM(widget)) && (!GE_IS_BOX(widget)))
-	    dockitem = widget->parent;
+	    dockitem = gtk_widget_get_parent (widget);
 	    
 	  has_grip = GE_IS_CONTAINER(dockitem);
 	  
@@ -1026,10 +1026,14 @@ redmond_draw_box (GtkStyle * style,
             for (child = g_list_first(children); child; child = g_list_next(child))
               {
 	        if (GE_IS_BONOBO_DOCK_ITEM_GRIP(child->data))
-                  has_grip = (gtk_widget_get_visible (child->data) && 
-                              gtk_widget_get_realized(child->data) && 
-                              GTK_WIDGET(child->data)->allocation.width > 1) &&
-                              (GTK_WIDGET(child->data)->allocation.height > 1);
+	          {
+	            GtkAllocation allocation;
+	            gtk_widget_get_allocation (GTK_WIDGET (child->data), &allocation);
+                    has_grip = (gtk_widget_get_visible (child->data) && 
+                                gtk_widget_get_realized(child->data) && 
+                                allocation.width > 1) &&
+                                (allocation.height > 1);
+                  }
               }	            
  
             if (children)   
@@ -1111,18 +1115,18 @@ redmond_draw_box (GtkStyle * style,
 	      break;
 	    }      
         }
-      else if (GE_IS_HANDLE_BOX_ITEM(widget) && GTK_WIDGET_REALIZED(widget->parent) && gtk_widget_get_visible (widget->parent))
+      else if (GE_IS_HANDLE_BOX_ITEM(widget) && gtk_widget_get_realized(gtk_widget_get_parent (widget)) && gtk_widget_get_visible (gtk_widget_get_parent (widget)))
         {
 	  switch (gtk_handle_box_get_handle_position
-		  (GTK_HANDLE_BOX (widget->parent)))
+		  (GTK_HANDLE_BOX (gtk_widget_get_parent (widget))))
 	    {
 	      case GTK_POS_LEFT:
-                left_cutoff = (!widget) || (gtk_widget_get_direction (widget->parent) == GTK_TEXT_DIR_LTR);
+                left_cutoff = (!widget) || (gtk_widget_get_direction (gtk_widget_get_parent (widget)) == GTK_TEXT_DIR_LTR);
                 right_cutoff= !left_cutoff;		
               break;
  
 	      case GTK_POS_RIGHT:
-                left_cutoff = (widget) && (gtk_widget_get_direction (widget->parent) == GTK_TEXT_DIR_RTL);
+                left_cutoff = (widget) && (gtk_widget_get_direction (gtk_widget_get_parent (widget)) == GTK_TEXT_DIR_RTL);
 	        right_cutoff = !left_cutoff;
 	      break;
  
@@ -1156,7 +1160,7 @@ redmond_draw_box (GtkStyle * style,
       /* If this is a menu embedded in the gnome-panel, we don't
        *  draw a border since it looks cleaner without one.
        */
-      if ((widget) && (widget->parent) &&
+      if ((widget) && (gtk_widget_get_parent (widget)) &&
 	  ((!((CHECK_DETAIL (detail, "menubar")) && 
 	  ge_is_panel_widget_item (widget)))))
         {
@@ -1176,14 +1180,15 @@ redmond_draw_box (GtkStyle * style,
         }
       cairo_destroy(cr);
     }
-  else if ((CHECK_DETAIL (detail, "menuitem")) && widget && widget->parent
-	   && GE_IS_MENU_BAR (widget->parent))
+  else if ((CHECK_DETAIL (detail, "menuitem")) && widget && gtk_widget_get_parent (widget)
+	   && GE_IS_MENU_BAR (gtk_widget_get_parent (widget)))
     {
       /* Primary Menu Items on Menu bars are drawn with 
        * a thin inset border on select/active,
        * and a thin outset border on prelight
        */
       CairoColor *top, *bottom;
+      GtkWidget *submenu = NULL;
  
       if (state_type != GTK_STATE_INSENSITIVE)
 	state_type = GTK_STATE_NORMAL;
@@ -1192,12 +1197,12 @@ redmond_draw_box (GtkStyle * style,
 
       ge_cairo_pattern_fill (cr, DEFAULT_BACKGROUND_PATTERN(redmond_style, state_type),
 					  x, y, width, height);
-		 			  
-      if ((!GE_IS_MENU(GTK_MENU_ITEM(widget)->submenu)) || 
-          (!(GTK_WIDGET_REALIZED(GTK_MENU_ITEM(widget)->submenu) && 
-             gtk_widget_get_visible (GTK_MENU_ITEM(widget)->submenu) &&
-             GTK_WIDGET_REALIZED(GTK_MENU(GTK_MENU_ITEM(widget)->submenu)->toplevel) &&
-             gtk_widget_get_visible (GTK_MENU(GTK_MENU_ITEM(widget)->submenu)->toplevel))))
+
+      if (GTK_IS_MENU_ITEM (widget))
+        submenu = gtk_menu_item_get_submenu (GTK_MENU_ITEM (widget));
+      if ((!GE_IS_MENU(submenu)) || 
+          (!(gtk_widget_get_realized (submenu) && 
+             gtk_widget_get_visible (submenu))))
         {  
           top = &redmond_style->color_cube.light[state_type];
           bottom = &redmond_style->color_cube.dark[state_type];
@@ -1251,16 +1256,18 @@ redmond_draw_box (GtkStyle * style,
     {
       gint pointer_x, pointer_y;
       GdkModifierType pointer_mask;
+      GtkAllocation allocation;
+      gtk_widget_get_allocation (widget, &allocation);
 
-      gdk_window_get_pointer(widget->window, &pointer_x, &pointer_y, &pointer_mask);
+      gdk_window_get_pointer(gtk_widget_get_window (widget), &pointer_x, &pointer_y, &pointer_mask);
 	    
       cr = ge_gdk_drawable_to_cairo (window, area);
-      if ((pointer_x >= widget->allocation.x) && 
-	  (pointer_y >= widget->allocation.y) &&
-	  (pointer_x < (widget->allocation.x + 
-	                widget->allocation.width)) && 
-	  (pointer_y < (widget->allocation.y +
-	                widget->allocation.height)))
+      if ((pointer_x >= allocation.x) && 
+	  (pointer_y >= allocation.y) &&
+	  (pointer_x < (allocation.x + 
+	                allocation.width)) && 
+	  (pointer_y < (allocation.y +
+	                allocation.height)))
         {
           ge_cairo_pattern_fill (cr, DEFAULT_BACKGROUND_PATTERN(redmond_style, state_type),
                                         x, y, width, height);
@@ -1603,12 +1610,16 @@ redmond_draw_handle (GtkStyle * style,
   if (GE_IS_BONOBO_DOCK_ITEM_GRIP(widget) && 
      (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) && 
      (orientation == (GTK_ORIENTATION_HORIZONTAL)) &&
-     (widget->parent != NULL))
+     (gtk_widget_get_parent (widget) != NULL))
   {
-    x = widget->parent->allocation.width - widget->allocation.width;
-    y = widget->parent->allocation.height - widget->allocation.height;
-    width = widget->allocation.width;
-    height = widget->allocation.height;
+    GtkAllocation allocation, parent_allocation;
+    gtk_widget_get_allocation (widget, &allocation);
+    gtk_widget_get_allocation (gtk_widget_get_parent (widget), &parent_allocation);
+
+    x = parent_allocation.width - allocation.width;
+    y = parent_allocation.height - allocation.height;
+    width = allocation.width;
+    height = allocation.height;
     
     area = NULL;
   }
@@ -1732,11 +1743,11 @@ redmond_draw_handle (GtkStyle * style,
  
           if (GE_IS_BONOBO_DOCK_ITEM_GRIP(widget))
             {
-              if GE_IS_BOX(widget->parent)
+              if GE_IS_BOX(gtk_widget_get_parent (widget))
                 {
                   GList *children = NULL, *child = NULL;
  
-                  children = gtk_container_get_children(GTK_CONTAINER(widget->parent));
+                  children = gtk_container_get_children(GTK_CONTAINER(gtk_widget_get_parent (widget)));
               
                   for (child = g_list_first(children); child; child = g_list_next(child))
                     {
diff --git a/engines/redmond/src/redmond_gtk2_misc.c b/engines/redmond/src/redmond_gtk2_misc.c
index 3ecfe26..fabfa35 100644
--- a/engines/redmond/src/redmond_gtk2_misc.c
+++ b/engines/redmond/src/redmond_gtk2_misc.c
@@ -442,7 +442,7 @@ redmond_gtk2_engine_hack_menu_shell_motion(GtkWidget *widget,
       GdkModifierType pointer_mask;
       GList *children = NULL, *child = NULL;
      
-      gdk_window_get_pointer(widget->window, &pointer_x, &pointer_y, &pointer_mask);
+      gdk_window_get_pointer(gtk_widget_get_window (widget), &pointer_x, &pointer_y, &pointer_mask);
 	    
       if (GE_IS_CONTAINER(widget))
         {
@@ -453,12 +453,15 @@ redmond_gtk2_engine_hack_menu_shell_motion(GtkWidget *widget,
 	      if ((child->data) && GE_IS_WIDGET(child->data) && 
                   (gtk_widget_get_state (GTK_WIDGET(child->data)) != GTK_STATE_INSENSITIVE))
 	        {
-	          if ((pointer_x >= GTK_WIDGET(child->data)->allocation.x) && 
-	              (pointer_y >= GTK_WIDGET(child->data)->allocation.y) &&
-	              (pointer_x < (GTK_WIDGET(child->data)->allocation.x + 
-	                              GTK_WIDGET(child->data)->allocation.width)) && 
-	              (pointer_y < (GTK_WIDGET(child->data)->allocation.y +
-	                              GTK_WIDGET(child->data)->allocation.height)))
+	          GtkAllocation allocation;
+	          gtk_widget_get_allocation (GTK_WIDGET(child->data), &allocation);
+
+	          if ((pointer_x >= allocation.x) && 
+	              (pointer_y >= allocation.y) &&
+	              (pointer_x < (allocation.x + 
+	                              allocation.width)) && 
+	              (pointer_y < (allocation.y +
+	                              allocation.height)))
 	            {
                       gtk_widget_set_state (GTK_WIDGET(child->data), GTK_STATE_PRELIGHT);
 	            }
@@ -501,11 +504,10 @@ redmond_gtk2_engine_hack_menu_shell_leave(GtkWidget *widget,
 	      if ((child->data) && GE_IS_MENU_ITEM(child->data) && 
                   (gtk_widget_get_state (GTK_WIDGET(child->data)) != GTK_STATE_INSENSITIVE))
 	        {
-                  if ((!GE_IS_MENU(GTK_MENU_ITEM(child->data)->submenu)) || 
-                      (!(gtk_widget_get_realized(GTK_MENU_ITEM(child->data)->submenu) && 
-                         gtk_widget_get_visible (GTK_MENU_ITEM(child->data)->submenu) &&
-                         gtk_widget_get_realized(GTK_MENU(GTK_MENU_ITEM(child->data)->submenu)->toplevel) &&
-                         gtk_widget_get_visible (GTK_MENU(GTK_MENU_ITEM(child->data)->submenu)->toplevel))))
+	          GtkWidget *submenu = gtk_menu_item_get_submenu (GTK_MENU_ITEM(child->data));
+                  if ((!GE_IS_MENU(submenu)) || 
+                      (!(gtk_widget_get_realized(submenu) && 
+                         gtk_widget_get_visible (submenu))))
 	          {
                     gtk_widget_set_state (GTK_WIDGET(child->data), GTK_STATE_NORMAL);
                   }
diff --git a/engines/support/widget-information.h b/engines/support/widget-information.h
index 17160ba..ea0efbe 100644
--- a/engines/support/widget-information.h
+++ b/engines/support/widget-information.h
@@ -71,7 +71,7 @@ typedef enum {
 #define GE_IS_HSEPARATOR(object) ((object) && ge_object_is_a ((GObject*)(object), "GtkHSeparator"))
  
 #define GE_IS_HANDLE_BOX(object) ((object) && ge_object_is_a ((GObject*)(object), "GtkHandleBox"))
-#define GE_IS_HANDLE_BOX_ITEM(object) ((object) && GE_IS_HANDLE_BOX(object->parent))
+#define GE_IS_HANDLE_BOX_ITEM(object) ((object) && GE_IS_HANDLE_BOX(gtk_widget_get_parent (object)))
 #define GE_IS_BONOBO_DOCK_ITEM(object) ((object) && ge_object_is_a ((GObject*)(object), "BonoboDockItem"))
 #define GE_IS_BONOBO_DOCK_ITEM_GRIP(object) ((object) && ge_object_is_a ((GObject*)(object), "BonoboDockItemGrip"))
 #define GE_IS_BONOBO_TOOLBAR(object) ((object) && ge_object_is_a ((GObject*)(object), "BonoboUIToolbar"))
diff --git a/themes/Clearlooks/gtk-3.0/gtkrc-common b/themes/Clearlooks/gtk-3.0/gtkrc-common
index 6c29269..208d206 100644
--- a/themes/Clearlooks/gtk-3.0/gtkrc-common
+++ b/themes/Clearlooks/gtk-3.0/gtkrc-common
@@ -16,6 +16,7 @@ style "default" {
 
 	GtkPaned::handle-size = 6
 
+	GtkRange::trough-under-steppers = 0
 	GtkRange::trough-border = 0
 	GtkRange::slider-width = 15
 	GtkRange::stepper-size = 15



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