Added appletGetAppletResourceUserIdOfCallerApplet, appletSetAppletWindowVisibility, and appletSetAppletGpuTimeSlice. Minor other change.

This commit is contained in:
yellows8 2019-07-29 18:18:19 -04:00
parent 01d648e7ed
commit 7310c8f880
No known key found for this signature in database
GPG Key ID: 0AF90DA3F1E60E43
2 changed files with 50 additions and 4 deletions

View File

@ -588,6 +588,29 @@ Result appletGetProgramTotalActiveTime(u64 *activeTime);
*/
Result appletSetApplicationAlbumUserData(const void* buffer, size_t size);
// IWindowController
/**
* @brief Gets the AppletResourceUserId of the CallerApplet.
* @note Only available with [6.0.0+].
* @param[out] out AppletResourceUserId
*/
Result appletGetAppletResourceUserIdOfCallerApplet(u64 *out);
/**
* @brief Sets the current applet WindowVisibility.
* @note Only available with [7.0.0+].
* @param[in] flag Flag
*/
Result appletSetAppletWindowVisibility(bool flag);
/**
* @brief Sets the AppletGpuTimeSlice.
* @note Only available with [7.0.0+].
* @param[in] val Input value, must not be negative.
*/
Result appletSetAppletGpuTimeSlice(s64 val);
// ILibraryAppletCreator
/**

View File

@ -1895,10 +1895,6 @@ static Result _appletGetAppletResourceUserId(u64 *out) {
return _appletCmdNoInOut64(&g_appletIWindowController, out, 1);
}
static Result _appletAcquireForegroundRights(void) {
return _appletCmdNoIO(&g_appletIWindowController, 10);
}
Result appletGetAppletResourceUserId(u64 *out) {
if (!serviceIsActive(&g_appletSrv))
return MAKERESULT(Module_Libnx, LibnxError_NotInitialized);
@ -1907,6 +1903,33 @@ Result appletGetAppletResourceUserId(u64 *out) {
return 0;
}
Result appletGetAppletResourceUserIdOfCallerApplet(u64 *out) {
if (hosversionBefore(6,0,0))
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
if (!serviceIsActive(&g_appletSrv))
return MAKERESULT(Module_Libnx, LibnxError_NotInitialized);
return _appletCmdNoInOut64(&g_appletIWindowController, out, 2);
}
static Result _appletAcquireForegroundRights(void) {
return _appletCmdNoIO(&g_appletIWindowController, 10);
}
Result appletSetAppletWindowVisibility(bool flag) {
if (hosversionBefore(7,0,0))
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
return _appletCmdInBool(&g_appletIWindowController, flag, 20);
}
Result appletSetAppletGpuTimeSlice(s64 val) {
if (hosversionBefore(7,0,0))
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
return _appletCmdInU64(&g_appletIWindowController, val, 21);
}
// ILibraryAppletCreator
static Result _appletCreateLibraryApplet(Service* srv_out, AppletId id, LibAppletMode mode) {