Nebula
Loading...
Searching...
No Matches
RmlUi::Api Namespace Reference

Typedefs

typedef void(*) EventCallback(intptr_t userData, uint64_t currentElement, uint64_t targetElement)
 called for an event, with the element the listener is on and the element the event started at
typedef void(*) ReleaseCallback(intptr_t userData)
 called once RmlUi drops a listener

Functions

bool RmlUiLoadFontFace (const char *path, bool fallback)
 load a font face (ttf, otf...)
uint64_t RmlUiLoadDocument (const char *path)
 load a document, hidden until shown, returns 0 on failure
void RmlUiDocumentShow (uint64_t document)
 show a document
void RmlUiDocumentHide (uint64_t document)
 hide a document
void RmlUiDocumentClose (uint64_t document)
 close a document, its elements become invalid
bool RmlUiIsActive ()
 check if RmlUi is running. At shutdown it stops before scripts unload
void RmlUiSetDebuggerVisible (bool visible)
 show or hide the RmlUi debugger
bool RmlUiElementIsValid (uint64_t element)
 check if a handle still refers to a live element
uint64_t RmlUiElementGetElementById (uint64_t element, const char *id)
 find an element by id in the subtree of an element (or document), returns 0 if there is none
uint64_t RmlUiElementGetDocument (uint64_t element)
 get the document an element is in
int RmlUiElementGetInnerRml (uint64_t element, char *buffer, int bufferSize)
 get the element's inner RML
void RmlUiElementSetInnerRml (uint64_t element, const char *rml)
 replace the element's content with RML
int RmlUiElementGetAttribute (uint64_t element, const char *name, char *buffer, int bufferSize)
 get an attribute as a string
void RmlUiElementSetAttribute (uint64_t element, const char *name, const char *value)
 set an attribute
void RmlUiElementRemoveAttribute (uint64_t element, const char *name)
 remove an attribute
void RmlUiElementSetClass (uint64_t element, const char *name, bool active)
 set or clear a class
bool RmlUiElementIsClassSet (uint64_t element, const char *name)
 check for a class
bool RmlUiElementSetProperty (uint64_t element, const char *name, const char *value)
 set an RCSS property from its string form, returns false if it doesn't parse
void RmlUiElementRemoveProperty (uint64_t element, const char *name)
 remove a local RCSS property
int RmlUiElementGetValue (uint64_t element, char *buffer, int bufferSize)
 get the value of a form control (input, select, textarea)
void RmlUiElementSetValue (uint64_t element, const char *value)
 set the value of a form control
bool RmlUiElementFocus (uint64_t element)
 focus an element
uint64_t RmlUiElementAddEventListener (uint64_t element, const char *event, EventCallback callback, ReleaseCallback release, intptr_t userData)
 add a listener for an event ("click", "change", "mouseover"...)
void RmlUiRemoveEventListener (uint64_t listenerId)
 A listener whose element has been destroyed is already gone, removing it again does nothing.
void RmlUiCreateDataModel (const char *model)
 create a data model, bind its variables before loading documents that use it
void RmlUiRemoveDataModel (const char *model)
 remove a data model and its component bindings
void RmlUiBindComponent (const char *model, const char *name, uint64_t entity, uint32_t component)
 bind a component of an entity as a variable of a data model
void RmlUiBindDataEvent (const char *model, const char *name, EventCallback callback, intptr_t userData)
 bind a data event (data-event-click="name"), the callback gets the element the event is on
void RmlUiDirtyVariable (const char *model, const char *name)
 mark a data model variable dirty so views update
void DiscardHandles ()
 drop all handles and listeners, called when RmlUi shuts down

Typedef Documentation

◆ EventCallback

typedef void(*) RmlUi::Api::EventCallback(intptr_t userData, uint64_t currentElement, uint64_t targetElement)

called for an event, with the element the listener is on and the element the event started at

◆ ReleaseCallback

typedef void(*) RmlUi::Api::ReleaseCallback(intptr_t userData)

called once RmlUi drops a listener

Function Documentation

◆ DiscardHandles()

void RmlUi::Api::DiscardHandles ( )

drop all handles and listeners, called when RmlUi shuts down

◆ RmlUiBindComponent()

NEBULA_EXPORT void RmlUi::Api::RmlUiBindComponent ( const char * model,
const char * name,
uint64_t entityId,
uint32_t component )

bind a component of an entity as a variable of a data model

◆ RmlUiBindDataEvent()

NEBULA_EXPORT void RmlUi::Api::RmlUiBindDataEvent ( const char * model,
const char * name,
EventCallback callback,
intptr_t userData )

bind a data event (data-event-click="name"), the callback gets the element the event is on

◆ RmlUiCreateDataModel()

NEBULA_EXPORT void RmlUi::Api::RmlUiCreateDataModel ( const char * model)

create a data model, bind its variables before loading documents that use it

◆ RmlUiDirtyVariable()

NEBULA_EXPORT void RmlUi::Api::RmlUiDirtyVariable ( const char * model,
const char * name )

mark a data model variable dirty so views update

◆ RmlUiDocumentClose()

NEBULA_EXPORT void RmlUi::Api::RmlUiDocumentClose ( uint64_t document)

close a document, its elements become invalid

◆ RmlUiDocumentHide()

NEBULA_EXPORT void RmlUi::Api::RmlUiDocumentHide ( uint64_t document)

hide a document

◆ RmlUiDocumentShow()

NEBULA_EXPORT void RmlUi::Api::RmlUiDocumentShow ( uint64_t document)

show a document

◆ RmlUiElementAddEventListener()

NEBULA_EXPORT uint64_t RmlUi::Api::RmlUiElementAddEventListener ( uint64_t element,
const char * event,
EventCallback callback,
ReleaseCallback release,
intptr_t userData )

add a listener for an event ("click", "change", "mouseover"...)

◆ RmlUiElementFocus()

NEBULA_EXPORT bool RmlUi::Api::RmlUiElementFocus ( uint64_t element)

focus an element

◆ RmlUiElementGetAttribute()

NEBULA_EXPORT int RmlUi::Api::RmlUiElementGetAttribute ( uint64_t element,
const char * name,
char * buffer,
int bufferSize )

get an attribute as a string

◆ RmlUiElementGetDocument()

NEBULA_EXPORT uint64_t RmlUi::Api::RmlUiElementGetDocument ( uint64_t element)

get the document an element is in

◆ RmlUiElementGetElementById()

NEBULA_EXPORT uint64_t RmlUi::Api::RmlUiElementGetElementById ( uint64_t element,
const char * id )

find an element by id in the subtree of an element (or document), returns 0 if there is none

◆ RmlUiElementGetInnerRml()

NEBULA_EXPORT int RmlUi::Api::RmlUiElementGetInnerRml ( uint64_t element,
char * buffer,
int bufferSize )

get the element's inner RML

◆ RmlUiElementGetValue()

NEBULA_EXPORT int RmlUi::Api::RmlUiElementGetValue ( uint64_t element,
char * buffer,
int bufferSize )

get the value of a form control (input, select, textarea)

◆ RmlUiElementIsClassSet()

NEBULA_EXPORT bool RmlUi::Api::RmlUiElementIsClassSet ( uint64_t element,
const char * name )

check for a class

◆ RmlUiElementIsValid()

NEBULA_EXPORT bool RmlUi::Api::RmlUiElementIsValid ( uint64_t element)

check if a handle still refers to a live element

◆ RmlUiElementRemoveAttribute()

NEBULA_EXPORT void RmlUi::Api::RmlUiElementRemoveAttribute ( uint64_t element,
const char * name )

remove an attribute

◆ RmlUiElementRemoveProperty()

NEBULA_EXPORT void RmlUi::Api::RmlUiElementRemoveProperty ( uint64_t element,
const char * name )

remove a local RCSS property

◆ RmlUiElementSetAttribute()

NEBULA_EXPORT void RmlUi::Api::RmlUiElementSetAttribute ( uint64_t element,
const char * name,
const char * value )

set an attribute

◆ RmlUiElementSetClass()

NEBULA_EXPORT void RmlUi::Api::RmlUiElementSetClass ( uint64_t element,
const char * name,
bool active )

set or clear a class

◆ RmlUiElementSetInnerRml()

NEBULA_EXPORT void RmlUi::Api::RmlUiElementSetInnerRml ( uint64_t element,
const char * rml )

replace the element's content with RML

◆ RmlUiElementSetProperty()

NEBULA_EXPORT bool RmlUi::Api::RmlUiElementSetProperty ( uint64_t element,
const char * name,
const char * value )

set an RCSS property from its string form, returns false if it doesn't parse

◆ RmlUiElementSetValue()

NEBULA_EXPORT void RmlUi::Api::RmlUiElementSetValue ( uint64_t element,
const char * value )

set the value of a form control

◆ RmlUiIsActive()

NEBULA_EXPORT bool RmlUi::Api::RmlUiIsActive ( )

check if RmlUi is running. At shutdown it stops before scripts unload

◆ RmlUiLoadDocument()

NEBULA_EXPORT uint64_t RmlUi::Api::RmlUiLoadDocument ( const char * path)

load a document, hidden until shown, returns 0 on failure

◆ RmlUiLoadFontFace()

NEBULA_EXPORT bool RmlUi::Api::RmlUiLoadFontFace ( const char * path,
bool fallback )

load a font face (ttf, otf...)

◆ RmlUiRemoveDataModel()

NEBULA_EXPORT void RmlUi::Api::RmlUiRemoveDataModel ( const char * model)

remove a data model and its component bindings

◆ RmlUiRemoveEventListener()

NEBULA_EXPORT void RmlUi::Api::RmlUiRemoveEventListener ( uint64_t listenerId)

A listener whose element has been destroyed is already gone, removing it again does nothing.

remove a listener, which calls its release callback. Does nothing for a listener whose element is gone

◆ RmlUiSetDebuggerVisible()

NEBULA_EXPORT void RmlUi::Api::RmlUiSetDebuggerVisible ( bool visible)

show or hide the RmlUi debugger