ConstraintRef
public struct ConstraintRef : ConstraintProtocol, GWeakCapturing
GtkConstraint describes a constraint between attributes of two widgets,
expressed as a linear equation.
The typical equation for a constraint is:
target.target_attr = source.source_attr × multiplier + constant
Each GtkConstraint is part of a system that will be solved by a
[classGtk.ConstraintLayout] in order to allocate and position each
child widget or guide.
The source and target, as well as their attributes, of a GtkConstraint
instance are immutable after creation.
The ConstraintRef type acts as a lightweight Swift reference to an underlying GtkConstraint instance.
It exposes methods that can operate on this data type through ConstraintProtocol conformance.
Use ConstraintRef only as an unowned reference to an existing GtkConstraint instance.
-
Untyped pointer to the underlying `GtkConstraint` instance.For type-safe access, use the generated, typed pointer
constraint_ptrproperty instead.Declaration
Swift
public let ptr: UnsafeMutableRawPointer!
-
Designated initialiser from the underlying
Cdata typeDeclaration
Swift
@inlinable init(_ p: UnsafeMutablePointer<GtkConstraint>) -
Designated initialiser from a constant pointer to the underlying
Cdata typeDeclaration
Swift
@inlinable init(_ p: UnsafePointer<GtkConstraint>) -
Conditional initialiser from an optional pointer to the underlying
Cdata typeDeclaration
Swift
@inlinable init!(_ maybePointer: UnsafeMutablePointer<GtkConstraint>?) -
Conditional initialiser from an optional, non-mutable pointer to the underlying
Cdata typeDeclaration
Swift
@inlinable init!(_ maybePointer: UnsafePointer<GtkConstraint>?) -
Conditional initialiser from an optional
gpointerDeclaration
Swift
@inlinable init!(gpointer g: gpointer?) -
Conditional initialiser from an optional, non-mutable
gconstpointerDeclaration
Swift
@inlinable init!(gconstpointer g: gconstpointer?) -
Reference intialiser for a related type that implements
ConstraintProtocolDeclaration
Swift
@inlinable init<T>(_ other: T) where T : ConstraintProtocol -
This factory is syntactic sugar for setting weak pointers wrapped in
GWeak<T>Declaration
Swift
@inlinable static func unowned<T>(_ other: T) -> ConstraintRef where T : ConstraintProtocol -
Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
ConstraintProtocol.Declaration
Swift
@inlinable init<T>(cPointer: UnsafeMutablePointer<T>) -
Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
ConstraintProtocol.Declaration
Swift
@inlinable init<T>(constPointer: UnsafePointer<T>) -
Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
ConstraintProtocol.Declaration
Swift
@inlinable init(mutating raw: UnsafeRawPointer) -
Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
ConstraintProtocol.Declaration
Swift
@inlinable init(raw: UnsafeMutableRawPointer) -
Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
ConstraintProtocol.Declaration
Swift
@inlinable init(opaquePointer: OpaquePointer) -
Creates a new constraint representing a relation between a layoutattribute on a source and a layout attribute on a target.
Declaration
Swift
@inlinable init<ConstraintTargetT>(target: ConstraintTargetT?, targetAttribute: GtkConstraintAttribute, relation: GtkConstraintRelation, source: ConstraintTargetT?, sourceAttribute: GtkConstraintAttribute, multiplier: CDouble, constant: CDouble, strength: Int) where ConstraintTargetT : ConstraintTargetProtocol -
Creates a new constraint representing a relation between a layout attribute on a target and a constant value.
Declaration
Swift
@inlinable init<ConstraintTargetT>(constant target: ConstraintTargetT?, targetAttribute: GtkConstraintAttribute, relation: GtkConstraintRelation, constant: CDouble, strength: Int) where ConstraintTargetT : ConstraintTargetProtocol -
Creates a new constraint representing a relation between a layout attribute on a target and a constant value.
Declaration
Swift
@inlinable static func new<ConstraintTargetT>(constant target: ConstraintTargetT?, targetAttribute: GtkConstraintAttribute, relation: GtkConstraintRelation, constant: CDouble, strength: Int) -> ConstraintRef! where ConstraintTargetT : ConstraintTargetProtocol
View on GitHub
Install in Dash
ConstraintRef Structure Reference