gimp/pdb/groups/image_undo.pdb

307 lines
7.6 KiB
Plaintext
Raw Normal View History

# GIMP - The GNU Image Manipulation Program
1998-10-24 13:21:56 +08:00
# Copyright (C) 1995 Spencer Kimball and Peter Mattis
# This program is free software: you can redistribute it and/or modify
1998-10-24 13:21:56 +08:00
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
1998-10-24 13:21:56 +08:00
# (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 <https://www.gnu.org/licenses/>.
1998-10-24 13:21:56 +08:00
# "Perlized" from C source by Manish Singh <yosh@gimp.org>
sub image_undo_group_start {
1998-10-24 13:21:56 +08:00
$blurb = 'Starts a group undo.';
$help = <<'HELP';
This function is used to start a group undo--necessary for logically combining
two or more undo operations into a single operation. This call must be used in
conjunction with a gimp_image_undo_group_end() call.
1998-10-24 13:21:56 +08:00
HELP
&std_pdb_misc;
$date = '1997';
@inargs = (
{ name => 'image', type => 'image',
desc => 'The ID of the image in which to open an undo group' }
);
1998-10-24 13:21:56 +08:00
%invoke = (
code => <<'CODE'
{
GimpPlugIn *plug_in = gimp->plug_in_manager->current_plug_in;
const gchar *undo_desc = NULL;
app/plug-in/Makefile.am app/plug-in/plug-in-types.h new object which keeps 2006-04-29 Michael Natterer <mitch@gimp.org> * app/plug-in/Makefile.am * app/plug-in/plug-in-types.h * app/plug-in/gimppluginmanager.[ch]: new object which keeps all plug-in related stuff that was kept in the Gimp instance. Has "menu-branch-added" and "last-plug-in-changed" signals. * app/plug-in/plug-ins.[ch]: removed, all its functions are in GimpPlugInManager now. * app/core/gimpmarshal.list: new marshaller for the new object. * app/core/gimp.[ch]: removed all plug-in related stuff and keep a GimpPlugInManager around. * app/plug-in/plug-in-data.[ch] * app/plug-in/plug-in-file.[ch] * app/plug-in/plug-in-help-domain.[ch] * app/plug-in/plug-in-locale-domain.[ch] * app/plug-in/plug-in-menu-branch.[ch] * app/plug-in/plug-ins-query.[ch]: removed... * app/plug-in/gimppluginmanager-data.[ch] * app/plug-in/gimppluginmanager-file.[ch] * app/plug-in/gimppluginmanager-help-domain.[ch] * app/plug-in/gimppluginmanager-locale-domain.[ch] * app/plug-in/gimppluginmanager-menu-branch.[ch] * app/plug-in/gimppluginmanager-query.[ch]: ...and added as methods of GimpPlugInManager. * app/plug-in/plug-in-debug.[ch] * app/plug-in/plug-in-shm.[ch]: removed... * app/plug-in/gimpplugindebug.[ch] * app/plug-in/gimppluginshm.[ch]: ...and added as properly namespeced structs with constructors and destructors. * app/core/Makefile.am * app/core/gimpenvirontable.[ch] * app/core/gimpinterpreterdb.[ch]: removed... * app/plug-in/gimpenvirontable.[ch] * app/plug-in/gimpinterpreterdb.[ch]: ...and added here unchanged. * app/core/gimp-gui.[ch] * app/gui/gui-vtable.c: remove gimp_menus_create_branch() and all related stuff. * app/actions/plug-in-actions.[ch]: connect to the plug-in-manager's "menu-path-added" signal and create menu branch actions accordingly. * app/plug-in/plug-in-context.c * app/plug-in/plug-in-message.c * app/plug-in/plug-in-progress.c * app/plug-in/plug-in-run.[ch] * app/plug-in/plug-in.[ch] * app/app_procs.c * app/actions/file-commands.c * app/actions/plug-in-commands.c * app/core/gimpimage.c * app/dialogs/file-open-location-dialog.c * app/dialogs/file-save-dialog.c * app/file/file-open.c * app/gui/gui.c * app/menus/plug-in-menus.c * app/pdb/gimppluginprocedure.c * app/pdb/gimptemporaryprocedure.c * app/widgets/gimpdnd-xds.c * app/widgets/gimpfiledialog.c * app/widgets/gimpfileprocview.c * app/widgets/gimphelp.c * app/widgets/gimpthumbbox.c * app/xcf/xcf.c * tools/pdbgen/pdb/context.pdb * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/help.pdb * tools/pdbgen/pdb/message.pdb * tools/pdbgen/pdb/plug_in.pdb * tools/pdbgen/pdb/procedural_db.pdb * tools/pdbgen/pdb/progress.pdb * tools/pdbgen/pdb/undo.pdb: follow above refactoring. * app/pdb/context_cmds.c * app/pdb/drawable_cmds.c * app/pdb/fileops_cmds.c * app/pdb/help_cmds.c * app/pdb/message_cmds.c * app/pdb/plug_in_cmds.c * app/pdb/procedural_db_cmds.c * app/pdb/progress_cmds.c * app/pdb/undo_cmds.c: regenerated.
2006-04-29 06:26:51 +08:00
if (plug_in)
{
success = gimp_plug_in_cleanup_undo_group_start (plug_in, image);
if (success)
undo_desc = gimp_plug_in_get_undo_desc (plug_in);
}
if (success)
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_MISC, undo_desc);
}
CODE
);
1998-10-24 13:21:56 +08:00
}
sub image_undo_group_end {
1998-10-24 13:21:56 +08:00
$blurb = 'Finish a group undo.';
$help = <<'HELP';
This function must be called once for each gimp_image_undo_group_start() call
that is made.
1998-10-24 13:21:56 +08:00
HELP
&std_pdb_misc;
$date = '1997';
@inargs = (
{ name => 'image', type => 'image',
desc => 'The ID of the image in which to close an undo group' }
);
1998-10-24 13:21:56 +08:00
%invoke = (
code => <<'CODE'
{
GimpPlugIn *plug_in = gimp->plug_in_manager->current_plug_in;
if (plug_in)
success = gimp_plug_in_cleanup_undo_group_end (plug_in, image);
if (success)
gimp_image_undo_group_end (image);
}
CODE
);
1998-10-24 13:21:56 +08:00
}
sub image_undo_is_enabled {
$blurb = "Check if the image's undo stack is enabled.";
$help = <<'HELP';
This procedure checks if the image's undo stack is currently enabled or
disabled. This is useful when several plug-ins or scripts call each other
and want to check if their caller has already used gimp_image_undo_disable()
or gimp_image_undo_freeze().
HELP
&raphael_pdb_misc('1999');
@inargs = (
{ name => 'image', type => 'image',
desc => 'The image' }
);
@outargs = (
{ name => 'enabled', type => 'boolean',
2006-03-25 05:57:47 +08:00
desc => 'TRUE if undo is enabled for this image' }
);
%invoke = (
code => <<'CODE'
{
enabled = gimp_image_undo_is_enabled (image);
}
CODE
);
}
sub image_undo_disable {
$blurb = "Disable the image's undo stack.";
$help = <<'HELP';
This procedure disables the image's undo stack, allowing subsequent operations
to ignore their undo steps. This is generally called in conjunction with
gimp_image_undo_enable() to temporarily disable an image undo stack. This is
advantageous because saving undo steps can be time and memory intensive.
HELP
&std_pdb_misc;
@inargs = (
{ name => 'image', type => 'image',
desc => 'The image' }
);
@outargs = (
{ name => 'disabled', type => 'boolean',
2006-03-25 05:57:47 +08:00
desc => 'TRUE if the image undo has been disabled' }
);
%invoke = (
code => <<'CODE'
{
#if 0
GimpPlugIn *plug_in = gimp->plug_in_manager->current_plug_in;
if (plug_in)
success = gimp_plug_in_cleanup_undo_disable (plug_in, image);
#endif
if (success)
disabled = gimp_image_undo_disable (image);
}
CODE
);
}
sub image_undo_enable {
$blurb = "Enable the image's undo stack.";
$help = <<'HELP';
This procedure enables the image's undo stack, allowing subsequent operations
to store their undo steps. This is generally called in conjunction with
gimp_image_undo_disable() to temporarily disable an image undo stack.
HELP
&std_pdb_misc;
@inargs = (
{ name => 'image', type => 'image',
desc => 'The image' }
);
@outargs = (
{ name => 'enabled', type => 'boolean',
2006-03-25 05:57:47 +08:00
desc => 'TRUE if the image undo has been enabled' }
);
%invoke = (
code => <<'CODE'
{
#if 0
GimpPlugIn *plug_in = gimp->plug_in_manager->current_plug_in;
if (plug_in)
success = gimp_plug_in_cleanup_undo_enable (plug_in, image);
#endif
if (success)
enabled = gimp_image_undo_enable (image);
}
CODE
);
}
sub image_undo_freeze {
$blurb = "Freeze the image's undo stack.";
&adam_pdb_misc('1999');
$help = <<'HELP';
This procedure freezes the image's undo stack, allowing subsequent
operations to ignore their undo steps. This is generally called in
conjunction with gimp_image_undo_thaw() to temporarily disable an
image undo stack. This is advantageous because saving undo steps can
be time and memory intensive. gimp_image_undo_freeze() /
gimp_image_undo_thaw() and gimp_image_undo_disable() /
gimp_image_undo_enable() differ in that the former does not free up
all undo steps when undo is thawed, so is more suited to interactive
in-situ previews. It is important in this case that the image is back
to the same state it was frozen in before thawing, else 'undo'
behaviour is undefined.
HELP
@inargs = (
{ name => 'image', type => 'image',
desc => 'The image' }
);
@outargs = (
{ name => 'frozen', type => 'boolean',
2006-03-25 05:57:47 +08:00
desc => 'TRUE if the image undo has been frozen' }
);
%invoke = (
code => <<'CODE'
{
#if 0
GimpPlugIn *plug_in = gimp->plug_in_manager->current_plug_in;
if (plug_in)
success = gimp_plug_in_cleanup_undo_freeze (plug_in, image);
#endif
if (success)
frozen = gimp_image_undo_freeze (image);
}
CODE
);
}
sub image_undo_thaw {
$blurb = "Thaw the image's undo stack.";
&adam_pdb_misc('1999');
$help = <<'HELP';
This procedure thaws the image's undo stack, allowing subsequent
operations to store their undo steps. This is generally called in
conjunction with gimp_image_undo_freeze() to temporarily freeze an
image undo stack. gimp_image_undo_thaw() does NOT free the undo stack
as gimp_image_undo_enable() does, so is suited for situations where
one wishes to leave the undo stack in the same state in which one
found it despite non-destructively playing with the image in the
meantime. An example would be in-situ plug-in previews. Balancing
freezes and thaws and ensuring image consistency is the responsibility
of the caller.
HELP
@inargs = (
{ name => 'image', type => 'image',
desc => 'The image' }
);
@outargs = (
{ name => 'thawed', type => 'boolean',
2006-03-25 05:57:47 +08:00
desc => 'TRUE if the image undo has been thawed' }
);
%invoke = (
code => <<'CODE'
{
#if 0
GimpPlugIn *plug_in = gimp->plug_in_manager->current_plug_in;
if (plug_in)
success = gimp_plug_in_cleanup_undo_thaw (plug_in, image);
#endif
if (success)
thawed = gimp_image_undo_thaw (image);
}
CODE
);
}
@headers = qw("core/gimp.h"
"core/gimpimage-undo.h"
"plug-in/gimpplugin.h"
"plug-in/gimpplugin-cleanup.h"
"plug-in/gimppluginmanager.h");
1999-03-28 14:36:11 +08:00
@procs = qw(image_undo_group_start image_undo_group_end
image_undo_is_enabled
image_undo_disable image_undo_enable
image_undo_freeze image_undo_thaw);
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]);
1998-10-24 13:21:56 +08:00
$desc = 'Image Undo';
$doc_title = 'gimpimageundo';
$doc_short_desc = 'Control of image undo/redo.';
$doc_long_desc = 'Control of image undo/redo.';
1998-10-24 13:21:56 +08:00
1;