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

« back to all changes in this revision

Viewing changes to libs/gtkmm2/gdk/gdkmm/event.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_EVENT_H
 
4
#define _GDKMM_EVENT_H
 
5
 
 
6
#include <glibmm.h>
 
7
 
 
8
/* $Id$ */
 
9
 
 
10
/* Copyright (C) 1998-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 <gdkmm/window.h>
 
29
#include <gdkmm/screen.h>
 
30
 
 
31
/* Shadow DELETE macro (from winnt.h).
 
32
 */
 
33
#if defined(DELETE) && !defined(GTKMM_MACRO_SHADOW_DELETE)
 
34
enum { GTKMM_MACRO_DEFINITION_DELETE = DELETE };
 
35
#undef DELETE
 
36
enum { DELETE = GTKMM_MACRO_DEFINITION_DELETE };
 
37
#define DELETE DELETE
 
38
#define GTKMM_MACRO_SHADOW_DELETE 1
 
39
#endif
 
40
 
 
41
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
42
extern "C" { typedef union _GdkEvent GdkEvent; }
 
43
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
44
 
 
45
 
 
46
namespace Gdk
 
47
{
 
48
 
 
49
/** @addtogroup gdkmmEnums Enums and Flags */
 
50
 
 
51
/**
 
52
 * @ingroup gdkmmEnums
 
53
 */
 
54
enum EventType
 
55
{
 
56
  NOTHING = -1,
 
57
  DELETE,
 
58
  DESTROY,
 
59
  EXPOSE,
 
60
  MOTION_NOTIFY,
 
61
  BUTTON_PRESS,
 
62
  DOUBLE_BUTTON_PRESS,
 
63
  TRIPLE_BUTTON_PRESS,
 
64
  BUTTON_RELEASE,
 
65
  KEY_PRESS,
 
66
  KEY_RELEASE,
 
67
  ENTER_NOTIFY,
 
68
  LEAVE_NOTIFY,
 
69
  FOCUS_CHANGE,
 
70
  CONFIGURE,
 
71
  MAP,
 
72
  UNMAP,
 
73
  PROPERTY_NOTIFY,
 
74
  SELECTION_CLEAR,
 
75
  SELECTION_REQUEST,
 
76
  SELECTION_NOTIFY,
 
77
  PROXIMITY_IN,
 
78
  PROXIMITY_OUT,
 
79
  DRAG_ENTER,
 
80
  DRAG_LEAVE,
 
81
  DRAG_MOTION,
 
82
  DRAG_STATUS,
 
83
  DROP_START,
 
84
  DROP_FINISHED,
 
85
  CLIENT_EVENT,
 
86
  VISIBILITY_NOTIFY,
 
87
  NO_EXPOSE,
 
88
  SCROLL,
 
89
  WINDOW_STATE,
 
90
  SETTING,
 
91
  OWNER_CHANGE
 
92
};
 
93
 
 
94
} // namespace Gdk
 
95
 
 
96
 
 
97
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
98
namespace Glib
 
99
{
 
100
 
 
101
template <>
 
102
class Value<Gdk::EventType> : public Glib::Value_Enum<Gdk::EventType>
 
103
{
 
104
public:
 
105
  static GType value_type() G_GNUC_CONST;
 
106
};
 
107
 
 
108
} // namespace Glib
 
109
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
110
 
 
111
 
 
112
namespace Gdk
 
113
{
 
114
 
 
115
 
 
116
/**
 
117
 * @ingroup gdkmmEnums
 
118
 */
 
119
enum ExtensionMode
 
120
{
 
121
  EXTENSION_EVENTS_NONE,
 
122
  EXTENSION_EVENTS_ALL,
 
123
  EXTENSION_EVENTS_CURSOR
 
124
};
 
125
 
 
126
} // namespace Gdk
 
127
 
 
128
 
 
129
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
130
namespace Glib
 
131
{
 
132
 
 
133
template <>
 
134
class Value<Gdk::ExtensionMode> : public Glib::Value_Enum<Gdk::ExtensionMode>
 
135
{
 
136
public:
 
137
  static GType value_type() G_GNUC_CONST;
 
138
};
 
139
 
 
140
} // namespace Glib
 
141
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
142
 
 
143
 
 
144
namespace Gdk
 
145
{
 
146
 
 
147
/**
 
148
 * @ingroup gdkmmEnums
 
149
 */
 
150
enum AxisUse
 
151
{
 
152
  AXIS_IGNORE,
 
153
  AXIS_X,
 
154
  AXIS_Y,
 
155
  AXIS_PRESSURE,
 
156
  AXIS_XTILT,
 
157
  AXIS_YTILT,
 
158
  AXIS_WHEEL,
 
159
  AXIS_LAST
 
160
};
 
161
 
 
162
} // namespace Gdk
 
163
 
 
164
 
 
165
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
166
namespace Glib
 
167
{
 
168
 
 
169
template <>
 
170
class Value<Gdk::AxisUse> : public Glib::Value_Enum<Gdk::AxisUse>
 
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
//TODO: Actually use this class instead of GdkEvent?
 
185
class Event
 
186
{
 
187
  public:
 
188
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
189
  typedef Event CppObjectType;
 
190
  typedef GdkEvent BaseObjectType;
 
191
 
 
192
  static GType get_type() G_GNUC_CONST;
 
193
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
194
 
 
195
  Event();
 
196
 
 
197
  explicit Event(GdkEvent* gobject, bool make_a_copy = true);
 
198
 
 
199
  Event(const Event& other);
 
200
  Event& operator=(const Event& other);
 
201
 
 
202
  ~Event();
 
203
 
 
204
  void swap(Event& other);
 
205
 
 
206
  ///Provides access to the underlying C instance.
 
207
  GdkEvent*       gobj()       { return gobject_; }
 
208
 
 
209
  ///Provides access to the underlying C instance.
 
210
  const GdkEvent* gobj() const { return gobject_; }
 
211
 
 
212
  ///Provides access to the underlying C instance. The caller is responsible for freeing it. Use when directly setting fields in structs.
 
213
  GdkEvent* gobj_copy() const;
 
214
 
 
215
protected:
 
216
  GdkEvent* gobject_;
 
217
 
 
218
private:
 
219
 
 
220
  
 
221
public:
 
222
 
 
223
  
 
224
  /** Checks all open displays for a Gdk::Event to process,to be processed
 
225
   * on, fetching events from the windowing system if necessary.
 
226
   * See Gdk::Display::get_event().
 
227
   * @return The next Gdk::Event to be processed, or <tt>0</tt> if no events
 
228
   * are pending. The returned Gdk::Event should be freed with gdk_event_free().
 
229
   */
 
230
  static Event get();
 
231
  
 
232
  /** If there is an event waiting in the event queue of some open
 
233
   * display, returns a copy of it. See Gdk::Display::peek_event().
 
234
   * @return A copy of the first Gdk::Event on some event queue, or <tt>0</tt> if no
 
235
   * events are in any queues. The returned Gdk::Event should be freed with
 
236
   * gdk_event_free().
 
237
   */
 
238
  static Event peek();
 
239
  
 
240
  /** Waits for a GraphicsExpose or NoExpose event from the X server.
 
241
   * This is used in the Gtk::Text and Gtk::CList widgets in GTK+ to make sure any
 
242
   * GraphicsExpose events are handled before the widget is scrolled.
 
243
   * @param window The Gdk::Window to wait for the events for.
 
244
   * @return A Gdk::EventExpose if a GraphicsExpose was received, or <tt>0</tt> if a
 
245
   * NoExpose event was received.
 
246
   */
 
247
  static Event get_graphics_expose(const Glib::RefPtr<Window>& window);
 
248
  
 
249
  /** Appends a copy of the given event onto the front of the event
 
250
   * queue for event->any.window's display, or the default event
 
251
   * queue if event->any.window is <tt>0</tt>. See Gdk::Display::put_event().
 
252
   */
 
253
  void put();
 
254
 
 
255
  
 
256
  /** Checks if any events are ready to be processed for any display.
 
257
   * @return <tt>true</tt> if any events are pending.
 
258
   */
 
259
  static bool events_pending();
 
260
 
 
261
  
 
262
  /** Returns the time stamp from @a event , if there is one; otherwise
 
263
   * returns Gdk::CURRENT_TIME. If @a event  is <tt>0</tt>, returns Gdk::CURRENT_TIME.
 
264
   * @return Time stamp field from @a event .
 
265
   */
 
266
  guint32 get_time() const;
 
267
  
 
268
  /** If the event contains a "state" field, puts that field in @a state . Otherwise
 
269
   * stores an empty state (0). Returns <tt>true</tt> if there was a state field
 
270
   * in the event. @a event  may be <tt>0</tt>, in which case it's treated
 
271
   * as if the event had no state field.
 
272
   * @param state Return location for state.
 
273
   * @return <tt>true</tt> if there was a state field in the event.
 
274
   */
 
275
  bool get_state(ModifierType& state) const;
 
276
  
 
277
  /** Extract the event window relative x/y coordinates from an event.
 
278
   * @param x_win Location to put event window x coordinate.
 
279
   * @param y_win Location to put event window y coordinate.
 
280
   * @return <tt>true</tt> if the event delivered event window coordinates.
 
281
   */
 
282
  bool get_coords(double& x_win, double& y_win) const;
 
283
  
 
284
  /** Extract the root window relative x/y coordinates from an event.
 
285
   * @param x_root Location to put root window x coordinate.
 
286
   * @param y_root Location to put root window y coordinate.
 
287
   * @return <tt>true</tt> if the event delivered root window coordinates.
 
288
   */
 
289
  bool get_root_coords(double& x_root, double& y_root) const;
 
290
  
 
291
  /** Extract the axis value for a particular axis use from
 
292
   * an event structure.
 
293
   * @param axis_use The axis use to look for.
 
294
   * @param value Location to store the value found.
 
295
   * @return <tt>true</tt> if the specified axis was found, otherwise <tt>false</tt>.
 
296
   */
 
297
  bool get_axis(AxisUse axis_use, double& value) const;
 
298
  //_WRAP_METHOD(void   gdk_event_handler_set(GdkEventFunc func, gpointer data, GDestroyNotify  notify), gdk_event_handler_set)
 
299
 
 
300
  
 
301
  /** Sets whether a trace of received events is output.
 
302
   * Note that GTK+ must be compiled with debugging (that is,
 
303
   * configured using the &lt;option&gt;--enable-debug&lt;/option&gt; option)
 
304
   * to use this option.
 
305
   * @param show_events <tt>true</tt> to output event debugging information.
 
306
   */
 
307
  static void set_show_events(bool show_events);
 
308
  
 
309
  /** Gets whether event debugging output is enabled.
 
310
   * @return <tt>true</tt> if event debugging output is enabled.
 
311
   */
 
312
  static bool get_show_events();
 
313
 
 
314
  
 
315
  /** Sets the screen for @a event  to @a screen . The event must
 
316
   * have been allocated by GTK+, for instance, by
 
317
   * gdk_event_copy().
 
318
   * 
 
319
   * Since: 2.2
 
320
   * @param screen A Gdk::Screen.
 
321
   */
 
322
  void set_screen(const Glib::RefPtr<Screen>& screen);
 
323
  
 
324
  /** Returns the screen for the event. The screen is
 
325
   * typically the screen for <tt>event->any.window</tt>, but
 
326
   * for events such as mouse events, it is the screen
 
327
   * where the the pointer was when the event occurs -
 
328
   * that is, the screen which has the root window 
 
329
   * to which <tt>event->motion.x_root</tt> and
 
330
   * <tt>event->motion.y_root</tt> are relative.
 
331
   * @return The screen for the event
 
332
   * 
 
333
   * Since: 2.2.
 
334
   */
 
335
  Glib::RefPtr<Screen> get_screen();
 
336
  
 
337
  /** Returns the screen for the event. The screen is
 
338
   * typically the screen for <tt>event->any.window</tt>, but
 
339
   * for events such as mouse events, it is the screen
 
340
   * where the the pointer was when the event occurs -
 
341
   * that is, the screen which has the root window 
 
342
   * to which <tt>event->motion.x_root</tt> and
 
343
   * <tt>event->motion.y_root</tt> are relative.
 
344
   * @return The screen for the event
 
345
   * 
 
346
   * Since: 2.2.
 
347
   */
 
348
  Glib::RefPtr<const Screen> get_screen() const;
 
349
 
 
350
  
 
351
  /** Sends an X ClientMessage event to a given window (which must be
 
352
   * on the default Gdk::Display.)
 
353
   * This could be used for communicating between different applications,
 
354
   * though the amount of data is limited to 20 bytes.
 
355
   * @param winid The window to send the X ClientMessage event to.
 
356
   * @return Non-zero on success.
 
357
   */
 
358
  bool send_client_message(NativeWindow winid);
 
359
  bool send_client_message(const Glib::RefPtr<Display>& display, NativeWindow winid);
 
360
  
 
361
 
 
362
};
 
363
 
 
364
} // namespace Gdk
 
365
 
 
366
 
 
367
namespace Gdk
 
368
{
 
369
 
 
370
/** @relates Gdk::Event
 
371
 * @param lhs The left-hand side
 
372
 * @param rhs The right-hand side
 
373
 */
 
374
inline void swap(Event& lhs, Event& rhs)
 
375
  { lhs.swap(rhs); }
 
376
 
 
377
} // namespace Gdk
 
378
 
 
379
namespace Glib
 
380
{
 
381
 
 
382
/** @relates Gdk::Event
 
383
 * @param object The C instance
 
384
 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
 
385
 * @result A C++ instance that wraps this C instance.
 
386
 */
 
387
Gdk::Event wrap(GdkEvent* object, bool take_copy = false);
 
388
 
 
389
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
390
template <>
 
391
class Value<Gdk::Event> : public Glib::Value_Boxed<Gdk::Event>
 
392
{};
 
393
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
394
 
 
395
} // namespace Glib
 
396
 
 
397
#endif /* _GDKMM_EVENT_H */
 
398