1
/* The GIMP -- an image manipulation program
2
* Copyright (C) 1995-2003 Spencer Kimball and Peter Mattis
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 2 of the License, or
7
* (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19
/* NOTE: This file is autogenerated by pdbgen.pl. */
24
#include <glib-object.h>
26
#include "libgimpbase/gimpbase.h"
28
#include "pdb-types.h"
29
#include "procedural_db.h"
31
#include "core/gimp-parasites.h"
32
#include "core/gimpdrawable.h"
33
#include "core/gimpimage.h"
35
static ProcRecord parasite_find_proc;
36
static ProcRecord parasite_attach_proc;
37
static ProcRecord parasite_detach_proc;
38
static ProcRecord parasite_list_proc;
39
static ProcRecord drawable_parasite_find_proc;
40
static ProcRecord drawable_parasite_attach_proc;
41
static ProcRecord drawable_parasite_detach_proc;
42
static ProcRecord drawable_parasite_list_proc;
43
static ProcRecord image_parasite_find_proc;
44
static ProcRecord image_parasite_attach_proc;
45
static ProcRecord image_parasite_detach_proc;
46
static ProcRecord image_parasite_list_proc;
49
register_parasite_procs (Gimp *gimp)
51
procedural_db_register (gimp, ¶site_find_proc);
52
procedural_db_register (gimp, ¶site_attach_proc);
53
procedural_db_register (gimp, ¶site_detach_proc);
54
procedural_db_register (gimp, ¶site_list_proc);
55
procedural_db_register (gimp, &drawable_parasite_find_proc);
56
procedural_db_register (gimp, &drawable_parasite_attach_proc);
57
procedural_db_register (gimp, &drawable_parasite_detach_proc);
58
procedural_db_register (gimp, &drawable_parasite_list_proc);
59
procedural_db_register (gimp, &image_parasite_find_proc);
60
procedural_db_register (gimp, &image_parasite_attach_proc);
61
procedural_db_register (gimp, &image_parasite_detach_proc);
62
procedural_db_register (gimp, &image_parasite_list_proc);
66
parasite_find_invoker (Gimp *gimp,
68
GimpProgress *progress,
71
gboolean success = TRUE;
72
Argument *return_args;
74
GimpParasite *parasite = NULL;
76
name = (gchar *) args[0].value.pdb_pointer;
77
if (name == NULL || !g_utf8_validate (name, -1, NULL))
82
parasite = gimp_parasite_copy (gimp_parasite_find (gimp, name));
83
success = parasite != NULL;
86
return_args = procedural_db_return_args (¶site_find_proc, success);
89
return_args[1].value.pdb_pointer = parasite;
94
static ProcArg parasite_find_inargs[] =
99
"The name of the parasite to find"
103
static ProcArg parasite_find_outargs[] =
112
static ProcRecord parasite_find_proc =
114
"gimp_parasite_find",
115
"Finds the named parasite.",
116
"Finds and returns the named parasite that was previously attached to the gimp.",
123
parasite_find_inargs,
125
parasite_find_outargs,
126
{ { parasite_find_invoker } }
130
parasite_attach_invoker (Gimp *gimp,
131
GimpContext *context,
132
GimpProgress *progress,
135
gboolean success = TRUE;
136
GimpParasite *parasite;
138
parasite = (GimpParasite *) args[0].value.pdb_pointer;
139
if (parasite == NULL || parasite->name == NULL || !g_utf8_validate (parasite->name, -1, NULL))
143
gimp_parasite_attach (gimp, parasite);
145
return procedural_db_return_args (¶site_attach_proc, success);
148
static ProcArg parasite_attach_inargs[] =
153
"The parasite to attach to the gimp"
157
static ProcRecord parasite_attach_proc =
159
"gimp_parasite_attach",
160
"Add a parasite to the gimp.",
161
"This procedure attaches a parasite to the gimp. It has no return values.",
168
parasite_attach_inargs,
171
{ { parasite_attach_invoker } }
175
parasite_detach_invoker (Gimp *gimp,
176
GimpContext *context,
177
GimpProgress *progress,
180
gboolean success = TRUE;
183
name = (gchar *) args[0].value.pdb_pointer;
184
if (name == NULL || !g_utf8_validate (name, -1, NULL))
188
gimp_parasite_detach (gimp, name);
190
return procedural_db_return_args (¶site_detach_proc, success);
193
static ProcArg parasite_detach_inargs[] =
198
"The name of the parasite to detach from the gimp."
202
static ProcRecord parasite_detach_proc =
204
"gimp_parasite_detach",
205
"Removes a parasite from the gimp.",
206
"This procedure detaches a parasite from the gimp. It has no return values.",
213
parasite_detach_inargs,
216
{ { parasite_detach_invoker } }
220
parasite_list_invoker (Gimp *gimp,
221
GimpContext *context,
222
GimpProgress *progress,
225
Argument *return_args;
226
gint32 num_parasites;
229
parasites = gimp_parasite_list (gimp, &num_parasites);
231
return_args = procedural_db_return_args (¶site_list_proc, TRUE);
233
return_args[1].value.pdb_int = num_parasites;
234
return_args[2].value.pdb_pointer = parasites;
239
static ProcArg parasite_list_outargs[] =
244
"The number of attached parasites"
247
GIMP_PDB_STRINGARRAY,
249
"The names of currently attached parasites"
253
static ProcRecord parasite_list_proc =
255
"gimp_parasite_list",
256
"List all parasites.",
257
"Returns a list of all currently attached parasites.",
266
parasite_list_outargs,
267
{ { parasite_list_invoker } }
271
drawable_parasite_find_invoker (Gimp *gimp,
272
GimpContext *context,
273
GimpProgress *progress,
276
gboolean success = TRUE;
277
Argument *return_args;
278
GimpDrawable *drawable;
280
GimpParasite *parasite = NULL;
282
drawable = (GimpDrawable *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
283
if (! (GIMP_IS_DRAWABLE (drawable) && ! gimp_item_is_removed (GIMP_ITEM (drawable))))
286
name = (gchar *) args[1].value.pdb_pointer;
287
if (name == NULL || !g_utf8_validate (name, -1, NULL))
292
parasite = gimp_parasite_copy (gimp_item_parasite_find (GIMP_ITEM (drawable), name));
293
success = parasite != NULL;
296
return_args = procedural_db_return_args (&drawable_parasite_find_proc, success);
299
return_args[1].value.pdb_pointer = parasite;
304
static ProcArg drawable_parasite_find_inargs[] =
314
"The name of the parasite to find"
318
static ProcArg drawable_parasite_find_outargs[] =
327
static ProcRecord drawable_parasite_find_proc =
329
"gimp_drawable_parasite_find",
330
"Finds the named parasite in a drawable",
331
"Finds and returns the named parasite that was previously attached to a drawable.",
338
drawable_parasite_find_inargs,
340
drawable_parasite_find_outargs,
341
{ { drawable_parasite_find_invoker } }
345
drawable_parasite_attach_invoker (Gimp *gimp,
346
GimpContext *context,
347
GimpProgress *progress,
350
gboolean success = TRUE;
351
GimpDrawable *drawable;
352
GimpParasite *parasite;
354
drawable = (GimpDrawable *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
355
if (! (GIMP_IS_DRAWABLE (drawable) && ! gimp_item_is_removed (GIMP_ITEM (drawable))))
358
parasite = (GimpParasite *) args[1].value.pdb_pointer;
359
if (parasite == NULL || parasite->name == NULL || !g_utf8_validate (parasite->name, -1, NULL))
363
gimp_item_parasite_attach (GIMP_ITEM (drawable), parasite);
365
return procedural_db_return_args (&drawable_parasite_attach_proc, success);
368
static ProcArg drawable_parasite_attach_inargs[] =
378
"The parasite to attach to a drawable"
382
static ProcRecord drawable_parasite_attach_proc =
384
"gimp_drawable_parasite_attach",
385
"Add a parasite to a drawable.",
386
"This procedure attaches a parasite to a drawable. It has no return values.",
393
drawable_parasite_attach_inargs,
396
{ { drawable_parasite_attach_invoker } }
400
drawable_parasite_detach_invoker (Gimp *gimp,
401
GimpContext *context,
402
GimpProgress *progress,
405
gboolean success = TRUE;
406
GimpDrawable *drawable;
409
drawable = (GimpDrawable *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
410
if (! (GIMP_IS_DRAWABLE (drawable) && ! gimp_item_is_removed (GIMP_ITEM (drawable))))
413
name = (gchar *) args[1].value.pdb_pointer;
414
if (name == NULL || !g_utf8_validate (name, -1, NULL))
418
gimp_item_parasite_detach (GIMP_ITEM (drawable), name);
420
return procedural_db_return_args (&drawable_parasite_detach_proc, success);
423
static ProcArg drawable_parasite_detach_inargs[] =
433
"The name of the parasite to detach from a drawable."
437
static ProcRecord drawable_parasite_detach_proc =
439
"gimp_drawable_parasite_detach",
440
"Removes a parasite from a drawable.",
441
"This procedure detaches a parasite from a drawable. It has no return values.",
448
drawable_parasite_detach_inargs,
451
{ { drawable_parasite_detach_invoker } }
455
drawable_parasite_list_invoker (Gimp *gimp,
456
GimpContext *context,
457
GimpProgress *progress,
460
gboolean success = TRUE;
461
Argument *return_args;
462
GimpDrawable *drawable;
463
gint32 num_parasites;
464
gchar **parasites = NULL;
466
drawable = (GimpDrawable *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
467
if (! (GIMP_IS_DRAWABLE (drawable) && ! gimp_item_is_removed (GIMP_ITEM (drawable))))
471
parasites = gimp_item_parasite_list (GIMP_ITEM (drawable), &num_parasites);
473
return_args = procedural_db_return_args (&drawable_parasite_list_proc, success);
477
return_args[1].value.pdb_int = num_parasites;
478
return_args[2].value.pdb_pointer = parasites;
484
static ProcArg drawable_parasite_list_inargs[] =
493
static ProcArg drawable_parasite_list_outargs[] =
498
"The number of attached parasites"
501
GIMP_PDB_STRINGARRAY,
503
"The names of currently attached parasites"
507
static ProcRecord drawable_parasite_list_proc =
509
"gimp_drawable_parasite_list",
510
"List all parasites.",
511
"Returns a list of all currently attached parasites.",
518
drawable_parasite_list_inargs,
520
drawable_parasite_list_outargs,
521
{ { drawable_parasite_list_invoker } }
525
image_parasite_find_invoker (Gimp *gimp,
526
GimpContext *context,
527
GimpProgress *progress,
530
gboolean success = TRUE;
531
Argument *return_args;
534
GimpParasite *parasite = NULL;
536
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
537
if (! GIMP_IS_IMAGE (gimage))
540
name = (gchar *) args[1].value.pdb_pointer;
541
if (name == NULL || !g_utf8_validate (name, -1, NULL))
546
parasite = gimp_parasite_copy (gimp_image_parasite_find (gimage, name));
547
success = parasite != NULL;
550
return_args = procedural_db_return_args (&image_parasite_find_proc, success);
553
return_args[1].value.pdb_pointer = parasite;
558
static ProcArg image_parasite_find_inargs[] =
568
"The name of the parasite to find"
572
static ProcArg image_parasite_find_outargs[] =
581
static ProcRecord image_parasite_find_proc =
583
"gimp_image_parasite_find",
584
"Finds the named parasite in an image",
585
"Finds and returns the named parasite that was previously attached to an image.",
592
image_parasite_find_inargs,
594
image_parasite_find_outargs,
595
{ { image_parasite_find_invoker } }
599
image_parasite_attach_invoker (Gimp *gimp,
600
GimpContext *context,
601
GimpProgress *progress,
604
gboolean success = TRUE;
606
GimpParasite *parasite;
608
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
609
if (! GIMP_IS_IMAGE (gimage))
612
parasite = (GimpParasite *) args[1].value.pdb_pointer;
613
if (parasite == NULL || parasite->name == NULL || !g_utf8_validate (parasite->name, -1, NULL))
617
gimp_image_parasite_attach (gimage, parasite);
619
return procedural_db_return_args (&image_parasite_attach_proc, success);
622
static ProcArg image_parasite_attach_inargs[] =
632
"The parasite to attach to an image"
636
static ProcRecord image_parasite_attach_proc =
638
"gimp_image_parasite_attach",
639
"Add a parasite to an image.",
640
"This procedure attaches a parasite to an image. It has no return values.",
647
image_parasite_attach_inargs,
650
{ { image_parasite_attach_invoker } }
654
image_parasite_detach_invoker (Gimp *gimp,
655
GimpContext *context,
656
GimpProgress *progress,
659
gboolean success = TRUE;
663
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
664
if (! GIMP_IS_IMAGE (gimage))
667
name = (gchar *) args[1].value.pdb_pointer;
668
if (name == NULL || !g_utf8_validate (name, -1, NULL))
672
gimp_image_parasite_detach (gimage, name);
674
return procedural_db_return_args (&image_parasite_detach_proc, success);
677
static ProcArg image_parasite_detach_inargs[] =
687
"The name of the parasite to detach from an image."
691
static ProcRecord image_parasite_detach_proc =
693
"gimp_image_parasite_detach",
694
"Removes a parasite from an image.",
695
"This procedure detaches a parasite from an image. It has no return values.",
702
image_parasite_detach_inargs,
705
{ { image_parasite_detach_invoker } }
709
image_parasite_list_invoker (Gimp *gimp,
710
GimpContext *context,
711
GimpProgress *progress,
714
gboolean success = TRUE;
715
Argument *return_args;
717
gint32 num_parasites;
718
gchar **parasites = NULL;
720
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
721
if (! GIMP_IS_IMAGE (gimage))
725
parasites = gimp_image_parasite_list (gimage, &num_parasites);
727
return_args = procedural_db_return_args (&image_parasite_list_proc, success);
731
return_args[1].value.pdb_int = num_parasites;
732
return_args[2].value.pdb_pointer = parasites;
738
static ProcArg image_parasite_list_inargs[] =
747
static ProcArg image_parasite_list_outargs[] =
752
"The number of attached parasites"
755
GIMP_PDB_STRINGARRAY,
757
"The names of currently attached parasites"
761
static ProcRecord image_parasite_list_proc =
763
"gimp_image_parasite_list",
764
"List all parasites.",
765
"Returns a list of all currently attached parasites.",
772
image_parasite_list_inargs,
774
image_parasite_list_outargs,
775
{ { image_parasite_list_invoker } }