2000-05-30 23:15:06 -07:00
|
|
|
/* LIBGIMP - The GIMP Library
|
2003-07-02 17:47:26 -07:00
|
|
|
* Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
|
2000-05-30 23:15:06 -07:00
|
|
|
*
|
2000-06-01 14:18:04 -07:00
|
|
|
* gimpgradients_pdb.c
|
1998-01-25 02:26:47 -08:00
|
|
|
*
|
2009-01-17 14:28:01 -08:00
|
|
|
* This library is free software: you can redistribute it and/or
|
1999-11-17 13:13:50 -08:00
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
1998-01-25 02:26:47 -08:00
|
|
|
* License as published by the Free Software Foundation; either
|
2009-01-17 14:28:01 -08:00
|
|
|
* version 3 of the License, or (at your option) any later version.
|
2000-05-30 23:15:06 -07: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
|
2000-06-01 14:18:04 -07:00
|
|
|
* Lesser General Public License for more details.
|
1998-01-25 02:26:47 -08:00
|
|
|
*
|
1999-11-17 13:13:50 -08:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2009-01-17 14:28:01 -08:00
|
|
|
* License along with this library. If not, see
|
2018-07-11 14:27:07 -07:00
|
|
|
* <https://www.gnu.org/licenses/>.
|
2000-05-30 23:15:06 -07:00
|
|
|
*/
|
|
|
|
|
|
2007-01-09 02:52:47 -08:00
|
|
|
/* NOTE: This file is auto-generated by pdbgen.pl */
|
1997-11-24 14:05:25 -08:00
|
|
|
|
2002-05-13 16:30:23 -07:00
|
|
|
#include "config.h"
|
|
|
|
|
|
2022-03-28 06:13:17 -07:00
|
|
|
#include "stamp-pdbgen.h"
|
|
|
|
|
|
2000-06-01 14:18:04 -07:00
|
|
|
#include "gimp.h"
|
1997-11-24 14:05:25 -08:00
|
|
|
|
2010-07-07 02:43:10 -07:00
|
|
|
|
|
|
|
|
/**
|
2019-07-31 01:04:43 -07:00
|
|
|
* SECTION: gimpgradients
|
2010-07-07 02:43:10 -07:00
|
|
|
* @title: gimpgradients
|
|
|
|
|
* @short_description: Operations related to gradients.
|
|
|
|
|
*
|
|
|
|
|
* Operations related to gradients.
|
|
|
|
|
**/
|
|
|
|
|
|
|
|
|
|
|
2002-02-21 03:16:00 -08:00
|
|
|
/**
|
|
|
|
|
* gimp_gradients_refresh:
|
|
|
|
|
*
|
2003-12-08 03:58:45 -08:00
|
|
|
* Refresh current gradients. This function always succeeds.
|
2002-02-21 03:16:00 -08:00
|
|
|
*
|
|
|
|
|
* This procedure retrieves all gradients currently in the user's
|
|
|
|
|
* gradient path and updates the gradient dialogs accordingly.
|
|
|
|
|
*
|
|
|
|
|
* Returns: TRUE on success.
|
2010-09-15 13:07:36 -07:00
|
|
|
**/
|
2002-02-21 03:16:00 -08:00
|
|
|
gboolean
|
|
|
|
|
gimp_gradients_refresh (void)
|
|
|
|
|
{
|
2019-07-30 01:51:16 -07:00
|
|
|
GimpValueArray *args;
|
|
|
|
|
GimpValueArray *return_vals;
|
2002-02-21 03:16:00 -08:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
|
2019-08-08 04:01:50 -07:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
|
G_TYPE_NONE);
|
2002-02-21 03:16:00 -08:00
|
|
|
|
2023-10-16 13:07:55 -07:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
|
"gimp-gradients-refresh",
|
|
|
|
|
args);
|
2019-07-30 01:51:16 -07:00
|
|
|
gimp_value_array_unref (args);
|
2002-02-21 03:16:00 -08:00
|
|
|
|
2019-09-03 16:49:35 -07:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-07-30 01:51:16 -07:00
|
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2002-02-21 03:16:00 -08:00
|
|
|
|
|
|
|
|
return success;
|
|
|
|
|
}
|
|
|
|
|
|
2000-08-24 16:06:53 -07:00
|
|
|
/**
|
|
|
|
|
* gimp_gradients_get_list:
|
2025-01-20 11:11:14 -08:00
|
|
|
* @filter: (nullable): An optional regular expression used to filter the list.
|
2000-08-24 16:06:53 -07:00
|
|
|
*
|
|
|
|
|
* Retrieve the list of loaded gradients.
|
|
|
|
|
*
|
|
|
|
|
* This procedure returns a list of the gradients that are currently
|
2024-11-03 07:36:47 -08:00
|
|
|
* loaded.
|
|
|
|
|
* Each gradient returned can be used as input to
|
|
|
|
|
* [func@Gimp.context_set_gradient].
|
2000-08-24 16:06:53 -07:00
|
|
|
*
|
2024-11-03 07:36:47 -08:00
|
|
|
* Returns: (element-type GimpGradient) (array zero-terminated=1) (transfer container):
|
|
|
|
|
* The list of gradients.
|
|
|
|
|
* The returned value must be freed with g_free().
|
2010-09-15 13:07:36 -07:00
|
|
|
**/
|
2024-11-03 07:36:47 -08:00
|
|
|
GimpGradient **
|
2021-12-01 13:35:25 -08:00
|
|
|
gimp_gradients_get_list (const gchar *filter)
|
1997-11-24 14:05:25 -08:00
|
|
|
{
|
2019-07-30 01:51:16 -07:00
|
|
|
GimpValueArray *args;
|
|
|
|
|
GimpValueArray *return_vals;
|
2024-11-03 07:36:47 -08:00
|
|
|
GimpGradient **gradient_list = NULL;
|
1997-11-24 14:05:25 -08:00
|
|
|
|
2019-08-08 04:01:50 -07:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
|
G_TYPE_STRING, filter,
|
2019-07-30 01:51:16 -07:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
|
2023-10-16 13:07:55 -07:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
|
"gimp-gradients-get-list",
|
|
|
|
|
args);
|
2019-07-30 01:51:16 -07:00
|
|
|
gimp_value_array_unref (args);
|
2000-06-01 14:18:04 -07:00
|
|
|
|
2019-09-03 16:49:35 -07:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2024-11-03 07:36:47 -08:00
|
|
|
gradient_list = g_value_dup_boxed (gimp_value_array_index (return_vals, 1));
|
1997-11-24 14:05:25 -08:00
|
|
|
|
2019-07-30 01:51:16 -07:00
|
|
|
gimp_value_array_unref (return_vals);
|
1997-11-24 14:05:25 -08:00
|
|
|
|
2003-09-04 05:02:31 -07:00
|
|
|
return gradient_list;
|
1997-11-24 14:05:25 -08:00
|
|
|
}
|