aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorAlexander Tkachev2016-07-14 12:26:10 +0600
committerAlexander Tkachev2016-08-24 16:07:55 +0600
commit990dee3c4fafdf58a3c8b2ecc08b4c6d44887ad8 (patch)
treef0da76ad275840a5fcd40374fd949fa68997d7e0 /backends
parentdfd68306de6f655a7bd2c68cea0b9299956ce8fc (diff)
downloadscummvm-rg350-990dee3c4fafdf58a3c8b2ecc08b4c6d44887ad8.tar.gz
scummvm-rg350-990dee3c4fafdf58a3c8b2ecc08b4c6d44887ad8.tar.bz2
scummvm-rg350-990dee3c4fafdf58a3c8b2ecc08b4c6d44887ad8.zip
CLOUD: Add Networking::Browser::openUrl() sketch
Only Windows' shellExecute() now.
Diffstat (limited to 'backends')
-rw-r--r--backends/module.mk8
-rw-r--r--backends/networking/browser/openurl-default.cpp36
-rw-r--r--backends/networking/browser/openurl-windows.cpp43
-rw-r--r--backends/networking/browser/openurl.h36
4 files changed, 123 insertions, 0 deletions
diff --git a/backends/module.mk b/backends/module.mk
index 1881cc2f59..c792a94070 100644
--- a/backends/module.mk
+++ b/backends/module.mk
@@ -76,6 +76,14 @@ MODULE_OBJS += \
networking/sdl_net/uploadfileclienthandler.o
endif
+ifdef WIN32
+MODULE_OBJS += \
+ networking/browser/openurl-windows.o
+else
+MODULE_OBJS += \
+ networking/browser/openurl-default.o
+endif
+
ifdef USE_ELF_LOADER
MODULE_OBJS += \
plugins/elf/arm-loader.o \
diff --git a/backends/networking/browser/openurl-default.cpp b/backends/networking/browser/openurl-default.cpp
new file mode 100644
index 0000000000..c430953196
--- /dev/null
+++ b/backends/networking/browser/openurl-default.cpp
@@ -0,0 +1,36 @@
+/* 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.
+ *
+ */
+
+#include "backends/networking/browser/openurl.h"
+#include "common/textconsole.h"
+
+namespace Networking {
+namespace Browser {
+
+bool openUrl(const Common::String &url) {
+ warning("Networking::Browser::openUrl(): not implemented");
+ return false;
+}
+
+} // End of namespace Browser
+} // End of namespace Networking
+
diff --git a/backends/networking/browser/openurl-windows.cpp b/backends/networking/browser/openurl-windows.cpp
new file mode 100644
index 0000000000..53d76f076b
--- /dev/null
+++ b/backends/networking/browser/openurl-windows.cpp
@@ -0,0 +1,43 @@
+/* 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.
+ *
+ */
+
+#include "backends/networking/browser/openurl.h"
+#include "common/textconsole.h"
+#include <windows.h>
+#include <Shellapi.h>
+
+namespace Networking {
+namespace Browser {
+
+bool openUrl(const Common::String &url) {
+ const uint64 result = (uint64)ShellExecute(0, 0, /*(wchar_t*)nativeFilePath.utf16()*/url.c_str(), 0, 0, SW_SHOWNORMAL);
+ // ShellExecute returns a value greater than 32 if successful
+ if (result <= 32) {
+ warning("ShellExecute failed: error = %u", result);
+ return false;
+ }
+ return true;
+}
+
+} // End of namespace Browser
+} // End of namespace Networking
+
diff --git a/backends/networking/browser/openurl.h b/backends/networking/browser/openurl.h
new file mode 100644
index 0000000000..fe2f452f62
--- /dev/null
+++ b/backends/networking/browser/openurl.h
@@ -0,0 +1,36 @@
+/* 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.
+ *
+ */
+
+#ifndef NETWORKING_BROWSER_OPENURL_H
+#define NETWORKING_BROWSER_OPENURL_H
+
+#include "common/str.h"
+
+namespace Networking {
+namespace Browser {
+
+bool openUrl(const Common::String &url);
+
+} // End of namespace Browser
+} // End of namespace Networking
+
+#endif /*NETWORKING_BROWSER_OPENURL_H*/