[glade3] Use accessor functions instead direct access.
- From: Javier Jardón <jjardon src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [glade3] Use accessor functions instead direct access.
- Date: Fri, 4 Dec 2009 19:15:52 +0000 (UTC)
commit 2d7e9abe72d4ae63cdb7906751c6f85758a14593
Author: Javier Jardón <jjardon gnome org>
Date: Fri Dec 4 20:14:58 2009 +0100
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
ChangeLog | 15 ++
configure.ac | 2 +-
gladeui/glade-app.c | 4 +-
gladeui/glade-command.c | 3 +-
gladeui/glade-cursor.c | 4 +-
gladeui/glade-custom.c | 45 ++++---
gladeui/glade-design-layout.c | 181 +++++++++++++----------
gladeui/glade-editor-property.c | 137 +++++++++++-------
gladeui/glade-editor.c | 30 +++--
gladeui/glade-fixed.c | 49 ++++---
gladeui/glade-inspector.c | 4 +-
gladeui/glade-named-icon-chooser-dialog.c | 22 ++-
gladeui/glade-palette-box.c | 38 +++--
gladeui/glade-palette-expander.c | 58 ++++---
gladeui/glade-palette.c | 8 +-
gladeui/glade-placeholder.c | 48 ++++---
gladeui/glade-popup.c | 2 +-
gladeui/glade-project.c | 14 +-
gladeui/glade-property-class.c | 12 +-
gladeui/glade-widget.c | 60 +++++---
plugins/gtk+/glade-accels.c | 3 +-
plugins/gtk+/glade-activatable-editor.c | 4 +-
plugins/gtk+/glade-attributes.c | 12 +-
plugins/gtk+/glade-button-editor.c | 4 +-
plugins/gtk+/glade-column-types.c | 2 +-
plugins/gtk+/glade-gtk.c | 230 +++++++++++++++++------------
plugins/gtk+/glade-icon-sources.c | 2 +-
src/glade-window.c | 17 +--
28 files changed, 590 insertions(+), 420 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 2dcbd94..c21d43a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+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
diff --git a/configure.ac b/configure.ac
index 6acc59b..e1afd06 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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)
diff --git a/gladeui/glade-app.c b/gladeui/glade-app.c
index 1295a11..3fa69b1 100644
--- a/gladeui/glade-app.c
+++ b/gladeui/glade-app.c
@@ -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)
{
diff --git a/gladeui/glade-command.c b/gladeui/glade-command.c
index 097de9d..ab4ef03 100644
--- a/gladeui/glade-command.c
+++ b/gladeui/glade-command.c
@@ -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;
diff --git a/gladeui/glade-cursor.c b/gladeui/glade-cursor.c
index 10ad910..f3b61e4 100644
--- a/gladeui/glade-cursor.c
+++ b/gladeui/glade-cursor.c
@@ -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 =
diff --git a/gladeui/glade-custom.c b/gladeui/glade-custom.c
index 8715d79..5f2157a 100644
--- a/gladeui/glade-custom.c
+++ b/gladeui/glade-custom.c
@@ -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);
diff --git a/gladeui/glade-design-layout.c b/gladeui/glade-design-layout.c
index 7414d22..a1072d8 100644
--- a/gladeui/glade-design-layout.c
+++ b/gladeui/glade-design-layout.c
@@ -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 = >K_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, >k_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;
diff --git a/gladeui/glade-editor-property.c b/gladeui/glade-editor-property.c
index 691b5a8..b19e313 100644
--- a/gladeui/glade-editor-property.c
+++ b/gladeui/glade-editor-property.c
@@ -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;
GtkWidget *label;
GtkWidget *vbox;
+ GtkWidget *content_area;
+ GtkWidget *action_area;
dialog = gtk_dialog_new_with_buttons (_("Select Fields"),
GTK_WINDOW (gtk_widget_get_toplevel (button)),
@@ -1111,9 +1113,11 @@ glade_eprop_flags_show_dialog (GtkWidget *button,
/* HIG spacings */
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
- gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 2); /* 2 * 5 + 2 = 12 */
- gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->action_area), 5);
- gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->action_area), 6);
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
+ gtk_box_set_spacing (GTK_BOX (content_area), 2); /* 2 * 5 + 2 = 12 */
+ action_area = gtk_dialog_get_action_area (GTK_DIALOG (dialog));
+ gtk_container_set_border_width (GTK_CONTAINER (action_area), 5);
+ gtk_box_set_spacing (GTK_BOX (action_area), 6);
vbox = gtk_vbox_new (FALSE, 6);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
@@ -1126,7 +1130,7 @@ glade_eprop_flags_show_dialog (GtkWidget *button,
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), view, TRUE, TRUE, 0);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), vbox, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), vbox, TRUE, TRUE, 0);
gtk_widget_show (label);
gtk_widget_show (view);
@@ -1531,7 +1535,7 @@ glade_eprop_text_load (GladeEditorProperty *eprop, GladeProperty *property)
{
const gchar *text = g_value_get_string (property->value);
if (!text) text = "";
- gtk_entry_set_text (GTK_ENTRY (GTK_BIN (eprop_text->text_entry)->child), text);
+ gtk_entry_set_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (eprop_text->text_entry))), text);
}
else
{
@@ -1689,6 +1693,7 @@ glade_editor_property_show_i18n_dialog (GtkWidget *parent,
GtkWidget *text_view, *comment_view, *context_view;
GtkTextBuffer *text_buffer, *comment_buffer, *context_buffer = NULL;
GtkWidget *translatable_button, *context_button;
+ GtkWidget *content_area, *action_area;
gint res;
g_return_val_if_fail (text && context && comment && translatable && has_context, FALSE);
@@ -1710,16 +1715,18 @@ glade_editor_property_show_i18n_dialog (GtkWidget *parent,
/* HIG spacings */
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
- gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 2); /* 2 * 5 + 2 = 12 */
- gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->action_area), 5);
- gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->action_area), 6);
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
+ gtk_box_set_spacing (GTK_BOX (content_area), 2); /* 2 * 5 + 2 = 12 */
+ action_area = gtk_dialog_get_action_area (GTK_DIALOG (dialog));
+ gtk_container_set_border_width (GTK_CONTAINER (action_area), 5);
+ gtk_box_set_spacing (GTK_BOX (action_area), 6);
vbox = gtk_vbox_new (FALSE, 6);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
gtk_widget_show (vbox);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), vbox, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), vbox, TRUE, TRUE, 0);
/* Text */
label = gtk_label_new_with_mnemonic (_("_Text:"));
@@ -1933,6 +1940,7 @@ glade_editor_property_show_resource_dialog (GladeProject *project, GtkWidget *pa
{
GtkWidget *dialog;
+ GtkWidget *action_area;
gchar *folder;
g_return_val_if_fail (filename != NULL, FALSE);
@@ -1954,9 +1962,10 @@ glade_editor_property_show_resource_dialog (GladeProject *project, GtkWidget *pa
/* HIG spacings */
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
- gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 2); /* 2 * 5 + 2 = 12 */
- gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->action_area), 5);
- gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->action_area), 6);
+ gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), 2); /* 2 * 5 + 2 = 12 */
+ action_area = gtk_dialog_get_action_area (GTK_DIALOG (dialog));
+ gtk_container_set_border_width (GTK_CONTAINER (action_area), 5);
+ gtk_box_set_spacing (GTK_BOX (action_area), 6);
folder = glade_project_resource_fullpath (project, ".");
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), folder);
@@ -2060,7 +2069,7 @@ eprop_text_stock_changed (GtkComboBox *combo,
}
else if (GTK_IS_COMBO_BOX_ENTRY (combo))
{
- str = gtk_entry_get_text (GTK_ENTRY (GTK_BIN (combo)->child));
+ str = gtk_entry_get_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (combo))));
glade_eprop_text_changed_common (eprop, str, eprop->use_command);
}
}
@@ -2079,6 +2088,7 @@ glade_eprop_text_create_input (GladeEditorProperty *eprop)
if (klass->stock || klass->stock_icon)
{
GtkCellRenderer *renderer;
+ GtkWidget *child;
GtkWidget *combo = gtk_combo_box_entry_new ();
eprop_text->store = (GtkTreeModel *)
@@ -2100,10 +2110,11 @@ glade_eprop_text_create_input (GladeEditorProperty *eprop)
/* Dont allow custom items where an actual GTK+ stock item is expected
* (i.e. real items come with labels) */
+ child = gtk_bin_get_child (GTK_BIN (combo));
if (klass->stock)
- gtk_editable_set_editable (GTK_EDITABLE (GTK_BIN (combo)->child), FALSE);
+ gtk_editable_set_editable (GTK_EDITABLE (child), FALSE);
else
- gtk_editable_set_editable (GTK_EDITABLE (GTK_BIN (combo)->child), TRUE);
+ gtk_editable_set_editable (GTK_EDITABLE (child), TRUE);
gtk_widget_show (combo);
gtk_box_pack_start (GTK_BOX (hbox), combo, FALSE, FALSE, 0);
@@ -2214,7 +2225,7 @@ glade_eprop_bool_load (GladeEditorProperty *eprop, GladeProperty *property)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (eprop_bool->toggle), state);
- label = GTK_BIN (eprop_bool->toggle)->child;
+ label = gtk_bin_get_child (GTK_BIN (eprop_bool->toggle));
gtk_label_set_text (GTK_LABEL (label), state ? _("Yes") : _("No"));
}
}
@@ -2230,7 +2241,7 @@ glade_eprop_bool_changed (GtkWidget *button,
if (eprop->loading) return;
state = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button));
- label = GTK_BIN (button)->child;
+ label = gtk_bin_get_child (GTK_BIN (button));
gtk_label_set_text (GTK_LABEL (label), state ? _("Yes") : _("No"));
g_value_init (&val, G_TYPE_BOOLEAN);
@@ -2745,6 +2756,8 @@ glade_eprop_object_show_dialog (GtkWidget *dialog_button,
GtkWidget *dialog, *parent;
GtkWidget *vbox, *label, *sw;
GtkWidget *tree_view;
+ GtkWidget *content_area;
+ GtkWidget *action_area;
GladeProject *project;
gchar *title = glade_eprop_object_dialog_title (eprop);
gint res;
@@ -2806,16 +2819,18 @@ glade_eprop_object_show_dialog (GtkWidget *dialog_button,
/* HIG settings */
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
- gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 2); /* 2 * 5 + 2 = 12 */
- gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->action_area), 5);
- gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->action_area), 6);
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
+ gtk_box_set_spacing (GTK_BOX (content_area), 2); /* 2 * 5 + 2 = 12 */
+ action_area = gtk_dialog_get_action_area (GTK_DIALOG (dialog));
+ gtk_container_set_border_width (GTK_CONTAINER (action_area), 5);
+ gtk_box_set_spacing (GTK_BOX (action_area), 6);
vbox = gtk_vbox_new (FALSE, 6);
gtk_widget_show (vbox);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), vbox, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), vbox, TRUE, TRUE, 0);
/* Checklist */
label = gtk_label_new_with_mnemonic (_("O_bjects:"));
@@ -3098,7 +3113,7 @@ glade_eprop_objects_show_dialog (GtkWidget *dialog_button,
gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), vbox, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), vbox, TRUE, TRUE, 0);
/* Checklist */
label = gtk_label_new (_("Objects:"));
@@ -3246,14 +3261,14 @@ glade_eprop_adj_value_changed (GtkAdjustment *adj, GladeEditorProperty *eprop)
data = g_new (EPropAdjIdleData, 1);
data->eprop = eprop;
- data->value = adj->value;
+ data->value = gtk_adjustment_get_value (adj);
/* Update GladeEPropAdjustment value spinbutton in an idle funtion */
g_idle_add (glade_eprop_adj_set_value_idle, data);
/* Set adjustment to the old value */
- adj->value = gtk_spin_button_get_value (GTK_SPIN_BUTTON (
- GLADE_EPROP_ADJUSTMENT (eprop)->value));
+ gtk_adjustment_set_value (adj, gtk_spin_button_get_value (GTK_SPIN_BUTTON (
+ GLADE_EPROP_ADJUSTMENT (eprop)->value)));
}
static void
@@ -3286,13 +3301,25 @@ glade_eprop_adjustment_load (GladeEditorProperty *eprop, GladeProperty *property
eprop);
/* Update adjustment's values */
- eprop_adj->value_adj->value = adj ? adj->value : 0.0;
- eprop_adj->value_adj->lower = adj ? adj->lower : 0.0;
- eprop_adj->value_adj->upper = adj ? adj->upper : 100.0;
- eprop_adj->value_adj->step_increment = adj ? adj->step_increment : 1;
- eprop_adj->value_adj->page_increment = adj ? adj->page_increment : 10;
- eprop_adj->value_adj->page_size = adj ? adj->page_size : 10;
-
+ if (adj)
+ {
+ gtk_adjustment_set_value (eprop_adj->value_adj, gtk_adjustment_get_value (adj));
+ gtk_adjustment_set_lower (eprop_adj->value_adj, gtk_adjustment_get_lower (adj));
+ gtk_adjustment_set_upper (eprop_adj->value_adj, gtk_adjustment_get_upper (adj));
+ gtk_adjustment_set_step_increment (eprop_adj->value_adj, gtk_adjustment_get_step_increment (adj));
+ gtk_adjustment_set_page_increment (eprop_adj->value_adj, gtk_adjustment_get_page_increment (adj));
+ gtk_adjustment_set_page_size (eprop_adj->value_adj, gtk_adjustment_get_page_size (adj));
+ }
+ else
+ {
+ gtk_adjustment_set_value (eprop_adj->value_adj, 0.0);
+ gtk_adjustment_set_lower (eprop_adj->value_adj, 0.0);
+ gtk_adjustment_set_upper (eprop_adj->value_adj, 100.0);
+ gtk_adjustment_set_step_increment (eprop_adj->value_adj, 1);
+ gtk_adjustment_set_page_increment (eprop_adj->value_adj, 10);
+ gtk_adjustment_set_page_size (eprop_adj->value_adj, 10);
+ }
+
/* Block Handlers */
g_signal_handler_block (eprop_adj->value, eprop_adj->ids.value);
g_signal_handler_block (eprop_adj->lower, eprop_adj->ids.lower);
@@ -3302,14 +3329,18 @@ glade_eprop_adjustment_load (GladeEditorProperty *eprop, GladeProperty *property
g_signal_handler_block (eprop_adj->page_size, eprop_adj->ids.page_size);
/* Update spinbuttons values */
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (eprop_adj->value), eprop_adj->value_adj->value);
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (eprop_adj->lower), eprop_adj->value_adj->lower);
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (eprop_adj->upper), eprop_adj->value_adj->upper);
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (eprop_adj->step_increment),
- eprop_adj->value_adj->step_increment);
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (eprop_adj->page_increment),
- eprop_adj->value_adj->page_increment);
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (eprop_adj->page_size), eprop_adj->value_adj->page_size);
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON (eprop_adj->value),
+ gtk_adjustment_get_value (eprop_adj->value_adj));
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON (eprop_adj->lower),
+ gtk_adjustment_get_lower (eprop_adj->value_adj));
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON (eprop_adj->upper),
+ gtk_adjustment_get_upper (eprop_adj->value_adj));
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON (eprop_adj->step_increment),
+ gtk_adjustment_get_step_increment (eprop_adj->value_adj));
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON (eprop_adj->page_increment),
+ gtk_adjustment_get_page_increment (eprop_adj->value_adj));
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON (eprop_adj->page_size),
+ gtk_adjustment_get_page_size (eprop_adj->value_adj));
/* Unblock Handlers */
g_signal_handler_unblock (eprop_adj->value, eprop_adj->ids.value);
@@ -3357,12 +3388,12 @@ glade_eprop_adjustment_dup_adj (GladeEditorProperty *eprop)
adj = GTK_ADJUSTMENT (object);
- return GTK_ADJUSTMENT (gtk_adjustment_new (adj->value,
- adj->lower,
- adj->upper,
- adj->step_increment,
- adj->page_increment,
- adj->page_size));
+ return GTK_ADJUSTMENT (gtk_adjustment_new (gtk_adjustment_get_value (adj),
+ gtk_adjustment_get_lower (adj),
+ gtk_adjustment_get_upper (adj),
+ gtk_adjustment_get_step_increment (adj),
+ gtk_adjustment_get_page_increment (adj),
+ gtk_adjustment_get_page_size (adj)));
}
static void
@@ -3373,12 +3404,12 @@ glade_eprop_adjustment_prop_changed_common (GladeEditorProperty *eprop,
g_value_init (&value, GTK_TYPE_ADJUSTMENT);
- if (adjustment->value == 0.00 &&
- adjustment->lower == 0.00 &&
- adjustment->upper == 100.00 &&
- adjustment->step_increment == 1.00 &&
- adjustment->page_increment == 10.00 &&
- adjustment->page_size == 10.00)
+ if (gtk_adjustment_get_value (adjustment) == 0.00 &&
+ gtk_adjustment_get_lower (adjustment) == 0.00 &&
+ gtk_adjustment_get_upper (adjustment) == 100.00 &&
+ gtk_adjustment_get_step_increment (adjustment) == 1.00 &&
+ gtk_adjustment_get_page_increment (adjustment) == 10.00 &&
+ gtk_adjustment_get_page_size (adjustment) == 10.00)
{
gtk_object_destroy (GTK_OBJECT (adjustment));
g_value_set_object (&value, NULL);
diff --git a/gladeui/glade-editor.c b/gladeui/glade-editor.c
index 9da51d2..4eaa306 100644
--- a/gladeui/glade-editor.c
+++ b/gladeui/glade-editor.c
@@ -518,7 +518,7 @@ glade_editor_load_editable_in_page (GladeEditor *editor,
GladeEditorPageType type)
{
GtkContainer *container = NULL;
- GtkWidget *scrolled_window, *editable;
+ GtkWidget *scrolled_window, *editable, *child;
GtkAdjustment *adj;
/* Remove the old table that was in this container */
@@ -543,10 +543,11 @@ glade_editor_load_editable_in_page (GladeEditor *editor,
}
/* Remove the editable (this will destroy on packing pages) */
- if (GTK_BIN (container)->child)
+ child = gtk_bin_get_child (GTK_BIN (container));
+ if (child)
{
- gtk_widget_hide (GTK_BIN (container)->child);
- gtk_container_remove (container, GTK_BIN (container)->child);
+ gtk_widget_hide (child);
+ gtk_container_remove (container, child);
}
if (!adaptor)
@@ -803,17 +804,21 @@ query_dialog_style_set_cb (GtkWidget *dialog,
GtkStyle *previous_style,
gpointer user_data)
{
- gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), 12);
- gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 12);
- gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->action_area), 0);
- gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->action_area), 6);
+ GtkWidget *content_area, *action_area;
+
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
+ gtk_container_set_border_width (GTK_CONTAINER (content_area), 12);
+ gtk_box_set_spacing (GTK_BOX (content_area), 12);
+ action_area = gtk_dialog_get_action_area (GTK_DIALOG (dialog));
+ gtk_container_set_border_width (GTK_CONTAINER (action_area), 0);
+ gtk_box_set_spacing (GTK_BOX (action_area), 6);
}
gboolean
glade_editor_query_dialog (GladeEditor *editor, GladeWidget *widget)
{
- GtkWidget *dialog, *editable;
+ GtkWidget *dialog, *editable, *content_area;
gchar *title;
gint answer;
gboolean retval = TRUE;
@@ -839,7 +844,8 @@ glade_editor_query_dialog (GladeEditor *editor, GladeWidget *widget)
widget->adaptor,
GLADE_PAGE_QUERY);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox),
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
+ gtk_box_pack_start (GTK_BOX (content_area),
editable, FALSE, FALSE, 6);
glade_editable_load (GLADE_EDITABLE (editable), widget);
@@ -858,7 +864,7 @@ glade_editor_query_dialog (GladeEditor *editor, GladeWidget *widget)
if (answer == GTK_RESPONSE_CANCEL)
retval = FALSE;
- gtk_container_remove (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), editable);
+ gtk_container_remove (GTK_CONTAINER (content_area), editable);
gtk_widget_destroy (dialog);
return retval;
@@ -1203,7 +1209,7 @@ glade_editor_reset_dialog (GladeEditor *editor)
gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), vbox, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), vbox, TRUE, TRUE, 0);
/* Checklist */
label = gtk_label_new_with_mnemonic (_("_Properties:"));
diff --git a/gladeui/glade-fixed.c b/gladeui/glade-fixed.c
index a2c6bf1..bd52492 100644
--- a/gladeui/glade-fixed.c
+++ b/gladeui/glade-fixed.c
@@ -103,6 +103,7 @@ glade_fixed_get_operation (GtkWidget *widget,
gint y)
{
GladeCursorType operation = GLADE_CURSOR_DRAG;
+ GtkAllocation allocation;
#if 0
g_print ("%s called (width %d height %d x %d y %d)\n",
@@ -111,31 +112,32 @@ glade_fixed_get_operation (GtkWidget *widget,
widget->allocation.height, x, y);
#endif
+ gtk_widget_get_allocation (widget, &allocation);
if (x < GRAB_BORDER_WIDTH) {
if (y < GRAB_BORDER_WIDTH)
operation = GLADE_CURSOR_RESIZE_TOP_LEFT;
- else if (y > widget->allocation.height - GRAB_BORDER_WIDTH)
+ else if (y > allocation.height - GRAB_BORDER_WIDTH)
operation = GLADE_CURSOR_RESIZE_BOTTOM_LEFT;
else
operation = GLADE_CURSOR_RESIZE_LEFT;
- } else if (x > widget->allocation.width - GRAB_BORDER_WIDTH) {
+ } else if (x > allocation.width - GRAB_BORDER_WIDTH) {
if (y < GRAB_BORDER_WIDTH)
operation = GLADE_CURSOR_RESIZE_TOP_RIGHT;
- else if (y > widget->allocation.height - GRAB_BORDER_WIDTH)
+ else if (y > allocation.height - GRAB_BORDER_WIDTH)
operation = GLADE_CURSOR_RESIZE_BOTTOM_RIGHT;
else
operation = GLADE_CURSOR_RESIZE_RIGHT;
} else if (y < GRAB_BORDER_WIDTH) {
if (x < GRAB_BORDER_WIDTH)
operation = GLADE_CURSOR_RESIZE_TOP_LEFT;
- else if (x > widget->allocation.width - GRAB_BORDER_WIDTH)
+ else if (x > allocation.width - GRAB_BORDER_WIDTH)
operation = GLADE_CURSOR_RESIZE_TOP_RIGHT;
else
operation = GLADE_CURSOR_RESIZE_TOP;
- } else if (y > widget->allocation.height - GRAB_BORDER_WIDTH) {
+ } else if (y > allocation.height - GRAB_BORDER_WIDTH) {
if (x < GRAB_BORDER_WIDTH)
operation = GLADE_CURSOR_RESIZE_BOTTOM_LEFT;
- else if (x > widget->allocation.width - GRAB_BORDER_WIDTH)
+ else if (x > allocation.width - GRAB_BORDER_WIDTH)
operation = GLADE_CURSOR_RESIZE_BOTTOM_RIGHT;
else
operation = GLADE_CURSOR_RESIZE_BOTTOM;
@@ -147,6 +149,8 @@ static void
glade_fixed_save_state (GladeFixed *fixed,
GladeWidget *child)
{
+ GtkAllocation allocation;
+
gtk_widget_get_pointer (GTK_WIDGET (GLADE_WIDGET (fixed)->object),
&(GLADE_FIXED (fixed)->pointer_x_origin),
&(GLADE_FIXED (fixed)->pointer_y_origin));
@@ -157,8 +161,9 @@ glade_fixed_save_state (GladeFixed *fixed,
&(fixed->child_x_origin),
&(fixed->child_y_origin));
- fixed->child_width_origin = GTK_WIDGET (child->object)->allocation.width;
- fixed->child_height_origin = GTK_WIDGET (child->object)->allocation.height;
+ gtk_widget_get_allocation (GTK_WIDGET (child->object), &allocation);
+ fixed->child_width_origin = allocation.width;
+ fixed->child_height_origin = allocation.height;
fixed->pointer_x_child_origin =
fixed->pointer_x_origin - fixed->child_x_origin;
@@ -176,12 +181,14 @@ glade_fixed_filter_event (GladeFixed *fixed,
gint top,
gint bottom)
{
+ GtkAllocation allocation;
gint cont_width, cont_height;
g_return_if_fail (x && y);
- cont_width = GTK_WIDGET (GLADE_WIDGET (fixed)->object)->allocation.width;
- cont_height = GTK_WIDGET (GLADE_WIDGET (fixed)->object)->allocation.height;
+ gtk_widget_get_allocation (GTK_WIDGET (GLADE_WIDGET (fixed)->object), &allocation);
+ cont_width = allocation.width;
+ cont_height = allocation.height;
/* Clip out mouse events that are outside the window.
*/
@@ -238,6 +245,7 @@ glade_fixed_handle_swindow (GladeFixed *fixed,
GtkWidget *fixed_widget = GTK_WIDGET (GLADE_WIDGET (fixed)->object);
GtkWidget *swindow = NULL, *swindow_child = NULL;
GtkAdjustment *hadj, *vadj;
+ GtkAllocation child_allocation;
gint x, y;
swindow_child = swindow = fixed_widget;
@@ -246,7 +254,7 @@ glade_fixed_handle_swindow (GladeFixed *fixed,
if (!GTK_IS_VIEWPORT (swindow))
swindow_child = swindow;
- swindow = swindow->parent;
+ swindow = gtk_widget_get_parent (swindow);
}
if (swindow)
@@ -256,15 +264,16 @@ glade_fixed_handle_swindow (GladeFixed *fixed,
*/
hadj = gtk_scrolled_window_get_hadjustment (GTK_SCROLLED_WINDOW (swindow));
vadj = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (swindow));
+ gtk_widget_get_allocation (swindow_child, &child_allocation);
g_object_set (G_OBJECT (hadj),
"lower", 0.0F,
- "upper", (gdouble) swindow_child->allocation.width + 0.0,
+ "upper", (gdouble) child_allocation.width + 0.0,
NULL);
g_object_set (G_OBJECT (vadj),
"lower", 0.0F,
- "upper", (gdouble) swindow_child->allocation.height + 0.0,
+ "upper", (gdouble) child_allocation.height + 0.0,
NULL);
gtk_widget_translate_coordinates (fixed_widget,
@@ -596,7 +605,7 @@ glade_fixed_handle_child_event (GladeFixed *fixed,
handled = TRUE;
}
- gdk_window_get_pointer (GTK_WIDGET (child->object)->window, NULL, NULL, NULL);
+ gdk_window_get_pointer (gtk_widget_get_window (GTK_WIDGET (child->object)), NULL, NULL, NULL);
break;
case GDK_BUTTON_PRESS:
/* We cant rely on GDK_BUTTON1_MASK since event->state isnt yet updated
@@ -686,9 +695,10 @@ glade_fixed_add_child_impl (GladeWidget *gwidget_fixed,
GladeWidget *child,
gboolean at_mouse)
{
- GladeFixed *fixed = GLADE_FIXED (gwidget_fixed);
- GdkRectangle rect;
- gboolean handled;
+ GladeFixed *fixed = GLADE_FIXED (gwidget_fixed);
+ GtkAllocation allocation;
+ GdkRectangle rect;
+ gboolean handled;
g_return_if_fail (GLADE_IS_FIXED (fixed));
g_return_if_fail (GLADE_IS_WIDGET (child));
@@ -725,10 +735,11 @@ glade_fixed_add_child_impl (GladeWidget *gwidget_fixed,
}
else if (at_mouse)
{
+ gtk_widget_get_allocation (GTK_WIDGET (child->object), &allocation);
rect.x = fixed->mouse_x;
rect.y = fixed->mouse_y;
- rect.width = GTK_WIDGET (child->object)->allocation.width;
- rect.height = GTK_WIDGET (child->object)->allocation.height;
+ rect.width = allocation.width;
+ rect.height = allocation.height;
if (rect.width < CHILD_WIDTH_DEF)
rect.width = CHILD_WIDTH_DEF;
diff --git a/gladeui/glade-inspector.c b/gladeui/glade-inspector.c
index 05f63d3..7f11fc3 100644
--- a/gladeui/glade-inspector.c
+++ b/gladeui/glade-inspector.c
@@ -446,7 +446,7 @@ search_complete_func (GObject *object)
static void
widget_font_desc_set_style (GtkWidget *widget, PangoStyle style)
{
- PangoFontDescription *font_desc = pango_font_description_copy (widget->style->font_desc);
+ PangoFontDescription *font_desc = pango_font_description_copy (gtk_widget_get_style (widget)->font_desc);
pango_font_description_set_style (font_desc, style);
gtk_widget_modify_font (widget, font_desc);
@@ -465,7 +465,7 @@ search_entry_update (GladeInspector *inspector)
widget_font_desc_set_style (priv->entry, PANGO_STYLE_ITALIC);
gtk_entry_set_text (GTK_ENTRY (priv->entry), _("< search widgets >"));
gtk_widget_modify_text (priv->entry, GTK_STATE_NORMAL,
- &priv->entry->style->text[GTK_STATE_INSENSITIVE]);
+ >k_widget_get_style (priv->entry)->text[GTK_STATE_INSENSITIVE]);
}
}
diff --git a/gladeui/glade-named-icon-chooser-dialog.c b/gladeui/glade-named-icon-chooser-dialog.c
index 6c37539..5244a13 100644
--- a/gladeui/glade-named-icon-chooser-dialog.c
+++ b/gladeui/glade-named-icon-chooser-dialog.c
@@ -452,7 +452,7 @@ set_busy_cursor (GladeNamedIconChooserDialog *dialog,
else
cursor = NULL;
- gdk_window_set_cursor (GTK_WIDGET (dialog)->window, cursor);
+ gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET (dialog)), cursor);
gdk_display_flush (display);
if (cursor)
@@ -821,7 +821,7 @@ centre_selected_row (GladeNamedIconChooserDialog *dialog)
if (l) {
g_assert (GTK_WIDGET_MAPPED (dialog));
- g_assert (GTK_WIDGET_VISIBLE (dialog));
+ g_assert (gtk_widget_get_visible (GTK_WIDGET (dialog)));
gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (dialog->priv->icons_view),
(GtkTreePath *) l->data,
@@ -1277,7 +1277,7 @@ icon_activated_cb (GladeNamedIconChooserDialog *dialog)
{
GList *children, *l;
- children = gtk_container_get_children (GTK_CONTAINER (GTK_DIALOG (dialog)->action_area));
+ children = gtk_container_get_children (GTK_CONTAINER (gtk_dialog_get_action_area (GTK_DIALOG (dialog))));
for (l = children; l; l = l->next)
{
@@ -1311,7 +1311,7 @@ selection_changed_cb (GladeNamedIconChooserDialog *dialog)
GList *children, *l;
gchar *icon_name;
- children = gtk_container_get_children (GTK_CONTAINER (GTK_DIALOG (dialog)->action_area));
+ children = gtk_container_get_children (GTK_CONTAINER (gtk_dialog_get_action_area (GTK_DIALOG (dialog))));
for (l = children; l; l = l->next)
{
@@ -1348,6 +1348,8 @@ glade_named_icon_chooser_dialog_init (GladeNamedIconChooserDialog *dialog)
GtkWidget *sw;
GtkWidget *label;
GtkWidget *hpaned;
+ GtkWidget *content_area;
+ GtkWidget *action_area;
GtkSizeGroup *group;
dialog->priv = GLADE_NAMED_ICON_CHOOSER_DIALOG_GET_PRIVATE (dialog);
@@ -1366,10 +1368,12 @@ glade_named_icon_chooser_dialog_init (GladeNamedIconChooserDialog *dialog)
gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
- gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), 12);
- gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 12);
- gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->action_area), 0);
- gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->action_area), 6);
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
+ gtk_container_set_border_width (GTK_CONTAINER (content_area), 12);
+ gtk_box_set_spacing (GTK_BOX (content_area), 12);
+ action_area = gtk_dialog_get_action_area (GTK_DIALOG (dialog));
+ gtk_container_set_border_width (GTK_CONTAINER (action_area), 0);
+ gtk_box_set_spacing (GTK_BOX (action_area), 6);
/* We do a signal connection here rather than overriding the method in
* class_init because GtkDialog::response is a RUN_LAST signal. We want *our*
@@ -1489,7 +1493,7 @@ glade_named_icon_chooser_dialog_init (GladeNamedIconChooserDialog *dialog)
dialog);
gtk_box_pack_start (GTK_BOX (contents), dialog->priv->button, FALSE, FALSE, 0);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), contents, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), contents, TRUE, TRUE, 0);
gtk_widget_pop_composite_child ();
diff --git a/gladeui/glade-palette-box.c b/gladeui/glade-palette-box.c
index e8c2e33..74e5f6f 100644
--- a/gladeui/glade-palette-box.c
+++ b/gladeui/glade-palette-box.c
@@ -117,7 +117,7 @@ glade_palette_box_class_init (GladePaletteBoxClass *klass)
static void
glade_palette_box_init (GladePaletteBox *box)
{
- GTK_WIDGET_SET_FLAGS (box, GTK_NO_WINDOW);
+ gtk_widget_set_has_window (GTK_WIDGET (box), FALSE);
gtk_widget_set_redraw_on_allocate (GTK_WIDGET (box), FALSE);
box->priv = GLADE_PALETTE_BOX_GET_PRIVATE (box);
@@ -190,7 +190,7 @@ calculate_children_width_allocation (GtkWidget *widget,
g_assert (child_requisition->width >= 0);
- w = allocation->width - GTK_CONTAINER (widget)->border_width;
+ w = allocation->width - gtk_container_get_border_width (GTK_CONTAINER (widget));
cw = child_requisition->width;
if ((nvis_children * cw) < w )
@@ -210,6 +210,7 @@ glade_palette_box_size_request (GtkWidget *widget, GtkRequisition *requisition)
GtkRequisition child_requisition;
GList *l;
gint nvis_children = 0;
+ guint border_width = 0;
box = GLADE_PALETTE_BOX (widget);
@@ -222,7 +223,7 @@ glade_palette_box_size_request (GtkWidget *widget, GtkRequisition *requisition)
{
child = (GladePaletteBoxChild *) (l->data);
- if (GTK_WIDGET_VISIBLE (child->widget))
+ if (gtk_widget_get_visible (child->widget))
{
GtkRequisition requisition;
gtk_widget_size_request (child->widget, &requisition);
@@ -238,9 +239,10 @@ glade_palette_box_size_request (GtkWidget *widget, GtkRequisition *requisition)
requisition->width += child_requisition.width;
requisition->height += child_requisition.height;
}
-
- requisition->width += GTK_CONTAINER (box)->border_width * 2;
- requisition->height += GTK_CONTAINER (box)->border_width * 2;
+
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (box));
+ requisition->width += border_width * 2;
+ requisition->height += border_width * 2;
}
static void
@@ -255,9 +257,10 @@ glade_palette_box_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
gint x, y;
gint rows = 1;
gint children_width;
+ guint border_width;
box = GLADE_PALETTE_BOX (widget);
- widget->allocation = *allocation;
+ gtk_widget_set_allocation (widget, allocation);
child_requisition.width = 0;
child_requisition.height = 0;
@@ -267,7 +270,7 @@ glade_palette_box_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
{
child = (GladePaletteBoxChild *) (l->data);
- if (GTK_WIDGET_VISIBLE (child->widget))
+ if (gtk_widget_get_visible (child->widget))
{
GtkRequisition requisition;
@@ -283,8 +286,9 @@ glade_palette_box_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
if (nvis_children <= 0)
return;
- x = allocation->x + GTK_CONTAINER (box)->border_width;
- y = allocation->y + GTK_CONTAINER (box)->border_width;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (box));
+ x = allocation->x + border_width;
+ y = allocation->y + border_width;
children_width = calculate_children_width_allocation (widget, allocation,
&child_requisition,
@@ -297,27 +301,29 @@ glade_palette_box_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
child = (GladePaletteBoxChild *) (l->data);
- if (GTK_WIDGET_VISIBLE (child->widget))
+ if (gtk_widget_get_visible (child->widget))
{
child_allocation.x = x;
child_allocation.y = y;
child_allocation.width = children_width;
child_allocation.height = child_requisition.height;
+ guint border_width;
gtk_widget_size_allocate (child->widget, &child_allocation);
x += child_allocation.width;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (box));
/* calculate horizontal space remaining */
horizontal_space_remaining = x
- allocation->x
- + GTK_CONTAINER (box)->border_width
+ + border_width
+ children_width;
/* jump to next row */
if ((horizontal_space_remaining > allocation->width) && l->next )
{
- x = allocation->x + GTK_CONTAINER (box)->border_width;
+ x = allocation->x + border_width;
y += child_allocation.height;
rows++;
}
@@ -336,7 +342,7 @@ glade_palette_box_add (GtkContainer *container, GtkWidget *widget)
g_return_if_fail (GLADE_IS_PALETTE_BOX (container));
g_return_if_fail (GTK_IS_WIDGET (widget));
- g_return_if_fail (widget->parent == NULL);
+ g_return_if_fail (gtk_widget_get_parent (widget) == NULL);
box = GLADE_PALETTE_BOX (container);
@@ -370,7 +376,7 @@ glade_palette_box_remove (GtkContainer *container, GtkWidget *widget)
{
gboolean was_visible;
- was_visible = GTK_WIDGET_VISIBLE (widget);
+ was_visible = gtk_widget_get_visible (widget);
gtk_widget_unparent (widget);
@@ -451,7 +457,7 @@ glade_palette_box_reorder_child (GladePaletteBox *box,
box->priv->children = g_list_insert_before (box->priv->children, new_link, child_info);
gtk_widget_child_notify (child, "position");
- if (GTK_WIDGET_VISIBLE (child) && GTK_WIDGET_VISIBLE (box))
+ if (gtk_widget_get_visible (child) && gtk_widget_get_visible (GTK_WIDGET (box)))
gtk_widget_queue_resize (child);
}
diff --git a/gladeui/glade-palette-expander.c b/gladeui/glade-palette-expander.c
index 70a0e19..3fa42c3 100644
--- a/gladeui/glade-palette-expander.c
+++ b/gladeui/glade-palette-expander.c
@@ -187,8 +187,8 @@ glade_palette_expander_init (GladePaletteExpander *expander)
GtkWidget *alignment;
expander->priv = priv = GLADE_PALETTE_EXPANDER_GET_PRIVATE (expander);
-
- GTK_WIDGET_SET_FLAGS (expander, GTK_NO_WINDOW);
+
+ gtk_widget_set_has_window (GTK_WIDGET (expander), FALSE);
priv->spacing = 0;
priv->expanded = FALSE;
@@ -298,19 +298,20 @@ glade_palette_expander_size_request (GtkWidget *widget,
GladePaletteExpanderPrivate *priv;
GladePaletteExpander *expander;
GtkBin *bin;
- gint border_width;
+ GtkWidget *child;
+ guint border_width;
bin = GTK_BIN (widget);
expander = GLADE_PALETTE_EXPANDER (widget);
priv = expander->priv;
- border_width = GTK_CONTAINER (widget)->border_width;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
requisition->width = 0;
requisition->height = 0;
- if (GTK_WIDGET_VISIBLE (priv->button))
+ if (gtk_widget_get_visible (priv->button))
{
GtkRequisition button_requisition;
@@ -320,11 +321,12 @@ glade_palette_expander_size_request (GtkWidget *widget,
requisition->height += button_requisition.height;
}
- if (bin->child && gtk_widget_get_child_visible (bin->child))
+ child = gtk_bin_get_child (bin);
+ if (child && gtk_widget_get_child_visible (child))
{
GtkRequisition child_requisition;
- gtk_widget_size_request (bin->child, &child_requisition);
+ gtk_widget_size_request (child, &child_requisition);
requisition->width = MAX (requisition->width, child_requisition.width);
requisition->height += child_requisition.height + priv->spacing;
@@ -341,37 +343,39 @@ glade_palette_expander_size_allocate (GtkWidget *widget,
GladePaletteExpanderPrivate *priv;
GladePaletteExpander *expander;
GtkBin *bin;
+ GtkWidget *child;
GtkRequisition child_requisition;
gboolean child_visible = FALSE;
- gint border_width;
+ guint border_width;
gint button_height;
expander = GLADE_PALETTE_EXPANDER (widget);
bin = GTK_BIN (widget);
priv = expander->priv;
- border_width = GTK_CONTAINER (widget)->border_width;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
child_requisition.width = 0;
child_requisition.height = 0;
-
- if (bin->child && gtk_widget_get_child_visible (bin->child))
+
+ child = gtk_bin_get_child (bin);
+ if (child && gtk_widget_get_child_visible (child))
{
child_visible = TRUE;
- gtk_widget_get_child_requisition (bin->child, &child_requisition);
+ gtk_widget_get_child_requisition (child, &child_requisition);
}
- widget->allocation = *allocation;
+ gtk_widget_set_allocation (widget, allocation);
- if (GTK_WIDGET_VISIBLE (priv->button))
+ if (gtk_widget_get_visible (priv->button))
{
GtkAllocation button_allocation;
GtkRequisition button_requisition;
gtk_widget_get_child_requisition (priv->button, &button_requisition);
- button_allocation.x = widget->allocation.x + border_width;
- button_allocation.y = widget->allocation.y + border_width;
+ button_allocation.x = allocation->x + border_width;
+ button_allocation.y = allocation->y + border_width;
button_allocation.width = MAX (allocation->width - 2 * border_width, 1);
@@ -394,8 +398,8 @@ glade_palette_expander_size_allocate (GtkWidget *widget,
{
GtkAllocation child_allocation;
- child_allocation.x = widget->allocation.x + border_width;
- child_allocation.y = widget->allocation.y + border_width + button_height + priv->spacing;
+ child_allocation.x = allocation->x + border_width;
+ child_allocation.y = allocation->y + border_width + button_height + priv->spacing;
child_allocation.width = MAX (allocation->width - 2 * border_width, 1);
@@ -403,7 +407,7 @@ glade_palette_expander_size_allocate (GtkWidget *widget,
2 * border_width - priv->spacing;
child_allocation.height = MAX (child_allocation.height, 1);
- gtk_widget_size_allocate (bin->child, &child_allocation);
+ gtk_widget_size_allocate (child, &child_allocation);
}
}
@@ -448,7 +452,7 @@ glade_palette_expander_remove (GtkContainer *container,
gtk_widget_unparent (expander->priv->button);
expander->priv->button = NULL;
- if (GTK_WIDGET_VISIBLE (expander))
+ if (gtk_widget_get_visible (GTK_WIDGET (expander)))
gtk_widget_queue_resize (GTK_WIDGET (expander));
g_object_notify (G_OBJECT (expander), "label");
@@ -467,10 +471,12 @@ glade_palette_expander_forall (GtkContainer *container,
gpointer callback_data)
{
GtkBin *bin = GTK_BIN (container);
+ GtkWidget *child;
GladePaletteExpanderPrivate *priv = GLADE_PALETTE_EXPANDER_GET_PRIVATE (container);
-
- if (bin->child)
- (* callback) (bin->child, callback_data);
+
+ child = gtk_bin_get_child (bin);
+ if (child)
+ (* callback) (child, callback_data);
if (priv->button)
(* callback) (priv->button, callback_data);
@@ -550,6 +556,7 @@ void
glade_palette_expander_set_expanded (GladePaletteExpander *expander, gboolean expanded)
{
GladePaletteExpanderPrivate *priv;
+ GtkWidget *child;
g_return_if_fail (GLADE_IS_PALETTE_EXPANDER (expander));
@@ -561,9 +568,10 @@ glade_palette_expander_set_expanded (GladePaletteExpander *expander, gboolean ex
{
priv->expanded = expanded;
- if (GTK_BIN (expander)->child)
+ child = gtk_bin_get_child (GTK_BIN (expander));
+ if (child)
{
- gtk_widget_set_child_visible (GTK_BIN (expander)->child, priv->expanded);
+ gtk_widget_set_child_visible (child, priv->expanded);
gtk_widget_queue_resize (GTK_WIDGET (expander));
}
diff --git a/gladeui/glade-palette.c b/gladeui/glade-palette.c
index a12519a..aff2287 100644
--- a/gladeui/glade-palette.c
+++ b/gladeui/glade-palette.c
@@ -210,7 +210,7 @@ glade_palette_set_show_selector_button (GladePalette *palette, gboolean show_sel
g_return_if_fail (GLADE_IS_PALETTE (palette));
priv = GLADE_PALETTE_GET_PRIVATE (palette);
- if (GTK_WIDGET_VISIBLE (priv->selector_hbox) != show_selector_button)
+ if (gtk_widget_get_visible (priv->selector_hbox) != show_selector_button)
{
if (show_selector_button)
gtk_widget_show (priv->selector_hbox);
@@ -278,7 +278,7 @@ glade_palette_get_property (GObject *object,
g_value_set_boolean (value, priv->use_small_item_icons);
break;
case PROP_SHOW_SELECTOR_BUTTON:
- g_value_set_boolean (value, GTK_WIDGET_VISIBLE (priv->selector_button));
+ g_value_set_boolean (value, gtk_widget_get_visible (priv->selector_button));
break;
case PROP_ITEM_APPEARANCE:
g_value_set_enum (value, priv->item_appearance);
@@ -495,7 +495,7 @@ glade_palette_on_button_toggled (GtkWidget *button, GladePalette *palette)
/* check whether to enable sticky selection */
adaptor = glade_palette_item_get_adaptor (GLADE_PALETTE_ITEM (button));
- gdk_window_get_pointer (button->window, NULL, NULL, &mask);
+ gdk_window_get_pointer (gtk_widget_get_window (button), NULL, NULL, &mask);
priv->sticky_selection_mode = (!GWA_IS_TOPLEVEL (adaptor)) && (mask & GDK_CONTROL_MASK);
g_signal_emit (G_OBJECT (palette), glade_palette_signals[TOGGLED], 0);
@@ -839,7 +839,7 @@ glade_palette_get_show_selector_button (GladePalette *palette)
{
g_return_val_if_fail (GLADE_IS_PALETTE (palette), FALSE);
- return GTK_WIDGET_VISIBLE (palette->priv->selector_hbox);
+ return gtk_widget_get_visible (palette->priv->selector_hbox);
}
/**
diff --git a/gladeui/glade-placeholder.c b/gladeui/glade-placeholder.c
index 893a954..3a8814d 100644
--- a/gladeui/glade-placeholder.c
+++ b/gladeui/glade-placeholder.c
@@ -128,7 +128,7 @@ glade_placeholder_init (GladePlaceholder *placeholder)
placeholder->placeholder_pixmap = NULL;
placeholder->packing_actions = NULL;
- GTK_WIDGET_SET_FLAGS (GTK_WIDGET (placeholder), GTK_CAN_FOCUS);
+ gtk_widget_set_can_focus (GTK_WIDGET (placeholder), TRUE);
gtk_widget_set_size_request (GTK_WIDGET (placeholder),
WIDTH_REQUISITION,
@@ -178,6 +178,8 @@ static void
glade_placeholder_realize (GtkWidget *widget)
{
GladePlaceholder *placeholder;
+ GtkAllocation allocation;
+ GdkWindow *window;
GdkWindowAttr attributes;
gint attributes_mask;
@@ -188,10 +190,11 @@ glade_placeholder_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);
@@ -204,10 +207,11 @@ glade_placeholder_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, placeholder);
+ 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, placeholder);
- widget->style = gtk_style_attach (widget->style, widget->window);
+ gtk_widget_set_style (widget, gtk_style_attach (gtk_widget_get_style (widget), gtk_widget_get_window (widget)));
glade_placeholder_send_configure (GLADE_PLACEHOLDER (widget));
@@ -219,7 +223,7 @@ glade_placeholder_realize (GtkWidget *widget)
g_assert(G_IS_OBJECT(placeholder->placeholder_pixmap));
}
- gdk_window_set_back_pixmap (GTK_WIDGET (placeholder)->window, placeholder->placeholder_pixmap, FALSE);
+ gdk_window_set_back_pixmap (gtk_widget_get_window (GTK_WIDGET (placeholder)), placeholder->placeholder_pixmap, FALSE);
}
static void
@@ -228,11 +232,11 @@ glade_placeholder_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
g_return_if_fail (GLADE_IS_PLACEHOLDER (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);
@@ -244,16 +248,18 @@ static void
glade_placeholder_send_configure (GladePlaceholder *placeholder)
{
GtkWidget *widget;
+ GtkAllocation allocation;
GdkEvent *event = gdk_event_new (GDK_CONFIGURE);
widget = GTK_WIDGET (placeholder);
- 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);
@@ -270,14 +276,16 @@ glade_placeholder_get_project (GladePlaceholder *placeholder)
static gboolean
glade_placeholder_expose (GtkWidget *widget, GdkEventExpose *event)
{
+ GtkStyle *style;
GdkGC *light_gc;
GdkGC *dark_gc;
gint w, h;
g_return_val_if_fail (GLADE_IS_PLACEHOLDER (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);
@@ -333,7 +341,7 @@ glade_placeholder_button_press (GtkWidget *widget, GdkEventButton *event)
placeholder = GLADE_PLACEHOLDER (widget);
project = glade_placeholder_get_project (placeholder);
- if (!GTK_WIDGET_HAS_FOCUS (widget))
+ if (!gtk_widget_has_focus (widget))
gtk_widget_grab_focus (widget);
if (event->button == 1 && event->type == GDK_BUTTON_PRESS)
diff --git a/gladeui/glade-popup.c b/gladeui/glade-popup.c
index 67ba7f4..84f67b7 100644
--- a/gladeui/glade-popup.c
+++ b/gladeui/glade-popup.c
@@ -551,7 +551,7 @@ glade_popup_create_clipboard_menu (GladeWidget *widget)
popup_menu = gtk_menu_new ();
- if (GTK_WIDGET_TOPLEVEL (glade_widget_get_object (widget)))
+ if (gtk_widget_is_toplevel (GTK_WIDGET (glade_widget_get_object (widget))))
{
glade_popup_append_item (popup_menu, GTK_STOCK_PASTE,
NULL, NULL, TRUE,
diff --git a/gladeui/glade-project.c b/gladeui/glade-project.c
index 9be067c..6aff9c1 100644
--- a/gladeui/glade-project.c
+++ b/gladeui/glade-project.c
@@ -1591,7 +1591,7 @@ glade_project_write (GladeProject *project)
{
GladeXmlContext *context;
GladeXmlDoc *doc;
- GladeXmlNode *root, *comment_node;
+ GladeXmlNode *root; /* *comment_node; */
GList *list;
doc = glade_xml_doc_new ();
@@ -1600,7 +1600,7 @@ glade_project_write (GladeProject *project)
glade_xml_doc_set_root (doc, root);
glade_project_update_comment (project);
-/* comment_node = glade_xml_node_new_comment (context, project->priv->comment); */
+ /* comment_node = glade_xml_node_new_comment (context, project->priv->comment); */
/* XXX Need to append this to the doc ! not the ROOT !
glade_xml_node_append_child (root, comment_node); */
@@ -4075,19 +4075,19 @@ glade_project_build_prefs_dialog (GladeProject *project)
g_free (name);
widget = glade_project_build_prefs_box (project);
- gtk_box_pack_end (GTK_BOX (GTK_DIALOG (dialog)->vbox),
+ gtk_box_pack_end (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))),
widget, TRUE, TRUE, 2);
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
- gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 2);
+ gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), 2);
gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
/* HIG spacings */
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
- gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 2); /* 2 * 5 + 2 = 12 */
- gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->action_area), 5);
- gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->action_area), 6);
+ gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), 2); /* 2 * 5 + 2 = 12 */
+ gtk_container_set_border_width (GTK_CONTAINER (gtk_dialog_get_action_area (GTK_DIALOG (dialog))), 5);
+ gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_action_area (GTK_DIALOG (dialog))), 6);
/* Were explicitly destroying it anyway */
diff --git a/gladeui/glade-property-class.c b/gladeui/glade-property-class.c
index f1ef33b..87bf8c9 100644
--- a/gladeui/glade-property-class.c
+++ b/gladeui/glade-property-class.c
@@ -292,27 +292,27 @@ glade_property_class_make_string_from_object (GladePropertyClass *property_class
GString *str = g_string_sized_new (G_ASCII_DTOSTR_BUF_SIZE * 6 + 6);
gchar buff[G_ASCII_DTOSTR_BUF_SIZE];
- g_ascii_dtostr (buff, sizeof (buff), adj->value);
+ g_ascii_dtostr (buff, sizeof (buff), gtk_adjustment_get_value (adj));
g_string_append (str, buff);
g_string_append_c (str, ' ');
- g_ascii_dtostr (buff, sizeof (buff), adj->lower);
+ g_ascii_dtostr (buff, sizeof (buff), gtk_adjustment_get_lower (adj));
g_string_append (str, buff);
g_string_append_c (str, ' ');
- g_ascii_dtostr (buff, sizeof (buff), adj->upper);
+ g_ascii_dtostr (buff, sizeof (buff), gtk_adjustment_get_upper (adj));
g_string_append (str, buff);
g_string_append_c (str, ' ');
- g_ascii_dtostr (buff, sizeof (buff), adj->step_increment);
+ g_ascii_dtostr (buff, sizeof (buff), gtk_adjustment_get_step_increment (adj));
g_string_append (str, buff);
g_string_append_c (str, ' ');
- g_ascii_dtostr (buff, sizeof (buff), adj->page_increment);
+ g_ascii_dtostr (buff, sizeof (buff), gtk_adjustment_get_page_increment (adj));
g_string_append (str, buff);
g_string_append_c (str, ' ');
- g_ascii_dtostr (buff, sizeof (buff), adj->page_size);
+ g_ascii_dtostr (buff, sizeof (buff), gtk_adjustment_get_page_size (adj));
g_string_append (str, buff);
string = g_string_free (str, FALSE);
diff --git a/gladeui/glade-widget.c b/gladeui/glade-widget.c
index 406d6e4..46408f5 100644
--- a/gladeui/glade-widget.c
+++ b/gladeui/glade-widget.c
@@ -302,7 +302,7 @@ glade_widget_button_press_event_impl (GladeWidget *gwidget,
/* make sure to grab focus, since we may stop default handlers */
widget = GTK_WIDGET (glade_widget_get_object (gwidget));
- if (GTK_WIDGET_CAN_FOCUS (widget) && !GTK_WIDGET_HAS_FOCUS (widget))
+ if (gtk_widget_get_can_focus (widget) && !gtk_widget_has_focus (widget))
gtk_widget_grab_focus (widget);
/* if it's already selected don't stop default handlers, e.g. toggle button */
@@ -780,7 +780,7 @@ glade_widget_constructor (GType type,
if (gwidget->parent && gwidget->packing_properties == NULL)
glade_widget_set_packing_properties (gwidget, gwidget->parent);
- if (GTK_IS_WIDGET (gwidget->object) && !GTK_WIDGET_TOPLEVEL (gwidget->object))
+ if (GTK_IS_WIDGET (gwidget->object) && !gtk_widget_is_toplevel (GTK_WIDGET (gwidget->object)))
{
gwidget->visible = TRUE;
gtk_widget_show_all (GTK_WIDGET (gwidget->object));
@@ -2011,10 +2011,13 @@ glade_widget_hide (GladeWidget *widget)
if ((view = glade_design_view_get_from_project (glade_widget_get_project (widget))) != NULL)
{
+ GtkWidget *child;
+
layout = GTK_WIDGET (glade_design_view_get_layout (view));
+ child = gtk_bin_get_child (GTK_BIN (layout));
- if (GTK_BIN (layout)->child == GTK_WIDGET (widget->object))
- gtk_container_remove (GTK_CONTAINER (layout), GTK_BIN (layout)->child);
+ if (child == GTK_WIDGET (widget->object))
+ gtk_container_remove (GTK_CONTAINER (layout), child);
}
gtk_widget_hide (GTK_WIDGET (widget->object));
@@ -3280,7 +3283,7 @@ glade_widget_event_private (GtkWidget *widget,
/* Find the parenting layout container */
while (layout && !GLADE_IS_DESIGN_LAYOUT (layout))
- layout = layout->parent;
+ layout = gtk_widget_get_parent (layout);
/* Event outside the logical heirarchy, could be a menuitem
* or other such popup window, we'll presume to send it directly
@@ -4199,12 +4202,12 @@ glade_window_is_embedded (GtkWindow *window)
static void
embedded_window_realize_handler (GtkWidget *widget)
{
- GtkWindow *window;
+ GtkAllocation allocation;
+ GtkStyle *style;
+ GdkWindow *window;
GdkWindowAttr attributes;
gint attributes_mask;
- window = GTK_WINDOW (widget);
-
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
attributes.window_type = GDK_WINDOW_CHILD;
@@ -4212,10 +4215,11 @@ embedded_window_realize_handler (GtkWidget *widget)
attributes.visual = gtk_widget_get_visual (widget);
attributes.colormap = gtk_widget_get_colormap (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.event_mask = gtk_widget_get_events (widget) |
GDK_EXPOSURE_MASK |
@@ -4229,33 +4233,39 @@ embedded_window_realize_handler (GtkWidget *widget)
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
/* destroy the previously created window */
- if (GDK_IS_WINDOW (widget->window))
+ window = gtk_widget_get_window (widget);
+ if (GDK_IS_WINDOW (window))
{
- gdk_window_hide (widget->window);
+ gdk_window_hide (window);
}
- widget->window = gdk_window_new (gtk_widget_get_parent_window (widget),
- &attributes, attributes_mask);
+ window = gdk_window_new (gtk_widget_get_parent_window (widget),
+ &attributes, attributes_mask);
+ gtk_widget_set_window (widget, window);
- gdk_window_enable_synchronized_configure (widget->window);
+ gdk_window_enable_synchronized_configure (window);
- gdk_window_set_user_data (widget->window, window);
+ gdk_window_set_user_data (window, GTK_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
embedded_window_size_allocate_handler (GtkWidget *widget)
{
+ GtkAllocation allocation;
+
if (GTK_WIDGET_REALIZED (widget))
{
- gdk_window_move_resize (widget->window,
- widget->allocation.x,
- widget->allocation.y,
- widget->allocation.width,
- widget->allocation.height);
+ gtk_widget_get_allocation (widget, &allocation);
+ gdk_window_move_resize (gtk_widget_get_window (widget),
+ allocation.x,
+ allocation.y,
+ allocation.width,
+ allocation.height);
}
}
diff --git a/plugins/gtk+/glade-accels.c b/plugins/gtk+/glade-accels.c
index 3d06cae..59a70ab 100644
--- a/plugins/gtk+/glade-accels.c
+++ b/plugins/gtk+/glade-accels.c
@@ -518,7 +518,8 @@ glade_eprop_accel_show_dialog (GtkWidget *dialog_button,
gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), vbox, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))),
+ vbox, TRUE, TRUE, 0);
sw = gtk_scrolled_window_new (NULL, NULL);
gtk_widget_show (sw);
diff --git a/plugins/gtk+/glade-activatable-editor.c b/plugins/gtk+/glade-activatable-editor.c
index 97b30e9..30d48bb 100644
--- a/plugins/gtk+/glade-activatable-editor.c
+++ b/plugins/gtk+/glade-activatable-editor.c
@@ -286,7 +286,7 @@ reset_properties (GladeWidget *gwidget,
/* If theres a widget customly inside... command remove it first... */
button = GTK_WIDGET (gwidget->object);
- child = GTK_BIN (button)->child;
+ child = gtk_bin_get_child (GTK_BIN (button));
if (child)
gchild = glade_widget_get_from_gobject (child);
@@ -378,7 +378,7 @@ glade_activatable_editor_new (GladeWidgetAdaptor *adaptor,
{
GladeActivatableEditor *activatable_editor;
GladeEditorProperty *eprop;
- GtkWidget *table, *frame, *alignment, *label, *hbox;
+ GtkWidget *table, *frame, *alignment, *label;
GtkSizeGroup *group;
gchar *str;
gint row = 0;
diff --git a/plugins/gtk+/glade-attributes.c b/plugins/gtk+/glade-attributes.c
index 32228a0..a1f2a44 100755
--- a/plugins/gtk+/glade-attributes.c
+++ b/plugins/gtk+/glade-attributes.c
@@ -700,6 +700,7 @@ value_button_clicked (GtkCellRendererToggle *cell_renderer,
GladeEPropAttrs *eprop_attrs)
{
GtkWidget *dialog;
+ GtkWidget *colorsel;
GtkTreeIter iter;
PangoAttrType type;
AttrEditType edit_type;
@@ -722,15 +723,15 @@ value_button_clicked (GtkCellRendererToggle *cell_renderer,
case EDIT_COLOR:
dialog = gtk_color_selection_dialog_new (_("Select a color"));
+ colorsel = gtk_color_selection_dialog_get_color_selection (GTK_COLOR_SELECTION_DIALOG (dialog));
+
/* Get response etc... */
if (text && gdk_color_parse (text, &color))
- gtk_color_selection_set_current_color
- (GTK_COLOR_SELECTION (GTK_COLOR_SELECTION_DIALOG (dialog)->colorsel), &color);
+ gtk_color_selection_set_current_color (GTK_COLOR_SELECTION (colorsel), &color);
gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_color_selection_get_current_color
- (GTK_COLOR_SELECTION (GTK_COLOR_SELECTION_DIALOG (dialog)->colorsel), &color);
+ gtk_color_selection_get_current_color (GTK_COLOR_SELECTION (colorsel), &color);
new_text = gdk_color_to_string (&color);
@@ -1026,7 +1027,8 @@ glade_eprop_attrs_show_dialog (GtkWidget *dialog_button,
gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), vbox, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))),
+ vbox, TRUE, TRUE, 0);
sw = gtk_scrolled_window_new (NULL, NULL);
gtk_widget_show (sw);
diff --git a/plugins/gtk+/glade-button-editor.c b/plugins/gtk+/glade-button-editor.c
index 17cb50d..1f27f7d 100644
--- a/plugins/gtk+/glade-button-editor.c
+++ b/plugins/gtk+/glade-button-editor.c
@@ -133,7 +133,7 @@ glade_button_editor_load (GladeEditable *editable,
glade_widget_property_get (widget, "use-action-appearance", &use_appearance);
button = GTK_WIDGET (widget->object);
- child = GTK_BIN (button)->child;
+ child = gtk_bin_get_child (GTK_BIN (button));
if (child)
gchild = glade_widget_get_from_gobject (child);
@@ -239,7 +239,7 @@ standard_toggled (GtkWidget *widget,
/* If theres a widget customly inside... command remove it first... */
button = GTK_WIDGET (button_editor->loaded_widget->object);
- child = GTK_BIN (button)->child;
+ child = gtk_bin_get_child (GTK_BIN (button));
if (child)
gchild = glade_widget_get_from_gobject (child);
diff --git a/plugins/gtk+/glade-column-types.c b/plugins/gtk+/glade-column-types.c
index 4ded5da..ae73589 100644
--- a/plugins/gtk+/glade-column-types.c
+++ b/plugins/gtk+/glade-column-types.c
@@ -766,7 +766,7 @@ types_combo_editing_started (GtkCellRenderer *renderer,
gtk_entry_completion_set_model (completion, types_model);
gtk_entry_completion_set_text_column (completion, 0);
gtk_entry_completion_set_inline_completion (completion, TRUE);
- gtk_entry_set_completion (GTK_ENTRY (GTK_BIN (editable)->child), completion);
+ gtk_entry_set_completion (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (editable))), completion);
g_object_unref (G_OBJECT (completion));
}
diff --git a/plugins/gtk+/glade-gtk.c b/plugins/gtk+/glade-gtk.c
index 3cbd80c..b55eddc 100644
--- a/plugins/gtk+/glade-gtk.c
+++ b/plugins/gtk+/glade-gtk.c
@@ -1214,7 +1214,7 @@ glade_gtk_widget_action_activate (GladeWidgetAdaptor *adaptor,
{
GladeWidget *gwidget = glade_widget_get_from_gobject (object), *gparent;
GList this_widget = { 0, }, that_widget = { 0, };
- GtkWidget *parent = GTK_WIDGET (object)->parent;
+ GtkWidget *parent = gtk_widget_get_parent (GTK_WIDGET (object));
if (parent)
gparent = glade_widget_get_from_gobject (parent);
@@ -1310,7 +1310,7 @@ glade_gtk_widget_action_activate (GladeWidgetAdaptor *adaptor,
if (new_type == GTK_TYPE_FRAME)
{
GObject *frame = glade_widget_get_object (that_widget.data);
- GladeWidget *galign = glade_widget_get_from_gobject (GTK_BIN (frame)->child);
+ GladeWidget *galign = glade_widget_get_from_gobject (gtk_bin_get_child (GTK_BIN (frame)));
GList to_delete = { 0, };
to_delete.data = galign;
@@ -1476,7 +1476,7 @@ glade_gtk_container_replace_child (GladeWidgetAdaptor *adaptor,
guint nproperties;
guint i;
- if (current->parent != container)
+ if (gtk_widget_get_parent (current) != container)
return;
param_spec = gtk_container_class_list_child_properties
@@ -1526,11 +1526,13 @@ glade_gtk_container_add_child (GladeWidgetAdaptor *adaptor,
GtkWidget *container,
GtkWidget *child)
{
+ GtkWidget *container_child = gtk_bin_get_child (GTK_BIN (container));
+
/* Get a placeholder out of the way before adding the child if its a GtkBin
*/
- if (GTK_IS_BIN (container) && GTK_BIN (container)->child != NULL &&
- GLADE_IS_PLACEHOLDER (GTK_BIN (container)->child))
- gtk_container_remove (GTK_CONTAINER (container), GTK_BIN (container)->child);
+ if (GTK_IS_BIN (container) && container_child != NULL &&
+ GLADE_IS_PLACEHOLDER (container_child))
+ gtk_container_remove (GTK_CONTAINER (container), container_child);
gtk_container_add (GTK_CONTAINER (container), child);
}
@@ -1606,24 +1608,26 @@ glade_gtk_box_configure_child (GladeFixed *fixed,
GdkRectangle *rect,
GtkWidget *box)
{
- GList *list;
- GtkBoxChild *bchild;
- gint point, trans_point, span,
- iter_span, position, old_position,
+ GList *list;
+ GtkBoxChild *bchild;
+ GtkAllocation allocation, bchild_allocation;
+ gint point, trans_point, span,
+ iter_span, position, old_position,
offset, orig_offset;
- gboolean found = FALSE;
+ gboolean found = FALSE;
+ gtk_widget_get_allocation (GTK_WIDGET (child->object), &allocation);
if (GTK_IS_HBOX (box) || GTK_IS_HBUTTON_BOX (box))
{
point = fixed->mouse_x;
- span = GTK_WIDGET (child->object)->allocation.width;
+ span = allocation.width;
offset = rect->x;
orig_offset = fixed->child_x_origin;
}
else
{
point = fixed->mouse_y;
- span = GTK_WIDGET (child->object)->allocation.height;
+ span = allocation.height;
offset = rect->y;
orig_offset = fixed->child_y_origin;
}
@@ -1631,7 +1635,7 @@ glade_gtk_box_configure_child (GladeFixed *fixed,
glade_widget_pack_property_get
(child, "position", &old_position);
- for (list = GTK_BOX (box)->children; list; list = list->next)
+ for (list = gtk_container_get_children (GTK_CONTAINER (box)); list; list = list->next)
{
bchild = list->data;
@@ -1643,20 +1647,21 @@ glade_gtk_box_configure_child (GladeFixed *fixed,
* position.
*/
+ gtk_widget_get_allocation (GTK_WIDGET (bchild->widget), &bchild_allocation);
if (GTK_IS_HBOX (box) || GTK_IS_HBUTTON_BOX (box))
{
gtk_widget_translate_coordinates
(GTK_WIDGET (box), bchild->widget,
point, 0, &trans_point, NULL);
- iter_span = bchild->widget->allocation.width;
+ iter_span = bchild_allocation.width;
}
else
{
gtk_widget_translate_coordinates
(GTK_WIDGET (box), bchild->widget,
0, point, NULL, &trans_point);
- iter_span = bchild->widget->allocation.height;
+ iter_span = bchild_allocation.height;
}
#if 0
@@ -1713,7 +1718,7 @@ glade_gtk_box_configure_begin (GladeFixed *fixed,
g_assert (glade_gtk_box_original_positions == NULL);
- for (list = GTK_BOX (box)->children; list; list = list->next)
+ for (list = gtk_container_get_children (GTK_CONTAINER (box)); list; list = list->next)
{
GladeGtkBoxChild *gbchild;
GladeWidget *gchild;
@@ -1742,7 +1747,7 @@ glade_gtk_box_configure_end (GladeFixed *fixed,
GList *list, *l;
GList *prop_list = NULL;
- for (list = GTK_BOX (box)->children; list; list = list->next)
+ for (list = gtk_container_get_children (GTK_CONTAINER (box)); list; list = list->next)
{
GtkBoxChild *bchild = list->data;
@@ -1975,7 +1980,8 @@ glade_gtk_box_get_property (GladeWidgetAdaptor *adaptor,
GtkBox *box = GTK_BOX (object);
g_value_reset (value);
- g_value_set_int (value, g_list_length (box->children));
+ g_value_set_int (value,
+ g_list_length (gtk_container_get_children (GTK_CONTAINER (box))));
}
else
GWA_GET_CLASS (GTK_TYPE_CONTAINER)->get_property (adaptor, object, id, value);
@@ -1988,7 +1994,7 @@ glade_gtk_box_get_first_blank (GtkBox *box)
GladeWidget *gwidget;
gint position;
- for (child = box->children, position = 0;
+ for (child = gtk_container_get_children (GTK_CONTAINER (box)), position = 0;
child && child->data;
child = child->next, position++)
{
@@ -2012,7 +2018,7 @@ static void
glade_gtk_box_set_size (GObject *object, const GValue *value)
{
GtkBox *box;
- GList *child;
+ GList *child, *children;
guint new_size, old_size, i;
box = GTK_BOX (object);
@@ -2021,7 +2027,9 @@ glade_gtk_box_set_size (GObject *object, const GValue *value)
if (glade_util_object_is_loading (object))
return;
- old_size = g_list_length (box->children);
+ children = gtk_container_get_children (GTK_CONTAINER (box));
+
+ old_size = g_list_length (children);
new_size = g_value_get_int (value);
if (old_size == new_size)
@@ -2031,7 +2039,7 @@ glade_gtk_box_set_size (GObject *object, const GValue *value)
*/
for (i = 0; i < new_size; i++)
{
- if (g_list_length(box->children) < (i + 1))
+ if (g_list_length(children) < (i + 1))
{
GtkWidget *placeholder = glade_placeholder_new ();
gint blank = glade_gtk_box_get_first_blank (box);
@@ -2042,9 +2050,9 @@ glade_gtk_box_set_size (GObject *object, const GValue *value)
}
/* The box has shrunk. Remove the widgets that are on those slots */
- for (child = g_list_last (box->children);
+ for (child = g_list_last (children);
child && old_size > new_size;
- child = g_list_last (box->children), old_size--)
+ child = g_list_last (children), old_size--)
{
GtkWidget *child_widget = ((GtkBoxChild *) (child->data))->widget;
@@ -2079,10 +2087,10 @@ glade_gtk_box_verify_size (GObject *object, const GValue *value)
{
GtkBox *box = GTK_BOX(object);
GList *child;
- gint old_size = g_list_length (box->children);
+ gint old_size = g_list_length (gtk_container_get_children (GTK_CONTAINER (box)));
gint new_size = g_value_get_int (value);
- for (child = g_list_last (box->children);
+ for (child = g_list_last (gtk_container_get_children (GTK_CONTAINER (box)));
child && old_size > new_size;
child = g_list_previous (child), old_size--)
{
@@ -2166,7 +2174,9 @@ glade_gtk_box_add_child (GladeWidgetAdaptor *adaptor,
GList *l;
GtkBox *box = GTK_BOX (object);
- for (l = g_list_last (box->children); l; l = g_list_previous (l))
+ for (l = g_list_last (gtk_container_get_children (GTK_CONTAINER (box)));
+ l;
+ l = g_list_previous (l))
{
GtkWidget *child_widget = ((GtkBoxChild *) (l->data))->widget;
if (GLADE_IS_PLACEHOLDER (child_widget))
@@ -2179,7 +2189,7 @@ glade_gtk_box_add_child (GladeWidgetAdaptor *adaptor,
gtk_container_add (GTK_CONTAINER (object), GTK_WIDGET (child));
- num_children = g_list_length (GTK_BOX (object)->children);
+ num_children = g_list_length (gtk_container_get_children (GTK_CONTAINER (object)));
glade_widget_property_set (gbox, "size", num_children);
gchild = glade_widget_get_from_gobject (child);
@@ -2358,10 +2368,13 @@ glade_gtk_table_get_row_col_from_point (GtkTable *table,
gint point)
{
GtkTableChild *tchild;
+ GtkAllocation allocation;
GList *list;
gint span, trans_point, size, base, end;
- for (list = table->children; list; list = list->next)
+ for (list = gtk_container_get_children (GTK_CONTAINER (table));
+ list;
+ list = list->next)
{
tchild = list->data;
@@ -2373,20 +2386,18 @@ glade_gtk_table_get_row_col_from_point (GtkTable *table,
gtk_widget_translate_coordinates
(GTK_WIDGET (table), tchild->widget,
point, 0, &trans_point, NULL);
-
+
+ gtk_widget_get_allocation (tchild->widget, &allocation);
/* Find any widget in our row/column
*/
- end = row ?
- tchild->widget->allocation.height :
- tchild->widget->allocation.width;
+ end = row ? allocation.height : allocation.width;
if (trans_point >= 0 &&
/* should be trans_point < end ... test FIXME ! */
trans_point < end)
{
base = row ? tchild->top_attach : tchild->left_attach;
- size = row ? (tchild->widget->allocation.height) :
- (tchild->widget->allocation.width);
+ size = row ? allocation.height : allocation.width;
span = row ? (tchild->bottom_attach - tchild->top_attach) :
(tchild->right_attach - tchild->left_attach);
@@ -2407,10 +2418,11 @@ glade_gtk_table_point_crosses_threshold (GtkTable *table,
{
GtkTableChild *tchild;
+ GtkAllocation allocation;
GList *list;
gint span, trans_point, size, rowcol_size, base;
- for (list = table->children; list; list = list->next)
+ for (list = gtk_container_get_children (GTK_CONTAINER (table)); list; list = list->next)
{
tchild = list->data;
@@ -2431,8 +2443,8 @@ glade_gtk_table_point_crosses_threshold (GtkTable *table,
span = row ? (tchild->bottom_attach - tchild->top_attach) :
(tchild->right_attach - tchild->left_attach);
- size = row ? (tchild->widget->allocation.height) :
- (tchild->widget->allocation.width);
+ gtk_widget_get_allocation (tchild->widget, &allocation);
+ size = row ? allocation.height : allocation.width;
base = row ? tchild->top_attach : tchild->left_attach;
rowcol_size = size / span;
@@ -2474,6 +2486,7 @@ glade_gtk_table_get_attachments (GladeFixed *fixed,
GladeGtkTableChild *configure)
{
gint center_x, center_y, row, column;
+ guint n_columns, n_rows;
center_x = rect->x + (rect->width / 2);
center_y = rect->y + (rect->height / 2);
@@ -2494,6 +2507,11 @@ glade_gtk_table_get_attachments (GladeFixed *fixed,
if (column >= 0 && row >= 0)
{
+ g_object_get (table,
+ "n-columns", &n_columns,
+ "n-rows", &n_rows,
+ NULL);
+
/* Check and expand left
*/
while (configure->left_attach > 0)
@@ -2513,7 +2531,7 @@ glade_gtk_table_get_attachments (GladeFixed *fixed,
/* Check and expand right
*/
- while (configure->right_attach < (table->ncols))
+ while (configure->right_attach < n_columns)
{
if (rect->x + rect->width >
fixed->child_x_origin + fixed->child_width_origin &&
@@ -2548,7 +2566,7 @@ glade_gtk_table_get_attachments (GladeFixed *fixed,
/* Check and expand bottom
*/
- while (configure->bottom_attach < (table->nrows))
+ while (configure->bottom_attach < n_rows)
{
if (rect->y + rect->height >
fixed->child_y_origin + fixed->child_height_origin &&
@@ -2762,10 +2780,12 @@ glade_gtk_table_has_child (GtkTable *table, guint left_attach, guint top_attach)
{
GList *list;
- for (list = table->children; list && list->data; list = list->next)
+ for (list = gtk_container_get_children (GTK_CONTAINER (table));
+ list && list->data;
+ list = list->next)
{
GtkTableChild *child = list->data;
-
+
if (left_attach >= child->left_attach && left_attach < child->right_attach &&
top_attach >= child->top_attach && top_attach < child->bottom_attach)
return TRUE;
@@ -2777,7 +2797,9 @@ static gboolean
glade_gtk_table_widget_exceeds_bounds (GtkTable *table, gint n_rows, gint n_cols)
{
GList *list;
- for (list = table->children; list && list->data; list = list->next)
+ for (list = gtk_container_get_children (GTK_CONTAINER (table));
+ list && list->data;
+ list = list->next)
{
GtkTableChild *child = list->data;
if (GLADE_IS_PLACEHOLDER(child->widget) == FALSE &&
@@ -2792,9 +2814,17 @@ static void
glade_gtk_table_refresh_placeholders (GtkTable *table)
{
GList *list, *toremove = NULL;
+ guint n_columns, n_rows;
gint i, j;
- for (list = table->children; list && list->data; list = list->next)
+ g_object_get (table,
+ "n-columns", &n_columns,
+ "n-rows", &n_rows,
+ NULL);
+
+ for (list = gtk_container_get_children (GTK_CONTAINER (table));
+ list && list->data;
+ list = list->next)
{
GtkTableChild *child = list->data;
@@ -2810,8 +2840,8 @@ glade_gtk_table_refresh_placeholders (GtkTable *table)
g_list_free (toremove);
}
- for (i = 0; i < table->ncols; i++)
- for (j = 0; j < table->nrows; j++)
+ for (i = 0; i < n_columns; i++)
+ for (j = 0; j < n_rows; j++)
if (glade_gtk_table_has_child (table, i, j) == FALSE)
gtk_table_attach_defaults (table,
glade_placeholder_new (),
@@ -2906,21 +2936,26 @@ glade_gtk_table_set_n_common (GObject *object, const GValue *value, gboolean for
{
GladeWidget *widget;
GtkTable *table;
- guint new_size, old_size;
+ guint new_size, old_size, n_columns, n_rows;
table = GTK_TABLE (object);
g_return_if_fail (GTK_IS_TABLE (table));
+ g_object_get (table,
+ "n-columns", &n_columns,
+ "n-rows", &n_rows,
+ NULL);
+
new_size = g_value_get_uint (value);
- old_size = for_rows ? table->nrows : table->ncols;
+ old_size = for_rows ? n_rows : n_columns;
if (new_size < 1)
return;
if (glade_gtk_table_widget_exceeds_bounds
(table,
- for_rows ? new_size : table->nrows,
- for_rows ? table->ncols : new_size))
+ for_rows ? new_size : n_rows,
+ for_rows ? n_columns : new_size))
/* Refuse to shrink if it means orphaning widgets */
return;
@@ -2928,9 +2963,9 @@ glade_gtk_table_set_n_common (GObject *object, const GValue *value, gboolean for
g_return_if_fail (widget != NULL);
if (for_rows)
- gtk_table_resize (table, new_size, table->ncols);
+ gtk_table_resize (table, new_size, n_columns);
else
- gtk_table_resize (table, table->nrows, new_size);
+ gtk_table_resize (table, n_rows, new_size);
/* Fill table with placeholders */
glade_gtk_table_refresh_placeholders (table);
@@ -2941,7 +2976,9 @@ glade_gtk_table_set_n_common (GObject *object, const GValue *value, gboolean for
GList *list;
GList *list_to_free = NULL;
- for (list = table->children; list && list->data; list = list->next)
+ for (list = gtk_container_get_children (GTK_CONTAINER (table));
+ list && list->data;
+ list = list->next)
{
GtkTableChild *child = list->data;
guint start = for_rows ? child->top_attach : child->left_attach;
@@ -2978,8 +3015,8 @@ glade_gtk_table_set_n_common (GObject *object, const GValue *value, gboolean for
g_list_free (list_to_free);
}
gtk_table_resize (table,
- for_rows ? new_size : table->nrows,
- for_rows ? table->ncols : new_size);
+ for_rows ? new_size : n_rows,
+ for_rows ? n_columns : new_size);
}
}
@@ -3002,12 +3039,17 @@ static gboolean
glade_gtk_table_verify_n_common (GObject *object, const GValue *value, gboolean for_rows)
{
GtkTable *table = GTK_TABLE(object);
- guint new_size = g_value_get_uint (value);
+ guint n_columns, n_rows, new_size = g_value_get_uint (value);
+
+ g_object_get (table,
+ "n-columns", &n_columns,
+ "n-rows", &n_rows,
+ NULL);
if (glade_gtk_table_widget_exceeds_bounds
(table,
- for_rows ? new_size : table->nrows,
- for_rows ? table->ncols : new_size))
+ for_rows ? new_size : n_rows,
+ for_rows ? n_columns : new_size))
/* Refuse to shrink if it means orphaning widgets */
return FALSE;
@@ -4878,9 +4920,10 @@ glade_gtk_fixed_layout_realize (GtkWidget *widget)
NULL, NULL, fixed_bg_xpm);
if (GTK_IS_LAYOUT (widget))
- gdk_window_set_back_pixmap (GTK_LAYOUT (widget)->bin_window, backing, FALSE);
+ gdk_window_set_back_pixmap (gtk_layout_get_bin_window (GTK_LAYOUT (widget)),
+ backing, FALSE);
else
- gdk_window_set_back_pixmap (widget->window, backing, FALSE);
+ gdk_window_set_back_pixmap (gtk_widget_get_window (widget), backing, FALSE);
/* For cleanup later
@@ -4921,7 +4964,7 @@ glade_gtk_fixed_layout_post_create (GladeWidgetAdaptor *adaptor,
GladeCreateReason reason)
{
/* This is needed at least to set a backing pixmap. */
- GTK_WIDGET_UNSET_FLAGS(object, GTK_NO_WINDOW);
+ gtk_widget_set_has_window (GTK_WIDGET (object), FALSE);
/* For backing pixmap
*/
@@ -5177,7 +5220,7 @@ glade_gtk_dialog_post_create (GladeWidgetAdaptor *adaptor,
if (GTK_IS_INPUT_DIALOG (object))
{
GtkInputDialog *id = GTK_INPUT_DIALOG (dialog);
-
+
save_button = glade_widget_adaptor_create_internal
(widget, G_OBJECT (id->save_button),
"save_button", "inputdialog", FALSE, reason);
@@ -5267,16 +5310,16 @@ glade_gtk_dialog_post_create (GladeWidgetAdaptor *adaptor,
* his internal vbox.
*/
if (GTK_IS_FILE_CHOOSER_DIALOG (object))
- gtk_container_forall (GTK_CONTAINER (dialog->vbox),
+ gtk_container_forall (GTK_CONTAINER (gtk_dialog_get_content_area (dialog)),
glade_gtk_file_chooser_forall,
NULL);
vbox_widget = glade_widget_adaptor_create_internal
- (widget, G_OBJECT(dialog->vbox),
+ (widget, G_OBJECT(gtk_dialog_get_content_area (dialog)),
"vbox", "dialog", FALSE, reason);
actionarea_widget = glade_widget_adaptor_create_internal
- (vbox_widget, G_OBJECT(dialog->action_area),
+ (vbox_widget, G_OBJECT(gtk_dialog_get_action_area (dialog)),
"action_area", "dialog", FALSE, reason);
/* These properties are controlled by the GtkDialog style properties:
@@ -5309,7 +5352,6 @@ glade_gtk_dialog_post_create (GladeWidgetAdaptor *adaptor,
}
}
-
GtkWidget *
glade_gtk_dialog_get_internal_child (GladeWidgetAdaptor *adaptor,
GtkDialog *dialog,
@@ -5360,9 +5402,9 @@ glade_gtk_dialog_get_internal_child (GladeWidgetAdaptor *adaptor,
/* Default generic dialog handling
*/
if (strcmp ("vbox", name) == 0)
- child = dialog->vbox;
+ child = gtk_dialog_get_content_area (dialog);
else if (strcmp ("action_area", name) == 0)
- child = dialog->action_area;
+ child = gtk_dialog_get_action_area (dialog);
}
return child;
@@ -5406,7 +5448,6 @@ glade_gtk_dialog_get_children (GladeWidgetAdaptor *adaptor,
}
-
#define GLADE_TAG_ACTION_WIDGETS "action-widgets"
#define GLADE_TAG_ACTION_WIDGET "action-widget"
#define GLADE_TAG_RESPONSE "response"
@@ -5471,7 +5512,7 @@ glade_gtk_dialog_write_responses (GladeWidget *widget,
{
GladeXmlNode *widget_node;
GtkDialog *dialog = GTK_DIALOG (widget->object);
- GList *l, *action_widgets = gtk_container_get_children (GTK_CONTAINER (dialog->action_area));
+ GList *l, *action_widgets = gtk_container_get_children (GTK_CONTAINER (gtk_dialog_get_action_area (dialog)));
for (l = action_widgets; l; l = l->next)
{
@@ -5534,17 +5575,19 @@ glade_gtk_dialog_write_child (GladeWidgetAdaptor *adaptor,
static gboolean
glade_gtk_message_dialog_reset_image (GtkMessageDialog *dialog)
{
+ GtkWidget *image;
gint message_type;
g_object_get (dialog, "message-type", &message_type, NULL);
if (message_type != GTK_MESSAGE_OTHER)
return FALSE;
- if (glade_widget_get_from_gobject (dialog->image))
+ image = gtk_message_dialog_get_image (dialog);
+ if (glade_widget_get_from_gobject (image))
{
gtk_message_dialog_set_image (dialog,
gtk_image_new_from_stock (NULL, GTK_ICON_SIZE_DIALOG));
- gtk_widget_show (dialog->image);
+ gtk_widget_show (image);
return TRUE;
}
@@ -5564,17 +5607,19 @@ glade_gtk_message_dialog_image_determine_action (GtkMessageDialog *dialog,
GtkWidget **image,
GladeWidget **gimage)
{
+ GtkWidget *dialog_image = gtk_message_dialog_get_image (dialog);
+
*image = g_value_get_object (value);
if (*image == NULL)
- if (glade_widget_get_from_gobject (dialog->image))
+ if (glade_widget_get_from_gobject (dialog_image))
return MD_IMAGE_ACTION_RESET;
else
return MD_IMAGE_ACTION_INVALID;
else
{
*image = GTK_WIDGET (*image);
- if (dialog->image == *image)
+ if (dialog_image == *image)
return MD_IMAGE_ACTION_INVALID;
if (gtk_widget_get_parent (*image))
return MD_IMAGE_ACTION_INVALID;
@@ -5693,11 +5738,12 @@ glade_gtk_message_dialog_get_property (GladeWidgetAdaptor *adaptor,
if (!strcmp (property_name, "image"))
{
GtkMessageDialog *dialog = GTK_MESSAGE_DIALOG (object);
+ GtkWidget *image = gtk_message_dialog_get_image (dialog);
- if (!glade_widget_get_from_gobject (dialog->image))
+ if (!glade_widget_get_from_gobject (image))
g_value_set_object (value, NULL);
else
- g_value_set_object (value, dialog->image);
+ g_value_set_object (value, image);
}
else
GWA_GET_CLASS (GTK_TYPE_DIALOG)->get_property (adaptor, object,
@@ -5879,18 +5925,17 @@ glade_gtk_button_set_property (GladeWidgetAdaptor *adaptor,
if (strcmp (id, "custom-child") == 0)
{
+ GtkWidget *child = gtk_bin_get_child (GTK_BIN (object));
+
if (g_value_get_boolean (value))
{
- if (GTK_BIN (object)->child)
- gtk_container_remove (GTK_CONTAINER (object),
- GTK_BIN (object)->child);
+ if (child)
+ gtk_container_remove (GTK_CONTAINER (object), child);
gtk_container_add (GTK_CONTAINER (object), glade_placeholder_new ());
}
- else if (GTK_BIN (object)->child &&
- GLADE_IS_PLACEHOLDER (GTK_BIN (object)->child))
- gtk_container_remove (GTK_CONTAINER (object),
- GTK_BIN (object)->child);
+ else if (child && GLADE_IS_PLACEHOLDER (child))
+ gtk_container_remove (GTK_CONTAINER (object), child);
}
else if (strcmp (id, "stock") == 0)
{
@@ -6244,16 +6289,16 @@ static gint
glade_gtk_menu_shell_get_item_position (GObject *container, GObject *child)
{
gint position = 0;
- GList *list = GTK_MENU_SHELL (container)->children;
-
+ GList *list = gtk_container_get_children (GTK_CONTAINER (container));
+
while (list)
{
if (G_OBJECT (list->data) == child) break;
-
+
list = list->next;
position++;
}
-
+
return position;
}
@@ -8691,7 +8736,7 @@ glade_gtk_combo_box_entry_post_create (GladeWidgetAdaptor *adaptor,
GWA_GET_CLASS (GTK_TYPE_CONTAINER)->post_create (adaptor, object, reason);
glade_widget_adaptor_create_internal
- (gcombo, G_OBJECT (GTK_BIN (object)->child),
+ (gcombo, G_OBJECT (gtk_bin_get_child (GTK_BIN (object))),
"entry", "comboboxentry", FALSE, reason);
}
@@ -8724,7 +8769,8 @@ glade_gtk_spin_button_set_adjustment (GObject *object, const GValue *value)
{
adj = GTK_ADJUSTMENT (adjustment);
gtk_spin_button_set_adjustment (GTK_SPIN_BUTTON (object), adj);
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (object), adj->value);
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON (object),
+ gtk_adjustment_get_value (adj));
}
}
@@ -8824,7 +8870,7 @@ glade_gtk_list_item_set_label (GObject *object, const GValue *value)
g_return_if_fail (GTK_IS_LIST_ITEM (object));
- label = GTK_BIN (object)->child;
+ label = gtk_bin_get_child (GTK_BIN (object));
gtk_label_set_text (GTK_LABEL (label), g_value_get_string (value));
}
@@ -8836,7 +8882,7 @@ glade_gtk_list_item_get_label (GObject *object, GValue *value)
g_return_if_fail (GTK_IS_LIST_ITEM (object));
- label = GTK_BIN (object)->child;
+ label = gtk_bin_get_child (GTK_BIN (object));
g_value_set_string (value, gtk_label_get_text (GTK_LABEL (label)));
}
diff --git a/plugins/gtk+/glade-icon-sources.c b/plugins/gtk+/glade-icon-sources.c
index db9a2c3..aa13bd6 100644
--- a/plugins/gtk+/glade-icon-sources.c
+++ b/plugins/gtk+/glade-icon-sources.c
@@ -936,7 +936,7 @@ glade_eprop_icon_sources_create_input (GladeEditorProperty *eprop)
eprop_sources->icon_names_store = gtk_list_store_new (1, G_TYPE_STRING);
eprop_sources->combo = gtk_combo_box_entry_new_with_model
(GTK_TREE_MODEL (eprop_sources->icon_names_store), 0);
- g_signal_connect (G_OBJECT (GTK_BIN (eprop_sources->combo)->child), "activate",
+ g_signal_connect (G_OBJECT (gtk_bin_get_child (GTK_BIN (eprop_sources->combo))), "activate",
G_CALLBACK (icon_name_entry_activated), eprop);
gtk_box_pack_start (GTK_BOX (hbox), eprop_sources->combo, TRUE, TRUE, 0);
diff --git a/src/glade-window.c b/src/glade-window.c
index d8ccab6..d3b713d 100644
--- a/src/glade-window.c
+++ b/src/glade-window.c
@@ -1804,8 +1804,8 @@ toggle_dock_cb (GtkAction *action, GladeWindow *window)
toplevel = gtk_widget_get_toplevel (dock->widget);
g_object_ref (dock->widget);
- gtk_container_remove (GTK_CONTAINER
- (GTK_BIN (toplevel)->child), dock->widget);
+ gtk_container_remove (GTK_CONTAINER (gtk_bin_get_child (GTK_BIN (toplevel))),
+ dock->widget);
if (dock->first_child)
gtk_paned_pack1 (GTK_PANED (dock->paned), dock->widget, FALSE, FALSE);
@@ -1847,8 +1847,8 @@ toggle_dock_cb (GtkAction *action, GladeWindow *window)
g_signal_connect (G_OBJECT (toplevel), "configure-event",
G_CALLBACK (on_dock_resized), dock);
- if (!GTK_PANED (dock->paned)->child1 &&
- !GTK_PANED (dock->paned)->child2)
+ if (!gtk_paned_get_child1 (GTK_PANED (dock->paned)) &&
+ !gtk_paned_get_child2 (GTK_PANED (dock->paned)))
gtk_widget_hide (dock->paned);
@@ -2311,17 +2311,14 @@ drag_data_received (GtkWidget *widget,
guint info, guint time, GladeWindow *window)
{
gchar **uris, **str;
- gchar *data;
+ const guchar *data;
if (info != TARGET_URI_LIST)
return;
- /* On MS-Windows, it looks like `selection_data->data' is not NULL terminated. */
- data = g_new (gchar, selection_data->length + 1);
- memcpy (data, selection_data->data, selection_data->length);
- data[selection_data->length] = 0;
+ data = gtk_selection_data_get_data (selection_data);
- uris = g_uri_list_extract_uris (data);
+ uris = g_uri_list_extract_uris ((gchar *) data);
for (str = uris; *str; str++)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]