summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1998-04-23 13:21:09 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1998-04-23 13:21:09 (GMT)
commit7f725e406147125eaeef0958cf9b489660f6eb52 (patch)
treecb4c06dd09b9818e1e189a57e797be4f536c123e
parentbbf4be2c2fee581606bb5fdeadefc8b104bc204f (diff)
downloadcpython-7f725e406147125eaeef0958cf9b489660f6eb52.zip
cpython-7f725e406147125eaeef0958cf9b489660f6eb52.tar.gz
cpython-7f725e406147125eaeef0958cf9b489660f6eb52.tar.bz2
SetPort was missing, and the defs file needs the FOUR_CHAR_CODE define.
-rw-r--r--Mac/Modules/qd/Qdmodule.c34
-rw-r--r--Mac/Modules/qd/qdedit.py20
-rw-r--r--Mac/Modules/qd/qdscan.py4
-rw-r--r--Mac/Modules/qd/qdsupport.py2
4 files changed, 39 insertions, 21 deletions
diff --git a/Mac/Modules/qd/Qdmodule.c b/Mac/Modules/qd/Qdmodule.c
index 94ddce5..9c73bc8 100644
--- a/Mac/Modules/qd/Qdmodule.c
+++ b/Mac/Modules/qd/Qdmodule.c
@@ -3833,6 +3833,36 @@ static PyObject *Qd_CharExtra(_self, _args)
return _res;
}
+static PyObject *Qd_SetPort(_self, _args)
+ PyObject *_self;
+ PyObject *_args;
+{
+ PyObject *_res = NULL;
+ WindowPtr thePort;
+ if (!PyArg_ParseTuple(_args, "O&",
+ WinObj_Convert, &thePort))
+ return NULL;
+ SetPort(thePort);
+ Py_INCREF(Py_None);
+ _res = Py_None;
+ return _res;
+}
+
+static PyObject *Qd_OpenDeskAcc(_self, _args)
+ PyObject *_self;
+ PyObject *_args;
+{
+ PyObject *_res = NULL;
+ Str255 name;
+ if (!PyArg_ParseTuple(_args, "O&",
+ PyMac_GetStr255, name))
+ return NULL;
+ OpenDeskAcc(name);
+ Py_INCREF(Py_None);
+ _res = Py_None;
+ return _res;
+}
+
static PyObject *Qd_BitMap(_self, _args)
PyObject *_self;
PyObject *_args;
@@ -4277,6 +4307,10 @@ static PyMethodDef Qd_methods[] = {
"() -> (FontInfo info)"},
{"CharExtra", (PyCFunction)Qd_CharExtra, 1,
"(Fixed extra) -> None"},
+ {"SetPort", (PyCFunction)Qd_SetPort, 1,
+ "(WindowPtr thePort) -> None"},
+ {"OpenDeskAcc", (PyCFunction)Qd_OpenDeskAcc, 1,
+ "(Str255 name) -> None"},
{"BitMap", (PyCFunction)Qd_BitMap, 1,
"Take (string, int, Rect) argument and create BitMap"},
{"RawBitMap", (PyCFunction)Qd_RawBitMap, 1,
diff --git a/Mac/Modules/qd/qdedit.py b/Mac/Modules/qd/qdedit.py
index 2242c5a..3139168 100644
--- a/Mac/Modules/qd/qdedit.py
+++ b/Mac/Modules/qd/qdedit.py
@@ -1,28 +1,8 @@
-f = Function(void, 'GlobalToLocal',
- (Point, 'thePoint', InOutMode),
-)
-functions.append(f)
-
-f = Function(void, 'LocalToGlobal',
- (Point, 'thePoint', InOutMode),
-)
-functions.append(f)
-
f = Function(void, 'SetPort',
(WindowPtr, 'thePort', InMode),
)
functions.append(f)
-f = Function(void, 'ClipRect',
- (Rect, 'r', InMode),
-)
-functions.append(f)
-
-f = Function(void, 'EraseRect',
- (Rect, 'r', InMode),
-)
-functions.append(f)
-
f = Function(void, 'OpenDeskAcc',
(Str255, 'name', InMode),
)
diff --git a/Mac/Modules/qd/qdscan.py b/Mac/Modules/qd/qdscan.py
index 86f69aa..81a5b1c 100644
--- a/Mac/Modules/qd/qdscan.py
+++ b/Mac/Modules/qd/qdscan.py
@@ -60,6 +60,10 @@ class MyScanner(Scanner):
## listname = "r_methods"
return classname, listname
+
+ def writeinitialdefs(self):
+ self.defsfile.write("def FOUR_CHAR_CODE(x): return x\n")
+
def makeblacklistnames(self):
return [
'InitGraf',
diff --git a/Mac/Modules/qd/qdsupport.py b/Mac/Modules/qd/qdsupport.py
index 9b1151b..7f1db82 100644
--- a/Mac/Modules/qd/qdsupport.py
+++ b/Mac/Modules/qd/qdsupport.py
@@ -302,7 +302,7 @@ Method = OSErrMethodGenerator
functions = []
methods = []
execfile(INPUTFILE)
-#execfile(EXTRAFILE)
+execfile(EXTRAFILE)
# add the populated lists to the generator groups
# (in a different wordl the scan program would generate this)