From efec6a4b614de84b8639977f278159aa28c38994 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Luk=C3=A1=C5=A1=20Bezdi=C4=8Dka?= <255993@mail.muni.cz> Date: Sun, 10 Apr 2011 17:15:14 +0200 Subject: [PATCH] working with signals --- libview/ev-view-presentation.c | 10 ++++------ libview/ev-view-presentation.h | 4 ++-- shell/ev-dualscreen.c | 12 ++++++------ shell/ev-dualscreen.h | 9 +++++---- shell/ev-window.c | 2 +- 5 files changed, 18 insertions(+), 19 deletions(-) diff --git a/libview/ev-view-presentation.c b/libview/ev-view-presentation.c index bbbfd4f9..6ee168be 100644 --- a/libview/ev-view-presentation.c +++ b/libview/ev-view-presentation.c @@ -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) diff --git a/libview/ev-view-presentation.h b/libview/ev-view-presentation.h index e1589243..14a45f05 100644 --- a/libview/ev-view-presentation.h +++ b/libview/ev-view-presentation.h @@ -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, diff --git a/shell/ev-dualscreen.c b/shell/ev-dualscreen.c index cdeb4aea..bb3c89e7 100644 --- a/shell/ev-dualscreen.c +++ b/shell/ev-dualscreen.c @@ -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); diff --git a/shell/ev-dualscreen.h b/shell/ev-dualscreen.h index 790e161e..6db456ae 100644 --- a/shell/ev-dualscreen.h +++ b/shell/ev-dualscreen.h @@ -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 diff --git a/shell/ev-window.c b/shell/ev-window.c index dd9d1167..5acc5422 100644 --- a/shell/ev-window.c +++ b/shell/ev-window.c @@ -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)); //} } -- 2.39.3