Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 89 lines (69 sloc) 2.923 kb
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
1 /***********************************************************************
2 * FXRuby -- the Ruby language bindings for the FOX GUI toolkit.
b8219ec @lylejohnson Updated copyright notice for all SWIG interface files
lylejohnson authored
3 * Copyright (c) 2001-2009 by Lyle Johnson. All Rights Reserved.
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 * For further information please contact the author by e-mail
a934547 @lylejohnson Replaced e-mail address "lyle@users.sourceforge.net" with
lylejohnson authored
20 * at "lyle@lylejohnson.name".
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
21 ***********************************************************************/
22
23 %rename("empty?") FXRegion::empty() const;
24 %rename("contains?") FXRegion::contains(FXint x,FXint y) const;
25 %rename("contains?") FXRegion::contains(FXint x,FXint y,FXint w,FXint h) const;
26 %rename("offset!") FXRegion::offset(FXint dx,FXint dy);
27
28 /// Region
29 class FXRegion {
30 friend class FXDC;
31 friend class FXDCWindow;
32 private:
33 void *region;
34 public:
35
36 /// Construct new empty region
37 FXRegion();
38
39 /// Construct new region copied from region r
40 FXRegion(const FXRegion& r);
bea4cad @larskanis Strip all whitespaces on line endings
authored
41
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
42 /// Construct new region from rectangle
43 FXRegion(const FXRectangle& rect);
44
45 /// Construct rectangle region
46 FXRegion(FXint x,FXint y,FXint w,FXint h);
47
bea4cad @larskanis Strip all whitespaces on line endings
authored
48 /// Construct polygon region
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
49 FXRegion(const FXPoint* points,FXuint npoints,bool winding=FALSE);
bea4cad @larskanis Strip all whitespaces on line endings
authored
50
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
51 /// Return TRUE if region is empty
52 bool empty() const;
53
54 /// Return TRUE if region contains point
55 bool contains(FXint x,FXint y) const;
56
57 /// Return TRUE if region contains rectangle
58 bool contains(FXint x,FXint y,FXint w,FXint h) const;
59
60 /// Return bounding box
61 FXRectangle bounds() const;
62
63 /// Offset region by dx,dy
64 FXRegion& offset(FXint dx,FXint dy);
65
66 %extend {
67 // Union region r with this one
68 FXRegion operator+(const FXRegion& other) const { return (*self)+other; }
69
70 // Intersect region r with this one
71 FXRegion operator*(const FXRegion& other) const { return (*self)*other; }
72
73 // Subtract region r from this one
74 FXRegion operator-(const FXRegion& other) const { return (*self)-other; }
75
76 // Xor region r with this one
77 FXRegion operator^(const FXRegion& other) const { return (*self)^other; }
78
79 // Return TRUE if region equal to this one
80 bool operator==(const FXRegion& other) const { return (*self)==other; }
81 }
bea4cad @larskanis Strip all whitespaces on line endings
authored
82
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
83 /// Reset region to empty
84 void reset();
85
86 /// Destroy region
87 ~FXRegion();
88 };
Something went wrong with that request. Please try again.