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,2005 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.16 2005/01/16 16:06:06 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 friend class FXWindow; 00034 private: 00035 void *region; 00036 public: 00037 00038 /// Construct new empty region 00039 FXRegion(); 00040 00041 /// Construct new region copied from region r 00042 FXRegion(const FXRegion& r); 00043 00044 /// Construct new region from rectangle rect 00045 FXRegion(const FXRectangle& rect); 00046 00047 /// Construct rectangle region 00048 FXRegion(FXint x,FXint y,FXint w,FXint h); 00049 00050 /// Construct polygon region 00051 FXRegion(const FXPoint* points,FXuint npoints,FXbool winding=FALSE); 00052 00053 /// Assign region r to this one 00054 FXRegion &operator=(const FXRegion& r); 00055 00056 /// Return TRUE if region is empty 00057 FXbool empty() const; 00058 00059 /// Return TRUE if region contains point 00060 FXbool contains(FXint x,FXint y) const; 00061 00062 /// Return TRUE if region contains rectangle 00063 FXbool contains(FXint x,FXint y,FXint w,FXint h) const; 00064 00065 /// Return bounding box 00066 FXRectangle bounds() const; 00067 00068 /// Offset region by dx,dy 00069 FXRegion& offset(FXint dx,FXint dy); 00070 00071 /// Union region r with this one 00072 FXRegion& operator+=(const FXRegion& r); 00073 00074 /// Intersect region r with this one 00075 FXRegion& operator*=(const FXRegion& r); 00076 00077 /// Subtract region r from this one 00078 FXRegion& operator-=(const FXRegion& r); 00079 00080 /// Xor region r with this one 00081 FXRegion& operator^=(const FXRegion& r); 00082 00083 /// Union of region r1 and region r2 00084 friend FXAPI FXRegion operator+(const FXRegion& r1,const FXRegion& r2); 00085 00086 /// Intersection of region r1 and region r2 00087 friend FXAPI FXRegion operator*(const FXRegion& r1,const FXRegion& r2); 00088 00089 /// Subtract region r2 from region r1 00090 friend FXAPI FXRegion operator-(const FXRegion& r1,const FXRegion& r2); 00091 00092 /// Xor of region r1 and region r2 00093 friend FXAPI FXRegion operator^(const FXRegion& r1,const FXRegion& r2); 00094 00095 /// Return TRUE if region equal to this one 00096 friend FXAPI FXbool operator==(const FXRegion& r1,const FXRegion& r2); 00097 00098 /// Return TRUE if region not equal to this one 00099 friend FXAPI FXbool operator!=(const FXRegion& r1,const FXRegion& r2); 00100 00101 /// Reset region to empty 00102 void reset(); 00103 00104 /// Destroy region 00105 ~FXRegion(); 00106 }; 00107 00108 } 00109 00110 #endif

Copyright © 1997-2005 Jeroen van der Zijp