gimp r27388 - in trunk: . app/actions app/core app/dialogs app/pdb app/vectors tools/pdbgen/pdb
- From: mitch svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp r27388 - in trunk: . app/actions app/core app/dialogs app/pdb app/vectors tools/pdbgen/pdb
- Date: Fri, 24 Oct 2008 07:37:47 +0000 (UTC)
Author: mitch
Date: Fri Oct 24 07:37:46 2008
New Revision: 27388
URL: http://svn.gnome.org/viewvc/gimp?rev=27388&view=rev
Log:
2008-10-24 Michael Natterer <mitch gimp org>
* app/core/Makefile.am
* app/core/core-types.h
* app/core/gimpstrokedesc.[ch]: remove this mis-engineered
abstraction...
* app/core/gimpstrokeoptions.[ch]: ...and add its properties and
API here.
* app/core/gimpitem.[ch]: GimpItem::stroke() take a
GimpStrokeOptions instead of a GimpStrokeDesc.
* app/core/gimpchannel.c
* app/core/gimpselection.c
* app/vectors/gimpvectors.c
* app/actions/select-commands.c
* app/actions/vectors-commands.c
* app/dialogs/stroke-dialog.c
* tools/pdbgen/pdb/edit.pdb
* tools/pdbgen/pdb/paths.pdb: changed accordingly.
* app/pdb/edit-cmds.c
* app/pdb/paths-cmds.c: regenerated.
Removed:
trunk/app/core/gimpstrokedesc.c
trunk/app/core/gimpstrokedesc.h
Modified:
trunk/ChangeLog
trunk/app/actions/select-commands.c
trunk/app/actions/vectors-commands.c
trunk/app/core/Makefile.am
trunk/app/core/core-types.h
trunk/app/core/gimpchannel.c
trunk/app/core/gimpitem.c
trunk/app/core/gimpitem.h
trunk/app/core/gimpselection.c
trunk/app/core/gimpstrokeoptions.c
trunk/app/core/gimpstrokeoptions.h
trunk/app/dialogs/stroke-dialog.c
trunk/app/pdb/edit-cmds.c
trunk/app/pdb/paths-cmds.c
trunk/app/vectors/gimpvectors.c
trunk/tools/pdbgen/pdb/edit.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 Fri Oct 24 07:37:46 2008
@@ -31,7 +31,7 @@
#include "core/gimpchannel-select.h"
#include "core/gimpimage.h"
#include "core/gimpselection.h"
-#include "core/gimpstrokedesc.h"
+#include "core/gimpstrokeoptions.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpdialogfactory.h"
@@ -345,12 +345,12 @@
select_stroke_last_vals_cmd_callback (GtkAction *action,
gpointer data)
{
- GimpImage *image;
- GimpDrawable *drawable;
- GimpContext *context;
- GtkWidget *widget;
- GimpStrokeDesc *desc;
- GError *error = NULL;
+ GimpImage *image;
+ GimpDrawable *drawable;
+ GimpContext *context;
+ GtkWidget *widget;
+ GimpStrokeOptions *options;
+ GError *error = NULL;
return_if_no_image (image, data);
return_if_no_context (context, data);
return_if_no_widget (widget, data);
@@ -364,15 +364,15 @@
return;
}
- desc = g_object_get_data (G_OBJECT (image->gimp), "saved-stroke-desc");
+ options = g_object_get_data (G_OBJECT (image->gimp), "saved-stroke-options");
- if (desc)
- g_object_ref (desc);
+ if (options)
+ g_object_ref (options);
else
- desc = gimp_stroke_desc_new (image->gimp, context);
+ options = gimp_stroke_options_new (image->gimp, context);
if (! gimp_item_stroke (GIMP_ITEM (gimp_image_get_mask (image)),
- drawable, context, desc, FALSE, NULL, &error))
+ drawable, context, options, FALSE, NULL, &error))
{
gimp_message (image->gimp, G_OBJECT (widget), GIMP_MESSAGE_WARNING,
error->message);
@@ -383,7 +383,7 @@
gimp_image_flush (image);
}
- g_object_unref (desc);
+ g_object_unref (options);
}
Modified: trunk/app/actions/vectors-commands.c
==============================================================================
--- trunk/app/actions/vectors-commands.c (original)
+++ trunk/app/actions/vectors-commands.c Fri Oct 24 07:37:46 2008
@@ -38,7 +38,7 @@
#include "core/gimpitemundo.h"
#include "core/gimpparamspecs.h"
#include "core/gimpprogress.h"
-#include "core/gimpstrokedesc.h"
+#include "core/gimpstrokeoptions.h"
#include "core/gimptoolinfo.h"
#include "pdb/gimppdb.h"
@@ -394,13 +394,13 @@
vectors_stroke_last_vals_cmd_callback (GtkAction *action,
gpointer data)
{
- GimpImage *image;
- GimpVectors *vectors;
- GimpDrawable *drawable;
- GimpContext *context;
- GtkWidget *widget;
- GimpStrokeDesc *desc;
- GError *error = NULL;
+ GimpImage *image;
+ GimpVectors *vectors;
+ GimpDrawable *drawable;
+ GimpContext *context;
+ GtkWidget *widget;
+ GimpStrokeOptions *options;
+ GError *error = NULL;
return_if_no_vectors (image, vectors, data);
return_if_no_context (context, data);
return_if_no_widget (widget, data);
@@ -415,14 +415,14 @@
}
- desc = g_object_get_data (G_OBJECT (image->gimp), "saved-stroke-desc");
+ options = g_object_get_data (G_OBJECT (image->gimp), "saved-stroke-options");
- if (desc)
- g_object_ref (desc);
+ if (options)
+ g_object_ref (options);
else
- desc = gimp_stroke_desc_new (image->gimp, context);
+ options = gimp_stroke_options_new (image->gimp, context);
- if (! gimp_item_stroke (GIMP_ITEM (vectors), drawable, context, desc, FALSE,
+ if (! gimp_item_stroke (GIMP_ITEM (vectors), drawable, context, options, FALSE,
NULL, &error))
{
gimp_message (image->gimp, G_OBJECT (widget), GIMP_MESSAGE_WARNING,
@@ -434,7 +434,7 @@
gimp_image_flush (image);
}
- g_object_unref (desc);
+ g_object_unref (options);
}
void
Modified: trunk/app/core/Makefile.am
==============================================================================
--- trunk/app/core/Makefile.am (original)
+++ trunk/app/core/Makefile.am Fri Oct 24 07:37:46 2008
@@ -309,8 +309,6 @@
gimpscanconvert.h \
gimpselection.c \
gimpselection.h \
- gimpstrokedesc.c \
- gimpstrokedesc.h \
gimpstrokeoptions.c \
gimpstrokeoptions.h \
gimpsubprogress.c \
Modified: trunk/app/core/core-types.h
==============================================================================
--- trunk/app/core/core-types.h (original)
+++ trunk/app/core/core-types.h Fri Oct 24 07:37:46 2008
@@ -148,7 +148,6 @@
typedef struct _GimpPdbProgress GimpPdbProgress;
typedef struct _GimpProjection GimpProjection;
typedef struct _GimpSubProgress GimpSubProgress;
-typedef struct _GimpStrokeDesc GimpStrokeDesc;
/* typedef struct _GimpTemplate GimpTemplate; in config-types.h */
Modified: trunk/app/core/gimpchannel.c
==============================================================================
--- trunk/app/core/gimpchannel.c (original)
+++ trunk/app/core/gimpchannel.c Fri Oct 24 07:37:46 2008
@@ -53,7 +53,7 @@
#include "gimpmarshal.h"
#include "gimppaintinfo.h"
#include "gimppickable.h"
-#include "gimpstrokedesc.h"
+#include "gimpstrokeoptions.h"
#include "gimp-intl.h"
@@ -74,148 +74,148 @@
static void gimp_channel_pickable_iface_init (GimpPickableInterface *iface);
-static void gimp_channel_finalize (GObject *object);
+static void gimp_channel_finalize (GObject *object);
-static gint64 gimp_channel_get_memsize (GimpObject *object,
- gint64 *gui_size);
+static gint64 gimp_channel_get_memsize (GimpObject *object,
+ gint64 *gui_size);
-static gchar * gimp_channel_get_description (GimpViewable *viewable,
- gchar **tooltip);
+static gchar * gimp_channel_get_description (GimpViewable *viewable,
+ gchar **tooltip);
-static gboolean gimp_channel_is_attached (GimpItem *item);
-static GimpItem * gimp_channel_duplicate (GimpItem *item,
- GType new_type);
-static void gimp_channel_convert (GimpItem *item,
- GimpImage *dest_image);
-static void gimp_channel_translate (GimpItem *item,
- gint off_x,
- gint off_y,
- gboolean push_undo);
-static void gimp_channel_scale (GimpItem *item,
- gint new_width,
- gint new_height,
- gint new_offset_x,
- gint new_offset_y,
+static gboolean gimp_channel_is_attached (GimpItem *item);
+static GimpItem * gimp_channel_duplicate (GimpItem *item,
+ GType new_type);
+static void gimp_channel_convert (GimpItem *item,
+ GimpImage *dest_image);
+static void gimp_channel_translate (GimpItem *item,
+ gint off_x,
+ gint off_y,
+ gboolean push_undo);
+static void gimp_channel_scale (GimpItem *item,
+ gint new_width,
+ gint new_height,
+ gint new_offset_x,
+ gint new_offset_y,
GimpInterpolationType interp_type,
- GimpProgress *progress);
-static void gimp_channel_resize (GimpItem *item,
- GimpContext *context,
- gint new_width,
- gint new_height,
- gint offx,
- gint offy);
-static void gimp_channel_flip (GimpItem *item,
- GimpContext *context,
+ GimpProgress *progress);
+static void gimp_channel_resize (GimpItem *item,
+ GimpContext *context,
+ gint new_width,
+ gint new_height,
+ gint offx,
+ gint offy);
+static void gimp_channel_flip (GimpItem *item,
+ GimpContext *context,
GimpOrientationType flip_type,
- gdouble axis,
- gboolean flip_result);
-static void gimp_channel_rotate (GimpItem *item,
- GimpContext *context,
- GimpRotationType flip_type,
- gdouble center_x,
- gdouble center_y,
- gboolean flip_result);
-static void gimp_channel_transform (GimpItem *item,
- GimpContext *context,
+ gdouble axis,
+ gboolean flip_result);
+static void gimp_channel_rotate (GimpItem *item,
+ GimpContext *context,
+ GimpRotationType flip_type,
+ gdouble center_x,
+ gdouble center_y,
+ gboolean flip_result);
+static void gimp_channel_transform (GimpItem *item,
+ GimpContext *context,
const GimpMatrix3 *matrix,
GimpTransformDirection direction,
GimpInterpolationType interpolation_type,
- gint recursion_level,
+ gint recursion_level,
GimpTransformResize clip_result,
- GimpProgress *progress);
-static gboolean gimp_channel_stroke (GimpItem *item,
- GimpDrawable *drawable,
- GimpStrokeDesc *stroke_desc,
- GimpProgress *progress,
- GError **error);
+ GimpProgress *progress);
+static gboolean gimp_channel_stroke (GimpItem *item,
+ GimpDrawable *drawable,
+ GimpStrokeOptions *stroke_options,
+ GimpProgress *progress,
+ GError **error);
static void gimp_channel_invalidate_boundary (GimpDrawable *drawable);
static void gimp_channel_get_active_components (const GimpDrawable *drawable,
gboolean *active);
-static void gimp_channel_apply_region (GimpDrawable *drawable,
- PixelRegion *src2PR,
- gboolean push_undo,
- const gchar *undo_desc,
- gdouble opacity,
+static void gimp_channel_apply_region (GimpDrawable *drawable,
+ PixelRegion *src2PR,
+ gboolean push_undo,
+ const gchar *undo_desc,
+ gdouble opacity,
GimpLayerModeEffects mode,
- TileManager *src1_tiles,
- gint x,
- gint y);
-static void gimp_channel_replace_region (GimpDrawable *drawable,
- PixelRegion *src2PR,
- gboolean push_undo,
- const gchar *undo_desc,
- gdouble opacity,
- PixelRegion *maskPR,
- gint x,
- gint y);
-static void gimp_channel_set_tiles (GimpDrawable *drawable,
- gboolean push_undo,
- const gchar *undo_desc,
- TileManager *tiles,
- GimpImageType type,
- gint offset_x,
- gint offset_y);
-static GeglNode * gimp_channel_get_node (GimpDrawable *drawable);
-static void gimp_channel_swap_pixels (GimpDrawable *drawable,
- TileManager *tiles,
- gboolean sparse,
- gint x,
- gint y,
- gint width,
- gint height);
-
-static gint gimp_channel_get_opacity_at (GimpPickable *pickable,
- gint x,
- gint y);
-
-static gboolean gimp_channel_real_boundary (GimpChannel *channel,
- const BoundSeg **segs_in,
- const BoundSeg **segs_out,
- gint *num_segs_in,
- gint *num_segs_out,
- gint x1,
- gint y1,
- gint x2,
- gint y2);
-static gboolean gimp_channel_real_bounds (GimpChannel *channel,
- gint *x1,
- gint *y1,
- gint *x2,
- gint *y2);
-static gboolean gimp_channel_real_is_empty (GimpChannel *channel);
-static void gimp_channel_real_feather (GimpChannel *channel,
- gdouble radius_x,
- gdouble radius_y,
- gboolean push_undo);
-static void gimp_channel_real_sharpen (GimpChannel *channel,
- gboolean push_undo);
-static void gimp_channel_real_clear (GimpChannel *channel,
- const gchar *undo_desc,
- gboolean push_undo);
-static void gimp_channel_real_all (GimpChannel *channel,
- gboolean push_undo);
-static void gimp_channel_real_invert (GimpChannel *channel,
- gboolean push_undo);
-static void gimp_channel_real_border (GimpChannel *channel,
- gint radius_x,
- gint radius_y,
- gboolean feather,
- gboolean edge_lock,
- gboolean push_undo);
-static void gimp_channel_real_grow (GimpChannel *channel,
- gint radius_x,
- gint radius_y,
- gboolean push_undo);
-static void gimp_channel_real_shrink (GimpChannel *channel,
- gint radius_x,
- gint radius_y,
- gboolean edge_lock,
- gboolean push_undo);
+ TileManager *src1_tiles,
+ gint x,
+ gint y);
+static void gimp_channel_replace_region (GimpDrawable *drawable,
+ PixelRegion *src2PR,
+ gboolean push_undo,
+ const gchar *undo_desc,
+ gdouble opacity,
+ PixelRegion *maskPR,
+ gint x,
+ gint y);
+static void gimp_channel_set_tiles (GimpDrawable *drawable,
+ gboolean push_undo,
+ const gchar *undo_desc,
+ TileManager *tiles,
+ GimpImageType type,
+ gint offset_x,
+ gint offset_y);
+static GeglNode * gimp_channel_get_node (GimpDrawable *drawable);
+static void gimp_channel_swap_pixels (GimpDrawable *drawable,
+ TileManager *tiles,
+ gboolean sparse,
+ gint x,
+ gint y,
+ gint width,
+ gint height);
+
+static gint gimp_channel_get_opacity_at (GimpPickable *pickable,
+ gint x,
+ gint y);
+
+static gboolean gimp_channel_real_boundary (GimpChannel *channel,
+ const BoundSeg **segs_in,
+ const BoundSeg **segs_out,
+ gint *num_segs_in,
+ gint *num_segs_out,
+ gint x1,
+ gint y1,
+ gint x2,
+ gint y2);
+static gboolean gimp_channel_real_bounds (GimpChannel *channel,
+ gint *x1,
+ gint *y1,
+ gint *x2,
+ gint *y2);
+static gboolean gimp_channel_real_is_empty (GimpChannel *channel);
+static void gimp_channel_real_feather (GimpChannel *channel,
+ gdouble radius_x,
+ gdouble radius_y,
+ gboolean push_undo);
+static void gimp_channel_real_sharpen (GimpChannel *channel,
+ gboolean push_undo);
+static void gimp_channel_real_clear (GimpChannel *channel,
+ const gchar *undo_desc,
+ gboolean push_undo);
+static void gimp_channel_real_all (GimpChannel *channel,
+ gboolean push_undo);
+static void gimp_channel_real_invert (GimpChannel *channel,
+ gboolean push_undo);
+static void gimp_channel_real_border (GimpChannel *channel,
+ gint radius_x,
+ gint radius_y,
+ gboolean feather,
+ gboolean edge_lock,
+ gboolean push_undo);
+static void gimp_channel_real_grow (GimpChannel *channel,
+ gint radius_x,
+ gint radius_y,
+ gboolean push_undo);
+static void gimp_channel_real_shrink (GimpChannel *channel,
+ gint radius_x,
+ gint radius_y,
+ gboolean edge_lock,
+ gboolean push_undo);
-static void gimp_channel_validate_tile (TileManager *tm,
- Tile *tile);
+static void gimp_channel_validate_tile (TileManager *tm,
+ Tile *tile);
G_DEFINE_TYPE_WITH_CODE (GimpChannel, gimp_channel, GIMP_TYPE_DRAWABLE,
@@ -696,11 +696,11 @@
}
static gboolean
-gimp_channel_stroke (GimpItem *item,
- GimpDrawable *drawable,
- GimpStrokeDesc *stroke_desc,
- GimpProgress *progress,
- GError **error)
+gimp_channel_stroke (GimpItem *item,
+ GimpDrawable *drawable,
+ GimpStrokeOptions *stroke_options,
+ GimpProgress *progress,
+ GError **error)
{
GimpChannel *channel = GIMP_CHANNEL (item);
@@ -722,11 +722,11 @@
gimp_item_offsets (GIMP_ITEM (channel), &offset_x, &offset_y);
- switch (stroke_desc->method)
+ switch (stroke_options->method)
{
case GIMP_STROKE_METHOD_LIBART:
gimp_drawable_stroke_boundary (drawable,
- stroke_desc->stroke_options,
+ stroke_options,
segs_in, n_segs_in,
offset_x, offset_y);
retval = TRUE;
@@ -734,13 +734,16 @@
case GIMP_STROKE_METHOD_PAINT_CORE:
{
+ GimpPaintInfo *paint_info;
GimpPaintCore *core;
- core = g_object_new (stroke_desc->paint_info->paint_type, NULL);
+ paint_info = gimp_context_get_paint_info (GIMP_CONTEXT (stroke_options));
+
+ core = g_object_new (paint_info->paint_type, NULL);
retval = gimp_paint_core_stroke_boundary (core, drawable,
- stroke_desc->paint_options,
- stroke_desc->emulate_dynamics,
+ stroke_options->paint_options,
+ stroke_options->emulate_dynamics,
segs_in, n_segs_in,
offset_x, offset_y,
error);
Modified: trunk/app/core/gimpitem.c
==============================================================================
--- trunk/app/core/gimpitem.c (original)
+++ trunk/app/core/gimpitem.c Fri Oct 24 07:37:46 2008
@@ -40,7 +40,7 @@
#include "gimpmarshal.h"
#include "gimpparasitelist.h"
#include "gimpprogress.h"
-#include "gimpstrokedesc.h"
+#include "gimpstrokeoptions.h"
#include "gimp-intl.h"
@@ -1004,13 +1004,13 @@
}
gboolean
-gimp_item_stroke (GimpItem *item,
- GimpDrawable *drawable,
- GimpContext *context,
- GimpStrokeDesc *stroke_desc,
- gboolean use_default_values,
- GimpProgress *progress,
- GError **error)
+gimp_item_stroke (GimpItem *item,
+ GimpDrawable *drawable,
+ GimpContext *context,
+ GimpStrokeOptions *stroke_options,
+ gboolean use_default_values,
+ GimpProgress *progress,
+ GError **error)
{
GimpItemClass *item_class;
gboolean retval = FALSE;
@@ -1020,7 +1020,7 @@
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)), FALSE);
g_return_val_if_fail (GIMP_IS_CONTEXT (context), FALSE);
- g_return_val_if_fail (GIMP_IS_STROKE_DESC (stroke_desc), FALSE);
+ g_return_val_if_fail (GIMP_IS_STROKE_OPTIONS (stroke_options), FALSE);
g_return_val_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress), FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
@@ -1030,16 +1030,17 @@
{
GimpImage *image = gimp_item_get_image (item);
- gimp_stroke_desc_prepare (stroke_desc, context, use_default_values);
+ gimp_stroke_options_prepare (stroke_options, context, use_default_values);
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_PAINT,
item_class->stroke_desc);
- retval = item_class->stroke (item, drawable, stroke_desc, progress, error);
+ retval = item_class->stroke (item, drawable, stroke_options, progress,
+ error);
gimp_image_undo_group_end (image);
- gimp_stroke_desc_finish (stroke_desc);
+ gimp_stroke_options_finish (stroke_options);
}
return retval;
Modified: trunk/app/core/gimpitem.h
==============================================================================
--- trunk/app/core/gimpitem.h (original)
+++ trunk/app/core/gimpitem.h Fri Oct 24 07:37:46 2008
@@ -110,7 +110,7 @@
GimpProgress *progress);
gboolean (* stroke) (GimpItem *item,
GimpDrawable *drawable,
- GimpStrokeDesc *stroke_desc,
+ GimpStrokeOptions *stroke_options,
GimpProgress *progress,
GError **error);
@@ -213,7 +213,7 @@
gboolean gimp_item_stroke (GimpItem *item,
GimpDrawable *drawable,
GimpContext *context,
- GimpStrokeDesc *stroke_desc,
+ GimpStrokeOptions *stroke_options,
gboolean use_default_values,
GimpProgress *progress,
GError **error);
Modified: trunk/app/core/gimpselection.c
==============================================================================
--- trunk/app/core/gimpselection.c (original)
+++ trunk/app/core/gimpselection.c Fri Oct 24 07:37:46 2008
@@ -44,85 +44,85 @@
#include "gimp-intl.h"
-static gboolean gimp_selection_is_attached (GimpItem *item);
-static void gimp_selection_translate (GimpItem *item,
- gint offset_x,
- gint offset_y,
- gboolean push_undo);
-static void gimp_selection_scale (GimpItem *item,
- gint new_width,
- gint new_height,
- gint new_offset_x,
- gint new_offset_y,
+static gboolean gimp_selection_is_attached (GimpItem *item);
+static void gimp_selection_translate (GimpItem *item,
+ gint offset_x,
+ gint offset_y,
+ gboolean push_undo);
+static void gimp_selection_scale (GimpItem *item,
+ gint new_width,
+ gint new_height,
+ gint new_offset_x,
+ gint new_offset_y,
GimpInterpolationType interp_type,
- GimpProgress *progress);
-static void gimp_selection_resize (GimpItem *item,
- GimpContext *context,
- gint new_width,
- gint new_height,
- gint off_x,
- gint off_y);
-static void gimp_selection_flip (GimpItem *item,
- GimpContext *context,
+ GimpProgress *progress);
+static void gimp_selection_resize (GimpItem *item,
+ GimpContext *context,
+ gint new_width,
+ gint new_height,
+ gint off_x,
+ gint off_y);
+static void gimp_selection_flip (GimpItem *item,
+ GimpContext *context,
GimpOrientationType flip_type,
- gdouble axis,
- gboolean clip_result);
-static void gimp_selection_rotate (GimpItem *item,
- GimpContext *context,
- GimpRotationType rotation_type,
- gdouble center_x,
- gdouble center_y,
- gboolean clip_result);
-static gboolean gimp_selection_stroke (GimpItem *item,
- GimpDrawable *drawable,
- GimpStrokeDesc *stroke_desc,
- GimpProgress *progress,
- GError **error);
-static void gimp_selection_invalidate_boundary (GimpDrawable *drawable);
-
-static gboolean gimp_selection_boundary (GimpChannel *channel,
- const BoundSeg **segs_in,
- const BoundSeg **segs_out,
- gint *num_segs_in,
- gint *num_segs_out,
- gint x1,
- gint y1,
- gint x2,
- gint y2);
-static gboolean gimp_selection_bounds (GimpChannel *channel,
- gint *x1,
- gint *y1,
- gint *x2,
- gint *y2);
-static gboolean gimp_selection_is_empty (GimpChannel *channel);
-static void gimp_selection_feather (GimpChannel *channel,
- gdouble radius_x,
- gdouble radius_y,
- gboolean push_undo);
-static void gimp_selection_sharpen (GimpChannel *channel,
- gboolean push_undo);
-static void gimp_selection_clear (GimpChannel *channel,
- const gchar *undo_desc,
- gboolean push_undo);
-static void gimp_selection_all (GimpChannel *channel,
- gboolean push_undo);
-static void gimp_selection_invert (GimpChannel *channel,
- gboolean push_undo);
-static void gimp_selection_border (GimpChannel *channel,
- gint radius_x,
- gint radius_y,
- gboolean feather,
- gboolean edge_lock,
- gboolean push_undo);
-static void gimp_selection_grow (GimpChannel *channel,
- gint radius_x,
- gint radius_y,
- gboolean push_undo);
-static void gimp_selection_shrink (GimpChannel *channel,
- gint radius_x,
- gint radius_y,
- gboolean edge_lock,
- gboolean push_undo);
+ gdouble axis,
+ gboolean clip_result);
+static void gimp_selection_rotate (GimpItem *item,
+ GimpContext *context,
+ GimpRotationType rotation_type,
+ gdouble center_x,
+ gdouble center_y,
+ gboolean clip_result);
+static gboolean gimp_selection_stroke (GimpItem *item,
+ GimpDrawable *drawable,
+ GimpStrokeOptions *stroke_options,
+ GimpProgress *progress,
+ GError **error);
+static void gimp_selection_invalidate_boundary (GimpDrawable *drawable);
+
+static gboolean gimp_selection_boundary (GimpChannel *channel,
+ const BoundSeg **segs_in,
+ const BoundSeg **segs_out,
+ gint *num_segs_in,
+ gint *num_segs_out,
+ gint x1,
+ gint y1,
+ gint x2,
+ gint y2);
+static gboolean gimp_selection_bounds (GimpChannel *channel,
+ gint *x1,
+ gint *y1,
+ gint *x2,
+ gint *y2);
+static gboolean gimp_selection_is_empty (GimpChannel *channel);
+static void gimp_selection_feather (GimpChannel *channel,
+ gdouble radius_x,
+ gdouble radius_y,
+ gboolean push_undo);
+static void gimp_selection_sharpen (GimpChannel *channel,
+ gboolean push_undo);
+static void gimp_selection_clear (GimpChannel *channel,
+ const gchar *undo_desc,
+ gboolean push_undo);
+static void gimp_selection_all (GimpChannel *channel,
+ gboolean push_undo);
+static void gimp_selection_invert (GimpChannel *channel,
+ gboolean push_undo);
+static void gimp_selection_border (GimpChannel *channel,
+ gint radius_x,
+ gint radius_y,
+ gboolean feather,
+ gboolean edge_lock,
+ gboolean push_undo);
+static void gimp_selection_grow (GimpChannel *channel,
+ gint radius_x,
+ gint radius_y,
+ gboolean push_undo);
+static void gimp_selection_shrink (GimpChannel *channel,
+ gint radius_x,
+ gint radius_y,
+ gboolean edge_lock,
+ gboolean push_undo);
G_DEFINE_TYPE (GimpSelection, gimp_selection, GIMP_TYPE_CHANNEL)
@@ -253,11 +253,11 @@
}
static gboolean
-gimp_selection_stroke (GimpItem *item,
- GimpDrawable *drawable,
- GimpStrokeDesc *stroke_desc,
- GimpProgress *progress,
- GError **error)
+gimp_selection_stroke (GimpItem *item,
+ GimpDrawable *drawable,
+ GimpStrokeOptions *stroke_options,
+ GimpProgress *progress,
+ GError **error)
{
GimpSelection *selection = GIMP_SELECTION (item);
const BoundSeg *dummy_in;
@@ -278,7 +278,8 @@
selection->stroking = TRUE;
- retval = GIMP_ITEM_CLASS (parent_class)->stroke (item, drawable, stroke_desc,
+ retval = GIMP_ITEM_CLASS (parent_class)->stroke (item, drawable,
+ stroke_options,
progress, error);
selection->stroking = FALSE;
Modified: trunk/app/core/gimpstrokeoptions.c
==============================================================================
--- trunk/app/core/gimpstrokeoptions.c (original)
+++ trunk/app/core/gimpstrokeoptions.c Fri Oct 24 07:37:46 2008
@@ -3,6 +3,7 @@
*
* gimpstrokeoptions.c
* Copyright (C) 2003 Simon Budig
+ * Copyright (C) 2004 Michael Natterer <mitch gimp org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -28,16 +29,26 @@
#include "core-types.h"
+#include "config/gimpcoreconfig.h"
+
+#include "gimp.h"
+#include "gimpcontext.h"
#include "gimpdashpattern.h"
#include "gimpmarshal.h"
+#include "gimppaintinfo.h"
#include "gimpstrokeoptions.h"
+#include "paint/gimppaintoptions.h"
+
#include "gimp-intl.h"
enum
{
PROP_0,
+
+ PROP_METHOD,
+
PROP_STYLE,
PROP_WIDTH,
PROP_UNIT,
@@ -47,7 +58,10 @@
PROP_ANTIALIAS,
PROP_DASH_UNIT,
PROP_DASH_OFFSET,
- PROP_DASH_INFO
+ PROP_DASH_INFO,
+
+ PROP_PAINT_OPTIONS,
+ PROP_EMULATE_DYNAMICS
};
enum
@@ -57,17 +71,28 @@
};
-static void gimp_stroke_options_set_property (GObject *object,
- guint property_id,
- const GValue *value,
- GParamSpec *pspec);
-static void gimp_stroke_options_get_property (GObject *object,
- guint property_id,
- GValue *value,
- GParamSpec *pspec);
+static void gimp_stroke_options_config_iface_init (gpointer iface,
+ gpointer iface_data);
+static void gimp_stroke_options_finalize (GObject *object);
+static void gimp_stroke_options_set_property (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec);
+static void gimp_stroke_options_get_property (GObject *object,
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec);
+
+static GimpConfig * gimp_stroke_options_duplicate (GimpConfig *config);
+
+
+G_DEFINE_TYPE_WITH_CODE (GimpStrokeOptions, gimp_stroke_options,
+ GIMP_TYPE_FILL_OPTIONS,
+ G_IMPLEMENT_INTERFACE (GIMP_TYPE_CONFIG,
+ gimp_stroke_options_config_iface_init))
-G_DEFINE_TYPE (GimpStrokeOptions, gimp_stroke_options, GIMP_TYPE_FILL_OPTIONS)
+#define parent_class gimp_stroke_options_parent_class
static guint stroke_options_signals[LAST_SIGNAL] = { 0 };
@@ -78,6 +103,7 @@
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GParamSpec *array_spec;
+ object_class->finalize = gimp_stroke_options_finalize;
object_class->set_property = gimp_stroke_options_set_property;
object_class->get_property = gimp_stroke_options_get_property;
@@ -93,22 +119,32 @@
G_TYPE_NONE, 1,
GIMP_TYPE_DASH_PRESET);
+ GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_METHOD,
+ "method", NULL,
+ GIMP_TYPE_STROKE_METHOD,
+ GIMP_STROKE_METHOD_LIBART,
+ GIMP_PARAM_STATIC_STRINGS);
+
GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_WIDTH,
"width", NULL,
0.0, 2000.0, 6.0,
GIMP_PARAM_STATIC_STRINGS);
+
GIMP_CONFIG_INSTALL_PROP_UNIT (object_class, PROP_UNIT,
"unit", NULL,
TRUE, FALSE, GIMP_UNIT_PIXEL,
GIMP_PARAM_STATIC_STRINGS);
+
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_CAP_STYLE,
"cap-style", NULL,
GIMP_TYPE_CAP_STYLE, GIMP_CAP_BUTT,
GIMP_PARAM_STATIC_STRINGS);
+
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_JOIN_STYLE,
"join-style", NULL,
GIMP_TYPE_JOIN_STYLE, GIMP_JOIN_MITER,
GIMP_PARAM_STATIC_STRINGS);
+
GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_MITER_LIMIT,
"miter-limit",
_("Convert a mitered join to a bevelled "
@@ -117,6 +153,7 @@
"line-width from the actual join point."),
0.0, 100.0, 10.0,
GIMP_PARAM_STATIC_STRINGS);
+
GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_DASH_OFFSET,
"dash-offset", NULL,
0.0, 2000.0, 0.0,
@@ -130,6 +167,25 @@
array_spec,
GIMP_PARAM_STATIC_STRINGS |
GIMP_CONFIG_PARAM_FLAGS));
+
+ GIMP_CONFIG_INSTALL_PROP_OBJECT (object_class, PROP_PAINT_OPTIONS,
+ "paint-options", NULL,
+ GIMP_TYPE_PAINT_OPTIONS,
+ GIMP_PARAM_STATIC_STRINGS);
+
+ GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_EMULATE_DYNAMICS,
+ "emulate-brush-dynamics", NULL,
+ FALSE,
+ GIMP_PARAM_STATIC_STRINGS);
+}
+
+static void
+gimp_stroke_options_config_iface_init (gpointer iface,
+ gpointer iface_data)
+{
+ GimpConfigInterface *config_iface = (GimpConfigInterface *) iface;
+
+ config_iface->duplicate = gimp_stroke_options_duplicate;
}
static void
@@ -138,6 +194,20 @@
}
static void
+gimp_stroke_options_finalize (GObject *object)
+{
+ GimpStrokeOptions *options = GIMP_STROKE_OPTIONS (object);
+
+ if (options->paint_options)
+ {
+ g_object_unref (options->paint_options);
+ options->paint_options = NULL;
+ }
+
+ G_OBJECT_CLASS (parent_class)->finalize (object);
+}
+
+static void
gimp_stroke_options_set_property (GObject *object,
guint property_id,
const GValue *value,
@@ -147,6 +217,10 @@
switch (property_id)
{
+ case PROP_METHOD:
+ options->method = g_value_get_enum (value);
+ break;
+
case PROP_WIDTH:
options->width = g_value_get_double (value);
break;
@@ -176,6 +250,15 @@
}
break;
+ case PROP_PAINT_OPTIONS:
+ if (options->paint_options)
+ g_object_unref (options->paint_options);
+ options->paint_options = g_value_dup_object (value);
+ break;
+ case PROP_EMULATE_DYNAMICS:
+ options->emulate_dynamics = g_value_get_boolean (value);
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
@@ -192,6 +275,10 @@
switch (property_id)
{
+ case PROP_METHOD:
+ g_value_set_enum (value, options->method);
+ break;
+
case PROP_WIDTH:
g_value_set_double (value, options->width);
break;
@@ -219,12 +306,75 @@
}
break;
+ case PROP_PAINT_OPTIONS:
+ g_value_set_object (value, options->paint_options);
+ break;
+ case PROP_EMULATE_DYNAMICS:
+ g_value_set_boolean (value, options->emulate_dynamics);
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
}
}
+static GimpConfig *
+gimp_stroke_options_duplicate (GimpConfig *config)
+{
+ GimpStrokeOptions *options = GIMP_STROKE_OPTIONS (config);
+ GimpStrokeOptions *new_options;
+
+ new_options = gimp_stroke_options_new (GIMP_CONTEXT (options)->gimp,
+ GIMP_CONTEXT (options));
+
+ if (options->paint_options)
+ {
+ GObject *paint_options;
+
+ paint_options = gimp_config_duplicate (GIMP_CONFIG (options->paint_options));
+ g_object_set (new_options, "paint-options", paint_options, NULL);
+ g_object_unref (paint_options);
+ }
+
+ return GIMP_CONFIG (new_options);
+}
+
+
+/* public functions */
+
+GimpStrokeOptions *
+gimp_stroke_options_new (Gimp *gimp,
+ GimpContext *context)
+{
+ GimpPaintInfo *paint_info = NULL;
+ GimpStrokeOptions *options;
+
+ g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
+ g_return_val_if_fail (context == NULL || GIMP_IS_CONTEXT (context), NULL);
+
+ if (context)
+ paint_info = gimp_context_get_paint_info (context);
+
+ if (! paint_info)
+ paint_info = gimp_paint_info_get_standard (gimp);
+
+ options = g_object_new (GIMP_TYPE_STROKE_OPTIONS,
+ "gimp", gimp,
+ "paint-info", paint_info,
+ NULL);
+
+ gimp_context_define_properties (GIMP_CONTEXT (options),
+ GIMP_CONTEXT_FOREGROUND_MASK |
+ GIMP_CONTEXT_PATTERN_MASK,
+ FALSE);
+
+ if (context)
+ gimp_context_set_parent (GIMP_CONTEXT (options), context);
+
+ return options;
+}
+
/**
* gimp_stroke_options_take_dash_pattern:
* @options: a #GimpStrokeOptions object
@@ -257,3 +407,79 @@
g_signal_emit (options, stroke_options_signals [DASH_INFO_CHANGED], 0,
preset);
}
+
+void
+gimp_stroke_options_prepare (GimpStrokeOptions *options,
+ GimpContext *context,
+ gboolean use_default_values)
+{
+ g_return_if_fail (GIMP_IS_STROKE_OPTIONS (options));
+ g_return_if_fail (GIMP_IS_CONTEXT (context));
+
+ switch (options->method)
+ {
+ case GIMP_STROKE_METHOD_LIBART:
+ break;
+
+ case GIMP_STROKE_METHOD_PAINT_CORE:
+ {
+ GimpPaintInfo *paint_info = GIMP_CONTEXT (options)->paint_info;
+ GimpPaintOptions *paint_options;
+
+ if (use_default_values)
+ {
+ paint_options = gimp_paint_options_new (paint_info);
+
+ /* undefine the paint-relevant context properties and get them
+ * from the passed context
+ */
+ gimp_context_define_properties (GIMP_CONTEXT (paint_options),
+ GIMP_CONTEXT_PAINT_PROPS_MASK,
+ FALSE);
+ gimp_context_set_parent (GIMP_CONTEXT (paint_options), context);
+ }
+ else
+ {
+ GimpCoreConfig *config = context->gimp->config;
+ GimpContextPropMask global_props = 0;
+
+ paint_options =
+ gimp_config_duplicate (GIMP_CONFIG (paint_info->paint_options));
+
+ /* FG and BG are always shared between all tools */
+ global_props |= GIMP_CONTEXT_FOREGROUND_MASK;
+ global_props |= GIMP_CONTEXT_BACKGROUND_MASK;
+
+ if (config->global_brush)
+ global_props |= GIMP_CONTEXT_BRUSH_MASK;
+ if (config->global_pattern)
+ global_props |= GIMP_CONTEXT_PATTERN_MASK;
+ if (config->global_palette)
+ global_props |= GIMP_CONTEXT_PALETTE_MASK;
+ if (config->global_gradient)
+ global_props |= GIMP_CONTEXT_GRADIENT_MASK;
+ if (config->global_font)
+ global_props |= GIMP_CONTEXT_FONT_MASK;
+
+ gimp_context_copy_properties (context,
+ GIMP_CONTEXT (paint_options),
+ global_props);
+ }
+
+ g_object_set (options, "paint-options", paint_options, NULL);
+ g_object_unref (paint_options);
+ }
+ break;
+
+ default:
+ g_return_if_reached ();
+ }
+}
+
+void
+gimp_stroke_options_finish (GimpStrokeOptions *options)
+{
+ g_return_if_fail (GIMP_IS_STROKE_OPTIONS (options));
+
+ g_object_set (options, "paint-options", NULL, NULL);
+}
Modified: trunk/app/core/gimpstrokeoptions.h
==============================================================================
--- trunk/app/core/gimpstrokeoptions.h (original)
+++ trunk/app/core/gimpstrokeoptions.h Fri Oct 24 07:37:46 2008
@@ -38,34 +38,48 @@
struct _GimpStrokeOptions
{
- GimpFillOptions parent_instance;
+ GimpFillOptions parent_instance;
- gdouble width;
- GimpUnit unit;
+ GimpStrokeMethod method;
- GimpCapStyle cap_style;
- GimpJoinStyle join_style;
+ /* options for medhod == LIBART */
+ gdouble width;
+ GimpUnit unit;
- gdouble miter_limit;
+ GimpCapStyle cap_style;
+ GimpJoinStyle join_style;
- gdouble dash_offset;
- GArray *dash_info;
+ gdouble miter_limit;
+
+ gdouble dash_offset;
+ GArray *dash_info;
+
+ /* options for method == PAINT_TOOL */
+ GimpPaintOptions *paint_options;
+ gboolean emulate_dynamics;
};
struct _GimpStrokeOptionsClass
{
- GimpFillOptionsClass parent_class;
+ GimpFillOptionsClass parent_class;
void (* dash_info_changed) (GimpStrokeOptions *stroke_options,
GimpDashPreset preset);
};
-GType gimp_stroke_options_get_type (void) G_GNUC_CONST;
+GType gimp_stroke_options_get_type (void) G_GNUC_CONST;
-void gimp_stroke_options_take_dash_pattern (GimpStrokeOptions *options,
- GimpDashPreset preset,
- GArray *pattern);
+GimpStrokeOptions * gimp_stroke_options_new (Gimp *gimp,
+ GimpContext *context);
+void gimp_stroke_options_take_dash_pattern (GimpStrokeOptions *options,
+ GimpDashPreset preset,
+ GArray *pattern);
+
+void gimp_stroke_options_prepare (GimpStrokeOptions *options,
+ GimpContext *context,
+ gboolean use_default_values);
+void gimp_stroke_options_finish (GimpStrokeOptions *options);
#endif /* __GIMP_STROKE_OPTIONS_H__ */
Modified: trunk/app/dialogs/stroke-dialog.c
==============================================================================
--- trunk/app/dialogs/stroke-dialog.c (original)
+++ trunk/app/dialogs/stroke-dialog.c Fri Oct 24 07:37:46 2008
@@ -32,7 +32,6 @@
#include "core/gimpdrawable.h"
#include "core/gimpimage.h"
#include "core/gimppaintinfo.h"
-#include "core/gimpstrokedesc.h"
#include "core/gimpstrokeoptions.h"
#include "core/gimptoolinfo.h"
@@ -57,7 +56,7 @@
static void stroke_dialog_paint_info_selected (GimpContainerView *view,
GimpViewable *viewable,
gpointer insert_data,
- GimpStrokeDesc *desc);
+ GimpStrokeOptions *options);
/* public function */
@@ -70,16 +69,16 @@
const gchar *help_id,
GtkWidget *parent)
{
- GimpStrokeDesc *desc;
- GimpStrokeDesc *saved_desc;
- GimpImage *image;
- GtkWidget *dialog;
- GtkWidget *main_vbox;
- GtkWidget *radio_box;
- GtkWidget *libart_radio;
- GtkWidget *paint_radio;
- GSList *group;
- GtkWidget *frame;
+ GimpStrokeOptions *options;
+ GimpStrokeOptions *saved_options;
+ GimpImage *image;
+ GtkWidget *dialog;
+ GtkWidget *main_vbox;
+ GtkWidget *radio_box;
+ GtkWidget *libart_radio;
+ GtkWidget *paint_radio;
+ GSList *group;
+ GtkWidget *frame;
g_return_val_if_fail (GIMP_IS_ITEM (item), NULL);
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
@@ -89,13 +88,13 @@
image = gimp_item_get_image (item);
- desc = gimp_stroke_desc_new (context->gimp, context);
+ options = gimp_stroke_options_new (context->gimp, context);
- saved_desc = g_object_get_data (G_OBJECT (context->gimp),
- "saved-stroke-desc");
+ saved_options = g_object_get_data (G_OBJECT (context->gimp),
+ "saved-stroke-options");
- if (saved_desc)
- gimp_config_sync (G_OBJECT (saved_desc), G_OBJECT (desc), 0);
+ if (saved_options)
+ gimp_config_sync (G_OBJECT (saved_options), G_OBJECT (options), 0);
dialog = gimp_viewable_dialog_new (GIMP_VIEWABLE (item), context,
title, "gimp-stroke-options",
@@ -124,7 +123,7 @@
dialog);
g_object_set_data (G_OBJECT (dialog), "gimp-item", item);
- g_object_set_data_full (G_OBJECT (dialog), "gimp-stroke-desc", desc,
+ g_object_set_data_full (G_OBJECT (dialog), "gimp-stroke-options", options,
(GDestroyNotify) g_object_unref);
main_vbox = gtk_vbox_new (FALSE, 12);
@@ -132,7 +131,8 @@
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), main_vbox);
gtk_widget_show (main_vbox);
- radio_box = gimp_prop_enum_radio_box_new (G_OBJECT (desc), "method", -1, -1);
+ radio_box = gimp_prop_enum_radio_box_new (G_OBJECT (options), "method",
+ -1, -1);
group = gtk_radio_button_get_group (g_object_get_data (G_OBJECT (radio_box),
"radio-button"));
@@ -181,12 +181,12 @@
gimp_image_get_resolution (image, &xres, &yres);
- stroke_editor = gimp_stroke_editor_new (desc->stroke_options, yres);
+ stroke_editor = gimp_stroke_editor_new (options, yres);
gtk_container_add (GTK_CONTAINER (frame), stroke_editor);
gtk_widget_show (stroke_editor);
gtk_widget_set_sensitive (stroke_editor,
- desc->method == GIMP_STROKE_METHOD_LIBART);
+ options->method == GIMP_STROKE_METHOD_LIBART);
g_object_set_data (G_OBJECT (libart_radio), "set_sensitive", stroke_editor);
}
@@ -216,7 +216,7 @@
gtk_widget_show (vbox);
gtk_widget_set_sensitive (vbox,
- desc->method == GIMP_STROKE_METHOD_PAINT_CORE);
+ options->method == GIMP_STROKE_METHOD_PAINT_CORE);
g_object_set_data (G_OBJECT (paint_radio), "set_sensitive", vbox);
hbox = gtk_hbox_new (FALSE, 6);
@@ -231,18 +231,17 @@
context,
16, 0);
gimp_container_view_select_item (GIMP_CONTAINER_VIEW (combo),
- GIMP_VIEWABLE (desc->paint_info));
+ GIMP_VIEWABLE (GIMP_CONTEXT (options)->paint_info));
gtk_box_pack_start (GTK_BOX (hbox), combo, TRUE, TRUE, 0);
gtk_widget_show (combo);
g_signal_connect (combo, "select-item",
G_CALLBACK (stroke_dialog_paint_info_selected),
- desc);
-
+ options);
g_object_set_data (G_OBJECT (dialog), "gimp-tool-menu", combo);
- button = gimp_prop_check_button_new (G_OBJECT (desc),
+ button = gimp_prop_check_button_new (G_OBJECT (options),
"emulate-brush-dynamics",
_("_Emulate brush dynamics"));
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
@@ -260,13 +259,13 @@
gint response_id,
GtkWidget *dialog)
{
- GimpStrokeDesc *desc;
- GimpItem *item;
- GimpImage *image;
- GimpContext *context;
+ GimpStrokeOptions *options;
+ GimpItem *item;
+ GimpImage *image;
+ GimpContext *context;
item = g_object_get_data (G_OBJECT (dialog), "gimp-item");
- desc = g_object_get_data (G_OBJECT (dialog), "gimp-stroke-desc");
+ options = g_object_get_data (G_OBJECT (dialog), "gimp-stroke-options");
image = gimp_item_get_image (item);
context = GIMP_VIEWABLE_DIALOG (dialog)->context;
@@ -279,7 +278,7 @@
GtkWidget *combo = g_object_get_data (G_OBJECT (dialog),
"gimp-tool-menu");;
- gimp_config_reset (GIMP_CONFIG (desc));
+ gimp_config_reset (GIMP_CONFIG (options));
gimp_container_view_select_item (GIMP_CONTAINER_VIEW (combo),
GIMP_VIEWABLE (tool_info->paint_info));
@@ -289,9 +288,9 @@
case GTK_RESPONSE_OK:
{
- GimpDrawable *drawable = gimp_image_get_active_drawable (image);
- GimpStrokeDesc *saved_desc;
- GError *error = NULL;
+ GimpDrawable *drawable = gimp_image_get_active_drawable (image);
+ GimpStrokeOptions *saved_options;
+ GError *error = NULL;
if (! drawable)
{
@@ -302,21 +301,21 @@
return;
}
- saved_desc = g_object_get_data (G_OBJECT (context->gimp),
- "saved-stroke-desc");
+ saved_options = g_object_get_data (G_OBJECT (context->gimp),
+ "saved-stroke-options");
- if (saved_desc)
- g_object_ref (saved_desc);
+ if (saved_options)
+ g_object_ref (saved_options);
else
- saved_desc = gimp_stroke_desc_new (context->gimp, context);
+ saved_options = gimp_stroke_options_new (context->gimp, context);
- gimp_config_sync (G_OBJECT (desc), G_OBJECT (saved_desc), 0);
+ gimp_config_sync (G_OBJECT (options), G_OBJECT (saved_options), 0);
- g_object_set_data_full (G_OBJECT (context->gimp), "saved-stroke-desc",
- saved_desc,
+ g_object_set_data_full (G_OBJECT (context->gimp), "saved-stroke-options",
+ saved_options,
(GDestroyNotify) g_object_unref);
- if (! gimp_item_stroke (item, drawable, context, desc, FALSE, NULL,
+ if (! gimp_item_stroke (item, drawable, context, options, FALSE, NULL,
&error))
{
gimp_message (context->gimp, G_OBJECT (widget),
@@ -340,7 +339,7 @@
stroke_dialog_paint_info_selected (GimpContainerView *view,
GimpViewable *viewable,
gpointer insert_data,
- GimpStrokeDesc *desc)
+ GimpStrokeOptions *options)
{
- g_object_set (desc, "paint-info", viewable, NULL);
+ g_object_set (options, "paint-info", viewable, NULL);
}
Modified: trunk/app/pdb/edit-cmds.c
==============================================================================
--- trunk/app/pdb/edit-cmds.c (original)
+++ trunk/app/pdb/edit-cmds.c Fri Oct 24 07:37:46 2008
@@ -36,7 +36,7 @@
#include "core/gimplayer.h"
#include "core/gimpparamspecs.h"
#include "core/gimpprogress.h"
-#include "core/gimpstrokedesc.h"
+#include "core/gimpstrokeoptions.h"
#include "vectors/gimpvectors.h"
#include "gimppdb.h"
@@ -746,16 +746,18 @@
{
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error))
{
- GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
- GimpStrokeDesc *desc = gimp_stroke_desc_new (gimp, context);
+ GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
+ GimpStrokeOptions *options = gimp_stroke_options_new (gimp, context);
- g_object_set (desc, "method", GIMP_STROKE_METHOD_PAINT_CORE, NULL);
+ g_object_set (options,
+ "method", GIMP_STROKE_METHOD_PAINT_CORE,
+ NULL);
success = gimp_item_stroke (GIMP_ITEM (gimp_image_get_mask (image)),
- drawable, context, desc, TRUE, progress,
+ drawable, context, options, TRUE, progress,
error);
- g_object_unref (desc);
+ g_object_unref (options);
}
else
success = FALSE;
@@ -785,15 +787,17 @@
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error) &&
gimp_pdb_item_is_attached (GIMP_ITEM (vectors), error))
{
- GimpStrokeDesc *desc = gimp_stroke_desc_new (gimp, context);
+ GimpStrokeOptions *options = gimp_stroke_options_new (gimp, context);
- g_object_set (desc, "method", GIMP_STROKE_METHOD_PAINT_CORE, NULL);
+ g_object_set (options,
+ "method", GIMP_STROKE_METHOD_PAINT_CORE,
+ NULL);
success = gimp_item_stroke (GIMP_ITEM (vectors),
- drawable, context, desc, TRUE, progress,
+ drawable, context, options, TRUE, progress,
error);
- g_object_unref (desc);
+ g_object_unref (options);
}
else
success = FALSE;
Modified: trunk/app/pdb/paths-cmds.c
==============================================================================
--- trunk/app/pdb/paths-cmds.c (original)
+++ trunk/app/pdb/paths-cmds.c Fri Oct 24 07:37:46 2008
@@ -32,7 +32,7 @@
#include "core/gimpimage.h"
#include "core/gimplist.h"
#include "core/gimpparamspecs.h"
-#include "core/gimpstrokedesc.h"
+#include "core/gimpstrokeoptions.h"
#include "vectors/gimpanchor.h"
#include "vectors/gimpbezierstroke.h"
#include "vectors/gimpvectors-compat.h"
@@ -333,15 +333,17 @@
if (vectors && drawable)
{
- GimpStrokeDesc *desc = gimp_stroke_desc_new (gimp, context);
+ GimpStrokeOptions *options = gimp_stroke_options_new (gimp, context);
- g_object_set (desc, "method", GIMP_STROKE_METHOD_PAINT_CORE, NULL);
+ g_object_set (options,
+ "method", GIMP_STROKE_METHOD_PAINT_CORE,
+ NULL);
success = gimp_item_stroke (GIMP_ITEM (vectors),
- drawable, context, desc, TRUE, progress,
+ drawable, context, options, TRUE, progress,
error);
- g_object_unref (desc);
+ g_object_unref (options);
}
else
success = FALSE;
Modified: trunk/app/vectors/gimpvectors.c
==============================================================================
--- trunk/app/vectors/gimpvectors.c (original)
+++ trunk/app/vectors/gimpvectors.c Fri Oct 24 07:37:46 2008
@@ -38,7 +38,7 @@
#include "core/gimpimage-undo-push.h"
#include "core/gimpmarshal.h"
#include "core/gimppaintinfo.h"
-#include "core/gimpstrokedesc.h"
+#include "core/gimpstrokeoptions.h"
#include "paint/gimppaintcore-stroke.h"
#include "paint/gimppaintoptions.h"
@@ -59,57 +59,57 @@
};
-static void gimp_vectors_finalize (GObject *object);
+static void gimp_vectors_finalize (GObject *object);
-static gint64 gimp_vectors_get_memsize (GimpObject *object,
- gint64 *gui_size);
+static gint64 gimp_vectors_get_memsize (GimpObject *object,
+ gint64 *gui_size);
-static gboolean gimp_vectors_is_attached (GimpItem *item);
-static GimpItem * gimp_vectors_duplicate (GimpItem *item,
- GType new_type);
-static void gimp_vectors_convert (GimpItem *item,
- GimpImage *dest_image);
-static void gimp_vectors_translate (GimpItem *item,
- gint offset_x,
- gint offset_y,
- gboolean push_undo);
-static void gimp_vectors_scale (GimpItem *item,
- gint new_width,
- gint new_height,
- gint new_offset_x,
- gint new_offset_y,
+static gboolean gimp_vectors_is_attached (GimpItem *item);
+static GimpItem * gimp_vectors_duplicate (GimpItem *item,
+ GType new_type);
+static void gimp_vectors_convert (GimpItem *item,
+ GimpImage *dest_image);
+static void gimp_vectors_translate (GimpItem *item,
+ gint offset_x,
+ gint offset_y,
+ gboolean push_undo);
+static void gimp_vectors_scale (GimpItem *item,
+ gint new_width,
+ gint new_height,
+ gint new_offset_x,
+ gint new_offset_y,
GimpInterpolationType interp_type,
- GimpProgress *progress);
-static void gimp_vectors_resize (GimpItem *item,
- GimpContext *context,
- gint new_width,
- gint new_height,
- gint offset_x,
- gint offset_y);
-static void gimp_vectors_flip (GimpItem *item,
- GimpContext *context,
+ GimpProgress *progress);
+static void gimp_vectors_resize (GimpItem *item,
+ GimpContext *context,
+ gint new_width,
+ gint new_height,
+ gint offset_x,
+ gint offset_y);
+static void gimp_vectors_flip (GimpItem *item,
+ GimpContext *context,
GimpOrientationType flip_type,
- gdouble axis,
- gboolean clip_result);
-static void gimp_vectors_rotate (GimpItem *item,
- GimpContext *context,
- GimpRotationType rotate_type,
- gdouble center_x,
- gdouble center_y,
- gboolean clip_result);
-static void gimp_vectors_transform (GimpItem *item,
- GimpContext *context,
+ gdouble axis,
+ gboolean clip_result);
+static void gimp_vectors_rotate (GimpItem *item,
+ GimpContext *context,
+ GimpRotationType rotate_type,
+ gdouble center_x,
+ gdouble center_y,
+ gboolean clip_result);
+static void gimp_vectors_transform (GimpItem *item,
+ GimpContext *context,
const GimpMatrix3 *matrix,
GimpTransformDirection direction,
GimpInterpolationType interp_type,
- gint recursion_level,
+ gint recursion_level,
GimpTransformResize clip_result,
- GimpProgress *progress);
-static gboolean gimp_vectors_stroke (GimpItem *item,
- GimpDrawable *drawable,
- GimpStrokeDesc *stroke_desc,
- GimpProgress *progress,
- GError **error);
+ GimpProgress *progress);
+static gboolean gimp_vectors_stroke (GimpItem *item,
+ GimpDrawable *drawable,
+ GimpStrokeOptions *stroke_options,
+ GimpProgress *progress,
+ GError **error);
static void gimp_vectors_real_thaw (GimpVectors *vectors);
static void gimp_vectors_real_stroke_add (GimpVectors *vectors,
@@ -492,11 +492,11 @@
}
static gboolean
-gimp_vectors_stroke (GimpItem *item,
- GimpDrawable *drawable,
- GimpStrokeDesc *stroke_desc,
- GimpProgress *progress,
- GError **error)
+gimp_vectors_stroke (GimpItem *item,
+ GimpDrawable *drawable,
+ GimpStrokeOptions *stroke_options,
+ GimpProgress *progress,
+ GError **error)
{
GimpVectors *vectors = GIMP_VECTORS (item);
gboolean retval = FALSE;
@@ -505,24 +505,27 @@
if (! vectors->strokes)
return TRUE;
- switch (stroke_desc->method)
+ switch (stroke_options->method)
{
case GIMP_STROKE_METHOD_LIBART:
gimp_drawable_stroke_vectors (drawable,
- stroke_desc->stroke_options,
+ stroke_options,
vectors);
retval = TRUE;
break;
case GIMP_STROKE_METHOD_PAINT_CORE:
{
+ GimpPaintInfo *paint_info;
GimpPaintCore *core;
- core = g_object_new (stroke_desc->paint_info->paint_type, NULL);
+ paint_info = gimp_context_get_paint_info (GIMP_CONTEXT (stroke_options));
+
+ core = g_object_new (paint_info->paint_type, NULL);
retval = gimp_paint_core_stroke_vectors (core, drawable,
- stroke_desc->paint_options,
- stroke_desc->emulate_dynamics,
+ stroke_options->paint_options,
+ stroke_options->emulate_dynamics,
vectors, 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 Fri Oct 24 07:37:46 2008
@@ -827,21 +827,23 @@
);
%invoke = (
- headers => [ qw("core/gimpstrokedesc.h") ],
+ headers => [ qw("core/gimpstrokeoptions.h") ],
code => <<'CODE'
{
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error))
{
- GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
- GimpStrokeDesc *desc = gimp_stroke_desc_new (gimp, context);
+ GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
+ GimpStrokeOptions *options = gimp_stroke_options_new (gimp, context);
- g_object_set (desc, "method", GIMP_STROKE_METHOD_PAINT_CORE, NULL);
+ g_object_set (options,
+ "method", GIMP_STROKE_METHOD_PAINT_CORE,
+ NULL);
success = gimp_item_stroke (GIMP_ITEM (gimp_image_get_mask (image)),
- drawable, context, desc, TRUE, progress,
+ drawable, context, options, TRUE, progress,
error);
- g_object_unref (desc);
+ g_object_unref (options);
}
else
success = FALSE;
@@ -868,21 +870,23 @@
);
%invoke = (
- headers => [ qw("core/gimpstrokedesc.h") ],
+ headers => [ qw("core/gimpstrokeoptions.h") ],
code => <<'CODE'
{
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), error) &&
gimp_pdb_item_is_attached (GIMP_ITEM (vectors), error))
{
- GimpStrokeDesc *desc = gimp_stroke_desc_new (gimp, context);
+ GimpStrokeOptions *options = gimp_stroke_options_new (gimp, context);
- g_object_set (desc, "method", GIMP_STROKE_METHOD_PAINT_CORE, NULL);
+ g_object_set (options,
+ "method", GIMP_STROKE_METHOD_PAINT_CORE,
+ NULL);
success = gimp_item_stroke (GIMP_ITEM (vectors),
- drawable, context, desc, TRUE, progress,
+ drawable, context, options, TRUE, progress,
error);
- g_object_unref (desc);
+ g_object_unref (options);
}
else
success = FALSE;
Modified: trunk/tools/pdbgen/pdb/paths.pdb
==============================================================================
--- trunk/tools/pdbgen/pdb/paths.pdb (original)
+++ trunk/tools/pdbgen/pdb/paths.pdb Fri Oct 24 07:37:46 2008
@@ -260,7 +260,7 @@
);
%invoke = (
- headers => [ qw("core/gimpstrokedesc.h") ],
+ headers => [ qw("core/gimpstrokeoptions.h") ],
code => <<'CODE'
{
GimpVectors *vectors = gimp_image_get_active_vectors (image);
@@ -268,15 +268,17 @@
if (vectors && drawable)
{
- GimpStrokeDesc *desc = gimp_stroke_desc_new (gimp, context);
+ GimpStrokeOptions *options = gimp_stroke_options_new (gimp, context);
- g_object_set (desc, "method", GIMP_STROKE_METHOD_PAINT_CORE, NULL);
+ g_object_set (options,
+ "method", GIMP_STROKE_METHOD_PAINT_CORE,
+ NULL);
success = gimp_item_stroke (GIMP_ITEM (vectors),
- drawable, context, desc, TRUE, progress,
+ drawable, context, options, TRUE, progress,
error);
- g_object_unref (desc);
+ g_object_unref (options);
}
else
success = FALSE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]