X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;ds=sidebyside;f=shell%2Fev-application.c;h=aee7390bafb270910767184d52c2d0fa1f023584;hb=1f4859f8061b8a03e8f75a5cbd26f16c19155670;hp=4bbec37cd1d1348a63903a316fd317662084d590;hpb=bd7342aad81904a616ea6948a1e87c59e26af951;p=evince.git diff --git a/shell/ev-application.c b/shell/ev-application.c index 4bbec37c..aee7390b 100644 --- a/shell/ev-application.c +++ b/shell/ev-application.c @@ -109,7 +109,9 @@ ev_application_register_service (EvApplication *application) dbus_g_connection_register_g_object (connection, "/org/gnome/evince/Evince", G_OBJECT (application)); - + + application->scr_saver = totem_scrsaver_new (connection); + return TRUE; } #endif /* ENABLE_DBUS */ @@ -260,6 +262,22 @@ get_destination_from_args (GHashTable *args) return dest; } +static gboolean +get_unlink_temp_file_from_args (GHashTable *args) +{ + gboolean unlink_temp_file = FALSE; + GValue *value = NULL; + + g_assert (args != NULL); + + value = g_hash_table_lookup (args, "unlink-temp-file"); + if (value) { + unlink_temp_file = g_value_get_boolean (value); + } + + return unlink_temp_file; +} + gboolean ev_application_open_window (EvApplication *application, GHashTable *args, @@ -339,6 +357,7 @@ ev_application_open_uri_at_dest (EvApplication *application, GdkScreen *screen, EvLinkDest *dest, EvWindowRunMode mode, + gboolean unlink_temp_file, guint timestamp) { EvWindow *new_window; @@ -360,7 +379,7 @@ ev_application_open_uri_at_dest (EvApplication *application, /* We need to load uri before showing the window, so we can restore window size without flickering */ - ev_window_open_uri (new_window, uri, dest, mode); + ev_window_open_uri (new_window, uri, dest, mode, unlink_temp_file); gtk_widget_show (GTK_WIDGET (new_window)); @@ -377,16 +396,20 @@ ev_application_open_uri (EvApplication *application, { EvLinkDest *dest = NULL; EvWindowRunMode mode = EV_WINDOW_MODE_NORMAL; + gboolean unlink_temp_file = FALSE; GdkScreen *screen = NULL; if (args) { screen = get_screen_from_args (args); dest = get_destination_from_args (args); mode = get_window_run_mode_from_args (args); + unlink_temp_file = (mode == EV_WINDOW_MODE_PREVIEW && + get_unlink_temp_file_from_args (args)); } ev_application_open_uri_at_dest (application, uri, screen, - dest, mode, timestamp); + dest, mode, unlink_temp_file, + timestamp); if (dest) g_object_unref (dest); @@ -404,7 +427,8 @@ ev_application_open_uri_list (EvApplication *application, for (l = uri_list; l != NULL; l = l->next) { ev_application_open_uri_at_dest (application, (char *)l->data, - screen, NULL, 0, timestamp); + screen, NULL, 0, FALSE, + timestamp); } } @@ -529,3 +553,14 @@ const gchar* ev_application_get_chooser_uri (EvApplication *application) return application->last_chooser_uri; } +void ev_application_screensaver_enable (EvApplication *application) +{ + if (application->scr_saver) + totem_scrsaver_enable (application->scr_saver); +} + +void ev_application_screensaver_disable (EvApplication *application) +{ + if (application->scr_saver) + totem_scrsaver_disable (application->scr_saver); +}