~ubuntu-branches/ubuntu/vivid/ardour/vivid-proposed

« back to all changes in this revision

Viewing changes to libs/gtkmm2/gdk/gdkmm/device.cc

  • Committer: Package Import Robot
  • Author(s): Felipe Sateler, Jaromír Mikeš, Felipe Sateler
  • Date: 2014-05-22 14:39:25 UTC
  • mfrom: (29 sid)
  • mto: This revision was merged to the branch mainline in revision 30.
  • Revision ID: package-import@ubuntu.com-20140522143925-vwqfo9287pmkrroe
Tags: 1:2.8.16+git20131003-3
* Team upload

[ Jaromír Mikeš ]
* Add -dbg package

[ Felipe Sateler ]
* Upload to experimental

Show diffs side-by-side

added added

removed removed

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