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