Gradient
open class Gradient : GradientProtocol
GtkGradient is a boxed type that represents a gradient.
It is the result of parsing a
gradient expression.
To obtain the gradient represented by a GtkGradient, it has to
be resolved with gtk_gradient_resolve()
, which replaces all
symbolic color references by the colors they refer to (in a given
context) and constructs a cairo_pattern_t
value.
It is not normally necessary to deal directly with GtkGradients
,
since they are mostly used behind the scenes by GtkStyleContext
and
GtkCssProvider
.
GtkGradient
is deprecated. It was used internally by GTK’s CSS engine
to represent gradients. As its handling is not conforming to modern
web standards, it is not used anymore. If you want to use gradients in
your own code, please use Cairo directly.
The Gradient
type acts as a reference-counted owner of an underlying GtkGradient
instance.
It provides the methods that can operate on this data type through GradientProtocol
conformance.
Use Gradient
as a strong reference or owner of a GtkGradient
instance.
-
Untyped pointer to the underlying `GtkGradient` instance.
For type-safe access, use the generated, typed pointer
gradient_ptr
property instead.Declaration
Swift
public let ptr: UnsafeMutableRawPointer!
-
Designated initialiser from the underlying
C
data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to theGradient
instance.Declaration
Swift
@inlinable public init(_ op: UnsafeMutablePointer<GtkGradient>)
Parameters
op
pointer to the underlying object
-
Designated initialiser from a constant pointer to the underlying
C
data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to theGradient
instance.Declaration
Swift
@inlinable public init(_ op: UnsafePointer<GtkGradient>)
Parameters
op
pointer to the underlying object
-
Optional initialiser from a non-mutating
gpointer
to the underlyingC
data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to theGradient
instance.Declaration
Swift
@inlinable public init!(gpointer op: gpointer?)
Parameters
op
gpointer to the underlying object
-
Optional initialiser from a non-mutating
gconstpointer
to the underlyingC
data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to theGradient
instance.Declaration
Swift
@inlinable public init!(gconstpointer op: gconstpointer?)
Parameters
op
pointer to the underlying object
-
Optional initialiser from a constant pointer to the underlying
C
data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to theGradient
instance.Declaration
Swift
@inlinable public init!(_ op: UnsafePointer<GtkGradient>?)
Parameters
op
pointer to the underlying object
-
Optional initialiser from the underlying
C
data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to theGradient
instance.Declaration
Swift
@inlinable public init!(_ op: UnsafeMutablePointer<GtkGradient>?)
Parameters
op
pointer to the underlying object
-
Designated initialiser from the underlying
C
data type. Will retainGtkGradient
. i.e., ownership is transferred to theGradient
instance.Declaration
Swift
@inlinable public init(retaining op: UnsafeMutablePointer<GtkGradient>)
Parameters
op
pointer to the underlying object
-
Reference intialiser for a related type that implements
GradientProtocol
Will retainGtkGradient
.Declaration
Swift
@inlinable public init<T>(_ other: T) where T : GradientProtocol
Parameters
other
an instance of a related type that implements
GradientProtocol
-
Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
GradientProtocol
.Declaration
Swift
@inlinable public init<T>(cPointer p: UnsafeMutablePointer<T>)
Parameters
cPointer
pointer to the underlying object
-
Unsafe typed, retaining initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
GradientProtocol
.Declaration
Swift
@inlinable public init<T>(retainingCPointer cPointer: UnsafeMutablePointer<T>)
Parameters
cPointer
pointer to the underlying object
-
Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
GradientProtocol
.Declaration
Swift
@inlinable public init(raw p: UnsafeRawPointer)
Parameters
p
raw pointer to the underlying object
-
Unsafe untyped, retaining initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
GradientProtocol
.Declaration
Swift
@inlinable public init(retainingRaw raw: UnsafeRawPointer)
-
Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
GradientProtocol
.Declaration
Swift
@inlinable public required init(raw p: UnsafeMutableRawPointer)
Parameters
p
mutable raw pointer to the underlying object
-
Unsafe untyped, retaining initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
GradientProtocol
.Declaration
Swift
@inlinable public init(retainingRaw raw: UnsafeMutableRawPointer)
Parameters
raw
mutable raw pointer to the underlying object
-
Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
GradientProtocol
.Declaration
Swift
@inlinable public init(opaquePointer p: OpaquePointer)
Parameters
p
opaque pointer to the underlying object
-
Unsafe untyped, retaining initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
GradientProtocol
.Declaration
Swift
@inlinable public init(retainingOpaquePointer p: OpaquePointer)
Parameters
p
opaque pointer to the underlying object
-
Creates a new linear gradient along the line defined by (x0, y0) and (x1, y1). Before using the gradient a number of stop colors must be added through
gtk_gradient_add_color_stop()
.new_linear is deprecated:
GtkGradient is deprecated.
Declaration
Swift
@available(*, deprecated) @inlinable public init(linear x0: Double, y0: Double, x1: Double, y1: Double)
-
Creates a new radial gradient along the two circles defined by (x0, y0, radius0) and (x1, y1, radius1). Before using the gradient a number of stop colors must be added through
gtk_gradient_add_color_stop()
.new_radial is deprecated:
GtkGradient is deprecated.
Declaration
Swift
@available(*, deprecated) @inlinable public init(radial x0: Double, y0: Double, radius0: Double, x1: Double, y1: Double, radius1: Double)
-
Creates a new linear gradient along the line defined by (x0, y0) and (x1, y1). Before using the gradient a number of stop colors must be added through
gtk_gradient_add_color_stop()
.new_linear is deprecated:
GtkGradient is deprecated.
Declaration
Swift
@available(*, deprecated) @inlinable public static func new(linear x0: Double, y0: Double, x1: Double, y1: Double) -> Gradient!
-
Creates a new radial gradient along the two circles defined by (x0, y0, radius0) and (x1, y1, radius1). Before using the gradient a number of stop colors must be added through
gtk_gradient_add_color_stop()
.new_radial is deprecated:
GtkGradient is deprecated.
Declaration
Swift
@available(*, deprecated) @inlinable public static func new(radial x0: Double, y0: Double, radius0: Double, x1: Double, y1: Double, radius1: Double) -> Gradient!