00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __PYTHON_WINDOW_H_
00021
00022 #define __PYTHON_WINDOW_H_
00023
00024 #include <Python.h>
00025 #include <ekg/windows.h>
00026
00027 typedef struct
00028 {
00029 PyObject_HEAD;
00030 window_t *w;
00031 } ekg_windowObj;
00032
00033 void ekg_window_dealloc(ekg_windowObj *o);
00034 PyObject * ekg_window_repr(ekg_windowObj * self);
00035 PyObject * ekg_window_str(ekg_windowObj * self);
00036 int ekg_window_init(ekg_windowObj *self, PyObject *args, PyObject *kwds);
00037 PyObject* ekg_window_switch_to(ekg_windowObj *self, PyObject *args);
00038 PyObject* ekg_window_echo(ekg_windowObj * self, PyObject *args);
00039 PyObject* ekg_window_echo_format(ekg_windowObj * self, PyObject *args);
00040 PyObject* ekg_window_kill(ekg_windowObj * self, PyObject *args);
00041 PyObject* ekg_window_get_attr(ekg_windowObj * self, char * attr);
00042 PyObject* ekg_window_next(ekg_windowObj *self, PyObject *args);
00043 PyObject* ekg_window_prev(ekg_windowObj *self, PyObject *args);
00044
00045 staticforward PyMethodDef ekg_window_methods[] = {
00046 {"switch_to", (PyCFunction)ekg_window_switch_to, METH_VARARGS, "Switch to this window"},
00047 {"echo", (PyCFunction)ekg_window_echo, METH_VARARGS, "Print string on this window"},
00048 {"echo_format", (PyCFunction)ekg_window_echo_format, METH_VARARGS, "Print formatted string on this window"},
00049 {"kill", (PyCFunction)ekg_window_kill, METH_VARARGS, "Kill window"},
00050 {"next", (PyCFunction)ekg_window_next, METH_VARARGS, "Return next window" },
00051 {"prev", (PyCFunction)ekg_window_prev, METH_VARARGS, "Return previous window" },
00052 {NULL, NULL, 0, NULL}
00053 };
00054
00055 static PyTypeObject ekg_window_type = {
00056 PyObject_HEAD_INIT(NULL)
00057 0,
00058 "window",
00059 sizeof(ekg_windowObj),
00060 0,
00061 (destructor)ekg_window_dealloc,
00062 0,
00063 (getattrfunc)ekg_window_get_attr,
00064 0,
00065 0,
00066 (reprfunc)ekg_window_repr,
00067 0,
00068 0,
00069 0,
00070 0,
00071 0,
00072 (reprfunc)ekg_window_str,
00073 0,
00074 0,
00075 0,
00076 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
00077 "Window object",
00078 0,
00079 0,
00080 0,
00081 0,
00082 0,
00083 0,
00084 ekg_window_methods,
00085 0,
00086 0,
00087 0,
00088 0,
00089 0,
00090 0,
00091 0,
00092 (initproc)ekg_window_init,
00093 0,
00094 0,
00095 };
00096
00097
00098 #endif
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108