2006-12-10 05:33:38 +08:00
/* GIMP - The GNU Image Manipulation Program
2003-07-03 08:47:26 +08:00
* Copyright ( C ) 1995 - 2003 Spencer Kimball and Peter Mattis
1999-03-22 08:51:30 +08:00
*
* 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
* the Free Software Foundation ; either version 2 of the License , or
* ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
* along with this program ; if not , write to the Free Software
* Foundation , Inc . , 59 Temple Place - Suite 330 , Boston , MA 02111 - 1307 , USA .
*/
2007-01-09 18:52:47 +08:00
/* NOTE: This file is auto-generated by pdbgen.pl. */
1999-03-22 08:51:30 +08:00
2000-12-29 23:22:01 +08:00
# include "config.h"
1999-03-22 08:51:30 +08:00
Win32 portability changes:
* config.h.win32, README.win32: Small changes.
* tools/pdbgen/pdb/*.pdb: Include <string.h>.
* app/*_cmds.c: Autogenerated files reflect above changes.
* libgimp/makefile.msc app/makefile.msc: Various updates,
including new object files. Gtk+ directory now should be called
gtk+ (not gtk-plus). Use win32-specific gdk subdir. Glib directory
now should be called just glib.
* libgimp/gimp.def: Updates.
* libgimp/gimpfeatures.h.win32: Made current with
gimpfeatures.h.in.
* libgimp/gimpfileselection.c: Define S_ISDIR and S_ISREG if
necessary.
* tools/pdbgen/pdb/fileops.pdb: Must have a
statement (even an empty one) after a label.
* app/fileops_cmds.c: Autogenerated file reflects above changes.
* app/crop.c: Include <string.h>.
* app/{app_procs,batch,fileops,datafiles,errorconsole,general,
plug_in,temp_buf,tile_swap}.c: Test NATIVE_WIN32, not
_MSC_VER. (NATIVE_WIN32 means we are using the Microsoft C
runtime, even if we might be compiling with gcc.)
* app/fileops.c: Don't include <process.h> here.
* app/fileops.h: Do include <process.h> here.
* app/gimpparasite.c: Include config.h, guard inclusion of
<unistd.h>. (Is the inclusion of unistd.h in source files all over
the place really necessary?)
* app/ink.c: MSC doesn't handle conversion from unsigned __int64
to double, so cast to signed.
* app/lut_funcs.c: Include config.h, and define rint() if necessary.
* app/pixel_processor.c: Include config.h without "..", like in
all the other places. Include <string.h>
* app/text_tool.c: Guard the "POINTS" identifier that clashes with
<windows.h>, sigh.
1999-05-05 05:32:17 +08:00
# include <string.h>
2008-10-10 04:24:04 +08:00
# include <gegl.h>
2000-12-29 23:22:01 +08:00
2007-03-09 21:00:01 +08:00
# include "libgimpmath/gimpmath.h"
2001-08-17 22:27:31 +08:00
# include "pdb-types.h"
2000-12-29 23:22:01 +08:00
2003-10-06 20:17:11 +08:00
# include "core/gimpchannel-select.h"
2001-05-09 10:32:03 +08:00
# include "core/gimpimage.h"
2003-05-16 05:15:00 +08:00
# include "core/gimplist.h"
2008-02-08 01:08:54 +08:00
# include "core/gimpparamspecs.h"
2004-10-22 20:32:31 +08:00
# include "core/gimpstrokedesc.h"
2003-05-16 05:15:00 +08:00
# include "vectors/gimpanchor.h"
# include "vectors/gimpbezierstroke.h"
2003-05-23 03:02:38 +08:00
# include "vectors/gimpvectors-compat.h"
2003-09-22 01:29:12 +08:00
# include "vectors/gimpvectors-import.h"
2003-05-16 05:15:00 +08:00
# include "vectors/gimpvectors.h"
1999-03-22 08:51:30 +08:00
2008-02-08 01:08:54 +08:00
# include "gimppdb.h"
# include "gimpprocedure.h"
2008-04-04 19:15:55 +08:00
# include "internal-procs.h"
2006-11-01 03:02:56 +08:00
2008-02-08 01:08:54 +08:00
# include "gimp-intl.h"
1999-03-22 08:51:30 +08:00
2006-04-04 18:30:58 +08:00
static GValueArray *
2007-12-03 02:05:54 +08:00
path_list_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GValueArray * args ,
GError * * error )
1999-03-22 08:51:30 +08:00
{
1999-03-28 14:55:29 +08:00
gboolean success = TRUE ;
2006-04-04 18:30:58 +08:00
GValueArray * return_vals ;
2006-03-24 05:17:16 +08:00
GimpImage * image ;
2006-03-15 23:32:39 +08:00
gint32 num_paths = 0 ;
2003-09-05 01:57:27 +08:00
gchar * * path_list = NULL ;
1999-03-22 08:51:30 +08:00
2006-04-04 18:30:58 +08:00
image = gimp_value_get_image ( & args - > values [ 0 ] , gimp ) ;
1999-03-22 08:51:30 +08:00
if ( success )
2006-03-22 17:58:08 +08:00
{
2006-03-24 05:17:16 +08:00
path_list = gimp_container_get_name_array ( image - > vectors , & num_paths ) ;
2006-03-22 17:58:08 +08:00
}
1999-03-22 08:51:30 +08:00
2008-08-16 21:57:57 +08:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
1999-03-28 14:55:29 +08:00
if ( success )
{
2006-04-04 18:30:58 +08:00
g_value_set_int ( & return_vals - > values [ 1 ] , num_paths ) ;
gimp_value_take_stringarray ( & return_vals - > values [ 2 ] , path_list , num_paths ) ;
1999-03-28 14:55:29 +08:00
}
2006-03-28 05:09:32 +08:00
return return_vals ;
1999-03-22 08:51:30 +08:00
}
2006-04-04 18:30:58 +08:00
static GValueArray *
2007-12-03 02:05:54 +08:00
path_get_current_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GValueArray * args ,
GError * * error )
1999-03-22 08:51:30 +08:00
{
1999-03-28 14:55:29 +08:00
gboolean success = TRUE ;
2006-04-04 18:30:58 +08:00
GValueArray * return_vals ;
2006-03-24 05:17:16 +08:00
GimpImage * image ;
2003-07-09 21:18:56 +08:00
gchar * name = NULL ;
1999-03-28 14:55:29 +08:00
2006-04-04 18:30:58 +08:00
image = gimp_value_get_image ( & args - > values [ 0 ] , gimp ) ;
1999-03-22 08:51:30 +08:00
if ( success )
{
2006-03-24 05:17:16 +08:00
GimpVectors * vectors = gimp_image_get_active_vectors ( image ) ;
2004-03-27 00:38:44 +08:00
2003-05-16 05:15:00 +08:00
if ( vectors )
2004-03-27 00:49:18 +08:00
name = g_strdup ( gimp_object_get_name ( GIMP_OBJECT ( vectors ) ) ) ;
2003-05-16 05:15:00 +08:00
else
2004-03-27 00:49:18 +08:00
success = FALSE ;
1999-03-22 08:51:30 +08:00
}
2008-08-16 21:57:57 +08:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
1999-03-28 14:55:29 +08:00
if ( success )
2006-04-04 18:30:58 +08:00
g_value_take_string ( & return_vals - > values [ 1 ] , name ) ;
1999-03-22 08:51:30 +08:00
2006-03-28 05:09:32 +08:00
return return_vals ;
1999-03-22 08:51:30 +08:00
}
2006-04-04 18:30:58 +08:00
static GValueArray *
2007-12-03 02:05:54 +08:00
path_set_current_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GValueArray * args ,
GError * * error )
1999-03-22 08:51:30 +08:00
{
1999-03-28 14:55:29 +08:00
gboolean success = TRUE ;
2006-03-24 05:17:16 +08:00
GimpImage * image ;
2006-04-03 00:03:32 +08:00
const gchar * name ;
1999-03-22 08:51:30 +08:00
2006-04-04 18:30:58 +08:00
image = gimp_value_get_image ( & args - > values [ 0 ] , gimp ) ;
name = g_value_get_string ( & args - > values [ 1 ] ) ;
2003-05-16 05:15:00 +08:00
1999-03-22 08:51:30 +08:00
if ( success )
{
2006-03-24 05:17:16 +08:00
GimpVectors * vectors = gimp_image_get_vectors_by_name ( image , name ) ;
2004-03-27 00:38:44 +08:00
2003-05-16 05:15:00 +08:00
if ( vectors )
2006-03-24 05:17:16 +08:00
gimp_image_set_active_vectors ( image , vectors ) ;
1999-03-22 08:51:30 +08:00
else
2004-03-27 00:49:18 +08:00
success = FALSE ;
1999-03-22 08:51:30 +08:00
}
2008-08-16 21:57:57 +08:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
1999-03-22 08:51:30 +08:00
}
2006-04-04 18:30:58 +08:00
static GValueArray *
2007-12-03 02:05:54 +08:00
path_delete_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GValueArray * args ,
GError * * error )
2003-05-16 05:15:00 +08:00
{
gboolean success = TRUE ;
2006-03-24 05:17:16 +08:00
GimpImage * image ;
2006-04-03 00:03:32 +08:00
const gchar * name ;
2003-05-16 05:15:00 +08:00
2006-04-04 18:30:58 +08:00
image = gimp_value_get_image ( & args - > values [ 0 ] , gimp ) ;
name = g_value_get_string ( & args - > values [ 1 ] ) ;
2003-05-16 05:15:00 +08:00
if ( success )
{
2006-03-24 05:17:16 +08:00
GimpVectors * vectors = gimp_image_get_vectors_by_name ( image , name ) ;
2004-03-27 00:38:44 +08:00
2003-05-16 05:15:00 +08:00
if ( vectors )
2008-10-10 03:40:41 +08:00
gimp_image_remove_vectors ( image , vectors , TRUE , NULL ) ;
2003-05-16 05:15:00 +08:00
else
2004-03-27 00:49:18 +08:00
success = FALSE ;
2003-05-16 05:15:00 +08:00
}
2008-08-16 21:57:57 +08:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2003-05-16 05:15:00 +08:00
}
2006-04-04 18:30:58 +08:00
static GValueArray *
2007-12-03 02:05:54 +08:00
path_get_points_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GValueArray * args ,
GError * * error )
1999-03-22 08:51:30 +08:00
{
1999-03-28 14:55:29 +08:00
gboolean success = TRUE ;
2006-04-04 18:30:58 +08:00
GValueArray * return_vals ;
2006-03-24 05:17:16 +08:00
GimpImage * image ;
2006-04-03 00:03:32 +08:00
const gchar * name ;
2003-05-16 07:18:35 +08:00
gint32 path_type = 0 ;
gint32 path_closed = 0 ;
2006-03-15 23:00:01 +08:00
gint32 num_path_point_details = 0 ;
2003-05-23 03:02:38 +08:00
gdouble * points_pairs = NULL ;
1999-03-22 08:51:30 +08:00
2006-04-04 18:30:58 +08:00
image = gimp_value_get_image ( & args - > values [ 0 ] , gimp ) ;
name = g_value_get_string ( & args - > values [ 1 ] ) ;
1999-03-22 08:51:30 +08:00
1999-03-28 14:55:29 +08:00
if ( success )
2003-05-16 05:15:00 +08:00
{
2006-03-24 05:17:16 +08:00
GimpVectors * vectors = gimp_image_get_vectors_by_name ( image , name ) ;
2004-03-27 00:38:44 +08:00
2003-05-16 05:15:00 +08:00
if ( vectors )
2004-03-27 00:49:18 +08:00
{
GimpVectorsCompatPoint * points ;
gint num_points ;
path_type = 1 ; /* BEZIER (1.2 compat) */
points = gimp_vectors_compat_get_points ( vectors , & num_points ,
& path_closed ) ;
2006-03-15 23:00:01 +08:00
num_path_point_details = num_points * 3 ;
2004-03-27 00:49:18 +08:00
if ( points )
{
gdouble * curr_point ;
gint i ;
2006-03-15 23:00:01 +08:00
points_pairs = g_new0 ( gdouble , num_path_point_details ) ;
2004-03-27 00:49:18 +08:00
for ( i = 0 , curr_point = points_pairs ;
i < num_points ;
i + + , curr_point + = 3 )
{
curr_point [ 0 ] = points [ i ] . x ;
curr_point [ 1 ] = points [ i ] . y ;
curr_point [ 2 ] = points [ i ] . type ;
}
g_free ( points ) ;
}
else
success = FALSE ;
}
2003-05-16 05:15:00 +08:00
else
2004-03-27 00:49:18 +08:00
success = FALSE ;
2003-05-16 05:15:00 +08:00
}
1999-03-28 14:55:29 +08:00
2008-08-16 21:57:57 +08:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2003-05-16 05:15:00 +08:00
if ( success )
{
2006-04-04 18:30:58 +08:00
g_value_set_int ( & return_vals - > values [ 1 ] , path_type ) ;
g_value_set_int ( & return_vals - > values [ 2 ] , path_closed ) ;
g_value_set_int ( & return_vals - > values [ 3 ] , num_path_point_details ) ;
gimp_value_take_floatarray ( & return_vals - > values [ 4 ] , points_pairs , num_path_point_details ) ;
2003-05-16 05:15:00 +08:00
}
2006-03-28 05:09:32 +08:00
return return_vals ;
1999-03-22 08:51:30 +08:00
}
2006-04-04 18:30:58 +08:00
static GValueArray *
2007-12-03 02:05:54 +08:00
path_set_points_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GValueArray * args ,
GError * * error )
1999-03-22 08:51:30 +08:00
{
1999-03-28 14:55:29 +08:00
gboolean success = TRUE ;
2006-03-24 05:17:16 +08:00
GimpImage * image ;
2006-04-03 00:03:32 +08:00
const gchar * name ;
1999-03-28 14:55:29 +08:00
gint32 ptype ;
2006-03-15 23:32:39 +08:00
gint32 num_path_points ;
2006-04-03 00:03:32 +08:00
const gdouble * points_pairs ;
1999-03-22 08:51:30 +08:00
2006-04-04 18:30:58 +08:00
image = gimp_value_get_image ( & args - > values [ 0 ] , gimp ) ;
name = g_value_get_string ( & args - > values [ 1 ] ) ;
ptype = g_value_get_int ( & args - > values [ 2 ] ) ;
num_path_points = g_value_get_int ( & args - > values [ 3 ] ) ;
points_pairs = gimp_value_get_floatarray ( & args - > values [ 4 ] ) ;
1999-03-28 14:55:29 +08:00
if ( success )
1999-03-22 08:51:30 +08:00
{
2006-03-15 05:35:50 +08:00
gboolean closed = FALSE ;
2003-05-16 05:15:00 +08:00
if ( ( num_path_points / 3 ) % 3 = = 0 )
2004-03-27 00:49:18 +08:00
closed = TRUE ;
2003-05-16 05:15:00 +08:00
else if ( ( num_path_points / 3 ) % 3 ! = 2 )
2004-03-27 00:49:18 +08:00
success = FALSE ;
2004-03-27 00:38:44 +08:00
2003-05-16 05:15:00 +08:00
if ( success )
2004-03-27 00:49:18 +08:00
{
GimpVectors * vectors ;
2006-04-03 00:03:32 +08:00
const gdouble * curr_point_pair ;
2004-03-27 00:49:18 +08:00
GimpVectorsCompatPoint * points ;
gint n_points ;
gint i ;
n_points = num_path_points / 3 ;
points = g_new0 ( GimpVectorsCompatPoint , n_points ) ;
for ( i = 0 , curr_point_pair = points_pairs ;
i < n_points ;
i + + , curr_point_pair + = 3 )
{
points [ i ] . x = curr_point_pair [ 0 ] ;
points [ i ] . y = curr_point_pair [ 1 ] ;
points [ i ] . type = curr_point_pair [ 2 ] ;
}
2006-03-24 05:17:16 +08:00
vectors = gimp_vectors_compat_new ( image , name , points , n_points ,
2004-03-27 00:49:18 +08:00
closed ) ;
g_free ( points ) ;
if ( vectors )
2008-10-10 03:40:41 +08:00
success = gimp_image_add_vectors ( image , vectors , 0 , TRUE ) ;
2004-03-27 00:49:18 +08:00
else
success = FALSE ;
}
1999-03-22 08:51:30 +08:00
}
2008-08-16 21:57:57 +08:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
1999-03-22 08:51:30 +08:00
}
2006-04-04 18:30:58 +08:00
static GValueArray *
2007-12-03 02:05:54 +08:00
path_stroke_current_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GValueArray * args ,
GError * * error )
1999-03-22 08:51:30 +08:00
{
1999-03-28 14:55:29 +08:00
gboolean success = TRUE ;
2006-03-24 05:17:16 +08:00
GimpImage * image ;
1999-03-22 08:51:30 +08:00
2006-04-04 18:30:58 +08:00
image = gimp_value_get_image ( & args - > values [ 0 ] , gimp ) ;
1999-03-22 08:51:30 +08:00
if ( success )
{
2006-03-24 05:17:16 +08:00
GimpVectors * vectors = gimp_image_get_active_vectors ( image ) ;
2007-07-19 22:59:51 +08:00
GimpDrawable * drawable = gimp_image_get_active_drawable ( image ) ;
2004-03-27 00:38:44 +08:00
2003-05-16 05:15:00 +08:00
if ( vectors & & drawable )
2004-03-27 00:49:18 +08:00
{
2004-10-22 20:32:31 +08:00
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 ) ,
2007-12-07 02:40:12 +08:00
drawable , context , desc , TRUE , progress ,
error ) ;
2004-03-27 00:38:44 +08:00
2004-10-22 20:32:31 +08:00
g_object_unref ( desc ) ;
2004-03-27 00:49:18 +08:00
}
1999-03-22 08:51:30 +08:00
else
2004-03-27 00:49:18 +08:00
success = FALSE ;
1999-03-22 08:51:30 +08:00
}
2008-08-16 21:57:57 +08:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
1999-03-22 08:51:30 +08:00
}
2006-04-04 18:30:58 +08:00
static GValueArray *
2007-12-03 02:05:54 +08:00
path_get_point_at_dist_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GValueArray * args ,
GError * * error )
1999-04-06 07:33:50 +08:00
{
gboolean success = TRUE ;
2006-04-04 18:30:58 +08:00
GValueArray * return_vals ;
2006-03-24 05:17:16 +08:00
GimpImage * image ;
1999-04-06 07:33:50 +08:00
gdouble distance ;
gint32 x_point = 0 ;
gint32 y_point = 0 ;
2006-03-15 23:32:39 +08:00
gdouble slope = 0.0 ;
1999-04-06 07:33:50 +08:00
2006-04-04 18:30:58 +08:00
image = gimp_value_get_image ( & args - > values [ 0 ] , gimp ) ;
distance = g_value_get_double ( & args - > values [ 1 ] ) ;
1999-04-06 07:33:50 +08:00
if ( success )
{
2006-03-15 05:35:50 +08:00
GimpVectors * vectors ;
GimpStroke * stroke ;
gdouble distance_along ;
gdouble stroke_length ;
gdouble stroke_distance ;
GimpCoords position ;
2006-03-24 05:17:16 +08:00
vectors = gimp_image_get_active_vectors ( image ) ;
2004-03-27 00:38:44 +08:00
2003-05-16 05:15:00 +08:00
if ( vectors )
2004-03-27 00:49:18 +08:00
{
2004-06-30 06:45:58 +08:00
distance_along = 0.0 ;
stroke = gimp_vectors_stroke_get_next ( vectors , NULL ) ;
2006-01-17 20:43:50 +08:00
while ( stroke ! = NULL )
2004-06-30 06:45:58 +08:00
{
stroke_length = gimp_stroke_get_length ( stroke , 0.5 ) ;
2006-01-17 20:43:50 +08:00
if ( distance_along + stroke_length < distance )
2004-06-30 06:45:58 +08:00
{
distance_along + = stroke_length ;
}
else
{
stroke_distance = distance - distance_along ;
stroke_distance = stroke_distance < 0 ? 0 : stroke_distance ;
if ( ! gimp_stroke_get_point_at_dist ( stroke , stroke_distance , 0.5 ,
2004-12-15 06:36:40 +08:00
& position , & slope ) )
2004-06-30 06:45:58 +08:00
{
success = FALSE ;
break ;
}
else
{
success = TRUE ;
x_point = ROUND ( position . x ) ;
y_point = ROUND ( position . y ) ;
break ;
}
}
stroke = gimp_vectors_stroke_get_next ( vectors , stroke ) ;
}
2004-03-27 00:49:18 +08:00
}
1999-04-10 12:54:34 +08:00
else
2004-06-30 06:45:58 +08:00
{
success = FALSE ;
}
1999-04-06 07:33:50 +08:00
}
2008-08-16 21:57:57 +08:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
1999-04-06 07:33:50 +08:00
if ( success )
{
2006-04-04 18:30:58 +08:00
g_value_set_int ( & return_vals - > values [ 1 ] , x_point ) ;
g_value_set_int ( & return_vals - > values [ 2 ] , y_point ) ;
g_value_set_double ( & return_vals - > values [ 3 ] , slope ) ;
1999-04-06 07:33:50 +08:00
}
2006-03-28 05:09:32 +08:00
return return_vals ;
1999-04-06 07:33:50 +08:00
}
2006-04-04 18:30:58 +08:00
static GValueArray *
2007-12-03 02:05:54 +08:00
path_get_tattoo_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GValueArray * args ,
GError * * error )
1999-04-06 07:33:50 +08:00
{
gboolean success = TRUE ;
2006-04-04 18:30:58 +08:00
GValueArray * return_vals ;
2006-03-24 05:17:16 +08:00
GimpImage * image ;
2006-04-03 00:03:32 +08:00
const gchar * name ;
1999-04-06 07:33:50 +08:00
gint32 tattoo = 0 ;
2006-04-04 18:30:58 +08:00
image = gimp_value_get_image ( & args - > values [ 0 ] , gimp ) ;
name = g_value_get_string ( & args - > values [ 1 ] ) ;
1999-04-06 07:33:50 +08:00
if ( success )
{
2006-03-24 05:17:16 +08:00
GimpVectors * vectors = gimp_image_get_vectors_by_name ( image , name ) ;
2004-03-27 00:38:44 +08:00
2003-05-16 05:15:00 +08:00
if ( vectors )
2004-03-27 00:49:18 +08:00
tattoo = gimp_item_get_tattoo ( GIMP_ITEM ( vectors ) ) ;
1999-04-10 12:54:34 +08:00
else
2004-03-27 00:49:18 +08:00
success = FALSE ;
1999-04-06 07:33:50 +08:00
}
2008-08-16 21:57:57 +08:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
1999-04-06 07:33:50 +08:00
if ( success )
2006-04-04 18:30:58 +08:00
g_value_set_int ( & return_vals - > values [ 1 ] , tattoo ) ;
1999-04-06 07:33:50 +08:00
2006-03-28 05:09:32 +08:00
return return_vals ;
1999-04-06 07:33:50 +08:00
}
2006-04-04 18:30:58 +08:00
static GValueArray *
2007-12-03 02:05:54 +08:00
path_set_tattoo_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GValueArray * args ,
GError * * error )
1999-04-06 07:33:50 +08:00
{
gboolean success = TRUE ;
2006-03-24 05:17:16 +08:00
GimpImage * image ;
2006-04-03 00:03:32 +08:00
const gchar * name ;
2006-03-15 23:32:39 +08:00
gint32 tattovalue ;
1999-04-06 07:33:50 +08:00
2006-04-04 18:30:58 +08:00
image = gimp_value_get_image ( & args - > values [ 0 ] , gimp ) ;
name = g_value_get_string ( & args - > values [ 1 ] ) ;
tattovalue = g_value_get_int ( & args - > values [ 2 ] ) ;
1999-04-06 07:33:50 +08:00
if ( success )
{
2006-03-24 05:17:16 +08:00
GimpVectors * vectors = gimp_image_get_vectors_by_name ( image , name ) ;
2004-03-27 00:38:44 +08:00
2003-05-16 05:15:00 +08:00
if ( vectors )
2004-03-27 00:49:18 +08:00
gimp_item_set_tattoo ( GIMP_ITEM ( vectors ) , tattovalue ) ;
1999-04-06 07:33:50 +08:00
else
2004-03-27 00:49:18 +08:00
success = FALSE ;
1999-04-06 07:33:50 +08:00
}
2008-08-16 21:57:57 +08:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
1999-04-06 07:33:50 +08:00
}
2006-04-04 18:30:58 +08:00
static GValueArray *
2007-12-03 02:05:54 +08:00
get_path_by_tattoo_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GValueArray * args ,
GError * * error )
1999-07-07 05:19:34 +08:00
{
gboolean success = TRUE ;
2006-04-04 18:30:58 +08:00
GValueArray * return_vals ;
2006-03-24 05:17:16 +08:00
GimpImage * image ;
2003-05-16 05:15:00 +08:00
gint32 tattoo ;
2003-07-09 21:18:56 +08:00
gchar * name = NULL ;
1999-07-07 05:19:34 +08:00
2006-04-04 18:30:58 +08:00
image = gimp_value_get_image ( & args - > values [ 0 ] , gimp ) ;
tattoo = g_value_get_int ( & args - > values [ 1 ] ) ;
2003-05-16 05:15:00 +08:00
if ( success )
{
2006-03-24 05:17:16 +08:00
GimpVectors * vectors = gimp_image_get_vectors_by_tattoo ( image , tattoo ) ;
2004-03-27 00:38:44 +08:00
2003-05-16 05:15:00 +08:00
if ( vectors )
2004-03-27 00:49:18 +08:00
name = g_strdup ( gimp_object_get_name ( GIMP_OBJECT ( vectors ) ) ) ;
2003-05-16 05:15:00 +08:00
else
2004-03-27 00:49:18 +08:00
success = FALSE ;
2003-05-16 05:15:00 +08:00
}
2008-08-16 21:57:57 +08:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
1999-07-07 05:19:34 +08:00
if ( success )
2006-04-04 18:30:58 +08:00
g_value_take_string ( & return_vals - > values [ 1 ] , name ) ;
1999-07-07 05:19:34 +08:00
2006-03-28 05:09:32 +08:00
return return_vals ;
1999-07-07 05:19:34 +08:00
}
2006-04-05 05:11:45 +08:00
static GValueArray *
2007-12-03 02:05:54 +08:00
path_get_locked_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GValueArray * args ,
GError * * error )
2006-04-05 05:11:45 +08:00
{
gboolean success = TRUE ;
GValueArray * return_vals ;
GimpImage * image ;
const gchar * name ;
gboolean locked = FALSE ;
image = gimp_value_get_image ( & args - > values [ 0 ] , gimp ) ;
name = g_value_get_string ( & args - > values [ 1 ] ) ;
if ( success )
{
GimpVectors * vectors = gimp_image_get_vectors_by_name ( image , name ) ;
if ( vectors )
locked = gimp_item_get_linked ( GIMP_ITEM ( vectors ) ) ;
else
success = FALSE ;
}
2008-08-16 21:57:57 +08:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2006-04-05 05:11:45 +08:00
if ( success )
g_value_set_boolean ( & return_vals - > values [ 1 ] , locked ) ;
return return_vals ;
}
static GValueArray *
2007-12-03 02:05:54 +08:00
path_set_locked_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GValueArray * args ,
GError * * error )
2006-04-05 05:11:45 +08:00
{
gboolean success = TRUE ;
GimpImage * image ;
const gchar * name ;
gboolean locked ;
image = gimp_value_get_image ( & args - > values [ 0 ] , gimp ) ;
name = g_value_get_string ( & args - > values [ 1 ] ) ;
locked = g_value_get_boolean ( & args - > values [ 2 ] ) ;
if ( success )
{
GimpVectors * vectors = gimp_image_get_vectors_by_name ( image , name ) ;
if ( vectors )
gimp_item_set_linked ( GIMP_ITEM ( vectors ) , locked , TRUE ) ;
else
success = FALSE ;
}
2008-08-16 21:57:57 +08:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2006-04-05 05:11:45 +08:00
}
static GValueArray *
2007-12-03 02:05:54 +08:00
path_to_selection_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GValueArray * args ,
GError * * error )
2006-04-05 05:11:45 +08:00
{
gboolean success = TRUE ;
GimpImage * image ;
const gchar * name ;
gint32 op ;
gboolean antialias ;
gboolean feather ;
gdouble feather_radius_x ;
gdouble feather_radius_y ;
image = gimp_value_get_image ( & args - > values [ 0 ] , gimp ) ;
name = g_value_get_string ( & args - > values [ 1 ] ) ;
op = g_value_get_enum ( & args - > values [ 2 ] ) ;
antialias = g_value_get_boolean ( & args - > values [ 3 ] ) ;
feather = g_value_get_boolean ( & args - > values [ 4 ] ) ;
feather_radius_x = g_value_get_double ( & args - > values [ 5 ] ) ;
feather_radius_y = g_value_get_double ( & args - > values [ 6 ] ) ;
if ( success )
{
GimpVectors * vectors = gimp_image_get_vectors_by_name ( image , name ) ;
if ( vectors )
gimp_channel_select_vectors ( gimp_image_get_mask ( image ) ,
_ ( " Path to Selection " ) ,
vectors ,
op ,
antialias ,
feather ,
feather_radius_x ,
2006-08-26 01:19:36 +08:00
feather_radius_y ,
TRUE ) ;
2006-04-05 05:11:45 +08:00
else
success = FALSE ;
}
2008-08-16 21:57:57 +08:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2006-04-05 05:11:45 +08:00
}
static GValueArray *
2007-12-03 02:05:54 +08:00
path_import_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GValueArray * args ,
GError * * error )
2006-04-05 05:11:45 +08:00
{
gboolean success = TRUE ;
GimpImage * image ;
const gchar * filename ;
gboolean merge ;
gboolean scale ;
image = gimp_value_get_image ( & args - > values [ 0 ] , gimp ) ;
filename = g_value_get_string ( & args - > values [ 1 ] ) ;
merge = g_value_get_boolean ( & args - > values [ 2 ] ) ;
scale = g_value_get_boolean ( & args - > values [ 3 ] ) ;
if ( success )
{
2006-10-25 23:14:03 +08:00
success = gimp_vectors_import_file ( image , filename ,
merge , scale , - 1 , NULL , NULL ) ;
2006-04-05 05:11:45 +08:00
}
2008-08-16 21:57:57 +08:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2006-04-05 05:11:45 +08:00
}
void
2006-04-26 17:13:47 +08:00
register_paths_procs ( GimpPDB * pdb )
1999-07-07 05:19:34 +08:00
{
2006-04-05 05:11:45 +08:00
GimpProcedure * procedure ;
/*
* gimp - path - list
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( path_list_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-path-list " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_set_static_strings ( procedure ,
" gimp-path-list " ,
" This procedure is deprecated! Use 'gimp-image-get-vectors' instead. " ,
" This procedure is deprecated! Use 'gimp-image-get-vectors' instead. " ,
" " ,
" " ,
" " ,
" gimp-image-get-vectors " ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_image_id ( " image " ,
" image " ,
" The image to list the paths from " ,
2006-05-07 02:57:51 +08:00
pdb - > gimp , FALSE ,
2006-04-05 05:11:45 +08:00
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
gimp_param_spec_int32 ( " num-paths " ,
" num paths " ,
" The number of paths returned. " ,
0 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
gimp_param_spec_string_array ( " path-list " ,
" path list " ,
" List of the paths belonging to this image. " ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
2006-04-05 05:11:45 +08:00
/*
* gimp - path - get - current
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( path_get_current_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-path-get-current " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_set_static_strings ( procedure ,
" gimp-path-get-current " ,
" This procedure is deprecated! Use 'gimp-image-get-active-vectors' instead. " ,
" This procedure is deprecated! Use 'gimp-image-get-active-vectors' instead. " ,
" " ,
" " ,
" " ,
" gimp-image-get-active-vectors " ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_image_id ( " image " ,
" image " ,
" The image to get the current path from " ,
2006-05-07 02:57:51 +08:00
pdb - > gimp , FALSE ,
2006-04-05 05:11:45 +08:00
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
gimp_param_spec_string ( " name " ,
" name " ,
" The name of the current path. " ,
2007-04-25 22:23:05 +08:00
FALSE , FALSE , FALSE ,
2006-04-05 05:11:45 +08:00
NULL ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
2000-02-02 12:14:23 +08:00
2006-04-05 05:11:45 +08:00
/*
* gimp - path - set - current
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( path_set_current_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-path-set-current " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_set_static_strings ( procedure ,
" gimp-path-set-current " ,
" This procedure is deprecated! Use 'gimp-image-set-active-vectors' instead. " ,
" This procedure is deprecated! Use 'gimp-image-set-active-vectors' instead. " ,
" " ,
" " ,
" " ,
" gimp-image-set-active-vectors " ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_image_id ( " image " ,
" image " ,
" The image in which a path will become current " ,
2006-05-07 02:57:51 +08:00
pdb - > gimp , FALSE ,
2006-04-05 05:11:45 +08:00
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_string ( " name " ,
" name " ,
" The name of the path to make current. " ,
2007-04-25 22:23:05 +08:00
FALSE , FALSE , FALSE ,
2006-04-05 05:11:45 +08:00
NULL ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
2000-02-02 12:14:23 +08:00
2006-04-05 05:11:45 +08:00
/*
* gimp - path - delete
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( path_delete_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-path-delete " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_set_static_strings ( procedure ,
" gimp-path-delete " ,
" This procedure is deprecated! Use 'gimp-image-remove-vectors' instead. " ,
" This procedure is deprecated! Use 'gimp-image-remove-vectors' instead. " ,
" " ,
" " ,
" " ,
" gimp-image-remove-vectors " ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_image_id ( " image " ,
" image " ,
" The image to delete the path from " ,
2006-05-07 02:57:51 +08:00
pdb - > gimp , FALSE ,
2006-04-05 05:11:45 +08:00
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_string ( " name " ,
" name " ,
" The name of the path to delete. " ,
2007-04-25 22:23:05 +08:00
FALSE , FALSE , FALSE ,
2006-04-05 05:11:45 +08:00
NULL ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
2000-02-02 12:14:23 +08:00
2006-04-05 05:11:45 +08:00
/*
* gimp - path - get - points
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( path_get_points_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-path-get-points " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_set_static_strings ( procedure ,
" gimp-path-get-points " ,
2006-10-24 22:23:29 +08:00
" This procedure is deprecated! Use 'gimp-vectors-stroke-get-points' instead. " ,
" This procedure is deprecated! Use 'gimp-vectors-stroke-get-points' instead. " ,
" " ,
" " ,
" " ,
" gimp-vectors-stroke-get-points " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_image_id ( " image " ,
" image " ,
" The image to list the paths from " ,
2006-05-07 02:57:51 +08:00
pdb - > gimp , FALSE ,
2006-04-05 05:11:45 +08:00
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_string ( " name " ,
" name " ,
" The name of the path whose points should be listed. " ,
2007-04-25 22:23:05 +08:00
FALSE , FALSE , FALSE ,
2006-04-05 05:11:45 +08:00
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
gimp_param_spec_int32 ( " path-type " ,
" path type " ,
" The type of the path. Currently only one type (1 = Bezier) is supported " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
gimp_param_spec_int32 ( " path-closed " ,
" path closed " ,
" Return if the path is closed. (0 = path open, 1 = path closed) " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
gimp_param_spec_int32 ( " num-path-point-details " ,
" num path point details " ,
" The number of points returned. Each point is made up of (x, y, pnt_type) of floats. " ,
0 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
gimp_param_spec_float_array ( " points-pairs " ,
" points pairs " ,
" The points in the path represented as 3 floats. The first is the x pos, next is the y pos, last is the type of the pnt. The type field is dependant on the path type. For beziers (type 1 paths) the type can either be (1.0 = BEZIER_ANCHOR, 2.0 = BEZIER_CONTROL, 3.0 = BEZIER_MOVE). Note all points are returned in pixel resolution. " ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
2000-02-02 12:14:23 +08:00
2006-04-05 05:11:45 +08:00
/*
* gimp - path - set - points
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( path_set_points_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-path-set-points " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_set_static_strings ( procedure ,
" gimp-path-set-points " ,
2006-10-27 01:38:30 +08:00
" This procedure is deprecated! Use 'vectors-stroke-new-from-points' instead. " ,
" This procedure is deprecated! Use 'vectors-stroke-new-from-points' instead. " ,
2006-10-26 23:36:45 +08:00
" " ,
" " ,
" " ,
2006-10-27 01:38:30 +08:00
" vectors-stroke-new-from-points " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_image_id ( " image " ,
" image " ,
" The image to set the paths in " ,
2006-05-07 02:57:51 +08:00
pdb - > gimp , FALSE ,
2006-04-05 05:11:45 +08:00
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_string ( " name " ,
" name " ,
" The name of the path to create. If it exists then a unique name will be created - query the list of paths if you want to make sure that the name of the path you create is unique. This will be set as the current path. " ,
2007-04-25 22:23:05 +08:00
FALSE , FALSE , FALSE ,
2006-04-05 05:11:45 +08:00
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_int32 ( " ptype " ,
" ptype " ,
" The type of the path. Currently only one type (1 = Bezier) is supported. " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_int32 ( " num-path-points " ,
" num path points " ,
" The number of elements in the array, i.e. the number of points in the path * 3. Each point is made up of (x, y, type) of floats. Currently only the creation of bezier curves is allowed. The type parameter must be set to (1) to indicate a BEZIER type curve. Note that for BEZIER curves, points must be given in the following order: ACCACCAC... If the path is not closed the last control point is missed off. Points consist of three control points (control/anchor/control) so for a curve that is not closed there must be at least two points passed (2 x,y pairs). If (num_path_points/3) % 3 = 0 then the path is assumed to be closed and the points are ACCACCACCACC. " ,
0 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_float_array ( " points-pairs " ,
" points pairs " ,
" The points in the path represented as 3 floats. The first is the x pos, next is the y pos, last is the type of the pnt. The type field is dependant on the path type. For beziers (type 1 paths) the type can either be (1.0 = BEZIER_ANCHOR, 2.0 = BEZIER_CONTROL, 3.0= BEZIER_MOVE). Note all points are returned in pixel resolution. " ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
2000-02-02 12:14:23 +08:00
2006-04-05 05:11:45 +08:00
/*
* gimp - path - stroke - current
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( path_stroke_current_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-path-stroke-current " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_set_static_strings ( procedure ,
" gimp-path-stroke-current " ,
2006-10-26 06:43:21 +08:00
" This procedure is deprecated! Use 'gimp-edit-stroke-vectors' instead. " ,
" This procedure is deprecated! Use 'gimp-edit-stroke-vectors' instead. " ,
" " ,
" " ,
" " ,
" gimp-edit-stroke-vectors " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_image_id ( " image " ,
" image " ,
" The image which contains the path to stroke " ,
2006-05-07 02:57:51 +08:00
pdb - > gimp , FALSE ,
2006-04-05 05:11:45 +08:00
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
2000-02-02 12:14:23 +08:00
2006-04-05 05:11:45 +08:00
/*
* gimp - path - get - point - at - dist
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( path_get_point_at_dist_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-path-get-point-at-dist " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_set_static_strings ( procedure ,
" gimp-path-get-point-at-dist " ,
" This procedure is deprecated! Use 'gimp-vectors-stroke-get-point-at-dist' instead. " ,
2006-04-20 05:07:11 +08:00
" This procedure is deprecated! Use 'gimp-vectors-stroke-get-point-at-dist' instead. " ,
" " ,
" " ,
" " ,
2006-04-05 05:11:45 +08:00
" gimp-vectors-stroke-get-point-at-dist " ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_image_id ( " image " ,
" image " ,
" The image the paths belongs to " ,
2006-05-07 02:57:51 +08:00
pdb - > gimp , FALSE ,
2006-04-05 05:11:45 +08:00
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
g_param_spec_double ( " distance " ,
" distance " ,
" The distance along the path. " ,
- G_MAXDOUBLE , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
gimp_param_spec_int32 ( " x-point " ,
" x point " ,
" The x position of the point. " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
gimp_param_spec_int32 ( " y-point " ,
" y point " ,
" The y position of the point. " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
g_param_spec_double ( " slope " ,
" slope " ,
" The slope (dy / dx) at the specified point. " ,
- G_MAXDOUBLE , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
2000-02-02 12:14:23 +08:00
2006-04-05 05:11:45 +08:00
/*
* gimp - path - get - tattoo
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( path_get_tattoo_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-path-get-tattoo " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_set_static_strings ( procedure ,
" gimp-path-get-tattoo " ,
" This procedure is deprecated! Use 'gimp-vectors-get-tattoo' instead. " ,
" This procedure is deprecated! Use 'gimp-vectors-get-tattoo' instead. " ,
" " ,
" " ,
" " ,
" gimp-vectors-get-tattoo " ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_image_id ( " image " ,
" image " ,
" The image " ,
2006-05-07 02:57:51 +08:00
pdb - > gimp , FALSE ,
2006-04-05 05:11:45 +08:00
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_string ( " name " ,
" name " ,
" The name of the path whose tattoo should be obtained. " ,
2007-04-25 22:23:05 +08:00
FALSE , FALSE , FALSE ,
2006-04-05 05:11:45 +08:00
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
gimp_param_spec_int32 ( " tattoo " ,
" tattoo " ,
" The tattoo associated with the named path. " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
2003-07-09 21:18:56 +08:00
2006-04-05 05:11:45 +08:00
/*
* gimp - path - set - tattoo
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( path_set_tattoo_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-path-set-tattoo " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_set_static_strings ( procedure ,
" gimp-path-set-tattoo " ,
" This procedure is deprecated! Use 'gimp-vectors-set-tattoo' instead. " ,
" This procedure is deprecated! Use 'gimp-vectors-set-tattoo' instead. " ,
" " ,
" " ,
" " ,
" gimp-vectors-set-tattoo " ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_image_id ( " image " ,
" image " ,
" The image " ,
2006-05-07 02:57:51 +08:00
pdb - > gimp , FALSE ,
2006-04-05 05:11:45 +08:00
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_string ( " name " ,
" name " ,
" the name of the path whose tattoo should be set " ,
2007-04-25 22:23:05 +08:00
FALSE , FALSE , FALSE ,
2006-04-05 05:11:45 +08:00
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_int32 ( " tattovalue " ,
" tattovalue " ,
" The tattoo associated with the name path. Only values returned from 'path_get_tattoo' should be used here " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
2003-07-09 21:18:56 +08:00
2006-04-05 05:11:45 +08:00
/*
* gimp - get - path - by - tattoo
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( get_path_by_tattoo_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-get-path-by-tattoo " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_set_static_strings ( procedure ,
" gimp-get-path-by-tattoo " ,
" This procedure is deprecated! Use 'gimp-image-get-vectors-by-tattoo' instead. " ,
" This procedure is deprecated! Use 'gimp-image-get-vectors-by-tattoo' instead. " ,
" " ,
" " ,
" " ,
" gimp-image-get-vectors-by-tattoo " ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_image_id ( " image " ,
" image " ,
" The image " ,
2006-05-07 02:57:51 +08:00
pdb - > gimp , FALSE ,
2006-04-05 05:11:45 +08:00
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_int32 ( " tattoo " ,
" tattoo " ,
" The tattoo of the required path. " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
gimp_param_spec_string ( " name " ,
" name " ,
" The name of the path with the specified tattoo. " ,
2007-04-25 22:23:05 +08:00
FALSE , FALSE , FALSE ,
2006-04-05 05:11:45 +08:00
NULL ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
2003-07-09 21:18:56 +08:00
2006-04-05 05:11:45 +08:00
/*
* gimp - path - get - locked
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( path_get_locked_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-path-get-locked " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_set_static_strings ( procedure ,
" gimp-path-get-locked " ,
" This procedure is deprecated! Use 'gimp-vectors-get-linked' instead. " ,
" This procedure is deprecated! Use 'gimp-vectors-get-linked' instead. " ,
" " ,
" " ,
" " ,
" gimp-vectors-get-linked " ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_image_id ( " image " ,
" image " ,
" The image " ,
2006-05-07 02:57:51 +08:00
pdb - > gimp , FALSE ,
2006-04-05 05:11:45 +08:00
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_string ( " name " ,
" name " ,
" The name of the path whose locked status should be obtained. " ,
2007-04-25 22:23:05 +08:00
FALSE , FALSE , FALSE ,
2006-04-05 05:11:45 +08:00
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
g_param_spec_boolean ( " locked " ,
" locked " ,
" TRUE if the path is locked, FALSE otherwise " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
2003-09-22 01:29:12 +08:00
2006-04-05 05:11:45 +08:00
/*
* gimp - path - set - locked
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( path_set_locked_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-path-set-locked " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_set_static_strings ( procedure ,
" gimp-path-set-locked " ,
" This procedure is deprecated! Use 'gimp-vectors-set-linked' instead. " ,
" This procedure is deprecated! Use 'gimp-vectors-set-linked' instead. " ,
" " ,
" " ,
" " ,
" gimp-vectors-set-linked " ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_image_id ( " image " ,
" image " ,
" The image " ,
2006-05-07 02:57:51 +08:00
pdb - > gimp , FALSE ,
2006-04-05 05:11:45 +08:00
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_string ( " name " ,
" name " ,
" the name of the path whose locked status should be set " ,
2007-04-25 22:23:05 +08:00
FALSE , FALSE , FALSE ,
2006-04-05 05:11:45 +08:00
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
g_param_spec_boolean ( " locked " ,
" locked " ,
" Whether the path is locked " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
2003-09-25 08:39:46 +08:00
2006-04-05 05:11:45 +08:00
/*
* gimp - path - to - selection
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( path_to_selection_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-path-to-selection " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_set_static_strings ( procedure ,
" gimp-path-to-selection " ,
2006-07-28 22:54:31 +08:00
" This procedure is deprecated! Use 'gimp-vectors-to-selection' instead. " ,
" This procedure is deprecated! Use 'gimp-vectors-to-selection' instead. " ,
" " ,
" " ,
" " ,
" gimp-vectors-to-selection " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_image_id ( " image " ,
" image " ,
" The image " ,
2006-05-07 02:57:51 +08:00
pdb - > gimp , FALSE ,
2006-04-05 05:11:45 +08:00
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_string ( " name " ,
" name " ,
" The name of the path which should be made into selection. " ,
2007-04-25 22:23:05 +08:00
FALSE , FALSE , FALSE ,
2006-04-05 05:11:45 +08:00
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
g_param_spec_enum ( " op " ,
" op " ,
2006-05-19 01:25:15 +08:00
" The desired operation with current selection " ,
2006-04-05 05:11:45 +08:00
GIMP_TYPE_CHANNEL_OPS ,
GIMP_CHANNEL_OP_ADD ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
g_param_spec_boolean ( " antialias " ,
" antialias " ,
" Antialias selection. " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
g_param_spec_boolean ( " feather " ,
" feather " ,
" Feather selection. " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
g_param_spec_double ( " feather-radius-x " ,
" feather radius x " ,
" Feather radius x. " ,
- G_MAXDOUBLE , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
g_param_spec_double ( " feather-radius-y " ,
" feather radius y " ,
" Feather radius y. " ,
- G_MAXDOUBLE , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
2003-09-22 01:29:12 +08:00
2006-04-05 05:11:45 +08:00
/*
* gimp - path - import
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( path_import_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-path-import " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_set_static_strings ( procedure ,
" gimp-path-import " ,
2006-11-24 06:26:58 +08:00
" This procedure is deprecated! Use 'vectors-import-from-file' instead. " ,
" This procedure is deprecated! Use 'vectors-import-from-file' instead. " ,
2006-10-25 23:14:03 +08:00
" " ,
" " ,
" " ,
2006-11-24 06:26:58 +08:00
" vectors-import-from-file " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_image_id ( " image " ,
" image " ,
" The image " ,
2006-05-07 02:57:51 +08:00
pdb - > gimp , FALSE ,
2006-04-05 05:11:45 +08:00
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_string ( " filename " ,
" filename " ,
" The name of the SVG file to import. " ,
2007-04-25 22:23:05 +08:00
TRUE , FALSE , FALSE ,
2006-04-05 05:11:45 +08:00
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
g_param_spec_boolean ( " merge " ,
" merge " ,
" Merge paths into a single vectors object. " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
g_param_spec_boolean ( " scale " ,
" scale " ,
" Scale the SVG to image dimensions. " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
2005-03-03 19:02:12 +08:00
}