]> www.fi.muni.cz Git - evince.git/blob - libdocument/ev-annotation.h
47d908dbadfe6c143a24acbe0b455ba9a8296271
[evince.git] / libdocument / ev-annotation.h
1 /* ev-annotation.h
2  *  this file is part of evince, a gnome document viewer
3  *
4  * Copyright (C) 2009 Carlos Garcia Campos <carlosgc@gnome.org>
5  * Copyright (C) 2007 IƱigo Martinez <inigomartinez@gmail.com>
6  *
7  * Evince is free software; you can redistribute it and/or modify it
8  * under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * Evince is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
20  */
21
22 #ifndef EV_ANNOTATION_H
23 #define EV_ANNOTATION_H
24
25 #include <glib-object.h>
26
27 #include "ev-document.h"
28
29 G_BEGIN_DECLS
30
31 /* EvAnnotation */
32 #define EV_TYPE_ANNOTATION                      (ev_annotation_get_type())
33 #define EV_ANNOTATION(object)                   (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_ANNOTATION, EvAnnotation))
34 #define EV_ANNOTATION_CLASS(klass)              (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_ANNOTATION, EvAnnotationClass))
35 #define EV_IS_ANNOTATION(object)                (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_ANNOTATION))
36 #define EV_IS_ANNOTATION_CLASS(klass)           (G_TYPE_CHECK_CLASS_TYPE((klass), EV_TYPE_ANNOTATION))
37 #define EV_ANNOTATION_GET_CLASS(object)         (G_TYPE_INSTANCE_GET_CLASS((object), EV_TYPE_ANNOTATION, EvAnnotationClass))
38
39 /* EvAnnotationMarkup */
40 #define EV_TYPE_ANNOTATION_MARKUP               (ev_annotation_markup_get_type ())
41 #define EV_ANNOTATION_MARKUP(o)                 (G_TYPE_CHECK_INSTANCE_CAST ((o), EV_TYPE_ANNOTATION_MARKUP, EvAnnotationMarkup))
42 #define EV_ANNOTATION_MARKUP_IFACE(k)           (G_TYPE_CHECK_CLASS_CAST((k), EV_TYPE_ANNOTATION_MARKUP, EvAnnotationMarkupIface))
43 #define EV_IS_ANNOTATION_MARKUP(o)              (G_TYPE_CHECK_INSTANCE_TYPE ((o), EV_TYPE_ANNOTATION_MARKUP))
44 #define EV_IS_ANNOTATION_MARKUP_IFACE(k)        (G_TYPE_CHECK_CLASS_TYPE ((k), EV_TYPE_ANNOTATION_MARKUP))
45 #define EV_ANNOTATION_MARKUP_GET_IFACE(inst)    (G_TYPE_INSTANCE_GET_INTERFACE ((inst), EV_TYPE_ANNOTATION_MARKUP, EvAnnotationMarkupIface))
46
47 /* EvAnnotationText */
48 #define EV_TYPE_ANNOTATION_TEXT                 (ev_annotation_text_get_type())
49 #define EV_ANNOTATION_TEXT(object)              (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_ANNOTATION_TEXT, EvAnnotationText))
50 #define EV_ANNOTATION_TEXT_CLASS(klass)         (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_ANNOTATION_TEXT, EvAnnotationTextClass))
51 #define EV_IS_ANNOTATION_TEXT(object)           (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_ANNOTATION_TEXT))
52 #define EV_IS_ANNOTATION_TEXT_CLASS(klass)      (G_TYPE_CHECK_CLASS_TYPE((klass), EV_TYPE_ANNOTATION_TEXT))
53 #define EV_ANNOTATION_TEXT_GET_CLASS(object)    (G_TYPE_INSTANCE_GET_CLASS((object), EV_TYPE_ANNOTATION_TEXT, EvAnnotationTextClass))
54
55 typedef struct _EvAnnotation             EvAnnotation;
56 typedef struct _EvAnnotationClass        EvAnnotationClass;
57
58 typedef struct _EvAnnotationMarkup       EvAnnotationMarkup;
59 typedef struct _EvAnnotationMarkupIface  EvAnnotationMarkupIface;
60
61 typedef struct _EvAnnotationText         EvAnnotationText;
62 typedef struct _EvAnnotationTextClass    EvAnnotationTextClass;
63
64 struct _EvAnnotation
65 {
66         GObject parent;
67
68         EvPage  *page;
69         gboolean changed;
70
71         gchar   *contents;
72         gchar   *name;
73         gchar   *modified;
74         GdkColor color;
75
76 };
77
78 struct _EvAnnotationClass
79 {
80         GObjectClass parent_class;
81 };
82
83 struct _EvAnnotationMarkupIface
84 {
85         GTypeInterface base_iface;
86 };
87
88 struct _EvAnnotationText
89 {
90         EvAnnotation parent;
91
92         gboolean is_open : 1;
93 };
94
95 struct _EvAnnotationTextClass
96 {
97         EvAnnotationClass parent_class;
98 };
99
100 /* EvAnnotation */
101 GType         ev_annotation_get_type             (void) G_GNUC_CONST;
102
103 /* EvAnnotationMarkup */
104 GType         ev_annotation_markup_get_type      (void) G_GNUC_CONST;
105 gchar        *ev_annotation_markup_get_label     (EvAnnotationMarkup *markup);
106 void          ev_annotation_markup_set_label     (EvAnnotationMarkup *markup,
107                                                   const gchar        *label);
108 gdouble       ev_annotation_markup_get_opacity   (EvAnnotationMarkup *markup);
109 void          ev_annotation_markup_set_opacity   (EvAnnotationMarkup *markup,
110                                                   gdouble             opacity);
111 void          ev_annotation_markup_get_rectangle (EvAnnotationMarkup *markup,
112                                                   EvRectangle        *ev_rect);
113 gboolean      ev_annotation_markup_get_is_open   (EvAnnotationMarkup *markup);
114 void          ev_annotation_markup_set_is_open   (EvAnnotationMarkup *markup,
115                                                   gboolean            is_open);
116
117 /* EvAnnotationText */
118 GType         ev_annotation_text_get_type        (void) G_GNUC_CONST;
119 EvAnnotation *ev_annotation_text_new             (EvPage             *page);
120
121
122 /* Annotation Mapping stuff */
123 typedef struct _EvAnnotationMapping   EvAnnotationMapping;
124 struct _EvAnnotationMapping
125 {
126                 EvAnnotation *annotation;
127                 gdouble       x1;
128                 gdouble       y1;
129                 gdouble       x2;
130                 gdouble       y2;
131 };
132
133 void          ev_annotation_mapping_free     (GList       *annotation_mapping);
134 EvAnnotation *ev_annotation_mapping_find     (GList       *annotation_mapping,
135                                               gdouble       x,
136                                               gdouble       y);
137 void          ev_annotation_mapping_get_area (GList        *annotation_mapping,
138                                               EvAnnotation *annotation,
139                                               EvRectangle  *area);
140
141 G_END_DECLS
142
143 #endif /* EV_ANNOTATION_H */