gimp/libgimp/gimpgradients_pdb.c

433 lines
11 KiB
C
Raw Normal View History

Sven Neumann <sven@gimp.org> 2000-05-31 Michael Natterer <mitch@gimp.org> Sven Neumann <sven@gimp.org> * libgimp/Makefile.am * libgimp/gimpchannel_pdb.h * libgimp/gimpdisplay_pdb.h * libgimp/gimpdrawable_pdb.h * libgimp/gimpgradient_pdb.h * libgimp/gimphelp_pdb.h * libgimp/gimpimage_pdb.h * libgimp/gimplayer_pdb.h * libgimp/gimpparasite_pdb.h * libgimp/gimpselection_pdb.h * libgimp/gimpunit_pdb.h * libgimp/gimpdrawable.[ch] * libgimp/gimphelp.c * libgimp/gimppixelrgn.h * libgimp/gimptile.h: new files * libgimp/gimp.[ch] * libgimp/gimpchannel_pdb.c * libgimp/gimpdrawable_pdb.c * libgimp/gimpgradient_pdb.c * libgimp/gimppalette_pdb.c * libgimp/gimpselection_pdb.c * libgimp/gimphelp_pdb.c * libgimp/gimpimage_pdb.c * libgimp/gimplayer_pdb.c * libgimp/gimpgradientmenu.c * libgimp/gimpbrushmenu.c * libgimp/gimpmenu.[ch] * libgimp/gimppatternmenu.c * libgimp/gimppixelrgn.c * libgimp/gimptile.c: part III of the (final) libgimp cleanup Split gimp.h into a bunch of headers. More or less finished the task of moving PDB wrappers into separate files in preparation of the upcoming autogen-it-all-attack. * libgimp/gimpcompat.h: declared the following functions obsolete: gimp_[channel|layer]_[width|height] gimp_layer_[bpp|type] gimp_channel_get_[image|layer]_ID * libgimp/gimptypes.h: new file: GPlugInInfo GTile GDrawable GPixelRgn GParamColor GParamRegion GParamData GParamDef GParam: s/G/Gimp/ * app/gimphelp_cmds.c * app/plug_in_cmds.c * tools/pdbgen/pdb/gimphelp.pdb * tools/pdbgen/pdb/plug_in.pdb: changed help texts.
2000-05-31 14:15:06 +08:00
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
Sven Neumann <sven@gimp.org> 2000-05-31 Michael Natterer <mitch@gimp.org> Sven Neumann <sven@gimp.org> * libgimp/Makefile.am * libgimp/gimpchannel_pdb.h * libgimp/gimpdisplay_pdb.h * libgimp/gimpdrawable_pdb.h * libgimp/gimpgradient_pdb.h * libgimp/gimphelp_pdb.h * libgimp/gimpimage_pdb.h * libgimp/gimplayer_pdb.h * libgimp/gimpparasite_pdb.h * libgimp/gimpselection_pdb.h * libgimp/gimpunit_pdb.h * libgimp/gimpdrawable.[ch] * libgimp/gimphelp.c * libgimp/gimppixelrgn.h * libgimp/gimptile.h: new files * libgimp/gimp.[ch] * libgimp/gimpchannel_pdb.c * libgimp/gimpdrawable_pdb.c * libgimp/gimpgradient_pdb.c * libgimp/gimppalette_pdb.c * libgimp/gimpselection_pdb.c * libgimp/gimphelp_pdb.c * libgimp/gimpimage_pdb.c * libgimp/gimplayer_pdb.c * libgimp/gimpgradientmenu.c * libgimp/gimpbrushmenu.c * libgimp/gimpmenu.[ch] * libgimp/gimppatternmenu.c * libgimp/gimppixelrgn.c * libgimp/gimptile.c: part III of the (final) libgimp cleanup Split gimp.h into a bunch of headers. More or less finished the task of moving PDB wrappers into separate files in preparation of the upcoming autogen-it-all-attack. * libgimp/gimpcompat.h: declared the following functions obsolete: gimp_[channel|layer]_[width|height] gimp_layer_[bpp|type] gimp_channel_get_[image|layer]_ID * libgimp/gimptypes.h: new file: GPlugInInfo GTile GDrawable GPixelRgn GParamColor GParamRegion GParamData GParamDef GParam: s/G/Gimp/ * app/gimphelp_cmds.c * app/plug_in_cmds.c * tools/pdbgen/pdb/gimphelp.pdb * tools/pdbgen/pdb/plug_in.pdb: changed help texts.
2000-05-31 14:15:06 +08:00
*
* gimpgradients_pdb.c
1998-01-25 18:26:47 +08:00
*
* This library is free software; you can redistribute it and/or
1999-11-18 05:13:50 +08:00
* modify it under the terms of the GNU Lesser General Public
1998-01-25 18:26:47 +08:00
* License as published by the Free Software Foundation; either
Sven Neumann <sven@gimp.org> 2000-05-31 Michael Natterer <mitch@gimp.org> Sven Neumann <sven@gimp.org> * libgimp/Makefile.am * libgimp/gimpchannel_pdb.h * libgimp/gimpdisplay_pdb.h * libgimp/gimpdrawable_pdb.h * libgimp/gimpgradient_pdb.h * libgimp/gimphelp_pdb.h * libgimp/gimpimage_pdb.h * libgimp/gimplayer_pdb.h * libgimp/gimpparasite_pdb.h * libgimp/gimpselection_pdb.h * libgimp/gimpunit_pdb.h * libgimp/gimpdrawable.[ch] * libgimp/gimphelp.c * libgimp/gimppixelrgn.h * libgimp/gimptile.h: new files * libgimp/gimp.[ch] * libgimp/gimpchannel_pdb.c * libgimp/gimpdrawable_pdb.c * libgimp/gimpgradient_pdb.c * libgimp/gimppalette_pdb.c * libgimp/gimpselection_pdb.c * libgimp/gimphelp_pdb.c * libgimp/gimpimage_pdb.c * libgimp/gimplayer_pdb.c * libgimp/gimpgradientmenu.c * libgimp/gimpbrushmenu.c * libgimp/gimpmenu.[ch] * libgimp/gimppatternmenu.c * libgimp/gimppixelrgn.c * libgimp/gimptile.c: part III of the (final) libgimp cleanup Split gimp.h into a bunch of headers. More or less finished the task of moving PDB wrappers into separate files in preparation of the upcoming autogen-it-all-attack. * libgimp/gimpcompat.h: declared the following functions obsolete: gimp_[channel|layer]_[width|height] gimp_layer_[bpp|type] gimp_channel_get_[image|layer]_ID * libgimp/gimptypes.h: new file: GPlugInInfo GTile GDrawable GPixelRgn GParamColor GParamRegion GParamData GParamDef GParam: s/G/Gimp/ * app/gimphelp_cmds.c * app/plug_in_cmds.c * tools/pdbgen/pdb/gimphelp.pdb * tools/pdbgen/pdb/plug_in.pdb: changed help texts.
2000-05-31 14:15:06 +08:00
* version 2 of the License, or (at your option) any later version.
*
* 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.
1998-01-25 18:26:47 +08:00
*
1999-11-18 05:13:50 +08:00
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
Sven Neumann <sven@gimp.org> 2000-05-31 Michael Natterer <mitch@gimp.org> Sven Neumann <sven@gimp.org> * libgimp/Makefile.am * libgimp/gimpchannel_pdb.h * libgimp/gimpdisplay_pdb.h * libgimp/gimpdrawable_pdb.h * libgimp/gimpgradient_pdb.h * libgimp/gimphelp_pdb.h * libgimp/gimpimage_pdb.h * libgimp/gimplayer_pdb.h * libgimp/gimpparasite_pdb.h * libgimp/gimpselection_pdb.h * libgimp/gimpunit_pdb.h * libgimp/gimpdrawable.[ch] * libgimp/gimphelp.c * libgimp/gimppixelrgn.h * libgimp/gimptile.h: new files * libgimp/gimp.[ch] * libgimp/gimpchannel_pdb.c * libgimp/gimpdrawable_pdb.c * libgimp/gimpgradient_pdb.c * libgimp/gimppalette_pdb.c * libgimp/gimpselection_pdb.c * libgimp/gimphelp_pdb.c * libgimp/gimpimage_pdb.c * libgimp/gimplayer_pdb.c * libgimp/gimpgradientmenu.c * libgimp/gimpbrushmenu.c * libgimp/gimpmenu.[ch] * libgimp/gimppatternmenu.c * libgimp/gimppixelrgn.c * libgimp/gimptile.c: part III of the (final) libgimp cleanup Split gimp.h into a bunch of headers. More or less finished the task of moving PDB wrappers into separate files in preparation of the upcoming autogen-it-all-attack. * libgimp/gimpcompat.h: declared the following functions obsolete: gimp_[channel|layer]_[width|height] gimp_layer_[bpp|type] gimp_channel_get_[image|layer]_ID * libgimp/gimptypes.h: new file: GPlugInInfo GTile GDrawable GPixelRgn GParamColor GParamRegion GParamData GParamDef GParam: s/G/Gimp/ * app/gimphelp_cmds.c * app/plug_in_cmds.c * tools/pdbgen/pdb/gimphelp.pdb * tools/pdbgen/pdb/plug_in.pdb: changed help texts.
2000-05-31 14:15:06 +08:00
*/
/* NOTE: This file is autogenerated by pdbgen.pl */
1997-11-25 06:05:25 +08:00
#include "config.h"
#include <string.h>
#include "gimp.h"
1997-11-25 06:05:25 +08:00
/**
* gimp_gradients_refresh:
*
* Refresh current gradients. This function always succeeds.
*
* This procedure retrieves all gradients currently in the user's
* gradient path and updates the gradient dialogs accordingly.
*
* Returns: TRUE on success.
*/
gboolean
gimp_gradients_refresh (void)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp_gradients_refresh",
&nreturn_vals,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_gradients_get_list:
* @filter: An optional regular expression used to filter the list.
* @num_gradients: The number of loaded gradients.
*
* Retrieve the list of loaded gradients.
*
* This procedure returns a list of the gradients that are currently
* loaded in the gradient editor. You can later use the
* gimp_gradients_set_active function to set the active gradient.
*
* Returns: The list of gradient names.
*/
Sven Neumann <sven@gimp.org> 2000-05-31 Michael Natterer <mitch@gimp.org> Sven Neumann <sven@gimp.org> * libgimp/Makefile.am * libgimp/gimpchannel_pdb.h * libgimp/gimpdisplay_pdb.h * libgimp/gimpdrawable_pdb.h * libgimp/gimpgradient_pdb.h * libgimp/gimphelp_pdb.h * libgimp/gimpimage_pdb.h * libgimp/gimplayer_pdb.h * libgimp/gimpparasite_pdb.h * libgimp/gimpselection_pdb.h * libgimp/gimpunit_pdb.h * libgimp/gimpdrawable.[ch] * libgimp/gimphelp.c * libgimp/gimppixelrgn.h * libgimp/gimptile.h: new files * libgimp/gimp.[ch] * libgimp/gimpchannel_pdb.c * libgimp/gimpdrawable_pdb.c * libgimp/gimpgradient_pdb.c * libgimp/gimppalette_pdb.c * libgimp/gimpselection_pdb.c * libgimp/gimphelp_pdb.c * libgimp/gimpimage_pdb.c * libgimp/gimplayer_pdb.c * libgimp/gimpgradientmenu.c * libgimp/gimpbrushmenu.c * libgimp/gimpmenu.[ch] * libgimp/gimppatternmenu.c * libgimp/gimppixelrgn.c * libgimp/gimptile.c: part III of the (final) libgimp cleanup Split gimp.h into a bunch of headers. More or less finished the task of moving PDB wrappers into separate files in preparation of the upcoming autogen-it-all-attack. * libgimp/gimpcompat.h: declared the following functions obsolete: gimp_[channel|layer]_[width|height] gimp_layer_[bpp|type] gimp_channel_get_[image|layer]_ID * libgimp/gimptypes.h: new file: GPlugInInfo GTile GDrawable GPixelRgn GParamColor GParamRegion GParamData GParamDef GParam: s/G/Gimp/ * app/gimphelp_cmds.c * app/plug_in_cmds.c * tools/pdbgen/pdb/gimphelp.pdb * tools/pdbgen/pdb/plug_in.pdb: changed help texts.
2000-05-31 14:15:06 +08:00
gchar **
gimp_gradients_get_list (const gchar *filter,
gint *num_gradients)
1997-11-25 06:05:25 +08:00
{
GimpParam *return_vals;
gint nreturn_vals;
gchar **gradient_list = NULL;
gint i;
1997-11-25 06:05:25 +08:00
return_vals = gimp_run_procedure ("gimp_gradients_get_list",
&nreturn_vals,
GIMP_PDB_STRING, filter,
GIMP_PDB_END);
1997-11-25 06:05:25 +08:00
*num_gradients = 0;
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
1997-11-25 06:05:25 +08:00
{
*num_gradients = return_vals[1].data.d_int32;
gradient_list = g_new (gchar *, *num_gradients);
1997-11-25 06:05:25 +08:00
for (i = 0; i < *num_gradients; i++)
gradient_list[i] = g_strdup (return_vals[2].data.d_stringarray[i]);
1997-11-25 06:05:25 +08:00
}
gimp_destroy_params (return_vals, nreturn_vals);
return gradient_list;
1997-11-25 06:05:25 +08:00
}
/**
renamed parameters to be consistent with the other foo-select.* files. 2002-03-13 Michael Natterer <mitch@gimp.org> * app/gui/brush-select.[ch]: renamed parameters to be consistent with the other foo-select.* files. * app/gui/tool-options-dialog.c: removed unused function. * app/plug-in/plug-in-types.h: PlugInImageType was accidentially exported to the PDB. * tools/pdbgen/enums.pl * libgimp/gimpenums.h * plug-ins/script-fu/script-fu-constants.c: regenerated. More brush, pattern, ... PDB wrapper cleanup: * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/palette_select.pdb * tools/pdbgen/pdb/pattern_select.pdb: even more cleanup, guard all functions with if(!gimp->no_interface). * tools/pdbgen/pdb/brushes.pdb * tools/pdbgen/pdb/gradients.pdb * tools/pdbgen/pdb/palettes.pdb * tools/pdbgen/pdb/patterns.pdb: reordered functions to be consistent across all files. Generate libgimp wrappers for *all* functions because of API symmetry. * tools/pdbgen/pdb/gradients.pdb: renamed gradients_[get|set]_active to gradients_[get|set]_gradient because of API symmetry. * libgimp/gimpcompat.h: added the old function names here, guard the whole file with GIMP_ENABLE_COMPAT_CRUFT (it's back, yeah). * plug-ins/FractalExplorer/Dialogs.c * plug-ins/gflare/gflare.c: use the new function names. * libgimp/gimpbrushes_pdb.[ch] * libgimp/gimpgradients_pdb.[ch] * libgimp/gimppalettes_pdb.[ch] * libgimp/gimppatterns_pdb.[ch] * app/pdb/brush_select_cmds.c * app/pdb/brushes_cmds.c * app/pdb/gradient_select_cmds.c * app/pdb/gradients_cmds.c * app/pdb/palette_select_cmds.c * app/pdb/palettes_cmds.c * app/pdb/pattern_select_cmds.c * app/pdb/patterns_cmds.c: regenerated.
2002-03-13 23:29:59 +08:00
* gimp_gradients_get_gradient:
*
* Retrieve the name of the active gradient.
*
* This procedure returns the name of the active gradient in the
* gradient editor.
*
* Returns: The name of the active gradient.
*/
Sven Neumann <sven@gimp.org> 2000-05-31 Michael Natterer <mitch@gimp.org> Sven Neumann <sven@gimp.org> * libgimp/Makefile.am * libgimp/gimpchannel_pdb.h * libgimp/gimpdisplay_pdb.h * libgimp/gimpdrawable_pdb.h * libgimp/gimpgradient_pdb.h * libgimp/gimphelp_pdb.h * libgimp/gimpimage_pdb.h * libgimp/gimplayer_pdb.h * libgimp/gimpparasite_pdb.h * libgimp/gimpselection_pdb.h * libgimp/gimpunit_pdb.h * libgimp/gimpdrawable.[ch] * libgimp/gimphelp.c * libgimp/gimppixelrgn.h * libgimp/gimptile.h: new files * libgimp/gimp.[ch] * libgimp/gimpchannel_pdb.c * libgimp/gimpdrawable_pdb.c * libgimp/gimpgradient_pdb.c * libgimp/gimppalette_pdb.c * libgimp/gimpselection_pdb.c * libgimp/gimphelp_pdb.c * libgimp/gimpimage_pdb.c * libgimp/gimplayer_pdb.c * libgimp/gimpgradientmenu.c * libgimp/gimpbrushmenu.c * libgimp/gimpmenu.[ch] * libgimp/gimppatternmenu.c * libgimp/gimppixelrgn.c * libgimp/gimptile.c: part III of the (final) libgimp cleanup Split gimp.h into a bunch of headers. More or less finished the task of moving PDB wrappers into separate files in preparation of the upcoming autogen-it-all-attack. * libgimp/gimpcompat.h: declared the following functions obsolete: gimp_[channel|layer]_[width|height] gimp_layer_[bpp|type] gimp_channel_get_[image|layer]_ID * libgimp/gimptypes.h: new file: GPlugInInfo GTile GDrawable GPixelRgn GParamColor GParamRegion GParamData GParamDef GParam: s/G/Gimp/ * app/gimphelp_cmds.c * app/plug_in_cmds.c * tools/pdbgen/pdb/gimphelp.pdb * tools/pdbgen/pdb/plug_in.pdb: changed help texts.
2000-05-31 14:15:06 +08:00
gchar *
renamed parameters to be consistent with the other foo-select.* files. 2002-03-13 Michael Natterer <mitch@gimp.org> * app/gui/brush-select.[ch]: renamed parameters to be consistent with the other foo-select.* files. * app/gui/tool-options-dialog.c: removed unused function. * app/plug-in/plug-in-types.h: PlugInImageType was accidentially exported to the PDB. * tools/pdbgen/enums.pl * libgimp/gimpenums.h * plug-ins/script-fu/script-fu-constants.c: regenerated. More brush, pattern, ... PDB wrapper cleanup: * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/palette_select.pdb * tools/pdbgen/pdb/pattern_select.pdb: even more cleanup, guard all functions with if(!gimp->no_interface). * tools/pdbgen/pdb/brushes.pdb * tools/pdbgen/pdb/gradients.pdb * tools/pdbgen/pdb/palettes.pdb * tools/pdbgen/pdb/patterns.pdb: reordered functions to be consistent across all files. Generate libgimp wrappers for *all* functions because of API symmetry. * tools/pdbgen/pdb/gradients.pdb: renamed gradients_[get|set]_active to gradients_[get|set]_gradient because of API symmetry. * libgimp/gimpcompat.h: added the old function names here, guard the whole file with GIMP_ENABLE_COMPAT_CRUFT (it's back, yeah). * plug-ins/FractalExplorer/Dialogs.c * plug-ins/gflare/gflare.c: use the new function names. * libgimp/gimpbrushes_pdb.[ch] * libgimp/gimpgradients_pdb.[ch] * libgimp/gimppalettes_pdb.[ch] * libgimp/gimppatterns_pdb.[ch] * app/pdb/brush_select_cmds.c * app/pdb/brushes_cmds.c * app/pdb/gradient_select_cmds.c * app/pdb/gradients_cmds.c * app/pdb/palette_select_cmds.c * app/pdb/palettes_cmds.c * app/pdb/pattern_select_cmds.c * app/pdb/patterns_cmds.c: regenerated.
2002-03-13 23:29:59 +08:00
gimp_gradients_get_gradient (void)
1997-11-25 06:05:25 +08:00
{
GimpParam *return_vals;
gint nreturn_vals;
gchar *name = NULL;
1997-11-25 06:05:25 +08:00
renamed parameters to be consistent with the other foo-select.* files. 2002-03-13 Michael Natterer <mitch@gimp.org> * app/gui/brush-select.[ch]: renamed parameters to be consistent with the other foo-select.* files. * app/gui/tool-options-dialog.c: removed unused function. * app/plug-in/plug-in-types.h: PlugInImageType was accidentially exported to the PDB. * tools/pdbgen/enums.pl * libgimp/gimpenums.h * plug-ins/script-fu/script-fu-constants.c: regenerated. More brush, pattern, ... PDB wrapper cleanup: * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/palette_select.pdb * tools/pdbgen/pdb/pattern_select.pdb: even more cleanup, guard all functions with if(!gimp->no_interface). * tools/pdbgen/pdb/brushes.pdb * tools/pdbgen/pdb/gradients.pdb * tools/pdbgen/pdb/palettes.pdb * tools/pdbgen/pdb/patterns.pdb: reordered functions to be consistent across all files. Generate libgimp wrappers for *all* functions because of API symmetry. * tools/pdbgen/pdb/gradients.pdb: renamed gradients_[get|set]_active to gradients_[get|set]_gradient because of API symmetry. * libgimp/gimpcompat.h: added the old function names here, guard the whole file with GIMP_ENABLE_COMPAT_CRUFT (it's back, yeah). * plug-ins/FractalExplorer/Dialogs.c * plug-ins/gflare/gflare.c: use the new function names. * libgimp/gimpbrushes_pdb.[ch] * libgimp/gimpgradients_pdb.[ch] * libgimp/gimppalettes_pdb.[ch] * libgimp/gimppatterns_pdb.[ch] * app/pdb/brush_select_cmds.c * app/pdb/brushes_cmds.c * app/pdb/gradient_select_cmds.c * app/pdb/gradients_cmds.c * app/pdb/palette_select_cmds.c * app/pdb/palettes_cmds.c * app/pdb/pattern_select_cmds.c * app/pdb/patterns_cmds.c: regenerated.
2002-03-13 23:29:59 +08:00
return_vals = gimp_run_procedure ("gimp_gradients_get_gradient",
1997-11-25 06:05:25 +08:00
&nreturn_vals,
GIMP_PDB_END);
1997-11-25 06:05:25 +08:00
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
name = g_strdup (return_vals[1].data.d_string);
1997-11-25 06:05:25 +08:00
gimp_destroy_params (return_vals, nreturn_vals);
return name;
1997-11-25 06:05:25 +08:00
}
/**
renamed parameters to be consistent with the other foo-select.* files. 2002-03-13 Michael Natterer <mitch@gimp.org> * app/gui/brush-select.[ch]: renamed parameters to be consistent with the other foo-select.* files. * app/gui/tool-options-dialog.c: removed unused function. * app/plug-in/plug-in-types.h: PlugInImageType was accidentially exported to the PDB. * tools/pdbgen/enums.pl * libgimp/gimpenums.h * plug-ins/script-fu/script-fu-constants.c: regenerated. More brush, pattern, ... PDB wrapper cleanup: * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/palette_select.pdb * tools/pdbgen/pdb/pattern_select.pdb: even more cleanup, guard all functions with if(!gimp->no_interface). * tools/pdbgen/pdb/brushes.pdb * tools/pdbgen/pdb/gradients.pdb * tools/pdbgen/pdb/palettes.pdb * tools/pdbgen/pdb/patterns.pdb: reordered functions to be consistent across all files. Generate libgimp wrappers for *all* functions because of API symmetry. * tools/pdbgen/pdb/gradients.pdb: renamed gradients_[get|set]_active to gradients_[get|set]_gradient because of API symmetry. * libgimp/gimpcompat.h: added the old function names here, guard the whole file with GIMP_ENABLE_COMPAT_CRUFT (it's back, yeah). * plug-ins/FractalExplorer/Dialogs.c * plug-ins/gflare/gflare.c: use the new function names. * libgimp/gimpbrushes_pdb.[ch] * libgimp/gimpgradients_pdb.[ch] * libgimp/gimppalettes_pdb.[ch] * libgimp/gimppatterns_pdb.[ch] * app/pdb/brush_select_cmds.c * app/pdb/brushes_cmds.c * app/pdb/gradient_select_cmds.c * app/pdb/gradients_cmds.c * app/pdb/palette_select_cmds.c * app/pdb/palettes_cmds.c * app/pdb/pattern_select_cmds.c * app/pdb/patterns_cmds.c: regenerated.
2002-03-13 23:29:59 +08:00
* gimp_gradients_set_gradient:
* @name: The name of the gradient to set.
*
* Sets the specified gradient as the active gradient.
*
* This procedure lets you set the specified gradient as the active or
* \"current\" one. The name is simply a string which corresponds to
* one of the loaded gradients in the gradient editor. If no matching
* gradient is found, this procedure will return an error. Otherwise,
* the specified gradient will become active and will be used for
* subsequent custom gradient operations.
*
* Returns: TRUE on success.
*/
gboolean
gimp_gradients_set_gradient (const gchar *name)
1997-11-25 06:05:25 +08:00
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
1997-11-25 06:05:25 +08:00
renamed parameters to be consistent with the other foo-select.* files. 2002-03-13 Michael Natterer <mitch@gimp.org> * app/gui/brush-select.[ch]: renamed parameters to be consistent with the other foo-select.* files. * app/gui/tool-options-dialog.c: removed unused function. * app/plug-in/plug-in-types.h: PlugInImageType was accidentially exported to the PDB. * tools/pdbgen/enums.pl * libgimp/gimpenums.h * plug-ins/script-fu/script-fu-constants.c: regenerated. More brush, pattern, ... PDB wrapper cleanup: * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/palette_select.pdb * tools/pdbgen/pdb/pattern_select.pdb: even more cleanup, guard all functions with if(!gimp->no_interface). * tools/pdbgen/pdb/brushes.pdb * tools/pdbgen/pdb/gradients.pdb * tools/pdbgen/pdb/palettes.pdb * tools/pdbgen/pdb/patterns.pdb: reordered functions to be consistent across all files. Generate libgimp wrappers for *all* functions because of API symmetry. * tools/pdbgen/pdb/gradients.pdb: renamed gradients_[get|set]_active to gradients_[get|set]_gradient because of API symmetry. * libgimp/gimpcompat.h: added the old function names here, guard the whole file with GIMP_ENABLE_COMPAT_CRUFT (it's back, yeah). * plug-ins/FractalExplorer/Dialogs.c * plug-ins/gflare/gflare.c: use the new function names. * libgimp/gimpbrushes_pdb.[ch] * libgimp/gimpgradients_pdb.[ch] * libgimp/gimppalettes_pdb.[ch] * libgimp/gimppatterns_pdb.[ch] * app/pdb/brush_select_cmds.c * app/pdb/brushes_cmds.c * app/pdb/gradient_select_cmds.c * app/pdb/gradients_cmds.c * app/pdb/palette_select_cmds.c * app/pdb/palettes_cmds.c * app/pdb/pattern_select_cmds.c * app/pdb/patterns_cmds.c: regenerated.
2002-03-13 23:29:59 +08:00
return_vals = gimp_run_procedure ("gimp_gradients_set_gradient",
1997-11-25 06:05:25 +08:00
&nreturn_vals,
GIMP_PDB_STRING, name,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
1997-11-25 06:05:25 +08:00
gimp_destroy_params (return_vals, nreturn_vals);
return success;
1997-11-25 06:05:25 +08:00
}
/**
* gimp_gradients_sample_uniform:
* @num_samples: The number of samples to take.
* @reverse: Use the reverse gradient.
*
* Sample the active gradient in uniform parts.
*
* This procedure samples the active gradient from the gradient editor
* in the specified number of uniform parts. It returns a list of
* floating-point values which correspond to the RGBA values for each
* sample. The minimum number of samples to take is 2, in which case
* the returned colors will correspond to the { 0.0, 1.0 } positions in
* the gradient. For example, if the number of samples is 3, the
* procedure will return the colors at positions { 0.0, 0.5, 1.0 }.
*
* Returns: Color samples: { R1, G1, B1, A1, ..., Rn, Gn, Bn, An }.
*/
1997-11-25 06:05:25 +08:00
gdouble *
gimp_gradients_sample_uniform (gint num_samples,
gboolean reverse)
1997-11-25 06:05:25 +08:00
{
GimpParam *return_vals;
gint nreturn_vals;
gdouble *color_samples = NULL;
gint num_color_samples;
1997-11-25 06:05:25 +08:00
return_vals = gimp_run_procedure ("gimp_gradients_sample_uniform",
&nreturn_vals,
GIMP_PDB_INT32, num_samples,
GIMP_PDB_INT32, reverse,
GIMP_PDB_END);
1997-11-25 06:05:25 +08:00
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
1997-11-25 06:05:25 +08:00
{
num_color_samples = return_vals[1].data.d_int32;
color_samples = g_new (gdouble, num_color_samples);
memcpy (color_samples, return_vals[2].data.d_floatarray,
num_color_samples * sizeof (gdouble));
1997-11-25 06:05:25 +08:00
}
gimp_destroy_params (return_vals, nreturn_vals);
return color_samples;
1997-11-25 06:05:25 +08:00
}
/**
* gimp_gradients_sample_custom:
* @num_samples: The number of samples to take.
* @positions: The list of positions to sample along the gradient.
* @reverse: Use the reverse gradient.
*
* Sample the active gradient in custom positions.
*
* This procedure samples the active gradient from the gradient editor
* in the specified number of points. The procedure will sample the
* gradient in the specified positions from the list. The left endpoint
* of the gradient corresponds to position 0.0, and the right endpoint
* corresponds to 1.0. The procedure returns a list of floating-point
* values which correspond to the RGBA values for each sample.
*
* Returns: Color samples: { R1, G1, B1, A1, ..., Rn, Gn, Bn, An }.
*/
1997-11-25 06:05:25 +08:00
gdouble *
gimp_gradients_sample_custom (gint num_samples,
const gdouble *positions,
gboolean reverse)
1997-11-25 06:05:25 +08:00
{
GimpParam *return_vals;
gint nreturn_vals;
gdouble *color_samples = NULL;
gint num_color_samples;
1997-11-25 06:05:25 +08:00
return_vals = gimp_run_procedure ("gimp_gradients_sample_custom",
&nreturn_vals,
GIMP_PDB_INT32, num_samples,
GIMP_PDB_FLOATARRAY, positions,
GIMP_PDB_INT32, reverse,
GIMP_PDB_END);
1997-11-25 06:05:25 +08:00
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
1997-11-25 06:05:25 +08:00
{
num_color_samples = return_vals[1].data.d_int32;
color_samples = g_new (gdouble, num_color_samples);
memcpy (color_samples, return_vals[2].data.d_floatarray,
num_color_samples * sizeof (gdouble));
1997-11-25 06:05:25 +08:00
}
gimp_destroy_params (return_vals, nreturn_vals);
return color_samples;
1997-11-25 06:05:25 +08:00
}
/**
* gimp_gradients_get_gradient_data:
* @name: The gradient name (\"\" means current active gradient).
* @sample_size: Size of the sample to return when the gradient is changed.
* @reverse: Use the reverse gradient.
* @width: The gradient sample width (r,g,b,a).
* @grad_data: The gradient sample data.
*
* Retrieve information about the specified gradient (including data).
*
* This procedure retrieves information about the gradient. This
* includes the gradient name, and the sample data for the gradient.
*
* Returns: The gradient name.
*/
gchar *
gimp_gradients_get_gradient_data (const gchar *name,
gint sample_size,
gboolean reverse,
gint *width,
gdouble **grad_data)
{
GimpParam *return_vals;
gint nreturn_vals;
gchar *ret_name = NULL;
return_vals = gimp_run_procedure ("gimp_gradients_get_gradient_data",
&nreturn_vals,
GIMP_PDB_STRING, name,
GIMP_PDB_INT32, sample_size,
GIMP_PDB_INT32, reverse,
GIMP_PDB_END);
*width = 0;
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
{
ret_name = g_strdup (return_vals[1].data.d_string);
*width = return_vals[2].data.d_int32;
*grad_data = g_new (gdouble, *width);
memcpy (*grad_data, return_vals[3].data.d_floatarray,
*width * sizeof (gdouble));
}
gimp_destroy_params (return_vals, nreturn_vals);
return ret_name;
}
/**
* gimp_gradients_new:
* @name: The requested name of the new gradient.
*
* Creates a new gradient
*
* This procedure creates a new, uninitialized gradient
*
* Returns: The actual new gradient name.
*
* Since: GIMP 2.2
*/
gchar *
gimp_gradients_new (const gchar *name)
{
GimpParam *return_vals;
gint nreturn_vals;
gchar *ret_name = NULL;
return_vals = gimp_run_procedure ("gimp_gradients_new",
&nreturn_vals,
GIMP_PDB_STRING, name,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
ret_name = g_strdup (return_vals[1].data.d_string);
gimp_destroy_params (return_vals, nreturn_vals);
return ret_name;
}
/**
* gimp_gradients_duplicate:
* @name: The name of the gradient to duplicate.
*
* Duplicates a gradient
*
* This procedure creates an identical gradient by a different name
*
* Returns: The name of the gradient's copy.
*
* Since: GIMP 2.2
*/
gchar *
gimp_gradients_duplicate (const gchar *name)
{
GimpParam *return_vals;
gint nreturn_vals;
gchar *ret_name = NULL;
return_vals = gimp_run_procedure ("gimp_gradients_duplicate",
&nreturn_vals,
GIMP_PDB_STRING, name,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
ret_name = g_strdup (return_vals[1].data.d_string);
gimp_destroy_params (return_vals, nreturn_vals);
return ret_name;
}
/**
* gimp_gradients_delete:
* @name: The name of the gradient to delete.
*
* Deletes a gradient
*
* This procedure deletes a gradient
*
* Returns: TRUE on success.
*
* Since: GIMP 2.2
*/
gboolean
gimp_gradients_delete (const gchar *name)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp_gradients_delete",
&nreturn_vals,
GIMP_PDB_STRING, name,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_gradients_rename:
* @name: The name of the gradient to rename.
* @new_name: The new name of the gradient.
*
* Rename a gradient
*
* This procedure renames a gradient
*
* Returns: The actual new name of the gradient.
*
* Since: GIMP 2.2
*/
gchar *
gimp_gradients_rename (const gchar *name,
const gchar *new_name)
{
GimpParam *return_vals;
gint nreturn_vals;
gchar *ret_name = NULL;
return_vals = gimp_run_procedure ("gimp_gradients_rename",
&nreturn_vals,
GIMP_PDB_STRING, name,
GIMP_PDB_STRING, new_name,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
ret_name = g_strdup (return_vals[1].data.d_string);
gimp_destroy_params (return_vals, nreturn_vals);
return ret_name;
}