[libwnck] TestTasklist, TestWnck: added cmdline options to set the icons size



commit 63e4670d37a24d2bc0b7b4db044788e780fff73a
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date:   Tue Aug 20 16:29:42 2013 +0200

    TestTasklist, TestWnck: added cmdline options to set the icons size

 libwnck/private.h       |   11 +++++------
 libwnck/test-tasklist.c |    3 +++
 libwnck/test-wnck.c     |   19 ++++++++++++++++++-
 3 files changed, 26 insertions(+), 7 deletions(-)
---
diff --git a/libwnck/private.h b/libwnck/private.h
index d87661a..b526dda 100644
--- a/libwnck/private.h
+++ b/libwnck/private.h
@@ -71,8 +71,8 @@ time_t      _wnck_window_or_transient_get_needs_attention_time (WnckWindow *wind
 
 void        _wnck_window_shutdown_all (void);
 
-WnckWorkspace* _wnck_workspace_create  (int            number,
-                                       WnckScreen    *screen);
+WnckWorkspace* _wnck_workspace_create  (int            number, 
+                                        WnckScreen    *screen);
 void           _wnck_workspace_destroy (WnckWorkspace *space);
 
 void _wnck_window_set_application    (WnckWindow      *window,
@@ -82,10 +82,9 @@ void _wnck_window_set_class_group (WnckWindow     *window,
                                   WnckClassGroup *class_group);
 
 /* this one is in pager.c since it needs code from there to draw the icon */
-void 
-_wnck_window_set_as_drag_icon (WnckWindow     *window,
-                               GdkDragContext *context,
-                               GtkWidget      *drag_source);
+void _wnck_window_set_as_drag_icon (WnckWindow     *window,
+                                    GdkDragContext *context,
+                                    GtkWidget      *drag_source);
 
 void _wnck_application_add_window    (WnckApplication *app,
                                       WnckWindow      *window);
diff --git a/libwnck/test-tasklist.c b/libwnck/test-tasklist.c
index 5e5d1fe..5f94ee2 100644
--- a/libwnck/test-tasklist.c
+++ b/libwnck/test-tasklist.c
@@ -10,11 +10,13 @@ static gboolean rtl = FALSE;
 static gboolean skip_tasklist = FALSE;
 static gboolean transparent = FALSE;
 static gboolean vertical = FALSE;
+static gint icon_size = WNCK_DEFAULT_MINI_ICON_SIZE;
 
 static GOptionEntry entries[] = {
        {"always-group", 'g', 0, G_OPTION_ARG_NONE, &always_group, "Always group windows", NULL},
        {"never-group", 'n', 0, G_OPTION_ARG_NONE, &never_group, "Never group windows", NULL},
        {"display-all", 'a', 0, G_OPTION_ARG_NONE, &display_all, "Display windows from all workspaces", NULL},
+       {"icon-size", 'i', 0, G_OPTION_ARG_INT, &icon_size, "Icon size for tasklist", NULL},
        {"rtl", 'r', 0, G_OPTION_ARG_NONE, &rtl, "Use RTL as default direction", NULL},
        {"skip-tasklist", 's', 0, G_OPTION_ARG_NONE, &skip_tasklist, "Don't show window in tasklist", NULL},
        {"vertical", 'v', 0, G_OPTION_ARG_NONE, &vertical, "Show in vertical mode", NULL},
@@ -66,6 +68,7 @@ main (int argc, char **argv)
   if (rtl)
     gtk_widget_set_default_direction (GTK_TEXT_DIR_RTL);
 
+  wnck_set_default_mini_icon_size (icon_size);
   screen = wnck_screen_get_default ();
 
   /* because the pager doesn't respond to signals at the moment */
diff --git a/libwnck/test-wnck.c b/libwnck/test-wnck.c
index 46df1ef..5d85131 100644
--- a/libwnck/test-wnck.c
+++ b/libwnck/test-wnck.c
@@ -58,13 +58,30 @@ static void          update_window     (GtkTreeModel *model,
                                         WnckWindow   *window);
 static void          queue_refill_model (void);
 
+static gint icon_size = WNCK_DEFAULT_MINI_ICON_SIZE;
+
+static GOptionEntry entries[] = {
+  {"icon-size", 'i', 0, G_OPTION_ARG_INT, &icon_size, "Icon size for tasklist", NULL},
+  {NULL }
+};
+
+
 int
 main (int argc, char **argv)
 {
   WnckScreen *screen;
   GtkWidget *sw;
   GtkWidget *win;
-  
+  GOptionContext *ctxt;
+
+  ctxt = g_option_context_new ("");
+  g_option_context_add_main_entries (ctxt, entries, NULL);
+  g_option_context_add_group (ctxt, gtk_get_option_group (TRUE));
+  g_option_context_parse (ctxt, &argc, &argv, NULL);
+  g_clear_pointer (&ctxt, g_option_context_free);
+
+  wnck_set_default_mini_icon_size (icon_size);
+
   gtk_init (&argc, &argv);
 
   screen = wnck_screen_get (0);


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