GradientRef

public struct GradientRef : 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 GradientRef type acts as a lightweight Swift reference to an underlying GtkGradient instance. It exposes methods that can operate on this data type through GradientProtocol conformance. Use GradientRef only as an unowned reference to an existing GtkGradient instance.

  • ptr
    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!

Gradient Record

  • Designated initialiser from the underlying C data type

    Declaration

    Swift

    @inlinable
    init(_ p: UnsafeMutablePointer<GtkGradient>)
  • Designated initialiser from a constant pointer to the underlying C data type

    Declaration

    Swift

    @inlinable
    init(_ p: UnsafePointer<GtkGradient>)
  • Conditional initialiser from an optional pointer to the underlying C data type

    Declaration

    Swift

    @inlinable
    init!(_ maybePointer: UnsafeMutablePointer<GtkGradient>?)
  • Conditional initialiser from an optional, non-mutable pointer to the underlying C data type

    Declaration

    Swift

    @inlinable
    init!(_ maybePointer: UnsafePointer<GtkGradient>?)
  • Conditional initialiser from an optional gpointer

    Declaration

    Swift

    @inlinable
    init!(gpointer g: gpointer?)
  • Conditional initialiser from an optional, non-mutable gconstpointer

    Declaration

    Swift

    @inlinable
    init!(gconstpointer g: gconstpointer?)
  • Reference intialiser for a related type that implements GradientProtocol

    Declaration

    Swift

    @inlinable
    init<T>(_ other: T) where T : GradientProtocol
  • Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to GradientProtocol.

    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 GradientProtocol.

    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 GradientProtocol.

    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 GradientProtocol.

    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 GradientProtocol.

    Declaration

    Swift

    @inlinable
    init(opaquePointer: OpaquePointer)
  • 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
    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
    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
    static func new(linear x0: Double, y0: Double, x1: Double, y1: Double) -> GradientRef!
  • 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
    static func new(radial x0: Double, y0: Double, radius0: Double, x1: Double, y1: Double, radius1: Double) -> GradientRef!