all repos — openbox @ fe55bb846db1933d8d6f023236298940cab441f8

openbox fork - make it a bit more like ryudo

python interface is working!
Dana Jansens danakj@orodu.net
commit

fe55bb846db1933d8d6f023236298940cab441f8

parent

fdd5338fc1b3d1651baefc20b297e6f0064e4dee

4 files changed, 35 insertions(+), 22 deletions(-)

jump to
M src/Makefile.amsrc/Makefile.am

@@ -29,7 +29,7 @@ openbox.i: openbox.hh screen.hh client.hh

touch openbox.i openbox_wrap.cc: openbox.i - swig -python -c++ -nodefault -module openbox -o openbox_wrap.cc openbox.i + swig -python -c++ -nodefault -o openbox_wrap.cc openbox.i # swig -guile -c++ -nodefault -o openbox_wrap.cc openbox.i # local dependencies
M src/openbox.isrc/openbox.i

@@ -12,17 +12,32 @@ #include "screen.hh"

#include "client.hh" %} -%immutable ob::Openbox::instance; +%include stl.i +//%include std_list.i +//%template(ClientList) std::list<OBClient*>; + + +%ignore ob::Openbox::instance; +%ignore ob::OBScreen::clients; %include "openbox.hh" %include "screen.hh" %include "client.hh" - -%include stl.i -%include std_list.i +%inline %{ + ob::Openbox *Openbox_instance() { return ob::Openbox::instance; } +%}; %{ -class OBClient; + #include <iterator> %} -%template(ClientList) std::list<OBClient*>; +%extend ob::OBScreen { + OBClient *client(int i) { + ob::OBScreen::ClientList::iterator it = self->clients.begin(); + std::advance(it,i); + return *it; + } + int clientCount() const { + return (int) self->clients.size(); + } +};
M src/screen.ccsrc/screen.cc

@@ -101,8 +101,8 @@ {

if (! _managed) return; // unmanage all windows - while (!_clients.empty()) - unmanageWindow(_clients.front()); + while (!clients.empty()) + unmanageWindow(clients.front()); delete _image_control; }

@@ -243,13 +243,13 @@ {

Window *windows; // create an array of the window ids - if (_clients.size() > 0) { + if (clients.size() > 0) { Window *win_it; - windows = new Window[_clients.size()]; + windows = new Window[clients.size()]; win_it = windows; - ClientList::const_iterator it = _clients.begin(); - const ClientList::const_iterator end = _clients.end(); + ClientList::const_iterator it = clients.begin(); + const ClientList::const_iterator end = clients.end(); for (; it != end; ++it, ++win_it) *win_it = (*it)->window(); } else

@@ -258,9 +258,9 @@

Openbox::instance->property()->set(_info->rootWindow(), otk::OBProperty::net_client_list, otk::OBProperty::Atom_Window, - windows, _clients.size()); + windows, clients.size()); - if (_clients.size()) + if (clients.size()) delete [] windows; setStackingList();

@@ -389,7 +389,7 @@

otk::OBDisplay::ungrab(); // add to the screen's list - _clients.push_back(client); + clients.push_back(client); // update the root properties setClientList(); }

@@ -432,7 +432,7 @@ delete client->frame;

client->frame = 0; // remove from the screen's list - _clients.remove(client); + clients.remove(client); delete client; // update the root properties
M src/screen.hhsrc/screen.hh

@@ -43,6 +43,9 @@ SubstructureRedirectMask |

ButtonPressMask | ButtonReleaseMask; + //! All managed clients on the screen + ClientList clients; + private: //! Was %Openbox able to manage the screen? bool _managed;

@@ -63,9 +66,6 @@ OBRootWindow _root;

//! Is the root colormap currently installed? bool _root_cmap_installed; - - //! All managed clients on the screen - ClientList _clients; //! Area usable for placement etc (total - struts) otk::Rect _area;

@@ -113,8 +113,6 @@ //! Returns the area of the screen not reserved by applications' Struts

inline const otk::Rect &area() const { return _area; } //! Returns the style in use on the screen inline const otk::Style *style() const { return &_style; } - - inline ClientList clients() { return _clients; } //! Adds a window's strut to the screen's list of reserved spaces void addStrut(otk::Strut *strut);