Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7f725e4

Browse files
committed
SetPort was missing, and the defs file needs the FOUR_CHAR_CODE define.
1 parent bbf4be2 commit 7f725e4

4 files changed

Lines changed: 39 additions & 21 deletions

File tree

Mac/Modules/qd/Qdmodule.c

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3833,6 +3833,36 @@ static PyObject *Qd_CharExtra(_self, _args)
38333833
return _res;
38343834
}
38353835

3836+
static PyObject *Qd_SetPort(_self, _args)
3837+
PyObject *_self;
3838+
PyObject *_args;
3839+
{
3840+
PyObject *_res = NULL;
3841+
WindowPtr thePort;
3842+
if (!PyArg_ParseTuple(_args, "O&",
3843+
WinObj_Convert, &thePort))
3844+
return NULL;
3845+
SetPort(thePort);
3846+
Py_INCREF(Py_None);
3847+
_res = Py_None;
3848+
return _res;
3849+
}
3850+
3851+
static PyObject *Qd_OpenDeskAcc(_self, _args)
3852+
PyObject *_self;
3853+
PyObject *_args;
3854+
{
3855+
PyObject *_res = NULL;
3856+
Str255 name;
3857+
if (!PyArg_ParseTuple(_args, "O&",
3858+
PyMac_GetStr255, name))
3859+
return NULL;
3860+
OpenDeskAcc(name);
3861+
Py_INCREF(Py_None);
3862+
_res = Py_None;
3863+
return _res;
3864+
}
3865+
38363866
static PyObject *Qd_BitMap(_self, _args)
38373867
PyObject *_self;
38383868
PyObject *_args;
@@ -4277,6 +4307,10 @@ static PyMethodDef Qd_methods[] = {
42774307
"() -> (FontInfo info)"},
42784308
{"CharExtra", (PyCFunction)Qd_CharExtra, 1,
42794309
"(Fixed extra) -> None"},
4310+
{"SetPort", (PyCFunction)Qd_SetPort, 1,
4311+
"(WindowPtr thePort) -> None"},
4312+
{"OpenDeskAcc", (PyCFunction)Qd_OpenDeskAcc, 1,
4313+
"(Str255 name) -> None"},
42804314
{"BitMap", (PyCFunction)Qd_BitMap, 1,
42814315
"Take (string, int, Rect) argument and create BitMap"},
42824316
{"RawBitMap", (PyCFunction)Qd_RawBitMap, 1,

Mac/Modules/qd/qdedit.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,8 @@
1-
f = Function(void, 'GlobalToLocal',
2-
(Point, 'thePoint', InOutMode),
3-
)
4-
functions.append(f)
5-
6-
f = Function(void, 'LocalToGlobal',
7-
(Point, 'thePoint', InOutMode),
8-
)
9-
functions.append(f)
10-
111
f = Function(void, 'SetPort',
122
(WindowPtr, 'thePort', InMode),
133
)
144
functions.append(f)
155

16-
f = Function(void, 'ClipRect',
17-
(Rect, 'r', InMode),
18-
)
19-
functions.append(f)
20-
21-
f = Function(void, 'EraseRect',
22-
(Rect, 'r', InMode),
23-
)
24-
functions.append(f)
25-
266
f = Function(void, 'OpenDeskAcc',
277
(Str255, 'name', InMode),
288
)

Mac/Modules/qd/qdscan.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ def destination(self, type, name, arglist):
6060
## listname = "r_methods"
6161
return classname, listname
6262

63+
64+
def writeinitialdefs(self):
65+
self.defsfile.write("def FOUR_CHAR_CODE(x): return x\n")
66+
6367
def makeblacklistnames(self):
6468
return [
6569
'InitGraf',

Mac/Modules/qd/qdsupport.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ def outputGetattrHook(self):
302302
functions = []
303303
methods = []
304304
execfile(INPUTFILE)
305-
#execfile(EXTRAFILE)
305+
execfile(EXTRAFILE)
306306

307307
# add the populated lists to the generator groups
308308
# (in a different wordl the scan program would generate this)

0 commit comments

Comments
 (0)