]>
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
;
225 // The void*'s will be used to hold the native language's function pointer
226 typedef void (*MouseCallback
)(MouseData
*, void*);
227 typedef void (*KeyCallback
)(KeyData
*, void*);
228 typedef void (*EventCallback
)(EventData
*, void*);
232 void python_init(char *argv0
);
233 void python_destroy();
234 bool 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
);
245 #endif // __python_hh
This page took 0.045009 seconds and 4 git commands to generate.