#include "wx/dc.h"
-#if !USE_SHARED_LIBRARY
IMPLEMENT_ABSTRACT_CLASS(wxDC, wxObject)
-#endif
//-----------------------------------------------------------------------------
// constants
DrawSpline( &list );
};
-void wxDC::SetClippingRegion( long x, long y, long width, long height )
+void wxDC::SetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
{
MacVerifySetup() ;
if( m_clipping )
long x1 = XLOG2DEV(m_clipX1);
long y1 = YLOG2DEV(m_clipY1);
long x2 = XLOG2DEV(m_clipX2);
- long y2 = XLOG2DEV(m_clipY2);
+ long y2 = YLOG2DEV(m_clipY2);
Rect clip = { y1 , x1 , y2 , x2 } ;
};
+void wxDC::SetClippingRegion(const wxRect& rect)
+{
+ SetClippingRegion(rect.x, rect.y, rect.width, rect.height);
+}
+
void wxDC::DestroyClippingRegion(void)
{
MacVerifySetup() ;
::ClipRect(&m_macClipRect);
};
+void wxDC::GetClippingBox( wxCoord *x, wxCoord *y, wxCoord *width, wxCoord *height ) const
+{
+ if (m_clipping)
+ {
+ if (x) *x = m_clipX1;
+ if (y) *y = m_clipY1;
+ if (width) *width = (m_clipX2 - m_clipX1);
+ if (height) *height = (m_clipY2 - m_clipY1);
+ }
+ else
+ *x = *y = *width = *height = 0;
+};
+
void wxDC::GetClippingBox( long *x, long *y, long *width, long *height ) const
{
if (m_clipping)
*x = *y = *width = *height = 0;
};
+void wxDC::GetClippingBox(wxRect& rect) const
+{
+ // Necessary to use intermediate variables for 16-bit compilation
+ wxCoord x, y, w, h;
+ GetClippingBox(&x, &y, &w, &h);
+ rect.x = x; rect.y = y; rect.width = w; rect.height = h;
+}
+
void wxDC::GetSize( int* width, int* height ) const
{
*width = m_maxX-m_minX;
}
}
-long wxDC::GetCharWidth(void)
+wxCoord wxDC::GetCharWidth(void) const
{
if (!Ok())
return 1;
return (fi.descent + fi.ascent) / 2 ;
}
-long wxDC::GetCharHeight(void)
+wxCoord wxDC::GetCharHeight(void) const
{
if (!Ok())
return 1;