mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 20:42:44 +02:00
Added webConfigSetAlbumEntry and webConfigSetApplicationAlbumEntry.
This commit is contained in:
parent
bbd0dcbd2b
commit
dc3cf7084e
@ -7,6 +7,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "../types.h"
|
#include "../types.h"
|
||||||
#include "../services/applet.h"
|
#include "../services/applet.h"
|
||||||
|
#include "../services/caps.h"
|
||||||
|
|
||||||
/// This indicates the type of web-applet.
|
/// This indicates the type of web-applet.
|
||||||
typedef enum {
|
typedef enum {
|
||||||
@ -226,6 +227,14 @@ Result webConfigSetWhitelist(WebCommonConfig* config, const char* whitelist);
|
|||||||
*/
|
*/
|
||||||
Result webConfigSetUserID(WebCommonConfig* config, u128 userID);
|
Result webConfigSetUserID(WebCommonConfig* config, u128 userID);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Sets the CapsAlbumEntry.
|
||||||
|
* @note Only available with config created by \ref webShareCreate.
|
||||||
|
* @param config WebCommonConfig object.
|
||||||
|
* @param entry \ref CapsAlbumEntry
|
||||||
|
*/
|
||||||
|
Result webConfigSetAlbumEntry(WebCommonConfig* config, CapsAlbumEntry *entry);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets the ScreenShot flag, which controls whether screen-shot capture is allowed.
|
* @brief Sets the ScreenShot flag, which controls whether screen-shot capture is allowed.
|
||||||
* @note Only available with config created by \ref webPageCreate.
|
* @note Only available with config created by \ref webPageCreate.
|
||||||
@ -340,6 +349,14 @@ Result webConfigSetMediaPlayerUserGestureRestriction(WebCommonConfig* config, bo
|
|||||||
*/
|
*/
|
||||||
Result webConfigSetLobbyParameter(WebCommonConfig* config, const char* str);
|
Result webConfigSetLobbyParameter(WebCommonConfig* config, const char* str);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Sets the CapsApplicationAlbumEntry.
|
||||||
|
* @note Only available with config created by \ref webShareCreate on [3.0.0+].
|
||||||
|
* @param config WebCommonConfig object.
|
||||||
|
* @param entry \ref CapsApplicationAlbumEntry
|
||||||
|
*/
|
||||||
|
Result webConfigSetApplicationAlbumEntry(WebCommonConfig* config, CapsApplicationAlbumEntry *entry);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets whether JsExtension is enabled.
|
* @brief Sets whether JsExtension is enabled.
|
||||||
* @note Only available with config created by \ref webPageCreate or with Offline-applet, on [3.0.0+].
|
* @note Only available with config created by \ref webPageCreate or with Offline-applet, on [3.0.0+].
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "result.h"
|
#include "result.h"
|
||||||
|
#include "services/caps.h"
|
||||||
#include "services/applet.h"
|
#include "services/applet.h"
|
||||||
#include "applets/libapplet.h"
|
#include "applets/libapplet.h"
|
||||||
#include "applets/web.h"
|
#include "applets/web.h"
|
||||||
@ -322,6 +323,11 @@ Result webConfigSetUserID(WebCommonConfig* config, u128 userID) {
|
|||||||
return _webTLVSet(config, WebArgType_UserID, &userID, sizeof(userID));
|
return _webTLVSet(config, WebArgType_UserID, &userID, sizeof(userID));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Result webConfigSetAlbumEntry(WebCommonConfig* config, CapsAlbumEntry *entry) {
|
||||||
|
if (_webGetShimKind(config) != WebShimKind_Share) return MAKERESULT(Module_Libnx, LibnxError_NotInitialized);
|
||||||
|
return _webTLVSet(config, WebArgType_AlbumEntry, entry, sizeof(*entry));
|
||||||
|
}
|
||||||
|
|
||||||
Result webConfigSetScreenShot(WebCommonConfig* config, bool flag) {
|
Result webConfigSetScreenShot(WebCommonConfig* config, bool flag) {
|
||||||
if (_webGetShimKind(config) != WebShimKind_Web) return MAKERESULT(Module_Libnx, LibnxError_NotInitialized);
|
if (_webGetShimKind(config) != WebShimKind_Web) return MAKERESULT(Module_Libnx, LibnxError_NotInitialized);
|
||||||
return _webConfigSetFlag(config, WebArgType_ScreenShot, flag);
|
return _webConfigSetFlag(config, WebArgType_ScreenShot, flag);
|
||||||
@ -411,6 +417,12 @@ Result webConfigSetLobbyParameter(WebCommonConfig* config, const char* str) {
|
|||||||
return _webConfigSetString(config, WebArgType_LobbyParameter, str, 0x100);
|
return _webConfigSetString(config, WebArgType_LobbyParameter, str, 0x100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Result webConfigSetApplicationAlbumEntry(WebCommonConfig* config, CapsApplicationAlbumEntry *entry) {
|
||||||
|
if (_webGetShimKind(config) != WebShimKind_Share) return MAKERESULT(Module_Libnx, LibnxError_NotInitialized);
|
||||||
|
if (hosversionBefore(3,0,0)) return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
||||||
|
return _webTLVSet(config, WebArgType_ApplicationAlbumEntry, entry, sizeof(*entry));
|
||||||
|
}
|
||||||
|
|
||||||
Result webConfigSetJsExtension(WebCommonConfig* config, bool flag) {
|
Result webConfigSetJsExtension(WebCommonConfig* config, bool flag) {
|
||||||
WebShimKind shim = _webGetShimKind(config);
|
WebShimKind shim = _webGetShimKind(config);
|
||||||
if (shim != WebShimKind_Offline && shim != WebShimKind_Web) return MAKERESULT(Module_Libnx, LibnxError_NotInitialized);
|
if (shim != WebShimKind_Offline && shim != WebShimKind_Web) return MAKERESULT(Module_Libnx, LibnxError_NotInitialized);
|
||||||
|
Loading…
Reference in New Issue
Block a user