Index: main_window.h =================================================================== --- main_window.h (revision 4790) +++ main_window.h (working copy) @@ -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); Index: main.c =================================================================== --- main.c (revision 4790) +++ main.c (working copy) @@ -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)); Index: main_window.c =================================================================== --- main_window.c (revision 4790) +++ main_window.c (working copy) @@ -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;