aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/webos
diff options
context:
space:
mode:
Diffstat (limited to 'backends/platform/webos')
-rw-r--r--backends/platform/webos/main.cpp55
-rw-r--r--backends/platform/webos/module.mk10
-rw-r--r--backends/platform/webos/webos.cpp73
-rw-r--r--backends/platform/webos/webos.h40
-rw-r--r--backends/platform/webos/webos.mk91
5 files changed, 269 insertions, 0 deletions
diff --git a/backends/platform/webos/main.cpp b/backends/platform/webos/main.cpp
new file mode 100644
index 0000000000..eefdd30496
--- /dev/null
+++ b/backends/platform/webos/main.cpp
@@ -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$
+ *
+ */
+
+#define FORBIDDEN_SYMBOL_EXCEPTION_unistd_h
+
+#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
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..7db17f4b9f
--- /dev/null
+++ b/backends/platform/webos/webos.cpp
@@ -0,0 +1,73 @@
+/* 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"
+#include "backends/keymapper/keymapper.h"
+
+#if defined(WEBOS)
+
+using namespace Common;
+
+OSystem_SDL_WebOS::OSystem_SDL_WebOS()
+ :
+ OSystem_POSIX() {
+}
+
+/**
+ * Initializes the backend.
+ */
+void OSystem_SDL_WebOS::initBackend() {
+ // Create the events manager
+ if (_eventSource == 0)
+ _eventSource = new WebOSSdlEventSource();
+
+ // Call parent implementation of this method
+ OSystem_SDL::initBackend();
+}
+
+/**
+ * Gets the original SDL hardware key set, adds WebOS specific keys and
+ * returns the new key set.
+ *
+ * @return The hardware key set with added webOS specific keys.
+ */
+HardwareKeySet *OSystem_SDL_WebOS::getHardwareKeySet() {
+#ifdef ENABLE_KEYMAPPER
+ // Get the original SDL hardware key set
+ HardwareKeySet *keySet = OSystem_SDL::getHardwareKeySet();
+
+ // Add WebOS specific keys
+ keySet->addHardwareKey(new HardwareKey("FORWARD",
+ KeyState((KeyCode) 229, 229, 0), "Forward", kActionKeyType));
+
+ // Return the modified hardware key set
+ return keySet;
+#else
+ return 0;
+#endif
+}
+
+#endif
diff --git a/backends/platform/webos/webos.h b/backends/platform/webos/webos.h
new file mode 100644
index 0000000000..1cdba703e0
--- /dev/null
+++ b/backends/platform/webos/webos.h
@@ -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$
+ *
+ */
+
+#ifndef PLATFORM_SDL_WEBOS_H
+#define PLATFORM_SDL_WEBOS_H
+
+#include "common/system.h"
+#include "backends/platform/sdl/posix/posix.h"
+
+class OSystem_SDL_WebOS : public OSystem_POSIX {
+public:
+ OSystem_SDL_WebOS();
+
+ virtual void initBackend();
+ virtual Common::HardwareKeySet *getHardwareKeySet();
+};
+
+#endif
diff --git a/backends/platform/webos/webos.mk b/backends/platform/webos/webos.mk
new file mode 100644
index 0000000000..2b145b00c9
--- /dev/null
+++ b/backends/platform/webos/webos.mk
@@ -0,0 +1,91 @@
+# WebOS specific build targets
+# ============================================================================
+#
+# Build instructions:
+#
+# 1. Install the WebOS SDK and PDK and setup the environment variables
+# WEBOS_SDK and WEBOS_PDK accordingly.
+#
+# 2. Cross-compile zlib, flac, mad and tremor and install it into the PDK.
+#
+# 3. Prepare the ScummVM source for a webOS build:
+# $ ./configure --host=webos --enable-plugins --default-dynamic \
+# --enable-release
+#
+# 4. Create the package:
+# $ make package
+#
+# The package is now in the "portdist" folder.
+#
+# See http://wiki.scummvm.org/index.php/Compiling_ScummVM/WebOS for
+# more detailed build instructions.
+#
+#
+# Palm App catalog instructions:
+#
+# VER_PACKAGE must be set to a number which is higher than the currently
+# used package version in the app catalog. So when creating an updated
+# package for ScummVM 1.3.9 and the current ScummVM package in the app
+# catalog is version 1.3.0902 then you must specify VER_PACKAGE=3 to create
+# the ScummVM package with version 1.3.0903. Yeah, I know that's ugly but
+# WebOS package version numbers are restricted to three numeric components.
+#
+# As long as Palm doesn't support Team-maintained apps the uploaded packages
+# MUST NOT be packaged with the default "org.scummvm" base id. Instead apps
+# must be uploaded with a user-specific base id. A good practice is using
+# the github user as base id: com.github.<username>. It is also necessary
+# to use a user-specific app name when submitting the created package to the
+# Palm app catalog. Use "ScummVM (<username>)" instead of "ScummVM" and
+# "ScummVM Beta (<username>)" instead of "ScummVM Beta".
+#
+# The app id is automatically parsed from the installation prefix. So add a
+# configure parameter like this to prepare a build of a package for the Palm
+# App Catalog:
+#
+# --prefix=/media/cryptofs/apps/usr/palm/applications/com.github.kayahr.scummvm
+#
+# To build a package for the Palm Beta App Catalog add "-beta" to the prefix:
+#
+# --prefix=/media/cryptofs/apps/usr/palm/applications/com.github.kayahr.scummvm-beta
+# ============================================================================
+
+# Increment this number when the packaging of the app has been changed while
+# ScummVM itself has the same version as before. The number can be reset to
+# 1 when the ScummVM version is increased.
+VER_PACKAGE = 5
+
+PATH_DIST = $(srcdir)/dists/webos
+PATH_MOJO = $(PATH_DIST)/mojo
+APP_ID = $(shell basename $(prefix))
+APP_VERSION = $(shell printf "%d.%d.%02d%02d" $(VER_MAJOR) $(VER_MINOR) $(VER_PATCH) $(VER_PACKAGE))
+DESTDIR ?= portdist
+
+install: all
+ $(QUIET)$(INSTALL) -d "$(DESTDIR)$(prefix)"
+ $(QUIET)$(INSTALL) -m 0644 -t "$(DESTDIR)$(prefix)/" "$(PATH_MOJO)/"*
+ $(QUIET)$(INSTALL) -m 0755 "$(PATH_MOJO)/start" "$(DESTDIR)$(prefix)/"
+ $(QUIET)$(INSTALL) -d "$(DESTDIR)$(bindir)"
+ $(QUIET)$(INSTALL) -c -m 755 "./$(EXECUTABLE)" "$(DESTDIR)$(bindir)/$(EXECUTABLE)"
+ $(QUIET)$(STRIP) "$(DESTDIR)$(bindir)/$(EXECUTABLE)"
+ $(QUIET)$(INSTALL) -d "$(DESTDIR)$(docdir)"
+ $(QUIET)$(INSTALL) -c -m 644 $(DIST_FILES_DOCS) "$(DESTDIR)$(docdir)"
+ $(QUIET)$(INSTALL) -d "$(DESTDIR)$(datadir)"
+ $(QUIET)$(INSTALL) -c -m 644 $(DIST_FILES_THEMES) $(DIST_FILES_ENGINEDATA) "$(DESTDIR)$(datadir)/"
+ifdef DYNAMIC_MODULES
+ $(QUIET)$(INSTALL) -d "$(DESTDIR)$(libdir)/"
+ $(QUIET)$(INSTALL) -c -m 644 $(PLUGINS) "$(DESTDIR)$(libdir)/"
+ $(QUIET)$(STRIP) "$(DESTDIR)$(libdir)/"*
+endif
+ $(QUIET)sed -i s/'APP_VERSION'/'$(APP_VERSION)'/ "$(DESTDIR)$(prefix)/appinfo.json"
+ $(QUIET)sed -i s/'APP_ID'/'$(APP_ID)'/ "$(DESTDIR)$(prefix)/appinfo.json"
+ifneq (,$(findstring -beta,$(APP_ID)))
+ $(QUIET)sed -i s/'APP_TITLE'/'ScummVM Beta'/ "$(DESTDIR)$(prefix)/appinfo.json"
+else
+ $(QUIET)sed -i s/'APP_TITLE'/'ScummVM'/ "$(DESTDIR)$(prefix)/appinfo.json"
+endif
+
+uninstall:
+ $(QUIET)$(RM_REC) "$(DESTDIR)$(prefix)"
+
+package: install
+ $(QUIET)$(WEBOS_SDK)/bin/palm-package --use-v1-format "$(DESTDIR)$(prefix)" -o "$(DESTDIR)"