Blackberry: Support receiving invocations from system. Set as a default application for ISO, CSO, PBP and PRX. Check in NativeInit if the system has requested for us to start a specific file.

This commit is contained in:
Sacha 2013-11-02 04:31:06 +10:00
parent ba0b9707ad
commit 3403928a75
3 changed files with 37 additions and 1 deletions

View File

@ -31,6 +31,18 @@
</icon>
<splashscreen>icon-114.png</splashscreen>
<invoke-target id="com.Qtness.PPSSPP.openrom">
<invoke-target-name>Open PSP ROM</invoke-target-name>
<invoke-target-type>application</invoke-target-type>
<icon><image>icon-114.png</image></icon>
<filter>
<action>bb.action.OPEN</action>
<mime-type>*</mime-type>
<property var="uris" value="file://"/>
<property var="exts" value="iso,cso,pbp,prx"/>
</filter>
</invoke-target>
<env var="LD_LIBRARY_PATH" value="app/native/lib:/usr/lib/qt4/lib/:/accounts/1000/shared/misc/"/>
<permission system="true">run_native</permission>

View File

@ -85,6 +85,11 @@ static UI::Theme ui_theme;
#include "ios/iOSCoreAudio.h"
#endif
#ifdef BLACKBERRY
#include <bps/navigator.h>
#include <bps/navigator_invoke.h>
#endif
Texture *uiTexture;
ScreenManager *screenManager;
@ -415,6 +420,25 @@ void NativeInit(int argc, const char *argv[],
screenManager = new ScreenManager();
#ifdef BLACKBERRY
// Check if the system has sent us any messages at runtime
while (true) {
bps_event_t *event = NULL;
bps_get_event(&event, 0);
if (event == NULL)
break;
// Were we opened to run a specific ROM?
if (bps_event_get_domain(event) == navigator_get_domain() &&
bps_event_get_code(event) == NAVIGATOR_INVOKE_TARGET) {
const navigator_invoke_invocation_t *invoke = navigator_invoke_event_get_invocation(event);
if(invoke) {
boot_filename = navigator_invoke_invocation_get_uri(invoke)+7; // Remove file://
skipLogo = true;
}
}
}
#endif
if (skipLogo) {
screenManager->switchScreen(new EmuScreen(boot_filename));
} else {

2
native

@ -1 +1 @@
Subproject commit 4c8922d9e70cbebc54c2d5a36d52e79339feeff0
Subproject commit f5121df3be55ea9049164607e64a7c7d7bd2a7dd