Gdk::Rectangle is a structure holding the position and size of a rectangle.
More...
|
static GType | get_type () |
| Get the GType for this class, for use with the underlying GObject type system. More...
|
|
Gdk::Rectangle is a structure holding the position and size of a rectangle.
The intersection of two rectangles can be computed with intersect(). To find the union of two rectangles use union().
◆ Rectangle() [1/5]
Gdk::Rectangle::Rectangle |
( |
const Rectangle& |
other | ) |
|
|
noexcept |
◆ Rectangle() [2/5]
Gdk::Rectangle::Rectangle |
( |
Rectangle&& |
other | ) |
|
|
noexcept |
◆ Rectangle() [3/5]
Gdk::Rectangle::Rectangle |
( |
| ) |
|
◆ Rectangle() [4/5]
Gdk::Rectangle::Rectangle |
( |
const GdkRectangle * |
gobject | ) |
|
|
explicit |
◆ Rectangle() [5/5]
Gdk::Rectangle::Rectangle |
( |
int |
x, |
|
|
int |
y, |
|
|
int |
width, |
|
|
int |
height |
|
) |
| |
Creates a new rectangle instance with these dimensions.
◆ get_height()
int Gdk::Rectangle::get_height |
( |
| ) |
const |
◆ get_type()
static GType Gdk::Rectangle::get_type |
( |
| ) |
|
|
static |
Get the GType for this class, for use with the underlying GObject type system.
◆ get_width()
int Gdk::Rectangle::get_width |
( |
| ) |
const |
◆ get_x()
int Gdk::Rectangle::get_x |
( |
| ) |
const |
◆ get_y()
int Gdk::Rectangle::get_y |
( |
| ) |
const |
◆ gobj() [1/2]
GdkRectangle* Gdk::Rectangle::gobj |
( |
| ) |
|
|
inline |
Provides access to the underlying C instance.
◆ gobj() [2/2]
const GdkRectangle* Gdk::Rectangle::gobj |
( |
| ) |
const |
|
inline |
Provides access to the underlying C instance.
◆ has_zero_area()
bool Gdk::Rectangle::has_zero_area |
( |
| ) |
const |
Checks whether either the width or height are 0.
- Returns
- Whether this rectangle has any non-0 area.
◆ intersect() [1/2]
Calculates the intersection of two rectangles, changing this rectangle.
If the rectangles do not intersect, this rectangle's width and height is set to 0 and its x and y values are undefined.
This method returns a reference to this instance, allowing you to then call another method easily. For instance: rect.intersect(src2).join(src3);
- Parameters
-
src2 | The rectangle with which to calculate the intersection with this rectangle. |
- Returns
- A reference to this rectangle.
◆ intersect() [2/2]
Rectangle& Gdk::Rectangle::intersect |
( |
const Rectangle& |
src2, |
|
|
bool & |
rectangles_intersect |
|
) |
| |
Calculates the intersection of two rectangles, changing this rectangle.
If the rectangles do not intersect, this rectangle's width and height is set to 0 and its x and y values are undefined.
This method returns a reference to this instance, allowing you to then call another method easily. For instance: rect.intersect(src2).join(src3);
- Parameters
-
src2 | The rectangle with which to calculate the intersection with this rectangle. |
rectangles_interesect | This will be set to true if the rectangles intersect. |
- Returns
- A reference to this rectangle.
◆ join()
Calculates the union of two rectangles.
The union of this rectangle and src2 is the smallest rectangle which includes both this rectangle and src2 within it.
This method returns a reference to this instance, allowing you to then call another method easily. For instance: rect.join(src2).intersect(src3);
- Parameters
-
src2 | The rectangle with which to calculate the union with this rectangle. |
- Returns
- A reference to this rectangle.
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ set_height()
void Gdk::Rectangle::set_height |
( |
const int & |
value | ) |
|
◆ set_width()
void Gdk::Rectangle::set_width |
( |
const int & |
value | ) |
|
◆ set_x()
void Gdk::Rectangle::set_x |
( |
const int & |
value | ) |
|
◆ set_y()
void Gdk::Rectangle::set_y |
( |
const int & |
value | ) |
|
◆ wrap() [1/2]
- Parameters
-
- Returns
- A C++ instance that wraps this C instance.
◆ wrap() [2/2]
- Parameters
-
- Returns
- A C++ instance that wraps this C instance.
◆ gobject_
GdkRectangle Gdk::Rectangle::gobject_ |
|
protected |
The documentation for this class was generated from the following file: