]> www.fi.muni.cz Git - evince.git/commitdiff
Use EvPage instead of a render context to get the selection map
authorCarlos Garcia Campos <carlosgc@gnome.org>
Tue, 8 Dec 2009 12:26:44 +0000 (13:26 +0100)
committerCarlos Garcia Campos <carlosgc@gnome.org>
Tue, 8 Dec 2009 12:41:02 +0000 (13:41 +0100)
Selection map doesn't depend on scale/rotation so only the page is
needed.

backend/pdf/ev-poppler.cc
libdocument/ev-selection.c
libdocument/ev-selection.h
libview/ev-jobs.c

index 784295c0fbe811982b1e7ec775a456abc449908b..506e9349b0ce23b7052eaa286a56024e84c0dcb2 100644 (file)
@@ -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;
index c19ac2a36a15938d041fc45b99ca38f7edf704fb..017036f45b091bc3b38a6992e58b9dfa96c9ff87 100644 (file)
@@ -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);
 }
index 7a1252a10c7ff4df8b1eb1549c17d594ca4120f8..4e896065dc530f4ec879cf8a637191c36965c343 100644 (file)
@@ -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,
index a0866d508b0ec31d7ef8aed7312b3ae56677ad7f..620ea66709495d450b1e75d4cc779c3e3c7c67d0 100644 (file)
@@ -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);