1
/* GIMP - The GNU Image Manipulation Program
2
* Copyright (C) 1995-2003 Spencer Kimball and Peter Mattis
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 2 of the License, or
7
* (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19
/* NOTE: This file is auto-generated by pdbgen.pl. */
25
#include <glib-object.h>
27
#include "pdb-types.h"
29
#include "core/gimpchannel-select.h"
30
#include "core/gimpimage.h"
31
#include "core/gimplayer.h"
32
#include "core/gimplist.h"
33
#include "core/gimpparamspecs.h"
34
#include "text/gimptext-vectors.h"
35
#include "text/gimptextlayer.h"
36
#include "vectors/gimpanchor.h"
37
#include "vectors/gimpbezierstroke.h"
38
#include "vectors/gimpstroke-new.h"
39
#include "vectors/gimpvectors-export.h"
40
#include "vectors/gimpvectors-import.h"
41
#include "vectors/gimpvectors.h"
44
#include "gimppdb-utils.h"
45
#include "gimpprocedure.h"
46
#include "internal-procs.h"
48
#include "gimp-intl.h"
52
vectors_is_valid_invoker (GimpProcedure *procedure,
55
GimpProgress *progress,
56
const GValueArray *args,
59
GValueArray *return_vals;
61
gboolean valid = FALSE;
63
vectors = gimp_value_get_vectors (&args->values[0], gimp);
65
valid = (GIMP_IS_VECTORS (vectors) &&
66
! gimp_item_is_removed (GIMP_ITEM (vectors)));
68
return_vals = gimp_procedure_get_return_values (procedure, TRUE, NULL);
69
g_value_set_boolean (&return_vals->values[1], valid);
75
vectors_new_invoker (GimpProcedure *procedure,
78
GimpProgress *progress,
79
const GValueArray *args,
82
gboolean success = TRUE;
83
GValueArray *return_vals;
86
GimpVectors *vectors = NULL;
88
image = gimp_value_get_image (&args->values[0], gimp);
89
name = g_value_get_string (&args->values[1]);
93
vectors = gimp_vectors_new (image, name);
96
return_vals = gimp_procedure_get_return_values (procedure, success,
97
error ? *error : NULL);
100
gimp_value_set_vectors (&return_vals->values[1], vectors);
106
vectors_new_from_text_layer_invoker (GimpProcedure *procedure,
108
GimpContext *context,
109
GimpProgress *progress,
110
const GValueArray *args,
113
gboolean success = TRUE;
114
GValueArray *return_vals;
117
GimpVectors *vectors = NULL;
119
image = gimp_value_get_image (&args->values[0], gimp);
120
layer = gimp_value_get_layer (&args->values[1], gimp);
124
if (gimp_pdb_layer_is_text_layer (layer, error))
128
vectors = gimp_text_vectors_new (image,
129
gimp_text_layer_get_text (GIMP_TEXT_LAYER (layer)));
131
gimp_item_offsets (GIMP_ITEM (layer), &x, &y);
132
gimp_item_translate (GIMP_ITEM (vectors), x, y, FALSE);
140
return_vals = gimp_procedure_get_return_values (procedure, success,
141
error ? *error : NULL);
144
gimp_value_set_vectors (&return_vals->values[1], vectors);
150
vectors_copy_invoker (GimpProcedure *procedure,
152
GimpContext *context,
153
GimpProgress *progress,
154
const GValueArray *args,
157
gboolean success = TRUE;
158
GValueArray *return_vals;
159
GimpVectors *vectors;
160
GimpVectors *vectors_copy = NULL;
162
vectors = gimp_value_get_vectors (&args->values[0], gimp);
166
vectors_copy = GIMP_VECTORS (gimp_item_duplicate (GIMP_ITEM (vectors),
167
G_TYPE_FROM_INSTANCE (vectors)));
173
return_vals = gimp_procedure_get_return_values (procedure, success,
174
error ? *error : NULL);
177
gimp_value_set_vectors (&return_vals->values[1], vectors_copy);
183
vectors_get_image_invoker (GimpProcedure *procedure,
185
GimpContext *context,
186
GimpProgress *progress,
187
const GValueArray *args,
190
gboolean success = TRUE;
191
GValueArray *return_vals;
192
GimpVectors *vectors;
193
GimpImage *image = NULL;
195
vectors = gimp_value_get_vectors (&args->values[0], gimp);
199
image = gimp_item_get_image (GIMP_ITEM (vectors));
202
return_vals = gimp_procedure_get_return_values (procedure, success,
203
error ? *error : NULL);
206
gimp_value_set_image (&return_vals->values[1], image);
212
vectors_get_name_invoker (GimpProcedure *procedure,
214
GimpContext *context,
215
GimpProgress *progress,
216
const GValueArray *args,
219
gboolean success = TRUE;
220
GValueArray *return_vals;
221
GimpVectors *vectors;
224
vectors = gimp_value_get_vectors (&args->values[0], gimp);
228
name = g_strdup (gimp_object_get_name (GIMP_OBJECT (vectors)));
231
return_vals = gimp_procedure_get_return_values (procedure, success,
232
error ? *error : NULL);
235
g_value_take_string (&return_vals->values[1], name);
241
vectors_set_name_invoker (GimpProcedure *procedure,
243
GimpContext *context,
244
GimpProgress *progress,
245
const GValueArray *args,
248
gboolean success = TRUE;
249
GimpVectors *vectors;
252
vectors = gimp_value_get_vectors (&args->values[0], gimp);
253
name = g_value_get_string (&args->values[1]);
257
success = gimp_item_rename (GIMP_ITEM (vectors), name, error);
260
return gimp_procedure_get_return_values (procedure, success,
261
error ? *error : NULL);
265
vectors_get_visible_invoker (GimpProcedure *procedure,
267
GimpContext *context,
268
GimpProgress *progress,
269
const GValueArray *args,
272
gboolean success = TRUE;
273
GValueArray *return_vals;
274
GimpVectors *vectors;
275
gboolean visible = FALSE;
277
vectors = gimp_value_get_vectors (&args->values[0], gimp);
281
visible = gimp_item_get_visible (GIMP_ITEM (vectors));
284
return_vals = gimp_procedure_get_return_values (procedure, success,
285
error ? *error : NULL);
288
g_value_set_boolean (&return_vals->values[1], visible);
294
vectors_set_visible_invoker (GimpProcedure *procedure,
296
GimpContext *context,
297
GimpProgress *progress,
298
const GValueArray *args,
301
gboolean success = TRUE;
302
GimpVectors *vectors;
305
vectors = gimp_value_get_vectors (&args->values[0], gimp);
306
visible = g_value_get_boolean (&args->values[1]);
310
gimp_item_set_visible (GIMP_ITEM (vectors), visible, TRUE);
313
return gimp_procedure_get_return_values (procedure, success,
314
error ? *error : NULL);
318
vectors_get_linked_invoker (GimpProcedure *procedure,
320
GimpContext *context,
321
GimpProgress *progress,
322
const GValueArray *args,
325
gboolean success = TRUE;
326
GValueArray *return_vals;
327
GimpVectors *vectors;
328
gboolean linked = FALSE;
330
vectors = gimp_value_get_vectors (&args->values[0], gimp);
334
linked = gimp_item_get_linked (GIMP_ITEM (vectors));
337
return_vals = gimp_procedure_get_return_values (procedure, success,
338
error ? *error : NULL);
341
g_value_set_boolean (&return_vals->values[1], linked);
347
vectors_set_linked_invoker (GimpProcedure *procedure,
349
GimpContext *context,
350
GimpProgress *progress,
351
const GValueArray *args,
354
gboolean success = TRUE;
355
GimpVectors *vectors;
358
vectors = gimp_value_get_vectors (&args->values[0], gimp);
359
linked = g_value_get_boolean (&args->values[1]);
363
gimp_item_set_linked (GIMP_ITEM (vectors), linked, TRUE);
366
return gimp_procedure_get_return_values (procedure, success,
367
error ? *error : NULL);
371
vectors_get_tattoo_invoker (GimpProcedure *procedure,
373
GimpContext *context,
374
GimpProgress *progress,
375
const GValueArray *args,
378
gboolean success = TRUE;
379
GValueArray *return_vals;
380
GimpVectors *vectors;
383
vectors = gimp_value_get_vectors (&args->values[0], gimp);
387
tattoo = gimp_item_get_tattoo (GIMP_ITEM (vectors));
390
return_vals = gimp_procedure_get_return_values (procedure, success,
391
error ? *error : NULL);
394
g_value_set_int (&return_vals->values[1], tattoo);
400
vectors_set_tattoo_invoker (GimpProcedure *procedure,
402
GimpContext *context,
403
GimpProgress *progress,
404
const GValueArray *args,
407
gboolean success = TRUE;
408
GimpVectors *vectors;
411
vectors = gimp_value_get_vectors (&args->values[0], gimp);
412
tattoo = g_value_get_int (&args->values[1]);
416
gimp_item_set_tattoo (GIMP_ITEM (vectors), tattoo);
419
return gimp_procedure_get_return_values (procedure, success,
420
error ? *error : NULL);
424
vectors_get_strokes_invoker (GimpProcedure *procedure,
426
GimpContext *context,
427
GimpProgress *progress,
428
const GValueArray *args,
431
gboolean success = TRUE;
432
GValueArray *return_vals;
433
GimpVectors *vectors;
434
gint32 num_strokes = 0;
435
gint32 *stroke_ids = NULL;
437
vectors = gimp_value_get_vectors (&args->values[0], gimp);
441
num_strokes = gimp_vectors_get_n_strokes (vectors);
445
GimpStroke *cur_stroke;
448
stroke_ids = g_new (gint32, num_strokes);
450
for (cur_stroke = gimp_vectors_stroke_get_next (vectors, NULL);
452
cur_stroke = gimp_vectors_stroke_get_next (vectors, cur_stroke))
454
stroke_ids[i] = gimp_stroke_get_ID (cur_stroke);
460
return_vals = gimp_procedure_get_return_values (procedure, success,
461
error ? *error : NULL);
465
g_value_set_int (&return_vals->values[1], num_strokes);
466
gimp_value_take_int32array (&return_vals->values[2], stroke_ids, num_strokes);
473
vectors_stroke_get_length_invoker (GimpProcedure *procedure,
475
GimpContext *context,
476
GimpProgress *progress,
477
const GValueArray *args,
480
gboolean success = TRUE;
481
GValueArray *return_vals;
482
GimpVectors *vectors;
485
gdouble length = 0.0;
487
vectors = gimp_value_get_vectors (&args->values[0], gimp);
488
stroke_id = g_value_get_int (&args->values[1]);
489
precision = g_value_get_double (&args->values[2]);
493
GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, error);
496
length = gimp_stroke_get_length (stroke, precision);
501
return_vals = gimp_procedure_get_return_values (procedure, success,
502
error ? *error : NULL);
505
g_value_set_double (&return_vals->values[1], length);
511
vectors_stroke_get_point_at_dist_invoker (GimpProcedure *procedure,
513
GimpContext *context,
514
GimpProgress *progress,
515
const GValueArray *args,
518
gboolean success = TRUE;
519
GValueArray *return_vals;
520
GimpVectors *vectors;
524
gdouble x_point = 0.0;
525
gdouble y_point = 0.0;
527
gboolean valid = FALSE;
529
vectors = gimp_value_get_vectors (&args->values[0], gimp);
530
stroke_id = g_value_get_int (&args->values[1]);
531
dist = g_value_get_double (&args->values[2]);
532
precision = g_value_get_double (&args->values[3]);
536
GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, error);
542
valid = gimp_stroke_get_point_at_dist (stroke, dist, precision,
544
x_point = valid ? coord.x : 0;
545
y_point = valid ? coord.y : 0;
551
return_vals = gimp_procedure_get_return_values (procedure, success,
552
error ? *error : NULL);
556
g_value_set_double (&return_vals->values[1], x_point);
557
g_value_set_double (&return_vals->values[2], y_point);
558
g_value_set_double (&return_vals->values[3], slope);
559
g_value_set_boolean (&return_vals->values[4], valid);
566
vectors_remove_stroke_invoker (GimpProcedure *procedure,
568
GimpContext *context,
569
GimpProgress *progress,
570
const GValueArray *args,
573
gboolean success = TRUE;
574
GimpVectors *vectors;
577
vectors = gimp_value_get_vectors (&args->values[0], gimp);
578
stroke_id = g_value_get_int (&args->values[1]);
582
GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, error);
585
gimp_vectors_stroke_remove (vectors, stroke);
590
return gimp_procedure_get_return_values (procedure, success,
591
error ? *error : NULL);
595
vectors_stroke_close_invoker (GimpProcedure *procedure,
597
GimpContext *context,
598
GimpProgress *progress,
599
const GValueArray *args,
602
gboolean success = TRUE;
603
GimpVectors *vectors;
606
vectors = gimp_value_get_vectors (&args->values[0], gimp);
607
stroke_id = g_value_get_int (&args->values[1]);
611
GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, error);
614
gimp_stroke_close (stroke);
619
return gimp_procedure_get_return_values (procedure, success,
620
error ? *error : NULL);
624
vectors_stroke_translate_invoker (GimpProcedure *procedure,
626
GimpContext *context,
627
GimpProgress *progress,
628
const GValueArray *args,
631
gboolean success = TRUE;
632
GimpVectors *vectors;
637
vectors = gimp_value_get_vectors (&args->values[0], gimp);
638
stroke_id = g_value_get_int (&args->values[1]);
639
off_x = g_value_get_int (&args->values[2]);
640
off_y = g_value_get_int (&args->values[3]);
644
GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, error);
647
gimp_stroke_translate (stroke, off_x, off_y);
652
return gimp_procedure_get_return_values (procedure, success,
653
error ? *error : NULL);
657
vectors_stroke_scale_invoker (GimpProcedure *procedure,
659
GimpContext *context,
660
GimpProgress *progress,
661
const GValueArray *args,
664
gboolean success = TRUE;
665
GimpVectors *vectors;
670
vectors = gimp_value_get_vectors (&args->values[0], gimp);
671
stroke_id = g_value_get_int (&args->values[1]);
672
scale_x = g_value_get_double (&args->values[2]);
673
scale_y = g_value_get_double (&args->values[3]);
677
GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, error);
680
gimp_stroke_scale (stroke, scale_x, scale_y);
685
return gimp_procedure_get_return_values (procedure, success,
686
error ? *error : NULL);
690
vectors_stroke_rotate_invoker (GimpProcedure *procedure,
692
GimpContext *context,
693
GimpProgress *progress,
694
const GValueArray *args,
697
gboolean success = TRUE;
698
GimpVectors *vectors;
704
vectors = gimp_value_get_vectors (&args->values[0], gimp);
705
stroke_id = g_value_get_int (&args->values[1]);
706
center_x = g_value_get_double (&args->values[2]);
707
center_y = g_value_get_double (&args->values[3]);
708
angle = g_value_get_double (&args->values[4]);
712
GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, error);
715
gimp_stroke_rotate (stroke, center_x, center_y, angle);
720
return gimp_procedure_get_return_values (procedure, success,
721
error ? *error : NULL);
725
vectors_stroke_flip_invoker (GimpProcedure *procedure,
727
GimpContext *context,
728
GimpProgress *progress,
729
const GValueArray *args,
732
gboolean success = TRUE;
733
GimpVectors *vectors;
738
vectors = gimp_value_get_vectors (&args->values[0], gimp);
739
stroke_id = g_value_get_int (&args->values[1]);
740
flip_type = g_value_get_enum (&args->values[2]);
741
axis = g_value_get_double (&args->values[3]);
745
GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, error);
748
gimp_stroke_flip (stroke, flip_type, axis);
753
return gimp_procedure_get_return_values (procedure, success,
754
error ? *error : NULL);
758
vectors_stroke_flip_free_invoker (GimpProcedure *procedure,
760
GimpContext *context,
761
GimpProgress *progress,
762
const GValueArray *args,
765
gboolean success = TRUE;
766
GimpVectors *vectors;
773
vectors = gimp_value_get_vectors (&args->values[0], gimp);
774
stroke_id = g_value_get_int (&args->values[1]);
775
x1 = g_value_get_double (&args->values[2]);
776
y1 = g_value_get_double (&args->values[3]);
777
x2 = g_value_get_double (&args->values[4]);
778
y2 = g_value_get_double (&args->values[5]);
782
GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, error);
785
gimp_stroke_flip_free (stroke, x1, y1, x2, y2);
790
return gimp_procedure_get_return_values (procedure, success,
791
error ? *error : NULL);
795
vectors_stroke_get_points_invoker (GimpProcedure *procedure,
797
GimpContext *context,
798
GimpProgress *progress,
799
const GValueArray *args,
802
gboolean success = TRUE;
803
GValueArray *return_vals;
804
GimpVectors *vectors;
807
gint32 num_points = 0;
808
gdouble *controlpoints = NULL;
809
gboolean closed = FALSE;
811
vectors = gimp_value_get_vectors (&args->values[0], gimp);
812
stroke_id = g_value_get_int (&args->values[1]);
816
GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, error);
818
if (GIMP_IS_BEZIER_STROKE (stroke))
820
GArray *points_array;
823
points_array = gimp_stroke_control_points_get (stroke, &closed);
827
num_points = points_array->len;
828
controlpoints = g_new (gdouble, num_points * 2);
830
type = GIMP_VECTORS_STROKE_TYPE_BEZIER;
831
for (i = 0; i < num_points; i++)
833
controlpoints[2*i] = g_array_index (points_array,
834
GimpAnchor, i).position.x;
835
controlpoints[2*i+1] = g_array_index (points_array,
836
GimpAnchor, i).position.y;
838
g_array_free (points_array, TRUE);
848
return_vals = gimp_procedure_get_return_values (procedure, success,
849
error ? *error : NULL);
853
g_value_set_enum (&return_vals->values[1], type);
854
g_value_set_int (&return_vals->values[2], num_points);
855
gimp_value_take_floatarray (&return_vals->values[3], controlpoints, num_points);
856
g_value_set_boolean (&return_vals->values[4], closed);
863
vectors_stroke_new_from_points_invoker (GimpProcedure *procedure,
865
GimpContext *context,
866
GimpProgress *progress,
867
const GValueArray *args,
870
gboolean success = TRUE;
871
GValueArray *return_vals;
872
GimpVectors *vectors;
875
const gdouble *controlpoints;
877
gint32 stroke_id = 0;
879
vectors = gimp_value_get_vectors (&args->values[0], gimp);
880
type = g_value_get_enum (&args->values[1]);
881
num_points = g_value_get_int (&args->values[2]);
882
controlpoints = gimp_value_get_floatarray (&args->values[3]);
883
closed = g_value_get_boolean (&args->values[4]);
889
GimpCoords default_coords = GIMP_COORDS_DEFAULT_VALUES;
894
if (type == GIMP_VECTORS_STROKE_TYPE_BEZIER &&
897
coords = g_new (GimpCoords, num_points/2);
898
for (i = 0; i < num_points/2; i++)
900
coords[i] = default_coords;
901
coords[i].x = controlpoints[i*2];
902
coords[i].y = controlpoints[i*2+1];
905
stroke = gimp_stroke_new_from_coords (type, coords, num_points/2, closed);
908
gimp_vectors_stroke_add (vectors, stroke);
909
stroke_id = gimp_stroke_get_ID (stroke);
918
return_vals = gimp_procedure_get_return_values (procedure, success,
919
error ? *error : NULL);
922
g_value_set_int (&return_vals->values[1], stroke_id);
928
vectors_stroke_interpolate_invoker (GimpProcedure *procedure,
930
GimpContext *context,
931
GimpProgress *progress,
932
const GValueArray *args,
935
gboolean success = TRUE;
936
GValueArray *return_vals;
937
GimpVectors *vectors;
940
gint32 num_coords = 0;
941
gdouble *coords = NULL;
942
gboolean closed = FALSE;
944
vectors = gimp_value_get_vectors (&args->values[0], gimp);
945
stroke_id = g_value_get_int (&args->values[1]);
946
precision = g_value_get_double (&args->values[2]);
950
GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, error);
954
GArray *coords_array;
957
coords_array = gimp_stroke_interpolate (stroke, precision, &closed);
961
num_coords = coords_array->len;
962
coords = g_new (gdouble, num_coords * 2);
964
for (i = 0; i < num_coords; i++)
966
coords[2*i] = g_array_index (coords_array, GimpCoords, i).x;
967
coords[2*i+1] = g_array_index (coords_array, GimpCoords, i).y;
969
g_array_free (coords_array, TRUE);
979
return_vals = gimp_procedure_get_return_values (procedure, success,
980
error ? *error : NULL);
984
g_value_set_int (&return_vals->values[1], num_coords);
985
gimp_value_take_floatarray (&return_vals->values[2], coords, num_coords);
986
g_value_set_boolean (&return_vals->values[3], closed);
993
vectors_bezier_stroke_new_moveto_invoker (GimpProcedure *procedure,
995
GimpContext *context,
996
GimpProgress *progress,
997
const GValueArray *args,
1000
gboolean success = TRUE;
1001
GValueArray *return_vals;
1002
GimpVectors *vectors;
1005
gint32 stroke_id = 0;
1007
vectors = gimp_value_get_vectors (&args->values[0], gimp);
1008
x0 = g_value_get_double (&args->values[1]);
1009
y0 = g_value_get_double (&args->values[2]);
1014
GimpCoords coord0 = GIMP_COORDS_DEFAULT_VALUES;
1019
stroke = gimp_bezier_stroke_new_moveto (&coord0);
1020
gimp_vectors_stroke_add (vectors, stroke);
1021
stroke_id = gimp_stroke_get_ID (stroke);
1024
return_vals = gimp_procedure_get_return_values (procedure, success,
1025
error ? *error : NULL);
1028
g_value_set_int (&return_vals->values[1], stroke_id);
1033
static GValueArray *
1034
vectors_bezier_stroke_lineto_invoker (GimpProcedure *procedure,
1036
GimpContext *context,
1037
GimpProgress *progress,
1038
const GValueArray *args,
1041
gboolean success = TRUE;
1042
GimpVectors *vectors;
1047
vectors = gimp_value_get_vectors (&args->values[0], gimp);
1048
stroke_id = g_value_get_int (&args->values[1]);
1049
x0 = g_value_get_double (&args->values[2]);
1050
y0 = g_value_get_double (&args->values[3]);
1054
GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, error);
1058
GimpCoords coord0 = GIMP_COORDS_DEFAULT_VALUES;
1063
gimp_bezier_stroke_lineto (stroke, &coord0);
1069
return gimp_procedure_get_return_values (procedure, success,
1070
error ? *error : NULL);
1073
static GValueArray *
1074
vectors_bezier_stroke_conicto_invoker (GimpProcedure *procedure,
1076
GimpContext *context,
1077
GimpProgress *progress,
1078
const GValueArray *args,
1081
gboolean success = TRUE;
1082
GimpVectors *vectors;
1089
vectors = gimp_value_get_vectors (&args->values[0], gimp);
1090
stroke_id = g_value_get_int (&args->values[1]);
1091
x0 = g_value_get_double (&args->values[2]);
1092
y0 = g_value_get_double (&args->values[3]);
1093
x1 = g_value_get_double (&args->values[4]);
1094
y1 = g_value_get_double (&args->values[5]);
1098
GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, error);
1102
GimpCoords coord0 = GIMP_COORDS_DEFAULT_VALUES;
1103
GimpCoords coord1 = GIMP_COORDS_DEFAULT_VALUES;
1111
gimp_bezier_stroke_conicto (stroke, &coord0, &coord1);
1117
return gimp_procedure_get_return_values (procedure, success,
1118
error ? *error : NULL);
1121
static GValueArray *
1122
vectors_bezier_stroke_cubicto_invoker (GimpProcedure *procedure,
1124
GimpContext *context,
1125
GimpProgress *progress,
1126
const GValueArray *args,
1129
gboolean success = TRUE;
1130
GimpVectors *vectors;
1139
vectors = gimp_value_get_vectors (&args->values[0], gimp);
1140
stroke_id = g_value_get_int (&args->values[1]);
1141
x0 = g_value_get_double (&args->values[2]);
1142
y0 = g_value_get_double (&args->values[3]);
1143
x1 = g_value_get_double (&args->values[4]);
1144
y1 = g_value_get_double (&args->values[5]);
1145
x2 = g_value_get_double (&args->values[6]);
1146
y2 = g_value_get_double (&args->values[7]);
1150
GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, error);
1154
GimpCoords coord0 = GIMP_COORDS_DEFAULT_VALUES;
1155
GimpCoords coord1 = GIMP_COORDS_DEFAULT_VALUES;
1156
GimpCoords coord2 = GIMP_COORDS_DEFAULT_VALUES;
1167
gimp_bezier_stroke_cubicto (stroke, &coord0, &coord1, &coord2);
1173
return gimp_procedure_get_return_values (procedure, success,
1174
error ? *error : NULL);
1177
static GValueArray *
1178
vectors_bezier_stroke_new_ellipse_invoker (GimpProcedure *procedure,
1180
GimpContext *context,
1181
GimpProgress *progress,
1182
const GValueArray *args,
1185
gboolean success = TRUE;
1186
GValueArray *return_vals;
1187
GimpVectors *vectors;
1193
gint32 stroke_id = 0;
1195
vectors = gimp_value_get_vectors (&args->values[0], gimp);
1196
x0 = g_value_get_double (&args->values[1]);
1197
y0 = g_value_get_double (&args->values[2]);
1198
radius_x = g_value_get_double (&args->values[3]);
1199
radius_y = g_value_get_double (&args->values[4]);
1200
angle = g_value_get_double (&args->values[5]);
1205
GimpCoords coord0 = GIMP_COORDS_DEFAULT_VALUES;
1210
stroke = gimp_bezier_stroke_new_ellipse (&coord0, radius_x, radius_y, angle);
1211
gimp_vectors_stroke_add (vectors, stroke);
1212
stroke_id = gimp_stroke_get_ID (stroke);
1215
return_vals = gimp_procedure_get_return_values (procedure, success,
1216
error ? *error : NULL);
1219
g_value_set_int (&return_vals->values[1], stroke_id);
1224
static GValueArray *
1225
vectors_to_selection_invoker (GimpProcedure *procedure,
1227
GimpContext *context,
1228
GimpProgress *progress,
1229
const GValueArray *args,
1232
gboolean success = TRUE;
1233
GimpVectors *vectors;
1237
gdouble feather_radius_x;
1238
gdouble feather_radius_y;
1240
vectors = gimp_value_get_vectors (&args->values[0], gimp);
1241
operation = g_value_get_enum (&args->values[1]);
1242
antialias = g_value_get_boolean (&args->values[2]);
1243
feather = g_value_get_boolean (&args->values[3]);
1244
feather_radius_x = g_value_get_double (&args->values[4]);
1245
feather_radius_y = g_value_get_double (&args->values[5]);
1249
GimpImage *image = gimp_item_get_image (GIMP_ITEM (vectors));
1252
gimp_channel_select_vectors (gimp_image_get_mask (image),
1253
_("Path to Selection"),
1265
return gimp_procedure_get_return_values (procedure, success,
1266
error ? *error : NULL);
1269
static GValueArray *
1270
vectors_import_from_file_invoker (GimpProcedure *procedure,
1272
GimpContext *context,
1273
GimpProgress *progress,
1274
const GValueArray *args,
1277
gboolean success = TRUE;
1278
GValueArray *return_vals;
1280
const gchar *filename;
1283
gint32 num_vectors = 0;
1284
gint32 *vectors_ids = NULL;
1286
image = gimp_value_get_image (&args->values[0], gimp);
1287
filename = g_value_get_string (&args->values[1]);
1288
merge = g_value_get_boolean (&args->values[2]);
1289
scale = g_value_get_boolean (&args->values[3]);
1293
GList *list, *vectors_list = NULL;
1295
success = gimp_vectors_import_file (image, filename,
1296
merge, scale, -1, &vectors_list, error);
1300
num_vectors = g_list_length (vectors_list);
1306
vectors_ids = g_new (gint32, num_vectors);
1308
list = vectors_list;
1309
for (i = 0; i < num_vectors; i++, list = g_list_next (list))
1310
vectors_ids[i] = gimp_item_get_ID (GIMP_ITEM (list->data));
1312
g_list_free (vectors_list);
1317
return_vals = gimp_procedure_get_return_values (procedure, success,
1318
error ? *error : NULL);
1322
g_value_set_int (&return_vals->values[1], num_vectors);
1323
gimp_value_take_int32array (&return_vals->values[2], vectors_ids, num_vectors);
1329
static GValueArray *
1330
vectors_import_from_string_invoker (GimpProcedure *procedure,
1332
GimpContext *context,
1333
GimpProgress *progress,
1334
const GValueArray *args,
1337
gboolean success = TRUE;
1338
GValueArray *return_vals;
1340
const gchar *string;
1344
gint32 num_vectors = 0;
1345
gint32 *vectors_ids = NULL;
1347
image = gimp_value_get_image (&args->values[0], gimp);
1348
string = g_value_get_string (&args->values[1]);
1349
length = g_value_get_int (&args->values[2]);
1350
merge = g_value_get_boolean (&args->values[3]);
1351
scale = g_value_get_boolean (&args->values[4]);
1355
GList *list, *vectors_list = NULL;
1357
success = gimp_vectors_import_buffer (image, string, length,
1358
merge, scale, -1, &vectors_list, error);
1362
num_vectors = g_list_length (vectors_list);
1368
vectors_ids = g_new (gint32, num_vectors);
1370
list = vectors_list;
1371
for (i = 0; i < num_vectors; i++, list = g_list_next (list))
1372
vectors_ids[i] = gimp_item_get_ID (GIMP_ITEM (list->data));
1374
g_list_free (vectors_list);
1379
return_vals = gimp_procedure_get_return_values (procedure, success,
1380
error ? *error : NULL);
1384
g_value_set_int (&return_vals->values[1], num_vectors);
1385
gimp_value_take_int32array (&return_vals->values[2], vectors_ids, num_vectors);
1391
static GValueArray *
1392
vectors_export_to_file_invoker (GimpProcedure *procedure,
1394
GimpContext *context,
1395
GimpProgress *progress,
1396
const GValueArray *args,
1399
gboolean success = TRUE;
1401
const gchar *filename;
1402
GimpVectors *vectors;
1404
image = gimp_value_get_image (&args->values[0], gimp);
1405
filename = g_value_get_string (&args->values[1]);
1406
vectors = gimp_value_get_vectors (&args->values[2], gimp);
1410
success = gimp_vectors_export_file (image, vectors, filename, error);
1413
return gimp_procedure_get_return_values (procedure, success,
1414
error ? *error : NULL);
1417
static GValueArray *
1418
vectors_export_to_string_invoker (GimpProcedure *procedure,
1420
GimpContext *context,
1421
GimpProgress *progress,
1422
const GValueArray *args,
1425
gboolean success = TRUE;
1426
GValueArray *return_vals;
1428
GimpVectors *vectors;
1429
gchar *string = NULL;
1431
image = gimp_value_get_image (&args->values[0], gimp);
1432
vectors = gimp_value_get_vectors (&args->values[1], gimp);
1436
string = gimp_vectors_export_string (image, vectors);
1438
success = (string != NULL);
1441
return_vals = gimp_procedure_get_return_values (procedure, success,
1442
error ? *error : NULL);
1445
g_value_take_string (&return_vals->values[1], string);
1451
register_vectors_procs (GimpPDB *pdb)
1453
GimpProcedure *procedure;
1456
* gimp-vectors-is-valid
1458
procedure = gimp_procedure_new (vectors_is_valid_invoker);
1459
gimp_object_set_static_name (GIMP_OBJECT (procedure),
1460
"gimp-vectors-is-valid");
1461
gimp_procedure_set_static_strings (procedure,
1462
"gimp-vectors-is-valid",
1463
"Returns TRUE if the vectors object is valid.",
1464
"This procedure checks if the given vectors ID is valid and refers to an existing vectors object.",
1465
"Sven Neumann <sven@gimp.org>",
1469
gimp_procedure_add_argument (procedure,
1470
gimp_param_spec_vectors_id ("vectors",
1472
"The vectors object to check",
1474
GIMP_PARAM_READWRITE | GIMP_PARAM_NO_VALIDATE));
1475
gimp_procedure_add_return_value (procedure,
1476
g_param_spec_boolean ("valid",
1478
"Whether the vectors ID is valid",
1480
GIMP_PARAM_READWRITE));
1481
gimp_pdb_register_procedure (pdb, procedure);
1482
g_object_unref (procedure);
1487
procedure = gimp_procedure_new (vectors_new_invoker);
1488
gimp_object_set_static_name (GIMP_OBJECT (procedure),
1489
"gimp-vectors-new");
1490
gimp_procedure_set_static_strings (procedure,
1492
"Creates a new empty vectors object.",
1493
"Creates a new empty vectors object. The vectors object needs to be added to the image using 'gimp-image-add-vectors'.",
1498
gimp_procedure_add_argument (procedure,
1499
gimp_param_spec_image_id ("image",
1503
GIMP_PARAM_READWRITE));
1504
gimp_procedure_add_argument (procedure,
1505
gimp_param_spec_string ("name",
1507
"the name of the new vector object.",
1508
FALSE, FALSE, FALSE,
1510
GIMP_PARAM_READWRITE));
1511
gimp_procedure_add_return_value (procedure,
1512
gimp_param_spec_vectors_id ("vectors",
1514
"the current vector object, 0 if no vector exists in the image.",
1516
GIMP_PARAM_READWRITE));
1517
gimp_pdb_register_procedure (pdb, procedure);
1518
g_object_unref (procedure);
1521
* gimp-vectors-new-from-text-layer
1523
procedure = gimp_procedure_new (vectors_new_from_text_layer_invoker);
1524
gimp_object_set_static_name (GIMP_OBJECT (procedure),
1525
"gimp-vectors-new-from-text-layer");
1526
gimp_procedure_set_static_strings (procedure,
1527
"gimp-vectors-new-from-text-layer",
1528
"Creates a new vectors object from a text layer.",
1529
"Creates a new vectors object from a text layer. The vectors object needs to be added to the image using 'gimp-image-add-vectors'.",
1530
"Marcus Heese <heese@cip.ifi.lmu.de>",
1534
gimp_procedure_add_argument (procedure,
1535
gimp_param_spec_image_id ("image",
1539
GIMP_PARAM_READWRITE));
1540
gimp_procedure_add_argument (procedure,
1541
gimp_param_spec_layer_id ("layer",
1545
GIMP_PARAM_READWRITE));
1546
gimp_procedure_add_return_value (procedure,
1547
gimp_param_spec_vectors_id ("vectors",
1549
"The vectors of the text layer.",
1551
GIMP_PARAM_READWRITE));
1552
gimp_pdb_register_procedure (pdb, procedure);
1553
g_object_unref (procedure);
1558
procedure = gimp_procedure_new (vectors_copy_invoker);
1559
gimp_object_set_static_name (GIMP_OBJECT (procedure),
1560
"gimp-vectors-copy");
1561
gimp_procedure_set_static_strings (procedure,
1562
"gimp-vectors-copy",
1563
"Copy a vectors object.",
1564
"This procedure copies the specified vectors object and returns the copy.",
1565
"Barak Itkin <lightningismyname@gmail.com>",
1569
gimp_procedure_add_argument (procedure,
1570
gimp_param_spec_vectors_id ("vectors",
1572
"The vectors object to copy",
1574
GIMP_PARAM_READWRITE));
1575
gimp_procedure_add_return_value (procedure,
1576
gimp_param_spec_vectors_id ("vectors-copy",
1578
"The newly copied vectors object",
1580
GIMP_PARAM_READWRITE));
1581
gimp_pdb_register_procedure (pdb, procedure);
1582
g_object_unref (procedure);
1585
* gimp-vectors-get-image
1587
procedure = gimp_procedure_new (vectors_get_image_invoker);
1588
gimp_object_set_static_name (GIMP_OBJECT (procedure),
1589
"gimp-vectors-get-image");
1590
gimp_procedure_set_static_strings (procedure,
1591
"gimp-vectors-get-image",
1592
"Returns the vectors objects image.",
1593
"Returns the vectors objects image.",
1598
gimp_procedure_add_argument (procedure,
1599
gimp_param_spec_vectors_id ("vectors",
1601
"The vectors object",
1603
GIMP_PARAM_READWRITE));
1604
gimp_procedure_add_return_value (procedure,
1605
gimp_param_spec_image_id ("image",
1607
"The vectors image",
1609
GIMP_PARAM_READWRITE));
1610
gimp_pdb_register_procedure (pdb, procedure);
1611
g_object_unref (procedure);
1614
* gimp-vectors-get-name
1616
procedure = gimp_procedure_new (vectors_get_name_invoker);
1617
gimp_object_set_static_name (GIMP_OBJECT (procedure),
1618
"gimp-vectors-get-name");
1619
gimp_procedure_set_static_strings (procedure,
1620
"gimp-vectors-get-name",
1621
"Gets the name of the vectors object.",
1622
"Gets the name of the vectors object.",
1627
gimp_procedure_add_argument (procedure,
1628
gimp_param_spec_vectors_id ("vectors",
1630
"The vectors object",
1632
GIMP_PARAM_READWRITE));
1633
gimp_procedure_add_return_value (procedure,
1634
gimp_param_spec_string ("name",
1636
"The name of the vectors object",
1637
FALSE, FALSE, FALSE,
1639
GIMP_PARAM_READWRITE));
1640
gimp_pdb_register_procedure (pdb, procedure);
1641
g_object_unref (procedure);
1644
* gimp-vectors-set-name
1646
procedure = gimp_procedure_new (vectors_set_name_invoker);
1647
gimp_object_set_static_name (GIMP_OBJECT (procedure),
1648
"gimp-vectors-set-name");
1649
gimp_procedure_set_static_strings (procedure,
1650
"gimp-vectors-set-name",
1651
"Sets the name of the vectors object.",
1652
"Sets the name of the vectors object.",
1657
gimp_procedure_add_argument (procedure,
1658
gimp_param_spec_vectors_id ("vectors",
1660
"The vectors object",
1662
GIMP_PARAM_READWRITE));
1663
gimp_procedure_add_argument (procedure,
1664
gimp_param_spec_string ("name",
1666
"the new name of the path",
1667
FALSE, FALSE, FALSE,
1669
GIMP_PARAM_READWRITE));
1670
gimp_pdb_register_procedure (pdb, procedure);
1671
g_object_unref (procedure);
1674
* gimp-vectors-get-visible
1676
procedure = gimp_procedure_new (vectors_get_visible_invoker);
1677
gimp_object_set_static_name (GIMP_OBJECT (procedure),
1678
"gimp-vectors-get-visible");
1679
gimp_procedure_set_static_strings (procedure,
1680
"gimp-vectors-get-visible",
1681
"Gets the visibility of the vectors object.",
1682
"Gets the visibility of the vectors object.",
1687
gimp_procedure_add_argument (procedure,
1688
gimp_param_spec_vectors_id ("vectors",
1690
"The vectors object",
1692
GIMP_PARAM_READWRITE));
1693
gimp_procedure_add_return_value (procedure,
1694
g_param_spec_boolean ("visible",
1696
"TRUE if the path is visible, FALSE otherwise",
1698
GIMP_PARAM_READWRITE));
1699
gimp_pdb_register_procedure (pdb, procedure);
1700
g_object_unref (procedure);
1703
* gimp-vectors-set-visible
1705
procedure = gimp_procedure_new (vectors_set_visible_invoker);
1706
gimp_object_set_static_name (GIMP_OBJECT (procedure),
1707
"gimp-vectors-set-visible");
1708
gimp_procedure_set_static_strings (procedure,
1709
"gimp-vectors-set-visible",
1710
"Sets the visibility of the vectors object.",
1711
"Sets the visibility of the vectors object.",
1716
gimp_procedure_add_argument (procedure,
1717
gimp_param_spec_vectors_id ("vectors",
1719
"The vectors object",
1721
GIMP_PARAM_READWRITE));
1722
gimp_procedure_add_argument (procedure,
1723
g_param_spec_boolean ("visible",
1725
"Whether the path is visible",
1727
GIMP_PARAM_READWRITE));
1728
gimp_pdb_register_procedure (pdb, procedure);
1729
g_object_unref (procedure);
1732
* gimp-vectors-get-linked
1734
procedure = gimp_procedure_new (vectors_get_linked_invoker);
1735
gimp_object_set_static_name (GIMP_OBJECT (procedure),
1736
"gimp-vectors-get-linked");
1737
gimp_procedure_set_static_strings (procedure,
1738
"gimp-vectors-get-linked",
1739
"Gets the linked state of the vectors object.",
1740
"Gets the linked state of the vectors object.",
1745
gimp_procedure_add_argument (procedure,
1746
gimp_param_spec_vectors_id ("vectors",
1748
"The vectors object",
1750
GIMP_PARAM_READWRITE));
1751
gimp_procedure_add_return_value (procedure,
1752
g_param_spec_boolean ("linked",
1754
"TRUE if the path is linked, FALSE otherwise",
1756
GIMP_PARAM_READWRITE));
1757
gimp_pdb_register_procedure (pdb, procedure);
1758
g_object_unref (procedure);
1761
* gimp-vectors-set-linked
1763
procedure = gimp_procedure_new (vectors_set_linked_invoker);
1764
gimp_object_set_static_name (GIMP_OBJECT (procedure),
1765
"gimp-vectors-set-linked");
1766
gimp_procedure_set_static_strings (procedure,
1767
"gimp-vectors-set-linked",
1768
"Sets the linked state of the vectors object.",
1769
"Sets the linked state of the vectors object.",
1774
gimp_procedure_add_argument (procedure,
1775
gimp_param_spec_vectors_id ("vectors",
1777
"The vectors object",
1779
GIMP_PARAM_READWRITE));
1780
gimp_procedure_add_argument (procedure,
1781
g_param_spec_boolean ("linked",
1783
"Whether the path is linked",
1785
GIMP_PARAM_READWRITE));
1786
gimp_pdb_register_procedure (pdb, procedure);
1787
g_object_unref (procedure);
1790
* gimp-vectors-get-tattoo
1792
procedure = gimp_procedure_new (vectors_get_tattoo_invoker);
1793
gimp_object_set_static_name (GIMP_OBJECT (procedure),
1794
"gimp-vectors-get-tattoo");
1795
gimp_procedure_set_static_strings (procedure,
1796
"gimp-vectors-get-tattoo",
1797
"Get the tattoo of the vectors object.",
1798
"Get the tattoo state of the vectors object.",
1803
gimp_procedure_add_argument (procedure,
1804
gimp_param_spec_vectors_id ("vectors",
1806
"The vectors object",
1808
GIMP_PARAM_READWRITE));
1809
gimp_procedure_add_return_value (procedure,
1810
gimp_param_spec_int32 ("tattoo",
1812
"The vectors tattoo",
1813
G_MININT32, G_MAXINT32, 0,
1814
GIMP_PARAM_READWRITE));
1815
gimp_pdb_register_procedure (pdb, procedure);
1816
g_object_unref (procedure);
1819
* gimp-vectors-set-tattoo
1821
procedure = gimp_procedure_new (vectors_set_tattoo_invoker);
1822
gimp_object_set_static_name (GIMP_OBJECT (procedure),
1823
"gimp-vectors-set-tattoo");
1824
gimp_procedure_set_static_strings (procedure,
1825
"gimp-vectors-set-tattoo",
1826
"Set the tattoo of the vectors object.",
1827
"Set the tattoo of the vectors object.",
1832
gimp_procedure_add_argument (procedure,
1833
gimp_param_spec_vectors_id ("vectors",
1835
"The vectors object",
1837
GIMP_PARAM_READWRITE));
1838
gimp_procedure_add_argument (procedure,
1839
gimp_param_spec_int32 ("tattoo",
1842
G_MININT32, G_MAXINT32, 0,
1843
GIMP_PARAM_READWRITE));
1844
gimp_pdb_register_procedure (pdb, procedure);
1845
g_object_unref (procedure);
1848
* gimp-vectors-get-strokes
1850
procedure = gimp_procedure_new (vectors_get_strokes_invoker);
1851
gimp_object_set_static_name (GIMP_OBJECT (procedure),
1852
"gimp-vectors-get-strokes");
1853
gimp_procedure_set_static_strings (procedure,
1854
"gimp-vectors-get-strokes",
1855
"List the strokes associated with the passed path.",
1856
"Returns an Array with the stroke-IDs associated with the passed path.",
1861
gimp_procedure_add_argument (procedure,
1862
gimp_param_spec_vectors_id ("vectors",
1864
"The vectors object",
1866
GIMP_PARAM_READWRITE));
1867
gimp_procedure_add_return_value (procedure,
1868
gimp_param_spec_int32 ("num-strokes",
1870
"The number of strokes returned.",
1872
GIMP_PARAM_READWRITE));
1873
gimp_procedure_add_return_value (procedure,
1874
gimp_param_spec_int32_array ("stroke-ids",
1876
"List of the strokes belonging to the path.",
1877
GIMP_PARAM_READWRITE));
1878
gimp_pdb_register_procedure (pdb, procedure);
1879
g_object_unref (procedure);
1882
* gimp-vectors-stroke-get-length
1884
procedure = gimp_procedure_new (vectors_stroke_get_length_invoker);
1885
gimp_object_set_static_name (GIMP_OBJECT (procedure),
1886
"gimp-vectors-stroke-get-length");
1887
gimp_procedure_set_static_strings (procedure,
1888
"gimp-vectors-stroke-get-length",
1889
"Measure the length of the given stroke.",
1890
"Measure the length of the given stroke.",
1895
gimp_procedure_add_argument (procedure,
1896
gimp_param_spec_vectors_id ("vectors",
1898
"The vectors object",
1900
GIMP_PARAM_READWRITE));
1901
gimp_procedure_add_argument (procedure,
1902
gimp_param_spec_int32 ("stroke-id",
1905
G_MININT32, G_MAXINT32, 0,
1906
GIMP_PARAM_READWRITE));
1907
gimp_procedure_add_argument (procedure,
1908
g_param_spec_double ("precision",
1910
"The precision used for the approximation",
1911
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1912
GIMP_PARAM_READWRITE));
1913
gimp_procedure_add_return_value (procedure,
1914
g_param_spec_double ("length",
1916
"The length (in pixels) of the given stroke.",
1917
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1918
GIMP_PARAM_READWRITE));
1919
gimp_pdb_register_procedure (pdb, procedure);
1920
g_object_unref (procedure);
1923
* gimp-vectors-stroke-get-point-at-dist
1925
procedure = gimp_procedure_new (vectors_stroke_get_point_at_dist_invoker);
1926
gimp_object_set_static_name (GIMP_OBJECT (procedure),
1927
"gimp-vectors-stroke-get-point-at-dist");
1928
gimp_procedure_set_static_strings (procedure,
1929
"gimp-vectors-stroke-get-point-at-dist",
1930
"Get point at a specified distance along the stroke.",
1931
"This will return the x,y position of a point at a given distance along the stroke. The distance will be obtained by first digitizing the curve internally and then walking along the curve. For a closed stroke the start of the path is the first point on the path that was created. This might not be obvious. If the stroke is not long enough, a \"valid\" flag will be FALSE.",
1936
gimp_procedure_add_argument (procedure,
1937
gimp_param_spec_vectors_id ("vectors",
1939
"The vectors object",
1941
GIMP_PARAM_READWRITE));
1942
gimp_procedure_add_argument (procedure,
1943
gimp_param_spec_int32 ("stroke-id",
1946
G_MININT32, G_MAXINT32, 0,
1947
GIMP_PARAM_READWRITE));
1948
gimp_procedure_add_argument (procedure,
1949
g_param_spec_double ("dist",
1951
"The given distance.",
1952
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1953
GIMP_PARAM_READWRITE));
1954
gimp_procedure_add_argument (procedure,
1955
g_param_spec_double ("precision",
1957
"The precision used for the approximation",
1958
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1959
GIMP_PARAM_READWRITE));
1960
gimp_procedure_add_return_value (procedure,
1961
g_param_spec_double ("x-point",
1963
"The x position of the point.",
1964
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1965
GIMP_PARAM_READWRITE));
1966
gimp_procedure_add_return_value (procedure,
1967
g_param_spec_double ("y-point",
1969
"The y position of the point.",
1970
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1971
GIMP_PARAM_READWRITE));
1972
gimp_procedure_add_return_value (procedure,
1973
g_param_spec_double ("slope",
1975
"The slope (dy / dx) at the specified point.",
1976
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1977
GIMP_PARAM_READWRITE));
1978
gimp_procedure_add_return_value (procedure,
1979
g_param_spec_boolean ("valid",
1981
"Indicator for the validity of the returned data.",
1983
GIMP_PARAM_READWRITE));
1984
gimp_pdb_register_procedure (pdb, procedure);
1985
g_object_unref (procedure);
1988
* gimp-vectors-remove-stroke
1990
procedure = gimp_procedure_new (vectors_remove_stroke_invoker);
1991
gimp_object_set_static_name (GIMP_OBJECT (procedure),
1992
"gimp-vectors-remove-stroke");
1993
gimp_procedure_set_static_strings (procedure,
1994
"gimp-vectors-remove-stroke",
1995
"remove the stroke from a vectors object.",
1996
"Remove the stroke from a vectors object.",
2001
gimp_procedure_add_argument (procedure,
2002
gimp_param_spec_vectors_id ("vectors",
2004
"The vectors object",
2006
GIMP_PARAM_READWRITE));
2007
gimp_procedure_add_argument (procedure,
2008
gimp_param_spec_int32 ("stroke-id",
2011
G_MININT32, G_MAXINT32, 0,
2012
GIMP_PARAM_READWRITE));
2013
gimp_pdb_register_procedure (pdb, procedure);
2014
g_object_unref (procedure);
2017
* gimp-vectors-stroke-close
2019
procedure = gimp_procedure_new (vectors_stroke_close_invoker);
2020
gimp_object_set_static_name (GIMP_OBJECT (procedure),
2021
"gimp-vectors-stroke-close");
2022
gimp_procedure_set_static_strings (procedure,
2023
"gimp-vectors-stroke-close",
2024
"closes the specified stroke.",
2025
"Closes the specified stroke.",
2030
gimp_procedure_add_argument (procedure,
2031
gimp_param_spec_vectors_id ("vectors",
2033
"The vectors object",
2035
GIMP_PARAM_READWRITE));
2036
gimp_procedure_add_argument (procedure,
2037
gimp_param_spec_int32 ("stroke-id",
2040
G_MININT32, G_MAXINT32, 0,
2041
GIMP_PARAM_READWRITE));
2042
gimp_pdb_register_procedure (pdb, procedure);
2043
g_object_unref (procedure);
2046
* gimp-vectors-stroke-translate
2048
procedure = gimp_procedure_new (vectors_stroke_translate_invoker);
2049
gimp_object_set_static_name (GIMP_OBJECT (procedure),
2050
"gimp-vectors-stroke-translate");
2051
gimp_procedure_set_static_strings (procedure,
2052
"gimp-vectors-stroke-translate",
2053
"translate the given stroke.",
2054
"Translate the given stroke.",
2059
gimp_procedure_add_argument (procedure,
2060
gimp_param_spec_vectors_id ("vectors",
2062
"The vectors object",
2064
GIMP_PARAM_READWRITE));
2065
gimp_procedure_add_argument (procedure,
2066
gimp_param_spec_int32 ("stroke-id",
2069
G_MININT32, G_MAXINT32, 0,
2070
GIMP_PARAM_READWRITE));
2071
gimp_procedure_add_argument (procedure,
2072
gimp_param_spec_int32 ("off-x",
2074
"Offset in x direction",
2075
G_MININT32, G_MAXINT32, 0,
2076
GIMP_PARAM_READWRITE));
2077
gimp_procedure_add_argument (procedure,
2078
gimp_param_spec_int32 ("off-y",
2080
"Offset in y direction",
2081
G_MININT32, G_MAXINT32, 0,
2082
GIMP_PARAM_READWRITE));
2083
gimp_pdb_register_procedure (pdb, procedure);
2084
g_object_unref (procedure);
2087
* gimp-vectors-stroke-scale
2089
procedure = gimp_procedure_new (vectors_stroke_scale_invoker);
2090
gimp_object_set_static_name (GIMP_OBJECT (procedure),
2091
"gimp-vectors-stroke-scale");
2092
gimp_procedure_set_static_strings (procedure,
2093
"gimp-vectors-stroke-scale",
2094
"scales the given stroke.",
2095
"Scale the given stroke.",
2100
gimp_procedure_add_argument (procedure,
2101
gimp_param_spec_vectors_id ("vectors",
2103
"The vectors object",
2105
GIMP_PARAM_READWRITE));
2106
gimp_procedure_add_argument (procedure,
2107
gimp_param_spec_int32 ("stroke-id",
2110
G_MININT32, G_MAXINT32, 0,
2111
GIMP_PARAM_READWRITE));
2112
gimp_procedure_add_argument (procedure,
2113
g_param_spec_double ("scale-x",
2115
"Scale factor in x direction",
2116
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2117
GIMP_PARAM_READWRITE));
2118
gimp_procedure_add_argument (procedure,
2119
g_param_spec_double ("scale-y",
2121
"Scale factor in y direction",
2122
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2123
GIMP_PARAM_READWRITE));
2124
gimp_pdb_register_procedure (pdb, procedure);
2125
g_object_unref (procedure);
2128
* gimp-vectors-stroke-rotate
2130
procedure = gimp_procedure_new (vectors_stroke_rotate_invoker);
2131
gimp_object_set_static_name (GIMP_OBJECT (procedure),
2132
"gimp-vectors-stroke-rotate");
2133
gimp_procedure_set_static_strings (procedure,
2134
"gimp-vectors-stroke-rotate",
2135
"rotates the given stroke.",
2136
"Rotates the given stroke around given center by angle (in degrees).",
2137
"Jo\xc3\xa3o S. O. Bueno",
2138
"Jo\xc3\xa3o S. O. Bueno",
2141
gimp_procedure_add_argument (procedure,
2142
gimp_param_spec_vectors_id ("vectors",
2144
"The vectors object",
2146
GIMP_PARAM_READWRITE));
2147
gimp_procedure_add_argument (procedure,
2148
gimp_param_spec_int32 ("stroke-id",
2151
G_MININT32, G_MAXINT32, 0,
2152
GIMP_PARAM_READWRITE));
2153
gimp_procedure_add_argument (procedure,
2154
g_param_spec_double ("center-x",
2156
"X coordinate of the rotation center",
2157
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2158
GIMP_PARAM_READWRITE));
2159
gimp_procedure_add_argument (procedure,
2160
g_param_spec_double ("center-y",
2162
"Y coordinate of the rotation center",
2163
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2164
GIMP_PARAM_READWRITE));
2165
gimp_procedure_add_argument (procedure,
2166
g_param_spec_double ("angle",
2168
"angle to rotate about",
2169
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2170
GIMP_PARAM_READWRITE));
2171
gimp_pdb_register_procedure (pdb, procedure);
2172
g_object_unref (procedure);
2175
* gimp-vectors-stroke-flip
2177
procedure = gimp_procedure_new (vectors_stroke_flip_invoker);
2178
gimp_object_set_static_name (GIMP_OBJECT (procedure),
2179
"gimp-vectors-stroke-flip");
2180
gimp_procedure_set_static_strings (procedure,
2181
"gimp-vectors-stroke-flip",
2182
"flips the given stroke.",
2183
"Rotates the given stroke around given center by angle (in degrees).",
2184
"Jo\xc3\xa3o S. O. Bueno",
2185
"Jo\xc3\xa3o S. O. Bueno",
2188
gimp_procedure_add_argument (procedure,
2189
gimp_param_spec_vectors_id ("vectors",
2191
"The vectors object",
2193
GIMP_PARAM_READWRITE));
2194
gimp_procedure_add_argument (procedure,
2195
gimp_param_spec_int32 ("stroke-id",
2198
G_MININT32, G_MAXINT32, 0,
2199
GIMP_PARAM_READWRITE));
2200
gimp_procedure_add_argument (procedure,
2201
gimp_param_spec_enum ("flip-type",
2203
"Flip orientation, either vertical or horizontal",
2204
GIMP_TYPE_ORIENTATION_TYPE,
2205
GIMP_ORIENTATION_HORIZONTAL,
2206
GIMP_PARAM_READWRITE));
2207
gimp_param_spec_enum_exclude_value (GIMP_PARAM_SPEC_ENUM (procedure->args[2]),
2208
GIMP_ORIENTATION_UNKNOWN);
2209
gimp_procedure_add_argument (procedure,
2210
g_param_spec_double ("axis",
2212
"axis coordinate about which to flip, in pixels",
2213
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2214
GIMP_PARAM_READWRITE));
2215
gimp_pdb_register_procedure (pdb, procedure);
2216
g_object_unref (procedure);
2219
* gimp-vectors-stroke-flip-free
2221
procedure = gimp_procedure_new (vectors_stroke_flip_free_invoker);
2222
gimp_object_set_static_name (GIMP_OBJECT (procedure),
2223
"gimp-vectors-stroke-flip-free");
2224
gimp_procedure_set_static_strings (procedure,
2225
"gimp-vectors-stroke-flip-free",
2226
"flips the given stroke about an arbitrary axis.",
2227
"Flips the given stroke about an arbitrary axis. Axis is defined by two coordinates in the image (in pixels), through which the flipping axis passes.",
2228
"Jo\xc3\xa3o S. O. Bueno",
2229
"Jo\xc3\xa3o S. O. Bueno",
2232
gimp_procedure_add_argument (procedure,
2233
gimp_param_spec_vectors_id ("vectors",
2235
"The vectors object",
2237
GIMP_PARAM_READWRITE));
2238
gimp_procedure_add_argument (procedure,
2239
gimp_param_spec_int32 ("stroke-id",
2242
G_MININT32, G_MAXINT32, 0,
2243
GIMP_PARAM_READWRITE));
2244
gimp_procedure_add_argument (procedure,
2245
g_param_spec_double ("x1",
2247
"X coordinate of the first point of the flipping axis",
2248
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2249
GIMP_PARAM_READWRITE));
2250
gimp_procedure_add_argument (procedure,
2251
g_param_spec_double ("y1",
2253
"Y coordinate of the first point of the flipping axis",
2254
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2255
GIMP_PARAM_READWRITE));
2256
gimp_procedure_add_argument (procedure,
2257
g_param_spec_double ("x2",
2259
"X coordinate of the second point of the flipping axis",
2260
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2261
GIMP_PARAM_READWRITE));
2262
gimp_procedure_add_argument (procedure,
2263
g_param_spec_double ("y2",
2265
"Y coordinate of the second point of the flipping axis",
2266
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2267
GIMP_PARAM_READWRITE));
2268
gimp_pdb_register_procedure (pdb, procedure);
2269
g_object_unref (procedure);
2272
* gimp-vectors-stroke-get-points
2274
procedure = gimp_procedure_new (vectors_stroke_get_points_invoker);
2275
gimp_object_set_static_name (GIMP_OBJECT (procedure),
2276
"gimp-vectors-stroke-get-points");
2277
gimp_procedure_set_static_strings (procedure,
2278
"gimp-vectors-stroke-get-points",
2279
"returns the control points of a stroke.",
2280
"returns the control points of a stroke. The interpretation of the coordinates returned depends on the type of the stroke. For Gimp 2.4 this is always a bezier stroke, where the coordinates are the control points.",
2285
gimp_procedure_add_argument (procedure,
2286
gimp_param_spec_vectors_id ("vectors",
2288
"The vectors object",
2290
GIMP_PARAM_READWRITE));
2291
gimp_procedure_add_argument (procedure,
2292
gimp_param_spec_int32 ("stroke-id",
2295
G_MININT32, G_MAXINT32, 0,
2296
GIMP_PARAM_READWRITE));
2297
gimp_procedure_add_return_value (procedure,
2298
g_param_spec_enum ("type",
2300
"type of the stroke (always GIMP_VECTORS_STROKE_TYPE_BEZIER for now).",
2301
GIMP_TYPE_VECTORS_STROKE_TYPE,
2302
GIMP_VECTORS_STROKE_TYPE_BEZIER,
2303
GIMP_PARAM_READWRITE));
2304
gimp_procedure_add_return_value (procedure,
2305
gimp_param_spec_int32 ("num-points",
2307
"The number of floats returned.",
2309
GIMP_PARAM_READWRITE));
2310
gimp_procedure_add_return_value (procedure,
2311
gimp_param_spec_float_array ("controlpoints",
2313
"List of the control points for the stroke (x0, y0, x1, y1, ...).",
2314
GIMP_PARAM_READWRITE));
2315
gimp_procedure_add_return_value (procedure,
2316
g_param_spec_boolean ("closed",
2318
"Whether the stroke is closed or not.",
2320
GIMP_PARAM_READWRITE));
2321
gimp_pdb_register_procedure (pdb, procedure);
2322
g_object_unref (procedure);
2325
* gimp-vectors-stroke-new-from-points
2327
procedure = gimp_procedure_new (vectors_stroke_new_from_points_invoker);
2328
gimp_object_set_static_name (GIMP_OBJECT (procedure),
2329
"gimp-vectors-stroke-new-from-points");
2330
gimp_procedure_set_static_strings (procedure,
2331
"gimp-vectors-stroke-new-from-points",
2332
"Adds a stroke of a given type to the vectors object.",
2333
"Adds a stroke of a given type to the vectors object. The coordinates of the control points can be specified. For now only strokes of the type GIMP_VECTORS_STROKE_TYPE_BEZIER are supported. The control points are specified as a pair of float values for the x- and y-coordinate. The Bezier stroke type needs a multiple of three control points. Each Bezier segment endpoint (anchor, A) has two additional control points (C) associated. They are specified in the order CACCACCAC...",
2338
gimp_procedure_add_argument (procedure,
2339
gimp_param_spec_vectors_id ("vectors",
2341
"The vectors object",
2343
GIMP_PARAM_READWRITE));
2344
gimp_procedure_add_argument (procedure,
2345
g_param_spec_enum ("type",
2347
"type of the stroke (always GIMP_VECTORS_STROKE_TYPE_BEZIER for now).",
2348
GIMP_TYPE_VECTORS_STROKE_TYPE,
2349
GIMP_VECTORS_STROKE_TYPE_BEZIER,
2350
GIMP_PARAM_READWRITE));
2351
gimp_procedure_add_argument (procedure,
2352
gimp_param_spec_int32 ("num-points",
2354
"The number of elements in the array, i.e. the number of controlpoints in the stroke * 2 (x- and y-coordinate).",
2356
GIMP_PARAM_READWRITE));
2357
gimp_procedure_add_argument (procedure,
2358
gimp_param_spec_float_array ("controlpoints",
2360
"List of the x- and y-coordinates of the control points.",
2361
GIMP_PARAM_READWRITE));
2362
gimp_procedure_add_argument (procedure,
2363
g_param_spec_boolean ("closed",
2365
"Whether the stroke is to be closed or not.",
2367
GIMP_PARAM_READWRITE));
2368
gimp_procedure_add_return_value (procedure,
2369
gimp_param_spec_int32 ("stroke-id",
2371
"The stroke ID of the newly created stroke.",
2372
G_MININT32, G_MAXINT32, 0,
2373
GIMP_PARAM_READWRITE));
2374
gimp_pdb_register_procedure (pdb, procedure);
2375
g_object_unref (procedure);
2378
* gimp-vectors-stroke-interpolate
2380
procedure = gimp_procedure_new (vectors_stroke_interpolate_invoker);
2381
gimp_object_set_static_name (GIMP_OBJECT (procedure),
2382
"gimp-vectors-stroke-interpolate");
2383
gimp_procedure_set_static_strings (procedure,
2384
"gimp-vectors-stroke-interpolate",
2385
"returns polygonal approximation of the stroke.",
2386
"returns polygonal approximation of the stroke.",
2391
gimp_procedure_add_argument (procedure,
2392
gimp_param_spec_vectors_id ("vectors",
2394
"The vectors object",
2396
GIMP_PARAM_READWRITE));
2397
gimp_procedure_add_argument (procedure,
2398
gimp_param_spec_int32 ("stroke-id",
2401
G_MININT32, G_MAXINT32, 0,
2402
GIMP_PARAM_READWRITE));
2403
gimp_procedure_add_argument (procedure,
2404
g_param_spec_double ("precision",
2406
"The precision used for the approximation",
2407
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2408
GIMP_PARAM_READWRITE));
2409
gimp_procedure_add_return_value (procedure,
2410
gimp_param_spec_int32 ("num-coords",
2412
"The number of floats returned.",
2414
GIMP_PARAM_READWRITE));
2415
gimp_procedure_add_return_value (procedure,
2416
gimp_param_spec_float_array ("coords",
2418
"List of the coords along the path (x0, y0, x1, y1, ...).",
2419
GIMP_PARAM_READWRITE));
2420
gimp_procedure_add_return_value (procedure,
2421
g_param_spec_boolean ("closed",
2423
"Whether the stroke is closed or not.",
2425
GIMP_PARAM_READWRITE));
2426
gimp_pdb_register_procedure (pdb, procedure);
2427
g_object_unref (procedure);
2430
* gimp-vectors-bezier-stroke-new-moveto
2432
procedure = gimp_procedure_new (vectors_bezier_stroke_new_moveto_invoker);
2433
gimp_object_set_static_name (GIMP_OBJECT (procedure),
2434
"gimp-vectors-bezier-stroke-new-moveto");
2435
gimp_procedure_set_static_strings (procedure,
2436
"gimp-vectors-bezier-stroke-new-moveto",
2437
"Adds a bezier stroke with a single moveto to the vectors object.",
2438
"Adds a bezier stroke with a single moveto to the vectors object.",
2443
gimp_procedure_add_argument (procedure,
2444
gimp_param_spec_vectors_id ("vectors",
2446
"The vectors object",
2448
GIMP_PARAM_READWRITE));
2449
gimp_procedure_add_argument (procedure,
2450
g_param_spec_double ("x0",
2452
"The x-coordinate of the moveto",
2453
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2454
GIMP_PARAM_READWRITE));
2455
gimp_procedure_add_argument (procedure,
2456
g_param_spec_double ("y0",
2458
"The y-coordinate of the moveto",
2459
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2460
GIMP_PARAM_READWRITE));
2461
gimp_procedure_add_return_value (procedure,
2462
gimp_param_spec_int32 ("stroke-id",
2464
"The resulting stroke",
2465
G_MININT32, G_MAXINT32, 0,
2466
GIMP_PARAM_READWRITE));
2467
gimp_pdb_register_procedure (pdb, procedure);
2468
g_object_unref (procedure);
2471
* gimp-vectors-bezier-stroke-lineto
2473
procedure = gimp_procedure_new (vectors_bezier_stroke_lineto_invoker);
2474
gimp_object_set_static_name (GIMP_OBJECT (procedure),
2475
"gimp-vectors-bezier-stroke-lineto");
2476
gimp_procedure_set_static_strings (procedure,
2477
"gimp-vectors-bezier-stroke-lineto",
2478
"Extends a bezier stroke with a lineto.",
2479
"Extends a bezier stroke with a lineto.",
2484
gimp_procedure_add_argument (procedure,
2485
gimp_param_spec_vectors_id ("vectors",
2487
"The vectors object",
2489
GIMP_PARAM_READWRITE));
2490
gimp_procedure_add_argument (procedure,
2491
gimp_param_spec_int32 ("stroke-id",
2494
G_MININT32, G_MAXINT32, 0,
2495
GIMP_PARAM_READWRITE));
2496
gimp_procedure_add_argument (procedure,
2497
g_param_spec_double ("x0",
2499
"The x-coordinate of the lineto",
2500
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2501
GIMP_PARAM_READWRITE));
2502
gimp_procedure_add_argument (procedure,
2503
g_param_spec_double ("y0",
2505
"The y-coordinate of the lineto",
2506
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2507
GIMP_PARAM_READWRITE));
2508
gimp_pdb_register_procedure (pdb, procedure);
2509
g_object_unref (procedure);
2512
* gimp-vectors-bezier-stroke-conicto
2514
procedure = gimp_procedure_new (vectors_bezier_stroke_conicto_invoker);
2515
gimp_object_set_static_name (GIMP_OBJECT (procedure),
2516
"gimp-vectors-bezier-stroke-conicto");
2517
gimp_procedure_set_static_strings (procedure,
2518
"gimp-vectors-bezier-stroke-conicto",
2519
"Extends a bezier stroke with a conic bezier spline.",
2520
"Extends a bezier stroke with a conic bezier spline. Actually a cubic bezier spline gets added that realizes the shape of a conic bezier spline.",
2525
gimp_procedure_add_argument (procedure,
2526
gimp_param_spec_vectors_id ("vectors",
2528
"The vectors object",
2530
GIMP_PARAM_READWRITE));
2531
gimp_procedure_add_argument (procedure,
2532
gimp_param_spec_int32 ("stroke-id",
2535
G_MININT32, G_MAXINT32, 0,
2536
GIMP_PARAM_READWRITE));
2537
gimp_procedure_add_argument (procedure,
2538
g_param_spec_double ("x0",
2540
"The x-coordinate of the control point",
2541
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2542
GIMP_PARAM_READWRITE));
2543
gimp_procedure_add_argument (procedure,
2544
g_param_spec_double ("y0",
2546
"The y-coordinate of the control point",
2547
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2548
GIMP_PARAM_READWRITE));
2549
gimp_procedure_add_argument (procedure,
2550
g_param_spec_double ("x1",
2552
"The x-coordinate of the end point",
2553
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2554
GIMP_PARAM_READWRITE));
2555
gimp_procedure_add_argument (procedure,
2556
g_param_spec_double ("y1",
2558
"The y-coordinate of the end point",
2559
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2560
GIMP_PARAM_READWRITE));
2561
gimp_pdb_register_procedure (pdb, procedure);
2562
g_object_unref (procedure);
2565
* gimp-vectors-bezier-stroke-cubicto
2567
procedure = gimp_procedure_new (vectors_bezier_stroke_cubicto_invoker);
2568
gimp_object_set_static_name (GIMP_OBJECT (procedure),
2569
"gimp-vectors-bezier-stroke-cubicto");
2570
gimp_procedure_set_static_strings (procedure,
2571
"gimp-vectors-bezier-stroke-cubicto",
2572
"Extends a bezier stroke with a cubic bezier spline.",
2573
"Extends a bezier stroke with a cubic bezier spline.",
2578
gimp_procedure_add_argument (procedure,
2579
gimp_param_spec_vectors_id ("vectors",
2581
"The vectors object",
2583
GIMP_PARAM_READWRITE));
2584
gimp_procedure_add_argument (procedure,
2585
gimp_param_spec_int32 ("stroke-id",
2588
G_MININT32, G_MAXINT32, 0,
2589
GIMP_PARAM_READWRITE));
2590
gimp_procedure_add_argument (procedure,
2591
g_param_spec_double ("x0",
2593
"The x-coordinate of the first control point",
2594
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2595
GIMP_PARAM_READWRITE));
2596
gimp_procedure_add_argument (procedure,
2597
g_param_spec_double ("y0",
2599
"The y-coordinate of the first control point",
2600
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2601
GIMP_PARAM_READWRITE));
2602
gimp_procedure_add_argument (procedure,
2603
g_param_spec_double ("x1",
2605
"The x-coordinate of the second control point",
2606
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2607
GIMP_PARAM_READWRITE));
2608
gimp_procedure_add_argument (procedure,
2609
g_param_spec_double ("y1",
2611
"The y-coordinate of the second control point",
2612
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2613
GIMP_PARAM_READWRITE));
2614
gimp_procedure_add_argument (procedure,
2615
g_param_spec_double ("x2",
2617
"The x-coordinate of the end point",
2618
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2619
GIMP_PARAM_READWRITE));
2620
gimp_procedure_add_argument (procedure,
2621
g_param_spec_double ("y2",
2623
"The y-coordinate of the end point",
2624
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2625
GIMP_PARAM_READWRITE));
2626
gimp_pdb_register_procedure (pdb, procedure);
2627
g_object_unref (procedure);
2630
* gimp-vectors-bezier-stroke-new-ellipse
2632
procedure = gimp_procedure_new (vectors_bezier_stroke_new_ellipse_invoker);
2633
gimp_object_set_static_name (GIMP_OBJECT (procedure),
2634
"gimp-vectors-bezier-stroke-new-ellipse");
2635
gimp_procedure_set_static_strings (procedure,
2636
"gimp-vectors-bezier-stroke-new-ellipse",
2637
"Adds a bezier stroke describing an ellipse the vectors object.",
2638
"Adds a bezier stroke describing an ellipse the vectors object.",
2643
gimp_procedure_add_argument (procedure,
2644
gimp_param_spec_vectors_id ("vectors",
2646
"The vectors object",
2648
GIMP_PARAM_READWRITE));
2649
gimp_procedure_add_argument (procedure,
2650
g_param_spec_double ("x0",
2652
"The x-coordinate of the center",
2653
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2654
GIMP_PARAM_READWRITE));
2655
gimp_procedure_add_argument (procedure,
2656
g_param_spec_double ("y0",
2658
"The y-coordinate of the center",
2659
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2660
GIMP_PARAM_READWRITE));
2661
gimp_procedure_add_argument (procedure,
2662
g_param_spec_double ("radius-x",
2664
"The radius in x direction",
2665
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2666
GIMP_PARAM_READWRITE));
2667
gimp_procedure_add_argument (procedure,
2668
g_param_spec_double ("radius-y",
2670
"The radius in y direction",
2671
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2672
GIMP_PARAM_READWRITE));
2673
gimp_procedure_add_argument (procedure,
2674
g_param_spec_double ("angle",
2676
"The angle the x-axis of the ellipse (radians, counterclockwise)",
2677
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2678
GIMP_PARAM_READWRITE));
2679
gimp_procedure_add_return_value (procedure,
2680
gimp_param_spec_int32 ("stroke-id",
2682
"The resulting stroke",
2683
G_MININT32, G_MAXINT32, 0,
2684
GIMP_PARAM_READWRITE));
2685
gimp_pdb_register_procedure (pdb, procedure);
2686
g_object_unref (procedure);
2689
* gimp-vectors-to-selection
2691
procedure = gimp_procedure_new (vectors_to_selection_invoker);
2692
gimp_object_set_static_name (GIMP_OBJECT (procedure),
2693
"gimp-vectors-to-selection");
2694
gimp_procedure_set_static_strings (procedure,
2695
"gimp-vectors-to-selection",
2696
"Transforms the specified vectors object into a selection",
2697
"This procedure renders the desired vectors object into the current selection of the image the vectors object belongs to.",
2702
gimp_procedure_add_argument (procedure,
2703
gimp_param_spec_vectors_id ("vectors",
2705
"The vectors object to render to the selection",
2707
GIMP_PARAM_READWRITE));
2708
gimp_procedure_add_argument (procedure,
2709
g_param_spec_enum ("operation",
2711
"The desired operation with current selection",
2712
GIMP_TYPE_CHANNEL_OPS,
2713
GIMP_CHANNEL_OP_ADD,
2714
GIMP_PARAM_READWRITE));
2715
gimp_procedure_add_argument (procedure,
2716
g_param_spec_boolean ("antialias",
2718
"Antialias selection.",
2720
GIMP_PARAM_READWRITE));
2721
gimp_procedure_add_argument (procedure,
2722
g_param_spec_boolean ("feather",
2724
"Feather selection.",
2726
GIMP_PARAM_READWRITE));
2727
gimp_procedure_add_argument (procedure,
2728
g_param_spec_double ("feather-radius-x",
2730
"Feather radius x.",
2731
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2732
GIMP_PARAM_READWRITE));
2733
gimp_procedure_add_argument (procedure,
2734
g_param_spec_double ("feather-radius-y",
2736
"Feather radius y.",
2737
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
2738
GIMP_PARAM_READWRITE));
2739
gimp_pdb_register_procedure (pdb, procedure);
2740
g_object_unref (procedure);
2743
* gimp-vectors-import-from-file
2745
procedure = gimp_procedure_new (vectors_import_from_file_invoker);
2746
gimp_object_set_static_name (GIMP_OBJECT (procedure),
2747
"gimp-vectors-import-from-file");
2748
gimp_procedure_set_static_strings (procedure,
2749
"gimp-vectors-import-from-file",
2750
"Import paths from an SVG file.",
2751
"This procedure imports paths from an SVG file. SVG elements other than paths and basic shapes are ignored.",
2756
gimp_procedure_add_argument (procedure,
2757
gimp_param_spec_image_id ("image",
2761
GIMP_PARAM_READWRITE));
2762
gimp_procedure_add_argument (procedure,
2763
gimp_param_spec_string ("filename",
2765
"The name of the SVG file to import.",
2768
GIMP_PARAM_READWRITE));
2769
gimp_procedure_add_argument (procedure,
2770
g_param_spec_boolean ("merge",
2772
"Merge paths into a single vectors object.",
2774
GIMP_PARAM_READWRITE));
2775
gimp_procedure_add_argument (procedure,
2776
g_param_spec_boolean ("scale",
2778
"Scale the SVG to image dimensions.",
2780
GIMP_PARAM_READWRITE));
2781
gimp_procedure_add_return_value (procedure,
2782
gimp_param_spec_int32 ("num-vectors",
2784
"The number of newly created vectors",
2786
GIMP_PARAM_READWRITE));
2787
gimp_procedure_add_return_value (procedure,
2788
gimp_param_spec_int32_array ("vectors-ids",
2790
"The list of newly created vectors",
2791
GIMP_PARAM_READWRITE));
2792
gimp_pdb_register_procedure (pdb, procedure);
2793
g_object_unref (procedure);
2796
* gimp-vectors-import-from-string
2798
procedure = gimp_procedure_new (vectors_import_from_string_invoker);
2799
gimp_object_set_static_name (GIMP_OBJECT (procedure),
2800
"gimp-vectors-import-from-string");
2801
gimp_procedure_set_static_strings (procedure,
2802
"gimp-vectors-import-from-string",
2803
"Import paths from an SVG string.",
2804
"This procedure works like 'gimp-vectors-import-from-file' but takes a string rather than reading the SVG from a file. This allows you to write scripts that generate SVG and feed it to GIMP.",
2809
gimp_procedure_add_argument (procedure,
2810
gimp_param_spec_image_id ("image",
2814
GIMP_PARAM_READWRITE));
2815
gimp_procedure_add_argument (procedure,
2816
gimp_param_spec_string ("string",
2818
"A string that must be a complete and valid SVG document.",
2821
GIMP_PARAM_READWRITE));
2822
gimp_procedure_add_argument (procedure,
2823
gimp_param_spec_int32 ("length",
2825
"Number of bytes in string or -1 if the string is NULL terminated.",
2826
G_MININT32, G_MAXINT32, 0,
2827
GIMP_PARAM_READWRITE));
2828
gimp_procedure_add_argument (procedure,
2829
g_param_spec_boolean ("merge",
2831
"Merge paths into a single vectors object.",
2833
GIMP_PARAM_READWRITE));
2834
gimp_procedure_add_argument (procedure,
2835
g_param_spec_boolean ("scale",
2837
"Scale the SVG to image dimensions.",
2839
GIMP_PARAM_READWRITE));
2840
gimp_procedure_add_return_value (procedure,
2841
gimp_param_spec_int32 ("num-vectors",
2843
"The number of newly created vectors",
2845
GIMP_PARAM_READWRITE));
2846
gimp_procedure_add_return_value (procedure,
2847
gimp_param_spec_int32_array ("vectors-ids",
2849
"The list of newly created vectors",
2850
GIMP_PARAM_READWRITE));
2851
gimp_pdb_register_procedure (pdb, procedure);
2852
g_object_unref (procedure);
2855
* gimp-vectors-export-to-file
2857
procedure = gimp_procedure_new (vectors_export_to_file_invoker);
2858
gimp_object_set_static_name (GIMP_OBJECT (procedure),
2859
"gimp-vectors-export-to-file");
2860
gimp_procedure_set_static_strings (procedure,
2861
"gimp-vectors-export-to-file",
2862
"save a path as an SVG file.",
2863
"This procedure creates an SVG file to save a Vectors object, that is, a path. The resulting file can be edited using a vector graphics application, or later reloaded into GIMP. If you pass 0 as the 'vectors' argument, then all paths in the image will be exported.",
2864
"Bill Skaggs <weskaggs@primate.ucdavis.edu>",
2868
gimp_procedure_add_argument (procedure,
2869
gimp_param_spec_image_id ("image",
2873
GIMP_PARAM_READWRITE));
2874
gimp_procedure_add_argument (procedure,
2875
gimp_param_spec_string ("filename",
2877
"The name of the SVG file to create.",
2880
GIMP_PARAM_READWRITE));
2881
gimp_procedure_add_argument (procedure,
2882
gimp_param_spec_vectors_id ("vectors",
2884
"The vectors object to be saved, or 0 for all in the image",
2886
GIMP_PARAM_READWRITE | GIMP_PARAM_NO_VALIDATE));
2887
gimp_pdb_register_procedure (pdb, procedure);
2888
g_object_unref (procedure);
2891
* gimp-vectors-export-to-string
2893
procedure = gimp_procedure_new (vectors_export_to_string_invoker);
2894
gimp_object_set_static_name (GIMP_OBJECT (procedure),
2895
"gimp-vectors-export-to-string");
2896
gimp_procedure_set_static_strings (procedure,
2897
"gimp-vectors-export-to-string",
2898
"Save a path as an SVG string.",
2899
"This procedure works like 'gimp-vectors-export-to-file' but creates a string rather than a file. The contents are a %NUL-terminated string that holds a complete XML document. If you pass 0 as the 'vectors' argument, then all paths in the image will be exported.",
2900
"Bill Skaggs <weskaggs@primate.ucdavis.edu>",
2904
gimp_procedure_add_argument (procedure,
2905
gimp_param_spec_image_id ("image",
2909
GIMP_PARAM_READWRITE));
2910
gimp_procedure_add_argument (procedure,
2911
gimp_param_spec_vectors_id ("vectors",
2913
"The vectors object to save, or 0 for all in the image",
2915
GIMP_PARAM_READWRITE | GIMP_PARAM_NO_VALIDATE));
2916
gimp_procedure_add_return_value (procedure,
2917
gimp_param_spec_string ("string",
2919
"A string whose contents are a complete SVG document.",
2920
FALSE, FALSE, FALSE,
2922
GIMP_PARAM_READWRITE));
2923
gimp_pdb_register_procedure (pdb, procedure);
2924
g_object_unref (procedure);