~ubuntu-branches/ubuntu/hoary/gimp/hoary

« back to all changes in this revision

Viewing changes to libgimp/gimpparasite_pdb.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2005-04-04 14:51:23 UTC
  • Revision ID: james.westby@ubuntu.com-20050404145123-9py049eeelfymur8
Tags: upstream-2.2.2
ImportĀ upstreamĀ versionĀ 2.2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* LIBGIMP - The GIMP Library
 
2
 * Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
 
3
 *
 
4
 * gimpparasite_pdb.c
 
5
 *
 
6
 * This library is free software; you can redistribute it and/or
 
7
 * modify it under the terms of the GNU Lesser General Public
 
8
 * License as published by the Free Software Foundation; either
 
9
 * version 2 of the License, or (at your option) any later version.
 
10
 *
 
11
 * This library is distributed in the hope that it will be useful,
 
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
14
 * Lesser General Public License for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU Lesser General Public
 
17
 * License along with this library; if not, write to the
 
18
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 
19
 * Boston, MA 02111-1307, USA.
 
20
 */
 
21
 
 
22
/* NOTE: This file is autogenerated by pdbgen.pl */
 
23
 
 
24
#include "config.h"
 
25
 
 
26
#include "gimp.h"
 
27
 
 
28
/**
 
29
 * gimp_parasite_find:
 
30
 * @name: The name of the parasite to find.
 
31
 *
 
32
 * Finds the named parasite.
 
33
 *
 
34
 * Finds and returns the named parasite that was previously attached to
 
35
 * the gimp.
 
36
 *
 
37
 * Returns: The found parasite.
 
38
 */
 
39
GimpParasite *
 
40
gimp_parasite_find (const gchar *name)
 
41
{
 
42
  GimpParam *return_vals;
 
43
  gint nreturn_vals;
 
44
  GimpParasite *parasite = NULL;
 
45
 
 
46
  return_vals = gimp_run_procedure ("gimp_parasite_find",
 
47
                                    &nreturn_vals,
 
48
                                    GIMP_PDB_STRING, name,
 
49
                                    GIMP_PDB_END);
 
50
 
 
51
  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
 
52
    parasite = gimp_parasite_copy (&return_vals[1].data.d_parasite);
 
53
 
 
54
  gimp_destroy_params (return_vals, nreturn_vals);
 
55
 
 
56
  return parasite;
 
57
}
 
58
 
 
59
/**
 
60
 * gimp_parasite_attach:
 
61
 * @parasite: The parasite to attach to the gimp.
 
62
 *
 
63
 * Add a parasite to the gimp.
 
64
 *
 
65
 * This procedure attaches a parasite to the gimp. It has no return
 
66
 * values.
 
67
 *
 
68
 * Returns: TRUE on success.
 
69
 */
 
70
gboolean
 
71
gimp_parasite_attach (GimpParasite *parasite)
 
72
{
 
73
  GimpParam *return_vals;
 
74
  gint nreturn_vals;
 
75
  gboolean success = TRUE;
 
76
 
 
77
  return_vals = gimp_run_procedure ("gimp_parasite_attach",
 
78
                                    &nreturn_vals,
 
79
                                    GIMP_PDB_PARASITE, parasite,
 
80
                                    GIMP_PDB_END);
 
81
 
 
82
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
 
83
 
 
84
  gimp_destroy_params (return_vals, nreturn_vals);
 
85
 
 
86
  return success;
 
87
}
 
88
 
 
89
/**
 
90
 * gimp_parasite_detach:
 
91
 * @name: The name of the parasite to detach from the gimp.
 
92
 *
 
93
 * Removes a parasite from the gimp.
 
94
 *
 
95
 * This procedure detaches a parasite from the gimp. It has no return
 
96
 * values.
 
97
 *
 
98
 * Returns: TRUE on success.
 
99
 */
 
100
gboolean
 
101
gimp_parasite_detach (const gchar *name)
 
102
{
 
103
  GimpParam *return_vals;
 
104
  gint nreturn_vals;
 
105
  gboolean success = TRUE;
 
106
 
 
107
  return_vals = gimp_run_procedure ("gimp_parasite_detach",
 
108
                                    &nreturn_vals,
 
109
                                    GIMP_PDB_STRING, name,
 
110
                                    GIMP_PDB_END);
 
111
 
 
112
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
 
113
 
 
114
  gimp_destroy_params (return_vals, nreturn_vals);
 
115
 
 
116
  return success;
 
117
}
 
118
 
 
119
/**
 
120
 * gimp_parasite_list:
 
121
 * @num_parasites: The number of attached parasites.
 
122
 * @parasites: The names of currently attached parasites.
 
123
 *
 
124
 * List all parasites.
 
125
 *
 
126
 * Returns a list of all currently attached parasites.
 
127
 *
 
128
 * Returns: TRUE on success.
 
129
 */
 
130
gboolean
 
131
gimp_parasite_list (gint    *num_parasites,
 
132
                    gchar ***parasites)
 
133
{
 
134
  GimpParam *return_vals;
 
135
  gint nreturn_vals;
 
136
  gboolean success = TRUE;
 
137
  gint i;
 
138
 
 
139
  return_vals = gimp_run_procedure ("gimp_parasite_list",
 
140
                                    &nreturn_vals,
 
141
                                    GIMP_PDB_END);
 
142
 
 
143
  *num_parasites = 0;
 
144
  *parasites = NULL;
 
145
 
 
146
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
 
147
 
 
148
  if (success)
 
149
    {
 
150
      *num_parasites = return_vals[1].data.d_int32;
 
151
      *parasites = g_new (gchar *, *num_parasites);
 
152
      for (i = 0; i < *num_parasites; i++)
 
153
        (*parasites)[i] = g_strdup (return_vals[2].data.d_stringarray[i]);
 
154
    }
 
155
 
 
156
  gimp_destroy_params (return_vals, nreturn_vals);
 
157
 
 
158
  return success;
 
159
}
 
160
 
 
161
/**
 
162
 * gimp_drawable_parasite_find:
 
163
 * @drawable_ID: The drawable.
 
164
 * @name: The name of the parasite to find.
 
165
 *
 
166
 * Finds the named parasite in a drawable
 
167
 *
 
168
 * Finds and returns the named parasite that was previously attached to
 
169
 * a drawable.
 
170
 *
 
171
 * Returns: The found parasite.
 
172
 */
 
173
GimpParasite *
 
174
gimp_drawable_parasite_find (gint32       drawable_ID,
 
175
                             const gchar *name)
 
176
{
 
177
  GimpParam *return_vals;
 
178
  gint nreturn_vals;
 
179
  GimpParasite *parasite = NULL;
 
180
 
 
181
  return_vals = gimp_run_procedure ("gimp_drawable_parasite_find",
 
182
                                    &nreturn_vals,
 
183
                                    GIMP_PDB_DRAWABLE, drawable_ID,
 
184
                                    GIMP_PDB_STRING, name,
 
185
                                    GIMP_PDB_END);
 
186
 
 
187
  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
 
188
    parasite = gimp_parasite_copy (&return_vals[1].data.d_parasite);
 
189
 
 
190
  gimp_destroy_params (return_vals, nreturn_vals);
 
191
 
 
192
  return parasite;
 
193
}
 
194
 
 
195
/**
 
196
 * gimp_drawable_parasite_attach:
 
197
 * @drawable_ID: The drawable.
 
198
 * @parasite: The parasite to attach to a drawable.
 
199
 *
 
200
 * Add a parasite to a drawable.
 
201
 *
 
202
 * This procedure attaches a parasite to a drawable. It has no return
 
203
 * values.
 
204
 *
 
205
 * Returns: TRUE on success.
 
206
 */
 
207
gboolean
 
208
gimp_drawable_parasite_attach (gint32        drawable_ID,
 
209
                               GimpParasite *parasite)
 
210
{
 
211
  GimpParam *return_vals;
 
212
  gint nreturn_vals;
 
213
  gboolean success = TRUE;
 
214
 
 
215
  return_vals = gimp_run_procedure ("gimp_drawable_parasite_attach",
 
216
                                    &nreturn_vals,
 
217
                                    GIMP_PDB_DRAWABLE, drawable_ID,
 
218
                                    GIMP_PDB_PARASITE, parasite,
 
219
                                    GIMP_PDB_END);
 
220
 
 
221
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
 
222
 
 
223
  gimp_destroy_params (return_vals, nreturn_vals);
 
224
 
 
225
  return success;
 
226
}
 
227
 
 
228
/**
 
229
 * gimp_drawable_parasite_detach:
 
230
 * @drawable_ID: The drawable.
 
231
 * @name: The name of the parasite to detach from a drawable.
 
232
 *
 
233
 * Removes a parasite from a drawable.
 
234
 *
 
235
 * This procedure detaches a parasite from a drawable. It has no return
 
236
 * values.
 
237
 *
 
238
 * Returns: TRUE on success.
 
239
 */
 
240
gboolean
 
241
gimp_drawable_parasite_detach (gint32       drawable_ID,
 
242
                               const gchar *name)
 
243
{
 
244
  GimpParam *return_vals;
 
245
  gint nreturn_vals;
 
246
  gboolean success = TRUE;
 
247
 
 
248
  return_vals = gimp_run_procedure ("gimp_drawable_parasite_detach",
 
249
                                    &nreturn_vals,
 
250
                                    GIMP_PDB_DRAWABLE, drawable_ID,
 
251
                                    GIMP_PDB_STRING, name,
 
252
                                    GIMP_PDB_END);
 
253
 
 
254
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
 
255
 
 
256
  gimp_destroy_params (return_vals, nreturn_vals);
 
257
 
 
258
  return success;
 
259
}
 
260
 
 
261
/**
 
262
 * gimp_drawable_parasite_list:
 
263
 * @drawable_ID: The drawable.
 
264
 * @num_parasites: The number of attached parasites.
 
265
 * @parasites: The names of currently attached parasites.
 
266
 *
 
267
 * List all parasites.
 
268
 *
 
269
 * Returns a list of all currently attached parasites.
 
270
 *
 
271
 * Returns: TRUE on success.
 
272
 */
 
273
gboolean
 
274
gimp_drawable_parasite_list (gint32    drawable_ID,
 
275
                             gint     *num_parasites,
 
276
                             gchar  ***parasites)
 
277
{
 
278
  GimpParam *return_vals;
 
279
  gint nreturn_vals;
 
280
  gboolean success = TRUE;
 
281
  gint i;
 
282
 
 
283
  return_vals = gimp_run_procedure ("gimp_drawable_parasite_list",
 
284
                                    &nreturn_vals,
 
285
                                    GIMP_PDB_DRAWABLE, drawable_ID,
 
286
                                    GIMP_PDB_END);
 
287
 
 
288
  *num_parasites = 0;
 
289
  *parasites = NULL;
 
290
 
 
291
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
 
292
 
 
293
  if (success)
 
294
    {
 
295
      *num_parasites = return_vals[1].data.d_int32;
 
296
      *parasites = g_new (gchar *, *num_parasites);
 
297
      for (i = 0; i < *num_parasites; i++)
 
298
        (*parasites)[i] = g_strdup (return_vals[2].data.d_stringarray[i]);
 
299
    }
 
300
 
 
301
  gimp_destroy_params (return_vals, nreturn_vals);
 
302
 
 
303
  return success;
 
304
}
 
305
 
 
306
/**
 
307
 * gimp_image_parasite_find:
 
308
 * @image_ID: The image.
 
309
 * @name: The name of the parasite to find.
 
310
 *
 
311
 * Finds the named parasite in an image
 
312
 *
 
313
 * Finds and returns the named parasite that was previously attached to
 
314
 * an image.
 
315
 *
 
316
 * Returns: The found parasite.
 
317
 */
 
318
GimpParasite *
 
319
gimp_image_parasite_find (gint32       image_ID,
 
320
                          const gchar *name)
 
321
{
 
322
  GimpParam *return_vals;
 
323
  gint nreturn_vals;
 
324
  GimpParasite *parasite = NULL;
 
325
 
 
326
  return_vals = gimp_run_procedure ("gimp_image_parasite_find",
 
327
                                    &nreturn_vals,
 
328
                                    GIMP_PDB_IMAGE, image_ID,
 
329
                                    GIMP_PDB_STRING, name,
 
330
                                    GIMP_PDB_END);
 
331
 
 
332
  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
 
333
    parasite = gimp_parasite_copy (&return_vals[1].data.d_parasite);
 
334
 
 
335
  gimp_destroy_params (return_vals, nreturn_vals);
 
336
 
 
337
  return parasite;
 
338
}
 
339
 
 
340
/**
 
341
 * gimp_image_parasite_attach:
 
342
 * @image_ID: The image.
 
343
 * @parasite: The parasite to attach to an image.
 
344
 *
 
345
 * Add a parasite to an image.
 
346
 *
 
347
 * This procedure attaches a parasite to an image. It has no return
 
348
 * values.
 
349
 *
 
350
 * Returns: TRUE on success.
 
351
 */
 
352
gboolean
 
353
gimp_image_parasite_attach (gint32        image_ID,
 
354
                            GimpParasite *parasite)
 
355
{
 
356
  GimpParam *return_vals;
 
357
  gint nreturn_vals;
 
358
  gboolean success = TRUE;
 
359
 
 
360
  return_vals = gimp_run_procedure ("gimp_image_parasite_attach",
 
361
                                    &nreturn_vals,
 
362
                                    GIMP_PDB_IMAGE, image_ID,
 
363
                                    GIMP_PDB_PARASITE, parasite,
 
364
                                    GIMP_PDB_END);
 
365
 
 
366
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
 
367
 
 
368
  gimp_destroy_params (return_vals, nreturn_vals);
 
369
 
 
370
  return success;
 
371
}
 
372
 
 
373
/**
 
374
 * gimp_image_parasite_detach:
 
375
 * @image_ID: The image.
 
376
 * @name: The name of the parasite to detach from an image.
 
377
 *
 
378
 * Removes a parasite from an image.
 
379
 *
 
380
 * This procedure detaches a parasite from an image. It has no return
 
381
 * values.
 
382
 *
 
383
 * Returns: TRUE on success.
 
384
 */
 
385
gboolean
 
386
gimp_image_parasite_detach (gint32       image_ID,
 
387
                            const gchar *name)
 
388
{
 
389
  GimpParam *return_vals;
 
390
  gint nreturn_vals;
 
391
  gboolean success = TRUE;
 
392
 
 
393
  return_vals = gimp_run_procedure ("gimp_image_parasite_detach",
 
394
                                    &nreturn_vals,
 
395
                                    GIMP_PDB_IMAGE, image_ID,
 
396
                                    GIMP_PDB_STRING, name,
 
397
                                    GIMP_PDB_END);
 
398
 
 
399
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
 
400
 
 
401
  gimp_destroy_params (return_vals, nreturn_vals);
 
402
 
 
403
  return success;
 
404
}
 
405
 
 
406
/**
 
407
 * gimp_image_parasite_list:
 
408
 * @image_ID: The image.
 
409
 * @num_parasites: The number of attached parasites.
 
410
 * @parasites: The names of currently attached parasites.
 
411
 *
 
412
 * List all parasites.
 
413
 *
 
414
 * Returns a list of all currently attached parasites.
 
415
 *
 
416
 * Returns: TRUE on success.
 
417
 */
 
418
gboolean
 
419
gimp_image_parasite_list (gint32    image_ID,
 
420
                          gint     *num_parasites,
 
421
                          gchar  ***parasites)
 
422
{
 
423
  GimpParam *return_vals;
 
424
  gint nreturn_vals;
 
425
  gboolean success = TRUE;
 
426
  gint i;
 
427
 
 
428
  return_vals = gimp_run_procedure ("gimp_image_parasite_list",
 
429
                                    &nreturn_vals,
 
430
                                    GIMP_PDB_IMAGE, image_ID,
 
431
                                    GIMP_PDB_END);
 
432
 
 
433
  *num_parasites = 0;
 
434
  *parasites = NULL;
 
435
 
 
436
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
 
437
 
 
438
  if (success)
 
439
    {
 
440
      *num_parasites = return_vals[1].data.d_int32;
 
441
      *parasites = g_new (gchar *, *num_parasites);
 
442
      for (i = 0; i < *num_parasites; i++)
 
443
        (*parasites)[i] = g_strdup (return_vals[2].data.d_stringarray[i]);
 
444
    }
 
445
 
 
446
  gimp_destroy_params (return_vals, nreturn_vals);
 
447
 
 
448
  return success;
 
449
}