Classes

The following classes are available globally.

Binding Class

  • GBinding is the representation of a binding between a property on a GObject instance (or source) and another property on another GObject instance (or target).

    Whenever the source property changes, the same value is applied to the target property; for instance, the following binding:

    (C Language Example):

      g_object_bind_property (object1, "property-a",
                              object2, "property-b",
                              G_BINDING_DEFAULT);
    

    will cause the property named “property-b” of object2 to be updated every time g_object_set() or the specific accessor changes the value of the property “property-a” of object1.

    It is possible to create a bidirectional binding between two properties of two GObject instances, so that if either property changes, the other is updated as well, for instance:

    (C Language Example):

      g_object_bind_property (object1, "property-a",
                              object2, "property-b",
                              G_BINDING_BIDIRECTIONAL);
    

    will keep the two properties in sync.

    It is also possible to set a custom transformation function (in both directions, in case of a bidirectional binding) to apply a custom transformation from the source value to the target value before applying it; for instance, the following binding:

    (C Language Example):

      g_object_bind_property_full (adjustment1, "value",
                                   adjustment2, "value",
                                   G_BINDING_BIDIRECTIONAL,
                                   celsius_to_fahrenheit,
                                   fahrenheit_to_celsius,
                                   NULL, NULL);
    

    will keep the “value” property of the two adjustments in sync; the celsius_to_fahrenheit function will be called whenever the “value” property of adjustment1 changes and will transform the current value of the property before applying it to the “value” property of adjustment2.

    Vice versa, the fahrenheit_to_celsius function will be called whenever the “value” property of adjustment2 changes, and will transform the current value of the property before applying it to the “value” property of adjustment1.

    Note that GBinding does not resolve cycles by itself; a cycle like

      object1:propertyA -> object2:propertyB
      object2:propertyB -> object3:propertyC
      object3:propertyC -> object1:propertyA
    

    might lead to an infinite loop. The loop, in this particular case, can be avoided if the objects emit the GObject::notify signal only if the value has effectively been changed. A binding is implemented using the GObject::notify signal, so it is susceptible to all the various ways of blocking a signal emission, like g_signal_stop_emission() or g_signal_handler_block().

    A binding will be severed, and the resources it allocates freed, whenever either one of the GObject instances it refers to are finalized, or when the GBinding instance loses its last reference.

    Bindings for languages with garbage collection can use g_binding_unbind() to explicitly release a binding between the source and target properties, instead of relying on the last reference on the binding, source, and target instances to drop.

    GBinding is available since GObject 2.26

    The Binding type acts as a reference-counted owner of an underlying GBinding instance. It provides the methods that can operate on this data type through BindingProtocol conformance. Use Binding as a strong reference or owner of a GBinding instance.

    See more

    Declaration

    Swift

    open class Binding : Object, BindingProtocol

CClosure Record

  • A GCClosure is a specialization of GClosure for C function callbacks.

    The CClosure type acts as an owner of an underlying GCClosure instance. It provides the methods that can operate on this data type through CClosureProtocol conformance. Use CClosure as a strong reference or owner of a GCClosure instance.

    See more

    Declaration

    Swift

    open class CClosure : CClosureProtocol

Closure Record

  • A GClosure represents a callback supplied by the programmer.

    It will generally comprise a function of some kind and a marshaller used to call it. It is the responsibility of the marshaller to convert the arguments for the invocation from GValues into a suitable form, perform the callback on the converted arguments, and transform the return value back into a GValue.

    In the case of C programs, a closure usually just holds a pointer to a function and maybe a data argument, and the marshaller converts between GValue and native C types. The GObject library provides the GCClosure type for this purpose. Bindings for other languages need marshallers which convert between GValues and suitable representations in the runtime of the language in order to use functions written in that language as callbacks. Use g_closure_set_marshal() to set the marshaller on such a custom closure implementation.

    Within GObject, closures play an important role in the implementation of signals. When a signal is registered, the c_marshaller argument to g_signal_new() specifies the default C marshaller for any closure which is connected to this signal. GObject provides a number of C marshallers for this purpose, see the g_cclosure_marshal_() functions. Additional C marshallers can be generated with the glib-genmarshal utility. Closures can be explicitly connected to signals with g_signal_connect_closure(), but it usually more convenient to let GObject create a closure automatically by using one of the g_signal_connect_() functions which take a callback function/user data pair.

    Using closures has a number of important advantages over a simple callback function/data pointer combination:

    • Closures allow the callee to get the types of the callback parameters, which means that language bindings don’t have to write individual glue for each callback type.

    • The reference counting of GClosure makes it easy to handle reentrancy right; if a callback is removed while it is being invoked, the closure and its parameters won’t be freed until the invocation finishes.

    • g_closure_invalidate() and invalidation notifiers allow callbacks to be automatically removed when the objects they point to go away.

    The Closure type acts as a reference-counted owner of an underlying GClosure instance. It provides the methods that can operate on this data type through ClosureProtocol conformance. Use Closure as a strong reference or owner of a GClosure instance.

    See more

    Declaration

    Swift

    open class Closure : ClosureProtocol

ClosureNotifyData Record

EnumClass Record

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

    The EnumClass type acts as an owner of an underlying GEnumClass instance. It provides the methods that can operate on this data type through EnumClassProtocol conformance. Use EnumClass as a strong reference or owner of a GEnumClass instance.

    See more

    Declaration

    Swift

    open class EnumClass : EnumClassProtocol

EnumValue Record

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

    The EnumValue type acts as an owner of an underlying GEnumValue instance. It provides the methods that can operate on this data type through EnumValueProtocol conformance. Use EnumValue as a strong reference or owner of a GEnumValue instance.

    See more

    Declaration

    Swift

    open class EnumValue : EnumValueProtocol

FlagsClass Record

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

    The FlagsClass type acts as an owner of an underlying GFlagsClass instance. It provides the methods that can operate on this data type through FlagsClassProtocol conformance. Use FlagsClass as a strong reference or owner of a GFlagsClass instance.

    See more

    Declaration

    Swift

    open class FlagsClass : FlagsClassProtocol

FlagsValue Record

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

    The FlagsValue type acts as an owner of an underlying GFlagsValue instance. It provides the methods that can operate on this data type through FlagsValueProtocol conformance. Use FlagsValue as a strong reference or owner of a GFlagsValue instance.

    See more

    Declaration

    Swift

    open class FlagsValue : FlagsValueProtocol

InitiallyUnowned Class

  • A type for objects that have an initially floating reference.

    All the fields in the GInitiallyUnowned structure are private to the implementation and should never be accessed directly.

    The InitiallyUnowned type acts as a reference-counted owner of an underlying GInitiallyUnowned instance. It provides the methods that can operate on this data type through InitiallyUnownedProtocol conformance. Use InitiallyUnowned as a strong reference or owner of a GInitiallyUnowned instance.

    See more

    Declaration

    Swift

    open class InitiallyUnowned : Object, InitiallyUnownedProtocol

InterfaceInfo Record

  • A structure that provides information to the type system which is used specifically for managing interface types.

    The InterfaceInfo type acts as an owner of an underlying GInterfaceInfo instance. It provides the methods that can operate on this data type through InterfaceInfoProtocol conformance. Use InterfaceInfo as a strong reference or owner of a GInterfaceInfo instance.

    See more

    Declaration

    Swift

    open class InterfaceInfo : InterfaceInfoProtocol

ObjectConstructParam Record

  • The GObjectConstructParam struct is an auxiliary structure used to hand GParamSpec/GValue pairs to the constructor of a GObjectClass.

    The ObjectConstructParam type acts as an owner of an underlying GObjectConstructParam instance. It provides the methods that can operate on this data type through ObjectConstructParamProtocol conformance. Use ObjectConstructParam as a strong reference or owner of a GObjectConstructParam instance.

    See more

    Declaration

    Swift

    open class ObjectConstructParam : ObjectConstructParamProtocol

Object Class

  • The base object type.

    All the fields in the GObject structure are private to the implementation and should never be accessed directly.

    The Object type acts as a reference-counted owner of an underlying GObject instance. It provides the methods that can operate on this data type through ObjectProtocol conformance. Use Object as a strong reference or owner of a GObject instance.

    See more

    Declaration

    Swift

    open class Object : ObjectProtocol

ParamSpecClass Record

  • The class structure for the GParamSpec type. Normally, GParamSpec classes are filled by g_param_type_register_static().

    The ParamSpecClass type acts as an owner of an underlying GParamSpecClass instance. It provides the methods that can operate on this data type through ParamSpecClassProtocol conformance. Use ParamSpecClass as a strong reference or owner of a GParamSpecClass instance.

    See more

    Declaration

    Swift

    open class ParamSpecClass : ParamSpecClassProtocol

ParamSpecPool Record

  • A GParamSpecPool maintains a collection of GParamSpecs which can be quickly accessed by owner and name.

    The implementation of the GObject property system uses such a pool to store the GParamSpecs of the properties all object types.

    The ParamSpecPool type acts as an owner of an underlying GParamSpecPool instance. It provides the methods that can operate on this data type through ParamSpecPoolProtocol conformance. Use ParamSpecPool as a strong reference or owner of a GParamSpecPool instance.

    See more

    Declaration

    Swift

    open class ParamSpecPool : ParamSpecPoolProtocol

ParamSpecTypeInfo Record

  • This structure is used to provide the type system with the information required to initialize and destruct (finalize) a parameter’s class and instances thereof.

    The initialized structure is passed to the g_param_type_register_static() The type system will perform a deep copy of this structure, so its memory does not need to be persistent across invocation of g_param_type_register_static().

    The ParamSpecTypeInfo type acts as an owner of an underlying GParamSpecTypeInfo instance. It provides the methods that can operate on this data type through ParamSpecTypeInfoProtocol conformance. Use ParamSpecTypeInfo as a strong reference or owner of a GParamSpecTypeInfo instance.

    See more

    Declaration

    Swift

    open class ParamSpecTypeInfo : ParamSpecTypeInfoProtocol

Parameter Record

  • The GParameter struct is an auxiliary structure used to hand parameter name/value pairs to g_object_newv().

    The Parameter type acts as an owner of an underlying GParameter instance. It provides the methods that can operate on this data type through ParameterProtocol conformance. Use Parameter as a strong reference or owner of a GParameter instance.

    See more

    Declaration

    Swift

    open class Parameter : ParameterProtocol

ParamSpec Class

  • GParamSpec is an object structure that encapsulates the metadata required to specify parameters, such as e.g. GObject properties.

    Parameter names #

    A property name consists of one or more segments consisting of ASCII letters and digits, separated by either the - or _ character. The first character of a property name must be a letter. These are the same rules as for signal naming (see g_signal_new()).

    When creating and looking up a GParamSpec, either separator can be used, but they cannot be mixed. Using - is considerably more efficient, and is the ‘canonical form’. Using _ is discouraged.

    The ParamSpec type acts as a reference-counted owner of an underlying GParamSpec instance. It provides the methods that can operate on this data type through ParamSpecProtocol conformance. Use ParamSpec as a strong reference or owner of a GParamSpec instance.

    See more

    Declaration

    Swift

    open class ParamSpec : ParamSpecProtocol

ParamSpecBoolean Class

  • A GParamSpec derived structure that contains the meta data for boolean properties.

    The ParamSpecBoolean type acts as a reference-counted owner of an underlying GParamSpecBoolean instance. It provides the methods that can operate on this data type through ParamSpecBooleanProtocol conformance. Use ParamSpecBoolean as a strong reference or owner of a GParamSpecBoolean instance.

    See more

    Declaration

    Swift

    open class ParamSpecBoolean : ParamSpec, ParamSpecBooleanProtocol

ParamSpecBoxed Class

  • A GParamSpec derived structure that contains the meta data for boxed properties.

    The ParamSpecBoxed type acts as a reference-counted owner of an underlying GParamSpecBoxed instance. It provides the methods that can operate on this data type through ParamSpecBoxedProtocol conformance. Use ParamSpecBoxed as a strong reference or owner of a GParamSpecBoxed instance.

    See more

    Declaration

    Swift

    open class ParamSpecBoxed : ParamSpec, ParamSpecBoxedProtocol

ParamSpecChar Class

  • A GParamSpec derived structure that contains the meta data for character properties.

    The ParamSpecChar type acts as a reference-counted owner of an underlying GParamSpecChar instance. It provides the methods that can operate on this data type through ParamSpecCharProtocol conformance. Use ParamSpecChar as a strong reference or owner of a GParamSpecChar instance.

    See more

    Declaration

    Swift

    open class ParamSpecChar : ParamSpec, ParamSpecCharProtocol

ParamSpecDouble Class

  • A GParamSpec derived structure that contains the meta data for double properties.

    The ParamSpecDouble type acts as a reference-counted owner of an underlying GParamSpecDouble instance. It provides the methods that can operate on this data type through ParamSpecDoubleProtocol conformance. Use ParamSpecDouble as a strong reference or owner of a GParamSpecDouble instance.

    See more

    Declaration

    Swift

    open class ParamSpecDouble : ParamSpec, ParamSpecDoubleProtocol

ParamSpecEnum Class

  • A GParamSpec derived structure that contains the meta data for enum properties.

    The ParamSpecEnum type acts as a reference-counted owner of an underlying GParamSpecEnum instance. It provides the methods that can operate on this data type through ParamSpecEnumProtocol conformance. Use ParamSpecEnum as a strong reference or owner of a GParamSpecEnum instance.

    See more

    Declaration

    Swift

    open class ParamSpecEnum : ParamSpec, ParamSpecEnumProtocol

ParamSpecFlags Class

  • A GParamSpec derived structure that contains the meta data for flags properties.

    The ParamSpecFlags type acts as a reference-counted owner of an underlying GParamSpecFlags instance. It provides the methods that can operate on this data type through ParamSpecFlagsProtocol conformance. Use ParamSpecFlags as a strong reference or owner of a GParamSpecFlags instance.

    See more

    Declaration

    Swift

    open class ParamSpecFlags : ParamSpec, ParamSpecFlagsProtocol

ParamSpecFloat Class

  • A GParamSpec derived structure that contains the meta data for float properties.

    The ParamSpecFloat type acts as a reference-counted owner of an underlying GParamSpecFloat instance. It provides the methods that can operate on this data type through ParamSpecFloatProtocol conformance. Use ParamSpecFloat as a strong reference or owner of a GParamSpecFloat instance.

    See more

    Declaration

    Swift

    open class ParamSpecFloat : ParamSpec, ParamSpecFloatProtocol

ParamSpecGType Class

  • A GParamSpec derived structure that contains the meta data for GType properties.

    The ParamSpecGType type acts as a reference-counted owner of an underlying GParamSpecGType instance. It provides the methods that can operate on this data type through ParamSpecGTypeProtocol conformance. Use ParamSpecGType as a strong reference or owner of a GParamSpecGType instance.

    See more

    Declaration

    Swift

    open class ParamSpecGType : ParamSpec, ParamSpecGTypeProtocol

ParamSpecInt Class

  • A GParamSpec derived structure that contains the meta data for integer properties.

    The ParamSpecInt type acts as a reference-counted owner of an underlying GParamSpecInt instance. It provides the methods that can operate on this data type through ParamSpecIntProtocol conformance. Use ParamSpecInt as a strong reference or owner of a GParamSpecInt instance.

    See more

    Declaration

    Swift

    open class ParamSpecInt : ParamSpec, ParamSpecIntProtocol

ParamSpecInt64 Class

  • A GParamSpec derived structure that contains the meta data for 64bit integer properties.

    The ParamSpecInt64 type acts as a reference-counted owner of an underlying GParamSpecInt64 instance. It provides the methods that can operate on this data type through ParamSpecInt64Protocol conformance. Use ParamSpecInt64 as a strong reference or owner of a GParamSpecInt64 instance.

    See more

    Declaration

    Swift

    open class ParamSpecInt64 : ParamSpec, ParamSpecInt64Protocol

ParamSpecLong Class

  • A GParamSpec derived structure that contains the meta data for long integer properties.

    The ParamSpecLong type acts as a reference-counted owner of an underlying GParamSpecLong instance. It provides the methods that can operate on this data type through ParamSpecLongProtocol conformance. Use ParamSpecLong as a strong reference or owner of a GParamSpecLong instance.

    See more

    Declaration

    Swift

    open class ParamSpecLong : ParamSpec, ParamSpecLongProtocol

ParamSpecObject Class

  • A GParamSpec derived structure that contains the meta data for object properties.

    The ParamSpecObject type acts as a reference-counted owner of an underlying GParamSpecObject instance. It provides the methods that can operate on this data type through ParamSpecObjectProtocol conformance. Use ParamSpecObject as a strong reference or owner of a GParamSpecObject instance.

    See more

    Declaration

    Swift

    open class ParamSpecObject : ParamSpec, ParamSpecObjectProtocol

ParamSpecOverride Class

  • A GParamSpec derived structure that redirects operations to other types of GParamSpec.

    All operations other than getting or setting the value are redirected, including accessing the nick and blurb, validating a value, and so forth.

    See g_param_spec_get_redirect_target() for retrieving the overridden property. GParamSpecOverride is used in implementing g_object_class_override_property(), and will not be directly useful unless you are implementing a new base type similar to GObject.

    The ParamSpecOverride type acts as a reference-counted owner of an underlying GParamSpecOverride instance. It provides the methods that can operate on this data type through ParamSpecOverrideProtocol conformance. Use ParamSpecOverride as a strong reference or owner of a GParamSpecOverride instance.

    See more

    Declaration

    Swift

    open class ParamSpecOverride : ParamSpec, ParamSpecOverrideProtocol

ParamSpecParam Class

  • A GParamSpec derived structure that contains the meta data for G_TYPE_PARAM properties.

    The ParamSpecParam type acts as a reference-counted owner of an underlying GParamSpecParam instance. It provides the methods that can operate on this data type through ParamSpecParamProtocol conformance. Use ParamSpecParam as a strong reference or owner of a GParamSpecParam instance.

    See more

    Declaration

    Swift

    open class ParamSpecParam : ParamSpec, ParamSpecParamProtocol

ParamSpecPointer Class

  • A GParamSpec derived structure that contains the meta data for pointer properties.

    The ParamSpecPointer type acts as a reference-counted owner of an underlying GParamSpecPointer instance. It provides the methods that can operate on this data type through ParamSpecPointerProtocol conformance. Use ParamSpecPointer as a strong reference or owner of a GParamSpecPointer instance.

    See more

    Declaration

    Swift

    open class ParamSpecPointer : ParamSpec, ParamSpecPointerProtocol

ParamSpecString Class

  • A GParamSpec derived structure that contains the meta data for string properties.

    The ParamSpecString type acts as a reference-counted owner of an underlying GParamSpecString instance. It provides the methods that can operate on this data type through ParamSpecStringProtocol conformance. Use ParamSpecString as a strong reference or owner of a GParamSpecString instance.

    See more

    Declaration

    Swift

    open class ParamSpecString : ParamSpec, ParamSpecStringProtocol

ParamSpecUChar Class

  • A GParamSpec derived structure that contains the meta data for unsigned character properties.

    The ParamSpecUChar type acts as a reference-counted owner of an underlying GParamSpecUChar instance. It provides the methods that can operate on this data type through ParamSpecUCharProtocol conformance. Use ParamSpecUChar as a strong reference or owner of a GParamSpecUChar instance.

    See more

    Declaration

    Swift

    open class ParamSpecUChar : ParamSpec, ParamSpecUCharProtocol

ParamSpecUInt Class

  • A GParamSpec derived structure that contains the meta data for unsigned integer properties.

    The ParamSpecUInt type acts as a reference-counted owner of an underlying GParamSpecUInt instance. It provides the methods that can operate on this data type through ParamSpecUIntProtocol conformance. Use ParamSpecUInt as a strong reference or owner of a GParamSpecUInt instance.

    See more

    Declaration

    Swift

    open class ParamSpecUInt : ParamSpec, ParamSpecUIntProtocol

ParamSpecUInt64 Class

  • A GParamSpec derived structure that contains the meta data for unsigned 64bit integer properties.

    The ParamSpecUInt64 type acts as a reference-counted owner of an underlying GParamSpecUInt64 instance. It provides the methods that can operate on this data type through ParamSpecUInt64Protocol conformance. Use ParamSpecUInt64 as a strong reference or owner of a GParamSpecUInt64 instance.

    See more

    Declaration

    Swift

    open class ParamSpecUInt64 : ParamSpec, ParamSpecUInt64Protocol

ParamSpecULong Class

  • A GParamSpec derived structure that contains the meta data for unsigned long integer properties.

    The ParamSpecULong type acts as a reference-counted owner of an underlying GParamSpecULong instance. It provides the methods that can operate on this data type through ParamSpecULongProtocol conformance. Use ParamSpecULong as a strong reference or owner of a GParamSpecULong instance.

    See more

    Declaration

    Swift

    open class ParamSpecULong : ParamSpec, ParamSpecULongProtocol

ParamSpecUnichar Class

  • A GParamSpec derived structure that contains the meta data for unichar (unsigned integer) properties.

    The ParamSpecUnichar type acts as a reference-counted owner of an underlying GParamSpecUnichar instance. It provides the methods that can operate on this data type through ParamSpecUnicharProtocol conformance. Use ParamSpecUnichar as a strong reference or owner of a GParamSpecUnichar instance.

    See more

    Declaration

    Swift

    open class ParamSpecUnichar : ParamSpec, ParamSpecUnicharProtocol

ParamSpecValueArray Class

  • A GParamSpec derived structure that contains the meta data for GValueArray properties.

    The ParamSpecValueArray type acts as a reference-counted owner of an underlying GParamSpecValueArray instance. It provides the methods that can operate on this data type through ParamSpecValueArrayProtocol conformance. Use ParamSpecValueArray as a strong reference or owner of a GParamSpecValueArray instance.

    See more

    Declaration

    Swift

    open class ParamSpecValueArray : ParamSpec, ParamSpecValueArrayProtocol

ParamSpecVariant Class

  • A GParamSpec derived structure that contains the meta data for GVariant properties.

    When comparing values with g_param_values_cmp(), scalar values with the same type will be compared with g_variant_compare(). Other non-nil variants will be checked for equality with g_variant_equal(), and their sort order is otherwise undefined. nil is ordered before non-nil variants. Two nil values compare equal.

    The ParamSpecVariant type acts as a reference-counted owner of an underlying GParamSpecVariant instance. It provides the methods that can operate on this data type through ParamSpecVariantProtocol conformance. Use ParamSpecVariant as a strong reference or owner of a GParamSpecVariant instance.

    See more

    Declaration

    Swift

    open class ParamSpecVariant : ParamSpec, ParamSpecVariantProtocol

SignalInvocationHint Record

  • The GSignalInvocationHint structure is used to pass on additional information to callbacks during a signal emission.

    The SignalInvocationHint type acts as an owner of an underlying GSignalInvocationHint instance. It provides the methods that can operate on this data type through SignalInvocationHintProtocol conformance. Use SignalInvocationHint as a strong reference or owner of a GSignalInvocationHint instance.

    See more

    Declaration

    Swift

    open class SignalInvocationHint : SignalInvocationHintProtocol

SignalQuery Record

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

    See also: g_signal_query()

    The SignalQuery type acts as an owner of an underlying GSignalQuery instance. It provides the methods that can operate on this data type through SignalQueryProtocol conformance. Use SignalQuery as a strong reference or owner of a GSignalQuery instance.

    See more

    Declaration

    Swift

    open class SignalQuery : SignalQueryProtocol

TypePlugin Interface

  • An interface that handles the lifecycle of dynamically loaded types.

    The GObject type system supports dynamic loading of types. It goes as follows:

    1. The type is initially introduced (usually upon loading the module the first time, or by your main application that knows what modules introduces what types), like this:

    (C Language Example):

       new_type_id = g_type_register_dynamic (parent_type_id,
                                              "TypeName",
                                              new_type_plugin,
                                              type_flags);
    
    

    where new_type_plugin is an implementation of the GTypePlugin interface.

    1. The type’s implementation is referenced, e.g. through g_type_class_ref() or through g_type_create_instance() (this is being called by g_object_new()) or through one of the above done on a type derived from new_type_id.

    2. This causes the type system to load the type’s implementation by calling g_type_plugin_use() and g_type_plugin_complete_type_info() on new_type_plugin.

    3. At some point the type’s implementation isn’t required anymore, e.g. after g_type_class_unref() or g_type_free_instance() (called when the reference count of an instance drops to zero).

    4. This causes the type system to throw away the information retrieved from g_type_plugin_complete_type_info() and then it calls g_type_plugin_unuse() on new_type_plugin.

    5. Things may repeat from the second step.

    So basically, you need to implement a GTypePlugin type that carries a use_count, once use_count goes from zero to one, you need to load the implementation to successfully handle the upcoming g_type_plugin_complete_type_info() call. Later, maybe after succeeding use/unuse calls, once use_count drops to zero, you can unload the implementation again. The type system makes sure to call g_type_plugin_use() and g_type_plugin_complete_type_info() again when the type is needed again.

    GTypeModule is an implementation of GTypePlugin that already implements most of this except for the actual module loading and unloading. It even handles multiple registered types per module.

    The TypePlugin type acts as an owner of an underlying GTypePlugin instance. It provides the methods that can operate on this data type through TypePluginProtocol conformance. Use TypePlugin as a strong reference or owner of a GTypePlugin instance.

    See more

    Declaration

    Swift

    open class TypePlugin : TypePluginProtocol

TypeClass Record

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

    The TypeClass type acts as an owner of an underlying GTypeClass instance. It provides the methods that can operate on this data type through TypeClassProtocol conformance. Use TypeClass as a strong reference or owner of a GTypeClass instance.

    See more

    Declaration

    Swift

    open class TypeClass : TypeClassProtocol

TypeFundamentalInfo Record

  • A structure that provides information to the type system which is used specifically for managing fundamental types.

    The TypeFundamentalInfo type acts as an owner of an underlying GTypeFundamentalInfo instance. It provides the methods that can operate on this data type through TypeFundamentalInfoProtocol conformance. Use TypeFundamentalInfo as a strong reference or owner of a GTypeFundamentalInfo instance.

    See more

    Declaration

    Swift

    open class TypeFundamentalInfo : TypeFundamentalInfoProtocol

TypeInfo Record

  • This structure is used to provide the type system with the information required to initialize and destruct (finalize) a type’s class and its instances.

    The initialized structure is passed to the g_type_register_static() function (or is copied into the provided GTypeInfo structure in the g_type_plugin_complete_type_info()). The type system will perform a deep copy of this structure, so its memory does not need to be persistent across invocation of g_type_register_static().

    The TypeInfo type acts as an owner of an underlying GTypeInfo instance. It provides the methods that can operate on this data type through TypeInfoProtocol conformance. Use TypeInfo as a strong reference or owner of a GTypeInfo instance.

    See more

    Declaration

    Swift

    open class TypeInfo : TypeInfoProtocol

TypeInstance Record

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

    The TypeInstance type acts as an owner of an underlying GTypeInstance instance. It provides the methods that can operate on this data type through TypeInstanceProtocol conformance. Use TypeInstance as a strong reference or owner of a GTypeInstance instance.

    See more

    Declaration

    Swift

    open class TypeInstance : TypeInstanceProtocol

TypeInterface Record

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

    The TypeInterface type acts as an owner of an underlying GTypeInterface instance. It provides the methods that can operate on this data type through TypeInterfaceProtocol conformance. Use TypeInterface as a strong reference or owner of a GTypeInterface instance.

    See more

    Declaration

    Swift

    open class TypeInterface : TypeInterfaceProtocol

TypePluginClass Record

  • The GTypePlugin interface is used by the type system in order to handle the lifecycle of dynamically loaded types.

    The TypePluginClass type acts as an owner of an underlying GTypePluginClass instance. It provides the methods that can operate on this data type through TypePluginClassProtocol conformance. Use TypePluginClass as a strong reference or owner of a GTypePluginClass instance.

    See more

    Declaration

    Swift

    open class TypePluginClass : TypePluginClassProtocol

TypeQuery Record

  • A structure holding information for a specific type.

    See also: g_type_query()

    The TypeQuery type acts as an owner of an underlying GTypeQuery instance. It provides the methods that can operate on this data type through TypeQueryProtocol conformance. Use TypeQuery as a strong reference or owner of a GTypeQuery instance.

    See more

    Declaration

    Swift

    open class TypeQuery : TypeQueryProtocol

TypeValueTable Record

  • The GTypeValueTable provides the functions required by the GValue implementation, to serve as a container for values of a type.

    The TypeValueTable type acts as an owner of an underlying GTypeValueTable instance. It provides the methods that can operate on this data type through TypeValueTableProtocol conformance. Use TypeValueTable as a strong reference or owner of a GTypeValueTable instance.

    See more

    Declaration

    Swift

    open class TypeValueTable : TypeValueTableProtocol

TypeModule Class

  • GTypeModule provides a simple implementation of the GTypePlugin interface.

    The model of GTypeModule is a dynamically loaded module which implements some number of types and interface implementations.

    When the module is loaded, it registers its types and interfaces using g_type_module_register_type() and g_type_module_add_interface(). As long as any instances of these types and interface implementations are in use, the module is kept loaded. When the types and interfaces are gone, the module may be unloaded. If the types and interfaces become used again, the module will be reloaded. Note that the last reference cannot be released from within the module code, since that would lead to the caller’s code being unloaded before g_object_unref() returns to it.

    Keeping track of whether the module should be loaded or not is done by using a use count - it starts at zero, and whenever it is greater than zero, the module is loaded. The use count is maintained internally by the type system, but also can be explicitly controlled by g_type_module_use() and g_type_module_unuse(). Typically, when loading a module for the first type, g_type_module_use() will be used to load it so that it can initialize its types. At some later point, when the module no longer needs to be loaded except for the type implementations it contains, g_type_module_unuse() is called.

    GTypeModule does not actually provide any implementation of module loading and unloading. To create a particular module type you must derive from GTypeModule and implement the load and unload functions in GTypeModuleClass.

    The TypeModule type acts as a reference-counted owner of an underlying GTypeModule instance. It provides the methods that can operate on this data type through TypeModuleProtocol conformance. Use TypeModule as a strong reference or owner of a GTypeModule instance.

    See more

    Declaration

    Swift

    open class TypeModule : Object, TypeModuleProtocol

Value Record

  • An opaque structure used to hold different types of values.

    The data within the structure has protected scope: it is accessible only to functions within a GTypeValueTable structure, or implementations of the g_value_*() API. That is, code portions which implement new fundamental types.

    GValue users cannot make any assumptions about how data is stored within the 2 element data union, and the g_type member should only be accessed through the G_VALUE_TYPE() macro.

    The Value type acts as an owner of an underlying GValue instance. It provides the methods that can operate on this data type through ValueProtocol conformance. Use Value as a strong reference or owner of a GValue instance.

    See more

    Declaration

    Swift

    open class ValueBase : ValueProtocol

ValueArray Record

  • A GValueArray contains an array of GValue elements.

    The ValueArray type acts as an owner of an underlying GValueArray instance. It provides the methods that can operate on this data type through ValueArrayProtocol conformance. Use ValueArray as a strong reference or owner of a GValueArray instance.

    See more

    Declaration

    Swift

    open class ValueArray : ValueArrayProtocol

WeakRef Record

  • A structure containing a weak reference to a GObject.

    A GWeakRef can either be empty (i.e. point to nil), or point to an object for as long as at least one “strong” reference to that object exists. Before the object’s GObjectClass.dispose method is called, every GWeakRef associated with becomes empty (i.e. points to nil).

    Like GValue, GWeakRef can be statically allocated, stack- or heap-allocated, or embedded in larger structures.

    Unlike g_object_weak_ref() and g_object_add_weak_pointer(), this weak reference is thread-safe: converting a weak pointer to a reference is atomic with respect to invalidation of weak pointers to destroyed objects.

    If the object’s GObjectClass.dispose method results in additional references to the object being held (‘re-referencing’), any GWeakRefs taken before it was disposed will continue to point to nil. Any GWeakRefs taken during disposal and after re-referencing, or after disposal has returned due to the re-referencing, will continue to point to the object until its refcount goes back to zero, at which point they too will be invalidated.

    It is invalid to take a GWeakRef on an object during GObjectClass.dispose without first having or creating a strong reference to the object.

    The WeakRef type acts as an owner of an underlying GWeakRef instance. It provides the methods that can operate on this data type through WeakRefProtocol conformance. Use WeakRef as a strong reference or owner of a GWeakRef instance.

    See more

    Declaration

    Swift

    open class WeakRef : WeakRefProtocol

TypeCValue Union

  • The TypeCValue type acts as an owner of an underlying GTypeCValue instance. It provides the methods that can operate on this data type through TypeCValueProtocol conformance. Use TypeCValue as a strong reference or owner of a GTypeCValue instance.

    See more

    Declaration

    Swift

    open class TypeCValue : TypeCValueProtocol

Valuedata_union Union

  • The _Value__data__union type acts as an owner of an underlying _Value__data__union instance. It provides the methods that can operate on this data type through _Value__data__unionProtocol conformance. Use _Value__data__union as a strong reference or owner of a _Value__data__union instance.

    See more

    Declaration

    Swift

    open class _Value__data__union : _Value__data__unionProtocol
  • Internal Class that wraps a binding to make sure it is retained until no longer required

    See more

    Declaration

    Swift

    public class BindingHolder<S, T>
  • This class is the main Swift wrapper with memory management for underlying GValues (the opaque GLib structure used to hold different types of values.

    Note

    this class conforms to ExpressibleBy*Literal for storage of primitive types such as String, Int, Double, or Bool
    See more

    Declaration

    Swift

    open class Value : ValueBase, ExpressibleByStringLiteral, ExpressibleByIntegerLiteral, ExpressibleByFloatLiteral, ExpressibleByBooleanLiteral
  • Storage for weak references of GObject reference counting. Use only unowning wrappers as a generic parameter T.

    See more

    Declaration

    Swift

    @propertyWrapper
    public final class GWeak<T> where T : GWeakCapturing, T : ObjectProtocol