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