Ardour  9.0-pre0-582-g084a23a80d
tk/ydkmm/ydkmm/gdkmm/region.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 // Generated by gmmproc 2.45.3 -- DO NOT MODIFY!
3 #ifndef _GDKMM_REGION_H
4 #define _GDKMM_REGION_H
5 
6 
7 #include <glibmm/ustring.h>
8 #include <sigc++/sigc++.h>
9 
10 /* $Id: region.hg,v 1.3 2004/02/03 11:06:48 murrayc Exp $ */
11 
12 /* region.h
13  *
14  * Copyright (C) 1998-2002 The gtkmm Development Team
15  *
16  * This library is free software; you can redistribute it and/or
17  * modify it under the terms of the GNU Lesser General Public
18  * License as published by the Free Software Foundation; either
19  * version 2.1 of the License, or (at your option) any later version.
20  *
21  * This library is distributed in the hope that it will be useful,
22  * but WITHOUT ANY WARRANTY; without even the implied warranty of
23  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24  * Lesser General Public License for more details.
25  *
26  * You should have received a copy of the GNU Lesser General Public
27  * License along with this library; if not, write to the Free
28  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
29  */
30 
31 // We use GdkSpanFunc in the (deprecated) API, so we must temporarily undef GDK_DISABLE_DEPRECATED.
32 // We shouldn't have used that C type in the API anyway, but we can't break API.
33 // Temporarily undef GDK_DISABLE_DEPRECATED, redefining it later if appropriate.
34 // We need this to use _GtkBoxChild, which we use in our (deprecated) API.
35 #if defined(GDK_DISABLE_DEPRECATED) && !defined(GTKMM_GDK_DISABLE_DEPRECATED_UNDEFED)
36 #undef GDK_DISABLE_DEPRECATED
37 #define GTKMM_GDK_DISABLE_DEPRECATED_UNDEFED 1
38 #endif
39 
40 // This is for dragcontext which is often included after color.h, which we can't avoid.
41 // We use GdkDragContext members in the (deprecated) API, for which there are no replacements,
42 // so we must temporarily undef GSEAL_ENABLE.
43 // Temporarily undef GSEAL_ENABLE, redefining it later if appropriate.
44 #if defined(GSEAL_ENABLE) && !defined(GTKMM_GSEAL_ENABLE_UNDEFED)
45 #undef GSEAL_ENABLE
46 #define GTKMM_GSEAL_ENABLE_UNDEFED 1
47 #endif
48 
49 #include <gdk/gdk.h>
50 
51 // Redefine GDK_DISABLE_DEPRECATED if it was defined before we temporarily undefed it:
52 #if defined(GTKMM_GDK_DISABLE_DEPRECATED_UNDEFED)
53 #define GDK_DISABLE_DEPRECATED 1
54 #undef GTKMM_GDK_DISABLE_DEPRECATED_UNDEFED
55 #endif
56 
57 // Redefine GSEAL_ENABLE if it was defined before we temporarily undefed it:
58 #if defined(GTKMM_GSEAL_ENABLE_UNDEFED)
59 #define GSEAL_ENABLE 1
60 #undef GTKMM_GSEAL_ENABLE_UNDEFED
61 #endif
62 
63 
64 extern "C" { typedef struct _GdkRegion GdkRegion; }
65 
66 #include <glibmm/arrayhandle.h>
67 #include <gdkmm/types.h>
68 #include <gdkmm/rectangle.h>
69 
70 
71 namespace Gdk
72 {
73 
74 
82 {
85 };
86 
87 } // namespace Gdk
88 
89 
90 #ifndef DOXYGEN_SHOULD_SKIP_THIS
91 namespace Glib
92 {
93 
94 template <>
95 class Value<Gdk::FillRule> : public Glib::Value_Enum<Gdk::FillRule>
96 {
97 public:
98  static GType value_type() G_GNUC_CONST;
99 };
100 
101 } // namespace Glib
102 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
103 
104 
105 namespace Gdk
106 {
107 
113 {
117 };
118 
119 } // namespace Gdk
120 
121 
122 #ifndef DOXYGEN_SHOULD_SKIP_THIS
123 namespace Glib
124 {
125 
126 template <>
127 class Value<Gdk::OverlapType> : public Glib::Value_Enum<Gdk::OverlapType>
128 {
129 public:
130  static GType value_type() G_GNUC_CONST;
131 };
132 
133 } // namespace Glib
134 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
135 
136 
137 namespace Gdk
138 {
139 
140 
144 class Region
145 {
146  public:
147 #ifndef DOXYGEN_SHOULD_SKIP_THIS
148  typedef Region CppObjectType;
149  typedef GdkRegion BaseObjectType;
150 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
151 
157 
158  // Use make_a_copy=true when getting it directly from a struct.
159  explicit Region(GdkRegion* castitem, bool make_a_copy = false);
160 
161  Region(const Region& src);
162  Region& operator=(const Region& src);
163 
165 
166  GdkRegion* gobj() { return gobject_; }
167  const GdkRegion* gobj() const { return gobject_; }
168 
171 
172 protected:
174 
175 private:
176 
177 
178 public:
179 
180  Region(const Glib::ArrayHandle<Gdk::Point>& points, FillRule fill_rule);
181  explicit Region(const Rectangle& rectangle);
182 
183 
189  Glib::ArrayHandle<Rectangle> get_rectangles() const;
190 
191 
196  bool empty();
197 
204  bool point_in(int x, int y);
205 
214 
215 
221  void offset(int dx, int dy);
222 
231  void shrink(int dx, int dy);
232 
239  void union_with_rect(const Rectangle& rect);
240 
247  void intersect(const Region& source2);
248 
255  void union_(const Region& source2); //union is a keyword.
256 
262  void subtract(const Region& source2);
263 
270  void xor_(const Region& source2); //xor is a keyword
271 
272 
273 //Note: The spans parameter was made const in GTK+ 2.16, but we can't change that in our C++ API. TODO: Change it when we can do an ABI break.
274 
275 
286  void spans_intersect_foreach(GdkSpan* spans, int n_spans, bool sorted, GdkSpanFunc function, gpointer data);
287 
288 
289 };
290 
291 
292 } //namespace Gdk
293 
294 
295 namespace Gdk
296 {
297 
303 bool operator==(const Region& lhs, const Region& rhs);
304 
310 bool operator!=(const Region& lhs, const Region& rhs);
311 
312 
313 } // namespace Gdk
314 
315 
316 namespace Glib
317 {
318 
327 Gdk::Region wrap(GdkRegion* object, bool take_copy = false);
328 
329 } // namespace Glib
330 
331 
332 #endif /* _GDKMM_REGION_H */
333 
void xor_(const Region &source2)
void spans_intersect_foreach(GdkSpan *spans, int n_spans, bool sorted, GdkSpanFunc function, gpointer data)
void subtract(const Region &source2)
const GdkRegion * gobj() const
Region & operator=(const Region &src)
Region(const Region &src)
void shrink(int dx, int dy)
OverlapType rect_in(const Rectangle &rect)
Gdk::Region wrap(GdkRegion *object, bool take_copy=false)
void union_(const Region &source2)
Region(GdkRegion *castitem, bool make_a_copy=false)
bool operator!=(const Region &lhs, const Region &rhs)
void get_clipbox(const Rectangle &rectangle)
Region(const Rectangle &rectangle)
bool point_in(int x, int y)
void offset(int dx, int dy)
Glib::ArrayHandle< Rectangle > get_rectangles() const
void union_with_rect(const Rectangle &rect)
GdkRegion * gobj_copy() const
Provides access to the underlying C instance. The caller is responsible for freeing it....
void intersect(const Region &source2)
bool operator==(const Region &lhs, const Region &rhs)
bool empty()
Region(const Glib::ArrayHandle< Gdk::Point > &points, FillRule fill_rule)
void(* GdkSpanFunc)(GdkSpan *span, gpointer data)
Definition: gdkregion.h:63
void rectangle(Cairo::RefPtr< Cairo::Context > context, double x, double y, double w, double h, double r=10)
Definition: lobject.h:100