]>
Dogcows Code - chaz/openbox/blob - src/python.hh
7cec766712a9ac1376f9dff7b38400b3d0e65eb3
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"
85 int press_clientwidth
;
86 int press_clientheight
;
88 MouseData(int screen
, Client
*client
, Time time
, unsigned int state
,
89 unsigned int button
, MouseContext context
, MouseAction action
,
90 int xroot
, int yroot
, const otk::Point
&initpos
,
91 const otk::Rect
&initarea
) {
92 this->screen
= screen
;
93 this->client
= client
;
96 this->button
= button
;
97 this->context
= context
;
98 this->action
= action
;
101 this->pressx
= initpos
.x();
102 this->pressy
= initpos
.y();
103 this->press_clientx
= initarea
.x();
104 this->press_clienty
= initarea
.y();
105 this->press_clientwidth
= initarea
.width();
106 this->press_clientheight
= initarea
.height();
108 MouseData(int screen
, Client
*client
, Time time
, unsigned int state
,
109 unsigned int button
, MouseContext context
, MouseAction action
) {
110 this->screen
= screen
;
111 this->client
= client
;
114 this->button
= button
;
115 this->context
= context
;
116 this->action
= action
;
121 this->press_clientx
= 0;
122 this->press_clienty
= 0;
123 this->press_clientwidth
= 0;
124 this->press_clientheight
= 0;
135 EventData(int screen
, Client
*client
, EventAction action
,
136 unsigned int state
) {
137 this->screen
= screen
;
138 this->client
= client
;
139 this->action
= action
;
151 EventAction action
; // this is here so that all the Data structs have .action
153 KeyData(int screen
, Client
*client
, Time time
, unsigned int state
,
155 this->screen
= screen
;
156 this->client
= client
;
159 this->key
= XKeysymToString(XKeycodeToKeysym(**otk::display
,
161 this->action
= EventKey
;
167 void python_init(char *argv0
);
168 void python_destroy();
169 bool python_exec(const std::string
&path
);
171 bool python_get_long(const char *name
, long *value
);
172 bool python_get_string(const char *name
, otk::ustring
*value
);
173 bool python_get_stringlist(const char *name
, std::vector
<otk::ustring
> *value
);
175 /***********************************************
176 * These are found in openbox.i, not python.cc *
177 ***********************************************/
178 void python_callback(PyObject
*func
, MouseData
*data
);
179 void python_callback(PyObject
*func
, EventData
*data
);
180 void python_callback(PyObject
*func
, KeyData
*data
);
184 PyObject
*mbind(const std::string
&button
, ob::MouseContext context
,
185 ob::MouseAction action
, PyObject
*func
);
187 PyObject
*kbind(PyObject
*keylist
, ob::KeyContext context
, PyObject
*func
);
189 PyObject
*ebind(ob::EventAction action
, PyObject
*func
);
191 void set_reset_key(const std::string
&key
);
193 PyObject
*send_client_msg(Window target
, Atom type
, Window about
,
194 long data
, long data1
= 0, long data2
= 0,
195 long data3
= 0, long data4
= 0);
199 #endif // __python_hh
This page took 0.040637 seconds and 4 git commands to generate.