python. no more guile. python.
[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 %import "../otk/eventdispatcher.hh"
24 %import "../otk/eventhandler.hh"
25 %import "widget.hh"
26
27 %include "openbox.hh"
28 %include "screen.hh"
29 %include "client.hh"
30
31 %inline %{
32   ob::Openbox *Openbox_instance() { return ob::Openbox::instance; }
33 %};
34
35 %{
36   #include <iterator>
37 %}
38 %extend ob::OBScreen {
39   OBClient *client(int i) {
40     ob::OBScreen::ClientList::iterator it = self->clients.begin();
41     std::advance(it,i);
42     return *it;
43   }
44   int clientCount() const {
45     return (int) self->clients.size();
46   }
47 };