summaryrefslogtreecommitdiffstats
path: root/Lib/plat-mac
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2003-12-03 22:34:19 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2003-12-03 22:34:19 (GMT)
commitfe3fe4adb5c7a72bfec3c5b7b8ec5e42d8ccc625 (patch)
tree78b64ad4523e884ed7e33ad0df90e16696f003ed /Lib/plat-mac
parent8850c8785f9b61e9d2b4803a0249d0ae20d932fd (diff)
downloadcpython-fe3fe4adb5c7a72bfec3c5b7b8ec5e42d8ccc625.zip
cpython-fe3fe4adb5c7a72bfec3c5b7b8ec5e42d8ccc625.tar.gz
cpython-fe3fe4adb5c7a72bfec3c5b7b8ec5e42d8ccc625.tar.bz2
Adding an interface to the high-level Open Scripting Architecture,
by request of Donovan Preston. In return, he promised to use this to create a Python OSA component, which would turn Python into a first-class OSA scripting language (like AppleScript itself).
Diffstat (limited to 'Lib/plat-mac')
-rw-r--r--Lib/plat-mac/Carbon/OSAconst.py129
-rw-r--r--Lib/plat-mac/Carbon/WASTEconst.py83
2 files changed, 212 insertions, 0 deletions
diff --git a/Lib/plat-mac/Carbon/OSAconst.py b/Lib/plat-mac/Carbon/OSAconst.py
new file mode 100644
index 0000000..c6d4851
--- /dev/null
+++ b/Lib/plat-mac/Carbon/OSAconst.py
@@ -0,0 +1,129 @@
+# Generated from 'OSA.h'
+
+def FOUR_CHAR_CODE(x): return x
+from Carbon.AppleEvents import *
+kAEUseStandardDispatch = -1
+kOSAComponentType = FOUR_CHAR_CODE('osa ')
+kOSAGenericScriptingComponentSubtype = FOUR_CHAR_CODE('scpt')
+kOSAFileType = FOUR_CHAR_CODE('osas')
+kOSASuite = FOUR_CHAR_CODE('ascr')
+kOSARecordedText = FOUR_CHAR_CODE('recd')
+kOSAScriptIsModified = FOUR_CHAR_CODE('modi')
+kOSAScriptIsTypeCompiledScript = FOUR_CHAR_CODE('cscr')
+kOSAScriptIsTypeScriptValue = FOUR_CHAR_CODE('valu')
+kOSAScriptIsTypeScriptContext = FOUR_CHAR_CODE('cntx')
+kOSAScriptBestType = FOUR_CHAR_CODE('best')
+kOSACanGetSource = FOUR_CHAR_CODE('gsrc')
+typeOSADialectInfo = FOUR_CHAR_CODE('difo')
+keyOSADialectName = FOUR_CHAR_CODE('dnam')
+keyOSADialectCode = FOUR_CHAR_CODE('dcod')
+keyOSADialectLangCode = FOUR_CHAR_CODE('dlcd')
+keyOSADialectScriptCode = FOUR_CHAR_CODE('dscd')
+kOSANullScript = 0L
+kOSANullMode = 0
+kOSAModeNull = 0
+kOSASupportsCompiling = 0x0002
+kOSASupportsGetSource = 0x0004
+kOSASupportsAECoercion = 0x0008
+kOSASupportsAESending = 0x0010
+kOSASupportsRecording = 0x0020
+kOSASupportsConvenience = 0x0040
+kOSASupportsDialects = 0x0080
+kOSASupportsEventHandling = 0x0100
+kOSASelectLoad = 0x0001
+kOSASelectStore = 0x0002
+kOSASelectExecute = 0x0003
+kOSASelectDisplay = 0x0004
+kOSASelectScriptError = 0x0005
+kOSASelectDispose = 0x0006
+kOSASelectSetScriptInfo = 0x0007
+kOSASelectGetScriptInfo = 0x0008
+kOSASelectSetActiveProc = 0x0009
+kOSASelectGetActiveProc = 0x000A
+kOSASelectScriptingComponentName = 0x0102
+kOSASelectCompile = 0x0103
+kOSASelectCopyID = 0x0104
+kOSASelectCopyScript = 0x0105
+kOSASelectGetSource = 0x0201
+kOSASelectCoerceFromDesc = 0x0301
+kOSASelectCoerceToDesc = 0x0302
+kOSASelectSetSendProc = 0x0401
+kOSASelectGetSendProc = 0x0402
+kOSASelectSetCreateProc = 0x0403
+kOSASelectGetCreateProc = 0x0404
+kOSASelectSetDefaultTarget = 0x0405
+kOSASelectStartRecording = 0x0501
+kOSASelectStopRecording = 0x0502
+kOSASelectLoadExecute = 0x0601
+kOSASelectCompileExecute = 0x0602
+kOSASelectDoScript = 0x0603
+kOSASelectSetCurrentDialect = 0x0701
+kOSASelectGetCurrentDialect = 0x0702
+kOSASelectAvailableDialects = 0x0703
+kOSASelectGetDialectInfo = 0x0704
+kOSASelectAvailableDialectCodeList = 0x0705
+kOSASelectSetResumeDispatchProc = 0x0801
+kOSASelectGetResumeDispatchProc = 0x0802
+kOSASelectExecuteEvent = 0x0803
+kOSASelectDoEvent = 0x0804
+kOSASelectMakeContext = 0x0805
+kOSADebuggerCreateSession = 0x0901
+kOSADebuggerGetSessionState = 0x0902
+kOSADebuggerSessionStep = 0x0903
+kOSADebuggerDisposeSession = 0x0904
+kOSADebuggerGetStatementRanges = 0x0905
+kOSADebuggerGetBreakpoint = 0x0910
+kOSADebuggerSetBreakpoint = 0x0911
+kOSADebuggerGetDefaultBreakpoint = 0x0912
+kOSADebuggerGetCurrentCallFrame = 0x0906
+kOSADebuggerGetCallFrameState = 0x0907
+kOSADebuggerGetVariable = 0x0908
+kOSADebuggerSetVariable = 0x0909
+kOSADebuggerGetPreviousCallFrame = 0x090A
+kOSADebuggerDisposeCallFrame = 0x090B
+kOSASelectComponentSpecificStart = 0x1001
+kOSAModePreventGetSource = 0x00000001
+kOSAModeNeverInteract = kAENeverInteract
+kOSAModeCanInteract = kAECanInteract
+kOSAModeAlwaysInteract = kAEAlwaysInteract
+kOSAModeDontReconnect = kAEDontReconnect
+kOSAModeCantSwitchLayer = 0x00000040
+kOSAModeDoRecord = 0x00001000
+kOSAModeCompileIntoContext = 0x00000002
+kOSAModeAugmentContext = 0x00000004
+kOSAModeDisplayForHumans = 0x00000008
+kOSAModeDontStoreParent = 0x00010000
+kOSAModeDispatchToDirectObject = 0x00020000
+kOSAModeDontGetDataForArguments = 0x00040000
+kOSAScriptResourceType = kOSAGenericScriptingComponentSubtype
+typeOSAGenericStorage = kOSAScriptResourceType
+kOSAErrorNumber = keyErrorNumber
+kOSAErrorMessage = keyErrorString
+kOSAErrorBriefMessage = FOUR_CHAR_CODE('errb')
+kOSAErrorApp = FOUR_CHAR_CODE('erap')
+kOSAErrorPartialResult = FOUR_CHAR_CODE('ptlr')
+kOSAErrorOffendingObject = FOUR_CHAR_CODE('erob')
+kOSAErrorExpectedType = FOUR_CHAR_CODE('errt')
+kOSAErrorRange = FOUR_CHAR_CODE('erng')
+typeOSAErrorRange = FOUR_CHAR_CODE('erng')
+keyOSASourceStart = FOUR_CHAR_CODE('srcs')
+keyOSASourceEnd = FOUR_CHAR_CODE('srce')
+kOSAUseStandardDispatch = kAEUseStandardDispatch
+kOSANoDispatch = kAENoDispatch
+kOSADontUsePhac = 0x0001
+eNotStarted = 0
+eRunnable = 1
+eRunning = 2
+eStopped = 3
+eTerminated = 4
+eStepOver = 0
+eStepIn = 1
+eStepOut = 2
+eRun = 3
+keyProgramState = FOUR_CHAR_CODE('dsps')
+typeStatementRange = FOUR_CHAR_CODE('srng')
+keyProcedureName = FOUR_CHAR_CODE('dfnm')
+keyStatementRange = FOUR_CHAR_CODE('dfsr')
+keyLocalsNames = FOUR_CHAR_CODE('dfln')
+keyGlobalsNames = FOUR_CHAR_CODE('dfgn')
+keyParamsNames = FOUR_CHAR_CODE('dfpn')
diff --git a/Lib/plat-mac/Carbon/WASTEconst.py b/Lib/plat-mac/Carbon/WASTEconst.py
index dc73905..f674e60 100644
--- a/Lib/plat-mac/Carbon/WASTEconst.py
+++ b/Lib/plat-mac/Carbon/WASTEconst.py
@@ -51,6 +51,7 @@ kLeadingEdge = -1
kTrailingEdge = 0
kObjectEdge = 2
weFAutoScroll = 0
+weFAutoIdle = 1
weFOutlineHilite = 2
weFReadOnly = 5
weFUndo = 6
@@ -62,10 +63,13 @@ weFDrawOffscreen = 11
weFInhibitRedraw = 12
weFMonoStyled = 13
weFMultipleUndo = 14
+weFLeftMarginClick = 16
+weFNoAutoTabForHangingIndent = 28
weFNoKeyboardSync = 29
weFInhibitICSupport = 30
weFInhibitColor = 31
# weDoAutoScroll = 1UL << weFAutoScroll
+weDoAutoIdle = 1UL << weFAutoIdle
# weDoOutlineHilite = 1UL << weFOutlineHilite
# weDoReadOnly = 1UL << weFReadOnly
# weDoUndo = 1UL << weFUndo
@@ -77,6 +81,8 @@ weFInhibitColor = 31
# weDoInhibitRedraw = 1UL << weFInhibitRedraw
# weDoMonoStyled = 1UL << weFMonoStyled
# weDoMultipleUndo = 1UL << weFMultipleUndo
+weDoLeftMarginClick = 1UL << weFLeftMarginClick
+weDoNoAutoTabForHangingIndent = 1UL << weFNoAutoTabForHangingIndent
# weDoNoKeyboardSync = 1UL << weFNoKeyboardSync
# weDoInhibitICSupport = 1UL << weFInhibitICSupport
# weDoInhibitColor = 1UL << weFInhibitColor
@@ -86,6 +92,9 @@ weBitClear = 0
weBitSet = 1
weLowerCase = 0
weUpperCase = 1
+weRedWigglyUnderline = 29303
+weGreenWigglyUnderline = 26487
+weOrangeWigglyUnderline = 28535
weFindWholeWords = 0x00000001
weFindCaseInsensitive = 0x00000002
weFindDiacriticalInsensitive = 0x00000004
@@ -94,8 +103,13 @@ wePutAddToTypingSequence = 0x00000002
wePutDetectUnicodeBOM = 0x00000200
weStreamDestinationKindMask = 0x000000FF
weStreamIncludeObjects = 0x00000100
+weCopyPromiseFlavors = 0x00000001
weGetAddUnicodeBOM = 0x00000200
weGetLittleEndian = 0x00000400
+weSaveAddResources = 0x00000001
+weSaveCompatibilityResources = 0x00000002
+weSaveLittleEndian = 0x00000004
+kWASTECreator = FOUR_CHAR_CODE('OEDE')
weTagFontFamily = FOUR_CHAR_CODE('font')
weTagFontSize = FOUR_CHAR_CODE('ptsz')
weTagPlain = FOUR_CHAR_CODE('plan')
@@ -107,10 +121,19 @@ weTagShadow = FOUR_CHAR_CODE('shad')
weTagCondensed = FOUR_CHAR_CODE('cond')
weTagExtended = FOUR_CHAR_CODE('pexp')
weTagStrikethrough = FOUR_CHAR_CODE('strk')
+weTagHidden = FOUR_CHAR_CODE('hidn')
+weTagAllCaps = FOUR_CHAR_CODE('alcp')
+weTagAllLowercase = FOUR_CHAR_CODE('lowc')
weTagTextColor = FOUR_CHAR_CODE('colr')
weTagBackgroundColor = FOUR_CHAR_CODE('pbcl')
weTagTransferMode = FOUR_CHAR_CODE('pptm')
weTagVerticalShift = FOUR_CHAR_CODE('xshf')
+weTagLanguage = FOUR_CHAR_CODE('lang')
+weTagUnderlineStyle = FOUR_CHAR_CODE('unds')
+weTagSmallCaps = FOUR_CHAR_CODE('smcp')
+weTagDoubleStrikethrough = FOUR_CHAR_CODE('dstr')
+weTagEmbossed = FOUR_CHAR_CODE('embo')
+weTagEngraved = FOUR_CHAR_CODE('engr')
weTagAlignment = FOUR_CHAR_CODE('pjst')
weTagDirection = FOUR_CHAR_CODE('LDIR')
weTagLineSpacing = FOUR_CHAR_CODE('ledg')
@@ -119,28 +142,66 @@ weTagRightIndent = FOUR_CHAR_CODE('riin')
weTagFirstLineIndent = FOUR_CHAR_CODE('fidt')
weTagSpaceBefore = FOUR_CHAR_CODE('spbe')
weTagSpaceAfter = FOUR_CHAR_CODE('spaf')
+weTagTabList = FOUR_CHAR_CODE('tabs')
weTagBottomBorderStyle = FOUR_CHAR_CODE('BBRD')
+weTagKeepTogether = FOUR_CHAR_CODE('keep')
+weTagKeepWithNext = FOUR_CHAR_CODE('kepn')
+weTagPageBreakBefore = FOUR_CHAR_CODE('pbrb')
+weTagWidowOrphanOverride = FOUR_CHAR_CODE('wdov')
+weTagWidowOrphanControl = FOUR_CHAR_CODE('wido')
+weTagNoLineNumbering = FOUR_CHAR_CODE('!ln#')
+weTagNoHyphenation = FOUR_CHAR_CODE('!hyp')
+weTagParagraphUserData = FOUR_CHAR_CODE('pusr')
weTagForceFontFamily = FOUR_CHAR_CODE('ffnt')
weTagAddFontSize = FOUR_CHAR_CODE('+siz')
weTagAddVerticalShift = FOUR_CHAR_CODE('+shf')
+weTagAddLeftIndent = FOUR_CHAR_CODE('+lei')
+weTagAddRightIndent = FOUR_CHAR_CODE('+rii')
+weTagAddFirstLineIndent = FOUR_CHAR_CODE('+fid')
+weTagAddSpaceBefore = FOUR_CHAR_CODE('+spb')
+weTagAddSpaceAfter = FOUR_CHAR_CODE('+spa')
+weTagAddLineSpacing = FOUR_CHAR_CODE('+led')
weTagTextEncoding = FOUR_CHAR_CODE('ptxe')
weTagQDStyles = FOUR_CHAR_CODE('qdst')
weTagTETextStyle = FOUR_CHAR_CODE('tets')
+weTagRunDirection = FOUR_CHAR_CODE('rdir')
+weTagUnderlineDefault = FOUR_CHAR_CODE('deft')
+weTagUnderlineWord = FOUR_CHAR_CODE('word')
+weTagUnderlineDouble = FOUR_CHAR_CODE('dubl')
+weTagUnderlineThick = FOUR_CHAR_CODE('thck')
+weTagUnderlineDash = FOUR_CHAR_CODE('- ')
+weTagUnderlineDot = FOUR_CHAR_CODE('. ')
+weTagUnderlineDotDash = FOUR_CHAR_CODE('.- ')
+weTagUnderlineDotDotDash = FOUR_CHAR_CODE('..- ')
+weTagUnderlineWave = FOUR_CHAR_CODE('wave')
weTagAlignmentDefault = FOUR_CHAR_CODE('deft')
weTagAlignmentLeft = FOUR_CHAR_CODE('left')
weTagAlignmentCenter = FOUR_CHAR_CODE('cent')
weTagAlignmentRight = FOUR_CHAR_CODE('rght')
weTagAlignmentFull = FOUR_CHAR_CODE('full')
+weTagAlignmentDecimal = FOUR_CHAR_CODE('decm')
weTagDirectionDefault = FOUR_CHAR_CODE('deft')
weTagDirectionLeftToRight = FOUR_CHAR_CODE('L->R')
weTagDirectionRightToLeft = FOUR_CHAR_CODE('R->L')
+weTagLeaderNone = FOUR_CHAR_CODE('NONE')
+weTagLeaderDots = FOUR_CHAR_CODE('DOTS')
+weTagLeaderHyphens = FOUR_CHAR_CODE('HYPH')
+weTagLeaderUnderline = FOUR_CHAR_CODE('UNDL')
+weTagLeaderThickLine = FOUR_CHAR_CODE('THKL')
+weTagLeaderEqualSigns = FOUR_CHAR_CODE('= ')
weTagBorderStyleNone = FOUR_CHAR_CODE('NONE')
weTagBorderStyleThin = FOUR_CHAR_CODE('SLDL')
weTagBorderStyleDotted = FOUR_CHAR_CODE('DTDL')
weTagBorderStyleThick = FOUR_CHAR_CODE('THKL')
+weTagLineSpacingAbsolute = FOUR_CHAR_CODE('abso')
+weTagLineSpacingAtLeast = FOUR_CHAR_CODE('atle')
+weTagLineSpacingRelative = FOUR_CHAR_CODE('rele')
weLineSpacingSingle = 0x00000000
weLineSpacingOneAndHalf = 0x00008000
weLineSpacingDouble = 0x00010000
+weAutoScrollDelay = FOUR_CHAR_CODE('ausd')
+weBusyProc = FOUR_CHAR_CODE('busy')
+weBusyInterval = FOUR_CHAR_CODE('bzin')
weCharByteHook = FOUR_CHAR_CODE('cbyt')
weCharToPixelHook = FOUR_CHAR_CODE('c2p ')
weCharTypeHook = FOUR_CHAR_CODE('ctyp')
@@ -165,6 +226,7 @@ weTranslucencyThreshold = FOUR_CHAR_CODE('tluc')
weTSMDocumentID = FOUR_CHAR_CODE('tsmd')
weTSMPreUpdate = FOUR_CHAR_CODE('pre ')
weTSMPostUpdate = FOUR_CHAR_CODE('post')
+weUndoProc = FOUR_CHAR_CODE('undo')
weURLHint = FOUR_CHAR_CODE('urlh')
weWordBreakHook = FOUR_CHAR_CODE('wbrk')
weNewHandler = FOUR_CHAR_CODE('new ')
@@ -184,6 +246,8 @@ kTypeStyleScrap = FOUR_CHAR_CODE('WEst')
kTypeUnicodeText = FOUR_CHAR_CODE('utxt')
kTypeUTF8Text = FOUR_CHAR_CODE('UTF8')
kTypeStyledText = FOUR_CHAR_CODE('STXT')
+kTypeRTF = FOUR_CHAR_CODE('RTF ')
+kTypeRTFD = FOUR_CHAR_CODE('RTFD')
weAKNone = 0
weAKUnspecified = 1
weAKTyping = 2
@@ -197,11 +261,30 @@ weAKBackspace = 9
weAKFwdDelete = 10
weAKCaseChange = 11
weAKObjectChange = 12
+weUndoNewAction = 0
+weUndoNewSubAction = 1
+weUndoBeginSequence = 2
weToScrap = 0
weToDrag = 1
weToSoup = 2
weMouseEnter = 0
weMouseWithin = 1
weMouseLeave = 2
+weBusyRecalBreaks = 0
+weCreatorDocumentInfo = FOUR_CHAR_CODE('Info')
+weTagDocumentTitle = FOUR_CHAR_CODE('Titl')
+weTagDocumentSubject = FOUR_CHAR_CODE('Subj')
+weTagDocumentAuthor = FOUR_CHAR_CODE('Auth')
+weTagDocumentManager = FOUR_CHAR_CODE('Mngr')
+weTagDocumentCompany = FOUR_CHAR_CODE('Cmpy')
+weTagDocumentCategory = FOUR_CHAR_CODE('Ctgy')
+weTagDocumentKeywords = FOUR_CHAR_CODE('Keyw')
+weTagDocumentComments = FOUR_CHAR_CODE('Cmnt')
+weTagDocumentOperator = FOUR_CHAR_CODE('Oper')
+weTagDocumentBaseAddress = FOUR_CHAR_CODE('Hlnk')
+weTagPageInfo = FOUR_CHAR_CODE('Page')
+weTagMacPrintRecord = FOUR_CHAR_CODE('PRec')
kCurrentSelection = -1
kNullStyle = -2
+kMaxTabCount = 20
+kMaxLanguageTagSize = 32