all broken now. working on adding mouse binding support
[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 #include "python.hh"
14 %}
15
16
17 %include stl.i
18 //%include std_list.i
19 //%template(ClientList) std::list<OBClient*>;
20
21 %ignore ob::Openbox::instance;
22 %inline %{
23   ob::Openbox *Openbox_instance() { return ob::Openbox::instance; }
24 %};
25
26 // stuff for scripting callbacks!
27 %inline %{
28   enum ActionType {
29     Action_ButtonPress,
30     Action_ButtonRelease,
31     Action_Click,
32     Action_DoubleClick,
33     Action_EnterWindow,
34     Action_LeaveWindow,
35     Action_KeyPress,
36     Action_MouseMotion
37   };
38   enum WidgetType {
39     Type_Frame,
40     Type_Titlebar,
41     Type_Handle,
42     Type_Plate,
43     Type_Label,
44     Type_MaximizeButton,
45     Type_CloseButton,
46     Type_IconifyButton,
47     Type_StickyButton,
48     Type_LeftGrip,
49     Type_RightGrip,
50     Type_Client,
51     Type_Root
52   };
53 %}
54 %ignore ob::python_callback;
55 %rename(register) ob::python_register;
56 %rename(preregister) ob::python_preregister;
57 %rename(unregister) ob::python_unregister;
58 %rename(unregister_all) ob::python_unregister_all;
59 %rename(bind_key) ob::python_bind_key;
60 %rename(unbind_key) ob::python_unbind_key;
61 %rename(bind_mouse) ob::python_bind_mouse;
62 %rename(unbind_mouse) ob::python_unbind_mouse;
63 %rename(unbind_all) ob::python_unbind_all;
64
65 %ignore ob::OBScreen::clients;
66 %{
67   #include <iterator>
68 %}
69 %extend ob::OBScreen {
70   OBClient *client(int i) {
71     if (i >= (int)self->clients.size())
72       return NULL;
73     ob::OBScreen::ClientList::iterator it = self->clients.begin();
74     std::advance(it,i);
75     return *it;
76   }
77   int clientCount() const {
78     return (int) self->clients.size();
79   }
80 };
81
82 %import "../otk/eventdispatcher.hh"
83 %import "../otk/eventhandler.hh"
84 %import "widget.hh"
85
86 %include "openbox.hh"
87 %include "screen.hh"
88 %include "client.hh"
89 %include "python.hh"
90
91 // for Mod1Mask etc
92 %include "X11/X.h"