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