gimp/app/display/gimpdisplayshell-handlers.c

666 lines
27 KiB
C
Raw Normal View History

/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <gtk/gtk.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
#include "config/gimpdisplayconfig.h"
#include "core/gimp.h"
#include "core/gimpcontainer.h"
#include "core/gimpimage.h"
#include "core/gimpitem.h"
#include "widgets/gimpwidgets-utils.h"
#include "gimpdisplay.h"
#include "gimpdisplayoptions.h"
#include "gimpdisplayshell.h"
#include "gimpdisplayshell-appearance.h"
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
#include "gimpdisplayshell-callbacks.h"
#include "gimpdisplayshell-draw.h"
#include "gimpdisplayshell-handlers.h"
#include "gimpdisplayshell-scale.h"
#include "gimpdisplayshell-title.h"
app/display/Makefile.am app/display/display-types.h new widget derived 2002-02-03 Michael Natterer <mitch@gimp.org> * app/display/Makefile.am * app/display/display-types.h * app/display/gimpstatusbar.[ch]: new widget derived from GtkStatusbar. Contains the coordinates display, a progress bar which is also used for status message display and a cancel button. Added a simplified API for pushing/popping messages which takes a string as context_id and does the conversion to guint internally on each call. * app/display/gimpdisplayshell.[ch]: removed the status bar code. * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell-handlers.c * app/display/gimpdisplayshell-scale.c * app/gui/view-commands.c * app/gimpprogress.c: changed accordingly. Removed knowledge about GimpDisplayShell from tools: * app/tools/gimptool.[ch]: added gimp_tool_push_status() and gimp_tool_pop_status() so tools don't need to fiddle with display details. * app/tools/gimpdrawtool.[ch]: pass a GimpDisplay instead of a GdkWindow to gimp_draw_tool_start() (the window passed was always gdisp->shell->canvas->window). * app/tools/gimpbezierselecttool.c * app/tools/gimpblendtool.[ch] * app/tools/gimpclonetool.c * app/tools/gimpcolorpickertool.c * app/tools/gimpcroptool.[ch] * app/tools/gimpeditselectiontool.c * app/tools/gimpfreeselecttool.c * app/tools/gimpfuzzyselecttool.c * app/tools/gimpiscissorstool.c * app/tools/gimpmagnifytool.c * app/tools/gimpmeasuretool.[ch] * app/tools/gimpmovetool.c * app/tools/gimppainttool.[ch] * app/tools/gimppathtool.c * app/tools/gimprectselecttool.[ch] * app/tools/gimptransformtool.c: changed accordingly: - pass GimpDisplay to gimp_draw_tool_start(). - use GimpTool's new status push/pop functions. - removed the statusbar context_id from all tool structs. * app/gui/dialogs-constructors.[ch]: a bit cleanup in preparation of dockable editor dialogs.
2002-02-03 20:10:23 +08:00
#include "gimpstatusbar.h"
#define GIMP_DISPLAY_UPDATE_ICON_TIMEOUT 1000
/* local function prototypes */
static void gimp_display_shell_clean_dirty_handler (GimpImage *gimage,
GimpDisplayShell *shell);
static void gimp_display_shell_undo_event_handler (GimpImage *gimage,
Reimplemented the undo history: 2003-02-20 Michael Natterer <mitch@gimp.org> Reimplemented the undo history: * app/Makefile.am * app/undo_history.[ch]: removed. Changes/cleanups to the undo system to enable/simplify the new undo history implementation: * app/core/core-types.h: removed enum undo_event_t. Removed the GimpImage parameter from GimpUndoPopFunc and GimpUndoFreeFunc because GimpUndo has a GimpImage pointer now (see below). * app/core/core-enums.[ch]: added enum GimpUndoEvent. Added an enum value for REDO_EXPIRED. * app/core/gimpimage.[ch]: added a GimpUndo pointer to the "undo_event" signal which needs to be passed for all events except UNDO_FREE. * app/display/gimpdisplayshell-handlers.c: changed accordingly. * app/core/gimpundo.[ch]: added a GimpImage pointer to the GimpUndo struct. Removed GimpImage parameters all over the place. Added preview stuff. The preview creation needs to be triggered explicitly using gimp_undo_create_preview() because the GimpUndo can't know when it's possible to create the preview. * app/core/gimpimage-undo-push.c * app/paint/gimppaintcore-undo.c * app/tools/gimptransformtool-undo.c: changed accordingly, cleanup. * app/core/gimpundostack.[ch]: ditto. Return the freed undo from gimp_undo_stack_free_bottom(). Removed unused container signal handlers. * app/core/gimpimage-undo.c: free the redo stack the same way old undos are freed (from bottom up). Emit "undo_event" with event == REDO_EXPIRED for each removed redo. * app/core/gimpmarshal.list: added new marshallers. New undo history implementation: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpundoeditor.[ch] * app/widgets/gimpundopreview.[ch]: new widgets for the undo step previews and the history itself. * app/widgets/gimppreview-utils.c: added GimpUndoPreview to the list of possible preview types. * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c * app/gui/image-menu.c * app/gui/toolbox-menu.c: removed the old and added the new undo history to the dialog factory and the various dialog menus. * app/widgets/gimpdnd.[ch]: don't warn if a GType has no corresponding DND type. Instead, return FALSE from the function that failed. * app/widgets/gimppreview.c: check the return value of gimpdnd functions. Not only add drag sources but also remove them when no longer needed. * app/widgets/gimpselectioneditor.h: removed unneeded inclusion of "gui/gui-types.h".
2003-02-20 20:47:42 +08:00
GimpUndoEvent event,
GimpUndo *undo,
GimpDisplayShell *shell);
static void gimp_display_shell_grid_notify_handler (GimpGrid *grid,
GParamSpec *pspec,
Added a per image configurable grid. This fixes bug #65198 * app/core/Makefile.am * app/core/core-types.h: * app/core/gimpgrid.[ch]: added new class GimpGrid. * app/core/core-enums.[ch]: added new enum GimpGridType. * app/core/gimpimage-guides.[ch]: removed the gimp_image_snap_*() functions... * app/core/gimpimage-snap.[ch]: ...and added them here since they are no longer guide specific. * app/core/gimpimage-undo-push.[ch]: added gimp_image_undo_push_image_grid() * app/display/gimpdisplayshell-handlers.c: * app/core/gimpimage.[ch]: added grid member to _GimpImage. Added new signal "grid_changed", added gimp_image_grid_changed(), gimp_image_get_grid() and gimp_image_set_grid(). * app/display/gimpdisplayshell-appearance.[ch]: added gimp_display_shell_set_show_grid(), gimp_display_shell_get_show_grid(), gimp_display_shell_set_snap_to_grid() and gimp_display_shell_get_snap_to_grid(). * app/display/gimpdisplayshell-callbacks.c: added call to gimp_display_shell_draw_grid() * app/display/gimpdisplayshell.[ch]: added grid member to _GimpDisplayShellVisibility, added snap_to_grid and grid_dialog members to _GimpDisplayShell, added gimp_display_shell_draw_grid(), modified gimp_display_shell_snap_coords() to use the new gimp_image_snap_*() functions. * app/gui/image-menu.c: added grid entries to image_menu_entries[]. * app/gui/view-commands.[ch]: added view_configure_grid_cmd_callback(), view_toggle_grid_cmd_callback() and view_snap_to_grid_cmd_callback(). * app/gui/Makefile.am * app/gui/grid-dialog.[ch]: added a grid dialog.
2003-06-24 03:34:48 +08:00
GimpDisplayShell *shell);
static void gimp_display_shell_name_changed_handler (GimpImage *gimage,
GimpDisplayShell *shell);
static void gimp_display_shell_selection_control_handler (GimpImage *gimage,
GimpSelectionControl control,
GimpDisplayShell *shell);
static void gimp_display_shell_size_changed_handler (GimpImage *gimage,
GimpDisplayShell *shell);
static void gimp_display_shell_resolution_changed_handler (GimpImage *gimage,
GimpDisplayShell *shell);
static void gimp_display_shell_unit_changed_handler (GimpImage *gimage,
GimpDisplayShell *shell);
static void gimp_display_shell_qmask_changed_handler (GimpImage *gimage,
GimpDisplayShell *shell);
static void gimp_display_shell_update_guide_handler (GimpImage *gimage,
GimpGuide *guide,
GimpDisplayShell *shell);
static void gimp_display_shell_invalidate_preview_handler (GimpImage *gimage,
GimpDisplayShell *shell);
static void gimp_display_shell_vectors_freeze_handler (GimpVectors *vectors,
GimpDisplayShell *shell);
static void gimp_display_shell_vectors_thaw_handler (GimpVectors *vectors,
GimpDisplayShell *shell);
static void gimp_display_shell_vectors_visible_handler (GimpVectors *vectors,
GimpDisplayShell *shell);
static void gimp_display_shell_vectors_add_handler (GimpContainer *container,
GimpVectors *vectors,
GimpDisplayShell *shell);
static void gimp_display_shell_vectors_remove_handler (GimpContainer *container,
GimpVectors *vectors,
GimpDisplayShell *shell);
static void gimp_display_shell_check_notify_handler (GObject *config,
GParamSpec *param_spec,
GimpDisplayShell *shell);
static void gimp_display_shell_title_notify_handler (GObject *config,
GParamSpec *param_spec,
GimpDisplayShell *shell);
static void gimp_display_shell_nav_size_notify_handler (GObject *config,
GParamSpec *param_spec,
GimpDisplayShell *shell);
removed gimp_config_values_equal(). 2002-11-23 Michael Natterer <mitch@gimp.org> * app/config/gimpconfig-utils.[ch]: removed gimp_config_values_equal(). * app/config/gimpconfig-serialize.c * app/config/gimpconfig.c: use g_param_values_cmp() instead so our registered compare methods are used. * app/config/gimpdisplayconfig.[ch]: added "canvas_padding_mode" and "canvas_padding_color" properties. * app/display/display-enums.[ch]: added enum GimpDisplayPaddingMode which can be one of { theme, light check, dark check, custom }. * app/display/gimpdisplay.h * app/display/gimpdisplay-handlers.c: removed cached monitor resolution values... * app/display/gimpdisplayshell.[ch]: ...and added them here. Added padding state as in GimpDisplayConfig. Added utility function gimp_display_shell_set_padding() which hides all the details. Added the new padding modes to the padding color button's context menu. * app/display/gimpdisplayshell-callbacks.[ch]: don't fiddle with colors manually but use gimp_display_shell_set_padding() in realize() and in the color button callbacks. * app/display/gimpdisplayshell-handlers.c: connect to notify::monitor-[xy]resolution and notify::canvas-padding-[mode|color] and update accordingly. * app/widgets/gimppropwidgets.[ch]: added gimp_prop_color_button_new(). * app/widgets/gimpdialogfactory.[ch]: added gimp_dialog_factories_session_clear() (unimplemented). * app/gui/preferences-dialog.c: added widgets for padding mode and color. Removed some callbacks by connecting the functions they called directly. Cleanup.
2002-11-24 06:22:21 +08:00
static void gimp_display_shell_monitor_res_notify_handler (GObject *config,
GParamSpec *param_spec,
GimpDisplayShell *shell);
static void gimp_display_shell_padding_notify_handler (GObject *config,
GParamSpec *param_spec,
GimpDisplayShell *shell);
static void gimp_display_shell_ants_speed_notify_handler (GObject *config,
GParamSpec *param_spec,
GimpDisplayShell *shell);
static gboolean gimp_display_shell_idle_update_icon (gpointer data);
/* public functions */
void
gimp_display_shell_connect (GimpDisplayShell *shell)
{
removed gimp_config_values_equal(). 2002-11-23 Michael Natterer <mitch@gimp.org> * app/config/gimpconfig-utils.[ch]: removed gimp_config_values_equal(). * app/config/gimpconfig-serialize.c * app/config/gimpconfig.c: use g_param_values_cmp() instead so our registered compare methods are used. * app/config/gimpdisplayconfig.[ch]: added "canvas_padding_mode" and "canvas_padding_color" properties. * app/display/display-enums.[ch]: added enum GimpDisplayPaddingMode which can be one of { theme, light check, dark check, custom }. * app/display/gimpdisplay.h * app/display/gimpdisplay-handlers.c: removed cached monitor resolution values... * app/display/gimpdisplayshell.[ch]: ...and added them here. Added padding state as in GimpDisplayConfig. Added utility function gimp_display_shell_set_padding() which hides all the details. Added the new padding modes to the padding color button's context menu. * app/display/gimpdisplayshell-callbacks.[ch]: don't fiddle with colors manually but use gimp_display_shell_set_padding() in realize() and in the color button callbacks. * app/display/gimpdisplayshell-handlers.c: connect to notify::monitor-[xy]resolution and notify::canvas-padding-[mode|color] and update accordingly. * app/widgets/gimppropwidgets.[ch]: added gimp_prop_color_button_new(). * app/widgets/gimpdialogfactory.[ch]: added gimp_dialog_factories_session_clear() (unimplemented). * app/gui/preferences-dialog.c: added widgets for padding mode and color. Removed some callbacks by connecting the functions they called directly. Cleanup.
2002-11-24 06:22:21 +08:00
GimpImage *gimage;
GimpDisplayConfig *display_config;
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
g_return_if_fail (GIMP_IS_DISPLAY (shell->gdisp));
g_return_if_fail (GIMP_IS_IMAGE (shell->gdisp->gimage));
gimage = shell->gdisp->gimage;
removed gimp_config_values_equal(). 2002-11-23 Michael Natterer <mitch@gimp.org> * app/config/gimpconfig-utils.[ch]: removed gimp_config_values_equal(). * app/config/gimpconfig-serialize.c * app/config/gimpconfig.c: use g_param_values_cmp() instead so our registered compare methods are used. * app/config/gimpdisplayconfig.[ch]: added "canvas_padding_mode" and "canvas_padding_color" properties. * app/display/display-enums.[ch]: added enum GimpDisplayPaddingMode which can be one of { theme, light check, dark check, custom }. * app/display/gimpdisplay.h * app/display/gimpdisplay-handlers.c: removed cached monitor resolution values... * app/display/gimpdisplayshell.[ch]: ...and added them here. Added padding state as in GimpDisplayConfig. Added utility function gimp_display_shell_set_padding() which hides all the details. Added the new padding modes to the padding color button's context menu. * app/display/gimpdisplayshell-callbacks.[ch]: don't fiddle with colors manually but use gimp_display_shell_set_padding() in realize() and in the color button callbacks. * app/display/gimpdisplayshell-handlers.c: connect to notify::monitor-[xy]resolution and notify::canvas-padding-[mode|color] and update accordingly. * app/widgets/gimppropwidgets.[ch]: added gimp_prop_color_button_new(). * app/widgets/gimpdialogfactory.[ch]: added gimp_dialog_factories_session_clear() (unimplemented). * app/gui/preferences-dialog.c: added widgets for padding mode and color. Removed some callbacks by connecting the functions they called directly. Cleanup.
2002-11-24 06:22:21 +08:00
display_config = GIMP_DISPLAY_CONFIG (gimage->gimp->config);
g_signal_connect (gimage, "clean",
G_CALLBACK (gimp_display_shell_clean_dirty_handler),
shell);
g_signal_connect (gimage, "dirty",
G_CALLBACK (gimp_display_shell_clean_dirty_handler),
shell);
g_signal_connect (gimage, "undo_event",
G_CALLBACK (gimp_display_shell_undo_event_handler),
shell);
g_signal_connect (gimage->grid, "notify",
G_CALLBACK (gimp_display_shell_grid_notify_handler),
Added a per image configurable grid. This fixes bug #65198 * app/core/Makefile.am * app/core/core-types.h: * app/core/gimpgrid.[ch]: added new class GimpGrid. * app/core/core-enums.[ch]: added new enum GimpGridType. * app/core/gimpimage-guides.[ch]: removed the gimp_image_snap_*() functions... * app/core/gimpimage-snap.[ch]: ...and added them here since they are no longer guide specific. * app/core/gimpimage-undo-push.[ch]: added gimp_image_undo_push_image_grid() * app/display/gimpdisplayshell-handlers.c: * app/core/gimpimage.[ch]: added grid member to _GimpImage. Added new signal "grid_changed", added gimp_image_grid_changed(), gimp_image_get_grid() and gimp_image_set_grid(). * app/display/gimpdisplayshell-appearance.[ch]: added gimp_display_shell_set_show_grid(), gimp_display_shell_get_show_grid(), gimp_display_shell_set_snap_to_grid() and gimp_display_shell_get_snap_to_grid(). * app/display/gimpdisplayshell-callbacks.c: added call to gimp_display_shell_draw_grid() * app/display/gimpdisplayshell.[ch]: added grid member to _GimpDisplayShellVisibility, added snap_to_grid and grid_dialog members to _GimpDisplayShell, added gimp_display_shell_draw_grid(), modified gimp_display_shell_snap_coords() to use the new gimp_image_snap_*() functions. * app/gui/image-menu.c: added grid entries to image_menu_entries[]. * app/gui/view-commands.[ch]: added view_configure_grid_cmd_callback(), view_toggle_grid_cmd_callback() and view_snap_to_grid_cmd_callback(). * app/gui/Makefile.am * app/gui/grid-dialog.[ch]: added a grid dialog.
2003-06-24 03:34:48 +08:00
shell);
g_signal_connect (gimage, "name_changed",
G_CALLBACK (gimp_display_shell_name_changed_handler),
shell);
g_signal_connect (gimage, "selection_control",
G_CALLBACK (gimp_display_shell_selection_control_handler),
shell);
g_signal_connect (gimage, "size_changed",
G_CALLBACK (gimp_display_shell_size_changed_handler),
shell);
g_signal_connect (gimage, "resolution_changed",
G_CALLBACK (gimp_display_shell_resolution_changed_handler),
shell);
g_signal_connect (gimage, "unit_changed",
G_CALLBACK (gimp_display_shell_unit_changed_handler),
shell);
g_signal_connect (gimage, "qmask_changed",
G_CALLBACK (gimp_display_shell_qmask_changed_handler),
shell);
g_signal_connect (gimage, "update_guide",
G_CALLBACK (gimp_display_shell_update_guide_handler),
shell);
g_signal_connect (gimage, "invalidate_preview",
G_CALLBACK (gimp_display_shell_invalidate_preview_handler),
shell);
shell->vectors_freeze_handler =
gimp_container_add_handler (gimage->vectors, "freeze",
G_CALLBACK (gimp_display_shell_vectors_freeze_handler),
shell);
shell->vectors_thaw_handler =
gimp_container_add_handler (gimage->vectors, "thaw",
G_CALLBACK (gimp_display_shell_vectors_thaw_handler),
shell);
shell->vectors_visible_handler =
gimp_container_add_handler (gimage->vectors, "visibility_changed",
G_CALLBACK (gimp_display_shell_vectors_visible_handler),
shell);
g_signal_connect (gimage->vectors, "add",
G_CALLBACK (gimp_display_shell_vectors_add_handler),
shell);
g_signal_connect (gimage->vectors, "remove",
G_CALLBACK (gimp_display_shell_vectors_remove_handler),
shell);
g_signal_connect (gimage->gimp->config,
"notify::transparency-size",
G_CALLBACK (gimp_display_shell_check_notify_handler),
shell);
g_signal_connect (gimage->gimp->config,
"notify::transparency-type",
G_CALLBACK (gimp_display_shell_check_notify_handler),
shell);
g_signal_connect (gimage->gimp->config,
"notify::image-title-format",
G_CALLBACK (gimp_display_shell_title_notify_handler),
shell);
g_signal_connect (gimage->gimp->config,
"notify::image-status-format",
G_CALLBACK (gimp_display_shell_title_notify_handler),
shell);
g_signal_connect (gimage->gimp->config,
"notify::navigation-preview-size",
G_CALLBACK (gimp_display_shell_nav_size_notify_handler),
shell);
g_signal_connect (gimage->gimp->config,
"notify::monitor-resolution-from-windowing-system",
G_CALLBACK (gimp_display_shell_monitor_res_notify_handler),
shell);
g_signal_connect (gimage->gimp->config,
"notify::monitor-xresolution",
removed gimp_config_values_equal(). 2002-11-23 Michael Natterer <mitch@gimp.org> * app/config/gimpconfig-utils.[ch]: removed gimp_config_values_equal(). * app/config/gimpconfig-serialize.c * app/config/gimpconfig.c: use g_param_values_cmp() instead so our registered compare methods are used. * app/config/gimpdisplayconfig.[ch]: added "canvas_padding_mode" and "canvas_padding_color" properties. * app/display/display-enums.[ch]: added enum GimpDisplayPaddingMode which can be one of { theme, light check, dark check, custom }. * app/display/gimpdisplay.h * app/display/gimpdisplay-handlers.c: removed cached monitor resolution values... * app/display/gimpdisplayshell.[ch]: ...and added them here. Added padding state as in GimpDisplayConfig. Added utility function gimp_display_shell_set_padding() which hides all the details. Added the new padding modes to the padding color button's context menu. * app/display/gimpdisplayshell-callbacks.[ch]: don't fiddle with colors manually but use gimp_display_shell_set_padding() in realize() and in the color button callbacks. * app/display/gimpdisplayshell-handlers.c: connect to notify::monitor-[xy]resolution and notify::canvas-padding-[mode|color] and update accordingly. * app/widgets/gimppropwidgets.[ch]: added gimp_prop_color_button_new(). * app/widgets/gimpdialogfactory.[ch]: added gimp_dialog_factories_session_clear() (unimplemented). * app/gui/preferences-dialog.c: added widgets for padding mode and color. Removed some callbacks by connecting the functions they called directly. Cleanup.
2002-11-24 06:22:21 +08:00
G_CALLBACK (gimp_display_shell_monitor_res_notify_handler),
shell);
g_signal_connect (gimage->gimp->config,
"notify::monitor-yresolution",
removed gimp_config_values_equal(). 2002-11-23 Michael Natterer <mitch@gimp.org> * app/config/gimpconfig-utils.[ch]: removed gimp_config_values_equal(). * app/config/gimpconfig-serialize.c * app/config/gimpconfig.c: use g_param_values_cmp() instead so our registered compare methods are used. * app/config/gimpdisplayconfig.[ch]: added "canvas_padding_mode" and "canvas_padding_color" properties. * app/display/display-enums.[ch]: added enum GimpDisplayPaddingMode which can be one of { theme, light check, dark check, custom }. * app/display/gimpdisplay.h * app/display/gimpdisplay-handlers.c: removed cached monitor resolution values... * app/display/gimpdisplayshell.[ch]: ...and added them here. Added padding state as in GimpDisplayConfig. Added utility function gimp_display_shell_set_padding() which hides all the details. Added the new padding modes to the padding color button's context menu. * app/display/gimpdisplayshell-callbacks.[ch]: don't fiddle with colors manually but use gimp_display_shell_set_padding() in realize() and in the color button callbacks. * app/display/gimpdisplayshell-handlers.c: connect to notify::monitor-[xy]resolution and notify::canvas-padding-[mode|color] and update accordingly. * app/widgets/gimppropwidgets.[ch]: added gimp_prop_color_button_new(). * app/widgets/gimpdialogfactory.[ch]: added gimp_dialog_factories_session_clear() (unimplemented). * app/gui/preferences-dialog.c: added widgets for padding mode and color. Removed some callbacks by connecting the functions they called directly. Cleanup.
2002-11-24 06:22:21 +08:00
G_CALLBACK (gimp_display_shell_monitor_res_notify_handler),
shell);
g_signal_connect (display_config->default_view,
"notify::padding-mode",
removed gimp_config_values_equal(). 2002-11-23 Michael Natterer <mitch@gimp.org> * app/config/gimpconfig-utils.[ch]: removed gimp_config_values_equal(). * app/config/gimpconfig-serialize.c * app/config/gimpconfig.c: use g_param_values_cmp() instead so our registered compare methods are used. * app/config/gimpdisplayconfig.[ch]: added "canvas_padding_mode" and "canvas_padding_color" properties. * app/display/display-enums.[ch]: added enum GimpDisplayPaddingMode which can be one of { theme, light check, dark check, custom }. * app/display/gimpdisplay.h * app/display/gimpdisplay-handlers.c: removed cached monitor resolution values... * app/display/gimpdisplayshell.[ch]: ...and added them here. Added padding state as in GimpDisplayConfig. Added utility function gimp_display_shell_set_padding() which hides all the details. Added the new padding modes to the padding color button's context menu. * app/display/gimpdisplayshell-callbacks.[ch]: don't fiddle with colors manually but use gimp_display_shell_set_padding() in realize() and in the color button callbacks. * app/display/gimpdisplayshell-handlers.c: connect to notify::monitor-[xy]resolution and notify::canvas-padding-[mode|color] and update accordingly. * app/widgets/gimppropwidgets.[ch]: added gimp_prop_color_button_new(). * app/widgets/gimpdialogfactory.[ch]: added gimp_dialog_factories_session_clear() (unimplemented). * app/gui/preferences-dialog.c: added widgets for padding mode and color. Removed some callbacks by connecting the functions they called directly. Cleanup.
2002-11-24 06:22:21 +08:00
G_CALLBACK (gimp_display_shell_padding_notify_handler),
shell);
g_signal_connect (display_config->default_view,
"notify::padding-color",
removed gimp_config_values_equal(). 2002-11-23 Michael Natterer <mitch@gimp.org> * app/config/gimpconfig-utils.[ch]: removed gimp_config_values_equal(). * app/config/gimpconfig-serialize.c * app/config/gimpconfig.c: use g_param_values_cmp() instead so our registered compare methods are used. * app/config/gimpdisplayconfig.[ch]: added "canvas_padding_mode" and "canvas_padding_color" properties. * app/display/display-enums.[ch]: added enum GimpDisplayPaddingMode which can be one of { theme, light check, dark check, custom }. * app/display/gimpdisplay.h * app/display/gimpdisplay-handlers.c: removed cached monitor resolution values... * app/display/gimpdisplayshell.[ch]: ...and added them here. Added padding state as in GimpDisplayConfig. Added utility function gimp_display_shell_set_padding() which hides all the details. Added the new padding modes to the padding color button's context menu. * app/display/gimpdisplayshell-callbacks.[ch]: don't fiddle with colors manually but use gimp_display_shell_set_padding() in realize() and in the color button callbacks. * app/display/gimpdisplayshell-handlers.c: connect to notify::monitor-[xy]resolution and notify::canvas-padding-[mode|color] and update accordingly. * app/widgets/gimppropwidgets.[ch]: added gimp_prop_color_button_new(). * app/widgets/gimpdialogfactory.[ch]: added gimp_dialog_factories_session_clear() (unimplemented). * app/gui/preferences-dialog.c: added widgets for padding mode and color. Removed some callbacks by connecting the functions they called directly. Cleanup.
2002-11-24 06:22:21 +08:00
G_CALLBACK (gimp_display_shell_padding_notify_handler),
shell);
g_signal_connect (display_config->default_fullscreen_view,
"notify::padding-mode",
G_CALLBACK (gimp_display_shell_padding_notify_handler),
shell);
g_signal_connect (display_config->default_fullscreen_view,
"notify::padding-color",
G_CALLBACK (gimp_display_shell_padding_notify_handler),
shell);
g_signal_connect (gimage->gimp->config,
"notify::marching-ants-speed",
G_CALLBACK (gimp_display_shell_ants_speed_notify_handler),
shell);
gimp_display_shell_invalidate_preview_handler (gimage, shell);
gimp_display_shell_qmask_changed_handler (gimage, shell);
}
void
gimp_display_shell_disconnect (GimpDisplayShell *shell)
{
GimpImage *gimage;
GimpDisplayConfig *display_config;
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
g_return_if_fail (GIMP_IS_DISPLAY (shell->gdisp));
g_return_if_fail (GIMP_IS_IMAGE (shell->gdisp->gimage));
gimage = shell->gdisp->gimage;
display_config = GIMP_DISPLAY_CONFIG (gimage->gimp->config);
if (shell->icon_idle_id)
{
g_source_remove (shell->icon_idle_id);
shell->icon_idle_id = 0;
}
if (shell->grid_gc)
{
g_object_unref (shell->grid_gc);
shell->grid_gc = NULL;
}
g_signal_handlers_disconnect_by_func (gimage->gimp->config,
gimp_display_shell_ants_speed_notify_handler,
shell);
g_signal_handlers_disconnect_by_func (display_config->default_fullscreen_view,
gimp_display_shell_padding_notify_handler,
shell);
g_signal_handlers_disconnect_by_func (display_config->default_view,
removed gimp_config_values_equal(). 2002-11-23 Michael Natterer <mitch@gimp.org> * app/config/gimpconfig-utils.[ch]: removed gimp_config_values_equal(). * app/config/gimpconfig-serialize.c * app/config/gimpconfig.c: use g_param_values_cmp() instead so our registered compare methods are used. * app/config/gimpdisplayconfig.[ch]: added "canvas_padding_mode" and "canvas_padding_color" properties. * app/display/display-enums.[ch]: added enum GimpDisplayPaddingMode which can be one of { theme, light check, dark check, custom }. * app/display/gimpdisplay.h * app/display/gimpdisplay-handlers.c: removed cached monitor resolution values... * app/display/gimpdisplayshell.[ch]: ...and added them here. Added padding state as in GimpDisplayConfig. Added utility function gimp_display_shell_set_padding() which hides all the details. Added the new padding modes to the padding color button's context menu. * app/display/gimpdisplayshell-callbacks.[ch]: don't fiddle with colors manually but use gimp_display_shell_set_padding() in realize() and in the color button callbacks. * app/display/gimpdisplayshell-handlers.c: connect to notify::monitor-[xy]resolution and notify::canvas-padding-[mode|color] and update accordingly. * app/widgets/gimppropwidgets.[ch]: added gimp_prop_color_button_new(). * app/widgets/gimpdialogfactory.[ch]: added gimp_dialog_factories_session_clear() (unimplemented). * app/gui/preferences-dialog.c: added widgets for padding mode and color. Removed some callbacks by connecting the functions they called directly. Cleanup.
2002-11-24 06:22:21 +08:00
gimp_display_shell_padding_notify_handler,
shell);
g_signal_handlers_disconnect_by_func (gimage->gimp->config,
removed gimp_config_values_equal(). 2002-11-23 Michael Natterer <mitch@gimp.org> * app/config/gimpconfig-utils.[ch]: removed gimp_config_values_equal(). * app/config/gimpconfig-serialize.c * app/config/gimpconfig.c: use g_param_values_cmp() instead so our registered compare methods are used. * app/config/gimpdisplayconfig.[ch]: added "canvas_padding_mode" and "canvas_padding_color" properties. * app/display/display-enums.[ch]: added enum GimpDisplayPaddingMode which can be one of { theme, light check, dark check, custom }. * app/display/gimpdisplay.h * app/display/gimpdisplay-handlers.c: removed cached monitor resolution values... * app/display/gimpdisplayshell.[ch]: ...and added them here. Added padding state as in GimpDisplayConfig. Added utility function gimp_display_shell_set_padding() which hides all the details. Added the new padding modes to the padding color button's context menu. * app/display/gimpdisplayshell-callbacks.[ch]: don't fiddle with colors manually but use gimp_display_shell_set_padding() in realize() and in the color button callbacks. * app/display/gimpdisplayshell-handlers.c: connect to notify::monitor-[xy]resolution and notify::canvas-padding-[mode|color] and update accordingly. * app/widgets/gimppropwidgets.[ch]: added gimp_prop_color_button_new(). * app/widgets/gimpdialogfactory.[ch]: added gimp_dialog_factories_session_clear() (unimplemented). * app/gui/preferences-dialog.c: added widgets for padding mode and color. Removed some callbacks by connecting the functions they called directly. Cleanup.
2002-11-24 06:22:21 +08:00
gimp_display_shell_monitor_res_notify_handler,
shell);
g_signal_handlers_disconnect_by_func (gimage->gimp->config,
gimp_display_shell_nav_size_notify_handler,
shell);
g_signal_handlers_disconnect_by_func (gimage->gimp->config,
gimp_display_shell_title_notify_handler,
shell);
g_signal_handlers_disconnect_by_func (gimage->gimp->config,
gimp_display_shell_check_notify_handler,
shell);
g_signal_handlers_disconnect_by_func (gimage->vectors,
gimp_display_shell_vectors_remove_handler,
shell);
g_signal_handlers_disconnect_by_func (gimage->vectors,
gimp_display_shell_vectors_add_handler,
shell);
gimp_container_remove_handler (gimage->vectors,
shell->vectors_visible_handler);
gimp_container_remove_handler (gimage->vectors,
shell->vectors_thaw_handler);
gimp_container_remove_handler (gimage->vectors,
shell->vectors_freeze_handler);
g_signal_handlers_disconnect_by_func (gimage,
gimp_display_shell_invalidate_preview_handler,
shell);
g_signal_handlers_disconnect_by_func (gimage,
gimp_display_shell_update_guide_handler,
shell);
g_signal_handlers_disconnect_by_func (gimage,
gimp_display_shell_qmask_changed_handler,
shell);
g_signal_handlers_disconnect_by_func (gimage,
gimp_display_shell_unit_changed_handler,
shell);
g_signal_handlers_disconnect_by_func (gimage,
gimp_display_shell_resolution_changed_handler,
shell);
g_signal_handlers_disconnect_by_func (gimage,
gimp_display_shell_size_changed_handler,
shell);
g_signal_handlers_disconnect_by_func (gimage,
gimp_display_shell_selection_control_handler,
shell);
g_signal_handlers_disconnect_by_func (gimage,
gimp_display_shell_name_changed_handler,
shell);
g_signal_handlers_disconnect_by_func (gimage->grid,
gimp_display_shell_grid_notify_handler,
Added a per image configurable grid. This fixes bug #65198 * app/core/Makefile.am * app/core/core-types.h: * app/core/gimpgrid.[ch]: added new class GimpGrid. * app/core/core-enums.[ch]: added new enum GimpGridType. * app/core/gimpimage-guides.[ch]: removed the gimp_image_snap_*() functions... * app/core/gimpimage-snap.[ch]: ...and added them here since they are no longer guide specific. * app/core/gimpimage-undo-push.[ch]: added gimp_image_undo_push_image_grid() * app/display/gimpdisplayshell-handlers.c: * app/core/gimpimage.[ch]: added grid member to _GimpImage. Added new signal "grid_changed", added gimp_image_grid_changed(), gimp_image_get_grid() and gimp_image_set_grid(). * app/display/gimpdisplayshell-appearance.[ch]: added gimp_display_shell_set_show_grid(), gimp_display_shell_get_show_grid(), gimp_display_shell_set_snap_to_grid() and gimp_display_shell_get_snap_to_grid(). * app/display/gimpdisplayshell-callbacks.c: added call to gimp_display_shell_draw_grid() * app/display/gimpdisplayshell.[ch]: added grid member to _GimpDisplayShellVisibility, added snap_to_grid and grid_dialog members to _GimpDisplayShell, added gimp_display_shell_draw_grid(), modified gimp_display_shell_snap_coords() to use the new gimp_image_snap_*() functions. * app/gui/image-menu.c: added grid entries to image_menu_entries[]. * app/gui/view-commands.[ch]: added view_configure_grid_cmd_callback(), view_toggle_grid_cmd_callback() and view_snap_to_grid_cmd_callback(). * app/gui/Makefile.am * app/gui/grid-dialog.[ch]: added a grid dialog.
2003-06-24 03:34:48 +08:00
shell);
g_signal_handlers_disconnect_by_func (gimage,
gimp_display_shell_undo_event_handler,
shell);
g_signal_handlers_disconnect_by_func (gimage,
gimp_display_shell_clean_dirty_handler,
shell);
}
/* private functions */
static void
gimp_display_shell_clean_dirty_handler (GimpImage *gimage,
GimpDisplayShell *shell)
{
gimp_display_shell_update_title (shell);
}
static void
gimp_display_shell_undo_event_handler (GimpImage *gimage,
Reimplemented the undo history: 2003-02-20 Michael Natterer <mitch@gimp.org> Reimplemented the undo history: * app/Makefile.am * app/undo_history.[ch]: removed. Changes/cleanups to the undo system to enable/simplify the new undo history implementation: * app/core/core-types.h: removed enum undo_event_t. Removed the GimpImage parameter from GimpUndoPopFunc and GimpUndoFreeFunc because GimpUndo has a GimpImage pointer now (see below). * app/core/core-enums.[ch]: added enum GimpUndoEvent. Added an enum value for REDO_EXPIRED. * app/core/gimpimage.[ch]: added a GimpUndo pointer to the "undo_event" signal which needs to be passed for all events except UNDO_FREE. * app/display/gimpdisplayshell-handlers.c: changed accordingly. * app/core/gimpundo.[ch]: added a GimpImage pointer to the GimpUndo struct. Removed GimpImage parameters all over the place. Added preview stuff. The preview creation needs to be triggered explicitly using gimp_undo_create_preview() because the GimpUndo can't know when it's possible to create the preview. * app/core/gimpimage-undo-push.c * app/paint/gimppaintcore-undo.c * app/tools/gimptransformtool-undo.c: changed accordingly, cleanup. * app/core/gimpundostack.[ch]: ditto. Return the freed undo from gimp_undo_stack_free_bottom(). Removed unused container signal handlers. * app/core/gimpimage-undo.c: free the redo stack the same way old undos are freed (from bottom up). Emit "undo_event" with event == REDO_EXPIRED for each removed redo. * app/core/gimpmarshal.list: added new marshallers. New undo history implementation: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpundoeditor.[ch] * app/widgets/gimpundopreview.[ch]: new widgets for the undo step previews and the history itself. * app/widgets/gimppreview-utils.c: added GimpUndoPreview to the list of possible preview types. * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c * app/gui/image-menu.c * app/gui/toolbox-menu.c: removed the old and added the new undo history to the dialog factory and the various dialog menus. * app/widgets/gimpdnd.[ch]: don't warn if a GType has no corresponding DND type. Instead, return FALSE from the function that failed. * app/widgets/gimppreview.c: check the return value of gimpdnd functions. Not only add drag sources but also remove them when no longer needed. * app/widgets/gimpselectioneditor.h: removed unneeded inclusion of "gui/gui-types.h".
2003-02-20 20:47:42 +08:00
GimpUndoEvent event,
GimpUndo *undo,
GimpDisplayShell *shell)
{
gimp_display_shell_update_title (shell);
}
Added a per image configurable grid. This fixes bug #65198 * app/core/Makefile.am * app/core/core-types.h: * app/core/gimpgrid.[ch]: added new class GimpGrid. * app/core/core-enums.[ch]: added new enum GimpGridType. * app/core/gimpimage-guides.[ch]: removed the gimp_image_snap_*() functions... * app/core/gimpimage-snap.[ch]: ...and added them here since they are no longer guide specific. * app/core/gimpimage-undo-push.[ch]: added gimp_image_undo_push_image_grid() * app/display/gimpdisplayshell-handlers.c: * app/core/gimpimage.[ch]: added grid member to _GimpImage. Added new signal "grid_changed", added gimp_image_grid_changed(), gimp_image_get_grid() and gimp_image_set_grid(). * app/display/gimpdisplayshell-appearance.[ch]: added gimp_display_shell_set_show_grid(), gimp_display_shell_get_show_grid(), gimp_display_shell_set_snap_to_grid() and gimp_display_shell_get_snap_to_grid(). * app/display/gimpdisplayshell-callbacks.c: added call to gimp_display_shell_draw_grid() * app/display/gimpdisplayshell.[ch]: added grid member to _GimpDisplayShellVisibility, added snap_to_grid and grid_dialog members to _GimpDisplayShell, added gimp_display_shell_draw_grid(), modified gimp_display_shell_snap_coords() to use the new gimp_image_snap_*() functions. * app/gui/image-menu.c: added grid entries to image_menu_entries[]. * app/gui/view-commands.[ch]: added view_configure_grid_cmd_callback(), view_toggle_grid_cmd_callback() and view_snap_to_grid_cmd_callback(). * app/gui/Makefile.am * app/gui/grid-dialog.[ch]: added a grid dialog.
2003-06-24 03:34:48 +08:00
static void
gimp_display_shell_grid_notify_handler (GimpGrid *grid,
GParamSpec *pspec,
GimpDisplayShell *shell)
Added a per image configurable grid. This fixes bug #65198 * app/core/Makefile.am * app/core/core-types.h: * app/core/gimpgrid.[ch]: added new class GimpGrid. * app/core/core-enums.[ch]: added new enum GimpGridType. * app/core/gimpimage-guides.[ch]: removed the gimp_image_snap_*() functions... * app/core/gimpimage-snap.[ch]: ...and added them here since they are no longer guide specific. * app/core/gimpimage-undo-push.[ch]: added gimp_image_undo_push_image_grid() * app/display/gimpdisplayshell-handlers.c: * app/core/gimpimage.[ch]: added grid member to _GimpImage. Added new signal "grid_changed", added gimp_image_grid_changed(), gimp_image_get_grid() and gimp_image_set_grid(). * app/display/gimpdisplayshell-appearance.[ch]: added gimp_display_shell_set_show_grid(), gimp_display_shell_get_show_grid(), gimp_display_shell_set_snap_to_grid() and gimp_display_shell_get_snap_to_grid(). * app/display/gimpdisplayshell-callbacks.c: added call to gimp_display_shell_draw_grid() * app/display/gimpdisplayshell.[ch]: added grid member to _GimpDisplayShellVisibility, added snap_to_grid and grid_dialog members to _GimpDisplayShell, added gimp_display_shell_draw_grid(), modified gimp_display_shell_snap_coords() to use the new gimp_image_snap_*() functions. * app/gui/image-menu.c: added grid entries to image_menu_entries[]. * app/gui/view-commands.[ch]: added view_configure_grid_cmd_callback(), view_toggle_grid_cmd_callback() and view_snap_to_grid_cmd_callback(). * app/gui/Makefile.am * app/gui/grid-dialog.[ch]: added a grid dialog.
2003-06-24 03:34:48 +08:00
{
if (shell->grid_gc)
{
g_object_unref (shell->grid_gc);
shell->grid_gc = NULL;
}
Added a per image configurable grid. This fixes bug #65198 * app/core/Makefile.am * app/core/core-types.h: * app/core/gimpgrid.[ch]: added new class GimpGrid. * app/core/core-enums.[ch]: added new enum GimpGridType. * app/core/gimpimage-guides.[ch]: removed the gimp_image_snap_*() functions... * app/core/gimpimage-snap.[ch]: ...and added them here since they are no longer guide specific. * app/core/gimpimage-undo-push.[ch]: added gimp_image_undo_push_image_grid() * app/display/gimpdisplayshell-handlers.c: * app/core/gimpimage.[ch]: added grid member to _GimpImage. Added new signal "grid_changed", added gimp_image_grid_changed(), gimp_image_get_grid() and gimp_image_set_grid(). * app/display/gimpdisplayshell-appearance.[ch]: added gimp_display_shell_set_show_grid(), gimp_display_shell_get_show_grid(), gimp_display_shell_set_snap_to_grid() and gimp_display_shell_get_snap_to_grid(). * app/display/gimpdisplayshell-callbacks.c: added call to gimp_display_shell_draw_grid() * app/display/gimpdisplayshell.[ch]: added grid member to _GimpDisplayShellVisibility, added snap_to_grid and grid_dialog members to _GimpDisplayShell, added gimp_display_shell_draw_grid(), modified gimp_display_shell_snap_coords() to use the new gimp_image_snap_*() functions. * app/gui/image-menu.c: added grid entries to image_menu_entries[]. * app/gui/view-commands.[ch]: added view_configure_grid_cmd_callback(), view_toggle_grid_cmd_callback() and view_snap_to_grid_cmd_callback(). * app/gui/Makefile.am * app/gui/grid-dialog.[ch]: added a grid dialog.
2003-06-24 03:34:48 +08:00
gimp_display_shell_expose_full (shell);
/* update item factory */
gimp_display_flush (shell->gdisp);
}
static void
gimp_display_shell_name_changed_handler (GimpImage *gimage,
GimpDisplayShell *shell)
{
gimp_display_shell_update_title (shell);
}
static void
gimp_display_shell_selection_control_handler (GimpImage *gimage,
GimpSelectionControl control,
GimpDisplayShell *shell)
{
gimp_display_shell_selection_visibility (shell, control);
}
static void
gimp_display_shell_size_changed_handler (GimpImage *gimage,
GimpDisplayShell *shell)
{
app/display/Makefile.am app/display/display-types.h new widget derived 2002-02-03 Michael Natterer <mitch@gimp.org> * app/display/Makefile.am * app/display/display-types.h * app/display/gimpstatusbar.[ch]: new widget derived from GtkStatusbar. Contains the coordinates display, a progress bar which is also used for status message display and a cancel button. Added a simplified API for pushing/popping messages which takes a string as context_id and does the conversion to guint internally on each call. * app/display/gimpdisplayshell.[ch]: removed the status bar code. * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell-handlers.c * app/display/gimpdisplayshell-scale.c * app/gui/view-commands.c * app/gimpprogress.c: changed accordingly. Removed knowledge about GimpDisplayShell from tools: * app/tools/gimptool.[ch]: added gimp_tool_push_status() and gimp_tool_pop_status() so tools don't need to fiddle with display details. * app/tools/gimpdrawtool.[ch]: pass a GimpDisplay instead of a GdkWindow to gimp_draw_tool_start() (the window passed was always gdisp->shell->canvas->window). * app/tools/gimpbezierselecttool.c * app/tools/gimpblendtool.[ch] * app/tools/gimpclonetool.c * app/tools/gimpcolorpickertool.c * app/tools/gimpcroptool.[ch] * app/tools/gimpeditselectiontool.c * app/tools/gimpfreeselecttool.c * app/tools/gimpfuzzyselecttool.c * app/tools/gimpiscissorstool.c * app/tools/gimpmagnifytool.c * app/tools/gimpmeasuretool.[ch] * app/tools/gimpmovetool.c * app/tools/gimppainttool.[ch] * app/tools/gimppathtool.c * app/tools/gimprectselecttool.[ch] * app/tools/gimptransformtool.c: changed accordingly: - pass GimpDisplay to gimp_draw_tool_start(). - use GimpTool's new status push/pop functions. - removed the statusbar context_id from all tool structs. * app/gui/dialogs-constructors.[ch]: a bit cleanup in preparation of dockable editor dialogs.
2002-02-03 20:10:23 +08:00
gimp_statusbar_resize_cursor (GIMP_STATUSBAR (shell->statusbar));
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
gimp_display_shell_scale_resize (shell,
GIMP_DISPLAY_CONFIG (gimage->gimp->config)->resize_windows_on_resize,
TRUE);
}
static void
gimp_display_shell_resolution_changed_handler (GimpImage *gimage,
GimpDisplayShell *shell)
{
if (! shell->dot_for_dot)
{
gimp_display_shell_scale_setup (shell);
gimp_display_shell_scaled (shell);
}
app/display/Makefile.am app/display/display-types.h new widget derived 2002-02-03 Michael Natterer <mitch@gimp.org> * app/display/Makefile.am * app/display/display-types.h * app/display/gimpstatusbar.[ch]: new widget derived from GtkStatusbar. Contains the coordinates display, a progress bar which is also used for status message display and a cancel button. Added a simplified API for pushing/popping messages which takes a string as context_id and does the conversion to guint internally on each call. * app/display/gimpdisplayshell.[ch]: removed the status bar code. * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell-handlers.c * app/display/gimpdisplayshell-scale.c * app/gui/view-commands.c * app/gimpprogress.c: changed accordingly. Removed knowledge about GimpDisplayShell from tools: * app/tools/gimptool.[ch]: added gimp_tool_push_status() and gimp_tool_pop_status() so tools don't need to fiddle with display details. * app/tools/gimpdrawtool.[ch]: pass a GimpDisplay instead of a GdkWindow to gimp_draw_tool_start() (the window passed was always gdisp->shell->canvas->window). * app/tools/gimpbezierselecttool.c * app/tools/gimpblendtool.[ch] * app/tools/gimpclonetool.c * app/tools/gimpcolorpickertool.c * app/tools/gimpcroptool.[ch] * app/tools/gimpeditselectiontool.c * app/tools/gimpfreeselecttool.c * app/tools/gimpfuzzyselecttool.c * app/tools/gimpiscissorstool.c * app/tools/gimpmagnifytool.c * app/tools/gimpmeasuretool.[ch] * app/tools/gimpmovetool.c * app/tools/gimppainttool.[ch] * app/tools/gimppathtool.c * app/tools/gimprectselecttool.[ch] * app/tools/gimptransformtool.c: changed accordingly: - pass GimpDisplay to gimp_draw_tool_start(). - use GimpTool's new status push/pop functions. - removed the statusbar context_id from all tool structs. * app/gui/dialogs-constructors.[ch]: a bit cleanup in preparation of dockable editor dialogs.
2002-02-03 20:10:23 +08:00
gimp_statusbar_resize_cursor (GIMP_STATUSBAR (shell->statusbar));
}
static void
gimp_display_shell_unit_changed_handler (GimpImage *gimage,
GimpDisplayShell *shell)
{
if (! shell->dot_for_dot)
{
gimp_display_shell_scale_setup (shell);
gimp_display_shell_scaled (shell);
}
app/display/Makefile.am app/display/display-types.h new widget derived 2002-02-03 Michael Natterer <mitch@gimp.org> * app/display/Makefile.am * app/display/display-types.h * app/display/gimpstatusbar.[ch]: new widget derived from GtkStatusbar. Contains the coordinates display, a progress bar which is also used for status message display and a cancel button. Added a simplified API for pushing/popping messages which takes a string as context_id and does the conversion to guint internally on each call. * app/display/gimpdisplayshell.[ch]: removed the status bar code. * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell-handlers.c * app/display/gimpdisplayshell-scale.c * app/gui/view-commands.c * app/gimpprogress.c: changed accordingly. Removed knowledge about GimpDisplayShell from tools: * app/tools/gimptool.[ch]: added gimp_tool_push_status() and gimp_tool_pop_status() so tools don't need to fiddle with display details. * app/tools/gimpdrawtool.[ch]: pass a GimpDisplay instead of a GdkWindow to gimp_draw_tool_start() (the window passed was always gdisp->shell->canvas->window). * app/tools/gimpbezierselecttool.c * app/tools/gimpblendtool.[ch] * app/tools/gimpclonetool.c * app/tools/gimpcolorpickertool.c * app/tools/gimpcroptool.[ch] * app/tools/gimpeditselectiontool.c * app/tools/gimpfreeselecttool.c * app/tools/gimpfuzzyselecttool.c * app/tools/gimpiscissorstool.c * app/tools/gimpmagnifytool.c * app/tools/gimpmeasuretool.[ch] * app/tools/gimpmovetool.c * app/tools/gimppainttool.[ch] * app/tools/gimppathtool.c * app/tools/gimprectselecttool.[ch] * app/tools/gimptransformtool.c: changed accordingly: - pass GimpDisplay to gimp_draw_tool_start(). - use GimpTool's new status push/pop functions. - removed the statusbar context_id from all tool structs. * app/gui/dialogs-constructors.[ch]: a bit cleanup in preparation of dockable editor dialogs.
2002-02-03 20:10:23 +08:00
gimp_statusbar_resize_cursor (GIMP_STATUSBAR (shell->statusbar));
}
static void
gimp_display_shell_qmask_changed_handler (GimpImage *gimage,
GimpDisplayShell *shell)
{
GtkImage *image;
image = GTK_IMAGE (GTK_BIN (shell->qmask)->child);
g_signal_handlers_block_by_func (shell->qmask,
gimp_display_shell_qmask_toggled,
shell);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (shell->qmask),
shell->gdisp->gimage->qmask_state);
if (shell->gdisp->gimage->qmask_state)
gtk_image_set_from_stock (image, GIMP_STOCK_QMASK_ON, GTK_ICON_SIZE_MENU);
else
gtk_image_set_from_stock (image, GIMP_STOCK_QMASK_OFF, GTK_ICON_SIZE_MENU);
g_signal_handlers_unblock_by_func (shell->qmask,
gimp_display_shell_qmask_toggled,
shell);
}
static void
gimp_display_shell_update_guide_handler (GimpImage *gimage,
GimpGuide *guide,
GimpDisplayShell *shell)
{
gimp_display_shell_expose_guide (shell, guide);
}
static void
gimp_display_shell_invalidate_preview_handler (GimpImage *gimage,
GimpDisplayShell *shell)
{
if (shell->icon_idle_id)
g_source_remove (shell->icon_idle_id);
shell->icon_idle_id = g_timeout_add_full (G_PRIORITY_LOW,
GIMP_DISPLAY_UPDATE_ICON_TIMEOUT,
gimp_display_shell_idle_update_icon,
shell,
NULL);
}
static void
gimp_display_shell_vectors_freeze_handler (GimpVectors *vectors,
GimpDisplayShell *shell)
{
if (shell->paused_count == 0 && gimp_item_get_visible (GIMP_ITEM (vectors)))
gimp_display_shell_draw_vector (shell, vectors);
}
static void
gimp_display_shell_vectors_thaw_handler (GimpVectors *vectors,
GimpDisplayShell *shell)
{
if (shell->paused_count == 0 && gimp_item_get_visible (GIMP_ITEM (vectors)))
gimp_display_shell_draw_vector (shell, vectors);
}
static void
gimp_display_shell_vectors_visible_handler (GimpVectors *vectors,
GimpDisplayShell *shell)
{
if (shell->paused_count == 0)
gimp_display_shell_draw_vector (shell, vectors);
}
static void
gimp_display_shell_vectors_add_handler (GimpContainer *container,
GimpVectors *vectors,
GimpDisplayShell *shell)
{
if (shell->paused_count == 0 && gimp_item_get_visible (GIMP_ITEM (vectors)))
gimp_display_shell_draw_vector (shell, vectors);
}
static void
gimp_display_shell_vectors_remove_handler (GimpContainer *container,
GimpVectors *vectors,
GimpDisplayShell *shell)
{
if (shell->paused_count == 0 && gimp_item_get_visible (GIMP_ITEM (vectors)))
gimp_display_shell_draw_vector (shell, vectors);
}
static void
gimp_display_shell_check_notify_handler (GObject *config,
GParamSpec *param_spec,
GimpDisplayShell *shell)
{
GimpCanvasPaddingMode padding_mode;
GimpRGB padding_color;
gimp_display_shell_get_padding (shell, &padding_mode, &padding_color);
switch (padding_mode)
removed gimp_config_values_equal(). 2002-11-23 Michael Natterer <mitch@gimp.org> * app/config/gimpconfig-utils.[ch]: removed gimp_config_values_equal(). * app/config/gimpconfig-serialize.c * app/config/gimpconfig.c: use g_param_values_cmp() instead so our registered compare methods are used. * app/config/gimpdisplayconfig.[ch]: added "canvas_padding_mode" and "canvas_padding_color" properties. * app/display/display-enums.[ch]: added enum GimpDisplayPaddingMode which can be one of { theme, light check, dark check, custom }. * app/display/gimpdisplay.h * app/display/gimpdisplay-handlers.c: removed cached monitor resolution values... * app/display/gimpdisplayshell.[ch]: ...and added them here. Added padding state as in GimpDisplayConfig. Added utility function gimp_display_shell_set_padding() which hides all the details. Added the new padding modes to the padding color button's context menu. * app/display/gimpdisplayshell-callbacks.[ch]: don't fiddle with colors manually but use gimp_display_shell_set_padding() in realize() and in the color button callbacks. * app/display/gimpdisplayshell-handlers.c: connect to notify::monitor-[xy]resolution and notify::canvas-padding-[mode|color] and update accordingly. * app/widgets/gimppropwidgets.[ch]: added gimp_prop_color_button_new(). * app/widgets/gimpdialogfactory.[ch]: added gimp_dialog_factories_session_clear() (unimplemented). * app/gui/preferences-dialog.c: added widgets for padding mode and color. Removed some callbacks by connecting the functions they called directly. Cleanup.
2002-11-24 06:22:21 +08:00
{
case GIMP_CANVAS_PADDING_MODE_LIGHT_CHECK:
case GIMP_CANVAS_PADDING_MODE_DARK_CHECK:
gimp_display_shell_set_padding (shell, padding_mode, &padding_color);
removed gimp_config_values_equal(). 2002-11-23 Michael Natterer <mitch@gimp.org> * app/config/gimpconfig-utils.[ch]: removed gimp_config_values_equal(). * app/config/gimpconfig-serialize.c * app/config/gimpconfig.c: use g_param_values_cmp() instead so our registered compare methods are used. * app/config/gimpdisplayconfig.[ch]: added "canvas_padding_mode" and "canvas_padding_color" properties. * app/display/display-enums.[ch]: added enum GimpDisplayPaddingMode which can be one of { theme, light check, dark check, custom }. * app/display/gimpdisplay.h * app/display/gimpdisplay-handlers.c: removed cached monitor resolution values... * app/display/gimpdisplayshell.[ch]: ...and added them here. Added padding state as in GimpDisplayConfig. Added utility function gimp_display_shell_set_padding() which hides all the details. Added the new padding modes to the padding color button's context menu. * app/display/gimpdisplayshell-callbacks.[ch]: don't fiddle with colors manually but use gimp_display_shell_set_padding() in realize() and in the color button callbacks. * app/display/gimpdisplayshell-handlers.c: connect to notify::monitor-[xy]resolution and notify::canvas-padding-[mode|color] and update accordingly. * app/widgets/gimppropwidgets.[ch]: added gimp_prop_color_button_new(). * app/widgets/gimpdialogfactory.[ch]: added gimp_dialog_factories_session_clear() (unimplemented). * app/gui/preferences-dialog.c: added widgets for padding mode and color. Removed some callbacks by connecting the functions they called directly. Cleanup.
2002-11-24 06:22:21 +08:00
break;
default:
break;
}
gimp_display_shell_expose_full (shell);
}
static void
gimp_display_shell_title_notify_handler (GObject *config,
GParamSpec *param_spec,
GimpDisplayShell *shell)
{
gimp_display_shell_update_title (shell);
}
static void
gimp_display_shell_nav_size_notify_handler (GObject *config,
GParamSpec *param_spec,
GimpDisplayShell *shell)
{
if (shell->nav_popup)
{
gtk_widget_destroy (shell->nav_popup);
shell->nav_popup = NULL;
}
}
removed gimp_config_values_equal(). 2002-11-23 Michael Natterer <mitch@gimp.org> * app/config/gimpconfig-utils.[ch]: removed gimp_config_values_equal(). * app/config/gimpconfig-serialize.c * app/config/gimpconfig.c: use g_param_values_cmp() instead so our registered compare methods are used. * app/config/gimpdisplayconfig.[ch]: added "canvas_padding_mode" and "canvas_padding_color" properties. * app/display/display-enums.[ch]: added enum GimpDisplayPaddingMode which can be one of { theme, light check, dark check, custom }. * app/display/gimpdisplay.h * app/display/gimpdisplay-handlers.c: removed cached monitor resolution values... * app/display/gimpdisplayshell.[ch]: ...and added them here. Added padding state as in GimpDisplayConfig. Added utility function gimp_display_shell_set_padding() which hides all the details. Added the new padding modes to the padding color button's context menu. * app/display/gimpdisplayshell-callbacks.[ch]: don't fiddle with colors manually but use gimp_display_shell_set_padding() in realize() and in the color button callbacks. * app/display/gimpdisplayshell-handlers.c: connect to notify::monitor-[xy]resolution and notify::canvas-padding-[mode|color] and update accordingly. * app/widgets/gimppropwidgets.[ch]: added gimp_prop_color_button_new(). * app/widgets/gimpdialogfactory.[ch]: added gimp_dialog_factories_session_clear() (unimplemented). * app/gui/preferences-dialog.c: added widgets for padding mode and color. Removed some callbacks by connecting the functions they called directly. Cleanup.
2002-11-24 06:22:21 +08:00
static void
gimp_display_shell_monitor_res_notify_handler (GObject *config,
GParamSpec *param_spec,
GimpDisplayShell *shell)
{
if (GIMP_DISPLAY_CONFIG (config)->monitor_res_from_gdk)
{
gimp_get_screen_resolution (gtk_widget_get_screen (GTK_WIDGET (shell)),
&shell->monitor_xres,
&shell->monitor_yres);
}
else
{
shell->monitor_xres = GIMP_DISPLAY_CONFIG (config)->monitor_xres;
shell->monitor_yres = GIMP_DISPLAY_CONFIG (config)->monitor_yres;
}
removed gimp_config_values_equal(). 2002-11-23 Michael Natterer <mitch@gimp.org> * app/config/gimpconfig-utils.[ch]: removed gimp_config_values_equal(). * app/config/gimpconfig-serialize.c * app/config/gimpconfig.c: use g_param_values_cmp() instead so our registered compare methods are used. * app/config/gimpdisplayconfig.[ch]: added "canvas_padding_mode" and "canvas_padding_color" properties. * app/display/display-enums.[ch]: added enum GimpDisplayPaddingMode which can be one of { theme, light check, dark check, custom }. * app/display/gimpdisplay.h * app/display/gimpdisplay-handlers.c: removed cached monitor resolution values... * app/display/gimpdisplayshell.[ch]: ...and added them here. Added padding state as in GimpDisplayConfig. Added utility function gimp_display_shell_set_padding() which hides all the details. Added the new padding modes to the padding color button's context menu. * app/display/gimpdisplayshell-callbacks.[ch]: don't fiddle with colors manually but use gimp_display_shell_set_padding() in realize() and in the color button callbacks. * app/display/gimpdisplayshell-handlers.c: connect to notify::monitor-[xy]resolution and notify::canvas-padding-[mode|color] and update accordingly. * app/widgets/gimppropwidgets.[ch]: added gimp_prop_color_button_new(). * app/widgets/gimpdialogfactory.[ch]: added gimp_dialog_factories_session_clear() (unimplemented). * app/gui/preferences-dialog.c: added widgets for padding mode and color. Removed some callbacks by connecting the functions they called directly. Cleanup.
2002-11-24 06:22:21 +08:00
if (! shell->dot_for_dot)
{
gimp_display_shell_scale_setup (shell);
gimp_display_shell_scaled (shell);
gimp_statusbar_resize_cursor (GIMP_STATUSBAR (shell->statusbar));
gimp_display_shell_expose_full (shell);
}
removed gimp_config_values_equal(). 2002-11-23 Michael Natterer <mitch@gimp.org> * app/config/gimpconfig-utils.[ch]: removed gimp_config_values_equal(). * app/config/gimpconfig-serialize.c * app/config/gimpconfig.c: use g_param_values_cmp() instead so our registered compare methods are used. * app/config/gimpdisplayconfig.[ch]: added "canvas_padding_mode" and "canvas_padding_color" properties. * app/display/display-enums.[ch]: added enum GimpDisplayPaddingMode which can be one of { theme, light check, dark check, custom }. * app/display/gimpdisplay.h * app/display/gimpdisplay-handlers.c: removed cached monitor resolution values... * app/display/gimpdisplayshell.[ch]: ...and added them here. Added padding state as in GimpDisplayConfig. Added utility function gimp_display_shell_set_padding() which hides all the details. Added the new padding modes to the padding color button's context menu. * app/display/gimpdisplayshell-callbacks.[ch]: don't fiddle with colors manually but use gimp_display_shell_set_padding() in realize() and in the color button callbacks. * app/display/gimpdisplayshell-handlers.c: connect to notify::monitor-[xy]resolution and notify::canvas-padding-[mode|color] and update accordingly. * app/widgets/gimppropwidgets.[ch]: added gimp_prop_color_button_new(). * app/widgets/gimpdialogfactory.[ch]: added gimp_dialog_factories_session_clear() (unimplemented). * app/gui/preferences-dialog.c: added widgets for padding mode and color. Removed some callbacks by connecting the functions they called directly. Cleanup.
2002-11-24 06:22:21 +08:00
}
static void
gimp_display_shell_padding_notify_handler (GObject *config,
GParamSpec *param_spec,
GimpDisplayShell *shell)
{
GimpDisplayConfig *display_config;
gboolean fullscreen;
GimpCanvasPaddingMode padding_mode;
GimpRGB padding_color;
removed gimp_config_values_equal(). 2002-11-23 Michael Natterer <mitch@gimp.org> * app/config/gimpconfig-utils.[ch]: removed gimp_config_values_equal(). * app/config/gimpconfig-serialize.c * app/config/gimpconfig.c: use g_param_values_cmp() instead so our registered compare methods are used. * app/config/gimpdisplayconfig.[ch]: added "canvas_padding_mode" and "canvas_padding_color" properties. * app/display/display-enums.[ch]: added enum GimpDisplayPaddingMode which can be one of { theme, light check, dark check, custom }. * app/display/gimpdisplay.h * app/display/gimpdisplay-handlers.c: removed cached monitor resolution values... * app/display/gimpdisplayshell.[ch]: ...and added them here. Added padding state as in GimpDisplayConfig. Added utility function gimp_display_shell_set_padding() which hides all the details. Added the new padding modes to the padding color button's context menu. * app/display/gimpdisplayshell-callbacks.[ch]: don't fiddle with colors manually but use gimp_display_shell_set_padding() in realize() and in the color button callbacks. * app/display/gimpdisplayshell-handlers.c: connect to notify::monitor-[xy]resolution and notify::canvas-padding-[mode|color] and update accordingly. * app/widgets/gimppropwidgets.[ch]: added gimp_prop_color_button_new(). * app/widgets/gimpdialogfactory.[ch]: added gimp_dialog_factories_session_clear() (unimplemented). * app/gui/preferences-dialog.c: added widgets for padding mode and color. Removed some callbacks by connecting the functions they called directly. Cleanup.
2002-11-24 06:22:21 +08:00
display_config = GIMP_DISPLAY_CONFIG (shell->gdisp->gimage->gimp->config);
removed gimp_config_values_equal(). 2002-11-23 Michael Natterer <mitch@gimp.org> * app/config/gimpconfig-utils.[ch]: removed gimp_config_values_equal(). * app/config/gimpconfig-serialize.c * app/config/gimpconfig.c: use g_param_values_cmp() instead so our registered compare methods are used. * app/config/gimpdisplayconfig.[ch]: added "canvas_padding_mode" and "canvas_padding_color" properties. * app/display/display-enums.[ch]: added enum GimpDisplayPaddingMode which can be one of { theme, light check, dark check, custom }. * app/display/gimpdisplay.h * app/display/gimpdisplay-handlers.c: removed cached monitor resolution values... * app/display/gimpdisplayshell.[ch]: ...and added them here. Added padding state as in GimpDisplayConfig. Added utility function gimp_display_shell_set_padding() which hides all the details. Added the new padding modes to the padding color button's context menu. * app/display/gimpdisplayshell-callbacks.[ch]: don't fiddle with colors manually but use gimp_display_shell_set_padding() in realize() and in the color button callbacks. * app/display/gimpdisplayshell-handlers.c: connect to notify::monitor-[xy]resolution and notify::canvas-padding-[mode|color] and update accordingly. * app/widgets/gimppropwidgets.[ch]: added gimp_prop_color_button_new(). * app/widgets/gimpdialogfactory.[ch]: added gimp_dialog_factories_session_clear() (unimplemented). * app/gui/preferences-dialog.c: added widgets for padding mode and color. Removed some callbacks by connecting the functions they called directly. Cleanup.
2002-11-24 06:22:21 +08:00
fullscreen = gimp_display_shell_get_fullscreen (shell);
/* if the user did not set the padding mode for this display explicitely */
if (! shell->fullscreen_options->padding_mode_set)
{
padding_mode = display_config->default_fullscreen_view->padding_mode;
padding_color = display_config->default_fullscreen_view->padding_color;
if (fullscreen)
{
gimp_display_shell_set_padding (shell, padding_mode, &padding_color);
}
else
{
shell->fullscreen_options->padding_mode = padding_mode;
shell->fullscreen_options->padding_color = padding_color;
}
removed gimp_config_values_equal(). 2002-11-23 Michael Natterer <mitch@gimp.org> * app/config/gimpconfig-utils.[ch]: removed gimp_config_values_equal(). * app/config/gimpconfig-serialize.c * app/config/gimpconfig.c: use g_param_values_cmp() instead so our registered compare methods are used. * app/config/gimpdisplayconfig.[ch]: added "canvas_padding_mode" and "canvas_padding_color" properties. * app/display/display-enums.[ch]: added enum GimpDisplayPaddingMode which can be one of { theme, light check, dark check, custom }. * app/display/gimpdisplay.h * app/display/gimpdisplay-handlers.c: removed cached monitor resolution values... * app/display/gimpdisplayshell.[ch]: ...and added them here. Added padding state as in GimpDisplayConfig. Added utility function gimp_display_shell_set_padding() which hides all the details. Added the new padding modes to the padding color button's context menu. * app/display/gimpdisplayshell-callbacks.[ch]: don't fiddle with colors manually but use gimp_display_shell_set_padding() in realize() and in the color button callbacks. * app/display/gimpdisplayshell-handlers.c: connect to notify::monitor-[xy]resolution and notify::canvas-padding-[mode|color] and update accordingly. * app/widgets/gimppropwidgets.[ch]: added gimp_prop_color_button_new(). * app/widgets/gimpdialogfactory.[ch]: added gimp_dialog_factories_session_clear() (unimplemented). * app/gui/preferences-dialog.c: added widgets for padding mode and color. Removed some callbacks by connecting the functions they called directly. Cleanup.
2002-11-24 06:22:21 +08:00
}
/* if the user did not set the padding mode for this display explicitely */
if (! shell->options->padding_mode_set)
{
padding_mode = display_config->default_view->padding_mode;
padding_color = display_config->default_view->padding_color;
if (fullscreen)
{
shell->options->padding_mode = padding_mode;
shell->options->padding_color = padding_color;
}
else
{
gimp_display_shell_set_padding (shell, padding_mode, &padding_color);
}
}
removed gimp_config_values_equal(). 2002-11-23 Michael Natterer <mitch@gimp.org> * app/config/gimpconfig-utils.[ch]: removed gimp_config_values_equal(). * app/config/gimpconfig-serialize.c * app/config/gimpconfig.c: use g_param_values_cmp() instead so our registered compare methods are used. * app/config/gimpdisplayconfig.[ch]: added "canvas_padding_mode" and "canvas_padding_color" properties. * app/display/display-enums.[ch]: added enum GimpDisplayPaddingMode which can be one of { theme, light check, dark check, custom }. * app/display/gimpdisplay.h * app/display/gimpdisplay-handlers.c: removed cached monitor resolution values... * app/display/gimpdisplayshell.[ch]: ...and added them here. Added padding state as in GimpDisplayConfig. Added utility function gimp_display_shell_set_padding() which hides all the details. Added the new padding modes to the padding color button's context menu. * app/display/gimpdisplayshell-callbacks.[ch]: don't fiddle with colors manually but use gimp_display_shell_set_padding() in realize() and in the color button callbacks. * app/display/gimpdisplayshell-handlers.c: connect to notify::monitor-[xy]resolution and notify::canvas-padding-[mode|color] and update accordingly. * app/widgets/gimppropwidgets.[ch]: added gimp_prop_color_button_new(). * app/widgets/gimpdialogfactory.[ch]: added gimp_dialog_factories_session_clear() (unimplemented). * app/gui/preferences-dialog.c: added widgets for padding mode and color. Removed some callbacks by connecting the functions they called directly. Cleanup.
2002-11-24 06:22:21 +08:00
}
static void
gimp_display_shell_ants_speed_notify_handler (GObject *config,
GParamSpec *param_spec,
GimpDisplayShell *shell)
{
gimp_display_shell_selection_visibility (shell, GIMP_SELECTION_PAUSE);
gimp_display_shell_selection_visibility (shell, GIMP_SELECTION_RESUME);
}
static gboolean
gimp_display_shell_idle_update_icon (gpointer data)
{
GimpDisplayShell *shell;
shell = GIMP_DISPLAY_SHELL (data);
shell->icon_idle_id = 0;
gimp_display_shell_update_icon (shell);
return FALSE;
}