diff options
author | Javier Jardón <jjardon@gnome.org> | 2010-08-11 23:06:16 +0200 |
---|---|---|
committer | Javier Jardón <jjardon@gnome.org> | 2010-08-22 21:25:26 +0200 |
commit | f8ac83bc072346f43c668fddd2814870c836af98 (patch) | |
tree | 0a23f7f0af3e68ed6609f46a1e3707bff99550b5 | |
parent | e49c130018211014f1bd0e20a0b8dfc2c9429b81 (diff) | |
download | gtk+-f8ac83bc072346f43c668fddd2814870c836af98.tar.gz |
gtk/gtkoffscreenwindow.c: use accessor functions to access GtkWidget
-rw-r--r-- | gtk/gtkoffscreenwindow.c | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/gtk/gtkoffscreenwindow.c b/gtk/gtkoffscreenwindow.c index 1c51abe2b4..bdd29c626c 100644 --- a/gtk/gtkoffscreenwindow.c +++ b/gtk/gtkoffscreenwindow.c @@ -92,12 +92,12 @@ gtk_offscreen_window_size_allocate (GtkWidget *widget, GtkWidget *child; gint border_width; - widget->allocation = *allocation; + gtk_widget_set_allocation (widget, allocation); border_width = gtk_container_get_border_width (GTK_CONTAINER (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, @@ -123,8 +123,10 @@ gtk_offscreen_window_size_allocate (GtkWidget *widget, static void gtk_offscreen_window_realize (GtkWidget *widget) { + GtkAllocation allocation; GtkBin *bin; GtkWidget *child; + GdkWindow *window; GdkWindowAttr attributes; gint attributes_mask; gint border_width; @@ -135,10 +137,12 @@ gtk_offscreen_window_realize (GtkWidget *widget) 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_OFFSCREEN; attributes.event_mask = gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK; attributes.visual = gtk_widget_get_visual (widget); @@ -147,17 +151,18 @@ gtk_offscreen_window_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, widget); + 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); child = gtk_bin_get_child (bin); if (child) - gtk_widget_set_parent_window (child, widget->window); - - widget->style = gtk_style_attach (widget->style, widget->window); + gtk_widget_set_parent_window (child, window); - gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL); + gtk_widget_style_attach (widget); + gtk_style_set_background (gtk_widget_get_style (widget), + window, GTK_STATE_NORMAL); } static void @@ -280,7 +285,7 @@ gtk_offscreen_window_get_pixmap (GtkOffscreenWindow *offscreen) { g_return_val_if_fail (GTK_IS_OFFSCREEN_WINDOW (offscreen), NULL); - return gdk_offscreen_window_get_pixmap (GTK_WIDGET (offscreen)->window); + return gdk_offscreen_window_get_pixmap (gtk_widget_get_window (GTK_WIDGET (offscreen))); } /** @@ -304,7 +309,7 @@ gtk_offscreen_window_get_pixbuf (GtkOffscreenWindow *offscreen) g_return_val_if_fail (GTK_IS_OFFSCREEN_WINDOW (offscreen), NULL); - pixmap = gdk_offscreen_window_get_pixmap (GTK_WIDGET (offscreen)->window); + pixmap = gdk_offscreen_window_get_pixmap (gtk_widget_get_window (GTK_WIDGET (offscreen))); if (pixmap != NULL) { |