diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 1995-06-06 13:08:40 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 1995-06-06 13:08:40 (GMT) |
commit | b81cf9d61c71f9b5949b9424cec1f59ac4a426e8 (patch) | |
tree | 2b8fdc1f0dfd48b31a650f5a41864a8dc0b5ea7e /Mac/Modules/qd | |
parent | ae8a68f40cd56aa952520260970ebd5b9d3fb95c (diff) | |
download | cpython-b81cf9d61c71f9b5949b9424cec1f59ac4a426e8.zip cpython-b81cf9d61c71f9b5949b9424cec1f59ac4a426e8.tar.gz cpython-b81cf9d61c71f9b5949b9424cec1f59ac4a426e8.tar.bz2 |
Trying again to check it in. Changes to:
- Use Universal Headers as input
- Change addpack calls to not depend on Guido's disklayout
- Checkge testprograms to use new names for some functions
Diffstat (limited to 'Mac/Modules/qd')
-rw-r--r-- | Mac/Modules/qd/Qdmodule.c | 524 | ||||
-rw-r--r-- | Mac/Modules/qd/qdgen.py | 154 | ||||
-rw-r--r-- | Mac/Modules/qd/qdscan.py | 32 | ||||
-rw-r--r-- | Mac/Modules/qd/qdsupport.py | 2 |
4 files changed, 349 insertions, 363 deletions
diff --git a/Mac/Modules/qd/Qdmodule.c b/Mac/Modules/qd/Qdmodule.c index 959df31..c1e5c8e 100644 --- a/Mac/Modules/qd/Qdmodule.c +++ b/Mac/Modules/qd/Qdmodule.c @@ -438,192 +438,6 @@ static PyObject *Qd_Line(_self, _args) return _res; } -static PyObject *Qd_TextFont(_self, _args) - PyObject *_self; - PyObject *_args; -{ - PyObject *_res = NULL; - short font; - if (!PyArg_ParseTuple(_args, "h", - &font)) - return NULL; - TextFont(font); - Py_INCREF(Py_None); - _res = Py_None; - return _res; -} - -static PyObject *Qd_TextFace(_self, _args) - PyObject *_self; - PyObject *_args; -{ - PyObject *_res = NULL; - short face; - if (!PyArg_ParseTuple(_args, "h", - &face)) - return NULL; - TextFace(face); - Py_INCREF(Py_None); - _res = Py_None; - return _res; -} - -static PyObject *Qd_TextMode(_self, _args) - PyObject *_self; - PyObject *_args; -{ - PyObject *_res = NULL; - short mode; - if (!PyArg_ParseTuple(_args, "h", - &mode)) - return NULL; - TextMode(mode); - Py_INCREF(Py_None); - _res = Py_None; - return _res; -} - -static PyObject *Qd_TextSize(_self, _args) - PyObject *_self; - PyObject *_args; -{ - PyObject *_res = NULL; - short size; - if (!PyArg_ParseTuple(_args, "h", - &size)) - return NULL; - TextSize(size); - Py_INCREF(Py_None); - _res = Py_None; - return _res; -} - -static PyObject *Qd_SpaceExtra(_self, _args) - PyObject *_self; - PyObject *_args; -{ - PyObject *_res = NULL; - long extra; - if (!PyArg_ParseTuple(_args, "l", - &extra)) - return NULL; - SpaceExtra(extra); - Py_INCREF(Py_None); - _res = Py_None; - return _res; -} - -static PyObject *Qd_DrawChar(_self, _args) - PyObject *_self; - PyObject *_args; -{ - PyObject *_res = NULL; - short ch; - if (!PyArg_ParseTuple(_args, "h", - &ch)) - return NULL; - DrawChar(ch); - Py_INCREF(Py_None); - _res = Py_None; - return _res; -} - -static PyObject *Qd_DrawString(_self, _args) - PyObject *_self; - PyObject *_args; -{ - PyObject *_res = NULL; - Str255 s; - if (!PyArg_ParseTuple(_args, "O&", - PyMac_GetStr255, s)) - return NULL; - DrawString(s); - Py_INCREF(Py_None); - _res = Py_None; - return _res; -} - -static PyObject *Qd_DrawText(_self, _args) - PyObject *_self; - PyObject *_args; -{ - PyObject *_res = NULL; - char *textBuf__in__; - int textBuf__len__; - int textBuf__in_len__; - short firstByte; - short byteCount; - if (!PyArg_ParseTuple(_args, "s#hh", - &textBuf__in__, &textBuf__in_len__, - &firstByte, - &byteCount)) - return NULL; - DrawText(textBuf__in__, - firstByte, - byteCount); - Py_INCREF(Py_None); - _res = Py_None; - textBuf__error__: ; - return _res; -} - -static PyObject *Qd_CharWidth(_self, _args) - PyObject *_self; - PyObject *_args; -{ - PyObject *_res = NULL; - short _rv; - short ch; - if (!PyArg_ParseTuple(_args, "h", - &ch)) - return NULL; - _rv = CharWidth(ch); - _res = Py_BuildValue("h", - _rv); - return _res; -} - -static PyObject *Qd_StringWidth(_self, _args) - PyObject *_self; - PyObject *_args; -{ - PyObject *_res = NULL; - short _rv; - Str255 s; - if (!PyArg_ParseTuple(_args, "O&", - PyMac_GetStr255, s)) - return NULL; - _rv = StringWidth(s); - _res = Py_BuildValue("h", - _rv); - return _res; -} - -static PyObject *Qd_TextWidth(_self, _args) - PyObject *_self; - PyObject *_args; -{ - PyObject *_res = NULL; - short _rv; - char *textBuf__in__; - int textBuf__len__; - int textBuf__in_len__; - short firstByte; - short byteCount; - if (!PyArg_ParseTuple(_args, "s#hh", - &textBuf__in__, &textBuf__in_len__, - &firstByte, - &byteCount)) - return NULL; - _rv = TextWidth(textBuf__in__, - firstByte, - byteCount); - _res = Py_BuildValue("h", - _rv); - textBuf__error__: ; - return _res; -} - static PyObject *Qd_ForeColor(_self, _args) PyObject *_self; PyObject *_args; @@ -1989,6 +1803,24 @@ static PyObject *Qd_PtToAngle(_self, _args) return _res; } +static PyObject *Qd_SubPt(_self, _args) + PyObject *_self; + PyObject *_args; +{ + PyObject *_res = NULL; + Point src; + Point dst; + if (!PyArg_ParseTuple(_args, "O&O&", + PyMac_GetPoint, &src, + PyMac_GetPoint, &dst)) + return NULL; + SubPt(src, + &dst); + _res = Py_BuildValue("O&", + PyMac_BuildPoint, dst); + return _res; +} + static PyObject *Qd_PtInRgn(_self, _args) PyObject *_self; PyObject *_args; @@ -2022,21 +1854,6 @@ static PyObject *Qd_NewPixMap(_self, _args) return _res; } -static PyObject *Qd_DisposPixMap(_self, _args) - PyObject *_self; - PyObject *_args; -{ - PyObject *_res = NULL; - PixMapHandle pm; - if (!PyArg_ParseTuple(_args, "O&", - ResObj_Convert, &pm)) - return NULL; - DisposPixMap(pm); - Py_INCREF(Py_None); - _res = Py_None; - return _res; -} - static PyObject *Qd_DisposePixMap(_self, _args) PyObject *_self; PyObject *_args; @@ -2084,21 +1901,6 @@ static PyObject *Qd_NewPixPat(_self, _args) return _res; } -static PyObject *Qd_DisposPixPat(_self, _args) - PyObject *_self; - PyObject *_args; -{ - PyObject *_res = NULL; - PixPatHandle pp; - if (!PyArg_ParseTuple(_args, "O&", - ResObj_Convert, &pp)) - return NULL; - DisposPixPat(pp); - Py_INCREF(Py_None); - _res = Py_None; - return _res; -} - static PyObject *Qd_DisposePixPat(_self, _args) PyObject *_self; PyObject *_args; @@ -2326,21 +2128,6 @@ static PyObject *Qd_AllocCursor(_self, _args) return _res; } -static PyObject *Qd_CharExtra(_self, _args) - PyObject *_self; - PyObject *_args; -{ - PyObject *_res = NULL; - long extra; - if (!PyArg_ParseTuple(_args, "l", - &extra)) - return NULL; - CharExtra(extra); - Py_INCREF(Py_None); - _res = Py_None; - return _res; -} - static PyObject *Qd_GetCTSeed(_self, _args) PyObject *_self; PyObject *_args; @@ -2355,24 +2142,6 @@ static PyObject *Qd_GetCTSeed(_self, _args) return _res; } -static PyObject *Qd_SubPt(_self, _args) - PyObject *_self; - PyObject *_args; -{ - PyObject *_res = NULL; - Point src; - Point dst; - if (!PyArg_ParseTuple(_args, "O&O&", - PyMac_GetPoint, &src, - PyMac_GetPoint, &dst)) - return NULL; - SubPt(src, - &dst); - _res = Py_BuildValue("O&", - PyMac_BuildPoint, dst); - return _res; -} - static PyObject *Qd_SetClientID(_self, _args) PyObject *_self; PyObject *_args; @@ -2438,6 +2207,207 @@ static PyObject *Qd_QDError(_self, _args) return _res; } +static PyObject *Qd_TextFont(_self, _args) + PyObject *_self; + PyObject *_args; +{ + PyObject *_res = NULL; + short font; + if (!PyArg_ParseTuple(_args, "h", + &font)) + return NULL; + TextFont(font); + Py_INCREF(Py_None); + _res = Py_None; + return _res; +} + +static PyObject *Qd_TextFace(_self, _args) + PyObject *_self; + PyObject *_args; +{ + PyObject *_res = NULL; + short face; + if (!PyArg_ParseTuple(_args, "h", + &face)) + return NULL; + TextFace(face); + Py_INCREF(Py_None); + _res = Py_None; + return _res; +} + +static PyObject *Qd_TextMode(_self, _args) + PyObject *_self; + PyObject *_args; +{ + PyObject *_res = NULL; + short mode; + if (!PyArg_ParseTuple(_args, "h", + &mode)) + return NULL; + TextMode(mode); + Py_INCREF(Py_None); + _res = Py_None; + return _res; +} + +static PyObject *Qd_TextSize(_self, _args) + PyObject *_self; + PyObject *_args; +{ + PyObject *_res = NULL; + short size; + if (!PyArg_ParseTuple(_args, "h", + &size)) + return NULL; + TextSize(size); + Py_INCREF(Py_None); + _res = Py_None; + return _res; +} + +static PyObject *Qd_SpaceExtra(_self, _args) + PyObject *_self; + PyObject *_args; +{ + PyObject *_res = NULL; + long extra; + if (!PyArg_ParseTuple(_args, "l", + &extra)) + return NULL; + SpaceExtra(extra); + Py_INCREF(Py_None); + _res = Py_None; + return _res; +} + +static PyObject *Qd_DrawChar(_self, _args) + PyObject *_self; + PyObject *_args; +{ + PyObject *_res = NULL; + short ch; + if (!PyArg_ParseTuple(_args, "h", + &ch)) + return NULL; + DrawChar(ch); + Py_INCREF(Py_None); + _res = Py_None; + return _res; +} + +static PyObject *Qd_DrawString(_self, _args) + PyObject *_self; + PyObject *_args; +{ + PyObject *_res = NULL; + Str255 s; + if (!PyArg_ParseTuple(_args, "O&", + PyMac_GetStr255, s)) + return NULL; + DrawString(s); + Py_INCREF(Py_None); + _res = Py_None; + return _res; +} + +static PyObject *Qd_DrawText(_self, _args) + PyObject *_self; + PyObject *_args; +{ + PyObject *_res = NULL; + char *textBuf__in__; + int textBuf__len__; + int textBuf__in_len__; + short firstByte; + short byteCount; + if (!PyArg_ParseTuple(_args, "s#hh", + &textBuf__in__, &textBuf__in_len__, + &firstByte, + &byteCount)) + return NULL; + DrawText(textBuf__in__, + firstByte, + byteCount); + Py_INCREF(Py_None); + _res = Py_None; + textBuf__error__: ; + return _res; +} + +static PyObject *Qd_CharWidth(_self, _args) + PyObject *_self; + PyObject *_args; +{ + PyObject *_res = NULL; + short _rv; + short ch; + if (!PyArg_ParseTuple(_args, "h", + &ch)) + return NULL; + _rv = CharWidth(ch); + _res = Py_BuildValue("h", + _rv); + return _res; +} + +static PyObject *Qd_StringWidth(_self, _args) + PyObject *_self; + PyObject *_args; +{ + PyObject *_res = NULL; + short _rv; + Str255 s; + if (!PyArg_ParseTuple(_args, "O&", + PyMac_GetStr255, s)) + return NULL; + _rv = StringWidth(s); + _res = Py_BuildValue("h", + _rv); + return _res; +} + +static PyObject *Qd_TextWidth(_self, _args) + PyObject *_self; + PyObject *_args; +{ + PyObject *_res = NULL; + short _rv; + char *textBuf__in__; + int textBuf__len__; + int textBuf__in_len__; + short firstByte; + short byteCount; + if (!PyArg_ParseTuple(_args, "s#hh", + &textBuf__in__, &textBuf__in_len__, + &firstByte, + &byteCount)) + return NULL; + _rv = TextWidth(textBuf__in__, + firstByte, + byteCount); + _res = Py_BuildValue("h", + _rv); + textBuf__error__: ; + return _res; +} + +static PyObject *Qd_CharExtra(_self, _args) + PyObject *_self; + PyObject *_args; +{ + PyObject *_res = NULL; + long extra; + if (!PyArg_ParseTuple(_args, "l", + &extra)) + return NULL; + CharExtra(extra); + Py_INCREF(Py_None); + _res = Py_None; + return _res; +} + static PyMethodDef Qd_methods[] = { {"OpenPort", (PyCFunction)Qd_OpenPort, 1, "(WindowPtr port) -> None"}, @@ -2491,28 +2461,6 @@ static PyMethodDef Qd_methods[] = { "(short h, short v) -> None"}, {"Line", (PyCFunction)Qd_Line, 1, "(short dh, short dv) -> None"}, - {"TextFont", (PyCFunction)Qd_TextFont, 1, - "(short font) -> None"}, - {"TextFace", (PyCFunction)Qd_TextFace, 1, - "(short face) -> None"}, - {"TextMode", (PyCFunction)Qd_TextMode, 1, - "(short mode) -> None"}, - {"TextSize", (PyCFunction)Qd_TextSize, 1, - "(short size) -> None"}, - {"SpaceExtra", (PyCFunction)Qd_SpaceExtra, 1, - "(long extra) -> None"}, - {"DrawChar", (PyCFunction)Qd_DrawChar, 1, - "(short ch) -> None"}, - {"DrawString", (PyCFunction)Qd_DrawString, 1, - "(Str255 s) -> None"}, - {"DrawText", (PyCFunction)Qd_DrawText, 1, - "(Buffer textBuf, short firstByte, short byteCount) -> None"}, - {"CharWidth", (PyCFunction)Qd_CharWidth, 1, - "(short ch) -> (short _rv)"}, - {"StringWidth", (PyCFunction)Qd_StringWidth, 1, - "(Str255 s) -> (short _rv)"}, - {"TextWidth", (PyCFunction)Qd_TextWidth, 1, - "(Buffer textBuf, short firstByte, short byteCount) -> (short _rv)"}, {"ForeColor", (PyCFunction)Qd_ForeColor, 1, "(long color) -> None"}, {"BackColor", (PyCFunction)Qd_BackColor, 1, @@ -2665,20 +2613,18 @@ static PyMethodDef Qd_methods[] = { "(Point pt1, Point pt2) -> (Rect dstRect)"}, {"PtToAngle", (PyCFunction)Qd_PtToAngle, 1, "(Rect r, Point pt) -> (short angle)"}, + {"SubPt", (PyCFunction)Qd_SubPt, 1, + "(Point src, Point dst) -> (Point dst)"}, {"PtInRgn", (PyCFunction)Qd_PtInRgn, 1, "(Point pt, RgnHandle rgn) -> (Boolean _rv)"}, {"NewPixMap", (PyCFunction)Qd_NewPixMap, 1, "() -> (PixMapHandle _rv)"}, - {"DisposPixMap", (PyCFunction)Qd_DisposPixMap, 1, - "(PixMapHandle pm) -> None"}, {"DisposePixMap", (PyCFunction)Qd_DisposePixMap, 1, "(PixMapHandle pm) -> None"}, {"CopyPixMap", (PyCFunction)Qd_CopyPixMap, 1, "(PixMapHandle srcPM, PixMapHandle dstPM) -> None"}, {"NewPixPat", (PyCFunction)Qd_NewPixPat, 1, "() -> (PixPatHandle _rv)"}, - {"DisposPixPat", (PyCFunction)Qd_DisposPixPat, 1, - "(PixPatHandle pp) -> None"}, {"DisposePixPat", (PyCFunction)Qd_DisposePixPat, 1, "(PixPatHandle pp) -> None"}, {"CopyPixPat", (PyCFunction)Qd_CopyPixPat, 1, @@ -2705,12 +2651,8 @@ static PyMethodDef Qd_methods[] = { "(PixMapHandle pm) -> None"}, {"AllocCursor", (PyCFunction)Qd_AllocCursor, 1, "() -> None"}, - {"CharExtra", (PyCFunction)Qd_CharExtra, 1, - "(long extra) -> None"}, {"GetCTSeed", (PyCFunction)Qd_GetCTSeed, 1, "() -> (long _rv)"}, - {"SubPt", (PyCFunction)Qd_SubPt, 1, - "(Point src, Point dst) -> (Point dst)"}, {"SetClientID", (PyCFunction)Qd_SetClientID, 1, "(short id) -> None"}, {"ProtectEntry", (PyCFunction)Qd_ProtectEntry, 1, @@ -2719,6 +2661,30 @@ static PyMethodDef Qd_methods[] = { "(short index, Boolean reserve) -> None"}, {"QDError", (PyCFunction)Qd_QDError, 1, "() -> (short _rv)"}, + {"TextFont", (PyCFunction)Qd_TextFont, 1, + "(short font) -> None"}, + {"TextFace", (PyCFunction)Qd_TextFace, 1, + "(short face) -> None"}, + {"TextMode", (PyCFunction)Qd_TextMode, 1, + "(short mode) -> None"}, + {"TextSize", (PyCFunction)Qd_TextSize, 1, + "(short size) -> None"}, + {"SpaceExtra", (PyCFunction)Qd_SpaceExtra, 1, + "(long extra) -> None"}, + {"DrawChar", (PyCFunction)Qd_DrawChar, 1, + "(short ch) -> None"}, + {"DrawString", (PyCFunction)Qd_DrawString, 1, + "(Str255 s) -> None"}, + {"DrawText", (PyCFunction)Qd_DrawText, 1, + "(Buffer textBuf, short firstByte, short byteCount) -> None"}, + {"CharWidth", (PyCFunction)Qd_CharWidth, 1, + "(short ch) -> (short _rv)"}, + {"StringWidth", (PyCFunction)Qd_StringWidth, 1, + "(Str255 s) -> (short _rv)"}, + {"TextWidth", (PyCFunction)Qd_TextWidth, 1, + "(Buffer textBuf, short firstByte, short byteCount) -> (short _rv)"}, + {"CharExtra", (PyCFunction)Qd_CharExtra, 1, + "(long extra) -> None"}, {NULL, NULL, 0} }; diff --git a/Mac/Modules/qd/qdgen.py b/Mac/Modules/qd/qdgen.py index 975e438..612b9e7 100644 --- a/Mac/Modules/qd/qdgen.py +++ b/Mac/Modules/qd/qdgen.py @@ -1,4 +1,4 @@ -# Generated from 'D:Development:THINK C:Mac #includes:Apple #includes:QuickDraw.h' +# Generated from 'Moes:CW5 GOLD \304:Metrowerks C/C++ \304:Headers \304:Universal Headers 2.0a3 \304:QuickDraw.h' f = Function(void, 'OpenPort', (GrafPtr, 'port', InMode), @@ -131,65 +131,6 @@ f = Function(void, 'Line', ) functions.append(f) -f = Function(void, 'TextFont', - (short, 'font', InMode), -) -functions.append(f) - -f = Function(void, 'TextFace', - (short, 'face', InMode), -) -functions.append(f) - -f = Function(void, 'TextMode', - (short, 'mode', InMode), -) -functions.append(f) - -f = Function(void, 'TextSize', - (short, 'size', InMode), -) -functions.append(f) - -f = Function(void, 'SpaceExtra', - (Fixed, 'extra', InMode), -) -functions.append(f) - -f = Function(void, 'DrawChar', - (short, 'ch', InMode), -) -functions.append(f) - -f = Function(void, 'DrawString', - (ConstStr255Param, 's', InMode), -) -functions.append(f) - -f = Function(void, 'DrawText', - (TextThingie, 'textBuf', InMode), - (short, 'firstByte', InMode), - (short, 'byteCount', InMode), -) -functions.append(f) - -f = Function(short, 'CharWidth', - (short, 'ch', InMode), -) -functions.append(f) - -f = Function(short, 'StringWidth', - (ConstStr255Param, 's', InMode), -) -functions.append(f) - -f = Function(short, 'TextWidth', - (TextThingie, 'textBuf', InMode), - (short, 'firstByte', InMode), - (short, 'byteCount', InMode), -) -functions.append(f) - f = Function(void, 'ForeColor', (long, 'color', InMode), ) @@ -641,6 +582,12 @@ f = Function(void, 'PtToAngle', ) functions.append(f) +f = Function(void, 'SubPt', + (Point, 'src', InMode), + (Point, 'dst', InOutMode), +) +functions.append(f) + f = Function(Boolean, 'PtInRgn', (Point, 'pt', InMode), (RgnHandle, 'rgn', InMode), @@ -651,11 +598,6 @@ f = Function(PixMapHandle, 'NewPixMap', ) functions.append(f) -f = Function(void, 'DisposPixMap', - (PixMapHandle, 'pm', InMode), -) -functions.append(f) - f = Function(void, 'DisposePixMap', (PixMapHandle, 'pm', InMode), ) @@ -671,11 +613,6 @@ f = Function(PixPatHandle, 'NewPixPat', ) functions.append(f) -f = Function(void, 'DisposPixPat', - (PixPatHandle, 'pp', InMode), -) -functions.append(f) - f = Function(void, 'DisposePixPat', (PixPatHandle, 'pp', InMode), ) @@ -751,21 +688,10 @@ f = Function(void, 'AllocCursor', ) functions.append(f) -f = Function(void, 'CharExtra', - (Fixed, 'extra', InMode), -) -functions.append(f) - f = Function(long, 'GetCTSeed', ) functions.append(f) -f = Function(void, 'SubPt', - (Point, 'src', InMode), - (Point, 'dst', InOutMode), -) -functions.append(f) - f = Function(void, 'SetClientID', (short, 'id', InMode), ) @@ -787,3 +713,69 @@ f = Function(short, 'QDError', ) functions.append(f) +# Generated from 'Moes:CW5 GOLD \304:Metrowerks C/C++ \304:Headers \304:Universal Headers 2.0a3 \304:QuickDrawText.h' + +f = Function(void, 'TextFont', + (short, 'font', InMode), +) +functions.append(f) + +f = Function(void, 'TextFace', + (short, 'face', InMode), +) +functions.append(f) + +f = Function(void, 'TextMode', + (short, 'mode', InMode), +) +functions.append(f) + +f = Function(void, 'TextSize', + (short, 'size', InMode), +) +functions.append(f) + +f = Function(void, 'SpaceExtra', + (Fixed, 'extra', InMode), +) +functions.append(f) + +f = Function(void, 'DrawChar', + (short, 'ch', InMode), +) +functions.append(f) + +f = Function(void, 'DrawString', + (ConstStr255Param, 's', InMode), +) +functions.append(f) + +f = Function(void, 'DrawText', + (TextThingie, 'textBuf', InMode), + (short, 'firstByte', InMode), + (short, 'byteCount', InMode), +) +functions.append(f) + +f = Function(short, 'CharWidth', + (short, 'ch', InMode), +) +functions.append(f) + +f = Function(short, 'StringWidth', + (ConstStr255Param, 's', InMode), +) +functions.append(f) + +f = Function(short, 'TextWidth', + (TextThingie, 'textBuf', InMode), + (short, 'firstByte', InMode), + (short, 'byteCount', InMode), +) +functions.append(f) + +f = Function(void, 'CharExtra', + (Fixed, 'extra', InMode), +) +functions.append(f) + diff --git a/Mac/Modules/qd/qdscan.py b/Mac/Modules/qd/qdscan.py index 057db6d..48766f2 100644 --- a/Mac/Modules/qd/qdscan.py +++ b/Mac/Modules/qd/qdscan.py @@ -1,7 +1,7 @@ # Scan an Apple header file, generating a Python file of generator calls. import addpack -addpack.addpack('D:python:Tools:bgen:bgen') +addpack.addpack(':Tools:bgen:bgen') from scantools import Scanner @@ -12,6 +12,32 @@ def main(): scanner = MyScanner(input, output, defsoutput) scanner.scan() scanner.close() + + # Grmpf. Universal Headers have Text-stuff in a different include file... + input = "QuickDrawText.h" + output = "@qdgentext.py" + defsoutput = "@QuickDrawText.py" + have_extra = 0 + try: + scanner = MyScanner(input, output, defsoutput) + scanner.scan() + scanner.close() + have_extra = 1 + except IOError: + pass + if have_extra: + print "=== Copying QuickDrawText stuff into main files... ===" + ifp = open("@qdgentext.py") + ofp = open("qdgen.py", "a") + ofp.write(ifp.read()) + ifp.close() + ofp.close() + ifp = open("@QuickDrawText.py") + ofp = open("QuickDraw.py", "a") + ofp.write(ifp.read()) + ifp.close() + ofp.close() + print "=== Done scanning and generating, now importing the generated code... ===" import qdsupport print "=== Done. It's up to you to compile it now! ===" @@ -23,7 +49,7 @@ class MyScanner(Scanner): listname = "functions" if arglist: t, n, m = arglist[0] - if t in ("WindowPtr", "WindowPeek") and m == "InMode": + if t in ("WindowPtr", "WindowPeek", "WindowRef") and m == "InMode": classname = "Method" listname = "methods" return classname, listname @@ -48,7 +74,9 @@ class MyScanner(Scanner): 'CSpecArray', 'CTabHandle', 'ColorComplementProcPtr', + 'ColorComplementUPP', 'ColorSearchProcPtr', + 'ColorSearchUPP', 'ConstPatternParam', 'Cursor_ptr', 'DeviceLoopDrawingProcPtr', diff --git a/Mac/Modules/qd/qdsupport.py b/Mac/Modules/qd/qdsupport.py index 0aa439c..f3e7a9a 100644 --- a/Mac/Modules/qd/qdsupport.py +++ b/Mac/Modules/qd/qdsupport.py @@ -6,7 +6,7 @@ import string import addpack -addpack.addpack('D:python:Tools:bgen:bgen') +addpack.addpack(':Tools:bgen:bgen') # Declarations that change for each manager MACHEADERFILE = 'QuickDraw.h' # The Apple header file |