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