]> icculus.org git repositories - dana/openbox.git/blob - src/openbox.i
*** empty log message ***
[dana/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     if (i >= (int)self->clients.size())
41       return NULL;
42     ob::OBScreen::ClientList::iterator it = self->clients.begin();
43     std::advance(it,i);
44     return *it;
45   }
46   int clientCount() const {
47     return (int) self->clients.size();
48   }
49 };