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_ptrproperty instead.Declaration
Swift
public let ptr: UnsafeMutableRawPointer! -
Designated initialiser from the underlying
Cdata type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to theGradientinstance.Declaration
Swift
@inlinable public init(_ op: UnsafeMutablePointer<GtkGradient>)Parameters
oppointer to the underlying object
-
Designated initialiser from a constant pointer to the underlying
Cdata type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to theGradientinstance.Declaration
Swift
@inlinable public init(_ op: UnsafePointer<GtkGradient>)Parameters
oppointer to the underlying object
-
Optional initialiser from a non-mutating
gpointerto the underlyingCdata type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to theGradientinstance.Declaration
Swift
@inlinable public init!(gpointer op: gpointer?)Parameters
opgpointer to the underlying object
-
Optional initialiser from a non-mutating
gconstpointerto the underlyingCdata type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to theGradientinstance.Declaration
Swift
@inlinable public init!(gconstpointer op: gconstpointer?)Parameters
oppointer to the underlying object
-
Optional initialiser from a constant pointer to the underlying
Cdata type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to theGradientinstance.Declaration
Swift
@inlinable public init!(_ op: UnsafePointer<GtkGradient>?)Parameters
oppointer to the underlying object
-
Optional initialiser from the underlying
Cdata type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to theGradientinstance.Declaration
Swift
@inlinable public init!(_ op: UnsafeMutablePointer<GtkGradient>?)Parameters
oppointer to the underlying object
-
Designated initialiser from the underlying
Cdata type. Will retainGtkGradient. i.e., ownership is transferred to theGradientinstance.Declaration
Swift
@inlinable public init(retaining op: UnsafeMutablePointer<GtkGradient>)Parameters
oppointer to the underlying object
-
Reference intialiser for a related type that implements
GradientProtocolWill retainGtkGradient.Declaration
Swift
@inlinable public init<T>(_ other: T) where T : GradientProtocolParameters
otheran 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
cPointerpointer 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
cPointerpointer 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
praw 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
pmutable 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
rawmutable 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
popaque 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
popaque 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!
View on GitHub
Install in Dash
Gradient Class Reference