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