[Scummvm-cvs-logs] SF.net SVN: scummvm:[50481] scummvm/branches/gsoc2010-opengl/backends
vgvgf at users.sourceforge.net
vgvgf at users.sourceforge.net
Tue Jun 29 07:00:45 CEST 2010
Revision: 50481
http://scummvm.svn.sourceforge.net/scummvm/?rev=50481&view=rev
Author: vgvgf
Date: 2010-06-29 05:00:44 +0000 (Tue, 29 Jun 2010)
Log Message:
-----------
Renamed Samsung TV SDL Event Manager class and file for constancy, and added initialization for it on Samsung TV backend.
Modified Paths:
--------------
scummvm/branches/gsoc2010-opengl/backends/module.mk
scummvm/branches/gsoc2010-opengl/backends/platform/samsungtv/samsungtv.cpp
scummvm/branches/gsoc2010-opengl/backends/platform/samsungtv/samsungtv.h
Added Paths:
-----------
scummvm/branches/gsoc2010-opengl/backends/events/samsungtvsdl/
scummvm/branches/gsoc2010-opengl/backends/events/samsungtvsdl/samsungtvsdl-events.cpp
scummvm/branches/gsoc2010-opengl/backends/events/samsungtvsdl/samsungtvsdl-events.h
Removed Paths:
-------------
scummvm/branches/gsoc2010-opengl/backends/events/samsungtv/
scummvm/branches/gsoc2010-opengl/backends/events/samsungtvsdl/samsungtv-events.cpp
scummvm/branches/gsoc2010-opengl/backends/events/samsungtvsdl/samsungtv-events.h
Deleted: scummvm/branches/gsoc2010-opengl/backends/events/samsungtvsdl/samsungtv-events.cpp
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/events/samsungtv/samsungtv-events.cpp 2010-06-29 03:53:06 UTC (rev 50480)
+++ scummvm/branches/gsoc2010-opengl/backends/events/samsungtvsdl/samsungtv-events.cpp 2010-06-29 05:00:44 UTC (rev 50481)
@@ -1,78 +0,0 @@
-/* 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$
- * $Id$
- *
- */
-
-#if defined(SAMSUNGTV)
-
-#include "backends/events/samsungtv/samsungtv-events.h"
-
-SdlSamsungTVEventManager::SdlSamsungTVEventManager(Common::EventSource *boss)
- :
- SdlEventManager(boss) {
-
-}
-
-bool SdlSamsungTVEventManager::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
Deleted: scummvm/branches/gsoc2010-opengl/backends/events/samsungtvsdl/samsungtv-events.h
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/events/samsungtv/samsungtv-events.h 2010-06-29 03:53:06 UTC (rev 50480)
+++ scummvm/branches/gsoc2010-opengl/backends/events/samsungtvsdl/samsungtv-events.h 2010-06-29 05:00:44 UTC (rev 50481)
@@ -1,40 +0,0 @@
-/* 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$
- * $Id$
- *
- */
-
-#if !defined(BACKEND_EVENTS_SDL_SAMSUNGTV_H) && !defined(DISABLE_DEFAULT_EVENTMANAGER)
-#define BACKEND_EVENTS_SDL_SAMSUNGTV_H
-
-#include "backends/events/sdl/sdl-events.h"
-
-class SdlSamsungTVEventManager : public SdlEventManager {
-public:
- SdlSamsungTVEventManager(Common::EventSource *boss);
- ~SdlSamsungTVEventManager() {}
-
-protected:
- bool remapKey(SDL_Event &ev, Common::Event &event);
-};
-
-#endif
Copied: scummvm/branches/gsoc2010-opengl/backends/events/samsungtvsdl/samsungtvsdl-events.cpp (from rev 50480, scummvm/branches/gsoc2010-opengl/backends/events/samsungtv/samsungtv-events.cpp)
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/events/samsungtvsdl/samsungtvsdl-events.cpp (rev 0)
+++ scummvm/branches/gsoc2010-opengl/backends/events/samsungtvsdl/samsungtvsdl-events.cpp 2010-06-29 05:00:44 UTC (rev 50481)
@@ -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$
+ * $Id$
+ *
+ */
+
+#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
Copied: scummvm/branches/gsoc2010-opengl/backends/events/samsungtvsdl/samsungtvsdl-events.h (from rev 50480, scummvm/branches/gsoc2010-opengl/backends/events/samsungtv/samsungtv-events.h)
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/events/samsungtvsdl/samsungtvsdl-events.h (rev 0)
+++ scummvm/branches/gsoc2010-opengl/backends/events/samsungtvsdl/samsungtvsdl-events.h 2010-06-29 05:00:44 UTC (rev 50481)
@@ -0,0 +1,40 @@
+/* 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$
+ * $Id$
+ *
+ */
+
+#if !defined(BACKEND_EVENTS_SDL_SAMSUNGTV_H) && !defined(DISABLE_DEFAULT_EVENTMANAGER)
+#define BACKEND_EVENTS_SDL_SAMSUNGTV_H
+
+#include "backends/events/sdl/sdl-events.h"
+
+class SamsungTVSdlEventManager : public SdlEventManager {
+public:
+ SamsungTVSdlEventManager(Common::EventSource *boss);
+ ~SamsungTVSdlEventManager() {}
+
+protected:
+ virtual bool remapKey(SDL_Event &ev, Common::Event &event);
+};
+
+#endif
Modified: scummvm/branches/gsoc2010-opengl/backends/module.mk
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/module.mk 2010-06-29 03:53:06 UTC (rev 50480)
+++ scummvm/branches/gsoc2010-opengl/backends/module.mk 2010-06-29 05:00:44 UTC (rev 50481)
@@ -7,7 +7,7 @@
audiocd/sdl/sdl-audiocd.o \
events/default/default-events.o \
events/linuxmotosdl/linuxmotosdl-events.o \
- events/samsungtv/samsungtv-events.o \
+ events/samsungtvsdl/samsungtvsdl-events.o \
events/sdl/sdl-events.o \
events/symbiansdl/symbiansdl-events.o \
fs/abstract-fs.o \
Modified: scummvm/branches/gsoc2010-opengl/backends/platform/samsungtv/samsungtv.cpp
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/platform/samsungtv/samsungtv.cpp 2010-06-29 03:53:06 UTC (rev 50480)
+++ scummvm/branches/gsoc2010-opengl/backends/platform/samsungtv/samsungtv.cpp 2010-06-29 05:00:44 UTC (rev 50481)
@@ -24,6 +24,7 @@
*/
#include "backends/platform/samsungtv/samsungtv.h"
+#include "backends/events/samsungtvsdl/samsungtvsdl-events.h"
OSystem_SDL_SamsungTV::OSystem_SDL_SamsungTV()
:
@@ -36,6 +37,14 @@
(f == OSystem::kFeatureCursorHasPalette);
}
+void OSystem_SDL_SamsungTV::initBackend() {
+ if (_eventManager == 0)
+ _eventManager = new SamsungTVSdlEventManager(this);
+
+ // Call parent implementation of this method
+ OSystem_SDL::initBackend();
+}
+
void OSystem_SDL_SamsungTV::setFeatureState(Feature f, bool enable) {
switch (f) {
case OSystem::kFeatureAspectRatioCorrection:
Modified: scummvm/branches/gsoc2010-opengl/backends/platform/samsungtv/samsungtv.h
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/platform/samsungtv/samsungtv.h 2010-06-29 03:53:06 UTC (rev 50480)
+++ scummvm/branches/gsoc2010-opengl/backends/platform/samsungtv/samsungtv.h 2010-06-29 05:00:44 UTC (rev 50481)
@@ -23,8 +23,8 @@
*
*/
-#ifndef SDL_SAMSUNGTV_COMMON_H
-#define SDL_SAMSUNGTV_COMMON_H
+#ifndef PLATFORM_SDL_SAMSUNGTV_H
+#define PLATFORM_SDL_SAMSUNGTV_H
#include "backends/platform/sdl/posix/posix.h"
@@ -32,11 +32,13 @@
public:
OSystem_SDL_SamsungTV();
- bool hasFeature(Feature f);
- void setFeatureState(Feature f, bool enable);
- bool getFeatureState(Feature f);
+ virtual void initBackend();
- void quit();
+ virtual bool hasFeature(Feature f);
+ virtual void setFeatureState(Feature f, bool enable);
+ virtual bool getFeatureState(Feature f);
+
+ virtual void quit();
};
#endif
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