enum {
CHANGE_PAGE,
+ FINISHED,
N_SIGNALS
};
/* signals */
void (* change_page) (EvViewPresentation *pview,
GtkScrollType scroll);
+ void (* finished) (EvViewPresentation *pview);
};
static guint signals[N_SIGNALS] = { 0 };
PangoFontDescription *font_desc;
gchar *markup;
GdkRectangle area = {0};
- const gchar *text = _("End of presentation. Press Escape to exit.");
+ const gchar *text = _("End of presentation. Click to exit.");
if (pview->state != EV_PRESENTATION_END)
return;
case 1: {
EvLink *link;
+ if (pview->state == EV_PRESENTATION_END) {
+ g_signal_emit (pview, signals[FINISHED], 0, NULL);
+
+ return FALSE;
+ }
+
link = ev_view_presentation_get_link_at_location (pview,
event->x,
event->y);
g_cclosure_marshal_VOID__ENUM,
G_TYPE_NONE, 1,
GTK_TYPE_SCROLL_TYPE);
+ signals[FINISHED] =
+ g_signal_new ("finished",
+ G_OBJECT_CLASS_TYPE (gobject_class),
+ G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
+ G_STRUCT_OFFSET (EvViewPresentationClass, finished),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0,
+ G_TYPE_NONE);
binding_set = gtk_binding_set_by_class (klass);
add_change_page_binding_keypad (binding_set, GDK_Left, 0, GTK_SCROLL_PAGE_BACKWARD);
(action, G_CALLBACK (ev_window_cmd_view_presentation), window);
}
+static void
+ev_window_view_presentation_finished (EvWindow *window)
+{
+ ev_window_stop_presentation (window, TRUE);
+}
+
static void
ev_window_run_presentation (EvWindow *window)
{
rotation = ev_document_model_get_rotation (window->priv->model);
window->priv->presentation_view =
ev_view_presentation_new (window->priv->document, current_page, rotation);
+ g_signal_connect_swapped (window->priv->presentation_view, "finished",
+ G_CALLBACK (ev_window_view_presentation_finished),
+ window);
gtk_box_pack_start (GTK_BOX (window->priv->main_box),
window->priv->presentation_view,