]> www.fi.muni.cz Git - evince.git/blob - shell/ev-view-private.h
Add support for double and triple click selections.
[evince.git] / shell / ev-view-private.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; c-indent-level: 8 -*- */
2 /* this file is part of evince, a gnome document viewer
3  *
4  *  Copyright (C) 2004 Red Hat, Inc
5  *
6  * Evince is free software; you can redistribute it and/or modify it
7  * under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * Evince is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
19  */
20
21 #ifndef __EV_VIEW_PRIVATE_H__
22 #define __EV_VIEW_PRIVATE_H__
23
24 #include "ev-view.h"
25 #include "ev-pixbuf-cache.h"
26 #include "ev-page-cache.h"
27 #include "ev-image.h"
28 #include "ev-form-field.h"
29 #include "ev-selection.h"
30
31 /* Information for middle clicking and moving around the doc */
32 typedef struct {
33         gboolean in_drag;
34         GdkPoint start;
35         gdouble hadj;
36         gdouble vadj;
37 } DragInfo;
38
39 /* Information for handling selection */
40 typedef struct {
41         gboolean in_drag;
42         GdkPoint start;
43         gboolean in_selection;
44         GList *selections;
45         EvSelectionStyle style;
46 } SelectionInfo;
47
48 /* Information for handling images DND */
49 typedef struct {
50         gboolean in_drag;
51         GdkPoint start;
52         EvImage *image;
53 } ImageDNDInfo;
54
55 typedef enum {
56         SCROLL_TO_KEEP_POSITION,
57         SCROLL_TO_PAGE_POSITION,
58         SCROLL_TO_CENTER,
59         SCROLL_TO_FIND_LOCATION,
60 } PendingScroll;
61
62 typedef enum {
63         EV_VIEW_CURSOR_NORMAL,
64         EV_VIEW_CURSOR_IBEAM,
65         EV_VIEW_CURSOR_LINK,
66         EV_VIEW_CURSOR_WAIT,
67         EV_VIEW_CURSOR_HIDDEN,
68         EV_VIEW_CURSOR_DRAG
69 } EvViewCursor;
70
71 typedef enum {
72         EV_PRESENTATION_NORMAL,
73         EV_PRESENTATION_BLACK,
74         EV_PRESENTATION_WHITE,
75         EV_PRESENTATION_END
76 } EvPresentationState;
77
78 struct _EvView {
79         GtkLayout layout;
80
81         EvDocument *document;
82
83         char *find_status;
84         int find_result;
85         gboolean jump_to_find_result;
86         gboolean highlight_find_results;
87         
88         EvPageCache *page_cache;
89         EvPixbufCache *pixbuf_cache;
90         EvViewCursor cursor;
91         EvJobRender *current_job;
92
93         /* Scrolling */
94         GtkAdjustment *hadjustment;
95         GtkAdjustment *vadjustment;
96
97         gint scroll_x;
98         gint scroll_y;  
99
100         PendingScroll pending_scroll;
101         gboolean      pending_resize;
102         EvPoint       pending_point;
103
104         /* Current geometry */
105     
106         gint start_page;
107         gint end_page;
108         gint current_page;
109
110         gint rotation;
111         gdouble scale;
112         gint spacing;
113         gdouble dpi;
114         gdouble max_scale;
115         gdouble min_scale;
116
117         gboolean loading;
118         gboolean continuous;
119         gboolean dual_page;
120         gboolean fullscreen;
121         gboolean presentation;
122         EvSizingMode sizing_mode;
123         cairo_surface_t *loading_text;
124
125         /* Presentation */
126         EvPresentationState presentation_state;
127         EvSizingMode sizing_mode_saved;
128         double scale_saved;
129         guint  trans_timeout_id;
130
131         /* Common for button press handling */
132         int pressed_button;
133
134         /* Information for middle clicking and dragging around. */
135         DragInfo drag_info;
136
137         /* Selection */
138         GdkPoint motion;
139         guint selection_update_id;
140         guint selection_scroll_id;
141
142         EvViewSelectionMode selection_mode;
143         SelectionInfo selection_info;
144
145         /* Image DND */
146         ImageDNDInfo image_dnd_info;
147
148 #if !GTK_CHECK_VERSION (2, 11, 7)
149         /* Links */
150         GtkWidget *link_tooltip;
151         EvLink *hovered_link;
152 #endif
153
154         /* Goto Popup */
155         GtkWidget *goto_window;
156         GtkWidget *goto_entry;
157 };
158
159 struct _EvViewClass {
160         GtkLayoutClass parent_class;
161
162         void    (*binding_activated)      (EvView         *view,
163                                            EvScrollType   scroll,
164                                            gboolean        horizontal);
165         void    (*zoom_invalid)           (EvView         *view);
166         void    (*handle_link)            (EvView         *view,
167                                            EvLink         *link);
168         void    (*external_link)          (EvView         *view,
169                                            EvLinkAction   *action);
170         void    (*popup_menu)             (EvView         *view,
171                                            EvLink         *link);
172 };
173
174 #endif  /* __EV_VIEW_PRIVATE_H__ */
175