From a4e757834e1ea227c207072868ca732f9872ed59 Mon Sep 17 00:00:00 2001 From: Klaus Reimer Date: Mon, 4 Apr 2011 00:28:14 +0200 Subject: WEBOS: Create webos backend with custom events Currently only contains test code. --- backends/platform/sdl/posix/posix-main.cpp | 2 +- backends/platform/webos/main.cpp | 54 ++++++++++++++++++++++++++++++ backends/platform/webos/module.mk | 10 ++++++ backends/platform/webos/webos.cpp | 45 +++++++++++++++++++++++++ backends/platform/webos/webos.h | 38 +++++++++++++++++++++ 5 files changed, 148 insertions(+), 1 deletion(-) create mode 100644 backends/platform/webos/main.cpp create mode 100644 backends/platform/webos/module.mk create mode 100644 backends/platform/webos/webos.cpp create mode 100644 backends/platform/webos/webos.h (limited to 'backends/platform') diff --git a/backends/platform/sdl/posix/posix-main.cpp b/backends/platform/sdl/posix/posix-main.cpp index 72777e1ab7..9e778ab899 100644 --- a/backends/platform/sdl/posix/posix-main.cpp +++ b/backends/platform/sdl/posix/posix-main.cpp @@ -25,7 +25,7 @@ #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/plugins/sdl/sdl-provider.h" diff --git a/backends/platform/webos/main.cpp b/backends/platform/webos/main.cpp new file mode 100644 index 0000000000..fa10613630 --- /dev/null +++ b/backends/platform/webos/main.cpp @@ -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 + +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 diff --git a/backends/platform/webos/module.mk b/backends/platform/webos/module.mk new file mode 100644 index 0000000000..fe4ec1e079 --- /dev/null +++ b/backends/platform/webos/module.mk @@ -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))) diff --git a/backends/platform/webos/webos.cpp b/backends/platform/webos/webos.cpp new file mode 100644 index 0000000000..597da005ed --- /dev/null +++ b/backends/platform/webos/webos.cpp @@ -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 diff --git a/backends/platform/webos/webos.h b/backends/platform/webos/webos.h new file mode 100644 index 0000000000..be35547131 --- /dev/null +++ b/backends/platform/webos/webos.h @@ -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 -- cgit v1.2.3