19
19
* Boston, MA 02111-1307, USA.
22
/* NOTE: This file is autogenerated by pdbgen.pl */
22
/* NOTE: This file is auto-generated by pdbgen.pl */
24
24
#include "config.h"
26
26
#include <string.h>
29
#undef GIMP_DISABLE_DEPRECATED
30
#undef __GIMP_PATHS_PDB_H__
31
#include "gimppaths_pdb.h"
32
* @image_ID: The ID of the image to list the paths from.
35
* @image_ID: The image to list the paths from.
33
36
* @num_paths: The number of paths returned.
35
* List the paths associated with the passed image.
37
* List the paths associated with the passed image.
38
* This procedure is deprecated! Use gimp_image_get_vectors() instead.
39
40
* Returns: List of the paths belonging to this image.
42
43
gimp_path_list (gint32 image_ID,
45
46
GimpParam *return_vals;
47
48
gchar **path_list = NULL;
50
return_vals = gimp_run_procedure ("gimp_path_list",
52
GIMP_PDB_IMAGE, image_ID,
51
return_vals = gimp_run_procedure ("gimp-path-list",
53
GIMP_PDB_IMAGE, image_ID,
59
60
*num_paths = return_vals[1].data.d_int32;
60
61
path_list = g_new (gchar *, *num_paths);
61
62
for (i = 0; i < *num_paths; i++)
62
path_list[i] = g_strdup (return_vals[2].data.d_stringarray[i]);
63
path_list[i] = g_strdup (return_vals[2].data.d_stringarray[i]);
65
66
gimp_destroy_params (return_vals, nreturn_vals);
71
72
* gimp_path_get_current:
72
* @image_ID: The ID of the image to get the current path from.
74
* The name of the current path. Error if no paths.
76
* The name of the current path. Error if no paths.
73
* @image_ID: The image to get the current path from.
75
* This procedure is deprecated! Use gimp_image_get_active_vectors()
78
78
* Returns: The name of the current path.
85
85
gchar *name = NULL;
87
return_vals = gimp_run_procedure ("gimp_path_get_current",
89
GIMP_PDB_IMAGE, image_ID,
87
return_vals = gimp_run_procedure ("gimp-path-get-current",
89
GIMP_PDB_IMAGE, image_ID,
92
92
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
93
93
name = g_strdup (return_vals[1].data.d_string);
101
101
* gimp_path_set_current:
102
* @image_ID: The ID of the image in which a path will become current.
102
* @image_ID: The image in which a path will become current.
103
103
* @name: The name of the path to make current.
105
* Sets the current path associated with the passed image.
107
* Sets a named path as the current path.
105
* This procedure is deprecated! Use gimp_image_set_active_vectors()
109
108
* Returns: TRUE on success.
112
111
gimp_path_set_current (gint32 image_ID,
115
114
GimpParam *return_vals;
116
115
gint nreturn_vals;
117
116
gboolean success = TRUE;
119
return_vals = gimp_run_procedure ("gimp_path_set_current",
121
GIMP_PDB_IMAGE, image_ID,
122
GIMP_PDB_STRING, name,
118
return_vals = gimp_run_procedure ("gimp-path-set-current",
120
GIMP_PDB_IMAGE, image_ID,
121
GIMP_PDB_STRING, name,
125
124
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
133
132
* gimp_path_delete:
134
* @image_ID: The ID of the image to delete the path from.
133
* @image_ID: The image to delete the path from.
135
134
* @name: The name of the path to delete.
137
* Delete the named path associated with the passed image.
139
* Delete the named path.
136
* This procedure is deprecated! Use gimp_image_remove_vectors()
141
139
* Returns: TRUE on success.
144
142
gimp_path_delete (gint32 image_ID,
147
145
GimpParam *return_vals;
148
146
gint nreturn_vals;
149
147
gboolean success = TRUE;
151
return_vals = gimp_run_procedure ("gimp_path_delete",
153
GIMP_PDB_IMAGE, image_ID,
154
GIMP_PDB_STRING, name,
149
return_vals = gimp_run_procedure ("gimp-path-delete",
151
GIMP_PDB_IMAGE, image_ID,
152
GIMP_PDB_STRING, name,
157
155
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
165
163
* gimp_path_get_points:
166
* @image_ID: The ID of the image to list the paths from.
164
* @image_ID: The image to list the paths from.
167
165
* @name: The name of the path whose points should be listed.
168
166
* @path_closed: Return if the path is closed. (0 = path open, 1 = path closed).
169
167
* @num_path_point_details: The number of points returned. Each point is made up of (x, y, pnt_type) of floats.
170
168
* @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.
172
* List the points associated with the named path.
174
* List the points associated with the named path.
170
* This procedure is deprecated! Use gimp_vectors_stroke_get_points()
176
173
* Returns: The type of the path. Currently only one type (1 = Bezier) is supported.
179
176
gimp_path_get_points (gint32 image_ID,
182
gint *num_path_point_details,
183
gdouble **points_pairs)
179
gint *num_path_point_details,
180
gdouble **points_pairs)
185
182
GimpParam *return_vals;
186
183
gint nreturn_vals;
187
184
gint path_type = 0;
189
return_vals = gimp_run_procedure ("gimp_path_get_points",
191
GIMP_PDB_IMAGE, image_ID,
192
GIMP_PDB_STRING, name,
186
return_vals = gimp_run_procedure ("gimp-path-get-points",
188
GIMP_PDB_IMAGE, image_ID,
189
GIMP_PDB_STRING, name,
195
192
*num_path_point_details = 0;
200
197
*path_closed = return_vals[2].data.d_int32;
201
198
*num_path_point_details = return_vals[3].data.d_int32;
202
199
*points_pairs = g_new (gdouble, *num_path_point_details);
203
memcpy (*points_pairs, return_vals[4].data.d_floatarray,
204
*num_path_point_details * sizeof (gdouble));
200
memcpy (*points_pairs,
201
return_vals[4].data.d_floatarray,
202
*num_path_point_details * sizeof (gdouble));
207
205
gimp_destroy_params (return_vals, nreturn_vals);
213
211
* gimp_path_set_points:
214
* @image_ID: The ID of the image to set the paths in.
212
* @image_ID: The image to set the paths in.
215
213
* @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.
216
214
* @ptype: The type of the path. Currently only one type (1 = Bezier) is supported.
217
215
* @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.
218
216
* @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.
220
* Set the points associated with the named path.
222
* Set the points associated with the named path.
218
* This procedure is deprecated! Use vectors_stroke_new_from_points()
224
221
* Returns: TRUE on success.
227
224
gimp_path_set_points (gint32 image_ID,
230
gint num_path_points,
231
const gdouble *points_pairs)
227
gint num_path_points,
228
const gdouble *points_pairs)
233
230
GimpParam *return_vals;
234
231
gint nreturn_vals;
235
232
gboolean success = TRUE;
237
return_vals = gimp_run_procedure ("gimp_path_set_points",
239
GIMP_PDB_IMAGE, image_ID,
240
GIMP_PDB_STRING, name,
241
GIMP_PDB_INT32, ptype,
242
GIMP_PDB_INT32, num_path_points,
243
GIMP_PDB_FLOATARRAY, points_pairs,
234
return_vals = gimp_run_procedure ("gimp-path-set-points",
236
GIMP_PDB_IMAGE, image_ID,
237
GIMP_PDB_STRING, name,
238
GIMP_PDB_INT32, ptype,
239
GIMP_PDB_INT32, num_path_points,
240
GIMP_PDB_FLOATARRAY, points_pairs,
246
243
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
254
251
* gimp_path_stroke_current:
255
* @image_ID: The ID of the image which contains the path to stroke.
257
* Stroke the current path in the passed image.
259
* Stroke the current path in the passed image.
252
* @image_ID: The image which contains the path to stroke.
254
* This procedure is deprecated! Use gimp_edit_stroke_vectors()
261
257
* Returns: TRUE on success.
267
263
gint nreturn_vals;
268
264
gboolean success = TRUE;
270
return_vals = gimp_run_procedure ("gimp_path_stroke_current",
272
GIMP_PDB_IMAGE, image_ID,
266
return_vals = gimp_run_procedure ("gimp-path-stroke-current",
268
GIMP_PDB_IMAGE, image_ID,
275
271
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
283
279
* gimp_path_get_point_at_dist:
284
* @image_ID: The ID of the image the paths belongs to.
280
* @image_ID: The image the paths belongs to.
285
281
* @distance: The distance along the path.
286
282
* @y_point: The y position of the point.
287
283
* @slope: The slope (dy / dx) at the specified point.
289
* Get point on a path at a specified distance along the path.
291
* This will return the x,y position of a point at a given distance
292
* along the bezier curve. The distance will be obtained by first
293
* digitizing the curve internally and then walking along the curve.
294
* For a closed curve the start of the path is the first point on the
295
* path that was created. This might not be obvious. Note the current
285
* This procedure is deprecated! Use
286
* gimp_vectors_stroke_get_point_at_dist() instead.
298
288
* Returns: The x position of the point.
301
291
gimp_path_get_point_at_dist (gint32 image_ID,
306
296
GimpParam *return_vals;
307
297
gint nreturn_vals;
308
298
gint x_point = 0;
310
return_vals = gimp_run_procedure ("gimp_path_get_point_at_dist",
312
GIMP_PDB_IMAGE, image_ID,
313
GIMP_PDB_FLOAT, distance,
300
return_vals = gimp_run_procedure ("gimp-path-get-point-at-dist",
302
GIMP_PDB_IMAGE, image_ID,
303
GIMP_PDB_FLOAT, distance,
316
306
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
330
320
* @image_ID: The image.
331
321
* @name: The name of the path whose tattoo should be obtained.
333
* Returns the tattoo associated with the name path.
335
* This procedure returns the tattoo associated with the specified
336
* path. A tattoo is a unique and permanent identifier attached to a
337
* path that can be used to uniquely identify a path within an image
338
* even between sessions.
323
* This procedure is deprecated! Use gimp_vectors_get_tattoo() instead.
340
325
* Returns: The tattoo associated with the named path.
343
328
gimp_path_get_tattoo (gint32 image_ID,
346
331
GimpParam *return_vals;
347
332
gint nreturn_vals;
350
return_vals = gimp_run_procedure ("gimp_path_get_tattoo",
352
GIMP_PDB_IMAGE, image_ID,
353
GIMP_PDB_STRING, name,
335
return_vals = gimp_run_procedure ("gimp-path-get-tattoo",
337
GIMP_PDB_IMAGE, image_ID,
338
GIMP_PDB_STRING, name,
356
341
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
357
342
tattoo = return_vals[1].data.d_int32;
367
352
* @name: the name of the path whose tattoo should be set.
368
353
* @tattovalue: The tattoo associated with the name path. Only values returned from 'path_get_tattoo' should be used here.
370
* Sets the tattoo associated with the named path.
372
* This procedure sets the tattoo associated with the specified path. A
373
* tattoo is a unique and permenant identifier attached to a path that
374
* can be used to uniquely identify a path within an image even between
375
* sessions. Note that the value passed to this function must have been
376
* obtained from a previous call to path_get_tattoo.
355
* This procedure is deprecated! Use gimp_vectors_set_tattoo() instead.
378
357
* Returns: TRUE on success.
381
360
gimp_path_set_tattoo (gint32 image_ID,
385
364
GimpParam *return_vals;
386
365
gint nreturn_vals;
387
366
gboolean success = TRUE;
389
return_vals = gimp_run_procedure ("gimp_path_set_tattoo",
391
GIMP_PDB_IMAGE, image_ID,
392
GIMP_PDB_STRING, name,
393
GIMP_PDB_INT32, tattovalue,
368
return_vals = gimp_run_procedure ("gimp-path-set-tattoo",
370
GIMP_PDB_IMAGE, image_ID,
371
GIMP_PDB_STRING, name,
372
GIMP_PDB_INT32, tattovalue,
396
375
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
405
384
* @image_ID: The image.
406
385
* @tattoo: The tattoo of the required path.
408
* Return the name of the path with the given tattoo.
410
* The procedure returns the name of the path in the specified image
411
* which has the passed tattoo. The tattoos are unique within the image
412
* and will be preserved across sessions and through renaming of the
413
* path. An error is returned if no path with the specified tattoo can
387
* This procedure is deprecated! Use gimp_image_get_vectors_by_tattoo()
416
390
* Returns: The name of the path with the specified tattoo.
419
393
gimp_get_path_by_tattoo (gint32 image_ID,
422
396
GimpParam *return_vals;
423
397
gint nreturn_vals;
424
398
gchar *name = NULL;
426
return_vals = gimp_run_procedure ("gimp_get_path_by_tattoo",
428
GIMP_PDB_IMAGE, image_ID,
429
GIMP_PDB_INT32, tattoo,
400
return_vals = gimp_run_procedure ("gimp-get-path-by-tattoo",
402
GIMP_PDB_IMAGE, image_ID,
403
GIMP_PDB_INT32, tattoo,
432
406
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
433
407
name = g_strdup (return_vals[1].data.d_string);
442
416
* @image_ID: The image.
443
417
* @name: The name of the path whose locked status should be obtained.
445
* Returns the locked status associated with the named path.
447
* This procedure returns the lock status associated with the specified
448
* path. A path can be \"locked\" which means that the transformation
449
* tool operations will also apply to the path.
451
* Returns: The lock status associated with the name path. 0 is returned if the path is not locked. 1 is returned if the path is locked.
419
* This procedure is deprecated! Use gimp_vectors_get_linked() instead.
421
* Returns: TRUE if the path is locked, FALSE otherwise.
454
424
gimp_path_get_locked (gint32 image_ID,
457
427
GimpParam *return_vals;
458
428
gint nreturn_vals;
429
gboolean locked = FALSE;
461
return_vals = gimp_run_procedure ("gimp_path_get_locked",
463
GIMP_PDB_IMAGE, image_ID,
464
GIMP_PDB_STRING, name,
431
return_vals = gimp_run_procedure ("gimp-path-get-locked",
433
GIMP_PDB_IMAGE, image_ID,
434
GIMP_PDB_STRING, name,
467
437
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
468
lockstatus = return_vals[1].data.d_int32;
438
locked = return_vals[1].data.d_int32;
470
440
gimp_destroy_params (return_vals, nreturn_vals);
476
446
* gimp_path_set_locked:
477
447
* @image_ID: The image.
478
448
* @name: the name of the path whose locked status should be set.
479
* @lockstatus: The lock status associated with the name path. 0 if the path is not locked. 1 if the path is to be locked.
481
* Set the locked status associated with the named path.
483
* This procedure sets the lock status associated with the specified
484
* path. A path can be \"locked\" which means that the transformation
485
* tool operations will also apply to the path.
449
* @locked: Whether the path is locked.
451
* This procedure is deprecated! Use gimp_vectors_set_linked() instead.
487
453
* Returns: TRUE on success.
490
456
gimp_path_set_locked (gint32 image_ID,
494
460
GimpParam *return_vals;
495
461
gint nreturn_vals;
496
462
gboolean success = TRUE;
498
return_vals = gimp_run_procedure ("gimp_path_set_locked",
500
GIMP_PDB_IMAGE, image_ID,
501
GIMP_PDB_STRING, name,
502
GIMP_PDB_INT32, lockstatus,
464
return_vals = gimp_run_procedure ("gimp-path-set-locked",
466
GIMP_PDB_IMAGE, image_ID,
467
GIMP_PDB_STRING, name,
468
GIMP_PDB_INT32, locked,
505
471
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
519
485
* @feather_radius_x: Feather radius x.
520
486
* @feather_radius_y: Feather radius y.
522
* Transforms the active path into a selection
524
* This procedure renders the desired path into the current selection.
488
* This procedure is deprecated! Use gimp_vectors_to_selection()
526
491
* Returns: TRUE on success.
529
494
gimp_path_to_selection (gint32 image_ID,
534
gdouble feather_radius_x,
535
gdouble feather_radius_y)
499
gdouble feather_radius_x,
500
gdouble feather_radius_y)
537
502
GimpParam *return_vals;
538
503
gint nreturn_vals;
539
504
gboolean success = TRUE;
541
return_vals = gimp_run_procedure ("gimp_path_to_selection",
543
GIMP_PDB_IMAGE, image_ID,
544
GIMP_PDB_STRING, name,
546
GIMP_PDB_INT32, antialias,
547
GIMP_PDB_INT32, feather,
548
GIMP_PDB_FLOAT, feather_radius_x,
549
GIMP_PDB_FLOAT, feather_radius_y,
506
return_vals = gimp_run_procedure ("gimp-path-to-selection",
508
GIMP_PDB_IMAGE, image_ID,
509
GIMP_PDB_STRING, name,
511
GIMP_PDB_INT32, antialias,
512
GIMP_PDB_INT32, feather,
513
GIMP_PDB_FLOAT, feather_radius_x,
514
GIMP_PDB_FLOAT, feather_radius_y,
552
517
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
563
528
* @merge: Merge paths into a single vectors object.
564
529
* @scale: Scale the SVG to image dimensions.
566
* Import paths from an SVG file.
568
* This procedure imports paths from an SVG file. This is a temporary
569
* solution until the new vectors PDB API is in place. Don't rely on
570
* this function being available in future GIMP releases.
531
* This procedure is deprecated! Use vectors_import_from_file()
572
534
* Returns: TRUE on success.
575
537
gimp_path_import (gint32 image_ID,
576
const gchar *filename,
538
const gchar *filename,
580
542
GimpParam *return_vals;
581
543
gint nreturn_vals;
582
544
gboolean success = TRUE;
584
return_vals = gimp_run_procedure ("gimp_path_import",
586
GIMP_PDB_IMAGE, image_ID,
587
GIMP_PDB_STRING, filename,
588
GIMP_PDB_INT32, merge,
589
GIMP_PDB_INT32, scale,
546
return_vals = gimp_run_procedure ("gimp-path-import",
548
GIMP_PDB_IMAGE, image_ID,
549
GIMP_PDB_STRING, filename,
550
GIMP_PDB_INT32, merge,
551
GIMP_PDB_INT32, scale,
592
554
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;