2025-02-12 23:12:24 +01:00
|
|
|
/*
|
|
|
|
|
Crafter.CppDOM
|
|
|
|
|
Copyright (C) 2025 Catcrafts
|
|
|
|
|
Catcrafts.net
|
|
|
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
|
|
|
|
modify it under the terms of the GNU Lesser General Public
|
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
|
version 3.0 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
|
Lesser General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
|
|
|
License along with this library; if not, write to the Free Software
|
|
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
|
*/
|
|
|
|
|
|
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-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-10 21:31:06 +01:00
|
|
|
std::unordered_map<int, std::function<void(Crafter::MouseEvent)>>* clickHandlers = new std::unordered_map<int, std::function<void(Crafter::MouseEvent)>>();
|
2025-11-09 22:56:29 +01:00
|
|
|
|
2025-11-10 20:42:35 +01:00
|
|
|
std::int32_t mouseOverHandlerMaxId = 0;
|
|
|
|
|
std::unordered_map<int, std::function<void(Crafter::MouseEvent)>>* mouseOverHandlers = new std::unordered_map<int, std::function<void(Crafter::MouseEvent)>>();
|
2025-11-09 22:56:29 +01:00
|
|
|
|
2025-11-10 20:42:35 +01:00
|
|
|
std::int32_t mouseOutHandlerMaxId = 0;
|
|
|
|
|
std::unordered_map<int, std::function<void(Crafter::MouseEvent)>>* mouseOutHandlers = new std::unordered_map<int, std::function<void(Crafter::MouseEvent)>>();
|
2025-11-09 22:56:29 +01:00
|
|
|
|
2025-11-10 20:42:35 +01:00
|
|
|
std::int32_t mouseMoveHandlerMaxId = 0;
|
|
|
|
|
std::unordered_map<int, std::function<void(Crafter::MouseEvent)>>* mouseMoveHandlers = new std::unordered_map<int, std::function<void(Crafter::MouseEvent)>>();
|
2025-11-09 22:56:29 +01:00
|
|
|
|
2025-11-10 20:42:35 +01:00
|
|
|
std::int32_t mouseDownHandlerMaxId = 0;
|
|
|
|
|
std::unordered_map<int, std::function<void(Crafter::MouseEvent)>>* mouseDownHandlers = new std::unordered_map<int, std::function<void(Crafter::MouseEvent)>>();
|
2025-11-10 20:02:11 +01:00
|
|
|
|
2025-11-10 20:42:35 +01:00
|
|
|
std::int32_t mouseUpHandlerMaxId = 0;
|
|
|
|
|
std::unordered_map<int, std::function<void(Crafter::MouseEvent)>>* mouseUpHandlers = new std::unordered_map<int, std::function<void(Crafter::MouseEvent)>>();
|
2025-11-10 20:02:11 +01:00
|
|
|
|
2025-11-10 20:42:35 +01:00
|
|
|
std::int32_t focusHandlerMaxId = 0;
|
2025-11-10 21:21:35 +01:00
|
|
|
std::unordered_map<int, std::function<void(Crafter::FocusEvent)>>* focusHandlers = new std::unordered_map<int, std::function<void(Crafter::FocusEvent)>>();
|
2025-11-09 22:56:29 +01:00
|
|
|
|
2025-11-10 20:42:35 +01:00
|
|
|
std::int32_t blurHandlerMaxId = 0;
|
2025-11-10 21:21:35 +01:00
|
|
|
std::unordered_map<int, std::function<void(Crafter::FocusEvent)>>* blurHandlers = new std::unordered_map<int, std::function<void(Crafter::FocusEvent)>>();
|
2025-11-09 22:56:29 +01:00
|
|
|
|
2025-11-10 20:42:35 +01:00
|
|
|
std::int32_t keyDownHandlerMaxId = 0;
|
2025-11-10 20:02:11 +01:00
|
|
|
std::unordered_map<int, std::function<void(Crafter::KeyboardEvent)>>* keyDownHandlers = new std::unordered_map<int, std::function<void(Crafter::KeyboardEvent)>>();
|
2025-11-09 22:56:29 +01:00
|
|
|
|
2025-11-10 20:42:35 +01:00
|
|
|
std::int32_t keyUpHandlerMaxId = 0;
|
2025-11-10 20:02:11 +01:00
|
|
|
std::unordered_map<int, std::function<void(Crafter::KeyboardEvent)>>* keyUpHandlers = new std::unordered_map<int, std::function<void(Crafter::KeyboardEvent)>>();
|
2025-11-09 22:56:29 +01:00
|
|
|
|
2025-11-10 20:42:35 +01:00
|
|
|
std::int32_t keyPressHandlerMaxId = 0;
|
2025-11-10 20:02:11 +01:00
|
|
|
std::unordered_map<int, std::function<void(Crafter::KeyboardEvent)>>* keyPressHandlers = new std::unordered_map<int, std::function<void(Crafter::KeyboardEvent)>>();
|
2025-11-09 22:56:29 +01:00
|
|
|
|
2025-11-10 20:42:35 +01:00
|
|
|
std::int32_t changeHandlerMaxId = 0;
|
2025-11-10 20:02:11 +01:00
|
|
|
std::unordered_map<int, std::function<void(Crafter::ChangeEvent)>>* changeHandlers = new std::unordered_map<int, std::function<void(Crafter::ChangeEvent)>>();
|
2025-11-09 22:56:29 +01:00
|
|
|
|
2025-11-10 20:42:35 +01:00
|
|
|
std::int32_t submitHandlerMaxId = 0;
|
2025-11-09 22:56:29 +01:00
|
|
|
std::unordered_map<int, std::function<void(void)>>* submitHandlers = new std::unordered_map<int, std::function<void(void)>>();
|
|
|
|
|
|
2025-11-10 20:42:35 +01:00
|
|
|
std::int32_t inputHandlerMaxId = 0;
|
2025-11-10 20:02:11 +01:00
|
|
|
std::unordered_map<int, std::function<void(Crafter::InputEvent)>>* inputHandlers = new std::unordered_map<int, std::function<void(Crafter::InputEvent)>>();
|
2025-11-09 22:56:29 +01:00
|
|
|
|
2025-11-10 20:42:35 +01:00
|
|
|
std::int32_t resizeHandlerMaxId = 0;
|
2025-11-10 20:02:11 +01:00
|
|
|
std::unordered_map<int, std::function<void(Crafter::ResizeEvent)>>* resizeHandlers = new std::unordered_map<int, std::function<void(Crafter::ResizeEvent)>>();
|
2025-11-09 22:56:29 +01:00
|
|
|
|
2025-11-10 20:42:35 +01:00
|
|
|
std::int32_t scrollHandlerMaxId = 0;
|
2025-11-10 20:02:11 +01:00
|
|
|
std::unordered_map<int, std::function<void(Crafter::ScrollEvent)>>* scrollHandlers = new std::unordered_map<int, std::function<void(Crafter::ScrollEvent)>>();
|
2025-11-09 22:56:29 +01:00
|
|
|
|
2025-11-10 20:42:35 +01:00
|
|
|
std::int32_t contextMenuHandlerMaxId = 0;
|
2025-11-10 20:02:11 +01:00
|
|
|
std::unordered_map<int, std::function<void(Crafter::MouseEvent)>>* contextMenuHandlers = new std::unordered_map<int, std::function<void(Crafter::MouseEvent)>>();
|
2025-11-09 22:56:29 +01:00
|
|
|
|
2025-11-10 20:42:35 +01:00
|
|
|
std::int32_t dragStartHandlerMaxId = 0;
|
2025-11-10 20:02:11 +01:00
|
|
|
std::unordered_map<int, std::function<void(Crafter::MouseEvent)>>* dragStartHandlers = new std::unordered_map<int, std::function<void(Crafter::MouseEvent)>>();
|
2025-11-09 22:56:29 +01:00
|
|
|
|
2025-11-10 20:42:35 +01:00
|
|
|
std::int32_t dragEndHandlerMaxId = 0;
|
2025-11-10 20:02:11 +01:00
|
|
|
std::unordered_map<int, std::function<void(Crafter::MouseEvent)>>* dragEndHandlers = new std::unordered_map<int, std::function<void(Crafter::MouseEvent)>>();
|
2025-11-09 22:56:29 +01:00
|
|
|
|
2025-11-10 20:42:35 +01:00
|
|
|
std::int32_t dropHandlerMaxId = 0;
|
2025-11-10 20:02:11 +01:00
|
|
|
std::unordered_map<int, std::function<void(Crafter::MouseEvent)>>* dropHandlers = new std::unordered_map<int, std::function<void(Crafter::MouseEvent)>>();
|
|
|
|
|
|
2025-11-10 20:42:35 +01:00
|
|
|
std::int32_t wheelHandlerMaxId = 0;
|
2025-11-10 20:02:11 +01:00
|
|
|
std::unordered_map<int, std::function<void(Crafter::WheelEvent)>>* wheelHandlers = new std::unordered_map<int, std::function<void(Crafter::WheelEvent)>>();
|
|
|
|
|
|
2025-11-10 20:42:35 +01:00
|
|
|
std::int32_t dragOverHandlerMaxId = 0;
|
2025-11-10 20:02:11 +01:00
|
|
|
std::unordered_map<int, std::function<void(Crafter::MouseEvent)>>* dragOverHandlers = new std::unordered_map<int, std::function<void(Crafter::MouseEvent)>>();
|
|
|
|
|
|
2025-11-10 20:42:35 +01:00
|
|
|
std::int32_t dragEnterHandlerMaxId = 0;
|
2025-11-10 20:02:11 +01:00
|
|
|
std::unordered_map<int, std::function<void(Crafter::MouseEvent)>>* dragEnterHandlers = new std::unordered_map<int, std::function<void(Crafter::MouseEvent)>>();
|
|
|
|
|
|
2025-11-10 20:42:35 +01:00
|
|
|
std::int32_t dragLeaveHandlerMaxId = 0;
|
2025-11-10 20:02:11 +01:00
|
|
|
std::unordered_map<int, std::function<void(Crafter::MouseEvent)>>* dragLeaveHandlers = new std::unordered_map<int, std::function<void(Crafter::MouseEvent)>>();
|
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) {
|
|
|
|
|
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) {
|
|
|
|
|
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) {
|
|
|
|
|
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) {
|
|
|
|
|
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) {
|
|
|
|
|
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) {
|
|
|
|
|
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) {
|
|
|
|
|
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) {
|
|
|
|
|
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) {
|
|
|
|
|
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) {
|
|
|
|
|
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) {
|
|
|
|
|
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-10 20:25:50 +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) {
|
|
|
|
|
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-10 20:25:50 +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-10 20:25:50 +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-10 20:25:50 +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) {
|
|
|
|
|
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) {
|
|
|
|
|
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) {
|
|
|
|
|
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) {
|
|
|
|
|
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) {
|
|
|
|
|
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) {
|
|
|
|
|
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) {
|
|
|
|
|
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) {
|
|
|
|
|
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-10 22:06:27 +01:00
|
|
|
|
|
|
|
|
// Style functions
|
|
|
|
|
__attribute__((export_name("setStyle"))) void SetStyle(void* ptr, const char* style, std::size_t styleLength) {
|
|
|
|
|
// This will be implemented in JavaScript
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
__attribute__((export_name("setProperty"))) void SetProperty(void* ptr, const char* property, std::size_t propertyLength, const char* value, std::size_t valueLength) {
|
|
|
|
|
// This will be implemented in JavaScript
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
__attribute__((export_name("addClass"))) void AddClass(void* ptr, const char* className, std::size_t classNameLength) {
|
|
|
|
|
// This will be implemented in JavaScript
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
__attribute__((export_name("removeClass"))) void RemoveClass(void* ptr, const char* className, std::size_t classNameLength) {
|
|
|
|
|
// This will be implemented in JavaScript
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
__attribute__((export_name("toggleClass"))) void ToggleClass(void* ptr, const char* className, std::size_t classNameLength) {
|
|
|
|
|
// This will be implemented in JavaScript
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
__attribute__((export_name("hasClass"))) bool HasClass(void* ptr, const char* className, std::size_t classNameLength) {
|
|
|
|
|
// This will be implemented in JavaScript
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2025-11-09 22:43:52 +01:00
|
|
|
}
|