]> Dogcows Code - chaz/openbox/blobdiff - wrap/ob.i
add support for the openbox_restack_window message.
[chaz/openbox] / wrap / ob.i
index 0ba9a90e75be4a6da8ad2ecce6ac0d5ed72ab7c0..fa2d020e506fcd1ec0695eafba47a50d0421e70d 100644 (file)
--- a/wrap/ob.i
+++ b/wrap/ob.i
@@ -16,8 +16,6 @@
 %}
 
 %include "stl.i"
-//%include std_list.i
-//%template(ClientList) std::list<Client*>;
 %include "callback.i"
 
 %immutable ob::openbox;
 %};
 */
 
-%ignore ob::Screen::clients;
-%{
-  #include <iterator>
-%}
-%extend ob::Screen {
-  Client *client(int i) {
-    if (i < 0 || i >= (int)self->clients.size())
-      return NULL;
-    ob::Client::List::iterator it = self->clients.begin();
-    std::advance(it,i);
-    return *it;
-  }
-  int clientCount() const {
-    return (int) self->clients.size();
-  }
-};
+%typemap(python,out) std::list<ob::Client*> {
+  unsigned int s = $1.size();
+  PyObject *l = PyList_New(s);
+
+  std::list<ob::Client*>::const_iterator it = $1.begin(), end = $1.end();
+  for (unsigned int i = 0; i < s; ++i, ++it) {
+    PyObject *pdata = SWIG_NewPointerObj((void *) *it,
+                                         SWIGTYPE_p_ob__Client, 0);
+    PyList_SET_ITEM(l, i, pdata);
+ }
+  $result = l;
+}
+// do this through events
+%ignore ob::Screen::showDesktop(bool);
+
+%ignore ob::Screen::managed;
+%ignore ob::Screen::config;
 
 %import "otk.i"
 
This page took 0.023032 seconds and 4 git commands to generate.