#include "ev-sidebar-thumbnails.h"
struct _EvDSCWindowPrivate {
- GtkWidget *main_box;
- GtkWidget *menubar;
- GtkWidget *sidebar;
- GtkWidget *notesview;
+ GtkWidget *main_box;
+ GtkWidget *menubar;
+ GtkWidget *sidebar;
+ GtkWidget *notesview;
EvDocumentModel *model;
- EvDocument * notesdocument;
+ EvDocumentModel *notes_model;
+ EvDocument *presentation_document;
+ EvDocument *notes_document;
+ GtkWidget *presentation_window;
+ GtkWidget *overview_scrolled_window;
GtkWidget *notesview_scrolled_window;
- GtkWidget *presentation_window;
EvViewPresentation *presentation_view;
- EvDocument * presentation_document;
- gint moveback_monitor;
+ gint moveback_monitor;
};
#define EV_DSCWINDOW_GET_PRIVATE(object) \
#define PAGE_CACHE_SIZE 52428800 /* 50MB */
#define SIDEBAR_DEFAULT_SIZE 132
-/*static gpointer parent_class = NULL;*/
G_DEFINE_TYPE (EvDSCWindow, ev_dscwindow, GTK_TYPE_WINDOW)
* @self: EvDSCWindow
**/
static gboolean
-ev_dscwindow_switch_monitors (GtkWidget *widget, EvDSCWindow *self)
+ev_dscwindow_switch_monitors (GtkWidget *widget, EvDSCWindow *ev_dscwindow)
{
-/*
-+ if (!EV_IS_DSCWINDOW (self))
-+ return FALSE;
-+
-+ EvDSCWindowPrivate *priv = EV_DSCWINDOW_GET_PRIVATE (self);
-+
-+ gint num_monitors = get_num_monitors (GTK_WINDOW (self));
-+
-+ if (num_monitors == 2) {
-+ GtkWindow * presentation_window = GTK_WINDOW (priv->presentation_window);
-+ GdkScreen * screen = gtk_window_get_screen (presentation_window);
-+
-+ gint monitor_1 = gdk_screen_get_monitor_at_window (screen,
-+ GTK_WIDGET (presentation_window)->window);
-+
-+ gint monitor_2 = (monitor_1 + 1) % 2;
-+
-+ GdkRectangle coords;
-+ gdk_screen_get_monitor_geometry (screen, monitor_2, &coords);
-+ ev_window_stop_presentation (priv->presentation_window);
-+ gtk_window_move (presentation_window, coords.x, coords.y);
-+ ev_window_run_presentation (priv->presentation_window);
-+ priv->moveback_monitor = monitor_1;
-+
-+ gdk_screen_get_monitor_geometry (screen, monitor_1, &coords);
-+ gtk_window_unmaximize (GTK_WINDOW (self));
-+ gtk_window_move (GTK_WINDOW (self), coords.x, coords.y);
-+ gtk_window_maximize (GTK_WINDOW (self));
-+ }*/
+
+ if (!EV_IS_DSCWINDOW (ev_dscwindow))
+ return FALSE;
+
+ 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 monitor_1 = gdk_screen_get_monitor_at_window (screen,
+ gtk_widget_get_window (GTK_WIDGET (presentation_window)));
+
+ gint monitor_2 = (monitor_1 + 1) % 2;
+
+ GdkRectangle coords;
+ gdk_screen_get_monitor_geometry (screen, monitor_2, &coords);
+ gtk_window_move (presentation_window, coords.x, coords.y);
+ ev_dscwindow->priv->moveback_monitor = monitor_1;
+
+ gdk_screen_get_monitor_geometry (screen, monitor_1, &coords);
+ gtk_window_unmaximize (GTK_WINDOW (ev_dscwindow));
+ gtk_window_move (GTK_WINDOW (ev_dscwindow), coords.x, coords.y);
+ gtk_window_maximize (GTK_WINDOW (ev_dscwindow));
+ }
return TRUE;
}
{
ev_dscwindow->priv = EV_DSCWINDOW_GET_PRIVATE (ev_dscwindow);
ev_dscwindow->priv->moveback_monitor = -1;
- ev_dscwindow->priv->notesdocument = NULL;
+ ev_dscwindow->priv->notes_document = NULL;
gtk_window_set_title (GTK_WINDOW (ev_dscwindow), _("Presentation Control"));
GtkWidget *sidebar_widget;
sidebar_widget = ev_sidebar_thumbnails_new ();
- /*g_signal_connect (sidebar_widget,
- "notify::main-widget",
- G_CALLBACK (sidebar_page_main_widget_update_cb),
- ev_window);
- sidebar_page_main_widget_update_cb (G_OBJECT (sidebar_widget), NULL, ev_window);*/
+
gtk_widget_show (sidebar_widget);
ev_sidebar_add_page (EV_SIDEBAR (ev_dscwindow->priv->sidebar),
sidebar_widget);