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