]> Dogcows Code - chaz/openbox/blob - src/python.hh
all broken now. working on adding mouse binding support
[chaz/openbox] / src / python.hh
1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
2 #ifndef __python_hh
3 #define __python_hh
4
5 /*! @file python.hh
6 @brief wee
7 */
8
9 #include "actions.hh"
10 #include "widget.hh"
11 #include "bindings.hh"
12
13 extern "C" {
14 #include <Python.h>
15 }
16
17 namespace ob {
18
19 //! Add a python callback funtion to the back of the hook list
20 bool python_register(int action, PyObject *callback);
21 //! Add a python callback funtion to the front of the hook list
22 bool python_preregister(int action, PyObject *callback);
23 //! Remove a python callback function from the hook list
24 bool python_unregister(int action, PyObject *callback);
25
26 //! Removes all python callback functions from the hook list
27 bool python_unregister_all(int action);
28
29 //! Add a keybinding
30 /*!
31 @param keylist A python list of modifier/key/buttons, in the form:
32 "C-A-space" or "A-Button1" etc.
33 @param callback A python function to call when the binding is used.
34 */
35 bool python_bind_key(PyObject *keylist, PyObject *callback);
36
37 bool python_unbind_key(PyObject *keylist);
38
39 //! Adds a mouse binding
40 bool python_bind_mouse(const std::string &button, PyObject *callback);
41
42 bool python_unbind_mouse(const std::string &button);
43
44 bool python_unbind_all();
45
46 //! Fire a python callback function
47 void python_callback(OBActions::ActionType action, Window window,
48 OBWidget::WidgetType type, unsigned int state,
49 long d1 = LONG_MIN, long d2 = LONG_MIN,
50 long d3 = LONG_MIN, long d4 = LONG_MIN);
51
52 }
53
54 #endif // __python_hh
This page took 0.034181 seconds and 4 git commands to generate.