70 #ifndef __INCLUDE_CRECT_HXX 71 #define __INCLUDE_CRECT_HXX 77 #include <nuttx/config.h> 82 #include <nuttx/nx/nxglib.h> 83 #include <nuttx/nx/nx.h> 93 #if defined(__cplusplus) 122 CRect(nxgl_coord_t x, nxgl_coord_t y,
123 nxgl_coord_t width, nxgl_coord_t height);
131 CRect(FAR
const nxgl_rect_s *rect);
152 nxgl_coord_t x2, nxgl_coord_t y2);
160 inline nxgl_coord_t
getX(
void)
const 170 inline nxgl_coord_t
getY(
void)
const 192 inline void getSize(
struct nxgl_size_s &size)
const 215 inline void getNxRect(FAR
struct nxgl_rect_s *rect)
const 217 rect->pt1.x =
m_pos.x;
218 rect->pt1.y =
m_pos.y;
229 inline void setX(nxgl_coord_t x)
240 inline void setY(nxgl_coord_t y)
272 inline void setNxRect(FAR
const struct nxgl_rect_s *rect)
274 m_pos.x = rect->pt1.x;
275 m_pos.y = rect->pt1.y;
276 m_size.w = rect->pt2.x - rect->pt1.x + 1;
277 m_size.h = rect->pt2.y - rect->pt1.y + 1;
289 void setX2(nxgl_coord_t x2);
300 void setY2(nxgl_coord_t y2);
308 inline nxgl_coord_t
getX2(
void)
const 319 inline nxgl_coord_t
getY2(
void)
const 331 inline void offset(nxgl_coord_t dx, nxgl_coord_t dy)
404 bool contains(nxgl_coord_t x, nxgl_coord_t y)
const;
434 #endif // __cplusplus 436 #endif // __INCLUDE_CRECT_HXX nxgl_coord_t getY2(void) const
nxgl_coord_t getHeight(void) const
void expandToInclude(const CRect &rect)
void getNxRect(FAR struct nxgl_rect_s *rect) const
void copyTo(CRect &dest) const
nxgl_coord_t getWidth(void) const
nxgl_coord_t getX(void) const
bool intersects(const CRect &rect) const
nxgl_coord_t getX2(void) const
struct nxgl_size_s m_size
void getAddition(const CRect &rect, CRect &dest) const
void setNxRect(FAR const struct nxgl_rect_s *rect)
bool hasDimensions(void) const
void setHeight(nxgl_coord_t height)
void clipToIntersect(const CRect &rect)
void getIntersect(const CRect &rect, CRect &dest) const
void setX(nxgl_coord_t x)
bool contains(nxgl_coord_t x, nxgl_coord_t y) const
void getSize(struct nxgl_size_s &size) const
static CRect fromCoordinates(nxgl_coord_t x1, nxgl_coord_t y1, nxgl_coord_t x2, nxgl_coord_t y2)
void setX2(nxgl_coord_t x2)
void setY2(nxgl_coord_t y2)
void offset(nxgl_coord_t dx, nxgl_coord_t dy)
void setWidth(nxgl_coord_t width)
nxgl_coord_t getY(void) const
struct nxgl_point_s m_pos
CRect operator &(const CRect &rect)
void setY(nxgl_coord_t y)
CRect operator+(const CRect &rect)