Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 654043 Details for
Bug 736647
app-text/atril: make synctex (tex dependency) optional
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to make synctex support optional
atril-1.24.0-make-synctex-optional.patch (text/plain), 13.77 KB, created by
Grant Edwards
on 2020-08-10 15:49:40 UTC
(
hide
)
Description:
Patch to make synctex support optional
Filename:
MIME Type:
Creator:
Grant Edwards
Created:
2020-08-10 15:49:40 UTC
Size:
13.77 KB
patch
obsolete
>diff -r -U10 atril-1.24.0-orig/configure.ac atril-1.24.0/configure.ac >--- atril-1.24.0-orig/configure.ac 2020-02-10 04:39:56.000000000 -0600 >+++ atril-1.24.0/configure.ac 2020-08-10 10:06:51.293766385 -0500 >@@ -354,29 +354,39 @@ > > AC_SUBST([G_IR_SCANNER]) > AC_SUBST([G_IR_COMPILER]) > AC_SUBST([G_IR_GENERATE]) > AC_SUBST([GIRDIR]) > AC_SUBST([GIRTYPELIBDIR]) > > AM_CONDITIONAL([ENABLE_INTROSPECTION],[test "$enable_introspection" = "yes"]) > > dnl ================== libsynctex =========================================== >+AC_ARG_ENABLE([synctex], >+ [AS_HELP_STRING([--disable-synctex], [Disable support for synctex])], >+ [], >+ [enable_synctex=yes]) >+ >+ >+if test "$enable_synctex" = "yes"; then >+ AC_DEFINE([ENABLE_SYNCTEX],[1],[Define if synctex support is enabled]) >+ PKG_CHECK_MODULES(SYNCTEX, [synctex >= $SYNCTEX_REQUIRED], has_synctex=yes, has_synctex=no) >+ dnl not found? use internal code copy. >+ if test "x$has_synctex" = "xno"; then >+ AC_MSG_ERROR("SyncTeX support is disabled since library version $SYNCTEX_REQUIRED or newer not found") >+ fi >+ AC_SUBST(SYNCTEX_LIBS) >+ AC_SUBST(SYNCTEX_CFLAGS) >+fi > >-PKG_CHECK_MODULES(SYNCTEX, [synctex >= $SYNCTEX_REQUIRED], has_synctex=yes, has_synctex=no) >+AM_CONDITIONAL([ENABLE_SYNCTEX], [test "$enable_synctex" = "yes"]) > >-dnl not found? use internal code copy. >-if test "x$has_synctex" = "xno"; then >- AC_MSG_ERROR("SyncTeX support is disabled since library version $SYNCTEX_REQUIRED or newer not found") >-fi >-AC_SUBST(SYNCTEX_LIBS) >-AC_SUBST(SYNCTEX_CFLAGS) > > dnl ================== portability checks =========================================== > > dnl for backtrace() > AC_CHECK_HEADERS([execinfo.h]) > > AC_CHECK_DECL([_NL_MEASUREMENT_MEASUREMENT],[ > AC_DEFINE([HAVE__NL_MEASUREMENT_MEASUREMENT],[1],[Define if _NL_MEASUREMENT_MEASUREMENT is available]) > ],[],[#include <langinfo.h>]) > >@@ -763,21 +773,20 @@ > DBUS Support........: $enable_dbus > Caja Plugin.........: $enable_caja > Thumbnailer.........: $enable_thumbnailer > Previewer...........: $enable_previewer > Gtk-Doc Support.....: $enable_gtk_doc > Debug mode..........: $enable_debug > GObj. Introspection.: $enable_introspection > Tests...............: $enable_tests > > PDF Backend.........: $enable_pdf >+ Synctex enabled.....: $enable_synctex > PostScript Backend..: $enable_ps > TIFF Backend........: $enable_tiff > DJVU Backend........: $enable_djvu > DVI Backend.........: $enable_dvi > Pixbuf Backend......: $enable_pixbuf > Comics Backend......: $enable_comics > XPS Backend.........: $enable_xps > ePub Backend........: $have_webkit >- >- SyncTeX.............: $has_synctex > " >diff -r -U10 atril-1.24.0-orig/libdocument/ev-document.c atril-1.24.0/libdocument/ev-document.c >--- atril-1.24.0-orig/libdocument/ev-document.c 2020-02-10 04:39:56.000000000 -0600 >+++ atril-1.24.0/libdocument/ev-document.c 2020-08-10 10:08:56.505053350 -0500 >@@ -18,21 +18,23 @@ > * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. > * > */ > > #include "config.h" > > #include <stdlib.h> > #include <string.h> > > #include "ev-document.h" >+#ifdef ENABLE_SYNCTEX > #include "synctex_parser.h" >+#endif > #include "ev-file-helpers.h" > > typedef struct _EvPageSize > { > gdouble width; > gdouble height; > } EvPageSize; > > struct _EvDocumentPrivate > { >@@ -46,22 +48,23 @@ > > gdouble max_width; > gdouble max_height; > gdouble min_width; > gdouble min_height; > gint max_label; > > gchar **page_labels; > EvPageSize *page_sizes; > EvDocumentInfo *info; >- >+#ifdef ENABLE_SYNCTEX > synctex_scanner_p synctex_scanner; >+#endif > }; > > static gint _ev_document_get_n_pages (EvDocument *document); > static void _ev_document_get_page_size (EvDocument *document, > EvPage *page, > double *width, > double *height); > static gchar *_ev_document_get_page_label (EvDocument *document, > EvPage *page); > static EvDocumentInfo *_ev_document_get_info (EvDocument *document); >@@ -117,35 +120,36 @@ > g_free (document->priv->page_labels[i]); > } > g_free (document->priv->page_labels); > document->priv->page_labels = NULL; > } > > if (document->priv->info) { > ev_document_info_free (document->priv->info); > document->priv->info = NULL; > } >- >+#ifdef ENABLE_SYNCTEX > if (document->priv->synctex_scanner) { > synctex_scanner_free (document->priv->synctex_scanner); > document->priv->synctex_scanner = NULL; > } >- >+#endif > G_OBJECT_CLASS (ev_document_parent_class)->finalize (object); > } > > static void > ev_document_init (EvDocument *document) > { > document->priv = ev_document_get_instance_private (document); >+#ifdef ENABLE_SYNCTEX > document->synctex_version = SYNCTEX_VERSION_STRING; >- >+#endif > /* Assume all pages are the same size until proven otherwise */ > document->priv->uniform = TRUE; > /* Assume that the document is not a web document*/ > document->iswebdocument = FALSE ; > } > > static void > ev_document_class_init (EvDocumentClass *klass) > { > GObjectClass *g_object_class = G_OBJECT_CLASS (klass); >@@ -329,30 +333,32 @@ > > priv->page_labels[i] = page_label; > priv->max_label = MAX (priv->max_label, > g_utf8_strlen (page_label, 256)); > } > > g_object_unref (page); > } > > priv->info = _ev_document_get_info (document); >+#ifdef ENABLE_SYNCTEX > if (_ev_document_support_synctex (document)) { > gchar *filename; > > filename = g_filename_from_uri (uri, NULL, NULL); > if (filename != NULL) { > priv->synctex_scanner = > synctex_scanner_new_with_output_file (filename, NULL, 1); > g_free (filename); > } > } >+#endif > } > > return retval; > } > > /** > * ev_document_save: > * @document: > * @uri: the target URI > * @error: a #GError location to store an error, or %NULL >@@ -381,20 +387,21 @@ > } > > static gboolean > _ev_document_support_synctex (EvDocument *document) > { > EvDocumentClass *klass = EV_DOCUMENT_GET_CLASS (document); > > return klass->support_synctex ? klass->support_synctex (document) : FALSE; > } > >+#ifdef ENABLE_SYNCTEX > gboolean > ev_document_has_synctex (EvDocument *document) > { > g_return_val_if_fail (EV_IS_DOCUMENT (document), FALSE); > > return document->priv->synctex_scanner != NULL; > } > > /** > * ev_document_synctex_backward_search: >@@ -485,20 +492,21 @@ > result->area.y1 = synctex_node_box_visible_v (node) - > synctex_node_box_visible_height (node); > result->area.x2 = synctex_node_box_visible_width (node) + result->area.x1; > result->area.y2 = synctex_node_box_visible_depth (node) + > synctex_node_box_visible_height (node) + result->area.y1; > } > } > > return result; > } >+#endif /* ENABLE_SYNCTEX */ > > static gint > _ev_document_get_n_pages (EvDocument *document) > { > EvDocumentClass *klass = EV_DOCUMENT_GET_CLASS (document); > > return klass->get_n_pages (document); > } > > gint >diff -r -U10 atril-1.24.0-orig/libview/ev-view.c atril-1.24.0/libview/ev-view.c >--- atril-1.24.0-orig/libview/ev-view.c 2020-02-10 04:39:56.000000000 -0600 >+++ atril-1.24.0/libview/ev-view.c 2020-08-10 10:08:56.506053336 -0500 >@@ -3203,20 +3203,21 @@ > > ev_page_cache_mark_dirty (view->page_cache, page, EV_PAGE_DATA_INCLUDE_ANNOTS); > > /* FIXME: only redraw the annot area */ > ev_view_reload_page (view, page, NULL); > > g_signal_emit (view, signals[SIGNAL_ANNOT_REMOVED], 0, annot); > g_object_unref (annot); > } > >+#ifdef ENABLE_SYNCTEX > static gboolean > ev_view_synctex_backward_search (EvView *view, > gdouble x, > gdouble y) > { > gint page = -1; > gint x_new = 0, y_new = 0; > EvSourceLink *link; > > if (!ev_document_has_synctex (view->document)) >@@ -3228,20 +3229,21 @@ > link = ev_document_synctex_backward_search (view->document, page, x_new, y_new); > if (link) { > g_signal_emit (view, signals[SIGNAL_SYNC_SOURCE], 0, link); > ev_source_link_free (link); > > return TRUE; > } > > return FALSE; > } >+#endif > > /* Caret navigation */ > #define CURSOR_ON_MULTIPLIER 2 > #define CURSOR_OFF_MULTIPLIER 1 > #define CURSOR_PEND_MULTIPLIER 3 > #define CURSOR_DIVIDER 3 > > static inline gboolean > cursor_is_in_visible_page (EvView *view) > { >@@ -4071,22 +4073,24 @@ > draw_one_page (view, i, cr, &page_area, &border, area, &page_ready); > > if (page_ready && should_draw_caret_cursor (view, i)) > draw_caret_cursor (view, cr); > if (page_ready && view->find_pages && view->highlight_find_results) > highlight_find_results (view, cr, i); > if (page_ready && EV_IS_DOCUMENT_ANNOTATIONS (view->document)) > 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) > (* GTK_WIDGET_CLASS (ev_view_parent_class)->draw) (widget, cr); > > return FALSE; > } > > static void > ev_view_set_focused_element_at_location (EvView *view, >@@ -4465,23 +4469,24 @@ > if (view->scroll_info.autoscrolling) > return TRUE; > > switch (event->button) { > case 1: { > EvImage *image; > EvAnnotation *annot; > 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) { > start_selection_for_event (view, event); > } else if (event->state & GDK_SHIFT_MASK) { > GdkPoint end_point; > > end_point.x = event->x + view->scroll_x; > end_point.y = event->y + view->scroll_y; > extend_selection (view, &view->selection_info.start, &end_point); >@@ -7515,20 +7520,21 @@ > view->highlight_find_results = value; > gtk_widget_queue_draw (GTK_WIDGET (view)); > } > > void > ev_view_find_cancel (EvView *view) > { > view->find_pages = NULL; > } > >+#ifdef ENABLE_SYNCTEX > /*** Synctex ***/ > void > ev_view_highlight_forward_search (EvView *view, > EvSourceLink *link) > { > EvMapping *mapping; > gint page; > GdkRectangle view_rect; > > if (!ev_document_has_synctex (view->document)) >@@ -7542,20 +7548,21 @@ > g_free (view->synctex_result); > view->synctex_result = mapping; > > page = GPOINTER_TO_INT (mapping->data); > ev_document_model_set_page (view->model, page); > > _ev_view_transform_doc_rect_to_view_rect (view, page, &mapping->area, &view_rect); > ensure_rectangle_is_visible (view, &view_rect); > gtk_widget_queue_draw (GTK_WIDGET (view)); > } >+#endif /* ENABLE_SYNCTEX */ > > /*** Selections ***/ > static gboolean > gdk_rectangle_point_in (GdkRectangle *rectangle, > GdkPoint *point) > { > return rectangle->x <= point->x && > rectangle->y <= point->y && > point->x < rectangle->x + rectangle->width && > point->y < rectangle->y + rectangle->height; >diff -r -U10 atril-1.24.0-orig/shell/ev-window.c atril-1.24.0/shell/ev-window.c >--- atril-1.24.0-orig/shell/ev-window.c 2020-02-10 04:39:56.000000000 -0600 >+++ atril-1.24.0/shell/ev-window.c 2020-08-10 10:08:56.508053309 -0500 >@@ -7744,40 +7744,43 @@ > > static void > ev_window_emit_doc_loaded (EvWindow *window) > { > if (window->priv->skeleton == NULL) > return; > > ev_atril_window_emit_document_loaded (window->priv->skeleton, window->priv->uri); > } > >+ >+#ifdef ENABLE_SYNCTEX > static gboolean > handle_sync_view_cb (EvAtrilWindow *object, > GDBusMethodInvocation *invocation, > const gchar *source_file, > GVariant *source_point, > guint timestamp, > EvWindow *window) > { > if (window->priv->document && ev_document_has_synctex (window->priv->document)) { > EvSourceLink link; > link.filename = (char *) source_file; > g_variant_get (source_point, "(ii)", &link.line, &link.col); > ev_view_highlight_forward_search (EV_VIEW (window->priv->view), &link); > gtk_window_present_with_time (GTK_WINDOW (window), timestamp); > } > > ev_atril_window_complete_sync_view (object, invocation); > > return TRUE; > } >+#endif > #endif /* ENABLE_DBUS */ > > static gboolean > _gtk_css_provider_load_from_resource (GtkCssProvider *provider, > const char *resource_path, > GError **error) > { > GBytes *data; > gboolean retval; > >@@ -7824,23 +7827,25 @@ > EvAtrilWindow *skeleton; > > ev_window->priv->dbus_object_path = g_strdup_printf (EV_WINDOW_DBUS_OBJECT_PATH, window_id++); > > skeleton = ev_atril_window_skeleton_new (); > if (g_dbus_interface_skeleton_export (G_DBUS_INTERFACE_SKELETON (skeleton), > connection, > ev_window->priv->dbus_object_path, > &error)) { > ev_window->priv->skeleton = skeleton; >+#ifdef ENABLE_SYNCTEX > g_signal_connect (skeleton, "handle-sync-view", > G_CALLBACK (handle_sync_view_cb), > ev_window); >+#endif > } else { > g_printerr ("Failed to register bus object %s: %s\n", > ev_window->priv->dbus_object_path, error->message); > g_error_free (error); > g_free (ev_window->priv->dbus_object_path); > ev_window->priv->dbus_object_path = NULL; > error = NULL; > > g_object_unref (skeleton); > ev_window->priv->skeleton = NULL;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 736647
: 654043 |
654045