added HtmlElement class
This commit is contained in:
parent
3174f75e21
commit
9ee52266b5
8 changed files with 55 additions and 38 deletions
|
|
@ -18,12 +18,9 @@ License along with this library; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
module;
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <cstdlib>
|
||||
#include <string>
|
||||
export module Crafter.CppDOM;
|
||||
export import :Bindings;
|
||||
export import :HtmlElement;
|
||||
|
||||
extern "C" {
|
||||
void __cxa_allocate_exception() {
|
||||
|
|
@ -34,24 +31,3 @@ extern "C" {
|
|||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
export namespace Crafter::CppDOM::Bindings {
|
||||
__attribute__((import_module("env"), import_name("getElementById"))) void* GetElementById(const char* id, std::size_t idLenght);
|
||||
inline void* GetElementById(const std::string& id){
|
||||
return GetElementById(id.c_str(), id.size());
|
||||
}
|
||||
__attribute__((import_module("env"), import_name("setInnerHTML"))) void SetInnerHTML(void* ptr, const char* html, std::size_t htmlLenght);
|
||||
inline void SetInnerHTML(void* ptr, const std::string& html){
|
||||
SetInnerHTML(ptr, html.c_str(), html.size());
|
||||
}
|
||||
__attribute__((import_module("env"), import_name("freeJs"))) void FreeJs(void* ptr);
|
||||
// __attribute__((import_module("env"), import_name("strokeRect"))) void StrokeRect(std::uint64_t id, std::uint32_t x, std::uint32_t y, std::uint32_t width, std::uint32_t height, const char* color, std::size_t colorLenght);
|
||||
// __attribute__((import_module("env"), import_name("putImageData"))) void PutImageData(std::uint64_t id, Crafter::Web::Pixel* buffer, std::uint32_t width, std::uint32_t height);
|
||||
// __attribute__((import_module("env"), import_name("fetch"))) void Fetch(void* obj, const char* url, std::size_t urlCallback, char* buffer, void (*listener)(void* obj, std::uint32_t, char*));
|
||||
// __attribute__((import_module("env"), import_name("setTimeout"))) void SetTimeout(void* obj, std::uint32_t time, void (*listener)(void* obj));
|
||||
// __attribute__((import_module("env"), import_name("draw"))) void Draw(std::uint64_t id, std::uint32_t x, std::uint32_t y, const char* text, std::uint32_t textLenght);
|
||||
//__attribute__((import_module("env"), import_name("addEventListener"))) void AddEventListener(std::string id, std::string eventId, void (*listener)(void));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue