Ardour  8.7-14-g57a6773833
tk/ydkmm/ydkmm/gdkmm/types.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 // Generated by gmmproc 2.45.3 -- DO NOT MODIFY!
3 #ifndef _GDKMM_TYPES_H
4 #define _GDKMM_TYPES_H
5 
6 
7 #include <glibmm/ustring.h>
8 #include <sigc++/sigc++.h>
9 
10 /* $Id: types.hg,v 1.6 2005/12/14 15:36:23 murrayc Exp $ */
11 
12 /* Copyright (C) 2002 The gtkmm Development Team
13  *
14  * This library is free software; you can redistribute it and/or
15  * modify it under the terms of the GNU Lesser General Public
16  * License as published by the Free Software Foundation; either
17  * version 2.1 of the License, or (at your option) any later version.
18  *
19  * This library is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22  * Lesser General Public License for more details.
23  *
24  * You should have received a copy of the GNU Lesser General Public
25  * License along with this library; if not, write to the Free
26  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27  */
28 
29 
30 #include <glibmm/arrayhandle.h>
31 #include <glibmm/listhandle.h>
32 #include <gdk/gdk.h>
33 #include <gdkmmconfig.h>
34 
35 /* Shadow ERROR macro (from wingdi.h).
36  */
37 #if defined(ERROR) && !defined(GTKMM_MACRO_SHADOW_ERROR)
38 enum { GTKMM_MACRO_DEFINITION_ERROR = ERROR };
39 #undef ERROR
40 enum { ERROR = GTKMM_MACRO_DEFINITION_ERROR };
41 #define ERROR ERROR
42 #define GTKMM_MACRO_SHADOW_ERROR 1
43 #endif
44 
45 /*********************************************************************
46 ***** Version macros
47 *********************************************************************/
48 
49 /* macro for controlling version numbers */
50 #ifndef _GDK_VERSION
51 
52 #define GDK_VERSION_GT(major,minor) ((GTK_MAJOR_VERSION>major)||(GTK_MAJOR_VERSION==major)&&(GTK_MINOR_VERSION>minor))
53 #define GDK_VERSION_GE(major,minor) ((GTK_MAJOR_VERSION>major)||(GTK_MAJOR_VERSION==major)&&(GTK_MINOR_VERSION>=minor))
54 #define GDK_VERSION_EQ(major,minor) ((GTK_MAJOR_VERSION==major)&&(GTK_MINOR_VERSION==minor))
55 #define GDK_VERSION_NE(major,minor) ((GTK_MAJOR_VERSION!=major)||(GTK_MINOR_VERSION!=minor))
56 #define GDK_VERSION_LE(major,minor) ((GTK_MAJOR_VERSION<major)||(GTK_MAJOR_VERSION==major)&&(GTK_MINOR_VERSION<=minor))
57 #define GDK_VERSION_LT(major,minor) ((GTK_MAJOR_VERSION<major)||(GTK_MAJOR_VERSION==major)&&(GTK_MINOR_VERSION<minor))
58 
59 //Note: Use GTK_CHECK_VERSION to check that a version is equal or more than (the micro version).
60 
61 #endif /* _GDK_VERSION */
62 
63 namespace Gdk
64 {
65 
66 class Bitmap;
67 class Colormap;
68 class Pixmap;
69 class Window;
70 class Font;
71 class GC;
72 class Color;
73 class Image;
74 
82 {
84  MSB_FIRST
85 };
86 
87 } // namespace Gdk
88 
89 
90 #ifndef DOXYGEN_SHOULD_SKIP_THIS
91 namespace Glib
92 {
93 
94 template <>
95 class Value<Gdk::ByteOrder> : public Glib::Value_Enum<Gdk::ByteOrder>
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 
121 {
122  SHIFT_MASK = 1 << 0,
123  LOCK_MASK = 1 << 1,
124  CONTROL_MASK = 1 << 2,
125  MOD1_MASK = 1 << 3,
126  MOD2_MASK = 1 << 4,
127  MOD3_MASK = 1 << 5,
128  MOD4_MASK = 1 << 6,
129  MOD5_MASK = 1 << 7,
130  BUTTON1_MASK = 1 << 8,
131  BUTTON2_MASK = 1 << 9,
132  BUTTON3_MASK = 1 << 10,
133  BUTTON4_MASK = 1 << 11,
134  BUTTON5_MASK = 1 << 12,
135  SUPER_MASK = 1 << 26,
136  HYPER_MASK = 1 << 27,
137  META_MASK = 1 << 28,
138  RELEASE_MASK = 1 << 30,
139  MODIFIER_MASK = 0x5c001fff
140 };
141 
144  { return static_cast<ModifierType>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs)); }
145 
148  { return static_cast<ModifierType>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs)); }
149 
152  { return static_cast<ModifierType>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs)); }
153 
156  { return static_cast<ModifierType>(~static_cast<unsigned>(flags)); }
157 
160  { return (lhs = static_cast<ModifierType>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs))); }
161 
164  { return (lhs = static_cast<ModifierType>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs))); }
165 
168  { return (lhs = static_cast<ModifierType>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs))); }
169 
170 } // namespace Gdk
171 
172 
173 #ifndef DOXYGEN_SHOULD_SKIP_THIS
174 namespace Glib
175 {
176 
177 template <>
178 class Value<Gdk::ModifierType> : public Glib::Value_Flags<Gdk::ModifierType>
179 {
180 public:
181  static GType value_type() G_GNUC_CONST;
182 };
183 
184 } // namespace Glib
185 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
186 
187 
188 namespace Gdk
189 {
190 
195 enum Status
196 {
197  OK = 0,
198  ERROR = -1,
201  ERROR_MEM = -4
202 };
203 
204 } // namespace Gdk
205 
206 
207 #ifndef DOXYGEN_SHOULD_SKIP_THIS
208 namespace Glib
209 {
210 
211 template <>
212 class Value<Gdk::Status> : public Glib::Value_Enum<Gdk::Status>
213 {
214 public:
215  static GType value_type() G_GNUC_CONST;
216 };
217 
218 } // namespace Glib
219 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
220 
221 
222 namespace Gdk
223 {
224 
238 {
239  INPUT_READ = 1 << 0,
240  INPUT_WRITE = 1 << 1,
241  INPUT_EXCEPTION = 1 << 2
242 };
243 
246  { return static_cast<InputCondition>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs)); }
247 
250  { return static_cast<InputCondition>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs)); }
251 
254  { return static_cast<InputCondition>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs)); }
255 
258  { return static_cast<InputCondition>(~static_cast<unsigned>(flags)); }
259 
262  { return (lhs = static_cast<InputCondition>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs))); }
263 
266  { return (lhs = static_cast<InputCondition>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs))); }
267 
270  { return (lhs = static_cast<InputCondition>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs))); }
271 
272 } // namespace Gdk
273 
274 
275 #ifndef DOXYGEN_SHOULD_SKIP_THIS
276 namespace Glib
277 {
278 
279 template <>
280 class Value<Gdk::InputCondition> : public Glib::Value_Flags<Gdk::InputCondition>
281 {
282 public:
283  static GType value_type() G_GNUC_CONST;
284 };
285 
286 } // namespace Glib
287 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
288 
289 
290 namespace Gdk
291 {
292 
293 
294 typedef GdkGeometry Geometry; //It's not used enough to justify having a wrapper.
296 
299 class Point
300 {
301  public:
302 #ifndef DOXYGEN_SHOULD_SKIP_THIS
303  typedef Point CppObjectType;
304  typedef GdkPoint BaseObjectType;
305 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
306 
307 private:
308 
309 
310 public:
311  Point();
312  Point(int x, int y);
313 
314  void set_x(int x) { gobject_.x = x; }
315  void set_y(int y) { gobject_.y = y; }
316 
317  int get_x() const { return gobject_.x; }
318  int get_y() const { return gobject_.y; }
319 
320  bool equal(const Gdk::Point& rhs) const;
321 
323  GdkPoint* gobj() { return &gobject_; }
325  const GdkPoint* gobj() const { return &gobject_; }
326 
327 protected:
329 
330 
331 };
332 
334 inline bool operator==(const Point& lhs, const Point& rhs)
335  { return lhs.equal(rhs); }
336 
338 inline bool operator!=(const Point& lhs, const Point& rhs)
339  { return !lhs.equal(rhs); }
340 
341 #ifndef DOXYGEN_SHOULD_SKIP_THIS
342 struct AtomStringTraits
343 {
344  typedef std::string CppType;
345  typedef GdkAtom CType;
346  typedef GdkAtom CTypeNonConst;
347 
348  static GdkAtom to_c_type(GdkAtom atom) { return atom; }
349  static void release_c_type(GdkAtom) {}
350 
351  // These aren't worth to be inlined since doing so
352  // would expose way too much of the implementation.
353  static GdkAtom to_c_type (const std::string& atom_name);
354  static std::string to_cpp_type(GdkAtom atom);
355 };
356 
357 // I'm typedef'ing this because when we call to_c_type or to_c_type,
358 // we don't want it to look like we're calling a template trait, but
359 // a utility function. -Bryan
360 typedef AtomStringTraits AtomString;
361 
362 // Glib::ScopedPtr has been deprecated in glibmm 2.47.6.
363 // We don't want to use the replacement, Glib::make_unique_ptr_gfree(),
364 // in gtkmm-2, because it requires C++11. Instead, add this identical Gdk::ScopedPtr,
365 // intended only for internal use in gtkmm.
366 
370 template <typename T>
371 class ScopedPtr
372 {
373 private:
374  T* ptr_;
375  ScopedPtr(const ScopedPtr<T>&);
376  ScopedPtr<T>& operator=(const ScopedPtr<T>&);
377 
378 public:
379  ScopedPtr() : ptr_(0) {}
380  explicit ScopedPtr(T* ptr) : ptr_(ptr) {}
381  ~ScopedPtr() { g_free(ptr_); }
382  T* get() const { return ptr_; }
383  T** addr() { return &ptr_; }
384 };
385 #endif //DOXYGEN_SHOULD_SKIP_THIS
386 
387 typedef Glib::ArrayHandle<std::string,AtomStringTraits> ArrayHandle_AtomString;
388 typedef Glib::ListHandle<std::string,AtomStringTraits> ListHandle_AtomString;
389 
390 } // namespace Gdk
391 
392 
393 namespace Glib
394 {
395 
398 
400 const Gdk::Point& wrap(const GdkPoint* object);
401 
402 } // namespace Glib
403 
404 
405 #endif /* _GDKMM_TYPES_H */
406 
const Gdk::Point & wrap(const GdkPoint *object)
bool operator!=(const Point &lhs, const Point &rhs)
const GdkPoint * gobj() const
Provides access to the underlying C GObject.
bool equal(const Gdk::Point &rhs) const
Gdk::Point & wrap(GdkPoint *object)
GdkPoint * gobj()
Provides access to the underlying C GObject.
bool operator==(const Point &lhs, const Point &rhs)
Point(int x, int y)
Definition: Window.h:41
struct _GdkAtom * GdkAtom
Definition: gdktypes.h:80
guint32 GdkNativeWindow
Definition: gdktypes.h:97
typedefG_BEGIN_DECLS struct _GdkPoint GdkPoint
Definition: gdktypes.h:68
typedefG_BEGIN_DECLS struct _GdkGeometry GdkGeometry
Definition: gdkwindow.h:40
InputCondition operator|(InputCondition lhs, InputCondition rhs)
InputCondition operator~(InputCondition flags)
InputCondition & operator&=(InputCondition &lhs, InputCondition rhs)
InputCondition operator^(InputCondition lhs, InputCondition rhs)
InputCondition & operator|=(InputCondition &lhs, InputCondition rhs)
DragAction operator&(DragAction lhs, DragAction rhs)
Definition: dragcontext.h:82
DragAction & operator|=(DragAction &lhs, DragAction rhs)
Definition: dragcontext.h:94
DragAction operator~(DragAction flags)
Definition: dragcontext.h:90
DragAction & operator^=(DragAction &lhs, DragAction rhs)
Definition: dragcontext.h:102
InputCondition & operator^=(InputCondition &lhs, InputCondition rhs)
InputCondition operator&(InputCondition lhs, InputCondition rhs)
DragAction & operator&=(DragAction &lhs, DragAction rhs)
Definition: dragcontext.h:98
DragAction operator^(DragAction lhs, DragAction rhs)
Definition: dragcontext.h:86
DragAction operator|(DragAction lhs, DragAction rhs)
Definition: dragcontext.h:78
Glib::ArrayHandle< std::string, AtomStringTraits > ArrayHandle_AtomString
Glib::ListHandle< std::string, AtomStringTraits > ListHandle_AtomString
GdkNativeWindow NativeWindow
GdkGeometry Geometry
uint32_t Color
Definition: colors.h:33
Definition: lobject.h:100