GFC Logo GFC Title Logo
Reference Manual
Main Page  |  Namespace List  |  Alphabetical List  |  Class List  |  File List

region.hh

Go to the documentation of this file.
00001 /* GFC-UI: GTK+ Foundation Classes (User Interface Library) 00002 * Copyright (C) 2002-2004 The GFC Development Team. 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation; either version 2 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU Library General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Library General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00017 */ 00018 00024 00025 #ifndef GFC_GDK_REGION_HH 00026 #define GFC_GDK_REGION_HH 00027 00028 #ifndef GFC_OBJECT_HH 00029 #include <gfc/object.hh> 00030 #endif 00031 00032 #ifndef __GDK_REGION_H__ 00033 #include <gdk/gdkregion.h> 00034 #endif 00035 00036 #ifndef _CPP_VECTOR 00037 #include <vector> 00038 #endif 00039 00040 namespace GFC { 00041 00042 namespace Gdk { 00043 00044 class Rectangle; 00045 class Point; 00046 class Span; 00047 00052 00053 enum FillRule 00054 { 00055 EVEN_ODD_RULE = GDK_EVEN_ODD_RULE, 00058 00059 WINDING_RULE = GDK_WINDING_RULE 00061 }; 00062 00065 00066 enum OverlapType 00067 { 00068 OVERLAP_RECTANGLE_IN = GDK_OVERLAP_RECTANGLE_IN, 00069 OVERLAP_RECTANGLE_OUT = GDK_OVERLAP_RECTANGLE_OUT, 00070 OVERLAP_RECTANGLE_PART = GDK_OVERLAP_RECTANGLE_PART 00071 }; 00072 00078 00079 class Region : public GFC::Object 00080 { 00081 GdkRegion *region_; 00082 00083 public: 00084 typedef sigc::slot<void, GdkSpan*> SpansIntersectForeachSlot; 00094 00097 00098 Region(); 00100 00101 Region(const std::vector<Point>& points, FillRule fill_rule); 00105 00106 Region(const Rectangle& rectangle); 00109 00110 explicit Region(GdkRegion *region); 00115 00116 Region(const Region& src); 00119 00120 virtual ~Region(); 00122 00123 Region& operator=(const Region& src); 00126 00130 00131 GdkRegion* gdk_region() const; 00133 00134 operator GdkRegion* () const; 00136 00137 Rectangle get_clipbox() const; 00140 00141 void get_clipbox(Rectangle& rectangle) const; 00145 00146 std::vector<Rectangle> get_rectangles() const; 00149 00150 bool empty() const; 00152 00153 bool equal(const Region& other) const; 00155 00156 bool point_in(int x, int y) const; 00161 00162 bool point_in(const Point& point) const; 00166 00167 OverlapType rect_in(const Rectangle& rectangle) const; 00172 00173 bool operator==(const Region& other) const; 00177 00178 bool operator!=(const Region& other) const; 00182 00186 00187 void offset(int dx, int dy); 00191 00192 void shrink(int dx, int dy); 00198 00199 void union_with(const Rectangle& rectangle); 00204 00205 void union_with(const Region& other); 00210 00211 void intersect(const Region& other); 00216 00217 void subtract(const Region& other); 00222 00223 void xor_with(const Region& other); 00228 00229 void spans_intersect_foreach(const std::vector<Span>& spans, bool sorted, const SpansIntersectForeachSlot& slot); 00234 00236 }; 00237 00238 } // namespace Gdk 00239 00240 } // namespace GFC 00241 00242 #include <gfc/gdk/inline/region.inl> 00243 00244 #endif // GFC_GDK_REGION_HH 00245

Generated on Tue Aug 24 00:34:31 2004 for GFC-UI by doxygen 1.3.8