X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/409c9842c71df526bcfbf1cf5ce80067b09d4d97..4a64bee465c0dbf3d97fbf290cb2fef4ad41ca34:/src/os2/region.cpp diff --git a/src/os2/region.cpp b/src/os2/region.cpp index cb637f96eb..2ea5f9d684 100644 --- a/src/os2/region.cpp +++ b/src/os2/region.cpp @@ -18,10 +18,8 @@ #include "wx/window.h" #include "wx/os2/private.h" -#if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxRegion, wxGDIObject) IMPLEMENT_DYNAMIC_CLASS(wxRegionIterator, wxObject) -#endif //----------------------------------------------------------------------------- // wxRegionRefData implementation @@ -44,8 +42,11 @@ public: // TODO } + + HRGN m_region; }; +#define M_REGION (((wxRegionRefData*)m_refData)->m_region) //----------------------------------------------------------------------------- // wxRegion @@ -66,7 +67,7 @@ wxRegion::wxRegion(WXHRGN hRegion) M_REGION = (HRGN) hRegion; } -wxRegion::wxRegion(long x, long y, long w, long h) +wxRegion::wxRegion(wxCoord x, wxCoord y, wxCoord w, wxCoord h) { m_refData = new wxRegionRefData; // TODO create rect region @@ -103,7 +104,7 @@ void wxRegion::Clear() } //! Combine rectangle (x, y, w, h) with this. -bool wxRegion::Combine(long x, long y, long width, long height, wxRegionOp op) +bool wxRegion::Combine(wxCoord x, wxCoord y, wxCoord width, wxCoord height, wxRegionOp op) { // Don't change shared data if (!m_refData) { @@ -194,7 +195,7 @@ bool wxRegion::Combine(const wxRect& rect, wxRegionOp op) //----------------------------------------------------------------------------- // Outer bounds of region -void wxRegion::GetBox(long& x, long& y, long&w, long &h) const +void wxRegion::GetBox(wxCoord& x, wxCoord& y, wxCoord&w, wxCoord &h) const { if (m_refData) { // TODO get box @@ -205,7 +206,7 @@ void wxRegion::GetBox(long& x, long& y, long&w, long &h) const wxRect wxRegion::GetBox() const { - long x, y, w, h; + wxCoord x, y, w, h; GetBox(x, y, w, h); return wxRect(x, y, w, h); } @@ -222,13 +223,14 @@ bool wxRegion::Empty() const //----------------------------------------------------------------------------- // Does the region contain the point (x,y)? -wxRegionContain wxRegion::Contains(long x, long y) const +wxRegionContain wxRegion::Contains(wxCoord x, wxCoord y) const { + bool bOK = FALSE; // temporary if (!m_refData) return wxOutRegion; // TODO. Return wxInRegion if within region. - if (0) + if (bOK) return wxInRegion; return wxOutRegion; } @@ -236,24 +238,26 @@ wxRegionContain wxRegion::Contains(long x, long y) const // Does the region contain the point pt? wxRegionContain wxRegion::Contains(const wxPoint& pt) const { + bool bOK = FALSE; // temporary if (!m_refData) return wxOutRegion; // TODO. Return wxInRegion if within region. - if (0) + if (bOK) return wxInRegion; else return wxOutRegion; } // Does the region contain the rectangle (x, y, w, h)? -wxRegionContain wxRegion::Contains(long x, long y, long w, long h) const +wxRegionContain wxRegion::Contains(wxCoord x, wxCoord y, wxCoord w, wxCoord h) const { + bool bOK = FALSE; // temporary if (!m_refData) return wxOutRegion; // TODO. Return wxInRegion if within region. - if (0) + if (bOK) return wxInRegion; else return wxOutRegion; @@ -265,7 +269,7 @@ wxRegionContain wxRegion::Contains(const wxRect& rect) const if (!m_refData) return wxOutRegion; - long x, y, w, h; + wxCoord x, y, w, h; x = rect.x; y = rect.y; w = rect.GetWidth(); @@ -352,28 +356,28 @@ void wxRegionIterator::operator ++ (int) ++m_current; } -long wxRegionIterator::GetX() const +wxCoord wxRegionIterator::GetX() const { if (m_current < m_numRects) return m_rects[m_current].x; return 0; } -long wxRegionIterator::GetY() const +wxCoord wxRegionIterator::GetY() const { if (m_current < m_numRects) return m_rects[m_current].y; return 0; } -long wxRegionIterator::GetW() const +wxCoord wxRegionIterator::GetW() const { if (m_current < m_numRects) return m_rects[m_current].width ; return 0; } -long wxRegionIterator::GetH() const +wxCoord wxRegionIterator::GetH() const { if (m_current < m_numRects) return m_rects[m_current].height;