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 /* thumbnail sizes and spacing */
29 
30 #define PAN_THUMB_SIZE_DOTS 4
31 #define PAN_THUMB_SIZE_NONE 24
32 #define PAN_THUMB_SIZE_SMALL 64
33 #define PAN_THUMB_SIZE_NORMAL 128
34 #define PAN_THUMB_SIZE_LARGE 256
35 #define PAN_THUMB_SIZE pw->thumb_size
36 
37 #define PAN_THUMB_GAP_DOTS 2
38 #define PAN_THUMB_GAP_SMALL 14
39 #define PAN_THUMB_GAP_NORMAL 30
40 #define PAN_THUMB_GAP_LARGE 40
41 #define PAN_THUMB_GAP_HUGE 50
42 #define PAN_THUMB_GAP pw->thumb_gap
43 
44 /* basic sizes, colors, spacings */
45 
46 #define PAN_SHADOW_OFFSET 6
47 #define PAN_SHADOW_FADE 5
48 #define PAN_SHADOW_COLOR 0, 0, 0
49 #define PAN_SHADOW_ALPHA 64
50 
51 #define PAN_OUTLINE_THICKNESS 1
52 #define PAN_OUTLINE_COLOR_1 255, 255, 255
53 #define PAN_OUTLINE_COLOR_2 64, 64, 64
54 #define PAN_OUTLINE_ALPHA 180
55 
56 #define PAN_BACKGROUND_COLOR 150, 150, 150
57 
58 #define PAN_GRID_SIZE 60
59 #define PAN_GRID_COLOR 0, 0, 0
60 #define PAN_GRID_ALPHA 20
61 
62 #define PAN_BOX_COLOR 255, 255, 255
63 #define PAN_BOX_ALPHA 100
64 #define PAN_BOX_BORDER 20
65 
66 #define PAN_BOX_OUTLINE_THICKNESS 4
67 #define PAN_BOX_OUTLINE_COLOR 0, 0, 0
68 #define PAN_BOX_OUTLINE_ALPHA 128
69 
70 #define PAN_TEXT_BORDER_SIZE 4
71 #define PAN_TEXT_COLOR 0, 0, 0
72 
73 /* popup info box */
74 
75 #define PAN_POPUP_COLOR 255, 255, 225
76 #define PAN_POPUP_ALPHA 255
77 #define PAN_POPUP_BORDER 1
78 #define PAN_POPUP_BORDER_COLOR 0, 0, 0
79 #define PAN_POPUP_TEXT_COLOR 0, 0, 0
80 
81 
82 #define PAN_GROUP_MAX 16
83 
84 
85 
86 typedef enum {
87 	PAN_LAYOUT_TIMELINE = 0,
88 	PAN_LAYOUT_CALENDAR,
89 	PAN_LAYOUT_FOLDERS_LINEAR,
90 	PAN_LAYOUT_FOLDERS_FLOWER,
91 	PAN_LAYOUT_GRID,
92 	PAN_LAYOUT_COUNT
93 } PanLayoutType;
94 
95 typedef enum {
96 	PAN_IMAGE_SIZE_THUMB_DOTS = 0,
97 	PAN_IMAGE_SIZE_THUMB_NONE,
98 	PAN_IMAGE_SIZE_THUMB_SMALL,
99 	PAN_IMAGE_SIZE_THUMB_NORMAL,
100 	PAN_IMAGE_SIZE_THUMB_LARGE,
101 	PAN_IMAGE_SIZE_10,
102 	PAN_IMAGE_SIZE_25,
103 	PAN_IMAGE_SIZE_33,
104 	PAN_IMAGE_SIZE_50,
105 	PAN_IMAGE_SIZE_100,
106 	PAN_IMAGE_SIZE_COUNT
107 } PanImageSize;
108 
109 typedef enum {
110 	PAN_ITEM_NONE,
111 	PAN_ITEM_THUMB,
112 	PAN_ITEM_BOX,
113 	PAN_ITEM_TRIANGLE,
114 	PAN_ITEM_TEXT,
115 	PAN_ITEM_IMAGE
116 } PanItemType;
117 
118 typedef enum {
119 	PAN_TEXT_ATTR_NONE = 0,
120 	PAN_TEXT_ATTR_BOLD = 1 << 0,
121 	PAN_TEXT_ATTR_HEADING = 1 << 1,
122 	PAN_TEXT_ATTR_MARKUP = 1 << 2
123 } PanTextAttrType;
124 
125 typedef enum {
126 	PAN_BORDER_NONE = 0,
127 	PAN_BORDER_1 = 1 << 0,
128 	PAN_BORDER_2 = 1 << 1,
129 	PAN_BORDER_3 = 1 << 2,
130 	PAN_BORDER_4 = 1 << 3
131 } PanBorderType;
132 
133 #define PAN_BORDER_TOP		PAN_BORDER_1
134 #define PAN_BORDER_RIGHT		PAN_BORDER_2
135 #define PAN_BORDER_BOTTOM	PAN_BORDER_3
136 #define PAN_BORDER_LEFT		PAN_BORDER_4
137 
138 
139 typedef struct _PanItem PanItem;
140 struct _PanItem {
141 	PanItemType type;
142 	gint x;
143 	gint y;
144 	gint width;
145 	gint height;
146 	gchar *key;
147 
148 	FileData *fd;
149 
150 	GdkPixbuf *pixbuf;
151 	gint refcount;
152 
153 	gchar *text;
154 	PanTextAttrType text_attr;
155 
156 	guint8 color_r;
157 	guint8 color_g;
158 	guint8 color_b;
159 	guint8 color_a;
160 
161 	guint8 color2_r;
162 	guint8 color2_g;
163 	guint8 color2_b;
164 	guint8 color2_a;
165 	gint border;
166 
167 	gpointer data;
168 
169 	gboolean queued;
170 };
171 
172 typedef struct _PanViewSearchUi PanViewSearchUi;
173 struct _PanViewSearchUi
174 {
175 	GtkWidget *search_box;
176 	GtkWidget *search_entry;
177 	GtkWidget *search_label;
178 	GtkWidget *search_button;
179 	GtkWidget *search_button_arrow;
180 };
181 
182 // Defined in pan-view-filter.h
183 typedef struct _PanViewFilterUi PanViewFilterUi;
184 
185 typedef struct _PanWindow PanWindow;
186 struct _PanWindow
187 {
188 	GtkWidget *window;
189 	ImageWindow *imd;
190 	ImageWindow *imd_normal;
191 	FullScreenData *fs;
192 
193 	GtkWidget *path_entry;
194 
195 	GtkWidget *label_message;
196 	GtkWidget *label_zoom;
197 
198 	PanViewSearchUi *search_ui;
199 	PanViewFilterUi *filter_ui;
200 
201 	GtkWidget *date_button;
202 
203 	GtkWidget *scrollbar_h;
204 	GtkWidget *scrollbar_v;
205 
206 	FileData *dir_fd;
207 	PanLayoutType layout;
208 	PanImageSize size;
209 	gint thumb_size;
210 	gint thumb_gap;
211 	gint image_size;
212 	gboolean exif_date_enable;
213 
214 	gint info_image_size;
215 	gboolean info_includes_exif;
216 
217 	gboolean ignore_symlinks;
218 
219 	GList *list;
220 	GList *list_static;
221 	GList *list_grid;
222 
223 	GList *cache_list;
224 	GList *cache_todo;
225 	gint cache_count;
226 	gint cache_total;
227 	gint cache_tick;
228 	CacheLoader *cache_cl;
229 
230 	ImageLoader *il;
231 	ThumbLoader *tl;
232 	PanItem *queue_pi;
233 	GList *queue;
234 
235 	PanItem *click_pi;
236 	PanItem *search_pi;
237 
238 	gint idle_id;
239 };
240 
241 typedef struct _PanGrid PanGrid;
242 struct _PanGrid {
243 	gint x;
244 	gint y;
245 	gint w;
246 	gint h;
247 	GList *list;
248 };
249 
250 typedef struct _PanCacheData PanCacheData;
251 struct _PanCacheData {
252 	FileData *fd;
253 	CacheData *cd;
254 };
255 
256 #endif
257 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
258