]> www.fi.muni.cz Git - evince.git/commitdiff
working with signals
authorLukáš Bezdička <255993@mail.muni.cz>
Sun, 10 Apr 2011 15:15:14 +0000 (17:15 +0200)
committerJan "Yenya" Kasprzak <kas@fi.muni.cz>
Wed, 1 Jun 2011 11:09:21 +0000 (13:09 +0200)
libview/ev-view-presentation.c
libview/ev-view-presentation.h
shell/ev-dualscreen.c
shell/ev-dualscreen.h
shell/ev-window.c

index bbbfd4f9435737518b17078540e6e8cf4bf6e035..6ee168beff4fd6679e24ccf7e65e5eb00fea8926 100644 (file)
@@ -30,7 +30,6 @@
 #include "ev-transition-animation.h"
 #include "ev-view-cursor.h"
 #include "ev-page-cache.h"
-#include "ev-view-marshal.h"
 
 enum {
        PROP_0,
@@ -99,9 +98,8 @@ struct _EvViewPresentationClass
        GtkWidgetClass base_class;
 
        /* signals */
-       void (* page_changed) (EvViewPresentation   *pview,
-                                                  gint                  old_page,
-                                          gint                  new_page);
+       void (* page_changed)  (EvViewPresentation *pview,
+                               gint                page);
        void (* change_page)   (EvViewPresentation *pview,
                                 GtkScrollType       scroll);
        void (* finished)      (EvViewPresentation *pview);
@@ -493,8 +491,8 @@ ev_view_presentation_update_current_page (EvViewPresentation *pview,
                }
        }
 
-       g_signal_emit (pview, signals[PAGE_CHANGED], 0, pview->current_page);
-
+       g_signal_emit (pview, signals[PAGE_CHANGED], 0, page);
+       g_printf("pages: %d %d\n",page,pview->current_page;
        pview->current_page = page;
 
        if (pview->page_cache)
index e15892435685c47a59b7b9f12b7954e932f873c8..14a45f05d41a8471cab980b0a8510f8dcd9e7fbe 100644 (file)
@@ -45,8 +45,8 @@ GtkWidget      *ev_view_presentation_new            (EvDocument         *document,
                                                       guint               rotation,
                                                       gboolean            inverted_colors);
 guint           ev_view_presentation_get_current_page (EvViewPresentation *pview);
-void                   ev_view_presentation_set_page             (EvViewPresentation *pview,
-                                                                          gint                            new_page);
+void           ev_view_presentation_set_page         (EvViewPresentation *pview,
+                                                      gint                new_page);
 void            ev_view_presentation_next_page        (EvViewPresentation *pview);
 void            ev_view_presentation_previous_page    (EvViewPresentation *pview);
 void            ev_view_presentation_set_rotation     (EvViewPresentation *pview,
index cdeb4aeaeef7af3d57978b7340a1f7f5430a2796..bb3c89e7d9f2aca01f06faa1a1e43b341d1b0eef 100644 (file)
@@ -44,7 +44,7 @@ struct _EvDSCWindowPrivate {
        GtkWidget *notesview_scrolled_window;
        GtkWidget *presentation_window;
 
-       EvView *presentation_view;
+       EvViewPresentation *presentation_view;
        EvDocument * presentation_document;
        gint moveback_monitor;
 };
@@ -216,14 +216,14 @@ ev_dscwindow_presentation_page_changed_cb (EvDocumentModel *model,
  **/
 void
 ev_dscwindow_set_presentation (EvDSCWindow *ev_dscwindow,
-       EvWindow *presentation_window, EvDocument *document, GtkWidget *pview)
+       EvWindow *presentation_window, EvDocument *document, EvViewPresentation *pview)
 {
        if (!EV_IS_WINDOW (presentation_window))
                return;
 
-       ev_dscwindow->priv->presentation_window = presentation_window;
+       ev_dscwindow->priv->presentation_window = GTK_WIDGET(presentation_window);
        ev_dscwindow->priv->presentation_document = document;
-       ev_dscwindow->priv->presentation_view = pview;
+       ev_dscwindow->priv->presentation_view = EV_VIEW_PRESENTATION(pview);
        g_signal_connect (ev_dscwindow->priv->presentation_view,
                          "notify::page",
                          G_CALLBACK (ev_dscwindow_presentation_page_changed_cb),
@@ -362,14 +362,14 @@ ev_dscwindow_dispose (GObject *obj)
 //             ev_document_model_set_document (priv->model, NULL);
 
 //             ev_view_set_document (EV_VIEW (priv->overview),  NULL);
-               g_object_unref (priv->overview);
+//             g_object_unref (priv->overview);
 //     }
 //     if (EV_IS_VIEW (priv->notesview)) {
 //             ev_view_set_document (EV_VIEW (priv->notesview), NULL);
 //             g_object_unref (priv->notesview);
 //     }
 /*TODO: save fulscreen state*/
-       ev_window_stop_presentation (priv->presentation_window, 0);
+       ev_window_stop_presentation (EV_WINDOW(priv->presentation_window), 0);
 
        if (priv->moveback_monitor >= 0) {
                GtkWindow * presentation_window = GTK_WINDOW (priv->presentation_window);
index 790e161e453e2b43d807ddb2c2e39d5c5d8793ba..6db456aec28f5960b3d301f868f6d628a53dbbdb 100644 (file)
@@ -26,6 +26,7 @@
 #include "ev-window.h"
 #include "ev-document.h"*/
 #include "ev-window.h"
+#include "ev-view-presentation.h"
 
 G_BEGIN_DECLS
 
@@ -51,10 +52,10 @@ struct _EvDSCWindowClass {
 
 GType          ev_dscwindow_get_type   (void);
 GtkWidget      *ev_dscwindow_new (void);
-void           ev_dscwindow_set_presentation (EvDSCWindow      *ev_dscwindow,
-                                               EvWindow        *presentation_window,
-                                               EvDocument      *document,
-                                               GtkWidget       *pview);
+void           ev_dscwindow_set_presentation (EvDSCWindow              *ev_dscwindow,
+                                               EvWindow                *presentation_window,
+                                               EvDocument              *document,
+                                               EvViewPresentation      *pview);
 EvDSCWindow*    ev_dscwindow_get_control (void);
 
 G_END_DECLS
index dd9d1167af06e42dae71d871ecdb24d192fd944b..5acc5422bd41b0842f7849b06849925209a8e64a 100644 (file)
@@ -4057,7 +4057,7 @@ ev_window_run_presentation (EvWindow *window)
        EvDSCWindow *control = ev_dscwindow_get_control();
        ev_dscwindow_set_presentation   (control, window,
                                         window->priv->document,
-                                        window->priv->presentation_view);
+                                        EV_VIEW_PRESENTATION(window->priv->presentation_view));
        gtk_window_present (GTK_WINDOW (control));
        //}
 }