python interface is working!
[mikachu/openbox.git] / src / openbox.i
1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
2
3 %module openbox
4
5 %{
6 #ifdef HAVE_CONFIG_H
7 #  include "../config.h"
8 #endif
9
10 #include "openbox.hh"
11 #include "screen.hh"
12 #include "client.hh"
13 %}
14
15 %include stl.i
16 //%include std_list.i
17 //%template(ClientList) std::list<OBClient*>;
18
19
20 %ignore ob::Openbox::instance;
21 %ignore ob::OBScreen::clients;
22
23 %include "openbox.hh"
24 %include "screen.hh"
25 %include "client.hh"
26
27 %inline %{
28   ob::Openbox *Openbox_instance() { return ob::Openbox::instance; }
29 %};
30
31 %{
32   #include <iterator>
33 %}
34 %extend ob::OBScreen {
35   OBClient *client(int i) {
36     ob::OBScreen::ClientList::iterator it = self->clients.begin();
37     std::advance(it,i);
38     return *it;
39   }
40   int clientCount() const {
41     return (int) self->clients.size();
42   }
43 };