[gimp] app: add GimpCoreConfig::default-new-layer-mode



commit a256cf3338344821b49ab724489346b2e6da4092
Author: Michael Natterer <mitch gimp org>
Date:   Sat Aug 19 21:48:45 2017 +0200

    app: add GimpCoreConfig::default-new-layer-mode
    
    which for now has no UI and still defaults to NORMAL_LEGACY.

 app/config/gimpcoreconfig.c |   15 +++++++++++++++
 app/config/gimpcoreconfig.h |    1 +
 app/config/gimprc-blurbs.h  |    3 +++
 3 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/app/config/gimpcoreconfig.c b/app/config/gimpcoreconfig.c
index 31dec43..288a323 100644
--- a/app/config/gimpcoreconfig.c
+++ b/app/config/gimpcoreconfig.c
@@ -58,6 +58,7 @@ enum
   PROP_LANGUAGE,
   PROP_INTERPOLATION_TYPE,
   PROP_DEFAULT_THRESHOLD,
+  PROP_DEFAULT_NEW_LAYER_MODE,
   PROP_PLUG_IN_PATH,
   PROP_MODULE_PATH,
   PROP_INTERPRETER_PATH,
@@ -181,6 +182,14 @@ gimp_core_config_class_init (GimpCoreConfigClass *klass)
                         0, 255, 15,
                         GIMP_PARAM_STATIC_STRINGS);
 
+  GIMP_CONFIG_PROP_ENUM (object_class, PROP_DEFAULT_NEW_LAYER_MODE,
+                         "default-new-layer-mode",
+                         "Default new layer mode",
+                         DEFAULT_NEW_LAYER_MODE_BLURB,
+                         GIMP_TYPE_LAYER_MODE,
+                         GIMP_LAYER_MODE_NORMAL_LEGACY,
+                         GIMP_PARAM_STATIC_STRINGS);
+
   path = gimp_config_build_plug_in_path ("plug-ins");
   GIMP_CONFIG_PROP_PATH (object_class, PROP_PLUG_IN_PATH,
                          "plug-in-path",
@@ -753,6 +762,9 @@ gimp_core_config_set_property (GObject      *object,
     case PROP_DEFAULT_THRESHOLD:
       core_config->default_threshold = g_value_get_int (value);
       break;
+    case PROP_DEFAULT_NEW_LAYER_MODE:
+      core_config->default_new_layer_mode = g_value_get_enum (value);
+      break;
     case PROP_PLUG_IN_PATH:
       g_free (core_config->plug_in_path);
       core_config->plug_in_path = g_value_dup_string (value);
@@ -976,6 +988,9 @@ gimp_core_config_get_property (GObject    *object,
     case PROP_DEFAULT_THRESHOLD:
       g_value_set_int (value, core_config->default_threshold);
       break;
+    case PROP_DEFAULT_NEW_LAYER_MODE:
+      g_value_set_enum (value, core_config->default_new_layer_mode);
+      break;
     case PROP_PLUG_IN_PATH:
       g_value_set_string (value, core_config->plug_in_path);
       break;
diff --git a/app/config/gimpcoreconfig.h b/app/config/gimpcoreconfig.h
index 2ef1df1..bdb6147 100644
--- a/app/config/gimpcoreconfig.h
+++ b/app/config/gimpcoreconfig.h
@@ -43,6 +43,7 @@ struct _GimpCoreConfig
   gchar                  *language;
   GimpInterpolationType   interpolation_type;
   gint                    default_threshold;
+  GimpLayerMode           default_new_layer_mode;
   gchar                  *plug_in_path;
   gchar                  *module_path;
   gchar                  *interpreter_path;
diff --git a/app/config/gimprc-blurbs.h b/app/config/gimprc-blurbs.h
index 599b044..6f2e095 100644
--- a/app/config/gimprc-blurbs.h
+++ b/app/config/gimprc-blurbs.h
@@ -105,6 +105,9 @@ _("This is the distance in pixels where Guide and Grid snapping " \
 #define SNAP_TO_PATH_BLURB \
 "Snap to the active path by default in new image windows."
 
+#define DEFAULT_NEW_LAYER_MODE_BLURB \
+_("The default layer mode for newly created layers and images.")
+
 #define DEFAULT_THRESHOLD_BLURB \
 _("Tools such as fuzzy-select and bucket fill find regions based on a " \
   "seed-fill algorithm.  The seed fill starts at the initially selected " \


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