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