From 4534151926c4f3887ba9e37ae67df16f1eb039ef Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Mon, 17 Feb 2003 21:25:52 +0000 Subject: split up the otk stuff into separate files. wrap otk::Property properly with typemaps so that it is usable. wrap otk::Timer properly so that you can use it with a python callback --- wrap/otk_widget.i | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 wrap/otk_widget.i (limited to 'wrap/otk_widget.i') diff --git a/wrap/otk_widget.i b/wrap/otk_widget.i new file mode 100644 index 00000000..a9f06b5d --- /dev/null +++ b/wrap/otk_widget.i @@ -0,0 +1,35 @@ +// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*- + +%module otk_widget + +%{ +#include "config.h" +#include "widget.hh" +%} + +%include "otk_rendercolor.i" + +%typemap(python,out) const std::list& { + std::list *v = $1; + unsigned int s = v->size(); + PyObject *l = PyList_New(s); + + std::list::const_iterator it = v->begin(), end = v->end(); + for (unsigned int i = 0; i < s; ++i, ++it) { + PyObject *pdata = SWIG_NewPointerObj((void*)*it,SWIGTYPE_p_otk__Widget,0); + PyList_SET_ITEM(l, i, pdata); + } + $result = l; +} + +namespace otk { + +%ignore Widget::exposeHandler(const XExposeEvent &); +%ignore Widget::configureHandler(const XConfigureEvent &); +%ignore Widget::styleChanged(const RenderStyle &); + +} + +%import "../otk/eventhandler.hh" +%import "../otk/renderstyle.hh" +%include "widget.hh" -- cgit v1.2.3