1
/* LIBGIMP - The GIMP Library
2
* Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
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.
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.
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.
22
/* NOTE: This file is autogenerated by pdbgen.pl */
29
* gimp_palettes_refresh:
31
* Refreshes current palettes. This function always succeeds.
33
* This procedure retrieves all palettes currently in the user's
34
* palette path and updates the palette dialogs accordingly.
36
* Returns: TRUE on success.
39
gimp_palettes_refresh (void)
41
GimpParam *return_vals;
43
gboolean success = TRUE;
45
return_vals = gimp_run_procedure ("gimp_palettes_refresh",
49
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
51
gimp_destroy_params (return_vals, nreturn_vals);
57
* gimp_palettes_get_list:
58
* @filter: An optional regular expression used to filter the list.
59
* @num_palettes: The number of palettes in the list.
61
* Retrieves a list of all of the available palettes
63
* This procedure returns a complete listing of available palettes.
64
* Each name returned can be used as input to the command
65
* 'gimp_context_set_palette'.
67
* Returns: The list of palette names.
70
gimp_palettes_get_list (const gchar *filter,
73
GimpParam *return_vals;
75
gchar **palette_list = NULL;
78
return_vals = gimp_run_procedure ("gimp_palettes_get_list",
80
GIMP_PDB_STRING, filter,
85
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
87
*num_palettes = return_vals[1].data.d_int32;
88
palette_list = g_new (gchar *, *num_palettes);
89
for (i = 0; i < *num_palettes; i++)
90
palette_list[i] = g_strdup (return_vals[2].data.d_stringarray[i]);
93
gimp_destroy_params (return_vals, nreturn_vals);
99
* gimp_palettes_get_palette:
100
* @num_colors: The palette num_colors.
102
* This procedure is deprecated! Use gimp_context_get_palette()
105
* Returns: The palette name.
108
gimp_palettes_get_palette (gint *num_colors)
110
GimpParam *return_vals;
114
return_vals = gimp_run_procedure ("gimp_palettes_get_palette",
118
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
120
name = g_strdup (return_vals[1].data.d_string);
121
*num_colors = return_vals[2].data.d_int32;
124
gimp_destroy_params (return_vals, nreturn_vals);
130
* gimp_palettes_get_palette_entry:
131
* @name: The palette name (\"\" means currently active palette).
132
* @entry_num: The entry to retrieve.
133
* @num_colors: The palette num_colors.
134
* @color: The color requested.
136
* This procedure is deprecated! Use gimp_palette_entry_get_color()
139
* Returns: The palette name.
142
gimp_palettes_get_palette_entry (const gchar *name,
147
GimpParam *return_vals;
149
gchar *ret_name = NULL;
151
return_vals = gimp_run_procedure ("gimp_palettes_get_palette_entry",
153
GIMP_PDB_STRING, name,
154
GIMP_PDB_INT32, entry_num,
157
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
159
ret_name = g_strdup (return_vals[1].data.d_string);
160
*num_colors = return_vals[2].data.d_int32;
161
*color = return_vals[3].data.d_color;
164
gimp_destroy_params (return_vals, nreturn_vals);