Mercurial > hg > forks > geeqie
annotate src/image-overlay.c @ 2916:ae6cdcd69d9f default tip
Merge with upstream/master.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 14 May 2019 11:46:50 +0300 |
parents | 87242753ed2c |
children |
rev | line source |
---|---|
9 | 1 /* |
2350
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2335
diff
changeset
|
2 * Copyright (C) 2006 John Ellis |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2335
diff
changeset
|
3 * Copyright (C) 2008 - 2016 The Geeqie Team |
9 | 4 * |
5 * Author: John Ellis | |
6 * | |
2350
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2335
diff
changeset
|
7 * This program is free software; you can redistribute it and/or modify |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2335
diff
changeset
|
8 * it under the terms of the GNU General Public License as published by |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2335
diff
changeset
|
9 * the Free Software Foundation; either version 2 of the License, or |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2335
diff
changeset
|
10 * (at your option) any later version. |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2335
diff
changeset
|
11 * |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2335
diff
changeset
|
12 * This program is distributed in the hope that it will be useful, |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2335
diff
changeset
|
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2335
diff
changeset
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2335
diff
changeset
|
15 * GNU General Public License for more details. |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2335
diff
changeset
|
16 * |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2335
diff
changeset
|
17 * You should have received a copy of the GNU General Public License along |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2335
diff
changeset
|
18 * with this program; if not, write to the Free Software Foundation, Inc., |
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2335
diff
changeset
|
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
9 | 20 */ |
21 | |
281 | 22 #include "main.h" |
9 | 23 #include "image-overlay.h" |
24 | |
586
122fc2223b42
split filelist.c to filefilter.c and filedata.c
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
532
diff
changeset
|
25 #include "filedata.h" |
622
5fc535fec168
Fix display of collection in overlay info.
Laurent Monin <geeqie@norz.org>
parents:
621
diff
changeset
|
26 #include "histogram.h" |
9 | 27 #include "image.h" |
28 #include "img-view.h" | |
29 #include "layout.h" | |
2866
87242753ed2c
Ref #160: Replace print dialog by standard GTK dialog
Colin Clark <colin.clark@cclark.uk>
parents:
2794
diff
changeset
|
30 #include "osd.h" |
23
9ff428db7772
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
John Ellis <johne@verizon.net>
parents:
9
diff
changeset
|
31 #include "pixbuf-renderer.h" |
9 | 32 #include "pixbuf_util.h" |
622
5fc535fec168
Fix display of collection in overlay info.
Laurent Monin <geeqie@norz.org>
parents:
621
diff
changeset
|
33 #include "ui_fileops.h" |
1011
66037ee8b4d6
do not access image_loader directly
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
995
diff
changeset
|
34 #include "image-load.h" |
9 | 35 |
36 /* | |
37 *---------------------------------------------------------------------------- | |
38 * image overlay | |
39 *---------------------------------------------------------------------------- | |
40 */ | |
41 | |
614
e477b53a6046
image_osd_get() and image_osd_set() now uses flags.
Laurent Monin <geeqie@norz.org>
parents:
613
diff
changeset
|
42 |
117
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
43 typedef struct _OverlayStateData OverlayStateData; |
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
44 struct _OverlayStateData { |
9 | 45 ImageWindow *imd; |
117
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
46 ImageState changed_states; |
1439
bd8442811951
compute histogram in idle time
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
47 NotifyType notify; |
117
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
48 |
616
0486114b0f50
Move overlay histogram stuff from ImageWindow to OverlayStateData.
Laurent Monin <geeqie@norz.org>
parents:
615
diff
changeset
|
49 Histogram *histogram; |
0486114b0f50
Move overlay histogram stuff from ImageWindow to OverlayStateData.
Laurent Monin <geeqie@norz.org>
parents:
615
diff
changeset
|
50 |
614
e477b53a6046
image_osd_get() and image_osd_set() now uses flags.
Laurent Monin <geeqie@norz.org>
parents:
613
diff
changeset
|
51 OsdShowFlags show; |
2794
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
52 OverlayRendererFlags origin; |
117
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
53 |
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
54 gint ovl_info; |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
55 |
822
470ee217bff0
Allow to set image overlay info position through options:
Laurent Monin <geeqie@norz.org>
parents:
821
diff
changeset
|
56 gint x; |
470ee217bff0
Allow to set image overlay info position through options:
Laurent Monin <geeqie@norz.org>
parents:
821
diff
changeset
|
57 gint y; |
118
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
58 |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
59 gint icon_time[IMAGE_OSD_COUNT]; |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
60 gint icon_id[IMAGE_OSD_COUNT]; |
117
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
61 |
1523
e52aabe8fc7a
Fix up event source ids type: gint -> guint.
Laurent Monin <geeqie@norz.org>
parents:
1498
diff
changeset
|
62 guint idle_id; /* event source id */ |
e52aabe8fc7a
Fix up event source ids type: gint -> guint.
Laurent Monin <geeqie@norz.org>
parents:
1498
diff
changeset
|
63 guint timer_id; /* event source id */ |
9 | 64 gulong destroy_id; |
65 }; | |
66 | |
118
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
67 |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
68 typedef struct _OSDIcon OSDIcon; |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
69 struct _OSDIcon { |
1433
12600de4b59a
Use gboolean where applicable, minor cleanup and indentations fixes.
Laurent Monin <geeqie@norz.org>
parents:
1367
diff
changeset
|
70 gboolean reset; /* reset on new image */ |
122
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
71 gint x; /* x, y offset */ |
118
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
72 gint y; |
122
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
73 gchar *key; /* inline pixbuf */ |
118
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
74 }; |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
75 |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
76 static OSDIcon osd_icons[] = { |
122
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
77 { TRUE, 0, 0, NULL }, /* none */ |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
78 { TRUE, -10, -10, NULL }, /* auto rotated */ |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
79 { TRUE, -10, -10, NULL }, /* user rotated */ |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
80 { TRUE, -40, -10, NULL }, /* color embedded */ |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
81 { TRUE, -70, -10, NULL }, /* first image */ |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
82 { TRUE, -70, -10, NULL }, /* last image */ |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
83 { FALSE, -70, -10, NULL }, /* osd enabled */ |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
84 { FALSE, 0, 0, NULL } |
118
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
85 }; |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
86 |
117
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
87 #define OSD_DATA "overlay-data" |
9 | 88 |
118
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
89 #define IMAGE_OSD_DEFAULT_DURATION 30 |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
90 |
290
81901d728c9f
improved histogram drawing
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
281
diff
changeset
|
91 #define HISTOGRAM_HEIGHT 140 |
620
9281a39e4566
Display a simple grid with histogram.
Laurent Monin <geeqie@norz.org>
parents:
618
diff
changeset
|
92 #define HISTOGRAM_WIDTH 256 |
469
681796421193
Rename few functions and replace fullscreen info with image overlay template string.
Laurent Monin <geeqie@norz.org>
parents:
468
diff
changeset
|
93 |
481
f55cb8ad0abc
Merge view_overlay_toggle() and layout_image_overlay_toggle() into new image_osd_toggle().
Laurent Monin <geeqie@norz.org>
parents:
480
diff
changeset
|
94 static void image_osd_timer_schedule(OverlayStateData *osd); |
f55cb8ad0abc
Merge view_overlay_toggle() and layout_image_overlay_toggle() into new image_osd_toggle().
Laurent Monin <geeqie@norz.org>
parents:
480
diff
changeset
|
95 |
733
3cf9cdf1ff65
Modify set_default_image_overlay_template_string() to accept the pointer to
Laurent Monin <geeqie@norz.org>
parents:
671
diff
changeset
|
96 void set_image_overlay_template_string(gchar **template_string, const gchar *value) |
469
681796421193
Rename few functions and replace fullscreen info with image overlay template string.
Laurent Monin <geeqie@norz.org>
parents:
468
diff
changeset
|
97 { |
733
3cf9cdf1ff65
Modify set_default_image_overlay_template_string() to accept the pointer to
Laurent Monin <geeqie@norz.org>
parents:
671
diff
changeset
|
98 g_assert(template_string); |
3cf9cdf1ff65
Modify set_default_image_overlay_template_string() to accept the pointer to
Laurent Monin <geeqie@norz.org>
parents:
671
diff
changeset
|
99 |
3cf9cdf1ff65
Modify set_default_image_overlay_template_string() to accept the pointer to
Laurent Monin <geeqie@norz.org>
parents:
671
diff
changeset
|
100 g_free(*template_string); |
3cf9cdf1ff65
Modify set_default_image_overlay_template_string() to accept the pointer to
Laurent Monin <geeqie@norz.org>
parents:
671
diff
changeset
|
101 *template_string = g_strdup(value); |
3cf9cdf1ff65
Modify set_default_image_overlay_template_string() to accept the pointer to
Laurent Monin <geeqie@norz.org>
parents:
671
diff
changeset
|
102 } |
3cf9cdf1ff65
Modify set_default_image_overlay_template_string() to accept the pointer to
Laurent Monin <geeqie@norz.org>
parents:
671
diff
changeset
|
103 |
3cf9cdf1ff65
Modify set_default_image_overlay_template_string() to accept the pointer to
Laurent Monin <geeqie@norz.org>
parents:
671
diff
changeset
|
104 |
3cf9cdf1ff65
Modify set_default_image_overlay_template_string() to accept the pointer to
Laurent Monin <geeqie@norz.org>
parents:
671
diff
changeset
|
105 void set_default_image_overlay_template_string(gchar **template_string) |
3cf9cdf1ff65
Modify set_default_image_overlay_template_string() to accept the pointer to
Laurent Monin <geeqie@norz.org>
parents:
671
diff
changeset
|
106 { |
3cf9cdf1ff65
Modify set_default_image_overlay_template_string() to accept the pointer to
Laurent Monin <geeqie@norz.org>
parents:
671
diff
changeset
|
107 set_image_overlay_template_string(template_string, DEFAULT_OVERLAY_INFO); |
469
681796421193
Rename few functions and replace fullscreen info with image overlay template string.
Laurent Monin <geeqie@norz.org>
parents:
468
diff
changeset
|
108 } |
681796421193
Rename few functions and replace fullscreen info with image overlay template string.
Laurent Monin <geeqie@norz.org>
parents:
468
diff
changeset
|
109 |
2334
e38178f556f6
Image overlay configurable font
Colin Clark <cclark@mcb.net>
parents:
2228
diff
changeset
|
110 void set_image_overlay_font_string(gchar **font_string, const gchar *value) |
e38178f556f6
Image overlay configurable font
Colin Clark <cclark@mcb.net>
parents:
2228
diff
changeset
|
111 { |
e38178f556f6
Image overlay configurable font
Colin Clark <cclark@mcb.net>
parents:
2228
diff
changeset
|
112 g_assert(font_string); |
e38178f556f6
Image overlay configurable font
Colin Clark <cclark@mcb.net>
parents:
2228
diff
changeset
|
113 |
e38178f556f6
Image overlay configurable font
Colin Clark <cclark@mcb.net>
parents:
2228
diff
changeset
|
114 g_free(*font_string); |
e38178f556f6
Image overlay configurable font
Colin Clark <cclark@mcb.net>
parents:
2228
diff
changeset
|
115 *font_string = g_strdup(value); |
e38178f556f6
Image overlay configurable font
Colin Clark <cclark@mcb.net>
parents:
2228
diff
changeset
|
116 } |
e38178f556f6
Image overlay configurable font
Colin Clark <cclark@mcb.net>
parents:
2228
diff
changeset
|
117 |
615
84f0ba5ca4f1
Introduce image_get_osd_data() and image_set_osd_data().
Laurent Monin <geeqie@norz.org>
parents:
614
diff
changeset
|
118 static OverlayStateData *image_get_osd_data(ImageWindow *imd) |
84f0ba5ca4f1
Introduce image_get_osd_data() and image_set_osd_data().
Laurent Monin <geeqie@norz.org>
parents:
614
diff
changeset
|
119 { |
84f0ba5ca4f1
Introduce image_get_osd_data() and image_set_osd_data().
Laurent Monin <geeqie@norz.org>
parents:
614
diff
changeset
|
120 OverlayStateData *osd; |
84f0ba5ca4f1
Introduce image_get_osd_data() and image_set_osd_data().
Laurent Monin <geeqie@norz.org>
parents:
614
diff
changeset
|
121 |
84f0ba5ca4f1
Introduce image_get_osd_data() and image_set_osd_data().
Laurent Monin <geeqie@norz.org>
parents:
614
diff
changeset
|
122 if (!imd) return NULL; |
84f0ba5ca4f1
Introduce image_get_osd_data() and image_set_osd_data().
Laurent Monin <geeqie@norz.org>
parents:
614
diff
changeset
|
123 |
84f0ba5ca4f1
Introduce image_get_osd_data() and image_set_osd_data().
Laurent Monin <geeqie@norz.org>
parents:
614
diff
changeset
|
124 g_assert(imd->pr); |
84f0ba5ca4f1
Introduce image_get_osd_data() and image_set_osd_data().
Laurent Monin <geeqie@norz.org>
parents:
614
diff
changeset
|
125 |
84f0ba5ca4f1
Introduce image_get_osd_data() and image_set_osd_data().
Laurent Monin <geeqie@norz.org>
parents:
614
diff
changeset
|
126 osd = g_object_get_data(G_OBJECT(imd->pr), "IMAGE_OVERLAY_DATA"); |
84f0ba5ca4f1
Introduce image_get_osd_data() and image_set_osd_data().
Laurent Monin <geeqie@norz.org>
parents:
614
diff
changeset
|
127 return osd; |
84f0ba5ca4f1
Introduce image_get_osd_data() and image_set_osd_data().
Laurent Monin <geeqie@norz.org>
parents:
614
diff
changeset
|
128 } |
84f0ba5ca4f1
Introduce image_get_osd_data() and image_set_osd_data().
Laurent Monin <geeqie@norz.org>
parents:
614
diff
changeset
|
129 |
84f0ba5ca4f1
Introduce image_get_osd_data() and image_set_osd_data().
Laurent Monin <geeqie@norz.org>
parents:
614
diff
changeset
|
130 static void image_set_osd_data(ImageWindow *imd, OverlayStateData *osd) |
84f0ba5ca4f1
Introduce image_get_osd_data() and image_set_osd_data().
Laurent Monin <geeqie@norz.org>
parents:
614
diff
changeset
|
131 { |
84f0ba5ca4f1
Introduce image_get_osd_data() and image_set_osd_data().
Laurent Monin <geeqie@norz.org>
parents:
614
diff
changeset
|
132 g_assert(imd); |
84f0ba5ca4f1
Introduce image_get_osd_data() and image_set_osd_data().
Laurent Monin <geeqie@norz.org>
parents:
614
diff
changeset
|
133 g_assert(imd->pr); |
84f0ba5ca4f1
Introduce image_get_osd_data() and image_set_osd_data().
Laurent Monin <geeqie@norz.org>
parents:
614
diff
changeset
|
134 g_object_set_data(G_OBJECT(imd->pr), "IMAGE_OVERLAY_DATA", osd); |
84f0ba5ca4f1
Introduce image_get_osd_data() and image_set_osd_data().
Laurent Monin <geeqie@norz.org>
parents:
614
diff
changeset
|
135 } |
84f0ba5ca4f1
Introduce image_get_osd_data() and image_set_osd_data().
Laurent Monin <geeqie@norz.org>
parents:
614
diff
changeset
|
136 |
273
aedbff4f5d0d
reworked the histogram patch by Uwe Ohse, most of the code is in
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
265
diff
changeset
|
137 /* |
aedbff4f5d0d
reworked the histogram patch by Uwe Ohse, most of the code is in
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
265
diff
changeset
|
138 *---------------------------------------------------------------------------- |
aedbff4f5d0d
reworked the histogram patch by Uwe Ohse, most of the code is in
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
265
diff
changeset
|
139 * image histogram |
aedbff4f5d0d
reworked the histogram patch by Uwe Ohse, most of the code is in
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
265
diff
changeset
|
140 *---------------------------------------------------------------------------- |
aedbff4f5d0d
reworked the histogram patch by Uwe Ohse, most of the code is in
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
265
diff
changeset
|
141 */ |
aedbff4f5d0d
reworked the histogram patch by Uwe Ohse, most of the code is in
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
265
diff
changeset
|
142 |
aedbff4f5d0d
reworked the histogram patch by Uwe Ohse, most of the code is in
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
265
diff
changeset
|
143 |
1665
455ed93cdbd6
improved overlay menu
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1523
diff
changeset
|
144 void image_osd_histogram_toggle_channel(ImageWindow *imd) |
273
aedbff4f5d0d
reworked the histogram patch by Uwe Ohse, most of the code is in
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
265
diff
changeset
|
145 { |
616
0486114b0f50
Move overlay histogram stuff from ImageWindow to OverlayStateData.
Laurent Monin <geeqie@norz.org>
parents:
615
diff
changeset
|
146 OverlayStateData *osd = image_get_osd_data(imd); |
613
6fb8126eaac0
image_osd_histogram_chan_toggle(), image_osd_histogram_log_toggle():
Laurent Monin <geeqie@norz.org>
parents:
586
diff
changeset
|
147 |
616
0486114b0f50
Move overlay histogram stuff from ImageWindow to OverlayStateData.
Laurent Monin <geeqie@norz.org>
parents:
615
diff
changeset
|
148 if (!osd || !osd->histogram) return; |
0486114b0f50
Move overlay histogram stuff from ImageWindow to OverlayStateData.
Laurent Monin <geeqie@norz.org>
parents:
615
diff
changeset
|
149 |
1312
5fb01a6ee761
Introduce helpers histogram_toggle_channel() and histogram_toggle_mode().
Laurent Monin <geeqie@norz.org>
parents:
1302
diff
changeset
|
150 histogram_toggle_channel(osd->histogram); |
613
6fb8126eaac0
image_osd_histogram_chan_toggle(), image_osd_histogram_log_toggle():
Laurent Monin <geeqie@norz.org>
parents:
586
diff
changeset
|
151 image_osd_update(imd); |
273
aedbff4f5d0d
reworked the histogram patch by Uwe Ohse, most of the code is in
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
265
diff
changeset
|
152 } |
aedbff4f5d0d
reworked the histogram patch by Uwe Ohse, most of the code is in
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
265
diff
changeset
|
153 |
1665
455ed93cdbd6
improved overlay menu
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1523
diff
changeset
|
154 void image_osd_histogram_toggle_mode(ImageWindow *imd) |
273
aedbff4f5d0d
reworked the histogram patch by Uwe Ohse, most of the code is in
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
265
diff
changeset
|
155 { |
616
0486114b0f50
Move overlay histogram stuff from ImageWindow to OverlayStateData.
Laurent Monin <geeqie@norz.org>
parents:
615
diff
changeset
|
156 OverlayStateData *osd = image_get_osd_data(imd); |
613
6fb8126eaac0
image_osd_histogram_chan_toggle(), image_osd_histogram_log_toggle():
Laurent Monin <geeqie@norz.org>
parents:
586
diff
changeset
|
157 |
616
0486114b0f50
Move overlay histogram stuff from ImageWindow to OverlayStateData.
Laurent Monin <geeqie@norz.org>
parents:
615
diff
changeset
|
158 if (!osd || !osd->histogram) return; |
0486114b0f50
Move overlay histogram stuff from ImageWindow to OverlayStateData.
Laurent Monin <geeqie@norz.org>
parents:
615
diff
changeset
|
159 |
1312
5fb01a6ee761
Introduce helpers histogram_toggle_channel() and histogram_toggle_mode().
Laurent Monin <geeqie@norz.org>
parents:
1302
diff
changeset
|
160 histogram_toggle_mode(osd->histogram); |
613
6fb8126eaac0
image_osd_histogram_chan_toggle(), image_osd_histogram_log_toggle():
Laurent Monin <geeqie@norz.org>
parents:
586
diff
changeset
|
161 image_osd_update(imd); |
273
aedbff4f5d0d
reworked the histogram patch by Uwe Ohse, most of the code is in
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
265
diff
changeset
|
162 } |
aedbff4f5d0d
reworked the histogram patch by Uwe Ohse, most of the code is in
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
265
diff
changeset
|
163 |
1665
455ed93cdbd6
improved overlay menu
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1523
diff
changeset
|
164 void image_osd_histogram_set_channel(ImageWindow *imd, gint chan) |
455ed93cdbd6
improved overlay menu
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1523
diff
changeset
|
165 { |
455ed93cdbd6
improved overlay menu
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1523
diff
changeset
|
166 OverlayStateData *osd = image_get_osd_data(imd); |
455ed93cdbd6
improved overlay menu
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1523
diff
changeset
|
167 |
455ed93cdbd6
improved overlay menu
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1523
diff
changeset
|
168 if (!osd || !osd->histogram) return; |
455ed93cdbd6
improved overlay menu
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1523
diff
changeset
|
169 |
455ed93cdbd6
improved overlay menu
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1523
diff
changeset
|
170 histogram_set_channel(osd->histogram, chan); |
455ed93cdbd6
improved overlay menu
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1523
diff
changeset
|
171 image_osd_update(imd); |
455ed93cdbd6
improved overlay menu
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1523
diff
changeset
|
172 } |
455ed93cdbd6
improved overlay menu
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1523
diff
changeset
|
173 |
455ed93cdbd6
improved overlay menu
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1523
diff
changeset
|
174 void image_osd_histogram_set_mode(ImageWindow *imd, gint mode) |
455ed93cdbd6
improved overlay menu
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1523
diff
changeset
|
175 { |
455ed93cdbd6
improved overlay menu
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1523
diff
changeset
|
176 OverlayStateData *osd = image_get_osd_data(imd); |
455ed93cdbd6
improved overlay menu
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1523
diff
changeset
|
177 |
455ed93cdbd6
improved overlay menu
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1523
diff
changeset
|
178 if (!osd || !osd->histogram) return; |
455ed93cdbd6
improved overlay menu
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1523
diff
changeset
|
179 |
455ed93cdbd6
improved overlay menu
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1523
diff
changeset
|
180 histogram_set_mode(osd->histogram, mode); |
455ed93cdbd6
improved overlay menu
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1523
diff
changeset
|
181 image_osd_update(imd); |
455ed93cdbd6
improved overlay menu
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1523
diff
changeset
|
182 } |
455ed93cdbd6
improved overlay menu
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1523
diff
changeset
|
183 |
455ed93cdbd6
improved overlay menu
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1523
diff
changeset
|
184 gint image_osd_histogram_get_channel(ImageWindow *imd) |
455ed93cdbd6
improved overlay menu
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1523
diff
changeset
|
185 { |
455ed93cdbd6
improved overlay menu
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1523
diff
changeset
|
186 OverlayStateData *osd = image_get_osd_data(imd); |
455ed93cdbd6
improved overlay menu
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1523
diff
changeset
|
187 |
455ed93cdbd6
improved overlay menu
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1523
diff
changeset
|
188 if (!osd || !osd->histogram) return HCHAN_DEFAULT; |
455ed93cdbd6
improved overlay menu
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1523
diff
changeset
|
189 |
455ed93cdbd6
improved overlay menu
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1523
diff
changeset
|
190 return histogram_get_channel(osd->histogram); |
455ed93cdbd6
improved overlay menu
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1523
diff
changeset
|
191 } |
455ed93cdbd6
improved overlay menu
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1523
diff
changeset
|
192 |
455ed93cdbd6
improved overlay menu
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1523
diff
changeset
|
193 gint image_osd_histogram_get_mode(ImageWindow *imd) |
455ed93cdbd6
improved overlay menu
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1523
diff
changeset
|
194 { |
455ed93cdbd6
improved overlay menu
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1523
diff
changeset
|
195 OverlayStateData *osd = image_get_osd_data(imd); |
455ed93cdbd6
improved overlay menu
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1523
diff
changeset
|
196 |
455ed93cdbd6
improved overlay menu
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1523
diff
changeset
|
197 if (!osd || !osd->histogram) return 0; |
455ed93cdbd6
improved overlay menu
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1523
diff
changeset
|
198 |
455ed93cdbd6
improved overlay menu
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1523
diff
changeset
|
199 return histogram_get_mode(osd->histogram); |
455ed93cdbd6
improved overlay menu
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1523
diff
changeset
|
200 } |
455ed93cdbd6
improved overlay menu
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1523
diff
changeset
|
201 |
481
f55cb8ad0abc
Merge view_overlay_toggle() and layout_image_overlay_toggle() into new image_osd_toggle().
Laurent Monin <geeqie@norz.org>
parents:
480
diff
changeset
|
202 void image_osd_toggle(ImageWindow *imd) |
f55cb8ad0abc
Merge view_overlay_toggle() and layout_image_overlay_toggle() into new image_osd_toggle().
Laurent Monin <geeqie@norz.org>
parents:
480
diff
changeset
|
203 { |
1447
1a49a4b440cc
fixed segfault in osd called from img-view
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1440
diff
changeset
|
204 OsdShowFlags show; |
503
0cbad6f87eb6
Fix image overlay displayed only on second "I" press in layout view.
Laurent Monin <geeqie@norz.org>
parents:
483
diff
changeset
|
205 |
616
0486114b0f50
Move overlay histogram stuff from ImageWindow to OverlayStateData.
Laurent Monin <geeqie@norz.org>
parents:
615
diff
changeset
|
206 if (!imd) return; |
0486114b0f50
Move overlay histogram stuff from ImageWindow to OverlayStateData.
Laurent Monin <geeqie@norz.org>
parents:
615
diff
changeset
|
207 |
1447
1a49a4b440cc
fixed segfault in osd called from img-view
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1440
diff
changeset
|
208 show = image_osd_get(imd); |
1a49a4b440cc
fixed segfault in osd called from img-view
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1440
diff
changeset
|
209 if (show == OSD_SHOW_NOTHING) |
481
f55cb8ad0abc
Merge view_overlay_toggle() and layout_image_overlay_toggle() into new image_osd_toggle().
Laurent Monin <geeqie@norz.org>
parents:
480
diff
changeset
|
210 { |
616
0486114b0f50
Move overlay histogram stuff from ImageWindow to OverlayStateData.
Laurent Monin <geeqie@norz.org>
parents:
615
diff
changeset
|
211 image_osd_set(imd, OSD_SHOW_INFO | OSD_SHOW_STATUS); |
0486114b0f50
Move overlay histogram stuff from ImageWindow to OverlayStateData.
Laurent Monin <geeqie@norz.org>
parents:
615
diff
changeset
|
212 return; |
0486114b0f50
Move overlay histogram stuff from ImageWindow to OverlayStateData.
Laurent Monin <geeqie@norz.org>
parents:
615
diff
changeset
|
213 } |
1336
7fe7536f02e1
fixed overlay configuration
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1329
diff
changeset
|
214 else |
616
0486114b0f50
Move overlay histogram stuff from ImageWindow to OverlayStateData.
Laurent Monin <geeqie@norz.org>
parents:
615
diff
changeset
|
215 { |
2794
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
216 if (show & OSD_SHOW_GUIDELINES) |
481
f55cb8ad0abc
Merge view_overlay_toggle() and layout_image_overlay_toggle() into new image_osd_toggle().
Laurent Monin <geeqie@norz.org>
parents:
480
diff
changeset
|
217 { |
616
0486114b0f50
Move overlay histogram stuff from ImageWindow to OverlayStateData.
Laurent Monin <geeqie@norz.org>
parents:
615
diff
changeset
|
218 image_osd_set(imd, OSD_SHOW_NOTHING); |
481
f55cb8ad0abc
Merge view_overlay_toggle() and layout_image_overlay_toggle() into new image_osd_toggle().
Laurent Monin <geeqie@norz.org>
parents:
480
diff
changeset
|
219 } |
2794
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
220 else if (show & OSD_SHOW_HISTOGRAM) |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
221 { |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
222 image_osd_set(imd, OSD_SHOW_GUIDELINES); |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
223 image_osd_set(imd, show | ~OSD_SHOW_HISTOGRAM); |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
224 } |
481
f55cb8ad0abc
Merge view_overlay_toggle() and layout_image_overlay_toggle() into new image_osd_toggle().
Laurent Monin <geeqie@norz.org>
parents:
480
diff
changeset
|
225 else |
f55cb8ad0abc
Merge view_overlay_toggle() and layout_image_overlay_toggle() into new image_osd_toggle().
Laurent Monin <geeqie@norz.org>
parents:
480
diff
changeset
|
226 { |
1447
1a49a4b440cc
fixed segfault in osd called from img-view
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1440
diff
changeset
|
227 image_osd_set(imd, show | OSD_SHOW_HISTOGRAM); |
481
f55cb8ad0abc
Merge view_overlay_toggle() and layout_image_overlay_toggle() into new image_osd_toggle().
Laurent Monin <geeqie@norz.org>
parents:
480
diff
changeset
|
228 } |
f55cb8ad0abc
Merge view_overlay_toggle() and layout_image_overlay_toggle() into new image_osd_toggle().
Laurent Monin <geeqie@norz.org>
parents:
480
diff
changeset
|
229 } |
f55cb8ad0abc
Merge view_overlay_toggle() and layout_image_overlay_toggle() into new image_osd_toggle().
Laurent Monin <geeqie@norz.org>
parents:
480
diff
changeset
|
230 } |
118
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
231 |
616
0486114b0f50
Move overlay histogram stuff from ImageWindow to OverlayStateData.
Laurent Monin <geeqie@norz.org>
parents:
615
diff
changeset
|
232 static GdkPixbuf *image_osd_info_render(OverlayStateData *osd) |
9 | 233 { |
410
8b0b92beb720
Fix OSD display when fullscreen info string is empty.
Laurent Monin <geeqie@norz.org>
parents:
322
diff
changeset
|
234 GdkPixbuf *pixbuf = NULL; |
9 | 235 gint width, height; |
236 PangoLayout *layout; | |
237 const gchar *name; | |
275
0c872187d982
fixed histogram label
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
273
diff
changeset
|
238 gchar *text; |
860
8003beb6ef8c
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
Laurent Monin <geeqie@norz.org>
parents:
857
diff
changeset
|
239 gboolean with_hist; |
2124 | 240 const HistMap *histmap = NULL; |
995 | 241 ImageWindow *imd = osd->imd; |
617
b657a018d87b
image_osd_info_render(): if there's no fd, just return.
Laurent Monin <geeqie@norz.org>
parents:
616
diff
changeset
|
242 FileData *fd = image_get_fd(imd); |
2334
e38178f556f6
Image overlay configurable font
Colin Clark <cclark@mcb.net>
parents:
2228
diff
changeset
|
243 PangoFontDescription *font_desc; |
617
b657a018d87b
image_osd_info_render(): if there's no fd, just return.
Laurent Monin <geeqie@norz.org>
parents:
616
diff
changeset
|
244 |
b657a018d87b
image_osd_info_render(): if there's no fd, just return.
Laurent Monin <geeqie@norz.org>
parents:
616
diff
changeset
|
245 if (!fd) return NULL; |
218
9ec9947e7682
Customizable info overlay in fullscreen, based on the patch posted to gqview-devel list by Timo on 2007-09-10.
Laurent Monin <geeqie@norz.org>
parents:
216
diff
changeset
|
246 |
9 | 247 name = image_get_name(imd); |
248 if (name) | |
249 { | |
860
8003beb6ef8c
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
Laurent Monin <geeqie@norz.org>
parents:
857
diff
changeset
|
250 gint n, t; |
8003beb6ef8c
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
Laurent Monin <geeqie@norz.org>
parents:
857
diff
changeset
|
251 CollectionData *cd; |
8003beb6ef8c
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
Laurent Monin <geeqie@norz.org>
parents:
857
diff
changeset
|
252 CollectInfo *info; |
8003beb6ef8c
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
Laurent Monin <geeqie@norz.org>
parents:
857
diff
changeset
|
253 GHashTable *vars; |
861
e4ea72a989ec
image_osd_info_render(): ensure values are always escaped before using pango_layout_set_markup().
Laurent Monin <geeqie@norz.org>
parents:
860
diff
changeset
|
254 |
860
8003beb6ef8c
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
Laurent Monin <geeqie@norz.org>
parents:
857
diff
changeset
|
255 vars = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, g_free); |
9 | 256 |
860
8003beb6ef8c
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
Laurent Monin <geeqie@norz.org>
parents:
857
diff
changeset
|
257 cd = image_get_collection(imd, &info); |
8003beb6ef8c
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
Laurent Monin <geeqie@norz.org>
parents:
857
diff
changeset
|
258 if (cd) |
622
5fc535fec168
Fix display of collection in overlay info.
Laurent Monin <geeqie@norz.org>
parents:
621
diff
changeset
|
259 { |
860
8003beb6ef8c
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
Laurent Monin <geeqie@norz.org>
parents:
857
diff
changeset
|
260 t = g_list_length(cd->list); |
8003beb6ef8c
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
Laurent Monin <geeqie@norz.org>
parents:
857
diff
changeset
|
261 n = g_list_index(cd->list, info) + 1; |
8003beb6ef8c
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
Laurent Monin <geeqie@norz.org>
parents:
857
diff
changeset
|
262 if (cd->name) |
9 | 263 { |
860
8003beb6ef8c
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
Laurent Monin <geeqie@norz.org>
parents:
857
diff
changeset
|
264 if (file_extension_match(cd->name, GQ_COLLECTION_EXT)) |
862
2193ea101ec3
osd_template_insert(): optimize and simplify using flags.
Laurent Monin <geeqie@norz.org>
parents:
861
diff
changeset
|
265 osd_template_insert(vars, "collection", remove_extension_from_path(cd->name), OSDT_FREE); |
860
8003beb6ef8c
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
Laurent Monin <geeqie@norz.org>
parents:
857
diff
changeset
|
266 else |
862
2193ea101ec3
osd_template_insert(): optimize and simplify using flags.
Laurent Monin <geeqie@norz.org>
parents:
861
diff
changeset
|
267 osd_template_insert(vars, "collection", cd->name, OSDT_NONE); |
9 | 268 } |
269 else | |
270 { | |
862
2193ea101ec3
osd_template_insert(): optimize and simplify using flags.
Laurent Monin <geeqie@norz.org>
parents:
861
diff
changeset
|
271 osd_template_insert(vars, "collection", _("Untitled"), OSDT_NONE); |
9 | 272 } |
273 } | |
274 else | |
275 { | |
860
8003beb6ef8c
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
Laurent Monin <geeqie@norz.org>
parents:
857
diff
changeset
|
276 LayoutWindow *lw = layout_find_by_image(imd); |
8003beb6ef8c
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
Laurent Monin <geeqie@norz.org>
parents:
857
diff
changeset
|
277 if (lw) |
8003beb6ef8c
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
Laurent Monin <geeqie@norz.org>
parents:
857
diff
changeset
|
278 { |
8003beb6ef8c
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
Laurent Monin <geeqie@norz.org>
parents:
857
diff
changeset
|
279 if (lw->slideshow) |
8003beb6ef8c
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
Laurent Monin <geeqie@norz.org>
parents:
857
diff
changeset
|
280 { |
8003beb6ef8c
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
Laurent Monin <geeqie@norz.org>
parents:
857
diff
changeset
|
281 n = g_list_length(lw->slideshow->list_done); |
8003beb6ef8c
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
Laurent Monin <geeqie@norz.org>
parents:
857
diff
changeset
|
282 t = n + g_list_length(lw->slideshow->list); |
8003beb6ef8c
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
Laurent Monin <geeqie@norz.org>
parents:
857
diff
changeset
|
283 if (n == 0) n = t; |
8003beb6ef8c
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
Laurent Monin <geeqie@norz.org>
parents:
857
diff
changeset
|
284 } |
8003beb6ef8c
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
Laurent Monin <geeqie@norz.org>
parents:
857
diff
changeset
|
285 else |
8003beb6ef8c
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
Laurent Monin <geeqie@norz.org>
parents:
857
diff
changeset
|
286 { |
8003beb6ef8c
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
Laurent Monin <geeqie@norz.org>
parents:
857
diff
changeset
|
287 t = layout_list_count(lw, NULL); |
8003beb6ef8c
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
Laurent Monin <geeqie@norz.org>
parents:
857
diff
changeset
|
288 n = layout_list_get_index(lw, image_get_fd(lw->image)) + 1; |
8003beb6ef8c
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
Laurent Monin <geeqie@norz.org>
parents:
857
diff
changeset
|
289 } |
8003beb6ef8c
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
Laurent Monin <geeqie@norz.org>
parents:
857
diff
changeset
|
290 } |
8003beb6ef8c
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
Laurent Monin <geeqie@norz.org>
parents:
857
diff
changeset
|
291 else if (view_window_find_image(imd, &n, &t)) |
8003beb6ef8c
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
Laurent Monin <geeqie@norz.org>
parents:
857
diff
changeset
|
292 { |
8003beb6ef8c
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
Laurent Monin <geeqie@norz.org>
parents:
857
diff
changeset
|
293 n++; |
8003beb6ef8c
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
Laurent Monin <geeqie@norz.org>
parents:
857
diff
changeset
|
294 } |
8003beb6ef8c
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
Laurent Monin <geeqie@norz.org>
parents:
857
diff
changeset
|
295 else |
8003beb6ef8c
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
Laurent Monin <geeqie@norz.org>
parents:
857
diff
changeset
|
296 { |
8003beb6ef8c
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
Laurent Monin <geeqie@norz.org>
parents:
857
diff
changeset
|
297 t = 1; |
8003beb6ef8c
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
Laurent Monin <geeqie@norz.org>
parents:
857
diff
changeset
|
298 n = 1; |
8003beb6ef8c
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
Laurent Monin <geeqie@norz.org>
parents:
857
diff
changeset
|
299 } |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
300 |
860
8003beb6ef8c
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
Laurent Monin <geeqie@norz.org>
parents:
857
diff
changeset
|
301 if (n < 1) n = 1; |
8003beb6ef8c
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
Laurent Monin <geeqie@norz.org>
parents:
857
diff
changeset
|
302 if (t < 1) t = 1; |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
303 |
862
2193ea101ec3
osd_template_insert(): optimize and simplify using flags.
Laurent Monin <geeqie@norz.org>
parents:
861
diff
changeset
|
304 osd_template_insert(vars, "collection", NULL, OSDT_NONE); |
860
8003beb6ef8c
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
Laurent Monin <geeqie@norz.org>
parents:
857
diff
changeset
|
305 } |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
306 |
862
2193ea101ec3
osd_template_insert(): optimize and simplify using flags.
Laurent Monin <geeqie@norz.org>
parents:
861
diff
changeset
|
307 osd_template_insert(vars, "number", g_strdup_printf("%d", n), OSDT_NO_DUP); |
2193ea101ec3
osd_template_insert(): optimize and simplify using flags.
Laurent Monin <geeqie@norz.org>
parents:
861
diff
changeset
|
308 osd_template_insert(vars, "total", g_strdup_printf("%d", t), OSDT_NO_DUP); |
2193ea101ec3
osd_template_insert(): optimize and simplify using flags.
Laurent Monin <geeqie@norz.org>
parents:
861
diff
changeset
|
309 osd_template_insert(vars, "name", (gchar *) name, OSDT_NONE); |
995 | 310 osd_template_insert(vars, "date", imd->image_fd ? ((gchar *) text_from_time(imd->image_fd->date)) : "", OSDT_NONE); |
888
626822338b41
reload changed images
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
887
diff
changeset
|
311 osd_template_insert(vars, "size", imd->image_fd ? (text_from_size_abrev(imd->image_fd->size)) : g_strdup(""), OSDT_FREE); |
862
2193ea101ec3
osd_template_insert(): optimize and simplify using flags.
Laurent Monin <geeqie@norz.org>
parents:
861
diff
changeset
|
312 osd_template_insert(vars, "zoom", image_zoom_get_as_text(imd), OSDT_FREE); |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
313 |
860
8003beb6ef8c
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
Laurent Monin <geeqie@norz.org>
parents:
857
diff
changeset
|
314 if (!imd->unknown) |
8003beb6ef8c
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
Laurent Monin <geeqie@norz.org>
parents:
857
diff
changeset
|
315 { |
8003beb6ef8c
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
Laurent Monin <geeqie@norz.org>
parents:
857
diff
changeset
|
316 gint w, h; |
1011
66037ee8b4d6
do not access image_loader directly
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
995
diff
changeset
|
317 GdkPixbuf *load_pixbuf = image_loader_get_pixbuf(imd->il); |
442 | 318 |
860
8003beb6ef8c
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
Laurent Monin <geeqie@norz.org>
parents:
857
diff
changeset
|
319 if (imd->delay_flip && |
1011
66037ee8b4d6
do not access image_loader directly
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
995
diff
changeset
|
320 imd->il && load_pixbuf && |
66037ee8b4d6
do not access image_loader directly
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
995
diff
changeset
|
321 image_get_pixbuf(imd) != load_pixbuf) |
860
8003beb6ef8c
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
Laurent Monin <geeqie@norz.org>
parents:
857
diff
changeset
|
322 { |
1011
66037ee8b4d6
do not access image_loader directly
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
995
diff
changeset
|
323 w = gdk_pixbuf_get_width(load_pixbuf); |
66037ee8b4d6
do not access image_loader directly
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
995
diff
changeset
|
324 h = gdk_pixbuf_get_height(load_pixbuf); |
860
8003beb6ef8c
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
Laurent Monin <geeqie@norz.org>
parents:
857
diff
changeset
|
325 } |
8003beb6ef8c
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
Laurent Monin <geeqie@norz.org>
parents:
857
diff
changeset
|
326 else |
8003beb6ef8c
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
Laurent Monin <geeqie@norz.org>
parents:
857
diff
changeset
|
327 { |
8003beb6ef8c
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
Laurent Monin <geeqie@norz.org>
parents:
857
diff
changeset
|
328 image_get_image_size(imd, &w, &h); |
8003beb6ef8c
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
Laurent Monin <geeqie@norz.org>
parents:
857
diff
changeset
|
329 } |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
330 |
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
331 |
862
2193ea101ec3
osd_template_insert(): optimize and simplify using flags.
Laurent Monin <geeqie@norz.org>
parents:
861
diff
changeset
|
332 osd_template_insert(vars, "width", g_strdup_printf("%d", w), OSDT_NO_DUP); |
2193ea101ec3
osd_template_insert(): optimize and simplify using flags.
Laurent Monin <geeqie@norz.org>
parents:
861
diff
changeset
|
333 osd_template_insert(vars, "height", g_strdup_printf("%d", h), OSDT_NO_DUP); |
2193ea101ec3
osd_template_insert(): optimize and simplify using flags.
Laurent Monin <geeqie@norz.org>
parents:
861
diff
changeset
|
334 osd_template_insert(vars, "res", g_strdup_printf("%d × %d", w, h), OSDT_FREE); |
860
8003beb6ef8c
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
Laurent Monin <geeqie@norz.org>
parents:
857
diff
changeset
|
335 } |
861
e4ea72a989ec
image_osd_info_render(): ensure values are always escaped before using pango_layout_set_markup().
Laurent Monin <geeqie@norz.org>
parents:
860
diff
changeset
|
336 else |
e4ea72a989ec
image_osd_info_render(): ensure values are always escaped before using pango_layout_set_markup().
Laurent Monin <geeqie@norz.org>
parents:
860
diff
changeset
|
337 { |
862
2193ea101ec3
osd_template_insert(): optimize and simplify using flags.
Laurent Monin <geeqie@norz.org>
parents:
861
diff
changeset
|
338 osd_template_insert(vars, "width", NULL, OSDT_NONE); |
2193ea101ec3
osd_template_insert(): optimize and simplify using flags.
Laurent Monin <geeqie@norz.org>
parents:
861
diff
changeset
|
339 osd_template_insert(vars, "height", NULL, OSDT_NONE); |
2193ea101ec3
osd_template_insert(): optimize and simplify using flags.
Laurent Monin <geeqie@norz.org>
parents:
861
diff
changeset
|
340 osd_template_insert(vars, "res", NULL, OSDT_NONE); |
861
e4ea72a989ec
image_osd_info_render(): ensure values are always escaped before using pango_layout_set_markup().
Laurent Monin <geeqie@norz.org>
parents:
860
diff
changeset
|
341 } |
e4ea72a989ec
image_osd_info_render(): ensure values are always escaped before using pango_layout_set_markup().
Laurent Monin <geeqie@norz.org>
parents:
860
diff
changeset
|
342 |
2866
87242753ed2c
Ref #160: Replace print dialog by standard GTK dialog
Colin Clark <colin.clark@cclark.uk>
parents:
2794
diff
changeset
|
343 text = image_osd_mkinfo(options->image_overlay.template_string, imd->image_fd, vars); |
860
8003beb6ef8c
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
Laurent Monin <geeqie@norz.org>
parents:
857
diff
changeset
|
344 g_hash_table_destroy(vars); |
415
7c97f17797f5
Add zoom ratio display to OSD in fullscreen mode.
Laurent Monin <geeqie@norz.org>
parents:
411
diff
changeset
|
345 |
860
8003beb6ef8c
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
Laurent Monin <geeqie@norz.org>
parents:
857
diff
changeset
|
346 } else { |
8003beb6ef8c
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
Laurent Monin <geeqie@norz.org>
parents:
857
diff
changeset
|
347 /* When does this occur ?? */ |
861
e4ea72a989ec
image_osd_info_render(): ensure values are always escaped before using pango_layout_set_markup().
Laurent Monin <geeqie@norz.org>
parents:
860
diff
changeset
|
348 text = g_markup_escape_text(_("Untitled"), -1); |
860
8003beb6ef8c
image_osd_info_render(): code cleanup and simplification, drop some useless memory allocations.
Laurent Monin <geeqie@norz.org>
parents:
857
diff
changeset
|
349 } |
132
b025afc3c92a
First implementation of marks for all photos.
Petr Ostadal <postadal@suse.cz>
parents:
122
diff
changeset
|
350 |
1294 | 351 with_hist = ((osd->show & OSD_SHOW_HISTOGRAM) && osd->histogram); |
352 if (with_hist) | |
353 { | |
354 histmap = histmap_get(imd->image_fd); | |
2184 | 355 if (!histmap) |
1439
bd8442811951
compute histogram in idle time
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
356 { |
bd8442811951
compute histogram in idle time
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
357 histmap_start_idle(imd->image_fd); |
bd8442811951
compute histogram in idle time
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
358 with_hist = FALSE; |
bd8442811951
compute histogram in idle time
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
359 } |
1294 | 360 } |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
361 |
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
362 |
133 | 363 { |
265
f5b5a4c652c7
Fix a segfault on fullscreen file deletion reported by Frédéric Mantegazza.
Laurent Monin <geeqie@norz.org>
parents:
263
diff
changeset
|
364 gint active_marks = 0; |
f5b5a4c652c7
Fix a segfault on fullscreen file deletion reported by Frédéric Mantegazza.
Laurent Monin <geeqie@norz.org>
parents:
263
diff
changeset
|
365 gint mark; |
275
0c872187d982
fixed histogram label
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
273
diff
changeset
|
366 gchar *text2; |
263
bf48762c4080
Display marks in overlay info only if at least one is set.
Laurent Monin <geeqie@norz.org>
parents:
245
diff
changeset
|
367 |
442 | 368 for (mark = 0; mark < FILEDATA_MARKS_SIZE; mark++) |
263
bf48762c4080
Display marks in overlay info only if at least one is set.
Laurent Monin <geeqie@norz.org>
parents:
245
diff
changeset
|
369 { |
800
b8a707a3e66e
various notification improvements
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
783
diff
changeset
|
370 active_marks += file_data_get_mark(fd, mark); |
265
f5b5a4c652c7
Fix a segfault on fullscreen file deletion reported by Frédéric Mantegazza.
Laurent Monin <geeqie@norz.org>
parents:
263
diff
changeset
|
371 } |
263
bf48762c4080
Display marks in overlay info only if at least one is set.
Laurent Monin <geeqie@norz.org>
parents:
245
diff
changeset
|
372 |
265
f5b5a4c652c7
Fix a segfault on fullscreen file deletion reported by Frédéric Mantegazza.
Laurent Monin <geeqie@norz.org>
parents:
263
diff
changeset
|
373 if (active_marks > 0) |
f5b5a4c652c7
Fix a segfault on fullscreen file deletion reported by Frédéric Mantegazza.
Laurent Monin <geeqie@norz.org>
parents:
263
diff
changeset
|
374 { |
f5b5a4c652c7
Fix a segfault on fullscreen file deletion reported by Frédéric Mantegazza.
Laurent Monin <geeqie@norz.org>
parents:
263
diff
changeset
|
375 GString *buf = g_string_sized_new(FILEDATA_MARKS_SIZE * 2); |
442 | 376 |
377 for (mark = 0; mark < FILEDATA_MARKS_SIZE; mark++) | |
265
f5b5a4c652c7
Fix a segfault on fullscreen file deletion reported by Frédéric Mantegazza.
Laurent Monin <geeqie@norz.org>
parents:
263
diff
changeset
|
378 { |
2600
c6a11c0bade8
Bug fix #509: Increase number of marks to 10
Tomasz Golinski <tomaszg@math.uwb.edu.pl>
parents:
2490
diff
changeset
|
379 g_string_append_printf(buf, file_data_get_mark(fd, mark) ? " <span background='#FF00FF'>%c</span>" : " %c", '1' + (mark < 9 ? mark : -1) ); |
995 | 380 } |
265
f5b5a4c652c7
Fix a segfault on fullscreen file deletion reported by Frédéric Mantegazza.
Laurent Monin <geeqie@norz.org>
parents:
263
diff
changeset
|
381 |
410
8b0b92beb720
Fix OSD display when fullscreen info string is empty.
Laurent Monin <geeqie@norz.org>
parents:
322
diff
changeset
|
382 if (*text) |
8b0b92beb720
Fix OSD display when fullscreen info string is empty.
Laurent Monin <geeqie@norz.org>
parents:
322
diff
changeset
|
383 text2 = g_strdup_printf("%s\n%s", text, buf->str); |
8b0b92beb720
Fix OSD display when fullscreen info string is empty.
Laurent Monin <geeqie@norz.org>
parents:
322
diff
changeset
|
384 else |
8b0b92beb720
Fix OSD display when fullscreen info string is empty.
Laurent Monin <geeqie@norz.org>
parents:
322
diff
changeset
|
385 text2 = g_strdup(buf->str); |
265
f5b5a4c652c7
Fix a segfault on fullscreen file deletion reported by Frédéric Mantegazza.
Laurent Monin <geeqie@norz.org>
parents:
263
diff
changeset
|
386 g_string_free(buf, TRUE); |
f5b5a4c652c7
Fix a segfault on fullscreen file deletion reported by Frédéric Mantegazza.
Laurent Monin <geeqie@norz.org>
parents:
263
diff
changeset
|
387 g_free(text); |
275
0c872187d982
fixed histogram label
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
273
diff
changeset
|
388 text = text2; |
265
f5b5a4c652c7
Fix a segfault on fullscreen file deletion reported by Frédéric Mantegazza.
Laurent Monin <geeqie@norz.org>
parents:
263
diff
changeset
|
389 } |
275
0c872187d982
fixed histogram label
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
273
diff
changeset
|
390 |
995 | 391 if (with_hist) |
290
81901d728c9f
improved histogram drawing
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
281
diff
changeset
|
392 { |
616
0486114b0f50
Move overlay histogram stuff from ImageWindow to OverlayStateData.
Laurent Monin <geeqie@norz.org>
parents:
615
diff
changeset
|
393 gchar *escaped_histogram_label = g_markup_escape_text(histogram_label(osd->histogram), -1); |
410
8b0b92beb720
Fix OSD display when fullscreen info string is empty.
Laurent Monin <geeqie@norz.org>
parents:
322
diff
changeset
|
394 if (*text) |
483
010c12d0755c
Correctly escape data before using pango_layout_set_markup().
Laurent Monin <geeqie@norz.org>
parents:
482
diff
changeset
|
395 text2 = g_strdup_printf("%s\n%s", text, escaped_histogram_label); |
410
8b0b92beb720
Fix OSD display when fullscreen info string is empty.
Laurent Monin <geeqie@norz.org>
parents:
322
diff
changeset
|
396 else |
483
010c12d0755c
Correctly escape data before using pango_layout_set_markup().
Laurent Monin <geeqie@norz.org>
parents:
482
diff
changeset
|
397 text2 = g_strdup(escaped_histogram_label); |
010c12d0755c
Correctly escape data before using pango_layout_set_markup().
Laurent Monin <geeqie@norz.org>
parents:
482
diff
changeset
|
398 g_free(escaped_histogram_label); |
290
81901d728c9f
improved histogram drawing
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
281
diff
changeset
|
399 g_free(text); |
81901d728c9f
improved histogram drawing
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
281
diff
changeset
|
400 text = text2; |
81901d728c9f
improved histogram drawing
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
281
diff
changeset
|
401 } |
155
07f87e691e45
show active marks in image overlay
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
133
diff
changeset
|
402 } |
410
8b0b92beb720
Fix OSD display when fullscreen info string is empty.
Laurent Monin <geeqie@norz.org>
parents:
322
diff
changeset
|
403 |
2334
e38178f556f6
Image overlay configurable font
Colin Clark <cclark@mcb.net>
parents:
2228
diff
changeset
|
404 font_desc = pango_font_description_from_string(options->image_overlay.font); |
23
9ff428db7772
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
John Ellis <johne@verizon.net>
parents:
9
diff
changeset
|
405 layout = gtk_widget_create_pango_layout(imd->pr, NULL); |
2334
e38178f556f6
Image overlay configurable font
Colin Clark <cclark@mcb.net>
parents:
2228
diff
changeset
|
406 pango_layout_set_font_description(layout, font_desc); |
e38178f556f6
Image overlay configurable font
Colin Clark <cclark@mcb.net>
parents:
2228
diff
changeset
|
407 |
275
0c872187d982
fixed histogram label
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
273
diff
changeset
|
408 pango_layout_set_markup(layout, text, -1); |
0c872187d982
fixed histogram label
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
273
diff
changeset
|
409 g_free(text); |
442 | 410 |
9 | 411 pango_layout_get_pixel_size(layout, &width, &height); |
410
8b0b92beb720
Fix OSD display when fullscreen info string is empty.
Laurent Monin <geeqie@norz.org>
parents:
322
diff
changeset
|
412 /* with empty text width is set to 0, but not height) */ |
8b0b92beb720
Fix OSD display when fullscreen info string is empty.
Laurent Monin <geeqie@norz.org>
parents:
322
diff
changeset
|
413 if (width == 0) |
8b0b92beb720
Fix OSD display when fullscreen info string is empty.
Laurent Monin <geeqie@norz.org>
parents:
322
diff
changeset
|
414 height = 0; |
8b0b92beb720
Fix OSD display when fullscreen info string is empty.
Laurent Monin <geeqie@norz.org>
parents:
322
diff
changeset
|
415 else if (height == 0) |
8b0b92beb720
Fix OSD display when fullscreen info string is empty.
Laurent Monin <geeqie@norz.org>
parents:
322
diff
changeset
|
416 width = 0; |
8b0b92beb720
Fix OSD display when fullscreen info string is empty.
Laurent Monin <geeqie@norz.org>
parents:
322
diff
changeset
|
417 if (width > 0) width += 10; |
8b0b92beb720
Fix OSD display when fullscreen info string is empty.
Laurent Monin <geeqie@norz.org>
parents:
322
diff
changeset
|
418 if (height > 0) height += 10; |
9 | 419 |
273
aedbff4f5d0d
reworked the histogram patch by Uwe Ohse, most of the code is in
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
265
diff
changeset
|
420 if (with_hist) |
aedbff4f5d0d
reworked the histogram patch by Uwe Ohse, most of the code is in
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
265
diff
changeset
|
421 { |
620
9281a39e4566
Display a simple grid with histogram.
Laurent Monin <geeqie@norz.org>
parents:
618
diff
changeset
|
422 if (width < HISTOGRAM_WIDTH + 10) width = HISTOGRAM_WIDTH + 10; |
290
81901d728c9f
improved histogram drawing
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
281
diff
changeset
|
423 height += HISTOGRAM_HEIGHT + 5; |
273
aedbff4f5d0d
reworked the histogram patch by Uwe Ohse, most of the code is in
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
265
diff
changeset
|
424 } |
aedbff4f5d0d
reworked the histogram patch by Uwe Ohse, most of the code is in
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
265
diff
changeset
|
425 |
410
8b0b92beb720
Fix OSD display when fullscreen info string is empty.
Laurent Monin <geeqie@norz.org>
parents:
322
diff
changeset
|
426 if (width > 0 && height > 0) |
8b0b92beb720
Fix OSD display when fullscreen info string is empty.
Laurent Monin <geeqie@norz.org>
parents:
322
diff
changeset
|
427 { |
8b0b92beb720
Fix OSD display when fullscreen info string is empty.
Laurent Monin <geeqie@norz.org>
parents:
322
diff
changeset
|
428 pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, width, height); |
2335
aa2e9d37193b
Image overlay configurable colours
Colin Clark <cclark@mcb.net>
parents:
2334
diff
changeset
|
429 pixbuf_set_rect_fill(pixbuf, 3, 3, width-6, height-6, options->image_overlay.background_red, options->image_overlay.background_green, |
aa2e9d37193b
Image overlay configurable colours
Colin Clark <cclark@mcb.net>
parents:
2334
diff
changeset
|
430 options->image_overlay.background_blue, options->image_overlay.background_alpha); |
410
8b0b92beb720
Fix OSD display when fullscreen info string is empty.
Laurent Monin <geeqie@norz.org>
parents:
322
diff
changeset
|
431 pixbuf_set_rect(pixbuf, 0, 0, width, height, 240, 240, 240, 80, 1, 1, 1, 1); |
8b0b92beb720
Fix OSD display when fullscreen info string is empty.
Laurent Monin <geeqie@norz.org>
parents:
322
diff
changeset
|
432 pixbuf_set_rect(pixbuf, 1, 1, width-2, height-2, 240, 240, 240, 130, 1, 1, 1, 1); |
8b0b92beb720
Fix OSD display when fullscreen info string is empty.
Laurent Monin <geeqie@norz.org>
parents:
322
diff
changeset
|
433 pixbuf_set_rect(pixbuf, 2, 2, width-4, height-4, 240, 240, 240, 180, 1, 1, 1, 1); |
8b0b92beb720
Fix OSD display when fullscreen info string is empty.
Laurent Monin <geeqie@norz.org>
parents:
322
diff
changeset
|
434 pixbuf_pixel_set(pixbuf, 0, 0, 0, 0, 0, 0); |
8b0b92beb720
Fix OSD display when fullscreen info string is empty.
Laurent Monin <geeqie@norz.org>
parents:
322
diff
changeset
|
435 pixbuf_pixel_set(pixbuf, width - 1, 0, 0, 0, 0, 0); |
8b0b92beb720
Fix OSD display when fullscreen info string is empty.
Laurent Monin <geeqie@norz.org>
parents:
322
diff
changeset
|
436 pixbuf_pixel_set(pixbuf, 0, height - 1, 0, 0, 0, 0); |
8b0b92beb720
Fix OSD display when fullscreen info string is empty.
Laurent Monin <geeqie@norz.org>
parents:
322
diff
changeset
|
437 pixbuf_pixel_set(pixbuf, width - 1, height - 1, 0, 0, 0, 0); |
442 | 438 |
410
8b0b92beb720
Fix OSD display when fullscreen info string is empty.
Laurent Monin <geeqie@norz.org>
parents:
322
diff
changeset
|
439 if (with_hist) |
620
9281a39e4566
Display a simple grid with histogram.
Laurent Monin <geeqie@norz.org>
parents:
618
diff
changeset
|
440 { |
9281a39e4566
Display a simple grid with histogram.
Laurent Monin <geeqie@norz.org>
parents:
618
diff
changeset
|
441 gint x = 5; |
9281a39e4566
Display a simple grid with histogram.
Laurent Monin <geeqie@norz.org>
parents:
618
diff
changeset
|
442 gint y = height - HISTOGRAM_HEIGHT - 5; |
9281a39e4566
Display a simple grid with histogram.
Laurent Monin <geeqie@norz.org>
parents:
618
diff
changeset
|
443 gint w = width - 10; |
442 | 444 |
1302
f7e8c21eb688
Add grid to bar histogram, simplify the code and draw horizontal lines too.
Laurent Monin <geeqie@norz.org>
parents:
1298
diff
changeset
|
445 pixbuf_set_rect_fill(pixbuf, x, y, w, HISTOGRAM_HEIGHT, 220, 220, 220, 210); |
1294 | 446 histogram_draw(osd->histogram, histmap, pixbuf, x, y, w, HISTOGRAM_HEIGHT); |
620
9281a39e4566
Display a simple grid with histogram.
Laurent Monin <geeqie@norz.org>
parents:
618
diff
changeset
|
447 } |
2335
aa2e9d37193b
Image overlay configurable colours
Colin Clark <cclark@mcb.net>
parents:
2334
diff
changeset
|
448 pixbuf_draw_layout(pixbuf, layout, imd->pr, 5, 5, options->image_overlay.text_red, options->image_overlay.text_green, |
aa2e9d37193b
Image overlay configurable colours
Colin Clark <cclark@mcb.net>
parents:
2334
diff
changeset
|
449 options->image_overlay.text_blue, options->image_overlay.text_alpha); |
410
8b0b92beb720
Fix OSD display when fullscreen info string is empty.
Laurent Monin <geeqie@norz.org>
parents:
322
diff
changeset
|
450 } |
9 | 451 |
452 g_object_unref(G_OBJECT(layout)); | |
453 | |
454 return pixbuf; | |
455 } | |
456 | |
118
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
457 static GdkPixbuf *image_osd_icon_pixbuf(ImageOSDFlag flag) |
9 | 458 { |
118
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
459 static GdkPixbuf **icons = NULL; |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
460 GdkPixbuf *icon = NULL; |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
461 |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
462 if (!icons) icons = g_new0(GdkPixbuf *, IMAGE_OSD_COUNT); |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
463 if (icons[flag]) return icons[flag]; |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
464 |
122
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
465 if (osd_icons[flag].key) |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
466 { |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
467 icon = pixbuf_inline(osd_icons[flag].key); |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
468 } |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
469 |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
470 if (!icon) |
117
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
471 { |
122
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
472 icon = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, 24, 24); |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
473 pixbuf_set_rect_fill(icon, 1, 1, 22, 22, 255, 255, 255, 200); |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
474 pixbuf_set_rect(icon, 0, 0, 24, 24, 0, 0, 0, 128, 1, 1, 1, 1); |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
475 switch (flag) |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
476 { |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
477 case IMAGE_OSD_ROTATE_AUTO: |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
478 pixbuf_set_rect(icon, 3, 8, 11, 12, |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
479 0, 0, 0, 255, |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
480 3, 0, 3, 0); |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
481 pixbuf_draw_triangle(icon, 14, 3, 6, 12, |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
482 20, 9, 14, 15, 14, 3, |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
483 0, 0, 0, 255); |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
484 break; |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
485 case IMAGE_OSD_ROTATE_USER: |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
486 break; |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
487 case IMAGE_OSD_COLOR: |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
488 pixbuf_set_rect_fill(icon, 3, 3, 18, 6, 200, 0, 0, 255); |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
489 pixbuf_set_rect_fill(icon, 3, 9, 18, 6, 0, 200, 0, 255); |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
490 pixbuf_set_rect_fill(icon, 3, 15, 18, 6, 0, 0, 200, 255); |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
491 break; |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
492 case IMAGE_OSD_FIRST: |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
493 pixbuf_set_rect(icon, 3, 3, 18, 18, 0, 0, 0, 200, 3, 3, 3, 0); |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
494 pixbuf_draw_triangle(icon, 6, 5, 12, 6, |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
495 12, 5, 18, 11, 6, 11, |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
496 0, 0, 0, 255); |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
497 break; |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
498 case IMAGE_OSD_LAST: |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
499 pixbuf_set_rect(icon, 3, 3, 18, 18, 0, 0, 0, 200, 3, 3, 0, 3); |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
500 pixbuf_draw_triangle(icon, 6, 12, 12, 6, |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
501 12, 18, 6, 12, 18, 12, |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
502 0, 0, 0, 255); |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
503 break; |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
504 case IMAGE_OSD_ICON: |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
505 pixbuf_set_rect_fill(icon, 11, 3, 3, 12, 0, 0, 0, 255); |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
506 pixbuf_set_rect_fill(icon, 11, 17, 3, 3, 0, 0, 0, 255); |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
507 break; |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
508 default: |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
509 break; |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
510 } |
118
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
511 } |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
512 |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
513 icons[flag] = icon; |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
514 |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
515 return icon; |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
516 } |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
517 |
2794
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
518 static GdkPixbuf *image_osd_guidelines_render(OverlayStateData *osd) |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
519 { |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
520 gint width, height; |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
521 GdkPixbuf *rectangles; |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
522 ImageWindow *imd = osd->imd; |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
523 |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
524 pixbuf_renderer_get_scaled_size((PixbufRenderer *)imd->pr, &width, &height); |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
525 |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
526 if (width && height) |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
527 { |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
528 rectangles = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, width, height); |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
529 if (rectangles) |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
530 { |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
531 pixbuf_set_rect_fill(rectangles, 0, 0, width, height, 255, 255, 255, 0); |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
532 pixbuf_set_rect(rectangles, 0, 0 + (height / 3), width, height / 3, |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
533 0, 0, 0, 255, |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
534 1, 1, 1, 1); |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
535 pixbuf_set_rect(rectangles, 0, 0 + (height / 3 + 1), width, height / 3 - 2, |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
536 255, 255, 255, 255, |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
537 1, 1, 1, 1); |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
538 |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
539 pixbuf_set_rect(rectangles, 0 + width / 3, 0 , width / 3, height, |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
540 0, 0, 0, 255, |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
541 1, 1, 1, 1); |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
542 pixbuf_set_rect(rectangles, 0 + width / 3 + 1, 0, width / 3 - 2, height, |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
543 255, 255, 255, 255, |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
544 1, 1, 1, 1); |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
545 return rectangles; |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
546 } |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
547 } |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
548 |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
549 return NULL; |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
550 } |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
551 |
821
b0c1806b153a
Move some functions from image.[ch] to image-overlay.c and make them static:
Laurent Monin <geeqie@norz.org>
parents:
800
diff
changeset
|
552 static gint image_overlay_add(ImageWindow *imd, GdkPixbuf *pixbuf, gint x, gint y, |
857
8ee324a036ed
Use flags instead of int parameters for pixbuf_renderer_overlay_add().
Laurent Monin <geeqie@norz.org>
parents:
844
diff
changeset
|
553 OverlayRendererFlags flags) |
821
b0c1806b153a
Move some functions from image.[ch] to image-overlay.c and make them static:
Laurent Monin <geeqie@norz.org>
parents:
800
diff
changeset
|
554 { |
857
8ee324a036ed
Use flags instead of int parameters for pixbuf_renderer_overlay_add().
Laurent Monin <geeqie@norz.org>
parents:
844
diff
changeset
|
555 return pixbuf_renderer_overlay_add((PixbufRenderer *)imd->pr, pixbuf, x, y, flags); |
821
b0c1806b153a
Move some functions from image.[ch] to image-overlay.c and make them static:
Laurent Monin <geeqie@norz.org>
parents:
800
diff
changeset
|
556 } |
b0c1806b153a
Move some functions from image.[ch] to image-overlay.c and make them static:
Laurent Monin <geeqie@norz.org>
parents:
800
diff
changeset
|
557 |
b0c1806b153a
Move some functions from image.[ch] to image-overlay.c and make them static:
Laurent Monin <geeqie@norz.org>
parents:
800
diff
changeset
|
558 static void image_overlay_set(ImageWindow *imd, gint id, GdkPixbuf *pixbuf, gint x, gint y) |
b0c1806b153a
Move some functions from image.[ch] to image-overlay.c and make them static:
Laurent Monin <geeqie@norz.org>
parents:
800
diff
changeset
|
559 { |
b0c1806b153a
Move some functions from image.[ch] to image-overlay.c and make them static:
Laurent Monin <geeqie@norz.org>
parents:
800
diff
changeset
|
560 pixbuf_renderer_overlay_set((PixbufRenderer *)imd->pr, id, pixbuf, x, y); |
b0c1806b153a
Move some functions from image.[ch] to image-overlay.c and make them static:
Laurent Monin <geeqie@norz.org>
parents:
800
diff
changeset
|
561 } |
b0c1806b153a
Move some functions from image.[ch] to image-overlay.c and make them static:
Laurent Monin <geeqie@norz.org>
parents:
800
diff
changeset
|
562 |
b0c1806b153a
Move some functions from image.[ch] to image-overlay.c and make them static:
Laurent Monin <geeqie@norz.org>
parents:
800
diff
changeset
|
563 static void image_overlay_remove(ImageWindow *imd, gint id) |
b0c1806b153a
Move some functions from image.[ch] to image-overlay.c and make them static:
Laurent Monin <geeqie@norz.org>
parents:
800
diff
changeset
|
564 { |
b0c1806b153a
Move some functions from image.[ch] to image-overlay.c and make them static:
Laurent Monin <geeqie@norz.org>
parents:
800
diff
changeset
|
565 pixbuf_renderer_overlay_remove((PixbufRenderer *)imd->pr, id); |
b0c1806b153a
Move some functions from image.[ch] to image-overlay.c and make them static:
Laurent Monin <geeqie@norz.org>
parents:
800
diff
changeset
|
566 } |
b0c1806b153a
Move some functions from image.[ch] to image-overlay.c and make them static:
Laurent Monin <geeqie@norz.org>
parents:
800
diff
changeset
|
567 |
118
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
568 static void image_osd_icon_show(OverlayStateData *osd, ImageOSDFlag flag) |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
569 { |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
570 GdkPixbuf *pixbuf; |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
571 |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
572 if (osd->icon_id[flag]) return; |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
573 |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
574 pixbuf = image_osd_icon_pixbuf(flag); |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
575 if (!pixbuf) return; |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
576 |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
577 osd->icon_id[flag] = image_overlay_add(osd->imd, pixbuf, |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
578 osd_icons[flag].x, osd_icons[flag].y, |
857
8ee324a036ed
Use flags instead of int parameters for pixbuf_renderer_overlay_add().
Laurent Monin <geeqie@norz.org>
parents:
844
diff
changeset
|
579 OVL_RELATIVE); |
118
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
580 } |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
581 |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
582 static void image_osd_icon_hide(OverlayStateData *osd, ImageOSDFlag flag) |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
583 { |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
584 if (osd->icon_id[flag]) |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
585 { |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
586 image_overlay_remove(osd->imd, osd->icon_id[flag]); |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
587 osd->icon_id[flag] = 0; |
117
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
588 } |
9 | 589 } |
590 | |
886
f159ff44406f
Tidy up and code redundancy reduction.
Laurent Monin <geeqie@norz.org>
parents:
866
diff
changeset
|
591 static void image_osd_icons_reset_time(OverlayStateData *osd) |
f159ff44406f
Tidy up and code redundancy reduction.
Laurent Monin <geeqie@norz.org>
parents:
866
diff
changeset
|
592 { |
f159ff44406f
Tidy up and code redundancy reduction.
Laurent Monin <geeqie@norz.org>
parents:
866
diff
changeset
|
593 gint i; |
f159ff44406f
Tidy up and code redundancy reduction.
Laurent Monin <geeqie@norz.org>
parents:
866
diff
changeset
|
594 |
f159ff44406f
Tidy up and code redundancy reduction.
Laurent Monin <geeqie@norz.org>
parents:
866
diff
changeset
|
595 for (i = 0; i < IMAGE_OSD_COUNT; i++) |
f159ff44406f
Tidy up and code redundancy reduction.
Laurent Monin <geeqie@norz.org>
parents:
866
diff
changeset
|
596 { |
f159ff44406f
Tidy up and code redundancy reduction.
Laurent Monin <geeqie@norz.org>
parents:
866
diff
changeset
|
597 if (osd_icons[i].reset) |
f159ff44406f
Tidy up and code redundancy reduction.
Laurent Monin <geeqie@norz.org>
parents:
866
diff
changeset
|
598 { |
f159ff44406f
Tidy up and code redundancy reduction.
Laurent Monin <geeqie@norz.org>
parents:
866
diff
changeset
|
599 osd->icon_time[i] = 0; |
f159ff44406f
Tidy up and code redundancy reduction.
Laurent Monin <geeqie@norz.org>
parents:
866
diff
changeset
|
600 } |
f159ff44406f
Tidy up and code redundancy reduction.
Laurent Monin <geeqie@norz.org>
parents:
866
diff
changeset
|
601 } |
f159ff44406f
Tidy up and code redundancy reduction.
Laurent Monin <geeqie@norz.org>
parents:
866
diff
changeset
|
602 } |
f159ff44406f
Tidy up and code redundancy reduction.
Laurent Monin <geeqie@norz.org>
parents:
866
diff
changeset
|
603 |
f159ff44406f
Tidy up and code redundancy reduction.
Laurent Monin <geeqie@norz.org>
parents:
866
diff
changeset
|
604 static void image_osd_icons_update(OverlayStateData *osd) |
f159ff44406f
Tidy up and code redundancy reduction.
Laurent Monin <geeqie@norz.org>
parents:
866
diff
changeset
|
605 { |
f159ff44406f
Tidy up and code redundancy reduction.
Laurent Monin <geeqie@norz.org>
parents:
866
diff
changeset
|
606 gint i; |
f159ff44406f
Tidy up and code redundancy reduction.
Laurent Monin <geeqie@norz.org>
parents:
866
diff
changeset
|
607 |
f159ff44406f
Tidy up and code redundancy reduction.
Laurent Monin <geeqie@norz.org>
parents:
866
diff
changeset
|
608 for (i = 0; i < IMAGE_OSD_COUNT; i++) |
f159ff44406f
Tidy up and code redundancy reduction.
Laurent Monin <geeqie@norz.org>
parents:
866
diff
changeset
|
609 { |
f159ff44406f
Tidy up and code redundancy reduction.
Laurent Monin <geeqie@norz.org>
parents:
866
diff
changeset
|
610 if (osd->icon_time[i] > 0) |
f159ff44406f
Tidy up and code redundancy reduction.
Laurent Monin <geeqie@norz.org>
parents:
866
diff
changeset
|
611 { |
f159ff44406f
Tidy up and code redundancy reduction.
Laurent Monin <geeqie@norz.org>
parents:
866
diff
changeset
|
612 image_osd_icon_show(osd, i); |
f159ff44406f
Tidy up and code redundancy reduction.
Laurent Monin <geeqie@norz.org>
parents:
866
diff
changeset
|
613 } |
f159ff44406f
Tidy up and code redundancy reduction.
Laurent Monin <geeqie@norz.org>
parents:
866
diff
changeset
|
614 else |
f159ff44406f
Tidy up and code redundancy reduction.
Laurent Monin <geeqie@norz.org>
parents:
866
diff
changeset
|
615 { |
f159ff44406f
Tidy up and code redundancy reduction.
Laurent Monin <geeqie@norz.org>
parents:
866
diff
changeset
|
616 image_osd_icon_hide(osd, i); |
f159ff44406f
Tidy up and code redundancy reduction.
Laurent Monin <geeqie@norz.org>
parents:
866
diff
changeset
|
617 } |
f159ff44406f
Tidy up and code redundancy reduction.
Laurent Monin <geeqie@norz.org>
parents:
866
diff
changeset
|
618 } |
f159ff44406f
Tidy up and code redundancy reduction.
Laurent Monin <geeqie@norz.org>
parents:
866
diff
changeset
|
619 } |
f159ff44406f
Tidy up and code redundancy reduction.
Laurent Monin <geeqie@norz.org>
parents:
866
diff
changeset
|
620 |
f159ff44406f
Tidy up and code redundancy reduction.
Laurent Monin <geeqie@norz.org>
parents:
866
diff
changeset
|
621 static void image_osd_icons_hide(OverlayStateData *osd) |
f159ff44406f
Tidy up and code redundancy reduction.
Laurent Monin <geeqie@norz.org>
parents:
866
diff
changeset
|
622 { |
f159ff44406f
Tidy up and code redundancy reduction.
Laurent Monin <geeqie@norz.org>
parents:
866
diff
changeset
|
623 gint i; |
f159ff44406f
Tidy up and code redundancy reduction.
Laurent Monin <geeqie@norz.org>
parents:
866
diff
changeset
|
624 |
f159ff44406f
Tidy up and code redundancy reduction.
Laurent Monin <geeqie@norz.org>
parents:
866
diff
changeset
|
625 for (i = 0; i < IMAGE_OSD_COUNT; i++) |
f159ff44406f
Tidy up and code redundancy reduction.
Laurent Monin <geeqie@norz.org>
parents:
866
diff
changeset
|
626 { |
f159ff44406f
Tidy up and code redundancy reduction.
Laurent Monin <geeqie@norz.org>
parents:
866
diff
changeset
|
627 image_osd_icon_hide(osd, i); |
f159ff44406f
Tidy up and code redundancy reduction.
Laurent Monin <geeqie@norz.org>
parents:
866
diff
changeset
|
628 } |
f159ff44406f
Tidy up and code redundancy reduction.
Laurent Monin <geeqie@norz.org>
parents:
866
diff
changeset
|
629 } |
f159ff44406f
Tidy up and code redundancy reduction.
Laurent Monin <geeqie@norz.org>
parents:
866
diff
changeset
|
630 |
887
646b0013963b
Move code from image_osd_update_cb() to separate functions.
Laurent Monin <geeqie@norz.org>
parents:
886
diff
changeset
|
631 static void image_osd_info_show(OverlayStateData *osd, GdkPixbuf *pixbuf) |
646b0013963b
Move code from image_osd_update_cb() to separate functions.
Laurent Monin <geeqie@norz.org>
parents:
886
diff
changeset
|
632 { |
646b0013963b
Move code from image_osd_update_cb() to separate functions.
Laurent Monin <geeqie@norz.org>
parents:
886
diff
changeset
|
633 if (osd->ovl_info == 0) |
646b0013963b
Move code from image_osd_update_cb() to separate functions.
Laurent Monin <geeqie@norz.org>
parents:
886
diff
changeset
|
634 { |
2794
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
635 osd->ovl_info = image_overlay_add(osd->imd, pixbuf, osd->x, osd->y, osd->origin); |
887
646b0013963b
Move code from image_osd_update_cb() to separate functions.
Laurent Monin <geeqie@norz.org>
parents:
886
diff
changeset
|
636 } |
646b0013963b
Move code from image_osd_update_cb() to separate functions.
Laurent Monin <geeqie@norz.org>
parents:
886
diff
changeset
|
637 else |
646b0013963b
Move code from image_osd_update_cb() to separate functions.
Laurent Monin <geeqie@norz.org>
parents:
886
diff
changeset
|
638 { |
646b0013963b
Move code from image_osd_update_cb() to separate functions.
Laurent Monin <geeqie@norz.org>
parents:
886
diff
changeset
|
639 image_overlay_set(osd->imd, osd->ovl_info, pixbuf, osd->x, osd->y); |
646b0013963b
Move code from image_osd_update_cb() to separate functions.
Laurent Monin <geeqie@norz.org>
parents:
886
diff
changeset
|
640 } |
646b0013963b
Move code from image_osd_update_cb() to separate functions.
Laurent Monin <geeqie@norz.org>
parents:
886
diff
changeset
|
641 } |
646b0013963b
Move code from image_osd_update_cb() to separate functions.
Laurent Monin <geeqie@norz.org>
parents:
886
diff
changeset
|
642 |
646b0013963b
Move code from image_osd_update_cb() to separate functions.
Laurent Monin <geeqie@norz.org>
parents:
886
diff
changeset
|
643 static void image_osd_info_hide(OverlayStateData *osd) |
646b0013963b
Move code from image_osd_update_cb() to separate functions.
Laurent Monin <geeqie@norz.org>
parents:
886
diff
changeset
|
644 { |
646b0013963b
Move code from image_osd_update_cb() to separate functions.
Laurent Monin <geeqie@norz.org>
parents:
886
diff
changeset
|
645 if (osd->ovl_info == 0) return; |
646b0013963b
Move code from image_osd_update_cb() to separate functions.
Laurent Monin <geeqie@norz.org>
parents:
886
diff
changeset
|
646 |
646b0013963b
Move code from image_osd_update_cb() to separate functions.
Laurent Monin <geeqie@norz.org>
parents:
886
diff
changeset
|
647 image_overlay_remove(osd->imd, osd->ovl_info); |
646b0013963b
Move code from image_osd_update_cb() to separate functions.
Laurent Monin <geeqie@norz.org>
parents:
886
diff
changeset
|
648 osd->ovl_info = 0; |
646b0013963b
Move code from image_osd_update_cb() to separate functions.
Laurent Monin <geeqie@norz.org>
parents:
886
diff
changeset
|
649 } |
646b0013963b
Move code from image_osd_update_cb() to separate functions.
Laurent Monin <geeqie@norz.org>
parents:
886
diff
changeset
|
650 |
1433
12600de4b59a
Use gboolean where applicable, minor cleanup and indentations fixes.
Laurent Monin <geeqie@norz.org>
parents:
1367
diff
changeset
|
651 static gboolean image_osd_update_cb(gpointer data) |
9 | 652 { |
117
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
653 OverlayStateData *osd = data; |
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
654 |
614
e477b53a6046
image_osd_get() and image_osd_set() now uses flags.
Laurent Monin <geeqie@norz.org>
parents:
613
diff
changeset
|
655 if (osd->show & OSD_SHOW_INFO) |
117
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
656 { |
2184 | 657 /* redraw when the image was changed, |
1297
ae7da76b7e9e
fixed histogram drawing
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1294
diff
changeset
|
658 with histogram we have to redraw also when loading is finished */ |
ae7da76b7e9e
fixed histogram drawing
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1294
diff
changeset
|
659 if (osd->changed_states & IMAGE_STATE_IMAGE || |
1439
bd8442811951
compute histogram in idle time
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
660 (osd->changed_states & IMAGE_STATE_LOADING && osd->show & OSD_SHOW_HISTOGRAM) || |
2794
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
661 (osd->changed_states & IMAGE_STATE_LOADING && osd->show & OSD_SHOW_GUIDELINES) || |
1439
bd8442811951
compute histogram in idle time
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
662 osd->notify & NOTIFY_HISTMAP) |
117
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
663 { |
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
664 GdkPixbuf *pixbuf; |
9 | 665 |
2794
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
666 if (osd->show & OSD_SHOW_GUIDELINES) |
117
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
667 { |
2794
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
668 ImageWindow *imd = osd->imd; |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
669 osd->x = ((PixbufRenderer *)imd->pr)->x_offset; |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
670 osd->y = ((PixbufRenderer *)imd->pr)->y_offset; |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
671 osd->origin = OVL_NORMAL; |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
672 |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
673 pixbuf = image_osd_guidelines_render(osd); |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
674 if (pixbuf) |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
675 { |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
676 image_osd_info_show(osd, pixbuf); |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
677 g_object_unref(pixbuf); |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
678 } |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
679 |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
680 osd->x = options->image_overlay.x; |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
681 osd->y = options->image_overlay.y; |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
682 osd->origin = OVL_RELATIVE; |
117
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
683 } |
887
646b0013963b
Move code from image_osd_update_cb() to separate functions.
Laurent Monin <geeqie@norz.org>
parents:
886
diff
changeset
|
684 else |
117
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
685 { |
2794
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
686 pixbuf = image_osd_info_render(osd); |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
687 if (pixbuf) |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
688 { |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
689 image_osd_info_show(osd, pixbuf); |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
690 g_object_unref(pixbuf); |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
691 } |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
692 else |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
693 { |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
694 image_osd_info_hide(osd); |
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
695 } |
117
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
696 } |
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
697 } |
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
698 } |
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
699 else |
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
700 { |
887
646b0013963b
Move code from image_osd_update_cb() to separate functions.
Laurent Monin <geeqie@norz.org>
parents:
886
diff
changeset
|
701 image_osd_info_hide(osd); |
117
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
702 } |
9 | 703 |
614
e477b53a6046
image_osd_get() and image_osd_set() now uses flags.
Laurent Monin <geeqie@norz.org>
parents:
613
diff
changeset
|
704 if (osd->show & OSD_SHOW_STATUS) |
117
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
705 { |
118
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
706 if (osd->changed_states & IMAGE_STATE_IMAGE) |
886
f159ff44406f
Tidy up and code redundancy reduction.
Laurent Monin <geeqie@norz.org>
parents:
866
diff
changeset
|
707 image_osd_icons_reset_time(osd); |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
708 |
118
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
709 if (osd->changed_states & IMAGE_STATE_COLOR_ADJ) |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
710 { |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
711 osd->icon_time[IMAGE_OSD_COLOR] = IMAGE_OSD_DEFAULT_DURATION + 1; |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
712 image_osd_timer_schedule(osd); |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
713 } |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
714 |
122
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
715 if (osd->changed_states & IMAGE_STATE_ROTATE_AUTO) |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
716 { |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
717 gint n = 0; |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
718 |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
719 if (osd->imd->state & IMAGE_STATE_ROTATE_AUTO) |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
720 { |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
721 n = 1; |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
722 if (!osd->imd->cm) n += IMAGE_OSD_DEFAULT_DURATION; |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
723 } |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
724 |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
725 osd->icon_time[IMAGE_OSD_ROTATE_AUTO] = n; |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
726 image_osd_timer_schedule(osd); |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
727 } |
5ae2f8b7b565
Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
118
diff
changeset
|
728 |
886
f159ff44406f
Tidy up and code redundancy reduction.
Laurent Monin <geeqie@norz.org>
parents:
866
diff
changeset
|
729 image_osd_icons_update(osd); |
117
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
730 } |
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
731 else |
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
732 { |
886
f159ff44406f
Tidy up and code redundancy reduction.
Laurent Monin <geeqie@norz.org>
parents:
866
diff
changeset
|
733 image_osd_icons_hide(osd); |
117
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
734 } |
9 | 735 |
1440
4a7e11043729
fixed a bug in osd updating, it seems that the osd icons work again
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1439
diff
changeset
|
736 osd->changed_states = IMAGE_STATE_NONE; |
1439
bd8442811951
compute histogram in idle time
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
737 osd->notify = 0; |
1523
e52aabe8fc7a
Fix up event source ids type: gint -> guint.
Laurent Monin <geeqie@norz.org>
parents:
1498
diff
changeset
|
738 osd->idle_id = 0; |
9 | 739 return FALSE; |
740 } | |
741 | |
1433
12600de4b59a
Use gboolean where applicable, minor cleanup and indentations fixes.
Laurent Monin <geeqie@norz.org>
parents:
1367
diff
changeset
|
742 static void image_osd_update_schedule(OverlayStateData *osd, gboolean force) |
9 | 743 { |
117
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
744 if (force) osd->changed_states |= IMAGE_STATE_IMAGE; |
9 | 745 |
1523
e52aabe8fc7a
Fix up event source ids type: gint -> guint.
Laurent Monin <geeqie@norz.org>
parents:
1498
diff
changeset
|
746 if (!osd->idle_id) |
117
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
747 { |
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
748 osd->idle_id = g_idle_add_full(G_PRIORITY_HIGH, image_osd_update_cb, osd, NULL); |
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
749 } |
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
750 } |
9 | 751 |
117
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
752 void image_osd_update(ImageWindow *imd) |
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
753 { |
615
84f0ba5ca4f1
Introduce image_get_osd_data() and image_set_osd_data().
Laurent Monin <geeqie@norz.org>
parents:
614
diff
changeset
|
754 OverlayStateData *osd = image_get_osd_data(imd); |
117
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
755 |
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
756 if (!osd) return; |
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
757 |
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
758 image_osd_update_schedule(osd, TRUE); |
9 | 759 } |
760 | |
1433
12600de4b59a
Use gboolean where applicable, minor cleanup and indentations fixes.
Laurent Monin <geeqie@norz.org>
parents:
1367
diff
changeset
|
761 static gboolean image_osd_timer_cb(gpointer data) |
118
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
762 { |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
763 OverlayStateData *osd = data; |
1433
12600de4b59a
Use gboolean where applicable, minor cleanup and indentations fixes.
Laurent Monin <geeqie@norz.org>
parents:
1367
diff
changeset
|
764 gboolean done = TRUE; |
12600de4b59a
Use gboolean where applicable, minor cleanup and indentations fixes.
Laurent Monin <geeqie@norz.org>
parents:
1367
diff
changeset
|
765 gboolean changed = FALSE; |
118
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
766 gint i; |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
767 |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
768 for (i = 0; i < IMAGE_OSD_COUNT; i++) |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
769 { |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
770 if (osd->icon_time[i] > 1) |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
771 { |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
772 osd->icon_time[i]--; |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
773 if (osd->icon_time[i] < 2) |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
774 { |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
775 osd->icon_time[i] = 0; |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
776 changed = TRUE; |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
777 } |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
778 else |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
779 { |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
780 done = FALSE; |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
781 } |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
782 } |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
783 } |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
784 |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
785 if (changed) image_osd_update_schedule(osd, FALSE); |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
786 |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
787 if (done) |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
788 { |
1523
e52aabe8fc7a
Fix up event source ids type: gint -> guint.
Laurent Monin <geeqie@norz.org>
parents:
1498
diff
changeset
|
789 osd->timer_id = 0; |
118
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
790 return FALSE; |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
791 } |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
792 |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
793 return TRUE; |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
794 } |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
795 |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
796 static void image_osd_timer_schedule(OverlayStateData *osd) |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
797 { |
1523
e52aabe8fc7a
Fix up event source ids type: gint -> guint.
Laurent Monin <geeqie@norz.org>
parents:
1498
diff
changeset
|
798 if (!osd->timer_id) |
118
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
799 { |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
800 osd->timer_id = g_timeout_add(100, image_osd_timer_cb, osd); |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
801 } |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
802 } |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
803 |
117
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
804 static void image_osd_state_cb(ImageWindow *imd, ImageState state, gpointer data) |
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
805 { |
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
806 OverlayStateData *osd = data; |
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
807 |
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
808 osd->changed_states |= state; |
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
809 image_osd_update_schedule(osd, FALSE); |
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
810 } |
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
811 |
1439
bd8442811951
compute histogram in idle time
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
812 static void image_osd_notify_cb(FileData *fd, NotifyType type, gpointer data) |
bd8442811951
compute histogram in idle time
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
813 { |
bd8442811951
compute histogram in idle time
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
814 OverlayStateData *osd = data; |
bd8442811951
compute histogram in idle time
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
815 |
bd8442811951
compute histogram in idle time
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
816 if ((type & (NOTIFY_HISTMAP)) && osd->imd && fd == osd->imd->image_fd) |
bd8442811951
compute histogram in idle time
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
817 { |
1498
2b0712dcf139
improved debug messages
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1447
diff
changeset
|
818 DEBUG_1("Notify osd: %s %04x", fd->path, type); |
1439
bd8442811951
compute histogram in idle time
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
819 osd->notify |= type; |
bd8442811951
compute histogram in idle time
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
820 image_osd_update_schedule(osd, FALSE); |
bd8442811951
compute histogram in idle time
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
821 } |
bd8442811951
compute histogram in idle time
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
822 } |
bd8442811951
compute histogram in idle time
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
823 |
bd8442811951
compute histogram in idle time
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
824 |
117
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
825 static void image_osd_free(OverlayStateData *osd) |
9 | 826 { |
117
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
827 if (!osd) return; |
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
828 |
1523
e52aabe8fc7a
Fix up event source ids type: gint -> guint.
Laurent Monin <geeqie@norz.org>
parents:
1498
diff
changeset
|
829 if (osd->idle_id) g_source_remove(osd->idle_id); |
e52aabe8fc7a
Fix up event source ids type: gint -> guint.
Laurent Monin <geeqie@norz.org>
parents:
1498
diff
changeset
|
830 if (osd->timer_id) g_source_remove(osd->timer_id); |
117
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
831 |
1439
bd8442811951
compute histogram in idle time
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
832 file_data_unregister_notify_func(image_osd_notify_cb, osd); |
bd8442811951
compute histogram in idle time
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
833 |
117
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
834 if (osd->imd) |
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
835 { |
615
84f0ba5ca4f1
Introduce image_get_osd_data() and image_set_osd_data().
Laurent Monin <geeqie@norz.org>
parents:
614
diff
changeset
|
836 image_set_osd_data(osd->imd, NULL); |
117
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
837 g_signal_handler_disconnect(osd->imd->pr, osd->destroy_id); |
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
838 |
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
839 image_set_state_func(osd->imd, NULL, NULL); |
118
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
840 |
887
646b0013963b
Move code from image_osd_update_cb() to separate functions.
Laurent Monin <geeqie@norz.org>
parents:
886
diff
changeset
|
841 image_osd_info_hide(osd); |
886
f159ff44406f
Tidy up and code redundancy reduction.
Laurent Monin <geeqie@norz.org>
parents:
866
diff
changeset
|
842 image_osd_icons_hide(osd); |
117
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
843 } |
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
844 |
616
0486114b0f50
Move overlay histogram stuff from ImageWindow to OverlayStateData.
Laurent Monin <geeqie@norz.org>
parents:
615
diff
changeset
|
845 if (osd->histogram) histogram_free(osd->histogram); |
0486114b0f50
Move overlay histogram stuff from ImageWindow to OverlayStateData.
Laurent Monin <geeqie@norz.org>
parents:
615
diff
changeset
|
846 |
117
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
847 g_free(osd); |
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
848 } |
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
849 |
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
850 static void image_osd_destroy_cb(GtkWidget *widget, gpointer data) |
9 | 851 { |
117
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
852 OverlayStateData *osd = data; |
9 | 853 |
117
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
854 osd->imd = NULL; |
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
855 image_osd_free(osd); |
9 | 856 } |
857 | |
614
e477b53a6046
image_osd_get() and image_osd_set() now uses flags.
Laurent Monin <geeqie@norz.org>
parents:
613
diff
changeset
|
858 static void image_osd_enable(ImageWindow *imd, OsdShowFlags show) |
9 | 859 { |
615
84f0ba5ca4f1
Introduce image_get_osd_data() and image_set_osd_data().
Laurent Monin <geeqie@norz.org>
parents:
614
diff
changeset
|
860 OverlayStateData *osd = image_get_osd_data(imd); |
117
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
861 |
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
862 if (!osd) |
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
863 { |
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
864 osd = g_new0(OverlayStateData, 1); |
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
865 osd->imd = imd; |
616
0486114b0f50
Move overlay histogram stuff from ImageWindow to OverlayStateData.
Laurent Monin <geeqie@norz.org>
parents:
615
diff
changeset
|
866 osd->show = OSD_SHOW_NOTHING; |
1336
7fe7536f02e1
fixed overlay configuration
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1329
diff
changeset
|
867 osd->x = options->image_overlay.x; |
7fe7536f02e1
fixed overlay configuration
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1329
diff
changeset
|
868 osd->y = options->image_overlay.y; |
2794
780a9b685335
Ref #331: Overimposed custom composition rule lines
Colin Clark <colin.clark@cclark.uk>
parents:
2720
diff
changeset
|
869 osd->origin = OVL_RELATIVE; |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
870 |
1336
7fe7536f02e1
fixed overlay configuration
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1329
diff
changeset
|
871 osd->histogram = histogram_new(); |
7fe7536f02e1
fixed overlay configuration
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1329
diff
changeset
|
872 |
117
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
873 osd->destroy_id = g_signal_connect(G_OBJECT(imd->pr), "destroy", |
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
874 G_CALLBACK(image_osd_destroy_cb), osd); |
615
84f0ba5ca4f1
Introduce image_get_osd_data() and image_set_osd_data().
Laurent Monin <geeqie@norz.org>
parents:
614
diff
changeset
|
875 image_set_osd_data(imd, osd); |
117
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
876 |
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
877 image_set_state_func(osd->imd, image_osd_state_cb, osd); |
1439
bd8442811951
compute histogram in idle time
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1433
diff
changeset
|
878 file_data_register_notify_func(image_osd_notify_cb, osd, NOTIFY_PRIORITY_LOW); |
117
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
879 } |
9 | 880 |
616
0486114b0f50
Move overlay histogram stuff from ImageWindow to OverlayStateData.
Laurent Monin <geeqie@norz.org>
parents:
615
diff
changeset
|
881 if (show & OSD_SHOW_STATUS) |
0486114b0f50
Move overlay histogram stuff from ImageWindow to OverlayStateData.
Laurent Monin <geeqie@norz.org>
parents:
615
diff
changeset
|
882 image_osd_icon(imd, IMAGE_OSD_ICON, -1); |
0486114b0f50
Move overlay histogram stuff from ImageWindow to OverlayStateData.
Laurent Monin <geeqie@norz.org>
parents:
615
diff
changeset
|
883 |
614
e477b53a6046
image_osd_get() and image_osd_set() now uses flags.
Laurent Monin <geeqie@norz.org>
parents:
613
diff
changeset
|
884 if (show != osd->show) |
e477b53a6046
image_osd_get() and image_osd_set() now uses flags.
Laurent Monin <geeqie@norz.org>
parents:
613
diff
changeset
|
885 image_osd_update_schedule(osd, TRUE); |
9 | 886 |
614
e477b53a6046
image_osd_get() and image_osd_set() now uses flags.
Laurent Monin <geeqie@norz.org>
parents:
613
diff
changeset
|
887 osd->show = show; |
9 | 888 } |
889 | |
614
e477b53a6046
image_osd_get() and image_osd_set() now uses flags.
Laurent Monin <geeqie@norz.org>
parents:
613
diff
changeset
|
890 void image_osd_set(ImageWindow *imd, OsdShowFlags show) |
9 | 891 { |
117
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
892 if (!imd) return; |
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
893 |
614
e477b53a6046
image_osd_get() and image_osd_set() now uses flags.
Laurent Monin <geeqie@norz.org>
parents:
613
diff
changeset
|
894 image_osd_enable(imd, show); |
9 | 895 } |
896 | |
621
c5ebd4b66d41
image_osd_get() now returns OsdShowFlags.
Laurent Monin <geeqie@norz.org>
parents:
620
diff
changeset
|
897 OsdShowFlags image_osd_get(ImageWindow *imd) |
117
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
898 { |
615
84f0ba5ca4f1
Introduce image_get_osd_data() and image_set_osd_data().
Laurent Monin <geeqie@norz.org>
parents:
614
diff
changeset
|
899 OverlayStateData *osd = image_get_osd_data(imd); |
117
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
900 |
621
c5ebd4b66d41
image_osd_get() now returns OsdShowFlags.
Laurent Monin <geeqie@norz.org>
parents:
620
diff
changeset
|
901 return osd ? osd->show : OSD_SHOW_NOTHING; |
117
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
902 } |
f95079062ea0
Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
23
diff
changeset
|
903 |
1336
7fe7536f02e1
fixed overlay configuration
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1329
diff
changeset
|
904 Histogram *image_osd_get_histogram(ImageWindow *imd) |
7fe7536f02e1
fixed overlay configuration
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1329
diff
changeset
|
905 { |
7fe7536f02e1
fixed overlay configuration
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1329
diff
changeset
|
906 OverlayStateData *osd = image_get_osd_data(imd); |
7fe7536f02e1
fixed overlay configuration
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1329
diff
changeset
|
907 |
7fe7536f02e1
fixed overlay configuration
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1329
diff
changeset
|
908 return osd ? osd->histogram : NULL; |
7fe7536f02e1
fixed overlay configuration
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1329
diff
changeset
|
909 } |
7fe7536f02e1
fixed overlay configuration
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1329
diff
changeset
|
910 |
7fe7536f02e1
fixed overlay configuration
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1329
diff
changeset
|
911 void image_osd_copy_status(ImageWindow *src, ImageWindow *dest) |
7fe7536f02e1
fixed overlay configuration
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1329
diff
changeset
|
912 { |
7fe7536f02e1
fixed overlay configuration
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1329
diff
changeset
|
913 Histogram *h_src, *h_dest; |
7fe7536f02e1
fixed overlay configuration
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1329
diff
changeset
|
914 image_osd_set(dest, image_osd_get(src)); |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
915 |
1336
7fe7536f02e1
fixed overlay configuration
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1329
diff
changeset
|
916 h_src = image_osd_get_histogram(src); |
7fe7536f02e1
fixed overlay configuration
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1329
diff
changeset
|
917 h_dest = image_osd_get_histogram(dest); |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
918 |
1336
7fe7536f02e1
fixed overlay configuration
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1329
diff
changeset
|
919 h_dest->histogram_mode = h_src->histogram_mode; |
7fe7536f02e1
fixed overlay configuration
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1329
diff
changeset
|
920 h_dest->histogram_channel = h_src->histogram_channel; |
2185
c14a1d8e6aa4
Trim trailing white spaces on empty lines.
Laurent Monin <zas@norz.org>
parents:
2184
diff
changeset
|
921 |
1336
7fe7536f02e1
fixed overlay configuration
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1329
diff
changeset
|
922 } |
7fe7536f02e1
fixed overlay configuration
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1329
diff
changeset
|
923 |
118
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
924 /* duration: |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
925 0 = hide |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
926 1 = show |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
927 2+ = show for duration tenths of a second |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
928 -1 = use default duration |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
929 */ |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
930 void image_osd_icon(ImageWindow *imd, ImageOSDFlag flag, gint duration) |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
931 { |
615
84f0ba5ca4f1
Introduce image_get_osd_data() and image_set_osd_data().
Laurent Monin <geeqie@norz.org>
parents:
614
diff
changeset
|
932 OverlayStateData *osd = image_get_osd_data(imd); |
118
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
933 |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
934 if (!osd) return; |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
935 |
1177
c5e6f6030aee
Fix up unsigned expression always true/false warnings.
Laurent Monin <geeqie@norz.org>
parents:
1055
diff
changeset
|
936 if (flag >= IMAGE_OSD_COUNT) return; |
118
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
937 if (duration < 0) duration = IMAGE_OSD_DEFAULT_DURATION; |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
938 if (duration > 1) duration += 1; |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
939 |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
940 osd->icon_time[flag] = duration; |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
941 |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
942 image_osd_update_schedule(osd, FALSE); |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
943 image_osd_timer_schedule(osd); |
7642cc02ee8d
Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
John Ellis <johne@verizon.net>
parents:
117
diff
changeset
|
944 } |
1055
4bbdfab3c89a
Adding a vim modeline to all files - patch by Klaus Ethgen
Vladimir Nadvornik <nadvornik@suse.cz>
parents:
1011
diff
changeset
|
945 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ |