/*
- * Geeqie
- * (C) 2006 John Ellis
- * Copyright (C) 2008 - 2009 The Geeqie Team
+ * Copyright (C) 2006 John Ellis
+ * Copyright (C) 2008 - 2016 The Geeqie Team
*
* Author: John Ellis
*
- * This software is released under the GNU General Public License (GNU GPL).
- * Please read the included file COPYING for more information.
- * This software comes with no warranty of any kind, use at your own risk!
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-
#ifndef TYPEDEFS_H
#define TYPEDEFS_H
typedef enum {
DIRVIEW_LIST,
- DIRVIEW_TREE
+ DIRVIEW_TREE,
+
+ // Keep this up to date!
+ DIRVIEW_LAST = DIRVIEW_TREE
} DirViewType;
typedef enum {
FILEVIEW_LIST,
- FILEVIEW_ICON
+ FILEVIEW_ICON,
+
+ // Keep this up to date!
+ FILEVIEW_LAST = FILEVIEW_ICON
} FileViewType;
#define CMD_COPY "geeqie-copy-command.desktop"
SORT_NAME,
SORT_SIZE,
SORT_TIME,
+ SORT_CTIME,
SORT_PATH,
- SORT_NUMBER
+ SORT_NUMBER,
+ SORT_EXIFTIME,
+ SORT_RATING
} SortType;
typedef enum {
ALTER_ROTATE_180,
ALTER_MIRROR,
ALTER_FLIP,
- ALTER_DESATURATE
} AlterType;
typedef enum {
NOTIFY_PRIORITY_MEDIUM,
NOTIFY_PRIORITY_LOW
} NotifyPriority;
-
+
typedef enum {
NOTIFY_MARKS = 1 << 1, /* changed marks */
NOTIFY_PIXBUF = 1 << 2, /* image was read into fd->pixbuf */
CHANGE_WARN_NO_WRITE_PERM = 1 << 1,
CHANGE_WARN_SAME = 1 << 2,
CHANGE_WARN_CHANGED_EXT = 1 << 3,
- CHANGE_ERROR_MASK = (~0) << 4, /* the values below are fatal errors */
- CHANGE_NO_READ_PERM = 1 << 4,
- CHANGE_NO_WRITE_PERM_DIR = 1 << 5,
- CHANGE_NO_DEST_DIR = 1 << 6,
- CHANGE_NO_WRITE_PERM_DEST_DIR = 1 << 7,
- CHANGE_NO_WRITE_PERM_DEST = 1 << 8,
- CHANGE_DEST_EXISTS = 1 << 9,
- CHANGE_NO_SRC = 1 << 10,
+ CHANGE_WARN_UNSAVED_META = 1 << 4,
+ CHANGE_WARN_NO_WRITE_PERM_DEST_DIR = 1 << 5,
+ CHANGE_ERROR_MASK = (~0U) << 8, /* the values below are fatal errors */
+ CHANGE_NO_READ_PERM = 1 << 8,
+ CHANGE_NO_WRITE_PERM_DIR = 1 << 9,
+ CHANGE_NO_DEST_DIR = 1 << 10,
+ CHANGE_DUPLICATE_DEST = 1 << 11,
+ CHANGE_NO_WRITE_PERM_DEST = 1 << 12,
+ CHANGE_DEST_EXISTS = 1 << 13,
+ CHANGE_NO_SRC = 1 << 14,
CHANGE_GENERIC_ERROR = 1 << 16
} ChangeError;
METADATA_FORMATTED = 1 /* for display only */
} MetadataFormat;
+typedef enum {
+ STARTUP_PATH_CURRENT = 0,
+ STARTUP_PATH_LAST,
+ STARTUP_PATH_HOME,
+} StartUpPath;
+
+typedef enum {
+ TOOLBAR_MAIN,
+ TOOLBAR_STATUS,
+ TOOLBAR_COUNT
+} ToolbarType;
+
+typedef enum {
+ PR_STEREO_NONE = 0, /* do nothing */
+ PR_STEREO_DUAL = 1 << 0, /* independent stereo buffers, for example nvidia opengl */
+ PR_STEREO_FIXED = 1 << 1, /* custom position */
+ PR_STEREO_HORIZ = 1 << 2, /* side by side */
+ PR_STEREO_VERT = 1 << 3, /* above below */
+ PR_STEREO_RIGHT = 1 << 4, /* render right buffer */
+ PR_STEREO_ANAGLYPH_RC = 1 << 5, /* anaglyph red-cyan */
+ PR_STEREO_ANAGLYPH_GM = 1 << 6, /* anaglyph green-magenta */
+ PR_STEREO_ANAGLYPH_YB = 1 << 7, /* anaglyph yellow-blue */
+ PR_STEREO_ANAGLYPH_GRAY_RC = 1 << 8, /* anaglyph gray red-cyan*/
+ PR_STEREO_ANAGLYPH_GRAY_GM = 1 << 9, /* anaglyph gray green-magenta */
+ PR_STEREO_ANAGLYPH_GRAY_YB = 1 << 10, /* anaglyph gray yellow-blue */
+ PR_STEREO_ANAGLYPH_DB_RC = 1 << 11, /* anaglyph dubois red-cyan */
+ PR_STEREO_ANAGLYPH_DB_GM = 1 << 12, /* anaglyph dubois green-magenta */
+ PR_STEREO_ANAGLYPH_DB_YB = 1 << 13, /* anaglyph dubois yellow-blue */
+ PR_STEREO_ANAGLYPH = PR_STEREO_ANAGLYPH_RC |
+ PR_STEREO_ANAGLYPH_GM |
+ PR_STEREO_ANAGLYPH_YB |
+ PR_STEREO_ANAGLYPH_GRAY_RC |
+ PR_STEREO_ANAGLYPH_GRAY_GM |
+ PR_STEREO_ANAGLYPH_GRAY_YB |
+ PR_STEREO_ANAGLYPH_DB_RC |
+ PR_STEREO_ANAGLYPH_DB_GM |
+ PR_STEREO_ANAGLYPH_DB_YB, /* anaglyph mask */
+
+ PR_STEREO_MIRROR_LEFT = 1 << 14, /* mirror */
+ PR_STEREO_FLIP_LEFT = 1 << 15, /* flip */
+
+ PR_STEREO_MIRROR_RIGHT = 1 << 16, /* mirror */
+ PR_STEREO_FLIP_RIGHT = 1 << 17, /* flip */
+
+ PR_STEREO_MIRROR = PR_STEREO_MIRROR_LEFT | PR_STEREO_MIRROR_RIGHT, /* mirror mask*/
+ PR_STEREO_FLIP = PR_STEREO_FLIP_LEFT | PR_STEREO_FLIP_RIGHT, /* flip mask*/
+ PR_STEREO_SWAP = 1 << 18, /* swap left and right buffers */
+ PR_STEREO_TEMP_DISABLE = 1 << 19, /* temporarily disable stereo mode if source image is not stereo */
+ PR_STEREO_HALF = 1 << 20
+} PixbufRendererStereoMode;
+
+typedef enum {
+ STEREO_PIXBUF_DEFAULT = 0,
+ STEREO_PIXBUF_SBS = 1,
+ STEREO_PIXBUF_CROSS = 2,
+ STEREO_PIXBUF_NONE = 3
+} StereoPixbufData;
#define MAX_SPLIT_IMAGES 4
typedef struct _ImageLoader ImageLoader;
typedef struct _ThumbLoader ThumbLoader;
+typedef struct _AnimationData AnimationData;
+
typedef struct _CollectInfo CollectInfo;
typedef struct _CollectionData CollectionData;
typedef struct _CollectTable CollectTable;
gpointer data;
- gint idle_done_id;
+ guint idle_done_id; /* event source id */
+};
+
+struct _AnimationData
+{
+ ImageWindow *iw;
+ GdkPixbufAnimation *gpa;
+ GdkPixbufAnimationIter *iter;
+ GdkPixbuf *gpb;
+ FileData *data_adr;
+ guint delay;
+ gboolean valid;
};
struct _CollectInfo
CollectInfo *click_info;
GtkWidget *tip_window;
- gint tip_delay_id;
+ guint tip_delay_id; /* event source id */
CollectInfo *tip_info;
GdkWindow *marker_window;
CollectInfo *drop_info;
GList *drop_list;
- gint sync_idle_id;
- gint drop_idle_id;
+ guint sync_idle_id; /* event source id */
+ guint drop_idle_id; /* event source id */
gboolean show_text;
/* button, scroll functions */
void (*func_button)(ImageWindow *, GdkEventButton *event, gpointer);
- void (*func_drag)(ImageWindow *, GdkEventButton *event, gdouble dx, gdouble dy, gpointer);
+ void (*func_drag)(ImageWindow *, GdkEventMotion *event, gdouble dx, gdouble dy, gpointer);
void (*func_scroll)(ImageWindow *, GdkEventScroll *event, gpointer);
+ void (*func_focus_in)(ImageWindow *, gpointer);
gpointer data_button;
gpointer data_drag;
gpointer data_scroll;
+ gpointer data_focus_in;
/* scroll notification (for scroll bar implementation) */
void (*func_scroll_notify)(ImageWindow *, gint x, gint y, gint width, gint height, gpointer);
/* color profiles */
gboolean color_profile_enable;
gint color_profile_input;
- gint color_profile_screen;
gboolean color_profile_use_image;
gint color_profile_from_image;
gpointer cm;
gboolean delay_flip;
gint orientation;
gboolean desaturate;
+ gint user_stereo;
- gboolean overlay_show_zoom; /* set to true if overlay is showing zoom ratio */
+ gboolean mouse_wheel_mode;
};
#define FILEDATA_MARKS_SIZE 6
gchar *source;
gchar *dest;
gint error;
+ gboolean regroup_when_finished;
};
struct _FileData {
- gint magick;
+ guint magick;
gint type;
gchar *original_path; /* key to file_data_pool hash table */
gchar *path;
const gchar *name;
const gchar *extension;
+ gchar *extended_extension;
gchar *collate_key_name;
gchar *collate_key_name_nocase;
gint64 size;
time_t date;
+ time_t cdate;
mode_t mode; /* this is needed at least for notification in view_dir because it is preserved after the file/directory is deleted */
-
+ gint sidecar_priority;
+
guint marks; /* each bit represents one mark */
guint valid_marks; /* zero bit means that the corresponding mark needs to be reread */
GdkPixbuf *pixbuf; /* full-size image, only complete images, NULL during loading
all FileData with non-NULL pixbuf are referenced by image_cache */
-
+
HistMap *histmap;
+ gboolean locked;
gint ref;
gint version; /* increased when any field in this structure is changed */
- gint disable_grouping;
+ gboolean disable_grouping;
gint user_orientation;
gint exif_orientation;
-
+
ExifData *exif;
+ time_t exifdate;
GHashTable *modified_xmp; // hash table which contains unwritten xmp metadata in format: key->list of string values
+ GList *cached_metadata;
+ gint rating;
};
struct _LayoutOptions
{
+ gchar *id;
+
gchar *order;
gint style;
gboolean show_thumbnails;
gboolean show_marks;
gboolean show_directory_date;
+ gboolean show_info_pixel;
struct {
gint w;
gint vdivider_pos;
} float_window;
+ struct {
+ gint vdivider_pos;
+ } folder_window;
+
struct {
gint w;
gint h;
gboolean tools_float;
gboolean tools_hidden;
gboolean toolbar_hidden;
- gboolean info_pixel_hidden;
+
+ struct {
+ gboolean info;
+ gboolean sort;
+ gboolean tools_float;
+ gboolean tools_hidden;
+ gboolean hidden;
+ } bars_state;
gchar *home_path;
+ gchar *last_path;
+
+ StartUpPath startup_path;
+
+ gboolean exit_on_close;
+
+ gboolean animate;
};
struct _LayoutWindow
/* menus, path selector */
GtkActionGroup *action_group;
- GtkActionGroup *action_group_external;
+ GtkActionGroup *action_group_editors;
+ guint ui_editors_id;
GtkUIManager *ui_manager;
- guint toolbar_merge_id;
- GList *toolbar_actions;
+ GList *toolbar_actions[TOOLBAR_COUNT];
GtkWidget *path_entry;
// gint tools_float;
// gint tools_hidden;
+ GtkWidget *menu_bar; /* referenced by lw, exist during whole lw lifetime */
/* toolbar */
- GtkWidget *toolbar;
+ GtkWidget *toolbar[TOOLBAR_COUNT]; /* referenced by lw, exist during whole lw lifetime */
// gint toolbar_hidden;
// GtkWidget *thumb_button;
GtkWidget *file_view;
SortType sort_method;
- gint sort_ascend;
+ gboolean sort_ascend;
/* status bar */
GtkWidget *info_box;
GtkWidget *info_progress_bar;
GtkWidget *info_sort;
- GtkWidget *info_color;
GtkWidget *info_status;
GtkWidget *info_details;
GtkWidget *info_zoom;
- GtkWidget *info_write;
GtkWidget *info_pixel;
-
+
/* slide show */
SlideShowData *slideshow;
/* misc */
- GtkWidget *utility_box;
+ GtkWidget *utility_box; /* referenced by lw, exist during whole lw lifetime */
GtkWidget *utility_paned; /* between image and bar */
GtkWidget *bar_sort;
GtkWidget *bar;
GtkWidget *exif_window;
- /* file list for edit menu */
- GList *editmenu_fd_list;
+ AnimationData *animation;
};
struct _ViewDir
FileData *drop_fd;
GList *drop_list;
- gint drop_scroll_id;
+ guint drop_scroll_id; /* event source id */
/* func list */
- void (*select_func)(ViewDir *vd, const gchar *path, gpointer data);
+ void (*select_func)(ViewDir *vd, FileData *fd, gpointer data);
gpointer select_data;
void (*dnd_drop_update_func)(ViewDir *vd);
struct _ViewDirInfoTree
{
- gint drop_expand_id;
+ guint drop_expand_id; /* event source id */
gint busy_ref;
};
GList *list;
SortType sort_method;
- gint sort_ascend;
+ gboolean sort_ascend;
/* func list */
void (*func_thumb_status)(ViewFile *vf, gdouble val, const gchar *text, gpointer data);
GtkWidget *popup;
/* thumbs updates*/
- gint thumbs_running;
+ gboolean thumbs_running;
ThumbLoader *thumbs_loader;
FileData *thumbs_filedata;
/* marks */
- gint marks_enabled;
+ gboolean marks_enabled;
gint active_mark;
gint clicked_mark;
-
+
/* refresh */
- gint refresh_idle_id;
+ guint refresh_idle_id; /* event source id */
+ time_t time_refresh_set; /* time when refresh_idle_id was set */
/* file list for edit menu */
GList *editmenu_fd_list;
FileData *click_fd;
FileData *select_fd;
- gint thumbs_enabled;
+ gboolean thumbs_enabled;
- gint select_idle_id;
+ guint select_idle_id; /* event source id */
};
-struct _IconData;
+typedef enum {
+ SELECTION_NONE = 0,
+ SELECTION_SELECTED = 1 << 0,
+ SELECTION_PRELIGHT = 1 << 1,
+ SELECTION_FOCUS = 1 << 2
+} SelectionType;
+
+typedef struct _IconData IconData;
+struct _IconData
+{
+ SelectionType selected;
+ FileData *fd;
+};
struct _ViewFileInfoIcon
{
struct _IconData *prev_selection;
GtkWidget *tip_window;
- gint tip_delay_id;
+ guint tip_delay_id; /* event source id */
struct _IconData *tip_id;
struct _IconData *click_id;
gint focus_row;
gint focus_column;
- gint show_text;
+ gboolean show_text;
};
struct _SlideShowData
{
- ImageWindow *imd;
+ LayoutWindow *lw; /* use this window to display the slideshow */
+ ImageWindow *imd; /* use this window only if lw is not available,
+ FIXME: it is probably required only by img-view.c and should be dropped with it */
GList *filelist;
CollectionData *cd;
FileData *dir_fd;
- LayoutWindow *layout;
GList *list;
GList *list_done;
FileData *slide_fd;
guint slide_count;
- gint timeout_id;
+ guint timeout_id; /* event source id */
- gint from_selection;
+ gboolean from_selection;
void (*stop_func)(SlideShowData *, gpointer);
gpointer stop_data;
GtkWidget *normal_window;
ImageWindow *normal_imd;
- gint hide_mouse_id;
- gint busy_mouse_id;
+ guint hide_mouse_id; /* event source id */
+ guint busy_mouse_id; /* event source id */
+
gint cursor_state;
- gint saver_block_id;
+ guint saver_block_id; /* event source id */
void (*stop_func)(FullScreenData *, gpointer);
gpointer stop_data;
+
+ gboolean same_region; /* the returned region will overlap the current location of widget. */
};
struct _PixmapFolders