[gtkmm] Gdk::Device: Add list_axes().
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm] Gdk::Device: Add list_axes().
- Date: Mon, 26 Mar 2012 08:14:02 +0000 (UTC)
commit d4c9120e26837fa51dd2460be355657f1883f1f1
Author: Murray Cumming <murrayc murrayc com>
Date: Sun Mar 25 23:22:04 2012 +0200
Gdk::Device: Add list_axes().
* gdk/src/device.[hg|ccg]: Wrap gdk_device_list_axes().
ChangeLog | 6 ++++++
gdk/src/device.ccg | 6 ++++++
gdk/src/device.hg | 7 ++++++-
3 files changed, 18 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 93ac140..3644698 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -19,6 +19,12 @@
2012-03-25 Murray Cumming <murrayc murrayc com>
+ Gdk::Device: Add list_axes().
+
+ * gdk/src/device.[hg|ccg]: Wrap gdk_device_list_axes().
+
+2012-03-25 Murray Cumming <murrayc murrayc com>
+
Gdk: Add AppLaunchContext.
* tools/extra_defs_gen/generate_defs_gtk.cc: Mention
diff --git a/gdk/src/device.ccg b/gdk/src/device.ccg
index 8fa9df3..deff9d2 100644
--- a/gdk/src/device.ccg
+++ b/gdk/src/device.ccg
@@ -67,5 +67,11 @@ GrabStatus Device::grab(const Glib::RefPtr<Window>& window, GrabOwnership grab_o
return static_cast<GrabStatus>(gdk_device_grab(gobj(), Glib::unwrap(window), static_cast<GdkGrabOwnership>(grab_ownership), static_cast<int>(owner_events), static_cast<GdkEventMask>(event_mask), 0, time_));
}
+std::vector<std::string> Device::list_axes() const
+{
+ GList* glist = gdk_device_list_axes(const_cast<GdkDevice*>(gobj()));
+ return Glib::ListHandler<std::string, AtomStringTraits>::list_to_vector(glist, Glib::OWNERSHIP_SHALLOW);
+}
+
} // namespace Gdk
diff --git a/gdk/src/device.hg b/gdk/src/device.hg
index 5ee2000..d0adc0a 100644
--- a/gdk/src/device.hg
+++ b/gdk/src/device.hg
@@ -76,7 +76,12 @@ public:
//TODO:_WRAP_METHOD(std::vector<Glib::RefPtr<const Gdk::Device> > list_slave_devices() const, gdk_device_list_slave_devices, constversion)
_WRAP_METHOD(int get_n_axes() const, gdk_device_get_n_axes)
- //TODO: A list of GdkAtom, which we should show as strings: _WRAP_METHOD(GList * gdk_device_list_axes () const, gdk_device_list_axes)
+
+ /** Returns the labels for the axes that the device currently has.
+ * @newin{3,4}
+ */
+ std::vector<std::string> list_axes() const;
+ _IGNORE(gdk_device_list_axes)
//TODO: Use a string instead of a GdkAtom:
_WRAP_METHOD(bool get_axis_value(double& axes, GdkAtom axis_label, double& value) const, gdk_device_get_axis_value )
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]