Represents a rectangle.
GdkRectangle is identical to cairo_rectangle_t. Together with Cairo's cairo_region_t data type, these are the central types for representing sets of pixels.
The intersection of two rectangles can be computed with [methodGdk.Rectangle.intersect]; to find the union of two rectangles use [methodGdk.Rectangle.union].
The cairo_region_t 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.
<group>Gdk, the low-level API</group>
function Contains_Point
(Self : Gdk_Rectangle;
X : Glib.Gint;
Y : Glib.Gint) return Boolean
Returns True if Rect contains the point described by X and Y.
X coordinate
Y coordinate
True if Rect contains the point
function Equal
(Self : Gdk_Rectangle;
Rect2 : Gdk_Rectangle) return Boolean
Checks if the two given rectangles are equal.
a GdkRectangle
True if the rectangles are equal.
function From_Object_Free
(B : not null access Gdk_Rectangle) return Gdk_Rectangle
Return the underlying object and free the pointer. This is meant to be used internally by GtkAda, and should not in general be called by user code.
type Gdk_Rectangle is record
X : Glib.Gint;
Y : Glib.Gint;
Width : Glib.Gint;
Height : Glib.Gint;
end record;
Represents a rectangle.
GdkRectangle is identical to cairo_rectangle_t. Together with Cairo's cairo_region_t data type, these are the central types for representing sets of pixels.
The intersection of two rectangles can be computed with [methodGdk.Rectangle.intersect]; to find the union of two rectangles use [methodGdk.Rectangle.union].
The cairo_region_t 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.
function Get_Type return Glib.GType
procedure Intersect
(Self : Gdk_Rectangle;
Src2 : Gdk_Rectangle;
Dest : out Gdk_Rectangle;
Do_Intersect : out Boolean)
Calculates the intersection of two rectangles. It is allowed for Dest to be the same as either Src1 or Src2. 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, pass null for Dest.
a GdkRectangle
return location for the intersection of Src1 and Src2
True if the rectangles intersect.
procedure Union
(Self : Gdk_Rectangle;
Src2 : Gdk_Rectangle;
Dest : out Gdk_Rectangle)
Calculates the union of two rectangles. The union of rectangles Src1 and Src2 is the smallest rectangle which includes both Src1 and Src2 within it. It is allowed for Dest to be the same as either Src1 or Src2. Note that this function does not ignore 'empty' rectangles (ie. with zero width or height).
a GdkRectangle
return location for the union of Src1 and Src2