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