]>
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"
41 #ifndef DOXYGEN_IGNORE
54 #ifndef DOXYGEN_IGNORE
64 #ifndef DOXYGEN_IGNORE
74 #ifndef DOXYGEN_IGNORE
82 EnterWindow
, //!< Occurs when the mouse enters a window
83 LeaveWindow
, //!< Occurs when the mouse leaves a window
84 //! Occurs while a window is being managed. The handler should call
85 //! Client::move on the window
87 //! Occurs while a window is being managed, just before the window is
90 Note that the window's state may not be completely stabilized by this
91 point. The NewWindow event should be used when possible.
94 //! Occurs when a window is finished being managed
96 //! Occurs when a window has been closed and is going to be unmanaged
98 //! Occurs when the window manager manages a screen
100 This event occurs on each managed screen during startup.
103 //! Occurs when the window manager unmanages a screen
105 This event occurs on each managed screen during shutdown.
108 //! Occurs when the input focus target changes
110 The data.client will be None of no client is focused.
113 //! Occurs when the system is fired through X.
115 The data.client will hold the client associated with the bell if
116 one has been specified, or None.
119 //! Occurs when a client toggles its urgent status.
121 The Client::urgent method can be used to get the status.
124 #ifndef DOXYGEN_IGNORE
137 MouseContext::MC context
;
138 MouseAction::MA action
;
145 int press_clientwidth
;
146 int press_clientheight
;
148 MouseData(int screen
, Client
*client
, Time time
, unsigned int state
,
149 unsigned int button
, MouseContext::MC context
,
150 MouseAction::MA action
, int xroot
, int yroot
,
151 const otk::Point
&initpos
, const otk::Rect
&initarea
) {
152 this->screen
= screen
;
153 this->client
= client
;
156 this->button
= button
;
157 this->context
= context
;
158 this->action
= action
;
161 this->pressx
= initpos
.x();
162 this->pressy
= initpos
.y();
163 this->press_clientx
= initarea
.x();
164 this->press_clienty
= initarea
.y();
165 this->press_clientwidth
= initarea
.width();
166 this->press_clientheight
= initarea
.height();
168 MouseData(int screen
, Client
*client
, Time time
, unsigned int state
,
169 unsigned int button
, MouseContext::MC context
,
170 MouseAction::MA action
) {
171 this->screen
= screen
;
172 this->client
= client
;
175 this->button
= button
;
176 this->context
= context
;
177 this->action
= action
;
182 this->press_clientx
= 0;
183 this->press_clienty
= 0;
184 this->press_clientwidth
= 0;
185 this->press_clientheight
= 0;
194 EventAction::EA action
;
196 EventData(int screen
, Client
*client
, EventAction::EA action
,
197 unsigned int state
) {
198 this->screen
= screen
;
199 this->client
= client
;
200 this->action
= action
;
212 KeyAction::KA action
;
214 KeyData(int screen
, Client
*client
, Time time
, unsigned int state
,
215 unsigned int key
, KeyAction::KA action
) {
216 this->screen
= screen
;
217 this->client
= client
;
220 this->key
= XKeysymToString(XKeycodeToKeysym(**otk::display
,
222 this->action
= action
;
226 // The void*'s will be used to hold the native language's function pointer
227 typedef void (*MouseCallback
)(MouseData
*, void*);
228 typedef void (*KeyCallback
)(KeyData
*, void*);
229 typedef void (*EventCallback
)(EventData
*, void*);
231 void python_init(char *argv0
);
232 void python_destroy();
233 //! Returns 0 for success, 1 for failing to open the file, 2 for an exception
234 int python_exec(const std::string
&path
);
236 bool python_get_long(const char *name
, long *value
);
237 bool python_get_string(const char *name
, otk::ustring
*value
);
238 bool python_get_stringlist(const char *name
, std::vector
<otk::ustring
> *value
);
243 #endif // __python_hh
This page took 0.044179 seconds and 4 git commands to generate.