gimp r26413 - in trunk: . app/core app/display app/paint app/pdb app/tools app/widgets tools/pdbgen/pdb



Author: neo
Date: Thu Aug  7 09:17:46 2008
New Revision: 26413
URL: http://svn.gnome.org/viewvc/gimp?rev=26413&view=rev

Log:
2008-08-07  Sven Neumann  <sven gimp org>

	* app/core/gimpimage.[ch]: added gimp_image_get_projection().

	* app/display/gimpdisplay-handlers.c
	* app/display/gimpdisplayshell-render.c
	* app/display/gimpdisplayshell-scroll.c
	* app/paint/gimppaintcore.c
	* app/paint/gimpsourcecore.c
	* app/tools/gimpbycolorselecttool.c
	* app/tools/gimpeditselectiontool.c
	* app/tools/gimpimagemaptool.c
	* app/tools/gimpiscissorstool.c
	* app/tools/gimppainttool.c
	* app/widgets/gimpsamplepointeditor.c
	* tools/pdbgen/pdb/image.pdb: use the new accessor function.

	* app/pdb/image-cmds.c: regenerated.



Modified:
   trunk/ChangeLog
   trunk/app/core/gimpimage.c
   trunk/app/core/gimpimage.h
   trunk/app/display/gimpdisplay-handlers.c
   trunk/app/display/gimpdisplayshell-render.c
   trunk/app/display/gimpdisplayshell-scroll.c
   trunk/app/paint/gimppaintcore.c
   trunk/app/paint/gimpsourcecore.c
   trunk/app/pdb/image-cmds.c
   trunk/app/tools/gimpbycolorselecttool.c
   trunk/app/tools/gimpeditselectiontool.c
   trunk/app/tools/gimpimagemaptool.c
   trunk/app/tools/gimpiscissorstool.c
   trunk/app/tools/gimppainttool.c
   trunk/app/widgets/gimpsamplepointeditor.c
   trunk/tools/pdbgen/pdb/image.pdb

Modified: trunk/app/core/gimpimage.c
==============================================================================
--- trunk/app/core/gimpimage.c	(original)
+++ trunk/app/core/gimpimage.c	Thu Aug  7 09:17:46 2008
@@ -2507,6 +2507,17 @@
 }
 
 
+/*  projection  */
+
+GimpProjection *
+gimp_image_get_projection (const GimpImage *image)
+{
+  g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
+
+  return image->projection;
+}
+
+
 /*  layers / channels / vectors  */
 
 GimpContainer *

Modified: trunk/app/core/gimpimage.h
==============================================================================
--- trunk/app/core/gimpimage.h	(original)
+++ trunk/app/core/gimpimage.h	Thu Aug  7 09:17:46 2008
@@ -403,6 +403,11 @@
 GimpTattoo      gimp_image_get_tattoo_state      (GimpImage          *image);
 
 
+/*  projection  */
+
+GimpProjection * gimp_image_get_projection       (const GimpImage    *image);
+
+
 /*  layers / channels / vectors  */
 
 GimpContainer * gimp_image_get_layers            (const GimpImage    *image);

Modified: trunk/app/display/gimpdisplay-handlers.c
==============================================================================
--- trunk/app/display/gimpdisplay-handlers.c	(original)
+++ trunk/app/display/gimpdisplay-handlers.c	Thu Aug  7 09:17:46 2008
@@ -76,9 +76,10 @@
 
   g_object_ref (image);
 
-  g_signal_connect (image->projection, "update",
+  g_signal_connect (gimp_image_get_projection (image), "update",
                     G_CALLBACK (gimp_display_update_handler),
                     display);
+
   g_signal_connect (image, "flush",
                     G_CALLBACK (gimp_display_flush_handler),
                     display);
@@ -95,17 +96,20 @@
   g_return_if_fail (GIMP_IS_DISPLAY (display));
   g_return_if_fail (GIMP_IS_IMAGE (display->image));
 
-  g_signal_handlers_disconnect_by_func (display->image,
+  image = display->image;
+
+  g_signal_handlers_disconnect_by_func (image,
                                         gimp_display_saved_handler,
                                         display);
-  g_signal_handlers_disconnect_by_func (display->image,
+  g_signal_handlers_disconnect_by_func (image,
                                         gimp_display_flush_handler,
                                         display);
-  g_signal_handlers_disconnect_by_func (display->image->projection,
+
+  g_signal_handlers_disconnect_by_func (gimp_image_get_projection (image),
                                         gimp_display_update_handler,
                                         display);
 
-  display->image->disp_count--;
+  image->disp_count--;
 
 #if 0
   g_print ("%s: image->ref_count before unrefing: %d\n",
@@ -116,7 +120,6 @@
    *  that listens for image removals and then iterates the display list
    *  to find a valid display.
    */
-  image = display->image;
   display->image = NULL;
 
   g_object_unref (image);

Modified: trunk/app/display/gimpdisplayshell-render.c
==============================================================================
--- trunk/app/display/gimpdisplayshell-render.c	(original)
+++ trunk/app/display/gimpdisplayshell-render.c	Thu Aug  7 09:17:46 2008
@@ -231,7 +231,8 @@
   g_return_if_fail (w > 0 && h > 0);
 
   image = shell->display->image;
-  projection = image->projection;
+
+  projection = gimp_image_get_projection (image);
 
   gimp_display_shell_get_render_start_offset (shell, &offset_x, &offset_y);
 

Modified: trunk/app/display/gimpdisplayshell-scroll.c
==============================================================================
--- trunk/app/display/gimpdisplayshell-scroll.c	(original)
+++ trunk/app/display/gimpdisplayshell-scroll.c	Thu Aug  7 09:17:46 2008
@@ -306,7 +306,7 @@
   g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
   g_return_if_fail (GIMP_IS_IMAGE (shell->display->image));
 
-  proj = shell->display->image->projection;
+  proj = gimp_image_get_projection (shell->display->image);
 
   level = gimp_projection_get_level (proj, shell->scale_x, shell->scale_y);
 

Modified: trunk/app/paint/gimppaintcore.c
==============================================================================
--- trunk/app/paint/gimppaintcore.c	(original)
+++ trunk/app/paint/gimppaintcore.c	Thu Aug  7 09:17:46 2008
@@ -368,11 +368,11 @@
 
   if (core->use_saved_proj)
     {
-      GimpPickable *pickable;
-      TileManager  *tiles;
+      GimpImage      *image      = gimp_item_get_image (item);
+      GimpProjection *projection = gimp_image_get_projection (image);
+      TileManager    *tiles;
 
-      pickable = GIMP_PICKABLE (gimp_item_get_image (item)->projection);
-      tiles    = gimp_pickable_get_tiles (pickable);
+      tiles = gimp_pickable_get_tiles (GIMP_PICKABLE (projection));
 
       core->saved_proj_tiles = tile_manager_new (tile_manager_width (tiles),
                                                  tile_manager_height (tiles),
@@ -796,14 +796,15 @@
 
   if (core->use_saved_proj)
     {
-      GimpImage    *image    = gimp_item_get_image (GIMP_ITEM (drawable));
-      GimpPickable *pickable = GIMP_PICKABLE (image->projection);
-      gint          off_x;
-      gint          off_y;
+      GimpImage      *image      = gimp_item_get_image (GIMP_ITEM (drawable));
+      GimpProjection *projection = gimp_image_get_projection (image);
+      gint            off_x;
+      gint            off_y;
 
       gimp_item_offsets (GIMP_ITEM (drawable), &off_x, &off_y);
 
-      gimp_paint_core_validate_saved_proj_tiles (core, pickable,
+      gimp_paint_core_validate_saved_proj_tiles (core,
+                                                 GIMP_PICKABLE (projection),
                                                  core->canvas_buf->x + off_x,
                                                  core->canvas_buf->y + off_y,
                                                  core->canvas_buf->width,
@@ -1087,9 +1088,11 @@
                */
               dest_tile = tile_manager_get_tile (core->saved_proj_tiles,
                                                  j, i, TRUE, TRUE);
+
               memcpy (tile_data_pointer (dest_tile, 0, 0),
                       tile_data_pointer (src_tile, 0, 0),
                       tile_size (src_tile));
+
               tile_release (dest_tile, TRUE);
               tile_release (src_tile, FALSE);
             }

Modified: trunk/app/paint/gimpsourcecore.c
==============================================================================
--- trunk/app/paint/gimpsourcecore.c	(original)
+++ trunk/app/paint/gimpsourcecore.c	Thu Aug  7 09:17:46 2008
@@ -368,7 +368,7 @@
           GimpImage *src_image = gimp_pickable_get_image (src_pickable);
           gint       off_x, off_y;
 
-          src_pickable = GIMP_PICKABLE (src_image->projection);
+          src_pickable = GIMP_PICKABLE (gimp_image_get_projection (src_image));
 
           gimp_item_offsets (GIMP_ITEM (source_core->src_drawable),
                              &off_x, &off_y);

Modified: trunk/app/pdb/image-cmds.c
==============================================================================
--- trunk/app/pdb/image-cmds.c	(original)
+++ trunk/app/pdb/image-cmds.c	Thu Aug  7 09:17:46 2008
@@ -766,7 +766,7 @@
       if (success)
         {
           if (sample_merged)
-            gimp_pickable_flush (GIMP_PICKABLE (image->projection));
+            gimp_pickable_flush (GIMP_PICKABLE (gimp_image_get_projection (image)));
           else
             gimp_pickable_flush (GIMP_PICKABLE (drawable));
 
@@ -1615,7 +1615,7 @@
       else
         width  = MAX (1, (height * dwidth) / dheight);
 
-      gimp_pickable_flush (GIMP_PICKABLE (image->projection));
+      gimp_pickable_flush (GIMP_PICKABLE (gimp_image_get_projection (image)));
 
       buf = gimp_viewable_get_new_preview (GIMP_VIEWABLE (image), context,
                                            width, height);

Modified: trunk/app/tools/gimpbycolorselecttool.c
==============================================================================
--- trunk/app/tools/gimpbycolorselecttool.c	(original)
+++ trunk/app/tools/gimpbycolorselecttool.c	Thu Aug  7 09:17:46 2008
@@ -121,7 +121,7 @@
     }
   else
     {
-      pickable = GIMP_PICKABLE (display->image->projection);
+      pickable = GIMP_PICKABLE (gimp_image_get_projection (display->image));
     }
 
   gimp_pickable_flush (pickable);

Modified: trunk/app/tools/gimpeditselectiontool.c
==============================================================================
--- trunk/app/tools/gimpeditselectiontool.c	(original)
+++ trunk/app/tools/gimpeditselectiontool.c	Thu Aug  7 09:17:46 2008
@@ -714,7 +714,7 @@
       edit_select->first_move = FALSE;
     }
 
-  gimp_projection_flush (display->image->projection);
+  gimp_projection_flush (gimp_image_get_projection (display->image));
 
   gimp_tool_pop_status (tool, display);
   gimp_tool_push_status_coords (tool, display,

Modified: trunk/app/tools/gimpimagemaptool.c
==============================================================================
--- trunk/app/tools/gimpimagemaptool.c	(original)
+++ trunk/app/tools/gimpimagemaptool.c	Thu Aug  7 09:17:46 2008
@@ -506,10 +506,11 @@
 gimp_image_map_tool_flush (GimpImageMap     *image_map,
                            GimpImageMapTool *image_map_tool)
 {
-  GimpTool *tool = GIMP_TOOL (image_map_tool);
+  GimpTool    *tool = GIMP_TOOL (image_map_tool);
+  GimpDisplay *display = tool->display;
 
-  gimp_projection_flush_now (tool->display->image->projection);
-  gimp_display_flush_now (tool->display);
+  gimp_projection_flush_now (gimp_image_get_projection (display->image));
+  gimp_display_flush_now (display);
 }
 
 static void

Modified: trunk/app/tools/gimpiscissorstool.c
==============================================================================
--- trunk/app/tools/gimpiscissorstool.c	(original)
+++ trunk/app/tools/gimpiscissorstool.c	Thu Aug  7 09:17:46 2008
@@ -1786,7 +1786,7 @@
   dw = tile_ewidth (tile);
   dh = tile_eheight (tile);
 
-  pickable = GIMP_PICKABLE (image->projection);
+  pickable = GIMP_PICKABLE (gimp_image_get_projection (image));
 
   gimp_pickable_flush (pickable);
 

Modified: trunk/app/tools/gimppainttool.c
==============================================================================
--- trunk/app/tools/gimppainttool.c	(original)
+++ trunk/app/tools/gimppainttool.c	Thu Aug  7 09:17:46 2008
@@ -365,7 +365,7 @@
                              GIMP_PAINT_STATE_MOTION, time);
     }
 
-  gimp_projection_flush_now (display->image->projection);
+  gimp_projection_flush_now (gimp_image_get_projection (display->image));
   gimp_display_flush_now (display);
 
   gimp_draw_tool_start (draw_tool, display);
@@ -456,7 +456,7 @@
 
   gimp_paint_core_interpolate (core, drawable, paint_options, time);
 
-  gimp_projection_flush_now (display->image->projection);
+  gimp_projection_flush_now (gimp_image_get_projection (display->image));
   gimp_display_flush_now (display);
 
   gimp_draw_tool_resume (GIMP_DRAW_TOOL (tool));

Modified: trunk/app/widgets/gimpsamplepointeditor.c
==============================================================================
--- trunk/app/widgets/gimpsamplepointeditor.c	(original)
+++ trunk/app/widgets/gimpsamplepointeditor.c	Thu Aug  7 09:17:46 2008
@@ -269,7 +269,8 @@
       g_signal_handlers_disconnect_by_func (image_editor->image,
                                             gimp_sample_point_editor_point_update,
                                             editor);
-      g_signal_handlers_disconnect_by_func (image_editor->image->projection,
+
+      g_signal_handlers_disconnect_by_func (gimp_image_get_projection (image_editor->image),
                                             gimp_sample_point_editor_proj_update,
                                             editor);
     }
@@ -287,7 +288,8 @@
       g_signal_connect (image, "update-sample-point",
                         G_CALLBACK (gimp_sample_point_editor_point_update),
                         editor);
-      g_signal_connect (image->projection, "update",
+
+      g_signal_connect (gimp_image_get_projection (image), "update",
                         G_CALLBACK (gimp_sample_point_editor_proj_update),
                         editor);
     }

Modified: trunk/tools/pdbgen/pdb/image.pdb
==============================================================================
--- trunk/tools/pdbgen/pdb/image.pdb	(original)
+++ trunk/tools/pdbgen/pdb/image.pdb	Thu Aug  7 09:17:46 2008
@@ -615,7 +615,7 @@
   if (success)
     {
       if (sample_merged)
-        gimp_pickable_flush (GIMP_PICKABLE (image->projection));
+        gimp_pickable_flush (GIMP_PICKABLE (gimp_image_get_projection (image)));
       else
         gimp_pickable_flush (GIMP_PICKABLE (drawable));
 
@@ -2508,7 +2508,7 @@
   else
     width  = MAX (1, (height * dwidth) / dheight);
 
-  gimp_pickable_flush (GIMP_PICKABLE (image->projection));
+  gimp_pickable_flush (GIMP_PICKABLE (gimp_image_get_projection (image)));
 
   buf = gimp_viewable_get_new_preview (GIMP_VIEWABLE (image), context,
                                        width, height);



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