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