]> Dogcows Code - chaz/openbox/blob - src/openbox.i
keybindings underway. dont work yet
[chaz/openbox] / 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) ob::python_bind;
60 %rename(unbind) ob::python_unbind;
61 %rename(unbind_all) ob::python_unbind_all;
62
63 %ignore ob::OBScreen::clients;
64 %{
65 #include <iterator>
66 %}
67 %extend ob::OBScreen {
68 OBClient *client(int i) {
69 if (i >= (int)self->clients.size())
70 return NULL;
71 ob::OBScreen::ClientList::iterator it = self->clients.begin();
72 std::advance(it,i);
73 return *it;
74 }
75 int clientCount() const {
76 return (int) self->clients.size();
77 }
78 };
79
80 %import "../otk/eventdispatcher.hh"
81 %import "../otk/eventhandler.hh"
82 %import "widget.hh"
83
84 %include "openbox.hh"
85 %include "screen.hh"
86 %include "client.hh"
87 %include "python.hh"
88
89 // for Mod1Mask etc
90 %include "X11/X.h"
This page took 0.039639 seconds and 4 git commands to generate.