mirror of
https://gitlab.gnome.org/GNOME/gimp
synced 2024-10-23 21:11:43 +00:00
a3bb0b0dad
2002-05-08 Michael Natterer <mitch@gimp.org> Started to get rid of the gdisplays_foo() functions in app/display/gimpdisplay-foreach.[ch]. Work in progress... * app/core/gimp.[ch]: added the display list to the Gimp object (as a GimpList of GimpObjects). This way we get more independent from whether there is GUI or not, as gimp->displays will simply be an empty list for the --no-interface case. * app/display/gimpdisplay.[ch]: Removed the global "display_list" and "display_num" variables. Use gimp->displays instead. * app/display/gimpdisplay-foreach.[ch]: renamed most functions from gdisplays_foo() to gimp_displays_foo() and pass them a Gimp pointer. * app/core/gimpimage.[ch]: added a "flush" signal. * app/display/gimpdisplay-handlers.c: connect to "flush" and call gimp_display_flush() in the callback. * tools/pdbgen/pdb/display.pdb: use gimp_displays_flush(gimp) here and only here. * app/pdb/display_cmds.c: regenerated. * app/app_procs.c * app/gui/gui.c * app/gui/preferences-dialog.c: s/gdislays_foo()/gimp_displays_foo(gimp)/ * app/image_map.c * app/undo_history.c * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell-dnd.c * app/display/gimpdisplayshell-layer-select.c * app/display/gimpdisplayshell-scale.c * app/gui/channels-commands.c * app/gui/colormap-editor-commands.c * app/gui/convert-dialog.c * app/gui/drawable-commands.c * app/gui/edit-commands.c * app/gui/file-commands.c * app/gui/image-commands.c * app/gui/layers-commands.c * app/gui/offset-dialog.c * app/gui/qmask-commands.c * app/gui/select-commands.c * app/gui/vectors-commands.c * app/paint/gimpairbrush.c * app/tools/gimpbezierselecttool.c * app/tools/gimpblendtool.c * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpbycolorselecttool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpcurvestool.c * app/tools/gimpeditselectiontool.c * app/tools/gimpfreeselecttool.c * app/tools/gimpfuzzyselecttool.c * app/tools/gimphuesaturationtool.c * app/tools/gimpinktool.c * app/tools/gimpiscissorstool.c * app/tools/gimplevelstool.c * app/tools/gimpmeasuretool.c * app/tools/gimpmovetool.c * app/tools/gimppainttool.c * app/tools/gimpposterizetool.c * app/tools/gimprectselecttool.c * app/tools/gimptexttool.c * app/tools/gimpthresholdtool.c * app/tools/gimptransformtool.c * app/tools/gimpvectortool.c * app/widgets/gimpbufferview.c * app/widgets/gimpchannellistview.c * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpdocumentview.c * app/widgets/gimpdrawablelistitem.c * app/widgets/gimpdrawablelistview.c * app/widgets/gimpimageview.c * app/widgets/gimpitemlistitem.c * app/widgets/gimpitemlistview.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplayerlistview.c * app/widgets/gimpvectorslistview.c: replaced gdisplays_flush() with calls to gimp_image_flush(gimage). Removed inclusion of "display/gimpdisplay-foreach.h" from most files.
176 lines
4.5 KiB
C
176 lines
4.5 KiB
C
/* The GIMP -- an image manipulation program
|
|
* Copyright (C) 1995-2000 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.
|
|
*/
|
|
|
|
/* NOTE: This file is autogenerated by pdbgen.pl. */
|
|
|
|
#include "config.h"
|
|
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
#include "libgimpbase/gimpbasetypes.h"
|
|
|
|
#include "pdb-types.h"
|
|
#include "display/display-types.h"
|
|
#include "procedural_db.h"
|
|
|
|
#include "core/gimp.h"
|
|
#include "core/gimpimage.h"
|
|
#include "display/gimpdisplay-foreach.h"
|
|
#include "display/gimpdisplay.h"
|
|
|
|
static ProcRecord display_new_proc;
|
|
static ProcRecord display_delete_proc;
|
|
static ProcRecord displays_flush_proc;
|
|
|
|
void
|
|
register_display_procs (Gimp *gimp)
|
|
{
|
|
procedural_db_register (gimp, &display_new_proc);
|
|
procedural_db_register (gimp, &display_delete_proc);
|
|
procedural_db_register (gimp, &displays_flush_proc);
|
|
}
|
|
|
|
static Argument *
|
|
display_new_invoker (Gimp *gimp,
|
|
Argument *args)
|
|
{
|
|
gboolean success = TRUE;
|
|
Argument *return_args;
|
|
GimpImage *gimage;
|
|
GimpDisplay *gdisp = NULL;
|
|
|
|
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
|
|
if (gimage == NULL)
|
|
success = FALSE;
|
|
|
|
if (success)
|
|
{
|
|
gdisp = (GimpDisplay *) gimp_create_display (gimp, gimage, 0x0101);
|
|
|
|
success = (gdisp != NULL);
|
|
}
|
|
|
|
return_args = procedural_db_return_args (&display_new_proc, success);
|
|
|
|
if (success)
|
|
return_args[1].value.pdb_int = gimp_display_get_ID (gdisp);
|
|
|
|
return return_args;
|
|
}
|
|
|
|
static ProcArg display_new_inargs[] =
|
|
{
|
|
{
|
|
GIMP_PDB_IMAGE,
|
|
"image",
|
|
"The image"
|
|
}
|
|
};
|
|
|
|
static ProcArg display_new_outargs[] =
|
|
{
|
|
{
|
|
GIMP_PDB_DISPLAY,
|
|
"display",
|
|
"The new display"
|
|
}
|
|
};
|
|
|
|
static ProcRecord display_new_proc =
|
|
{
|
|
"gimp_display_new",
|
|
"Create a new display for the specified image.",
|
|
"Creates a new display for the specified image. If the image already has a display, another is added. Multiple displays are handled transparently by the GIMP. The newly created display is returned and can be subsequently destroyed with a call to 'gimp-display-delete'. This procedure only makes sense for use with the GIMP UI.",
|
|
"Spencer Kimball & Peter Mattis",
|
|
"Spencer Kimball & Peter Mattis",
|
|
"1995-1996",
|
|
GIMP_INTERNAL,
|
|
1,
|
|
display_new_inargs,
|
|
1,
|
|
display_new_outargs,
|
|
{ { display_new_invoker } }
|
|
};
|
|
|
|
static Argument *
|
|
display_delete_invoker (Gimp *gimp,
|
|
Argument *args)
|
|
{
|
|
gboolean success = TRUE;
|
|
GimpDisplay *gdisp;
|
|
|
|
gdisp = gimp_display_get_by_ID (gimp, args[0].value.pdb_int);
|
|
if (gdisp == NULL)
|
|
success = FALSE;
|
|
|
|
if (success)
|
|
gimp_display_delete (gdisp);
|
|
|
|
return procedural_db_return_args (&display_delete_proc, success);
|
|
}
|
|
|
|
static ProcArg display_delete_inargs[] =
|
|
{
|
|
{
|
|
GIMP_PDB_DISPLAY,
|
|
"display",
|
|
"The display to delete"
|
|
}
|
|
};
|
|
|
|
static ProcRecord display_delete_proc =
|
|
{
|
|
"gimp_display_delete",
|
|
"Delete the specified display.",
|
|
"This procedure removes the specified display. If this is the last remaining display for the underlying image, then the image is deleted also.",
|
|
"Spencer Kimball & Peter Mattis",
|
|
"Spencer Kimball & Peter Mattis",
|
|
"1995-1996",
|
|
GIMP_INTERNAL,
|
|
1,
|
|
display_delete_inargs,
|
|
0,
|
|
NULL,
|
|
{ { display_delete_invoker } }
|
|
};
|
|
|
|
static Argument *
|
|
displays_flush_invoker (Gimp *gimp,
|
|
Argument *args)
|
|
{
|
|
gimp_displays_flush (gimp);
|
|
return procedural_db_return_args (&displays_flush_proc, TRUE);
|
|
}
|
|
|
|
static ProcRecord displays_flush_proc =
|
|
{
|
|
"gimp_displays_flush",
|
|
"Flush all internal changes to the user interface",
|
|
"This procedure takes no arguments and returns nothing except a success status. Its purpose is to flush all pending updates of image manipulations to the user interface. It should be called whenever appropriate.",
|
|
"Spencer Kimball & Peter Mattis",
|
|
"Spencer Kimball & Peter Mattis",
|
|
"1995-1996",
|
|
GIMP_INTERNAL,
|
|
0,
|
|
NULL,
|
|
0,
|
|
NULL,
|
|
{ { displays_flush_invoker } }
|
|
};
|