add new sigc++2 directory
[ardour.git] / libs / gtkmm2 / gdk / gdkmm / device.cc
1 // Generated by gtkmmproc -- DO NOT MODIFY!
2
3
4 #include <gdkmm/device.h>
5 #include <gdkmm/private/device_p.h>
6
7 // -*- c++ -*-
8 /* $Id$ */
9
10 /* Copyright 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 #include <gdk/gdkinput.h>
28
29 namespace Gdk
30 {
31
32
33 } // namespace Gdk
34
35
36 namespace
37 {
38 } // anonymous namespace
39
40 // static
41 GType Glib::Value<Gdk::InputMode>::value_type()
42 {
43   return gdk_input_mode_get_type();
44 }
45
46 // static
47 GType Glib::Value<Gdk::InputSource>::value_type()
48 {
49   return gdk_input_source_get_type();
50 }
51
52
53 namespace Glib
54 {
55
56 Glib::RefPtr<Gdk::Device> wrap(GdkDevice* object, bool take_copy)
57 {
58   return Glib::RefPtr<Gdk::Device>( dynamic_cast<Gdk::Device*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
59   //We use dynamic_cast<> in case of multiple inheritance.
60 }
61
62 } /* namespace Glib */
63
64
65 namespace Gdk
66 {
67
68
69 /* The *_Class implementation: */
70
71 const Glib::Class& Device_Class::init()
72 {
73   if(!gtype_) // create the GType if necessary
74   {
75     // Glib::Class has to know the class init function to clone custom types.
76     class_init_func_ = &Device_Class::class_init_function;
77
78     // This is actually just optimized away, apparently with no harm.
79     // Make sure that the parent type has been created.
80     //CppClassParent::CppObjectType::get_type();
81
82     // Create the wrapper type, with the same class/instance size as the base type.
83     register_derived_type(gdk_device_get_type());
84
85     // Add derived versions of interfaces, if the C type implements any interfaces:
86   }
87
88   return *this;
89 }
90
91 void Device_Class::class_init_function(void* g_class, void* class_data)
92 {
93   BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
94   CppClassParent::class_init_function(klass, class_data);
95
96 #ifdef GLIBMM_VFUNCS_ENABLED
97 #endif //GLIBMM_VFUNCS_ENABLED
98
99 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
100 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
101 }
102
103 #ifdef GLIBMM_VFUNCS_ENABLED
104 #endif //GLIBMM_VFUNCS_ENABLED
105
106 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
107 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
108
109
110 Glib::ObjectBase* Device_Class::wrap_new(GObject* object)
111 {
112   return new Device((GdkDevice*)object);
113 }
114
115
116 /* The implementation: */
117
118 GdkDevice* Device::gobj_copy()
119 {
120   reference();
121   return gobj();
122 }
123
124 Device::Device(const Glib::ConstructParams& construct_params)
125 :
126   Glib::Object(construct_params)
127 {}
128
129 Device::Device(GdkDevice* castitem)
130 :
131   Glib::Object((GObject*)(castitem))
132 {}
133
134 Device::~Device()
135 {}
136
137
138 Device::CppClassType Device::device_class_; // initialize static member
139
140 GType Device::get_type()
141 {
142   return device_class_.init().get_type();
143 }
144
145 GType Device::get_base_type()
146 {
147   return gdk_device_get_type();
148 }
149
150
151 Device::Device()
152 :
153   // Mark this class as non-derived to allow C++ vfuncs to be skipped.
154   Glib::ObjectBase(0),
155   Glib::Object(Glib::ConstructParams(device_class_.init()))
156 {
157   }
158
159 void Device::set_source(InputSource source)
160 {
161 gdk_device_set_source(gobj(), ((GdkInputSource)(source))); 
162 }
163
164 bool Device::set_mode(InputMode mode)
165 {
166   return gdk_device_set_mode(gobj(), ((GdkInputMode)(mode)));
167 }
168
169 void Device::set_key(guint index_, guint keyval, ModifierType modifiers)
170 {
171 gdk_device_set_key(gobj(), index_, keyval, ((GdkModifierType)(modifiers))); 
172 }
173
174 void Device::set_axis_use(guint index_, AxisUse use)
175 {
176 gdk_device_set_axis_use(gobj(), index_, ((GdkAxisUse)(use))); 
177 }
178
179 void Device::get_state(const Glib::RefPtr<Window>& window, double& axes, ModifierType& mask)
180 {
181 gdk_device_get_state(gobj(), Glib::unwrap(window), &(axes), ((GdkModifierType*) &(mask))); 
182 }
183
184 bool Device::get_history(const Glib::RefPtr<Window>& window, guint32 start, guint32 stop, GdkTimeCoord**& events, int& n_events)
185 {
186   return gdk_device_get_history(gobj(), Glib::unwrap(window), start, stop, &(events), &n_events);
187 }
188
189 bool Device::get_axis(double& axes, AxisUse use, double& value) const
190 {
191   return gdk_device_get_axis(const_cast<GdkDevice*>(gobj()), &(axes), ((GdkAxisUse)(use)), &(value));
192 }
193
194  Glib::ustring Device::get_name() const
195 {
196   return Glib::convert_const_gchar_ptr_to_ustring(gobj()->name);
197 }
198  
199  InputSource Device::get_source() const
200 {
201   return ((InputSource)(gobj()->source));
202 }
203  
204  InputMode Device::get_mode() const
205 {
206   return ((InputMode)(gobj()->mode));
207 }
208  
209  bool Device::get_has_cursor() const
210 {
211   return gobj()->has_cursor;
212 }
213  
214
215 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
216 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
217
218 #ifdef GLIBMM_VFUNCS_ENABLED
219 #endif //GLIBMM_VFUNCS_ENABLED
220
221
222 } // namespace Gdk
223
224