From 982600bbceb76a22d5c7b3e0cbe6e20421105ad6 Mon Sep 17 00:00:00 2001 From: Carlos Garcia Campos Date: Fri, 31 Aug 2007 20:37:24 +0000 Subject: Add support for double and triple click selections. 2007-08-31 Carlos Garcia Campos * backend/dvi/dvi-document.c: (dvi_document_document_iface_init): * backend/impress/impress-document.c: (impress_document_document_iface_init): * backend/ps/ps-document.c: (ps_document_document_iface_init): * backend/djvu/djvu-document.c: (djvu_document_document_iface_init), (djvu_selection_get_selected_text), (djvu_selection_iface_init): * backend/tiff/tiff-document.c: (tiff_document_document_iface_init): * backend/pixbuf/pixbuf-document.c: (pixbuf_document_document_iface_init): * backend/comics/comics-document.c: (comics_document_document_iface_init): * backend/pdf/ev-poppler.cc: (pdf_document_document_iface_init), (pdf_selection_render_selection), (pdf_selection_get_selected_text), (pdf_selection_get_selection_region), (pdf_selection_get_selection_map), (pdf_selection_iface_init): * libdocument/ev-selection.[ch]: (ev_selection_get_selected_text), (ev_selection_get_selection_region), (ev_selection_get_selection_map): * libdocument/ev-document.[ch]: * shell/ev-pixbuf-cache.[ch]: (add_job), (ev_pixbuf_cache_get_selection_surface), (update_job_selection): * shell/ev-view-private.h: * shell/ev-jobs.[ch]: (ev_job_render_new), (ev_job_render_new), (ev_job_render_run): * shell/ev-window.c: (ev_window_setup_action_sensitivity): * shell/ev-view.c: (start_selection_for_event), (ev_view_button_press_event), (ev_view_drag_data_get), (ev_view_drag_data_received), (ev_view_button_release_event), (compute_new_selection_text), (compute_selections), (ev_view_select_all), (get_selected_text), (ev_view_copy), (ev_view_primary_get_cb): Add support for double and triple click selections. svn path=/trunk/; revision=2648 --- (limited to 'libdocument/ev-selection.c') diff --git a/libdocument/ev-selection.c b/libdocument/ev-selection.c index f7aee2f..9a7336c 100644 --- a/libdocument/ev-selection.c +++ b/libdocument/ev-selection.c @@ -62,25 +62,45 @@ ev_selection_render_selection (EvSelection *selection, cairo_surface_t **surface, EvRectangle *points, EvRectangle *old_points, - GdkColor *text, - GdkColor *base) + EvSelectionStyle style, + GdkColor *text, + GdkColor *base) { EvSelectionIface *iface = EV_SELECTION_GET_IFACE (selection); + if (!iface->render_selection) + return; + iface->render_selection (selection, rc, surface, points, old_points, + style, text, base); } +gchar * +ev_selection_get_selected_text (EvSelection *selection, + EvRenderContext *rc, + EvSelectionStyle style, + EvRectangle *points) +{ + EvSelectionIface *iface = EV_SELECTION_GET_IFACE (selection); + + return iface->get_selected_text (selection, rc, style, points); +} + GdkRegion * ev_selection_get_selection_region (EvSelection *selection, EvRenderContext *rc, + EvSelectionStyle style, EvRectangle *points) { EvSelectionIface *iface = EV_SELECTION_GET_IFACE (selection); - return iface->get_selection_region (selection, rc, points); + if (!iface->get_selection_region) + return NULL; + + return iface->get_selection_region (selection, rc, style, points); } GdkRegion * @@ -89,5 +109,8 @@ ev_selection_get_selection_map (EvSelection *selection, { EvSelectionIface *iface = EV_SELECTION_GET_IFACE (selection); + if (!iface->get_selection_map) + return NULL; + return iface->get_selection_map (selection, rc); } -- cgit v0.9.1