~ubuntu-branches/ubuntu/jaunty/gimp/jaunty-security

« back to all changes in this revision

Viewing changes to tools/pdbgen/pdb/vectors.pdb

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2007-05-02 16:33:03 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070502163303-bvzhjzbpw8qglc4y
Tags: 2.3.16-1ubuntu1
* Resynchronized with Debian, remaining Ubuntu changes:
  - debian/rules: i18n magic.
* debian/control.in:
  - Maintainer: Ubuntu Core Developers <ubuntu-devel@lists.ubuntu.com>
* debian/patches/02_help-message.patch,
  debian/patches/03_gimp.desktop.in.in.patch,
  debian/patches/10_dont_show_wizard.patch: updated.
* debian/patches/04_composite-signedness.patch,
  debian/patches/05_add-letter-spacing.patch: dropped, used upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# GIMP - The GNU Image Manipulation Program
 
2
# Copyright (C) 1995 Spencer Kimball and Peter Mattis
 
3
 
 
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.
 
8
 
 
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.
 
13
 
 
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.
 
17
 
 
18
sub vectors_is_valid {
 
19
    $blurb = 'Returns TRUE if the vectors object is valid.';
 
20
 
 
21
    $help = <<'HELP';
 
22
This procedure checks if the given vectors ID is valid and refers to an
 
23
existing vectors object.
 
24
HELP
 
25
 
 
26
    &neo_pdb_misc('2007', '2.4');
 
27
 
 
28
    @inargs = (
 
29
        { name => 'vectors', type => 'vectors', no_validate => 1,
 
30
          desc => 'The vectors object to check' }
 
31
    );
 
32
 
 
33
    @outargs = (
 
34
        { name => 'valid', type => 'boolean',
 
35
          desc => 'Whether the vectors ID is valid' }
 
36
    );
 
37
 
 
38
    %invoke = (
 
39
        code => <<'CODE'
 
40
{
 
41
  valid = (GIMP_IS_VECTORS (vectors) &&
 
42
           gimp_item_is_attached (GIMP_ITEM (vectors)));
 
43
}
 
44
CODE
 
45
    );
 
46
}
 
47
 
 
48
sub vectors_new {
 
49
    $blurb = 'Creates a new empty vectors object.';
 
50
 
 
51
    $help = <<'HELP';
 
52
Creates a new empty vectors object. Needs to be added to an image
 
53
using gimp_image_add_vectors().
 
54
HELP
 
55
 
 
56
    &simon_pdb_misc('2005', '2.4');
 
57
 
 
58
    @inargs = (
 
59
        { name => 'image', type => 'image',
 
60
          desc => 'The image' },
 
61
        { name => 'name', type => 'string',
 
62
          desc => 'the name of the new vector object.' }
 
63
    );
 
64
 
 
65
    @outargs = (
 
66
        { name => 'vectors', type => 'vectors',
 
67
          desc => 'the current vector object, 0 if no vector exists
 
68
                   in the image.' }
 
69
    );
 
70
 
 
71
    %invoke = (
 
72
        code => <<'CODE'
 
73
{
 
74
  vectors = gimp_vectors_new (image, name);
 
75
}
 
76
CODE
 
77
    );
 
78
}
 
79
 
 
80
sub vectors_get_image {
 
81
    $blurb = 'Returns the vectors objects image.';
 
82
    $help  = 'Returns the vectors objects image.';
 
83
 
 
84
    &simon_pdb_misc('2005', '2.4');
 
85
 
 
86
    @inargs = (
 
87
        { name => 'vectors', type => 'vectors',
 
88
          desc => 'The vectors object' }
 
89
    );
 
90
 
 
91
    @outargs = (
 
92
        { name => 'image', type => 'image',
 
93
          desc => 'The vectors image' }
 
94
    );
 
95
 
 
96
    %invoke = (
 
97
        code => <<"CODE"
 
98
{
 
99
  image = gimp_item_get_image (GIMP_ITEM (vectors));
 
100
}
 
101
CODE
 
102
    );
 
103
}
 
104
 
 
105
sub vectors_get_name {
 
106
    $blurb = 'Gets the name of the vectors object.';
 
107
    $help  = 'Gets the name of the vectors object.';
 
108
 
 
109
    &simon_pdb_misc('2005', '2.4');
 
110
 
 
111
    @inargs = (
 
112
        { name => 'vectors', type => 'vectors',
 
113
          desc => 'The vectors object' }
 
114
    );
 
115
 
 
116
    @outargs = (
 
117
        { name => 'name', type => 'string',
 
118
          desc => 'The name of the vectors object' }
 
119
    );
 
120
 
 
121
    %invoke = (
 
122
        code => <<"CODE"
 
123
{
 
124
  name = g_strdup (gimp_object_get_name (GIMP_OBJECT (vectors)));
 
125
}
 
126
CODE
 
127
    );
 
128
}
 
129
 
 
130
sub vectors_set_name {
 
131
    $blurb = 'Sets the name of the vectors object.';
 
132
    $help  = 'Sets the name of the vectors object.';
 
133
 
 
134
    &simon_pdb_misc('2005', '2.4');
 
135
 
 
136
    @inargs = (
 
137
        { name => 'vectors', type => 'vectors',
 
138
          desc => 'The vectors object' },
 
139
        { name => 'name', type => 'string',
 
140
          desc => 'the new name of the path' }
 
141
    );
 
142
 
 
143
    %invoke = (
 
144
        code => <<"CODE"
 
145
{
 
146
  success = gimp_item_rename (GIMP_ITEM (vectors), name);
 
147
}
 
148
CODE
 
149
    );
 
150
}
 
151
 
 
152
sub vectors_get_visible {
 
153
    $blurb = 'Gets the visibility of the vectors object.';
 
154
    $help  = 'Gets the visibility of the vectors object.';
 
155
 
 
156
    &simon_pdb_misc('2005', '2.4');
 
157
 
 
158
    @inargs = (
 
159
        { name => 'vectors', type => 'vectors',
 
160
          desc => 'The vectors object' }
 
161
    );
 
162
 
 
163
    @outargs = (
 
164
        { name => 'visible', type => 'boolean',
 
165
          desc => 'TRUE if the path is visible, FALSE otherwise' }
 
166
    );
 
167
 
 
168
    %invoke = (
 
169
        code => <<"CODE"
 
170
{
 
171
  visible = gimp_item_get_visible (GIMP_ITEM (vectors));
 
172
}
 
173
CODE
 
174
    );
 
175
}
 
176
 
 
177
sub vectors_set_visible {
 
178
    $blurb = 'Sets the visibility of the vectors object.';
 
179
    $help  = 'Sets the visibility of the vectors object.';
 
180
 
 
181
    &simon_pdb_misc('2005', '2.4');
 
182
 
 
183
    @inargs = (
 
184
        { name => 'vectors', type => 'vectors',
 
185
          desc => 'The vectors object' },
 
186
        { name => 'visible', type => 'boolean',
 
187
          desc => 'Whether the path is visible' }
 
188
    );
 
189
 
 
190
    %invoke = (
 
191
        code => <<"CODE"
 
192
{
 
193
  gimp_item_set_visible (GIMP_ITEM (vectors), visible, TRUE);
 
194
}
 
195
CODE
 
196
    );
 
197
}
 
198
 
 
199
sub vectors_get_linked {
 
200
    $blurb = 'Gets the linked state of the vectors object.';
 
201
    $help  = 'Gets the linked state of the vectors object.';
 
202
 
 
203
    &simon_pdb_misc('2005', '2.4');
 
204
 
 
205
    @inargs = (
 
206
        { name => 'vectors', type => 'vectors',
 
207
          desc => 'The vectors object' }
 
208
    );
 
209
 
 
210
    @outargs = (
 
211
        { name => 'linked', type => 'boolean',
 
212
          desc => 'TRUE if the path is linked, FALSE otherwise' }
 
213
    );
 
214
 
 
215
    %invoke = (
 
216
        code => <<"CODE"
 
217
{
 
218
  linked = gimp_item_get_linked (GIMP_ITEM (vectors));
 
219
}
 
220
CODE
 
221
    );
 
222
}
 
223
 
 
224
sub vectors_set_linked {
 
225
    $blurb = 'Sets the linked state of the vectors object.';
 
226
    $help  = 'Sets the linked state of the vectors object.';
 
227
 
 
228
    &simon_pdb_misc('2005', '2.4');
 
229
 
 
230
    @inargs = (
 
231
        { name => 'vectors', type => 'vectors',
 
232
          desc => 'The vectors object' },
 
233
        { name => 'linked', type => 'boolean',
 
234
          desc => 'Whether the path is linked' }
 
235
    );
 
236
 
 
237
    %invoke = (
 
238
        code => <<"CODE"
 
239
{
 
240
  gimp_item_set_linked (GIMP_ITEM (vectors), linked, TRUE);
 
241
}
 
242
CODE
 
243
    );
 
244
}
 
245
 
 
246
sub vectors_get_tattoo {
 
247
    $blurb = 'Get the tattoo of the vectors object.';
 
248
    $help  = 'Get the tattoo state of the vectors object.';
 
249
 
 
250
    &simon_pdb_misc('2005', '2.4');
 
251
 
 
252
    @inargs = (
 
253
        { name => 'vectors', type => 'vectors',
 
254
          desc => 'The vectors object' }
 
255
    );
 
256
 
 
257
    @outargs = (
 
258
        { name => 'tattoo', type => 'int32',
 
259
          desc => 'The vectors tattoo' }
 
260
    );
 
261
 
 
262
    %invoke = (
 
263
        code => <<"CODE"
 
264
{
 
265
  tattoo = gimp_item_get_tattoo (GIMP_ITEM (vectors));
 
266
}
 
267
CODE
 
268
    );
 
269
}
 
270
 
 
271
sub vectors_set_tattoo {
 
272
    $blurb = 'Set the tattoo of the vectors object.';
 
273
    $help  = 'Set the tattoo of the vectors object.';
 
274
 
 
275
    &simon_pdb_misc('2005', '2.4');
 
276
 
 
277
    @inargs = (
 
278
        { name => 'vectors', type => 'vectors',
 
279
          desc => 'The vectors object' },
 
280
        { name => 'tattoo', type => 'int32',
 
281
          desc => 'the new tattoo' }
 
282
    );
 
283
 
 
284
    %invoke = (
 
285
        code => <<"CODE"
 
286
{
 
287
  gimp_item_set_tattoo (GIMP_ITEM (vectors), tattoo);
 
288
}
 
289
CODE
 
290
    );
 
291
}
 
292
 
 
293
sub vectors_get_strokes {
 
294
    $blurb = 'List the strokes associated with the passed path.';
 
295
 
 
296
    $help = <<'HELP';
 
297
Returns an Array with the stroke-IDs associated with the passed path.
 
298
HELP
 
299
 
 
300
    &simon_pdb_misc('2005', '2.4');
 
301
 
 
302
    @inargs = (
 
303
        { name => 'vectors', type => 'vectors',
 
304
          desc => 'The vectors object' }
 
305
    );
 
306
 
 
307
    @outargs = (
 
308
        { name => 'stroke_ids', type => 'int32array',
 
309
          desc => 'List of the strokes belonging to the path.',
 
310
          array => { name => 'num_strokes',
 
311
                     desc => 'The number of strokes returned.' } }
 
312
    );
 
313
 
 
314
    %invoke = (
 
315
        code => <<"CODE"
 
316
{
 
317
  num_strokes = gimp_vectors_get_n_strokes (vectors);
 
318
 
 
319
  if (num_strokes)
 
320
    {
 
321
      GimpStroke *cur_stroke;
 
322
      gint        i = 0;
 
323
 
 
324
      stroke_ids = g_new (gint32, num_strokes);
 
325
 
 
326
      for (cur_stroke = gimp_vectors_stroke_get_next (vectors, NULL);
 
327
           cur_stroke;
 
328
           cur_stroke = gimp_vectors_stroke_get_next (vectors, cur_stroke))
 
329
        {
 
330
          stroke_ids[i] = gimp_stroke_get_ID (cur_stroke);
 
331
          i++;
 
332
        }
 
333
    }
 
334
}
 
335
CODE
 
336
    );
 
337
}
 
338
 
 
339
sub vectors_stroke_get_length {
 
340
    $blurb = 'Measure the length of the given stroke.';
 
341
    $help  = 'Measure the length of the given stroke.';
 
342
 
 
343
    &simon_pdb_misc('2005', '2.4');
 
344
 
 
345
    @inargs = (
 
346
        { name => 'vectors', type => 'vectors',
 
347
          desc => 'The vectors object' },
 
348
        { name => 'stroke_id', type => 'int32',
 
349
          desc => 'The stroke ID' },
 
350
        { name => 'precision', type => 'float',
 
351
          desc => 'The precision used for the approximation' }
 
352
    );
 
353
 
 
354
    @outargs = (
 
355
        { name => 'length', type => 'float',
 
356
          desc => 'The length (in pixels) of the given stroke.' }
 
357
    );
 
358
 
 
359
    %invoke = (
 
360
        code => <<"CODE"
 
361
{
 
362
  GimpStroke *stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id);
 
363
  
 
364
  if (stroke)
 
365
    length = gimp_stroke_get_length (stroke, precision);
 
366
  else
 
367
    success = FALSE;
 
368
}
 
369
CODE
 
370
    );
 
371
}
 
372
 
 
373
sub vectors_stroke_get_point_at_dist {
 
374
    $blurb = 'Get point at a specified distance along the stroke.';
 
375
 
 
376
    $help = <<'HELP';
 
377
This will return the x,y position of a point at a given distance along the
 
378
stroke. The distance will be obtained by first digitizing the 
 
379
curve internally and then walking along the curve. For a closed stroke the
 
380
start of the path is the first point on the path that was created. This might
 
381
not be obvious. If the stroke is not long enough, a "valid" flag will be FALSE.
 
382
HELP
 
383
 
 
384
    &simon_pdb_misc('2005', '2.4');
 
385
 
 
386
    @inargs = (
 
387
        { name => 'vectors', type => 'vectors',
 
388
          desc => 'The vectors object' },
 
389
        { name => 'stroke_id', type => 'int32',
 
390
          desc => 'The stroke ID' },
 
391
        { name => 'dist', type => 'float',
 
392
          desc => 'The given distance.' },
 
393
        { name => 'precision', type => 'float',
 
394
          desc => 'The precision used for the approximation' }
 
395
    );
 
396
 
 
397
    @outargs = (
 
398
        { name => 'x_point', type => 'float', void_ret => 1,
 
399
          desc => 'The x position of the point.' },
 
400
        { name => 'y_point', type => 'float',
 
401
          desc => 'The y position of the point.' },
 
402
        { name => 'slope', type => 'float',
 
403
          desc => 'The slope (dy / dx) at the specified point.' },
 
404
        { name => 'valid', type => 'boolean',
 
405
          desc => 'Indicator for the validity of the returned data.' }
 
406
    );
 
407
 
 
408
    %invoke = (
 
409
        code => <<"CODE"
 
410
{
 
411
  GimpStroke *stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id);
 
412
  
 
413
  if (stroke)
 
414
    {
 
415
      GimpCoords coord;
 
416
 
 
417
      valid = gimp_stroke_get_point_at_dist (stroke, dist, precision,
 
418
                                             &coord, &slope);
 
419
      x_point = valid ? coord.x : 0;
 
420
      y_point = valid ? coord.y : 0;
 
421
    }
 
422
  else
 
423
    success = FALSE;
 
424
}
 
425
CODE
 
426
    );
 
427
}
 
428
 
 
429
sub vectors_remove_stroke {
 
430
    $blurb = 'remove the stroke from a vectors object.';
 
431
 
 
432
    $help = <<'HELP';
 
433
Remove the stroke from a vectors object.
 
434
HELP
 
435
 
 
436
    &simon_pdb_misc('2005', '2.4');
 
437
 
 
438
    @inargs = (
 
439
        { name => 'vectors', type => 'vectors',
 
440
          desc => 'The vectors object' },
 
441
        { name => 'stroke_id', type => 'int32',
 
442
          desc => 'The stroke ID' }
 
443
    );
 
444
 
 
445
    %invoke = (
 
446
        code => <<"CODE"
 
447
{
 
448
  GimpStroke *stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id);
 
449
  
 
450
  if (stroke)
 
451
    gimp_vectors_stroke_remove (vectors, stroke);
 
452
  else
 
453
    success = FALSE;
 
454
}
 
455
CODE
 
456
    );
 
457
}
 
458
 
 
459
sub vectors_stroke_close {
 
460
    $blurb = 'closes the specified stroke.';
 
461
 
 
462
    $help = <<'HELP';
 
463
Closes the specified stroke.
 
464
HELP
 
465
 
 
466
    &simon_pdb_misc('2005', '2.4');
 
467
 
 
468
    @inargs = (
 
469
        { name => 'vectors', type => 'vectors',
 
470
          desc => 'The vectors object' },
 
471
        { name => 'stroke_id', type => 'int32',
 
472
          desc => 'The stroke ID' }
 
473
    );
 
474
 
 
475
    %invoke = (
 
476
        code => <<"CODE"
 
477
{
 
478
  GimpStroke *stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id);
 
479
  
 
480
  if (stroke)
 
481
    gimp_stroke_close (stroke);
 
482
  else
 
483
    success = FALSE;
 
484
}
 
485
CODE
 
486
    );
 
487
}
 
488
 
 
489
 
 
490
sub vectors_stroke_translate {
 
491
    $blurb = 'translate the given stroke.';
 
492
 
 
493
    $help = <<'HELP';
 
494
Translate the given stroke.
 
495
HELP
 
496
 
 
497
    &simon_pdb_misc('2005', '2.4');
 
498
 
 
499
    @inargs = (
 
500
        { name => 'vectors', type => 'vectors',
 
501
          desc => 'The vectors object' },
 
502
        { name => 'stroke_id', type => 'int32',
 
503
          desc => 'The stroke ID' },
 
504
        { name => "off_x", type => 'int32',
 
505
          desc => "Offset in x direction" },
 
506
        { name => "off_y", type => 'int32',
 
507
          desc => "Offset in y direction" }
 
508
    );
 
509
 
 
510
    %invoke = (
 
511
        code => <<"CODE"
 
512
{
 
513
  GimpStroke *stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id);
 
514
  
 
515
  if (stroke)
 
516
    gimp_stroke_translate (stroke, off_x, off_y);
 
517
  else
 
518
    success = FALSE;
 
519
}
 
520
CODE
 
521
    );
 
522
}
 
523
 
 
524
sub vectors_stroke_scale {
 
525
    $blurb = 'scales the given stroke.';
 
526
 
 
527
    $help = <<'HELP';
 
528
Scale the given stroke.
 
529
HELP
 
530
 
 
531
    &simon_pdb_misc('2005', '2.4');
 
532
 
 
533
    @inargs = (
 
534
        { name => 'vectors', type => 'vectors',
 
535
          desc => 'The vectors object' },
 
536
        { name => 'stroke_id', type => 'int32',
 
537
          desc => 'The stroke ID' },
 
538
        { name => "scale_x", type => 'float',
 
539
          desc => "Scale factor in x direction" },
 
540
        { name => "scale_y", type => 'float',
 
541
          desc => "Scale factor in y direction" }
 
542
    );
 
543
 
 
544
    %invoke = (
 
545
        code => <<"CODE"
 
546
{
 
547
  GimpStroke *stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id);
 
548
  
 
549
  if (stroke)
 
550
    gimp_stroke_scale (stroke, scale_x, scale_y);
 
551
  else
 
552
    success = FALSE;
 
553
}
 
554
CODE
 
555
    );
 
556
}
 
557
 
 
558
sub vectors_stroke_rotate {
 
559
    $blurb = 'rotates the given stroke.';
 
560
 
 
561
    $help = <<'HELP';
 
562
Rotates the given stroke around given center by angle (in degrees).
 
563
HELP
 
564
 
 
565
    &joao_pdb_misc('2006', '2.4');
 
566
    @inargs = (
 
567
        { name => 'vectors', type => 'vectors',
 
568
          desc => 'The vectors object' },
 
569
        { name => 'stroke_id', type => 'int32',
 
570
          desc => 'The stroke ID' },
 
571
        { name => "center_x", type => 'float',
 
572
          desc => "X coordinate of the rotation center" },
 
573
        { name => "center_y", type => 'float',
 
574
          desc => "Y coordinate of the rotation center" },
 
575
        { name => "angle", type => 'float',
 
576
          desc => "angle to rotate about" }
 
577
    );
 
578
 
 
579
    %invoke = (
 
580
        code => <<"CODE"
 
581
{
 
582
  GimpStroke *stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id);
 
583
  
 
584
  if (stroke)
 
585
    gimp_stroke_rotate (stroke, center_x, center_y, angle);
 
586
  else
 
587
    success = FALSE;
 
588
}
 
589
CODE
 
590
    );
 
591
}
 
592
 
 
593
sub vectors_stroke_flip {
 
594
    $blurb = 'flips the given stroke.';
 
595
 
 
596
    $help = <<'HELP';
 
597
Rotates the given stroke around given center by angle (in degrees).
 
598
HELP
 
599
 
 
600
    &joao_pdb_misc('2006', '2.4');
 
601
    @inargs = (
 
602
        { name => 'vectors', type => 'vectors',
 
603
          desc => 'The vectors object' },
 
604
        { name => 'stroke_id', type => 'int32',
 
605
          desc => 'The stroke ID' },
 
606
        { name => "flip_type",
 
607
          type => 'enum GimpOrientationType (no GIMP_ORIENTATION_UNKNOWN)',
 
608
          desc => "Flip orientation, either vertical or horizontal" },
 
609
        { name => "axis", type => 'float',
 
610
          desc => "axis coordinate about which to flip, in pixels" }
 
611
    );
 
612
 
 
613
    %invoke = (
 
614
        code => <<"CODE"
 
615
{
 
616
  GimpStroke *stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id);
 
617
  
 
618
  if (stroke)
 
619
    gimp_stroke_flip (stroke, flip_type, axis);
 
620
  else
 
621
    success = FALSE;
 
622
}
 
623
CODE
 
624
    );
 
625
}
 
626
 
 
627
sub vectors_stroke_flip_free {
 
628
    $blurb = 'flips the given stroke about an arbitrary axis.';
 
629
 
 
630
    $help = <<'HELP';
 
631
Flips the given stroke about an arbitrary axis. Axis is defined by two coordinates
 
632
in the image (in pixels), through which the flipping axis passes.
 
633
HELP
 
634
 
 
635
    &joao_pdb_misc('2006', '2.4');
 
636
    @inargs = (
 
637
        { name => 'vectors', type => 'vectors',
 
638
          desc => 'The vectors object' },
 
639
        { name => 'stroke_id', type => 'int32',
 
640
          desc => 'The stroke ID' },
 
641
        { name => "x1", type => 'float',
 
642
          desc => "X coordinate of the first point of the flipping axis" },
 
643
        { name => "y1", type => 'float',
 
644
          desc => "Y coordinate of the first point of the flipping axis" },
 
645
        { name => "x2", type => 'float',
 
646
          desc => "X coordinate of the second point of the flipping axis" },
 
647
        { name => "y2", type => 'float',
 
648
          desc => "Y coordinate of the second point of the flipping axis" },
 
649
 
 
650
    );
 
651
 
 
652
    %invoke = (
 
653
        code => <<"CODE"
 
654
{
 
655
  GimpStroke *stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id);
 
656
  
 
657
  if (stroke)
 
658
    gimp_stroke_flip_free (stroke, x1, y1, x2, y2);
 
659
  else
 
660
    success = FALSE;
 
661
}
 
662
CODE
 
663
    );
 
664
}
 
665
 
 
666
sub vectors_stroke_get_points {
 
667
    $blurb = 'returns the control points of a stroke.';
 
668
 
 
669
    $help = <<'HELP';
 
670
returns the control points of a stroke. The interpretation of the coordinates
 
671
returned depends on the type of the stroke. For Gimp 2.4 this is always a
 
672
bezier stroke, where the coordinates are the control points.
 
673
HELP
 
674
 
 
675
    &simon_pdb_misc('2006', '2.4');
 
676
 
 
677
    @inargs = (
 
678
        { name => 'vectors', type => 'vectors',
 
679
          desc => 'The vectors object' },
 
680
        { name => 'stroke_id', type => 'int32',
 
681
          desc => 'The stroke ID' }
 
682
    );
 
683
 
 
684
    @outargs = (
 
685
        { name => 'type', type => 'enum GimpVectorsStrokeType',
 
686
          desc => 'type of the stroke (always GIMP_VECTORS_STROKE_TYPE_BEZIER for now).' },
 
687
        { name => 'controlpoints', type => 'floatarray',
 
688
          desc => 'List of the control points for the stroke (x0, y0, x1, y1, ...).',
 
689
          array => { name => 'num_points',
 
690
                     desc => 'The number of floats returned.' } },
 
691
        { name => 'closed', type => 'boolean',
 
692
          desc => 'Whether the stroke is closed or not.' }
 
693
    );
 
694
 
 
695
    %invoke = (
 
696
        code => <<"CODE"
 
697
{
 
698
  GimpStroke *stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id);
 
699
  
 
700
  if (stroke && GIMP_IS_BEZIER_STROKE (stroke))
 
701
    {
 
702
      GArray *points_array;
 
703
      gint    i;
 
704
 
 
705
      points_array = gimp_stroke_control_points_get (stroke, &closed);
 
706
 
 
707
      if (points_array)
 
708
        {
 
709
          num_points = points_array->len;
 
710
          controlpoints = g_new (gdouble, num_points * 2);
 
711
 
 
712
          type = GIMP_VECTORS_STROKE_TYPE_BEZIER;
 
713
          for (i = 0; i < num_points; i++)
 
714
            {
 
715
              controlpoints[2*i]   = g_array_index (points_array,
 
716
                                                    GimpAnchor, i).position.x;
 
717
              controlpoints[2*i+1] = g_array_index (points_array,
 
718
                                                    GimpAnchor, i).position.y;
 
719
            }
 
720
          g_array_free (points_array, TRUE);
 
721
          num_points *= 2;
 
722
        }
 
723
      else
 
724
        success = FALSE;
 
725
    }
 
726
  else
 
727
    success = FALSE;
 
728
}
 
729
CODE
 
730
    );
 
731
}
 
732
 
 
733
 
 
734
sub vectors_stroke_interpolate {
 
735
    $blurb = 'returns polygonal approximation of the stroke.';
 
736
 
 
737
    $help = <<'HELP';
 
738
returns polygonal approximation of the stroke.
 
739
HELP
 
740
 
 
741
    &simon_pdb_misc('2005', '2.4');
 
742
 
 
743
    @inargs = (
 
744
        { name => 'vectors', type => 'vectors',
 
745
          desc => 'The vectors object' },
 
746
        { name => 'stroke_id', type => 'int32',
 
747
          desc => 'The stroke ID' },
 
748
        { name => 'precision', type => 'float',
 
749
          desc => 'The precision used for the approximation' }
 
750
    );
 
751
 
 
752
    @outargs = (
 
753
        { name => 'coords', type => 'floatarray',
 
754
          desc => 'List of the coords along the path (x0, y0, x1, y1, ...).',
 
755
          array => { name => 'num_coords',
 
756
                     desc => 'The number of floats returned.' } },
 
757
        { name => 'closed', type => 'boolean',
 
758
          desc => 'Whether the stroke is closed or not.' }
 
759
    );
 
760
 
 
761
    %invoke = (
 
762
        code => <<"CODE"
 
763
{
 
764
  GimpStroke *stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id);
 
765
  
 
766
  if (stroke)
 
767
    {
 
768
      GArray *coords_array;
 
769
      gint    i;
 
770
 
 
771
      coords_array = gimp_stroke_interpolate (stroke, precision, &closed);
 
772
 
 
773
      if (coords_array)
 
774
        {
 
775
          num_coords = coords_array->len;
 
776
          coords = g_new (gdouble, num_coords * 2);
 
777
 
 
778
          for (i = 0; i < num_coords; i++)
 
779
            {
 
780
              coords[2*i]   = g_array_index (coords_array, GimpCoords, i).x;
 
781
              coords[2*i+1] = g_array_index (coords_array, GimpCoords, i).y;
 
782
            }
 
783
          g_array_free (coords_array, TRUE);
 
784
          num_coords *= 2;
 
785
        }
 
786
      else
 
787
        success = FALSE;
 
788
    }
 
789
  else
 
790
    success = FALSE;
 
791
}
 
792
CODE
 
793
    );
 
794
}
 
795
 
 
796
 
 
797
sub vectors_stroke_new_from_points {
 
798
    $blurb = 'Adds a stroke of a given type to the vectors object.';
 
799
 
 
800
    $help = <<'HELP';
 
801
Adds a stroke of a given type to the vectors object. The coordinates of the
 
802
control points can be specified.
 
803
For now only strokes of the type GIMP_VECTORS_STROKE_TYPE_BEZIER are supported.
 
804
The control points are specified as a pair of float values for the x- and
 
805
y-coordinate.
 
806
The Bezier stroke type needs a multiple of three control points. Each Bezier
 
807
segment endpoint (anchor, A) has two additional control points (C) associated.
 
808
They are specified in the order CACCACCAC...
 
809
HELP
 
810
 
 
811
    &simon_pdb_misc('2006', '2.4');
 
812
 
 
813
    @inargs = (
 
814
        { name => 'vectors', type => 'vectors',
 
815
          desc => 'The vectors object' },
 
816
        { name => 'type', type => 'enum GimpVectorsStrokeType',
 
817
          desc => 'type of the stroke (always GIMP_VECTORS_STROKE_TYPE_BEZIER for now).' },
 
818
        { name => 'controlpoints', type => 'floatarray',
 
819
          desc => 'List of the x- and y-coordinates of the control points.',
 
820
          array => { name => 'num_points',
 
821
                     desc => 'The number of elements in the array, i.e. the
 
822
                              number of controlpoints in the stroke * 2
 
823
                              (x- and y-coordinate).' } },
 
824
        { name => 'closed', type => 'boolean',
 
825
          desc => 'Whether the stroke is to be closed or not.' }
 
826
    );
 
827
 
 
828
    @outargs = (
 
829
        { name => 'stroke_id', type => 'int32',
 
830
          desc => 'The stroke ID of the newly created stroke.' }
 
831
    );
 
832
 
 
833
    %invoke = (
 
834
        code => <<"CODE"
 
835
{
 
836
  GimpStroke *stroke;
 
837
  GimpCoords *coords;
 
838
  GimpCoords  default_coords = GIMP_COORDS_DEFAULT_VALUES;
 
839
  gint i;
 
840
 
 
841
  success = FALSE;
 
842
 
 
843
  if (type == GIMP_VECTORS_STROKE_TYPE_BEZIER &&
 
844
      num_points % 6 == 0)
 
845
    {
 
846
      coords = g_new (GimpCoords, num_points);
 
847
      for (i = 0; i < num_points; i++)
 
848
        {
 
849
          coords[i] = default_coords;
 
850
          coords[i].x = controlpoints[i*2];
 
851
          coords[i].y = controlpoints[i*2+1];
 
852
        }
 
853
 
 
854
      stroke = gimp_stroke_new_from_coords (type, coords, num_points/2, closed);
 
855
      if (stroke)
 
856
        {
 
857
          gimp_vectors_stroke_add (vectors, stroke);
 
858
          stroke_id = gimp_stroke_get_ID (stroke);
 
859
 
 
860
          success = TRUE;
 
861
        }
 
862
 
 
863
      g_free (coords);
 
864
    }
 
865
}
 
866
CODE
 
867
    );
 
868
}
 
869
 
 
870
sub vectors_bezier_stroke_new_moveto {
 
871
    $blurb = 'Adds a bezier stroke with a single moveto to the vectors object.';
 
872
 
 
873
    $help = <<'HELP';
 
874
Adds a bezier stroke with a single moveto to the vectors object.
 
875
HELP
 
876
 
 
877
    &simon_pdb_misc('2005', '2.4');
 
878
 
 
879
    @inargs = (
 
880
        { name => 'vectors', type => 'vectors',
 
881
          desc => 'The vectors object' },
 
882
        { name => 'x0', type => 'float',
 
883
          desc => 'The x-coordinate of the moveto' },
 
884
        { name => 'y0', type => 'float',
 
885
          desc => 'The y-coordinate of the moveto' }
 
886
    );
 
887
 
 
888
    @outargs = (
 
889
        { name => 'stroke_id', type => 'int32',
 
890
          desc => 'The resulting stroke' }
 
891
    );
 
892
 
 
893
    %invoke = (
 
894
        code => <<"CODE"
 
895
{
 
896
  GimpStroke *stroke;
 
897
  GimpCoords  coord0 = GIMP_COORDS_DEFAULT_VALUES;
 
898
 
 
899
  coord0.x = x0;
 
900
  coord0.y = y0;
 
901
 
 
902
  stroke = gimp_bezier_stroke_new_moveto (&coord0);
 
903
  gimp_vectors_stroke_add (vectors, stroke);
 
904
  stroke_id = gimp_stroke_get_ID (stroke);
 
905
}
 
906
CODE
 
907
    );
 
908
}
 
909
 
 
910
sub vectors_bezier_stroke_lineto {
 
911
    $blurb = 'Extends a bezier stroke with a lineto.';
 
912
 
 
913
    $help = <<'HELP';
 
914
Extends a bezier stroke with a lineto.
 
915
HELP
 
916
 
 
917
    &simon_pdb_misc('2005', '2.4');
 
918
 
 
919
    @inargs = (
 
920
        { name => 'vectors', type => 'vectors',
 
921
          desc => 'The vectors object' },
 
922
        { name => 'stroke_id', type => 'int32',
 
923
          desc => 'The stroke ID' },
 
924
        { name => 'x0', type => 'float',
 
925
          desc => 'The x-coordinate of the lineto' },
 
926
        { name => 'y0', type => 'float',
 
927
          desc => 'The y-coordinate of the lineto' }
 
928
    );
 
929
 
 
930
    %invoke = (
 
931
        code => <<"CODE"
 
932
{
 
933
  GimpStroke *stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id);
 
934
 
 
935
  if (stroke)
 
936
    {
 
937
      GimpCoords coord0 = GIMP_COORDS_DEFAULT_VALUES;
 
938
 
 
939
      coord0.x = x0;
 
940
      coord0.y = y0;
 
941
 
 
942
      gimp_bezier_stroke_lineto (stroke, &coord0);
 
943
    }
 
944
  else
 
945
    success = FALSE;
 
946
}
 
947
CODE
 
948
    );
 
949
}
 
950
 
 
951
sub vectors_bezier_stroke_conicto {
 
952
    $blurb = 'Extends a bezier stroke with a conic bezier spline.';
 
953
 
 
954
    $help = <<'HELP';
 
955
Extends a bezier stroke with a conic bezier spline. Actually a
 
956
cubic bezier spline gets added that realizes the shape of a conic
 
957
bezier spline.
 
958
HELP
 
959
 
 
960
    &simon_pdb_misc('2005', '2.4');
 
961
 
 
962
    @inargs = (
 
963
        { name => 'vectors', type => 'vectors',
 
964
          desc => 'The vectors object' },
 
965
        { name => 'stroke_id', type => 'int32',
 
966
          desc => 'The stroke ID' },
 
967
        { name => 'x0', type => 'float',
 
968
          desc => 'The x-coordinate of the control point' },
 
969
        { name => 'y0', type => 'float',
 
970
          desc => 'The y-coordinate of the control point' },
 
971
        { name => 'x1', type => 'float',
 
972
          desc => 'The x-coordinate of the end point' },
 
973
        { name => 'y1', type => 'float',
 
974
          desc => 'The y-coordinate of the end point' }
 
975
    );
 
976
 
 
977
    %invoke = (
 
978
        code => <<"CODE"
 
979
{
 
980
  GimpStroke *stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id);
 
981
 
 
982
  if (stroke)
 
983
    {
 
984
      GimpCoords coord0 = GIMP_COORDS_DEFAULT_VALUES;
 
985
      GimpCoords coord1 = GIMP_COORDS_DEFAULT_VALUES;
 
986
 
 
987
      coord0.x = x0;
 
988
      coord0.y = y0;
 
989
 
 
990
      coord1.x = x1;
 
991
      coord1.y = y1;
 
992
 
 
993
      gimp_bezier_stroke_conicto (stroke, &coord0, &coord1);
 
994
    }
 
995
  else
 
996
    success = FALSE;
 
997
}
 
998
CODE
 
999
    );
 
1000
}
 
1001
 
 
1002
sub vectors_bezier_stroke_cubicto {
 
1003
    $blurb = 'Extends a bezier stroke with a cubic bezier spline.';
 
1004
 
 
1005
    $help = <<'HELP';
 
1006
Extends a bezier stroke with a cubic bezier spline.
 
1007
HELP
 
1008
 
 
1009
    &simon_pdb_misc('2005', '2.4');
 
1010
 
 
1011
    @inargs = (
 
1012
        { name => 'vectors', type => 'vectors',
 
1013
          desc => 'The vectors object' },
 
1014
        { name => 'stroke_id', type => 'int32',
 
1015
          desc => 'The stroke ID' },
 
1016
        { name => 'x0', type => 'float',
 
1017
          desc => 'The x-coordinate of the first control point' },
 
1018
        { name => 'y0', type => 'float',
 
1019
          desc => 'The y-coordinate of the first control point' },
 
1020
        { name => 'x1', type => 'float',
 
1021
          desc => 'The x-coordinate of the second control point' },
 
1022
        { name => 'y1', type => 'float',
 
1023
          desc => 'The y-coordinate of the second control point' },
 
1024
        { name => 'x2', type => 'float',
 
1025
          desc => 'The x-coordinate of the end point' },
 
1026
        { name => 'y2', type => 'float',
 
1027
          desc => 'The y-coordinate of the end point' }
 
1028
    );
 
1029
 
 
1030
    %invoke = (
 
1031
        code => <<"CODE"
 
1032
{
 
1033
  GimpStroke *stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id);
 
1034
 
 
1035
  if (stroke)
 
1036
    {
 
1037
      GimpCoords coord0 = GIMP_COORDS_DEFAULT_VALUES;
 
1038
      GimpCoords coord1 = GIMP_COORDS_DEFAULT_VALUES;
 
1039
      GimpCoords coord2 = GIMP_COORDS_DEFAULT_VALUES;
 
1040
 
 
1041
      coord0.x = x0;
 
1042
      coord0.y = y0;
 
1043
 
 
1044
      coord1.x = x1;
 
1045
      coord1.y = y1;
 
1046
 
 
1047
      coord2.x = x2;
 
1048
      coord2.y = y2;
 
1049
 
 
1050
      gimp_bezier_stroke_cubicto (stroke, &coord0, &coord1, &coord2);
 
1051
    }
 
1052
  else
 
1053
    success = FALSE;
 
1054
}
 
1055
CODE
 
1056
    );
 
1057
}
 
1058
 
 
1059
sub vectors_bezier_stroke_new_ellipse {
 
1060
    $blurb = 'Adds a bezier stroke describing an ellipse the vectors object.';
 
1061
 
 
1062
    $help = <<'HELP';
 
1063
Adds a bezier stroke describing an ellipse the vectors object.
 
1064
HELP
 
1065
 
 
1066
    &simon_pdb_misc('2005', '2.4');
 
1067
 
 
1068
    @inargs = (
 
1069
        { name => 'vectors', type => 'vectors',
 
1070
          desc => 'The vectors object' },
 
1071
        { name => 'x0', type => 'float',
 
1072
          desc => 'The x-coordinate of the center' },
 
1073
        { name => 'y0', type => 'float',
 
1074
          desc => 'The y-coordinate of the center' },
 
1075
        { name => 'radius_x', type => 'float',
 
1076
          desc => 'The radius in x direction' },
 
1077
        { name => 'radius_y', type => 'float',
 
1078
          desc => 'The radius in y direction' },
 
1079
        { name => 'angle', type => 'float',
 
1080
          desc => 'The angle the x-axis of the ellipse
 
1081
                   (radians, counterclockwise)' }
 
1082
    );
 
1083
 
 
1084
    @outargs = (
 
1085
        { name => 'stroke_id', type => 'int32',
 
1086
          desc => 'The resulting stroke' }
 
1087
    );
 
1088
 
 
1089
    %invoke = (
 
1090
        code => <<"CODE"
 
1091
{
 
1092
  GimpStroke *stroke;
 
1093
  GimpCoords  coord0 = GIMP_COORDS_DEFAULT_VALUES;
 
1094
 
 
1095
  coord0.x = x0;
 
1096
  coord0.y = y0;
 
1097
 
 
1098
  stroke = gimp_bezier_stroke_new_ellipse (&coord0, radius_x, radius_y, angle);
 
1099
  gimp_vectors_stroke_add (vectors, stroke);
 
1100
  stroke_id = gimp_stroke_get_ID (stroke);
 
1101
}
 
1102
CODE
 
1103
    );
 
1104
}
 
1105
 
 
1106
sub vectors_to_selection {
 
1107
    $blurb = 'Transforms the specified vectors object into a selection';
 
1108
 
 
1109
    $help = <<'HELP';
 
1110
This procedure renders the desired vectors object into the current selection
 
1111
of the image the vectors object belongs to.
 
1112
HELP
 
1113
 
 
1114
    &simon_pdb_misc('2006', '2.4');
 
1115
 
 
1116
    @inargs = (
 
1117
        { name => 'vectors', type => 'vectors',
 
1118
          desc => 'The vectors object to render to the selection' },
 
1119
        { name => 'operation', type => 'enum GimpChannelOps',
 
1120
          desc => 'The desired operation with current selection' },
 
1121
        { name => 'antialias', type => 'boolean',
 
1122
          desc => 'Antialias selection.' },
 
1123
        { name => 'feather', type => 'boolean',
 
1124
          desc => 'Feather selection.' },
 
1125
        { name => 'feather_radius_x', type => 'float',
 
1126
          desc => 'Feather radius x.'  },
 
1127
        { name => 'feather_radius_y', type => 'float',
 
1128
          desc => 'Feather radius y.'  }
 
1129
    );
 
1130
 
 
1131
    %invoke = (
 
1132
        code => <<'CODE'
 
1133
{
 
1134
  GimpImage *image;
 
1135
 
 
1136
  image = gimp_item_get_image (GIMP_ITEM (vectors));
 
1137
 
 
1138
  if (image)
 
1139
    gimp_channel_select_vectors (gimp_image_get_mask (image),
 
1140
                                 _("Path to Selection"),
 
1141
                                 vectors,
 
1142
                                 operation,
 
1143
                                 antialias,
 
1144
                                 feather,
 
1145
                                 feather_radius_x,
 
1146
                                 feather_radius_y,
 
1147
                                 TRUE);
 
1148
  else
 
1149
    success = FALSE;
 
1150
}
 
1151
CODE
 
1152
    );
 
1153
 
 
1154
}
 
1155
 
 
1156
sub vectors_import_from_file {
 
1157
    $blurb = 'Import paths from an SVG file.';
 
1158
 
 
1159
    $help = <<'HELP';
 
1160
This procedure imports paths from an SVG file. SVG elements other than
 
1161
paths and basic shapes are ignored.
 
1162
HELP
 
1163
 
 
1164
    &simon_pdb_misc('2006', '2.4');
 
1165
 
 
1166
    @inargs = (
 
1167
        { name => 'image', type => 'image',
 
1168
          desc => 'The image' },
 
1169
        { name => 'filename', type => 'string', no_validate => 1,
 
1170
          desc => 'The name of the SVG file to import.' },
 
1171
        { name => 'merge', type => 'boolean',
 
1172
          desc => 'Merge paths into a single vectors object.' },
 
1173
        { name => 'scale', type => 'boolean',
 
1174
          desc => 'Scale the SVG to image dimensions.' }
 
1175
    );
 
1176
 
 
1177
    @outargs = (
 
1178
        { name => 'vectors_ids', type => 'int32array', void_ret => 1,
 
1179
          desc => 'The list of newly created vectors',
 
1180
          array => { name => 'num_vectors',
 
1181
                     desc => 'The number of newly created vectors' } }
 
1182
    );
 
1183
 
 
1184
    %invoke = (
 
1185
        headers => [ qw("vectors/gimpvectors-import.h") ],
 
1186
        code    => <<'CODE'
 
1187
{
 
1188
  GList *list, *vectors_list = NULL;
 
1189
 
 
1190
  success = gimp_vectors_import_file (image, filename,
 
1191
                                      merge, scale, -1, &vectors_list, NULL);
 
1192
 
 
1193
  if (success)
 
1194
    {
 
1195
      num_vectors = g_list_length (vectors_list);
 
1196
 
 
1197
      if (num_vectors)
 
1198
        {
 
1199
          gint i;
 
1200
      
 
1201
          vectors_ids = g_new (gint32, num_vectors);
 
1202
      
 
1203
          list = vectors_list;
 
1204
          for (i = 0; i < num_vectors; i++, list = g_list_next (list))
 
1205
            vectors_ids[i] = gimp_item_get_ID (GIMP_ITEM (list->data));
 
1206
 
 
1207
          g_list_free (vectors_list);
 
1208
        }
 
1209
    }
 
1210
}
 
1211
CODE
 
1212
    );
 
1213
}
 
1214
 
 
1215
sub vectors_import_from_string {
 
1216
    $blurb = 'Import paths from an SVG string.';
 
1217
 
 
1218
    $help = <<'HELP';
 
1219
This procedure works like gimp_vectors_import_from_file() but takes a string
 
1220
rather than reading the SVG from a file. This allows you to write scripts that
 
1221
generate SVG and feed it to GIMP.
 
1222
HELP
 
1223
 
 
1224
    &simon_pdb_misc('2006', '2.4');
 
1225
 
 
1226
    @inargs = (
 
1227
        { name => 'image', type => 'image',
 
1228
          desc => 'The image' },
 
1229
        { name => 'string', type => 'string', no_validate => 1,
 
1230
          desc => 'A string that must be a complete and valid SVG document.' },
 
1231
        { name => 'length', type => 'int32',
 
1232
          desc => 'Number of bytes in string or -1 if the string is NULL
 
1233
                   terminated.' },
 
1234
        { name => 'merge', type => 'boolean',
 
1235
          desc => 'Merge paths into a single vectors object.' },
 
1236
        { name => 'scale', type => 'boolean',
 
1237
          desc => 'Scale the SVG to image dimensions.' }
 
1238
    );
 
1239
 
 
1240
    @outargs = (
 
1241
        { name => 'vectors_ids', type => 'int32array', void_ret => 1,
 
1242
          desc => 'The list of newly created vectors',
 
1243
          array => { name => 'num_vectors',
 
1244
                     desc => 'The number of newly created vectors' } }
 
1245
    );
 
1246
 
 
1247
    %invoke = (
 
1248
        headers => [ qw("vectors/gimpvectors-import.h") ],
 
1249
        code    => <<'CODE'
 
1250
{
 
1251
  GList *list, *vectors_list = NULL;
 
1252
 
 
1253
  success = gimp_vectors_import_buffer (image, string, length,
 
1254
                                        merge, scale, -1, &vectors_list, NULL);
 
1255
 
 
1256
  if (success)
 
1257
    {
 
1258
      num_vectors = g_list_length (vectors_list);
 
1259
 
 
1260
      if (num_vectors)
 
1261
        {
 
1262
          gint i;
 
1263
      
 
1264
          vectors_ids = g_new (gint32, num_vectors);
 
1265
      
 
1266
          list = vectors_list;
 
1267
          for (i = 0; i < num_vectors; i++, list = g_list_next (list))
 
1268
            vectors_ids[i] = gimp_item_get_ID (GIMP_ITEM (list->data));
 
1269
 
 
1270
          g_list_free (vectors_list);
 
1271
        }
 
1272
    }
 
1273
}
 
1274
CODE
 
1275
    );
 
1276
}
 
1277
 
 
1278
 
 
1279
@headers = qw(<string.h> "core/gimp.h" "core/gimplist.h" "core/gimpimage.h"
 
1280
              "core/gimpchannel-select.h" "vectors/gimpanchor.h"
 
1281
              "vectors/gimpstroke-new.h"
 
1282
              "vectors/gimpbezierstroke.h"
 
1283
              "vectors/gimpvectors.h"
 
1284
              "gimp-intl.h");
 
1285
 
 
1286
@procs = qw(vectors_is_valid
 
1287
            vectors_new
 
1288
            vectors_get_image
 
1289
            vectors_get_name vectors_set_name
 
1290
            vectors_get_visible vectors_set_visible
 
1291
            vectors_get_linked vectors_set_linked
 
1292
            vectors_get_tattoo vectors_set_tattoo
 
1293
            vectors_get_strokes 
 
1294
            vectors_stroke_get_length
 
1295
            vectors_stroke_get_point_at_dist
 
1296
            vectors_remove_stroke
 
1297
            vectors_stroke_close
 
1298
            vectors_stroke_translate
 
1299
            vectors_stroke_scale
 
1300
            vectors_stroke_rotate
 
1301
            vectors_stroke_flip
 
1302
            vectors_stroke_flip_free
 
1303
            vectors_stroke_get_points
 
1304
            vectors_stroke_new_from_points
 
1305
            vectors_stroke_interpolate
 
1306
            vectors_bezier_stroke_new_moveto
 
1307
            vectors_bezier_stroke_lineto
 
1308
            vectors_bezier_stroke_conicto
 
1309
            vectors_bezier_stroke_cubicto
 
1310
            vectors_bezier_stroke_new_ellipse
 
1311
            vectors_to_selection
 
1312
            vectors_import_from_file
 
1313
            vectors_import_from_string);
 
1314
 
 
1315
%exports = (app => [@procs], lib => [@procs]);
 
1316
 
 
1317
$desc = 'Vectors';
 
1318
 
 
1319
1;