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