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,2009 by Jeroen van der Zijp.   All Rights Reserved.        *
00007 *********************************************************************************
00008 * This library is free software; you can redistribute it and/or modify          *
00009 * it under the terms of the GNU Lesser General Public License as published by   *
00010 * the Free Software Foundation; either version 3 of the License, or             *
00011 * (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                 *
00016 * GNU Lesser General Public License for more details.                           *
00017 *                                                                               *
00018 * You should have received a copy of the GNU Lesser General Public License      *
00019 * along with this program.  If not, see <http://www.gnu.org/licenses/>          *
00020 *********************************************************************************
00021 * $Id: FXRegion.h,v 1.25 2009/01/06 13:07:26 fox Exp $                          *
00022 ********************************************************************************/
00023 #ifndef FXREGION_H
00024 #define FXREGION_H
00025 
00026 namespace FX {
00027 
00028 /// Region
00029 class FXAPI FXRegion {
00030   friend class FXDC;
00031   friend class FXDCWindow;
00032   friend class FXWindow;
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   FXRectangle bounds() const;
00066 
00067   /// Offset region by dx,dy
00068   FXRegion& offset(FXint dx,FXint dy);
00069 
00070   /// Return true if region equal to this one
00071   FXbool operator==(const FXRegion& r) const;
00072 
00073   /// Return true if region not equal to this one
00074   FXbool operator!=(const FXRegion& r) const;
00075 
00076   /// Union region r with this one
00077   FXRegion& operator+=(const FXRegion& r);
00078 
00079   /// Intersect region r with this one
00080   FXRegion& operator*=(const FXRegion& r);
00081 
00082   /// Subtract region r from this one
00083   FXRegion& operator-=(const FXRegion& r);
00084 
00085   /// Xor region r with this one
00086   FXRegion& operator^=(const FXRegion& r);
00087 
00088   /// Union of this region and region r
00089   FXRegion operator+(const FXRegion& r) const;
00090 
00091   /// Intersection of this region and region r
00092   FXRegion operator*(const FXRegion& r) const;
00093 
00094   /// Subtract region r from this region
00095   FXRegion operator-(const FXRegion& r) const;
00096 
00097   /// Xor of this region and region r
00098   FXRegion operator^(const FXRegion& r) const;
00099 
00100   /// Reset region to empty
00101   void reset();
00102 
00103   /// Destroy region
00104  ~FXRegion();
00105   };
00106 
00107 }
00108 
00109 #endif

Copyright © 1997-2009 Jeroen van der Zijp