mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-22 13:02:38 +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_Total, ///< Total languages supported by this enum.
|
||||||
} SetLanguage;
|
} 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.
|
/// Command IDs for setsysGetFlag/setsysSetFlag.
|
||||||
typedef enum {
|
typedef enum {
|
||||||
SetSysFlag_LockScreen = 7,
|
SetSysFlag_LockScreen = 7,
|
||||||
@ -81,7 +89,7 @@ Result setGetAvailableLanguageCodes(s32 *total_entries, u64 *LanguageCodes, size
|
|||||||
Result setGetAvailableLanguageCodeCount(s32 *total);
|
Result setGetAvailableLanguageCodeCount(s32 *total);
|
||||||
|
|
||||||
/// Gets the RegionCode.
|
/// Gets the RegionCode.
|
||||||
Result setGetRegionCode(s32 *RegionCode);
|
Result setGetRegionCode(SetRegion *out);
|
||||||
|
|
||||||
Result setsysInitialize(void);
|
Result setsysInitialize(void);
|
||||||
void setsysExit(void);
|
void setsysExit(void);
|
||||||
@ -89,6 +97,9 @@ void setsysExit(void);
|
|||||||
/// Gets the current system theme.
|
/// 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.
|
* @brief Gets the size of a settings item value.
|
||||||
* @param out Pointer to output the size to.
|
* @param out Pointer to output the size to.
|
||||||
|
@ -279,7 +279,7 @@ Result setGetAvailableLanguageCodeCount(s32 *total) {
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
Result setGetRegionCode(s32 *RegionCode) {
|
Result setGetRegionCode(SetRegion *out) {
|
||||||
IpcCommand c;
|
IpcCommand c;
|
||||||
ipcInitialize(&c);
|
ipcInitialize(&c);
|
||||||
|
|
||||||
@ -307,7 +307,7 @@ Result setGetRegionCode(s32 *RegionCode) {
|
|||||||
|
|
||||||
rc = resp->result;
|
rc = resp->result;
|
||||||
|
|
||||||
if (R_SUCCEEDED(rc) && RegionCode) *RegionCode = resp->RegionCode;
|
if (R_SUCCEEDED(rc) && out) *out = resp->RegionCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
@ -345,7 +345,40 @@ Result setsysGetColorSetId(ColorSetId* out)
|
|||||||
}
|
}
|
||||||
|
|
||||||
return rc;
|
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) {
|
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