[gtk+] Add a --direction option to gtk-reftest



commit 39f95f1b9bf8af34c3eb449c44734aa08d4c1b0c
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Jun 29 20:03:29 2013 -0400

    Add a --direction option to gtk-reftest
    
    gtk_test_init() hardcodes the locale to "C", so the --direction
    option is useful to check reftests in rtl.

 testsuite/reftests/gtk-reftest.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/testsuite/reftests/gtk-reftest.c b/testsuite/reftests/gtk-reftest.c
index a358600..19918a0 100644
--- a/testsuite/reftests/gtk-reftest.c
+++ b/testsuite/reftests/gtk-reftest.c
@@ -34,12 +34,15 @@ typedef enum {
 
 static char *arg_output_dir = NULL;
 static char *arg_base_dir = NULL;
+static char *arg_direction = NULL;
 
 static const GOptionEntry test_args[] = {
   { "output",         'o', 0, G_OPTION_ARG_FILENAME, &arg_output_dir,
     "Directory to save image files to", "DIR" },
   { "directory",        'd', 0, G_OPTION_ARG_FILENAME, &arg_base_dir,
     "Directory to run tests from", "DIR" },
+  { "direction",       0, 0, G_OPTION_ARG_STRING, &arg_direction,
+    "Set text direction", "DIRECTION" },
   { NULL }
 };
 
@@ -61,6 +64,11 @@ parse_command_line (int *argc, char ***argv)
 
   gtk_test_init (argc, argv);
 
+  if (g_strcmp0 (arg_direction, "rtl") == 0)
+    gtk_widget_set_default_direction (GTK_TEXT_DIR_RTL);
+  else if (g_strcmp0 (arg_direction, "ltr") == 0)
+    gtk_widget_set_default_direction (GTK_TEXT_DIR_LTR);
+
   return TRUE;
 }
 


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