]> 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
28 /* Information for middle clicking and moving around the doc */
29 typedef struct {
30         gboolean in_drag;
31         GdkPoint start;
32         gdouble hadj;
33         gdouble vadj;
34 } DragInfo;
35
36 /* Information for handling selection */
37 typedef struct {
38         gboolean in_drag;
39         GdkPoint start;
40         gboolean in_selection;
41         GList *selections;
42 } SelectionInfo;
43
44 typedef enum {
45         SCROLL_TO_KEEP_POSITION,
46         SCROLL_TO_PAGE_POSITION,
47         SCROLL_TO_CENTER,
48         SCROLL_TO_FIND_LOCATION,
49 } PendingScroll;
50
51 typedef enum {
52         EV_VIEW_CURSOR_NORMAL,
53         EV_VIEW_CURSOR_IBEAM,
54         EV_VIEW_CURSOR_LINK,
55         EV_VIEW_CURSOR_WAIT,
56         EV_VIEW_CURSOR_HIDDEN,
57         EV_VIEW_CURSOR_DRAG
58 } EvViewCursor;
59
60 typedef enum {
61         EV_PRESENTATION_NORMAL,
62         EV_PRESENTATION_BLACK,
63         EV_PRESENTATION_WHITE,
64         EV_PRESENTATION_END
65 } EvPresentationState;
66
67 struct _EvView {
68         GtkWidget parent_instance;
69
70         EvDocument *document;
71
72         char *status;
73         char *find_status;
74         int find_result;
75         gboolean jump_to_find_result;
76         
77         EvPageCache *page_cache;
78         EvPixbufCache *pixbuf_cache;
79         EvViewCursor cursor;
80         EvJobRender *current_job;
81
82         /* Scrolling */
83         GtkAdjustment *hadjustment;
84         GtkAdjustment *vadjustment;
85
86         gint scroll_x;
87         gint scroll_y;  
88
89         PendingScroll pending_scroll;
90         gboolean      pending_resize;
91         EvPoint       pending_point;
92
93         /* Current geometry */
94     
95         gint start_page;
96         gint end_page;
97         gint current_page;
98
99         int rotation;
100         double scale;
101         int spacing;
102
103         gboolean loading;
104         gboolean continuous;
105         gboolean dual_page;
106         gboolean fullscreen;
107         gboolean presentation;
108         EvPresentationState presentation_state;
109         EvSizingMode sizing_mode;
110
111         /* Common for button press handling */
112         int pressed_button;
113
114         /* Information for middle clicking and dragging around. */
115         DragInfo drag_info;
116
117         /* Selection */
118         GdkPoint motion;
119         guint selection_update_id;
120         guint selection_scroll_id;
121
122         EvViewSelectionMode selection_mode;
123         SelectionInfo selection_info;
124
125         /* Links */
126         GtkWidget *link_tooltip;
127         EvLink *hovered_link;
128 };
129
130 struct _EvViewClass {
131         GtkWidgetClass parent_class;
132
133         void    (*set_scroll_adjustments) (EvView         *view,
134                                            GtkAdjustment  *hadjustment,
135                                            GtkAdjustment  *vadjustment);
136         void    (*binding_activated)      (EvView         *view,
137                                            EvScrollType   scroll,
138                                            gboolean        horizontal);
139         void    (*zoom_invalid)           (EvView         *view);
140         void    (*external_link)          (EvView         *view,
141                                            EvLinkAction   *action);
142         void    (*popup_menu)             (EvView         *view,
143                                            EvLink         *link);
144 };
145
146 #endif  /* __EV_VIEW_PRIVATE_H__ */
147