[evince] [gimpcellrenderertoggle] Fix build with GSEAL enabled



commit 5ccd1e692206fd3f7ca82a7181054eff4ad45cbf
Author: Carlos Garcia Campos <carlosgc gnome org>
Date:   Mon May 10 19:44:33 2010 +0200

    [gimpcellrenderertoggle] Fix build with GSEAL enabled

 .../gimpcellrenderertoggle.c                       |   34 +++++++++++++-------
 1 files changed, 22 insertions(+), 12 deletions(-)
---
diff --git a/cut-n-paste/gimpcellrenderertoggle/gimpcellrenderertoggle.c b/cut-n-paste/gimpcellrenderertoggle/gimpcellrenderertoggle.c
index d60f01e..e9a25f1 100644
--- a/cut-n-paste/gimpcellrenderertoggle/gimpcellrenderertoggle.c
+++ b/cut-n-paste/gimpcellrenderertoggle/gimpcellrenderertoggle.c
@@ -221,6 +221,10 @@ gimp_cell_renderer_toggle_get_size (GtkCellRenderer *cell,
   gint                    calc_height;
   gint                    pixbuf_width;
   gint                    pixbuf_height;
+  gfloat                  xalign;
+  gfloat                  yalign;
+  gint                    xpad;
+  gint                    ypad;
 
   if (! toggle->stock_id)
     {
@@ -232,6 +236,9 @@ gimp_cell_renderer_toggle_get_size (GtkCellRenderer *cell,
       return;
     }
 
+  gtk_cell_renderer_get_alignment (cell, &xalign, &yalign);
+  gtk_cell_renderer_get_padding (cell, &xpad, &ypad);
+
   if (! toggle->pixbuf)
     gimp_cell_renderer_toggle_create_pixbuf (toggle, widget);
 
@@ -239,9 +246,9 @@ gimp_cell_renderer_toggle_get_size (GtkCellRenderer *cell,
   pixbuf_height = gdk_pixbuf_get_height (toggle->pixbuf);
 
   calc_width  = (pixbuf_width +
-                 (gint) cell->xpad * 2 + style->xthickness * 2);
+                 (gint) xpad * 2 + style->xthickness * 2);
   calc_height = (pixbuf_height +
-                 (gint) cell->ypad * 2 + style->ythickness * 2);
+                 (gint) ypad * 2 + style->ythickness * 2);
 
   if (width)
     *width  = calc_width;
@@ -254,14 +261,14 @@ gimp_cell_renderer_toggle_get_size (GtkCellRenderer *cell,
       if (x_offset)
         {
           *x_offset = (((gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) ?
-                        (1.0 - cell->xalign) : cell->xalign) *
+                        (1.0 - xalign) : xalign) *
                        (cell_area->width - calc_width));
           *x_offset = MAX (*x_offset, 0);
         }
 
       if (y_offset)
         {
-          *y_offset = cell->yalign * (cell_area->height - calc_height);
+          *y_offset = yalign * (cell_area->height - calc_height);
           *y_offset = MAX (*y_offset, 0);
         }
     }
@@ -282,6 +289,8 @@ gimp_cell_renderer_toggle_render (GtkCellRenderer      *cell,
   GdkRectangle            draw_rect;
   GtkStateType            state;
   gboolean                active;
+  gint                    xpad;
+  gint                    ypad;
 
   if (! toggle->stock_id)
     {
@@ -298,10 +307,11 @@ gimp_cell_renderer_toggle_render (GtkCellRenderer      *cell,
                                       &toggle_rect.width,
                                       &toggle_rect.height);
 
-  toggle_rect.x      += cell_area->x + cell->xpad;
-  toggle_rect.y      += cell_area->y + cell->ypad;
-  toggle_rect.width  -= cell->xpad * 2;
-  toggle_rect.height -= cell->ypad * 2;
+  gtk_cell_renderer_get_padding (cell, &xpad, &ypad);
+  toggle_rect.x      += cell_area->x + xpad;
+  toggle_rect.y      += cell_area->y + ypad;
+  toggle_rect.width  -= xpad * 2;
+  toggle_rect.height -= ypad * 2;
 
   if (toggle_rect.width <= 0 || toggle_rect.height <= 0)
     return;
@@ -309,7 +319,7 @@ gimp_cell_renderer_toggle_render (GtkCellRenderer      *cell,
   active =
     gtk_cell_renderer_toggle_get_active (GTK_CELL_RENDERER_TOGGLE (cell));
 
-  if (!cell->sensitive)
+  if (!gtk_cell_renderer_get_sensitive (cell))
     {
       state = GTK_STATE_INSENSITIVE;
     }
@@ -322,7 +332,7 @@ gimp_cell_renderer_toggle_render (GtkCellRenderer      *cell,
     }
   else
     {
-      if (GTK_CELL_RENDERER_TOGGLE (cell)->activatable)
+      if (gtk_cell_renderer_toggle_get_activatable (GTK_CELL_RENDERER_TOGGLE (cell)))
         state = GTK_STATE_NORMAL;
       else
         state = GTK_STATE_INSENSITIVE;
@@ -362,7 +372,7 @@ gimp_cell_renderer_toggle_render (GtkCellRenderer      *cell,
 	  gtk_icon_source_set_size (source, GTK_ICON_SIZE_SMALL_TOOLBAR);
 	  gtk_icon_source_set_size_wildcarded (source, FALSE);
 
-	  insensitive = gtk_style_render_icon (widget->style,
+	  insensitive = gtk_style_render_icon (gtk_widget_get_style (widget),
 					       source,
 					       gtk_widget_get_direction (widget),
 					       GTK_STATE_INSENSITIVE,
@@ -405,7 +415,7 @@ gimp_cell_renderer_toggle_activate (GtkCellRenderer      *cell,
 {
   GtkCellRendererToggle *toggle = GTK_CELL_RENDERER_TOGGLE (cell);
 
-  if (toggle->activatable)
+  if (gtk_cell_renderer_toggle_get_activatable (toggle))
     {
       GdkModifierType state = 0;
 



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