diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 1996-04-12 16:29:23 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 1996-04-12 16:29:23 (GMT) |
commit | 46d9e79de61047ca4b1cc89aeded8a4b47972bf5 (patch) | |
tree | eba59d4ffd410bdf18068b0f3161b2856f4b8498 /Mac/Modules/te | |
parent | 819fa1a794bf642da0b9bc6e345a784ab6bc3fa8 (diff) | |
download | cpython-46d9e79de61047ca4b1cc89aeded8a4b47972bf5.zip cpython-46d9e79de61047ca4b1cc89aeded8a4b47972bf5.tar.gz cpython-46d9e79de61047ca4b1cc89aeded8a4b47972bf5.tar.bz2 |
bgen-generators now drop the python definition file straight in the
Lib:toolbox folder.
Diffstat (limited to 'Mac/Modules/te')
-rw-r--r-- | Mac/Modules/te/TEmodule.c | 26 | ||||
-rw-r--r-- | Mac/Modules/te/tescan.py | 3 | ||||
-rw-r--r-- | Mac/Modules/te/tesupport.py | 28 |
3 files changed, 56 insertions, 1 deletions
diff --git a/Mac/Modules/te/TEmodule.c b/Mac/Modules/te/TEmodule.c index 5b54822..9d14b09 100644 --- a/Mac/Modules/te/TEmodule.c +++ b/Mac/Modules/te/TEmodule.c @@ -805,6 +805,32 @@ static PyObject *TEObj_getattr(self, name) TEObject *self; char *name; { + + if( strcmp(name, "destRect") == 0 ) + return Py_BuildValue("O&", PyMac_BuildRect, + (*self->ob_itself)->destRect); + if( strcmp(name, "viewRect") == 0 ) + return Py_BuildValue("O&", PyMac_BuildRect, + (*self->ob_itself)->viewRect); + if( strcmp(name, "selRect") == 0 ) + return Py_BuildValue("O&", PyMac_BuildRect, + (*self->ob_itself)->selRect); + if( strcmp(name, "lineHeight") == 0 ) + return Py_BuildValue("h", (*self->ob_itself)->lineHeight); + if( strcmp(name, "fontAscent") == 0 ) + return Py_BuildValue("h", (*self->ob_itself)->fontAscent); + if( strcmp(name, "selPoint") == 0 ) + return Py_BuildValue("O&", PyMac_BuildPoint, + (*self->ob_itself)->selPoint); + if( strcmp(name, "selStart") == 0 ) + return Py_BuildValue("h", (*self->ob_itself)->selStart); + if( strcmp(name, "selEnd") == 0 ) + return Py_BuildValue("h", (*self->ob_itself)->selEnd); + if( strcmp(name, "active") == 0 ) + return Py_BuildValue("h", (*self->ob_itself)->active); + if( strcmp(name, "teLength") == 0 ) + return Py_BuildValue("h", (*self->ob_itself)->teLength); + return Py_FindMethodInChain(&TEObj_chain, (PyObject *)self, name); } diff --git a/Mac/Modules/te/tescan.py b/Mac/Modules/te/tescan.py index e7bb74b..8d919e8 100644 --- a/Mac/Modules/te/tescan.py +++ b/Mac/Modules/te/tescan.py @@ -3,6 +3,7 @@ import addpack addpack.addpack(':tools:bgen:bgen') from scantools import Scanner +from bgenlocations import TOOLBOXDIR LONG = "TextEdit" SHORT = "te" @@ -11,7 +12,7 @@ OBJECT = "TEHandle" def main(): input = LONG + ".h" output = SHORT + "gen.py" - defsoutput = LONG + ".py" + defsoutput = TOOLBOXDIR + LONG + ".py" scanner = MyScanner(input, output, defsoutput) scanner.scan() scanner.close() diff --git a/Mac/Modules/te/tesupport.py b/Mac/Modules/te/tesupport.py index eda089c..daadea0 100644 --- a/Mac/Modules/te/tesupport.py +++ b/Mac/Modules/te/tesupport.py @@ -86,6 +86,34 @@ class MyObjectDefinition(GlobalObjectDefinition): }""") def outputFreeIt(self, itselfname): Output("TEDispose(%s);", itselfname) + + def outputGetattrHook(self): + Output(""" + if( strcmp(name, "destRect") == 0 ) + return Py_BuildValue("O&", PyMac_BuildRect, + (*self->ob_itself)->destRect); + if( strcmp(name, "viewRect") == 0 ) + return Py_BuildValue("O&", PyMac_BuildRect, + (*self->ob_itself)->viewRect); + if( strcmp(name, "selRect") == 0 ) + return Py_BuildValue("O&", PyMac_BuildRect, + (*self->ob_itself)->selRect); + if( strcmp(name, "lineHeight") == 0 ) + return Py_BuildValue("h", (*self->ob_itself)->lineHeight); + if( strcmp(name, "fontAscent") == 0 ) + return Py_BuildValue("h", (*self->ob_itself)->fontAscent); + if( strcmp(name, "selPoint") == 0 ) + return Py_BuildValue("O&", PyMac_BuildPoint, + (*self->ob_itself)->selPoint); + if( strcmp(name, "selStart") == 0 ) + return Py_BuildValue("h", (*self->ob_itself)->selStart); + if( strcmp(name, "selEnd") == 0 ) + return Py_BuildValue("h", (*self->ob_itself)->selEnd); + if( strcmp(name, "active") == 0 ) + return Py_BuildValue("h", (*self->ob_itself)->active); + if( strcmp(name, "teLength") == 0 ) + return Py_BuildValue("h", (*self->ob_itself)->teLength); + """) # From here on it's basically all boiler plate... |