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