gimp r27398 - in trunk: . app/actions app/core app/dialogs app/paint app/pdb app/tools app/vectors tools/pdbgen/pdb



Author: mitch
Date: Sat Oct 25 11:59:03 2008
New Revision: 27398
URL: http://svn.gnome.org/viewvc/gimp?rev=27398&view=rev

Log:
2008-10-25  Michael Natterer  <mitch gimp org>

	More merging from SOC 2006's vector layer branch:

	* app/core/gimpitem.[ch]: add "gboolean push_undo" to
	GimpItem::stroke().

	* app/core/gimpdrawable-stroke.[ch]
	* app/paint/gimppaintcore-stroke.[ch]
	* app/paint/gimppaintcore.[ch] (gimp_paint_core_finish): add
	"push_undo" parameters here too.

	* app/actions/select-commands.c
	* app/actions/vectors-commands.c
	* app/core/gimpchannel.c
	* app/core/gimpselection.c
	* app/dialogs/stroke-dialog.c
	* app/tools/gimppainttool.c
	* app/vectors/gimpvectors.c
	* tools/pdbgen/pdb/edit.pdb
	* tools/pdbgen/pdb/paint_tools.pdb
	* tools/pdbgen/pdb/paths.pdb: pass TRUE all over the place.

	* app/pdb/edit-cmds.c
	* app/pdb/paint-tools-cmds.c
	* app/pdb/paths-cmds.c: regenerated.



Modified:
   trunk/ChangeLog
   trunk/app/actions/select-commands.c
   trunk/app/actions/vectors-commands.c
   trunk/app/core/gimpchannel.c
   trunk/app/core/gimpdrawable-stroke.c
   trunk/app/core/gimpdrawable-stroke.h
   trunk/app/core/gimpitem.c
   trunk/app/core/gimpitem.h
   trunk/app/core/gimpselection.c
   trunk/app/dialogs/stroke-dialog.c
   trunk/app/paint/gimppaintcore-stroke.c
   trunk/app/paint/gimppaintcore-stroke.h
   trunk/app/paint/gimppaintcore.c
   trunk/app/paint/gimppaintcore.h
   trunk/app/pdb/edit-cmds.c
   trunk/app/pdb/paint-tools-cmds.c
   trunk/app/pdb/paths-cmds.c
   trunk/app/tools/gimppainttool.c
   trunk/app/vectors/gimpvectors.c
   trunk/tools/pdbgen/pdb/edit.pdb
   trunk/tools/pdbgen/pdb/paint_tools.pdb
   trunk/tools/pdbgen/pdb/paths.pdb

Modified: trunk/app/actions/select-commands.c
==============================================================================
--- trunk/app/actions/select-commands.c	(original)
+++ trunk/app/actions/select-commands.c	Sat Oct 25 11:59:03 2008
@@ -372,7 +372,7 @@
     options = gimp_stroke_options_new (image->gimp, context, TRUE);
 
   if (! gimp_item_stroke (GIMP_ITEM (gimp_image_get_mask (image)),
-                          drawable, context, options, FALSE, NULL, &error))
+                          drawable, context, options, FALSE, TRUE, NULL, &error))
     {
       gimp_message (image->gimp, G_OBJECT (widget), GIMP_MESSAGE_WARNING,
                     error->message);

Modified: trunk/app/actions/vectors-commands.c
==============================================================================
--- trunk/app/actions/vectors-commands.c	(original)
+++ trunk/app/actions/vectors-commands.c	Sat Oct 25 11:59:03 2008
@@ -423,7 +423,7 @@
     options = gimp_stroke_options_new (image->gimp, context, TRUE);
 
   if (! gimp_item_stroke (GIMP_ITEM (vectors), drawable, context, options, FALSE,
-                          NULL, &error))
+                          TRUE, NULL, &error))
     {
       gimp_message (image->gimp, G_OBJECT (widget), GIMP_MESSAGE_WARNING,
                     error->message);

Modified: trunk/app/core/gimpchannel.c
==============================================================================
--- trunk/app/core/gimpchannel.c	(original)
+++ trunk/app/core/gimpchannel.c	Sat Oct 25 11:59:03 2008
@@ -126,6 +126,7 @@
 static gboolean   gimp_channel_stroke        (GimpItem          *item,
                                               GimpDrawable      *drawable,
                                               GimpStrokeOptions *stroke_options,
+                                              gboolean           push_undo,
                                               GimpProgress      *progress,
                                               GError           **error);
 
@@ -699,9 +700,9 @@
 gimp_channel_stroke (GimpItem           *item,
                      GimpDrawable       *drawable,
                      GimpStrokeOptions  *stroke_options,
+                     gboolean            push_undo,
                      GimpProgress       *progress,
                      GError            **error)
-
 {
   GimpChannel    *channel = GIMP_CHANNEL (item);
   const BoundSeg *segs_in;
@@ -728,7 +729,8 @@
       gimp_drawable_stroke_boundary (drawable,
                                      stroke_options,
                                      segs_in, n_segs_in,
-                                     offset_x, offset_y);
+                                     offset_x, offset_y,
+                                     push_undo);
       retval = TRUE;
       break;
 
@@ -746,7 +748,7 @@
                                                   stroke_options->emulate_dynamics,
                                                   segs_in, n_segs_in,
                                                   offset_x, offset_y,
-                                                  error);
+                                                  push_undo, error);
 
         g_object_unref (core);
       }

Modified: trunk/app/core/gimpdrawable-stroke.c
==============================================================================
--- trunk/app/core/gimpdrawable-stroke.c	(original)
+++ trunk/app/core/gimpdrawable-stroke.c	Sat Oct 25 11:59:03 2008
@@ -55,7 +55,9 @@
 
 static void gimp_drawable_stroke_scan_convert (GimpDrawable      *drawable,
                                                GimpStrokeOptions *options,
-                                               GimpScanConvert   *scan_convert);
+                                               GimpScanConvert   *scan_convert,
+                                               gboolean           push_undo);
+
 
 
 /*  public functions  */
@@ -66,7 +68,8 @@
                                const BoundSeg    *bound_segs,
                                gint               n_bound_segs,
                                gint               offset_x,
-                               gint               offset_y)
+                               gint               offset_y,
+                               gboolean           push_undo)
 {
   GimpScanConvert *scan_convert;
   BoundSeg        *stroke_segs;
@@ -135,7 +138,8 @@
   g_free (points);
   g_free (stroke_segs);
 
-  gimp_drawable_stroke_scan_convert (drawable, options, scan_convert);
+  gimp_drawable_stroke_scan_convert (drawable, options, scan_convert,
+                                     push_undo);
 
   gimp_scan_convert_free (scan_convert);
 }
@@ -143,7 +147,9 @@
 void
 gimp_drawable_stroke_vectors (GimpDrawable      *drawable,
                               GimpStrokeOptions *options,
-                              GimpVectors       *vectors)
+                              GimpVectors       *vectors,
+                              gboolean           push_undo)
+
 {
   GimpScanConvert *scan_convert;
   GimpStroke      *stroke;
@@ -194,7 +200,8 @@
     }
 
   if (num_coords > 0)
-    gimp_drawable_stroke_scan_convert (drawable, options, scan_convert);
+    gimp_drawable_stroke_scan_convert (drawable, options, scan_convert,
+                                       push_undo);
 
   gimp_scan_convert_free (scan_convert);
 }
@@ -205,7 +212,8 @@
 static void
 gimp_drawable_stroke_scan_convert (GimpDrawable      *drawable,
                                    GimpStrokeOptions *options,
-                                   GimpScanConvert   *scan_convert)
+                                   GimpScanConvert   *scan_convert,
+                                   gboolean           push_undo)
 {
   GimpContext *context = GIMP_CONTEXT (options);
   GimpImage   *image;
@@ -321,7 +329,7 @@
   /* Apply to drawable */
   pixel_region_init (&basePR, base, 0, 0, w, h, FALSE);
   gimp_drawable_apply_region (drawable, &basePR,
-                              TRUE, _("Render Stroke"),
+                              push_undo, _("Render Stroke"),
                               gimp_context_get_opacity (context),
                               gimp_context_get_paint_mode (context),
                               NULL, x, y);

Modified: trunk/app/core/gimpdrawable-stroke.h
==============================================================================
--- trunk/app/core/gimpdrawable-stroke.h	(original)
+++ trunk/app/core/gimpdrawable-stroke.h	Sat Oct 25 11:59:03 2008
@@ -28,11 +28,13 @@
                                       const BoundSeg    *bound_segs,
                                       gint               n_bound_segs,
                                       gint               offset_x,
-                                      gint               offset_y);
+                                      gint               offset_y,
+                                      gboolean           push_undo);
 
 void   gimp_drawable_stroke_vectors  (GimpDrawable      *drawable,
                                       GimpStrokeOptions *options,
-                                      GimpVectors       *vectors);
+                                      GimpVectors       *vectors,
+                                      gboolean           push_undo);
 
 
 #endif  /*  __GIMP_DRAWABLE_STROKE_H__  */

Modified: trunk/app/core/gimpitem.c
==============================================================================
--- trunk/app/core/gimpitem.c	(original)
+++ trunk/app/core/gimpitem.c	Sat Oct 25 11:59:03 2008
@@ -1009,6 +1009,7 @@
                   GimpContext       *context,
                   GimpStrokeOptions *stroke_options,
                   gboolean           use_default_values,
+                  gboolean           push_undo,
                   GimpProgress      *progress,
                   GError           **error)
 {
@@ -1032,13 +1033,15 @@
 
       gimp_stroke_options_prepare (stroke_options, context, use_default_values);
 
-      gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_PAINT,
-                                   item_class->stroke_desc);
+      if (push_undo)
+        gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_PAINT,
+                                     item_class->stroke_desc);
 
-      retval = item_class->stroke (item, drawable, stroke_options, progress,
-                                   error);
+      retval = item_class->stroke (item, drawable, stroke_options, push_undo,
+                                   progress, error);
 
-      gimp_image_undo_group_end (image);
+      if (push_undo)
+        gimp_image_undo_group_end (image);
 
       gimp_stroke_options_finish (stroke_options);
     }

Modified: trunk/app/core/gimpitem.h
==============================================================================
--- trunk/app/core/gimpitem.h	(original)
+++ trunk/app/core/gimpitem.h	Sat Oct 25 11:59:03 2008
@@ -111,6 +111,7 @@
   gboolean   (* stroke)       (GimpItem               *item,
                                GimpDrawable           *drawable,
                                GimpStrokeOptions      *stroke_options,
+                               gboolean                push_undo,
                                GimpProgress           *progress,
                                GError                **error);
 
@@ -215,6 +216,7 @@
                                             GimpContext        *context,
                                             GimpStrokeOptions  *stroke_options,
                                             gboolean            use_default_values,
+                                            gboolean            push_undo,
                                             GimpProgress       *progress,
                                             GError            **error);
 

Modified: trunk/app/core/gimpselection.c
==============================================================================
--- trunk/app/core/gimpselection.c	(original)
+++ trunk/app/core/gimpselection.c	Sat Oct 25 11:59:03 2008
@@ -76,6 +76,7 @@
 static gboolean   gimp_selection_stroke        (GimpItem          *item,
                                                 GimpDrawable      *drawable,
                                                 GimpStrokeOptions *stroke_options,
+                                                gboolean           push_undo,
                                                 GimpProgress      *progress,
                                                 GError           **error);
 static void gimp_selection_invalidate_boundary (GimpDrawable      *drawable);
@@ -256,6 +257,7 @@
 gimp_selection_stroke (GimpItem           *item,
                        GimpDrawable       *drawable,
                        GimpStrokeOptions  *stroke_options,
+                       gboolean            push_undo,
                        GimpProgress       *progress,
                        GError            **error)
 {
@@ -280,7 +282,7 @@
 
   retval = GIMP_ITEM_CLASS (parent_class)->stroke (item, drawable,
                                                    stroke_options,
-                                                   progress, error);
+                                                   push_undo, progress, error);
 
   selection->stroking = FALSE;
 

Modified: trunk/app/dialogs/stroke-dialog.c
==============================================================================
--- trunk/app/dialogs/stroke-dialog.c	(original)
+++ trunk/app/dialogs/stroke-dialog.c	Sat Oct 25 11:59:03 2008
@@ -315,8 +315,8 @@
                                 saved_options,
                                 (GDestroyNotify) g_object_unref);
 
-        if (! gimp_item_stroke (item, drawable, context, options, FALSE, NULL,
-                                &error))
+        if (! gimp_item_stroke (item, drawable, context, options, FALSE, TRUE,
+                                NULL, &error))
           {
             gimp_message (context->gimp, G_OBJECT (widget),
                           GIMP_MESSAGE_WARNING,

Modified: trunk/app/paint/gimppaintcore-stroke.c
==============================================================================
--- trunk/app/paint/gimppaintcore-stroke.c	(original)
+++ trunk/app/paint/gimppaintcore-stroke.c	Sat Oct 25 11:59:03 2008
@@ -46,6 +46,7 @@
                         GimpPaintOptions  *paint_options,
                         GimpCoords        *strokes,
                         gint               n_strokes,
+                        gboolean           push_undo,
                         GError           **error)
 {
   g_return_val_if_fail (GIMP_IS_PAINT_CORE (core), FALSE);
@@ -80,7 +81,7 @@
       gimp_paint_core_paint (core, drawable, paint_options,
                              GIMP_PAINT_STATE_FINISH, 0);
 
-      gimp_paint_core_finish (core, drawable);
+      gimp_paint_core_finish (core, drawable, push_undo);
 
       gimp_paint_core_cleanup (core);
 
@@ -99,6 +100,7 @@
                                  gint               n_bound_segs,
                                  gint               offset_x,
                                  gint               offset_y,
+                                 gboolean           push_undo,
                                  GError           **error)
 {
   GimpImage  *image;
@@ -212,7 +214,7 @@
 
   if (initialized)
     {
-      gimp_paint_core_finish (core, drawable);
+      gimp_paint_core_finish (core, drawable, push_undo);
 
       gimp_paint_core_cleanup (core);
     }
@@ -229,6 +231,7 @@
                                 GimpPaintOptions  *paint_options,
                                 gboolean           emulate_dynamics,
                                 GimpVectors       *vectors,
+                                gboolean           push_undo,
                                 GError           **error)
 {
   GList    *stroke;
@@ -313,7 +316,7 @@
 
   if (initialized)
     {
-      gimp_paint_core_finish (core, drawable);
+      gimp_paint_core_finish (core, drawable, push_undo);
 
       gimp_paint_core_cleanup (core);
     }

Modified: trunk/app/paint/gimppaintcore-stroke.h
==============================================================================
--- trunk/app/paint/gimppaintcore-stroke.h	(original)
+++ trunk/app/paint/gimppaintcore-stroke.h	Sat Oct 25 11:59:03 2008
@@ -25,6 +25,7 @@
                                             GimpPaintOptions  *paint_options,
                                             GimpCoords        *strokes,
                                             gint               n_strokes,
+                                            gboolean           push_undo,
                                             GError           **error);
 gboolean   gimp_paint_core_stroke_boundary (GimpPaintCore     *core,
                                             GimpDrawable      *drawable,
@@ -34,12 +35,14 @@
                                             gint               n_bound_segs,
                                             gint               offset_x,
                                             gint               offset_y,
+                                            gboolean           push_undo,
                                             GError           **error);
 gboolean   gimp_paint_core_stroke_vectors  (GimpPaintCore     *core,
                                             GimpDrawable      *drawable,
                                             GimpPaintOptions  *paint_options,
                                             gboolean           emulate_dynamics,
                                             GimpVectors       *vectors,
+                                            gboolean           push_undo,
                                             GError           **error);
 
 

Modified: trunk/app/paint/gimppaintcore.c
==============================================================================
--- trunk/app/paint/gimppaintcore.c	(original)
+++ trunk/app/paint/gimppaintcore.c	Sat Oct 25 11:59:03 2008
@@ -402,7 +402,8 @@
 
 void
 gimp_paint_core_finish (GimpPaintCore *core,
-                        GimpDrawable  *drawable)
+                        GimpDrawable  *drawable,
+                        gboolean       push_undo)
 {
   GimpImage *image;
 
@@ -418,21 +419,25 @@
   if ((core->x2 == core->x1) || (core->y2 == core->y1))
     return;
 
-  gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_PAINT, core->undo_desc);
+  if (push_undo)
+    {
+      gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_PAINT,
+                                   core->undo_desc);
 
-  GIMP_PAINT_CORE_GET_CLASS (core)->push_undo (core, image, NULL);
+      GIMP_PAINT_CORE_GET_CLASS (core)->push_undo (core, image, NULL);
 
-  gimp_drawable_push_undo (drawable, NULL,
-                           core->x1, core->y1,
-                           core->x2, core->y2,
-                           core->undo_tiles,
-                           TRUE);
+      gimp_drawable_push_undo (drawable, NULL,
+                               core->x1, core->y1,
+                               core->x2, core->y2,
+                               core->undo_tiles,
+                               TRUE);
+
+      gimp_image_undo_group_end (image);
+    }
 
   tile_manager_unref (core->undo_tiles);
   core->undo_tiles = NULL;
 
-  gimp_image_undo_group_end (image);
-
   if (core->saved_proj_tiles)
     {
       tile_manager_unref (core->saved_proj_tiles);

Modified: trunk/app/paint/gimppaintcore.h
==============================================================================
--- trunk/app/paint/gimppaintcore.h	(original)
+++ trunk/app/paint/gimppaintcore.h	Sat Oct 25 11:59:03 2008
@@ -122,7 +122,8 @@
                                                      GimpCoords       *coords,
                                                      GError          **error);
 void      gimp_paint_core_finish                    (GimpPaintCore    *core,
-                                                     GimpDrawable     *drawable);
+                                                     GimpDrawable     *drawable,
+                                                     gboolean          push_undo);
 void      gimp_paint_core_cancel                    (GimpPaintCore    *core,
                                                      GimpDrawable     *drawable);
 void      gimp_paint_core_cleanup                   (GimpPaintCore    *core);

Modified: trunk/app/pdb/edit-cmds.c
==============================================================================
--- trunk/app/pdb/edit-cmds.c	(original)
+++ trunk/app/pdb/edit-cmds.c	Sat Oct 25 11:59:03 2008
@@ -754,8 +754,8 @@
                         NULL);
 
           success = gimp_item_stroke (GIMP_ITEM (gimp_image_get_mask (image)),
-                                      drawable, context, options, TRUE, progress,
-                                      error);
+                                      drawable, context, options, TRUE, TRUE,
+                                      progress, error);
 
           g_object_unref (options);
         }
@@ -794,8 +794,8 @@
                         NULL);
 
           success = gimp_item_stroke (GIMP_ITEM (vectors),
-                                      drawable, context, options, TRUE, progress,
-                                      error);
+                                      drawable, context, options, TRUE, TRUE,
+                                      progress, error);
 
           g_object_unref (options);
         }

Modified: trunk/app/pdb/paint-tools-cmds.c
==============================================================================
--- trunk/app/pdb/paint-tools-cmds.c	(original)
+++ trunk/app/pdb/paint-tools-cmds.c	Sat Oct 25 11:59:03 2008
@@ -83,7 +83,7 @@
     }
 
   retval = gimp_paint_core_stroke (core, drawable, options,
-                                   coords, n_strokes,
+                                   coords, n_strokes, TRUE,
                                    error);
 
   g_free (coords);

Modified: trunk/app/pdb/paths-cmds.c
==============================================================================
--- trunk/app/pdb/paths-cmds.c	(original)
+++ trunk/app/pdb/paths-cmds.c	Sat Oct 25 11:59:03 2008
@@ -340,8 +340,8 @@
                         NULL);
 
           success = gimp_item_stroke (GIMP_ITEM (vectors),
-                                      drawable, context, options, TRUE, progress,
-                                      error);
+                                      drawable, context, options, TRUE, TRUE,
+                                      progress, error);
 
           g_object_unref (options);
         }

Modified: trunk/app/tools/gimppainttool.c
==============================================================================
--- trunk/app/tools/gimppainttool.c	(original)
+++ trunk/app/tools/gimppainttool.c	Sat Oct 25 11:59:03 2008
@@ -423,7 +423,7 @@
   if (release_type == GIMP_BUTTON_RELEASE_CANCEL)
     gimp_paint_core_cancel (core, drawable);
   else
-    gimp_paint_core_finish (core, drawable);
+    gimp_paint_core_finish (core, drawable, TRUE);
 
   gimp_image_flush (display->image);
 

Modified: trunk/app/vectors/gimpvectors.c
==============================================================================
--- trunk/app/vectors/gimpvectors.c	(original)
+++ trunk/app/vectors/gimpvectors.c	Sat Oct 25 11:59:03 2008
@@ -108,6 +108,7 @@
 static gboolean   gimp_vectors_stroke       (GimpItem          *item,
                                              GimpDrawable      *drawable,
                                              GimpStrokeOptions *stroke_options,
+                                             gboolean           push_undo,
                                              GimpProgress      *progress,
                                              GError           **error);
 
@@ -495,6 +496,7 @@
 gimp_vectors_stroke (GimpItem           *item,
                      GimpDrawable       *drawable,
                      GimpStrokeOptions  *stroke_options,
+                     gboolean            push_undo,
                      GimpProgress       *progress,
                      GError            **error)
 {
@@ -510,7 +512,7 @@
     case GIMP_STROKE_METHOD_LIBART:
       gimp_drawable_stroke_vectors (drawable,
                                     stroke_options,
-                                    vectors);
+                                    vectors, push_undo);
       retval = TRUE;
       break;
 
@@ -526,7 +528,7 @@
         retval = gimp_paint_core_stroke_vectors (core, drawable,
                                                  stroke_options->paint_options,
                                                  stroke_options->emulate_dynamics,
-                                                 vectors, error);
+                                                 vectors, push_undo, error);
 
         g_object_unref (core);
       }

Modified: trunk/tools/pdbgen/pdb/edit.pdb
==============================================================================
--- trunk/tools/pdbgen/pdb/edit.pdb	(original)
+++ trunk/tools/pdbgen/pdb/edit.pdb	Sat Oct 25 11:59:03 2008
@@ -840,8 +840,8 @@
                     NULL);
 
       success = gimp_item_stroke (GIMP_ITEM (gimp_image_get_mask (image)),
-                                  drawable, context, options, TRUE, progress,
-                                  error);
+                                  drawable, context, options, TRUE, TRUE,
+                                  progress, error);
 
       g_object_unref (options);
     }
@@ -883,8 +883,8 @@
                     NULL);
 
       success = gimp_item_stroke (GIMP_ITEM (vectors),
-                                  drawable, context, options, TRUE, progress,
-                                  error);
+                                  drawable, context, options, TRUE, TRUE,
+                                  progress, error);
 
       g_object_unref (options);
     }

Modified: trunk/tools/pdbgen/pdb/paint_tools.pdb
==============================================================================
--- trunk/tools/pdbgen/pdb/paint_tools.pdb	(original)
+++ trunk/tools/pdbgen/pdb/paint_tools.pdb	Sat Oct 25 11:59:03 2008
@@ -928,7 +928,7 @@
     }
 
   retval = gimp_paint_core_stroke (core, drawable, options,
-                                   coords, n_strokes,
+                                   coords, n_strokes, TRUE,
                                    error);
 
   g_free (coords);

Modified: trunk/tools/pdbgen/pdb/paths.pdb
==============================================================================
--- trunk/tools/pdbgen/pdb/paths.pdb	(original)
+++ trunk/tools/pdbgen/pdb/paths.pdb	Sat Oct 25 11:59:03 2008
@@ -275,8 +275,8 @@
                     NULL);
 
       success = gimp_item_stroke (GIMP_ITEM (vectors),
-                                  drawable, context, options, TRUE, progress,
-                                  error);
+                                  drawable, context, options, TRUE, TRUE,
+                                  progress, error);
 
       g_object_unref (options);
     }
@@ -287,7 +287,7 @@
     );
 }
 
-sub  path_get_point_at_dist {
+sub path_get_point_at_dist {
     &std_pdb_deprecated('gimp-vectors-stroke-get-point-at-dist');
 
     @inargs = (



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