2003-03-22 02:56:04 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2004-04-13 19:45:02 +00:00
|
|
|
// Name: wx/cocoa/region.h
|
2003-03-22 02:56:04 +00:00
|
|
|
// Purpose: wxRegion class
|
2004-04-13 19:45:02 +00:00
|
|
|
// Author: David Elliott
|
2006-10-17 14:44:52 +00:00
|
|
|
// Modified by:
|
2004-04-13 19:45:02 +00:00
|
|
|
// Created: 2004/04/12
|
|
|
|
// Copyright: (c) 2004 David Elliott
|
2006-10-17 14:44:52 +00:00
|
|
|
// Licence: wxWindows licence
|
2003-03-22 02:56:04 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2004-04-13 19:45:02 +00:00
|
|
|
#ifndef _WX_COCOA_REGION_H__
|
|
|
|
#define _WX_COCOA_REGION_H__
|
2003-03-22 02:56:04 +00:00
|
|
|
|
2004-04-13 19:45:02 +00:00
|
|
|
#include "wx/generic/region.h"
|
2003-03-22 02:56:04 +00:00
|
|
|
|
2007-07-06 00:18:28 +00:00
|
|
|
#if defined(__LP64__) || defined(NS_BUILD_32_LIKE_64)
|
|
|
|
typedef struct CGRect NSRect;
|
|
|
|
#else
|
2004-04-14 05:53:50 +00:00
|
|
|
typedef struct _NSRect NSRect;
|
2007-07-06 00:18:28 +00:00
|
|
|
#endif
|
2004-04-14 05:53:50 +00:00
|
|
|
|
2008-03-26 15:06:00 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxRegion : public wxRegionGeneric
|
2004-04-13 19:45:02 +00:00
|
|
|
{
|
2003-03-22 02:56:04 +00:00
|
|
|
public:
|
2004-04-13 19:45:02 +00:00
|
|
|
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() {}
|
2004-06-03 21:13:52 +00:00
|
|
|
wxRegion(const wxBitmap& bmp)
|
|
|
|
: wxRegionGeneric()
|
|
|
|
{ Union(bmp); }
|
2004-04-13 19:45:02 +00:00
|
|
|
wxRegion(const wxBitmap& bmp,
|
2004-06-03 21:13:52 +00:00
|
|
|
const wxColour& transColour, int tolerance = 0)
|
2004-04-13 19:45:02 +00:00
|
|
|
: wxRegionGeneric()
|
2004-06-03 21:13:52 +00:00
|
|
|
{ Union(bmp, transColour, tolerance); }
|
2006-09-05 20:47:48 +00:00
|
|
|
virtual ~wxRegion() {}
|
2003-03-22 02:56:04 +00:00
|
|
|
wxRegion(const wxRegion& r)
|
2004-04-13 19:45:02 +00:00
|
|
|
: wxRegionGeneric(r)
|
|
|
|
{}
|
|
|
|
wxRegion& operator= (const wxRegion& r)
|
|
|
|
{ return *(wxRegion*)&(this->wxRegionGeneric::operator=(r)); }
|
2003-03-28 23:05:05 +00:00
|
|
|
|
2004-04-14 05:53:50 +00:00
|
|
|
// Cocoa-specific creation
|
|
|
|
wxRegion(const NSRect& rect);
|
|
|
|
wxRegion(const NSRect *rects, int count);
|
|
|
|
|
2006-09-25 11:47:23 +00:00
|
|
|
private:
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxRegion);
|
2003-03-22 02:56:04 +00:00
|
|
|
};
|
|
|
|
|
2008-03-26 15:06:00 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxRegionIterator : public wxRegionIteratorGeneric
|
2003-03-22 02:56:04 +00:00
|
|
|
{
|
2004-04-13 19:45:02 +00:00
|
|
|
// DECLARE_DYNAMIC_CLASS(wxRegionIteratorGeneric);
|
2003-03-22 02:56:04 +00:00
|
|
|
public:
|
2004-04-13 19:45:02 +00:00
|
|
|
wxRegionIterator() {}
|
|
|
|
wxRegionIterator(const wxRegion& region)
|
|
|
|
: wxRegionIteratorGeneric(region)
|
|
|
|
{}
|
|
|
|
wxRegionIterator(const wxRegionIterator& iterator)
|
|
|
|
: wxRegionIteratorGeneric(iterator)
|
|
|
|
{}
|
2006-09-05 20:47:48 +00:00
|
|
|
virtual ~wxRegionIterator() {}
|
2004-04-13 19:45:02 +00:00
|
|
|
|
|
|
|
wxRegionIterator& operator=(const wxRegionIterator& iter)
|
|
|
|
{ return *(wxRegionIterator*)&(this->wxRegionIteratorGeneric::operator=(iter)); }
|
2003-03-22 02:56:04 +00:00
|
|
|
};
|
|
|
|
|
2006-10-17 14:44:52 +00:00
|
|
|
#endif
|
|
|
|
//ndef _WX_COCOA_REGION_H__
|