[Goodies-commits] r4792 - ristretto/trunk/src

Stephan Arts stephan at xfce.org
Mon May 12 14:36:25 CEST 2008


Author: stephan
Date: 2008-05-12 12:36:25 +0000 (Mon, 12 May 2008)
New Revision: 4792

Modified:
   ristretto/trunk/src/main.c
   ristretto/trunk/src/main_window.c
   ristretto/trunk/src/main_window.h
Log:
Add commandline options for fullscreen and slideshow (Patch by Gauvain Pocentek <gauvainpocentek AT gmail DOT com>)
(Fixes bug #4077)


Modified: ristretto/trunk/src/main.c
===================================================================
--- ristretto/trunk/src/main.c	2008-05-12 12:34:23 UTC (rev 4791)
+++ ristretto/trunk/src/main.c	2008-05-12 12:36:25 UTC (rev 4792)
@@ -52,6 +52,8 @@
 cb_rstto_open_files (RsttoOpenFiles *rof);
 
 gboolean version = FALSE;
+gboolean start_fullscreen = FALSE;
+gboolean start_slideshow = FALSE;
 
 static GOptionEntry entries[] =
 {
@@ -59,6 +61,14 @@
         N_("Version information"),
         NULL
     },
+    {    "fullscreen", 'f', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_NONE, &start_fullscreen,
+        N_("Start in fullscreen mode"),
+        NULL
+    },
+    {    "slideshow", 's', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_NONE, &start_slideshow,
+        N_("Start a slideshow"),
+        NULL
+    },
     { NULL }
 };
 
@@ -281,6 +291,8 @@
     rstto_main_window_set_hide_thumbnail(RSTTO_MAIN_WINDOW(window), slideshow_hide_thumbnail);
     rstto_main_window_set_scale_to_100(RSTTO_MAIN_WINDOW(window), scale_to_100);
     rstto_navigator_set_timeout(navigator, slideshow_timeout);
+    rstto_main_window_set_start_fullscreen(RSTTO_MAIN_WINDOW(window), start_fullscreen);
+    rstto_main_window_set_start_slideshow(RSTTO_MAIN_WINDOW(window), start_slideshow);
 
     /* When more then one file is provided over the CLI,
      * just open those files and don't index the folder
@@ -324,7 +336,10 @@
 
     rstto_main_window_set_show_thumbnail_viewer(RSTTO_MAIN_WINDOW(window), show_thumbnail_viewer);
     rstto_main_window_set_show_toolbar(RSTTO_MAIN_WINDOW(window), show_toolbar);
-
+    if (start_fullscreen)
+        rstto_main_window_force_fullscreen(RSTTO_MAIN_WINDOW(window));
+    if (start_slideshow)
+        rstto_main_window_force_slideshow (RSTTO_MAIN_WINDOW(window));
     gtk_main();
 
     bg_color = (GdkColor *)rstto_main_window_get_pv_bg_color(RSTTO_MAIN_WINDOW(window));

Modified: ristretto/trunk/src/main_window.c
===================================================================
--- ristretto/trunk/src/main_window.c	2008-05-12 12:34:23 UTC (rev 4791)
+++ ristretto/trunk/src/main_window.c	2008-05-12 12:36:25 UTC (rev 4792)
@@ -70,6 +70,8 @@
         const GdkColor *bg_color;
         gboolean        scale_to_100;
         RsttoDesktop    desktop;
+        gboolean        start_fullscreen;
+        gboolean        start_slideshow;
     } settings;
 
     struct {
@@ -1071,6 +1073,31 @@
 }
 
 void
+rstto_main_window_set_start_fullscreen (RsttoMainWindow *window, gboolean fullscreen)
+{
+    window->priv->settings.start_fullscreen = fullscreen;
+}
+
+void
+rstto_main_window_set_start_slideshow (RsttoMainWindow *window, gboolean slideshow)
+{
+    window->priv->settings.start_slideshow = slideshow;
+}
+
+void
+rstto_main_window_force_fullscreen (RsttoMainWindow *window)
+{
+    if(gdk_window_get_state(GTK_WIDGET(window)->window) | GDK_WINDOW_STATE_FULLSCREEN)
+        gtk_window_fullscreen(GTK_WINDOW(window));
+}
+
+void
+rstto_main_window_force_slideshow (RsttoMainWindow *window)
+{
+    gtk_widget_activate(window->priv->menus.go.menu_item_play);
+}
+
+void
 rstto_main_window_set_max_cache_size (RsttoMainWindow *window, gint max_cache_size)
 {
     window->priv->settings.max_cache_size = max_cache_size;

Modified: ristretto/trunk/src/main_window.h
===================================================================
--- ristretto/trunk/src/main_window.h	2008-05-12 12:34:23 UTC (rev 4791)
+++ ristretto/trunk/src/main_window.h	2008-05-12 12:36:25 UTC (rev 4792)
@@ -104,6 +104,15 @@
 rstto_main_window_get_pv_bg_color (RsttoMainWindow *window);
 
 void
+rstto_main_window_set_start_fullscreen (RsttoMainWindow *window, gboolean fullscreen);
+void
+rstto_main_window_set_start_slideshow (RsttoMainWindow *window, gboolean slideshow);
+void
+rstto_main_window_force_fullscreen (RsttoMainWindow *window);
+void
+rstto_main_window_force_slideshow (RsttoMainWindow *window);
+
+void
 rstto_main_window_set_scale_to_100 (RsttoMainWindow *window, gboolean scale_to_100);
 gboolean
 rstto_main_window_get_scale_to_100 (RsttoMainWindow *window);




More information about the Goodies-commits mailing list