diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/plugin.c | 3 | ||||
-rw-r--r-- | apps/plugin.h | 5 | ||||
-rw-r--r-- | apps/recorder/widgets.c | 25 | ||||
-rw-r--r-- | apps/recorder/widgets.h | 1 |
4 files changed, 33 insertions, 1 deletions
diff --git a/apps/plugin.c b/apps/plugin.c index cdb787a0b0..3258dadad2 100644 --- a/apps/plugin.c +++ b/apps/plugin.c | |||
@@ -185,6 +185,9 @@ static struct plugin_api rockbox_api = { | |||
185 | #ifndef SIMULATOR | 185 | #ifndef SIMULATOR |
186 | ata_sleep, | 186 | ata_sleep, |
187 | #endif | 187 | #endif |
188 | #ifdef HAVE_LCD_BITMAP | ||
189 | checkbox, | ||
190 | #endif | ||
188 | }; | 191 | }; |
189 | 192 | ||
190 | int plugin_load(char* plugin, void* parameter) | 193 | int plugin_load(char* plugin, void* parameter) |
diff --git a/apps/plugin.h b/apps/plugin.h index e017247e77..720e4b20f3 100644 --- a/apps/plugin.h +++ b/apps/plugin.h | |||
@@ -50,7 +50,7 @@ | |||
50 | /* update this to latest version if a change to the api struct breaks | 50 | /* update this to latest version if a change to the api struct breaks |
51 | backwards compatibility (and please take the opportunity to sort in any | 51 | backwards compatibility (and please take the opportunity to sort in any |
52 | new function which are "waiting" at the end of the function table) */ | 52 | new function which are "waiting" at the end of the function table) */ |
53 | #define PLUGIN_MIN_API_VERSION 9 | 53 | #define PLUGIN_MIN_API_VERSION 10 |
54 | 54 | ||
55 | /* plugin return codes */ | 55 | /* plugin return codes */ |
56 | enum plugin_status { | 56 | enum plugin_status { |
@@ -207,6 +207,9 @@ struct plugin_api { | |||
207 | #ifndef SIMULATOR | 207 | #ifndef SIMULATOR |
208 | int (*ata_sleep)(void); | 208 | int (*ata_sleep)(void); |
209 | #endif | 209 | #endif |
210 | #ifdef HAVE_LCD_BITMAP | ||
211 | void (*checkbox)(int x, int y, int width, int height, bool checked); | ||
212 | #endif | ||
210 | }; | 213 | }; |
211 | 214 | ||
212 | /* defined by the plugin loader (plugin.c) */ | 215 | /* defined by the plugin loader (plugin.c) */ |
diff --git a/apps/recorder/widgets.c b/apps/recorder/widgets.c index 99257495cf..4008d2b4c2 100644 --- a/apps/recorder/widgets.c +++ b/apps/recorder/widgets.c | |||
@@ -210,4 +210,29 @@ void scrollbar(int x, int y, int width, int height, int items, int min_shown, | |||
210 | } | 210 | } |
211 | } | 211 | } |
212 | } | 212 | } |
213 | |||
214 | /* | ||
215 | * Print a checkbox | ||
216 | */ | ||
217 | void checkbox(int x, int y, int width, int height, bool checked) | ||
218 | { | ||
219 | /* check position and dimensions */ | ||
220 | if((x < 0) || (x + width > LCD_WIDTH) || | ||
221 | (y < 0) || (y + height > LCD_HEIGHT) || | ||
222 | (width < 4 ) || (height < 4 )) | ||
223 | { | ||
224 | return; | ||
225 | } | ||
226 | |||
227 | lcd_drawrect(x, y, width, height); | ||
228 | |||
229 | if (checked){ | ||
230 | lcd_drawline(x + 2, y + 2, x + width - 2 - 1 , y + height - 2 - 1); | ||
231 | lcd_drawline(x + 2, y + height - 2 - 1, x + width - 2 - 1, y + 2); | ||
232 | } else { | ||
233 | /* be sure to clear box */ | ||
234 | lcd_clearrect(x + 1, y + 1, width - 2, height - 2); | ||
235 | } | ||
236 | } | ||
237 | |||
213 | #endif | 238 | #endif |
diff --git a/apps/recorder/widgets.h b/apps/recorder/widgets.h index 18f59a8893..de8e78520f 100644 --- a/apps/recorder/widgets.h +++ b/apps/recorder/widgets.h | |||
@@ -38,5 +38,6 @@ enum { | |||
38 | extern void progressbar(int x, int y, int width, int height, int percent, int direction); | 38 | extern void progressbar(int x, int y, int width, int height, int percent, int direction); |
39 | extern void slidebar(int x, int y, int width, int height, int percent, int direction); | 39 | extern void slidebar(int x, int y, int width, int height, int percent, int direction); |
40 | extern void scrollbar(int x, int y, int width, int height, int items, int min_shown, int max_shown, int orientation); | 40 | extern void scrollbar(int x, int y, int width, int height, int items, int min_shown, int max_shown, int orientation); |
41 | extern void checkbox(int x, int y, int width, int height, bool checked); | ||
41 | #endif /* HAVE_LCD_BITMAP */ | 42 | #endif /* HAVE_LCD_BITMAP */ |
42 | #endif /* __WIDGETS_H__ */ | 43 | #endif /* __WIDGETS_H__ */ |