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 3 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, see
18 * <https://www.gnu.org/licenses/>.
21 /* NOTE: This file is auto-generated by pdbgen.pl */
29 * SECTION: gimpgradients
30 * @title: gimpgradients
31 * @short_description: Operations related to gradients.
33 * Operations related to gradients.
38 * gimp_gradients_refresh:
40 * Refresh current gradients. This function always succeeds.
42 * This procedure retrieves all gradients currently in the user's
43 * gradient path and updates the gradient dialogs accordingly.
45 * Returns: TRUE on success.
48 gimp_gradients_refresh (void)
50 GimpParam
*return_vals
;
52 gboolean success
= TRUE
;
54 return_vals
= gimp_run_procedure ("gimp-gradients-refresh",
58 success
= return_vals
[0].data
.d_status
== GIMP_PDB_SUCCESS
;
60 gimp_destroy_params (return_vals
, nreturn_vals
);
66 * gimp_gradients_get_list:
67 * @filter: An optional regular expression used to filter the list.
68 * @num_gradients: The number of loaded gradients.
70 * Retrieve the list of loaded gradients.
72 * This procedure returns a list of the gradients that are currently
73 * loaded. You can later use the gimp_context_set_gradient() function
74 * to set the active gradient.
76 * Returns: The list of gradient names. The returned value must be
77 * freed with g_strfreev().
80 gimp_gradients_get_list (const gchar
*filter
,
83 GimpParam
*return_vals
;
85 gchar
**gradient_list
= NULL
;
88 return_vals
= gimp_run_procedure ("gimp-gradients-get-list",
90 GIMP_PDB_STRING
, filter
,
95 if (return_vals
[0].data
.d_status
== GIMP_PDB_SUCCESS
)
97 *num_gradients
= return_vals
[1].data
.d_int32
;
98 if (*num_gradients
> 0)
100 gradient_list
= g_new0 (gchar
*, *num_gradients
+ 1);
101 for (i
= 0; i
< *num_gradients
; i
++)
102 gradient_list
[i
] = g_strdup (return_vals
[2].data
.d_stringarray
[i
]);
106 gimp_destroy_params (return_vals
, nreturn_vals
);
108 return gradient_list
;