Simplify vflist_get_formatted()
[geeqie.git] / src / image.h
1 /*
2  * Copyright (C) 2004 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 IMAGE_H
23 #define IMAGE_H
24
25
26 void image_set_frame(ImageWindow *imd, gboolean frame);
27 ImageWindow *image_new(gboolean frame);
28
29 /* additional setup */
30 void image_attach_window(ImageWindow *imd, GtkWidget *window,
31                          const gchar *title, const gchar *title_right, gboolean show_zoom);
32 void image_set_update_func(ImageWindow *imd,
33                            void (*func)(ImageWindow *imd, gpointer data),
34                            gpointer data);
35 void image_set_button_func(ImageWindow *imd,
36         void (*func)(ImageWindow *, GdkEventButton *event, gpointer),
37         gpointer data);
38 void image_set_drag_func(ImageWindow *imd,
39         void (*func)(ImageWindow *, GdkEventMotion *event, gdouble dx, gdouble dy, gpointer),
40         gpointer data);
41 void image_set_scroll_func(ImageWindow *imd,
42         void (*func)(ImageWindow *, GdkEventScroll *event, gpointer),
43         gpointer data);
44 void image_set_focus_in_func(ImageWindow *imd,
45         void (*func)(ImageWindow *, gpointer),
46         gpointer data);
47 void image_set_scroll_notify_func(ImageWindow *imd,
48                                   void (*func)(ImageWindow *imd, gint x, gint y, gint width, gint height, gpointer data),
49                                   gpointer data);
50 void image_set_complete_func(ImageWindow *imd,
51                              void (*func)(ImageWindow *imd, gint preload, gpointer data),
52                              gpointer data);
53 void image_set_state_func(ImageWindow *imd,
54                           void (*func)(ImageWindow *imd, ImageState state, gpointer data),
55                           gpointer data);
56
57 void image_select(ImageWindow *imd, gboolean select);
58 void image_set_selectable(ImageWindow *imd, gboolean selectable);
59
60 void image_grab_focus(ImageWindow *imd);
61 /* path, name */
62 const gchar *image_get_path(ImageWindow *imd);
63 const gchar *image_get_name(ImageWindow *imd);
64 FileData *image_get_fd(ImageWindow *imd);
65
66 /**
67  * @headerfile image_set_fd
68  * merely changes path string, does not change the image!
69  */
70 void image_set_fd(ImageWindow *imd, FileData *fd);
71
72 /* load a new image */
73 void image_change_fd(ImageWindow *imd, FileData *fd, gdouble zoom);
74 void image_change_pixbuf(ImageWindow *imd, GdkPixbuf *pixbuf, gdouble zoom, gboolean lazy);
75 void image_change_from_collection(ImageWindow *imd, CollectionData *cd, CollectInfo *info, gdouble zoom);
76 CollectionData *image_get_collection(ImageWindow *imd, CollectInfo **info);
77 void image_copy_from_image(ImageWindow *imd, ImageWindow *source);
78 void image_move_from_image(ImageWindow *imd, ImageWindow *source);
79
80 gboolean image_get_image_size(ImageWindow *imd, gint *width, gint *height);
81 GdkPixbuf *image_get_pixbuf(ImageWindow *imd);
82
83 /* manipulation */
84 void image_area_changed(ImageWindow *imd, gint x, gint y, gint width, gint height);
85 void image_reload(ImageWindow *imd);
86 void image_scroll(ImageWindow *imd, gint x, gint y);
87 void image_scroll_to_point(ImageWindow *imd, gint x, gint y,
88                            gdouble x_align, gdouble y_align);
89 void image_get_scroll_center(ImageWindow *imd, gdouble *x, gdouble *y);
90 void image_set_scroll_center(ImageWindow *imd, gdouble x, gdouble y);
91 void image_alter_orientation(ImageWindow *imd, FileData *fd, AlterType type);
92 void image_set_desaturate(ImageWindow *imd, gboolean desaturate);
93 gboolean image_get_desaturate(ImageWindow *imd);
94 void image_set_overunderexposed(ImageWindow *imd, gboolean overunderexposed);
95 gboolean image_get_overunderexposed(ImageWindow *imd);
96 void image_set_ignore_alpha(ImageWindow *imd, gboolean ignore_alpha);
97
98 /* zoom */
99 void image_zoom_adjust(ImageWindow *imd, gdouble increment);
100 void image_zoom_adjust_at_point(ImageWindow *imd, gdouble increment, gint x, gint y);
101 void image_zoom_set_limits(ImageWindow *imd, gdouble min, gdouble max);
102 void image_zoom_set(ImageWindow *imd, gdouble zoom);
103 void image_zoom_set_fill_geometry(ImageWindow *imd, gboolean vertical);
104 gdouble image_zoom_get(ImageWindow *imd);
105 gdouble image_zoom_get_real(ImageWindow *imd);
106 gchar *image_zoom_get_as_text(ImageWindow *imd);
107 gdouble image_zoom_get_default(ImageWindow *imd);
108
109 /* stereo */
110 gint image_stereo_get(ImageWindow *imd);
111 void image_stereo_set(ImageWindow *imd, gint stereo_mode);
112 void image_stereo_swap(ImageWindow *imd);
113
114 StereoPixbufData image_stereo_pixbuf_get(ImageWindow *imd);
115 void image_stereo_pixbuf_set(ImageWindow *imd, StereoPixbufData stereo_mode);
116
117 /**
118  * @headerfile image_prebuffer_set
119  * read ahead, pass NULL to cancel
120  */
121 void image_prebuffer_set(ImageWindow *imd, FileData *fd);
122
123 /**
124  * @headerfile image_auto_refresh_enable
125  * auto refresh
126  */
127 void image_auto_refresh_enable(ImageWindow *imd, gboolean enable);
128
129 /**
130  * @headerfile image_top_window_set_sync
131  * allow top window to be resized ?
132  */
133 void image_top_window_set_sync(ImageWindow *imd, gboolean allow_sync);
134
135 /* background of image */
136 void image_background_set_color(ImageWindow *imd, GdkColor *color);
137 void image_background_set_color_from_options(ImageWindow *imd, gboolean fullscreen);
138
139 /* color profiles */
140 void image_color_profile_set(ImageWindow *imd,
141                              gint input_type,
142                              gboolean use_image);
143 gboolean image_color_profile_get(ImageWindow *imd,
144                              gint *input_type,
145                              gboolean *use_image);
146 void image_color_profile_set_use(ImageWindow *imd, gboolean enable);
147 gboolean image_color_profile_get_use(ImageWindow *imd);
148 gboolean image_color_profile_get_status(ImageWindow *imd, gchar **image_profile, gchar **screen_profile);
149
150 /**
151  * @headerfile image_set_delay_flip
152  * set delayed page flipping
153  */
154 void image_set_delay_flip(ImageWindow *imd, gint delay);
155
156 /**
157  * @headerfile image_to_root_window
158  * wallpaper util
159  */
160 void image_to_root_window(ImageWindow *imd, gboolean scaled);
161
162
163
164 void image_set_image_as_tiles(ImageWindow *imd, gint width, gint height,
165                               gint tile_width, gint tile_height, gint cache_size,
166                               ImageTileRequestFunc func_tile_request,
167                               ImageTileDisposeFunc func_tile_dispose,
168                               gpointer data,
169                               gdouble zoom);
170
171 /**
172  * @headerfile image_options_sync
173  * reset default options
174  */
175 void image_options_sync(void);
176
177 void image_get_rectangle(gint *x1, gint *y1, gint *x2, gint *y2);
178 void image_update_title(ImageWindow *imd);
179 #endif
180 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */