43
43
GimpParam *return_vals;
45
gchar *ret_name = NULL;
45
gchar *actual_name = NULL;
47
return_vals = gimp_run_procedure ("gimp_palette_new",
49
GIMP_PDB_STRING, name,
47
return_vals = gimp_run_procedure ("gimp-palette-new",
49
GIMP_PDB_STRING, name,
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);
55
55
gimp_destroy_params (return_vals, nreturn_vals);
75
75
GimpParam *return_vals;
77
gchar *ret_name = NULL;
77
gchar *copy_name = NULL;
79
return_vals = gimp_run_procedure ("gimp_palette_duplicate",
81
GIMP_PDB_STRING, name,
79
return_vals = gimp_run_procedure ("gimp-palette-duplicate",
81
GIMP_PDB_STRING, name,
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);
87
87
gimp_destroy_params (return_vals, nreturn_vals);
106
106
gimp_palette_rename (const gchar *name,
107
const gchar *new_name)
107
const gchar *new_name)
109
109
GimpParam *return_vals;
110
110
gint nreturn_vals;
111
gchar *ret_name = NULL;
111
gchar *actual_name = NULL;
113
return_vals = gimp_run_procedure ("gimp_palette_rename",
115
GIMP_PDB_STRING, name,
116
GIMP_PDB_STRING, new_name,
113
return_vals = gimp_run_procedure ("gimp-palette-rename",
115
GIMP_PDB_STRING, name,
116
GIMP_PDB_STRING, new_name,
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);
122
122
gimp_destroy_params (return_vals, nreturn_vals);
159
* gimp_palette_is_editable:
160
* @name: The palette name.
162
* Tests if palette can be edited
164
* Returns TRUE if you have permission to change the palette
166
* Returns: TRUE if the palette can be edited.
171
gimp_palette_is_editable (const gchar *name)
173
GimpParam *return_vals;
175
gboolean editable = FALSE;
177
return_vals = gimp_run_procedure ("gimp-palette-is-editable",
179
GIMP_PDB_STRING, name,
182
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
183
editable = return_vals[1].data.d_int32;
185
gimp_destroy_params (return_vals, nreturn_vals);
159
191
* gimp_palette_get_info:
160
192
* @name: The palette name.
161
193
* @num_colors: The number of colors in the palette.
173
205
gimp_palette_get_info (const gchar *name,
176
208
GimpParam *return_vals;
177
209
gint nreturn_vals;
178
210
gboolean success = TRUE;
180
return_vals = gimp_run_procedure ("gimp_palette_get_info",
182
GIMP_PDB_STRING, name,
212
return_vals = gimp_run_procedure ("gimp-palette-get-info",
214
GIMP_PDB_STRING, name,
230
* gimp_palette_get_columns:
231
* @name: The palette name.
233
* Retrieves the number of columns to use to display this palette
235
* This procedures retrieves the prefered number of columns to use when
236
* the palette is being displayed.
238
* Returns: The number of columns used to display this palette.
243
gimp_palette_get_columns (const gchar *name)
245
GimpParam *return_vals;
247
gint num_columns = 0;
249
return_vals = gimp_run_procedure ("gimp-palette-get-columns",
251
GIMP_PDB_STRING, name,
254
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
255
num_columns = return_vals[1].data.d_int32;
257
gimp_destroy_params (return_vals, nreturn_vals);
263
* gimp_palette_set_columns:
264
* @name: The palette name.
265
* @columns: The new number of columns.
267
* Sets the number of columns to use when displaying the palette
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.
273
* Returns: TRUE on success.
278
gimp_palette_set_columns (const gchar *name,
281
GimpParam *return_vals;
283
gboolean success = TRUE;
285
return_vals = gimp_run_procedure ("gimp-palette-set-columns",
287
GIMP_PDB_STRING, name,
288
GIMP_PDB_INT32, columns,
291
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
293
gimp_destroy_params (return_vals, nreturn_vals);
198
299
* gimp_palette_add_entry:
199
300
* @name: The palette name.
200
301
* @entry_name: The name of the entry.
214
315
gimp_palette_add_entry (const gchar *name,
215
const gchar *entry_name,
216
const GimpRGB *color,
316
const gchar *entry_name,
317
const GimpRGB *color,
219
320
GimpParam *return_vals;
220
321
gint nreturn_vals;
221
322
gboolean success = TRUE;
223
return_vals = gimp_run_procedure ("gimp_palette_add_entry",
225
GIMP_PDB_STRING, name,
226
GIMP_PDB_STRING, entry_name,
227
GIMP_PDB_COLOR, color,
324
return_vals = gimp_run_procedure ("gimp-palette-add-entry",
326
GIMP_PDB_STRING, name,
327
GIMP_PDB_STRING, entry_name,
328
GIMP_PDB_COLOR, color,
257
358
gimp_palette_delete_entry (const gchar *name,
260
361
GimpParam *return_vals;
261
362
gint nreturn_vals;
262
363
gboolean success = TRUE;
264
return_vals = gimp_run_procedure ("gimp_palette_delete_entry",
266
GIMP_PDB_STRING, name,
267
GIMP_PDB_INT32, entry_num,
365
return_vals = gimp_run_procedure ("gimp-palette-delete-entry",
367
GIMP_PDB_STRING, name,
368
GIMP_PDB_INT32, entry_num,
270
371
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
294
395
gimp_palette_entry_get_color (const gchar *name,
298
399
GimpParam *return_vals;
299
400
gint nreturn_vals;
300
401
gboolean success = TRUE;
302
return_vals = gimp_run_procedure ("gimp_palette_entry_get_color",
304
GIMP_PDB_STRING, name,
305
GIMP_PDB_INT32, entry_num,
403
return_vals = gimp_run_procedure ("gimp-palette-entry-get-color",
405
GIMP_PDB_STRING, name,
406
GIMP_PDB_INT32, entry_num,
308
409
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
335
436
gimp_palette_entry_set_color (const gchar *name,
337
const GimpRGB *color)
438
const GimpRGB *color)
339
440
GimpParam *return_vals;
340
441
gint nreturn_vals;
341
442
gboolean success = TRUE;
343
return_vals = gimp_run_procedure ("gimp_palette_entry_set_color",
345
GIMP_PDB_STRING, name,
346
GIMP_PDB_INT32, entry_num,
347
GIMP_PDB_COLOR, color,
444
return_vals = gimp_run_procedure ("gimp-palette-entry-set-color",
446
GIMP_PDB_STRING, name,
447
GIMP_PDB_INT32, entry_num,
448
GIMP_PDB_COLOR, color,
350
451
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
374
475
gimp_palette_entry_get_name (const gchar *name,
378
479
GimpParam *return_vals;
379
480
gint nreturn_vals;
380
481
gboolean success = TRUE;
382
return_vals = gimp_run_procedure ("gimp_palette_entry_get_name",
384
GIMP_PDB_STRING, name,
385
GIMP_PDB_INT32, entry_num,
483
return_vals = gimp_run_procedure ("gimp-palette-entry-get-name",
485
GIMP_PDB_STRING, name,
486
GIMP_PDB_INT32, entry_num,
388
489
*entry_name = NULL;
417
518
gimp_palette_entry_set_name (const gchar *name,
419
const gchar *entry_name)
520
const gchar *entry_name)
421
522
GimpParam *return_vals;
422
523
gint nreturn_vals;
423
524
gboolean success = TRUE;
425
return_vals = gimp_run_procedure ("gimp_palette_entry_set_name",
427
GIMP_PDB_STRING, name,
428
GIMP_PDB_INT32, entry_num,
429
GIMP_PDB_STRING, entry_name,
526
return_vals = gimp_run_procedure ("gimp-palette-entry-set-name",
528
GIMP_PDB_STRING, name,
529
GIMP_PDB_INT32, entry_num,
530
GIMP_PDB_STRING, entry_name,
432
533
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;