+ ev_dscwindow_set_page (ev_dscwindow, ev_view_presentation_get_current_page (pview));
+}
+
+static gboolean
+ev_dscwindow_notes_interaction (GtkContainer *container, EvDSCWindow *ev_dscwindow)
+{
+ GtkWidget *dialog;
+
+ dialog = gtk_file_chooser_dialog_new (
+ _("Open Document"),
+ GTK_WINDOW (ev_dscwindow),
+ GTK_FILE_CHOOSER_ACTION_OPEN,
+ GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT,
+ GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
+ NULL);
+
+ ev_document_factory_add_filters (dialog, NULL);
+ gtk_file_chooser_set_select_multiple (GTK_FILE_CHOOSER (dialog), FALSE);
+ gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER (dialog), TRUE);
+
+ if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)
+ {
+ char * uri = gtk_file_chooser_get_uri (GTK_FILE_CHOOSER (dialog));
+ GError * error = NULL;
+ ev_view_set_loading (EV_VIEW (ev_dscwindow->priv->notesview), TRUE);
+
+ if (ev_dscwindow->priv->notes_document) {
+ ev_document_load (ev_dscwindow->priv->notes_document, uri, &error);
+ } else {
+ ev_dscwindow->priv->notes_document = ev_document_factory_get_document (uri,
+ &error);
+ }
+ g_free (uri);
+ if (error == NULL){
+ ev_dscwindow->priv->notes_model = ev_document_model_new ();
+ ev_document_model_set_document (ev_dscwindow->priv->notes_model,
+ ev_dscwindow->priv->notes_document);
+ ev_document_model_set_continuous (ev_dscwindow->priv->notes_model,
+ FALSE);
+ ev_document_model_set_dual_page (ev_dscwindow->priv->notes_model,
+ FALSE);
+ ev_document_model_set_sizing_mode (ev_dscwindow->priv->notes_model,
+ EV_SIZING_BEST_FIT);
+ ev_document_model_set_page (ev_dscwindow->priv->notes_model,
+ ev_document_model_get_page (ev_dscwindow->priv->model));
+ ev_view_set_model(EV_VIEW(ev_dscwindow->priv->notesview),
+ ev_dscwindow->priv->notes_model);
+ g_signal_connect (G_OBJECT(ev_dscwindow->priv->notes_model),
+ "notify::page",
+ G_CALLBACK (ev_dscwindow_page_changed_cb),
+ ev_dscwindow);
+ }
+ }
+ gtk_widget_destroy (dialog);
+
+ return TRUE;
+}
+
+EvDSCWindow *
+ev_dscwindow_get_control (void)
+{
+ static EvDSCWindow * control = NULL;
+
+ if (!control || !EV_IS_DSCWINDOW (control)) {
+ control = EV_DSCWINDOW (g_object_new (EV_TYPE_DSCWINDOW, NULL));
+ }
+
+ return control;
+}
+
+static void
+ev_dscwindow_window_placement (EvDSCWindow *ev_dscwindow)
+{
+ GtkWindow * presentation_window = GTK_WINDOW (ev_dscwindow->priv->presentation_window);
+ GdkScreen * screen = gtk_window_get_screen (presentation_window);
+ gint work_monitor = gdk_screen_get_monitor_at_window (screen,
+ gtk_widget_get_window (GTK_WIDGET (presentation_window)));
+ gint presentation_monitor = (work_monitor + 1) % 2;
+ GdkRectangle coords;
+ gdk_screen_get_monitor_geometry (screen, presentation_monitor,
+ &coords);
+
+ gtk_window_move (presentation_window, coords.x, coords.y);
+ ev_dscwindow->priv->moveback_monitor = work_monitor;
+ gtk_window_maximize (GTK_WINDOW (ev_dscwindow));