Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 736647
Collapse All | Expand All

(-)atril-1.24.0-orig/configure.ac (-9 / +18 lines)
Lines 354-382 Link Here
354
354
355
AC_SUBST([G_IR_SCANNER])
355
AC_SUBST([G_IR_SCANNER])
356
AC_SUBST([G_IR_COMPILER])
356
AC_SUBST([G_IR_COMPILER])
357
AC_SUBST([G_IR_GENERATE])
357
AC_SUBST([G_IR_GENERATE])
358
AC_SUBST([GIRDIR])
358
AC_SUBST([GIRDIR])
359
AC_SUBST([GIRTYPELIBDIR])
359
AC_SUBST([GIRTYPELIBDIR])
360
360
361
AM_CONDITIONAL([ENABLE_INTROSPECTION],[test "$enable_introspection" = "yes"])
361
AM_CONDITIONAL([ENABLE_INTROSPECTION],[test "$enable_introspection" = "yes"])
362
362
363
dnl ================== libsynctex ===========================================
363
dnl ================== libsynctex ===========================================
364
AC_ARG_ENABLE([synctex],
365
  [AS_HELP_STRING([--disable-synctex], [Disable support for synctex])],
366
  [],
367
  [enable_synctex=yes])
368
369
370
if test "$enable_synctex" = "yes"; then
371
  AC_DEFINE([ENABLE_SYNCTEX],[1],[Define if synctex support is enabled])
372
  PKG_CHECK_MODULES(SYNCTEX, [synctex >= $SYNCTEX_REQUIRED], has_synctex=yes, has_synctex=no)
373
  dnl not found? use internal code copy.
374
  if test "x$has_synctex" = "xno"; then
375
          AC_MSG_ERROR("SyncTeX support is disabled since library version $SYNCTEX_REQUIRED or newer not found")
376
  fi
377
  AC_SUBST(SYNCTEX_LIBS)
378
  AC_SUBST(SYNCTEX_CFLAGS)
379
fi
364
380
365
PKG_CHECK_MODULES(SYNCTEX, [synctex >= $SYNCTEX_REQUIRED], has_synctex=yes, has_synctex=no)
381
AM_CONDITIONAL([ENABLE_SYNCTEX], [test "$enable_synctex" = "yes"])
366
382
367
dnl not found? use internal code copy.
368
if test "x$has_synctex" = "xno"; then
369
        AC_MSG_ERROR("SyncTeX support is disabled since library version $SYNCTEX_REQUIRED or newer not found")
370
fi
371
AC_SUBST(SYNCTEX_LIBS)
372
AC_SUBST(SYNCTEX_CFLAGS)
373
383
374
dnl ================== portability checks ===========================================
384
dnl ================== portability checks ===========================================
375
385
376
dnl for backtrace()
386
dnl for backtrace()
377
AC_CHECK_HEADERS([execinfo.h])
387
AC_CHECK_HEADERS([execinfo.h])
378
388
379
AC_CHECK_DECL([_NL_MEASUREMENT_MEASUREMENT],[
389
AC_CHECK_DECL([_NL_MEASUREMENT_MEASUREMENT],[
380
  AC_DEFINE([HAVE__NL_MEASUREMENT_MEASUREMENT],[1],[Define if _NL_MEASUREMENT_MEASUREMENT is available])
390
  AC_DEFINE([HAVE__NL_MEASUREMENT_MEASUREMENT],[1],[Define if _NL_MEASUREMENT_MEASUREMENT is available])
381
  ],[],[#include <langinfo.h>])
391
  ],[],[#include <langinfo.h>])
382
392
Lines 763-783 Link Here
763
    DBUS Support........:    $enable_dbus
773
    DBUS Support........:    $enable_dbus
764
    Caja Plugin.........:    $enable_caja
774
    Caja Plugin.........:    $enable_caja
765
    Thumbnailer.........:    $enable_thumbnailer
775
    Thumbnailer.........:    $enable_thumbnailer
766
    Previewer...........:    $enable_previewer
776
    Previewer...........:    $enable_previewer
767
    Gtk-Doc Support.....:    $enable_gtk_doc
777
    Gtk-Doc Support.....:    $enable_gtk_doc
768
    Debug mode..........:    $enable_debug
778
    Debug mode..........:    $enable_debug
769
    GObj. Introspection.:    $enable_introspection
779
    GObj. Introspection.:    $enable_introspection
770
    Tests...............:    $enable_tests
780
    Tests...............:    $enable_tests
771
781
772
    PDF Backend.........:    $enable_pdf
782
    PDF Backend.........:    $enable_pdf
783
    Synctex enabled.....:    $enable_synctex
773
    PostScript Backend..:    $enable_ps
784
    PostScript Backend..:    $enable_ps
774
    TIFF Backend........:    $enable_tiff
785
    TIFF Backend........:    $enable_tiff
775
    DJVU Backend........:    $enable_djvu
786
    DJVU Backend........:    $enable_djvu
776
    DVI Backend.........:    $enable_dvi
787
    DVI Backend.........:    $enable_dvi
777
    Pixbuf Backend......:    $enable_pixbuf
788
    Pixbuf Backend......:    $enable_pixbuf
778
    Comics Backend......:    $enable_comics
789
    Comics Backend......:    $enable_comics
779
    XPS Backend.........:    $enable_xps
790
    XPS Backend.........:    $enable_xps
780
    ePub Backend........:    $have_webkit
791
    ePub Backend........:    $have_webkit
781
782
    SyncTeX.............:    $has_synctex
783
"
792
"
(-)atril-1.24.0-orig/libdocument/ev-document.c (-4 / +12 lines)
Lines 18-38 Link Here
18
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19
 *
19
 *
20
 */
20
 */
21
21
22
#include "config.h"
22
#include "config.h"
23
23
24
#include <stdlib.h>
24
#include <stdlib.h>
25
#include <string.h>
25
#include <string.h>
26
26
27
#include "ev-document.h"
27
#include "ev-document.h"
28
#ifdef ENABLE_SYNCTEX
28
#include "synctex_parser.h"
29
#include "synctex_parser.h"
30
#endif
29
#include "ev-file-helpers.h"
31
#include "ev-file-helpers.h"
30
32
31
typedef struct _EvPageSize
33
typedef struct _EvPageSize
32
{
34
{
33
	gdouble width;
35
	gdouble width;
34
	gdouble height;
36
	gdouble height;
35
} EvPageSize;
37
} EvPageSize;
36
38
37
struct _EvDocumentPrivate
39
struct _EvDocumentPrivate
38
{
40
{
Lines 46-67 Link Here
46
48
47
	gdouble         max_width;
49
	gdouble         max_width;
48
	gdouble         max_height;
50
	gdouble         max_height;
49
	gdouble         min_width;
51
	gdouble         min_width;
50
	gdouble         min_height;
52
	gdouble         min_height;
51
	gint            max_label;
53
	gint            max_label;
52
54
53
	gchar         **page_labels;
55
	gchar         **page_labels;
54
	EvPageSize     *page_sizes;
56
	EvPageSize     *page_sizes;
55
	EvDocumentInfo *info;
57
	EvDocumentInfo *info;
56
58
#ifdef ENABLE_SYNCTEX
57
	synctex_scanner_p synctex_scanner;
59
	synctex_scanner_p synctex_scanner;
60
#endif
58
};
61
};
59
62
60
static gint            _ev_document_get_n_pages     (EvDocument *document);
63
static gint            _ev_document_get_n_pages     (EvDocument *document);
61
static void            _ev_document_get_page_size   (EvDocument *document,
64
static void            _ev_document_get_page_size   (EvDocument *document,
62
						     EvPage     *page,
65
						     EvPage     *page,
63
						     double     *width,
66
						     double     *width,
64
						     double     *height);
67
						     double     *height);
65
static gchar          *_ev_document_get_page_label  (EvDocument *document,
68
static gchar          *_ev_document_get_page_label  (EvDocument *document,
66
						     EvPage     *page);
69
						     EvPage     *page);
67
static EvDocumentInfo *_ev_document_get_info        (EvDocument *document);
70
static EvDocumentInfo *_ev_document_get_info        (EvDocument *document);
Lines 117-151 Link Here
117
			g_free (document->priv->page_labels[i]);
120
			g_free (document->priv->page_labels[i]);
118
		}
121
		}
119
		g_free (document->priv->page_labels);
122
		g_free (document->priv->page_labels);
120
		document->priv->page_labels = NULL;
123
		document->priv->page_labels = NULL;
121
	}
124
	}
122
125
123
	if (document->priv->info) {
126
	if (document->priv->info) {
124
		ev_document_info_free (document->priv->info);
127
		ev_document_info_free (document->priv->info);
125
		document->priv->info = NULL;
128
		document->priv->info = NULL;
126
	}
129
	}
127
130
#ifdef ENABLE_SYNCTEX
128
	if (document->priv->synctex_scanner) {
131
	if (document->priv->synctex_scanner) {
129
		synctex_scanner_free (document->priv->synctex_scanner);
132
		synctex_scanner_free (document->priv->synctex_scanner);
130
		document->priv->synctex_scanner = NULL;
133
		document->priv->synctex_scanner = NULL;
131
	}
134
	}
132
135
#endif
133
	G_OBJECT_CLASS (ev_document_parent_class)->finalize (object);
136
	G_OBJECT_CLASS (ev_document_parent_class)->finalize (object);
134
}
137
}
135
138
136
static void
139
static void
137
ev_document_init (EvDocument *document)
140
ev_document_init (EvDocument *document)
138
{
141
{
139
	document->priv = ev_document_get_instance_private (document);
142
	document->priv = ev_document_get_instance_private (document);
143
#ifdef ENABLE_SYNCTEX
140
	document->synctex_version = SYNCTEX_VERSION_STRING;
144
	document->synctex_version = SYNCTEX_VERSION_STRING;
141
145
#endif
142
	/* Assume all pages are the same size until proven otherwise */
146
	/* Assume all pages are the same size until proven otherwise */
143
	document->priv->uniform = TRUE;
147
	document->priv->uniform = TRUE;
144
	/* Assume that the document is not a web document*/
148
	/* Assume that the document is not a web document*/
145
	document->iswebdocument = FALSE ;
149
	document->iswebdocument = FALSE ;
146
}
150
}
147
151
148
static void
152
static void
149
ev_document_class_init (EvDocumentClass *klass)
153
ev_document_class_init (EvDocumentClass *klass)
150
{
154
{
151
	GObjectClass *g_object_class = G_OBJECT_CLASS (klass);
155
	GObjectClass *g_object_class = G_OBJECT_CLASS (klass);
Lines 329-358 Link Here
329
333
330
				priv->page_labels[i] = page_label;
334
				priv->page_labels[i] = page_label;
331
				priv->max_label = MAX (priv->max_label,
335
				priv->max_label = MAX (priv->max_label,
332
						       g_utf8_strlen (page_label, 256));
336
						       g_utf8_strlen (page_label, 256));
333
			}
337
			}
334
338
335
			g_object_unref (page);
339
			g_object_unref (page);
336
		}
340
		}
337
341
338
		priv->info = _ev_document_get_info (document);
342
		priv->info = _ev_document_get_info (document);
343
#ifdef ENABLE_SYNCTEX
339
		if (_ev_document_support_synctex (document)) {
344
		if (_ev_document_support_synctex (document)) {
340
			gchar *filename;
345
			gchar *filename;
341
346
342
			filename = g_filename_from_uri (uri, NULL, NULL);
347
			filename = g_filename_from_uri (uri, NULL, NULL);
343
			if (filename != NULL) {
348
			if (filename != NULL) {
344
				priv->synctex_scanner =
349
				priv->synctex_scanner =
345
					synctex_scanner_new_with_output_file (filename, NULL, 1);
350
					synctex_scanner_new_with_output_file (filename, NULL, 1);
346
				g_free (filename);
351
				g_free (filename);
347
			}
352
			}
348
		}
353
		}
354
#endif
349
	}
355
	}
350
356
351
	return retval;
357
	return retval;
352
}
358
}
353
359
354
/**
360
/**
355
 * ev_document_save:
361
 * ev_document_save:
356
 * @document:
362
 * @document:
357
 * @uri: the target URI
363
 * @uri: the target URI
358
 * @error: a #GError location to store an error, or %NULL
364
 * @error: a #GError location to store an error, or %NULL
Lines 381-400 Link Here
381
}
387
}
382
388
383
static gboolean
389
static gboolean
384
_ev_document_support_synctex (EvDocument *document)
390
_ev_document_support_synctex (EvDocument *document)
385
{
391
{
386
	EvDocumentClass *klass = EV_DOCUMENT_GET_CLASS (document);
392
	EvDocumentClass *klass = EV_DOCUMENT_GET_CLASS (document);
387
393
388
	return klass->support_synctex ? klass->support_synctex (document) : FALSE;
394
	return klass->support_synctex ? klass->support_synctex (document) : FALSE;
389
}
395
}
390
396
397
#ifdef ENABLE_SYNCTEX
391
gboolean
398
gboolean
392
ev_document_has_synctex (EvDocument *document)
399
ev_document_has_synctex (EvDocument *document)
393
{
400
{
394
	g_return_val_if_fail (EV_IS_DOCUMENT (document), FALSE);
401
	g_return_val_if_fail (EV_IS_DOCUMENT (document), FALSE);
395
402
396
	return document->priv->synctex_scanner != NULL;
403
	return document->priv->synctex_scanner != NULL;
397
}
404
}
398
405
399
/**
406
/**
400
 * ev_document_synctex_backward_search:
407
 * ev_document_synctex_backward_search:
Lines 485-504 Link Here
485
                        result->area.y1 = synctex_node_box_visible_v (node) -
492
                        result->area.y1 = synctex_node_box_visible_v (node) -
486
                                synctex_node_box_visible_height (node);
493
                                synctex_node_box_visible_height (node);
487
                        result->area.x2 = synctex_node_box_visible_width (node) + result->area.x1;
494
                        result->area.x2 = synctex_node_box_visible_width (node) + result->area.x1;
488
                        result->area.y2 = synctex_node_box_visible_depth (node) +
495
                        result->area.y2 = synctex_node_box_visible_depth (node) +
489
                                synctex_node_box_visible_height (node) + result->area.y1;
496
                                synctex_node_box_visible_height (node) + result->area.y1;
490
                }
497
                }
491
        }
498
        }
492
499
493
        return result;
500
        return result;
494
}
501
}
502
#endif /* ENABLE_SYNCTEX */
495
503
496
static gint
504
static gint
497
_ev_document_get_n_pages (EvDocument  *document)
505
_ev_document_get_n_pages (EvDocument  *document)
498
{
506
{
499
	EvDocumentClass *klass = EV_DOCUMENT_GET_CLASS (document);
507
	EvDocumentClass *klass = EV_DOCUMENT_GET_CLASS (document);
500
508
501
	return klass->get_n_pages (document);
509
	return klass->get_n_pages (document);
502
}
510
}
503
511
504
gint
512
gint
(-)atril-1.24.0-orig/libview/ev-view.c (-1 / +8 lines)
Lines 3203-3222 Link Here
3203
3203
3204
        ev_page_cache_mark_dirty (view->page_cache, page, EV_PAGE_DATA_INCLUDE_ANNOTS);
3204
        ev_page_cache_mark_dirty (view->page_cache, page, EV_PAGE_DATA_INCLUDE_ANNOTS);
3205
3205
3206
        /* FIXME: only redraw the annot area */
3206
        /* FIXME: only redraw the annot area */
3207
        ev_view_reload_page (view, page, NULL);
3207
        ev_view_reload_page (view, page, NULL);
3208
3208
3209
        g_signal_emit (view, signals[SIGNAL_ANNOT_REMOVED], 0, annot);
3209
        g_signal_emit (view, signals[SIGNAL_ANNOT_REMOVED], 0, annot);
3210
        g_object_unref (annot);
3210
        g_object_unref (annot);
3211
}
3211
}
3212
3212
3213
#ifdef ENABLE_SYNCTEX
3213
static gboolean
3214
static gboolean
3214
ev_view_synctex_backward_search (EvView *view,
3215
ev_view_synctex_backward_search (EvView *view,
3215
				 gdouble x,
3216
				 gdouble x,
3216
				 gdouble y)
3217
				 gdouble y)
3217
{
3218
{
3218
	gint page = -1;
3219
	gint page = -1;
3219
	gint x_new = 0, y_new = 0;
3220
	gint x_new = 0, y_new = 0;
3220
	EvSourceLink *link;
3221
	EvSourceLink *link;
3221
3222
3222
	if (!ev_document_has_synctex (view->document))
3223
	if (!ev_document_has_synctex (view->document))
Lines 3228-3247 Link Here
3228
	link = ev_document_synctex_backward_search (view->document, page, x_new, y_new);
3229
	link = ev_document_synctex_backward_search (view->document, page, x_new, y_new);
3229
	if (link) {
3230
	if (link) {
3230
		g_signal_emit (view, signals[SIGNAL_SYNC_SOURCE], 0, link);
3231
		g_signal_emit (view, signals[SIGNAL_SYNC_SOURCE], 0, link);
3231
		ev_source_link_free (link);
3232
		ev_source_link_free (link);
3232
3233
3233
		return TRUE;
3234
		return TRUE;
3234
	}
3235
	}
3235
3236
3236
	return FALSE;
3237
	return FALSE;
3237
}
3238
}
3239
#endif
3238
3240
3239
/* Caret navigation */
3241
/* Caret navigation */
3240
#define CURSOR_ON_MULTIPLIER 2
3242
#define CURSOR_ON_MULTIPLIER 2
3241
#define CURSOR_OFF_MULTIPLIER 1
3243
#define CURSOR_OFF_MULTIPLIER 1
3242
#define CURSOR_PEND_MULTIPLIER 3
3244
#define CURSOR_PEND_MULTIPLIER 3
3243
#define CURSOR_DIVIDER 3
3245
#define CURSOR_DIVIDER 3
3244
3246
3245
static inline gboolean
3247
static inline gboolean
3246
cursor_is_in_visible_page (EvView *view)
3248
cursor_is_in_visible_page (EvView *view)
3247
{
3249
{
Lines 4071-4092 Link Here
4071
		draw_one_page (view, i, cr, &page_area, &border, area, &page_ready);
4073
		draw_one_page (view, i, cr, &page_area, &border, area, &page_ready);
4072
4074
4073
		if (page_ready && should_draw_caret_cursor (view, i))
4075
		if (page_ready && should_draw_caret_cursor (view, i))
4074
			draw_caret_cursor (view, cr);
4076
			draw_caret_cursor (view, cr);
4075
		if (page_ready && view->find_pages && view->highlight_find_results)
4077
		if (page_ready && view->find_pages && view->highlight_find_results)
4076
			highlight_find_results (view, cr, i);
4078
			highlight_find_results (view, cr, i);
4077
		if (page_ready && EV_IS_DOCUMENT_ANNOTATIONS (view->document))
4079
		if (page_ready && EV_IS_DOCUMENT_ANNOTATIONS (view->document))
4078
			show_annotation_windows (view, i);
4080
			show_annotation_windows (view, i);
4079
		if (page_ready && view->focused_element)
4081
		if (page_ready && view->focused_element)
4080
			draw_focus (view, cr, i, &clip_rect);
4082
			draw_focus (view, cr, i, &clip_rect);
4083
#ifdef ENABLE_SYNCTEX
4081
		if (page_ready && view->synctex_result)
4084
		if (page_ready && view->synctex_result)
4082
			highlight_forward_search_results (view, cr, i);
4085
			highlight_forward_search_results (view, cr, i);
4086
#endif
4083
	}
4087
	}
4084
4088
4085
	if (GTK_WIDGET_CLASS (ev_view_parent_class)->draw)
4089
	if (GTK_WIDGET_CLASS (ev_view_parent_class)->draw)
4086
		(* GTK_WIDGET_CLASS (ev_view_parent_class)->draw) (widget, cr);
4090
		(* GTK_WIDGET_CLASS (ev_view_parent_class)->draw) (widget, cr);
4087
4091
4088
	return FALSE;
4092
	return FALSE;
4089
}
4093
}
4090
4094
4091
static void
4095
static void
4092
ev_view_set_focused_element_at_location (EvView *view,
4096
ev_view_set_focused_element_at_location (EvView *view,
Lines 4465-4487 Link Here
4465
	if (view->scroll_info.autoscrolling)
4469
	if (view->scroll_info.autoscrolling)
4466
		return TRUE;
4470
		return TRUE;
4467
4471
4468
	switch (event->button) {
4472
	switch (event->button) {
4469
	        case 1: {
4473
	        case 1: {
4470
			EvImage *image;
4474
			EvImage *image;
4471
			EvAnnotation *annot;
4475
			EvAnnotation *annot;
4472
			EvFormField *field;
4476
			EvFormField *field;
4473
			EvMapping *link;
4477
			EvMapping *link;
4474
			gint page;
4478
			gint page;
4475
4479
#ifdef ENABLE_SYNCTEX
4476
			if (event->state & GDK_CONTROL_MASK)
4480
			if (event->state & GDK_CONTROL_MASK)
4477
				return ev_view_synctex_backward_search (view, event->x , event->y);
4481
				return ev_view_synctex_backward_search (view, event->x , event->y);
4482
#endif
4478
4483
4479
			if (EV_IS_SELECTION (view->document) && view->selection_info.selections) {
4484
			if (EV_IS_SELECTION (view->document) && view->selection_info.selections) {
4480
				if (event->type == GDK_3BUTTON_PRESS) {
4485
				if (event->type == GDK_3BUTTON_PRESS) {
4481
					start_selection_for_event (view, event);
4486
					start_selection_for_event (view, event);
4482
				} else if (event->state & GDK_SHIFT_MASK) {
4487
				} else if (event->state & GDK_SHIFT_MASK) {
4483
					GdkPoint end_point;
4488
					GdkPoint end_point;
4484
4489
4485
					end_point.x = event->x + view->scroll_x;
4490
					end_point.x = event->x + view->scroll_x;
4486
					end_point.y = event->y + view->scroll_y;
4491
					end_point.y = event->y + view->scroll_y;
4487
					extend_selection (view, &view->selection_info.start, &end_point);
4492
					extend_selection (view, &view->selection_info.start, &end_point);
Lines 7515-7534 Link Here
7515
	view->highlight_find_results = value;
7520
	view->highlight_find_results = value;
7516
	gtk_widget_queue_draw (GTK_WIDGET (view));
7521
	gtk_widget_queue_draw (GTK_WIDGET (view));
7517
}
7522
}
7518
7523
7519
void
7524
void
7520
ev_view_find_cancel (EvView *view)
7525
ev_view_find_cancel (EvView *view)
7521
{
7526
{
7522
	view->find_pages = NULL;
7527
	view->find_pages = NULL;
7523
}
7528
}
7524
7529
7530
#ifdef ENABLE_SYNCTEX
7525
/*** Synctex ***/
7531
/*** Synctex ***/
7526
void
7532
void
7527
ev_view_highlight_forward_search (EvView       *view,
7533
ev_view_highlight_forward_search (EvView       *view,
7528
				  EvSourceLink *link)
7534
				  EvSourceLink *link)
7529
{
7535
{
7530
	EvMapping   *mapping;
7536
	EvMapping   *mapping;
7531
	gint         page;
7537
	gint         page;
7532
	GdkRectangle view_rect;
7538
	GdkRectangle view_rect;
7533
7539
7534
	if (!ev_document_has_synctex (view->document))
7540
	if (!ev_document_has_synctex (view->document))
Lines 7542-7561 Link Here
7542
		g_free (view->synctex_result);
7548
		g_free (view->synctex_result);
7543
	view->synctex_result = mapping;
7549
	view->synctex_result = mapping;
7544
7550
7545
	page = GPOINTER_TO_INT (mapping->data);
7551
	page = GPOINTER_TO_INT (mapping->data);
7546
	ev_document_model_set_page (view->model, page);
7552
	ev_document_model_set_page (view->model, page);
7547
7553
7548
	_ev_view_transform_doc_rect_to_view_rect (view, page, &mapping->area, &view_rect);
7554
	_ev_view_transform_doc_rect_to_view_rect (view, page, &mapping->area, &view_rect);
7549
	ensure_rectangle_is_visible (view, &view_rect);
7555
	ensure_rectangle_is_visible (view, &view_rect);
7550
	gtk_widget_queue_draw (GTK_WIDGET (view));
7556
	gtk_widget_queue_draw (GTK_WIDGET (view));
7551
}
7557
}
7558
#endif /* ENABLE_SYNCTEX */
7552
7559
7553
/*** Selections ***/
7560
/*** Selections ***/
7554
static gboolean
7561
static gboolean
7555
gdk_rectangle_point_in (GdkRectangle *rectangle,
7562
gdk_rectangle_point_in (GdkRectangle *rectangle,
7556
			GdkPoint     *point)
7563
			GdkPoint     *point)
7557
{
7564
{
7558
	return rectangle->x <= point->x &&
7565
	return rectangle->x <= point->x &&
7559
		rectangle->y <= point->y &&
7566
		rectangle->y <= point->y &&
7560
		point->x < rectangle->x + rectangle->width &&
7567
		point->x < rectangle->x + rectangle->width &&
7561
		point->y < rectangle->y + rectangle->height;
7568
		point->y < rectangle->y + rectangle->height;
(-)atril-1.24.0-orig/shell/ev-window.c (+5 lines)
Lines 7744-7783 Link Here
7744
7744
7745
static void
7745
static void
7746
ev_window_emit_doc_loaded (EvWindow *window)
7746
ev_window_emit_doc_loaded (EvWindow *window)
7747
{
7747
{
7748
        if (window->priv->skeleton == NULL)
7748
        if (window->priv->skeleton == NULL)
7749
                return;
7749
                return;
7750
7750
7751
        ev_atril_window_emit_document_loaded (window->priv->skeleton, window->priv->uri);
7751
        ev_atril_window_emit_document_loaded (window->priv->skeleton, window->priv->uri);
7752
}
7752
}
7753
7753
7754
7755
#ifdef ENABLE_SYNCTEX
7754
static gboolean
7756
static gboolean
7755
handle_sync_view_cb (EvAtrilWindow        *object,
7757
handle_sync_view_cb (EvAtrilWindow        *object,
7756
                     GDBusMethodInvocation *invocation,
7758
                     GDBusMethodInvocation *invocation,
7757
                     const gchar           *source_file,
7759
                     const gchar           *source_file,
7758
                     GVariant              *source_point,
7760
                     GVariant              *source_point,
7759
                     guint                  timestamp,
7761
                     guint                  timestamp,
7760
                     EvWindow              *window)
7762
                     EvWindow              *window)
7761
{
7763
{
7762
	if (window->priv->document && ev_document_has_synctex (window->priv->document)) {
7764
	if (window->priv->document && ev_document_has_synctex (window->priv->document)) {
7763
		EvSourceLink link;
7765
		EvSourceLink link;
7764
		link.filename = (char *) source_file;
7766
		link.filename = (char *) source_file;
7765
		g_variant_get (source_point, "(ii)", &link.line, &link.col);
7767
		g_variant_get (source_point, "(ii)", &link.line, &link.col);
7766
		ev_view_highlight_forward_search (EV_VIEW (window->priv->view), &link);
7768
		ev_view_highlight_forward_search (EV_VIEW (window->priv->view), &link);
7767
		gtk_window_present_with_time (GTK_WINDOW (window), timestamp);
7769
		gtk_window_present_with_time (GTK_WINDOW (window), timestamp);
7768
	}
7770
	}
7769
7771
7770
	ev_atril_window_complete_sync_view (object, invocation);
7772
	ev_atril_window_complete_sync_view (object, invocation);
7771
7773
7772
	return TRUE;
7774
	return TRUE;
7773
}
7775
}
7776
#endif
7774
#endif /* ENABLE_DBUS */
7777
#endif /* ENABLE_DBUS */
7775
7778
7776
static gboolean
7779
static gboolean
7777
_gtk_css_provider_load_from_resource (GtkCssProvider *provider,
7780
_gtk_css_provider_load_from_resource (GtkCssProvider *provider,
7778
				      const char     *resource_path,
7781
				      const char     *resource_path,
7779
				      GError        **error)
7782
				      GError        **error)
7780
{
7783
{
7781
	GBytes  *data;
7784
	GBytes  *data;
7782
	gboolean retval;
7785
	gboolean retval;
7783
7786
Lines 7824-7846 Link Here
7824
                EvAtrilWindow *skeleton;
7827
                EvAtrilWindow *skeleton;
7825
7828
7826
                ev_window->priv->dbus_object_path = g_strdup_printf (EV_WINDOW_DBUS_OBJECT_PATH, window_id++);
7829
                ev_window->priv->dbus_object_path = g_strdup_printf (EV_WINDOW_DBUS_OBJECT_PATH, window_id++);
7827
7830
7828
                skeleton = ev_atril_window_skeleton_new ();
7831
                skeleton = ev_atril_window_skeleton_new ();
7829
                if (g_dbus_interface_skeleton_export (G_DBUS_INTERFACE_SKELETON (skeleton),
7832
                if (g_dbus_interface_skeleton_export (G_DBUS_INTERFACE_SKELETON (skeleton),
7830
                                                      connection,
7833
                                                      connection,
7831
                                                      ev_window->priv->dbus_object_path,
7834
                                                      ev_window->priv->dbus_object_path,
7832
                                                      &error)) {
7835
                                                      &error)) {
7833
                        ev_window->priv->skeleton = skeleton;
7836
                        ev_window->priv->skeleton = skeleton;
7837
#ifdef ENABLE_SYNCTEX
7834
                        g_signal_connect (skeleton, "handle-sync-view",
7838
                        g_signal_connect (skeleton, "handle-sync-view",
7835
                                          G_CALLBACK (handle_sync_view_cb),
7839
                                          G_CALLBACK (handle_sync_view_cb),
7836
                                          ev_window);
7840
                                          ev_window);
7841
#endif
7837
                } else {
7842
                } else {
7838
                        g_printerr ("Failed to register bus object %s: %s\n",
7843
                        g_printerr ("Failed to register bus object %s: %s\n",
7839
			            ev_window->priv->dbus_object_path, error->message);
7844
			            ev_window->priv->dbus_object_path, error->message);
7840
                        g_error_free (error);
7845
                        g_error_free (error);
7841
                        g_free (ev_window->priv->dbus_object_path);
7846
                        g_free (ev_window->priv->dbus_object_path);
7842
                        ev_window->priv->dbus_object_path = NULL;
7847
                        ev_window->priv->dbus_object_path = NULL;
7843
                        error = NULL;
7848
                        error = NULL;
7844
7849
7845
                        g_object_unref (skeleton);
7850
                        g_object_unref (skeleton);
7846
                        ev_window->priv->skeleton = NULL;
7851
                        ev_window->priv->skeleton = NULL;

Return to bug 736647