Nui
Loading...
Searching...
No Matches
html_element_bridges.hpp
Go to the documentation of this file.
1#pragma once
2
5
6namespace Nui
7{
10 +[](HtmlElement const& element) {
11 return Nui::val::global("document").call<Nui::val>("createElement", Nui::val{element.name()});
12 },
13 };
14
17 +[](HtmlElement const& element) {
18 return Nui::val::global("document")
19 .call<Nui::val>(
20 "createElementNS",
21 Nui::val{std::string{"http://www.w3.org/2000/svg"}},
22 Nui::val{element.name()});
23 },
24 };
25
28 +[](HtmlElement const& element) {
29 return Nui::val::global("document")
30 .call<Nui::val>("createTextNode", Nui::val{element.attributes()[0].stringData()});
31 },
32 };
33
36 +[](HtmlElement const& element) {
37 return Nui::val::global("document")
38 .call<Nui::val>("createComment", Nui::val{element.attributes()[0].stringData()});
39 },
40 };
41}
Definition html_element.hpp:58
Definition file_dialog.hpp:6
constexpr auto SvgElementBridge
Definition html_element_bridges.hpp:15
constexpr auto RegularHtmlElementBridge
Definition html_element_bridges.hpp:8
constexpr auto TextElementBridge
Definition html_element_bridges.hpp:26
constexpr auto CommentElementBridge
Definition html_element_bridges.hpp:34
emscripten::val val
Definition val.hpp:5
Definition html_element_bridge.hpp:14
Nui::val(* createElement)(HtmlElement const &element)
Definition html_element_bridge.hpp:15