Evince
Evince is a document viewer capable of displaying multiple and single page document formats like PDF and Postscript.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ev-view-private.h
Go to the documentation of this file.
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19  */
20 
21 #if !defined (EVINCE_COMPILATION)
22 #error "This is a private header."
23 #endif
24 
25 #ifndef __EV_VIEW_PRIVATE_H__
26 #define __EV_VIEW_PRIVATE_H__
27 
28 #include "ev-view.h"
29 #include "ev-document-model.h"
30 #include "ev-pixbuf-cache.h"
31 #include "ev-page-cache.h"
32 #include "ev-jobs.h"
33 #include "ev-image.h"
34 #include "ev-form-field.h"
35 #include "ev-selection.h"
36 #include "ev-view-cursor.h"
37 
38 #define DRAG_HISTORY 10
39 
40 /* Information for middle clicking and moving around the doc */
41 typedef struct {
42  gboolean in_drag;
43  GdkPoint start;
44  gdouble hadj;
45  gdouble vadj;
48  GdkPoint buffer[DRAG_HISTORY];
49  GdkPoint momentum;
50 } DragInfo;
51 
52 /* Autoscrolling */
53 typedef struct {
54  gboolean autoscrolling;
55  guint last_y;
56  guint start_y;
57  guint timeout_id;
59 
60 /* Information for handling selection */
61 typedef struct {
62  gboolean in_drag;
63  GdkPoint start;
64  GList *selections;
67 
68 /* Information for handling images DND */
69 typedef struct {
70  gboolean in_drag;
71  GdkPoint start;
73 } ImageDNDInfo;
74 
75 typedef enum {
79 } EvPanAction;
80 
81 /* Annotation popup windows */
82 typedef struct {
83  GtkWidget *window;
84  guint page;
85 
86  /* Current position */
87  gint x;
88  gint y;
89 
90  /* EvView root position */
91  gint parent_x;
92  gint parent_y;
93 
94  /* Document coords */
95  gdouble orig_x;
96  gdouble orig_y;
97 
98  gboolean visible;
99  gboolean moved;
101 
102 typedef enum {
107 } PendingScroll;
108 
109 typedef struct _EvHeightToPageCache {
110  gint rotation;
111  gboolean dual_even_left;
112  gdouble *height_to_page;
115 
116 /* Information for handling annotations */
117 typedef struct {
118  GdkPoint start;
119  GdkPoint stop;
120  gboolean adding_annot;
124 
125 typedef struct {
126  GdkPoint start;
128  gboolean annot_clicked;
129  gboolean moving_annot;
132 
133 struct _EvView {
134  GtkContainer layout;
135 
136  /* Container */
137  GList *children;
138 
140 
141  /* Find */
143  GList **find_pages; /* Backwards compatibility */
144  gint find_page;
148 
156 
157  GtkRequisition requisition;
159 
160  /* Scrolling */
161  GtkAdjustment *hadjustment;
162  GtkAdjustment *vadjustment;
163  /* GtkScrollablePolicy needs to be checked when
164  * driving the scrollable adjustment values */
165  guint hscroll_policy : 1;
166  guint vscroll_policy : 1;
167 
168  gint scroll_x;
169  gint scroll_y;
170 
171  /* Delta sum for emulating normal scrolling */
172  gdouble total_delta;
174  gboolean pending_resize;
176 
177  /* Current geometry */
178 
180  gint end_page;
182 
183  gint rotation;
184  gdouble scale;
185  gint spacing;
186 
187  gboolean loading;
188  gboolean can_zoom_in;
189  gboolean can_zoom_out;
190  gboolean continuous;
191  gboolean dual_even_left;
192  gboolean fullscreen;
195  GtkWidget *loading_window;
198 
199  /* Common for button press handling */
201 
202  /* Key bindings propagation */
204 
205  /* Information for middle clicking and dragging around. */
207 
208  /* Autoscrolling */
210 
211  /* Selection */
212  GdkPoint motion;
215 
217 
218  /* Copy link address selection */
220 
221  /* Image DND */
223 
224  /* Annotations */
229  GHashTable *annot_window_map;
230 
231  /* Focus */
235 
236  /* Synctex */
238 
239  /* Accessibility */
240  AtkObject *accessible;
241 
242  /* Caret navigation */
243  gboolean caret_enabled;
247  gboolean cursor_visible;
250 
251  /* Gestures */
252  GtkGesture *pan_gesture;
253  GtkGesture *zoom_gesture;
256 
257  /* Current zoom center */
258  gdouble zoom_center_x;
259  gdouble zoom_center_y;
260 };
261 
262 struct _EvViewClass {
263  GtkContainerClass parent_class;
264 
265  void (*scroll) (EvView *view,
266  GtkScrollType scroll,
267  GtkOrientation orientation);
268  void (*handle_link) (EvView *view,
269  EvLink *link);
270  void (*external_link) (EvView *view,
271  EvLinkAction *action);
272  void (*popup_menu) (EvView *view,
273  GList *items);
274  void (*selection_changed) (EvView *view);
275  void (*sync_source) (EvView *view,
276  EvSourceLink *link);
277  void (*annot_added) (EvView *view,
278  EvAnnotation *annot);
279  void (*annot_removed) (EvView *view,
280  EvAnnotation *annot);
281  void (*layers_changed) (EvView *view);
282  gboolean (*move_cursor) (EvView *view,
283  GtkMovementStep step,
284  gint count,
285  gboolean extend_selection);
286  void (*activate) (EvView *view);
287 };
288 
290  gint page,
291  gdouble scale,
292  gint rotation,
293  gint *page_width,
294  gint *page_height);
296  GdkPoint *view_point,
297  GdkRectangle *page_area,
298  GtkBorder *border,
299  double *doc_point_x,
300  double *doc_point_y);
302  GdkRectangle *view_rect,
303  GdkRectangle *page_area,
304  GtkBorder *border,
305  EvRectangle *doc_rect);
307  int page,
308  EvPoint *doc_point,
309  GdkPoint *view_point);
311  int page,
312  EvRectangle *doc_rect,
313  GdkRectangle *view_rect);
315  GdkRGBA *bg_color,
316  GdkRGBA *fg_color);
318  gint page,
319  gdouble doc_x,
320  gdouble doc_y);
321 
322 void _ev_view_clear_selection (EvView *view);
323 void _ev_view_set_selection (EvView *view,
324  GdkPoint *start_point,
325  GdkPoint *end_point);
326 
328  EvMapping *element_mapping,
329  gint page);
331  EvFormField *field);
332 
333 #endif /* __EV_VIEW_PRIVATE_H__ */
334