From 5f9264df166dd93ce930f66ef8eee4a3aa70a0f7 Mon Sep 17 00:00:00 2001 From: yellows8 Date: Thu, 28 Feb 2019 17:54:57 -0500 Subject: [PATCH] Added webConfigSetFooter and webConfigSetKeyRepeatFrame. --- nx/include/switch/applets/web.h | 17 +++++++++++++++++ nx/source/applets/web.c | 15 +++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/nx/include/switch/applets/web.h b/nx/include/switch/applets/web.h index 178fc10b..7a6745eb 100644 --- a/nx/include/switch/applets/web.h +++ b/nx/include/switch/applets/web.h @@ -236,6 +236,14 @@ Result webConfigSetBootDisplayKind(WebCommonConfig* config, u32 kind); */ Result webConfigSetBackgroundKind(WebCommonConfig* config, u32 kind); +/** + * @brief Sets the whether the UI footer is enabled. + * @note Only available with config created by \ref webPageCreate or with Offline-applet. + * @param config WebCommonConfig object. + * @param flag Flag + */ +Result webConfigSetFooter(WebCommonConfig* config, bool flag); + /** * @brief Sets the whether the Pointer is enabled. * @note Only available with config created by \ref webPageCreate, \ref webLobbyCreate, or with Offline-applet. @@ -254,6 +262,15 @@ Result webConfigSetPointer(WebCommonConfig* config, bool flag); */ Result webConfigSetLeftStickMode(WebCommonConfig* config, u32 mode); +/** + * @brief Sets the KeyRepeatFrame. + * @note Only available with Offline-applet. + * @param config WebCommonConfig object. + * @param inval0 First input param. + * @param inval1 Second input param. + */ +Result webConfigSetKeyRepeatFrame(WebCommonConfig* config, s32 inval0, s32 inval1); + /** * @brief Sets the DisplayUrlKind. * @param config WebCommonConfig object. diff --git a/nx/source/applets/web.c b/nx/source/applets/web.c index 43e0ef8f..bea8ea64 100644 --- a/nx/source/applets/web.c +++ b/nx/source/applets/web.c @@ -269,6 +269,12 @@ Result webConfigSetBackgroundKind(WebCommonConfig* config, u32 kind) { return _webConfigSetU32(config, WebArgType_BackgroundKind, kind); } +Result webConfigSetFooter(WebCommonConfig* config, bool flag) { + WebShimKind shim = _webGetShimKind(config); + if (shim != WebShimKind_Offline && shim != WebShimKind_Web) return MAKERESULT(Module_Libnx, LibnxError_NotInitialized); + return _webConfigSetFlag(config, WebArgType_Footer, flag); +} + Result webConfigSetPointer(WebCommonConfig* config, bool flag) { WebShimKind shim = _webGetShimKind(config); if (shim != WebShimKind_Offline && shim != WebShimKind_Web && shim != WebShimKind_Lobby) return MAKERESULT(Module_Libnx, LibnxError_NotInitialized); @@ -281,6 +287,15 @@ Result webConfigSetLeftStickMode(WebCommonConfig* config, u32 mode) { return _webConfigSetU32(config, WebArgType_LeftStickMode, mode); } +Result webConfigSetKeyRepeatFrame(WebCommonConfig* config, s32 inval0, s32 inval1) { + Result rc=0; + WebShimKind shim = _webGetShimKind(config); + if (shim != WebShimKind_Offline) return MAKERESULT(Module_Libnx, LibnxError_NotInitialized); + rc = _webConfigSetU32(config, WebArgType_KeyRepeatFrame0, inval0); + if (R_SUCCEEDED(rc)) rc = _webConfigSetU32(config, WebArgType_KeyRepeatFrame1, inval1); + return rc; +} + Result webConfigSetDisplayUrlKind(WebCommonConfig* config, bool kind) { return _webConfigSetFlag(config, WebArgType_DisplayUrlKind, kind); }