Added SwkbdInlineMode enum.

This commit is contained in:
yellows8 2019-01-14 14:57:28 -05:00
parent 9d5127d37d
commit 1a91c10c19
2 changed files with 8 additions and 2 deletions

View File

@ -47,6 +47,12 @@ typedef enum {
SwkbdRequestCommand_Calc = 0xA,
} SwkbdRequestCommand;
/// Value for \ref SwkbdInitializeArg mode. Controls the LibAppletMode when launching the applet.
typedef enum {
SwkbdInlineMode_UserDisplay = 0, ///< LibAppletMode_Unknown3. This is the default. The user-process must handle displaying the swkbd gfx on the screen. Attempting to get the swkbd gfx data for this currently throws an error (unknown why), SwkbdInlineMode_AppletDisplay should be used instead.
SwkbdInlineMode_AppletDisplay = 1, ///< LibAppletMode_Background. The applet will handle displaying gfx on the screen.
} SwkbdInlineMode;
/// TextCheck callback set by \ref swkbdConfigSetTextCheckCallback, for validating the input string when the swkbd ok-button is pressed. This buffer contains an UTF-8 string. This callback should validate the input string, then return a \ref SwkbdTextCheckResult indicating success/failure. On failure, this function must write an error message to the tmp_string buffer, which will then be displayed by swkbd.
typedef SwkbdTextCheckResult (*SwkbdTextCheckCb)(char* tmp_string, size_t tmp_string_size);
@ -103,7 +109,7 @@ typedef struct {
typedef struct {
u32 unk_x0;
u8 mode; ///< Controls the LibAppletMode when launching the applet. Non-zero indicates LibAppletMode_Background, otherwise LibAppletMode_Unknown3
u8 mode; ///< See \ref SwkbdInlineMode.
u8 unk_x5; ///< Only set on 5.0.0+.
u8 pad[2];
} SwkbdInitializeArg;

View File

@ -391,7 +391,7 @@ Result swkbdInlineClose(SwkbdInline* s) {
Result swkbdInlineLaunch(SwkbdInline* s) {
Result rc=0;
rc = appletCreateLibraryApplet(&s->holder, AppletId_swkbd, s->calcArg.initArg.mode!=0 ? LibAppletMode_Background : LibAppletMode_Unknown3);
rc = appletCreateLibraryApplet(&s->holder, AppletId_swkbd, s->calcArg.initArg.mode!=SwkbdInlineMode_UserDisplay ? LibAppletMode_Background : LibAppletMode_Unknown3);
if (R_FAILED(rc)) return rc;
LibAppletArgs commonargs;