From 935780e4260755b252cbd7d212aa3e9c0cde7db2 Mon Sep 17 00:00:00 2001 From: Maurus Cuelenaere Date: Mon, 9 Mar 2009 23:32:37 +0000 Subject: Add support for Onda VX747 simulator (and yes, it needs a better picture) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20273 a1c6a512-1295-4272-9138-f99709370657 --- uisimulator/sdl/UI-ondavx747.bmp | Bin 0 -> 613076 bytes uisimulator/sdl/button.c | 29 +++++++++++++++++------------ uisimulator/sdl/uisdl.h | 6 ++++++ 3 files changed, 23 insertions(+), 12 deletions(-) create mode 100755 uisimulator/sdl/UI-ondavx747.bmp (limited to 'uisimulator') diff --git a/uisimulator/sdl/UI-ondavx747.bmp b/uisimulator/sdl/UI-ondavx747.bmp new file mode 100755 index 0000000000..364003d720 Binary files /dev/null and b/uisimulator/sdl/UI-ondavx747.bmp differ diff --git a/uisimulator/sdl/button.c b/uisimulator/sdl/button.c index 6402c75d55..c32c0a8c6a 100644 --- a/uisimulator/sdl/button.c +++ b/uisimulator/sdl/button.c @@ -34,16 +34,8 @@ static intptr_t button_data; /* data value from last message dequeued */ #ifdef HAVE_TOUCHSCREEN +#include "touchscreen.h" static int mouse_coords = 0; -static enum touchscreen_mode touchscreen_mode = TOUCHSCREEN_POINT; -void touchscreen_set_mode(enum touchscreen_mode mode) -{ - touchscreen_mode = mode; -} -enum touchscreen_mode touchscreen_get_mode(void) -{ - return touchscreen_mode; -} #endif /* how long until repeat kicks in */ #define REPEAT_START 6 @@ -124,7 +116,7 @@ void button_event(int key, bool pressed) #ifdef HAVE_TOUCHSCREEN case BUTTON_TOUCHSCREEN: data = mouse_coords; - switch (touchscreen_mode) + switch (touchscreen_get_mode()) { case TOUCHSCREEN_POINT: new_btn = BUTTON_TOUCHSCREEN; @@ -172,8 +164,8 @@ void button_event(int key, bool pressed) case SDLK_F4: if(pressed) { - touchscreen_mode = (touchscreen_mode == TOUCHSCREEN_POINT ? TOUCHSCREEN_BUTTON : TOUCHSCREEN_POINT); - printf("Touchscreen mode: %s\n", touchscreen_mode == TOUCHSCREEN_POINT ? "TOUCHSCREEN_POINT" : "TOUCHSCREEN_BUTTON"); + touchscreen_set_mode(touchscreen_get_mode() == TOUCHSCREEN_POINT ? TOUCHSCREEN_BUTTON : TOUCHSCREEN_POINT); + printf("Touchscreen mode: %s\n", touchscreen_get_mode() == TOUCHSCREEN_POINT ? "TOUCHSCREEN_POINT" : "TOUCHSCREEN_BUTTON"); } break; @@ -1091,6 +1083,19 @@ void button_event(int key, bool pressed) case SDLK_KP_PLUS: new_btn = BUTTON_VIEW; break; +#elif CONFIG_KEYPAD == ONDAVX747_PAD + case SDLK_ESCAPE: + new_btn = BUTTON_POWER; + break; + case SDLK_KP_PLUS: + new_btn = BUTTON_VOL_UP; + break; + case SDLK_KP_MINUS: + new_btn = BUTTON_VOL_DOWN; + break; + case SDLK_KP_ENTER: + new_btn = BUTTON_MENU; + break; #else #error No keymap defined! #endif /* CONFIG_KEYPAD */ diff --git a/uisimulator/sdl/uisdl.h b/uisimulator/sdl/uisdl.h index 6cb382ce8b..3868158938 100644 --- a/uisimulator/sdl/uisdl.h +++ b/uisimulator/sdl/uisdl.h @@ -291,6 +291,12 @@ #define UI_LCD_POSX 42 /* x position of lcd */ #define UI_LCD_POSY 55 /* y position of lcd */ +#elif defined(ONDA_VX747) +#define UI_TITLE "Onda VX747" +#define UI_WIDTH 340 /* width of GUI window */ +#define UI_HEIGHT 601 /* height of GUI window */ +#define UI_LCD_POSX 45 /* x position of lcd */ +#define UI_LCD_POSY 90 /* y position of lcd */ #else #error no UI defines -- cgit