]> www.fi.muni.cz Git - evince.git/blob - shell/ev-view-private.h
Translation updated
[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 #include "ev-transition-animation.h"
31
32 #define DRAG_HISTORY 10
33
34 /* Information for middle clicking and moving around the doc */
35 typedef struct {
36         gboolean in_drag;
37         GdkPoint start;
38         gdouble hadj;
39         gdouble vadj;
40         guint drag_timeout_id;
41         guint release_timeout_id;
42         GdkPoint buffer[DRAG_HISTORY];
43         GdkPoint momentum;
44 } DragInfo;
45
46 /* Autoscrolling */
47 typedef struct {
48         gboolean autoscrolling;
49         guint last_y;
50         guint start_y;
51         guint timeout_id;       
52 } AutoScrollInfo;
53
54 /* Information for handling selection */
55 typedef struct {
56         gboolean in_drag;
57         GdkPoint start;
58         gboolean in_selection;
59         GList *selections;
60         EvSelectionStyle style;
61 } SelectionInfo;
62
63 /* Information for handling images DND */
64 typedef struct {
65         gboolean in_drag;
66         GdkPoint start;
67         EvImage *image;
68 } ImageDNDInfo;
69
70 typedef enum {
71         SCROLL_TO_KEEP_POSITION,
72         SCROLL_TO_PAGE_POSITION,
73         SCROLL_TO_CENTER,
74         SCROLL_TO_FIND_LOCATION,
75 } PendingScroll;
76
77 typedef enum {
78         EV_VIEW_CURSOR_NORMAL,
79         EV_VIEW_CURSOR_IBEAM,
80         EV_VIEW_CURSOR_LINK,
81         EV_VIEW_CURSOR_WAIT,
82         EV_VIEW_CURSOR_HIDDEN,
83         EV_VIEW_CURSOR_DRAG,
84         EV_VIEW_CURSOR_AUTOSCROLL,
85 } EvViewCursor;
86
87 typedef enum {
88         EV_PRESENTATION_NORMAL,
89         EV_PRESENTATION_BLACK,
90         EV_PRESENTATION_WHITE,
91         EV_PRESENTATION_END
92 } EvPresentationState;
93
94 struct _EvView {
95         GtkLayout layout;
96
97         EvDocument *document;
98
99         char *find_status;
100         int find_result;
101         gboolean jump_to_find_result;
102         gboolean highlight_find_results;
103         
104         EvPageCache *page_cache;
105         EvPixbufCache *pixbuf_cache;
106         EvViewCursor cursor;
107         EvJobRender *current_job;
108
109         /* Scrolling */
110         GtkAdjustment *hadjustment;
111         GtkAdjustment *vadjustment;
112
113         gint scroll_x;
114         gint scroll_y;  
115
116         PendingScroll pending_scroll;
117         gboolean      pending_resize;
118         EvPoint       pending_point;
119
120         /* Current geometry */
121     
122         gint start_page;
123         gint end_page;
124         gint current_page;
125
126         gint rotation;
127         gdouble scale;
128         gint spacing;
129         gdouble dpi;
130         gdouble max_scale;
131         gdouble min_scale;
132
133         gboolean loading;
134         gboolean continuous;
135         gboolean dual_page;
136         gboolean fullscreen;
137         gboolean presentation;
138         EvSizingMode sizing_mode;
139         cairo_surface_t *loading_text;
140
141         /* Presentation */
142         EvPresentationState presentation_state;
143         EvSizingMode sizing_mode_saved;
144         double scale_saved;
145         guint  trans_timeout_id;
146
147         /* Common for button press handling */
148         int pressed_button;
149
150         /* Information for middle clicking and dragging around. */
151         DragInfo drag_info;
152         
153         /* Autoscrolling */
154         AutoScrollInfo scroll_info;
155
156         /* Selection */
157         GdkPoint motion;
158         guint selection_update_id;
159         guint selection_scroll_id;
160
161         EvViewSelectionMode selection_mode;
162         SelectionInfo selection_info;
163
164         /* Image DND */
165         ImageDNDInfo image_dnd_info;
166
167 #if !GTK_CHECK_VERSION (2, 11, 7)
168         /* Links */
169         GtkWidget *link_tooltip;
170         EvLink *hovered_link;
171 #endif
172
173         /* Goto Popup */
174         GtkWidget *goto_window;
175         GtkWidget *goto_entry;
176
177         EvTransitionAnimation *animation;
178 };
179
180 struct _EvViewClass {
181         GtkLayoutClass parent_class;
182
183         void    (*binding_activated)      (EvView         *view,
184                                            EvScrollType   scroll,
185                                            gboolean        horizontal);
186         void    (*zoom_invalid)           (EvView         *view);
187         void    (*handle_link)            (EvView         *view,
188                                            EvLink         *link);
189         void    (*external_link)          (EvView         *view,
190                                            EvLinkAction   *action);
191         void    (*popup_menu)             (EvView         *view,
192                                            EvLink         *link);
193 };
194
195 #endif  /* __EV_VIEW_PRIVATE_H__ */
196