]>
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"
86 int press_clientwidth
;
87 int press_clientheight
;
89 MouseData(int screen
, Client
*client
, Time time
, unsigned int state
,
90 unsigned int button
, MouseContext context
, MouseAction action
,
91 int xroot
, int yroot
, const otk::Point
&initpos
,
92 const otk::Rect
&initarea
) {
93 this->screen
= screen
;
94 this->client
= client
;
97 this->button
= button
;
98 this->context
= context
;
99 this->action
= action
;
102 this->pressx
= initpos
.x();
103 this->pressy
= initpos
.y();
104 this->press_clientx
= initarea
.x();
105 this->press_clienty
= initarea
.y();
106 this->press_clientwidth
= initarea
.width();
107 this->press_clientheight
= initarea
.height();
109 MouseData(int screen
, Client
*client
, Time time
, unsigned int state
,
110 unsigned int button
, MouseContext context
, MouseAction action
) {
111 this->screen
= screen
;
112 this->client
= client
;
115 this->button
= button
;
116 this->context
= context
;
117 this->action
= action
;
122 this->press_clientx
= 0;
123 this->press_clienty
= 0;
124 this->press_clientwidth
= 0;
125 this->press_clientheight
= 0;
136 EventData(int screen
, Client
*client
, EventAction action
,
137 unsigned int state
) {
138 this->screen
= screen
;
139 this->client
= client
;
140 this->action
= action
;
152 EventAction action
; // this is here so that all the Data structs have .action
154 KeyData(int screen
, Client
*client
, Time time
, unsigned int state
,
156 this->screen
= screen
;
157 this->client
= client
;
160 this->key
= XKeysymToString(XKeycodeToKeysym(**otk::display
,
162 this->action
= EventKey
;
168 void python_init(char *argv0
);
169 void python_destroy();
170 bool python_exec(const std::string
&path
);
172 bool python_get_long(const char *name
, long *value
);
173 bool python_get_string(const char *name
, otk::ustring
*value
);
174 bool python_get_stringlist(const char *name
, std::vector
<otk::ustring
> *value
);
176 /***********************************************
177 * These are found in openbox.i, not python.cc *
178 ***********************************************/
179 void python_callback(PyObject
*func
, MouseData
*data
);
180 void python_callback(PyObject
*func
, EventData
*data
);
181 void python_callback(PyObject
*func
, KeyData
*data
);
185 PyObject
*mbind(const std::string
&button
, ob::MouseContext context
,
186 ob::MouseAction action
, PyObject
*func
);
188 PyObject
*kbind(PyObject
*keylist
, ob::KeyContext context
, PyObject
*func
);
190 PyObject
*ebind(ob::EventAction action
, PyObject
*func
);
192 void set_reset_key(const std::string
&key
);
194 PyObject
*send_client_msg(Window target
, Atom type
, Window about
,
195 long data
, long data1
= 0, long data2
= 0,
196 long data3
= 0, long data4
= 0);
200 #endif // __python_hh
This page took 0.040123 seconds and 4 git commands to generate.