Skip to content

Commit 0bf1f22

Browse files
committed
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...
1 parent b19a18f commit 0bf1f22

10 files changed

+48
-2
lines changed

app/app.c

+2
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ app_run (const gchar *full_prog_name,
155155
gboolean use_cpu_accel,
156156
gboolean console_messages,
157157
gboolean use_debug_handler,
158+
gboolean show_playground,
158159
GimpStackTraceMode stack_trace_mode,
159160
GimpPDBCompatMode pdb_compat_mode)
160161
{
@@ -197,6 +198,7 @@ app_run (const gchar *full_prog_name,
197198
use_shm,
198199
use_cpu_accel,
199200
console_messages,
201+
show_playground,
200202
stack_trace_mode,
201203
pdb_compat_mode);
202204

app/app.h

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ void app_run (const gchar *full_prog_name,
4747
gboolean use_cpu_accel,
4848
gboolean console_messages,
4949
gboolean use_debug_handler,
50+
gboolean show_playground,
5051
GimpStackTraceMode stack_trace_mode,
5152
GimpPDBCompatMode pdb_compat_mode);
5253

app/core/gimp.c

+3
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ gimp_init (Gimp *gimp)
222222
gimp->use_shm = FALSE;
223223
gimp->use_cpu_accel = TRUE;
224224
gimp->message_handler = GIMP_CONSOLE;
225+
gimp->show_playground = FALSE;
225226
gimp->stack_trace_mode = GIMP_STACK_TRACE_NEVER;
226227
gimp->pdb_compat_mode = GIMP_PDB_COMPAT_OFF;
227228

@@ -802,6 +803,7 @@ gimp_new (const gchar *name,
802803
gboolean use_shm,
803804
gboolean use_cpu_accel,
804805
gboolean console_messages,
806+
gboolean show_playground,
805807
GimpStackTraceMode stack_trace_mode,
806808
GimpPDBCompatMode pdb_compat_mode)
807809
{
@@ -824,6 +826,7 @@ gimp_new (const gchar *name,
824826
gimp->use_shm = use_shm ? TRUE : FALSE;
825827
gimp->use_cpu_accel = use_cpu_accel ? TRUE : FALSE;
826828
gimp->console_messages = console_messages ? TRUE : FALSE;
829+
gimp->show_playground = show_playground ? TRUE : FALSE;
827830
gimp->stack_trace_mode = stack_trace_mode;
828831
gimp->pdb_compat_mode = pdb_compat_mode;
829832

app/core/gimp.h

+2
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ struct _Gimp
5252
gboolean use_cpu_accel;
5353
GimpMessageHandlerType message_handler;
5454
gboolean console_messages;
55+
gboolean show_playground;
5556
GimpStackTraceMode stack_trace_mode;
5657
GimpPDBCompatMode pdb_compat_mode;
5758

@@ -153,6 +154,7 @@ Gimp * gimp_new (const gchar *name,
153154
gboolean use_shm,
154155
gboolean use_cpu_accel,
155156
gboolean console_messages,
157+
gboolean show_playground,
156158
GimpStackTraceMode stack_trace_mode,
157159
GimpPDBCompatMode pdb_compat_mode);
158160
void gimp_set_show_gui (Gimp *gimp,

app/dialogs/preferences-dialog.c

+26
Original file line numberDiff line numberDiff line change
@@ -1451,6 +1451,32 @@ prefs_dialog_new (Gimp *gimp,
14511451
gimp);
14521452

14531453

1454+
/****************/
1455+
/* Playground */
1456+
/****************/
1457+
if (gimp->show_playground)
1458+
{
1459+
GtkWidget *label;
1460+
1461+
pixbuf = prefs_get_pixbufs (dialog, "playground", &small_pixbuf);
1462+
vbox = gimp_prefs_box_add_page (GIMP_PREFS_BOX (prefs_box),
1463+
_("Experimental Playground"),
1464+
pixbuf,
1465+
_("Playground"),
1466+
small_pixbuf,
1467+
GIMP_HELP_PREFS_DIALOG,
1468+
NULL,
1469+
&top_iter);
1470+
1471+
vbox2 = prefs_frame_new (_("Insane Options"),
1472+
GTK_CONTAINER (vbox), TRUE);
1473+
1474+
label = gtk_label_new ("Fuck Yeah!");
1475+
gtk_box_pack_start (GTK_BOX (vbox2), label, TRUE, TRUE, 0);
1476+
gtk_widget_show (label);
1477+
}
1478+
1479+
14541480
/***********/
14551481
/* Theme */
14561482
/***********/

app/main.c

+8
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,11 @@ static gboolean console_messages = FALSE;
133133
static gboolean use_debug_handler = FALSE;
134134

135135
#ifdef GIMP_UNSTABLE
136+
static gboolean show_playground = TRUE;
136137
static GimpStackTraceMode stack_trace_mode = GIMP_STACK_TRACE_QUERY;
137138
static GimpPDBCompatMode pdb_compat_mode = GIMP_PDB_COMPAT_WARN;
138139
#else
140+
static gboolean show_playground = FALSE;
139141
static GimpStackTraceMode stack_trace_mode = GIMP_STACK_TRACE_NEVER;
140142
static GimpPDBCompatMode pdb_compat_mode = GIMP_PDB_COMPAT_ON;
141143
#endif
@@ -270,6 +272,11 @@ static const GOptionEntry main_entries[] =
270272
G_OPTION_ARG_CALLBACK, gimp_option_dump_pdb_procedures_deprecated,
271273
N_("Output a sorted list of deprecated procedures in the PDB"), NULL
272274
},
275+
{
276+
"show-playground", 0, G_OPTION_FLAG_HIDDEN,
277+
G_OPTION_ARG_NONE, &show_playground,
278+
N_("Show a preferences page with experimental features"), NULL
279+
},
273280
{
274281
G_OPTION_REMAINING, 0, 0,
275282
G_OPTION_ARG_FILENAME_ARRAY, &filenames,
@@ -466,6 +473,7 @@ main (int argc,
466473
use_cpu_accel,
467474
console_messages,
468475
use_debug_handler,
476+
show_playground,
469477
stack_trace_mode,
470478
pdb_compat_mode);
471479

app/tests.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ gimp_init_for_testing (void)
6666
gegl_init (NULL, NULL);
6767

6868
gimp = gimp_new ("Unit Tested GIMP", NULL, NULL, FALSE, TRUE, TRUE, TRUE,
69-
FALSE, FALSE, TRUE, TRUE, FALSE);
69+
FALSE, FALSE, TRUE, FALSE,
70+
GIMP_STACK_TRACE_QUERY, GIMP_PDB_COMPAT_OFF);
7071

7172
units_init (gimp);
7273

@@ -123,7 +124,8 @@ gimp_init_for_gui_testing_internal (gboolean show_gui,
123124

124125
/* from app_run() */
125126
gimp = gimp_new ("Unit Tested GIMP", NULL, NULL, FALSE, TRUE, TRUE, !show_gui,
126-
FALSE, FALSE, TRUE, TRUE, FALSE);
127+
FALSE, FALSE, TRUE, FALSE,
128+
GIMP_STACK_TRACE_QUERY, GIMP_PDB_COMPAT_OFF);
127129
gimp_set_show_gui (gimp, show_gui);
128130
units_init (gimp);
129131
gimp_load_config (gimp, gimprc, NULL);

icons/22/gimp-prefs-playground.png

11.1 KB
Loading

icons/48/gimp-prefs-playground.png

16.7 KB
Loading

icons/Makefile.am

+2
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ icons22_DATA = \
260260
22/gimp-prefs-input-devices.png \
261261
22/gimp-prefs-interface.png \
262262
22/gimp-prefs-new-image.png \
263+
22/gimp-prefs-playground.png \
263264
22/gimp-prefs-session.png \
264265
22/gimp-prefs-theme.png \
265266
22/gimp-prefs-tool-options.png \
@@ -432,6 +433,7 @@ icons48_DATA = \
432433
48/gimp-prefs-input-devices.png \
433434
48/gimp-prefs-interface.png \
434435
48/gimp-prefs-new-image.png \
436+
48/gimp-prefs-playground.png \
435437
48/gimp-prefs-session.png \
436438
48/gimp-prefs-theme.png \
437439
48/gimp-prefs-tool-options.png \

0 commit comments

Comments
 (0)