Jens Arnold | 468f9ec | 2005-02-15 08:03:56 +0000 | [diff] [blame] | 1 | /*************************************************************************** |
| 2 | * __________ __ ___. |
| 3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ |
| 4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / |
| 5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
| 6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
| 7 | * \/ \/ \/ \/ \/ |
| 8 | * $Id$ |
| 9 | * |
Christian Gmeiner | 7f9e1eb | 2006-03-27 17:34:23 +0000 | [diff] [blame] | 10 | * Copyright (C) 2005 Jonas H�gqvist |
Jens Arnold | 468f9ec | 2005-02-15 08:03:56 +0000 | [diff] [blame] | 11 | * |
Daniel Stenberg | 2acc0ac | 2008-06-28 18:10:04 +0000 | [diff] [blame^] | 12 | * This program is free software; you can redistribute it and/or |
| 13 | * modify it under the terms of the GNU General Public License |
| 14 | * as published by the Free Software Foundation; either version 2 |
| 15 | * of the License, or (at your option) any later version. |
Jens Arnold | 468f9ec | 2005-02-15 08:03:56 +0000 | [diff] [blame] | 16 | * |
| 17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
| 18 | * KIND, either express or implied. |
| 19 | * |
| 20 | **************************************************************************/ |
| 21 | #include "plugin.h" |
Jens Arnold | fabdf1d | 2005-03-05 22:45:04 +0000 | [diff] [blame] | 22 | #include "playergfx.h" |
Jens Arnold | 468f9ec | 2005-02-15 08:03:56 +0000 | [diff] [blame] | 23 | |
Jens Arnold | a36b1d4 | 2006-01-15 18:20:18 +0000 | [diff] [blame] | 24 | PLUGIN_HEADER |
| 25 | |
Jens Arnold | fabdf1d | 2005-03-05 22:45:04 +0000 | [diff] [blame] | 26 | #ifdef HAVE_LCD_BITMAP |
| 27 | #define DISPLAY_WIDTH LCD_WIDTH |
| 28 | #define DISPLAY_HEIGHT LCD_HEIGHT |
| 29 | #define RAND_SCALE 5 |
Jens Arnold | 468f9ec | 2005-02-15 08:03:56 +0000 | [diff] [blame] | 30 | |
Daniel Stenberg | ac31e6a | 2005-05-23 16:23:25 +0000 | [diff] [blame] | 31 | #ifdef HAVE_REMOTE_LCD |
| 32 | #define REMOTE_WIDTH LCD_REMOTE_WIDTH |
| 33 | #define REMOTE_HEIGHT LCD_REMOTE_HEIGHT |
Jonas Häggqvist | d5f372a | 2008-01-31 21:05:32 +0000 | [diff] [blame] | 34 | #include "remote_rockboxlogo.h" |
| 35 | #define REMOTE_LOGO_WIDTH BMPWIDTH_remote_rockboxlogo |
| 36 | #define REMOTE_LOGO_HEIGHT BMPHEIGHT_remote_rockboxlogo |
Jonas Häggqvist | 4cd37d5 | 2008-01-31 19:28:51 +0000 | [diff] [blame] | 37 | #define REMOTE_LOGO remote_rockboxlogo |
Jonas Häggqvist | 2dd3ea0 | 2008-01-31 20:42:28 +0000 | [diff] [blame] | 38 | extern const fb_remote_data remote_rockboxlogo[]; |
Jens Arnold | 9386730 | 2005-06-30 21:07:00 +0000 | [diff] [blame] | 39 | #endif /* HAVE_REMOTE_LCD */ |
Jonas Häggqvist | a7d8829 | 2005-05-16 12:07:30 +0000 | [diff] [blame] | 40 | |
Jonas Häggqvist | 4cd37d5 | 2008-01-31 19:28:51 +0000 | [diff] [blame] | 41 | #define LOGO rockboxlogo |
Jonas Häggqvist | d5f372a | 2008-01-31 21:05:32 +0000 | [diff] [blame] | 42 | #include "rockboxlogo.h" |
| 43 | #define LOGO_WIDTH BMPWIDTH_rockboxlogo |
| 44 | #define LOGO_HEIGHT BMPHEIGHT_rockboxlogo |
Jonas Häggqvist | 4cd37d5 | 2008-01-31 19:28:51 +0000 | [diff] [blame] | 45 | extern const fb_data rockboxlogo[]; |
Jens Arnold | fabdf1d | 2005-03-05 22:45:04 +0000 | [diff] [blame] | 46 | |
| 47 | #else /* !LCD_BITMAP */ |
| 48 | #define DISPLAY_WIDTH 55 |
| 49 | #define DISPLAY_HEIGHT 14 |
| 50 | #define RAND_SCALE 2 |
| 51 | #define LOGO_WIDTH 16 |
| 52 | #define LOGO_HEIGHT 7 |
| 53 | #define LOGO rockbox16x7 |
| 54 | const unsigned char rockbox16x7[] = { |
Jens Arnold | 9386730 | 2005-06-30 21:07:00 +0000 | [diff] [blame] | 55 | 0x47, 0x18, 0xa6, 0xd8, 0x66, 0xde, 0xb7, 0x9b, |
| 56 | 0x76, 0xdb, 0x26, 0xdb, 0x66, 0xde, |
Jens Arnold | fabdf1d | 2005-03-05 22:45:04 +0000 | [diff] [blame] | 57 | }; |
| 58 | #endif /* !LCD_BITMAP */ |
| 59 | |
| 60 | /* variable button definitions */ |
| 61 | #if CONFIG_KEYPAD == PLAYER_PAD |
| 62 | #define LP_QUIT BUTTON_STOP |
| 63 | #define LP_DEC_X BUTTON_LEFT |
| 64 | #define LP_INC_X BUTTON_RIGHT |
| 65 | #define LP_DEC_Y (BUTTON_ON | BUTTON_LEFT) |
| 66 | #define LP_INC_Y (BUTTON_ON | BUTTON_RIGHT) |
Jens Arnold | 29361ab | 2008-03-22 10:24:28 +0000 | [diff] [blame] | 67 | |
Dave Chapman | fb4e384 | 2006-02-24 20:54:09 +0000 | [diff] [blame] | 68 | #elif (CONFIG_KEYPAD == IPOD_4G_PAD) || \ |
Jens Arnold | b701322 | 2007-07-27 09:57:27 +0000 | [diff] [blame] | 69 | (CONFIG_KEYPAD == IPOD_3G_PAD) || \ |
| 70 | (CONFIG_KEYPAD == IPOD_1G2G_PAD) |
Dave Chapman | 54d44c8 | 2005-12-14 01:31:37 +0000 | [diff] [blame] | 71 | #define LP_QUIT BUTTON_MENU |
| 72 | #define LP_DEC_X BUTTON_LEFT |
| 73 | #define LP_INC_X BUTTON_RIGHT |
| 74 | #define LP_DEC_Y BUTTON_SCROLL_BACK |
| 75 | #define LP_INC_Y BUTTON_SCROLL_FWD |
Jens Arnold | 29361ab | 2008-03-22 10:24:28 +0000 | [diff] [blame] | 76 | |
Dave Chapman | d83e929 | 2006-01-12 00:35:50 +0000 | [diff] [blame] | 77 | #elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD |
| 78 | #define LP_QUIT BUTTON_PLAY |
| 79 | #define LP_DEC_X BUTTON_LEFT |
| 80 | #define LP_INC_X BUTTON_RIGHT |
| 81 | #define LP_DEC_Y BUTTON_DOWN |
| 82 | #define LP_INC_Y BUTTON_UP |
Jens Arnold | 29361ab | 2008-03-22 10:24:28 +0000 | [diff] [blame] | 83 | |
Jens Arnold | 85a226d | 2007-03-16 23:02:39 +0000 | [diff] [blame] | 84 | #elif CONFIG_KEYPAD == IAUDIO_X5M5_PAD |
Christian Gmeiner | 7f9e1eb | 2006-03-27 17:34:23 +0000 | [diff] [blame] | 85 | #define LP_QUIT BUTTON_POWER |
Daniel Stenberg | acf7d5e | 2006-01-19 12:44:46 +0000 | [diff] [blame] | 86 | #define LP_DEC_X BUTTON_LEFT |
| 87 | #define LP_INC_X BUTTON_RIGHT |
| 88 | #define LP_DEC_Y BUTTON_DOWN |
| 89 | #define LP_INC_Y BUTTON_UP |
Jens Arnold | 29361ab | 2008-03-22 10:24:28 +0000 | [diff] [blame] | 90 | |
Marcoen Hirschberg | 338e2bb | 2006-02-24 15:42:52 +0000 | [diff] [blame] | 91 | #elif CONFIG_KEYPAD == GIGABEAT_PAD |
Marcoen Hirschberg | a7168fe | 2007-05-19 23:38:09 +0000 | [diff] [blame] | 92 | #define LP_QUIT BUTTON_POWER |
Marcoen Hirschberg | 338e2bb | 2006-02-24 15:42:52 +0000 | [diff] [blame] | 93 | #define LP_DEC_X BUTTON_LEFT |
| 94 | #define LP_INC_X BUTTON_RIGHT |
| 95 | #define LP_DEC_Y BUTTON_DOWN |
| 96 | #define LP_INC_Y BUTTON_UP |
Barry Wardell | 24f4a2a | 2006-10-26 13:38:09 +0000 | [diff] [blame] | 97 | |
Marianne Arnold | 12ddb8e | 2007-09-20 10:49:48 +0000 | [diff] [blame] | 98 | #elif (CONFIG_KEYPAD == SANSA_E200_PAD) || \ |
| 99 | (CONFIG_KEYPAD == SANSA_C200_PAD) |
Barry Wardell | 24f4a2a | 2006-10-26 13:38:09 +0000 | [diff] [blame] | 100 | #define LP_QUIT BUTTON_POWER |
| 101 | #define LP_DEC_X BUTTON_LEFT |
| 102 | #define LP_INC_X BUTTON_RIGHT |
| 103 | #define LP_DEC_Y BUTTON_DOWN |
| 104 | #define LP_INC_Y BUTTON_UP |
| 105 | |
Daniel Stenberg | 1e88be5 | 2006-08-03 20:17:25 +0000 | [diff] [blame] | 106 | #elif CONFIG_KEYPAD == IRIVER_H10_PAD |
| 107 | #define LP_QUIT BUTTON_POWER |
| 108 | #define LP_DEC_X BUTTON_LEFT |
| 109 | #define LP_INC_X BUTTON_RIGHT |
| 110 | #define LP_DEC_Y BUTTON_SCROLL_DOWN |
| 111 | #define LP_INC_Y BUTTON_SCROLL_UP |
Jonathan Gordon | 56ddddc | 2007-10-23 15:40:51 +0000 | [diff] [blame] | 112 | |
| 113 | #elif CONFIG_KEYPAD == MROBE500_PAD |
| 114 | #define LP_QUIT BUTTON_POWER |
| 115 | #define LP_DEC_X BUTTON_LEFT |
| 116 | #define LP_INC_X BUTTON_RIGHT |
| 117 | #define LP_DEC_Y BUTTON_RC_DOWN |
| 118 | #define LP_INC_Y BUTTON_RC_PLAY |
| 119 | |
Will Robertson | 8215b34 | 2008-02-17 12:23:02 +0000 | [diff] [blame] | 120 | #elif CONFIG_KEYPAD == GIGABEAT_S_PAD |
| 121 | #define LP_QUIT BUTTON_BACK |
| 122 | #define LP_DEC_X BUTTON_LEFT |
| 123 | #define LP_INC_X BUTTON_RIGHT |
| 124 | #define LP_DEC_Y BUTTON_DOWN |
| 125 | #define LP_INC_Y BUTTON_UP |
| 126 | |
Robert Kukla | d6c8b57 | 2008-03-01 22:55:09 +0000 | [diff] [blame] | 127 | #elif CONFIG_KEYPAD == MROBE100_PAD |
| 128 | #define LP_QUIT BUTTON_POWER |
| 129 | #define LP_DEC_X BUTTON_LEFT |
| 130 | #define LP_INC_X BUTTON_RIGHT |
| 131 | #define LP_DEC_Y BUTTON_DOWN |
| 132 | #define LP_INC_Y BUTTON_UP |
| 133 | |
Jens Arnold | 29361ab | 2008-03-22 10:24:28 +0000 | [diff] [blame] | 134 | #elif CONFIG_KEYPAD == IAUDIO_M3_PAD |
| 135 | #define LP_QUIT BUTTON_RC_REC |
| 136 | #define LP_DEC_X BUTTON_RC_REW |
| 137 | #define LP_INC_X BUTTON_RC_FF |
| 138 | #define LP_DEC_Y BUTTON_RC_VOL_DOWN |
| 139 | #define LP_INC_Y BUTTON_RC_VOL_UP |
| 140 | |
Rob Purchase | 554d7ed | 2008-03-22 22:03:34 +0000 | [diff] [blame] | 141 | #elif CONFIG_KEYPAD == COWOND2_PAD |
| 142 | #define LP_QUIT BUTTON_POWER |
Rob Purchase | 554d7ed | 2008-03-22 22:03:34 +0000 | [diff] [blame] | 143 | |
Jens Arnold | fabdf1d | 2005-03-05 22:45:04 +0000 | [diff] [blame] | 144 | #else |
| 145 | #define LP_QUIT BUTTON_OFF |
| 146 | #define LP_DEC_X BUTTON_LEFT |
| 147 | #define LP_INC_X BUTTON_RIGHT |
| 148 | #define LP_DEC_Y BUTTON_DOWN |
| 149 | #define LP_INC_Y BUTTON_UP |
Jens Arnold | 468f9ec | 2005-02-15 08:03:56 +0000 | [diff] [blame] | 150 | #endif |
| 151 | |
Jonas Häggqvist | e2c9317 | 2005-06-02 11:50:05 +0000 | [diff] [blame] | 152 | #ifdef CONFIG_REMOTE_KEYPAD |
Daniel Stenberg | 01377e2 | 2005-06-29 12:47:24 +0000 | [diff] [blame] | 153 | #if (CONFIG_REMOTE_KEYPAD == H100_REMOTE) || \ |
| 154 | (CONFIG_REMOTE_KEYPAD == H300_REMOTE) |
Jonas Häggqvist | e2c9317 | 2005-06-02 11:50:05 +0000 | [diff] [blame] | 155 | #define LP_R_QUIT BUTTON_RC_STOP |
| 156 | #define LP_R_DEC_X BUTTON_RC_REW |
| 157 | #define LP_R_INC_X BUTTON_RC_FF |
| 158 | #define LP_R_DEC_Y BUTTON_RC_SOURCE |
| 159 | #define LP_R_INC_Y BUTTON_RC_BITRATE |
| 160 | #endif |
| 161 | #endif /* CONFIG_REMOTE_KEYPAD */ |
| 162 | |
Rob Purchase | 297e050 | 2008-04-27 15:30:19 +0000 | [diff] [blame] | 163 | #ifdef HAVE_TOUCHPAD |
| 164 | #ifndef LP_QUIT |
| 165 | #define LP_QUIT BUTTON_TOPLEFT |
| 166 | #endif |
| 167 | #ifndef LP_DEC_X |
| 168 | #define LP_DEC_X BUTTON_MIDLEFT |
| 169 | #endif |
| 170 | #ifndef LP_INC_X |
| 171 | #define LP_INC_X BUTTON_MIDRIGHT |
| 172 | #endif |
| 173 | #ifndef LP_DEC_Y |
| 174 | #define LP_DEC_Y BUTTON_TOPMIDDLE |
| 175 | #endif |
| 176 | #ifndef LP_INC_Y |
| 177 | #define LP_INC_Y BUTTON_BOTTOMMIDDLE |
| 178 | #endif |
| 179 | #endif |
Jens Arnold | 468f9ec | 2005-02-15 08:03:56 +0000 | [diff] [blame] | 180 | |
Steve Bavin | 6526577 | 2008-05-13 09:57:56 +0000 | [diff] [blame] | 181 | enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter) { |
Jens Arnold | 468f9ec | 2005-02-15 08:03:56 +0000 | [diff] [blame] | 182 | int button; |
| 183 | int timer = 10; |
Jens Arnold | fabdf1d | 2005-03-05 22:45:04 +0000 | [diff] [blame] | 184 | int x = (DISPLAY_WIDTH / 2) - (LOGO_WIDTH / 2); |
| 185 | int y = (DISPLAY_HEIGHT / 2) - (LOGO_HEIGHT / 2); |
Steve Bavin | 6526577 | 2008-05-13 09:57:56 +0000 | [diff] [blame] | 186 | const struct plugin_api* rb = api; |
Daniel Stenberg | 74f941e | 2005-02-15 09:27:23 +0000 | [diff] [blame] | 187 | int dx; |
| 188 | int dy; |
Jens Arnold | fabdf1d | 2005-03-05 22:45:04 +0000 | [diff] [blame] | 189 | #ifdef HAVE_LCD_CHARCELLS |
| 190 | int cpos = -1; |
| 191 | int old_cpos = -1; |
| 192 | #endif |
Daniel Stenberg | 74f941e | 2005-02-15 09:27:23 +0000 | [diff] [blame] | 193 | |
Jens Arnold | 468f9ec | 2005-02-15 08:03:56 +0000 | [diff] [blame] | 194 | (void)parameter; |
Daniel Stenberg | 74f941e | 2005-02-15 09:27:23 +0000 | [diff] [blame] | 195 | |
Jens Arnold | fabdf1d | 2005-03-05 22:45:04 +0000 | [diff] [blame] | 196 | #ifdef HAVE_LCD_CHARCELLS |
| 197 | if (!pgfx_init(rb, 4, 2)) { |
Jens Arnold | 4d6374c | 2007-03-16 21:56:08 +0000 | [diff] [blame] | 198 | rb->splash(HZ*2, "Old LCD :("); |
Jens Arnold | fabdf1d | 2005-03-05 22:45:04 +0000 | [diff] [blame] | 199 | return PLUGIN_OK; |
| 200 | } |
| 201 | #endif |
| 202 | rb->srand(*rb->current_tick); |
| 203 | dx = rb->rand()%(2*RAND_SCALE+1) - RAND_SCALE; |
| 204 | dy = rb->rand()%(2*RAND_SCALE+1) - RAND_SCALE; |
Jens Arnold | 468f9ec | 2005-02-15 08:03:56 +0000 | [diff] [blame] | 205 | |
| 206 | while (1) { |
Jens Arnold | fabdf1d | 2005-03-05 22:45:04 +0000 | [diff] [blame] | 207 | #ifdef HAVE_LCD_BITMAP |
Jens Arnold | 468f9ec | 2005-02-15 08:03:56 +0000 | [diff] [blame] | 208 | rb->lcd_clear_display(); |
Jonas Häggqvist | 4cd37d5 | 2008-01-31 19:28:51 +0000 | [diff] [blame] | 209 | rb->lcd_bitmap(LOGO, x, y, LOGO_WIDTH, LOGO_HEIGHT); |
Jonas Häggqvist | a7d8829 | 2005-05-16 12:07:30 +0000 | [diff] [blame] | 210 | #ifdef REMOTE_LOGO |
Jens Arnold | 576908d | 2005-06-29 01:39:50 +0000 | [diff] [blame] | 211 | rb->lcd_remote_clear_display(); |
Jonas Häggqvist | 4cd37d5 | 2008-01-31 19:28:51 +0000 | [diff] [blame] | 212 | rb->lcd_remote_bitmap(REMOTE_LOGO, |
Jonas Häggqvist | a7d8829 | 2005-05-16 12:07:30 +0000 | [diff] [blame] | 213 | (x * (REMOTE_WIDTH - REMOTE_LOGO_WIDTH)) / (DISPLAY_WIDTH - LOGO_WIDTH), |
| 214 | (y * (REMOTE_HEIGHT - REMOTE_LOGO_HEIGHT)) / (DISPLAY_HEIGHT - LOGO_HEIGHT), |
Jens Arnold | 576908d | 2005-06-29 01:39:50 +0000 | [diff] [blame] | 215 | REMOTE_LOGO_WIDTH, REMOTE_LOGO_HEIGHT); |
Jonas Häggqvist | a7d8829 | 2005-05-16 12:07:30 +0000 | [diff] [blame] | 216 | #endif |
Jens Arnold | fabdf1d | 2005-03-05 22:45:04 +0000 | [diff] [blame] | 217 | #else |
| 218 | pgfx_clear_display(); |
Jens Arnold | d7f9439 | 2005-07-07 00:05:29 +0000 | [diff] [blame] | 219 | pgfx_mono_bitmap(LOGO, x % 5, y, LOGO_WIDTH, LOGO_HEIGHT); |
Jens Arnold | fabdf1d | 2005-03-05 22:45:04 +0000 | [diff] [blame] | 220 | cpos = x / 5; |
| 221 | #endif |
Jens Arnold | 468f9ec | 2005-02-15 08:03:56 +0000 | [diff] [blame] | 222 | |
| 223 | x += dx; |
| 224 | if (x < 0) { |
| 225 | dx = -dx; |
| 226 | x = 0; |
| 227 | } |
Jens Arnold | fabdf1d | 2005-03-05 22:45:04 +0000 | [diff] [blame] | 228 | if (x > DISPLAY_WIDTH - LOGO_WIDTH) { |
Jens Arnold | 468f9ec | 2005-02-15 08:03:56 +0000 | [diff] [blame] | 229 | dx = -dx; |
Jens Arnold | fabdf1d | 2005-03-05 22:45:04 +0000 | [diff] [blame] | 230 | x = DISPLAY_WIDTH - LOGO_WIDTH; |
Jens Arnold | 468f9ec | 2005-02-15 08:03:56 +0000 | [diff] [blame] | 231 | } |
| 232 | |
| 233 | y += dy; |
| 234 | if (y < 0) { |
| 235 | dy = -dy; |
| 236 | y = 0; |
| 237 | } |
Jens Arnold | fabdf1d | 2005-03-05 22:45:04 +0000 | [diff] [blame] | 238 | if (y > DISPLAY_HEIGHT - LOGO_HEIGHT) { |
Jens Arnold | 468f9ec | 2005-02-15 08:03:56 +0000 | [diff] [blame] | 239 | dy = -dy; |
Jens Arnold | fabdf1d | 2005-03-05 22:45:04 +0000 | [diff] [blame] | 240 | y = DISPLAY_HEIGHT - LOGO_HEIGHT; |
Jens Arnold | 468f9ec | 2005-02-15 08:03:56 +0000 | [diff] [blame] | 241 | } |
Jens Arnold | fabdf1d | 2005-03-05 22:45:04 +0000 | [diff] [blame] | 242 | |
| 243 | #ifdef HAVE_LCD_BITMAP |
Jens Arnold | 468f9ec | 2005-02-15 08:03:56 +0000 | [diff] [blame] | 244 | rb->lcd_update(); |
Jonas Häggqvist | a7d8829 | 2005-05-16 12:07:30 +0000 | [diff] [blame] | 245 | #ifdef REMOTE_LOGO |
Jens Arnold | 576908d | 2005-06-29 01:39:50 +0000 | [diff] [blame] | 246 | rb->lcd_remote_update(); |
Jonas Häggqvist | a7d8829 | 2005-05-16 12:07:30 +0000 | [diff] [blame] | 247 | #endif |
Jens Arnold | fabdf1d | 2005-03-05 22:45:04 +0000 | [diff] [blame] | 248 | #else |
| 249 | if (cpos != old_cpos) { |
| 250 | rb->lcd_clear_display(); |
Jens Arnold | fabdf1d | 2005-03-05 22:45:04 +0000 | [diff] [blame] | 251 | pgfx_display(cpos, 0); |
| 252 | old_cpos = cpos; |
| 253 | } |
Jens Arnold | f9b90e9 | 2007-04-06 22:55:00 +0000 | [diff] [blame] | 254 | pgfx_update(); |
Jens Arnold | fabdf1d | 2005-03-05 22:45:04 +0000 | [diff] [blame] | 255 | #endif |
Jens Arnold | 468f9ec | 2005-02-15 08:03:56 +0000 | [diff] [blame] | 256 | rb->sleep(HZ/timer); |
| 257 | |
| 258 | button = rb->button_get(false); |
| 259 | switch (button) { |
Jens Arnold | fabdf1d | 2005-03-05 22:45:04 +0000 | [diff] [blame] | 260 | case LP_QUIT: |
Jonas Häggqvist | e2c9317 | 2005-06-02 11:50:05 +0000 | [diff] [blame] | 261 | #ifdef CONFIG_REMOTE_KEYPAD |
| 262 | case LP_R_QUIT: |
| 263 | #endif |
Jens Arnold | fabdf1d | 2005-03-05 22:45:04 +0000 | [diff] [blame] | 264 | #ifdef HAVE_LCD_CHARCELLS |
| 265 | pgfx_release(); |
| 266 | #endif |
Jens Arnold | 468f9ec | 2005-02-15 08:03:56 +0000 | [diff] [blame] | 267 | return PLUGIN_OK; |
Jens Arnold | fabdf1d | 2005-03-05 22:45:04 +0000 | [diff] [blame] | 268 | case LP_DEC_X: |
Jonas Häggqvist | e2c9317 | 2005-06-02 11:50:05 +0000 | [diff] [blame] | 269 | #ifdef CONFIG_REMOTE_KEYPAD |
| 270 | case LP_R_DEC_X: |
| 271 | #endif |
Jens Arnold | fabdf1d | 2005-03-05 22:45:04 +0000 | [diff] [blame] | 272 | if (dx) |
| 273 | dx += (dx < 0) ? 1 : -1; |
Jens Arnold | 468f9ec | 2005-02-15 08:03:56 +0000 | [diff] [blame] | 274 | break; |
Jens Arnold | fabdf1d | 2005-03-05 22:45:04 +0000 | [diff] [blame] | 275 | case LP_INC_X: |
Jonas Häggqvist | e2c9317 | 2005-06-02 11:50:05 +0000 | [diff] [blame] | 276 | #ifdef CONFIG_REMOTE_KEYPAD |
| 277 | case LP_R_INC_X: |
| 278 | #endif |
Jens Arnold | fabdf1d | 2005-03-05 22:45:04 +0000 | [diff] [blame] | 279 | dx += (dx < 0) ? -1 : 1; |
Jens Arnold | 468f9ec | 2005-02-15 08:03:56 +0000 | [diff] [blame] | 280 | break; |
Jens Arnold | fabdf1d | 2005-03-05 22:45:04 +0000 | [diff] [blame] | 281 | case LP_DEC_Y: |
Jonas Häggqvist | e2c9317 | 2005-06-02 11:50:05 +0000 | [diff] [blame] | 282 | #ifdef CONFIG_REMOTE_KEYPAD |
| 283 | case LP_R_DEC_Y: |
| 284 | #endif |
Jens Arnold | fabdf1d | 2005-03-05 22:45:04 +0000 | [diff] [blame] | 285 | if (dy) |
| 286 | dy += (dy < 0) ? 1 : -1; |
Jens Arnold | 468f9ec | 2005-02-15 08:03:56 +0000 | [diff] [blame] | 287 | break; |
Jens Arnold | fabdf1d | 2005-03-05 22:45:04 +0000 | [diff] [blame] | 288 | case LP_INC_Y: |
Jonas Häggqvist | e2c9317 | 2005-06-02 11:50:05 +0000 | [diff] [blame] | 289 | #ifdef CONFIG_REMOTE_KEYPAD |
| 290 | case LP_R_INC_Y: |
| 291 | #endif |
Jens Arnold | fabdf1d | 2005-03-05 22:45:04 +0000 | [diff] [blame] | 292 | dy += (dy < 0) ? -1 : 1; |
Jens Arnold | 468f9ec | 2005-02-15 08:03:56 +0000 | [diff] [blame] | 293 | break; |
| 294 | |
| 295 | default: |
Jens Arnold | fabdf1d | 2005-03-05 22:45:04 +0000 | [diff] [blame] | 296 | if (rb->default_event_handler(button) == SYS_USB_CONNECTED) { |
| 297 | #ifdef HAVE_LCD_CHARCELLS |
| 298 | pgfx_release(); |
| 299 | #endif |
| 300 | return PLUGIN_USB_CONNECTED; |
| 301 | } |
Jens Arnold | 468f9ec | 2005-02-15 08:03:56 +0000 | [diff] [blame] | 302 | break; |
| 303 | } |
| 304 | } |
| 305 | } |
| 306 | |
Rob Purchase | 297e050 | 2008-04-27 15:30:19 +0000 | [diff] [blame] | 307 | |