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