]>
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))
53 #if ! (defined(DOXYGEN_IGNORE) || defined(SWIG))
63 #if ! (defined(DOXYGEN_IGNORE) || defined(SWIG))
73 #if ! (defined(DOXYGEN_IGNORE) || defined(SWIG))
81 EnterWindow
, //!< Occurs when the mouse enters a window
82 LeaveWindow
, //!< Occurs when the mouse leaves a window
83 //! Occurs while a window is being managed. The handler should call
84 //! Client::move on the window
86 //! Occurs while a window is being managed, just before the window is
89 Note that the window's state may not be completely stabilized by this
90 point. The NewWindow event should be used when possible.
93 //! Occurs when a window is finished being managed
95 //! Occurs when a window has been closed and is going to be unmanaged
97 //! Occurs when the window manager manages a screen
99 This event occurs on each managed screen during startup.
102 //! Occurs when the window manager unmanages a screen
104 This event occurs on each managed screen during shutdown.
107 //! Occurs when the input focus target changes
109 The data.client will be None of no client is focused.
112 //! Occurs when the system is fired through X.
114 The data.client will hold the client associated with the bell if
115 one has been specified, or None.
118 //! Occurs when a client toggles its urgent status.
120 The Client::urgent method can be used to get the status.
123 #if ! (defined(DOXYGEN_IGNORE) || defined(SWIG))
136 MouseContext::MC context
;
137 MouseAction::MA action
;
144 int press_clientwidth
;
145 int press_clientheight
;
147 MouseData(int screen
, Client
*client
, Time time
, unsigned int state
,
148 unsigned int button
, MouseContext::MC context
,
149 MouseAction::MA action
, int xroot
, int yroot
,
150 const otk::Point
&initpos
, const otk::Rect
&initarea
) {
151 this->screen
= screen
;
152 this->client
= client
;
155 this->button
= button
;
156 this->context
= context
;
157 this->action
= action
;
160 this->pressx
= initpos
.x();
161 this->pressy
= initpos
.y();
162 this->press_clientx
= initarea
.x();
163 this->press_clienty
= initarea
.y();
164 this->press_clientwidth
= initarea
.width();
165 this->press_clientheight
= initarea
.height();
167 MouseData(int screen
, Client
*client
, Time time
, unsigned int state
,
168 unsigned int button
, MouseContext::MC context
,
169 MouseAction::MA action
) {
170 this->screen
= screen
;
171 this->client
= client
;
174 this->button
= button
;
175 this->context
= context
;
176 this->action
= action
;
181 this->press_clientx
= 0;
182 this->press_clienty
= 0;
183 this->press_clientwidth
= 0;
184 this->press_clientheight
= 0;
193 EventAction::EA action
;
195 EventData(int screen
, Client
*client
, EventAction::EA action
,
196 unsigned int state
) {
197 this->screen
= screen
;
198 this->client
= client
;
199 this->action
= action
;
211 KeyAction::KA action
;
213 KeyData(int screen
, Client
*client
, Time time
, unsigned int state
,
214 unsigned int key
, KeyAction::KA action
) {
215 this->screen
= screen
;
216 this->client
= client
;
219 this->key
= XKeysymToString(XKeycodeToKeysym(**otk::display
,
221 this->action
= action
;
227 void python_init(char *argv0
);
228 void python_destroy();
229 bool python_exec(const std::string
&path
);
231 bool python_get_long(const char *name
, long *value
);
232 bool python_get_string(const char *name
, otk::ustring
*value
);
233 bool python_get_stringlist(const char *name
, std::vector
<otk::ustring
> *value
);
235 /***********************************************
236 * These are found in openbox.i, not python.cc *
237 ***********************************************/
238 void python_callback(PyObject
*func
, MouseData
*data
);
239 void python_callback(PyObject
*func
, EventData
*data
);
240 void python_callback(PyObject
*func
, KeyData
*data
);
244 PyObject
*mbind(const std::string
&button
, ob::MouseContext::MC context
,
245 ob::MouseAction::MA action
, PyObject
*func
);
247 PyObject
*kbind(PyObject
*keylist
, ob::KeyContext::KC context
, PyObject
*func
);
249 PyObject
*kgrab(int screen
, PyObject
*func
);
252 PyObject
*mgrab(int screen
);
255 PyObject
*ebind(ob::EventAction::EA action
, PyObject
*func
);
257 void set_reset_key(const std::string
&key
);
259 PyObject
*send_client_msg(Window target
, Atom type
, Window about
,
260 long data
, long data1
= 0, long data2
= 0,
261 long data3
= 0, long data4
= 0);
264 void execute(const std::string
&bin
, int screen
=0);
269 #endif // __python_hh
This page took 0.047039 seconds and 4 git commands to generate.