libGimbal 0.1.0
C17-Based Extended Standard Library and Cross-Language Runtime Framework
Loading...
Searching...
No Matches
gimbal_object.h
Go to the documentation of this file.
1/*! \file
2 * \brief GblObject structure and related functions
3 * \ingroup meta
4 *
5 * This file contains the type definitions and API for
6 * GblObject and GblObjectClass. This is the instantiable
7 * type which provides the OO meat of the instantiable types--
8 * such as properties, hierarchial relationships, event management,
9 * generic construction, named instances, etc.
10 *
11 * \todo
12 * - Uninstall all signals upon class destructor (with property uninstallation)
13 * - Fix construction
14 * * initializer calls constructor? Wtf?
15 * - implement class property
16 * - Get rid of GblObject_findContext()
17 *
18 * \author 2023, 2024 Falco Girgis
19 * \copyright MIT License
20 */
21#ifndef GIMBAL_OBJECT_H
22#define GIMBAL_OBJECT_H
23
24#include "gimbal_box.h"
25#include "../ifaces/gimbal_itable_variant.h"
26#include "../ifaces/gimbal_ievent_handler.h"
27#include "../ifaces/gimbal_ievent_filter.h"
28#include "../properties/gimbal_property.h"
29
30/*! \name Type System
31 * \brief Type UUID and Cast operators
32 * @{
33 */
34#define GBL_OBJECT_TYPE (GBL_TYPEID(GblObject)) //!< GblType UUID for GblObject
35#define GBL_OBJECT(self) (GBL_CAST(GblObject, self)) //!< Casts a GblInstance to a GblObject
36#define GBL_OBJECT_CLASS(klass) (GBL_CLASS_CAST(GblObject, klass)) //!< Casts a GblClass to a GblObjectClass
37#define GBL_OBJECT_GET_CLASS(self) (GBL_CLASSOF(GblObject, self)) //!< Gets a GblObjectClass from a GblInstance
38//! @}
39
40/*! \brief DSL macro used to heap-construct a GblObject-derived type.
41 * It takes the struct name followed by an optional list of property KV pairs.
42 */
43#define GBL_NEW(/*type,*/ ...) GBL_OBJECT_NEW(__VA_ARGS__)
44/*! \brief DSL macro used to placement-construct a GblObject-derived type
45 * It takes the struct name followed by an optional list of property KV pairs.
46 */
47#define GBL_PLACEMENT_NEW(/*self, type,*/ ...) GBL_OBJECT_CONSTRUCT(__VA_ARGS__)
48
49#define GBL_SELF_TYPE GblObject
50
52
54
55/*! \struct GblObjectClass
56 * \extends GblBoxClass
57 * \implements GblITableVariantClass
58 * \implements GblIEventHandlerClass
59 * \implements GblIEventFilterClass
60 * \brief GblClass structure for GblObject
61 *
62 * GblObjectClass provides the virtual table for all types
63 * deriving from GblObject. It provides a constructor, event
64 * handlers, as well as accessors for reading and writing properties.
65 */
66GBL_CLASS_DERIVE(GblObject, GblBox,
67 GblITableVariant, GblIEventHandler, GblIEventFilter)
68 //! Virtual method called immediately during instance construction
69 GBL_RESULT (*pFnConstructor)(GBL_SELF);
70 //! Virtual method called during construction after CONSTRUCT properties but before extra WRITE properties are set
71 GBL_RESULT (*pFnConstructed)(GBL_SELF);
72 //! Virtual method for reading properties
73 GBL_RESULT (*pFnProperty) (GBL_CSELF, const GblProperty* pProp, GblVariant* pValue);
74 //! Virtaul method for writing properties
75 GBL_RESULT (*pFnSetProperty)(GBL_SELF, const GblProperty* pProp, GblVariant* pValue);
77
78/*! \class GblObject
79 * \extends GblBox
80 * \implements GblITableVariant
81 * \implements GblIEventHandler
82 * \implements GblIEventFilter
83 * \ingroup metaBuiltinTypes
84 * \brief Main Object-Oriented Instance with Properties, EventHandlers, and Parenting
85 *
86 * A GblObject is the default, full-blown object-oriented instantiable type.
87 * It is analogous to Qt's "QObject" or GNOME's "GObject" root type. It extends
88 * GblBox to add the following additonal functionality:
89 * - properties
90 * - GblVariant table operations
91 * - constructor / post-constructor
92 * - event handling and filtering
93 * - object parenting and hierarchy
94 * - object name
95 *
96 * \note
97 * A GblObject by default has the same size of a GblBox. Additional data for
98 * fields such as name, parent, children, event filters, etc are created lazily
99 * and are stored within GblBox::pFields.
100 *
101 * \sa GblBox, GblObjectClass, GblProperty
102 */
104
105//! \cond
106GBL_PROPERTIES(GblObject,
107 (name, GBL_GENERIC, (READ, WRITE, LOAD, SAVE), GBL_STRING_TYPE),
108 (parent, GBL_GENERIC, (READ, WRITE), GBL_OBJECT_TYPE),
109 (userdata, GBL_GENERIC, (READ, WRITE), GBL_POINTER_TYPE),
110 (refCount, GBL_GENERIC, (READ), GBL_UINT16_TYPE)
111// (class, GBL_GENERIC, (READ, WRITE, CONSTRUCT), GBL_POINTER_TYPE)
112)
113//! \endcond
114
115//! Returns the GblType UUID associated with GblObject
117
118/*! \name Constructors
119 * \brief Methods for constructing GblObject-derived types
120 * @{
121 */
122//! Creates an object-derived type on the heap, intializing it with a NULL-terminated K,V pair listing of properties
124//! Variant of GblObject_create(), where the object is created with an extended size
125GBL_EXPORT GblObject* GblObject_createExt (GblType type, size_t size, ...) GBL_NOEXCEPT;
126//! Constructs an object-derived type in-place, initializing it with a NULL-terminated K,V pair listing of properties
128//! Creates an object-derived type on the heap, with the given class, initializing it with a NULL-terminated K,V pair property list
129GBL_EXPORT GblObject* GblObject_createWithClass (GblObjectClass* pClass, ...) GBL_NOEXCEPT;
130//! Variant of GblObject_createWithClass(), where the object is created with an extended size
131GBL_EXPORT GblObject* GblObject_createExtWithClass (GblObjectClass* pClass, size_t size, ...) GBL_NOEXCEPT;
132//! Constructs an object-derived type in-place, with the given class, initializing it with a NULL-terminated K,V pair property list
133GBL_EXPORT GBL_RESULT GblObject_constructWithClass (GBL_SELF, GblObjectClass* pClass, ...) GBL_NOEXCEPT;
134//! Variant of GblObject_create(), where the property list is provided as a va_list pointer
135GBL_EXPORT GblObject* GblObject_createVaList (GblType type, va_list* pList) GBL_NOEXCEPT;
136//! Variant of GblObject_createVaList(), where the object is created with an extended size
137GBL_EXPORT GblObject* GblObject_createExtVaList (GblType type, size_t size, va_list* pList) GBL_NOEXCEPT;
138//! Variant of GblObject_construct(), where the property list is provided as a va_list pointer
140//! Variant of GblObject_createWithClass(), where the property list is provided as a va_list pointer
142 (GblObjectClass* pClass, va_list* pList) GBL_NOEXCEPT;
143//! Variant of GblObject_createVaListWithClass(), where the object is allocated with an extended size
145 (GblObjectClass* pClass,
146 size_t size,
147 va_list* pList) GBL_NOEXCEPT;
148//! Variant of GblObjecT_constructWithClass(), where the property list is provided as a va_list pointer
150 (GBL_SELF,
151 GblObjectClass* pClass,
152 va_list* pList) GBL_NOEXCEPT;
153//! Creates an object-derived type on the heap, initializing it with an array of property values and a corresponding array of names
155 size_t propertyCount,
156 const char* pNames[],
157 GblVariant* pValues) GBL_NOEXCEPT;
158//! Variant of GblObject_createVariants(), where the object is allocated with an extended size
160 size_t size,
161 size_t propertyCount,
162 const char* pNames[],
163 GblVariant* pValues) GBL_NOEXCEPT;
164//! Creates an object-derived type in-place, initiailzing it with an array of property values and a corresponding array of names
166 GblType type,
167 size_t propertyCount,
168 const char* pNames[],
169 GblVariant* pValues) GBL_NOEXCEPT;
170//! Variant of GblObject_createVariants(), where the object is constructed with a weak reference to the given class
172 (GblObjectClass* pClass,
173 size_t propertyCount,
174 const char* pNames[],
175 GblVariant* pValues) GBL_NOEXCEPT;
176//! Variant of GblObject_createVariantsWithClass(), where the object is allocated with an extended size
178 (GblObjectClass* pClass,
179 size_t size,
180 size_t propertyCount,
181 const char* pNames[],
182 GblVariant* pValues) GBL_NOEXCEPT;
183//! Variant of GblObject_constructVariants(), where the object is constructed with a weak reference to the given class
185 (GBL_SELF,
186 GblObjectClass* pClass,
187 size_t propertyCount,
188 const char* pNames[],
189 GblVariant* pValues) GBL_NOEXCEPT;
190//! @}
191
192/*! \name Property Accessors
193 * \brief Methods for reading and writing properties
194 * \relatesalso GblObject
195 * @{
196 */
197//! Looks up the property on the object by name, storing its value in the pointer passed as a variadic argument
198GBL_EXPORT GBL_RESULT GblObject_property (GBL_CSELF, const char* pName, ...) GBL_NOEXCEPT;
199//! Looks up the property on the object by quark (faster), storing its value in the pointer passed as a variadic argument
201//! Variant of GblObject_property() with the pointer for storing the value specified by a pointer to a va_list
202GBL_EXPORT GBL_RESULT GblObject_propertyVaList (GBL_CSELF, const char* pName, va_list* pList) GBL_NOEXCEPT;
203//! Variant of GblObject_propertyVaList() with the name being specified by a quark (faster lookups)
205 (GBL_CSELF, GblQuark name, va_list* pList) GBL_NOEXCEPT;
206//! Fetches the value of the specified property, storing it within a variant
207GBL_EXPORT GBL_RESULT GblObject_propertyVariant (GBL_CSELF, const char* pName, GblVariant* pValue) GBL_NOEXCEPT;
208//! Variant of GblObject_propertyVariant(), with the property name specified as a quark (faster lookups)
210 (GBL_CSELF, GblQuark name, GblVariant* pValue) GBL_NOEXCEPT;
211//! Takes a NULL-terminated K,V pair list of string property names and pointers to store their values within
213//! Variant of GblObject_properties() with the NULL-terminated K,V pair list being specified as a pointer to a va_list
215//! Looks up multiple properties by the names provided by the \p pNames list and stores them within the array of GblVariants
217 size_t count,
218 const char* pNames[],
219 GblVariant* pValue) GBL_NOEXCEPT;
220
221//! Sets the property with the given string name to the value given by the pointer passed through the variadic argument list
222GBL_EXPORT GBL_RESULT GblObject_setProperty (GBL_SELF, const char* pName, ...) GBL_NOEXCEPT;
223//! Variant of GblObject_setProperty() with the name being specified as a quark (for faster lookups)
225//! Variant of GblObject_setProperty() with the pointer for storing the value being specified as a pointer to a va_list
226GBL_EXPORT GBL_RESULT GblObject_setPropertyVaList (GBL_SELF, const char* pName, va_list* pList) GBL_NOEXCEPT;
227//! Variant of GblObject_setPropertyVaList() with the name being specified as a quark (for faster lookups)
229 (GBL_SELF, GblQuark name, va_list* pList) GBL_NOEXCEPT;
230//! Variant of GblObject_setProperty() where the property value is provided as a GblVariant
231GBL_EXPORT GBL_RESULT GblObject_setPropertyVariant (GBL_SELF, const char* pName, GblVariant* pValue) GBL_NOEXCEPT;
232//! Variant of GblObject_setPropertyVariant() where the property name is provided as a quark (for faster lookups)
234 (GBL_SELF, GblQuark name, GblVariant* pValue) GBL_NOEXCEPT;
235//! Sets multiple properties by taking a NULL-terminated K,V pairs list of string names and pointers to store the values within
237//! Variant of Gblobject_setProperties() where the NULL-termianted K,V pairs list is specified as apointer to a va_list
239//! Sets the properties specified by the list of names to the corresponding values specified as the list of GblVariants
241 (GBL_SELF,
242 size_t count,
243 const char* pNames[],
244 GblVariant* pValue) GBL_NOEXCEPT;
245//! @}
246
247/*! \name Name Accessors
248 * \brief Methods for reading and writing object name
249 * \relatesalso GblObject
250 * @{
251 */
252//! Retrieves the name of the given object or returns an empty string if it doesn't have one
254//! Sets the name of the given object to \p pName, making a copy of its contents to store internally
256//! Sets the name of the given object to \p pRef, taking ownership of the given reference
258//! @}
259
260/*! \name Hierarchy Management
261 * \brief Methods for parenting, traversing, or querying object trees
262 * \relatesalso GblObject
263 * @{
264 */
265//! Returns a poiner to the parent of the given object, or NULL if it doesn't have one
267//! Sets the parent of the given object to \p pParent
269//! Adds \p pChild as a child of the given object, setting itself as the parent
271//! Removes \p pChild from being a child of the given object, setting its parent to NULL
273//! Returns the number of levels deep the given object is in the object tree formed by its ancestors
275//! Returns a pointer to the first child of the given object or NULL if it has none
277//! Returns the number of children with the given object as their parent
279//! Returns the next sibling after the given object, forming a linked list of their parents' children
281//! Returns a pointer to the closest ancestor object of the given object that is of \p ancestorType or NULL if there isn't one
283//! Returns a pointer to the first ancestor found with the given name or NULL if none were found
285//! Returns a pointer to the ancestor object of the given object at the specified \p height, with 1 being the direct parent
287//! Starting at the root object, returns a pointer to the ancestor of the given object at the specified depth or NULL if there isn't one
289//! Searches through the list of children on the given object, returning a pointer to the first one with the given type or NULL if there isn't one
291//! Searches through the list of children on the given object, returning a pointer to the first one with the given name or NULL if there isn't one
293//! Iterates sequentially over the list of children on the given object, returning a pointer to the one at the given type, or NULL if there isn't one
295//! Iterates sequentially over the list of siblings to the given object, returning a pointer to the first one of the given type or NULL if there isn't one
297//! Iterates sequentially over the list of siblings to the given object, returning a poitner to the first one with the given name or NULL if there isn't one
299//! Iterates sequentially over thelist of siblings to the given object, returning a pointer to the one at the given index or NULL if there isn't one
301//! @}
302
303/*! \name Event Management
304 * \brief Methods for sending, notifying, and filtering events
305 * \relatesalso GblObject
306 * @{
307 */
308//! Emits an event upwards through the object hierarchy, notifying the parent of the given object of the event
310//! Notifies the given object of an event, which first propagates through its event filters before going through its event handler and propagating up if still unhandled
312//! Installs the event filter on the given object, allowing it to intercept event notifications
313GBL_EXPORT GBL_RESULT GblObject_installEventFilter (GBL_SELF, GblIEventFilter* pFilter) GBL_NOEXCEPT;
314//! Removes the event filter from the given object, so that it no longer intercepts event notifications
315GBL_EXPORT GBL_RESULT GblObject_uninstallEventFilter (GBL_SELF, GblIEventFilter* pFilter) GBL_NOEXCEPT;
316//! Returns the number of event filters currently installed on the given object
318//! Returns a pointer to the event filter installed on the given object at the \p index position
320//! @}
321
322//! \deprecated
324
326
327///\cond
328#define GBL_OBJECT_NEW(...) GBL_VA_OVERLOAD_CALL(GBL_OBJECT_NEW, GBL_VA_OVERLOAD_SUFFIXER_1_N, __VA_ARGS__)
329
330#define GBL_OBJECT_NEW_1(typeName) ((typeName*)GblObject_create(GBL_TYPEID(typeName), GBL_NULL))
331#define GBL_OBJECT_NEW_N(...) ((GBL_TUPLE_FIRST(__VA_ARGS__)*)GblObject_create(GBL_TYPEID(GBL_TUPLE_FIRST(__VA_ARGS__)),
332 GBL_TUPLE_REST(__VA_ARGS__), NULL))
333
334#define GBL_OBJECT_CONTRUCT(instance, cType, ...) (GblObject_construct(instance,GBL_TYPEID(cType), __VA_ARGS__, NULL))
335///\endcond
336
337#undef GBL_SELF_TYPE
338
339#endif // GIMBAL_OBJECT_H
#define GBL_CLASS_CAST(cType, klass)
#define GBL_NULL
#define GBL_NOEXCEPT
#define GBL_DECLS_BEGIN
#define GBL_FORWARD_DECLARE_STRUCT(S)
#define GBL_TYPEID(instanceStruct)
#define GBL_CLASS_DERIVE(...)
#define GBL_EXPORT
#define GBL_CLASS_END
#define GBL_INSTANCE_DERIVE_EMPTY(derived, base)
#define GBL_CLASSOF(cType, self)
#define GBL_CAST(cType, self)
#define GBL_VA_OVERLOAD_CALL(BASE, SUFFIXER,...)
#define GBL_TUPLE_REST(X,...)
#define GBL_TUPLE_FIRST(...)
#define GBL_VA_OVERLOAD_SUFFIXER_1_N(...)
GBL_RESULT GblObject_constructVaListWithClass(GblObject *pSelf, GblObjectClass *pClass, va_list *pList)
Variant of GblObjecT_constructWithClass(), where the property list is provided as a va_list pointer.
GblObject * GblObject_createVaList(GblType type, va_list *pList)
Variant of GblObject_create(), where the property list is provided as a va_list pointer.
GblObject * GblObject_createVariants(GblType type, size_t propertyCount, const char *pNames[], GblVariant *pValues)
Creates an object-derived type on the heap, initializing it with an array of property values and a co...
GblObject * GblObject_createExtVaList(GblType type, size_t size, va_list *pList)
Variant of GblObject_createVaList(), where the object is created with an extended size.
GBL_RESULT GblObject_constructWithClass(GblObject *pSelf, GblObjectClass *pClass,...)
Constructs an object-derived type in-place, with the given class, initializing it with a NULL-termina...
GblObject * GblObject_createVariantsWithClass(GblObjectClass *pClass, size_t propertyCount, const char *pNames[], GblVariant *pValues)
Variant of GblObject_createVariants(), where the object is constructed with a weak reference to the g...
GblObject * GblObject_createWithClass(GblObjectClass *pClass,...)
Creates an object-derived type on the heap, with the given class, initializing it with a NULL-termina...
GBL_RESULT GblObject_construct(GblObject *pSelf, GblType type,...)
Constructs an object-derived type in-place, initializing it with a NULL-terminated K,...
GblObject * GblObject_createVaListWithClass(GblObjectClass *pClass, va_list *pList)
Variant of GblObject_createWithClass(), where the property list is provided as a va_list pointer.
GBL_RESULT GblObject_constructVariantsWithClass(GblObject *pSelf, GblObjectClass *pClass, size_t propertyCount, const char *pNames[], GblVariant *pValues)
Variant of GblObject_constructVariants(), where the object is constructed with a weak reference to th...
GblType GblObject_type(void)
Returns the GblType UUID associated with GblObject.
GblObject * GblObject_createExt(GblType type, size_t size,...)
Variant of GblObject_create(), where the object is created with an extended size.
GblObject * GblObject_create(GblType type,...)
Creates an object-derived type on the heap, intializing it with a NULL-terminated K,...
GblObject * GblObject_createExtWithClass(GblObjectClass *pClass, size_t size,...)
Variant of GblObject_createWithClass(), where the object is created with an extended size.
GblObject * GblObject_createVariantsExt(GblType type, size_t size, size_t propertyCount, const char *pNames[], GblVariant *pValues)
Variant of GblObject_createVariants(), where the object is allocated with an extended size.
GBL_RESULT GblObject_constructVariants(GblObject *pSelf, GblType type, size_t propertyCount, const char *pNames[], GblVariant *pValues)
Creates an object-derived type in-place, initiailzing it with an array of property values and a corre...
#define GBL_OBJECT_TYPE
GblType UUID for GblObject.
GblObject * GblObject_createVariantsExtWithClass(GblObjectClass *pClass, size_t size, size_t propertyCount, const char *pNames[], GblVariant *pValues)
Variant of GblObject_createVariantsWithClass(), where the object is allocated with an extended size.
GBL_RESULT GblObject_constructVaList(GblObject *pSelf, GblType type, va_list *pList)
Variant of GblObject_construct(), where the property list is provided as a va_list pointer.
GblObject * GblObject_createExtVaListWithClass(GblObjectClass *pClass, size_t size, va_list *pList)
Variant of GblObject_createVaListWithClass(), where the object is allocated with an extended size.
#define GBL_UINT16_TYPE
Builtin ID for uint16_t GblVariant type.
#define GBL_STRING_TYPE
Builtin ID for string GblVariant type.
#define GBL_PROPERTIES(object,...)
Declares a list of properties for the given object/instance structure.
uint8_t GblBool
Basic boolean type, standardized to sizeof(char)
#define GBL_POINTER_TYPE
uintptr_t GblType
Meta Type UUID.
Definition gimbal_type.h:51
uintptr_t GblQuark
Uniquely identifiable interned string type.
const char GblStringRef
Reference-counted, const char*-compatible string type.
Main Object-Oriented Instance with Properties, EventHandlers, and Parenting.
void GblObject_addChild(GblObject *pSelf, GblObject *pChild)
Adds pChild as a child of the given object, setting itself as the parent.
GBL_RESULT GblObject_properties(const GblObject *pSelf,...)
Takes a NULL-terminated K,V pair list of string property names and pointers to store their values wit...
GblObject * GblObject_findBaseByDepth(const GblObject *pSelf, size_t depth)
Starting at the root object, returns a pointer to the ancestor of the given object at the specified d...
GblObject * GblObject_parent(const GblObject *pSelf)
Returns a poiner to the parent of the given object, or NULL if it doesn't have one.
GBL_RESULT GblObject_setPropertyVaList(GblObject *pSelf, const char *pName, va_list *pList)
Variant of GblObject_setProperty() with the pointer for storing the value being specified as a pointe...
size_t GblObject_depth(const GblObject *pSelf)
Returns the number of levels deep the given object is in the object tree formed by its ancestors.
GBL_RESULT GblObject_uninstallEventFilter(GblObject *pSelf, GblIEventFilter *pFilter)
Removes the event filter from the given object, so that it no longer intercepts event notifications.
GblObject * GblObject_findChildByIndex(const GblObject *pSelf, size_t index)
Iterates sequentially over the list of children on the given object, returning a pointer to the one a...
GblObject * GblObject_findSiblingByType(const GblObject *pSelf, GblType siblingType)
Iterates sequentially over the list of siblings to the given object, returning a pointer to the first...
void GblObject_setParent(GblObject *pSelf, GblObject *pParent)
Sets the parent of the given object to pParent.
GblObject * GblObject_findSiblingByName(const GblObject *pSelf, const char *pName)
Iterates sequentially over the list of siblings to the given object, returning a poitner to the first...
GBL_RESULT GblObject_propertyVaListByQuark(const GblObject *pSelf, GblQuark name, va_list *pList)
Variant of GblObject_propertyVaList() with the name being specified by a quark (faster lookups)
GblIEventFilter * GblObject_eventFilter(const GblObject *pSelf, size_t index)
Returns a pointer to the event filter installed on the given object at the index position.
GblObject * GblObject_findAncestorByType(const GblObject *pSelf, GblType ancestorType)
Returns a pointer to the closest ancestor object of the given object that is of ancestorType or NULL ...
GblObject * GblObject_siblingNext(const GblObject *pSelf)
Returns the next sibling after the given object, forming a linked list of their parents' children.
GBL_RESULT GblObject_property(const GblObject *pSelf, const char *pName,...)
Looks up the property on the object by name, storing its value in the pointer passed as a variadic ar...
GBL_RESULT GblObject_propertyVariant(const GblObject *pSelf, const char *pName, GblVariant *pValue)
Fetches the value of the specified property, storing it within a variant.
GBL_RESULT GblObject_setProperty(GblObject *pSelf, const char *pName,...)
Sets the property with the given string name to the value given by the pointer passed through the var...
GblBool GblObject_removeChild(GblObject *pSelf, GblObject *pChild)
Removes pChild from being a child of the given object, setting its parent to NULL.
GBL_RESULT GblObject_setPropertyVariant(GblObject *pSelf, const char *pName, GblVariant *pValue)
Variant of GblObject_setProperty() where the property value is provided as a GblVariant.
size_t GblObject_childCount(const GblObject *pSelf)
Returns the number of children with the given object as their parent.
void GblObject_setNameRef(GblObject *pSelf, const GblStringRef *pRef)
Sets the name of the given object to pRef, taking ownership of the given reference.
GBL_RESULT GblObject_setPropertiesVaList(GblObject *pSelf, va_list *pList)
Variant of Gblobject_setProperties() where the NULL-termianted K,V pairs list is specified as apointe...
GblObject * GblObject_findChildByType(const GblObject *pSelf, GblType childType)
Searches through the list of children on the given object, returning a pointer to the first one with ...
GBL_RESULT GblObject_propertyByQuark(const GblObject *pSelf, GblQuark name,...)
Looks up the property on the object by quark (faster), storing its value in the pointer passed as a v...
GblObject * GblObject_childFirst(const GblObject *pSelf)
Returns a pointer to the first child of the given object or NULL if it has none.
void GblObject_setName(GblObject *pSelf, const char *pName)
Sets the name of the given object to pName, making a copy of its contents to store internally.
const GblStringRef * GblObject_name(const GblObject *pSelf)
Retrieves the name of the given object or returns an empty string if it doesn't have one.
GBL_RESULT GblObject_propertyVaList(const GblObject *pSelf, const char *pName, va_list *pList)
Variant of GblObject_property() with the pointer for storing the value specified by a pointer to a va...
GBL_RESULT GblObject_propertiesVariants(const GblObject *pSelf, size_t count, const char *pNames[], GblVariant *pValue)
Looks up multiple properties by the names provided by the pNames list and stores them within the arra...
GBL_RESULT GblObject_sendEvent(GblObject *pSelf, GblEvent *pEvent)
Emits an event upwards through the object hierarchy, notifying the parent of the given object of the ...
GBL_RESULT GblObject_installEventFilter(GblObject *pSelf, GblIEventFilter *pFilter)
Installs the event filter on the given object, allowing it to intercept event notifications.
GblObject * GblObject_findSiblingByIndex(const GblObject *pSelf, size_t index)
Iterates sequentially over thelist of siblings to the given object, returning a pointer to the one at...
GBL_RESULT GblObject_setPropertyVaListByQuark(GblObject *pSelf, GblQuark name, va_list *pList)
Variant of GblObject_setPropertyVaList() with the name being specified as a quark (for faster lookups...
GblObject * GblObject_findAncestorByName(const GblObject *pSelf, const char *pName)
Returns a pointer to the first ancestor found with the given name or NULL if none were found.
size_t GblObject_eventFilterCount(const GblObject *pSelf)
Returns the number of event filters currently installed on the given object.
GblContext * GblObject_findContext(GblObject *pSelf)
GBL_RESULT GblObject_propertyVariantByQuark(const GblObject *pSelf, GblQuark name, GblVariant *pValue)
Variant of GblObject_propertyVariant(), with the property name specified as a quark (faster lookups)
GBL_RESULT GblObject_propertiesVaList(const GblObject *pSelf, va_list *pList)
Variant of GblObject_properties() with the NULL-terminated K,V pair list being specified as a pointer...
GBL_RESULT GblObject_setProperties(GblObject *pSelf,...)
Sets multiple properties by taking a NULL-terminated K,V pairs list of string names and pointers to s...
GBL_RESULT GblObject_setPropertyByQuark(GblObject *pSelf, GblQuark quark,...)
Variant of GblObject_setProperty() with the name being specified as a quark (for faster lookups)
GBL_RESULT GblObject_notifyEvent(GblObject *pSelf, GblEvent *pEvent)
Notifies the given object of an event, which first propagates through its event filters before going ...
GBL_RESULT GblObject_setPropertyVariantByQuark(GblObject *pSelf, GblQuark name, GblVariant *pValue)
Variant of GblObject_setPropertyVariant() where the property name is provided as a quark (for faster ...
GBL_RESULT GblObject_setPropertiesVariants(GblObject *pSelf, size_t count, const char *pNames[], GblVariant *pValue)
Sets the properties specified by the list of names to the corresponding values specified as the list ...
GblObject * GblObject_findAncestorByHeight(const GblObject *pSelf, size_t height)
Returns a pointer to the ancestor object of the given object at the specified height,...
GblObject * GblObject_findChildByName(const GblObject *pSelf, const char *pName)
Searches through the list of children on the given object, returning a pointer to the first one with ...