Classes

The following classes are available globally.

  • Internal Class that wraps a closure to make sure the closure is retained until no longer required

    See more

    Declaration

    Swift

    public class ClosureHolder<S, T>
  • 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>
  • Undocumented

    See more

    Declaration

    Swift

    open class Value : ValueBase, ExpressibleByStringLiteral, ExpressibleByIntegerLiteral, ExpressibleByFloatLiteral, ExpressibleByBooleanLiteral

Binding Class

  • 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.

    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

    See more

    Declaration

    Swift

    open class Binding : Object, BindingProtocol

CClosure Record

  • 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.

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

    See more

    Declaration

    Swift

    open class CClosure : CClosureProtocol

Closure Record

  • 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.

    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.

    See more

    Declaration

    Swift

    open class Closure : ClosureProtocol

ClosureNotifyData Record

EnumClass Record

  • 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.

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

    See more

    Declaration

    Swift

    open class EnumClass : EnumClassProtocol

EnumValue Record

  • 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.

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

    See more

    Declaration

    Swift

    open class EnumValue : EnumValueProtocol

FlagsClass Record

  • 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.

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

    See more

    Declaration

    Swift

    open class FlagsClass : FlagsClassProtocol

FlagsValue Record

  • 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.

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

    See more

    Declaration

    Swift

    open class FlagsValue : FlagsValueProtocol

InitiallyUnowned Class

  • 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.

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

    See more

    Declaration

    Swift

    open class InitiallyUnowned : Object, InitiallyUnownedProtocol

InitiallyUnownedClass Record

InterfaceInfo Record

  • 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.

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

    See more

    Declaration

    Swift

    open class InterfaceInfo : InterfaceInfoProtocol

Object Class

  • 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.

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

    See more

    Declaration

    Swift

    open class Object : ObjectProtocol

ObjectClass Record

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

    The class structure for the GObject type.

    (C Language Example):

    // Example of implementing a singleton using a constructor.
    static MySingleton *the_singleton = NULL;
    
    static GObject*
    my_singleton_constructor (GType                  type,
                              guint                  n_construct_params,
                              GObjectConstructParam *construct_params)
    {
      GObject *object;
    
      if (!the_singleton)
        {
          object = G_OBJECT_CLASS (parent_class)->constructor (type,
                                                               n_construct_params,
                                                               construct_params);
          the_singleton = MY_SINGLETON (object);
        }
      else
        object = g_object_ref (G_OBJECT (the_singleton));
    
      return object;
    }
    
    See more

    Declaration

    Swift

    open class ObjectClass : ObjectClassProtocol

ObjectConstructParam Record

  • 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.

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

    See more

    Declaration

    Swift

    open class ObjectConstructParam : ObjectConstructParamProtocol

ParamSpec Class

  • 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.

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

    See more

    Declaration

    Swift

    open class ParamSpec : ParamSpecProtocol

ParamSpecBoolean Class

  • 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.

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

    See more

    Declaration

    Swift

    open class ParamSpecBoolean : ParamSpec, ParamSpecBooleanProtocol

ParamSpecBoxed Class

  • 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.

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

    See more

    Declaration

    Swift

    open class ParamSpecBoxed : ParamSpec, ParamSpecBoxedProtocol

ParamSpecChar Class

  • 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.

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

    See more

    Declaration

    Swift

    open class ParamSpecChar : ParamSpec, ParamSpecCharProtocol

ParamSpecClass Record

  • 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.

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

    See more

    Declaration

    Swift

    open class ParamSpecClass : ParamSpecClassProtocol

ParamSpecDouble Class

  • 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.

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

    See more

    Declaration

    Swift

    open class ParamSpecDouble : ParamSpec, ParamSpecDoubleProtocol

ParamSpecEnum Class

  • 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.

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

    See more

    Declaration

    Swift

    open class ParamSpecEnum : ParamSpec, ParamSpecEnumProtocol

ParamSpecFlags Class

  • 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.

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

    See more

    Declaration

    Swift

    open class ParamSpecFlags : ParamSpec, ParamSpecFlagsProtocol

ParamSpecFloat Class

  • 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.

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

    See more

    Declaration

    Swift

    open class ParamSpecFloat : ParamSpec, ParamSpecFloatProtocol

ParamSpecGType Class

  • 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.

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

    See more

    Declaration

    Swift

    open class ParamSpecGType : ParamSpec, ParamSpecGTypeProtocol

ParamSpecInt Class

  • 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.

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

    See more

    Declaration

    Swift

    open class ParamSpecInt : ParamSpec, ParamSpecIntProtocol

ParamSpecInt64 Class

  • 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.

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

    See more

    Declaration

    Swift

    open class ParamSpecInt64 : ParamSpec, ParamSpecInt64Protocol

ParamSpecLong Class

  • 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.

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

    See more

    Declaration

    Swift

    open class ParamSpecLong : ParamSpec, ParamSpecLongProtocol

ParamSpecObject Class

  • 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.

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

    See more

    Declaration

    Swift

    open class ParamSpecObject : ParamSpec, ParamSpecObjectProtocol

ParamSpecOverride Class

  • 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.

    This is a type of GParamSpec type that simply redirects operations to another paramspec. 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 overidden 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.

    See more

    Declaration

    Swift

    open class ParamSpecOverride : ParamSpec, ParamSpecOverrideProtocol

ParamSpecParam Class

  • 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.

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

    See more

    Declaration

    Swift

    open class ParamSpecParam : ParamSpec, ParamSpecParamProtocol

ParamSpecPointer Class

  • 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.

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

    See more

    Declaration

    Swift

    open class ParamSpecPointer : ParamSpec, ParamSpecPointerProtocol

ParamSpecPool Record

  • 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.

    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.

    See more

    Declaration

    Swift

    open class ParamSpecPool : ParamSpecPoolProtocol

ParamSpecString Class

  • 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.

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

    See more

    Declaration

    Swift

    open class ParamSpecString : ParamSpec, ParamSpecStringProtocol

ParamSpecTypeInfo Record

  • 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.

    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().

    See more

    Declaration

    Swift

    open class ParamSpecTypeInfo : ParamSpecTypeInfoProtocol

ParamSpecUChar Class

  • 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.

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

    See more

    Declaration

    Swift

    open class ParamSpecUChar : ParamSpec, ParamSpecUCharProtocol

ParamSpecUInt Class

  • 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.

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

    See more

    Declaration

    Swift

    open class ParamSpecUInt : ParamSpec, ParamSpecUIntProtocol

ParamSpecUInt64 Class

  • 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.

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

    See more

    Declaration

    Swift

    open class ParamSpecUInt64 : ParamSpec, ParamSpecUInt64Protocol

ParamSpecULong Class

  • 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.

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

    See more

    Declaration

    Swift

    open class ParamSpecULong : ParamSpec, ParamSpecULongProtocol

ParamSpecUnichar Class

  • 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.

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

    See more

    Declaration

    Swift

    open class ParamSpecUnichar : ParamSpec, ParamSpecUnicharProtocol

ParamSpecValueArray Class

  • 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.

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

    See more

    Declaration

    Swift

    open class ParamSpecValueArray : ParamSpec, ParamSpecValueArrayProtocol

ParamSpecVariant Class

  • 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.

    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.

    See more

    Declaration

    Swift

    open class ParamSpecVariant : ParamSpec, ParamSpecVariantProtocol

Parameter Record

  • 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.

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

    See more

    Declaration

    Swift

    open class Parameter : ParameterProtocol

SignalInvocationHint Record

  • 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.

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

    See more

    Declaration

    Swift

    open class SignalInvocationHint : SignalInvocationHintProtocol

SignalQuery Record

  • 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.

    A structure holding in-depth information for a specific signal. It is filled in by the g_signal_query() function.

    See more

    Declaration

    Swift

    open class SignalQuery : SignalQueryProtocol

TypeClass Record

  • 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.

    An opaque structure used as the base of all classes.

    See more

    Declaration

    Swift

    open class TypeClass : TypeClassProtocol

TypeFundamentalInfo Record

  • 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.

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

    See more

    Declaration

    Swift

    open class TypeFundamentalInfo : TypeFundamentalInfoProtocol

TypeInfo Record

  • 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.

    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().

    See more

    Declaration

    Swift

    open class TypeInfo : TypeInfoProtocol

TypeInstance Record

  • 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.

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

    See more

    Declaration

    Swift

    open class TypeInstance : TypeInstanceProtocol

TypeInterface Record

  • 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.

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

    See more

    Declaration

    Swift

    open class TypeInterface : TypeInterfaceProtocol

TypeModule Class

  • 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.

    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 unref cannot happen in 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.

    See more

    Declaration

    Swift

    open class TypeModule : Object, TypeModuleProtocol

TypeModuleClass Record

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

    In order to implement dynamic loading of types based on GTypeModule, the load and unload functions in GTypeModuleClass must be implemented.

    See more

    Declaration

    Swift

    open class TypeModuleClass : TypeModuleClassProtocol

TypePlugin Interface

  • 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.

    The GObject type system supports dynamic loading of types. The GTypePlugin interface is used to handle the lifecycle of dynamically loaded 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.

    See more

    Declaration

    Swift

    open class TypePlugin : TypePluginProtocol

TypePluginClass Record

  • 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.

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

    See more

    Declaration

    Swift

    open class TypePluginClass : TypePluginClassProtocol

TypeQuery Record

  • 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.

    A structure holding information for a specific type. It is filled in by the g_type_query() function.

    See more

    Declaration

    Swift

    open class TypeQuery : TypeQueryProtocol

TypeValueTable Record

  • 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.

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

    See more

    Declaration

    Swift

    open class TypeValueTable : TypeValueTableProtocol

Value Record

  • 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.

    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.

    See more

    Declaration

    Swift

    open class ValueBase : ValueProtocol

ValueArray Record

  • 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.

    A GValueArray contains an array of GValue elements.

    See more

    Declaration

    Swift

    open class ValueArray : ValueArrayProtocol

WeakRef Record

  • 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.

    A structure containing a weak reference to a GObject. It 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, any GWeakRefs taken before it was disposed will continue to point to nil. If GWeakRefs are taken after the object is disposed and re-referenced, they will continue to point to it until its refcount goes back to zero, at which point they too will be invalidated.

    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