diff options
Diffstat (limited to 'intern/ghost/GHOST_Rect.h')
-rw-r--r-- | intern/ghost/GHOST_Rect.h | 50 |
1 files changed, 22 insertions, 28 deletions
diff --git a/intern/ghost/GHOST_Rect.h b/intern/ghost/GHOST_Rect.h index dae2a2a8cbb..1c67ca3d2e0 100644 --- a/intern/ghost/GHOST_Rect.h +++ b/intern/ghost/GHOST_Rect.h @@ -42,7 +42,7 @@ class GHOST_Rect { * \param r: requested right coordinate of the rectangle. * \param b: requested bottom coordinate of the rectangle. */ - GHOST_Rect(GHOST_TInt32 l = 0, GHOST_TInt32 t = 0, GHOST_TInt32 r = 0, GHOST_TInt32 b = 0) + GHOST_Rect(int32_t l = 0, int32_t t = 0, int32_t r = 0, int32_t b = 0) : m_l(l), m_t(t), m_r(r), m_b(b) { } @@ -58,13 +58,13 @@ class GHOST_Rect { * Access to rectangle width. * \return width of the rectangle. */ - virtual inline GHOST_TInt32 getWidth() const; + virtual inline int32_t getWidth() const; /** * Access to rectangle height. * \return height of the rectangle. */ - virtual inline GHOST_TInt32 getHeight() const; + virtual inline int32_t getHeight() const; /** * Sets all members of the rectangle. @@ -73,7 +73,7 @@ class GHOST_Rect { * \param r: requested right coordinate of the rectangle. * \param b: requested bottom coordinate of the rectangle. */ - virtual inline void set(GHOST_TInt32 l, GHOST_TInt32 t, GHOST_TInt32 r, GHOST_TInt32 b); + virtual inline void set(int32_t l, int32_t t, int32_t r, int32_t b); /** * Returns whether this rectangle is empty. @@ -95,7 +95,7 @@ class GHOST_Rect { * The method avoids negative insets making the rectangle invalid * \param i: The amount of offset given to each extreme (negative values shrink the rectangle). */ - virtual void inset(GHOST_TInt32 i); + virtual void inset(int32_t i); /** * Does a union of the rectangle given and this rectangle. @@ -109,17 +109,14 @@ class GHOST_Rect { * \param x: The x-coordinate of the point. * \param y: The y-coordinate of the point. */ - virtual inline void unionPoint(GHOST_TInt32 x, GHOST_TInt32 y); + virtual inline void unionPoint(int32_t x, int32_t y); /** * Grows the rectangle to included a point. * \param x: The x-coordinate of the point. * \param y: The y-coordinate of the point. */ - virtual inline void wrapPoint(GHOST_TInt32 &x, - GHOST_TInt32 &y, - GHOST_TInt32 ofs, - GHOST_TAxisFlag axis); + virtual inline void wrapPoint(int32_t &x, int32_t &y, int32_t ofs, GHOST_TAxisFlag axis); /** * Returns whether the point is inside this rectangle. @@ -128,7 +125,7 @@ class GHOST_Rect { * \param y: y-coordinate of point to test. * \return boolean value (true if point is inside). */ - virtual inline bool isInside(GHOST_TInt32 x, GHOST_TInt32 y) const; + virtual inline bool isInside(int32_t x, int32_t y) const; /** * Returns whether the rectangle is inside this rectangle. @@ -143,7 +140,7 @@ class GHOST_Rect { * \param cx: requested center x-coordinate of the rectangle. * \param cy: requested center y-coordinate of the rectangle. */ - virtual void setCenter(GHOST_TInt32 cx, GHOST_TInt32 cy); + virtual void setCenter(int32_t cx, int32_t cy); /** * Sets rectangle members. @@ -154,7 +151,7 @@ class GHOST_Rect { * \param w: requested width of the rectangle. * \param h: requested height of the rectangle. */ - virtual void setCenter(GHOST_TInt32 cx, GHOST_TInt32 cy, GHOST_TInt32 w, GHOST_TInt32 h); + virtual void setCenter(int32_t cx, int32_t cy, int32_t w, int32_t h); /** * Clips a rectangle. @@ -166,30 +163,30 @@ class GHOST_Rect { virtual bool clip(GHOST_Rect &r) const; /** Left coordinate of the rectangle */ - GHOST_TInt32 m_l; + int32_t m_l; /** Top coordinate of the rectangle */ - GHOST_TInt32 m_t; + int32_t m_t; /** Right coordinate of the rectangle */ - GHOST_TInt32 m_r; + int32_t m_r; /** Bottom coordinate of the rectangle */ - GHOST_TInt32 m_b; + int32_t m_b; #ifdef WITH_CXX_GUARDEDALLOC MEM_CXX_CLASS_ALLOC_FUNCS("GHOST:GHOST_Rect") #endif }; -inline GHOST_TInt32 GHOST_Rect::getWidth() const +inline int32_t GHOST_Rect::getWidth() const { return m_r - m_l; } -inline GHOST_TInt32 GHOST_Rect::getHeight() const +inline int32_t GHOST_Rect::getHeight() const { return m_b - m_t; } -inline void GHOST_Rect::set(GHOST_TInt32 l, GHOST_TInt32 t, GHOST_TInt32 r, GHOST_TInt32 b) +inline void GHOST_Rect::set(int32_t l, int32_t t, int32_t r, int32_t b) { m_l = l; m_t = t; @@ -219,7 +216,7 @@ inline void GHOST_Rect::unionRect(const GHOST_Rect &r) m_b = r.m_b; } -inline void GHOST_Rect::unionPoint(GHOST_TInt32 x, GHOST_TInt32 y) +inline void GHOST_Rect::unionPoint(int32_t x, int32_t y) { if (x < m_l) m_l = x; @@ -231,13 +228,10 @@ inline void GHOST_Rect::unionPoint(GHOST_TInt32 x, GHOST_TInt32 y) m_b = y; } -inline void GHOST_Rect::wrapPoint(GHOST_TInt32 &x, - GHOST_TInt32 &y, - GHOST_TInt32 ofs, - GHOST_TAxisFlag axis) +inline void GHOST_Rect::wrapPoint(int32_t &x, int32_t &y, int32_t ofs, GHOST_TAxisFlag axis) { - GHOST_TInt32 w = getWidth(); - GHOST_TInt32 h = getHeight(); + int32_t w = getWidth(); + int32_t h = getHeight(); /* highly unlikely but avoid eternal loop */ if (w - ofs * 2 <= 0 || h - ofs * 2 <= 0) { @@ -258,7 +252,7 @@ inline void GHOST_Rect::wrapPoint(GHOST_TInt32 &x, } } -inline bool GHOST_Rect::isInside(GHOST_TInt32 x, GHOST_TInt32 y) const +inline bool GHOST_Rect::isInside(int32_t x, int32_t y) const { return (x >= m_l) && (x <= m_r) && (y >= m_t) && (y <= m_b); } |