gimp r26006 - in trunk: . app/actions app/dialogs app/display modules



Author: mitch
Date: Sat Jun 28 15:12:13 2008
New Revision: 26006
URL: http://svn.gnome.org/viewvc/gimp?rev=26006&view=rev

Log:
2008-06-28  Michael Natterer  <mitch gimp org>

	* app/actions/layers-commands.c
	* app/actions/view-actions.c
	* app/dialogs/about-dialog.c
	* app/dialogs/layer-options-dialog.c
	* app/dialogs/preferences-dialog.c
	* app/display/gimpcanvas.c
	* app/display/gimpdisplayshell-appearance.c
	* app/display/gimpnavigationeditor.c
	* modules/colorsel_water.c: use accessors instead of accessing
	members of GTK+ widgets directly.



Modified:
   trunk/ChangeLog
   trunk/app/actions/layers-commands.c
   trunk/app/actions/view-actions.c
   trunk/app/dialogs/about-dialog.c
   trunk/app/dialogs/layer-options-dialog.c
   trunk/app/dialogs/preferences-dialog.c
   trunk/app/display/gimpcanvas.c
   trunk/app/display/gimpdisplayshell-appearance.c
   trunk/app/display/gimpnavigationeditor.c
   trunk/modules/colorsel_water.c

Modified: trunk/app/actions/layers-commands.c
==============================================================================
--- trunk/app/actions/layers-commands.c	(original)
+++ trunk/app/actions/layers-commands.c	Sat Jun 28 15:12:13 2008
@@ -988,7 +988,7 @@
         {
           g_object_set (layer,
                         "auto-rename",
-                        GTK_TOGGLE_BUTTON (dialog->rename_toggle)->active,
+                        gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->rename_toggle)),
                         NULL);
         }
     }

Modified: trunk/app/actions/view-actions.c
==============================================================================
--- trunk/app/actions/view-actions.c	(original)
+++ trunk/app/actions/view-actions.c	Sat Jun 28 15:12:13 2008
@@ -633,11 +633,11 @@
 
       if (shell->canvas)
         {
-          GimpRGB color;
+          GtkStyle *style = gtk_widget_get_style (shell->canvas);
+          GimpRGB   color;
 
           gtk_widget_ensure_style (shell->canvas);
-          gimp_rgb_set_gdk_color (&color,
-                                  shell->canvas->style->bg + GTK_STATE_NORMAL);
+          gimp_rgb_set_gdk_color (&color, style->bg + GTK_STATE_NORMAL);
           gimp_rgb_set_alpha (&color, GIMP_OPACITY_OPAQUE);
 
           SET_COLOR ("view-padding-color-theme",  &color);

Modified: trunk/app/dialogs/about-dialog.c
==============================================================================
--- trunk/app/dialogs/about-dialog.c	(original)
+++ trunk/app/dialogs/about-dialog.c	Sat Jun 28 15:12:13 2008
@@ -288,14 +288,15 @@
                           GdkEventExpose  *event,
                           GimpAboutDialog *dialog)
 {
-  GdkGC *text_gc;
-  gint   x, y;
-  gint   width, height;
+  GtkStyle *style = gtk_widget_get_style (widget);
+  GdkGC    *text_gc;
+  gint      x, y;
+  gint      width, height;
 
   if (! dialog->visible)
     return FALSE;
 
-  text_gc = widget->style->text_gc[GTK_STATE_NORMAL];
+  text_gc = style->text_gc[GTK_STATE_NORMAL];
 
   pango_layout_get_pixel_size (dialog->layout, &width, &height);
 
@@ -366,6 +367,7 @@
                gint             anim_type,
                gdouble          time)
 {
+  GtkStyle       *style = gtk_widget_get_style (dialog->anim_area);
   const gchar    *text;
   const gchar    *ptr;
   gint            letter_count = 0;
@@ -379,8 +381,8 @@
   PangoRectangle  lrect = {0, 0, 0, 0};
   GdkColor        mix;
 
-  mix_colors (dialog->anim_area->style->bg + GTK_STATE_NORMAL,
-              dialog->anim_area->style->fg + GTK_STATE_NORMAL, &mix, time);
+  mix_colors (style->bg + GTK_STATE_NORMAL,
+              style->fg + GTK_STATE_NORMAL, &mix, time);
 
   text = pango_layout_get_text (dialog->layout);
   g_return_if_fail (text != NULL);
@@ -476,8 +478,8 @@
           else
             pos = ((gdouble) (letter_count - border)) / 15;
 
-          mix_colors (dialog->anim_area->style->fg + GTK_STATE_NORMAL,
-                      dialog->anim_area->style->bg + GTK_STATE_NORMAL,
+          mix_colors (style->fg + GTK_STATE_NORMAL,
+                      style->bg + GTK_STATE_NORMAL,
                       &mix, pos);
 
           ptr = g_utf8_next_char (ptr);

Modified: trunk/app/dialogs/layer-options-dialog.c
==============================================================================
--- trunk/app/dialogs/layer-options-dialog.c	(original)
+++ trunk/app/dialogs/layer-options-dialog.c	Sat Jun 28 15:12:13 2008
@@ -239,7 +239,7 @@
 layer_options_dialog_toggle_rename (GtkWidget          *widget,
                                     LayerOptionsDialog *options)
 {
-  if (GTK_TOGGLE_BUTTON (widget)->active &&
+  if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)) &&
       gimp_drawable_is_text_layer (GIMP_DRAWABLE (options->layer)))
     {
       GimpTextLayer *text_layer = GIMP_TEXT_LAYER (options->layer);

Modified: trunk/app/dialogs/preferences-dialog.c
==============================================================================
--- trunk/app/dialogs/preferences-dialog.c	(original)
+++ trunk/app/dialogs/preferences-dialog.c	Sat Jun 28 15:12:13 2008
@@ -437,7 +437,7 @@
 
   gimp_toggle_button_sensitive_update (GTK_TOGGLE_BUTTON (widget));
 
-  from_gdk = GTK_TOGGLE_BUTTON (widget)->active;
+  from_gdk = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));
 
   if (from_gdk)
     {

Modified: trunk/app/display/gimpcanvas.c
==============================================================================
--- trunk/app/display/gimpcanvas.c	(original)
+++ trunk/app/display/gimpcanvas.c	Sat Jun 28 15:12:13 2008
@@ -828,6 +828,7 @@
                             cairo_t    *cr)
 {
   GtkWidget *widget = GTK_WIDGET (canvas);
+  GtkStyle  *style  = gtk_widget_get_style (widget);
   gdouble    wilber_width;
   gdouble    wilber_height;
   gdouble    width;
@@ -857,9 +858,9 @@
                      widget->allocation.height / factor - wilber_height * 1.1);
 
   cairo_set_source_rgba (cr,
-                         widget->style->fg[widget->state].red   / 65535.0,
-                         widget->style->fg[widget->state].green / 65535.0,
-                         widget->style->fg[widget->state].blue  / 65535.0,
+                         style->fg[widget->state].red   / 65535.0,
+                         style->fg[widget->state].green / 65535.0,
+                         style->fg[widget->state].blue  / 65535.0,
                          0.15);
   cairo_fill (cr);
 }

Modified: trunk/app/display/gimpdisplayshell-appearance.c
==============================================================================
--- trunk/app/display/gimpdisplayshell-appearance.c	(original)
+++ trunk/app/display/gimpdisplayshell-appearance.c	Sat Jun 28 15:12:13 2008
@@ -180,7 +180,7 @@
 
   g_object_set (options, "show-rulers", show, NULL);
 
-  table = GTK_TABLE (GTK_WIDGET (shell->canvas)->parent);
+  table = GTK_TABLE (gtk_widget_get_parent (GTK_WIDGET (shell->canvas)));
 
   if (show)
     {
@@ -220,6 +220,7 @@
                                         gboolean          show)
 {
   GimpDisplayOptions *options;
+  GtkWidget          *parent;
   GtkBox             *hbox;
   GtkBox             *vbox;
 
@@ -229,8 +230,11 @@
 
   g_object_set (options, "show-scrollbars", show, NULL);
 
-  hbox = GTK_BOX (shell->vsb->parent->parent);
-  vbox = GTK_BOX (shell->hsb->parent->parent);
+  parent = gtk_widget_get_parent (shell->vsb);
+  hbox   = GTK_BOX (gtk_widget_get_parent (parent));
+
+  parent = gtk_widget_get_parent (shell->hsb);
+  vbox   = GTK_BOX (gtk_widget_get_parent (parent));
 
   if (show)
     {
@@ -585,9 +589,13 @@
     case GIMP_CANVAS_PADDING_MODE_DEFAULT:
       if (shell->canvas)
         {
+          GtkStyle *style;
+
           gtk_widget_ensure_style (shell->canvas);
-          gimp_rgb_set_gdk_color (&color,
-                                  shell->canvas->style->bg + GTK_STATE_NORMAL);
+
+          style = gtk_widget_get_style (shell->canvas);
+
+          gimp_rgb_set_gdk_color (&color, style->bg + GTK_STATE_NORMAL);
         }
       break;
 

Modified: trunk/app/display/gimpnavigationeditor.c
==============================================================================
--- trunk/app/display/gimpnavigationeditor.c	(original)
+++ trunk/app/display/gimpnavigationeditor.c	Sat Jun 28 15:12:13 2008
@@ -220,6 +220,7 @@
                               gint              click_x,
                               gint              click_y)
 {
+  GtkStyle             *style = gtk_widget_get_style (widget);
   GimpNavigationEditor *editor;
   GimpNavigationView   *view;
   GdkScreen            *screen;
@@ -271,12 +272,12 @@
   x = (x_org + click_x -
        view->p_x -
        0.5 * (view->p_width  - BORDER_PEN_WIDTH) -
-       2   * widget->style->xthickness);
+       2   * style->xthickness);
 
   y = (y_org + click_y -
        view->p_y -
        0.5 * (view->p_height - BORDER_PEN_WIDTH) -
-       2   * widget->style->ythickness);
+       2   * style->ythickness);
 
   /* If the popup doesn't fit into the screen, we have a problem.
    * We move the popup onscreen and risk that the pointer is not
@@ -290,10 +291,10 @@
 
   x = CLAMP (x, 0, (gdk_screen_get_width (screen)  -
                     GIMP_VIEW (view)->renderer->width  -
-                    4 * widget->style->xthickness));
+                    4 * style->xthickness));
   y = CLAMP (y, 0, (gdk_screen_get_height (screen) -
                     GIMP_VIEW (view)->renderer->height -
-                    4 * widget->style->ythickness));
+                    4 * style->ythickness));
 
   gtk_window_move (GTK_WINDOW (shell->nav_popup), x, y);
   gtk_widget_show (shell->nav_popup);

Modified: trunk/modules/colorsel_water.c
==============================================================================
--- trunk/modules/colorsel_water.c	(original)
+++ trunk/modules/colorsel_water.c	Sat Jun 28 15:12:13 2008
@@ -204,14 +204,15 @@
 select_area_expose (GtkWidget      *widget,
                     GdkEventExpose *event)
 {
-  gdouble  width  = widget->allocation.width;
-  gdouble  height = widget->allocation.height;
-  gdouble  dx     = 1.0 / width;
-  gdouble  dy     = 1.0 / height;
-  guchar  *buf    = g_alloca (3 * event->area.width * event->area.height);
-  guchar  *dest   = buf;
-  gdouble  y;
-  gint     i, j;
+  GtkStyle *style  = gtk_widget_get_style (widget);
+  gdouble   width  = widget->allocation.width;
+  gdouble   height = widget->allocation.height;
+  gdouble   dx     = 1.0 / width;
+  gdouble   dy     = 1.0 / height;
+  guchar   *buf    = g_alloca (3 * event->area.width * event->area.height);
+  guchar   *dest   = buf;
+  gdouble   y;
+  gint      i, j;
 
   for (j = 0, y = event->area.y / height; j < event->area.height; j++, y += dy)
     {
@@ -246,7 +247,7 @@
     }
 
   gdk_draw_rgb_image_dithalign (widget->window,
-                                widget->style->fg_gc[widget->state],
+                                style->fg_gc[widget->state],
                                 event->area.x, event->area.y,
                                 event->area.width, event->area.height,
                                 GDK_RGB_DITHER_MAX,



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