2
// Generated by gtkmmproc -- DO NOT MODIFY!
10
/* Copyright (C) 1998-2002 The gtkmm Development Team
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.
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.
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.
28
#include <gdkmm/window.h>
29
#include <gdkmm/screen.h>
31
/* Shadow DELETE macro (from winnt.h).
33
#if defined(DELETE) && !defined(GTKMM_MACRO_SHADOW_DELETE)
34
enum { GTKMM_MACRO_DEFINITION_DELETE = DELETE };
36
enum { DELETE = GTKMM_MACRO_DEFINITION_DELETE };
38
#define GTKMM_MACRO_SHADOW_DELETE 1
41
#ifndef DOXYGEN_SHOULD_SKIP_THIS
42
extern "C" { typedef union _GdkEvent GdkEvent; }
43
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
49
/** @addtogroup gdkmmEnums Enums and Flags */
97
#ifndef DOXYGEN_SHOULD_SKIP_THIS
102
class Value<Gdk::EventType> : public Glib::Value_Enum<Gdk::EventType>
105
static GType value_type() G_GNUC_CONST;
109
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
117
* @ingroup gdkmmEnums
121
EXTENSION_EVENTS_NONE,
122
EXTENSION_EVENTS_ALL,
123
EXTENSION_EVENTS_CURSOR
129
#ifndef DOXYGEN_SHOULD_SKIP_THIS
134
class Value<Gdk::ExtensionMode> : public Glib::Value_Enum<Gdk::ExtensionMode>
137
static GType value_type() G_GNUC_CONST;
141
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
148
* @ingroup gdkmmEnums
165
#ifndef DOXYGEN_SHOULD_SKIP_THIS
170
class Value<Gdk::AxisUse> : public Glib::Value_Enum<Gdk::AxisUse>
173
static GType value_type() G_GNUC_CONST;
177
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
184
//TODO: Actually use this class instead of GdkEvent?
188
#ifndef DOXYGEN_SHOULD_SKIP_THIS
189
typedef Event CppObjectType;
190
typedef GdkEvent BaseObjectType;
192
static GType get_type() G_GNUC_CONST;
193
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
197
explicit Event(GdkEvent* gobject, bool make_a_copy = true);
199
Event(const Event& other);
200
Event& operator=(const Event& other);
204
void swap(Event& other);
206
///Provides access to the underlying C instance.
207
GdkEvent* gobj() { return gobject_; }
209
///Provides access to the underlying C instance.
210
const GdkEvent* gobj() const { return gobject_; }
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;
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().
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
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.
247
static Event get_graphics_expose(const Glib::RefPtr<Window>& window);
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().
256
/** Checks if any events are ready to be processed for any display.
257
* @return <tt>true</tt> if any events are pending.
259
static bool events_pending();
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 .
266
guint32 get_time() const;
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.
275
bool get_state(ModifierType& state) const;
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.
282
bool get_coords(double& x_win, double& y_win) const;
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.
289
bool get_root_coords(double& x_root, double& y_root) const;
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>.
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)
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 <option>--enable-debug</option> option)
304
* to use this option.
305
* @param show_events <tt>true</tt> to output event debugging information.
307
static void set_show_events(bool show_events);
309
/** Gets whether event debugging output is enabled.
310
* @return <tt>true</tt> if event debugging output is enabled.
312
static bool get_show_events();
315
/** Sets the screen for @a event to @a screen . The event must
316
* have been allocated by GTK+, for instance, by
320
* @param screen A Gdk::Screen.
322
void set_screen(const Glib::RefPtr<Screen>& screen);
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
335
Glib::RefPtr<Screen> get_screen();
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
348
Glib::RefPtr<const Screen> get_screen() const;
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.
358
bool send_client_message(NativeWindow winid);
359
bool send_client_message(const Glib::RefPtr<Display>& display, NativeWindow winid);
370
/** @relates Gdk::Event
371
* @param lhs The left-hand side
372
* @param rhs The right-hand side
374
inline void swap(Event& lhs, Event& rhs)
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.
387
Gdk::Event wrap(GdkEvent* object, bool take_copy = false);
389
#ifndef DOXYGEN_SHOULD_SKIP_THIS
391
class Value<Gdk::Event> : public Glib::Value_Boxed<Gdk::Event>
393
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
397
#endif /* _GDKMM_EVENT_H */