summaryrefslogtreecommitdiffstats
path: root/Mac/Python
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1995-11-15 15:19:29 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1995-11-15 15:19:29 (GMT)
commitfa4d5d0414da24c2fa4ffc617ed6ee2d33c3ddd2 (patch)
treef21564c0ece2b5aa6add4857d9699154a41b9c10 /Mac/Python
parentb7abb18cd99e348ab2f9f7ea85d72158684319a7 (diff)
downloadcpython-fa4d5d0414da24c2fa4ffc617ed6ee2d33c3ddd2.zip
cpython-fa4d5d0414da24c2fa4ffc617ed6ee2d33c3ddd2.tar.gz
cpython-fa4d5d0414da24c2fa4ffc617ed6ee2d33c3ddd2.tar.bz2
Added converters for Fixed
Diffstat (limited to 'Mac/Python')
-rw-r--r--Mac/Python/macglue.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/Mac/Python/macglue.c b/Mac/Python/macglue.c
index 2528e25..23415eb 100644
--- a/Mac/Python/macglue.c
+++ b/Mac/Python/macglue.c
@@ -734,3 +734,26 @@ PyMac_BuildEventRecord(EventRecord *e)
e->where.v,
e->modifiers);
}
+
+/* Convert Python object to Fixed */
+int
+PyMac_GetFixed(PyObject *v, Fixed *f)
+{
+ double d;
+
+ if( !PyArg_Parse(v, "d", &d))
+ return 0;
+ *f = (Fixed)(d * 0x10000);
+}
+
+/* Convert a Point to a Python object */
+PyObject *
+PyMac_BuildFixed(Fixed f)
+{
+ double d;
+
+ d = f;
+ d = d / 0x10000;
+ return Py_BuildValue("d", d);
+}
+