X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=shell%2Fev-jobs.c;h=0f9bf7352498daccac86269c0f69e7c12aa1d381;hb=205c689a78e992d1ad3cf9223f7c95bf424dda94;hp=3bc2fa883ccd260684a4a8ec201b29a7a81060dd;hpb=e93b3a265bbc02546d230204402e3f41e83d6ab5;p=evince.git diff --git a/shell/ev-jobs.c b/shell/ev-jobs.c index 3bc2fa88..0f9bf735 100644 --- a/shell/ev-jobs.c +++ b/shell/ev-jobs.c @@ -116,6 +116,16 @@ ev_job_render_dispose (GObject *object) job->rc = NULL; } + if (job->selection) { + g_object_unref (job->selection); + job->selection = NULL; + } + + if (job->selection_region) { + gdk_region_destroy (job->selection_region); + job->selection_region = NULL; + } + (* G_OBJECT_CLASS (ev_job_render_parent_class)->dispose) (object); } @@ -226,7 +236,10 @@ ev_job_render_new (EvDocument *document, gint width, gint height, EvRectangle *selection_points, + GdkColor *text, + GdkColor *base, gboolean include_links, + gboolean include_text, gboolean include_selection) { EvJobRender *job; @@ -241,7 +254,10 @@ ev_job_render_new (EvDocument *document, job->rc = g_object_ref (rc); job->target_width = width; job->target_height = height; + job->text = *text; + job->base = *base; job->include_links = include_links; + job->include_text = include_text; job->include_selection = include_selection; if (include_selection) @@ -274,19 +290,28 @@ ev_job_render_run (EvJobRender *job) if (EV_JOB (job)->async) { EvAsyncRenderer *renderer = EV_ASYNC_RENDERER (EV_JOB (job)->document); - ev_async_renderer_render_pixbuf (renderer, job->rc->page, job->rc->scale); + ev_async_renderer_render_pixbuf (renderer, job->rc->page, job->rc->scale, + job->rc->rotation); g_signal_connect (EV_JOB (job)->document, "render_finished", G_CALLBACK (render_finished_cb), job); } else { job->pixbuf = ev_document_render_pixbuf (EV_JOB (job)->document, job->rc); if (job->include_links) job->link_mapping = ev_document_get_links (EV_JOB (job)->document, job->rc->page); - if (job->include_selection && EV_IS_SELECTION (EV_JOB (job)->document)) + if (job->include_text && EV_IS_SELECTION (EV_JOB (job)->document)) + job->text_mapping = ev_selection_get_selection_map (EV_SELECTION (EV_JOB (job)->document), job->rc); + if (job->include_selection && EV_IS_SELECTION (EV_JOB (job)->document)) { ev_selection_render_selection (EV_SELECTION (EV_JOB (job)->document), job->rc, &(job->selection), &(job->selection_points), - NULL); + NULL, + &(job->text), &(job->base)); + job->selection_region = + ev_selection_get_selection_region (EV_SELECTION (EV_JOB (job)->document), + job->rc, + &(job->selection_points)); + } EV_JOB (job)->finished = TRUE; } @@ -295,9 +320,10 @@ ev_job_render_run (EvJobRender *job) } EvJob * -ev_job_thumbnail_new (EvDocument *document, - gint page, - gint requested_width) +ev_job_thumbnail_new (EvDocument *document, + gint page, + int rotation, + gint requested_width) { EvJobThumbnail *job; @@ -305,6 +331,7 @@ ev_job_thumbnail_new (EvDocument *document, EV_JOB (job)->document = g_object_ref (document); job->page = page; + job->rotation = rotation; job->requested_width = requested_width; return EV_JOB (job); @@ -320,6 +347,7 @@ ev_job_thumbnail_run (EvJobThumbnail *job) job->thumbnail = ev_document_thumbnails_get_thumbnail (EV_DOCUMENT_THUMBNAILS (EV_JOB (job)->document), job->page, + job->rotation, job->requested_width, TRUE); EV_JOB (job)->finished = TRUE;