From d1f4707aad8a1ecad412295d2ccd3f7aa87b95b0 Mon Sep 17 00:00:00 2001 From: Oz Tiram Date: Fri, 7 Feb 2020 21:57:10 +0100 Subject: Make synctex optional Not everyone who reads PDF's is necessarily a LaTeX user. These changes allow users to install atril without the huge bagage of tex-live on systems where synctex isn't provided as a stand alone library. --- libview/ev-view.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'libview') diff --git a/libview/ev-view.c b/libview/ev-view.c index a195ba21..e98582d3 100644 --- a/libview/ev-view.c +++ b/libview/ev-view.c @@ -3210,6 +3210,7 @@ ev_view_remove_annotation (EvView *view, g_object_unref (annot); } +#ifdef ENABLE_SYNCTEX static gboolean ev_view_synctex_backward_search (EvView *view, gdouble x, @@ -3235,6 +3236,7 @@ ev_view_synctex_backward_search (EvView *view, return FALSE; } +#endif /* Caret navigation */ #define CURSOR_ON_MULTIPLIER 2 @@ -4078,8 +4080,10 @@ ev_view_draw (GtkWidget *widget, show_annotation_windows (view, i); if (page_ready && view->focused_element) draw_focus (view, cr, i, &clip_rect); +#ifdef ENABLE_SYNCTEX if (page_ready && view->synctex_result) highlight_forward_search_results (view, cr, i); +#endif } if (GTK_WIDGET_CLASS (ev_view_parent_class)->draw) @@ -4472,9 +4476,10 @@ ev_view_button_press_event (GtkWidget *widget, EvFormField *field; EvMapping *link; gint page; - +#ifdef ENABLE_SYNCTEX if (event->state & GDK_CONTROL_MASK) return ev_view_synctex_backward_search (view, event->x , event->y); +#endif if (EV_IS_SELECTION (view->document) && view->selection_info.selections) { if (event->type == GDK_3BUTTON_PRESS) { @@ -7522,6 +7527,7 @@ ev_view_find_cancel (EvView *view) view->find_pages = NULL; } +#ifdef ENABLE_SYNCTEX /*** Synctex ***/ void ev_view_highlight_forward_search (EvView *view, @@ -7549,6 +7555,7 @@ ev_view_highlight_forward_search (EvView *view, ensure_rectangle_is_visible (view, &view_rect); gtk_widget_queue_draw (GTK_WIDGET (view)); } +#endif /* ENABLE_SYNCTEX */ /*** Selections ***/ static gboolean -- cgit v1.2.1