mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-20 20:22:38 +02:00
Added appletSetScreenShotPermission and appletSetScreenShotImageOrientation. Added LibnxError_IncompatSysVer.
This commit is contained in:
parent
4137f9aefe
commit
dc785c1fee
@ -60,6 +60,7 @@ enum {
|
||||
LibnxError_BadGetInfo_Rng,
|
||||
LibnxError_JitUnavailable,
|
||||
LibnxError_WeirdKernel,
|
||||
LibnxError_IncompatSysVer,
|
||||
};
|
||||
|
||||
enum {
|
||||
|
@ -45,6 +45,14 @@ Result appletGetAppletResourceUserId(u64 *out);
|
||||
void appletNotifyRunning(u8 *out);
|
||||
Result appletCreateManagedDisplayLayer(u64 *out);
|
||||
|
||||
/**
|
||||
* @brief Controls whether screenshot-capture is allowed.
|
||||
* @param val 0 = disable, 1 = enable.
|
||||
*/
|
||||
Result appletSetScreenShotPermission(s32 val);
|
||||
|
||||
Result appletSetScreenShotImageOrientation(s32 val);
|
||||
|
||||
/**
|
||||
* @brief Processes the current applet status. Generally used within a main loop.
|
||||
* @return Whether the application should continue running.
|
||||
|
@ -658,6 +658,39 @@ static Result _appletGetCurrentFocusState(u8 *out) {
|
||||
return rc;
|
||||
}
|
||||
|
||||
Result appletSetScreenShotPermission(s32 val) {
|
||||
IpcCommand c;
|
||||
ipcInitialize(&c);
|
||||
|
||||
struct {
|
||||
u64 magic;
|
||||
u64 cmd_id;
|
||||
s32 val;
|
||||
} *raw;
|
||||
|
||||
raw = ipcPrepareHeader(&c, sizeof(*raw));
|
||||
|
||||
raw->magic = SFCI_MAGIC;
|
||||
raw->cmd_id = 10;
|
||||
raw->val = val;
|
||||
|
||||
Result rc = serviceIpcDispatch(&g_appletISelfController);
|
||||
|
||||
if (R_SUCCEEDED(rc)) {
|
||||
IpcParsedCommand r;
|
||||
ipcParse(&r);
|
||||
|
||||
struct {
|
||||
u64 magic;
|
||||
u64 result;
|
||||
} *resp = r.Raw;
|
||||
|
||||
rc = resp->result;
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
static Result _appletSetOperationModeChangedNotification(u8 flag) {
|
||||
IpcCommand c;
|
||||
ipcInitialize(&c);
|
||||
@ -794,6 +827,42 @@ static Result _appletSetOutOfFocusSuspendingEnabled(u8 inval) {
|
||||
return rc;
|
||||
}
|
||||
|
||||
Result appletSetScreenShotImageOrientation(s32 val) {
|
||||
if (!kernelAbove300())
|
||||
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
||||
|
||||
IpcCommand c;
|
||||
ipcInitialize(&c);
|
||||
|
||||
struct {
|
||||
u64 magic;
|
||||
u64 cmd_id;
|
||||
s32 val;
|
||||
} *raw;
|
||||
|
||||
raw = ipcPrepareHeader(&c, sizeof(*raw));
|
||||
|
||||
raw->magic = SFCI_MAGIC;
|
||||
raw->cmd_id = 19;
|
||||
raw->val = val;
|
||||
|
||||
Result rc = serviceIpcDispatch(&g_appletISelfController);
|
||||
|
||||
if (R_SUCCEEDED(rc)) {
|
||||
IpcParsedCommand r;
|
||||
ipcParse(&r);
|
||||
|
||||
struct {
|
||||
u64 magic;
|
||||
u64 result;
|
||||
} *resp = r.Raw;
|
||||
|
||||
rc = resp->result;
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
Result appletCreateManagedDisplayLayer(u64 *out) {
|
||||
IpcCommand c;
|
||||
ipcInitialize(&c);
|
||||
|
Loading…
Reference in New Issue
Block a user