[gtkmm] Some minor GDK API additions.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm] Some minor GDK API additions.
- Date: Mon, 19 Sep 2011 08:08:03 +0000 (UTC)
commit c87a37f038f1e97b6cfc341f8cd6b4c498fb2e55
Author: Murray Cumming <murrayc murrayc com>
Date: Mon Sep 19 10:07:56 2011 +0200
Some minor GDK API additions.
* gdk/src/device.hg: Added get_n_keys() and list_slave_devices().
* gdk/src/pixbuf.hg: Added properties.
* gdk/src/window.[hg|ccg]: Added get_drag_protocol().
ChangeLog | 8 ++++++++
gdk/src/device.hg | 8 +++++---
gdk/src/pixbuf.hg | 9 +++++++++
gdk/src/window.ccg | 17 +++++++++++++++++
gdk/src/window.hg | 9 +++++++++
5 files changed, 48 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 952291d..6528df4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
2011-09-19 Murray Cumming <murrayc murrayc com>
+ Some minor GDK API additions.
+
+ * gdk/src/device.hg: Added get_n_keys() and list_slave_devices().
+ * gdk/src/pixbuf.hg: Added properties.
+ * gdk/src/window.[hg|ccg]: Added get_drag_protocol().
+
+2011-09-19 Murray Cumming <murrayc murrayc com>
+
Documentation: Do not show colloboration diagrams.
* docs/reference/Doxyfile.in: Do not show colloboration diagrams. We seem to
diff --git a/gdk/src/device.hg b/gdk/src/device.hg
index 982891f..e331464 100644
--- a/gdk/src/device.hg
+++ b/gdk/src/device.hg
@@ -60,6 +60,7 @@ public:
_WRAP_METHOD(InputSource get_source() const, gdk_device_get_source)
_WRAP_METHOD(InputMode get_mode() const, gdk_device_get_mode)
_WRAP_METHOD(bool set_mode(InputMode mode), gdk_device_set_mode)
+ _WRAP_METHOD(int get_n_keys() const, gdk_device_get_n_keys)
_WRAP_METHOD(bool get_key(guint index_, guint& keyval, ModifierType& modifiers) const, gdk_device_get_key)
_WRAP_METHOD(void set_key(guint index_, guint keyval, ModifierType modifiers), gdk_device_set_key)
_WRAP_METHOD(AxisUse get_axis_use(guint index_) const, gdk_device_get_axis_use)
@@ -69,9 +70,10 @@ public:
// TODO: docs.
std::vector<TimeCoord> get_history(const Glib::RefPtr<Window>& window, guint32 start, guint32 stop) const;
_IGNORE(gdk_device_get_history)
-//#m4 _CONVERSION(`GList*',`std::vector<Glib::RefPtr<Gdk::Device> >',`Glib::ListHandler<Glib::RefPtr<Gdk::Device> >::list_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
- //_WRAP_METHOD(std::vector<Glib::RefPtr<Gdk::Device> > list_slave_devices(), gdk_device_list_slave_devices)
- //_WRAP_METHOD(std::vector<Glib::RefPtr<const Gdk::Device> > list_slave_devices() const, gdk_device_list_slave_devices, constversion)
+
+#m4 _CONVERSION(`GList*',`std::vector<Glib::RefPtr<Gdk::Device> >',`Glib::ListHandler<Glib::RefPtr<Gdk::Device> >::list_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
+ _WRAP_METHOD(std::vector<Glib::RefPtr<Gdk::Device> > list_slave_devices(), gdk_device_list_slave_devices)
+ _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)
diff --git a/gdk/src/pixbuf.hg b/gdk/src/pixbuf.hg
index 56d00b0..eea4f62 100644
--- a/gdk/src/pixbuf.hg
+++ b/gdk/src/pixbuf.hg
@@ -454,6 +454,15 @@ gboolean gdk_pixbuf_save_to_callbackv (GdkPixbuf *pixbuf,
*/
static std::vector<PixbufFormat> get_formats();
_IGNORE(gdk_pixbuf_get_formats)
+
+ _WRAP_PROPERTY("colorspace", Colorspace)
+ _WRAP_PROPERTY("n-channels", int)
+ _WRAP_PROPERTY("has-alpha", bool)
+ _WRAP_PROPERTY("bits-per-sample", int)
+ _WRAP_PROPERTY("width", int)
+ _WRAP_PROPERTY("height", int)
+ _WRAP_PROPERTY("rowstride", int)
+ _WRAP_PROPERTY("pixels", void*)
};
} // namespace Gdk
diff --git a/gdk/src/window.ccg b/gdk/src/window.ccg
index 4c9f5b9..c0812c4 100644
--- a/gdk/src/window.ccg
+++ b/gdk/src/window.ccg
@@ -64,5 +64,22 @@ Glib::RefPtr<DragContext> Window::drag_begin (const std::vector<Glib::ustring>&
return Glib::wrap (gdk_drag_begin (gobj (), Glib::ListHandler<Glib::ustring, AtomUstringTraits>::vector_to_list(targets).data ()), true);
}
+DragProtocol Window::get_drag_protocol(Glib::RefPtr<Window>& target) const
+{
+ GdkWindow* window = 0;
+ GdkDragProtocol result = gdk_window_get_drag_protocol(
+ const_cast<GdkWindow*>(gobj())
+ &window);
+
+ target = Glib::wrap(window, true /* take ref */);
+ return result;
+}
+
+DragProtocol Window::get_drag_protocol() const
+{
+ return gdk_window_get_drag_protocol(
+ const_cast<GdkWindow*>(gobj())
+ 0);
+}
} // namespace Gdk
diff --git a/gdk/src/window.hg b/gdk/src/window.hg
index 8b65bdb..772a886 100644
--- a/gdk/src/window.hg
+++ b/gdk/src/window.hg
@@ -248,6 +248,15 @@ public:
_WRAP_METHOD(void maximize(), gdk_window_maximize)
_WRAP_METHOD(void unmaximize(), gdk_window_unmaximize)
_WRAP_METHOD(void register_dnd(), gdk_window_register_dnd)
+
+ _WRAP_DOCS_ONLY(gdk_window_get_drag_protocol)
+ DragProtocol get_drag_protocol(Glib::RefPtr<Window>& target) const;
+
+ //TODO: Documentation
+ DragProtocol get_drag_protocol() const;
+
+ _IGNORE(gdk_window_get_drag_protocol)
+
_WRAP_METHOD(void begin_resize_drag(WindowEdge edge, int button, int root_x, int root_y, guint32 timestamp), gdk_window_begin_resize_drag)
_WRAP_METHOD(void begin_move_drag(int button, int root_x, int root_y, guint32 timestamp), gdk_window_begin_move_drag)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]