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
GdkRectangle
instance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get }
-
rectangle_ptr
Default implementationTyped pointer to the underlying
GdkRectangle
instance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GdkRectangle
instance.Declaration
Swift
var rectangle_ptr: UnsafeMutablePointer<GdkRectangle>! { get }
-
Required Initialiser for types conforming to
RectangleProtocol
Declaration
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
dest
to be the same as eithersrc1
orsrc2
. 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, passnil
fordest
.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
src1
andsrc2
is the smallest rectangle which includes bothsrc1
andsrc2
within it. It is allowed fordest
to be the same as eithersrc1
orsrc2
.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
-
x
Extension methodUndocumented
Declaration
Swift
@inlinable var x: gint { get set }
-
y
Extension methodUndocumented
Declaration
Swift
@inlinable var y: gint { get set }
-
width
Extension methodUndocumented
Declaration
Swift
@inlinable var width: gint { get set }
-
height
Extension methodUndocumented
Declaration
Swift
@inlinable var height: gint { get set }