1 // Generated by gtkmmproc -- DO NOT MODIFY!
4 #include <gdkmm/device.h>
5 #include <gdkmm/private/device_p.h>
10 /* Copyright 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.
27 #include <gdk/gdkinput.h>
38 } // anonymous namespace
41 GType Glib::Value<Gdk::InputMode>::value_type()
43 return gdk_input_mode_get_type();
47 GType Glib::Value<Gdk::InputSource>::value_type()
49 return gdk_input_source_get_type();
56 Glib::RefPtr<Gdk::Device> wrap(GdkDevice* object, bool take_copy)
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.
62 } /* namespace Glib */
69 /* The *_Class implementation: */
71 const Glib::Class& Device_Class::init()
73 if(!gtype_) // create the GType if necessary
75 // Glib::Class has to know the class init function to clone custom types.
76 class_init_func_ = &Device_Class::class_init_function;
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();
82 // Create the wrapper type, with the same class/instance size as the base type.
83 register_derived_type(gdk_device_get_type());
85 // Add derived versions of interfaces, if the C type implements any interfaces:
91 void Device_Class::class_init_function(void* g_class, void* class_data)
93 BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
94 CppClassParent::class_init_function(klass, class_data);
96 #ifdef GLIBMM_VFUNCS_ENABLED
97 #endif //GLIBMM_VFUNCS_ENABLED
99 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
100 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
103 #ifdef GLIBMM_VFUNCS_ENABLED
104 #endif //GLIBMM_VFUNCS_ENABLED
106 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
107 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
110 Glib::ObjectBase* Device_Class::wrap_new(GObject* object)
112 return new Device((GdkDevice*)object);
116 /* The implementation: */
118 GdkDevice* Device::gobj_copy()
124 Device::Device(const Glib::ConstructParams& construct_params)
126 Glib::Object(construct_params)
129 Device::Device(GdkDevice* castitem)
131 Glib::Object((GObject*)(castitem))
138 Device::CppClassType Device::device_class_; // initialize static member
140 GType Device::get_type()
142 return device_class_.init().get_type();
145 GType Device::get_base_type()
147 return gdk_device_get_type();
153 // Mark this class as non-derived to allow C++ vfuncs to be skipped.
155 Glib::Object(Glib::ConstructParams(device_class_.init()))
159 void Device::set_source(InputSource source)
161 gdk_device_set_source(gobj(), ((GdkInputSource)(source)));
164 bool Device::set_mode(InputMode mode)
166 return gdk_device_set_mode(gobj(), ((GdkInputMode)(mode)));
169 void Device::set_key(guint index_, guint keyval, ModifierType modifiers)
171 gdk_device_set_key(gobj(), index_, keyval, ((GdkModifierType)(modifiers)));
174 void Device::set_axis_use(guint index_, AxisUse use)
176 gdk_device_set_axis_use(gobj(), index_, ((GdkAxisUse)(use)));
179 void Device::get_state(const Glib::RefPtr<Window>& window, double& axes, ModifierType& mask)
181 gdk_device_get_state(gobj(), Glib::unwrap(window), &(axes), ((GdkModifierType*) &(mask)));
184 bool Device::get_history(const Glib::RefPtr<Window>& window, guint32 start, guint32 stop, GdkTimeCoord**& events, int& n_events)
186 return gdk_device_get_history(gobj(), Glib::unwrap(window), start, stop, &(events), &n_events);
189 bool Device::get_axis(double& axes, AxisUse use, double& value) const
191 return gdk_device_get_axis(const_cast<GdkDevice*>(gobj()), &(axes), ((GdkAxisUse)(use)), &(value));
194 Glib::ustring Device::get_name() const
196 return Glib::convert_const_gchar_ptr_to_ustring(gobj()->name);
199 InputSource Device::get_source() const
201 return ((InputSource)(gobj()->source));
204 InputMode Device::get_mode() const
206 return ((InputMode)(gobj()->mode));
209 bool Device::get_has_cursor() const
211 return gobj()->has_cursor;
215 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
216 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
218 #ifdef GLIBMM_VFUNCS_ENABLED
219 #endif //GLIBMM_VFUNCS_ENABLED