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>
* 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)
dnl ================================================================
dnl Check for gtk+
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_CFLAGS)
......
......@@ -1006,7 +1006,7 @@ glade_app_add_project (GladeProject *project)
if (g_list_length (app->priv->projects) == 1 ||
!(view = glade_design_view_get_from_project (project)) ||
!(layout = glade_design_view_get_layout (view)) ||
!GTK_BIN (layout)->child)
!gtk_bin_get_child (GTK_BIN (layout)))
{
const GList *node;
for (node = glade_project_get_objects (project);
......@@ -1318,7 +1318,7 @@ glade_app_command_paste (GladePlaceholder *placeholder)
* at a time
*/
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) &&
g_list_length (clipboard->selection) != 1)
{
......
......@@ -1889,9 +1889,8 @@ glade_command_break_references (GladeProject *project, GList *widgets)
void
glade_command_paste(GList *widgets, GladeWidget *parent, GladePlaceholder *placeholder)
{
GList *l, *list, *copied_widgets = NULL;
GList *list, *copied_widgets = NULL;
GladeWidget *copied_widget = NULL;
GladeProperty *property;
/* GladeProject *target_project; */
gboolean exact;
......
......@@ -40,11 +40,11 @@ set_cursor_recurse (GtkWidget *widget,
{
GList *children, *list;
if (!GTK_WIDGET_VISIBLE (widget) ||
if (!gtk_widget_get_visible (widget) ||
!GTK_WIDGET_REALIZED (widget))
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) &&
(children =
......
......@@ -83,16 +83,18 @@ static void
glade_custom_send_configure (GladeCustom *custom)
{
GtkWidget *widget;
GtkAllocation allocation;
GdkEvent *event = gdk_event_new (GDK_CONFIGURE);
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.x = widget->allocation.x;
event->configure.y = widget->allocation.y;
event->configure.width = widget->allocation.width;
event->configure.height = widget->allocation.height;
gtk_widget_get_allocation (widget, &allocation);
event->configure.x = allocation.x;
event->configure.y = allocation.y;
event->configure.width = allocation.width;
event->configure.height = allocation.height;
gtk_widget_event (widget, event);
gdk_event_free (event);
......@@ -102,6 +104,8 @@ static void
glade_custom_realize (GtkWidget *widget)
{
GladeCustom *custom;
GtkAllocation allocation;
GdkWindow *window;
GdkWindowAttr attributes;
gint attributes_mask;
......@@ -112,10 +116,11 @@ glade_custom_realize (GtkWidget *widget)
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
attributes.window_type = GDK_WINDOW_CHILD;
attributes.x = widget->allocation.x;
attributes.y = widget->allocation.y;
attributes.width = widget->allocation.width;
attributes.height = widget->allocation.height;
gtk_widget_get_allocation (widget, &allocation);
attributes.x = allocation.x;
attributes.y = allocation.y;
attributes.width = allocation.width;
attributes.height = allocation.height;
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.visual = gtk_widget_get_visual (widget);
attributes.colormap = gtk_widget_get_colormap (widget);
......@@ -123,11 +128,11 @@ glade_custom_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, custom);
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, 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);
......@@ -140,7 +145,7 @@ glade_custom_realize (GtkWidget *widget)
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
......@@ -149,11 +154,11 @@ glade_custom_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
g_return_if_fail (GLADE_IS_CUSTOM (widget));
g_return_if_fail (allocation != NULL);
widget->allocation = *allocation;
gtk_widget_set_allocation (widget, allocation);
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->width, allocation->height);
......@@ -164,14 +169,16 @@ glade_custom_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
static gboolean
glade_custom_expose (GtkWidget *widget, GdkEventExpose *event)
{
GtkStyle *style;
GdkGC *light_gc;
GdkGC *dark_gc;
gint w, h;
g_return_val_if_fail (GLADE_IS_CUSTOM (widget), FALSE);
light_gc = widget->style->light_gc[GTK_STATE_NORMAL];
dark_gc = widget->style->dark_gc[GTK_STATE_NORMAL];
style = gtk_widget_get_style (widget);
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_draw_line (event->window, light_gc, 0, 0, w - 1, 0);
......
......@@ -89,47 +89,47 @@ static PointerRegion
glade_design_layout_get_pointer_region (GladeDesignLayout *layout, gint x, gint y)
{
GladeDesignLayoutPrivate *priv;
GtkAllocation *child_allocation;
GtkAllocation child_allocation;
PointerRegion region = REGION_INSIDE;
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)) &&
(x < (child_allocation->x + child_allocation->width + OUTLINE_WIDTH)))
if ((x >= (child_allocation.x + child_allocation.width)) &&
(x < (child_allocation.x + child_allocation.width + OUTLINE_WIDTH)))
{
if ((y < (child_allocation->y + child_allocation->height - OUTLINE_WIDTH)) &&
(y >= child_allocation->y - OUTLINE_WIDTH))
if ((y < (child_allocation.y + child_allocation.height - OUTLINE_WIDTH)) &&
(y >= child_allocation.y - OUTLINE_WIDTH))
region = REGION_EAST;
else if ((y < (child_allocation->y + child_allocation->height)) &&
(y >= (child_allocation->y + child_allocation->height - OUTLINE_WIDTH)))
else if ((y < (child_allocation.y + child_allocation.height)) &&
(y >= (child_allocation.y + child_allocation.height - OUTLINE_WIDTH)))
region = REGION_NORTH_OF_SOUTH_EAST;
else if ((y < (child_allocation->y + child_allocation->height + OUTLINE_WIDTH)) &&
(y >= (child_allocation->y + child_allocation->height)))
else if ((y < (child_allocation.y + child_allocation.height + OUTLINE_WIDTH)) &&
(y >= (child_allocation.y + child_allocation.height)))
region = REGION_SOUTH_EAST;
}
else if ((y >= (child_allocation->y + child_allocation->height)) &&
(y < (child_allocation->y + child_allocation->height + OUTLINE_WIDTH)))
else if ((y >= (child_allocation.y + child_allocation.height)) &&
(y < (child_allocation.y + child_allocation.height + OUTLINE_WIDTH)))
{
if ((x < (child_allocation->x + child_allocation->width - OUTLINE_WIDTH)) &&
(x >= child_allocation->x - OUTLINE_WIDTH))
if ((x < (child_allocation.x + child_allocation.width - OUTLINE_WIDTH)) &&
(x >= child_allocation.x - OUTLINE_WIDTH))
region = REGION_SOUTH;
else if ((x < (child_allocation->x + child_allocation->width)) &&
(x >= (child_allocation->x + child_allocation->width - OUTLINE_WIDTH)))
else if ((x < (child_allocation.x + child_allocation.width)) &&
(x >= (child_allocation.x + child_allocation.width - OUTLINE_WIDTH)))
region = REGION_WEST_OF_SOUTH_EAST;
else if ((x < (child_allocation->x + child_allocation->width + OUTLINE_WIDTH)) &&
(x >= (child_allocation->x + child_allocation->width)))
else if ((x < (child_allocation.x + child_allocation.width + OUTLINE_WIDTH)) &&
(x >= (child_allocation.x + child_allocation.width)))
region = REGION_SOUTH_EAST;
}
if (x < PADDING || y < PADDING ||
x >= (child_allocation->x + child_allocation->width + OUTLINE_WIDTH) ||
y >= (child_allocation->y + child_allocation->height + OUTLINE_WIDTH))
x >= (child_allocation.x + child_allocation.width + OUTLINE_WIDTH) ||
y >= (child_allocation.y + child_allocation.height + OUTLINE_WIDTH))
region = REGION_OUTSIDE;
return region;
......@@ -144,6 +144,8 @@ child_size_request_handler (GtkWidget *widget,
GladeDesignLayout *layout)
{
GladeDesignLayoutPrivate *priv;
GtkAllocation allocation;
GtkRequisition requisition;
gint new_width, new_height;
gint old_width, old_height;
......@@ -152,8 +154,9 @@ child_size_request_handler (GtkWidget *widget,
priv->current_size_request->width = req->width;
priv->current_size_request->height = req->height;
new_width = widget->allocation.width;
new_height = widget->allocation.height;
gtk_widget_get_allocation (widget, &allocation);
new_width = allocation.width;
new_height = allocation.height;
if (req->width > new_width)
new_width = req->width;
......@@ -161,19 +164,16 @@ child_size_request_handler (GtkWidget *widget,
if (req->height > new_height)
new_height = req->height;
if ((new_width != widget->allocation.width) ||
(new_height != widget->allocation.height))
if ((new_width != allocation.width) ||
(new_height != allocation.height))
{
old_width = widget->requisition.width;
old_height = widget->requisition.height;
gtk_widget_size_request (widget, &requisition);
old_width = requisition.width;
old_height = requisition.height;
gtk_widget_set_size_request (widget, new_width, new_height);
if (old_width > new_width)
widget->requisition.width = old_width;
if (old_height > new_height)
widget->requisition.height = old_height;
gtk_widget_set_size_request (widget,
(old_width > new_width) ? old_width : new_width,
(old_height > new_height) ? old_height : new_height);
}
gtk_widget_queue_draw (GTK_WIDGET (layout));
......@@ -186,7 +186,7 @@ glade_design_layout_leave_notify_event (GtkWidget *widget, GdkEventCrossing *ev)
GtkWidget *child;
GladeDesignLayoutPrivate *priv;
if ((child = GTK_BIN (widget)->child) == NULL)
if ((child = gtk_bin_get_child (GTK_BIN (widget))) == NULL)
return FALSE;
priv = GLADE_DESIGN_LAYOUT_GET_PRIVATE (widget);
......@@ -237,13 +237,15 @@ typedef struct {
static void
glade_design_layout_find_inside_container (GtkWidget *widget, GladeFindInContainerData *data)
{
GtkAllocation allocation;
gint x;
gint 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) &&
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)
data->found = widget;
......@@ -339,7 +341,7 @@ glade_design_layout_motion_notify_event (GtkWidget *widget, GdkEventMotion *ev)
gint x, y;
gint new_width, new_height;
if ((child = GTK_BIN (widget)->child) == NULL)
if ((child = gtk_bin_get_child (GTK_BIN (widget))) == NULL)
return FALSE;
priv = GLADE_DESIGN_LAYOUT_GET_PRIVATE (widget);
......@@ -347,7 +349,7 @@ glade_design_layout_motion_notify_event (GtkWidget *widget, GdkEventMotion *ev)
gdk_window_get_pointer (priv->event_window, &x, &y, NULL);
child_glade_widget = glade_widget_get_from_gobject (child);
allocation = child->allocation;
gtk_widget_get_allocation (child, &allocation);
if (priv->activity == ACTIVITY_RESIZE_WIDTH)
{
......@@ -416,11 +418,12 @@ static gboolean
glade_design_layout_button_press_event (GtkWidget *widget, GdkEventButton *ev)
{
GtkWidget *child;
PointerRegion region;
GtkAllocation child_allocation;
PointerRegion region;
GladeDesignLayoutPrivate *priv;
gint x, y;
if ((child = GTK_BIN (widget)->child) == NULL)
if ((child = gtk_bin_get_child (GTK_BIN (widget))) == NULL)
return FALSE;
priv = GLADE_DESIGN_LAYOUT_GET_PRIVATE (widget);
......@@ -430,8 +433,9 @@ glade_design_layout_button_press_event (GtkWidget *widget, GdkEventButton *ev)
if (((GdkEventButton *) ev)->button == 1)
{
priv->dx = x - (child->allocation.x + child->allocation.width);
priv->dy = y - (child->allocation.y + child->allocation.height);
gtk_widget_get_allocation (child, &child_allocation);
priv->dx = x - (child_allocation.x + child_allocation.width);
priv->dy = y - (child_allocation.y + child_allocation.height);
if (region == REGION_EAST)
{
......@@ -469,7 +473,7 @@ glade_design_layout_button_release_event (GtkWidget *widget, GdkEventButton *ev)
GladeDesignLayoutPrivate *priv;
GtkWidget *child;
if ((child = GTK_BIN (widget)->child) == NULL)
if ((child = gtk_bin_get_child (GTK_BIN (widget))) == NULL)
return FALSE;
priv = GLADE_DESIGN_LAYOUT_GET_PRIVATE (widget);
......@@ -489,15 +493,16 @@ glade_design_layout_size_request (GtkWidget *widget, GtkRequisition *requisition
GladeWidget *gchild;
gint child_width = 0;
gint child_height = 0;
guint border_width = 0;
priv = GLADE_DESIGN_LAYOUT_GET_PRIVATE (widget);
requisition->width = 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);
g_assert (gchild);
......@@ -519,8 +524,9 @@ glade_design_layout_size_request (GtkWidget *widget, GtkRequisition *requisition
2 * PADDING + child_height + 2 * OUTLINE_WIDTH);
}
requisition->width += GTK_CONTAINER (widget)->border_width * 2;
requisition->height += GTK_CONTAINER (widget)->border_width * 2;
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
requisition->width += border_width * 2;
requisition->height += border_width * 2;
}
static void
......@@ -529,7 +535,7 @@ glade_design_layout_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
GladeDesignLayoutPrivate *priv;
GladeWidget *gchild;
GtkRequisition child_requisition;
GtkAllocation child_allocation;
GtkAllocation child_allocation, widget_allocation;
GtkWidget *child;
gint border_width;
gint child_width = 0;
......@@ -537,8 +543,8 @@ glade_design_layout_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
priv = GLADE_DESIGN_LAYOUT_GET_PRIVATE (widget);
widget->allocation = *allocation;
border_width = GTK_CONTAINER (widget)->border_width;
gtk_widget_set_allocation (widget, allocation);
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
if (GTK_WIDGET_REALIZED (widget))
{
......@@ -551,9 +557,9 @@ glade_design_layout_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
}
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);
g_assert (gchild);
......@@ -568,8 +574,9 @@ glade_design_layout_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
child_width = MAX (child_width, child_requisition.width);
child_height = MAX (child_height, child_requisition.height);
child_allocation.x = widget->allocation.x + border_width + PADDING + OUTLINE_WIDTH;
child_allocation.y = widget->allocation.y + border_width + PADDING + OUTLINE_WIDTH;
gtk_widget_get_allocation (widget, &widget_allocation);
child_allocation.x = widget_allocation.x + border_width + PADDING + OUTLINE_WIDTH;
child_allocation.y = widget_allocation.y + border_width + PADDING + OUTLINE_WIDTH;
child_allocation.width = child_width - 2 * border_width;
child_allocation.height = child_height - 2 * border_width;
......@@ -609,20 +616,24 @@ static void
glade_design_layout_realize (GtkWidget *widget)
{
GladeDesignLayoutPrivate *priv;
GtkAllocation allocation;
GtkStyle *style;
GdkWindow *window;
GdkWindowAttr attributes;
gint attributes_mask;
gint border_width;
guint border_width;
priv = GLADE_DESIGN_LAYOUT_GET_PRIVATE (widget);
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
border_width = GTK_CONTAINER (widget)->border_width;
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
attributes.x = widget->allocation.x;
attributes.y = widget->allocation.y;
attributes.width = widget->allocation.width;
attributes.height = widget->allocation.height;
gtk_widget_get_allocation (widget, &allocation);
attributes.x = allocation.x;
attributes.y = allocation.y;
attributes.width = allocation.width;
attributes.height = allocation.height;
attributes.window_type = GDK_WINDOW_CHILD;
attributes.wclass = GDK_INPUT_ONLY;
......@@ -637,15 +648,16 @@ glade_design_layout_realize (GtkWidget *widget)
GDK_LEAVE_NOTIFY_MASK;
attributes_mask = GDK_WA_X | GDK_WA_Y;
widget->window = gtk_widget_get_parent_window (widget);
g_object_ref (widget->window);
window = gtk_widget_get_parent_window (widget);
gtk_widget_set_window (widget, window);
priv->event_window = gdk_window_new (gtk_widget_get_parent_window (widget),
&attributes, attributes_mask);
gdk_window_set_user_data (priv->event_window, widget);
widget->style = gtk_style_attach (widget->style, widget->window);
gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
style = gtk_style_attach (gtk_widget_get_style (widget), window);
gtk_widget_set_style (widget, style);
gtk_style_set_background (style, window, GTK_STATE_NORMAL);
}
static void
......@@ -735,7 +747,7 @@ draw_frame (GtkWidget *widget,
cairo_set_line_join (cr, CAIRO_LINE_JOIN_ROUND);
cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND);
gdk_cairo_set_source_color (cr, &widget->style->bg[GTK_STATE_SELECTED]);
gdk_cairo_set_source_color (cr, &gtk_widget_get_style (widget)->bg[GTK_STATE_SELECTED]);
/* rectangle */
cairo_move_to (cr, x, y);
......@@ -760,35 +772,42 @@ static gboolean
glade_design_layout_expose_event (GtkWidget *widget, GdkEventExpose *ev)
{
GladeDesignLayout *layout;
GtkStyle *style;
GtkAllocation allocation, child_allocation;
GtkWidget *child;
GdkWindow *window;
gint x, y, w, h;
gint border_width;
cairo_t *cr;
layout = GLADE_DESIGN_LAYOUT (widget);
border_width = GTK_CONTAINER (widget)->border_width;
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
window = gtk_widget_get_window (widget);
style = gtk_widget_get_style (widget);
gtk_widget_get_allocation (widget, &allocation);
/* draw a white widget background */
gdk_draw_rectangle (widget->window,
widget->style->base_gc [GTK_WIDGET_STATE (widget)],
gdk_draw_rectangle (window,
style->base_gc [gtk_widget_get_state (widget)],
TRUE,
widget->allocation.x + border_width,
widget->allocation.y + border_width,
widget->allocation.width - 2 * border_width,
widget->allocation.height - 2 * border_width);
allocation.x + border_width,
allocation.y + border_width,
allocation.width - 2 * border_width,
allocation.height - 2 * border_width);
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))
{
x = child->allocation.x - OUTLINE_WIDTH / 2;
y = child->allocation.y - OUTLINE_WIDTH / 2;
w = child->allocation.width + OUTLINE_WIDTH;
h = child->allocation.height + OUTLINE_WIDTH;
gtk_widget_get_allocation (child, &child_allocation);
x = child_allocation.x - OUTLINE_WIDTH / 2;
y = child_allocation.y - OUTLINE_WIDTH / 2;
w = child_allocation.width + OUTLINE_WIDTH;
h = child_allocation.height + OUTLINE_WIDTH;
/* draw frame */
cr = gdk_cairo_create (widget->window);
cr = gdk_cairo_create (window);
draw_frame (widget, cr, x, y, w, h);
......@@ -796,8 +815,8 @@ glade_design_layout_expose_event (GtkWidget *widget, GdkEventExpose *ev)
/* draw a filled rectangle in case child does not draw
* it's own background (a GTK_WIDGET_NO_WINDOW child). */
gdk_draw_rectangle (widget->window,
widget->style->bg_gc[GTK_STATE_NORMAL],
gdk_draw_rectangle (window,
style->bg_gc[GTK_STATE_NORMAL],
TRUE,
x + OUTLINE_WIDTH / 2, y + OUTLINE_WIDTH / 2,
w - OUTLINE_WIDTH, h - OUTLINE_WIDTH);
......@@ -879,7 +898,7 @@ glade_design_layout_init (GladeDesignLayout *layout)
layout->priv = priv = GLADE_DESIGN_LAYOUT_GET_PRIVATE (layout);
GTK_WIDGET_SET_FLAGS (GTK_WIDGET (layout), GTK_NO_WINDOW);
gtk_widget_set_has_window (GTK_WIDGET (layout), FALSE);
priv->event_window = NULL;
priv->activity = ACTIVITY_NONE;
......
......@@ -259,7 +259,7 @@ eprop_item_label_size_allocate_after (GtkWidget *widget, GtkAllocation *allocati
gint width = EDITOR_COLUMN_SIZE;
gint icon_width = 0;
if (GTK_WIDGET_VISIBLE (eprop->warning) && GTK_WIDGET_MAPPED (eprop->warning))
if (gtk_widget_get_visible (eprop->warning) && GTK_WIDGET_MAPPED (eprop->warning))
{
GtkRequisition req = { -1, -1 };
gtk_widget_size_request (eprop->warning, &req);
......@@ -1097,6 +1097,8 @@ glade_eprop_flags_show_dialog (GtkWidget *button,
GtkWidget *view;