summaryrefslogtreecommitdiffstats
path: root/Mac/Modules/scrap/scrapsupport.py
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2001-12-31 14:52:03 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2001-12-31 14:52:03 (GMT)
commit420ed40344768adac305a6ff76baced021d6fffd (patch)
tree95c89b4abbdb69a22f0fa685222fd154c2a78131 /Mac/Modules/scrap/scrapsupport.py
parent7633593683fb4bef8b92534ff0ee845c0e55352a (diff)
downloadcpython-420ed40344768adac305a6ff76baced021d6fffd.zip
cpython-420ed40344768adac305a6ff76baced021d6fffd.tar.gz
cpython-420ed40344768adac305a6ff76baced021d6fffd.tar.bz2
Added support for the Carbon scrap manager (finally).
Diffstat (limited to 'Mac/Modules/scrap/scrapsupport.py')
-rw-r--r--Mac/Modules/scrap/scrapsupport.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/Mac/Modules/scrap/scrapsupport.py b/Mac/Modules/scrap/scrapsupport.py
index 516b22b..65525be 100644
--- a/Mac/Modules/scrap/scrapsupport.py
+++ b/Mac/Modules/scrap/scrapsupport.py
@@ -11,15 +11,19 @@ import string
# Declarations that change for each manager
MACHEADERFILE = 'Scrap.h' # The Apple header file
MODNAME = '_Scrap' # The name of the module
+OBJECTNAME = 'Scrap' # The basic name of the objects used here
# The following is *usually* unchanged but may still require tuning
MODPREFIX = 'Scrap' # The prefix for module-wide routines
+OBJECTTYPE = OBJECTNAME + 'Ref' # The C type used to represent them
+OBJECTPREFIX = MODPREFIX + '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
from macsupport import *
# Create the type objects
+ScrapRef = OpaqueByValueType(OBJECTTYPE, OBJECTPREFIX)
includestuff = includestuff + """
#ifdef WITHOUT_FRAMEWORKS
@@ -44,21 +48,31 @@ SCRRec_New(itself)
ScrapStuffPtr = OpaqueByValueType('ScrapStuffPtr', 'SCRRec')
ScrapFlavorType = OSTypeType('ScrapFlavorType')
+ScrapFlavorFlags = Type('ScrapFlavorFlags', 'l')
+#ScrapFlavorInfo = OpaqueType('ScrapFlavorInfo', 'ScrapFlavorInfo')
putscrapbuffer = FixedInputBufferType('void *')
+class MyObjectDefinition(GlobalObjectDefinition):
+ pass
+
# Create the generator groups and link them
module = MacModule(MODNAME, MODPREFIX, includestuff, finalstuff, initstuff)
+object = MyObjectDefinition(OBJECTNAME, OBJECTPREFIX, OBJECTTYPE)
+module.addobject(object)
# Create the generator classes used to populate the lists
Function = OSErrFunctionGenerator
+Method = OSErrMethodGenerator
# Create and populate the lists
functions = []
+methods = []
execfile(INPUTFILE)
# add the populated lists to the generator groups
# (in a different wordl the scan program would generate this)
for f in functions: module.add(f)
+for f in methods: object.add(f)
# generate output (open the output file as late as possible)
SetOutputFileName(OUTPUTFILE)