libGimbal 0.1.0
C17-Based Extended Standard Library and Cross-Language Runtime Framework
Loading...
Searching...
No Matches
GblObject Class Reference

#include <gimbal_object.h>

Inheritance diagram for GblObject:
GblBox GblITableVariant GblInstance GblApp GblArenaAllocator GblCmdParser GblContext GblException GblLogger GblMainLoop GblOptionGroup GblScanner GblSettings GblTask GblTestSuite GblThread

Data Fields

union { 
 
   GblObjectClass *   pClass 
 
   GblBox   base 
 
};  
 
- Data Fields inherited from GblBox
union { 
 
   GblBoxClass *   pClass 
 
   GblInstance   base 
 
};  
 
struct { 
 
   GblArrayMap *   pFields 
 
   volatile uint16_t   refCounter 
 
   uint16_t   contextType: 1 
 
   uint16_t   constructedInPlace: 1 
 
   uint16_t   derivedFlags: 14 
 
private_ 
 
- Data Fields inherited from GblInstance
GblClasspClass
 

Related Symbols

(Note that these are not member symbols.)

GblContextGblObject_findContext (GblObject *pSelf)
 
Property Accessors

Methods for reading and writing properties

GBL_RESULT GblObject_property (const GblObject *pSelf, const char *pName,...)
 
GBL_RESULT GblObject_propertyByQuark (const GblObject *pSelf, GblQuark name,...)
 
GBL_RESULT GblObject_propertyVaList (const GblObject *pSelf, const char *pName, va_list *pList)
 
GBL_RESULT GblObject_propertyVaListByQuark (const GblObject *pSelf, GblQuark name, va_list *pList)
 
GBL_RESULT GblObject_propertyVariant (const GblObject *pSelf, const char *pName, GblVariant *pValue)
 
GBL_RESULT GblObject_propertyVariantByQuark (const GblObject *pSelf, GblQuark name, GblVariant *pValue)
 
GBL_RESULT GblObject_properties (const GblObject *pSelf,...)
 
GBL_RESULT GblObject_propertiesVaList (const GblObject *pSelf, va_list *pList)
 
GBL_RESULT GblObject_propertiesVariants (const GblObject *pSelf, size_t count, const char *pNames[], GblVariant *pValue)
 
GBL_RESULT GblObject_setProperty (GblObject *pSelf, const char *pName,...)
 
GBL_RESULT GblObject_setPropertyByQuark (GblObject *pSelf, GblQuark quark,...)
 
GBL_RESULT GblObject_setPropertyVaList (GblObject *pSelf, const char *pName, va_list *pList)
 
GBL_RESULT GblObject_setPropertyVaListByQuark (GblObject *pSelf, GblQuark name, va_list *pList)
 
GBL_RESULT GblObject_setPropertyVariant (GblObject *pSelf, const char *pName, GblVariant *pValue)
 
GBL_RESULT GblObject_setPropertyVariantByQuark (GblObject *pSelf, GblQuark name, GblVariant *pValue)
 
GBL_RESULT GblObject_setProperties (GblObject *pSelf,...)
 
GBL_RESULT GblObject_setPropertiesVaList (GblObject *pSelf, va_list *pList)
 
GBL_RESULT GblObject_setPropertiesVariants (GblObject *pSelf, size_t count, const char *pNames[], GblVariant *pValue)
 
Name Accessors

Methods for reading and writing object name

const GblStringRefGblObject_name (const GblObject *pSelf)
 
void GblObject_setName (GblObject *pSelf, const char *pName)
 
void GblObject_setNameRef (GblObject *pSelf, const GblStringRef *pRef)
 
Hierarchy Management

Methods for parenting, traversing, or querying object trees

GblObjectGblObject_parent (const GblObject *pSelf)
 
void GblObject_setParent (GblObject *pSelf, GblObject *pParent)
 
void GblObject_addChild (GblObject *pSelf, GblObject *pChild)
 
GblBool GblObject_removeChild (GblObject *pSelf, GblObject *pChild)
 
size_t GblObject_depth (const GblObject *pSelf)
 
GblObjectGblObject_childFirst (const GblObject *pSelf)
 
size_t GblObject_childCount (const GblObject *pSelf)
 
GblObjectGblObject_siblingNext (const GblObject *pSelf)
 
GblObjectGblObject_findAncestorByType (const GblObject *pSelf, GblType ancestorType)
 
GblObjectGblObject_findAncestorByName (const GblObject *pSelf, const char *pName)
 
GblObjectGblObject_findAncestorByHeight (const GblObject *pSelf, size_t height)
 
GblObjectGblObject_findBaseByDepth (const GblObject *pSelf, size_t depth)
 
GblObjectGblObject_findChildByType (const GblObject *pSelf, GblType childType)
 
GblObjectGblObject_findChildByName (const GblObject *pSelf, const char *pName)
 
GblObjectGblObject_findChildByIndex (const GblObject *pSelf, size_t index)
 
GblObjectGblObject_findSiblingByType (const GblObject *pSelf, GblType siblingType)
 
GblObjectGblObject_findSiblingByName (const GblObject *pSelf, const char *pName)
 
GblObjectGblObject_findSiblingByIndex (const GblObject *pSelf, size_t index)
 
Event Management

Methods for sending, notifying, and filtering events

GBL_RESULT GblObject_sendEvent (GblObject *pSelf, GblEvent *pEvent)
 
GBL_RESULT GblObject_notifyEvent (GblObject *pSelf, GblEvent *pEvent)
 
GBL_RESULT GblObject_installEventFilter (GblObject *pSelf, GblIEventFilter *pFilter)
 
GBL_RESULT GblObject_uninstallEventFilter (GblObject *pSelf, GblIEventFilter *pFilter)
 
size_t GblObject_eventFilterCount (const GblObject *pSelf)
 
GblIEventFilter * GblObject_eventFilter (const GblObject *pSelf, size_t index)
 

Detailed Description

Main Object-Oriented Instance with Properties, EventHandlers, and Parenting.

A GblObject is the default, full-blown object-oriented instantiable type. It is analogous to Qt's "QObject" or GNOME's "GObject" root type. It extends GblBox to add the following additonal functionality:

  • properties
  • GblVariant table operations
  • constructor / post-constructor
  • event handling and filtering
  • object parenting and hierarchy
  • object name
Note
A GblObject by default has the same size of a GblBox. Additional data for fields such as name, parent, children, event filters, etc are created lazily and are stored within GblBox::pFields.
See also
GblBox, GblObjectClass, GblProperty

Definition at line 103 of file gimbal_object.h.

Friends And Related Symbol Documentation

◆ GblObject_property()

GBL_RESULT GblObject_property ( const GblObject pSelf,
const char *  pName,
  ... 
)
related

Looks up the property on the object by name, storing its value in the pointer passed as a variadic argument.

◆ GblObject_propertyByQuark()

GBL_RESULT GblObject_propertyByQuark ( const GblObject pSelf,
GblQuark  name,
  ... 
)
related

Looks up the property on the object by quark (faster), storing its value in the pointer passed as a variadic argument.

◆ GblObject_propertyVaList()

GBL_RESULT GblObject_propertyVaList ( const GblObject pSelf,
const char *  pName,
va_list *  pList 
)
related

Variant of GblObject_property() with the pointer for storing the value specified by a pointer to a va_list.

◆ GblObject_propertyVaListByQuark()

GBL_RESULT GblObject_propertyVaListByQuark ( const GblObject pSelf,
GblQuark  name,
va_list *  pList 
)
related

Variant of GblObject_propertyVaList() with the name being specified by a quark (faster lookups)

◆ GblObject_propertyVariant()

GBL_RESULT GblObject_propertyVariant ( const GblObject pSelf,
const char *  pName,
GblVariant pValue 
)
related

Fetches the value of the specified property, storing it within a variant.

◆ GblObject_propertyVariantByQuark()

GBL_RESULT GblObject_propertyVariantByQuark ( const GblObject pSelf,
GblQuark  name,
GblVariant pValue 
)
related

Variant of GblObject_propertyVariant(), with the property name specified as a quark (faster lookups)

◆ GblObject_properties()

GBL_RESULT GblObject_properties ( const GblObject pSelf,
  ... 
)
related

Takes a NULL-terminated K,V pair list of string property names and pointers to store their values within.

◆ GblObject_propertiesVaList()

GBL_RESULT GblObject_propertiesVaList ( const GblObject pSelf,
va_list *  pList 
)
related

Variant of GblObject_properties() with the NULL-terminated K,V pair list being specified as a pointer to a va_list.

◆ GblObject_propertiesVariants()

GBL_RESULT GblObject_propertiesVariants ( const GblObject pSelf,
size_t  count,
const char *  pNames[],
GblVariant pValue 
)
related

Looks up multiple properties by the names provided by the pNames list and stores them within the array of GblVariants.

◆ GblObject_setProperty()

GBL_RESULT GblObject_setProperty ( GblObject pSelf,
const char *  pName,
  ... 
)
related

Sets the property with the given string name to the value given by the pointer passed through the variadic argument list.

◆ GblObject_setPropertyByQuark()

GBL_RESULT GblObject_setPropertyByQuark ( GblObject pSelf,
GblQuark  quark,
  ... 
)
related

Variant of GblObject_setProperty() with the name being specified as a quark (for faster lookups)

◆ GblObject_setPropertyVaList()

GBL_RESULT GblObject_setPropertyVaList ( GblObject pSelf,
const char *  pName,
va_list *  pList 
)
related

Variant of GblObject_setProperty() with the pointer for storing the value being specified as a pointer to a va_list.

◆ GblObject_setPropertyVaListByQuark()

GBL_RESULT GblObject_setPropertyVaListByQuark ( GblObject pSelf,
GblQuark  name,
va_list *  pList 
)
related

Variant of GblObject_setPropertyVaList() with the name being specified as a quark (for faster lookups)

◆ GblObject_setPropertyVariant()

GBL_RESULT GblObject_setPropertyVariant ( GblObject pSelf,
const char *  pName,
GblVariant pValue 
)
related

Variant of GblObject_setProperty() where the property value is provided as a GblVariant.

◆ GblObject_setPropertyVariantByQuark()

GBL_RESULT GblObject_setPropertyVariantByQuark ( GblObject pSelf,
GblQuark  name,
GblVariant pValue 
)
related

Variant of GblObject_setPropertyVariant() where the property name is provided as a quark (for faster lookups)

◆ GblObject_setProperties()

GBL_RESULT GblObject_setProperties ( GblObject pSelf,
  ... 
)
related

Sets multiple properties by taking a NULL-terminated K,V pairs list of string names and pointers to store the values within.

◆ GblObject_setPropertiesVaList()

GBL_RESULT GblObject_setPropertiesVaList ( GblObject pSelf,
va_list *  pList 
)
related

Variant of Gblobject_setProperties() where the NULL-termianted K,V pairs list is specified as apointer to a va_list.

◆ GblObject_setPropertiesVariants()

GBL_RESULT GblObject_setPropertiesVariants ( GblObject pSelf,
size_t  count,
const char *  pNames[],
GblVariant pValue 
)
related

Sets the properties specified by the list of names to the corresponding values specified as the list of GblVariants.

◆ GblObject_name()

const GblStringRef * GblObject_name ( const GblObject pSelf)
related

Retrieves the name of the given object or returns an empty string if it doesn't have one.

◆ GblObject_setName()

void GblObject_setName ( GblObject pSelf,
const char *  pName 
)
related

Sets the name of the given object to pName, making a copy of its contents to store internally.

◆ GblObject_setNameRef()

void GblObject_setNameRef ( GblObject pSelf,
const GblStringRef pRef 
)
related

Sets the name of the given object to pRef, taking ownership of the given reference.

◆ GblObject_parent()

GblObject * GblObject_parent ( const GblObject pSelf)
related

Returns a poiner to the parent of the given object, or NULL if it doesn't have one.

◆ GblObject_setParent()

void GblObject_setParent ( GblObject pSelf,
GblObject pParent 
)
related

Sets the parent of the given object to pParent.

◆ GblObject_addChild()

void GblObject_addChild ( GblObject pSelf,
GblObject pChild 
)
related

Adds pChild as a child of the given object, setting itself as the parent.

◆ GblObject_removeChild()

GblBool GblObject_removeChild ( GblObject pSelf,
GblObject pChild 
)
related

Removes pChild from being a child of the given object, setting its parent to NULL.

◆ GblObject_depth()

size_t GblObject_depth ( const GblObject pSelf)
related

Returns the number of levels deep the given object is in the object tree formed by its ancestors.

◆ GblObject_childFirst()

GblObject * GblObject_childFirst ( const GblObject pSelf)
related

Returns a pointer to the first child of the given object or NULL if it has none.

◆ GblObject_childCount()

size_t GblObject_childCount ( const GblObject pSelf)
related

Returns the number of children with the given object as their parent.

◆ GblObject_siblingNext()

GblObject * GblObject_siblingNext ( const GblObject pSelf)
related

Returns the next sibling after the given object, forming a linked list of their parents' children.

◆ GblObject_findAncestorByType()

GblObject * GblObject_findAncestorByType ( const GblObject pSelf,
GblType  ancestorType 
)
related

Returns a pointer to the closest ancestor object of the given object that is of ancestorType or NULL if there isn't one.

◆ GblObject_findAncestorByName()

GblObject * GblObject_findAncestorByName ( const GblObject pSelf,
const char *  pName 
)
related

Returns a pointer to the first ancestor found with the given name or NULL if none were found.

◆ GblObject_findAncestorByHeight()

GblObject * GblObject_findAncestorByHeight ( const GblObject pSelf,
size_t  height 
)
related

Returns a pointer to the ancestor object of the given object at the specified height, with 1 being the direct parent.

◆ GblObject_findBaseByDepth()

GblObject * GblObject_findBaseByDepth ( const GblObject pSelf,
size_t  depth 
)
related

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.

◆ GblObject_findChildByType()

GblObject * GblObject_findChildByType ( const GblObject pSelf,
GblType  childType 
)
related

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.

◆ GblObject_findChildByName()

GblObject * GblObject_findChildByName ( const GblObject pSelf,
const char *  pName 
)
related

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.

◆ GblObject_findChildByIndex()

GblObject * GblObject_findChildByIndex ( const GblObject pSelf,
size_t  index 
)
related

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.

◆ GblObject_findSiblingByType()

GblObject * GblObject_findSiblingByType ( const GblObject pSelf,
GblType  siblingType 
)
related

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.

◆ GblObject_findSiblingByName()

GblObject * GblObject_findSiblingByName ( const GblObject pSelf,
const char *  pName 
)
related

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.

◆ GblObject_findSiblingByIndex()

GblObject * GblObject_findSiblingByIndex ( const GblObject pSelf,
size_t  index 
)
related

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.

◆ GblObject_sendEvent()

GBL_RESULT GblObject_sendEvent ( GblObject pSelf,
GblEvent pEvent 
)
related

Emits an event upwards through the object hierarchy, notifying the parent of the given object of the event.

◆ GblObject_notifyEvent()

GBL_RESULT GblObject_notifyEvent ( GblObject pSelf,
GblEvent pEvent 
)
related

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.

◆ GblObject_installEventFilter()

GBL_RESULT GblObject_installEventFilter ( GblObject pSelf,
GblIEventFilter *  pFilter 
)
related

Installs the event filter on the given object, allowing it to intercept event notifications.

◆ GblObject_uninstallEventFilter()

GBL_RESULT GblObject_uninstallEventFilter ( GblObject pSelf,
GblIEventFilter *  pFilter 
)
related

Removes the event filter from the given object, so that it no longer intercepts event notifications.

◆ GblObject_eventFilterCount()

size_t GblObject_eventFilterCount ( const GblObject pSelf)
related

Returns the number of event filters currently installed on the given object.

◆ GblObject_eventFilter()

GblIEventFilter * GblObject_eventFilter ( const GblObject pSelf,
size_t  index 
)
related

Returns a pointer to the event filter installed on the given object at the index position.

◆ GblObject_findContext()

GblContext * GblObject_findContext ( GblObject pSelf)
related

Field Documentation

◆ pClass

GblObjectClass* GblObject::pClass

Pointer to class/vtable structure.

Definition at line 103 of file gimbal_object.h.

◆ base

GblBox GblObject::base

Inherited base instance structure.

Definition at line 103 of file gimbal_object.h.


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