gimp/pdb/pdb.pl

275 lines
11 KiB
Perl
Raw Normal View History

# GIMP - The GNU Image Manipulation Program
# Copyright (C) 1998-2003 Manish Singh <yosh@gimp.org>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
# This program 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 General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
package Gimp::CodeGen::pdb;
%arg_types = (
int32 => { name => 'INT32',
type => 'gint32 ',
const_type => 'gint32 ',
init_value => '0',
get_value_func => '$var = g_value_get_int ($value)',
set_value_func => 'g_value_set_int ($value, $var)' },
int16 => { name => 'INT16',
type => 'gint16 ',
const_type => 'gint16 ',
init_value => '0',
get_value_func => '$var = g_value_get_int ($value)',
set_value_func => 'g_value_set_int ($value, $var)' },
int8 => { name => 'INT8' ,
type => 'guint8 ',
const_type => 'guint8 ',
init_value => '0',
get_value_func => '$var = g_value_get_uint ($value)',
set_value_func => 'g_value_set_uint ($value, $var)' },
float => { name => 'FLOAT',
type => 'gdouble ',
const_type => 'gdouble ',
init_value => '0.0',
get_value_func => '$var = g_value_get_double ($value)',
set_value_func => 'g_value_set_double ($value, $var)' },
string => { name => 'STRING',
type => 'gchar *',
const_type => 'const gchar *',
init_value => 'NULL',
get_value_func => '$var = g_value_get_string ($value)',
set_value_func => 'g_value_take_string ($value, $var)' },
replace the value union by a GValue. 2006-03-30 Michael Natterer <mitch@gimp.org> * app/pdb/procedural_db.[ch] (struct Argument): replace the value union by a GValue. (procedural_db_argument_init) (procedural_db_compat_arg_init): new functions to initialize an Argument. They call g_value_init() on the Argument's value. (procedural_db_arguments) (procedural_db_return_values): initialize the returned Argument arrays so their GValues are ready to use. Allow to get the (unsuccessful) return values of a NULL ProcRecord. (procedural_db_destroy_args): g_value_unset() the values. Added a "gboolean full_destroy" parameter. Its only effect is to destroy PDB arrays, everything else is nicely memory managed by GValue. (procedural_db_execute) (procedural_db_run_proc): do GValue stuff. Added n_args and n_return_vals parameters to execute(). (procedural_db_execute_proc): private function to execute a procedure. Validates the passed in arguments using the registered GParamSpecs before passing them to the resp. exec method. * app/plug-in/plug-in-params.[ch] (plug_in_params_to_args): needs an array of ProcArgs now in order to initialize the Arguments' GValues correctly. Passing NULL ProcArgs uses procedural_db_compat_arg_init(), so procedures (plug-ins) returning more values than expected work. (plug_in_args_to_params): do GValue stuff here too. (plug_in_args_destroy): removed this function, procedural_db_destroy_args() does the same now. * app/plug-in/plug-in-message.c (plug_in_handle_proc_run): simplified quite a bit because everything returns n_return_values now. Call plug_in_params_to_args() only of the procedure was found. (plug_in_handle_proc_return_priv): pass ProcRecs to plug_in_params_to_args(). * app/batch.c * app/actions/plug-in-commands.c * app/actions/vectors-commands.c * app/core/gimppdbprogress.c * app/dialogs/about-dialog.c * app/file/file-open.c * app/file/file-save.c * app/plug-in/plug-ins.c * app/plug-in/plug-in-progress.c * app/plug-in/plug-in-run.[ch] * app/widgets/gimphelp.c * app/widgets/gimppdbdialog.c * app/xcf/xcf.c * tools/pdbgen/pdb/fileops.pdb: changed accordingly: don't g_new/g_free Argument arrays, always use procedural_db_foo() functions. Use GValue functions to get/set Arguments. * tools/pdbgen/pdb.pl: added get_value_func and set_value_func to all PDB types. Removed id_func, id_ret_func and check_func. Added flags which indicated that a type is an ID. Removed unused utility functions. * tools/pdbgen/lib.pl: use the flag instead of looking at functions and value types. * tools/pdbgen/app.pl: use the get_value_func and set_value_func to marshal inargs and outargs. Removed all checks performed on inargs because that's done by GParamSpec validation now. Added the missing bits to register excluded values with GimpParamSpecEnum. * app/pdb/*_cmds.c: regenerated.
2006-03-30 07:56:07 +08:00
int32array => { name => 'INT32ARRAY',
type => 'gint32 *',
const_type => 'const gint32 *',
replace the value union by a GValue. 2006-03-30 Michael Natterer <mitch@gimp.org> * app/pdb/procedural_db.[ch] (struct Argument): replace the value union by a GValue. (procedural_db_argument_init) (procedural_db_compat_arg_init): new functions to initialize an Argument. They call g_value_init() on the Argument's value. (procedural_db_arguments) (procedural_db_return_values): initialize the returned Argument arrays so their GValues are ready to use. Allow to get the (unsuccessful) return values of a NULL ProcRecord. (procedural_db_destroy_args): g_value_unset() the values. Added a "gboolean full_destroy" parameter. Its only effect is to destroy PDB arrays, everything else is nicely memory managed by GValue. (procedural_db_execute) (procedural_db_run_proc): do GValue stuff. Added n_args and n_return_vals parameters to execute(). (procedural_db_execute_proc): private function to execute a procedure. Validates the passed in arguments using the registered GParamSpecs before passing them to the resp. exec method. * app/plug-in/plug-in-params.[ch] (plug_in_params_to_args): needs an array of ProcArgs now in order to initialize the Arguments' GValues correctly. Passing NULL ProcArgs uses procedural_db_compat_arg_init(), so procedures (plug-ins) returning more values than expected work. (plug_in_args_to_params): do GValue stuff here too. (plug_in_args_destroy): removed this function, procedural_db_destroy_args() does the same now. * app/plug-in/plug-in-message.c (plug_in_handle_proc_run): simplified quite a bit because everything returns n_return_values now. Call plug_in_params_to_args() only of the procedure was found. (plug_in_handle_proc_return_priv): pass ProcRecs to plug_in_params_to_args(). * app/batch.c * app/actions/plug-in-commands.c * app/actions/vectors-commands.c * app/core/gimppdbprogress.c * app/dialogs/about-dialog.c * app/file/file-open.c * app/file/file-save.c * app/plug-in/plug-ins.c * app/plug-in/plug-in-progress.c * app/plug-in/plug-in-run.[ch] * app/widgets/gimphelp.c * app/widgets/gimppdbdialog.c * app/xcf/xcf.c * tools/pdbgen/pdb/fileops.pdb: changed accordingly: don't g_new/g_free Argument arrays, always use procedural_db_foo() functions. Use GValue functions to get/set Arguments. * tools/pdbgen/pdb.pl: added get_value_func and set_value_func to all PDB types. Removed id_func, id_ret_func and check_func. Added flags which indicated that a type is an ID. Removed unused utility functions. * tools/pdbgen/lib.pl: use the flag instead of looking at functions and value types. * tools/pdbgen/app.pl: use the get_value_func and set_value_func to marshal inargs and outargs. Removed all checks performed on inargs because that's done by GParamSpec validation now. Added the missing bits to register excluded values with GimpParamSpecEnum. * app/pdb/*_cmds.c: regenerated.
2006-03-30 07:56:07 +08:00
array => 1,
init_value => 'NULL',
get_value_func => '$var = gimp_value_get_int32array ($value)',
added struct GimpArray which can keep static or allocated data. Added 2006-04-01 Michael Natterer <mitch@gimp.org> * app/core/gimpparamspecs.[ch]: added struct GimpArray which can keep static or allocated data. Added boxed types GIMP_TYPE_ARRAY and GIMP_TYPE_STRING_ARRAY. Added GParamSpecs for PDB int32, int16, int8, float and string arrays. Added functions to get, dup, set and set_static the various arrays from/to GValues. * app/pdb/gimpprocedure.c * app/pdb/procedural_db.c * app/plug-in/plug-in-params.c * tools/pdbgen/app.pl * tools/pdbgen/pdb.pl: use the new param pspecs and gimp_value functions to keep arrays in GimpArguments. * app/pdb/gimpargument.[ch] (gimp_arguments_destroy): removed parameter "gboolean full_destroy". It's not needed any longer because the GValues fully memory-manage all their data now. * app/batch.c * app/actions/plug-in-commands.c * app/actions/vectors-commands.c * app/core/gimppdbprogress.c * app/dialogs/about-dialog.c * app/dialogs/print-size-dialog.c * app/dialogs/resize-dialog.c * app/display/gimpdisplayshell-handlers.c * app/file/file-open.c * app/file/file-save.c * app/plug-in/plug-in-message.c * app/plug-in/plug-in-run.c * app/plug-in/plug-ins.c * app/widgets/gimphelp.c * app/widgets/gimppdbdialog.c * tools/pdbgen/pdb/fileops.pdb: changed accordingly. * app/pdb/brush_cmds.c * app/pdb/brushes_cmds.c * app/pdb/buffer_cmds.c * app/pdb/color_cmds.c * app/pdb/drawable_cmds.c * app/pdb/fileops_cmds.c * app/pdb/fonts_cmds.c * app/pdb/gimpargument.c * app/pdb/gimpargument.h * app/pdb/gimpprocedure.c * app/pdb/gradient_cmds.c * app/pdb/gradients_cmds.c * app/pdb/image_cmds.c * app/pdb/paint_tools_cmds.c * app/pdb/palettes_cmds.c * app/pdb/parasite_cmds.c * app/pdb/paths_cmds.c * app/pdb/pattern_cmds.c * app/pdb/patterns_cmds.c * app/pdb/plug_in_cmds.c * app/pdb/procedural_db.c * app/pdb/procedural_db_cmds.c * app/pdb/selection_tools_cmds.c * app/pdb/vectors_cmds.c: regenerated. ... and ported everything to perl btw...
2006-04-01 09:33:28 +08:00
set_value_func => 'gimp_value_take_int32array ($value, $var, $var_len)' },
replace the value union by a GValue. 2006-03-30 Michael Natterer <mitch@gimp.org> * app/pdb/procedural_db.[ch] (struct Argument): replace the value union by a GValue. (procedural_db_argument_init) (procedural_db_compat_arg_init): new functions to initialize an Argument. They call g_value_init() on the Argument's value. (procedural_db_arguments) (procedural_db_return_values): initialize the returned Argument arrays so their GValues are ready to use. Allow to get the (unsuccessful) return values of a NULL ProcRecord. (procedural_db_destroy_args): g_value_unset() the values. Added a "gboolean full_destroy" parameter. Its only effect is to destroy PDB arrays, everything else is nicely memory managed by GValue. (procedural_db_execute) (procedural_db_run_proc): do GValue stuff. Added n_args and n_return_vals parameters to execute(). (procedural_db_execute_proc): private function to execute a procedure. Validates the passed in arguments using the registered GParamSpecs before passing them to the resp. exec method. * app/plug-in/plug-in-params.[ch] (plug_in_params_to_args): needs an array of ProcArgs now in order to initialize the Arguments' GValues correctly. Passing NULL ProcArgs uses procedural_db_compat_arg_init(), so procedures (plug-ins) returning more values than expected work. (plug_in_args_to_params): do GValue stuff here too. (plug_in_args_destroy): removed this function, procedural_db_destroy_args() does the same now. * app/plug-in/plug-in-message.c (plug_in_handle_proc_run): simplified quite a bit because everything returns n_return_values now. Call plug_in_params_to_args() only of the procedure was found. (plug_in_handle_proc_return_priv): pass ProcRecs to plug_in_params_to_args(). * app/batch.c * app/actions/plug-in-commands.c * app/actions/vectors-commands.c * app/core/gimppdbprogress.c * app/dialogs/about-dialog.c * app/file/file-open.c * app/file/file-save.c * app/plug-in/plug-ins.c * app/plug-in/plug-in-progress.c * app/plug-in/plug-in-run.[ch] * app/widgets/gimphelp.c * app/widgets/gimppdbdialog.c * app/xcf/xcf.c * tools/pdbgen/pdb/fileops.pdb: changed accordingly: don't g_new/g_free Argument arrays, always use procedural_db_foo() functions. Use GValue functions to get/set Arguments. * tools/pdbgen/pdb.pl: added get_value_func and set_value_func to all PDB types. Removed id_func, id_ret_func and check_func. Added flags which indicated that a type is an ID. Removed unused utility functions. * tools/pdbgen/lib.pl: use the flag instead of looking at functions and value types. * tools/pdbgen/app.pl: use the get_value_func and set_value_func to marshal inargs and outargs. Removed all checks performed on inargs because that's done by GParamSpec validation now. Added the missing bits to register excluded values with GimpParamSpecEnum. * app/pdb/*_cmds.c: regenerated.
2006-03-30 07:56:07 +08:00
int16array => { name => 'INT16ARRAY',
type => 'gint16 *',
const_type => 'const gint16 *',
replace the value union by a GValue. 2006-03-30 Michael Natterer <mitch@gimp.org> * app/pdb/procedural_db.[ch] (struct Argument): replace the value union by a GValue. (procedural_db_argument_init) (procedural_db_compat_arg_init): new functions to initialize an Argument. They call g_value_init() on the Argument's value. (procedural_db_arguments) (procedural_db_return_values): initialize the returned Argument arrays so their GValues are ready to use. Allow to get the (unsuccessful) return values of a NULL ProcRecord. (procedural_db_destroy_args): g_value_unset() the values. Added a "gboolean full_destroy" parameter. Its only effect is to destroy PDB arrays, everything else is nicely memory managed by GValue. (procedural_db_execute) (procedural_db_run_proc): do GValue stuff. Added n_args and n_return_vals parameters to execute(). (procedural_db_execute_proc): private function to execute a procedure. Validates the passed in arguments using the registered GParamSpecs before passing them to the resp. exec method. * app/plug-in/plug-in-params.[ch] (plug_in_params_to_args): needs an array of ProcArgs now in order to initialize the Arguments' GValues correctly. Passing NULL ProcArgs uses procedural_db_compat_arg_init(), so procedures (plug-ins) returning more values than expected work. (plug_in_args_to_params): do GValue stuff here too. (plug_in_args_destroy): removed this function, procedural_db_destroy_args() does the same now. * app/plug-in/plug-in-message.c (plug_in_handle_proc_run): simplified quite a bit because everything returns n_return_values now. Call plug_in_params_to_args() only of the procedure was found. (plug_in_handle_proc_return_priv): pass ProcRecs to plug_in_params_to_args(). * app/batch.c * app/actions/plug-in-commands.c * app/actions/vectors-commands.c * app/core/gimppdbprogress.c * app/dialogs/about-dialog.c * app/file/file-open.c * app/file/file-save.c * app/plug-in/plug-ins.c * app/plug-in/plug-in-progress.c * app/plug-in/plug-in-run.[ch] * app/widgets/gimphelp.c * app/widgets/gimppdbdialog.c * app/xcf/xcf.c * tools/pdbgen/pdb/fileops.pdb: changed accordingly: don't g_new/g_free Argument arrays, always use procedural_db_foo() functions. Use GValue functions to get/set Arguments. * tools/pdbgen/pdb.pl: added get_value_func and set_value_func to all PDB types. Removed id_func, id_ret_func and check_func. Added flags which indicated that a type is an ID. Removed unused utility functions. * tools/pdbgen/lib.pl: use the flag instead of looking at functions and value types. * tools/pdbgen/app.pl: use the get_value_func and set_value_func to marshal inargs and outargs. Removed all checks performed on inargs because that's done by GParamSpec validation now. Added the missing bits to register excluded values with GimpParamSpecEnum. * app/pdb/*_cmds.c: regenerated.
2006-03-30 07:56:07 +08:00
array => 1,
init_value => 'NULL',
get_value_func => '$var = gimp_value_get_int16array ($value)',
added struct GimpArray which can keep static or allocated data. Added 2006-04-01 Michael Natterer <mitch@gimp.org> * app/core/gimpparamspecs.[ch]: added struct GimpArray which can keep static or allocated data. Added boxed types GIMP_TYPE_ARRAY and GIMP_TYPE_STRING_ARRAY. Added GParamSpecs for PDB int32, int16, int8, float and string arrays. Added functions to get, dup, set and set_static the various arrays from/to GValues. * app/pdb/gimpprocedure.c * app/pdb/procedural_db.c * app/plug-in/plug-in-params.c * tools/pdbgen/app.pl * tools/pdbgen/pdb.pl: use the new param pspecs and gimp_value functions to keep arrays in GimpArguments. * app/pdb/gimpargument.[ch] (gimp_arguments_destroy): removed parameter "gboolean full_destroy". It's not needed any longer because the GValues fully memory-manage all their data now. * app/batch.c * app/actions/plug-in-commands.c * app/actions/vectors-commands.c * app/core/gimppdbprogress.c * app/dialogs/about-dialog.c * app/dialogs/print-size-dialog.c * app/dialogs/resize-dialog.c * app/display/gimpdisplayshell-handlers.c * app/file/file-open.c * app/file/file-save.c * app/plug-in/plug-in-message.c * app/plug-in/plug-in-run.c * app/plug-in/plug-ins.c * app/widgets/gimphelp.c * app/widgets/gimppdbdialog.c * tools/pdbgen/pdb/fileops.pdb: changed accordingly. * app/pdb/brush_cmds.c * app/pdb/brushes_cmds.c * app/pdb/buffer_cmds.c * app/pdb/color_cmds.c * app/pdb/drawable_cmds.c * app/pdb/fileops_cmds.c * app/pdb/fonts_cmds.c * app/pdb/gimpargument.c * app/pdb/gimpargument.h * app/pdb/gimpprocedure.c * app/pdb/gradient_cmds.c * app/pdb/gradients_cmds.c * app/pdb/image_cmds.c * app/pdb/paint_tools_cmds.c * app/pdb/palettes_cmds.c * app/pdb/parasite_cmds.c * app/pdb/paths_cmds.c * app/pdb/pattern_cmds.c * app/pdb/patterns_cmds.c * app/pdb/plug_in_cmds.c * app/pdb/procedural_db.c * app/pdb/procedural_db_cmds.c * app/pdb/selection_tools_cmds.c * app/pdb/vectors_cmds.c: regenerated. ... and ported everything to perl btw...
2006-04-01 09:33:28 +08:00
set_value_func => 'gimp_value_take_int16array ($value, $var, $var_len)' },
replace the value union by a GValue. 2006-03-30 Michael Natterer <mitch@gimp.org> * app/pdb/procedural_db.[ch] (struct Argument): replace the value union by a GValue. (procedural_db_argument_init) (procedural_db_compat_arg_init): new functions to initialize an Argument. They call g_value_init() on the Argument's value. (procedural_db_arguments) (procedural_db_return_values): initialize the returned Argument arrays so their GValues are ready to use. Allow to get the (unsuccessful) return values of a NULL ProcRecord. (procedural_db_destroy_args): g_value_unset() the values. Added a "gboolean full_destroy" parameter. Its only effect is to destroy PDB arrays, everything else is nicely memory managed by GValue. (procedural_db_execute) (procedural_db_run_proc): do GValue stuff. Added n_args and n_return_vals parameters to execute(). (procedural_db_execute_proc): private function to execute a procedure. Validates the passed in arguments using the registered GParamSpecs before passing them to the resp. exec method. * app/plug-in/plug-in-params.[ch] (plug_in_params_to_args): needs an array of ProcArgs now in order to initialize the Arguments' GValues correctly. Passing NULL ProcArgs uses procedural_db_compat_arg_init(), so procedures (plug-ins) returning more values than expected work. (plug_in_args_to_params): do GValue stuff here too. (plug_in_args_destroy): removed this function, procedural_db_destroy_args() does the same now. * app/plug-in/plug-in-message.c (plug_in_handle_proc_run): simplified quite a bit because everything returns n_return_values now. Call plug_in_params_to_args() only of the procedure was found. (plug_in_handle_proc_return_priv): pass ProcRecs to plug_in_params_to_args(). * app/batch.c * app/actions/plug-in-commands.c * app/actions/vectors-commands.c * app/core/gimppdbprogress.c * app/dialogs/about-dialog.c * app/file/file-open.c * app/file/file-save.c * app/plug-in/plug-ins.c * app/plug-in/plug-in-progress.c * app/plug-in/plug-in-run.[ch] * app/widgets/gimphelp.c * app/widgets/gimppdbdialog.c * app/xcf/xcf.c * tools/pdbgen/pdb/fileops.pdb: changed accordingly: don't g_new/g_free Argument arrays, always use procedural_db_foo() functions. Use GValue functions to get/set Arguments. * tools/pdbgen/pdb.pl: added get_value_func and set_value_func to all PDB types. Removed id_func, id_ret_func and check_func. Added flags which indicated that a type is an ID. Removed unused utility functions. * tools/pdbgen/lib.pl: use the flag instead of looking at functions and value types. * tools/pdbgen/app.pl: use the get_value_func and set_value_func to marshal inargs and outargs. Removed all checks performed on inargs because that's done by GParamSpec validation now. Added the missing bits to register excluded values with GimpParamSpecEnum. * app/pdb/*_cmds.c: regenerated.
2006-03-30 07:56:07 +08:00
int8array => { name => 'INT8ARRAY',
type => 'guint8 *',
const_type => 'const guint8 *',
replace the value union by a GValue. 2006-03-30 Michael Natterer <mitch@gimp.org> * app/pdb/procedural_db.[ch] (struct Argument): replace the value union by a GValue. (procedural_db_argument_init) (procedural_db_compat_arg_init): new functions to initialize an Argument. They call g_value_init() on the Argument's value. (procedural_db_arguments) (procedural_db_return_values): initialize the returned Argument arrays so their GValues are ready to use. Allow to get the (unsuccessful) return values of a NULL ProcRecord. (procedural_db_destroy_args): g_value_unset() the values. Added a "gboolean full_destroy" parameter. Its only effect is to destroy PDB arrays, everything else is nicely memory managed by GValue. (procedural_db_execute) (procedural_db_run_proc): do GValue stuff. Added n_args and n_return_vals parameters to execute(). (procedural_db_execute_proc): private function to execute a procedure. Validates the passed in arguments using the registered GParamSpecs before passing them to the resp. exec method. * app/plug-in/plug-in-params.[ch] (plug_in_params_to_args): needs an array of ProcArgs now in order to initialize the Arguments' GValues correctly. Passing NULL ProcArgs uses procedural_db_compat_arg_init(), so procedures (plug-ins) returning more values than expected work. (plug_in_args_to_params): do GValue stuff here too. (plug_in_args_destroy): removed this function, procedural_db_destroy_args() does the same now. * app/plug-in/plug-in-message.c (plug_in_handle_proc_run): simplified quite a bit because everything returns n_return_values now. Call plug_in_params_to_args() only of the procedure was found. (plug_in_handle_proc_return_priv): pass ProcRecs to plug_in_params_to_args(). * app/batch.c * app/actions/plug-in-commands.c * app/actions/vectors-commands.c * app/core/gimppdbprogress.c * app/dialogs/about-dialog.c * app/file/file-open.c * app/file/file-save.c * app/plug-in/plug-ins.c * app/plug-in/plug-in-progress.c * app/plug-in/plug-in-run.[ch] * app/widgets/gimphelp.c * app/widgets/gimppdbdialog.c * app/xcf/xcf.c * tools/pdbgen/pdb/fileops.pdb: changed accordingly: don't g_new/g_free Argument arrays, always use procedural_db_foo() functions. Use GValue functions to get/set Arguments. * tools/pdbgen/pdb.pl: added get_value_func and set_value_func to all PDB types. Removed id_func, id_ret_func and check_func. Added flags which indicated that a type is an ID. Removed unused utility functions. * tools/pdbgen/lib.pl: use the flag instead of looking at functions and value types. * tools/pdbgen/app.pl: use the get_value_func and set_value_func to marshal inargs and outargs. Removed all checks performed on inargs because that's done by GParamSpec validation now. Added the missing bits to register excluded values with GimpParamSpecEnum. * app/pdb/*_cmds.c: regenerated.
2006-03-30 07:56:07 +08:00
array => 1,
init_value => 'NULL',
added a shitload of new GTypes and corresponding GParamSpecs to use them 2006-04-03 Michael Natterer <mitch@gimp.org> * app/core/gimpparamspecs.[ch]: added a shitload of new GTypes and corresponding GParamSpecs to use them as PDB arguments. Each GimpPDBArgType has one or more corresponding GTypes in the core now. * app/pdb/gimpargument.[ch] (struct GimpArgument) (struct GimpArgumentSpec): removed "value" member because the GValue's/GParamSpec's GType carries just as much information now. (gimp_argument_type_to_pdb_arg_type): new function which maps GTypes to GimpPDBArgType. (gimp_pdb_arg_type_to_string): formerly known as procedural_db_type_name(). * app/pdb/gimpprocedure.[ch] * app/pdb/procedural_db.[ch]: completely switch to GValue. Use the new GParamSpecs for procedure arguments. GimpPDBArgType is only used for adding compat args/values of plug-in procedures. (procedural_db_run_proc): the va_list expects a sequence of (GType, value, GType, value, ..., G_TYPE_NONE) now. * app/plug-in/plug-in-params.[ch]: changed accordingly. (plug_in_param_defs_check): removed this function. * app/plug-in/plug-in-message.c (plug_in_handle_proc_install): use plug_in_proc_args_check() instead and initialize the GimpProcedure before doing so. * tools/pdbgen/app.pl * tools/pdbgen/pdb.pl: use the new param spec types and their utility functions. Changed argument/value registration accordingly. * app/pdb/procedural-db-query.c * app/actions/plug-in-commands.c * app/actions/vectors-commands.c * app/core/gimppdbprogress.c * app/dialogs/about-dialog.c * app/file/file-open.c * app/file/file-save.c * app/plug-in/plug-in-progress.c * app/plug-in/plug-in-rc.c * app/plug-in/plug-ins.c * app/widgets/gimpbrushselect.c * app/widgets/gimpfontselect.c * app/widgets/gimpgradientselect.c * app/widgets/gimphelp.c * app/widgets/gimppaletteselect.c * app/widgets/gimppatternselect.c * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/procedural_db.pdb: changed accordingly. * app/pdb/*_cmds.c: regenerated.
2006-04-04 04:54:55 +08:00
get_value_func => '$var = gimp_value_get_int8array ($value)',
added struct GimpArray which can keep static or allocated data. Added 2006-04-01 Michael Natterer <mitch@gimp.org> * app/core/gimpparamspecs.[ch]: added struct GimpArray which can keep static or allocated data. Added boxed types GIMP_TYPE_ARRAY and GIMP_TYPE_STRING_ARRAY. Added GParamSpecs for PDB int32, int16, int8, float and string arrays. Added functions to get, dup, set and set_static the various arrays from/to GValues. * app/pdb/gimpprocedure.c * app/pdb/procedural_db.c * app/plug-in/plug-in-params.c * tools/pdbgen/app.pl * tools/pdbgen/pdb.pl: use the new param pspecs and gimp_value functions to keep arrays in GimpArguments. * app/pdb/gimpargument.[ch] (gimp_arguments_destroy): removed parameter "gboolean full_destroy". It's not needed any longer because the GValues fully memory-manage all their data now. * app/batch.c * app/actions/plug-in-commands.c * app/actions/vectors-commands.c * app/core/gimppdbprogress.c * app/dialogs/about-dialog.c * app/dialogs/print-size-dialog.c * app/dialogs/resize-dialog.c * app/display/gimpdisplayshell-handlers.c * app/file/file-open.c * app/file/file-save.c * app/plug-in/plug-in-message.c * app/plug-in/plug-in-run.c * app/plug-in/plug-ins.c * app/widgets/gimphelp.c * app/widgets/gimppdbdialog.c * tools/pdbgen/pdb/fileops.pdb: changed accordingly. * app/pdb/brush_cmds.c * app/pdb/brushes_cmds.c * app/pdb/buffer_cmds.c * app/pdb/color_cmds.c * app/pdb/drawable_cmds.c * app/pdb/fileops_cmds.c * app/pdb/fonts_cmds.c * app/pdb/gimpargument.c * app/pdb/gimpargument.h * app/pdb/gimpprocedure.c * app/pdb/gradient_cmds.c * app/pdb/gradients_cmds.c * app/pdb/image_cmds.c * app/pdb/paint_tools_cmds.c * app/pdb/palettes_cmds.c * app/pdb/parasite_cmds.c * app/pdb/paths_cmds.c * app/pdb/pattern_cmds.c * app/pdb/patterns_cmds.c * app/pdb/plug_in_cmds.c * app/pdb/procedural_db.c * app/pdb/procedural_db_cmds.c * app/pdb/selection_tools_cmds.c * app/pdb/vectors_cmds.c: regenerated. ... and ported everything to perl btw...
2006-04-01 09:33:28 +08:00
set_value_func => 'gimp_value_take_int8array ($value, $var, $var_len)' },
replace the value union by a GValue. 2006-03-30 Michael Natterer <mitch@gimp.org> * app/pdb/procedural_db.[ch] (struct Argument): replace the value union by a GValue. (procedural_db_argument_init) (procedural_db_compat_arg_init): new functions to initialize an Argument. They call g_value_init() on the Argument's value. (procedural_db_arguments) (procedural_db_return_values): initialize the returned Argument arrays so their GValues are ready to use. Allow to get the (unsuccessful) return values of a NULL ProcRecord. (procedural_db_destroy_args): g_value_unset() the values. Added a "gboolean full_destroy" parameter. Its only effect is to destroy PDB arrays, everything else is nicely memory managed by GValue. (procedural_db_execute) (procedural_db_run_proc): do GValue stuff. Added n_args and n_return_vals parameters to execute(). (procedural_db_execute_proc): private function to execute a procedure. Validates the passed in arguments using the registered GParamSpecs before passing them to the resp. exec method. * app/plug-in/plug-in-params.[ch] (plug_in_params_to_args): needs an array of ProcArgs now in order to initialize the Arguments' GValues correctly. Passing NULL ProcArgs uses procedural_db_compat_arg_init(), so procedures (plug-ins) returning more values than expected work. (plug_in_args_to_params): do GValue stuff here too. (plug_in_args_destroy): removed this function, procedural_db_destroy_args() does the same now. * app/plug-in/plug-in-message.c (plug_in_handle_proc_run): simplified quite a bit because everything returns n_return_values now. Call plug_in_params_to_args() only of the procedure was found. (plug_in_handle_proc_return_priv): pass ProcRecs to plug_in_params_to_args(). * app/batch.c * app/actions/plug-in-commands.c * app/actions/vectors-commands.c * app/core/gimppdbprogress.c * app/dialogs/about-dialog.c * app/file/file-open.c * app/file/file-save.c * app/plug-in/plug-ins.c * app/plug-in/plug-in-progress.c * app/plug-in/plug-in-run.[ch] * app/widgets/gimphelp.c * app/widgets/gimppdbdialog.c * app/xcf/xcf.c * tools/pdbgen/pdb/fileops.pdb: changed accordingly: don't g_new/g_free Argument arrays, always use procedural_db_foo() functions. Use GValue functions to get/set Arguments. * tools/pdbgen/pdb.pl: added get_value_func and set_value_func to all PDB types. Removed id_func, id_ret_func and check_func. Added flags which indicated that a type is an ID. Removed unused utility functions. * tools/pdbgen/lib.pl: use the flag instead of looking at functions and value types. * tools/pdbgen/app.pl: use the get_value_func and set_value_func to marshal inargs and outargs. Removed all checks performed on inargs because that's done by GParamSpec validation now. Added the missing bits to register excluded values with GimpParamSpecEnum. * app/pdb/*_cmds.c: regenerated.
2006-03-30 07:56:07 +08:00
floatarray => { name => 'FLOATARRAY',
type => 'gdouble *',
const_type => 'const gdouble *',
replace the value union by a GValue. 2006-03-30 Michael Natterer <mitch@gimp.org> * app/pdb/procedural_db.[ch] (struct Argument): replace the value union by a GValue. (procedural_db_argument_init) (procedural_db_compat_arg_init): new functions to initialize an Argument. They call g_value_init() on the Argument's value. (procedural_db_arguments) (procedural_db_return_values): initialize the returned Argument arrays so their GValues are ready to use. Allow to get the (unsuccessful) return values of a NULL ProcRecord. (procedural_db_destroy_args): g_value_unset() the values. Added a "gboolean full_destroy" parameter. Its only effect is to destroy PDB arrays, everything else is nicely memory managed by GValue. (procedural_db_execute) (procedural_db_run_proc): do GValue stuff. Added n_args and n_return_vals parameters to execute(). (procedural_db_execute_proc): private function to execute a procedure. Validates the passed in arguments using the registered GParamSpecs before passing them to the resp. exec method. * app/plug-in/plug-in-params.[ch] (plug_in_params_to_args): needs an array of ProcArgs now in order to initialize the Arguments' GValues correctly. Passing NULL ProcArgs uses procedural_db_compat_arg_init(), so procedures (plug-ins) returning more values than expected work. (plug_in_args_to_params): do GValue stuff here too. (plug_in_args_destroy): removed this function, procedural_db_destroy_args() does the same now. * app/plug-in/plug-in-message.c (plug_in_handle_proc_run): simplified quite a bit because everything returns n_return_values now. Call plug_in_params_to_args() only of the procedure was found. (plug_in_handle_proc_return_priv): pass ProcRecs to plug_in_params_to_args(). * app/batch.c * app/actions/plug-in-commands.c * app/actions/vectors-commands.c * app/core/gimppdbprogress.c * app/dialogs/about-dialog.c * app/file/file-open.c * app/file/file-save.c * app/plug-in/plug-ins.c * app/plug-in/plug-in-progress.c * app/plug-in/plug-in-run.[ch] * app/widgets/gimphelp.c * app/widgets/gimppdbdialog.c * app/xcf/xcf.c * tools/pdbgen/pdb/fileops.pdb: changed accordingly: don't g_new/g_free Argument arrays, always use procedural_db_foo() functions. Use GValue functions to get/set Arguments. * tools/pdbgen/pdb.pl: added get_value_func and set_value_func to all PDB types. Removed id_func, id_ret_func and check_func. Added flags which indicated that a type is an ID. Removed unused utility functions. * tools/pdbgen/lib.pl: use the flag instead of looking at functions and value types. * tools/pdbgen/app.pl: use the get_value_func and set_value_func to marshal inargs and outargs. Removed all checks performed on inargs because that's done by GParamSpec validation now. Added the missing bits to register excluded values with GimpParamSpecEnum. * app/pdb/*_cmds.c: regenerated.
2006-03-30 07:56:07 +08:00
array => 1,
init_value => 'NULL',
get_value_func => '$var = gimp_value_get_floatarray ($value)',
added struct GimpArray which can keep static or allocated data. Added 2006-04-01 Michael Natterer <mitch@gimp.org> * app/core/gimpparamspecs.[ch]: added struct GimpArray which can keep static or allocated data. Added boxed types GIMP_TYPE_ARRAY and GIMP_TYPE_STRING_ARRAY. Added GParamSpecs for PDB int32, int16, int8, float and string arrays. Added functions to get, dup, set and set_static the various arrays from/to GValues. * app/pdb/gimpprocedure.c * app/pdb/procedural_db.c * app/plug-in/plug-in-params.c * tools/pdbgen/app.pl * tools/pdbgen/pdb.pl: use the new param pspecs and gimp_value functions to keep arrays in GimpArguments. * app/pdb/gimpargument.[ch] (gimp_arguments_destroy): removed parameter "gboolean full_destroy". It's not needed any longer because the GValues fully memory-manage all their data now. * app/batch.c * app/actions/plug-in-commands.c * app/actions/vectors-commands.c * app/core/gimppdbprogress.c * app/dialogs/about-dialog.c * app/dialogs/print-size-dialog.c * app/dialogs/resize-dialog.c * app/display/gimpdisplayshell-handlers.c * app/file/file-open.c * app/file/file-save.c * app/plug-in/plug-in-message.c * app/plug-in/plug-in-run.c * app/plug-in/plug-ins.c * app/widgets/gimphelp.c * app/widgets/gimppdbdialog.c * tools/pdbgen/pdb/fileops.pdb: changed accordingly. * app/pdb/brush_cmds.c * app/pdb/brushes_cmds.c * app/pdb/buffer_cmds.c * app/pdb/color_cmds.c * app/pdb/drawable_cmds.c * app/pdb/fileops_cmds.c * app/pdb/fonts_cmds.c * app/pdb/gimpargument.c * app/pdb/gimpargument.h * app/pdb/gimpprocedure.c * app/pdb/gradient_cmds.c * app/pdb/gradients_cmds.c * app/pdb/image_cmds.c * app/pdb/paint_tools_cmds.c * app/pdb/palettes_cmds.c * app/pdb/parasite_cmds.c * app/pdb/paths_cmds.c * app/pdb/pattern_cmds.c * app/pdb/patterns_cmds.c * app/pdb/plug_in_cmds.c * app/pdb/procedural_db.c * app/pdb/procedural_db_cmds.c * app/pdb/selection_tools_cmds.c * app/pdb/vectors_cmds.c: regenerated. ... and ported everything to perl btw...
2006-04-01 09:33:28 +08:00
set_value_func => 'gimp_value_take_floatarray ($value, $var, $var_len)' },
replace the value union by a GValue. 2006-03-30 Michael Natterer <mitch@gimp.org> * app/pdb/procedural_db.[ch] (struct Argument): replace the value union by a GValue. (procedural_db_argument_init) (procedural_db_compat_arg_init): new functions to initialize an Argument. They call g_value_init() on the Argument's value. (procedural_db_arguments) (procedural_db_return_values): initialize the returned Argument arrays so their GValues are ready to use. Allow to get the (unsuccessful) return values of a NULL ProcRecord. (procedural_db_destroy_args): g_value_unset() the values. Added a "gboolean full_destroy" parameter. Its only effect is to destroy PDB arrays, everything else is nicely memory managed by GValue. (procedural_db_execute) (procedural_db_run_proc): do GValue stuff. Added n_args and n_return_vals parameters to execute(). (procedural_db_execute_proc): private function to execute a procedure. Validates the passed in arguments using the registered GParamSpecs before passing them to the resp. exec method. * app/plug-in/plug-in-params.[ch] (plug_in_params_to_args): needs an array of ProcArgs now in order to initialize the Arguments' GValues correctly. Passing NULL ProcArgs uses procedural_db_compat_arg_init(), so procedures (plug-ins) returning more values than expected work. (plug_in_args_to_params): do GValue stuff here too. (plug_in_args_destroy): removed this function, procedural_db_destroy_args() does the same now. * app/plug-in/plug-in-message.c (plug_in_handle_proc_run): simplified quite a bit because everything returns n_return_values now. Call plug_in_params_to_args() only of the procedure was found. (plug_in_handle_proc_return_priv): pass ProcRecs to plug_in_params_to_args(). * app/batch.c * app/actions/plug-in-commands.c * app/actions/vectors-commands.c * app/core/gimppdbprogress.c * app/dialogs/about-dialog.c * app/file/file-open.c * app/file/file-save.c * app/plug-in/plug-ins.c * app/plug-in/plug-in-progress.c * app/plug-in/plug-in-run.[ch] * app/widgets/gimphelp.c * app/widgets/gimppdbdialog.c * app/xcf/xcf.c * tools/pdbgen/pdb/fileops.pdb: changed accordingly: don't g_new/g_free Argument arrays, always use procedural_db_foo() functions. Use GValue functions to get/set Arguments. * tools/pdbgen/pdb.pl: added get_value_func and set_value_func to all PDB types. Removed id_func, id_ret_func and check_func. Added flags which indicated that a type is an ID. Removed unused utility functions. * tools/pdbgen/lib.pl: use the flag instead of looking at functions and value types. * tools/pdbgen/app.pl: use the get_value_func and set_value_func to marshal inargs and outargs. Removed all checks performed on inargs because that's done by GParamSpec validation now. Added the missing bits to register excluded values with GimpParamSpecEnum. * app/pdb/*_cmds.c: regenerated.
2006-03-30 07:56:07 +08:00
stringarray => { name => 'STRINGARRAY',
type => 'gchar **',
const_type => 'const gchar **',
replace the value union by a GValue. 2006-03-30 Michael Natterer <mitch@gimp.org> * app/pdb/procedural_db.[ch] (struct Argument): replace the value union by a GValue. (procedural_db_argument_init) (procedural_db_compat_arg_init): new functions to initialize an Argument. They call g_value_init() on the Argument's value. (procedural_db_arguments) (procedural_db_return_values): initialize the returned Argument arrays so their GValues are ready to use. Allow to get the (unsuccessful) return values of a NULL ProcRecord. (procedural_db_destroy_args): g_value_unset() the values. Added a "gboolean full_destroy" parameter. Its only effect is to destroy PDB arrays, everything else is nicely memory managed by GValue. (procedural_db_execute) (procedural_db_run_proc): do GValue stuff. Added n_args and n_return_vals parameters to execute(). (procedural_db_execute_proc): private function to execute a procedure. Validates the passed in arguments using the registered GParamSpecs before passing them to the resp. exec method. * app/plug-in/plug-in-params.[ch] (plug_in_params_to_args): needs an array of ProcArgs now in order to initialize the Arguments' GValues correctly. Passing NULL ProcArgs uses procedural_db_compat_arg_init(), so procedures (plug-ins) returning more values than expected work. (plug_in_args_to_params): do GValue stuff here too. (plug_in_args_destroy): removed this function, procedural_db_destroy_args() does the same now. * app/plug-in/plug-in-message.c (plug_in_handle_proc_run): simplified quite a bit because everything returns n_return_values now. Call plug_in_params_to_args() only of the procedure was found. (plug_in_handle_proc_return_priv): pass ProcRecs to plug_in_params_to_args(). * app/batch.c * app/actions/plug-in-commands.c * app/actions/vectors-commands.c * app/core/gimppdbprogress.c * app/dialogs/about-dialog.c * app/file/file-open.c * app/file/file-save.c * app/plug-in/plug-ins.c * app/plug-in/plug-in-progress.c * app/plug-in/plug-in-run.[ch] * app/widgets/gimphelp.c * app/widgets/gimppdbdialog.c * app/xcf/xcf.c * tools/pdbgen/pdb/fileops.pdb: changed accordingly: don't g_new/g_free Argument arrays, always use procedural_db_foo() functions. Use GValue functions to get/set Arguments. * tools/pdbgen/pdb.pl: added get_value_func and set_value_func to all PDB types. Removed id_func, id_ret_func and check_func. Added flags which indicated that a type is an ID. Removed unused utility functions. * tools/pdbgen/lib.pl: use the flag instead of looking at functions and value types. * tools/pdbgen/app.pl: use the get_value_func and set_value_func to marshal inargs and outargs. Removed all checks performed on inargs because that's done by GParamSpec validation now. Added the missing bits to register excluded values with GimpParamSpecEnum. * app/pdb/*_cmds.c: regenerated.
2006-03-30 07:56:07 +08:00
array => 1,
init_value => 'NULL',
get_value_func => '$var = gimp_value_get_stringarray ($value)',
added struct GimpArray which can keep static or allocated data. Added 2006-04-01 Michael Natterer <mitch@gimp.org> * app/core/gimpparamspecs.[ch]: added struct GimpArray which can keep static or allocated data. Added boxed types GIMP_TYPE_ARRAY and GIMP_TYPE_STRING_ARRAY. Added GParamSpecs for PDB int32, int16, int8, float and string arrays. Added functions to get, dup, set and set_static the various arrays from/to GValues. * app/pdb/gimpprocedure.c * app/pdb/procedural_db.c * app/plug-in/plug-in-params.c * tools/pdbgen/app.pl * tools/pdbgen/pdb.pl: use the new param pspecs and gimp_value functions to keep arrays in GimpArguments. * app/pdb/gimpargument.[ch] (gimp_arguments_destroy): removed parameter "gboolean full_destroy". It's not needed any longer because the GValues fully memory-manage all their data now. * app/batch.c * app/actions/plug-in-commands.c * app/actions/vectors-commands.c * app/core/gimppdbprogress.c * app/dialogs/about-dialog.c * app/dialogs/print-size-dialog.c * app/dialogs/resize-dialog.c * app/display/gimpdisplayshell-handlers.c * app/file/file-open.c * app/file/file-save.c * app/plug-in/plug-in-message.c * app/plug-in/plug-in-run.c * app/plug-in/plug-ins.c * app/widgets/gimphelp.c * app/widgets/gimppdbdialog.c * tools/pdbgen/pdb/fileops.pdb: changed accordingly. * app/pdb/brush_cmds.c * app/pdb/brushes_cmds.c * app/pdb/buffer_cmds.c * app/pdb/color_cmds.c * app/pdb/drawable_cmds.c * app/pdb/fileops_cmds.c * app/pdb/fonts_cmds.c * app/pdb/gimpargument.c * app/pdb/gimpargument.h * app/pdb/gimpprocedure.c * app/pdb/gradient_cmds.c * app/pdb/gradients_cmds.c * app/pdb/image_cmds.c * app/pdb/paint_tools_cmds.c * app/pdb/palettes_cmds.c * app/pdb/parasite_cmds.c * app/pdb/paths_cmds.c * app/pdb/pattern_cmds.c * app/pdb/patterns_cmds.c * app/pdb/plug_in_cmds.c * app/pdb/procedural_db.c * app/pdb/procedural_db_cmds.c * app/pdb/selection_tools_cmds.c * app/pdb/vectors_cmds.c: regenerated. ... and ported everything to perl btw...
2006-04-01 09:33:28 +08:00
set_value_func => 'gimp_value_take_stringarray ($value, $var, $var_len)' },
colorarray => { name => 'COLORARRAY',
type => 'GimpRGB *',
const_type => 'const GimpRGB *',
array => 1,
init_value => 'NULL',
get_value_func => '$var = gimp_value_get_colorarray ($value)',
set_value_func => 'gimp_value_take_colorarray ($value, $var, $var_len)' },
replace the value union by a GValue. 2006-03-30 Michael Natterer <mitch@gimp.org> * app/pdb/procedural_db.[ch] (struct Argument): replace the value union by a GValue. (procedural_db_argument_init) (procedural_db_compat_arg_init): new functions to initialize an Argument. They call g_value_init() on the Argument's value. (procedural_db_arguments) (procedural_db_return_values): initialize the returned Argument arrays so their GValues are ready to use. Allow to get the (unsuccessful) return values of a NULL ProcRecord. (procedural_db_destroy_args): g_value_unset() the values. Added a "gboolean full_destroy" parameter. Its only effect is to destroy PDB arrays, everything else is nicely memory managed by GValue. (procedural_db_execute) (procedural_db_run_proc): do GValue stuff. Added n_args and n_return_vals parameters to execute(). (procedural_db_execute_proc): private function to execute a procedure. Validates the passed in arguments using the registered GParamSpecs before passing them to the resp. exec method. * app/plug-in/plug-in-params.[ch] (plug_in_params_to_args): needs an array of ProcArgs now in order to initialize the Arguments' GValues correctly. Passing NULL ProcArgs uses procedural_db_compat_arg_init(), so procedures (plug-ins) returning more values than expected work. (plug_in_args_to_params): do GValue stuff here too. (plug_in_args_destroy): removed this function, procedural_db_destroy_args() does the same now. * app/plug-in/plug-in-message.c (plug_in_handle_proc_run): simplified quite a bit because everything returns n_return_values now. Call plug_in_params_to_args() only of the procedure was found. (plug_in_handle_proc_return_priv): pass ProcRecs to plug_in_params_to_args(). * app/batch.c * app/actions/plug-in-commands.c * app/actions/vectors-commands.c * app/core/gimppdbprogress.c * app/dialogs/about-dialog.c * app/file/file-open.c * app/file/file-save.c * app/plug-in/plug-ins.c * app/plug-in/plug-in-progress.c * app/plug-in/plug-in-run.[ch] * app/widgets/gimphelp.c * app/widgets/gimppdbdialog.c * app/xcf/xcf.c * tools/pdbgen/pdb/fileops.pdb: changed accordingly: don't g_new/g_free Argument arrays, always use procedural_db_foo() functions. Use GValue functions to get/set Arguments. * tools/pdbgen/pdb.pl: added get_value_func and set_value_func to all PDB types. Removed id_func, id_ret_func and check_func. Added flags which indicated that a type is an ID. Removed unused utility functions. * tools/pdbgen/lib.pl: use the flag instead of looking at functions and value types. * tools/pdbgen/app.pl: use the get_value_func and set_value_func to marshal inargs and outargs. Removed all checks performed on inargs because that's done by GParamSpec validation now. Added the missing bits to register excluded values with GimpParamSpecEnum. * app/pdb/*_cmds.c: regenerated.
2006-03-30 07:56:07 +08:00
color => { name => 'COLOR' ,
type => 'GimpRGB ',
const_type => 'GimpRGB ',
struct => 1,
init_value => '{ 0.0, 0.0, 0.0, 1.0 }',
get_value_func => 'gimp_value_get_rgb ($value, &$var)',
set_value_func => 'gimp_value_set_rgb ($value, &$var)',
headers => [ qw(<cairo.h> "libgimpcolor/gimpcolor.h") ] },
display => { name => 'DISPLAY',
type => 'GimpObject *',
const_type => 'GimpObject *',
id => 1,
init_value => 'NULL',
get_value_func => '$var = gimp_value_get_display ($value, gimp)',
set_value_func => 'gimp_value_set_display ($value, $var)' },
image => { name => 'IMAGE',
type => 'GimpImage *',
const_type => 'GimpImage *',
id => 1,
init_value => 'NULL',
get_value_func => '$var = gimp_value_get_image ($value, gimp)',
set_value_func => 'gimp_value_set_image ($value, $var)',
headers => [ qw("core/gimpimage.h") ] },
item => { name => 'ITEM',
type => 'GimpItem *',
const_type => 'GimpItem *',
id => 1,
init_value => 'NULL',
get_value_func => '$var = gimp_value_get_item ($value, gimp)',
set_value_func => 'gimp_value_set_item ($value, $var)',
headers => [ qw("core/gimpitem.h") ] },
layer => { name => 'LAYER',
type => 'GimpLayer *',
const_type => 'GimpLayer *',
id => 1,
init_value => 'NULL',
get_value_func => '$var = gimp_value_get_layer ($value, gimp)',
set_value_func => 'gimp_value_set_layer ($value, $var)',
headers => [ qw("core/gimplayer.h") ] },
channel => { name => 'CHANNEL',
type => 'GimpChannel *',
const_type => 'GimpChannel *',
id => 1,
init_value => 'NULL',
get_value_func => '$var = gimp_value_get_channel ($value, gimp)',
set_value_func => 'gimp_value_set_channel ($value, $var)',
headers => [ qw("core/gimpchannel.h") ] },
drawable => { name => 'DRAWABLE',
type => 'GimpDrawable *',
const_type => 'GimpDrawable *',
id => 1,
init_value => 'NULL',
get_value_func => '$var = gimp_value_get_drawable ($value, gimp)',
set_value_func => 'gimp_value_set_drawable ($value, $var)',
headers => [ qw("core/gimpdrawable.h") ] },
selection => { name => 'SELECTION',
type => 'GimpSelection *',
const_type => 'GimpSelection *',
id => 1,
init_value => 'NULL',
get_value_func => '$var = gimp_value_get_selection ($value, gimp)',
set_value_func => 'gimp_value_set_selection ($value, $var)',
headers => [ qw("core/gimpselection.h") ] },
layer_mask => { name => 'CHANNEL',
type => 'GimpLayerMask *',
const_type => 'GimpLayerMask *',
id => 1,
init_value => 'NULL',
get_value_func => '$var = gimp_value_get_layer_mask ($value, gimp)',
set_value_func => 'gimp_value_set_layer_mask ($value, $var)',
headers => [ qw("core/gimplayermask.h") ] },
vectors => { name => 'VECTORS',
type => 'GimpVectors *',
const_type => 'GimpVectors *',
id => 1,
init_value => 'NULL',
get_value_func => '$var = gimp_value_get_vectors ($value, gimp)',
set_value_func => 'gimp_value_set_vectors ($value, $var)',
headers => [ qw("vectors/gimpvectors.h") ] },
parasite => { name => 'PARASITE',
type => 'GimpParasite *',
const_type => 'const GimpParasite *',
init_value => 'NULL',
get_value_func => '$var = g_value_get_boxed ($value)',
set_value_func => 'g_value_take_boxed ($value, $var)',
headers => [ qw("libgimpbase/gimpbase.h") ] },
# Special cases
enum => { name => 'INT32',
type => 'gint32 ',
const_type => 'gint32 ',
init_value => '0',
get_value_func => '$var = g_value_get_enum ($value)',
set_value_func => 'g_value_set_enum ($value, $var)' },
boolean => { name => 'INT32',
type => 'gboolean ',
const_type => 'gboolean ',
init_value => 'FALSE',
get_value_func => '$var = g_value_get_boolean ($value)',
set_value_func => 'g_value_set_boolean ($value, $var)' },
tattoo => { name => 'INT32',
type => 'gint32 ',
const_type => 'gint32 ',
init_value => '0',
get_value_func => '$var = g_value_get_uint ($value)',
set_value_func => 'g_value_set_uint ($value, $var)' },
guide => { name => 'INT32',
type => 'gint32 ',
const_type => 'gint32 ',
id => 1,
init_value => '0',
get_value_func => '$var = g_value_get_uint ($value)',
set_value_func => 'g_value_set_uint ($value, $var)' },
sample_point => { name => 'INT32',
type => 'gint32 ',
const_type => 'gint32 ',
id => 1,
init_value => '0',
get_value_func => '$var = g_value_get_uint ($value)',
set_value_func => 'g_value_set_uint ($value, $var)' },
unit => { name => 'INT32',
type => 'GimpUnit ',
const_type => 'GimpUnit ',
init_value => '0',
get_value_func => '$var = g_value_get_int ($value)',
set_value_func => 'g_value_set_int ($value, $var)' }
);
# Split out the parts of an arg constraint
sub arg_parse {
my $arg = shift;
1999-03-18 07:08:08 +08:00
if ($arg =~ /^enum (\w+)(.*)/) {
my ($name, $remove) = ($1, $2);
my @retvals = ('enum', $name);
1999-03-28 14:36:11 +08:00
if ($remove && $remove =~ m@ \(no @) {
chop $remove; ($remove = substr($remove, 5)) =~ s/ $//;
1999-03-18 07:08:08 +08:00
push @retvals, split(/,\s*/, $remove);
}
return @retvals;
}
1999-04-27 12:33:41 +08:00
elsif ($arg =~ /^unit(?: \(min (.*?)\))?/) {
my @retvals = ('unit');
push @retvals, $1 if $1;
return @retvals;
}
elsif ($arg =~ /^(?:([+-.\dA-Z_][^\s]*) \s* (<=|<))?
1999-03-21 10:14:08 +08:00
\s* (\w+) \s*
(?:(<=|<) \s* ([+-.\dA-Z_][^\s]*))?
1999-03-20 07:04:16 +08:00
/x) {
return ($3, $1, $2, $5, $4);
}
}
1999-04-04 13:59:08 +08:00
1;