]> www.fi.muni.cz Git - evince.git/commitdiff
[dualscreen] [presentation] make presentation control dscwindow, presentation ->...
authorLukas Bezdicka <255993@mail.muni.cz>
Sun, 10 Apr 2011 20:53:45 +0000 (22:53 +0200)
committerJan "Yenya" Kasprzak <kas@fi.muni.cz>
Wed, 1 Jun 2011 11:09:21 +0000 (13:09 +0200)
libview/ev-view-presentation.c
shell/ev-dualscreen.c

index 49c9c976185da139b051849b87e18399dd6511c5..3612904ae025cd539d3d5edb2b094cb3a414b739 100644 (file)
@@ -37,6 +37,7 @@ enum {
        PROP_0,
        PROP_DOCUMENT,
        PROP_CURRENT_PAGE,
+       PROP_PAGE,
        PROP_ROTATION,
        PROP_INVERTED_COLORS
 };
@@ -491,7 +492,7 @@ ev_view_presentation_update_current_page (EvViewPresentation *pview,
        }
 
        pview->current_page = page;
-       g_object_notify (G_OBJECT(pview), "current_page");
+       g_object_notify (G_OBJECT(pview), "page");
 
        if (pview->page_cache)
                ev_page_cache_set_page_range (pview->page_cache, page, page);
@@ -1368,6 +1369,9 @@ ev_view_presentation_set_property (GObject      *object,
        case PROP_CURRENT_PAGE:
                pview->current_page = g_value_get_uint (value);
                break;
+       case PROP_PAGE:
+               pview->current_page = g_value_get_uint (value);
+               break;
        case PROP_ROTATION:
                 ev_view_presentation_set_rotation (pview, g_value_get_uint (value));
                break;
@@ -1388,7 +1392,7 @@ ev_view_presentation_get_property (GObject    *object,
         EvViewPresentation *pview = EV_VIEW_PRESENTATION (object);
 
         switch (prop_id) {
-               case PROP_CURRENT_PAGE:
+               case PROP_PAGE:
                                g_value_set_uint (value, ev_view_presentation_get_current_page (pview));
                                break;
         case PROP_ROTATION:
@@ -1455,13 +1459,21 @@ ev_view_presentation_class_init (EvViewPresentationClass *klass)
                                                              EV_TYPE_DOCUMENT,
                                                              G_PARAM_WRITABLE |
                                                              G_PARAM_CONSTRUCT_ONLY));
+       g_object_class_install_property (gobject_class,
+                                        PROP_PAGE,
+                                        g_param_spec_uint ("page",
+                                                           "Current Page",
+                                                           "The current page",
+                                                           0, G_MAXUINT, 0,
+                                                               G_PARAM_READWRITE));
        g_object_class_install_property (gobject_class,
                                         PROP_CURRENT_PAGE,
                                         g_param_spec_uint ("current_page",
                                                            "Current Page",
                                                            "The current page",
                                                            0, G_MAXUINT, 0,
-                                                           G_PARAM_READWRITE));
+                                                               G_PARAM_WRITABLE |
+                                                           G_PARAM_CONSTRUCT_ONLY));
        g_object_class_install_property (gobject_class,
                                         PROP_ROTATION,
                                         g_param_spec_uint ("rotation",
index 66b08e167accff92b09463895d501070aab827ff..fdec315fe016aa5610a40df1a2486bf91c4a1a9c 100644 (file)
@@ -170,7 +170,6 @@ static void
 ev_dscwindow_window_placement (EvDSCWindow *ev_dscwindow)
 {
        gint num_monitors = get_num_monitors (GTK_WINDOW (ev_dscwindow));
-       g_printf ("num_monitors: %d \n",num_monitors);
        //if (num_monitors == 2) {
                GtkWindow * presentation_window = GTK_WINDOW (ev_dscwindow->priv->presentation_window);
                GdkScreen * screen = gtk_window_get_screen (presentation_window);
@@ -197,7 +196,6 @@ ev_dscwindow_page_changed_cb (EvDocumentModel *model,
                           EvDSCWindow     *ev_dscwindow)
 {
        gint page = ev_document_model_get_page (model);
-       g_printf("m_page:%d\n",page);
        if(page != ev_view_presentation_get_current_page (ev_dscwindow->priv->presentation_view))
                ev_view_presentation_set_page (EV_VIEW_PRESENTATION(ev_dscwindow->priv->presentation_view), page);
 }
@@ -207,7 +205,6 @@ ev_dscwindow_presentation_page_changed_cb (EvViewPresentation *pview,
                           EvDSCWindow     *ev_dscwindow)
 {
        gint page = ev_view_presentation_get_current_page (pview);
-       g_printf("p_page:%d\n",page);
        ev_document_model_set_page (ev_dscwindow->priv->model, page);
 }
 
@@ -227,8 +224,8 @@ ev_dscwindow_set_presentation (EvDSCWindow *ev_dscwindow,
        ev_dscwindow->priv->presentation_view = EV_VIEW_PRESENTATION(pview);
        ev_document_model_set_document(ev_dscwindow->priv->model,
                document);
-       g_signal_connect (ev_dscwindow->priv->presentation_view,
-                         "notify::current_page",
+       g_signal_connect (G_OBJECT(ev_dscwindow->priv->presentation_view),
+                         "notify::page",
                          G_CALLBACK (ev_dscwindow_presentation_page_changed_cb),
                          ev_dscwindow);
        ev_dscwindow_window_placement (ev_dscwindow);
@@ -264,7 +261,7 @@ ev_dscwindow_init (EvDSCWindow *ev_dscwindow)
        GtkWidget *v = gtk_vbox_new (FALSE, 0);
 
        ev_dscwindow->priv->model = ev_document_model_new ();
-       g_signal_connect (ev_dscwindow->priv->model,
+       g_signal_connect (G_OBJECT(ev_dscwindow->priv->model),
                          "notify::page",
                          G_CALLBACK (ev_dscwindow_page_changed_cb),
                          ev_dscwindow);