diff options
| author | Dana Jansens <danakj@orodu.net> | 2003-02-17 15:42:31 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2003-02-17 15:42:31 +0000 |
| commit | c217a730901137252cde2d3a39b59c4ebd53e879 (patch) | |
| tree | 1ebc60ba7c20631fe48b6be734eb7f9c3895c98d /wrap/ob_screen.i | |
| parent | 0dd7ebcba90752d3ad832586f0c1745660078a03 (diff) | |
split the ob module into separate .i's
cleanly define the interface, add functions for modifying the objects (via client messages)
Diffstat (limited to 'wrap/ob_screen.i')
| -rw-r--r-- | wrap/ob_screen.i | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/wrap/ob_screen.i b/wrap/ob_screen.i new file mode 100644 index 00000000..bbf7b57c --- /dev/null +++ b/wrap/ob_screen.i @@ -0,0 +1,80 @@ +// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*- + +%module ob_screen + +%{ +#include "config.h" +#include "screen.hh" +#include "otk/display.hh" +#include "otk/property.hh" +%} + +%include "ob_client.i" +%include "otk.i" // XXX otk_rect.i!!! +%include "ustring.i" + +%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; +} + +%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; +} + +namespace ob { + +%extend Screen { + void showDesktop(bool show) { + Window root = RootWindow(**otk::display, self->number()); + send_client_msg(root, otk::Property::atoms.net_showing_desktop, + root, show); + } + + void changeDesktop(unsigned int desktop) { + Window root = RootWindow(**otk::display, self->number()); + send_client_msg(root, otk::Property::atoms.net_current_desktop, + root, desktop); + } +} + +%immutable Screen::clients; + +%ignore Screen::event_mask; +%ignore Screen::Screen(int); +%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(); +%ignore Screen::manageExisting(); +%ignore Screen::manageWindow(Window); +%ignore Screen::unmanageWindow(Client*); +%ignore Screen::raiseWindow(Client*); +%ignore Screen::lowerWindow(Client*); +%ignore Screen::installColormap(bool) const; +%ignore Screen::propertyHandler(const XPropertyEvent &); +%ignore Screen::clientMessageHandler(const XClientMessageEvent &); +%ignore Screen::mapRequestHandler(const XMapRequestEvent &); + +} + +%include "screen.hh" |
