]>
Dogcows Code - chaz/openbox/blob - src/python.hh
1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
9 #include "otk/point.hh"
10 #include "otk/rect.hh"
11 #include "otk/property.hh"
12 #include "otk/display.hh"
13 #include "otk/ustring.hh"
40 #if ! (defined(DOXYGEN_IGNORE) || defined(SWIG))
52 #if ! (defined(DOXYGEN_IGNORE) || defined(SWIG))
62 #if ! (defined(DOXYGEN_IGNORE) || defined(SWIG))
72 #if ! (defined(DOXYGEN_IGNORE) || defined(SWIG))
80 EnterWindow
, //!< Occurs when the mouse enters a window
81 LeaveWindow
, //!< Occurs when the mouse leaves a window
82 //! Occurs while a window is being managed. The handler should call
83 //! Client::move to the window
85 //! Occurs while a window is being managed, just before the window is
88 Note that the window's state may not be completely stabilized by this
89 point. The NewWindow event should be used when possible.
92 //! Occurs when a window is finished being managed
94 //! Occurs when a window has been closed and is going to be unmanaged
96 //! Occurs when the window manager manages a screen
98 This event occurs on each managed screen during startup.
101 //! Occurs when the window manager unmanages a screen
103 This event occurs on each managed screen during shutdown.
106 //! Occurs when the input focus target changes
108 The data.client will be None of no client is focused.
111 //! Occurs when the system is fired through X.
113 The data.client will hold the client associated with the bell if
114 one has been specified, or None.
117 //! Occurs when a client toggles its urgent status.
119 The Client::urgent method can be used to get the status.
122 #if ! (defined(DOXYGEN_IGNORE) || defined(SWIG))
135 MouseContext::MC context
;
136 MouseAction::MA action
;
143 int press_clientwidth
;
144 int press_clientheight
;
146 MouseData(int screen
, Client
*client
, Time time
, unsigned int state
,
147 unsigned int button
, MouseContext::MC context
,
148 MouseAction::MA action
, int xroot
, int yroot
,
149 const otk::Point
&initpos
, const otk::Rect
&initarea
) {
150 this->screen
= screen
;
151 this->client
= client
;
154 this->button
= button
;
155 this->context
= context
;
156 this->action
= action
;
159 this->pressx
= initpos
.x();
160 this->pressy
= initpos
.y();
161 this->press_clientx
= initarea
.x();
162 this->press_clienty
= initarea
.y();
163 this->press_clientwidth
= initarea
.width();
164 this->press_clientheight
= initarea
.height();
166 MouseData(int screen
, Client
*client
, Time time
, unsigned int state
,
167 unsigned int button
, MouseContext::MC context
,
168 MouseAction::MA action
) {
169 this->screen
= screen
;
170 this->client
= client
;
173 this->button
= button
;
174 this->context
= context
;
175 this->action
= action
;
180 this->press_clientx
= 0;
181 this->press_clienty
= 0;
182 this->press_clientwidth
= 0;
183 this->press_clientheight
= 0;
192 EventAction::EA action
;
194 EventData(int screen
, Client
*client
, EventAction::EA action
,
195 unsigned int state
) {
196 this->screen
= screen
;
197 this->client
= client
;
198 this->action
= action
;
210 KeyAction::KA action
;
212 KeyData(int screen
, Client
*client
, Time time
, unsigned int state
,
213 unsigned int key
, KeyAction::KA action
) {
214 this->screen
= screen
;
215 this->client
= client
;
218 this->key
= XKeysymToString(XKeycodeToKeysym(**otk::display
,
220 this->action
= action
;
226 void python_init(char *argv0
);
227 void python_destroy();
228 bool python_exec(const std::string
&path
);
230 bool python_get_long(const char *name
, long *value
);
231 bool python_get_string(const char *name
, otk::ustring
*value
);
232 bool python_get_stringlist(const char *name
, std::vector
<otk::ustring
> *value
);
234 /***********************************************
235 * These are found in openbox.i, not python.cc *
236 ***********************************************/
237 void python_callback(PyObject
*func
, MouseData
*data
);
238 void python_callback(PyObject
*func
, EventData
*data
);
239 void python_callback(PyObject
*func
, KeyData
*data
);
243 PyObject
*mbind(const std::string
&button
, ob::MouseContext::MC context
,
244 ob::MouseAction::MA action
, PyObject
*func
);
246 PyObject
*kbind(PyObject
*keylist
, ob::KeyContext::KC context
, PyObject
*func
);
248 PyObject
*kgrab(int screen
, PyObject
*func
);
251 PyObject
*ebind(ob::EventAction::EA action
, PyObject
*func
);
253 void set_reset_key(const std::string
&key
);
255 PyObject
*send_client_msg(Window target
, Atom type
, Window about
,
256 long data
, long data1
= 0, long data2
= 0,
257 long data3
= 0, long data4
= 0);
260 void execute(const std::string
&bin
, int screen
=0);
265 #endif // __python_hh
This page took 0.048005 seconds and 4 git commands to generate.