1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
7 # include "../config.h"
13 #include "bindings.hh"
16 #include "otk/display.hh"
21 //%template(ClientList) std::list<OBClient*>;
23 %ignore ob::Openbox::instance;
25 ob::Openbox *Openbox_instance() { return ob::Openbox::instance; }
30 void python_callback(PyObject *func, MotionData *data)
35 arglist = Py_BuildValue("(O)", SWIG_NewPointerObj((void *) data,
36 SWIGTYPE_p_ob__MotionData,
40 result = PyEval_CallObject(func, arglist);
41 if (!result || PyErr_Occurred()) {
42 // an exception occured in the script, display it
50 void python_callback(PyObject *func, ButtonData *data)
55 arglist = Py_BuildValue("(O)", SWIG_NewPointerObj((void *) data,
56 SWIGTYPE_p_ob__ButtonData,
60 result = PyEval_CallObject(func, arglist);
61 if (!result || PyErr_Occurred()) {
62 // an exception occured in the script, display it
70 void python_callback(PyObject *func, EventData *data)
75 arglist = Py_BuildValue("(O)", SWIG_NewPointerObj((void *) data,
76 SWIGTYPE_p_ob__EventData,
80 result = PyEval_CallObject(func, arglist);
81 if (!result || PyErr_Occurred()) {
82 // an exception occured in the script, display it
90 void python_callback(PyObject *func, KeyData *data)
95 arglist = Py_BuildValue("(O)", SWIG_NewPointerObj((void *) data,
96 SWIGTYPE_p_ob__KeyData,
100 result = PyEval_CallObject(func, arglist);
101 if (!result || PyErr_Occurred()) {
102 // an exception occured in the script, display it
113 %ignore ob::OBScreen::clients;
117 %extend ob::OBScreen {
118 OBClient *client(int i) {
119 if (i >= (int)self->clients.size())
121 ob::OBClient::List::iterator it = self->clients.begin();
125 int clientCount() const {
126 return (int) self->clients.size();
130 %import "../otk/eventdispatcher.hh"
131 %import "../otk/eventhandler.hh"
135 %include "openbox.hh"