]> www.fi.muni.cz Git - evince.git/blobdiff - shell/ev-dualscreen.c
[dualscreen] presentation wrapper and window placement
[evince.git] / shell / ev-dualscreen.c
index 4df456cc3575527dd41c10995a1f2e8e175783ca..3a0beaea8aac23f9e5e51bb592a569f25117650e 100644 (file)
@@ -158,6 +158,55 @@ ev_dscwindow_get_control (void)
 
        return control;
 }
+/*TODO: Fix me!*/
+static void
+ev_dscwindow_window_placement (EvDSCWindow *ev_dscwindow)
+{
+       gint num_monitors = get_num_monitors (GTK_WINDOW (ev_dscwindow));
+       if (num_monitors == 2) {
+               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 (presentation_window)->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_window_run_presentation (ev_dscwindow->priv->presentation_window);
+               ev_dscwindow->priv->moveback_monitor = work_monitor;
+
+               gtk_window_maximize (GTK_WINDOW (ev_dscwindow));
+       }
+}
+
+
+/**
+ * ev_dscwindow_set_presentation: Set presentation document
+ * @presentation_window: Main window we can reuse for presentation
+ **/
+void
+ev_dscwindow_set_presentation (EvDSCWindow *ev_dscwindow,
+       EvWindow *presentation_window)
+{
+       if (!EV_IS_WINDOW (presentation_window))
+               return;
+
+       ev_dscwindow->priv->presentation_window = presentation_window;
+       ev_dscwindow->priv->presentation_document = document;
+
+       ev_document_model_set_document(ev_dscwindow->priv->model,
+               presentation_window->priv->document);
+/*     ev_view_set_document (EV_VIEW (priv->notesview),
+               priv->presentation_document);
+       ev_dscwindow_window_placement (self);
+       ev_dscwindow_handle_resized (NULL, NULL, self);
+       */
+}
 
 /**
  * ev_dscwindow_end: Stop presentation mode.
@@ -169,8 +218,6 @@ ev_dscwindow_end (GtkWidget *widget, GdkEvent *event)
        return TRUE;
 }
 
-
-
 /**
 * ev_dscwindow_init: Initialize multihead presentation
 *