]> www.fi.muni.cz Git - evince.git/commitdiff
[shell] dualscreen first set of compile fixes
authorLukáš Bezdička <255993@mail.muni.cz>
Tue, 5 Apr 2011 11:42:13 +0000 (13:42 +0200)
committerJan "Yenya" Kasprzak <kas@fi.muni.cz>
Wed, 1 Jun 2011 11:09:20 +0000 (13:09 +0200)
shell/ev-dualscreen.c

index 0f94912e7d9f2bcc918326d711a3315765ac1122..8fc6953a2c5a4d55b6244792fe31588fecdf42da 100644 (file)
@@ -42,7 +42,7 @@ struct _EvDSCWindowPrivate {
        EvWindow *presentation_window;
        EvDocument * presentation_document;
        gint moveback_monitor;
-} EvDSCWindowPrivate;
+};
 
 #define EV_DSCWINDOW_GET_PRIVATE(object) \
        (G_TYPE_INSTANCE_GET_PRIVATE ((object), EV_TYPE_DSCWINDOW, EvDSCWindowPrivate))
@@ -140,6 +140,25 @@ ev_dscwindow_notes_interaction (GtkContainer *container, EvDSCWindow *self)
        return TRUE;
 }
 
+/**
+ * ev_dscwindow_get_control: Get the control instance.
+ *
+ * If there is none, create one.
+ *
+ * Returns: control instance
+ **/
+EvDSCWindow *
+ev_dscwindow_get_control (void)
+{
+       static EvDSCWindow * control = NULL;
+
+       if (!control || !EV_IS_DSCWINDOW (control)) {
+               control = EV_DSCWINDOW (g_object_new (EV_TYPE_DSCWINDOW, NULL));
+       }
+
+       return control;
+}
+
 /**
  * ev_dscwindow_end: Stop presentation mode.
  */
@@ -166,14 +185,14 @@ ev_dscwindow_init (EvDSCWindow *ev_dscwindow)
        ev_dscwindow->priv->moveback_monitor = -1;
        ev_dscwindow->priv->notesdocument = NULL;
 
-       gtk_window_set_title (GTK_WINDOW (self), _("Presentation Control"));
+       gtk_window_set_title (GTK_WINDOW (ev_dscwindow), _("Presentation Control"));
 
        GtkWidget *h = gtk_hpaned_new ();
        GtkWidget *v = gtk_vbox_new (FALSE, 0);
 
        ev_dscwindow->priv->overview_scrolled_window = GTK_WIDGET (g_object_new (
                        GTK_TYPE_SCROLLED_WINDOW, "shadow-type", GTK_SHADOW_IN, NULL));
-       gtk_box_pack_start_defaults (GTK_BOX (v), priv->overview_scrolled_window);
+       gtk_box_pack_start_defaults (GTK_BOX (v), ev_dscwindow->priv->overview_scrolled_window);
 
        ev_dscwindow->priv->model = ev_document_model_new ();
        ev_dscwindow->priv->overview = ev_view_new ();
@@ -260,7 +279,7 @@ ev_dscwindow_init (EvDSCWindow *ev_dscwindow)
 static void
 ev_dscwindow_dispose (GObject *obj)
 {
-       EvDSCWindow * self = EV_DSCWINDOW (obj);
+       EvDSCWindow * ev_dscwindow = EV_DSCWINDOW (obj);
        EvDSCWindowPrivate *priv = ev_dscwindow->priv;
 
 /*     if (EV_IS_VIEW (priv->overview) {
@@ -293,11 +312,10 @@ ev_dscwindow_dispose (GObject *obj)
 static void
 ev_dscwindow_class_init (EvDSCWindowClass * klass)
 {
-/*     GObjectClass *g_object_class = G_OBJECT_CLASS (klass);
- *     parent_class = g_type_class_peek_parent (klass);
- *     g_type_class_add_private (klass, sizeof (EvDSCWindowPrivate));
- *     g_object_class->dispose  = ev_dscwindow_dispose;
- */
+       GObjectClass *g_object_class = G_OBJECT_CLASS (klass);
+       parent_class = g_type_class_peek_parent (klass);
+       g_type_class_add_private (klass, sizeof (EvDSCWindowPrivate));
+       g_object_class->dispose  = ev_dscwindow_dispose;
 }
 
 GtkWidget *