summaryrefslogtreecommitdiff
path: root/lib/py_aes.c
diff options
context:
space:
mode:
authorJeff Armstrong <jeffrey.armstrong@approximatrix.com>2011-07-14 22:49:28 -0400
committerJeff Armstrong <jeffrey.armstrong@approximatrix.com>2011-07-14 22:49:28 -0400
commit7e9b495ca8c5aef1b4f3e4d5a29283df27348a84 (patch)
tree44246a5ac35ab49e3d12543e2c08e9e581302c0f /lib/py_aes.c
parentf4be6ead7080a62c18058b42e4b50b9a92c2ff3a (diff)
downloadgempy-7e9b495ca8c5aef1b4f3e4d5a29283df27348a84.tar.gz
gempy-7e9b495ca8c5aef1b4f3e4d5a29283df27348a84.zip
Added graphics functions and a stub for the event handling call.
Diffstat (limited to 'lib/py_aes.c')
-rw-r--r--lib/py_aes.c74
1 files changed, 74 insertions, 0 deletions
diff --git a/lib/py_aes.c b/lib/py_aes.c
index 09bf588..702f996 100644
--- a/lib/py_aes.c
+++ b/lib/py_aes.c
@@ -69,6 +69,7 @@ int ret;
}
static PyObject* __CDECL py_form_do(PyObject *self, PyObject *args)
+{
PyObject *obj;
int x;
int ret;
@@ -81,6 +82,7 @@ int ret;
}
static PyObject* __CDECL py_form_center(PyObject *self, PyObject *args)
+{
PyObject *obj;
int x,y,w,h;
int ret;
@@ -94,6 +96,37 @@ int ret;
return Py_None;
}
+/* --- Graphics Library --- */
+static PyObject* __CDECL py_graf_handle(PyObject *self)
+{
+int wchar,hchar,wcell,hcell;
+int ret;
+
+ ret = graf_handle(&wchar, &hchar, &wcell, &hcell);
+ return Py_BuildValue("i(iiii)",ret,wchar,hchar,wcell,hcell);
+}
+
+static PyObject* __CDECL py_graf_mouse(PyObject self, PyObject *args)
+{
+int mouse;
+
+ if(!PyArg_ParseTuple(args,"i",&mouse))
+ return NULL;
+
+ if(mouse == USER_DEF) {
+ PyErr_SetString(GEMError,"User-defined mouse pointers not currently supported");
+ return NULL;
+ }
+
+ if(graf_mouse(mouse) == 0) {
+ PyErr_SetString(GEMError,"Mouse cursor setting failed");
+ return NULL;
+ }
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
/* --- Resources Library --- */
static PyObject* __CDECL py_rsrc_load(PyObject *self, PyObject *args)
{
@@ -331,3 +364,44 @@ PyObject *tple;
Py_INCREF(Py_None);
return Py_None;
}
+
+
+/* --- Event Library --- */
+static PyObject* __CDECL py_evnt_multi(PyObject self, PyObject *args)
+{
+/* Because this is possibly the ugliest call ever created in the C
+ * language, we'll use the same variable names as the docs use.
+ */
+int ev_mflags, ev_mbclicks, ev_mbmask, ev_mbstate, ev_mm1flags, ev_mm1x, ev_mm1y, ev_mm1width, ev_mm1height, ev_mm2flags;
+int ev_mm2x, ev_mm2y, ev_mm2width, ev_mm2height, ev_mmgpbuff, ev_mtlocount, ev_mthicount, ev_mmox, ev_mmoy;
+int ev_mmbutton, ev_mmokstate, ev_mkreturn, ev_mbreturn;
+
+ /* More is still needed */
+
+ ret = evnt_multi(ev_mflags,
+ ev_mbclicks,
+ ev_mbmask,
+ ev_mbstate,
+ ev_mm1flags,
+ ev_mm1x,
+ ev_mm1y,
+ ev_mm1width,
+ ev_mm1height,
+ ev_mm2flags,
+ ev_mm2x,
+ ev_mm2y,
+ ev_mm2width,
+ ev_mm2height,
+ &ev_mmgpbuff,
+ ev_mtlocount,
+ ev_mthicount,
+ &ev_mmox,
+ &ev_mmoy,
+ &ev_mmbutton,
+ &ev_mmokstate,
+ &ev_mkreturn,
+ &ev_mbreturn);
+
+
+}
+