2000-06-01 05:16:11 +08:00
|
|
|
/* LIBGIMP - The GIMP Library
|
2003-07-03 08:47:26 +08:00
|
|
|
* Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
|
2000-06-01 05:16:11 +08:00
|
|
|
*
|
|
|
|
* gimpbrushes_pdb.c
|
|
|
|
*
|
2009-01-18 06:28:01 +08:00
|
|
|
* This library is free software: you can redistribute it and/or
|
2000-06-01 05:16:11 +08:00
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
2009-01-18 06:28:01 +08:00
|
|
|
* version 3 of the License, or (at your option) any later version.
|
2000-06-01 05:16:11 +08:00
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2009-01-18 06:28:01 +08:00
|
|
|
* License along with this library. If not, see
|
2018-07-12 05:27:07 +08:00
|
|
|
* <https://www.gnu.org/licenses/>.
|
2000-06-01 05:16:11 +08:00
|
|
|
*/
|
|
|
|
|
2007-01-09 18:52:47 +08:00
|
|
|
/* NOTE: This file is auto-generated by pdbgen.pl */
|
2000-08-22 02:59:12 +08:00
|
|
|
|
2002-05-14 07:30:23 +08:00
|
|
|
#include "config.h"
|
|
|
|
|
2022-03-28 21:13:17 +08:00
|
|
|
#include "stamp-pdbgen.h"
|
|
|
|
|
2000-06-01 05:16:11 +08:00
|
|
|
#include "gimp.h"
|
|
|
|
|
2010-07-07 17:43:10 +08:00
|
|
|
|
|
|
|
/**
|
2019-07-31 16:04:43 +08:00
|
|
|
* SECTION: gimpbrushes
|
2010-07-07 17:43:10 +08:00
|
|
|
* @title: gimpbrushes
|
|
|
|
* @short_description: Functions for manipulating brushes.
|
|
|
|
*
|
|
|
|
* Functions related to getting and setting brushes.
|
|
|
|
**/
|
|
|
|
|
|
|
|
|
2002-03-13 23:29:59 +08:00
|
|
|
/**
|
|
|
|
* gimp_brushes_refresh:
|
|
|
|
*
|
2003-12-08 19:58:45 +08:00
|
|
|
* Refresh current brushes. This function always succeeds.
|
2002-03-13 23:29:59 +08:00
|
|
|
*
|
|
|
|
* This procedure retrieves all brushes currently in the user's brush
|
2004-09-23 23:05:48 +08:00
|
|
|
* path and updates the brush dialogs accordingly.
|
2002-03-13 23:29:59 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2002-03-13 23:29:59 +08:00
|
|
|
gboolean
|
|
|
|
gimp_brushes_refresh (void)
|
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2002-03-13 23:29:59 +08:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2002-03-13 23:29:59 +08:00
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-brushes-refresh",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2002-03-13 23:29:59 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-07-30 16:51:16 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2002-03-13 23:29:59 +08:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_brushes_get_list:
|
2003-09-05 01:04:36 +08:00
|
|
|
* @filter: An optional regular expression used to filter the list.
|
2002-03-13 23:29:59 +08:00
|
|
|
*
|
|
|
|
* 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
|
2006-06-14 16:32:08 +08:00
|
|
|
* gimp_context_set_brush() procedure.
|
2002-03-13 23:29:59 +08:00
|
|
|
*
|
2021-12-02 05:35:25 +08:00
|
|
|
* Returns: (array zero-terminated=1) (transfer full): The list of brush names.
|
2019-08-05 04:09:04 +08:00
|
|
|
* The returned value must be freed with g_strfreev().
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2002-03-13 23:29:59 +08:00
|
|
|
gchar **
|
2021-12-02 05:35:25 +08:00
|
|
|
gimp_brushes_get_list (const gchar *filter)
|
2002-03-13 23:29:59 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2002-03-13 23:29:59 +08:00
|
|
|
gchar **brush_list = NULL;
|
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_STRING, filter,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-brushes-get-list",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2002-03-13 23:29:59 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2021-12-02 05:35:25 +08:00
|
|
|
brush_list = GIMP_VALUES_DUP_STRV (return_vals, 1);
|
2002-03-13 23:29:59 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2002-03-13 23:29:59 +08:00
|
|
|
|
|
|
|
return brush_list;
|
|
|
|
}
|