Fix #612: Pan view image class filtering
[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
443         /* file list for edit menu */
444         GList *editmenu_fd_list;
445 };
446
447 struct _CollectWindow
448 {
449         GtkWidget *window;
450         CollectTable *table;
451         GtkWidget *status_box;
452
453         GtkWidget *close_dialog;
454
455         CollectionData *cd;
456 };
457
458 typedef gint (* ImageTileRequestFunc)(ImageWindow *imd, gint x, gint y,
459                                       gint width, gint height, GdkPixbuf *pixbuf, gpointer);
460 typedef void (* ImageTileDisposeFunc)(ImageWindow *imd, gint x, gint y,
461                                       gint width, gint height, GdkPixbuf *pixbuf, gpointer);
462
463 struct _ImageWindow
464 {
465         GtkWidget *widget;      /* use this to add it and show it */
466         GtkWidget *pr;
467         GtkWidget *frame;
468
469         FileData *image_fd;
470
471         gboolean unknown;               /* failed to load image */
472
473         ImageLoader *il;        /* FIXME - image loader should probably go to FileData, but it must first support
474                                    sending callbacks to multiple ImageWindows in parallel */
475
476         gint has_frame;  /* not boolean, see image_new() */
477
478         /* top level (not necessarily parent) window */
479         gboolean top_window_sync;       /* resize top_window when image dimensions change */
480         GtkWidget *top_window;  /* window that gets title, and window to resize when 'fitting' */
481         gchar *title;           /* window title to display left of file name */
482         gchar *title_right;     /* window title to display right of file name */
483         gboolean title_show_zoom;       /* option to include zoom in window title */
484
485         gboolean completed;
486         ImageState state;       /* mask of IMAGE_STATE_* flags about current image */
487
488         void (*func_update)(ImageWindow *imd, gpointer data);
489         void (*func_complete)(ImageWindow *imd, gint preload, gpointer data);
490         void (*func_state)(ImageWindow *imd, ImageState state, gpointer data);
491         ImageTileRequestFunc func_tile_request;
492         ImageTileDisposeFunc func_tile_dispose;
493
494         gpointer data_update;
495         gpointer data_complete;
496         gpointer data_state;
497         gpointer data_tile;
498
499         /* button, scroll functions */
500         void (*func_button)(ImageWindow *, GdkEventButton *event, gpointer);
501         void (*func_drag)(ImageWindow *, GdkEventMotion *event, gdouble dx, gdouble dy, gpointer);
502         void (*func_scroll)(ImageWindow *, GdkEventScroll *event, gpointer);
503         void (*func_focus_in)(ImageWindow *, gpointer);
504
505         gpointer data_button;
506         gpointer data_drag;
507         gpointer data_scroll;
508         gpointer data_focus_in;
509
510         /* scroll notification (for scroll bar implementation) */
511         void (*func_scroll_notify)(ImageWindow *, gint x, gint y, gint width, gint height, gpointer);
512
513         gpointer data_scroll_notify;
514
515         /* collection info */
516         CollectionData *collection;
517         CollectInfo *collection_info;
518
519         /* color profiles */
520         gboolean color_profile_enable;
521         gint color_profile_input;
522         gboolean color_profile_use_image;
523         gint color_profile_from_image;
524         gpointer cm;
525
526         AlterType delay_alter_type;
527
528         FileData *read_ahead_fd;
529         ImageLoader *read_ahead_il;
530
531         gint prev_color_row;
532
533         gboolean auto_refresh;
534
535         gboolean delay_flip;
536         gint orientation;
537         gboolean desaturate;
538         gint user_stereo;
539
540         gboolean mouse_wheel_mode;
541 };
542
543 #define FILEDATA_MARKS_SIZE 10
544
545 struct _FileDataChangeInfo {
546         FileDataChangeType type;
547         gchar *source;
548         gchar *dest;
549         gint error;
550         gboolean regroup_when_finished;
551 };
552
553 struct _FileData {
554         guint magick;
555         gint type;
556         gchar *original_path; /* key to file_data_pool hash table */
557         gchar *path;
558         const gchar *name;
559         const gchar *extension;
560         gchar *extended_extension;
561         FileFormatClass format_class;
562         gchar *collate_key_name;
563         gchar *collate_key_name_nocase;
564         gint64 size;
565         time_t date;
566         time_t cdate;
567         mode_t mode; /* this is needed at least for notification in view_dir because it is preserved after the file/directory is deleted */
568         gint sidecar_priority;
569
570         guint marks; /* each bit represents one mark */
571         guint valid_marks; /* zero bit means that the corresponding mark needs to be reread */
572
573
574         GList *sidecar_files;
575         FileData *parent; /* parent file if this is a sidecar file, NULL otherwise */
576         FileDataChangeInfo *change; /* for rename, move ... */
577         GdkPixbuf *thumb_pixbuf;
578
579         GdkPixbuf *pixbuf; /* full-size image, only complete images, NULL during loading
580                               all FileData with non-NULL pixbuf are referenced by image_cache */
581
582         HistMap *histmap;
583
584         gboolean locked;
585         gint ref;
586         gint version; /* increased when any field in this structure is changed */
587         gboolean disable_grouping;
588
589         gint user_orientation;
590         gint exif_orientation;
591
592         ExifData *exif;
593         time_t exifdate;
594         time_t exifdate_digitized;
595         GHashTable *modified_xmp; // hash table which contains unwritten xmp metadata in format: key->list of string values
596         GList *cached_metadata;
597         gint rating;
598
599         SelectionType selected;  // Used by view_file_icon.
600 };
601
602 struct _LayoutOptions
603 {
604         gchar *id;
605
606         gchar *order;
607         gint style;
608
609         DirViewType dir_view_type;
610         FileViewType file_view_type;
611
612         gboolean show_thumbnails;
613         gboolean show_marks;
614         gboolean show_directory_date;
615         gboolean show_info_pixel;
616
617         struct {
618                 gint w;
619                 gint h;
620                 gint x;
621                 gint y;
622                 gboolean maximized;
623                 gint hdivider_pos;
624                 gint vdivider_pos;
625         } main_window;
626
627         struct {
628                 gint w;
629                 gint h;
630                 gint x;
631                 gint y;
632                 gint vdivider_pos;
633         } float_window;
634
635         struct {
636                 gint vdivider_pos;
637         } folder_window;
638
639         struct {
640                 gint w;
641                 gint h;
642         } properties_window;
643
644         struct {
645                 guint state;
646                 gint histogram_channel;
647                 gint histogram_mode;
648         } image_overlay;
649
650         struct {
651                 gint w;
652                 gint h;
653                 gint x;
654                 gint y;
655         } log_window;
656
657         gboolean tools_float;
658         gboolean tools_hidden;
659         gboolean toolbar_hidden;
660
661         struct {
662                 gboolean info;
663                 gboolean sort;
664                 gboolean tools_float;
665                 gboolean tools_hidden;
666                 gboolean hidden;
667         } bars_state;
668
669         gchar *home_path;
670         gchar *last_path;
671
672         StartUpPath startup_path;
673
674         gboolean exit_on_close;
675
676         gboolean animate;
677 };
678
679 struct _LayoutWindow
680 {
681         LayoutOptions options;
682
683         FileData *dir_fd;
684
685         /* base */
686
687         GtkWidget *window;
688
689         GtkWidget *main_box;
690
691         GtkWidget *group_box;
692         GtkWidget *h_pane;
693         GtkWidget *v_pane;
694
695         /* menus, path selector */
696
697         GtkActionGroup *action_group;
698         GtkActionGroup *action_group_editors;
699         guint ui_editors_id;
700         GtkUIManager *ui_manager;
701         guint toolbar_merge_id[TOOLBAR_COUNT];
702         GList *toolbar_actions[TOOLBAR_COUNT];
703
704         GtkWidget *path_entry;
705
706         /* image */
707
708         LayoutLocation image_location;
709
710         ImageWindow *image;
711
712         ImageWindow *split_images[MAX_SPLIT_IMAGES];
713         ImageSplitMode split_mode;
714         gint active_split_image;
715
716         GtkWidget *split_image_widget;
717         GtkSizeGroup *split_image_sizegroup;
718
719         /* tools window (float) */
720
721         GtkWidget *tools;
722         GtkWidget *tools_pane;
723
724 //      gint tools_float;
725 //      gint tools_hidden;
726
727         GtkWidget *menu_bar; /* referenced by lw, exist during whole lw lifetime */
728         /* toolbar */
729
730         GtkWidget *toolbar[TOOLBAR_COUNT]; /* referenced by lw, exist during whole lw lifetime */
731 //      gint toolbar_hidden;
732
733 //      GtkWidget *thumb_button;
734 //      gint thumbs_enabled;
735 //      gint marks_enabled;
736
737         GtkWidget *back_button;
738
739         /* dir view */
740
741         LayoutLocation dir_location;
742
743         ViewDir *vd;
744         GtkWidget *dir_view;
745
746 //      DirViewType dir_view_type;
747
748         /* file view */
749
750         LayoutLocation file_location;
751
752         ViewFile *vf;
753 //      FileViewType file_view_type;
754
755         GtkWidget *file_view;
756
757         SortType sort_method;
758         gboolean sort_ascend;
759
760         /* status bar */
761
762         GtkWidget *info_box;
763         GtkWidget *info_progress_bar;
764         GtkWidget *info_sort;
765         GtkWidget *info_status;
766         GtkWidget *info_details;
767         GtkWidget *info_zoom;
768         GtkWidget *info_pixel;
769
770         /* slide show */
771
772         SlideShowData *slideshow;
773
774         /* full screen */
775
776         FullScreenData *full_screen;
777
778         /* dividers */
779
780 //      gint div_h;
781 //      gint div_v;
782 //      gint div_float;
783
784         /* misc */
785
786         GtkWidget *utility_box; /* referenced by lw, exist during whole lw lifetime */
787         GtkWidget *utility_paned; /* between image and bar */
788         GtkWidget *bar_sort;
789         GtkWidget *bar;
790
791         gboolean bar_sort_enabled; /* Set during start-up, and checked when the editors have loaded */
792 //      gint bar_enabled;
793
794 //      gint bar_width;
795
796         GtkWidget *exif_window;
797
798         AnimationData *animation;
799
800         GtkWidget *log_window;
801 };
802
803 struct _ViewDir
804 {
805         DirViewType type;
806         gpointer info;
807
808         GtkWidget *widget;
809         GtkWidget *view;
810
811         FileData *dir_fd;
812
813         FileData *click_fd;
814
815         FileData *drop_fd;
816         GList *drop_list;
817         guint drop_scroll_id; /* event source id */
818
819         /* func list */
820         void (*select_func)(ViewDir *vd, FileData *fd, gpointer data);
821         gpointer select_data;
822
823         void (*dnd_drop_update_func)(ViewDir *vd);
824         void (*dnd_drop_leave_func)(ViewDir *vd);
825
826         LayoutWindow *layout;
827
828         GtkWidget *popup;
829
830         PixmapFolders *pf;
831 };
832
833 struct _ViewDirInfoList
834 {
835         GList *list;
836 };
837
838 struct _ViewDirInfoTree
839 {
840         guint drop_expand_id; /* event source id */
841         gint busy_ref;
842 };
843
844
845 struct _ViewFile
846 {
847         FileViewType type;
848         // TODO(xsdg): Turn this into a union (see VFLIST and VFICON from view_file.h).
849         gpointer info;
850
851         GtkWidget *widget;
852         GtkWidget *listview;
853         GtkWidget *scrolled;
854         GtkWidget *filter;
855         GtkWidget *filter_check[FILEDATA_MARKS_SIZE];
856
857         FileData *dir_fd;
858         GList *list;
859
860         SortType sort_method;
861         gboolean sort_ascend;
862
863         /* func list */
864         void (*func_thumb_status)(ViewFile *vf, gdouble val, const gchar *text, gpointer data);
865         gpointer data_thumb_status;
866
867         void (*func_status)(ViewFile *vf, gpointer data);
868         gpointer data_status;
869
870         LayoutWindow *layout;
871
872         GtkWidget *popup;
873
874         /* thumbs updates*/
875         gboolean thumbs_running;
876         ThumbLoader *thumbs_loader;
877         FileData *thumbs_filedata;
878
879         /* marks */
880         gboolean marks_enabled;
881         gint active_mark;
882         gint clicked_mark;
883
884         /* refresh */
885         guint refresh_idle_id; /* event source id */
886         time_t time_refresh_set; /* time when refresh_idle_id was set */
887
888         /* file list for edit menu */
889         GList *editmenu_fd_list;
890 };
891
892 struct _ViewFileInfoList
893 {
894         FileData *click_fd;
895         FileData *select_fd;
896
897         gboolean thumbs_enabled;
898
899         guint select_idle_id; /* event source id */
900 };
901
902 struct _ViewFileInfoIcon
903 {
904         /* table stuff */
905         gint columns;
906         gint rows;
907
908         GList *selection;
909         FileData *prev_selection;
910
911         GtkWidget *tip_window;
912         guint tip_delay_id; /* event source id */
913         FileData *tip_fd;
914
915         FileData *click_fd;
916
917         FileData *focus_fd;
918         gint focus_row;
919         gint focus_column;
920
921         gboolean show_text;
922 };
923
924 struct _SlideShowData
925 {
926         LayoutWindow *lw;        /* use this window to display the slideshow */
927         ImageWindow *imd;        /* use this window only if lw is not available,
928                                     FIXME: it is probably required only by img-view.c and should be dropped with it */
929
930         GList *filelist;
931         CollectionData *cd;
932         FileData *dir_fd;
933
934         GList *list;
935         GList *list_done;
936
937         FileData *slide_fd;
938
939         guint slide_count;
940         guint timeout_id; /* event source id */
941
942         gboolean from_selection;
943
944         void (*stop_func)(SlideShowData *, gpointer);
945         gpointer stop_data;
946
947         gboolean paused;
948 };
949
950 struct _FullScreenData
951 {
952         GtkWidget *window;
953         ImageWindow *imd;
954
955         GtkWidget *normal_window;
956         ImageWindow *normal_imd;
957
958         guint hide_mouse_id; /* event source id */
959         guint busy_mouse_id; /* event source id */
960
961         gint cursor_state;
962
963         guint saver_block_id; /* event source id */
964
965         void (*stop_func)(FullScreenData *, gpointer);
966         gpointer stop_data;
967
968         gboolean same_region; /* the returned region will overlap the current location of widget. */
969 };
970
971 struct _PixmapFolders
972 {
973         GdkPixbuf *close;
974         GdkPixbuf *open;
975         GdkPixbuf *deny;
976         GdkPixbuf *parent;
977 };
978
979 struct _SecureSaveInfo {
980         FILE *fp; /**< file stream pointer */
981         gchar *file_name; /**< final file name */
982         gchar *tmp_file_name; /**< temporary file name */
983         gint err; /**< set to non-zero value in case of error */
984         gboolean secure_save; /**< use secure save for this file, internal use only */
985         gboolean preserve_perms; /**< whether to preserve perms, TRUE by default */
986         gboolean preserve_mtime; /**< whether to preserve mtime, FALSE by default */
987         gboolean unlink_on_error; /**< whether to remove temporary file on save failure, TRUE by default */
988 };
989
990 struct _CommandLine
991 {
992         int argc;
993         gchar **argv;
994         gboolean startup_blank;
995         gboolean startup_full_screen;
996         gboolean startup_in_slideshow;
997         gboolean startup_command_line_collection;
998         gboolean tools_hide;
999         gboolean tools_show;
1000         gboolean log_window_show;
1001         gchar *path;
1002         gchar *file;
1003         GList *cmd_list;
1004         GList *collection_list;
1005         gchar *geometry;
1006         gchar *regexp;
1007         gchar *log_file;
1008         SecureSaveInfo *ssi;
1009 };
1010
1011 #endif
1012 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */