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

« back to all changes in this revision

Viewing changes to libgimp/gimppalette_pdb.c

  • 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:
19
19
 * Boston, MA 02111-1307, USA.
20
20
 */
21
21
 
22
 
/* NOTE: This file is autogenerated by pdbgen.pl */
 
22
/* NOTE: This file is auto-generated by pdbgen.pl */
23
23
 
24
24
#include "config.h"
25
25
 
42
42
{
43
43
  GimpParam *return_vals;
44
44
  gint nreturn_vals;
45
 
  gchar *ret_name = NULL;
 
45
  gchar *actual_name = NULL;
46
46
 
47
 
  return_vals = gimp_run_procedure ("gimp_palette_new",
48
 
                                    &nreturn_vals,
49
 
                                    GIMP_PDB_STRING, name,
50
 
                                    GIMP_PDB_END);
 
47
  return_vals = gimp_run_procedure ("gimp-palette-new",
 
48
                                    &nreturn_vals,
 
49
                                    GIMP_PDB_STRING, name,
 
50
                                    GIMP_PDB_END);
51
51
 
52
52
  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
53
 
    ret_name = g_strdup (return_vals[1].data.d_string);
 
53
    actual_name = g_strdup (return_vals[1].data.d_string);
54
54
 
55
55
  gimp_destroy_params (return_vals, nreturn_vals);
56
56
 
57
 
  return ret_name;
 
57
  return actual_name;
58
58
}
59
59
 
60
60
/**
74
74
{
75
75
  GimpParam *return_vals;
76
76
  gint nreturn_vals;
77
 
  gchar *ret_name = NULL;
 
77
  gchar *copy_name = NULL;
78
78
 
79
 
  return_vals = gimp_run_procedure ("gimp_palette_duplicate",
80
 
                                    &nreturn_vals,
81
 
                                    GIMP_PDB_STRING, name,
82
 
                                    GIMP_PDB_END);
 
79
  return_vals = gimp_run_procedure ("gimp-palette-duplicate",
 
80
                                    &nreturn_vals,
 
81
                                    GIMP_PDB_STRING, name,
 
82
                                    GIMP_PDB_END);
83
83
 
84
84
  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
85
 
    ret_name = g_strdup (return_vals[1].data.d_string);
 
85
    copy_name = g_strdup (return_vals[1].data.d_string);
86
86
 
87
87
  gimp_destroy_params (return_vals, nreturn_vals);
88
88
 
89
 
  return ret_name;
 
89
  return copy_name;
90
90
}
91
91
 
92
92
/**
104
104
 */
105
105
gchar *
106
106
gimp_palette_rename (const gchar *name,
107
 
                     const gchar *new_name)
 
107
                     const gchar *new_name)
108
108
{
109
109
  GimpParam *return_vals;
110
110
  gint nreturn_vals;
111
 
  gchar *ret_name = NULL;
 
111
  gchar *actual_name = NULL;
112
112
 
113
 
  return_vals = gimp_run_procedure ("gimp_palette_rename",
114
 
                                    &nreturn_vals,
115
 
                                    GIMP_PDB_STRING, name,
116
 
                                    GIMP_PDB_STRING, new_name,
117
 
                                    GIMP_PDB_END);
 
113
  return_vals = gimp_run_procedure ("gimp-palette-rename",
 
114
                                    &nreturn_vals,
 
115
                                    GIMP_PDB_STRING, name,
 
116
                                    GIMP_PDB_STRING, new_name,
 
117
                                    GIMP_PDB_END);
118
118
 
119
119
  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
120
 
    ret_name = g_strdup (return_vals[1].data.d_string);
 
120
    actual_name = g_strdup (return_vals[1].data.d_string);
121
121
 
122
122
  gimp_destroy_params (return_vals, nreturn_vals);
123
123
 
124
 
  return ret_name;
 
124
  return actual_name;
125
125
}
126
126
 
127
127
/**
143
143
  gint nreturn_vals;
144
144
  gboolean success = TRUE;
145
145
 
146
 
  return_vals = gimp_run_procedure ("gimp_palette_delete",
147
 
                                    &nreturn_vals,
148
 
                                    GIMP_PDB_STRING, name,
149
 
                                    GIMP_PDB_END);
 
146
  return_vals = gimp_run_procedure ("gimp-palette-delete",
 
147
                                    &nreturn_vals,
 
148
                                    GIMP_PDB_STRING, name,
 
149
                                    GIMP_PDB_END);
150
150
 
151
151
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
152
152
 
156
156
}
157
157
 
158
158
/**
 
159
 * gimp_palette_is_editable:
 
160
 * @name: The palette name.
 
161
 *
 
162
 * Tests if palette can be edited
 
163
 *
 
164
 * Returns TRUE if you have permission to change the palette
 
165
 *
 
166
 * Returns: TRUE if the palette can be edited.
 
167
 *
 
168
 * Since: GIMP 2.4
 
169
 */
 
170
gboolean
 
171
gimp_palette_is_editable (const gchar *name)
 
172
{
 
173
  GimpParam *return_vals;
 
174
  gint nreturn_vals;
 
175
  gboolean editable = FALSE;
 
176
 
 
177
  return_vals = gimp_run_procedure ("gimp-palette-is-editable",
 
178
                                    &nreturn_vals,
 
179
                                    GIMP_PDB_STRING, name,
 
180
                                    GIMP_PDB_END);
 
181
 
 
182
  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
 
183
    editable = return_vals[1].data.d_int32;
 
184
 
 
185
  gimp_destroy_params (return_vals, nreturn_vals);
 
186
 
 
187
  return editable;
 
188
}
 
189
 
 
190
/**
159
191
 * gimp_palette_get_info:
160
192
 * @name: The palette name.
161
193
 * @num_colors: The number of colors in the palette.
171
203
 */
172
204
gboolean
173
205
gimp_palette_get_info (const gchar *name,
174
 
                       gint        *num_colors)
 
206
                       gint        *num_colors)
175
207
{
176
208
  GimpParam *return_vals;
177
209
  gint nreturn_vals;
178
210
  gboolean success = TRUE;
179
211
 
180
 
  return_vals = gimp_run_procedure ("gimp_palette_get_info",
181
 
                                    &nreturn_vals,
182
 
                                    GIMP_PDB_STRING, name,
183
 
                                    GIMP_PDB_END);
 
212
  return_vals = gimp_run_procedure ("gimp-palette-get-info",
 
213
                                    &nreturn_vals,
 
214
                                    GIMP_PDB_STRING, name,
 
215
                                    GIMP_PDB_END);
184
216
 
185
217
  *num_colors = 0;
186
218
 
195
227
}
196
228
 
197
229
/**
 
230
 * gimp_palette_get_columns:
 
231
 * @name: The palette name.
 
232
 *
 
233
 * Retrieves the number of columns to use to display this palette
 
234
 *
 
235
 * This procedures retrieves the prefered number of columns to use when
 
236
 * the palette is being displayed.
 
237
 *
 
238
 * Returns: The number of columns used to display this palette.
 
239
 *
 
240
 * Since: GIMP 2.4
 
241
 */
 
242
gint
 
243
gimp_palette_get_columns (const gchar *name)
 
244
{
 
245
  GimpParam *return_vals;
 
246
  gint nreturn_vals;
 
247
  gint num_columns = 0;
 
248
 
 
249
  return_vals = gimp_run_procedure ("gimp-palette-get-columns",
 
250
                                    &nreturn_vals,
 
251
                                    GIMP_PDB_STRING, name,
 
252
                                    GIMP_PDB_END);
 
253
 
 
254
  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
 
255
    num_columns = return_vals[1].data.d_int32;
 
256
 
 
257
  gimp_destroy_params (return_vals, nreturn_vals);
 
258
 
 
259
  return num_columns;
 
260
}
 
261
 
 
262
/**
 
263
 * gimp_palette_set_columns:
 
264
 * @name: The palette name.
 
265
 * @columns: The new number of columns.
 
266
 *
 
267
 * Sets the number of columns to use when displaying the palette
 
268
 *
 
269
 * This procedures allows to control how many colors are shown per row
 
270
 * when the palette is being displayed. This value can only be changed
 
271
 * if the palette is writable. The maximum allowed value is 64.
 
272
 *
 
273
 * Returns: TRUE on success.
 
274
 *
 
275
 * Since: GIMP 2.4
 
276
 */
 
277
gboolean
 
278
gimp_palette_set_columns (const gchar *name,
 
279
                          gint         columns)
 
280
{
 
281
  GimpParam *return_vals;
 
282
  gint nreturn_vals;
 
283
  gboolean success = TRUE;
 
284
 
 
285
  return_vals = gimp_run_procedure ("gimp-palette-set-columns",
 
286
                                    &nreturn_vals,
 
287
                                    GIMP_PDB_STRING, name,
 
288
                                    GIMP_PDB_INT32, columns,
 
289
                                    GIMP_PDB_END);
 
290
 
 
291
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
 
292
 
 
293
  gimp_destroy_params (return_vals, nreturn_vals);
 
294
 
 
295
  return success;
 
296
}
 
297
 
 
298
/**
198
299
 * gimp_palette_add_entry:
199
300
 * @name: The palette name.
200
301
 * @entry_name: The name of the entry.
212
313
 */
213
314
gboolean
214
315
gimp_palette_add_entry (const gchar   *name,
215
 
                        const gchar   *entry_name,
216
 
                        const GimpRGB *color,
217
 
                        gint          *entry_num)
 
316
                        const gchar   *entry_name,
 
317
                        const GimpRGB *color,
 
318
                        gint          *entry_num)
218
319
{
219
320
  GimpParam *return_vals;
220
321
  gint nreturn_vals;
221
322
  gboolean success = TRUE;
222
323
 
223
 
  return_vals = gimp_run_procedure ("gimp_palette_add_entry",
224
 
                                    &nreturn_vals,
225
 
                                    GIMP_PDB_STRING, name,
226
 
                                    GIMP_PDB_STRING, entry_name,
227
 
                                    GIMP_PDB_COLOR, color,
228
 
                                    GIMP_PDB_END);
 
324
  return_vals = gimp_run_procedure ("gimp-palette-add-entry",
 
325
                                    &nreturn_vals,
 
326
                                    GIMP_PDB_STRING, name,
 
327
                                    GIMP_PDB_STRING, entry_name,
 
328
                                    GIMP_PDB_COLOR, color,
 
329
                                    GIMP_PDB_END);
229
330
 
230
331
  *entry_num = 0;
231
332
 
255
356
 */
256
357
gboolean
257
358
gimp_palette_delete_entry (const gchar *name,
258
 
                           gint         entry_num)
 
359
                           gint         entry_num)
259
360
{
260
361
  GimpParam *return_vals;
261
362
  gint nreturn_vals;
262
363
  gboolean success = TRUE;
263
364
 
264
 
  return_vals = gimp_run_procedure ("gimp_palette_delete_entry",
265
 
                                    &nreturn_vals,
266
 
                                    GIMP_PDB_STRING, name,
267
 
                                    GIMP_PDB_INT32, entry_num,
268
 
                                    GIMP_PDB_END);
 
365
  return_vals = gimp_run_procedure ("gimp-palette-delete-entry",
 
366
                                    &nreturn_vals,
 
367
                                    GIMP_PDB_STRING, name,
 
368
                                    GIMP_PDB_INT32, entry_num,
 
369
                                    GIMP_PDB_END);
269
370
 
270
371
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
271
372
 
292
393
 */
293
394
gboolean
294
395
gimp_palette_entry_get_color (const gchar *name,
295
 
                              gint         entry_num,
296
 
                              GimpRGB     *color)
 
396
                              gint         entry_num,
 
397
                              GimpRGB     *color)
297
398
{
298
399
  GimpParam *return_vals;
299
400
  gint nreturn_vals;
300
401
  gboolean success = TRUE;
301
402
 
302
 
  return_vals = gimp_run_procedure ("gimp_palette_entry_get_color",
303
 
                                    &nreturn_vals,
304
 
                                    GIMP_PDB_STRING, name,
305
 
                                    GIMP_PDB_INT32, entry_num,
306
 
                                    GIMP_PDB_END);
 
403
  return_vals = gimp_run_procedure ("gimp-palette-entry-get-color",
 
404
                                    &nreturn_vals,
 
405
                                    GIMP_PDB_STRING, name,
 
406
                                    GIMP_PDB_INT32, entry_num,
 
407
                                    GIMP_PDB_END);
307
408
 
308
409
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
309
410
 
333
434
 */
334
435
gboolean
335
436
gimp_palette_entry_set_color (const gchar   *name,
336
 
                              gint           entry_num,
337
 
                              const GimpRGB *color)
 
437
                              gint           entry_num,
 
438
                              const GimpRGB *color)
338
439
{
339
440
  GimpParam *return_vals;
340
441
  gint nreturn_vals;
341
442
  gboolean success = TRUE;
342
443
 
343
 
  return_vals = gimp_run_procedure ("gimp_palette_entry_set_color",
344
 
                                    &nreturn_vals,
345
 
                                    GIMP_PDB_STRING, name,
346
 
                                    GIMP_PDB_INT32, entry_num,
347
 
                                    GIMP_PDB_COLOR, color,
348
 
                                    GIMP_PDB_END);
 
444
  return_vals = gimp_run_procedure ("gimp-palette-entry-set-color",
 
445
                                    &nreturn_vals,
 
446
                                    GIMP_PDB_STRING, name,
 
447
                                    GIMP_PDB_INT32, entry_num,
 
448
                                    GIMP_PDB_COLOR, color,
 
449
                                    GIMP_PDB_END);
349
450
 
350
451
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
351
452
 
372
473
 */
373
474
gboolean
374
475
gimp_palette_entry_get_name (const gchar  *name,
375
 
                             gint          entry_num,
376
 
                             gchar       **entry_name)
 
476
                             gint          entry_num,
 
477
                             gchar       **entry_name)
377
478
{
378
479
  GimpParam *return_vals;
379
480
  gint nreturn_vals;
380
481
  gboolean success = TRUE;
381
482
 
382
 
  return_vals = gimp_run_procedure ("gimp_palette_entry_get_name",
383
 
                                    &nreturn_vals,
384
 
                                    GIMP_PDB_STRING, name,
385
 
                                    GIMP_PDB_INT32, entry_num,
386
 
                                    GIMP_PDB_END);
 
483
  return_vals = gimp_run_procedure ("gimp-palette-entry-get-name",
 
484
                                    &nreturn_vals,
 
485
                                    GIMP_PDB_STRING, name,
 
486
                                    GIMP_PDB_INT32, entry_num,
 
487
                                    GIMP_PDB_END);
387
488
 
388
489
  *entry_name = NULL;
389
490
 
415
516
 */
416
517
gboolean
417
518
gimp_palette_entry_set_name (const gchar *name,
418
 
                             gint         entry_num,
419
 
                             const gchar *entry_name)
 
519
                             gint         entry_num,
 
520
                             const gchar *entry_name)
420
521
{
421
522
  GimpParam *return_vals;
422
523
  gint nreturn_vals;
423
524
  gboolean success = TRUE;
424
525
 
425
 
  return_vals = gimp_run_procedure ("gimp_palette_entry_set_name",
426
 
                                    &nreturn_vals,
427
 
                                    GIMP_PDB_STRING, name,
428
 
                                    GIMP_PDB_INT32, entry_num,
429
 
                                    GIMP_PDB_STRING, entry_name,
430
 
                                    GIMP_PDB_END);
 
526
  return_vals = gimp_run_procedure ("gimp-palette-entry-set-name",
 
527
                                    &nreturn_vals,
 
528
                                    GIMP_PDB_STRING, name,
 
529
                                    GIMP_PDB_INT32, entry_num,
 
530
                                    GIMP_PDB_STRING, entry_name,
 
531
                                    GIMP_PDB_END);
431
532
 
432
533
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
433
534