]>
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"
68 // *** MotionData can be (and is) cast ButtonData!! (in actions.cc) *** //
84 int press_clientwidth
;
85 int press_clientheight
;
87 MotionData(int screen
, OBClient
*client
, Time time
, unsigned int state
,
88 unsigned int button
, MouseContext context
, MouseAction action
,
89 int xroot
, int yroot
, const otk::Point
&initpos
,
90 const otk::Rect
&initarea
) {
91 this->screen
= screen
;
92 this->client
= client
;
95 this->button
= button
;
96 this->context
= context
;
97 this->action
= action
;
100 this->pressx
= initpos
.x();
101 this->pressy
= initpos
.y();
102 this->press_clientx
= initarea
.x();
103 this->press_clienty
= initarea
.y();
104 this->press_clientwidth
= initarea
.width();
105 this->press_clientheight
= initarea
.height();
109 // *** MotionData can be (and is) cast ButtonData!! (in actions.cc) *** //
117 MouseContext context
;
120 ButtonData(int screen
, OBClient
*client
, Time time
, unsigned int state
,
121 unsigned int button
, MouseContext context
, MouseAction action
) {
122 this->screen
= screen
;
123 this->client
= client
;
126 this->button
= button
;
127 this->context
= context
;
128 this->action
= action
;
139 EventData(int screen
, OBClient
*client
, EventAction action
,
140 unsigned int state
) {
141 this->screen
= screen
;
142 this->client
= client
;
143 this->action
= action
;
156 KeyData(int screen
, OBClient
*client
, Time time
, unsigned int state
,
158 this->screen
= screen
;
159 this->client
= client
;
162 this->key
= XKeysymToString(XKeycodeToKeysym(otk::OBDisplay::display
,
169 void python_init(char *argv0
);
170 void python_destroy();
171 bool python_exec(const std::string
&path
);
173 bool python_get_long(const char *name
, long *value
);
174 bool python_get_string(const char *name
, std::string
*value
);
175 bool python_get_stringlist(const char *name
, std::vector
<std::string
> *value
);
177 /***********************************************
178 * These are found in openbox.i, not python.cc *
179 ***********************************************/
180 void python_callback(PyObject
*func
, MotionData
*data
);
181 void python_callback(PyObject
*func
, ButtonData
*data
);
182 void python_callback(PyObject
*func
, EventData
*data
);
183 void python_callback(PyObject
*func
, KeyData
*data
);
187 PyObject
*mbind(const std::string
&button
, ob::MouseContext context
,
188 ob::MouseAction action
, PyObject
*func
);
190 PyObject
*kbind(PyObject
*keylist
, ob::KeyContext context
, PyObject
*func
);
192 PyObject
*ebind(ob::EventAction action
, PyObject
*func
);
194 void set_reset_key(const std::string
&key
);
196 PyObject
*send_client_msg(Window target
, int type
, Window about
,
197 long data
, long data1
= 0, long data2
= 0,
198 long data3
= 0, long data4
= 0);
202 #endif // __python_hh
This page took 0.043538 seconds and 4 git commands to generate.