From 63a74632ac39d445cb15cda510c8267da9ff6bbb Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Mon, 13 Jan 2003 10:08:44 +0000 Subject: [PATCH] add the global display variable --- src/openbox.i | 3 +++ src/openbox.py | 2 ++ src/openbox_wrap.cc | 18 ++++++++++++++++++ 3 files changed, 23 insertions(+) diff --git a/src/openbox.i b/src/openbox.i index ef86b9bc..657e31b7 100644 --- a/src/openbox.i +++ b/src/openbox.i @@ -110,6 +110,9 @@ void python_callback(PyObject *func, KeyData *data) }; %ignore otk::display; +%inline %{ + otk::Display *Display_instance() { return otk::display; } +%}; %include "../otk/ustring.i" diff --git a/src/openbox.py b/src/openbox.py index 1f263d30..1d7e4104 100644 --- a/src/openbox.py +++ b/src/openbox.py @@ -29,6 +29,8 @@ except AttributeError: Openbox_instance = _openbox.Openbox_instance +Display_instance = _openbox.Display_instance + class Display(_object): __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, Display, name, value) diff --git a/src/openbox_wrap.cc b/src/openbox_wrap.cc index 4a66d956..4d1136cd 100644 --- a/src/openbox_wrap.cc +++ b/src/openbox_wrap.cc @@ -883,6 +883,9 @@ void python_callback(PyObject *func, KeyData *data) #include + otk::Display *Display_instance() { return otk::display; } + + #include "ustring.hh" ob::Client *ob_Screen_client(ob::Screen *self,int i){ @@ -912,6 +915,20 @@ static PyObject *_wrap_Openbox_instance(PyObject *self, PyObject *args) { } +static PyObject *_wrap_Display_instance(PyObject *self, PyObject *args) { + PyObject *resultobj; + otk::Display *result; + + if(!PyArg_ParseTuple(args,(char *)":Display_instance")) goto fail; + result = (otk::Display *)Display_instance(); + + resultobj = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_otk__Display, 0); + return resultobj; + fail: + return NULL; +} + + static PyObject *_wrap_new_Display(PyObject *self, PyObject *args) { PyObject *resultobj; otk::Display *result; @@ -7953,6 +7970,7 @@ static PyObject *_wrap_send_client_msg(PyObject *self, PyObject *args) { static PyMethodDef SwigMethods[] = { { (char *)"Openbox_instance", _wrap_Openbox_instance, METH_VARARGS }, + { (char *)"Display_instance", _wrap_Display_instance, METH_VARARGS }, { (char *)"new_Display", _wrap_new_Display, METH_VARARGS }, { (char *)"delete_Display", _wrap_delete_Display, METH_VARARGS }, { (char *)"Display_gcCache", _wrap_Display_gcCache, METH_VARARGS }, -- 2.45.2