]>
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"
93 MouseContext::MC context
;
94 MouseAction::MA action
;
101 int press_clientwidth
;
102 int press_clientheight
;
104 MouseData(int screen
, Client
*client
, Time time
, unsigned int state
,
105 unsigned int button
, MouseContext::MC context
,
106 MouseAction::MA action
, int xroot
, int yroot
,
107 const otk::Point
&initpos
, const otk::Rect
&initarea
) {
108 this->screen
= screen
;
109 this->client
= client
;
112 this->button
= button
;
113 this->context
= context
;
114 this->action
= action
;
117 this->pressx
= initpos
.x();
118 this->pressy
= initpos
.y();
119 this->press_clientx
= initarea
.x();
120 this->press_clienty
= initarea
.y();
121 this->press_clientwidth
= initarea
.width();
122 this->press_clientheight
= initarea
.height();
124 MouseData(int screen
, Client
*client
, Time time
, unsigned int state
,
125 unsigned int button
, MouseContext::MC context
,
126 MouseAction::MA action
) {
127 this->screen
= screen
;
128 this->client
= client
;
131 this->button
= button
;
132 this->context
= context
;
133 this->action
= action
;
138 this->press_clientx
= 0;
139 this->press_clienty
= 0;
140 this->press_clientwidth
= 0;
141 this->press_clientheight
= 0;
150 EventAction::EA action
;
152 EventData(int screen
, Client
*client
, EventAction::EA action
,
153 unsigned int state
) {
154 this->screen
= screen
;
155 this->client
= client
;
156 this->action
= action
;
168 KeyAction::KA action
;
170 KeyData(int screen
, Client
*client
, Time time
, unsigned int state
,
171 unsigned int key
, KeyAction::KA action
) {
172 this->screen
= screen
;
173 this->client
= client
;
176 this->key
= XKeysymToString(XKeycodeToKeysym(**otk::display
,
178 this->action
= action
;
184 void python_init(char *argv0
);
185 void python_destroy();
186 bool python_exec(const std::string
&path
);
188 bool python_get_long(const char *name
, long *value
);
189 bool python_get_string(const char *name
, otk::ustring
*value
);
190 bool python_get_stringlist(const char *name
, std::vector
<otk::ustring
> *value
);
192 /***********************************************
193 * These are found in openbox.i, not python.cc *
194 ***********************************************/
195 void python_callback(PyObject
*func
, MouseData
*data
);
196 void python_callback(PyObject
*func
, EventData
*data
);
197 void python_callback(PyObject
*func
, KeyData
*data
);
201 PyObject
*mbind(const std::string
&button
, ob::MouseContext::MC context
,
202 ob::MouseAction::MA action
, PyObject
*func
);
204 PyObject
*kbind(PyObject
*keylist
, ob::KeyContext::KC context
, PyObject
*func
);
206 PyObject
*kgrab(int screen
, PyObject
*func
);
209 PyObject
*ebind(ob::EventAction::EA action
, PyObject
*func
);
211 void set_reset_key(const std::string
&key
);
213 PyObject
*send_client_msg(Window target
, Atom type
, Window about
,
214 long data
, long data1
= 0, long data2
= 0,
215 long data3
= 0, long data4
= 0);
218 void execute(const std::string
&bin
, int screen
=0);
223 #endif // __python_hh
This page took 0.043846 seconds and 4 git commands to generate.