]> Dogcows Code - chaz/openbox/blob - wrap/ob.i
change the default titlebar layout
[chaz/openbox] / wrap / ob.i
1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
2
3 %module ob
4
5 %{
6 #include "config.h"
7
8 #include "frame.hh"
9 #include "openbox.hh"
10 #include "screen.hh"
11 #include "client.hh"
12 #include "bindings.hh"
13 #include "actions.hh"
14 #include "python.hh"
15 #include "otk/otk.hh"
16 %}
17
18 %include "stl.i"
19 //%include std_list.i
20 //%template(ClientList) std::list<Client*>;
21 %include "callback.i"
22
23 %immutable ob::openbox;
24 /*
25 %ignore ob::openbox;
26 %inline %{
27 ob::Openbox *Openbox_instance() { return ob::openbox; }
28 %};
29 */
30
31 %ignore ob::Screen::clients;
32 %{
33 #include <iterator>
34 %}
35 %extend ob::Screen {
36 Client *client(int i) {
37 if (i < 0 || i >= (int)self->clients.size())
38 return NULL;
39 ob::Client::List::iterator it = self->clients.begin();
40 std::advance(it,i);
41 return *it;
42 }
43 int clientCount() const {
44 return (int) self->clients.size();
45 }
46 };
47
48 // do this through events
49 %ignore ob::Screen::showDesktop(bool);
50
51 %ignore ob::Screen::managed;
52 %ignore ob::Screen::config;
53
54 %import "otk.i"
55
56 %import "actions.hh"
57
58 %include "openbox.hh"
59 %include "screen.hh"
60 %include "client.hh"
61 %include "frame.hh"
62 %include "python.hh"
63
64 // for Window etc
65 %import "X11/X.h"
66
67 %inline %{
68 void set_reset_key(const std::string &key)
69 {
70 ob::openbox->bindings()->setResetKey(key);
71 }
72
73 void send_client_msg(Window target, Atom type, Window about,
74 long data=0, long data1=0, long data2=0,
75 long data3=0, long data4=0)
76 {
77 XEvent e;
78 e.xclient.type = ClientMessage;
79 e.xclient.format = 32;
80 e.xclient.message_type = type;
81 e.xclient.window = about;
82 e.xclient.data.l[0] = data;
83 e.xclient.data.l[1] = data1;
84 e.xclient.data.l[2] = data2;
85 e.xclient.data.l[3] = data3;
86 e.xclient.data.l[4] = data4;
87
88 XSendEvent(**otk::display, target, false,
89 SubstructureRedirectMask | SubstructureNotifyMask,
90 &e);
91 }
92
93 void execute(const std::string &bin, int screen=0)
94 {
95 if (screen >= ScreenCount(**otk::display))
96 screen = 0;
97 otk::bexec(bin, otk::display->screenInfo(screen)->displayString());
98 }
99
100 %};
101
102 // globals
103 %pythoncode %{
104 openbox = cvar.openbox;
105 %}
This page took 0.043334 seconds and 4 git commands to generate.