[gtk+/refactor: 82/96] gtk/gtkcellview.c: use accessor functions to access GtkWidget



commit be68fa1c4f808883bdc59926cee92f95aef29e6c
Author: Javier Jardón <jjardon gnome org>
Date:   Wed Aug 11 23:15:42 2010 +0200

    gtk/gtkcellview.c: use accessor functions to access GtkWidget

 gtk/gtkcellview.c |   21 ++++++++++++---------
 1 files changed, 12 insertions(+), 9 deletions(-)
---
diff --git a/gtk/gtkcellview.c b/gtk/gtkcellview.c
index a02fc72..08d3fda 100644
--- a/gtk/gtkcellview.c
+++ b/gtk/gtkcellview.c
@@ -361,7 +361,7 @@ gtk_cell_view_size_allocate (GtkWidget     *widget,
   gint extra_space;
   GtkCellView *cellview;
 
-  widget->allocation = *allocation;
+  gtk_widget_set_allocation (widget, allocation);
 
   cellview = GTK_CELL_VIEW (widget);
 
@@ -379,7 +379,7 @@ gtk_cell_view_size_allocate (GtkWidget     *widget,
       full_requested_width += info->requested_width;
     }
 
-  extra_space = widget->allocation.width - full_requested_width;
+  extra_space = allocation->width - full_requested_width;
   if (extra_space < 0)
     extra_space = 0;
   else if (extra_space > 0 && expand_cell_count > 0)
@@ -402,6 +402,7 @@ gtk_cell_view_expose (GtkWidget      *widget,
                       GdkEventExpose *event)
 {
   GList *i;
+  GtkAllocation allocation;
   GtkCellView *cellview;
   GdkRectangle area;
   GtkCellRendererState state;
@@ -412,12 +413,14 @@ gtk_cell_view_expose (GtkWidget      *widget,
   if (!gtk_widget_is_drawable (widget))
     return FALSE;
 
+  gtk_widget_get_allocation (widget, &allocation);
+
   /* "blank" background */
   if (cellview->priv->background_set)
     {
-      cairo_t *cr = gdk_cairo_create (GTK_WIDGET (cellview)->window);
+      cairo_t *cr = gdk_cairo_create (gtk_widget_get_window (GTK_WIDGET (cellview)));
 
-      gdk_cairo_rectangle (cr, &widget->allocation);
+      gdk_cairo_rectangle (cr, &allocation);
       cairo_set_source_rgb (cr,
 			    cellview->priv->background.red / 65535.,
 			    cellview->priv->background.green / 65535.,
@@ -434,11 +437,11 @@ gtk_cell_view_expose (GtkWidget      *widget,
     return FALSE;
 
   /* render cells */
-  area = widget->allocation;
+  area = allocation;
 
   /* we draw on our very own window, initialize x and y to zero */
-  area.x = widget->allocation.x + (rtl ? widget->allocation.width : 0); 
-  area.y = widget->allocation.y;
+  area.x = allocation.x + (rtl ? allocation.width : 0);
+  area.y = allocation.y;
 
   if (gtk_widget_get_state (widget) == GTK_STATE_PRELIGHT)
     state = GTK_CELL_RENDERER_PRELIT;
@@ -472,7 +475,7 @@ gtk_cell_view_expose (GtkWidget      *widget,
          area.x += info->real_width;
     }
 
-   area.x = rtl ? widget->allocation.x : (widget->allocation.x + widget->allocation.width);  
+   area.x = rtl ? allocation.x : (allocation.x + allocation.width);
 
   /* PACK_END */
   for (i = cellview->priv->cell_list; i; i = i->next)
@@ -490,7 +493,7 @@ gtk_cell_view_expose (GtkWidget      *widget,
          area.x -= area.width;   
 
       gtk_cell_renderer_render (info->cell,
-                                widget->window,
+                                gtk_widget_get_window (widget),
                                 widget,
                                 /* FIXME ! */
                                 &area, &area, &event->area, state);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]