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