It doesn't depend on scale and rotation so we only need the page.
static gchar *
djvu_selection_get_selected_text (EvSelection *selection,
- EvRenderContext *rc,
+ EvPage *page,
EvSelectionStyle style,
EvRectangle *points)
{
gchar *text;
djvu_document_get_page_size (EV_DOCUMENT (djvu_document),
- rc->page, &width, &height);
+ page, &width, &height);
rectangle.x1 = points->x1 / SCALE_FACTOR;
rectangle.y1 = (height - points->y2) / SCALE_FACTOR;
rectangle.x2 = points->x2 / SCALE_FACTOR;
rectangle.y2 = (height - points->y1) / SCALE_FACTOR;
- text = djvu_text_copy (djvu_document, rc->page->index, &rectangle);
+ text = djvu_text_copy (djvu_document, page->index, &rectangle);
if (text == NULL)
text = g_strdup ("");
static gchar *
pdf_selection_get_selected_text (EvSelection *selection,
- EvRenderContext *rc,
+ EvPage *page,
EvSelectionStyle style,
EvRectangle *points)
{
double height;
char *retval;
- poppler_page = POPPLER_PAGE (rc->page->backend_page);
+ poppler_page = POPPLER_PAGE (page->backend_page);
poppler_page_get_size (poppler_page, NULL, &height);
r.x1 = points->x1;
gchar *
ev_selection_get_selected_text (EvSelection *selection,
- EvRenderContext *rc,
+ EvPage *page,
EvSelectionStyle style,
EvRectangle *points)
{
EvSelectionInterface *iface = EV_SELECTION_GET_IFACE (selection);
- return iface->get_selected_text (selection, rc, style, points);
+ return iface->get_selected_text (selection, page, style, points);
}
GdkRegion *
GdkColor *text,
GdkColor *base);
gchar * (* get_selected_text) (EvSelection *selection,
- EvRenderContext *rc,
+ EvPage *page,
EvSelectionStyle style,
EvRectangle *points);
GdkRegion * (* get_selection_map) (EvSelection *selection,
GdkColor *text,
GdkColor *base);
gchar *ev_selection_get_selected_text (EvSelection *selection,
- EvRenderContext *rc,
+ EvPage *page,
EvSelectionStyle style,
EvRectangle *points);
GdkRegion *ev_selection_get_selection_map (EvSelection *selection,
GString *text;
GList *l;
gchar *normalized_text;
- EvRenderContext *rc;
text = g_string_new (NULL);
- rc = ev_render_context_new (NULL, view->rotation, view->scale);
ev_document_doc_mutex_lock ();
gchar *tmp;
page = ev_document_get_page (view->document, selection->page);
- ev_render_context_set_page (rc, page);
- g_object_unref (page);
-
tmp = ev_selection_get_selected_text (EV_SELECTION (view->document),
- rc, selection->style,
+ page, selection->style,
&(selection->rect));
-
+ g_object_unref (page);
g_string_append (text, tmp);
g_free (tmp);
}
- g_object_unref (rc);
-
ev_document_doc_mutex_unlock ();
normalized_text = g_utf8_normalize (text->str, text->len, G_NORMALIZE_NFKC);