diff options
Diffstat (limited to 'Mac/Modules/app/appsupport.py')
-rw-r--r-- | Mac/Modules/app/appsupport.py | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/Mac/Modules/app/appsupport.py b/Mac/Modules/app/appsupport.py index a9d87681b8..177dfd55f5 100644 --- a/Mac/Modules/app/appsupport.py +++ b/Mac/Modules/app/appsupport.py @@ -6,17 +6,17 @@ import string # Declarations that change for each manager -MACHEADERFILE = 'Appearance.h' # The Apple header file -MODNAME = '_App' # The name of the module -OBJECTNAME = 'ThemeDrawingState' # The basic name of the objects used here -KIND = '' # Usually 'Ptr' or 'Handle' +MACHEADERFILE = 'Appearance.h' # The Apple header file +MODNAME = '_App' # The name of the module +OBJECTNAME = 'ThemeDrawingState' # The basic name of the objects used here +KIND = '' # Usually 'Ptr' or 'Handle' # The following is *usually* unchanged but may still require tuning -MODPREFIX = 'App' # The prefix for module-wide routines -OBJECTTYPE = OBJECTNAME + KIND # The C type used to represent them -OBJECTPREFIX = OBJECTNAME + 'Obj' # The prefix for object methods +MODPREFIX = 'App' # The prefix for module-wide routines +OBJECTTYPE = OBJECTNAME + KIND # The C type used to represent them +OBJECTPREFIX = OBJECTNAME + 'Obj' # The prefix for object methods INPUTFILE = string.lower(MODPREFIX) + 'gen.py' # The file generated by the scanner -OUTPUTFILE = MODNAME + "module.c" # The file generated by this program +OUTPUTFILE = MODNAME + "module.c" # The file generated by this program from macsupport import * @@ -84,24 +84,24 @@ includestuff = includestuff + """ int ThemeButtonDrawInfo_Convert(PyObject *v, ThemeButtonDrawInfo *p_itself) { - return PyArg_Parse(v, "(iHH)", &p_itself->state, &p_itself->value, &p_itself->adornment); + return PyArg_Parse(v, "(iHH)", &p_itself->state, &p_itself->value, &p_itself->adornment); } """ class MyObjectDefinition(PEP253Mixin, GlobalObjectDefinition): - pass -## def outputCheckNewArg(self): -## Output("if (itself == NULL) return PyMac_Error(resNotFound);") -## def outputCheckConvertArg(self): -## OutLbrace("if (DlgObj_Check(v))") -## Output("*p_itself = ((WindowObject *)v)->ob_itself;") -## Output("return 1;") -## OutRbrace() -## Out(""" -## if (v == Py_None) { *p_itself = NULL; return 1; } -## if (PyInt_Check(v)) { *p_itself = (WindowPtr)PyInt_AsLong(v); return 1; } -## """) + pass +## def outputCheckNewArg(self): +## Output("if (itself == NULL) return PyMac_Error(resNotFound);") +## def outputCheckConvertArg(self): +## OutLbrace("if (DlgObj_Check(v))") +## Output("*p_itself = ((WindowObject *)v)->ob_itself;") +## Output("return 1;") +## OutRbrace() +## Out(""" +## if (v == Py_None) { *p_itself = NULL; return 1; } +## if (PyInt_Check(v)) { *p_itself = (WindowPtr)PyInt_AsLong(v); return 1; } +## """) # From here on it's basically all boiler plate... @@ -131,4 +131,3 @@ for f in methods: object.add(f) # generate output (open the output file as late as possible) SetOutputFileName(OUTPUTFILE) module.generate() - |