[gimp] app: Add show_gui parameter to gimp_init_for_gui_testing()



commit 0601229f9feac47f72851dc3e10c3c1d8aa1ea4f
Author: Martin Nordholts <martinn src gnome org>
Date:   Wed Sep 16 22:58:41 2009 +0200

    app: Add show_gui parameter to gimp_init_for_gui_testing()
    
    Add show_gui parameter to gimp_init_for_gui_testing() so that we can
    have tests that shows the the actual GIMP interface.

 app/tests.c                        |    6 +++---
 app/tests.h                        |    3 ++-
 app/tests/test-window-management.c |    2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/app/tests.c b/app/tests.c
index d13b367..f16e255 100644
--- a/app/tests.c
+++ b/app/tests.c
@@ -81,7 +81,7 @@ gimp_status_func_dummy (const gchar *text1,
  * Returns: The #Gimp instance.
  **/
 Gimp *
-gimp_init_for_gui_testing (gboolean use_cpu_accel)
+gimp_init_for_gui_testing (gboolean use_cpu_accel, gboolean show_gui)
 {
   Gimp *gimp;
 
@@ -90,9 +90,9 @@ gimp_init_for_gui_testing (gboolean use_cpu_accel)
   g_type_init();
 
   /* from app_run() */
-  gimp = gimp_new ("Unit Tested GIMP", NULL, FALSE, TRUE, TRUE, TRUE,
+  gimp = gimp_new ("Unit Tested GIMP", NULL, FALSE, TRUE, TRUE, !show_gui,
                    FALSE, TRUE, TRUE, FALSE);
-  gimp_set_show_gui (gimp, FALSE);
+  gimp_set_show_gui (gimp, show_gui);
   units_init (gimp);
   gimp_load_config (gimp, NULL, NULL);
   base_init (GIMP_BASE_CONFIG (gimp->config), FALSE, use_cpu_accel);
diff --git a/app/tests.h b/app/tests.h
index 654e048..1282753 100644
--- a/app/tests.h
+++ b/app/tests.h
@@ -20,7 +20,8 @@
 
 
 Gimp * gimp_init_for_testing     (gboolean use_cpu_accel);
-Gimp * gimp_init_for_gui_testing (gboolean use_cpu_accel);
+Gimp * gimp_init_for_gui_testing (gboolean use_cpu_accel,
+                                  gboolean show_gui);
 
 
 #endif /* __TESTS_H__ */
diff --git a/app/tests/test-window-management.c b/app/tests/test-window-management.c
index fdbb2b9..6ef7373 100644
--- a/app/tests/test-window-management.c
+++ b/app/tests/test-window-management.c
@@ -52,7 +52,7 @@ int main(int argc, char **argv)
   g_test_init (&argc, &argv, NULL);
 
   /* We share the same application instance across all tests */
-  gimp = gimp_init_for_gui_testing (FALSE);
+  gimp = gimp_init_for_gui_testing (FALSE, FALSE);
 
   /* Setup the tests */
   g_test_add ("/gimp-window-management/window-roles",



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