This commit is contained in:
Jorijn van der Graaf 2025-11-12 16:25:12 +01:00
commit b96faacf89
4 changed files with 39 additions and 0 deletions

View file

@ -138,4 +138,11 @@ export namespace Crafter::CppDOMBindings {
}
__attribute__((import_module("env"), import_name("deleteElement"))) void DeleteElement(void* ptr);
// Value property functions
__attribute__((import_module("env"), import_name("getValue"))) const char* GetValue(void* ptr);
__attribute__((import_module("env"), import_name("setValue"))) void SetValue(void* ptr, const char* value, std::int32_t valueLength);
void SetValue(void* ptr, const std::string_view value) {
SetValue(ptr, value.data(), value.size());
}
}

View file

@ -63,6 +63,10 @@ namespace Crafter {
void ToggleClass(const std::string_view className);
bool HasClass(const std::string_view className);
// Value property accessors
std::string GetValue();
void SetValue(const std::string_view value);
std::int32_t AddClickListener(std::function<void(Crafter::MouseEvent)> callback);
void RemoveClickListener(std::int32_t id);