12d5b810065b2db7b565cedb660a95071256fea4
[geeqie.git] / src / pan-view / pan-types.h
1 /*
2  * Copyright (C) 2006 John Ellis
3  * Copyright (C) 2008 - 2016 The Geeqie Team
4  *
5  * Author: John Ellis
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along
18  * with this program; if not, write to the Free Software Foundation, Inc.,
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20  */
21
22 #ifndef PAN_VIEW_PAN_TYPES_H
23 #define PAN_VIEW_PAN_TYPES_H
24
25 #include "cache-loader.h"
26 #include "filedata.h"
27
28 struct FullScreenData;
29 struct ImageWindow;
30 struct ThumbLoader;
31
32 /* thumbnail sizes and spacing */
33
34 #define PAN_THUMB_SIZE_DOTS 4
35 #define PAN_THUMB_SIZE_NONE 24
36 #define PAN_THUMB_SIZE_SMALL 64
37 #define PAN_THUMB_SIZE_NORMAL 128
38 #define PAN_THUMB_SIZE_LARGE 256
39 #define PAN_THUMB_SIZE pw->thumb_size
40
41 #define PAN_THUMB_GAP_DOTS 2
42 #define PAN_THUMB_GAP_SMALL 14
43 #define PAN_THUMB_GAP_NORMAL 30
44 #define PAN_THUMB_GAP_LARGE 40
45 #define PAN_THUMB_GAP_HUGE 50
46 #define PAN_THUMB_GAP pw->thumb_gap
47
48 /* basic sizes, colors, spacings */
49
50 #define PAN_SHADOW_OFFSET 6
51 #define PAN_SHADOW_FADE 5
52 #define PAN_SHADOW_COLOR 0, 0, 0
53 #define PAN_SHADOW_ALPHA 64
54
55 #define PAN_OUTLINE_THICKNESS 1
56 #define PAN_OUTLINE_COLOR_1 255, 255, 255
57 #define PAN_OUTLINE_COLOR_2 64, 64, 64
58 #define PAN_OUTLINE_ALPHA 180
59
60 #define PAN_BACKGROUND_COLOR 150, 150, 150
61
62 #define PAN_GRID_SIZE 60
63 #define PAN_GRID_COLOR 0, 0, 0
64 #define PAN_GRID_ALPHA 20
65
66 #define PAN_BOX_COLOR 255, 255, 255
67 #define PAN_BOX_ALPHA 100
68 #define PAN_BOX_BORDER 20
69
70 #define PAN_BOX_OUTLINE_THICKNESS 4
71 #define PAN_BOX_OUTLINE_COLOR 0, 0, 0
72 #define PAN_BOX_OUTLINE_ALPHA 128
73
74 #define PAN_TEXT_BORDER_SIZE 4
75 #define PAN_TEXT_COLOR 0, 0, 0
76
77 /* popup info box */
78
79 #define PAN_POPUP_COLOR 255, 255, 225
80 #define PAN_POPUP_ALPHA 255
81 #define PAN_POPUP_BORDER 1
82 #define PAN_POPUP_BORDER_COLOR 0, 0, 0
83 #define PAN_POPUP_TEXT_COLOR 0, 0, 0
84
85
86 #define PAN_GROUP_MAX 16
87
88
89
90 enum PanLayoutType {
91         PAN_LAYOUT_TIMELINE = 0,
92         PAN_LAYOUT_CALENDAR,
93         PAN_LAYOUT_FOLDERS_LINEAR,
94         PAN_LAYOUT_FOLDERS_FLOWER,
95         PAN_LAYOUT_GRID,
96         PAN_LAYOUT_COUNT
97 };
98
99 enum PanImageSize {
100         PAN_IMAGE_SIZE_THUMB_DOTS = 0,
101         PAN_IMAGE_SIZE_THUMB_NONE,
102         PAN_IMAGE_SIZE_THUMB_SMALL,
103         PAN_IMAGE_SIZE_THUMB_NORMAL,
104         PAN_IMAGE_SIZE_THUMB_LARGE,
105         PAN_IMAGE_SIZE_10,
106         PAN_IMAGE_SIZE_25,
107         PAN_IMAGE_SIZE_33,
108         PAN_IMAGE_SIZE_50,
109         PAN_IMAGE_SIZE_100,
110         PAN_IMAGE_SIZE_COUNT
111 };
112
113 enum PanItemType {
114         PAN_ITEM_NONE,
115         PAN_ITEM_THUMB,
116         PAN_ITEM_BOX,
117         PAN_ITEM_TRIANGLE,
118         PAN_ITEM_TEXT,
119         PAN_ITEM_IMAGE
120 };
121
122 enum PanTextAttrType {
123         PAN_TEXT_ATTR_NONE = 0,
124         PAN_TEXT_ATTR_BOLD = 1 << 0,
125         PAN_TEXT_ATTR_HEADING = 1 << 1,
126         PAN_TEXT_ATTR_MARKUP = 1 << 2
127 };
128
129 enum PanBorderType {
130         PAN_BORDER_NONE = 0,
131         PAN_BORDER_1 = 1 << 0,
132         PAN_BORDER_2 = 1 << 1,
133         PAN_BORDER_3 = 1 << 2,
134         PAN_BORDER_4 = 1 << 3
135 };
136
137 #define PAN_BORDER_TOP          PAN_BORDER_1
138 #define PAN_BORDER_RIGHT                PAN_BORDER_2
139 #define PAN_BORDER_BOTTOM       PAN_BORDER_3
140 #define PAN_BORDER_LEFT         PAN_BORDER_4
141
142
143 struct PanItem {
144         PanItemType type;
145         gint x;
146         gint y;
147         gint width;
148         gint height;
149         gchar *key;
150
151         FileData *fd;
152
153         GdkPixbuf *pixbuf;
154         gint refcount;
155
156         gchar *text;
157         PanTextAttrType text_attr;
158
159         guint8 color_r;
160         guint8 color_g;
161         guint8 color_b;
162         guint8 color_a;
163
164         guint8 color2_r;
165         guint8 color2_g;
166         guint8 color2_b;
167         guint8 color2_a;
168         gint border;
169
170         gpointer data;
171
172         gboolean queued;
173 };
174
175 struct PanViewSearchUi
176 {
177         GtkWidget *search_box;
178         GtkWidget *search_entry;
179         GtkWidget *search_label;
180         GtkWidget *search_button;
181         GtkWidget *search_button_arrow;
182 };
183
184 /**
185  * @struct PanViewFilterUi
186  * Defined in pan-view-filter.h
187  */
188 struct PanViewFilterUi;
189
190 struct PanWindow
191 {
192         GtkWidget *window;
193         ImageWindow *imd;
194         ImageWindow *imd_normal;
195         FullScreenData *fs;
196
197         GtkWidget *path_entry;
198
199         GtkWidget *label_message;
200         GtkWidget *label_zoom;
201
202         PanViewSearchUi *search_ui;
203         PanViewFilterUi *filter_ui;
204
205         GtkWidget *date_button;
206
207         GtkWidget *scrollbar_h;
208         GtkWidget *scrollbar_v;
209
210         FileData *dir_fd;
211         PanLayoutType layout;
212         PanImageSize size;
213         gint thumb_size;
214         gint thumb_gap;
215         gint image_size;
216         gboolean exif_date_enable;
217
218         gint info_image_size;
219         gboolean info_includes_exif;
220
221         gboolean ignore_symlinks;
222
223         GList *list;
224         GList *list_static;
225         GList *list_grid;
226
227         GList *cache_list;
228         GList *cache_todo;
229         gint cache_count;
230         gint cache_total;
231         gint cache_tick;
232         CacheLoader *cache_cl;
233
234         ImageLoader *il;
235         ThumbLoader *tl;
236         PanItem *queue_pi;
237         GList *queue;
238
239         PanItem *click_pi;
240         PanItem *search_pi;
241
242         gint idle_id;
243 };
244
245 struct PanGrid {
246         gint x;
247         gint y;
248         gint w;
249         gint h;
250         GList *list;
251 };
252
253 struct PanCacheData {
254         FileData *fd;
255         CacheData *cd;
256 };
257
258 #endif
259 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */