[gimp] app: add a "Playground" perfs page and a --show-playground command line option



commit 0bf1f22b01bb87ce08d2b468118fe954b6ecab78
Author: Michael Natterer <mitch gimp org>
Date:   Sun Sep 14 01:08:25 2014 +0200

    app: add a "Playground" perfs page and a --show-playground command line option
    
    The page is shown by default in unstable but needs --show-playground
    in stable versions. There is nothing yet on that page. Also, the icon
    needs improvement...

 app/app.c                          |    2 ++
 app/app.h                          |    1 +
 app/core/gimp.c                    |    3 +++
 app/core/gimp.h                    |    2 ++
 app/dialogs/preferences-dialog.c   |   26 ++++++++++++++++++++++++++
 app/main.c                         |    8 ++++++++
 app/tests.c                        |    6 ++++--
 icons/22/gimp-prefs-playground.png |  Bin 0 -> 11351 bytes
 icons/48/gimp-prefs-playground.png |  Bin 0 -> 17088 bytes
 icons/Makefile.am                  |    2 ++
 10 files changed, 48 insertions(+), 2 deletions(-)
---
diff --git a/app/app.c b/app/app.c
index cc5f5c5..753d3f7 100644
--- a/app/app.c
+++ b/app/app.c
@@ -155,6 +155,7 @@ app_run (const gchar         *full_prog_name,
          gboolean             use_cpu_accel,
          gboolean             console_messages,
          gboolean             use_debug_handler,
+         gboolean             show_playground,
          GimpStackTraceMode   stack_trace_mode,
          GimpPDBCompatMode    pdb_compat_mode)
 {
@@ -197,6 +198,7 @@ app_run (const gchar         *full_prog_name,
                    use_shm,
                    use_cpu_accel,
                    console_messages,
+                   show_playground,
                    stack_trace_mode,
                    pdb_compat_mode);
 
diff --git a/app/app.h b/app/app.h
index 0a25610..9f96216 100644
--- a/app/app.h
+++ b/app/app.h
@@ -47,6 +47,7 @@ void  app_run       (const gchar         *full_prog_name,
                      gboolean             use_cpu_accel,
                      gboolean             console_messages,
                      gboolean             use_debug_handler,
+                     gboolean             show_playground,
                      GimpStackTraceMode   stack_trace_mode,
                      GimpPDBCompatMode    pdb_compat_mode);
 
diff --git a/app/core/gimp.c b/app/core/gimp.c
index 7bfc38f..2cafa16 100644
--- a/app/core/gimp.c
+++ b/app/core/gimp.c
@@ -222,6 +222,7 @@ gimp_init (Gimp *gimp)
   gimp->use_shm          = FALSE;
   gimp->use_cpu_accel    = TRUE;
   gimp->message_handler  = GIMP_CONSOLE;
+  gimp->show_playground  = FALSE;
   gimp->stack_trace_mode = GIMP_STACK_TRACE_NEVER;
   gimp->pdb_compat_mode  = GIMP_PDB_COMPAT_OFF;
 
@@ -802,6 +803,7 @@ gimp_new (const gchar       *name,
           gboolean           use_shm,
           gboolean           use_cpu_accel,
           gboolean           console_messages,
+          gboolean           show_playground,
           GimpStackTraceMode stack_trace_mode,
           GimpPDBCompatMode  pdb_compat_mode)
 {
@@ -824,6 +826,7 @@ gimp_new (const gchar       *name,
   gimp->use_shm          = use_shm          ? TRUE : FALSE;
   gimp->use_cpu_accel    = use_cpu_accel    ? TRUE : FALSE;
   gimp->console_messages = console_messages ? TRUE : FALSE;
+  gimp->show_playground  = show_playground  ? TRUE : FALSE;
   gimp->stack_trace_mode = stack_trace_mode;
   gimp->pdb_compat_mode  = pdb_compat_mode;
 
diff --git a/app/core/gimp.h b/app/core/gimp.h
index 265a887..cd8d9d9 100644
--- a/app/core/gimp.h
+++ b/app/core/gimp.h
@@ -52,6 +52,7 @@ struct _Gimp
   gboolean                use_cpu_accel;
   GimpMessageHandlerType  message_handler;
   gboolean                console_messages;
+  gboolean                show_playground;
   GimpStackTraceMode      stack_trace_mode;
   GimpPDBCompatMode       pdb_compat_mode;
 
@@ -153,6 +154,7 @@ Gimp         * gimp_new                  (const gchar         *name,
                                           gboolean             use_shm,
                                           gboolean             use_cpu_accel,
                                           gboolean             console_messages,
+                                          gboolean             show_playground,
                                           GimpStackTraceMode   stack_trace_mode,
                                           GimpPDBCompatMode    pdb_compat_mode);
 void           gimp_set_show_gui         (Gimp                *gimp,
diff --git a/app/dialogs/preferences-dialog.c b/app/dialogs/preferences-dialog.c
index 62f9272..6b0d739 100644
--- a/app/dialogs/preferences-dialog.c
+++ b/app/dialogs/preferences-dialog.c
@@ -1451,6 +1451,32 @@ prefs_dialog_new (Gimp       *gimp,
                     gimp);
 
 
+  /****************/
+  /*  Playground  */
+  /****************/
+  if (gimp->show_playground)
+    {
+      GtkWidget *label;
+
+      pixbuf = prefs_get_pixbufs (dialog, "playground", &small_pixbuf);
+      vbox = gimp_prefs_box_add_page (GIMP_PREFS_BOX (prefs_box),
+                                      _("Experimental Playground"),
+                                      pixbuf,
+                                      _("Playground"),
+                                      small_pixbuf,
+                                      GIMP_HELP_PREFS_DIALOG,
+                                      NULL,
+                                      &top_iter);
+
+      vbox2 = prefs_frame_new (_("Insane Options"),
+                               GTK_CONTAINER (vbox), TRUE);
+
+      label = gtk_label_new ("Fuck Yeah!");
+      gtk_box_pack_start (GTK_BOX (vbox2), label, TRUE, TRUE, 0);
+      gtk_widget_show (label);
+    }
+
+
   /***********/
   /*  Theme  */
   /***********/
diff --git a/app/main.c b/app/main.c
index 2038657..18db832 100644
--- a/app/main.c
+++ b/app/main.c
@@ -133,9 +133,11 @@ static gboolean            console_messages  = FALSE;
 static gboolean            use_debug_handler = FALSE;
 
 #ifdef GIMP_UNSTABLE
+static gboolean            show_playground   = TRUE;
 static GimpStackTraceMode  stack_trace_mode  = GIMP_STACK_TRACE_QUERY;
 static GimpPDBCompatMode   pdb_compat_mode   = GIMP_PDB_COMPAT_WARN;
 #else
+static gboolean            show_playground   = FALSE;
 static GimpStackTraceMode  stack_trace_mode  = GIMP_STACK_TRACE_NEVER;
 static GimpPDBCompatMode   pdb_compat_mode   = GIMP_PDB_COMPAT_ON;
 #endif
@@ -271,6 +273,11 @@ static const GOptionEntry main_entries[] =
     N_("Output a sorted list of deprecated procedures in the PDB"), NULL
   },
   {
+    "show-playground", 0, G_OPTION_FLAG_HIDDEN,
+    G_OPTION_ARG_NONE, &show_playground,
+    N_("Show a preferences page with experimental features"), NULL
+  },
+  {
     G_OPTION_REMAINING, 0, 0,
     G_OPTION_ARG_FILENAME_ARRAY, &filenames,
     NULL, NULL
@@ -466,6 +473,7 @@ main (int    argc,
            use_cpu_accel,
            console_messages,
            use_debug_handler,
+           show_playground,
            stack_trace_mode,
            pdb_compat_mode);
 
diff --git a/app/tests.c b/app/tests.c
index 7306622..5633e3e 100644
--- a/app/tests.c
+++ b/app/tests.c
@@ -66,7 +66,8 @@ gimp_init_for_testing (void)
   gegl_init (NULL, NULL);
 
   gimp = gimp_new ("Unit Tested GIMP", NULL, NULL, FALSE, TRUE, TRUE, TRUE,
-                   FALSE, FALSE, TRUE, TRUE, FALSE);
+                   FALSE, FALSE, TRUE, FALSE,
+                   GIMP_STACK_TRACE_QUERY, GIMP_PDB_COMPAT_OFF);
 
   units_init (gimp);
 
@@ -123,7 +124,8 @@ gimp_init_for_gui_testing_internal (gboolean  show_gui,
 
   /* from app_run() */
   gimp = gimp_new ("Unit Tested GIMP", NULL, NULL, FALSE, TRUE, TRUE, !show_gui,
-                   FALSE, FALSE, TRUE, TRUE, FALSE);
+                   FALSE, FALSE, TRUE, FALSE,
+                   GIMP_STACK_TRACE_QUERY, GIMP_PDB_COMPAT_OFF);
   gimp_set_show_gui (gimp, show_gui);
   units_init (gimp);
   gimp_load_config (gimp, gimprc, NULL);
diff --git a/icons/22/gimp-prefs-playground.png b/icons/22/gimp-prefs-playground.png
new file mode 100644
index 0000000..b2ef8f9
Binary files /dev/null and b/icons/22/gimp-prefs-playground.png differ
diff --git a/icons/48/gimp-prefs-playground.png b/icons/48/gimp-prefs-playground.png
new file mode 100644
index 0000000..b4356c5
Binary files /dev/null and b/icons/48/gimp-prefs-playground.png differ
diff --git a/icons/Makefile.am b/icons/Makefile.am
index d63b92f..d661d0e 100644
--- a/icons/Makefile.am
+++ b/icons/Makefile.am
@@ -260,6 +260,7 @@ icons22_DATA = \
        22/gimp-prefs-input-devices.png         \
        22/gimp-prefs-interface.png             \
        22/gimp-prefs-new-image.png             \
+       22/gimp-prefs-playground.png            \
        22/gimp-prefs-session.png               \
        22/gimp-prefs-theme.png                 \
        22/gimp-prefs-tool-options.png          \
@@ -432,6 +433,7 @@ icons48_DATA = \
        48/gimp-prefs-input-devices.png         \
        48/gimp-prefs-interface.png             \
        48/gimp-prefs-new-image.png             \
+       48/gimp-prefs-playground.png            \
        48/gimp-prefs-session.png               \
        48/gimp-prefs-theme.png                 \
        48/gimp-prefs-tool-options.png          \


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