wxWidgets/include/wx/cocoa/region.h
Vadim Zeitlin 8a16d7370e The Great wxRegion Refactoring:
1. added wxRegionBase class and derive all wxRegions from it
2. also added wxRegionWithCombine for the ports providing Combine() method
   (MSW, OS2 and Mac) to reduce code duplication further
3. made sure region comparison works the same way in all ports (except those
   not implementing it) and added IsEqual() method


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41429 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-09-25 11:47:23 +00:00

72 lines
2.0 KiB
C++

/////////////////////////////////////////////////////////////////////////////
// Name: wx/cocoa/region.h
// Purpose: wxRegion class
// Author: David Elliott
// Modified by:
// Created: 2004/04/12
// RCS-ID: $Id$
// Copyright: (c) 2004 David Elliott
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_COCOA_REGION_H__
#define _WX_COCOA_REGION_H__
#include "wx/generic/region.h"
typedef struct _NSRect NSRect;
class WXDLLEXPORT wxRegion : public wxRegionGeneric
{
public:
wxRegion(wxCoord x, wxCoord y, wxCoord w, wxCoord h)
: wxRegionGeneric(x,y,w,h)
{}
wxRegion(const wxPoint& topLeft, const wxPoint& bottomRight)
: wxRegionGeneric(topLeft, bottomRight)
{}
wxRegion(const wxRect& rect)
: wxRegionGeneric(rect)
{}
wxRegion() {}
wxRegion(const wxBitmap& bmp)
: wxRegionGeneric()
{ Union(bmp); }
wxRegion(const wxBitmap& bmp,
const wxColour& transColour, int tolerance = 0)
: wxRegionGeneric()
{ Union(bmp, transColour, tolerance); }
virtual ~wxRegion() {}
wxRegion(const wxRegion& r)
: wxRegionGeneric(r)
{}
wxRegion& operator= (const wxRegion& r)
{ return *(wxRegion*)&(this->wxRegionGeneric::operator=(r)); }
// Cocoa-specific creation
wxRegion(const NSRect& rect);
wxRegion(const NSRect *rects, int count);
private:
DECLARE_DYNAMIC_CLASS(wxRegion);
};
class WXDLLEXPORT wxRegionIterator : public wxRegionIteratorGeneric
{
// DECLARE_DYNAMIC_CLASS(wxRegionIteratorGeneric);
public:
wxRegionIterator() {}
wxRegionIterator(const wxRegion& region)
: wxRegionIteratorGeneric(region)
{}
wxRegionIterator(const wxRegionIterator& iterator)
: wxRegionIteratorGeneric(iterator)
{}
virtual ~wxRegionIterator() {}
wxRegionIterator& operator=(const wxRegionIterator& iter)
{ return *(wxRegionIterator*)&(this->wxRegionIteratorGeneric::operator=(iter)); }
};
#endif //ndef _WX_COCOA_REGION_H__