Commit 0de5d32f authored by Simon Budig's avatar Simon Budig Committed by Simon Budig

added gimp_edit_stroke_vectors () deprecated gimp_path_stroke_current ()

2006-10-26  Simon Budig  <simon@gimp.org>

	* tools/pdbgen/pdb/edit.pdb: added gimp_edit_stroke_vectors ()
	* tools/pdbgen/pdb/paths.pdb: deprecated gimp_path_stroke_current ()

	* libgimp/gimp.def: updated.

	* app/pdb/edit_cmds.c
	* app/pdb/internal_procs.c
	* app/pdb/paths_cmds.c
	* devel-docs/libgimp/tmpl/gimppaths.sgml
	* libgimp/gimpedit_pdb.[ch]
	* libgimp/gimppaths_pdb.[ch]: regenerated.
parent dd6f5d71
2006-10-26 Simon Budig <simon@gimp.org>
* tools/pdbgen/pdb/edit.pdb: added gimp_edit_stroke_vectors ()
* tools/pdbgen/pdb/paths.pdb: deprecated gimp_path_stroke_current ()
* libgimp/gimp.def: updated.
* app/pdb/edit_cmds.c
* app/pdb/internal_procs.c
* app/pdb/paths_cmds.c
* devel-docs/libgimp/tmpl/gimppaths.sgml
* libgimp/gimpedit_pdb.[ch]
* libgimp/gimppaths_pdb.[ch]: regenerated.
2006-10-26 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage.[ch]
......
......@@ -41,6 +41,7 @@
#include "core/gimpprogress.h"
#include "core/gimpstrokedesc.h"
#include "gimp-intl.h"
#include "vectors/gimpvectors.h"
static GValueArray *
......@@ -683,6 +684,40 @@ edit_stroke_invoker (GimpProcedure *procedure,
return gimp_procedure_get_return_values (procedure, success);
}
static GValueArray *
edit_stroke_vectors_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GValueArray *args)
{
gboolean success = TRUE;
GimpDrawable *drawable;
GimpVectors *vectors;
drawable = gimp_value_get_drawable (&args->values[0], gimp);
vectors = gimp_value_get_vectors (&args->values[1], gimp);
if (success)
{
if (gimp_item_is_attached (GIMP_ITEM (drawable)))
{
GimpStrokeDesc *desc = gimp_stroke_desc_new (gimp, context);
g_object_set (desc, "method", GIMP_STROKE_METHOD_PAINT_CORE, NULL);
success = gimp_item_stroke (GIMP_ITEM (vectors),
drawable, context, desc, TRUE);
g_object_unref (desc);
}
else
success = FALSE;
}
return gimp_procedure_get_return_values (procedure, success);
}
void
register_edit_procs (GimpPDB *pdb)
{
......@@ -1339,4 +1374,32 @@ register_edit_procs (GimpPDB *pdb)
GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-edit-stroke-vectors
*/
procedure = gimp_procedure_new (edit_stroke_vectors_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-edit-stroke-vectors");
gimp_procedure_set_static_strings (procedure,
"gimp-edit-stroke-vectors",
"Stroke the specified vectors object",
"This procedure strokes the specified vectors object, painting along the path with the active brush and foreground color.",
"Simon Budig",
"Simon Budig",
"2006",
NULL);
gimp_procedure_add_argument (procedure,
gimp_param_spec_drawable_id ("drawable",
"drawable",
"The drawable to stroke to",
pdb->gimp, FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_vectors_id ("vectors",
"vectors",
"The vectors object",
pdb->gimp, FALSE,
GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
}
......@@ -75,7 +75,7 @@ void register_undo_procs (GimpPDB *pdb);
void register_unit_procs (GimpPDB *pdb);
void register_vectors_procs (GimpPDB *pdb);
/* 535 procedures registered total */
/* 536 procedures registered total */
void
internal_procs_init (GimpPDB *pdb)
......
......@@ -877,12 +877,12 @@ register_paths_procs (GimpPDB *pdb)
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-path-stroke-current");
gimp_procedure_set_static_strings (procedure,
"gimp-path-stroke-current",
"Stroke the current path in the passed image.",
"Stroke the current path in the passed image.",
"Andy Thomas",
"Andy Thomas",
"1999",
NULL);
"This procedure is deprecated! Use 'gimp-edit-stroke-vectors' instead.",
"This procedure is deprecated! Use 'gimp-edit-stroke-vectors' instead.",
"",
"",
"",
"gimp-edit-stroke-vectors");
gimp_procedure_add_argument (procedure,
gimp_param_spec_image_id ("image",
"image",
......
......@@ -182,16 +182,3 @@ Operations related to paths.
@Returns:
<!-- ##### FUNCTION gimp_path_import_string ##### -->
<para>
</para>
@image_ID:
@string:
@length:
@merge:
@scale:
@Returns:
......@@ -191,6 +191,7 @@ EXPORTS
gimp_edit_paste
gimp_edit_paste_as_new
gimp_edit_stroke
gimp_edit_stroke_vectors
gimp_ellipse_select
gimp_enums_get_type_names
gimp_enums_init
......
......@@ -710,3 +710,38 @@ gimp_edit_stroke (gint32 drawable_ID)
return success;
}
/**
* gimp_edit_stroke_vectors:
* @drawable_ID: The drawable to stroke to.
* @vectors_ID: The vectors object.
*
* Stroke the specified vectors object
*
* This procedure strokes the specified vectors object, painting along
* the path with the active brush and foreground color.
*
* Returns: TRUE on success.
*
* Since: GIMP 2.4
*/
gboolean
gimp_edit_stroke_vectors (gint32 drawable_ID,
gint32 vectors_ID)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp-edit-stroke-vectors",
&nreturn_vals,
GIMP_PDB_DRAWABLE, drawable_ID,
GIMP_PDB_VECTORS, vectors_ID,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
......@@ -83,6 +83,8 @@ gboolean gimp_edit_blend (gint32 drawable_ID,
gdouble x2,
gdouble y2);
gboolean gimp_edit_stroke (gint32 drawable_ID);
gboolean gimp_edit_stroke_vectors (gint32 drawable_ID,
gint32 vectors_ID);
G_END_DECLS
......
......@@ -249,9 +249,8 @@ gimp_path_set_points (gint32 image_ID,
* gimp_path_stroke_current:
* @image_ID: The image which contains the path to stroke.
*
* Stroke the current path in the passed image.
*
* Stroke the current path in the passed image.
* This procedure is deprecated! Use gimp_edit_stroke_vectors()
* instead.
*
* Returns: TRUE on success.
*/
......
......@@ -48,8 +48,8 @@ gboolean gimp_path_set_points (gint32 image_ID,
gint ptype,
gint num_path_points,
const gdouble *points_pairs);
gboolean gimp_path_stroke_current (gint32 image_ID);
#ifndef GIMP_DISABLE_DEPRECATED
gboolean gimp_path_stroke_current (gint32 image_ID);
gint gimp_path_get_point_at_dist (gint32 image_ID,
gdouble distance,
gint *y_point,
......
......@@ -804,6 +804,45 @@ CODE
);
}
sub edit_stroke_vectors {
$blurb = 'Stroke the specified vectors object';
$help = <<'HELP';
This procedure strokes the specified vectors object, painting along the
path with the active brush and foreground color.
HELP
&simon_pdb_misc('2006', '2.4');
@inargs = (
{ name => 'drawable', type => 'drawable',
desc => 'The drawable to stroke to' },
{ name => 'vectors', type => 'vectors',
desc => 'The vectors object' }
);
%invoke = (
headers => [ qw("core/gimpstrokedesc.h") ],
code => <<'CODE'
{
if (gimp_item_is_attached (GIMP_ITEM (drawable)))
{
GimpStrokeDesc *desc = gimp_stroke_desc_new (gimp, context);
g_object_set (desc, "method", GIMP_STROKE_METHOD_PAINT_CORE, NULL);
success = gimp_item_stroke (GIMP_ITEM (vectors),
drawable, context, desc, TRUE);
g_object_unref (desc);
}
else
success = FALSE;
}
CODE
);
}
@headers = qw(<string.h>
"core/gimp.h"
......@@ -818,7 +857,7 @@ CODE
edit_named_cut edit_named_copy edit_named_copy_visible
edit_named_paste edit_named_paste_as_new
edit_clear edit_fill edit_bucket_fill edit_bucket_fill_full
edit_blend edit_stroke);
edit_blend edit_stroke edit_stroke_vectors);
%exports = (app => [@procs], lib => [@procs]);
......
......@@ -255,10 +255,7 @@ CODE
}
sub path_stroke_current {
$blurb = 'Stroke the current path in the passed image.';
$help = 'Stroke the current path in the passed image.';
&andy_pdb_misc('1999');
&std_pdb_deprecated('gimp-edit-stroke-vectors');
@inargs = (
{ name => 'image', type => 'image',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment