G-Golf GObject low level API.
GObject — The base object type
g-object-class-install-property
g-object-class-find-property
g-object-class-list-properties
g-object-new
g-object-new-with-properties
g-object-ref
g-object-unref
g-object-ref-sink
g-object-ref-count
g-object-is-floating
g-object-add-toggle-ref
g-object-remove-toggle-ref
g-object-type
g-object-type-name
g-object-get-property
g-object-set-property
GObject
+— GBinding
+— GInitiallyUnowned
+— GTypeModule
GObject
is the fundamental type providing the common attributes
and methods for all object types in GTK+
, Pango
and other
libraries based on GObject. The GObject class provides methods for
object construction and destruction, property access methods, and signal
support.
Please read the GObject section from the GObject reference manual for a complete description.
Note: in this section, unless otherwise specified, the object
argument is [must be] a pointer to a GObject
(instance).
Returns nothing.
Installs a new property.
The arguments are g-class a (pointer to a) GObjectClass
),
p-id the id for the new property, and p-spec the (a pointer
to the) GParamSpec
for the new property.
All properties should be installed during the class initializer. It is possible to install properties after that, but doing so is not recommend, and specifically, is not guaranteed to be thread-safe vs. use of properties on the same type on other threads.
Note that it is possible to redefine a property in a derived class, by installing a property with the same name. This can be useful at times, e.g. to change the range of allowed values or the default value.
Returns a pointer or #f
.
Obtains and returns (a pointer to) the GParamSpec
for name,
or #f
if g-class (a pointer to a GObjectClass
)
doesn’t have a property of that name.
Returns two values.
Obtains and returns (1) the (possibly empty) list of GParamSpec pointers for g-class and (2) its length (the number of properties for g-class).
Returns a pointer.
Creates and returns a (pointer to) a new instance of a GObject subtype gtype. All properties are set to there default values.
Returns a pointer.
Creates and returns a (pointer to) a new instance of a GObject subtype
gtype. The other arguments are n-prop the number of
properties, names a pointer to an array of pointers to strings
with the names of each property to be set and values an array of
GValue
containing the values of each property to be set.
Properties that are not explicitly specified are set to there default values.
Returns a pointer.
Increases the reference count of object.
Returns nothing.
Decreases the reference count of object. When its reference count drops to 0, the object is finalized (i.e. its memory is freed).
Returns a pointer.
If object has a floating reference, then this call ‘assumes ownership’ of the floating reference, converting it to a normal reference by clearing the floating flag while leaving the reference count unchanged.
If object is not floating, then this call adds a new normal reference increasing the reference count by one.
Returns an integer.
Obtains and returns the (public GObject struct field) ref_count
value for object.
Returns #t
if object has a floating reference, otherwise it
returns #f
.
Returns nothing.
Increases the reference count of object by one and sets a callback, notify, to be called when all other references to object are dropped, or when this is already the last reference to object and another reference is established.
Please refer to the GObject g_object_add_toggle_ref documentation for a complete description.
Multiple toggle references may be added to the same gobject, however if there are multiple toggle references to an object, none of them will ever be notified until all but one are removed.
object is (a pointer to) a GObject, notify is a function to
call when this reference is the last reference to the object, or is no
longer the last reference, and data is (a pointer to) the data to
pass to notify. The data argument can be #f
.
Returns nothing.
Removes a reference added with g-object-add-toggle-ref. The reference count of object is decreased by one.
object is (a pointer to) a GObject, notify is a function to
call when this reference is the last reference to the object, or is no
longer the last reference, and data is (a pointer to) the data to
pass to notify. The data argument can be #f
.
Returns the GType (the type id) for object.
Returns the GType name for object.
Returns the property value for object.
The property argument is (must be) a pointer to a valid
GIPropertyInfo
(property must point to one of the
properties infos of the class of object). The g-type
argument must be a valid GType
value. If #f
, which is the
default, gi-property-g-type is called.
Returns value.
Sets the object property to value. The
property argument is (must be) a pointer to a valid
GIPropertyInfo
(property must point to one of the
properties infos of the class of object). The g-type
argument must be a valid GType
value. If #f
, which is the
default, gi-property-g-type is called.