AeonGUI
A portable video game graphic user interface library.
Loading...
Searching...
No Matches
AeonGUI_PluginContext Struct Reference

Plugin context passed to OnLoad and OnUnload. More...

#include </d/a/AeonGUI/AeonGUI/include/aeongui/PluginAPI.h>

Public Attributes

AeonGUI_Documentdocument
 The document that loaded this plugin.
AeonGUI_Element *(* getElementById )(AeonGUI_Document *doc, const char *id)
 Find an element by its id attribute.
void(* addEventListener )(AeonGUI_Element *element, const char *type, AeonGUI_EventCallback callback, void *userData)
 Register an event listener on an element.
void(* removeEventListener )(AeonGUI_Element *element, const char *type, AeonGUI_EventCallback callback, void *userData)
 Remove a previously registered event listener.
const char *(* getAttribute )(AeonGUI_Element *element, const char *name)
 Read an attribute value from an element.
const char *(* getEventType )(AeonGUI_Event *event)
 Get the type string of an event.
void(* setAttribute )(AeonGUI_Element *element, const char *name, const char *value)
 Set (or add) an attribute on an element.
AeonGUI_Element *(* querySelector )(AeonGUI_Element *element, const char *selector)
 Find the first descendant element matching a CSS selector.

Detailed Description

Plugin context passed to OnLoad and OnUnload.

Contains the document handle and function pointers for interacting with the DOM. The plugin does not need to link against AeonGUI — all calls go through these pointers.

Member Data Documentation

◆ addEventListener

void(* AeonGUI_PluginContext::addEventListener) (AeonGUI_Element *element, const char *type, AeonGUI_EventCallback callback, void *userData)

Register an event listener on an element.

Parameters
elementThe target element.
typeEvent type (e.g. "click", "mouseenter").
callbackFunction to call when the event fires.
userDataOpaque pointer forwarded to the callback.

◆ getAttribute

const char *(* AeonGUI_PluginContext::getAttribute) (AeonGUI_Element *element, const char *name)

Read an attribute value from an element.

Parameters
elementThe element.
nameAttribute name.
Returns
The attribute value string, or NULL if not found. The pointer is valid until the element is destroyed.

◆ getElementById

AeonGUI_Element *(* AeonGUI_PluginContext::getElementById) (AeonGUI_Document *doc, const char *id)

Find an element by its id attribute.

Parameters
docThe document handle.
idThe id string to search for.
Returns
Element handle, or NULL if not found.

◆ getEventType

const char *(* AeonGUI_PluginContext::getEventType) (AeonGUI_Event *event)

Get the type string of an event.

Parameters
eventThe event handle.
Returns
The event type (e.g. "click"). Valid for the lifetime of the event.

◆ querySelector

AeonGUI_Element *(* AeonGUI_PluginContext::querySelector) (AeonGUI_Element *element, const char *selector)

Find the first descendant element matching a CSS selector.

Parameters
elementThe root element to search within.
selectorCSS selector string.
Returns
Element handle, or NULL if not found.

◆ removeEventListener

void(* AeonGUI_PluginContext::removeEventListener) (AeonGUI_Element *element, const char *type, AeonGUI_EventCallback callback, void *userData)

Remove a previously registered event listener.

Parameters
elementThe target element.
typeEvent type.
callbackThe callback to remove.
userDataThe same userData used during registration.

◆ setAttribute

void(* AeonGUI_PluginContext::setAttribute) (AeonGUI_Element *element, const char *name, const char *value)

Set (or add) an attribute on an element.

Parameters
elementThe element.
nameAttribute name.
valueNew value.

The documentation for this struct was generated from the following file: