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