[Scummvm-cvs-logs] SF.net SVN: scummvm:[54518] scummvm/trunk/backends

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sun Nov 28 15:56:33 CET 2010


Revision: 54518
          http://scummvm.svn.sourceforge.net/scummvm/?rev=54518&view=rev
Author:   fingolfin
Date:     2010-11-28 14:56:31 +0000 (Sun, 28 Nov 2010)

Log Message:
-----------
Merging the gsoc2010-opengl branch

Modified Paths:
--------------
    scummvm/trunk/backends/module.mk
    scummvm/trunk/backends/platform/dingux/dingux.cpp
    scummvm/trunk/backends/platform/dingux/dingux.h
    scummvm/trunk/backends/platform/dingux/main.cpp
    scummvm/trunk/backends/platform/dingux/module.mk
    scummvm/trunk/backends/platform/ds/arm9/source/gbampsave.cpp
    scummvm/trunk/backends/platform/ds/arm9/source/gbampsave.h
    scummvm/trunk/backends/platform/gp2x/gp2x-common.h
    scummvm/trunk/backends/platform/gp2x/gp2x.cpp
    scummvm/trunk/backends/platform/gp2x/module.mk
    scummvm/trunk/backends/platform/gph/gph-main.cpp
    scummvm/trunk/backends/platform/linuxmoto/linuxmoto-main.cpp
    scummvm/trunk/backends/platform/linuxmoto/linuxmoto-sdl.cpp
    scummvm/trunk/backends/platform/linuxmoto/linuxmoto-sdl.h
    scummvm/trunk/backends/platform/linuxmoto/module.mk
    scummvm/trunk/backends/platform/null/null.cpp
    scummvm/trunk/backends/platform/samsungtv/main.cpp
    scummvm/trunk/backends/platform/samsungtv/module.mk
    scummvm/trunk/backends/platform/samsungtv/samsungtv.cpp
    scummvm/trunk/backends/platform/samsungtv/samsungtv.h
    scummvm/trunk/backends/platform/sdl/main.cpp
    scummvm/trunk/backends/platform/sdl/module.mk
    scummvm/trunk/backends/platform/sdl/sdl.cpp
    scummvm/trunk/backends/platform/sdl/sdl.h
    scummvm/trunk/backends/platform/symbian/S60v3/ScummVM_A0000658_S60v3.mmp.in
    scummvm/trunk/backends/platform/symbian/S60v3/ScummVM_S60v3.mmp.in
    scummvm/trunk/backends/platform/symbian/UIQ3/ScummVM_A0000658_UIQ3.mmp.in
    scummvm/trunk/backends/platform/symbian/UIQ3/ScummVM_UIQ3.mmp.in
    scummvm/trunk/backends/platform/symbian/mmp/scummvm_base.mmp.in
    scummvm/trunk/backends/platform/symbian/src/SymbianOS.cpp
    scummvm/trunk/backends/platform/symbian/src/SymbianOS.h

Added Paths:
-----------
    scummvm/trunk/backends/events/dinguxsdl/
    scummvm/trunk/backends/events/dinguxsdl/dinguxsdl-events.cpp
    scummvm/trunk/backends/events/dinguxsdl/dinguxsdl-events.h
    scummvm/trunk/backends/events/gp2xsdl/
    scummvm/trunk/backends/events/gp2xsdl/gp2xsdl-events.cpp
    scummvm/trunk/backends/events/gp2xsdl/gp2xsdl-events.h
    scummvm/trunk/backends/events/linuxmotosdl/
    scummvm/trunk/backends/events/linuxmotosdl/linuxmotosdl-events.cpp
    scummvm/trunk/backends/events/linuxmotosdl/linuxmotosdl-events.h
    scummvm/trunk/backends/events/samsungtvsdl/
    scummvm/trunk/backends/events/samsungtvsdl/samsungtvsdl-events.cpp
    scummvm/trunk/backends/events/samsungtvsdl/samsungtvsdl-events.h
    scummvm/trunk/backends/events/sdl/
    scummvm/trunk/backends/events/sdl/sdl-events.cpp
    scummvm/trunk/backends/events/sdl/sdl-events.h
    scummvm/trunk/backends/events/symbiansdl/
    scummvm/trunk/backends/events/symbiansdl/symbiansdl-events.cpp
    scummvm/trunk/backends/events/symbiansdl/symbiansdl-events.h
    scummvm/trunk/backends/graphics/
    scummvm/trunk/backends/graphics/dinguxsdl/
    scummvm/trunk/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp
    scummvm/trunk/backends/graphics/dinguxsdl/dinguxsdl-graphics.h
    scummvm/trunk/backends/graphics/gp2xsdl/
    scummvm/trunk/backends/graphics/gp2xsdl/gp2xsdl-graphics.cpp
    scummvm/trunk/backends/graphics/gp2xsdl/gp2xsdl-graphics.h
    scummvm/trunk/backends/graphics/graphics.h
    scummvm/trunk/backends/graphics/linuxmotosdl/
    scummvm/trunk/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp
    scummvm/trunk/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h
    scummvm/trunk/backends/graphics/null/
    scummvm/trunk/backends/graphics/null/null-graphics.h
    scummvm/trunk/backends/graphics/opengl/
    scummvm/trunk/backends/graphics/opengl/glerrorcheck.cpp
    scummvm/trunk/backends/graphics/opengl/glerrorcheck.h
    scummvm/trunk/backends/graphics/opengl/gltexture.cpp
    scummvm/trunk/backends/graphics/opengl/gltexture.h
    scummvm/trunk/backends/graphics/opengl/opengl-graphics.cpp
    scummvm/trunk/backends/graphics/opengl/opengl-graphics.h
    scummvm/trunk/backends/graphics/openglsdl/
    scummvm/trunk/backends/graphics/openglsdl/openglsdl-graphics.cpp
    scummvm/trunk/backends/graphics/openglsdl/openglsdl-graphics.h
    scummvm/trunk/backends/graphics/sdl/
    scummvm/trunk/backends/graphics/sdl/sdl-graphics.cpp
    scummvm/trunk/backends/graphics/sdl/sdl-graphics.h
    scummvm/trunk/backends/graphics/symbiansdl/
    scummvm/trunk/backends/graphics/symbiansdl/symbiansdl-graphics.cpp
    scummvm/trunk/backends/graphics/symbiansdl/symbiansdl-graphics.h
    scummvm/trunk/backends/mixer/
    scummvm/trunk/backends/mixer/doublebuffersdl/
    scummvm/trunk/backends/mixer/doublebuffersdl/doublebuffersdl-mixer.cpp
    scummvm/trunk/backends/mixer/doublebuffersdl/doublebuffersdl-mixer.h
    scummvm/trunk/backends/mixer/sdl/
    scummvm/trunk/backends/mixer/sdl/sdl-mixer.cpp
    scummvm/trunk/backends/mixer/sdl/sdl-mixer.h
    scummvm/trunk/backends/mixer/symbiansdl/
    scummvm/trunk/backends/mixer/symbiansdl/symbiansdl-mixer.cpp
    scummvm/trunk/backends/mixer/symbiansdl/symbiansdl-mixer.h
    scummvm/trunk/backends/modular-backend.cpp
    scummvm/trunk/backends/modular-backend.h
    scummvm/trunk/backends/mutex/
    scummvm/trunk/backends/mutex/mutex.h
    scummvm/trunk/backends/mutex/null/
    scummvm/trunk/backends/mutex/null/null-mutex.h
    scummvm/trunk/backends/mutex/sdl/
    scummvm/trunk/backends/mutex/sdl/sdl-mutex.cpp
    scummvm/trunk/backends/mutex/sdl/sdl-mutex.h
    scummvm/trunk/backends/platform/gp2x/gp2x-main.cpp
    scummvm/trunk/backends/platform/sdl/amigaos/
    scummvm/trunk/backends/platform/sdl/amigaos/amigaos-main.cpp
    scummvm/trunk/backends/platform/sdl/amigaos/amigaos.cpp
    scummvm/trunk/backends/platform/sdl/amigaos/amigaos.h
    scummvm/trunk/backends/platform/sdl/macosx/
    scummvm/trunk/backends/platform/sdl/macosx/macosx-main.cpp
    scummvm/trunk/backends/platform/sdl/macosx/macosx.cpp
    scummvm/trunk/backends/platform/sdl/macosx/macosx.h
    scummvm/trunk/backends/platform/sdl/posix/
    scummvm/trunk/backends/platform/sdl/posix/posix-main.cpp
    scummvm/trunk/backends/platform/sdl/posix/posix.cpp
    scummvm/trunk/backends/platform/sdl/posix/posix.h
    scummvm/trunk/backends/platform/sdl/win32/
    scummvm/trunk/backends/platform/sdl/win32/win32-main.cpp
    scummvm/trunk/backends/platform/sdl/win32/win32.cpp
    scummvm/trunk/backends/platform/sdl/win32/win32.h
    scummvm/trunk/backends/platform/symbian/src/SymbianMain.cpp
    scummvm/trunk/backends/timer/sdl/
    scummvm/trunk/backends/timer/sdl/sdl-timer.cpp
    scummvm/trunk/backends/timer/sdl/sdl-timer.h

Removed Paths:
-------------
    scummvm/trunk/backends/platform/dingux/dingux-events.cpp
    scummvm/trunk/backends/platform/dingux/dingux-graphics.cpp
    scummvm/trunk/backends/platform/gp2x/events.cpp
    scummvm/trunk/backends/platform/gp2x/graphics.cpp
    scummvm/trunk/backends/platform/linuxmoto/linuxmoto-events.cpp
    scummvm/trunk/backends/platform/linuxmoto/linuxmoto-graphics.cpp
    scummvm/trunk/backends/platform/samsungtv/events.cpp
    scummvm/trunk/backends/platform/sdl/events.cpp
    scummvm/trunk/backends/platform/sdl/graphics.cpp

Copied: scummvm/trunk/backends/events/dinguxsdl/dinguxsdl-events.cpp (from rev 54517, scummvm/trunk/backends/platform/dingux/dingux-events.cpp)
===================================================================
--- scummvm/trunk/backends/events/dinguxsdl/dinguxsdl-events.cpp	                        (rev 0)
+++ scummvm/trunk/backends/events/dinguxsdl/dinguxsdl-events.cpp	2010-11-28 14:56:31 UTC (rev 54518)
@@ -0,0 +1,226 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL: https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2010-opengl/backends/events/dinguxsdl/dinguxsdl-events.cpp $
+ * $Id: dinguxsdl-events.cpp 53730 2010-10-23 09:30:26Z hkz $
+ *
+ */
+
+#if defined(DINGUX)
+
+#include "backends/events/dinguxsdl/dinguxsdl-events.h"
+#include "graphics/scaler/aspect.h"	// for aspect2Real 
+
+#define PAD_UP    SDLK_UP
+#define PAD_DOWN  SDLK_DOWN
+#define PAD_LEFT  SDLK_LEFT
+#define PAD_RIGHT SDLK_RIGHT
+#define BUT_A     SDLK_LCTRL
+#define BUT_B     SDLK_LALT
+#define BUT_X     SDLK_SPACE
+#define BUT_Y     SDLK_LSHIFT
+#define BUT_SELECT   SDLK_ESCAPE
+#define BUT_START    SDLK_RETURN
+#define TRIG_L    SDLK_TAB
+#define TRIG_R    SDLK_BACKSPACE
+
+static int mapKey(SDLKey key, SDLMod mod, Uint16 unicode) {
+	if (key >= SDLK_F1 && key <= SDLK_F9) {
+		return key - SDLK_F1 + Common::ASCII_F1;
+	} else if (key >= SDLK_KP0 && key <= SDLK_KP9) {
+		return key - SDLK_KP0 + '0';
+	} else if (key >= SDLK_UP && key <= SDLK_PAGEDOWN) {
+		return key;
+	} else if (unicode) {
+		return unicode;
+	} else if (key >= 'a' && key <= 'z' && (mod & KMOD_SHIFT)) {
+		return key & ~0x20;
+	} else if (key >= SDLK_NUMLOCK && key <= SDLK_EURO) {
+		return 0;
+	}
+	return key;
+}
+
+DINGUXSdlEventSource::DINGUXSdlEventSource() : SdlEventSource() {
+	;
+}
+
+bool DINGUXSdlEventSource::remapKey(SDL_Event &ev, Common::Event &event) {
+	if (ev.key.keysym.sym == PAD_UP) {
+		if (ev.type == SDL_KEYDOWN) {
+			_km.y_vel = -1;
+			_km.y_down_count = 1;
+		} else {
+			_km.y_vel = 0;
+			_km.y_down_count = 0;
+		}
+
+		event.type = Common::EVENT_MOUSEMOVE;
+		fillMouseEvent(event, _km.x, _km.y);
+
+		return true;
+	} else if (ev.key.keysym.sym == PAD_DOWN) {
+		if (ev.type == SDL_KEYDOWN) {
+			_km.y_vel = 1;
+			_km.y_down_count = 1;
+		} else {
+			_km.y_vel = 0;
+			_km.y_down_count = 0;
+		}
+
+		event.type = Common::EVENT_MOUSEMOVE;
+		fillMouseEvent(event, _km.x, _km.y);
+
+		return true;
+	} else if (ev.key.keysym.sym == PAD_LEFT) {
+		if (ev.type == SDL_KEYDOWN) {
+			_km.x_vel = -1;
+			_km.x_down_count = 1;
+		} else {
+			_km.x_vel = 0;
+			_km.x_down_count = 0;
+		}
+
+		event.type = Common::EVENT_MOUSEMOVE;
+		fillMouseEvent(event, _km.x, _km.y);
+
+		return true;
+	} else if (ev.key.keysym.sym == PAD_RIGHT) {
+		if (ev.type == SDL_KEYDOWN) {
+			_km.x_vel = 1;
+			_km.x_down_count = 1;
+		} else {
+			_km.x_vel = 0;
+			_km.x_down_count = 0;
+		}
+
+		event.type = Common::EVENT_MOUSEMOVE;
+		fillMouseEvent(event, _km.x, _km.y);
+
+		return true;
+	} else if (ev.key.keysym.sym == BUT_Y) { // left mouse button
+		if (ev.type == SDL_KEYDOWN) {
+			event.type = Common::EVENT_LBUTTONDOWN;
+		} else {
+			event.type = Common::EVENT_LBUTTONUP;
+		}
+
+		fillMouseEvent(event, _km.x, _km.y);
+
+		return true;
+	} else if (ev.key.keysym.sym == BUT_B) { // right mouse button
+		if (ev.type == SDL_KEYDOWN) {
+			event.type = Common::EVENT_RBUTTONDOWN;
+		} else {
+			event.type = Common::EVENT_RBUTTONUP;
+		}
+
+		fillMouseEvent(event, _km.x, _km.y);
+
+		return true;
+	} else if (ev.key.keysym.sym == BUT_X) { // '.' skip dialogue
+		ev.key.keysym.sym = SDLK_PERIOD;
+		ev.key.keysym.mod = (SDLMod)0;
+		ev.key.keysym.unicode = '.';
+	} else if (ev.key.keysym.sym == TRIG_L) { // global menu
+		ev.key.keysym.sym = SDLK_F5;
+		event.kbd.keycode = Common::KEYCODE_F5;
+		event.kbd.ascii = Common::ASCII_F5;
+		event.kbd.flags = Common::KBD_CTRL;
+
+		if (ev.type == SDL_KEYDOWN) {
+			event.type = Common::EVENT_KEYDOWN;
+		} else {
+			event.type = Common::EVENT_KEYUP;
+		}
+
+		return true;
+	} else if (ev.key.keysym.sym == BUT_A) { // key '0'
+		ev.key.keysym.sym = SDLK_0;
+
+		event.kbd.keycode = Common::KEYCODE_0;
+		event.kbd.ascii = '0';
+		event.kbd.flags = 0;
+
+		if (ev.type == SDL_KEYDOWN) {
+			event.type = Common::EVENT_KEYDOWN;
+		} else {
+			event.type = Common::EVENT_KEYUP;
+		}
+
+		return true;
+	} else if (ev.key.keysym.sym == BUT_SELECT) { // virtual keyboard
+		ev.key.keysym.sym = SDLK_F7;
+
+	} else if (ev.key.keysym.sym == BUT_START) { // F5, menu in some games
+		ev.key.keysym.sym = SDLK_F5;
+
+	}  else if (ev.key.keysym.sym == TRIG_R) { // ESC
+		ev.key.keysym.sym = SDLK_ESCAPE;
+	} else {
+		event.kbd.keycode = (Common::KeyCode)ev.key.keysym.sym;
+		event.kbd.ascii = mapKey(ev.key.keysym.sym, ev.key.keysym.mod, ev.key.keysym.unicode);
+	}
+
+	return false;
+}
+
+void DINGUXSdlEventSource::fillMouseEvent(Common::Event &event, int x, int y) {
+	if (_grpMan->getVideoMode()->mode == GFX_HALF && !(_grpMan->isOverlayVisible())) {
+		event.mouse.x = x * 2;
+		event.mouse.y = y * 2;
+	} else {
+		event.mouse.x = x;
+		event.mouse.y = y;
+	}
+
+	// Update the "keyboard mouse" coords
+	_km.x = x;
+	_km.y = y;
+
+	// Adjust for the screen scaling
+	if (!(_grpMan->isOverlayVisible())) {
+		event.mouse.x /= (_grpMan->getVideoMode())->scaleFactor;
+		event.mouse.y /= (_grpMan->getVideoMode())->scaleFactor;
+#if 0
+		if (_grpMan->getVideoMode()->aspectRatioCorrection)
+			event.mouse.y = aspect2Real(event.mouse.y);
+#endif
+	}
+}
+
+void DINGUXSdlEventSource::warpMouse(int x, int y) {
+	int mouse_cur_x = _grpMan->getMouseCurState()->x;
+	int mouse_cur_y = _grpMan->getMouseCurState()->y;
+
+	if ((mouse_cur_x != x) || (mouse_cur_y != y)) {
+		if (_grpMan->getVideoMode()->mode == GFX_HALF && !(_grpMan->isOverlayVisible())) {
+			x = x / 2;
+			y = y / 2;
+		}
+	}
+	SDL_WarpMouse(x, y);
+}
+
+void DINGUXSdlEventSource::setCurrentGraphMan(DINGUXSdlGraphicsManager *_graphicManager) {
+	_grpMan = _graphicManager;
+}
+
+#endif /* DINGUX */


Property changes on: scummvm/trunk/backends/events/dinguxsdl/dinguxsdl-events.cpp
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + Date Rev Author URL Id
Added: svn:eol-style
   + native

Copied: scummvm/trunk/backends/events/dinguxsdl/dinguxsdl-events.h (from rev 54517, scummvm/trunk/backends/platform/dingux/main.cpp)
===================================================================
--- scummvm/trunk/backends/events/dinguxsdl/dinguxsdl-events.h	                        (rev 0)
+++ scummvm/trunk/backends/events/dinguxsdl/dinguxsdl-events.h	2010-11-28 14:56:31 UTC (rev 54518)
@@ -0,0 +1,47 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL: https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2010-opengl/backends/events/dinguxsdl/dinguxsdl-events.h $
+ * $Id: dinguxsdl-events.h 53730 2010-10-23 09:30:26Z hkz $
+ *
+ */
+
+#ifndef BACKENDS_EVENTS_SDL_DINGUX_H
+#define BACKENDS_EVENTS_SDL_DINGUX_H
+#if defined(DINGUX)
+
+#include "backends/platform/dingux/dingux.h"
+#include "backends/events/dinguxsdl/dinguxsdl-events.h"
+
+class DINGUXSdlEventSource : public SdlEventSource {
+public:
+	DINGUXSdlEventSource();
+	void setCurrentGraphMan(DINGUXSdlGraphicsManager *_graphicManager);
+
+protected:
+	DINGUXSdlGraphicsManager *_grpMan;
+
+	bool remapKey(SDL_Event &ev, Common::Event &event);
+	void fillMouseEvent(Common::Event &event, int x, int y);
+	void warpMouse(int x, int y);
+};
+
+#endif /* DINGUX */
+#endif /* BACKENDS_EVENTS_SDL_DINGUX_H */

Copied: scummvm/trunk/backends/events/gp2xsdl/gp2xsdl-events.cpp (from rev 54517, scummvm/trunk/backends/platform/gp2x/events.cpp)
===================================================================
--- scummvm/trunk/backends/events/gp2xsdl/gp2xsdl-events.cpp	                        (rev 0)
+++ scummvm/trunk/backends/events/gp2xsdl/gp2xsdl-events.cpp	2010-11-28 14:56:31 UTC (rev 54518)
@@ -0,0 +1,494 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL: https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2010-opengl/backends/events/gp2xsdl/gp2xsdl-events.cpp $
+ * $Id: gp2xsdl-events.cpp 53399 2010-10-13 03:57:44Z lordhoto $
+ *
+ */
+
+#if defined(GP2X) || defined(GP2XWIZ)
+
+#include "backends/events/gp2xsdl/gp2xsdl-events.h"
+#if defined(GP2X)
+#include "backends/platform/gp2x/gp2x-hw.h"
+#include "backends/graphics/gp2xsdl/gp2xsdl-graphics.h"
+#else
+#include "backends/platform/gp2xwiz/gp2xwiz-hw.h"
+#endif
+
+#include "backends/platform/sdl/sdl.h"
+
+// FIXME move joystick defines out and replace with confile file options
+// we should really allow users to map any key to a joystick button using the keymapper.
+#define JOY_DEADZONE 2200
+
+#define JOY_XAXIS 0
+#define JOY_YAXIS 1
+
+/* Quick default button states for modifiers. */
+int BUTTON_STATE_L					=	false;
+
+enum {
+	/* DPAD/Stick */
+	BUTTON_UP			= 0,
+	BUTTON_UPLEFT		= 1,
+	BUTTON_LEFT			= 2,
+	BUTTON_DOWNLEFT		= 3,
+	BUTTON_DOWN			= 4,
+	BUTTON_DOWNRIGHT	= 5,
+	BUTTON_RIGHT		= 6,
+	BUTTON_UPRIGHT		= 7,
+	/* Joystick Buttons */
+	BUTTON_MENU			= 8,	// Start on F100 GP2X
+	BUTTON_SELECT		= 9,
+	BUTTON_L			= 10,
+	BUTTON_R			= 11,
+	BUTTON_A			= 12,
+	BUTTON_B			= 13,
+	BUTTON_X			= 14,
+	BUTTON_Y			= 15,
+	BUTTON_VOLUP		= 16,
+	BUTTON_VOLDOWN		= 17,
+	BUTTON_CLICK		= 18
+};
+
+enum {
+	/* Unused Joystick Buttons on the GP2X */
+	BUTTON_HOME			= 51,
+	BUTTON_HOLD			= 52,
+	BUTTON_HELP			= 53,
+	BUTTON_HELP2		= 54
+};
+
+enum {
+	/* Touchscreen TapMode */
+	TAPMODE_LEFT		= 0,
+	TAPMODE_RIGHT		= 1,
+	TAPMODE_HOVER		= 2
+};
+
+GP2XSdlEventManager::GP2XSdlEventManager(Common::EventSource *boss)
+	:
+	_buttonStateL(false),
+	SdlEventManager(boss) {
+
+}
+
+void GP2XSdlEventManager::SDLModToOSystemKeyFlags(SDLMod mod, Common::Event &event) {
+	event.kbd.flags = 0;
+
+	if (mod & KMOD_SHIFT)
+		event.kbd.flags |= Common::KBD_SHIFT;
+	if (mod & KMOD_ALT)
+		event.kbd.flags |= Common::KBD_ALT;
+	if (mod & KMOD_CTRL)
+		event.kbd.flags |= Common::KBD_CTRL;
+
+	// Sticky flags
+	if (mod & KMOD_NUM)
+		event.kbd.flags |= Common::KBD_NUM;
+	if (mod & KMOD_CAPS)
+		event.kbd.flags |= Common::KBD_CAPS;
+}
+
+void GP2XSdlEventManager::moveStick() {
+	bool stickBtn[32];
+
+	memcpy(stickBtn, _stickBtn, sizeof(stickBtn));
+
+	if ((stickBtn[0])||(stickBtn[2])||(stickBtn[4])||(stickBtn[6]))
+		stickBtn[1] = stickBtn[3] = stickBtn[5] = stickBtn[7] = 0;
+
+	if ((stickBtn[1])||(stickBtn[2])||(stickBtn[3])) {
+		if (_km.x_down_count!=2) {
+			_km.x_vel = -1;
+			_km.x_down_count = 1;
+		} else
+			_km.x_vel = -4;
+	} else if ((stickBtn[5])||(stickBtn[6])||(stickBtn[7])) {
+		if (_km.x_down_count!=2) {
+			_km.x_vel = 1;
+			_km.x_down_count = 1;
+		} else
+			_km.x_vel = 4;
+	} else {
+		_km.x_vel = 0;
+		_km.x_down_count = 0;
+	}
+
+	if ((stickBtn[0])||(stickBtn[1])||(stickBtn[7])) {
+		if (_km.y_down_count!=2) {
+			_km.y_vel = -1;
+			_km.y_down_count = 1;
+		} else
+			_km.y_vel = -4;
+	} else if ((stickBtn[3])||(stickBtn[4])||(stickBtn[5])) {
+		if (_km.y_down_count!=2) {
+			_km.y_vel = 1;
+			_km.y_down_count = 1;
+		} else
+			_km.y_vel = 4;
+	} else {
+		_km.y_vel = 0;
+		_km.y_down_count = 0;
+	}
+}
+
+/* GP2X Input mappings.
+Single Button
+
+Movement:
+
+GP2X_BUTTON_UP              Cursor Up
+GP2X_BUTTON_DOWN            Cursor Down
+GP2X_BUTTON_LEFT            Cursor Left
+GP2X_BUTTON_RIGHT           Cursor Right
+
+GP2X_BUTTON_UPLEFT          Cursor Up Left
+GP2X_BUTTON_UPRIGHT         Cursor Up Right
+GP2X_BUTTON_DOWNLEFT        Cursor Down Left
+GP2X_BUTTON_DOWNRIGHT       Cursor Down Right
+
+Button Emulation:
+
+GP2X_BUTTON_CLICK           Left Mouse Click (GP2X only)
+GP2X_BUTTON_A				. (Period)
+GP2X_BUTTON_B               Left Mouse Click
+GP2X_BUTTON_Y               Space Bar
+GP2X_BUTTON_X               Right Mouse Click
+GP2X_BUTTON_L				Combo Modifier (Left Trigger)
+GP2X_BUTTON_R               Return (Right Trigger)
+GP2X_BUTTON_MENU			F5 (Game Menu)
+GP2X_BUTTON_SELECT          Escape
+GP2X_BUTTON_VOLUP           /dev/mixer Global Volume Up
+GP2X_BUTTON_VOLDOWN         /dev/mixer Global Volume Down
+
+Combos:
+
+GP2X_BUTTON_VOLUP &	GP2X_BUTTON_VOLDOWN		0 (For Monkey 2 CP) or Virtual Keyboard if enabled
+GP2X_BUTTON_L &	GP2X_BUTTON_SELECT			Common::EVENT_QUIT (Calls Sync() to make sure SD is flushed)
+GP2X_BUTTON_L &	GP2X_BUTTON_MENU			Common::EVENT_MAINMENU (ScummVM Global Main Menu)
+GP2X_BUTTON_L &	GP2X_BUTTON_A				Common::EVENT_PREDICTIVE_DIALOG for predictive text entry box (AGI games)
+GP2X_BUTTON_L &	GP2X_BUTTON_Y				Toggles setZoomOnMouse() for larger then 320*240 games to scale to the point + raduis. (GP2X only)
+*/
+
+bool GP2XSdlEventManager::handleKeyDown(SDL_Event &ev, Common::Event &event) {
+	SDLModToOSystemKeyFlags(SDL_GetModState(), event);
+
+	if (remapKey(ev, event))
+		return true;
+
+	event.type = Common::EVENT_KEYDOWN;
+	event.kbd.keycode = (Common::KeyCode)ev.key.keysym.sym;
+	event.kbd.ascii = mapKey(ev.key.keysym.sym, ev.key.keysym.mod, ev.key.keysym.unicode);
+
+	return true;
+}
+
+bool GP2XSdlEventManager::handleKeyUp(SDL_Event &ev, Common::Event &event) {
+	if (remapKey(ev, event))
+		return true;
+
+	event.type = Common::EVENT_KEYUP;
+	event.kbd.keycode = (Common::KeyCode)ev.key.keysym.sym;
+	event.kbd.ascii = mapKey(ev.key.keysym.sym, ev.key.keysym.mod, ev.key.keysym.unicode);
+
+	// Ctrl-Alt-<key> will change the GFX mode
+	SDLModToOSystemKeyFlags(SDL_GetModState(), event);
+
+	// Set the scroll lock sticky flag
+	if (_scrollLock)
+		event.kbd.flags |= Common::KBD_SCRL;
+
+	if (isScalerHotkey(event))
+		// Swallow these key up events
+		return false;
+
+	return true;
+}
+
+bool GP2XSdlEventManager::handleJoyButtonDown(SDL_Event &ev, Common::Event &event) {
+
+	_stickBtn[ev.jbutton.button] = 1;
+	event.kbd.flags = 0;
+
+	switch (ev.jbutton.button) {
+	case BUTTON_UP:
+	case BUTTON_UPLEFT:
+	case BUTTON_LEFT:
+	case BUTTON_DOWNLEFT:
+	case BUTTON_DOWN:
+	case BUTTON_DOWNRIGHT:
+	case BUTTON_RIGHT:
+	case BUTTON_UPRIGHT:
+		moveStick();
+		event.type = Common::EVENT_MOUSEMOVE;
+		fillMouseEvent(event, _km.x, _km.y);
+		break;
+	case BUTTON_B:
+	case BUTTON_CLICK:
+		if (BUTTON_STATE_L == true) {
+			((GP2XSdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->toogleZoomOnMouse();
+			fillMouseEvent(event, _km.x, _km.y);
+		} else {
+			event.type = Common::EVENT_LBUTTONDOWN;
+			fillMouseEvent(event, _km.x, _km.y);
+		}
+		break;
+	case BUTTON_X:
+		event.type = Common::EVENT_RBUTTONDOWN;
+		fillMouseEvent(event, _km.x, _km.y);
+		break;
+	case BUTTON_L:
+		BUTTON_STATE_L = true;
+		break;
+	case BUTTON_R:
+		event.type = Common::EVENT_KEYDOWN;
+		if (BUTTON_STATE_L == true) {
+#ifdef ENABLE_VKEYBD
+			event.kbd.keycode = Common::KEYCODE_F7;
+			event.kbd.ascii = mapKey(SDLK_F7, ev.key.keysym.mod, 0);
+#else
+			event.kbd.keycode = Common::KEYCODE_0;
+			event.kbd.ascii = mapKey(SDLK_0, ev.key.keysym.mod, 0);
+#endif
+		} else {
+			event.kbd.keycode = Common::KEYCODE_RETURN;
+			event.kbd.ascii = mapKey(SDLK_RETURN, ev.key.keysym.mod, 0);
+		}
+		break;
+	case BUTTON_SELECT:
+	case BUTTON_HOME:
+		event.type = Common::EVENT_KEYDOWN;
+		if (BUTTON_STATE_L == true) {
+			event.type = Common::EVENT_QUIT;
+		} else {
+			event.kbd.keycode = Common::KEYCODE_ESCAPE;
+			event.kbd.ascii = mapKey(SDLK_ESCAPE, ev.key.keysym.mod, 0);
+		}
+		break;
+	case BUTTON_A:
+		event.type = Common::EVENT_KEYDOWN;
+		if (BUTTON_STATE_L == true) {
+			event.type = Common::EVENT_PREDICTIVE_DIALOG;
+		} else {
+		event.kbd.keycode = Common::KEYCODE_PERIOD;
+		event.kbd.ascii = mapKey(SDLK_PERIOD, ev.key.keysym.mod, 0);
+		}
+		break;
+	case BUTTON_Y:
+		event.type = Common::EVENT_KEYDOWN;
+		if (BUTTON_STATE_L == true) {
+			GPH::ToggleTapMode();
+			if (GPH::tapmodeLevel == TAPMODE_LEFT) {
+				g_system->displayMessageOnOSD("Touchscreen 'Tap Mode' - Left Click");
+			} else if (GPH::tapmodeLevel == TAPMODE_RIGHT) {
+				g_system->displayMessageOnOSD("Touchscreen 'Tap Mode' - Right Click");
+			} else if (GPH::tapmodeLevel == TAPMODE_HOVER) {
+				g_system->displayMessageOnOSD("Touchscreen 'Tap Mode' - Hover (No Click)");
+ 			}
+		} else {
+			event.kbd.keycode = Common::KEYCODE_SPACE;
+			event.kbd.ascii = mapKey(SDLK_SPACE, ev.key.keysym.mod, 0);
+		}
+		break;
+	case BUTTON_MENU:
+	case BUTTON_HELP:
+		event.type = Common::EVENT_KEYDOWN;
+		if (BUTTON_STATE_L == true) {
+			event.type = Common::EVENT_MAINMENU;
+		} else {
+			event.kbd.keycode = Common::KEYCODE_F5;
+			event.kbd.ascii = mapKey(SDLK_F5, ev.key.keysym.mod, 0);
+		}
+		break;
+	case BUTTON_VOLUP:
+		GP2X_HW::mixerMoveVolume(2);
+		if (GP2X_HW::volumeLevel == 100) {
+			g_system->displayMessageOnOSD("Maximum Volume");
+		} else {
+			g_system->displayMessageOnOSD("Increasing Volume");
+		}
+		break;
+
+	case BUTTON_VOLDOWN:
+		GP2X_HW::mixerMoveVolume(1);
+		if (GP2X_HW::volumeLevel == 0) {
+			g_system->displayMessageOnOSD("Minimal Volume");
+		} else {
+			g_system->displayMessageOnOSD("Decreasing Volume");
+		}
+		break;
+	case BUTTON_HOLD:
+		event.type = Common::EVENT_QUIT;
+		break;
+	case BUTTON_HELP2:
+		GPH::ToggleTapMode();
+		if (GPH::tapmodeLevel == TAPMODE_LEFT) {
+			g_system->displayMessageOnOSD("Touchscreen 'Tap Mode': Left Click");
+		} else if (GPH::tapmodeLevel == TAPMODE_RIGHT) {
+			g_system->displayMessageOnOSD("Touchscreen 'Tap Mode': Right Click");
+		} else if (GPH::tapmodeLevel == TAPMODE_HOVER) {
+			g_system->displayMessageOnOSD("Touchscreen 'Tap Mode': Hover (No Click)");
+		}
+		break;
+	}
+	return true;
+}
+
+bool GP2XSdlEventManager::handleJoyButtonUp(SDL_Event &ev, Common::Event &event) {
+	_stickBtn[ev.jbutton.button] = 0;
+	event.kbd.flags = 0;
+
+	switch (ev.jbutton.button) {
+	case BUTTON_UP:
+	case BUTTON_UPLEFT:
+	case BUTTON_LEFT:
+	case BUTTON_DOWNLEFT:
+	case BUTTON_DOWN:
+	case BUTTON_DOWNRIGHT:
+	case BUTTON_RIGHT:
+	case BUTTON_UPRIGHT:
+		moveStick();
+		event.type = Common::EVENT_MOUSEMOVE;
+		fillMouseEvent(event, _km.x, _km.y);
+		break;
+	case BUTTON_B:
+	case BUTTON_CLICK:
+		if (BUTTON_STATE_L == true) {
+			break;
+		} else {
+			event.type = Common::EVENT_LBUTTONUP;
+			fillMouseEvent(event, _km.x, _km.y);
+		}
+		break;
+	case BUTTON_X:
+		event.type = Common::EVENT_RBUTTONUP;
+		fillMouseEvent(event, _km.x, _km.y);
+		break;
+	case BUTTON_L:
+		BUTTON_STATE_L = false;
+		break;
+	case BUTTON_SELECT:
+	case BUTTON_HOME:
+		event.type = Common::EVENT_KEYUP;
+		event.kbd.keycode = Common::KEYCODE_ESCAPE;
+		event.kbd.ascii = mapKey(SDLK_ESCAPE, ev.key.keysym.mod, 0);
+		break;
+	case BUTTON_A:
+		event.type = Common::EVENT_KEYUP;
+		event.kbd.keycode = Common::KEYCODE_PERIOD;
+		event.kbd.ascii = mapKey(SDLK_PERIOD, ev.key.keysym.mod, 0);
+		break;
+	case BUTTON_Y:
+		event.type = Common::EVENT_KEYUP;
+		event.kbd.keycode = Common::KEYCODE_SPACE;
+		event.kbd.ascii = mapKey(SDLK_SPACE, ev.key.keysym.mod, 0);
+		break;
+	case BUTTON_MENU:
+	case BUTTON_HELP:
+		event.type = Common::EVENT_KEYUP;
+		if (BUTTON_STATE_L == true) {
+			event.type = Common::EVENT_MAINMENU;
+		} else {
+			event.kbd.keycode = Common::KEYCODE_F5;
+			event.kbd.ascii = mapKey(SDLK_F5, ev.key.keysym.mod, 0);
+		}
+		break;
+	case BUTTON_R:
+		event.type = Common::EVENT_KEYUP;
+		if (BUTTON_STATE_L == true) {
+#ifdef ENABLE_VKEYBD
+			event.kbd.keycode = Common::KEYCODE_F7;
+			event.kbd.ascii = mapKey(SDLK_F7, ev.key.keysym.mod, 0);
+#else
+			event.kbd.keycode = Common::KEYCODE_0;
+			event.kbd.ascii = mapKey(SDLK_0, ev.key.keysym.mod, 0);
+#endif
+		} else {
+			event.kbd.keycode = Common::KEYCODE_RETURN;
+			event.kbd.ascii = mapKey(SDLK_RETURN, ev.key.keysym.mod, 0);
+		}
+		break;
+	case BUTTON_VOLUP:
+		break;
+	case BUTTON_VOLDOWN:
+		break;
+	case BUTTON_HOLD:
+		break;
+	case BUTTON_HELP2:
+		break;
+	}
+	return true;
+}
+
+bool GP2XSdlEventManager::handleJoyAxisMotion(SDL_Event &ev, Common::Event &event) {
+	int axis = ev.jaxis.value;
+	if ( axis > JOY_DEADZONE) {
+		axis -= JOY_DEADZONE;
+		event.type = Common::EVENT_MOUSEMOVE;
+	} else if ( axis < -JOY_DEADZONE ) {
+		axis += JOY_DEADZONE;
+		event.type = Common::EVENT_MOUSEMOVE;
+	} else
+		axis = 0;
+
+	if ( ev.jaxis.axis == JOY_XAXIS) {
+#ifdef JOY_ANALOG
+		_km.x_vel = axis/2000;
+		_km.x_down_count = 0;
+#else
+		if (axis != 0) {
+			_km.x_vel = (axis > 0) ? 1:-1;
+			_km.x_down_count = 1;
+		} else {
+			_km.x_vel = 0;
+			_km.x_down_count = 0;
+		}
+#endif
+ 
+	} else if (ev.jaxis.axis == JOY_YAXIS) {
+#ifndef JOY_INVERT_Y
+		axis = -axis;
+#endif
+#ifdef JOY_ANALOG
+		_km.y_vel = -axis / 2000;
+		_km.y_down_count = 0;
+#else
+		if (axis != 0) {
+			_km.y_vel = (-axis > 0) ? 1: -1;
+			_km.y_down_count = 1;
+		} else {
+			_km.y_vel = 0;
+			_km.y_down_count = 0;
+		}
+#endif
+	}
+
+	fillMouseEvent(event, _km.x, _km.y);
+	return true;
+}
+
+bool GP2XSdlEventManager::remapKey(SDL_Event &ev, Common::Event &event) {
+	return false;
+}
+
+
+#endif


Property changes on: scummvm/trunk/backends/events/gp2xsdl/gp2xsdl-events.cpp
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + Date Rev Author URL Id
Added: svn:eol-style
   + native

Added: scummvm/trunk/backends/events/gp2xsdl/gp2xsdl-events.h
===================================================================
--- scummvm/trunk/backends/events/gp2xsdl/gp2xsdl-events.h	                        (rev 0)
+++ scummvm/trunk/backends/events/gp2xsdl/gp2xsdl-events.h	2010-11-28 14:56:31 UTC (rev 54518)
@@ -0,0 +1,60 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL: https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2010-opengl/backends/events/gp2xsdl/gp2xsdl-events.h $
+ * $Id: gp2xsdl-events.h 53399 2010-10-13 03:57:44Z lordhoto $
+ *
+ */
+
+#if !defined(BACKEND_EVENTS_SDL_GP2X_H) && !defined(DISABLE_DEFAULT_EVENTMANAGER)
+#define BACKEND_EVENTS_SDL_GP2X_H
+
+#include "backends/events/sdl/sdl-events.h"
+
+/**
+ * SDL events manager for GP2X and GP2XWIZ
+ */
+class GP2XSdlEventManager : public SdlEventManager {
+public:
+	GP2XSdlEventManager(Common::EventSource *boss);
+
+protected:
+	bool _stickBtn[32];
+
+	/** Button state for L button modifier */
+	bool _buttonStateL;
+
+	/**
+	 * Handles the stick movement
+	 */
+	void moveStick();
+
+	virtual bool handleKeyDown(SDL_Event &ev, Common::Event &event);
+	virtual bool handleKeyUp(SDL_Event &ev, Common::Event &event);
+	virtual bool handleJoyButtonDown(SDL_Event &ev, Common::Event &event);
+	virtual bool handleJoyButtonUp(SDL_Event &ev, Common::Event &event);
+	virtual bool GP2XSdlEventManager::handleJoyAxisMotion(SDL_Event &ev, Common::Event &event);
+
+	virtual void SDLModToOSystemKeyFlags(SDLMod mod, Common::Event &event);
+
+	virtual bool GP2XSdlEventManager::remapKey(SDL_Event &ev, Common::Event &event);
+};
+
+#endif


Property changes on: scummvm/trunk/backends/events/gp2xsdl/gp2xsdl-events.h
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + Date Rev Author URL Id
Added: svn:eol-style
   + native

Copied: scummvm/trunk/backends/events/linuxmotosdl/linuxmotosdl-events.cpp (from rev 54517, scummvm/trunk/backends/platform/linuxmoto/linuxmoto-events.cpp)
===================================================================
--- scummvm/trunk/backends/events/linuxmotosdl/linuxmotosdl-events.cpp	                        (rev 0)
+++ scummvm/trunk/backends/events/linuxmotosdl/linuxmotosdl-events.cpp	2010-11-28 14:56:31 UTC (rev 54518)
@@ -0,0 +1,227 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL: https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2010-opengl/backends/events/linuxmotosdl/linuxmotosdl-events.cpp $
+ * $Id: linuxmotosdl-events.cpp 53399 2010-10-13 03:57:44Z lordhoto $
+ *
+ */
+
+#if defined(LINUXMOTO)
+
+#include "backends/events/linuxmotosdl/linuxmotosdl-events.h"
+#include "backends/platform/linuxmoto/linuxmoto-sdl.h"
+
+enum {
+	GFX_HALF = 12
+};
+
+LinuxmotoSdlEventManager::LinuxmotoSdlEventManager(Common::EventSource *boss)
+	:
+	SdlEventManager(boss) {
+
+}
+
+void LinuxmotoSdlEventManager::preprocessEvents(SDL_Event *event) {
+	if (event->type == SDL_ACTIVEEVENT) {
+		if (event->active.state == SDL_APPINPUTFOCUS && !event->active.gain) {
+			((OSystem_SDL* )g_system)->getMixerManager()->suspendAudio();
+			for (;;) {
+				if (!SDL_WaitEvent(event)) {
+					SDL_Delay(10);
+					continue;
+				}
+				if (event->type == SDL_QUIT)
+					return;
+				if (event->type != SDL_ACTIVEEVENT)
+					continue;
+				if (event->active.state == SDL_APPINPUTFOCUS && event->active.gain) {
+					((OSystem_SDL* )g_system)->getMixerManager()->resumeAudio();
+					return;
+				}
+			}
+		}
+	}
+}
+
+bool LinuxmotoSdlEventManager::remapKey(SDL_Event &ev, Common::Event &event) {
+	if (false) {}
+
+	//  Motorol A1200/E6/A1600 remapkey by Lubomyr
+#ifdef MOTOEZX
+	// Quit on MOD+Camera Key on A1200
+	if (ev.key.keysym.sym == SDLK_e) {
+		event.type = Common::EVENT_QUIT;
+		return true;
+	}
+	// '1' Bypass security protection - MOD+Call key
+	if (ev.key.keysym.sym == SDLK_f) {
+		ev.key.keysym.sym = SDLK_1;
+	}
+	// F5 Game Menu - Call key
+	else if (ev.key.keysym.sym == SDLK_SPACE) {
+		ev.key.keysym.sym = SDLK_F5;
+	}
+	// VirtualKeyboard - Camera key
+	else if (ev.key.keysym.sym == SDLK_PAUSE) {
+		ev.key.keysym.sym = SDLK_F7;
+	}
+	// Enter - mod+fire key
+	else if (ev.key.keysym.sym == SDLK_b) {
+		ev.key.keysym.sym = SDLK_RETURN;
+	}
+	// '3' - mod+up key
+	else if (ev.key.keysym.sym == SDLK_j) {
+		ev.key.keysym.sym = SDLK_3;
+	}
+	// '6' - mod+up key
+	else if (ev.key.keysym.sym == SDLK_i) {
+		ev.key.keysym.sym = SDLK_6;
+	}
+	// 'y' - mod+right key
+	else if (ev.key.keysym.sym == SDLK_g) {
+		ev.key.keysym.sym = SDLK_y;
+	}
+	// 'n' - mod+right key
+	else if (ev.key.keysym.sym == SDLK_h) {
+		ev.key.keysym.sym = SDLK_n;
+	}
+	//  mod+vol'+' -> volume'+'
+	else if (ev.key.keysym.sym == SDLK_c) {
+		ev.key.keysym.sym = SDLK_RIGHTBRACKET;
+	}
+	//  mod+vol'-' -> volume'-'
+	else if (ev.key.keysym.sym == SDLK_d) {
+		ev.key.keysym.sym = SDLK_LEFTBRACKET;
+	}
+#endif
+
+#ifdef MOTOMAGX
+	// Quit on Clr
+	if (ev.key.keysym.sym == SDLK_BACKSPACE) {
+		event.type = Common::EVENT_QUIT;
+		return true;
+	}
+	// Game Menu - Left Soft key
+	else if (ev.key.keysym.sym == SDLK_F9) {
+		ev.key.keysym.sym = SDLK_F5;
+	}
+	// VirtualKeyboard - Right Soft key
+	else if (ev.key.keysym.sym == SDLK_F11) {
+		ev.key.keysym.sym = SDLK_F7;
+	}
+#endif
+
+// Joystick to Mouse
+	else if (ev.key.keysym.sym == SDLK_LEFT) {
+		if (ev.type == SDL_KEYDOWN) {
+			_km.x_vel = -1;
+			_km.x_down_count = 1;
+		} else {
+			_km.x_vel = 0;
+			_km.x_down_count = 0;
+		}
+
+		event.type = Common::EVENT_MOUSEMOVE;
+		fillMouseEvent(event, _km.x, _km.y);
+		return true;
+	} else if (ev.key.keysym.sym == SDLK_RIGHT) {
+		if (ev.type == SDL_KEYDOWN) {
+			_km.x_vel = 1;
+			_km.x_down_count = 1;
+		} else {
+			_km.x_vel = 0;
+			_km.x_down_count = 0;
+		}
+
+		event.type = Common::EVENT_MOUSEMOVE;
+		fillMouseEvent(event, _km.x, _km.y);
+
+		return true;
+	} else if (ev.key.keysym.sym == SDLK_DOWN) {
+		if (ev.type == SDL_KEYDOWN) {
+			_km.y_vel = 1;
+			_km.y_down_count = 1;
+		} else {
+			_km.y_vel = 0;
+			_km.y_down_count = 0;
+		}
+
+		event.type = Common::EVENT_MOUSEMOVE;
+		fillMouseEvent(event, _km.x, _km.y);
+
+		return true;
+	} else if (ev.key.keysym.sym == SDLK_UP) {
+		if (ev.type == SDL_KEYDOWN) {
+			_km.y_vel = -1;
+			_km.y_down_count = 1;
+		} else {
+			_km.y_vel = 0;
+			_km.y_down_count = 0;
+		}
+
+		event.type = Common::EVENT_MOUSEMOVE;
+		fillMouseEvent(event, _km.x, _km.y);
+
+		return true;
+	} else if (ev.key.keysym.sym == SDLK_RETURN) {
+		// Joystick center to pressing Left Mouse
+		if (ev.key.type == SDL_KEYDOWN) {
+			event.type = Common::EVENT_LBUTTONDOWN;
+		} else {
+			event.type = Common::EVENT_LBUTTONUP;
+		}
+
+		fillMouseEvent(event, _km.x, _km.y);
+
+		return true;
+	} else if (ev.key.keysym.sym == SDLK_PLUS) {
+		// Volume Up to pressing Right Mouse
+		if (ev.key.type == SDL_KEYDOWN ) {
+			event.type = Common::EVENT_RBUTTONDOWN;
+		} else {
+			event.type = Common::EVENT_RBUTTONUP;
+		}
+		fillMouseEvent(event, _km.x, _km.y);
+
+		return true;
+	} else if (ev.key.keysym.sym == SDLK_MINUS) {
+		// Volume Down to pressing Left Mouse
+		if (ev.key.type == SDL_KEYDOWN) {
+			event.type = Common::EVENT_LBUTTONDOWN;
+		} else {
+			event.type = Common::EVENT_LBUTTONUP;
+		}
+
+		fillMouseEvent(event, _km.x, _km.y);
+
+		return true;
+	} else {
+		// Let the events fall through if we didn't change them, this may not be the best way to
+		// set it up, but i'm not sure how sdl would like it if we let if fall through then redid it though.
+		// and yes i have an huge terminal size so i dont wrap soon enough.
+		event.type = Common::EVENT_KEYDOWN;
+		event.kbd.keycode = (Common::KeyCode)ev.key.keysym.sym;
+		event.kbd.ascii = mapKey(ev.key.keysym.sym, ev.key.keysym.mod, ev.key.keysym.unicode);
+	}
+
+	return false;
+}
+
+#endif


Property changes on: scummvm/trunk/backends/events/linuxmotosdl/linuxmotosdl-events.cpp
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + Date Rev Author URL Id
Added: svn:eol-style
   + native

Copied: scummvm/trunk/backends/events/linuxmotosdl/linuxmotosdl-events.h (from rev 54517, scummvm/trunk/backends/platform/samsungtv/samsungtv.h)
===================================================================
--- scummvm/trunk/backends/events/linuxmotosdl/linuxmotosdl-events.h	                        (rev 0)
+++ scummvm/trunk/backends/events/linuxmotosdl/linuxmotosdl-events.h	2010-11-28 14:56:31 UTC (rev 54518)
@@ -0,0 +1,43 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL: https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2010-opengl/backends/events/linuxmotosdl/linuxmotosdl-events.h $
+ * $Id: linuxmotosdl-events.h 50609 2010-07-03 00:13:45Z vgvgf $
+ *
+ */
+
+#if !defined(BACKEND_EVENTS_SDL_LINUXMOTO_H) && !defined(DISABLE_DEFAULT_EVENTMANAGER)
+#define BACKEND_EVENTS_SDL_LINUXMOTO_H
+
+#include "backends/events/sdl/sdl-events.h"
+
+/**
+ * SDL events manager for LINUXMOTO
+ */
+class LinuxmotoSdlEventManager : public SdlEventManager {
+public:
+	LinuxmotoSdlEventManager(Common::EventSource *boss);
+
+protected:
+	virtual void preprocessEvents(SDL_Event *event);
+	virtual bool remapKey(SDL_Event &ev, Common::Event &event);
+};
+
+#endif

Copied: scummvm/trunk/backends/events/samsungtvsdl/samsungtvsdl-events.cpp (from rev 54517, scummvm/trunk/backends/platform/samsungtv/events.cpp)
===================================================================
--- scummvm/trunk/backends/events/samsungtvsdl/samsungtvsdl-events.cpp	                        (rev 0)
+++ scummvm/trunk/backends/events/samsungtvsdl/samsungtvsdl-events.cpp	2010-11-28 14:56:31 UTC (rev 54518)
@@ -0,0 +1,78 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL: https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2010-opengl/backends/events/samsungtvsdl/samsungtvsdl-events.cpp $
+ * $Id: samsungtvsdl-events.cpp 50481 2010-06-29 05:00:44Z vgvgf $
+ *
+ */
+
+#ifdef SAMSUNGTV
+
+#include "backends/events/samsungtvsdl/samsungtvsdl-events.h"
+
+SamsungTVSdlEventManager::SamsungTVSdlEventManager(Common::EventSource *boss)
+	:
+	SdlEventManager(boss) {
+
+}
+
+bool SamsungTVSdlEventManager::remapKey(SDL_Event &ev, Common::Event &event) {
+	switch (ev.type) {
+		case SDL_KEYDOWN:{
+			if (ev.key.keysym.sym == SDLK_POWER) {
+				event.type = Common::EVENT_QUIT;
+				return true;
+			} else if (ev.key.keysym.sym == SDLK_F1 && ev.key.keysym.scancode == 20) {
+				event.type = Common::EVENT_KEYDOWN;
+				event.kbd.keycode = Common::KEYCODE_F5;
+				event.kbd.ascii = Common::ASCII_F5;
+				return true;
+			} else if (ev.key.keysym.sym == SDLK_F2 && ev.key.keysym.scancode == 21) {
+				event.type = Common::EVENT_KEYDOWN;
+				event.kbd.keycode = Common::KEYCODE_F7;
+				event.kbd.ascii = Common::ASCII_F7;
+				return true;
+			}
+			break;
+		}
+		case SDL_KEYUP: {
+			if (ev.key.keysym.sym == SDLK_POWER) {
+				event.type = Common::EVENT_QUIT;
+				return true;
+			} else if (ev.key.keysym.sym == SDLK_F1 && ev.key.keysym.scancode == 20) {
+				event.type = Common::EVENT_KEYUP;
+				event.kbd.keycode = Common::KEYCODE_F5;
+				event.kbd.ascii = Common::ASCII_F5;
+				return true;
+			} else if (ev.key.keysym.sym == SDLK_F2 && ev.key.keysym.scancode == 21) {
+				event.type = Common::EVENT_KEYUP;
+				event.kbd.keycode = Common::KEYCODE_F7;
+				event.kbd.ascii = Common::ASCII_F7;
+				return true;
+			}
+			break;
+		}
+	}
+
+	// Invoke parent implementation of this method
+	return SdlEventManager::remapKey(ev, event);
+}
+
+#endif


Property changes on: scummvm/trunk/backends/events/samsungtvsdl/samsungtvsdl-events.cpp
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + Date Rev Author URL Id
Added: svn:eol-style
   + native

Copied: scummvm/trunk/backends/events/samsungtvsdl/samsungtvsdl-events.h (from rev 54517, scummvm/trunk/backends/platform/samsungtv/samsungtv.h)
===================================================================
--- scummvm/trunk/backends/events/samsungtvsdl/samsungtvsdl-events.h	                        (rev 0)
+++ scummvm/trunk/backends/events/samsungtvsdl/samsungtvsdl-events.h	2010-11-28 14:56:31 UTC (rev 54518)
@@ -0,0 +1,42 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL: https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2010-opengl/backends/events/samsungtvsdl/samsungtvsdl-events.h $
+ * $Id: samsungtvsdl-events.h 50609 2010-07-03 00:13:45Z vgvgf $
+ *
+ */
+
+#if !defined(BACKEND_EVENTS_SDL_SAMSUNGTV_H) && !defined(DISABLE_DEFAULT_EVENTMANAGER)
+#define BACKEND_EVENTS_SDL_SAMSUNGTV_H
+
+#include "backends/events/sdl/sdl-events.h"
+
+/**
+ * SDL events manager for Samsung TV
+ */
+class SamsungTVSdlEventManager : public SdlEventManager {
+public:
+	SamsungTVSdlEventManager(Common::EventSource *boss);
+
+protected:
+	virtual bool remapKey(SDL_Event &ev, Common::Event &event);
+};
+
+#endif

Copied: scummvm/trunk/backends/events/sdl/sdl-events.cpp (from rev 54517, scummvm/trunk/backends/platform/sdl/events.cpp)
===================================================================
--- scummvm/trunk/backends/events/sdl/sdl-events.cpp	                        (rev 0)
+++ scummvm/trunk/backends/events/sdl/sdl-events.cpp	2010-11-28 14:56:31 UTC (rev 54518)
@@ -0,0 +1,569 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL: https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2010-opengl/backends/events/sdl/sdl-events.cpp $
+ * $Id: sdl-events.cpp 53433 2010-10-13 15:42:16Z lordhoto $
+ *
+ */
+
+#if defined(SDL_BACKEND)
+
+// Disable symbol overrides so that we can use system headers.
+#define FORBIDDEN_SYMBOL_EXCEPTION_FILE
+
+#include "backends/events/sdl/sdl-events.h"
+#include "backends/platform/sdl/sdl.h"
+#include "common/config-manager.h"
+
+// FIXME move joystick defines out and replace with confile file options
+// we should really allow users to map any key to a joystick button
+#define JOY_DEADZONE 3200
+
+#ifndef __SYMBIAN32__ // Symbian wants dialog joystick i.e cursor for movement/selection
+	#define JOY_ANALOG
+#endif
+
+// #define JOY_INVERT_Y
+#define JOY_XAXIS 0
+#define JOY_YAXIS 1
+// buttons
+#define JOY_BUT_LMOUSE 0
+#define JOY_BUT_RMOUSE 2
+#define JOY_BUT_ESCAPE 3
+#define JOY_BUT_PERIOD 1
+#define JOY_BUT_SPACE 4
+#define JOY_BUT_F5 5
+
+SdlEventSource::SdlEventSource()
+    : _scrollLock(false), _joystick(0), _lastScreenID(0), EventSource() {
+	// Reset mouse state
+	memset(&_km, 0, sizeof(_km));
+
+	int joystick_num = ConfMan.getInt("joystick_num");
+	if (joystick_num > -1) {
+		// Initialize SDL joystick subsystem
+		if (SDL_InitSubSystem(SDL_INIT_JOYSTICK) == -1) {
+			error("Could not initialize SDL: %s", SDL_GetError());
+		}
+
+		// Enable joystick
+		if (SDL_NumJoysticks() > 0) {
+			printf("Using joystick: %s\n", SDL_JoystickName(0));
+			_joystick = SDL_JoystickOpen(joystick_num);
+		}
+	}
+}
+
+SdlEventSource::~SdlEventSource() {
+	if (_joystick)
+		SDL_JoystickClose(_joystick);
+}
+
+int SdlEventSource::mapKey(SDLKey key, SDLMod mod, Uint16 unicode) {
+	if (key >= SDLK_F1 && key <= SDLK_F9) {
+		return key - SDLK_F1 + Common::ASCII_F1;
+	} else if (key >= SDLK_KP0 && key <= SDLK_KP9) {
+		return key - SDLK_KP0 + '0';
+	} else if (key >= SDLK_UP && key <= SDLK_PAGEDOWN) {
+		return key;
+	} else if (unicode) {
+		return unicode;
+	} else if (key >= 'a' && key <= 'z' && (mod & KMOD_SHIFT)) {
+		return key & ~0x20;
+	} else if (key >= SDLK_NUMLOCK && key <= SDLK_EURO) {
+		return 0;
+	}
+	return key;
+}
+
+void SdlEventSource::fillMouseEvent(Common::Event &event, int x, int y) {
+	event.mouse.x = x;
+	event.mouse.y = y;
+
+	// Update the "keyboard mouse" coords
+	_km.x = x;
+	_km.y = y;
+}
+
+void SdlEventSource::handleKbdMouse() {
+	uint32 curTime = g_system->getMillis();
+	if (curTime >= _km.last_time + _km.delay_time) {
+		_km.last_time = curTime;
+		if (_km.x_down_count == 1) {
+			_km.x_down_time = curTime;
+			_km.x_down_count = 2;
+		}
+		if (_km.y_down_count == 1) {
+			_km.y_down_time = curTime;
+			_km.y_down_count = 2;
+		}
+
+		if (_km.x_vel || _km.y_vel) {
+			if (_km.x_down_count) {
+				if (curTime > _km.x_down_time + _km.delay_time * 12) {
+					if (_km.x_vel > 0)
+						_km.x_vel++;
+					else
+						_km.x_vel--;
+				} else if (curTime > _km.x_down_time + _km.delay_time * 8) {
+					if (_km.x_vel > 0)
+						_km.x_vel = 5;
+					else
+						_km.x_vel = -5;
+				}
+			}
+			if (_km.y_down_count) {
+				if (curTime > _km.y_down_time + _km.delay_time * 12) {
+					if (_km.y_vel > 0)
+						_km.y_vel++;
+					else
+						_km.y_vel--;
+				} else if (curTime > _km.y_down_time + _km.delay_time * 8) {
+					if (_km.y_vel > 0)
+						_km.y_vel = 5;
+					else
+						_km.y_vel = -5;
+				}
+			}
+
+			_km.x += _km.x_vel;
+			_km.y += _km.y_vel;
+
+			if (_km.x < 0) {
+				_km.x = 0;
+				_km.x_vel = -1;
+				_km.x_down_count = 1;
+			} else if (_km.x > _km.x_max) {
+				_km.x = _km.x_max;
+				_km.x_vel = 1;
+				_km.x_down_count = 1;
+			}
+
+			if (_km.y < 0) {
+				_km.y = 0;
+				_km.y_vel = -1;
+				_km.y_down_count = 1;
+			} else if (_km.y > _km.y_max) {
+				_km.y = _km.y_max;
+				_km.y_vel = 1;
+				_km.y_down_count = 1;
+			}
+
+			SDL_WarpMouse((Uint16)_km.x, (Uint16)_km.y);
+		}
+	}
+}
+
+void SdlEventSource::SDLModToOSystemKeyFlags(SDLMod mod, Common::Event &event) {
+
+	event.kbd.flags = 0;
+
+#ifdef LINUPY
+	// Yopy has no ALT key, steal the SHIFT key
+	// (which isn't used much anyway)
+	if (mod & KMOD_SHIFT)
+		event.kbd.flags |= Common::KBD_ALT;
+#else
+	if (mod & KMOD_SHIFT)
+		event.kbd.flags |= Common::KBD_SHIFT;
+	if (mod & KMOD_ALT)
+		event.kbd.flags |= Common::KBD_ALT;
+#endif
+	if (mod & KMOD_CTRL)
+		event.kbd.flags |= Common::KBD_CTRL;
+
+	// Sticky flags
+	if (mod & KMOD_NUM)
+		event.kbd.flags |= Common::KBD_NUM;
+	if (mod & KMOD_CAPS)
+		event.kbd.flags |= Common::KBD_CAPS;
+}
+
+bool SdlEventSource::pollEvent(Common::Event &event) {
+	handleKbdMouse();
+
+	// If the screen changed, send an Common::EVENT_SCREEN_CHANGED
+	int screenID = ((OSystem_SDL *)g_system)->getGraphicsManager()->getScreenChangeID();
+	if (screenID != _lastScreenID) {
+		_lastScreenID = screenID;
+		event.type = Common::EVENT_SCREEN_CHANGED;
+		return true;
+	}
+
+	SDL_Event ev;
+	ev.type = SDL_NOEVENT;
+	while (SDL_PollEvent(&ev)) {
+		preprocessEvents(&ev);
+		if (dispatchSDLEvent(ev, event))
+			return true;
+	}
+	return false;
+}
+
+bool SdlEventSource::dispatchSDLEvent(SDL_Event &ev, Common::Event &event) {
+	switch (ev.type) {
+	case SDL_KEYDOWN:
+		return handleKeyDown(ev, event);
+	case SDL_KEYUP:
+		return handleKeyUp(ev, event);
+	case SDL_MOUSEMOTION:
+		return handleMouseMotion(ev, event);
+	case SDL_MOUSEBUTTONDOWN:
+		return handleMouseButtonDown(ev, event);
+	case SDL_MOUSEBUTTONUP:
+		return handleMouseButtonUp(ev, event);
+	case SDL_JOYBUTTONDOWN:
+		return handleJoyButtonDown(ev, event);
+	case SDL_JOYBUTTONUP:
+		return handleJoyButtonUp(ev, event);
+	case SDL_JOYAXISMOTION:
+		return handleJoyAxisMotion(ev, event);
+
+	case SDL_VIDEOEXPOSE:
+		// HACK: Send a fake event, handled by SdlGraphicsManager
+		event.type = (Common::EventType)OSystem_SDL::kSdlEventExpose;
+		return true;
+
+	case SDL_VIDEORESIZE:
+		// HACK: Send a fake event, handled by OpenGLSdlGraphicsManager
+		event.type = (Common::EventType)OSystem_SDL::kSdlEventResize;
+		event.mouse.x = ev.resize.w;
+		event.mouse.y = ev.resize.h;
+		return true;
+
+	case SDL_QUIT:
+		event.type = Common::EVENT_QUIT;
+		return true;
+
+	}
+
+	return false;
+}
+
+
+bool SdlEventSource::handleKeyDown(SDL_Event &ev, Common::Event &event) {
+
+	SDLModToOSystemKeyFlags(SDL_GetModState(), event);
+
+	// Handle scroll lock as a key modifier
+	if (ev.key.keysym.sym == SDLK_SCROLLOCK)
+		_scrollLock = !_scrollLock;
+
+	if (_scrollLock)
+		event.kbd.flags |= Common::KBD_SCRL;
+
+	// Ctrl-m toggles mouse capture
+	if (event.kbd.hasFlags(Common::KBD_CTRL) && ev.key.keysym.sym == 'm') {
+		toggleMouseGrab();
+		return false;
+	}
+
+#if defined(MACOSX)
+	// On Macintosh', Cmd-Q quits
+	if ((ev.key.keysym.mod & KMOD_META) && ev.key.keysym.sym == 'q') {
+		event.type = Common::EVENT_QUIT;
+		return true;
+	}
+#elif defined(UNIX)
+	// On other unices, Control-Q quits
+	if ((ev.key.keysym.mod & KMOD_CTRL) && ev.key.keysym.sym == 'q') {
+		event.type = Common::EVENT_QUIT;
+		return true;
+	}
+#else
+	// Ctrl-z and Alt-X quit
+	if ((event.kbd.hasFlags(Common::KBD_CTRL) && ev.key.keysym.sym == 'z') || (event.kbd.hasFlags(Common::KBD_ALT) && ev.key.keysym.sym == 'x')) {
+		event.type = Common::EVENT_QUIT;
+		return true;
+	}
+#endif
+
+	if ((ev.key.keysym.mod & KMOD_CTRL) && ev.key.keysym.sym == 'u') {
+		event.type = Common::EVENT_MUTE;
+		return true;
+	}
+
+	if (remapKey(ev, event))
+		return true;
+
+	event.type = Common::EVENT_KEYDOWN;
+	event.kbd.keycode = (Common::KeyCode)ev.key.keysym.sym;
+	event.kbd.ascii = mapKey(ev.key.keysym.sym, ev.key.keysym.mod, ev.key.keysym.unicode);
+
+	return true;
+}
+
+bool SdlEventSource::handleKeyUp(SDL_Event &ev, Common::Event &event) {
+	if (remapKey(ev, event))
+		return true;
+
+	event.type = Common::EVENT_KEYUP;
+	event.kbd.keycode = (Common::KeyCode)ev.key.keysym.sym;
+	event.kbd.ascii = mapKey(ev.key.keysym.sym, ev.key.keysym.mod, ev.key.keysym.unicode);
+
+	// Ctrl-Alt-<key> will change the GFX mode
+	SDLModToOSystemKeyFlags(SDL_GetModState(), event);
+
+	// Set the scroll lock sticky flag
+	if (_scrollLock)
+		event.kbd.flags |= Common::KBD_SCRL;
+
+	return true;
+}
+
+bool SdlEventSource::handleMouseMotion(SDL_Event &ev, Common::Event &event) {
+	event.type = Common::EVENT_MOUSEMOVE;
+	fillMouseEvent(event, ev.motion.x, ev.motion.y);
+
+	return true;
+}
+
+bool SdlEventSource::handleMouseButtonDown(SDL_Event &ev, Common::Event &event) {
+	if (ev.button.button == SDL_BUTTON_LEFT)
+		event.type = Common::EVENT_LBUTTONDOWN;
+	else if (ev.button.button == SDL_BUTTON_RIGHT)
+		event.type = Common::EVENT_RBUTTONDOWN;
+#if defined(SDL_BUTTON_WHEELUP) && defined(SDL_BUTTON_WHEELDOWN)
+	else if (ev.button.button == SDL_BUTTON_WHEELUP)
+		event.type = Common::EVENT_WHEELUP;
+	else if (ev.button.button == SDL_BUTTON_WHEELDOWN)
+		event.type = Common::EVENT_WHEELDOWN;
+#endif
+#if defined(SDL_BUTTON_MIDDLE)
+	else if (ev.button.button == SDL_BUTTON_MIDDLE)
+		event.type = Common::EVENT_MBUTTONDOWN;
+#endif
+	else
+		return false;
+
+	fillMouseEvent(event, ev.button.x, ev.button.y);
+
+	return true;
+}
+
+bool SdlEventSource::handleMouseButtonUp(SDL_Event &ev, Common::Event &event) {
+	if (ev.button.button == SDL_BUTTON_LEFT)
+		event.type = Common::EVENT_LBUTTONUP;
+	else if (ev.button.button == SDL_BUTTON_RIGHT)
+		event.type = Common::EVENT_RBUTTONUP;
+#if defined(SDL_BUTTON_MIDDLE)
+	else if (ev.button.button == SDL_BUTTON_MIDDLE)
+		event.type = Common::EVENT_MBUTTONUP;
+#endif
+	else
+		return false;
+	fillMouseEvent(event, ev.button.x, ev.button.y);
+
+	return true;
+}
+
+bool SdlEventSource::handleJoyButtonDown(SDL_Event &ev, Common::Event &event) {
+	if (ev.jbutton.button == JOY_BUT_LMOUSE) {
+		event.type = Common::EVENT_LBUTTONDOWN;
+		fillMouseEvent(event, _km.x, _km.y);
+	} else if (ev.jbutton.button == JOY_BUT_RMOUSE) {
+		event.type = Common::EVENT_RBUTTONDOWN;
+		fillMouseEvent(event, _km.x, _km.y);
+	} else {
+		event.type = Common::EVENT_KEYDOWN;
+		switch (ev.jbutton.button) {
+		case JOY_BUT_ESCAPE:
+			event.kbd.keycode = Common::KEYCODE_ESCAPE;
+			event.kbd.ascii = mapKey(SDLK_ESCAPE, ev.key.keysym.mod, 0);
+			break;
+		case JOY_BUT_PERIOD:
+			event.kbd.keycode = Common::KEYCODE_PERIOD;
+			event.kbd.ascii = mapKey(SDLK_PERIOD, ev.key.keysym.mod, 0);
+			break;
+		case JOY_BUT_SPACE:
+			event.kbd.keycode = Common::KEYCODE_SPACE;
+			event.kbd.ascii = mapKey(SDLK_SPACE, ev.key.keysym.mod, 0);
+			break;
+		case JOY_BUT_F5:
+			event.kbd.keycode = Common::KEYCODE_F5;
+			event.kbd.ascii = mapKey(SDLK_F5, ev.key.keysym.mod, 0);
+			break;
+		}
+	}
+	return true;
+}
+
+bool SdlEventSource::handleJoyButtonUp(SDL_Event &ev, Common::Event &event) {
+	if (ev.jbutton.button == JOY_BUT_LMOUSE) {
+		event.type = Common::EVENT_LBUTTONUP;
+		fillMouseEvent(event, _km.x, _km.y);
+	} else if (ev.jbutton.button == JOY_BUT_RMOUSE) {
+		event.type = Common::EVENT_RBUTTONUP;
+		fillMouseEvent(event, _km.x, _km.y);
+	} else {
+		event.type = Common::EVENT_KEYUP;
+		switch (ev.jbutton.button) {
+		case JOY_BUT_ESCAPE:
+			event.kbd.keycode = Common::KEYCODE_ESCAPE;
+			event.kbd.ascii = mapKey(SDLK_ESCAPE, ev.key.keysym.mod, 0);
+			break;
+		case JOY_BUT_PERIOD:
+			event.kbd.keycode = Common::KEYCODE_PERIOD;
+			event.kbd.ascii = mapKey(SDLK_PERIOD, ev.key.keysym.mod, 0);
+			break;
+		case JOY_BUT_SPACE:
+			event.kbd.keycode = Common::KEYCODE_SPACE;
+			event.kbd.ascii = mapKey(SDLK_SPACE, ev.key.keysym.mod, 0);
+			break;
+		case JOY_BUT_F5:
+			event.kbd.keycode = Common::KEYCODE_F5;
+			event.kbd.ascii = mapKey(SDLK_F5, ev.key.keysym.mod, 0);
+			break;
+		}
+	}
+	return true;
+}
+
+bool SdlEventSource::handleJoyAxisMotion(SDL_Event &ev, Common::Event &event) {
+	int axis = ev.jaxis.value;
+	if ( axis > JOY_DEADZONE) {
+		axis -= JOY_DEADZONE;
+		event.type = Common::EVENT_MOUSEMOVE;
+	} else if ( axis < -JOY_DEADZONE ) {
+		axis += JOY_DEADZONE;
+		event.type = Common::EVENT_MOUSEMOVE;
+	} else
+		axis = 0;
+
+	if ( ev.jaxis.axis == JOY_XAXIS) {
+#ifdef JOY_ANALOG
+		_km.x_vel = axis / 2000;
+		_km.x_down_count = 0;
+#else
+		if (axis != 0) {
+			_km.x_vel = (axis > 0) ? 1:-1;
+			_km.x_down_count = 1;
+		} else {
+			_km.x_vel = 0;
+			_km.x_down_count = 0;
+		}
+#endif
+
+	} else if (ev.jaxis.axis == JOY_YAXIS) {
+#ifndef JOY_INVERT_Y
+		axis = -axis;
+#endif
+#ifdef JOY_ANALOG
+		_km.y_vel = -axis / 2000;
+		_km.y_down_count = 0;
+#else
+		if (axis != 0) {
+			_km.y_vel = (-axis > 0) ? 1: -1;
+			_km.y_down_count = 1;
+		} else {
+			_km.y_vel = 0;
+			_km.y_down_count = 0;
+		}
+#endif
+	}
+
+	fillMouseEvent(event, _km.x, _km.y);
+
+	return true;
+}
+
+bool SdlEventSource::remapKey(SDL_Event &ev, Common::Event &event) {
+#ifdef LINUPY
+	// On Yopy map the End button to quit
+	if ((ev.key.keysym.sym == 293)) {
+		event.type = Common::EVENT_QUIT;
+		return true;
+	}
+	// Map menu key to f5 (scumm menu)
+	if (ev.key.keysym.sym == 306) {
+		event.type = Common::EVENT_KEYDOWN;
+		event.kbd.keycode = Common::KEYCODE_F5;
+		event.kbd.ascii = mapKey(SDLK_F5, ev.key.keysym.mod, 0);
+		return true;
+	}
+	// Map action key to action
+	if (ev.key.keysym.sym == 291) {
+		event.type = Common::EVENT_KEYDOWN;
+		event.kbd.keycode = Common::KEYCODE_TAB;
+		event.kbd.ascii = mapKey(SDLK_TAB, ev.key.keysym.mod, 0);
+		return true;
+	}
+	// Map OK key to skip cinematic
+	if (ev.key.keysym.sym == 292) {
+		event.type = Common::EVENT_KEYDOWN;
+		event.kbd.keycode = Common::KEYCODE_ESCAPE;
+		event.kbd.ascii = mapKey(SDLK_ESCAPE, ev.key.keysym.mod, 0);
+		return true;
+	}
+#endif
+
+#ifdef QTOPIA
+	// Quit on fn+backspace on zaurus
+	if (ev.key.keysym.sym == 127) {
+		event.type = Common::EVENT_QUIT;
+		return true;
+	}
+
+	// Map menu key (f11) to f5 (scumm menu)
+	if (ev.key.keysym.sym == SDLK_F11) {
+		event.type = Common::EVENT_KEYDOWN;
+		event.kbd.keycode = Common::KEYCODE_F5;
+		event.kbd.ascii = mapKey(SDLK_F5, ev.key.keysym.mod, 0);
+	}
+	// Nap center (space) to tab (default action )
+	// I wanted to map the calendar button but the calendar comes up
+	//
+	else if (ev.key.keysym.sym == SDLK_SPACE) {
+		event.type = Common::EVENT_KEYDOWN;
+		event.kbd.keycode = Common::KEYCODE_TAB;
+		event.kbd.ascii = mapKey(SDLK_TAB, ev.key.keysym.mod, 0);
+	}
+	// Since we stole space (pause) above we'll rebind it to the tab key on the keyboard
+	else if (ev.key.keysym.sym == SDLK_TAB) {
+		event.type = Common::EVENT_KEYDOWN;
+		event.kbd.keycode = Common::KEYCODE_SPACE;
+		event.kbd.ascii = mapKey(SDLK_SPACE, ev.key.keysym.mod, 0);
+	} else {
+	// Let the events fall through if we didn't change them, this may not be the best way to
+	// set it up, but i'm not sure how sdl would like it if we let if fall through then redid it though.
+	// and yes i have an huge terminal size so i dont wrap soon enough.
+		event.type = Common::EVENT_KEYDOWN;
+		event.kbd.keycode = ev.key.keysym.sym;
+		event.kbd.ascii = mapKey(ev.key.keysym.sym, ev.key.keysym.mod, ev.key.keysym.unicode);
+	}
+#endif
+	return false;
+}
+
+void SdlEventSource::toggleMouseGrab() {
+	if (SDL_WM_GrabInput(SDL_GRAB_QUERY) == SDL_GRAB_OFF)
+		SDL_WM_GrabInput(SDL_GRAB_ON);
+	else
+		SDL_WM_GrabInput(SDL_GRAB_OFF);
+}
+
+void SdlEventSource::resetKeyboadEmulation(int16 x_max, int16 y_max) {
+	_km.x_max = x_max;
+	_km.y_max = y_max;
+	_km.delay_time = 25;
+	_km.last_time = 0;
+}
+
+#endif


Property changes on: scummvm/trunk/backends/events/sdl/sdl-events.cpp
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + Date Rev Author URL Id
Added: svn:eol-style
   + native

Added: scummvm/trunk/backends/events/sdl/sdl-events.h
===================================================================
--- scummvm/trunk/backends/events/sdl/sdl-events.h	                        (rev 0)
+++ scummvm/trunk/backends/events/sdl/sdl-events.h	2010-11-28 14:56:31 UTC (rev 54518)
@@ -0,0 +1,138 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL: https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2010-opengl/backends/events/sdl/sdl-events.h $
+ * $Id: sdl-events.h 53434 2010-10-13 15:42:33Z lordhoto $
+ *
+ */
+
+#if !defined(BACKEND_EVENTS_SDL_H) && !defined(DISABLE_DEFAULT_EVENTMANAGER)
+#define BACKEND_EVENTS_SDL_H
+
+#include "backends/events/default/default-events.h"
+
+#if defined(__SYMBIAN32__)
+#include <esdl\SDL.h>
+#else
+#include <SDL.h>
+#endif
+
+/**
+ * The SDL event source.
+ */
+class SdlEventSource : public Common::EventSource {
+public: 
+	SdlEventSource();
+	virtual ~SdlEventSource();
+
+	/**
+	 * Gets and processes SDL events.
+	 */
+	virtual bool pollEvent(Common::Event &event);
+
+	/**
+	 * Resets keyboard emulation after a video screen change
+	 */
+	virtual void resetKeyboadEmulation(int16 x_max, int16 y_max);
+
+	/**
+	 * Toggles mouse input grab
+	 */
+	virtual void toggleMouseGrab();
+
+protected:
+	/** @name Keyboard mouse emulation
+	 * Disabled by fingolfin 2004-12-18.
+	 * I am keeping the rest of the code in for now, since the joystick
+	 * code (or rather, "hack") uses it, too.
+	 */
+	//@{
+
+	struct KbdMouse {
+		int16 x, y, x_vel, y_vel, x_max, y_max, x_down_count, y_down_count;
+		uint32 last_time, delay_time, x_down_time, y_down_time;
+	};
+	KbdMouse _km;
+
+	//@}
+
+	/** Scroll lock state - since SDL doesn't track it */
+	bool _scrollLock;
+	
+	/** Joystick */
+	SDL_Joystick *_joystick;
+
+	/** Last screen id for checking if it was modified */
+	int _lastScreenID;
+
+	/**
+	 * Pre process an event before it is dispatched.
+	 */
+	virtual void preprocessEvents(SDL_Event *event) {}
+
+	/**
+	 * Dispatchs SDL events for each handler.
+	 */
+	virtual bool dispatchSDLEvent(SDL_Event &ev, Common::Event &event);
+
+
+	/** @name Event Handlers
+	 * Handlers for specific SDL events, called by SdlEventManager::dispatchSDLEvent().
+	 * This way, if a managers inherits fromt this SDL events manager, it can
+	 * change the behavior of only a single event, without having to override all
+	 * of SdlEventManager::dispatchSDLEvent().
+	 */
+	//@{
+
+	virtual bool handleKeyDown(SDL_Event &ev, Common::Event &event);
+	virtual bool handleKeyUp(SDL_Event &ev, Common::Event &event);
+	virtual bool handleMouseMotion(SDL_Event &ev, Common::Event &event);
+	virtual bool handleMouseButtonDown(SDL_Event &ev, Common::Event &event);
+	virtual bool handleMouseButtonUp(SDL_Event &ev, Common::Event &event);
+	virtual bool handleJoyButtonDown(SDL_Event &ev, Common::Event &event);
+	virtual bool handleJoyButtonUp(SDL_Event &ev, Common::Event &event);
+	virtual bool handleJoyAxisMotion(SDL_Event &ev, Common::Event &event);
+	virtual void handleKbdMouse();
+
+	//@}
+
+	/**
+	 * Assigns the mouse coords to the mouse event
+	 */
+	virtual void fillMouseEvent(Common::Event &event, int x, int y);
+
+	/**
+	 * Remaps key events. This allows platforms to configure
+	 * their custom keys.
+	 */
+	virtual bool remapKey(SDL_Event &ev, Common::Event &event);
+
+	/**
+	 * Maps the ASCII value of key
+	 */
+	virtual int mapKey(SDLKey key, SDLMod mod, Uint16 unicode);
+
+	/**
+	 * Configures the key modifiers flags status
+	 */
+	virtual void SDLModToOSystemKeyFlags(SDLMod mod, Common::Event &event);
+};
+
+#endif


Property changes on: scummvm/trunk/backends/events/sdl/sdl-events.h
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + Date Rev Author URL Id
Added: svn:eol-style
   + native

Added: scummvm/trunk/backends/events/symbiansdl/symbiansdl-events.cpp
===================================================================
--- scummvm/trunk/backends/events/symbiansdl/symbiansdl-events.cpp	                        (rev 0)
+++ scummvm/trunk/backends/events/symbiansdl/symbiansdl-events.cpp	2010-11-28 14:56:31 UTC (rev 54518)
@@ -0,0 +1,201 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL: https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2010-opengl/backends/events/symbiansdl/symbiansdl-events.cpp $
+ * $Id: symbiansdl-events.cpp 50840 2010-07-13 04:31:15Z vgvgf $
+ *
+ */
+
+#ifdef __SYMBIAN32__
+
+#include "backends/events/symbiansdl/symbiansdl-events.h"
+#include "backends/platform/symbian/src/SymbianActions.h"
+#include "gui/message.h"
+#include "common/translation.h"
+
+#include <bautils.h>
+
+SymbianSdlEventManager::zoneDesc SymbianSdlEventManager::_zones[TOTAL_ZONES] = {
+        { 0, 0, 320, 145 },
+        { 0, 145, 150, 55 },
+        { 150, 145, 170, 55 }
+};
+
+SymbianSdlEventManager::SymbianSdlEventManager(Common::EventSource *boss)
+	:
+	_currentZone(0),
+	SdlEventManager(boss) {
+	for (int i = 0; i < TOTAL_ZONES; i++) {
+		_mouseXZone[i] = (_zones[i].x + (_zones[i].width / 2));
+		_mouseYZone[i] = (_zones[i].y + (_zones[i].height / 2));
+	}
+}
+
+bool SymbianSdlEventManager::remapKey(SDL_Event &ev, Common::Event &event) {
+	if (GUI::Actions::Instance()->mappingActive() || ev.key.keysym.sym <= SDLK_UNKNOWN)
+		return false;
+
+	for (TInt loop = 0; loop < GUI::ACTION_LAST; loop++) {
+		if (GUI::Actions::Instance()->getMapping(loop) == (uint)ev.key.keysym.sym &&
+			GUI::Actions::Instance()->isEnabled(loop)) {
+			// Create proper event instead
+			switch (loop) {
+			case GUI::ACTION_UP:
+				if (ev.type == SDL_KEYDOWN) {
+					_km.y_vel = -1;
+					_km.y_down_count = 1;
+				} else {
+					_km.y_vel = 0;
+					_km.y_down_count = 0;
+				}
+				event.type = Common::EVENT_MOUSEMOVE;
+				fillMouseEvent(event, _km.x, _km.y);
+
+				return true;
+
+			case GUI::ACTION_DOWN:
+				if (ev.type == SDL_KEYDOWN) {
+					_km.y_vel = 1;
+					_km.y_down_count = 1;
+				} else {
+					_km.y_vel = 0;
+					_km.y_down_count = 0;
+				}
+				event.type = Common::EVENT_MOUSEMOVE;
+				fillMouseEvent(event, _km.x, _km.y);
+
+				return true;
+
+			case GUI::ACTION_LEFT:
+				if (ev.type == SDL_KEYDOWN) {
+					_km.x_vel = -1;
+					_km.x_down_count = 1;
+				} else {
+					_km.x_vel = 0;
+					_km.x_down_count = 0;
+				}
+				event.type = Common::EVENT_MOUSEMOVE;
+				fillMouseEvent(event, _km.x, _km.y);
+
+				return true;
+
+			case GUI::ACTION_RIGHT:
+				if (ev.type == SDL_KEYDOWN) {
+					_km.x_vel = 1;
+					_km.x_down_count = 1;
+				} else {
+					_km.x_vel = 0;
+					_km.x_down_count = 0;
+				}
+				event.type = Common::EVENT_MOUSEMOVE;
+				fillMouseEvent(event, _km.x, _km.y);
+
+				return true;
+
+			case GUI::ACTION_LEFTCLICK:
+				event.type = (ev.type == SDL_KEYDOWN ? Common::EVENT_LBUTTONDOWN : Common::EVENT_LBUTTONUP);
+				fillMouseEvent(event, _km.x, _km.y);
+
+				return true;
+
+			case GUI::ACTION_RIGHTCLICK:
+				event.type = (ev.type == SDL_KEYDOWN ? Common::EVENT_RBUTTONDOWN : Common::EVENT_RBUTTONUP);
+				fillMouseEvent(event, _km.x, _km.y);
+
+				return true;
+
+			case GUI::ACTION_ZONE:
+				if (ev.type == SDL_KEYDOWN) {
+					for (int i = 0; i < TOTAL_ZONES; i++)
+						if (_km.x >= _zones[i].x && _km.y >= _zones[i].y &&
+							_km.x <= _zones[i].x + _zones[i].width && _km.y <= _zones[i].y + _zones[i].height
+							) {
+							_mouseXZone[i] = _km.x;
+							_mouseYZone[i] = _km.y;
+							break;
+						}
+						_currentZone++;
+						if (_currentZone >= TOTAL_ZONES)
+							_currentZone = 0;
+						event.type = Common::EVENT_MOUSEMOVE;
+						fillMouseEvent(event, _mouseXZone[_currentZone], _mouseYZone[_currentZone]);
+						SDL_WarpMouse(event.mouse.x, event.mouse.y);
+				}
+
+				return true;
+			case GUI::ACTION_MULTI: {
+				GUI::Key &key = GUI::Actions::Instance()->getKeyAction(loop);
+				// if key code is pause, then change event to interactive or just fall through
+				if (key.keycode() == SDLK_PAUSE) {
+					event.type = Common::EVENT_PREDICTIVE_DIALOG;
+					return true;
+					}
+				}
+			case GUI::ACTION_SAVE:
+			case GUI::ACTION_SKIP:
+			case GUI::ACTION_SKIP_TEXT:
+			case GUI::ACTION_PAUSE:
+			case GUI::ACTION_SWAPCHAR:
+			case GUI::ACTION_FASTMODE:
+			case GUI::ACTION_DEBUGGER:
+			case GUI::ACTION_MAINMENU:
+			case GUI::ACTION_VKB:
+			case GUI::ACTION_KEYMAPPER:{
+					GUI::Key &key = GUI::Actions::Instance()->getKeyAction(loop);
+					ev.key.keysym.sym = (SDLKey) key.keycode();
+					ev.key.keysym.scancode = 0;
+					ev.key.keysym.mod = (SDLMod) key.flags();
+
+					// Translate from SDL keymod event to Scummvm Key Mod Common::Event.
+					// This codes is also present in GP32 backend and in SDL backend as a static function
+					// Perhaps it should be shared.
+					if (key.flags() != 0) {
+						event.kbd.flags = 0;
+
+						if (ev.key.keysym.mod & KMOD_SHIFT)
+							event.kbd.flags |= Common::KBD_SHIFT;
+
+						if (ev.key.keysym.mod & KMOD_ALT)
+							event.kbd.flags |= Common::KBD_ALT;
+
+						if (ev.key.keysym.mod & KMOD_CTRL)
+							event.kbd.flags |= Common::KBD_CTRL;
+					}
+
+					return false;
+				}
+
+			case GUI::ACTION_QUIT:
+				{
+					GUI::MessageDialog alert(_("Do you want to quit ?"), _("Yes"), _("No"));
+					if (alert.runModal() == GUI::kMessageOK)
+						g_system->quit();
+
+					return true;
+				}
+			}
+		}
+	}
+
+	return false;
+}
+
+#endif
+


Property changes on: scummvm/trunk/backends/events/symbiansdl/symbiansdl-events.cpp
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + Date Rev Author URL Id
Added: svn:eol-style
   + native

Copied: scummvm/trunk/backends/events/symbiansdl/symbiansdl-events.h (from rev 54517, scummvm/trunk/backends/platform/samsungtv/samsungtv.h)
===================================================================
--- scummvm/trunk/backends/events/symbiansdl/symbiansdl-events.h	                        (rev 0)
+++ scummvm/trunk/backends/events/symbiansdl/symbiansdl-events.h	2010-11-28 14:56:31 UTC (rev 54518)
@@ -0,0 +1,59 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL: https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2010-opengl/backends/events/symbiansdl/symbiansdl-events.h $
+ * $Id: symbiansdl-events.h 50609 2010-07-03 00:13:45Z vgvgf $
+ *
+ */
+
+#if !defined(BACKEND_EVENTS_SYMBIAN_SDL_H) && !defined(DISABLE_DEFAULT_EVENTMANAGER)
+#define BACKEND_EVENTS_SYMBIAN_SDL_H
+
+#include "backends/events/sdl/sdl-events.h"
+
+#define TOTAL_ZONES 3
+
+/**
+ * SDL events manager for Symbian
+ */
+class SymbianSdlEventManager : public SdlEventManager {
+public:
+	SymbianSdlEventManager(Common::EventSource *boss);
+
+protected:
+	// Used to handle joystick navi zones
+	int _mouseXZone[TOTAL_ZONES];
+	int _mouseYZone[TOTAL_ZONES];
+	int _currentZone;
+
+	struct zoneDesc {
+		int x;
+		int y;
+		int width;
+		int height;
+	};
+
+	static zoneDesc _zones[TOTAL_ZONES];
+
+	virtual bool remapKey(SDL_Event &ev, Common::Event &event);
+};
+
+#endif
+

Copied: scummvm/trunk/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp (from rev 54517, scummvm/trunk/backends/platform/dingux/dingux-graphics.cpp)
===================================================================
--- scummvm/trunk/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp	                        (rev 0)
+++ scummvm/trunk/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp	2010-11-28 14:56:31 UTC (rev 54518)
@@ -0,0 +1,506 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL: https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2010-opengl/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp $
+ * $Id: dinguxsdl-graphics.cpp 53730 2010-10-23 09:30:26Z hkz $
+ *
+ */
+
+#if defined (DINGUX)
+
+#include "backends/graphics/dinguxsdl/dinguxsdl-graphics.h"
+#include "backends/events/dinguxsdl/dinguxsdl-events.h"
+#include "graphics/scaler/aspect.h"
+
+static const OSystem::GraphicsMode s_supportedGraphicsModes[] = {
+	{"1x", "Standard", GFX_NORMAL},
+	{0, 0, 0}
+};
+
+DINGUXSdlGraphicsManager::DINGUXSdlGraphicsManager(SdlEventSource *boss) : SdlGraphicsManager(boss) {
+	_evSrc = boss;
+}
+
+const OSystem::GraphicsMode *DINGUXSdlGraphicsManager::getSupportedGraphicsModes() const {
+	return s_supportedGraphicsModes;
+}
+
+int DINGUXSdlGraphicsManager::getDefaultGraphicsMode() const {
+	return GFX_NORMAL;
+}
+
+bool DINGUXSdlGraphicsManager::setGraphicsMode(int mode) {
+	Common::StackLock lock(_graphicsMutex);
+
+	assert(_transactionMode == kTransactionActive);
+
+	if (_oldVideoMode.setup && _oldVideoMode.mode == mode)
+		return true;
+
+	int newScaleFactor = 1;
+
+	switch (mode) {
+	case GFX_NORMAL:
+		newScaleFactor = 1;
+		break;
+	case GFX_HALF:
+		newScaleFactor = 1;
+		break;
+	default:
+		warning("unknown gfx mode %d", mode);
+		return false;
+	}
+
+	_transactionDetails.normal1xScaler = (mode == GFX_NORMAL);
+	if (_oldVideoMode.setup && _oldVideoMode.scaleFactor != newScaleFactor)
+		_transactionDetails.needHotswap = true;
+
+	_transactionDetails.needUpdatescreen = true;
+
+	_videoMode.mode = mode;
+	_videoMode.scaleFactor = newScaleFactor;
+
+	return true;
+}
+
+void DINGUXSdlGraphicsManager::setGraphicsModeIntern() {
+	Common::StackLock lock(_graphicsMutex);
+	ScalerProc *newScalerProc = 0;
+
+	switch (_videoMode.mode) {
+	case GFX_NORMAL:
+		newScalerProc = Normal1x;
+		break;
+	case GFX_HALF:
+		newScalerProc = DownscaleAllByHalf;
+		break;
+
+	default:
+		error("Unknown gfx mode %d", _videoMode.mode);
+	}
+
+	_scalerProc = newScalerProc;
+
+	if (!_screen || !_hwscreen)
+		return;
+
+	// Blit everything to the screen
+	_forceFull = true;
+
+	// Even if the old and new scale factors are the same, we may have a
+	// different scaler for the cursor now.
+	blitCursor();
+}
+
+void DINGUXSdlGraphicsManager::initSize(uint w, uint h) {
+	assert(_transactionMode == kTransactionActive);
+
+	// Avoid redundant res changes
+	if ((int)w == _videoMode.screenWidth && (int)h == _videoMode.screenHeight)
+		return;
+
+	_videoMode.screenWidth = w;
+	_videoMode.screenHeight = h;
+	if (w > 320 || h > 240) {
+		setGraphicsMode(GFX_HALF);
+		setGraphicsModeIntern();
+		_evSrc->toggleMouseGrab();
+	}
+
+	_transactionDetails.sizeChanged = true;
+}
+
+void DINGUXSdlGraphicsManager::drawMouse() {
+	if (!_mouseVisible || !_mouseSurface) {
+		_mouseBackup.x = _mouseBackup.y = _mouseBackup.w = _mouseBackup.h = 0;
+		return;
+	}
+
+	SDL_Rect dst;
+	int scale;
+	int hotX, hotY;
+
+	if (_videoMode.mode == GFX_HALF && !_overlayVisible) {
+		dst.x = _mouseCurState.x / 2;
+		dst.y = _mouseCurState.y / 2;
+	} else {
+		dst.x = _mouseCurState.x;
+		dst.y = _mouseCurState.y;
+	}
+
+	if (!_overlayVisible) {
+		scale = _videoMode.scaleFactor;
+		dst.w = _mouseCurState.vW;
+		dst.h = _mouseCurState.vH;
+		hotX = _mouseCurState.vHotX;
+		hotY = _mouseCurState.vHotY;
+	} else {
+		scale = 1;
+		dst.w = _mouseCurState.rW;
+		dst.h = _mouseCurState.rH;
+		hotX = _mouseCurState.rHotX;
+		hotY = _mouseCurState.rHotY;
+	}
+
+	// The mouse is undrawn using virtual coordinates, i.e. they may be
+	// scaled and aspect-ratio corrected.
+
+	_mouseBackup.x = dst.x - hotX;
+	_mouseBackup.y = dst.y - hotY;
+	_mouseBackup.w = dst.w;
+	_mouseBackup.h = dst.h;
+
+	// We draw the pre-scaled cursor image, so now we need to adjust for
+	// scaling, shake position and aspect ratio correction manually.
+
+	if (!_overlayVisible) {
+		dst.y += _currentShakePos;
+	}
+
+	if (_videoMode.aspectRatioCorrection && !_overlayVisible)
+		dst.y = real2Aspect(dst.y);
+
+	dst.x = scale * dst.x - _mouseCurState.rHotX;
+	dst.y = scale * dst.y - _mouseCurState.rHotY;
+	dst.w = _mouseCurState.rW;
+	dst.h = _mouseCurState.rH;
+
+	// Note that SDL_BlitSurface() and addDirtyRect() will both perform any
+	// clipping necessary
+
+	if (SDL_BlitSurface(_mouseSurface, NULL, _hwscreen, &dst) != 0)
+		error("SDL_BlitSurface failed: %s", SDL_GetError());
+
+	// The screen will be updated using real surface coordinates, i.e.
+	// they will not be scaled or aspect-ratio corrected.
+	addDirtyRect(dst.x, dst.y, dst.w, dst.h, true);
+}
+
+void DINGUXSdlGraphicsManager::undrawMouse() {
+	const int x = _mouseBackup.x;
+	const int y = _mouseBackup.y;
+
+	// When we switch bigger overlay off mouse jumps. Argh!
+	// This is intended to prevent undrawing offscreen mouse
+	if (!_overlayVisible && (x >= _videoMode.screenWidth || y >= _videoMode.screenHeight))
+		return;
+
+	if (_mouseBackup.w != 0 && _mouseBackup.h != 0) {
+		if (_videoMode.mode == GFX_HALF && !_overlayVisible) {
+			addDirtyRect(x*2, y*2, _mouseBackup.w*2, _mouseBackup.h*2);
+		} else {
+			addDirtyRect(x, y, _mouseBackup.w, _mouseBackup.h);
+		}
+	}
+}
+
+void DINGUXSdlGraphicsManager::internUpdateScreen() {
+	SDL_Surface *srcSurf, *origSurf;
+	int height, width;
+	ScalerProc *scalerProc;
+	int scale1;
+
+#if defined (DEBUG) && ! defined(_WIN32_WCE) // definitions not available for non-DEBUG here. (needed this to compile in SYMBIAN32 & linux?)
+	assert(_hwscreen != NULL);
+	assert(_hwscreen->map->sw_data != NULL);
+#endif
+
+	// If the shake position changed, fill the dirty area with blackness
+	if (_currentShakePos != _newShakePos) {
+		SDL_Rect blackrect = {0, 0, _videoMode.screenWidth * _videoMode.scaleFactor, _newShakePos * _videoMode.scaleFactor};
+
+		if (_videoMode.aspectRatioCorrection && !_overlayVisible)
+			blackrect.h = real2Aspect(blackrect.h - 1) + 1;
+
+		SDL_FillRect(_hwscreen, &blackrect, 0);
+
+		_currentShakePos = _newShakePos;
+
+		_forceFull = true;
+	}
+
+	// Check whether the palette was changed in the meantime and update the
+	// screen surface accordingly.
+	if (_screen && _paletteDirtyEnd != 0) {
+		SDL_SetColors(_screen, _currentPalette + _paletteDirtyStart,
+		              _paletteDirtyStart,
+		              _paletteDirtyEnd - _paletteDirtyStart);
+
+		_paletteDirtyEnd = 0;
+
+		_forceFull = true;
+	}
+
+#ifdef USE_OSD
+	// OSD visible (i.e. non-transparent)?
+	if (_osdAlpha != SDL_ALPHA_TRANSPARENT) {
+		// Updated alpha value
+		const int diff = SDL_GetTicks() - _osdFadeStartTime;
+		if (diff > 0) {
+			if (diff >= kOSDFadeOutDuration) {
+				// Back to full transparency
+				_osdAlpha = SDL_ALPHA_TRANSPARENT;
+			} else {
+				// Do a linear fade out...
+				const int startAlpha = SDL_ALPHA_TRANSPARENT + kOSDInitialAlpha * (SDL_ALPHA_OPAQUE - SDL_ALPHA_TRANSPARENT) / 100;
+				_osdAlpha = startAlpha + diff * (SDL_ALPHA_TRANSPARENT - startAlpha) / kOSDFadeOutDuration;
+			}
+			SDL_SetAlpha(_osdSurface, SDL_RLEACCEL | SDL_SRCCOLORKEY | SDL_SRCALPHA, _osdAlpha);
+			_forceFull = true;
+		}
+	}
+#endif
+
+	if (!_overlayVisible) {
+		origSurf = _screen;
+		srcSurf = _tmpscreen;
+		width = _videoMode.screenWidth;
+		height = _videoMode.screenHeight;
+		scalerProc = _scalerProc;
+		scale1 = _videoMode.scaleFactor;
+	} else {
+		origSurf = _overlayscreen;
+		srcSurf = _tmpscreen2;
+		width = _videoMode.overlayWidth;
+		height = _videoMode.overlayHeight;
+		scalerProc = Normal1x;
+		scale1 = 1;
+	}
+
+	// Add the area covered by the mouse cursor to the list of dirty rects if
+	// we have to redraw the mouse.
+	if (_mouseNeedsRedraw)
+		undrawMouse();
+
+	// Force a full redraw if requested
+	if (_forceFull) {
+		_numDirtyRects = 1;
+		_dirtyRectList[0].x = 0;
+		_dirtyRectList[0].y = 0;
+		_dirtyRectList[0].w = width;
+		_dirtyRectList[0].h = height;
+	}
+
+	// Only draw anything if necessary
+	if (_numDirtyRects > 0 || _mouseNeedsRedraw) {
+		SDL_Rect *r;
+		SDL_Rect dst;
+		uint32 srcPitch, dstPitch;
+		SDL_Rect *lastRect = _dirtyRectList + _numDirtyRects;
+
+		for (r = _dirtyRectList; r != lastRect; ++r) {
+			dst = *r;
+			dst.x++;	// Shift rect by one since 2xSai needs to access the data around
+			dst.y++;	// any pixel to scale it, and we want to avoid mem access crashes.
+
+			if (SDL_BlitSurface(origSurf, r, srcSurf, &dst) != 0)
+				error("SDL_BlitSurface failed: %s", SDL_GetError());
+		}
+
+		SDL_LockSurface(srcSurf);
+		SDL_LockSurface(_hwscreen);
+
+		srcPitch = srcSurf->pitch;
+		dstPitch = _hwscreen->pitch;
+
+		for (r = _dirtyRectList; r != lastRect; ++r) {
+			register int dst_y = r->y + _currentShakePos;
+			register int dst_h = 0;
+			register int dst_w = r->w;
+			register int orig_dst_y = 0;
+			register int dst_x = r->x;
+			register int src_y;
+			register int src_x;
+
+			if (dst_y < height) {
+				dst_h = r->h;
+				if (dst_h > height - dst_y)
+					dst_h = height - dst_y;
+
+				orig_dst_y = dst_y;
+				src_x = dst_x;
+				src_y = dst_y;
+
+				if (_videoMode.aspectRatioCorrection && !_overlayVisible)
+					dst_y = real2Aspect(dst_y);
+
+				assert(scalerProc != NULL);
+
+				if ((_videoMode.mode == GFX_HALF) && (scalerProc == DownscaleAllByHalf)) {
+					if (dst_x % 2 == 1) {
+						dst_x--;
+						dst_w++;
+					}
+					if (dst_y % 2 == 1) {
+						dst_y--;
+						dst_h++;
+					}
+					src_x = dst_x;
+					src_y = dst_y;
+					dst_x = dst_x / 2;
+					dst_y = dst_y / 2;
+
+					scalerProc((byte *)srcSurf->pixels + (src_x * 2 + 2) + (src_y + 1) * srcPitch, srcPitch,
+					           (byte *)_hwscreen->pixels + dst_x * 2 + dst_y * dstPitch, dstPitch, dst_w, dst_h);
+
+				} else {
+					scalerProc((byte *)srcSurf->pixels + (r->x * 2 + 2) + (r->y + 1) * srcPitch, srcPitch,
+					           (byte *)_hwscreen->pixels + r->x * 2 + dst_y * dstPitch, dstPitch, r->w, dst_h);
+				}
+			}
+
+			if (_videoMode.mode == GFX_HALF && scalerProc == DownscaleAllByHalf) {
+				r->w = r->w / 2;
+				r->h = dst_h / 2;
+			} else {
+				r->w = r->w;
+				r->h = dst_h;
+			}
+
+			r->x = dst_x;
+			r->y = dst_y;
+
+
+#ifdef USE_SCALERS
+			if (_videoMode.aspectRatioCorrection && orig_dst_y < height && !_overlayVisible)
+				r->h = stretch200To240((uint8 *) _hwscreen->pixels, dstPitch, r->w, r->h, r->x, r->y, orig_dst_y * scale1);
+#endif
+		}
+		SDL_UnlockSurface(srcSurf);
+		SDL_UnlockSurface(_hwscreen);
+
+		// Readjust the dirty rect list in case we are doing a full update.
+		// This is necessary if shaking is active.
+		if (_forceFull) {
+			_dirtyRectList[0].y = 0;
+			_dirtyRectList[0].h = (_videoMode.mode == GFX_HALF) ? effectiveScreenHeight() / 2 : effectiveScreenHeight();
+		}
+
+		drawMouse();
+
+#ifdef USE_OSD
+		if (_osdAlpha != SDL_ALPHA_TRANSPARENT) {
+			SDL_BlitSurface(_osdSurface, 0, _hwscreen, 0);
+		}
+#endif
+		// Finally, blit all our changes to the screen
+		SDL_UpdateRects(_hwscreen, _numDirtyRects, _dirtyRectList);
+	}
+
+	_numDirtyRects = 0;
+	_forceFull = false;
+	_mouseNeedsRedraw = false;
+}
+
+void DINGUXSdlGraphicsManager::showOverlay() {
+	if (_videoMode.mode == GFX_HALF) {
+		_mouseCurState.x = _mouseCurState.x / 2;
+		_mouseCurState.y = _mouseCurState.y / 2;
+	}
+	SdlGraphicsManager::showOverlay();
+}
+
+void DINGUXSdlGraphicsManager::hideOverlay() {
+	if (_videoMode.mode == GFX_HALF) {
+		_mouseCurState.x = _mouseCurState.x * 2;
+		_mouseCurState.y = _mouseCurState.y * 2;
+	}
+	SdlGraphicsManager::hideOverlay();
+}
+
+bool DINGUXSdlGraphicsManager::loadGFXMode() {
+
+	// Forcefully disable aspect ratio correction for games
+	// which starts with a native 240px height resolution.
+	// This fixes games with weird resolutions, like MM Nes (256x240)
+	if(_videoMode.screenHeight == 240) {
+		_videoMode.aspectRatioCorrection = false;
+	}
+
+	fprintf(stdout, "Game ScreenMode = %d*%d\n", _videoMode.screenWidth, _videoMode.screenHeight);
+	if (_videoMode.screenWidth > 320 || _videoMode.screenHeight > 240) {
+		_videoMode.aspectRatioCorrection = false;
+		setGraphicsMode(GFX_HALF);
+		fprintf(stdout, "GraphicsMode set to HALF\n");
+	} else {
+		setGraphicsMode(GFX_NORMAL);
+		fprintf(stdout, "GraphicsMode set to NORMAL\n");
+	}
+
+	if ((_videoMode.mode == GFX_HALF) && !_overlayVisible) {
+		_videoMode.overlayWidth = _videoMode.screenWidth / 2;
+		_videoMode.overlayHeight = _videoMode.screenHeight / 2;
+		_videoMode.fullscreen = true;
+	} else {
+
+		_videoMode.overlayWidth = _videoMode.screenWidth * _videoMode.scaleFactor;
+		_videoMode.overlayHeight = _videoMode.screenHeight * _videoMode.scaleFactor;
+
+		if (_videoMode.aspectRatioCorrection)
+			_videoMode.overlayHeight = real2Aspect(_videoMode.overlayHeight);
+
+		_videoMode.hardwareWidth = _videoMode.screenWidth * _videoMode.scaleFactor;
+		_videoMode.hardwareHeight = effectiveScreenHeight();
+	}
+
+
+	return SdlGraphicsManager::loadGFXMode();
+}
+
+bool DINGUXSdlGraphicsManager::hasFeature(OSystem::Feature f) {
+	return
+	    (f == OSystem::kFeatureAspectRatioCorrection) ||
+	    (f == OSystem::kFeatureCursorHasPalette);
+}
+
+void DINGUXSdlGraphicsManager::setFeatureState(OSystem::Feature f, bool enable) {
+	switch (f) {
+		case OSystem::kFeatureAspectRatioCorrection:
+		setAspectRatioCorrection(enable);
+		break;
+	default:
+		break;
+	}
+}
+
+bool DINGUXSdlGraphicsManager::getFeatureState(OSystem::Feature f) {
+	assert(_transactionMode == kTransactionNone);
+
+	switch (f) {
+		case OSystem::kFeatureAspectRatioCorrection:
+		return _videoMode.aspectRatioCorrection;
+	default:
+		return false;
+	}
+}
+
+SdlGraphicsManager::MousePos* DINGUXSdlGraphicsManager::getMouseCurState() {
+	return &_mouseCurState;
+}
+
+SdlGraphicsManager::VideoState* DINGUXSdlGraphicsManager::getVideoMode() {
+	return &_videoMode;
+}
+
+bool DINGUXSdlGraphicsManager::isOverlayVisible() {
+	return _overlayVisible;
+}
+
+#endif


Property changes on: scummvm/trunk/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + Date Rev Author URL Id
Added: svn:eol-style
   + native

Copied: scummvm/trunk/backends/graphics/dinguxsdl/dinguxsdl-graphics.h (from rev 54517, scummvm/trunk/backends/platform/linuxmoto/linuxmoto-sdl.h)
===================================================================
--- scummvm/trunk/backends/graphics/dinguxsdl/dinguxsdl-graphics.h	                        (rev 0)
+++ scummvm/trunk/backends/graphics/dinguxsdl/dinguxsdl-graphics.h	2010-11-28 14:56:31 UTC (rev 54518)
@@ -0,0 +1,69 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL: https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2010-opengl/backends/graphics/dinguxsdl/dinguxsdl-graphics.h $
+ * $Id: dinguxsdl-graphics.h 53730 2010-10-23 09:30:26Z hkz $
+ *
+ */
+
+#ifndef BACKENDS_GRAPHICS_SDL_DINGUX_H
+#define BACKENDS_GRAPHICS_SDL_DINGUX_H
+#if defined (DINGUX)
+
+#include "backends/graphics/sdl/sdl-graphics.h"
+
+#include "graphics/scaler/aspect.h"	// for aspect2Real 
+#include "graphics/scaler/downscaler.h"
+
+enum {
+	GFX_HALF = 12
+};
+
+class DINGUXSdlGraphicsManager : public SdlGraphicsManager {
+public:
+	DINGUXSdlGraphicsManager(SdlEventSource *boss);
+
+	bool hasFeature(OSystem::Feature f);
+	void setFeatureState(OSystem::Feature f, bool enable);
+	bool getFeatureState(OSystem::Feature f);
+	int getDefaultGraphicsMode() const;
+
+	void initSize(uint w, uint h);
+	const OSystem::GraphicsMode *getSupportedGraphicsModes() const;
+	bool setGraphicsMode(const char *name);
+	bool setGraphicsMode(int mode);
+	void setGraphicsModeIntern();
+	void internUpdateScreen();
+	void showOverlay();
+	void hideOverlay();
+	bool loadGFXMode();
+	void drawMouse();
+	void undrawMouse();
+
+	SdlGraphicsManager::MousePos *getMouseCurState();
+	SdlGraphicsManager::VideoState *getVideoMode();
+	bool isOverlayVisible();
+
+protected:
+	SdlEventSource *_evSrc;
+};
+
+#endif /* DINGUX */
+#endif /* BACKENDS_GRAPHICS_SDL_DINGUX_H */

Added: scummvm/trunk/backends/graphics/gp2xsdl/gp2xsdl-graphics.cpp
===================================================================
--- scummvm/trunk/backends/graphics/gp2xsdl/gp2xsdl-graphics.cpp	                        (rev 0)
+++ scummvm/trunk/backends/graphics/gp2xsdl/gp2xsdl-graphics.cpp	2010-11-28 14:56:31 UTC (rev 54518)
@@ -0,0 +1,183 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL: https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2010-opengl/backends/graphics/gp2xsdl/gp2xsdl-graphics.cpp $
+ * $Id: gp2xsdl-graphics.cpp 50542 2010-07-01 06:07:24Z vgvgf $
+ *
+ */
+
+#ifdef GP2X
+
+#include "backends/graphics/gp2xsdl/gp2xsdl-graphics.h"
+#include "graphics/scaler/aspect.h"
+#include <SDL_gp2x.h>
+
+static const OSystem::GraphicsMode s_supportedGraphicsModes[] = {
+	{"Fullscreen", "1x", GFX_NORMAL},
+	{0, 0, 0}
+};
+
+GP2XSdlGraphicsManager::GP2XSdlGraphicsManager()
+	:
+	_adjustZoomOnMouse(false) {
+
+}
+
+const OSystem::GraphicsMode *GP2XSdlGraphicsManager::getSupportedGraphicsModes() const {
+	return s_supportedGraphicsModes;
+}
+
+int GP2XSdlGraphicsManager::getDefaultGraphicsMode() const {
+	return GFX_NORMAL;
+}
+
+
+bool GP2XSdlGraphicsManager::hasFeature(OSystem::Feature f) {
+	if (f == OSystem::kFeatureIconifyWindow)
+		return false;
+
+	return SdlGraphicsManager::hasFeature(f);
+}
+
+void GP2XSdlGraphicsManager::setFeatureState(OSystem::Feature f, bool enable) {
+	if (f != OSystem::kFeatureIconifyWindow)
+		SdlGraphicsManager::setFeatureState(f, enable);
+}
+
+void GP2XSdlGraphicsManager::drawMouse() {
+	if (!_mouseVisible || !_mouseSurface) {
+		_mouseBackup.x = _mouseBackup.y = _mouseBackup.w = _mouseBackup.h = 0;
+		return;
+	}
+
+	SDL_Rect zoomdst;
+	SDL_Rect dst;
+	int scale;
+	int hotX, hotY;
+	int tmpScreenWidth, tmpScreenHeight;
+
+	// Temp vars to ensure we zoom to the LCD resolution or greater.
+	tmpScreenWidth = _videoMode.screenWidth;
+	tmpScreenHeight = _videoMode.screenHeight;
+
+	if (_videoMode.screenHeight <= 240) {
+		tmpScreenHeight = 240;
+	}
+
+	if (_videoMode.screenWidth <= 320) {
+		tmpScreenWidth = 320;
+	}
+
+	dst.x = _mouseCurState.x;
+	dst.y = _mouseCurState.y;
+
+	if (!_overlayVisible) {
+		scale = _videoMode.scaleFactor;
+		dst.w = _mouseCurState.vW;
+		dst.h = _mouseCurState.vH;
+		hotX = _mouseCurState.vHotX;
+		hotY = _mouseCurState.vHotY;
+	} else {
+		scale = 1;
+		dst.w = _mouseCurState.rW;
+		dst.h = _mouseCurState.rH;
+		hotX = _mouseCurState.rHotX;
+		hotY = _mouseCurState.rHotY;
+	}
+
+	// The mouse is undrawn using virtual coordinates, i.e. they may be
+	// scaled and aspect-ratio corrected.
+
+	_mouseBackup.x = dst.x - hotX;
+	_mouseBackup.y = dst.y - hotY;
+	_mouseBackup.w = dst.w;
+	_mouseBackup.h = dst.h;
+
+	// We draw the pre-scaled cursor image, so now we need to adjust for
+	// scaling, shake position and aspect ratio correction manually.
+
+	if (!_overlayVisible) {
+		dst.y += _currentShakePos;
+	}
+
+	if (_videoMode.aspectRatioCorrection && !_overlayVisible)
+		dst.y = real2Aspect(dst.y);
+
+	dst.x = scale * dst.x - _mouseCurState.rHotX;
+	dst.y = scale * dst.y - _mouseCurState.rHotY;
+	dst.w = _mouseCurState.rW;
+	dst.h = _mouseCurState.rH;
+
+	// Hacking about with the zoom around mouse pointer stuff.
+	if (_adjustZoomOnMouse){
+
+		zoomdst.w = (tmpScreenWidth / 2);
+		zoomdst.h = (tmpScreenHeight / 2);
+
+		// Create a zoomed rect centered on the mouse pointer.
+		// Will pan 1/4 of the screen.
+
+		if (dst.x > ((tmpScreenWidth / 4) * 3)) {
+			zoomdst.x = (tmpScreenWidth / 2);
+		} else {
+			zoomdst.x = (dst.x - (tmpScreenWidth / 4));
+			if (zoomdst.x < 0) {
+				zoomdst.x = 0;
+			}
+		}
+
+		if (dst.y > ((tmpScreenHeight / 4) * 3)) {
+			zoomdst.y = (tmpScreenHeight / 2);
+		} else {
+			zoomdst.y = (dst.y - (tmpScreenHeight / 4));
+			if (zoomdst.y < 0) {
+				zoomdst.y = 0;
+			}
+		}
+		SDL_GP2X_Display(&zoomdst);
+	} else {
+
+		// Make sure we are looking at the whole screen otherwise.
+
+		zoomdst.x = 0;
+		zoomdst.y = 0;
+		zoomdst.w = (tmpScreenWidth);
+		zoomdst.h = (tmpScreenHeight);
+
+		SDL_GP2X_Display(&zoomdst);
+	};
+
+	// Note that SDL_BlitSurface() and addDirtyRect() will both perform any
+	// clipping necessary
+
+	if (SDL_BlitSurface(_mouseSurface, NULL, _hwscreen, &dst) != 0)
+		error("SDL_BlitSurface failed: %s", SDL_GetError());
+
+	// The screen will be updated using real surface coordinates, i.e.
+	// they will not be scaled or aspect-ratio corrected.
+
+	addDirtyRect(dst.x, dst.y, dst.w, dst.h, true);
+}
+
+void GP2XSdlGraphicsManager::toggleZoomOnMouse() {
+	_adjustZoomOnMouse = !_adjustZoomOnMouse;
+}
+
+#endif


Property changes on: scummvm/trunk/backends/graphics/gp2xsdl/gp2xsdl-graphics.cpp
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + Date Rev Author URL Id
Added: svn:eol-style
   + native

Copied: scummvm/trunk/backends/graphics/gp2xsdl/gp2xsdl-graphics.h (from rev 54517, scummvm/trunk/backends/platform/samsungtv/samsungtv.h)
===================================================================
--- scummvm/trunk/backends/graphics/gp2xsdl/gp2xsdl-graphics.h	                        (rev 0)
+++ scummvm/trunk/backends/graphics/gp2xsdl/gp2xsdl-graphics.h	2010-11-28 14:56:31 UTC (rev 54518)
@@ -0,0 +1,48 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL: https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2010-opengl/backends/graphics/gp2xsdl/gp2xsdl-graphics.h $
+ * $Id: gp2xsdl-graphics.h 50667 2010-07-05 01:10:29Z vgvgf $
+ *
+ */
+
+#ifndef BACKENDS_GRAPHICS_SDL_GP2X_H
+#define BACKENDS_GRAPHICS_SDL_GP2X_H
+
+#include "backends/graphics/sdl/sdl-graphics.h"
+
+class GP2XSdlGraphicsManager : public SdlGraphicsManager {
+public:
+	
+	virtual const OSystem::GraphicsMode *getSupportedGraphicsModes() const;
+	virtual int getDefaultGraphicsMode() const;
+	virtual void drawMouse();
+
+	virtual bool hasFeature(OSystem::Feature f);
+	virtual void setFeatureState(OSystem::Feature f, bool enable);
+
+	// Toggles zoom adjust on mouse
+	void toggleZoomOnMouse();
+
+protected:
+	bool _adjustZoomOnMouse;
+};
+
+#endif

Added: scummvm/trunk/backends/graphics/graphics.h
===================================================================
--- scummvm/trunk/backends/graphics/graphics.h	                        (rev 0)
+++ scummvm/trunk/backends/graphics/graphics.h	2010-11-28 14:56:31 UTC (rev 54518)
@@ -0,0 +1,91 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL: https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2010-opengl/backends/graphics/graphics.h $
+ * $Id: graphics.h 51492 2010-07-30 03:06:57Z vgvgf $
+ *
+ */
+
+#ifndef BACKENDS_GRAPHICS_ABSTRACT_H
+#define BACKENDS_GRAPHICS_ABSTRACT_H
+
+#include "common/system.h"
+#include "common/noncopyable.h"
+#include "common/keyboard.h"
+
+/**
+ * Abstract class for graphics manager. Subclasses
+ * implement the real functionality.
+ */
+class GraphicsManager : Common::NonCopyable {
+public:
+	virtual ~GraphicsManager() {}
+
+	virtual bool hasFeature(OSystem::Feature f) = 0;
+	virtual void setFeatureState(OSystem::Feature f, bool enable) = 0;
+	virtual bool getFeatureState(OSystem::Feature f) = 0;
+
+	virtual const OSystem::GraphicsMode *getSupportedGraphicsModes() const = 0;
+	virtual int getDefaultGraphicsMode() const = 0;
+	virtual bool setGraphicsMode(int mode) = 0;
+	virtual void resetGraphicsScale() = 0;
+	virtual int getGraphicsMode() const = 0;
+#ifdef USE_RGB_COLOR
+	virtual Graphics::PixelFormat getScreenFormat() const = 0;
+	virtual Common::List<Graphics::PixelFormat> getSupportedFormats() const = 0;
+#endif
+	virtual void initSize(uint width, uint height, const Graphics::PixelFormat *format = NULL) = 0;
+	virtual int getScreenChangeID() const = 0;
+
+	virtual void beginGFXTransaction() = 0;
+	virtual OSystem::TransactionError endGFXTransaction() = 0;
+
+	virtual int16 getHeight() = 0;
+	virtual int16 getWidth() = 0;
+	virtual void setPalette(const byte *colors, uint start, uint num) = 0;
+	virtual void grabPalette(byte *colors, uint start, uint num) = 0;
+	virtual void copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h) = 0;
+	virtual Graphics::Surface *lockScreen() = 0;
+	virtual void unlockScreen() = 0;
+	virtual void fillScreen(uint32 col) = 0;
+	virtual void updateScreen() = 0;
+	virtual void setShakePos(int shakeOffset) = 0;
+	virtual void setFocusRectangle(const Common::Rect& rect) = 0;
+	virtual void clearFocusRectangle() = 0;
+
+	virtual void showOverlay() = 0;
+	virtual void hideOverlay() = 0;
+	virtual Graphics::PixelFormat getOverlayFormat() const = 0;
+	virtual void clearOverlay() = 0;
+	virtual void grabOverlay(OverlayColor *buf, int pitch) = 0;
+	virtual void copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h)= 0;
+	virtual int16 getOverlayHeight() = 0;
+	virtual int16 getOverlayWidth() = 0;
+
+	virtual bool showMouse(bool visible) = 0;
+	virtual void warpMouse(int x, int y) = 0;
+	virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int cursorTargetScale = 1, const Graphics::PixelFormat *format = NULL) = 0;
+	virtual void setCursorPalette(const byte *colors, uint start, uint num) = 0;
+	virtual void disableCursorPalette(bool disable) = 0;
+
+	virtual void displayMessageOnOSD(const char *msg) {}
+};
+
+#endif


Property changes on: scummvm/trunk/backends/graphics/graphics.h
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + Date Rev Author URL Id
Added: svn:eol-style
   + native


@@ Diff output truncated at 100000 characters. @@

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list