Kaydet (Commit) e56db434 authored tarafından Guido van Rossum's avatar Guido van Rossum

first cut at the whole quickdraw.h header file ...

üst 86c3af7d
# Generated from 'D:Development:THINK C:Mac #includes:Apple #includes:QuickDraw.h'
invalColReq = -1
srcCopy = 0
srcOr = 1
srcXor = 2
srcBic = 3
notSrcCopy = 4
notSrcOr = 5
notSrcXor = 6
notSrcBic = 7
patCopy = 8
patOr = 9
patXor = 10
patBic = 11
notPatCopy = 12
notPatOr = 13
notPatXor = 14
notPatBic = 15
grayishTextOr = 49
blend = 32
addPin = 33
addOver = 34
subPin = 35
addMax = 37
adMax = 37
subOver = 38
adMin = 39
ditherCopy = 64
transparent = 36
normalBit = 0
inverseBit = 1
redBit = 4
greenBit = 3
blueBit = 2
cyanBit = 8
magentaBit = 7
yellowBit = 6
blackBit = 5
blackColor = 33
whiteColor = 30
redColor = 205
greenColor = 341
blueColor = 409
cyanColor = 273
magentaColor = 137
yellowColor = 69
picLParen = 0
picRParen = 1
normal = 0
bold = 1
italic = 2
underline = 4
outline = 8
shadow = 0x10
condense = 0x20
extend = 0x40
clutType = 0
fixedType = 1
directType = 2
gdDevType = 0
burstDevice = 7
ext32Device = 8
ramInit = 10
mainScreen = 11
allInit = 12
screenDevice = 13
noDriver = 14
screenActive = 15
hiliteBit = 7
pHiliteBit = 0
defQDColors = 127
RGBDirect = 16
baseAddr32 = 4
rgnOverflowErr = -147
insufficientStackErr = -149
allDevices = 1 << allDevicesBit
This diff is collapsed.
This diff is collapsed.
# Scan an Apple header file, generating a Python file of generator calls.
import addpack
addpack.addpack('D:python:Tools:bgen:bgen')
from scantools import Scanner
def main():
input = "QuickDraw.h"
output = "qdgen.py"
defsoutput = "QuickDraw.py"
scanner = MyScanner(input, output, defsoutput)
scanner.scan()
scanner.close()
print "=== Done scanning and generating, now importing the generated code... ==="
import qdsupport
print "=== Done. It's up to you to compile it now! ==="
class MyScanner(Scanner):
def destination(self, type, name, arglist):
classname = "Function"
listname = "functions"
if arglist:
t, n, m = arglist[0]
if t in ("WindowPtr", "WindowPeek") and m == "InMode":
classname = "Method"
listname = "methods"
return classname, listname
def makeblacklistnames(self):
return [
'InitGraf',
'StuffHex',
'StdLine',
'StdComment',
'StdGetPic',
'StdLine',
]
def makeblacklisttypes(self):
return [
'BitMap_ptr',
'CCrsrHandle',
'CGrafPtr',
'CIconHandle',
'CQDProcs',
'CSpecArray',
'CTabHandle',
'ColorComplementProcPtr',
'ColorSearchProcPtr',
'ConstPatternParam',
'Cursor_ptr',
'DeviceLoopDrawingProcPtr',
'DeviceLoopFlags',
'FontInfo',
'GDHandle',
'GrafVerb',
'OpenCPicParams_ptr',
'PenState',
'PenState_ptr',
'Ptr',
'QDProcs',
'RGBColor',
'RGBColor_ptr',
'ReqListRec',
'void_ptr',
]
def makerepairinstructions(self):
return [
([('void_ptr', 'textBuf', 'InMode'),
('short', 'firstByte', 'InMode'),
('short', 'byteCount', 'InMode')],
[('TextThingie', '*', '*'), ('*', '*', '*'), ('*', '*', '*')]),
([('Point', '*', 'OutMode')],
[('*', '*', 'InOutMode')]),
]
if __name__ == "__main__":
main()
......@@ -5,6 +5,9 @@
import string
import addpack
addpack.addpack('D:python:Tools:bgen:bgen')
# Declarations that change for each manager
MACHEADERFILE = 'QuickDraw.h' # The Apple header file
MODNAME = 'Qd' # The name of the module
......@@ -22,6 +25,22 @@ from macsupport import *
# Create the type objects
GrafPtr = WindowPtr
class TextThingieClass(FixedInputBufferType):
def getargsCheck(self, name):
pass
TextThingie = TextThingieClass(None)
# These are temporary!
Fixed = long
RgnHandle = OpaqueByValueType("RgnHandle", "ResObj")
PicHandle = OpaqueByValueType("PicHandle", "ResObj")
PolyHandle = OpaqueByValueType("PolyHandle", "ResObj")
PixMapHandle = OpaqueByValueType("PixMapHandle", "ResObj")
PixPatHandle = OpaqueByValueType("PixPatHandle", "ResObj")
includestuff = includestuff + """
#include <%s>""" % MACHEADERFILE + """
#include <Desk.h>
......@@ -58,8 +77,8 @@ Method = OSErrMethodGenerator
# Create and populate the lists
functions = []
methods = []
#execfile(INPUTFILE)
execfile(EXTRAFILE)
execfile(INPUTFILE)
#execfile(EXTRAFILE)
# add the populated lists to the generator groups
# (in a different wordl the scan program would generate this)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment