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

FXRegion.h

Go to the documentation of this file.
00001 /********************************************************************************
00002 *                                                                               *
00003 *                      C l i p p i n g   R e g i o n                            *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 2000,2006 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.20 2006/01/22 17:58:08 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,bool 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   bool empty() const;
00058 
00059   /// Return true if region contains point
00060   bool contains(FXint x,FXint y) const;
00061 
00062   /// Return true if region contains rectangle
00063   bool 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   /// Return true if region equal to this one
00072   bool operator==(const FXRegion& r) const;
00073 
00074   /// Return true if region not equal to this one
00075   bool operator!=(const FXRegion& r) const;
00076 
00077   /// Union region r with this one
00078   FXRegion& operator+=(const FXRegion& r);
00079 
00080   /// Intersect region r with this one
00081   FXRegion& operator*=(const FXRegion& r);
00082 
00083   /// Subtract region r from this one
00084   FXRegion& operator-=(const FXRegion& r);
00085 
00086   /// Xor region r with this one
00087   FXRegion& operator^=(const FXRegion& r);
00088 
00089   /// Union of this region and region r
00090   FXRegion operator+(const FXRegion& r) const;
00091 
00092   /// Intersection of this region and region r
00093   FXRegion operator*(const FXRegion& r) const;
00094 
00095   /// Subtract region r from this region
00096   FXRegion operator-(const FXRegion& r) const;
00097 
00098   /// Xor of this region and region r
00099   FXRegion operator^(const FXRegion& r) const;
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