MORPHOS : add kFeatureOpenUrl
Enable OpenURL
This commit is contained in:
parent
81fe49242a
commit
0e4e606e36
2 changed files with 8 additions and 3 deletions
|
@ -26,7 +26,6 @@
|
||||||
|
|
||||||
#include "backends/platform/sdl/morphos/morphos.h"
|
#include "backends/platform/sdl/morphos/morphos.h"
|
||||||
#include "backends/fs/morphos/morphos-fs-factory.h"
|
#include "backends/fs/morphos/morphos-fs-factory.h"
|
||||||
#include <proto/exec.h>
|
|
||||||
#include <proto/openurl.h>
|
#include <proto/openurl.h>
|
||||||
|
|
||||||
void OSystem_MorphOS::init() {
|
void OSystem_MorphOS::init() {
|
||||||
|
@ -37,14 +36,19 @@ void OSystem_MorphOS::init() {
|
||||||
OSystem_SDL::init();
|
OSystem_SDL::init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool OSystem_MorphOS::hasFeature(Feature f) {
|
||||||
|
if (f == kFeatureOpenUrl)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return OSystem_SDL::hasFeature(f);
|
||||||
|
}
|
||||||
|
|
||||||
bool OSystem_MorphOS::openUrl(const Common::String &url) {
|
bool OSystem_MorphOS::openUrl(const Common::String &url) {
|
||||||
|
|
||||||
struct Library *OpenURLBase = OpenLibrary("openurl.library",0);
|
|
||||||
static struct TagItem URLTags[] = {{TAG_DONE, (ULONG) NULL}};
|
static struct TagItem URLTags[] = {{TAG_DONE, (ULONG) NULL}};
|
||||||
|
|
||||||
if (OpenURLBase){
|
if (OpenURLBase){
|
||||||
URL_OpenA((STRPTR)url.c_str(), (struct TagItem*) URLTags);
|
URL_OpenA((STRPTR)url.c_str(), (struct TagItem*) URLTags);
|
||||||
CloseLibrary(OpenURLBase);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
class OSystem_MorphOS : public OSystem_SDL {
|
class OSystem_MorphOS : public OSystem_SDL {
|
||||||
public:
|
public:
|
||||||
virtual void init() override;
|
virtual void init() override;
|
||||||
|
virtual bool hasFeature(Feature f);
|
||||||
virtual bool openUrl(const Common::String &url) override;
|
virtual bool openUrl(const Common::String &url) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue