Structures

The following structures are available globally.

Binding Class

  • The BindingRef type acts as a lightweight Swift reference to an underlying GBinding instance. It exposes methods that can operate on this data type through BindingProtocol conformance. Use BindingRef only as an unowned reference to an existing 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

    public struct BindingRef : BindingProtocol

CClosure Record

  • The CClosureRef type acts as a lightweight Swift reference to an underlying GCClosure instance. It exposes methods that can operate on this data type through CClosureProtocol conformance. Use CClosureRef only as an unowned reference to an existing GCClosure instance.

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

    See more

    Declaration

    Swift

    public struct CClosureRef : CClosureProtocol

Closure Record

  • The ClosureRef type acts as a lightweight Swift reference to an underlying GClosure instance. It exposes methods that can operate on this data type through ClosureProtocol conformance. Use ClosureRef only as an unowned reference to an existing 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

    public struct ClosureRef : ClosureProtocol

ClosureNotifyData Record

EnumClass Record

  • The EnumClassRef type acts as a lightweight Swift reference to an underlying GEnumClass instance. It exposes methods that can operate on this data type through EnumClassProtocol conformance. Use EnumClassRef only as an unowned reference to an existing GEnumClass instance.

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

    See more

    Declaration

    Swift

    public struct EnumClassRef : EnumClassProtocol

EnumValue Record

  • The EnumValueRef type acts as a lightweight Swift reference to an underlying GEnumValue instance. It exposes methods that can operate on this data type through EnumValueProtocol conformance. Use EnumValueRef only as an unowned reference to an existing GEnumValue instance.

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

    See more

    Declaration

    Swift

    public struct EnumValueRef : EnumValueProtocol

FlagsClass Record

  • The FlagsClassRef type acts as a lightweight Swift reference to an underlying GFlagsClass instance. It exposes methods that can operate on this data type through FlagsClassProtocol conformance. Use FlagsClassRef only as an unowned reference to an existing GFlagsClass instance.

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

    See more

    Declaration

    Swift

    public struct FlagsClassRef : FlagsClassProtocol

FlagsValue Record

  • The FlagsValueRef type acts as a lightweight Swift reference to an underlying GFlagsValue instance. It exposes methods that can operate on this data type through FlagsValueProtocol conformance. Use FlagsValueRef only as an unowned reference to an existing GFlagsValue instance.

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

    See more

    Declaration

    Swift

    public struct FlagsValueRef : FlagsValueProtocol

InitiallyUnowned Class

  • The InitiallyUnownedRef type acts as a lightweight Swift reference to an underlying GInitiallyUnowned instance. It exposes methods that can operate on this data type through InitiallyUnownedProtocol conformance. Use InitiallyUnownedRef only as an unowned reference to an existing 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

    public struct InitiallyUnownedRef : InitiallyUnownedProtocol

InitiallyUnownedClass Record

  • The InitiallyUnownedClassRef type acts as a lightweight Swift reference to an underlying GInitiallyUnownedClass instance. It exposes methods that can operate on this data type through InitiallyUnownedClassProtocol conformance. Use InitiallyUnownedClassRef only as an unowned reference to an existing GInitiallyUnownedClass instance.

    The class structure for the GInitiallyUnowned type.

    See more

    Declaration

    Swift

    public struct InitiallyUnownedClassRef : InitiallyUnownedClassProtocol

InterfaceInfo Record

  • The InterfaceInfoRef type acts as a lightweight Swift reference to an underlying GInterfaceInfo instance. It exposes methods that can operate on this data type through InterfaceInfoProtocol conformance. Use InterfaceInfoRef only as an unowned reference to an existing GInterfaceInfo instance.

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

    See more

    Declaration

    Swift

    public struct InterfaceInfoRef : InterfaceInfoProtocol

Object Class

  • The ObjectRef type acts as a lightweight Swift reference to an underlying GObject instance. It exposes methods that can operate on this data type through ObjectProtocol conformance. Use ObjectRef only as an unowned reference to an existing 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

    public struct ObjectRef : ObjectProtocol

ObjectClass Record

  • The ObjectClassRef type acts as a lightweight Swift reference to an underlying GObjectClass instance. It exposes methods that can operate on this data type through ObjectClassProtocol conformance. Use ObjectClassRef only as an unowned reference to an existing 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

    public struct ObjectClassRef : ObjectClassProtocol

ObjectConstructParam Record

  • The ObjectConstructParamRef type acts as a lightweight Swift reference to an underlying GObjectConstructParam instance. It exposes methods that can operate on this data type through ObjectConstructParamProtocol conformance. Use ObjectConstructParamRef only as an unowned reference to an existing 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

    public struct ObjectConstructParamRef : ObjectConstructParamProtocol

ParamSpec Class

  • The ParamSpecRef type acts as a lightweight Swift reference to an underlying GParamSpec instance. It exposes methods that can operate on this data type through ParamSpecProtocol conformance. Use ParamSpecRef only as an unowned reference to an existing 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

    public struct ParamSpecRef : ParamSpecProtocol

ParamSpecBoolean Class

  • The ParamSpecBooleanRef type acts as a lightweight Swift reference to an underlying GParamSpecBoolean instance. It exposes methods that can operate on this data type through ParamSpecBooleanProtocol conformance. Use ParamSpecBooleanRef only as an unowned reference to an existing GParamSpecBoolean instance.

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

    See more

    Declaration

    Swift

    public struct ParamSpecBooleanRef : ParamSpecBooleanProtocol

ParamSpecBoxed Class

  • The ParamSpecBoxedRef type acts as a lightweight Swift reference to an underlying GParamSpecBoxed instance. It exposes methods that can operate on this data type through ParamSpecBoxedProtocol conformance. Use ParamSpecBoxedRef only as an unowned reference to an existing GParamSpecBoxed instance.

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

    See more

    Declaration

    Swift

    public struct ParamSpecBoxedRef : ParamSpecBoxedProtocol

ParamSpecChar Class

  • The ParamSpecCharRef type acts as a lightweight Swift reference to an underlying GParamSpecChar instance. It exposes methods that can operate on this data type through ParamSpecCharProtocol conformance. Use ParamSpecCharRef only as an unowned reference to an existing GParamSpecChar instance.

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

    See more

    Declaration

    Swift

    public struct ParamSpecCharRef : ParamSpecCharProtocol

ParamSpecClass Record

  • The ParamSpecClassRef type acts as a lightweight Swift reference to an underlying GParamSpecClass instance. It exposes methods that can operate on this data type through ParamSpecClassProtocol conformance. Use ParamSpecClassRef only as an unowned reference to an existing GParamSpecClass instance.

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

    See more

    Declaration

    Swift

    public struct ParamSpecClassRef : ParamSpecClassProtocol

ParamSpecDouble Class

  • The ParamSpecDoubleRef type acts as a lightweight Swift reference to an underlying GParamSpecDouble instance. It exposes methods that can operate on this data type through ParamSpecDoubleProtocol conformance. Use ParamSpecDoubleRef only as an unowned reference to an existing GParamSpecDouble instance.

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

    See more

    Declaration

    Swift

    public struct ParamSpecDoubleRef : ParamSpecDoubleProtocol

ParamSpecEnum Class

  • The ParamSpecEnumRef type acts as a lightweight Swift reference to an underlying GParamSpecEnum instance. It exposes methods that can operate on this data type through ParamSpecEnumProtocol conformance. Use ParamSpecEnumRef only as an unowned reference to an existing GParamSpecEnum instance.

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

    See more

    Declaration

    Swift

    public struct ParamSpecEnumRef : ParamSpecEnumProtocol

ParamSpecFlags Class

  • The ParamSpecFlagsRef type acts as a lightweight Swift reference to an underlying GParamSpecFlags instance. It exposes methods that can operate on this data type through ParamSpecFlagsProtocol conformance. Use ParamSpecFlagsRef only as an unowned reference to an existing GParamSpecFlags instance.

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

    See more

    Declaration

    Swift

    public struct ParamSpecFlagsRef : ParamSpecFlagsProtocol

ParamSpecFloat Class

  • The ParamSpecFloatRef type acts as a lightweight Swift reference to an underlying GParamSpecFloat instance. It exposes methods that can operate on this data type through ParamSpecFloatProtocol conformance. Use ParamSpecFloatRef only as an unowned reference to an existing GParamSpecFloat instance.

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

    See more

    Declaration

    Swift

    public struct ParamSpecFloatRef : ParamSpecFloatProtocol

ParamSpecGType Class

  • The ParamSpecGTypeRef type acts as a lightweight Swift reference to an underlying GParamSpecGType instance. It exposes methods that can operate on this data type through ParamSpecGTypeProtocol conformance. Use ParamSpecGTypeRef only as an unowned reference to an existing GParamSpecGType instance.

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

    See more

    Declaration

    Swift

    public struct ParamSpecGTypeRef : ParamSpecGTypeProtocol

ParamSpecInt Class

  • The ParamSpecIntRef type acts as a lightweight Swift reference to an underlying GParamSpecInt instance. It exposes methods that can operate on this data type through ParamSpecIntProtocol conformance. Use ParamSpecIntRef only as an unowned reference to an existing GParamSpecInt instance.

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

    See more

    Declaration

    Swift

    public struct ParamSpecIntRef : ParamSpecIntProtocol

ParamSpecInt64 Class

  • The ParamSpecInt64Ref type acts as a lightweight Swift reference to an underlying GParamSpecInt64 instance. It exposes methods that can operate on this data type through ParamSpecInt64Protocol conformance. Use ParamSpecInt64Ref only as an unowned reference to an existing GParamSpecInt64 instance.

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

    See more

    Declaration

    Swift

    public struct ParamSpecInt64Ref : ParamSpecInt64Protocol

ParamSpecLong Class

  • The ParamSpecLongRef type acts as a lightweight Swift reference to an underlying GParamSpecLong instance. It exposes methods that can operate on this data type through ParamSpecLongProtocol conformance. Use ParamSpecLongRef only as an unowned reference to an existing GParamSpecLong instance.

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

    See more

    Declaration

    Swift

    public struct ParamSpecLongRef : ParamSpecLongProtocol

ParamSpecObject Class

  • The ParamSpecObjectRef type acts as a lightweight Swift reference to an underlying GParamSpecObject instance. It exposes methods that can operate on this data type through ParamSpecObjectProtocol conformance. Use ParamSpecObjectRef only as an unowned reference to an existing GParamSpecObject instance.

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

    See more

    Declaration

    Swift

    public struct ParamSpecObjectRef : ParamSpecObjectProtocol

ParamSpecOverride Class

  • The ParamSpecOverrideRef type acts as a lightweight Swift reference to an underlying GParamSpecOverride instance. It exposes methods that can operate on this data type through ParamSpecOverrideProtocol conformance. Use ParamSpecOverrideRef only as an unowned reference to an existing 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

    public struct ParamSpecOverrideRef : ParamSpecOverrideProtocol

ParamSpecParam Class

  • The ParamSpecParamRef type acts as a lightweight Swift reference to an underlying GParamSpecParam instance. It exposes methods that can operate on this data type through ParamSpecParamProtocol conformance. Use ParamSpecParamRef only as an unowned reference to an existing GParamSpecParam instance.

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

    See more

    Declaration

    Swift

    public struct ParamSpecParamRef : ParamSpecParamProtocol

ParamSpecPointer Class

  • The ParamSpecPointerRef type acts as a lightweight Swift reference to an underlying GParamSpecPointer instance. It exposes methods that can operate on this data type through ParamSpecPointerProtocol conformance. Use ParamSpecPointerRef only as an unowned reference to an existing GParamSpecPointer instance.

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

    See more

    Declaration

    Swift

    public struct ParamSpecPointerRef : ParamSpecPointerProtocol

ParamSpecPool Record

  • The ParamSpecPoolRef type acts as a lightweight Swift reference to an underlying GParamSpecPool instance. It exposes methods that can operate on this data type through ParamSpecPoolProtocol conformance. Use ParamSpecPoolRef only as an unowned reference to an existing 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

    public struct ParamSpecPoolRef : ParamSpecPoolProtocol

ParamSpecString Class

  • The ParamSpecStringRef type acts as a lightweight Swift reference to an underlying GParamSpecString instance. It exposes methods that can operate on this data type through ParamSpecStringProtocol conformance. Use ParamSpecStringRef only as an unowned reference to an existing GParamSpecString instance.

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

    See more

    Declaration

    Swift

    public struct ParamSpecStringRef : ParamSpecStringProtocol

ParamSpecTypeInfo Record

  • The ParamSpecTypeInfoRef type acts as a lightweight Swift reference to an underlying GParamSpecTypeInfo instance. It exposes methods that can operate on this data type through ParamSpecTypeInfoProtocol conformance. Use ParamSpecTypeInfoRef only as an unowned reference to an existing 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

    public struct ParamSpecTypeInfoRef : ParamSpecTypeInfoProtocol

ParamSpecUChar Class

  • The ParamSpecUCharRef type acts as a lightweight Swift reference to an underlying GParamSpecUChar instance. It exposes methods that can operate on this data type through ParamSpecUCharProtocol conformance. Use ParamSpecUCharRef only as an unowned reference to an existing GParamSpecUChar instance.

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

    See more

    Declaration

    Swift

    public struct ParamSpecUCharRef : ParamSpecUCharProtocol

ParamSpecUInt Class

  • The ParamSpecUIntRef type acts as a lightweight Swift reference to an underlying GParamSpecUInt instance. It exposes methods that can operate on this data type through ParamSpecUIntProtocol conformance. Use ParamSpecUIntRef only as an unowned reference to an existing GParamSpecUInt instance.

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

    See more

    Declaration

    Swift

    public struct ParamSpecUIntRef : ParamSpecUIntProtocol

ParamSpecUInt64 Class

  • The ParamSpecUInt64Ref type acts as a lightweight Swift reference to an underlying GParamSpecUInt64 instance. It exposes methods that can operate on this data type through ParamSpecUInt64Protocol conformance. Use ParamSpecUInt64Ref only as an unowned reference to an existing GParamSpecUInt64 instance.

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

    See more

    Declaration

    Swift

    public struct ParamSpecUInt64Ref : ParamSpecUInt64Protocol

ParamSpecULong Class

  • The ParamSpecULongRef type acts as a lightweight Swift reference to an underlying GParamSpecULong instance. It exposes methods that can operate on this data type through ParamSpecULongProtocol conformance. Use ParamSpecULongRef only as an unowned reference to an existing GParamSpecULong instance.

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

    See more

    Declaration

    Swift

    public struct ParamSpecULongRef : ParamSpecULongProtocol

ParamSpecUnichar Class

  • The ParamSpecUnicharRef type acts as a lightweight Swift reference to an underlying GParamSpecUnichar instance. It exposes methods that can operate on this data type through ParamSpecUnicharProtocol conformance. Use ParamSpecUnicharRef only as an unowned reference to an existing GParamSpecUnichar instance.

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

    See more

    Declaration

    Swift

    public struct ParamSpecUnicharRef : ParamSpecUnicharProtocol

ParamSpecValueArray Class

  • The ParamSpecValueArrayRef type acts as a lightweight Swift reference to an underlying GParamSpecValueArray instance. It exposes methods that can operate on this data type through ParamSpecValueArrayProtocol conformance. Use ParamSpecValueArrayRef only as an unowned reference to an existing GParamSpecValueArray instance.

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

    See more

    Declaration

    Swift

    public struct ParamSpecValueArrayRef : ParamSpecValueArrayProtocol

ParamSpecVariant Class

  • The ParamSpecVariantRef type acts as a lightweight Swift reference to an underlying GParamSpecVariant instance. It exposes methods that can operate on this data type through ParamSpecVariantProtocol conformance. Use ParamSpecVariantRef only as an unowned reference to an existing 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

    public struct ParamSpecVariantRef : ParamSpecVariantProtocol

Parameter Record

  • The ParameterRef type acts as a lightweight Swift reference to an underlying GParameter instance. It exposes methods that can operate on this data type through ParameterProtocol conformance. Use ParameterRef only as an unowned reference to an existing GParameter instance.

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

    See more

    Declaration

    Swift

    public struct ParameterRef : ParameterProtocol

SignalInvocationHint Record

  • The SignalInvocationHintRef type acts as a lightweight Swift reference to an underlying GSignalInvocationHint instance. It exposes methods that can operate on this data type through SignalInvocationHintProtocol conformance. Use SignalInvocationHintRef only as an unowned reference to an existing GSignalInvocationHint instance.

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

    See more

    Declaration

    Swift

    public struct SignalInvocationHintRef : SignalInvocationHintProtocol

SignalQuery Record

  • The SignalQueryRef type acts as a lightweight Swift reference to an underlying GSignalQuery instance. It exposes methods that can operate on this data type through SignalQueryProtocol conformance. Use SignalQueryRef only as an unowned reference to an existing 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

    public struct SignalQueryRef : SignalQueryProtocol

TypeClass Record

  • The TypeClassRef type acts as a lightweight Swift reference to an underlying GTypeClass instance. It exposes methods that can operate on this data type through TypeClassProtocol conformance. Use TypeClassRef only as an unowned reference to an existing GTypeClass instance.

    An opaque structure used as the base of all classes.

    See more

    Declaration

    Swift

    public struct TypeClassRef : TypeClassProtocol

TypeFundamentalInfo Record

  • The TypeFundamentalInfoRef type acts as a lightweight Swift reference to an underlying GTypeFundamentalInfo instance. It exposes methods that can operate on this data type through TypeFundamentalInfoProtocol conformance. Use TypeFundamentalInfoRef only as an unowned reference to an existing GTypeFundamentalInfo instance.

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

    See more

    Declaration

    Swift

    public struct TypeFundamentalInfoRef : TypeFundamentalInfoProtocol

TypeInfo Record

  • The TypeInfoRef type acts as a lightweight Swift reference to an underlying GTypeInfo instance. It exposes methods that can operate on this data type through TypeInfoProtocol conformance. Use TypeInfoRef only as an unowned reference to an existing 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

    public struct TypeInfoRef : TypeInfoProtocol

TypeInstance Record

  • The TypeInstanceRef type acts as a lightweight Swift reference to an underlying GTypeInstance instance. It exposes methods that can operate on this data type through TypeInstanceProtocol conformance. Use TypeInstanceRef only as an unowned reference to an existing GTypeInstance instance.

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

    See more

    Declaration

    Swift

    public struct TypeInstanceRef : TypeInstanceProtocol

TypeInterface Record

  • The TypeInterfaceRef type acts as a lightweight Swift reference to an underlying GTypeInterface instance. It exposes methods that can operate on this data type through TypeInterfaceProtocol conformance. Use TypeInterfaceRef only as an unowned reference to an existing GTypeInterface instance.

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

    See more

    Declaration

    Swift

    public struct TypeInterfaceRef : TypeInterfaceProtocol

TypeModule Class

  • The TypeModuleRef type acts as a lightweight Swift reference to an underlying GTypeModule instance. It exposes methods that can operate on this data type through TypeModuleProtocol conformance. Use TypeModuleRef only as an unowned reference to an existing 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

    public struct TypeModuleRef : TypeModuleProtocol

TypeModuleClass Record

  • The TypeModuleClassRef type acts as a lightweight Swift reference to an underlying GTypeModuleClass instance. It exposes methods that can operate on this data type through TypeModuleClassProtocol conformance. Use TypeModuleClassRef only as an unowned reference to an existing 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

    public struct TypeModuleClassRef : TypeModuleClassProtocol

TypePlugin Interface

  • The TypePluginRef type acts as a lightweight Swift reference to an underlying GTypePlugin instance. It exposes methods that can operate on this data type through TypePluginProtocol conformance. Use TypePluginRef only as an unowned reference to an existing 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

    public struct TypePluginRef : TypePluginProtocol

TypePluginClass Record

  • The TypePluginClassRef type acts as a lightweight Swift reference to an underlying GTypePluginClass instance. It exposes methods that can operate on this data type through TypePluginClassProtocol conformance. Use TypePluginClassRef only as an unowned reference to an existing 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

    public struct TypePluginClassRef : TypePluginClassProtocol

TypeQuery Record

  • The TypeQueryRef type acts as a lightweight Swift reference to an underlying GTypeQuery instance. It exposes methods that can operate on this data type through TypeQueryProtocol conformance. Use TypeQueryRef only as an unowned reference to an existing GTypeQuery instance.

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

    See more

    Declaration

    Swift

    public struct TypeQueryRef : TypeQueryProtocol

TypeValueTable Record

  • The TypeValueTableRef type acts as a lightweight Swift reference to an underlying GTypeValueTable instance. It exposes methods that can operate on this data type through TypeValueTableProtocol conformance. Use TypeValueTableRef only as an unowned reference to an existing 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

    public struct TypeValueTableRef : TypeValueTableProtocol

Value Record

  • The ValueRef type acts as a lightweight Swift reference to an underlying GValue instance. It exposes methods that can operate on this data type through ValueProtocol conformance. Use ValueRef only as an unowned reference to an existing 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

    public struct ValueRef : ValueProtocol

ValueArray Record

  • The ValueArrayRef type acts as a lightweight Swift reference to an underlying GValueArray instance. It exposes methods that can operate on this data type through ValueArrayProtocol conformance. Use ValueArrayRef only as an unowned reference to an existing GValueArray instance.

    A GValueArray contains an array of GValue elements.

    See more

    Declaration

    Swift

    public struct ValueArrayRef : ValueArrayProtocol

WeakRef Record

  • The WeakRefRef type acts as a lightweight Swift reference to an underlying GWeakRef instance. It exposes methods that can operate on this data type through WeakRefProtocol conformance. Use WeakRefRef only as an unowned reference to an existing 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

    public struct WeakRefRef : WeakRefProtocol
  • Flags to be passed to g_object_bind_property() or g_object_bind_property_full().

    This enumeration can be extended at later date.

    See more

    Declaration

    Swift

    public struct BindingFlags : OptionSet
  • The connection flags are used to specify the behaviour of a signal’s connection.

    See more

    Declaration

    Swift

    public struct ConnectFlags : OptionSet
  • Through the GParamFlags flag values, certain aspects of parameters can be configured. See also G_PARAM_STATIC_STRINGS.

    See more

    Declaration

    Swift

    public struct ParamFlags : OptionSet
  • The signal flags are used to specify a signal’s behaviour, the overall signal description outlines how especially the RUN flags control the stages of a signal emission.

    See more

    Declaration

    Swift

    public struct SignalFlags : OptionSet
  • The match types specify what g_signal_handlers_block_matched(), g_signal_handlers_unblock_matched() and g_signal_handlers_disconnect_matched() match signals by.

    See more

    Declaration

    Swift

    public struct SignalMatchType : OptionSet
  • These flags used to be passed to g_type_init_with_debug_flags() which is now deprecated.

    If you need to enable debugging features, use the GOBJECT_DEBUG environment variable.

    TypeDebugFlags is deprecated: g_type_init() is now done automatically

    See more

    Declaration

    Swift

    public struct TypeDebugFlags : OptionSet
  • Bit masks used to check or determine characteristics of a type.

    See more

    Declaration

    Swift

    public struct TypeFlags : OptionSet
  • Bit masks used to check or determine specific characteristics of a fundamental type.

    See more

    Declaration

    Swift

    public struct TypeFundamentalFlags : OptionSet

TypeCValue Union

  • The TypeCValueRef type acts as a lightweight Swift reference to an underlying GTypeCValue instance. It exposes methods that can operate on this data type through TypeCValueProtocol conformance. Use TypeCValueRef only as an unowned reference to an existing GTypeCValue instance.

    See more

    Declaration

    Swift

    public struct TypeCValueRef : TypeCValueProtocol

Valuedata_union Union