+ /* 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, unlink_temp_file);
+
+ 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);
+}
+
+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;
+ 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, unlink_temp_file,
+ 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, FALSE,
+ timestamp);
+ }
+}
+
+void
+ev_application_shutdown (EvApplication *application)
+{
+ if (application->toolbars_model) {
+ g_object_unref (application->toolbars_model);
+ g_object_unref (application->preview_toolbars_model);
+ g_free (application->toolbars_file);
+ application->toolbars_model = NULL;
+ application->preview_toolbars_model = NULL;
+ application->toolbars_file = NULL;
+ }
+
+#ifndef HAVE_GTK_RECENT
+ if (application->recent_model) {
+ g_object_unref (application->recent_model);
+ application->recent_model = NULL;
+ }
+#endif
+
+ g_free (application->last_chooser_uri);
+ g_object_unref (application);
+
+ gtk_main_quit ();
+}
+
+static void
+ev_application_class_init (EvApplicationClass *ev_application_class)
+{