1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
4 # include "../config.h"
7 #include "python_client.hh"
14 PyObject *getWindow(PyObject* self, PyObject* args)
16 if (!PyArg_ParseTuple(args, ":getWindow"))
18 return PyLong_FromLong(((PyClientObject*)self)->client->window());
23 static PyMethodDef attr_methods[] = {
24 {"getWindow", (PyCFunction)getWindow, METH_VARARGS,
25 "Return the window id."},
26 {NULL, NULL, 0, NULL} /* sentinel */
29 static PyObject *getattr(PyObject *obj, char *name)
31 return Py_FindMethod(attr_methods, obj, name);
36 static void client_dealloc(PyObject* self)
41 PyTypeObject PyClient_Type = {
42 PyObject_HEAD_INIT(NULL)
45 sizeof(PyClientObject),
47 client_dealloc, /*tp_dealloc*/
49 getattr, /*tp_getattr*/