#define SWIGTYPE_p_otk__OtkEventDispatcher swig_types[18]
#define SWIGTYPE_p_XPropertyEvent swig_types[19]
#define SWIGTYPE_p_XDestroyWindowEvent swig_types[20]
-#define SWIGTYPE_p_PyObject swig_types[21]
-#define SWIGTYPE_p_otk__BImageControl swig_types[22]
+#define SWIGTYPE_p_otk__BImageControl swig_types[21]
+#define SWIGTYPE_p_PyObject swig_types[22]
#define SWIGTYPE_p_ob__OBBindings swig_types[23]
#define SWIGTYPE_p_ob__MwmHints swig_types[24]
#define SWIGTYPE_p_XUnmapEvent swig_types[25]
ob::Openbox *Openbox_instance() { return ob::Openbox::instance; }
- enum ActionType {
- Action_ButtonPress,
- Action_Click,
- Action_DoubleClick,
- Action_EnterWindow,
- Action_LeaveWindow,
- Action_KeyPress,
- Action_MouseMotion,
- Action_NewWindow,
- Action_CloseWindow
- };
- enum WidgetType {
- Type_Frame,
- Type_Titlebar,
- Type_Handle,
- Type_Plate,
- Type_Label,
- Type_MaximizeButton,
- Type_CloseButton,
- Type_IconifyButton,
- Type_StickyButton,
- Type_LeftGrip,
- Type_RightGrip,
- Type_Client,
- Type_Root
- };
-
-
-PyObject * python_register(int action, PyObject *func, bool infront = false)
-{
- if (!PyCallable_Check(func)) {
- PyErr_SetString(PyExc_TypeError, "Invalid callback function.");
- return NULL;
- }
-
- if (!ob::Openbox::instance->actions()->registerCallback(
- (ob::OBActions::ActionType)action, func, infront)) {
- PyErr_SetString(PyExc_RuntimeError, "Unable to register action callback.");
- return NULL;
- }
- Py_INCREF(Py_None); return Py_None;
-}
-
-PyObject * unregister(int action, PyObject *func)
-{
- if (!PyCallable_Check(func)) {
- PyErr_SetString(PyExc_TypeError, "Invalid callback function.");
- return NULL;
- }
-
- if (!ob::Openbox::instance->actions()->unregisterCallback(
- (ob::OBActions::ActionType)action, func)) {
- PyErr_SetString(PyExc_RuntimeError, "Unable to unregister action callback.");
- return NULL;
- }
- Py_INCREF(Py_None); return Py_None;
-}
-
-PyObject * unregister_all(int action)
-{
- if (!ob::Openbox::instance->actions()->unregisterAllCallbacks(
- (ob::OBActions::ActionType)action)) {
- PyErr_SetString(PyExc_RuntimeError,
- "Unable to unregister action callbacks.");
- return NULL;
- }
- Py_INCREF(Py_None); return Py_None;
-}
-
-PyObject * bind(PyObject *keylist, PyObject *func)
-{
- if (!PyCallable_Check(func)) {
- PyErr_SetString(PyExc_TypeError, "Invalid callback function.");
- return NULL;
- }
- if (!PyList_Check(keylist)) {
- PyErr_SetString(PyExc_TypeError, "Invalid keylist. Not a list.");
- return NULL;
- }
-
- ob::OBBindings::StringVect vectkeylist;
- for (int i = 0, end = PyList_Size(keylist); i < end; ++i) {
- PyObject *str = PyList_GetItem(keylist, i);
- if (!PyString_Check(str)) {
- PyErr_SetString(PyExc_TypeError,
- "Invalid keylist. It must contain only strings.");
- return NULL;
- }
- vectkeylist.push_back(PyString_AsString(str));
- }
-
- if (!ob::Openbox::instance->bindings()->add(vectkeylist, func)) {
- PyErr_SetString(PyExc_RuntimeError,"Unable to add binding.");
- return NULL;
- }
- Py_INCREF(Py_None); return Py_None;
-}
-
-PyObject * unbind(PyObject *keylist)
-{
- if (!PyList_Check(keylist)) {
- PyErr_SetString(PyExc_TypeError, "Invalid keylist. Not a list.");
- return NULL;
- }
-
- ob::OBBindings::StringVect vectkeylist;
- for (int i = 0, end = PyList_Size(keylist); i < end; ++i) {
- PyObject *str = PyList_GetItem(keylist, i);
- if (!PyString_Check(str)) {
- PyErr_SetString(PyExc_TypeError,
- "Invalid keylist. It must contain only strings.");
- return NULL;
- }
- vectkeylist.push_back(PyString_AsString(str));
- }
-
- ob::Openbox::instance->bindings()->remove(vectkeylist);
- Py_INCREF(Py_None); return Py_None;
-}
-
-void unbind_all()
-{
- ob::Openbox::instance->bindings()->removeAll();
-}
-
-void set_reset_key(const std::string &key)
-{
- ob::Openbox::instance->bindings()->setResetKey(key);
-}
-
-
#include <iterator>
ob::OBClient *ob_OBScreen_client(ob::OBScreen *self,int i){
}
-static PyObject *_wrap_register(PyObject *self, PyObject *args) {
- PyObject *resultobj;
- int arg1 ;
- PyObject *arg2 = (PyObject *) 0 ;
- bool arg3 = (bool) false ;
- PyObject *result;
- PyObject * obj1 = 0 ;
- PyObject * obj2 = 0 ;
-
- if(!PyArg_ParseTuple(args,(char *)"iO|O:register",&arg1,&obj1,&obj2)) goto fail;
- arg2 = obj1;
- if (obj2) {
- arg3 = (bool) PyInt_AsLong(obj2);
- if (PyErr_Occurred()) SWIG_fail;
- }
- result = (PyObject *)python_register(arg1,arg2,arg3);
-
- resultobj = result;
- return resultobj;
- fail:
- return NULL;
-}
-
-
-static PyObject *_wrap_unregister(PyObject *self, PyObject *args) {
- PyObject *resultobj;
- int arg1 ;
- PyObject *arg2 = (PyObject *) 0 ;
- PyObject *result;
- PyObject * obj1 = 0 ;
-
- if(!PyArg_ParseTuple(args,(char *)"iO:unregister",&arg1,&obj1)) goto fail;
- arg2 = obj1;
- result = (PyObject *)unregister(arg1,arg2);
-
- resultobj = result;
- return resultobj;
- fail:
- return NULL;
-}
-
-
-static PyObject *_wrap_unregister_all(PyObject *self, PyObject *args) {
- PyObject *resultobj;
- int arg1 ;
- PyObject *result;
-
- if(!PyArg_ParseTuple(args,(char *)"i:unregister_all",&arg1)) goto fail;
- result = (PyObject *)unregister_all(arg1);
-
- resultobj = result;
- return resultobj;
- fail:
- return NULL;
-}
-
-
-static PyObject *_wrap_bind(PyObject *self, PyObject *args) {
- PyObject *resultobj;
- PyObject *arg1 = (PyObject *) 0 ;
- PyObject *arg2 = (PyObject *) 0 ;
- PyObject *result;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
-
- if(!PyArg_ParseTuple(args,(char *)"OO:bind",&obj0,&obj1)) goto fail;
- arg1 = obj0;
- arg2 = obj1;
- result = (PyObject *)bind(arg1,arg2);
-
- resultobj = result;
- return resultobj;
- fail:
- return NULL;
-}
-
-
-static PyObject *_wrap_unbind(PyObject *self, PyObject *args) {
- PyObject *resultobj;
- PyObject *arg1 = (PyObject *) 0 ;
- PyObject *result;
- PyObject * obj0 = 0 ;
-
- if(!PyArg_ParseTuple(args,(char *)"O:unbind",&obj0)) goto fail;
- arg1 = obj0;
- result = (PyObject *)unbind(arg1);
-
- resultobj = result;
- return resultobj;
- fail:
- return NULL;
-}
-
-
-static PyObject *_wrap_unbind_all(PyObject *self, PyObject *args) {
- PyObject *resultobj;
-
- if(!PyArg_ParseTuple(args,(char *)":unbind_all")) goto fail;
- unbind_all();
-
- Py_INCREF(Py_None); resultobj = Py_None;
- return resultobj;
- fail:
- return NULL;
-}
-
-
-static PyObject *_wrap_set_reset_key(PyObject *self, PyObject *args) {
- PyObject *resultobj;
- std::string *arg1 = 0 ;
- std::string temp1 ;
- PyObject * obj0 = 0 ;
-
- if(!PyArg_ParseTuple(args,(char *)"O:set_reset_key",&obj0)) goto fail;
- {
- if (PyString_Check(obj0)) {
- temp1 = std::string(PyString_AsString(obj0));
- arg1 = &temp1;
- }else {
- SWIG_exception(SWIG_TypeError, "string expected");
- }
- }
- set_reset_key((std::string const &)*arg1);
-
- Py_INCREF(Py_None); resultobj = Py_None;
- return resultobj;
- fail:
- return NULL;
-}
-
-
static PyObject *_wrap_Cursors_session_set(PyObject *self, PyObject *args) {
PyObject *resultobj;
ob::Cursors *arg1 = (ob::Cursors *) 0 ;
Py_INCREF(obj);
return Py_BuildValue((char *)"");
}
+static PyObject *_wrap_mbind(PyObject *self, PyObject *args) {
+ PyObject *resultobj;
+ std::string *arg1 = 0 ;
+ int arg2 ;
+ int arg3 ;
+ PyObject *arg4 = (PyObject *) 0 ;
+ PyObject *result;
+ std::string temp1 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj3 = 0 ;
+
+ if(!PyArg_ParseTuple(args,(char *)"OiiO:mbind",&obj0,&arg2,&arg3,&obj3)) goto fail;
+ {
+ if (PyString_Check(obj0)) {
+ temp1 = std::string(PyString_AsString(obj0));
+ arg1 = &temp1;
+ }else {
+ SWIG_exception(SWIG_TypeError, "string expected");
+ }
+ }
+ arg4 = obj3;
+ result = (PyObject *)ob::mbind((std::string const &)*arg1,(ob::MouseContext )arg2,(ob::MouseAction )arg3,arg4);
+
+ resultobj = result;
+ return resultobj;
+ fail:
+ return NULL;
+}
+
+
+static PyObject *_wrap_kbind(PyObject *self, PyObject *args) {
+ PyObject *resultobj;
+ PyObject *arg1 = (PyObject *) 0 ;
+ int arg2 ;
+ PyObject *arg3 = (PyObject *) 0 ;
+ PyObject *result;
+ PyObject * obj0 = 0 ;
+ PyObject * obj2 = 0 ;
+
+ if(!PyArg_ParseTuple(args,(char *)"OiO:kbind",&obj0,&arg2,&obj2)) goto fail;
+ arg1 = obj0;
+ arg3 = obj2;
+ result = (PyObject *)ob::kbind(arg1,(ob::KeyContext )arg2,arg3);
+
+ resultobj = result;
+ return resultobj;
+ fail:
+ return NULL;
+}
+
+
+static PyObject *_wrap_kunbind(PyObject *self, PyObject *args) {
+ PyObject *resultobj;
+ PyObject *arg1 = (PyObject *) 0 ;
+ PyObject *result;
+ PyObject * obj0 = 0 ;
+
+ if(!PyArg_ParseTuple(args,(char *)"O:kunbind",&obj0)) goto fail;
+ arg1 = obj0;
+ result = (PyObject *)ob::kunbind(arg1);
+
+ resultobj = result;
+ return resultobj;
+ fail:
+ return NULL;
+}
+
+
+static PyObject *_wrap_kunbind_all(PyObject *self, PyObject *args) {
+ PyObject *resultobj;
+
+ if(!PyArg_ParseTuple(args,(char *)":kunbind_all")) goto fail;
+ ob::kunbind_all();
+
+ Py_INCREF(Py_None); resultobj = Py_None;
+ return resultobj;
+ fail:
+ return NULL;
+}
+
+
+static PyObject *_wrap_set_reset_key(PyObject *self, PyObject *args) {
+ PyObject *resultobj;
+ std::string *arg1 = 0 ;
+ std::string temp1 ;
+ PyObject * obj0 = 0 ;
+
+ if(!PyArg_ParseTuple(args,(char *)"O:set_reset_key",&obj0)) goto fail;
+ {
+ if (PyString_Check(obj0)) {
+ temp1 = std::string(PyString_AsString(obj0));
+ arg1 = &temp1;
+ }else {
+ SWIG_exception(SWIG_TypeError, "string expected");
+ }
+ }
+ ob::set_reset_key((std::string const &)*arg1);
+
+ Py_INCREF(Py_None); resultobj = Py_None;
+ return resultobj;
+ fail:
+ return NULL;
+}
+
+
static PyMethodDef SwigMethods[] = {
{ (char *)"Openbox_instance", _wrap_Openbox_instance, METH_VARARGS },
- { (char *)"register", _wrap_register, METH_VARARGS },
- { (char *)"unregister", _wrap_unregister, METH_VARARGS },
- { (char *)"unregister_all", _wrap_unregister_all, METH_VARARGS },
- { (char *)"bind", _wrap_bind, METH_VARARGS },
- { (char *)"unbind", _wrap_unbind, METH_VARARGS },
- { (char *)"unbind_all", _wrap_unbind_all, METH_VARARGS },
- { (char *)"set_reset_key", _wrap_set_reset_key, METH_VARARGS },
{ (char *)"Cursors_session_set", _wrap_Cursors_session_set, METH_VARARGS },
{ (char *)"Cursors_session_get", _wrap_Cursors_session_get, METH_VARARGS },
{ (char *)"Cursors_move_set", _wrap_Cursors_move_set, METH_VARARGS },
{ (char *)"OBClient_destroyHandler", _wrap_OBClient_destroyHandler, METH_VARARGS },
{ (char *)"OBClient_reparentHandler", _wrap_OBClient_reparentHandler, METH_VARARGS },
{ (char *)"OBClient_swigregister", OBClient_swigregister, METH_VARARGS },
+ { (char *)"mbind", _wrap_mbind, METH_VARARGS },
+ { (char *)"kbind", _wrap_kbind, METH_VARARGS },
+ { (char *)"kunbind", _wrap_kunbind, METH_VARARGS },
+ { (char *)"kunbind_all", _wrap_kunbind_all, METH_VARARGS },
+ { (char *)"set_reset_key", _wrap_set_reset_key, METH_VARARGS },
{ NULL, NULL }
};
static swig_type_info _swigt__p_otk__OtkEventDispatcher[] = {{"_p_otk__OtkEventDispatcher", 0, "otk::OtkEventDispatcher *", 0},{"_p_otk__OtkEventDispatcher"},{"_p_ob__Openbox", _p_ob__OpenboxTo_p_otk__OtkEventDispatcher},{0}};
static swig_type_info _swigt__p_XPropertyEvent[] = {{"_p_XPropertyEvent", 0, "XPropertyEvent *", 0},{"_p_XPropertyEvent"},{0}};
static swig_type_info _swigt__p_XDestroyWindowEvent[] = {{"_p_XDestroyWindowEvent", 0, "XDestroyWindowEvent *", 0},{"_p_XDestroyWindowEvent"},{0}};
-static swig_type_info _swigt__p_PyObject[] = {{"_p_PyObject", 0, "PyObject *", 0},{"_p_PyObject"},{0}};
static swig_type_info _swigt__p_otk__BImageControl[] = {{"_p_otk__BImageControl", 0, "otk::BImageControl *", 0},{"_p_otk__BImageControl"},{0}};
+static swig_type_info _swigt__p_PyObject[] = {{"_p_PyObject", 0, "PyObject *", 0},{"_p_PyObject"},{0}};
static swig_type_info _swigt__p_ob__OBBindings[] = {{"_p_ob__OBBindings", 0, "ob::OBBindings *", 0},{"_p_ob__OBBindings"},{0}};
static swig_type_info _swigt__p_ob__MwmHints[] = {{"_p_ob__MwmHints", 0, "ob::MwmHints *", 0},{"_p_ob__MwmHints"},{0}};
static swig_type_info _swigt__p_XUnmapEvent[] = {{"_p_XUnmapEvent", 0, "XUnmapEvent *", 0},{"_p_XUnmapEvent"},{0}};
_swigt__p_otk__OtkEventDispatcher,
_swigt__p_XPropertyEvent,
_swigt__p_XDestroyWindowEvent,
-_swigt__p_PyObject,
_swigt__p_otk__BImageControl,
+_swigt__p_PyObject,
_swigt__p_ob__OBBindings,
_swigt__p_ob__MwmHints,
_swigt__p_XUnmapEvent,
/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
static swig_const_info swig_const_table[] = {
-{ SWIG_PY_INT, (char *)"Action_ButtonPress", (long) Action_ButtonPress, 0, 0, 0},
-{ SWIG_PY_INT, (char *)"Action_Click", (long) Action_Click, 0, 0, 0},
-{ SWIG_PY_INT, (char *)"Action_DoubleClick", (long) Action_DoubleClick, 0, 0, 0},
-{ SWIG_PY_INT, (char *)"Action_EnterWindow", (long) Action_EnterWindow, 0, 0, 0},
-{ SWIG_PY_INT, (char *)"Action_LeaveWindow", (long) Action_LeaveWindow, 0, 0, 0},
-{ SWIG_PY_INT, (char *)"Action_KeyPress", (long) Action_KeyPress, 0, 0, 0},
-{ SWIG_PY_INT, (char *)"Action_MouseMotion", (long) Action_MouseMotion, 0, 0, 0},
-{ SWIG_PY_INT, (char *)"Action_NewWindow", (long) Action_NewWindow, 0, 0, 0},
-{ SWIG_PY_INT, (char *)"Action_CloseWindow", (long) Action_CloseWindow, 0, 0, 0},
-{ SWIG_PY_INT, (char *)"Type_Frame", (long) Type_Frame, 0, 0, 0},
-{ SWIG_PY_INT, (char *)"Type_Titlebar", (long) Type_Titlebar, 0, 0, 0},
-{ SWIG_PY_INT, (char *)"Type_Handle", (long) Type_Handle, 0, 0, 0},
-{ SWIG_PY_INT, (char *)"Type_Plate", (long) Type_Plate, 0, 0, 0},
-{ SWIG_PY_INT, (char *)"Type_Label", (long) Type_Label, 0, 0, 0},
-{ SWIG_PY_INT, (char *)"Type_MaximizeButton", (long) Type_MaximizeButton, 0, 0, 0},
-{ SWIG_PY_INT, (char *)"Type_CloseButton", (long) Type_CloseButton, 0, 0, 0},
-{ SWIG_PY_INT, (char *)"Type_IconifyButton", (long) Type_IconifyButton, 0, 0, 0},
-{ SWIG_PY_INT, (char *)"Type_StickyButton", (long) Type_StickyButton, 0, 0, 0},
-{ SWIG_PY_INT, (char *)"Type_LeftGrip", (long) Type_LeftGrip, 0, 0, 0},
-{ SWIG_PY_INT, (char *)"Type_RightGrip", (long) Type_RightGrip, 0, 0, 0},
-{ SWIG_PY_INT, (char *)"Type_Client", (long) Type_Client, 0, 0, 0},
-{ SWIG_PY_INT, (char *)"Type_Root", (long) Type_Root, 0, 0, 0},
{ SWIG_PY_INT, (char *)"Openbox_State_Starting", (long) ob::Openbox::State_Starting, 0, 0, 0},
{ SWIG_PY_INT, (char *)"Openbox_State_Normal", (long) ob::Openbox::State_Normal, 0, 0, 0},
{ SWIG_PY_INT, (char *)"Openbox_State_Exiting", (long) ob::Openbox::State_Exiting, 0, 0, 0},
{ SWIG_PY_INT, (char *)"OBClient_State_Toggle", (long) ob::OBClient::State_Toggle, 0, 0, 0},
{ SWIG_PY_INT, (char *)"OBClient_event_mask", (long) ob::OBClient::event_mask, 0, 0, 0},
{ SWIG_PY_INT, (char *)"OBClient_no_propagate_mask", (long) ob::OBClient::no_propagate_mask, 0, 0, 0},
+{ SWIG_PY_INT, (char *)"MC_Frame", (long) ob::MC_Frame, 0, 0, 0},
+{ SWIG_PY_INT, (char *)"MC_Titlebar", (long) ob::MC_Titlebar, 0, 0, 0},
+{ SWIG_PY_INT, (char *)"MC_Handle", (long) ob::MC_Handle, 0, 0, 0},
+{ SWIG_PY_INT, (char *)"MC_Window", (long) ob::MC_Window, 0, 0, 0},
+{ SWIG_PY_INT, (char *)"MC_MaximizeButton", (long) ob::MC_MaximizeButton, 0, 0, 0},
+{ SWIG_PY_INT, (char *)"MC_CloseButton", (long) ob::MC_CloseButton, 0, 0, 0},
+{ SWIG_PY_INT, (char *)"MC_IconifyButton", (long) ob::MC_IconifyButton, 0, 0, 0},
+{ SWIG_PY_INT, (char *)"MC_StickyButton", (long) ob::MC_StickyButton, 0, 0, 0},
+{ SWIG_PY_INT, (char *)"MC_Grip", (long) ob::MC_Grip, 0, 0, 0},
+{ SWIG_PY_INT, (char *)"MC_Root", (long) ob::MC_Root, 0, 0, 0},
+{ SWIG_PY_INT, (char *)"MC_MenuItem", (long) ob::MC_MenuItem, 0, 0, 0},
+{ SWIG_PY_INT, (char *)"NUM_MOUSE_CONTEXT", (long) ob::NUM_MOUSE_CONTEXT, 0, 0, 0},
+{ SWIG_PY_INT, (char *)"MousePress", (long) ob::MousePress, 0, 0, 0},
+{ SWIG_PY_INT, (char *)"MouseClick", (long) ob::MouseClick, 0, 0, 0},
+{ SWIG_PY_INT, (char *)"MouseDoubleClick", (long) ob::MouseDoubleClick, 0, 0, 0},
+{ SWIG_PY_INT, (char *)"MouseMotion", (long) ob::MouseMotion, 0, 0, 0},
+{ SWIG_PY_INT, (char *)"NUM_MOUSE_ACTION", (long) ob::NUM_MOUSE_ACTION, 0, 0, 0},
+{ SWIG_PY_INT, (char *)"KC_Menu", (long) ob::KC_Menu, 0, 0, 0},
+{ SWIG_PY_INT, (char *)"KC_All", (long) ob::KC_All, 0, 0, 0},
+{ SWIG_PY_INT, (char *)"NUM_KEY_CONTEXT", (long) ob::NUM_KEY_CONTEXT, 0, 0, 0},
{ SWIG_PY_INT, (char *)"X_PROTOCOL", (long) 11, 0, 0, 0},
{ SWIG_PY_INT, (char *)"X_PROTOCOL_REVISION", (long) 0, 0, 0, 0},
{ SWIG_PY_INT, (char *)"None", (long) 0L, 0, 0, 0},