Mercurial > geeqie
annotate src/image-overlay.c @ 1432:cf4029d10d38
improved notification system
author | nadvornik |
---|---|
date | Sat, 14 Mar 2009 17:21:35 +0000 |
parents | fe4da037be21 |
children | b4ad1d201279 |
rev | line source |
---|---|
9 | 1 /* |
196 | 2 * Geeqie |
117
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
3 * (C) 2006 John Ellis |
1284 | 4 * Copyright (C) 2008 - 2009 The Geeqie Team |
9 | 5 * |
6 * Author: John Ellis | |
7 * | |
8 * This software is released under the GNU General Public License (GNU GPL). | |
9 * Please read the included file COPYING for more information. | |
10 * This software comes with no warranty of any kind, use at your own risk! | |
11 */ | |
12 | |
281 | 13 #include "main.h" |
9 | 14 #include "image-overlay.h" |
15 | |
16 #include "collect.h" | |
218
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
216
diff
changeset
|
17 #include "exif.h" |
586 | 18 #include "filedata.h" |
622 | 19 #include "histogram.h" |
9 | 20 #include "image.h" |
21 #include "img-view.h" | |
22 #include "layout.h" | |
1178
f6449c17306b
Move comments/keywords read and write stuff to new metadata.{c,h}.
zas_
parents:
1177
diff
changeset
|
23 #include "metadata.h" |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
9
diff
changeset
|
24 #include "pixbuf-renderer.h" |
9 | 25 #include "pixbuf_util.h" |
622 | 26 #include "ui_fileops.h" |
1011 | 27 #include "image-load.h" |
9 | 28 |
29 /* | |
30 *---------------------------------------------------------------------------- | |
31 * image overlay | |
32 *---------------------------------------------------------------------------- | |
33 */ | |
34 | |
614 | 35 |
117
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
36 typedef struct _OverlayStateData OverlayStateData; |
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
37 struct _OverlayStateData { |
9 | 38 ImageWindow *imd; |
117
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
39 ImageState changed_states; |
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
40 |
616
d9c9d05c9d4d
Move overlay histogram stuff from ImageWindow to OverlayStateData.
zas_
parents:
615
diff
changeset
|
41 Histogram *histogram; |
d9c9d05c9d4d
Move overlay histogram stuff from ImageWindow to OverlayStateData.
zas_
parents:
615
diff
changeset
|
42 |
614 | 43 OsdShowFlags show; |
117
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
44 |
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
45 gint ovl_info; |
822
df541dc41707
Allow to set image overlay info position through options:
zas_
parents:
821
diff
changeset
|
46 |
df541dc41707
Allow to set image overlay info position through options:
zas_
parents:
821
diff
changeset
|
47 gint x; |
df541dc41707
Allow to set image overlay info position through options:
zas_
parents:
821
diff
changeset
|
48 gint y; |
118
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
49 |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
50 gint icon_time[IMAGE_OSD_COUNT]; |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
51 gint icon_id[IMAGE_OSD_COUNT]; |
117
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
52 |
9 | 53 gint idle_id; |
117
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
54 gint timer_id; |
9 | 55 gulong destroy_id; |
56 }; | |
57 | |
118
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
58 |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
59 typedef struct _OSDIcon OSDIcon; |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
60 struct _OSDIcon { |
122
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
61 gint reset; /* reset on new image */ |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
62 gint x; /* x, y offset */ |
118
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
63 gint y; |
122
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
64 gchar *key; /* inline pixbuf */ |
118
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
65 }; |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
66 |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
67 static OSDIcon osd_icons[] = { |
122
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
68 { TRUE, 0, 0, NULL }, /* none */ |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
69 { TRUE, -10, -10, NULL }, /* auto rotated */ |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
70 { TRUE, -10, -10, NULL }, /* user rotated */ |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
71 { TRUE, -40, -10, NULL }, /* color embedded */ |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
72 { TRUE, -70, -10, NULL }, /* first image */ |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
73 { TRUE, -70, -10, NULL }, /* last image */ |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
74 { FALSE, -70, -10, NULL }, /* osd enabled */ |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
75 { FALSE, 0, 0, NULL } |
118
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
76 }; |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
77 |
117
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
78 #define OSD_DATA "overlay-data" |
9 | 79 |
118
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
80 #define IMAGE_OSD_DEFAULT_DURATION 30 |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
81 |
290 | 82 #define HISTOGRAM_HEIGHT 140 |
620 | 83 #define HISTOGRAM_WIDTH 256 |
469
a05c72927e23
Rename few functions and replace fullscreen info with image overlay template string.
zas_
parents:
468
diff
changeset
|
84 |
481
67a612985686
Merge view_overlay_toggle() and layout_image_overlay_toggle() into new image_osd_toggle().
zas_
parents:
480
diff
changeset
|
85 static void image_osd_timer_schedule(OverlayStateData *osd); |
67a612985686
Merge view_overlay_toggle() and layout_image_overlay_toggle() into new image_osd_toggle().
zas_
parents:
480
diff
changeset
|
86 |
733
57f759d012c7
Modify set_default_image_overlay_template_string() to accept the pointer to
zas_
parents:
671
diff
changeset
|
87 void set_image_overlay_template_string(gchar **template_string, const gchar *value) |
469
a05c72927e23
Rename few functions and replace fullscreen info with image overlay template string.
zas_
parents:
468
diff
changeset
|
88 { |
733
57f759d012c7
Modify set_default_image_overlay_template_string() to accept the pointer to
zas_
parents:
671
diff
changeset
|
89 g_assert(template_string); |
57f759d012c7
Modify set_default_image_overlay_template_string() to accept the pointer to
zas_
parents:
671
diff
changeset
|
90 |
57f759d012c7
Modify set_default_image_overlay_template_string() to accept the pointer to
zas_
parents:
671
diff
changeset
|
91 g_free(*template_string); |
57f759d012c7
Modify set_default_image_overlay_template_string() to accept the pointer to
zas_
parents:
671
diff
changeset
|
92 *template_string = g_strdup(value); |
57f759d012c7
Modify set_default_image_overlay_template_string() to accept the pointer to
zas_
parents:
671
diff
changeset
|
93 } |
57f759d012c7
Modify set_default_image_overlay_template_string() to accept the pointer to
zas_
parents:
671
diff
changeset
|
94 |
57f759d012c7
Modify set_default_image_overlay_template_string() to accept the pointer to
zas_
parents:
671
diff
changeset
|
95 |
57f759d012c7
Modify set_default_image_overlay_template_string() to accept the pointer to
zas_
parents:
671
diff
changeset
|
96 void set_default_image_overlay_template_string(gchar **template_string) |
57f759d012c7
Modify set_default_image_overlay_template_string() to accept the pointer to
zas_
parents:
671
diff
changeset
|
97 { |
57f759d012c7
Modify set_default_image_overlay_template_string() to accept the pointer to
zas_
parents:
671
diff
changeset
|
98 set_image_overlay_template_string(template_string, DEFAULT_OVERLAY_INFO); |
469
a05c72927e23
Rename few functions and replace fullscreen info with image overlay template string.
zas_
parents:
468
diff
changeset
|
99 } |
a05c72927e23
Rename few functions and replace fullscreen info with image overlay template string.
zas_
parents:
468
diff
changeset
|
100 |
615
cddccc89d93b
Introduce image_get_osd_data() and image_set_osd_data().
zas_
parents:
614
diff
changeset
|
101 static OverlayStateData *image_get_osd_data(ImageWindow *imd) |
cddccc89d93b
Introduce image_get_osd_data() and image_set_osd_data().
zas_
parents:
614
diff
changeset
|
102 { |
cddccc89d93b
Introduce image_get_osd_data() and image_set_osd_data().
zas_
parents:
614
diff
changeset
|
103 OverlayStateData *osd; |
cddccc89d93b
Introduce image_get_osd_data() and image_set_osd_data().
zas_
parents:
614
diff
changeset
|
104 |
cddccc89d93b
Introduce image_get_osd_data() and image_set_osd_data().
zas_
parents:
614
diff
changeset
|
105 if (!imd) return NULL; |
cddccc89d93b
Introduce image_get_osd_data() and image_set_osd_data().
zas_
parents:
614
diff
changeset
|
106 |
cddccc89d93b
Introduce image_get_osd_data() and image_set_osd_data().
zas_
parents:
614
diff
changeset
|
107 g_assert(imd->pr); |
cddccc89d93b
Introduce image_get_osd_data() and image_set_osd_data().
zas_
parents:
614
diff
changeset
|
108 |
cddccc89d93b
Introduce image_get_osd_data() and image_set_osd_data().
zas_
parents:
614
diff
changeset
|
109 osd = g_object_get_data(G_OBJECT(imd->pr), "IMAGE_OVERLAY_DATA"); |
cddccc89d93b
Introduce image_get_osd_data() and image_set_osd_data().
zas_
parents:
614
diff
changeset
|
110 return osd; |
cddccc89d93b
Introduce image_get_osd_data() and image_set_osd_data().
zas_
parents:
614
diff
changeset
|
111 } |
cddccc89d93b
Introduce image_get_osd_data() and image_set_osd_data().
zas_
parents:
614
diff
changeset
|
112 |
cddccc89d93b
Introduce image_get_osd_data() and image_set_osd_data().
zas_
parents:
614
diff
changeset
|
113 static void image_set_osd_data(ImageWindow *imd, OverlayStateData *osd) |
cddccc89d93b
Introduce image_get_osd_data() and image_set_osd_data().
zas_
parents:
614
diff
changeset
|
114 { |
cddccc89d93b
Introduce image_get_osd_data() and image_set_osd_data().
zas_
parents:
614
diff
changeset
|
115 g_assert(imd); |
cddccc89d93b
Introduce image_get_osd_data() and image_set_osd_data().
zas_
parents:
614
diff
changeset
|
116 g_assert(imd->pr); |
cddccc89d93b
Introduce image_get_osd_data() and image_set_osd_data().
zas_
parents:
614
diff
changeset
|
117 g_object_set_data(G_OBJECT(imd->pr), "IMAGE_OVERLAY_DATA", osd); |
cddccc89d93b
Introduce image_get_osd_data() and image_set_osd_data().
zas_
parents:
614
diff
changeset
|
118 } |
cddccc89d93b
Introduce image_get_osd_data() and image_set_osd_data().
zas_
parents:
614
diff
changeset
|
119 |
273
e0e2c2b72c5a
reworked the histogram patch by Uwe Ohse, most of the code is in
nadvornik
parents:
265
diff
changeset
|
120 /* |
e0e2c2b72c5a
reworked the histogram patch by Uwe Ohse, most of the code is in
nadvornik
parents:
265
diff
changeset
|
121 *---------------------------------------------------------------------------- |
e0e2c2b72c5a
reworked the histogram patch by Uwe Ohse, most of the code is in
nadvornik
parents:
265
diff
changeset
|
122 * image histogram |
e0e2c2b72c5a
reworked the histogram patch by Uwe Ohse, most of the code is in
nadvornik
parents:
265
diff
changeset
|
123 *---------------------------------------------------------------------------- |
e0e2c2b72c5a
reworked the histogram patch by Uwe Ohse, most of the code is in
nadvornik
parents:
265
diff
changeset
|
124 */ |
e0e2c2b72c5a
reworked the histogram patch by Uwe Ohse, most of the code is in
nadvornik
parents:
265
diff
changeset
|
125 |
e0e2c2b72c5a
reworked the histogram patch by Uwe Ohse, most of the code is in
nadvornik
parents:
265
diff
changeset
|
126 |
e0e2c2b72c5a
reworked the histogram patch by Uwe Ohse, most of the code is in
nadvornik
parents:
265
diff
changeset
|
127 void image_osd_histogram_chan_toggle(ImageWindow *imd) |
e0e2c2b72c5a
reworked the histogram patch by Uwe Ohse, most of the code is in
nadvornik
parents:
265
diff
changeset
|
128 { |
616
d9c9d05c9d4d
Move overlay histogram stuff from ImageWindow to OverlayStateData.
zas_
parents:
615
diff
changeset
|
129 OverlayStateData *osd = image_get_osd_data(imd); |
613
d06f422a6673
image_osd_histogram_chan_toggle(), image_osd_histogram_log_toggle():
zas_
parents:
586
diff
changeset
|
130 |
616
d9c9d05c9d4d
Move overlay histogram stuff from ImageWindow to OverlayStateData.
zas_
parents:
615
diff
changeset
|
131 if (!osd || !osd->histogram) return; |
d9c9d05c9d4d
Move overlay histogram stuff from ImageWindow to OverlayStateData.
zas_
parents:
615
diff
changeset
|
132 |
1312
fcf0e7a6143e
Introduce helpers histogram_toggle_channel() and histogram_toggle_mode().
zas_
parents:
1302
diff
changeset
|
133 histogram_toggle_channel(osd->histogram); |
613
d06f422a6673
image_osd_histogram_chan_toggle(), image_osd_histogram_log_toggle():
zas_
parents:
586
diff
changeset
|
134 image_osd_update(imd); |
273
e0e2c2b72c5a
reworked the histogram patch by Uwe Ohse, most of the code is in
nadvornik
parents:
265
diff
changeset
|
135 } |
e0e2c2b72c5a
reworked the histogram patch by Uwe Ohse, most of the code is in
nadvornik
parents:
265
diff
changeset
|
136 |
e0e2c2b72c5a
reworked the histogram patch by Uwe Ohse, most of the code is in
nadvornik
parents:
265
diff
changeset
|
137 void image_osd_histogram_log_toggle(ImageWindow *imd) |
e0e2c2b72c5a
reworked the histogram patch by Uwe Ohse, most of the code is in
nadvornik
parents:
265
diff
changeset
|
138 { |
616
d9c9d05c9d4d
Move overlay histogram stuff from ImageWindow to OverlayStateData.
zas_
parents:
615
diff
changeset
|
139 OverlayStateData *osd = image_get_osd_data(imd); |
613
d06f422a6673
image_osd_histogram_chan_toggle(), image_osd_histogram_log_toggle():
zas_
parents:
586
diff
changeset
|
140 |
616
d9c9d05c9d4d
Move overlay histogram stuff from ImageWindow to OverlayStateData.
zas_
parents:
615
diff
changeset
|
141 if (!osd || !osd->histogram) return; |
d9c9d05c9d4d
Move overlay histogram stuff from ImageWindow to OverlayStateData.
zas_
parents:
615
diff
changeset
|
142 |
1312
fcf0e7a6143e
Introduce helpers histogram_toggle_channel() and histogram_toggle_mode().
zas_
parents:
1302
diff
changeset
|
143 histogram_toggle_mode(osd->histogram); |
613
d06f422a6673
image_osd_histogram_chan_toggle(), image_osd_histogram_log_toggle():
zas_
parents:
586
diff
changeset
|
144 image_osd_update(imd); |
273
e0e2c2b72c5a
reworked the histogram patch by Uwe Ohse, most of the code is in
nadvornik
parents:
265
diff
changeset
|
145 } |
e0e2c2b72c5a
reworked the histogram patch by Uwe Ohse, most of the code is in
nadvornik
parents:
265
diff
changeset
|
146 |
481
67a612985686
Merge view_overlay_toggle() and layout_image_overlay_toggle() into new image_osd_toggle().
zas_
parents:
480
diff
changeset
|
147 void image_osd_toggle(ImageWindow *imd) |
67a612985686
Merge view_overlay_toggle() and layout_image_overlay_toggle() into new image_osd_toggle().
zas_
parents:
480
diff
changeset
|
148 { |
616
d9c9d05c9d4d
Move overlay histogram stuff from ImageWindow to OverlayStateData.
zas_
parents:
615
diff
changeset
|
149 OverlayStateData *osd; |
503
e5023cced4e5
Fix image overlay displayed only on second "I" press in layout view.
zas_
parents:
483
diff
changeset
|
150 |
616
d9c9d05c9d4d
Move overlay histogram stuff from ImageWindow to OverlayStateData.
zas_
parents:
615
diff
changeset
|
151 if (!imd) return; |
d9c9d05c9d4d
Move overlay histogram stuff from ImageWindow to OverlayStateData.
zas_
parents:
615
diff
changeset
|
152 |
d9c9d05c9d4d
Move overlay histogram stuff from ImageWindow to OverlayStateData.
zas_
parents:
615
diff
changeset
|
153 osd = image_get_osd_data(imd); |
1336 | 154 if (osd->show == OSD_SHOW_NOTHING) |
481
67a612985686
Merge view_overlay_toggle() and layout_image_overlay_toggle() into new image_osd_toggle().
zas_
parents:
480
diff
changeset
|
155 { |
616
d9c9d05c9d4d
Move overlay histogram stuff from ImageWindow to OverlayStateData.
zas_
parents:
615
diff
changeset
|
156 image_osd_set(imd, OSD_SHOW_INFO | OSD_SHOW_STATUS); |
d9c9d05c9d4d
Move overlay histogram stuff from ImageWindow to OverlayStateData.
zas_
parents:
615
diff
changeset
|
157 return; |
d9c9d05c9d4d
Move overlay histogram stuff from ImageWindow to OverlayStateData.
zas_
parents:
615
diff
changeset
|
158 } |
1336 | 159 else |
616
d9c9d05c9d4d
Move overlay histogram stuff from ImageWindow to OverlayStateData.
zas_
parents:
615
diff
changeset
|
160 { |
d9c9d05c9d4d
Move overlay histogram stuff from ImageWindow to OverlayStateData.
zas_
parents:
615
diff
changeset
|
161 if (osd->show & OSD_SHOW_HISTOGRAM) |
481
67a612985686
Merge view_overlay_toggle() and layout_image_overlay_toggle() into new image_osd_toggle().
zas_
parents:
480
diff
changeset
|
162 { |
616
d9c9d05c9d4d
Move overlay histogram stuff from ImageWindow to OverlayStateData.
zas_
parents:
615
diff
changeset
|
163 image_osd_set(imd, OSD_SHOW_NOTHING); |
481
67a612985686
Merge view_overlay_toggle() and layout_image_overlay_toggle() into new image_osd_toggle().
zas_
parents:
480
diff
changeset
|
164 } |
67a612985686
Merge view_overlay_toggle() and layout_image_overlay_toggle() into new image_osd_toggle().
zas_
parents:
480
diff
changeset
|
165 else |
67a612985686
Merge view_overlay_toggle() and layout_image_overlay_toggle() into new image_osd_toggle().
zas_
parents:
480
diff
changeset
|
166 { |
616
d9c9d05c9d4d
Move overlay histogram stuff from ImageWindow to OverlayStateData.
zas_
parents:
615
diff
changeset
|
167 image_osd_set(imd, osd->show | OSD_SHOW_HISTOGRAM); |
481
67a612985686
Merge view_overlay_toggle() and layout_image_overlay_toggle() into new image_osd_toggle().
zas_
parents:
480
diff
changeset
|
168 } |
67a612985686
Merge view_overlay_toggle() and layout_image_overlay_toggle() into new image_osd_toggle().
zas_
parents:
480
diff
changeset
|
169 } |
67a612985686
Merge view_overlay_toggle() and layout_image_overlay_toggle() into new image_osd_toggle().
zas_
parents:
480
diff
changeset
|
170 } |
118
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
171 |
650
02e2c135ee0c
Keywords and comment can now be displayed in OSD info using %keywords% and %comment%.
zas_
parents:
622
diff
changeset
|
172 static gchar *keywords_to_string(FileData *fd) |
02e2c135ee0c
Keywords and comment can now be displayed in OSD info using %keywords% and %comment%.
zas_
parents:
622
diff
changeset
|
173 { |
02e2c135ee0c
Keywords and comment can now be displayed in OSD info using %keywords% and %comment%.
zas_
parents:
622
diff
changeset
|
174 GList *keywords; |
02e2c135ee0c
Keywords and comment can now be displayed in OSD info using %keywords% and %comment%.
zas_
parents:
622
diff
changeset
|
175 GString *kwstr = NULL; |
02e2c135ee0c
Keywords and comment can now be displayed in OSD info using %keywords% and %comment%.
zas_
parents:
622
diff
changeset
|
176 gchar *ret = NULL; |
02e2c135ee0c
Keywords and comment can now be displayed in OSD info using %keywords% and %comment%.
zas_
parents:
622
diff
changeset
|
177 |
02e2c135ee0c
Keywords and comment can now be displayed in OSD info using %keywords% and %comment%.
zas_
parents:
622
diff
changeset
|
178 g_assert(fd); |
02e2c135ee0c
Keywords and comment can now be displayed in OSD info using %keywords% and %comment%.
zas_
parents:
622
diff
changeset
|
179 |
1288 | 180 keywords = metadata_read_list(fd, KEYWORD_KEY, METADATA_PLAIN); |
1238
947e603a52c6
simplified metadata interface, dropped metadata_read,
nadvornik
parents:
1191
diff
changeset
|
181 |
947e603a52c6
simplified metadata interface, dropped metadata_read,
nadvornik
parents:
1191
diff
changeset
|
182 if (keywords) |
650
02e2c135ee0c
Keywords and comment can now be displayed in OSD info using %keywords% and %comment%.
zas_
parents:
622
diff
changeset
|
183 { |
02e2c135ee0c
Keywords and comment can now be displayed in OSD info using %keywords% and %comment%.
zas_
parents:
622
diff
changeset
|
184 GList *work = keywords; |
02e2c135ee0c
Keywords and comment can now be displayed in OSD info using %keywords% and %comment%.
zas_
parents:
622
diff
changeset
|
185 |
02e2c135ee0c
Keywords and comment can now be displayed in OSD info using %keywords% and %comment%.
zas_
parents:
622
diff
changeset
|
186 while (work) |
02e2c135ee0c
Keywords and comment can now be displayed in OSD info using %keywords% and %comment%.
zas_
parents:
622
diff
changeset
|
187 { |
02e2c135ee0c
Keywords and comment can now be displayed in OSD info using %keywords% and %comment%.
zas_
parents:
622
diff
changeset
|
188 gchar *kw = work->data; |
02e2c135ee0c
Keywords and comment can now be displayed in OSD info using %keywords% and %comment%.
zas_
parents:
622
diff
changeset
|
189 work = work->next; |
995 | 190 |
650
02e2c135ee0c
Keywords and comment can now be displayed in OSD info using %keywords% and %comment%.
zas_
parents:
622
diff
changeset
|
191 if (!kw) continue; |
02e2c135ee0c
Keywords and comment can now be displayed in OSD info using %keywords% and %comment%.
zas_
parents:
622
diff
changeset
|
192 if (!kwstr) |
02e2c135ee0c
Keywords and comment can now be displayed in OSD info using %keywords% and %comment%.
zas_
parents:
622
diff
changeset
|
193 kwstr = g_string_new(""); |
02e2c135ee0c
Keywords and comment can now be displayed in OSD info using %keywords% and %comment%.
zas_
parents:
622
diff
changeset
|
194 else |
02e2c135ee0c
Keywords and comment can now be displayed in OSD info using %keywords% and %comment%.
zas_
parents:
622
diff
changeset
|
195 g_string_append(kwstr, ", "); |
02e2c135ee0c
Keywords and comment can now be displayed in OSD info using %keywords% and %comment%.
zas_
parents:
622
diff
changeset
|
196 |
02e2c135ee0c
Keywords and comment can now be displayed in OSD info using %keywords% and %comment%.
zas_
parents:
622
diff
changeset
|
197 g_string_append(kwstr, kw); |
02e2c135ee0c
Keywords and comment can now be displayed in OSD info using %keywords% and %comment%.
zas_
parents:
622
diff
changeset
|
198 } |
1238
947e603a52c6
simplified metadata interface, dropped metadata_read,
nadvornik
parents:
1191
diff
changeset
|
199 string_list_free(keywords); |
650
02e2c135ee0c
Keywords and comment can now be displayed in OSD info using %keywords% and %comment%.
zas_
parents:
622
diff
changeset
|
200 } |
02e2c135ee0c
Keywords and comment can now be displayed in OSD info using %keywords% and %comment%.
zas_
parents:
622
diff
changeset
|
201 |
02e2c135ee0c
Keywords and comment can now be displayed in OSD info using %keywords% and %comment%.
zas_
parents:
622
diff
changeset
|
202 if (kwstr) |
02e2c135ee0c
Keywords and comment can now be displayed in OSD info using %keywords% and %comment%.
zas_
parents:
622
diff
changeset
|
203 { |
02e2c135ee0c
Keywords and comment can now be displayed in OSD info using %keywords% and %comment%.
zas_
parents:
622
diff
changeset
|
204 ret = kwstr->str; |
02e2c135ee0c
Keywords and comment can now be displayed in OSD info using %keywords% and %comment%.
zas_
parents:
622
diff
changeset
|
205 g_string_free(kwstr, FALSE); |
02e2c135ee0c
Keywords and comment can now be displayed in OSD info using %keywords% and %comment%.
zas_
parents:
622
diff
changeset
|
206 } |
02e2c135ee0c
Keywords and comment can now be displayed in OSD info using %keywords% and %comment%.
zas_
parents:
622
diff
changeset
|
207 |
02e2c135ee0c
Keywords and comment can now be displayed in OSD info using %keywords% and %comment%.
zas_
parents:
622
diff
changeset
|
208 return ret; |
02e2c135ee0c
Keywords and comment can now be displayed in OSD info using %keywords% and %comment%.
zas_
parents:
622
diff
changeset
|
209 } |
02e2c135ee0c
Keywords and comment can now be displayed in OSD info using %keywords% and %comment%.
zas_
parents:
622
diff
changeset
|
210 |
218
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
216
diff
changeset
|
211 static gchar *image_osd_mkinfo(const gchar *str, ImageWindow *imd, GHashTable *vars) |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
216
diff
changeset
|
212 { |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
216
diff
changeset
|
213 gchar delim = '%', imp = '|', sep[] = " - "; |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
216
diff
changeset
|
214 gchar *start, *end; |
736 | 215 guint pos, prev; |
866
c879a9a4f186
image_osd_mkinfo(): pipe replacement by " - " separator was fixed to work correctly with
zas_
parents:
865
diff
changeset
|
216 gboolean want_separator = FALSE; |
218
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
216
diff
changeset
|
217 gchar *name, *data; |
410 | 218 GString *new; |
218
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
216
diff
changeset
|
219 gchar *ret; |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
216
diff
changeset
|
220 |
410 | 221 if (!str || !*str) return g_strdup(""); |
442 | 222 |
410 | 223 new = g_string_new(str); |
224 | |
218
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
216
diff
changeset
|
225 prev = 0; |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
216
diff
changeset
|
226 |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
216
diff
changeset
|
227 while (TRUE) |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
216
diff
changeset
|
228 { |
736 | 229 guint limit = 0; |
298
cb93a982fcdd
Add the possibility to truncate overlay infos displayed:
zas_
parents:
290
diff
changeset
|
230 gchar *trunc = NULL; |
622 | 231 gchar *limpos = NULL; |
232 gchar *extra = NULL; | |
233 gchar *extrapos = NULL; | |
298
cb93a982fcdd
Add the possibility to truncate overlay infos displayed:
zas_
parents:
290
diff
changeset
|
234 gchar *p; |
cb93a982fcdd
Add the possibility to truncate overlay infos displayed:
zas_
parents:
290
diff
changeset
|
235 |
218
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
216
diff
changeset
|
236 start = strchr(new->str, delim); |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
216
diff
changeset
|
237 if (!start) |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
216
diff
changeset
|
238 break; |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
216
diff
changeset
|
239 end = strchr(start+1, delim); |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
216
diff
changeset
|
240 if (!end) |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
216
diff
changeset
|
241 break; |
442 | 242 |
622 | 243 /* Search for optionnal modifiers |
244 * %name:99:extra% -> name = "name", limit=99, extra = "extra" | |
245 */ | |
246 for (p = start + 1; p < end; p++) | |
298
cb93a982fcdd
Add the possibility to truncate overlay infos displayed:
zas_
parents:
290
diff
changeset
|
247 { |
622 | 248 if (p[0] == ':') |
298
cb93a982fcdd
Add the possibility to truncate overlay infos displayed:
zas_
parents:
290
diff
changeset
|
249 { |
622 | 250 if (g_ascii_isdigit(p[1]) && !limpos) |
251 { | |
252 limpos = p + 1; | |
253 if (!trunc) trunc = p; | |
254 } | |
255 else | |
256 { | |
257 extrapos = p + 1; | |
258 if (!trunc) trunc = p; | |
259 break; | |
260 } | |
298
cb93a982fcdd
Add the possibility to truncate overlay infos displayed:
zas_
parents:
290
diff
changeset
|
261 } |
cb93a982fcdd
Add the possibility to truncate overlay infos displayed:
zas_
parents:
290
diff
changeset
|
262 } |
218
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
216
diff
changeset
|
263 |
622 | 264 if (limpos) |
736 | 265 limit = (guint) atoi(limpos); |
298
cb93a982fcdd
Add the possibility to truncate overlay infos displayed:
zas_
parents:
290
diff
changeset
|
266 |
622 | 267 if (extrapos) |
268 extra = g_strndup(extrapos, end - extrapos); | |
269 | |
270 name = g_strndup(start+1, (trunc ? trunc : end)-start-1); | |
650
02e2c135ee0c
Keywords and comment can now be displayed in OSD info using %keywords% and %comment%.
zas_
parents:
622
diff
changeset
|
271 pos = start - new->str; |
02e2c135ee0c
Keywords and comment can now be displayed in OSD info using %keywords% and %comment%.
zas_
parents:
622
diff
changeset
|
272 data = NULL; |
02e2c135ee0c
Keywords and comment can now be displayed in OSD info using %keywords% and %comment%.
zas_
parents:
622
diff
changeset
|
273 |
02e2c135ee0c
Keywords and comment can now be displayed in OSD info using %keywords% and %comment%.
zas_
parents:
622
diff
changeset
|
274 if (strcmp(name, "keywords") == 0) |
02e2c135ee0c
Keywords and comment can now be displayed in OSD info using %keywords% and %comment%.
zas_
parents:
622
diff
changeset
|
275 { |
02e2c135ee0c
Keywords and comment can now be displayed in OSD info using %keywords% and %comment%.
zas_
parents:
622
diff
changeset
|
276 data = keywords_to_string(imd->image_fd); |
02e2c135ee0c
Keywords and comment can now be displayed in OSD info using %keywords% and %comment%.
zas_
parents:
622
diff
changeset
|
277 } |
02e2c135ee0c
Keywords and comment can now be displayed in OSD info using %keywords% and %comment%.
zas_
parents:
622
diff
changeset
|
278 else if (strcmp(name, "comment") == 0) |
02e2c135ee0c
Keywords and comment can now be displayed in OSD info using %keywords% and %comment%.
zas_
parents:
622
diff
changeset
|
279 { |
1288 | 280 data = metadata_read_string(imd->image_fd, COMMENT_KEY, METADATA_PLAIN); |
650
02e2c135ee0c
Keywords and comment can now be displayed in OSD info using %keywords% and %comment%.
zas_
parents:
622
diff
changeset
|
281 } |
02e2c135ee0c
Keywords and comment can now be displayed in OSD info using %keywords% and %comment%.
zas_
parents:
622
diff
changeset
|
282 else |
02e2c135ee0c
Keywords and comment can now be displayed in OSD info using %keywords% and %comment%.
zas_
parents:
622
diff
changeset
|
283 { |
02e2c135ee0c
Keywords and comment can now be displayed in OSD info using %keywords% and %comment%.
zas_
parents:
622
diff
changeset
|
284 data = g_strdup(g_hash_table_lookup(vars, name)); |
02e2c135ee0c
Keywords and comment can now be displayed in OSD info using %keywords% and %comment%.
zas_
parents:
622
diff
changeset
|
285 if (data && strcmp(name, "zoom") == 0) imd->overlay_show_zoom = TRUE; |
1288 | 286 if (!data) |
287 data = metadata_read_string(imd->image_fd, name, METADATA_FORMATTED); | |
650
02e2c135ee0c
Keywords and comment can now be displayed in OSD info using %keywords% and %comment%.
zas_
parents:
622
diff
changeset
|
288 } |
866
c879a9a4f186
image_osd_mkinfo(): pipe replacement by " - " separator was fixed to work correctly with
zas_
parents:
865
diff
changeset
|
289 |
299 | 290 if (data && *data && limit > 0 && strlen(data) > limit + 3) |
298
cb93a982fcdd
Add the possibility to truncate overlay infos displayed:
zas_
parents:
290
diff
changeset
|
291 { |
cb93a982fcdd
Add the possibility to truncate overlay infos displayed:
zas_
parents:
290
diff
changeset
|
292 gchar *new_data = g_strdup_printf("%-*.*s...", limit, limit, data); |
cb93a982fcdd
Add the possibility to truncate overlay infos displayed:
zas_
parents:
290
diff
changeset
|
293 g_free(data); |
cb93a982fcdd
Add the possibility to truncate overlay infos displayed:
zas_
parents:
290
diff
changeset
|
294 data = new_data; |
cb93a982fcdd
Add the possibility to truncate overlay infos displayed:
zas_
parents:
290
diff
changeset
|
295 } |
622 | 296 |
483
c9e3baeda1b1
Correctly escape data before using pango_layout_set_markup().
zas_
parents:
482
diff
changeset
|
297 if (data) |
c9e3baeda1b1
Correctly escape data before using pango_layout_set_markup().
zas_
parents:
482
diff
changeset
|
298 { |
c9e3baeda1b1
Correctly escape data before using pango_layout_set_markup().
zas_
parents:
482
diff
changeset
|
299 /* Since we use pango markup to display, we need to escape here */ |
c9e3baeda1b1
Correctly escape data before using pango_layout_set_markup().
zas_
parents:
482
diff
changeset
|
300 gchar *escaped = g_markup_escape_text(data, -1); |
c9e3baeda1b1
Correctly escape data before using pango_layout_set_markup().
zas_
parents:
482
diff
changeset
|
301 g_free(data); |
c9e3baeda1b1
Correctly escape data before using pango_layout_set_markup().
zas_
parents:
482
diff
changeset
|
302 data = escaped; |
c9e3baeda1b1
Correctly escape data before using pango_layout_set_markup().
zas_
parents:
482
diff
changeset
|
303 } |
622 | 304 |
305 if (extra) | |
306 { | |
307 if (data && *data) | |
308 { | |
309 /* Display data between left and right parts of extra string | |
752
85c9412d77d2
Allow to escape star characters in the template string with a \.
zas_
parents:
736
diff
changeset
|
310 * the data is expressed by a '*' character. A '*' may be escaped |
995 | 311 * by a \. You should escape all '*' characters, do not rely on the |
752
85c9412d77d2
Allow to escape star characters in the template string with a \.
zas_
parents:
736
diff
changeset
|
312 * current implementation which only replaces the first unescaped '*'. |
622 | 313 * If no "*" is present, the extra string is just appended to data string. |
314 * Pango mark up is accepted in left and right parts. | |
315 * Any \n is replaced by a newline | |
316 * Examples: | |
317 * "<i>*</i>\n" -> data is displayed in italics ended with a newline | |
318 * "\n" -> ended with newline | |
319 * "ISO *" -> prefix data with "ISO " (ie. "ISO 100") | |
752
85c9412d77d2
Allow to escape star characters in the template string with a \.
zas_
parents:
736
diff
changeset
|
320 * "\**\*" -> prefix data with a star, and append a star (ie. "*100*") |
85c9412d77d2
Allow to escape star characters in the template string with a \.
zas_
parents:
736
diff
changeset
|
321 * "\\*" -> prefix data with an anti slash (ie "\100") |
622 | 322 * "Collection <b>*</b>\n" -> display data in bold prefixed by "Collection " and a newline is appended |
323 * | |
324 * FIXME: using background / foreground colors lead to weird results. | |
325 */ | |
326 gchar *new_data; | |
327 gchar *left = NULL; | |
328 gchar *right = extra; | |
329 gchar *p; | |
736 | 330 guint len = strlen(extra); |
622 | 331 |
752
85c9412d77d2
Allow to escape star characters in the template string with a \.
zas_
parents:
736
diff
changeset
|
332 /* Search for left and right parts and unescape characters */ |
622 | 333 for (p = extra; *p; p++, len--) |
752
85c9412d77d2
Allow to escape star characters in the template string with a \.
zas_
parents:
736
diff
changeset
|
334 if (p[0] == '\\') |
622 | 335 { |
752
85c9412d77d2
Allow to escape star characters in the template string with a \.
zas_
parents:
736
diff
changeset
|
336 if (p[1] == 'n') |
85c9412d77d2
Allow to escape star characters in the template string with a \.
zas_
parents:
736
diff
changeset
|
337 { |
85c9412d77d2
Allow to escape star characters in the template string with a \.
zas_
parents:
736
diff
changeset
|
338 memmove(p+1, p+2, --len); |
85c9412d77d2
Allow to escape star characters in the template string with a \.
zas_
parents:
736
diff
changeset
|
339 p[0] = '\n'; |
85c9412d77d2
Allow to escape star characters in the template string with a \.
zas_
parents:
736
diff
changeset
|
340 } |
85c9412d77d2
Allow to escape star characters in the template string with a \.
zas_
parents:
736
diff
changeset
|
341 else if (p[1] != '\0') |
85c9412d77d2
Allow to escape star characters in the template string with a \.
zas_
parents:
736
diff
changeset
|
342 memmove(p, p+1, len--); // includes \0 |
85c9412d77d2
Allow to escape star characters in the template string with a \.
zas_
parents:
736
diff
changeset
|
343 } |
85c9412d77d2
Allow to escape star characters in the template string with a \.
zas_
parents:
736
diff
changeset
|
344 else if (p[0] == '*' && !left) |
85c9412d77d2
Allow to escape star characters in the template string with a \.
zas_
parents:
736
diff
changeset
|
345 { |
85c9412d77d2
Allow to escape star characters in the template string with a \.
zas_
parents:
736
diff
changeset
|
346 right = p + 1; |
85c9412d77d2
Allow to escape star characters in the template string with a \.
zas_
parents:
736
diff
changeset
|
347 left = extra; |
622 | 348 } |
349 | |
752
85c9412d77d2
Allow to escape star characters in the template string with a \.
zas_
parents:
736
diff
changeset
|
350 if (left) right[-1] = '\0'; |
85c9412d77d2
Allow to escape star characters in the template string with a \.
zas_
parents:
736
diff
changeset
|
351 |
622 | 352 new_data = g_strdup_printf("%s%s%s", left ? left : "", data, right); |
353 g_free(data); | |
354 data = new_data; | |
355 } | |
356 g_free(extra); | |
995 | 357 } |
622 | 358 |
218
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
216
diff
changeset
|
359 g_string_erase(new, pos, end-start+1); |
866
c879a9a4f186
image_osd_mkinfo(): pipe replacement by " - " separator was fixed to work correctly with
zas_
parents:
865
diff
changeset
|
360 if (data && *data) |
218
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
216
diff
changeset
|
361 { |
866
c879a9a4f186
image_osd_mkinfo(): pipe replacement by " - " separator was fixed to work correctly with
zas_
parents:
865
diff
changeset
|
362 if (want_separator) |
218
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
216
diff
changeset
|
363 { |
866
c879a9a4f186
image_osd_mkinfo(): pipe replacement by " - " separator was fixed to work correctly with
zas_
parents:
865
diff
changeset
|
364 /* insert separator */ |
218
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
216
diff
changeset
|
365 g_string_insert(new, pos, sep); |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
216
diff
changeset
|
366 pos += strlen(sep); |
986
533694a9675c
Fix another missing separator bug in image overlay. This one was occuring with default string when no ISO data was available from exif.
zas_
parents:
963
diff
changeset
|
367 want_separator = FALSE; |
218
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
216
diff
changeset
|
368 } |
866
c879a9a4f186
image_osd_mkinfo(): pipe replacement by " - " separator was fixed to work correctly with
zas_
parents:
865
diff
changeset
|
369 |
c879a9a4f186
image_osd_mkinfo(): pipe replacement by " - " separator was fixed to work correctly with
zas_
parents:
865
diff
changeset
|
370 g_string_insert(new, pos, data); |
c879a9a4f186
image_osd_mkinfo(): pipe replacement by " - " separator was fixed to work correctly with
zas_
parents:
865
diff
changeset
|
371 pos += strlen(data); |
c879a9a4f186
image_osd_mkinfo(): pipe replacement by " - " separator was fixed to work correctly with
zas_
parents:
865
diff
changeset
|
372 } |
c879a9a4f186
image_osd_mkinfo(): pipe replacement by " - " separator was fixed to work correctly with
zas_
parents:
865
diff
changeset
|
373 |
c879a9a4f186
image_osd_mkinfo(): pipe replacement by " - " separator was fixed to work correctly with
zas_
parents:
865
diff
changeset
|
374 if (pos-prev >= 1 && new->str[pos] == imp) |
c879a9a4f186
image_osd_mkinfo(): pipe replacement by " - " separator was fixed to work correctly with
zas_
parents:
865
diff
changeset
|
375 { |
c879a9a4f186
image_osd_mkinfo(): pipe replacement by " - " separator was fixed to work correctly with
zas_
parents:
865
diff
changeset
|
376 /* pipe character is replaced by a separator, delete it |
c879a9a4f186
image_osd_mkinfo(): pipe replacement by " - " separator was fixed to work correctly with
zas_
parents:
865
diff
changeset
|
377 * and raise a flag if needed */ |
c879a9a4f186
image_osd_mkinfo(): pipe replacement by " - " separator was fixed to work correctly with
zas_
parents:
865
diff
changeset
|
378 g_string_erase(new, pos--, 1); |
986
533694a9675c
Fix another missing separator bug in image overlay. This one was occuring with default string when no ISO data was available from exif.
zas_
parents:
963
diff
changeset
|
379 want_separator |= (data && *data); |
866
c879a9a4f186
image_osd_mkinfo(): pipe replacement by " - " separator was fixed to work correctly with
zas_
parents:
865
diff
changeset
|
380 } |
986
533694a9675c
Fix another missing separator bug in image overlay. This one was occuring with default string when no ISO data was available from exif.
zas_
parents:
963
diff
changeset
|
381 |
533694a9675c
Fix another missing separator bug in image overlay. This one was occuring with default string when no ISO data was available from exif.
zas_
parents:
963
diff
changeset
|
382 if (new->str[pos] == '\n') want_separator = FALSE; |
533694a9675c
Fix another missing separator bug in image overlay. This one was occuring with default string when no ISO data was available from exif.
zas_
parents:
963
diff
changeset
|
383 |
866
c879a9a4f186
image_osd_mkinfo(): pipe replacement by " - " separator was fixed to work correctly with
zas_
parents:
865
diff
changeset
|
384 prev = pos - 1; |
c879a9a4f186
image_osd_mkinfo(): pipe replacement by " - " separator was fixed to work correctly with
zas_
parents:
865
diff
changeset
|
385 |
218
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
216
diff
changeset
|
386 g_free(name); |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
216
diff
changeset
|
387 g_free(data); |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
216
diff
changeset
|
388 } |
442 | 389 |
218
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
216
diff
changeset
|
390 /* search and destroy empty lines */ |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
216
diff
changeset
|
391 end = new->str; |
245
62f2f8f7cb2d
Add parenthesis around affection to clear a gcc warning.
zas_
parents:
218
diff
changeset
|
392 while ((start = strchr(end, '\n'))) |
218
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
216
diff
changeset
|
393 { |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
216
diff
changeset
|
394 end = start; |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
216
diff
changeset
|
395 while (*++(end) == '\n') |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
216
diff
changeset
|
396 ; |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
216
diff
changeset
|
397 g_string_erase(new, start-new->str, end-start-1); |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
216
diff
changeset
|
398 } |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
216
diff
changeset
|
399 |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
216
diff
changeset
|
400 g_strchomp(new->str); |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
216
diff
changeset
|
401 |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
216
diff
changeset
|
402 ret = new->str; |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
216
diff
changeset
|
403 g_string_free(new, FALSE); |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
216
diff
changeset
|
404 |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
216
diff
changeset
|
405 return ret; |
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
216
diff
changeset
|
406 } |
9 | 407 |
862
30e1f4370215
osd_template_insert(): optimize and simplify using flags.
zas_
parents:
861
diff
changeset
|
408 typedef enum { |
30e1f4370215
osd_template_insert(): optimize and simplify using flags.
zas_
parents:
861
diff
changeset
|
409 OSDT_NONE = 0, |
30e1f4370215
osd_template_insert(): optimize and simplify using flags.
zas_
parents:
861
diff
changeset
|
410 OSDT_FREE = 1 << 0, |
963 | 411 OSDT_NO_DUP = 1 << 1 |
862
30e1f4370215
osd_template_insert(): optimize and simplify using flags.
zas_
parents:
861
diff
changeset
|
412 } OsdTemplateFlags; |
30e1f4370215
osd_template_insert(): optimize and simplify using flags.
zas_
parents:
861
diff
changeset
|
413 |
30e1f4370215
osd_template_insert(): optimize and simplify using flags.
zas_
parents:
861
diff
changeset
|
414 static void osd_template_insert(GHashTable *vars, gchar *keyword, gchar *value, OsdTemplateFlags flags) |
861
3df5220fbc23
image_osd_info_render(): ensure values are always escaped before using pango_layout_set_markup().
zas_
parents:
860
diff
changeset
|
415 { |
862
30e1f4370215
osd_template_insert(): optimize and simplify using flags.
zas_
parents:
861
diff
changeset
|
416 if (!value) |
30e1f4370215
osd_template_insert(): optimize and simplify using flags.
zas_
parents:
861
diff
changeset
|
417 { |
30e1f4370215
osd_template_insert(): optimize and simplify using flags.
zas_
parents:
861
diff
changeset
|
418 g_hash_table_insert(vars, keyword, g_strdup("")); |
30e1f4370215
osd_template_insert(): optimize and simplify using flags.
zas_
parents:
861
diff
changeset
|
419 return; |
30e1f4370215
osd_template_insert(): optimize and simplify using flags.
zas_
parents:
861
diff
changeset
|
420 } |
30e1f4370215
osd_template_insert(): optimize and simplify using flags.
zas_
parents:
861
diff
changeset
|
421 |
30e1f4370215
osd_template_insert(): optimize and simplify using flags.
zas_
parents:
861
diff
changeset
|
422 if (flags & OSDT_NO_DUP) |
30e1f4370215
osd_template_insert(): optimize and simplify using flags.
zas_
parents:
861
diff
changeset
|
423 { |
30e1f4370215
osd_template_insert(): optimize and simplify using flags.
zas_
parents:
861
diff
changeset
|
424 g_hash_table_insert(vars, keyword, value); |
30e1f4370215
osd_template_insert(): optimize and simplify using flags.
zas_
parents:
861
diff
changeset
|
425 return; |
30e1f4370215
osd_template_insert(): optimize and simplify using flags.
zas_
parents:
861
diff
changeset
|
426 } |
963 | 427 else |
862
30e1f4370215
osd_template_insert(): optimize and simplify using flags.
zas_
parents:
861
diff
changeset
|
428 { |
30e1f4370215
osd_template_insert(): optimize and simplify using flags.
zas_
parents:
861
diff
changeset
|
429 g_hash_table_insert(vars, keyword, g_strdup(value)); |
30e1f4370215
osd_template_insert(): optimize and simplify using flags.
zas_
parents:
861
diff
changeset
|
430 } |
861
3df5220fbc23
image_osd_info_render(): ensure values are always escaped before using pango_layout_set_markup().
zas_
parents:
860
diff
changeset
|
431 |
862
30e1f4370215
osd_template_insert(): optimize and simplify using flags.
zas_
parents:
861
diff
changeset
|
432 if (flags & OSDT_FREE) g_free((gpointer) value); |
861
3df5220fbc23
image_osd_info_render(): ensure values are always escaped before using pango_layout_set_markup().
zas_
parents:
860
diff
changeset
|
433 } |
3df5220fbc23
image_osd_info_render(): ensure values are always escaped before using pango_layout_set_markup().
zas_
parents:
860
diff
changeset
|
434 |
616
d9c9d05c9d4d
Move overlay histogram stuff from ImageWindow to OverlayStateData.
zas_
parents:
615
diff
changeset
|
435 static GdkPixbuf *image_osd_info_render(OverlayStateData *osd) |
9 | 436 { |
410 | 437 GdkPixbuf *pixbuf = NULL; |
9 | 438 gint width, height; |
439 PangoLayout *layout; | |
440 const gchar *name; | |
275 | 441 gchar *text; |
273
e0e2c2b72c5a
reworked the histogram patch by Uwe Ohse, most of the code is in
nadvornik
parents:
265
diff
changeset
|
442 GdkPixbuf *imgpixbuf = NULL; |
860
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
443 gboolean with_hist; |
1298 | 444 const HistMap *histmap; |
995 | 445 ImageWindow *imd = osd->imd; |
617
aa883b6d2ef6
image_osd_info_render(): if there's no fd, just return.
zas_
parents:
616
diff
changeset
|
446 FileData *fd = image_get_fd(imd); |
aa883b6d2ef6
image_osd_info_render(): if there's no fd, just return.
zas_
parents:
616
diff
changeset
|
447 |
aa883b6d2ef6
image_osd_info_render(): if there's no fd, just return.
zas_
parents:
616
diff
changeset
|
448 if (!fd) return NULL; |
218
f4a0555794a9
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
zas_
parents:
216
diff
changeset
|
449 |
9 | 450 name = image_get_name(imd); |
451 if (name) | |
452 { | |
860
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
453 gint n, t; |
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
454 CollectionData *cd; |
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
455 CollectInfo *info; |
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
456 GHashTable *vars; |
861
3df5220fbc23
image_osd_info_render(): ensure values are always escaped before using pango_layout_set_markup().
zas_
parents:
860
diff
changeset
|
457 |
860
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
458 vars = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, g_free); |
9 | 459 |
860
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
460 cd = image_get_collection(imd, &info); |
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
461 if (cd) |
622 | 462 { |
860
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
463 t = g_list_length(cd->list); |
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
464 n = g_list_index(cd->list, info) + 1; |
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
465 if (cd->name) |
9 | 466 { |
860
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
467 if (file_extension_match(cd->name, GQ_COLLECTION_EXT)) |
862
30e1f4370215
osd_template_insert(): optimize and simplify using flags.
zas_
parents:
861
diff
changeset
|
468 osd_template_insert(vars, "collection", remove_extension_from_path(cd->name), OSDT_FREE); |
860
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
469 else |
862
30e1f4370215
osd_template_insert(): optimize and simplify using flags.
zas_
parents:
861
diff
changeset
|
470 osd_template_insert(vars, "collection", cd->name, OSDT_NONE); |
9 | 471 } |
472 else | |
473 { | |
862
30e1f4370215
osd_template_insert(): optimize and simplify using flags.
zas_
parents:
861
diff
changeset
|
474 osd_template_insert(vars, "collection", _("Untitled"), OSDT_NONE); |
9 | 475 } |
476 } | |
477 else | |
478 { | |
860
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
479 LayoutWindow *lw = layout_find_by_image(imd); |
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
480 if (lw) |
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
481 { |
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
482 if (lw->slideshow) |
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
483 { |
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
484 n = g_list_length(lw->slideshow->list_done); |
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
485 t = n + g_list_length(lw->slideshow->list); |
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
486 if (n == 0) n = t; |
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
487 } |
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
488 else |
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
489 { |
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
490 t = layout_list_count(lw, NULL); |
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
491 n = layout_list_get_index(lw, image_get_fd(lw->image)) + 1; |
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
492 } |
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
493 } |
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
494 else if (view_window_find_image(imd, &n, &t)) |
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
495 { |
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
496 n++; |
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
497 } |
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
498 else |
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
499 { |
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
500 t = 1; |
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
501 n = 1; |
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
502 } |
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
503 |
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
504 if (n < 1) n = 1; |
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
505 if (t < 1) t = 1; |
480
805c3258d228
Make histogram depends on image window not layout window.
zas_
parents:
475
diff
changeset
|
506 |
862
30e1f4370215
osd_template_insert(): optimize and simplify using flags.
zas_
parents:
861
diff
changeset
|
507 osd_template_insert(vars, "collection", NULL, OSDT_NONE); |
860
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
508 } |
861
3df5220fbc23
image_osd_info_render(): ensure values are always escaped before using pango_layout_set_markup().
zas_
parents:
860
diff
changeset
|
509 |
862
30e1f4370215
osd_template_insert(): optimize and simplify using flags.
zas_
parents:
861
diff
changeset
|
510 osd_template_insert(vars, "number", g_strdup_printf("%d", n), OSDT_NO_DUP); |
30e1f4370215
osd_template_insert(): optimize and simplify using flags.
zas_
parents:
861
diff
changeset
|
511 osd_template_insert(vars, "total", g_strdup_printf("%d", t), OSDT_NO_DUP); |
30e1f4370215
osd_template_insert(): optimize and simplify using flags.
zas_
parents:
861
diff
changeset
|
512 osd_template_insert(vars, "name", (gchar *) name, OSDT_NONE); |
995 | 513 osd_template_insert(vars, "date", imd->image_fd ? ((gchar *) text_from_time(imd->image_fd->date)) : "", OSDT_NONE); |
888 | 514 osd_template_insert(vars, "size", imd->image_fd ? (text_from_size_abrev(imd->image_fd->size)) : g_strdup(""), OSDT_FREE); |
862
30e1f4370215
osd_template_insert(): optimize and simplify using flags.
zas_
parents:
861
diff
changeset
|
515 osd_template_insert(vars, "zoom", image_zoom_get_as_text(imd), OSDT_FREE); |
861
3df5220fbc23
image_osd_info_render(): ensure values are always escaped before using pango_layout_set_markup().
zas_
parents:
860
diff
changeset
|
516 |
860
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
517 if (!imd->unknown) |
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
518 { |
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
519 gint w, h; |
1011 | 520 GdkPixbuf *load_pixbuf = image_loader_get_pixbuf(imd->il); |
442 | 521 |
860
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
522 if (imd->delay_flip && |
1011 | 523 imd->il && load_pixbuf && |
524 image_get_pixbuf(imd) != load_pixbuf) | |
860
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
525 { |
1011 | 526 w = gdk_pixbuf_get_width(load_pixbuf); |
527 h = gdk_pixbuf_get_height(load_pixbuf); | |
528 imgpixbuf = load_pixbuf; | |
860
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
529 } |
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
530 else |
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
531 { |
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
532 image_get_image_size(imd, &w, &h); |
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
533 imgpixbuf = (PIXBUF_RENDERER(imd->pr))->pixbuf; |
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
534 } |
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
535 |
861
3df5220fbc23
image_osd_info_render(): ensure values are always escaped before using pango_layout_set_markup().
zas_
parents:
860
diff
changeset
|
536 |
862
30e1f4370215
osd_template_insert(): optimize and simplify using flags.
zas_
parents:
861
diff
changeset
|
537 osd_template_insert(vars, "width", g_strdup_printf("%d", w), OSDT_NO_DUP); |
30e1f4370215
osd_template_insert(): optimize and simplify using flags.
zas_
parents:
861
diff
changeset
|
538 osd_template_insert(vars, "height", g_strdup_printf("%d", h), OSDT_NO_DUP); |
30e1f4370215
osd_template_insert(): optimize and simplify using flags.
zas_
parents:
861
diff
changeset
|
539 osd_template_insert(vars, "res", g_strdup_printf("%d × %d", w, h), OSDT_FREE); |
860
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
540 } |
861
3df5220fbc23
image_osd_info_render(): ensure values are always escaped before using pango_layout_set_markup().
zas_
parents:
860
diff
changeset
|
541 else |
3df5220fbc23
image_osd_info_render(): ensure values are always escaped before using pango_layout_set_markup().
zas_
parents:
860
diff
changeset
|
542 { |
862
30e1f4370215
osd_template_insert(): optimize and simplify using flags.
zas_
parents:
861
diff
changeset
|
543 osd_template_insert(vars, "width", NULL, OSDT_NONE); |
30e1f4370215
osd_template_insert(): optimize and simplify using flags.
zas_
parents:
861
diff
changeset
|
544 osd_template_insert(vars, "height", NULL, OSDT_NONE); |
30e1f4370215
osd_template_insert(): optimize and simplify using flags.
zas_
parents:
861
diff
changeset
|
545 osd_template_insert(vars, "res", NULL, OSDT_NONE); |
861
3df5220fbc23
image_osd_info_render(): ensure values are always escaped before using pango_layout_set_markup().
zas_
parents:
860
diff
changeset
|
546 } |
3df5220fbc23
image_osd_info_render(): ensure values are always escaped before using pango_layout_set_markup().
zas_
parents:
860
diff
changeset
|
547 |
1336 | 548 text = image_osd_mkinfo(options->image_overlay.template_string, imd, vars); |
860
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
549 g_hash_table_destroy(vars); |
415 | 550 |
860
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
551 } else { |
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
552 /* When does this occur ?? */ |
861
3df5220fbc23
image_osd_info_render(): ensure values are always escaped before using pango_layout_set_markup().
zas_
parents:
860
diff
changeset
|
553 text = g_markup_escape_text(_("Untitled"), -1); |
860
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
554 } |
132 | 555 |
1294 | 556 with_hist = ((osd->show & OSD_SHOW_HISTOGRAM) && osd->histogram); |
557 if (with_hist) | |
558 { | |
559 histmap = histmap_get(imd->image_fd); | |
560 if (!histmap) with_hist = FALSE; | |
561 } | |
562 | |
860
1e85eabf4952
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
zas_
parents:
857
diff
changeset
|
563 |
133 | 564 { |
265
3f14da3c3b9a
Fix a segfault on fullscreen file deletion reported by Fr«±d«±ric Mantegazza.
zas_
parents:
263
diff
changeset
|
565 gint active_marks = 0; |
3f14da3c3b9a
Fix a segfault on fullscreen file deletion reported by Fr«±d«±ric Mantegazza.
zas_
parents:
263
diff
changeset
|
566 gint mark; |
275 | 567 gchar *text2; |
263
c7fefb0a4b78
Display marks in overlay info only if at least one is set.
zas_
parents:
245
diff
changeset
|
568 |
442 | 569 for (mark = 0; mark < FILEDATA_MARKS_SIZE; mark++) |
263
c7fefb0a4b78
Display marks in overlay info only if at least one is set.
zas_
parents:
245
diff
changeset
|
570 { |
800 | 571 active_marks += file_data_get_mark(fd, mark); |
265
3f14da3c3b9a
Fix a segfault on fullscreen file deletion reported by Fr«±d«±ric Mantegazza.
zas_
parents:
263
diff
changeset
|
572 } |
263
c7fefb0a4b78
Display marks in overlay info only if at least one is set.
zas_
parents:
245
diff
changeset
|
573 |
265
3f14da3c3b9a
Fix a segfault on fullscreen file deletion reported by Fr«±d«±ric Mantegazza.
zas_
parents:
263
diff
changeset
|
574 if (active_marks > 0) |
3f14da3c3b9a
Fix a segfault on fullscreen file deletion reported by Fr«±d«±ric Mantegazza.
zas_
parents:
263
diff
changeset
|
575 { |
3f14da3c3b9a
Fix a segfault on fullscreen file deletion reported by Fr«±d«±ric Mantegazza.
zas_
parents:
263
diff
changeset
|
576 GString *buf = g_string_sized_new(FILEDATA_MARKS_SIZE * 2); |
442 | 577 |
578 for (mark = 0; mark < FILEDATA_MARKS_SIZE; mark++) | |
265
3f14da3c3b9a
Fix a segfault on fullscreen file deletion reported by Fr«±d«±ric Mantegazza.
zas_
parents:
263
diff
changeset
|
579 { |
800 | 580 g_string_append_printf(buf, file_data_get_mark(fd, mark) ? " <span background='#FF00FF'>%c</span>" : " %c", '1' + mark); |
995 | 581 } |
265
3f14da3c3b9a
Fix a segfault on fullscreen file deletion reported by Fr«±d«±ric Mantegazza.
zas_
parents:
263
diff
changeset
|
582 |
410 | 583 if (*text) |
584 text2 = g_strdup_printf("%s\n%s", text, buf->str); | |
585 else | |
586 text2 = g_strdup(buf->str); | |
265
3f14da3c3b9a
Fix a segfault on fullscreen file deletion reported by Fr«±d«±ric Mantegazza.
zas_
parents:
263
diff
changeset
|
587 g_string_free(buf, TRUE); |
3f14da3c3b9a
Fix a segfault on fullscreen file deletion reported by Fr«±d«±ric Mantegazza.
zas_
parents:
263
diff
changeset
|
588 g_free(text); |
275 | 589 text = text2; |
265
3f14da3c3b9a
Fix a segfault on fullscreen file deletion reported by Fr«±d«±ric Mantegazza.
zas_
parents:
263
diff
changeset
|
590 } |
275 | 591 |
995 | 592 if (with_hist) |
290 | 593 { |
616
d9c9d05c9d4d
Move overlay histogram stuff from ImageWindow to OverlayStateData.
zas_
parents:
615
diff
changeset
|
594 gchar *escaped_histogram_label = g_markup_escape_text(histogram_label(osd->histogram), -1); |
410 | 595 if (*text) |
483
c9e3baeda1b1
Correctly escape data before using pango_layout_set_markup().
zas_
parents:
482
diff
changeset
|
596 text2 = g_strdup_printf("%s\n%s", text, escaped_histogram_label); |
410 | 597 else |
483
c9e3baeda1b1
Correctly escape data before using pango_layout_set_markup().
zas_
parents:
482
diff
changeset
|
598 text2 = g_strdup(escaped_histogram_label); |
c9e3baeda1b1
Correctly escape data before using pango_layout_set_markup().
zas_
parents:
482
diff
changeset
|
599 g_free(escaped_histogram_label); |
290 | 600 g_free(text); |
601 text = text2; | |
602 } | |
155 | 603 } |
410 | 604 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
9
diff
changeset
|
605 layout = gtk_widget_create_pango_layout(imd->pr, NULL); |
275 | 606 pango_layout_set_markup(layout, text, -1); |
607 g_free(text); | |
442 | 608 |
9 | 609 pango_layout_get_pixel_size(layout, &width, &height); |
410 | 610 /* with empty text width is set to 0, but not height) */ |
611 if (width == 0) | |
612 height = 0; | |
613 else if (height == 0) | |
614 width = 0; | |
615 if (width > 0) width += 10; | |
616 if (height > 0) height += 10; | |
9 | 617 |
273
e0e2c2b72c5a
reworked the histogram patch by Uwe Ohse, most of the code is in
nadvornik
parents:
265
diff
changeset
|
618 if (with_hist) |
e0e2c2b72c5a
reworked the histogram patch by Uwe Ohse, most of the code is in
nadvornik
parents:
265
diff
changeset
|
619 { |
620 | 620 if (width < HISTOGRAM_WIDTH + 10) width = HISTOGRAM_WIDTH + 10; |
290 | 621 height += HISTOGRAM_HEIGHT + 5; |
273
e0e2c2b72c5a
reworked the histogram patch by Uwe Ohse, most of the code is in
nadvornik
parents:
265
diff
changeset
|
622 } |
e0e2c2b72c5a
reworked the histogram patch by Uwe Ohse, most of the code is in
nadvornik
parents:
265
diff
changeset
|
623 |
410 | 624 if (width > 0 && height > 0) |
625 { | |
626 /* TODO: make osd color configurable --Zas */ | |
627 pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, width, height); | |
628 pixbuf_set_rect_fill(pixbuf, 3, 3, width-6, height-6, 240, 240, 240, 210); | |
629 pixbuf_set_rect(pixbuf, 0, 0, width, height, 240, 240, 240, 80, 1, 1, 1, 1); | |
630 pixbuf_set_rect(pixbuf, 1, 1, width-2, height-2, 240, 240, 240, 130, 1, 1, 1, 1); | |
631 pixbuf_set_rect(pixbuf, 2, 2, width-4, height-4, 240, 240, 240, 180, 1, 1, 1, 1); | |
632 pixbuf_pixel_set(pixbuf, 0, 0, 0, 0, 0, 0); | |
633 pixbuf_pixel_set(pixbuf, width - 1, 0, 0, 0, 0, 0); | |
634 pixbuf_pixel_set(pixbuf, 0, height - 1, 0, 0, 0, 0); | |
635 pixbuf_pixel_set(pixbuf, width - 1, height - 1, 0, 0, 0, 0); | |
442 | 636 |
410 | 637 if (with_hist) |
620 | 638 { |
639 gint x = 5; | |
640 gint y = height - HISTOGRAM_HEIGHT - 5; | |
641 gint w = width - 10; | |
442 | 642 |
1302
8d1f9739c06a
Add grid to bar histogram, simplify the code and draw horizontal lines too.
zas_
parents:
1298
diff
changeset
|
643 pixbuf_set_rect_fill(pixbuf, x, y, w, HISTOGRAM_HEIGHT, 220, 220, 220, 210); |
1294 | 644 histogram_draw(osd->histogram, histmap, pixbuf, x, y, w, HISTOGRAM_HEIGHT); |
620 | 645 } |
410 | 646 pixbuf_draw_layout(pixbuf, layout, imd->pr, 5, 5, 0, 0, 0, 255); |
647 } | |
9 | 648 |
649 g_object_unref(G_OBJECT(layout)); | |
650 | |
651 return pixbuf; | |
652 } | |
653 | |
118
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
654 static GdkPixbuf *image_osd_icon_pixbuf(ImageOSDFlag flag) |
9 | 655 { |
118
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
656 static GdkPixbuf **icons = NULL; |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
657 GdkPixbuf *icon = NULL; |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
658 |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
659 if (!icons) icons = g_new0(GdkPixbuf *, IMAGE_OSD_COUNT); |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
660 if (icons[flag]) return icons[flag]; |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
661 |
122
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
662 if (osd_icons[flag].key) |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
663 { |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
664 icon = pixbuf_inline(osd_icons[flag].key); |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
665 } |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
666 |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
667 if (!icon) |
117
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
668 { |
122
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
669 icon = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, 24, 24); |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
670 pixbuf_set_rect_fill(icon, 1, 1, 22, 22, 255, 255, 255, 200); |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
671 pixbuf_set_rect(icon, 0, 0, 24, 24, 0, 0, 0, 128, 1, 1, 1, 1); |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
672 switch (flag) |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
673 { |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
674 case IMAGE_OSD_ROTATE_AUTO: |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
675 pixbuf_set_rect(icon, 3, 8, 11, 12, |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
676 0, 0, 0, 255, |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
677 3, 0, 3, 0); |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
678 pixbuf_draw_triangle(icon, 14, 3, 6, 12, |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
679 20, 9, 14, 15, 14, 3, |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
680 0, 0, 0, 255); |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
681 break; |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
682 case IMAGE_OSD_ROTATE_USER: |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
683 break; |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
684 case IMAGE_OSD_COLOR: |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
685 pixbuf_set_rect_fill(icon, 3, 3, 18, 6, 200, 0, 0, 255); |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
686 pixbuf_set_rect_fill(icon, 3, 9, 18, 6, 0, 200, 0, 255); |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
687 pixbuf_set_rect_fill(icon, 3, 15, 18, 6, 0, 0, 200, 255); |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
688 break; |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
689 case IMAGE_OSD_FIRST: |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
690 pixbuf_set_rect(icon, 3, 3, 18, 18, 0, 0, 0, 200, 3, 3, 3, 0); |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
691 pixbuf_draw_triangle(icon, 6, 5, 12, 6, |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
692 12, 5, 18, 11, 6, 11, |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
693 0, 0, 0, 255); |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
694 break; |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
695 case IMAGE_OSD_LAST: |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
696 pixbuf_set_rect(icon, 3, 3, 18, 18, 0, 0, 0, 200, 3, 3, 0, 3); |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
697 pixbuf_draw_triangle(icon, 6, 12, 12, 6, |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
698 12, 18, 6, 12, 18, 12, |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
699 0, 0, 0, 255); |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
700 break; |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
701 case IMAGE_OSD_ICON: |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
702 pixbuf_set_rect_fill(icon, 11, 3, 3, 12, 0, 0, 0, 255); |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
703 pixbuf_set_rect_fill(icon, 11, 17, 3, 3, 0, 0, 0, 255); |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
704 break; |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
705 default: |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
706 break; |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
707 } |
118
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
708 } |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
709 |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
710 icons[flag] = icon; |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
711 |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
712 return icon; |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
713 } |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
714 |
821
fb249b8e63e4
Move some functions from image.[ch] to image-overlay.c and make them static:
zas_
parents:
800
diff
changeset
|
715 static gint image_overlay_add(ImageWindow *imd, GdkPixbuf *pixbuf, gint x, gint y, |
857
7d387a25b1ec
Use flags instead of int parameters for pixbuf_renderer_overlay_add().
zas_
parents:
844
diff
changeset
|
716 OverlayRendererFlags flags) |
821
fb249b8e63e4
Move some functions from image.[ch] to image-overlay.c and make them static:
zas_
parents:
800
diff
changeset
|
717 { |
857
7d387a25b1ec
Use flags instead of int parameters for pixbuf_renderer_overlay_add().
zas_
parents:
844
diff
changeset
|
718 return pixbuf_renderer_overlay_add((PixbufRenderer *)imd->pr, pixbuf, x, y, flags); |
821
fb249b8e63e4
Move some functions from image.[ch] to image-overlay.c and make them static:
zas_
parents:
800
diff
changeset
|
719 } |
fb249b8e63e4
Move some functions from image.[ch] to image-overlay.c and make them static:
zas_
parents:
800
diff
changeset
|
720 |
fb249b8e63e4
Move some functions from image.[ch] to image-overlay.c and make them static:
zas_
parents:
800
diff
changeset
|
721 static void image_overlay_set(ImageWindow *imd, gint id, GdkPixbuf *pixbuf, gint x, gint y) |
fb249b8e63e4
Move some functions from image.[ch] to image-overlay.c and make them static:
zas_
parents:
800
diff
changeset
|
722 { |
fb249b8e63e4
Move some functions from image.[ch] to image-overlay.c and make them static:
zas_
parents:
800
diff
changeset
|
723 pixbuf_renderer_overlay_set((PixbufRenderer *)imd->pr, id, pixbuf, x, y); |
fb249b8e63e4
Move some functions from image.[ch] to image-overlay.c and make them static:
zas_
parents:
800
diff
changeset
|
724 } |
fb249b8e63e4
Move some functions from image.[ch] to image-overlay.c and make them static:
zas_
parents:
800
diff
changeset
|
725 |
fb249b8e63e4
Move some functions from image.[ch] to image-overlay.c and make them static:
zas_
parents:
800
diff
changeset
|
726 #if 0 /* unused for now */ |
fb249b8e63e4
Move some functions from image.[ch] to image-overlay.c and make them static:
zas_
parents:
800
diff
changeset
|
727 static gint image_overlay_get(ImageWindow *imd, gint id, GdkPixbuf **pixbuf, gint *x, gint *y) |
fb249b8e63e4
Move some functions from image.[ch] to image-overlay.c and make them static:
zas_
parents:
800
diff
changeset
|
728 { |
fb249b8e63e4
Move some functions from image.[ch] to image-overlay.c and make them static:
zas_
parents:
800
diff
changeset
|
729 return pixbuf_renderer_overlay_get((PixbufRenderer *)imd->pr, id, pixbuf, x, y); |
fb249b8e63e4
Move some functions from image.[ch] to image-overlay.c and make them static:
zas_
parents:
800
diff
changeset
|
730 } |
fb249b8e63e4
Move some functions from image.[ch] to image-overlay.c and make them static:
zas_
parents:
800
diff
changeset
|
731 #endif |
fb249b8e63e4
Move some functions from image.[ch] to image-overlay.c and make them static:
zas_
parents:
800
diff
changeset
|
732 |
fb249b8e63e4
Move some functions from image.[ch] to image-overlay.c and make them static:
zas_
parents:
800
diff
changeset
|
733 static void image_overlay_remove(ImageWindow *imd, gint id) |
fb249b8e63e4
Move some functions from image.[ch] to image-overlay.c and make them static:
zas_
parents:
800
diff
changeset
|
734 { |
fb249b8e63e4
Move some functions from image.[ch] to image-overlay.c and make them static:
zas_
parents:
800
diff
changeset
|
735 pixbuf_renderer_overlay_remove((PixbufRenderer *)imd->pr, id); |
fb249b8e63e4
Move some functions from image.[ch] to image-overlay.c and make them static:
zas_
parents:
800
diff
changeset
|
736 } |
fb249b8e63e4
Move some functions from image.[ch] to image-overlay.c and make them static:
zas_
parents:
800
diff
changeset
|
737 |
118
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
738 static void image_osd_icon_show(OverlayStateData *osd, ImageOSDFlag flag) |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
739 { |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
740 GdkPixbuf *pixbuf; |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
741 |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
742 if (osd->icon_id[flag]) return; |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
743 |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
744 pixbuf = image_osd_icon_pixbuf(flag); |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
745 if (!pixbuf) return; |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
746 |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
747 osd->icon_id[flag] = image_overlay_add(osd->imd, pixbuf, |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
748 osd_icons[flag].x, osd_icons[flag].y, |
857
7d387a25b1ec
Use flags instead of int parameters for pixbuf_renderer_overlay_add().
zas_
parents:
844
diff
changeset
|
749 OVL_RELATIVE); |
118
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
750 } |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
751 |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
752 static void image_osd_icon_hide(OverlayStateData *osd, ImageOSDFlag flag) |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
753 { |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
754 if (osd->icon_id[flag]) |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
755 { |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
756 image_overlay_remove(osd->imd, osd->icon_id[flag]); |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
757 osd->icon_id[flag] = 0; |
117
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
758 } |
9 | 759 } |
760 | |
886 | 761 static void image_osd_icons_reset_time(OverlayStateData *osd) |
762 { | |
763 gint i; | |
764 | |
765 for (i = 0; i < IMAGE_OSD_COUNT; i++) | |
766 { | |
767 if (osd_icons[i].reset) | |
768 { | |
769 osd->icon_time[i] = 0; | |
770 } | |
771 } | |
772 } | |
773 | |
774 static void image_osd_icons_update(OverlayStateData *osd) | |
775 { | |
776 gint i; | |
777 | |
778 for (i = 0; i < IMAGE_OSD_COUNT; i++) | |
779 { | |
780 if (osd->icon_time[i] > 0) | |
781 { | |
782 image_osd_icon_show(osd, i); | |
783 } | |
784 else | |
785 { | |
786 image_osd_icon_hide(osd, i); | |
787 } | |
788 } | |
789 } | |
790 | |
791 static void image_osd_icons_hide(OverlayStateData *osd) | |
792 { | |
793 gint i; | |
794 | |
795 for (i = 0; i < IMAGE_OSD_COUNT; i++) | |
796 { | |
797 image_osd_icon_hide(osd, i); | |
798 } | |
799 } | |
800 | |
887
e418c33a49c8
Move code from image_osd_update_cb() to separate functions.
zas_
parents:
886
diff
changeset
|
801 static void image_osd_info_show(OverlayStateData *osd, GdkPixbuf *pixbuf) |
e418c33a49c8
Move code from image_osd_update_cb() to separate functions.
zas_
parents:
886
diff
changeset
|
802 { |
e418c33a49c8
Move code from image_osd_update_cb() to separate functions.
zas_
parents:
886
diff
changeset
|
803 if (osd->ovl_info == 0) |
e418c33a49c8
Move code from image_osd_update_cb() to separate functions.
zas_
parents:
886
diff
changeset
|
804 { |
e418c33a49c8
Move code from image_osd_update_cb() to separate functions.
zas_
parents:
886
diff
changeset
|
805 osd->ovl_info = image_overlay_add(osd->imd, pixbuf, osd->x, osd->y, OVL_RELATIVE); |
e418c33a49c8
Move code from image_osd_update_cb() to separate functions.
zas_
parents:
886
diff
changeset
|
806 } |
e418c33a49c8
Move code from image_osd_update_cb() to separate functions.
zas_
parents:
886
diff
changeset
|
807 else |
e418c33a49c8
Move code from image_osd_update_cb() to separate functions.
zas_
parents:
886
diff
changeset
|
808 { |
e418c33a49c8
Move code from image_osd_update_cb() to separate functions.
zas_
parents:
886
diff
changeset
|
809 image_overlay_set(osd->imd, osd->ovl_info, pixbuf, osd->x, osd->y); |
e418c33a49c8
Move code from image_osd_update_cb() to separate functions.
zas_
parents:
886
diff
changeset
|
810 } |
e418c33a49c8
Move code from image_osd_update_cb() to separate functions.
zas_
parents:
886
diff
changeset
|
811 } |
e418c33a49c8
Move code from image_osd_update_cb() to separate functions.
zas_
parents:
886
diff
changeset
|
812 |
e418c33a49c8
Move code from image_osd_update_cb() to separate functions.
zas_
parents:
886
diff
changeset
|
813 static void image_osd_info_hide(OverlayStateData *osd) |
e418c33a49c8
Move code from image_osd_update_cb() to separate functions.
zas_
parents:
886
diff
changeset
|
814 { |
e418c33a49c8
Move code from image_osd_update_cb() to separate functions.
zas_
parents:
886
diff
changeset
|
815 if (osd->ovl_info == 0) return; |
e418c33a49c8
Move code from image_osd_update_cb() to separate functions.
zas_
parents:
886
diff
changeset
|
816 |
e418c33a49c8
Move code from image_osd_update_cb() to separate functions.
zas_
parents:
886
diff
changeset
|
817 image_overlay_remove(osd->imd, osd->ovl_info); |
e418c33a49c8
Move code from image_osd_update_cb() to separate functions.
zas_
parents:
886
diff
changeset
|
818 osd->ovl_info = 0; |
e418c33a49c8
Move code from image_osd_update_cb() to separate functions.
zas_
parents:
886
diff
changeset
|
819 } |
e418c33a49c8
Move code from image_osd_update_cb() to separate functions.
zas_
parents:
886
diff
changeset
|
820 |
117
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
821 static gint image_osd_update_cb(gpointer data) |
9 | 822 { |
117
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
823 OverlayStateData *osd = data; |
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
824 |
415 | 825 osd->imd->overlay_show_zoom = FALSE; |
826 | |
614 | 827 if (osd->show & OSD_SHOW_INFO) |
117
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
828 { |
1297 | 829 /* redraw when the image was changed, |
830 with histogram we have to redraw also when loading is finished */ | |
831 if (osd->changed_states & IMAGE_STATE_IMAGE || | |
832 (osd->changed_states & IMAGE_STATE_LOADING && osd->show & OSD_SHOW_HISTOGRAM)) | |
117
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
833 { |
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
834 GdkPixbuf *pixbuf; |
9 | 835 |
616
d9c9d05c9d4d
Move overlay histogram stuff from ImageWindow to OverlayStateData.
zas_
parents:
615
diff
changeset
|
836 pixbuf = image_osd_info_render(osd); |
410 | 837 if (pixbuf) |
117
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
838 { |
887
e418c33a49c8
Move code from image_osd_update_cb() to separate functions.
zas_
parents:
886
diff
changeset
|
839 image_osd_info_show(osd, pixbuf); |
410 | 840 g_object_unref(pixbuf); |
117
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
841 } |
887
e418c33a49c8
Move code from image_osd_update_cb() to separate functions.
zas_
parents:
886
diff
changeset
|
842 else |
117
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
843 { |
887
e418c33a49c8
Move code from image_osd_update_cb() to separate functions.
zas_
parents:
886
diff
changeset
|
844 image_osd_info_hide(osd); |
117
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
845 } |
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
846 } |
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
847 } |
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
848 else |
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
849 { |
887
e418c33a49c8
Move code from image_osd_update_cb() to separate functions.
zas_
parents:
886
diff
changeset
|
850 image_osd_info_hide(osd); |
117
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
851 } |
9 | 852 |
614 | 853 if (osd->show & OSD_SHOW_STATUS) |
117
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
854 { |
118
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
855 if (osd->changed_states & IMAGE_STATE_IMAGE) |
886 | 856 image_osd_icons_reset_time(osd); |
857 | |
118
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
858 if (osd->changed_states & IMAGE_STATE_COLOR_ADJ) |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
859 { |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
860 osd->icon_time[IMAGE_OSD_COLOR] = IMAGE_OSD_DEFAULT_DURATION + 1; |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
861 image_osd_timer_schedule(osd); |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
862 } |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
863 |
122
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
864 if (osd->changed_states & IMAGE_STATE_ROTATE_AUTO) |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
865 { |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
866 gint n = 0; |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
867 |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
868 if (osd->imd->state & IMAGE_STATE_ROTATE_AUTO) |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
869 { |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
870 n = 1; |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
871 if (!osd->imd->cm) n += IMAGE_OSD_DEFAULT_DURATION; |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
872 } |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
873 |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
874 osd->icon_time[IMAGE_OSD_ROTATE_AUTO] = n; |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
875 image_osd_timer_schedule(osd); |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
876 } |
e2a8b7f2165b
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
118
diff
changeset
|
877 |
886 | 878 image_osd_icons_update(osd); |
117
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
879 } |
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
880 else |
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
881 { |
886 | 882 image_osd_icons_hide(osd); |
117
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
883 } |
9 | 884 |
1011 | 885 if (osd->imd->il && image_loader_get_is_done(osd->imd->il)) |
273
e0e2c2b72c5a
reworked the histogram patch by Uwe Ohse, most of the code is in
nadvornik
parents:
265
diff
changeset
|
886 osd->changed_states = IMAGE_STATE_NONE; |
117
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
887 osd->idle_id = -1; |
9 | 888 return FALSE; |
889 } | |
890 | |
117
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
891 static void image_osd_update_schedule(OverlayStateData *osd, gint force) |
9 | 892 { |
117
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
893 if (force) osd->changed_states |= IMAGE_STATE_IMAGE; |
9 | 894 |
117
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
895 if (osd->idle_id == -1) |
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
896 { |
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
897 osd->idle_id = g_idle_add_full(G_PRIORITY_HIGH, image_osd_update_cb, osd, NULL); |
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
898 } |
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
899 } |
9 | 900 |
117
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
901 void image_osd_update(ImageWindow *imd) |
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
902 { |
615
cddccc89d93b
Introduce image_get_osd_data() and image_set_osd_data().
zas_
parents:
614
diff
changeset
|
903 OverlayStateData *osd = image_get_osd_data(imd); |
117
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
904 |
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
905 if (!osd) return; |
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
906 |
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
907 image_osd_update_schedule(osd, TRUE); |
9 | 908 } |
909 | |
118
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
910 static gint image_osd_timer_cb(gpointer data) |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
911 { |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
912 OverlayStateData *osd = data; |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
913 gint done = TRUE; |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
914 gint changed = FALSE; |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
915 gint i; |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
916 |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
917 for (i = 0; i < IMAGE_OSD_COUNT; i++) |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
918 { |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
919 if (osd->icon_time[i] > 1) |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
920 { |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
921 osd->icon_time[i]--; |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
922 if (osd->icon_time[i] < 2) |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
923 { |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
924 osd->icon_time[i] = 0; |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
925 changed = TRUE; |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
926 } |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
927 else |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
928 { |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
929 done = FALSE; |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
930 } |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
931 } |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
932 } |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
933 |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
934 if (changed) image_osd_update_schedule(osd, FALSE); |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
935 |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
936 if (done) |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
937 { |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
938 osd->timer_id = -1; |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
939 return FALSE; |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
940 } |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
941 |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
942 return TRUE; |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
943 } |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
944 |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
945 static void image_osd_timer_schedule(OverlayStateData *osd) |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
946 { |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
947 if (osd->timer_id == -1) |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
948 { |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
949 osd->timer_id = g_timeout_add(100, image_osd_timer_cb, osd); |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
950 } |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
951 } |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
952 |
117
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
953 static void image_osd_state_cb(ImageWindow *imd, ImageState state, gpointer data) |
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
954 { |
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
955 OverlayStateData *osd = data; |
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
956 |
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
957 osd->changed_states |= state; |
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
958 image_osd_update_schedule(osd, FALSE); |
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
959 } |
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
960 |
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
961 static void image_osd_free(OverlayStateData *osd) |
9 | 962 { |
117
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
963 if (!osd) return; |
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
964 |
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
965 if (osd->idle_id != -1) g_source_remove(osd->idle_id); |
118
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
966 if (osd->timer_id != -1) g_source_remove(osd->timer_id); |
117
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
967 |
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
968 if (osd->imd) |
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
969 { |
615
cddccc89d93b
Introduce image_get_osd_data() and image_set_osd_data().
zas_
parents:
614
diff
changeset
|
970 image_set_osd_data(osd->imd, NULL); |
117
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
971 g_signal_handler_disconnect(osd->imd->pr, osd->destroy_id); |
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
972 |
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
973 image_set_state_func(osd->imd, NULL, NULL); |
118
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
974 |
887
e418c33a49c8
Move code from image_osd_update_cb() to separate functions.
zas_
parents:
886
diff
changeset
|
975 image_osd_info_hide(osd); |
886 | 976 image_osd_icons_hide(osd); |
117
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
977 } |
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
978 |
616
d9c9d05c9d4d
Move overlay histogram stuff from ImageWindow to OverlayStateData.
zas_
parents:
615
diff
changeset
|
979 if (osd->histogram) histogram_free(osd->histogram); |
d9c9d05c9d4d
Move overlay histogram stuff from ImageWindow to OverlayStateData.
zas_
parents:
615
diff
changeset
|
980 |
117
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
981 g_free(osd); |
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
982 } |
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
983 |
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
984 static void image_osd_remove(ImageWindow *imd) |
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
985 { |
615
cddccc89d93b
Introduce image_get_osd_data() and image_set_osd_data().
zas_
parents:
614
diff
changeset
|
986 OverlayStateData *osd = image_get_osd_data(imd); |
117
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
987 |
616
d9c9d05c9d4d
Move overlay histogram stuff from ImageWindow to OverlayStateData.
zas_
parents:
615
diff
changeset
|
988 if (osd) image_osd_free(osd); |
9 | 989 } |
990 | |
117
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
991 static void image_osd_destroy_cb(GtkWidget *widget, gpointer data) |
9 | 992 { |
117
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
993 OverlayStateData *osd = data; |
9 | 994 |
117
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
995 osd->imd = NULL; |
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
996 image_osd_free(osd); |
9 | 997 } |
998 | |
614 | 999 static void image_osd_enable(ImageWindow *imd, OsdShowFlags show) |
9 | 1000 { |
615
cddccc89d93b
Introduce image_get_osd_data() and image_set_osd_data().
zas_
parents:
614
diff
changeset
|
1001 OverlayStateData *osd = image_get_osd_data(imd); |
117
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
1002 |
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
1003 if (!osd) |
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
1004 { |
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
1005 osd = g_new0(OverlayStateData, 1); |
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
1006 osd->imd = imd; |
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
1007 osd->idle_id = -1; |
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
1008 osd->timer_id = -1; |
616
d9c9d05c9d4d
Move overlay histogram stuff from ImageWindow to OverlayStateData.
zas_
parents:
615
diff
changeset
|
1009 osd->show = OSD_SHOW_NOTHING; |
1336 | 1010 osd->x = options->image_overlay.x; |
1011 osd->y = options->image_overlay.y; | |
822
df541dc41707
Allow to set image overlay info position through options:
zas_
parents:
821
diff
changeset
|
1012 |
1336 | 1013 osd->histogram = histogram_new(); |
1014 | |
117
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
1015 osd->destroy_id = g_signal_connect(G_OBJECT(imd->pr), "destroy", |
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
1016 G_CALLBACK(image_osd_destroy_cb), osd); |
615
cddccc89d93b
Introduce image_get_osd_data() and image_set_osd_data().
zas_
parents:
614
diff
changeset
|
1017 image_set_osd_data(imd, osd); |
117
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
1018 |
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
1019 image_set_state_func(osd->imd, image_osd_state_cb, osd); |
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
1020 } |
9 | 1021 |
616
d9c9d05c9d4d
Move overlay histogram stuff from ImageWindow to OverlayStateData.
zas_
parents:
615
diff
changeset
|
1022 if (show & OSD_SHOW_STATUS) |
d9c9d05c9d4d
Move overlay histogram stuff from ImageWindow to OverlayStateData.
zas_
parents:
615
diff
changeset
|
1023 image_osd_icon(imd, IMAGE_OSD_ICON, -1); |
d9c9d05c9d4d
Move overlay histogram stuff from ImageWindow to OverlayStateData.
zas_
parents:
615
diff
changeset
|
1024 |
614 | 1025 if (show != osd->show) |
1026 image_osd_update_schedule(osd, TRUE); | |
9 | 1027 |
614 | 1028 osd->show = show; |
9 | 1029 } |
1030 | |
614 | 1031 void image_osd_set(ImageWindow *imd, OsdShowFlags show) |
9 | 1032 { |
117
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
1033 if (!imd) return; |
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
1034 |
614 | 1035 image_osd_enable(imd, show); |
9 | 1036 } |
1037 | |
621 | 1038 OsdShowFlags image_osd_get(ImageWindow *imd) |
117
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
1039 { |
615
cddccc89d93b
Introduce image_get_osd_data() and image_set_osd_data().
zas_
parents:
614
diff
changeset
|
1040 OverlayStateData *osd = image_get_osd_data(imd); |
117
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
1041 |
621 | 1042 return osd ? osd->show : OSD_SHOW_NOTHING; |
117
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
1043 } |
0c2e1f0a001b
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
1044 |
1336 | 1045 Histogram *image_osd_get_histogram(ImageWindow *imd) |
1046 { | |
1047 OverlayStateData *osd = image_get_osd_data(imd); | |
1048 | |
1049 return osd ? osd->histogram : NULL; | |
1050 } | |
1051 | |
1052 void image_osd_copy_status(ImageWindow *src, ImageWindow *dest) | |
1053 { | |
1054 Histogram *h_src, *h_dest; | |
1055 image_osd_set(dest, image_osd_get(src)); | |
1056 | |
1057 h_src = image_osd_get_histogram(src); | |
1058 h_dest = image_osd_get_histogram(dest); | |
1059 | |
1060 h_dest->histogram_mode = h_src->histogram_mode; | |
1061 h_dest->histogram_channel = h_src->histogram_channel; | |
1062 | |
1063 } | |
1064 | |
118
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
1065 /* duration: |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
1066 0 = hide |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
1067 1 = show |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
1068 2+ = show for duration tenths of a second |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
1069 -1 = use default duration |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
1070 */ |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
1071 void image_osd_icon(ImageWindow *imd, ImageOSDFlag flag, gint duration) |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
1072 { |
615
cddccc89d93b
Introduce image_get_osd_data() and image_set_osd_data().
zas_
parents:
614
diff
changeset
|
1073 OverlayStateData *osd = image_get_osd_data(imd); |
118
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
1074 |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
1075 if (!osd) return; |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
1076 |
1177
5a20c47e7a14
Fix up unsigned expression always true/false warnings.
zas_
parents:
1055
diff
changeset
|
1077 if (flag >= IMAGE_OSD_COUNT) return; |
118
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
1078 if (duration < 0) duration = IMAGE_OSD_DEFAULT_DURATION; |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
1079 if (duration > 1) duration += 1; |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
1080 |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
1081 osd->icon_time[flag] = duration; |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
1082 |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
1083 image_osd_update_schedule(osd, FALSE); |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
1084 image_osd_timer_schedule(osd); |
ac0f7f942c4d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents:
117
diff
changeset
|
1085 } |
1055
1646720364cf
Adding a vim modeline to all files - patch by Klaus Ethgen
nadvornik
parents:
1011
diff
changeset
|
1086 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ |