]> icculus.org git repositories - mikachu/openbox.git/blob - wrap/ob.i
split the ob module into separate .i's
[mikachu/openbox.git] / wrap / ob.i
1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
2
3 %module ob
4
5 %{
6 #include <X11/Xlib.h>
7 #include "otk/display.hh"
8 void send_client_msg(Window target, Atom type, Window about,
9                      long data=0, long data1=0, long data2=0,
10                      long data3=0, long data4=0)
11 {
12   XEvent e;
13   e.xclient.type = ClientMessage;
14   e.xclient.format = 32;
15   e.xclient.message_type = type;
16   e.xclient.window = about;
17   e.xclient.data.l[0] = data;
18   e.xclient.data.l[1] = data1;
19   e.xclient.data.l[2] = data2;
20   e.xclient.data.l[3] = data3;
21   e.xclient.data.l[4] = data4;
22
23   XSendEvent(**otk::display, target, false,
24              SubstructureRedirectMask | SubstructureNotifyMask,
25              &e);
26 }
27
28 %}
29
30 %include "ob_openbox.i"
31 %include "ob_screen.i"
32 %include "ob_client.i"
33 %include "ob_frame.i"
34 %include "ob_python.i"
35 %include "callback.i"
36
37 %import "otk.i"
38 // for Window etc
39 %import "X11/X.h"
40
41 %inline %{
42 #include <string>
43
44 void set_reset_key(const std::string &key)
45 {
46   ob::openbox->bindings()->setResetKey(key);
47 }
48
49 void execute(const std::string &bin, int screen=0)
50 {
51   if (screen >= ScreenCount(**otk::display))
52     screen = 0;
53   otk::bexec(bin, otk::display->screenInfo(screen)->displayString());
54 }
55
56 %};
57
58 // globals
59 %pythoncode %{
60 openbox = cvar.openbox;
61 %}