WEBOS: Create webos backend with custom events
Currently only contains test code.
This commit is contained in:
parent
b17f7d20c2
commit
a4e757834e
9 changed files with 245 additions and 2 deletions
55
backends/events/webossdl/webossdl-events.cpp
Normal file
55
backends/events/webossdl/webossdl-events.cpp
Normal 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
|
39
backends/events/webossdl/webossdl-events.h
Normal file
39
backends/events/webossdl/webossdl-events.h
Normal 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
|
|
@ -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 \
|
||||||
|
|
|
@ -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"
|
||||||
|
|
54
backends/platform/webos/main.cpp
Normal file
54
backends/platform/webos/main.cpp
Normal 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
|
10
backends/platform/webos/module.mk
Normal file
10
backends/platform/webos/module.mk
Normal 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)))
|
45
backends/platform/webos/webos.cpp
Normal file
45
backends/platform/webos/webos.cpp
Normal 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
|
38
backends/platform/webos/webos.h
Normal file
38
backends/platform/webos/webos.h
Normal 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
3
configure
vendored
|
@ -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)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue