gimp/app/core/gimpprojection.c

755 lines
20 KiB
C
Raw Normal View History

1997-11-25 06:05:25 +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.
1997-11-25 06:05:25 +08:00
*/
app/appenv.h New file. Includes <math.h>. Move G_PI, RINT(), ROUND() etc 1999-09-01 Tor Lillqvist <tml@iki.fi> * app/appenv.h * libgimp/gimpmath.h: New file. Includes <math.h>. Move G_PI, RINT(), ROUND() etc from app/appenv.h here, so plug-ins can use them, too. Remove some commented-out old stuff in appenv.h. * libgimp/gimp.h: Include gimpmath.h. * libgimp/gimp.c (gimp_main): Win32: Don't install signal handlers, we can't do anything useful in the handler ourselves anyway (it would be nice to print out a backtrace, but that seems pretty hard to do, even if not impossible). Let Windows inform the user about the crash. If the plug-in was compiled with MSVC, and the user also has it, she is offered a chance to start the debugger automatically anyway. * app/*several*.c: Include gimpmath.h for G_PI etc. Don't include <math.h>, as gimpmath.h includes it. * plug-ins/*/*many*.c: Include config.h. Don't include <math.h>. Remove all the duplicated definitions of G_PI and rint(). Use RINT() instead of rint(). * app/app_procs.[ch]: app_exit() takes a gboolean. * app/batch.c * app/commands.c * app/interface.c: Call app_exit() with FALSE or TRUE. * app/main.c (on_error): Call gimp_fatal_error. (main): Don't install any signal handler on Win32 here, either. * app/errors.c (gimp_fatal_error, gimp_terminate): Win32: Format the message and call MessageBox with it. g_on_error_query doesn't do anything useful on Win32, and printf'ing a message to stdout or stderr doesn't do anything, either, in a windowing application.
1999-09-02 04:30:56 +08:00
#include "config.h"
Cleanup weekend... 2001-10-29 Michael Natterer <mitch@gimp.org> Cleanup weekend... * app/app_procs.c: pass "no_interface" to gimp_new(). * app/core/gimp.[ch]: added "gboolean no_interface" and the load_procs and save_procs GSLists. * app/core/gimptoolinfo.[ch]: added a "Gimp" pointer to the GimpToolInfo object so more functions find their context without accessing the global "the_gimp" variable. * app/display/display-types.h: removed the GDisplay -> GimpDisplay typedef. * app/display/gimpdisplay.c: look at gimp->no_interface, don't include "appenv.h". * app/file/file-open.[ch] * app/file/file-save.[ch]: don't use "the_gimp" any more. Instead, pass around lots of "Gimp" pointers. Removed the global load_procs and save_procs variables here. Use access() to find out whether a file is readable/writable, removed the manual voodoo and it's Win32 wrappers. Added an optional (can be NULL) "PlunInProcDef" parameter to file_save(), removed file_save_with_proc(). * app/gui/menus.c: Use the unused "gpointer data" parameter of the GtkItemFactory callbacks to pass a "Gimp" pointer to all of them. This reduces the usage of the global "the_gimp" hack to zero in app/gui/... yeah. * app/gui/channels-commands.c * app/gui/edit-commands.c * app/gui/file-commands.c * app/gui/image-commands.c * app/gui/layers-commands.c * app/gui/palettes-commands.c * app/gui/select-commands.c * app/gui/test-commands.c * app/gui/tools-commands.c * app/gui/view-commands.c: use the passed "Gimp" pointer. * app/gui/color-area.[ch] * app/gui/convert-dialog.c * app/gui/dialogs-constructors.c * app/gui/file-new-dialog.[ch] * app/gui/file-open-dialog.[ch] * app/gui/file-save-dialog.[ch] * app/gui/gui.c * app/gui/info-window.[ch] * app/gui/module-browser.[ch] * app/gui/palette-editor.c * app/gui/palette-import-dialog.[ch] * app/gui/paths-dialog.c * app/gui/preferences-dialog.[ch] * app/gui/resize-dialog.[ch] * app/gui/tool-options-dialog.[ch] * app/gui/toolbox.c: pass around lots more "Gimp" and "GimpContext" pointers and don't use "the_gimp" any more. * app/tools/gimptool.h: added a pointer to the corresponding GimpToolInfo object (which in turn has a pointer to a Gimp). * app/tools/tool_manager.[ch]: set the pointer after creating the tool object. Removed tool_manager_get_info_by_tool() as there is a tool->tool_info pointer now. * app/tools/gimpbezierselecttool.c * app/tools/gimpblendtool.c * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpclonetool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpcolorpickertool.c * app/tools/gimpconvolvetool.c * app/tools/gimpcroptool.c * app/tools/gimpcurvestool.c * app/tools/gimpdodgeburntool.c * app/tools/gimpdrawtool.c * app/tools/gimpeditselectiontool.c * app/tools/gimpellipseselecttool.c * app/tools/gimperasertool.c * app/tools/gimpfliptool.c * app/tools/gimphistogramtool.c * app/tools/gimphuesaturationtool.c * app/tools/gimpinktool.c * app/tools/gimplevelstool.c * app/tools/gimpmagnifytool.c * app/tools/gimpmeasuretool.c * app/tools/gimpmovetool.c * app/tools/gimppainttool.c * app/tools/gimppathtool.c * app/tools/gimpperspectivetool.c * app/tools/gimpposterizetool.c * app/tools/gimprectselecttool.c * app/tools/gimprotatetool.c * app/tools/gimpscaletool.c * app/tools/gimpsheartool.c * app/tools/gimptexttool.c * app/tools/gimpthresholdtool.c * app/tools/path_tool.c * app/tools/xinput_airbrush.c: s/GDisplay/GimpDisplay/g. Use tool->tool_info and tool_info->gimp in some places to get rid of using "the_gimp". Removing the remaining ones involves changing the tool options system and is scheduled next... * app/widgets/gimpdnd.c * app/widgets/gimpdocumentview.c: pass a "Gimp" pointer to all file_open_*() functions. * app/gdisplay_color.[ch] * app/gdisplay_color_ui.[ch] * app/image_map.[ch] * app/nav_window.[ch] * app/path.c * app/path_bezier.c * app/path_transform.h * app/qmask.[ch]: s/GDisplay/GimpDisplay/g * tools/pdbgen/pdb/fileops.pdb: load_procs and save_procs are members of the "Gimp" object now. * tools/pdbgen/pdb/plug_in.pdb: use gimp->no_interface, don't include "appenv.h". * app/pdb/fileops_cmds.c * app/pdb/plug_in_cmds.c: regenerated.
2001-10-29 19:47:11 +08:00
Convert ugly comments into named structure fields. Much cleaner and less 2001-12-02 Daniel Egger <degger@fhm.edu> * app/gimprc.c: Convert ugly comments into named structure fields. Much cleaner and less errorprone though may cause troubles on older compilers and then needs to be reverted. Please report! * app/base/base-types.h: Add FIXME reminder. * app/base/gimplut.c: Use CLAMP macro instead of if-cascade. * app/base/temp-buf.c: Remove duplicated calculations and simplify checks. * app/base/tile-manager.c: - (tile_manager_get_tile_num): Return success and take an additional pointer for the tilenumber. - Simplify logic in the rest of the file as a result. - Remove rotten debugging cruft. * app/core/gimpbrushgenerated.c: Fix two stylistic nits. * app/app_procs.c: Include <stdlib.h> for exit () prototype. * app/core/gimpdrawable-blend.c: Include <stdlib.h> for abs () prototype. * app/display/gimpdisplay.c: Include <string.h> for memcpy () prototype. * app/core/gimpimage-convert.c: (HIST_RGB): First parameter is not const. Fixes a gcc warning for a wrong return value. * libgimpwidgets/gimpunitmenu.c * app/core/gimpunit.c: Add suggested (by gcc 3.1 cvs) parentheses to group correct logic tests together. * app/paint-funcs/paint-funcs-generic.h: Fix my HAS_ALPHA macro to avoid gcc 3.1 cvs warning. * app/gimprc.h * pathP.h * base-config.h * app/base/boundary.h * app/base/gimplut.[ch] * app/base/pixel-region.h * app/base/pixel-surround.[ch] * app/base/temp-buf.[ch] * app/base/tile-manager-private.h * app/base/tile-manager.c * app/base/tile-private.h * app/base/tile.[ch] * app/core/gimp.h * app/core/gimpbrushgenerated.h * app/core/gimpbrushpipe.h * app/core/gimpchannel.[ch] * app/core/gimpcontainer.h * app/core/gimpcoreconfig.h * app/core/gimpdata.h * app/core/gimpdatafactory.[ch] * app/core/gimpdrawable-blend.c * app/core/gimpdrawable.[ch] * app/core/gimpimage.h * app/core/gimpimagefile.h * app/core/gimplayer.h * app/core/gimplayermask.h * app/core/gimpmoduleinfo.h * app/core/gimppalette.h * app/core/gimpundo.h * app/display/gimpdisplay.h * app/display/gimpdisplayshell-selection.h * app/display/gimpdisplayshell.h * app/gui/brush-select.h * app/gui/gradient-editor.h * app/gui/gradient-select.h * app/gui/info-dialog.h * app/gui/resize-dialog.h * app/tools/gimpbezierselecttool.h * app/tools/gimpcolorbalancetool.h * app/tools/gimpcolorpickertool.h * app/tools/gimpcurvestool.h * app/tools/gimpdodgeburntool.c * app/tools/gimpfreeselecttool.h * app/tools/gimpfuzzyselecttool.h * app/tools/gimphuesaturationtool.h * app/tools/gimpinktool-blob.h * app/tools/gimpinktool.h * app/tools/gimpiscissorstool.h * app/tools/gimpmagnifytool.h * app/tools/gimpmeasuretool.h * app/tools/gimppainttool.h * app/tools/gimppathtool.h * app/tools/gimprectselecttool.h * app/tools/gimpthresholdtool.h * app/tools/gimptool.h * app/tools/gimptransformtool.h * app/tools/path_toolP.h * app/widgets/gimpbrushfactoryview.h * app/widgets/gimpconstrainedhwrapbox.h * app/widgets/gimpcontainermenu.h * app/widgets/gimpcontainerview.h * app/widgets/gimpdialogfactory.h * app/widgets/gimpimagedock.h * app/widgets/gimplistitem.h * app/widgets/gimpmenuitem.h * app/widgets/gimpnavigationpreview.h * app/widgets/gimppreview.h: Unsignify lots of variables and parameters and use bitfields in structs where possible. First part of a huge cleanup all over the code...
2001-12-02 22:59:30 +08:00
#include <string.h>
#include <gtk/gtk.h>
#include "display-types.h"
devel-docs/Makefile.am new file documenting the core's include policy. 2002-05-03 Michael Natterer <mitch@gimp.org> * devel-docs/Makefile.am * devel-docs/includes.txt: new file documenting the core's include policy. * HACKING: mention it here. * libgimptool/gimptooltypes.h: removed GimpToolOptions here. * app/core/core-types.h: and added it here. This is a temp hack needed because GimpToolInfo needs to know the GimpToolOptions type. * libgimpproxy/gimpproxytypes.h: regenerated. * libgimptool/gimptoolmodule.h: don't include gimptooltypes.h here... * libgimptool/gimptoolmodule.c: ...but here. * app/config/gimpconfig-params.c: include "libgimpbase/gimpbase.h" entirely, not single files from it. * app/core/gimp.c * app/core/gimpcontext.c * app/core/gimpcoreconfig.c * app/core/gimpdatafactory.c * app/core/gimpdocuments.c * app/core/gimpdrawable-blend.c * app/core/gimpdrawable-bucket-fill.c * app/core/gimpdrawable-offset.c * app/core/gimpdrawable-transform.c * app/core/gimpdrawable.c * app/core/gimpedit.c * app/core/gimpimage-convert.c * app/core/gimpimage-crop.c * app/core/gimpimage-duplicate.c * app/core/gimpimage-guides.c * app/core/gimpimage-mask.c * app/core/gimpimage-merge.c * app/core/gimpimage-new.c * app/core/gimpimage-projection.c * app/core/gimpimage-qmask.c * app/core/gimpimage-resize.c * app/core/gimpimage-scale.c * app/core/gimpimage.c * app/core/gimpitem.c * app/core/gimpmodules.c * app/core/gimppaintinfo.c * app/core/gimpparasite.c * app/core/gimppreviewcache.c * app/core/gimptoolinfo.c * app/core/gimpunit.c: include "core-types.h" and no other types file. * app/display/gimpdisplay.c * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell.c: include "tools/tools-types.h" instead of "libgimptool/gimptooltypes.h", warn about inclusion on "gui/gui-types.h" * app/file/file-open.c * app/file/file-save.c: don't include "libgimptool/gimptooltypes.h". * app/gui/about-dialog.c * app/gui/brush-select.c * app/gui/brushes-commands.c * app/gui/color-select.c * app/gui/data-commands.c * app/gui/device-status-dialog.c * app/gui/dialogs.c * app/gui/gradients-commands.c * app/gui/help-commands.c * app/gui/info-window.c * app/gui/palettes-commands.c * app/gui/patterns-commands.c * app/gui/resize-dialog.c * app/gui/tips-dialog.c * app/gui/tool-options-dialog.c: include "gui-types.h" and no other types file. * app/paint/gimpairbrush.c * app/paint/gimpclone.c * app/paint/gimpconvolve.c * app/paint/gimpdodgeburn.c * app/paint/gimperaser.c * app/paint/gimppaintbrush.c * app/paint/gimppaintcore-stroke.c * app/paint/gimppaintcore.c * app/paint/gimppaintoptions.c * app/paint/gimppencil.c * app/paint/gimpsmudge.c * app/paint/paint.c: include "paint-types.h" and no other types file. * app/pdb/pdb-types.h: don't include "libgimptool/gimptooltypes.h". * app/plug-in/plug-in-progress.c: warn about inclusion of "display/display-types.h" * app/tools/tools-types.h: include "libgimptool/gimptooltypes.h". * app/tools/gimpairbrushtool.c * app/tools/gimpbezierselecttool.c * app/tools/gimpblendtool.c * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpbycolorselecttool.c * app/tools/gimpclonetool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpcolorpickertool.c * app/tools/gimpconvolvetool.c * app/tools/gimpcroptool.c * app/tools/gimpcurvestool.c * app/tools/gimpdodgeburntool.c * app/tools/gimpdrawtool.c * app/tools/gimpeditselectiontool.c * app/tools/gimpellipseselecttool.c * app/tools/gimperasertool.c * app/tools/gimpfliptool.c * app/tools/gimpfreeselecttool.c * app/tools/gimpfuzzyselecttool.c * app/tools/gimphistogramtool.c * app/tools/gimphuesaturationtool.c * app/tools/gimpinktool.c * app/tools/gimplevelstool.c * app/tools/gimpmagnifytool.c * app/tools/gimpmeasuretool.c * app/tools/gimpmovetool.c * app/tools/gimppaintbrushtool.c * app/tools/gimppainttool.c * app/tools/gimppathtool.c * app/tools/gimppenciltool.c * app/tools/gimpperspectivetool.c * app/tools/gimpposterizetool.c * app/tools/gimprectselecttool.c * app/tools/gimprotatetool.c * app/tools/gimpscaletool.c * app/tools/gimpselectiontool.c * app/tools/gimpsheartool.c * app/tools/gimpsmudgetool.c * app/tools/gimptexttool.c * app/tools/gimpthresholdtool.c * app/tools/gimptoolcontrol.c * app/tools/gimptoolcontrol.h * app/tools/gimptransformtool.c * app/tools/gimpvectortool.c * app/tools/tools.c: include "tools-types.h" and no other types file, warn about inclusion of "gui/gui-types.h". * app/widgets/gimpcolorpanel.c * app/widgets/gimptoolbox-color-area.c: warn about inclusion of "gui/gui-types.h". * app/xcf/xcf-load.c * app/xcf/xcf.c: don't include "libgimptool/gimptooltypes.h". Split tool-safe-mode up in two files, one including libgimpproxy, one libgimp. * plug-ins/tools/Makefile.am * plug-ins/tools/tool-safe-mode-plug-in.[ch]: new files including libgimp/ stuff only. * plug-ins/tools/tool-safe-mode.[ch]: include libgimpproxy/ and libgimptool/ but don't include libgimp/ because of conflicting declarations. Unrelated: * app/tools/gimpclonetool.c: create the clone core so we don't crash. * app/gui/file-open-dialog.c: changed the way we create previews so that only out-of-date previews are created on a click in the preview area. Unconditional creation can still be forced by <Ctrl>+click. Changed the tooltip to document this.
2002-05-03 20:45:22 +08:00
#include "tools/tools-types.h"
app/Makefile.am removed. 2001-07-07 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/context_manager.[ch]: removed. * app/app_procs.c: call tool_mananger instead of context_manager functions, pass "the_gimp" to some more functions. * app/drawable.[ch]: pass a GimpContext to drawable_fill(). * app/errors.c: behave according to "stack_trace_mode" when using the debugging signal handler. * app/gimprc.[ch]: removed the core/ config variables. * app/selection.c: set the selection's state to INVISIBLE in selection_pause(). * app/core/Makefile.am * app/core/gimpcoreconfig.[ch]: new files (the configuration variables used by core/). * app/core/gimpcontext.[ch]: removed the global contexts (user, default, ...) and their functions. It's no longer possible to pass NULL to the context functions to manipulate the current context (gimpcontext.c doesn't know the current context any more). * app/core/gimp.[ch]: added them here. The functions are now called gimp_[set|get]_*_context(). Added gimp_create_context() which is the only function to create contexts now. * app/gui/dialogs.[ch] * app/gui/gui.[ch]: pass "gimp" to all functions. * app/tools/tool_manager.[ch] * app/tools/tools.[ch]: pass "gimp" to lots of functions. Added the "global_tool_context" logic and the global/non-global paint options switching from the context_manager. Pass "gimp" to all tools' "register" functions. * app/tools/*: changed accordingly. * app/devices.c * app/disp_callbacks.c * app/file-open.[ch] * app/file-save.c * app/gdisplay.c * app/gimage.c * app/libgimp_glue.c * app/module_db.c * app/nav_window.c * app/plug_in.c * app/qmask.c * app/undo.c * app/base/base-config.c * app/core/gimpbrushpipe.c * app/core/gimpdrawable-offset.c * app/core/gimpgradient.c * app/core/gimpimage-duplicate.c * app/core/gimpimage-mask.c * app/core/gimpimage-new.c * app/core/gimpimage.c * app/core/gimppalette.c * app/core/gimptoolinfo.[ch] * app/core/gimpundo.c * app/gui/brush-select.c * app/gui/channels-commands.c * app/gui/color-area.c * app/gui/dialogs-constructors.c * app/gui/file-new-dialog.c * app/gui/file-open-dialog.c * app/gui/gradient-editor.c * app/gui/gradient-select.c * app/gui/info-window.c * app/gui/layers-commands.c * app/gui/menus.c * app/gui/palette-editor.c * app/gui/palette-import-dialog.c * app/gui/palette-select.c * app/gui/paths-dialog.c * app/gui/pattern-select.c * app/gui/preferences-dialog.c * app/gui/resize-dialog.c * app/gui/test-commands.c * app/gui/tool-options-dialog.c * app/gui/toolbox.c * app/gui/tools-commands.c * app/xcf/xcf-load.c * app/xcf/xcf-save.c * app/widgets/gimpchannellistview.c * app/widgets/gimpdnd.c * app/widgets/gimpdrawablelistview.[ch] * app/widgets/gimpimagedock.c * app/widgets/gimplayerlistview.c * app/pdb/brushes_cmds.c * app/pdb/drawable_cmds.c * app/pdb/gradient_select_cmds.c * app/pdb/gradients_cmds.c * app/pdb/palette_cmds.c * app/pdb/patterns_cmds.c * app/pdb/procedural_db.c * tools/pdbgen/pdb/brushes.pdb * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/gradients.pdb * tools/pdbgen/pdb/palette.pdb * tools/pdbgen/pdb/patterns.pdb: changed accordingly: remove usage of gimp_context_[get|set]_*(NULL), create contexts with gimp_create_context(). Get the user/current context with gimp_get_[user|current]_context(). Added/removed access to the global "the_gimp" variable in some places. Get the core's config variables from "core_config".
2001-07-07 20:17:23 +08:00
#include "core/gimp.h"
Started to get rid of the gdisplays_foo() functions in 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.
2002-05-09 01:48:24 +08:00
#include "core/gimpcontainer.h"
#include "core/gimpcontext.h"
2001-11-01 05:20:09 +08:00
#include "core/gimpdrawable.h"
#include "core/gimpimage.h"
#include "core/gimpimage-projection.h"
Started to get rid of the gdisplays_foo() functions in 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.
2002-05-09 01:48:24 +08:00
#include "core/gimplist.h"
app/Makefile.am removed. Stuff now lives in app_procs.[ch] and in 2001-05-13 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/cursorutil.[ch]: removed. Stuff now lives in app_procs.[ch] and in widgets/gimpcursor.[ch] * app/appenv.h: added the "gimp_busy" boolean. * app/app_procs.[ch]: added the "busy" stuff here. * app/gui/gui.[ch]: "busy" stuff for the gui. * app/widgets/Makefile.am * app/widgets/gimpcursor.[ch]: exports only one function: gimp_cursor_new() which returns a GdkCursor which has to be destroyed. * app/apptypes.h * app/appenums.h: removed the cursor types. * app/widgets/widgets-types.h: added here. * app/tools/gimpeditselectiontool.[ch]: added gtkutil_compress_motion() here (will go to some utils file in widgets/). * app/tools/tools-types.h: #include "widgets/widgets-types.h" * app/dialog_handler.c * app/disp_callbacks.c * app/gdisplay.[ch] * app/nav_window.c * app/scroll.c * app/xcf.c * app/core/gimpimage-convert.c * app/core/gimpimage-duplicate.c * app/core/gimpimage.c * app/gui/file-open-dialog.c * app/tools/gimpblendtool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpcroptool.c * app/tools/gimpfuzzyselecttool.c * app/tools/gimptransformtool.c * tools/pdbgen/pdb/image.pdb * app/pdb/image_cmds.c: use the new cursor and "busy" functions. * app/gdisplay.h * app/core/gimpbrush.c: added some ugly cross-includes. * app/context_manager.c * app/gdisplay_ops.c * app/gimprc.c * app/core/gimpdrawable-offset.c * app/gui/file-save-dialog.c * app/gui/gradient-editor.c * app/gui/preferences-dialog.c * app/tools/gimpbezierselecttool.c * app/tools/gimpbycolorselecttool.c * app/tools/gimpclonetool.c * app/tools/gimpcolorpickertool.c * app/tools/gimperasertool.c * app/tools/gimpfliptool.c * app/tools/gimpinktool.c * app/tools/gimpiscissorstool.c * app/tools/gimpmagnifytool.c * app/tools/gimpmeasuretool.c * app/tools/gimpmovetool.c * app/tools/gimppainttool.c * app/tools/gimprectselecttool.c * app/tools/gimprotatetool.c * app/tools/gimpselectiontool.c: removed inclusion of "cursorutil.h"
2001-05-14 05:51:20 +08:00
2002-03-29 11:50:29 +08:00
#include "libgimptool/gimptool.h"
include the new "paint-funcs/paint-funcs-types.h". 2001-11-28 Michael Natterer <mitch@gimp.org> * app/base/base-types.h: include the new "paint-funcs/paint-funcs-types.h". * app/paint-funcs/Makefile.am * app/paint-funcs/paint-funcs-types.h: new file. Includes "base/base-types.h". * app/paint-funcs/paint-funcs.[ch]: removed the enums here, include "paint-funcs-types.h". * app/widgets/widgets-types.h: include "display/display-types.h" * app/display/display-types.h: include "widgets/widgets-types.h". * app/tools/tools-types.h: include "display/display-types.h" * app/gui/gui-types.h: include "tools/tools-types.h". The order of namespaces/dependencies should be (but is not): (base, paint-funcs) -> (core, file, xcf, pdb) -> (widgets, display) -> tools -> gui * app/path.c: include "tools/tools-types.h". * app/core/Makefile.am * app/core/gimpimage-guides.[ch] * app/core/gimpimage-merge.[ch] * app/core/gimpimage-resize.[ch] * app/core/gimpimage-scale.[ch]: new files. * app/core/gimpimage.[ch]: removed the stuff which is in the new files. Reordered all functions in both the .h and .c files, commented the groups of functions. * app/core/gimpcontainer.c: create the handler_id using a counter, not the address of a pointer, because the address *may* be the same twice, added debugging output. * app/core/gimpviewable.[ch]: added primitive support for getting a preview GdkPixbuf. * app/nav_window.c * app/undo.c * app/undo_history.c * app/core/gimpimage-duplicate.c * app/core/gimpimage-mask.[ch] * app/display/gimpdisplay.c * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell-dnd.c * app/display/gimpdisplayshell-render.c * app/display/gimpdisplayshell-scale.c * app/display/gimpdisplayshell-scroll.c * app/gui/image-commands.c * app/gui/info-window.c * app/gui/layers-commands.c * app/gui/palette-import-dialog.c * app/tools/gimpbycolorselecttool.c * app/tools/gimpeditselectiontool.c * app/tools/gimpmeasuretool.c * app/tools/gimpmovetool.c * app/widgets/gimpcontainerview-utils.c * app/xcf/xcf-load.c: changed accordingly, some cleanup. * tools/pdbgen/pdb/guides.pdb * tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions. * app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu items to the name of the last plug-in (Fixes #50986). * app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and "Redo" to the resp. undo names. Much simplified the WM icon stuff by removing most code and using gimp_viewable_get_new_preview_pixbuf(). * app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark returned by gimp_container_add_handler(). * app/pdb/guides_cmds.c * app/pdb/image_cmds.c * libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
#include "tools/tool_manager.h"
#include "gimpdisplay.h"
2001-11-01 05:20:09 +08:00
#include "gimpdisplay-area.h"
#include "gimpdisplay-handlers.h"
#include "gimpdisplayshell.h"
#include "gimpdisplayshell-handlers.h"
app/Makefile.am app/gui/Makefile.am app/about_dialog.[ch] 2001-04-17 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/gui/Makefile.am * app/about_dialog.[ch] * app/brush_edit.[ch] * app/brush_select.[ch] * app/channels_dialog.[ch] * app/color_area.[ch] * app/color_notebook.[ch] * app/color_select.[ch] * app/colormap_dialog.[ch] * app/commands.[ch] * app/file_new_dialog.[ch] * app/gradient_editor.[ch] * app/gradient_select.[ch] * app/indicator_area.[ch] * app/info_dialog.[ch] * app/info_window.[ch] * app/layer_select.[ch] * app/layers_dialog.[ch] * app/menus.[ch] * app/palette.[ch] * app/palette_import.[ch] * app/palette_select.[ch] * app/paths_dialog.[ch] * app/pattern_select.[ch] * app/preferences_dialog.[ch] * app/session.[ch] * app/test_commands.[ch] * app/tips_dialog.[ch] * app/toolbox.[ch]: moved to gui/ (s/_/-/ and some more useful filenames on the way). * app/app_procs.c * app/context_manager.c * app/convert.c * app/disp_callbacks.c * app/errorconsole.c * app/file-open.c * app/file-save.c * app/file-utils.c * app/gdisplay.c * app/gimage.c * app/gimprc.c * app/image_new.c * app/interface.c * app/nav_window.c * app/path.c * app/plug_in.c * app/gui/dialogs-constructors.c * app/pdb/brush_select_cmds.c * app/pdb/convert_cmds.c * app/pdb/gradient_select_cmds.c * app/pdb/pattern_select_cmds.c * app/tools/gimpcolorpickertool.c * app/tools/gimpcroptool.c * app/tools/gimpmagnifytool.c * app/tools/gimpmeasuretool.c * app/tools/gimpscaletool.c * app/tools/gimptransformtool.c * app/widgets/gimpcolorpanel.c * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/convert.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/pattern_select.pdb * po/POTFILES.in: changed accordingly.
2001-04-18 05:43:29 +08:00
1997-11-25 06:05:25 +08:00
#include "gimprc.h"
#include "libgimp/gimpintl.h"
2001-11-01 05:20:09 +08:00
/* local function prototypes */
static void gimp_display_class_init (GimpDisplayClass *klass);
static void gimp_display_init (GimpDisplay *gdisp);
static void gimp_display_finalize (GObject *object);
static void gimp_display_flush_whenever (GimpDisplay *gdisp,
gboolean now);
static void gimp_display_idlerender_init (GimpDisplay *gdisp);
static gboolean gimp_display_idlerender_callback (gpointer data);
static gboolean gimp_display_idle_render_next_area (GimpDisplay *gdisp);
static void gimp_display_paint_area (GimpDisplay *gdisp,
gint x,
gint y,
gint w,
gint h);
static GimpObjectClass *parent_class = NULL;
GType
gimp_display_get_type (void)
{
static GType display_type = 0;
if (! display_type)
{
static const GTypeInfo display_info =
{
sizeof (GimpDisplayClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_display_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpDisplay),
0, /* n_preallocs */
(GInstanceInitFunc) gimp_display_init,
};
1997-11-25 06:05:25 +08:00
display_type = g_type_register_static (GIMP_TYPE_OBJECT,
"GimpDisplay",
&display_info, 0);
}
return display_type;
}
static void
gimp_display_class_init (GimpDisplayClass *klass)
1997-11-25 06:05:25 +08:00
{
GObjectClass *object_class;
1997-11-25 06:05:25 +08:00
object_class = G_OBJECT_CLASS (klass);
1997-11-25 06:05:25 +08:00
parent_class = g_type_class_peek_parent (klass);
object_class->finalize = gimp_display_finalize;
}
static void
gimp_display_init (GimpDisplay *gdisp)
{
Started to get rid of the gdisplays_foo() functions in 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.
2002-05-09 01:48:24 +08:00
gdisp->ID = 0;
2001-11-01 05:20:09 +08:00
gdisp->gimage = NULL;
gdisp->instance = 0;
gdisp->shell = NULL;
2001-11-01 05:20:09 +08:00
gdisp->scale = 0;
gdisp->dot_for_dot = gimprc.default_dot_for_dot;
gdisp->draw_guides = TRUE;
gdisp->snap_to_guides = TRUE;
gdisp->update_areas = NULL;
gdisp->idle_render.idle_id = 0;
gdisp->idle_render.update_areas = NULL;
}
static void
gimp_display_finalize (GObject *object)
{
GimpDisplay *gdisp;
g_return_if_fail (GIMP_IS_DISPLAY (object));
gdisp = GIMP_DISPLAY (object);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
GimpDisplay *
gimp_display_new (GimpImage *gimage,
guint scale)
{
GimpDisplay *gdisp;
Cleanup weekend... 2001-10-29 Michael Natterer <mitch@gimp.org> Cleanup weekend... * app/app_procs.c: pass "no_interface" to gimp_new(). * app/core/gimp.[ch]: added "gboolean no_interface" and the load_procs and save_procs GSLists. * app/core/gimptoolinfo.[ch]: added a "Gimp" pointer to the GimpToolInfo object so more functions find their context without accessing the global "the_gimp" variable. * app/display/display-types.h: removed the GDisplay -> GimpDisplay typedef. * app/display/gimpdisplay.c: look at gimp->no_interface, don't include "appenv.h". * app/file/file-open.[ch] * app/file/file-save.[ch]: don't use "the_gimp" any more. Instead, pass around lots of "Gimp" pointers. Removed the global load_procs and save_procs variables here. Use access() to find out whether a file is readable/writable, removed the manual voodoo and it's Win32 wrappers. Added an optional (can be NULL) "PlunInProcDef" parameter to file_save(), removed file_save_with_proc(). * app/gui/menus.c: Use the unused "gpointer data" parameter of the GtkItemFactory callbacks to pass a "Gimp" pointer to all of them. This reduces the usage of the global "the_gimp" hack to zero in app/gui/... yeah. * app/gui/channels-commands.c * app/gui/edit-commands.c * app/gui/file-commands.c * app/gui/image-commands.c * app/gui/layers-commands.c * app/gui/palettes-commands.c * app/gui/select-commands.c * app/gui/test-commands.c * app/gui/tools-commands.c * app/gui/view-commands.c: use the passed "Gimp" pointer. * app/gui/color-area.[ch] * app/gui/convert-dialog.c * app/gui/dialogs-constructors.c * app/gui/file-new-dialog.[ch] * app/gui/file-open-dialog.[ch] * app/gui/file-save-dialog.[ch] * app/gui/gui.c * app/gui/info-window.[ch] * app/gui/module-browser.[ch] * app/gui/palette-editor.c * app/gui/palette-import-dialog.[ch] * app/gui/paths-dialog.c * app/gui/preferences-dialog.[ch] * app/gui/resize-dialog.[ch] * app/gui/tool-options-dialog.[ch] * app/gui/toolbox.c: pass around lots more "Gimp" and "GimpContext" pointers and don't use "the_gimp" any more. * app/tools/gimptool.h: added a pointer to the corresponding GimpToolInfo object (which in turn has a pointer to a Gimp). * app/tools/tool_manager.[ch]: set the pointer after creating the tool object. Removed tool_manager_get_info_by_tool() as there is a tool->tool_info pointer now. * app/tools/gimpbezierselecttool.c * app/tools/gimpblendtool.c * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpclonetool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpcolorpickertool.c * app/tools/gimpconvolvetool.c * app/tools/gimpcroptool.c * app/tools/gimpcurvestool.c * app/tools/gimpdodgeburntool.c * app/tools/gimpdrawtool.c * app/tools/gimpeditselectiontool.c * app/tools/gimpellipseselecttool.c * app/tools/gimperasertool.c * app/tools/gimpfliptool.c * app/tools/gimphistogramtool.c * app/tools/gimphuesaturationtool.c * app/tools/gimpinktool.c * app/tools/gimplevelstool.c * app/tools/gimpmagnifytool.c * app/tools/gimpmeasuretool.c * app/tools/gimpmovetool.c * app/tools/gimppainttool.c * app/tools/gimppathtool.c * app/tools/gimpperspectivetool.c * app/tools/gimpposterizetool.c * app/tools/gimprectselecttool.c * app/tools/gimprotatetool.c * app/tools/gimpscaletool.c * app/tools/gimpsheartool.c * app/tools/gimptexttool.c * app/tools/gimpthresholdtool.c * app/tools/path_tool.c * app/tools/xinput_airbrush.c: s/GDisplay/GimpDisplay/g. Use tool->tool_info and tool_info->gimp in some places to get rid of using "the_gimp". Removing the remaining ones involves changing the tool options system and is scheduled next... * app/widgets/gimpdnd.c * app/widgets/gimpdocumentview.c: pass a "Gimp" pointer to all file_open_*() functions. * app/gdisplay_color.[ch] * app/gdisplay_color_ui.[ch] * app/image_map.[ch] * app/nav_window.[ch] * app/path.c * app/path_bezier.c * app/path_transform.h * app/qmask.[ch]: s/GDisplay/GimpDisplay/g * tools/pdbgen/pdb/fileops.pdb: load_procs and save_procs are members of the "Gimp" object now. * tools/pdbgen/pdb/plug_in.pdb: use gimp->no_interface, don't include "appenv.h". * app/pdb/fileops_cmds.c * app/pdb/plug_in_cmds.c: regenerated.
2001-10-29 19:47:11 +08:00
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
/* If there isn't an interface, never create a gdisplay */
Cleanup weekend... 2001-10-29 Michael Natterer <mitch@gimp.org> Cleanup weekend... * app/app_procs.c: pass "no_interface" to gimp_new(). * app/core/gimp.[ch]: added "gboolean no_interface" and the load_procs and save_procs GSLists. * app/core/gimptoolinfo.[ch]: added a "Gimp" pointer to the GimpToolInfo object so more functions find their context without accessing the global "the_gimp" variable. * app/display/display-types.h: removed the GDisplay -> GimpDisplay typedef. * app/display/gimpdisplay.c: look at gimp->no_interface, don't include "appenv.h". * app/file/file-open.[ch] * app/file/file-save.[ch]: don't use "the_gimp" any more. Instead, pass around lots of "Gimp" pointers. Removed the global load_procs and save_procs variables here. Use access() to find out whether a file is readable/writable, removed the manual voodoo and it's Win32 wrappers. Added an optional (can be NULL) "PlunInProcDef" parameter to file_save(), removed file_save_with_proc(). * app/gui/menus.c: Use the unused "gpointer data" parameter of the GtkItemFactory callbacks to pass a "Gimp" pointer to all of them. This reduces the usage of the global "the_gimp" hack to zero in app/gui/... yeah. * app/gui/channels-commands.c * app/gui/edit-commands.c * app/gui/file-commands.c * app/gui/image-commands.c * app/gui/layers-commands.c * app/gui/palettes-commands.c * app/gui/select-commands.c * app/gui/test-commands.c * app/gui/tools-commands.c * app/gui/view-commands.c: use the passed "Gimp" pointer. * app/gui/color-area.[ch] * app/gui/convert-dialog.c * app/gui/dialogs-constructors.c * app/gui/file-new-dialog.[ch] * app/gui/file-open-dialog.[ch] * app/gui/file-save-dialog.[ch] * app/gui/gui.c * app/gui/info-window.[ch] * app/gui/module-browser.[ch] * app/gui/palette-editor.c * app/gui/palette-import-dialog.[ch] * app/gui/paths-dialog.c * app/gui/preferences-dialog.[ch] * app/gui/resize-dialog.[ch] * app/gui/tool-options-dialog.[ch] * app/gui/toolbox.c: pass around lots more "Gimp" and "GimpContext" pointers and don't use "the_gimp" any more. * app/tools/gimptool.h: added a pointer to the corresponding GimpToolInfo object (which in turn has a pointer to a Gimp). * app/tools/tool_manager.[ch]: set the pointer after creating the tool object. Removed tool_manager_get_info_by_tool() as there is a tool->tool_info pointer now. * app/tools/gimpbezierselecttool.c * app/tools/gimpblendtool.c * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpclonetool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpcolorpickertool.c * app/tools/gimpconvolvetool.c * app/tools/gimpcroptool.c * app/tools/gimpcurvestool.c * app/tools/gimpdodgeburntool.c * app/tools/gimpdrawtool.c * app/tools/gimpeditselectiontool.c * app/tools/gimpellipseselecttool.c * app/tools/gimperasertool.c * app/tools/gimpfliptool.c * app/tools/gimphistogramtool.c * app/tools/gimphuesaturationtool.c * app/tools/gimpinktool.c * app/tools/gimplevelstool.c * app/tools/gimpmagnifytool.c * app/tools/gimpmeasuretool.c * app/tools/gimpmovetool.c * app/tools/gimppainttool.c * app/tools/gimppathtool.c * app/tools/gimpperspectivetool.c * app/tools/gimpposterizetool.c * app/tools/gimprectselecttool.c * app/tools/gimprotatetool.c * app/tools/gimpscaletool.c * app/tools/gimpsheartool.c * app/tools/gimptexttool.c * app/tools/gimpthresholdtool.c * app/tools/path_tool.c * app/tools/xinput_airbrush.c: s/GDisplay/GimpDisplay/g. Use tool->tool_info and tool_info->gimp in some places to get rid of using "the_gimp". Removing the remaining ones involves changing the tool options system and is scheduled next... * app/widgets/gimpdnd.c * app/widgets/gimpdocumentview.c: pass a "Gimp" pointer to all file_open_*() functions. * app/gdisplay_color.[ch] * app/gdisplay_color_ui.[ch] * app/image_map.[ch] * app/nav_window.[ch] * app/path.c * app/path_bezier.c * app/path_transform.h * app/qmask.[ch]: s/GDisplay/GimpDisplay/g * tools/pdbgen/pdb/fileops.pdb: load_procs and save_procs are members of the "Gimp" object now. * tools/pdbgen/pdb/plug_in.pdb: use gimp->no_interface, don't include "appenv.h". * app/pdb/fileops_cmds.c * app/pdb/plug_in_cmds.c: regenerated.
2001-10-29 19:47:11 +08:00
if (gimage->gimp->no_interface)
return NULL;
gdisp = g_object_new (GIMP_TYPE_DISPLAY, NULL);
Started to get rid of the gdisplays_foo() functions in 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.
2002-05-09 01:48:24 +08:00
gdisp->ID = gimage->gimp->next_display_ID;
1997-11-25 06:05:25 +08:00
/* refs the image */
2001-11-01 05:20:09 +08:00
gimp_display_connect (gdisp, gimage);
1997-11-25 06:05:25 +08:00
/* FIXME: this needs to go to GimpDisplayShell */
2001-11-01 05:20:09 +08:00
gdisp->scale = scale;
1997-11-25 06:05:25 +08:00
2001-11-01 05:20:09 +08:00
/* create the shell for the image */
gdisp->shell = gimp_display_shell_new (gdisp);
1997-11-25 06:05:25 +08:00
2001-11-10 00:54:56 +08:00
gtk_widget_show (gdisp->shell);
1997-11-25 06:05:25 +08:00
return gdisp;
}
2001-11-01 05:20:09 +08:00
void
gimp_display_delete (GimpDisplay *gdisp)
1997-11-25 06:05:25 +08:00
{
GimpTool *active_tool;
g_return_if_fail (GIMP_IS_DISPLAY (gdisp));
2001-11-01 05:20:09 +08:00
/* remove the display from the list */
Started to get rid of the gdisplays_foo() functions in 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.
2002-05-09 01:48:24 +08:00
gimp_container_remove (gdisp->gimage->gimp->displays,
GIMP_OBJECT (gdisp));
1997-11-25 06:05:25 +08:00
/* stop any active tool */
tool_manager_control_active (gdisp->gimage->gimp, HALT, gdisp);
active_tool = tool_manager_get_active (gdisp->gimage->gimp);
1997-11-25 06:05:25 +08:00
namespace cleanups. 1999-06-21 Michael Natterer <mitschel@cs.tu-berlin.de> * app/context_manager.c: namespace cleanups. * app/commands.[ch] * app/menus.c: moved the "Toggle Selection" menu entry to "View", sprinkled some separators and made the layers/channels/paths popup menus consistent with Tigert's last ops buttons change. * app/fileops.c * app/plug_in.c: check for gdisplay_active() returning NULL in some more places. * app/[all tool related files]: - Turned the ToolAction and ToolState #define's into typedef'ed enums, so the compiler can do some more sanity checking. - Removed one more unused global variable "active_tool_layer". - Removed some #include's from tools.c. - Standardized the individual tools' structure names. - Moved showing/hiding the tool options to separate functions. - Stuff... * app/commands.c * app/disp_callbacks.c * app/gdisplay.c * app/tools.c: fixed the segfaults which happened when the image of one of the tools which have dialogs (levels/posterize/...) was deleted. My approach was to do stricter sanity checking and to set some gdisplay pointers correctly where appropriate, so I can't tell exactly where the bug was. The curves tool now(??) updates on every _second_ display change only, which is really obscure. Finding/changing the display to operate on should definitely be done by connecting to the user context's "display_changed" signal. * app/gimpset.c: emit the "remove" signal _after_ removing the pointer from the set. If this was not a bug but a feature, please let me know, we'll need two signals then.
1999-06-22 06:12:07 +08:00
/* clear out the pointer to this gdisp from the active tool */
if (active_tool && active_tool->gdisp == gdisp)
namespace cleanups. 1999-06-21 Michael Natterer <mitschel@cs.tu-berlin.de> * app/context_manager.c: namespace cleanups. * app/commands.[ch] * app/menus.c: moved the "Toggle Selection" menu entry to "View", sprinkled some separators and made the layers/channels/paths popup menus consistent with Tigert's last ops buttons change. * app/fileops.c * app/plug_in.c: check for gdisplay_active() returning NULL in some more places. * app/[all tool related files]: - Turned the ToolAction and ToolState #define's into typedef'ed enums, so the compiler can do some more sanity checking. - Removed one more unused global variable "active_tool_layer". - Removed some #include's from tools.c. - Standardized the individual tools' structure names. - Moved showing/hiding the tool options to separate functions. - Stuff... * app/commands.c * app/disp_callbacks.c * app/gdisplay.c * app/tools.c: fixed the segfaults which happened when the image of one of the tools which have dialogs (levels/posterize/...) was deleted. My approach was to do stricter sanity checking and to set some gdisplay pointers correctly where appropriate, so I can't tell exactly where the bug was. The curves tool now(??) updates on every _second_ display change only, which is really obscure. Finding/changing the display to operate on should definitely be done by connecting to the user context's "display_changed" signal. * app/gimpset.c: emit the "remove" signal _after_ removing the pointer from the set. If this was not a bug but a feature, please let me know, we'll need two signals then.
1999-06-22 06:12:07 +08:00
{
active_tool->drawable = NULL;
active_tool->gdisp = NULL;
}
/* If this gdisplay was idlerendering at the time when it was deleted,
* deactivate the idlerendering thread before deletion!
*/
if (gdisp->idle_render.idle_id)
{
g_source_remove (gdisp->idle_render.idle_id);
gdisp->idle_render.idle_id = 0;
}
Dirty flag now correct in all cases. Can be displayed in image window Mon Aug 23 10:15:32 EDT 1999 Austin Donnelly <austin@gimp.org> Dirty flag now correct in all cases. Can be displayed in image window title too. See NOTE near gimp_image_dirty() for details. * app/fileops.c: gimp_image_clean_all() after reverting an image. * app/gdisplay.c: register handlers for gimage dirty and clean signals to update image title. New image-title-format expansion: %Dx expands to x if the image is dirty. * app/gdisplay_ops.c: gimage->dirty flags != 0 is the correct condition to test to see if an image is dirty. * app/gimpdrawable.c: gimp_image_dirty() should never be called except from an undo_push_* function. Call undo_push_cantundo() if you want to dirty the image but can't be bothered writing an undo handler (be ashamed of yourself!). * app/gimpimage.c: new gimage signal: clean. Emitted when an undo operation takes place. Gimage changes when either dirty or clean is emitted, so if you need to update previews etc, look for both! Move group_count into gimage structure, since leaving it as a static in undo.c is bad if two undo groups are started on different images at the same time. More changes of gimp_image_dirty() to undo_push_cantundo() (parasite-related, plus layer moves). See the NOTE on dirty counter near gimp_image_dirty() for the full story. gimp_image_dirty() and gimp_image_clean() simplified - counter can go negative. * app/gimpimageP.h: group_count moved from undo.c * app/layers_dialog.c: push undo for layer name change, rather than dirtying the image. * app/undo.c: layer rename undo functions added. undo_push_cantundo() convenience functions added. group_count made per-gimage since everything else is. When blowing away redo stack, make image infinitely dirty if redo info contained file save point. * app/undo.h: added undo_push_layer_rename() and undo_push_cantundo(). * TODO: added idea for undo history window.
1999-08-23 22:34:58 +08:00
2001-11-01 05:20:09 +08:00
/* free the update area lists */
gimp_display_area_list_free (gdisp->update_areas);
gimp_display_area_list_free (gdisp->idle_render.update_areas);
if (gdisp->shell)
{
gtk_widget_destroy (gdisp->shell);
gdisp->shell = NULL;
}
/* unrefs the gimage */
2001-11-01 05:20:09 +08:00
gimp_display_disconnect (gdisp);
g_object_unref (G_OBJECT (gdisp));
1997-11-25 06:05:25 +08:00
}
gint
gimp_display_get_ID (GimpDisplay *gdisp)
{
g_return_val_if_fail (GIMP_IS_DISPLAY (gdisp), -1);
return gdisp->ID;
}
2001-11-01 05:20:09 +08:00
GimpDisplay *
gimp_display_get_by_ID (Gimp *gimp,
gint ID)
1997-11-25 06:05:25 +08:00
{
2001-11-01 05:20:09 +08:00
GimpDisplay *gdisp;
Started to get rid of the gdisplays_foo() functions in 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.
2002-05-09 01:48:24 +08:00
GList *list;
2001-11-01 05:20:09 +08:00
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
Started to get rid of the gdisplays_foo() functions in 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.
2002-05-09 01:48:24 +08:00
for (list = GIMP_LIST (gimp->displays)->list;
list;
list = g_list_next (list))
1997-11-25 06:05:25 +08:00
{
2001-11-01 05:20:09 +08:00
gdisp = (GimpDisplay *) list->data;
if (gdisp->ID == ID)
return gdisp;
1997-11-25 06:05:25 +08:00
}
return NULL;
}
2001-11-01 05:20:09 +08:00
void
gimp_display_reconnect (GimpDisplay *gdisp,
GimpImage *gimage)
1997-11-25 06:05:25 +08:00
{
2001-11-01 05:20:09 +08:00
g_return_if_fail (GIMP_IS_DISPLAY (gdisp));
g_return_if_fail (GIMP_IS_IMAGE (gimage));
if (gdisp->idle_render.idle_id)
1997-11-25 06:05:25 +08:00
{
g_source_remove (gdisp->idle_render.idle_id);
gdisp->idle_render.idle_id = 0;
1997-11-25 06:05:25 +08:00
}
gimp_display_shell_disconnect (GIMP_DISPLAY_SHELL (gdisp->shell));
2001-11-01 05:20:09 +08:00
gimp_display_disconnect (gdisp);
1997-11-25 06:05:25 +08:00
2001-11-01 05:20:09 +08:00
gimp_display_connect (gdisp, gimage);
gimp_display_add_update_area (gdisp,
0, 0,
gdisp->gimage->width,
gdisp->gimage->height);
1997-11-25 06:05:25 +08:00
gimp_display_shell_reconnect (GIMP_DISPLAY_SHELL (gdisp->shell));
2001-11-01 05:20:09 +08:00
}
1997-11-25 06:05:25 +08:00
void
gimp_display_add_update_area (GimpDisplay *gdisp,
gint x,
gint y,
gint w,
gint h)
1997-11-25 06:05:25 +08:00
{
GimpArea *area;
g_return_if_fail (GIMP_IS_DISPLAY (gdisp));
area = gimp_area_new (CLAMP (x, 0, gdisp->gimage->width),
CLAMP (y, 0, gdisp->gimage->height),
CLAMP (x + w, 0, gdisp->gimage->width),
CLAMP (y + h, 0, gdisp->gimage->height));
gdisp->update_areas = gimp_display_area_list_process (gdisp->update_areas,
area);
1997-11-25 06:05:25 +08:00
}
void
gimp_display_flush (GimpDisplay *gdisp)
{
g_return_if_fail (GIMP_IS_DISPLAY (gdisp));
/* Redraw on idle time */
2001-11-01 05:20:09 +08:00
gimp_display_flush_whenever (gdisp, FALSE);
}
void
gimp_display_flush_now (GimpDisplay *gdisp)
{
g_return_if_fail (GIMP_IS_DISPLAY (gdisp));
/* Redraw NOW */
2001-11-01 05:20:09 +08:00
gimp_display_flush_whenever (gdisp, TRUE);
}
/* Force all gdisplays to finish their idlerender projection */
void
gimp_display_finish_draw (GimpDisplay *gdisp)
{
2001-11-01 05:20:09 +08:00
g_return_if_fail (GIMP_IS_DISPLAY (gdisp));
if (gdisp->idle_render.idle_id)
{
g_source_remove (gdisp->idle_render.idle_id);
gdisp->idle_render.idle_id = 0;
while (gimp_display_idlerender_callback (gdisp));
}
2001-11-01 05:20:09 +08:00
}
/* stuff that will go to GimpDisplayShell */
2001-11-01 05:20:09 +08:00
void
gdisplay_transform_coords (GimpDisplay *gdisp,
gint x,
gint y,
gint *nx,
gint *ny,
gboolean use_offsets)
{
GimpDisplayShell *shell;
gdouble scalex;
gdouble scaley;
gint offset_x;
gint offset_y;
2001-11-01 05:20:09 +08:00
g_return_if_fail (GIMP_IS_DISPLAY (gdisp));
g_return_if_fail (nx != NULL);
g_return_if_fail (ny != NULL);
2001-11-01 05:20:09 +08:00
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
2001-11-01 05:20:09 +08:00
/* transform from image coordinates to screen coordinates */
scalex = SCALEFACTOR_X (gdisp);
scaley = SCALEFACTOR_Y (gdisp);
2001-11-01 05:20:09 +08:00
if (use_offsets)
{
2001-11-01 05:20:09 +08:00
gimp_drawable_offsets (gimp_image_active_drawable (gdisp->gimage),
&offset_x, &offset_y);
}
else
{
2001-11-01 05:20:09 +08:00
offset_x = offset_y = 0;
}
app/display/Makefile.am app/display/gimpdisplay-callbacks.[ch] 2001-11-01 Michael Natterer <mitch@gimp.org> * app/display/Makefile.am * app/display/gimpdisplay-callbacks.[ch] * app/display/gimpdisplay-render.[ch] * app/display/gimpdisplay-scale.[ch] * app/display/gimpdisplay-scroll.[ch]: removed and added as gimpdisplayshell-foo.[ch] because they are all methods of the shell. * app/display/gimpdisplay.[ch] * app/display/gimpdisplayshell.[ch]: moved the "offset" and "size" variables from GimpDisplay to GimpDisplayShell. GimpDisplay should know nothing about screen coordinates. The gdisplay_[un]transform_foo() methods are still part of GimpDisplay but will be moved to GimpDisplayShell as soon as the tools' vitrual functions speak in image coordinates instead of GdkEvents. * app/display/gimpdisplayshell-callbacks.[ch]: prefixed all functions with gimp_display_shell_*. Moved some stuff to a "realize" callback File still has to be renamed. * app/display/gimpdisplay-foreach.[ch]: removed gdisplays_shrink_wrap(). * app/gui/menus.c * app/gui/view-commands.[ch] * app/display/gimpdisplayshell-scale.[ch]: implemented "Zoom to Fit Window" function (#57670). * app/nav_window.c * app/display/gimpdisplay-handlers.c * app/display/gimpdisplayshell-render.[ch] * app/display/gimpdisplayshell-scale.[ch] * app/display/gimpdisplayshell-scroll.[ch] * app/gui/colormap-dialog.c * app/gui/gui.c * app/gui/preferences-dialog.c * app/tools/gimpmagnifytool.c * app/tools/gimpmovetool.c * app/widgets/gimppreview.c: changed according to variable and filename changes. * app/tools/tool_manager.c: tool_manager_select_tool(): send the active tool a "HALT" command before selecting the new one. Fixes stale tool dialogs which were there because some other hack was removed (This is IMHO the right place to shut down the active tool). * app/tools/gimpcroptool.c: don't shrink wrap after cropping but let gimprc.allow_resize_windows decide. * app/tools/gimpselectiontool.c: gimage_mask_value() takes image, not screen coordinates. A good example of how braindead it is to pass GdkEvents to tools :-) Fixes incorrect cursor and oper update of the selection tools. * app/tools/gimptransformtool.c * app/undo.c: removed (#if 0 for now) some strange code which did manual exposing of GimpDisplayShell areas. This was definitely a hack and should not be there given the image emits correct "update" signals.
2001-11-02 17:31:21 +08:00
*nx = (gint) (scalex * (x + offset_x) - shell->offset_x);
*ny = (gint) (scaley * (y + offset_y) - shell->offset_y);
app/display/Makefile.am app/display/gimpdisplay-callbacks.[ch] 2001-11-01 Michael Natterer <mitch@gimp.org> * app/display/Makefile.am * app/display/gimpdisplay-callbacks.[ch] * app/display/gimpdisplay-render.[ch] * app/display/gimpdisplay-scale.[ch] * app/display/gimpdisplay-scroll.[ch]: removed and added as gimpdisplayshell-foo.[ch] because they are all methods of the shell. * app/display/gimpdisplay.[ch] * app/display/gimpdisplayshell.[ch]: moved the "offset" and "size" variables from GimpDisplay to GimpDisplayShell. GimpDisplay should know nothing about screen coordinates. The gdisplay_[un]transform_foo() methods are still part of GimpDisplay but will be moved to GimpDisplayShell as soon as the tools' vitrual functions speak in image coordinates instead of GdkEvents. * app/display/gimpdisplayshell-callbacks.[ch]: prefixed all functions with gimp_display_shell_*. Moved some stuff to a "realize" callback File still has to be renamed. * app/display/gimpdisplay-foreach.[ch]: removed gdisplays_shrink_wrap(). * app/gui/menus.c * app/gui/view-commands.[ch] * app/display/gimpdisplayshell-scale.[ch]: implemented "Zoom to Fit Window" function (#57670). * app/nav_window.c * app/display/gimpdisplay-handlers.c * app/display/gimpdisplayshell-render.[ch] * app/display/gimpdisplayshell-scale.[ch] * app/display/gimpdisplayshell-scroll.[ch] * app/gui/colormap-dialog.c * app/gui/gui.c * app/gui/preferences-dialog.c * app/tools/gimpmagnifytool.c * app/tools/gimpmovetool.c * app/widgets/gimppreview.c: changed according to variable and filename changes. * app/tools/tool_manager.c: tool_manager_select_tool(): send the active tool a "HALT" command before selecting the new one. Fixes stale tool dialogs which were there because some other hack was removed (This is IMHO the right place to shut down the active tool). * app/tools/gimpcroptool.c: don't shrink wrap after cropping but let gimprc.allow_resize_windows decide. * app/tools/gimpselectiontool.c: gimage_mask_value() takes image, not screen coordinates. A good example of how braindead it is to pass GdkEvents to tools :-) Fixes incorrect cursor and oper update of the selection tools. * app/tools/gimptransformtool.c * app/undo.c: removed (#if 0 for now) some strange code which did manual exposing of GimpDisplayShell areas. This was definitely a hack and should not be there given the image emits correct "update" signals.
2001-11-02 17:31:21 +08:00
*nx += shell->disp_xoffset;
*ny += shell->disp_yoffset;
}
void
2001-11-01 05:20:09 +08:00
gdisplay_untransform_coords (GimpDisplay *gdisp,
gint x,
gint y,
gint *nx,
gint *ny,
gboolean round,
gboolean use_offsets)
{
2001-11-01 05:20:09 +08:00
GimpDisplayShell *shell;
gdouble scalex;
gdouble scaley;
gint offset_x;
gint offset_y;
2001-11-01 05:20:09 +08:00
g_return_if_fail (GIMP_IS_DISPLAY (gdisp));
g_return_if_fail (nx != NULL);
g_return_if_fail (ny != NULL);
2001-11-01 05:20:09 +08:00
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
app/display/Makefile.am app/display/gimpdisplay-callbacks.[ch] 2001-11-01 Michael Natterer <mitch@gimp.org> * app/display/Makefile.am * app/display/gimpdisplay-callbacks.[ch] * app/display/gimpdisplay-render.[ch] * app/display/gimpdisplay-scale.[ch] * app/display/gimpdisplay-scroll.[ch]: removed and added as gimpdisplayshell-foo.[ch] because they are all methods of the shell. * app/display/gimpdisplay.[ch] * app/display/gimpdisplayshell.[ch]: moved the "offset" and "size" variables from GimpDisplay to GimpDisplayShell. GimpDisplay should know nothing about screen coordinates. The gdisplay_[un]transform_foo() methods are still part of GimpDisplay but will be moved to GimpDisplayShell as soon as the tools' vitrual functions speak in image coordinates instead of GdkEvents. * app/display/gimpdisplayshell-callbacks.[ch]: prefixed all functions with gimp_display_shell_*. Moved some stuff to a "realize" callback File still has to be renamed. * app/display/gimpdisplay-foreach.[ch]: removed gdisplays_shrink_wrap(). * app/gui/menus.c * app/gui/view-commands.[ch] * app/display/gimpdisplayshell-scale.[ch]: implemented "Zoom to Fit Window" function (#57670). * app/nav_window.c * app/display/gimpdisplay-handlers.c * app/display/gimpdisplayshell-render.[ch] * app/display/gimpdisplayshell-scale.[ch] * app/display/gimpdisplayshell-scroll.[ch] * app/gui/colormap-dialog.c * app/gui/gui.c * app/gui/preferences-dialog.c * app/tools/gimpmagnifytool.c * app/tools/gimpmovetool.c * app/widgets/gimppreview.c: changed according to variable and filename changes. * app/tools/tool_manager.c: tool_manager_select_tool(): send the active tool a "HALT" command before selecting the new one. Fixes stale tool dialogs which were there because some other hack was removed (This is IMHO the right place to shut down the active tool). * app/tools/gimpcroptool.c: don't shrink wrap after cropping but let gimprc.allow_resize_windows decide. * app/tools/gimpselectiontool.c: gimage_mask_value() takes image, not screen coordinates. A good example of how braindead it is to pass GdkEvents to tools :-) Fixes incorrect cursor and oper update of the selection tools. * app/tools/gimptransformtool.c * app/undo.c: removed (#if 0 for now) some strange code which did manual exposing of GimpDisplayShell areas. This was definitely a hack and should not be there given the image emits correct "update" signals.
2001-11-02 17:31:21 +08:00
x -= shell->disp_xoffset;
y -= shell->disp_yoffset;
1997-11-25 06:05:25 +08:00
/* transform from screen coordinates to image coordinates */
scalex = SCALEFACTOR_X (gdisp);
scaley = SCALEFACTOR_Y (gdisp);
1997-11-25 06:05:25 +08:00
if (use_offsets)
2001-11-01 05:20:09 +08:00
{
gimp_drawable_offsets (gimp_image_active_drawable (gdisp->gimage),
&offset_x, &offset_y);
}
1997-11-25 06:05:25 +08:00
else
{
offset_x = offset_y = 0;
}
if (round)
{
app/display/Makefile.am app/display/gimpdisplay-callbacks.[ch] 2001-11-01 Michael Natterer <mitch@gimp.org> * app/display/Makefile.am * app/display/gimpdisplay-callbacks.[ch] * app/display/gimpdisplay-render.[ch] * app/display/gimpdisplay-scale.[ch] * app/display/gimpdisplay-scroll.[ch]: removed and added as gimpdisplayshell-foo.[ch] because they are all methods of the shell. * app/display/gimpdisplay.[ch] * app/display/gimpdisplayshell.[ch]: moved the "offset" and "size" variables from GimpDisplay to GimpDisplayShell. GimpDisplay should know nothing about screen coordinates. The gdisplay_[un]transform_foo() methods are still part of GimpDisplay but will be moved to GimpDisplayShell as soon as the tools' vitrual functions speak in image coordinates instead of GdkEvents. * app/display/gimpdisplayshell-callbacks.[ch]: prefixed all functions with gimp_display_shell_*. Moved some stuff to a "realize" callback File still has to be renamed. * app/display/gimpdisplay-foreach.[ch]: removed gdisplays_shrink_wrap(). * app/gui/menus.c * app/gui/view-commands.[ch] * app/display/gimpdisplayshell-scale.[ch]: implemented "Zoom to Fit Window" function (#57670). * app/nav_window.c * app/display/gimpdisplay-handlers.c * app/display/gimpdisplayshell-render.[ch] * app/display/gimpdisplayshell-scale.[ch] * app/display/gimpdisplayshell-scroll.[ch] * app/gui/colormap-dialog.c * app/gui/gui.c * app/gui/preferences-dialog.c * app/tools/gimpmagnifytool.c * app/tools/gimpmovetool.c * app/widgets/gimppreview.c: changed according to variable and filename changes. * app/tools/tool_manager.c: tool_manager_select_tool(): send the active tool a "HALT" command before selecting the new one. Fixes stale tool dialogs which were there because some other hack was removed (This is IMHO the right place to shut down the active tool). * app/tools/gimpcroptool.c: don't shrink wrap after cropping but let gimprc.allow_resize_windows decide. * app/tools/gimpselectiontool.c: gimage_mask_value() takes image, not screen coordinates. A good example of how braindead it is to pass GdkEvents to tools :-) Fixes incorrect cursor and oper update of the selection tools. * app/tools/gimptransformtool.c * app/undo.c: removed (#if 0 for now) some strange code which did manual exposing of GimpDisplayShell areas. This was definitely a hack and should not be there given the image emits correct "update" signals.
2001-11-02 17:31:21 +08:00
*nx = ROUND ((x + shell->offset_x) / scalex - offset_x);
*ny = ROUND ((y + shell->offset_y) / scaley - offset_y);
1997-11-25 06:05:25 +08:00
}
else
{
app/display/Makefile.am app/display/gimpdisplay-callbacks.[ch] 2001-11-01 Michael Natterer <mitch@gimp.org> * app/display/Makefile.am * app/display/gimpdisplay-callbacks.[ch] * app/display/gimpdisplay-render.[ch] * app/display/gimpdisplay-scale.[ch] * app/display/gimpdisplay-scroll.[ch]: removed and added as gimpdisplayshell-foo.[ch] because they are all methods of the shell. * app/display/gimpdisplay.[ch] * app/display/gimpdisplayshell.[ch]: moved the "offset" and "size" variables from GimpDisplay to GimpDisplayShell. GimpDisplay should know nothing about screen coordinates. The gdisplay_[un]transform_foo() methods are still part of GimpDisplay but will be moved to GimpDisplayShell as soon as the tools' vitrual functions speak in image coordinates instead of GdkEvents. * app/display/gimpdisplayshell-callbacks.[ch]: prefixed all functions with gimp_display_shell_*. Moved some stuff to a "realize" callback File still has to be renamed. * app/display/gimpdisplay-foreach.[ch]: removed gdisplays_shrink_wrap(). * app/gui/menus.c * app/gui/view-commands.[ch] * app/display/gimpdisplayshell-scale.[ch]: implemented "Zoom to Fit Window" function (#57670). * app/nav_window.c * app/display/gimpdisplay-handlers.c * app/display/gimpdisplayshell-render.[ch] * app/display/gimpdisplayshell-scale.[ch] * app/display/gimpdisplayshell-scroll.[ch] * app/gui/colormap-dialog.c * app/gui/gui.c * app/gui/preferences-dialog.c * app/tools/gimpmagnifytool.c * app/tools/gimpmovetool.c * app/widgets/gimppreview.c: changed according to variable and filename changes. * app/tools/tool_manager.c: tool_manager_select_tool(): send the active tool a "HALT" command before selecting the new one. Fixes stale tool dialogs which were there because some other hack was removed (This is IMHO the right place to shut down the active tool). * app/tools/gimpcroptool.c: don't shrink wrap after cropping but let gimprc.allow_resize_windows decide. * app/tools/gimpselectiontool.c: gimage_mask_value() takes image, not screen coordinates. A good example of how braindead it is to pass GdkEvents to tools :-) Fixes incorrect cursor and oper update of the selection tools. * app/tools/gimptransformtool.c * app/undo.c: removed (#if 0 for now) some strange code which did manual exposing of GimpDisplayShell areas. This was definitely a hack and should not be there given the image emits correct "update" signals.
2001-11-02 17:31:21 +08:00
*nx = (int) ((x + shell->offset_x) / scalex - offset_x);
*ny = (int) ((y + shell->offset_y) / scaley - offset_y);
1997-11-25 06:05:25 +08:00
}
}
void
gdisplay_transform_coords_f (GimpDisplay *gdisp,
gdouble x,
gdouble y,
gdouble *nx,
gdouble *ny,
gboolean use_offsets)
1997-11-25 06:05:25 +08:00
{
2001-11-01 05:20:09 +08:00
GimpDisplayShell *shell;
gdouble scalex;
gdouble scaley;
gint offset_x;
gint offset_y;
1997-11-25 06:05:25 +08:00
g_return_if_fail (GIMP_IS_DISPLAY (gdisp));
2001-11-01 05:20:09 +08:00
g_return_if_fail (nx != NULL);
g_return_if_fail (ny != NULL);
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
1997-11-25 06:05:25 +08:00
/* transform from gimp coordinates to screen coordinates */
scalex = SCALEFACTOR_X (gdisp);
scaley = SCALEFACTOR_Y (gdisp);
1997-11-25 06:05:25 +08:00
if (use_offsets)
2001-11-01 05:20:09 +08:00
{
gimp_drawable_offsets (gimp_image_active_drawable (gdisp->gimage),
&offset_x, &offset_y);
}
1997-11-25 06:05:25 +08:00
else
{
offset_x = offset_y = 0;
}
app/display/Makefile.am app/display/gimpdisplay-callbacks.[ch] 2001-11-01 Michael Natterer <mitch@gimp.org> * app/display/Makefile.am * app/display/gimpdisplay-callbacks.[ch] * app/display/gimpdisplay-render.[ch] * app/display/gimpdisplay-scale.[ch] * app/display/gimpdisplay-scroll.[ch]: removed and added as gimpdisplayshell-foo.[ch] because they are all methods of the shell. * app/display/gimpdisplay.[ch] * app/display/gimpdisplayshell.[ch]: moved the "offset" and "size" variables from GimpDisplay to GimpDisplayShell. GimpDisplay should know nothing about screen coordinates. The gdisplay_[un]transform_foo() methods are still part of GimpDisplay but will be moved to GimpDisplayShell as soon as the tools' vitrual functions speak in image coordinates instead of GdkEvents. * app/display/gimpdisplayshell-callbacks.[ch]: prefixed all functions with gimp_display_shell_*. Moved some stuff to a "realize" callback File still has to be renamed. * app/display/gimpdisplay-foreach.[ch]: removed gdisplays_shrink_wrap(). * app/gui/menus.c * app/gui/view-commands.[ch] * app/display/gimpdisplayshell-scale.[ch]: implemented "Zoom to Fit Window" function (#57670). * app/nav_window.c * app/display/gimpdisplay-handlers.c * app/display/gimpdisplayshell-render.[ch] * app/display/gimpdisplayshell-scale.[ch] * app/display/gimpdisplayshell-scroll.[ch] * app/gui/colormap-dialog.c * app/gui/gui.c * app/gui/preferences-dialog.c * app/tools/gimpmagnifytool.c * app/tools/gimpmovetool.c * app/widgets/gimppreview.c: changed according to variable and filename changes. * app/tools/tool_manager.c: tool_manager_select_tool(): send the active tool a "HALT" command before selecting the new one. Fixes stale tool dialogs which were there because some other hack was removed (This is IMHO the right place to shut down the active tool). * app/tools/gimpcroptool.c: don't shrink wrap after cropping but let gimprc.allow_resize_windows decide. * app/tools/gimpselectiontool.c: gimage_mask_value() takes image, not screen coordinates. A good example of how braindead it is to pass GdkEvents to tools :-) Fixes incorrect cursor and oper update of the selection tools. * app/tools/gimptransformtool.c * app/undo.c: removed (#if 0 for now) some strange code which did manual exposing of GimpDisplayShell areas. This was definitely a hack and should not be there given the image emits correct "update" signals.
2001-11-02 17:31:21 +08:00
*nx = scalex * (x + offset_x) - shell->offset_x;
*ny = scaley * (y + offset_y) - shell->offset_y;
1997-11-25 06:05:25 +08:00
app/display/Makefile.am app/display/gimpdisplay-callbacks.[ch] 2001-11-01 Michael Natterer <mitch@gimp.org> * app/display/Makefile.am * app/display/gimpdisplay-callbacks.[ch] * app/display/gimpdisplay-render.[ch] * app/display/gimpdisplay-scale.[ch] * app/display/gimpdisplay-scroll.[ch]: removed and added as gimpdisplayshell-foo.[ch] because they are all methods of the shell. * app/display/gimpdisplay.[ch] * app/display/gimpdisplayshell.[ch]: moved the "offset" and "size" variables from GimpDisplay to GimpDisplayShell. GimpDisplay should know nothing about screen coordinates. The gdisplay_[un]transform_foo() methods are still part of GimpDisplay but will be moved to GimpDisplayShell as soon as the tools' vitrual functions speak in image coordinates instead of GdkEvents. * app/display/gimpdisplayshell-callbacks.[ch]: prefixed all functions with gimp_display_shell_*. Moved some stuff to a "realize" callback File still has to be renamed. * app/display/gimpdisplay-foreach.[ch]: removed gdisplays_shrink_wrap(). * app/gui/menus.c * app/gui/view-commands.[ch] * app/display/gimpdisplayshell-scale.[ch]: implemented "Zoom to Fit Window" function (#57670). * app/nav_window.c * app/display/gimpdisplay-handlers.c * app/display/gimpdisplayshell-render.[ch] * app/display/gimpdisplayshell-scale.[ch] * app/display/gimpdisplayshell-scroll.[ch] * app/gui/colormap-dialog.c * app/gui/gui.c * app/gui/preferences-dialog.c * app/tools/gimpmagnifytool.c * app/tools/gimpmovetool.c * app/widgets/gimppreview.c: changed according to variable and filename changes. * app/tools/tool_manager.c: tool_manager_select_tool(): send the active tool a "HALT" command before selecting the new one. Fixes stale tool dialogs which were there because some other hack was removed (This is IMHO the right place to shut down the active tool). * app/tools/gimpcroptool.c: don't shrink wrap after cropping but let gimprc.allow_resize_windows decide. * app/tools/gimpselectiontool.c: gimage_mask_value() takes image, not screen coordinates. A good example of how braindead it is to pass GdkEvents to tools :-) Fixes incorrect cursor and oper update of the selection tools. * app/tools/gimptransformtool.c * app/undo.c: removed (#if 0 for now) some strange code which did manual exposing of GimpDisplayShell areas. This was definitely a hack and should not be there given the image emits correct "update" signals.
2001-11-02 17:31:21 +08:00
*nx += shell->disp_xoffset;
*ny += shell->disp_yoffset;
1997-11-25 06:05:25 +08:00
}
void
gdisplay_untransform_coords_f (GimpDisplay *gdisp,
gdouble x,
gdouble y,
gdouble *nx,
gdouble *ny,
gboolean use_offsets)
1997-11-25 06:05:25 +08:00
{
2001-11-01 05:20:09 +08:00
GimpDisplayShell *shell;
gdouble scalex;
gdouble scaley;
gint offset_x;
gint offset_y;
1997-11-25 06:05:25 +08:00
g_return_if_fail (GIMP_IS_DISPLAY (gdisp));
2001-11-01 05:20:09 +08:00
g_return_if_fail (nx != NULL);
g_return_if_fail (ny != NULL);
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
app/display/Makefile.am app/display/gimpdisplay-callbacks.[ch] 2001-11-01 Michael Natterer <mitch@gimp.org> * app/display/Makefile.am * app/display/gimpdisplay-callbacks.[ch] * app/display/gimpdisplay-render.[ch] * app/display/gimpdisplay-scale.[ch] * app/display/gimpdisplay-scroll.[ch]: removed and added as gimpdisplayshell-foo.[ch] because they are all methods of the shell. * app/display/gimpdisplay.[ch] * app/display/gimpdisplayshell.[ch]: moved the "offset" and "size" variables from GimpDisplay to GimpDisplayShell. GimpDisplay should know nothing about screen coordinates. The gdisplay_[un]transform_foo() methods are still part of GimpDisplay but will be moved to GimpDisplayShell as soon as the tools' vitrual functions speak in image coordinates instead of GdkEvents. * app/display/gimpdisplayshell-callbacks.[ch]: prefixed all functions with gimp_display_shell_*. Moved some stuff to a "realize" callback File still has to be renamed. * app/display/gimpdisplay-foreach.[ch]: removed gdisplays_shrink_wrap(). * app/gui/menus.c * app/gui/view-commands.[ch] * app/display/gimpdisplayshell-scale.[ch]: implemented "Zoom to Fit Window" function (#57670). * app/nav_window.c * app/display/gimpdisplay-handlers.c * app/display/gimpdisplayshell-render.[ch] * app/display/gimpdisplayshell-scale.[ch] * app/display/gimpdisplayshell-scroll.[ch] * app/gui/colormap-dialog.c * app/gui/gui.c * app/gui/preferences-dialog.c * app/tools/gimpmagnifytool.c * app/tools/gimpmovetool.c * app/widgets/gimppreview.c: changed according to variable and filename changes. * app/tools/tool_manager.c: tool_manager_select_tool(): send the active tool a "HALT" command before selecting the new one. Fixes stale tool dialogs which were there because some other hack was removed (This is IMHO the right place to shut down the active tool). * app/tools/gimpcroptool.c: don't shrink wrap after cropping but let gimprc.allow_resize_windows decide. * app/tools/gimpselectiontool.c: gimage_mask_value() takes image, not screen coordinates. A good example of how braindead it is to pass GdkEvents to tools :-) Fixes incorrect cursor and oper update of the selection tools. * app/tools/gimptransformtool.c * app/undo.c: removed (#if 0 for now) some strange code which did manual exposing of GimpDisplayShell areas. This was definitely a hack and should not be there given the image emits correct "update" signals.
2001-11-02 17:31:21 +08:00
x -= shell->disp_xoffset;
y -= shell->disp_yoffset;
1997-11-25 06:05:25 +08:00
/* transform from screen coordinates to gimp coordinates */
scalex = SCALEFACTOR_X (gdisp);
scaley = SCALEFACTOR_Y (gdisp);
1997-11-25 06:05:25 +08:00
if (use_offsets)
2001-11-01 05:20:09 +08:00
{
gimp_drawable_offsets (gimp_image_active_drawable (gdisp->gimage),
&offset_x, &offset_y);
}
1997-11-25 06:05:25 +08:00
else
{
offset_x = offset_y = 0;
}
app/display/Makefile.am app/display/gimpdisplay-callbacks.[ch] 2001-11-01 Michael Natterer <mitch@gimp.org> * app/display/Makefile.am * app/display/gimpdisplay-callbacks.[ch] * app/display/gimpdisplay-render.[ch] * app/display/gimpdisplay-scale.[ch] * app/display/gimpdisplay-scroll.[ch]: removed and added as gimpdisplayshell-foo.[ch] because they are all methods of the shell. * app/display/gimpdisplay.[ch] * app/display/gimpdisplayshell.[ch]: moved the "offset" and "size" variables from GimpDisplay to GimpDisplayShell. GimpDisplay should know nothing about screen coordinates. The gdisplay_[un]transform_foo() methods are still part of GimpDisplay but will be moved to GimpDisplayShell as soon as the tools' vitrual functions speak in image coordinates instead of GdkEvents. * app/display/gimpdisplayshell-callbacks.[ch]: prefixed all functions with gimp_display_shell_*. Moved some stuff to a "realize" callback File still has to be renamed. * app/display/gimpdisplay-foreach.[ch]: removed gdisplays_shrink_wrap(). * app/gui/menus.c * app/gui/view-commands.[ch] * app/display/gimpdisplayshell-scale.[ch]: implemented "Zoom to Fit Window" function (#57670). * app/nav_window.c * app/display/gimpdisplay-handlers.c * app/display/gimpdisplayshell-render.[ch] * app/display/gimpdisplayshell-scale.[ch] * app/display/gimpdisplayshell-scroll.[ch] * app/gui/colormap-dialog.c * app/gui/gui.c * app/gui/preferences-dialog.c * app/tools/gimpmagnifytool.c * app/tools/gimpmovetool.c * app/widgets/gimppreview.c: changed according to variable and filename changes. * app/tools/tool_manager.c: tool_manager_select_tool(): send the active tool a "HALT" command before selecting the new one. Fixes stale tool dialogs which were there because some other hack was removed (This is IMHO the right place to shut down the active tool). * app/tools/gimpcroptool.c: don't shrink wrap after cropping but let gimprc.allow_resize_windows decide. * app/tools/gimpselectiontool.c: gimage_mask_value() takes image, not screen coordinates. A good example of how braindead it is to pass GdkEvents to tools :-) Fixes incorrect cursor and oper update of the selection tools. * app/tools/gimptransformtool.c * app/undo.c: removed (#if 0 for now) some strange code which did manual exposing of GimpDisplayShell areas. This was definitely a hack and should not be there given the image emits correct "update" signals.
2001-11-02 17:31:21 +08:00
*nx = (x + shell->offset_x) / scalex - offset_x;
*ny = (y + shell->offset_y) / scaley - offset_y;
1997-11-25 06:05:25 +08:00
}
/* private functions */
static void
gimp_display_flush_whenever (GimpDisplay *gdisp,
gboolean now)
major cleanup. After being finished, I decided that it needs to be 2001-06-18 Michael Natterer <mitch@gimp.org> * app/nav_window.[ch]: major cleanup. After being finished, I decided that it needs to be factored out to a widget (see below), so like 90% of this file will go away soon. * app/apptypes.h: added opaque NavigationDialog typedef. * app/gdisplay.[ch]: Added gdisplay_selection_visibility() which is called from gdisplays_selection_visibility(). Capitalized the SelectionControl enum values. Cleaned up the GDisplay struct and it's initialisation while i was on it. * app/gimage.c: gimage_size_changed_handler(): removed stuff which is now done by GimpImage itself. * app/scale.c * app/scroll.c: also update the navigation popup, not only the dialog. * app/selection.[ch]: major indentation & cleanup attack. Maybe found the "Selection vanishes" bug (the timeout id was assinged to a gint, not a _guint_). * app/undo.c: s/gimp_image_size_changed/gimp_viweable_size_changed/ * app/core/gimpdrawable.c: invalidate the image's preview from our "invalidate_preview" implementation. This means that the image's preview is invalidated way too often currently, which cries for some general freeze/thaw mechanism on the GimpViewable level. (Note that previews are rendered in the idle loop, so this is not really a major performance impact, it's just ugly). * app/core/gimpimage.[ch]: removed the "size_changed" signal... * app/core/gimpviewable.[ch]: ...and added it here. * app/core/gimplayer.c: invalidate_preview(): always chain up, also if it's a floating selection. * app/gui/info-dialog.[ch] * app/gui/info-window.c: minor cleanups. * app/gui/preferences-dialog.c: no need to invalidate the image after we have invalidated all it's layers. * app/core/gimpimage-mask.c * app/gui/commands.c * app/tools/gimpeditselectiontool.c * app/tools/gimpinktool.c * app/tools/gimpmovetool.c * app/tools/gimppainttool.c: capitalized the SelectionCommand enum values. * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpnavigationpreview.[ch]: new widget. * app/widgets/gimppreview.[ch]: added a non-working non-dot-for-dot mode. Added xres/yres params to the gimp_preview_calc_size() helper function. Cache the "size" value which was passed to the simple function variants (gimp_preview_new() and gimp_preview_set_size()) so we can re-calculate the preview's extents on the underlying viewable's "size_changed" signal and on gimp_preview_set_viewable(). * app/widgets/gimpdrawablepreview.c * app/widgets/gimpimagepreview.c: changed accordingly.
2001-06-18 21:10:03 +08:00
{
/* Flush the items in the displays and updates lists -
* but only if gdisplay has been mapped and exposed
*/
if (! GIMP_DISPLAY_SHELL (gdisp->shell)->select)
{
g_warning ("gimp_display_flush_whenever(): called unrealized");
return;
}
/* First the updates... */
if (now)
major cleanup. After being finished, I decided that it needs to be 2001-06-18 Michael Natterer <mitch@gimp.org> * app/nav_window.[ch]: major cleanup. After being finished, I decided that it needs to be factored out to a widget (see below), so like 90% of this file will go away soon. * app/apptypes.h: added opaque NavigationDialog typedef. * app/gdisplay.[ch]: Added gdisplay_selection_visibility() which is called from gdisplays_selection_visibility(). Capitalized the SelectionControl enum values. Cleaned up the GDisplay struct and it's initialisation while i was on it. * app/gimage.c: gimage_size_changed_handler(): removed stuff which is now done by GimpImage itself. * app/scale.c * app/scroll.c: also update the navigation popup, not only the dialog. * app/selection.[ch]: major indentation & cleanup attack. Maybe found the "Selection vanishes" bug (the timeout id was assinged to a gint, not a _guint_). * app/undo.c: s/gimp_image_size_changed/gimp_viweable_size_changed/ * app/core/gimpdrawable.c: invalidate the image's preview from our "invalidate_preview" implementation. This means that the image's preview is invalidated way too often currently, which cries for some general freeze/thaw mechanism on the GimpViewable level. (Note that previews are rendered in the idle loop, so this is not really a major performance impact, it's just ugly). * app/core/gimpimage.[ch]: removed the "size_changed" signal... * app/core/gimpviewable.[ch]: ...and added it here. * app/core/gimplayer.c: invalidate_preview(): always chain up, also if it's a floating selection. * app/gui/info-dialog.[ch] * app/gui/info-window.c: minor cleanups. * app/gui/preferences-dialog.c: no need to invalidate the image after we have invalidated all it's layers. * app/core/gimpimage-mask.c * app/gui/commands.c * app/tools/gimpeditselectiontool.c * app/tools/gimpinktool.c * app/tools/gimpmovetool.c * app/tools/gimppainttool.c: capitalized the SelectionCommand enum values. * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpnavigationpreview.[ch]: new widget. * app/widgets/gimppreview.[ch]: added a non-working non-dot-for-dot mode. Added xres/yres params to the gimp_preview_calc_size() helper function. Cache the "size" value which was passed to the simple function variants (gimp_preview_new() and gimp_preview_set_size()) so we can re-calculate the preview's extents on the underlying viewable's "size_changed" signal and on gimp_preview_set_viewable(). * app/widgets/gimpdrawablepreview.c * app/widgets/gimpimagepreview.c: changed accordingly.
2001-06-18 21:10:03 +08:00
{
/* Synchronous */
GSList *list;
GimpArea *area;
for (list = gdisp->update_areas; list; list = g_slist_next (list))
major cleanup. After being finished, I decided that it needs to be 2001-06-18 Michael Natterer <mitch@gimp.org> * app/nav_window.[ch]: major cleanup. After being finished, I decided that it needs to be factored out to a widget (see below), so like 90% of this file will go away soon. * app/apptypes.h: added opaque NavigationDialog typedef. * app/gdisplay.[ch]: Added gdisplay_selection_visibility() which is called from gdisplays_selection_visibility(). Capitalized the SelectionControl enum values. Cleaned up the GDisplay struct and it's initialisation while i was on it. * app/gimage.c: gimage_size_changed_handler(): removed stuff which is now done by GimpImage itself. * app/scale.c * app/scroll.c: also update the navigation popup, not only the dialog. * app/selection.[ch]: major indentation & cleanup attack. Maybe found the "Selection vanishes" bug (the timeout id was assinged to a gint, not a _guint_). * app/undo.c: s/gimp_image_size_changed/gimp_viweable_size_changed/ * app/core/gimpdrawable.c: invalidate the image's preview from our "invalidate_preview" implementation. This means that the image's preview is invalidated way too often currently, which cries for some general freeze/thaw mechanism on the GimpViewable level. (Note that previews are rendered in the idle loop, so this is not really a major performance impact, it's just ugly). * app/core/gimpimage.[ch]: removed the "size_changed" signal... * app/core/gimpviewable.[ch]: ...and added it here. * app/core/gimplayer.c: invalidate_preview(): always chain up, also if it's a floating selection. * app/gui/info-dialog.[ch] * app/gui/info-window.c: minor cleanups. * app/gui/preferences-dialog.c: no need to invalidate the image after we have invalidated all it's layers. * app/core/gimpimage-mask.c * app/gui/commands.c * app/tools/gimpeditselectiontool.c * app/tools/gimpinktool.c * app/tools/gimpmovetool.c * app/tools/gimppainttool.c: capitalized the SelectionCommand enum values. * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpnavigationpreview.[ch]: new widget. * app/widgets/gimppreview.[ch]: added a non-working non-dot-for-dot mode. Added xres/yres params to the gimp_preview_calc_size() helper function. Cache the "size" value which was passed to the simple function variants (gimp_preview_new() and gimp_preview_set_size()) so we can re-calculate the preview's extents on the underlying viewable's "size_changed" signal and on gimp_preview_set_viewable(). * app/widgets/gimpdrawablepreview.c * app/widgets/gimpimagepreview.c: changed accordingly.
2001-06-18 21:10:03 +08:00
{
/* Paint the area specified by the GimpArea */
area = (GimpArea *) list->data;
if ((area->x1 != area->x2) && (area->y1 != area->y2))
{
gimp_display_paint_area (gdisp,
area->x1,
area->y1,
(area->x2 - area->x1),
(area->y2 - area->y1));
}
major cleanup. After being finished, I decided that it needs to be 2001-06-18 Michael Natterer <mitch@gimp.org> * app/nav_window.[ch]: major cleanup. After being finished, I decided that it needs to be factored out to a widget (see below), so like 90% of this file will go away soon. * app/apptypes.h: added opaque NavigationDialog typedef. * app/gdisplay.[ch]: Added gdisplay_selection_visibility() which is called from gdisplays_selection_visibility(). Capitalized the SelectionControl enum values. Cleaned up the GDisplay struct and it's initialisation while i was on it. * app/gimage.c: gimage_size_changed_handler(): removed stuff which is now done by GimpImage itself. * app/scale.c * app/scroll.c: also update the navigation popup, not only the dialog. * app/selection.[ch]: major indentation & cleanup attack. Maybe found the "Selection vanishes" bug (the timeout id was assinged to a gint, not a _guint_). * app/undo.c: s/gimp_image_size_changed/gimp_viweable_size_changed/ * app/core/gimpdrawable.c: invalidate the image's preview from our "invalidate_preview" implementation. This means that the image's preview is invalidated way too often currently, which cries for some general freeze/thaw mechanism on the GimpViewable level. (Note that previews are rendered in the idle loop, so this is not really a major performance impact, it's just ugly). * app/core/gimpimage.[ch]: removed the "size_changed" signal... * app/core/gimpviewable.[ch]: ...and added it here. * app/core/gimplayer.c: invalidate_preview(): always chain up, also if it's a floating selection. * app/gui/info-dialog.[ch] * app/gui/info-window.c: minor cleanups. * app/gui/preferences-dialog.c: no need to invalidate the image after we have invalidated all it's layers. * app/core/gimpimage-mask.c * app/gui/commands.c * app/tools/gimpeditselectiontool.c * app/tools/gimpinktool.c * app/tools/gimpmovetool.c * app/tools/gimppainttool.c: capitalized the SelectionCommand enum values. * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpnavigationpreview.[ch]: new widget. * app/widgets/gimppreview.[ch]: added a non-working non-dot-for-dot mode. Added xres/yres params to the gimp_preview_calc_size() helper function. Cache the "size" value which was passed to the simple function variants (gimp_preview_new() and gimp_preview_set_size()) so we can re-calculate the preview's extents on the underlying viewable's "size_changed" signal and on gimp_preview_set_viewable(). * app/widgets/gimpdrawablepreview.c * app/widgets/gimpimagepreview.c: changed accordingly.
2001-06-18 21:10:03 +08:00
}
}
else
{
/* Asynchronous */
if (gdisp->update_areas)
gimp_display_idlerender_init (gdisp);
}
/* Free the update lists */
gdisp->update_areas = gimp_display_area_list_free (gdisp->update_areas);
/* Next the displays... */
gimp_display_shell_flush (GIMP_DISPLAY_SHELL (gdisp->shell));
/* ensure the consistency of the tear-off menus */
if (! now && gimp_context_get_display (gimp_get_user_context
(gdisp->gimage->gimp)) == gdisp)
{
gimp_display_shell_set_menu_sensitivity (GIMP_DISPLAY_SHELL (gdisp->shell),
gdisp->gimage->gimp);
}
}
static void
gimp_display_idlerender_init (GimpDisplay *gdisp)
{
GSList *list;
GimpArea *area, *new_area;
/* We need to merge the IdleRender's and the GimpDisplay's update_areas list
* to keep track of which of the updates have been flushed and hence need
* to be drawn.
*/
for (list = gdisp->update_areas; list; list = g_slist_next (list))
{
area = (GimpArea *) list->data;
new_area = g_new (GimpArea, 1);
memcpy (new_area, area, sizeof (GimpArea));
gdisp->idle_render.update_areas =
gimp_display_area_list_process (gdisp->idle_render.update_areas,
new_area);
}
/* If an idlerender was already running, merge the remainder of its
* unrendered area with the update_areas list, and make it start work
* on the next unrendered area in the list.
*/
if (gdisp->idle_render.idle_id)
{
new_area =
gimp_area_new (gdisp->idle_render.basex,
gdisp->idle_render.y,
gdisp->idle_render.basex + gdisp->idle_render.width,
gdisp->idle_render.y + (gdisp->idle_render.height -
(gdisp->idle_render.y -
gdisp->idle_render.basey)));
gdisp->idle_render.update_areas =
gimp_display_area_list_process (gdisp->idle_render.update_areas,
new_area);
gimp_display_idle_render_next_area (gdisp);
}
else
{
if (gdisp->idle_render.update_areas == NULL)
{
g_warning ("Wanted to start idlerender thread with no update_areas. (+memleak)");
return;
}
gimp_display_idle_render_next_area (gdisp);
gdisp->idle_render.idle_id = g_idle_add_full (G_PRIORITY_LOW,
gimp_display_idlerender_callback,
gdisp,
NULL);
}
/* Caller frees gdisp->update_areas */
}
/* Unless specified otherwise, display re-rendering is organised by
* IdleRender, which amalgamates areas to be re-rendered and breaks
* them into bite-sized chunks which are chewed on in a low- priority
* idle thread. This greatly improves responsiveness for many GIMP
* operations. -- Adam
*/
static gboolean
gimp_display_idlerender_callback (gpointer data)
{
const gint CHUNK_WIDTH = 256;
const gint CHUNK_HEIGHT = 128;
gint workx, worky, workw, workh;
GimpDisplay *gdisp = data;
workw = CHUNK_WIDTH;
workh = CHUNK_HEIGHT;
workx = gdisp->idle_render.x;
worky = gdisp->idle_render.y;
if (workx + workw > gdisp->idle_render.basex + gdisp->idle_render.width)
{
workw = gdisp->idle_render.basex + gdisp->idle_render.width - workx;
}
if (worky + workh > gdisp->idle_render.basey + gdisp->idle_render.height)
{
workh = gdisp->idle_render.basey + gdisp->idle_render.height - worky;
}
gimp_display_paint_area (gdisp, workx, worky, workw, workh);
gimp_display_shell_flush (GIMP_DISPLAY_SHELL (gdisp->shell));
gdisp->idle_render.x += CHUNK_WIDTH;
if (gdisp->idle_render.x >=
gdisp->idle_render.basex + gdisp->idle_render.width)
{
gdisp->idle_render.x = gdisp->idle_render.basex;
gdisp->idle_render.y += CHUNK_HEIGHT;
if (gdisp->idle_render.y >=
gdisp->idle_render.basey + gdisp->idle_render.height)
{
if (! gimp_display_idle_render_next_area (gdisp))
{
/* FINISHED */
gdisp->idle_render.idle_id = 0;
return FALSE;
}
}
}
/* Still work to do. */
return TRUE;
}
static gboolean
gimp_display_idle_render_next_area (GimpDisplay *gdisp)
{
GimpArea *area;
if (! gdisp->idle_render.update_areas)
return FALSE;
area = (GimpArea *) gdisp->idle_render.update_areas->data;
gdisp->idle_render.update_areas =
g_slist_remove (gdisp->idle_render.update_areas, area);
gdisp->idle_render.x = gdisp->idle_render.basex = area->x1;
gdisp->idle_render.y = gdisp->idle_render.basey = area->y1;
gdisp->idle_render.width = area->x2 - area->x1;
gdisp->idle_render.height = area->y2 - area->y1;
g_free (area);
return TRUE;
}
static void
gimp_display_paint_area (GimpDisplay *gdisp,
gint x,
gint y,
gint w,
gint h)
{
GimpDisplayShell *shell;
gint x1, y1, x2, y2;
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
/* Bounds check */
x1 = CLAMP (x, 0, gdisp->gimage->width);
y1 = CLAMP (y, 0, gdisp->gimage->height);
x2 = CLAMP (x + w, 0, gdisp->gimage->width);
y2 = CLAMP (y + h, 0, gdisp->gimage->height);
x = x1;
y = y1;
w = (x2 - x1);
h = (y2 - y1);
/* calculate the extents of the update as limited by what's visible */
gdisplay_untransform_coords (gdisp,
0, 0,
&x1, &y1,
FALSE, FALSE);
gdisplay_untransform_coords (gdisp,
shell->disp_width, shell->disp_height,
&x2, &y2,
FALSE, FALSE);
gimp_image_invalidate (gdisp->gimage, x, y, w, h, x1, y1, x2, y2);
/* display the area */
gdisplay_transform_coords (gdisp, x, y, &x1, &y1, FALSE);
gdisplay_transform_coords (gdisp, x + w, y + h, &x2, &y2, FALSE);
gimp_display_shell_add_expose_area (shell,
x1, y1, (x2 - x1), (y2 - y1));
major cleanup. After being finished, I decided that it needs to be 2001-06-18 Michael Natterer <mitch@gimp.org> * app/nav_window.[ch]: major cleanup. After being finished, I decided that it needs to be factored out to a widget (see below), so like 90% of this file will go away soon. * app/apptypes.h: added opaque NavigationDialog typedef. * app/gdisplay.[ch]: Added gdisplay_selection_visibility() which is called from gdisplays_selection_visibility(). Capitalized the SelectionControl enum values. Cleaned up the GDisplay struct and it's initialisation while i was on it. * app/gimage.c: gimage_size_changed_handler(): removed stuff which is now done by GimpImage itself. * app/scale.c * app/scroll.c: also update the navigation popup, not only the dialog. * app/selection.[ch]: major indentation & cleanup attack. Maybe found the "Selection vanishes" bug (the timeout id was assinged to a gint, not a _guint_). * app/undo.c: s/gimp_image_size_changed/gimp_viweable_size_changed/ * app/core/gimpdrawable.c: invalidate the image's preview from our "invalidate_preview" implementation. This means that the image's preview is invalidated way too often currently, which cries for some general freeze/thaw mechanism on the GimpViewable level. (Note that previews are rendered in the idle loop, so this is not really a major performance impact, it's just ugly). * app/core/gimpimage.[ch]: removed the "size_changed" signal... * app/core/gimpviewable.[ch]: ...and added it here. * app/core/gimplayer.c: invalidate_preview(): always chain up, also if it's a floating selection. * app/gui/info-dialog.[ch] * app/gui/info-window.c: minor cleanups. * app/gui/preferences-dialog.c: no need to invalidate the image after we have invalidated all it's layers. * app/core/gimpimage-mask.c * app/gui/commands.c * app/tools/gimpeditselectiontool.c * app/tools/gimpinktool.c * app/tools/gimpmovetool.c * app/tools/gimppainttool.c: capitalized the SelectionCommand enum values. * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpnavigationpreview.[ch]: new widget. * app/widgets/gimppreview.[ch]: added a non-working non-dot-for-dot mode. Added xres/yres params to the gimp_preview_calc_size() helper function. Cache the "size" value which was passed to the simple function variants (gimp_preview_new() and gimp_preview_set_size()) so we can re-calculate the preview's extents on the underlying viewable's "size_changed" signal and on gimp_preview_set_viewable(). * app/widgets/gimpdrawablepreview.c * app/widgets/gimpimagepreview.c: changed accordingly.
2001-06-18 21:10:03 +08:00
}