]>
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"
91 int press_clientwidth
;
92 int press_clientheight
;
94 MouseData(int screen
, Client
*client
, Time time
, unsigned int state
,
95 unsigned int button
, MouseContext context
, MouseAction action
,
96 int xroot
, int yroot
, const otk::Point
&initpos
,
97 const otk::Rect
&initarea
) {
98 this->screen
= screen
;
99 this->client
= client
;
102 this->button
= button
;
103 this->context
= context
;
104 this->action
= action
;
107 this->pressx
= initpos
.x();
108 this->pressy
= initpos
.y();
109 this->press_clientx
= initarea
.x();
110 this->press_clienty
= initarea
.y();
111 this->press_clientwidth
= initarea
.width();
112 this->press_clientheight
= initarea
.height();
114 MouseData(int screen
, Client
*client
, Time time
, unsigned int state
,
115 unsigned int button
, MouseContext context
, MouseAction action
) {
116 this->screen
= screen
;
117 this->client
= client
;
120 this->button
= button
;
121 this->context
= context
;
122 this->action
= action
;
127 this->press_clientx
= 0;
128 this->press_clienty
= 0;
129 this->press_clientwidth
= 0;
130 this->press_clientheight
= 0;
141 EventData(int screen
, Client
*client
, EventAction action
,
142 unsigned int state
) {
143 this->screen
= screen
;
144 this->client
= client
;
145 this->action
= action
;
159 KeyData(int screen
, Client
*client
, Time time
, unsigned int state
,
160 unsigned int key
, KeyAction action
) {
161 this->screen
= screen
;
162 this->client
= client
;
165 this->key
= XKeysymToString(XKeycodeToKeysym(**otk::display
,
167 this->action
= action
;
173 void python_init(char *argv0
);
174 void python_destroy();
175 bool python_exec(const std::string
&path
);
177 bool python_get_long(const char *name
, long *value
);
178 bool python_get_string(const char *name
, otk::ustring
*value
);
179 bool python_get_stringlist(const char *name
, std::vector
<otk::ustring
> *value
);
181 /***********************************************
182 * These are found in openbox.i, not python.cc *
183 ***********************************************/
184 void python_callback(PyObject
*func
, MouseData
*data
);
185 void python_callback(PyObject
*func
, EventData
*data
);
186 void python_callback(PyObject
*func
, KeyData
*data
);
190 PyObject
*mbind(const std::string
&button
, ob::MouseContext context
,
191 ob::MouseAction action
, PyObject
*func
);
193 PyObject
*kbind(PyObject
*keylist
, ob::KeyContext context
, PyObject
*func
);
195 PyObject
*kgrab(PyObject
*func
);
198 PyObject
*ebind(ob::EventAction action
, PyObject
*func
);
200 void set_reset_key(const std::string
&key
);
202 PyObject
*send_client_msg(Window target
, Atom type
, Window about
,
203 long data
, long data1
= 0, long data2
= 0,
204 long data3
= 0, long data4
= 0);
208 #endif // __python_hh
This page took 0.045047 seconds and 4 git commands to generate.