Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FXRegion.h

00001 /******************************************************************************** 00002 * * 00003 * C l i p p i n g R e g i o n * 00004 * * 00005 ********************************************************************************* 00006 * Copyright (C) 2000,2004 by Jeroen van der Zijp. All Rights Reserved. * 00007 ********************************************************************************* 00008 * This library is free software; you can redistribute it and/or * 00009 * modify it under the terms of the GNU Lesser General Public * 00010 * License as published by the Free Software Foundation; either * 00011 * version 2.1 of the License, or (at your option) any later version. * 00012 * * 00013 * This library is distributed in the hope that it will be useful, * 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00016 * Lesser General Public License for more details. * 00017 * * 00018 * You should have received a copy of the GNU Lesser General Public * 00019 * License along with this library; if not, write to the Free Software * 00020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * 00021 ********************************************************************************* 00022 * $Id: FXRegion.h,v 1.12 2004/02/11 20:33:36 fox Exp $ * 00023 ********************************************************************************/ 00024 #ifndef FXREGION_H 00025 #define FXREGION_H 00026 00027 namespace FX { 00028 00029 /// Region 00030 class FXAPI FXRegion { 00031 friend class FXDC; 00032 friend class FXDCWindow; 00033 private: 00034 void *region; 00035 public: 00036 00037 /// Construct new empty region 00038 FXRegion(); 00039 00040 /// Construct new region copied from region r 00041 FXRegion(const FXRegion& r); 00042 00043 /// Construct new region from rectangle rect 00044 FXRegion(const FXRectangle& rect); 00045 00046 /// Construct rectangle region 00047 FXRegion(FXint x,FXint y,FXint w,FXint h); 00048 00049 /// Construct polygon region 00050 FXRegion(const FXPoint* points,FXuint npoints,FXbool winding=FALSE); 00051 00052 /// Assign region r to this one 00053 FXRegion &operator=(const FXRegion& r); 00054 00055 /// Return TRUE if region is empty 00056 FXbool empty() const; 00057 00058 /// Return TRUE if region contains point 00059 FXbool contains(FXint x,FXint y) const; 00060 00061 /// Return TRUE if region contains rectangle 00062 FXbool contains(FXint x,FXint y,FXint w,FXint h) const; 00063 00064 /// Return bounding box 00065 void bounds(FXRectangle& r) const; 00066 00067 /// Offset region by dx,dy 00068 FXRegion& offset(FXint dx,FXint dy); 00069 00070 /// Union region r with this one 00071 FXRegion& operator+=(const FXRegion& r); 00072 00073 /// Intersect region r with this one 00074 FXRegion& operator*=(const FXRegion& r); 00075 00076 /// Substract region r from this one 00077 FXRegion& operator-=(const FXRegion& r); 00078 00079 /// Xor region r with this one 00080 FXRegion& operator^=(const FXRegion& r); 00081 00082 /// Union of region r1 and region r2 00083 friend FXAPI FXRegion operator+(const FXRegion& r1,const FXRegion& r2); 00084 00085 /// Intersection of region r1 and region r2 00086 friend FXAPI FXRegion operator*(const FXRegion& r1,const FXRegion& r2); 00087 00088 /// Substract region r2 from region r1 00089 friend FXAPI FXRegion operator-(const FXRegion& r1,const FXRegion& r2); 00090 00091 /// Xor of region r1 and region r2 00092 friend FXAPI FXRegion operator^(const FXRegion& r1,const FXRegion& r2); 00093 00094 /// Return TRUE if region equal to this one 00095 friend FXAPI FXbool operator==(const FXRegion& r1,const FXRegion& r2); 00096 00097 /// Return TRUE if region not equal to this one 00098 friend FXAPI FXbool operator!=(const FXRegion& r1,const FXRegion& r2); 00099 00100 /// Reset region to empty 00101 void reset(); 00102 00103 /// Destroy region 00104 ~FXRegion(); 00105 }; 00106 00107 } 00108 00109 #endif

Copyright © 1997-2004 Jeroen van der Zijp