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