From: Lukáš Bezdička <255993@mail.muni.cz> Date: Tue, 5 Apr 2011 11:42:13 +0000 (+0200) Subject: [shell] dualscreen first set of compile fixes X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?p=evince.git;a=commitdiff_plain;h=b834124afbc9c4f8044a9712b356533c6cd5d31a [shell] dualscreen first set of compile fixes --- diff --git a/shell/ev-dualscreen.c b/shell/ev-dualscreen.c index 0f94912e..8fc6953a 100644 --- a/shell/ev-dualscreen.c +++ b/shell/ev-dualscreen.c @@ -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 *