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