diff options
author | Frank Gevaerts <frank@gevaerts.be> | 2009-07-25 21:36:11 +0000 |
---|---|---|
committer | Frank Gevaerts <frank@gevaerts.be> | 2009-07-25 21:36:11 +0000 |
commit | a175e3a42a18e3462095242700daa7229d6aa4c7 (patch) | |
tree | 4e87587d7e17850f8186a734f6211450835ad29f /apps/plugins/png/png.h | |
parent | fee24eefa9c843bac5586fb762da2d8871df3a65 (diff) | |
download | rockbox-a175e3a42a18e3462095242700daa7229d6aa4c7.tar.gz rockbox-a175e3a42a18e3462095242700daa7229d6aa4c7.zip |
Add a png viewer plugin
Author: Christophe Gouiran
Flyspray: FS#9493
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22037 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/png/png.h')
-rw-r--r-- | apps/plugins/png/png.h | 341 |
1 files changed, 341 insertions, 0 deletions
diff --git a/apps/plugins/png/png.h b/apps/plugins/png/png.h new file mode 100644 index 0000000000..2449a754e3 --- /dev/null +++ b/apps/plugins/png/png.h | |||
@@ -0,0 +1,341 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$id $ | ||
9 | * | ||
10 | * Copyright (C) 2009 by Christophe Gouiran <bechris13250 -at- gmail -dot- com> | ||
11 | * | ||
12 | * Based on lodepng, a lightweight png decoder/encoder | ||
13 | * (c) 2005-2008 Lode Vandevenne | ||
14 | * | ||
15 | * This program is free software; you can redistribute it and/or | ||
16 | * modify it under the terms of the GNU General Public License | ||
17 | * as published by the Free Software Foundation; either version 2 | ||
18 | * of the License, or (at your option) any later version. | ||
19 | * | ||
20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
21 | * KIND, either express or implied. | ||
22 | * | ||
23 | ****************************************************************************/ | ||
24 | |||
25 | /* | ||
26 | LodePNG version 20080927 | ||
27 | |||
28 | Copyright (c) 2005-2008 Lode Vandevenne | ||
29 | |||
30 | This software is provided 'as-is', without any express or implied | ||
31 | warranty. In no event will the authors be held liable for any damages | ||
32 | arising from the use of this software. | ||
33 | |||
34 | Permission is granted to anyone to use this software for any purpose, | ||
35 | including commercial applications, and to alter it and redistribute it | ||
36 | freely, subject to the following restrictions: | ||
37 | |||
38 | 1. The origin of this software must not be misrepresented; you must not | ||
39 | claim that you wrote the original software. If you use this software | ||
40 | in a product, an acknowledgment in the product documentation would be | ||
41 | appreciated but is not required. | ||
42 | |||
43 | 2. Altered source versions must be plainly marked as such, and must not be | ||
44 | misrepresented as being the original software. | ||
45 | |||
46 | 3. This notice may not be removed or altered from any source | ||
47 | distribution. | ||
48 | */ | ||
49 | |||
50 | /* | ||
51 | The manual and changelog can be found in the header file "lodepng.h" | ||
52 | You are free to name this file lodepng.cpp or lodepng.c depending on your usage. | ||
53 | */ | ||
54 | |||
55 | /* variable button definitions */ | ||
56 | #if CONFIG_KEYPAD == RECORDER_PAD | ||
57 | #define PNG_ZOOM_IN BUTTON_PLAY | ||
58 | #define PNG_ZOOM_OUT BUTTON_ON | ||
59 | #define PNG_UP BUTTON_UP | ||
60 | #define PNG_DOWN BUTTON_DOWN | ||
61 | #define PNG_LEFT BUTTON_LEFT | ||
62 | #define PNG_RIGHT BUTTON_RIGHT | ||
63 | #define PNG_NEXT BUTTON_F3 | ||
64 | #define PNG_PREVIOUS BUTTON_F2 | ||
65 | #define PNG_MENU BUTTON_OFF | ||
66 | |||
67 | #elif CONFIG_KEYPAD == ARCHOS_AV300_PAD | ||
68 | #define PNG_ZOOM_IN BUTTON_SELECT | ||
69 | #define PNG_ZOOM_OUT BUTTON_ON | ||
70 | #define PNG_UP BUTTON_UP | ||
71 | #define PNG_DOWN BUTTON_DOWN | ||
72 | #define PNG_LEFT BUTTON_LEFT | ||
73 | #define PNG_RIGHT BUTTON_RIGHT | ||
74 | #define PNG_NEXT BUTTON_F3 | ||
75 | #define PNG_PREVIOUS BUTTON_F2 | ||
76 | #define PNG_MENU BUTTON_OFF | ||
77 | |||
78 | #elif CONFIG_KEYPAD == ONDIO_PAD | ||
79 | #define PNG_ZOOM_PRE BUTTON_MENU | ||
80 | #define PNG_ZOOM_IN (BUTTON_MENU | BUTTON_REL) | ||
81 | #define PNG_ZOOM_OUT (BUTTON_MENU | BUTTON_DOWN) | ||
82 | #define PNG_UP BUTTON_UP | ||
83 | #define PNG_DOWN BUTTON_DOWN | ||
84 | #define PNG_LEFT BUTTON_LEFT | ||
85 | #define PNG_RIGHT BUTTON_RIGHT | ||
86 | #define PNG_NEXT (BUTTON_MENU | BUTTON_RIGHT) | ||
87 | #define PNG_PREVIOUS (BUTTON_MENU | BUTTON_LEFT) | ||
88 | #define PNG_MENU BUTTON_OFF | ||
89 | |||
90 | #elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \ | ||
91 | (CONFIG_KEYPAD == IRIVER_H300_PAD) | ||
92 | #define PNG_ZOOM_IN BUTTON_SELECT | ||
93 | #define PNG_ZOOM_OUT BUTTON_MODE | ||
94 | #define PNG_UP BUTTON_UP | ||
95 | #define PNG_DOWN BUTTON_DOWN | ||
96 | #define PNG_LEFT BUTTON_LEFT | ||
97 | #define PNG_RIGHT BUTTON_RIGHT | ||
98 | #if (CONFIG_KEYPAD == IRIVER_H100_PAD) | ||
99 | #define PNG_NEXT BUTTON_ON | ||
100 | #define PNG_PREVIOUS BUTTON_REC | ||
101 | #else | ||
102 | #define PNG_NEXT BUTTON_REC | ||
103 | #define PNG_PREVIOUS BUTTON_ON | ||
104 | #endif | ||
105 | #define PNG_MENU BUTTON_OFF | ||
106 | #define PNG_RC_MENU BUTTON_RC_STOP | ||
107 | |||
108 | #elif (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_3G_PAD) || \ | ||
109 | (CONFIG_KEYPAD == IPOD_1G2G_PAD) | ||
110 | #define PNG_ZOOM_IN BUTTON_SCROLL_FWD | ||
111 | #define PNG_ZOOM_OUT BUTTON_SCROLL_BACK | ||
112 | #define PNG_UP BUTTON_MENU | ||
113 | #define PNG_DOWN BUTTON_PLAY | ||
114 | #define PNG_LEFT BUTTON_LEFT | ||
115 | #define PNG_RIGHT BUTTON_RIGHT | ||
116 | #define PNG_MENU (BUTTON_SELECT | BUTTON_MENU) | ||
117 | #define PNG_NEXT (BUTTON_SELECT | BUTTON_RIGHT) | ||
118 | #define PNG_PREVIOUS (BUTTON_SELECT | BUTTON_LEFT) | ||
119 | |||
120 | #elif CONFIG_KEYPAD == IAUDIO_X5M5_PAD | ||
121 | #define PNG_ZOOM_PRE BUTTON_SELECT | ||
122 | #define PNG_ZOOM_IN (BUTTON_SELECT | BUTTON_REL) | ||
123 | #define PNG_ZOOM_OUT (BUTTON_SELECT | BUTTON_REPEAT) | ||
124 | #define PNG_UP BUTTON_UP | ||
125 | #define PNG_DOWN BUTTON_DOWN | ||
126 | #define PNG_LEFT BUTTON_LEFT | ||
127 | #define PNG_RIGHT BUTTON_RIGHT | ||
128 | #define PNG_MENU BUTTON_POWER | ||
129 | #define PNG_NEXT BUTTON_PLAY | ||
130 | #define PNG_PREVIOUS BUTTON_REC | ||
131 | |||
132 | #elif CONFIG_KEYPAD == GIGABEAT_PAD | ||
133 | #define PNG_ZOOM_IN BUTTON_VOL_UP | ||
134 | #define PNG_ZOOM_OUT BUTTON_VOL_DOWN | ||
135 | #define PNG_UP BUTTON_UP | ||
136 | #define PNG_DOWN BUTTON_DOWN | ||
137 | #define PNG_LEFT BUTTON_LEFT | ||
138 | #define PNG_RIGHT BUTTON_RIGHT | ||
139 | #define PNG_MENU BUTTON_MENU | ||
140 | #define PNG_NEXT (BUTTON_A | BUTTON_RIGHT) | ||
141 | #define PNG_PREVIOUS (BUTTON_A | BUTTON_LEFT) | ||
142 | |||
143 | #elif CONFIG_KEYPAD == SANSA_E200_PAD | ||
144 | #define PNG_ZOOM_PRE BUTTON_SELECT | ||
145 | #define PNG_ZOOM_IN (BUTTON_SELECT | BUTTON_REL) | ||
146 | #define PNG_ZOOM_OUT (BUTTON_SELECT | BUTTON_REPEAT) | ||
147 | #define PNG_UP BUTTON_UP | ||
148 | #define PNG_DOWN BUTTON_DOWN | ||
149 | #define PNG_LEFT BUTTON_LEFT | ||
150 | #define PNG_RIGHT BUTTON_RIGHT | ||
151 | #define PNG_MENU BUTTON_POWER | ||
152 | #define PNG_SLIDE_SHOW BUTTON_REC | ||
153 | #define PNG_NEXT BUTTON_SCROLL_FWD | ||
154 | #define PNG_NEXT_REPEAT (BUTTON_SCROLL_FWD|BUTTON_REPEAT) | ||
155 | #define PNG_PREVIOUS BUTTON_SCROLL_BACK | ||
156 | #define PNG_PREVIOUS_REPEAT (BUTTON_SCROLL_BACK|BUTTON_REPEAT) | ||
157 | |||
158 | #elif CONFIG_KEYPAD == SANSA_FUZE_PAD | ||
159 | #define PNG_ZOOM_PRE BUTTON_SELECT | ||
160 | #define PNG_ZOOM_IN (BUTTON_SELECT | BUTTON_REL) | ||
161 | #define PNG_ZOOM_OUT (BUTTON_SELECT | BUTTON_REPEAT) | ||
162 | #define PNG_UP BUTTON_UP | ||
163 | #define PNG_DOWN BUTTON_DOWN | ||
164 | #define PNG_LEFT BUTTON_LEFT | ||
165 | #define PNG_RIGHT BUTTON_RIGHT | ||
166 | #define PNG_MENU (BUTTON_HOME|BUTTON_REPEAT) | ||
167 | #define PNG_NEXT BUTTON_SCROLL_FWD | ||
168 | #define PNG_NEXT_REPEAT (BUTTON_SCROLL_FWD|BUTTON_REPEAT) | ||
169 | #define PNG_PREVIOUS BUTTON_SCROLL_BACK | ||
170 | #define PNG_PREVIOUS_REPEAT (BUTTON_SCROLL_BACK|BUTTON_REPEAT) | ||
171 | |||
172 | #elif CONFIG_KEYPAD == SANSA_C200_PAD | ||
173 | #define PNG_ZOOM_PRE BUTTON_SELECT | ||
174 | #define PNG_ZOOM_IN (BUTTON_SELECT | BUTTON_REL) | ||
175 | #define PNG_ZOOM_OUT (BUTTON_SELECT | BUTTON_REPEAT) | ||
176 | #define PNG_UP BUTTON_UP | ||
177 | #define PNG_DOWN BUTTON_DOWN | ||
178 | #define PNG_LEFT BUTTON_LEFT | ||
179 | #define PNG_RIGHT BUTTON_RIGHT | ||
180 | #define PNG_MENU BUTTON_POWER | ||
181 | #define PNG_SLIDE_SHOW BUTTON_REC | ||
182 | #define PNG_NEXT BUTTON_VOL_UP | ||
183 | #define PNG_NEXT_REPEAT (BUTTON_VOL_UP|BUTTON_REPEAT) | ||
184 | #define PNG_PREVIOUS BUTTON_VOL_DOWN | ||
185 | #define PNG_PREVIOUS_REPEAT (BUTTON_VOL_DOWN|BUTTON_REPEAT) | ||
186 | |||
187 | #elif CONFIG_KEYPAD == SANSA_CLIP_PAD | ||
188 | #define PNG_ZOOM_PRE BUTTON_SELECT | ||
189 | #define PNG_ZOOM_IN (BUTTON_SELECT | BUTTON_REL) | ||
190 | #define PNG_ZOOM_OUT (BUTTON_SELECT | BUTTON_REPEAT) | ||
191 | #define PNG_UP BUTTON_UP | ||
192 | #define PNG_DOWN BUTTON_DOWN | ||
193 | #define PNG_LEFT BUTTON_LEFT | ||
194 | #define PNG_RIGHT BUTTON_RIGHT | ||
195 | #define PNG_MENU BUTTON_POWER | ||
196 | #define PNG_SLIDE_SHOW BUTTON_HOME | ||
197 | #define PNG_NEXT BUTTON_VOL_UP | ||
198 | #define PNG_NEXT_REPEAT (BUTTON_VOL_UP|BUTTON_REPEAT) | ||
199 | #define PNG_PREVIOUS BUTTON_VOL_DOWN | ||
200 | #define PNG_PREVIOUS_REPEAT (BUTTON_VOL_DOWN|BUTTON_REPEAT) | ||
201 | |||
202 | #elif CONFIG_KEYPAD == SANSA_M200_PAD | ||
203 | #define PNG_ZOOM_PRE BUTTON_SELECT | ||
204 | #define PNG_ZOOM_IN (BUTTON_SELECT | BUTTON_REL) | ||
205 | #define PNG_ZOOM_OUT (BUTTON_SELECT | BUTTON_REPEAT) | ||
206 | #define PNG_UP BUTTON_UP | ||
207 | #define PNG_DOWN BUTTON_DOWN | ||
208 | #define PNG_LEFT BUTTON_LEFT | ||
209 | #define PNG_RIGHT BUTTON_RIGHT | ||
210 | #define PNG_MENU BUTTON_POWER | ||
211 | #define PNG_SLIDE_SHOW (BUTTON_SELECT | BUTTON_UP) | ||
212 | #define PNG_NEXT BUTTON_VOL_UP | ||
213 | #define PNG_NEXT_REPEAT (BUTTON_VOL_UP|BUTTON_REPEAT) | ||
214 | #define PNG_PREVIOUS BUTTON_VOL_DOWN | ||
215 | #define PNG_PREVIOUS_REPEAT (BUTTON_VOL_DOWN|BUTTON_REPEAT) | ||
216 | |||
217 | #elif CONFIG_KEYPAD == IRIVER_H10_PAD | ||
218 | #define PNG_ZOOM_PRE BUTTON_PLAY | ||
219 | #define PNG_ZOOM_IN (BUTTON_PLAY | BUTTON_REL) | ||
220 | #define PNG_ZOOM_OUT (BUTTON_PLAY | BUTTON_REPEAT) | ||
221 | #define PNG_UP BUTTON_SCROLL_UP | ||
222 | #define PNG_DOWN BUTTON_SCROLL_DOWN | ||
223 | #define PNG_LEFT BUTTON_LEFT | ||
224 | #define PNG_RIGHT BUTTON_RIGHT | ||
225 | #define PNG_MENU BUTTON_POWER | ||
226 | #define PNG_NEXT BUTTON_FF | ||
227 | #define PNG_PREVIOUS BUTTON_REW | ||
228 | |||
229 | #elif CONFIG_KEYPAD == MROBE500_PAD | ||
230 | |||
231 | #elif CONFIG_KEYPAD == GIGABEAT_S_PAD | ||
232 | #define PNG_ZOOM_IN BUTTON_VOL_UP | ||
233 | #define PNG_ZOOM_OUT BUTTON_VOL_DOWN | ||
234 | #define PNG_UP BUTTON_UP | ||
235 | #define PNG_DOWN BUTTON_DOWN | ||
236 | #define PNG_LEFT BUTTON_LEFT | ||
237 | #define PNG_RIGHT BUTTON_RIGHT | ||
238 | #define PNG_MENU BUTTON_MENU | ||
239 | #define PNG_NEXT BUTTON_NEXT | ||
240 | #define PNG_PREVIOUS BUTTON_PREV | ||
241 | |||
242 | #elif CONFIG_KEYPAD == MROBE100_PAD | ||
243 | #define PNG_ZOOM_IN BUTTON_SELECT | ||
244 | #define PNG_ZOOM_OUT BUTTON_PLAY | ||
245 | #define PNG_UP BUTTON_UP | ||
246 | #define PNG_DOWN BUTTON_DOWN | ||
247 | #define PNG_LEFT BUTTON_LEFT | ||
248 | #define PNG_RIGHT BUTTON_RIGHT | ||
249 | #define PNG_MENU BUTTON_MENU | ||
250 | #define PNG_NEXT (BUTTON_DISPLAY | BUTTON_RIGHT) | ||
251 | #define PNG_PREVIOUS (BUTTON_DISPLAY | BUTTON_LEFT) | ||
252 | |||
253 | #elif CONFIG_KEYPAD == IAUDIO_M3_PAD | ||
254 | #define PNG_ZOOM_PRE BUTTON_RC_PLAY | ||
255 | #define PNG_ZOOM_IN (BUTTON_RC_PLAY|BUTTON_REL) | ||
256 | #define PNG_ZOOM_OUT (BUTTON_RC_PLAY|BUTTON_REPEAT) | ||
257 | #define PNG_UP BUTTON_RC_VOL_UP | ||
258 | #define PNG_DOWN BUTTON_RC_VOL_DOWN | ||
259 | #define PNG_LEFT BUTTON_RC_REW | ||
260 | #define PNG_RIGHT BUTTON_RC_FF | ||
261 | #define PNG_MENU BUTTON_RC_REC | ||
262 | #define PNG_NEXT BUTTON_RC_MODE | ||
263 | #define PNG_PREVIOUS BUTTON_RC_MENU | ||
264 | |||
265 | #elif CONFIG_KEYPAD == COWOND2_PAD | ||
266 | |||
267 | #elif CONFIG_KEYPAD == IAUDIO67_PAD | ||
268 | #define PNG_ZOOM_IN BUTTON_VOLUP | ||
269 | #define PNG_ZOOM_OUT BUTTON_VOLDOWN | ||
270 | #define PNG_UP BUTTON_STOP | ||
271 | #define PNG_DOWN BUTTON_PLAY | ||
272 | #define PNG_LEFT BUTTON_LEFT | ||
273 | #define PNG_RIGHT BUTTON_RIGHT | ||
274 | #define PNG_MENU BUTTON_MENU | ||
275 | #define PNG_NEXT (BUTTON_PLAY|BUTTON_VOLUP) | ||
276 | #define PNG_PREVIOUS (BUTTON_PLAY|BUTTON_VOLDOWN) | ||
277 | |||
278 | #elif CONFIG_KEYPAD == CREATIVEZVM_PAD | ||
279 | |||
280 | #define PNG_ZOOM_IN BUTTON_PLAY | ||
281 | #define PNG_ZOOM_OUT BUTTON_CUSTOM | ||
282 | #define PNG_UP BUTTON_UP | ||
283 | #define PNG_DOWN BUTTON_DOWN | ||
284 | #define PNG_LEFT BUTTON_LEFT | ||
285 | #define PNG_RIGHT BUTTON_RIGHT | ||
286 | #define PNG_MENU BUTTON_MENU | ||
287 | #define PNG_NEXT BUTTON_SELECT | ||
288 | #define PNG_PREVIOUS BUTTON_BACK | ||
289 | |||
290 | #elif CONFIG_KEYPAD == PHILIPS_HDD1630_PAD | ||
291 | #define PNG_ZOOM_IN BUTTON_VOL_UP | ||
292 | #define PNG_ZOOM_OUT BUTTON_VOL_DOWN | ||
293 | #define PNG_UP BUTTON_UP | ||
294 | #define PNG_DOWN BUTTON_DOWN | ||
295 | #define PNG_LEFT BUTTON_LEFT | ||
296 | #define PNG_RIGHT BUTTON_RIGHT | ||
297 | #define PNG_MENU BUTTON_MENU | ||
298 | #define PNG_NEXT BUTTON_VIEW | ||
299 | #define PNG_PREVIOUS BUTTON_PLAYLIST | ||
300 | |||
301 | #elif CONFIG_KEYPAD == ONDAVX747_PAD | ||
302 | |||
303 | #else | ||
304 | #error No keymap defined! | ||
305 | #endif | ||
306 | |||
307 | #ifdef HAVE_TOUCHSCREEN | ||
308 | #ifndef PNG_UP | ||
309 | #define PNG_UP BUTTON_TOPMIDDLE | ||
310 | #endif | ||
311 | #ifndef PNG_DOWN | ||
312 | #define PNG_DOWN BUTTON_BOTTOMMIDDLE | ||
313 | #endif | ||
314 | #ifndef PNG_LEFT | ||
315 | #define PNG_LEFT BUTTON_MIDLEFT | ||
316 | #endif | ||
317 | #ifndef PNG_RIGHT | ||
318 | #define PNG_RIGHT BUTTON_MIDRIGHT | ||
319 | #endif | ||
320 | #ifndef PNG_ZOOM_IN | ||
321 | #define PNG_ZOOM_IN BUTTON_TOPRIGHT | ||
322 | #endif | ||
323 | #ifndef PNG_ZOOM_OUT | ||
324 | #define PNG_ZOOM_OUT BUTTON_TOPLEFT | ||
325 | #endif | ||
326 | #ifndef PNG_MENU | ||
327 | #define PNG_MENU (BUTTON_CENTER|BUTTON_REL) | ||
328 | #endif | ||
329 | #ifndef PNG_NEXT | ||
330 | #define PNG_NEXT BUTTON_BOTTOMRIGHT | ||
331 | #endif | ||
332 | #ifndef PNG_PREVIOUS | ||
333 | #define PNG_PREVIOUS BUTTON_BOTTOMLEFT | ||
334 | #endif | ||
335 | #endif | ||
336 | |||
337 | #define PLUGIN_OTHER 10 /* State code for output with return. */ | ||
338 | #define PLUGIN_REFRESH 11 /* State code for output with return. */ | ||
339 | #define PLUGIN_ABORT 12 | ||
340 | #define OUT_OF_MEMORY 9900 | ||
341 | #define FILE_TOO_LARGE 9910 | ||