From d3bc7b9497f6205eaa0c6dece068caff6411ce8c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Luk=C3=A1=C5=A1=20Bezdi=C4=8Dka?= <255993@mail.muni.cz> Date: Sun, 24 Apr 2011 16:05:53 +0200 Subject: [PATCH] [dualscreen] licence fix --- shell/Makefile.am | 4 ++- shell/ev-dualscreen.c | 59 +++++++++++-------------------------------- shell/ev-dualscreen.h | 5 ++++ shell/ev-window.c | 3 +-- 4 files changed, 24 insertions(+), 47 deletions(-) diff --git a/shell/Makefile.am b/shell/Makefile.am index 99b81571..008037e4 100644 --- a/shell/Makefile.am +++ b/shell/Makefile.am @@ -96,7 +96,9 @@ evince_SOURCES= \ if ENABLE_DBUS evince_SOURCES += \ ev-media-player-keys.c \ - ev-media-player-keys.h + ev-media-player-keys.h \ + ev-presentation-timer.h \ + ev-presentation-timer.c endif diff --git a/shell/ev-dualscreen.c b/shell/ev-dualscreen.c index 98e9322c..f5dc1cb9 100644 --- a/shell/ev-dualscreen.c +++ b/shell/ev-dualscreen.c @@ -190,39 +190,18 @@ ev_dscwindow_get_control (void) 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_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)); - } -} - -static gboolean -ev_dscwindow_notes_clicked (GtkWidget *widget, GdkEvent *event, - EvDSCWindow *self) -{ - if (!self || !EV_IS_DSCWINDOW (self) || !event) - return FALSE; - gint page = ev_document_model_get_page (self->priv->model); - - if (event->type == GDK_2BUTTON_PRESS && ((GdkEventButton *)event)->button == 1) { - ev_dscwindow_notes_interaction (NULL, self); - } else if (event->type == GDK_BUTTON_PRESS && ((GdkEventButton *)event)->button == 1) { - ev_document_model_set_page (self->priv->model, page+1); - } else if (event->type == GDK_BUTTON_PRESS && ((GdkEventButton *)event)->button == 3) { - ev_document_model_set_page (self->priv->model, page-1); - } - return FALSE; + 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)); } void @@ -235,8 +214,10 @@ ev_dscwindow_set_presentation (EvDSCWindow *ev_dscwindow, ev_dscwindow->priv->presentation_window = GTK_WIDGET(presentation_window); ev_dscwindow->priv->presentation_document = document; ev_dscwindow->priv->presentation_view = EV_VIEW_PRESENTATION(pview); + ev_document_model_set_document(ev_dscwindow->priv->model, document); ev_document_model_set_page(ev_dscwindow->priv->model, ev_view_presentation_get_current_page (pview)); + /*signals*/ g_signal_connect_swapped (ev_dscwindow->priv->presentation_view, "destroy", G_CALLBACK (gtk_widget_destroy), @@ -249,6 +230,7 @@ ev_dscwindow_set_presentation (EvDSCWindow *ev_dscwindow, "notify::page", G_CALLBACK (ev_dscwindow_presentation_page_changed_cb), ev_dscwindow); + ev_dscwindow_window_placement (ev_dscwindow); } @@ -333,20 +315,10 @@ ev_dscwindow_init (EvDSCWindow *ev_dscwindow) gtk_container_add (GTK_CONTAINER (expander), toolbar); gtk_box_pack_end (GTK_BOX (vbox), expander, FALSE, TRUE, 0); -// gtk_drag_dest_unset (GTK_WIDGET (ev_dscwindow->priv->notesview)); -// gtk_drag_dest_unset (GTK_WIDGET (ev_dscwindow->priv->sidebar)); - -// gint click = GDK_BUTTON1_MOTION_MASK | GDK_KEY_PRESS_MASK; -// gtk_widget_add_events (GTK_WIDGET (ev_dscwindow->priv->sidebar), click); - /* TODO: actions, this part is broken...*/ - /*g_signal_connect (ev_dscwindow->priv->notesview, "button-press-event", - G_CALLBACK (ev_dscwindow_notes_clicked), ev_dscwindow);*/ - gtk_widget_show_all(vbox); gtk_container_add (GTK_CONTAINER (ev_dscwindow), vbox); } - static void ev_dscwindow_dispose (GObject *obj) { @@ -369,7 +341,6 @@ ev_dscwindow_dispose (GObject *obj) priv->overview = NULL; }*/ - G_OBJECT_CLASS (ev_dscwindow_parent_class)->dispose (obj); } diff --git a/shell/ev-dualscreen.h b/shell/ev-dualscreen.h index 35699876..9cd2355d 100644 --- a/shell/ev-dualscreen.h +++ b/shell/ev-dualscreen.h @@ -1,6 +1,11 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; c-indent-level: 8 -*- */ /* this file is part of evince, a gnome document viewer * + * Copyright (C) 2007 Johannes Buchner + * + * Author: + * Johannes Buchner + * Lukas Bezdicka <255993@mail.muni.cz> * * Evince is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by diff --git a/shell/ev-window.c b/shell/ev-window.c index da4c58ff..799f64d6 100644 --- a/shell/ev-window.c +++ b/shell/ev-window.c @@ -4055,11 +4055,10 @@ ev_window_run_presentation (EvWindow *window) // if ( get_num_monitors(GTK_WINDOW(window)) > 1) { EvDSCWindow *control = ev_dscwindow_get_control(); - + gtk_window_present (GTK_WINDOW (control)); ev_dscwindow_set_presentation (control, window, window->priv->document, EV_VIEW_PRESENTATION(window->priv->presentation_view)); - gtk_window_present (GTK_WINDOW (control)); // } } -- 2.39.3