~ubuntu-branches/ubuntu/vivid/ardour/vivid-proposed

« back to all changes in this revision

Viewing changes to libs/gtkmm2/gdk/gdkmm/types.h

  • Committer: Package Import Robot
  • Author(s): Felipe Sateler, Jaromír Mikeš, Felipe Sateler
  • Date: 2014-05-22 14:39:25 UTC
  • mfrom: (29 sid)
  • mto: This revision was merged to the branch mainline in revision 30.
  • Revision ID: package-import@ubuntu.com-20140522143925-vwqfo9287pmkrroe
Tags: 1:2.8.16+git20131003-3
* Team upload

[ Jaromír Mikeš ]
* Add -dbg package

[ Felipe Sateler ]
* Upload to experimental

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// -*- c++ -*-
 
2
// Generated by gtkmmproc -- DO NOT MODIFY!
 
3
#ifndef _GDKMM_TYPES_H
 
4
#define _GDKMM_TYPES_H
 
5
 
 
6
#include <glibmm.h>
 
7
 
 
8
/* $Id$ */
 
9
 
 
10
/* Copyright (C) 2002 The gtkmm Development Team
 
11
 *
 
12
 * This library is free software; you can redistribute it and/or
 
13
 * modify it under the terms of the GNU Library General Public
 
14
 * License as published by the Free Software Foundation; either
 
15
 * version 2 of the License, or (at your option) any later version.
 
16
 *
 
17
 * This library is distributed in the hope that it will be useful,
 
18
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
19
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
20
 * Library General Public License for more details.
 
21
 *
 
22
 * You should have received a copy of the GNU Library General Public
 
23
 * License along with this library; if not, write to the Free
 
24
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
25
 */
 
26
 
 
27
 
 
28
#include <gdk/gdk.h>
 
29
#include <gdkmmconfig.h>
 
30
 
 
31
/* Shadow ERROR macro (from wingdi.h).
 
32
 */
 
33
#if defined(ERROR) && !defined(GTKMM_MACRO_SHADOW_ERROR)
 
34
enum { GTKMM_MACRO_DEFINITION_ERROR = ERROR };
 
35
#undef ERROR
 
36
enum { ERROR = GTKMM_MACRO_DEFINITION_ERROR };
 
37
#define ERROR ERROR
 
38
#define GTKMM_MACRO_SHADOW_ERROR 1
 
39
#endif
 
40
 
 
41
/*********************************************************************
 
42
***** Version macros
 
43
*********************************************************************/
 
44
 
 
45
/* macro for controlling version numbers */
 
46
#ifndef _GDK_VERSION
 
47
 
 
48
#define GDK_VERSION_GT(major,minor) ((GTK_MAJOR_VERSION>major)||(GTK_MAJOR_VERSION==major)&&(GTK_MINOR_VERSION>minor))
 
49
#define GDK_VERSION_GE(major,minor) ((GTK_MAJOR_VERSION>major)||(GTK_MAJOR_VERSION==major)&&(GTK_MINOR_VERSION>=minor))
 
50
#define GDK_VERSION_EQ(major,minor) ((GTK_MAJOR_VERSION==major)&&(GTK_MINOR_VERSION==minor))
 
51
#define GDK_VERSION_NE(major,minor) ((GTK_MAJOR_VERSION!=major)||(GTK_MINOR_VERSION!=minor))
 
52
#define GDK_VERSION_LE(major,minor) ((GTK_MAJOR_VERSION<major)||(GTK_MAJOR_VERSION==major)&&(GTK_MINOR_VERSION<=minor))
 
53
#define GDK_VERSION_LT(major,minor) ((GTK_MAJOR_VERSION<major)||(GTK_MAJOR_VERSION==major)&&(GTK_MINOR_VERSION<minor))
 
54
 
 
55
//Note: Use GTK_CHECK_VERSION to check that a version is equal or more than (the micro version).
 
56
 
 
57
#endif /* _GDK_VERSION */
 
58
 
 
59
namespace Gdk
 
60
{
 
61
 
 
62
class Bitmap;
 
63
class Colormap;
 
64
class Pixmap;
 
65
class Window;
 
66
class Font;
 
67
class GC;
 
68
class Color;
 
69
class Image;
 
70
 
 
71
 
 
72
/** @addtogroup gdkmmEnums Enums and Flags */
 
73
 
 
74
/**
 
75
 * @ingroup gdkmmEnums
 
76
 */
 
77
enum ByteOrder
 
78
{
 
79
  LSB_FIRST,
 
80
  MSB_FIRST
 
81
};
 
82
 
 
83
} // namespace Gdk
 
84
 
 
85
 
 
86
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
87
namespace Glib
 
88
{
 
89
 
 
90
template <>
 
91
class Value<Gdk::ByteOrder> : public Glib::Value_Enum<Gdk::ByteOrder>
 
92
{
 
93
public:
 
94
  static GType value_type() G_GNUC_CONST;
 
95
};
 
96
 
 
97
} // namespace Glib
 
98
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
99
 
 
100
 
 
101
namespace Gdk
 
102
{
 
103
 
 
104
/**
 
105
 * @ingroup gdkmmEnums
 
106
 * @par Bitwise operators:
 
107
 * <tt>%ModifierType operator|(ModifierType, ModifierType)</tt><br>
 
108
 * <tt>%ModifierType operator&(ModifierType, ModifierType)</tt><br>
 
109
 * <tt>%ModifierType operator^(ModifierType, ModifierType)</tt><br>
 
110
 * <tt>%ModifierType operator~(ModifierType)</tt><br>
 
111
 * <tt>%ModifierType& operator|=(ModifierType&, ModifierType)</tt><br>
 
112
 * <tt>%ModifierType& operator&=(ModifierType&, ModifierType)</tt><br>
 
113
 * <tt>%ModifierType& operator^=(ModifierType&, ModifierType)</tt><br>
 
114
 */
 
115
enum ModifierType
 
116
{
 
117
  SHIFT_MASK = 1 << 0,
 
118
  LOCK_MASK = 1 << 1,
 
119
  CONTROL_MASK = 1 << 2,
 
120
  MOD1_MASK = 1 << 3,
 
121
  MOD2_MASK = 1 << 4,
 
122
  MOD3_MASK = 1 << 5,
 
123
  MOD4_MASK = 1 << 6,
 
124
  MOD5_MASK = 1 << 7,
 
125
  BUTTON1_MASK = 1 << 8,
 
126
  BUTTON2_MASK = 1 << 9,
 
127
  BUTTON3_MASK = 1 << 10,
 
128
  BUTTON4_MASK = 1 << 11,
 
129
  BUTTON5_MASK = 1 << 12,
 
130
  RELEASE_MASK = 1 << 30,
 
131
  MODIFIER_MASK = 0x40001FFF
 
132
};
 
133
 
 
134
/** @ingroup gdkmmEnums */
 
135
inline ModifierType operator|(ModifierType lhs, ModifierType rhs)
 
136
  { return static_cast<ModifierType>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs)); }
 
137
 
 
138
/** @ingroup gdkmmEnums */
 
139
inline ModifierType operator&(ModifierType lhs, ModifierType rhs)
 
140
  { return static_cast<ModifierType>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs)); }
 
141
 
 
142
/** @ingroup gdkmmEnums */
 
143
inline ModifierType operator^(ModifierType lhs, ModifierType rhs)
 
144
  { return static_cast<ModifierType>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs)); }
 
145
 
 
146
/** @ingroup gdkmmEnums */
 
147
inline ModifierType operator~(ModifierType flags)
 
148
  { return static_cast<ModifierType>(~static_cast<unsigned>(flags)); }
 
149
 
 
150
/** @ingroup gdkmmEnums */
 
151
inline ModifierType& operator|=(ModifierType& lhs, ModifierType rhs)
 
152
  { return (lhs = static_cast<ModifierType>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs))); }
 
153
 
 
154
/** @ingroup gdkmmEnums */
 
155
inline ModifierType& operator&=(ModifierType& lhs, ModifierType rhs)
 
156
  { return (lhs = static_cast<ModifierType>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs))); }
 
157
 
 
158
/** @ingroup gdkmmEnums */
 
159
inline ModifierType& operator^=(ModifierType& lhs, ModifierType rhs)
 
160
  { return (lhs = static_cast<ModifierType>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs))); }
 
161
 
 
162
} // namespace Gdk
 
163
 
 
164
 
 
165
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
166
namespace Glib
 
167
{
 
168
 
 
169
template <>
 
170
class Value<Gdk::ModifierType> : public Glib::Value_Flags<Gdk::ModifierType>
 
171
{
 
172
public:
 
173
  static GType value_type() G_GNUC_CONST;
 
174
};
 
175
 
 
176
} // namespace Glib
 
177
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
178
 
 
179
 
 
180
namespace Gdk
 
181
{
 
182
 
 
183
/**
 
184
 * @ingroup gdkmmEnums
 
185
 */
 
186
enum Status
 
187
{
 
188
  OK = 0,
 
189
  ERROR = -1,
 
190
  ERROR_PARAM = -2,
 
191
  ERROR_FILE = -3,
 
192
  ERROR_MEM = -4
 
193
};
 
194
 
 
195
} // namespace Gdk
 
196
 
 
197
 
 
198
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
199
namespace Glib
 
200
{
 
201
 
 
202
template <>
 
203
class Value<Gdk::Status> : public Glib::Value_Enum<Gdk::Status>
 
204
{
 
205
public:
 
206
  static GType value_type() G_GNUC_CONST;
 
207
};
 
208
 
 
209
} // namespace Glib
 
210
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
211
 
 
212
 
 
213
namespace Gdk
 
214
{
 
215
 
 
216
/**
 
217
 * @ingroup gdkmmEnums
 
218
 * @par Bitwise operators:
 
219
 * <tt>%InputCondition operator|(InputCondition, InputCondition)</tt><br>
 
220
 * <tt>%InputCondition operator&(InputCondition, InputCondition)</tt><br>
 
221
 * <tt>%InputCondition operator^(InputCondition, InputCondition)</tt><br>
 
222
 * <tt>%InputCondition operator~(InputCondition)</tt><br>
 
223
 * <tt>%InputCondition& operator|=(InputCondition&, InputCondition)</tt><br>
 
224
 * <tt>%InputCondition& operator&=(InputCondition&, InputCondition)</tt><br>
 
225
 * <tt>%InputCondition& operator^=(InputCondition&, InputCondition)</tt><br>
 
226
 */
 
227
enum InputCondition
 
228
{
 
229
  INPUT_READ = 1 << 0,
 
230
  INPUT_WRITE = 1 << 1,
 
231
  INPUT_EXCEPTION = 1 << 2
 
232
};
 
233
 
 
234
/** @ingroup gdkmmEnums */
 
235
inline InputCondition operator|(InputCondition lhs, InputCondition rhs)
 
236
  { return static_cast<InputCondition>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs)); }
 
237
 
 
238
/** @ingroup gdkmmEnums */
 
239
inline InputCondition operator&(InputCondition lhs, InputCondition rhs)
 
240
  { return static_cast<InputCondition>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs)); }
 
241
 
 
242
/** @ingroup gdkmmEnums */
 
243
inline InputCondition operator^(InputCondition lhs, InputCondition rhs)
 
244
  { return static_cast<InputCondition>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs)); }
 
245
 
 
246
/** @ingroup gdkmmEnums */
 
247
inline InputCondition operator~(InputCondition flags)
 
248
  { return static_cast<InputCondition>(~static_cast<unsigned>(flags)); }
 
249
 
 
250
/** @ingroup gdkmmEnums */
 
251
inline InputCondition& operator|=(InputCondition& lhs, InputCondition rhs)
 
252
  { return (lhs = static_cast<InputCondition>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs))); }
 
253
 
 
254
/** @ingroup gdkmmEnums */
 
255
inline InputCondition& operator&=(InputCondition& lhs, InputCondition rhs)
 
256
  { return (lhs = static_cast<InputCondition>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs))); }
 
257
 
 
258
/** @ingroup gdkmmEnums */
 
259
inline InputCondition& operator^=(InputCondition& lhs, InputCondition rhs)
 
260
  { return (lhs = static_cast<InputCondition>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs))); }
 
261
 
 
262
} // namespace Gdk
 
263
 
 
264
 
 
265
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
266
namespace Glib
 
267
{
 
268
 
 
269
template <>
 
270
class Value<Gdk::InputCondition> : public Glib::Value_Flags<Gdk::InputCondition>
 
271
{
 
272
public:
 
273
  static GType value_type() G_GNUC_CONST;
 
274
};
 
275
 
 
276
} // namespace Glib
 
277
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
278
 
 
279
 
 
280
namespace Gdk
 
281
{
 
282
 
 
283
 
 
284
typedef GdkGeometry Geometry; //It's not used enough to justify having a wrapper.
 
285
typedef GdkNativeWindow NativeWindow;
 
286
 
 
287
/** This is a simple structure containing an x and y coordinate of a point.
 
288
 */
 
289
class Point
 
290
{
 
291
  public:
 
292
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
293
  typedef Point CppObjectType;
 
294
  typedef GdkPoint BaseObjectType;
 
295
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
296
 
 
297
private:
 
298
 
 
299
 
 
300
public:
 
301
  Point();
 
302
  Point(int x, int y);
 
303
 
 
304
  void set_x(int x) { gobject_.x = x; }
 
305
  void set_y(int y) { gobject_.y = y; }
 
306
 
 
307
  int get_x() const { return gobject_.x; }
 
308
  int get_y() const { return gobject_.y; }
 
309
 
 
310
  bool equal(const Gdk::Point& rhs) const;
 
311
 
 
312
  /// Provides access to the underlying C GObject.  
 
313
  GdkPoint*       gobj()       { return &gobject_; }
 
314
  /// Provides access to the underlying C GObject.  
 
315
  const GdkPoint* gobj() const { return &gobject_; }
 
316
 
 
317
protected:
 
318
  GdkPoint gobject_;
 
319
 
 
320
 
 
321
};
 
322
 
 
323
/** @relates Gdk::Point */
 
324
inline bool operator==(const Point& lhs, const Point& rhs)
 
325
  { return lhs.equal(rhs); }
 
326
 
 
327
/** @relates Gdk::Point */
 
328
inline bool operator!=(const Point& lhs, const Point& rhs)
 
329
  { return !lhs.equal(rhs); }
 
330
 
 
331
 
 
332
struct AtomStringTraits
 
333
{
 
334
  typedef std::string CppType;
 
335
  typedef GdkAtom     CType;
 
336
  typedef GdkAtom     CTypeNonConst;
 
337
 
 
338
  static GdkAtom to_c_type(GdkAtom atom) { return atom; }
 
339
  static void    release_c_type(GdkAtom) {}
 
340
 
 
341
  // These aren't worth to be inlined since doing so
 
342
  // would expose way too much of the implementation.
 
343
  static GdkAtom     to_c_type  (const std::string& atom_name);
 
344
  static std::string to_cpp_type(GdkAtom atom);
 
345
};
 
346
 
 
347
// I'm typedef'ing this because when we call to_c_type or to_c_type,
 
348
// we don't want it to look like we're calling a template trait, but
 
349
// a utility function. -Bryan
 
350
typedef AtomStringTraits AtomString;
 
351
 
 
352
typedef Glib::ArrayHandle<std::string,AtomStringTraits> ArrayHandle_AtomString;
 
353
 
 
354
} // namespace Gdk
 
355
 
 
356
 
 
357
namespace Glib
 
358
{
 
359
 
 
360
/** @relates Gdk::Point */
 
361
Gdk::Point& wrap(GdkPoint* object);
 
362
 
 
363
/** @relates Gdk::Point */
 
364
const Gdk::Point& wrap(const GdkPoint* object);
 
365
 
 
366
} // namespace Glib
 
367
 
 
368
 
 
369
#endif /* _GDKMM_TYPES_H */
 
370