Package: gobject

CStruct gobject:object-class

Declaration

(cffi:defcstruct object-class
  ;; Class type
  (type-class (:pointer (:struct type-class)))
  ;; Private
  (construct-properties :pointer)
  ;; Virtual functions
  (constructor :pointer)
  (set-property :pointer)
  (get-property :pointer)
  (dispose :pointer)
  (finalize :pointer)
  (dispatch-properties-changed :pointer)
  (notify :pointer)
  (constructed :pointer)
  ;; Private
  (pdummy :pointer :count 7))  

Values

type-class
The parent class.
constructor
The constructor function is called by the g:object-new constructor to complete the object initialization after all the construction properties are set. The first thing a constructor implementation must do is chain up to the constructor of the parent class. Overriding constructor should be rarely needed, for example, to handle construct properties, or to implement singletons.
set-property
The generic setter for all properties of this type. Should be overridden for every type with properties. If implementations of set-property do not emit property change notification explicitly, this will be done implicitly by the type system. However, if the notify signal is emitted explicitly, the type system will not emit it a second time.
get-property
The generic getter for all properties of this type. Should be overridden for every type with properties.
dispose
The dispose function is supposed to drop all references to other objects, but keep the instance otherwise intact, so that client method invocations still work. It may be run multiple times (due to reference loops). Before returning, dispose should chain up to the dispose method of the parent class.
finalize
Instance finalization function, should finish the finalization of the instance begun in dispose and chain up to the finalize method of the parent class.
dispatch-properties-changed
Emits property change notification for a bunch of properties. Overriding dispatch-properties-changed should be rarely needed.
notify
The class closure for the notify signal.
constructed
The constructed function is called by the g:object-new as the final step of the object creation process. At the point of the call, all construction properties have been set on the object. The purpose of this call is to allow for object initialisation steps that can only be performed after construction properties have been set. Implementors of the constructed virtual function should chain up to the constructed call of their parent class to allow it to complete its initialisation.

Details

The class structure for the g:object class.

Notes

The g:object-class structure is used internally to implement the Lisp API. The main purpose for the Lisp API user is to use the size of the g:object-class structure and the documentation to implement virtual function tables for subclasses of the g:object class.
 

See also

2025-10-04