Up: cl-cffi-gtk4 API documentation

Package gobject

GObject provides the object system used for Pango and GTK. This is the API documentation of a Lisp binding to GObject.

About This Package

Type Information
Various types and functions
Generic Values
Parameters and Values
GObject
Signals
GBinding

Type Information


Introduction to type information

The GType API is the foundation of the GObject system. It provides the facilities for registering and managing all fundamental data types, user-defined objects and interface types.

For type creation and registration purposes, all types fall into one of two categories: static or dynamic. Static types are never loaded or unloaded at run-time as dynamic types may be. Static types are created with the function g_type_register_static() that gets type specific information passed in via a GTypeInfo structure. Dynamic types are created with the function g_type_register_dynamic() which takes a GTypePlugin structure instead. The remaining type information (the GTypeInfo structure) is retrieved during runtime through the GTypePlugin structure and the g_type_plugin_*() API. These registration functions are usually called only once from a function whose only purpose is to return the type identifier for a specific class. Once the type (or class or interface) is registered, it may be instantiated, inherited, or implemented depending on exactly what sort of type it is. There is also a third registration function for registering fundamental types called g_type_register_fundamental() which requires both a GTypeInfo structure and a GTypeFundamentalInfo structure but it is seldom used since most fundamental types are predefined rather than user-defined.

Type instance and class structures are limited to a total of 64 KiB, including all parent types. Similarly, type instances' private data (as created by the function g_type_class_add_private()) are limited to a total of 64 KiB. If a type instance needs a large static buffer, allocate it separately (typically by using a GArray or GPtrArray structure) and put a pointer to the buffer in the structure.

A final word about type names. Such an identifier needs to be at least three characters long. There is no upper length limit. The first character needs to be a letter (a-z or A-Z) or an underscore '_'. Subsequent characters can be letters, numbers or any of '-_+'.

Types and functions for type information

The g:type-t type specifier represents the unique GType identifier of a registered type. ...

The g:gtype structure represents the unique identifier of a registered foreign GType type on the Lisp side. ...

Returns the name of the GType type. ...

Returns the unique identifier for the GType type. ...

Returns a g:gtype instance for thing. ...

Returns the Lisp symbol for the given name-or-gtype argument. ...

An opaque structure used as the base of all classes. ...

An opaque structure used as the base of all interface types. ...

An opaque structure used as the base of all type instances. ...

Checks if gtype is an abstract type. ...

Checks if gtype is derived or in object oriented terminology inherited from another type. ...

Checks if gtype is a fundamental type. ...

Checks if gtype is a value type and can be used with the g:value-init function. ...

Checks if gtype is a classed type. ...

Checks if gtype is an interface type. ...

Gets the type identifier from a given instance. ...

Gets the type identifier from a given class instance. ...

Gets the type identifier from a given interface instance. ...

Get the class structure of a given instance. ...

Checks if instance is an instance of the type identified by gtype or derived. ...

Checks if class is a class structure of the type identified by gtype or derived. ...

Get the unique name that is assigned to a type ID. ...

Returns the direct parent type of the passed in gtype. ...

Returns a list of type IDs, listing the child types of gtype. ...

Returns the length of the ancestry of the passed in gtype. ...

Given a leaf and a root which is contained in its anchestry, return the type that root is the immediate parent of. ...

If the is-a-type argument is a derivable type, check whether the gtype argument is a descendant of is-a-type. ...

Increments the reference count of the class instance belonging to gtype and returns the pointer to the class instance. ...

This function is essentially the same as the g:type-class-ref function, except that the classes reference count is not incremented. ...

Decrements the reference count of the class instance being passed in. ...

This is a convenience function often needed in class initializers. It returns the class intance of the immediate parent type of the class passed in. ...

Returns the interface structure of an interface to which the passed in class conforms. ...

Increments the reference count for the interface type, and returns the default interface vtable for the type. ...

If the interface type gtype is currently in use, returns its default interface vtable. ...

Decrements the reference count for the type corresponding to the interface default vtable of iface. ...

Returns a list of type IDs, listing the interface types that gtype conforms to. ...

Returns the prerequisites of an interfaces type. ...

The g:type-qdata function obtains data which has previously been attached to gtype with the (setf g:type-qdata) function. ...

The fundamental type which is the ancestor of the gtype argument. ...

Ensures that the indicated gtype has been registered with the type system, and its initializer method has been run. ...

Various types and functions


Introduction to enumeration and Flag Types

The GLib type system provides fundamental types for enumeration and flags types. Flags types are like enumerations, but allow their values to be combined by bitwise OR. A registered enumeration or flags type associates a name and a nickname with each allowed value. When an enumeration or flags type is registered with the GLib type system, it can be used as value type for object properties, using the g:param-spec-enum or g:param-spec-flags functions.

Types and functions for enumeration and flags types

The class of an enumeration type holds information about its possible values. ...

A structure which contains a single enum value, its name, and its nickname. ...

Checks whether gtype is a "GEnum" type. ...

The class of a flags type holds information about its possible values. ...

A structure which contains a single flags value, its name, and its nickname. ...

Checks whether type is a "GFlags" type. ...


Introduction to boxed types

A mechanism to wrap opaque C structures registered by the type system

GBoxed is a generic wrapper mechanism for arbitrary C structures. The only thing the type system needs to know about the structures is how to copy and free them, beyond that they are treated as opaque chunks of memory.

Boxed types are useful for simple value-holder structures like rectangles or points. They can also be used for wrapping structures defined in non-GObject based libraries. They allow arbitrary structures to be handled in a uniform way, allowing uniform copying (or referencing) and freeing (or unreferencing) of them, and uniform representation of the type of the contained structure. In turn, this allows any type which can be boxed to be set as the data in a GValue, which allows for polymorphic handling of a much wider range of data types, and hence usage of such types as GObject property values.

GBoxed is designed so that reference counted types can be boxed. Use the type’s ‘ref’ function as the GBoxedCopyFunc, and its ‘unref’ function as the GBoxedFreeFunc. For example, for GBytes, the GBoxedCopyFunc is g_bytes_ref(), and the GBoxedFreeFunc is g_bytes_unref().

Functions for boxed types

Checks whether gtype is a "GBoxed" type. ...

Generic Values

The g:value structure is a variable container that consists of a type identifier and a specific value of that type. ...

The g:with-value macro allocates a new g:value instance, initializes it with the given values and executes the body that uses gvalue. ...

The g:with-values macro creates new variable bindings and executes the body that use these bindings. ...

Checks if gvalue holds or contains a value of gtype type. ...

Get the type identifier of gvalue. ...

Gets the the type name of gvalue. ...

Checks whether the passed in gtype ID can be used for the g:value-init function. ...

Sets gvalue to zero and initializes it with the gtype type. ...

Copies the value of src into dest. ...

Clears the current value in gvalue and resets it to the default value as if the value had just been initialized. ...

Clears the current value in gvalue and "unsets" the type, this releases all resources associated with this gvalue instance. ...

The g:value-get function parses the g:value instance and returns the corresponding Lisp value. ...

The g:value-set function initializes the g:value instance and sets the value. ...

Returns whether a g:value instance of type src can be copied into a g:value instance of type dest. ...

Return a string, which describes the contents of a g:value instance. ...

Parameters and Values


Introduction to parameters and values

Standard Parameter and Value Types

GValue provides an abstract container structure which can be copied, transformed and compared while holding a value of any (derived) type, which is registered as a GType with a GTypeValueTable in its GTypeInfo structure. Parameter specifications for most value types can be created as GParamSpec derived instances, to implement, for example, GObject properties which operate on GValue containers.

Parameter names need to start with a letter (a-z or A-Z). Subsequent characters can be letters, numbers or a '-'. All other characters are replaced by a '-' during construction.

Functions for GParamSpec

Through the g:param-flags flag values, certain aspects of parameters can be configured. ...

The g:param-spec structure is an object structure that encapsulates the metadata required to specify parameters, such as, for example g:object properties. ...

Checks whether gtype is a "GParam" type. ...

Checks whether pspec is a valid g:param-spec instance of "GParam" type or derived. ...

Retrieves the g:type-t type ID of pspec. ...

Retrieves the g:type-t type ID name of pspec. ...

Retrieves the g:type-t type ID to initialize a g:value instance for this parameter. ...

Increments the reference count of pspec. ...

Decrements the reference count of a pspec. ...

Convenience function to ref and sink a g:param-spec instance. ...

Gets the default value of pspec as a g:value instance. ...

Sets value to its default value as specified in pspec. ...

Checks whether value contains the default value as specified in pspec. ...

Ensures that the contents of value comply with the specifications set out by pspec. ...

Gets the name of a g:param-spec instance. ...

Get the nickname of a g:param-spec instance. ...

Gets the short description of a g:param-spec instance. ...

Creates a new parameter specification instance. ...


Types and functions for parameters and values

The g:param-spec derived structure that contains the meta data for boolean properties. ...

Creates a new parameter specification instance specifying a property of "gboolean" type. ...

The g:value-boolean function gets the contents of a g:value instance of "gboolean" type. ...

The g:param-spec derived structure that contains the meta data for character properties. ...

Creates a new parameter specification instance specifying a property of "gchar" type. ...

The g:value-char function gets the contents of a g:value instance of "gchar" type. ...

The g:value-schar function gets the contents of a g:value of "gchar" type. ...

The g:param-spec derived structure that contains the meta data for unsigned character properties. ...

Creates a new parameter specification instance specifying a property of "guchar" type. ...

The g:value-uchar function gets the contents of a g:value instance of "guchar" type. ...

A g:param-spec derived structure that contains the meta data for integer properties. ...

Creates a new parameter specification instance specifying a property of "gint" type. ...

Integer contents of gvalue. ...

A g:param-spec derived structure that contains the meta data for unsigned integer properties. ...

Creates a new parameter specificaton instance specifying a property of "guint" type. ...

Unsigned integer contents of gvalue. ...

A g:param-spec derived structure that contains the meta data for long integer properties. ...

Creates a new parameter specification instance specifying a property of "glong" type. ...

Long integer contents of gvalue. ...

A g:param-spec derived structure that contains the meta data for unsigned long integer properties. ...

Creates a new parameter specification instance specifying a property of "gulong" type. ...

Unsigned long integer contents of gvalue. ...

A g:param-spec derived structure that contains the meta data for 64 bit integer properties. ...

Creates a new parameter specification instance specifying a property of "gint64" type. ...

The 64-bit integer contents of gvalue. ...

A g:param-spec derived structure that contains the meta data for unsigned 64 bit integer properties. ...

Creates a new parameter specification instance specifying a property of "guint64" type. ...

Unsigned 64-bit integer contents of gvalue. ...

A g:param-spec derived structure that contains the meta data for float properties. ...

Creates a new parameter specification instance specifying a property of "gfloat" type. ...

Float contents of gvalue. ...

A g:param-spec derived structure that contains the meta data for double properties. ...

Creates a new parameter specification instance specifying a property of "gdouble" type. ...

Double float contents of gvalue. ...

A g:param-spec derived structure that contains the meta data for enum properties. ...

Creates a new parameter specification instance specifying a property of "GEnum" type. ...

Enumeration value contents of gvalue. ...

A g:param-spec derived structure that contains the meta data for flags properties. ...

Creates a new parameter specification instance specifying a property of "GFlags" type. ...

Flags contents of gvalue. ...

A g:param-spec derived structure that contains the meta data for string properties. ...

Creates a new parameter specification instance specifying a property of "gchararray" type. ...

String content of gvalue. ...

A g:param-spec derived structure that contains the meta data for properties of "GParam" type. ...

Creates a new parameter specification instance specifying a property of "GParam" type. ...

The g:param-spec content of gvalue. ...

A g:param-spec derived structure that contains the meta data for boxed properties. ...

Creates a new parameter specification instance specifying a property derived of "GBoxed" type. ...

Boxed contents of gvalue. ...

Sets the contents of a g:value instance of "GBoxed" type to value. ...

A g:param-spec derived structure that contains the meta data for pointer properties. ...

Creates a new parameter specification instance specifying a property of "gpointer" type. ...

Pointer contents of gvalue. ...

A g:param-spec derived structure that contains the meta data for object properties. ...

Creates a new parameter specification instance specifying a property of a "GObject" dervived type. ...

Object contents of gvalue. ...

A g:param-spec derived structure that contains the meta data for g:type-t type ID properties. ...

Creates a new parameter specification instance specifying a "GType" property. ...

The g:value-gtype function gets the contents of a g:type-t type ID value. ...

Variant contents of gvalue. ...

GObject

The g:object class is the fundamental type providing the common attributes and methods for all object types in GTK, Pango and other libraries. ...

Accessor of the has-reference slot of the g:object class. ...

Accessor of the pointer slot of the g:object class. ...

Checks if the passed in type ID is a "GObject" type or derived from it. ...

Checks whether the object argument is of "GObject" type or derived from it. ...

Looks up the g:param-spec instance for a property of an object class type. ...

Gets a list of g:param-spec instances for all properties of an object class type. ...

Find the g:param-spec instance with the given property name for an interface type. ...

Lists the properties of an interface type. ...

Creates a new instance of a g:object subtype and sets its properties. ...

Increases the reference count of object. ...

Returns the reference count of the object. ...

Decreases the reference count of object. ...

Emits a "notify" signal for the property on the object. ...

Increases the freeze count on the object. ...

Reverts the effect of a previous call to the g:object-freeze-notify function. ...

Each object carries around a table of associations from strings to pointers. ...

Specifies the type of function which is called when a data element is destroyed. ...

Like the g:object-data function except it adds notification for when the association is destroyed, either by setting it to a different value or when the object is destroyed. ...

Accessor of the property of an object. ...

Signals


Introduction to signals

The basic concept of the signal system is that of the emission of a signal. Signals are introduced per-type and are identified through strings. Signals introduced for a parent type are available in derived types as well, so basically they are a per-type facility that is inherited.

A signal emission mainly involves invocation of a certain set of callbacks in precisely defined manner. There are two main categories of such callbacks, per-object ones and user provided ones. The per-object callbacks are most often referred to as "object method handler" or "default (signal) handler", while user provided callbacks are usually just called "signal handler".

The object method handler is provided at signal creation time, this most frequently happens at the end of an object class' creation, while user provided handlers are frequently connected and disconnected to/from a certain signal on certain object instances.

A signal emission consists of five stages, unless prematurely stopped:
  1. Invocation of the object method handler for :run-first signals.
  2. Invocation of normal user-provided signal handlers (where the after flag is not set).
  3. Invocation of the object method handler for :run-last signals.
  4. Invocation of user provided signal handlers (where the after flag is set).
  5. Invocation of the object method handler for :run-cleanup signals.
The user-provided signal handlers are called in the order they were connected in.

All handlers may prematurely stop a signal emission, and any number of handlers may be connected, disconnected, blocked or unblocked during a signal emission.

There are certain criteria for skipping user handlers in stages 2 and 4 of a signal emission. First, user handlers may be blocked. Blocked handlers are omitted during callback invocation, to return from the blocked state, a handler has to get unblocked exactly the same amount of times it has been blocked before. Second, upon emission of a :detailed signal, an additional detail argument passed in to the g:signal-emit function has to match the detail argument of the signal handler currently subject to invocation. Specification of no detail argument for signal handlers (omission of the detail part of the signal specification upon connection) serves as a wildcard and matches any detail argument passed in to emission.

While the detail argument is typically used to pass an object property name, as with "notify", no specific format is mandated for the detail string, other than that it must be non-empty.

Types and functions for signals

The signal flags are used to specify the behaviour of the signal, the overall signal description outlines how the flags control the stages of a signal emission. ...

The connection flags are used to specify the behaviour of the connection of the signal. ...

A structure holding in-depth information for a specific signal. ...

Accessor of the signal-id slot of the g:signal-query structure. ...

Accessor of the signal-name slot of the g:signal-query structure. ...

Accessor of the owner-type slot of the g:signal-query structure. ...

Accessor of the signal-flags slot of the g:signal-query structure. ...

Accessor of the return-type slot of the g:signal-query structure. ...

Accessor of the param-types slot of the g:signal-query structure. ...

Accessor of the signal-detail slot of the g:signal-query structure. ...

Returns the signal info. ...

Given the name of the signal and the type of object it connects to, gets the identifying integer of the signal. ...

Given the identifier of the signal, finds its name. ...

Lists the signals by ID that a certain instance or interface type created. ...

Emits a signal. ...

Connects a Lisp callback function to a signal for a particular object. ...

Blocks a handler of an instance so it will not be called during any signal emissions unless it is unblocked again. ...

Undoes the effect of a previous call of the g:signal-handler-block function. ...

Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to. ...

Finds the first signal handler that matches the given signal-id. ...

Returns whether handler-id is the ID of a handler connected to instance. ...

Returns whether there are any handlers connected to instance for the given signal ID and detail. ...

Stops a current emission of the signal. ...

GBinding

Flags to be passed to the g:object-bind-property or g:object-bind-property-full functions. ...

The g:binding object is the representation of a binding between a property on a g:object instance, or source, and another property on another g:object instance, or target. ...

Accessor of the flags slot of the g:binding class. ...

Accessor of the source slot of the g:binding class. ...

Accessor of the source-property slot of the g:binding class. ...

Accessor of the target slot of the g:binding class. ...

Accessor of the target-property slot of the g:binding class. ...

Retrieves the g:object instance used as the source of the binding. ...

Retrieves the g:object instance used as the target of the binding. ...

Explicitly releases the binding between the source and the target property expressed by binding. ...

Creates a binding between source-prop on source and target-prop on target. ...

The callback function for the g:object-bind-property-full function to be called to transform from to to. ...

Complete version of the g:object-bind-property function. ...

Exported Symbol Index

binding, Class
initially-unowned, Class
object, Class
signal-query, Struct
type-t, Type
binding-dup-source, Function
binding-dup-target, Function
binding-flags, Accessor
binding-source, Accessor
binding-source-property, Accessor
binding-target, Accessor
binding-target-property, Accessor
binding-unbind, Function
define-gobject-subclass, Macro  (undocumented)
get-gvalue-for-type, Generic Function  (undocumented)
is-object, Function
is-param-spec, Function
object-bind-property, Function
object-bind-property-full, Function
object-class-find-property, Function
object-class-init, Generic Function  (undocumented)
object-class-list-properties, Function
object-data, Function
object-freeze-notify, Function
object-has-reference, Accessor
object-instance-init, Generic Function  (undocumented)
object-interface-find-property, Function
object-interface-list-properties, Function
object-new, Function
object-notify, Function
object-pointer, Accessor
object-property, Function
object-ref, Function
object-ref-count, Function
object-set-data-full, Function
object-thaw-notify, Function
object-unref, Function
param-spec-blurb, Function
param-spec-boolean, Function
param-spec-boxed, Function
param-spec-char, Function
param-spec-default-value, Function
param-spec-double, Function
param-spec-enum, Function
param-spec-flags, Function
param-spec-float, Function
param-spec-gtype, Function
param-spec-int, Function
param-spec-int64, Function
param-spec-internal, Function
param-spec-long, Function
param-spec-name, Function
param-spec-nick, Function
param-spec-object, Function
param-spec-param, Function
param-spec-pointer, Function
param-spec-ref, Function
param-spec-ref-sink, Function
param-spec-string, Function
param-spec-type, Function
param-spec-type-name, Function
param-spec-uchar, Function
param-spec-uint, Function
param-spec-uint64, Function
param-spec-ulong, Function
param-spec-unref, Function
param-spec-value-type, Function
param-value-defaults, Function
param-value-set-default, Function
param-value-validate, Function
set-gvalue-for-type, Generic Function  (undocumented)
signal-connect, Function
signal-emit, Function
signal-handler-block, Function
signal-handler-disconnect, Function
signal-handler-find, Function
signal-handler-is-connected, Function
signal-handler-unblock, Function
signal-has-handler-pending, Function
signal-list-ids, Function
signal-lookup, Function
signal-name, Function
signal-query, Function
signal-query-owner-type, Accessor
signal-query-param-types, Accessor
signal-query-return-type, Accessor
signal-query-signal-detail, Accessor
signal-query-signal-flags, Accessor
signal-query-signal-id, Accessor
signal-query-signal-name, Accessor
signal-stop-emission, Function
strdup-value-contents, Function
type-check-class-type, Function
type-check-instance-type, Function
type-children, Function
type-class-peek, Function
type-class-peek-parent, Function
type-class-ref, Function
type-class-unref, Function
type-default-interface-peek, Function
type-default-interface-ref, Function
type-default-interface-unref, Function
type-depth, Function
type-ensure, Function
type-from-class, Function
type-from-instance, Function
type-from-interface, Function
type-fundamental, Function
type-instance-class, Function
type-interface-peek, Function
type-interface-prerequisites, Function
type-interfaces, Function
type-is-a, Function
type-is-abstract, Function
type-is-boxed, Function
type-is-classed, Function
type-is-derived, Function
type-is-enum, Function
type-is-flags, Function
type-is-fundamental, Function
type-is-interface, Function
type-is-object, Function
type-is-param, Function
type-is-value, Function
type-is-value-type, Function
type-name, Function
type-next-base, Function
type-parent, Function
type-qdata, Function
value-boolean, Function
value-boxed, Function
value-char, Function
value-copy, Function
value-double, Function
value-enum, Function
value-flags, Function
value-float, Function
value-get, Function
value-gtype, Function
value-holds, Function
value-init, Function
value-int, Function
value-int64, Function
value-long, Function
value-object, Function
value-param, Function
value-pointer, Function
value-reset, Function
value-schar, Function
value-set, Function
value-string, Function
value-take-boxed, Function
value-type, Function
value-type-compatible, Function
value-type-name, Function
value-uchar, Function
value-uint, Function
value-uint64, Function
value-ulong, Function
value-unset, Function
value-variant, Function
with-value, Macro
with-values, Macro
binding-flags, GFlags
binding-transform-func, Callback
connect-flags, Bitfield
destroy-notify, Callback
enum, Symbol  (undocumented)
enum-class, CStruct
enum-value, CStruct
flags, Symbol  (undocumented)
flags-class, CStruct
flags-value, CStruct
param, Symbol  (undocumented)
param-flags, Bitfield
param-spec, CStruct
param-spec-boolean, CStruct
param-spec-boxed, CStruct
param-spec-char, CStruct
param-spec-double, CStruct
param-spec-enum, CStruct
param-spec-flags, CStruct
param-spec-float, CStruct
param-spec-gtype, CStruct
param-spec-int, CStruct
param-spec-int64, CStruct
param-spec-long, CStruct
param-spec-object, CStruct
param-spec-param, CStruct
param-spec-pointer, CStruct
param-spec-string, CStruct
param-spec-uchar, CStruct
param-spec-uint, CStruct
param-spec-uint64, CStruct
param-spec-ulong, CStruct
signal-flags, Bitfield
type-class, CStruct
type-instance, CStruct
type-interface, CStruct
value, CStruct