ValueProtocol

public protocol ValueProtocol

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 ValueProtocol protocol exposes the methods and properties of an underlying GValue instance. The default implementation of these can be found in the protocol extension below. For a concrete class that implements these methods and properties, see Value. Alternatively, use ValueRef as a lighweight, unowned reference if you already have an instance you just want to use.

  • ptr

    Untyped pointer to the underlying GValue instance.

    Declaration

    Swift

    var ptr: UnsafeMutableRawPointer! { get }
  • value_ptr Default implementation

    Typed pointer to the underlying GValue instance.

    Default Implementation

    Return the stored, untyped pointer as a typed pointer to the GValue instance.

    Declaration

    Swift

    var value_ptr: UnsafeMutablePointer<GValue>! { get }
  • Required Initialiser for types conforming to ValueProtocol

    Declaration

    Swift

    init(raw: UnsafeMutableRawPointer)

Value Record: ValueProtocol extension (methods and fields)

  • copy(destValue:) Extension method

    Copies the value of src_value into dest_value.

    Declaration

    Swift

    @inlinable
    func copy<ValueT>(destValue: ValueT) where ValueT : ValueProtocol
  • dupBoxed() Extension method

    Get the contents of a G_TYPE_BOXED derived GValue. Upon getting, the boxed value is duplicated and needs to be later freed with g_boxed_free(), e.g. like: g_boxed_free (G_VALUE_TYPE (value), return_value);

    Declaration

    Swift

    @inlinable
    func dupBoxed() -> gpointer?
  • dupObject() Extension method

    Get the contents of a G_TYPE_OBJECT derived GValue, increasing its reference count. If the contents of the GValue are nil, then nil will be returned.

    Declaration

    Swift

    @inlinable
    func dupObject() -> GLibObject.ObjectRef!
  • dupParam() Extension method

    Get the contents of a G_TYPE_PARAM GValue, increasing its reference count.

    Declaration

    Swift

    @inlinable
    func dupParam() -> GLibObject.ParamSpecRef!
  • dupString() Extension method

    Get a copy the contents of a G_TYPE_STRING GValue.

    Declaration

    Swift

    @inlinable
    func dupString() -> String!
  • dupVariant() Extension method

    Get the contents of a variant GValue, increasing its refcount. The returned GVariant is never floating.

    Declaration

    Swift

    @inlinable
    func dupVariant() -> GLib.VariantRef!
  • fitsPointer() Extension method

    Determines if value will fit inside the size of a pointer value. This is an internal function introduced mainly for C marshallers.

    Declaration

    Swift

    @inlinable
    func fitsPointer() -> Bool
  • getBoolean() Extension method

    Get the contents of a G_TYPE_BOOLEAN GValue.

    Declaration

    Swift

    @inlinable
    func getBoolean() -> Bool
  • getBoxed() Extension method

    Get the contents of a G_TYPE_BOXED derived GValue.

    Declaration

    Swift

    @inlinable
    func getBoxed() -> gpointer?
  • getChar() Extension method

    Do not use this function; it is broken on platforms where the char type is unsigned, such as ARM and PowerPC. See g_value_get_schar().

    Get the contents of a G_TYPE_CHAR GValue.

    get_char is deprecated: This function’s return type is broken, see g_value_get_schar()

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func getChar() -> gchar
  • getDouble() Extension method

    Get the contents of a G_TYPE_DOUBLE GValue.

    Declaration

    Swift

    @inlinable
    func getDouble() -> Double
  • getEnum() Extension method

    Get the contents of a G_TYPE_ENUM GValue.

    Declaration

    Swift

    @inlinable
    func getEnum() -> Int
  • getFlags() Extension method

    Get the contents of a G_TYPE_FLAGS GValue.

    Declaration

    Swift

    @inlinable
    func getFlags() -> Int
  • getFloat() Extension method

    Get the contents of a G_TYPE_FLOAT GValue.

    Declaration

    Swift

    @inlinable
    func getFloat() -> Double
  • getGtype() Extension method

    Get the contents of a G_TYPE_GTYPE GValue.

    Declaration

    Swift

    @inlinable
    func getGtype() -> GType
  • getInt() Extension method

    Get the contents of a G_TYPE_INT GValue.

    Declaration

    Swift

    @inlinable
    func getInt() -> Int
  • getInt64() Extension method

    Get the contents of a G_TYPE_INT64 GValue.

    Declaration

    Swift

    @inlinable
    func getInt64() -> gint64
  • getLong() Extension method

    Get the contents of a G_TYPE_LONG GValue.

    Declaration

    Swift

    @inlinable
    func getLong() -> Int
  • getObject() Extension method

    Get the contents of a G_TYPE_OBJECT derived GValue.

    Declaration

    Swift

    @inlinable
    func getObject() -> GLibObject.ObjectRef!
  • getParam() Extension method

    Get the contents of a G_TYPE_PARAM GValue.

    Declaration

    Swift

    @inlinable
    func getParam() -> GLibObject.ParamSpecRef!
  • getPointer() Extension method

    Get the contents of a pointer GValue.

    Declaration

    Swift

    @inlinable
    func getPointer() -> gpointer?
  • getSchar() Extension method

    Get the contents of a G_TYPE_CHAR GValue.

    Declaration

    Swift

    @inlinable
    func getSchar() -> gint8
  • getString() Extension method

    Get the contents of a G_TYPE_STRING GValue.

    Declaration

    Swift

    @inlinable
    func getString() -> String!
  • getUchar() Extension method

    Get the contents of a G_TYPE_UCHAR GValue.

    Declaration

    Swift

    @inlinable
    func getUchar() -> guchar
  • getUint() Extension method

    Get the contents of a G_TYPE_UINT GValue.

    Declaration

    Swift

    @inlinable
    func getUint() -> Int
  • getUint64() Extension method

    Get the contents of a G_TYPE_UINT64 GValue.

    Declaration

    Swift

    @inlinable
    func getUint64() -> guint64
  • getUlong() Extension method

    Get the contents of a G_TYPE_ULONG GValue.

    Declaration

    Swift

    @inlinable
    func getUlong() -> Int
  • getVariant() Extension method

    Get the contents of a variant GValue.

    Declaration

    Swift

    @inlinable
    func getVariant() -> GLib.VariantRef!
  • init_(gType:) Extension method

    Initializes value with the default value of type.

    Declaration

    Swift

    @inlinable
    func init_(gType: GType) -> GLibObject.ValueRef!
  • initFrom(instance:) Extension method

    Initializes and sets value from an instantiatable type via the value_table’s collect_value() function.

    Note: The value will be initialised with the exact type of instance. If you wish to set the value‘s type to a different GType (such as a parent class GType), you need to manually call g_value_init() and g_value_set_instance().

    Declaration

    Swift

    @inlinable
    func initFrom<TypeInstanceT>(instance: TypeInstanceT) where TypeInstanceT : TypeInstanceProtocol
  • peekPointer() Extension method

    Returns the value contents as pointer. This function asserts that g_value_fits_pointer() returned true for the passed in value. This is an internal function introduced mainly for C marshallers.

    Declaration

    Swift

    @inlinable
    func peekPointer() -> gpointer?
  • reset() Extension method

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

    Declaration

    Swift

    @inlinable
    func reset() -> GLibObject.ValueRef!
  • setBoolean(vBoolean:) Extension method

    Set the contents of a G_TYPE_BOOLEAN GValue to v_boolean.

    Declaration

    Swift

    @inlinable
    func setBoolean(vBoolean: Bool)
  • setBoxed(vBoxed:) Extension method

    Set the contents of a G_TYPE_BOXED derived GValue to v_boxed.

    Declaration

    Swift

    @inlinable
    func setBoxed(vBoxed: gconstpointer? = nil)
  • This is an internal function introduced mainly for C marshallers.

    set_boxed_take_ownership is deprecated: Use g_value_take_boxed() instead.

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func setBoxedTakeOwnership(vBoxed: gconstpointer? = nil)
  • setChar(vChar:) Extension method

    Set the contents of a G_TYPE_CHAR GValue to v_char.

    set_char is deprecated: This function’s input type is broken, see g_value_set_schar()

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func setChar(vChar: gchar)
  • setDouble(vDouble:) Extension method

    Set the contents of a G_TYPE_DOUBLE GValue to v_double.

    Declaration

    Swift

    @inlinable
    func setDouble(vDouble: Double)
  • setEnum(vEnum:) Extension method

    Set the contents of a G_TYPE_ENUM GValue to v_enum.

    Declaration

    Swift

    @inlinable
    func setEnum(vEnum: Int)
  • setFlags(vFlags:) Extension method

    Set the contents of a G_TYPE_FLAGS GValue to v_flags.

    Declaration

    Swift

    @inlinable
    func setFlags(vFlags: Int)
  • setFloat(vFloat:) Extension method

    Set the contents of a G_TYPE_FLOAT GValue to v_float.

    Declaration

    Swift

    @inlinable
    func setFloat(vFloat: Double)
  • setGtype(vGtype:) Extension method

    Set the contents of a G_TYPE_GTYPE GValue to v_gtype.

    Declaration

    Swift

    @inlinable
    func setGtype(vGtype: GType)
  • set(instance:) Extension method

    Sets value from an instantiatable type via the value_table’s collect_value() function.

    Declaration

    Swift

    @inlinable
    func set(instance: gpointer? = nil)
  • setInt(vInt:) Extension method

    Set the contents of a G_TYPE_INT GValue to v_int.

    Declaration

    Swift

    @inlinable
    func setInt(vInt: gint)
  • setInt64(vInt64:) Extension method

    Set the contents of a G_TYPE_INT64 GValue to v_int64.

    Declaration

    Swift

    @inlinable
    func setInt64(vInt64: gint64)
  • setInternedString(vString:) Extension method

    Set the contents of a G_TYPE_STRING GValue to v_string. The string is assumed to be static and interned (canonical, for example from g_intern_string()), and is thus not duplicated when setting the GValue.

    Declaration

    Swift

    @inlinable
    func setInternedString(vString: UnsafePointer<gchar>? = nil)
  • setLong(vLong:) Extension method

    Set the contents of a G_TYPE_LONG GValue to v_long.

    Declaration

    Swift

    @inlinable
    func setLong(vLong: Int)
  • setObject(vObject:) Extension method

    Set the contents of a G_TYPE_OBJECT derived GValue to v_object.

    g_value_set_object() increases the reference count of v_object (the GValue holds a reference to v_object). If you do not wish to increase the reference count of the object (i.e. you wish to pass your current reference to the GValue because you no longer need it), use g_value_take_object() instead.

    It is important that your GValue holds a reference to v_object (either its own, or one it has taken) to ensure that the object won’t be destroyed while the GValue still exists).

    Declaration

    Swift

    @inlinable
    func setObject(vObject: ObjectRef? = nil)
  • setObject(vObject:) Extension method

    Set the contents of a G_TYPE_OBJECT derived GValue to v_object.

    g_value_set_object() increases the reference count of v_object (the GValue holds a reference to v_object). If you do not wish to increase the reference count of the object (i.e. you wish to pass your current reference to the GValue because you no longer need it), use g_value_take_object() instead.

    It is important that your GValue holds a reference to v_object (either its own, or one it has taken) to ensure that the object won’t be destroyed while the GValue still exists).

    Declaration

    Swift

    @inlinable
    func setObject<ObjectT>(vObject: ObjectT?) where ObjectT : ObjectProtocol
  • This is an internal function introduced mainly for C marshallers.

    set_object_take_ownership is deprecated: Use g_value_take_object() instead.

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func setObjectTakeOwnership(vObject: gpointer? = nil)
  • set(param:) Extension method

    Set the contents of a G_TYPE_PARAM GValue to param.

    Declaration

    Swift

    @inlinable
    func set(param: ParamSpecRef? = nil)
  • set(param:) Extension method

    Set the contents of a G_TYPE_PARAM GValue to param.

    Declaration

    Swift

    @inlinable
    func set<ParamSpecT>(param: ParamSpecT?) where ParamSpecT : ParamSpecProtocol
  • This is an internal function introduced mainly for C marshallers.

    set_param_take_ownership is deprecated: Use g_value_take_param() instead.

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func setParamTakeOwnership(param: ParamSpecRef? = nil)
  • This is an internal function introduced mainly for C marshallers.

    set_param_take_ownership is deprecated: Use g_value_take_param() instead.

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func setParamTakeOwnership<ParamSpecT>(param: ParamSpecT?) where ParamSpecT : ParamSpecProtocol
  • setPointer(vPointer:) Extension method

    Set the contents of a pointer GValue to v_pointer.

    Declaration

    Swift

    @inlinable
    func setPointer(vPointer: gpointer? = nil)
  • setSchar(vChar:) Extension method

    Set the contents of a G_TYPE_CHAR GValue to v_char.

    Declaration

    Swift

    @inlinable
    func setSchar(vChar: gint8)
  • setStaticBoxed(vBoxed:) Extension method

    Set the contents of a G_TYPE_BOXED derived GValue to v_boxed.

    The boxed value is assumed to be static, and is thus not duplicated when setting the GValue.

    Declaration

    Swift

    @inlinable
    func setStaticBoxed(vBoxed: gconstpointer? = nil)
  • setStaticString(vString:) Extension method

    Set the contents of a G_TYPE_STRING GValue to v_string. The string is assumed to be static, and is thus not duplicated when setting the GValue.

    If the the string is a canonical string, using g_value_set_interned_string() is more appropriate.

    Declaration

    Swift

    @inlinable
    func setStaticString(vString: UnsafePointer<gchar>? = nil)
  • setString(vString:) Extension method

    Set the contents of a G_TYPE_STRING GValue to a copy of v_string.

    Declaration

    Swift

    @inlinable
    func setString(vString: UnsafePointer<gchar>? = nil)
  • This is an internal function introduced mainly for C marshallers.

    set_string_take_ownership is deprecated: Use g_value_take_string() instead.

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func setStringTakeOwnership(vString: UnsafeMutablePointer<gchar>? = nil)
  • setUchar(vUchar:) Extension method

    Set the contents of a G_TYPE_UCHAR GValue to v_uchar.

    Declaration

    Swift

    @inlinable
    func setUchar(vUchar: guchar)
  • setUint(vUint:) Extension method

    Set the contents of a G_TYPE_UINT GValue to v_uint.

    Declaration

    Swift

    @inlinable
    func setUint(vUint: guint)
  • setUint64(vUint64:) Extension method

    Set the contents of a G_TYPE_UINT64 GValue to v_uint64.

    Declaration

    Swift

    @inlinable
    func setUint64(vUint64: guint64)
  • setUlong(vUlong:) Extension method

    Set the contents of a G_TYPE_ULONG GValue to v_ulong.

    Declaration

    Swift

    @inlinable
    func setUlong(vUlong: gulong)
  • set(variant:) Extension method

    Set the contents of a variant GValue to variant. If the variant is floating, it is consumed.

    Declaration

    Swift

    @inlinable
    func set(variant: GLib.VariantRef? = nil)
  • set(variant:) Extension method

    Set the contents of a variant GValue to variant. If the variant is floating, it is consumed.

    Declaration

    Swift

    @inlinable
    func set<GLibVariantT>(variant: GLibVariantT?) where GLibVariantT : VariantProtocol
  • takeBoxed(vBoxed:) Extension method

    Sets the contents of a G_TYPE_BOXED derived GValue to v_boxed and takes over the ownership of the caller’s reference to v_boxed; the caller doesn’t have to unref it any more.

    Declaration

    Swift

    @inlinable
    func takeBoxed(vBoxed: gconstpointer? = nil)
  • takeObject(vObject:) Extension method

    Sets the contents of a G_TYPE_OBJECT derived GValue to v_object and takes over the ownership of the caller’s reference to v_object; the caller doesn’t have to unref it any more (i.e. the reference count of the object is not increased).

    If you want the GValue to hold its own reference to v_object, use g_value_set_object() instead.

    Declaration

    Swift

    @inlinable
    func takeObject(vObject: gpointer? = nil)
  • take(param:) Extension method

    Sets the contents of a G_TYPE_PARAM GValue to param and takes over the ownership of the caller’s reference to param; the caller doesn’t have to unref it any more.

    Declaration

    Swift

    @inlinable
    func take(param: ParamSpecRef? = nil)
  • take(param:) Extension method

    Sets the contents of a G_TYPE_PARAM GValue to param and takes over the ownership of the caller’s reference to param; the caller doesn’t have to unref it any more.

    Declaration

    Swift

    @inlinable
    func take<ParamSpecT>(param: ParamSpecT?) where ParamSpecT : ParamSpecProtocol
  • takeString(vString:) Extension method

    Sets the contents of a G_TYPE_STRING GValue to v_string.

    Declaration

    Swift

    @inlinable
    func takeString(vString: UnsafeMutablePointer<gchar>? = nil)
  • take(variant:) Extension method

    Set the contents of a variant GValue to variant, and takes over the ownership of the caller’s reference to variant; the caller doesn’t have to unref it any more (i.e. the reference count of the variant is not increased).

    If variant was floating then its floating reference is converted to a hard reference.

    If you want the GValue to hold its own reference to variant, use g_value_set_variant() instead.

    This is an internal function introduced mainly for C marshallers.

    Declaration

    Swift

    @inlinable
    func take(variant: GLib.VariantRef? = nil)
  • take(variant:) Extension method

    Set the contents of a variant GValue to variant, and takes over the ownership of the caller’s reference to variant; the caller doesn’t have to unref it any more (i.e. the reference count of the variant is not increased).

    If variant was floating then its floating reference is converted to a hard reference.

    If you want the GValue to hold its own reference to variant, use g_value_set_variant() instead.

    This is an internal function introduced mainly for C marshallers.

    Declaration

    Swift

    @inlinable
    func take<GLibVariantT>(variant: GLibVariantT?) where GLibVariantT : VariantProtocol
  • transform(destValue:) Extension method

    Tries to cast the contents of src_value into a type appropriate to store in dest_value, e.g. to transform a G_TYPE_INT value into a G_TYPE_FLOAT value. Performing transformations between value types might incur precision lossage. Especially transformations into strings might reveal seemingly arbitrary results and shouldn’t be relied upon for production code (such as rcfile value or object property serialization).

    Declaration

    Swift

    @inlinable
    func transform<ValueT>(destValue: ValueT) -> Bool where ValueT : ValueProtocol
  • unset() Extension method

    Clears the current value in value (if any) and “unsets” the type, this releases all resources associated with this GValue. An unset value is the same as an uninitialized (zero-filled) GValue structure.

    Declaration

    Swift

    @inlinable
    func unset()
  • A GClosureMarshal function for use with signals with handlers that take two boxed pointers as arguments and return a boolean. If you have such a signal, you will probably also need to use an accumulator, such as g_signal_accumulator_true_handled().

    Declaration

    Swift

    @inlinable
    func cclosureMarshalBOOLEANBOXEDBOXED<ClosureT, ValueT>(closure: ClosureT, nParamValues: Int, paramValues: ValueT, invocationHint: gpointer? = nil, marshalData: gpointer? = nil) where ClosureT : ClosureProtocol, ValueT : ValueProtocol
  • A marshaller for a GCClosure with a callback of type gboolean (*callback) (gpointer instance, gint arg1, gpointer user_data) where the gint parameter denotes a flags type.

    Declaration

    Swift

    @inlinable
    func cclosureMarshalBOOLEANFLAGS<ClosureT, ValueT>(closure: ClosureT, nParamValues: Int, paramValues: ValueT, invocationHint: gpointer? = nil, marshalData: gpointer? = nil) where ClosureT : ClosureProtocol, ValueT : ValueProtocol
  • A marshaller for a GCClosure with a callback of type gchar* (*callback) (gpointer instance, GObject *arg1, gpointer arg2, gpointer user_data).

    Declaration

    Swift

    @inlinable
    func cclosureMarshalSTRINGOBJECTPOINTER<ClosureT, ValueT>(closure: ClosureT, nParamValues: Int, paramValues: ValueT, invocationHint: gpointer? = nil, marshalData: gpointer? = nil) where ClosureT : ClosureProtocol, ValueT : ValueProtocol
  • A marshaller for a GCClosure with a callback of type void (*callback) (gpointer instance, gboolean arg1, gpointer user_data).

    Declaration

    Swift

    @inlinable
    func cclosureMarshalVOIDBOOLEAN<ClosureT, ValueT>(closure: ClosureT, nParamValues: Int, paramValues: ValueT, invocationHint: gpointer? = nil, marshalData: gpointer? = nil) where ClosureT : ClosureProtocol, ValueT : ValueProtocol
  • A marshaller for a GCClosure with a callback of type void (*callback) (gpointer instance, GBoxed *arg1, gpointer user_data).

    Declaration

    Swift

    @inlinable
    func cclosureMarshalVOIDBOXED<ClosureT, ValueT>(closure: ClosureT, nParamValues: Int, paramValues: ValueT, invocationHint: gpointer? = nil, marshalData: gpointer? = nil) where ClosureT : ClosureProtocol, ValueT : ValueProtocol
  • A marshaller for a GCClosure with a callback of type void (*callback) (gpointer instance, gchar arg1, gpointer user_data).

    Declaration

    Swift

    @inlinable
    func cclosureMarshalVOIDCHAR<ClosureT, ValueT>(closure: ClosureT, nParamValues: Int, paramValues: ValueT, invocationHint: gpointer? = nil, marshalData: gpointer? = nil) where ClosureT : ClosureProtocol, ValueT : ValueProtocol
  • A marshaller for a GCClosure with a callback of type void (*callback) (gpointer instance, gdouble arg1, gpointer user_data).

    Declaration

    Swift

    @inlinable
    func cclosureMarshalVOIDDOUBLE<ClosureT, ValueT>(closure: ClosureT, nParamValues: Int, paramValues: ValueT, invocationHint: gpointer? = nil, marshalData: gpointer? = nil) where ClosureT : ClosureProtocol, ValueT : ValueProtocol
  • A marshaller for a GCClosure with a callback of type void (*callback) (gpointer instance, gint arg1, gpointer user_data) where the gint parameter denotes an enumeration type..

    Declaration

    Swift

    @inlinable
    func cclosureMarshalVOIDENUM<ClosureT, ValueT>(closure: ClosureT, nParamValues: Int, paramValues: ValueT, invocationHint: gpointer? = nil, marshalData: gpointer? = nil) where ClosureT : ClosureProtocol, ValueT : ValueProtocol
  • A marshaller for a GCClosure with a callback of type void (*callback) (gpointer instance, gint arg1, gpointer user_data) where the gint parameter denotes a flags type.

    Declaration

    Swift

    @inlinable
    func cclosureMarshalVOIDFLAGS<ClosureT, ValueT>(closure: ClosureT, nParamValues: Int, paramValues: ValueT, invocationHint: gpointer? = nil, marshalData: gpointer? = nil) where ClosureT : ClosureProtocol, ValueT : ValueProtocol
  • A marshaller for a GCClosure with a callback of type void (*callback) (gpointer instance, gfloat arg1, gpointer user_data).

    Declaration

    Swift

    @inlinable
    func cclosureMarshalVOIDFLOAT<ClosureT, ValueT>(closure: ClosureT, nParamValues: Int, paramValues: ValueT, invocationHint: gpointer? = nil, marshalData: gpointer? = nil) where ClosureT : ClosureProtocol, ValueT : ValueProtocol
  • A marshaller for a GCClosure with a callback of type void (*callback) (gpointer instance, gint arg1, gpointer user_data).

    Declaration

    Swift

    @inlinable
    func cclosureMarshalVOIDINT<ClosureT, ValueT>(closure: ClosureT, nParamValues: Int, paramValues: ValueT, invocationHint: gpointer? = nil, marshalData: gpointer? = nil) where ClosureT : ClosureProtocol, ValueT : ValueProtocol
  • A marshaller for a GCClosure with a callback of type void (*callback) (gpointer instance, glong arg1, gpointer user_data).

    Declaration

    Swift

    @inlinable
    func cclosureMarshalVOIDLONG<ClosureT, ValueT>(closure: ClosureT, nParamValues: Int, paramValues: ValueT, invocationHint: gpointer? = nil, marshalData: gpointer? = nil) where ClosureT : ClosureProtocol, ValueT : ValueProtocol
  • A marshaller for a GCClosure with a callback of type void (*callback) (gpointer instance, GObject *arg1, gpointer user_data).

    Declaration

    Swift

    @inlinable
    func cclosureMarshalVOIDOBJECT<ClosureT, ValueT>(closure: ClosureT, nParamValues: Int, paramValues: ValueT, invocationHint: gpointer? = nil, marshalData: gpointer? = nil) where ClosureT : ClosureProtocol, ValueT : ValueProtocol
  • A marshaller for a GCClosure with a callback of type void (*callback) (gpointer instance, GParamSpec *arg1, gpointer user_data).

    Declaration

    Swift

    @inlinable
    func cclosureMarshalVOIDPARAM<ClosureT, ValueT>(closure: ClosureT, nParamValues: Int, paramValues: ValueT, invocationHint: gpointer? = nil, marshalData: gpointer? = nil) where ClosureT : ClosureProtocol, ValueT : ValueProtocol
  • A marshaller for a GCClosure with a callback of type void (*callback) (gpointer instance, gpointer arg1, gpointer user_data).

    Declaration

    Swift

    @inlinable
    func cclosureMarshalVOIDPOINTER<ClosureT, ValueT>(closure: ClosureT, nParamValues: Int, paramValues: ValueT, invocationHint: gpointer? = nil, marshalData: gpointer? = nil) where ClosureT : ClosureProtocol, ValueT : ValueProtocol
  • A marshaller for a GCClosure with a callback of type void (*callback) (gpointer instance, const gchar *arg1, gpointer user_data).

    Declaration

    Swift

    @inlinable
    func cclosureMarshalVOIDSTRING<ClosureT, ValueT>(closure: ClosureT, nParamValues: Int, paramValues: ValueT, invocationHint: gpointer? = nil, marshalData: gpointer? = nil) where ClosureT : ClosureProtocol, ValueT : ValueProtocol
  • A marshaller for a GCClosure with a callback of type void (*callback) (gpointer instance, guchar arg1, gpointer user_data).

    Declaration

    Swift

    @inlinable
    func cclosureMarshalVOIDUCHAR<ClosureT, ValueT>(closure: ClosureT, nParamValues: Int, paramValues: ValueT, invocationHint: gpointer? = nil, marshalData: gpointer? = nil) where ClosureT : ClosureProtocol, ValueT : ValueProtocol
  • A marshaller for a GCClosure with a callback of type void (*callback) (gpointer instance, guint arg1, gpointer user_data).

    Declaration

    Swift

    @inlinable
    func cclosureMarshalVOIDUINT<ClosureT, ValueT>(closure: ClosureT, nParamValues: Int, paramValues: ValueT, invocationHint: gpointer? = nil, marshalData: gpointer? = nil) where ClosureT : ClosureProtocol, ValueT : ValueProtocol
  • A marshaller for a GCClosure with a callback of type void (*callback) (gpointer instance, guint arg1, gpointer arg2, gpointer user_data).

    Declaration

    Swift

    @inlinable
    func cclosureMarshalVOIDUINTPOINTER<ClosureT, ValueT>(closure: ClosureT, nParamValues: Int, paramValues: ValueT, invocationHint: gpointer? = nil, marshalData: gpointer? = nil) where ClosureT : ClosureProtocol, ValueT : ValueProtocol
  • A marshaller for a GCClosure with a callback of type void (*callback) (gpointer instance, gulong arg1, gpointer user_data).

    Declaration

    Swift

    @inlinable
    func cclosureMarshalVOIDULONG<ClosureT, ValueT>(closure: ClosureT, nParamValues: Int, paramValues: ValueT, invocationHint: gpointer? = nil, marshalData: gpointer? = nil) where ClosureT : ClosureProtocol, ValueT : ValueProtocol
  • A marshaller for a GCClosure with a callback of type void (*callback) (gpointer instance, GVariant *arg1, gpointer user_data).

    Declaration

    Swift

    @inlinable
    func cclosureMarshalVOIDVARIANT<ClosureT, ValueT>(closure: ClosureT, nParamValues: Int, paramValues: ValueT, invocationHint: gpointer? = nil, marshalData: gpointer? = nil) where ClosureT : ClosureProtocol, ValueT : ValueProtocol
  • A marshaller for a GCClosure with a callback of type void (*callback) (gpointer instance, gpointer user_data).

    Declaration

    Swift

    @inlinable
    func cclosureMarshalVOIDVOID<ClosureT, ValueT>(closure: ClosureT, nParamValues: Int, paramValues: ValueT, invocationHint: gpointer? = nil, marshalData: gpointer? = nil) where ClosureT : ClosureProtocol, ValueT : ValueProtocol
  • A generic marshaller function implemented via libffi.

    Normally this function is not passed explicitly to g_signal_new(), but used automatically by GLib when specifying a nil marshaller.

    Declaration

    Swift

    @inlinable
    func cclosureMarshalGeneric<ClosureT, ValueT>(closure: ClosureT, nParamValues: Int, paramValues: ValueT, invocationHint: gpointer? = nil, marshalData: gpointer? = nil) where ClosureT : ClosureProtocol, ValueT : ValueProtocol
  • Transforms src_value into dest_value if possible, and then validates dest_value, in order for it to conform to pspec. If strict_validation is true this function will only succeed if the transformed dest_value complied to pspec without modifications.

    See also g_value_type_transformable(), g_value_transform() and g_param_value_validate().

    Declaration

    Swift

    @inlinable
    func paramValueConvert<ParamSpecT, ValueT>(pspec: ParamSpecT, destValue: ValueT, strictValidation: Bool) -> Bool where ParamSpecT : ParamSpecProtocol, ValueT : ValueProtocol
  • paramValueDefaults(pspec:) Extension method

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

    Declaration

    Swift

    @inlinable
    func paramValueDefaults<ParamSpecT>(pspec: ParamSpecT) -> Bool where ParamSpecT : ParamSpecProtocol
  • paramValueSetDefault(pspec:) Extension method

    Sets value to its default value as specified in pspec.

    Declaration

    Swift

    @inlinable
    func paramValueSetDefault<ParamSpecT>(pspec: ParamSpecT) where ParamSpecT : ParamSpecProtocol
  • paramValueValidate(pspec:) Extension method

    Ensures that the contents of value comply with the specifications set out by pspec. For example, a GParamSpecInt might require that integers stored in value may not be smaller than -42 and not be greater than +42. If value contains an integer outside of this range, it is modified accordingly, so the resulting value will fit into the range -42 .. +42.

    Declaration

    Swift

    @inlinable
    func paramValueValidate<ParamSpecT>(pspec: ParamSpecT) -> Bool where ParamSpecT : ParamSpecProtocol
  • Compares value1 with value2 according to pspec, and return -1, 0 or +1, if value1 is found to be less than, equal to or greater than value2, respectively.

    Declaration

    Swift

    @inlinable
    func paramValuesCmp<ParamSpecT, ValueT>(pspec: ParamSpecT, value2: ValueT) -> Int where ParamSpecT : ParamSpecProtocol, ValueT : ValueProtocol
  • A predefined GSignalAccumulator for signals intended to be used as a hook for application code to provide a particular value. Usually only one such value is desired and multiple handlers for the same signal don’t make much sense (except for the case of the default handler defined in the class structure, in which case you will usually want the signal connection to override the class handler).

    This accumulator will use the return value from the first signal handler that is run as the return value for the signal and not run any further handlers (ie: the first handler “wins”).

    Declaration

    Swift

    @inlinable
    func signalAccumulatorFirstWins<SignalInvocationHintT, ValueT>(ihint: SignalInvocationHintT, handlerReturn: ValueT, dummy: gpointer? = nil) -> Bool where SignalInvocationHintT : SignalInvocationHintProtocol, ValueT : ValueProtocol
  • A predefined GSignalAccumulator for signals that return a boolean values. The behavior that this accumulator gives is that a return of true stops the signal emission: no further callbacks will be invoked, while a return of false allows the emission to continue. The idea here is that a true return indicates that the callback handled the signal, and no further handling is needed.

    Declaration

    Swift

    @inlinable
    func signalAccumulatorTrueHandled<SignalInvocationHintT, ValueT>(ihint: SignalInvocationHintT, handlerReturn: ValueT, dummy: gpointer? = nil) -> Bool where SignalInvocationHintT : SignalInvocationHintProtocol, ValueT : ValueProtocol
  • Calls the original class closure of a signal. This function should only be called from an overridden class closure; see g_signal_override_class_closure() and g_signal_override_class_handler().

    Declaration

    Swift

    @inlinable
    func signalChainFromOverridden(instanceAndParams: UnsafePointer<GValue>!)
  • Emits a signal. Signal emission is done synchronously. The method will only return control after all handlers are called or signal emission was stopped.

    Note that g_signal_emitv() doesn’t change return_value if no handlers are connected, in contrast to g_signal_emit() and g_signal_emit_valist().

    Declaration

    Swift

    @inlinable
    func signalEmitv(instanceAndParams: UnsafePointer<GValue>!, signalID: Int, detail: GQuark)
  • strdupValueContents() Extension method

    Return a newly allocated string, which describes the contents of a GValue. The main purpose of this function is to describe GValue contents for debugging output, the way in which the contents are described may change between different GLib versions.

    Declaration

    Swift

    @inlinable
    func strdupValueContents() -> String!
  • typeCheckValue() Extension method

    Undocumented

    Declaration

    Swift

    @inlinable
    func typeCheckValue() -> Bool
  • typeCheckValueHolds(type:) Extension method

    Undocumented

    Declaration

    Swift

    @inlinable
    func typeCheckValueHolds(type: GType) -> Bool
  • boolean Extension method

    Get the contents of a G_TYPE_BOOLEAN GValue.

    Declaration

    Swift

    @inlinable
    var boolean: Bool { get nonmutating set }
  • boxed Extension method

    Get the contents of a G_TYPE_BOXED derived GValue.

    Declaration

    Swift

    @inlinable
    var boxed: gpointer? { get nonmutating set }
  • char Extension method

    Do not use this function; it is broken on platforms where the char type is unsigned, such as ARM and PowerPC. See g_value_get_schar().

    Get the contents of a G_TYPE_CHAR GValue.

    get_char is deprecated: This function’s return type is broken, see g_value_get_schar()

    Declaration

    Swift

    @inlinable
    var char: gchar { get nonmutating set }
  • double Extension method

    Get the contents of a G_TYPE_DOUBLE GValue.

    Declaration

    Swift

    @inlinable
    var double: Double { get nonmutating set }
  • enum Extension method

    Get the contents of a G_TYPE_ENUM GValue.

    Declaration

    Swift

    @inlinable
    var `enum`: Int { get nonmutating set }
  • flags Extension method

    Get the contents of a G_TYPE_FLAGS GValue.

    Declaration

    Swift

    @inlinable
    var flags: Int { get nonmutating set }
  • float Extension method

    Get the contents of a G_TYPE_FLOAT GValue.

    Declaration

    Swift

    @inlinable
    var float: Double { get nonmutating set }
  • gtype Extension method

    Get the contents of a G_TYPE_GTYPE GValue.

    Declaration

    Swift

    @inlinable
    var gtype: GType { get nonmutating set }
  • int Extension method

    Get the contents of a G_TYPE_INT GValue.

    Declaration

    Swift

    @inlinable
    var int: Int { get nonmutating set }
  • int64 Extension method

    Get the contents of a G_TYPE_INT64 GValue.

    Declaration

    Swift

    @inlinable
    var int64: gint64 { get nonmutating set }
  • long Extension method

    Get the contents of a G_TYPE_LONG GValue.

    Declaration

    Swift

    @inlinable
    var long: Int { get nonmutating set }
  • object Extension method

    Get the contents of a G_TYPE_OBJECT derived GValue.

    Declaration

    Swift

    @inlinable
    var object: GLibObject.ObjectRef! { get nonmutating set }
  • param Extension method

    Get the contents of a G_TYPE_PARAM GValue.

    Declaration

    Swift

    @inlinable
    var param: GLibObject.ParamSpecRef! { get nonmutating set }
  • pointer Extension method

    Get the contents of a pointer GValue.

    Declaration

    Swift

    @inlinable
    var pointer: gpointer? { get nonmutating set }
  • schar Extension method

    Get the contents of a G_TYPE_CHAR GValue.

    Declaration

    Swift

    @inlinable
    var schar: gint8 { get nonmutating set }
  • string Extension method

    Get the contents of a G_TYPE_STRING GValue.

    Declaration

    Swift

    @inlinable
    var string: String! { get nonmutating set }
  • uchar Extension method

    Get the contents of a G_TYPE_UCHAR GValue.

    Declaration

    Swift

    @inlinable
    var uchar: guchar { get nonmutating set }
  • uint Extension method

    Get the contents of a G_TYPE_UINT GValue.

    Declaration

    Swift

    @inlinable
    var uint: Int { get nonmutating set }
  • uint64 Extension method

    Get the contents of a G_TYPE_UINT64 GValue.

    Declaration

    Swift

    @inlinable
    var uint64: guint64 { get nonmutating set }
  • ulong Extension method

    Get the contents of a G_TYPE_ULONG GValue.

    Declaration

    Swift

    @inlinable
    var ulong: Int { get nonmutating set }
  • variant Extension method

    Get the contents of a variant GValue.

    Declaration

    Swift

    @inlinable
    var variant: GLib.VariantRef! { get nonmutating set }
  • data Extension method

    Undocumented

    Declaration

    Swift

    @inlinable
    var data: (_Value__data__union, _Value__data__union) { get set }
  • bindingFlags Extension method

    Return the value as bindingFlags

    Declaration

    Swift

    @inlinable
    var bindingFlags: BindingFlags { get }
  • set(type:) Extension method

    Set the receiver up to hold a value of the given type

    Declaration

    Swift

    @inlinable
    func set(type: GType)

    Parameters

    type

    the type of value to hold

  • get() Extension method

    Generic Value accessor.

    Declaration

    Swift

    @inlinable
    func get() -> String

    Return Value

    an optional String if stored as the value

  • get() Extension method

    Generic Value accessor.

    Declaration

    Swift

    @inlinable
    func get() -> Bool

    Return Value

    a Bool if stored as the value

  • get() Extension method

    Generic Value accessor.

    Declaration

    Swift

    @inlinable
    func get() -> Double

    Return Value

    a Double if stored as the value

  • get() Extension method

    Generic Value accessor.

    Declaration

    Swift

    @inlinable
    func get() -> Float

    Return Value

    a Float if stored as the value

  • get() Extension method

    Generic Value accessor.

    Declaration

    Swift

    @inlinable
    func get() -> Int

    Return Value

    an Int if stored as the value

  • get() Extension method

    Generic Value accessor.

    Declaration

    Swift

    @inlinable
    func get() -> UInt

    Return Value

    a UInt if stored as the value

  • get() Extension method

    Generic Value accessor.

    Declaration

    Swift

    @inlinable
    func get() -> Int64

    Return Value

    an Int if stored as the value

  • get() Extension method

    Generic Value accessor.

    Declaration

    Swift

    @inlinable
    func get() -> UInt64

    Return Value

    a UInt if stored as the value

  • get() Extension method

    Generic Value accessor.

    Declaration

    Swift

    @inlinable
    func get() -> Int32

    Return Value

    an Int if stored as the value

  • get() Extension method

    Generic Value accessor.

    Declaration

    Swift

    @inlinable
    func get() -> UInt32

    Return Value

    a UInt if stored as the value

  • get() Extension method

    Generic Value accessor.

    Declaration

    Swift

    @inlinable
    func get() -> Int8

    Return Value

    an Int8 if stored as the value

  • get() Extension method

    Generic Value accessor.

    Declaration

    Swift

    @inlinable
    func get() -> UInt8

    Return Value

    an optional UInt if stored as the value

  • get() Extension method

    Generic Value copier.

    Declaration

    Swift

    @inlinable
    func get() -> Value

    Return Value

    a Value containing a copy of the receiver

  • get() Extension method

    ObjectRef Value accessor.

    Declaration

    Swift

    @inlinable
    func get() -> ObjectRef?

    Return Value

    an optional Object reference if stored as the value

  • get() Extension method

    ParamSpec Value accessor.

    Declaration

    Swift

    @inlinable
    func get() -> ParamSpecRef?

    Return Value

    an optional ParamSpec reference if stored as the value

  • get() Extension method

    Variant Value accessor.

    Declaration

    Swift

    @inlinable
    func get() -> Variant?

    Return Value

    an optional Variant reference if stored as the value

  • get() Extension method

    BindingFlags Value accessor.

    Declaration

    Swift

    @inlinable
    func get() -> BindingFlags?

    Return Value

    optional BindingFlags if stored as the value

  • get() Extension method

    Generic, mutable pointer Value accessor.

    Declaration

    Swift

    @inlinable
    func get<T>() -> UnsafeMutablePointer<T>?

    Return Value

    an optional pointer if stored as the value

  • geUnsafeMutablePointer() Extension method

    Generic, force-unwrapped mutable pointer Value accessor

    Declaration

    Swift

    @inlinable
    func geUnsafeMutablePointer<T>() -> UnsafeMutablePointer<T>!

    Return Value

    a force-unwrapped, optional pointer if stored as the value

  • get() Extension method

    Generic Value accessor for object types.

    Warning

    this method does not check whether the object actually conforms to the given object subtype. If you want run time safety, you need to check the (meta)type of the returned reference!

    Declaration

    Swift

    @inlinable
    func get<O>() -> O? where O : ObjectProtocol

    Return Value

    the unwrapped value if conforming to object type or nil

  • get() Extension method

    Generic Value accessor for unknown types.

    Declaration

    Swift

    @inlinable
    func get<T>() -> T?

    Return Value

    the unwrapped value if conforming to the given type or nil

  • dataPointer() Extension method

    Generic Value accessor for Object classes.

    Declaration

    Swift

    @inlinable
    func dataPointer<T>() -> UnsafePointer<T>

    Return Value

    nil

  • mutableDataPointer() Extension method

    Generic Value accessor for Object classes.

    Declaration

    Swift

    @inlinable
    func mutableDataPointer<T>() -> UnsafeMutablePointer<T>

    Return Value

    nil

  • set(_:) Extension method

    Generic value copier.

    Declaration

    Swift

    @inlinable
    func set(_ value: ValueBase)

    Parameters

    value

    original Value to copy

  • set(_:) Extension method

    Generic value copier.

    Declaration

    Swift

    @inlinable
    func set(_ value: ValueRef)

    Parameters

    value

    original ValueRef to copy

  • set(_:) Extension method

    Generic value copier.

    Declaration

    Swift

    @inlinable
    func set(_ value: ValueProtocol)

    Parameters

    value

    original value of kind ValueProtocol to copy

  • set(_:) Extension method

    Generic value setter.

    Declaration

    Swift

    @inlinable
    func set(_ value: String)

    Parameters

    value

    String value to set

  • set(_:) Extension method

    Generic value setter.

    Declaration

    Swift

    @inlinable
    func set(_ s: StaticString)

    Parameters

    value

    static String value to set

  • set(_:) Extension method

    Generic value setter.

    Declaration

    Swift

    @inlinable
    func set<S>(_ value: S) where S : StringProtocol

    Parameters

    value

    String protocol value to set

  • set(_:) Extension method

    Generic value setter.

    Declaration

    Swift

    @inlinable
    func set(_ value: Bool)

    Parameters

    value

    Bool value to set

  • set(_:) Extension method

    Generic value setter.

    Declaration

    Swift

    @inlinable
    func set(_ value: Double)

    Parameters

    value

    Double value to set

  • set(_:) Extension method

    Generic value setter.

    Declaration

    Swift

    @inlinable
    func set(_ value: Int)

    Parameters

    value

    Int value to set

  • set(_:) Extension method

    Generic value setter.

    Declaration

    Swift

    @inlinable
    func set(_ value: UInt)

    Parameters

    value

    UInt value to set

  • set(_:) Extension method

    Generic value setter.

    Declaration

    Swift

    @inlinable
    func set(_ value: Int64)

    Parameters

    value

    Int64 value to set

  • set(_:) Extension method

    Generic value setter.

    Declaration

    Swift

    @inlinable
    func set(_ value: UInt64)

    Parameters

    value

    UInt64 value to set

  • set(_:) Extension method

    Generic value setter.

    Declaration

    Swift

    @inlinable
    func set(_ value: Int32)

    Parameters

    value

    Int32 value to set

  • set(_:) Extension method

    Generic value setter.

    Declaration

    Swift

    @inlinable
    func set(_ value: UInt32)

    Parameters

    value

    UInt32 value to set

  • set(_:) Extension method

    Generic value setter.

    Declaration

    Swift

    @inlinable
    func set(_ value: Int8)

    Parameters

    value

    Int8 value to set

  • set(_:) Extension method

    Generic value setter.

    Declaration

    Swift

    @inlinable
    func set(_ value: UInt8)

    Parameters

    value

    UInt8 value to set

  • set(_:) Extension method

    Generic object setter.

    Declaration

    Swift

    @inlinable
    func set<O>(_ object: O) where O : ObjectProtocol

    Parameters

    object

    GObject or subclass to set

  • set(_:) Extension method

    Generic ParamSpec setter.

    Declaration

    Swift

    @inlinable
    func set<P>(_ spec: P) where P : ParamSpecProtocol

    Parameters

    spec

    ParamSpec to set

  • set(_:) Extension method

    Generic Optional setter.

    Declaration

    Swift

    @inlinable
    func set<O>(_ optional: O?)

    Parameters

    spec

    optional value to set (or unset if nil)

  • set(_:) Extension method

    Generic Variant setter.

    Declaration

    Swift

    @inlinable
    func set<V>(_ v: V) where V : VariantProtocol

    Parameters

    variant

    Variant to set

  • transform(_:) Extension method

    Generic Transformer

    Declaration

    Swift

    @inlinable
    func transform<T, U>(_ f: (T?) -> U?) -> U?

    Parameters

    f

    transformation function or closure

    Return Value

    true if destination value has been set, false if unset

  • transform(_:) Extension method

    Generic Transformer

    Declaration

    Swift

    @inlinable
    func transform<T, U>(_ f: (T) -> U?) -> U?

    Parameters

    f

    transformation function or closure

    Return Value

    true if destination value has been set, false if unset

  • transform(to:_:) Extension method

    Generic Transformer

    Declaration

    Swift

    @inlinable
    func transform<T, U, V>(to dest_value: V, _ f: (T) -> U?) -> Bool where V : ValueProtocol

    Parameters

    dest_value

    destination value to fill

    f

    transformation function or closure

    Return Value

    true if destination value has been set, false if unset

  • transform(to:_:) Extension method

    Generic Transformer

    Declaration

    Swift

    @inlinable
    func transform<T, U, V>(to dest_value: V, _ f: (T?) -> U?) -> Bool where V : ValueProtocol

    Parameters

    dest_value

    destination value to fill

    f

    transformation function or closure

    Return Value

    true if destination value has been set, false if unset