[gtkmm/gtkmm-2-22] gdkmm: Wrapped new Device and Display methods.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm/gtkmm-2-22] gdkmm: Wrapped new Device and Display methods.
- Date: Sun, 29 Aug 2010 21:26:44 +0000 (UTC)
commit c65f880998ff0897da3894d17f18fcd36e3b801c
Author: Murray Cumming <murrayc murrayc com>
Date: Mon Aug 2 16:30:50 2010 +0200
gdkmm: Wrapped new Device and Display methods.
* gdk/src/cursor.hg: Added get_cursor_type().
* gdk/src/device.[hg|ccg]: Added get_key(), get_axis_use(), get_n_axes().
* gdk/src/gdk_pixbuf_methods.defs: Regenerated with h2defs.py
* tools/m4/convert_gdk.m4: Added DeviceManager conversions.
* gtk/src/widget.hg: Added const version of get_accessible().
ChangeLog | 11 +++++++++++
gdk/src/cursor.hg | 2 ++
gdk/src/device.ccg | 2 ++
gdk/src/device.hg | 14 ++++++++------
gdk/src/display.ccg | 2 +-
gdk/src/gdk_methods.defs | 1 +
gdk/src/gdk_pixbuf_methods.defs | 24 ------------------------
gtk/src/widget.hg | 2 +-
tools/m4/convert_gdk.m4 | 8 ++++++++
9 files changed, 34 insertions(+), 32 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 0a12d56..0f79b61 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
2010-08-29 Murray Cumming <murrayc murrayc com>
+ gdkmm: Wrapped new Device and Display methods.
+
+ * gdk/src/cursor.hg: Added get_cursor_type().
+ * gdk/src/device.[hg|ccg]: Added get_key(), get_axis_use(), get_n_axes().
+ * gdk/src/filelist.am:
+ * gdk/src/gdk_pixbuf_methods.defs: Regenerated with h2defs.py
+ * tools/m4/convert_gdk.m4: Added DeviceManager conversions.
+ * gtk/src/widget.hg: Added const version of get_accessible().
+
+2010-08-29 Murray Cumming <murrayc murrayc com>
+
Regenerated function .defs files.
* gdk/src/gdk_methods.defs:
diff --git a/gdk/src/cursor.hg b/gdk/src/cursor.hg
index e21a458..88d36bc 100644
--- a/gdk/src/cursor.hg
+++ b/gdk/src/cursor.hg
@@ -54,6 +54,8 @@ public:
_WRAP_METHOD(Glib::RefPtr<Gdk::Pixbuf> get_image(), gdk_cursor_get_image)
_WRAP_METHOD(Glib::RefPtr<const Gdk::Pixbuf> get_image() const, gdk_cursor_get_image, constversion)
+
+ _WRAP_METHOD(CursorType get_cursor_type() const, gdk_cursor_get_cursor_type)
};
} //namespace Gdk
diff --git a/gdk/src/device.ccg b/gdk/src/device.ccg
index 985ca29..0107bb1 100644
--- a/gdk/src/device.ccg
+++ b/gdk/src/device.ccg
@@ -19,6 +19,8 @@
*/
#include <gdk/gdk.h>
+#include <gdkmm/cursor.h>
+#include <gdkmm/display.h>
namespace Gdk
{
diff --git a/gdk/src/device.hg b/gdk/src/device.hg
index ca41bb7..81201aa 100644
--- a/gdk/src/device.hg
+++ b/gdk/src/device.hg
@@ -20,6 +20,8 @@
#include <gdkmm/window.h>
#include <gdkmm/event.h>
+//#include <gdkmm/display.h>
+#include <gdk/gdk.h>
_DEFS(gdkmm,gdk)
_PINCLUDE(glibmm/private/object_p.h)
@@ -31,6 +33,8 @@ namespace Gdk
_WRAP_ENUM(InputMode, GdkInputMode)
_WRAP_ENUM(InputSource, GdkInputSource)
+class Display;
+
/** A Gdk::Device instance contains a detailed description of an extended input device.
*/
class Device : public Glib::Object
@@ -44,7 +48,9 @@ public:
_WRAP_METHOD(void set_source(InputSource source), gdk_device_set_source)
_WRAP_METHOD(bool set_mode(InputMode mode), gdk_device_set_mode)
+ _WRAP_METHOD(void 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)
_WRAP_METHOD(void set_axis_use(guint index_, AxisUse use), gdk_device_set_axis_use)
_WRAP_METHOD(void get_state(const Glib::RefPtr<Window>& window, double& axes, ModifierType& mask), gdk_device_get_state)
_WRAP_METHOD(bool get_history(const Glib::RefPtr<Window>& window, guint32 start, guint32 stop, GdkTimeCoord**& events, int& n_events), gdk_device_get_history)
@@ -55,12 +61,8 @@ public:
_WRAP_METHOD(InputMode get_mode() const, gdk_device_get_mode)
_WRAP_METHOD(bool get_has_cursor() const, gdk_device_get_has_cursor)
- //TODO: Add suitable accessor for the information in these fields. For now, people must use gobj() and access them directly.
- //gint num_axes the length of the axes array.
- //GdkDeviceAxis *axes an array of GdkDeviceAxis, describing the axes of this device.
- //
- //gint num_keys the length of the keys array.
- //GdkDeviceKey *keys an array of GdkDeviceKey, describing the mapped macro buttons of this device.
+ _WRAP_METHOD(gint 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)
};
} // namespace Gdk
diff --git a/gdk/src/display.ccg b/gdk/src/display.ccg
index 3e2e6da..598b335 100644
--- a/gdk/src/display.ccg
+++ b/gdk/src/display.ccg
@@ -52,7 +52,7 @@ void Display::selection_send_notify(GdkNativeWindow requestor, Glib::ustring& se
{
gdk_selection_send_notify_for_display(gobj(), requestor, Gdk::AtomString::to_c_type(selection), Gdk::AtomString::to_c_type(target), Gdk::AtomString::to_c_type(property), time_);
}
-
+
void Display::get_pointer(Glib::RefPtr<Screen>& screen, int& x, int& y, ModifierType& mask)
{
GdkScreen* cScreen = 0;
diff --git a/gdk/src/gdk_methods.defs b/gdk/src/gdk_methods.defs
index 16bc408..3aa2a69 100644
--- a/gdk/src/gdk_methods.defs
+++ b/gdk/src/gdk_methods.defs
@@ -7123,3 +7123,4 @@
)
+
diff --git a/gdk/src/gdk_pixbuf_methods.defs b/gdk/src/gdk_pixbuf_methods.defs
index c6b1c10..3e296ac 100644
--- a/gdk/src/gdk_pixbuf_methods.defs
+++ b/gdk/src/gdk_pixbuf_methods.defs
@@ -140,18 +140,6 @@
)
)
-(define-method ref
- (of-object "GdkPixbufAnimation")
- (c-name "gdk_pixbuf_animation_ref")
- (return-type "GdkPixbufAnimation*")
-)
-
-(define-method unref
- (of-object "GdkPixbufAnimation")
- (c-name "gdk_pixbuf_animation_unref")
- (return-type "none")
-)
-
(define-method get_width
(of-object "GdkPixbufAnimation")
(c-name "gdk_pixbuf_animation_get_width")
@@ -242,18 +230,6 @@
(return-type "GType")
)
-(define-method ref
- (of-object "GdkPixbuf")
- (c-name "gdk_pixbuf_ref")
- (return-type "GdkPixbuf*")
-)
-
-(define-method unref
- (of-object "GdkPixbuf")
- (c-name "gdk_pixbuf_unref")
- (return-type "none")
-)
-
(define-method get_colorspace
(of-object "GdkPixbuf")
(c-name "gdk_pixbuf_get_colorspace")
diff --git a/gtk/src/widget.hg b/gtk/src/widget.hg
index d2cf835..59a677e 100644
--- a/gtk/src/widget.hg
+++ b/gtk/src/widget.hg
@@ -344,8 +344,8 @@ public:
*/
Glib::RefPtr<Gdk::Pixmap> get_snapshot() const;
- //TODO: This probably needs a special conversion to do an extra ref (take_copy=true) for the returned instance:
_WRAP_METHOD(Glib::RefPtr<Atk::Object> get_accessible(), gtk_widget_get_accessible, refreturn, ifdef GTKMM_ATKMM_ENABLED)
+ _WRAP_METHOD(Glib::RefPtr<const Atk::Object> get_accessible() const, gtk_widget_get_accessible, refreturn, constversion, ifdef GTKMM_ATKMM_ENABLED)
_WRAP_METHOD(void set_colormap(const Glib::RefPtr<const Gdk::Colormap> &colormap), gtk_widget_set_colormap)
_WRAP_METHOD(Gdk::EventMask get_events() const, gtk_widget_get_events)
diff --git a/tools/m4/convert_gdk.m4 b/tools/m4/convert_gdk.m4
index 2b4df2a..1dc7d22 100644
--- a/tools/m4/convert_gdk.m4
+++ b/tools/m4/convert_gdk.m4
@@ -30,6 +30,7 @@ _CONV_ENUM(Gdk,ByteOrder)
_CONV_ENUM(Gdk,CapStyle)
_CONV_ENUM(Gdk,Colorspace)
_CONV_ENUM(Gdk,CursorType)
+_CONV_ENUM(Gdk,DeviceType)
_CONV_ENUM(Gdk,DragAction)
_CONV_ENUM(Gdk,DragProtocol)
_CONV_ENUM(Gdk,EventMask)
@@ -40,6 +41,7 @@ _CONV_ENUM(Gdk,FillRule)
_CONV_ENUM(Gdk,Function)
_CONV_ENUM(Gdk,GCValuesMask)
_CONV_ENUM(Gdk,Gravity)
+_CONV_ENUM(Gdk,GrabOwnership)
_CONV_ENUM(Gdk,ImageType)
_CONV_ENUM(Gdk,InputCondition)
_CONV_ENUM(Gdk,InputMode)
@@ -89,6 +91,7 @@ _CONVERSION(`GdkColor',`Gdk::Color', `Gdk::Color(const_cast<GdkColor*>(&($3)), t
_CONVERSION(`Color&',`GdkColor*',($3).gobj())
_CONVERSION(`const Gdk::Color&',`const GdkColor*',`($3).gobj()')
_CONVERSION(`const Color&',`const GdkColor*',`($3).gobj()')
+_CONVERSION(`const Cursor&',`GdkCursor*',const_cast<GdkCursor*>(($3).gobj()))
_CONVERSION(`Rectangle&',`GdkRectangle*',($3).gobj())
_CONVERSION(`Gdk::Rectangle&',`GdkRectangle*',($3).gobj())
_CONVERSION(`const Rectangle&',`const GdkRectangle*',($3).gobj())
@@ -130,7 +133,9 @@ _CONVERSION(`const Glib::RefPtr<Display>&',`GdkDisplay*',__CONVERT_REFPTR_TO_P)
_CONVERSION(`const Glib::RefPtr<Screen>&',`GdkScreen*',__CONVERT_REFPTR_TO_P)
_CONVERSION(`const Glib::RefPtr<Gdk::Display>&',`GdkDisplay*',__CONVERT_REFPTR_TO_P)
_CONVERSION(`const Glib::RefPtr<Gdk::Screen>&',`GdkScreen*',__CONVERT_REFPTR_TO_P)
+_CONVERSION(`const Glib::RefPtr<Screen>&',`GdkScreen*',__CONVERT_REFPTR_TO_P)
_CONVERSION(`const Glib::RefPtr<Gdk::Device>&',`GdkDevice*',__CONVERT_REFPTR_TO_P)
+_CONVERSION(`const Glib::RefPtr<Device>&',`GdkDevice*',__CONVERT_REFPTR_TO_P)
_CONVERSION(`const Glib::RefPtr<const Gdk::Screen>&',`GdkScreen*',__CONVERT_CONST_REFPTR_TO_P_SUN(Gdk::Screen))
define(`__CFR2P',`const_cast<$`'2>($`'3.gobj())')
@@ -217,6 +222,9 @@ _CONVERSION(`GdkDevice*',`Glib::RefPtr<Gdk::Device>', `Glib::wrap($3)')
_CONVERSION(`GdkDevice*',`Glib::RefPtr<const Device>', `Glib::wrap($3)')
_CONVERSION(`GdkDevice*',`Glib::RefPtr<const Gdk::Device>', `Glib::wrap($3)')
+_CONVERSION(`GdkDeviceManager*',`Glib::RefPtr<DeviceManager>', `Glib::wrap($3)')
+_CONVERSION(`GdkDeviceManager*',`Glib::RefPtr<const DeviceManager>', `Glib::wrap($3)')
+
_CONVERSION(`gpointer',`const void*', `($2)($3)')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]