From: Carlos Garcia Campos Date: Tue, 8 Dec 2009 12:26:44 +0000 (+0100) Subject: Use EvPage instead of a render context to get the selection map X-Git-Tag: EVINCE_2_29_4~28 X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=ed252626b3d584bc3d98649ce2a217c0b82ec50b;p=evince.git Use EvPage instead of a render context to get the selection map Selection map doesn't depend on scale/rotation so only the page is needed. --- diff --git a/backend/pdf/ev-poppler.cc b/backend/pdf/ev-poppler.cc index 784295c0..506e9349 100644 --- a/backend/pdf/ev-poppler.cc +++ b/backend/pdf/ev-poppler.cc @@ -2012,15 +2012,15 @@ pdf_selection_get_selection_region (EvSelection *selection, } static GdkRegion * -pdf_selection_get_selection_map (EvSelection *selection, - EvRenderContext *rc) +pdf_selection_get_selection_map (EvSelection *selection, + EvPage *page) { PopplerPage *poppler_page; PopplerRectangle points; GList *region; GdkRegion *retval; - poppler_page = POPPLER_PAGE (rc->page->backend_page); + poppler_page = POPPLER_PAGE (page->backend_page); points.x1 = 0.0; points.y1 = 0.0; diff --git a/libdocument/ev-selection.c b/libdocument/ev-selection.c index c19ac2a3..017036f4 100644 --- a/libdocument/ev-selection.c +++ b/libdocument/ev-selection.c @@ -77,13 +77,13 @@ ev_selection_get_selection_region (EvSelection *selection, } GdkRegion * -ev_selection_get_selection_map (EvSelection *selection, - EvRenderContext *rc) +ev_selection_get_selection_map (EvSelection *selection, + EvPage *page) { EvSelectionIface *iface = EV_SELECTION_GET_IFACE (selection); if (!iface->get_selection_map) return NULL; - - return iface->get_selection_map (selection, rc); + + return iface->get_selection_map (selection, page); } diff --git a/libdocument/ev-selection.h b/libdocument/ev-selection.h index 7a1252a1..4e896065 100644 --- a/libdocument/ev-selection.h +++ b/libdocument/ev-selection.h @@ -65,7 +65,7 @@ struct _EvSelectionIface EvSelectionStyle style, EvRectangle *points); GdkRegion * (* get_selection_map) (EvSelection *selection, - EvRenderContext *rc); + EvPage *page); GdkRegion * (* get_selection_region) (EvSelection *selection, EvRenderContext *rc, EvSelectionStyle style, @@ -86,7 +86,7 @@ gchar *ev_selection_get_selected_text (EvSelection *selection, EvSelectionStyle style, EvRectangle *points); GdkRegion *ev_selection_get_selection_map (EvSelection *selection, - EvRenderContext *rc); + EvPage *page); GdkRegion *ev_selection_get_selection_region (EvSelection *selection, EvRenderContext *rc, EvSelectionStyle style, diff --git a/libview/ev-jobs.c b/libview/ev-jobs.c index a0866d50..620ea667 100644 --- a/libview/ev-jobs.c +++ b/libview/ev-jobs.c @@ -553,7 +553,7 @@ ev_job_render_run (EvJob *job) if ((job_render->flags & EV_RENDER_INCLUDE_TEXT) && EV_IS_SELECTION (job->document)) job_render->text_mapping = - ev_selection_get_selection_map (EV_SELECTION (job->document), rc); + ev_selection_get_selection_map (EV_SELECTION (job->document), job_render->ev_page); if ((job_render->flags & EV_RENDER_INCLUDE_LINKS) && EV_IS_DOCUMENT_LINKS (job->document)) job_render->link_mapping = ev_document_links_get_links (EV_DOCUMENT_LINKS (job->document), job_render->page);