gimp/app/display/gimpdisplayshell-callbacks.c

679 lines
21 KiB
C
Raw Normal View History

/* GIMP - The GNU Image Manipulation Program
1997-11-25 06:05:25 +08:00
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software: you can redistribute it and/or modify
1997-11-25 06:05:25 +08:00
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
1997-11-25 06:05:25 +08:00
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
1997-11-25 06:05:25 +08:00
*/
app/Makefile.am app/channel_pvt.h app/drawable_pvt.h app/gdisplayF.h 2000-12-29 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/channel_pvt.h * app/drawable_pvt.h * app/gdisplayF.h * app/gimpdrawableP.h * app/gimpimageP.h * app/layer_pvt.h * app/toolsF.h: removed these files. * app/apptypes.h * tools/pdbgen/enums.pl: added tons of opaque typedefs and enums. * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/brushes.pdb * tools/pdbgen/pdb/channel.pdb * tools/pdbgen/pdb/color.pdb * tools/pdbgen/pdb/convert.pdb * tools/pdbgen/pdb/display.pdb * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/gradients.pdb * tools/pdbgen/pdb/help.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/patterns.pdb * tools/pdbgen/pdb/selection.pdb * tools/pdbgen/pdb/tools.pdb * app/*: chainsaw #include cleanup: - Never (never!!) include stuff in header files except where we need access to structures' contents (like derived objects). - Added prototypes and proper formating in many files. - The #include order in *all* *.c files is as follows: #include "config.h" #include <system stuff> #include <gtk/gtk.h> #include "apptypes.h" #include "gimp stuff" #include "libgimp stuff" #include "libgimp/gimpintl.h" By following this scheme we can easily see a file's dependencies from it's #include's and can grep for the inclusion to find out where a file is used. * tools/pdbgen/app.pl: changed to follow the include scheme above. * libgimp/Makefile.am * libgimp/gimpuitypes.h: new file, included from libgimp/gimpui.h and from app/apptypes.h. * libgimp/gimpcolorbutton.[ch] * libgimp/gimpdialog.[ch] * libgimp/gimphelpui.[ch] * libgimp/gimpparasite.[ch] * libgimp/gimppatheditor.[ch] * libgimp/gimpprotocol.c * libgimp/gimpquerybox.[ch] * libgimp/gimpsizeentry.[ch] * libgimp/gimptypes.h * libgimp/gimpui.h * libgimp/gimpunit.h * libgimp/gimpunitmenu.[ch] * libgimp/gimpwidgets.[ch]: changed accordingly. * plug-ins/FractalExplorer/Dialogs.c * plug-ins/gdyntext/message_window.c * plug-ins/imagemap/imap_default_dialog.c * plug-ins/imagemap/imap_file.c: these files used to include "libgimp/gimpui.h" without including "libgimp/gimp.h". This is no longer possible because the libgimpui headers don't inlcude "libgimp/gimpunit.h" any more.
2000-12-29 23:22:01 +08:00
#include "config.h"
#include <gegl.h>
app/Makefile.am app/channel_pvt.h app/drawable_pvt.h app/gdisplayF.h 2000-12-29 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/channel_pvt.h * app/drawable_pvt.h * app/gdisplayF.h * app/gimpdrawableP.h * app/gimpimageP.h * app/layer_pvt.h * app/toolsF.h: removed these files. * app/apptypes.h * tools/pdbgen/enums.pl: added tons of opaque typedefs and enums. * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/brushes.pdb * tools/pdbgen/pdb/channel.pdb * tools/pdbgen/pdb/color.pdb * tools/pdbgen/pdb/convert.pdb * tools/pdbgen/pdb/display.pdb * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/gradients.pdb * tools/pdbgen/pdb/help.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/patterns.pdb * tools/pdbgen/pdb/selection.pdb * tools/pdbgen/pdb/tools.pdb * app/*: chainsaw #include cleanup: - Never (never!!) include stuff in header files except where we need access to structures' contents (like derived objects). - Added prototypes and proper formating in many files. - The #include order in *all* *.c files is as follows: #include "config.h" #include <system stuff> #include <gtk/gtk.h> #include "apptypes.h" #include "gimp stuff" #include "libgimp stuff" #include "libgimp/gimpintl.h" By following this scheme we can easily see a file's dependencies from it's #include's and can grep for the inclusion to find out where a file is used. * tools/pdbgen/app.pl: changed to follow the include scheme above. * libgimp/Makefile.am * libgimp/gimpuitypes.h: new file, included from libgimp/gimpui.h and from app/apptypes.h. * libgimp/gimpcolorbutton.[ch] * libgimp/gimpdialog.[ch] * libgimp/gimphelpui.[ch] * libgimp/gimpparasite.[ch] * libgimp/gimppatheditor.[ch] * libgimp/gimpprotocol.c * libgimp/gimpquerybox.[ch] * libgimp/gimpsizeentry.[ch] * libgimp/gimptypes.h * libgimp/gimpui.h * libgimp/gimpunit.h * libgimp/gimpunitmenu.[ch] * libgimp/gimpwidgets.[ch]: changed accordingly. * plug-ins/FractalExplorer/Dialogs.c * plug-ins/gdyntext/message_window.c * plug-ins/imagemap/imap_default_dialog.c * plug-ins/imagemap/imap_file.c: these files used to include "libgimp/gimpui.h" without including "libgimp/gimp.h". This is no longer possible because the libgimpui headers don't inlcude "libgimp/gimpunit.h" any more.
2000-12-29 23:22:01 +08:00
#include <gtk/gtk.h>
#include "libgimpmath/gimpmath.h"
#include "libgimpwidgets/gimpwidgets.h"
#include "display-types.h"
Finally landed the new GimpConfig based gimprc parser. It's not finished 2002-11-18 Sven Neumann <sven@gimp.org> Finally landed the new GimpConfig based gimprc parser. It's not finished yet but we need to start somewhere. This release removes the old gimprc.[ch] files. The gimprc format changes slightly, but the changes are minimal. The Preferences dialog is temporarily disabled since it still needs to be ported. If you are are afraid, stay away from CVS for a few days ;-) * app/Makefile.am * app/gimprc.[ch]: removed the old gimprc system. * app/base/Makefile.am * app/base/base-config.[ch]: removed these files in favor of config/gimpbaseconfig.[ch]. * app/core/Makefile.am * app/core/gimpcoreconfig.[ch]: removed these files in favor of config/gimpcoreconfig.[ch]. * app/config/Makefile.am * app/config/config-types.h: moved typedefs into this new file. * app/config/gimpbaseconfig.[ch] * app/config/gimpcoreconfig.[ch] * app/config/gimpdisplayconfig.[ch] * app/config/gimpguiconfig.[ch] * app/config/gimprc.[ch] * app/config/test-config.c: brought into shape for real use. * app/base/base-types.h: include config/config-types.h here. Added a global GimpBaseConfig *base_config variable to ease migration. * app/gui/Makefile.am: temporarily disabled the preferences dialog. * app/app_procs.c * app/undo.c * app/undo_history.c * app/base/base.[ch] * app/base/gimphistogram.c * app/base/pixel-processor.c * app/base/temp-buf.c * app/base/tile-cache.c * app/core/core-types.h * app/core/gimp-documents.c * app/core/gimp.c * app/core/gimpbrush.c * app/core/gimpbrushgenerated.c * app/core/gimpcontext.c * app/core/gimpdrawable-transform.c * app/core/gimpimage-new.c * app/core/gimpimage.c * app/core/gimpimagefile.c * app/core/gimpmodules.c * app/core/gimppattern.c * app/display/Makefile.am * app/display/gimpdisplay-handlers.c * app/display/gimpdisplay.[ch] * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell-handlers.c * app/display/gimpdisplayshell-layer-select.c * app/display/gimpdisplayshell-render.c * app/display/gimpdisplayshell-scale.c * app/display/gimpdisplayshell-scroll.c * app/display/gimpdisplayshell-selection.c * app/display/gimpdisplayshell.[ch] * app/display/gimpnavigationview.c * app/file/file-save.c * app/gui/device-status-dialog.c * app/gui/dialogs-constructors.c * app/gui/file-commands.c * app/gui/file-new-dialog.c * app/gui/file-open-dialog.c * app/gui/file-save-dialog.c * app/gui/gui.c * app/gui/menus.c * app/gui/paths-dialog.c * app/gui/resize-dialog.c * app/gui/session.c * app/gui/test-commands.c * app/gui/tips-dialog.c * app/gui/tips-dialog.h * app/gui/user-install-dialog.c * app/gui/view-commands.c * app/paint/gimppaintcore.c * app/plug-in/plug-in.c * app/plug-in/plug-ins.c * app/tools/gimpbezierselecttool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpcolorpickertool.c * app/tools/gimpcroptool.c * app/tools/gimpeditselectiontool.c * app/tools/gimpfuzzyselecttool.c * app/tools/gimpinktool.c * app/tools/gimpmagnifytool.c * app/tools/gimpmeasuretool.c * app/tools/gimppainttool.c * app/tools/gimppathtool.c * app/tools/gimptexttool.[ch] * app/tools/selection_options.c * app/tools/tools.c * app/tools/transform_options.c * app/widgets/gimphelp.c * app/widgets/gimpitemfactory.c * app/widgets/gimpselectioneditor.c * app/xcf/xcf-load.c * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/gimprc.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/transform_tools.pdb: use the new config system instead of the old gimprc stuff. * etc/gimprc.in * etc/gimprc_user.in: adapted to the new gimprc format. Will update the man-page later... * app/pdb/fileops_cmds.c * app/pdb/gimprc_cmds.c * app/pdb/image_cmds.c * app/pdb/layer_cmds.c * app/pdb/transform_tools_cmds.c * libgimp/gimpgimprc_pdb.c: regenerated.
2002-11-19 04:50:31 +08:00
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"
#include "core/gimpimage.h"
#include "core/gimpimage-quick-mask.h"
Made the tool system work again and integrated it back with the 2001-02-21 Michael Natterer <mitch@gimp.org> Made the tool system work again and integrated it back with the GimpContext. It's a hack between old, new and freshly hacked stuff. There are still lots of warnings but at least we can switch tools again. * app/tools/Makefile.am * app/tools/gimptoolinfo.[ch]: resurrected as real object. The GimpToolInfo objects are derived from GimpData, which gives us the tool icon stuff for free. Also, we need a list of _objects_ which is allocated all the time. All tools are required to have a "register" function which registers themselves with the list of GimpToolInfo objects which is maintained by the tool manager. * app/tools/tool.[ch]: made a real GtkObject with properly named functions out of it. The former "active_tool_control" is of course not the default implementation of the tool's "control" method but a hack _around_ it, so it went to the tool manager. * app/tools/color_picker.[ch] * app/tools/measure.[ch]: ditto. Added "register" functions and "destroy" implementations so the tools go away after use. * app/tools/tool_manager.[ch]: badly hacked at the moment to keep both the list of class structures _and_ the tool info list. * app/tools/tools.c: call the tools' register functions. * app/gimpcontext.[ch]: store a pointer to a GimpToolInfo object as "active_tool" in the context, so we're independent of tools being allocated or not. It's treated just like a brush or pattern now. * app/gimpdnd.[ch]: made tool DND work like all other DND types. * app/devices.[ch]: also here: the tool is just a normal data object now, resulting in removal of lots of code. * app/commands.c * app/context_manager.c: updated the tool select and context stuff to work again. * app/toolbox.c: removed the old pixmap buttons and put GimpPreviews inside the tool buttons. Still needs an own preview type to look nice. * app/disp_callbacks.c * app/about_dialog.c * app/app_procs.c * app/appenums.h * app/apptypes.h * app/gimage.c * app/gimppalette.c * app/gimppreview.c * app/gimprc.c * app/info_window.c * app/menus.c * app/palette_select.h * app/scale.c * app/scroll.c: lots of changes to make it work again.
2001-02-21 20:18:09 +08:00
#include "widgets/gimpcairo-wilber.h"
Switch from GtkItemFactory to GtkUIManager. The migration is almost 2004-04-29 Michael Natterer <mitch@gimp.org> Switch from GtkItemFactory to GtkUIManager. The migration is almost complete, still stuff missing/incomplete, definitely added a bunch of new bugs... * app/actions/*-commands.[ch]: converted all callback from GtkItemFactory callbacks to GtkAction callbacks. * app/actions/debug-actions.c * app/actions/gradient-editor-actions.c * app/actions/help-actions.c * app/actions/plug-in-actions.c * app/actions/qmask-actions.c * app/actions/tool-options-actions.c: various fixes. * app/display/gimpdisplay.[ch] * app/display/gimpdisplayshell-appearance.[ch] * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell.[ch]: move everything from GtkItemFactory to GtkUIManager. * app/gui/dialogs.[ch]: added new function dialogs_get_toolbox(). Needed because the action callbacks don't have a widget parameter and sometimes we need a parent window for showing dialogs. * app/gui/Makefile.am * app/gui/brushes-menu.[ch] * app/gui/buffers-menu.[ch] * app/gui/channels-menu.[ch] * app/gui/colormap-editor-menu.[ch] * app/gui/dialogs-menu.[ch] * app/gui/documents-menu.[ch] * app/gui/error-console-menu.[ch] * app/gui/fonts-menu.[ch] * app/gui/gradient-editor-menu.[ch] * app/gui/gradients-menu.[ch] * app/gui/images-menu.[ch] * app/gui/layers-menu.[ch] * app/gui/palette-editor-menu.[ch] * app/gui/palettes-menu.[ch] * app/gui/patterns-menu.[ch] * app/gui/qmask-menu.[ch] * app/gui/templates-menu.[ch] * app/gui/vectors-menu.[ch]: removed these files. * app/gui/gui.c: create a global UI manager for the image popup menu and the toolbox menubar. * app/gui/menus.[ch]: removed all GtkItemFactory code. * app/gui/image-menu.[ch] * app/gui/toolbox-menu.[ch]: removed everything except the trivial setup_funcs. * app/gui/file-open-menu.c * app/gui/file-save-menu.c * app/gui/tool-options-menu.c: don't use the macros from menus.h any more, they are gone. * app/gui/gui-vtable.c * app/gui/plug-in-menus.[ch]: create/destroy the dynamic plug-in menu entries. * app/tools/gimpimagemaptool.c: s/gimp_item_factory_update/ gimp_ui_manager_update/g * app/widgets/gimpuimanager.[ch]: added API to get an action group by name. * app/widgets/gimpmenufactory.c: don't choke on the item_factory entries being NULL. * app/widgets/gimpactiongroup.c: make sure booleans set using g_object_set() only have TRUE or FALSE values. * app/widgets/gimpcolormapeditor.c * app/widgets/gimpcomponenteditor.c * app/widgets/gimpcontainereditor.[ch] * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainertreeview.c * app/widgets/gimpdockable.[ch] * app/widgets/gimpdocked.[ch] * app/widgets/gimpeditor.[ch] * app/widgets/gimperrorconsole.c * app/widgets/gimpgradienteditor.c * app/widgets/gimpitemtreeview.c * app/widgets/gimppaletteeditor.c * app/widgets/gimptoolbox.c * app/widgets/gimptooloptionseditor.c: removed all GtkItemFactory code and enable the #if 0'ed UI manager stuff. * menus/gradient-editor-menu.xml: fixed typos. * menus/image-menu.xml: duplicate everything so we have both an image menubar and an image popup menu. Badly cries for an XSL processor. * menus/toolbox-menu.xml: added an "Extensions" placeholder.
2004-04-29 20:52:29 +08:00
#include "widgets/gimpuimanager.h"
#include "gimpcanvasitem.h"
#include "gimpdisplay.h"
2001-11-01 05:20:09 +08:00
#include "gimpdisplayshell.h"
#include "gimpdisplayshell-appearance.h"
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
#include "gimpdisplayshell-callbacks.h"
#include "gimpdisplayshell-draw.h"
#include "gimpdisplayshell-render.h"
#include "gimpdisplayshell-scale.h"
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
#include "gimpdisplayshell-scroll.h"
#include "gimpdisplayshell-scrollbars.h"
#include "gimpdisplayshell-selection.h"
#include "gimpdisplayshell-title.h"
#include "gimpdisplayshell-transform.h"
#include "gimpimagewindow.h"
#include "gimpnavigationeditor.h"
#include "git-version.h"
#include "gimp-intl.h"
app/Makefile.am app/channel_pvt.h app/drawable_pvt.h app/gdisplayF.h 2000-12-29 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/channel_pvt.h * app/drawable_pvt.h * app/gdisplayF.h * app/gimpdrawableP.h * app/gimpimageP.h * app/layer_pvt.h * app/toolsF.h: removed these files. * app/apptypes.h * tools/pdbgen/enums.pl: added tons of opaque typedefs and enums. * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/brushes.pdb * tools/pdbgen/pdb/channel.pdb * tools/pdbgen/pdb/color.pdb * tools/pdbgen/pdb/convert.pdb * tools/pdbgen/pdb/display.pdb * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/gradients.pdb * tools/pdbgen/pdb/help.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/patterns.pdb * tools/pdbgen/pdb/selection.pdb * tools/pdbgen/pdb/tools.pdb * app/*: chainsaw #include cleanup: - Never (never!!) include stuff in header files except where we need access to structures' contents (like derived objects). - Added prototypes and proper formating in many files. - The #include order in *all* *.c files is as follows: #include "config.h" #include <system stuff> #include <gtk/gtk.h> #include "apptypes.h" #include "gimp stuff" #include "libgimp stuff" #include "libgimp/gimpintl.h" By following this scheme we can easily see a file's dependencies from it's #include's and can grep for the inclusion to find out where a file is used. * tools/pdbgen/app.pl: changed to follow the include scheme above. * libgimp/Makefile.am * libgimp/gimpuitypes.h: new file, included from libgimp/gimpui.h and from app/apptypes.h. * libgimp/gimpcolorbutton.[ch] * libgimp/gimpdialog.[ch] * libgimp/gimphelpui.[ch] * libgimp/gimpparasite.[ch] * libgimp/gimppatheditor.[ch] * libgimp/gimpprotocol.c * libgimp/gimpquerybox.[ch] * libgimp/gimpsizeentry.[ch] * libgimp/gimptypes.h * libgimp/gimpui.h * libgimp/gimpunit.h * libgimp/gimpunitmenu.[ch] * libgimp/gimpwidgets.[ch]: changed accordingly. * plug-ins/FractalExplorer/Dialogs.c * plug-ins/gdyntext/message_window.c * plug-ins/imagemap/imap_default_dialog.c * plug-ins/imagemap/imap_file.c: these files used to include "libgimp/gimpui.h" without including "libgimp/gimp.h". This is no longer possible because the libgimpui headers don't inlcude "libgimp/gimpunit.h" any more.
2000-12-29 23:22:01 +08:00
/* local function prototypes */
static void gimp_display_shell_vadjustment_changed (GtkAdjustment *adjustment,
GimpDisplayShell *shell);
static void gimp_display_shell_hadjustment_changed (GtkAdjustment *adjustment,
GimpDisplayShell *shell);
static gboolean gimp_display_shell_vscrollbar_change_value (GtkRange *range,
GtkScrollType scroll,
gdouble value,
GimpDisplayShell *shell);
static gboolean gimp_display_shell_hscrollbar_change_value (GtkRange *range,
GtkScrollType scroll,
gdouble value,
GimpDisplayShell *shell);
static void gimp_display_shell_canvas_draw_image (GimpDisplayShell *shell,
cairo_t *cr);
static void gimp_display_shell_canvas_draw_drop_zone (GimpDisplayShell *shell,
cairo_t *cr);
/* public functions */
updated. 2001-02-24 Michael Natterer <mitch@gimp.org> * TODO.xml: updated. * app/appenums.h * app/apptypes.h: prefixed the cursor stuff with "Gimp", added the new stock tool cursor enum. Removed the old ToolType enum. * app/cursorutil.[ch] * app/gdisplay.[ch]: removed the old ToolType enum and prefixed the functions with "gimp_". Also stripped all "toggle cursor" stuff from the cursor code, so the new API is easier and not depending on the tool system. All existing tool cursors can be used via the new stock tool cursor enum, so no tool has to fiddle around with bitmap cursors. There will be an cursorutil function for registering stock tool cursor types on the fly. * app/disp_callbacks.c * app/scroll.[ch]: moved the display scrollbar callbacks from scroll.[ch] to disp_callbacks.c. Removed some crap from scroll.h * app/tools/tool.[ch]: removed the BitmapCursor pointers from the tool class struct and add cursor and toggle cursor IDs to the GimpTool struct. Work in progress. * app/dialog_handler.c * app/tools/bezier_select.c * app/tools/blend.c * app/tools/bucket_fill.c * app/tools/by_color_select.c * app/tools/clone.c * app/tools/color_picker.c * app/tools/convolve.c * app/tools/crop.c * app/tools/dodgeburn.c * app/tools/edit_selection.c * app/tools/ellipse_select.c * app/tools/flip_tool.c * app/tools/free_select.c * app/tools/fuzzy_select.c * app/tools/ink.c * app/tools/iscissors.c * app/tools/magnify.c * app/tools/measure.c * app/tools/move.c * app/tools/paint_core.[ch] * app/tools/perspective_tool.c * app/tools/rect_select.c * app/tools/rotate_tool.c * app/tools/scale_tool.c * app/tools/shear_tool.c * app/tools/text_tool.c * app/tools/transform_core.[ch]: changed accordingly. Did this "blind" for most tools because they don't compile. The changes are minimal, so there should be no conflicts.
2001-02-25 03:29:47 +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
void
gimp_display_shell_canvas_realize (GtkWidget *canvas,
GimpDisplayShell *shell)
{
GimpCanvasPaddingMode padding_mode;
GimpRGB padding_color;
GtkAllocation allocation;
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
gtk_widget_grab_focus (canvas);
2001-11-10 00:54:56 +08:00
gimp_display_shell_get_padding (shell, &padding_mode, &padding_color);
gimp_display_shell_set_padding (shell, padding_mode, &padding_color);
gtk_widget_get_allocation (canvas, &allocation);
gimp_display_shell_title_update (shell);
2001-11-10 00:54:56 +08:00
shell->disp_width = allocation.width;
shell->disp_height = allocation.height;
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
gimp_display_shell_render_set_scale (
shell,
gdk_window_get_scale_factor (
gtk_widget_get_window (gtk_widget_get_toplevel (canvas))));
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
/* set up the scrollbar observers */
g_signal_connect (shell->hsbdata, "value-changed",
G_CALLBACK (gimp_display_shell_hadjustment_changed),
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
shell);
g_signal_connect (shell->vsbdata, "value-changed",
G_CALLBACK (gimp_display_shell_vadjustment_changed),
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
shell);
g_signal_connect (shell->hsb, "change-value",
G_CALLBACK (gimp_display_shell_hscrollbar_change_value),
shell);
g_signal_connect (shell->vsb, "change-value",
G_CALLBACK (gimp_display_shell_vscrollbar_change_value),
shell);
CPPFLAGS: added -DGTK_DISABLE_DEPRECATED 2002-01-25 Michael Natterer <mitch@gimp.org> * configure.in: CPPFLAGS: added -DGTK_DISABLE_DEPRECATED * libgimpwidgets/gimpdialog.c: still use the deprecated gtk_window_set_policy() but spit out a #warning. * app/widgets/widgets-types.h * app/widgets/gimpitemfactory.[ch]: made it a GtkItemFactory subclass. This way we can reproduce the effect of gtk_item_factory_get_from_path() which is deprectated for good reasons. For GIMP, using it its perfectly OK since we only have one item factory per "<prefix>". * app/widgets/gimpbrushfactoryview.[ch] * app/widgets/gimpbufferview.[ch] * app/widgets/gimpcontainereditor.[ch] * app/widgets/gimpdatafactoryview.[ch] * app/widgets/gimpdialogfactory.[ch] * app/widgets/gimpdock.c * app/widgets/gimpdockbook.c * app/widgets/gimpdocumentview.[ch] * app/widgets/gimpdrawablelistview.[ch] * app/widgets/gimppreview.c * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell.[ch]: pass around GimpItemFactory pointers instead of "const gchar *" item factory identifiers. Replaced gtk_window_set_policy() by gtk_window_set_resizable() and other recommended stuff. * app/gui/about-dialog.c * app/gui/dialogs-constructors.c * app/gui/dialogs.c * app/gui/file-open-dialog.c * app/gui/file-save-dialog.c * app/gui/gradient-editor.c * app/gui/menus.c * app/gui/offset-dialog.c * app/gui/splash.c * app/gui/tips-dialog.c * app/gui/toolbox.c: lots of s/gtk_item_factory_from_path/gimp_item_factory_from_path/, gtk_window_set_policy() replacements, misc fixes. * plug-ins/gdyntext/charmap_window.c * plug-ins/gdyntext/gdyntext_ui.c * plug-ins/gdyntext/message_window.c * plug-ins/imagemap/imap_main.c: replaced gtk_window_set_policy().
2002-01-26 02:34:33 +08:00
/* allow shrinking */
gtk_widget_set_size_request (GTK_WIDGET (shell), 0, 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
}
typedef struct
{
GimpDisplayShell *shell;
gint prev_width;
gint prev_height;
} TickClosure;
static gboolean
gimp_display_shell_canvas_tick (GtkWidget *widget,
GdkFrameClock *frame_clock,
TickClosure *tick)
build display/ before tools/. 2001-11-08 Michael Natterer <mitch@gimp.org> * app/Makefile.am: build display/ before tools/. * app/devices.c: devices_check_change(): added all events which have a GdkDevice pointer. * app/gimpprogress.c: include "display-types.h" instead of "core-types.h". * app/core/Makefile.am * app/core/gimpdrawable-bucket-fill.[ch]: new files: the bucket_fill stuff taken from tools/gimpbucketfilltool.[ch]. * app/core/core-types.h: added "BucketFillMode". * app/core/gimpimage-mask-select.[ch]: cleanup. * app/core/gimpmarshal.list: added more marshallers for GimpTool's new signal signatures. * app/core/gimpmarshal.[ch]: regenerated. * app/display/Makefile.am * app/display/gimpdisplayshell-dnd.[ch] * app/display/gimpdisplayshell-layer-select.[ch]: new files: the canvas drop callbacks from gimpdisplayshell-callbacks.[ch] and the stuff formerly knows as gui/layer-select.[ch]. * app/display/gimpdisplay.h: don't include "gui/gui-types.h". * app/display/gximage.c: include "display-types.h". * app/display/gimpdisplay-foreach.c * app/display/gimpdisplayshell.[ch]: call gdsplay_delete(), don't destroy the shell widget. * app/gui/Makefile.am * app/gui/layer-select.[ch]: removed. * app/gui/gradients-commands.c: fixed "Save as POV" fprintf()s. * app/gui/preferences-dialog.c: removed the layer_select stuff because it is useless with the new preview system. * app/gui/tool-options-dialog.c: send the correct data to the close_callback. * app/gui/tools-commands.c: changed to follow the new gimp_tool_initialize() semantics (see below). Tool & canvas event handling chainsawing: * app/tools/tools-types.h: new struct GimpCoords which contains x, y, pressure, tilt etc. * app/display/gimpdisplayshell-callbacks.[ch]: added utility functions which transparently retreive the current event's GimpCoords or take it from the device directly if the event has none. Pass GimpCoords _in_image_coordinates_ to all tool functions. Most important: don't pass GdkEvents and display coordinates to tools any more. * app/tools/gimptool.[ch]: changed virtual functions to take GimpCoords, time and state separately instead of GdkEvents. * app/tools/gimpbezierselecttool.c * app/tools/gimpblendtool.c * app/tools/gimpbucketfilltool.[ch] * app/tools/gimpbycolorselecttool.c * app/tools/gimpclonetool.c * app/tools/gimpcolorpickertool.c * app/tools/gimpconvolvetool.c * app/tools/gimpcroptool.[ch] * app/tools/gimpcurvestool.c * app/tools/gimpdodgeburntool.c * app/tools/gimpdrawtool.c * app/tools/gimpeditselectiontool.[ch] * app/tools/gimperasertool.c * app/tools/gimpfliptool.c * app/tools/gimpfreeselecttool.[ch] * app/tools/gimpfuzzyselecttool.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/gimppathtool.[ch] * app/tools/gimprectselecttool.c * app/tools/gimprotatetool.c * app/tools/gimpselectiontool.[ch] * app/tools/gimpsmudgetool.c * app/tools/gimptexttool.c * app/tools/gimptransformtool.[ch] * app/tools/path_tool.[ch] * app/tools/selection_options.c: tons and tons of changes: - changed to use the new virtual function parameters. - removed zillions of gdisplay_untransform_coords(). - get the active drawable's offsets manually in many cases. (questionable, but IMHO ok because it's obvious and not simply a "TRUE" passed to some function) - reordered some functions to be consistent across tools. - some tools had to be changed to work on image coords, not display ones (esp. crop). - fixed strange rotate tool behaviour which should be backported to stable. - some stuff i came across. - indentation and other paranoia. - rounding of coordinated may be broken in some tools. - new bugs guaranteed. * app/tools/tool_manager.[ch]: new semantic of tool_manager_initialize_active() (looked at the places where it was used from and put common code together). Should be a bit better now :) * app/tools/gimpblendtool.c * app/tools/transform_options.c: use the new GTK+ feature that a widget (toggle button) can be a frame's title for this tools' tool options. * app/widgets/widgets-types.h: stuff. * themes/Default/gtkrc: s/GtkDialog/GimpDialog/. * tools/pdbgen/Makefile.am: don't scan tools/gimpbucketfilltool.h any more. * tools/pdbgen/enums.pl: regenerated. * tools/pdbgen/pdb/tools.pdb: changed bucket_fill wrapper. * app/pdb/tools_cmds.c: regenerated.
2001-11-09 03:14:51 +08:00
{
GimpDisplayShell *shell = tick->shell;
GtkAllocation allocation;
gtk_widget_get_allocation (widget, &allocation);
if ((tick->prev_width != allocation.width) ||
(tick->prev_height != allocation.height))
{
if (shell->zoom_on_resize &&
tick->prev_width > 64 &&
tick->prev_height > 64 &&
allocation.width > 64 &&
allocation.height > 64)
{
gdouble scale = gimp_zoom_model_get_factor (shell->zoom);
gint offset_x;
gint offset_y;
/* FIXME: The code is a bit of a mess */
/* multiply the zoom_factor with the ratio of the new and
* old canvas diagonals
*/
scale *= (sqrt (SQR (allocation.width) +
SQR (allocation.height)) /
sqrt (SQR (tick->prev_width) +
SQR (tick->prev_height)));
offset_x = UNSCALEX (shell, shell->offset_x);
offset_y = UNSCALEX (shell, shell->offset_y);
gimp_zoom_model_zoom (shell->zoom, GIMP_ZOOM_TO, scale);
shell->offset_x = SCALEX (shell, offset_x);
shell->offset_y = SCALEY (shell, offset_y);
}
/* When we size-allocate due to resize of the top level window,
* we want some additional logic. Don't apply it on
* zoom_on_resize though.
*/
if (shell->size_allocate_from_configure_event &&
! shell->zoom_on_resize)
{
gboolean center_horizontally;
gboolean center_vertically;
gint target_offset_x;
gint target_offset_y;
gint sw;
gint sh;
gimp_display_shell_scale_get_image_size (shell, &sw, &sh);
center_horizontally = sw <= shell->disp_width;
center_vertically = sh <= shell->disp_height;
if (! gimp_display_shell_get_infinite_canvas (shell))
{
gimp_display_shell_scroll_center_image (shell,
center_horizontally,
center_vertically);
}
else
{
gimp_display_shell_scroll_center_content (shell,
center_horizontally,
center_vertically);
}
/* This is basically the best we can do before we get an
* API for storing the image offset at the start of an
* image window resize using the mouse
*/
target_offset_x = shell->offset_x;
target_offset_y = shell->offset_y;
if (! center_horizontally)
{
target_offset_x = MAX (shell->offset_x, 0);
}
if (! center_vertically)
{
target_offset_y = MAX (shell->offset_y, 0);
}
gimp_display_shell_scroll_set_offset (shell,
target_offset_x,
target_offset_y);
}
gimp_display_shell_scroll_clamp_and_update (shell);
gimp_display_shell_scaled (shell);
shell->size_allocate_from_configure_event = FALSE;
}
if (shell->size_allocate_center_image)
{
gimp_display_shell_scroll_center_image (shell, TRUE, TRUE);
shell->size_allocate_center_image = FALSE;
}
/* undo size request from gimp_display_shell_constructed() */
gtk_widget_set_size_request (widget, -1, -1);
g_free (tick);
return G_SOURCE_REMOVE;
}
void
gimp_display_shell_canvas_size_allocate (GtkWidget *widget,
GtkAllocation *allocation,
GimpDisplayShell *shell)
{
TickClosure *tick;
/* are we in destruction? */
if (! shell->display || ! gimp_display_get_shell (shell->display))
return;
tick = g_new0 (TickClosure, 1);
tick->shell = shell;
tick->prev_width = shell->disp_width;
tick->prev_height = shell->disp_height;
if (shell->disp_width != allocation->width ||
shell->disp_height != allocation->height)
{
g_clear_pointer (&shell->render_cache, cairo_surface_destroy);
gimp_display_shell_render_invalidate_full (shell);
shell->disp_width = allocation->width;
shell->disp_height = allocation->height;
}
gtk_widget_add_tick_callback (widget,
(GtkTickCallback) gimp_display_shell_canvas_tick,
tick, NULL);
build display/ before tools/. 2001-11-08 Michael Natterer <mitch@gimp.org> * app/Makefile.am: build display/ before tools/. * app/devices.c: devices_check_change(): added all events which have a GdkDevice pointer. * app/gimpprogress.c: include "display-types.h" instead of "core-types.h". * app/core/Makefile.am * app/core/gimpdrawable-bucket-fill.[ch]: new files: the bucket_fill stuff taken from tools/gimpbucketfilltool.[ch]. * app/core/core-types.h: added "BucketFillMode". * app/core/gimpimage-mask-select.[ch]: cleanup. * app/core/gimpmarshal.list: added more marshallers for GimpTool's new signal signatures. * app/core/gimpmarshal.[ch]: regenerated. * app/display/Makefile.am * app/display/gimpdisplayshell-dnd.[ch] * app/display/gimpdisplayshell-layer-select.[ch]: new files: the canvas drop callbacks from gimpdisplayshell-callbacks.[ch] and the stuff formerly knows as gui/layer-select.[ch]. * app/display/gimpdisplay.h: don't include "gui/gui-types.h". * app/display/gximage.c: include "display-types.h". * app/display/gimpdisplay-foreach.c * app/display/gimpdisplayshell.[ch]: call gdsplay_delete(), don't destroy the shell widget. * app/gui/Makefile.am * app/gui/layer-select.[ch]: removed. * app/gui/gradients-commands.c: fixed "Save as POV" fprintf()s. * app/gui/preferences-dialog.c: removed the layer_select stuff because it is useless with the new preview system. * app/gui/tool-options-dialog.c: send the correct data to the close_callback. * app/gui/tools-commands.c: changed to follow the new gimp_tool_initialize() semantics (see below). Tool & canvas event handling chainsawing: * app/tools/tools-types.h: new struct GimpCoords which contains x, y, pressure, tilt etc. * app/display/gimpdisplayshell-callbacks.[ch]: added utility functions which transparently retreive the current event's GimpCoords or take it from the device directly if the event has none. Pass GimpCoords _in_image_coordinates_ to all tool functions. Most important: don't pass GdkEvents and display coordinates to tools any more. * app/tools/gimptool.[ch]: changed virtual functions to take GimpCoords, time and state separately instead of GdkEvents. * app/tools/gimpbezierselecttool.c * app/tools/gimpblendtool.c * app/tools/gimpbucketfilltool.[ch] * app/tools/gimpbycolorselecttool.c * app/tools/gimpclonetool.c * app/tools/gimpcolorpickertool.c * app/tools/gimpconvolvetool.c * app/tools/gimpcroptool.[ch] * app/tools/gimpcurvestool.c * app/tools/gimpdodgeburntool.c * app/tools/gimpdrawtool.c * app/tools/gimpeditselectiontool.[ch] * app/tools/gimperasertool.c * app/tools/gimpfliptool.c * app/tools/gimpfreeselecttool.[ch] * app/tools/gimpfuzzyselecttool.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/gimppathtool.[ch] * app/tools/gimprectselecttool.c * app/tools/gimprotatetool.c * app/tools/gimpselectiontool.[ch] * app/tools/gimpsmudgetool.c * app/tools/gimptexttool.c * app/tools/gimptransformtool.[ch] * app/tools/path_tool.[ch] * app/tools/selection_options.c: tons and tons of changes: - changed to use the new virtual function parameters. - removed zillions of gdisplay_untransform_coords(). - get the active drawable's offsets manually in many cases. (questionable, but IMHO ok because it's obvious and not simply a "TRUE" passed to some function) - reordered some functions to be consistent across tools. - some tools had to be changed to work on image coords, not display ones (esp. crop). - fixed strange rotate tool behaviour which should be backported to stable. - some stuff i came across. - indentation and other paranoia. - rounding of coordinated may be broken in some tools. - new bugs guaranteed. * app/tools/tool_manager.[ch]: new semantic of tool_manager_initialize_active() (looked at the places where it was used from and put common code together). Should be a bit better now :) * app/tools/gimpblendtool.c * app/tools/transform_options.c: use the new GTK+ feature that a widget (toggle button) can be a frame's title for this tools' tool options. * app/widgets/widgets-types.h: stuff. * themes/Default/gtkrc: s/GtkDialog/GimpDialog/. * tools/pdbgen/Makefile.am: don't scan tools/gimpbucketfilltool.h any more. * tools/pdbgen/enums.pl: regenerated. * tools/pdbgen/pdb/tools.pdb: changed bucket_fill wrapper. * app/pdb/tools_cmds.c: regenerated.
2001-11-09 03:14:51 +08:00
}
gboolean
gimp_display_shell_canvas_draw (GtkWidget *widget,
cairo_t *cr,
GimpDisplayShell *shell)
build display/ before tools/. 2001-11-08 Michael Natterer <mitch@gimp.org> * app/Makefile.am: build display/ before tools/. * app/devices.c: devices_check_change(): added all events which have a GdkDevice pointer. * app/gimpprogress.c: include "display-types.h" instead of "core-types.h". * app/core/Makefile.am * app/core/gimpdrawable-bucket-fill.[ch]: new files: the bucket_fill stuff taken from tools/gimpbucketfilltool.[ch]. * app/core/core-types.h: added "BucketFillMode". * app/core/gimpimage-mask-select.[ch]: cleanup. * app/core/gimpmarshal.list: added more marshallers for GimpTool's new signal signatures. * app/core/gimpmarshal.[ch]: regenerated. * app/display/Makefile.am * app/display/gimpdisplayshell-dnd.[ch] * app/display/gimpdisplayshell-layer-select.[ch]: new files: the canvas drop callbacks from gimpdisplayshell-callbacks.[ch] and the stuff formerly knows as gui/layer-select.[ch]. * app/display/gimpdisplay.h: don't include "gui/gui-types.h". * app/display/gximage.c: include "display-types.h". * app/display/gimpdisplay-foreach.c * app/display/gimpdisplayshell.[ch]: call gdsplay_delete(), don't destroy the shell widget. * app/gui/Makefile.am * app/gui/layer-select.[ch]: removed. * app/gui/gradients-commands.c: fixed "Save as POV" fprintf()s. * app/gui/preferences-dialog.c: removed the layer_select stuff because it is useless with the new preview system. * app/gui/tool-options-dialog.c: send the correct data to the close_callback. * app/gui/tools-commands.c: changed to follow the new gimp_tool_initialize() semantics (see below). Tool & canvas event handling chainsawing: * app/tools/tools-types.h: new struct GimpCoords which contains x, y, pressure, tilt etc. * app/display/gimpdisplayshell-callbacks.[ch]: added utility functions which transparently retreive the current event's GimpCoords or take it from the device directly if the event has none. Pass GimpCoords _in_image_coordinates_ to all tool functions. Most important: don't pass GdkEvents and display coordinates to tools any more. * app/tools/gimptool.[ch]: changed virtual functions to take GimpCoords, time and state separately instead of GdkEvents. * app/tools/gimpbezierselecttool.c * app/tools/gimpblendtool.c * app/tools/gimpbucketfilltool.[ch] * app/tools/gimpbycolorselecttool.c * app/tools/gimpclonetool.c * app/tools/gimpcolorpickertool.c * app/tools/gimpconvolvetool.c * app/tools/gimpcroptool.[ch] * app/tools/gimpcurvestool.c * app/tools/gimpdodgeburntool.c * app/tools/gimpdrawtool.c * app/tools/gimpeditselectiontool.[ch] * app/tools/gimperasertool.c * app/tools/gimpfliptool.c * app/tools/gimpfreeselecttool.[ch] * app/tools/gimpfuzzyselecttool.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/gimppathtool.[ch] * app/tools/gimprectselecttool.c * app/tools/gimprotatetool.c * app/tools/gimpselectiontool.[ch] * app/tools/gimpsmudgetool.c * app/tools/gimptexttool.c * app/tools/gimptransformtool.[ch] * app/tools/path_tool.[ch] * app/tools/selection_options.c: tons and tons of changes: - changed to use the new virtual function parameters. - removed zillions of gdisplay_untransform_coords(). - get the active drawable's offsets manually in many cases. (questionable, but IMHO ok because it's obvious and not simply a "TRUE" passed to some function) - reordered some functions to be consistent across tools. - some tools had to be changed to work on image coords, not display ones (esp. crop). - fixed strange rotate tool behaviour which should be backported to stable. - some stuff i came across. - indentation and other paranoia. - rounding of coordinated may be broken in some tools. - new bugs guaranteed. * app/tools/tool_manager.[ch]: new semantic of tool_manager_initialize_active() (looked at the places where it was used from and put common code together). Should be a bit better now :) * app/tools/gimpblendtool.c * app/tools/transform_options.c: use the new GTK+ feature that a widget (toggle button) can be a frame's title for this tools' tool options. * app/widgets/widgets-types.h: stuff. * themes/Default/gtkrc: s/GtkDialog/GimpDialog/. * tools/pdbgen/Makefile.am: don't scan tools/gimpbucketfilltool.h any more. * tools/pdbgen/enums.pl: regenerated. * tools/pdbgen/pdb/tools.pdb: changed bucket_fill wrapper. * app/pdb/tools_cmds.c: regenerated.
2001-11-09 03:14:51 +08:00
{
/* are we in destruction? */
if (! shell->display || ! gimp_display_get_shell (shell->display))
return TRUE;
First draft of the "no image open" window, which is implemented as a 2008-03-18 Michael Natterer <mitch@gimp.org> First draft of the "no image open" window, which is implemented as a display without image (a view with NULL model). Didn't change the display's appearance yet so I can first make sure the display without image works properly in all details before hiding these details. * app/core/gimp-gui.[ch]: add "gimp" parameter to display_create() and allow "image" to be NULL. * app/core/gimpcontext.c (gimp_context_real_set_display): a display's image can be NULL now. * app/display/gimpdisplay.[ch]: add Gimp and GimpDisplayConfig members. Add Gimp parameter to gimp_display_shell_new(). Changed gimp_display_reconnect() to gimp_display_set_image() and allow to set a NULL image. * app/gui/gui-vtable.c (gui_display_create): if there is a single display without an image, call gimp_display_set_image() on that display instead of creating a new one. * app/display/gimpdisplayshell-close.c: if the last display is closed, don't close it but make it empty. Factored out that code to gimp_display_shell_really_close(). * app/display/gimpdisplayshell-dnd.c: when dropping uris on an empty display, open the first one into that display and the other ones as layers of the newly opened image. This is consistent with dropping on an existing image but maybe needs some discussion. * app/display/gimpdisplayshell-callbacks.c: bail out early in the tool event callback so tools never have to deal with empty displays. In expose(), draw the drop zone on the empty display. * app/display/gimpdisplayshell-title.c: set the empty display's title to "Gimp - Drop Files". * app/display/gimpdisplay-foreach.c * app/display/gimpdisplay-handlers.c * app/display/gimpdisplayshell-appearance.c * app/display/gimpdisplayshell-autoscroll.c * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell-cursor.c * app/display/gimpdisplayshell-dnd.c * app/display/gimpdisplayshell-draw.c * app/display/gimpdisplayshell-filter-dialog.c * app/display/gimpdisplayshell-handlers.c * app/display/gimpdisplayshell-layer-select.c * app/display/gimpdisplayshell-preview.c * app/display/gimpdisplayshell-render.c * app/display/gimpdisplayshell-scale.c * app/display/gimpdisplayshell-scroll.c * app/display/gimpdisplayshell-selection.c * app/display/gimpdisplayshell-title.c * app/display/gimpdisplayshell.c * app/display/gimpnavigationeditor.c * app/display/gimpstatusbar.c: use display->gimp and display->config instead of going via the image. Guard against empty displays in some few places (most places can't be called). Where needed, use the canvas' dimensions instead of the image's dimensions so scroll offsets and scrollbars still have sane values instead of the last image's ones. * app/actions/actions.c (action_data_get_gimp) (action_data_get_context): use display->gimp instead of display->image->gimp. * app/actions/edit-commands.c (edit_paste_cmd_callback): redirect to "paste as new" if there is an empty display. * app/actions/tools-commands.c (tools_select_cmd_callback): don't initialize the new tool on an empty display. * app/actions/view-actions.c (view_actions_update): changed lots of sensitivity settings to be insensitive when there is no image (instead of no display). * app/actions/view-commands.c: use the display's config object instead of gimp's. svn path=/trunk/; revision=25113
2008-03-19 05:22:21 +08:00
/* we will scroll around in the next tick anyway, so we just can as
* well skip the drawing of this frame and wait for the next
*/
if (shell->size_allocate_center_image)
return TRUE;
/* ignore events on overlays */
if (gtk_cairo_should_draw_window (cr, gtk_widget_get_window (widget)))
{
if (gimp_display_get_image (shell->display))
{
gimp_display_shell_canvas_draw_image (shell, cr);
}
else
{
gimp_display_shell_canvas_draw_drop_zone (shell, cr);
}
}
return FALSE;
}
build display/ before tools/. 2001-11-08 Michael Natterer <mitch@gimp.org> * app/Makefile.am: build display/ before tools/. * app/devices.c: devices_check_change(): added all events which have a GdkDevice pointer. * app/gimpprogress.c: include "display-types.h" instead of "core-types.h". * app/core/Makefile.am * app/core/gimpdrawable-bucket-fill.[ch]: new files: the bucket_fill stuff taken from tools/gimpbucketfilltool.[ch]. * app/core/core-types.h: added "BucketFillMode". * app/core/gimpimage-mask-select.[ch]: cleanup. * app/core/gimpmarshal.list: added more marshallers for GimpTool's new signal signatures. * app/core/gimpmarshal.[ch]: regenerated. * app/display/Makefile.am * app/display/gimpdisplayshell-dnd.[ch] * app/display/gimpdisplayshell-layer-select.[ch]: new files: the canvas drop callbacks from gimpdisplayshell-callbacks.[ch] and the stuff formerly knows as gui/layer-select.[ch]. * app/display/gimpdisplay.h: don't include "gui/gui-types.h". * app/display/gximage.c: include "display-types.h". * app/display/gimpdisplay-foreach.c * app/display/gimpdisplayshell.[ch]: call gdsplay_delete(), don't destroy the shell widget. * app/gui/Makefile.am * app/gui/layer-select.[ch]: removed. * app/gui/gradients-commands.c: fixed "Save as POV" fprintf()s. * app/gui/preferences-dialog.c: removed the layer_select stuff because it is useless with the new preview system. * app/gui/tool-options-dialog.c: send the correct data to the close_callback. * app/gui/tools-commands.c: changed to follow the new gimp_tool_initialize() semantics (see below). Tool & canvas event handling chainsawing: * app/tools/tools-types.h: new struct GimpCoords which contains x, y, pressure, tilt etc. * app/display/gimpdisplayshell-callbacks.[ch]: added utility functions which transparently retreive the current event's GimpCoords or take it from the device directly if the event has none. Pass GimpCoords _in_image_coordinates_ to all tool functions. Most important: don't pass GdkEvents and display coordinates to tools any more. * app/tools/gimptool.[ch]: changed virtual functions to take GimpCoords, time and state separately instead of GdkEvents. * app/tools/gimpbezierselecttool.c * app/tools/gimpblendtool.c * app/tools/gimpbucketfilltool.[ch] * app/tools/gimpbycolorselecttool.c * app/tools/gimpclonetool.c * app/tools/gimpcolorpickertool.c * app/tools/gimpconvolvetool.c * app/tools/gimpcroptool.[ch] * app/tools/gimpcurvestool.c * app/tools/gimpdodgeburntool.c * app/tools/gimpdrawtool.c * app/tools/gimpeditselectiontool.[ch] * app/tools/gimperasertool.c * app/tools/gimpfliptool.c * app/tools/gimpfreeselecttool.[ch] * app/tools/gimpfuzzyselecttool.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/gimppathtool.[ch] * app/tools/gimprectselecttool.c * app/tools/gimprotatetool.c * app/tools/gimpselectiontool.[ch] * app/tools/gimpsmudgetool.c * app/tools/gimptexttool.c * app/tools/gimptransformtool.[ch] * app/tools/path_tool.[ch] * app/tools/selection_options.c: tons and tons of changes: - changed to use the new virtual function parameters. - removed zillions of gdisplay_untransform_coords(). - get the active drawable's offsets manually in many cases. (questionable, but IMHO ok because it's obvious and not simply a "TRUE" passed to some function) - reordered some functions to be consistent across tools. - some tools had to be changed to work on image coords, not display ones (esp. crop). - fixed strange rotate tool behaviour which should be backported to stable. - some stuff i came across. - indentation and other paranoia. - rounding of coordinated may be broken in some tools. - new bugs guaranteed. * app/tools/tool_manager.[ch]: new semantic of tool_manager_initialize_active() (looked at the places where it was used from and put common code together). Should be a bit better now :) * app/tools/gimpblendtool.c * app/tools/transform_options.c: use the new GTK+ feature that a widget (toggle button) can be a frame's title for this tools' tool options. * app/widgets/widgets-types.h: stuff. * themes/Default/gtkrc: s/GtkDialog/GimpDialog/. * tools/pdbgen/Makefile.am: don't scan tools/gimpbucketfilltool.h any more. * tools/pdbgen/enums.pl: regenerated. * tools/pdbgen/pdb/tools.pdb: changed bucket_fill wrapper. * app/pdb/tools_cmds.c: regenerated.
2001-11-09 03:14:51 +08:00
gboolean
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
gimp_display_shell_origin_button_press (GtkWidget *widget,
GdkEventButton *event,
GimpDisplayShell *shell)
{
First draft of the "no image open" window, which is implemented as a 2008-03-18 Michael Natterer <mitch@gimp.org> First draft of the "no image open" window, which is implemented as a display without image (a view with NULL model). Didn't change the display's appearance yet so I can first make sure the display without image works properly in all details before hiding these details. * app/core/gimp-gui.[ch]: add "gimp" parameter to display_create() and allow "image" to be NULL. * app/core/gimpcontext.c (gimp_context_real_set_display): a display's image can be NULL now. * app/display/gimpdisplay.[ch]: add Gimp and GimpDisplayConfig members. Add Gimp parameter to gimp_display_shell_new(). Changed gimp_display_reconnect() to gimp_display_set_image() and allow to set a NULL image. * app/gui/gui-vtable.c (gui_display_create): if there is a single display without an image, call gimp_display_set_image() on that display instead of creating a new one. * app/display/gimpdisplayshell-close.c: if the last display is closed, don't close it but make it empty. Factored out that code to gimp_display_shell_really_close(). * app/display/gimpdisplayshell-dnd.c: when dropping uris on an empty display, open the first one into that display and the other ones as layers of the newly opened image. This is consistent with dropping on an existing image but maybe needs some discussion. * app/display/gimpdisplayshell-callbacks.c: bail out early in the tool event callback so tools never have to deal with empty displays. In expose(), draw the drop zone on the empty display. * app/display/gimpdisplayshell-title.c: set the empty display's title to "Gimp - Drop Files". * app/display/gimpdisplay-foreach.c * app/display/gimpdisplay-handlers.c * app/display/gimpdisplayshell-appearance.c * app/display/gimpdisplayshell-autoscroll.c * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell-cursor.c * app/display/gimpdisplayshell-dnd.c * app/display/gimpdisplayshell-draw.c * app/display/gimpdisplayshell-filter-dialog.c * app/display/gimpdisplayshell-handlers.c * app/display/gimpdisplayshell-layer-select.c * app/display/gimpdisplayshell-preview.c * app/display/gimpdisplayshell-render.c * app/display/gimpdisplayshell-scale.c * app/display/gimpdisplayshell-scroll.c * app/display/gimpdisplayshell-selection.c * app/display/gimpdisplayshell-title.c * app/display/gimpdisplayshell.c * app/display/gimpnavigationeditor.c * app/display/gimpstatusbar.c: use display->gimp and display->config instead of going via the image. Guard against empty displays in some few places (most places can't be called). Where needed, use the canvas' dimensions instead of the image's dimensions so scroll offsets and scrollbars still have sane values instead of the last image's ones. * app/actions/actions.c (action_data_get_gimp) (action_data_get_context): use display->gimp instead of display->image->gimp. * app/actions/edit-commands.c (edit_paste_cmd_callback): redirect to "paste as new" if there is an empty display. * app/actions/tools-commands.c (tools_select_cmd_callback): don't initialize the new tool on an empty display. * app/actions/view-actions.c (view_actions_update): changed lots of sensitivity settings to be insensitive when there is no image (instead of no display). * app/actions/view-commands.c: use the display's config object instead of gimp's. svn path=/trunk/; revision=25113
2008-03-19 05:22:21 +08:00
if (! shell->display->gimp->busy)
{
if (event->type == GDK_BUTTON_PRESS && event->button == 1)
{
gboolean unused;
g_signal_emit_by_name (shell, "popup-menu", &unused);
}
}
/* Return TRUE to stop signal emission so the button doesn't grab the
* pointer away from us.
*/
return TRUE;
}
app/core/Makefile.am new files: the QMask stuff stripped from GUI code. 2001-11-30 Michael Natterer <mitch@gimp.org> * app/core/Makefile.am * app/core/gimpimage-qmask.[ch]: new files: the QMask stuff stripped from GUI code. Added gimp_image_qmask_invert(). * app/core/gimpimage.[ch]: removed the QMask functions. * app/display/Makefile.am * app/display/gimpdisplayshell-qmask.[ch]: removed. * app/gui/Makefile.am * app/gui/qmask-commands.[ch]: new files for the new QMask item factory callbacks and the qmask query dialog. * app/gui/menus.c: added a context menu for the QMask button. * app/display/gimpdisplayshell.c * app/display/gimpdisplayshell-handlers.c: don't include the qmask stuff. * app/display/gimpdisplayshell-callbacks.[ch]: Moved the 2 qmask callbacks here. Don't popup the dialog on double_click. Show the contect menu on right-click. * app/display/gimpdisplayshell-callbacks.[ch]: gimp_display_shell_canvas_events(): removed the hack of conntecting "key_press_event" to gtk_true() while a tool is active. Instead, check for (event & GDK_BUTTON1_MASK) in the key_press and key_release handlers and stop signal emission. Save the modifier state on "button_press" and restore it after "button_release". Changed the way context menus are updated/shown: - removed GimpContainerContextFunc. - pass around item factory identifiers (e.g. "<Brushes>") - added voodoo to update the menus before showing them. * app/widgets/gimpitemfactory.[ch]: gimp_item_factory_new(): take a GimpItemFactoryUpdateFunc parameter, attach it as data to the factory and use it to update the menu in gimp_item_factory_popup_with_date(). * app/widgets/gimpwidgets-utils.[ch]: removed gimp_item_factory_popup_with_data() here. * app/widgets/gimpbrushfactoryview.[ch] * app/widgets/gimpbufferview.[ch] * app/widgets/gimpcontainereditor.[ch] * app/widgets/gimpdatafactoryview.[ch] * app/widgets/gimpdocumentview.[ch] * app/widgets/gimpdrawablelistview.[ch]: use item_factory identifier strings all over the place. * app/widgets/gimpdockbook.c: removed the menu update code, it's now in gui/dialogs-commands.c. * app/gui/brushes-commands.[ch] * app/gui/buffers-commands.[c] * app/gui/channels-commands.[ch] * app/gui/dialogs-commands.[ch] * app/gui/documents-commands.[ch] * app/gui/gradient-editor-commands.[ch] * app/gui/gradients-commands.[ch] * app/gui/layers-commands.[ch] * app/gui/palettes-commands.[ch] * app/gui/patterns-commands.[ch]: removed all show_context_menu() functions and made the update functions public. Changed all update functions to use the gimp_item_factory_set_foo() methods instead of gimp_menu_item_set_foo(). * app/gui/menus.c: pass the update functions to the gimp_item_factory_new(). * app/gui/dialogs-constructors.c: pass item factory identifiers to all view constructors. * app/gui/gradient-editor.c: show the context menu using the new method. * app/gui/toolbox.c: no need to include "dialogs-commands.h".
2001-11-30 22:41:56 +08:00
gboolean
gimp_display_shell_quick_mask_button_press (GtkWidget *widget,
GdkEventButton *bevent,
GimpDisplayShell *shell)
app/core/Makefile.am new files: the QMask stuff stripped from GUI code. 2001-11-30 Michael Natterer <mitch@gimp.org> * app/core/Makefile.am * app/core/gimpimage-qmask.[ch]: new files: the QMask stuff stripped from GUI code. Added gimp_image_qmask_invert(). * app/core/gimpimage.[ch]: removed the QMask functions. * app/display/Makefile.am * app/display/gimpdisplayshell-qmask.[ch]: removed. * app/gui/Makefile.am * app/gui/qmask-commands.[ch]: new files for the new QMask item factory callbacks and the qmask query dialog. * app/gui/menus.c: added a context menu for the QMask button. * app/display/gimpdisplayshell.c * app/display/gimpdisplayshell-handlers.c: don't include the qmask stuff. * app/display/gimpdisplayshell-callbacks.[ch]: Moved the 2 qmask callbacks here. Don't popup the dialog on double_click. Show the contect menu on right-click. * app/display/gimpdisplayshell-callbacks.[ch]: gimp_display_shell_canvas_events(): removed the hack of conntecting "key_press_event" to gtk_true() while a tool is active. Instead, check for (event & GDK_BUTTON1_MASK) in the key_press and key_release handlers and stop signal emission. Save the modifier state on "button_press" and restore it after "button_release". Changed the way context menus are updated/shown: - removed GimpContainerContextFunc. - pass around item factory identifiers (e.g. "<Brushes>") - added voodoo to update the menus before showing them. * app/widgets/gimpitemfactory.[ch]: gimp_item_factory_new(): take a GimpItemFactoryUpdateFunc parameter, attach it as data to the factory and use it to update the menu in gimp_item_factory_popup_with_date(). * app/widgets/gimpwidgets-utils.[ch]: removed gimp_item_factory_popup_with_data() here. * app/widgets/gimpbrushfactoryview.[ch] * app/widgets/gimpbufferview.[ch] * app/widgets/gimpcontainereditor.[ch] * app/widgets/gimpdatafactoryview.[ch] * app/widgets/gimpdocumentview.[ch] * app/widgets/gimpdrawablelistview.[ch]: use item_factory identifier strings all over the place. * app/widgets/gimpdockbook.c: removed the menu update code, it's now in gui/dialogs-commands.c. * app/gui/brushes-commands.[ch] * app/gui/buffers-commands.[c] * app/gui/channels-commands.[ch] * app/gui/dialogs-commands.[ch] * app/gui/documents-commands.[ch] * app/gui/gradient-editor-commands.[ch] * app/gui/gradients-commands.[ch] * app/gui/layers-commands.[ch] * app/gui/palettes-commands.[ch] * app/gui/patterns-commands.[ch]: removed all show_context_menu() functions and made the update functions public. Changed all update functions to use the gimp_item_factory_set_foo() methods instead of gimp_menu_item_set_foo(). * app/gui/menus.c: pass the update functions to the gimp_item_factory_new(). * app/gui/dialogs-constructors.c: pass item factory identifiers to all view constructors. * app/gui/gradient-editor.c: show the context menu using the new method. * app/gui/toolbox.c: no need to include "dialogs-commands.h".
2001-11-30 22:41:56 +08:00
{
if (! gimp_display_get_image (shell->display))
First draft of the "no image open" window, which is implemented as a 2008-03-18 Michael Natterer <mitch@gimp.org> First draft of the "no image open" window, which is implemented as a display without image (a view with NULL model). Didn't change the display's appearance yet so I can first make sure the display without image works properly in all details before hiding these details. * app/core/gimp-gui.[ch]: add "gimp" parameter to display_create() and allow "image" to be NULL. * app/core/gimpcontext.c (gimp_context_real_set_display): a display's image can be NULL now. * app/display/gimpdisplay.[ch]: add Gimp and GimpDisplayConfig members. Add Gimp parameter to gimp_display_shell_new(). Changed gimp_display_reconnect() to gimp_display_set_image() and allow to set a NULL image. * app/gui/gui-vtable.c (gui_display_create): if there is a single display without an image, call gimp_display_set_image() on that display instead of creating a new one. * app/display/gimpdisplayshell-close.c: if the last display is closed, don't close it but make it empty. Factored out that code to gimp_display_shell_really_close(). * app/display/gimpdisplayshell-dnd.c: when dropping uris on an empty display, open the first one into that display and the other ones as layers of the newly opened image. This is consistent with dropping on an existing image but maybe needs some discussion. * app/display/gimpdisplayshell-callbacks.c: bail out early in the tool event callback so tools never have to deal with empty displays. In expose(), draw the drop zone on the empty display. * app/display/gimpdisplayshell-title.c: set the empty display's title to "Gimp - Drop Files". * app/display/gimpdisplay-foreach.c * app/display/gimpdisplay-handlers.c * app/display/gimpdisplayshell-appearance.c * app/display/gimpdisplayshell-autoscroll.c * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell-cursor.c * app/display/gimpdisplayshell-dnd.c * app/display/gimpdisplayshell-draw.c * app/display/gimpdisplayshell-filter-dialog.c * app/display/gimpdisplayshell-handlers.c * app/display/gimpdisplayshell-layer-select.c * app/display/gimpdisplayshell-preview.c * app/display/gimpdisplayshell-render.c * app/display/gimpdisplayshell-scale.c * app/display/gimpdisplayshell-scroll.c * app/display/gimpdisplayshell-selection.c * app/display/gimpdisplayshell-title.c * app/display/gimpdisplayshell.c * app/display/gimpnavigationeditor.c * app/display/gimpstatusbar.c: use display->gimp and display->config instead of going via the image. Guard against empty displays in some few places (most places can't be called). Where needed, use the canvas' dimensions instead of the image's dimensions so scroll offsets and scrollbars still have sane values instead of the last image's ones. * app/actions/actions.c (action_data_get_gimp) (action_data_get_context): use display->gimp instead of display->image->gimp. * app/actions/edit-commands.c (edit_paste_cmd_callback): redirect to "paste as new" if there is an empty display. * app/actions/tools-commands.c (tools_select_cmd_callback): don't initialize the new tool on an empty display. * app/actions/view-actions.c (view_actions_update): changed lots of sensitivity settings to be insensitive when there is no image (instead of no display). * app/actions/view-commands.c: use the display's config object instead of gimp's. svn path=/trunk/; revision=25113
2008-03-19 05:22:21 +08:00
return TRUE;
if (gdk_event_triggers_context_menu ((GdkEvent *) bevent))
app/core/Makefile.am new files: the QMask stuff stripped from GUI code. 2001-11-30 Michael Natterer <mitch@gimp.org> * app/core/Makefile.am * app/core/gimpimage-qmask.[ch]: new files: the QMask stuff stripped from GUI code. Added gimp_image_qmask_invert(). * app/core/gimpimage.[ch]: removed the QMask functions. * app/display/Makefile.am * app/display/gimpdisplayshell-qmask.[ch]: removed. * app/gui/Makefile.am * app/gui/qmask-commands.[ch]: new files for the new QMask item factory callbacks and the qmask query dialog. * app/gui/menus.c: added a context menu for the QMask button. * app/display/gimpdisplayshell.c * app/display/gimpdisplayshell-handlers.c: don't include the qmask stuff. * app/display/gimpdisplayshell-callbacks.[ch]: Moved the 2 qmask callbacks here. Don't popup the dialog on double_click. Show the contect menu on right-click. * app/display/gimpdisplayshell-callbacks.[ch]: gimp_display_shell_canvas_events(): removed the hack of conntecting "key_press_event" to gtk_true() while a tool is active. Instead, check for (event & GDK_BUTTON1_MASK) in the key_press and key_release handlers and stop signal emission. Save the modifier state on "button_press" and restore it after "button_release". Changed the way context menus are updated/shown: - removed GimpContainerContextFunc. - pass around item factory identifiers (e.g. "<Brushes>") - added voodoo to update the menus before showing them. * app/widgets/gimpitemfactory.[ch]: gimp_item_factory_new(): take a GimpItemFactoryUpdateFunc parameter, attach it as data to the factory and use it to update the menu in gimp_item_factory_popup_with_date(). * app/widgets/gimpwidgets-utils.[ch]: removed gimp_item_factory_popup_with_data() here. * app/widgets/gimpbrushfactoryview.[ch] * app/widgets/gimpbufferview.[ch] * app/widgets/gimpcontainereditor.[ch] * app/widgets/gimpdatafactoryview.[ch] * app/widgets/gimpdocumentview.[ch] * app/widgets/gimpdrawablelistview.[ch]: use item_factory identifier strings all over the place. * app/widgets/gimpdockbook.c: removed the menu update code, it's now in gui/dialogs-commands.c. * app/gui/brushes-commands.[ch] * app/gui/buffers-commands.[c] * app/gui/channels-commands.[ch] * app/gui/dialogs-commands.[ch] * app/gui/documents-commands.[ch] * app/gui/gradient-editor-commands.[ch] * app/gui/gradients-commands.[ch] * app/gui/layers-commands.[ch] * app/gui/palettes-commands.[ch] * app/gui/patterns-commands.[ch]: removed all show_context_menu() functions and made the update functions public. Changed all update functions to use the gimp_item_factory_set_foo() methods instead of gimp_menu_item_set_foo(). * app/gui/menus.c: pass the update functions to the gimp_item_factory_new(). * app/gui/dialogs-constructors.c: pass item factory identifiers to all view constructors. * app/gui/gradient-editor.c: show the context menu using the new method. * app/gui/toolbox.c: no need to include "dialogs-commands.h".
2001-11-30 22:41:56 +08:00
{
GimpImageWindow *window = gimp_display_shell_get_window (shell);
if (window)
{
GimpUIManager *manager = gimp_image_window_get_ui_manager (window);
gimp_ui_manager_ui_popup_at_widget (manager,
"/quick-mask-popup",
widget,
GDK_GRAVITY_EAST,
GDK_GRAVITY_SOUTH_WEST,
(GdkEvent *) bevent,
NULL, NULL);
}
app/core/Makefile.am new files: the QMask stuff stripped from GUI code. 2001-11-30 Michael Natterer <mitch@gimp.org> * app/core/Makefile.am * app/core/gimpimage-qmask.[ch]: new files: the QMask stuff stripped from GUI code. Added gimp_image_qmask_invert(). * app/core/gimpimage.[ch]: removed the QMask functions. * app/display/Makefile.am * app/display/gimpdisplayshell-qmask.[ch]: removed. * app/gui/Makefile.am * app/gui/qmask-commands.[ch]: new files for the new QMask item factory callbacks and the qmask query dialog. * app/gui/menus.c: added a context menu for the QMask button. * app/display/gimpdisplayshell.c * app/display/gimpdisplayshell-handlers.c: don't include the qmask stuff. * app/display/gimpdisplayshell-callbacks.[ch]: Moved the 2 qmask callbacks here. Don't popup the dialog on double_click. Show the contect menu on right-click. * app/display/gimpdisplayshell-callbacks.[ch]: gimp_display_shell_canvas_events(): removed the hack of conntecting "key_press_event" to gtk_true() while a tool is active. Instead, check for (event & GDK_BUTTON1_MASK) in the key_press and key_release handlers and stop signal emission. Save the modifier state on "button_press" and restore it after "button_release". Changed the way context menus are updated/shown: - removed GimpContainerContextFunc. - pass around item factory identifiers (e.g. "<Brushes>") - added voodoo to update the menus before showing them. * app/widgets/gimpitemfactory.[ch]: gimp_item_factory_new(): take a GimpItemFactoryUpdateFunc parameter, attach it as data to the factory and use it to update the menu in gimp_item_factory_popup_with_date(). * app/widgets/gimpwidgets-utils.[ch]: removed gimp_item_factory_popup_with_data() here. * app/widgets/gimpbrushfactoryview.[ch] * app/widgets/gimpbufferview.[ch] * app/widgets/gimpcontainereditor.[ch] * app/widgets/gimpdatafactoryview.[ch] * app/widgets/gimpdocumentview.[ch] * app/widgets/gimpdrawablelistview.[ch]: use item_factory identifier strings all over the place. * app/widgets/gimpdockbook.c: removed the menu update code, it's now in gui/dialogs-commands.c. * app/gui/brushes-commands.[ch] * app/gui/buffers-commands.[c] * app/gui/channels-commands.[ch] * app/gui/dialogs-commands.[ch] * app/gui/documents-commands.[ch] * app/gui/gradient-editor-commands.[ch] * app/gui/gradients-commands.[ch] * app/gui/layers-commands.[ch] * app/gui/palettes-commands.[ch] * app/gui/patterns-commands.[ch]: removed all show_context_menu() functions and made the update functions public. Changed all update functions to use the gimp_item_factory_set_foo() methods instead of gimp_menu_item_set_foo(). * app/gui/menus.c: pass the update functions to the gimp_item_factory_new(). * app/gui/dialogs-constructors.c: pass item factory identifiers to all view constructors. * app/gui/gradient-editor.c: show the context menu using the new method. * app/gui/toolbox.c: no need to include "dialogs-commands.h".
2001-11-30 22:41:56 +08:00
return TRUE;
}
return FALSE;
}
void
gimp_display_shell_quick_mask_toggled (GtkWidget *widget,
GimpDisplayShell *shell)
app/core/Makefile.am new files: the QMask stuff stripped from GUI code. 2001-11-30 Michael Natterer <mitch@gimp.org> * app/core/Makefile.am * app/core/gimpimage-qmask.[ch]: new files: the QMask stuff stripped from GUI code. Added gimp_image_qmask_invert(). * app/core/gimpimage.[ch]: removed the QMask functions. * app/display/Makefile.am * app/display/gimpdisplayshell-qmask.[ch]: removed. * app/gui/Makefile.am * app/gui/qmask-commands.[ch]: new files for the new QMask item factory callbacks and the qmask query dialog. * app/gui/menus.c: added a context menu for the QMask button. * app/display/gimpdisplayshell.c * app/display/gimpdisplayshell-handlers.c: don't include the qmask stuff. * app/display/gimpdisplayshell-callbacks.[ch]: Moved the 2 qmask callbacks here. Don't popup the dialog on double_click. Show the contect menu on right-click. * app/display/gimpdisplayshell-callbacks.[ch]: gimp_display_shell_canvas_events(): removed the hack of conntecting "key_press_event" to gtk_true() while a tool is active. Instead, check for (event & GDK_BUTTON1_MASK) in the key_press and key_release handlers and stop signal emission. Save the modifier state on "button_press" and restore it after "button_release". Changed the way context menus are updated/shown: - removed GimpContainerContextFunc. - pass around item factory identifiers (e.g. "<Brushes>") - added voodoo to update the menus before showing them. * app/widgets/gimpitemfactory.[ch]: gimp_item_factory_new(): take a GimpItemFactoryUpdateFunc parameter, attach it as data to the factory and use it to update the menu in gimp_item_factory_popup_with_date(). * app/widgets/gimpwidgets-utils.[ch]: removed gimp_item_factory_popup_with_data() here. * app/widgets/gimpbrushfactoryview.[ch] * app/widgets/gimpbufferview.[ch] * app/widgets/gimpcontainereditor.[ch] * app/widgets/gimpdatafactoryview.[ch] * app/widgets/gimpdocumentview.[ch] * app/widgets/gimpdrawablelistview.[ch]: use item_factory identifier strings all over the place. * app/widgets/gimpdockbook.c: removed the menu update code, it's now in gui/dialogs-commands.c. * app/gui/brushes-commands.[ch] * app/gui/buffers-commands.[c] * app/gui/channels-commands.[ch] * app/gui/dialogs-commands.[ch] * app/gui/documents-commands.[ch] * app/gui/gradient-editor-commands.[ch] * app/gui/gradients-commands.[ch] * app/gui/layers-commands.[ch] * app/gui/palettes-commands.[ch] * app/gui/patterns-commands.[ch]: removed all show_context_menu() functions and made the update functions public. Changed all update functions to use the gimp_item_factory_set_foo() methods instead of gimp_menu_item_set_foo(). * app/gui/menus.c: pass the update functions to the gimp_item_factory_new(). * app/gui/dialogs-constructors.c: pass item factory identifiers to all view constructors. * app/gui/gradient-editor.c: show the context menu using the new method. * app/gui/toolbox.c: no need to include "dialogs-commands.h".
2001-11-30 22:41:56 +08:00
{
GimpImage *image = gimp_display_get_image (shell->display);
gboolean active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));
if (active != gimp_image_get_quick_mask_state (image))
Fixed lots of QuickMask brokenness by letting the image adjust its 2004-02-14 Michael Natterer <mitch@gimp.org> Fixed lots of QuickMask brokenness by letting the image adjust its qmask_state automatically: * app/core/gimpimage-qmask.h: #define GIMP_IMAGE_QMASK_NAME "Qmask". Use the define in all files below. * app/core/gimpimage.[ch]: split gimp_image_drawable_add,_remove() into separate handlers for layers and channels. Added a "name_changed" handler for all channels. In the channel "add", "remove" and "name_changed" handlers, check if it was a channel named "Qmask" that was added, removed or renamed and call gimp_image_set_qmask_state() accordingly. * app/core/core-enums.[ch] * app/core/gimpimage-undo-push.[ch] * app/core/gimpundo.c: removed all Qmask undo code because the image does the right thing without undo interaction now. * app/core/gimpimage-qmask.c (gimp_image_set_qmask_state): set gimage->qmask_state early so we can return early when called recursively. Removed calls to gimp_image_undo_push_image_qmask(). Returned "removed" callback (it was utterly broken the way it was implemented). * app/display/gimpdisplayshell-callbacks.c (gimp_display_shell_qmask_toggled): check if the image's qmask state needs to be changed before changing it. * app/xcf/xcf-load.c (xcf_load_channel): removed code which recognized the qmask. GimpImage does this automatically now. * app/gui/qmask-commands.c: cleanup. * app/widgets/gimpimagedock.c (gimp_image_dock_constructor): destroy the "/Select/By Color" and "/Select/Toggle QuickMask" menu items. * app/widgets/image-menu.c (image_menu_update): changed accordingly.
2004-02-14 23:37:23 +08:00
{
GimpImageWindow *window = gimp_display_shell_get_window (shell);
if (window)
{
GimpUIManager *manager = gimp_image_window_get_ui_manager (window);
app/core/Makefile.am new files: the QMask stuff stripped from GUI code. 2001-11-30 Michael Natterer <mitch@gimp.org> * app/core/Makefile.am * app/core/gimpimage-qmask.[ch]: new files: the QMask stuff stripped from GUI code. Added gimp_image_qmask_invert(). * app/core/gimpimage.[ch]: removed the QMask functions. * app/display/Makefile.am * app/display/gimpdisplayshell-qmask.[ch]: removed. * app/gui/Makefile.am * app/gui/qmask-commands.[ch]: new files for the new QMask item factory callbacks and the qmask query dialog. * app/gui/menus.c: added a context menu for the QMask button. * app/display/gimpdisplayshell.c * app/display/gimpdisplayshell-handlers.c: don't include the qmask stuff. * app/display/gimpdisplayshell-callbacks.[ch]: Moved the 2 qmask callbacks here. Don't popup the dialog on double_click. Show the contect menu on right-click. * app/display/gimpdisplayshell-callbacks.[ch]: gimp_display_shell_canvas_events(): removed the hack of conntecting "key_press_event" to gtk_true() while a tool is active. Instead, check for (event & GDK_BUTTON1_MASK) in the key_press and key_release handlers and stop signal emission. Save the modifier state on "button_press" and restore it after "button_release". Changed the way context menus are updated/shown: - removed GimpContainerContextFunc. - pass around item factory identifiers (e.g. "<Brushes>") - added voodoo to update the menus before showing them. * app/widgets/gimpitemfactory.[ch]: gimp_item_factory_new(): take a GimpItemFactoryUpdateFunc parameter, attach it as data to the factory and use it to update the menu in gimp_item_factory_popup_with_date(). * app/widgets/gimpwidgets-utils.[ch]: removed gimp_item_factory_popup_with_data() here. * app/widgets/gimpbrushfactoryview.[ch] * app/widgets/gimpbufferview.[ch] * app/widgets/gimpcontainereditor.[ch] * app/widgets/gimpdatafactoryview.[ch] * app/widgets/gimpdocumentview.[ch] * app/widgets/gimpdrawablelistview.[ch]: use item_factory identifier strings all over the place. * app/widgets/gimpdockbook.c: removed the menu update code, it's now in gui/dialogs-commands.c. * app/gui/brushes-commands.[ch] * app/gui/buffers-commands.[c] * app/gui/channels-commands.[ch] * app/gui/dialogs-commands.[ch] * app/gui/documents-commands.[ch] * app/gui/gradient-editor-commands.[ch] * app/gui/gradients-commands.[ch] * app/gui/layers-commands.[ch] * app/gui/palettes-commands.[ch] * app/gui/patterns-commands.[ch]: removed all show_context_menu() functions and made the update functions public. Changed all update functions to use the gimp_item_factory_set_foo() methods instead of gimp_menu_item_set_foo(). * app/gui/menus.c: pass the update functions to the gimp_item_factory_new(). * app/gui/dialogs-constructors.c: pass item factory identifiers to all view constructors. * app/gui/gradient-editor.c: show the context menu using the new method. * app/gui/toolbox.c: no need to include "dialogs-commands.h".
2001-11-30 22:41:56 +08:00
gimp_ui_manager_toggle_action (manager,
"quick-mask", "quick-mask-toggle",
active);
}
Fixed lots of QuickMask brokenness by letting the image adjust its 2004-02-14 Michael Natterer <mitch@gimp.org> Fixed lots of QuickMask brokenness by letting the image adjust its qmask_state automatically: * app/core/gimpimage-qmask.h: #define GIMP_IMAGE_QMASK_NAME "Qmask". Use the define in all files below. * app/core/gimpimage.[ch]: split gimp_image_drawable_add,_remove() into separate handlers for layers and channels. Added a "name_changed" handler for all channels. In the channel "add", "remove" and "name_changed" handlers, check if it was a channel named "Qmask" that was added, removed or renamed and call gimp_image_set_qmask_state() accordingly. * app/core/core-enums.[ch] * app/core/gimpimage-undo-push.[ch] * app/core/gimpundo.c: removed all Qmask undo code because the image does the right thing without undo interaction now. * app/core/gimpimage-qmask.c (gimp_image_set_qmask_state): set gimage->qmask_state early so we can return early when called recursively. Removed calls to gimp_image_undo_push_image_qmask(). Returned "removed" callback (it was utterly broken the way it was implemented). * app/display/gimpdisplayshell-callbacks.c (gimp_display_shell_qmask_toggled): check if the image's qmask state needs to be changed before changing it. * app/xcf/xcf-load.c (xcf_load_channel): removed code which recognized the qmask. GimpImage does this automatically now. * app/gui/qmask-commands.c: cleanup. * app/widgets/gimpimagedock.c (gimp_image_dock_constructor): destroy the "/Select/By Color" and "/Select/Toggle QuickMask" menu items. * app/widgets/image-menu.c (image_menu_update): changed accordingly.
2004-02-14 23:37:23 +08:00
}
app/core/Makefile.am new files: the QMask stuff stripped from GUI code. 2001-11-30 Michael Natterer <mitch@gimp.org> * app/core/Makefile.am * app/core/gimpimage-qmask.[ch]: new files: the QMask stuff stripped from GUI code. Added gimp_image_qmask_invert(). * app/core/gimpimage.[ch]: removed the QMask functions. * app/display/Makefile.am * app/display/gimpdisplayshell-qmask.[ch]: removed. * app/gui/Makefile.am * app/gui/qmask-commands.[ch]: new files for the new QMask item factory callbacks and the qmask query dialog. * app/gui/menus.c: added a context menu for the QMask button. * app/display/gimpdisplayshell.c * app/display/gimpdisplayshell-handlers.c: don't include the qmask stuff. * app/display/gimpdisplayshell-callbacks.[ch]: Moved the 2 qmask callbacks here. Don't popup the dialog on double_click. Show the contect menu on right-click. * app/display/gimpdisplayshell-callbacks.[ch]: gimp_display_shell_canvas_events(): removed the hack of conntecting "key_press_event" to gtk_true() while a tool is active. Instead, check for (event & GDK_BUTTON1_MASK) in the key_press and key_release handlers and stop signal emission. Save the modifier state on "button_press" and restore it after "button_release". Changed the way context menus are updated/shown: - removed GimpContainerContextFunc. - pass around item factory identifiers (e.g. "<Brushes>") - added voodoo to update the menus before showing them. * app/widgets/gimpitemfactory.[ch]: gimp_item_factory_new(): take a GimpItemFactoryUpdateFunc parameter, attach it as data to the factory and use it to update the menu in gimp_item_factory_popup_with_date(). * app/widgets/gimpwidgets-utils.[ch]: removed gimp_item_factory_popup_with_data() here. * app/widgets/gimpbrushfactoryview.[ch] * app/widgets/gimpbufferview.[ch] * app/widgets/gimpcontainereditor.[ch] * app/widgets/gimpdatafactoryview.[ch] * app/widgets/gimpdocumentview.[ch] * app/widgets/gimpdrawablelistview.[ch]: use item_factory identifier strings all over the place. * app/widgets/gimpdockbook.c: removed the menu update code, it's now in gui/dialogs-commands.c. * app/gui/brushes-commands.[ch] * app/gui/buffers-commands.[c] * app/gui/channels-commands.[ch] * app/gui/dialogs-commands.[ch] * app/gui/documents-commands.[ch] * app/gui/gradient-editor-commands.[ch] * app/gui/gradients-commands.[ch] * app/gui/layers-commands.[ch] * app/gui/palettes-commands.[ch] * app/gui/patterns-commands.[ch]: removed all show_context_menu() functions and made the update functions public. Changed all update functions to use the gimp_item_factory_set_foo() methods instead of gimp_menu_item_set_foo(). * app/gui/menus.c: pass the update functions to the gimp_item_factory_new(). * app/gui/dialogs-constructors.c: pass item factory identifiers to all view constructors. * app/gui/gradient-editor.c: show the context menu using the new method. * app/gui/toolbox.c: no need to include "dialogs-commands.h".
2001-11-30 22:41:56 +08:00
}
app/Makefile.am removed... 2002-05-05 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/gimphelp.[ch]: removed... * app/widgets/Makefile.am * app/widgets/gimphelp.[ch]: ...and added here. * app/widgets/widgets-enums.[ch]: added GimpHelpBrowserType here as registered enum. Added an evil hack with GimpCursorType so app/config/gimpguiconfig.h can include this file. * app/widgets/gimpcursor.c: added an assertion because of the changed GimpCursorType. * app/config/gimpguiconfig.[ch]: added a property for the help browser type. * app/gimprc.c * app/libgimp_glue.c * app/gui/preferences-dialog.c * tools/pdbgen/pdb/help.pdb * app/pdb/help_cmds.c: regenerated. Some nav_window cleanup before chopping: * app/nav_window.[ch]: removed the old preview code and use GimpNavigationPreviews only. Namespaceified all functions. Speak in terms of GimpDisplayShell, not GimpDisplay. Lots of internal cleanup. * app/gui/gui-types.h: removed NadiagtionDialog here... * app/display/display-types.h: ...and added it here. * app/display/gimpdisplayshell-callbacks.[ch]: added a callback for the navigation button and call nav_window_show_popup() from there. * app/display/gimpdisplayshell.c: free shell->nav_dialog unconditionally, connect to the new callback. * app/display/gimpdisplayshell-scale.c * app/display/gimpdisplayshell-scroll.c * app/gui/view-commands.c: changed accordingly. * app/widgets/gimppreview.c (gimp_preview_set_viewable): the assertion introduced recently was too tight, breaking GimpNavigationPreview. Changed it to do an "is a" check, not exact preview type matching. * app/widgets/gimpimagepreview.c: added quick-hack support for xres != yres. * app/widgets/gimpnavigationpreview.[ch]: made gimp_navigation_preview_grab_pointer() public so the nav_window can call it. Unrelated: * app/display/gimpdisplay.c: removed the gui/ dependency from this file by removing info_window stuff. * app/display/gimpdisplayshell.c (gimp_display_shell_flush): update the info_window here. * app/gui/dialogs-constructors.c (dialogs_indexed_palette_new): call gimp_dockable_set_context() like all other constructors. * app/undo.c * app/paint/gimppaintcore.h: some more include cleanup.
2002-05-06 03:17:41 +08:00
gboolean
gimp_display_shell_navigation_button_press (GtkWidget *widget,
GdkEventButton *bevent,
GimpDisplayShell *shell)
app/Makefile.am removed... 2002-05-05 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/gimphelp.[ch]: removed... * app/widgets/Makefile.am * app/widgets/gimphelp.[ch]: ...and added here. * app/widgets/widgets-enums.[ch]: added GimpHelpBrowserType here as registered enum. Added an evil hack with GimpCursorType so app/config/gimpguiconfig.h can include this file. * app/widgets/gimpcursor.c: added an assertion because of the changed GimpCursorType. * app/config/gimpguiconfig.[ch]: added a property for the help browser type. * app/gimprc.c * app/libgimp_glue.c * app/gui/preferences-dialog.c * tools/pdbgen/pdb/help.pdb * app/pdb/help_cmds.c: regenerated. Some nav_window cleanup before chopping: * app/nav_window.[ch]: removed the old preview code and use GimpNavigationPreviews only. Namespaceified all functions. Speak in terms of GimpDisplayShell, not GimpDisplay. Lots of internal cleanup. * app/gui/gui-types.h: removed NadiagtionDialog here... * app/display/display-types.h: ...and added it here. * app/display/gimpdisplayshell-callbacks.[ch]: added a callback for the navigation button and call nav_window_show_popup() from there. * app/display/gimpdisplayshell.c: free shell->nav_dialog unconditionally, connect to the new callback. * app/display/gimpdisplayshell-scale.c * app/display/gimpdisplayshell-scroll.c * app/gui/view-commands.c: changed accordingly. * app/widgets/gimppreview.c (gimp_preview_set_viewable): the assertion introduced recently was too tight, breaking GimpNavigationPreview. Changed it to do an "is a" check, not exact preview type matching. * app/widgets/gimpimagepreview.c: added quick-hack support for xres != yres. * app/widgets/gimpnavigationpreview.[ch]: made gimp_navigation_preview_grab_pointer() public so the nav_window can call it. Unrelated: * app/display/gimpdisplay.c: removed the gui/ dependency from this file by removing info_window stuff. * app/display/gimpdisplayshell.c (gimp_display_shell_flush): update the info_window here. * app/gui/dialogs-constructors.c (dialogs_indexed_palette_new): call gimp_dockable_set_context() like all other constructors. * app/undo.c * app/paint/gimppaintcore.h: some more include cleanup.
2002-05-06 03:17:41 +08:00
{
if (! gimp_display_get_image (shell->display))
First draft of the "no image open" window, which is implemented as a 2008-03-18 Michael Natterer <mitch@gimp.org> First draft of the "no image open" window, which is implemented as a display without image (a view with NULL model). Didn't change the display's appearance yet so I can first make sure the display without image works properly in all details before hiding these details. * app/core/gimp-gui.[ch]: add "gimp" parameter to display_create() and allow "image" to be NULL. * app/core/gimpcontext.c (gimp_context_real_set_display): a display's image can be NULL now. * app/display/gimpdisplay.[ch]: add Gimp and GimpDisplayConfig members. Add Gimp parameter to gimp_display_shell_new(). Changed gimp_display_reconnect() to gimp_display_set_image() and allow to set a NULL image. * app/gui/gui-vtable.c (gui_display_create): if there is a single display without an image, call gimp_display_set_image() on that display instead of creating a new one. * app/display/gimpdisplayshell-close.c: if the last display is closed, don't close it but make it empty. Factored out that code to gimp_display_shell_really_close(). * app/display/gimpdisplayshell-dnd.c: when dropping uris on an empty display, open the first one into that display and the other ones as layers of the newly opened image. This is consistent with dropping on an existing image but maybe needs some discussion. * app/display/gimpdisplayshell-callbacks.c: bail out early in the tool event callback so tools never have to deal with empty displays. In expose(), draw the drop zone on the empty display. * app/display/gimpdisplayshell-title.c: set the empty display's title to "Gimp - Drop Files". * app/display/gimpdisplay-foreach.c * app/display/gimpdisplay-handlers.c * app/display/gimpdisplayshell-appearance.c * app/display/gimpdisplayshell-autoscroll.c * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell-cursor.c * app/display/gimpdisplayshell-dnd.c * app/display/gimpdisplayshell-draw.c * app/display/gimpdisplayshell-filter-dialog.c * app/display/gimpdisplayshell-handlers.c * app/display/gimpdisplayshell-layer-select.c * app/display/gimpdisplayshell-preview.c * app/display/gimpdisplayshell-render.c * app/display/gimpdisplayshell-scale.c * app/display/gimpdisplayshell-scroll.c * app/display/gimpdisplayshell-selection.c * app/display/gimpdisplayshell-title.c * app/display/gimpdisplayshell.c * app/display/gimpnavigationeditor.c * app/display/gimpstatusbar.c: use display->gimp and display->config instead of going via the image. Guard against empty displays in some few places (most places can't be called). Where needed, use the canvas' dimensions instead of the image's dimensions so scroll offsets and scrollbars still have sane values instead of the last image's ones. * app/actions/actions.c (action_data_get_gimp) (action_data_get_context): use display->gimp instead of display->image->gimp. * app/actions/edit-commands.c (edit_paste_cmd_callback): redirect to "paste as new" if there is an empty display. * app/actions/tools-commands.c (tools_select_cmd_callback): don't initialize the new tool on an empty display. * app/actions/view-actions.c (view_actions_update): changed lots of sensitivity settings to be insensitive when there is no image (instead of no display). * app/actions/view-commands.c: use the display's config object instead of gimp's. svn path=/trunk/; revision=25113
2008-03-19 05:22:21 +08:00
return TRUE;
if (bevent->type == GDK_BUTTON_PRESS && bevent->button == 1)
app/Makefile.am removed... 2002-05-05 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/gimphelp.[ch]: removed... * app/widgets/Makefile.am * app/widgets/gimphelp.[ch]: ...and added here. * app/widgets/widgets-enums.[ch]: added GimpHelpBrowserType here as registered enum. Added an evil hack with GimpCursorType so app/config/gimpguiconfig.h can include this file. * app/widgets/gimpcursor.c: added an assertion because of the changed GimpCursorType. * app/config/gimpguiconfig.[ch]: added a property for the help browser type. * app/gimprc.c * app/libgimp_glue.c * app/gui/preferences-dialog.c * tools/pdbgen/pdb/help.pdb * app/pdb/help_cmds.c: regenerated. Some nav_window cleanup before chopping: * app/nav_window.[ch]: removed the old preview code and use GimpNavigationPreviews only. Namespaceified all functions. Speak in terms of GimpDisplayShell, not GimpDisplay. Lots of internal cleanup. * app/gui/gui-types.h: removed NadiagtionDialog here... * app/display/display-types.h: ...and added it here. * app/display/gimpdisplayshell-callbacks.[ch]: added a callback for the navigation button and call nav_window_show_popup() from there. * app/display/gimpdisplayshell.c: free shell->nav_dialog unconditionally, connect to the new callback. * app/display/gimpdisplayshell-scale.c * app/display/gimpdisplayshell-scroll.c * app/gui/view-commands.c: changed accordingly. * app/widgets/gimppreview.c (gimp_preview_set_viewable): the assertion introduced recently was too tight, breaking GimpNavigationPreview. Changed it to do an "is a" check, not exact preview type matching. * app/widgets/gimpimagepreview.c: added quick-hack support for xres != yres. * app/widgets/gimpnavigationpreview.[ch]: made gimp_navigation_preview_grab_pointer() public so the nav_window can call it. Unrelated: * app/display/gimpdisplay.c: removed the gui/ dependency from this file by removing info_window stuff. * app/display/gimpdisplayshell.c (gimp_display_shell_flush): update the info_window here. * app/gui/dialogs-constructors.c (dialogs_indexed_palette_new): call gimp_dockable_set_context() like all other constructors. * app/undo.c * app/paint/gimppaintcore.h: some more include cleanup.
2002-05-06 03:17:41 +08:00
{
gimp_navigation_editor_popup (shell, widget,
(GdkEvent *) bevent,
bevent->x, bevent->y);
app/Makefile.am removed... 2002-05-05 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/gimphelp.[ch]: removed... * app/widgets/Makefile.am * app/widgets/gimphelp.[ch]: ...and added here. * app/widgets/widgets-enums.[ch]: added GimpHelpBrowserType here as registered enum. Added an evil hack with GimpCursorType so app/config/gimpguiconfig.h can include this file. * app/widgets/gimpcursor.c: added an assertion because of the changed GimpCursorType. * app/config/gimpguiconfig.[ch]: added a property for the help browser type. * app/gimprc.c * app/libgimp_glue.c * app/gui/preferences-dialog.c * tools/pdbgen/pdb/help.pdb * app/pdb/help_cmds.c: regenerated. Some nav_window cleanup before chopping: * app/nav_window.[ch]: removed the old preview code and use GimpNavigationPreviews only. Namespaceified all functions. Speak in terms of GimpDisplayShell, not GimpDisplay. Lots of internal cleanup. * app/gui/gui-types.h: removed NadiagtionDialog here... * app/display/display-types.h: ...and added it here. * app/display/gimpdisplayshell-callbacks.[ch]: added a callback for the navigation button and call nav_window_show_popup() from there. * app/display/gimpdisplayshell.c: free shell->nav_dialog unconditionally, connect to the new callback. * app/display/gimpdisplayshell-scale.c * app/display/gimpdisplayshell-scroll.c * app/gui/view-commands.c: changed accordingly. * app/widgets/gimppreview.c (gimp_preview_set_viewable): the assertion introduced recently was too tight, breaking GimpNavigationPreview. Changed it to do an "is a" check, not exact preview type matching. * app/widgets/gimpimagepreview.c: added quick-hack support for xres != yres. * app/widgets/gimpnavigationpreview.[ch]: made gimp_navigation_preview_grab_pointer() public so the nav_window can call it. Unrelated: * app/display/gimpdisplay.c: removed the gui/ dependency from this file by removing info_window stuff. * app/display/gimpdisplayshell.c (gimp_display_shell_flush): update the info_window here. * app/gui/dialogs-constructors.c (dialogs_indexed_palette_new): call gimp_dockable_set_context() like all other constructors. * app/undo.c * app/paint/gimppaintcore.h: some more include cleanup.
2002-05-06 03:17:41 +08:00
}
return TRUE;
}
/* private functions */
static void
gimp_display_shell_vadjustment_changed (GtkAdjustment *adjustment,
GimpDisplayShell *shell)
{
/* If we are panning with mouse, scrollbars are to be ignored or
* they will cause jitter in motion
*/
if (shell->mod_action == GIMP_MODIFIER_ACTION_NONE)
gimp_display_shell_scroll (shell,
0,
gtk_adjustment_get_value (adjustment) -
shell->offset_y);
}
static void
gimp_display_shell_hadjustment_changed (GtkAdjustment *adjustment,
GimpDisplayShell *shell)
{
/* If we are panning with mouse, scrollbars are to be ignored or
* they will cause jitter in motion
*/
if (shell->mod_action == GIMP_MODIFIER_ACTION_NONE)
gimp_display_shell_scroll (shell,
gtk_adjustment_get_value (adjustment) -
shell->offset_x,
0);
}
static gboolean
gimp_display_shell_hscrollbar_change_value (GtkRange *range,
GtkScrollType scroll,
gdouble value,
GimpDisplayShell *shell)
{
if (! shell->display)
return TRUE;
if ((scroll == GTK_SCROLL_JUMP) ||
(scroll == GTK_SCROLL_PAGE_BACKWARD) ||
(scroll == GTK_SCROLL_PAGE_FORWARD))
return FALSE;
g_object_freeze_notify (G_OBJECT (shell->hsbdata));
gimp_display_shell_scrollbars_setup_horizontal (shell, value);
g_object_thaw_notify (G_OBJECT (shell->hsbdata)); /* emits "changed" */
return FALSE;
}
static gboolean
gimp_display_shell_vscrollbar_change_value (GtkRange *range,
GtkScrollType scroll,
gdouble value,
GimpDisplayShell *shell)
{
if (! shell->display)
return TRUE;
if ((scroll == GTK_SCROLL_JUMP) ||
(scroll == GTK_SCROLL_PAGE_BACKWARD) ||
(scroll == GTK_SCROLL_PAGE_FORWARD))
return FALSE;
g_object_freeze_notify (G_OBJECT (shell->vsbdata));
gimp_display_shell_scrollbars_setup_vertical (shell, value);
g_object_thaw_notify (G_OBJECT (shell->vsbdata)); /* emits "changed" */
return FALSE;
}
static void
gimp_display_shell_canvas_draw_image (GimpDisplayShell *shell,
cairo_t *cr)
{
cairo_rectangle_list_t *clip_rectangles;
GeglRectangle image_rect;
GeglRectangle rotated_image_rect;
GeglRectangle canvas_rect;
cairo_matrix_t matrix;
gdouble x1, y1;
gdouble x2, y2;
gimp_display_shell_scale_get_image_unrotated_bounding_box (
shell,
&image_rect.x,
&image_rect.y,
&image_rect.width,
&image_rect.height);
gimp_display_shell_scale_get_image_unrotated_bounds (
shell,
&canvas_rect.x,
&canvas_rect.y,
&canvas_rect.width,
&canvas_rect.height);
/* first, draw the background
*/
gimp_display_shell_draw_background (shell, cr);
/* then, draw the exposed part of the region that is inside the
* image
*/
cairo_save (cr);
clip_rectangles = cairo_copy_clip_rectangle_list (cr);
cairo_get_matrix (cr, &matrix);
if (shell->rotate_transform)
cairo_transform (cr, shell->rotate_transform);
if (shell->show_all)
{
cairo_save (cr);
if (gimp_display_shell_get_padding_in_show_all (shell))
{
cairo_rectangle (cr,
canvas_rect.x,
canvas_rect.y,
canvas_rect.width,
canvas_rect.height);
cairo_clip (cr);
}
gimp_display_shell_draw_checkerboard (shell, cr);
cairo_restore (cr);
}
cairo_rectangle (cr,
image_rect.x,
image_rect.y,
image_rect.width,
image_rect.height);
cairo_clip (cr);
gimp_display_shell_rotate_bounds (shell,
image_rect.x,
image_rect.y,
image_rect.x + image_rect.width,
image_rect.y + image_rect.height,
&x1, &y1, &x2, &y2);
rotated_image_rect.x = floor (x1);
rotated_image_rect.y = floor (y1);
rotated_image_rect.width = ceil (x2) - rotated_image_rect.x;
rotated_image_rect.height = ceil (y2) - rotated_image_rect.y;
if (gdk_cairo_get_clip_rectangle (cr, NULL))
{
gint i;
if (! shell->show_all)
{
cairo_save (cr);
gimp_display_shell_draw_checkerboard (shell, cr);
cairo_restore (cr);
}
if (shell->show_image)
{
cairo_set_matrix (cr, &matrix);
for (i = 0; i < clip_rectangles->num_rectangles; i++)
{
cairo_rectangle_t clip_rect = clip_rectangles->rectangles[i];
GeglRectangle rect;
rect.x = floor (clip_rect.x);
rect.y = floor (clip_rect.y);
rect.width = ceil (clip_rect.x + clip_rect.width) - rect.x;
rect.height = ceil (clip_rect.y + clip_rect.height) - rect.y;
if (gegl_rectangle_intersect (&rect, &rect, &rotated_image_rect))
{
gimp_display_shell_draw_image (shell, cr,
rect.x, rect.y,
rect.width, rect.height);
}
}
}
}
cairo_rectangle_list_destroy (clip_rectangles);
cairo_restore (cr);
/* finally, draw all the remaining image window stuff on top
*/
/* draw canvas items */
cairo_save (cr);
if (shell->rotate_transform)
cairo_transform (cr, shell->rotate_transform);
gimp_canvas_item_draw (shell->canvas_item, cr);
cairo_restore (cr);
gimp_canvas_item_draw (shell->unrotated_item, cr);
/* restart (and recalculate) the selection boundaries */
gimp_display_shell_selection_draw (shell, cr);
gimp_display_shell_selection_restart (shell);
}
static void
gimp_display_shell_canvas_draw_drop_zone (GimpDisplayShell *shell,
cairo_t *cr)
{
cairo_save (cr);
gimp_display_shell_draw_background (shell, cr);
gimp_cairo_draw_drop_wilber (shell->canvas, cr, shell->blink);
cairo_restore (cr);
#ifdef GIMP_UNSTABLE
{
GtkWidget *widget = GTK_WIDGET (shell);
GtkStyleContext *context = gtk_widget_get_style_context (widget);
GtkStateFlags state = gtk_widget_get_state_flags (widget);
PangoLayout *layout;
gchar *msg;
GtkAllocation allocation;
gint width;
gint height;
gdouble scale;
GdkRGBA color;
layout = gtk_widget_create_pango_layout (shell->canvas, NULL);
msg = g_strdup_printf (_("<big>Unstable Development Version</big>\n\n"
"<small>commit <tt>%s</tt></small>\n\n"
"<small>Please test bugs against "
"latest git master branch\n"
"before reporting them.</small>"),
GIMP_GIT_VERSION_ABBREV);
pango_layout_set_markup (layout, msg, -1);
g_free (msg);
pango_layout_set_alignment (layout, PANGO_ALIGN_CENTER);
pango_layout_get_pixel_size (layout, &width, &height);
gtk_widget_get_allocation (shell->canvas, &allocation);
scale = MIN (((gdouble) allocation.width / 2.0) / (gdouble) width,
((gdouble) allocation.height / 2.0) / (gdouble) height);
gtk_style_context_get_color (context, state, &color);
gdk_cairo_set_source_rgba (cr, &color);
cairo_move_to (cr,
(allocation.width - (width * scale)) / 2,
(allocation.height - (height * scale)) / 2);
cairo_scale (cr, scale, scale);
pango_cairo_show_layout (cr, layout);
g_object_unref (layout);
}
#endif /* GIMP_UNSTABLE */
}