SurfaceProtocol

public protocol SurfaceProtocol

The SurfaceProtocol protocol exposes the methods and properties of an underlying cairo_surface_t 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 Surface. Alternatively, use SurfaceRef as a lighweight, unowned reference if you already have an instance you just want to use.

  • ptr

    Untyped pointer to the underlying cairo_surface_t instance.

    Declaration

    Swift

    var ptr: UnsafeMutableRawPointer! { get }
  • _ptr Default implementation

    Typed pointer to the underlying cairo_surface_t instance.

    Default Implementation

    Return the stored, untyped pointer as a typed pointer to the cairo_surface_t instance.

    Declaration

    Swift

    var _ptr: UnsafeMutablePointer<cairo_surface_t>! { get }
  • Required Initialiser for types conforming to SurfaceProtocol

    Declaration

    Swift

    init(raw: UnsafeMutableRawPointer)
  • deviceOffset Extension method

    Device offset as an x/y tuple

    Declaration

    Swift

    @inlinable
    var deviceOffset: (x: Double, y: Double) { get nonmutating set }
  • setDeviceOffset(x:y:) Extension method

    Set the device offset

    Declaration

    Swift

    @inlinable
    func setDeviceOffset(x: Double = 0, y: Double = 0)

    Parameters

    x

    horizontal offset

    y

    vertical offset

  • deviceScale Extension method

    Device scale as an x/y tuple

    Declaration

    Swift

    @inlinable
    var deviceScale: (x: Double, y: Double) { get nonmutating set }
  • setDeviceScale(x:y:) Extension method

    Set the device scale

    Declaration

    Swift

    @inlinable
    func setDeviceScale(x: Double = 1, y: Double = 1)

    Parameters

    x

    horizontal scale

    y

    vertical scale