1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
4 # include "../config.h"
7 #include "python_client.hh"
14 PyObject *get_client_dict(PyObject* self, PyObject* args)
16 if (!PyArg_ParseTuple(args, ":get_client_dict"))
18 return PyDictProxy_New((PyObject*)Openbox::instance->pyclients());
23 PyObject *getWindow(PyObject* self, PyObject* args)
25 if (!PyArg_ParseTuple(args, ":getWindow"))
27 return PyLong_FromLong(((PyClientObject*)self)->window);
32 static PyMethodDef attr_methods[] = {
33 {"getWindow", getWindow, METH_VARARGS,
34 "Return the window id."},
35 {NULL, NULL, 0, NULL} /* sentinel */
38 static PyObject *getattr(PyObject *obj, char *name)
40 return Py_FindMethod(attr_methods, obj, name);
45 static void client_dealloc(PyObject* self)
50 PyTypeObject PyClient_Type = {
51 PyObject_HEAD_INIT(NULL)
54 sizeof(PyClientObject),
56 client_dealloc, /*tp_dealloc*/
58 getattr, /*tp_getattr*/