2006-12-09 21:33:38 +00:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
2001-11-10 19:10:28 +00:00
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
2009-01-17 22:28:01 +00:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
2001-11-10 19:10:28 +00:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
2009-01-17 22:28:01 +00:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2001-11-10 19:10:28 +00: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
|
2018-07-11 23:27:07 +02:00
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2001-11-10 19:10:28 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
2008-10-09 20:24:04 +00:00
|
|
|
#include <gegl.h>
|
2001-11-10 19:10:28 +00:00
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
2014-07-07 23:56:56 +02:00
|
|
|
#include "libgimpbase/gimpbase.h"
|
2007-08-06 19:23:22 +00:00
|
|
|
#include "libgimpcolor/gimpcolor.h"
|
2016-05-14 23:50:58 +02:00
|
|
|
#include "libgimpconfig/gimpconfig.h"
|
2008-08-04 20:11:35 +00:00
|
|
|
#include "libgimpmath/gimpmath.h"
|
2001-11-29 16:44:51 +00:00
|
|
|
#include "libgimpwidgets/gimpwidgets.h"
|
|
|
|
|
2001-11-10 19:10:28 +00:00
|
|
|
#include "display-types.h"
|
|
|
|
|
2010-02-01 21:55:18 +01:00
|
|
|
#include "config/gimpdisplayoptions.h"
|
2016-01-10 20:09:28 +01:00
|
|
|
#include "config/gimpguiconfig.h"
|
2002-11-18 20:50:31 +00:00
|
|
|
|
|
|
|
#include "core/gimp.h"
|
2015-12-15 02:54:04 +01:00
|
|
|
#include "core/gimp-cairo.h"
|
2010-09-30 08:59:36 +02:00
|
|
|
#include "core/gimpguide.h"
|
2001-11-10 19:10:28 +00:00
|
|
|
#include "core/gimpimage.h"
|
2010-02-03 22:16:02 +01:00
|
|
|
#include "core/gimpimage-grid.h"
|
2010-10-01 10:34:15 +02:00
|
|
|
#include "core/gimpimage-guides.h"
|
2010-02-04 09:49:45 +01:00
|
|
|
#include "core/gimpimage-quick-mask.h"
|
2010-10-01 09:15:52 +02:00
|
|
|
#include "core/gimpimage-sample-points.h"
|
2003-09-11 22:24:30 +00:00
|
|
|
#include "core/gimpitem.h"
|
2010-10-08 01:03:56 +02:00
|
|
|
#include "core/gimpitemstack.h"
|
2010-09-30 08:59:36 +02:00
|
|
|
#include "core/gimpsamplepoint.h"
|
2009-08-04 22:32:24 +02:00
|
|
|
#include "core/gimptreehandler.h"
|
2001-11-10 19:10:28 +00:00
|
|
|
|
2010-10-08 01:03:56 +02:00
|
|
|
#include "vectors/gimpvectors.h"
|
|
|
|
|
2003-05-29 11:34:30 +00:00
|
|
|
#include "widgets/gimpwidgets-utils.h"
|
|
|
|
|
2019-09-04 16:33:09 +03:00
|
|
|
#include "gimpcanvascanvasboundary.h"
|
2010-09-30 08:59:36 +02:00
|
|
|
#include "gimpcanvasguide.h"
|
2010-10-03 00:28:40 +02:00
|
|
|
#include "gimpcanvaslayerboundary.h"
|
2010-10-08 01:03:56 +02:00
|
|
|
#include "gimpcanvaspath.h"
|
2010-10-01 09:15:52 +02:00
|
|
|
#include "gimpcanvasproxygroup.h"
|
2010-09-30 08:59:36 +02:00
|
|
|
#include "gimpcanvassamplepoint.h"
|
2001-11-10 19:10:28 +00:00
|
|
|
#include "gimpdisplay.h"
|
|
|
|
#include "gimpdisplayshell.h"
|
2003-03-11 16:49:36 +00:00
|
|
|
#include "gimpdisplayshell-appearance.h"
|
2001-11-30 14:41:56 +00:00
|
|
|
#include "gimpdisplayshell-callbacks.h"
|
2009-10-02 23:55:26 +02:00
|
|
|
#include "gimpdisplayshell-expose.h"
|
2001-11-10 19:10:28 +00:00
|
|
|
#include "gimpdisplayshell-handlers.h"
|
2015-05-27 12:30:32 +02:00
|
|
|
#include "gimpdisplayshell-profile.h"
|
2019-07-15 23:24:35 +02:00
|
|
|
#include "gimpdisplayshell-render.h"
|
2016-01-05 18:02:59 +01:00
|
|
|
#include "gimpdisplayshell-rulers.h"
|
2001-11-10 19:10:28 +00:00
|
|
|
#include "gimpdisplayshell-scale.h"
|
2008-08-03 11:35:53 +00:00
|
|
|
#include "gimpdisplayshell-scroll.h"
|
2006-09-04 19:06:40 +00:00
|
|
|
#include "gimpdisplayshell-selection.h"
|
2003-01-03 18:01:30 +00:00
|
|
|
#include "gimpdisplayshell-title.h"
|
2009-09-23 14:52:33 +02:00
|
|
|
#include "gimpimagewindow.h"
|
2009-09-29 22:38:34 +02:00
|
|
|
#include "gimpstatusbar.h"
|
|
|
|
|
|
|
|
#include "gimp-intl.h"
|
2001-11-10 19:10:28 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* local function prototypes */
|
|
|
|
|
2006-03-28 17:08:36 +00:00
|
|
|
static void gimp_display_shell_clean_dirty_handler (GimpImage *image,
|
2004-07-29 14:16:21 +00:00
|
|
|
GimpDirtyMask dirty_mask,
|
2002-02-15 17:44:05 +00:00
|
|
|
GimpDisplayShell *shell);
|
2006-03-28 17:08:36 +00:00
|
|
|
static void gimp_display_shell_undo_event_handler (GimpImage *image,
|
2003-02-20 12:47:42 +00:00
|
|
|
GimpUndoEvent event,
|
|
|
|
GimpUndo *undo,
|
2002-02-07 17:37:34 +00:00
|
|
|
GimpDisplayShell *shell);
|
2003-10-14 15:37:21 +00:00
|
|
|
static void gimp_display_shell_grid_notify_handler (GimpGrid *grid,
|
|
|
|
GParamSpec *pspec,
|
2003-06-23 19:34:48 +00:00
|
|
|
GimpDisplayShell *shell);
|
2006-03-28 17:08:36 +00:00
|
|
|
static void gimp_display_shell_name_changed_handler (GimpImage *image,
|
2001-11-10 19:10:28 +00:00
|
|
|
GimpDisplayShell *shell);
|
2010-10-09 20:23:05 +02:00
|
|
|
static void gimp_display_shell_selection_invalidate_handler
|
|
|
|
(GimpImage *image,
|
2001-11-10 23:03:22 +00:00
|
|
|
GimpDisplayShell *shell);
|
2019-09-04 17:48:06 +03:00
|
|
|
static void gimp_display_shell_component_visibility_changed_handler
|
|
|
|
(GimpImage *image,
|
|
|
|
GimpChannelType channel,
|
|
|
|
GimpDisplayShell *shell);
|
2008-08-03 11:35:53 +00:00
|
|
|
static void gimp_display_shell_size_changed_detailed_handler
|
|
|
|
(GimpImage *image,
|
2008-08-04 20:11:35 +00:00
|
|
|
gint previous_origin_x,
|
|
|
|
gint previous_origin_y,
|
2008-08-28 19:12:03 +00:00
|
|
|
gint previous_width,
|
|
|
|
gint previous_height,
|
2001-11-10 19:10:28 +00:00
|
|
|
GimpDisplayShell *shell);
|
2006-03-28 17:08:36 +00:00
|
|
|
static void gimp_display_shell_resolution_changed_handler (GimpImage *image,
|
2001-11-10 19:10:28 +00:00
|
|
|
GimpDisplayShell *shell);
|
2006-03-28 17:08:36 +00:00
|
|
|
static void gimp_display_shell_quick_mask_changed_handler (GimpImage *image,
|
2001-11-10 19:10:28 +00:00
|
|
|
GimpDisplayShell *shell);
|
2010-10-01 10:34:15 +02:00
|
|
|
static void gimp_display_shell_guide_add_handler (GimpImage *image,
|
|
|
|
GimpGuide *guide,
|
|
|
|
GimpDisplayShell *shell);
|
|
|
|
static void gimp_display_shell_guide_remove_handler (GimpImage *image,
|
|
|
|
GimpGuide *guide,
|
|
|
|
GimpDisplayShell *shell);
|
|
|
|
static void gimp_display_shell_guide_move_handler (GimpImage *image,
|
2001-11-14 15:40:30 +00:00
|
|
|
GimpGuide *guide,
|
|
|
|
GimpDisplayShell *shell);
|
2010-10-01 09:15:52 +02:00
|
|
|
static void gimp_display_shell_sample_point_add_handler (GimpImage *image,
|
|
|
|
GimpSamplePoint *sample_point,
|
|
|
|
GimpDisplayShell *shell);
|
|
|
|
static void gimp_display_shell_sample_point_remove_handler(GimpImage *image,
|
|
|
|
GimpSamplePoint *sample_point,
|
|
|
|
GimpDisplayShell *shell);
|
|
|
|
static void gimp_display_shell_sample_point_move_handler (GimpImage *image,
|
2005-03-04 16:34:59 +00:00
|
|
|
GimpSamplePoint *sample_point,
|
|
|
|
GimpDisplayShell *shell);
|
2019-06-01 14:19:05 +02:00
|
|
|
static void gimp_display_shell_mode_changed_handler (GimpImage *image,
|
|
|
|
GimpDisplayShell *shell);
|
2015-06-13 00:27:21 +02:00
|
|
|
static void gimp_display_shell_precision_changed_handler (GimpImage *image,
|
|
|
|
GimpDisplayShell *shell);
|
2007-08-06 19:23:22 +00:00
|
|
|
static void gimp_display_shell_profile_changed_handler (GimpColorManaged *image,
|
|
|
|
GimpDisplayShell *shell);
|
2009-09-29 22:38:34 +02:00
|
|
|
static void gimp_display_shell_saved_handler (GimpImage *image,
|
2014-07-07 23:56:56 +02:00
|
|
|
GFile *file,
|
2009-09-29 22:38:34 +02:00
|
|
|
GimpDisplayShell *shell);
|
|
|
|
static void gimp_display_shell_exported_handler (GimpImage *image,
|
2014-07-07 23:56:56 +02:00
|
|
|
GFile *file,
|
2009-09-29 22:38:34 +02:00
|
|
|
GimpDisplayShell *shell);
|
2002-02-17 13:12:16 +00:00
|
|
|
|
2010-09-12 00:08:17 +02:00
|
|
|
static void gimp_display_shell_active_vectors_handler (GimpImage *image,
|
|
|
|
GimpDisplayShell *shell);
|
|
|
|
|
2010-10-08 01:03:56 +02:00
|
|
|
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);
|
|
|
|
|
2002-11-21 15:46:19 +00:00
|
|
|
static void gimp_display_shell_check_notify_handler (GObject *config,
|
|
|
|
GParamSpec *param_spec,
|
|
|
|
GimpDisplayShell *shell);
|
2002-11-22 22:10:40 +00:00
|
|
|
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);
|
2002-11-23 22:22:21 +00:00
|
|
|
static void gimp_display_shell_monitor_res_notify_handler (GObject *config,
|
|
|
|
GParamSpec *param_spec,
|
|
|
|
GimpDisplayShell *shell);
|
2007-10-30 12:02:19 +00:00
|
|
|
static void gimp_display_shell_padding_notify_handler (GObject *config,
|
|
|
|
GParamSpec *param_spec,
|
|
|
|
GimpDisplayShell *shell);
|
2002-11-24 00:03:42 +00:00
|
|
|
static void gimp_display_shell_ants_speed_notify_handler (GObject *config,
|
|
|
|
GParamSpec *param_spec,
|
|
|
|
GimpDisplayShell *shell);
|
2007-10-08 13:30:49 +00:00
|
|
|
static void gimp_display_shell_quality_notify_handler (GObject *config,
|
|
|
|
GParamSpec *param_spec,
|
|
|
|
GimpDisplayShell *shell);
|
2016-05-14 23:50:58 +02:00
|
|
|
static void gimp_display_shell_color_config_notify_handler (GObject *config,
|
|
|
|
GParamSpec *param_spec,
|
|
|
|
GimpDisplayShell *shell);
|
2019-09-05 13:51:35 +03:00
|
|
|
static void gimp_display_shell_display_changed_handler (GimpContext *context,
|
|
|
|
GimpDisplay *display,
|
|
|
|
GimpDisplayShell *shell);
|
2002-11-21 15:46:19 +00:00
|
|
|
|
2001-11-10 19:10:28 +00:00
|
|
|
|
|
|
|
/* public functions */
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_display_shell_connect (GimpDisplayShell *shell)
|
|
|
|
{
|
2016-05-14 23:50:58 +02:00
|
|
|
GimpImage *image;
|
|
|
|
GimpContainer *vectors;
|
|
|
|
GimpDisplayConfig *config;
|
|
|
|
GimpColorConfig *color_config;
|
2019-09-05 13:51:35 +03:00
|
|
|
GimpContext *user_context;
|
2016-05-14 23:50:58 +02:00
|
|
|
GList *list;
|
2001-11-10 19:10:28 +00:00
|
|
|
|
|
|
|
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
2006-03-28 17:55:52 +00:00
|
|
|
g_return_if_fail (GIMP_IS_DISPLAY (shell->display));
|
2001-11-10 19:10:28 +00:00
|
|
|
|
2016-05-14 23:50:58 +02:00
|
|
|
image = gimp_display_get_image (shell->display);
|
2009-10-06 19:20:44 +02:00
|
|
|
|
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
2001-11-10 19:10:28 +00:00
|
|
|
|
2016-05-14 23:50:58 +02:00
|
|
|
vectors = gimp_image_get_vectors (image);
|
|
|
|
|
|
|
|
config = shell->display->config;
|
|
|
|
color_config = GIMP_CORE_CONFIG (config)->color_management;
|
|
|
|
|
2019-09-05 13:51:35 +03:00
|
|
|
user_context = gimp_get_user_context (shell->display->gimp);
|
|
|
|
|
2006-03-28 17:08:36 +00:00
|
|
|
g_signal_connect (image, "clean",
|
2002-02-15 17:44:05 +00:00
|
|
|
G_CALLBACK (gimp_display_shell_clean_dirty_handler),
|
|
|
|
shell);
|
2006-03-28 17:08:36 +00:00
|
|
|
g_signal_connect (image, "dirty",
|
2002-02-15 17:44:05 +00:00
|
|
|
G_CALLBACK (gimp_display_shell_clean_dirty_handler),
|
|
|
|
shell);
|
2006-03-28 17:08:36 +00:00
|
|
|
g_signal_connect (image, "undo-event",
|
2002-02-07 17:37:34 +00:00
|
|
|
G_CALLBACK (gimp_display_shell_undo_event_handler),
|
2001-11-10 19:10:28 +00:00
|
|
|
shell);
|
2010-10-02 20:57:40 +02:00
|
|
|
|
2010-02-03 22:16:02 +01:00
|
|
|
g_signal_connect (gimp_image_get_grid (image), "notify",
|
2003-10-14 15:37:21 +00:00
|
|
|
G_CALLBACK (gimp_display_shell_grid_notify_handler),
|
2003-06-23 19:34:48 +00:00
|
|
|
shell);
|
2010-10-02 20:57:40 +02:00
|
|
|
g_object_set (shell->grid, "grid", gimp_image_get_grid (image), NULL);
|
|
|
|
|
2006-03-28 17:08:36 +00:00
|
|
|
g_signal_connect (image, "name-changed",
|
2002-02-07 17:37:34 +00:00
|
|
|
G_CALLBACK (gimp_display_shell_name_changed_handler),
|
2001-11-10 19:10:28 +00:00
|
|
|
shell);
|
2010-10-09 20:23:05 +02:00
|
|
|
g_signal_connect (image, "selection-invalidate",
|
|
|
|
G_CALLBACK (gimp_display_shell_selection_invalidate_handler),
|
2001-11-10 23:03:22 +00:00
|
|
|
shell);
|
2019-09-04 17:48:06 +03:00
|
|
|
g_signal_connect (image, "component-visibility-changed",
|
|
|
|
G_CALLBACK (gimp_display_shell_component_visibility_changed_handler),
|
|
|
|
shell);
|
2008-08-03 11:35:53 +00:00
|
|
|
g_signal_connect (image, "size-changed-detailed",
|
|
|
|
G_CALLBACK (gimp_display_shell_size_changed_detailed_handler),
|
2001-11-10 19:10:28 +00:00
|
|
|
shell);
|
2006-03-28 17:08:36 +00:00
|
|
|
g_signal_connect (image, "resolution-changed",
|
2001-11-10 19:10:28 +00:00
|
|
|
G_CALLBACK (gimp_display_shell_resolution_changed_handler),
|
|
|
|
shell);
|
2006-03-28 17:08:36 +00:00
|
|
|
g_signal_connect (image, "quick-mask-changed",
|
2005-09-19 12:44:06 +00:00
|
|
|
G_CALLBACK (gimp_display_shell_quick_mask_changed_handler),
|
2001-11-10 19:10:28 +00:00
|
|
|
shell);
|
2010-10-01 10:34:15 +02:00
|
|
|
|
|
|
|
g_signal_connect (image, "guide-added",
|
|
|
|
G_CALLBACK (gimp_display_shell_guide_add_handler),
|
|
|
|
shell);
|
|
|
|
g_signal_connect (image, "guide-removed",
|
|
|
|
G_CALLBACK (gimp_display_shell_guide_remove_handler),
|
|
|
|
shell);
|
|
|
|
g_signal_connect (image, "guide-moved",
|
|
|
|
G_CALLBACK (gimp_display_shell_guide_move_handler),
|
2001-11-14 15:40:30 +00:00
|
|
|
shell);
|
2010-10-01 10:34:15 +02:00
|
|
|
for (list = gimp_image_get_guides (image);
|
|
|
|
list;
|
|
|
|
list = g_list_next (list))
|
|
|
|
{
|
|
|
|
gimp_display_shell_guide_add_handler (image, list->data, shell);
|
|
|
|
}
|
2010-10-01 09:15:52 +02:00
|
|
|
|
|
|
|
g_signal_connect (image, "sample-point-added",
|
|
|
|
G_CALLBACK (gimp_display_shell_sample_point_add_handler),
|
|
|
|
shell);
|
|
|
|
g_signal_connect (image, "sample-point-removed",
|
|
|
|
G_CALLBACK (gimp_display_shell_sample_point_remove_handler),
|
|
|
|
shell);
|
|
|
|
g_signal_connect (image, "sample-point-moved",
|
|
|
|
G_CALLBACK (gimp_display_shell_sample_point_move_handler),
|
2005-03-04 16:34:59 +00:00
|
|
|
shell);
|
2010-10-01 09:15:52 +02:00
|
|
|
for (list = gimp_image_get_sample_points (image);
|
|
|
|
list;
|
|
|
|
list = g_list_next (list))
|
|
|
|
{
|
|
|
|
gimp_display_shell_sample_point_add_handler (image, list->data, shell);
|
|
|
|
}
|
|
|
|
|
2019-06-01 14:19:05 +02:00
|
|
|
g_signal_connect (image, "mode-changed",
|
|
|
|
G_CALLBACK (gimp_display_shell_mode_changed_handler),
|
|
|
|
shell);
|
2015-06-13 00:27:21 +02:00
|
|
|
g_signal_connect (image, "precision-changed",
|
|
|
|
G_CALLBACK (gimp_display_shell_precision_changed_handler),
|
|
|
|
shell);
|
2007-08-06 19:23:22 +00:00
|
|
|
g_signal_connect (image, "profile-changed",
|
|
|
|
G_CALLBACK (gimp_display_shell_profile_changed_handler),
|
|
|
|
shell);
|
2009-09-29 22:38:34 +02:00
|
|
|
g_signal_connect (image, "saved",
|
|
|
|
G_CALLBACK (gimp_display_shell_saved_handler),
|
|
|
|
shell);
|
|
|
|
g_signal_connect (image, "exported",
|
|
|
|
G_CALLBACK (gimp_display_shell_exported_handler),
|
|
|
|
shell);
|
2002-02-17 13:12:16 +00:00
|
|
|
|
2020-04-04 02:49:51 +02:00
|
|
|
g_signal_connect (image, "selected-vectors-changed",
|
2010-09-12 00:08:17 +02:00
|
|
|
G_CALLBACK (gimp_display_shell_active_vectors_handler),
|
|
|
|
shell);
|
|
|
|
|
2010-10-08 01:03:56 +02:00
|
|
|
shell->vectors_freeze_handler =
|
|
|
|
gimp_tree_handler_connect (vectors, "freeze",
|
|
|
|
G_CALLBACK (gimp_display_shell_vectors_freeze_handler),
|
|
|
|
shell);
|
|
|
|
shell->vectors_thaw_handler =
|
|
|
|
gimp_tree_handler_connect (vectors, "thaw",
|
|
|
|
G_CALLBACK (gimp_display_shell_vectors_thaw_handler),
|
|
|
|
shell);
|
|
|
|
shell->vectors_visible_handler =
|
|
|
|
gimp_tree_handler_connect (vectors, "visibility-changed",
|
|
|
|
G_CALLBACK (gimp_display_shell_vectors_visible_handler),
|
|
|
|
shell);
|
|
|
|
|
|
|
|
g_signal_connect (vectors, "add",
|
|
|
|
G_CALLBACK (gimp_display_shell_vectors_add_handler),
|
|
|
|
shell);
|
|
|
|
g_signal_connect (vectors, "remove",
|
|
|
|
G_CALLBACK (gimp_display_shell_vectors_remove_handler),
|
|
|
|
shell);
|
|
|
|
for (list = gimp_item_stack_get_item_iter (GIMP_ITEM_STACK (vectors));
|
|
|
|
list;
|
|
|
|
list = g_list_next (list))
|
|
|
|
{
|
|
|
|
gimp_display_shell_vectors_add_handler (vectors, list->data, shell);
|
|
|
|
}
|
|
|
|
|
2016-05-14 23:50:58 +02:00
|
|
|
g_signal_connect (config,
|
2002-11-21 15:46:19 +00:00
|
|
|
"notify::transparency-size",
|
|
|
|
G_CALLBACK (gimp_display_shell_check_notify_handler),
|
|
|
|
shell);
|
2016-05-14 23:50:58 +02:00
|
|
|
g_signal_connect (config,
|
2002-11-21 15:46:19 +00:00
|
|
|
"notify::transparency-type",
|
|
|
|
G_CALLBACK (gimp_display_shell_check_notify_handler),
|
|
|
|
shell);
|
2003-10-22 14:46:05 +00:00
|
|
|
|
2016-05-14 23:50:58 +02:00
|
|
|
g_signal_connect (config,
|
2002-11-22 22:10:40 +00:00
|
|
|
"notify::image-title-format",
|
|
|
|
G_CALLBACK (gimp_display_shell_title_notify_handler),
|
|
|
|
shell);
|
2016-05-14 23:50:58 +02:00
|
|
|
g_signal_connect (config,
|
2002-11-22 22:10:40 +00:00
|
|
|
"notify::image-status-format",
|
|
|
|
G_CALLBACK (gimp_display_shell_title_notify_handler),
|
|
|
|
shell);
|
2016-05-14 23:50:58 +02:00
|
|
|
g_signal_connect (config,
|
2002-11-22 22:10:40 +00:00
|
|
|
"notify::navigation-preview-size",
|
|
|
|
G_CALLBACK (gimp_display_shell_nav_size_notify_handler),
|
|
|
|
shell);
|
2016-05-14 23:50:58 +02:00
|
|
|
g_signal_connect (config,
|
2003-05-29 11:34:30 +00:00
|
|
|
"notify::monitor-resolution-from-windowing-system",
|
|
|
|
G_CALLBACK (gimp_display_shell_monitor_res_notify_handler),
|
|
|
|
shell);
|
2016-05-14 23:50:58 +02:00
|
|
|
g_signal_connect (config,
|
2002-12-18 15:42:45 +00:00
|
|
|
"notify::monitor-xresolution",
|
2002-11-23 22:22:21 +00:00
|
|
|
G_CALLBACK (gimp_display_shell_monitor_res_notify_handler),
|
|
|
|
shell);
|
2016-05-14 23:50:58 +02:00
|
|
|
g_signal_connect (config,
|
2002-12-18 15:42:45 +00:00
|
|
|
"notify::monitor-yresolution",
|
2002-11-23 22:22:21 +00:00
|
|
|
G_CALLBACK (gimp_display_shell_monitor_res_notify_handler),
|
|
|
|
shell);
|
2003-10-22 14:46:05 +00:00
|
|
|
|
2016-05-14 23:50:58 +02:00
|
|
|
g_signal_connect (config->default_view,
|
2007-10-30 12:02:19 +00:00
|
|
|
"notify::padding-mode",
|
|
|
|
G_CALLBACK (gimp_display_shell_padding_notify_handler),
|
|
|
|
shell);
|
2016-05-14 23:50:58 +02:00
|
|
|
g_signal_connect (config->default_view,
|
2007-10-30 12:02:19 +00:00
|
|
|
"notify::padding-color",
|
|
|
|
G_CALLBACK (gimp_display_shell_padding_notify_handler),
|
|
|
|
shell);
|
2016-05-14 23:50:58 +02:00
|
|
|
g_signal_connect (config->default_fullscreen_view,
|
2007-10-30 12:02:19 +00:00
|
|
|
"notify::padding-mode",
|
|
|
|
G_CALLBACK (gimp_display_shell_padding_notify_handler),
|
|
|
|
shell);
|
2016-05-14 23:50:58 +02:00
|
|
|
g_signal_connect (config->default_fullscreen_view,
|
2007-10-30 12:02:19 +00:00
|
|
|
"notify::padding-color",
|
|
|
|
G_CALLBACK (gimp_display_shell_padding_notify_handler),
|
|
|
|
shell);
|
|
|
|
|
2016-05-14 23:50:58 +02:00
|
|
|
g_signal_connect (config,
|
2002-11-24 00:03:42 +00:00
|
|
|
"notify::marching-ants-speed",
|
|
|
|
G_CALLBACK (gimp_display_shell_ants_speed_notify_handler),
|
|
|
|
shell);
|
2002-11-21 15:46:19 +00:00
|
|
|
|
2016-05-14 23:50:58 +02:00
|
|
|
g_signal_connect (config,
|
2007-10-08 13:30:49 +00:00
|
|
|
"notify::zoom-quality",
|
|
|
|
G_CALLBACK (gimp_display_shell_quality_notify_handler),
|
|
|
|
shell);
|
|
|
|
|
2016-05-14 23:50:58 +02:00
|
|
|
g_signal_connect (color_config, "notify",
|
|
|
|
G_CALLBACK (gimp_display_shell_color_config_notify_handler),
|
|
|
|
shell);
|
|
|
|
|
2019-09-05 13:51:35 +03:00
|
|
|
g_signal_connect (user_context, "display-changed",
|
|
|
|
G_CALLBACK (gimp_display_shell_display_changed_handler),
|
|
|
|
shell);
|
|
|
|
|
2017-05-02 18:02:22 +02:00
|
|
|
gimp_display_shell_active_vectors_handler (image, shell);
|
2006-03-28 17:08:36 +00:00
|
|
|
gimp_display_shell_quick_mask_changed_handler (image, shell);
|
2015-05-27 12:30:32 +02:00
|
|
|
gimp_display_shell_profile_changed_handler (GIMP_COLOR_MANAGED (image),
|
|
|
|
shell);
|
2016-05-14 23:50:58 +02:00
|
|
|
gimp_display_shell_color_config_notify_handler (G_OBJECT (color_config),
|
|
|
|
NULL, /* sync all */
|
|
|
|
shell);
|
2010-10-03 00:28:40 +02:00
|
|
|
|
2020-05-07 16:13:08 +02:00
|
|
|
gimp_canvas_layer_boundary_set_layers (GIMP_CANVAS_LAYER_BOUNDARY (shell->layer_boundary),
|
|
|
|
gimp_image_get_selected_layers (image));
|
2019-09-04 15:50:29 +03:00
|
|
|
|
2019-09-04 16:33:09 +03:00
|
|
|
gimp_canvas_canvas_boundary_set_image (GIMP_CANVAS_CANVAS_BOUNDARY (shell->canvas_boundary),
|
|
|
|
image);
|
|
|
|
|
2019-09-04 15:50:29 +03:00
|
|
|
if (shell->show_all)
|
|
|
|
{
|
|
|
|
gimp_image_inc_show_all_count (image);
|
|
|
|
|
|
|
|
gimp_image_flush (image);
|
|
|
|
}
|
2001-11-10 19:10:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_display_shell_disconnect (GimpDisplayShell *shell)
|
|
|
|
{
|
2016-05-14 23:50:58 +02:00
|
|
|
GimpImage *image;
|
|
|
|
GimpContainer *vectors;
|
|
|
|
GimpDisplayConfig *config;
|
|
|
|
GimpColorConfig *color_config;
|
2019-09-05 13:51:35 +03:00
|
|
|
GimpContext *user_context;
|
2016-05-14 23:50:58 +02:00
|
|
|
GList *list;
|
2001-11-10 19:10:28 +00:00
|
|
|
|
|
|
|
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
2006-03-28 17:55:52 +00:00
|
|
|
g_return_if_fail (GIMP_IS_DISPLAY (shell->display));
|
2001-11-10 19:10:28 +00:00
|
|
|
|
2009-10-06 19:20:44 +02:00
|
|
|
image = gimp_display_get_image (shell->display);
|
|
|
|
|
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
2001-11-10 19:10:28 +00:00
|
|
|
|
2010-10-08 01:03:56 +02:00
|
|
|
vectors = gimp_image_get_vectors (image);
|
|
|
|
|
2016-05-14 23:50:58 +02:00
|
|
|
config = shell->display->config;
|
|
|
|
color_config = GIMP_CORE_CONFIG (config)->color_management;
|
|
|
|
|
2019-09-05 13:51:35 +03:00
|
|
|
user_context = gimp_get_user_context (shell->display->gimp);
|
|
|
|
|
2020-05-07 16:13:08 +02:00
|
|
|
gimp_canvas_layer_boundary_set_layers (GIMP_CANVAS_LAYER_BOUNDARY (shell->layer_boundary),
|
|
|
|
NULL);
|
2010-10-03 00:28:40 +02:00
|
|
|
|
2019-09-04 16:33:09 +03:00
|
|
|
gimp_canvas_canvas_boundary_set_image (GIMP_CANVAS_CANVAS_BOUNDARY (shell->canvas_boundary),
|
|
|
|
NULL);
|
|
|
|
|
2019-09-05 13:51:35 +03:00
|
|
|
g_signal_handlers_disconnect_by_func (user_context,
|
|
|
|
gimp_display_shell_display_changed_handler,
|
|
|
|
shell);
|
|
|
|
|
2016-05-14 23:50:58 +02:00
|
|
|
g_signal_handlers_disconnect_by_func (color_config,
|
|
|
|
gimp_display_shell_color_config_notify_handler,
|
|
|
|
shell);
|
|
|
|
shell->color_config_set = FALSE;
|
|
|
|
|
|
|
|
g_signal_handlers_disconnect_by_func (config,
|
2007-10-08 13:30:49 +00:00
|
|
|
gimp_display_shell_quality_notify_handler,
|
|
|
|
shell);
|
2016-05-14 23:50:58 +02:00
|
|
|
g_signal_handlers_disconnect_by_func (config,
|
2002-11-24 00:03:42 +00:00
|
|
|
gimp_display_shell_ants_speed_notify_handler,
|
|
|
|
shell);
|
2016-05-14 23:50:58 +02:00
|
|
|
g_signal_handlers_disconnect_by_func (config->default_fullscreen_view,
|
2007-10-30 12:02:19 +00:00
|
|
|
gimp_display_shell_padding_notify_handler,
|
|
|
|
shell);
|
2016-05-14 23:50:58 +02:00
|
|
|
g_signal_handlers_disconnect_by_func (config->default_view,
|
2007-10-30 12:02:19 +00:00
|
|
|
gimp_display_shell_padding_notify_handler,
|
|
|
|
shell);
|
2016-05-14 23:50:58 +02:00
|
|
|
g_signal_handlers_disconnect_by_func (config,
|
2002-11-23 22:22:21 +00:00
|
|
|
gimp_display_shell_monitor_res_notify_handler,
|
|
|
|
shell);
|
2016-05-14 23:50:58 +02:00
|
|
|
g_signal_handlers_disconnect_by_func (config,
|
2002-11-22 22:10:40 +00:00
|
|
|
gimp_display_shell_nav_size_notify_handler,
|
|
|
|
shell);
|
2016-05-14 23:50:58 +02:00
|
|
|
g_signal_handlers_disconnect_by_func (config,
|
2002-11-22 22:10:40 +00:00
|
|
|
gimp_display_shell_title_notify_handler,
|
|
|
|
shell);
|
2016-05-14 23:50:58 +02:00
|
|
|
g_signal_handlers_disconnect_by_func (config,
|
2002-11-21 15:46:19 +00:00
|
|
|
gimp_display_shell_check_notify_handler,
|
|
|
|
shell);
|
|
|
|
|
2010-10-08 01:03:56 +02:00
|
|
|
g_signal_handlers_disconnect_by_func (vectors,
|
|
|
|
gimp_display_shell_vectors_remove_handler,
|
|
|
|
shell);
|
|
|
|
g_signal_handlers_disconnect_by_func (vectors,
|
|
|
|
gimp_display_shell_vectors_add_handler,
|
|
|
|
shell);
|
|
|
|
|
|
|
|
gimp_tree_handler_disconnect (shell->vectors_visible_handler);
|
|
|
|
shell->vectors_visible_handler = NULL;
|
|
|
|
|
|
|
|
gimp_tree_handler_disconnect (shell->vectors_thaw_handler);
|
|
|
|
shell->vectors_thaw_handler = NULL;
|
|
|
|
|
|
|
|
gimp_tree_handler_disconnect (shell->vectors_freeze_handler);
|
|
|
|
shell->vectors_freeze_handler = NULL;
|
|
|
|
|
2010-09-12 00:08:17 +02:00
|
|
|
g_signal_handlers_disconnect_by_func (image,
|
|
|
|
gimp_display_shell_active_vectors_handler,
|
|
|
|
shell);
|
|
|
|
|
2010-10-08 01:03:56 +02:00
|
|
|
for (list = gimp_item_stack_get_item_iter (GIMP_ITEM_STACK (vectors));
|
|
|
|
list;
|
|
|
|
list = g_list_next (list))
|
|
|
|
{
|
|
|
|
gimp_canvas_proxy_group_remove_item (GIMP_CANVAS_PROXY_GROUP (shell->vectors),
|
|
|
|
list->data);
|
|
|
|
}
|
|
|
|
|
2009-09-29 22:38:34 +02:00
|
|
|
g_signal_handlers_disconnect_by_func (image,
|
|
|
|
gimp_display_shell_exported_handler,
|
|
|
|
shell);
|
|
|
|
g_signal_handlers_disconnect_by_func (image,
|
|
|
|
gimp_display_shell_saved_handler,
|
|
|
|
shell);
|
2007-08-06 19:23:22 +00:00
|
|
|
g_signal_handlers_disconnect_by_func (image,
|
|
|
|
gimp_display_shell_profile_changed_handler,
|
|
|
|
shell);
|
2015-06-13 00:27:21 +02:00
|
|
|
g_signal_handlers_disconnect_by_func (image,
|
|
|
|
gimp_display_shell_precision_changed_handler,
|
|
|
|
shell);
|
2019-06-01 14:19:05 +02:00
|
|
|
g_signal_handlers_disconnect_by_func (image,
|
|
|
|
gimp_display_shell_mode_changed_handler,
|
|
|
|
shell);
|
2010-10-01 10:34:15 +02:00
|
|
|
|
2006-03-28 17:08:36 +00:00
|
|
|
g_signal_handlers_disconnect_by_func (image,
|
2010-10-01 10:34:15 +02:00
|
|
|
gimp_display_shell_guide_add_handler,
|
2001-11-14 15:40:30 +00:00
|
|
|
shell);
|
2010-10-01 10:34:15 +02:00
|
|
|
g_signal_handlers_disconnect_by_func (image,
|
|
|
|
gimp_display_shell_guide_remove_handler,
|
|
|
|
shell);
|
|
|
|
g_signal_handlers_disconnect_by_func (image,
|
|
|
|
gimp_display_shell_guide_move_handler,
|
|
|
|
shell);
|
|
|
|
for (list = gimp_image_get_guides (image);
|
|
|
|
list;
|
|
|
|
list = g_list_next (list))
|
|
|
|
{
|
|
|
|
gimp_canvas_proxy_group_remove_item (GIMP_CANVAS_PROXY_GROUP (shell->guides),
|
|
|
|
list->data);
|
|
|
|
}
|
2010-10-01 09:15:52 +02:00
|
|
|
|
2006-03-28 17:08:36 +00:00
|
|
|
g_signal_handlers_disconnect_by_func (image,
|
2010-10-01 09:15:52 +02:00
|
|
|
gimp_display_shell_sample_point_add_handler,
|
2005-03-04 16:34:59 +00:00
|
|
|
shell);
|
2010-10-01 09:15:52 +02:00
|
|
|
g_signal_handlers_disconnect_by_func (image,
|
|
|
|
gimp_display_shell_sample_point_remove_handler,
|
|
|
|
shell);
|
|
|
|
g_signal_handlers_disconnect_by_func (image,
|
|
|
|
gimp_display_shell_sample_point_move_handler,
|
|
|
|
shell);
|
|
|
|
for (list = gimp_image_get_sample_points (image);
|
|
|
|
list;
|
|
|
|
list = g_list_next (list))
|
|
|
|
{
|
|
|
|
gimp_canvas_proxy_group_remove_item (GIMP_CANVAS_PROXY_GROUP (shell->sample_points),
|
|
|
|
list->data);
|
|
|
|
}
|
|
|
|
|
2006-03-28 17:08:36 +00:00
|
|
|
g_signal_handlers_disconnect_by_func (image,
|
2005-09-19 12:44:06 +00:00
|
|
|
gimp_display_shell_quick_mask_changed_handler,
|
2001-11-10 19:10:28 +00:00
|
|
|
shell);
|
2006-03-28 17:08:36 +00:00
|
|
|
g_signal_handlers_disconnect_by_func (image,
|
2001-11-10 19:10:28 +00:00
|
|
|
gimp_display_shell_resolution_changed_handler,
|
|
|
|
shell);
|
2019-09-04 17:48:06 +03:00
|
|
|
g_signal_handlers_disconnect_by_func (image,
|
|
|
|
gimp_display_shell_component_visibility_changed_handler,
|
|
|
|
shell);
|
2006-03-28 17:08:36 +00:00
|
|
|
g_signal_handlers_disconnect_by_func (image,
|
2008-08-03 11:35:53 +00:00
|
|
|
gimp_display_shell_size_changed_detailed_handler,
|
2001-11-10 19:10:28 +00:00
|
|
|
shell);
|
2006-03-28 17:08:36 +00:00
|
|
|
g_signal_handlers_disconnect_by_func (image,
|
2010-10-09 20:23:05 +02:00
|
|
|
gimp_display_shell_selection_invalidate_handler,
|
2001-11-10 23:03:22 +00:00
|
|
|
shell);
|
2006-03-28 17:08:36 +00:00
|
|
|
g_signal_handlers_disconnect_by_func (image,
|
2002-02-07 17:37:34 +00:00
|
|
|
gimp_display_shell_name_changed_handler,
|
|
|
|
shell);
|
2010-02-03 22:16:02 +01:00
|
|
|
g_signal_handlers_disconnect_by_func (gimp_image_get_grid (image),
|
2003-10-14 15:37:21 +00:00
|
|
|
gimp_display_shell_grid_notify_handler,
|
2003-06-23 19:34:48 +00:00
|
|
|
shell);
|
2006-03-28 17:08:36 +00:00
|
|
|
g_signal_handlers_disconnect_by_func (image,
|
2002-02-07 17:37:34 +00:00
|
|
|
gimp_display_shell_undo_event_handler,
|
2001-11-10 19:10:28 +00:00
|
|
|
shell);
|
2006-03-28 17:08:36 +00:00
|
|
|
g_signal_handlers_disconnect_by_func (image,
|
2002-02-15 17:44:05 +00:00
|
|
|
gimp_display_shell_clean_dirty_handler,
|
|
|
|
shell);
|
2019-09-04 15:50:29 +03:00
|
|
|
|
|
|
|
if (shell->show_all)
|
|
|
|
{
|
|
|
|
gimp_image_dec_show_all_count (image);
|
|
|
|
|
|
|
|
gimp_image_flush (image);
|
|
|
|
}
|
2001-11-10 19:10:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* private functions */
|
|
|
|
|
2002-02-15 17:44:05 +00:00
|
|
|
static void
|
2006-03-28 17:08:36 +00:00
|
|
|
gimp_display_shell_clean_dirty_handler (GimpImage *image,
|
2004-07-29 14:16:21 +00:00
|
|
|
GimpDirtyMask dirty_mask,
|
2002-02-15 17:44:05 +00:00
|
|
|
GimpDisplayShell *shell)
|
|
|
|
{
|
2004-07-14 16:37:13 +00:00
|
|
|
gimp_display_shell_title_update (shell);
|
2002-02-15 17:44:05 +00:00
|
|
|
}
|
|
|
|
|
2001-11-10 19:10:28 +00:00
|
|
|
static void
|
2006-03-28 17:08:36 +00:00
|
|
|
gimp_display_shell_undo_event_handler (GimpImage *image,
|
2003-02-20 12:47:42 +00:00
|
|
|
GimpUndoEvent event,
|
|
|
|
GimpUndo *undo,
|
2002-02-07 17:37:34 +00:00
|
|
|
GimpDisplayShell *shell)
|
|
|
|
{
|
2004-07-14 16:37:13 +00:00
|
|
|
gimp_display_shell_title_update (shell);
|
2002-02-07 17:37:34 +00:00
|
|
|
}
|
|
|
|
|
2003-06-23 19:34:48 +00:00
|
|
|
static void
|
2003-10-14 15:37:21 +00:00
|
|
|
gimp_display_shell_grid_notify_handler (GimpGrid *grid,
|
|
|
|
GParamSpec *pspec,
|
|
|
|
GimpDisplayShell *shell)
|
2003-06-23 19:34:48 +00:00
|
|
|
{
|
2010-10-02 20:57:40 +02:00
|
|
|
g_object_set (shell->grid, "grid", grid, NULL);
|
2003-06-23 19:34:48 +00:00
|
|
|
}
|
|
|
|
|
2002-02-07 17:37:34 +00:00
|
|
|
static void
|
2006-03-28 17:08:36 +00:00
|
|
|
gimp_display_shell_name_changed_handler (GimpImage *image,
|
2001-11-10 19:10:28 +00:00
|
|
|
GimpDisplayShell *shell)
|
|
|
|
{
|
2004-07-14 16:37:13 +00:00
|
|
|
gimp_display_shell_title_update (shell);
|
2001-11-10 19:10:28 +00:00
|
|
|
}
|
|
|
|
|
2001-11-10 23:03:22 +00:00
|
|
|
static void
|
2010-10-09 20:23:05 +02:00
|
|
|
gimp_display_shell_selection_invalidate_handler (GimpImage *image,
|
|
|
|
GimpDisplayShell *shell)
|
2001-11-10 23:03:22 +00:00
|
|
|
{
|
2010-10-09 20:23:05 +02:00
|
|
|
gimp_display_shell_selection_undraw (shell);
|
2001-11-10 23:03:22 +00:00
|
|
|
}
|
|
|
|
|
2001-11-10 19:10:28 +00:00
|
|
|
static void
|
2006-03-28 17:08:36 +00:00
|
|
|
gimp_display_shell_resolution_changed_handler (GimpImage *image,
|
2001-11-10 19:10:28 +00:00
|
|
|
GimpDisplayShell *shell)
|
|
|
|
{
|
2016-01-05 18:48:22 +01:00
|
|
|
gimp_display_shell_scale_update (shell);
|
2007-03-14 10:01:08 +00:00
|
|
|
|
2004-11-10 15:44:16 +00:00
|
|
|
if (shell->dot_for_dot)
|
|
|
|
{
|
2008-08-14 15:34:09 +00:00
|
|
|
if (shell->unit != GIMP_UNIT_PIXEL)
|
|
|
|
{
|
2016-01-05 18:02:59 +01:00
|
|
|
gimp_display_shell_rulers_update (shell);
|
2008-08-14 15:34:09 +00:00
|
|
|
}
|
|
|
|
|
2004-11-10 15:44:16 +00:00
|
|
|
gimp_display_shell_scaled (shell);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2008-08-03 11:35:53 +00:00
|
|
|
/* A resolution change has the same effect as a size change from
|
|
|
|
* a display shell point of view. Force a redraw of the display
|
|
|
|
* so that we don't get any display garbage.
|
|
|
|
*/
|
2016-01-10 20:09:28 +01:00
|
|
|
|
|
|
|
GimpDisplayConfig *config = shell->display->config;
|
|
|
|
gboolean resize_window;
|
|
|
|
|
|
|
|
/* Resize windows only in multi-window mode */
|
|
|
|
resize_window = (config->resize_windows_on_resize &&
|
|
|
|
! GIMP_GUI_CONFIG (config)->single_window_mode);
|
|
|
|
|
|
|
|
gimp_display_shell_scale_resize (shell, resize_window, FALSE);
|
2004-11-10 15:44:16 +00:00
|
|
|
}
|
2001-11-10 19:10:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2006-03-28 17:08:36 +00:00
|
|
|
gimp_display_shell_quick_mask_changed_handler (GimpImage *image,
|
2005-09-19 12:44:06 +00:00
|
|
|
GimpDisplayShell *shell)
|
2001-11-10 19:10:28 +00:00
|
|
|
{
|
2008-03-12 16:58:28 +00:00
|
|
|
GtkImage *gtk_image;
|
2010-02-04 09:49:45 +01:00
|
|
|
gboolean quick_mask_state;
|
2008-03-12 16:58:28 +00:00
|
|
|
|
|
|
|
gtk_image = GTK_IMAGE (gtk_bin_get_child (GTK_BIN (shell->quick_mask_button)));
|
2001-11-29 16:44:51 +00:00
|
|
|
|
2005-09-19 12:44:06 +00:00
|
|
|
g_signal_handlers_block_by_func (shell->quick_mask_button,
|
|
|
|
gimp_display_shell_quick_mask_toggled,
|
2001-11-29 16:44:51 +00:00
|
|
|
shell);
|
|
|
|
|
2010-02-04 09:49:45 +01:00
|
|
|
quick_mask_state = gimp_image_get_quick_mask_state (image);
|
|
|
|
|
2005-09-19 12:44:06 +00:00
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (shell->quick_mask_button),
|
2010-02-04 09:49:45 +01:00
|
|
|
quick_mask_state);
|
2001-11-29 16:44:51 +00:00
|
|
|
|
2010-02-04 09:49:45 +01:00
|
|
|
if (quick_mask_state)
|
2017-03-05 16:01:59 +01:00
|
|
|
gtk_image_set_from_icon_name (gtk_image, GIMP_ICON_QUICK_MASK_ON,
|
2014-05-07 15:30:38 +02:00
|
|
|
GTK_ICON_SIZE_MENU);
|
2001-11-29 16:44:51 +00:00
|
|
|
else
|
2017-03-05 16:01:59 +01:00
|
|
|
gtk_image_set_from_icon_name (gtk_image, GIMP_ICON_QUICK_MASK_OFF,
|
2014-05-07 15:30:38 +02:00
|
|
|
GTK_ICON_SIZE_MENU);
|
2001-11-29 16:44:51 +00:00
|
|
|
|
2005-09-19 12:44:06 +00:00
|
|
|
g_signal_handlers_unblock_by_func (shell->quick_mask_button,
|
|
|
|
gimp_display_shell_quick_mask_toggled,
|
2001-11-29 16:44:51 +00:00
|
|
|
shell);
|
2001-11-10 19:10:28 +00:00
|
|
|
}
|
2001-11-14 15:40:30 +00:00
|
|
|
|
|
|
|
static void
|
2010-10-01 10:34:15 +02:00
|
|
|
gimp_display_shell_guide_add_handler (GimpImage *image,
|
|
|
|
GimpGuide *guide,
|
|
|
|
GimpDisplayShell *shell)
|
2001-11-14 15:40:30 +00:00
|
|
|
{
|
2010-10-01 10:34:15 +02:00
|
|
|
GimpCanvasProxyGroup *group = GIMP_CANVAS_PROXY_GROUP (shell->guides);
|
|
|
|
GimpCanvasItem *item;
|
2016-02-03 19:38:32 +01:00
|
|
|
GimpGuideStyle style;
|
|
|
|
|
|
|
|
style = gimp_guide_get_style (guide);
|
2010-10-01 14:13:45 +02:00
|
|
|
item = gimp_canvas_guide_new (shell,
|
|
|
|
gimp_guide_get_orientation (guide),
|
2010-10-03 22:14:40 +02:00
|
|
|
gimp_guide_get_position (guide),
|
2016-02-03 19:38:32 +01:00
|
|
|
style);
|
2010-09-30 08:59:36 +02:00
|
|
|
|
2010-10-01 10:34:15 +02:00
|
|
|
gimp_canvas_proxy_group_add_item (group, guide, item);
|
|
|
|
g_object_unref (item);
|
|
|
|
}
|
2010-09-30 08:59:36 +02:00
|
|
|
|
2010-10-01 10:34:15 +02:00
|
|
|
static void
|
|
|
|
gimp_display_shell_guide_remove_handler (GimpImage *image,
|
|
|
|
GimpGuide *guide,
|
|
|
|
GimpDisplayShell *shell)
|
|
|
|
{
|
|
|
|
GimpCanvasProxyGroup *group = GIMP_CANVAS_PROXY_GROUP (shell->guides);
|
|
|
|
|
|
|
|
gimp_canvas_proxy_group_remove_item (group, guide);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_display_shell_guide_move_handler (GimpImage *image,
|
|
|
|
GimpGuide *guide,
|
|
|
|
GimpDisplayShell *shell)
|
|
|
|
{
|
|
|
|
GimpCanvasProxyGroup *group = GIMP_CANVAS_PROXY_GROUP (shell->guides);
|
|
|
|
GimpCanvasItem *item;
|
|
|
|
|
|
|
|
item = gimp_canvas_proxy_group_get_item (group, guide);
|
|
|
|
|
2011-03-28 15:15:43 +02:00
|
|
|
gimp_canvas_guide_set (item,
|
|
|
|
gimp_guide_get_orientation (guide),
|
|
|
|
gimp_guide_get_position (guide));
|
2001-11-14 15:40:30 +00:00
|
|
|
}
|
2002-02-17 13:12:16 +00:00
|
|
|
|
2005-03-04 16:34:59 +00:00
|
|
|
static void
|
2010-10-01 09:15:52 +02:00
|
|
|
gimp_display_shell_sample_point_add_handler (GimpImage *image,
|
|
|
|
GimpSamplePoint *sample_point,
|
|
|
|
GimpDisplayShell *shell)
|
2005-03-04 16:34:59 +00:00
|
|
|
{
|
2010-10-01 09:15:52 +02:00
|
|
|
GimpCanvasProxyGroup *group = GIMP_CANVAS_PROXY_GROUP (shell->sample_points);
|
|
|
|
GimpCanvasItem *item;
|
|
|
|
GList *list;
|
2016-01-04 22:06:27 +01:00
|
|
|
gint x;
|
|
|
|
gint y;
|
2010-10-01 09:15:52 +02:00
|
|
|
gint i;
|
2010-09-30 08:59:36 +02:00
|
|
|
|
2016-01-04 22:06:27 +01:00
|
|
|
gimp_sample_point_get_position (sample_point, &x, &y);
|
|
|
|
|
|
|
|
item = gimp_canvas_sample_point_new (shell, x, y, 0, TRUE);
|
2010-09-30 08:59:36 +02:00
|
|
|
|
2010-10-01 09:15:52 +02:00
|
|
|
gimp_canvas_proxy_group_add_item (group, sample_point, item);
|
|
|
|
g_object_unref (item);
|
|
|
|
|
|
|
|
for (list = gimp_image_get_sample_points (image), i = 1;
|
|
|
|
list;
|
|
|
|
list = g_list_next (list), i++)
|
|
|
|
{
|
|
|
|
GimpSamplePoint *sample_point = list->data;
|
|
|
|
|
|
|
|
item = gimp_canvas_proxy_group_get_item (group, sample_point);
|
|
|
|
|
2011-03-01 17:05:58 +01:00
|
|
|
if (item)
|
|
|
|
g_object_set (item,
|
|
|
|
"index", i,
|
|
|
|
NULL);
|
2010-10-01 09:15:52 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_display_shell_sample_point_remove_handler (GimpImage *image,
|
|
|
|
GimpSamplePoint *sample_point,
|
|
|
|
GimpDisplayShell *shell)
|
|
|
|
{
|
|
|
|
GimpCanvasProxyGroup *group = GIMP_CANVAS_PROXY_GROUP (shell->sample_points);
|
|
|
|
GList *list;
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
gimp_canvas_proxy_group_remove_item (group, sample_point);
|
|
|
|
|
|
|
|
for (list = gimp_image_get_sample_points (image), i = 1;
|
|
|
|
list;
|
|
|
|
list = g_list_next (list), i++)
|
|
|
|
{
|
|
|
|
GimpSamplePoint *sample_point = list->data;
|
2010-10-01 17:13:00 +02:00
|
|
|
GimpCanvasItem *item;
|
2010-10-01 09:15:52 +02:00
|
|
|
|
|
|
|
item = gimp_canvas_proxy_group_get_item (group, sample_point);
|
|
|
|
|
2011-03-01 17:05:58 +01:00
|
|
|
if (item)
|
|
|
|
g_object_set (item,
|
|
|
|
"index", i,
|
|
|
|
NULL);
|
2010-10-01 09:15:52 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_display_shell_sample_point_move_handler (GimpImage *image,
|
|
|
|
GimpSamplePoint *sample_point,
|
|
|
|
GimpDisplayShell *shell)
|
|
|
|
{
|
|
|
|
GimpCanvasProxyGroup *group = GIMP_CANVAS_PROXY_GROUP (shell->sample_points);
|
|
|
|
GimpCanvasItem *item;
|
2016-01-04 22:06:27 +01:00
|
|
|
gint x;
|
|
|
|
gint y;
|
2010-10-01 09:15:52 +02:00
|
|
|
|
|
|
|
item = gimp_canvas_proxy_group_get_item (group, sample_point);
|
|
|
|
|
2016-01-04 22:06:27 +01:00
|
|
|
gimp_sample_point_get_position (sample_point, &x, &y);
|
|
|
|
|
|
|
|
gimp_canvas_sample_point_set (item, x, y);
|
2005-03-04 16:34:59 +00:00
|
|
|
}
|
|
|
|
|
2019-09-04 17:48:06 +03:00
|
|
|
static void
|
|
|
|
gimp_display_shell_component_visibility_changed_handler (GimpImage *image,
|
|
|
|
GimpChannelType channel,
|
|
|
|
GimpDisplayShell *shell)
|
|
|
|
{
|
|
|
|
if (channel == GIMP_CHANNEL_ALPHA && shell->show_all)
|
|
|
|
gimp_display_shell_expose_full (shell);
|
|
|
|
}
|
|
|
|
|
2008-08-03 11:35:53 +00:00
|
|
|
static void
|
|
|
|
gimp_display_shell_size_changed_detailed_handler (GimpImage *image,
|
2008-08-04 20:11:35 +00:00
|
|
|
gint previous_origin_x,
|
|
|
|
gint previous_origin_y,
|
2008-08-28 19:12:03 +00:00
|
|
|
gint previous_width,
|
|
|
|
gint previous_height,
|
2008-08-03 11:35:53 +00:00
|
|
|
GimpDisplayShell *shell)
|
|
|
|
{
|
2016-01-10 20:09:28 +01:00
|
|
|
GimpDisplayConfig *config = shell->display->config;
|
|
|
|
gboolean resize_window;
|
|
|
|
|
|
|
|
/* Resize windows only in multi-window mode */
|
|
|
|
resize_window = (config->resize_windows_on_resize &&
|
|
|
|
! GIMP_GUI_CONFIG (config)->single_window_mode);
|
|
|
|
|
|
|
|
if (resize_window)
|
2008-08-04 20:11:35 +00:00
|
|
|
{
|
2009-09-29 20:32:26 +02:00
|
|
|
GimpImageWindow *window = gimp_display_shell_get_window (shell);
|
2009-09-25 17:46:09 +02:00
|
|
|
|
2009-09-29 20:32:26 +02:00
|
|
|
if (window && gimp_image_window_get_active_shell (window) == shell)
|
2009-09-25 17:46:09 +02:00
|
|
|
{
|
|
|
|
/* If the window is resized just center the image in it when it
|
|
|
|
* has change size
|
|
|
|
*/
|
|
|
|
gimp_image_window_shrink_wrap (window, FALSE);
|
|
|
|
}
|
2008-08-04 20:11:35 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2016-01-05 17:33:22 +01:00
|
|
|
GimpImage *image = gimp_display_get_image (shell->display);
|
|
|
|
gint new_width = gimp_image_get_width (image);
|
|
|
|
gint new_height = gimp_image_get_height (image);
|
|
|
|
gint scaled_previous_origin_x;
|
|
|
|
gint scaled_previous_origin_y;
|
2009-03-28 21:13:20 +00:00
|
|
|
gboolean horizontally;
|
|
|
|
gboolean vertically;
|
2008-08-28 19:12:03 +00:00
|
|
|
|
2016-01-05 17:33:22 +01:00
|
|
|
scaled_previous_origin_x = SCALEX (shell, previous_origin_x);
|
|
|
|
scaled_previous_origin_y = SCALEY (shell, previous_origin_y);
|
|
|
|
|
2009-03-28 21:13:20 +00:00
|
|
|
horizontally = (SCALEX (shell, previous_width) > shell->disp_width &&
|
|
|
|
SCALEX (shell, new_width) <= shell->disp_width);
|
|
|
|
vertically = (SCALEY (shell, previous_height) > shell->disp_height &&
|
|
|
|
SCALEY (shell, new_height) <= shell->disp_height);
|
2008-08-04 20:11:35 +00:00
|
|
|
|
2008-08-10 13:09:24 +00:00
|
|
|
gimp_display_shell_scroll_set_offset (shell,
|
|
|
|
shell->offset_x + scaled_previous_origin_x,
|
|
|
|
shell->offset_y + scaled_previous_origin_y);
|
2008-08-28 19:12:03 +00:00
|
|
|
|
2019-09-15 16:22:06 +03:00
|
|
|
if (! gimp_display_shell_get_infinite_canvas (shell))
|
app: improve display scroll/zoom-related behavior in "show all" mode
In "show all" mode, the image is thought to be "infinite"; this
commit improves the overall scrolling/zooming behavior in this mode
according to this assumption. In cases where a specific image size
is needed (e.g., for the scrollbar bounds, fit-image-in-window,
etc.), the image's full bounding box is used; however, in cases
where a center point is needed (e.g., for the zoomed-out scrollbar
bounds, center-image-in-window), the canvas center, rather than the
bounding-box center, is still used.
2019-09-04 16:11:54 +03:00
|
|
|
{
|
|
|
|
gimp_display_shell_scroll_center_image (shell,
|
|
|
|
horizontally, vertically);
|
|
|
|
}
|
2008-12-04 20:22:30 +00:00
|
|
|
|
|
|
|
/* The above calls might not lead to a call to
|
2016-01-05 17:33:22 +01:00
|
|
|
* gimp_display_shell_scroll_clamp_and_update() and
|
|
|
|
* gimp_display_shell_expose_full() in all cases because when
|
|
|
|
* scaling the old and new scroll offset might be the same.
|
|
|
|
*
|
|
|
|
* We need them to be called in all cases, so simply call them
|
|
|
|
* explicitly here at the end
|
2008-12-04 20:22:30 +00:00
|
|
|
*/
|
|
|
|
gimp_display_shell_scroll_clamp_and_update (shell);
|
2009-03-28 21:18:40 +00:00
|
|
|
|
|
|
|
gimp_display_shell_expose_full (shell);
|
2019-07-15 23:24:35 +02:00
|
|
|
gimp_display_shell_render_invalidate_full (shell);
|
2008-08-04 20:11:35 +00:00
|
|
|
}
|
2008-08-03 11:35:53 +00:00
|
|
|
}
|
|
|
|
|
2019-06-01 14:19:05 +02:00
|
|
|
static void
|
|
|
|
gimp_display_shell_mode_changed_handler (GimpImage *image,
|
|
|
|
GimpDisplayShell *shell)
|
|
|
|
{
|
|
|
|
gimp_display_shell_profile_update (shell);
|
2002-02-17 13:12:16 +00:00
|
|
|
}
|
|
|
|
|
2015-06-13 00:27:21 +02:00
|
|
|
static void
|
|
|
|
gimp_display_shell_precision_changed_handler (GimpImage *image,
|
|
|
|
GimpDisplayShell *shell)
|
|
|
|
{
|
|
|
|
gimp_display_shell_profile_update (shell);
|
|
|
|
}
|
|
|
|
|
2007-08-06 19:23:22 +00:00
|
|
|
static void
|
|
|
|
gimp_display_shell_profile_changed_handler (GimpColorManaged *image,
|
|
|
|
GimpDisplayShell *shell)
|
|
|
|
{
|
|
|
|
gimp_color_managed_profile_changed (GIMP_COLOR_MANAGED (shell));
|
|
|
|
}
|
|
|
|
|
2009-09-29 22:38:34 +02:00
|
|
|
static void
|
|
|
|
gimp_display_shell_saved_handler (GimpImage *image,
|
2014-07-07 23:56:56 +02:00
|
|
|
GFile *file,
|
2009-09-29 22:38:34 +02:00
|
|
|
GimpDisplayShell *shell)
|
|
|
|
{
|
2009-10-04 15:31:38 +02:00
|
|
|
GimpStatusbar *statusbar = gimp_display_shell_get_statusbar (shell);
|
2009-09-29 22:38:34 +02:00
|
|
|
|
2009-10-04 15:31:38 +02:00
|
|
|
gimp_statusbar_push_temp (statusbar, GIMP_MESSAGE_INFO,
|
2017-03-05 16:01:59 +01:00
|
|
|
GIMP_ICON_DOCUMENT_SAVE,
|
|
|
|
_("Image saved to '%s'"),
|
2014-07-07 23:56:56 +02:00
|
|
|
gimp_file_get_utf8_name (file));
|
2009-09-29 22:38:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_display_shell_exported_handler (GimpImage *image,
|
2014-07-07 23:56:56 +02:00
|
|
|
GFile *file,
|
2009-09-29 22:38:34 +02:00
|
|
|
GimpDisplayShell *shell)
|
|
|
|
{
|
2009-10-04 15:31:38 +02:00
|
|
|
GimpStatusbar *statusbar = gimp_display_shell_get_statusbar (shell);
|
2009-09-29 22:38:34 +02:00
|
|
|
|
2009-10-04 15:31:38 +02:00
|
|
|
gimp_statusbar_push_temp (statusbar, GIMP_MESSAGE_INFO,
|
2017-03-05 16:01:59 +01:00
|
|
|
GIMP_ICON_DOCUMENT_SAVE,
|
|
|
|
_("Image exported to '%s'"),
|
2014-07-07 23:56:56 +02:00
|
|
|
gimp_file_get_utf8_name (file));
|
2009-09-29 22:38:34 +02:00
|
|
|
}
|
|
|
|
|
2010-09-12 00:08:17 +02:00
|
|
|
static void
|
|
|
|
gimp_display_shell_active_vectors_handler (GimpImage *image,
|
|
|
|
GimpDisplayShell *shell)
|
|
|
|
{
|
2010-10-08 18:52:28 +02:00
|
|
|
GimpCanvasProxyGroup *group = GIMP_CANVAS_PROXY_GROUP (shell->vectors);
|
2010-10-08 01:03:56 +02:00
|
|
|
GimpVectors *active = gimp_image_get_active_vectors (image);
|
|
|
|
GList *list;
|
|
|
|
|
|
|
|
for (list = gimp_image_get_vectors_iter (image);
|
|
|
|
list;
|
|
|
|
list = g_list_next (list))
|
|
|
|
{
|
|
|
|
GimpVectors *vectors = list->data;
|
|
|
|
GimpCanvasItem *item;
|
|
|
|
|
|
|
|
item = gimp_canvas_proxy_group_get_item (group, vectors);
|
|
|
|
|
|
|
|
gimp_canvas_item_set_highlight (item, vectors == active);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_display_shell_vectors_freeze_handler (GimpVectors *vectors,
|
|
|
|
GimpDisplayShell *shell)
|
|
|
|
{
|
|
|
|
/* do nothing */
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_display_shell_vectors_thaw_handler (GimpVectors *vectors,
|
|
|
|
GimpDisplayShell *shell)
|
|
|
|
{
|
|
|
|
GimpCanvasProxyGroup *group = GIMP_CANVAS_PROXY_GROUP (shell->vectors);
|
|
|
|
GimpCanvasItem *item;
|
|
|
|
|
|
|
|
item = gimp_canvas_proxy_group_get_item (group, vectors);
|
|
|
|
|
2011-03-28 15:15:43 +02:00
|
|
|
gimp_canvas_path_set (item, gimp_vectors_get_bezier (vectors));
|
2010-10-08 01:03:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_display_shell_vectors_visible_handler (GimpVectors *vectors,
|
|
|
|
GimpDisplayShell *shell)
|
|
|
|
{
|
|
|
|
GimpCanvasProxyGroup *group = GIMP_CANVAS_PROXY_GROUP (shell->vectors);
|
|
|
|
GimpCanvasItem *item;
|
|
|
|
|
|
|
|
item = gimp_canvas_proxy_group_get_item (group, vectors);
|
|
|
|
|
|
|
|
gimp_canvas_item_set_visible (item,
|
|
|
|
gimp_item_get_visible (GIMP_ITEM (vectors)));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_display_shell_vectors_add_handler (GimpContainer *container,
|
|
|
|
GimpVectors *vectors,
|
|
|
|
GimpDisplayShell *shell)
|
|
|
|
{
|
|
|
|
GimpCanvasProxyGroup *group = GIMP_CANVAS_PROXY_GROUP (shell->vectors);
|
|
|
|
GimpCanvasItem *item;
|
|
|
|
|
|
|
|
item = gimp_canvas_path_new (shell,
|
|
|
|
gimp_vectors_get_bezier (vectors),
|
2011-04-04 20:58:38 +02:00
|
|
|
0, 0,
|
2011-06-30 09:27:43 +02:00
|
|
|
FALSE,
|
|
|
|
GIMP_PATH_STYLE_VECTORS);
|
2010-10-08 01:03:56 +02:00
|
|
|
gimp_canvas_item_set_visible (item,
|
|
|
|
gimp_item_get_visible (GIMP_ITEM (vectors)));
|
|
|
|
|
|
|
|
gimp_canvas_proxy_group_add_item (group, vectors, item);
|
|
|
|
g_object_unref (item);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_display_shell_vectors_remove_handler (GimpContainer *container,
|
|
|
|
GimpVectors *vectors,
|
|
|
|
GimpDisplayShell *shell)
|
|
|
|
{
|
|
|
|
GimpCanvasProxyGroup *group = GIMP_CANVAS_PROXY_GROUP (shell->vectors);
|
|
|
|
|
|
|
|
gimp_canvas_proxy_group_remove_item (group, vectors);
|
2010-09-12 00:08:17 +02:00
|
|
|
}
|
|
|
|
|
2002-11-21 15:46:19 +00:00
|
|
|
static void
|
|
|
|
gimp_display_shell_check_notify_handler (GObject *config,
|
|
|
|
GParamSpec *param_spec,
|
|
|
|
GimpDisplayShell *shell)
|
|
|
|
{
|
2003-10-22 14:46:05 +00:00
|
|
|
GimpCanvasPaddingMode padding_mode;
|
|
|
|
GimpRGB padding_color;
|
2003-07-17 22:30:13 +00:00
|
|
|
|
2017-07-15 18:38:01 +02:00
|
|
|
g_clear_pointer (&shell->checkerboard, cairo_pattern_destroy);
|
2010-09-28 21:10:03 +02:00
|
|
|
|
2003-07-17 22:30:13 +00:00
|
|
|
gimp_display_shell_get_padding (shell, &padding_mode, &padding_color);
|
|
|
|
|
|
|
|
switch (padding_mode)
|
2002-11-23 22:22:21 +00:00
|
|
|
{
|
2003-10-22 14:46:05 +00:00
|
|
|
case GIMP_CANVAS_PADDING_MODE_LIGHT_CHECK:
|
|
|
|
case GIMP_CANVAS_PADDING_MODE_DARK_CHECK:
|
2003-07-17 22:30:13 +00:00
|
|
|
gimp_display_shell_set_padding (shell, padding_mode, &padding_color);
|
2002-11-23 22:22:21 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2003-02-24 12:30:33 +00:00
|
|
|
|
|
|
|
gimp_display_shell_expose_full (shell);
|
2002-11-21 15:46:19 +00:00
|
|
|
}
|
|
|
|
|
2002-11-22 22:10:40 +00:00
|
|
|
static void
|
|
|
|
gimp_display_shell_title_notify_handler (GObject *config,
|
|
|
|
GParamSpec *param_spec,
|
|
|
|
GimpDisplayShell *shell)
|
|
|
|
{
|
2004-07-14 16:37:13 +00:00
|
|
|
gimp_display_shell_title_update (shell);
|
2002-11-22 22:10:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_display_shell_nav_size_notify_handler (GObject *config,
|
|
|
|
GParamSpec *param_spec,
|
|
|
|
GimpDisplayShell *shell)
|
|
|
|
{
|
2017-07-15 18:38:01 +02:00
|
|
|
g_clear_pointer (&shell->nav_popup, gtk_widget_destroy);
|
2002-11-22 22:10:40 +00:00
|
|
|
}
|
|
|
|
|
2002-11-23 22:22:21 +00:00
|
|
|
static void
|
|
|
|
gimp_display_shell_monitor_res_notify_handler (GObject *config,
|
|
|
|
GParamSpec *param_spec,
|
|
|
|
GimpDisplayShell *shell)
|
|
|
|
{
|
2003-05-28 16:11:29 +00:00
|
|
|
if (GIMP_DISPLAY_CONFIG (config)->monitor_res_from_gdk)
|
|
|
|
{
|
2018-04-29 17:27:47 +02:00
|
|
|
gimp_get_monitor_resolution (gimp_widget_get_monitor (GTK_WIDGET (shell)),
|
2014-05-02 23:56:16 +02:00
|
|
|
&shell->monitor_xres,
|
|
|
|
&shell->monitor_yres);
|
2003-05-28 16:11:29 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
shell->monitor_xres = GIMP_DISPLAY_CONFIG (config)->monitor_xres;
|
|
|
|
shell->monitor_yres = GIMP_DISPLAY_CONFIG (config)->monitor_yres;
|
|
|
|
}
|
2002-11-23 22:22:21 +00:00
|
|
|
|
2016-01-05 18:48:22 +01:00
|
|
|
gimp_display_shell_scale_update (shell);
|
2007-03-14 10:01:08 +00:00
|
|
|
|
2002-11-25 13:48:24 +00:00
|
|
|
if (! shell->dot_for_dot)
|
2002-12-18 15:42:45 +00:00
|
|
|
{
|
2008-08-14 15:44:25 +00:00
|
|
|
gimp_display_shell_scroll_clamp_and_update (shell);
|
|
|
|
|
2003-03-21 16:28:06 +00:00
|
|
|
gimp_display_shell_scaled (shell);
|
2002-11-25 13:48:24 +00:00
|
|
|
|
2002-12-18 15:42:45 +00:00
|
|
|
gimp_display_shell_expose_full (shell);
|
2019-07-15 23:24:35 +02:00
|
|
|
gimp_display_shell_render_invalidate_full (shell);
|
2002-12-18 15:42:45 +00:00
|
|
|
}
|
2002-11-23 22:22:21 +00:00
|
|
|
}
|
|
|
|
|
2007-10-30 12:02:19 +00:00
|
|
|
static void
|
|
|
|
gimp_display_shell_padding_notify_handler (GObject *config,
|
|
|
|
GParamSpec *param_spec,
|
|
|
|
GimpDisplayShell *shell)
|
|
|
|
{
|
|
|
|
GimpDisplayConfig *display_config;
|
2009-09-29 20:32:26 +02:00
|
|
|
GimpImageWindow *window;
|
2007-10-30 12:02:19 +00:00
|
|
|
gboolean fullscreen;
|
|
|
|
GimpCanvasPaddingMode padding_mode;
|
|
|
|
GimpRGB padding_color;
|
|
|
|
|
2008-03-18 21:22:21 +00:00
|
|
|
display_config = shell->display->config;
|
2007-10-30 12:02:19 +00:00
|
|
|
|
2009-09-29 20:32:26 +02:00
|
|
|
window = gimp_display_shell_get_window (shell);
|
2009-09-23 14:52:33 +02:00
|
|
|
|
2009-09-29 20:32:26 +02:00
|
|
|
if (window)
|
|
|
|
fullscreen = gimp_image_window_get_fullscreen (window);
|
|
|
|
else
|
|
|
|
fullscreen = FALSE;
|
2007-10-30 12:02:19 +00:00
|
|
|
|
2012-09-10 12:22:12 -04:00
|
|
|
/* if the user did not set the padding mode for this display explicitly */
|
2007-10-30 12:02:19 +00:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-09-10 12:22:12 -04:00
|
|
|
/* if the user did not set the padding mode for this display explicitly */
|
2007-10-30 12:02:19 +00:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-11-24 00:03:42 +00:00
|
|
|
static void
|
|
|
|
gimp_display_shell_ants_speed_notify_handler (GObject *config,
|
|
|
|
GParamSpec *param_spec,
|
|
|
|
GimpDisplayShell *shell)
|
|
|
|
{
|
2010-10-09 14:26:33 +02:00
|
|
|
gimp_display_shell_selection_pause (shell);
|
|
|
|
gimp_display_shell_selection_resume (shell);
|
2002-11-24 00:03:42 +00:00
|
|
|
}
|
|
|
|
|
2007-10-08 13:30:49 +00:00
|
|
|
static void
|
|
|
|
gimp_display_shell_quality_notify_handler (GObject *config,
|
|
|
|
GParamSpec *param_spec,
|
|
|
|
GimpDisplayShell *shell)
|
|
|
|
{
|
|
|
|
gimp_display_shell_expose_full (shell);
|
2019-07-15 23:24:35 +02:00
|
|
|
gimp_display_shell_render_invalidate_full (shell);
|
2007-10-08 13:30:49 +00:00
|
|
|
}
|
2016-05-14 23:50:58 +02:00
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_display_shell_color_config_notify_handler (GObject *config,
|
|
|
|
GParamSpec *param_spec,
|
|
|
|
GimpDisplayShell *shell)
|
|
|
|
{
|
|
|
|
if (param_spec)
|
|
|
|
{
|
|
|
|
gboolean copy = TRUE;
|
|
|
|
|
2016-05-16 13:27:59 +02:00
|
|
|
if (! strcmp (param_spec->name, "mode") ||
|
|
|
|
! strcmp (param_spec->name, "display-rendering-intent") ||
|
|
|
|
! strcmp (param_spec->name, "display-use-black-point-compensation") ||
|
2020-10-16 19:50:19 +02:00
|
|
|
! strcmp (param_spec->name, "simulation-profile") ||
|
2016-05-16 13:27:59 +02:00
|
|
|
! strcmp (param_spec->name, "simulation-rendering-intent") ||
|
|
|
|
! strcmp (param_spec->name, "simulation-use-black-point-compensation") ||
|
|
|
|
! strcmp (param_spec->name, "simulation-gamut-check"))
|
2016-05-14 23:50:58 +02:00
|
|
|
{
|
|
|
|
if (shell->color_config_set)
|
|
|
|
copy = FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (copy)
|
|
|
|
{
|
|
|
|
GValue value = G_VALUE_INIT;
|
|
|
|
|
|
|
|
g_value_init (&value, param_spec->value_type);
|
|
|
|
|
|
|
|
g_object_get_property (config,
|
|
|
|
param_spec->name, &value);
|
|
|
|
g_object_set_property (G_OBJECT (shell->color_config),
|
|
|
|
param_spec->name, &value);
|
|
|
|
|
|
|
|
g_value_unset (&value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gimp_config_copy (GIMP_CONFIG (config),
|
|
|
|
GIMP_CONFIG (shell->color_config),
|
|
|
|
0);
|
|
|
|
shell->color_config_set = FALSE;
|
|
|
|
}
|
|
|
|
}
|
2019-09-05 13:51:35 +03:00
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_display_shell_display_changed_handler (GimpContext *context,
|
|
|
|
GimpDisplay *display,
|
|
|
|
GimpDisplayShell *shell)
|
|
|
|
{
|
|
|
|
if (shell->display == display)
|
|
|
|
gimp_display_shell_update_priority_rect (shell);
|
|
|
|
}
|