Thank you to anyone who has already donated - your generous donations helped make three months of treatment possible.
My brother Nate continues to fight stage IV Hodgkin's lymphoma. He's just 31, with a wife and baby girl. They have no active income (since he's been unable to return to work), no insurance, and cannot afford the treatment he needs. Nate and his family need your help. Please consider a donation, every dollar helps. Thanks.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 |
diff --git a/apps/plugin.c b/apps/plugin.c index 2528075..8f2f166 100644 static const struct plugin_api rockbox_api = { #endif #ifdef HAVE_TOUCHSCREEN touchscreen_set_mode, + touchscreen_get_mode, #endif #ifdef HAVE_BUTTON_LIGHT static const struct plugin_api rockbox_api = { get_action, #ifdef HAVE_TOUCHSCREEN action_get_touchscreen_press, + action_get_touchscreen_press_in_vp, #endif action_userabort, diff --git a/apps/plugin.h b/apps/plugin.h index d83f6f4..406b488 100644 struct plugin_api { #endif #ifdef HAVE_TOUCHSCREEN void (*touchscreen_set_mode)(enum touchscreen_mode); + enum touchscreen_mode (*touchscreen_get_mode)(void); #endif #ifdef HAVE_BUTTON_LIGHT void (*buttonlight_set_timeout)(int value); struct plugin_api { int (*get_action)(int context, int timeout); #ifdef HAVE_TOUCHSCREEN int (*action_get_touchscreen_press)(short *x, short *y); + int (*action_get_touchscreen_press_in_vp)(short *x, short *y, struct viewport *vp); #endif bool (*action_userabort)(int timeout); diff --git a/apps/plugins/CATEGORIES b/apps/plugins/CATEGORIES index 0ac5bdb..427f319 100644 test_mem,apps test_codec,viewers test_disk,apps test_fps,apps -test_grey,apps test_gfx,apps +test_grey,apps test_resize,apps test_sampr,apps test_scanrate,apps diff --git a/apps/plugins/SOURCES.app_build b/apps/plugins/SOURCES.app_build index e374062..e42e464 100644 theme_remove.c vbrfix.c #ifdef HAVE_TEST_PLUGINS /* enable in advanced build options */ +test_fps.c #ifdef HAVE_ADJUSTABLE_CPU_FREQ test_boost.c #endif diff --git a/apps/plugins/SUBDIRS b/apps/plugins/SUBDIRS index d2feb72..f374b45 100644 +#ifdef HAVE_TAGCACHE +pictureflow +#endif + +#if CONFIG_CODEC == SWCODEC && PLUGIN_BUFFER_SIZE > 0x20000 +fft +#endif +#ifndef APPLICATION /* For all targets */ shortcuts text_viewer clock rockboy #endif -#ifdef HAVE_TAGCACHE -pictureflow -#endif - -#if CONFIG_CODEC == SWCODEC && PLUGIN_BUFFER_SIZE > 0x20000 -fft -#endif - chessbox fractals imageviewer mpegplayer #if PLUGIN_BUFFER_SIZE >= 0x80000 lua #endif + +#endif /* APPLICATION */ diff --git a/apps/plugins/chopper.c b/apps/plugins/chopper.c index d819da4..b2c3653 100644 CONFIG_KEYPAD == MROBE500_PAD #define ACTION BUTTON_SELECT #define ACTIONTEXT "SELECT" -#else +#elif !defined(HAVE_TOUCHSCREEN) #error No keymap defined! #endif diff --git a/apps/plugins/fft/fft.c b/apps/plugins/fft/fft.c index b2ef8d8..1c4e1b4 100644 GREY_INFO_STRUCT # define FFT_FREQ_SCALE BUTTON_DOWN # define FFT_QUIT BUTTON_BACK -#else +#elif !defined(HAVE_TOUCHSCREEN) #error No keymap defined! #endif diff --git a/apps/plugins/test_codec.c b/apps/plugins/test_codec.c index 4c0739f..f02b3b7 100644 #elif CONFIG_KEYPAD == SAMSUNG_YPR0_PAD #define TESTCODEC_EXITBUTTON BUTTON_BACK #elif defined(HAVE_TOUCHSCREEN) -#define TESTCODEC_EXITBUTTON BUTTON_TOPLEFT +#define TESTCODEC_EXITBUTTON BUTTON_BOTTOMMIDDLE #else #define TESTCODEC_EXITBUTTON BUTTON_SELECT #endif exit: return res; } +#ifdef HAVE_TOUCHSCREEN +void cleanup(void) +{ + rb->screens[0]->set_viewport(NULL); +} +#endif + +void plugin_quit(void) +{ +#ifdef HAVE_TOUCHSCREEN + struct viewport vp; + struct screen *lcd = rb->screens[SCREEN_MAIN]; + rb->viewport_set_defaults(&vp, SCREEN_MAIN); + int font_height = rb->font_get(vp.font)->height; + int yoff; + + vp.x = 10; + vp.width = lcd->lcdwidth - 20; + vp.y = lcd->lcdheight - 60; + vp.height = 50; + vp.flags = VP_FLAG_ALIGN_CENTER; + + yoff = vp.height/2 - font_height/2; + lcd->set_viewport(&vp); + atexit(cleanup); + lcd->clear_viewport(); + lcd->set_foreground(LCD_WHITE); + lcd->putsxy(0, yoff, "OK"); + lcd->drawrect(vp.x, vp.y, vp.width, vp.height); + lcd->update_viewport(); + short x,y; + if (rb->touchscreen_get_mode() == TOUCHSCREEN_POINT) + { + while(1) + { + rb->get_action(CONTEXT_STD, TIMEOUT_BLOCK); + if (rb->action_get_touchscreen_press_in_vp(&x, &y, &vp) & BUTTON_REL) + break; + } + } + else +#endif + while (codec_action != CODEC_ACTION_HALT && + rb->button_get(true) != TESTCODEC_EXITBUTTON); +} + /* plugin entry point */ enum plugin_status plugin_start(const void* parameter) { menu: close_wav(); log_text("Wrote /test.wav",true); } - - while (codec_action != CODEC_ACTION_HALT && - rb->button_get(true) != TESTCODEC_EXITBUTTON); + plugin_quit(); } #ifdef HAVE_ADJUSTABLE_CPU_FREQ diff --git a/apps/plugins/test_fps.c b/apps/plugins/test_fps.c index 4514aa6..ac19954 100644 #define FPS_QUIT (BUTTON_M|BUTTON_REPEAT) #elif CONFIG_KEYPAD == SAMSUNG_YPR0_PAD #define FPS_QUIT BUTTON_BACK +#elif defined(HAVE_TOUCHSCREEN) +#define FPS_QUIT (BUTTON_BOTTOMMIDDLE|BUTTON_REL) #elif defined(BUTTON_OFF) #define FPS_QUIT BUTTON_OFF #else static void time_greyscale(void) } #endif +#ifdef HAVE_TOUCHSCREEN +void cleanup(void) +{ + rb->screens[0]->set_viewport(NULL); +} +#endif + +void plugin_quit(void) +{ +#ifdef HAVE_TOUCHSCREEN + struct viewport vp; + struct screen *lcd = rb->screens[SCREEN_MAIN]; + rb->viewport_set_defaults(&vp, SCREEN_MAIN); + int font_height = rb->font_get(vp.font)->height; + int yoff; + + vp.x = 10; + vp.width = lcd->lcdwidth - 20; + vp.y = lcd->lcdheight - 60; + vp.height = 50; + vp.flags = VP_FLAG_ALIGN_CENTER; + + yoff = vp.height/2 - font_height/2; + lcd->set_viewport(&vp); + atexit(cleanup); + lcd->clear_viewport(); + lcd->set_foreground(LCD_WHITE); + lcd->drawrect(vp.x, vp.y, vp.width, vp.height); + lcd->putsxy(0, yoff, "OK"); + lcd->update_viewport(); + short x,y; + if (rb->touchscreen_get_mode() == TOUCHSCREEN_POINT) + { + while(1) + { + rb->get_action(CONTEXT_STD, TIMEOUT_BLOCK); + if (rb->action_get_touchscreen_press_in_vp(&x, &y, &vp) & BUTTON_REL) + break; + } + } + else +#endif + while (rb->button_get(true) != FPS_QUIT); +} + /* plugin entry point */ enum plugin_status plugin_start(const void* parameter) { enum plugin_status plugin_start(const void* parameter) time_main_update(); rb->sleep(HZ); #if defined(HAVE_LCD_COLOR) && (MEMORYSIZE > 2) + rb->sleep(HZ/2); /* sleep a bit to see numbers */ time_main_yuv(); #endif #if LCD_DEPTH < 4 enum plugin_status plugin_start(const void* parameter) backlight_use_settings(); /* wait until user closes plugin */ - while (rb->button_get(true) != FPS_QUIT); + plugin_quit(); return PLUGIN_OK; } diff --git a/apps/plugins/test_touchscreen.c b/apps/plugins/test_touchscreen.c index 0c9cdc7..eb03b6d 100644 #elif (CONFIG_KEYPAD == ONDAVX747_PAD) #define TOUCHSCREEN_QUIT BUTTON_POWER #define TOUCHSCREEN_TOGGLE BUTTON_MENU +#elif (CONFIG_KEYPAD == ANDROID_PAD) +#define TOUCHSCREEN_QUIT BUTTON_BACK +#define TOUCHSCREEN_TOGGLE BUTTON_MENU +#elif (CONFIG_KEYPAD == SDL_PAD) +#define TOUCHSCREEN_QUIT BUTTON_MIDLEFT +#define TOUCHSCREEN_TOGGLE BUTTON_CENTER #endif /* plugin entry point */ enum plugin_status plugin_start(const void* parameter) mode = (mode == TOUCHSCREEN_POINT) ? TOUCHSCREEN_BUTTON : TOUCHSCREEN_POINT; rb->touchscreen_set_mode(mode); } - if (button & BUTTON_REL) draw_rect = false; rb->lcd_clear_display(); |