]> git.saurik.com Git - wxWidgets.git/blame - src/cocoa/region.mm
split wxUSE_MDI from wxUSE_MDI_ARCHITECTURE (which is wxUSE_MDI + wxUSE_DOCVIEW)
[wxWidgets.git] / src / cocoa / region.mm
CommitLineData
53dbce23
DE
1/////////////////////////////////////////////////////////////////////////////
2// Name: cocoa/region.mm
3// Purpose: wxRegion class
4// Author: David Elliott
5// Modified by:
6// Created: 2004/04/12
7// RCS-ID: $Id$
8// Copyright: (c) 2004 David Elliott
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12#include "wx/region.h"
13
e9ec987a
DE
14#import <Foundation/NSGeometry.h>
15
53dbce23
DE
16IMPLEMENT_DYNAMIC_CLASS(wxRegion, wxGDIObject);
17
e9ec987a
DE
18inline wxRect NSRectToWxRect(const NSRect& rect)
19{
20 return wxRect((wxCoord)rect.origin.x, (wxCoord)rect.origin.y,
21 (wxCoord)rect.size.width, (wxCoord)rect.size.height);
22}
23
24wxRegion::wxRegion(const NSRect& rect)
25{
26 Union(NSRectToWxRect(rect));
27}
28
29wxRegion::wxRegion(const NSRect *rects, int count)
30{
31 for(int i=0; i<count; i++)
32 {
33 Union(NSRectToWxRect(rects[i]));
34 }
35}
36