add new sigc++2 directory
[ardour.git] / libs / gtkmm2 / gdk / src / event.hg
1 /* $Id: event.hg,v 1.4 2006/04/12 11:11:24 murrayc Exp $ */
2
3 /* Copyright (C) 1998-2002 The gtkmm Development Team
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public
16  * License along with this library; if not, write to the Free
17  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18  */
19
20 _DEFS(gdkmm,gdk)
21 _CC_INCLUDE(gdk/gdkenumtypes.h)
22
23 #include <gdkmm/window.h>
24 #include <gdkmm/screen.h>
25
26 /* Shadow DELETE macro (from winnt.h).
27  */
28 #if defined(DELETE) && !defined(GTKMM_MACRO_SHADOW_DELETE)
29 enum { GTKMM_MACRO_DEFINITION_DELETE = DELETE };
30 #undef DELETE
31 enum { DELETE = GTKMM_MACRO_DEFINITION_DELETE };
32 #define DELETE DELETE
33 #define GTKMM_MACRO_SHADOW_DELETE 1
34 #endif
35
36 #ifndef DOXYGEN_SHOULD_SKIP_THIS
37 extern "C" { typedef union _GdkEvent GdkEvent; }
38 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
39
40
41 namespace Gdk
42 {
43
44 _WRAP_ENUM(EventType, GdkEventType,
45     s#^2BUTTON_PRESS#DOUBLE_BUTTON_PRESS#,
46     s#^3BUTTON_PRESS#TRIPLE_BUTTON_PRESS#
47 )
48
49 _WRAP_ENUM(ExtensionMode, GdkExtensionMode)
50 _WRAP_ENUM(AxisUse, GdkAxisUse)
51
52 //TODO: Actually use this class instead of GdkEvent?
53 class Event
54 {
55   _CLASS_BOXEDTYPE(Event, GdkEvent, NONE, gdk_event_copy, gdk_event_free)
56   _CUSTOM_STRUCT_PROTOTYPE
57   _IGNORE(gdk_event_copy, gdk_event_free)
58 public:
59
60   _WRAP_METHOD(static Event get(), gdk_event_get)
61   _WRAP_METHOD(static Event peek(), gdk_event_peek)
62   _WRAP_METHOD(static Event get_graphics_expose(const Glib::RefPtr<Window>& window), gdk_event_get_graphics_expose)
63   _WRAP_METHOD(void put(), gdk_event_put)
64
65   _WRAP_METHOD(static bool events_pending(), gdk_events_pending)
66
67   _WRAP_METHOD(guint32 get_time() const, gdk_event_get_time)
68   _WRAP_METHOD(bool get_state(ModifierType& state) const, gdk_event_get_state)
69   _WRAP_METHOD(bool get_coords(double& x_win, double& y_win) const, gdk_event_get_coords)
70   _WRAP_METHOD(bool get_root_coords(double& x_root, double& y_root) const, gdk_event_get_root_coords)
71   _WRAP_METHOD(bool get_axis(AxisUse axis_use, double& value) const, gdk_event_get_axis)
72   //_WRAP_METHOD(void   gdk_event_handler_set(GdkEventFunc func, gpointer data, GDestroyNotify  notify), gdk_event_handler_set)
73
74   _WRAP_METHOD(static void set_show_events(bool show_events), gdk_set_show_events)
75   _WRAP_METHOD(static bool get_show_events(), gdk_get_show_events)
76
77   _WRAP_METHOD(void set_screen(const Glib::RefPtr<Screen>& screen), gdk_event_set_screen)
78   _WRAP_METHOD(Glib::RefPtr<Screen> get_screen(), gdk_event_get_screen, refreturn)
79   _WRAP_METHOD(Glib::RefPtr<const Screen> get_screen() const, gdk_event_get_screen, refreturn, constversion)
80
81   _WRAP_METHOD(bool send_client_message(NativeWindow winid), gdk_event_send_client_message)
82   bool send_client_message(const Glib::RefPtr<Display>& display, NativeWindow winid);
83   _IGNORE(gdk_event_send_client_message_for_display)
84 };
85
86 } // namespace Gdk
87
88