]> icculus.org git repositories - mikachu/openbox.git/blob - src/openbox.i
global python scripts. client motion/resizing is all done via python now
[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(unregister) ob::python_unregister;
57
58 %ignore ob::OBScreen::clients;
59 %{
60   #include <iterator>
61 %}
62 %extend ob::OBScreen {
63   OBClient *client(int i) {
64     if (i >= (int)self->clients.size())
65       return NULL;
66     ob::OBScreen::ClientList::iterator it = self->clients.begin();
67     std::advance(it,i);
68     return *it;
69   }
70   int clientCount() const {
71     return (int) self->clients.size();
72   }
73 };
74
75 %import "../otk/eventdispatcher.hh"
76 %import "../otk/eventhandler.hh"
77 %import "widget.hh"
78
79 %include "openbox.hh"
80 %include "screen.hh"
81 %include "client.hh"
82 %include "python.hh"
83
84 // for Mod1Mask etc
85 %include "X11/X.h"