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.
-
Untyped pointer to the underlying
GValue
instance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get }
-
value_ptr
Default implementationTyped 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)
-
copy(destValue:
Extension method) Copies the value of
src_value
intodest_value
.Declaration
Swift
@inlinable func copy<ValueT>(destValue: ValueT) where ValueT : ValueProtocol
-
dupBoxed()
Extension methodGet the contents of a
G_TYPE_BOXED
derivedGValue
. Upon getting, the boxed value is duplicated and needs to be later freed withg_boxed_free()
, e.g. like: g_boxed_free (G_VALUE_TYPE (value
), return_value);Declaration
Swift
@inlinable func dupBoxed() -> gpointer?
-
dupObject()
Extension methodGet the contents of a
G_TYPE_OBJECT
derivedGValue
, increasing its reference count. If the contents of theGValue
arenil
, thennil
will be returned.Declaration
Swift
@inlinable func dupObject() -> GLibObject.ObjectRef!
-
dupParam()
Extension methodGet the contents of a
G_TYPE_PARAM
GValue
, increasing its reference count.Declaration
Swift
@inlinable func dupParam() -> GLibObject.ParamSpecRef!
-
dupString()
Extension methodGet a copy the contents of a
G_TYPE_STRING
GValue
.Declaration
Swift
@inlinable func dupString() -> String!
-
dupVariant()
Extension methodGet the contents of a variant
GValue
, increasing its refcount. The returnedGVariant
is never floating.Declaration
Swift
@inlinable func dupVariant() -> GLib.VariantRef!
-
fitsPointer()
Extension methodDetermines 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 methodGet the contents of a
G_TYPE_BOOLEAN
GValue
.Declaration
Swift
@inlinable func getBoolean() -> Bool
-
getBoxed()
Extension methodGet the contents of a
G_TYPE_BOXED
derivedGValue
.Declaration
Swift
@inlinable func getBoxed() -> gpointer?
-
getChar()
Extension methodDo not use this function; it is broken on platforms where the
char
type is unsigned, such as ARM and PowerPC. Seeg_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 methodGet the contents of a
G_TYPE_DOUBLE
GValue
.Declaration
Swift
@inlinable func getDouble() -> Double
-
getEnum()
Extension methodGet the contents of a
G_TYPE_ENUM
GValue
.Declaration
Swift
@inlinable func getEnum() -> Int
-
getFlags()
Extension methodGet the contents of a
G_TYPE_FLAGS
GValue
.Declaration
Swift
@inlinable func getFlags() -> Int
-
getFloat()
Extension methodGet the contents of a
G_TYPE_FLOAT
GValue
.Declaration
Swift
@inlinable func getFloat() -> Double
-
getGtype()
Extension methodGet the contents of a
G_TYPE_GTYPE
GValue
.Declaration
Swift
@inlinable func getGtype() -> GType
-
getInt()
Extension methodGet the contents of a
G_TYPE_INT
GValue
.Declaration
Swift
@inlinable func getInt() -> Int
-
getInt64()
Extension methodGet the contents of a
G_TYPE_INT64
GValue
.Declaration
Swift
@inlinable func getInt64() -> gint64
-
getLong()
Extension methodGet the contents of a
G_TYPE_LONG
GValue
.Declaration
Swift
@inlinable func getLong() -> Int
-
getObject()
Extension methodGet the contents of a
G_TYPE_OBJECT
derivedGValue
.Declaration
Swift
@inlinable func getObject() -> GLibObject.ObjectRef!
-
getParam()
Extension methodGet the contents of a
G_TYPE_PARAM
GValue
.Declaration
Swift
@inlinable func getParam() -> GLibObject.ParamSpecRef!
-
getPointer()
Extension methodGet the contents of a pointer
GValue
.Declaration
Swift
@inlinable func getPointer() -> gpointer?
-
getSchar()
Extension methodGet the contents of a
G_TYPE_CHAR
GValue
.Declaration
Swift
@inlinable func getSchar() -> gint8
-
getString()
Extension methodGet the contents of a
G_TYPE_STRING
GValue
.Declaration
Swift
@inlinable func getString() -> String!
-
getUchar()
Extension methodGet the contents of a
G_TYPE_UCHAR
GValue
.Declaration
Swift
@inlinable func getUchar() -> guchar
-
getUint()
Extension methodGet the contents of a
G_TYPE_UINT
GValue
.Declaration
Swift
@inlinable func getUint() -> Int
-
getUint64()
Extension methodGet the contents of a
G_TYPE_UINT64
GValue
.Declaration
Swift
@inlinable func getUint64() -> guint64
-
getUlong()
Extension methodGet the contents of a
G_TYPE_ULONG
GValue
.Declaration
Swift
@inlinable func getUlong() -> Int
-
getVariant()
Extension methodGet the contents of a variant
GValue
.Declaration
Swift
@inlinable func getVariant() -> GLib.VariantRef!
-
init_(gType:
Extension method) Initializes
value
with the default value oftype
.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’scollect_value()
function.Note: The
value
will be initialised with the exact type ofinstance
. If you wish to set thevalue
‘s type to a different GType (such as a parent class GType), you need to manually callg_value_init()
andg_value_set_instance()
.Declaration
Swift
@inlinable func initFrom<TypeInstanceT>(instance: TypeInstanceT) where TypeInstanceT : TypeInstanceProtocol
-
peekPointer()
Extension methodReturns the value contents as pointer. This function asserts that
g_value_fits_pointer()
returnedtrue
for the passed in value. This is an internal function introduced mainly for C marshallers.Declaration
Swift
@inlinable func peekPointer() -> gpointer?
-
reset()
Extension methodClears 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
tov_boolean
.Declaration
Swift
@inlinable func setBoolean(vBoolean: Bool)
-
setBoxed(vBoxed:
Extension method) Set the contents of a
G_TYPE_BOXED
derivedGValue
tov_boxed
.Declaration
Swift
@inlinable func setBoxed(vBoxed: gconstpointer? = nil)
-
setBoxedTakeOwnership(vBoxed:
Extension method) 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
tov_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
tov_double
.Declaration
Swift
@inlinable func setDouble(vDouble: Double)
-
setEnum(vEnum:
Extension method) Set the contents of a
G_TYPE_ENUM
GValue
tov_enum
.Declaration
Swift
@inlinable func setEnum(vEnum: Int)
-
setFlags(vFlags:
Extension method) Set the contents of a
G_TYPE_FLAGS
GValue
tov_flags
.Declaration
Swift
@inlinable func setFlags(vFlags: Int)
-
setFloat(vFloat:
Extension method) Set the contents of a
G_TYPE_FLOAT
GValue
tov_float
.Declaration
Swift
@inlinable func setFloat(vFloat: Double)
-
setGtype(vGtype:
Extension method) Set the contents of a
G_TYPE_GTYPE
GValue
tov_gtype
.Declaration
Swift
@inlinable func setGtype(vGtype: GType)
-
set(instance:
Extension method) Sets
value
from an instantiatable type via the value_table’scollect_value()
function.Declaration
Swift
@inlinable func set(instance: gpointer? = nil)
-
setInt(vInt:
Extension method) Set the contents of a
G_TYPE_INT
GValue
tov_int
.Declaration
Swift
@inlinable func setInt(vInt: gint)
-
setInt64(vInt64:
Extension method) Set the contents of a
G_TYPE_INT64
GValue
tov_int64
.Declaration
Swift
@inlinable func setInt64(vInt64: gint64)
-
setInternedString(vString:
Extension method) Set the contents of a
G_TYPE_STRING
GValue
tov_string
. The string is assumed to be static and interned (canonical, for example fromg_intern_string()
), and is thus not duplicated when setting theGValue
.Declaration
Swift
@inlinable func setInternedString(vString: UnsafePointer<gchar>? = nil)
-
setLong(vLong:
Extension method) Set the contents of a
G_TYPE_LONG
GValue
tov_long
.Declaration
Swift
@inlinable func setLong(vLong: Int)
-
setObject(vObject:
Extension method) Set the contents of a
G_TYPE_OBJECT
derivedGValue
tov_object
.g_value_set_object()
increases the reference count ofv_object
(theGValue
holds a reference tov_object
). If you do not wish to increase the reference count of the object (i.e. you wish to pass your current reference to theGValue
because you no longer need it), useg_value_take_object()
instead.It is important that your
GValue
holds a reference tov_object
(either its own, or one it has taken) to ensure that the object won’t be destroyed while theGValue
still exists).Declaration
Swift
@inlinable func setObject(vObject: ObjectRef? = nil)
-
setObject(vObject:
Extension method) Set the contents of a
G_TYPE_OBJECT
derivedGValue
tov_object
.g_value_set_object()
increases the reference count ofv_object
(theGValue
holds a reference tov_object
). If you do not wish to increase the reference count of the object (i.e. you wish to pass your current reference to theGValue
because you no longer need it), useg_value_take_object()
instead.It is important that your
GValue
holds a reference tov_object
(either its own, or one it has taken) to ensure that the object won’t be destroyed while theGValue
still exists).Declaration
Swift
@inlinable func setObject<ObjectT>(vObject: ObjectT?) where ObjectT : ObjectProtocol
-
setObjectTakeOwnership(vObject:
Extension method) 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
toparam
.Declaration
Swift
@inlinable func set(param: ParamSpecRef? = nil)
-
set(param:
Extension method) Set the contents of a
G_TYPE_PARAM
GValue
toparam
.Declaration
Swift
@inlinable func set<ParamSpecT>(param: ParamSpecT?) where ParamSpecT : ParamSpecProtocol
-
setParamTakeOwnership(param:
Extension method) 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)
-
setParamTakeOwnership(param:
Extension method) 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
tov_pointer
.Declaration
Swift
@inlinable func setPointer(vPointer: gpointer? = nil)
-
setSchar(vChar:
Extension method) Set the contents of a
G_TYPE_CHAR
GValue
tov_char
.Declaration
Swift
@inlinable func setSchar(vChar: gint8)
-
setStaticBoxed(vBoxed:
Extension method) Set the contents of a
G_TYPE_BOXED
derivedGValue
tov_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
tov_string
. The string is assumed to be static, and is thus not duplicated when setting theGValue
.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 ofv_string
.Declaration
Swift
@inlinable func setString(vString: UnsafePointer<gchar>? = nil)
-
setStringTakeOwnership(vString:
Extension method) 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
tov_uchar
.Declaration
Swift
@inlinable func setUchar(vUchar: guchar)
-
setUint(vUint:
Extension method) Set the contents of a
G_TYPE_UINT
GValue
tov_uint
.Declaration
Swift
@inlinable func setUint(vUint: guint)
-
setUint64(vUint64:
Extension method) Set the contents of a
G_TYPE_UINT64
GValue
tov_uint64
.Declaration
Swift
@inlinable func setUint64(vUint64: guint64)
-
setUlong(vUlong:
Extension method) Set the contents of a
G_TYPE_ULONG
GValue
tov_ulong
.Declaration
Swift
@inlinable func setUlong(vUlong: gulong)
-
set(variant:
Extension method) Set the contents of a variant
GValue
tovariant
. 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
tovariant
. 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
derivedGValue
tov_boxed
and takes over the ownership of the caller’s reference tov_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
derivedGValue
tov_object
and takes over the ownership of the caller’s reference tov_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 tov_object
, useg_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
toparam
and takes over the ownership of the caller’s reference toparam
; 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
toparam
and takes over the ownership of the caller’s reference toparam
; 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
tov_string
.Declaration
Swift
@inlinable func takeString(vString: UnsafeMutablePointer<gchar>? = nil)
-
take(variant:
Extension method) Set the contents of a variant
GValue
tovariant
, and takes over the ownership of the caller’s reference tovariant
; 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 tovariant
, useg_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
tovariant
, and takes over the ownership of the caller’s reference tovariant
; 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 tovariant
, useg_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 indest_value
, e.g. to transform aG_TYPE_INT
value into aG_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 methodClears 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()
-
cclosureMarshalBOOLEANBOXEDBOXED(closure:
Extension methodnParamValues: paramValues: invocationHint: marshalData: ) 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 asg_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
-
cclosureMarshalBOOLEANFLAGS(closure:
Extension methodnParamValues: paramValues: invocationHint: marshalData: ) A marshaller for a
GCClosure
with a callback of typegboolean (*callback) (gpointer instance, gint arg1, gpointer user_data)
where thegint
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
-
cclosureMarshalSTRINGOBJECTPOINTER(closure:
Extension methodnParamValues: paramValues: invocationHint: marshalData: ) A marshaller for a
GCClosure
with a callback of typegchar* (*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
-
cclosureMarshalVOIDBOOLEAN(closure:
Extension methodnParamValues: paramValues: invocationHint: marshalData: ) A marshaller for a
GCClosure
with a callback of typevoid (*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
-
cclosureMarshalVOIDBOXED(closure:
Extension methodnParamValues: paramValues: invocationHint: marshalData: ) A marshaller for a
GCClosure
with a callback of typevoid (*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
-
cclosureMarshalVOIDCHAR(closure:
Extension methodnParamValues: paramValues: invocationHint: marshalData: ) A marshaller for a
GCClosure
with a callback of typevoid (*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
-
cclosureMarshalVOIDDOUBLE(closure:
Extension methodnParamValues: paramValues: invocationHint: marshalData: ) A marshaller for a
GCClosure
with a callback of typevoid (*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
-
cclosureMarshalVOIDENUM(closure:
Extension methodnParamValues: paramValues: invocationHint: marshalData: ) A marshaller for a
GCClosure
with a callback of typevoid (*callback) (gpointer instance, gint arg1, gpointer user_data)
where thegint
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
-
cclosureMarshalVOIDFLAGS(closure:
Extension methodnParamValues: paramValues: invocationHint: marshalData: ) A marshaller for a
GCClosure
with a callback of typevoid (*callback) (gpointer instance, gint arg1, gpointer user_data)
where thegint
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
-
cclosureMarshalVOIDFLOAT(closure:
Extension methodnParamValues: paramValues: invocationHint: marshalData: ) A marshaller for a
GCClosure
with a callback of typevoid (*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
-
cclosureMarshalVOIDINT(closure:
Extension methodnParamValues: paramValues: invocationHint: marshalData: ) A marshaller for a
GCClosure
with a callback of typevoid (*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
-
cclosureMarshalVOIDLONG(closure:
Extension methodnParamValues: paramValues: invocationHint: marshalData: ) A marshaller for a
GCClosure
with a callback of typevoid (*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
-
cclosureMarshalVOIDOBJECT(closure:
Extension methodnParamValues: paramValues: invocationHint: marshalData: ) A marshaller for a
GCClosure
with a callback of typevoid (*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
-
cclosureMarshalVOIDPARAM(closure:
Extension methodnParamValues: paramValues: invocationHint: marshalData: ) A marshaller for a
GCClosure
with a callback of typevoid (*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
-
cclosureMarshalVOIDPOINTER(closure:
Extension methodnParamValues: paramValues: invocationHint: marshalData: ) A marshaller for a
GCClosure
with a callback of typevoid (*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
-
cclosureMarshalVOIDSTRING(closure:
Extension methodnParamValues: paramValues: invocationHint: marshalData: ) A marshaller for a
GCClosure
with a callback of typevoid (*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
-
cclosureMarshalVOIDUCHAR(closure:
Extension methodnParamValues: paramValues: invocationHint: marshalData: ) A marshaller for a
GCClosure
with a callback of typevoid (*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
-
cclosureMarshalVOIDUINT(closure:
Extension methodnParamValues: paramValues: invocationHint: marshalData: ) A marshaller for a
GCClosure
with a callback of typevoid (*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
-
cclosureMarshalVOIDUINTPOINTER(closure:
Extension methodnParamValues: paramValues: invocationHint: marshalData: ) A marshaller for a
GCClosure
with a callback of typevoid (*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
-
cclosureMarshalVOIDULONG(closure:
Extension methodnParamValues: paramValues: invocationHint: marshalData: ) A marshaller for a
GCClosure
with a callback of typevoid (*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
-
cclosureMarshalVOIDVARIANT(closure:
Extension methodnParamValues: paramValues: invocationHint: marshalData: ) A marshaller for a
GCClosure
with a callback of typevoid (*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
-
cclosureMarshalVOIDVOID(closure:
Extension methodnParamValues: paramValues: invocationHint: marshalData: ) A marshaller for a
GCClosure
with a callback of typevoid (*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
-
cclosureMarshalGeneric(closure:
Extension methodnParamValues: paramValues: invocationHint: marshalData: ) 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 anil
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
-
paramValueConvert(pspec:
Extension methoddestValue: strictValidation: ) Transforms
src_value
intodest_value
if possible, and then validatesdest_value
, in order for it to conform topspec
. Ifstrict_validation
istrue
this function will only succeed if the transformeddest_value
complied topspec
without modifications.See also
g_value_type_transformable()
,g_value_transform()
andg_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 inpspec
.Declaration
Swift
@inlinable func paramValueDefaults<ParamSpecT>(pspec: ParamSpecT) -> Bool where ParamSpecT : ParamSpecProtocol
-
paramValueSetDefault(pspec:
Extension method) Sets
value
to its default value as specified inpspec
.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 bypspec
. For example, aGParamSpecInt
might require that integers stored invalue
may not be smaller than -42 and not be greater than +42. Ifvalue
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
-
paramValuesCmp(pspec:
Extension methodvalue2: ) Compares
value1
withvalue2
according topspec
, and return -1, 0 or +1, ifvalue1
is found to be less than, equal to or greater thanvalue2
, respectively.Declaration
Swift
@inlinable func paramValuesCmp<ParamSpecT, ValueT>(pspec: ParamSpecT, value2: ValueT) -> Int where ParamSpecT : ParamSpecProtocol, ValueT : ValueProtocol
-
signalAccumulatorFirstWins(ihint:
Extension methodhandlerReturn: dummy: ) 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
-
signalAccumulatorTrueHandled(ihint:
Extension methodhandlerReturn: dummy: ) A predefined
GSignalAccumulator
for signals that return a boolean values. The behavior that this accumulator gives is that a return oftrue
stops the signal emission: no further callbacks will be invoked, while a return offalse
allows the emission to continue. The idea here is that atrue
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
-
signalChainFromOverridden(instanceAndParams:
Extension method) 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()
andg_signal_override_class_handler()
.Declaration
Swift
@inlinable func signalChainFromOverridden(instanceAndParams: UnsafePointer<GValue>!)
-
signalEmitv(instanceAndParams:
Extension methodsignalID: detail: ) 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 changereturn_value
if no handlers are connected, in contrast tog_signal_emit()
andg_signal_emit_valist()
.Declaration
Swift
@inlinable func signalEmitv(instanceAndParams: UnsafePointer<GValue>!, signalID: Int, detail: GQuark)
-
strdupValueContents()
Extension methodReturn a newly allocated string, which describes the contents of a
GValue
. The main purpose of this function is to describeGValue
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 methodUndocumented
Declaration
Swift
@inlinable func typeCheckValue() -> Bool
-
typeCheckValueHolds(type:
Extension method) Undocumented
Declaration
Swift
@inlinable func typeCheckValueHolds(type: GType) -> Bool
-
boolean
Extension methodGet the contents of a
G_TYPE_BOOLEAN
GValue
.Declaration
Swift
@inlinable var boolean: Bool { get nonmutating set }
-
boxed
Extension methodGet the contents of a
G_TYPE_BOXED
derivedGValue
.Declaration
Swift
@inlinable var boxed: gpointer? { get nonmutating set }
-
char
Extension methodDo not use this function; it is broken on platforms where the
char
type is unsigned, such as ARM and PowerPC. Seeg_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 methodGet the contents of a
G_TYPE_DOUBLE
GValue
.Declaration
Swift
@inlinable var double: Double { get nonmutating set }
-
enum
Extension methodGet the contents of a
G_TYPE_ENUM
GValue
.Declaration
Swift
@inlinable var `enum`: Int { get nonmutating set }
-
flags
Extension methodGet the contents of a
G_TYPE_FLAGS
GValue
.Declaration
Swift
@inlinable var flags: Int { get nonmutating set }
-
float
Extension methodGet the contents of a
G_TYPE_FLOAT
GValue
.Declaration
Swift
@inlinable var float: Double { get nonmutating set }
-
gtype
Extension methodGet the contents of a
G_TYPE_GTYPE
GValue
.Declaration
Swift
@inlinable var gtype: GType { get nonmutating set }
-
int
Extension methodGet the contents of a
G_TYPE_INT
GValue
.Declaration
Swift
@inlinable var int: Int { get nonmutating set }
-
int64
Extension methodGet the contents of a
G_TYPE_INT64
GValue
.Declaration
Swift
@inlinable var int64: gint64 { get nonmutating set }
-
long
Extension methodGet the contents of a
G_TYPE_LONG
GValue
.Declaration
Swift
@inlinable var long: Int { get nonmutating set }
-
object
Extension methodGet the contents of a
G_TYPE_OBJECT
derivedGValue
.Declaration
Swift
@inlinable var object: GLibObject.ObjectRef! { get nonmutating set }
-
param
Extension methodGet the contents of a
G_TYPE_PARAM
GValue
.Declaration
Swift
@inlinable var param: GLibObject.ParamSpecRef! { get nonmutating set }
-
pointer
Extension methodGet the contents of a pointer
GValue
.Declaration
Swift
@inlinable var pointer: gpointer? { get nonmutating set }
-
schar
Extension methodGet the contents of a
G_TYPE_CHAR
GValue
.Declaration
Swift
@inlinable var schar: gint8 { get nonmutating set }
-
string
Extension methodGet the contents of a
G_TYPE_STRING
GValue
.Declaration
Swift
@inlinable var string: String! { get nonmutating set }
-
uchar
Extension methodGet the contents of a
G_TYPE_UCHAR
GValue
.Declaration
Swift
@inlinable var uchar: guchar { get nonmutating set }
-
uint
Extension methodGet the contents of a
G_TYPE_UINT
GValue
.Declaration
Swift
@inlinable var uint: Int { get nonmutating set }
-
uint64
Extension methodGet the contents of a
G_TYPE_UINT64
GValue
.Declaration
Swift
@inlinable var uint64: guint64 { get nonmutating set }
-
ulong
Extension methodGet the contents of a
G_TYPE_ULONG
GValue
.Declaration
Swift
@inlinable var ulong: Int { get nonmutating set }
-
variant
Extension methodGet the contents of a variant
GValue
.Declaration
Swift
@inlinable var variant: GLib.VariantRef! { get nonmutating set }
-
data
Extension methodUndocumented
Declaration
Swift
@inlinable var data: (_Value__data__union, _Value__data__union) { get set }
-
bindingFlags
Extension methodReturn 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 methodGeneric Value accessor.
Declaration
Swift
@inlinable func get() -> String
Return Value
an optional String if stored as the value
-
get()
Extension methodGeneric Value accessor.
Declaration
Swift
@inlinable func get() -> Bool
Return Value
a Bool if stored as the value
-
get()
Extension methodGeneric Value accessor.
Declaration
Swift
@inlinable func get() -> Double
Return Value
a Double if stored as the value
-
get()
Extension methodGeneric Value accessor.
Declaration
Swift
@inlinable func get() -> Float
Return Value
a Float if stored as the value
-
get()
Extension methodGeneric Value accessor.
Declaration
Swift
@inlinable func get() -> Int
Return Value
an Int if stored as the value
-
get()
Extension methodGeneric Value accessor.
Declaration
Swift
@inlinable func get() -> UInt
Return Value
a UInt if stored as the value
-
get()
Extension methodGeneric Value accessor.
Declaration
Swift
@inlinable func get() -> Int64
Return Value
an Int if stored as the value
-
get()
Extension methodGeneric Value accessor.
Declaration
Swift
@inlinable func get() -> UInt64
Return Value
a UInt if stored as the value
-
get()
Extension methodGeneric Value accessor.
Declaration
Swift
@inlinable func get() -> Int32
Return Value
an Int if stored as the value
-
get()
Extension methodGeneric Value accessor.
Declaration
Swift
@inlinable func get() -> UInt32
Return Value
a UInt if stored as the value
-
get()
Extension methodGeneric Value accessor.
Declaration
Swift
@inlinable func get() -> Int8
Return Value
an Int8 if stored as the value
-
get()
Extension methodGeneric Value accessor.
Declaration
Swift
@inlinable func get() -> UInt8
Return Value
an optional UInt if stored as the value
-
get()
Extension method -
get()
Extension methodObjectRef Value accessor.
Declaration
Swift
@inlinable func get() -> ObjectRef?
Return Value
an optional Object reference if stored as the value
-
get()
Extension methodParamSpec Value accessor.
Declaration
Swift
@inlinable func get() -> ParamSpecRef?
Return Value
an optional ParamSpec reference if stored as the value
-
get()
Extension methodVariant Value accessor.
Declaration
Swift
@inlinable func get() -> Variant?
Return Value
an optional Variant reference if stored as the value
-
get()
Extension methodBindingFlags Value accessor.
Declaration
Swift
@inlinable func get() -> BindingFlags?
Return Value
optional BindingFlags if stored as the value
-
get()
Extension methodGeneric, mutable pointer Value accessor.
Declaration
Swift
@inlinable func get<T>() -> UnsafeMutablePointer<T>?
Return Value
an optional pointer if stored as the value
-
geUnsafeMutablePointer()
Extension methodGeneric, 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 methodGeneric 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 methodGeneric 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 methodGeneric Value accessor for Object classes.
Declaration
Swift
@inlinable func dataPointer<T>() -> UnsafePointer<T>
Return Value
nil
-
mutableDataPointer()
Extension methodGeneric Value accessor for Object classes.
Declaration
Swift
@inlinable func mutableDataPointer<T>() -> UnsafeMutablePointer<T>
Return Value
nil
-
set(_:
Extension method) -
set(_:
Extension method) -
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