X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;ds=sidebyside;f=libview%2Fev-view.c;h=4686560b6ff705ab21684fd856593d71f2ca7408;hb=f6d7d0d57eeb150d45379c61161d2b699af30960;hp=71470fbe43c20b511a8a489436f40afca67579ff;hpb=70a15c80d722d7974328550498bd2cfc3cc03302;p=evince.git diff --git a/libview/ev-view.c b/libview/ev-view.c index 71470fbe..4686560b 100644 --- a/libview/ev-view.c +++ b/libview/ev-view.c @@ -28,7 +28,7 @@ #include #include -#include "ev-mapping.h" +#include "ev-mapping-list.h" #include "ev-document-forms.h" #include "ev-document-images.h" #include "ev-document-links.h" @@ -55,6 +55,7 @@ enum { SIGNAL_POPUP_MENU, SIGNAL_SELECTION_CHANGED, SIGNAL_SYNC_SOURCE, + SIGNAL_ANNOT_ADDED, N_SIGNALS }; @@ -178,6 +179,9 @@ static void highlight_find_results (EvView int page); static void highlight_forward_search_results (EvView *view, int page); +static void focus_annotation (EvView *view, + int page, + GdkRectangle *clip); static void draw_one_page (EvView *view, gint page, cairo_t *cr, @@ -1462,11 +1466,11 @@ get_doc_point_from_location (EvView *view, } static void -ev_view_get_area_from_mapping (EvView *view, - guint page, - GList *mapping_list, - gconstpointer data, - GdkRectangle *area) +ev_view_get_area_from_mapping (EvView *view, + guint page, + EvMappingList *mapping_list, + gconstpointer data, + GdkRectangle *area) { EvMapping *mapping; @@ -1485,7 +1489,7 @@ ev_view_get_link_at_location (EvView *view, { gint page = -1; gint x_new = 0, y_new = 0; - GList *link_mapping; + EvMappingList *link_mapping; if (!EV_IS_DOCUMENT_LINKS (view->document)) return NULL; @@ -1829,6 +1833,12 @@ ev_view_handle_cursor_over_xy (EvView *view, gint x, gint y) if (view->cursor == EV_VIEW_CURSOR_HIDDEN) return; + if (view->adding_annot) { + if (view->cursor != EV_VIEW_CURSOR_ADD) + ev_view_set_cursor (view, EV_VIEW_CURSOR_ADD); + return; + } + if (view->drag_info.in_drag) { if (view->cursor != EV_VIEW_CURSOR_DRAG) ev_view_set_cursor (view, EV_VIEW_CURSOR_DRAG); @@ -1863,7 +1873,8 @@ ev_view_handle_cursor_over_xy (EvView *view, gint x, gint y) if (view->cursor == EV_VIEW_CURSOR_LINK || view->cursor == EV_VIEW_CURSOR_IBEAM || view->cursor == EV_VIEW_CURSOR_DRAG || - view->cursor == EV_VIEW_CURSOR_AUTOSCROLL) + view->cursor == EV_VIEW_CURSOR_AUTOSCROLL || + view->cursor == EV_VIEW_CURSOR_ADD) ev_view_set_cursor (view, EV_VIEW_CURSOR_NORMAL); } @@ -1879,7 +1890,7 @@ ev_view_get_image_at_location (EvView *view, { gint page = -1; gint x_new = 0, y_new = 0; - GList *image_mapping; + EvMappingList *image_mapping; if (!EV_IS_DOCUMENT_IMAGES (view->document)) return NULL; @@ -1903,7 +1914,7 @@ ev_view_get_form_field_at_location (EvView *view, { gint page = -1; gint x_new = 0, y_new = 0; - GList *forms_mapping; + EvMappingList *forms_mapping; if (!EV_IS_DOCUMENT_FORMS (view->document)) return NULL; @@ -1923,8 +1934,8 @@ static cairo_region_t * ev_view_form_field_get_region (EvView *view, EvFormField *field) { - GdkRectangle view_area; - GList *forms_mapping; + GdkRectangle view_area; + EvMappingList *forms_mapping; forms_mapping = ev_page_cache_get_form_field_mapping (view->page_cache, field->page->index); @@ -1962,8 +1973,9 @@ ev_view_form_field_button_create_widget (EvView *view, return NULL; case EV_FORM_FIELD_BUTTON_CHECK: case EV_FORM_FIELD_BUTTON_RADIO: { - gboolean state; - GList *forms_mapping, *l; + gboolean state; + EvMappingList *forms_mapping; + GList *l; state = ev_document_forms_form_field_button_get_state (EV_DOCUMENT_FORMS (view->document), field); @@ -1980,7 +1992,7 @@ ev_view_form_field_button_create_widget (EvView *view, */ forms_mapping = ev_page_cache_get_form_field_mapping (view->page_cache, field->page->index); - for (l = forms_mapping; l; l = g_list_next (l)) { + for (l = ev_mapping_list_get_list (forms_mapping); l; l = g_list_next (l)) { EvFormField *button = ((EvMapping *)(l->data))->data; cairo_region_t *button_region; @@ -2338,9 +2350,9 @@ ev_view_handle_form_field (EvView *view, gdouble x, gdouble y) { - GtkWidget *field_widget = NULL; - GList *form_field_mapping; - GdkRectangle view_area; + GtkWidget *field_widget = NULL; + EvMappingList *form_field_mapping; + GdkRectangle view_area; if (field->is_read_only) return; @@ -2490,7 +2502,7 @@ ev_view_find_window_child_for_annot (EvView *view, continue; wannot = ev_annotation_window_get_annotation (EV_ANNOTATION_WINDOW (child->window)); - if (wannot == annot || strcmp (wannot->name, annot->name) == 0) + if (ev_annotation_equal (wannot, annot)) return child; } @@ -2573,37 +2585,73 @@ annotation_window_moved (EvAnnotationWindow *window, } static void -ev_view_annotation_save (EvView *view, - EvAnnotation *annot) +ev_view_annotation_save_contents (EvView *view, + GParamSpec *pspec, + EvAnnotation *annot) { if (!view->document) return; - if (!annot->changed) - return; + ev_document_doc_mutex_lock (); + ev_document_annotations_save_annotation (EV_DOCUMENT_ANNOTATIONS (view->document), + annot, EV_ANNOTATIONS_SAVE_CONTENTS); + ev_document_doc_mutex_unlock (); +} + +static GtkWidget * +ev_view_create_annotation_window (EvView *view, + EvAnnotation *annot, + GtkWindow *parent) +{ + GtkWidget *window; + EvRectangle doc_rect; + GdkRectangle view_rect; + guint page; + + window = ev_annotation_window_new (annot, parent); + g_signal_connect (window, "grab_focus", + G_CALLBACK (annotation_window_grab_focus), + view); + g_signal_connect (window, "closed", + G_CALLBACK (annotation_window_closed), + view); + g_signal_connect (window, "moved", + G_CALLBACK (annotation_window_moved), + view); + g_signal_connect_swapped (annot, "notify::contents", + G_CALLBACK (ev_view_annotation_save_contents), + view); + g_object_set_data (G_OBJECT (annot), "popup", window); + + page = ev_annotation_get_page_index (annot); + ev_annotation_window_get_rectangle (EV_ANNOTATION_WINDOW (window), &doc_rect); + doc_rect_to_view_rect (view, page, &doc_rect, &view_rect); + view_rect.x -= view->scroll_x; + view_rect.y -= view->scroll_y; + + ev_view_window_child_put (view, window, page, + view_rect.x, view_rect.y, + doc_rect.x1, doc_rect.y1); - ev_document_annotations_annotation_set_contents (EV_DOCUMENT_ANNOTATIONS (view->document), - annot, annot->contents); - annot->changed = FALSE; + return window; } static void show_annotation_windows (EvView *view, gint page) { - GList *annots, *l; - GtkWindow *parent; + EvMappingList *annots; + GList *l; + GtkWindow *parent; parent = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (view))); annots = ev_page_cache_get_annot_mapping (view->page_cache, page); - for (l = annots; l && l->data; l = g_list_next (l)) { + for (l = ev_mapping_list_get_list (annots); l && l->data; l = g_list_next (l)) { EvAnnotation *annot; EvViewWindowChild *child; GtkWidget *window; - EvRectangle *doc_rect; - GdkRectangle view_rect; annot = ((EvMapping *)(l->data))->data; @@ -2627,30 +2675,7 @@ show_annotation_windows (EvView *view, g_object_set_data (G_OBJECT (annot), "popup", window); ev_view_window_child_move_with_parent (view, window); } else { - window = ev_annotation_window_new (annot, parent); - g_signal_connect (window, "grab_focus", - G_CALLBACK (annotation_window_grab_focus), - view); - g_signal_connect (window, "closed", - G_CALLBACK (annotation_window_closed), - view); - g_signal_connect (window, "moved", - G_CALLBACK (annotation_window_moved), - view); - g_object_set_data (G_OBJECT (annot), "popup", window); - - doc_rect = (EvRectangle *)ev_annotation_window_get_rectangle (EV_ANNOTATION_WINDOW (window)); - doc_rect_to_view_rect (view, page, doc_rect, &view_rect); - view_rect.x -= view->scroll_x; - view_rect.y -= view->scroll_y; - - ev_view_window_child_put (view, window, page, - view_rect.x, view_rect.y, - doc_rect->x1, doc_rect->y1); - - g_object_weak_ref (G_OBJECT (annot), - (GWeakNotify)ev_view_annotation_save, - view); + ev_view_create_annotation_window (view, annot, parent); } } } @@ -2659,11 +2684,12 @@ static void hide_annotation_windows (EvView *view, gint page) { - GList *annots, *l; + EvMappingList *annots; + GList *l; annots = ev_page_cache_get_annot_mapping (view->page_cache, page); - for (l = annots; l && l->data; l = g_list_next (l)) { + for (l = ev_mapping_list_get_list (annots); l && l->data; l = g_list_next (l)) { EvAnnotation *annot; GtkWidget *window; @@ -2685,7 +2711,7 @@ ev_view_get_annotation_at_location (EvView *view, { gint page = -1; gint x_new = 0, y_new = 0; - GList *annotations_mapping; + EvMappingList *annotations_mapping; if (!EV_IS_DOCUMENT_ANNOTATIONS (view->document)) return NULL; @@ -2701,6 +2727,23 @@ ev_view_get_annotation_at_location (EvView *view, return NULL; } +static void +ev_view_annotation_show_popup_window (EvView *view, + GtkWidget *window) +{ + EvViewWindowChild *child; + + if (!window) + return; + + child = ev_view_get_window_child (view, window); + if (!child->visible) { + child->visible = TRUE; + ev_view_window_child_move (view, child, child->x, child->y); + gtk_widget_show (window); + } +} + static void ev_view_handle_annotation (EvView *view, EvAnnotation *annot, @@ -2712,21 +2755,13 @@ ev_view_handle_annotation (EvView *view, GtkWidget *window; window = g_object_get_data (G_OBJECT (annot), "popup"); - if (window) { - EvViewWindowChild *child; - - child = ev_view_get_window_child (view, window); - if (!child->visible) { - child->visible = TRUE; - ev_view_window_child_move (view, child, child->x, child->y); - gtk_widget_show (window); - } - } + ev_view_annotation_show_popup_window (view, window); } if (EV_IS_ANNOTATION_ATTACHMENT (annot)) { - EvAttachment *attachment = EV_ANNOTATION_ATTACHMENT (annot)->attachment; + EvAttachment *attachment; + attachment = ev_annotation_attachment_get_attachment (EV_ANNOTATION_ATTACHMENT (annot)); if (attachment) { GError *error = NULL; @@ -2743,6 +2778,144 @@ ev_view_handle_annotation (EvView *view, } } +static void +ev_view_create_annotation (EvView *view, + EvAnnotationType annot_type, + gint x, + gint y) +{ + EvAnnotation *annot; + GdkPoint point; + GdkRectangle page_area; + GtkBorder border; + EvRectangle doc_rect, popup_rect; + EvPage *page; + GdkColor color = { 0, 65535, 65535, 0 }; + GdkRectangle view_rect; + cairo_region_t *region; + + point.x = x; + point.y = y; + ev_view_get_page_extents (view, view->current_page, &page_area, &border); + view_point_to_doc_point (view, &point, &page_area, + &doc_rect.x1, &doc_rect.y1); + doc_rect.x2 = doc_rect.x1 + 24; + doc_rect.y2 = doc_rect.y1 + 24; + + ev_document_doc_mutex_lock (); + page = ev_document_get_page (view->document, view->current_page); + switch (annot_type) { + case EV_ANNOTATION_TYPE_TEXT: + annot = ev_annotation_text_new (page); + break; + case EV_ANNOTATION_TYPE_ATTACHMENT: + /* TODO */ + g_object_unref (page); + ev_document_doc_mutex_unlock (); + return; + default: + g_assert_not_reached (); + } + g_object_unref (page); + + ev_annotation_set_color (annot, &color); + + if (EV_IS_ANNOTATION_MARKUP (annot)) { + popup_rect.x1 = doc_rect.x2; + popup_rect.x2 = popup_rect.x1 + 200; + popup_rect.y1 = doc_rect.y2; + popup_rect.y2 = popup_rect.y1 + 150; + g_object_set (annot, + "rectangle", &popup_rect, + "has_popup", TRUE, + "popup_is_open", FALSE, + "label", g_get_real_name (), + "opacity", 1.0, + NULL); + } + ev_document_annotations_add_annotation (EV_DOCUMENT_ANNOTATIONS (view->document), + annot, &doc_rect); + ev_document_doc_mutex_unlock (); + + /* If the page didn't have annots, mark the cache as dirty */ + if (!ev_page_cache_get_annot_mapping (view->page_cache, view->current_page)) + ev_page_cache_mark_dirty (view->page_cache, view->current_page); + + if (EV_IS_ANNOTATION_MARKUP (annot)) { + GtkWindow *parent; + GtkWidget *window; + + parent = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (view))); + window = ev_view_create_annotation_window (view, annot, parent); + + /* Show the annot window the first time */ + ev_view_annotation_show_popup_window (view, window); + } + + doc_rect_to_view_rect (view, view->current_page, &doc_rect, &view_rect); + view_rect.x -= view->scroll_x; + view_rect.y -= view->scroll_y; + region = cairo_region_create_rectangle (&view_rect); + ev_view_reload_page (view, view->current_page, region); + cairo_region_destroy (region); + + g_signal_emit (view, signals[SIGNAL_ANNOT_ADDED], 0, annot); +} + +void +ev_view_focus_annotation (EvView *view, + EvMapping *annot_mapping) +{ + GdkRectangle view_rect; + EvAnnotation *annot; + guint page; + + if (!EV_IS_DOCUMENT_ANNOTATIONS (view->document)) + return; + + if (view->focus_annotation == annot_mapping) + return; + + view->focus_annotation = annot_mapping; + annot = (EvAnnotation *)annot_mapping->data; + + page = ev_annotation_get_page_index (annot); + ev_document_model_set_page (view->model, page); + + doc_rect_to_view_rect (view, page, + &annot_mapping->area, &view_rect); + ensure_rectangle_is_visible (view, &view_rect); + gtk_widget_queue_draw (GTK_WIDGET (view)); +} + +void +ev_view_begin_add_annotation (EvView *view, + EvAnnotationType annot_type) +{ + if (annot_type == EV_ANNOTATION_TYPE_UNKNOWN) + return; + + if (view->adding_annot) + return; + + view->adding_annot = TRUE; + view->adding_annot_type = annot_type; + ev_view_set_cursor (view, EV_VIEW_CURSOR_ADD); +} + +void +ev_view_cancel_add_annotation (EvView *view) +{ + gint x, y; + + if (!view->adding_annot) + return; + + view->adding_annot = FALSE; + gtk_widget_get_pointer (GTK_WIDGET (view), &x, &y); + ev_view_handle_cursor_over_xy (view, x, y); +} + static gboolean ev_view_synctex_backward_search (EvView *view, gdouble x, @@ -2967,7 +3140,7 @@ ev_view_size_allocate (GtkWidget *widget, for (l = children; l && l->data; l = g_list_next (l)) { EvFormField *field; GdkRectangle view_area; - GList *form_field_mapping; + EvMappingList *form_field_mapping; GtkAllocation child_allocation; GtkRequisition child_requisition; GtkWidget *child = (GtkWidget *)l->data; @@ -3010,7 +3183,7 @@ ev_view_size_allocate (GtkWidget *widget, child = (EvViewWindowChild *)l->data; - doc_rect = *ev_annotation_window_get_rectangle (EV_ANNOTATION_WINDOW (child->window)); + ev_annotation_window_get_rectangle (EV_ANNOTATION_WINDOW (child->window), &doc_rect); if (child->moved) { doc_rect.x1 = child->orig_x; doc_rect.y1 = child->orig_y; @@ -3172,6 +3345,8 @@ ev_view_expose_event (GtkWidget *widget, highlight_find_results (view, i); if (page_ready && EV_IS_DOCUMENT_ANNOTATIONS (view->document)) show_annotation_windows (view, i); + if (page_ready && view->focus_annotation) + focus_annotation (view, i, &event->area); if (page_ready && view->synctex_result) highlight_forward_search_results (view, i); } @@ -3229,9 +3404,9 @@ get_link_area (EvView *view, EvLink *link, GdkRectangle *area) { - GList *link_mapping; - gint page; - gint x_offset = 0, y_offset = 0; + EvMappingList *link_mapping; + gint page; + gint x_offset = 0, y_offset = 0; x += view->scroll_x; y += view->scroll_y; @@ -3251,9 +3426,9 @@ get_annot_area (EvView *view, EvAnnotation *annot, GdkRectangle *area) { - GList *annot_mapping; - gint page; - gint x_offset = 0, y_offset = 0; + EvMappingList *annot_mapping; + gint page; + gint x_offset = 0, y_offset = 0; x += view->scroll_x; y += view->scroll_y; @@ -3279,14 +3454,18 @@ ev_view_query_tooltip (GtkWidget *widget, gchar *text; annot = ev_view_get_annotation_at_location (view, x, y); - if (annot && annot->contents) { - GdkRectangle annot_area; + if (annot) { + const gchar *contents; - get_annot_area (view, x, y, annot, &annot_area); - gtk_tooltip_set_text (tooltip, annot->contents); - gtk_tooltip_set_tip_area (tooltip, &annot_area); + if ((contents = ev_annotation_get_contents (annot))) { + GdkRectangle annot_area; - return TRUE; + get_annot_area (view, x, y, annot, &annot_area); + gtk_tooltip_set_text (tooltip, contents); + gtk_tooltip_set_tip_area (tooltip, &annot_area); + + return TRUE; + } } link = ev_view_get_link_at_location (view, x, y); @@ -3354,13 +3533,15 @@ ev_view_button_press_event (GtkWidget *widget, window = EV_ANNOTATION_WINDOW (view->window_child_focus->window); annot = ev_annotation_window_get_annotation (window); ev_annotation_window_ungrab_focus (window); - ev_view_annotation_save (view, annot); view->window_child_focus = NULL; } view->pressed_button = event->button; view->selection_info.in_drag = FALSE; + if (view->adding_annot) + return FALSE; + if (view->scroll_info.autoscrolling) return TRUE; @@ -3408,6 +3589,9 @@ ev_view_button_press_event (GtkWidget *widget, gtk_widget_queue_draw (widget); } + if (view->focus_annotation) + view->focus_annotation = NULL; + if (EV_IS_SELECTION (view->document)) start_selection_for_event (view, event); } @@ -3812,7 +3996,12 @@ ev_view_button_release_event (GtkWidget *widget, view->pressed_button = -1; return TRUE; - } + } + + if (view->pressed_button == 1 && event->state & GDK_CONTROL_MASK) { + view->pressed_button = -1; + return TRUE; + } if (view->drag_info.in_drag) { view->drag_info.release_timeout_id = @@ -3826,6 +4015,19 @@ ev_view_button_release_event (GtkWidget *widget, view->drag_info.in_drag = FALSE; + if (view->adding_annot && view->pressed_button == 1) { + view->adding_annot = FALSE; + ev_view_handle_cursor_over_xy (view, event->x, event->y); + view->pressed_button = -1; + + ev_view_create_annotation (view, + view->adding_annot_type, + event->x + view->scroll_x, + event->y + view->scroll_y); + + return FALSE; + } + if (view->pressed_button == 2) { ev_view_handle_cursor_over_xy (view, event->x, event->y); } @@ -4049,6 +4251,29 @@ highlight_forward_search_results (EvView *view, int page) cairo_destroy (cr); } +static void +focus_annotation (EvView *view, + gint page, + GdkRectangle *clip) +{ + GtkWidget *widget = GTK_WIDGET (view); + GdkRectangle rect; + EvMapping *mapping = view->focus_annotation; + EvAnnotation *annot = (EvAnnotation *)mapping->data; + + if (ev_annotation_get_page_index (annot) != page) + return; + + doc_rect_to_view_rect (view, page, &mapping->area, &rect); + gtk_paint_focus (gtk_widget_get_style (widget), + gtk_layout_get_bin_window (GTK_LAYOUT (view)), + gtk_widget_get_state (widget), + NULL, widget, NULL, + rect.x - view->scroll_x, + rect.y - view->scroll_y, + rect.width + 1, rect.height + 1); +} + static void ev_view_loading_window_move (EvView *view) { @@ -4156,7 +4381,7 @@ draw_one_page (EvView *view, bin_window = gtk_layout_get_bin_window (GTK_LAYOUT (view)); current_page = ev_document_model_get_page (view->model); inverted_colors = ev_document_model_get_inverted_colors (view->model); - ev_document_misc_paint_one_page (bin_window, + ev_document_misc_paint_one_page (cr, GTK_WIDGET (view), page_area, border, page == current_page, @@ -4350,10 +4575,12 @@ ev_view_get_accessible (GtkWidget *widget) factory = atk_registry_get_factory (registry, derived_type); derived_atk_type = atk_object_factory_get_accessible_type (factory); - if (g_type_is_a (derived_atk_type, GTK_TYPE_ACCESSIBLE)) - atk_registry_set_factory_type (registry, + if (g_type_is_a (derived_atk_type, GTK_TYPE_ACCESSIBLE)) { + atk_registry_set_factory_type (registry, EV_TYPE_VIEW, ev_view_accessible_factory_get_type ()); + EV_VIEW (widget)->a11y_enabled = TRUE; + } first_time = FALSE; } return GTK_WIDGET_CLASS (ev_view_parent_class)->get_accessible (widget); @@ -4445,6 +4672,14 @@ ev_view_class_init (EvViewClass *class) g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1, G_TYPE_POINTER); + signals[SIGNAL_ANNOT_ADDED] = g_signal_new ("annot-added", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, + G_STRUCT_OFFSET (EvViewClass, annot_added), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + EV_TYPE_ANNOTATION); binding_set = gtk_binding_set_by_class (class); @@ -4633,6 +4868,14 @@ setup_caches (EvView *view) view->height_to_page_cache = ev_view_get_height_to_page_cache (view); view->pixbuf_cache = ev_pixbuf_cache_new (GTK_WIDGET (view), view->model, view->pixbuf_cache_size); view->page_cache = ev_page_cache_new (view->document); + if (view->a11y_enabled) { + EvJobPageDataFlags flags = ev_page_cache_get_flags (view->page_cache); + + ev_page_cache_set_flags (view->page_cache, + flags | + EV_PAGE_DATA_INCLUDE_TEXT_LAYOUT | + EV_PAGE_DATA_INCLUDE_TEXT); + } inverted_colors = ev_document_model_get_inverted_colors (view->model); ev_pixbuf_cache_set_inverted_colors (view->pixbuf_cache, inverted_colors); g_signal_connect (view->pixbuf_cache, "job-finished", G_CALLBACK (job_finished_cb), view); @@ -5606,12 +5849,14 @@ merge_selection_region (EvView *view, /* Now we figure out what needs redrawing */ if (old_sel && new_sel) { if (old_sel->covered_region && new_sel->covered_region) { - cairo_region_t *tbr; - /* We only want to redraw the areas that have * changed, so we xor the old and new regions * and redraw if it's different */ region = cairo_region_copy (old_sel->covered_region); +#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 9, 12) + cairo_region_xor (region, new_sel->covered_region); +#else + cairo_region_t *tbr; tbr = cairo_region_copy (new_sel->covered_region); /* xor old_sel, new_sel*/ @@ -5619,6 +5864,7 @@ merge_selection_region (EvView *view, cairo_region_subtract (region, new_sel->covered_region); cairo_region_union (region, tbr); cairo_region_destroy (tbr); +#endif if (cairo_region_is_empty (region)) { cairo_region_destroy (region);