|
AeonGUI
A portable video game graphic user interface library.
|
Represents a DOM Document. More...
#include <aeongui/dom/Document.hpp>
Public Member Functions | |
| Document () | |
| Default constructor. Creates an empty document. | |
| void | Load (const USVString &aFilename) |
| Load a document from a file. | |
| ~Document () | |
| Destructor. Unloads the document. | |
| void | Draw (Canvas &aCanvas) const |
| Draw the document onto a canvas. | |
| const USVString & | url () const |
| Get the document URL. | |
| NodeType | nodeType () const final |
| Get the node type (always DOCUMENT_NODE). | |
| Public Member Functions inherited from AeonGUI::DOM::Node | |
| Node (Node *aParent=nullptr) | |
| Construct a node with an optional parent. | |
| Node * | AddNode (std::unique_ptr< Node > aNode) |
| Add a child node. | |
| std::unique_ptr< Node > | RemoveNode (const Node *aNode) |
| Remove a child node. | |
| void | TraverseDepthFirstPreOrder (const std::function< void(Node &) > &aAction) |
| Traverse the tree depth-first in pre-order. | |
| void | TraverseDepthFirstPreOrder (const std::function< void(const Node &) > &aAction) const |
| Traverse the tree depth-first in pre-order (const). | |
| void | TraverseDepthFirstPostOrder (const std::function< void(Node &) > &aAction) |
| Traverse the tree depth-first in post-order. | |
| void | TraverseDepthFirstPostOrder (const std::function< void(const Node &) > &aAction) const |
| Traverse the tree depth-first in post-order (const). | |
| void | TraverseDepthFirstPreOrder (const std::function< void(Node &) > &aPreamble, const std::function< void(Node &) > &aPostamble) |
| Traverse pre-order with separate pre and post callbacks. | |
| void | TraverseDepthFirstPreOrder (const std::function< void(const Node &) > &aPreamble, const std::function< void(const Node &) > &aPostamble) const |
| Traverse pre-order with pre/post callbacks (const). | |
| void | TraverseDepthFirstPreOrder (const std::function< void(Node &) > &aPreamble, const std::function< void(Node &) > &aPostamble, const std::function< bool(Node &) > &aUnaryPredicate) |
| Traverse pre-order with pre/post callbacks and a predicate filter. | |
| void | TraverseDepthFirstPreOrder (const std::function< void(const Node &) > &aPreamble, const std::function< void(const Node &) > &aPostamble, const std::function< bool(const Node &) > &aUnaryPredicate) const |
| Traverse pre-order with pre/post callbacks and predicate (const). | |
| virtual void | DrawStart (Canvas &aCanvas) const |
| Begin drawing this node on the canvas. | |
| virtual void | DrawFinish (Canvas &aCanvas) const |
| Finish drawing this node on the canvas. | |
| virtual void | OnLoad () |
| virtual void | OnUnload () |
| virtual bool | IsDrawEnabled () const |
| Node * | parentNode () const |
| Get the parent node. | |
| Node * | parentElement () const |
| Get the parent element (same as parentNode for elements). | |
| const std::vector< std::unique_ptr< Node > > & | childNodes () const |
| Get the list of child nodes. | |
| Public Member Functions inherited from AeonGUI::DOM::EventTarget | |
| virtual | ~EventTarget ()=0 |
| Virtual destructor. | |
| void | addEventListener (const DOMString &type, EventListener *callback, const std::variant< std::monostate, AddEventListenerOptions, bool > &options={}) |
| Register an event listener. | |
| void | removeEventListener (const DOMString &type, EventListener *callback, const std::variant< std::monostate, EventListenerOptions, bool > &options={}) |
| Unregister an event listener. | |
| virtual bool | dispatchEvent (Event &event) |
| Dispatch an event to this target. | |
Additional Inherited Members | |
| Public Types inherited from AeonGUI::DOM::Node | |
| enum | NodeType { ELEMENT_NODE = 1 , ATTRIBUTE_NODE = 2 , TEXT_NODE = 3 , CDATA_SECTION_NODE = 4 , ENTITY_REFERENCE_NODE = 5 , ENTITY_NODE = 6 , PROCESSING_INSTRUCTION_NODE = 7 , COMMENT_NODE = 8 , DOCUMENT_NODE = 9 , DOCUMENT_TYPE_NODE = 10 , DOCUMENT_FRAGMENT_NODE = 11 , NOTATION_NODE = 12 } |
| DOM node type constants. More... | |
Represents a DOM Document.
The Document is the root of the DOM tree. It owns the parsed SVG node hierarchy and an associated CSS stylesheet.
| void AeonGUI::DOM::Document::Draw | ( | Canvas & | aCanvas | ) | const |
Draw the document onto a canvas.
| aCanvas | The rendering surface. |
| void AeonGUI::DOM::Document::Load | ( | const USVString & | aFilename | ) |
|
finalvirtual |
Get the node type (always DOCUMENT_NODE).
DOM Properties and Methods
Implements AeonGUI::DOM::Node.
| const USVString & AeonGUI::DOM::Document::url | ( | ) | const |
Get the document URL.