mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 12:32:40 +02:00
Add setsysSetColorSetId and region codes
This commit is contained in:
parent
9860ad331c
commit
eb3c264e88
@ -35,6 +35,14 @@ typedef enum
|
||||
SetLanguage_Total, ///< Total languages supported by this enum.
|
||||
} SetLanguage;
|
||||
|
||||
/// Region codes.
|
||||
typedef enum {
|
||||
SetRegion_JPN = 0, ///< Japan
|
||||
SetRegion_USA = 1, ///< The Americas
|
||||
SetRegion_EUR = 2, ///< Europe
|
||||
SetRegion_AUS = 3, ///< Australia/New Zealand
|
||||
} SetRegion;
|
||||
|
||||
/// Command IDs for setsysGetFlag/setsysSetFlag.
|
||||
typedef enum {
|
||||
SetSysFlag_LockScreen = 7,
|
||||
@ -81,13 +89,16 @@ Result setGetAvailableLanguageCodes(s32 *total_entries, u64 *LanguageCodes, size
|
||||
Result setGetAvailableLanguageCodeCount(s32 *total);
|
||||
|
||||
/// Gets the RegionCode.
|
||||
Result setGetRegionCode(s32 *RegionCode);
|
||||
Result setGetRegionCode(SetRegion *out);
|
||||
|
||||
Result setsysInitialize(void);
|
||||
void setsysExit(void);
|
||||
|
||||
/// Gets the current system theme.
|
||||
Result setsysGetColorSetId(ColorSetId* out);
|
||||
Result setsysGetColorSetId(ColorSetId *out);
|
||||
|
||||
/// Sets the current system theme.
|
||||
Result setsysSetColorSetId(ColorSetId id);
|
||||
|
||||
/**
|
||||
* @brief Gets the size of a settings item value.
|
||||
|
@ -279,7 +279,7 @@ Result setGetAvailableLanguageCodeCount(s32 *total) {
|
||||
return rc;
|
||||
}
|
||||
|
||||
Result setGetRegionCode(s32 *RegionCode) {
|
||||
Result setGetRegionCode(SetRegion *out) {
|
||||
IpcCommand c;
|
||||
ipcInitialize(&c);
|
||||
|
||||
@ -307,13 +307,13 @@ Result setGetRegionCode(s32 *RegionCode) {
|
||||
|
||||
rc = resp->result;
|
||||
|
||||
if (R_SUCCEEDED(rc) && RegionCode) *RegionCode = resp->RegionCode;
|
||||
if (R_SUCCEEDED(rc) && out) *out = resp->RegionCode;
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
Result setsysGetColorSetId(ColorSetId* out)
|
||||
Result setsysGetColorSetId(ColorSetId *out)
|
||||
{
|
||||
IpcCommand c;
|
||||
ipcInitialize(&c);
|
||||
@ -345,7 +345,40 @@ Result setsysGetColorSetId(ColorSetId* out)
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
Result setsysSetColorSetId(ColorSetId id)
|
||||
{
|
||||
IpcCommand c;
|
||||
ipcInitialize(&c);
|
||||
|
||||
struct {
|
||||
u64 magic;
|
||||
u64 cmd_id;
|
||||
s32 id;
|
||||
} *raw;
|
||||
|
||||
raw = ipcPrepareHeader(&c, sizeof(*raw));
|
||||
|
||||
raw->magic = SFCI_MAGIC;
|
||||
raw->cmd_id = 24;
|
||||
raw->id = id;
|
||||
|
||||
Result rc = serviceIpcDispatch(&g_setsysSrv);
|
||||
|
||||
if (R_SUCCEEDED(rc)) {
|
||||
IpcParsedCommand r;
|
||||
ipcParse(&r);
|
||||
|
||||
struct {
|
||||
u64 magic;
|
||||
u64 result;
|
||||
} *resp = r.Raw;
|
||||
|
||||
rc = resp->result;
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
Result setsysGetSettingsItemValue(const char *name, const char *item_key, void *value_out, size_t value_out_size) {
|
||||
|
Loading…
Reference in New Issue
Block a user