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

« back to all changes in this revision

Viewing changes to app/pdb/parasite-cmds.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2008-10-06 13:30:41 UTC
  • mto: This revision was merged to the branch mainline in revision 35.
  • Revision ID: james.westby@ubuntu.com-20081006133041-3panbkcanaymfsmp
Tags: upstream-2.6.0
ImportĀ upstreamĀ versionĀ 2.6.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* GIMP - The GNU Image Manipulation Program
 
2
 * Copyright (C) 1995-2003 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
 
 
19
/* NOTE: This file is auto-generated by pdbgen.pl. */
 
20
 
 
21
#include "config.h"
 
22
 
 
23
#include <glib-object.h>
 
24
 
 
25
#include "libgimpbase/gimpbase.h"
 
26
 
 
27
#include "pdb-types.h"
 
28
 
 
29
#include "core/gimp-parasites.h"
 
30
#include "core/gimpdrawable.h"
 
31
#include "core/gimpimage.h"
 
32
#include "core/gimpparamspecs.h"
 
33
#include "vectors/gimpvectors.h"
 
34
 
 
35
#include "gimppdb.h"
 
36
#include "gimpprocedure.h"
 
37
#include "internal-procs.h"
 
38
 
 
39
 
 
40
static GValueArray *
 
41
parasite_find_invoker (GimpProcedure      *procedure,
 
42
                       Gimp               *gimp,
 
43
                       GimpContext        *context,
 
44
                       GimpProgress       *progress,
 
45
                       const GValueArray  *args,
 
46
                       GError            **error)
 
47
{
 
48
  gboolean success = TRUE;
 
49
  GValueArray *return_vals;
 
50
  const gchar *name;
 
51
  GimpParasite *parasite = NULL;
 
52
 
 
53
  name = g_value_get_string (&args->values[0]);
 
54
 
 
55
  if (success)
 
56
    {
 
57
      parasite = gimp_parasite_copy (gimp_parasite_find (gimp, name));
 
58
 
 
59
      if (! parasite)
 
60
        success = FALSE;
 
61
    }
 
62
 
 
63
  return_vals = gimp_procedure_get_return_values (procedure, success,
 
64
                                                  error ? *error : NULL);
 
65
 
 
66
  if (success)
 
67
    g_value_take_boxed (&return_vals->values[1], parasite);
 
68
 
 
69
  return return_vals;
 
70
}
 
71
 
 
72
static GValueArray *
 
73
parasite_attach_invoker (GimpProcedure      *procedure,
 
74
                         Gimp               *gimp,
 
75
                         GimpContext        *context,
 
76
                         GimpProgress       *progress,
 
77
                         const GValueArray  *args,
 
78
                         GError            **error)
 
79
{
 
80
  gboolean success = TRUE;
 
81
  const GimpParasite *parasite;
 
82
 
 
83
  parasite = g_value_get_boxed (&args->values[0]);
 
84
 
 
85
  if (success)
 
86
    {
 
87
      gimp_parasite_attach (gimp, parasite);
 
88
    }
 
89
 
 
90
  return gimp_procedure_get_return_values (procedure, success,
 
91
                                           error ? *error : NULL);
 
92
}
 
93
 
 
94
static GValueArray *
 
95
parasite_detach_invoker (GimpProcedure      *procedure,
 
96
                         Gimp               *gimp,
 
97
                         GimpContext        *context,
 
98
                         GimpProgress       *progress,
 
99
                         const GValueArray  *args,
 
100
                         GError            **error)
 
101
{
 
102
  gboolean success = TRUE;
 
103
  const gchar *name;
 
104
 
 
105
  name = g_value_get_string (&args->values[0]);
 
106
 
 
107
  if (success)
 
108
    {
 
109
      gimp_parasite_detach (gimp, name);
 
110
    }
 
111
 
 
112
  return gimp_procedure_get_return_values (procedure, success,
 
113
                                           error ? *error : NULL);
 
114
}
 
115
 
 
116
static GValueArray *
 
117
parasite_list_invoker (GimpProcedure      *procedure,
 
118
                       Gimp               *gimp,
 
119
                       GimpContext        *context,
 
120
                       GimpProgress       *progress,
 
121
                       const GValueArray  *args,
 
122
                       GError            **error)
 
123
{
 
124
  GValueArray *return_vals;
 
125
  gint32 num_parasites = 0;
 
126
  gchar **parasites = NULL;
 
127
 
 
128
  parasites = gimp_parasite_list (gimp, &num_parasites);
 
129
 
 
130
  return_vals = gimp_procedure_get_return_values (procedure, TRUE, NULL);
 
131
 
 
132
  g_value_set_int (&return_vals->values[1], num_parasites);
 
133
  gimp_value_take_stringarray (&return_vals->values[2], parasites, num_parasites);
 
134
 
 
135
  return return_vals;
 
136
}
 
137
 
 
138
static GValueArray *
 
139
image_parasite_find_invoker (GimpProcedure      *procedure,
 
140
                             Gimp               *gimp,
 
141
                             GimpContext        *context,
 
142
                             GimpProgress       *progress,
 
143
                             const GValueArray  *args,
 
144
                             GError            **error)
 
145
{
 
146
  gboolean success = TRUE;
 
147
  GValueArray *return_vals;
 
148
  GimpImage *image;
 
149
  const gchar *name;
 
150
  GimpParasite *parasite = NULL;
 
151
 
 
152
  image = gimp_value_get_image (&args->values[0], gimp);
 
153
  name = g_value_get_string (&args->values[1]);
 
154
 
 
155
  if (success)
 
156
    {
 
157
      parasite = gimp_parasite_copy (gimp_image_parasite_find (image, name));
 
158
 
 
159
      if (! parasite)
 
160
        success = FALSE;
 
161
    }
 
162
 
 
163
  return_vals = gimp_procedure_get_return_values (procedure, success,
 
164
                                                  error ? *error : NULL);
 
165
 
 
166
  if (success)
 
167
    g_value_take_boxed (&return_vals->values[1], parasite);
 
168
 
 
169
  return return_vals;
 
170
}
 
171
 
 
172
static GValueArray *
 
173
image_parasite_attach_invoker (GimpProcedure      *procedure,
 
174
                               Gimp               *gimp,
 
175
                               GimpContext        *context,
 
176
                               GimpProgress       *progress,
 
177
                               const GValueArray  *args,
 
178
                               GError            **error)
 
179
{
 
180
  gboolean success = TRUE;
 
181
  GimpImage *image;
 
182
  const GimpParasite *parasite;
 
183
 
 
184
  image = gimp_value_get_image (&args->values[0], gimp);
 
185
  parasite = g_value_get_boxed (&args->values[1]);
 
186
 
 
187
  if (success)
 
188
    {
 
189
      gimp_image_parasite_attach (image, parasite);
 
190
    }
 
191
 
 
192
  return gimp_procedure_get_return_values (procedure, success,
 
193
                                           error ? *error : NULL);
 
194
}
 
195
 
 
196
static GValueArray *
 
197
image_parasite_detach_invoker (GimpProcedure      *procedure,
 
198
                               Gimp               *gimp,
 
199
                               GimpContext        *context,
 
200
                               GimpProgress       *progress,
 
201
                               const GValueArray  *args,
 
202
                               GError            **error)
 
203
{
 
204
  gboolean success = TRUE;
 
205
  GimpImage *image;
 
206
  const gchar *name;
 
207
 
 
208
  image = gimp_value_get_image (&args->values[0], gimp);
 
209
  name = g_value_get_string (&args->values[1]);
 
210
 
 
211
  if (success)
 
212
    {
 
213
      gimp_image_parasite_detach (image, name);
 
214
    }
 
215
 
 
216
  return gimp_procedure_get_return_values (procedure, success,
 
217
                                           error ? *error : NULL);
 
218
}
 
219
 
 
220
static GValueArray *
 
221
image_parasite_list_invoker (GimpProcedure      *procedure,
 
222
                             Gimp               *gimp,
 
223
                             GimpContext        *context,
 
224
                             GimpProgress       *progress,
 
225
                             const GValueArray  *args,
 
226
                             GError            **error)
 
227
{
 
228
  gboolean success = TRUE;
 
229
  GValueArray *return_vals;
 
230
  GimpImage *image;
 
231
  gint32 num_parasites = 0;
 
232
  gchar **parasites = NULL;
 
233
 
 
234
  image = gimp_value_get_image (&args->values[0], gimp);
 
235
 
 
236
  if (success)
 
237
    {
 
238
      parasites = gimp_image_parasite_list (image, &num_parasites);
 
239
    }
 
240
 
 
241
  return_vals = gimp_procedure_get_return_values (procedure, success,
 
242
                                                  error ? *error : NULL);
 
243
 
 
244
  if (success)
 
245
    {
 
246
      g_value_set_int (&return_vals->values[1], num_parasites);
 
247
      gimp_value_take_stringarray (&return_vals->values[2], parasites, num_parasites);
 
248
    }
 
249
 
 
250
  return return_vals;
 
251
}
 
252
 
 
253
static GValueArray *
 
254
drawable_parasite_find_invoker (GimpProcedure      *procedure,
 
255
                                Gimp               *gimp,
 
256
                                GimpContext        *context,
 
257
                                GimpProgress       *progress,
 
258
                                const GValueArray  *args,
 
259
                                GError            **error)
 
260
{
 
261
  gboolean success = TRUE;
 
262
  GValueArray *return_vals;
 
263
  GimpDrawable *drawable;
 
264
  const gchar *name;
 
265
  GimpParasite *parasite = NULL;
 
266
 
 
267
  drawable = gimp_value_get_drawable (&args->values[0], gimp);
 
268
  name = g_value_get_string (&args->values[1]);
 
269
 
 
270
  if (success)
 
271
    {
 
272
      parasite = gimp_parasite_copy (gimp_item_parasite_find (GIMP_ITEM (drawable),
 
273
                                                              name));
 
274
 
 
275
      if (! parasite)
 
276
        success = FALSE;
 
277
    }
 
278
 
 
279
  return_vals = gimp_procedure_get_return_values (procedure, success,
 
280
                                                  error ? *error : NULL);
 
281
 
 
282
  if (success)
 
283
    g_value_take_boxed (&return_vals->values[1], parasite);
 
284
 
 
285
  return return_vals;
 
286
}
 
287
 
 
288
static GValueArray *
 
289
drawable_parasite_attach_invoker (GimpProcedure      *procedure,
 
290
                                  Gimp               *gimp,
 
291
                                  GimpContext        *context,
 
292
                                  GimpProgress       *progress,
 
293
                                  const GValueArray  *args,
 
294
                                  GError            **error)
 
295
{
 
296
  gboolean success = TRUE;
 
297
  GimpDrawable *drawable;
 
298
  const GimpParasite *parasite;
 
299
 
 
300
  drawable = gimp_value_get_drawable (&args->values[0], gimp);
 
301
  parasite = g_value_get_boxed (&args->values[1]);
 
302
 
 
303
  if (success)
 
304
    {
 
305
      gimp_item_parasite_attach (GIMP_ITEM (drawable), parasite);
 
306
    }
 
307
 
 
308
  return gimp_procedure_get_return_values (procedure, success,
 
309
                                           error ? *error : NULL);
 
310
}
 
311
 
 
312
static GValueArray *
 
313
drawable_parasite_detach_invoker (GimpProcedure      *procedure,
 
314
                                  Gimp               *gimp,
 
315
                                  GimpContext        *context,
 
316
                                  GimpProgress       *progress,
 
317
                                  const GValueArray  *args,
 
318
                                  GError            **error)
 
319
{
 
320
  gboolean success = TRUE;
 
321
  GimpDrawable *drawable;
 
322
  const gchar *name;
 
323
 
 
324
  drawable = gimp_value_get_drawable (&args->values[0], gimp);
 
325
  name = g_value_get_string (&args->values[1]);
 
326
 
 
327
  if (success)
 
328
    {
 
329
      gimp_item_parasite_detach (GIMP_ITEM (drawable), name);
 
330
    }
 
331
 
 
332
  return gimp_procedure_get_return_values (procedure, success,
 
333
                                           error ? *error : NULL);
 
334
}
 
335
 
 
336
static GValueArray *
 
337
drawable_parasite_list_invoker (GimpProcedure      *procedure,
 
338
                                Gimp               *gimp,
 
339
                                GimpContext        *context,
 
340
                                GimpProgress       *progress,
 
341
                                const GValueArray  *args,
 
342
                                GError            **error)
 
343
{
 
344
  gboolean success = TRUE;
 
345
  GValueArray *return_vals;
 
346
  GimpDrawable *drawable;
 
347
  gint32 num_parasites = 0;
 
348
  gchar **parasites = NULL;
 
349
 
 
350
  drawable = gimp_value_get_drawable (&args->values[0], gimp);
 
351
 
 
352
  if (success)
 
353
    {
 
354
      parasites = gimp_item_parasite_list (GIMP_ITEM (drawable), &num_parasites);
 
355
    }
 
356
 
 
357
  return_vals = gimp_procedure_get_return_values (procedure, success,
 
358
                                                  error ? *error : NULL);
 
359
 
 
360
  if (success)
 
361
    {
 
362
      g_value_set_int (&return_vals->values[1], num_parasites);
 
363
      gimp_value_take_stringarray (&return_vals->values[2], parasites, num_parasites);
 
364
    }
 
365
 
 
366
  return return_vals;
 
367
}
 
368
 
 
369
static GValueArray *
 
370
vectors_parasite_find_invoker (GimpProcedure      *procedure,
 
371
                               Gimp               *gimp,
 
372
                               GimpContext        *context,
 
373
                               GimpProgress       *progress,
 
374
                               const GValueArray  *args,
 
375
                               GError            **error)
 
376
{
 
377
  gboolean success = TRUE;
 
378
  GValueArray *return_vals;
 
379
  GimpVectors *vectors;
 
380
  const gchar *name;
 
381
  GimpParasite *parasite = NULL;
 
382
 
 
383
  vectors = gimp_value_get_vectors (&args->values[0], gimp);
 
384
  name = g_value_get_string (&args->values[1]);
 
385
 
 
386
  if (success)
 
387
    {
 
388
      parasite = gimp_parasite_copy (gimp_item_parasite_find (GIMP_ITEM (vectors),
 
389
                                                              name));
 
390
 
 
391
      if (! parasite)
 
392
        success = FALSE;
 
393
    }
 
394
 
 
395
  return_vals = gimp_procedure_get_return_values (procedure, success,
 
396
                                                  error ? *error : NULL);
 
397
 
 
398
  if (success)
 
399
    g_value_take_boxed (&return_vals->values[1], parasite);
 
400
 
 
401
  return return_vals;
 
402
}
 
403
 
 
404
static GValueArray *
 
405
vectors_parasite_attach_invoker (GimpProcedure      *procedure,
 
406
                                 Gimp               *gimp,
 
407
                                 GimpContext        *context,
 
408
                                 GimpProgress       *progress,
 
409
                                 const GValueArray  *args,
 
410
                                 GError            **error)
 
411
{
 
412
  gboolean success = TRUE;
 
413
  GimpVectors *vectors;
 
414
  const GimpParasite *parasite;
 
415
 
 
416
  vectors = gimp_value_get_vectors (&args->values[0], gimp);
 
417
  parasite = g_value_get_boxed (&args->values[1]);
 
418
 
 
419
  if (success)
 
420
    {
 
421
      gimp_item_parasite_attach (GIMP_ITEM (vectors), parasite);
 
422
    }
 
423
 
 
424
  return gimp_procedure_get_return_values (procedure, success,
 
425
                                           error ? *error : NULL);
 
426
}
 
427
 
 
428
static GValueArray *
 
429
vectors_parasite_detach_invoker (GimpProcedure      *procedure,
 
430
                                 Gimp               *gimp,
 
431
                                 GimpContext        *context,
 
432
                                 GimpProgress       *progress,
 
433
                                 const GValueArray  *args,
 
434
                                 GError            **error)
 
435
{
 
436
  gboolean success = TRUE;
 
437
  GimpVectors *vectors;
 
438
  const gchar *name;
 
439
 
 
440
  vectors = gimp_value_get_vectors (&args->values[0], gimp);
 
441
  name = g_value_get_string (&args->values[1]);
 
442
 
 
443
  if (success)
 
444
    {
 
445
      gimp_item_parasite_detach (GIMP_ITEM (vectors), name);
 
446
    }
 
447
 
 
448
  return gimp_procedure_get_return_values (procedure, success,
 
449
                                           error ? *error : NULL);
 
450
}
 
451
 
 
452
static GValueArray *
 
453
vectors_parasite_list_invoker (GimpProcedure      *procedure,
 
454
                               Gimp               *gimp,
 
455
                               GimpContext        *context,
 
456
                               GimpProgress       *progress,
 
457
                               const GValueArray  *args,
 
458
                               GError            **error)
 
459
{
 
460
  gboolean success = TRUE;
 
461
  GValueArray *return_vals;
 
462
  GimpVectors *vectors;
 
463
  gint32 num_parasites = 0;
 
464
  gchar **parasites = NULL;
 
465
 
 
466
  vectors = gimp_value_get_vectors (&args->values[0], gimp);
 
467
 
 
468
  if (success)
 
469
    {
 
470
      parasites = gimp_item_parasite_list (GIMP_ITEM (vectors), &num_parasites);
 
471
    }
 
472
 
 
473
  return_vals = gimp_procedure_get_return_values (procedure, success,
 
474
                                                  error ? *error : NULL);
 
475
 
 
476
  if (success)
 
477
    {
 
478
      g_value_set_int (&return_vals->values[1], num_parasites);
 
479
      gimp_value_take_stringarray (&return_vals->values[2], parasites, num_parasites);
 
480
    }
 
481
 
 
482
  return return_vals;
 
483
}
 
484
 
 
485
void
 
486
register_parasite_procs (GimpPDB *pdb)
 
487
{
 
488
  GimpProcedure *procedure;
 
489
 
 
490
  /*
 
491
   * gimp-parasite-find
 
492
   */
 
493
  procedure = gimp_procedure_new (parasite_find_invoker);
 
494
  gimp_object_set_static_name (GIMP_OBJECT (procedure),
 
495
                               "gimp-parasite-find");
 
496
  gimp_procedure_set_static_strings (procedure,
 
497
                                     "gimp-parasite-find",
 
498
                                     "Look up a global parasite.",
 
499
                                     "Finds and returns the global parasite that was previously attached.",
 
500
                                     "Jay Cox",
 
501
                                     "Jay Cox",
 
502
                                     "1998",
 
503
                                     NULL);
 
504
  gimp_procedure_add_argument (procedure,
 
505
                               gimp_param_spec_string ("name",
 
506
                                                       "name",
 
507
                                                       "The name of the parasite to find",
 
508
                                                       FALSE, FALSE, FALSE,
 
509
                                                       NULL,
 
510
                                                       GIMP_PARAM_READWRITE));
 
511
  gimp_procedure_add_return_value (procedure,
 
512
                                   gimp_param_spec_parasite ("parasite",
 
513
                                                             "parasite",
 
514
                                                             "The found parasite",
 
515
                                                             GIMP_PARAM_READWRITE));
 
516
  gimp_pdb_register_procedure (pdb, procedure);
 
517
  g_object_unref (procedure);
 
518
 
 
519
  /*
 
520
   * gimp-parasite-attach
 
521
   */
 
522
  procedure = gimp_procedure_new (parasite_attach_invoker);
 
523
  gimp_object_set_static_name (GIMP_OBJECT (procedure),
 
524
                               "gimp-parasite-attach");
 
525
  gimp_procedure_set_static_strings (procedure,
 
526
                                     "gimp-parasite-attach",
 
527
                                     "Add a global parasite.",
 
528
                                     "This procedure attaches a global parasite. It has no return values.",
 
529
                                     "Jay Cox",
 
530
                                     "Jay Cox",
 
531
                                     "1998",
 
532
                                     NULL);
 
533
  gimp_procedure_add_argument (procedure,
 
534
                               gimp_param_spec_parasite ("parasite",
 
535
                                                         "parasite",
 
536
                                                         "The parasite to attach",
 
537
                                                         GIMP_PARAM_READWRITE));
 
538
  gimp_pdb_register_procedure (pdb, procedure);
 
539
  g_object_unref (procedure);
 
540
 
 
541
  /*
 
542
   * gimp-parasite-detach
 
543
   */
 
544
  procedure = gimp_procedure_new (parasite_detach_invoker);
 
545
  gimp_object_set_static_name (GIMP_OBJECT (procedure),
 
546
                               "gimp-parasite-detach");
 
547
  gimp_procedure_set_static_strings (procedure,
 
548
                                     "gimp-parasite-detach",
 
549
                                     "Removes a global parasite.",
 
550
                                     "This procedure detaches a global parasite from. It has no return values.",
 
551
                                     "Jay Cox",
 
552
                                     "Jay Cox",
 
553
                                     "1998",
 
554
                                     NULL);
 
555
  gimp_procedure_add_argument (procedure,
 
556
                               gimp_param_spec_string ("name",
 
557
                                                       "name",
 
558
                                                       "The name of the parasite to detach.",
 
559
                                                       FALSE, FALSE, FALSE,
 
560
                                                       NULL,
 
561
                                                       GIMP_PARAM_READWRITE));
 
562
  gimp_pdb_register_procedure (pdb, procedure);
 
563
  g_object_unref (procedure);
 
564
 
 
565
  /*
 
566
   * gimp-parasite-list
 
567
   */
 
568
  procedure = gimp_procedure_new (parasite_list_invoker);
 
569
  gimp_object_set_static_name (GIMP_OBJECT (procedure),
 
570
                               "gimp-parasite-list");
 
571
  gimp_procedure_set_static_strings (procedure,
 
572
                                     "gimp-parasite-list",
 
573
                                     "List all parasites.",
 
574
                                     "Returns a list of all currently attached global parasites.",
 
575
                                     "Marc Lehmann",
 
576
                                     "Marc Lehmann",
 
577
                                     "1999",
 
578
                                     NULL);
 
579
  gimp_procedure_add_return_value (procedure,
 
580
                                   gimp_param_spec_int32 ("num-parasites",
 
581
                                                          "num parasites",
 
582
                                                          "The number of attached parasites",
 
583
                                                          0, G_MAXINT32, 0,
 
584
                                                          GIMP_PARAM_READWRITE));
 
585
  gimp_procedure_add_return_value (procedure,
 
586
                                   gimp_param_spec_string_array ("parasites",
 
587
                                                                 "parasites",
 
588
                                                                 "The names of currently attached parasites",
 
589
                                                                 GIMP_PARAM_READWRITE));
 
590
  gimp_pdb_register_procedure (pdb, procedure);
 
591
  g_object_unref (procedure);
 
592
 
 
593
  /*
 
594
   * gimp-image-parasite-find
 
595
   */
 
596
  procedure = gimp_procedure_new (image_parasite_find_invoker);
 
597
  gimp_object_set_static_name (GIMP_OBJECT (procedure),
 
598
                               "gimp-image-parasite-find");
 
599
  gimp_procedure_set_static_strings (procedure,
 
600
                                     "gimp-image-parasite-find",
 
601
                                     "Look up a parasite in an image",
 
602
                                     "Finds and returns the parasite that was previously attached to an image.",
 
603
                                     "Jay Cox",
 
604
                                     "Jay Cox",
 
605
                                     "1998",
 
606
                                     NULL);
 
607
  gimp_procedure_add_argument (procedure,
 
608
                               gimp_param_spec_image_id ("image",
 
609
                                                         "image",
 
610
                                                         "The image",
 
611
                                                         pdb->gimp, FALSE,
 
612
                                                         GIMP_PARAM_READWRITE));
 
613
  gimp_procedure_add_argument (procedure,
 
614
                               gimp_param_spec_string ("name",
 
615
                                                       "name",
 
616
                                                       "The name of the parasite to find",
 
617
                                                       FALSE, FALSE, FALSE,
 
618
                                                       NULL,
 
619
                                                       GIMP_PARAM_READWRITE));
 
620
  gimp_procedure_add_return_value (procedure,
 
621
                                   gimp_param_spec_parasite ("parasite",
 
622
                                                             "parasite",
 
623
                                                             "The found parasite",
 
624
                                                             GIMP_PARAM_READWRITE));
 
625
  gimp_pdb_register_procedure (pdb, procedure);
 
626
  g_object_unref (procedure);
 
627
 
 
628
  /*
 
629
   * gimp-image-parasite-attach
 
630
   */
 
631
  procedure = gimp_procedure_new (image_parasite_attach_invoker);
 
632
  gimp_object_set_static_name (GIMP_OBJECT (procedure),
 
633
                               "gimp-image-parasite-attach");
 
634
  gimp_procedure_set_static_strings (procedure,
 
635
                                     "gimp-image-parasite-attach",
 
636
                                     "Add a parasite to an image.",
 
637
                                     "This procedure attaches a parasite to an image. It has no return values.",
 
638
                                     "Jay Cox",
 
639
                                     "Jay Cox",
 
640
                                     "1998",
 
641
                                     NULL);
 
642
  gimp_procedure_add_argument (procedure,
 
643
                               gimp_param_spec_image_id ("image",
 
644
                                                         "image",
 
645
                                                         "The image",
 
646
                                                         pdb->gimp, FALSE,
 
647
                                                         GIMP_PARAM_READWRITE));
 
648
  gimp_procedure_add_argument (procedure,
 
649
                               gimp_param_spec_parasite ("parasite",
 
650
                                                         "parasite",
 
651
                                                         "The parasite to attach to an image",
 
652
                                                         GIMP_PARAM_READWRITE));
 
653
  gimp_pdb_register_procedure (pdb, procedure);
 
654
  g_object_unref (procedure);
 
655
 
 
656
  /*
 
657
   * gimp-image-parasite-detach
 
658
   */
 
659
  procedure = gimp_procedure_new (image_parasite_detach_invoker);
 
660
  gimp_object_set_static_name (GIMP_OBJECT (procedure),
 
661
                               "gimp-image-parasite-detach");
 
662
  gimp_procedure_set_static_strings (procedure,
 
663
                                     "gimp-image-parasite-detach",
 
664
                                     "Removes a parasite from an image.",
 
665
                                     "This procedure detaches a parasite from an image. It has no return values.",
 
666
                                     "Jay Cox",
 
667
                                     "Jay Cox",
 
668
                                     "1998",
 
669
                                     NULL);
 
670
  gimp_procedure_add_argument (procedure,
 
671
                               gimp_param_spec_image_id ("image",
 
672
                                                         "image",
 
673
                                                         "The image",
 
674
                                                         pdb->gimp, FALSE,
 
675
                                                         GIMP_PARAM_READWRITE));
 
676
  gimp_procedure_add_argument (procedure,
 
677
                               gimp_param_spec_string ("name",
 
678
                                                       "name",
 
679
                                                       "The name of the parasite to detach from an image.",
 
680
                                                       FALSE, FALSE, FALSE,
 
681
                                                       NULL,
 
682
                                                       GIMP_PARAM_READWRITE));
 
683
  gimp_pdb_register_procedure (pdb, procedure);
 
684
  g_object_unref (procedure);
 
685
 
 
686
  /*
 
687
   * gimp-image-parasite-list
 
688
   */
 
689
  procedure = gimp_procedure_new (image_parasite_list_invoker);
 
690
  gimp_object_set_static_name (GIMP_OBJECT (procedure),
 
691
                               "gimp-image-parasite-list");
 
692
  gimp_procedure_set_static_strings (procedure,
 
693
                                     "gimp-image-parasite-list",
 
694
                                     "List all parasites.",
 
695
                                     "Returns a list of all currently attached parasites.",
 
696
                                     "Marc Lehmann",
 
697
                                     "Marc Lehmann",
 
698
                                     "1999",
 
699
                                     NULL);
 
700
  gimp_procedure_add_argument (procedure,
 
701
                               gimp_param_spec_image_id ("image",
 
702
                                                         "image",
 
703
                                                         "The image",
 
704
                                                         pdb->gimp, FALSE,
 
705
                                                         GIMP_PARAM_READWRITE));
 
706
  gimp_procedure_add_return_value (procedure,
 
707
                                   gimp_param_spec_int32 ("num-parasites",
 
708
                                                          "num parasites",
 
709
                                                          "The number of attached parasites",
 
710
                                                          0, G_MAXINT32, 0,
 
711
                                                          GIMP_PARAM_READWRITE));
 
712
  gimp_procedure_add_return_value (procedure,
 
713
                                   gimp_param_spec_string_array ("parasites",
 
714
                                                                 "parasites",
 
715
                                                                 "The names of currently attached parasites",
 
716
                                                                 GIMP_PARAM_READWRITE));
 
717
  gimp_pdb_register_procedure (pdb, procedure);
 
718
  g_object_unref (procedure);
 
719
 
 
720
  /*
 
721
   * gimp-drawable-parasite-find
 
722
   */
 
723
  procedure = gimp_procedure_new (drawable_parasite_find_invoker);
 
724
  gimp_object_set_static_name (GIMP_OBJECT (procedure),
 
725
                               "gimp-drawable-parasite-find");
 
726
  gimp_procedure_set_static_strings (procedure,
 
727
                                     "gimp-drawable-parasite-find",
 
728
                                     "Look up a parasite in a drawable",
 
729
                                     "Finds and returns the parasite that was previously attached to a drawable.",
 
730
                                     "Jay Cox",
 
731
                                     "Jay Cox",
 
732
                                     "1998",
 
733
                                     NULL);
 
734
  gimp_procedure_add_argument (procedure,
 
735
                               gimp_param_spec_drawable_id ("drawable",
 
736
                                                            "drawable",
 
737
                                                            "The drawable",
 
738
                                                            pdb->gimp, FALSE,
 
739
                                                            GIMP_PARAM_READWRITE));
 
740
  gimp_procedure_add_argument (procedure,
 
741
                               gimp_param_spec_string ("name",
 
742
                                                       "name",
 
743
                                                       "The name of the parasite to find",
 
744
                                                       FALSE, FALSE, FALSE,
 
745
                                                       NULL,
 
746
                                                       GIMP_PARAM_READWRITE));
 
747
  gimp_procedure_add_return_value (procedure,
 
748
                                   gimp_param_spec_parasite ("parasite",
 
749
                                                             "parasite",
 
750
                                                             "The found parasite",
 
751
                                                             GIMP_PARAM_READWRITE));
 
752
  gimp_pdb_register_procedure (pdb, procedure);
 
753
  g_object_unref (procedure);
 
754
 
 
755
  /*
 
756
   * gimp-drawable-parasite-attach
 
757
   */
 
758
  procedure = gimp_procedure_new (drawable_parasite_attach_invoker);
 
759
  gimp_object_set_static_name (GIMP_OBJECT (procedure),
 
760
                               "gimp-drawable-parasite-attach");
 
761
  gimp_procedure_set_static_strings (procedure,
 
762
                                     "gimp-drawable-parasite-attach",
 
763
                                     "Add a parasite to a drawable.",
 
764
                                     "This procedure attaches a parasite to a drawable. It has no return values.",
 
765
                                     "Jay Cox",
 
766
                                     "Jay Cox",
 
767
                                     "1998",
 
768
                                     NULL);
 
769
  gimp_procedure_add_argument (procedure,
 
770
                               gimp_param_spec_drawable_id ("drawable",
 
771
                                                            "drawable",
 
772
                                                            "The drawable",
 
773
                                                            pdb->gimp, FALSE,
 
774
                                                            GIMP_PARAM_READWRITE));
 
775
  gimp_procedure_add_argument (procedure,
 
776
                               gimp_param_spec_parasite ("parasite",
 
777
                                                         "parasite",
 
778
                                                         "The parasite to attach to a drawable",
 
779
                                                         GIMP_PARAM_READWRITE));
 
780
  gimp_pdb_register_procedure (pdb, procedure);
 
781
  g_object_unref (procedure);
 
782
 
 
783
  /*
 
784
   * gimp-drawable-parasite-detach
 
785
   */
 
786
  procedure = gimp_procedure_new (drawable_parasite_detach_invoker);
 
787
  gimp_object_set_static_name (GIMP_OBJECT (procedure),
 
788
                               "gimp-drawable-parasite-detach");
 
789
  gimp_procedure_set_static_strings (procedure,
 
790
                                     "gimp-drawable-parasite-detach",
 
791
                                     "Removes a parasite from a drawable.",
 
792
                                     "This procedure detaches a parasite from a drawable. It has no return values.",
 
793
                                     "Jay Cox",
 
794
                                     "Jay Cox",
 
795
                                     "1998",
 
796
                                     NULL);
 
797
  gimp_procedure_add_argument (procedure,
 
798
                               gimp_param_spec_drawable_id ("drawable",
 
799
                                                            "drawable",
 
800
                                                            "The drawable",
 
801
                                                            pdb->gimp, FALSE,
 
802
                                                            GIMP_PARAM_READWRITE));
 
803
  gimp_procedure_add_argument (procedure,
 
804
                               gimp_param_spec_string ("name",
 
805
                                                       "name",
 
806
                                                       "The name of the parasite to detach from a drawable.",
 
807
                                                       FALSE, FALSE, FALSE,
 
808
                                                       NULL,
 
809
                                                       GIMP_PARAM_READWRITE));
 
810
  gimp_pdb_register_procedure (pdb, procedure);
 
811
  g_object_unref (procedure);
 
812
 
 
813
  /*
 
814
   * gimp-drawable-parasite-list
 
815
   */
 
816
  procedure = gimp_procedure_new (drawable_parasite_list_invoker);
 
817
  gimp_object_set_static_name (GIMP_OBJECT (procedure),
 
818
                               "gimp-drawable-parasite-list");
 
819
  gimp_procedure_set_static_strings (procedure,
 
820
                                     "gimp-drawable-parasite-list",
 
821
                                     "List all parasites.",
 
822
                                     "Returns a list of all currently attached parasites.",
 
823
                                     "Marc Lehmann",
 
824
                                     "Marc Lehmann",
 
825
                                     "1999",
 
826
                                     NULL);
 
827
  gimp_procedure_add_argument (procedure,
 
828
                               gimp_param_spec_drawable_id ("drawable",
 
829
                                                            "drawable",
 
830
                                                            "The drawable",
 
831
                                                            pdb->gimp, FALSE,
 
832
                                                            GIMP_PARAM_READWRITE));
 
833
  gimp_procedure_add_return_value (procedure,
 
834
                                   gimp_param_spec_int32 ("num-parasites",
 
835
                                                          "num parasites",
 
836
                                                          "The number of attached parasites",
 
837
                                                          0, G_MAXINT32, 0,
 
838
                                                          GIMP_PARAM_READWRITE));
 
839
  gimp_procedure_add_return_value (procedure,
 
840
                                   gimp_param_spec_string_array ("parasites",
 
841
                                                                 "parasites",
 
842
                                                                 "The names of currently attached parasites",
 
843
                                                                 GIMP_PARAM_READWRITE));
 
844
  gimp_pdb_register_procedure (pdb, procedure);
 
845
  g_object_unref (procedure);
 
846
 
 
847
  /*
 
848
   * gimp-vectors-parasite-find
 
849
   */
 
850
  procedure = gimp_procedure_new (vectors_parasite_find_invoker);
 
851
  gimp_object_set_static_name (GIMP_OBJECT (procedure),
 
852
                               "gimp-vectors-parasite-find");
 
853
  gimp_procedure_set_static_strings (procedure,
 
854
                                     "gimp-vectors-parasite-find",
 
855
                                     "Look up a parasite in a vectors object",
 
856
                                     "Finds and returns the parasite that was previously attached to a vectors object.",
 
857
                                     "Michael Natterer <mitch@gimp.org>",
 
858
                                     "Michael Natterer",
 
859
                                     "2006",
 
860
                                     NULL);
 
861
  gimp_procedure_add_argument (procedure,
 
862
                               gimp_param_spec_vectors_id ("vectors",
 
863
                                                           "vectors",
 
864
                                                           "The vectors object",
 
865
                                                           pdb->gimp, FALSE,
 
866
                                                           GIMP_PARAM_READWRITE));
 
867
  gimp_procedure_add_argument (procedure,
 
868
                               gimp_param_spec_string ("name",
 
869
                                                       "name",
 
870
                                                       "The name of the parasite to find",
 
871
                                                       FALSE, FALSE, FALSE,
 
872
                                                       NULL,
 
873
                                                       GIMP_PARAM_READWRITE));
 
874
  gimp_procedure_add_return_value (procedure,
 
875
                                   gimp_param_spec_parasite ("parasite",
 
876
                                                             "parasite",
 
877
                                                             "The found parasite",
 
878
                                                             GIMP_PARAM_READWRITE));
 
879
  gimp_pdb_register_procedure (pdb, procedure);
 
880
  g_object_unref (procedure);
 
881
 
 
882
  /*
 
883
   * gimp-vectors-parasite-attach
 
884
   */
 
885
  procedure = gimp_procedure_new (vectors_parasite_attach_invoker);
 
886
  gimp_object_set_static_name (GIMP_OBJECT (procedure),
 
887
                               "gimp-vectors-parasite-attach");
 
888
  gimp_procedure_set_static_strings (procedure,
 
889
                                     "gimp-vectors-parasite-attach",
 
890
                                     "Add a parasite to a vectors object",
 
891
                                     "This procedure attaches a parasite to a vectors object. It has no return values.",
 
892
                                     "Michael Natterer <mitch@gimp.org>",
 
893
                                     "Michael Natterer",
 
894
                                     "2006",
 
895
                                     NULL);
 
896
  gimp_procedure_add_argument (procedure,
 
897
                               gimp_param_spec_vectors_id ("vectors",
 
898
                                                           "vectors",
 
899
                                                           "The vectors object",
 
900
                                                           pdb->gimp, FALSE,
 
901
                                                           GIMP_PARAM_READWRITE));
 
902
  gimp_procedure_add_argument (procedure,
 
903
                               gimp_param_spec_parasite ("parasite",
 
904
                                                         "parasite",
 
905
                                                         "The parasite to attach to a vectors object",
 
906
                                                         GIMP_PARAM_READWRITE));
 
907
  gimp_pdb_register_procedure (pdb, procedure);
 
908
  g_object_unref (procedure);
 
909
 
 
910
  /*
 
911
   * gimp-vectors-parasite-detach
 
912
   */
 
913
  procedure = gimp_procedure_new (vectors_parasite_detach_invoker);
 
914
  gimp_object_set_static_name (GIMP_OBJECT (procedure),
 
915
                               "gimp-vectors-parasite-detach");
 
916
  gimp_procedure_set_static_strings (procedure,
 
917
                                     "gimp-vectors-parasite-detach",
 
918
                                     "Removes a parasite from a vectors object",
 
919
                                     "This procedure detaches a parasite from a vectors object. It has no return values.",
 
920
                                     "Michael Natterer <mitch@gimp.org>",
 
921
                                     "Michael Natterer",
 
922
                                     "2006",
 
923
                                     NULL);
 
924
  gimp_procedure_add_argument (procedure,
 
925
                               gimp_param_spec_vectors_id ("vectors",
 
926
                                                           "vectors",
 
927
                                                           "The vectors object",
 
928
                                                           pdb->gimp, FALSE,
 
929
                                                           GIMP_PARAM_READWRITE));
 
930
  gimp_procedure_add_argument (procedure,
 
931
                               gimp_param_spec_string ("name",
 
932
                                                       "name",
 
933
                                                       "The name of the parasite to detach from a vectors object.",
 
934
                                                       FALSE, FALSE, FALSE,
 
935
                                                       NULL,
 
936
                                                       GIMP_PARAM_READWRITE));
 
937
  gimp_pdb_register_procedure (pdb, procedure);
 
938
  g_object_unref (procedure);
 
939
 
 
940
  /*
 
941
   * gimp-vectors-parasite-list
 
942
   */
 
943
  procedure = gimp_procedure_new (vectors_parasite_list_invoker);
 
944
  gimp_object_set_static_name (GIMP_OBJECT (procedure),
 
945
                               "gimp-vectors-parasite-list");
 
946
  gimp_procedure_set_static_strings (procedure,
 
947
                                     "gimp-vectors-parasite-list",
 
948
                                     "List all parasites.",
 
949
                                     "Returns a list of all currently attached parasites.",
 
950
                                     "Michael Natterer <mitch@gimp.org>",
 
951
                                     "Michael Natterer",
 
952
                                     "2006",
 
953
                                     NULL);
 
954
  gimp_procedure_add_argument (procedure,
 
955
                               gimp_param_spec_vectors_id ("vectors",
 
956
                                                           "vectors",
 
957
                                                           "The vectors object",
 
958
                                                           pdb->gimp, FALSE,
 
959
                                                           GIMP_PARAM_READWRITE));
 
960
  gimp_procedure_add_return_value (procedure,
 
961
                                   gimp_param_spec_int32 ("num-parasites",
 
962
                                                          "num parasites",
 
963
                                                          "The number of attached parasites",
 
964
                                                          0, G_MAXINT32, 0,
 
965
                                                          GIMP_PARAM_READWRITE));
 
966
  gimp_procedure_add_return_value (procedure,
 
967
                                   gimp_param_spec_string_array ("parasites",
 
968
                                                                 "parasites",
 
969
                                                                 "The names of currently attached parasites",
 
970
                                                                 GIMP_PARAM_READWRITE));
 
971
  gimp_pdb_register_procedure (pdb, procedure);
 
972
  g_object_unref (procedure);
 
973
}