+ ev_document_fc_mutex_lock ();
+ gtk_widget_show (GTK_WIDGET (new_window));
+ ev_document_fc_mutex_unlock ();
+
+ gtk_window_present_with_time (GTK_WINDOW (new_window),
+ timestamp);
+}
+
+/**
+ * ev_application_open_uri:
+ * @application: The instance of the application.
+ * @uri: The uri to be opened
+ * @args: A #GHashTable with the arguments data.
+ * @timestamp: Current time value.
+ * @error: The #GError facility.
+ */
+gboolean
+ev_application_open_uri (EvApplication *application,
+ const char *uri,
+ GHashTable *args,
+ guint timestamp,
+ GError **error)
+{
+ EvLinkDest *dest = NULL;
+ EvWindowRunMode mode = EV_WINDOW_MODE_NORMAL;
+ const gchar *search_string = NULL;
+ gboolean unlink_temp_file = FALSE;
+ const gchar *print_settings = NULL;
+ 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);
+ search_string = get_find_string_from_args (args);
+ unlink_temp_file = (mode == EV_WINDOW_MODE_PREVIEW &&
+ get_unlink_temp_file_from_args (args));
+ print_settings = get_print_settings_from_args (args);
+ }
+
+ ev_application_open_uri_at_dest (application, uri, screen,
+ dest, mode, search_string,
+ unlink_temp_file,
+ print_settings, timestamp);
+
+ if (dest)
+ g_object_unref (dest);
+
+ return TRUE;
+}
+
+void
+ev_application_open_uri_list (EvApplication *application,
+ GSList *uri_list,
+ GdkScreen *screen,
+ guint timestamp)
+{
+ GSList *l;
+
+ for (l = uri_list; l != NULL; l = l->next) {
+ ev_application_open_uri_at_dest (application, (char *)l->data,
+ screen, NULL, 0, NULL,
+ FALSE, NULL, timestamp);
+ }
+}
+
+void
+ev_application_shutdown (EvApplication *application)
+{
+ if (application->toolbars_model) {
+ g_object_unref (application->toolbars_model);
+ g_free (application->toolbars_file);
+ application->toolbars_model = NULL;
+ application->toolbars_file = NULL;
+ }
+
+#ifdef WITH_GTK_PRINT
+#if GTK_CHECK_VERSION (2, 11, 0)
+ if (application->print_settings_file) {
+ if (application->print_settings) {
+ GError *error = NULL;
+
+ gtk_print_settings_to_file (application->print_settings,
+ application->print_settings_file,
+ &error);
+ if (error) {
+ g_warning (error->message);
+ g_error_free (error);
+ }
+
+ g_object_unref (application->print_settings);
+ application->print_settings = NULL;
+ }
+
+ g_free (application->print_settings_file);
+ application->print_settings_file = NULL;
+ }
+#else /* ! GTK 2.11.0 */
+ if (application->print_settings) {
+ g_object_unref (application->print_settings);
+ application->print_settings = NULL;
+ }
+#endif /* GTK 2.11.0 */
+#endif /* WITH_GTK_PRINT */
+
+ g_free (application->last_chooser_uri);
+ g_object_unref (application);
+
+ gtk_main_quit ();
+}
+
+static void
+ev_application_class_init (EvApplicationClass *ev_application_class)
+{