Rectangle

A gtk.types.Rectangle data type for representing rectangles.

gtk.types.Rectangle is identical to cairo.rectangle.Rectangle. Together with Cairo’s cairo.region.Region data type, these are the central types for representing sets of pixels.

The intersection of two rectangles can be computed with gdk.rectangle.Rectangle.intersect; to find the union of two rectangles use gdk.rectangle.Rectangle.union_.

The cairo.region.Region type provided by Cairo is usually used for managing non-rectangular clipping of graphical operations.

The Graphene library has a number of other data types for regions and volumes in 2D and 3D.

Constructors

this
this(int x, int y, int width, int height)

Create a rectangle.Rectangle boxed type.

this
this(void* ptr, Flag!"Take" take)

Members

Functions

cPtr
void* cPtr(Flag!"Dup" dup)
containsPoint
bool containsPoint(int x, int y)

Returns true if rect contains the point described by x and y.

equal
bool equal(gdk.rectangle.Rectangle rect2)

Checks if the two given rectangles are equal.

intersect
bool intersect(gdk.rectangle.Rectangle src2, gdk.rectangle.Rectangle dest)

Calculates the intersection of two rectangles.

self
Rectangle self()

Returns this, for use in with statements.

union_
void union_(gdk.rectangle.Rectangle src2, gdk.rectangle.Rectangle dest)

Calculates the union of two rectangles.

Properties

gType
GType gType [@property getter]
height
int height [@property getter]

Get field height.

height
int height [@property setter]

Set field height.

width
int width [@property getter]

Get field width.

width
int width [@property setter]

Set field width.

x
int x [@property getter]

Get field x.

x
int x [@property setter]

Set field x.

y
int y [@property getter]

Get field y.

y
int y [@property setter]

Set field y.

Static functions

getGType
GType getGType()

Inherited Members

From Boxed

cInstancePtr
void* cInstancePtr;

Pointer to the C boxed value

getType
GType getType()

Get the GType of this boxed type.

gType
GType gType [@property getter]

Boxed GType property.

self
Boxed self()

Convenience method to return this cast to a type. For use in D with statements.

copy_
void* copy_()

Make a copy of the wrapped C boxed data.

boxedCopy
void* boxedCopy(void* cBoxed)

Copy a C boxed value using g_boxed_copy.

boxedFree
void boxedFree(void* cBoxed)

Free a C boxed value using g_boxed_free.