RectangleProtocol
public protocol RectangleProtocol
The RectangleProtocol protocol exposes the methods and properties of an underlying GdkRectangle 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 Rectangle.
Alternatively, use RectangleRef as a lighweight, unowned reference if you already have an instance you just want to use.
Defines the position and size of a rectangle. It is identical to
cairo_rectangle_int_t.
-
Untyped pointer to the underlying
GdkRectangleinstance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get } -
rectangle_ptrDefault implementationTyped pointer to the underlying
GdkRectangleinstance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GdkRectangleinstance.Declaration
Swift
var rectangle_ptr: UnsafeMutablePointer<GdkRectangle>! { get } -
Required Initialiser for types conforming to
RectangleProtocolDeclaration
Swift
init(raw: UnsafeMutableRawPointer)
-
equal(rect2:Extension method) Checks if the two given rectangles are equal.
Declaration
Swift
@inlinable func equal<RectangleT>(rect2: RectangleT) -> Bool where RectangleT : RectangleProtocol -
intersect(src2:Extension methoddest: ) Calculates the intersection of two rectangles. It is allowed for
destto be the same as eithersrc1orsrc2. If the rectangles do not intersect,dest’s width and height is set to 0 and its x and y values are undefined. If you are only interested in whether the rectangles intersect, but not in the intersecting area itself, passnilfordest.Declaration
Swift
@inlinable func intersect<RectangleT>(src2: RectangleT, dest: RectangleT?) -> Bool where RectangleT : RectangleProtocol -
union(src2:Extension methoddest: ) Calculates the union of two rectangles. The union of rectangles
src1andsrc2is the smallest rectangle which includes bothsrc1andsrc2within it. It is allowed fordestto be the same as eithersrc1orsrc2.Note that this function does not ignore ‘empty’ rectangles (ie. with zero width or height).
Declaration
Swift
@inlinable func union<RectangleT>(src2: RectangleT, dest: RectangleT) where RectangleT : RectangleProtocol -
cairoGetClipRectangle(cr:Extension method) This is a convenience function around
cairo_clip_extents(). It rounds the clip extents to integer coordinates and returns a boolean indicating if a clip area exists.Declaration
Swift
@inlinable func cairoGetClipRectangle<ContextT>(cr: ContextT) -> Bool where ContextT : ContextProtocol -
cairoRectangle(cr:Extension method) Adds the given rectangle to the current path of
cr.Declaration
Swift
@inlinable func cairoRectangle<ContextT>(cr: ContextT) where ContextT : ContextProtocol -
xExtension methodUndocumented
Declaration
Swift
@inlinable var x: gint { get set } -
yExtension methodUndocumented
Declaration
Swift
@inlinable var y: gint { get set } -
widthExtension methodUndocumented
Declaration
Swift
@inlinable var width: gint { get set } -
heightExtension methodUndocumented
Declaration
Swift
@inlinable var height: gint { get set }
View on GitHub
Install in Dash
RectangleProtocol Protocol Reference