Mercurial > geeqie.yaz
annotate src/pan-types.h @ 1581:cef502852c4f
resolved conflict
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Fri, 01 May 2009 15:48:11 +0900 |
parents | 24a12aa0cb54 |
children | 717374fb1bbd |
rev | line source |
---|---|
105 | 1 /* |
196 | 2 * Geeqie |
105 | 3 * (C) 2006 John Ellis |
1284 | 4 * Copyright (C) 2008 - 2009 The Geeqie Team |
105 | 5 * |
6 * Author: John Ellis | |
7 * | |
8 * This software is released under the GNU General Public License (GNU GPL). | |
9 * Please read the included file COPYING for more information. | |
10 * This software comes with no warranty of any kind, use at your own risk! | |
11 */ | |
12 | |
13 | |
14 #ifndef PAN_TYPES_H | |
15 #define PAN_TYPES_H | |
16 | |
17 #include "cache.h" | |
18 #include "cache-loader.h" | |
586 | 19 #include "filedata.h" |
105 | 20 #include "image.h" |
21 #include "image-load.h" | |
22 #include "pixbuf_util.h" | |
23 #include "pixbuf-renderer.h" | |
24 #include "ui_misc.h" | |
25 | |
26 | |
27 /* thumbnail sizes and spacing */ | |
28 | |
29 #define PAN_THUMB_SIZE_DOTS 4 | |
30 #define PAN_THUMB_SIZE_NONE 24 | |
31 #define PAN_THUMB_SIZE_SMALL 64 | |
32 #define PAN_THUMB_SIZE_NORMAL 128 | |
33 #define PAN_THUMB_SIZE_LARGE 256 | |
34 #define PAN_THUMB_SIZE pw->thumb_size | |
35 | |
36 #define PAN_THUMB_GAP_DOTS 2 | |
37 #define PAN_THUMB_GAP_SMALL 14 | |
38 #define PAN_THUMB_GAP_NORMAL 30 | |
39 #define PAN_THUMB_GAP_LARGE 40 | |
40 #define PAN_THUMB_GAP_HUGE 50 | |
41 #define PAN_THUMB_GAP pw->thumb_gap | |
42 | |
43 /* basic sizes, colors, spacings */ | |
44 | |
45 #define PAN_SHADOW_OFFSET 6 | |
46 #define PAN_SHADOW_FADE 5 | |
47 #define PAN_SHADOW_COLOR 0, 0, 0 | |
48 #define PAN_SHADOW_ALPHA 64 | |
49 | |
50 #define PAN_OUTLINE_THICKNESS 1 | |
51 #define PAN_OUTLINE_COLOR_1 255, 255, 255 | |
52 #define PAN_OUTLINE_COLOR_2 64, 64, 64 | |
53 #define PAN_OUTLINE_ALPHA 180 | |
54 | |
55 #define PAN_BACKGROUND_COLOR 150, 150, 150 | |
56 | |
57 #define PAN_GRID_SIZE 60 | |
58 #define PAN_GRID_COLOR 0, 0, 0 | |
59 #define PAN_GRID_ALPHA 20 | |
60 | |
61 #define PAN_BOX_COLOR 255, 255, 255 | |
62 #define PAN_BOX_ALPHA 100 | |
63 #define PAN_BOX_BORDER 20 | |
64 | |
65 #define PAN_BOX_OUTLINE_THICKNESS 4 | |
66 #define PAN_BOX_OUTLINE_COLOR 0, 0, 0 | |
67 #define PAN_BOX_OUTLINE_ALPHA 128 | |
68 | |
69 #define PAN_TEXT_BORDER_SIZE 4 | |
70 #define PAN_TEXT_COLOR 0, 0, 0 | |
71 | |
72 /* popup info box */ | |
73 | |
74 #define PAN_POPUP_COLOR 255, 255, 225 | |
75 #define PAN_POPUP_ALPHA 255 | |
76 #define PAN_POPUP_BORDER 1 | |
77 #define PAN_POPUP_BORDER_COLOR 0, 0, 0 | |
78 #define PAN_POPUP_TEXT_COLOR 0, 0, 0 | |
79 | |
80 | |
81 #define PAN_GROUP_MAX 16 | |
82 | |
83 | |
84 | |
85 typedef enum { | |
86 PAN_LAYOUT_TIMELINE = 0, | |
87 PAN_LAYOUT_CALENDAR, | |
88 PAN_LAYOUT_FOLDERS_LINEAR, | |
89 PAN_LAYOUT_FOLDERS_FLOWER, | |
90 PAN_LAYOUT_GRID, | |
91 PAN_LAYOUT_COUNT | |
92 } PanLayoutType; | |
93 | |
94 typedef enum { | |
95 PAN_IMAGE_SIZE_THUMB_DOTS = 0, | |
96 PAN_IMAGE_SIZE_THUMB_NONE, | |
97 PAN_IMAGE_SIZE_THUMB_SMALL, | |
98 PAN_IMAGE_SIZE_THUMB_NORMAL, | |
99 PAN_IMAGE_SIZE_THUMB_LARGE, | |
100 PAN_IMAGE_SIZE_10, | |
101 PAN_IMAGE_SIZE_25, | |
102 PAN_IMAGE_SIZE_33, | |
103 PAN_IMAGE_SIZE_50, | |
104 PAN_IMAGE_SIZE_100, | |
105 PAN_IMAGE_SIZE_COUNT | |
106 } PanImageSize; | |
107 | |
108 typedef enum { | |
109 PAN_ITEM_NONE, | |
110 PAN_ITEM_THUMB, | |
111 PAN_ITEM_BOX, | |
112 PAN_ITEM_TRIANGLE, | |
113 PAN_ITEM_TEXT, | |
114 PAN_ITEM_IMAGE | |
115 } PanItemType; | |
116 | |
117 typedef enum { | |
118 PAN_TEXT_ATTR_NONE = 0, | |
119 PAN_TEXT_ATTR_BOLD = 1 << 0, | |
120 PAN_TEXT_ATTR_HEADING = 1 << 1, | |
121 PAN_TEXT_ATTR_MARKUP = 1 << 2 | |
122 } PanTextAttrType; | |
123 | |
124 typedef enum { | |
125 PAN_BORDER_NONE = 0, | |
126 PAN_BORDER_1 = 1 << 0, | |
127 PAN_BORDER_2 = 1 << 1, | |
128 PAN_BORDER_3 = 1 << 2, | |
129 PAN_BORDER_4 = 1 << 3 | |
130 } PanBorderType; | |
131 | |
132 #define PAN_BORDER_TOP PAN_BORDER_1 | |
133 #define PAN_BORDER_RIGHT PAN_BORDER_2 | |
134 #define PAN_BORDER_BOTTOM PAN_BORDER_3 | |
135 #define PAN_BORDER_LEFT PAN_BORDER_4 | |
136 | |
137 | |
138 typedef struct _PanItem PanItem; | |
139 struct _PanItem { | |
140 PanItemType type; | |
141 gint x; | |
142 gint y; | |
143 gint width; | |
144 gint height; | |
145 gchar *key; | |
146 | |
147 FileData *fd; | |
148 | |
149 GdkPixbuf *pixbuf; | |
150 gint refcount; | |
151 | |
152 gchar *text; | |
153 PanTextAttrType text_attr; | |
154 | |
155 guint8 color_r; | |
156 guint8 color_g; | |
157 guint8 color_b; | |
158 guint8 color_a; | |
159 | |
160 guint8 color2_r; | |
161 guint8 color2_g; | |
162 guint8 color2_b; | |
163 guint8 color2_a; | |
164 gint border; | |
165 | |
166 gpointer data; | |
167 | |
1434 | 168 gboolean queued; |
105 | 169 }; |
170 | |
171 typedef struct _PanWindow PanWindow; | |
172 struct _PanWindow | |
173 { | |
174 GtkWidget *window; | |
175 ImageWindow *imd; | |
176 ImageWindow *imd_normal; | |
177 FullScreenData *fs; | |
178 | |
179 GtkWidget *path_entry; | |
180 | |
181 GtkWidget *label_message; | |
182 GtkWidget *label_zoom; | |
183 | |
184 GtkWidget *search_box; | |
185 GtkWidget *search_entry; | |
186 GtkWidget *search_label; | |
187 GtkWidget *search_button; | |
188 GtkWidget *search_button_arrow; | |
189 | |
190 GtkWidget *date_button; | |
191 | |
192 GtkWidget *scrollbar_h; | |
193 GtkWidget *scrollbar_v; | |
194 | |
783 | 195 FileData *dir_fd; |
105 | 196 PanLayoutType layout; |
197 PanImageSize size; | |
198 gint thumb_size; | |
199 gint thumb_gap; | |
200 gint image_size; | |
1434 | 201 gboolean exif_date_enable; |
105 | 202 |
203 gint info_image_size; | |
1434 | 204 gboolean info_includes_exif; |
105 | 205 |
1434 | 206 gboolean ignore_symlinks; |
105 | 207 |
208 GList *list; | |
209 GList *list_static; | |
210 GList *list_grid; | |
211 | |
212 GList *cache_list; | |
213 GList *cache_todo; | |
214 gint cache_count; | |
215 gint cache_total; | |
216 gint cache_tick; | |
217 CacheLoader *cache_cl; | |
218 | |
219 ImageLoader *il; | |
220 ThumbLoader *tl; | |
221 PanItem *queue_pi; | |
222 GList *queue; | |
223 | |
224 PanItem *click_pi; | |
225 PanItem *search_pi; | |
226 | |
227 gint idle_id; | |
1397
a0bd58a6535f
In various Edit context menus, only display editors that match the file types in the selection.
zas_
parents:
1284
diff
changeset
|
228 |
a0bd58a6535f
In various Edit context menus, only display editors that match the file types in the selection.
zas_
parents:
1284
diff
changeset
|
229 /* file list for edit menu */ |
a0bd58a6535f
In various Edit context menus, only display editors that match the file types in the selection.
zas_
parents:
1284
diff
changeset
|
230 GList *editmenu_fd_list; |
105 | 231 }; |
232 | |
233 typedef struct _PanGrid PanGrid; | |
234 struct _PanGrid { | |
235 gint x; | |
236 gint y; | |
237 gint w; | |
238 gint h; | |
239 GList *list; | |
240 }; | |
241 | |
242 typedef struct _PanCacheData PanCacheData; | |
243 struct _PanCacheData { | |
138 | 244 FileData *fd; |
105 | 245 CacheData *cd; |
246 }; | |
247 | |
248 | |
249 /* pan-view.c */ | |
250 | |
251 GList *pan_layout_intersect(PanWindow *pw, gint x, gint y, gint width, gint height); | |
252 void pan_layout_resize(PanWindow *pw); | |
253 | |
254 void pan_cache_sync_date(PanWindow *pw, GList *list); | |
255 | |
1434 | 256 GList *pan_cache_sort(GList *list, SortType method, gboolean ascend); |
105 | 257 /* pan-item.c */ |
258 | |
259 void pan_item_free(PanItem *pi); | |
260 | |
261 void pan_item_set_key(PanItem *pi, const gchar *key); | |
262 void pan_item_added(PanWindow *pw, PanItem *pi); | |
263 void pan_item_remove(PanWindow *pw, PanItem *pi); | |
264 | |
265 void pan_item_size_by_item(PanItem *pi, PanItem *child, gint border); | |
266 void pan_item_size_coordinates(PanItem *pi, gint border, gint *w, gint *h); | |
267 | |
268 | |
269 PanItem *pan_item_find_by_key(PanWindow *pw, PanItemType type, const gchar *key); | |
270 GList *pan_item_find_by_path(PanWindow *pw, PanItemType type, const gchar *path, | |
1434 | 271 gboolean ignore_case, gboolean partial); |
783 | 272 GList *pan_item_find_by_fd(PanWindow *pw, PanItemType type, FileData *fd, |
1434 | 273 gboolean ignore_case, gboolean partial); |
105 | 274 PanItem *pan_item_find_by_coord(PanWindow *pw, PanItemType type, |
275 gint x, gint y, const gchar *key); | |
276 | |
277 | |
278 PanItem *pan_item_box_new(PanWindow *pw, FileData *fd, gint x, gint y, gint width, gint height, | |
279 gint border_size, | |
280 guint8 base_r, guint8 base_g, guint8 base_b, guint8 base_a, | |
281 guint8 bord_r, guint8 bord_g, guint8 bord_b, guint8 bord_a); | |
282 void pan_item_box_shadow(PanItem *pi, gint offset, gint fade); | |
283 gint pan_item_box_draw(PanWindow *pw, PanItem *pi, GdkPixbuf *pixbuf, PixbufRenderer *pr, | |
284 gint x, gint y, gint width, gint height); | |
285 | |
286 PanItem *pan_item_tri_new(PanWindow *pw, FileData *fd, gint x, gint y, gint width, gint height, | |
287 gint x1, gint y1, gint x2, gint y2, gint x3, gint y3, | |
288 guint8 r, guint8 g, guint8 b, guint8 a); | |
289 void pan_item_tri_border(PanItem *pi, gint borders, | |
290 guint8 r, guint8 g, guint8 b, guint8 a); | |
291 gint pan_item_tri_draw(PanWindow *pw, PanItem *pi, GdkPixbuf *pixbuf, PixbufRenderer *pr, | |
292 gint x, gint y, gint width, gint height); | |
293 | |
294 PanItem *pan_item_text_new(PanWindow *pw, gint x, gint y, const gchar *text, | |
295 PanTextAttrType attr, PanBorderType border, | |
296 guint8 r, guint8 g, guint8 b, guint8 a); | |
297 gint pan_item_text_draw(PanWindow *pw, PanItem *pi, GdkPixbuf *pixbuf, PixbufRenderer *pr, | |
298 gint x, gint y, gint width, gint height); | |
299 | |
300 PanItem *pan_item_thumb_new(PanWindow *pw, FileData *fd, gint x, gint y); | |
301 gint pan_item_thumb_draw(PanWindow *pw, PanItem *pi, GdkPixbuf *pixbuf, PixbufRenderer *pr, | |
302 gint x, gint y, gint width, gint height); | |
303 | |
304 PanItem *pan_item_image_new(PanWindow *pw, FileData *fd, gint x, gint y, gint w, gint h); | |
305 gint pan_item_image_draw(PanWindow *pw, PanItem *pi, GdkPixbuf *pixbuf, PixbufRenderer *pr, | |
306 gint x, gint y, gint width, gint height); | |
307 | |
308 | |
309 typedef struct _PanTextAlignment PanTextAlignment; | |
310 struct _PanTextAlignment { | |
311 PanWindow *pw; | |
312 | |
313 GList *column1; | |
314 GList *column2; | |
315 | |
316 gint x; | |
317 gint y; | |
318 gchar *key; | |
319 }; | |
320 | |
321 PanTextAlignment *pan_text_alignment_new(PanWindow *pw, gint x, gint y, const gchar *key); | |
322 void pan_text_alignment_free(PanTextAlignment *ta); | |
323 | |
324 PanItem *pan_text_alignment_add(PanTextAlignment *ta, const gchar *label, const gchar *text); | |
325 void pan_text_alignment_calc(PanTextAlignment *ta, PanItem *box); | |
326 | |
327 | |
328 /* utils in pan-util.c */ | |
329 | |
330 typedef enum { | |
331 PAN_DATE_LENGTH_EXACT, | |
332 PAN_DATE_LENGTH_HOUR, | |
333 PAN_DATE_LENGTH_DAY, | |
334 PAN_DATE_LENGTH_WEEK, | |
335 PAN_DATE_LENGTH_MONTH, | |
336 PAN_DATE_LENGTH_YEAR | |
337 } PanDateLengthType; | |
338 | |
1434 | 339 gboolean pan_date_compare(time_t a, time_t b, PanDateLengthType length); |
105 | 340 gint pan_date_value(time_t d, PanDateLengthType length); |
341 gchar *pan_date_value_string(time_t d, PanDateLengthType length); | |
342 time_t pan_date_to_time(gint year, gint month, gint day); | |
343 | |
1434 | 344 gboolean pan_is_link_loop(const gchar *s); |
345 gboolean pan_is_ignored(const gchar *s, gboolean ignore_symlinks); | |
346 GList *pan_list_tree(FileData *dir_fd, SortType sort, gboolean ascend, | |
347 gboolean ignore_symlinks); | |
105 | 348 |
349 | |
350 /* the different view types */ | |
351 | |
352 void pan_calendar_update(PanWindow *pw, PanItem *pi_day); | |
783 | 353 void pan_calendar_compute(PanWindow *pw, FileData *dir_fd, gint *width, gint *height); |
354 void pan_flower_compute(PanWindow *pw, FileData *dir_fd, | |
105 | 355 gint *width, gint *height, |
356 gint *scroll_x, gint *scroll_y); | |
783 | 357 void pan_folder_tree_compute(PanWindow *pw, FileData *dir_fd, gint *width, gint *height); |
358 void pan_grid_compute(PanWindow *pw, FileData *dir_fd, gint *width, gint *height); | |
359 void pan_timeline_compute(PanWindow *pw, FileData *dir_fd, gint *width, gint *height); | |
105 | 360 |
361 | |
362 #endif | |
1055
1646720364cf
Adding a vim modeline to all files - patch by Klaus Ethgen
nadvornik
parents:
783
diff
changeset
|
363 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ |