aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/webos
diff options
context:
space:
mode:
authorMatthew Hoops2011-04-13 16:04:29 -0400
committerMatthew Hoops2011-04-13 16:04:29 -0400
commit6d153f311c65fe414e31e99f8a9a6503c49a01a5 (patch)
tree9173f9964c0fec4215514e622f705810730d0ce9 /backends/platform/webos
parent47c2a9adbe8d9e6640a819386f0f34e929937672 (diff)
parent66b43f2312578f35e0718d0699de207a7bf77f1a (diff)
downloadscummvm-rg350-6d153f311c65fe414e31e99f8a9a6503c49a01a5.tar.gz
scummvm-rg350-6d153f311c65fe414e31e99f8a9a6503c49a01a5.tar.bz2
scummvm-rg350-6d153f311c65fe414e31e99f8a9a6503c49a01a5.zip
Merge remote branch 'upstream/master' into t7g-ios
Conflicts: video/qt_decoder.cpp
Diffstat (limited to 'backends/platform/webos')
-rw-r--r--backends/platform/webos/main.cpp53
-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.mk23
5 files changed, 199 insertions, 0 deletions
diff --git a/backends/platform/webos/main.cpp b/backends/platform/webos/main.cpp
new file mode 100644
index 0000000000..bbf55c6efd
--- /dev/null
+++ b/backends/platform/webos/main.cpp
@@ -0,0 +1,53 @@
+/* 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
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..885c9eb90e
--- /dev/null
+++ b/backends/platform/webos/webos.mk
@@ -0,0 +1,23 @@
+# WebOS specific build targets
+
+PATH_DIST = $(srcdir)/dists/webos
+PATH_MOJO = $(PATH_DIST)/mojo
+
+STAGING_DIR=STAGING/org.scummvm.scummvm
+
+webosrelease:
+ rm -rf $(STAGING_DIR)
+ rm -f *.ipk
+ mkdir -p $(STAGING_DIR)
+ mkdir -p $(STAGING_DIR)/bin
+ mkdir -p $(STAGING_DIR)/lib
+ mkdir -p $(STAGING_DIR)/share/scummvm
+ cp -f $(PATH_MOJO)/* $(STAGING_DIR)
+ cp -f gui/themes/translations.dat $(STAGING_DIR)/share/scummvm
+ cp -f gui/themes/scummmodern.zip $(STAGING_DIR)/share/scummvm
+ cp -f scummvm $(STAGING_DIR)/bin
+ $(STRIP) $(STAGING_DIR)/bin/scummvm
+ $(WEBOS_SDK)/bin/palm-package $(STAGING_DIR)
+ rm -rf STAGING
+
+.PHONY: webosrelease