]> git.saurik.com Git - wxWidgets.git/blame_incremental - src/cocoa/region.mm
Replace deprecated wxNB_* flags with wxBK_* used in last commit.
[wxWidgets.git] / src / cocoa / region.mm
... / ...
CommitLineData
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: wxWidgets licence
10/////////////////////////////////////////////////////////////////////////////
11
12#include "wx/region.h"
13
14#import <Foundation/NSGeometry.h>
15
16IMPLEMENT_DYNAMIC_CLASS(wxRegion, wxGDIObject);
17
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