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