summaryrefslogtreecommitdiff
path: root/gtk/gtkfixed.c
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.van.berkom@gmail.com>2010-08-30 14:56:28 +0900
committerTristan Van Berkom <tristan.van.berkom@gmail.com>2010-08-30 14:56:28 +0900
commit54d44a9bd04cfbed8426614fc69c027a46f41a14 (patch)
tree34bdf65a6e8d5d6d4016154345d1d803ba0da379 /gtk/gtkfixed.c
parentb3b22c31b997fb85b3319b392a1a69407703184c (diff)
parent67194ed77b153eb5a7eb6c596f3c20e274b7787a (diff)
downloadgtk+-native-layout.tar.gz
Merge branch 'master' into native-layoutnative-layout
Conflicts: gtk/gtkplug.c gtk/gtkscrolledwindow.c
Diffstat (limited to 'gtk/gtkfixed.c')
-rw-r--r--gtk/gtkfixed.c59
1 files changed, 32 insertions, 27 deletions
diff --git a/gtk/gtkfixed.c b/gtk/gtkfixed.c
index 22b77775a3..0a461423f5 100644
--- a/gtk/gtkfixed.c
+++ b/gtk/gtkfixed.c
@@ -30,7 +30,7 @@
#include "gtkintl.h"
-struct _GtkFixedPriv
+struct _GtkFixedPrivate
{
GList *children;
};
@@ -110,7 +110,7 @@ gtk_fixed_class_init (GtkFixedClass *class)
0,
GTK_PARAM_READWRITE));
- g_type_class_add_private (class, sizeof (GtkFixedPriv));
+ g_type_class_add_private (class, sizeof (GtkFixedPrivate));
}
static GType
@@ -122,11 +122,11 @@ gtk_fixed_child_type (GtkContainer *container)
static void
gtk_fixed_init (GtkFixed *fixed)
{
- GtkFixedPriv *priv;
+ GtkFixedPrivate *priv;
fixed->priv = G_TYPE_INSTANCE_GET_PRIVATE (fixed,
GTK_TYPE_FIXED,
- GtkFixedPriv);
+ GtkFixedPrivate);
priv = fixed->priv;
gtk_widget_set_has_window (GTK_WIDGET (fixed), FALSE);
@@ -144,7 +144,7 @@ static GtkFixedChild*
get_child (GtkFixed *fixed,
GtkWidget *widget)
{
- GtkFixedPriv *priv = fixed->priv;
+ GtkFixedPrivate *priv = fixed->priv;
GList *children;
children = priv->children;
@@ -168,7 +168,7 @@ gtk_fixed_put (GtkFixed *fixed,
gint x,
gint y)
{
- GtkFixedPriv *priv = fixed->priv;
+ GtkFixedPrivate *priv = fixed->priv;
GtkFixedChild *child_info;
g_return_if_fail (GTK_IS_FIXED (fixed));
@@ -196,8 +196,8 @@ gtk_fixed_move_internal (GtkFixed *fixed,
g_return_if_fail (GTK_IS_FIXED (fixed));
g_return_if_fail (GTK_IS_WIDGET (widget));
- g_return_if_fail (widget->parent == GTK_WIDGET (fixed));
-
+ g_return_if_fail (gtk_widget_get_parent (widget) == GTK_WIDGET (fixed));
+
child = get_child (fixed, widget);
g_assert (child);
@@ -287,6 +287,8 @@ gtk_fixed_get_child_property (GtkContainer *container,
static void
gtk_fixed_realize (GtkWidget *widget)
{
+ GtkAllocation allocation;
+ GdkWindow *window;
GdkWindowAttr attributes;
gint attributes_mask;
@@ -296,11 +298,13 @@ gtk_fixed_realize (GtkWidget *widget)
{
gtk_widget_set_realized (widget, TRUE);
+ gtk_widget_get_allocation (widget, &allocation);
+
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;
+ 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);
@@ -308,13 +312,14 @@ gtk_fixed_realize (GtkWidget *widget)
attributes.event_mask |= GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK;
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
-
- widget->window = gdk_window_new (gtk_widget_get_parent_window (widget), &attributes,
- attributes_mask);
- gdk_window_set_user_data (widget->window, widget);
-
- widget->style = gtk_style_attach (widget->style, widget->window);
- gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
+
+ window = gdk_window_new (gtk_widget_get_parent_window (widget),
+ &attributes, attributes_mask);
+ gtk_widget_set_window (widget, window);
+ gdk_window_set_user_data (window, widget);
+
+ gtk_widget_style_attach (widget);
+ gtk_style_set_background (gtk_widget_get_style (widget), window, GTK_STATE_NORMAL);
}
}
@@ -322,7 +327,7 @@ static void
gtk_fixed_size_request (GtkWidget *widget,
GtkRequisition *requisition)
{
- GtkFixedPriv *priv;
+ GtkFixedPrivate *priv;
GtkFixed *fixed;
GtkFixedChild *child;
GList *children;
@@ -364,19 +369,19 @@ gtk_fixed_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
GtkFixed *fixed = GTK_FIXED (widget);
- GtkFixedPriv *priv = fixed->priv;
+ GtkFixedPrivate *priv = fixed->priv;
GtkFixedChild *child;
GtkAllocation child_allocation;
GtkRequisition child_requisition;
GList *children;
guint border_width;
- widget->allocation = *allocation;
+ gtk_widget_set_allocation (widget, allocation);
if (gtk_widget_get_has_window (widget))
{
if (gtk_widget_get_realized (widget))
- gdk_window_move_resize (widget->window,
+ gdk_window_move_resize (gtk_widget_get_window (widget),
allocation->x,
allocation->y,
allocation->width,
@@ -399,8 +404,8 @@ gtk_fixed_size_allocate (GtkWidget *widget,
if (!gtk_widget_get_has_window (widget))
{
- child_allocation.x += widget->allocation.x;
- child_allocation.y += widget->allocation.y;
+ child_allocation.x += allocation->x;
+ child_allocation.y += allocation->y;
}
child_allocation.width = child_requisition.width;
@@ -422,7 +427,7 @@ gtk_fixed_remove (GtkContainer *container,
GtkWidget *widget)
{
GtkFixed *fixed = GTK_FIXED (container);
- GtkFixedPriv *priv = fixed->priv;
+ GtkFixedPrivate *priv = fixed->priv;
GtkFixedChild *child;
GtkWidget *widget_container = GTK_WIDGET (container);
GList *children;
@@ -459,7 +464,7 @@ gtk_fixed_forall (GtkContainer *container,
gpointer callback_data)
{
GtkFixed *fixed = GTK_FIXED (container);
- GtkFixedPriv *priv = fixed->priv;
+ GtkFixedPrivate *priv = fixed->priv;
GtkFixedChild *child;
GList *children;