Evince
Evince is a document viewer capable of displaying multiple and single page document formats like PDF and Postscript.
Main Page
Related Pages
Data Structures
Files
File List
Globals
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
;
46
guint
drag_timeout_id
;
47
guint
release_timeout_id
;
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
;
58
}
AutoScrollInfo
;
59
60
/* Information for handling selection */
61
typedef
struct
{
62
gboolean
in_drag
;
63
GdkPoint
start
;
64
GList *
selections
;
65
EvSelectionStyle
style
;
66
}
SelectionInfo
;
67
68
/* Information for handling images DND */
69
typedef
struct
{
70
gboolean
in_drag
;
71
GdkPoint
start
;
72
EvImage
*
image
;
73
}
ImageDNDInfo
;
74
75
typedef
enum
{
76
EV_PAN_ACTION_NONE
,
77
EV_PAN_ACTION_NEXT
,
78
EV_PAN_ACTION_PREV
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
;
100
}
EvViewWindowChild
;
101
102
typedef
enum
{
103
SCROLL_TO_KEEP_POSITION
,
104
SCROLL_TO_PAGE_POSITION
,
105
SCROLL_TO_CENTER
,
106
SCROLL_TO_FIND_LOCATION
,
107
}
PendingScroll
;
108
109
typedef
struct
_EvHeightToPageCache
{
110
gint
rotation
;
111
gboolean
dual_even_left
;
112
gdouble *
height_to_page
;
113
gdouble *
dual_height_to_page
;
114
}
EvHeightToPageCache
;
115
116
/* Information for handling annotations */
117
typedef
struct
{
118
GdkPoint
start
;
119
GdkPoint
stop
;
120
gboolean
adding_annot
;
121
EvAnnotationType
type
;
122
EvAnnotation
*
annot
;
123
}
AddingAnnotInfo
;
124
125
typedef
struct
{
126
GdkPoint
start
;
127
EvPoint
cursor_offset
;
128
gboolean
annot_clicked
;
129
gboolean
moving_annot
;
130
EvAnnotation
*
annot
;
131
}
MovingAnnotInfo
;
132
133
struct
_EvView
{
134
GtkContainer
layout
;
135
136
/* Container */
137
GList *
children
;
138
139
EvDocument
*
document
;
140
141
/* Find */
142
EvJobFind
*
find_job
;
143
GList **
find_pages
;
/* Backwards compatibility */
144
gint
find_page
;
145
gint
find_result
;
146
gboolean
jump_to_find_result
;
147
gboolean
highlight_find_results
;
148
149
EvDocumentModel
*
model
;
150
EvPixbufCache
*
pixbuf_cache
;
151
gsize
pixbuf_cache_size
;
152
EvPageCache
*
page_cache
;
153
EvHeightToPageCache
*
height_to_page_cache
;
154
EvViewCursor
cursor
;
155
EvJobRender
*
current_job
;
156
157
GtkRequisition
requisition
;
158
gboolean
internal_size_request
;
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
;
173
PendingScroll
pending_scroll
;
174
gboolean
pending_resize
;
175
EvPoint
pending_point
;
176
177
/* Current geometry */
178
179
gint
start_page
;
180
gint
end_page
;
181
gint
current_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
;
193
EvSizingMode
sizing_mode
;
194
EvPageLayout
page_layout
;
195
GtkWidget *
loading_window
;
196
guint
loading_timeout
;
197
gboolean
allow_links_change_zoom
;
198
199
/* Common for button press handling */
200
int
pressed_button
;
201
202
/* Key bindings propagation */
203
gboolean
key_binding_handled
;
204
205
/* Information for middle clicking and dragging around. */
206
DragInfo
drag_info
;
207
208
/* Autoscrolling */
209
AutoScrollInfo
scroll_info
;
210
211
/* Selection */
212
GdkPoint
motion
;
213
guint
selection_update_id
;
214
guint
selection_scroll_id
;
215
216
SelectionInfo
selection_info
;
217
218
/* Copy link address selection */
219
EvLinkAction
*
link_selected
;
220
221
/* Image DND */
222
ImageDNDInfo
image_dnd_info
;
223
224
/* Annotations */
225
GList *
window_children
;
226
EvViewWindowChild
*
window_child_focus
;
227
AddingAnnotInfo
adding_annot_info
;
228
MovingAnnotInfo
moving_annot_info
;
229
GHashTable *
annot_window_map
;
230
231
/* Focus */
232
EvMapping
*
focused_element
;
233
guint
focused_element_page
;
234
guint
child_focus_idle_id
;
235
236
/* Synctex */
237
EvMapping
*
synctex_result
;
238
239
/* Accessibility */
240
AtkObject *
accessible
;
241
242
/* Caret navigation */
243
gboolean
caret_enabled
;
244
gint
cursor_offset
;
245
gint
cursor_page
;
246
gdouble
cursor_line_offset
;
247
gboolean
cursor_visible
;
248
guint
cursor_blink_timeout_id
;
249
guint
cursor_blink_time
;
250
251
/* Gestures */
252
GtkGesture *
pan_gesture
;
253
GtkGesture *
zoom_gesture
;
254
gdouble
prev_zoom_gesture_scale
;
255
EvPanAction
pan_action
;
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
289
void
_get_page_size_for_scale_and_rotation
(
EvDocument
*document,
290
gint page,
291
gdouble scale,
292
gint rotation,
293
gint *page_width,
294
gint *page_height);
295
void
_ev_view_transform_view_point_to_doc_point
(
EvView
*view,
296
GdkPoint *view_point,
297
GdkRectangle *page_area,
298
GtkBorder *border,
299
double
*doc_point_x,
300
double
*doc_point_y);
301
void
_ev_view_transform_view_rect_to_doc_rect
(
EvView
*view,
302
GdkRectangle *view_rect,
303
GdkRectangle *page_area,
304
GtkBorder *border,
305
EvRectangle
*doc_rect);
306
void
_ev_view_transform_doc_point_to_view_point
(
EvView
*view,
307
int
page,
308
EvPoint
*doc_point,
309
GdkPoint *view_point);
310
void
_ev_view_transform_doc_rect_to_view_rect
(
EvView
*view,
311
int
page,
312
EvRectangle
*doc_rect,
313
GdkRectangle *view_rect);
314
void
_ev_view_get_selection_colors
(
EvView
*view,
315
GdkRGBA *bg_color,
316
GdkRGBA *fg_color);
317
gint
_ev_view_get_caret_cursor_offset_at_doc_point
(
EvView
*view,
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
327
void
_ev_view_set_focused_element
(
EvView
*view,
328
EvMapping
*element_mapping,
329
gint page);
330
void
_ev_view_focus_form_field
(
EvView
*view,
331
EvFormField
*field);
332
333
#endif
/* __EV_VIEW_PRIVATE_H__ */
334
evince-master
libview
ev-view-private.h
Generated on Thu Jul 13 2017 13:41:46 for Evince by
1.8.4