[pygtk] Bind nsview/nswindow attributes



commit be609e744ee47b117ced07f234262e4032658050
Author: Olivier Aubert <olivier aubert liris cnrs fr>
Date:   Fri Oct 15 09:26:24 2010 +1300

    Bind nsview/nswindow attributes

 gtk/gdk-base-types.defs |    2 ++
 gtk/gdk.override        |   28 ++++++++++++++++++++++++++++
 2 files changed, 30 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gdk-base-types.defs b/gtk/gdk-base-types.defs
index 5f39534..c77b2a1 100644
--- a/gtk/gdk-base-types.defs
+++ b/gtk/gdk-base-types.defs
@@ -71,6 +71,8 @@
   (fields
     '("guint32" "xid")
     '("gulong*" "handle")
+    '("gulong*" "nsview")
+    '("gulong*" "nswindow")
   )
 )
 
diff --git a/gtk/gdk.override b/gtk/gdk.override
index 0101546..d9db476 100644
--- a/gtk/gdk.override
+++ b/gtk/gdk.override
@@ -37,6 +37,8 @@ headers
 #include <gdk/gdkx.h>
 #elif defined(GDK_WINDOWING_WIN32)
 #include <gdk/gdkwin32.h>
+#elif defined(GDK_WINDOWING_QUARTZ)
+#include <gdk/gdkquartz.h>
 #endif
 
 /* make GDK_DISPLAY() the case macro */
@@ -885,6 +887,32 @@ _wrap_gdk_drawable__get_handle(PyGObject *self, void *closure)
 #endif
 }
 %%
+override-attr GdkDrawable.nsview
+static PyObject *
+_wrap_gdk_drawable__get_nsview(PyGObject *self, void *closure)
+{
+#if defined(GDK_WINDOWING_QUARTZ)
+    GdkDrawable *drawable = GDK_DRAWABLE(self->obj);
+    return PyLong_FromVoidPtr(gdk_quartz_window_get_nsview(drawable));
+#else
+    PyErr_SetString(PyExc_AttributeError, "nsview attribute not supported");
+    return NULL;
+#endif
+}
+%%
+override-attr GdkDrawable.nswindow
+static PyObject *
+_wrap_gdk_drawable__get_nswindow(PyGObject *self, void *closure)
+{
+#if defined(GDK_WINDOWING_QUARTZ)
+    GdkDrawable *drawable = GDK_DRAWABLE(self->obj);
+    return PyLong_FromVoidPtr(gdk_quartz_window_get_nswindow(drawable));
+#else
+    PyErr_SetString(PyExc_AttributeError, "nsview attribute not supported");
+    return NULL;
+#endif
+}
+%%
 override-attr GdkDrawable.xid
 static PyObject *
 _wrap_gdk_drawable__get_xid(PyGObject *self, void *closure)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]