Add support for Green-Magenta and Yellow-Blue anaglyph modes
[geeqie.git] / src / typedefs.h
1 /*
2  * Geeqie
3  * (C) 2006 John Ellis
4  * Copyright (C) 2008 - 2012 The Geeqie Team
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 TYPEDEFS_H
15 #define TYPEDEFS_H
16
17 typedef enum {
18         ZOOM_RESET_ORIGINAL     = 0,
19         ZOOM_RESET_FIT_WINDOW   = 1,
20         ZOOM_RESET_NONE         = 2
21 } ZoomMode;
22
23 typedef enum {
24         MOUSE_BUTTON_LEFT       = 1,
25         MOUSE_BUTTON_MIDDLE     = 2,
26         MOUSE_BUTTON_RIGHT      = 3,
27         MOUSE_BUTTON_WHEEL_UP   = 4,
28         MOUSE_BUTTON_WHEEL_DOWN = 5
29 } MouseButton;
30
31 typedef enum {
32         DIRVIEW_LIST,
33         DIRVIEW_TREE
34 } DirViewType;
35
36 typedef enum {
37         FILEVIEW_LIST,
38         FILEVIEW_ICON
39 } FileViewType;
40
41 #define CMD_COPY     "geeqie-copy-command.desktop"
42 #define CMD_MOVE     "geeqie-move-command.desktop"
43 #define CMD_RENAME   "geeqie-rename-command.desktop"
44 #define CMD_DELETE   "geeqie-delete-command.desktop"
45 #define CMD_FOLDER   "geeqie-folder-command.desktop"
46
47 typedef enum {
48         SORT_NONE,
49         SORT_NAME,
50         SORT_SIZE,
51         SORT_TIME,
52         SORT_PATH,
53         SORT_NUMBER,
54         SORT_EXIFTIME
55 } SortType;
56
57 typedef enum {
58         ALTER_NONE,             /* do nothing */
59         ALTER_ROTATE_90,
60         ALTER_ROTATE_90_CC,     /* counterclockwise */
61         ALTER_ROTATE_180,
62         ALTER_MIRROR,
63         ALTER_FLIP,
64 } AlterType;
65
66 typedef enum {
67         LAYOUT_HIDE   = 0,
68         LAYOUT_LEFT   = 1 << 0,
69         LAYOUT_RIGHT  = 1 << 1,
70         LAYOUT_TOP    = 1 << 2,
71         LAYOUT_BOTTOM = 1 << 3
72 } LayoutLocation;
73
74
75 typedef enum {
76         IMAGE_STATE_NONE        = 0,
77         IMAGE_STATE_IMAGE       = 1 << 0,
78         IMAGE_STATE_LOADING     = 1 << 1,
79         IMAGE_STATE_ERROR       = 1 << 2,
80         IMAGE_STATE_COLOR_ADJ   = 1 << 3,
81         IMAGE_STATE_ROTATE_AUTO = 1 << 4,
82         IMAGE_STATE_ROTATE_USER = 1 << 5,
83         IMAGE_STATE_DELAY_FLIP  = 1 << 6
84 } ImageState;
85
86 typedef enum {
87         SPLIT_NONE = 0,
88         SPLIT_VERT,
89         SPLIT_HOR,
90         SPLIT_QUAD,
91 } ImageSplitMode;
92
93 typedef enum {
94         FILEDATA_CHANGE_DELETE,
95         FILEDATA_CHANGE_MOVE,
96         FILEDATA_CHANGE_RENAME,
97         FILEDATA_CHANGE_COPY,
98         FILEDATA_CHANGE_UNSPECIFIED,
99         FILEDATA_CHANGE_WRITE_METADATA
100 } FileDataChangeType;
101
102 typedef enum {
103         MTS_MODE_MINUS,
104         MTS_MODE_SET,
105         MTS_MODE_OR,
106         MTS_MODE_AND
107 } MarkToSelectionMode;
108
109 typedef enum {
110         STM_MODE_RESET,
111         STM_MODE_SET,
112         STM_MODE_TOGGLE
113 } SelectionToMarkMode;
114
115 typedef enum {
116         FORMAT_CLASS_UNKNOWN,
117         FORMAT_CLASS_IMAGE,
118         FORMAT_CLASS_RAWIMAGE,
119         FORMAT_CLASS_META,
120         FILE_FORMAT_CLASSES
121 } FileFormatClass;
122
123 typedef enum {
124         SS_ERR_NONE = 0,
125         SS_ERR_DISABLED, /**< secsave is disabled. */
126         SS_ERR_OUT_OF_MEM, /**< memory allocation failure */
127
128         /* see err field in SecureSaveInfo */
129         SS_ERR_OPEN_READ,
130         SS_ERR_OPEN_WRITE,
131         SS_ERR_STAT,
132         SS_ERR_ACCESS,
133         SS_ERR_MKSTEMP,
134         SS_ERR_RENAME,
135         SS_ERR_OTHER,
136 } SecureSaveErrno;
137
138 typedef enum {
139         NOTIFY_PRIORITY_HIGH = 0,
140         NOTIFY_PRIORITY_MEDIUM,
141         NOTIFY_PRIORITY_LOW
142 } NotifyPriority;
143
144 typedef enum {
145         NOTIFY_MARKS            = 1 << 1, /* changed marks */
146         NOTIFY_PIXBUF           = 1 << 2, /* image was read into fd->pixbuf */
147         NOTIFY_HISTMAP          = 1 << 3, /* histmap was read into fd->histmap */
148         NOTIFY_ORIENTATION      = 1 << 4, /* image was rotated */
149         NOTIFY_METADATA         = 1 << 5, /* changed image metadata, not yet written */
150         NOTIFY_GROUPING         = 1 << 6, /* change in fd->sidecar_files or fd->parent */
151         NOTIFY_REREAD           = 1 << 7, /* changed file size, date, etc., file name remains unchanged */
152         NOTIFY_CHANGE           = 1 << 8  /* generic change described by fd->change */
153 } NotifyType;
154
155 typedef enum {
156         CHANGE_OK                      = 0,
157         CHANGE_WARN_DEST_EXISTS        = 1 << 0,
158         CHANGE_WARN_NO_WRITE_PERM      = 1 << 1,
159         CHANGE_WARN_SAME               = 1 << 2,
160         CHANGE_WARN_CHANGED_EXT        = 1 << 3,
161         CHANGE_WARN_UNSAVED_META       = 1 << 4,
162         CHANGE_WARN_NO_WRITE_PERM_DEST_DIR  = 1 << 5,
163         CHANGE_ERROR_MASK              = (~0) << 8, /* the values below are fatal errors */
164         CHANGE_NO_READ_PERM            = 1 << 8,
165         CHANGE_NO_WRITE_PERM_DIR       = 1 << 9,
166         CHANGE_NO_DEST_DIR             = 1 << 10,
167         CHANGE_NO_WRITE_PERM_DEST      = 1 << 12,
168         CHANGE_DEST_EXISTS             = 1 << 13,
169         CHANGE_NO_SRC                  = 1 << 14,
170         CHANGE_GENERIC_ERROR           = 1 << 16
171 } ChangeError;
172
173 typedef enum {
174         METADATA_PLAIN          = 0, /* format that can be edited and written back */
175         METADATA_FORMATTED      = 1  /* for display only */
176 } MetadataFormat;
177
178 typedef enum {
179         STARTUP_PATH_CURRENT    = 0,
180         STARTUP_PATH_LAST,
181         STARTUP_PATH_HOME,
182 } StartUpPath;
183
184 typedef enum {
185         TOOLBAR_MAIN,
186         TOOLBAR_STATUS,
187         TOOLBAR_COUNT
188 } ToolbarType;
189
190 typedef enum {
191         PR_STEREO_NONE             = 0,   /* do nothing */
192         PR_STEREO_DUAL             = 1 << 0, /* independent stereo buffers, for example nvidia opengl */
193         PR_STEREO_FIXED            = 1 << 1,  /* custom position */
194         PR_STEREO_HORIZ            = 1 << 2,  /* side by side */
195         PR_STEREO_VERT             = 1 << 3,  /* above below */
196         PR_STEREO_RIGHT            = 1 << 4,  /* render right buffer */
197         PR_STEREO_ANAGLYPH_RC      = 1 << 5,  /* anaglyph red-cyan */
198         PR_STEREO_ANAGLYPH_GM      = 1 << 6,  /* anaglyph green-magenta */
199         PR_STEREO_ANAGLYPH_YB      = 1 << 7,  /* anaglyph yellow-blue */
200         PR_STEREO_ANAGLYPH_GRAY_RC = 1 << 8,  /* anaglyph gray red-cyan*/
201         PR_STEREO_ANAGLYPH_GRAY_GM = 1 << 9,  /* anaglyph gray green-magenta */
202         PR_STEREO_ANAGLYPH_GRAY_YB = 1 << 10, /* anaglyph gray yellow-blue */
203         PR_STEREO_ANAGLYPH_DB_RC   = 1 << 11, /* anaglyph dubois red-cyan */
204         PR_STEREO_ANAGLYPH_DB_GM   = 1 << 12, /* anaglyph dubois green-magenta */
205         PR_STEREO_ANAGLYPH_DB_YB   = 1 << 13, /* anaglyph dubois yellow-blue */
206         PR_STEREO_ANAGLYPH         = PR_STEREO_ANAGLYPH_RC |
207                                      PR_STEREO_ANAGLYPH_GM |
208                                      PR_STEREO_ANAGLYPH_YB |
209                                      PR_STEREO_ANAGLYPH_GRAY_RC |
210                                      PR_STEREO_ANAGLYPH_GRAY_GM |
211                                      PR_STEREO_ANAGLYPH_GRAY_YB |
212                                      PR_STEREO_ANAGLYPH_DB_RC |
213                                      PR_STEREO_ANAGLYPH_DB_GM |
214                                      PR_STEREO_ANAGLYPH_DB_YB, /* anaglyph mask */
215
216         PR_STEREO_MIRROR_LEFT      = 1 << 14, /* mirror */
217         PR_STEREO_FLIP_LEFT        = 1 << 15, /* flip */
218
219         PR_STEREO_MIRROR_RIGHT     = 1 << 16, /* mirror */
220         PR_STEREO_FLIP_RIGHT       = 1 << 17, /* flip */
221
222         PR_STEREO_MIRROR           = PR_STEREO_MIRROR_LEFT | PR_STEREO_MIRROR_RIGHT, /* mirror mask*/
223         PR_STEREO_FLIP             = PR_STEREO_FLIP_LEFT | PR_STEREO_FLIP_RIGHT, /* flip mask*/
224         PR_STEREO_SWAP             = 1 << 18,  /* swap left and right buffers */
225         PR_STEREO_TEMP_DISABLE     = 1 << 19,  /* temporarily disable stereo mode if source image is not stereo */
226         PR_STEREO_HALF             = 1 << 20
227 } PixbufRendererStereoMode;
228
229 typedef enum {
230         STEREO_PIXBUF_DEFAULT  = 0,
231         STEREO_PIXBUF_SBS      = 1,
232         STEREO_PIXBUF_CROSS    = 2,
233         STEREO_PIXBUF_NONE     = 3
234 } StereoPixbufData;
235
236 #define MAX_SPLIT_IMAGES 4
237
238 typedef struct _ImageLoader ImageLoader;
239 typedef struct _ThumbLoader ThumbLoader;
240
241 typedef struct _CollectInfo CollectInfo;
242 typedef struct _CollectionData CollectionData;
243 typedef struct _CollectTable CollectTable;
244 typedef struct _CollectWindow CollectWindow;
245
246 typedef struct _ImageWindow ImageWindow;
247
248 typedef struct _FileData FileData;
249 typedef struct _FileDataChangeInfo FileDataChangeInfo;
250
251 typedef struct _LayoutWindow LayoutWindow;
252 typedef struct _LayoutOptions LayoutOptions;
253
254 typedef struct _ViewDir ViewDir;
255 typedef struct _ViewDirInfoList ViewDirInfoList;
256 typedef struct _ViewDirInfoTree ViewDirInfoTree;
257
258 typedef struct _ViewFile ViewFile;
259 typedef struct _ViewFileInfoList ViewFileInfoList;
260 typedef struct _ViewFileInfoIcon ViewFileInfoIcon;
261
262 typedef struct _SlideShowData SlideShowData;
263 typedef struct _FullScreenData FullScreenData;
264
265 typedef struct _PixmapFolders PixmapFolders;
266 typedef struct _Histogram Histogram;
267 typedef struct _HistMap HistMap;
268
269 typedef struct _SecureSaveInfo SecureSaveInfo;
270
271 typedef struct _ExifData ExifData;
272
273 typedef struct _EditorDescription EditorDescription;
274
275 typedef struct _CommandLine CommandLine;
276
277 struct _Histogram {
278         gint histogram_channel; /* drawing mode for histogram */
279         gint histogram_mode;     /* logarithmical or not */
280         guint vgrid; /* number of vertical divisions, 0 for none */
281         guint hgrid; /* number of horizontal divisions, 0 for none */
282         struct {
283                 int R; /* red */
284                 int G; /* green */
285                 int B; /* blue */
286                 int A; /* alpha */
287         } grid_color;  /* grid color */
288
289 };
290
291
292
293 struct _ImageLoader;
294
295 typedef void (* ThumbLoaderFunc)(ThumbLoader *tl, gpointer data);
296
297 typedef void (* FileUtilDoneFunc)(gboolean success, const gchar *done_path, gpointer data);
298
299 struct _ThumbLoader
300 {
301         gboolean standard_loader;
302
303         ImageLoader *il;
304         FileData *fd;           /* fd->pixbuf contains final (scaled) image when done */
305
306         gboolean cache_enable;
307         gboolean cache_hit;
308         gdouble percent_done;
309
310         gint max_w;
311         gint max_h;
312
313         ThumbLoaderFunc func_done;
314         ThumbLoaderFunc func_error;
315         ThumbLoaderFunc func_progress;
316
317         gpointer data;
318
319         guint idle_done_id; /* event source id */
320 };
321
322 struct _CollectInfo
323 {
324         FileData *fd;
325         GdkPixbuf *pixbuf;
326         guint flag_mask;
327 };
328
329 struct _CollectionData
330 {
331         gchar *path;
332         gchar *name;
333         GList *list;
334         SortType sort_method;
335
336         ThumbLoader *thumb_loader;
337         CollectInfo *thumb_info;
338
339         void (*info_updated_func)(CollectionData *, CollectInfo *, gpointer);
340         gpointer info_updated_data;
341
342         gint ref;
343
344         /* geometry */
345         gint window_read;
346         gint window_x;
347         gint window_y;
348         gint window_w;
349         gint window_h;
350
351         /* contents changed since save flag */
352         gboolean changed;
353
354         GHashTable *existence;
355 };
356
357 struct _CollectTable
358 {
359         GtkWidget *scrolled;
360         GtkWidget *listview;
361         gint columns;
362         gint rows;
363
364         CollectionData *cd;
365
366         GList *selection;
367         CollectInfo *prev_selection;
368
369         CollectInfo *click_info;
370
371         GtkWidget *tip_window;
372         guint tip_delay_id; /* event source id */
373         CollectInfo *tip_info;
374
375         GdkWindow *marker_window;
376         CollectInfo *marker_info;
377
378         GtkWidget *status_label;
379         GtkWidget *extra_label;
380
381         gint focus_row;
382         gint focus_column;
383         CollectInfo *focus_info;
384
385         GtkWidget *popup;
386         CollectInfo *drop_info;
387         GList *drop_list;
388
389         guint sync_idle_id; /* event source id */
390         guint drop_idle_id; /* event source id */
391
392         gboolean show_text;
393
394         /* file list for edit menu */
395         GList *editmenu_fd_list;
396 };
397
398 struct _CollectWindow
399 {
400         GtkWidget *window;
401         CollectTable *table;
402         GtkWidget *status_box;
403         GList *list;
404
405         GtkWidget *close_dialog;
406
407         CollectionData *cd;
408 };
409
410 typedef gint (* ImageTileRequestFunc)(ImageWindow *imd, gint x, gint y,
411                                       gint width, gint height, GdkPixbuf *pixbuf, gpointer);
412 typedef void (* ImageTileDisposeFunc)(ImageWindow *imd, gint x, gint y,
413                                       gint width, gint height, GdkPixbuf *pixbuf, gpointer);
414
415 struct _ImageWindow
416 {
417         GtkWidget *widget;      /* use this to add it and show it */
418         GtkWidget *pr;
419         GtkWidget *frame;
420
421         FileData *image_fd;
422
423         gboolean unknown;               /* failed to load image */
424
425         ImageLoader *il;        /* FIXME - image loader should probably go to FileData, but it must first support
426                                    sending callbacks to multiple ImageWindows in parallel */
427
428         gint has_frame;  /* not boolean, see image_new() */
429
430         /* top level (not necessarily parent) window */
431         gboolean top_window_sync;       /* resize top_window when image dimensions change */
432         GtkWidget *top_window;  /* window that gets title, and window to resize when 'fitting' */
433         gchar *title;           /* window title to display left of file name */
434         gchar *title_right;     /* window title to display right of file name */
435         gboolean title_show_zoom;       /* option to include zoom in window title */
436
437         gboolean completed;
438         ImageState state;       /* mask of IMAGE_STATE_* flags about current image */
439
440         void (*func_update)(ImageWindow *imd, gpointer data);
441         void (*func_complete)(ImageWindow *imd, gint preload, gpointer data);
442         void (*func_state)(ImageWindow *imd, ImageState state, gpointer data);
443         ImageTileRequestFunc func_tile_request;
444         ImageTileDisposeFunc func_tile_dispose;
445
446         gpointer data_update;
447         gpointer data_complete;
448         gpointer data_state;
449         gpointer data_tile;
450
451         /* button, scroll functions */
452         void (*func_button)(ImageWindow *, GdkEventButton *event, gpointer);
453         void (*func_drag)(ImageWindow *, GdkEventButton *event, gdouble dx, gdouble dy, gpointer);
454         void (*func_scroll)(ImageWindow *, GdkEventScroll *event, gpointer);
455         void (*func_focus_in)(ImageWindow *, gpointer);
456
457         gpointer data_button;
458         gpointer data_drag;
459         gpointer data_scroll;
460         gpointer data_focus_in;
461
462         /* scroll notification (for scroll bar implementation) */
463         void (*func_scroll_notify)(ImageWindow *, gint x, gint y, gint width, gint height, gpointer);
464
465         gpointer data_scroll_notify;
466
467         /* collection info */
468         CollectionData *collection;
469         CollectInfo *collection_info;
470
471         /* color profiles */
472         gboolean color_profile_enable;
473         gint color_profile_input;
474         gboolean color_profile_use_image;
475         gint color_profile_from_image;
476         gpointer cm;
477
478         AlterType delay_alter_type;
479
480         FileData *read_ahead_fd;
481         ImageLoader *read_ahead_il;
482
483         gint prev_color_row;
484
485         gboolean auto_refresh;
486
487         gboolean delay_flip;
488         gint orientation;
489         gboolean desaturate;
490         gint user_stereo;
491 };
492
493 #define FILEDATA_MARKS_SIZE 6
494
495 struct _FileDataChangeInfo {
496         FileDataChangeType type;
497         gchar *source;
498         gchar *dest;
499         gint error;
500         gboolean regroup_when_finished;
501 };
502
503 struct _FileData {
504         guint magick;
505         gint type;
506         gchar *original_path; /* key to file_data_pool hash table */
507         gchar *path;
508         const gchar *name;
509         const gchar *extension;
510         gchar *collate_key_name;
511         gchar *collate_key_name_nocase;
512         gint64 size;
513         time_t date;
514         mode_t mode; /* this is needed at least for notification in view_dir because it is preserved after the file/directory is deleted */
515         gint sidecar_priority;
516
517         guint marks; /* each bit represents one mark */
518         guint valid_marks; /* zero bit means that the corresponding mark needs to be reread */
519
520
521         GList *sidecar_files;
522         FileData *parent; /* parent file if this is a sidecar file, NULL otherwise */
523         FileDataChangeInfo *change; /* for rename, move ... */
524         GdkPixbuf *thumb_pixbuf;
525
526         GdkPixbuf *pixbuf; /* full-size image, only complete images, NULL during loading
527                               all FileData with non-NULL pixbuf are referenced by image_cache */
528
529         HistMap *histmap;
530
531         gboolean locked;
532         gint ref;
533         gint version; /* increased when any field in this structure is changed */
534         gboolean disable_grouping;
535
536         gint user_orientation;
537         gint exif_orientation;
538
539         ExifData *exif;
540         time_t exifdate;
541         GHashTable *modified_xmp; // hash table which contains unwritten xmp metadata in format: key->list of string values
542         GList *cached_metadata;
543 };
544
545 struct _LayoutOptions
546 {
547         gchar *id;
548
549         gchar *order;
550         gint style;
551
552         DirViewType dir_view_type;
553         FileViewType file_view_type;
554
555         gboolean show_thumbnails;
556         gboolean show_marks;
557         gboolean show_directory_date;
558         gboolean show_info_pixel;
559
560         struct {
561                 gint w;
562                 gint h;
563                 gint x;
564                 gint y;
565                 gboolean maximized;
566                 gint hdivider_pos;
567                 gint vdivider_pos;
568         } main_window;
569
570         struct {
571                 gint w;
572                 gint h;
573                 gint x;
574                 gint y;
575                 gint vdivider_pos;
576         } float_window;
577
578         struct {
579                 gint w;
580                 gint h;
581         } properties_window;
582
583         struct {
584                 guint state;
585                 gint histogram_channel;
586                 gint histogram_mode;
587         } image_overlay;
588
589         gboolean tools_float;
590         gboolean tools_hidden;
591         gboolean toolbar_hidden;
592
593         gchar *home_path;
594         gchar *last_path;
595
596         StartUpPath startup_path;
597
598         gboolean exit_on_close;
599 };
600
601 struct _LayoutWindow
602 {
603         LayoutOptions options;
604
605         FileData *dir_fd;
606
607         /* base */
608
609         GtkWidget *window;
610
611         GtkWidget *main_box;
612
613         GtkWidget *group_box;
614         GtkWidget *h_pane;
615         GtkWidget *v_pane;
616
617         /* menus, path selector */
618
619         GtkActionGroup *action_group;
620         GtkActionGroup *action_group_editors;
621         guint ui_editors_id;
622         GtkUIManager *ui_manager;
623         guint toolbar_merge_id[TOOLBAR_COUNT];
624         GList *toolbar_actions[TOOLBAR_COUNT];
625
626         GtkWidget *path_entry;
627
628         /* image */
629
630         LayoutLocation image_location;
631
632         ImageWindow *image;
633
634         ImageWindow *split_images[MAX_SPLIT_IMAGES];
635         ImageSplitMode split_mode;
636         gint active_split_image;
637
638         GtkWidget *split_image_widget;
639         GtkSizeGroup *split_image_sizegroup;
640
641         /* tools window (float) */
642
643         GtkWidget *tools;
644         GtkWidget *tools_pane;
645
646 //      gint tools_float;
647 //      gint tools_hidden;
648
649         GtkWidget *menu_bar; /* referenced by lw, exist during whole lw lifetime */
650         /* toolbar */
651
652         GtkWidget *toolbar[TOOLBAR_COUNT]; /* referenced by lw, exist during whole lw lifetime */
653 //      gint toolbar_hidden;
654
655 //      GtkWidget *thumb_button;
656 //      gint thumbs_enabled;
657 //      gint marks_enabled;
658
659         GtkWidget *back_button;
660
661         /* dir view */
662
663         LayoutLocation dir_location;
664
665         ViewDir *vd;
666         GtkWidget *dir_view;
667
668 //      DirViewType dir_view_type;
669
670         /* file view */
671
672         LayoutLocation file_location;
673
674         ViewFile *vf;
675 //      FileViewType file_view_type;
676
677         GtkWidget *file_view;
678
679         SortType sort_method;
680         gboolean sort_ascend;
681
682         /* status bar */
683
684         GtkWidget *info_box;
685         GtkWidget *info_progress_bar;
686         GtkWidget *info_sort;
687         GtkWidget *info_status;
688         GtkWidget *info_details;
689         GtkWidget *info_zoom;
690         GtkWidget *info_pixel;
691
692         /* slide show */
693
694         SlideShowData *slideshow;
695
696         /* full screen */
697
698         FullScreenData *full_screen;
699
700         /* dividers */
701
702 //      gint div_h;
703 //      gint div_v;
704 //      gint div_float;
705
706         /* misc */
707
708         GtkWidget *utility_box; /* referenced by lw, exist during whole lw lifetime */
709         GtkWidget *utility_paned; /* between image and bar */
710         GtkWidget *bar_sort;
711         GtkWidget *bar;
712
713 //      gint bar_sort_enabled;
714 //      gint bar_enabled;
715
716 //      gint bar_width;
717
718         GtkWidget *exif_window;
719 };
720
721 struct _ViewDir
722 {
723         DirViewType type;
724         gpointer info;
725
726         GtkWidget *widget;
727         GtkWidget *view;
728
729         FileData *dir_fd;
730
731         FileData *click_fd;
732
733         FileData *drop_fd;
734         GList *drop_list;
735         guint drop_scroll_id; /* event source id */
736
737         /* func list */
738         void (*select_func)(ViewDir *vd, FileData *fd, gpointer data);
739         gpointer select_data;
740
741         void (*dnd_drop_update_func)(ViewDir *vd);
742         void (*dnd_drop_leave_func)(ViewDir *vd);
743
744         LayoutWindow *layout;
745
746         GtkWidget *popup;
747
748         PixmapFolders *pf;
749 };
750
751 struct _ViewDirInfoList
752 {
753         GList *list;
754 };
755
756 struct _ViewDirInfoTree
757 {
758         guint drop_expand_id; /* event source id */
759         gint busy_ref;
760 };
761
762
763 struct _ViewFile
764 {
765         FileViewType type;
766         gpointer info;
767
768         GtkWidget *widget;
769         GtkWidget *listview;
770         GtkWidget *scrolled;
771         GtkWidget *filter;
772         GtkWidget *filter_check[FILEDATA_MARKS_SIZE];
773
774         FileData *dir_fd;
775         GList *list;
776
777         SortType sort_method;
778         gboolean sort_ascend;
779
780         /* func list */
781         void (*func_thumb_status)(ViewFile *vf, gdouble val, const gchar *text, gpointer data);
782         gpointer data_thumb_status;
783
784         void (*func_status)(ViewFile *vf, gpointer data);
785         gpointer data_status;
786
787         LayoutWindow *layout;
788
789         GtkWidget *popup;
790
791         /* thumbs updates*/
792         gboolean thumbs_running;
793         ThumbLoader *thumbs_loader;
794         FileData *thumbs_filedata;
795
796         /* marks */
797         gboolean marks_enabled;
798         gint active_mark;
799         gint clicked_mark;
800
801         /* refresh */
802         guint refresh_idle_id; /* event source id */
803         time_t time_refresh_set; /* time when refresh_idle_id was set */
804
805         /* file list for edit menu */
806         GList *editmenu_fd_list;
807 };
808
809 struct _ViewFileInfoList
810 {
811         FileData *click_fd;
812         FileData *select_fd;
813
814         gboolean thumbs_enabled;
815
816         guint select_idle_id; /* event source id */
817 };
818
819 struct _IconData;
820
821 struct _ViewFileInfoIcon
822 {
823         /* table stuff */
824         gint columns;
825         gint rows;
826
827         GList *selection;
828         struct _IconData *prev_selection;
829
830         GtkWidget *tip_window;
831         guint tip_delay_id; /* event source id */
832         struct _IconData *tip_id;
833
834         struct _IconData *click_id;
835
836         struct _IconData *focus_id;
837         gint focus_row;
838         gint focus_column;
839
840         gboolean show_text;
841 };
842
843 struct _SlideShowData
844 {
845         LayoutWindow *lw;        /* use this window to display the slideshow */
846         ImageWindow *imd;        /* use this window only if lw is not available,
847                                     FIXME: it is probably required only by img-view.c and should be dropped with it */
848
849         GList *filelist;
850         CollectionData *cd;
851         FileData *dir_fd;
852
853         GList *list;
854         GList *list_done;
855
856         FileData *slide_fd;
857
858         guint slide_count;
859         guint timeout_id; /* event source id */
860
861         gboolean from_selection;
862
863         void (*stop_func)(SlideShowData *, gpointer);
864         gpointer stop_data;
865
866         gboolean paused;
867 };
868
869 struct _FullScreenData
870 {
871         GtkWidget *window;
872         ImageWindow *imd;
873
874         GtkWidget *normal_window;
875         ImageWindow *normal_imd;
876
877         guint hide_mouse_id; /* event source id */
878         guint busy_mouse_id; /* event source id */
879
880         gint cursor_state;
881
882         guint saver_block_id; /* event source id */
883
884         void (*stop_func)(FullScreenData *, gpointer);
885         gpointer stop_data;
886
887         gboolean same_region; /* the returned region will overlap the current location of widget. */
888 };
889
890 struct _PixmapFolders
891 {
892         GdkPixbuf *close;
893         GdkPixbuf *open;
894         GdkPixbuf *deny;
895         GdkPixbuf *parent;
896 };
897
898 struct _SecureSaveInfo {
899         FILE *fp; /**< file stream pointer */
900         gchar *file_name; /**< final file name */
901         gchar *tmp_file_name; /**< temporary file name */
902         gint err; /**< set to non-zero value in case of error */
903         gboolean secure_save; /**< use secure save for this file, internal use only */
904         gboolean preserve_perms; /**< whether to preserve perms, TRUE by default */
905         gboolean preserve_mtime; /**< whether to preserve mtime, FALSE by default */
906         gboolean unlink_on_error; /**< whether to remove temporary file on save failure, TRUE by default */
907 };
908
909 struct _CommandLine
910 {
911         int argc;
912         gchar **argv;
913         gboolean startup_blank;
914         gboolean startup_full_screen;
915         gboolean startup_in_slideshow;
916         gboolean startup_command_line_collection;
917         gboolean tools_hide;
918         gboolean tools_show;
919         gchar *path;
920         gchar *file;
921         GList *cmd_list;
922         GList *collection_list;
923         gchar *geometry;
924 };
925
926 #endif
927 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */