mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-10-06 01:12:40 +02:00
app, libgimp, pdb: gimp_*_get_list() for various resource types return a resource array.
There are 2 *_get_list() for buffers and dynamics but since we don't have clases for these, they still just return a list of names for now. I opened #12268 for further thinking on these.
This commit is contained in:
@@ -87,7 +87,6 @@ gimp_container_filter (GimpContainer *container,
|
||||
if (GIMP_IS_LIST (result))
|
||||
gimp_list_reverse (GIMP_LIST (result));
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -138,7 +137,6 @@ gimp_container_filter_by_name (GimpContainer *container,
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
gchar **
|
||||
gimp_container_get_filtered_name_array (GimpContainer *container,
|
||||
const gchar *regexp)
|
||||
@@ -169,3 +167,38 @@ gimp_container_get_filtered_name_array (GimpContainer *container,
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
GimpObject **
|
||||
gimp_container_get_filtered_array (GimpContainer *container,
|
||||
const gchar *regexp)
|
||||
{
|
||||
GimpObject **retval = NULL;
|
||||
GimpContainer *weak = NULL;
|
||||
GError *error = NULL;
|
||||
|
||||
g_return_val_if_fail (GIMP_IS_CONTAINER (container), NULL);
|
||||
|
||||
if (regexp != NULL && strlen (regexp) > 0)
|
||||
weak = gimp_container_filter_by_name (container, regexp, &error);
|
||||
|
||||
if (error == NULL)
|
||||
{
|
||||
GList *list;
|
||||
GList *iter;
|
||||
gint i;
|
||||
|
||||
list = GIMP_LIST (weak ? weak : container)->queue->head;
|
||||
retval = g_new0 (GimpObject *, g_list_length (list) + 1);
|
||||
for (iter = list, i = 0; iter; iter = iter->next, i++)
|
||||
retval[i] = iter->data;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_warning ("%s", error->message);
|
||||
g_error_free (error);
|
||||
}
|
||||
|
||||
g_clear_object (&weak);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
@@ -22,16 +22,17 @@
|
||||
#define __GIMP_CONTAINER_FILTER_H__
|
||||
|
||||
|
||||
GimpContainer * gimp_container_filter (GimpContainer *container,
|
||||
GimpObjectFilterFunc filter,
|
||||
gpointer user_data);
|
||||
GimpContainer * gimp_container_filter_by_name (GimpContainer *container,
|
||||
const gchar *regexp,
|
||||
GError **error);
|
||||
GimpContainer * gimp_container_filter (GimpContainer *container,
|
||||
GimpObjectFilterFunc filter,
|
||||
gpointer user_data);
|
||||
GimpContainer * gimp_container_filter_by_name (GimpContainer *container,
|
||||
const gchar *regexp,
|
||||
GError **error);
|
||||
|
||||
gchar ** gimp_container_get_filtered_name_array
|
||||
(GimpContainer *container,
|
||||
const gchar *regexp);
|
||||
gchar ** gimp_container_get_filtered_name_array (GimpContainer *container,
|
||||
const gchar *regexp);
|
||||
GimpObject ** gimp_container_get_filtered_array (GimpContainer *container,
|
||||
const gchar *regexp);
|
||||
|
||||
|
||||
#endif /* __GIMP_CONTAINER_FILTER_H__ */
|
||||
|
@@ -69,14 +69,14 @@ brushes_get_list_invoker (GimpProcedure *procedure,
|
||||
gboolean success = TRUE;
|
||||
GimpValueArray *return_vals;
|
||||
const gchar *filter;
|
||||
gchar **brush_list = NULL;
|
||||
GimpBrush **brush_list = NULL;
|
||||
|
||||
filter = g_value_get_string (gimp_value_array_index (args, 0));
|
||||
|
||||
if (success)
|
||||
{
|
||||
brush_list = gimp_container_get_filtered_name_array (gimp_data_factory_get_container (gimp->brush_factory),
|
||||
filter);
|
||||
brush_list = (GimpBrush **) gimp_container_get_filtered_array (gimp_data_factory_get_container (gimp->brush_factory),
|
||||
filter);
|
||||
}
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, success,
|
||||
@@ -118,7 +118,8 @@ register_brushes_procs (GimpPDB *pdb)
|
||||
"gimp-brushes-get-list");
|
||||
gimp_procedure_set_static_help (procedure,
|
||||
"Retrieve a complete listing of the available brushes.",
|
||||
"This procedure returns a complete listing of available GIMP brushes. Each name returned can be used as input to the 'gimp-context-set-brush' procedure.",
|
||||
"This procedure returns a complete listing of available GIMP brushes.\n"
|
||||
"Each brush returned can be used as input to [func@Gimp.context_set_brush].",
|
||||
NULL);
|
||||
gimp_procedure_set_static_attribution (procedure,
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
@@ -128,15 +129,15 @@ register_brushes_procs (GimpPDB *pdb)
|
||||
gimp_param_spec_string ("filter",
|
||||
"filter",
|
||||
"An optional regular expression used to filter the list",
|
||||
FALSE, TRUE, FALSE,
|
||||
FALSE, FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_boxed ("brush-list",
|
||||
"brush list",
|
||||
"The list of brush names",
|
||||
G_TYPE_STRV,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_param_spec_core_object_array ("brush-list",
|
||||
"brush list",
|
||||
"The list of brushes",
|
||||
GIMP_TYPE_BRUSH,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
}
|
||||
|
@@ -34,6 +34,7 @@
|
||||
#include "core/gimpcontainer.h"
|
||||
#include "core/gimpdatafactory.h"
|
||||
#include "core/gimpparamspecs.h"
|
||||
#include "text/gimpfont.h"
|
||||
#include "text/gimpfontfactory.h"
|
||||
|
||||
#include "gimppdb.h"
|
||||
@@ -120,7 +121,7 @@ fonts_get_list_invoker (GimpProcedure *procedure,
|
||||
gboolean success = TRUE;
|
||||
GimpValueArray *return_vals;
|
||||
const gchar *filter;
|
||||
gchar **font_list = NULL;
|
||||
GimpFont **font_list = NULL;
|
||||
|
||||
filter = g_value_get_string (gimp_value_array_index (args, 0));
|
||||
|
||||
@@ -130,10 +131,8 @@ fonts_get_list_invoker (GimpProcedure *procedure,
|
||||
success = FALSE;
|
||||
|
||||
if (success)
|
||||
{
|
||||
font_list = gimp_container_get_filtered_name_array (gimp_data_factory_get_container (gimp->font_factory),
|
||||
filter);
|
||||
}
|
||||
font_list = (GimpFont **) gimp_container_get_filtered_array (gimp_data_factory_get_container (gimp->font_factory),
|
||||
filter);
|
||||
}
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, success,
|
||||
@@ -219,7 +218,8 @@ register_fonts_procs (GimpPDB *pdb)
|
||||
"gimp-fonts-get-list");
|
||||
gimp_procedure_set_static_help (procedure,
|
||||
"Retrieve the list of loaded fonts.",
|
||||
"This procedure returns a list of the fonts that are currently available.",
|
||||
"This procedure returns a list of the fonts that are currently available.\n"
|
||||
"Each font returned can be used as input to [func@Gimp.context_set_font].",
|
||||
NULL);
|
||||
gimp_procedure_set_static_attribution (procedure,
|
||||
"Sven Neumann <sven@gimp.org>",
|
||||
@@ -233,11 +233,11 @@ register_fonts_procs (GimpPDB *pdb)
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_boxed ("font-list",
|
||||
"font list",
|
||||
"The list of font names",
|
||||
G_TYPE_STRV,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_param_spec_core_object_array ("font-list",
|
||||
"font list",
|
||||
"The list of fonts",
|
||||
GIMP_TYPE_FONT,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
}
|
||||
|
@@ -68,14 +68,14 @@ gradients_get_list_invoker (GimpProcedure *procedure,
|
||||
gboolean success = TRUE;
|
||||
GimpValueArray *return_vals;
|
||||
const gchar *filter;
|
||||
gchar **gradient_list = NULL;
|
||||
GimpGradient **gradient_list = NULL;
|
||||
|
||||
filter = g_value_get_string (gimp_value_array_index (args, 0));
|
||||
|
||||
if (success)
|
||||
{
|
||||
gradient_list = gimp_container_get_filtered_name_array (gimp_data_factory_get_container (gimp->gradient_factory),
|
||||
filter);
|
||||
gradient_list = (GimpGradient **) gimp_container_get_filtered_array (gimp_data_factory_get_container (gimp->gradient_factory),
|
||||
filter);
|
||||
}
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, success,
|
||||
@@ -117,7 +117,8 @@ register_gradients_procs (GimpPDB *pdb)
|
||||
"gimp-gradients-get-list");
|
||||
gimp_procedure_set_static_help (procedure,
|
||||
"Retrieve the list of loaded gradients.",
|
||||
"This procedure returns a list of the gradients that are currently loaded. You can later use the 'gimp-context-set-gradient' function to set the active gradient.",
|
||||
"This procedure returns a list of the gradients that are currently loaded.\n"
|
||||
"Each gradient returned can be used as input to [func@Gimp.context_set_gradient].",
|
||||
NULL);
|
||||
gimp_procedure_set_static_attribution (procedure,
|
||||
"Federico Mena Quintero",
|
||||
@@ -131,11 +132,11 @@ register_gradients_procs (GimpPDB *pdb)
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_boxed ("gradient-list",
|
||||
"gradient list",
|
||||
"The list of gradient names",
|
||||
G_TYPE_STRV,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_param_spec_core_object_array ("gradient-list",
|
||||
"gradient list",
|
||||
"The list of gradients",
|
||||
GIMP_TYPE_GRADIENT,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
}
|
||||
|
@@ -68,14 +68,14 @@ palettes_get_list_invoker (GimpProcedure *procedure,
|
||||
gboolean success = TRUE;
|
||||
GimpValueArray *return_vals;
|
||||
const gchar *filter;
|
||||
gchar **palette_list = NULL;
|
||||
GimpPalette **palette_list = NULL;
|
||||
|
||||
filter = g_value_get_string (gimp_value_array_index (args, 0));
|
||||
|
||||
if (success)
|
||||
{
|
||||
palette_list = gimp_container_get_filtered_name_array (gimp_data_factory_get_container (gimp->palette_factory),
|
||||
filter);
|
||||
palette_list = (GimpPalette **) gimp_container_get_filtered_array (gimp_data_factory_get_container (gimp->palette_factory),
|
||||
filter);
|
||||
}
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, success,
|
||||
@@ -117,7 +117,8 @@ register_palettes_procs (GimpPDB *pdb)
|
||||
"gimp-palettes-get-list");
|
||||
gimp_procedure_set_static_help (procedure,
|
||||
"Retrieves a list of all of the available palettes",
|
||||
"This procedure returns a complete listing of available palettes. Each name returned can be used as input to the command 'gimp-context-set-palette'.",
|
||||
"This procedure returns a complete listing of available palettes.\n"
|
||||
"Each palette returned can be used as input to [func@Gimp.context_set_palette].",
|
||||
NULL);
|
||||
gimp_procedure_set_static_attribution (procedure,
|
||||
"Nathan Summers <rock@gimp.org>",
|
||||
@@ -131,11 +132,11 @@ register_palettes_procs (GimpPDB *pdb)
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_boxed ("palette-list",
|
||||
"palette list",
|
||||
"The list of palette names",
|
||||
G_TYPE_STRV,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_param_spec_core_object_array ("palette-list",
|
||||
"palette list",
|
||||
"The list of palettes",
|
||||
GIMP_TYPE_PALETTE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
}
|
||||
|
@@ -69,14 +69,14 @@ patterns_get_list_invoker (GimpProcedure *procedure,
|
||||
gboolean success = TRUE;
|
||||
GimpValueArray *return_vals;
|
||||
const gchar *filter;
|
||||
gchar **pattern_list = NULL;
|
||||
GimpPattern **pattern_list = NULL;
|
||||
|
||||
filter = g_value_get_string (gimp_value_array_index (args, 0));
|
||||
|
||||
if (success)
|
||||
{
|
||||
pattern_list = gimp_container_get_filtered_name_array (gimp_data_factory_get_container (gimp->pattern_factory),
|
||||
filter);
|
||||
pattern_list = (GimpPattern **) gimp_container_get_filtered_array (gimp_data_factory_get_container (gimp->pattern_factory),
|
||||
filter);
|
||||
}
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, success,
|
||||
@@ -118,7 +118,8 @@ register_patterns_procs (GimpPDB *pdb)
|
||||
"gimp-patterns-get-list");
|
||||
gimp_procedure_set_static_help (procedure,
|
||||
"Retrieve a complete listing of the available patterns.",
|
||||
"This procedure returns a complete listing of available GIMP patterns. Each name returned can be used as input to the 'gimp-context-set-pattern'.",
|
||||
"This procedure returns a complete listing of available GIMP patterns.\n"
|
||||
"Each pattern returned can be used as input to [func@Gimp.context_set_pattern].",
|
||||
NULL);
|
||||
gimp_procedure_set_static_attribution (procedure,
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
@@ -132,11 +133,11 @@ register_patterns_procs (GimpPDB *pdb)
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_boxed ("pattern-list",
|
||||
"pattern list",
|
||||
"The list of pattern names",
|
||||
G_TYPE_STRV,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_param_spec_core_object_array ("pattern-list",
|
||||
"pattern list",
|
||||
"The list of patterns",
|
||||
GIMP_TYPE_PATTERN,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
}
|
||||
|
@@ -75,18 +75,19 @@ gimp_brushes_refresh (void)
|
||||
* Retrieve a complete listing of the available brushes.
|
||||
*
|
||||
* This procedure returns a complete listing of available GIMP brushes.
|
||||
* Each name returned can be used as input to the
|
||||
* gimp_context_set_brush() procedure.
|
||||
* Each brush returned can be used as input to
|
||||
* [func@Gimp.context_set_brush].
|
||||
*
|
||||
* Returns: (array zero-terminated=1) (transfer full): The list of brush names.
|
||||
* The returned value must be freed with g_strfreev().
|
||||
* Returns: (element-type GimpBrush) (array zero-terminated=1) (transfer container):
|
||||
* The list of brushes.
|
||||
* The returned value must be freed with g_free().
|
||||
**/
|
||||
gchar **
|
||||
GimpBrush **
|
||||
gimp_brushes_get_list (const gchar *filter)
|
||||
{
|
||||
GimpValueArray *args;
|
||||
GimpValueArray *return_vals;
|
||||
gchar **brush_list = NULL;
|
||||
GimpBrush **brush_list = NULL;
|
||||
|
||||
args = gimp_value_array_new_from_types (NULL,
|
||||
G_TYPE_STRING, filter,
|
||||
@@ -98,7 +99,7 @@ gimp_brushes_get_list (const gchar *filter)
|
||||
gimp_value_array_unref (args);
|
||||
|
||||
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
||||
brush_list = GIMP_VALUES_DUP_STRV (return_vals, 1);
|
||||
brush_list = g_value_dup_boxed (gimp_value_array_index (return_vals, 1));
|
||||
|
||||
gimp_value_array_unref (return_vals);
|
||||
|
||||
|
@@ -32,8 +32,8 @@ G_BEGIN_DECLS
|
||||
/* For information look into the C source or the html documentation */
|
||||
|
||||
|
||||
gboolean gimp_brushes_refresh (void);
|
||||
gchar** gimp_brushes_get_list (const gchar *filter);
|
||||
gboolean gimp_brushes_refresh (void);
|
||||
GimpBrush** gimp_brushes_get_list (const gchar *filter);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
@@ -123,16 +123,19 @@ _gimp_fonts_get_custom_configs (gchar **sysconfig,
|
||||
*
|
||||
* This procedure returns a list of the fonts that are currently
|
||||
* available.
|
||||
* Each font returned can be used as input to
|
||||
* [func@Gimp.context_set_font].
|
||||
*
|
||||
* Returns: (array zero-terminated=1) (transfer full): The list of font names.
|
||||
* The returned value must be freed with g_strfreev().
|
||||
* Returns: (element-type GimpFont) (array zero-terminated=1) (transfer container):
|
||||
* The list of fonts.
|
||||
* The returned value must be freed with g_free().
|
||||
**/
|
||||
gchar **
|
||||
GimpFont **
|
||||
gimp_fonts_get_list (const gchar *filter)
|
||||
{
|
||||
GimpValueArray *args;
|
||||
GimpValueArray *return_vals;
|
||||
gchar **font_list = NULL;
|
||||
GimpFont **font_list = NULL;
|
||||
|
||||
args = gimp_value_array_new_from_types (NULL,
|
||||
G_TYPE_STRING, filter,
|
||||
@@ -144,7 +147,7 @@ gimp_fonts_get_list (const gchar *filter)
|
||||
gimp_value_array_unref (args);
|
||||
|
||||
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
||||
font_list = GIMP_VALUES_DUP_STRV (return_vals, 1);
|
||||
font_list = g_value_dup_boxed (gimp_value_array_index (return_vals, 1));
|
||||
|
||||
gimp_value_array_unref (return_vals);
|
||||
|
||||
|
@@ -36,7 +36,7 @@ gboolean gimp_fonts_refresh (void);
|
||||
G_GNUC_INTERNAL gchar* _gimp_fonts_get_custom_configs (gchar **sysconfig,
|
||||
gchar **renaming_config,
|
||||
gchar ***dirs);
|
||||
gchar** gimp_fonts_get_list (const gchar *filter);
|
||||
GimpFont** gimp_fonts_get_list (const gchar *filter);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
@@ -75,19 +75,20 @@ gimp_gradients_refresh (void)
|
||||
* Retrieve the list of loaded gradients.
|
||||
*
|
||||
* This procedure returns a list of the gradients that are currently
|
||||
* loaded. You can later use the gimp_context_set_gradient() function
|
||||
* to set the active gradient.
|
||||
* loaded.
|
||||
* Each gradient returned can be used as input to
|
||||
* [func@Gimp.context_set_gradient].
|
||||
*
|
||||
* Returns: (array zero-terminated=1) (transfer full):
|
||||
* The list of gradient names.
|
||||
* The returned value must be freed with g_strfreev().
|
||||
* Returns: (element-type GimpGradient) (array zero-terminated=1) (transfer container):
|
||||
* The list of gradients.
|
||||
* The returned value must be freed with g_free().
|
||||
**/
|
||||
gchar **
|
||||
GimpGradient **
|
||||
gimp_gradients_get_list (const gchar *filter)
|
||||
{
|
||||
GimpValueArray *args;
|
||||
GimpValueArray *return_vals;
|
||||
gchar **gradient_list = NULL;
|
||||
GimpGradient **gradient_list = NULL;
|
||||
|
||||
args = gimp_value_array_new_from_types (NULL,
|
||||
G_TYPE_STRING, filter,
|
||||
@@ -99,7 +100,7 @@ gimp_gradients_get_list (const gchar *filter)
|
||||
gimp_value_array_unref (args);
|
||||
|
||||
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
||||
gradient_list = GIMP_VALUES_DUP_STRV (return_vals, 1);
|
||||
gradient_list = g_value_dup_boxed (gimp_value_array_index (return_vals, 1));
|
||||
|
||||
gimp_value_array_unref (return_vals);
|
||||
|
||||
|
@@ -32,8 +32,8 @@ G_BEGIN_DECLS
|
||||
/* For information look into the C source or the html documentation */
|
||||
|
||||
|
||||
gboolean gimp_gradients_refresh (void);
|
||||
gchar** gimp_gradients_get_list (const gchar *filter);
|
||||
gboolean gimp_gradients_refresh (void);
|
||||
GimpGradient** gimp_gradients_get_list (const gchar *filter);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
@@ -75,19 +75,19 @@ gimp_palettes_refresh (void)
|
||||
* Retrieves a list of all of the available palettes
|
||||
*
|
||||
* This procedure returns a complete listing of available palettes.
|
||||
* Each name returned can be used as input to the command
|
||||
* gimp_context_set_palette().
|
||||
* Each palette returned can be used as input to
|
||||
* [func@Gimp.context_set_palette].
|
||||
*
|
||||
* Returns: (array zero-terminated=1) (transfer full):
|
||||
* The list of palette names.
|
||||
* The returned value must be freed with g_strfreev().
|
||||
* Returns: (element-type GimpPalette) (array zero-terminated=1) (transfer container):
|
||||
* The list of palettes.
|
||||
* The returned value must be freed with g_free().
|
||||
**/
|
||||
gchar **
|
||||
GimpPalette **
|
||||
gimp_palettes_get_list (const gchar *filter)
|
||||
{
|
||||
GimpValueArray *args;
|
||||
GimpValueArray *return_vals;
|
||||
gchar **palette_list = NULL;
|
||||
GimpPalette **palette_list = NULL;
|
||||
|
||||
args = gimp_value_array_new_from_types (NULL,
|
||||
G_TYPE_STRING, filter,
|
||||
@@ -99,7 +99,7 @@ gimp_palettes_get_list (const gchar *filter)
|
||||
gimp_value_array_unref (args);
|
||||
|
||||
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
||||
palette_list = GIMP_VALUES_DUP_STRV (return_vals, 1);
|
||||
palette_list = g_value_dup_boxed (gimp_value_array_index (return_vals, 1));
|
||||
|
||||
gimp_value_array_unref (return_vals);
|
||||
|
||||
|
@@ -32,8 +32,8 @@ G_BEGIN_DECLS
|
||||
/* For information look into the C source or the html documentation */
|
||||
|
||||
|
||||
gboolean gimp_palettes_refresh (void);
|
||||
gchar** gimp_palettes_get_list (const gchar *filter);
|
||||
gboolean gimp_palettes_refresh (void);
|
||||
GimpPalette** gimp_palettes_get_list (const gchar *filter);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
@@ -75,19 +75,20 @@ gimp_patterns_refresh (void)
|
||||
* Retrieve a complete listing of the available patterns.
|
||||
*
|
||||
* This procedure returns a complete listing of available GIMP
|
||||
* patterns. Each name returned can be used as input to the
|
||||
* gimp_context_set_pattern().
|
||||
* patterns.
|
||||
* Each pattern returned can be used as input to
|
||||
* [func@Gimp.context_set_pattern].
|
||||
*
|
||||
* Returns: (array zero-terminated=1) (transfer full):
|
||||
* The list of pattern names.
|
||||
* The returned value must be freed with g_strfreev().
|
||||
* Returns: (element-type GimpPattern) (array zero-terminated=1) (transfer container):
|
||||
* The list of patterns.
|
||||
* The returned value must be freed with g_free().
|
||||
**/
|
||||
gchar **
|
||||
GimpPattern **
|
||||
gimp_patterns_get_list (const gchar *filter)
|
||||
{
|
||||
GimpValueArray *args;
|
||||
GimpValueArray *return_vals;
|
||||
gchar **pattern_list = NULL;
|
||||
GimpPattern **pattern_list = NULL;
|
||||
|
||||
args = gimp_value_array_new_from_types (NULL,
|
||||
G_TYPE_STRING, filter,
|
||||
@@ -99,7 +100,7 @@ gimp_patterns_get_list (const gchar *filter)
|
||||
gimp_value_array_unref (args);
|
||||
|
||||
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
||||
pattern_list = GIMP_VALUES_DUP_STRV (return_vals, 1);
|
||||
pattern_list = g_value_dup_boxed (gimp_value_array_index (return_vals, 1));
|
||||
|
||||
gimp_value_array_unref (return_vals);
|
||||
|
||||
|
@@ -32,8 +32,8 @@ G_BEGIN_DECLS
|
||||
/* For information look into the C source or the html documentation */
|
||||
|
||||
|
||||
gboolean gimp_patterns_refresh (void);
|
||||
gchar** gimp_patterns_get_list (const gchar *filter);
|
||||
gboolean gimp_patterns_refresh (void);
|
||||
GimpPattern** gimp_patterns_get_list (const gchar *filter);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
@@ -40,28 +40,29 @@ sub brushes_get_list {
|
||||
|
||||
$help = <<'HELP';
|
||||
This procedure returns a complete listing of available GIMP
|
||||
brushes. Each name returned can be used as input to the
|
||||
gimp_context_set_brush() procedure.
|
||||
brushes.
|
||||
|
||||
Each brush returned can be used as input to [func@Gimp.context_set_brush].
|
||||
HELP
|
||||
|
||||
&std_pdb_misc;
|
||||
|
||||
@inargs = (
|
||||
{ name => 'filter', type => 'string', null_ok => 1,
|
||||
{ name => 'filter', type => 'string',
|
||||
desc => 'An optional regular expression used to filter the list' }
|
||||
);
|
||||
|
||||
@outargs = (
|
||||
{ name => 'brush_list', type => 'strv',
|
||||
desc => 'The list of brush names' }
|
||||
{ name => 'brush_list', type => 'brusharray',
|
||||
desc => 'The list of brushes' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
headers => [ qw("core/gimpcontainer-filter.h") ],
|
||||
code => <<'CODE'
|
||||
{
|
||||
brush_list = gimp_container_get_filtered_name_array (gimp_data_factory_get_container (gimp->brush_factory),
|
||||
filter);
|
||||
brush_list = (GimpBrush **) gimp_container_get_filtered_array (gimp_data_factory_get_container (gimp->brush_factory),
|
||||
filter);
|
||||
}
|
||||
CODE
|
||||
);
|
||||
|
@@ -42,6 +42,8 @@ sub fonts_get_list {
|
||||
|
||||
$help = <<'HELP';
|
||||
This procedure returns a list of the fonts that are currently available.
|
||||
|
||||
Each font returned can be used as input to [func@Gimp.context_set_font].
|
||||
HELP
|
||||
|
||||
&neo_pdb_misc('2003');
|
||||
@@ -52,8 +54,8 @@ HELP
|
||||
);
|
||||
|
||||
@outargs = (
|
||||
{ name => 'font_list', type => 'strv',
|
||||
desc => 'The list of font names' }
|
||||
{ name => 'font_list', type => 'fontarray',
|
||||
desc => 'The list of fonts' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
@@ -64,10 +66,8 @@ HELP
|
||||
success = FALSE;
|
||||
|
||||
if (success)
|
||||
{
|
||||
font_list = gimp_container_get_filtered_name_array (gimp_data_factory_get_container (gimp->font_factory),
|
||||
filter);
|
||||
}
|
||||
font_list = (GimpFont **) gimp_container_get_filtered_array (gimp_data_factory_get_container (gimp->font_factory),
|
||||
filter);
|
||||
}
|
||||
CODE
|
||||
);
|
||||
@@ -135,6 +135,7 @@ CODE
|
||||
@headers = qw("core/gimp.h"
|
||||
"core/gimpcontainer.h"
|
||||
"core/gimpdatafactory.h"
|
||||
"text/gimpfont.h"
|
||||
"text/gimpfontfactory.h");
|
||||
|
||||
@procs = qw(fonts_refresh
|
||||
|
@@ -40,8 +40,8 @@ sub gradients_get_list {
|
||||
|
||||
$help = <<'HELP';
|
||||
This procedure returns a list of the gradients that are currently loaded.
|
||||
You can later use the gimp_context_set_gradient() function to
|
||||
set the active gradient.
|
||||
|
||||
Each gradient returned can be used as input to [func@Gimp.context_set_gradient].
|
||||
HELP
|
||||
|
||||
&federico_pdb_misc('1997');
|
||||
@@ -52,16 +52,16 @@ HELP
|
||||
);
|
||||
|
||||
@outargs = (
|
||||
{ name => 'gradient_list', type => 'strv',
|
||||
desc => 'The list of gradient names' }
|
||||
{ name => 'gradient_list', type => 'gradientarray',
|
||||
desc => 'The list of gradients' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
headers => [ qw("core/gimpcontainer-filter.h") ],
|
||||
code => <<'CODE'
|
||||
{
|
||||
gradient_list = gimp_container_get_filtered_name_array (gimp_data_factory_get_container (gimp->gradient_factory),
|
||||
filter);
|
||||
gradient_list = (GimpGradient **) gimp_container_get_filtered_array (gimp_data_factory_get_container (gimp->gradient_factory),
|
||||
filter);
|
||||
}
|
||||
CODE
|
||||
);
|
||||
|
@@ -39,8 +39,9 @@ sub palettes_get_list {
|
||||
$blurb = 'Retrieves a list of all of the available palettes';
|
||||
|
||||
$help = <<'HELP';
|
||||
This procedure returns a complete listing of available palettes. Each name
|
||||
returned can be used as input to the command gimp_context_set_palette().
|
||||
This procedure returns a complete listing of available palettes.
|
||||
|
||||
Each palette returned can be used as input to [func@Gimp.context_set_palette].
|
||||
HELP
|
||||
|
||||
&rock_pdb_misc('2001');
|
||||
@@ -51,16 +52,16 @@ HELP
|
||||
);
|
||||
|
||||
@outargs = (
|
||||
{ name => 'palette_list', type => 'strv',
|
||||
desc => 'The list of palette names' }
|
||||
{ name => 'palette_list', type => 'palettearray',
|
||||
desc => 'The list of palettes' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
headers => [ qw("core/gimpcontainer-filter.h") ],
|
||||
code => <<'CODE'
|
||||
{
|
||||
palette_list = gimp_container_get_filtered_name_array (gimp_data_factory_get_container (gimp->palette_factory),
|
||||
filter);
|
||||
palette_list = (GimpPalette **) gimp_container_get_filtered_array (gimp_data_factory_get_container (gimp->palette_factory),
|
||||
filter);
|
||||
}
|
||||
CODE
|
||||
);
|
||||
|
@@ -39,8 +39,9 @@ sub patterns_get_list {
|
||||
$blurb = 'Retrieve a complete listing of the available patterns.';
|
||||
|
||||
$help = <<'HELP';
|
||||
This procedure returns a complete listing of available GIMP patterns. Each name
|
||||
returned can be used as input to the gimp_context_set_pattern().
|
||||
This procedure returns a complete listing of available GIMP patterns.
|
||||
|
||||
Each pattern returned can be used as input to [func@Gimp.context_set_pattern].
|
||||
HELP
|
||||
|
||||
&std_pdb_misc;
|
||||
@@ -51,16 +52,16 @@ HELP
|
||||
);
|
||||
|
||||
@outargs = (
|
||||
{ name => 'pattern_list', type => 'strv',
|
||||
desc => 'The list of pattern names' }
|
||||
{ name => 'pattern_list', type => 'patternarray',
|
||||
desc => 'The list of patterns' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
headers => [ qw("core/gimpcontainer-filter.h") ],
|
||||
code => <<'CODE'
|
||||
{
|
||||
pattern_list = gimp_container_get_filtered_name_array (gimp_data_factory_get_container (gimp->pattern_factory),
|
||||
filter);
|
||||
pattern_list = (GimpPattern **) gimp_container_get_filtered_array (gimp_data_factory_get_container (gimp->pattern_factory),
|
||||
filter);
|
||||
}
|
||||
CODE
|
||||
);
|
||||
|
Reference in New Issue
Block a user