diff options
author | Peter BozsoĢ | 2016-07-18 11:42:02 +0200 |
---|---|---|
committer | Alexander Tkachev | 2016-08-24 16:07:55 +0600 |
commit | 18fc113aa91d0563940b3de807576f7879e9ebea (patch) | |
tree | c2a70ab17e018a98616e3917f8f8ac3a55e823a3 /backends/networking/browser | |
parent | 04888cf454fb3243e82d424d46af1e2ca74d0b8c (diff) | |
download | scummvm-rg350-18fc113aa91d0563940b3de807576f7879e9ebea.tar.gz scummvm-rg350-18fc113aa91d0563940b3de807576f7879e9ebea.tar.bz2 scummvm-rg350-18fc113aa91d0563940b3de807576f7879e9ebea.zip |
CLOUD: Add URL opening for OS X
Diffstat (limited to 'backends/networking/browser')
-rw-r--r-- | backends/networking/browser/openurl-osx.cpp | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/backends/networking/browser/openurl-osx.cpp b/backends/networking/browser/openurl-osx.cpp new file mode 100644 index 0000000000..66d96b4e3d --- /dev/null +++ b/backends/networking/browser/openurl-osx.cpp @@ -0,0 +1,49 @@ +/* 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. + * + */ + +#define FORBIDDEN_SYMBOL_ALLOW_ALL + +#include "backends/networking/browser/openurl.h" +#include <CoreFoundation/CFBundle.h> +#include <ApplicationServices/ApplicationServices.h> + +namespace Networking { +namespace Browser { + +using namespace std; + +bool openUrl(const Common::String &url) { + CFURLRef urlRef = CFURLCreateWithBytes ( + NULL, + (UInt8*)url.c_str(), + url.size(), + kCFStringEncodingASCII, + NULL + ); + int result = LSOpenCFURLRef(urlRef, 0); + CFRelease(urlRef); + return result == 0; +} + +} // End of namespace Browser +} // End of namespace Networking + |