]> Dogcows Code - chaz/openbox/blobdiff - wrap/ob_screen.i
rm the old code including the .pys and the c++ shit
[chaz/openbox] / wrap / ob_screen.i
index bbf7b57c02ba0d40190f73cfb38d098711bffb49..20ca98288d970f297819ad33a3818d040292bf9d 100644 (file)
 %}
 
 %include "ob_client.i"
-%include "otk.i" // XXX otk_rect.i!!!
-%include "ustring.i"
+%include "otk_rect.i"
+%include "otk_ustring.i"
+%include "otk_size.i"
+%include "std_vector.i"
+
+%typemap(python,out) const otk::Property::StringVect& {
+  otk::Property::StringVect *v = $1;
+  unsigned int s = v->size();
+  PyObject *l = PyList_New(s);
+
+  otk::Property::StringVect::const_iterator it = v->begin(), end = v->end();
+  for (unsigned int i = 0; i < s; ++i, ++it) {
+    PyObject *pdata = PyString_FromString(it->c_str());
+    PyList_SET_ITEM(l, i, pdata);
+  }
+  $result = l;
+}
 
 %typemap(python,out) std::list<ob::Client*> {
   unsigned int s = $1.size();
   $result = l;
 }
 
-%typemap(python,out) const otk::Property::StringVect& {
-  otk::Property::StringVect *v = $1;
+%typemap(python,out) const std::vector<otk::Rect>& {
+  std::vector<otk::Rect> *v = $1;
   unsigned int s = v->size();
   PyObject *l = PyList_New(s);
 
-  otk::Property::StringVect::const_iterator it = v->begin(), end = v->end();
+  std::vector<otk::Rect>::const_iterator it = v->begin(), end = v->end();
   for (unsigned int i = 0; i < s; ++i, ++it) {
-    PyObject *pdata = PyString_FromString(it->c_str());
+    PyObject *pdata = SWIG_NewPointerObj((void*)&(*it),SWIGTYPE_p_otk__Rect,0);
     PyList_SET_ITEM(l, i, pdata);
   }
   $result = l;
@@ -52,6 +67,18 @@ namespace ob {
     send_client_msg(root, otk::Property::atoms.net_current_desktop,
                     root, desktop);
   }
+
+  const otk::Size& size() {
+    return otk::display->screenInfo(self->number())->size();
+  }
+
+  const std::vector<otk::Rect> &xineramaAreas() {
+    return otk::display->screenInfo(self->number())->xineramaAreas();
+  }
+
+  Window rootWindow() {
+    return otk::display->screenInfo(self->number())->rootWindow();
+  }
 }
 
 %immutable Screen::clients;
@@ -61,7 +88,6 @@ namespace ob {
 %ignore Screen::~Screen();
 %ignore Screen::focuswindow() const;
 %ignore Screen::managed() const;
-%ignore Screen::config();
 %rename(ignored_showDesktop) Screen::showDesktop(bool show);
 %ignore Screen::ignored_showDesktop(bool show);
 %ignore Screen::updateStruts();
This page took 0.023344 seconds and 4 git commands to generate.