mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 20:42:44 +02:00
Updated LibAppletMode enum and added appletHolderSetOutOfFocusApplicationSuspendingEnabled.
This commit is contained in:
parent
b3dd512253
commit
2257e3ccf4
@ -109,10 +109,11 @@ typedef enum {
|
|||||||
|
|
||||||
/// LibraryAppletMode
|
/// LibraryAppletMode
|
||||||
typedef enum {
|
typedef enum {
|
||||||
LibAppletMode_AllForeground = 0, ///< Foreground
|
LibAppletMode_AllForeground = 0, ///< Foreground.
|
||||||
LibAppletMode_Background = 1, ///< Background
|
LibAppletMode_Background = 1, ///< Background.
|
||||||
LibAppletMode_Unknown2 = 2, ///< Unknown
|
LibAppletMode_NoUi = 2, ///< No UI.
|
||||||
LibAppletMode_Unknown3 = 3, ///< Unknown
|
LibAppletMode_BackgroundIndirect = 3, ///< Background with indirect display, see \ref appletHolderGetIndirectLayerConsumerHandle.
|
||||||
|
LibAppletMode_AllForegroundInitiallyHidden = 4, ///< Foreground except initially hidden.
|
||||||
} LibAppletMode;
|
} LibAppletMode;
|
||||||
|
|
||||||
/// LibraryAppletExitReason
|
/// LibraryAppletExitReason
|
||||||
@ -669,7 +670,7 @@ bool appletHolderActive(AppletHolder *h);
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Gets the IndirectLayerConsumerHandle loaded during \ref appletCreateLibraryApplet, on 2.0.0+.
|
* @brief Gets the IndirectLayerConsumerHandle loaded during \ref appletCreateLibraryApplet, on 2.0.0+.
|
||||||
* @note Only available when \ref LibAppletMode is ::LibAppletMode_Unknown3.
|
* @note Only available when \ref LibAppletMode is ::LibAppletMode_BackgroundIndirect.
|
||||||
* @param h AppletHolder object.
|
* @param h AppletHolder object.
|
||||||
* @param out Output IndirectLayerConsumerHandle.
|
* @param out Output IndirectLayerConsumerHandle.
|
||||||
*/
|
*/
|
||||||
@ -705,6 +706,14 @@ bool appletHolderCheckFinished(AppletHolder *h);
|
|||||||
*/
|
*/
|
||||||
LibAppletExitReason appletHolderGetExitReason(AppletHolder *h);
|
LibAppletExitReason appletHolderGetExitReason(AppletHolder *h);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Sets OutOfFocusApplicationSuspendingEnabled.
|
||||||
|
* @note Only available with AppletType_*Application.
|
||||||
|
* @param h AppletHolder object.
|
||||||
|
* @param[in] flag Flag
|
||||||
|
*/
|
||||||
|
Result appletHolderSetOutOfFocusApplicationSuspendingEnabled(AppletHolder *h, bool flag);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Waits for the PopInteractiveOutDataEvent and StateChangedEvent.
|
* @brief Waits for the PopInteractiveOutDataEvent and StateChangedEvent.
|
||||||
* @return false for error / when StateChangedEvent was signaled, and true when PopInteractiveOutDataEvent was signaled.
|
* @return false for error / when StateChangedEvent was signaled, and true when PopInteractiveOutDataEvent was signaled.
|
||||||
|
@ -493,7 +493,7 @@ static Result _swkbdInlineLaunch(SwkbdInline* s, SwkbdInitializeArg *initArg) {
|
|||||||
memcpy(&s->calcArg.initArg, initArg, sizeof(*initArg));
|
memcpy(&s->calcArg.initArg, initArg, sizeof(*initArg));
|
||||||
s->calcArg.flags |= 0x1;
|
s->calcArg.flags |= 0x1;
|
||||||
|
|
||||||
rc = appletCreateLibraryApplet(&s->holder, AppletId_swkbd, s->calcArg.initArg.mode!=SwkbdInlineMode_UserDisplay ? LibAppletMode_Background : LibAppletMode_Unknown3);
|
rc = appletCreateLibraryApplet(&s->holder, AppletId_swkbd, s->calcArg.initArg.mode!=SwkbdInlineMode_UserDisplay ? LibAppletMode_Background : LibAppletMode_BackgroundIndirect);
|
||||||
if (R_FAILED(rc)) return rc;
|
if (R_FAILED(rc)) return rc;
|
||||||
|
|
||||||
LibAppletArgs commonargs;
|
LibAppletArgs commonargs;
|
||||||
|
@ -2147,7 +2147,7 @@ static Result _appletHolderCreate(AppletHolder *h, AppletId id, LibAppletMode mo
|
|||||||
|
|
||||||
if (R_SUCCEEDED(rc)) rc = _appletGetEvent(&h->s, &h->StateChangedEvent, 0, false);//GetAppletStateChangedEvent
|
if (R_SUCCEEDED(rc)) rc = _appletGetEvent(&h->s, &h->StateChangedEvent, 0, false);//GetAppletStateChangedEvent
|
||||||
|
|
||||||
if (R_SUCCEEDED(rc) && hosversionAtLeast(2,0,0) && h->mode == LibAppletMode_Unknown3) rc = _appletGetIndirectLayerConsumerHandle(&h->s, &h->layer_handle);
|
if (R_SUCCEEDED(rc) && hosversionAtLeast(2,0,0) && h->mode == LibAppletMode_BackgroundIndirect) rc = _appletGetIndirectLayerConsumerHandle(&h->s, &h->layer_handle);
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@ -2175,7 +2175,7 @@ bool appletHolderActive(AppletHolder *h) {
|
|||||||
Result appletHolderGetIndirectLayerConsumerHandle(AppletHolder *h, u64 *out) {
|
Result appletHolderGetIndirectLayerConsumerHandle(AppletHolder *h, u64 *out) {
|
||||||
if (!serviceIsActive(&h->s))
|
if (!serviceIsActive(&h->s))
|
||||||
return MAKERESULT(Module_Libnx, LibnxError_NotInitialized);
|
return MAKERESULT(Module_Libnx, LibnxError_NotInitialized);
|
||||||
if (h->mode!=LibAppletMode_Unknown3)
|
if (h->mode!=LibAppletMode_BackgroundIndirect)
|
||||||
return MAKERESULT(Module_Libnx, LibnxError_BadInput);
|
return MAKERESULT(Module_Libnx, LibnxError_BadInput);
|
||||||
if (hosversionBefore(2,0,0))
|
if (hosversionBefore(2,0,0))
|
||||||
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
||||||
@ -2239,6 +2239,13 @@ u32 appletHolderGetExitReason(AppletHolder *h) {
|
|||||||
return h->exitreason;
|
return h->exitreason;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Result appletHolderSetOutOfFocusApplicationSuspendingEnabled(AppletHolder *h, bool flag) {
|
||||||
|
if (!serviceIsActive(&g_appletSrv) || !_appletIsApplication())
|
||||||
|
return MAKERESULT(Module_Libnx, LibnxError_NotInitialized);
|
||||||
|
|
||||||
|
return _appletCmdInBool(&h->s, flag, 50);
|
||||||
|
}
|
||||||
|
|
||||||
static Result _appletHolderGetPopInteractiveOutDataEvent(AppletHolder *h) {
|
static Result _appletHolderGetPopInteractiveOutDataEvent(AppletHolder *h) {
|
||||||
Result rc=0;
|
Result rc=0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user