[gimp/soc/2022/cmyk: 2/2] core, libgimpcolor: Change simulation profile




commit a93916a41ce34d6523f027520ccbc2021ba32a05
Author: Alx Sa <cmyk student gmail com>
Date:   Sun Jun 19 13:29:52 2022 +0000

    core, libgimpcolor: Change simulation profile
    
    Updates menu options and code to support changing GimpImage’s
    internal simulation profile. Menu items are moved from View to
    Image’s Color Management section.
    New “simulation-profile-changed” signal is emitted via
    GimpColorManagedInterface so that relevant tools (such as the
    CMYK color picker, GimpColorFrame, and future dockable
    dialogue) are aware of these changes.

 app/actions/image-actions.c            | 144 ++++++++++++++++++++++---
 app/actions/image-commands.c           | 186 +++++++++++++++++++++++++++++++++
 app/actions/image-commands.h           | 160 +++++++++++++++-------------
 app/actions/view-actions.c             | 111 --------------------
 app/actions/view-commands.c            | 180 -------------------------------
 app/actions/view-commands.h            |  13 ---
 app/core/gimpimage.c                   |  32 +++++-
 app/display/gimpdisplayshell-profile.c |  39 +------
 libgimpcolor/gimpcolor.def             |   2 +
 libgimpcolor/gimpcolormanaged.c        |  53 +++++++++-
 libgimpcolor/gimpcolormanaged.h        |  25 +++--
 menus/image-menu.xml.in                |  25 +++--
 12 files changed, 521 insertions(+), 449 deletions(-)
---
diff --git a/app/actions/image-actions.c b/app/actions/image-actions.c
index cdfdef7d4b..eec92d73b7 100644
--- a/app/actions/image-actions.c
+++ b/app/actions/image-actions.c
@@ -20,6 +20,7 @@
 #include <gegl.h>
 #include <gtk/gtk.h>
 
+#include "libgimpconfig/gimpconfig.h"
 #include "libgimpwidgets/gimpwidgets.h"
 
 #include "actions-types.h"
@@ -35,6 +36,9 @@
 #include "core/gimpimage-color-profile.h"
 #include "core/gimpitemstack.h"
 
+#include "display/gimpdisplay.h"
+#include "display/gimpdisplayshell.h"
+
 #include "widgets/gimpactiongroup.h"
 #include "widgets/gimphelp-ids.h"
 
@@ -102,12 +106,21 @@ static const GimpActionEntry image_actions[] =
     image_color_profile_discard_cmd_callback,
     GIMP_HELP_IMAGE_COLOR_PROFILE_DISCARD },
 
+  { "image-softproof-profile", NULL,
+    NC_("image-action", "_Softproof Profile..."), NULL,
+    NC_("image-action", "Set the softproofing profile"),
+    image_softproof_profile_cmd_callback,
+    GIMP_HELP_VIEW_COLOR_MANAGEMENT },
+
   { "image-color-profile-save", NULL,
     NC_("image-action", "_Save Color Profile to File..."), NULL,
     NC_("image-action", "Save the image's color profile to an ICC file"),
     image_color_profile_save_cmd_callback,
     GIMP_HELP_IMAGE_COLOR_PROFILE_SAVE },
 
+  { "image-softproof-intent-menu", NULL,
+    NC_("image-action", "Soft-Proofing Re_ndering Intent") },
+
   { "image-resize", GIMP_ICON_OBJECT_RESIZE,
     NC_("image-action", "Can_vas Size..."), NULL,
     NC_("image-action", "Adjust the image dimensions"),
@@ -184,7 +197,29 @@ static const GimpToggleActionEntry image_toggle_actions[] =
         "allows to easily restore the profile."),
     image_color_profile_use_srgb_cmd_callback,
     TRUE,
-    GIMP_HELP_IMAGE_COLOR_PROFILE_USE_SRGB }
+    GIMP_HELP_IMAGE_COLOR_PROFILE_USE_SRGB },
+
+  { "image-color-management-softproof", NULL,
+    NC_("image-action", "_Proof Colors"), NULL,
+    NC_("image-action", "Use simulation profile for soft-proofing"),
+    image_color_management_softproof_cmd_callback,
+    FALSE,
+    GIMP_HELP_VIEW_COLOR_MANAGEMENT },
+
+  { "image-softproof-black-point-compensation", NULL,
+    NC_("image-action", "_Black Point Compensation"), NULL,
+    NC_("image-action", "Use black point compensation for soft-proofing"),
+    image_softproof_bpc_cmd_callback,
+    TRUE,
+    GIMP_HELP_VIEW_COLOR_MANAGEMENT },
+
+  { "image-softproof-gamut-check", NULL,
+    NC_("image-action", "_Mark Out Of Gamut Colors"), NULL,
+    NC_("image-action", "When soft-proofing, mark colors which cannot "
+        "be represented in the target color space"),
+    image_softproof_gamut_check_cmd_callback,
+    FALSE,
+    GIMP_HELP_VIEW_COLOR_MANAGEMENT }
 };
 
 static const GimpRadioActionEntry image_convert_base_type_actions[] =
@@ -301,6 +336,33 @@ static const GimpEnumActionEntry image_rotate_actions[] =
     GIMP_HELP_IMAGE_ROTATE_270 }
 };
 
+static const GimpRadioActionEntry image_softproof_intent_actions[] =
+{
+  { "image-softproof-intent-perceptual", NULL,
+    NC_("image-action", "_Perceptual"), NULL,
+    NC_("image-action", "Soft-proofing rendering intent is perceptual"),
+    GIMP_COLOR_RENDERING_INTENT_PERCEPTUAL,
+    GIMP_HELP_VIEW_COLOR_MANAGEMENT },
+
+  { "image-softproof-intent-relative-colorimetric", NULL,
+    NC_("image-action", "_Relative Colorimetric"), NULL,
+    NC_("image-action", "Soft-proofing rendering intent is relative colorimetric"),
+    GIMP_COLOR_RENDERING_INTENT_RELATIVE_COLORIMETRIC,
+    GIMP_HELP_VIEW_COLOR_MANAGEMENT },
+
+  { "image-softproof-intent-saturation", NULL,
+    NC_("image-action", "_Saturation"), NULL,
+    NC_("image-action", "Soft-proofing rendering intent is saturation"),
+    GIMP_COLOR_RENDERING_INTENT_SATURATION,
+    GIMP_HELP_VIEW_COLOR_MANAGEMENT },
+
+  { "image-softproof-intent-absolute-colorimetric", NULL,
+    NC_("image-action", "_Absolute Colorimetric"), NULL,
+    NC_("image-action", "Soft-proofing rendering intent is absolute colorimetric"),
+    GIMP_COLOR_RENDERING_INTENT_ABSOLUTE_COLORIMETRIC,
+    GIMP_HELP_VIEW_COLOR_MANAGEMENT }
+};
+
 
 void
 image_actions_setup (GimpActionGroup *group)
@@ -313,6 +375,13 @@ image_actions_setup (GimpActionGroup *group)
                                         image_toggle_actions,
                                         G_N_ELEMENTS (image_toggle_actions));
 
+  gimp_action_group_add_radio_actions (group, "image-action",
+                                       image_softproof_intent_actions,
+                                       G_N_ELEMENTS (image_softproof_intent_actions),
+                                       NULL,
+                                       GIMP_COLOR_MANAGEMENT_DISPLAY,
+                                       image_softproof_intent_cmd_callback);
+
   gimp_action_group_add_radio_actions (group, "image-convert-action",
                                        image_convert_base_type_actions,
                                        G_N_ELEMENTS (image_convert_base_type_actions),
@@ -355,17 +424,23 @@ void
 image_actions_update (GimpActionGroup *group,
                       gpointer         data)
 {
-  GimpImage *image          = action_data_get_image (data);
-  gboolean   is_indexed     = FALSE;
-  gboolean   is_u8_gamma    = FALSE;
-  gboolean   is_double      = FALSE;
-  gboolean   aux            = FALSE;
-  gboolean   lp             = FALSE;
-  gboolean   sel            = FALSE;
-  gboolean   groups         = FALSE;
-  gboolean   profile_srgb   = FALSE;
-  gboolean   profile_hidden = FALSE;
-  gboolean   profile        = FALSE;
+  GimpImage        *image          = action_data_get_image (data);
+  GimpDisplay      *display        = action_data_get_display (data);
+  GimpDisplayShell *shell          = NULL;
+  GimpColorConfig  *color_config   = NULL;
+  gboolean          is_indexed     = FALSE;
+  gboolean          is_u8_gamma    = FALSE;
+  gboolean          is_double      = FALSE;
+  gboolean          aux            = FALSE;
+  gboolean          lp             = FALSE;
+  gboolean          sel            = FALSE;
+  gboolean          groups         = FALSE;
+  gboolean          profile_srgb   = FALSE;
+  gboolean          profile_hidden = FALSE;
+  gboolean          profile        = FALSE;
+  gboolean          sp             = FALSE;
+  gboolean          s_bpc          = FALSE;
+  gboolean          gammut         = FALSE;
 
 #define SET_LABEL(action,label) \
         gimp_action_group_set_action_label (group, action, (label))
@@ -445,6 +520,39 @@ image_actions_update (GimpActionGroup *group,
 
       profile_srgb = gimp_image_get_use_srgb_profile (image, &profile_hidden);
       profile      = (gimp_image_get_color_profile (image) != NULL);
+
+      if (display)
+        {
+          shell        = gimp_display_get_shell (display);
+          color_config = gimp_display_shell_get_color_config (shell);
+
+          if (gimp_color_config_get_mode (color_config) == GIMP_COLOR_MANAGEMENT_SOFTPROOF)
+            sp = (image != NULL);
+
+          switch (gimp_color_config_get_simulation_intent (color_config))
+            {
+            case GIMP_COLOR_RENDERING_INTENT_PERCEPTUAL:
+              action = "image-softproof-intent-perceptual";
+              break;
+
+            case GIMP_COLOR_RENDERING_INTENT_RELATIVE_COLORIMETRIC:
+              action = "image-softproof-intent-relative-colorimetric";
+              break;
+
+            case GIMP_COLOR_RENDERING_INTENT_SATURATION:
+              action = "image-softproof-intent-saturation";
+              break;
+
+            case GIMP_COLOR_RENDERING_INTENT_ABSOLUTE_COLORIMETRIC:
+              action = "image-softproof-intent-absolute-colorimetric";
+              break;
+            }
+
+          gimp_action_group_set_action_active (group, action, TRUE);
+
+          s_bpc  = gimp_color_config_get_simulation_bpc (color_config);
+          gammut = gimp_color_config_get_simulation_gamut_check (color_config);
+        }
     }
   else
     {
@@ -472,6 +580,18 @@ image_actions_update (GimpActionGroup *group,
   SET_SENSITIVE ("image-convert-grayscale", image);
   SET_SENSITIVE ("image-convert-indexed",   image && !groups && is_u8_gamma);
 
+  SET_SENSITIVE ("image-color-management-softproof",             image);
+  SET_ACTIVE    ("image-color-management-softproof",             sp);
+  SET_SENSITIVE ("image-softproof-profile",                      sp);
+  SET_SENSITIVE ("image-softproof-intent-perceptual",            sp);
+  SET_SENSITIVE ("image-softproof-intent-relative-colorimetric", sp);
+  SET_SENSITIVE ("image-softproof-intent-saturation",            sp);
+  SET_SENSITIVE ("image-softproof-intent-absolute-colorimetric", sp);
+  SET_SENSITIVE ("image-softproof-black-point-compensation",     sp);
+  SET_ACTIVE    ("image-softproof-black-point-compensation",     s_bpc);
+  SET_SENSITIVE ("image-softproof-gamut-check",                  sp);
+  SET_ACTIVE    ("image-softproof-gamut-check",                  gammut);
+
   SET_SENSITIVE ("image-convert-u8",     image);
   SET_SENSITIVE ("image-convert-u16",    image && !is_indexed);
   SET_SENSITIVE ("image-convert-u32",    image && !is_indexed);
diff --git a/app/actions/image-commands.c b/app/actions/image-commands.c
index 323cc60158..a0a1fabaf1 100644
--- a/app/actions/image-commands.c
+++ b/app/actions/image-commands.c
@@ -22,6 +22,7 @@
 
 #include "libgimpbase/gimpbase.h"
 #include "libgimpcolor/gimpcolor.h"
+#include "libgimpconfig/gimpconfig.h"
 #include "libgimpwidgets/gimpwidgets.h"
 
 #include "actions-types.h"
@@ -172,6 +173,14 @@ static void   image_merge_layers_callback      (GtkWidget              *dialog,
                                                 gboolean                discard_invisible,
                                                 gpointer                user_data);
 
+static void   image_softproof_profile_callback  (GtkWidget                *dialog,
+                                                 GimpImage                *image,
+                                                 GimpColorProfile         *new_profile,
+                                                 GFile                    *new_file,
+                                                 GimpColorRenderingIntent  intent,
+                                                 gboolean                  bpc,
+                                                 gpointer                  user_data);
+
 
 /*  private variables  */
 
@@ -1563,3 +1572,180 @@ image_merge_layers_callback (GtkWidget     *dialog,
 
   g_clear_pointer (&dialog, gtk_widget_destroy);
 }
+
+void
+image_color_management_softproof_cmd_callback (GimpAction *action,
+                                               GVariant   *value,
+                                               gpointer    data)
+{
+  GimpImage               *image;
+  GimpDisplayShell        *shell;
+  GimpColorConfig         *color_config;
+  GimpColorManagementMode  mode;
+  gboolean                 active;
+  return_if_no_image (image, data);
+  return_if_no_shell (shell, data);
+
+  color_config = gimp_display_shell_get_color_config (shell);
+
+  active = g_variant_get_boolean (value);
+
+  mode = gimp_color_config_get_mode (color_config);
+
+  if (active)
+    {
+      mode = GIMP_COLOR_MANAGEMENT_SOFTPROOF;
+    }
+  else
+    {
+      if (mode != GIMP_COLOR_MANAGEMENT_OFF)
+        mode = GIMP_COLOR_MANAGEMENT_DISPLAY;
+    }
+
+  if (mode != gimp_color_config_get_mode (color_config))
+    {
+      g_object_set (color_config,
+                    "mode", mode,
+                    NULL);
+      shell->color_config_set = TRUE;
+    }
+
+  gimp_image_flush (image);
+}
+
+void
+image_softproof_profile_cmd_callback (GimpAction *action,
+                                      GVariant   *value,
+                                      gpointer    data)
+{
+  GimpImage        *image;
+  GimpDisplayShell *shell;
+  GtkWidget        *dialog;
+  return_if_no_image (image, data);
+  return_if_no_shell (shell, data);
+
+#define SOFTPROOF_PROFILE_DIALOG_KEY "gimp-softproof-profile-dialog"
+
+  dialog = dialogs_get_dialog (G_OBJECT (shell), SOFTPROOF_PROFILE_DIALOG_KEY);
+
+  if (! dialog)
+    {
+      GimpColorProfile *current_profile;
+
+      current_profile = gimp_image_get_simulation_profile (image);
+
+      dialog = color_profile_dialog_new (COLOR_PROFILE_DIALOG_SELECT_SOFTPROOF_PROFILE,
+                                         image,
+                                         action_data_get_context (data),
+                                         GTK_WIDGET (shell),
+                                         current_profile,
+                                         NULL,
+                                         0, 0,
+                                         image_softproof_profile_callback,
+                                         shell);
+
+      dialogs_attach_dialog (G_OBJECT (shell),
+                             SOFTPROOF_PROFILE_DIALOG_KEY, dialog);
+    }
+
+  gtk_window_present (GTK_WINDOW (dialog));
+}
+
+static void
+image_softproof_profile_callback (GtkWidget                *dialog,
+                                  GimpImage                *image,
+                                  GimpColorProfile         *new_profile,
+                                  GFile                    *new_file,
+                                  GimpColorRenderingIntent  intent,
+                                  gboolean                  bpc,
+                                  gpointer                  user_data)
+{
+  GimpDisplayShell *shell = user_data;
+  GimpColorConfig  *color_config;
+  gchar            *path  = NULL;
+
+  color_config = gimp_display_shell_get_color_config (shell);
+
+  if (new_file)
+    path = g_file_get_path (new_file);
+
+  g_object_set (color_config,
+                "simulation-profile", path,
+                NULL);
+  shell->color_config_set = TRUE;
+
+  /* Update image's simulation profile */
+  gimp_image_set_simulation_profile (image, new_profile);
+  gimp_color_managed_simulation_profile_changed (GIMP_COLOR_MANAGED (image));
+
+  gtk_widget_destroy (dialog);
+}
+
+void
+image_softproof_intent_cmd_callback (GimpAction *action,
+                                     GVariant   *value,
+                                     gpointer    data)
+{
+  GimpDisplayShell          *shell;
+  GimpColorConfig           *color_config;
+  GimpColorRenderingIntent   intent;
+  return_if_no_shell (shell, data);
+
+  intent = (GimpColorRenderingIntent) g_variant_get_int32 (value);
+
+  color_config = gimp_display_shell_get_color_config (shell);
+
+  if (intent != gimp_color_config_get_simulation_intent (color_config))
+    {
+      g_object_set (color_config,
+                    "simulation-rendering-intent", intent,
+                    NULL);
+      shell->color_config_set = TRUE;
+    }
+}
+
+void
+image_softproof_bpc_cmd_callback (GimpAction *action,
+                                  GVariant   *value,
+                                  gpointer    data)
+{
+  GimpDisplayShell *shell;
+  GimpColorConfig  *color_config;
+  gboolean          active;
+  return_if_no_shell (shell, data);
+
+  color_config = gimp_display_shell_get_color_config (shell);
+
+  active = g_variant_get_boolean (value);
+
+  if (active != gimp_color_config_get_simulation_bpc (color_config))
+    {
+      g_object_set (color_config,
+                    "simulation-use-black-point-compensation", active,
+                    NULL);
+      shell->color_config_set = TRUE;
+    }
+}
+
+void
+image_softproof_gamut_check_cmd_callback (GimpAction *action,
+                                         GVariant   *value,
+                                         gpointer    data)
+{
+  GimpDisplayShell *shell;
+  GimpColorConfig  *color_config;
+  gboolean          active;
+  return_if_no_shell (shell, data);
+
+  color_config = gimp_display_shell_get_color_config (shell);
+
+  active = g_variant_get_boolean (value);
+
+  if (active != gimp_color_config_get_simulation_gamut_check (color_config))
+    {
+      g_object_set (color_config,
+                    "simulation-gamut-check", active,
+                    NULL);
+      shell->color_config_set = TRUE;
+    }
+}
diff --git a/app/actions/image-commands.h b/app/actions/image-commands.h
index 964ffb2ec5..caf35233ee 100644
--- a/app/actions/image-commands.h
+++ b/app/actions/image-commands.h
@@ -19,83 +19,99 @@
 #define __IMAGE_COMMANDS_H__
 
 
-void   image_new_cmd_callback                      (GimpAction *action,
-                                                    GVariant   *value,
-                                                    gpointer    data);
-void   image_duplicate_cmd_callback                (GimpAction *action,
-                                                    GVariant   *value,
-                                                    gpointer    data);
+void   image_new_cmd_callback                        (GimpAction *action,
+                                                      GVariant   *value,
+                                                      gpointer    data);
+void   image_duplicate_cmd_callback                  (GimpAction *action,
+                                                      GVariant   *value,
+                                                      gpointer    data);
 
-void   image_convert_base_type_cmd_callback        (GimpAction *action,
-                                                    GVariant   *value,
-                                                    gpointer    data);
-void   image_convert_precision_cmd_callback        (GimpAction *action,
-                                                    GVariant   *value,
-                                                    gpointer    data);
-void   image_convert_trc_cmd_callback              (GimpAction *action,
-                                                    GVariant   *value,
-                                                    gpointer    data);
+void   image_convert_base_type_cmd_callback          (GimpAction *action,
+                                                      GVariant   *value,
+                                                      gpointer    data);
+void   image_convert_precision_cmd_callback          (GimpAction *action,
+                                                      GVariant   *value,
+                                                      gpointer    data);
+void   image_convert_trc_cmd_callback                (GimpAction *action,
+                                                      GVariant   *value,
+                                                      gpointer    data);
 
-void   image_color_profile_use_srgb_cmd_callback   (GimpAction *action,
-                                                    GVariant   *value,
-                                                    gpointer    data);
-void   image_color_profile_assign_cmd_callback     (GimpAction *action,
-                                                    GVariant   *value,
-                                                    gpointer    data);
-void   image_color_profile_convert_cmd_callback    (GimpAction *action,
-                                                    GVariant   *value,
-                                                    gpointer    data);
-void   image_color_profile_discard_cmd_callback    (GimpAction *action,
-                                                    GVariant   *value,
-                                                    gpointer    data);
-void   image_color_profile_save_cmd_callback       (GimpAction *action,
-                                                    GVariant   *value,
-                                                    gpointer    data);
+void   image_color_profile_use_srgb_cmd_callback     (GimpAction *action,
+                                                      GVariant   *value,
+                                                      gpointer    data);
+void   image_color_profile_assign_cmd_callback       (GimpAction *action,
+                                                      GVariant   *value,
+                                                      gpointer    data);
+void   image_color_profile_convert_cmd_callback      (GimpAction *action,
+                                                      GVariant   *value,
+                                                      gpointer    data);
+void   image_color_profile_discard_cmd_callback      (GimpAction *action,
+                                                      GVariant   *value,
+                                                      gpointer    data);
+void   image_color_profile_save_cmd_callback         (GimpAction *action,
+                                                      GVariant   *value,
+                                                      gpointer    data);
 
-void   image_resize_cmd_callback                   (GimpAction *action,
-                                                    GVariant   *value,
-                                                    gpointer    data);
-void   image_resize_to_layers_cmd_callback         (GimpAction *action,
-                                                    GVariant   *value,
-                                                    gpointer    data);
-void   image_resize_to_selection_cmd_callback      (GimpAction *action,
-                                                    GVariant   *value,
-                                                    gpointer    data);
-void   image_print_size_cmd_callback               (GimpAction *action,
-                                                    GVariant   *value,
-                                                    gpointer    data);
-void   image_scale_cmd_callback                    (GimpAction *action,
-                                                    GVariant   *value,
-                                                    gpointer    data);
-void   image_flip_cmd_callback                     (GimpAction *action,
-                                                    GVariant   *value,
-                                                    gpointer    data);
-void   image_rotate_cmd_callback                   (GimpAction *action,
-                                                    GVariant   *value,
-                                                    gpointer    data);
-void   image_crop_to_selection_cmd_callback        (GimpAction *action,
-                                                    GVariant   *value,
-                                                    gpointer    data);
-void   image_crop_to_content_cmd_callback          (GimpAction *action,
-                                                    GVariant   *value,
-                                                    gpointer    data);
+void   image_resize_cmd_callback                     (GimpAction *action,
+                                                      GVariant   *value,
+                                                      gpointer    data);
+void   image_resize_to_layers_cmd_callback           (GimpAction *action,
+                                                      GVariant   *value,
+                                                      gpointer    data);
+void   image_resize_to_selection_cmd_callback        (GimpAction *action,
+                                                      GVariant   *value,
+                                                      gpointer    data);
+void   image_print_size_cmd_callback                 (GimpAction *action,
+                                                      GVariant   *value,
+                                                      gpointer    data);
+void   image_scale_cmd_callback                      (GimpAction *action,
+                                                      GVariant   *value,
+                                                      gpointer    data);
+void   image_flip_cmd_callback                       (GimpAction *action,
+                                                      GVariant   *value,
+                                                      gpointer    data);
+void   image_rotate_cmd_callback                     (GimpAction *action,
+                                                      GVariant   *value,
+                                                      gpointer    data);
+void   image_crop_to_selection_cmd_callback          (GimpAction *action,
+                                                      GVariant   *value,
+                                                      gpointer    data);
+void   image_crop_to_content_cmd_callback            (GimpAction *action,
+                                                      GVariant   *value,
+                                                      gpointer    data);
 
-void   image_merge_layers_cmd_callback             (GimpAction *action,
-                                                    GVariant   *value,
-                                                    gpointer    data);
-void   image_merge_layers_last_vals_cmd_callback   (GimpAction *action,
-                                                    GVariant   *value,
-                                                    gpointer    data);
-void   image_flatten_image_cmd_callback            (GimpAction *action,
-                                                    GVariant   *value,
-                                                    gpointer    data);
+void   image_merge_layers_cmd_callback               (GimpAction *action,
+                                                      GVariant   *value,
+                                                      gpointer    data);
+void   image_merge_layers_last_vals_cmd_callback     (GimpAction *action,
+                                                      GVariant   *value,
+                                                      gpointer    data);
+void   image_flatten_image_cmd_callback              (GimpAction *action,
+                                                      GVariant   *value,
+                                                      gpointer    data);
 
-void   image_configure_grid_cmd_callback           (GimpAction *action,
-                                                    GVariant   *value,
-                                                    gpointer    data);
-void   image_properties_cmd_callback               (GimpAction *action,
-                                                    GVariant   *value,
-                                                    gpointer    data);
+void   image_configure_grid_cmd_callback             (GimpAction *action,
+                                                      GVariant   *value,
+                                                      gpointer    data);
+void   image_properties_cmd_callback                 (GimpAction *action,
+                                                      GVariant   *value,
+                                                      gpointer    data);
+
+void   image_color_management_softproof_cmd_callback (GimpAction *action,
+                                                      GVariant   *value,
+                                                      gpointer    data);
+void   image_softproof_profile_cmd_callback          (GimpAction *action,
+                                                      GVariant   *value,
+                                                      gpointer    data);
+void   image_softproof_intent_cmd_callback           (GimpAction *action,
+                                                      GVariant   *value,
+                                                      gpointer    data);
+void   image_softproof_bpc_cmd_callback              (GimpAction *action,
+                                                      GVariant   *value,
+                                                      gpointer    data);
+void   image_softproof_gamut_check_cmd_callback      (GimpAction *action,
+                                                      GVariant   *value,
+                                                      gpointer    data);
 
 
 #endif /* __IMAGE_COMMANDS_H__ */
diff --git a/app/actions/view-actions.c b/app/actions/view-actions.c
index 3943eec056..6d2c46e6eb 100644
--- a/app/actions/view-actions.c
+++ b/app/actions/view-actions.c
@@ -77,9 +77,6 @@ static const GimpActionEntry view_actions[] =
   { "view-display-intent-menu", NULL,
     NC_("view-action", "Display _Rendering Intent") },
 
-  { "view-softproof-intent-menu", NULL,
-    NC_("view-action", "Soft-Proofing Re_ndering Intent") },
-
   { "view-move-to-screen-menu", GIMP_ICON_WINDOW_MOVE_TO_SCREEN,
     NC_("view-action", "Move to Screen"), NULL, NULL, NULL,
     GIMP_HELP_VIEW_CHANGE_SCREEN },
@@ -165,12 +162,6 @@ static const GimpActionEntry view_actions[] =
     view_color_management_reset_cmd_callback,
     GIMP_HELP_VIEW_COLOR_MANAGEMENT },
 
-  { "view-softproof-profile", NULL,
-    NC_("view-action", "Soft-_Proofing Profile..."), NULL,
-    NC_("view-action", "Set the soft-proofing profile"),
-    view_softproof_profile_cmd_callback,
-    GIMP_HELP_VIEW_COLOR_MANAGEMENT },
-
   { "view-shrink-wrap", GIMP_ICON_ZOOM_FIT_BEST,
     NC_("view-action", "Shrink _Wrap"), "<primary>J",
     NC_("view-action", "Reduce the image window to the size of the image display"),
@@ -208,13 +199,6 @@ static const GimpToggleActionEntry view_toggle_actions[] =
     TRUE,
     GIMP_HELP_VIEW_COLOR_MANAGEMENT },
 
-  { "view-color-management-softproof", NULL,
-    NC_("view-action", "_Proof Colors"), NULL,
-    NC_("view-action", "Use this view for soft-proofing"),
-    view_color_management_softproof_cmd_callback,
-    FALSE,
-    GIMP_HELP_VIEW_COLOR_MANAGEMENT },
-
   { "view-display-black-point-compensation", NULL,
     NC_("view-action", "_Black Point Compensation"), NULL,
     NC_("view-action", "Use black point compensation for image display"),
@@ -222,21 +206,6 @@ static const GimpToggleActionEntry view_toggle_actions[] =
     TRUE,
     GIMP_HELP_VIEW_COLOR_MANAGEMENT },
 
-  { "view-softproof-black-point-compensation", NULL,
-    NC_("view-action", "_Black Point Compensation"), NULL,
-    NC_("view-action", "Use black point compensation for soft-proofing"),
-    view_softproof_bpc_cmd_callback,
-    TRUE,
-    GIMP_HELP_VIEW_COLOR_MANAGEMENT },
-
-  { "view-softproof-gamut-check", NULL,
-    NC_("view-action", "_Mark Out Of Gamut Colors"), NULL,
-    NC_("view-action", "When soft-proofing, mark colors which cannot "
-        "be represented in the target color space"),
-    view_softproof_gamut_check_cmd_callback,
-    FALSE,
-    GIMP_HELP_VIEW_COLOR_MANAGEMENT },
-
   { "view-show-selection", NULL,
     NC_("view-action", "Show _Selection"), "<primary>T",
     NC_("view-action", "Display the selection outline"),
@@ -580,33 +549,6 @@ static const GimpRadioActionEntry view_display_intent_actions[] =
     GIMP_HELP_VIEW_COLOR_MANAGEMENT }
 };
 
-static const GimpRadioActionEntry view_softproof_intent_actions[] =
-{
-  { "view-softproof-intent-perceptual", NULL,
-    NC_("view-action", "_Perceptual"), NULL,
-    NC_("view-action", "Soft-proofing rendering intent is perceptual"),
-    GIMP_COLOR_RENDERING_INTENT_PERCEPTUAL,
-    GIMP_HELP_VIEW_COLOR_MANAGEMENT },
-
-  { "view-softproof-intent-relative-colorimetric", NULL,
-    NC_("view-action", "_Relative Colorimetric"), NULL,
-    NC_("view-action", "Soft-proofing rendering intent is relative colorimetric"),
-    GIMP_COLOR_RENDERING_INTENT_RELATIVE_COLORIMETRIC,
-    GIMP_HELP_VIEW_COLOR_MANAGEMENT },
-
-  { "view-softproof-intent-saturation", NULL,
-    NC_("view-action", "_Saturation"), NULL,
-    NC_("view-action", "Soft-proofing rendering intent is saturation"),
-    GIMP_COLOR_RENDERING_INTENT_SATURATION,
-    GIMP_HELP_VIEW_COLOR_MANAGEMENT },
-
-  { "view-softproof-intent-absolute-colorimetric", NULL,
-    NC_("view-action", "_Absolute Colorimetric"), NULL,
-    NC_("view-action", "Soft-proofing rendering intent is absolute colorimetric"),
-    GIMP_COLOR_RENDERING_INTENT_ABSOLUTE_COLORIMETRIC,
-    GIMP_HELP_VIEW_COLOR_MANAGEMENT }
-};
-
 static const GimpEnumActionEntry view_padding_color_actions[] =
 {
   { "view-padding-color-theme", NULL,
@@ -775,13 +717,6 @@ view_actions_setup (GimpActionGroup *group)
                                        GIMP_COLOR_MANAGEMENT_DISPLAY,
                                        view_display_intent_cmd_callback);
 
-  gimp_action_group_add_radio_actions (group, "view-action",
-                                       view_softproof_intent_actions,
-                                       G_N_ELEMENTS (view_softproof_intent_actions),
-                                       NULL,
-                                       GIMP_COLOR_MANAGEMENT_DISPLAY,
-                                       view_softproof_intent_cmd_callback);
-
   gimp_action_group_add_enum_actions (group, "view-padding-color",
                                       view_padding_color_actions,
                                       G_N_ELEMENTS (view_padding_color_actions),
@@ -813,12 +748,6 @@ view_actions_setup (GimpActionGroup *group)
   g_signal_connect_object (group->gimp->config, "notify::check-type",
                            G_CALLBACK (view_actions_check_type_notify),
                            group, 0);
-  g_signal_connect_object (group->gimp->config, "notify::check-custom-color1",
-                           G_CALLBACK (view_actions_check_type_notify),
-                           group, 0);
-  g_signal_connect_object (group->gimp->config, "notify::check-custom-color2",
-                           G_CALLBACK (view_actions_check_type_notify),
-                           group, 0);
   view_actions_check_type_notify (GIMP_DISPLAY_CONFIG (group->gimp->config),
                                   NULL, group);
 
@@ -849,9 +778,7 @@ view_actions_update (GimpActionGroup *group,
   gboolean            flip_horizontally = FALSE;
   gboolean            flip_vertically   = FALSE;
   gboolean            cm                = FALSE;
-  gboolean            sp                = FALSE;
   gboolean            d_bpc             = FALSE;
-  gboolean            s_bpc             = FALSE;
   gboolean            gammut            = FALSE;
 
   if (display)
@@ -883,12 +810,8 @@ view_actions_update (GimpActionGroup *group,
           break;
 
         case GIMP_COLOR_MANAGEMENT_DISPLAY:
-          cm = (image != NULL);
-          break;
-
         case GIMP_COLOR_MANAGEMENT_SOFTPROOF:
           cm = (image != NULL);
-          sp = (image != NULL);
           break;
         }
 
@@ -913,30 +836,7 @@ view_actions_update (GimpActionGroup *group,
 
       gimp_action_group_set_action_active (group, action, TRUE);
 
-      switch (gimp_color_config_get_simulation_intent (color_config))
-        {
-        case GIMP_COLOR_RENDERING_INTENT_PERCEPTUAL:
-          action = "view-softproof-intent-perceptual";
-          break;
-
-        case GIMP_COLOR_RENDERING_INTENT_RELATIVE_COLORIMETRIC:
-          action = "view-softproof-intent-relative-colorimetric";
-          break;
-
-        case GIMP_COLOR_RENDERING_INTENT_SATURATION:
-          action = "view-softproof-intent-saturation";
-          break;
-
-        case GIMP_COLOR_RENDERING_INTENT_ABSOLUTE_COLORIMETRIC:
-          action = "view-softproof-intent-absolute-colorimetric";
-          break;
-        }
-
-      gimp_action_group_set_action_active (group, action, TRUE);
-
       d_bpc  = gimp_color_config_get_display_bpc (color_config);
-      s_bpc  = gimp_color_config_get_simulation_bpc (color_config);
-      gammut = gimp_color_config_get_simulation_gamut_check (color_config);
     }
 
 #define SET_ACTIVE(action,condition) \
@@ -1030,23 +930,12 @@ view_actions_update (GimpActionGroup *group,
 
   SET_SENSITIVE ("view-color-management-enable",                image);
   SET_ACTIVE    ("view-color-management-enable",                cm);
-  SET_SENSITIVE ("view-color-management-softproof",             image);
-  SET_ACTIVE    ("view-color-management-softproof",             sp);
   SET_SENSITIVE ("view-display-intent-perceptual",              cm);
   SET_SENSITIVE ("view-display-intent-relative-colorimetric",   cm);
   SET_SENSITIVE ("view-display-intent-saturation",              cm);
   SET_SENSITIVE ("view-display-intent-absolute-colorimetric",   cm);
   SET_SENSITIVE ("view-display-black-point-compensation",       cm);
   SET_ACTIVE    ("view-display-black-point-compensation",       d_bpc);
-  SET_SENSITIVE ("view-softproof-profile",                      sp);
-  SET_SENSITIVE ("view-softproof-intent-perceptual",            sp);
-  SET_SENSITIVE ("view-softproof-intent-relative-colorimetric", sp);
-  SET_SENSITIVE ("view-softproof-intent-saturation",            sp);
-  SET_SENSITIVE ("view-softproof-intent-absolute-colorimetric", sp);
-  SET_SENSITIVE ("view-softproof-black-point-compensation",     sp);
-  SET_ACTIVE    ("view-softproof-black-point-compensation",     s_bpc);
-  SET_SENSITIVE ("view-softproof-gamut-check",                  sp);
-  SET_ACTIVE    ("view-softproof-gamut-check",                  gammut);
   SET_SENSITIVE ("view-color-management-reset",                 image);
 
   SET_SENSITIVE ("view-show-selection",       image);
diff --git a/app/actions/view-commands.c b/app/actions/view-commands.c
index 0f6fdc0b7e..7d97228054 100644
--- a/app/actions/view-commands.c
+++ b/app/actions/view-commands.c
@@ -76,13 +76,6 @@
 
 /*  local function prototypes  */
 
-static void   view_softproof_profile_callback  (GtkWidget                *dialog,
-                                                GimpImage                *image,
-                                                GimpColorProfile         *new_profile,
-                                                GFile                    *new_file,
-                                                GimpColorRenderingIntent  intent,
-                                                gboolean                  bpc,
-                                                gpointer                  user_data);
 static void   view_padding_color_dialog_update (GimpColorDialog          *dialog,
                                                 const GimpRGB            *color,
                                                 GimpColorDialogState      state,
@@ -655,42 +648,6 @@ view_color_management_enable_cmd_callback (GimpAction *action,
     }
 }
 
-void
-view_color_management_softproof_cmd_callback (GimpAction *action,
-                                              GVariant   *value,
-                                              gpointer    data)
-{
-  GimpDisplayShell        *shell;
-  GimpColorConfig         *color_config;
-  GimpColorManagementMode  mode;
-  gboolean                 active;
-  return_if_no_shell (shell, data);
-
-  color_config = gimp_display_shell_get_color_config (shell);
-
-  active = g_variant_get_boolean (value);
-
-  mode = gimp_color_config_get_mode (color_config);
-
-  if (active)
-    {
-      mode = GIMP_COLOR_MANAGEMENT_SOFTPROOF;
-    }
-  else
-    {
-      if (mode != GIMP_COLOR_MANAGEMENT_OFF)
-        mode = GIMP_COLOR_MANAGEMENT_DISPLAY;
-    }
-
-  if (mode != gimp_color_config_get_mode (color_config))
-    {
-      g_object_set (color_config,
-                    "mode", mode,
-                    NULL);
-      shell->color_config_set = TRUE;
-    }
-}
-
 void
 view_display_intent_cmd_callback (GimpAction *action,
                                   GVariant   *value,
@@ -737,117 +694,6 @@ view_display_bpc_cmd_callback (GimpAction *action,
     }
 }
 
-void
-view_softproof_profile_cmd_callback (GimpAction *action,
-                                     GVariant   *value,
-                                     gpointer    data)
-{
-  GimpImage        *image;
-  GimpDisplayShell *shell;
-  GimpColorConfig  *color_config;
-  GtkWidget        *dialog;
-  return_if_no_image (image, data);
-  return_if_no_shell (shell, data);
-
-  color_config = gimp_display_shell_get_color_config (shell);
-
-#define SOFTPROOF_PROFILE_DIALOG_KEY "gimp-softproof-profile-dialog"
-
-  dialog = dialogs_get_dialog (G_OBJECT (shell), SOFTPROOF_PROFILE_DIALOG_KEY);
-
-  if (! dialog)
-    {
-      GimpColorProfile *current_profile;
-
-      current_profile = gimp_color_config_get_simulation_color_profile (color_config,
-                                                                        NULL);
-
-      dialog = color_profile_dialog_new (COLOR_PROFILE_DIALOG_SELECT_SOFTPROOF_PROFILE,
-                                         image,
-                                         action_data_get_context (data),
-                                         GTK_WIDGET (shell),
-                                         current_profile,
-                                         NULL,
-                                         0, 0,
-                                         view_softproof_profile_callback,
-                                         shell);
-
-      dialogs_attach_dialog (G_OBJECT (shell),
-                             SOFTPROOF_PROFILE_DIALOG_KEY, dialog);
-    }
-
-  gtk_window_present (GTK_WINDOW (dialog));
-}
-
-void
-view_softproof_intent_cmd_callback (GimpAction *action,
-                                    GVariant   *value,
-                                    gpointer    data)
-{
-  GimpDisplayShell          *shell;
-  GimpColorConfig           *color_config;
-  GimpColorRenderingIntent   intent;
-  return_if_no_shell (shell, data);
-
-  intent = (GimpColorRenderingIntent) g_variant_get_int32 (value);
-
-  color_config = gimp_display_shell_get_color_config (shell);
-
-  if (intent != gimp_color_config_get_simulation_intent (color_config))
-    {
-      g_object_set (color_config,
-                    "simulation-rendering-intent", intent,
-                    NULL);
-      shell->color_config_set = TRUE;
-    }
-}
-
-void
-view_softproof_bpc_cmd_callback (GimpAction *action,
-                                 GVariant   *value,
-                                 gpointer    data)
-{
-  GimpDisplayShell *shell;
-  GimpColorConfig  *color_config;
-  gboolean          active;
-  return_if_no_shell (shell, data);
-
-  color_config = gimp_display_shell_get_color_config (shell);
-
-  active = g_variant_get_boolean (value);
-
-  if (active != gimp_color_config_get_simulation_bpc (color_config))
-    {
-      g_object_set (color_config,
-                    "simulation-use-black-point-compensation", active,
-                    NULL);
-      shell->color_config_set = TRUE;
-    }
-}
-
-void
-view_softproof_gamut_check_cmd_callback (GimpAction *action,
-                                         GVariant   *value,
-                                         gpointer    data)
-{
-  GimpDisplayShell *shell;
-  GimpColorConfig  *color_config;
-  gboolean          active;
-  return_if_no_shell (shell, data);
-
-  color_config = gimp_display_shell_get_color_config (shell);
-
-  active = g_variant_get_boolean (value);
-
-  if (active != gimp_color_config_get_simulation_gamut_check (color_config))
-    {
-      g_object_set (color_config,
-                    "simulation-gamut-check", active,
-                    NULL);
-      shell->color_config_set = TRUE;
-    }
-}
-
 void
 view_toggle_selection_cmd_callback (GimpAction *action,
                                     GVariant   *value,
@@ -1247,32 +1093,6 @@ view_fullscreen_cmd_callback (GimpAction *action,
 
 /*  private functions  */
 
-static void
-view_softproof_profile_callback (GtkWidget                *dialog,
-                                 GimpImage                *image,
-                                 GimpColorProfile         *new_profile,
-                                 GFile                    *new_file,
-                                 GimpColorRenderingIntent  intent,
-                                 gboolean                  bpc,
-                                 gpointer                  user_data)
-{
-  GimpDisplayShell *shell = user_data;
-  GimpColorConfig  *color_config;
-  gchar            *path  = NULL;
-
-  color_config = gimp_display_shell_get_color_config (shell);
-
-  if (new_file)
-    path = g_file_get_path (new_file);
-
-  g_object_set (color_config,
-                "simulation-profile", path,
-                NULL);
-  shell->color_config_set = TRUE;
-
-  gtk_widget_destroy (dialog);
-}
-
 static void
 view_padding_color_dialog_update (GimpColorDialog      *dialog,
                                   const GimpRGB        *color,
diff --git a/app/actions/view-commands.h b/app/actions/view-commands.h
index b1c8d36679..244b35cd0d 100644
--- a/app/actions/view-commands.h
+++ b/app/actions/view-commands.h
@@ -114,19 +114,6 @@ void   view_display_intent_cmd_callback             (GimpAction *action,
 void   view_display_bpc_cmd_callback                (GimpAction *action,
                                                      GVariant   *value,
                                                      gpointer    data);
-void   view_softproof_profile_cmd_callback          (GimpAction *action,
-                                                     GVariant   *value,
-                                                     gpointer    data);
-void   view_softproof_intent_cmd_callback           (GimpAction *action,
-                                                     GVariant   *value,
-                                                     gpointer    data);
-void   view_softproof_bpc_cmd_callback              (GimpAction *action,
-                                                     GVariant   *value,
-                                                     gpointer    data);
-void   view_softproof_gamut_check_cmd_callback      (GimpAction *action,
-                                                     GVariant   *value,
-                                                     gpointer    data);
-
 void   view_toggle_selection_cmd_callback           (GimpAction *action,
                                                      GVariant   *value,
                                                      gpointer    data);
diff --git a/app/core/gimpimage.c b/app/core/gimpimage.c
index a249e3dc4d..7195f37782 100644
--- a/app/core/gimpimage.c
+++ b/app/core/gimpimage.c
@@ -198,6 +198,11 @@ static GimpColorProfile *
 static void
         gimp_image_color_managed_profile_changed (GimpColorManaged  *managed);
 
+static GimpColorProfile *
+      gimp_image_color_managed_get_simulation_profile     (GimpColorManaged  *managed);
+static void
+      gimp_image_color_managed_simulation_profile_changed (GimpColorManaged  *managed);
+
 static void        gimp_image_projectable_flush  (GimpProjectable   *projectable,
                                                   gboolean           invalidate_preview);
 static GeglRectangle gimp_image_get_bounding_box (GimpProjectable   *projectable);
@@ -697,9 +702,11 @@ gimp_image_class_init (GimpImageClass *klass)
 static void
 gimp_color_managed_iface_init (GimpColorManagedInterface *iface)
 {
-  iface->get_icc_profile   = gimp_image_color_managed_get_icc_profile;
-  iface->get_color_profile = gimp_image_color_managed_get_color_profile;
-  iface->profile_changed   = gimp_image_color_managed_profile_changed;
+  iface->get_icc_profile            = gimp_image_color_managed_get_icc_profile;
+  iface->get_color_profile          = gimp_image_color_managed_get_color_profile;
+  iface->profile_changed            = gimp_image_color_managed_profile_changed;
+  iface->get_simulation_profile     = gimp_image_color_managed_get_simulation_profile;
+  iface->simulation_profile_changed = gimp_image_color_managed_simulation_profile_changed;
 }
 
 static void
@@ -1438,6 +1445,25 @@ gimp_image_color_managed_profile_changed (GimpColorManaged *managed)
   gimp_item_stack_profile_changed (layers);
 }
 
+static GimpColorProfile *
+gimp_image_color_managed_get_simulation_profile (GimpColorManaged *managed)
+{
+  GimpImage        *image = GIMP_IMAGE (managed);
+  GimpColorProfile *profile;
+
+  profile = gimp_image_get_simulation_profile (image);
+
+  return profile;
+}
+
+static void
+gimp_image_color_managed_simulation_profile_changed (GimpColorManaged *managed)
+{
+  GimpImage     *image  = GIMP_IMAGE (managed);
+
+  gimp_viewable_invalidate_preview (GIMP_VIEWABLE (image));
+}
+
 static void
 gimp_image_projectable_flush (GimpProjectable *projectable,
                               gboolean         invalidate_preview)
diff --git a/app/display/gimpdisplayshell-profile.c b/app/display/gimpdisplayshell-profile.c
index df6c4b144b..a266387efa 100644
--- a/app/display/gimpdisplayshell-profile.c
+++ b/app/display/gimpdisplayshell-profile.c
@@ -261,8 +261,7 @@ gimp_display_shell_color_config_notify (GimpColorConfig  *config,
           break;
         }
 
-      SET_ACTIVE ("view-color-management-enable",    managed);
-      SET_ACTIVE ("view-color-management-softproof", softproof);
+      SET_ACTIVE ("view-color-management-enable", managed);
 
       switch (gimp_color_config_get_display_intent (config))
         {
@@ -293,42 +292,6 @@ gimp_display_shell_color_config_notify (GimpColorConfig  *config,
       SET_SENSITIVE ("view-display-black-point-compensation", managed);
       SET_ACTIVE    ("view-display-black-point-compensation",
                      gimp_color_config_get_display_bpc (config));
-
-      SET_SENSITIVE ("view-softproof-profile", softproof);
-
-      switch (gimp_color_config_get_simulation_intent (config))
-        {
-        case GIMP_COLOR_RENDERING_INTENT_PERCEPTUAL:
-          action = "view-softproof-intent-perceptual";
-          break;
-
-        case GIMP_COLOR_RENDERING_INTENT_RELATIVE_COLORIMETRIC:
-          action = "view-softproof-intent-relative-colorimetric";
-          break;
-
-        case GIMP_COLOR_RENDERING_INTENT_SATURATION:
-          action = "view-softproof-intent-saturation";
-          break;
-
-        case GIMP_COLOR_RENDERING_INTENT_ABSOLUTE_COLORIMETRIC:
-          action = "view-softproof-intent-absolute-colorimetric";
-          break;
-        }
-
-      SET_SENSITIVE ("view-softproof-intent-perceptual",            softproof);
-      SET_SENSITIVE ("view-softproof-intent-relative-colorimetric", softproof);
-      SET_SENSITIVE ("view-softproof-intent-saturation",            softproof);
-      SET_SENSITIVE ("view-softproof-intent-absolute-colorimetric", softproof);
-
-      SET_ACTIVE (action, TRUE);
-
-      SET_SENSITIVE ("view-softproof-black-point-compensation", softproof);
-      SET_ACTIVE    ("view-softproof-black-point-compensation",
-                     gimp_color_config_get_simulation_bpc (config));
-
-      SET_SENSITIVE ("view-softproof-gamut-check", softproof);
-      SET_ACTIVE    ("view-softproof-gamut-check",
-                     gimp_color_config_get_simulation_gamut_check (config));
     }
 
   gimp_color_managed_profile_changed (GIMP_COLOR_MANAGED (shell));
diff --git a/libgimpcolor/gimpcolor.def b/libgimpcolor/gimpcolor.def
index 47dbb99c57..467bc531bd 100644
--- a/libgimpcolor/gimpcolor.def
+++ b/libgimpcolor/gimpcolor.def
@@ -23,6 +23,8 @@ EXPORTS
        gimp_color_managed_get_icc_profile
        gimp_color_managed_get_type
        gimp_color_managed_profile_changed
+       gimp_color_managed_get_simulation_profile
+       gimp_color_managed_simulation_profile_changed
        gimp_color_profile_get_copyright
        gimp_color_profile_get_description
        gimp_color_profile_get_format
diff --git a/libgimpcolor/gimpcolormanaged.c b/libgimpcolor/gimpcolormanaged.c
index dca1fdbae8..b947cd11d7 100644
--- a/libgimpcolor/gimpcolormanaged.c
+++ b/libgimpcolor/gimpcolormanaged.c
@@ -42,6 +42,7 @@
 enum
 {
   PROFILE_CHANGED,
+  SIMULATION_PROFILE_CHANGED,
   LAST_SIGNAL
 };
 
@@ -66,6 +67,15 @@ gimp_color_managed_default_init (GimpColorManagedInterface *iface)
                                    profile_changed),
                   NULL, NULL, NULL,
                   G_TYPE_NONE, 0);
+
+  gimp_color_managed_signals[SIMULATION_PROFILE_CHANGED] =
+    g_signal_new ("simulation-profile-changed",
+                  G_TYPE_FROM_INTERFACE (iface),
+                  G_SIGNAL_RUN_FIRST,
+                  G_STRUCT_OFFSET (GimpColorManagedInterface,
+                                   simulation_profile_changed),
+                  NULL, NULL, NULL,
+                  G_TYPE_NONE, 0);
 }
 
 
@@ -128,9 +138,34 @@ gimp_color_managed_get_color_profile (GimpColorManaged *managed)
 }
 
 /**
- * gimp_color_managed_profile_changed:
+ * gimp_color_managed_get_simulation_profile:
  * @managed: an object the implements the #GimpColorManaged interface
  *
+ * This function always returns a #GimpColorProfile
+ *
+ * Returns: (transfer full): The @managed's simulation #GimpColorProfile.
+ *
+ * Since: 2.10
+ **/
+GimpColorProfile *
+gimp_color_managed_get_simulation_profile (GimpColorManaged *managed)
+{
+  GimpColorManagedInterface *iface;
+
+  g_return_val_if_fail (GIMP_IS_COLOR_MANAGED (managed), NULL);
+
+  iface = GIMP_COLOR_MANAGED_GET_IFACE (managed);
+
+  if (iface->get_simulation_profile)
+    return iface->get_simulation_profile (managed);
+
+  return NULL;
+}
+
+/**
+ * gimp_color_managed_profile_changed:
+ * @managed: an object that implements the #GimpColorManaged interface
+ *
  * Emits the "profile-changed" signal.
  *
  * Since: 2.4
@@ -142,3 +177,19 @@ gimp_color_managed_profile_changed (GimpColorManaged *managed)
 
   g_signal_emit (managed, gimp_color_managed_signals[PROFILE_CHANGED], 0);
 }
+
+/**
+ * gimp_color_managed_simulation_profile_changed:
+ * @managed: an object that implements the #GimpColorManaged interface
+ *
+ * Emits the "simulation-profile-changed" signal.
+ *
+ * Since: 3.0
+ **/
+void
+gimp_color_managed_simulation_profile_changed (GimpColorManaged *managed)
+{
+  g_return_if_fail (GIMP_IS_COLOR_MANAGED (managed));
+
+  g_signal_emit (managed, gimp_color_managed_signals[SIMULATION_PROFILE_CHANGED], 0);
+}
diff --git a/libgimpcolor/gimpcolormanaged.h b/libgimpcolor/gimpcolormanaged.h
index b6a473b509..cf36ffad7c 100644
--- a/libgimpcolor/gimpcolormanaged.h
+++ b/libgimpcolor/gimpcolormanaged.h
@@ -43,6 +43,8 @@ G_DECLARE_INTERFACE (GimpColorManaged, gimp_color_managed, GIMP, COLOR_MANAGED,
  *                   has changed
  * @get_color_profile: Returns the #GimpColorProfile of the pixels managed
  *                     by the object
+ * @get_simulation_profile: Returns the simulation #GimpColorProfile of the
+ *                          pixels managed by the object
  **/
 struct _GimpColorManagedInterface
 {
@@ -58,22 +60,29 @@ struct _GimpColorManagedInterface
    *
    * Since: 2.4
    */
-  const guint8     * (* get_icc_profile)   (GimpColorManaged *managed,
-                                            gsize            *len);
+  const guint8     * (* get_icc_profile)            (GimpColorManaged *managed,
+                                                     gsize            *len);
 
   /*  signals  */
-  void               (* profile_changed)   (GimpColorManaged *managed);
+  void               (* profile_changed)            (GimpColorManaged *managed);
+
+  void               (* simulation_profile_changed) (GimpColorManaged *managed);
 
   /*  virtual functions  */
-  GimpColorProfile * (* get_color_profile) (GimpColorManaged *managed);
+  GimpColorProfile * (* get_color_profile)      (GimpColorManaged *managed);
+  GimpColorProfile * (* get_simulation_profile) (GimpColorManaged *managed);
 };
 
 
-const guint8     * gimp_color_managed_get_icc_profile   (GimpColorManaged *managed,
-                                                         gsize            *len);
-GimpColorProfile * gimp_color_managed_get_color_profile (GimpColorManaged *managed);
+const guint8     * gimp_color_managed_get_icc_profile            (GimpColorManaged *managed,
+                                                                  gsize            *len);
+GimpColorProfile * gimp_color_managed_get_color_profile          (GimpColorManaged *managed);
+
+GimpColorProfile * gimp_color_managed_get_simulation_profile     (GimpColorManaged *managed);
+
+void               gimp_color_managed_profile_changed            (GimpColorManaged *managed);
 
-void               gimp_color_managed_profile_changed   (GimpColorManaged *managed);
+void               gimp_color_managed_simulation_profile_changed (GimpColorManaged *managed);
 
 
 G_END_DECLS
diff --git a/menus/image-menu.xml.in b/menus/image-menu.xml.in
index f9b7b5c262..b6b712921a 100644
--- a/menus/image-menu.xml.in
+++ b/menus/image-menu.xml.in
@@ -310,7 +310,6 @@
       <menuitem action="view-display-filters" />
       <menu action="view-color-management-menu" name="Color Management">
         <menuitem action="view-color-management-enable" />
-        <menuitem action="view-color-management-softproof" />
         <separator />
        <menu action="view-display-intent-menu" name="Display Rendering Intent">
           <menuitem action="view-display-intent-perceptual" />
@@ -320,16 +319,6 @@
        </menu>
         <menuitem action="view-display-black-point-compensation" />
         <separator />
-        <menuitem action="view-softproof-profile" />
-       <menu action="view-softproof-intent-menu" name="Softproof Rendering Intent">
-          <menuitem action="view-softproof-intent-perceptual" />
-          <menuitem action="view-softproof-intent-relative-colorimetric" />
-          <menuitem action="view-softproof-intent-saturation" />
-          <menuitem action="view-softproof-intent-absolute-colorimetric" />
-       </menu>
-        <menuitem action="view-softproof-black-point-compensation" />
-        <menuitem action="view-softproof-gamut-check" />
-        <separator />
         <menuitem action="view-color-management-reset" />
       </menu>
       <separator />
@@ -394,6 +383,20 @@
         <menuitem action="image-color-profile-discard" />
         <separator />
         <menuitem action="image-color-profile-save" />
+        <separator />
+        <menuitem action="image-color-management-softproof" />
+        <separator/>
+        <menuitem action="image-softproof-profile" />
+        <separator />
+    <menu action="image-softproof-intent-menu" name="Softproof Rendering Intent">
+          <menuitem action="image-softproof-intent-perceptual" />
+          <menuitem action="image-softproof-intent-relative-colorimetric" />
+          <menuitem action="image-softproof-intent-saturation" />
+          <menuitem action="image-softproof-intent-absolute-colorimetric" />
+       </menu>
+        <menuitem action="image-softproof-black-point-compensation" />
+        <menuitem action="image-softproof-gamut-check" />
+     <separator />
      </menu>
       <separator />
       <menu action="image-transform-menu" name="Transform">


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]