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:
Collaboration diagram for GblObject:

Data Fields

union { 
 
   GblObjectClass *   pClass 
 
   GblBox   base 
 
};  
 
- Data Fields inherited from GblInstance
GblClasspClass
 

Related Symbols

(Note that these are not member symbols.)

Reading Properties

Methods for retrieving property values.

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_propertyVaByQuark (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_propertiesVa (const GblObject *pSelf, va_list *pList)
 
GBL_RESULT GblObject_propertiesVariants (const GblObject *pSelf, size_t count, const char *pNames[], GblVariant *pValue)
 
Writing Properties

Methods for settingproperty values.

GBL_RESULT GblObject_setProperty (GblObject *pSelf, const char *pName,...)
 
GBL_RESULT GblObject_setPropertyByQuark (GblObject *pSelf, GblQuark quark,...)
 
GBL_RESULT GblObject_setPropertyVa (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_setPropertiesVa (GblObject *pSelf, va_list *pList)
 
GBL_RESULT GblObject_setPropertiesVariants (GblObject *pSelf, size_t count, const char *pNames[], GblVariant *pValue)
 
Property Notification

Methods involving property changed notifiers.

GBL_RESULT GblObject_emitPropertyChange (const GblObject *pSelf, const char *pName)
 
GBL_RESULT GblObject_emitPropertyChangeByQuark (const GblObject *pSelf, GblQuark name)
 
GblBool GblObject_blockPropertyChange (GblObject *pSelf, GblBool blocked)
 
GblBool GblObject_propertyChangeBlocked (const GblObject *pSelf)
 
State Management

Methods for querying GblObject state.

GblBool GblObject_isInstantiating (const GblObject *pSelf)
 
GblBool GblObject_isConstructing (const GblObject *pSelf)
 
Name Accessors

Methods for reading and writing object name

GblStringRefGblObject_name (const GblObject *pSelf)
 
void GblObject_setName (GblObject *pSelf, const char *pName)
 
void GblObject_setNameRef (GblObject *pSelf, 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)
 
size_t GblObject_childIndex (const GblObject *pSelf)
 
GblObjectGblObject_siblingNext (const GblObject *pSelf)
 
GblObjectGblObject_siblingNextByType (const GblObject *pSelf, GblType type)
 
GblObjectGblObject_siblingNextByName (const GblObject *pSelf, const char *pName)
 
GblObjectGblObject_siblingPrevious (const GblObject *pSelf)
 
GblObjectGblObject_siblingPreviousByType (const GblObject *pSelf, GblType type)
 
GblObjectGblObject_siblingPreviousByName (const GblObject *pSelf, const char *pName)
 
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, GblIEventReceiver *pFilter)
 
GBL_RESULT GblObject_uninstallEventFilter (GblObject *pSelf, GblIEventReceiver *pFilter)
 
size_t GblObject_eventFilterCount (const GblObject *pSelf)
 
GblIEventReceiver * GblObject_eventFilter (const GblObject *pSelf, size_t index)
 

Detailed Description

Main Object-Oriented Instance with Properties, EventReceivers, 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 115 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_propertyVaByQuark()

GBL_RESULT GblObject_propertyVaByQuark ( 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_propertiesVa()

GBL_RESULT GblObject_propertiesVa ( 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_setPropertyVa()

GBL_RESULT GblObject_setPropertyVa ( 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_setPropertiesVa()

GBL_RESULT GblObject_setPropertiesVa ( 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_emitPropertyChange()

GBL_RESULT GblObject_emitPropertyChange ( const GblObject * pSelf,
const char * pName )
related

Notifies any listeners that the value of a property has changed internally, by emitting the "propertyChanged" signal.

◆ GblObject_emitPropertyChangeByQuark()

GBL_RESULT GblObject_emitPropertyChangeByQuark ( const GblObject * pSelf,
GblQuark name )
related

Equivalent to GblObject_emitPropertyChange(), except that the property lookup is done more efficiently by using a quark for its name.

◆ GblObject_blockPropertyChange()

GblBool GblObject_blockPropertyChange ( GblObject * pSelf,
GblBool blocked )
related

Disables or enables emission of the "propertyChange" signal, returning its previous enablement. Typically you want to only do this temporarily and restore its previous state when done.

◆ GblObject_propertyChangeBlocked()

GblBool GblObject_propertyChangeBlocked ( const GblObject * pSelf)
related

Returns true if emission of the "propertyChange" signal has been blocked on the current object or false if it is enabled.

◆ GblObject_isInstantiating()

GblBool GblObject_isInstantiating ( const GblObject * pSelf)
related

Returns true from the time the object has been allocated to the time its final (possibly optional) initial properties have been set.

◆ GblObject_isConstructing()

GblBool GblObject_isConstructing ( const GblObject * pSelf)
related

Returns true immediately after type initializers are called, but before GblObject::pFnConstructed() is called with the initial constructor properties.

◆ GblObject_name()

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,
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_childIndex()

size_t GblObject_childIndex ( const GblObject * pSelf)
related

Returns the index of the given object in its parent's list of children.

◆ 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_siblingNextByType()

GblObject * GblObject_siblingNextByType ( const GblObject * pSelf,
GblType type )
related

Returns the next sibling after the given object that is of type, or NULL if there isn't one.

◆ GblObject_siblingNextByName()

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

Returns the next sibling after the given object with the given name, or NULL if there isn't one.

◆ GblObject_siblingPrevious()

GblObject * GblObject_siblingPrevious ( const GblObject * pSelf)
related

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

◆ GblObject_siblingPreviousByType()

GblObject * GblObject_siblingPreviousByType ( const GblObject * pSelf,
GblType type )
related

Returns the previous sibling before the given object that is of type, or NULL if there isn't one.

◆ GblObject_siblingPreviousByName()

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

Returns the previous sibling before the given object with the given name, or NULL if there isn't one.

◆ 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 pointer 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,
GblIEventReceiver * pFilter )
related

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

◆ GblObject_uninstallEventFilter()

GBL_RESULT GblObject_uninstallEventFilter ( GblObject * pSelf,
GblIEventReceiver * 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()

GblIEventReceiver * 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.

Field Documentation

◆ pClass

GblObjectClass* GblObject::pClass

Pointer to class/vtable structure.

Definition at line 115 of file gimbal_object.h.

◆ base

GblBox GblObject::base

Inherited base instance structure.

Definition at line 115 of file gimbal_object.h.


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