From b4e9a4b92f971d74895473c9f6825ba3f6e24962 Mon Sep 17 00:00:00 2001 From: Nicolas Bacca Date: Thu, 23 Dec 2004 01:15:27 +0000 Subject: Add Zone key support for Smartphones. Last commit for today svn-id: r16266 --- backends/wince/wince-sdl.cpp | 32 ++++++++++++++++++++++++++++++++ backends/wince/wince-sdl.h | 18 ++++++++++++++++++ 2 files changed, 50 insertions(+) (limited to 'backends') diff --git a/backends/wince/wince-sdl.cpp b/backends/wince/wince-sdl.cpp index 4edf203d03..19749c40e6 100644 --- a/backends/wince/wince-sdl.cpp +++ b/backends/wince/wince-sdl.cpp @@ -340,6 +340,16 @@ void OSystem_WINCE3::swap_zoom_down() { //#ifdef WIN32_PLATFORM_WFSP // Smartphone actions +void OSystem_WINCE3::initZones() { + int i; + + _currentZone = 0; + for (i=0; i= _zones[i].x && y >= _zones[i].y && + x <= _zones[i].x + _zones[i].width && y <= _zones[i].y + _zones[i].height + ) { + _mouseXZone[i] = x; + _mouseYZone[i] = y; + break; + } + _currentZone++; + if (_currentZone >= TOTAL_ZONES) + _currentZone = 0; + + EventsBuffer::simulateMouseMove(_mouseXZone[_currentZone], _mouseYZone[_currentZone]); } //#endif @@ -1600,3 +1627,8 @@ void OSystem_WINCE3::quit() { int OSystem_WINCE3::_platformScreenWidth; int OSystem_WINCE3::_platformScreenHeight; bool OSystem_WINCE3::_isOzone; +OSystem_WINCE3::zoneDesc OSystem_WINCE3::_zones[TOTAL_ZONES] = { + { 0, 0, 320, 145 }, + { 0, 145, 150, 55 }, + { 150, 145, 170, 55 } +}; \ No newline at end of file diff --git a/backends/wince/wince-sdl.h b/backends/wince/wince-sdl.h index cbc2e6083a..296cc5150b 100644 --- a/backends/wince/wince-sdl.h +++ b/backends/wince/wince-sdl.h @@ -36,6 +36,8 @@ #include +#define TOTAL_ZONES 3 + class OSystem_WINCE3 : public OSystem_SDL { public: OSystem_WINCE3(); @@ -72,6 +74,7 @@ public: //#ifdef WIN32_PLATFORM_WFSP // Smartphone actions + void initZones(); void loadSmartphoneConfigurationElement(String element, int &value, int defaultValue); void loadSmartphoneConfiguration(); void add_left_click(bool pushed); @@ -181,6 +184,21 @@ private: int _stepY1; // offset for up and down cursor moves (slowest) int _stepY2; // offset for up and down cursor moves (faster) int _stepY3; // offset for up and down cursor moves (fastest) + + int _mouseXZone[TOTAL_ZONES]; + int _mouseYZone[TOTAL_ZONES]; + int _currentZone; + + typedef struct zoneDesc { + int x; + int y; + int width; + int height; + } zoneDesc; + + static zoneDesc _zones[TOTAL_ZONES]; + + }; #endif -- cgit v1.2.3