Crafter.CppDOM/interfaces/Crafter.CppDOM-BindingsExport.cppm

237 lines
16 KiB
Text
Raw Permalink Normal View History

2025-11-10 20:25:50 +01:00
export module Crafter.CppDOM:BindingsExport;
2025-11-09 20:11:22 +01:00
import std;
2025-11-10 20:02:11 +01:00
import :EventTypes;
2025-11-12 20:45:35 +01:00
import :BindingsImport;
2025-02-12 23:06:56 +01:00
2025-11-10 20:02:11 +01:00
export namespace Crafter::CppDOMBindings {
2025-11-10 20:42:35 +01:00
std::int32_t clickHandlerMaxId = 0;
2025-11-14 18:40:13 +01:00
std::unordered_map<std::int32_t, std::function<void(Crafter::MouseEvent)>> clickHandlers;
2025-11-09 22:56:29 +01:00
2025-11-10 20:42:35 +01:00
std::int32_t mouseOverHandlerMaxId = 0;
2025-11-14 18:40:13 +01:00
std::unordered_map<std::int32_t, std::function<void(Crafter::MouseEvent)>> mouseOverHandlers;
2025-11-09 22:56:29 +01:00
2025-11-10 20:42:35 +01:00
std::int32_t mouseOutHandlerMaxId = 0;
2025-11-14 18:40:13 +01:00
std::unordered_map<std::int32_t, std::function<void(Crafter::MouseEvent)>> mouseOutHandlers;
2025-11-09 22:56:29 +01:00
2025-11-10 20:42:35 +01:00
std::int32_t mouseMoveHandlerMaxId = 0;
2025-11-14 18:40:13 +01:00
std::unordered_map<std::int32_t, std::function<void(Crafter::MouseEvent)>> mouseMoveHandlers;
2025-11-09 22:56:29 +01:00
2025-11-10 20:42:35 +01:00
std::int32_t mouseDownHandlerMaxId = 0;
2025-11-14 18:40:13 +01:00
std::unordered_map<std::int32_t, std::function<void(Crafter::MouseEvent)>> mouseDownHandlers;
2025-11-10 20:02:11 +01:00
2025-11-10 20:42:35 +01:00
std::int32_t mouseUpHandlerMaxId = 0;
2025-11-14 18:40:13 +01:00
std::unordered_map<std::int32_t, std::function<void(Crafter::MouseEvent)>> mouseUpHandlers;
2025-11-10 20:02:11 +01:00
2025-11-10 20:42:35 +01:00
std::int32_t focusHandlerMaxId = 0;
2025-11-14 18:40:13 +01:00
std::unordered_map<std::int32_t, std::function<void(Crafter::FocusEvent)>> focusHandlers;
2025-11-09 22:56:29 +01:00
2025-11-10 20:42:35 +01:00
std::int32_t blurHandlerMaxId = 0;
2025-11-14 18:40:13 +01:00
std::unordered_map<std::int32_t, std::function<void(Crafter::FocusEvent)>> blurHandlers;
2025-11-09 22:56:29 +01:00
2025-11-10 20:42:35 +01:00
std::int32_t keyDownHandlerMaxId = 0;
2025-11-14 18:40:13 +01:00
std::unordered_map<std::int32_t, std::function<void(Crafter::KeyboardEvent)>> keyDownHandlers;
2025-11-09 22:56:29 +01:00
2025-11-10 20:42:35 +01:00
std::int32_t keyUpHandlerMaxId = 0;
2025-11-14 18:40:13 +01:00
std::unordered_map<std::int32_t, std::function<void(Crafter::KeyboardEvent)>> keyUpHandlers;
2025-11-09 22:56:29 +01:00
2025-11-10 20:42:35 +01:00
std::int32_t keyPressHandlerMaxId = 0;
2025-11-14 18:40:13 +01:00
std::unordered_map<std::int32_t, std::function<void(Crafter::KeyboardEvent)>> keyPressHandlers;
2025-11-09 22:56:29 +01:00
2025-11-10 20:42:35 +01:00
std::int32_t changeHandlerMaxId = 0;
2025-11-14 18:40:13 +01:00
std::unordered_map<std::int32_t, std::function<void(Crafter::ChangeEvent)>> changeHandlers;
2025-11-09 22:56:29 +01:00
2025-11-10 20:42:35 +01:00
std::int32_t submitHandlerMaxId = 0;
2025-11-14 18:40:13 +01:00
std::unordered_map<std::int32_t, std::function<void(void)>> submitHandlers;
2025-11-09 22:56:29 +01:00
2025-11-10 20:42:35 +01:00
std::int32_t inputHandlerMaxId = 0;
2025-11-14 18:40:13 +01:00
std::unordered_map<std::int32_t, std::function<void(Crafter::InputEvent)>> inputHandlers;
2025-11-09 22:56:29 +01:00
2025-11-10 20:42:35 +01:00
std::int32_t resizeHandlerMaxId = 0;
2025-11-14 18:40:13 +01:00
std::unordered_map<std::int32_t, std::function<void(Crafter::ResizeEvent)>> resizeHandlers;
2025-11-09 22:56:29 +01:00
2025-11-10 20:42:35 +01:00
std::int32_t scrollHandlerMaxId = 0;
2025-11-14 18:40:13 +01:00
std::unordered_map<std::int32_t, std::function<void(Crafter::ScrollEvent)>> scrollHandlers;
2025-11-09 22:56:29 +01:00
2025-11-10 20:42:35 +01:00
std::int32_t contextMenuHandlerMaxId = 0;
2025-11-14 18:40:13 +01:00
std::unordered_map<std::int32_t, std::function<void(Crafter::MouseEvent)>> contextMenuHandlers;
2025-11-09 22:56:29 +01:00
2025-11-10 20:42:35 +01:00
std::int32_t dragStartHandlerMaxId = 0;
2025-11-14 18:40:13 +01:00
std::unordered_map<std::int32_t, std::function<void(Crafter::MouseEvent)>> dragStartHandlers;
2025-11-09 22:56:29 +01:00
2025-11-10 20:42:35 +01:00
std::int32_t dragEndHandlerMaxId = 0;
2025-11-14 18:40:13 +01:00
std::unordered_map<std::int32_t, std::function<void(Crafter::MouseEvent)>> dragEndHandlers;
2025-11-09 22:56:29 +01:00
2025-11-10 20:42:35 +01:00
std::int32_t dropHandlerMaxId = 0;
2025-11-14 18:40:13 +01:00
std::unordered_map<std::int32_t, std::function<void(Crafter::MouseEvent)>> dropHandlers;
2025-11-10 20:02:11 +01:00
2025-11-10 20:42:35 +01:00
std::int32_t wheelHandlerMaxId = 0;
2025-11-14 18:40:13 +01:00
std::unordered_map<std::int32_t, std::function<void(Crafter::WheelEvent)>> wheelHandlers;
2025-11-10 20:02:11 +01:00
2025-11-10 20:42:35 +01:00
std::int32_t dragOverHandlerMaxId = 0;
2025-11-14 18:40:13 +01:00
std::unordered_map<std::int32_t, std::function<void(Crafter::MouseEvent)>> dragOverHandlers;
2025-11-10 20:02:11 +01:00
2025-11-10 20:42:35 +01:00
std::int32_t dragEnterHandlerMaxId = 0;
2025-11-14 18:40:13 +01:00
std::unordered_map<std::int32_t, std::function<void(Crafter::MouseEvent)>> dragEnterHandlers;
2025-11-10 20:02:11 +01:00
2025-11-10 20:42:35 +01:00
std::int32_t dragLeaveHandlerMaxId = 0;
2025-11-14 18:40:13 +01:00
std::unordered_map<std::int32_t, std::function<void(Crafter::MouseEvent)>> dragLeaveHandlers;
2025-11-11 00:21:11 +01:00
2025-11-12 20:45:35 +01:00
std::int32_t popStateHandlerMaxId = 0;
2025-11-14 18:40:13 +01:00
std::unordered_map<std::int32_t, std::function<void(void)>> popStateHandlers;
2025-11-12 20:45:35 +01:00
2025-11-11 00:21:11 +01:00
std::int32_t fetchHandlerMaxId = 0;
2025-11-14 18:40:13 +01:00
std::unordered_map<std::int32_t, std::function<void(std::string)>> fetchHandlers;
2025-02-12 23:06:56 +01:00
}
2025-11-09 22:43:52 +01:00
extern "C" {
2025-11-10 20:02:11 +01:00
__attribute__((export_name("WasmAlloc"))) void* WasmAlloc(std::int32_t size) {
return std::malloc(size);
}
__attribute__((export_name("WasmFree"))) void WasmFree(void* ptr) {
std::free(ptr);
}
2025-11-10 21:31:06 +01:00
__attribute__((export_name("ExecuteClickHandler"))) void ExecuteClickHandler(std::int32_t handlerID, double clientX, double clientY, double screenX, double screenY, std::int32_t button, std::int32_t buttons, bool altKey, bool ctrlKey, bool shiftKey, bool metaKey) {
2025-11-14 18:40:13 +01:00
Crafter::CppDOMBindings::clickHandlers.find(handlerID)->second(Crafter::MouseEvent(clientX, clientY, screenX, screenY, button, buttons, altKey, ctrlKey, shiftKey, metaKey));
2025-11-10 20:02:11 +01:00
}
2025-11-10 20:42:35 +01:00
__attribute__((export_name("ExecuteMouseOverHandler"))) void ExecuteMouseOverHandler(std::int32_t handlerID, double clientX, double clientY, double screenX, double screenY, std::int32_t button, std::int32_t buttons, bool altKey, bool ctrlKey, bool shiftKey, bool metaKey) {
2025-11-14 18:40:13 +01:00
Crafter::CppDOMBindings::mouseOverHandlers.find(handlerID)->second(Crafter::MouseEvent(clientX, clientY, screenX, screenY, button, buttons, altKey, ctrlKey, shiftKey, metaKey));
2025-11-10 20:02:11 +01:00
}
2025-11-10 20:42:35 +01:00
__attribute__((export_name("ExecuteMouseOutHandler"))) void ExecuteMouseOutHandler(std::int32_t handlerID, double clientX, double clientY, double screenX, double screenY, std::int32_t button, std::int32_t buttons, bool altKey, bool ctrlKey, bool shiftKey, bool metaKey) {
2025-11-14 18:40:13 +01:00
Crafter::CppDOMBindings::mouseOutHandlers.find(handlerID)->second(Crafter::MouseEvent(clientX, clientY, screenX, screenY, button, buttons, altKey, ctrlKey, shiftKey, metaKey));
2025-11-10 20:02:11 +01:00
}
2025-11-10 20:42:35 +01:00
__attribute__((export_name("ExecuteMouseMoveHandler"))) void ExecuteMouseMoveHandler(std::int32_t handlerID, double clientX, double clientY, double screenX, double screenY, std::int32_t button, std::int32_t buttons, bool altKey, bool ctrlKey, bool shiftKey, bool metaKey) {
2025-11-14 18:40:13 +01:00
Crafter::CppDOMBindings::mouseMoveHandlers.find(handlerID)->second(Crafter::MouseEvent(clientX, clientY, screenX, screenY, button, buttons, altKey, ctrlKey, shiftKey, metaKey));
2025-11-10 20:02:11 +01:00
}
2025-11-10 20:42:35 +01:00
__attribute__((export_name("ExecuteMouseDownHandler"))) void ExecuteMouseDownHandler(std::int32_t handlerID, double clientX, double clientY, double screenX, double screenY, std::int32_t button,std::int32_t buttons, bool altKey, bool ctrlKey, bool shiftKey, bool metaKey) {
2025-11-14 18:40:13 +01:00
Crafter::CppDOMBindings::mouseDownHandlers.find(handlerID)->second(Crafter::MouseEvent(clientX, clientY, screenX, screenY, button, buttons, altKey, ctrlKey, shiftKey, metaKey));
2025-11-09 22:43:52 +01:00
}
2025-11-09 22:56:29 +01:00
2025-11-10 20:42:35 +01:00
__attribute__((export_name("ExecuteMouseUpHandler"))) void ExecuteMouseUpHandler(std::int32_t handlerID, double clientX, double clientY, double screenX, double screenY, std::int32_t button, std::int32_t buttons, bool altKey, bool ctrlKey, bool shiftKey, bool metaKey) {
2025-11-14 18:40:13 +01:00
Crafter::CppDOMBindings::mouseUpHandlers.find(handlerID)->second(Crafter::MouseEvent(clientX, clientY, screenX, screenY, button, buttons, altKey, ctrlKey, shiftKey, metaKey));
2025-11-09 22:56:29 +01:00
}
2025-11-10 21:21:35 +01:00
__attribute__((export_name("ExecuteFocusHandler"))) void ExecuteFocusHandler(std::int32_t handlerID, void* target, void* relatedTarget) {
2025-11-14 18:40:13 +01:00
Crafter::CppDOMBindings::focusHandlers.find(handlerID)->second(Crafter::FocusEvent(target, relatedTarget));
2025-11-09 22:56:29 +01:00
}
2025-11-10 21:21:35 +01:00
__attribute__((export_name("ExecuteBlurHandler"))) void ExecuteBlurHandler(std::int32_t handlerID, void* target, void* relatedTarget) {
2025-11-14 18:40:13 +01:00
Crafter::CppDOMBindings::blurHandlers.find(handlerID)->second(Crafter::FocusEvent(target, relatedTarget));
2025-11-09 22:56:29 +01:00
}
2025-11-10 20:02:11 +01:00
__attribute__((export_name("ExecuteKeyDownHandler"))) void ExecuteKeyDownHandler(std::int32_t handlerID, const char* key, std::int32_t keyCode, bool altKey, bool ctrlKey, bool shiftKey, bool metaKey) {
2025-11-14 18:40:13 +01:00
Crafter::CppDOMBindings::keyDownHandlers.find(handlerID)->second(Crafter::KeyboardEvent(key, keyCode, altKey, ctrlKey, shiftKey, metaKey));
2025-11-09 22:56:29 +01:00
}
2025-11-10 20:02:11 +01:00
__attribute__((export_name("ExecuteKeyUpHandler"))) void ExecuteKeyUpHandler(std::int32_t handlerID, const char* key, std::int32_t keyCode, bool altKey, bool ctrlKey, bool shiftKey, bool metaKey) {
2025-11-14 18:40:13 +01:00
Crafter::CppDOMBindings::keyUpHandlers.find(handlerID)->second(Crafter::KeyboardEvent(key, keyCode, altKey, ctrlKey, shiftKey, metaKey));
2025-11-09 22:56:29 +01:00
}
2025-11-10 20:02:11 +01:00
__attribute__((export_name("ExecuteKeyPressHandler"))) void ExecuteKeyPressHandler(std::int32_t handlerID, const char* key, std::int32_t keyCode, bool altKey, bool ctrlKey, bool shiftKey, bool metaKey) {
2025-11-14 18:40:13 +01:00
Crafter::CppDOMBindings::keyPressHandlers.find(handlerID)->second(Crafter::KeyboardEvent(key, keyCode, altKey, ctrlKey, shiftKey, metaKey));
2025-11-09 22:56:29 +01:00
}
2025-11-10 20:02:11 +01:00
__attribute__((export_name("ExecuteChangeHandler"))) void ExecuteChangeHandler(std::int32_t handlerID, const char* value) {
2025-11-14 18:40:13 +01:00
Crafter::CppDOMBindings::changeHandlers.find(handlerID)->second(Crafter::ChangeEvent(value));
2025-11-09 22:56:29 +01:00
}
2025-11-10 20:02:11 +01:00
__attribute__((export_name("ExecuteSubmitHandler"))) void ExecuteSubmitHandler(std::int32_t handlerID) {
2025-11-14 18:40:13 +01:00
Crafter::CppDOMBindings::submitHandlers.find(handlerID)->second();
2025-11-09 22:56:29 +01:00
}
2025-11-10 20:02:11 +01:00
__attribute__((export_name("ExecuteInputHandler"))) void ExecuteInputHandler(std::int32_t handlerID, const char* data, bool isComposing) {
2025-11-14 18:40:13 +01:00
Crafter::CppDOMBindings::inputHandlers.find(handlerID)->second(Crafter::InputEvent(data, isComposing));
2025-11-09 22:56:29 +01:00
}
2025-11-10 20:42:35 +01:00
__attribute__((export_name("ExecuteResizeHandler"))) void ExecuteResizeHandler(std::int32_t handlerID, std::int32_t width, std::int32_t height) {
2025-11-14 18:40:13 +01:00
Crafter::CppDOMBindings::resizeHandlers.find(handlerID)->second(Crafter::ResizeEvent(width, height));
2025-11-09 22:56:29 +01:00
}
2025-11-10 20:02:11 +01:00
__attribute__((export_name("ExecuteScrollHandler"))) void ExecuteScrollHandler(std::int32_t handlerID, double scrollX, double scrollY) {
2025-11-14 18:40:13 +01:00
Crafter::CppDOMBindings::scrollHandlers.find(handlerID)->second(Crafter::ScrollEvent(scrollX, scrollY));
2025-11-09 22:56:29 +01:00
}
2025-11-10 20:42:35 +01:00
__attribute__((export_name("ExecuteContextMenuHandler"))) void ExecuteContextMenuHandler(std::int32_t handlerID, double clientX, double clientY, double screenX, double screenY, std::int32_t button, std::int32_t buttons, bool altKey, bool ctrlKey, bool shiftKey, bool metaKey) {
2025-11-14 18:40:13 +01:00
Crafter::CppDOMBindings::contextMenuHandlers.find(handlerID)->second(Crafter::MouseEvent(clientX, clientY, screenX, screenY, button, buttons, altKey, ctrlKey, shiftKey, metaKey));
2025-11-09 22:56:29 +01:00
}
2025-11-10 20:42:35 +01:00
__attribute__((export_name("ExecuteDragStartHandler"))) void ExecuteDragStartHandler(std::int32_t handlerID, double clientX, double clientY, double screenX, double screenY, std::int32_t button, std::int32_t buttons, bool altKey, bool ctrlKey, bool shiftKey, bool metaKey) {
2025-11-14 18:40:13 +01:00
Crafter::CppDOMBindings::dragStartHandlers.find(handlerID)->second(Crafter::MouseEvent(clientX, clientY, screenX, screenY, button, buttons, altKey, ctrlKey, shiftKey, metaKey));
2025-11-09 22:56:29 +01:00
}
2025-11-10 20:42:35 +01:00
__attribute__((export_name("ExecuteDragEndHandler"))) void ExecuteDragEndHandler(std::int32_t handlerID, double clientX, double clientY, double screenX, double screenY, std::int32_t button, std::int32_t buttons, bool altKey, bool ctrlKey, bool shiftKey, bool metaKey) {
2025-11-14 18:40:13 +01:00
Crafter::CppDOMBindings::dragEndHandlers.find(handlerID)->second(Crafter::MouseEvent(clientX, clientY, screenX, screenY, button, buttons, altKey, ctrlKey, shiftKey, metaKey));
2025-11-09 22:56:29 +01:00
}
2025-11-10 20:42:35 +01:00
__attribute__((export_name("ExecuteDropHandler"))) void ExecuteDropHandler(std::int32_t handlerID, double clientX, double clientY, double screenX, double screenY, std::int32_t button, std::int32_t buttons, bool altKey, bool ctrlKey, bool shiftKey, bool metaKey) {
2025-11-14 18:40:13 +01:00
Crafter::CppDOMBindings::dropHandlers.find(handlerID)->second(Crafter::MouseEvent(clientX, clientY, screenX, screenY, button, buttons, altKey, ctrlKey, shiftKey, metaKey));
2025-11-09 22:56:29 +01:00
}
2025-11-10 20:42:35 +01:00
__attribute__((export_name("ExecuteWheelHandler"))) void ExecuteWheelHandler(std::int32_t handlerID, double deltaX, double deltaY, double deltaZ, std::int32_t deltaMode, double clientX, double clientY, double screenX, double screenY, std::int32_t button, std::int32_t buttons, bool altKey, bool ctrlKey, bool shiftKey, bool metaKey) {
2025-11-14 18:40:13 +01:00
Crafter::CppDOMBindings::wheelHandlers.find(handlerID)->second(Crafter::WheelEvent(clientX, clientY, screenX, screenY, button, buttons, altKey, ctrlKey, shiftKey, metaKey, deltaX, deltaY, deltaZ));
2025-11-09 22:56:29 +01:00
}
2025-11-10 20:42:35 +01:00
__attribute__((export_name("ExecuteDragOverHandler"))) void ExecuteDragOverHandler(std::int32_t handlerID, double clientX, double clientY, double screenX, double screenY, std::int32_t button, std::int32_t buttons, bool altKey, bool ctrlKey, bool shiftKey, bool metaKey) {
2025-11-14 18:40:13 +01:00
Crafter::CppDOMBindings::dragOverHandlers.find(handlerID)->second(Crafter::MouseEvent(clientX, clientY, screenX, screenY, button, buttons, altKey, ctrlKey, shiftKey, metaKey));
2025-11-09 22:56:29 +01:00
}
2025-11-10 20:42:35 +01:00
__attribute__((export_name("ExecuteDragEnterHandler"))) void ExecuteDragEnterHandler(std::int32_t handlerID, double clientX, double clientY, double screenX, double screenY, std::int32_t button, std::int32_t buttons, bool altKey, bool ctrlKey, bool shiftKey, bool metaKey) {
2025-11-14 18:40:13 +01:00
Crafter::CppDOMBindings::dragEnterHandlers.find(handlerID)->second(Crafter::MouseEvent(clientX, clientY, screenX, screenY, button, buttons, altKey, ctrlKey, shiftKey, metaKey));
2025-11-09 22:56:29 +01:00
}
2025-11-10 20:42:35 +01:00
__attribute__((export_name("ExecuteDragLeaveHandler"))) void ExecuteDragLeaveHandler(std::int32_t handlerID, double clientX, double clientY, double screenX, double screenY, std::int32_t button, std::int32_t buttons, bool altKey, bool ctrlKey, bool shiftKey, bool metaKey) {
2025-11-14 18:40:13 +01:00
Crafter::CppDOMBindings::dragLeaveHandlers.find(handlerID)->second(Crafter::MouseEvent(clientX, clientY, screenX, screenY, button, buttons, altKey, ctrlKey, shiftKey, metaKey));
2025-11-09 22:56:29 +01:00
}
2025-11-11 00:21:11 +01:00
__attribute__((export_name("ExecuteFetchHandler"))) void ExecuteFetchHandler(std::int32_t handlerID, const char* response) {
std::cout << handlerID << std::endl;
2025-11-14 18:40:13 +01:00
Crafter::CppDOMBindings::fetchHandlers.find(handlerID)->second(response);
Crafter::CppDOMBindings::fetchHandlers.erase(handlerID);
2025-11-10 22:06:27 +01:00
}
2025-11-12 20:45:35 +01:00
__attribute__((export_name("ExecutePopStateHandler"))) void ExecutePopStateHandler(std::int32_t handlerID) {
2025-11-14 18:40:13 +01:00
Crafter::CppDOMBindings::popStateHandlers.find(handlerID)->second();
2025-11-12 20:45:35 +01:00
}
2025-11-11 00:21:11 +01:00
}
export namespace Crafter::CppDOMBindings {
__attribute__((import_module("env"), import_name("fetch"))) void Fetch(const char* url, std::int32_t urlLenght, std::int32_t handlerID);
2025-11-11 00:24:20 +01:00
__attribute__((import_module("env"), import_name("fetchWithBody"))) void FetchWithBody(const char* url, std::int32_t urlLenght, const char* body, std::int32_t bodyLength, std::int32_t handlerID);
2025-11-11 00:21:11 +01:00
void Fetch(const std::string_view url, std::function<void(std::string)> callback) {
std::int32_t id = fetchHandlerMaxId++;
2025-11-14 18:40:13 +01:00
CppDOMBindings::fetchHandlers.insert({id, callback});
2025-11-11 00:21:11 +01:00
Fetch(url.data(), url.size(), id);
2025-11-10 22:06:27 +01:00
}
2025-11-11 00:24:20 +01:00
void Fetch(const std::string_view url, const std::string_view body, std::function<void(std::string)> callback) {
std::int32_t id = fetchHandlerMaxId++;
2025-11-14 18:40:13 +01:00
CppDOMBindings::fetchHandlers.insert({id, callback});
2025-11-11 00:24:20 +01:00
FetchWithBody(url.data(), url.size(), body.data(), body.size(), id);
}
2025-11-12 20:45:35 +01:00
__attribute__((import_module("env"), import_name("getPathName"))) const char* GetPathName();
std::string GetPathNameString() {
const char* path = GetPathName();
return std::string(path);
}
std::int32_t AddPopStateListener(std::function<void(void)> callback) {
std::int32_t id = popStateHandlerMaxId++;
2025-11-14 18:40:13 +01:00
popStateHandlers.insert({id, callback});
2025-11-12 20:45:35 +01:00
AddPopStateListener(id);
return id;
}
void RemovePopStateListener(std::int32_t id) {
RemovePopStateListener(id);
2025-11-14 18:40:13 +01:00
popStateHandlers.erase(id);
2025-11-12 20:45:35 +01:00
}
void PushState(const std::string_view data, const std::string_view title, const std::string_view url) {
PushState(data.data(), data.size(), title.data(), title.size(), url.data(), url.size());
}
2025-11-09 22:43:52 +01:00
}