gimp/tools/pdbgen/pdb/gimprc.pdb

135 lines
4.1 KiB
Plaintext
Raw Normal View History

1999-03-21 10:14:08 +08:00
# 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
1999-03-21 10:14:08 +08:00
# 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
1999-03-21 10:14:08 +08:00
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 a nd will not be queryable.
HELP
&std_pdb_misc;
$date = '1997';
@inargs = (
{ name => 'token', type => 'string',
desc => 'The token to query for' }
);
@outargs = (
{ name => 'value', type => 'string',
desc => 'The value associated with the queried token',
alias => 'g_strdup (value)', no_declare => 1 }
);
%invoke = (
vars => [ 'gchar *value = NULL' ],
code => <<'CODE'
{
success = (value = gimprc_find_token (token)) != NULL;
if (!success) /* custom ones failed, try the standard ones */
success = (value = gimprc_value_to_str(token)) != NULL;
}
CODE
1999-03-21 10:14:08 +08:00
);
}
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.
If the gimprc can not be written for whatever reason, gimp will complain loudly
and the old gimprc will be saved in gimprc.old.
HELP
$author = $copyright = 'Seth Burgess';
$date = '1999';
@inargs = (
{ name => 'token', type => 'string',
desc => 'The token to modify' },
{ name => 'value', type => 'string',
desc => 'The value to set the token to' }
);
%invoke = (
code => 'save_gimprc_strings(token, value);'
);
}
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 X-Server 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 = (
code => <<'CODE'
{
xres = monitor_xres;
yres = monitor_yres;
success = TRUE;
}
CODE
);
}
@headers = qw("gimprc.h");
@procs = qw(gimprc_query gimprc_set get_monitor_resolution);
Sven Neumann <sven@gimp.org> 2000-06-01 Michael Natterer <mitch@gimp.org> Sven Neumann <sven@gimp.org> Completed the new file structure. Yet only few of the _pdb.[ch] files are based upon generated code and nothing is really autogenerated... * app/Makefile.am * app/gdisplay_cmds.c -> app/display_cmds.c * app/gimage_cmds.c -> app/image_cmds.c * app/gimage_mask_cmds.c -> app/selection_cmds.c * app/internal_procs.c: related change * libgimp/Makefile.am * libgimp/gimp.h * libgimp/gimp_pdb.h * libgimp/gimpdisplay_pdb.[ch] * libgimp/gimpimage_pdb.[ch] * libgimp/gimpselection_pdb.[ch]: replaced with code based on files generated using pdbgen * libgimp/gimpchannelops_pdb.[ch] * libgimp/gimpcolor_pdb.[ch] * libgimp/gimpedit_pdb.[ch] * libgimp/gimpfloatingsel_pdb.[ch] * libgimp/gimpgimprc_pdb.[ch] * libgimp/gimptexttool_pdb.[ch] * libgimp/gimptools_pdb.[ch] * libgimp/gimpundo_pdb.[ch]: new files based on generated code * libgimp/gimpgradientselect.[ch] * libgimp/gimpimage.[ch] * libgimp/gimpselection.[ch]: new files wrapping around the autogenerated PDB wrappers as found in *_pdb.[ch]. This is necessary since the number of parameters or their order is different from the PDP calls. * plug-ins/common/CEL.c: plugged memleak * plug-ins/common/aa.c: removed compiler warning * tools/pdbgen/Makefile.am * tools/pdbgen/groups.pl * tools/pdbgen/pdb/gdisplay.pdb -> display.pdb * tools/pdbgen/pdb/gimage.pdb -> image.pdb * tools/pdbgen/pdb/gimage_mask.pdb -> selection.pdb * tools/pdbgen/pdb/channel_ops.pdb * tools/pdbgen/pdb/color.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/pdb/floating_sel.pdb * tools/pdbgen/pdb/gimprc.pdb * tools/pdbgen/pdb/text_tool.pdb * tools/pdbgen/pdb/tools.pdb * tools/pdbgen/pdb/undo.pdb: made them create libgimp code
2000-06-01 20:20:13 +08:00
%exports = (app => [@procs], lib => [@procs]);
1999-03-21 10:14:08 +08:00
$desc = 'Gimprc procedures';
1;