X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;ds=sidebyside;f=libdocument%2Fev-selection.c;h=017036f45b091bc3b38a6992e58b9dfa96c9ff87;hb=7d59434cbd7ea6bdd42a6f3223a47cbb06ba4069;hp=f7aee2f79045c68ac2b4f273b85fd819e8f22ef2;hpb=217797d63b2d3b1c9a7a0511af1bbf3d99f0d482;p=evince.git diff --git a/libdocument/ev-selection.c b/libdocument/ev-selection.c index f7aee2f7..017036f4 100644 --- a/libdocument/ev-selection.c +++ b/libdocument/ev-selection.c @@ -22,72 +22,68 @@ #include "ev-selection.h" -static void ev_selection_base_init (gpointer g_class); - -GType -ev_selection_get_type (void) -{ - static GType type = 0; - - if (G_UNLIKELY (type == 0)) - { - const GTypeInfo our_info = - { - sizeof (EvSelectionIface), - ev_selection_base_init, - NULL, - }; - - type = g_type_register_static (G_TYPE_INTERFACE, - "EvSelection", - &our_info, (GTypeFlags)0); - } - - return type; -} +EV_DEFINE_INTERFACE (EvSelection, ev_selection, 0) static void -ev_selection_base_init (gpointer g_class) +ev_selection_class_init (EvSelectionIface *klass) { - static gboolean initialized = FALSE; - - if (!initialized) { - } } - void ev_selection_render_selection (EvSelection *selection, EvRenderContext *rc, 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 * -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); - return iface->get_selection_map (selection, rc); + if (!iface->get_selection_map) + return NULL; + + return iface->get_selection_map (selection, page); }