+ev_application_add_icon_path_for_screen (GdkScreen *screen)
+{
+ GtkIconTheme *icon_theme;
+
+ icon_theme = gtk_icon_theme_get_for_screen (screen);
+ if (icon_theme) {
+ gchar **path = NULL;
+ gint n_paths;
+ gint i;
+ gchar *ev_icons_path;
+
+ /* GtkIconTheme will then look in Evince custom hicolor dir
+ * for icons as well as the standard search paths
+ */
+ ev_icons_path = g_build_filename (DATADIR, "icons", NULL);
+ gtk_icon_theme_get_search_path (icon_theme, &path, &n_paths);
+ for (i = n_paths - 1; i >= 0; i--) {
+ if (g_ascii_strcasecmp (ev_icons_path, path[i]) == 0)
+ break;
+ }
+
+ if (i < 0)
+ gtk_icon_theme_append_search_path (icon_theme,
+ ev_icons_path);
+
+ g_free (ev_icons_path);
+ g_strfreev (path);
+ }
+}
+
+/**
+ * ev_application_open_uri_at_dest:
+ * @application: The instance of the application.
+ * @uri: The uri to be opened.
+ * @screen: Thee screen where the link will be shown.
+ * @dest: The #EvLinkDest of the document.
+ * @mode: The run mode of the window.
+ * @unlink_temp_file: The unlink_temp_file option value.
+ * @timestamp: Current time value.
+ */
+void
+ev_application_open_uri_at_dest (EvApplication *application,
+ const char *uri,
+ GdkScreen *screen,
+ EvLinkDest *dest,
+ EvWindowRunMode mode,
+ const gchar *search_string,
+ gboolean unlink_temp_file,
+ const gchar *print_settings,
+ guint timestamp)
+{
+ EvWindow *new_window;
+
+ g_return_if_fail (uri != NULL);
+
+ ev_application_add_icon_path_for_screen (screen);
+
+ new_window = ev_application_get_uri_window (application, uri);
+
+ if (new_window == NULL) {
+ new_window = ev_application_get_empty_window (application, screen);
+ }
+
+ if (new_window == NULL) {
+ new_window = EV_WINDOW (ev_window_new ());
+ }
+
+ if (screen)
+ gtk_window_set_screen (GTK_WINDOW (new_window), screen);
+
+ /* 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, search_string,
+ unlink_temp_file, print_settings);
+
+ 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)