From 00efc5c16ed191f07f9a8a5d00acc41ddb064b46 Mon Sep 17 00:00:00 2001 From: Jonathan Blandford Date: Sat, 06 Aug 2005 05:13:20 +0000 Subject: Clean up selection to be much smoother! Sat Aug 6 01:12:44 2005 Jonathan Blandford * NOTES: * backend/ev-selection.c: (ev_selection_render_selection): * backend/ev-selection.h: * pdf/ev-poppler.cc: * shell/ev-jobs.c: (ev_job_render_dispose), (ev_job_render_new), (ev_job_render_run): * shell/ev-jobs.h: * shell/ev-pixbuf-cache.c: (dispose_cache_job_info), (ev_pixbuf_cache_new), (job_finished_cb), (add_job_if_needed), (convert_gdk_color_to_uint), (ev_pixbuf_cache_get_text_mapping), (ev_pixbuf_cache_style_changed), (ev_pixbuf_cache_get_selection_pixbuf), (ev_pixbuf_cache_set_selection_list), (ev_pixbuf_cache_get_selection_list): * shell/ev-pixbuf-cache.h: * shell/ev-utils.c: (ev_print_region_contents): * shell/ev-utils.h: * shell/ev-view.c: (ev_view_queue_draw_page), (selection_update_idle_cb), (ev_view_motion_notify_event), (ev_view_style_set), (draw_one_page), (ev_view_class_init), (setup_caches), (ev_view_find_next), (merge_selection_region), (selection_free): * shell/ev-window.c: (ev_window_update_fullscreen_popup): Clean up selection to be much smoother! --- (limited to 'shell/ev-jobs.c') diff --git a/shell/ev-jobs.c b/shell/ev-jobs.c index c250f0e..595f9e8 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,6 +236,8 @@ ev_job_render_new (EvDocument *document, gint width, gint height, EvRectangle *selection_points, + guint text, + guint base, gboolean include_links, gboolean include_text, gboolean include_selection) @@ -242,6 +254,8 @@ 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; @@ -285,12 +299,18 @@ ev_job_render_run (EvJobRender *job) job->link_mapping = ev_document_get_links (EV_JOB (job)->document, job->rc->page); 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)) + 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; } -- cgit v0.9.1