]> www.fi.muni.cz Git - evince.git/blob - libdocument/ev-selection.c
Reorganize source tree.
[evince.git] / libdocument / ev-selection.c
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; c-indent-level: 8 -*- */
2 /*
3  *  Copyright (C) 2005 Red Hat, Inc.
4  *
5  *  This program is free software; you can redistribute it and/or modify
6  *  it under the terms of the GNU General Public License as published by
7  *  the Free Software Foundation; either version 2, or (at your option)
8  *  any later version.
9  *
10  *  This program is distributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  *  GNU General Public License for more details.
14  *
15  *  You should have received a copy of the GNU General Public License
16  *  along with this program; if not, write to the Free Software
17  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18  *
19  */
20
21 #include "config.h"
22
23 #include "ev-selection.h"
24
25 static void ev_selection_base_init (gpointer g_class);
26
27 GType
28 ev_selection_get_type (void)
29 {
30         static GType type = 0;
31
32         if (G_UNLIKELY (type == 0))
33         {
34                 const GTypeInfo our_info =
35                 {
36                         sizeof (EvSelectionIface),
37                         ev_selection_base_init,
38                         NULL,
39                 };
40
41                 type = g_type_register_static (G_TYPE_INTERFACE,
42                                                "EvSelection",
43                                                &our_info, (GTypeFlags)0);
44         }
45
46         return type;
47 }
48
49 static void
50 ev_selection_base_init (gpointer g_class)
51 {
52         static gboolean initialized = FALSE;
53
54         if (!initialized) {
55         }
56 }
57
58
59 void
60 ev_selection_render_selection (EvSelection      *selection,
61                                EvRenderContext  *rc,
62                                GdkPixbuf       **pixbuf,
63                                EvRectangle      *points,
64                                EvRectangle      *old_points,
65                                GdkColor        *text,
66                                GdkColor        *base)
67 {
68         EvSelectionIface *iface = EV_SELECTION_GET_IFACE (selection);
69
70         iface->render_selection (selection, rc,
71                                  pixbuf,
72                                  points, old_points,
73                                  text, base);
74 }
75
76 GdkRegion *
77 ev_selection_get_selection_region (EvSelection     *selection,
78                                    EvRenderContext *rc,
79                                    EvRectangle     *points)
80 {
81         EvSelectionIface *iface = EV_SELECTION_GET_IFACE (selection);
82
83         return iface->get_selection_region (selection, rc, points);
84 }
85
86 GdkRegion *
87 ev_selection_get_selection_map (EvSelection     *selection,
88                                 EvRenderContext *rc)
89 {
90         EvSelectionIface *iface = EV_SELECTION_GET_IFACE (selection);
91
92         return iface->get_selection_map (selection, rc);
93 }