gimp/tools/pdbgen/pdb/gimprc.pdb
Michael Natterer db2db08fb4 tools/pdbgen/pdb/brush_select.pdb tools/pdbgen/pdb/brushes.pdb
2003-08-18  Michael Natterer  <mitch@gimp.org>

	* tools/pdbgen/pdb/brush_select.pdb
	* tools/pdbgen/pdb/brushes.pdb
	* tools/pdbgen/pdb/channel.pdb
	* tools/pdbgen/pdb/convert.pdb
	* tools/pdbgen/pdb/drawable.pdb
	* tools/pdbgen/pdb/fileops.pdb
	* tools/pdbgen/pdb/font_select.pdb
	* tools/pdbgen/pdb/gimprc.pdb
	* tools/pdbgen/pdb/gradient_select.pdb
	* tools/pdbgen/pdb/gradients.pdb
	* tools/pdbgen/pdb/layer.pdb
	* tools/pdbgen/pdb/message.pdb
	* tools/pdbgen/pdb/palette.pdb
	* tools/pdbgen/pdb/palette_select.pdb
	* tools/pdbgen/pdb/palettes.pdb
	* tools/pdbgen/pdb/paths.pdb
	* tools/pdbgen/pdb/pattern_select.pdb
	* tools/pdbgen/pdb/patterns.pdb
	* tools/pdbgen/pdb/plug_in.pdb
	* tools/pdbgen/pdb/procedural_db.pdb
	* tools/pdbgen/pdb/text_tool.pdb
	* tools/pdbgen/pdb/unit.pdb: UTF-8 validate all strings except
	filenames. Does not work yet for string params which may be NULL.
	They currently don't get checked because I still don't understand
	pdbgen enough :)

	* app/pdb/brush_select_cmds.c
	* app/pdb/brushes_cmds.c
	* app/pdb/channel_cmds.c
	* app/pdb/convert_cmds.c
	* app/pdb/drawable_cmds.c
	* app/pdb/fileops_cmds.c
	* app/pdb/font_select_cmds.c
	* app/pdb/gimprc_cmds.c
	* app/pdb/gradient_select_cmds.c
	* app/pdb/gradients_cmds.c
	* app/pdb/message_cmds.c
	* app/pdb/palette_select_cmds.c
	* app/pdb/palettes_cmds.c
	* app/pdb/paths_cmds.c
	* app/pdb/pattern_select_cmds.c
	* app/pdb/patterns_cmds.c
	* app/pdb/plug_in_cmds.c
	* app/pdb/procedural_db_cmds.c
	* app/pdb/text_tool_cmds.c
	* app/pdb/unit_cmds.c: regenerated.
2003-08-18 18:09:26 +00:00

170 lines
4.8 KiB
Plaintext

# The GIMP -- an image manipulation program
# Copyright (C) 1995 Spencer Kimball and Peter Mattis
# 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 2 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, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# "Perlized" from C source by Manish Singh <yosh@gimp.org>
# Added a PDB entry for writing a gimprc entry, by
# Seth Burgess <sjburges@gimp.org> 15/04/99
# The defs
sub gimprc_query {
$blurb = <<'BLURB';
Queries the gimprc file parser for information on a specified token.
BLURB
$help = <<'HELP';
This procedure is used to locate additional information contained in the gimprc
file considered extraneous to the operation of the GIMP. Plug-ins that need
configuration information can expect it will be stored in the user gimprc
file and can use this procedure to retrieve it. This query procedure will
return the value associated with the specified token. This corresponds _only_
to entries with the format: (<token> <value>). The value must be a string.
Entries not corresponding to this format will cause warnings to be issued on
gimprc parsing and will not be queryable.
HELP
&std_pdb_misc;
$date = '1997';
@inargs = (
{ name => 'token', type => 'string',
desc => 'The token to query for', utf8 => 1 }
);
@outargs = (
{ name => 'value', type => 'string',
desc => 'The value associated with the queried token',
no_declare => 1 }
);
%invoke = (
headers => [ qw("config/gimprc.h") ],
vars => [ 'gchar *value = NULL' ],
code => <<'CODE'
{
/* use edit_config so we get the values back we have set using
* gimprc_set() before
*/
success = (value = gimp_rc_query (GIMP_RC (gimp->edit_config), token)) != NULL;
}
CODE
);
}
sub gimprc_set {
$blurb = 'Sets a gimprc token to a value and saves it in the gimprc.';
$help = <<'HELP';
This procedure is used to add or change additional information in the gimprc
file that is considered extraneous to the operation of the GIMP. Plug-ins that
need configuration information can use this function to store it, and
gimp_gimprc_query to retrieve it. This will accept _only_ parameters in the
format of (<token> <value>), where <token> and <value> must be strings. Entries
not corresponding to this format will be eaten and no action will be performed.
HELP
$author = $copyright = 'Seth Burgess';
$date = '1999';
@inargs = (
{ name => 'token', type => 'string',
desc => 'The token to modify', utf8 => 1 },
{ name => 'value', type => 'string',
desc => 'The value to set the token to' }
);
%invoke = (
headers => [ qw("config/gimpconfig.h") ],
code => <<'CODE'
{
/* set the value in edit_config so we don't accidentially set
* GIMP_PARAM_RESTART values via the PDB
*/
gimp_config_add_unknown_token (G_OBJECT (gimp->edit_config), token, value);
success = TRUE;
}
CODE
);
}
sub get_monitor_resolution {
$blurb = 'Get the monitor resolution as specified in the Preferences.';
$help = <<'HELP';
Returns the resolution of the monitor in pixels/inch. This value
is taken from the Preferences (or the windowing system if this is set in
the Preferences) and there's no guarantee for the value to be reasonable.
HELP
&std_pdb_misc;
@inargs = ( );
@outargs = (
{ name => 'xres', type => 'float', void_ret => 1,
desc => 'X resolution', alias => 'xres' },
{ name => 'yres', type => 'float',
desc => 'Y resolution', alias => 'yres' },
);
%invoke = (
headers => [ qw("config/gimpdisplayconfig.h") ],
code => <<'CODE'
{
xres = GIMP_DISPLAY_CONFIG (gimp->config)->monitor_xres;
yres = GIMP_DISPLAY_CONFIG (gimp->config)->monitor_yres;
success = TRUE;
}
CODE
);
}
sub get_default_comment {
$blurb = 'Get the default image comment as specified in the Preferences.';
$help = 'Returns a copy of the default image comment.';
&std_pdb_misc;
@inargs = ( );
@outargs = (
{ name => 'comment', type => 'string',
desc => 'Default Image Comment' },
);
%invoke = (
headers => [ qw("config/gimpcoreconfig.h") ],
code => <<'CODE'
{
comment = g_strdup (gimp->config->default_comment);
success = TRUE;
}
CODE
);
}
@headers = qw("core/gimp.h");
@procs = qw(gimprc_query gimprc_set
get_default_comment get_monitor_resolution);
%exports = (app => [@procs], lib => [@procs]);
$desc = 'Gimprc procedures';
1;