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