Commit 2d7e9abe authored by Javier Jardón's avatar Javier Jardón
Browse files

Use accessor functions instead direct access.

GTK+ 2.17.10 is now the required version
I've used all the GTK+ 2.18.* api available, still missing:
GTK_WIDGET_UNSET_FLAGS (widget, GTK_TOPLEVEL);
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
GTK_WIDGET_REALIZED ()
GTK_WIDGET_MAPPED ()
GTK_VIEWPORT ()->bin_window
GTK_ENTRY ()->editing_canceled

https://bugzilla.gnome.org/show_bug.cgi?id=594957
parent 7475d2d5
2009-12-04 Javier Jardón <jjardon@gnome.org>
Use accessor functions instead direct access.
GTK+ 2.17.10 is now the required version
I've used all the GTK+ 2.18.* api available, still missing:
GTK_WIDGET_UNSET_FLAGS (widget, GTK_TOPLEVEL);
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
GTK_WIDGET_REALIZED ()
GTK_WIDGET_MAPPED ()
GTK_VIEWPORT ()->bin_window
GTK_ENTRY ()->editing_canceled
https://bugzilla.gnome.org/show_bug.cgi?id=594957
2009-11-09 Tristan Van Berkom <tvb@gnome.org> 2009-11-09 Tristan Van Berkom <tvb@gnome.org>
* plugins/gtk+/gtk+.xml.in, plugins/gtk+/glade-gtk.c: Disable default saving behaviour of order dependant * plugins/gtk+/gtk+.xml.in, plugins/gtk+/glade-gtk.c: Disable default saving behaviour of order dependant
......
...@@ -121,7 +121,7 @@ GTK_DOC_CHECK(1.9) ...@@ -121,7 +121,7 @@ GTK_DOC_CHECK(1.9)
dnl ================================================================ dnl ================================================================
dnl Check for gtk+ dnl Check for gtk+
dnl ================================================================ dnl ================================================================
PKG_CHECK_MODULES(GTK, [gtk+-2.0 >= 2.14.0 gthread-2.0 libxml-2.0 >= 2.4.0]) PKG_CHECK_MODULES(GTK, [gtk+-2.0 >= 2.17.10 gthread-2.0 libxml-2.0 >= 2.4.0])
AC_SUBST(GTK_LIBS) AC_SUBST(GTK_LIBS)
AC_SUBST(GTK_CFLAGS) AC_SUBST(GTK_CFLAGS)
......
...@@ -1006,7 +1006,7 @@ glade_app_add_project (GladeProject *project) ...@@ -1006,7 +1006,7 @@ glade_app_add_project (GladeProject *project)
if (g_list_length (app->priv->projects) == 1 || if (g_list_length (app->priv->projects) == 1 ||
!(view = glade_design_view_get_from_project (project)) || !(view = glade_design_view_get_from_project (project)) ||
!(layout = glade_design_view_get_layout (view)) || !(layout = glade_design_view_get_layout (view)) ||
!GTK_BIN (layout)->child) !gtk_bin_get_child (GTK_BIN (layout)))
{ {
const GList *node; const GList *node;
for (node = glade_project_get_objects (project); for (node = glade_project_get_objects (project);
...@@ -1318,7 +1318,7 @@ glade_app_command_paste (GladePlaceholder *placeholder) ...@@ -1318,7 +1318,7 @@ glade_app_command_paste (GladePlaceholder *placeholder)
* at a time * at a time
*/ */
if (GTK_IS_WIDGET (widget->object) && if (GTK_IS_WIDGET (widget->object) &&
GTK_WIDGET_TOPLEVEL (widget->object) == FALSE && gtk_widget_is_toplevel (GTK_WIDGET (widget->object)) == FALSE &&
parent && fixed && !GWA_USE_PLACEHOLDERS (parent->adaptor) && parent && fixed && !GWA_USE_PLACEHOLDERS (parent->adaptor) &&
g_list_length (clipboard->selection) != 1) g_list_length (clipboard->selection) != 1)
{ {
......
...@@ -1889,9 +1889,8 @@ glade_command_break_references (GladeProject *project, GList *widgets) ...@@ -1889,9 +1889,8 @@ glade_command_break_references (GladeProject *project, GList *widgets)
void void
glade_command_paste(GList *widgets, GladeWidget *parent, GladePlaceholder *placeholder) glade_command_paste(GList *widgets, GladeWidget *parent, GladePlaceholder *placeholder)
{ {
GList *l, *list, *copied_widgets = NULL; GList *list, *copied_widgets = NULL;
GladeWidget *copied_widget = NULL; GladeWidget *copied_widget = NULL;
GladeProperty *property;
/* GladeProject *target_project; */ /* GladeProject *target_project; */
gboolean exact; gboolean exact;
......
...@@ -40,11 +40,11 @@ set_cursor_recurse (GtkWidget *widget, ...@@ -40,11 +40,11 @@ set_cursor_recurse (GtkWidget *widget,
{ {
GList *children, *list; GList *children, *list;
if (!GTK_WIDGET_VISIBLE (widget) || if (!gtk_widget_get_visible (widget) ||
!GTK_WIDGET_REALIZED (widget)) !GTK_WIDGET_REALIZED (widget))
return; return;
gdk_window_set_cursor (widget->window, gdk_cursor); gdk_window_set_cursor (gtk_widget_get_window (widget), gdk_cursor);
if (GTK_IS_CONTAINER (widget) && if (GTK_IS_CONTAINER (widget) &&
(children = (children =
......
...@@ -83,16 +83,18 @@ static void ...@@ -83,16 +83,18 @@ static void
glade_custom_send_configure (GladeCustom *custom) glade_custom_send_configure (GladeCustom *custom)
{ {
GtkWidget *widget; GtkWidget *widget;
GtkAllocation allocation;
GdkEvent *event = gdk_event_new (GDK_CONFIGURE); GdkEvent *event = gdk_event_new (GDK_CONFIGURE);
widget = GTK_WIDGET (custom); widget = GTK_WIDGET (custom);
event->configure.window = g_object_ref (widget->window); event->configure.window = g_object_ref (gtk_widget_get_window (widget));
event->configure.send_event = TRUE; event->configure.send_event = TRUE;
event->configure.x = widget->allocation.x; gtk_widget_get_allocation (widget, &allocation);
event->configure.y = widget->allocation.y; event->configure.x = allocation.x;
event->configure.width = widget->allocation.width; event->configure.y = allocation.y;
event->configure.height = widget->allocation.height; event->configure.width = allocation.width;
event->configure.height = allocation.height;
gtk_widget_event (widget, event); gtk_widget_event (widget, event);
gdk_event_free (event); gdk_event_free (event);
...@@ -102,6 +104,8 @@ static void ...@@ -102,6 +104,8 @@ static void
glade_custom_realize (GtkWidget *widget) glade_custom_realize (GtkWidget *widget)
{ {
GladeCustom *custom; GladeCustom *custom;
GtkAllocation allocation;
GdkWindow *window;
GdkWindowAttr attributes; GdkWindowAttr attributes;
gint attributes_mask; gint attributes_mask;
...@@ -112,10 +116,11 @@ glade_custom_realize (GtkWidget *widget) ...@@ -112,10 +116,11 @@ glade_custom_realize (GtkWidget *widget)
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED); GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
attributes.window_type = GDK_WINDOW_CHILD; attributes.window_type = GDK_WINDOW_CHILD;
attributes.x = widget->allocation.x; gtk_widget_get_allocation (widget, &allocation);
attributes.y = widget->allocation.y; attributes.x = allocation.x;
attributes.width = widget->allocation.width; attributes.y = allocation.y;
attributes.height = widget->allocation.height; attributes.width = allocation.width;
attributes.height = allocation.height;
attributes.wclass = GDK_INPUT_OUTPUT; attributes.wclass = GDK_INPUT_OUTPUT;
attributes.visual = gtk_widget_get_visual (widget); attributes.visual = gtk_widget_get_visual (widget);
attributes.colormap = gtk_widget_get_colormap (widget); attributes.colormap = gtk_widget_get_colormap (widget);
...@@ -123,11 +128,11 @@ glade_custom_realize (GtkWidget *widget) ...@@ -123,11 +128,11 @@ glade_custom_realize (GtkWidget *widget)
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP; 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), window = gdk_window_new (gtk_widget_get_parent_window (widget), &attributes, attributes_mask);
&attributes, attributes_mask); gtk_widget_set_window (widget, window);
gdk_window_set_user_data (widget->window, custom); gdk_window_set_user_data (window, custom);
widget->style = gtk_style_attach (widget->style, widget->window); gtk_widget_set_style (widget, gtk_style_attach (gtk_widget_get_style (widget), window));
glade_custom_send_configure (custom); glade_custom_send_configure (custom);
...@@ -140,7 +145,7 @@ glade_custom_realize (GtkWidget *widget) ...@@ -140,7 +145,7 @@ glade_custom_realize (GtkWidget *widget)
g_assert(G_IS_OBJECT(custom->custom_pixmap)); g_assert(G_IS_OBJECT(custom->custom_pixmap));
} }
gdk_window_set_back_pixmap (GTK_WIDGET (custom)->window, custom->custom_pixmap, FALSE); gdk_window_set_back_pixmap (gtk_widget_get_window (GTK_WIDGET (custom)), custom->custom_pixmap, FALSE);
} }
static void static void
...@@ -149,11 +154,11 @@ glade_custom_size_allocate (GtkWidget *widget, GtkAllocation *allocation) ...@@ -149,11 +154,11 @@ glade_custom_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
g_return_if_fail (GLADE_IS_CUSTOM (widget)); g_return_if_fail (GLADE_IS_CUSTOM (widget));
g_return_if_fail (allocation != NULL); g_return_if_fail (allocation != NULL);
widget->allocation = *allocation; gtk_widget_set_allocation (widget, allocation);
if (GTK_WIDGET_REALIZED (widget)) if (GTK_WIDGET_REALIZED (widget))
{ {
gdk_window_move_resize (widget->window, gdk_window_move_resize (gtk_widget_get_window (widget),
allocation->x, allocation->y, allocation->x, allocation->y,
allocation->width, allocation->height); allocation->width, allocation->height);
...@@ -164,14 +169,16 @@ glade_custom_size_allocate (GtkWidget *widget, GtkAllocation *allocation) ...@@ -164,14 +169,16 @@ glade_custom_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
static gboolean static gboolean
glade_custom_expose (GtkWidget *widget, GdkEventExpose *event) glade_custom_expose (GtkWidget *widget, GdkEventExpose *event)
{ {
GtkStyle *style;
GdkGC *light_gc; GdkGC *light_gc;
GdkGC *dark_gc; GdkGC *dark_gc;
gint w, h; gint w, h;
g_return_val_if_fail (GLADE_IS_CUSTOM (widget), FALSE); g_return_val_if_fail (GLADE_IS_CUSTOM (widget), FALSE);
light_gc = widget->style->light_gc[GTK_STATE_NORMAL]; style = gtk_widget_get_style (widget);
dark_gc = widget->style->dark_gc[GTK_STATE_NORMAL]; light_gc = style->light_gc[GTK_STATE_NORMAL];
dark_gc = style->dark_gc[GTK_STATE_NORMAL];
gdk_drawable_get_size (event->window, &w, &h); gdk_drawable_get_size (event->window, &w, &h);
gdk_draw_line (event->window, light_gc, 0, 0, w - 1, 0); gdk_draw_line (event->window, light_gc, 0, 0, w - 1, 0);
......
...@@ -89,47 +89,47 @@ static PointerRegion ...@@ -89,47 +89,47 @@ static PointerRegion
glade_design_layout_get_pointer_region (GladeDesignLayout *layout, gint x, gint y) glade_design_layout_get_pointer_region (GladeDesignLayout *layout, gint x, gint y)
{ {
GladeDesignLayoutPrivate *priv; GladeDesignLayoutPrivate *priv;
GtkAllocation *child_allocation; GtkAllocation child_allocation;
PointerRegion region = REGION_INSIDE; PointerRegion region = REGION_INSIDE;
priv = GLADE_DESIGN_LAYOUT_GET_PRIVATE (layout); priv = GLADE_DESIGN_LAYOUT_GET_PRIVATE (layout);
child_allocation = &GTK_BIN (layout)->child->allocation; gtk_widget_get_allocation (gtk_bin_get_child (GTK_BIN (layout)), &child_allocation);
if ((x >= (child_allocation->x + child_allocation->width)) && if ((x >= (child_allocation.x + child_allocation.width)) &&
(x < (child_allocation->x + child_allocation->width + OUTLINE_WIDTH))) (x < (child_allocation.x + child_allocation.width + OUTLINE_WIDTH)))
{ {
if ((y < (child_allocation->y + child_allocation->height - OUTLINE_WIDTH)) && if ((y < (child_allocation.y + child_allocation.height - OUTLINE_WIDTH)) &&
(y >= child_allocation->y - OUTLINE_WIDTH)) (y >= child_allocation.y - OUTLINE_WIDTH))
region = REGION_EAST; region = REGION_EAST;
else if ((y < (child_allocation->y + child_allocation->height)) && else if ((y < (child_allocation.y + child_allocation.height)) &&
(y >= (child_allocation->y + child_allocation->height - OUTLINE_WIDTH))) (y >= (child_allocation.y + child_allocation.height - OUTLINE_WIDTH)))
region = REGION_NORTH_OF_SOUTH_EAST; region = REGION_NORTH_OF_SOUTH_EAST;
else if ((y < (child_allocation->y + child_allocation->height + OUTLINE_WIDTH)) && else if ((y < (child_allocation.y + child_allocation.height + OUTLINE_WIDTH)) &&
(y >= (child_allocation->y + child_allocation->height))) (y >= (child_allocation.y + child_allocation.height)))
region = REGION_SOUTH_EAST; region = REGION_SOUTH_EAST;
} }
else if ((y >= (child_allocation->y + child_allocation->height)) && else if ((y >= (child_allocation.y + child_allocation.height)) &&
(y < (child_allocation->y + child_allocation->height + OUTLINE_WIDTH))) (y < (child_allocation.y + child_allocation.height + OUTLINE_WIDTH)))
{ {
if ((x < (child_allocation->x + child_allocation->width - OUTLINE_WIDTH)) && if ((x < (child_allocation.x + child_allocation.width - OUTLINE_WIDTH)) &&
(x >= child_allocation->x - OUTLINE_WIDTH)) (x >= child_allocation.x - OUTLINE_WIDTH))
region = REGION_SOUTH; region = REGION_SOUTH;
else if ((x < (child_allocation->x + child_allocation->width)) && else if ((x < (child_allocation.x + child_allocation.width)) &&
(x >= (child_allocation->x + child_allocation->width - OUTLINE_WIDTH))) (x >= (child_allocation.x + child_allocation.width - OUTLINE_WIDTH)))
region = REGION_WEST_OF_SOUTH_EAST; region = REGION_WEST_OF_SOUTH_EAST;
else if ((x < (child_allocation->x + child_allocation->width + OUTLINE_WIDTH)) && else if ((x < (child_allocation.x + child_allocation.width + OUTLINE_WIDTH)) &&
(x >= (child_allocation->x + child_allocation->width))) (x >= (child_allocation.x + child_allocation.width)))
region = REGION_SOUTH_EAST; region = REGION_SOUTH_EAST;
} }
if (x < PADDING || y < PADDING || if (x < PADDING || y < PADDING ||
x >= (child_allocation->x + child_allocation->width + OUTLINE_WIDTH) || x >= (child_allocation.x + child_allocation.width + OUTLINE_WIDTH) ||
y >= (child_allocation->y + child_allocation->height + OUTLINE_WIDTH)) y >= (child_allocation.y + child_allocation.height + OUTLINE_WIDTH))
region = REGION_OUTSIDE; region = REGION_OUTSIDE;
return region; return region;
...@@ -144,6 +144,8 @@ child_size_request_handler (GtkWidget *widget, ...@@ -144,6 +144,8 @@ child_size_request_handler (GtkWidget *widget,
GladeDesignLayout *layout) GladeDesignLayout *layout)
{ {
GladeDesignLayoutPrivate *priv; GladeDesignLayoutPrivate *priv;
GtkAllocation allocation;
GtkRequisition requisition;
gint new_width, new_height; gint new_width, new_height;
gint old_width, old_height; gint old_width, old_height;
...@@ -152,8 +154,9 @@ child_size_request_handler (GtkWidget *widget, ...@@ -152,8 +154,9 @@ child_size_request_handler (GtkWidget *widget,
priv->current_size_request->width = req->width; priv->current_size_request->width = req->width;
priv->current_size_request->height = req->height; priv->current_size_request->height = req->height;
new_width = widget->allocation.width; gtk_widget_get_allocation (widget, &allocation);
new_height = widget->allocation.height; new_width = allocation.width;
new_height = allocation.height;
if (req->width > new_width) if (req->width > new_width)
new_width = req->width; new_width = req->width;
...@@ -161,19 +164,16 @@ child_size_request_handler (GtkWidget *widget, ...@@ -161,19 +164,16 @@ child_size_request_handler (GtkWidget *widget,
if (req->height > new_height) if (req->height > new_height)
new_height = req->height; new_height = req->height;
if ((new_width != widget->allocation.width) || if ((new_width != allocation.width) ||
(new_height != widget->allocation.height)) (new_height != allocation.height))
{ {
old_width = widget->requisition.width; gtk_widget_size_request (widget, &requisition);
old_height = widget->requisition.height; old_width = requisition.width;
old_height = requisition.height;
gtk_widget_set_size_request (widget, new_width, new_height); gtk_widget_set_size_request (widget,
(old_width > new_width) ? old_width : new_width,
if (old_width > new_width) (old_height > new_height) ? old_height : new_height);
widget->requisition.width = old_width;
if (old_height > new_height)
widget->requisition.height = old_height;
} }
gtk_widget_queue_draw (GTK_WIDGET (layout)); gtk_widget_queue_draw (GTK_WIDGET (layout));
...@@ -186,7 +186,7 @@ glade_design_layout_leave_notify_event (GtkWidget *widget, GdkEventCrossing *ev) ...@@ -186,7 +186,7 @@ glade_design_layout_leave_notify_event (GtkWidget *widget, GdkEventCrossing *ev)
GtkWidget *child; GtkWidget *child;
GladeDesignLayoutPrivate *priv; GladeDesignLayoutPrivate *priv;
if ((child = GTK_BIN (widget)->child) == NULL) if ((child = gtk_bin_get_child (GTK_BIN (widget))) == NULL)
return FALSE; return FALSE;
priv = GLADE_DESIGN_LAYOUT_GET_PRIVATE (widget); priv = GLADE_DESIGN_LAYOUT_GET_PRIVATE (widget);
...@@ -237,13 +237,15 @@ typedef struct { ...@@ -237,13 +237,15 @@ typedef struct {
static void static void
glade_design_layout_find_inside_container (GtkWidget *widget, GladeFindInContainerData *data) glade_design_layout_find_inside_container (GtkWidget *widget, GladeFindInContainerData *data)
{ {
GtkAllocation allocation;
gint x; gint x;
gint y; gint y;
gtk_widget_translate_coordinates (data->toplevel, widget, data->x, data->y, &x, &y); gtk_widget_translate_coordinates (data->toplevel, widget, data->x, data->y, &x, &y);
gtk_widget_get_allocation (widget, &allocation);
if (GTK_WIDGET_MAPPED(widget) && if (GTK_WIDGET_MAPPED(widget) &&
x >= 0 && x < widget->allocation.width && y >= 0 && y < widget->allocation.height) x >= 0 && x < allocation.width && y >= 0 && y < allocation.height)
{ {
if (glade_widget_get_from_gobject (widget) || data->any) if (glade_widget_get_from_gobject (widget) || data->any)
data->found = widget; data->found = widget;
...@@ -339,7 +341,7 @@ glade_design_layout_motion_notify_event (GtkWidget *widget, GdkEventMotion *ev) ...@@ -339,7 +341,7 @@ glade_design_layout_motion_notify_event (GtkWidget *widget, GdkEventMotion *ev)
gint x, y; gint x, y;
gint new_width, new_height; gint new_width, new_height;
if ((child = GTK_BIN (widget)->child) == NULL) if ((child = gtk_bin_get_child (GTK_BIN (widget))) == NULL)
return FALSE; return FALSE;
priv = GLADE_DESIGN_LAYOUT_GET_PRIVATE (widget); priv = GLADE_DESIGN_LAYOUT_GET_PRIVATE (widget);
...@@ -347,7 +349,7 @@ glade_design_layout_motion_notify_event (GtkWidget *widget, GdkEventMotion *ev) ...@@ -347,7 +349,7 @@ glade_design_layout_motion_notify_event (GtkWidget *widget, GdkEventMotion *ev)
gdk_window_get_pointer (priv->event_window, &x, &y, NULL); gdk_window_get_pointer (priv->event_window, &x, &y, NULL);
child_glade_widget = glade_widget_get_from_gobject (child); child_glade_widget = glade_widget_get_from_gobject (child);
allocation = child->allocation; gtk_widget_get_allocation (child, &allocation);
if (priv->activity == ACTIVITY_RESIZE_WIDTH) if (priv->activity == ACTIVITY_RESIZE_WIDTH)
{ {
...@@ -416,11 +418,12 @@ static gboolean ...@@ -416,11 +418,12 @@ static gboolean
glade_design_layout_button_press_event (GtkWidget *widget, GdkEventButton *ev) glade_design_layout_button_press_event (GtkWidget *widget, GdkEventButton *ev)
{ {
GtkWidget *child; GtkWidget *child;
PointerRegion region; GtkAllocation child_allocation;
PointerRegion region;
GladeDesignLayoutPrivate *priv; GladeDesignLayoutPrivate *priv;
gint x, y; gint x, y;
if ((child = GTK_BIN (widget)->child) == NULL) if ((child = gtk_bin_get_child (GTK_BIN (widget))) == NULL)
return FALSE; return FALSE;
priv = GLADE_DESIGN_LAYOUT_GET_PRIVATE (widget); priv = GLADE_DESIGN_LAYOUT_GET_PRIVATE (widget);
...@@ -430,8 +433,9 @@ glade_design_layout_button_press_event (GtkWidget *widget, GdkEventButton *ev) ...@@ -430,8 +433,9 @@ glade_design_layout_button_press_event (GtkWidget *widget, GdkEventButton *ev)
if (((GdkEventButton *) ev)->button == 1) if (((GdkEventButton *) ev)->button == 1)
{ {
priv->dx = x - (child->allocation.x + child->allocation.width); gtk_widget_get_allocation (child, &child_allocation);
priv->dy = y - (child->allocation.y + child->allocation.height); priv->dx = x - (child_allocation.x + child_allocation.width);
priv->dy = y - (child_allocation.y + child_allocation.height);
if (region == REGION_EAST) if (region == REGION_EAST)
{ {
...@@ -469,7 +473,7 @@ glade_design_layout_button_release_event (GtkWidget *widget, GdkEventButton *ev) ...@@ -469,7 +473,7 @@ glade_design_layout_button_release_event (GtkWidget *widget, GdkEventButton *ev)
GladeDesignLayoutPrivate *priv; GladeDesignLayoutPrivate *priv;
GtkWidget *child; GtkWidget *child;
if ((child = GTK_BIN (widget)->child) == NULL) if ((child = gtk_bin_get_child (GTK_BIN (widget))) == NULL)
return FALSE; return FALSE;
priv = GLADE_DESIGN_LAYOUT_GET_PRIVATE (widget); priv = GLADE_DESIGN_LAYOUT_GET_PRIVATE (widget);
...@@ -489,15 +493,16 @@ glade_design_layout_size_request (GtkWidget *widget, GtkRequisition *requisition ...@@ -489,15 +493,16 @@ glade_design_layout_size_request (GtkWidget *widget, GtkRequisition *requisition
GladeWidget *gchild; GladeWidget *gchild;
gint child_width = 0; gint child_width = 0;
gint child_height = 0; gint child_height = 0;
guint border_width = 0;
priv = GLADE_DESIGN_LAYOUT_GET_PRIVATE (widget); priv = GLADE_DESIGN_LAYOUT_GET_PRIVATE (widget);
requisition->width = 0; requisition->width = 0;
requisition->height = 0; requisition->height = 0;
child = GTK_BIN (widget)->child; child = gtk_bin_get_child (GTK_BIN (widget));
if (child && GTK_WIDGET_VISIBLE (child)) if (child && gtk_widget_get_visible (child))
{ {
gchild = glade_widget_get_from_gobject (child); gchild = glade_widget_get_from_gobject (child);
g_assert (gchild); g_assert (gchild);
...@@ -519,8 +524,9 @@ glade_design_layout_size_request (GtkWidget *widget, GtkRequisition *requisition ...@@ -519,8 +524,9 @@ glade_design_layout_size_request (GtkWidget *widget, GtkRequisition *requisition
2 * PADDING + child_height + 2 * OUTLINE_WIDTH); 2 * PADDING + child_height + 2 * OUTLINE_WIDTH);
} }
requisition->width += GTK_CONTAINER (widget)->border_width * 2; border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
requisition->height += GTK_CONTAINER (widget)->border_width * 2; requisition->width += border_width * 2;
requisition->height += border_width * 2;
} }
static void static void
...@@ -529,7 +535,7 @@ glade_design_layout_size_allocate (GtkWidget *widget, GtkAllocation *allocation) ...@@ -529,7 +535,7 @@ glade_design_layout_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
GladeDesignLayoutPrivate *priv; GladeDesignLayoutPrivate *priv;
GladeWidget *gchild; GladeWidget *gchild;
GtkRequisition child_requisition; GtkRequisition child_requisition;
GtkAllocation child_allocation; GtkAllocation child_allocation, widget_allocation;
GtkWidget *child; GtkWidget *child;
gint border_width; gint border_width;
gint child_width = 0; gint child_width = 0;
...@@ -537,8 +543,8 @@ glade_design_layout_size_allocate (GtkWidget *widget, GtkAllocation *allocation) ...@@ -537,8 +543,8 @@ glade_design_layout_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
priv = GLADE_DESIGN_LAYOUT_GET_PRIVATE (widget); priv = GLADE_DESIGN_LAYOUT_GET_PRIVATE (widget);
widget->allocation = *allocation; gtk_widget_set_allocation (widget, allocation);
border_width = GTK_CONTAINER (widget)->border_width; border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
if (GTK_WIDGET_REALIZED (widget)) if (GTK_WIDGET_REALIZED (widget))
{ {
...@@ -551,9 +557,9 @@ glade_design_layout_size_allocate (GtkWidget *widget, GtkAllocation *allocation) ...@@ -551,9 +557,9 @@ glade_design_layout_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
}