##### Note: GQview CVS on sourceforge is not always up to date, please use #####
[geeqie.git] / src / image.h
1 /*
2  * GQview
3  * (C) 2004 John Ellis
4  *
5  * Author: John Ellis
6  *
7  * This software is released under the GNU General Public License (GNU GPL).
8  * Please read the included file COPYING for more information.
9  * This software comes with no warranty of any kind, use at your own risk!
10  */
11
12
13 #ifndef IMAGE_H
14 #define IMAGE_H
15
16
17 ImageWindow *image_new(gint frame);
18
19 /* additional setup */
20 void image_attach_window(ImageWindow *imd, GtkWidget *window,
21                          const gchar *title, const gchar *title_right, gint show_zoom);
22 void image_set_update_func(ImageWindow *imd,
23                            void (*func)(ImageWindow *imd, gpointer data),
24                            gpointer data);
25 void image_set_button_func(ImageWindow *imd,
26         void (*func)(ImageWindow *, gint button, guint32 time, gdouble x, gdouble y, guint state, gpointer),
27         gpointer data);
28 void image_set_scroll_func(ImageWindow *imd,
29         void (*func)(ImageWindow *, GdkScrollDirection direction, guint32 time, gdouble x, gdouble y, guint state, gpointer),
30         gpointer data);
31 void image_set_scroll_notify_func(ImageWindow *imd,
32                                   void (*func)(ImageWindow *imd, gint x, gint y, gint width, gint height, gpointer data),
33                                   gpointer data);
34 void image_set_complete_func(ImageWindow *imd,
35                              void (*func)(ImageWindow *, gint preload, gpointer),
36                              gpointer data);
37 void image_set_new_func(ImageWindow *imd,
38                         void (*func)(ImageWindow *, gpointer),
39                         gpointer data);
40
41 /* path, name */
42 const gchar *image_get_path(ImageWindow *imd);
43 const gchar *image_get_name(ImageWindow *imd);
44
45 /* merely changes path string, does not change the image! */
46 void image_set_path(ImageWindow *imd, const gchar *newpath);
47
48 /* load a new image */
49 void image_change_path(ImageWindow *imd, const gchar *path, gdouble zoom);
50 void image_change_pixbuf(ImageWindow *imd, GdkPixbuf *pixbuf, gdouble zoom);
51 void image_change_from_collection(ImageWindow *imd, CollectionData *cd, CollectInfo *info, gdouble zoom);
52 CollectionData *image_get_collection(ImageWindow *imd, CollectInfo **info);
53 void image_change_from_image(ImageWindow *imd, ImageWindow *source);
54
55 GdkPixbuf *image_get_pixbuf(ImageWindow *imd);
56
57 /* manipulation */
58 void image_area_changed(ImageWindow *imd, gint x, gint y, gint width, gint height);
59 void image_reload(ImageWindow *imd);
60 void image_scroll(ImageWindow *imd, gint x, gint y);
61 void image_scroll_to_point(ImageWindow *imd, gint x, gint y,
62                            gdouble x_align, gdouble y_align);
63 void image_alter(ImageWindow *imd, AlterType type);
64
65 /* zoom */
66 void image_zoom_adjust(ImageWindow *imd, gdouble increment);
67 void image_zoom_adjust_at_point(ImageWindow *imd, gdouble increment, gint x, gint y);
68 void image_zoom_set_limits(ImageWindow *imd, gdouble min, gdouble max);
69 void image_zoom_set(ImageWindow *imd, gdouble zoom);
70 void image_zoom_set_fill_geometry(ImageWindow *imd, gint vertical);
71 gdouble image_zoom_get(ImageWindow *imd);
72 gdouble image_zoom_get_real(ImageWindow *imd);
73 gchar *image_zoom_get_as_text(ImageWindow *imd);
74 gdouble image_zoom_get_default(ImageWindow *imd, gint mode);
75
76 /* read ahead, pass NULL to cancel */
77 void image_prebuffer_set(ImageWindow *imd, const gchar *path);
78
79 /* auto refresh, interval is 1/1000 sec, 0 uses default, -1 disables */
80 void image_auto_refresh(ImageWindow *imd, gint interval);
81
82 /* allow top window to be resized ? */
83 void image_top_window_set_sync(ImageWindow *imd, gint allow_sync);
84
85 /* background of image */
86 void image_background_set_black(ImageWindow *imd, gint black);
87 void image_background_set_color(ImageWindow *imd, GdkColor *color);
88
89 /* set delayed page flipping */
90 void image_set_delay_flip(ImageWindow *imd, gint delay);
91
92 /* wallpaper util */
93 void image_to_root_window(ImageWindow *imd, gint scaled);
94
95 /* overlays */
96 gint image_overlay_add(ImageWindow *imd, GdkPixbuf *pixbuf, gint x, gint y,
97                        gint relative, gint always);
98 void image_overlay_set(ImageWindow *imd, gint id, GdkPixbuf *pixbuf, gint x, gint y);
99 gint image_overlay_get(ImageWindow *imd, gint id, GdkPixbuf **pixbuf, gint *x, gint *y);
100 void image_overlay_remove(ImageWindow *imd, gint id);
101
102
103
104 void image_set_image_as_tiles(ImageWindow *imd, gint width, gint height,
105                               gint tile_width, gint tile_height, gint cache_size,
106                               ImageTileRequestFunc func_tile_request,
107                               ImageTileDisposeFunc func_tile_dispose,
108                               gpointer data,
109                               gdouble zoom);
110
111
112 #endif
113
114
115