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"
84 int press_clientwidth;
85 int press_clientheight;
87 MouseData(int screen, Client *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();
107 MouseData(int screen, Client *client, Time time, unsigned int state,
108 unsigned int button, MouseContext context, MouseAction action) {
109 this->screen = screen;
110 this->client = client;
113 this->button = button;
114 this->context= context;
115 this->action = action;
120 this->press_clientx = 0;
121 this->press_clienty = 0;
122 this->press_clientwidth = 0;
123 this->press_clientheight = 0;
134 EventData(int screen, Client *client, EventAction action,
135 unsigned int state) {
136 this->screen = screen;
137 this->client = client;
138 this->action = action;
151 KeyData(int screen, Client *client, Time time, unsigned int state,
153 this->screen = screen;
154 this->client = client;
157 this->key = XKeysymToString(XKeycodeToKeysym(otk::Display::display,
164 void python_init(char *argv0);
165 void python_destroy();
166 bool python_exec(const std::string &path);
168 bool python_get_long(const char *name, long *value);
169 bool python_get_string(const char *name, otk::ustring *value);
170 bool python_get_stringlist(const char *name, std::vector<otk::ustring> *value);
172 /***********************************************
173 * These are found in openbox.i, not python.cc *
174 ***********************************************/
175 void python_callback(PyObject *func, MouseData *data);
176 void python_callback(PyObject *func, EventData *data);
177 void python_callback(PyObject *func, KeyData *data);
181 PyObject *mbind(const std::string &button, ob::MouseContext context,
182 ob::MouseAction action, PyObject *func);
184 PyObject *kbind(PyObject *keylist, ob::KeyContext context, PyObject *func);
186 PyObject *ebind(ob::EventAction action, PyObject *func);
188 void set_reset_key(const std::string &key);
190 PyObject *send_client_msg(Window target, int type, Window about,
191 long data, long data1 = 0, long data2 = 0,
192 long data3 = 0, long data4 = 0);
196 #endif // __python_hh