]> Dogcows Code - chaz/openbox/blob - wrap/ob_client.i
focus new windows
[chaz/openbox] / wrap / ob_client.i
1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
2
3 %module ob_client
4
5 %{
6 #include "config.h"
7 #include "client.hh"
8 %}
9
10 %include "otk_size.i"
11 %include "otk_ustring.i"
12 %include "std_string.i"
13
14 namespace ob {
15
16 %immutable Client::frame;
17
18 %ignore Client::event_mask;
19 %ignore Client::no_propagate_mask;
20 %ignore Client::ignore_unmaps;
21 %ignore Client::Client(int, Window);
22 %ignore Client::~Client();
23 %ignore Client::icon(const otk::Size &) const;
24 %ignore Client::pixmapIcon() const;
25 %ignore Client::pixmapIconMask() const;
26 %ignore Client::showhide();
27 %ignore Client::focus();
28 %ignore Client::unfocus() const;
29 %ignore Client::validate() const;
30 %ignore Client::installColormap(bool) const;
31 %ignore Client::focusHandler(const XFocusChangeEvent &);
32 %ignore Client::unfocusHandler(const XFocusChangeEvent &);
33 %ignore Client::propertyHandler(const XPropertyEvent &);
34 %ignore Client::clientMessageHandler(const XClientMessageEvent &);
35 %ignore Client::configureRequestHandler(const XConfigureRequestEvent &);
36 %ignore Client::unmapHandler(const XUnmapEvent &);
37 %ignore Client::destroyHandler(const XDestroyWindowEvent &);
38 %ignore Client::reparentHandler(const XReparentEvent &);
39 %ignore Client::mapRequestHandler(const XMapRequestEvent &);
40 %ignore Client::shapeHandler(const XShapeEvent &);
41
42
43 %extend Client {
44 void focus(bool unshade = false, bool raise = false) {
45 Window root = otk::display->screenInfo(self->screen())->rootWindow();
46 send_client_msg(root, otk::Property::atoms.openbox_active_window,
47 self->window(), unshade ? 1 : 0, raise ? 1 : 0);
48 }
49
50 bool __cmp__(const Client *o) { return self->window() != o->window(); }
51
52 void raiseWindow() {
53 Window root = RootWindow(**otk::display, self->screen());
54 send_client_msg(root, otk::Property::atoms.openbox_restack_window,
55 self->window(), 0);
56 }
57 void lowerWindow() {
58 Window root = RootWindow(**otk::display, self->screen());
59 send_client_msg(root, otk::Property::atoms.openbox_restack_window,
60 self->window(), 1);
61 }
62
63 void setDesktop(unsigned int desktop) {
64 Window root = RootWindow(**otk::display, self->screen());
65 send_client_msg(root, otk::Property::atoms.net_wm_desktop,
66 self->window(), desktop);
67 }
68
69 void iconify(bool icon = true) {
70 Window root = RootWindow(**otk::display, self->screen());
71 send_client_msg(root, otk::Property::atoms.wm_change_state,
72 self->window(), icon ? IconicState : NormalState);
73 }
74
75 void close() {
76 Window root = RootWindow(**otk::display, self->screen());
77 send_client_msg(root, otk::Property::atoms.net_close_window,
78 self->window(), 0);
79 }
80
81 void shade(bool shade = true) {
82 Window root = RootWindow(**otk::display, self->screen());
83 send_client_msg(root, otk::Property::atoms.net_wm_state,
84 self->window(),
85 (shade ? otk::Property::atoms.net_wm_state_add :
86 otk::Property::atoms.net_wm_state_remove),
87 otk::Property::atoms.net_wm_state_shaded);
88 }
89
90 void maximize(bool max = true) {
91 Window root = RootWindow(**otk::display, self->screen());
92 send_client_msg(root, otk::Property::atoms.net_wm_state,
93 self->window(),
94 (max ? otk::Property::atoms.net_wm_state_add :
95 otk::Property::atoms.net_wm_state_remove),
96 otk::Property::atoms.net_wm_state_maximized_horz,
97 otk::Property::atoms.net_wm_state_maximized_vert);
98 }
99
100 void maximizeHorizontal(bool max = true) {
101 Window root = RootWindow(**otk::display, self->screen());
102 send_client_msg(root, otk::Property::atoms.net_wm_state,
103 self->window(),
104 (max ? otk::Property::atoms.net_wm_state_add :
105 otk::Property::atoms.net_wm_state_remove),
106 otk::Property::atoms.net_wm_state_maximized_horz);
107 }
108
109 void maximizeVertical(bool max = true) {
110 Window root = RootWindow(**otk::display, self->screen());
111 send_client_msg(root, otk::Property::atoms.net_wm_state,
112 self->window(),
113 (max ? otk::Property::atoms.net_wm_state_add :
114 otk::Property::atoms.net_wm_state_remove),
115 otk::Property::atoms.net_wm_state_maximized_vert);
116 }
117
118 void setSkipTaskbar(bool skip = true) {
119 Window root = RootWindow(**otk::display, self->screen());
120 send_client_msg(root, otk::Property::atoms.net_wm_state,
121 self->window(),
122 (skip ? otk::Property::atoms.net_wm_state_add :
123 otk::Property::atoms.net_wm_state_remove),
124 otk::Property::atoms.net_wm_state_skip_taskbar);
125 }
126
127 void setSkipPager(bool skip = true) {
128 Window root = RootWindow(**otk::display, self->screen());
129 send_client_msg(root, otk::Property::atoms.net_wm_state,
130 self->window(),
131 (skip ? otk::Property::atoms.net_wm_state_add :
132 otk::Property::atoms.net_wm_state_remove),
133 otk::Property::atoms.net_wm_state_skip_pager);
134 }
135
136 void setAbove(bool above = true) {
137 Window root = RootWindow(**otk::display, self->screen());
138 send_client_msg(root, otk::Property::atoms.net_wm_state,
139 self->window(),
140 (above ? otk::Property::atoms.net_wm_state_add :
141 otk::Property::atoms.net_wm_state_remove),
142 otk::Property::atoms.net_wm_state_above);
143 }
144
145 void setBelow(bool below = true) {
146 Window root = RootWindow(**otk::display, self->screen());
147 send_client_msg(root, otk::Property::atoms.net_wm_state,
148 self->window(),
149 (below ? otk::Property::atoms.net_wm_state_add :
150 otk::Property::atoms.net_wm_state_remove),
151 otk::Property::atoms.net_wm_state_below);
152 }
153 };
154
155 }
156
157 %import "../otk/eventhandler.hh"
158 %include "client.hh"
This page took 0.039637 seconds and 4 git commands to generate.