]> www.fi.muni.cz Git - evince.git/blob - shell/ev-view-private.h
Add image handling support. Fixes bugs #310008 and #325047. Images
[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         int rotation;
108         double scale;
109         int spacing;
110
111         gboolean loading;
112         gboolean continuous;
113         gboolean dual_page;
114         gboolean fullscreen;
115         gboolean presentation;
116         EvSizingMode sizing_mode;
117
118         /* Presentation */
119         EvPresentationState presentation_state;
120         EvSizingMode sizing_mode_saved;
121         double scale_saved;
122         guint  trans_timeout_id;
123
124         /* Common for button press handling */
125         int pressed_button;
126
127         /* Information for middle clicking and dragging around. */
128         DragInfo drag_info;
129
130         /* Selection */
131         GdkPoint motion;
132         guint selection_update_id;
133         guint selection_scroll_id;
134
135         EvViewSelectionMode selection_mode;
136         SelectionInfo selection_info;
137
138         /* Image DND */
139         ImageDNDInfo image_dnd_info;
140
141         /* Links */
142         GtkWidget *link_tooltip;
143         EvLink *hovered_link;
144
145         /* Goto Popup */
146         GtkWidget *goto_window;
147         GtkWidget *goto_entry;
148 };
149
150 struct _EvViewClass {
151         GtkWidgetClass parent_class;
152
153         void    (*set_scroll_adjustments) (EvView         *view,
154                                            GtkAdjustment  *hadjustment,
155                                            GtkAdjustment  *vadjustment);
156         void    (*binding_activated)      (EvView         *view,
157                                            EvScrollType   scroll,
158                                            gboolean        horizontal);
159         void    (*zoom_invalid)           (EvView         *view);
160         void    (*external_link)          (EvView         *view,
161                                            EvLinkAction   *action);
162         void    (*popup_menu)             (EvView         *view,
163                                            EvLink         *link);
164 };
165
166 #endif  /* __EV_VIEW_PRIVATE_H__ */
167