diff options
| author | Dana Jansens <danakj@orodu.net> | 2003-01-03 05:26:04 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2003-01-03 05:26:04 +0000 |
| commit | ca3e463057ebf8a7a48a5997aedc062cdac72f3f (patch) | |
| tree | 38c809333c9e11626d87bbd78a08cbe05169d43b /src/python.hh | |
| parent | b35dae95a5cdb902f1661b9572af47c3f55c975c (diff) | |
moving a window is possible once again
Diffstat (limited to 'src/python.hh')
| -rw-r--r-- | src/python.hh | 61 |
1 files changed, 54 insertions, 7 deletions
diff --git a/src/python.hh b/src/python.hh index c5e566f4..67943a84 100644 --- a/src/python.hh +++ b/src/python.hh @@ -6,6 +6,9 @@ @brief wee */ +#include "otk/point.hh" +#include "otk/rect.hh" + extern "C" { #include <X11/Xlib.h> #include <Python.h> @@ -19,6 +22,7 @@ namespace ob { enum MouseContext { MC_Frame, MC_Titlebar, + MC_Handle, MC_Window, MC_MaximizeButton, MC_CloseButton, @@ -45,18 +49,61 @@ enum KeyContext { }; #ifndef SWIG + +// *** MotionData can be (and is) cast ButtonData!! (in actions.cc) *** // +typedef struct { + PyObject_HEAD; + Window window; + Time time; + unsigned int state; + unsigned int button; + MouseContext context; + MouseAction action; + int xroot; + int yroot; + int pressx; + int pressy; + int press_clientx; + int press_clienty; + int press_clientwidth; + int press_clientheight; +} MotionData; + +// *** MotionData can be (and is) cast ButtonData!! (in actions.cc) *** // +typedef struct { + PyObject_HEAD; + Window window; + Time time; + unsigned int state; + unsigned int button; + MouseContext context; + MouseAction action; +} ButtonData; + +typedef struct { + PyObject_HEAD; + Window window; + Time time; + unsigned int state; + unsigned int key; +} KeyData; + void python_init(char *argv0); void python_destroy(); bool python_exec(const std::string &path); -void python_callback(PyObject *func, MouseAction action, - Window window, MouseContext context, - unsigned int state, unsigned int button, - int xroot, int yroot, Time time); - -void python_callback(PyObject *func, Window window, unsigned int state, - unsigned int key, Time time); +MotionData *new_motion_data(Window window, Time time, unsigned int state, + unsigned int button, MouseContext context, + MouseAction action, int xroot, int yroot, + const otk::Point &initpos, + const otk::Rect &initarea); +ButtonData *new_button_data(Window window, Time time, unsigned int state, + unsigned int button, MouseContext context, + MouseAction action); +KeyData *new_key_data(Window window, Time time, unsigned int state, + unsigned int key); +void python_callback(PyObject *func, PyObject *data); bool python_get_string(const char *name, std::string *value); bool python_get_stringlist(const char *name, std::vector<std::string> *value); |
