summaryrefslogtreecommitdiffstats
path: root/Mac/Modules/qd
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1995-11-14 10:46:01 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1995-11-14 10:46:01 (GMT)
commit54c8f7e4bbbb11d5f106c4a34d87eec5635345eb (patch)
tree7e059ffaf569e408d121a8047e6f076a724047ce /Mac/Modules/qd
parentcdaa3d95b87b1da0d94fb82ef73594f8bcbb14ce (diff)
downloadcpython-54c8f7e4bbbb11d5f106c4a34d87eec5635345eb.zip
cpython-54c8f7e4bbbb11d5f106c4a34d87eec5635345eb.tar.gz
cpython-54c8f7e4bbbb11d5f106c4a34d87eec5635345eb.tar.bz2
- Fixed handling of InsetRect, OffsetRect, MapRect
- Added support for PatHandle, CursHandle - Regenerated from new universal headers.
Diffstat (limited to 'Mac/Modules/qd')
-rw-r--r--Mac/Modules/qd/Qdmodule.c129
-rw-r--r--Mac/Modules/qd/qdgen.py43
-rw-r--r--Mac/Modules/qd/qdscan.py17
-rw-r--r--Mac/Modules/qd/qdsupport.py2
4 files changed, 180 insertions, 11 deletions
diff --git a/Mac/Modules/qd/Qdmodule.c b/Mac/Modules/qd/Qdmodule.c
index 442a628..eecdd12 100644
--- a/Mac/Modules/qd/Qdmodule.c
+++ b/Mac/Modules/qd/Qdmodule.c
@@ -518,7 +518,8 @@ static PyObject *Qd_OffsetRect(_self, _args)
Rect r;
short dh;
short dv;
- if (!PyArg_ParseTuple(_args, "hh",
+ if (!PyArg_ParseTuple(_args, "O&hh",
+ PyMac_GetRect, &r,
&dh,
&dv))
return NULL;
@@ -538,7 +539,8 @@ static PyObject *Qd_InsetRect(_self, _args)
Rect r;
short dh;
short dv;
- if (!PyArg_ParseTuple(_args, "hh",
+ if (!PyArg_ParseTuple(_args, "O&hh",
+ PyMac_GetRect, &r,
&dh,
&dv))
return NULL;
@@ -1654,7 +1656,8 @@ static PyObject *Qd_MapRect(_self, _args)
Rect r;
Rect srcRect;
Rect dstRect;
- if (!PyArg_ParseTuple(_args, "O&O&",
+ if (!PyArg_ParseTuple(_args, "O&O&O&",
+ PyMac_GetRect, &r,
PyMac_GetRect, &srcRect,
PyMac_GetRect, &dstRect))
return NULL;
@@ -2208,6 +2211,108 @@ static PyObject *Qd_QDError(_self, _args)
return _res;
}
+static PyObject *Qd_GetPattern(_self, _args)
+ PyObject *_self;
+ PyObject *_args;
+{
+ PyObject *_res = NULL;
+ PatHandle _rv;
+ short patternID;
+ if (!PyArg_ParseTuple(_args, "h",
+ &patternID))
+ return NULL;
+ _rv = GetPattern(patternID);
+ _res = Py_BuildValue("O&",
+ ResObj_New, _rv);
+ return _res;
+}
+
+static PyObject *Qd_GetCursor(_self, _args)
+ PyObject *_self;
+ PyObject *_args;
+{
+ PyObject *_res = NULL;
+ CursHandle _rv;
+ short cursorID;
+ if (!PyArg_ParseTuple(_args, "h",
+ &cursorID))
+ return NULL;
+ _rv = GetCursor(cursorID);
+ _res = Py_BuildValue("O&",
+ ResObj_New, _rv);
+ return _res;
+}
+
+static PyObject *Qd_GetPicture(_self, _args)
+ PyObject *_self;
+ PyObject *_args;
+{
+ PyObject *_res = NULL;
+ PicHandle _rv;
+ short pictureID;
+ if (!PyArg_ParseTuple(_args, "h",
+ &pictureID))
+ return NULL;
+ _rv = GetPicture(pictureID);
+ _res = Py_BuildValue("O&",
+ ResObj_New, _rv);
+ return _res;
+}
+
+static PyObject *Qd_DeltaPoint(_self, _args)
+ PyObject *_self;
+ PyObject *_args;
+{
+ PyObject *_res = NULL;
+ long _rv;
+ Point ptA;
+ Point ptB;
+ if (!PyArg_ParseTuple(_args, "O&O&",
+ PyMac_GetPoint, &ptA,
+ PyMac_GetPoint, &ptB))
+ return NULL;
+ _rv = DeltaPoint(ptA,
+ ptB);
+ _res = Py_BuildValue("l",
+ _rv);
+ return _res;
+}
+
+static PyObject *Qd_ShieldCursor(_self, _args)
+ PyObject *_self;
+ PyObject *_args;
+{
+ PyObject *_res = NULL;
+ Rect shieldRect;
+ Point offsetPt;
+ if (!PyArg_ParseTuple(_args, "O&O&",
+ PyMac_GetRect, &shieldRect,
+ PyMac_GetPoint, &offsetPt))
+ return NULL;
+ ShieldCursor(&shieldRect,
+ offsetPt);
+ Py_INCREF(Py_None);
+ _res = Py_None;
+ return _res;
+}
+
+static PyObject *Qd_ScreenRes(_self, _args)
+ PyObject *_self;
+ PyObject *_args;
+{
+ PyObject *_res = NULL;
+ short scrnHRes;
+ short scrnVRes;
+ if (!PyArg_ParseTuple(_args, ""))
+ return NULL;
+ ScreenRes(&scrnHRes,
+ &scrnVRes);
+ _res = Py_BuildValue("hh",
+ scrnHRes,
+ scrnVRes);
+ return _res;
+}
+
static PyObject *Qd_TextFont(_self, _args)
PyObject *_self;
PyObject *_args;
@@ -2471,9 +2576,9 @@ static PyMethodDef Qd_methods[] = {
{"SetRect", (PyCFunction)Qd_SetRect, 1,
"(short left, short top, short right, short bottom) -> (Rect r)"},
{"OffsetRect", (PyCFunction)Qd_OffsetRect, 1,
- "(short dh, short dv) -> (Rect r)"},
+ "(Rect r, short dh, short dv) -> (Rect r)"},
{"InsetRect", (PyCFunction)Qd_InsetRect, 1,
- "(short dh, short dv) -> (Rect r)"},
+ "(Rect r, short dh, short dv) -> (Rect r)"},
{"SectRect", (PyCFunction)Qd_SectRect, 1,
"(Rect src1, Rect src2) -> (Boolean _rv, Rect dstRect)"},
{"UnionRect", (PyCFunction)Qd_UnionRect, 1,
@@ -2599,7 +2704,7 @@ static PyMethodDef Qd_methods[] = {
{"MapPt", (PyCFunction)Qd_MapPt, 1,
"(Point pt, Rect srcRect, Rect dstRect) -> (Point pt)"},
{"MapRect", (PyCFunction)Qd_MapRect, 1,
- "(Rect srcRect, Rect dstRect) -> (Rect r)"},
+ "(Rect r, Rect srcRect, Rect dstRect) -> (Rect r)"},
{"MapRgn", (PyCFunction)Qd_MapRgn, 1,
"(RgnHandle rgn, Rect srcRect, Rect dstRect) -> None"},
{"MapPoly", (PyCFunction)Qd_MapPoly, 1,
@@ -2662,6 +2767,18 @@ static PyMethodDef Qd_methods[] = {
"(short index, Boolean reserve) -> None"},
{"QDError", (PyCFunction)Qd_QDError, 1,
"() -> (short _rv)"},
+ {"GetPattern", (PyCFunction)Qd_GetPattern, 1,
+ "(short patternID) -> (PatHandle _rv)"},
+ {"GetCursor", (PyCFunction)Qd_GetCursor, 1,
+ "(short cursorID) -> (CursHandle _rv)"},
+ {"GetPicture", (PyCFunction)Qd_GetPicture, 1,
+ "(short pictureID) -> (PicHandle _rv)"},
+ {"DeltaPoint", (PyCFunction)Qd_DeltaPoint, 1,
+ "(Point ptA, Point ptB) -> (long _rv)"},
+ {"ShieldCursor", (PyCFunction)Qd_ShieldCursor, 1,
+ "(Rect shieldRect, Point offsetPt) -> None"},
+ {"ScreenRes", (PyCFunction)Qd_ScreenRes, 1,
+ "() -> (short scrnHRes, short scrnVRes)"},
{"TextFont", (PyCFunction)Qd_TextFont, 1,
"(short font) -> None"},
{"TextFace", (PyCFunction)Qd_TextFace, 1,
diff --git a/Mac/Modules/qd/qdgen.py b/Mac/Modules/qd/qdgen.py
index d7976f1..19e887d 100644
--- a/Mac/Modules/qd/qdgen.py
+++ b/Mac/Modules/qd/qdgen.py
@@ -1,4 +1,4 @@
-# Generated from 'Sap:CodeWarrior6:Metrowerks C/C++:Headers:Universal Headers 2.0.1f:QuickDraw.h'
+# Generated from 'Sap:CodeWarrior7:Metrowerks CodeWarrior:MacOS Support:Headers:Universal Headers:QuickDraw.h'
f = Function(void, 'OpenPort',
(GrafPtr, 'port', InMode),
@@ -156,14 +156,14 @@ f = Function(void, 'SetRect',
functions.append(f)
f = Function(void, 'OffsetRect',
- (Rect, 'r', OutMode),
+ (Rect, 'r', InOutMode),
(short, 'dh', InMode),
(short, 'dv', InMode),
)
functions.append(f)
f = Function(void, 'InsetRect',
- (Rect, 'r', OutMode),
+ (Rect, 'r', InOutMode),
(short, 'dh', InMode),
(short, 'dv', InMode),
)
@@ -530,7 +530,7 @@ f = Function(void, 'MapPt',
functions.append(f)
f = Function(void, 'MapRect',
- (Rect, 'r', OutMode),
+ (Rect, 'r', InOutMode),
(Rect_ptr, 'srcRect', InMode),
(Rect_ptr, 'dstRect', InMode),
)
@@ -713,7 +713,40 @@ f = Function(short, 'QDError',
)
functions.append(f)
-# Generated from 'Sap:CodeWarrior6:Metrowerks C/C++:Headers:Universal Headers 2.0.1f:QuickDrawText.h'
+f = Function(PatHandle, 'GetPattern',
+ (short, 'patternID', InMode),
+)
+functions.append(f)
+
+f = Function(CursHandle, 'GetCursor',
+ (short, 'cursorID', InMode),
+)
+functions.append(f)
+
+f = Function(PicHandle, 'GetPicture',
+ (short, 'pictureID', InMode),
+)
+functions.append(f)
+
+f = Function(long, 'DeltaPoint',
+ (Point, 'ptA', InMode),
+ (Point, 'ptB', InMode),
+)
+functions.append(f)
+
+f = Function(void, 'ShieldCursor',
+ (Rect_ptr, 'shieldRect', InMode),
+ (Point, 'offsetPt', InMode),
+)
+functions.append(f)
+
+f = Function(void, 'ScreenRes',
+ (short, 'scrnHRes', OutMode),
+ (short, 'scrnVRes', OutMode),
+)
+functions.append(f)
+
+# Generated from 'Sap:CodeWarrior7:Metrowerks CodeWarrior:MacOS Support:Headers:Universal Headers:QuickDrawText.h'
f = Function(void, 'TextFont',
(short, 'font', InMode),
diff --git a/Mac/Modules/qd/qdscan.py b/Mac/Modules/qd/qdscan.py
index 0e03d77..408c9c2 100644
--- a/Mac/Modules/qd/qdscan.py
+++ b/Mac/Modules/qd/qdscan.py
@@ -79,6 +79,7 @@ class MyScanner(Scanner):
'ColorSearchUPP',
'ConstPatternParam',
'Pattern_ptr',
+ 'Pattern',
'Cursor_ptr',
'DeviceLoopDrawingProcPtr',
'DeviceLoopFlags',
@@ -105,6 +106,22 @@ class MyScanner(Scanner):
([('Point', '*', 'OutMode')],
[('*', '*', 'InOutMode')]),
+
+ # InsetRect, OffsetRect
+ ([('Rect', 'r', 'OutMode'),
+ ('short', 'dh', 'InMode'),
+ ('short', 'dv', 'InMode')],
+ [('Rect', 'r', 'InOutMode'),
+ ('short', 'dh', 'InMode'),
+ ('short', 'dv', 'InMode')]),
+
+ # MapRect
+ ([('Rect', 'r', 'OutMode'),
+ ('Rect_ptr', 'srcRect', 'InMode'),
+ ('Rect_ptr', 'dstRect', 'InMode')],
+ [('Rect', 'r', 'InOutMode'),
+ ('Rect_ptr', 'srcRect', 'InMode'),
+ ('Rect_ptr', 'dstRect', 'InMode')]),
]
diff --git a/Mac/Modules/qd/qdsupport.py b/Mac/Modules/qd/qdsupport.py
index f3e7a9a..96d54f1 100644
--- a/Mac/Modules/qd/qdsupport.py
+++ b/Mac/Modules/qd/qdsupport.py
@@ -40,6 +40,8 @@ PicHandle = OpaqueByValueType("PicHandle", "ResObj")
PolyHandle = OpaqueByValueType("PolyHandle", "ResObj")
PixMapHandle = OpaqueByValueType("PixMapHandle", "ResObj")
PixPatHandle = OpaqueByValueType("PixPatHandle", "ResObj")
+PatHandle = OpaqueByValueType("PatHandle", "ResObj")
+CursHandle = OpaqueByValueType("CursHandle", "ResObj")
includestuff = includestuff + """
#include <%s>""" % MACHEADERFILE + """