1
// Generated by gtkmmproc -- DO NOT MODIFY!
3
#include <gdkmm/device.h>
4
#include <gdkmm/private/device_p.h>
9
/* Copyright 2002 The gtkmm Development Team
11
* This library is free software; you can redistribute it and/or
12
* modify it under the terms of the GNU Library General Public
13
* License as published by the Free Software Foundation; either
14
* version 2 of the License, or (at your option) any later version.
16
* This library is distributed in the hope that it will be useful,
17
* but WITHOUT ANY WARRANTY; without even the implied warranty of
18
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19
* Library General Public License for more details.
21
* You should have received a copy of the GNU Library General Public
22
* License along with this library; if not, write to the Free
23
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26
#include <gdk/gdkinput.h>
37
} // anonymous namespace
40
GType Glib::Value<Gdk::InputMode>::value_type()
42
return gdk_input_mode_get_type();
46
GType Glib::Value<Gdk::InputSource>::value_type()
48
return gdk_input_source_get_type();
55
Glib::RefPtr<Gdk::Device> wrap(GdkDevice* object, bool take_copy)
57
return Glib::RefPtr<Gdk::Device>( dynamic_cast<Gdk::Device*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
58
//We use dynamic_cast<> in case of multiple inheritance.
61
} /* namespace Glib */
68
/* The *_Class implementation: */
70
const Glib::Class& Device_Class::init()
72
if(!gtype_) // create the GType if necessary
74
// Glib::Class has to know the class init function to clone custom types.
75
class_init_func_ = &Device_Class::class_init_function;
77
// This is actually just optimized away, apparently with no harm.
78
// Make sure that the parent type has been created.
79
//CppClassParent::CppObjectType::get_type();
81
// Create the wrapper type, with the same class/instance size as the base type.
82
register_derived_type(gdk_device_get_type());
84
// Add derived versions of interfaces, if the C type implements any interfaces:
90
void Device_Class::class_init_function(void* g_class, void* class_data)
92
BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
93
CppClassParent::class_init_function(klass, class_data);
98
Glib::ObjectBase* Device_Class::wrap_new(GObject* object)
100
return new Device((GdkDevice*)object);
104
/* The implementation: */
106
GdkDevice* Device::gobj_copy()
112
Device::Device(const Glib::ConstructParams& construct_params)
114
Glib::Object(construct_params)
117
Device::Device(GdkDevice* castitem)
119
Glib::Object((GObject*)(castitem))
126
Device::CppClassType Device::device_class_; // initialize static member
128
GType Device::get_type()
130
return device_class_.init().get_type();
133
GType Device::get_base_type()
135
return gdk_device_get_type();
141
Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc optimisations.
142
Glib::Object(Glib::ConstructParams(device_class_.init()))
146
void Device::set_source(InputSource source)
148
gdk_device_set_source(gobj(), ((GdkInputSource)(source)));
151
bool Device::set_mode(InputMode mode)
153
return gdk_device_set_mode(gobj(), ((GdkInputMode)(mode)));
156
void Device::set_key(guint index_, guint keyval, ModifierType modifiers)
158
gdk_device_set_key(gobj(), index_, keyval, ((GdkModifierType)(modifiers)));
161
void Device::set_axis_use(guint index_, AxisUse use)
163
gdk_device_set_axis_use(gobj(), index_, ((GdkAxisUse)(use)));
166
void Device::get_state(const Glib::RefPtr<Window>& window, double& axes, ModifierType& mask)
168
gdk_device_get_state(gobj(), Glib::unwrap(window), &(axes), ((GdkModifierType*) &(mask)));
171
bool Device::get_history(const Glib::RefPtr<Window>& window, guint32 start, guint32 stop, GdkTimeCoord**& events, int& n_events)
173
return gdk_device_get_history(gobj(), Glib::unwrap(window), start, stop, &(events), &n_events);
176
bool Device::get_axis(double& axes, AxisUse use, double& value) const
178
return gdk_device_get_axis(const_cast<GdkDevice*>(gobj()), &(axes), ((GdkAxisUse)(use)), &(value));
181
Glib::ustring Device::get_name() const
183
return Glib::convert_const_gchar_ptr_to_ustring(gobj()->name);
186
InputSource Device::get_source() const
188
return ((InputSource)(gobj()->source));
191
InputMode Device::get_mode() const
193
return ((InputMode)(gobj()->mode));
196
bool Device::get_has_cursor() const
198
return gobj()->has_cursor;