summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1995-01-26 22:56:59 (GMT)
committerGuido van Rossum <guido@python.org>1995-01-26 22:56:59 (GMT)
commit5279ec683a6cddcccb494c4343b9a4ed9794683d (patch)
treeb7a4890d0709cfcf109c278858ab2d104db26775
parentefd9767f56bb04d8c1d61df7cb3bb34b68dbcbf4 (diff)
downloadcpython-5279ec683a6cddcccb494c4343b9a4ed9794683d.zip
cpython-5279ec683a6cddcccb494c4343b9a4ed9794683d.tar.gz
cpython-5279ec683a6cddcccb494c4343b9a4ed9794683d.tar.bz2
reverse h/v in Point and Rect
-rw-r--r--Mac/Python/macglue.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/Mac/Python/macglue.c b/Mac/Python/macglue.c
index b4a5fbd..5e82e7e 100644
--- a/Mac/Python/macglue.c
+++ b/Mac/Python/macglue.c
@@ -327,36 +327,38 @@ PyMac_GetFSSpec(PyObject *v, FSSpec *fs)
/* Convert a Python object to a Rect.
- The object must be a (top, left, bottom, right) tuple.
- (Unfortunately this is different from STDWIN's convention). */
+ The object must be a (left, top, right, bottom) tuple.
+ (This differs from the order in the struct but is consistent with
+ the arguments to SetRect(), and also with STDWIN). */
int
PyMac_GetRect(PyObject *v, Rect *r)
{
- return PyArg_Parse(v, "(hhhh)", &r->top, &r->left, &r->bottom, &r->right);
+ return PyArg_Parse(v, "(hhhh)", &r->left, &r->top, &r->right, &r->bottom);
}
/* Convert a Rect to a Python object */
PyObject *
PyMac_BuildRect(Rect *r)
{
- return Py_BuildValue("(hhhh)", r->top, r->left, r->bottom, r->right);
+ return Py_BuildValue("(hhhh)", r->left, r->top, r->right, r->bottom);
}
/* Convert a Python object to a Point.
- The object must be a (v, h) tuple.
- (Unfortunately this is different from STDWIN's convention). */
+ The object must be a (h, v) tuple.
+ (This differs from the order in the struct but is consistent with
+ the arguments to SetPoint(), and also with STDWIN). */
int
PyMac_GetPoint(PyObject *v, Point *p)
{
- return PyArg_Parse(v, "(hh)", &p->v, &p->h);
+ return PyArg_Parse(v, "(hh)", &p->h, &p->v);
}
/* Convert a Point to a Python object */
PyObject *
PyMac_BuildPoint(Point p)
{
- return Py_BuildValue("(hh)", p.v, p.h);
+ return Py_BuildValue("(hh)", p.h, p.v);
}
@@ -369,8 +371,8 @@ PyMac_GetEventRecord(PyObject *v, EventRecord *e)
&e->what,
&e->message,
&e->when,
- &e->where.v,
&e->where.h,
+ &e->where.v,
&e->modifiers);
}
@@ -382,7 +384,7 @@ PyMac_BuildEventRecord(EventRecord *e)
e->what,
e->message,
e->when,
- e->where.v,
e->where.h,
+ e->where.v,
e->modifiers);
}