Mercurial > hg > forks > geeqie
annotate src/image.h @ 2801:3e9ca298bb1d
Fix #251: Crop simulation
Menu option to draw a rectangle.
Rectangle co-ordinates can be obtained with the remote command:
--remote --get-rectangle
author | Colin Clark <colin.clark@cclark.uk> |
---|---|
date | Fri, 20 Jul 2018 17:45:10 +0100 |
parents | 8bcdac2603d3 |
children |
rev | line source |
---|---|
1 | 1 /* |
2350
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2104
diff
changeset
|
2 * Copyright (C) 2004 John Ellis |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2104
diff
changeset
|
3 * Copyright (C) 2008 - 2016 The Geeqie Team |
1 | 4 * |
5 * Author: John Ellis | |
6 * | |
2350
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2104
diff
changeset
|
7 * This program is free software; you can redistribute it and/or modify |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2104
diff
changeset
|
8 * it under the terms of the GNU General Public License as published by |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2104
diff
changeset
|
9 * the Free Software Foundation; either version 2 of the License, or |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2104
diff
changeset
|
10 * (at your option) any later version. |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2104
diff
changeset
|
11 * |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2104
diff
changeset
|
12 * This program is distributed in the hope that it will be useful, |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2104
diff
changeset
|
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2104
diff
changeset
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2104
diff
changeset
|
15 * GNU General Public License for more details. |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2104
diff
changeset
|
16 * |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2104
diff
changeset
|
17 * You should have received a copy of the GNU General Public License along |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2104
diff
changeset
|
18 * with this program; if not, write to the Free Software Foundation, Inc., |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2104
diff
changeset
|
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
1 | 20 */ |
21 | |
9 | 22 #ifndef IMAGE_H |
23 #define IMAGE_H | |
3 | 24 |
25 | |
247 | 26 void image_set_frame(ImageWindow *imd, gboolean frame); |
1431
13c985b6e35e
More gboolean and tidy up.
Laurent Monin <geeqie@norz.org>
parents:
1284
diff
changeset
|
27 ImageWindow *image_new(gboolean frame); |
9 | 28 |
29 /* additional setup */ | |
30 void image_attach_window(ImageWindow *imd, GtkWidget *window, | |
1431
13c985b6e35e
More gboolean and tidy up.
Laurent Monin <geeqie@norz.org>
parents:
1284
diff
changeset
|
31 const gchar *title, const gchar *title_right, gboolean show_zoom); |
9 | 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, | |
868
b043dc777759
Reduce number of parameters (mostly unused), just pass the event pointer.
Laurent Monin <geeqie@norz.org>
parents:
821
diff
changeset
|
36 void (*func)(ImageWindow *, GdkEventButton *event, gpointer), |
9 | 37 gpointer data); |
128
0c318260b7f6
improved connected scroll and active image switching
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
127
diff
changeset
|
38 void image_set_drag_func(ImageWindow *imd, |
2452
8bcdac2603d3
Fix #473: Parameter type fix for "motion-notify-event" signal handlers
Colin Clark <cclark@mcb.net>
parents:
2440
diff
changeset
|
39 void (*func)(ImageWindow *, GdkEventMotion *event, gdouble dx, gdouble dy, gpointer), |
128
0c318260b7f6
improved connected scroll and active image switching
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
127
diff
changeset
|
40 gpointer data); |
9 | 41 void image_set_scroll_func(ImageWindow *imd, |
868
b043dc777759
Reduce number of parameters (mostly unused), just pass the event pointer.
Laurent Monin <geeqie@norz.org>
parents:
821
diff
changeset
|
42 void (*func)(ImageWindow *, GdkEventScroll *event, gpointer), |
442 | 43 gpointer data); |
1481
7757038ff080
active image follows keyboard focus
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1431
diff
changeset
|
44 void image_set_focus_in_func(ImageWindow *imd, |
7757038ff080
active image follows keyboard focus
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1431
diff
changeset
|
45 void (*func)(ImageWindow *, gpointer), |
7757038ff080
active image follows keyboard focus
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1431
diff
changeset
|
46 gpointer data); |
12
8e6d90233b6d
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
John Ellis <johne@verizon.net>
parents:
9
diff
changeset
|
47 void image_set_scroll_notify_func(ImageWindow *imd, |
8e6d90233b6d
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
John Ellis <johne@verizon.net>
parents:
9
diff
changeset
|
48 void (*func)(ImageWindow *imd, gint x, gint y, gint width, gint height, gpointer data), |
8e6d90233b6d
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
John Ellis <johne@verizon.net>
parents:
9
diff
changeset
|
49 gpointer data); |
9 | 50 void image_set_complete_func(ImageWindow *imd, |
117
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
113
diff
changeset
|
51 void (*func)(ImageWindow *imd, gint preload, gpointer data), |
9 | 52 gpointer data); |
117
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
113
diff
changeset
|
53 void image_set_state_func(ImageWindow *imd, |
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
113
diff
changeset
|
54 void (*func)(ImageWindow *imd, ImageState state, gpointer data), |
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
113
diff
changeset
|
55 gpointer data); |
9 | 56 |
127
996ccab9eab3
implemented split windows
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
117
diff
changeset
|
57 void image_select(ImageWindow *imd, gboolean select); |
174
cbbd0368670d
improved drawing of image frames
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
138
diff
changeset
|
58 void image_set_selectable(ImageWindow *imd, gboolean selectable); |
127
996ccab9eab3
implemented split windows
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
117
diff
changeset
|
59 |
1482
0fa0b9ba559c
fixed keyboard focus on start-up
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1481
diff
changeset
|
60 void image_grab_focus(ImageWindow *imd); |
9 | 61 /* path, name */ |
62 const gchar *image_get_path(ImageWindow *imd); | |
63 const gchar *image_get_name(ImageWindow *imd); | |
138
5be5d1c53016
replaced gchar* path with FileData *fd
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
131
diff
changeset
|
64 FileData *image_get_fd(ImageWindow *imd); |
9 | 65 |
66 /* merely changes path string, does not change the image! */ | |
138
5be5d1c53016
replaced gchar* path with FileData *fd
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
131
diff
changeset
|
67 void image_set_fd(ImageWindow *imd, FileData *fd); |
9 | 68 |
69 /* load a new image */ | |
138
5be5d1c53016
replaced gchar* path with FileData *fd
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
131
diff
changeset
|
70 void image_change_fd(ImageWindow *imd, FileData *fd, gdouble zoom); |
1431
13c985b6e35e
More gboolean and tidy up.
Laurent Monin <geeqie@norz.org>
parents:
1284
diff
changeset
|
71 void image_change_pixbuf(ImageWindow *imd, GdkPixbuf *pixbuf, gdouble zoom, gboolean lazy); |
9 | 72 void image_change_from_collection(ImageWindow *imd, CollectionData *cd, CollectInfo *info, gdouble zoom); |
73 CollectionData *image_get_collection(ImageWindow *imd, CollectInfo **info); | |
2099
cd445a64205f
implemented presentation mode
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2021
diff
changeset
|
74 void image_copy_from_image(ImageWindow *imd, ImageWindow *source); |
2104
f32b6969ac46
fixed typo that caused build failure
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
2099
diff
changeset
|
75 void image_move_from_image(ImageWindow *imd, ImageWindow *source); |
9 | 76 |
1431
13c985b6e35e
More gboolean and tidy up.
Laurent Monin <geeqie@norz.org>
parents:
1284
diff
changeset
|
77 gboolean image_get_image_size(ImageWindow *imd, gint *width, gint *height); |
23
9ff428db7772
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
John Ellis <johne@verizon.net>
parents:
13
diff
changeset
|
78 GdkPixbuf *image_get_pixbuf(ImageWindow *imd); |
9ff428db7772
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
John Ellis <johne@verizon.net>
parents:
13
diff
changeset
|
79 |
9 | 80 /* manipulation */ |
81 void image_area_changed(ImageWindow *imd, gint x, gint y, gint width, gint height); | |
82 void image_reload(ImageWindow *imd); | |
83 void image_scroll(ImageWindow *imd, gint x, gint y); | |
13
ba909f3b01d6
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
John Ellis <johne@verizon.net>
parents:
12
diff
changeset
|
84 void image_scroll_to_point(ImageWindow *imd, gint x, gint y, |
ba909f3b01d6
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
John Ellis <johne@verizon.net>
parents:
12
diff
changeset
|
85 gdouble x_align, gdouble y_align); |
131
d50f6061b37b
relative scroll is working; some cleanup
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
129
diff
changeset
|
86 void image_get_scroll_center(ImageWindow *imd, gdouble *x, gdouble *y); |
d50f6061b37b
relative scroll is working; some cleanup
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
129
diff
changeset
|
87 void image_set_scroll_center(ImageWindow *imd, gdouble x, gdouble y); |
2440
cb9f25cb54f3
Orientation commands and file selections
cclark <cclark@mcb.net>
parents:
2350
diff
changeset
|
88 void image_alter_orientation(ImageWindow *imd, FileData *fd, AlterType type); |
1566
df4da4647646
separated Orientation and Grayscale functions
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1549
diff
changeset
|
89 void image_set_desaturate(ImageWindow *imd, gboolean desaturate); |
df4da4647646
separated Orientation and Grayscale functions
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1549
diff
changeset
|
90 gboolean image_get_desaturate(ImageWindow *imd); |
9 | 91 |
92 /* zoom */ | |
93 void image_zoom_adjust(ImageWindow *imd, gdouble increment); | |
94 void image_zoom_adjust_at_point(ImageWindow *imd, gdouble increment, gint x, gint y); | |
12
8e6d90233b6d
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
John Ellis <johne@verizon.net>
parents:
9
diff
changeset
|
95 void image_zoom_set_limits(ImageWindow *imd, gdouble min, gdouble max); |
9 | 96 void image_zoom_set(ImageWindow *imd, gdouble zoom); |
1269 | 97 void image_zoom_set_fill_geometry(ImageWindow *imd, gboolean vertical); |
9 | 98 gdouble image_zoom_get(ImageWindow *imd); |
99 gdouble image_zoom_get_real(ImageWindow *imd); | |
100 gchar *image_zoom_get_as_text(ImageWindow *imd); | |
885
b561a43f7fb0
Use a specific enum for image.zoom_mode values (ZoomMode) and
Laurent Monin <geeqie@norz.org>
parents:
868
diff
changeset
|
101 gdouble image_zoom_get_default(ImageWindow *imd); |
9 | 102 |
1886
ba2f9ac17b54
change stereo mode from menu
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1802
diff
changeset
|
103 /* stereo */ |
ba2f9ac17b54
change stereo mode from menu
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1802
diff
changeset
|
104 gint image_stereo_get(ImageWindow *imd); |
ba2f9ac17b54
change stereo mode from menu
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1802
diff
changeset
|
105 void image_stereo_set(ImageWindow *imd, gint stereo_mode); |
ba2f9ac17b54
change stereo mode from menu
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1802
diff
changeset
|
106 void image_stereo_swap(ImageWindow *imd); |
ba2f9ac17b54
change stereo mode from menu
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1802
diff
changeset
|
107 |
1888
039d5c8864a0
type of source stereo image made adjustable from menu
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1886
diff
changeset
|
108 StereoPixbufData image_stereo_pixbuf_get(ImageWindow *imd); |
039d5c8864a0
type of source stereo image made adjustable from menu
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1886
diff
changeset
|
109 void image_stereo_pixbuf_set(ImageWindow *imd, StereoPixbufData stereo_mode); |
039d5c8864a0
type of source stereo image made adjustable from menu
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1886
diff
changeset
|
110 |
9 | 111 /* read ahead, pass NULL to cancel */ |
138
5be5d1c53016
replaced gchar* path with FileData *fd
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
131
diff
changeset
|
112 void image_prebuffer_set(ImageWindow *imd, FileData *fd); |
9 | 113 |
888
626822338b41
reload changed images
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
885
diff
changeset
|
114 /* auto refresh */ |
626822338b41
reload changed images
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
885
diff
changeset
|
115 void image_auto_refresh_enable(ImageWindow *imd, gboolean enable); |
9 | 116 |
117 /* allow top window to be resized ? */ | |
1431
13c985b6e35e
More gboolean and tidy up.
Laurent Monin <geeqie@norz.org>
parents:
1284
diff
changeset
|
118 void image_top_window_set_sync(ImageWindow *imd, gboolean allow_sync); |
9 | 119 |
120 /* background of image */ | |
121 void image_background_set_color(ImageWindow *imd, GdkColor *color); | |
1626
63527696d61c
Add an option to Image preferences to restrict custom border to fullscreen mode only. Bug 2798062.
Laurent Monin <geeqie@norz.org>
parents:
1566
diff
changeset
|
122 void image_background_set_color_from_options(ImageWindow *imd, gboolean fullscreen); |
9 | 123 |
113
f2109493004f
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
26
diff
changeset
|
124 /* color profiles */ |
f2109493004f
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
26
diff
changeset
|
125 void image_color_profile_set(ImageWindow *imd, |
1548
1bd57e730350
support X11 screen profile
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1482
diff
changeset
|
126 gint input_type, |
1431
13c985b6e35e
More gboolean and tidy up.
Laurent Monin <geeqie@norz.org>
parents:
1284
diff
changeset
|
127 gboolean use_image); |
13c985b6e35e
More gboolean and tidy up.
Laurent Monin <geeqie@norz.org>
parents:
1284
diff
changeset
|
128 gboolean image_color_profile_get(ImageWindow *imd, |
1548
1bd57e730350
support X11 screen profile
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1482
diff
changeset
|
129 gint *input_type, |
1431
13c985b6e35e
More gboolean and tidy up.
Laurent Monin <geeqie@norz.org>
parents:
1284
diff
changeset
|
130 gboolean *use_image); |
13c985b6e35e
More gboolean and tidy up.
Laurent Monin <geeqie@norz.org>
parents:
1284
diff
changeset
|
131 void image_color_profile_set_use(ImageWindow *imd, gboolean enable); |
13c985b6e35e
More gboolean and tidy up.
Laurent Monin <geeqie@norz.org>
parents:
1284
diff
changeset
|
132 gboolean image_color_profile_get_use(ImageWindow *imd); |
1549
83cc83702eb6
show color management status on statusbar
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1548
diff
changeset
|
133 gboolean image_color_profile_get_status(ImageWindow *imd, gchar **image_profile, gchar **screen_profile); |
113
f2109493004f
Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
26
diff
changeset
|
134 |
9 | 135 /* set delayed page flipping */ |
136 void image_set_delay_flip(ImageWindow *imd, gint delay); | |
137 | |
138 /* wallpaper util */ | |
1431
13c985b6e35e
More gboolean and tidy up.
Laurent Monin <geeqie@norz.org>
parents:
1284
diff
changeset
|
139 void image_to_root_window(ImageWindow *imd, gboolean scaled); |
9 | 140 |
141 | |
12
8e6d90233b6d
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
John Ellis <johne@verizon.net>
parents:
9
diff
changeset
|
142 |
8e6d90233b6d
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
John Ellis <johne@verizon.net>
parents:
9
diff
changeset
|
143 void image_set_image_as_tiles(ImageWindow *imd, gint width, gint height, |
8e6d90233b6d
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
John Ellis <johne@verizon.net>
parents:
9
diff
changeset
|
144 gint tile_width, gint tile_height, gint cache_size, |
8e6d90233b6d
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
John Ellis <johne@verizon.net>
parents:
9
diff
changeset
|
145 ImageTileRequestFunc func_tile_request, |
8e6d90233b6d
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
John Ellis <johne@verizon.net>
parents:
9
diff
changeset
|
146 ImageTileDisposeFunc func_tile_dispose, |
8e6d90233b6d
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
John Ellis <johne@verizon.net>
parents:
9
diff
changeset
|
147 gpointer data, |
8e6d90233b6d
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
John Ellis <johne@verizon.net>
parents:
9
diff
changeset
|
148 gdouble zoom); |
8e6d90233b6d
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
John Ellis <johne@verizon.net>
parents:
9
diff
changeset
|
149 |
26
f1fe26e637e9
Mon Mar 28 20:23:34 2005 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
150 /* reset default options */ |
f1fe26e637e9
Mon Mar 28 20:23:34 2005 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
151 void image_options_sync(void); |
f1fe26e637e9
Mon Mar 28 20:23:34 2005 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
152 |
2801
3e9ca298bb1d
Fix #251: Crop simulation
Colin Clark <colin.clark@cclark.uk>
parents:
2452
diff
changeset
|
153 void image_get_rectangle(gint *x1, gint *y1, gint *x2, gint *y2); |
12
8e6d90233b6d
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
John Ellis <johne@verizon.net>
parents:
9
diff
changeset
|
154 |
9 | 155 #endif |
1055
4bbdfab3c89a
Adding a vim modeline to all files - patch by Klaus Ethgen
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1045
diff
changeset
|
156 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ |