WEBOS: Create webos backend with custom events

Currently only contains test code.
This commit is contained in:
Klaus Reimer 2011-04-04 00:28:14 +02:00 committed by Max Horn
parent b17f7d20c2
commit a4e757834e
9 changed files with 245 additions and 2 deletions

View file

@ -0,0 +1,55 @@
/* 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$
*
*/
#include "common/scummsys.h"
#include <stdio.h>
#ifdef WEBOS
#include "backends/events/webossdl/webossdl-events.h"
bool WebOSSdlEventSource::remapKey(SDL_Event &ev, Common::Event &event) {
switch (ev.type) {
case SDL_KEYDOWN:{
if (ev.key.keysym.sym == 231) {
printf("metatap down\n");
return true;
}
break;
}
case SDL_KEYUP: {
if (ev.key.keysym.sym == 231) {
printf("metatap up\n");
return true;
}
break;
}
}
// Invoke parent implementation of this method
return SdlEventSource::remapKey(ev, event);
}
#endif

View file

@ -0,0 +1,39 @@
/* 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_WEBOS_H) && !defined(DISABLE_DEFAULT_EVENTMANAGER)
#define BACKEND_EVENTS_SDL_WEBOS_H
#include "backends/events/sdl/sdl-events.h"
/**
* SDL events manager for WebOS
*/
class WebOSSdlEventSource : public SdlEventSource {
protected:
virtual bool remapKey(SDL_Event &ev, Common::Event &event);
};
#endif

View file

@ -14,6 +14,7 @@ MODULE_OBJS := \
events/samsungtvsdl/samsungtvsdl-events.o \ events/samsungtvsdl/samsungtvsdl-events.o \
events/sdl/sdl-events.o \ events/sdl/sdl-events.o \
events/symbiansdl/symbiansdl-events.o \ events/symbiansdl/symbiansdl-events.o \
events/webossdl/webossdl-events.o \
events/wincesdl/wincesdl-events.o \ events/wincesdl/wincesdl-events.o \
fs/abstract-fs.o \ fs/abstract-fs.o \
fs/stdiostream.o \ fs/stdiostream.o \

View file

@ -25,7 +25,7 @@
#include "common/scummsys.h" #include "common/scummsys.h"
#if defined(UNIX) && !defined(MACOSX) && !defined(SAMSUNGTV) && !defined(LINUXMOTO) && !defined(GPH_DEVICE) && !defined(GP2X) && !defined(DINGUX) && !defined(OPENPANDORA) #if defined(UNIX) && !defined(MACOSX) && !defined(SAMSUNGTV) && !defined(WEBOS) && !defined(LINUXMOTO) && !defined(GPH_DEVICE) && !defined(GP2X) && !defined(DINGUX) && !defined(OPENPANDORA)
#include "backends/platform/sdl/posix/posix.h" #include "backends/platform/sdl/posix/posix.h"
#include "backends/plugins/sdl/sdl-provider.h" #include "backends/plugins/sdl/sdl-provider.h"

View file

@ -0,0 +1,54 @@
/* 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$
*
*/
#include "backends/platform/webos/webos.h"
#include "backends/plugins/sdl/sdl-provider.h"
#include "base/main.h"
#if defined(WEBOS)
#include <unistd.h>
int main(int argc, char* argv[]) {
g_system = new OSystem_SDL_WebOS();
assert(g_system);
((OSystem_SDL_WebOS *)g_system)->init();
#ifdef DYNAMIC_MODULES
PluginManager::instance().addPluginProvider(new SDLPluginProvider());
#endif
// Invoke the actual ScummVM main entry point:
int res = scummvm_main(argc, argv);
// Free OSystem
delete (OSystem_SDL_WebOS *)g_system;
return res;
}
#endif

View file

@ -0,0 +1,10 @@
MODULE := backends/platform/webos
MODULE_OBJS := \
main.o \
webos.o
# We don't use rules.mk but rather manually update OBJS and MODULE_DIRS.
MODULE_OBJS := $(addprefix $(MODULE)/, $(MODULE_OBJS))
OBJS := $(MODULE_OBJS) $(OBJS)
MODULE_DIRS += $(sort $(dir $(MODULE_OBJS)))

View file

@ -0,0 +1,45 @@
/* 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$
*
*/
#include "backends/platform/webos/webos.h"
#include "backends/events/webossdl/webossdl-events.h"
#if defined(WEBOS)
OSystem_SDL_WebOS::OSystem_SDL_WebOS()
:
OSystem_POSIX("/media/cryptofs/apps/usr/palm/applications/org.scummvm/scummvmrc") {
}
void OSystem_SDL_WebOS::initBackend() {
// Create the events manager
if (_eventSource == 0)
_eventSource = new WebOSSdlEventSource();
// Call parent implementation of this method
OSystem_SDL::initBackend();
}
#endif

View file

@ -0,0 +1,38 @@
/* 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$
*
*/
#ifndef PLATFORM_SDL_WEBOS_H
#define PLATFORM_SDL_WEBOS_H
#include "backends/platform/sdl/posix/posix.h"
class OSystem_SDL_WebOS : public OSystem_POSIX {
public:
OSystem_SDL_WebOS();
virtual void initBackend();
};
#endif

3
configure vendored
View file

@ -2067,6 +2067,7 @@ if test -n "$_host"; then
_timidity=no _timidity=no
_mt32emu=no _mt32emu=no
_seq_midi=no _seq_midi=no
_vkeybd=yes
;; ;;
wii) wii)
_endian=big _endian=big
@ -3133,7 +3134,7 @@ case $_backend in
webos) webos)
INCLUDES="$INCLUDES -I$WEBOS_PDK/include/SDL" INCLUDES="$INCLUDES -I$WEBOS_PDK/include/SDL"
LIBS="$LIBS -lSDL -lpdl" LIBS="$LIBS -lSDL -lpdl"
DEFINES="$DEFINES -DWEBOS -DSDL_BACKEND" DEFINES="$DEFINES -DSDL_BACKEND -DWEBOS"
MODULES="$MODULES backends/platform/sdl" MODULES="$MODULES backends/platform/sdl"
;; ;;
wii) wii)