Open Media Library Platform
This commit is contained in:
commit
411ad5b16f
5849 changed files with 1778641 additions and 0 deletions
124
Darwin/lib/python2.7/plat-mac/Audio_mac.py
Normal file
124
Darwin/lib/python2.7/plat-mac/Audio_mac.py
Normal file
|
|
@ -0,0 +1,124 @@
|
|||
QSIZE = 100000
|
||||
error='Audio_mac.error'
|
||||
|
||||
from warnings import warnpy3k
|
||||
warnpy3k("In 3.x, the Play_Audio_mac module is removed.", stacklevel=2)
|
||||
|
||||
class Play_Audio_mac:
|
||||
|
||||
def __init__(self, qsize=QSIZE):
|
||||
self._chan = None
|
||||
self._qsize = qsize
|
||||
self._outrate = 22254
|
||||
self._sampwidth = 1
|
||||
self._nchannels = 1
|
||||
self._gc = []
|
||||
self._usercallback = None
|
||||
|
||||
def __del__(self):
|
||||
self.stop()
|
||||
self._usercallback = None
|
||||
|
||||
def wait(self):
|
||||
import time
|
||||
while self.getfilled():
|
||||
time.sleep(0.1)
|
||||
self._chan = None
|
||||
self._gc = []
|
||||
|
||||
def stop(self, quietNow = 1):
|
||||
##chan = self._chan
|
||||
self._chan = None
|
||||
##chan.SndDisposeChannel(1)
|
||||
self._gc = []
|
||||
|
||||
def setoutrate(self, outrate):
|
||||
self._outrate = outrate
|
||||
|
||||
def setsampwidth(self, sampwidth):
|
||||
self._sampwidth = sampwidth
|
||||
|
||||
def setnchannels(self, nchannels):
|
||||
self._nchannels = nchannels
|
||||
|
||||
def writeframes(self, data):
|
||||
import time
|
||||
from Carbon.Sound import bufferCmd, callBackCmd, extSH
|
||||
import struct
|
||||
import MacOS
|
||||
if not self._chan:
|
||||
from Carbon import Snd
|
||||
self._chan = Snd.SndNewChannel(5, 0, self._callback)
|
||||
nframes = len(data) / self._nchannels / self._sampwidth
|
||||
if len(data) != nframes * self._nchannels * self._sampwidth:
|
||||
raise error, 'data is not a whole number of frames'
|
||||
while self._gc and \
|
||||
self.getfilled() + nframes > \
|
||||
self._qsize / self._nchannels / self._sampwidth:
|
||||
time.sleep(0.1)
|
||||
if self._sampwidth == 1:
|
||||
import audioop
|
||||
data = audioop.add(data, '\x80'*len(data), 1)
|
||||
h1 = struct.pack('llHhllbbl',
|
||||
id(data)+MacOS.string_id_to_buffer,
|
||||
self._nchannels,
|
||||
self._outrate, 0,
|
||||
0,
|
||||
0,
|
||||
extSH,
|
||||
60,
|
||||
nframes)
|
||||
h2 = 22*'\0'
|
||||
h3 = struct.pack('hhlll',
|
||||
self._sampwidth*8,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0)
|
||||
header = h1+h2+h3
|
||||
self._gc.append((header, data))
|
||||
self._chan.SndDoCommand((bufferCmd, 0, header), 0)
|
||||
self._chan.SndDoCommand((callBackCmd, 0, 0), 0)
|
||||
|
||||
def _callback(self, *args):
|
||||
del self._gc[0]
|
||||
if self._usercallback:
|
||||
self._usercallback()
|
||||
|
||||
def setcallback(self, callback):
|
||||
self._usercallback = callback
|
||||
|
||||
def getfilled(self):
|
||||
filled = 0
|
||||
for header, data in self._gc:
|
||||
filled = filled + len(data)
|
||||
return filled / self._nchannels / self._sampwidth
|
||||
|
||||
def getfillable(self):
|
||||
return (self._qsize / self._nchannels / self._sampwidth) - self.getfilled()
|
||||
|
||||
def ulaw2lin(self, data):
|
||||
import audioop
|
||||
return audioop.ulaw2lin(data, 2)
|
||||
|
||||
def test():
|
||||
import aifc
|
||||
import EasyDialogs
|
||||
fn = EasyDialogs.AskFileForOpen(message="Select an AIFF soundfile", typeList=("AIFF",))
|
||||
if not fn: return
|
||||
af = aifc.open(fn, 'r')
|
||||
print af.getparams()
|
||||
p = Play_Audio_mac()
|
||||
p.setoutrate(af.getframerate())
|
||||
p.setsampwidth(af.getsampwidth())
|
||||
p.setnchannels(af.getnchannels())
|
||||
BUFSIZ = 10000
|
||||
while 1:
|
||||
data = af.readframes(BUFSIZ)
|
||||
if not data: break
|
||||
p.writeframes(data)
|
||||
print 'wrote', len(data), 'space', p.getfillable()
|
||||
p.wait()
|
||||
|
||||
if __name__ == '__main__':
|
||||
test()
|
||||
1
Darwin/lib/python2.7/plat-mac/Carbon/AE.py
Normal file
1
Darwin/lib/python2.7/plat-mac/Carbon/AE.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
from _AE import *
|
||||
1
Darwin/lib/python2.7/plat-mac/Carbon/AH.py
Normal file
1
Darwin/lib/python2.7/plat-mac/Carbon/AH.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
from _AH import *
|
||||
1
Darwin/lib/python2.7/plat-mac/Carbon/Alias.py
Normal file
1
Darwin/lib/python2.7/plat-mac/Carbon/Alias.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
from _Alias import *
|
||||
18
Darwin/lib/python2.7/plat-mac/Carbon/Aliases.py
Normal file
18
Darwin/lib/python2.7/plat-mac/Carbon/Aliases.py
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
# Generated from 'Aliases.h'
|
||||
|
||||
def FOUR_CHAR_CODE(x): return x
|
||||
true = True
|
||||
false = False
|
||||
rAliasType = FOUR_CHAR_CODE('alis')
|
||||
kARMMountVol = 0x00000001
|
||||
kARMNoUI = 0x00000002
|
||||
kARMMultVols = 0x00000008
|
||||
kARMSearch = 0x00000100
|
||||
kARMSearchMore = 0x00000200
|
||||
kARMSearchRelFirst = 0x00000400
|
||||
asiZoneName = -3
|
||||
asiServerName = -2
|
||||
asiVolumeName = -1
|
||||
asiAliasName = 0
|
||||
asiParentName = 1
|
||||
kResolveAliasFileNoUI = 0x00000001
|
||||
1
Darwin/lib/python2.7/plat-mac/Carbon/App.py
Normal file
1
Darwin/lib/python2.7/plat-mac/Carbon/App.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
from _App import *
|
||||
648
Darwin/lib/python2.7/plat-mac/Carbon/Appearance.py
Normal file
648
Darwin/lib/python2.7/plat-mac/Carbon/Appearance.py
Normal file
|
|
@ -0,0 +1,648 @@
|
|||
# Generated from 'Appearance.h'
|
||||
|
||||
def FOUR_CHAR_CODE(x): return x
|
||||
kAppearanceEventClass = FOUR_CHAR_CODE('appr')
|
||||
kAEAppearanceChanged = FOUR_CHAR_CODE('thme')
|
||||
kAESystemFontChanged = FOUR_CHAR_CODE('sysf')
|
||||
kAESmallSystemFontChanged = FOUR_CHAR_CODE('ssfn')
|
||||
kAEViewsFontChanged = FOUR_CHAR_CODE('vfnt')
|
||||
kThemeDataFileType = FOUR_CHAR_CODE('thme')
|
||||
kThemePlatinumFileType = FOUR_CHAR_CODE('pltn')
|
||||
kThemeCustomThemesFileType = FOUR_CHAR_CODE('scen')
|
||||
kThemeSoundTrackFileType = FOUR_CHAR_CODE('tsnd')
|
||||
kThemeBrushDialogBackgroundActive = 1
|
||||
kThemeBrushDialogBackgroundInactive = 2
|
||||
kThemeBrushAlertBackgroundActive = 3
|
||||
kThemeBrushAlertBackgroundInactive = 4
|
||||
kThemeBrushModelessDialogBackgroundActive = 5
|
||||
kThemeBrushModelessDialogBackgroundInactive = 6
|
||||
kThemeBrushUtilityWindowBackgroundActive = 7
|
||||
kThemeBrushUtilityWindowBackgroundInactive = 8
|
||||
kThemeBrushListViewSortColumnBackground = 9
|
||||
kThemeBrushListViewBackground = 10
|
||||
kThemeBrushIconLabelBackground = 11
|
||||
kThemeBrushListViewSeparator = 12
|
||||
kThemeBrushChasingArrows = 13
|
||||
kThemeBrushDragHilite = 14
|
||||
kThemeBrushDocumentWindowBackground = 15
|
||||
kThemeBrushFinderWindowBackground = 16
|
||||
kThemeBrushScrollBarDelimiterActive = 17
|
||||
kThemeBrushScrollBarDelimiterInactive = 18
|
||||
kThemeBrushFocusHighlight = 19
|
||||
kThemeBrushPopupArrowActive = 20
|
||||
kThemeBrushPopupArrowPressed = 21
|
||||
kThemeBrushPopupArrowInactive = 22
|
||||
kThemeBrushAppleGuideCoachmark = 23
|
||||
kThemeBrushIconLabelBackgroundSelected = 24
|
||||
kThemeBrushStaticAreaFill = 25
|
||||
kThemeBrushActiveAreaFill = 26
|
||||
kThemeBrushButtonFrameActive = 27
|
||||
kThemeBrushButtonFrameInactive = 28
|
||||
kThemeBrushButtonFaceActive = 29
|
||||
kThemeBrushButtonFaceInactive = 30
|
||||
kThemeBrushButtonFacePressed = 31
|
||||
kThemeBrushButtonActiveDarkShadow = 32
|
||||
kThemeBrushButtonActiveDarkHighlight = 33
|
||||
kThemeBrushButtonActiveLightShadow = 34
|
||||
kThemeBrushButtonActiveLightHighlight = 35
|
||||
kThemeBrushButtonInactiveDarkShadow = 36
|
||||
kThemeBrushButtonInactiveDarkHighlight = 37
|
||||
kThemeBrushButtonInactiveLightShadow = 38
|
||||
kThemeBrushButtonInactiveLightHighlight = 39
|
||||
kThemeBrushButtonPressedDarkShadow = 40
|
||||
kThemeBrushButtonPressedDarkHighlight = 41
|
||||
kThemeBrushButtonPressedLightShadow = 42
|
||||
kThemeBrushButtonPressedLightHighlight = 43
|
||||
kThemeBrushBevelActiveLight = 44
|
||||
kThemeBrushBevelActiveDark = 45
|
||||
kThemeBrushBevelInactiveLight = 46
|
||||
kThemeBrushBevelInactiveDark = 47
|
||||
kThemeBrushNotificationWindowBackground = 48
|
||||
kThemeBrushMovableModalBackground = 49
|
||||
kThemeBrushSheetBackgroundOpaque = 50
|
||||
kThemeBrushDrawerBackground = 51
|
||||
kThemeBrushToolbarBackground = 52
|
||||
kThemeBrushSheetBackgroundTransparent = 53
|
||||
kThemeBrushMenuBackground = 54
|
||||
kThemeBrushMenuBackgroundSelected = 55
|
||||
kThemeBrushSheetBackground = kThemeBrushSheetBackgroundOpaque
|
||||
kThemeBrushBlack = -1
|
||||
kThemeBrushWhite = -2
|
||||
kThemeBrushPrimaryHighlightColor = -3
|
||||
kThemeBrushSecondaryHighlightColor = -4
|
||||
kThemeTextColorDialogActive = 1
|
||||
kThemeTextColorDialogInactive = 2
|
||||
kThemeTextColorAlertActive = 3
|
||||
kThemeTextColorAlertInactive = 4
|
||||
kThemeTextColorModelessDialogActive = 5
|
||||
kThemeTextColorModelessDialogInactive = 6
|
||||
kThemeTextColorWindowHeaderActive = 7
|
||||
kThemeTextColorWindowHeaderInactive = 8
|
||||
kThemeTextColorPlacardActive = 9
|
||||
kThemeTextColorPlacardInactive = 10
|
||||
kThemeTextColorPlacardPressed = 11
|
||||
kThemeTextColorPushButtonActive = 12
|
||||
kThemeTextColorPushButtonInactive = 13
|
||||
kThemeTextColorPushButtonPressed = 14
|
||||
kThemeTextColorBevelButtonActive = 15
|
||||
kThemeTextColorBevelButtonInactive = 16
|
||||
kThemeTextColorBevelButtonPressed = 17
|
||||
kThemeTextColorPopupButtonActive = 18
|
||||
kThemeTextColorPopupButtonInactive = 19
|
||||
kThemeTextColorPopupButtonPressed = 20
|
||||
kThemeTextColorIconLabel = 21
|
||||
kThemeTextColorListView = 22
|
||||
kThemeTextColorDocumentWindowTitleActive = 23
|
||||
kThemeTextColorDocumentWindowTitleInactive = 24
|
||||
kThemeTextColorMovableModalWindowTitleActive = 25
|
||||
kThemeTextColorMovableModalWindowTitleInactive = 26
|
||||
kThemeTextColorUtilityWindowTitleActive = 27
|
||||
kThemeTextColorUtilityWindowTitleInactive = 28
|
||||
kThemeTextColorPopupWindowTitleActive = 29
|
||||
kThemeTextColorPopupWindowTitleInactive = 30
|
||||
kThemeTextColorRootMenuActive = 31
|
||||
kThemeTextColorRootMenuSelected = 32
|
||||
kThemeTextColorRootMenuDisabled = 33
|
||||
kThemeTextColorMenuItemActive = 34
|
||||
kThemeTextColorMenuItemSelected = 35
|
||||
kThemeTextColorMenuItemDisabled = 36
|
||||
kThemeTextColorPopupLabelActive = 37
|
||||
kThemeTextColorPopupLabelInactive = 38
|
||||
kThemeTextColorTabFrontActive = 39
|
||||
kThemeTextColorTabNonFrontActive = 40
|
||||
kThemeTextColorTabNonFrontPressed = 41
|
||||
kThemeTextColorTabFrontInactive = 42
|
||||
kThemeTextColorTabNonFrontInactive = 43
|
||||
kThemeTextColorIconLabelSelected = 44
|
||||
kThemeTextColorBevelButtonStickyActive = 45
|
||||
kThemeTextColorBevelButtonStickyInactive = 46
|
||||
kThemeTextColorNotification = 47
|
||||
kThemeTextColorBlack = -1
|
||||
kThemeTextColorWhite = -2
|
||||
kThemeStateInactive = 0
|
||||
kThemeStateActive = 1
|
||||
kThemeStatePressed = 2
|
||||
kThemeStateRollover = 6
|
||||
kThemeStateUnavailable = 7
|
||||
kThemeStateUnavailableInactive = 8
|
||||
kThemeStateDisabled = 0
|
||||
kThemeStatePressedUp = 2
|
||||
kThemeStatePressedDown = 3
|
||||
kThemeArrowCursor = 0
|
||||
kThemeCopyArrowCursor = 1
|
||||
kThemeAliasArrowCursor = 2
|
||||
kThemeContextualMenuArrowCursor = 3
|
||||
kThemeIBeamCursor = 4
|
||||
kThemeCrossCursor = 5
|
||||
kThemePlusCursor = 6
|
||||
kThemeWatchCursor = 7
|
||||
kThemeClosedHandCursor = 8
|
||||
kThemeOpenHandCursor = 9
|
||||
kThemePointingHandCursor = 10
|
||||
kThemeCountingUpHandCursor = 11
|
||||
kThemeCountingDownHandCursor = 12
|
||||
kThemeCountingUpAndDownHandCursor = 13
|
||||
kThemeSpinningCursor = 14
|
||||
kThemeResizeLeftCursor = 15
|
||||
kThemeResizeRightCursor = 16
|
||||
kThemeResizeLeftRightCursor = 17
|
||||
kThemeMenuBarNormal = 0
|
||||
kThemeMenuBarSelected = 1
|
||||
kThemeMenuSquareMenuBar = (1 << 0)
|
||||
kThemeMenuActive = 0
|
||||
kThemeMenuSelected = 1
|
||||
kThemeMenuDisabled = 3
|
||||
kThemeMenuTypePullDown = 0
|
||||
kThemeMenuTypePopUp = 1
|
||||
kThemeMenuTypeHierarchical = 2
|
||||
kThemeMenuTypeInactive = 0x0100
|
||||
kThemeMenuItemPlain = 0
|
||||
kThemeMenuItemHierarchical = 1
|
||||
kThemeMenuItemScrollUpArrow = 2
|
||||
kThemeMenuItemScrollDownArrow = 3
|
||||
kThemeMenuItemAtTop = 0x0100
|
||||
kThemeMenuItemAtBottom = 0x0200
|
||||
kThemeMenuItemHierBackground = 0x0400
|
||||
kThemeMenuItemPopUpBackground = 0x0800
|
||||
kThemeMenuItemHasIcon = 0x8000
|
||||
kThemeMenuItemNoBackground = 0x4000
|
||||
kThemeBackgroundTabPane = 1
|
||||
kThemeBackgroundPlacard = 2
|
||||
kThemeBackgroundWindowHeader = 3
|
||||
kThemeBackgroundListViewWindowHeader = 4
|
||||
kThemeBackgroundSecondaryGroupBox = 5
|
||||
kThemeNameTag = FOUR_CHAR_CODE('name')
|
||||
kThemeVariantNameTag = FOUR_CHAR_CODE('varn')
|
||||
kThemeVariantBaseTintTag = FOUR_CHAR_CODE('tint')
|
||||
kThemeHighlightColorTag = FOUR_CHAR_CODE('hcol')
|
||||
kThemeScrollBarArrowStyleTag = FOUR_CHAR_CODE('sbar')
|
||||
kThemeScrollBarThumbStyleTag = FOUR_CHAR_CODE('sbth')
|
||||
kThemeSoundsEnabledTag = FOUR_CHAR_CODE('snds')
|
||||
kThemeDblClickCollapseTag = FOUR_CHAR_CODE('coll')
|
||||
kThemeAppearanceFileNameTag = FOUR_CHAR_CODE('thme')
|
||||
kThemeSystemFontTag = FOUR_CHAR_CODE('lgsf')
|
||||
kThemeSmallSystemFontTag = FOUR_CHAR_CODE('smsf')
|
||||
kThemeViewsFontTag = FOUR_CHAR_CODE('vfnt')
|
||||
kThemeViewsFontSizeTag = FOUR_CHAR_CODE('vfsz')
|
||||
kThemeDesktopPatternNameTag = FOUR_CHAR_CODE('patn')
|
||||
kThemeDesktopPatternTag = FOUR_CHAR_CODE('patt')
|
||||
kThemeDesktopPictureNameTag = FOUR_CHAR_CODE('dpnm')
|
||||
kThemeDesktopPictureAliasTag = FOUR_CHAR_CODE('dpal')
|
||||
kThemeDesktopPictureAlignmentTag = FOUR_CHAR_CODE('dpan')
|
||||
kThemeHighlightColorNameTag = FOUR_CHAR_CODE('hcnm')
|
||||
kThemeExamplePictureIDTag = FOUR_CHAR_CODE('epic')
|
||||
kThemeSoundTrackNameTag = FOUR_CHAR_CODE('sndt')
|
||||
kThemeSoundMaskTag = FOUR_CHAR_CODE('smsk')
|
||||
kThemeUserDefinedTag = FOUR_CHAR_CODE('user')
|
||||
kThemeSmoothFontEnabledTag = FOUR_CHAR_CODE('smoo')
|
||||
kThemeSmoothFontMinSizeTag = FOUR_CHAR_CODE('smos')
|
||||
kTiledOnScreen = 1
|
||||
kCenterOnScreen = 2
|
||||
kFitToScreen = 3
|
||||
kFillScreen = 4
|
||||
kUseBestGuess = 5
|
||||
kThemeCheckBoxClassicX = 0
|
||||
kThemeCheckBoxCheckMark = 1
|
||||
kThemeScrollBarArrowsSingle = 0
|
||||
kThemeScrollBarArrowsLowerRight = 1
|
||||
kThemeScrollBarThumbNormal = 0
|
||||
kThemeScrollBarThumbProportional = 1
|
||||
kThemeSystemFont = 0
|
||||
kThemeSmallSystemFont = 1
|
||||
kThemeSmallEmphasizedSystemFont = 2
|
||||
kThemeViewsFont = 3
|
||||
kThemeEmphasizedSystemFont = 4
|
||||
kThemeApplicationFont = 5
|
||||
kThemeLabelFont = 6
|
||||
kThemeMenuTitleFont = 100
|
||||
kThemeMenuItemFont = 101
|
||||
kThemeMenuItemMarkFont = 102
|
||||
kThemeMenuItemCmdKeyFont = 103
|
||||
kThemeWindowTitleFont = 104
|
||||
kThemePushButtonFont = 105
|
||||
kThemeUtilityWindowTitleFont = 106
|
||||
kThemeAlertHeaderFont = 107
|
||||
kThemeCurrentPortFont = 200
|
||||
kThemeTabNonFront = 0
|
||||
kThemeTabNonFrontPressed = 1
|
||||
kThemeTabNonFrontInactive = 2
|
||||
kThemeTabFront = 3
|
||||
kThemeTabFrontInactive = 4
|
||||
kThemeTabNonFrontUnavailable = 5
|
||||
kThemeTabFrontUnavailable = 6
|
||||
kThemeTabNorth = 0
|
||||
kThemeTabSouth = 1
|
||||
kThemeTabEast = 2
|
||||
kThemeTabWest = 3
|
||||
kThemeSmallTabHeight = 16
|
||||
kThemeLargeTabHeight = 21
|
||||
kThemeTabPaneOverlap = 3
|
||||
kThemeSmallTabHeightMax = 19
|
||||
kThemeLargeTabHeightMax = 24
|
||||
kThemeMediumScrollBar = 0
|
||||
kThemeSmallScrollBar = 1
|
||||
kThemeMediumSlider = 2
|
||||
kThemeMediumProgressBar = 3
|
||||
kThemeMediumIndeterminateBar = 4
|
||||
kThemeRelevanceBar = 5
|
||||
kThemeSmallSlider = 6
|
||||
kThemeLargeProgressBar = 7
|
||||
kThemeLargeIndeterminateBar = 8
|
||||
kThemeTrackActive = 0
|
||||
kThemeTrackDisabled = 1
|
||||
kThemeTrackNothingToScroll = 2
|
||||
kThemeTrackInactive = 3
|
||||
kThemeLeftOutsideArrowPressed = 0x01
|
||||
kThemeLeftInsideArrowPressed = 0x02
|
||||
kThemeLeftTrackPressed = 0x04
|
||||
kThemeThumbPressed = 0x08
|
||||
kThemeRightTrackPressed = 0x10
|
||||
kThemeRightInsideArrowPressed = 0x20
|
||||
kThemeRightOutsideArrowPressed = 0x40
|
||||
kThemeTopOutsideArrowPressed = kThemeLeftOutsideArrowPressed
|
||||
kThemeTopInsideArrowPressed = kThemeLeftInsideArrowPressed
|
||||
kThemeTopTrackPressed = kThemeLeftTrackPressed
|
||||
kThemeBottomTrackPressed = kThemeRightTrackPressed
|
||||
kThemeBottomInsideArrowPressed = kThemeRightInsideArrowPressed
|
||||
kThemeBottomOutsideArrowPressed = kThemeRightOutsideArrowPressed
|
||||
kThemeThumbPlain = 0
|
||||
kThemeThumbUpward = 1
|
||||
kThemeThumbDownward = 2
|
||||
kThemeTrackHorizontal = (1 << 0)
|
||||
kThemeTrackRightToLeft = (1 << 1)
|
||||
kThemeTrackShowThumb = (1 << 2)
|
||||
kThemeTrackThumbRgnIsNotGhost = (1 << 3)
|
||||
kThemeTrackNoScrollBarArrows = (1 << 4)
|
||||
kThemeWindowHasGrow = (1 << 0)
|
||||
kThemeWindowHasHorizontalZoom = (1 << 3)
|
||||
kThemeWindowHasVerticalZoom = (1 << 4)
|
||||
kThemeWindowHasFullZoom = kThemeWindowHasHorizontalZoom + kThemeWindowHasVerticalZoom
|
||||
kThemeWindowHasCloseBox = (1 << 5)
|
||||
kThemeWindowHasCollapseBox = (1 << 6)
|
||||
kThemeWindowHasTitleText = (1 << 7)
|
||||
kThemeWindowIsCollapsed = (1 << 8)
|
||||
kThemeWindowHasDirty = (1 << 9)
|
||||
kThemeDocumentWindow = 0
|
||||
kThemeDialogWindow = 1
|
||||
kThemeMovableDialogWindow = 2
|
||||
kThemeAlertWindow = 3
|
||||
kThemeMovableAlertWindow = 4
|
||||
kThemePlainDialogWindow = 5
|
||||
kThemeShadowDialogWindow = 6
|
||||
kThemePopupWindow = 7
|
||||
kThemeUtilityWindow = 8
|
||||
kThemeUtilitySideWindow = 9
|
||||
kThemeSheetWindow = 10
|
||||
kThemeDrawerWindow = 11
|
||||
kThemeWidgetCloseBox = 0
|
||||
kThemeWidgetZoomBox = 1
|
||||
kThemeWidgetCollapseBox = 2
|
||||
kThemeWidgetDirtyCloseBox = 6
|
||||
kThemeArrowLeft = 0
|
||||
kThemeArrowDown = 1
|
||||
kThemeArrowRight = 2
|
||||
kThemeArrowUp = 3
|
||||
kThemeArrow3pt = 0
|
||||
kThemeArrow5pt = 1
|
||||
kThemeArrow7pt = 2
|
||||
kThemeArrow9pt = 3
|
||||
kThemeGrowLeft = (1 << 0)
|
||||
kThemeGrowRight = (1 << 1)
|
||||
kThemeGrowUp = (1 << 2)
|
||||
kThemeGrowDown = (1 << 3)
|
||||
kThemePushButton = 0
|
||||
kThemeCheckBox = 1
|
||||
kThemeRadioButton = 2
|
||||
kThemeBevelButton = 3
|
||||
kThemeArrowButton = 4
|
||||
kThemePopupButton = 5
|
||||
kThemeDisclosureButton = 6
|
||||
kThemeIncDecButton = 7
|
||||
kThemeSmallBevelButton = 8
|
||||
kThemeMediumBevelButton = 3
|
||||
kThemeLargeBevelButton = 9
|
||||
kThemeListHeaderButton = 10
|
||||
kThemeRoundButton = 11
|
||||
kThemeLargeRoundButton = 12
|
||||
kThemeSmallCheckBox = 13
|
||||
kThemeSmallRadioButton = 14
|
||||
kThemeRoundedBevelButton = 15
|
||||
kThemeNormalCheckBox = kThemeCheckBox
|
||||
kThemeNormalRadioButton = kThemeRadioButton
|
||||
kThemeButtonOff = 0
|
||||
kThemeButtonOn = 1
|
||||
kThemeButtonMixed = 2
|
||||
kThemeDisclosureRight = 0
|
||||
kThemeDisclosureDown = 1
|
||||
kThemeDisclosureLeft = 2
|
||||
kThemeAdornmentNone = 0
|
||||
kThemeAdornmentDefault = (1 << 0)
|
||||
kThemeAdornmentFocus = (1 << 2)
|
||||
kThemeAdornmentRightToLeft = (1 << 4)
|
||||
kThemeAdornmentDrawIndicatorOnly = (1 << 5)
|
||||
kThemeAdornmentHeaderButtonLeftNeighborSelected = (1 << 6)
|
||||
kThemeAdornmentHeaderButtonRightNeighborSelected = (1 << 7)
|
||||
kThemeAdornmentHeaderButtonSortUp = (1 << 8)
|
||||
kThemeAdornmentHeaderMenuButton = (1 << 9)
|
||||
kThemeAdornmentHeaderButtonNoShadow = (1 << 10)
|
||||
kThemeAdornmentHeaderButtonShadowOnly = (1 << 11)
|
||||
kThemeAdornmentNoShadow = kThemeAdornmentHeaderButtonNoShadow
|
||||
kThemeAdornmentShadowOnly = kThemeAdornmentHeaderButtonShadowOnly
|
||||
kThemeAdornmentArrowLeftArrow = (1 << 6)
|
||||
kThemeAdornmentArrowDownArrow = (1 << 7)
|
||||
kThemeAdornmentArrowDoubleArrow = (1 << 8)
|
||||
kThemeAdornmentArrowUpArrow = (1 << 9)
|
||||
kThemeNoSounds = 0
|
||||
kThemeWindowSoundsMask = (1 << 0)
|
||||
kThemeMenuSoundsMask = (1 << 1)
|
||||
kThemeControlSoundsMask = (1 << 2)
|
||||
kThemeFinderSoundsMask = (1 << 3)
|
||||
kThemeDragSoundNone = 0
|
||||
kThemeDragSoundMoveWindow = FOUR_CHAR_CODE('wmov')
|
||||
kThemeDragSoundGrowWindow = FOUR_CHAR_CODE('wgro')
|
||||
kThemeDragSoundMoveUtilWindow = FOUR_CHAR_CODE('umov')
|
||||
kThemeDragSoundGrowUtilWindow = FOUR_CHAR_CODE('ugro')
|
||||
kThemeDragSoundMoveDialog = FOUR_CHAR_CODE('dmov')
|
||||
kThemeDragSoundMoveAlert = FOUR_CHAR_CODE('amov')
|
||||
kThemeDragSoundMoveIcon = FOUR_CHAR_CODE('imov')
|
||||
kThemeDragSoundSliderThumb = FOUR_CHAR_CODE('slth')
|
||||
kThemeDragSoundSliderGhost = FOUR_CHAR_CODE('slgh')
|
||||
kThemeDragSoundScrollBarThumb = FOUR_CHAR_CODE('sbth')
|
||||
kThemeDragSoundScrollBarGhost = FOUR_CHAR_CODE('sbgh')
|
||||
kThemeDragSoundScrollBarArrowDecreasing = FOUR_CHAR_CODE('sbad')
|
||||
kThemeDragSoundScrollBarArrowIncreasing = FOUR_CHAR_CODE('sbai')
|
||||
kThemeDragSoundDragging = FOUR_CHAR_CODE('drag')
|
||||
kThemeSoundNone = 0
|
||||
kThemeSoundMenuOpen = FOUR_CHAR_CODE('mnuo')
|
||||
kThemeSoundMenuClose = FOUR_CHAR_CODE('mnuc')
|
||||
kThemeSoundMenuItemHilite = FOUR_CHAR_CODE('mnui')
|
||||
kThemeSoundMenuItemRelease = FOUR_CHAR_CODE('mnus')
|
||||
kThemeSoundWindowClosePress = FOUR_CHAR_CODE('wclp')
|
||||
kThemeSoundWindowCloseEnter = FOUR_CHAR_CODE('wcle')
|
||||
kThemeSoundWindowCloseExit = FOUR_CHAR_CODE('wclx')
|
||||
kThemeSoundWindowCloseRelease = FOUR_CHAR_CODE('wclr')
|
||||
kThemeSoundWindowZoomPress = FOUR_CHAR_CODE('wzmp')
|
||||
kThemeSoundWindowZoomEnter = FOUR_CHAR_CODE('wzme')
|
||||
kThemeSoundWindowZoomExit = FOUR_CHAR_CODE('wzmx')
|
||||
kThemeSoundWindowZoomRelease = FOUR_CHAR_CODE('wzmr')
|
||||
kThemeSoundWindowCollapsePress = FOUR_CHAR_CODE('wcop')
|
||||
kThemeSoundWindowCollapseEnter = FOUR_CHAR_CODE('wcoe')
|
||||
kThemeSoundWindowCollapseExit = FOUR_CHAR_CODE('wcox')
|
||||
kThemeSoundWindowCollapseRelease = FOUR_CHAR_CODE('wcor')
|
||||
kThemeSoundWindowDragBoundary = FOUR_CHAR_CODE('wdbd')
|
||||
kThemeSoundUtilWinClosePress = FOUR_CHAR_CODE('uclp')
|
||||
kThemeSoundUtilWinCloseEnter = FOUR_CHAR_CODE('ucle')
|
||||
kThemeSoundUtilWinCloseExit = FOUR_CHAR_CODE('uclx')
|
||||
kThemeSoundUtilWinCloseRelease = FOUR_CHAR_CODE('uclr')
|
||||
kThemeSoundUtilWinZoomPress = FOUR_CHAR_CODE('uzmp')
|
||||
kThemeSoundUtilWinZoomEnter = FOUR_CHAR_CODE('uzme')
|
||||
kThemeSoundUtilWinZoomExit = FOUR_CHAR_CODE('uzmx')
|
||||
kThemeSoundUtilWinZoomRelease = FOUR_CHAR_CODE('uzmr')
|
||||
kThemeSoundUtilWinCollapsePress = FOUR_CHAR_CODE('ucop')
|
||||
kThemeSoundUtilWinCollapseEnter = FOUR_CHAR_CODE('ucoe')
|
||||
kThemeSoundUtilWinCollapseExit = FOUR_CHAR_CODE('ucox')
|
||||
kThemeSoundUtilWinCollapseRelease = FOUR_CHAR_CODE('ucor')
|
||||
kThemeSoundUtilWinDragBoundary = FOUR_CHAR_CODE('udbd')
|
||||
kThemeSoundWindowOpen = FOUR_CHAR_CODE('wopn')
|
||||
kThemeSoundWindowClose = FOUR_CHAR_CODE('wcls')
|
||||
kThemeSoundWindowZoomIn = FOUR_CHAR_CODE('wzmi')
|
||||
kThemeSoundWindowZoomOut = FOUR_CHAR_CODE('wzmo')
|
||||
kThemeSoundWindowCollapseUp = FOUR_CHAR_CODE('wcol')
|
||||
kThemeSoundWindowCollapseDown = FOUR_CHAR_CODE('wexp')
|
||||
kThemeSoundWindowActivate = FOUR_CHAR_CODE('wact')
|
||||
kThemeSoundUtilWindowOpen = FOUR_CHAR_CODE('uopn')
|
||||
kThemeSoundUtilWindowClose = FOUR_CHAR_CODE('ucls')
|
||||
kThemeSoundUtilWindowZoomIn = FOUR_CHAR_CODE('uzmi')
|
||||
kThemeSoundUtilWindowZoomOut = FOUR_CHAR_CODE('uzmo')
|
||||
kThemeSoundUtilWindowCollapseUp = FOUR_CHAR_CODE('ucol')
|
||||
kThemeSoundUtilWindowCollapseDown = FOUR_CHAR_CODE('uexp')
|
||||
kThemeSoundUtilWindowActivate = FOUR_CHAR_CODE('uact')
|
||||
kThemeSoundDialogOpen = FOUR_CHAR_CODE('dopn')
|
||||
kThemeSoundDialogClose = FOUR_CHAR_CODE('dlgc')
|
||||
kThemeSoundAlertOpen = FOUR_CHAR_CODE('aopn')
|
||||
kThemeSoundAlertClose = FOUR_CHAR_CODE('altc')
|
||||
kThemeSoundPopupWindowOpen = FOUR_CHAR_CODE('pwop')
|
||||
kThemeSoundPopupWindowClose = FOUR_CHAR_CODE('pwcl')
|
||||
kThemeSoundButtonPress = FOUR_CHAR_CODE('btnp')
|
||||
kThemeSoundButtonEnter = FOUR_CHAR_CODE('btne')
|
||||
kThemeSoundButtonExit = FOUR_CHAR_CODE('btnx')
|
||||
kThemeSoundButtonRelease = FOUR_CHAR_CODE('btnr')
|
||||
kThemeSoundDefaultButtonPress = FOUR_CHAR_CODE('dbtp')
|
||||
kThemeSoundDefaultButtonEnter = FOUR_CHAR_CODE('dbte')
|
||||
kThemeSoundDefaultButtonExit = FOUR_CHAR_CODE('dbtx')
|
||||
kThemeSoundDefaultButtonRelease = FOUR_CHAR_CODE('dbtr')
|
||||
kThemeSoundCancelButtonPress = FOUR_CHAR_CODE('cbtp')
|
||||
kThemeSoundCancelButtonEnter = FOUR_CHAR_CODE('cbte')
|
||||
kThemeSoundCancelButtonExit = FOUR_CHAR_CODE('cbtx')
|
||||
kThemeSoundCancelButtonRelease = FOUR_CHAR_CODE('cbtr')
|
||||
kThemeSoundCheckboxPress = FOUR_CHAR_CODE('chkp')
|
||||
kThemeSoundCheckboxEnter = FOUR_CHAR_CODE('chke')
|
||||
kThemeSoundCheckboxExit = FOUR_CHAR_CODE('chkx')
|
||||
kThemeSoundCheckboxRelease = FOUR_CHAR_CODE('chkr')
|
||||
kThemeSoundRadioPress = FOUR_CHAR_CODE('radp')
|
||||
kThemeSoundRadioEnter = FOUR_CHAR_CODE('rade')
|
||||
kThemeSoundRadioExit = FOUR_CHAR_CODE('radx')
|
||||
kThemeSoundRadioRelease = FOUR_CHAR_CODE('radr')
|
||||
kThemeSoundScrollArrowPress = FOUR_CHAR_CODE('sbap')
|
||||
kThemeSoundScrollArrowEnter = FOUR_CHAR_CODE('sbae')
|
||||
kThemeSoundScrollArrowExit = FOUR_CHAR_CODE('sbax')
|
||||
kThemeSoundScrollArrowRelease = FOUR_CHAR_CODE('sbar')
|
||||
kThemeSoundScrollEndOfTrack = FOUR_CHAR_CODE('sbte')
|
||||
kThemeSoundScrollTrackPress = FOUR_CHAR_CODE('sbtp')
|
||||
kThemeSoundSliderEndOfTrack = FOUR_CHAR_CODE('slte')
|
||||
kThemeSoundSliderTrackPress = FOUR_CHAR_CODE('sltp')
|
||||
kThemeSoundBalloonOpen = FOUR_CHAR_CODE('blno')
|
||||
kThemeSoundBalloonClose = FOUR_CHAR_CODE('blnc')
|
||||
kThemeSoundBevelPress = FOUR_CHAR_CODE('bevp')
|
||||
kThemeSoundBevelEnter = FOUR_CHAR_CODE('beve')
|
||||
kThemeSoundBevelExit = FOUR_CHAR_CODE('bevx')
|
||||
kThemeSoundBevelRelease = FOUR_CHAR_CODE('bevr')
|
||||
kThemeSoundLittleArrowUpPress = FOUR_CHAR_CODE('laup')
|
||||
kThemeSoundLittleArrowDnPress = FOUR_CHAR_CODE('ladp')
|
||||
kThemeSoundLittleArrowEnter = FOUR_CHAR_CODE('lare')
|
||||
kThemeSoundLittleArrowExit = FOUR_CHAR_CODE('larx')
|
||||
kThemeSoundLittleArrowUpRelease = FOUR_CHAR_CODE('laur')
|
||||
kThemeSoundLittleArrowDnRelease = FOUR_CHAR_CODE('ladr')
|
||||
kThemeSoundPopupPress = FOUR_CHAR_CODE('popp')
|
||||
kThemeSoundPopupEnter = FOUR_CHAR_CODE('pope')
|
||||
kThemeSoundPopupExit = FOUR_CHAR_CODE('popx')
|
||||
kThemeSoundPopupRelease = FOUR_CHAR_CODE('popr')
|
||||
kThemeSoundDisclosurePress = FOUR_CHAR_CODE('dscp')
|
||||
kThemeSoundDisclosureEnter = FOUR_CHAR_CODE('dsce')
|
||||
kThemeSoundDisclosureExit = FOUR_CHAR_CODE('dscx')
|
||||
kThemeSoundDisclosureRelease = FOUR_CHAR_CODE('dscr')
|
||||
kThemeSoundTabPressed = FOUR_CHAR_CODE('tabp')
|
||||
kThemeSoundTabEnter = FOUR_CHAR_CODE('tabe')
|
||||
kThemeSoundTabExit = FOUR_CHAR_CODE('tabx')
|
||||
kThemeSoundTabRelease = FOUR_CHAR_CODE('tabr')
|
||||
kThemeSoundDragTargetHilite = FOUR_CHAR_CODE('dthi')
|
||||
kThemeSoundDragTargetUnhilite = FOUR_CHAR_CODE('dtuh')
|
||||
kThemeSoundDragTargetDrop = FOUR_CHAR_CODE('dtdr')
|
||||
kThemeSoundEmptyTrash = FOUR_CHAR_CODE('ftrs')
|
||||
kThemeSoundSelectItem = FOUR_CHAR_CODE('fsel')
|
||||
kThemeSoundNewItem = FOUR_CHAR_CODE('fnew')
|
||||
kThemeSoundReceiveDrop = FOUR_CHAR_CODE('fdrp')
|
||||
kThemeSoundCopyDone = FOUR_CHAR_CODE('fcpd')
|
||||
kThemeSoundResolveAlias = FOUR_CHAR_CODE('fral')
|
||||
kThemeSoundLaunchApp = FOUR_CHAR_CODE('flap')
|
||||
kThemeSoundDiskInsert = FOUR_CHAR_CODE('dski')
|
||||
kThemeSoundDiskEject = FOUR_CHAR_CODE('dske')
|
||||
kThemeSoundFinderDragOnIcon = FOUR_CHAR_CODE('fdon')
|
||||
kThemeSoundFinderDragOffIcon = FOUR_CHAR_CODE('fdof')
|
||||
kThemePopupTabNormalPosition = 0
|
||||
kThemePopupTabCenterOnWindow = 1
|
||||
kThemePopupTabCenterOnOffset = 2
|
||||
kThemeMetricScrollBarWidth = 0
|
||||
kThemeMetricSmallScrollBarWidth = 1
|
||||
kThemeMetricCheckBoxHeight = 2
|
||||
kThemeMetricRadioButtonHeight = 3
|
||||
kThemeMetricEditTextWhitespace = 4
|
||||
kThemeMetricEditTextFrameOutset = 5
|
||||
kThemeMetricListBoxFrameOutset = 6
|
||||
kThemeMetricFocusRectOutset = 7
|
||||
kThemeMetricImageWellThickness = 8
|
||||
kThemeMetricScrollBarOverlap = 9
|
||||
kThemeMetricLargeTabHeight = 10
|
||||
kThemeMetricLargeTabCapsWidth = 11
|
||||
kThemeMetricTabFrameOverlap = 12
|
||||
kThemeMetricTabIndentOrStyle = 13
|
||||
kThemeMetricTabOverlap = 14
|
||||
kThemeMetricSmallTabHeight = 15
|
||||
kThemeMetricSmallTabCapsWidth = 16
|
||||
kThemeMetricDisclosureButtonHeight = 17
|
||||
kThemeMetricRoundButtonSize = 18
|
||||
kThemeMetricPushButtonHeight = 19
|
||||
kThemeMetricListHeaderHeight = 20
|
||||
kThemeMetricSmallCheckBoxHeight = 21
|
||||
kThemeMetricDisclosureButtonWidth = 22
|
||||
kThemeMetricSmallDisclosureButtonHeight = 23
|
||||
kThemeMetricSmallDisclosureButtonWidth = 24
|
||||
kThemeMetricDisclosureTriangleHeight = 25
|
||||
kThemeMetricDisclosureTriangleWidth = 26
|
||||
kThemeMetricLittleArrowsHeight = 27
|
||||
kThemeMetricLittleArrowsWidth = 28
|
||||
kThemeMetricPaneSplitterHeight = 29
|
||||
kThemeMetricPopupButtonHeight = 30
|
||||
kThemeMetricSmallPopupButtonHeight = 31
|
||||
kThemeMetricLargeProgressBarThickness = 32
|
||||
kThemeMetricPullDownHeight = 33
|
||||
kThemeMetricSmallPullDownHeight = 34
|
||||
kThemeMetricSmallPushButtonHeight = 35
|
||||
kThemeMetricSmallRadioButtonHeight = 36
|
||||
kThemeMetricRelevanceIndicatorHeight = 37
|
||||
kThemeMetricResizeControlHeight = 38
|
||||
kThemeMetricSmallResizeControlHeight = 39
|
||||
kThemeMetricLargeRoundButtonSize = 40
|
||||
kThemeMetricHSliderHeight = 41
|
||||
kThemeMetricHSliderTickHeight = 42
|
||||
kThemeMetricSmallHSliderHeight = 43
|
||||
kThemeMetricSmallHSliderTickHeight = 44
|
||||
kThemeMetricVSliderWidth = 45
|
||||
kThemeMetricVSliderTickWidth = 46
|
||||
kThemeMetricSmallVSliderWidth = 47
|
||||
kThemeMetricSmallVSliderTickWidth = 48
|
||||
kThemeMetricTitleBarControlsHeight = 49
|
||||
kThemeMetricCheckBoxWidth = 50
|
||||
kThemeMetricSmallCheckBoxWidth = 51
|
||||
kThemeMetricRadioButtonWidth = 52
|
||||
kThemeMetricSmallRadioButtonWidth = 53
|
||||
kThemeMetricSmallHSliderMinThumbWidth = 54
|
||||
kThemeMetricSmallVSliderMinThumbHeight = 55
|
||||
kThemeMetricSmallHSliderTickOffset = 56
|
||||
kThemeMetricSmallVSliderTickOffset = 57
|
||||
kThemeMetricNormalProgressBarThickness = 58
|
||||
kThemeMetricProgressBarShadowOutset = 59
|
||||
kThemeMetricSmallProgressBarShadowOutset = 60
|
||||
kThemeMetricPrimaryGroupBoxContentInset = 61
|
||||
kThemeMetricSecondaryGroupBoxContentInset = 62
|
||||
kThemeMetricMenuMarkColumnWidth = 63
|
||||
kThemeMetricMenuExcludedMarkColumnWidth = 64
|
||||
kThemeMetricMenuMarkIndent = 65
|
||||
kThemeMetricMenuTextLeadingEdgeMargin = 66
|
||||
kThemeMetricMenuTextTrailingEdgeMargin = 67
|
||||
kThemeMetricMenuIndentWidth = 68
|
||||
kThemeMetricMenuIconTrailingEdgeMargin = 69
|
||||
# appearanceBadBrushIndexErr = themeInvalidBrushErr
|
||||
# appearanceProcessRegisteredErr = themeProcessRegisteredErr
|
||||
# appearanceProcessNotRegisteredErr = themeProcessNotRegisteredErr
|
||||
# appearanceBadTextColorIndexErr = themeBadTextColorErr
|
||||
# appearanceThemeHasNoAccents = themeHasNoAccentsErr
|
||||
# appearanceBadCursorIndexErr = themeBadCursorIndexErr
|
||||
kThemeActiveDialogBackgroundBrush = kThemeBrushDialogBackgroundActive
|
||||
kThemeInactiveDialogBackgroundBrush = kThemeBrushDialogBackgroundInactive
|
||||
kThemeActiveAlertBackgroundBrush = kThemeBrushAlertBackgroundActive
|
||||
kThemeInactiveAlertBackgroundBrush = kThemeBrushAlertBackgroundInactive
|
||||
kThemeActiveModelessDialogBackgroundBrush = kThemeBrushModelessDialogBackgroundActive
|
||||
kThemeInactiveModelessDialogBackgroundBrush = kThemeBrushModelessDialogBackgroundInactive
|
||||
kThemeActiveUtilityWindowBackgroundBrush = kThemeBrushUtilityWindowBackgroundActive
|
||||
kThemeInactiveUtilityWindowBackgroundBrush = kThemeBrushUtilityWindowBackgroundInactive
|
||||
kThemeListViewSortColumnBackgroundBrush = kThemeBrushListViewSortColumnBackground
|
||||
kThemeListViewBackgroundBrush = kThemeBrushListViewBackground
|
||||
kThemeIconLabelBackgroundBrush = kThemeBrushIconLabelBackground
|
||||
kThemeListViewSeparatorBrush = kThemeBrushListViewSeparator
|
||||
kThemeChasingArrowsBrush = kThemeBrushChasingArrows
|
||||
kThemeDragHiliteBrush = kThemeBrushDragHilite
|
||||
kThemeDocumentWindowBackgroundBrush = kThemeBrushDocumentWindowBackground
|
||||
kThemeFinderWindowBackgroundBrush = kThemeBrushFinderWindowBackground
|
||||
kThemeActiveScrollBarDelimiterBrush = kThemeBrushScrollBarDelimiterActive
|
||||
kThemeInactiveScrollBarDelimiterBrush = kThemeBrushScrollBarDelimiterInactive
|
||||
kThemeFocusHighlightBrush = kThemeBrushFocusHighlight
|
||||
kThemeActivePopupArrowBrush = kThemeBrushPopupArrowActive
|
||||
kThemePressedPopupArrowBrush = kThemeBrushPopupArrowPressed
|
||||
kThemeInactivePopupArrowBrush = kThemeBrushPopupArrowInactive
|
||||
kThemeAppleGuideCoachmarkBrush = kThemeBrushAppleGuideCoachmark
|
||||
kThemeActiveDialogTextColor = kThemeTextColorDialogActive
|
||||
kThemeInactiveDialogTextColor = kThemeTextColorDialogInactive
|
||||
kThemeActiveAlertTextColor = kThemeTextColorAlertActive
|
||||
kThemeInactiveAlertTextColor = kThemeTextColorAlertInactive
|
||||
kThemeActiveModelessDialogTextColor = kThemeTextColorModelessDialogActive
|
||||
kThemeInactiveModelessDialogTextColor = kThemeTextColorModelessDialogInactive
|
||||
kThemeActiveWindowHeaderTextColor = kThemeTextColorWindowHeaderActive
|
||||
kThemeInactiveWindowHeaderTextColor = kThemeTextColorWindowHeaderInactive
|
||||
kThemeActivePlacardTextColor = kThemeTextColorPlacardActive
|
||||
kThemeInactivePlacardTextColor = kThemeTextColorPlacardInactive
|
||||
kThemePressedPlacardTextColor = kThemeTextColorPlacardPressed
|
||||
kThemeActivePushButtonTextColor = kThemeTextColorPushButtonActive
|
||||
kThemeInactivePushButtonTextColor = kThemeTextColorPushButtonInactive
|
||||
kThemePressedPushButtonTextColor = kThemeTextColorPushButtonPressed
|
||||
kThemeActiveBevelButtonTextColor = kThemeTextColorBevelButtonActive
|
||||
kThemeInactiveBevelButtonTextColor = kThemeTextColorBevelButtonInactive
|
||||
kThemePressedBevelButtonTextColor = kThemeTextColorBevelButtonPressed
|
||||
kThemeActivePopupButtonTextColor = kThemeTextColorPopupButtonActive
|
||||
kThemeInactivePopupButtonTextColor = kThemeTextColorPopupButtonInactive
|
||||
kThemePressedPopupButtonTextColor = kThemeTextColorPopupButtonPressed
|
||||
kThemeIconLabelTextColor = kThemeTextColorIconLabel
|
||||
kThemeListViewTextColor = kThemeTextColorListView
|
||||
kThemeActiveDocumentWindowTitleTextColor = kThemeTextColorDocumentWindowTitleActive
|
||||
kThemeInactiveDocumentWindowTitleTextColor = kThemeTextColorDocumentWindowTitleInactive
|
||||
kThemeActiveMovableModalWindowTitleTextColor = kThemeTextColorMovableModalWindowTitleActive
|
||||
kThemeInactiveMovableModalWindowTitleTextColor = kThemeTextColorMovableModalWindowTitleInactive
|
||||
kThemeActiveUtilityWindowTitleTextColor = kThemeTextColorUtilityWindowTitleActive
|
||||
kThemeInactiveUtilityWindowTitleTextColor = kThemeTextColorUtilityWindowTitleInactive
|
||||
kThemeActivePopupWindowTitleColor = kThemeTextColorPopupWindowTitleActive
|
||||
kThemeInactivePopupWindowTitleColor = kThemeTextColorPopupWindowTitleInactive
|
||||
kThemeActiveRootMenuTextColor = kThemeTextColorRootMenuActive
|
||||
kThemeSelectedRootMenuTextColor = kThemeTextColorRootMenuSelected
|
||||
kThemeDisabledRootMenuTextColor = kThemeTextColorRootMenuDisabled
|
||||
kThemeActiveMenuItemTextColor = kThemeTextColorMenuItemActive
|
||||
kThemeSelectedMenuItemTextColor = kThemeTextColorMenuItemSelected
|
||||
kThemeDisabledMenuItemTextColor = kThemeTextColorMenuItemDisabled
|
||||
kThemeActivePopupLabelTextColor = kThemeTextColorPopupLabelActive
|
||||
kThemeInactivePopupLabelTextColor = kThemeTextColorPopupLabelInactive
|
||||
kAEThemeSwitch = kAEAppearanceChanged
|
||||
kThemeNoAdornment = kThemeAdornmentNone
|
||||
kThemeDefaultAdornment = kThemeAdornmentDefault
|
||||
kThemeFocusAdornment = kThemeAdornmentFocus
|
||||
kThemeRightToLeftAdornment = kThemeAdornmentRightToLeft
|
||||
kThemeDrawIndicatorOnly = kThemeAdornmentDrawIndicatorOnly
|
||||
kThemeBrushPassiveAreaFill = kThemeBrushStaticAreaFill
|
||||
kThemeMetricCheckBoxGlyphHeight = kThemeMetricCheckBoxHeight
|
||||
kThemeMetricRadioButtonGlyphHeight = kThemeMetricRadioButtonHeight
|
||||
kThemeMetricDisclosureButtonSize = kThemeMetricDisclosureButtonHeight
|
||||
kThemeMetricBestListHeaderHeight = kThemeMetricListHeaderHeight
|
||||
kThemeMetricSmallProgressBarThickness = kThemeMetricNormalProgressBarThickness
|
||||
kThemeMetricProgressBarThickness = kThemeMetricLargeProgressBarThickness
|
||||
kThemeScrollBar = kThemeMediumScrollBar
|
||||
kThemeSlider = kThemeMediumSlider
|
||||
kThemeProgressBar = kThemeMediumProgressBar
|
||||
kThemeIndeterminateBar = kThemeMediumIndeterminateBar
|
||||
961
Darwin/lib/python2.7/plat-mac/Carbon/AppleEvents.py
Normal file
961
Darwin/lib/python2.7/plat-mac/Carbon/AppleEvents.py
Normal file
|
|
@ -0,0 +1,961 @@
|
|||
# Generated from 'AEDataModel.h'
|
||||
|
||||
def FOUR_CHAR_CODE(x): return x
|
||||
typeApplicationBundleID = FOUR_CHAR_CODE('bund')
|
||||
typeBoolean = FOUR_CHAR_CODE('bool')
|
||||
typeChar = FOUR_CHAR_CODE('TEXT')
|
||||
typeSInt16 = FOUR_CHAR_CODE('shor')
|
||||
typeSInt32 = FOUR_CHAR_CODE('long')
|
||||
typeUInt32 = FOUR_CHAR_CODE('magn')
|
||||
typeSInt64 = FOUR_CHAR_CODE('comp')
|
||||
typeIEEE32BitFloatingPoint = FOUR_CHAR_CODE('sing')
|
||||
typeIEEE64BitFloatingPoint = FOUR_CHAR_CODE('doub')
|
||||
type128BitFloatingPoint = FOUR_CHAR_CODE('ldbl')
|
||||
typeDecimalStruct = FOUR_CHAR_CODE('decm')
|
||||
typeSMInt = typeSInt16
|
||||
typeShortInteger = typeSInt16
|
||||
typeInteger = typeSInt32
|
||||
typeLongInteger = typeSInt32
|
||||
typeMagnitude = typeUInt32
|
||||
typeComp = typeSInt64
|
||||
typeSMFloat = typeIEEE32BitFloatingPoint
|
||||
typeShortFloat = typeIEEE32BitFloatingPoint
|
||||
typeFloat = typeIEEE64BitFloatingPoint
|
||||
typeLongFloat = typeIEEE64BitFloatingPoint
|
||||
typeExtended = FOUR_CHAR_CODE('exte')
|
||||
typeAEList = FOUR_CHAR_CODE('list')
|
||||
typeAERecord = FOUR_CHAR_CODE('reco')
|
||||
typeAppleEvent = FOUR_CHAR_CODE('aevt')
|
||||
typeEventRecord = FOUR_CHAR_CODE('evrc')
|
||||
typeTrue = FOUR_CHAR_CODE('true')
|
||||
typeFalse = FOUR_CHAR_CODE('fals')
|
||||
typeAlias = FOUR_CHAR_CODE('alis')
|
||||
typeEnumerated = FOUR_CHAR_CODE('enum')
|
||||
typeType = FOUR_CHAR_CODE('type')
|
||||
typeAppParameters = FOUR_CHAR_CODE('appa')
|
||||
typeProperty = FOUR_CHAR_CODE('prop')
|
||||
typeFSS = FOUR_CHAR_CODE('fss ')
|
||||
typeFSRef = FOUR_CHAR_CODE('fsrf')
|
||||
typeFileURL = FOUR_CHAR_CODE('furl')
|
||||
typeKeyword = FOUR_CHAR_CODE('keyw')
|
||||
typeSectionH = FOUR_CHAR_CODE('sect')
|
||||
typeWildCard = FOUR_CHAR_CODE('****')
|
||||
typeApplSignature = FOUR_CHAR_CODE('sign')
|
||||
typeQDRectangle = FOUR_CHAR_CODE('qdrt')
|
||||
typeFixed = FOUR_CHAR_CODE('fixd')
|
||||
typeProcessSerialNumber = FOUR_CHAR_CODE('psn ')
|
||||
typeApplicationURL = FOUR_CHAR_CODE('aprl')
|
||||
typeNull = FOUR_CHAR_CODE('null')
|
||||
typeSessionID = FOUR_CHAR_CODE('ssid')
|
||||
typeTargetID = FOUR_CHAR_CODE('targ')
|
||||
typeDispatcherID = FOUR_CHAR_CODE('dspt')
|
||||
keyTransactionIDAttr = FOUR_CHAR_CODE('tran')
|
||||
keyReturnIDAttr = FOUR_CHAR_CODE('rtid')
|
||||
keyEventClassAttr = FOUR_CHAR_CODE('evcl')
|
||||
keyEventIDAttr = FOUR_CHAR_CODE('evid')
|
||||
keyAddressAttr = FOUR_CHAR_CODE('addr')
|
||||
keyOptionalKeywordAttr = FOUR_CHAR_CODE('optk')
|
||||
keyTimeoutAttr = FOUR_CHAR_CODE('timo')
|
||||
keyInteractLevelAttr = FOUR_CHAR_CODE('inte')
|
||||
keyEventSourceAttr = FOUR_CHAR_CODE('esrc')
|
||||
keyMissedKeywordAttr = FOUR_CHAR_CODE('miss')
|
||||
keyOriginalAddressAttr = FOUR_CHAR_CODE('from')
|
||||
keyAcceptTimeoutAttr = FOUR_CHAR_CODE('actm')
|
||||
kAEDescListFactorNone = 0
|
||||
kAEDescListFactorType = 4
|
||||
kAEDescListFactorTypeAndSize = 8
|
||||
kAutoGenerateReturnID = -1
|
||||
kAnyTransactionID = 0
|
||||
kAEDataArray = 0
|
||||
kAEPackedArray = 1
|
||||
kAEDescArray = 3
|
||||
kAEKeyDescArray = 4
|
||||
kAEHandleArray = 2
|
||||
kAENormalPriority = 0x00000000
|
||||
kAEHighPriority = 0x00000001
|
||||
kAENoReply = 0x00000001
|
||||
kAEQueueReply = 0x00000002
|
||||
kAEWaitReply = 0x00000003
|
||||
kAEDontReconnect = 0x00000080
|
||||
kAEWantReceipt = 0x00000200
|
||||
kAENeverInteract = 0x00000010
|
||||
kAECanInteract = 0x00000020
|
||||
kAEAlwaysInteract = 0x00000030
|
||||
kAECanSwitchLayer = 0x00000040
|
||||
kAEDontRecord = 0x00001000
|
||||
kAEDontExecute = 0x00002000
|
||||
kAEProcessNonReplyEvents = 0x00008000
|
||||
kAEDefaultTimeout = -1
|
||||
kNoTimeOut = -2
|
||||
kAEInteractWithSelf = 0
|
||||
kAEInteractWithLocal = 1
|
||||
kAEInteractWithAll = 2
|
||||
kAEDoNotIgnoreHandler = 0x00000000
|
||||
kAEIgnoreAppPhacHandler = 0x00000001
|
||||
kAEIgnoreAppEventHandler = 0x00000002
|
||||
kAEIgnoreSysPhacHandler = 0x00000004
|
||||
kAEIgnoreSysEventHandler = 0x00000008
|
||||
kAEIngoreBuiltInEventHandler = 0x00000010
|
||||
# kAEDontDisposeOnResume = (long)0x80000000
|
||||
kAENoDispatch = 0
|
||||
# kAEUseStandardDispatch = (long)0xFFFFFFFF
|
||||
keyDirectObject = FOUR_CHAR_CODE('----')
|
||||
keyErrorNumber = FOUR_CHAR_CODE('errn')
|
||||
keyErrorString = FOUR_CHAR_CODE('errs')
|
||||
keyProcessSerialNumber = FOUR_CHAR_CODE('psn ')
|
||||
keyPreDispatch = FOUR_CHAR_CODE('phac')
|
||||
keySelectProc = FOUR_CHAR_CODE('selh')
|
||||
keyAERecorderCount = FOUR_CHAR_CODE('recr')
|
||||
keyAEVersion = FOUR_CHAR_CODE('vers')
|
||||
kCoreEventClass = FOUR_CHAR_CODE('aevt')
|
||||
kAEOpenApplication = FOUR_CHAR_CODE('oapp')
|
||||
kAEOpenDocuments = FOUR_CHAR_CODE('odoc')
|
||||
kAEPrintDocuments = FOUR_CHAR_CODE('pdoc')
|
||||
kAEQuitApplication = FOUR_CHAR_CODE('quit')
|
||||
kAEAnswer = FOUR_CHAR_CODE('ansr')
|
||||
kAEApplicationDied = FOUR_CHAR_CODE('obit')
|
||||
kAEShowPreferences = FOUR_CHAR_CODE('pref')
|
||||
kAEStartRecording = FOUR_CHAR_CODE('reca')
|
||||
kAEStopRecording = FOUR_CHAR_CODE('recc')
|
||||
kAENotifyStartRecording = FOUR_CHAR_CODE('rec1')
|
||||
kAENotifyStopRecording = FOUR_CHAR_CODE('rec0')
|
||||
kAENotifyRecording = FOUR_CHAR_CODE('recr')
|
||||
kAEUnknownSource = 0
|
||||
kAEDirectCall = 1
|
||||
kAESameProcess = 2
|
||||
kAELocalProcess = 3
|
||||
kAERemoteProcess = 4
|
||||
cAEList = FOUR_CHAR_CODE('list')
|
||||
cApplication = FOUR_CHAR_CODE('capp')
|
||||
cArc = FOUR_CHAR_CODE('carc')
|
||||
cBoolean = FOUR_CHAR_CODE('bool')
|
||||
cCell = FOUR_CHAR_CODE('ccel')
|
||||
cChar = FOUR_CHAR_CODE('cha ')
|
||||
cColorTable = FOUR_CHAR_CODE('clrt')
|
||||
cColumn = FOUR_CHAR_CODE('ccol')
|
||||
cDocument = FOUR_CHAR_CODE('docu')
|
||||
cDrawingArea = FOUR_CHAR_CODE('cdrw')
|
||||
cEnumeration = FOUR_CHAR_CODE('enum')
|
||||
cFile = FOUR_CHAR_CODE('file')
|
||||
cFixed = FOUR_CHAR_CODE('fixd')
|
||||
cFixedPoint = FOUR_CHAR_CODE('fpnt')
|
||||
cFixedRectangle = FOUR_CHAR_CODE('frct')
|
||||
cGraphicLine = FOUR_CHAR_CODE('glin')
|
||||
cGraphicObject = FOUR_CHAR_CODE('cgob')
|
||||
cGraphicShape = FOUR_CHAR_CODE('cgsh')
|
||||
cGraphicText = FOUR_CHAR_CODE('cgtx')
|
||||
cGroupedGraphic = FOUR_CHAR_CODE('cpic')
|
||||
cInsertionLoc = FOUR_CHAR_CODE('insl')
|
||||
cInsertionPoint = FOUR_CHAR_CODE('cins')
|
||||
cIntlText = FOUR_CHAR_CODE('itxt')
|
||||
cIntlWritingCode = FOUR_CHAR_CODE('intl')
|
||||
cItem = FOUR_CHAR_CODE('citm')
|
||||
cLine = FOUR_CHAR_CODE('clin')
|
||||
cLongDateTime = FOUR_CHAR_CODE('ldt ')
|
||||
cLongFixed = FOUR_CHAR_CODE('lfxd')
|
||||
cLongFixedPoint = FOUR_CHAR_CODE('lfpt')
|
||||
cLongFixedRectangle = FOUR_CHAR_CODE('lfrc')
|
||||
cLongInteger = FOUR_CHAR_CODE('long')
|
||||
cLongPoint = FOUR_CHAR_CODE('lpnt')
|
||||
cLongRectangle = FOUR_CHAR_CODE('lrct')
|
||||
cMachineLoc = FOUR_CHAR_CODE('mLoc')
|
||||
cMenu = FOUR_CHAR_CODE('cmnu')
|
||||
cMenuItem = FOUR_CHAR_CODE('cmen')
|
||||
cObject = FOUR_CHAR_CODE('cobj')
|
||||
cObjectSpecifier = FOUR_CHAR_CODE('obj ')
|
||||
cOpenableObject = FOUR_CHAR_CODE('coob')
|
||||
cOval = FOUR_CHAR_CODE('covl')
|
||||
cParagraph = FOUR_CHAR_CODE('cpar')
|
||||
cPICT = FOUR_CHAR_CODE('PICT')
|
||||
cPixel = FOUR_CHAR_CODE('cpxl')
|
||||
cPixelMap = FOUR_CHAR_CODE('cpix')
|
||||
cPolygon = FOUR_CHAR_CODE('cpgn')
|
||||
cProperty = FOUR_CHAR_CODE('prop')
|
||||
cQDPoint = FOUR_CHAR_CODE('QDpt')
|
||||
cQDRectangle = FOUR_CHAR_CODE('qdrt')
|
||||
cRectangle = FOUR_CHAR_CODE('crec')
|
||||
cRGBColor = FOUR_CHAR_CODE('cRGB')
|
||||
cRotation = FOUR_CHAR_CODE('trot')
|
||||
cRoundedRectangle = FOUR_CHAR_CODE('crrc')
|
||||
cRow = FOUR_CHAR_CODE('crow')
|
||||
cSelection = FOUR_CHAR_CODE('csel')
|
||||
cShortInteger = FOUR_CHAR_CODE('shor')
|
||||
cTable = FOUR_CHAR_CODE('ctbl')
|
||||
cText = FOUR_CHAR_CODE('ctxt')
|
||||
cTextFlow = FOUR_CHAR_CODE('cflo')
|
||||
cTextStyles = FOUR_CHAR_CODE('tsty')
|
||||
cType = FOUR_CHAR_CODE('type')
|
||||
cVersion = FOUR_CHAR_CODE('vers')
|
||||
cWindow = FOUR_CHAR_CODE('cwin')
|
||||
cWord = FOUR_CHAR_CODE('cwor')
|
||||
enumArrows = FOUR_CHAR_CODE('arro')
|
||||
enumJustification = FOUR_CHAR_CODE('just')
|
||||
enumKeyForm = FOUR_CHAR_CODE('kfrm')
|
||||
enumPosition = FOUR_CHAR_CODE('posi')
|
||||
enumProtection = FOUR_CHAR_CODE('prtn')
|
||||
enumQuality = FOUR_CHAR_CODE('qual')
|
||||
enumSaveOptions = FOUR_CHAR_CODE('savo')
|
||||
enumStyle = FOUR_CHAR_CODE('styl')
|
||||
enumTransferMode = FOUR_CHAR_CODE('tran')
|
||||
formUniqueID = FOUR_CHAR_CODE('ID ')
|
||||
kAEAbout = FOUR_CHAR_CODE('abou')
|
||||
kAEAfter = FOUR_CHAR_CODE('afte')
|
||||
kAEAliasSelection = FOUR_CHAR_CODE('sali')
|
||||
kAEAllCaps = FOUR_CHAR_CODE('alcp')
|
||||
kAEArrowAtEnd = FOUR_CHAR_CODE('aren')
|
||||
kAEArrowAtStart = FOUR_CHAR_CODE('arst')
|
||||
kAEArrowBothEnds = FOUR_CHAR_CODE('arbo')
|
||||
kAEAsk = FOUR_CHAR_CODE('ask ')
|
||||
kAEBefore = FOUR_CHAR_CODE('befo')
|
||||
kAEBeginning = FOUR_CHAR_CODE('bgng')
|
||||
kAEBeginsWith = FOUR_CHAR_CODE('bgwt')
|
||||
kAEBeginTransaction = FOUR_CHAR_CODE('begi')
|
||||
kAEBold = FOUR_CHAR_CODE('bold')
|
||||
kAECaseSensEquals = FOUR_CHAR_CODE('cseq')
|
||||
kAECentered = FOUR_CHAR_CODE('cent')
|
||||
kAEChangeView = FOUR_CHAR_CODE('view')
|
||||
kAEClone = FOUR_CHAR_CODE('clon')
|
||||
kAEClose = FOUR_CHAR_CODE('clos')
|
||||
kAECondensed = FOUR_CHAR_CODE('cond')
|
||||
kAEContains = FOUR_CHAR_CODE('cont')
|
||||
kAECopy = FOUR_CHAR_CODE('copy')
|
||||
kAECoreSuite = FOUR_CHAR_CODE('core')
|
||||
kAECountElements = FOUR_CHAR_CODE('cnte')
|
||||
kAECreateElement = FOUR_CHAR_CODE('crel')
|
||||
kAECreatePublisher = FOUR_CHAR_CODE('cpub')
|
||||
kAECut = FOUR_CHAR_CODE('cut ')
|
||||
kAEDelete = FOUR_CHAR_CODE('delo')
|
||||
kAEDoObjectsExist = FOUR_CHAR_CODE('doex')
|
||||
kAEDoScript = FOUR_CHAR_CODE('dosc')
|
||||
kAEDrag = FOUR_CHAR_CODE('drag')
|
||||
kAEDuplicateSelection = FOUR_CHAR_CODE('sdup')
|
||||
kAEEditGraphic = FOUR_CHAR_CODE('edit')
|
||||
kAEEmptyTrash = FOUR_CHAR_CODE('empt')
|
||||
kAEEnd = FOUR_CHAR_CODE('end ')
|
||||
kAEEndsWith = FOUR_CHAR_CODE('ends')
|
||||
kAEEndTransaction = FOUR_CHAR_CODE('endt')
|
||||
kAEEquals = FOUR_CHAR_CODE('= ')
|
||||
kAEExpanded = FOUR_CHAR_CODE('pexp')
|
||||
kAEFast = FOUR_CHAR_CODE('fast')
|
||||
kAEFinderEvents = FOUR_CHAR_CODE('FNDR')
|
||||
kAEFormulaProtect = FOUR_CHAR_CODE('fpro')
|
||||
kAEFullyJustified = FOUR_CHAR_CODE('full')
|
||||
kAEGetClassInfo = FOUR_CHAR_CODE('qobj')
|
||||
kAEGetData = FOUR_CHAR_CODE('getd')
|
||||
kAEGetDataSize = FOUR_CHAR_CODE('dsiz')
|
||||
kAEGetEventInfo = FOUR_CHAR_CODE('gtei')
|
||||
kAEGetInfoSelection = FOUR_CHAR_CODE('sinf')
|
||||
kAEGetPrivilegeSelection = FOUR_CHAR_CODE('sprv')
|
||||
kAEGetSuiteInfo = FOUR_CHAR_CODE('gtsi')
|
||||
kAEGreaterThan = FOUR_CHAR_CODE('> ')
|
||||
kAEGreaterThanEquals = FOUR_CHAR_CODE('>= ')
|
||||
kAEGrow = FOUR_CHAR_CODE('grow')
|
||||
kAEHidden = FOUR_CHAR_CODE('hidn')
|
||||
kAEHiQuality = FOUR_CHAR_CODE('hiqu')
|
||||
kAEImageGraphic = FOUR_CHAR_CODE('imgr')
|
||||
kAEIsUniform = FOUR_CHAR_CODE('isun')
|
||||
kAEItalic = FOUR_CHAR_CODE('ital')
|
||||
kAELeftJustified = FOUR_CHAR_CODE('left')
|
||||
kAELessThan = FOUR_CHAR_CODE('< ')
|
||||
kAELessThanEquals = FOUR_CHAR_CODE('<= ')
|
||||
kAELowercase = FOUR_CHAR_CODE('lowc')
|
||||
kAEMakeObjectsVisible = FOUR_CHAR_CODE('mvis')
|
||||
kAEMiscStandards = FOUR_CHAR_CODE('misc')
|
||||
kAEModifiable = FOUR_CHAR_CODE('modf')
|
||||
kAEMove = FOUR_CHAR_CODE('move')
|
||||
kAENo = FOUR_CHAR_CODE('no ')
|
||||
kAENoArrow = FOUR_CHAR_CODE('arno')
|
||||
kAENonmodifiable = FOUR_CHAR_CODE('nmod')
|
||||
kAEOpen = FOUR_CHAR_CODE('odoc')
|
||||
kAEOpenSelection = FOUR_CHAR_CODE('sope')
|
||||
kAEOutline = FOUR_CHAR_CODE('outl')
|
||||
kAEPageSetup = FOUR_CHAR_CODE('pgsu')
|
||||
kAEPaste = FOUR_CHAR_CODE('past')
|
||||
kAEPlain = FOUR_CHAR_CODE('plan')
|
||||
kAEPrint = FOUR_CHAR_CODE('pdoc')
|
||||
kAEPrintSelection = FOUR_CHAR_CODE('spri')
|
||||
kAEPrintWindow = FOUR_CHAR_CODE('pwin')
|
||||
kAEPutAwaySelection = FOUR_CHAR_CODE('sput')
|
||||
kAEQDAddOver = FOUR_CHAR_CODE('addo')
|
||||
kAEQDAddPin = FOUR_CHAR_CODE('addp')
|
||||
kAEQDAdMax = FOUR_CHAR_CODE('admx')
|
||||
kAEQDAdMin = FOUR_CHAR_CODE('admn')
|
||||
kAEQDBic = FOUR_CHAR_CODE('bic ')
|
||||
kAEQDBlend = FOUR_CHAR_CODE('blnd')
|
||||
kAEQDCopy = FOUR_CHAR_CODE('cpy ')
|
||||
kAEQDNotBic = FOUR_CHAR_CODE('nbic')
|
||||
kAEQDNotCopy = FOUR_CHAR_CODE('ncpy')
|
||||
kAEQDNotOr = FOUR_CHAR_CODE('ntor')
|
||||
kAEQDNotXor = FOUR_CHAR_CODE('nxor')
|
||||
kAEQDOr = FOUR_CHAR_CODE('or ')
|
||||
kAEQDSubOver = FOUR_CHAR_CODE('subo')
|
||||
kAEQDSubPin = FOUR_CHAR_CODE('subp')
|
||||
kAEQDSupplementalSuite = FOUR_CHAR_CODE('qdsp')
|
||||
kAEQDXor = FOUR_CHAR_CODE('xor ')
|
||||
kAEQuickdrawSuite = FOUR_CHAR_CODE('qdrw')
|
||||
kAEQuitAll = FOUR_CHAR_CODE('quia')
|
||||
kAERedo = FOUR_CHAR_CODE('redo')
|
||||
kAERegular = FOUR_CHAR_CODE('regl')
|
||||
kAEReopenApplication = FOUR_CHAR_CODE('rapp')
|
||||
kAEReplace = FOUR_CHAR_CODE('rplc')
|
||||
kAERequiredSuite = FOUR_CHAR_CODE('reqd')
|
||||
kAERestart = FOUR_CHAR_CODE('rest')
|
||||
kAERevealSelection = FOUR_CHAR_CODE('srev')
|
||||
kAERevert = FOUR_CHAR_CODE('rvrt')
|
||||
kAERightJustified = FOUR_CHAR_CODE('rght')
|
||||
kAESave = FOUR_CHAR_CODE('save')
|
||||
kAESelect = FOUR_CHAR_CODE('slct')
|
||||
kAESetData = FOUR_CHAR_CODE('setd')
|
||||
kAESetPosition = FOUR_CHAR_CODE('posn')
|
||||
kAEShadow = FOUR_CHAR_CODE('shad')
|
||||
kAEShowClipboard = FOUR_CHAR_CODE('shcl')
|
||||
kAEShutDown = FOUR_CHAR_CODE('shut')
|
||||
kAESleep = FOUR_CHAR_CODE('slep')
|
||||
kAESmallCaps = FOUR_CHAR_CODE('smcp')
|
||||
kAESpecialClassProperties = FOUR_CHAR_CODE('c@#!')
|
||||
kAEStrikethrough = FOUR_CHAR_CODE('strk')
|
||||
kAESubscript = FOUR_CHAR_CODE('sbsc')
|
||||
kAESuperscript = FOUR_CHAR_CODE('spsc')
|
||||
kAETableSuite = FOUR_CHAR_CODE('tbls')
|
||||
kAETextSuite = FOUR_CHAR_CODE('TEXT')
|
||||
kAETransactionTerminated = FOUR_CHAR_CODE('ttrm')
|
||||
kAEUnderline = FOUR_CHAR_CODE('undl')
|
||||
kAEUndo = FOUR_CHAR_CODE('undo')
|
||||
kAEWholeWordEquals = FOUR_CHAR_CODE('wweq')
|
||||
kAEYes = FOUR_CHAR_CODE('yes ')
|
||||
kAEZoom = FOUR_CHAR_CODE('zoom')
|
||||
kAEMouseClass = FOUR_CHAR_CODE('mous')
|
||||
kAEDown = FOUR_CHAR_CODE('down')
|
||||
kAEUp = FOUR_CHAR_CODE('up ')
|
||||
kAEMoved = FOUR_CHAR_CODE('move')
|
||||
kAEStoppedMoving = FOUR_CHAR_CODE('stop')
|
||||
kAEWindowClass = FOUR_CHAR_CODE('wind')
|
||||
kAEUpdate = FOUR_CHAR_CODE('updt')
|
||||
kAEActivate = FOUR_CHAR_CODE('actv')
|
||||
kAEDeactivate = FOUR_CHAR_CODE('dact')
|
||||
kAECommandClass = FOUR_CHAR_CODE('cmnd')
|
||||
kAEKeyClass = FOUR_CHAR_CODE('keyc')
|
||||
kAERawKey = FOUR_CHAR_CODE('rkey')
|
||||
kAEVirtualKey = FOUR_CHAR_CODE('keyc')
|
||||
kAENavigationKey = FOUR_CHAR_CODE('nave')
|
||||
kAEAutoDown = FOUR_CHAR_CODE('auto')
|
||||
kAEApplicationClass = FOUR_CHAR_CODE('appl')
|
||||
kAESuspend = FOUR_CHAR_CODE('susp')
|
||||
kAEResume = FOUR_CHAR_CODE('rsme')
|
||||
kAEDiskEvent = FOUR_CHAR_CODE('disk')
|
||||
kAENullEvent = FOUR_CHAR_CODE('null')
|
||||
kAEWakeUpEvent = FOUR_CHAR_CODE('wake')
|
||||
kAEScrapEvent = FOUR_CHAR_CODE('scrp')
|
||||
kAEHighLevel = FOUR_CHAR_CODE('high')
|
||||
keyAEAngle = FOUR_CHAR_CODE('kang')
|
||||
keyAEArcAngle = FOUR_CHAR_CODE('parc')
|
||||
keyAEBaseAddr = FOUR_CHAR_CODE('badd')
|
||||
keyAEBestType = FOUR_CHAR_CODE('pbst')
|
||||
keyAEBgndColor = FOUR_CHAR_CODE('kbcl')
|
||||
keyAEBgndPattern = FOUR_CHAR_CODE('kbpt')
|
||||
keyAEBounds = FOUR_CHAR_CODE('pbnd')
|
||||
keyAECellList = FOUR_CHAR_CODE('kclt')
|
||||
keyAEClassID = FOUR_CHAR_CODE('clID')
|
||||
keyAEColor = FOUR_CHAR_CODE('colr')
|
||||
keyAEColorTable = FOUR_CHAR_CODE('cltb')
|
||||
keyAECurveHeight = FOUR_CHAR_CODE('kchd')
|
||||
keyAECurveWidth = FOUR_CHAR_CODE('kcwd')
|
||||
keyAEDashStyle = FOUR_CHAR_CODE('pdst')
|
||||
keyAEData = FOUR_CHAR_CODE('data')
|
||||
keyAEDefaultType = FOUR_CHAR_CODE('deft')
|
||||
keyAEDefinitionRect = FOUR_CHAR_CODE('pdrt')
|
||||
keyAEDescType = FOUR_CHAR_CODE('dstp')
|
||||
keyAEDestination = FOUR_CHAR_CODE('dest')
|
||||
keyAEDoAntiAlias = FOUR_CHAR_CODE('anta')
|
||||
keyAEDoDithered = FOUR_CHAR_CODE('gdit')
|
||||
keyAEDoRotate = FOUR_CHAR_CODE('kdrt')
|
||||
keyAEDoScale = FOUR_CHAR_CODE('ksca')
|
||||
keyAEDoTranslate = FOUR_CHAR_CODE('ktra')
|
||||
keyAEEditionFileLoc = FOUR_CHAR_CODE('eloc')
|
||||
keyAEElements = FOUR_CHAR_CODE('elms')
|
||||
keyAEEndPoint = FOUR_CHAR_CODE('pend')
|
||||
keyAEEventClass = FOUR_CHAR_CODE('evcl')
|
||||
keyAEEventID = FOUR_CHAR_CODE('evti')
|
||||
keyAEFile = FOUR_CHAR_CODE('kfil')
|
||||
keyAEFileType = FOUR_CHAR_CODE('fltp')
|
||||
keyAEFillColor = FOUR_CHAR_CODE('flcl')
|
||||
keyAEFillPattern = FOUR_CHAR_CODE('flpt')
|
||||
keyAEFlipHorizontal = FOUR_CHAR_CODE('kfho')
|
||||
keyAEFlipVertical = FOUR_CHAR_CODE('kfvt')
|
||||
keyAEFont = FOUR_CHAR_CODE('font')
|
||||
keyAEFormula = FOUR_CHAR_CODE('pfor')
|
||||
keyAEGraphicObjects = FOUR_CHAR_CODE('gobs')
|
||||
keyAEID = FOUR_CHAR_CODE('ID ')
|
||||
keyAEImageQuality = FOUR_CHAR_CODE('gqua')
|
||||
keyAEInsertHere = FOUR_CHAR_CODE('insh')
|
||||
keyAEKeyForms = FOUR_CHAR_CODE('keyf')
|
||||
keyAEKeyword = FOUR_CHAR_CODE('kywd')
|
||||
keyAELevel = FOUR_CHAR_CODE('levl')
|
||||
keyAELineArrow = FOUR_CHAR_CODE('arro')
|
||||
keyAEName = FOUR_CHAR_CODE('pnam')
|
||||
keyAENewElementLoc = FOUR_CHAR_CODE('pnel')
|
||||
keyAEObject = FOUR_CHAR_CODE('kobj')
|
||||
keyAEObjectClass = FOUR_CHAR_CODE('kocl')
|
||||
keyAEOffStyles = FOUR_CHAR_CODE('ofst')
|
||||
keyAEOnStyles = FOUR_CHAR_CODE('onst')
|
||||
keyAEParameters = FOUR_CHAR_CODE('prms')
|
||||
keyAEParamFlags = FOUR_CHAR_CODE('pmfg')
|
||||
keyAEPenColor = FOUR_CHAR_CODE('ppcl')
|
||||
keyAEPenPattern = FOUR_CHAR_CODE('pppa')
|
||||
keyAEPenWidth = FOUR_CHAR_CODE('ppwd')
|
||||
keyAEPixelDepth = FOUR_CHAR_CODE('pdpt')
|
||||
keyAEPixMapMinus = FOUR_CHAR_CODE('kpmm')
|
||||
keyAEPMTable = FOUR_CHAR_CODE('kpmt')
|
||||
keyAEPointList = FOUR_CHAR_CODE('ptlt')
|
||||
keyAEPointSize = FOUR_CHAR_CODE('ptsz')
|
||||
keyAEPosition = FOUR_CHAR_CODE('kpos')
|
||||
keyAEPropData = FOUR_CHAR_CODE('prdt')
|
||||
keyAEProperties = FOUR_CHAR_CODE('qpro')
|
||||
keyAEProperty = FOUR_CHAR_CODE('kprp')
|
||||
keyAEPropFlags = FOUR_CHAR_CODE('prfg')
|
||||
keyAEPropID = FOUR_CHAR_CODE('prop')
|
||||
keyAEProtection = FOUR_CHAR_CODE('ppro')
|
||||
keyAERenderAs = FOUR_CHAR_CODE('kren')
|
||||
keyAERequestedType = FOUR_CHAR_CODE('rtyp')
|
||||
keyAEResult = FOUR_CHAR_CODE('----')
|
||||
keyAEResultInfo = FOUR_CHAR_CODE('rsin')
|
||||
keyAERotation = FOUR_CHAR_CODE('prot')
|
||||
keyAERotPoint = FOUR_CHAR_CODE('krtp')
|
||||
keyAERowList = FOUR_CHAR_CODE('krls')
|
||||
keyAESaveOptions = FOUR_CHAR_CODE('savo')
|
||||
keyAEScale = FOUR_CHAR_CODE('pscl')
|
||||
keyAEScriptTag = FOUR_CHAR_CODE('psct')
|
||||
keyAEShowWhere = FOUR_CHAR_CODE('show')
|
||||
keyAEStartAngle = FOUR_CHAR_CODE('pang')
|
||||
keyAEStartPoint = FOUR_CHAR_CODE('pstp')
|
||||
keyAEStyles = FOUR_CHAR_CODE('ksty')
|
||||
keyAESuiteID = FOUR_CHAR_CODE('suit')
|
||||
keyAEText = FOUR_CHAR_CODE('ktxt')
|
||||
keyAETextColor = FOUR_CHAR_CODE('ptxc')
|
||||
keyAETextFont = FOUR_CHAR_CODE('ptxf')
|
||||
keyAETextPointSize = FOUR_CHAR_CODE('ptps')
|
||||
keyAETextStyles = FOUR_CHAR_CODE('txst')
|
||||
keyAETextLineHeight = FOUR_CHAR_CODE('ktlh')
|
||||
keyAETextLineAscent = FOUR_CHAR_CODE('ktas')
|
||||
keyAETheText = FOUR_CHAR_CODE('thtx')
|
||||
keyAETransferMode = FOUR_CHAR_CODE('pptm')
|
||||
keyAETranslation = FOUR_CHAR_CODE('ptrs')
|
||||
keyAETryAsStructGraf = FOUR_CHAR_CODE('toog')
|
||||
keyAEUniformStyles = FOUR_CHAR_CODE('ustl')
|
||||
keyAEUpdateOn = FOUR_CHAR_CODE('pupd')
|
||||
keyAEUserTerm = FOUR_CHAR_CODE('utrm')
|
||||
keyAEWindow = FOUR_CHAR_CODE('wndw')
|
||||
keyAEWritingCode = FOUR_CHAR_CODE('wrcd')
|
||||
keyMiscellaneous = FOUR_CHAR_CODE('fmsc')
|
||||
keySelection = FOUR_CHAR_CODE('fsel')
|
||||
keyWindow = FOUR_CHAR_CODE('kwnd')
|
||||
keyWhen = FOUR_CHAR_CODE('when')
|
||||
keyWhere = FOUR_CHAR_CODE('wher')
|
||||
keyModifiers = FOUR_CHAR_CODE('mods')
|
||||
keyKey = FOUR_CHAR_CODE('key ')
|
||||
keyKeyCode = FOUR_CHAR_CODE('code')
|
||||
keyKeyboard = FOUR_CHAR_CODE('keyb')
|
||||
keyDriveNumber = FOUR_CHAR_CODE('drv#')
|
||||
keyErrorCode = FOUR_CHAR_CODE('err#')
|
||||
keyHighLevelClass = FOUR_CHAR_CODE('hcls')
|
||||
keyHighLevelID = FOUR_CHAR_CODE('hid ')
|
||||
pArcAngle = FOUR_CHAR_CODE('parc')
|
||||
pBackgroundColor = FOUR_CHAR_CODE('pbcl')
|
||||
pBackgroundPattern = FOUR_CHAR_CODE('pbpt')
|
||||
pBestType = FOUR_CHAR_CODE('pbst')
|
||||
pBounds = FOUR_CHAR_CODE('pbnd')
|
||||
pClass = FOUR_CHAR_CODE('pcls')
|
||||
pClipboard = FOUR_CHAR_CODE('pcli')
|
||||
pColor = FOUR_CHAR_CODE('colr')
|
||||
pColorTable = FOUR_CHAR_CODE('cltb')
|
||||
pContents = FOUR_CHAR_CODE('pcnt')
|
||||
pCornerCurveHeight = FOUR_CHAR_CODE('pchd')
|
||||
pCornerCurveWidth = FOUR_CHAR_CODE('pcwd')
|
||||
pDashStyle = FOUR_CHAR_CODE('pdst')
|
||||
pDefaultType = FOUR_CHAR_CODE('deft')
|
||||
pDefinitionRect = FOUR_CHAR_CODE('pdrt')
|
||||
pEnabled = FOUR_CHAR_CODE('enbl')
|
||||
pEndPoint = FOUR_CHAR_CODE('pend')
|
||||
pFillColor = FOUR_CHAR_CODE('flcl')
|
||||
pFillPattern = FOUR_CHAR_CODE('flpt')
|
||||
pFont = FOUR_CHAR_CODE('font')
|
||||
pFormula = FOUR_CHAR_CODE('pfor')
|
||||
pGraphicObjects = FOUR_CHAR_CODE('gobs')
|
||||
pHasCloseBox = FOUR_CHAR_CODE('hclb')
|
||||
pHasTitleBar = FOUR_CHAR_CODE('ptit')
|
||||
pID = FOUR_CHAR_CODE('ID ')
|
||||
pIndex = FOUR_CHAR_CODE('pidx')
|
||||
pInsertionLoc = FOUR_CHAR_CODE('pins')
|
||||
pIsFloating = FOUR_CHAR_CODE('isfl')
|
||||
pIsFrontProcess = FOUR_CHAR_CODE('pisf')
|
||||
pIsModal = FOUR_CHAR_CODE('pmod')
|
||||
pIsModified = FOUR_CHAR_CODE('imod')
|
||||
pIsResizable = FOUR_CHAR_CODE('prsz')
|
||||
pIsStationeryPad = FOUR_CHAR_CODE('pspd')
|
||||
pIsZoomable = FOUR_CHAR_CODE('iszm')
|
||||
pIsZoomed = FOUR_CHAR_CODE('pzum')
|
||||
pItemNumber = FOUR_CHAR_CODE('itmn')
|
||||
pJustification = FOUR_CHAR_CODE('pjst')
|
||||
pLineArrow = FOUR_CHAR_CODE('arro')
|
||||
pMenuID = FOUR_CHAR_CODE('mnid')
|
||||
pName = FOUR_CHAR_CODE('pnam')
|
||||
pNewElementLoc = FOUR_CHAR_CODE('pnel')
|
||||
pPenColor = FOUR_CHAR_CODE('ppcl')
|
||||
pPenPattern = FOUR_CHAR_CODE('pppa')
|
||||
pPenWidth = FOUR_CHAR_CODE('ppwd')
|
||||
pPixelDepth = FOUR_CHAR_CODE('pdpt')
|
||||
pPointList = FOUR_CHAR_CODE('ptlt')
|
||||
pPointSize = FOUR_CHAR_CODE('ptsz')
|
||||
pProtection = FOUR_CHAR_CODE('ppro')
|
||||
pRotation = FOUR_CHAR_CODE('prot')
|
||||
pScale = FOUR_CHAR_CODE('pscl')
|
||||
pScript = FOUR_CHAR_CODE('scpt')
|
||||
pScriptTag = FOUR_CHAR_CODE('psct')
|
||||
pSelected = FOUR_CHAR_CODE('selc')
|
||||
pSelection = FOUR_CHAR_CODE('sele')
|
||||
pStartAngle = FOUR_CHAR_CODE('pang')
|
||||
pStartPoint = FOUR_CHAR_CODE('pstp')
|
||||
pTextColor = FOUR_CHAR_CODE('ptxc')
|
||||
pTextFont = FOUR_CHAR_CODE('ptxf')
|
||||
pTextItemDelimiters = FOUR_CHAR_CODE('txdl')
|
||||
pTextPointSize = FOUR_CHAR_CODE('ptps')
|
||||
pTextStyles = FOUR_CHAR_CODE('txst')
|
||||
pTransferMode = FOUR_CHAR_CODE('pptm')
|
||||
pTranslation = FOUR_CHAR_CODE('ptrs')
|
||||
pUniformStyles = FOUR_CHAR_CODE('ustl')
|
||||
pUpdateOn = FOUR_CHAR_CODE('pupd')
|
||||
pUserSelection = FOUR_CHAR_CODE('pusl')
|
||||
pVersion = FOUR_CHAR_CODE('vers')
|
||||
pVisible = FOUR_CHAR_CODE('pvis')
|
||||
typeAEText = FOUR_CHAR_CODE('tTXT')
|
||||
typeArc = FOUR_CHAR_CODE('carc')
|
||||
typeBest = FOUR_CHAR_CODE('best')
|
||||
typeCell = FOUR_CHAR_CODE('ccel')
|
||||
typeClassInfo = FOUR_CHAR_CODE('gcli')
|
||||
typeColorTable = FOUR_CHAR_CODE('clrt')
|
||||
typeColumn = FOUR_CHAR_CODE('ccol')
|
||||
typeDashStyle = FOUR_CHAR_CODE('tdas')
|
||||
typeData = FOUR_CHAR_CODE('tdta')
|
||||
typeDrawingArea = FOUR_CHAR_CODE('cdrw')
|
||||
typeElemInfo = FOUR_CHAR_CODE('elin')
|
||||
typeEnumeration = FOUR_CHAR_CODE('enum')
|
||||
typeEPS = FOUR_CHAR_CODE('EPS ')
|
||||
typeEventInfo = FOUR_CHAR_CODE('evin')
|
||||
typeFinderWindow = FOUR_CHAR_CODE('fwin')
|
||||
typeFixedPoint = FOUR_CHAR_CODE('fpnt')
|
||||
typeFixedRectangle = FOUR_CHAR_CODE('frct')
|
||||
typeGraphicLine = FOUR_CHAR_CODE('glin')
|
||||
typeGraphicText = FOUR_CHAR_CODE('cgtx')
|
||||
typeGroupedGraphic = FOUR_CHAR_CODE('cpic')
|
||||
typeInsertionLoc = FOUR_CHAR_CODE('insl')
|
||||
typeIntlText = FOUR_CHAR_CODE('itxt')
|
||||
typeIntlWritingCode = FOUR_CHAR_CODE('intl')
|
||||
typeLongDateTime = FOUR_CHAR_CODE('ldt ')
|
||||
typeLongFixed = FOUR_CHAR_CODE('lfxd')
|
||||
typeLongFixedPoint = FOUR_CHAR_CODE('lfpt')
|
||||
typeLongFixedRectangle = FOUR_CHAR_CODE('lfrc')
|
||||
typeLongPoint = FOUR_CHAR_CODE('lpnt')
|
||||
typeLongRectangle = FOUR_CHAR_CODE('lrct')
|
||||
typeMachineLoc = FOUR_CHAR_CODE('mLoc')
|
||||
typeOval = FOUR_CHAR_CODE('covl')
|
||||
typeParamInfo = FOUR_CHAR_CODE('pmin')
|
||||
typePict = FOUR_CHAR_CODE('PICT')
|
||||
typePixelMap = FOUR_CHAR_CODE('cpix')
|
||||
typePixMapMinus = FOUR_CHAR_CODE('tpmm')
|
||||
typePolygon = FOUR_CHAR_CODE('cpgn')
|
||||
typePropInfo = FOUR_CHAR_CODE('pinf')
|
||||
typePtr = FOUR_CHAR_CODE('ptr ')
|
||||
typeQDPoint = FOUR_CHAR_CODE('QDpt')
|
||||
typeQDRegion = FOUR_CHAR_CODE('Qrgn')
|
||||
typeRectangle = FOUR_CHAR_CODE('crec')
|
||||
typeRGB16 = FOUR_CHAR_CODE('tr16')
|
||||
typeRGB96 = FOUR_CHAR_CODE('tr96')
|
||||
typeRGBColor = FOUR_CHAR_CODE('cRGB')
|
||||
typeRotation = FOUR_CHAR_CODE('trot')
|
||||
typeRoundedRectangle = FOUR_CHAR_CODE('crrc')
|
||||
typeRow = FOUR_CHAR_CODE('crow')
|
||||
typeScrapStyles = FOUR_CHAR_CODE('styl')
|
||||
typeScript = FOUR_CHAR_CODE('scpt')
|
||||
typeStyledText = FOUR_CHAR_CODE('STXT')
|
||||
typeSuiteInfo = FOUR_CHAR_CODE('suin')
|
||||
typeTable = FOUR_CHAR_CODE('ctbl')
|
||||
typeTextStyles = FOUR_CHAR_CODE('tsty')
|
||||
typeTIFF = FOUR_CHAR_CODE('TIFF')
|
||||
typeVersion = FOUR_CHAR_CODE('vers')
|
||||
kAEMenuClass = FOUR_CHAR_CODE('menu')
|
||||
kAEMenuSelect = FOUR_CHAR_CODE('mhit')
|
||||
kAEMouseDown = FOUR_CHAR_CODE('mdwn')
|
||||
kAEMouseDownInBack = FOUR_CHAR_CODE('mdbk')
|
||||
kAEKeyDown = FOUR_CHAR_CODE('kdwn')
|
||||
kAEResized = FOUR_CHAR_CODE('rsiz')
|
||||
kAEPromise = FOUR_CHAR_CODE('prom')
|
||||
keyMenuID = FOUR_CHAR_CODE('mid ')
|
||||
keyMenuItem = FOUR_CHAR_CODE('mitm')
|
||||
keyCloseAllWindows = FOUR_CHAR_CODE('caw ')
|
||||
keyOriginalBounds = FOUR_CHAR_CODE('obnd')
|
||||
keyNewBounds = FOUR_CHAR_CODE('nbnd')
|
||||
keyLocalWhere = FOUR_CHAR_CODE('lwhr')
|
||||
typeHIMenu = FOUR_CHAR_CODE('mobj')
|
||||
typeHIWindow = FOUR_CHAR_CODE('wobj')
|
||||
kBySmallIcon = 0
|
||||
kByIconView = 1
|
||||
kByNameView = 2
|
||||
kByDateView = 3
|
||||
kBySizeView = 4
|
||||
kByKindView = 5
|
||||
kByCommentView = 6
|
||||
kByLabelView = 7
|
||||
kByVersionView = 8
|
||||
kAEInfo = 11
|
||||
kAEMain = 0
|
||||
kAESharing = 13
|
||||
kAEZoomIn = 7
|
||||
kAEZoomOut = 8
|
||||
kTextServiceClass = FOUR_CHAR_CODE('tsvc')
|
||||
kUpdateActiveInputArea = FOUR_CHAR_CODE('updt')
|
||||
kShowHideInputWindow = FOUR_CHAR_CODE('shiw')
|
||||
kPos2Offset = FOUR_CHAR_CODE('p2st')
|
||||
kOffset2Pos = FOUR_CHAR_CODE('st2p')
|
||||
kUnicodeNotFromInputMethod = FOUR_CHAR_CODE('unim')
|
||||
kGetSelectedText = FOUR_CHAR_CODE('gtxt')
|
||||
keyAETSMDocumentRefcon = FOUR_CHAR_CODE('refc')
|
||||
keyAEServerInstance = FOUR_CHAR_CODE('srvi')
|
||||
keyAETheData = FOUR_CHAR_CODE('kdat')
|
||||
keyAEFixLength = FOUR_CHAR_CODE('fixl')
|
||||
keyAEUpdateRange = FOUR_CHAR_CODE('udng')
|
||||
keyAECurrentPoint = FOUR_CHAR_CODE('cpos')
|
||||
keyAEBufferSize = FOUR_CHAR_CODE('buff')
|
||||
keyAEMoveView = FOUR_CHAR_CODE('mvvw')
|
||||
keyAENextBody = FOUR_CHAR_CODE('nxbd')
|
||||
keyAETSMScriptTag = FOUR_CHAR_CODE('sclg')
|
||||
keyAETSMTextFont = FOUR_CHAR_CODE('ktxf')
|
||||
keyAETSMTextFMFont = FOUR_CHAR_CODE('ktxm')
|
||||
keyAETSMTextPointSize = FOUR_CHAR_CODE('ktps')
|
||||
keyAETSMEventRecord = FOUR_CHAR_CODE('tevt')
|
||||
keyAETSMEventRef = FOUR_CHAR_CODE('tevr')
|
||||
keyAETextServiceEncoding = FOUR_CHAR_CODE('tsen')
|
||||
keyAETextServiceMacEncoding = FOUR_CHAR_CODE('tmen')
|
||||
typeTextRange = FOUR_CHAR_CODE('txrn')
|
||||
typeComponentInstance = FOUR_CHAR_CODE('cmpi')
|
||||
typeOffsetArray = FOUR_CHAR_CODE('ofay')
|
||||
typeTextRangeArray = FOUR_CHAR_CODE('tray')
|
||||
typeLowLevelEventRecord = FOUR_CHAR_CODE('evtr')
|
||||
typeEventRef = FOUR_CHAR_CODE('evrf')
|
||||
typeText = typeChar
|
||||
kTSMOutsideOfBody = 1
|
||||
kTSMInsideOfBody = 2
|
||||
kTSMInsideOfActiveInputArea = 3
|
||||
kNextBody = 1
|
||||
kPreviousBody = 2
|
||||
kCaretPosition = 1
|
||||
kRawText = 2
|
||||
kSelectedRawText = 3
|
||||
kConvertedText = 4
|
||||
kSelectedConvertedText = 5
|
||||
kBlockFillText = 6
|
||||
kOutlineText = 7
|
||||
kSelectedText = 8
|
||||
keyAEHiliteRange = FOUR_CHAR_CODE('hrng')
|
||||
keyAEPinRange = FOUR_CHAR_CODE('pnrg')
|
||||
keyAEClauseOffsets = FOUR_CHAR_CODE('clau')
|
||||
keyAEOffset = FOUR_CHAR_CODE('ofst')
|
||||
keyAEPoint = FOUR_CHAR_CODE('gpos')
|
||||
keyAELeftSide = FOUR_CHAR_CODE('klef')
|
||||
keyAERegionClass = FOUR_CHAR_CODE('rgnc')
|
||||
keyAEDragging = FOUR_CHAR_CODE('bool')
|
||||
keyAELeadingEdge = keyAELeftSide
|
||||
typeUnicodeText = FOUR_CHAR_CODE('utxt')
|
||||
typeStyledUnicodeText = FOUR_CHAR_CODE('sutx')
|
||||
typeEncodedString = FOUR_CHAR_CODE('encs')
|
||||
typeCString = FOUR_CHAR_CODE('cstr')
|
||||
typePString = FOUR_CHAR_CODE('pstr')
|
||||
typeMeters = FOUR_CHAR_CODE('metr')
|
||||
typeInches = FOUR_CHAR_CODE('inch')
|
||||
typeFeet = FOUR_CHAR_CODE('feet')
|
||||
typeYards = FOUR_CHAR_CODE('yard')
|
||||
typeMiles = FOUR_CHAR_CODE('mile')
|
||||
typeKilometers = FOUR_CHAR_CODE('kmtr')
|
||||
typeCentimeters = FOUR_CHAR_CODE('cmtr')
|
||||
typeSquareMeters = FOUR_CHAR_CODE('sqrm')
|
||||
typeSquareFeet = FOUR_CHAR_CODE('sqft')
|
||||
typeSquareYards = FOUR_CHAR_CODE('sqyd')
|
||||
typeSquareMiles = FOUR_CHAR_CODE('sqmi')
|
||||
typeSquareKilometers = FOUR_CHAR_CODE('sqkm')
|
||||
typeLiters = FOUR_CHAR_CODE('litr')
|
||||
typeQuarts = FOUR_CHAR_CODE('qrts')
|
||||
typeGallons = FOUR_CHAR_CODE('galn')
|
||||
typeCubicMeters = FOUR_CHAR_CODE('cmet')
|
||||
typeCubicFeet = FOUR_CHAR_CODE('cfet')
|
||||
typeCubicInches = FOUR_CHAR_CODE('cuin')
|
||||
typeCubicCentimeter = FOUR_CHAR_CODE('ccmt')
|
||||
typeCubicYards = FOUR_CHAR_CODE('cyrd')
|
||||
typeKilograms = FOUR_CHAR_CODE('kgrm')
|
||||
typeGrams = FOUR_CHAR_CODE('gram')
|
||||
typeOunces = FOUR_CHAR_CODE('ozs ')
|
||||
typePounds = FOUR_CHAR_CODE('lbs ')
|
||||
typeDegreesC = FOUR_CHAR_CODE('degc')
|
||||
typeDegreesF = FOUR_CHAR_CODE('degf')
|
||||
typeDegreesK = FOUR_CHAR_CODE('degk')
|
||||
kFAServerApp = FOUR_CHAR_CODE('ssrv')
|
||||
kDoFolderActionEvent = FOUR_CHAR_CODE('fola')
|
||||
kFolderActionCode = FOUR_CHAR_CODE('actn')
|
||||
kFolderOpenedEvent = FOUR_CHAR_CODE('fopn')
|
||||
kFolderClosedEvent = FOUR_CHAR_CODE('fclo')
|
||||
kFolderWindowMovedEvent = FOUR_CHAR_CODE('fsiz')
|
||||
kFolderItemsAddedEvent = FOUR_CHAR_CODE('fget')
|
||||
kFolderItemsRemovedEvent = FOUR_CHAR_CODE('flos')
|
||||
kItemList = FOUR_CHAR_CODE('flst')
|
||||
kNewSizeParameter = FOUR_CHAR_CODE('fnsz')
|
||||
kFASuiteCode = FOUR_CHAR_CODE('faco')
|
||||
kFAAttachCommand = FOUR_CHAR_CODE('atfa')
|
||||
kFARemoveCommand = FOUR_CHAR_CODE('rmfa')
|
||||
kFAEditCommand = FOUR_CHAR_CODE('edfa')
|
||||
kFAFileParam = FOUR_CHAR_CODE('faal')
|
||||
kFAIndexParam = FOUR_CHAR_CODE('indx')
|
||||
kAEInternetSuite = FOUR_CHAR_CODE('gurl')
|
||||
kAEISWebStarSuite = FOUR_CHAR_CODE('WWW\xbd')
|
||||
kAEISGetURL = FOUR_CHAR_CODE('gurl')
|
||||
KAEISHandleCGI = FOUR_CHAR_CODE('sdoc')
|
||||
cURL = FOUR_CHAR_CODE('url ')
|
||||
cInternetAddress = FOUR_CHAR_CODE('IPAD')
|
||||
cHTML = FOUR_CHAR_CODE('html')
|
||||
cFTPItem = FOUR_CHAR_CODE('ftp ')
|
||||
kAEISHTTPSearchArgs = FOUR_CHAR_CODE('kfor')
|
||||
kAEISPostArgs = FOUR_CHAR_CODE('post')
|
||||
kAEISMethod = FOUR_CHAR_CODE('meth')
|
||||
kAEISClientAddress = FOUR_CHAR_CODE('addr')
|
||||
kAEISUserName = FOUR_CHAR_CODE('user')
|
||||
kAEISPassword = FOUR_CHAR_CODE('pass')
|
||||
kAEISFromUser = FOUR_CHAR_CODE('frmu')
|
||||
kAEISServerName = FOUR_CHAR_CODE('svnm')
|
||||
kAEISServerPort = FOUR_CHAR_CODE('svpt')
|
||||
kAEISScriptName = FOUR_CHAR_CODE('scnm')
|
||||
kAEISContentType = FOUR_CHAR_CODE('ctyp')
|
||||
kAEISReferrer = FOUR_CHAR_CODE('refr')
|
||||
kAEISUserAgent = FOUR_CHAR_CODE('Agnt')
|
||||
kAEISAction = FOUR_CHAR_CODE('Kact')
|
||||
kAEISActionPath = FOUR_CHAR_CODE('Kapt')
|
||||
kAEISClientIP = FOUR_CHAR_CODE('Kcip')
|
||||
kAEISFullRequest = FOUR_CHAR_CODE('Kfrq')
|
||||
pScheme = FOUR_CHAR_CODE('pusc')
|
||||
pHost = FOUR_CHAR_CODE('HOST')
|
||||
pPath = FOUR_CHAR_CODE('FTPc')
|
||||
pUserName = FOUR_CHAR_CODE('RAun')
|
||||
pUserPassword = FOUR_CHAR_CODE('RApw')
|
||||
pDNSForm = FOUR_CHAR_CODE('pDNS')
|
||||
pURL = FOUR_CHAR_CODE('pURL')
|
||||
pTextEncoding = FOUR_CHAR_CODE('ptxe')
|
||||
pFTPKind = FOUR_CHAR_CODE('kind')
|
||||
eScheme = FOUR_CHAR_CODE('esch')
|
||||
eurlHTTP = FOUR_CHAR_CODE('http')
|
||||
eurlHTTPS = FOUR_CHAR_CODE('htps')
|
||||
eurlFTP = FOUR_CHAR_CODE('ftp ')
|
||||
eurlMail = FOUR_CHAR_CODE('mail')
|
||||
eurlFile = FOUR_CHAR_CODE('file')
|
||||
eurlGopher = FOUR_CHAR_CODE('gphr')
|
||||
eurlTelnet = FOUR_CHAR_CODE('tlnt')
|
||||
eurlNews = FOUR_CHAR_CODE('news')
|
||||
eurlSNews = FOUR_CHAR_CODE('snws')
|
||||
eurlNNTP = FOUR_CHAR_CODE('nntp')
|
||||
eurlMessage = FOUR_CHAR_CODE('mess')
|
||||
eurlMailbox = FOUR_CHAR_CODE('mbox')
|
||||
eurlMulti = FOUR_CHAR_CODE('mult')
|
||||
eurlLaunch = FOUR_CHAR_CODE('laun')
|
||||
eurlAFP = FOUR_CHAR_CODE('afp ')
|
||||
eurlAT = FOUR_CHAR_CODE('at ')
|
||||
eurlEPPC = FOUR_CHAR_CODE('eppc')
|
||||
eurlRTSP = FOUR_CHAR_CODE('rtsp')
|
||||
eurlIMAP = FOUR_CHAR_CODE('imap')
|
||||
eurlNFS = FOUR_CHAR_CODE('unfs')
|
||||
eurlPOP = FOUR_CHAR_CODE('upop')
|
||||
eurlLDAP = FOUR_CHAR_CODE('uldp')
|
||||
eurlUnknown = FOUR_CHAR_CODE('url?')
|
||||
kConnSuite = FOUR_CHAR_CODE('macc')
|
||||
cDevSpec = FOUR_CHAR_CODE('cdev')
|
||||
cAddressSpec = FOUR_CHAR_CODE('cadr')
|
||||
cADBAddress = FOUR_CHAR_CODE('cadb')
|
||||
cAppleTalkAddress = FOUR_CHAR_CODE('cat ')
|
||||
cBusAddress = FOUR_CHAR_CODE('cbus')
|
||||
cEthernetAddress = FOUR_CHAR_CODE('cen ')
|
||||
cFireWireAddress = FOUR_CHAR_CODE('cfw ')
|
||||
cIPAddress = FOUR_CHAR_CODE('cip ')
|
||||
cLocalTalkAddress = FOUR_CHAR_CODE('clt ')
|
||||
cSCSIAddress = FOUR_CHAR_CODE('cscs')
|
||||
cTokenRingAddress = FOUR_CHAR_CODE('ctok')
|
||||
cUSBAddress = FOUR_CHAR_CODE('cusb')
|
||||
pDeviceType = FOUR_CHAR_CODE('pdvt')
|
||||
pDeviceAddress = FOUR_CHAR_CODE('pdva')
|
||||
pConduit = FOUR_CHAR_CODE('pcon')
|
||||
pProtocol = FOUR_CHAR_CODE('pprt')
|
||||
pATMachine = FOUR_CHAR_CODE('patm')
|
||||
pATZone = FOUR_CHAR_CODE('patz')
|
||||
pATType = FOUR_CHAR_CODE('patt')
|
||||
pDottedDecimal = FOUR_CHAR_CODE('pipd')
|
||||
pDNS = FOUR_CHAR_CODE('pdns')
|
||||
pPort = FOUR_CHAR_CODE('ppor')
|
||||
pNetwork = FOUR_CHAR_CODE('pnet')
|
||||
pNode = FOUR_CHAR_CODE('pnod')
|
||||
pSocket = FOUR_CHAR_CODE('psoc')
|
||||
pSCSIBus = FOUR_CHAR_CODE('pscb')
|
||||
pSCSILUN = FOUR_CHAR_CODE('pslu')
|
||||
eDeviceType = FOUR_CHAR_CODE('edvt')
|
||||
eAddressSpec = FOUR_CHAR_CODE('eads')
|
||||
eConduit = FOUR_CHAR_CODE('econ')
|
||||
eProtocol = FOUR_CHAR_CODE('epro')
|
||||
eADB = FOUR_CHAR_CODE('eadb')
|
||||
eAnalogAudio = FOUR_CHAR_CODE('epau')
|
||||
eAppleTalk = FOUR_CHAR_CODE('epat')
|
||||
eAudioLineIn = FOUR_CHAR_CODE('ecai')
|
||||
eAudioLineOut = FOUR_CHAR_CODE('ecal')
|
||||
eAudioOut = FOUR_CHAR_CODE('ecao')
|
||||
eBus = FOUR_CHAR_CODE('ebus')
|
||||
eCDROM = FOUR_CHAR_CODE('ecd ')
|
||||
eCommSlot = FOUR_CHAR_CODE('eccm')
|
||||
eDigitalAudio = FOUR_CHAR_CODE('epda')
|
||||
eDisplay = FOUR_CHAR_CODE('edds')
|
||||
eDVD = FOUR_CHAR_CODE('edvd')
|
||||
eEthernet = FOUR_CHAR_CODE('ecen')
|
||||
eFireWire = FOUR_CHAR_CODE('ecfw')
|
||||
eFloppy = FOUR_CHAR_CODE('efd ')
|
||||
eHD = FOUR_CHAR_CODE('ehd ')
|
||||
eInfrared = FOUR_CHAR_CODE('ecir')
|
||||
eIP = FOUR_CHAR_CODE('epip')
|
||||
eIrDA = FOUR_CHAR_CODE('epir')
|
||||
eIRTalk = FOUR_CHAR_CODE('epit')
|
||||
eKeyboard = FOUR_CHAR_CODE('ekbd')
|
||||
eLCD = FOUR_CHAR_CODE('edlc')
|
||||
eLocalTalk = FOUR_CHAR_CODE('eclt')
|
||||
eMacIP = FOUR_CHAR_CODE('epmi')
|
||||
eMacVideo = FOUR_CHAR_CODE('epmv')
|
||||
eMicrophone = FOUR_CHAR_CODE('ecmi')
|
||||
eModemPort = FOUR_CHAR_CODE('ecmp')
|
||||
eModemPrinterPort = FOUR_CHAR_CODE('empp')
|
||||
eModem = FOUR_CHAR_CODE('edmm')
|
||||
eMonitorOut = FOUR_CHAR_CODE('ecmn')
|
||||
eMouse = FOUR_CHAR_CODE('emou')
|
||||
eNuBusCard = FOUR_CHAR_CODE('ednb')
|
||||
eNuBus = FOUR_CHAR_CODE('enub')
|
||||
ePCcard = FOUR_CHAR_CODE('ecpc')
|
||||
ePCIbus = FOUR_CHAR_CODE('ecpi')
|
||||
ePCIcard = FOUR_CHAR_CODE('edpi')
|
||||
ePDSslot = FOUR_CHAR_CODE('ecpd')
|
||||
ePDScard = FOUR_CHAR_CODE('epds')
|
||||
ePointingDevice = FOUR_CHAR_CODE('edpd')
|
||||
ePostScript = FOUR_CHAR_CODE('epps')
|
||||
ePPP = FOUR_CHAR_CODE('eppp')
|
||||
ePrinterPort = FOUR_CHAR_CODE('ecpp')
|
||||
ePrinter = FOUR_CHAR_CODE('edpr')
|
||||
eSvideo = FOUR_CHAR_CODE('epsv')
|
||||
eSCSI = FOUR_CHAR_CODE('ecsc')
|
||||
eSerial = FOUR_CHAR_CODE('epsr')
|
||||
eSpeakers = FOUR_CHAR_CODE('edsp')
|
||||
eStorageDevice = FOUR_CHAR_CODE('edst')
|
||||
eSVGA = FOUR_CHAR_CODE('epsg')
|
||||
eTokenRing = FOUR_CHAR_CODE('etok')
|
||||
eTrackball = FOUR_CHAR_CODE('etrk')
|
||||
eTrackpad = FOUR_CHAR_CODE('edtp')
|
||||
eUSB = FOUR_CHAR_CODE('ecus')
|
||||
eVideoIn = FOUR_CHAR_CODE('ecvi')
|
||||
eVideoMonitor = FOUR_CHAR_CODE('edvm')
|
||||
eVideoOut = FOUR_CHAR_CODE('ecvo')
|
||||
cKeystroke = FOUR_CHAR_CODE('kprs')
|
||||
pKeystrokeKey = FOUR_CHAR_CODE('kMsg')
|
||||
pModifiers = FOUR_CHAR_CODE('kMod')
|
||||
pKeyKind = FOUR_CHAR_CODE('kknd')
|
||||
eModifiers = FOUR_CHAR_CODE('eMds')
|
||||
eOptionDown = FOUR_CHAR_CODE('Kopt')
|
||||
eCommandDown = FOUR_CHAR_CODE('Kcmd')
|
||||
eControlDown = FOUR_CHAR_CODE('Kctl')
|
||||
eShiftDown = FOUR_CHAR_CODE('Ksft')
|
||||
eCapsLockDown = FOUR_CHAR_CODE('Kclk')
|
||||
eKeyKind = FOUR_CHAR_CODE('ekst')
|
||||
eEscapeKey = 0x6B733500
|
||||
eDeleteKey = 0x6B733300
|
||||
eTabKey = 0x6B733000
|
||||
eReturnKey = 0x6B732400
|
||||
eClearKey = 0x6B734700
|
||||
eEnterKey = 0x6B734C00
|
||||
eUpArrowKey = 0x6B737E00
|
||||
eDownArrowKey = 0x6B737D00
|
||||
eLeftArrowKey = 0x6B737B00
|
||||
eRightArrowKey = 0x6B737C00
|
||||
eHelpKey = 0x6B737200
|
||||
eHomeKey = 0x6B737300
|
||||
ePageUpKey = 0x6B737400
|
||||
ePageDownKey = 0x6B737900
|
||||
eForwardDelKey = 0x6B737500
|
||||
eEndKey = 0x6B737700
|
||||
eF1Key = 0x6B737A00
|
||||
eF2Key = 0x6B737800
|
||||
eF3Key = 0x6B736300
|
||||
eF4Key = 0x6B737600
|
||||
eF5Key = 0x6B736000
|
||||
eF6Key = 0x6B736100
|
||||
eF7Key = 0x6B736200
|
||||
eF8Key = 0x6B736400
|
||||
eF9Key = 0x6B736500
|
||||
eF10Key = 0x6B736D00
|
||||
eF11Key = 0x6B736700
|
||||
eF12Key = 0x6B736F00
|
||||
eF13Key = 0x6B736900
|
||||
eF14Key = 0x6B736B00
|
||||
eF15Key = 0x6B737100
|
||||
kAEAND = FOUR_CHAR_CODE('AND ')
|
||||
kAEOR = FOUR_CHAR_CODE('OR ')
|
||||
kAENOT = FOUR_CHAR_CODE('NOT ')
|
||||
kAEFirst = FOUR_CHAR_CODE('firs')
|
||||
kAELast = FOUR_CHAR_CODE('last')
|
||||
kAEMiddle = FOUR_CHAR_CODE('midd')
|
||||
kAEAny = FOUR_CHAR_CODE('any ')
|
||||
kAEAll = FOUR_CHAR_CODE('all ')
|
||||
kAENext = FOUR_CHAR_CODE('next')
|
||||
kAEPrevious = FOUR_CHAR_CODE('prev')
|
||||
keyAECompOperator = FOUR_CHAR_CODE('relo')
|
||||
keyAELogicalTerms = FOUR_CHAR_CODE('term')
|
||||
keyAELogicalOperator = FOUR_CHAR_CODE('logc')
|
||||
keyAEObject1 = FOUR_CHAR_CODE('obj1')
|
||||
keyAEObject2 = FOUR_CHAR_CODE('obj2')
|
||||
keyAEDesiredClass = FOUR_CHAR_CODE('want')
|
||||
keyAEContainer = FOUR_CHAR_CODE('from')
|
||||
keyAEKeyForm = FOUR_CHAR_CODE('form')
|
||||
keyAEKeyData = FOUR_CHAR_CODE('seld')
|
||||
keyAERangeStart = FOUR_CHAR_CODE('star')
|
||||
keyAERangeStop = FOUR_CHAR_CODE('stop')
|
||||
keyDisposeTokenProc = FOUR_CHAR_CODE('xtok')
|
||||
keyAECompareProc = FOUR_CHAR_CODE('cmpr')
|
||||
keyAECountProc = FOUR_CHAR_CODE('cont')
|
||||
keyAEMarkTokenProc = FOUR_CHAR_CODE('mkid')
|
||||
keyAEMarkProc = FOUR_CHAR_CODE('mark')
|
||||
keyAEAdjustMarksProc = FOUR_CHAR_CODE('adjm')
|
||||
keyAEGetErrDescProc = FOUR_CHAR_CODE('indc')
|
||||
formAbsolutePosition = FOUR_CHAR_CODE('indx')
|
||||
formRelativePosition = FOUR_CHAR_CODE('rele')
|
||||
formTest = FOUR_CHAR_CODE('test')
|
||||
formRange = FOUR_CHAR_CODE('rang')
|
||||
formPropertyID = FOUR_CHAR_CODE('prop')
|
||||
formName = FOUR_CHAR_CODE('name')
|
||||
typeObjectSpecifier = FOUR_CHAR_CODE('obj ')
|
||||
typeObjectBeingExamined = FOUR_CHAR_CODE('exmn')
|
||||
typeCurrentContainer = FOUR_CHAR_CODE('ccnt')
|
||||
typeToken = FOUR_CHAR_CODE('toke')
|
||||
typeRelativeDescriptor = FOUR_CHAR_CODE('rel ')
|
||||
typeAbsoluteOrdinal = FOUR_CHAR_CODE('abso')
|
||||
typeIndexDescriptor = FOUR_CHAR_CODE('inde')
|
||||
typeRangeDescriptor = FOUR_CHAR_CODE('rang')
|
||||
typeLogicalDescriptor = FOUR_CHAR_CODE('logi')
|
||||
typeCompDescriptor = FOUR_CHAR_CODE('cmpd')
|
||||
typeOSLTokenList = FOUR_CHAR_CODE('ostl')
|
||||
kAEIDoMinimum = 0x0000
|
||||
kAEIDoWhose = 0x0001
|
||||
kAEIDoMarking = 0x0004
|
||||
kAEPassSubDescs = 0x0008
|
||||
kAEResolveNestedLists = 0x0010
|
||||
kAEHandleSimpleRanges = 0x0020
|
||||
kAEUseRelativeIterators = 0x0040
|
||||
typeWhoseDescriptor = FOUR_CHAR_CODE('whos')
|
||||
formWhose = FOUR_CHAR_CODE('whos')
|
||||
typeWhoseRange = FOUR_CHAR_CODE('wrng')
|
||||
keyAEWhoseRangeStart = FOUR_CHAR_CODE('wstr')
|
||||
keyAEWhoseRangeStop = FOUR_CHAR_CODE('wstp')
|
||||
keyAEIndex = FOUR_CHAR_CODE('kidx')
|
||||
keyAETest = FOUR_CHAR_CODE('ktst')
|
||||
6
Darwin/lib/python2.7/plat-mac/Carbon/AppleHelp.py
Normal file
6
Darwin/lib/python2.7/plat-mac/Carbon/AppleHelp.py
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
# Generated from 'AppleHelp.h'
|
||||
|
||||
kAHInternalErr = -10790
|
||||
kAHInternetConfigPrefErr = -10791
|
||||
kAHTOCTypeUser = 0
|
||||
kAHTOCTypeDeveloper = 1
|
||||
1
Darwin/lib/python2.7/plat-mac/Carbon/CF.py
Normal file
1
Darwin/lib/python2.7/plat-mac/Carbon/CF.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
from _CF import *
|
||||
1
Darwin/lib/python2.7/plat-mac/Carbon/CG.py
Normal file
1
Darwin/lib/python2.7/plat-mac/Carbon/CG.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
from _CG import *
|
||||
451
Darwin/lib/python2.7/plat-mac/Carbon/CarbonEvents.py
Normal file
451
Darwin/lib/python2.7/plat-mac/Carbon/CarbonEvents.py
Normal file
|
|
@ -0,0 +1,451 @@
|
|||
# Generated from 'CarbonEvents.h'
|
||||
|
||||
def FOUR_CHAR_CODE(x): return x
|
||||
def FOUR_CHAR_CODE(x): return x
|
||||
false = 0
|
||||
true = 1
|
||||
keyAEEventClass = FOUR_CHAR_CODE('evcl')
|
||||
keyAEEventID = FOUR_CHAR_CODE('evti')
|
||||
eventAlreadyPostedErr = -9860
|
||||
eventTargetBusyErr = -9861
|
||||
eventClassInvalidErr = -9862
|
||||
eventClassIncorrectErr = -9864
|
||||
eventHandlerAlreadyInstalledErr = -9866
|
||||
eventInternalErr = -9868
|
||||
eventKindIncorrectErr = -9869
|
||||
eventParameterNotFoundErr = -9870
|
||||
eventNotHandledErr = -9874
|
||||
eventLoopTimedOutErr = -9875
|
||||
eventLoopQuitErr = -9876
|
||||
eventNotInQueueErr = -9877
|
||||
eventHotKeyExistsErr = -9878
|
||||
eventHotKeyInvalidErr = -9879
|
||||
kEventPriorityLow = 0
|
||||
kEventPriorityStandard = 1
|
||||
kEventPriorityHigh = 2
|
||||
kEventLeaveInQueue = false
|
||||
kEventRemoveFromQueue = true
|
||||
kTrackMouseLocationOptionDontConsumeMouseUp = (1 << 0)
|
||||
kMouseTrackingMouseDown = 1
|
||||
kMouseTrackingMouseUp = 2
|
||||
kMouseTrackingMouseExited = 3
|
||||
kMouseTrackingMouseEntered = 4
|
||||
kMouseTrackingMouseDragged = 5
|
||||
kMouseTrackingKeyModifiersChanged = 6
|
||||
kMouseTrackingUserCancelled = 7
|
||||
kMouseTrackingTimedOut = 8
|
||||
kMouseTrackingMouseMoved = 9
|
||||
kEventAttributeNone = 0
|
||||
kEventAttributeUserEvent = (1 << 0)
|
||||
kEventClassMouse = FOUR_CHAR_CODE('mous')
|
||||
kEventClassKeyboard = FOUR_CHAR_CODE('keyb')
|
||||
kEventClassTextInput = FOUR_CHAR_CODE('text')
|
||||
kEventClassApplication = FOUR_CHAR_CODE('appl')
|
||||
kEventClassAppleEvent = FOUR_CHAR_CODE('eppc')
|
||||
kEventClassMenu = FOUR_CHAR_CODE('menu')
|
||||
kEventClassWindow = FOUR_CHAR_CODE('wind')
|
||||
kEventClassControl = FOUR_CHAR_CODE('cntl')
|
||||
kEventClassCommand = FOUR_CHAR_CODE('cmds')
|
||||
kEventClassTablet = FOUR_CHAR_CODE('tblt')
|
||||
kEventClassVolume = FOUR_CHAR_CODE('vol ')
|
||||
kEventClassAppearance = FOUR_CHAR_CODE('appm')
|
||||
kEventClassService = FOUR_CHAR_CODE('serv')
|
||||
kEventMouseDown = 1
|
||||
kEventMouseUp = 2
|
||||
kEventMouseMoved = 5
|
||||
kEventMouseDragged = 6
|
||||
kEventMouseWheelMoved = 10
|
||||
kEventMouseButtonPrimary = 1
|
||||
kEventMouseButtonSecondary = 2
|
||||
kEventMouseButtonTertiary = 3
|
||||
kEventMouseWheelAxisX = 0
|
||||
kEventMouseWheelAxisY = 1
|
||||
kEventTextInputUpdateActiveInputArea = 1
|
||||
kEventTextInputUnicodeForKeyEvent = 2
|
||||
kEventTextInputOffsetToPos = 3
|
||||
kEventTextInputPosToOffset = 4
|
||||
kEventTextInputShowHideBottomWindow = 5
|
||||
kEventTextInputGetSelectedText = 6
|
||||
kEventRawKeyDown = 1
|
||||
kEventRawKeyRepeat = 2
|
||||
kEventRawKeyUp = 3
|
||||
kEventRawKeyModifiersChanged = 4
|
||||
kEventHotKeyPressed = 5
|
||||
kEventHotKeyReleased = 6
|
||||
kEventKeyModifierNumLockBit = 16
|
||||
kEventKeyModifierFnBit = 17
|
||||
kEventKeyModifierNumLockMask = 1L << kEventKeyModifierNumLockBit
|
||||
kEventKeyModifierFnMask = 1L << kEventKeyModifierFnBit
|
||||
kEventAppActivated = 1
|
||||
kEventAppDeactivated = 2
|
||||
kEventAppQuit = 3
|
||||
kEventAppLaunchNotification = 4
|
||||
kEventAppLaunched = 5
|
||||
kEventAppTerminated = 6
|
||||
kEventAppFrontSwitched = 7
|
||||
kEventAppGetDockTileMenu = 20
|
||||
kEventAppleEvent = 1
|
||||
kEventWindowUpdate = 1
|
||||
kEventWindowDrawContent = 2
|
||||
kEventWindowActivated = 5
|
||||
kEventWindowDeactivated = 6
|
||||
kEventWindowGetClickActivation = 7
|
||||
kEventWindowShowing = 22
|
||||
kEventWindowHiding = 23
|
||||
kEventWindowShown = 24
|
||||
kEventWindowHidden = 25
|
||||
kEventWindowCollapsing = 86
|
||||
kEventWindowCollapsed = 67
|
||||
kEventWindowExpanding = 87
|
||||
kEventWindowExpanded = 70
|
||||
kEventWindowZoomed = 76
|
||||
kEventWindowBoundsChanging = 26
|
||||
kEventWindowBoundsChanged = 27
|
||||
kEventWindowResizeStarted = 28
|
||||
kEventWindowResizeCompleted = 29
|
||||
kEventWindowDragStarted = 30
|
||||
kEventWindowDragCompleted = 31
|
||||
kEventWindowClosed = 73
|
||||
kWindowBoundsChangeUserDrag = (1 << 0)
|
||||
kWindowBoundsChangeUserResize = (1 << 1)
|
||||
kWindowBoundsChangeSizeChanged = (1 << 2)
|
||||
kWindowBoundsChangeOriginChanged = (1 << 3)
|
||||
kWindowBoundsChangeZoom = (1 << 4)
|
||||
kEventWindowClickDragRgn = 32
|
||||
kEventWindowClickResizeRgn = 33
|
||||
kEventWindowClickCollapseRgn = 34
|
||||
kEventWindowClickCloseRgn = 35
|
||||
kEventWindowClickZoomRgn = 36
|
||||
kEventWindowClickContentRgn = 37
|
||||
kEventWindowClickProxyIconRgn = 38
|
||||
kEventWindowClickToolbarButtonRgn = 41
|
||||
kEventWindowClickStructureRgn = 42
|
||||
kEventWindowCursorChange = 40
|
||||
kEventWindowCollapse = 66
|
||||
kEventWindowCollapseAll = 68
|
||||
kEventWindowExpand = 69
|
||||
kEventWindowExpandAll = 71
|
||||
kEventWindowClose = 72
|
||||
kEventWindowCloseAll = 74
|
||||
kEventWindowZoom = 75
|
||||
kEventWindowZoomAll = 77
|
||||
kEventWindowContextualMenuSelect = 78
|
||||
kEventWindowPathSelect = 79
|
||||
kEventWindowGetIdealSize = 80
|
||||
kEventWindowGetMinimumSize = 81
|
||||
kEventWindowGetMaximumSize = 82
|
||||
kEventWindowConstrain = 83
|
||||
kEventWindowHandleContentClick = 85
|
||||
kEventWindowProxyBeginDrag = 128
|
||||
kEventWindowProxyEndDrag = 129
|
||||
kEventWindowToolbarSwitchMode = 150
|
||||
kDockChangedUser = 1
|
||||
kDockChangedOrientation = 2
|
||||
kDockChangedAutohide = 3
|
||||
kDockChangedDisplay = 4
|
||||
kDockChangedItems = 5
|
||||
kDockChangedUnknown = 6
|
||||
kEventWindowFocusAcquired = 200
|
||||
kEventWindowFocusRelinquish = 201
|
||||
kEventWindowDrawFrame = 1000
|
||||
kEventWindowDrawPart = 1001
|
||||
kEventWindowGetRegion = 1002
|
||||
kEventWindowHitTest = 1003
|
||||
kEventWindowInit = 1004
|
||||
kEventWindowDispose = 1005
|
||||
kEventWindowDragHilite = 1006
|
||||
kEventWindowModified = 1007
|
||||
kEventWindowSetupProxyDragImage = 1008
|
||||
kEventWindowStateChanged = 1009
|
||||
kEventWindowMeasureTitle = 1010
|
||||
kEventWindowDrawGrowBox = 1011
|
||||
kEventWindowGetGrowImageRegion = 1012
|
||||
kEventWindowPaint = 1013
|
||||
kEventMenuBeginTracking = 1
|
||||
kEventMenuEndTracking = 2
|
||||
kEventMenuChangeTrackingMode = 3
|
||||
kEventMenuOpening = 4
|
||||
kEventMenuClosed = 5
|
||||
kEventMenuTargetItem = 6
|
||||
kEventMenuMatchKey = 7
|
||||
kEventMenuEnableItems = 8
|
||||
kEventMenuPopulate = 9
|
||||
kEventMenuMeasureItemWidth = 100
|
||||
kEventMenuMeasureItemHeight = 101
|
||||
kEventMenuDrawItem = 102
|
||||
kEventMenuDrawItemContent = 103
|
||||
kEventMenuDispose = 1001
|
||||
kMenuContextMenuBar = 1 << 0
|
||||
kMenuContextPullDown = 1 << 8
|
||||
kMenuContextPopUp = 1 << 9
|
||||
kMenuContextSubmenu = 1 << 10
|
||||
kMenuContextMenuBarTracking = 1 << 16
|
||||
kMenuContextPopUpTracking = 1 << 17
|
||||
kMenuContextKeyMatching = 1 << 18
|
||||
kMenuContextMenuEnabling = 1 << 19
|
||||
kMenuContextCommandIDSearch = 1 << 20
|
||||
kEventProcessCommand = 1
|
||||
kEventCommandProcess = 1
|
||||
kEventCommandUpdateStatus = 2
|
||||
kHICommandOK = FOUR_CHAR_CODE('ok ')
|
||||
kHICommandCancel = FOUR_CHAR_CODE('not!')
|
||||
kHICommandQuit = FOUR_CHAR_CODE('quit')
|
||||
kHICommandUndo = FOUR_CHAR_CODE('undo')
|
||||
kHICommandRedo = FOUR_CHAR_CODE('redo')
|
||||
kHICommandCut = FOUR_CHAR_CODE('cut ')
|
||||
kHICommandCopy = FOUR_CHAR_CODE('copy')
|
||||
kHICommandPaste = FOUR_CHAR_CODE('past')
|
||||
kHICommandClear = FOUR_CHAR_CODE('clea')
|
||||
kHICommandSelectAll = FOUR_CHAR_CODE('sall')
|
||||
kHICommandHide = FOUR_CHAR_CODE('hide')
|
||||
kHICommandHideOthers = FOUR_CHAR_CODE('hido')
|
||||
kHICommandShowAll = FOUR_CHAR_CODE('shal')
|
||||
kHICommandPreferences = FOUR_CHAR_CODE('pref')
|
||||
kHICommandZoomWindow = FOUR_CHAR_CODE('zoom')
|
||||
kHICommandMinimizeWindow = FOUR_CHAR_CODE('mini')
|
||||
kHICommandMinimizeAll = FOUR_CHAR_CODE('mina')
|
||||
kHICommandMaximizeWindow = FOUR_CHAR_CODE('maxi')
|
||||
kHICommandMaximizeAll = FOUR_CHAR_CODE('maxa')
|
||||
kHICommandArrangeInFront = FOUR_CHAR_CODE('frnt')
|
||||
kHICommandBringAllToFront = FOUR_CHAR_CODE('bfrt')
|
||||
kHICommandWindowListSeparator = FOUR_CHAR_CODE('wldv')
|
||||
kHICommandWindowListTerminator = FOUR_CHAR_CODE('wlst')
|
||||
kHICommandSelectWindow = FOUR_CHAR_CODE('swin')
|
||||
kHICommandAbout = FOUR_CHAR_CODE('abou')
|
||||
kHICommandNew = FOUR_CHAR_CODE('new ')
|
||||
kHICommandOpen = FOUR_CHAR_CODE('open')
|
||||
kHICommandClose = FOUR_CHAR_CODE('clos')
|
||||
kHICommandSave = FOUR_CHAR_CODE('save')
|
||||
kHICommandSaveAs = FOUR_CHAR_CODE('svas')
|
||||
kHICommandRevert = FOUR_CHAR_CODE('rvrt')
|
||||
kHICommandPrint = FOUR_CHAR_CODE('prnt')
|
||||
kHICommandPageSetup = FOUR_CHAR_CODE('page')
|
||||
kHICommandAppHelp = FOUR_CHAR_CODE('ahlp')
|
||||
kHICommandFromMenu = (1L << 0)
|
||||
kHICommandFromControl = (1L << 1)
|
||||
kHICommandFromWindow = (1L << 2)
|
||||
kEventControlInitialize = 1000
|
||||
kEventControlDispose = 1001
|
||||
kEventControlGetOptimalBounds = 1003
|
||||
kEventControlDefInitialize = kEventControlInitialize
|
||||
kEventControlDefDispose = kEventControlDispose
|
||||
kEventControlHit = 1
|
||||
kEventControlSimulateHit = 2
|
||||
kEventControlHitTest = 3
|
||||
kEventControlDraw = 4
|
||||
kEventControlApplyBackground = 5
|
||||
kEventControlApplyTextColor = 6
|
||||
kEventControlSetFocusPart = 7
|
||||
kEventControlGetFocusPart = 8
|
||||
kEventControlActivate = 9
|
||||
kEventControlDeactivate = 10
|
||||
kEventControlSetCursor = 11
|
||||
kEventControlContextualMenuClick = 12
|
||||
kEventControlClick = 13
|
||||
kEventControlTrack = 51
|
||||
kEventControlGetScrollToHereStartPoint = 52
|
||||
kEventControlGetIndicatorDragConstraint = 53
|
||||
kEventControlIndicatorMoved = 54
|
||||
kEventControlGhostingFinished = 55
|
||||
kEventControlGetActionProcPart = 56
|
||||
kEventControlGetPartRegion = 101
|
||||
kEventControlGetPartBounds = 102
|
||||
kEventControlSetData = 103
|
||||
kEventControlGetData = 104
|
||||
kEventControlValueFieldChanged = 151
|
||||
kEventControlAddedSubControl = 152
|
||||
kEventControlRemovingSubControl = 153
|
||||
kEventControlBoundsChanged = 154
|
||||
kEventControlOwningWindowChanged = 159
|
||||
kEventControlArbitraryMessage = 201
|
||||
kControlBoundsChangeSizeChanged = (1 << 2)
|
||||
kControlBoundsChangePositionChanged = (1 << 3)
|
||||
kEventTabletPoint = 1
|
||||
kEventTabletProximity = 2
|
||||
kEventTabletPointer = 1
|
||||
kEventVolumeMounted = 1
|
||||
kEventVolumeUnmounted = 2
|
||||
typeFSVolumeRefNum = FOUR_CHAR_CODE('voln')
|
||||
kEventAppearanceScrollBarVariantChanged = 1
|
||||
kEventServiceCopy = 1
|
||||
kEventServicePaste = 2
|
||||
kEventServiceGetTypes = 3
|
||||
kEventServicePerform = 4
|
||||
kEventParamDirectObject = FOUR_CHAR_CODE('----')
|
||||
kEventParamPostTarget = FOUR_CHAR_CODE('ptrg')
|
||||
typeEventTargetRef = FOUR_CHAR_CODE('etrg')
|
||||
kEventParamWindowRef = FOUR_CHAR_CODE('wind')
|
||||
kEventParamGrafPort = FOUR_CHAR_CODE('graf')
|
||||
kEventParamDragRef = FOUR_CHAR_CODE('drag')
|
||||
kEventParamMenuRef = FOUR_CHAR_CODE('menu')
|
||||
kEventParamEventRef = FOUR_CHAR_CODE('evnt')
|
||||
kEventParamControlRef = FOUR_CHAR_CODE('ctrl')
|
||||
kEventParamRgnHandle = FOUR_CHAR_CODE('rgnh')
|
||||
kEventParamEnabled = FOUR_CHAR_CODE('enab')
|
||||
kEventParamDimensions = FOUR_CHAR_CODE('dims')
|
||||
kEventParamAvailableBounds = FOUR_CHAR_CODE('avlb')
|
||||
kEventParamAEEventID = keyAEEventID
|
||||
kEventParamAEEventClass = keyAEEventClass
|
||||
kEventParamCGContextRef = FOUR_CHAR_CODE('cntx')
|
||||
kEventParamDeviceDepth = FOUR_CHAR_CODE('devd')
|
||||
kEventParamDeviceColor = FOUR_CHAR_CODE('devc')
|
||||
typeWindowRef = FOUR_CHAR_CODE('wind')
|
||||
typeGrafPtr = FOUR_CHAR_CODE('graf')
|
||||
typeGWorldPtr = FOUR_CHAR_CODE('gwld')
|
||||
typeDragRef = FOUR_CHAR_CODE('drag')
|
||||
typeMenuRef = FOUR_CHAR_CODE('menu')
|
||||
typeControlRef = FOUR_CHAR_CODE('ctrl')
|
||||
typeCollection = FOUR_CHAR_CODE('cltn')
|
||||
typeQDRgnHandle = FOUR_CHAR_CODE('rgnh')
|
||||
typeOSStatus = FOUR_CHAR_CODE('osst')
|
||||
typeCFStringRef = FOUR_CHAR_CODE('cfst')
|
||||
typeCFIndex = FOUR_CHAR_CODE('cfix')
|
||||
typeCFTypeRef = FOUR_CHAR_CODE('cfty')
|
||||
typeCGContextRef = FOUR_CHAR_CODE('cntx')
|
||||
typeHIPoint = FOUR_CHAR_CODE('hipt')
|
||||
typeHISize = FOUR_CHAR_CODE('hisz')
|
||||
typeHIRect = FOUR_CHAR_CODE('hirc')
|
||||
kEventParamMouseLocation = FOUR_CHAR_CODE('mloc')
|
||||
kEventParamMouseButton = FOUR_CHAR_CODE('mbtn')
|
||||
kEventParamClickCount = FOUR_CHAR_CODE('ccnt')
|
||||
kEventParamMouseWheelAxis = FOUR_CHAR_CODE('mwax')
|
||||
kEventParamMouseWheelDelta = FOUR_CHAR_CODE('mwdl')
|
||||
kEventParamMouseDelta = FOUR_CHAR_CODE('mdta')
|
||||
kEventParamMouseChord = FOUR_CHAR_CODE('chor')
|
||||
kEventParamTabletEventType = FOUR_CHAR_CODE('tblt')
|
||||
typeMouseButton = FOUR_CHAR_CODE('mbtn')
|
||||
typeMouseWheelAxis = FOUR_CHAR_CODE('mwax')
|
||||
kEventParamKeyCode = FOUR_CHAR_CODE('kcod')
|
||||
kEventParamKeyMacCharCodes = FOUR_CHAR_CODE('kchr')
|
||||
kEventParamKeyModifiers = FOUR_CHAR_CODE('kmod')
|
||||
kEventParamKeyUnicodes = FOUR_CHAR_CODE('kuni')
|
||||
kEventParamKeyboardType = FOUR_CHAR_CODE('kbdt')
|
||||
typeEventHotKeyID = FOUR_CHAR_CODE('hkid')
|
||||
kEventParamTextInputSendRefCon = FOUR_CHAR_CODE('tsrc')
|
||||
kEventParamTextInputSendComponentInstance = FOUR_CHAR_CODE('tsci')
|
||||
kEventParamTextInputSendSLRec = FOUR_CHAR_CODE('tssl')
|
||||
kEventParamTextInputReplySLRec = FOUR_CHAR_CODE('trsl')
|
||||
kEventParamTextInputSendText = FOUR_CHAR_CODE('tstx')
|
||||
kEventParamTextInputReplyText = FOUR_CHAR_CODE('trtx')
|
||||
kEventParamTextInputSendUpdateRng = FOUR_CHAR_CODE('tsup')
|
||||
kEventParamTextInputSendHiliteRng = FOUR_CHAR_CODE('tshi')
|
||||
kEventParamTextInputSendClauseRng = FOUR_CHAR_CODE('tscl')
|
||||
kEventParamTextInputSendPinRng = FOUR_CHAR_CODE('tspn')
|
||||
kEventParamTextInputSendFixLen = FOUR_CHAR_CODE('tsfx')
|
||||
kEventParamTextInputSendLeadingEdge = FOUR_CHAR_CODE('tsle')
|
||||
kEventParamTextInputReplyLeadingEdge = FOUR_CHAR_CODE('trle')
|
||||
kEventParamTextInputSendTextOffset = FOUR_CHAR_CODE('tsto')
|
||||
kEventParamTextInputReplyTextOffset = FOUR_CHAR_CODE('trto')
|
||||
kEventParamTextInputReplyRegionClass = FOUR_CHAR_CODE('trrg')
|
||||
kEventParamTextInputSendCurrentPoint = FOUR_CHAR_CODE('tscp')
|
||||
kEventParamTextInputSendDraggingMode = FOUR_CHAR_CODE('tsdm')
|
||||
kEventParamTextInputReplyPoint = FOUR_CHAR_CODE('trpt')
|
||||
kEventParamTextInputReplyFont = FOUR_CHAR_CODE('trft')
|
||||
kEventParamTextInputReplyFMFont = FOUR_CHAR_CODE('trfm')
|
||||
kEventParamTextInputReplyPointSize = FOUR_CHAR_CODE('trpz')
|
||||
kEventParamTextInputReplyLineHeight = FOUR_CHAR_CODE('trlh')
|
||||
kEventParamTextInputReplyLineAscent = FOUR_CHAR_CODE('trla')
|
||||
kEventParamTextInputReplyTextAngle = FOUR_CHAR_CODE('trta')
|
||||
kEventParamTextInputSendShowHide = FOUR_CHAR_CODE('tssh')
|
||||
kEventParamTextInputReplyShowHide = FOUR_CHAR_CODE('trsh')
|
||||
kEventParamTextInputSendKeyboardEvent = FOUR_CHAR_CODE('tske')
|
||||
kEventParamTextInputSendTextServiceEncoding = FOUR_CHAR_CODE('tsse')
|
||||
kEventParamTextInputSendTextServiceMacEncoding = FOUR_CHAR_CODE('tssm')
|
||||
kEventParamHICommand = FOUR_CHAR_CODE('hcmd')
|
||||
typeHICommand = FOUR_CHAR_CODE('hcmd')
|
||||
kEventParamWindowFeatures = FOUR_CHAR_CODE('wftr')
|
||||
kEventParamWindowDefPart = FOUR_CHAR_CODE('wdpc')
|
||||
kEventParamCurrentBounds = FOUR_CHAR_CODE('crct')
|
||||
kEventParamOriginalBounds = FOUR_CHAR_CODE('orct')
|
||||
kEventParamPreviousBounds = FOUR_CHAR_CODE('prct')
|
||||
kEventParamClickActivation = FOUR_CHAR_CODE('clac')
|
||||
kEventParamWindowRegionCode = FOUR_CHAR_CODE('wshp')
|
||||
kEventParamWindowDragHiliteFlag = FOUR_CHAR_CODE('wdhf')
|
||||
kEventParamWindowModifiedFlag = FOUR_CHAR_CODE('wmff')
|
||||
kEventParamWindowProxyGWorldPtr = FOUR_CHAR_CODE('wpgw')
|
||||
kEventParamWindowProxyImageRgn = FOUR_CHAR_CODE('wpir')
|
||||
kEventParamWindowProxyOutlineRgn = FOUR_CHAR_CODE('wpor')
|
||||
kEventParamWindowStateChangedFlags = FOUR_CHAR_CODE('wscf')
|
||||
kEventParamWindowTitleFullWidth = FOUR_CHAR_CODE('wtfw')
|
||||
kEventParamWindowTitleTextWidth = FOUR_CHAR_CODE('wttw')
|
||||
kEventParamWindowGrowRect = FOUR_CHAR_CODE('grct')
|
||||
kEventParamAttributes = FOUR_CHAR_CODE('attr')
|
||||
kEventParamDockChangedReason = FOUR_CHAR_CODE('dcrs')
|
||||
kEventParamPreviousDockRect = FOUR_CHAR_CODE('pdrc')
|
||||
kEventParamCurrentDockRect = FOUR_CHAR_CODE('cdrc')
|
||||
typeWindowRegionCode = FOUR_CHAR_CODE('wshp')
|
||||
typeWindowDefPartCode = FOUR_CHAR_CODE('wdpt')
|
||||
typeClickActivationResult = FOUR_CHAR_CODE('clac')
|
||||
kEventParamControlPart = FOUR_CHAR_CODE('cprt')
|
||||
kEventParamInitCollection = FOUR_CHAR_CODE('icol')
|
||||
kEventParamControlMessage = FOUR_CHAR_CODE('cmsg')
|
||||
kEventParamControlParam = FOUR_CHAR_CODE('cprm')
|
||||
kEventParamControlResult = FOUR_CHAR_CODE('crsl')
|
||||
kEventParamControlRegion = FOUR_CHAR_CODE('crgn')
|
||||
kEventParamControlAction = FOUR_CHAR_CODE('caup')
|
||||
kEventParamControlIndicatorDragConstraint = FOUR_CHAR_CODE('cidc')
|
||||
kEventParamControlIndicatorRegion = FOUR_CHAR_CODE('cirn')
|
||||
kEventParamControlIsGhosting = FOUR_CHAR_CODE('cgst')
|
||||
kEventParamControlIndicatorOffset = FOUR_CHAR_CODE('ciof')
|
||||
kEventParamControlClickActivationResult = FOUR_CHAR_CODE('ccar')
|
||||
kEventParamControlSubControl = FOUR_CHAR_CODE('csub')
|
||||
kEventParamControlOptimalBounds = FOUR_CHAR_CODE('cobn')
|
||||
kEventParamControlOptimalBaselineOffset = FOUR_CHAR_CODE('cobo')
|
||||
kEventParamControlDataTag = FOUR_CHAR_CODE('cdtg')
|
||||
kEventParamControlDataBuffer = FOUR_CHAR_CODE('cdbf')
|
||||
kEventParamControlDataBufferSize = FOUR_CHAR_CODE('cdbs')
|
||||
kEventParamControlDrawDepth = FOUR_CHAR_CODE('cddp')
|
||||
kEventParamControlDrawInColor = FOUR_CHAR_CODE('cdic')
|
||||
kEventParamControlFeatures = FOUR_CHAR_CODE('cftr')
|
||||
kEventParamControlPartBounds = FOUR_CHAR_CODE('cpbd')
|
||||
kEventParamControlOriginalOwningWindow = FOUR_CHAR_CODE('coow')
|
||||
kEventParamControlCurrentOwningWindow = FOUR_CHAR_CODE('ccow')
|
||||
typeControlActionUPP = FOUR_CHAR_CODE('caup')
|
||||
typeIndicatorDragConstraint = FOUR_CHAR_CODE('cidc')
|
||||
typeControlPartCode = FOUR_CHAR_CODE('cprt')
|
||||
kEventParamCurrentMenuTrackingMode = FOUR_CHAR_CODE('cmtm')
|
||||
kEventParamNewMenuTrackingMode = FOUR_CHAR_CODE('nmtm')
|
||||
kEventParamMenuFirstOpen = FOUR_CHAR_CODE('1sto')
|
||||
kEventParamMenuItemIndex = FOUR_CHAR_CODE('item')
|
||||
kEventParamMenuCommand = FOUR_CHAR_CODE('mcmd')
|
||||
kEventParamEnableMenuForKeyEvent = FOUR_CHAR_CODE('fork')
|
||||
kEventParamMenuEventOptions = FOUR_CHAR_CODE('meop')
|
||||
kEventParamMenuContext = FOUR_CHAR_CODE('mctx')
|
||||
kEventParamMenuItemBounds = FOUR_CHAR_CODE('mitb')
|
||||
kEventParamMenuMarkBounds = FOUR_CHAR_CODE('mmkb')
|
||||
kEventParamMenuIconBounds = FOUR_CHAR_CODE('micb')
|
||||
kEventParamMenuTextBounds = FOUR_CHAR_CODE('mtxb')
|
||||
kEventParamMenuTextBaseline = FOUR_CHAR_CODE('mtbl')
|
||||
kEventParamMenuCommandKeyBounds = FOUR_CHAR_CODE('mcmb')
|
||||
kEventParamMenuVirtualTop = FOUR_CHAR_CODE('mvrt')
|
||||
kEventParamMenuVirtualBottom = FOUR_CHAR_CODE('mvrb')
|
||||
kEventParamMenuDrawState = FOUR_CHAR_CODE('mdrs')
|
||||
kEventParamMenuItemType = FOUR_CHAR_CODE('mitp')
|
||||
kEventParamMenuItemWidth = FOUR_CHAR_CODE('mitw')
|
||||
kEventParamMenuItemHeight = FOUR_CHAR_CODE('mith')
|
||||
typeMenuItemIndex = FOUR_CHAR_CODE('midx')
|
||||
typeMenuCommand = FOUR_CHAR_CODE('mcmd')
|
||||
typeMenuTrackingMode = FOUR_CHAR_CODE('mtmd')
|
||||
typeMenuEventOptions = FOUR_CHAR_CODE('meop')
|
||||
typeThemeMenuState = FOUR_CHAR_CODE('tmns')
|
||||
typeThemeMenuItemType = FOUR_CHAR_CODE('tmit')
|
||||
kEventParamProcessID = FOUR_CHAR_CODE('psn ')
|
||||
kEventParamLaunchRefCon = FOUR_CHAR_CODE('lref')
|
||||
kEventParamLaunchErr = FOUR_CHAR_CODE('err ')
|
||||
kEventParamTabletPointRec = FOUR_CHAR_CODE('tbrc')
|
||||
kEventParamTabletProximityRec = FOUR_CHAR_CODE('tbpx')
|
||||
typeTabletPointRec = FOUR_CHAR_CODE('tbrc')
|
||||
typeTabletProximityRec = FOUR_CHAR_CODE('tbpx')
|
||||
kEventParamTabletPointerRec = FOUR_CHAR_CODE('tbrc')
|
||||
typeTabletPointerRec = FOUR_CHAR_CODE('tbrc')
|
||||
kEventParamNewScrollBarVariant = FOUR_CHAR_CODE('nsbv')
|
||||
kEventParamScrapRef = FOUR_CHAR_CODE('scrp')
|
||||
kEventParamServiceCopyTypes = FOUR_CHAR_CODE('svsd')
|
||||
kEventParamServicePasteTypes = FOUR_CHAR_CODE('svpt')
|
||||
kEventParamServiceMessageName = FOUR_CHAR_CODE('svmg')
|
||||
kEventParamServiceUserData = FOUR_CHAR_CODE('svud')
|
||||
typeScrapRef = FOUR_CHAR_CODE('scrp')
|
||||
typeCFMutableArrayRef = FOUR_CHAR_CODE('cfma')
|
||||
# sHandler = NewEventHandlerUPP( x )
|
||||
kMouseTrackingMousePressed = kMouseTrackingMouseDown
|
||||
kMouseTrackingMouseReleased = kMouseTrackingMouseUp
|
||||
1
Darwin/lib/python2.7/plat-mac/Carbon/CarbonEvt.py
Normal file
1
Darwin/lib/python2.7/plat-mac/Carbon/CarbonEvt.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
from _CarbonEvt import *
|
||||
1
Darwin/lib/python2.7/plat-mac/Carbon/Cm.py
Normal file
1
Darwin/lib/python2.7/plat-mac/Carbon/Cm.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
from _Cm import *
|
||||
62
Darwin/lib/python2.7/plat-mac/Carbon/Components.py
Normal file
62
Darwin/lib/python2.7/plat-mac/Carbon/Components.py
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
# Generated from 'Components.h'
|
||||
|
||||
def FOUR_CHAR_CODE(x): return x
|
||||
kAppleManufacturer = FOUR_CHAR_CODE('appl')
|
||||
kComponentResourceType = FOUR_CHAR_CODE('thng')
|
||||
kComponentAliasResourceType = FOUR_CHAR_CODE('thga')
|
||||
kAnyComponentType = 0
|
||||
kAnyComponentSubType = 0
|
||||
kAnyComponentManufacturer = 0
|
||||
kAnyComponentFlagsMask = 0
|
||||
cmpIsMissing = 1L << 29
|
||||
cmpWantsRegisterMessage = 1L << 31
|
||||
kComponentOpenSelect = -1
|
||||
kComponentCloseSelect = -2
|
||||
kComponentCanDoSelect = -3
|
||||
kComponentVersionSelect = -4
|
||||
kComponentRegisterSelect = -5
|
||||
kComponentTargetSelect = -6
|
||||
kComponentUnregisterSelect = -7
|
||||
kComponentGetMPWorkFunctionSelect = -8
|
||||
kComponentExecuteWiredActionSelect = -9
|
||||
kComponentGetPublicResourceSelect = -10
|
||||
componentDoAutoVersion = (1 << 0)
|
||||
componentWantsUnregister = (1 << 1)
|
||||
componentAutoVersionIncludeFlags = (1 << 2)
|
||||
componentHasMultiplePlatforms = (1 << 3)
|
||||
componentLoadResident = (1 << 4)
|
||||
defaultComponentIdentical = 0
|
||||
defaultComponentAnyFlags = 1
|
||||
defaultComponentAnyManufacturer = 2
|
||||
defaultComponentAnySubType = 4
|
||||
defaultComponentAnyFlagsAnyManufacturer = (defaultComponentAnyFlags + defaultComponentAnyManufacturer)
|
||||
defaultComponentAnyFlagsAnyManufacturerAnySubType = (defaultComponentAnyFlags + defaultComponentAnyManufacturer + defaultComponentAnySubType)
|
||||
registerComponentGlobal = 1
|
||||
registerComponentNoDuplicates = 2
|
||||
registerComponentAfterExisting = 4
|
||||
registerComponentAliasesOnly = 8
|
||||
platform68k = 1
|
||||
platformPowerPC = 2
|
||||
platformInterpreted = 3
|
||||
platformWin32 = 4
|
||||
platformPowerPCNativeEntryPoint = 5
|
||||
mpWorkFlagDoWork = (1 << 0)
|
||||
mpWorkFlagDoCompletion = (1 << 1)
|
||||
mpWorkFlagCopyWorkBlock = (1 << 2)
|
||||
mpWorkFlagDontBlock = (1 << 3)
|
||||
mpWorkFlagGetProcessorCount = (1 << 4)
|
||||
mpWorkFlagGetIsRunning = (1 << 6)
|
||||
cmpAliasNoFlags = 0
|
||||
cmpAliasOnlyThisFile = 1
|
||||
uppComponentFunctionImplementedProcInfo = 0x000002F0
|
||||
uppGetComponentVersionProcInfo = 0x000000F0
|
||||
uppComponentSetTargetProcInfo = 0x000003F0
|
||||
uppCallComponentOpenProcInfo = 0x000003F0
|
||||
uppCallComponentCloseProcInfo = 0x000003F0
|
||||
uppCallComponentCanDoProcInfo = 0x000002F0
|
||||
uppCallComponentVersionProcInfo = 0x000000F0
|
||||
uppCallComponentRegisterProcInfo = 0x000000F0
|
||||
uppCallComponentTargetProcInfo = 0x000003F0
|
||||
uppCallComponentUnregisterProcInfo = 0x000000F0
|
||||
uppCallComponentGetMPWorkFunctionProcInfo = 0x00000FF0
|
||||
uppCallComponentGetPublicResourceProcInfo = 0x00003BF0
|
||||
56
Darwin/lib/python2.7/plat-mac/Carbon/ControlAccessor.py
Normal file
56
Darwin/lib/python2.7/plat-mac/Carbon/ControlAccessor.py
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
# Accessor functions for control properties
|
||||
|
||||
from Controls import *
|
||||
import struct
|
||||
|
||||
# These needn't go through this module, but are here for completeness
|
||||
def SetControlData_Handle(control, part, selector, data):
|
||||
control.SetControlData_Handle(part, selector, data)
|
||||
|
||||
def GetControlData_Handle(control, part, selector):
|
||||
return control.GetControlData_Handle(part, selector)
|
||||
|
||||
_accessdict = {
|
||||
kControlPopupButtonMenuHandleTag: (SetControlData_Handle, GetControlData_Handle),
|
||||
}
|
||||
|
||||
_codingdict = {
|
||||
kControlPushButtonDefaultTag : ("b", None, None),
|
||||
|
||||
kControlEditTextTextTag: (None, None, None),
|
||||
kControlEditTextPasswordTag: (None, None, None),
|
||||
|
||||
kControlPopupButtonMenuIDTag: ("h", None, None),
|
||||
|
||||
kControlListBoxDoubleClickTag: ("b", None, None),
|
||||
}
|
||||
|
||||
def SetControlData(control, part, selector, data):
|
||||
if _accessdict.has_key(selector):
|
||||
setfunc, getfunc = _accessdict[selector]
|
||||
setfunc(control, part, selector, data)
|
||||
return
|
||||
if not _codingdict.has_key(selector):
|
||||
raise KeyError, ('Unknown control selector', selector)
|
||||
structfmt, coder, decoder = _codingdict[selector]
|
||||
if coder:
|
||||
data = coder(data)
|
||||
if structfmt:
|
||||
data = struct.pack(structfmt, data)
|
||||
control.SetControlData(part, selector, data)
|
||||
|
||||
def GetControlData(control, part, selector):
|
||||
if _accessdict.has_key(selector):
|
||||
setfunc, getfunc = _accessdict[selector]
|
||||
return getfunc(control, part, selector, data)
|
||||
if not _codingdict.has_key(selector):
|
||||
raise KeyError, ('Unknown control selector', selector)
|
||||
structfmt, coder, decoder = _codingdict[selector]
|
||||
data = control.GetControlData(part, selector)
|
||||
if structfmt:
|
||||
data = struct.unpack(structfmt, data)
|
||||
if decoder:
|
||||
data = decoder(data)
|
||||
if type(data) == type(()) and len(data) == 1:
|
||||
data = data[0]
|
||||
return data
|
||||
668
Darwin/lib/python2.7/plat-mac/Carbon/Controls.py
Normal file
668
Darwin/lib/python2.7/plat-mac/Carbon/Controls.py
Normal file
|
|
@ -0,0 +1,668 @@
|
|||
# Generated from 'Controls.h'
|
||||
|
||||
def FOUR_CHAR_CODE(x): return x
|
||||
from Carbon.TextEdit import *
|
||||
from Carbon.QuickDraw import *
|
||||
from Carbon.Dragconst import *
|
||||
from Carbon.CarbonEvents import *
|
||||
from Carbon.Appearance import *
|
||||
kDataBrowserItemAnyState = -1
|
||||
kControlBevelButtonCenterPopupGlyphTag = -1
|
||||
kDataBrowserClientPropertyFlagsMask = 0xFF000000
|
||||
|
||||
kControlDefProcType = FOUR_CHAR_CODE('CDEF')
|
||||
kControlTemplateResourceType = FOUR_CHAR_CODE('CNTL')
|
||||
kControlColorTableResourceType = FOUR_CHAR_CODE('cctb')
|
||||
kControlDefProcResourceType = FOUR_CHAR_CODE('CDEF')
|
||||
controlNotifyNothing = FOUR_CHAR_CODE('nada')
|
||||
controlNotifyClick = FOUR_CHAR_CODE('clik')
|
||||
controlNotifyFocus = FOUR_CHAR_CODE('focu')
|
||||
controlNotifyKey = FOUR_CHAR_CODE('key ')
|
||||
kControlCanAutoInvalidate = 1L << 0
|
||||
staticTextProc = 256
|
||||
editTextProc = 272
|
||||
iconProc = 288
|
||||
userItemProc = 304
|
||||
pictItemProc = 320
|
||||
cFrameColor = 0
|
||||
cBodyColor = 1
|
||||
cTextColor = 2
|
||||
cThumbColor = 3
|
||||
kNumberCtlCTabEntries = 4
|
||||
kControlNoVariant = 0
|
||||
kControlUsesOwningWindowsFontVariant = 1 << 3
|
||||
kControlNoPart = 0
|
||||
kControlIndicatorPart = 129
|
||||
kControlDisabledPart = 254
|
||||
kControlInactivePart = 255
|
||||
kControlEntireControl = 0
|
||||
kControlStructureMetaPart = -1
|
||||
kControlContentMetaPart = -2
|
||||
kControlFocusNoPart = 0
|
||||
kControlFocusNextPart = -1
|
||||
kControlFocusPrevPart = -2
|
||||
kControlCollectionTagBounds = FOUR_CHAR_CODE('boun')
|
||||
kControlCollectionTagValue = FOUR_CHAR_CODE('valu')
|
||||
kControlCollectionTagMinimum = FOUR_CHAR_CODE('min ')
|
||||
kControlCollectionTagMaximum = FOUR_CHAR_CODE('max ')
|
||||
kControlCollectionTagViewSize = FOUR_CHAR_CODE('view')
|
||||
kControlCollectionTagVisibility = FOUR_CHAR_CODE('visi')
|
||||
kControlCollectionTagRefCon = FOUR_CHAR_CODE('refc')
|
||||
kControlCollectionTagTitle = FOUR_CHAR_CODE('titl')
|
||||
kControlCollectionTagUnicodeTitle = FOUR_CHAR_CODE('uttl')
|
||||
kControlCollectionTagIDSignature = FOUR_CHAR_CODE('idsi')
|
||||
kControlCollectionTagIDID = FOUR_CHAR_CODE('idid')
|
||||
kControlCollectionTagCommand = FOUR_CHAR_CODE('cmd ')
|
||||
kControlCollectionTagVarCode = FOUR_CHAR_CODE('varc')
|
||||
kControlContentTextOnly = 0
|
||||
kControlNoContent = 0
|
||||
kControlContentIconSuiteRes = 1
|
||||
kControlContentCIconRes = 2
|
||||
kControlContentPictRes = 3
|
||||
kControlContentICONRes = 4
|
||||
kControlContentIconSuiteHandle = 129
|
||||
kControlContentCIconHandle = 130
|
||||
kControlContentPictHandle = 131
|
||||
kControlContentIconRef = 132
|
||||
kControlContentICON = 133
|
||||
kControlKeyScriptBehaviorAllowAnyScript = FOUR_CHAR_CODE('any ')
|
||||
kControlKeyScriptBehaviorPrefersRoman = FOUR_CHAR_CODE('prmn')
|
||||
kControlKeyScriptBehaviorRequiresRoman = FOUR_CHAR_CODE('rrmn')
|
||||
kControlFontBigSystemFont = -1
|
||||
kControlFontSmallSystemFont = -2
|
||||
kControlFontSmallBoldSystemFont = -3
|
||||
kControlFontViewSystemFont = -4
|
||||
kControlUseFontMask = 0x0001
|
||||
kControlUseFaceMask = 0x0002
|
||||
kControlUseSizeMask = 0x0004
|
||||
kControlUseForeColorMask = 0x0008
|
||||
kControlUseBackColorMask = 0x0010
|
||||
kControlUseModeMask = 0x0020
|
||||
kControlUseJustMask = 0x0040
|
||||
kControlUseAllMask = 0x00FF
|
||||
kControlAddFontSizeMask = 0x0100
|
||||
kControlAddToMetaFontMask = 0x0200
|
||||
kControlUseThemeFontIDMask = 0x0080
|
||||
kDoNotActivateAndIgnoreClick = 0
|
||||
kDoNotActivateAndHandleClick = 1
|
||||
kActivateAndIgnoreClick = 2
|
||||
kActivateAndHandleClick = 3
|
||||
kControlFontStyleTag = FOUR_CHAR_CODE('font')
|
||||
kControlKeyFilterTag = FOUR_CHAR_CODE('fltr')
|
||||
kControlKindTag = FOUR_CHAR_CODE('kind')
|
||||
kControlSizeTag = FOUR_CHAR_CODE('size')
|
||||
kControlSupportsGhosting = 1 << 0
|
||||
kControlSupportsEmbedding = 1 << 1
|
||||
kControlSupportsFocus = 1 << 2
|
||||
kControlWantsIdle = 1 << 3
|
||||
kControlWantsActivate = 1 << 4
|
||||
kControlHandlesTracking = 1 << 5
|
||||
kControlSupportsDataAccess = 1 << 6
|
||||
kControlHasSpecialBackground = 1 << 7
|
||||
kControlGetsFocusOnClick = 1 << 8
|
||||
kControlSupportsCalcBestRect = 1 << 9
|
||||
kControlSupportsLiveFeedback = 1 << 10
|
||||
kControlHasRadioBehavior = 1 << 11
|
||||
kControlSupportsDragAndDrop = 1 << 12
|
||||
kControlAutoToggles = 1 << 14
|
||||
kControlSupportsGetRegion = 1 << 17
|
||||
kControlSupportsFlattening = 1 << 19
|
||||
kControlSupportsSetCursor = 1 << 20
|
||||
kControlSupportsContextualMenus = 1 << 21
|
||||
kControlSupportsClickActivation = 1 << 22
|
||||
kControlIdlesWithTimer = 1 << 23
|
||||
drawCntl = 0
|
||||
testCntl = 1
|
||||
calcCRgns = 2
|
||||
initCntl = 3
|
||||
dispCntl = 4
|
||||
posCntl = 5
|
||||
thumbCntl = 6
|
||||
dragCntl = 7
|
||||
autoTrack = 8
|
||||
calcCntlRgn = 10
|
||||
calcThumbRgn = 11
|
||||
drawThumbOutline = 12
|
||||
kControlMsgDrawGhost = 13
|
||||
kControlMsgCalcBestRect = 14
|
||||
kControlMsgHandleTracking = 15
|
||||
kControlMsgFocus = 16
|
||||
kControlMsgKeyDown = 17
|
||||
kControlMsgIdle = 18
|
||||
kControlMsgGetFeatures = 19
|
||||
kControlMsgSetData = 20
|
||||
kControlMsgGetData = 21
|
||||
kControlMsgActivate = 22
|
||||
kControlMsgSetUpBackground = 23
|
||||
kControlMsgCalcValueFromPos = 26
|
||||
kControlMsgTestNewMsgSupport = 27
|
||||
kControlMsgSubValueChanged = 25
|
||||
kControlMsgSubControlAdded = 28
|
||||
kControlMsgSubControlRemoved = 29
|
||||
kControlMsgApplyTextColor = 30
|
||||
kControlMsgGetRegion = 31
|
||||
kControlMsgFlatten = 32
|
||||
kControlMsgSetCursor = 33
|
||||
kControlMsgDragEnter = 38
|
||||
kControlMsgDragLeave = 39
|
||||
kControlMsgDragWithin = 40
|
||||
kControlMsgDragReceive = 41
|
||||
kControlMsgDisplayDebugInfo = 46
|
||||
kControlMsgContextualMenuClick = 47
|
||||
kControlMsgGetClickActivation = 48
|
||||
kControlSizeNormal = 0
|
||||
kControlSizeSmall = 1
|
||||
kControlSizeLarge = 2
|
||||
kControlSizeAuto = 0xFFFF
|
||||
kDrawControlEntireControl = 0
|
||||
kDrawControlIndicatorOnly = 129
|
||||
kDragControlEntireControl = 0
|
||||
kDragControlIndicator = 1
|
||||
kControlSupportsNewMessages = FOUR_CHAR_CODE(' ok ')
|
||||
kControlKeyFilterBlockKey = 0
|
||||
kControlKeyFilterPassKey = 1
|
||||
noConstraint = kNoConstraint
|
||||
hAxisOnly = 1
|
||||
vAxisOnly = 2
|
||||
kControlDefProcPtr = 0
|
||||
kControlDefObjectClass = 1
|
||||
kControlKindSignatureApple = FOUR_CHAR_CODE('appl')
|
||||
kControlPropertyPersistent = 0x00000001
|
||||
kDragTrackingEnterControl = 2
|
||||
kDragTrackingInControl = 3
|
||||
kDragTrackingLeaveControl = 4
|
||||
useWFont = kControlUsesOwningWindowsFontVariant
|
||||
inThumb = kControlIndicatorPart
|
||||
kNoHiliteControlPart = kControlNoPart
|
||||
kInIndicatorControlPart = kControlIndicatorPart
|
||||
kReservedControlPart = kControlDisabledPart
|
||||
kControlInactiveControlPart = kControlInactivePart
|
||||
kControlTabListResType = FOUR_CHAR_CODE('tab#')
|
||||
kControlListDescResType = FOUR_CHAR_CODE('ldes')
|
||||
kControlCheckBoxUncheckedValue = 0
|
||||
kControlCheckBoxCheckedValue = 1
|
||||
kControlCheckBoxMixedValue = 2
|
||||
kControlRadioButtonUncheckedValue = 0
|
||||
kControlRadioButtonCheckedValue = 1
|
||||
kControlRadioButtonMixedValue = 2
|
||||
popupFixedWidth = 1 << 0
|
||||
popupVariableWidth = 1 << 1
|
||||
popupUseAddResMenu = 1 << 2
|
||||
popupUseWFont = 1 << 3
|
||||
popupTitleBold = 1 << 8
|
||||
popupTitleItalic = 1 << 9
|
||||
popupTitleUnderline = 1 << 10
|
||||
popupTitleOutline = 1 << 11
|
||||
popupTitleShadow = 1 << 12
|
||||
popupTitleCondense = 1 << 13
|
||||
popupTitleExtend = 1 << 14
|
||||
popupTitleNoStyle = 1 << 15
|
||||
popupTitleLeftJust = 0x00000000
|
||||
popupTitleCenterJust = 0x00000001
|
||||
popupTitleRightJust = 0x000000FF
|
||||
pushButProc = 0
|
||||
checkBoxProc = 1
|
||||
radioButProc = 2
|
||||
scrollBarProc = 16
|
||||
popupMenuProc = 1008
|
||||
kControlLabelPart = 1
|
||||
kControlMenuPart = 2
|
||||
kControlTrianglePart = 4
|
||||
kControlEditTextPart = 5
|
||||
kControlPicturePart = 6
|
||||
kControlIconPart = 7
|
||||
kControlClockPart = 8
|
||||
kControlListBoxPart = 24
|
||||
kControlListBoxDoubleClickPart = 25
|
||||
kControlImageWellPart = 26
|
||||
kControlRadioGroupPart = 27
|
||||
kControlButtonPart = 10
|
||||
kControlCheckBoxPart = 11
|
||||
kControlRadioButtonPart = 11
|
||||
kControlUpButtonPart = 20
|
||||
kControlDownButtonPart = 21
|
||||
kControlPageUpPart = 22
|
||||
kControlPageDownPart = 23
|
||||
kControlClockHourDayPart = 9
|
||||
kControlClockMinuteMonthPart = 10
|
||||
kControlClockSecondYearPart = 11
|
||||
kControlClockAMPMPart = 12
|
||||
kControlDataBrowserPart = 24
|
||||
kControlDataBrowserDraggedPart = 25
|
||||
kControlBevelButtonSmallBevelProc = 32
|
||||
kControlBevelButtonNormalBevelProc = 33
|
||||
kControlBevelButtonLargeBevelProc = 34
|
||||
kControlBevelButtonSmallBevelVariant = 0
|
||||
kControlBevelButtonNormalBevelVariant = (1 << 0)
|
||||
kControlBevelButtonLargeBevelVariant = (1 << 1)
|
||||
kControlBevelButtonMenuOnRightVariant = (1 << 2)
|
||||
kControlBevelButtonSmallBevel = 0
|
||||
kControlBevelButtonNormalBevel = 1
|
||||
kControlBevelButtonLargeBevel = 2
|
||||
kControlBehaviorPushbutton = 0
|
||||
kControlBehaviorToggles = 0x0100
|
||||
kControlBehaviorSticky = 0x0200
|
||||
kControlBehaviorSingleValueMenu = 0
|
||||
kControlBehaviorMultiValueMenu = 0x4000
|
||||
kControlBehaviorOffsetContents = 0x8000
|
||||
kControlBehaviorCommandMenu = 0x2000
|
||||
kControlBevelButtonMenuOnBottom = 0
|
||||
kControlBevelButtonMenuOnRight = (1 << 2)
|
||||
kControlKindBevelButton = FOUR_CHAR_CODE('bevl')
|
||||
kControlBevelButtonAlignSysDirection = -1
|
||||
kControlBevelButtonAlignCenter = 0
|
||||
kControlBevelButtonAlignLeft = 1
|
||||
kControlBevelButtonAlignRight = 2
|
||||
kControlBevelButtonAlignTop = 3
|
||||
kControlBevelButtonAlignBottom = 4
|
||||
kControlBevelButtonAlignTopLeft = 5
|
||||
kControlBevelButtonAlignBottomLeft = 6
|
||||
kControlBevelButtonAlignTopRight = 7
|
||||
kControlBevelButtonAlignBottomRight = 8
|
||||
kControlBevelButtonAlignTextSysDirection = teFlushDefault
|
||||
kControlBevelButtonAlignTextCenter = teCenter
|
||||
kControlBevelButtonAlignTextFlushRight = teFlushRight
|
||||
kControlBevelButtonAlignTextFlushLeft = teFlushLeft
|
||||
kControlBevelButtonPlaceSysDirection = -1
|
||||
kControlBevelButtonPlaceNormally = 0
|
||||
kControlBevelButtonPlaceToRightOfGraphic = 1
|
||||
kControlBevelButtonPlaceToLeftOfGraphic = 2
|
||||
kControlBevelButtonPlaceBelowGraphic = 3
|
||||
kControlBevelButtonPlaceAboveGraphic = 4
|
||||
kControlBevelButtonContentTag = FOUR_CHAR_CODE('cont')
|
||||
kControlBevelButtonTransformTag = FOUR_CHAR_CODE('tran')
|
||||
kControlBevelButtonTextAlignTag = FOUR_CHAR_CODE('tali')
|
||||
kControlBevelButtonTextOffsetTag = FOUR_CHAR_CODE('toff')
|
||||
kControlBevelButtonGraphicAlignTag = FOUR_CHAR_CODE('gali')
|
||||
kControlBevelButtonGraphicOffsetTag = FOUR_CHAR_CODE('goff')
|
||||
kControlBevelButtonTextPlaceTag = FOUR_CHAR_CODE('tplc')
|
||||
kControlBevelButtonMenuValueTag = FOUR_CHAR_CODE('mval')
|
||||
kControlBevelButtonMenuHandleTag = FOUR_CHAR_CODE('mhnd')
|
||||
kControlBevelButtonMenuRefTag = FOUR_CHAR_CODE('mhnd')
|
||||
# kControlBevelButtonCenterPopupGlyphTag = FOUR_CHAR_CODE('pglc')
|
||||
kControlBevelButtonLastMenuTag = FOUR_CHAR_CODE('lmnu')
|
||||
kControlBevelButtonMenuDelayTag = FOUR_CHAR_CODE('mdly')
|
||||
kControlBevelButtonScaleIconTag = FOUR_CHAR_CODE('scal')
|
||||
kControlBevelButtonOwnedMenuRefTag = FOUR_CHAR_CODE('omrf')
|
||||
kControlBevelButtonKindTag = FOUR_CHAR_CODE('bebk')
|
||||
kControlSliderProc = 48
|
||||
kControlSliderLiveFeedback = (1 << 0)
|
||||
kControlSliderHasTickMarks = (1 << 1)
|
||||
kControlSliderReverseDirection = (1 << 2)
|
||||
kControlSliderNonDirectional = (1 << 3)
|
||||
kControlSliderPointsDownOrRight = 0
|
||||
kControlSliderPointsUpOrLeft = 1
|
||||
kControlSliderDoesNotPoint = 2
|
||||
kControlKindSlider = FOUR_CHAR_CODE('sldr')
|
||||
kControlTriangleProc = 64
|
||||
kControlTriangleLeftFacingProc = 65
|
||||
kControlTriangleAutoToggleProc = 66
|
||||
kControlTriangleLeftFacingAutoToggleProc = 67
|
||||
kControlDisclosureTrianglePointDefault = 0
|
||||
kControlDisclosureTrianglePointRight = 1
|
||||
kControlDisclosureTrianglePointLeft = 2
|
||||
kControlKindDisclosureTriangle = FOUR_CHAR_CODE('dist')
|
||||
kControlTriangleLastValueTag = FOUR_CHAR_CODE('last')
|
||||
kControlProgressBarProc = 80
|
||||
kControlRelevanceBarProc = 81
|
||||
kControlKindProgressBar = FOUR_CHAR_CODE('prgb')
|
||||
kControlKindRelevanceBar = FOUR_CHAR_CODE('relb')
|
||||
kControlProgressBarIndeterminateTag = FOUR_CHAR_CODE('inde')
|
||||
kControlProgressBarAnimatingTag = FOUR_CHAR_CODE('anim')
|
||||
kControlLittleArrowsProc = 96
|
||||
kControlKindLittleArrows = FOUR_CHAR_CODE('larr')
|
||||
kControlChasingArrowsProc = 112
|
||||
kControlKindChasingArrows = FOUR_CHAR_CODE('carr')
|
||||
kControlChasingArrowsAnimatingTag = FOUR_CHAR_CODE('anim')
|
||||
kControlTabLargeProc = 128
|
||||
kControlTabSmallProc = 129
|
||||
kControlTabLargeNorthProc = 128
|
||||
kControlTabSmallNorthProc = 129
|
||||
kControlTabLargeSouthProc = 130
|
||||
kControlTabSmallSouthProc = 131
|
||||
kControlTabLargeEastProc = 132
|
||||
kControlTabSmallEastProc = 133
|
||||
kControlTabLargeWestProc = 134
|
||||
kControlTabSmallWestProc = 135
|
||||
kControlTabDirectionNorth = 0
|
||||
kControlTabDirectionSouth = 1
|
||||
kControlTabDirectionEast = 2
|
||||
kControlTabDirectionWest = 3
|
||||
kControlTabSizeLarge = kControlSizeNormal
|
||||
kControlTabSizeSmall = kControlSizeSmall
|
||||
kControlKindTabs = FOUR_CHAR_CODE('tabs')
|
||||
kControlTabContentRectTag = FOUR_CHAR_CODE('rect')
|
||||
kControlTabEnabledFlagTag = FOUR_CHAR_CODE('enab')
|
||||
kControlTabFontStyleTag = kControlFontStyleTag
|
||||
kControlTabInfoTag = FOUR_CHAR_CODE('tabi')
|
||||
kControlTabImageContentTag = FOUR_CHAR_CODE('cont')
|
||||
kControlTabInfoVersionZero = 0
|
||||
kControlTabInfoVersionOne = 1
|
||||
kControlSeparatorLineProc = 144
|
||||
kControlKindSeparator = FOUR_CHAR_CODE('sepa')
|
||||
kControlGroupBoxTextTitleProc = 160
|
||||
kControlGroupBoxCheckBoxProc = 161
|
||||
kControlGroupBoxPopupButtonProc = 162
|
||||
kControlGroupBoxSecondaryTextTitleProc = 164
|
||||
kControlGroupBoxSecondaryCheckBoxProc = 165
|
||||
kControlGroupBoxSecondaryPopupButtonProc = 166
|
||||
kControlKindGroupBox = FOUR_CHAR_CODE('grpb')
|
||||
kControlKindCheckGroupBox = FOUR_CHAR_CODE('cgrp')
|
||||
kControlKindPopupGroupBox = FOUR_CHAR_CODE('pgrp')
|
||||
kControlGroupBoxMenuHandleTag = FOUR_CHAR_CODE('mhan')
|
||||
kControlGroupBoxMenuRefTag = FOUR_CHAR_CODE('mhan')
|
||||
kControlGroupBoxFontStyleTag = kControlFontStyleTag
|
||||
kControlGroupBoxTitleRectTag = FOUR_CHAR_CODE('trec')
|
||||
kControlImageWellProc = 176
|
||||
kControlKindImageWell = FOUR_CHAR_CODE('well')
|
||||
kControlImageWellContentTag = FOUR_CHAR_CODE('cont')
|
||||
kControlImageWellTransformTag = FOUR_CHAR_CODE('tran')
|
||||
kControlImageWellIsDragDestinationTag = FOUR_CHAR_CODE('drag')
|
||||
kControlPopupArrowEastProc = 192
|
||||
kControlPopupArrowWestProc = 193
|
||||
kControlPopupArrowNorthProc = 194
|
||||
kControlPopupArrowSouthProc = 195
|
||||
kControlPopupArrowSmallEastProc = 196
|
||||
kControlPopupArrowSmallWestProc = 197
|
||||
kControlPopupArrowSmallNorthProc = 198
|
||||
kControlPopupArrowSmallSouthProc = 199
|
||||
kControlPopupArrowOrientationEast = 0
|
||||
kControlPopupArrowOrientationWest = 1
|
||||
kControlPopupArrowOrientationNorth = 2
|
||||
kControlPopupArrowOrientationSouth = 3
|
||||
kControlPopupArrowSizeNormal = 0
|
||||
kControlPopupArrowSizeSmall = 1
|
||||
kControlKindPopupArrow = FOUR_CHAR_CODE('parr')
|
||||
kControlPlacardProc = 224
|
||||
kControlKindPlacard = FOUR_CHAR_CODE('plac')
|
||||
kControlClockTimeProc = 240
|
||||
kControlClockTimeSecondsProc = 241
|
||||
kControlClockDateProc = 242
|
||||
kControlClockMonthYearProc = 243
|
||||
kControlClockTypeHourMinute = 0
|
||||
kControlClockTypeHourMinuteSecond = 1
|
||||
kControlClockTypeMonthDayYear = 2
|
||||
kControlClockTypeMonthYear = 3
|
||||
kControlClockFlagStandard = 0
|
||||
kControlClockNoFlags = 0
|
||||
kControlClockFlagDisplayOnly = 1
|
||||
kControlClockIsDisplayOnly = 1
|
||||
kControlClockFlagLive = 2
|
||||
kControlClockIsLive = 2
|
||||
kControlKindClock = FOUR_CHAR_CODE('clck')
|
||||
kControlClockLongDateTag = FOUR_CHAR_CODE('date')
|
||||
kControlClockFontStyleTag = kControlFontStyleTag
|
||||
kControlClockAnimatingTag = FOUR_CHAR_CODE('anim')
|
||||
kControlUserPaneProc = 256
|
||||
kControlKindUserPane = FOUR_CHAR_CODE('upan')
|
||||
kControlUserItemDrawProcTag = FOUR_CHAR_CODE('uidp')
|
||||
kControlUserPaneDrawProcTag = FOUR_CHAR_CODE('draw')
|
||||
kControlUserPaneHitTestProcTag = FOUR_CHAR_CODE('hitt')
|
||||
kControlUserPaneTrackingProcTag = FOUR_CHAR_CODE('trak')
|
||||
kControlUserPaneIdleProcTag = FOUR_CHAR_CODE('idle')
|
||||
kControlUserPaneKeyDownProcTag = FOUR_CHAR_CODE('keyd')
|
||||
kControlUserPaneActivateProcTag = FOUR_CHAR_CODE('acti')
|
||||
kControlUserPaneFocusProcTag = FOUR_CHAR_CODE('foci')
|
||||
kControlUserPaneBackgroundProcTag = FOUR_CHAR_CODE('back')
|
||||
kControlEditTextProc = 272
|
||||
kControlEditTextPasswordProc = 274
|
||||
kControlEditTextInlineInputProc = 276
|
||||
kControlKindEditText = FOUR_CHAR_CODE('etxt')
|
||||
kControlEditTextStyleTag = kControlFontStyleTag
|
||||
kControlEditTextTextTag = FOUR_CHAR_CODE('text')
|
||||
kControlEditTextTEHandleTag = FOUR_CHAR_CODE('than')
|
||||
kControlEditTextKeyFilterTag = kControlKeyFilterTag
|
||||
kControlEditTextSelectionTag = FOUR_CHAR_CODE('sele')
|
||||
kControlEditTextPasswordTag = FOUR_CHAR_CODE('pass')
|
||||
kControlEditTextKeyScriptBehaviorTag = FOUR_CHAR_CODE('kscr')
|
||||
kControlEditTextLockedTag = FOUR_CHAR_CODE('lock')
|
||||
kControlEditTextFixedTextTag = FOUR_CHAR_CODE('ftxt')
|
||||
kControlEditTextValidationProcTag = FOUR_CHAR_CODE('vali')
|
||||
kControlEditTextInlinePreUpdateProcTag = FOUR_CHAR_CODE('prup')
|
||||
kControlEditTextInlinePostUpdateProcTag = FOUR_CHAR_CODE('poup')
|
||||
kControlEditTextCFStringTag = FOUR_CHAR_CODE('cfst')
|
||||
kControlEditTextPasswordCFStringTag = FOUR_CHAR_CODE('pwcf')
|
||||
kControlStaticTextProc = 288
|
||||
kControlKindStaticText = FOUR_CHAR_CODE('stxt')
|
||||
kControlStaticTextStyleTag = kControlFontStyleTag
|
||||
kControlStaticTextTextTag = FOUR_CHAR_CODE('text')
|
||||
kControlStaticTextTextHeightTag = FOUR_CHAR_CODE('thei')
|
||||
kControlStaticTextTruncTag = FOUR_CHAR_CODE('trun')
|
||||
kControlStaticTextCFStringTag = FOUR_CHAR_CODE('cfst')
|
||||
kControlPictureProc = 304
|
||||
kControlPictureNoTrackProc = 305
|
||||
kControlKindPicture = FOUR_CHAR_CODE('pict')
|
||||
kControlPictureHandleTag = FOUR_CHAR_CODE('pich')
|
||||
kControlIconProc = 320
|
||||
kControlIconNoTrackProc = 321
|
||||
kControlIconSuiteProc = 322
|
||||
kControlIconSuiteNoTrackProc = 323
|
||||
kControlIconRefProc = 324
|
||||
kControlIconRefNoTrackProc = 325
|
||||
kControlKindIcon = FOUR_CHAR_CODE('icon')
|
||||
kControlIconTransformTag = FOUR_CHAR_CODE('trfm')
|
||||
kControlIconAlignmentTag = FOUR_CHAR_CODE('algn')
|
||||
kControlIconResourceIDTag = FOUR_CHAR_CODE('ires')
|
||||
kControlIconContentTag = FOUR_CHAR_CODE('cont')
|
||||
kControlWindowHeaderProc = 336
|
||||
kControlWindowListViewHeaderProc = 337
|
||||
kControlKindWindowHeader = FOUR_CHAR_CODE('whed')
|
||||
kControlListBoxProc = 352
|
||||
kControlListBoxAutoSizeProc = 353
|
||||
kControlKindListBox = FOUR_CHAR_CODE('lbox')
|
||||
kControlListBoxListHandleTag = FOUR_CHAR_CODE('lhan')
|
||||
kControlListBoxKeyFilterTag = kControlKeyFilterTag
|
||||
kControlListBoxFontStyleTag = kControlFontStyleTag
|
||||
kControlListBoxDoubleClickTag = FOUR_CHAR_CODE('dblc')
|
||||
kControlListBoxLDEFTag = FOUR_CHAR_CODE('ldef')
|
||||
kControlPushButtonProc = 368
|
||||
kControlCheckBoxProc = 369
|
||||
kControlRadioButtonProc = 370
|
||||
kControlPushButLeftIconProc = 374
|
||||
kControlPushButRightIconProc = 375
|
||||
kControlCheckBoxAutoToggleProc = 371
|
||||
kControlRadioButtonAutoToggleProc = 372
|
||||
kControlPushButtonIconOnLeft = 6
|
||||
kControlPushButtonIconOnRight = 7
|
||||
kControlKindPushButton = FOUR_CHAR_CODE('push')
|
||||
kControlKindPushIconButton = FOUR_CHAR_CODE('picn')
|
||||
kControlKindRadioButton = FOUR_CHAR_CODE('rdio')
|
||||
kControlKindCheckBox = FOUR_CHAR_CODE('cbox')
|
||||
kControlPushButtonDefaultTag = FOUR_CHAR_CODE('dflt')
|
||||
kControlPushButtonCancelTag = FOUR_CHAR_CODE('cncl')
|
||||
kControlScrollBarProc = 384
|
||||
kControlScrollBarLiveProc = 386
|
||||
kControlKindScrollBar = FOUR_CHAR_CODE('sbar')
|
||||
kControlScrollBarShowsArrowsTag = FOUR_CHAR_CODE('arro')
|
||||
kControlPopupButtonProc = 400
|
||||
kControlPopupFixedWidthVariant = 1 << 0
|
||||
kControlPopupVariableWidthVariant = 1 << 1
|
||||
kControlPopupUseAddResMenuVariant = 1 << 2
|
||||
kControlPopupUseWFontVariant = kControlUsesOwningWindowsFontVariant
|
||||
kControlKindPopupButton = FOUR_CHAR_CODE('popb')
|
||||
kControlPopupButtonMenuHandleTag = FOUR_CHAR_CODE('mhan')
|
||||
kControlPopupButtonMenuRefTag = FOUR_CHAR_CODE('mhan')
|
||||
kControlPopupButtonMenuIDTag = FOUR_CHAR_CODE('mnid')
|
||||
kControlPopupButtonExtraHeightTag = FOUR_CHAR_CODE('exht')
|
||||
kControlPopupButtonOwnedMenuRefTag = FOUR_CHAR_CODE('omrf')
|
||||
kControlPopupButtonCheckCurrentTag = FOUR_CHAR_CODE('chck')
|
||||
kControlRadioGroupProc = 416
|
||||
kControlKindRadioGroup = FOUR_CHAR_CODE('rgrp')
|
||||
kControlScrollTextBoxProc = 432
|
||||
kControlScrollTextBoxAutoScrollProc = 433
|
||||
kControlKindScrollingTextBox = FOUR_CHAR_CODE('stbx')
|
||||
kControlScrollTextBoxDelayBeforeAutoScrollTag = FOUR_CHAR_CODE('stdl')
|
||||
kControlScrollTextBoxDelayBetweenAutoScrollTag = FOUR_CHAR_CODE('scdl')
|
||||
kControlScrollTextBoxAutoScrollAmountTag = FOUR_CHAR_CODE('samt')
|
||||
kControlScrollTextBoxContentsTag = FOUR_CHAR_CODE('tres')
|
||||
kControlScrollTextBoxAnimatingTag = FOUR_CHAR_CODE('anim')
|
||||
kControlKindDisclosureButton = FOUR_CHAR_CODE('disb')
|
||||
kControlDisclosureButtonClosed = 0
|
||||
kControlDisclosureButtonDisclosed = 1
|
||||
kControlRoundButtonNormalSize = kControlSizeNormal
|
||||
kControlRoundButtonLargeSize = kControlSizeLarge
|
||||
kControlRoundButtonContentTag = FOUR_CHAR_CODE('cont')
|
||||
kControlRoundButtonSizeTag = kControlSizeTag
|
||||
kControlKindRoundButton = FOUR_CHAR_CODE('rndb')
|
||||
kControlKindDataBrowser = FOUR_CHAR_CODE('datb')
|
||||
errDataBrowserNotConfigured = -4970
|
||||
errDataBrowserItemNotFound = -4971
|
||||
errDataBrowserItemNotAdded = -4975
|
||||
errDataBrowserPropertyNotFound = -4972
|
||||
errDataBrowserInvalidPropertyPart = -4973
|
||||
errDataBrowserInvalidPropertyData = -4974
|
||||
errDataBrowserPropertyNotSupported = -4979
|
||||
kControlDataBrowserIncludesFrameAndFocusTag = FOUR_CHAR_CODE('brdr')
|
||||
kControlDataBrowserKeyFilterTag = kControlEditTextKeyFilterTag
|
||||
kControlDataBrowserEditTextKeyFilterTag = kControlDataBrowserKeyFilterTag
|
||||
kControlDataBrowserEditTextValidationProcTag = kControlEditTextValidationProcTag
|
||||
kDataBrowserNoView = 0x3F3F3F3F
|
||||
kDataBrowserListView = FOUR_CHAR_CODE('lstv')
|
||||
kDataBrowserColumnView = FOUR_CHAR_CODE('clmv')
|
||||
kDataBrowserDragSelect = 1 << 0
|
||||
kDataBrowserSelectOnlyOne = 1 << 1
|
||||
kDataBrowserResetSelection = 1 << 2
|
||||
kDataBrowserCmdTogglesSelection = 1 << 3
|
||||
kDataBrowserNoDisjointSelection = 1 << 4
|
||||
kDataBrowserAlwaysExtendSelection = 1 << 5
|
||||
kDataBrowserNeverEmptySelectionSet = 1 << 6
|
||||
kDataBrowserOrderUndefined = 0
|
||||
kDataBrowserOrderIncreasing = 1
|
||||
kDataBrowserOrderDecreasing = 2
|
||||
kDataBrowserNoItem = 0L
|
||||
kDataBrowserItemNoState = 0
|
||||
# kDataBrowserItemAnyState = (unsigned long)(-1)
|
||||
kDataBrowserItemIsSelected = 1 << 0
|
||||
kDataBrowserContainerIsOpen = 1 << 1
|
||||
kDataBrowserItemIsDragTarget = 1 << 2
|
||||
kDataBrowserRevealOnly = 0
|
||||
kDataBrowserRevealAndCenterInView = 1 << 0
|
||||
kDataBrowserRevealWithoutSelecting = 1 << 1
|
||||
kDataBrowserItemsAdd = 0
|
||||
kDataBrowserItemsAssign = 1
|
||||
kDataBrowserItemsToggle = 2
|
||||
kDataBrowserItemsRemove = 3
|
||||
kDataBrowserSelectionAnchorUp = 0
|
||||
kDataBrowserSelectionAnchorDown = 1
|
||||
kDataBrowserSelectionAnchorLeft = 2
|
||||
kDataBrowserSelectionAnchorRight = 3
|
||||
kDataBrowserEditMsgUndo = kHICommandUndo
|
||||
kDataBrowserEditMsgRedo = kHICommandRedo
|
||||
kDataBrowserEditMsgCut = kHICommandCut
|
||||
kDataBrowserEditMsgCopy = kHICommandCopy
|
||||
kDataBrowserEditMsgPaste = kHICommandPaste
|
||||
kDataBrowserEditMsgClear = kHICommandClear
|
||||
kDataBrowserEditMsgSelectAll = kHICommandSelectAll
|
||||
kDataBrowserItemAdded = 1
|
||||
kDataBrowserItemRemoved = 2
|
||||
kDataBrowserEditStarted = 3
|
||||
kDataBrowserEditStopped = 4
|
||||
kDataBrowserItemSelected = 5
|
||||
kDataBrowserItemDeselected = 6
|
||||
kDataBrowserItemDoubleClicked = 7
|
||||
kDataBrowserContainerOpened = 8
|
||||
kDataBrowserContainerClosing = 9
|
||||
kDataBrowserContainerClosed = 10
|
||||
kDataBrowserContainerSorting = 11
|
||||
kDataBrowserContainerSorted = 12
|
||||
kDataBrowserUserToggledContainer = 16
|
||||
kDataBrowserTargetChanged = 15
|
||||
kDataBrowserUserStateChanged = 13
|
||||
kDataBrowserSelectionSetChanged = 14
|
||||
kDataBrowserItemNoProperty = 0L
|
||||
kDataBrowserItemIsActiveProperty = 1L
|
||||
kDataBrowserItemIsSelectableProperty = 2L
|
||||
kDataBrowserItemIsEditableProperty = 3L
|
||||
kDataBrowserItemIsContainerProperty = 4L
|
||||
kDataBrowserContainerIsOpenableProperty = 5L
|
||||
kDataBrowserContainerIsClosableProperty = 6L
|
||||
kDataBrowserContainerIsSortableProperty = 7L
|
||||
kDataBrowserItemSelfIdentityProperty = 8L
|
||||
kDataBrowserContainerAliasIDProperty = 9L
|
||||
kDataBrowserColumnViewPreviewProperty = 10L
|
||||
kDataBrowserItemParentContainerProperty = 11L
|
||||
kDataBrowserCustomType = 0x3F3F3F3F
|
||||
kDataBrowserIconType = FOUR_CHAR_CODE('icnr')
|
||||
kDataBrowserTextType = FOUR_CHAR_CODE('text')
|
||||
kDataBrowserDateTimeType = FOUR_CHAR_CODE('date')
|
||||
kDataBrowserSliderType = FOUR_CHAR_CODE('sldr')
|
||||
kDataBrowserCheckboxType = FOUR_CHAR_CODE('chbx')
|
||||
kDataBrowserProgressBarType = FOUR_CHAR_CODE('prog')
|
||||
kDataBrowserRelevanceRankType = FOUR_CHAR_CODE('rank')
|
||||
kDataBrowserPopupMenuType = FOUR_CHAR_CODE('menu')
|
||||
kDataBrowserIconAndTextType = FOUR_CHAR_CODE('ticn')
|
||||
kDataBrowserPropertyEnclosingPart = 0L
|
||||
kDataBrowserPropertyContentPart = FOUR_CHAR_CODE('----')
|
||||
kDataBrowserPropertyDisclosurePart = FOUR_CHAR_CODE('disc')
|
||||
kDataBrowserPropertyTextPart = kDataBrowserTextType
|
||||
kDataBrowserPropertyIconPart = kDataBrowserIconType
|
||||
kDataBrowserPropertySliderPart = kDataBrowserSliderType
|
||||
kDataBrowserPropertyCheckboxPart = kDataBrowserCheckboxType
|
||||
kDataBrowserPropertyProgressBarPart = kDataBrowserProgressBarType
|
||||
kDataBrowserPropertyRelevanceRankPart = kDataBrowserRelevanceRankType
|
||||
kDataBrowserUniversalPropertyFlagsMask = 0xFF
|
||||
kDataBrowserPropertyIsMutable = 1 << 0
|
||||
kDataBrowserDefaultPropertyFlags = 0 << 0
|
||||
kDataBrowserUniversalPropertyFlags = kDataBrowserUniversalPropertyFlagsMask
|
||||
kDataBrowserPropertyIsEditable = kDataBrowserPropertyIsMutable
|
||||
kDataBrowserPropertyFlagsOffset = 8
|
||||
kDataBrowserPropertyFlagsMask = 0xFF << kDataBrowserPropertyFlagsOffset
|
||||
kDataBrowserCheckboxTriState = 1 << kDataBrowserPropertyFlagsOffset
|
||||
kDataBrowserDateTimeRelative = 1 << (kDataBrowserPropertyFlagsOffset)
|
||||
kDataBrowserDateTimeDateOnly = 1 << (kDataBrowserPropertyFlagsOffset + 1)
|
||||
kDataBrowserDateTimeTimeOnly = 1 << (kDataBrowserPropertyFlagsOffset + 2)
|
||||
kDataBrowserDateTimeSecondsToo = 1 << (kDataBrowserPropertyFlagsOffset + 3)
|
||||
kDataBrowserSliderPlainThumb = kThemeThumbPlain << kDataBrowserPropertyFlagsOffset
|
||||
kDataBrowserSliderUpwardThumb = kThemeThumbUpward << kDataBrowserPropertyFlagsOffset
|
||||
kDataBrowserSliderDownwardThumb = kThemeThumbDownward << kDataBrowserPropertyFlagsOffset
|
||||
kDataBrowserDoNotTruncateText = 3 << kDataBrowserPropertyFlagsOffset
|
||||
kDataBrowserTruncateTextAtEnd = 2 << kDataBrowserPropertyFlagsOffset
|
||||
kDataBrowserTruncateTextMiddle = 0 << kDataBrowserPropertyFlagsOffset
|
||||
kDataBrowserTruncateTextAtStart = 1 << kDataBrowserPropertyFlagsOffset
|
||||
kDataBrowserPropertyModificationFlags = kDataBrowserPropertyFlagsMask
|
||||
kDataBrowserRelativeDateTime = kDataBrowserDateTimeRelative
|
||||
kDataBrowserViewSpecificFlagsOffset = 16
|
||||
kDataBrowserViewSpecificFlagsMask = 0xFF << kDataBrowserViewSpecificFlagsOffset
|
||||
kDataBrowserViewSpecificPropertyFlags = kDataBrowserViewSpecificFlagsMask
|
||||
kDataBrowserClientPropertyFlagsOffset = 24
|
||||
# kDataBrowserClientPropertyFlagsMask = (unsigned long)(0xFF << kDataBrowserClientPropertyFlagsOffset)
|
||||
kDataBrowserLatestCallbacks = 0
|
||||
kDataBrowserContentHit = 1
|
||||
kDataBrowserNothingHit = 0
|
||||
kDataBrowserStopTracking = -1
|
||||
kDataBrowserLatestCustomCallbacks = 0
|
||||
kDataBrowserTableViewMinimalHilite = 0
|
||||
kDataBrowserTableViewFillHilite = 1
|
||||
kDataBrowserTableViewSelectionColumn = 1 << kDataBrowserViewSpecificFlagsOffset
|
||||
kDataBrowserTableViewLastColumn = -1
|
||||
kDataBrowserListViewMovableColumn = 1 << (kDataBrowserViewSpecificFlagsOffset + 1)
|
||||
kDataBrowserListViewSortableColumn = 1 << (kDataBrowserViewSpecificFlagsOffset + 2)
|
||||
kDataBrowserListViewSelectionColumn = kDataBrowserTableViewSelectionColumn
|
||||
kDataBrowserListViewDefaultColumnFlags = kDataBrowserListViewMovableColumn + kDataBrowserListViewSortableColumn
|
||||
kDataBrowserListViewLatestHeaderDesc = 0
|
||||
kDataBrowserListViewAppendColumn = kDataBrowserTableViewLastColumn
|
||||
kControlEditUnicodeTextPostUpdateProcTag = FOUR_CHAR_CODE('upup')
|
||||
kControlEditUnicodeTextProc = 912
|
||||
kControlEditUnicodeTextPasswordProc = 914
|
||||
kControlKindEditUnicodeText = FOUR_CHAR_CODE('eutx')
|
||||
kControlCheckboxUncheckedValue = kControlCheckBoxUncheckedValue
|
||||
kControlCheckboxCheckedValue = kControlCheckBoxCheckedValue
|
||||
kControlCheckboxMixedValue = kControlCheckBoxMixedValue
|
||||
inLabel = kControlLabelPart
|
||||
inMenu = kControlMenuPart
|
||||
inTriangle = kControlTrianglePart
|
||||
inButton = kControlButtonPart
|
||||
inCheckBox = kControlCheckBoxPart
|
||||
inUpButton = kControlUpButtonPart
|
||||
inDownButton = kControlDownButtonPart
|
||||
inPageUp = kControlPageUpPart
|
||||
inPageDown = kControlPageDownPart
|
||||
kInLabelControlPart = kControlLabelPart
|
||||
kInMenuControlPart = kControlMenuPart
|
||||
kInTriangleControlPart = kControlTrianglePart
|
||||
kInButtonControlPart = kControlButtonPart
|
||||
kInCheckBoxControlPart = kControlCheckBoxPart
|
||||
kInUpButtonControlPart = kControlUpButtonPart
|
||||
kInDownButtonControlPart = kControlDownButtonPart
|
||||
kInPageUpControlPart = kControlPageUpPart
|
||||
kInPageDownControlPart = kControlPageDownPart
|
||||
28
Darwin/lib/python2.7/plat-mac/Carbon/CoreFoundation.py
Normal file
28
Darwin/lib/python2.7/plat-mac/Carbon/CoreFoundation.py
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
# Generated from 'CFBase.h'
|
||||
|
||||
def FOUR_CHAR_CODE(x): return x
|
||||
kCFCompareLessThan = -1
|
||||
kCFCompareEqualTo = 0
|
||||
kCFCompareGreaterThan = 1
|
||||
kCFNotFound = -1
|
||||
kCFPropertyListImmutable = 0
|
||||
kCFPropertyListMutableContainers = 1
|
||||
kCFPropertyListMutableContainersAndLeaves = 2
|
||||
# kCFStringEncodingInvalidId = (long)0xFFFFFFFF
|
||||
kCFStringEncodingMacRoman = 0
|
||||
kCFStringEncodingWindowsLatin1 = 0x0500
|
||||
kCFStringEncodingISOLatin1 = 0x0201
|
||||
kCFStringEncodingNextStepLatin = 0x0B01
|
||||
kCFStringEncodingASCII = 0x0600
|
||||
kCFStringEncodingUnicode = 0x0100
|
||||
kCFStringEncodingUTF8 = 0x08000100
|
||||
kCFStringEncodingNonLossyASCII = 0x0BFF
|
||||
kCFCompareCaseInsensitive = 1
|
||||
kCFCompareBackwards = 4
|
||||
kCFCompareAnchored = 8
|
||||
kCFCompareNonliteral = 16
|
||||
kCFCompareLocalized = 32
|
||||
kCFCompareNumerically = 64
|
||||
kCFURLPOSIXPathStyle = 0
|
||||
kCFURLHFSPathStyle = 1
|
||||
kCFURLWindowsPathStyle = 2
|
||||
28
Darwin/lib/python2.7/plat-mac/Carbon/CoreGraphics.py
Normal file
28
Darwin/lib/python2.7/plat-mac/Carbon/CoreGraphics.py
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
# Generated from 'CGContext.h'
|
||||
|
||||
def FOUR_CHAR_CODE(x): return x
|
||||
kCGLineJoinMiter = 0
|
||||
kCGLineJoinRound = 1
|
||||
kCGLineJoinBevel = 2
|
||||
kCGLineCapButt = 0
|
||||
kCGLineCapRound = 1
|
||||
kCGLineCapSquare = 2
|
||||
kCGPathFill = 0
|
||||
kCGPathEOFill = 1
|
||||
kCGPathStroke = 2
|
||||
kCGPathFillStroke = 3
|
||||
kCGPathEOFillStroke = 4
|
||||
kCGTextFill = 0
|
||||
kCGTextStroke = 1
|
||||
kCGTextFillStroke = 2
|
||||
kCGTextInvisible = 3
|
||||
kCGTextFillClip = 4
|
||||
kCGTextStrokeClip = 5
|
||||
kCGTextFillStrokeClip = 6
|
||||
kCGTextClip = 7
|
||||
kCGEncodingFontSpecific = 0
|
||||
kCGEncodingMacRoman = 1
|
||||
kCGInterpolationDefault = 0
|
||||
kCGInterpolationNone = 1
|
||||
kCGInterpolationLow = 2
|
||||
kCGInterpolationHigh = 3
|
||||
1
Darwin/lib/python2.7/plat-mac/Carbon/Ctl.py
Normal file
1
Darwin/lib/python2.7/plat-mac/Carbon/Ctl.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
from _Ctl import *
|
||||
79
Darwin/lib/python2.7/plat-mac/Carbon/Dialogs.py
Normal file
79
Darwin/lib/python2.7/plat-mac/Carbon/Dialogs.py
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
# Generated from 'Dialogs.h'
|
||||
|
||||
def FOUR_CHAR_CODE(x): return x
|
||||
kControlDialogItem = 4
|
||||
kButtonDialogItem = kControlDialogItem | 0
|
||||
kCheckBoxDialogItem = kControlDialogItem | 1
|
||||
kRadioButtonDialogItem = kControlDialogItem | 2
|
||||
kResourceControlDialogItem = kControlDialogItem | 3
|
||||
kStaticTextDialogItem = 8
|
||||
kEditTextDialogItem = 16
|
||||
kIconDialogItem = 32
|
||||
kPictureDialogItem = 64
|
||||
kUserDialogItem = 0
|
||||
kHelpDialogItem = 1
|
||||
kItemDisableBit = 128
|
||||
ctrlItem = 4
|
||||
btnCtrl = 0
|
||||
chkCtrl = 1
|
||||
radCtrl = 2
|
||||
resCtrl = 3
|
||||
statText = 8
|
||||
editText = 16
|
||||
iconItem = 32
|
||||
picItem = 64
|
||||
userItem = 0
|
||||
itemDisable = 128
|
||||
kStdOkItemIndex = 1
|
||||
kStdCancelItemIndex = 2
|
||||
ok = kStdOkItemIndex
|
||||
cancel = kStdCancelItemIndex
|
||||
kStopIcon = 0
|
||||
kNoteIcon = 1
|
||||
kCautionIcon = 2
|
||||
stopIcon = kStopIcon
|
||||
noteIcon = kNoteIcon
|
||||
cautionIcon = kCautionIcon
|
||||
kOkItemIndex = 1
|
||||
kCancelItemIndex = 2
|
||||
overlayDITL = 0
|
||||
appendDITLRight = 1
|
||||
appendDITLBottom = 2
|
||||
kAlertStopAlert = 0
|
||||
kAlertNoteAlert = 1
|
||||
kAlertCautionAlert = 2
|
||||
kAlertPlainAlert = 3
|
||||
kAlertDefaultOKText = -1
|
||||
kAlertDefaultCancelText = -1
|
||||
kAlertDefaultOtherText = -1
|
||||
kAlertStdAlertOKButton = 1
|
||||
kAlertStdAlertCancelButton = 2
|
||||
kAlertStdAlertOtherButton = 3
|
||||
kAlertStdAlertHelpButton = 4
|
||||
kDialogFlagsUseThemeBackground = (1 << 0)
|
||||
kDialogFlagsUseControlHierarchy = (1 << 1)
|
||||
kDialogFlagsHandleMovableModal = (1 << 2)
|
||||
kDialogFlagsUseThemeControls = (1 << 3)
|
||||
kAlertFlagsUseThemeBackground = (1 << 0)
|
||||
kAlertFlagsUseControlHierarchy = (1 << 1)
|
||||
kAlertFlagsAlertIsMovable = (1 << 2)
|
||||
kAlertFlagsUseThemeControls = (1 << 3)
|
||||
kDialogFontNoFontStyle = 0
|
||||
kDialogFontUseFontMask = 0x0001
|
||||
kDialogFontUseFaceMask = 0x0002
|
||||
kDialogFontUseSizeMask = 0x0004
|
||||
kDialogFontUseForeColorMask = 0x0008
|
||||
kDialogFontUseBackColorMask = 0x0010
|
||||
kDialogFontUseModeMask = 0x0020
|
||||
kDialogFontUseJustMask = 0x0040
|
||||
kDialogFontUseAllMask = 0x00FF
|
||||
kDialogFontAddFontSizeMask = 0x0100
|
||||
kDialogFontUseFontNameMask = 0x0200
|
||||
kDialogFontAddToMetaFontMask = 0x0400
|
||||
kDialogFontUseThemeFontIDMask = 0x0080
|
||||
kHICommandOther = FOUR_CHAR_CODE('othr')
|
||||
kStdCFStringAlertVersionOne = 1
|
||||
kStdAlertDoNotDisposeSheet = 1 << 0
|
||||
kStdAlertDoNotAnimateOnDefault = 1 << 1
|
||||
kStdAlertDoNotAnimateOnCancel = 1 << 2
|
||||
kStdAlertDoNotAnimateOnOther = 1 << 3
|
||||
1
Darwin/lib/python2.7/plat-mac/Carbon/Dlg.py
Normal file
1
Darwin/lib/python2.7/plat-mac/Carbon/Dlg.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
from _Dlg import *
|
||||
1
Darwin/lib/python2.7/plat-mac/Carbon/Drag.py
Normal file
1
Darwin/lib/python2.7/plat-mac/Carbon/Drag.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
from _Drag import *
|
||||
86
Darwin/lib/python2.7/plat-mac/Carbon/Dragconst.py
Normal file
86
Darwin/lib/python2.7/plat-mac/Carbon/Dragconst.py
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
# Generated from 'Drag.h'
|
||||
|
||||
def FOUR_CHAR_CODE(x): return x
|
||||
from Carbon.TextEdit import *
|
||||
from Carbon.QuickDraw import *
|
||||
fkDragActionAll = -1
|
||||
|
||||
|
||||
kDragHasLeftSenderWindow = (1 << 0)
|
||||
kDragInsideSenderApplication = (1 << 1)
|
||||
kDragInsideSenderWindow = (1 << 2)
|
||||
kDragRegionAndImage = (1 << 4)
|
||||
flavorSenderOnly = (1 << 0)
|
||||
flavorSenderTranslated = (1 << 1)
|
||||
flavorNotSaved = (1 << 2)
|
||||
flavorSystemTranslated = (1 << 8)
|
||||
kDragHasLeftSenderWindow = (1L << 0)
|
||||
kDragInsideSenderApplication = (1L << 1)
|
||||
kDragInsideSenderWindow = (1L << 2)
|
||||
kDragBehaviorNone = 0
|
||||
kDragBehaviorZoomBackAnimation = (1L << 0)
|
||||
kDragRegionAndImage = (1L << 4)
|
||||
kDragStandardTranslucency = 0L
|
||||
kDragDarkTranslucency = 1L
|
||||
kDragDarkerTranslucency = 2L
|
||||
kDragOpaqueTranslucency = 3L
|
||||
kDragRegionBegin = 1
|
||||
kDragRegionDraw = 2
|
||||
kDragRegionHide = 3
|
||||
kDragRegionIdle = 4
|
||||
kDragRegionEnd = 5
|
||||
kZoomNoAcceleration = 0
|
||||
kZoomAccelerate = 1
|
||||
kZoomDecelerate = 2
|
||||
flavorSenderOnly = (1 << 0)
|
||||
flavorSenderTranslated = (1 << 1)
|
||||
flavorNotSaved = (1 << 2)
|
||||
flavorSystemTranslated = (1 << 8)
|
||||
flavorDataPromised = (1 << 9)
|
||||
kDragFlavorTypeHFS = FOUR_CHAR_CODE('hfs ')
|
||||
kDragFlavorTypePromiseHFS = FOUR_CHAR_CODE('phfs')
|
||||
flavorTypeHFS = kDragFlavorTypeHFS
|
||||
flavorTypePromiseHFS = kDragFlavorTypePromiseHFS
|
||||
kDragPromisedFlavorFindFile = FOUR_CHAR_CODE('rWm1')
|
||||
kDragPromisedFlavor = FOUR_CHAR_CODE('fssP')
|
||||
kDragPseudoCreatorVolumeOrDirectory = FOUR_CHAR_CODE('MACS')
|
||||
kDragPseudoFileTypeVolume = FOUR_CHAR_CODE('disk')
|
||||
kDragPseudoFileTypeDirectory = FOUR_CHAR_CODE('fold')
|
||||
flavorTypeDirectory = FOUR_CHAR_CODE('diry')
|
||||
kFlavorTypeClippingName = FOUR_CHAR_CODE('clnm')
|
||||
kFlavorTypeClippingFilename = FOUR_CHAR_CODE('clfn')
|
||||
kFlavorTypeDragToTrashOnly = FOUR_CHAR_CODE('fdtt')
|
||||
kFlavorTypeFinderNoTrackingBehavior = FOUR_CHAR_CODE('fntb')
|
||||
kDragTrackingEnterHandler = 1
|
||||
kDragTrackingEnterWindow = 2
|
||||
kDragTrackingInWindow = 3
|
||||
kDragTrackingLeaveWindow = 4
|
||||
kDragTrackingLeaveHandler = 5
|
||||
kDragActionNothing = 0L
|
||||
kDragActionCopy = 1L
|
||||
kDragActionAlias = (1L << 1)
|
||||
kDragActionGeneric = (1L << 2)
|
||||
kDragActionPrivate = (1L << 3)
|
||||
kDragActionMove = (1L << 4)
|
||||
kDragActionDelete = (1L << 5)
|
||||
# kDragActionAll = (long)0xFFFFFFFF
|
||||
dragHasLeftSenderWindow = kDragHasLeftSenderWindow
|
||||
dragInsideSenderApplication = kDragInsideSenderApplication
|
||||
dragInsideSenderWindow = kDragInsideSenderWindow
|
||||
dragTrackingEnterHandler = kDragTrackingEnterHandler
|
||||
dragTrackingEnterWindow = kDragTrackingEnterWindow
|
||||
dragTrackingInWindow = kDragTrackingInWindow
|
||||
dragTrackingLeaveWindow = kDragTrackingLeaveWindow
|
||||
dragTrackingLeaveHandler = kDragTrackingLeaveHandler
|
||||
dragRegionBegin = kDragRegionBegin
|
||||
dragRegionDraw = kDragRegionDraw
|
||||
dragRegionHide = kDragRegionHide
|
||||
dragRegionIdle = kDragRegionIdle
|
||||
dragRegionEnd = kDragRegionEnd
|
||||
zoomNoAcceleration = kZoomNoAcceleration
|
||||
zoomAccelerate = kZoomAccelerate
|
||||
zoomDecelerate = kZoomDecelerate
|
||||
kDragStandardImage = kDragStandardTranslucency
|
||||
kDragDarkImage = kDragDarkTranslucency
|
||||
kDragDarkerImage = kDragDarkerTranslucency
|
||||
kDragOpaqueImage = kDragOpaqueTranslucency
|
||||
102
Darwin/lib/python2.7/plat-mac/Carbon/Events.py
Normal file
102
Darwin/lib/python2.7/plat-mac/Carbon/Events.py
Normal file
|
|
@ -0,0 +1,102 @@
|
|||
# Generated from 'Events.h'
|
||||
|
||||
nullEvent = 0
|
||||
mouseDown = 1
|
||||
mouseUp = 2
|
||||
keyDown = 3
|
||||
keyUp = 4
|
||||
autoKey = 5
|
||||
updateEvt = 6
|
||||
diskEvt = 7
|
||||
activateEvt = 8
|
||||
osEvt = 15
|
||||
kHighLevelEvent = 23
|
||||
mDownMask = 1 << mouseDown
|
||||
mUpMask = 1 << mouseUp
|
||||
keyDownMask = 1 << keyDown
|
||||
keyUpMask = 1 << keyUp
|
||||
autoKeyMask = 1 << autoKey
|
||||
updateMask = 1 << updateEvt
|
||||
diskMask = 1 << diskEvt
|
||||
activMask = 1 << activateEvt
|
||||
highLevelEventMask = 0x0400
|
||||
osMask = 1 << osEvt
|
||||
everyEvent = 0xFFFF
|
||||
charCodeMask = 0x000000FF
|
||||
keyCodeMask = 0x0000FF00
|
||||
adbAddrMask = 0x00FF0000
|
||||
# osEvtMessageMask = (unsigned long)0xFF000000
|
||||
mouseMovedMessage = 0x00FA
|
||||
suspendResumeMessage = 0x0001
|
||||
resumeFlag = 1
|
||||
convertClipboardFlag = 2
|
||||
activeFlagBit = 0
|
||||
btnStateBit = 7
|
||||
cmdKeyBit = 8
|
||||
shiftKeyBit = 9
|
||||
alphaLockBit = 10
|
||||
optionKeyBit = 11
|
||||
controlKeyBit = 12
|
||||
rightShiftKeyBit = 13
|
||||
rightOptionKeyBit = 14
|
||||
rightControlKeyBit = 15
|
||||
activeFlag = 1 << activeFlagBit
|
||||
btnState = 1 << btnStateBit
|
||||
cmdKey = 1 << cmdKeyBit
|
||||
shiftKey = 1 << shiftKeyBit
|
||||
alphaLock = 1 << alphaLockBit
|
||||
optionKey = 1 << optionKeyBit
|
||||
controlKey = 1 << controlKeyBit
|
||||
rightShiftKey = 1 << rightShiftKeyBit
|
||||
rightOptionKey = 1 << rightOptionKeyBit
|
||||
rightControlKey = 1 << rightControlKeyBit
|
||||
kNullCharCode = 0
|
||||
kHomeCharCode = 1
|
||||
kEnterCharCode = 3
|
||||
kEndCharCode = 4
|
||||
kHelpCharCode = 5
|
||||
kBellCharCode = 7
|
||||
kBackspaceCharCode = 8
|
||||
kTabCharCode = 9
|
||||
kLineFeedCharCode = 10
|
||||
kVerticalTabCharCode = 11
|
||||
kPageUpCharCode = 11
|
||||
kFormFeedCharCode = 12
|
||||
kPageDownCharCode = 12
|
||||
kReturnCharCode = 13
|
||||
kFunctionKeyCharCode = 16
|
||||
kCommandCharCode = 17
|
||||
kCheckCharCode = 18
|
||||
kDiamondCharCode = 19
|
||||
kAppleLogoCharCode = 20
|
||||
kEscapeCharCode = 27
|
||||
kClearCharCode = 27
|
||||
kLeftArrowCharCode = 28
|
||||
kRightArrowCharCode = 29
|
||||
kUpArrowCharCode = 30
|
||||
kDownArrowCharCode = 31
|
||||
kSpaceCharCode = 32
|
||||
kDeleteCharCode = 127
|
||||
kBulletCharCode = 165
|
||||
kNonBreakingSpaceCharCode = 202
|
||||
kShiftUnicode = 0x21E7
|
||||
kControlUnicode = 0x2303
|
||||
kOptionUnicode = 0x2325
|
||||
kCommandUnicode = 0x2318
|
||||
kPencilUnicode = 0x270E
|
||||
kCheckUnicode = 0x2713
|
||||
kDiamondUnicode = 0x25C6
|
||||
kBulletUnicode = 0x2022
|
||||
kAppleLogoUnicode = 0xF8FF
|
||||
networkEvt = 10
|
||||
driverEvt = 11
|
||||
app1Evt = 12
|
||||
app2Evt = 13
|
||||
app3Evt = 14
|
||||
app4Evt = 15
|
||||
networkMask = 0x0400
|
||||
driverMask = 0x0800
|
||||
app1Mask = 0x1000
|
||||
app2Mask = 0x2000
|
||||
app3Mask = 0x4000
|
||||
app4Mask = 0x8000
|
||||
1
Darwin/lib/python2.7/plat-mac/Carbon/Evt.py
Normal file
1
Darwin/lib/python2.7/plat-mac/Carbon/Evt.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
from _Evt import *
|
||||
1
Darwin/lib/python2.7/plat-mac/Carbon/File.py
Normal file
1
Darwin/lib/python2.7/plat-mac/Carbon/File.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
from _File import *
|
||||
426
Darwin/lib/python2.7/plat-mac/Carbon/Files.py
Normal file
426
Darwin/lib/python2.7/plat-mac/Carbon/Files.py
Normal file
|
|
@ -0,0 +1,426 @@
|
|||
# Generated from 'Files.h'
|
||||
|
||||
def FOUR_CHAR_CODE(x): return x
|
||||
true = True
|
||||
false = False
|
||||
fsCurPerm = 0x00
|
||||
fsRdPerm = 0x01
|
||||
fsWrPerm = 0x02
|
||||
fsRdWrPerm = 0x03
|
||||
fsRdWrShPerm = 0x04
|
||||
fsRdDenyPerm = 0x10
|
||||
fsWrDenyPerm = 0x20
|
||||
fsRtParID = 1
|
||||
fsRtDirID = 2
|
||||
fsAtMark = 0
|
||||
fsFromStart = 1
|
||||
fsFromLEOF = 2
|
||||
fsFromMark = 3
|
||||
pleaseCacheBit = 4
|
||||
pleaseCacheMask = 0x0010
|
||||
noCacheBit = 5
|
||||
noCacheMask = 0x0020
|
||||
rdVerifyBit = 6
|
||||
rdVerifyMask = 0x0040
|
||||
rdVerify = 64
|
||||
forceReadBit = 6
|
||||
forceReadMask = 0x0040
|
||||
newLineBit = 7
|
||||
newLineMask = 0x0080
|
||||
newLineCharMask = 0xFF00
|
||||
fsSBPartialName = 1
|
||||
fsSBFullName = 2
|
||||
fsSBFlAttrib = 4
|
||||
fsSBFlFndrInfo = 8
|
||||
fsSBFlLgLen = 32
|
||||
fsSBFlPyLen = 64
|
||||
fsSBFlRLgLen = 128
|
||||
fsSBFlRPyLen = 256
|
||||
fsSBFlCrDat = 512
|
||||
fsSBFlMdDat = 1024
|
||||
fsSBFlBkDat = 2048
|
||||
fsSBFlXFndrInfo = 4096
|
||||
fsSBFlParID = 8192
|
||||
fsSBNegate = 16384
|
||||
fsSBDrUsrWds = 8
|
||||
fsSBDrNmFls = 16
|
||||
fsSBDrCrDat = 512
|
||||
fsSBDrMdDat = 1024
|
||||
fsSBDrBkDat = 2048
|
||||
fsSBDrFndrInfo = 4096
|
||||
fsSBDrParID = 8192
|
||||
fsSBPartialNameBit = 0
|
||||
fsSBFullNameBit = 1
|
||||
fsSBFlAttribBit = 2
|
||||
fsSBFlFndrInfoBit = 3
|
||||
fsSBFlLgLenBit = 5
|
||||
fsSBFlPyLenBit = 6
|
||||
fsSBFlRLgLenBit = 7
|
||||
fsSBFlRPyLenBit = 8
|
||||
fsSBFlCrDatBit = 9
|
||||
fsSBFlMdDatBit = 10
|
||||
fsSBFlBkDatBit = 11
|
||||
fsSBFlXFndrInfoBit = 12
|
||||
fsSBFlParIDBit = 13
|
||||
fsSBNegateBit = 14
|
||||
fsSBDrUsrWdsBit = 3
|
||||
fsSBDrNmFlsBit = 4
|
||||
fsSBDrCrDatBit = 9
|
||||
fsSBDrMdDatBit = 10
|
||||
fsSBDrBkDatBit = 11
|
||||
fsSBDrFndrInfoBit = 12
|
||||
fsSBDrParIDBit = 13
|
||||
bLimitFCBs = 31
|
||||
bLocalWList = 30
|
||||
bNoMiniFndr = 29
|
||||
bNoVNEdit = 28
|
||||
bNoLclSync = 27
|
||||
bTrshOffLine = 26
|
||||
bNoSwitchTo = 25
|
||||
bDontShareIt = 21
|
||||
bNoDeskItems = 20
|
||||
bNoBootBlks = 19
|
||||
bAccessCntl = 18
|
||||
bNoSysDir = 17
|
||||
bHasExtFSVol = 16
|
||||
bHasOpenDeny = 15
|
||||
bHasCopyFile = 14
|
||||
bHasMoveRename = 13
|
||||
bHasDesktopMgr = 12
|
||||
bHasShortName = 11
|
||||
bHasFolderLock = 10
|
||||
bHasPersonalAccessPrivileges = 9
|
||||
bHasUserGroupList = 8
|
||||
bHasCatSearch = 7
|
||||
bHasFileIDs = 6
|
||||
bHasBTreeMgr = 5
|
||||
bHasBlankAccessPrivileges = 4
|
||||
bSupportsAsyncRequests = 3
|
||||
bSupportsTrashVolumeCache = 2
|
||||
bIsEjectable = 0
|
||||
bSupportsHFSPlusAPIs = 1
|
||||
bSupportsFSCatalogSearch = 2
|
||||
bSupportsFSExchangeObjects = 3
|
||||
bSupports2TBFiles = 4
|
||||
bSupportsLongNames = 5
|
||||
bSupportsMultiScriptNames = 6
|
||||
bSupportsNamedForks = 7
|
||||
bSupportsSubtreeIterators = 8
|
||||
bL2PCanMapFileBlocks = 9
|
||||
bParentModDateChanges = 10
|
||||
bAncestorModDateChanges = 11
|
||||
bSupportsSymbolicLinks = 13
|
||||
bIsAutoMounted = 14
|
||||
bAllowCDiDataHandler = 17
|
||||
kLargeIcon = 1
|
||||
kLarge4BitIcon = 2
|
||||
kLarge8BitIcon = 3
|
||||
kSmallIcon = 4
|
||||
kSmall4BitIcon = 5
|
||||
kSmall8BitIcon = 6
|
||||
kicnsIconFamily = 239
|
||||
kLargeIconSize = 256
|
||||
kLarge4BitIconSize = 512
|
||||
kLarge8BitIconSize = 1024
|
||||
kSmallIconSize = 64
|
||||
kSmall4BitIconSize = 128
|
||||
kSmall8BitIconSize = 256
|
||||
kWidePosOffsetBit = 8
|
||||
kUseWidePositioning = (1 << kWidePosOffsetBit)
|
||||
kMaximumBlocksIn4GB = 0x007FFFFF
|
||||
fsUnixPriv = 1
|
||||
kNoUserAuthentication = 1
|
||||
kPassword = 2
|
||||
kEncryptPassword = 3
|
||||
kTwoWayEncryptPassword = 6
|
||||
kOwnerID2Name = 1
|
||||
kGroupID2Name = 2
|
||||
kOwnerName2ID = 3
|
||||
kGroupName2ID = 4
|
||||
kReturnNextUser = 1
|
||||
kReturnNextGroup = 2
|
||||
kReturnNextUG = 3
|
||||
kVCBFlagsIdleFlushBit = 3
|
||||
kVCBFlagsIdleFlushMask = 0x0008
|
||||
kVCBFlagsHFSPlusAPIsBit = 4
|
||||
kVCBFlagsHFSPlusAPIsMask = 0x0010
|
||||
kVCBFlagsHardwareGoneBit = 5
|
||||
kVCBFlagsHardwareGoneMask = 0x0020
|
||||
kVCBFlagsVolumeDirtyBit = 15
|
||||
kVCBFlagsVolumeDirtyMask = 0x8000
|
||||
kioVAtrbDefaultVolumeBit = 5
|
||||
kioVAtrbDefaultVolumeMask = 0x0020
|
||||
kioVAtrbFilesOpenBit = 6
|
||||
kioVAtrbFilesOpenMask = 0x0040
|
||||
kioVAtrbHardwareLockedBit = 7
|
||||
kioVAtrbHardwareLockedMask = 0x0080
|
||||
kioVAtrbSoftwareLockedBit = 15
|
||||
kioVAtrbSoftwareLockedMask = 0x8000
|
||||
kioFlAttribLockedBit = 0
|
||||
kioFlAttribLockedMask = 0x01
|
||||
kioFlAttribResOpenBit = 2
|
||||
kioFlAttribResOpenMask = 0x04
|
||||
kioFlAttribDataOpenBit = 3
|
||||
kioFlAttribDataOpenMask = 0x08
|
||||
kioFlAttribDirBit = 4
|
||||
kioFlAttribDirMask = 0x10
|
||||
ioDirFlg = 4
|
||||
ioDirMask = 0x10
|
||||
kioFlAttribCopyProtBit = 6
|
||||
kioFlAttribCopyProtMask = 0x40
|
||||
kioFlAttribFileOpenBit = 7
|
||||
kioFlAttribFileOpenMask = 0x80
|
||||
kioFlAttribInSharedBit = 2
|
||||
kioFlAttribInSharedMask = 0x04
|
||||
kioFlAttribMountedBit = 3
|
||||
kioFlAttribMountedMask = 0x08
|
||||
kioFlAttribSharePointBit = 5
|
||||
kioFlAttribSharePointMask = 0x20
|
||||
kioFCBWriteBit = 8
|
||||
kioFCBWriteMask = 0x0100
|
||||
kioFCBResourceBit = 9
|
||||
kioFCBResourceMask = 0x0200
|
||||
kioFCBWriteLockedBit = 10
|
||||
kioFCBWriteLockedMask = 0x0400
|
||||
kioFCBLargeFileBit = 11
|
||||
kioFCBLargeFileMask = 0x0800
|
||||
kioFCBSharedWriteBit = 12
|
||||
kioFCBSharedWriteMask = 0x1000
|
||||
kioFCBFileLockedBit = 13
|
||||
kioFCBFileLockedMask = 0x2000
|
||||
kioFCBOwnClumpBit = 14
|
||||
kioFCBOwnClumpMask = 0x4000
|
||||
kioFCBModifiedBit = 15
|
||||
kioFCBModifiedMask = 0x8000
|
||||
kioACUserNoSeeFolderBit = 0
|
||||
kioACUserNoSeeFolderMask = 0x01
|
||||
kioACUserNoSeeFilesBit = 1
|
||||
kioACUserNoSeeFilesMask = 0x02
|
||||
kioACUserNoMakeChangesBit = 2
|
||||
kioACUserNoMakeChangesMask = 0x04
|
||||
kioACUserNotOwnerBit = 7
|
||||
kioACUserNotOwnerMask = 0x80
|
||||
kioACAccessOwnerBit = 31
|
||||
# kioACAccessOwnerMask = (long)0x80000000
|
||||
kioACAccessBlankAccessBit = 28
|
||||
kioACAccessBlankAccessMask = 0x10000000
|
||||
kioACAccessUserWriteBit = 26
|
||||
kioACAccessUserWriteMask = 0x04000000
|
||||
kioACAccessUserReadBit = 25
|
||||
kioACAccessUserReadMask = 0x02000000
|
||||
kioACAccessUserSearchBit = 24
|
||||
kioACAccessUserSearchMask = 0x01000000
|
||||
kioACAccessEveryoneWriteBit = 18
|
||||
kioACAccessEveryoneWriteMask = 0x00040000
|
||||
kioACAccessEveryoneReadBit = 17
|
||||
kioACAccessEveryoneReadMask = 0x00020000
|
||||
kioACAccessEveryoneSearchBit = 16
|
||||
kioACAccessEveryoneSearchMask = 0x00010000
|
||||
kioACAccessGroupWriteBit = 10
|
||||
kioACAccessGroupWriteMask = 0x00000400
|
||||
kioACAccessGroupReadBit = 9
|
||||
kioACAccessGroupReadMask = 0x00000200
|
||||
kioACAccessGroupSearchBit = 8
|
||||
kioACAccessGroupSearchMask = 0x00000100
|
||||
kioACAccessOwnerWriteBit = 2
|
||||
kioACAccessOwnerWriteMask = 0x00000004
|
||||
kioACAccessOwnerReadBit = 1
|
||||
kioACAccessOwnerReadMask = 0x00000002
|
||||
kioACAccessOwnerSearchBit = 0
|
||||
kioACAccessOwnerSearchMask = 0x00000001
|
||||
kfullPrivileges = 0x00070007
|
||||
kownerPrivileges = 0x00000007
|
||||
knoUser = 0
|
||||
kadministratorUser = 1
|
||||
knoGroup = 0
|
||||
AppleShareMediaType = FOUR_CHAR_CODE('afpm')
|
||||
volMountNoLoginMsgFlagBit = 0
|
||||
volMountNoLoginMsgFlagMask = 0x0001
|
||||
volMountExtendedFlagsBit = 7
|
||||
volMountExtendedFlagsMask = 0x0080
|
||||
volMountInteractBit = 15
|
||||
volMountInteractMask = 0x8000
|
||||
volMountChangedBit = 14
|
||||
volMountChangedMask = 0x4000
|
||||
volMountFSReservedMask = 0x00FF
|
||||
volMountSysReservedMask = 0xFF00
|
||||
kAFPExtendedFlagsAlternateAddressMask = 1
|
||||
kAFPTagTypeIP = 0x01
|
||||
kAFPTagTypeIPPort = 0x02
|
||||
kAFPTagTypeDDP = 0x03
|
||||
kAFPTagTypeDNS = 0x04
|
||||
kAFPTagLengthIP = 0x06
|
||||
kAFPTagLengthIPPort = 0x08
|
||||
kAFPTagLengthDDP = 0x06
|
||||
kFSInvalidVolumeRefNum = 0
|
||||
kFSCatInfoNone = 0x00000000
|
||||
kFSCatInfoTextEncoding = 0x00000001
|
||||
kFSCatInfoNodeFlags = 0x00000002
|
||||
kFSCatInfoVolume = 0x00000004
|
||||
kFSCatInfoParentDirID = 0x00000008
|
||||
kFSCatInfoNodeID = 0x00000010
|
||||
kFSCatInfoCreateDate = 0x00000020
|
||||
kFSCatInfoContentMod = 0x00000040
|
||||
kFSCatInfoAttrMod = 0x00000080
|
||||
kFSCatInfoAccessDate = 0x00000100
|
||||
kFSCatInfoBackupDate = 0x00000200
|
||||
kFSCatInfoPermissions = 0x00000400
|
||||
kFSCatInfoFinderInfo = 0x00000800
|
||||
kFSCatInfoFinderXInfo = 0x00001000
|
||||
kFSCatInfoValence = 0x00002000
|
||||
kFSCatInfoDataSizes = 0x00004000
|
||||
kFSCatInfoRsrcSizes = 0x00008000
|
||||
kFSCatInfoSharingFlags = 0x00010000
|
||||
kFSCatInfoUserPrivs = 0x00020000
|
||||
kFSCatInfoUserAccess = 0x00080000
|
||||
kFSCatInfoAllDates = 0x000003E0
|
||||
kFSCatInfoGettableInfo = 0x0003FFFF
|
||||
kFSCatInfoSettableInfo = 0x00001FE3
|
||||
# kFSCatInfoReserved = (long)0xFFFC0000
|
||||
kFSNodeLockedBit = 0
|
||||
kFSNodeLockedMask = 0x0001
|
||||
kFSNodeResOpenBit = 2
|
||||
kFSNodeResOpenMask = 0x0004
|
||||
kFSNodeDataOpenBit = 3
|
||||
kFSNodeDataOpenMask = 0x0008
|
||||
kFSNodeIsDirectoryBit = 4
|
||||
kFSNodeIsDirectoryMask = 0x0010
|
||||
kFSNodeCopyProtectBit = 6
|
||||
kFSNodeCopyProtectMask = 0x0040
|
||||
kFSNodeForkOpenBit = 7
|
||||
kFSNodeForkOpenMask = 0x0080
|
||||
kFSNodeInSharedBit = 2
|
||||
kFSNodeInSharedMask = 0x0004
|
||||
kFSNodeIsMountedBit = 3
|
||||
kFSNodeIsMountedMask = 0x0008
|
||||
kFSNodeIsSharePointBit = 5
|
||||
kFSNodeIsSharePointMask = 0x0020
|
||||
kFSIterateFlat = 0
|
||||
kFSIterateSubtree = 1
|
||||
kFSIterateDelete = 2
|
||||
# kFSIterateReserved = (long)0xFFFFFFFC
|
||||
fsSBNodeID = 0x00008000
|
||||
fsSBAttributeModDate = 0x00010000
|
||||
fsSBAccessDate = 0x00020000
|
||||
fsSBPermissions = 0x00040000
|
||||
fsSBNodeIDBit = 15
|
||||
fsSBAttributeModDateBit = 16
|
||||
fsSBAccessDateBit = 17
|
||||
fsSBPermissionsBit = 18
|
||||
kFSAllocDefaultFlags = 0x0000
|
||||
kFSAllocAllOrNothingMask = 0x0001
|
||||
kFSAllocContiguousMask = 0x0002
|
||||
kFSAllocNoRoundUpMask = 0x0004
|
||||
kFSAllocReservedMask = 0xFFF8
|
||||
kFSVolInfoNone = 0x0000
|
||||
kFSVolInfoCreateDate = 0x0001
|
||||
kFSVolInfoModDate = 0x0002
|
||||
kFSVolInfoBackupDate = 0x0004
|
||||
kFSVolInfoCheckedDate = 0x0008
|
||||
kFSVolInfoFileCount = 0x0010
|
||||
kFSVolInfoDirCount = 0x0020
|
||||
kFSVolInfoSizes = 0x0040
|
||||
kFSVolInfoBlocks = 0x0080
|
||||
kFSVolInfoNextAlloc = 0x0100
|
||||
kFSVolInfoRsrcClump = 0x0200
|
||||
kFSVolInfoDataClump = 0x0400
|
||||
kFSVolInfoNextID = 0x0800
|
||||
kFSVolInfoFinderInfo = 0x1000
|
||||
kFSVolInfoFlags = 0x2000
|
||||
kFSVolInfoFSInfo = 0x4000
|
||||
kFSVolInfoDriveInfo = 0x8000
|
||||
kFSVolInfoGettableInfo = 0xFFFF
|
||||
kFSVolInfoSettableInfo = 0x3004
|
||||
kFSVolFlagDefaultVolumeBit = 5
|
||||
kFSVolFlagDefaultVolumeMask = 0x0020
|
||||
kFSVolFlagFilesOpenBit = 6
|
||||
kFSVolFlagFilesOpenMask = 0x0040
|
||||
kFSVolFlagHardwareLockedBit = 7
|
||||
kFSVolFlagHardwareLockedMask = 0x0080
|
||||
kFSVolFlagSoftwareLockedBit = 15
|
||||
kFSVolFlagSoftwareLockedMask = 0x8000
|
||||
kFNDirectoryModifiedMessage = 1
|
||||
kFNNoImplicitAllSubscription = (1 << 0)
|
||||
rAliasType = FOUR_CHAR_CODE('alis')
|
||||
kARMMountVol = 0x00000001
|
||||
kARMNoUI = 0x00000002
|
||||
kARMMultVols = 0x00000008
|
||||
kARMSearch = 0x00000100
|
||||
kARMSearchMore = 0x00000200
|
||||
kARMSearchRelFirst = 0x00000400
|
||||
asiZoneName = -3
|
||||
asiServerName = -2
|
||||
asiVolumeName = -1
|
||||
asiAliasName = 0
|
||||
asiParentName = 1
|
||||
kResolveAliasFileNoUI = 0x00000001
|
||||
kClippingCreator = FOUR_CHAR_CODE('drag')
|
||||
kClippingPictureType = FOUR_CHAR_CODE('clpp')
|
||||
kClippingTextType = FOUR_CHAR_CODE('clpt')
|
||||
kClippingSoundType = FOUR_CHAR_CODE('clps')
|
||||
kClippingUnknownType = FOUR_CHAR_CODE('clpu')
|
||||
kInternetLocationCreator = FOUR_CHAR_CODE('drag')
|
||||
kInternetLocationHTTP = FOUR_CHAR_CODE('ilht')
|
||||
kInternetLocationFTP = FOUR_CHAR_CODE('ilft')
|
||||
kInternetLocationFile = FOUR_CHAR_CODE('ilfi')
|
||||
kInternetLocationMail = FOUR_CHAR_CODE('ilma')
|
||||
kInternetLocationNNTP = FOUR_CHAR_CODE('ilnw')
|
||||
kInternetLocationAFP = FOUR_CHAR_CODE('ilaf')
|
||||
kInternetLocationAppleTalk = FOUR_CHAR_CODE('ilat')
|
||||
kInternetLocationNSL = FOUR_CHAR_CODE('ilns')
|
||||
kInternetLocationGeneric = FOUR_CHAR_CODE('ilge')
|
||||
kCustomIconResource = -16455
|
||||
kCustomBadgeResourceType = FOUR_CHAR_CODE('badg')
|
||||
kCustomBadgeResourceID = kCustomIconResource
|
||||
kCustomBadgeResourceVersion = 0
|
||||
# kSystemFolderType = 'macs'.
|
||||
kRoutingResourceType = FOUR_CHAR_CODE('rout')
|
||||
kRoutingResourceID = 0
|
||||
kContainerFolderAliasType = FOUR_CHAR_CODE('fdrp')
|
||||
kContainerTrashAliasType = FOUR_CHAR_CODE('trsh')
|
||||
kContainerHardDiskAliasType = FOUR_CHAR_CODE('hdsk')
|
||||
kContainerFloppyAliasType = FOUR_CHAR_CODE('flpy')
|
||||
kContainerServerAliasType = FOUR_CHAR_CODE('srvr')
|
||||
kApplicationAliasType = FOUR_CHAR_CODE('adrp')
|
||||
kContainerAliasType = FOUR_CHAR_CODE('drop')
|
||||
kDesktopPrinterAliasType = FOUR_CHAR_CODE('dtpa')
|
||||
kContainerCDROMAliasType = FOUR_CHAR_CODE('cddr')
|
||||
kApplicationCPAliasType = FOUR_CHAR_CODE('acdp')
|
||||
kApplicationDAAliasType = FOUR_CHAR_CODE('addp')
|
||||
kPackageAliasType = FOUR_CHAR_CODE('fpka')
|
||||
kAppPackageAliasType = FOUR_CHAR_CODE('fapa')
|
||||
kSystemFolderAliasType = FOUR_CHAR_CODE('fasy')
|
||||
kAppleMenuFolderAliasType = FOUR_CHAR_CODE('faam')
|
||||
kStartupFolderAliasType = FOUR_CHAR_CODE('fast')
|
||||
kPrintMonitorDocsFolderAliasType = FOUR_CHAR_CODE('fapn')
|
||||
kPreferencesFolderAliasType = FOUR_CHAR_CODE('fapf')
|
||||
kControlPanelFolderAliasType = FOUR_CHAR_CODE('fact')
|
||||
kExtensionFolderAliasType = FOUR_CHAR_CODE('faex')
|
||||
kExportedFolderAliasType = FOUR_CHAR_CODE('faet')
|
||||
kDropFolderAliasType = FOUR_CHAR_CODE('fadr')
|
||||
kSharedFolderAliasType = FOUR_CHAR_CODE('fash')
|
||||
kMountedFolderAliasType = FOUR_CHAR_CODE('famn')
|
||||
kIsOnDesk = 0x0001
|
||||
kColor = 0x000E
|
||||
kIsShared = 0x0040
|
||||
kHasNoINITs = 0x0080
|
||||
kHasBeenInited = 0x0100
|
||||
kHasCustomIcon = 0x0400
|
||||
kIsStationery = 0x0800
|
||||
kNameLocked = 0x1000
|
||||
kHasBundle = 0x2000
|
||||
kIsInvisible = 0x4000
|
||||
kIsAlias = 0x8000
|
||||
fOnDesk = kIsOnDesk
|
||||
fHasBundle = kHasBundle
|
||||
fInvisible = kIsInvisible
|
||||
fTrash = -3
|
||||
fDesktop = -2
|
||||
fDisk = 0
|
||||
kIsStationary = kIsStationery
|
||||
kExtendedFlagsAreInvalid = 0x8000
|
||||
kExtendedFlagHasCustomBadge = 0x0100
|
||||
kExtendedFlagHasRoutingInfo = 0x0004
|
||||
kFirstMagicBusyFiletype = FOUR_CHAR_CODE('bzy ')
|
||||
kLastMagicBusyFiletype = FOUR_CHAR_CODE('bzy?')
|
||||
kMagicBusyCreationDate = 0x4F3AFDB0
|
||||
1
Darwin/lib/python2.7/plat-mac/Carbon/Fm.py
Normal file
1
Darwin/lib/python2.7/plat-mac/Carbon/Fm.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
from _Fm import *
|
||||
1
Darwin/lib/python2.7/plat-mac/Carbon/Folder.py
Normal file
1
Darwin/lib/python2.7/plat-mac/Carbon/Folder.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
from _Folder import *
|
||||
190
Darwin/lib/python2.7/plat-mac/Carbon/Folders.py
Normal file
190
Darwin/lib/python2.7/plat-mac/Carbon/Folders.py
Normal file
|
|
@ -0,0 +1,190 @@
|
|||
# Generated from 'Folders.h'
|
||||
|
||||
def FOUR_CHAR_CODE(x): return x
|
||||
true = True
|
||||
false = False
|
||||
kOnSystemDisk = -32768L
|
||||
kOnAppropriateDisk = -32767
|
||||
kSystemDomain = -32766
|
||||
kLocalDomain = -32765
|
||||
kNetworkDomain = -32764
|
||||
kUserDomain = -32763
|
||||
kClassicDomain = -32762
|
||||
kCreateFolder = true
|
||||
kDontCreateFolder = false
|
||||
kSystemFolderType = FOUR_CHAR_CODE('macs')
|
||||
kDesktopFolderType = FOUR_CHAR_CODE('desk')
|
||||
kSystemDesktopFolderType = FOUR_CHAR_CODE('sdsk')
|
||||
kTrashFolderType = FOUR_CHAR_CODE('trsh')
|
||||
kSystemTrashFolderType = FOUR_CHAR_CODE('strs')
|
||||
kWhereToEmptyTrashFolderType = FOUR_CHAR_CODE('empt')
|
||||
kPrintMonitorDocsFolderType = FOUR_CHAR_CODE('prnt')
|
||||
kStartupFolderType = FOUR_CHAR_CODE('strt')
|
||||
kShutdownFolderType = FOUR_CHAR_CODE('shdf')
|
||||
kAppleMenuFolderType = FOUR_CHAR_CODE('amnu')
|
||||
kControlPanelFolderType = FOUR_CHAR_CODE('ctrl')
|
||||
kSystemControlPanelFolderType = FOUR_CHAR_CODE('sctl')
|
||||
kExtensionFolderType = FOUR_CHAR_CODE('extn')
|
||||
kFontsFolderType = FOUR_CHAR_CODE('font')
|
||||
kPreferencesFolderType = FOUR_CHAR_CODE('pref')
|
||||
kSystemPreferencesFolderType = FOUR_CHAR_CODE('sprf')
|
||||
kTemporaryFolderType = FOUR_CHAR_CODE('temp')
|
||||
kExtensionDisabledFolderType = FOUR_CHAR_CODE('extD')
|
||||
kControlPanelDisabledFolderType = FOUR_CHAR_CODE('ctrD')
|
||||
kSystemExtensionDisabledFolderType = FOUR_CHAR_CODE('macD')
|
||||
kStartupItemsDisabledFolderType = FOUR_CHAR_CODE('strD')
|
||||
kShutdownItemsDisabledFolderType = FOUR_CHAR_CODE('shdD')
|
||||
kApplicationsFolderType = FOUR_CHAR_CODE('apps')
|
||||
kDocumentsFolderType = FOUR_CHAR_CODE('docs')
|
||||
kVolumeRootFolderType = FOUR_CHAR_CODE('root')
|
||||
kChewableItemsFolderType = FOUR_CHAR_CODE('flnt')
|
||||
kApplicationSupportFolderType = FOUR_CHAR_CODE('asup')
|
||||
kTextEncodingsFolderType = FOUR_CHAR_CODE('\xc4tex')
|
||||
kStationeryFolderType = FOUR_CHAR_CODE('odst')
|
||||
kOpenDocFolderType = FOUR_CHAR_CODE('odod')
|
||||
kOpenDocShellPlugInsFolderType = FOUR_CHAR_CODE('odsp')
|
||||
kEditorsFolderType = FOUR_CHAR_CODE('oded')
|
||||
kOpenDocEditorsFolderType = FOUR_CHAR_CODE('\xc4odf')
|
||||
kOpenDocLibrariesFolderType = FOUR_CHAR_CODE('odlb')
|
||||
kGenEditorsFolderType = FOUR_CHAR_CODE('\xc4edi')
|
||||
kHelpFolderType = FOUR_CHAR_CODE('\xc4hlp')
|
||||
kInternetPlugInFolderType = FOUR_CHAR_CODE('\xc4net')
|
||||
kModemScriptsFolderType = FOUR_CHAR_CODE('\xc4mod')
|
||||
kPrinterDescriptionFolderType = FOUR_CHAR_CODE('ppdf')
|
||||
kPrinterDriverFolderType = FOUR_CHAR_CODE('\xc4prd')
|
||||
kScriptingAdditionsFolderType = FOUR_CHAR_CODE('\xc4scr')
|
||||
kSharedLibrariesFolderType = FOUR_CHAR_CODE('\xc4lib')
|
||||
kVoicesFolderType = FOUR_CHAR_CODE('fvoc')
|
||||
kControlStripModulesFolderType = FOUR_CHAR_CODE('sdev')
|
||||
kAssistantsFolderType = FOUR_CHAR_CODE('ast\xc4')
|
||||
kUtilitiesFolderType = FOUR_CHAR_CODE('uti\xc4')
|
||||
kAppleExtrasFolderType = FOUR_CHAR_CODE('aex\xc4')
|
||||
kContextualMenuItemsFolderType = FOUR_CHAR_CODE('cmnu')
|
||||
kMacOSReadMesFolderType = FOUR_CHAR_CODE('mor\xc4')
|
||||
kALMModulesFolderType = FOUR_CHAR_CODE('walk')
|
||||
kALMPreferencesFolderType = FOUR_CHAR_CODE('trip')
|
||||
kALMLocationsFolderType = FOUR_CHAR_CODE('fall')
|
||||
kColorSyncProfilesFolderType = FOUR_CHAR_CODE('prof')
|
||||
kThemesFolderType = FOUR_CHAR_CODE('thme')
|
||||
kFavoritesFolderType = FOUR_CHAR_CODE('favs')
|
||||
kInternetFolderType = FOUR_CHAR_CODE('int\xc4')
|
||||
kAppearanceFolderType = FOUR_CHAR_CODE('appr')
|
||||
kSoundSetsFolderType = FOUR_CHAR_CODE('snds')
|
||||
kDesktopPicturesFolderType = FOUR_CHAR_CODE('dtp\xc4')
|
||||
kInternetSearchSitesFolderType = FOUR_CHAR_CODE('issf')
|
||||
kFindSupportFolderType = FOUR_CHAR_CODE('fnds')
|
||||
kFindByContentFolderType = FOUR_CHAR_CODE('fbcf')
|
||||
kInstallerLogsFolderType = FOUR_CHAR_CODE('ilgf')
|
||||
kScriptsFolderType = FOUR_CHAR_CODE('scr\xc4')
|
||||
kFolderActionsFolderType = FOUR_CHAR_CODE('fasf')
|
||||
kLauncherItemsFolderType = FOUR_CHAR_CODE('laun')
|
||||
kRecentApplicationsFolderType = FOUR_CHAR_CODE('rapp')
|
||||
kRecentDocumentsFolderType = FOUR_CHAR_CODE('rdoc')
|
||||
kRecentServersFolderType = FOUR_CHAR_CODE('rsvr')
|
||||
kSpeakableItemsFolderType = FOUR_CHAR_CODE('spki')
|
||||
kKeychainFolderType = FOUR_CHAR_CODE('kchn')
|
||||
kQuickTimeExtensionsFolderType = FOUR_CHAR_CODE('qtex')
|
||||
kDisplayExtensionsFolderType = FOUR_CHAR_CODE('dspl')
|
||||
kMultiprocessingFolderType = FOUR_CHAR_CODE('mpxf')
|
||||
kPrintingPlugInsFolderType = FOUR_CHAR_CODE('pplg')
|
||||
kDomainTopLevelFolderType = FOUR_CHAR_CODE('dtop')
|
||||
kDomainLibraryFolderType = FOUR_CHAR_CODE('dlib')
|
||||
kColorSyncFolderType = FOUR_CHAR_CODE('sync')
|
||||
kColorSyncCMMFolderType = FOUR_CHAR_CODE('ccmm')
|
||||
kColorSyncScriptingFolderType = FOUR_CHAR_CODE('cscr')
|
||||
kPrintersFolderType = FOUR_CHAR_CODE('impr')
|
||||
kSpeechFolderType = FOUR_CHAR_CODE('spch')
|
||||
kCarbonLibraryFolderType = FOUR_CHAR_CODE('carb')
|
||||
kDocumentationFolderType = FOUR_CHAR_CODE('info')
|
||||
kDeveloperDocsFolderType = FOUR_CHAR_CODE('ddoc')
|
||||
kDeveloperHelpFolderType = FOUR_CHAR_CODE('devh')
|
||||
kISSDownloadsFolderType = FOUR_CHAR_CODE('issd')
|
||||
kUserSpecificTmpFolderType = FOUR_CHAR_CODE('utmp')
|
||||
kCachedDataFolderType = FOUR_CHAR_CODE('cach')
|
||||
kFrameworksFolderType = FOUR_CHAR_CODE('fram')
|
||||
kPrivateFrameworksFolderType = FOUR_CHAR_CODE('pfrm')
|
||||
kClassicDesktopFolderType = FOUR_CHAR_CODE('sdsk')
|
||||
kDeveloperFolderType = FOUR_CHAR_CODE('devf')
|
||||
kSystemSoundsFolderType = FOUR_CHAR_CODE('ssnd')
|
||||
kComponentsFolderType = FOUR_CHAR_CODE('cmpd')
|
||||
kQuickTimeComponentsFolderType = FOUR_CHAR_CODE('wcmp')
|
||||
kCoreServicesFolderType = FOUR_CHAR_CODE('csrv')
|
||||
kPictureDocumentsFolderType = FOUR_CHAR_CODE('pdoc')
|
||||
kMovieDocumentsFolderType = FOUR_CHAR_CODE('mdoc')
|
||||
kMusicDocumentsFolderType = FOUR_CHAR_CODE('\xb5doc')
|
||||
kInternetSitesFolderType = FOUR_CHAR_CODE('site')
|
||||
kPublicFolderType = FOUR_CHAR_CODE('pubb')
|
||||
kAudioSupportFolderType = FOUR_CHAR_CODE('adio')
|
||||
kAudioSoundsFolderType = FOUR_CHAR_CODE('asnd')
|
||||
kAudioSoundBanksFolderType = FOUR_CHAR_CODE('bank')
|
||||
kAudioAlertSoundsFolderType = FOUR_CHAR_CODE('alrt')
|
||||
kAudioPlugInsFolderType = FOUR_CHAR_CODE('aplg')
|
||||
kAudioComponentsFolderType = FOUR_CHAR_CODE('acmp')
|
||||
kKernelExtensionsFolderType = FOUR_CHAR_CODE('kext')
|
||||
kDirectoryServicesFolderType = FOUR_CHAR_CODE('dsrv')
|
||||
kDirectoryServicesPlugInsFolderType = FOUR_CHAR_CODE('dplg')
|
||||
kInstallerReceiptsFolderType = FOUR_CHAR_CODE('rcpt')
|
||||
kFileSystemSupportFolderType = FOUR_CHAR_CODE('fsys')
|
||||
kAppleShareSupportFolderType = FOUR_CHAR_CODE('shar')
|
||||
kAppleShareAuthenticationFolderType = FOUR_CHAR_CODE('auth')
|
||||
kMIDIDriversFolderType = FOUR_CHAR_CODE('midi')
|
||||
kLocalesFolderType = FOUR_CHAR_CODE('\xc4loc')
|
||||
kFindByContentPluginsFolderType = FOUR_CHAR_CODE('fbcp')
|
||||
kUsersFolderType = FOUR_CHAR_CODE('usrs')
|
||||
kCurrentUserFolderType = FOUR_CHAR_CODE('cusr')
|
||||
kCurrentUserRemoteFolderLocation = FOUR_CHAR_CODE('rusf')
|
||||
kCurrentUserRemoteFolderType = FOUR_CHAR_CODE('rusr')
|
||||
kSharedUserDataFolderType = FOUR_CHAR_CODE('sdat')
|
||||
kVolumeSettingsFolderType = FOUR_CHAR_CODE('vsfd')
|
||||
kAppleshareAutomountServerAliasesFolderType = FOUR_CHAR_CODE('srv\xc4')
|
||||
kPreMacOS91ApplicationsFolderType = FOUR_CHAR_CODE('\x8cpps')
|
||||
kPreMacOS91InstallerLogsFolderType = FOUR_CHAR_CODE('\x94lgf')
|
||||
kPreMacOS91AssistantsFolderType = FOUR_CHAR_CODE('\x8cst\xc4')
|
||||
kPreMacOS91UtilitiesFolderType = FOUR_CHAR_CODE('\x9fti\xc4')
|
||||
kPreMacOS91AppleExtrasFolderType = FOUR_CHAR_CODE('\x8cex\xc4')
|
||||
kPreMacOS91MacOSReadMesFolderType = FOUR_CHAR_CODE('\xb5or\xc4')
|
||||
kPreMacOS91InternetFolderType = FOUR_CHAR_CODE('\x94nt\xc4')
|
||||
kPreMacOS91AutomountedServersFolderType = FOUR_CHAR_CODE('\xa7rv\xc4')
|
||||
kPreMacOS91StationeryFolderType = FOUR_CHAR_CODE('\xbfdst')
|
||||
kCreateFolderAtBoot = 0x00000002
|
||||
kCreateFolderAtBootBit = 1
|
||||
kFolderCreatedInvisible = 0x00000004
|
||||
kFolderCreatedInvisibleBit = 2
|
||||
kFolderCreatedNameLocked = 0x00000008
|
||||
kFolderCreatedNameLockedBit = 3
|
||||
kFolderCreatedAdminPrivs = 0x00000010
|
||||
kFolderCreatedAdminPrivsBit = 4
|
||||
kFolderInUserFolder = 0x00000020
|
||||
kFolderInUserFolderBit = 5
|
||||
kFolderTrackedByAlias = 0x00000040
|
||||
kFolderTrackedByAliasBit = 6
|
||||
kFolderInRemoteUserFolderIfAvailable = 0x00000080
|
||||
kFolderInRemoteUserFolderIfAvailableBit = 7
|
||||
kFolderNeverMatchedInIdentifyFolder = 0x00000100
|
||||
kFolderNeverMatchedInIdentifyFolderBit = 8
|
||||
kFolderMustStayOnSameVolume = 0x00000200
|
||||
kFolderMustStayOnSameVolumeBit = 9
|
||||
kFolderManagerFolderInMacOS9FolderIfMacOSXIsInstalledMask = 0x00000400
|
||||
kFolderManagerFolderInMacOS9FolderIfMacOSXIsInstalledBit = 10
|
||||
kFolderInLocalOrRemoteUserFolder = kFolderInUserFolder | kFolderInRemoteUserFolderIfAvailable
|
||||
kRelativeFolder = FOUR_CHAR_CODE('relf')
|
||||
kSpecialFolder = FOUR_CHAR_CODE('spcf')
|
||||
kBlessedFolder = FOUR_CHAR_CODE('blsf')
|
||||
kRootFolder = FOUR_CHAR_CODE('rotf')
|
||||
kCurrentUserFolderLocation = FOUR_CHAR_CODE('cusf')
|
||||
kFindFolderRedirectionFlagUseDistinctUserFoldersBit = 0
|
||||
kFindFolderRedirectionFlagUseGivenVRefAndDirIDAsUserFolderBit = 1
|
||||
kFindFolderRedirectionFlagsUseGivenVRefNumAndDirIDAsRemoteUserFolderBit = 2
|
||||
kFolderManagerUserRedirectionGlobalsCurrentVersion = 1
|
||||
kFindFolderExtendedFlagsDoNotFollowAliasesBit = 0
|
||||
kFindFolderExtendedFlagsDoNotUseUserFolderBit = 1
|
||||
kFindFolderExtendedFlagsUseOtherUserRecord = 0x01000000
|
||||
kFolderManagerNotificationMessageUserLogIn = FOUR_CHAR_CODE('log+')
|
||||
kFolderManagerNotificationMessagePreUserLogIn = FOUR_CHAR_CODE('logj')
|
||||
kFolderManagerNotificationMessageUserLogOut = FOUR_CHAR_CODE('log-')
|
||||
kFolderManagerNotificationMessagePostUserLogOut = FOUR_CHAR_CODE('logp')
|
||||
kFolderManagerNotificationDiscardCachedData = FOUR_CHAR_CODE('dche')
|
||||
kFolderManagerNotificationMessageLoginStartup = FOUR_CHAR_CODE('stup')
|
||||
kDoNotRemoveWhenCurrentApplicationQuitsBit = 0
|
||||
kDoNotRemoveWheCurrentApplicationQuitsBit = kDoNotRemoveWhenCurrentApplicationQuitsBit
|
||||
kStopIfAnyNotificationProcReturnsErrorBit = 31
|
||||
59
Darwin/lib/python2.7/plat-mac/Carbon/Fonts.py
Normal file
59
Darwin/lib/python2.7/plat-mac/Carbon/Fonts.py
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
# Generated from 'Fonts.h'
|
||||
|
||||
def FOUR_CHAR_CODE(x): return x
|
||||
kNilOptions = 0
|
||||
systemFont = 0
|
||||
applFont = 1
|
||||
kFMDefaultOptions = kNilOptions
|
||||
kFMDefaultActivationContext = kFMDefaultOptions
|
||||
kFMGlobalActivationContext = 0x00000001
|
||||
kFMLocalActivationContext = kFMDefaultActivationContext
|
||||
kFMDefaultIterationScope = kFMDefaultOptions
|
||||
kFMGlobalIterationScope = 0x00000001
|
||||
kFMLocalIterationScope = kFMDefaultIterationScope
|
||||
kPlatformDefaultGuiFontID = applFont
|
||||
kPlatformDefaultGuiFontID = -1
|
||||
commandMark = 17
|
||||
checkMark = 18
|
||||
diamondMark = 19
|
||||
appleMark = 20
|
||||
propFont = 36864L
|
||||
prpFntH = 36865L
|
||||
prpFntW = 36866L
|
||||
prpFntHW = 36867L
|
||||
fixedFont = 45056L
|
||||
fxdFntH = 45057L
|
||||
fxdFntW = 45058L
|
||||
fxdFntHW = 45059L
|
||||
fontWid = 44208L
|
||||
kFMUseGlobalScopeOption = 0x00000001
|
||||
kFontIDNewYork = 2
|
||||
kFontIDGeneva = 3
|
||||
kFontIDMonaco = 4
|
||||
kFontIDVenice = 5
|
||||
kFontIDLondon = 6
|
||||
kFontIDAthens = 7
|
||||
kFontIDSanFrancisco = 8
|
||||
kFontIDToronto = 9
|
||||
kFontIDCairo = 11
|
||||
kFontIDLosAngeles = 12
|
||||
kFontIDTimes = 20
|
||||
kFontIDHelvetica = 21
|
||||
kFontIDCourier = 22
|
||||
kFontIDSymbol = 23
|
||||
kFontIDMobile = 24
|
||||
newYork = kFontIDNewYork
|
||||
geneva = kFontIDGeneva
|
||||
monaco = kFontIDMonaco
|
||||
venice = kFontIDVenice
|
||||
london = kFontIDLondon
|
||||
athens = kFontIDAthens
|
||||
sanFran = kFontIDSanFrancisco
|
||||
toronto = kFontIDToronto
|
||||
cairo = kFontIDCairo
|
||||
losAngeles = kFontIDLosAngeles
|
||||
times = kFontIDTimes
|
||||
helvetica = kFontIDHelvetica
|
||||
courier = kFontIDCourier
|
||||
symbol = kFontIDSymbol
|
||||
mobile = kFontIDMobile
|
||||
1
Darwin/lib/python2.7/plat-mac/Carbon/Help.py
Normal file
1
Darwin/lib/python2.7/plat-mac/Carbon/Help.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
from _Help import *
|
||||
1
Darwin/lib/python2.7/plat-mac/Carbon/IBCarbon.py
Normal file
1
Darwin/lib/python2.7/plat-mac/Carbon/IBCarbon.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
from _IBCarbon import *
|
||||
5
Darwin/lib/python2.7/plat-mac/Carbon/IBCarbonRuntime.py
Normal file
5
Darwin/lib/python2.7/plat-mac/Carbon/IBCarbonRuntime.py
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
# Generated from 'IBCarbonRuntime.h'
|
||||
|
||||
kIBCarbonRuntimeCantFindNibFile = -10960
|
||||
kIBCarbonRuntimeObjectNotOfRequestedType = -10961
|
||||
kIBCarbonRuntimeCantFindObject = -10962
|
||||
1
Darwin/lib/python2.7/plat-mac/Carbon/Icn.py
Normal file
1
Darwin/lib/python2.7/plat-mac/Carbon/Icn.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
from _Icn import *
|
||||
381
Darwin/lib/python2.7/plat-mac/Carbon/Icons.py
Normal file
381
Darwin/lib/python2.7/plat-mac/Carbon/Icons.py
Normal file
|
|
@ -0,0 +1,381 @@
|
|||
# Generated from 'Icons.h'
|
||||
|
||||
def FOUR_CHAR_CODE(x): return x
|
||||
from Carbon.Files import *
|
||||
kGenericDocumentIconResource = -4000
|
||||
kGenericStationeryIconResource = -3985
|
||||
kGenericEditionFileIconResource = -3989
|
||||
kGenericApplicationIconResource = -3996
|
||||
kGenericDeskAccessoryIconResource = -3991
|
||||
kGenericFolderIconResource = -3999
|
||||
kPrivateFolderIconResource = -3994
|
||||
kFloppyIconResource = -3998
|
||||
kTrashIconResource = -3993
|
||||
kGenericRAMDiskIconResource = -3988
|
||||
kGenericCDROMIconResource = -3987
|
||||
kDesktopIconResource = -3992
|
||||
kOpenFolderIconResource = -3997
|
||||
kGenericHardDiskIconResource = -3995
|
||||
kGenericFileServerIconResource = -3972
|
||||
kGenericSuitcaseIconResource = -3970
|
||||
kGenericMoverObjectIconResource = -3969
|
||||
kGenericPreferencesIconResource = -3971
|
||||
kGenericQueryDocumentIconResource = -16506
|
||||
kGenericExtensionIconResource = -16415
|
||||
kSystemFolderIconResource = -3983
|
||||
kHelpIconResource = -20271
|
||||
kAppleMenuFolderIconResource = -3982
|
||||
genericDocumentIconResource = kGenericDocumentIconResource
|
||||
genericStationeryIconResource = kGenericStationeryIconResource
|
||||
genericEditionFileIconResource = kGenericEditionFileIconResource
|
||||
genericApplicationIconResource = kGenericApplicationIconResource
|
||||
genericDeskAccessoryIconResource = kGenericDeskAccessoryIconResource
|
||||
genericFolderIconResource = kGenericFolderIconResource
|
||||
privateFolderIconResource = kPrivateFolderIconResource
|
||||
floppyIconResource = kFloppyIconResource
|
||||
trashIconResource = kTrashIconResource
|
||||
genericRAMDiskIconResource = kGenericRAMDiskIconResource
|
||||
genericCDROMIconResource = kGenericCDROMIconResource
|
||||
desktopIconResource = kDesktopIconResource
|
||||
openFolderIconResource = kOpenFolderIconResource
|
||||
genericHardDiskIconResource = kGenericHardDiskIconResource
|
||||
genericFileServerIconResource = kGenericFileServerIconResource
|
||||
genericSuitcaseIconResource = kGenericSuitcaseIconResource
|
||||
genericMoverObjectIconResource = kGenericMoverObjectIconResource
|
||||
genericPreferencesIconResource = kGenericPreferencesIconResource
|
||||
genericQueryDocumentIconResource = kGenericQueryDocumentIconResource
|
||||
genericExtensionIconResource = kGenericExtensionIconResource
|
||||
systemFolderIconResource = kSystemFolderIconResource
|
||||
appleMenuFolderIconResource = kAppleMenuFolderIconResource
|
||||
kStartupFolderIconResource = -3981
|
||||
kOwnedFolderIconResource = -3980
|
||||
kDropFolderIconResource = -3979
|
||||
kSharedFolderIconResource = -3978
|
||||
kMountedFolderIconResource = -3977
|
||||
kControlPanelFolderIconResource = -3976
|
||||
kPrintMonitorFolderIconResource = -3975
|
||||
kPreferencesFolderIconResource = -3974
|
||||
kExtensionsFolderIconResource = -3973
|
||||
kFontsFolderIconResource = -3968
|
||||
kFullTrashIconResource = -3984
|
||||
startupFolderIconResource = kStartupFolderIconResource
|
||||
ownedFolderIconResource = kOwnedFolderIconResource
|
||||
dropFolderIconResource = kDropFolderIconResource
|
||||
sharedFolderIconResource = kSharedFolderIconResource
|
||||
mountedFolderIconResource = kMountedFolderIconResource
|
||||
controlPanelFolderIconResource = kControlPanelFolderIconResource
|
||||
printMonitorFolderIconResource = kPrintMonitorFolderIconResource
|
||||
preferencesFolderIconResource = kPreferencesFolderIconResource
|
||||
extensionsFolderIconResource = kExtensionsFolderIconResource
|
||||
fontsFolderIconResource = kFontsFolderIconResource
|
||||
fullTrashIconResource = kFullTrashIconResource
|
||||
kThumbnail32BitData = FOUR_CHAR_CODE('it32')
|
||||
kThumbnail8BitMask = FOUR_CHAR_CODE('t8mk')
|
||||
kHuge1BitMask = FOUR_CHAR_CODE('ich#')
|
||||
kHuge4BitData = FOUR_CHAR_CODE('ich4')
|
||||
kHuge8BitData = FOUR_CHAR_CODE('ich8')
|
||||
kHuge32BitData = FOUR_CHAR_CODE('ih32')
|
||||
kHuge8BitMask = FOUR_CHAR_CODE('h8mk')
|
||||
kLarge1BitMask = FOUR_CHAR_CODE('ICN#')
|
||||
kLarge4BitData = FOUR_CHAR_CODE('icl4')
|
||||
kLarge8BitData = FOUR_CHAR_CODE('icl8')
|
||||
kLarge32BitData = FOUR_CHAR_CODE('il32')
|
||||
kLarge8BitMask = FOUR_CHAR_CODE('l8mk')
|
||||
kSmall1BitMask = FOUR_CHAR_CODE('ics#')
|
||||
kSmall4BitData = FOUR_CHAR_CODE('ics4')
|
||||
kSmall8BitData = FOUR_CHAR_CODE('ics8')
|
||||
kSmall32BitData = FOUR_CHAR_CODE('is32')
|
||||
kSmall8BitMask = FOUR_CHAR_CODE('s8mk')
|
||||
kMini1BitMask = FOUR_CHAR_CODE('icm#')
|
||||
kMini4BitData = FOUR_CHAR_CODE('icm4')
|
||||
kMini8BitData = FOUR_CHAR_CODE('icm8')
|
||||
kTileIconVariant = FOUR_CHAR_CODE('tile')
|
||||
kRolloverIconVariant = FOUR_CHAR_CODE('over')
|
||||
kDropIconVariant = FOUR_CHAR_CODE('drop')
|
||||
kOpenIconVariant = FOUR_CHAR_CODE('open')
|
||||
kOpenDropIconVariant = FOUR_CHAR_CODE('odrp')
|
||||
large1BitMask = kLarge1BitMask
|
||||
large4BitData = kLarge4BitData
|
||||
large8BitData = kLarge8BitData
|
||||
small1BitMask = kSmall1BitMask
|
||||
small4BitData = kSmall4BitData
|
||||
small8BitData = kSmall8BitData
|
||||
mini1BitMask = kMini1BitMask
|
||||
mini4BitData = kMini4BitData
|
||||
mini8BitData = kMini8BitData
|
||||
kAlignNone = 0x00
|
||||
kAlignVerticalCenter = 0x01
|
||||
kAlignTop = 0x02
|
||||
kAlignBottom = 0x03
|
||||
kAlignHorizontalCenter = 0x04
|
||||
kAlignAbsoluteCenter = kAlignVerticalCenter | kAlignHorizontalCenter
|
||||
kAlignCenterTop = kAlignTop | kAlignHorizontalCenter
|
||||
kAlignCenterBottom = kAlignBottom | kAlignHorizontalCenter
|
||||
kAlignLeft = 0x08
|
||||
kAlignCenterLeft = kAlignVerticalCenter | kAlignLeft
|
||||
kAlignTopLeft = kAlignTop | kAlignLeft
|
||||
kAlignBottomLeft = kAlignBottom | kAlignLeft
|
||||
kAlignRight = 0x0C
|
||||
kAlignCenterRight = kAlignVerticalCenter | kAlignRight
|
||||
kAlignTopRight = kAlignTop | kAlignRight
|
||||
kAlignBottomRight = kAlignBottom | kAlignRight
|
||||
atNone = kAlignNone
|
||||
atVerticalCenter = kAlignVerticalCenter
|
||||
atTop = kAlignTop
|
||||
atBottom = kAlignBottom
|
||||
atHorizontalCenter = kAlignHorizontalCenter
|
||||
atAbsoluteCenter = kAlignAbsoluteCenter
|
||||
atCenterTop = kAlignCenterTop
|
||||
atCenterBottom = kAlignCenterBottom
|
||||
atLeft = kAlignLeft
|
||||
atCenterLeft = kAlignCenterLeft
|
||||
atTopLeft = kAlignTopLeft
|
||||
atBottomLeft = kAlignBottomLeft
|
||||
atRight = kAlignRight
|
||||
atCenterRight = kAlignCenterRight
|
||||
atTopRight = kAlignTopRight
|
||||
atBottomRight = kAlignBottomRight
|
||||
kTransformNone = 0x00
|
||||
kTransformDisabled = 0x01
|
||||
kTransformOffline = 0x02
|
||||
kTransformOpen = 0x03
|
||||
kTransformLabel1 = 0x0100
|
||||
kTransformLabel2 = 0x0200
|
||||
kTransformLabel3 = 0x0300
|
||||
kTransformLabel4 = 0x0400
|
||||
kTransformLabel5 = 0x0500
|
||||
kTransformLabel6 = 0x0600
|
||||
kTransformLabel7 = 0x0700
|
||||
kTransformSelected = 0x4000
|
||||
kTransformSelectedDisabled = kTransformSelected | kTransformDisabled
|
||||
kTransformSelectedOffline = kTransformSelected | kTransformOffline
|
||||
kTransformSelectedOpen = kTransformSelected | kTransformOpen
|
||||
ttNone = kTransformNone
|
||||
ttDisabled = kTransformDisabled
|
||||
ttOffline = kTransformOffline
|
||||
ttOpen = kTransformOpen
|
||||
ttLabel1 = kTransformLabel1
|
||||
ttLabel2 = kTransformLabel2
|
||||
ttLabel3 = kTransformLabel3
|
||||
ttLabel4 = kTransformLabel4
|
||||
ttLabel5 = kTransformLabel5
|
||||
ttLabel6 = kTransformLabel6
|
||||
ttLabel7 = kTransformLabel7
|
||||
ttSelected = kTransformSelected
|
||||
ttSelectedDisabled = kTransformSelectedDisabled
|
||||
ttSelectedOffline = kTransformSelectedOffline
|
||||
ttSelectedOpen = kTransformSelectedOpen
|
||||
kSelectorLarge1Bit = 0x00000001
|
||||
kSelectorLarge4Bit = 0x00000002
|
||||
kSelectorLarge8Bit = 0x00000004
|
||||
kSelectorLarge32Bit = 0x00000008
|
||||
kSelectorLarge8BitMask = 0x00000010
|
||||
kSelectorSmall1Bit = 0x00000100
|
||||
kSelectorSmall4Bit = 0x00000200
|
||||
kSelectorSmall8Bit = 0x00000400
|
||||
kSelectorSmall32Bit = 0x00000800
|
||||
kSelectorSmall8BitMask = 0x00001000
|
||||
kSelectorMini1Bit = 0x00010000
|
||||
kSelectorMini4Bit = 0x00020000
|
||||
kSelectorMini8Bit = 0x00040000
|
||||
kSelectorHuge1Bit = 0x01000000
|
||||
kSelectorHuge4Bit = 0x02000000
|
||||
kSelectorHuge8Bit = 0x04000000
|
||||
kSelectorHuge32Bit = 0x08000000
|
||||
kSelectorHuge8BitMask = 0x10000000
|
||||
kSelectorAllLargeData = 0x000000FF
|
||||
kSelectorAllSmallData = 0x0000FF00
|
||||
kSelectorAllMiniData = 0x00FF0000
|
||||
# kSelectorAllHugeData = (long)0xFF000000
|
||||
kSelectorAll1BitData = kSelectorLarge1Bit | kSelectorSmall1Bit | kSelectorMini1Bit | kSelectorHuge1Bit
|
||||
kSelectorAll4BitData = kSelectorLarge4Bit | kSelectorSmall4Bit | kSelectorMini4Bit | kSelectorHuge4Bit
|
||||
kSelectorAll8BitData = kSelectorLarge8Bit | kSelectorSmall8Bit | kSelectorMini8Bit | kSelectorHuge8Bit
|
||||
kSelectorAll32BitData = kSelectorLarge32Bit | kSelectorSmall32Bit | kSelectorHuge32Bit
|
||||
# kSelectorAllAvailableData = (long)0xFFFFFFFF
|
||||
svLarge1Bit = kSelectorLarge1Bit
|
||||
svLarge4Bit = kSelectorLarge4Bit
|
||||
svLarge8Bit = kSelectorLarge8Bit
|
||||
svSmall1Bit = kSelectorSmall1Bit
|
||||
svSmall4Bit = kSelectorSmall4Bit
|
||||
svSmall8Bit = kSelectorSmall8Bit
|
||||
svMini1Bit = kSelectorMini1Bit
|
||||
svMini4Bit = kSelectorMini4Bit
|
||||
svMini8Bit = kSelectorMini8Bit
|
||||
svAllLargeData = kSelectorAllLargeData
|
||||
svAllSmallData = kSelectorAllSmallData
|
||||
svAllMiniData = kSelectorAllMiniData
|
||||
svAll1BitData = kSelectorAll1BitData
|
||||
svAll4BitData = kSelectorAll4BitData
|
||||
svAll8BitData = kSelectorAll8BitData
|
||||
# svAllAvailableData = kSelectorAllAvailableData
|
||||
kSystemIconsCreator = FOUR_CHAR_CODE('macs')
|
||||
# err = GetIconRef(kOnSystemDisk
|
||||
kClipboardIcon = FOUR_CHAR_CODE('CLIP')
|
||||
kClippingUnknownTypeIcon = FOUR_CHAR_CODE('clpu')
|
||||
kClippingPictureTypeIcon = FOUR_CHAR_CODE('clpp')
|
||||
kClippingTextTypeIcon = FOUR_CHAR_CODE('clpt')
|
||||
kClippingSoundTypeIcon = FOUR_CHAR_CODE('clps')
|
||||
kDesktopIcon = FOUR_CHAR_CODE('desk')
|
||||
kFinderIcon = FOUR_CHAR_CODE('FNDR')
|
||||
kFontSuitcaseIcon = FOUR_CHAR_CODE('FFIL')
|
||||
kFullTrashIcon = FOUR_CHAR_CODE('ftrh')
|
||||
kGenericApplicationIcon = FOUR_CHAR_CODE('APPL')
|
||||
kGenericCDROMIcon = FOUR_CHAR_CODE('cddr')
|
||||
kGenericControlPanelIcon = FOUR_CHAR_CODE('APPC')
|
||||
kGenericControlStripModuleIcon = FOUR_CHAR_CODE('sdev')
|
||||
kGenericComponentIcon = FOUR_CHAR_CODE('thng')
|
||||
kGenericDeskAccessoryIcon = FOUR_CHAR_CODE('APPD')
|
||||
kGenericDocumentIcon = FOUR_CHAR_CODE('docu')
|
||||
kGenericEditionFileIcon = FOUR_CHAR_CODE('edtf')
|
||||
kGenericExtensionIcon = FOUR_CHAR_CODE('INIT')
|
||||
kGenericFileServerIcon = FOUR_CHAR_CODE('srvr')
|
||||
kGenericFontIcon = FOUR_CHAR_CODE('ffil')
|
||||
kGenericFontScalerIcon = FOUR_CHAR_CODE('sclr')
|
||||
kGenericFloppyIcon = FOUR_CHAR_CODE('flpy')
|
||||
kGenericHardDiskIcon = FOUR_CHAR_CODE('hdsk')
|
||||
kGenericIDiskIcon = FOUR_CHAR_CODE('idsk')
|
||||
kGenericRemovableMediaIcon = FOUR_CHAR_CODE('rmov')
|
||||
kGenericMoverObjectIcon = FOUR_CHAR_CODE('movr')
|
||||
kGenericPCCardIcon = FOUR_CHAR_CODE('pcmc')
|
||||
kGenericPreferencesIcon = FOUR_CHAR_CODE('pref')
|
||||
kGenericQueryDocumentIcon = FOUR_CHAR_CODE('qery')
|
||||
kGenericRAMDiskIcon = FOUR_CHAR_CODE('ramd')
|
||||
kGenericSharedLibaryIcon = FOUR_CHAR_CODE('shlb')
|
||||
kGenericStationeryIcon = FOUR_CHAR_CODE('sdoc')
|
||||
kGenericSuitcaseIcon = FOUR_CHAR_CODE('suit')
|
||||
kGenericURLIcon = FOUR_CHAR_CODE('gurl')
|
||||
kGenericWORMIcon = FOUR_CHAR_CODE('worm')
|
||||
kInternationalResourcesIcon = FOUR_CHAR_CODE('ifil')
|
||||
kKeyboardLayoutIcon = FOUR_CHAR_CODE('kfil')
|
||||
kSoundFileIcon = FOUR_CHAR_CODE('sfil')
|
||||
kSystemSuitcaseIcon = FOUR_CHAR_CODE('zsys')
|
||||
kTrashIcon = FOUR_CHAR_CODE('trsh')
|
||||
kTrueTypeFontIcon = FOUR_CHAR_CODE('tfil')
|
||||
kTrueTypeFlatFontIcon = FOUR_CHAR_CODE('sfnt')
|
||||
kTrueTypeMultiFlatFontIcon = FOUR_CHAR_CODE('ttcf')
|
||||
kUserIDiskIcon = FOUR_CHAR_CODE('udsk')
|
||||
kInternationResourcesIcon = kInternationalResourcesIcon
|
||||
kInternetLocationHTTPIcon = FOUR_CHAR_CODE('ilht')
|
||||
kInternetLocationFTPIcon = FOUR_CHAR_CODE('ilft')
|
||||
kInternetLocationAppleShareIcon = FOUR_CHAR_CODE('ilaf')
|
||||
kInternetLocationAppleTalkZoneIcon = FOUR_CHAR_CODE('ilat')
|
||||
kInternetLocationFileIcon = FOUR_CHAR_CODE('ilfi')
|
||||
kInternetLocationMailIcon = FOUR_CHAR_CODE('ilma')
|
||||
kInternetLocationNewsIcon = FOUR_CHAR_CODE('ilnw')
|
||||
kInternetLocationNSLNeighborhoodIcon = FOUR_CHAR_CODE('ilns')
|
||||
kInternetLocationGenericIcon = FOUR_CHAR_CODE('ilge')
|
||||
kGenericFolderIcon = FOUR_CHAR_CODE('fldr')
|
||||
kDropFolderIcon = FOUR_CHAR_CODE('dbox')
|
||||
kMountedFolderIcon = FOUR_CHAR_CODE('mntd')
|
||||
kOpenFolderIcon = FOUR_CHAR_CODE('ofld')
|
||||
kOwnedFolderIcon = FOUR_CHAR_CODE('ownd')
|
||||
kPrivateFolderIcon = FOUR_CHAR_CODE('prvf')
|
||||
kSharedFolderIcon = FOUR_CHAR_CODE('shfl')
|
||||
kSharingPrivsNotApplicableIcon = FOUR_CHAR_CODE('shna')
|
||||
kSharingPrivsReadOnlyIcon = FOUR_CHAR_CODE('shro')
|
||||
kSharingPrivsReadWriteIcon = FOUR_CHAR_CODE('shrw')
|
||||
kSharingPrivsUnknownIcon = FOUR_CHAR_CODE('shuk')
|
||||
kSharingPrivsWritableIcon = FOUR_CHAR_CODE('writ')
|
||||
kUserFolderIcon = FOUR_CHAR_CODE('ufld')
|
||||
kWorkgroupFolderIcon = FOUR_CHAR_CODE('wfld')
|
||||
kGuestUserIcon = FOUR_CHAR_CODE('gusr')
|
||||
kUserIcon = FOUR_CHAR_CODE('user')
|
||||
kOwnerIcon = FOUR_CHAR_CODE('susr')
|
||||
kGroupIcon = FOUR_CHAR_CODE('grup')
|
||||
kAppearanceFolderIcon = FOUR_CHAR_CODE('appr')
|
||||
kAppleExtrasFolderIcon = FOUR_CHAR_CODE('aex\xc4')
|
||||
kAppleMenuFolderIcon = FOUR_CHAR_CODE('amnu')
|
||||
kApplicationsFolderIcon = FOUR_CHAR_CODE('apps')
|
||||
kApplicationSupportFolderIcon = FOUR_CHAR_CODE('asup')
|
||||
kAssistantsFolderIcon = FOUR_CHAR_CODE('ast\xc4')
|
||||
kColorSyncFolderIcon = FOUR_CHAR_CODE('prof')
|
||||
kContextualMenuItemsFolderIcon = FOUR_CHAR_CODE('cmnu')
|
||||
kControlPanelDisabledFolderIcon = FOUR_CHAR_CODE('ctrD')
|
||||
kControlPanelFolderIcon = FOUR_CHAR_CODE('ctrl')
|
||||
kControlStripModulesFolderIcon = FOUR_CHAR_CODE('sdv\xc4')
|
||||
kDocumentsFolderIcon = FOUR_CHAR_CODE('docs')
|
||||
kExtensionsDisabledFolderIcon = FOUR_CHAR_CODE('extD')
|
||||
kExtensionsFolderIcon = FOUR_CHAR_CODE('extn')
|
||||
kFavoritesFolderIcon = FOUR_CHAR_CODE('favs')
|
||||
kFontsFolderIcon = FOUR_CHAR_CODE('font')
|
||||
kHelpFolderIcon = FOUR_CHAR_CODE('\xc4hlp')
|
||||
kInternetFolderIcon = FOUR_CHAR_CODE('int\xc4')
|
||||
kInternetPlugInFolderIcon = FOUR_CHAR_CODE('\xc4net')
|
||||
kInternetSearchSitesFolderIcon = FOUR_CHAR_CODE('issf')
|
||||
kLocalesFolderIcon = FOUR_CHAR_CODE('\xc4loc')
|
||||
kMacOSReadMeFolderIcon = FOUR_CHAR_CODE('mor\xc4')
|
||||
kPublicFolderIcon = FOUR_CHAR_CODE('pubf')
|
||||
kPreferencesFolderIcon = FOUR_CHAR_CODE('prf\xc4')
|
||||
kPrinterDescriptionFolderIcon = FOUR_CHAR_CODE('ppdf')
|
||||
kPrinterDriverFolderIcon = FOUR_CHAR_CODE('\xc4prd')
|
||||
kPrintMonitorFolderIcon = FOUR_CHAR_CODE('prnt')
|
||||
kRecentApplicationsFolderIcon = FOUR_CHAR_CODE('rapp')
|
||||
kRecentDocumentsFolderIcon = FOUR_CHAR_CODE('rdoc')
|
||||
kRecentServersFolderIcon = FOUR_CHAR_CODE('rsrv')
|
||||
kScriptingAdditionsFolderIcon = FOUR_CHAR_CODE('\xc4scr')
|
||||
kSharedLibrariesFolderIcon = FOUR_CHAR_CODE('\xc4lib')
|
||||
kScriptsFolderIcon = FOUR_CHAR_CODE('scr\xc4')
|
||||
kShutdownItemsDisabledFolderIcon = FOUR_CHAR_CODE('shdD')
|
||||
kShutdownItemsFolderIcon = FOUR_CHAR_CODE('shdf')
|
||||
kSpeakableItemsFolder = FOUR_CHAR_CODE('spki')
|
||||
kStartupItemsDisabledFolderIcon = FOUR_CHAR_CODE('strD')
|
||||
kStartupItemsFolderIcon = FOUR_CHAR_CODE('strt')
|
||||
kSystemExtensionDisabledFolderIcon = FOUR_CHAR_CODE('macD')
|
||||
kSystemFolderIcon = FOUR_CHAR_CODE('macs')
|
||||
kTextEncodingsFolderIcon = FOUR_CHAR_CODE('\xc4tex')
|
||||
kUsersFolderIcon = FOUR_CHAR_CODE('usr\xc4')
|
||||
kUtilitiesFolderIcon = FOUR_CHAR_CODE('uti\xc4')
|
||||
kVoicesFolderIcon = FOUR_CHAR_CODE('fvoc')
|
||||
kSystemFolderXIcon = FOUR_CHAR_CODE('macx')
|
||||
kAppleScriptBadgeIcon = FOUR_CHAR_CODE('scrp')
|
||||
kLockedBadgeIcon = FOUR_CHAR_CODE('lbdg')
|
||||
kMountedBadgeIcon = FOUR_CHAR_CODE('mbdg')
|
||||
kSharedBadgeIcon = FOUR_CHAR_CODE('sbdg')
|
||||
kAliasBadgeIcon = FOUR_CHAR_CODE('abdg')
|
||||
kAlertCautionBadgeIcon = FOUR_CHAR_CODE('cbdg')
|
||||
kAlertNoteIcon = FOUR_CHAR_CODE('note')
|
||||
kAlertCautionIcon = FOUR_CHAR_CODE('caut')
|
||||
kAlertStopIcon = FOUR_CHAR_CODE('stop')
|
||||
kAppleTalkIcon = FOUR_CHAR_CODE('atlk')
|
||||
kAppleTalkZoneIcon = FOUR_CHAR_CODE('atzn')
|
||||
kAFPServerIcon = FOUR_CHAR_CODE('afps')
|
||||
kFTPServerIcon = FOUR_CHAR_CODE('ftps')
|
||||
kHTTPServerIcon = FOUR_CHAR_CODE('htps')
|
||||
kGenericNetworkIcon = FOUR_CHAR_CODE('gnet')
|
||||
kIPFileServerIcon = FOUR_CHAR_CODE('isrv')
|
||||
kToolbarCustomizeIcon = FOUR_CHAR_CODE('tcus')
|
||||
kToolbarDeleteIcon = FOUR_CHAR_CODE('tdel')
|
||||
kToolbarFavoritesIcon = FOUR_CHAR_CODE('tfav')
|
||||
kToolbarHomeIcon = FOUR_CHAR_CODE('thom')
|
||||
kAppleLogoIcon = FOUR_CHAR_CODE('capl')
|
||||
kAppleMenuIcon = FOUR_CHAR_CODE('sapl')
|
||||
kBackwardArrowIcon = FOUR_CHAR_CODE('baro')
|
||||
kFavoriteItemsIcon = FOUR_CHAR_CODE('favr')
|
||||
kForwardArrowIcon = FOUR_CHAR_CODE('faro')
|
||||
kGridIcon = FOUR_CHAR_CODE('grid')
|
||||
kHelpIcon = FOUR_CHAR_CODE('help')
|
||||
kKeepArrangedIcon = FOUR_CHAR_CODE('arng')
|
||||
kLockedIcon = FOUR_CHAR_CODE('lock')
|
||||
kNoFilesIcon = FOUR_CHAR_CODE('nfil')
|
||||
kNoFolderIcon = FOUR_CHAR_CODE('nfld')
|
||||
kNoWriteIcon = FOUR_CHAR_CODE('nwrt')
|
||||
kProtectedApplicationFolderIcon = FOUR_CHAR_CODE('papp')
|
||||
kProtectedSystemFolderIcon = FOUR_CHAR_CODE('psys')
|
||||
kRecentItemsIcon = FOUR_CHAR_CODE('rcnt')
|
||||
kShortcutIcon = FOUR_CHAR_CODE('shrt')
|
||||
kSortAscendingIcon = FOUR_CHAR_CODE('asnd')
|
||||
kSortDescendingIcon = FOUR_CHAR_CODE('dsnd')
|
||||
kUnlockedIcon = FOUR_CHAR_CODE('ulck')
|
||||
kConnectToIcon = FOUR_CHAR_CODE('cnct')
|
||||
kGenericWindowIcon = FOUR_CHAR_CODE('gwin')
|
||||
kQuestionMarkIcon = FOUR_CHAR_CODE('ques')
|
||||
kDeleteAliasIcon = FOUR_CHAR_CODE('dali')
|
||||
kEjectMediaIcon = FOUR_CHAR_CODE('ejec')
|
||||
kBurningIcon = FOUR_CHAR_CODE('burn')
|
||||
kRightContainerArrowIcon = FOUR_CHAR_CODE('rcar')
|
||||
kIconServicesNormalUsageFlag = 0
|
||||
kIconServicesCatalogInfoMask = (kFSCatInfoNodeID | kFSCatInfoParentDirID | kFSCatInfoVolume | kFSCatInfoNodeFlags | kFSCatInfoFinderInfo | kFSCatInfoFinderXInfo | kFSCatInfoUserAccess)
|
||||
kPlotIconRefNormalFlags = 0L
|
||||
kPlotIconRefNoImage = (1 << 1)
|
||||
kPlotIconRefNoMask = (1 << 2)
|
||||
kIconFamilyType = FOUR_CHAR_CODE('icns')
|
||||
1
Darwin/lib/python2.7/plat-mac/Carbon/Launch.py
Normal file
1
Darwin/lib/python2.7/plat-mac/Carbon/Launch.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
from _Launch import *
|
||||
74
Darwin/lib/python2.7/plat-mac/Carbon/LaunchServices.py
Normal file
74
Darwin/lib/python2.7/plat-mac/Carbon/LaunchServices.py
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
# Generated from 'LaunchServices.h'
|
||||
|
||||
def FOUR_CHAR_CODE(x): return x
|
||||
from Carbon.Files import *
|
||||
kLSRequestAllInfo = -1
|
||||
kLSRolesAll = -1
|
||||
kLSUnknownType = FOUR_CHAR_CODE('\0\0\0\0')
|
||||
kLSUnknownCreator = FOUR_CHAR_CODE('\0\0\0\0')
|
||||
kLSInvalidExtensionIndex = -1
|
||||
kLSUnknownErr = -10810
|
||||
kLSNotAnApplicationErr = -10811
|
||||
kLSNotInitializedErr = -10812
|
||||
kLSDataUnavailableErr = -10813
|
||||
kLSApplicationNotFoundErr = -10814
|
||||
kLSUnknownTypeErr = -10815
|
||||
kLSDataTooOldErr = -10816
|
||||
kLSDataErr = -10817
|
||||
kLSLaunchInProgressErr = -10818
|
||||
kLSNotRegisteredErr = -10819
|
||||
kLSAppDoesNotClaimTypeErr = -10820
|
||||
kLSAppDoesNotSupportSchemeWarning = -10821
|
||||
kLSServerCommunicationErr = -10822
|
||||
kLSCannotSetInfoErr = -10823
|
||||
kLSInitializeDefaults = 0x00000001
|
||||
kLSMinCatInfoBitmap = (kFSCatInfoNodeFlags | kFSCatInfoParentDirID | kFSCatInfoFinderInfo | kFSCatInfoFinderXInfo)
|
||||
# kLSInvalidExtensionIndex = (unsigned long)0xFFFFFFFF
|
||||
kLSRequestExtension = 0x00000001
|
||||
kLSRequestTypeCreator = 0x00000002
|
||||
kLSRequestBasicFlagsOnly = 0x00000004
|
||||
kLSRequestAppTypeFlags = 0x00000008
|
||||
kLSRequestAllFlags = 0x00000010
|
||||
kLSRequestIconAndKind = 0x00000020
|
||||
kLSRequestExtensionFlagsOnly = 0x00000040
|
||||
# kLSRequestAllInfo = (unsigned long)0xFFFFFFFF
|
||||
kLSItemInfoIsPlainFile = 0x00000001
|
||||
kLSItemInfoIsPackage = 0x00000002
|
||||
kLSItemInfoIsApplication = 0x00000004
|
||||
kLSItemInfoIsContainer = 0x00000008
|
||||
kLSItemInfoIsAliasFile = 0x00000010
|
||||
kLSItemInfoIsSymlink = 0x00000020
|
||||
kLSItemInfoIsInvisible = 0x00000040
|
||||
kLSItemInfoIsNativeApp = 0x00000080
|
||||
kLSItemInfoIsClassicApp = 0x00000100
|
||||
kLSItemInfoAppPrefersNative = 0x00000200
|
||||
kLSItemInfoAppPrefersClassic = 0x00000400
|
||||
kLSItemInfoAppIsScriptable = 0x00000800
|
||||
kLSItemInfoIsVolume = 0x00001000
|
||||
kLSItemInfoExtensionIsHidden = 0x00100000
|
||||
kLSRolesNone = 0x00000001
|
||||
kLSRolesViewer = 0x00000002
|
||||
kLSRolesEditor = 0x00000004
|
||||
# kLSRolesAll = (unsigned long)0xFFFFFFFF
|
||||
kLSUnknownKindID = 0
|
||||
# kLSUnknownType = 0
|
||||
# kLSUnknownCreator = 0
|
||||
kLSAcceptDefault = 0x00000001
|
||||
kLSAcceptAllowLoginUI = 0x00000002
|
||||
kLSLaunchDefaults = 0x00000001
|
||||
kLSLaunchAndPrint = 0x00000002
|
||||
kLSLaunchReserved2 = 0x00000004
|
||||
kLSLaunchReserved3 = 0x00000008
|
||||
kLSLaunchReserved4 = 0x00000010
|
||||
kLSLaunchReserved5 = 0x00000020
|
||||
kLSLaunchReserved6 = 0x00000040
|
||||
kLSLaunchInhibitBGOnly = 0x00000080
|
||||
kLSLaunchDontAddToRecents = 0x00000100
|
||||
kLSLaunchDontSwitch = 0x00000200
|
||||
kLSLaunchNoParams = 0x00000800
|
||||
kLSLaunchAsync = 0x00010000
|
||||
kLSLaunchStartClassic = 0x00020000
|
||||
kLSLaunchInClassic = 0x00040000
|
||||
kLSLaunchNewInstance = 0x00080000
|
||||
kLSLaunchAndHide = 0x00100000
|
||||
kLSLaunchAndHideOthers = 0x00200000
|
||||
1
Darwin/lib/python2.7/plat-mac/Carbon/List.py
Normal file
1
Darwin/lib/python2.7/plat-mac/Carbon/List.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
from _List import *
|
||||
35
Darwin/lib/python2.7/plat-mac/Carbon/Lists.py
Normal file
35
Darwin/lib/python2.7/plat-mac/Carbon/Lists.py
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
# Generated from 'Lists.h'
|
||||
|
||||
def FOUR_CHAR_CODE(x): return x
|
||||
listNotifyNothing = FOUR_CHAR_CODE('nada')
|
||||
listNotifyClick = FOUR_CHAR_CODE('clik')
|
||||
listNotifyDoubleClick = FOUR_CHAR_CODE('dblc')
|
||||
listNotifyPreClick = FOUR_CHAR_CODE('pclk')
|
||||
lDrawingModeOffBit = 3
|
||||
lDoVAutoscrollBit = 1
|
||||
lDoHAutoscrollBit = 0
|
||||
lDrawingModeOff = 8
|
||||
lDoVAutoscroll = 2
|
||||
lDoHAutoscroll = 1
|
||||
lOnlyOneBit = 7
|
||||
lExtendDragBit = 6
|
||||
lNoDisjointBit = 5
|
||||
lNoExtendBit = 4
|
||||
lNoRectBit = 3
|
||||
lUseSenseBit = 2
|
||||
lNoNilHiliteBit = 1
|
||||
lOnlyOne = -128
|
||||
lExtendDrag = 64
|
||||
lNoDisjoint = 32
|
||||
lNoExtend = 16
|
||||
lNoRect = 8
|
||||
lUseSense = 4
|
||||
lNoNilHilite = 2
|
||||
lInitMsg = 0
|
||||
lDrawMsg = 1
|
||||
lHiliteMsg = 2
|
||||
lCloseMsg = 3
|
||||
kListDefProcPtr = 0
|
||||
kListDefUserProcType = kListDefProcPtr
|
||||
kListDefStandardTextType = 1
|
||||
kListDefStandardIconType = 2
|
||||
58
Darwin/lib/python2.7/plat-mac/Carbon/MacHelp.py
Normal file
58
Darwin/lib/python2.7/plat-mac/Carbon/MacHelp.py
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
# Generated from 'MacHelp.h'
|
||||
|
||||
def FOUR_CHAR_CODE(x): return x
|
||||
kMacHelpVersion = 0x0003
|
||||
kHMSupplyContent = 0
|
||||
kHMDisposeContent = 1
|
||||
kHMNoContent = FOUR_CHAR_CODE('none')
|
||||
kHMCFStringContent = FOUR_CHAR_CODE('cfst')
|
||||
kHMPascalStrContent = FOUR_CHAR_CODE('pstr')
|
||||
kHMStringResContent = FOUR_CHAR_CODE('str#')
|
||||
kHMTEHandleContent = FOUR_CHAR_CODE('txth')
|
||||
kHMTextResContent = FOUR_CHAR_CODE('text')
|
||||
kHMStrResContent = FOUR_CHAR_CODE('str ')
|
||||
kHMDefaultSide = 0
|
||||
kHMOutsideTopScriptAligned = 1
|
||||
kHMOutsideLeftCenterAligned = 2
|
||||
kHMOutsideBottomScriptAligned = 3
|
||||
kHMOutsideRightCenterAligned = 4
|
||||
kHMOutsideTopLeftAligned = 5
|
||||
kHMOutsideTopRightAligned = 6
|
||||
kHMOutsideLeftTopAligned = 7
|
||||
kHMOutsideLeftBottomAligned = 8
|
||||
kHMOutsideBottomLeftAligned = 9
|
||||
kHMOutsideBottomRightAligned = 10
|
||||
kHMOutsideRightTopAligned = 11
|
||||
kHMOutsideRightBottomAligned = 12
|
||||
kHMOutsideTopCenterAligned = 13
|
||||
kHMOutsideBottomCenterAligned = 14
|
||||
kHMInsideRightCenterAligned = 15
|
||||
kHMInsideLeftCenterAligned = 16
|
||||
kHMInsideBottomCenterAligned = 17
|
||||
kHMInsideTopCenterAligned = 18
|
||||
kHMInsideTopLeftCorner = 19
|
||||
kHMInsideTopRightCorner = 20
|
||||
kHMInsideBottomLeftCorner = 21
|
||||
kHMInsideBottomRightCorner = 22
|
||||
kHMAbsoluteCenterAligned = 23
|
||||
kHMTopSide = kHMOutsideTopScriptAligned
|
||||
kHMLeftSide = kHMOutsideLeftCenterAligned
|
||||
kHMBottomSide = kHMOutsideBottomScriptAligned
|
||||
kHMRightSide = kHMOutsideRightCenterAligned
|
||||
kHMTopLeftCorner = kHMOutsideTopLeftAligned
|
||||
kHMTopRightCorner = kHMOutsideTopRightAligned
|
||||
kHMLeftTopCorner = kHMOutsideLeftTopAligned
|
||||
kHMLeftBottomCorner = kHMOutsideLeftBottomAligned
|
||||
kHMBottomLeftCorner = kHMOutsideBottomLeftAligned
|
||||
kHMBottomRightCorner = kHMOutsideBottomRightAligned
|
||||
kHMRightTopCorner = kHMOutsideRightTopAligned
|
||||
kHMRightBottomCorner = kHMOutsideRightBottomAligned
|
||||
kHMContentProvided = 0
|
||||
kHMContentNotProvided = 1
|
||||
kHMContentNotProvidedDontPropagate = 2
|
||||
kHMMinimumContentIndex = 0
|
||||
kHMMaximumContentIndex = 1
|
||||
errHMIllegalContentForMinimumState = -10980
|
||||
errHMIllegalContentForMaximumState = -10981
|
||||
kHMIllegalContentForMinimumState = errHMIllegalContentForMinimumState
|
||||
kHelpTagEventHandlerTag = FOUR_CHAR_CODE('hevt')
|
||||
226
Darwin/lib/python2.7/plat-mac/Carbon/MacTextEditor.py
Normal file
226
Darwin/lib/python2.7/plat-mac/Carbon/MacTextEditor.py
Normal file
|
|
@ -0,0 +1,226 @@
|
|||
# Generated from 'MacTextEditor.h'
|
||||
|
||||
|
||||
def FOUR_CHAR_CODE(x): return x
|
||||
false = 0
|
||||
true = 1
|
||||
kTXNClearThisControl = 0xFFFFFFFF
|
||||
kTXNClearTheseFontFeatures = 0x80000000
|
||||
kTXNDontCareTypeSize = 0xFFFFFFFF
|
||||
kTXNDecrementTypeSize = 0x80000000
|
||||
kTXNUseCurrentSelection = 0xFFFFFFFF
|
||||
kTXNStartOffset = 0
|
||||
kTXNEndOffset = 0x7FFFFFFF
|
||||
MovieFileType = FOUR_CHAR_CODE('moov')
|
||||
kTXNUseEncodingWordRulesMask = 0x80000000
|
||||
kTXNFontSizeAttributeSize = 4
|
||||
normal = 0
|
||||
kTXNWillDefaultToATSUIBit = 0
|
||||
kTXNWillDefaultToCarbonEventBit = 1
|
||||
kTXNWillDefaultToATSUIMask = 1L << kTXNWillDefaultToATSUIBit
|
||||
kTXNWillDefaultToCarbonEventMask = 1L << kTXNWillDefaultToCarbonEventBit
|
||||
kTXNWantMoviesBit = 0
|
||||
kTXNWantSoundBit = 1
|
||||
kTXNWantGraphicsBit = 2
|
||||
kTXNAlwaysUseQuickDrawTextBit = 3
|
||||
kTXNUseTemporaryMemoryBit = 4
|
||||
kTXNWantMoviesMask = 1L << kTXNWantMoviesBit
|
||||
kTXNWantSoundMask = 1L << kTXNWantSoundBit
|
||||
kTXNWantGraphicsMask = 1L << kTXNWantGraphicsBit
|
||||
kTXNAlwaysUseQuickDrawTextMask = 1L << kTXNAlwaysUseQuickDrawTextBit
|
||||
kTXNUseTemporaryMemoryMask = 1L << kTXNUseTemporaryMemoryBit
|
||||
kTXNDrawGrowIconBit = 0
|
||||
kTXNShowWindowBit = 1
|
||||
kTXNWantHScrollBarBit = 2
|
||||
kTXNWantVScrollBarBit = 3
|
||||
kTXNNoTSMEverBit = 4
|
||||
kTXNReadOnlyBit = 5
|
||||
kTXNNoKeyboardSyncBit = 6
|
||||
kTXNNoSelectionBit = 7
|
||||
kTXNSaveStylesAsSTYLResourceBit = 8
|
||||
kOutputTextInUnicodeEncodingBit = 9
|
||||
kTXNDoNotInstallDragProcsBit = 10
|
||||
kTXNAlwaysWrapAtViewEdgeBit = 11
|
||||
kTXNDontDrawCaretWhenInactiveBit = 12
|
||||
kTXNDontDrawSelectionWhenInactiveBit = 13
|
||||
kTXNSingleLineOnlyBit = 14
|
||||
kTXNDisableDragAndDropBit = 15
|
||||
kTXNUseQDforImagingBit = 16
|
||||
kTXNDrawGrowIconMask = 1L << kTXNDrawGrowIconBit
|
||||
kTXNShowWindowMask = 1L << kTXNShowWindowBit
|
||||
kTXNWantHScrollBarMask = 1L << kTXNWantHScrollBarBit
|
||||
kTXNWantVScrollBarMask = 1L << kTXNWantVScrollBarBit
|
||||
kTXNNoTSMEverMask = 1L << kTXNNoTSMEverBit
|
||||
kTXNReadOnlyMask = 1L << kTXNReadOnlyBit
|
||||
kTXNNoKeyboardSyncMask = 1L << kTXNNoKeyboardSyncBit
|
||||
kTXNNoSelectionMask = 1L << kTXNNoSelectionBit
|
||||
kTXNSaveStylesAsSTYLResourceMask = 1L << kTXNSaveStylesAsSTYLResourceBit
|
||||
kOutputTextInUnicodeEncodingMask = 1L << kOutputTextInUnicodeEncodingBit
|
||||
kTXNDoNotInstallDragProcsMask = 1L << kTXNDoNotInstallDragProcsBit
|
||||
kTXNAlwaysWrapAtViewEdgeMask = 1L << kTXNAlwaysWrapAtViewEdgeBit
|
||||
kTXNDontDrawCaretWhenInactiveMask = 1L << kTXNDontDrawCaretWhenInactiveBit
|
||||
kTXNDontDrawSelectionWhenInactiveMask = 1L << kTXNDontDrawSelectionWhenInactiveBit
|
||||
kTXNSingleLineOnlyMask = 1L << kTXNSingleLineOnlyBit
|
||||
kTXNDisableDragAndDropMask = 1L << kTXNDisableDragAndDropBit
|
||||
kTXNUseQDforImagingMask = 1L << kTXNUseQDforImagingBit
|
||||
kTXNSetFlushnessBit = 0
|
||||
kTXNSetJustificationBit = 1
|
||||
kTXNUseFontFallBackBit = 2
|
||||
kTXNRotateTextBit = 3
|
||||
kTXNUseVerticalTextBit = 4
|
||||
kTXNDontUpdateBoxRectBit = 5
|
||||
kTXNDontDrawTextBit = 6
|
||||
kTXNUseCGContextRefBit = 7
|
||||
kTXNImageWithQDBit = 8
|
||||
kTXNDontWrapTextBit = 9
|
||||
kTXNSetFlushnessMask = 1L << kTXNSetFlushnessBit
|
||||
kTXNSetJustificationMask = 1L << kTXNSetJustificationBit
|
||||
kTXNUseFontFallBackMask = 1L << kTXNUseFontFallBackBit
|
||||
kTXNRotateTextMask = 1L << kTXNRotateTextBit
|
||||
kTXNUseVerticalTextMask = 1L << kTXNUseVerticalTextBit
|
||||
kTXNDontUpdateBoxRectMask = 1L << kTXNDontUpdateBoxRectBit
|
||||
kTXNDontDrawTextMask = 1L << kTXNDontDrawTextBit
|
||||
kTXNUseCGContextRefMask = 1L << kTXNUseCGContextRefBit
|
||||
kTXNImageWithQDMask = 1L << kTXNImageWithQDBit
|
||||
kTXNDontWrapTextMask = 1L << kTXNDontWrapTextBit
|
||||
kTXNFontContinuousBit = 0
|
||||
kTXNSizeContinuousBit = 1
|
||||
kTXNStyleContinuousBit = 2
|
||||
kTXNColorContinuousBit = 3
|
||||
kTXNFontContinuousMask = 1L << kTXNFontContinuousBit
|
||||
kTXNSizeContinuousMask = 1L << kTXNSizeContinuousBit
|
||||
kTXNStyleContinuousMask = 1L << kTXNStyleContinuousBit
|
||||
kTXNColorContinuousMask = 1L << kTXNColorContinuousBit
|
||||
kTXNIgnoreCaseBit = 0
|
||||
kTXNEntireWordBit = 1
|
||||
kTXNUseEncodingWordRulesBit = 31
|
||||
kTXNIgnoreCaseMask = 1L << kTXNIgnoreCaseBit
|
||||
kTXNEntireWordMask = 1L << kTXNEntireWordBit
|
||||
# kTXNUseEncodingWordRulesMask = (unsigned long)(1L << kTXNUseEncodingWordRulesBit)
|
||||
kTXNTextensionFile = FOUR_CHAR_CODE('txtn')
|
||||
kTXNTextFile = FOUR_CHAR_CODE('TEXT')
|
||||
kTXNPictureFile = FOUR_CHAR_CODE('PICT')
|
||||
kTXNMovieFile = FOUR_CHAR_CODE('MooV')
|
||||
kTXNSoundFile = FOUR_CHAR_CODE('sfil')
|
||||
kTXNAIFFFile = FOUR_CHAR_CODE('AIFF')
|
||||
kTXNUnicodeTextFile = FOUR_CHAR_CODE('utxt')
|
||||
kTXNTextEditStyleFrameType = 1
|
||||
kTXNPageFrameType = 2
|
||||
kTXNMultipleFrameType = 3
|
||||
kTXNTextData = FOUR_CHAR_CODE('TEXT')
|
||||
kTXNPictureData = FOUR_CHAR_CODE('PICT')
|
||||
kTXNMovieData = FOUR_CHAR_CODE('moov')
|
||||
kTXNSoundData = FOUR_CHAR_CODE('snd ')
|
||||
kTXNUnicodeTextData = FOUR_CHAR_CODE('utxt')
|
||||
kTXNLineDirectionTag = FOUR_CHAR_CODE('lndr')
|
||||
kTXNJustificationTag = FOUR_CHAR_CODE('just')
|
||||
kTXNIOPrivilegesTag = FOUR_CHAR_CODE('iopv')
|
||||
kTXNSelectionStateTag = FOUR_CHAR_CODE('slst')
|
||||
kTXNInlineStateTag = FOUR_CHAR_CODE('inst')
|
||||
kTXNWordWrapStateTag = FOUR_CHAR_CODE('wwrs')
|
||||
kTXNKeyboardSyncStateTag = FOUR_CHAR_CODE('kbsy')
|
||||
kTXNAutoIndentStateTag = FOUR_CHAR_CODE('auin')
|
||||
kTXNTabSettingsTag = FOUR_CHAR_CODE('tabs')
|
||||
kTXNRefConTag = FOUR_CHAR_CODE('rfcn')
|
||||
kTXNMarginsTag = FOUR_CHAR_CODE('marg')
|
||||
kTXNFlattenMoviesTag = FOUR_CHAR_CODE('flat')
|
||||
kTXNDoFontSubstitution = FOUR_CHAR_CODE('fSub')
|
||||
kTXNNoUserIOTag = FOUR_CHAR_CODE('nuio')
|
||||
kTXNUseCarbonEvents = FOUR_CHAR_CODE('cbcb')
|
||||
kTXNDrawCaretWhenInactiveTag = FOUR_CHAR_CODE('dcrt')
|
||||
kTXNDrawSelectionWhenInactiveTag = FOUR_CHAR_CODE('dsln')
|
||||
kTXNDisableDragAndDropTag = FOUR_CHAR_CODE('drag')
|
||||
kTXNTypingAction = 0
|
||||
kTXNCutAction = 1
|
||||
kTXNPasteAction = 2
|
||||
kTXNClearAction = 3
|
||||
kTXNChangeFontAction = 4
|
||||
kTXNChangeFontColorAction = 5
|
||||
kTXNChangeFontSizeAction = 6
|
||||
kTXNChangeStyleAction = 7
|
||||
kTXNAlignLeftAction = 8
|
||||
kTXNAlignCenterAction = 9
|
||||
kTXNAlignRightAction = 10
|
||||
kTXNDropAction = 11
|
||||
kTXNMoveAction = 12
|
||||
kTXNFontFeatureAction = 13
|
||||
kTXNFontVariationAction = 14
|
||||
kTXNUndoLastAction = 1024
|
||||
# kTXNClearThisControl = (long)0xFFFFFFFF
|
||||
# kTXNClearTheseFontFeatures = (long)0x80000000
|
||||
kTXNReadWrite = false
|
||||
kTXNReadOnly = true
|
||||
kTXNSelectionOn = true
|
||||
kTXNSelectionOff = false
|
||||
kTXNUseInline = false
|
||||
kTXNUseBottomline = true
|
||||
kTXNAutoWrap = false
|
||||
kTXNNoAutoWrap = true
|
||||
kTXNSyncKeyboard = false
|
||||
kTXNNoSyncKeyboard = true
|
||||
kTXNAutoIndentOff = false
|
||||
kTXNAutoIndentOn = true
|
||||
kTXNDontDrawCaretWhenInactive = false
|
||||
kTXNDrawCaretWhenInactive = true
|
||||
kTXNDontDrawSelectionWhenInactive = false
|
||||
kTXNDrawSelectionWhenInactive = true
|
||||
kTXNEnableDragAndDrop = false
|
||||
kTXNDisableDragAndDrop = true
|
||||
kTXNRightTab = -1
|
||||
kTXNLeftTab = 0
|
||||
kTXNCenterTab = 1
|
||||
kTXNLeftToRight = 0
|
||||
kTXNRightToLeft = 1
|
||||
kTXNFlushDefault = 0
|
||||
kTXNFlushLeft = 1
|
||||
kTXNFlushRight = 2
|
||||
kTXNCenter = 4
|
||||
kTXNFullJust = 8
|
||||
kTXNForceFullJust = 16
|
||||
kScrollBarsAlwaysActive = true
|
||||
kScrollBarsSyncWithFocus = false
|
||||
# kTXNDontCareTypeSize = (long)0xFFFFFFFF
|
||||
kTXNDontCareTypeStyle = 0xFF
|
||||
kTXNIncrementTypeSize = 0x00000001
|
||||
# kTXNDecrementTypeSize = (long)0x80000000
|
||||
kTXNUseScriptDefaultValue = -1
|
||||
kTXNNoFontVariations = 0x7FFF
|
||||
# kTXNUseCurrentSelection = (unsigned long)0xFFFFFFFF
|
||||
# kTXNStartOffset = 0
|
||||
# kTXNEndOffset = 0x7FFFFFFF
|
||||
kTXNSingleStylePerTextDocumentResType = FOUR_CHAR_CODE('MPSR')
|
||||
kTXNMultipleStylesPerTextDocumentResType = FOUR_CHAR_CODE('styl')
|
||||
kTXNShowStart = false
|
||||
kTXNShowEnd = true
|
||||
kTXNDefaultFontName = 0
|
||||
kTXNDefaultFontSize = 0x000C0000
|
||||
kTXNDefaultFontStyle = normal
|
||||
kTXNQDFontNameAttribute = FOUR_CHAR_CODE('fntn')
|
||||
kTXNQDFontFamilyIDAttribute = FOUR_CHAR_CODE('font')
|
||||
kTXNQDFontSizeAttribute = FOUR_CHAR_CODE('size')
|
||||
kTXNQDFontStyleAttribute = FOUR_CHAR_CODE('face')
|
||||
kTXNQDFontColorAttribute = FOUR_CHAR_CODE('klor')
|
||||
kTXNTextEncodingAttribute = FOUR_CHAR_CODE('encd')
|
||||
kTXNATSUIFontFeaturesAttribute = FOUR_CHAR_CODE('atfe')
|
||||
kTXNATSUIFontVariationsAttribute = FOUR_CHAR_CODE('atva')
|
||||
# kTXNQDFontNameAttributeSize = sizeof(Str255)
|
||||
# kTXNQDFontFamilyIDAttributeSize = sizeof(SInt16)
|
||||
# kTXNQDFontSizeAttributeSize = sizeof(SInt16)
|
||||
# kTXNQDFontStyleAttributeSize = sizeof(Style)
|
||||
# kTXNQDFontColorAttributeSize = sizeof(RGBColor)
|
||||
# kTXNTextEncodingAttributeSize = sizeof(TextEncoding)
|
||||
# kTXNFontSizeAttributeSize = sizeof(Fixed)
|
||||
kTXNSystemDefaultEncoding = 0
|
||||
kTXNMacOSEncoding = 1
|
||||
kTXNUnicodeEncoding = 2
|
||||
kTXNBackgroundTypeRGB = 1
|
||||
kTXNTextInputCountBit = 0
|
||||
kTXNRunCountBit = 1
|
||||
kTXNTextInputCountMask = 1L << kTXNTextInputCountBit
|
||||
kTXNRunCountMask = 1L << kTXNRunCountBit
|
||||
kTXNAllCountMask = kTXNTextInputCountMask | kTXNRunCountMask
|
||||
kTXNNoAppleEventHandlersBit = 0
|
||||
kTXNRestartAppleEventHandlersBit = 1
|
||||
kTXNNoAppleEventHandlersMask = 1 << kTXNNoAppleEventHandlersBit
|
||||
kTXNRestartAppleEventHandlersMask = 1 << kTXNRestartAppleEventHandlersBit
|
||||
# status = TXNInitTextension( &defaults
|
||||
97
Darwin/lib/python2.7/plat-mac/Carbon/MediaDescr.py
Normal file
97
Darwin/lib/python2.7/plat-mac/Carbon/MediaDescr.py
Normal file
|
|
@ -0,0 +1,97 @@
|
|||
# Parsers/generators for QuickTime media descriptions
|
||||
import struct
|
||||
|
||||
Error = 'MediaDescr.Error'
|
||||
|
||||
class _MediaDescriptionCodec:
|
||||
def __init__(self, trunc, size, names, fmt):
|
||||
self.trunc = trunc
|
||||
self.size = size
|
||||
self.names = names
|
||||
self.fmt = fmt
|
||||
|
||||
def decode(self, data):
|
||||
if self.trunc:
|
||||
data = data[:self.size]
|
||||
values = struct.unpack(self.fmt, data)
|
||||
if len(values) != len(self.names):
|
||||
raise Error, ('Format length does not match number of names')
|
||||
rv = {}
|
||||
for i in range(len(values)):
|
||||
name = self.names[i]
|
||||
value = values[i]
|
||||
if type(name) == type(()):
|
||||
name, cod, dec = name
|
||||
value = dec(value)
|
||||
rv[name] = value
|
||||
return rv
|
||||
|
||||
def encode(self, dict):
|
||||
list = [self.fmt]
|
||||
for name in self.names:
|
||||
if type(name) == type(()):
|
||||
name, cod, dec = name
|
||||
else:
|
||||
cod = dec = None
|
||||
value = dict[name]
|
||||
if cod:
|
||||
value = cod(value)
|
||||
list.append(value)
|
||||
rv = struct.pack(*list)
|
||||
return rv
|
||||
|
||||
# Helper functions
|
||||
def _tofixed(float):
|
||||
hi = int(float)
|
||||
lo = int(float*0x10000) & 0xffff
|
||||
return (hi<<16)|lo
|
||||
|
||||
def _fromfixed(fixed):
|
||||
hi = (fixed >> 16) & 0xffff
|
||||
lo = (fixed & 0xffff)
|
||||
return hi + (lo / float(0x10000))
|
||||
|
||||
def _tostr31(str):
|
||||
return chr(len(str)) + str + '\0'*(31-len(str))
|
||||
|
||||
def _fromstr31(str31):
|
||||
return str31[1:1+ord(str31[0])]
|
||||
|
||||
SampleDescription = _MediaDescriptionCodec(
|
||||
1, # May be longer, truncate
|
||||
16, # size
|
||||
('descSize', 'dataFormat', 'resvd1', 'resvd2', 'dataRefIndex'), # Attributes
|
||||
"l4slhh" # Format
|
||||
)
|
||||
|
||||
SoundDescription = _MediaDescriptionCodec(
|
||||
1,
|
||||
36,
|
||||
('descSize', 'dataFormat', 'resvd1', 'resvd2', 'dataRefIndex',
|
||||
'version', 'revlevel', 'vendor', 'numChannels', 'sampleSize',
|
||||
'compressionID', 'packetSize', ('sampleRate', _tofixed, _fromfixed)),
|
||||
"l4slhhhh4shhhhl" # Format
|
||||
)
|
||||
|
||||
SoundDescriptionV1 = _MediaDescriptionCodec(
|
||||
1,
|
||||
52,
|
||||
('descSize', 'dataFormat', 'resvd1', 'resvd2', 'dataRefIndex',
|
||||
'version', 'revlevel', 'vendor', 'numChannels', 'sampleSize',
|
||||
'compressionID', 'packetSize', ('sampleRate', _tofixed, _fromfixed), 'samplesPerPacket',
|
||||
'bytesPerPacket', 'bytesPerFrame', 'bytesPerSample'),
|
||||
"l4slhhhh4shhhhlllll" # Format
|
||||
)
|
||||
|
||||
ImageDescription = _MediaDescriptionCodec(
|
||||
1, # May be longer, truncate
|
||||
86, # size
|
||||
('idSize', 'cType', 'resvd1', 'resvd2', 'dataRefIndex', 'version',
|
||||
'revisionLevel', 'vendor', 'temporalQuality', 'spatialQuality',
|
||||
'width', 'height', ('hRes', _tofixed, _fromfixed), ('vRes', _tofixed, _fromfixed),
|
||||
'dataSize', 'frameCount', ('name', _tostr31, _fromstr31),
|
||||
'depth', 'clutID'),
|
||||
'l4slhhhh4sllhhlllh32shh',
|
||||
)
|
||||
|
||||
# XXXX Others, like TextDescription and such, remain to be done.
|
||||
1
Darwin/lib/python2.7/plat-mac/Carbon/Menu.py
Normal file
1
Darwin/lib/python2.7/plat-mac/Carbon/Menu.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
from _Menu import *
|
||||
169
Darwin/lib/python2.7/plat-mac/Carbon/Menus.py
Normal file
169
Darwin/lib/python2.7/plat-mac/Carbon/Menus.py
Normal file
|
|
@ -0,0 +1,169 @@
|
|||
# Generated from 'Menus.h'
|
||||
|
||||
def FOUR_CHAR_CODE(x): return x
|
||||
noMark = 0
|
||||
kMenuDrawMsg = 0
|
||||
kMenuSizeMsg = 2
|
||||
kMenuPopUpMsg = 3
|
||||
kMenuCalcItemMsg = 5
|
||||
kMenuThemeSavvyMsg = 7
|
||||
mDrawMsg = 0
|
||||
mSizeMsg = 2
|
||||
mPopUpMsg = 3
|
||||
mCalcItemMsg = 5
|
||||
mChooseMsg = 1
|
||||
mDrawItemMsg = 4
|
||||
kMenuChooseMsg = 1
|
||||
kMenuDrawItemMsg = 4
|
||||
kThemeSavvyMenuResponse = 0x7473
|
||||
kMenuInitMsg = 8
|
||||
kMenuDisposeMsg = 9
|
||||
kMenuFindItemMsg = 10
|
||||
kMenuHiliteItemMsg = 11
|
||||
kMenuDrawItemsMsg = 12
|
||||
textMenuProc = 0
|
||||
hMenuCmd = 27
|
||||
hierMenu = -1
|
||||
kInsertHierarchicalMenu = -1
|
||||
mctAllItems = -98
|
||||
mctLastIDIndic = -99
|
||||
kMenuStdMenuProc = 63
|
||||
kMenuStdMenuBarProc = 63
|
||||
kMenuNoModifiers = 0
|
||||
kMenuShiftModifier = (1 << 0)
|
||||
kMenuOptionModifier = (1 << 1)
|
||||
kMenuControlModifier = (1 << 2)
|
||||
kMenuNoCommandModifier = (1 << 3)
|
||||
kMenuNoIcon = 0
|
||||
kMenuIconType = 1
|
||||
kMenuShrinkIconType = 2
|
||||
kMenuSmallIconType = 3
|
||||
kMenuColorIconType = 4
|
||||
kMenuIconSuiteType = 5
|
||||
kMenuIconRefType = 6
|
||||
kMenuCGImageRefType = 7
|
||||
kMenuSystemIconSelectorType = 8
|
||||
kMenuIconResourceType = 9
|
||||
kMenuNullGlyph = 0x00
|
||||
kMenuTabRightGlyph = 0x02
|
||||
kMenuTabLeftGlyph = 0x03
|
||||
kMenuEnterGlyph = 0x04
|
||||
kMenuShiftGlyph = 0x05
|
||||
kMenuControlGlyph = 0x06
|
||||
kMenuOptionGlyph = 0x07
|
||||
kMenuSpaceGlyph = 0x09
|
||||
kMenuDeleteRightGlyph = 0x0A
|
||||
kMenuReturnGlyph = 0x0B
|
||||
kMenuReturnR2LGlyph = 0x0C
|
||||
kMenuNonmarkingReturnGlyph = 0x0D
|
||||
kMenuPencilGlyph = 0x0F
|
||||
kMenuDownwardArrowDashedGlyph = 0x10
|
||||
kMenuCommandGlyph = 0x11
|
||||
kMenuCheckmarkGlyph = 0x12
|
||||
kMenuDiamondGlyph = 0x13
|
||||
kMenuAppleLogoFilledGlyph = 0x14
|
||||
kMenuParagraphKoreanGlyph = 0x15
|
||||
kMenuDeleteLeftGlyph = 0x17
|
||||
kMenuLeftArrowDashedGlyph = 0x18
|
||||
kMenuUpArrowDashedGlyph = 0x19
|
||||
kMenuRightArrowDashedGlyph = 0x1A
|
||||
kMenuEscapeGlyph = 0x1B
|
||||
kMenuClearGlyph = 0x1C
|
||||
kMenuLeftDoubleQuotesJapaneseGlyph = 0x1D
|
||||
kMenuRightDoubleQuotesJapaneseGlyph = 0x1E
|
||||
kMenuTrademarkJapaneseGlyph = 0x1F
|
||||
kMenuBlankGlyph = 0x61
|
||||
kMenuPageUpGlyph = 0x62
|
||||
kMenuCapsLockGlyph = 0x63
|
||||
kMenuLeftArrowGlyph = 0x64
|
||||
kMenuRightArrowGlyph = 0x65
|
||||
kMenuNorthwestArrowGlyph = 0x66
|
||||
kMenuHelpGlyph = 0x67
|
||||
kMenuUpArrowGlyph = 0x68
|
||||
kMenuSoutheastArrowGlyph = 0x69
|
||||
kMenuDownArrowGlyph = 0x6A
|
||||
kMenuPageDownGlyph = 0x6B
|
||||
kMenuAppleLogoOutlineGlyph = 0x6C
|
||||
kMenuContextualMenuGlyph = 0x6D
|
||||
kMenuPowerGlyph = 0x6E
|
||||
kMenuF1Glyph = 0x6F
|
||||
kMenuF2Glyph = 0x70
|
||||
kMenuF3Glyph = 0x71
|
||||
kMenuF4Glyph = 0x72
|
||||
kMenuF5Glyph = 0x73
|
||||
kMenuF6Glyph = 0x74
|
||||
kMenuF7Glyph = 0x75
|
||||
kMenuF8Glyph = 0x76
|
||||
kMenuF9Glyph = 0x77
|
||||
kMenuF10Glyph = 0x78
|
||||
kMenuF11Glyph = 0x79
|
||||
kMenuF12Glyph = 0x7A
|
||||
kMenuF13Glyph = 0x87
|
||||
kMenuF14Glyph = 0x88
|
||||
kMenuF15Glyph = 0x89
|
||||
kMenuControlISOGlyph = 0x8A
|
||||
kMenuAttrExcludesMarkColumn = (1 << 0)
|
||||
kMenuAttrAutoDisable = (1 << 2)
|
||||
kMenuAttrUsePencilGlyph = (1 << 3)
|
||||
kMenuAttrHidden = (1 << 4)
|
||||
kMenuItemAttrDisabled = (1 << 0)
|
||||
kMenuItemAttrIconDisabled = (1 << 1)
|
||||
kMenuItemAttrSubmenuParentChoosable = (1 << 2)
|
||||
kMenuItemAttrDynamic = (1 << 3)
|
||||
kMenuItemAttrNotPreviousAlternate = (1 << 4)
|
||||
kMenuItemAttrHidden = (1 << 5)
|
||||
kMenuItemAttrSeparator = (1 << 6)
|
||||
kMenuItemAttrSectionHeader = (1 << 7)
|
||||
kMenuItemAttrIgnoreMeta = (1 << 8)
|
||||
kMenuItemAttrAutoRepeat = (1 << 9)
|
||||
kMenuItemAttrUseVirtualKey = (1 << 10)
|
||||
kMenuItemAttrCustomDraw = (1 << 11)
|
||||
kMenuItemAttrIncludeInCmdKeyMatching = (1 << 12)
|
||||
kMenuTrackingModeMouse = 1
|
||||
kMenuTrackingModeKeyboard = 2
|
||||
kMenuEventIncludeDisabledItems = 0x0001
|
||||
kMenuEventQueryOnly = 0x0002
|
||||
kMenuEventDontCheckSubmenus = 0x0004
|
||||
kMenuItemDataText = (1 << 0)
|
||||
kMenuItemDataMark = (1 << 1)
|
||||
kMenuItemDataCmdKey = (1 << 2)
|
||||
kMenuItemDataCmdKeyGlyph = (1 << 3)
|
||||
kMenuItemDataCmdKeyModifiers = (1 << 4)
|
||||
kMenuItemDataStyle = (1 << 5)
|
||||
kMenuItemDataEnabled = (1 << 6)
|
||||
kMenuItemDataIconEnabled = (1 << 7)
|
||||
kMenuItemDataIconID = (1 << 8)
|
||||
kMenuItemDataIconHandle = (1 << 9)
|
||||
kMenuItemDataCommandID = (1 << 10)
|
||||
kMenuItemDataTextEncoding = (1 << 11)
|
||||
kMenuItemDataSubmenuID = (1 << 12)
|
||||
kMenuItemDataSubmenuHandle = (1 << 13)
|
||||
kMenuItemDataFontID = (1 << 14)
|
||||
kMenuItemDataRefcon = (1 << 15)
|
||||
kMenuItemDataAttributes = (1 << 16)
|
||||
kMenuItemDataCFString = (1 << 17)
|
||||
kMenuItemDataProperties = (1 << 18)
|
||||
kMenuItemDataIndent = (1 << 19)
|
||||
kMenuItemDataCmdVirtualKey = (1 << 20)
|
||||
kMenuItemDataAllDataVersionOne = 0x000FFFFF
|
||||
kMenuItemDataAllDataVersionTwo = kMenuItemDataAllDataVersionOne | kMenuItemDataCmdVirtualKey
|
||||
kMenuDefProcPtr = 0
|
||||
kMenuPropertyPersistent = 0x00000001
|
||||
kHierarchicalFontMenuOption = 0x00000001
|
||||
gestaltContextualMenuAttr = FOUR_CHAR_CODE('cmnu')
|
||||
gestaltContextualMenuUnusedBit = 0
|
||||
gestaltContextualMenuTrapAvailable = 1
|
||||
gestaltContextualMenuHasAttributeAndModifierKeys = 2
|
||||
gestaltContextualMenuHasUnicodeSupport = 3
|
||||
kCMHelpItemNoHelp = 0
|
||||
kCMHelpItemAppleGuide = 1
|
||||
kCMHelpItemOtherHelp = 2
|
||||
kCMHelpItemRemoveHelp = 3
|
||||
kCMNothingSelected = 0
|
||||
kCMMenuItemSelected = 1
|
||||
kCMShowHelpSelected = 3
|
||||
keyContextualMenuName = FOUR_CHAR_CODE('pnam')
|
||||
keyContextualMenuCommandID = FOUR_CHAR_CODE('cmcd')
|
||||
keyContextualMenuSubmenu = FOUR_CHAR_CODE('cmsb')
|
||||
keyContextualMenuAttributes = FOUR_CHAR_CODE('cmat')
|
||||
keyContextualMenuModifiers = FOUR_CHAR_CODE('cmmd')
|
||||
1
Darwin/lib/python2.7/plat-mac/Carbon/Mlte.py
Normal file
1
Darwin/lib/python2.7/plat-mac/Carbon/Mlte.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
from _Mlte import *
|
||||
1
Darwin/lib/python2.7/plat-mac/Carbon/OSA.py
Normal file
1
Darwin/lib/python2.7/plat-mac/Carbon/OSA.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
from _OSA import *
|
||||
133
Darwin/lib/python2.7/plat-mac/Carbon/OSAconst.py
Normal file
133
Darwin/lib/python2.7/plat-mac/Carbon/OSAconst.py
Normal file
|
|
@ -0,0 +1,133 @@
|
|||
# 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
|
||||
kOSADebuggerCountVariables = 0x090C
|
||||
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
|
||||
eLocal = 0
|
||||
eGlobal = 1
|
||||
eProperties = 2
|
||||
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')
|
||||
47
Darwin/lib/python2.7/plat-mac/Carbon/QDOffscreen.py
Normal file
47
Darwin/lib/python2.7/plat-mac/Carbon/QDOffscreen.py
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
# Generated from 'QDOffscreen.h'
|
||||
|
||||
def FOUR_CHAR_CODE(x): return x
|
||||
pixPurgeBit = 0
|
||||
noNewDeviceBit = 1
|
||||
useTempMemBit = 2
|
||||
keepLocalBit = 3
|
||||
useDistantHdwrMemBit = 4
|
||||
useLocalHdwrMemBit = 5
|
||||
pixelsPurgeableBit = 6
|
||||
pixelsLockedBit = 7
|
||||
mapPixBit = 16
|
||||
newDepthBit = 17
|
||||
alignPixBit = 18
|
||||
newRowBytesBit = 19
|
||||
reallocPixBit = 20
|
||||
clipPixBit = 28
|
||||
stretchPixBit = 29
|
||||
ditherPixBit = 30
|
||||
gwFlagErrBit = 31
|
||||
pixPurge = 1L << pixPurgeBit
|
||||
noNewDevice = 1L << noNewDeviceBit
|
||||
useTempMem = 1L << useTempMemBit
|
||||
keepLocal = 1L << keepLocalBit
|
||||
useDistantHdwrMem = 1L << useDistantHdwrMemBit
|
||||
useLocalHdwrMem = 1L << useLocalHdwrMemBit
|
||||
pixelsPurgeable = 1L << pixelsPurgeableBit
|
||||
pixelsLocked = 1L << pixelsLockedBit
|
||||
kAllocDirectDrawSurface = 1L << 14
|
||||
mapPix = 1L << mapPixBit
|
||||
newDepth = 1L << newDepthBit
|
||||
alignPix = 1L << alignPixBit
|
||||
newRowBytes = 1L << newRowBytesBit
|
||||
reallocPix = 1L << reallocPixBit
|
||||
clipPix = 1L << clipPixBit
|
||||
stretchPix = 1L << stretchPixBit
|
||||
ditherPix = 1L << ditherPixBit
|
||||
gwFlagErr = 1L << gwFlagErrBit
|
||||
deviceIsIndirect = (1L << 0)
|
||||
deviceNeedsLock = (1L << 1)
|
||||
deviceIsStatic = (1L << 2)
|
||||
deviceIsExternalBuffer = (1L << 3)
|
||||
deviceIsDDSurface = (1L << 4)
|
||||
deviceIsDCISurface = (1L << 5)
|
||||
deviceIsGDISurface = (1L << 6)
|
||||
deviceIsAScreen = (1L << 7)
|
||||
deviceIsOverlaySurface = (1L << 8)
|
||||
1
Darwin/lib/python2.7/plat-mac/Carbon/Qd.py
Normal file
1
Darwin/lib/python2.7/plat-mac/Carbon/Qd.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
from _Qd import *
|
||||
1
Darwin/lib/python2.7/plat-mac/Carbon/Qdoffs.py
Normal file
1
Darwin/lib/python2.7/plat-mac/Carbon/Qdoffs.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
from _Qdoffs import *
|
||||
5
Darwin/lib/python2.7/plat-mac/Carbon/Qt.py
Normal file
5
Darwin/lib/python2.7/plat-mac/Carbon/Qt.py
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
from _Qt import *
|
||||
try:
|
||||
_ = AddFilePreview
|
||||
except:
|
||||
raise ImportError, "Old (2.3) _Qt.so module loaded in stead of new (2.4) _Qt.so"
|
||||
218
Darwin/lib/python2.7/plat-mac/Carbon/QuickDraw.py
Normal file
218
Darwin/lib/python2.7/plat-mac/Carbon/QuickDraw.py
Normal file
|
|
@ -0,0 +1,218 @@
|
|||
# Generated from 'QuickDraw.h'
|
||||
|
||||
|
||||
def FOUR_CHAR_CODE(x): return x
|
||||
normal = 0
|
||||
bold = 1
|
||||
italic = 2
|
||||
underline = 4
|
||||
outline = 8
|
||||
shadow = 0x10
|
||||
condense = 0x20
|
||||
extend = 0x40
|
||||
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
|
||||
hilitetransfermode = 50
|
||||
hilite = 50
|
||||
blend = 32
|
||||
addPin = 33
|
||||
addOver = 34
|
||||
subPin = 35
|
||||
addMax = 37
|
||||
adMax = 37
|
||||
subOver = 38
|
||||
adMin = 39
|
||||
ditherCopy = 64
|
||||
transparent = 36
|
||||
italicBit = 1
|
||||
ulineBit = 2
|
||||
outlineBit = 3
|
||||
shadowBit = 4
|
||||
condenseBit = 5
|
||||
extendBit = 6
|
||||
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
|
||||
clutType = 0
|
||||
fixedType = 1
|
||||
directType = 2
|
||||
gdDevType = 0
|
||||
interlacedDevice = 2
|
||||
hwMirroredDevice = 4
|
||||
roundedDevice = 5
|
||||
hasAuxMenuBar = 6
|
||||
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
|
||||
sysPatListID = 0
|
||||
iBeamCursor = 1
|
||||
crossCursor = 2
|
||||
plusCursor = 3
|
||||
watchCursor = 4
|
||||
kQDGrafVerbFrame = 0
|
||||
kQDGrafVerbPaint = 1
|
||||
kQDGrafVerbErase = 2
|
||||
kQDGrafVerbInvert = 3
|
||||
kQDGrafVerbFill = 4
|
||||
frame = kQDGrafVerbFrame
|
||||
paint = kQDGrafVerbPaint
|
||||
erase = kQDGrafVerbErase
|
||||
invert = kQDGrafVerbInvert
|
||||
fill = kQDGrafVerbFill
|
||||
chunky = 0
|
||||
chunkyPlanar = 1
|
||||
planar = 2
|
||||
singleDevicesBit = 0
|
||||
dontMatchSeedsBit = 1
|
||||
allDevicesBit = 2
|
||||
singleDevices = 1 << singleDevicesBit
|
||||
dontMatchSeeds = 1 << dontMatchSeedsBit
|
||||
allDevices = 1 << allDevicesBit
|
||||
kPrinterFontStatus = 0
|
||||
kPrinterScalingStatus = 1
|
||||
kNoConstraint = 0
|
||||
kVerticalConstraint = 1
|
||||
kHorizontalConstraint = 2
|
||||
k1MonochromePixelFormat = 0x00000001
|
||||
k2IndexedPixelFormat = 0x00000002
|
||||
k4IndexedPixelFormat = 0x00000004
|
||||
k8IndexedPixelFormat = 0x00000008
|
||||
k16BE555PixelFormat = 0x00000010
|
||||
k24RGBPixelFormat = 0x00000018
|
||||
k32ARGBPixelFormat = 0x00000020
|
||||
k1IndexedGrayPixelFormat = 0x00000021
|
||||
k2IndexedGrayPixelFormat = 0x00000022
|
||||
k4IndexedGrayPixelFormat = 0x00000024
|
||||
k8IndexedGrayPixelFormat = 0x00000028
|
||||
k16LE555PixelFormat = FOUR_CHAR_CODE('L555')
|
||||
k16LE5551PixelFormat = FOUR_CHAR_CODE('5551')
|
||||
k16BE565PixelFormat = FOUR_CHAR_CODE('B565')
|
||||
k16LE565PixelFormat = FOUR_CHAR_CODE('L565')
|
||||
k24BGRPixelFormat = FOUR_CHAR_CODE('24BG')
|
||||
k32BGRAPixelFormat = FOUR_CHAR_CODE('BGRA')
|
||||
k32ABGRPixelFormat = FOUR_CHAR_CODE('ABGR')
|
||||
k32RGBAPixelFormat = FOUR_CHAR_CODE('RGBA')
|
||||
kYUVSPixelFormat = FOUR_CHAR_CODE('yuvs')
|
||||
kYUVUPixelFormat = FOUR_CHAR_CODE('yuvu')
|
||||
kYVU9PixelFormat = FOUR_CHAR_CODE('YVU9')
|
||||
kYUV411PixelFormat = FOUR_CHAR_CODE('Y411')
|
||||
kYVYU422PixelFormat = FOUR_CHAR_CODE('YVYU')
|
||||
kUYVY422PixelFormat = FOUR_CHAR_CODE('UYVY')
|
||||
kYUV211PixelFormat = FOUR_CHAR_CODE('Y211')
|
||||
k2vuyPixelFormat = FOUR_CHAR_CODE('2vuy')
|
||||
kCursorImageMajorVersion = 0x0001
|
||||
kCursorImageMinorVersion = 0x0000
|
||||
kQDParseRegionFromTop = (1 << 0)
|
||||
kQDParseRegionFromBottom = (1 << 1)
|
||||
kQDParseRegionFromLeft = (1 << 2)
|
||||
kQDParseRegionFromRight = (1 << 3)
|
||||
kQDParseRegionFromTopLeft = kQDParseRegionFromTop | kQDParseRegionFromLeft
|
||||
kQDParseRegionFromBottomRight = kQDParseRegionFromBottom | kQDParseRegionFromRight
|
||||
kQDRegionToRectsMsgInit = 1
|
||||
kQDRegionToRectsMsgParse = 2
|
||||
kQDRegionToRectsMsgTerminate = 3
|
||||
colorXorXFer = 52
|
||||
noiseXFer = 53
|
||||
customXFer = 54
|
||||
kXFer1PixelAtATime = 0x00000001
|
||||
kXFerConvertPixelToRGB32 = 0x00000002
|
||||
kCursorComponentsVersion = 0x00010001
|
||||
kCursorComponentType = FOUR_CHAR_CODE('curs')
|
||||
cursorDoesAnimate = 1L << 0
|
||||
cursorDoesHardware = 1L << 1
|
||||
cursorDoesUnreadableScreenBits = 1L << 2
|
||||
kRenderCursorInHardware = 1L << 0
|
||||
kRenderCursorInSoftware = 1L << 1
|
||||
kCursorComponentInit = 0x0001
|
||||
kCursorComponentGetInfo = 0x0002
|
||||
kCursorComponentSetOutputMode = 0x0003
|
||||
kCursorComponentSetData = 0x0004
|
||||
kCursorComponentReconfigure = 0x0005
|
||||
kCursorComponentDraw = 0x0006
|
||||
kCursorComponentErase = 0x0007
|
||||
kCursorComponentMove = 0x0008
|
||||
kCursorComponentAnimate = 0x0009
|
||||
kCursorComponentLastReserved = 0x0050
|
||||
# Generated from 'QuickDrawText.h'
|
||||
|
||||
|
||||
def FOUR_CHAR_CODE(x): return x
|
||||
normal = 0
|
||||
bold = 1
|
||||
italic = 2
|
||||
underline = 4
|
||||
outline = 8
|
||||
shadow = 0x10
|
||||
condense = 0x20
|
||||
extend = 0x40
|
||||
leftCaret = 0
|
||||
rightCaret = -1
|
||||
kHilite = 1
|
||||
smLeftCaret = 0
|
||||
smRightCaret = -1
|
||||
smHilite = 1
|
||||
onlyStyleRun = 0
|
||||
leftStyleRun = 1
|
||||
rightStyleRun = 2
|
||||
middleStyleRun = 3
|
||||
smOnlyStyleRun = 0
|
||||
smLeftStyleRun = 1
|
||||
smRightStyleRun = 2
|
||||
smMiddleStyleRun = 3
|
||||
truncEnd = 0
|
||||
truncMiddle = 0x4000
|
||||
smTruncEnd = 0
|
||||
smTruncMiddle = 0x4000
|
||||
notTruncated = 0
|
||||
truncated = 1
|
||||
truncErr = -1
|
||||
smNotTruncated = 0
|
||||
smTruncated = 1
|
||||
smTruncErr = -1
|
||||
smBreakWord = 0
|
||||
smBreakChar = 1
|
||||
smBreakOverflow = 2
|
||||
tfAntiAlias = 1 << 0
|
||||
tfUnicode = 1 << 1
|
||||
3468
Darwin/lib/python2.7/plat-mac/Carbon/QuickTime.py
Normal file
3468
Darwin/lib/python2.7/plat-mac/Carbon/QuickTime.py
Normal file
File diff suppressed because it is too large
Load diff
4
Darwin/lib/python2.7/plat-mac/Carbon/Res.py
Normal file
4
Darwin/lib/python2.7/plat-mac/Carbon/Res.py
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
try:
|
||||
from OverrideFrom23._Res import *
|
||||
except ImportError:
|
||||
from _Res import *
|
||||
27
Darwin/lib/python2.7/plat-mac/Carbon/Resources.py
Normal file
27
Darwin/lib/python2.7/plat-mac/Carbon/Resources.py
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
# Generated from 'Resources.h'
|
||||
|
||||
resSysHeap = 64
|
||||
resPurgeable = 32
|
||||
resLocked = 16
|
||||
resProtected = 8
|
||||
resPreload = 4
|
||||
resChanged = 2
|
||||
mapReadOnly = 128
|
||||
mapCompact = 64
|
||||
mapChanged = 32
|
||||
resSysRefBit = 7
|
||||
resSysHeapBit = 6
|
||||
resPurgeableBit = 5
|
||||
resLockedBit = 4
|
||||
resProtectedBit = 3
|
||||
resPreloadBit = 2
|
||||
resChangedBit = 1
|
||||
mapReadOnlyBit = 7
|
||||
mapCompactBit = 6
|
||||
mapChangedBit = 5
|
||||
kResFileNotOpened = -1
|
||||
kSystemResFile = 0
|
||||
kRsrcChainBelowSystemMap = 0
|
||||
kRsrcChainBelowApplicationMap = 1
|
||||
kRsrcChainAboveApplicationMap = 2
|
||||
kRsrcChainAboveAllMaps = 4
|
||||
1
Darwin/lib/python2.7/plat-mac/Carbon/Scrap.py
Normal file
1
Darwin/lib/python2.7/plat-mac/Carbon/Scrap.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
from _Scrap import *
|
||||
1
Darwin/lib/python2.7/plat-mac/Carbon/Snd.py
Normal file
1
Darwin/lib/python2.7/plat-mac/Carbon/Snd.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
from _Snd import *
|
||||
1
Darwin/lib/python2.7/plat-mac/Carbon/Sndihooks.py
Normal file
1
Darwin/lib/python2.7/plat-mac/Carbon/Sndihooks.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
from _Sndihooks import *
|
||||
400
Darwin/lib/python2.7/plat-mac/Carbon/Sound.py
Normal file
400
Darwin/lib/python2.7/plat-mac/Carbon/Sound.py
Normal file
|
|
@ -0,0 +1,400 @@
|
|||
# Generated from 'Sound.h'
|
||||
|
||||
def FOUR_CHAR_CODE(x): return x
|
||||
soundListRsrc = FOUR_CHAR_CODE('snd ')
|
||||
kSimpleBeepID = 1
|
||||
# rate48khz = (long)0xBB800000
|
||||
# rate44khz = (long)0xAC440000
|
||||
rate32khz = 0x7D000000
|
||||
rate22050hz = 0x56220000
|
||||
rate22khz = 0x56EE8BA3
|
||||
rate16khz = 0x3E800000
|
||||
rate11khz = 0x2B7745D1
|
||||
rate11025hz = 0x2B110000
|
||||
rate8khz = 0x1F400000
|
||||
sampledSynth = 5
|
||||
squareWaveSynth = 1
|
||||
waveTableSynth = 3
|
||||
MACE3snthID = 11
|
||||
MACE6snthID = 13
|
||||
kMiddleC = 60
|
||||
kNoVolume = 0
|
||||
kFullVolume = 0x0100
|
||||
stdQLength = 128
|
||||
dataOffsetFlag = 0x8000
|
||||
kUseOptionalOutputDevice = -1
|
||||
notCompressed = 0
|
||||
fixedCompression = -1
|
||||
variableCompression = -2
|
||||
twoToOne = 1
|
||||
eightToThree = 2
|
||||
threeToOne = 3
|
||||
sixToOne = 4
|
||||
sixToOnePacketSize = 8
|
||||
threeToOnePacketSize = 16
|
||||
stateBlockSize = 64
|
||||
leftOverBlockSize = 32
|
||||
firstSoundFormat = 0x0001
|
||||
secondSoundFormat = 0x0002
|
||||
dbBufferReady = 0x00000001
|
||||
dbLastBuffer = 0x00000004
|
||||
sysBeepDisable = 0x0000
|
||||
sysBeepEnable = (1 << 0)
|
||||
sysBeepSynchronous = (1 << 1)
|
||||
unitTypeNoSelection = 0xFFFF
|
||||
unitTypeSeconds = 0x0000
|
||||
stdSH = 0x00
|
||||
extSH = 0xFF
|
||||
cmpSH = 0xFE
|
||||
nullCmd = 0
|
||||
quietCmd = 3
|
||||
flushCmd = 4
|
||||
reInitCmd = 5
|
||||
waitCmd = 10
|
||||
pauseCmd = 11
|
||||
resumeCmd = 12
|
||||
callBackCmd = 13
|
||||
syncCmd = 14
|
||||
availableCmd = 24
|
||||
versionCmd = 25
|
||||
volumeCmd = 46
|
||||
getVolumeCmd = 47
|
||||
clockComponentCmd = 50
|
||||
getClockComponentCmd = 51
|
||||
scheduledSoundCmd = 52
|
||||
linkSoundComponentsCmd = 53
|
||||
soundCmd = 80
|
||||
bufferCmd = 81
|
||||
rateMultiplierCmd = 86
|
||||
getRateMultiplierCmd = 87
|
||||
initCmd = 1
|
||||
freeCmd = 2
|
||||
totalLoadCmd = 26
|
||||
loadCmd = 27
|
||||
freqDurationCmd = 40
|
||||
restCmd = 41
|
||||
freqCmd = 42
|
||||
ampCmd = 43
|
||||
timbreCmd = 44
|
||||
getAmpCmd = 45
|
||||
waveTableCmd = 60
|
||||
phaseCmd = 61
|
||||
rateCmd = 82
|
||||
continueCmd = 83
|
||||
doubleBufferCmd = 84
|
||||
getRateCmd = 85
|
||||
sizeCmd = 90
|
||||
convertCmd = 91
|
||||
waveInitChannelMask = 0x07
|
||||
waveInitChannel0 = 0x04
|
||||
waveInitChannel1 = 0x05
|
||||
waveInitChannel2 = 0x06
|
||||
waveInitChannel3 = 0x07
|
||||
initChan0 = waveInitChannel0
|
||||
initChan1 = waveInitChannel1
|
||||
initChan2 = waveInitChannel2
|
||||
initChan3 = waveInitChannel3
|
||||
outsideCmpSH = 0
|
||||
insideCmpSH = 1
|
||||
aceSuccess = 0
|
||||
aceMemFull = 1
|
||||
aceNilBlock = 2
|
||||
aceBadComp = 3
|
||||
aceBadEncode = 4
|
||||
aceBadDest = 5
|
||||
aceBadCmd = 6
|
||||
initChanLeft = 0x0002
|
||||
initChanRight = 0x0003
|
||||
initNoInterp = 0x0004
|
||||
initNoDrop = 0x0008
|
||||
initMono = 0x0080
|
||||
initStereo = 0x00C0
|
||||
initMACE3 = 0x0300
|
||||
initMACE6 = 0x0400
|
||||
initPanMask = 0x0003
|
||||
initSRateMask = 0x0030
|
||||
initStereoMask = 0x00C0
|
||||
initCompMask = 0xFF00
|
||||
siActiveChannels = FOUR_CHAR_CODE('chac')
|
||||
siActiveLevels = FOUR_CHAR_CODE('lmac')
|
||||
siAGCOnOff = FOUR_CHAR_CODE('agc ')
|
||||
siAsync = FOUR_CHAR_CODE('asyn')
|
||||
siAVDisplayBehavior = FOUR_CHAR_CODE('avdb')
|
||||
siChannelAvailable = FOUR_CHAR_CODE('chav')
|
||||
siCompressionAvailable = FOUR_CHAR_CODE('cmav')
|
||||
siCompressionChannels = FOUR_CHAR_CODE('cpct')
|
||||
siCompressionFactor = FOUR_CHAR_CODE('cmfa')
|
||||
siCompressionHeader = FOUR_CHAR_CODE('cmhd')
|
||||
siCompressionNames = FOUR_CHAR_CODE('cnam')
|
||||
siCompressionParams = FOUR_CHAR_CODE('evaw')
|
||||
siCompressionSampleRate = FOUR_CHAR_CODE('cprt')
|
||||
siCompressionType = FOUR_CHAR_CODE('comp')
|
||||
siContinuous = FOUR_CHAR_CODE('cont')
|
||||
siDecompressionParams = FOUR_CHAR_CODE('wave')
|
||||
siDeviceBufferInfo = FOUR_CHAR_CODE('dbin')
|
||||
siDeviceConnected = FOUR_CHAR_CODE('dcon')
|
||||
siDeviceIcon = FOUR_CHAR_CODE('icon')
|
||||
siDeviceName = FOUR_CHAR_CODE('name')
|
||||
siEQSpectrumBands = FOUR_CHAR_CODE('eqsb')
|
||||
siEQSpectrumLevels = FOUR_CHAR_CODE('eqlv')
|
||||
siEQSpectrumOnOff = FOUR_CHAR_CODE('eqlo')
|
||||
siEQSpectrumResolution = FOUR_CHAR_CODE('eqrs')
|
||||
siEQToneControlGain = FOUR_CHAR_CODE('eqtg')
|
||||
siEQToneControlOnOff = FOUR_CHAR_CODE('eqtc')
|
||||
siHardwareBalance = FOUR_CHAR_CODE('hbal')
|
||||
siHardwareBalanceSteps = FOUR_CHAR_CODE('hbls')
|
||||
siHardwareBass = FOUR_CHAR_CODE('hbas')
|
||||
siHardwareBassSteps = FOUR_CHAR_CODE('hbst')
|
||||
siHardwareBusy = FOUR_CHAR_CODE('hwbs')
|
||||
siHardwareFormat = FOUR_CHAR_CODE('hwfm')
|
||||
siHardwareMute = FOUR_CHAR_CODE('hmut')
|
||||
siHardwareMuteNoPrefs = FOUR_CHAR_CODE('hmnp')
|
||||
siHardwareTreble = FOUR_CHAR_CODE('htrb')
|
||||
siHardwareTrebleSteps = FOUR_CHAR_CODE('hwts')
|
||||
siHardwareVolume = FOUR_CHAR_CODE('hvol')
|
||||
siHardwareVolumeSteps = FOUR_CHAR_CODE('hstp')
|
||||
siHeadphoneMute = FOUR_CHAR_CODE('pmut')
|
||||
siHeadphoneVolume = FOUR_CHAR_CODE('pvol')
|
||||
siHeadphoneVolumeSteps = FOUR_CHAR_CODE('hdst')
|
||||
siInputAvailable = FOUR_CHAR_CODE('inav')
|
||||
siInputGain = FOUR_CHAR_CODE('gain')
|
||||
siInputSource = FOUR_CHAR_CODE('sour')
|
||||
siInputSourceNames = FOUR_CHAR_CODE('snam')
|
||||
siLevelMeterOnOff = FOUR_CHAR_CODE('lmet')
|
||||
siModemGain = FOUR_CHAR_CODE('mgai')
|
||||
siMonitorAvailable = FOUR_CHAR_CODE('mnav')
|
||||
siMonitorSource = FOUR_CHAR_CODE('mons')
|
||||
siNumberChannels = FOUR_CHAR_CODE('chan')
|
||||
siOptionsDialog = FOUR_CHAR_CODE('optd')
|
||||
siOSTypeInputSource = FOUR_CHAR_CODE('inpt')
|
||||
siOSTypeInputAvailable = FOUR_CHAR_CODE('inav')
|
||||
siOutputDeviceName = FOUR_CHAR_CODE('onam')
|
||||
siPlayThruOnOff = FOUR_CHAR_CODE('plth')
|
||||
siPostMixerSoundComponent = FOUR_CHAR_CODE('psmx')
|
||||
siPreMixerSoundComponent = FOUR_CHAR_CODE('prmx')
|
||||
siQuality = FOUR_CHAR_CODE('qual')
|
||||
siRateMultiplier = FOUR_CHAR_CODE('rmul')
|
||||
siRecordingQuality = FOUR_CHAR_CODE('qual')
|
||||
siSampleRate = FOUR_CHAR_CODE('srat')
|
||||
siSampleRateAvailable = FOUR_CHAR_CODE('srav')
|
||||
siSampleSize = FOUR_CHAR_CODE('ssiz')
|
||||
siSampleSizeAvailable = FOUR_CHAR_CODE('ssav')
|
||||
siSetupCDAudio = FOUR_CHAR_CODE('sucd')
|
||||
siSetupModemAudio = FOUR_CHAR_CODE('sumd')
|
||||
siSlopeAndIntercept = FOUR_CHAR_CODE('flap')
|
||||
siSoundClock = FOUR_CHAR_CODE('sclk')
|
||||
siUseThisSoundClock = FOUR_CHAR_CODE('sclc')
|
||||
siSpeakerMute = FOUR_CHAR_CODE('smut')
|
||||
siSpeakerVolume = FOUR_CHAR_CODE('svol')
|
||||
siSSpCPULoadLimit = FOUR_CHAR_CODE('3dll')
|
||||
siSSpLocalization = FOUR_CHAR_CODE('3dif')
|
||||
siSSpSpeakerSetup = FOUR_CHAR_CODE('3dst')
|
||||
siStereoInputGain = FOUR_CHAR_CODE('sgai')
|
||||
siSubwooferMute = FOUR_CHAR_CODE('bmut')
|
||||
siTerminalType = FOUR_CHAR_CODE('ttyp')
|
||||
siTwosComplementOnOff = FOUR_CHAR_CODE('twos')
|
||||
siVendorProduct = FOUR_CHAR_CODE('vpro')
|
||||
siVolume = FOUR_CHAR_CODE('volu')
|
||||
siVoxRecordInfo = FOUR_CHAR_CODE('voxr')
|
||||
siVoxStopInfo = FOUR_CHAR_CODE('voxs')
|
||||
siWideStereo = FOUR_CHAR_CODE('wide')
|
||||
siSupportedExtendedFlags = FOUR_CHAR_CODE('exfl')
|
||||
siRateConverterRollOffSlope = FOUR_CHAR_CODE('rcdb')
|
||||
siOutputLatency = FOUR_CHAR_CODE('olte')
|
||||
siCloseDriver = FOUR_CHAR_CODE('clos')
|
||||
siInitializeDriver = FOUR_CHAR_CODE('init')
|
||||
siPauseRecording = FOUR_CHAR_CODE('paus')
|
||||
siUserInterruptProc = FOUR_CHAR_CODE('user')
|
||||
# kInvalidSource = (long)0xFFFFFFFF
|
||||
kNoSource = FOUR_CHAR_CODE('none')
|
||||
kCDSource = FOUR_CHAR_CODE('cd ')
|
||||
kExtMicSource = FOUR_CHAR_CODE('emic')
|
||||
kSoundInSource = FOUR_CHAR_CODE('sinj')
|
||||
kRCAInSource = FOUR_CHAR_CODE('irca')
|
||||
kTVFMTunerSource = FOUR_CHAR_CODE('tvfm')
|
||||
kDAVInSource = FOUR_CHAR_CODE('idav')
|
||||
kIntMicSource = FOUR_CHAR_CODE('imic')
|
||||
kMediaBaySource = FOUR_CHAR_CODE('mbay')
|
||||
kModemSource = FOUR_CHAR_CODE('modm')
|
||||
kPCCardSource = FOUR_CHAR_CODE('pcm ')
|
||||
kZoomVideoSource = FOUR_CHAR_CODE('zvpc')
|
||||
kDVDSource = FOUR_CHAR_CODE('dvda')
|
||||
kMicrophoneArray = FOUR_CHAR_CODE('mica')
|
||||
kNoSoundComponentType = FOUR_CHAR_CODE('****')
|
||||
kSoundComponentType = FOUR_CHAR_CODE('sift')
|
||||
kSoundComponentPPCType = FOUR_CHAR_CODE('nift')
|
||||
kRate8SubType = FOUR_CHAR_CODE('ratb')
|
||||
kRate16SubType = FOUR_CHAR_CODE('ratw')
|
||||
kConverterSubType = FOUR_CHAR_CODE('conv')
|
||||
kSndSourceSubType = FOUR_CHAR_CODE('sour')
|
||||
kMixerType = FOUR_CHAR_CODE('mixr')
|
||||
kMixer8SubType = FOUR_CHAR_CODE('mixb')
|
||||
kMixer16SubType = FOUR_CHAR_CODE('mixw')
|
||||
kSoundInputDeviceType = FOUR_CHAR_CODE('sinp')
|
||||
kWaveInSubType = FOUR_CHAR_CODE('wavi')
|
||||
kWaveInSnifferSubType = FOUR_CHAR_CODE('wisn')
|
||||
kSoundOutputDeviceType = FOUR_CHAR_CODE('sdev')
|
||||
kClassicSubType = FOUR_CHAR_CODE('clas')
|
||||
kASCSubType = FOUR_CHAR_CODE('asc ')
|
||||
kDSPSubType = FOUR_CHAR_CODE('dsp ')
|
||||
kAwacsSubType = FOUR_CHAR_CODE('awac')
|
||||
kGCAwacsSubType = FOUR_CHAR_CODE('awgc')
|
||||
kSingerSubType = FOUR_CHAR_CODE('sing')
|
||||
kSinger2SubType = FOUR_CHAR_CODE('sng2')
|
||||
kWhitSubType = FOUR_CHAR_CODE('whit')
|
||||
kSoundBlasterSubType = FOUR_CHAR_CODE('sbls')
|
||||
kWaveOutSubType = FOUR_CHAR_CODE('wavo')
|
||||
kWaveOutSnifferSubType = FOUR_CHAR_CODE('wosn')
|
||||
kDirectSoundSubType = FOUR_CHAR_CODE('dsnd')
|
||||
kDirectSoundSnifferSubType = FOUR_CHAR_CODE('dssn')
|
||||
kUNIXsdevSubType = FOUR_CHAR_CODE('un1x')
|
||||
kUSBSubType = FOUR_CHAR_CODE('usb ')
|
||||
kBlueBoxSubType = FOUR_CHAR_CODE('bsnd')
|
||||
kSoundCompressor = FOUR_CHAR_CODE('scom')
|
||||
kSoundDecompressor = FOUR_CHAR_CODE('sdec')
|
||||
kAudioComponentType = FOUR_CHAR_CODE('adio')
|
||||
kAwacsPhoneSubType = FOUR_CHAR_CODE('hphn')
|
||||
kAudioVisionSpeakerSubType = FOUR_CHAR_CODE('telc')
|
||||
kAudioVisionHeadphoneSubType = FOUR_CHAR_CODE('telh')
|
||||
kPhilipsFaderSubType = FOUR_CHAR_CODE('tvav')
|
||||
kSGSToneSubType = FOUR_CHAR_CODE('sgs0')
|
||||
kSoundEffectsType = FOUR_CHAR_CODE('snfx')
|
||||
kEqualizerSubType = FOUR_CHAR_CODE('eqal')
|
||||
kSSpLocalizationSubType = FOUR_CHAR_CODE('snd3')
|
||||
kSoundNotCompressed = FOUR_CHAR_CODE('NONE')
|
||||
k8BitOffsetBinaryFormat = FOUR_CHAR_CODE('raw ')
|
||||
k16BitBigEndianFormat = FOUR_CHAR_CODE('twos')
|
||||
k16BitLittleEndianFormat = FOUR_CHAR_CODE('sowt')
|
||||
kFloat32Format = FOUR_CHAR_CODE('fl32')
|
||||
kFloat64Format = FOUR_CHAR_CODE('fl64')
|
||||
k24BitFormat = FOUR_CHAR_CODE('in24')
|
||||
k32BitFormat = FOUR_CHAR_CODE('in32')
|
||||
k32BitLittleEndianFormat = FOUR_CHAR_CODE('23ni')
|
||||
kMACE3Compression = FOUR_CHAR_CODE('MAC3')
|
||||
kMACE6Compression = FOUR_CHAR_CODE('MAC6')
|
||||
kCDXA4Compression = FOUR_CHAR_CODE('cdx4')
|
||||
kCDXA2Compression = FOUR_CHAR_CODE('cdx2')
|
||||
kIMACompression = FOUR_CHAR_CODE('ima4')
|
||||
kULawCompression = FOUR_CHAR_CODE('ulaw')
|
||||
kALawCompression = FOUR_CHAR_CODE('alaw')
|
||||
kMicrosoftADPCMFormat = 0x6D730002
|
||||
kDVIIntelIMAFormat = 0x6D730011
|
||||
kDVAudioFormat = FOUR_CHAR_CODE('dvca')
|
||||
kQDesignCompression = FOUR_CHAR_CODE('QDMC')
|
||||
kQDesign2Compression = FOUR_CHAR_CODE('QDM2')
|
||||
kQUALCOMMCompression = FOUR_CHAR_CODE('Qclp')
|
||||
kOffsetBinary = k8BitOffsetBinaryFormat
|
||||
kTwosComplement = k16BitBigEndianFormat
|
||||
kLittleEndianFormat = k16BitLittleEndianFormat
|
||||
kMPEGLayer3Format = 0x6D730055
|
||||
kFullMPEGLay3Format = FOUR_CHAR_CODE('.mp3')
|
||||
k16BitNativeEndianFormat = k16BitLittleEndianFormat
|
||||
k16BitNonNativeEndianFormat = k16BitBigEndianFormat
|
||||
k16BitNativeEndianFormat = k16BitBigEndianFormat
|
||||
k16BitNonNativeEndianFormat = k16BitLittleEndianFormat
|
||||
k8BitRawIn = (1 << 0)
|
||||
k8BitTwosIn = (1 << 1)
|
||||
k16BitIn = (1 << 2)
|
||||
kStereoIn = (1 << 3)
|
||||
k8BitRawOut = (1 << 8)
|
||||
k8BitTwosOut = (1 << 9)
|
||||
k16BitOut = (1 << 10)
|
||||
kStereoOut = (1 << 11)
|
||||
kReverse = (1L << 16)
|
||||
kRateConvert = (1L << 17)
|
||||
kCreateSoundSource = (1L << 18)
|
||||
kVMAwareness = (1L << 21)
|
||||
kHighQuality = (1L << 22)
|
||||
kNonRealTime = (1L << 23)
|
||||
kSourcePaused = (1 << 0)
|
||||
kPassThrough = (1L << 16)
|
||||
kNoSoundComponentChain = (1L << 17)
|
||||
kNoMixing = (1 << 0)
|
||||
kNoSampleRateConversion = (1 << 1)
|
||||
kNoSampleSizeConversion = (1 << 2)
|
||||
kNoSampleFormatConversion = (1 << 3)
|
||||
kNoChannelConversion = (1 << 4)
|
||||
kNoDecompression = (1 << 5)
|
||||
kNoVolumeConversion = (1 << 6)
|
||||
kNoRealtimeProcessing = (1 << 7)
|
||||
kScheduledSource = (1 << 8)
|
||||
kNonInterleavedBuffer = (1 << 9)
|
||||
kNonPagingMixer = (1 << 10)
|
||||
kSoundConverterMixer = (1 << 11)
|
||||
kPagingMixer = (1 << 12)
|
||||
kVMAwareMixer = (1 << 13)
|
||||
kExtendedSoundData = (1 << 14)
|
||||
kBestQuality = (1 << 0)
|
||||
kInputMask = 0x000000FF
|
||||
kOutputMask = 0x0000FF00
|
||||
kOutputShift = 8
|
||||
kActionMask = 0x00FF0000
|
||||
kSoundComponentBits = 0x00FFFFFF
|
||||
kAudioFormatAtomType = FOUR_CHAR_CODE('frma')
|
||||
kAudioEndianAtomType = FOUR_CHAR_CODE('enda')
|
||||
kAudioVBRAtomType = FOUR_CHAR_CODE('vbra')
|
||||
kAudioTerminatorAtomType = 0
|
||||
kAVDisplayHeadphoneRemove = 0
|
||||
kAVDisplayHeadphoneInsert = 1
|
||||
kAVDisplayPlainTalkRemove = 2
|
||||
kAVDisplayPlainTalkInsert = 3
|
||||
audioAllChannels = 0
|
||||
audioLeftChannel = 1
|
||||
audioRightChannel = 2
|
||||
audioUnmuted = 0
|
||||
audioMuted = 1
|
||||
audioDoesMono = (1L << 0)
|
||||
audioDoesStereo = (1L << 1)
|
||||
audioDoesIndependentChannels = (1L << 2)
|
||||
siCDQuality = FOUR_CHAR_CODE('cd ')
|
||||
siBestQuality = FOUR_CHAR_CODE('best')
|
||||
siBetterQuality = FOUR_CHAR_CODE('betr')
|
||||
siGoodQuality = FOUR_CHAR_CODE('good')
|
||||
siNoneQuality = FOUR_CHAR_CODE('none')
|
||||
siDeviceIsConnected = 1
|
||||
siDeviceNotConnected = 0
|
||||
siDontKnowIfConnected = -1
|
||||
siReadPermission = 0
|
||||
siWritePermission = 1
|
||||
kSoundConverterDidntFillBuffer = (1 << 0)
|
||||
kSoundConverterHasLeftOverData = (1 << 1)
|
||||
kExtendedSoundSampleCountNotValid = 1L << 0
|
||||
kExtendedSoundBufferSizeValid = 1L << 1
|
||||
kScheduledSoundDoScheduled = 1 << 0
|
||||
kScheduledSoundDoCallBack = 1 << 1
|
||||
kScheduledSoundExtendedHdr = 1 << 2
|
||||
kSoundComponentInitOutputDeviceSelect = 0x0001
|
||||
kSoundComponentSetSourceSelect = 0x0002
|
||||
kSoundComponentGetSourceSelect = 0x0003
|
||||
kSoundComponentGetSourceDataSelect = 0x0004
|
||||
kSoundComponentSetOutputSelect = 0x0005
|
||||
kSoundComponentAddSourceSelect = 0x0101
|
||||
kSoundComponentRemoveSourceSelect = 0x0102
|
||||
kSoundComponentGetInfoSelect = 0x0103
|
||||
kSoundComponentSetInfoSelect = 0x0104
|
||||
kSoundComponentStartSourceSelect = 0x0105
|
||||
kSoundComponentStopSourceSelect = 0x0106
|
||||
kSoundComponentPauseSourceSelect = 0x0107
|
||||
kSoundComponentPlaySourceBufferSelect = 0x0108
|
||||
kAudioGetVolumeSelect = 0x0000
|
||||
kAudioSetVolumeSelect = 0x0001
|
||||
kAudioGetMuteSelect = 0x0002
|
||||
kAudioSetMuteSelect = 0x0003
|
||||
kAudioSetToDefaultsSelect = 0x0004
|
||||
kAudioGetInfoSelect = 0x0005
|
||||
kAudioGetBassSelect = 0x0006
|
||||
kAudioSetBassSelect = 0x0007
|
||||
kAudioGetTrebleSelect = 0x0008
|
||||
kAudioSetTrebleSelect = 0x0009
|
||||
kAudioGetOutputDeviceSelect = 0x000A
|
||||
kAudioMuteOnEventSelect = 0x0081
|
||||
kDelegatedSoundComponentSelectors = 0x0100
|
||||
kSndInputReadAsyncSelect = 0x0001
|
||||
kSndInputReadSyncSelect = 0x0002
|
||||
kSndInputPauseRecordingSelect = 0x0003
|
||||
kSndInputResumeRecordingSelect = 0x0004
|
||||
kSndInputStopRecordingSelect = 0x0005
|
||||
kSndInputGetStatusSelect = 0x0006
|
||||
kSndInputGetDeviceInfoSelect = 0x0007
|
||||
kSndInputSetDeviceInfoSelect = 0x0008
|
||||
kSndInputInitHardwareSelect = 0x0009
|
||||
1
Darwin/lib/python2.7/plat-mac/Carbon/TE.py
Normal file
1
Darwin/lib/python2.7/plat-mac/Carbon/TE.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
from _TE import *
|
||||
57
Darwin/lib/python2.7/plat-mac/Carbon/TextEdit.py
Normal file
57
Darwin/lib/python2.7/plat-mac/Carbon/TextEdit.py
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
# Generated from 'TextEdit.h'
|
||||
|
||||
teJustLeft = 0
|
||||
teJustCenter = 1
|
||||
teJustRight = -1
|
||||
teForceLeft = -2
|
||||
teFlushDefault = 0
|
||||
teCenter = 1
|
||||
teFlushRight = -1
|
||||
teFlushLeft = -2
|
||||
fontBit = 0
|
||||
faceBit = 1
|
||||
sizeBit = 2
|
||||
clrBit = 3
|
||||
addSizeBit = 4
|
||||
toggleBit = 5
|
||||
doFont = 1
|
||||
doFace = 2
|
||||
doSize = 4
|
||||
doColor = 8
|
||||
doAll = 15
|
||||
addSize = 16
|
||||
doToggle = 32
|
||||
EOLHook = 0
|
||||
DRAWHook = 4
|
||||
WIDTHHook = 8
|
||||
HITTESTHook = 12
|
||||
nWIDTHHook = 24
|
||||
TextWidthHook = 28
|
||||
intEOLHook = 0
|
||||
intDrawHook = 1
|
||||
intWidthHook = 2
|
||||
intHitTestHook = 3
|
||||
intNWidthHook = 6
|
||||
intTextWidthHook = 7
|
||||
intInlineInputTSMTEPreUpdateHook = 8
|
||||
intInlineInputTSMTEPostUpdateHook = 9
|
||||
teFAutoScroll = 0
|
||||
teFTextBuffering = 1
|
||||
teFOutlineHilite = 2
|
||||
teFInlineInput = 3
|
||||
teFUseWhiteBackground = 4
|
||||
teFUseInlineInput = 5
|
||||
teFInlineInputAutoScroll = 6
|
||||
teFIdleWithEventLoopTimer = 7
|
||||
teBitClear = 0
|
||||
teBitSet = 1
|
||||
teBitTest = -1
|
||||
teWordSelect = 4
|
||||
teWordDrag = 8
|
||||
teFromFind = 12
|
||||
teFromRecal = 16
|
||||
teFind = 0
|
||||
teHighlight = 1
|
||||
teDraw = -1
|
||||
teCaret = -2
|
||||
teFUseTextServices = 4
|
||||
1
Darwin/lib/python2.7/plat-mac/Carbon/Win.py
Normal file
1
Darwin/lib/python2.7/plat-mac/Carbon/Win.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
from _Win import *
|
||||
279
Darwin/lib/python2.7/plat-mac/Carbon/Windows.py
Normal file
279
Darwin/lib/python2.7/plat-mac/Carbon/Windows.py
Normal file
|
|
@ -0,0 +1,279 @@
|
|||
# Generated from 'MacWindows.h'
|
||||
|
||||
def FOUR_CHAR_CODE(x): return x
|
||||
false = 0
|
||||
true = 1
|
||||
kWindowNoConstrainAttribute = 0x80000000
|
||||
kAlertWindowClass = 1
|
||||
kMovableAlertWindowClass = 2
|
||||
kModalWindowClass = 3
|
||||
kMovableModalWindowClass = 4
|
||||
kFloatingWindowClass = 5
|
||||
kDocumentWindowClass = 6
|
||||
kUtilityWindowClass = 8
|
||||
kHelpWindowClass = 10
|
||||
kSheetWindowClass = 11
|
||||
kToolbarWindowClass = 12
|
||||
kPlainWindowClass = 13
|
||||
kOverlayWindowClass = 14
|
||||
kSheetAlertWindowClass = 15
|
||||
kAltPlainWindowClass = 16
|
||||
kDrawerWindowClass = 20
|
||||
# kAllWindowClasses = (unsigned long)0xFFFFFFFF
|
||||
kWindowNoAttributes = 0L
|
||||
kWindowCloseBoxAttribute = (1L << 0)
|
||||
kWindowHorizontalZoomAttribute = (1L << 1)
|
||||
kWindowVerticalZoomAttribute = (1L << 2)
|
||||
kWindowFullZoomAttribute = (kWindowVerticalZoomAttribute | kWindowHorizontalZoomAttribute)
|
||||
kWindowCollapseBoxAttribute = (1L << 3)
|
||||
kWindowResizableAttribute = (1L << 4)
|
||||
kWindowSideTitlebarAttribute = (1L << 5)
|
||||
kWindowToolbarButtonAttribute = (1L << 6)
|
||||
kWindowNoUpdatesAttribute = (1L << 16)
|
||||
kWindowNoActivatesAttribute = (1L << 17)
|
||||
kWindowOpaqueForEventsAttribute = (1L << 18)
|
||||
kWindowNoShadowAttribute = (1L << 21)
|
||||
kWindowHideOnSuspendAttribute = (1L << 24)
|
||||
kWindowStandardHandlerAttribute = (1L << 25)
|
||||
kWindowHideOnFullScreenAttribute = (1L << 26)
|
||||
kWindowInWindowMenuAttribute = (1L << 27)
|
||||
kWindowLiveResizeAttribute = (1L << 28)
|
||||
# kWindowNoConstrainAttribute = (unsigned long)((1L << 31))
|
||||
kWindowStandardDocumentAttributes = (kWindowCloseBoxAttribute | kWindowFullZoomAttribute | kWindowCollapseBoxAttribute | kWindowResizableAttribute)
|
||||
kWindowStandardFloatingAttributes = (kWindowCloseBoxAttribute | kWindowCollapseBoxAttribute)
|
||||
kWindowDefProcType = FOUR_CHAR_CODE('WDEF')
|
||||
kStandardWindowDefinition = 0
|
||||
kRoundWindowDefinition = 1
|
||||
kFloatingWindowDefinition = 124
|
||||
kDocumentWindowVariantCode = 0
|
||||
kModalDialogVariantCode = 1
|
||||
kPlainDialogVariantCode = 2
|
||||
kShadowDialogVariantCode = 3
|
||||
kMovableModalDialogVariantCode = 5
|
||||
kAlertVariantCode = 7
|
||||
kMovableAlertVariantCode = 9
|
||||
kSideFloaterVariantCode = 8
|
||||
documentProc = 0
|
||||
dBoxProc = 1
|
||||
plainDBox = 2
|
||||
altDBoxProc = 3
|
||||
noGrowDocProc = 4
|
||||
movableDBoxProc = 5
|
||||
zoomDocProc = 8
|
||||
zoomNoGrow = 12
|
||||
floatProc = 1985
|
||||
floatGrowProc = 1987
|
||||
floatZoomProc = 1989
|
||||
floatZoomGrowProc = 1991
|
||||
floatSideProc = 1993
|
||||
floatSideGrowProc = 1995
|
||||
floatSideZoomProc = 1997
|
||||
floatSideZoomGrowProc = 1999
|
||||
rDocProc = 16
|
||||
kWindowDocumentDefProcResID = 64
|
||||
kWindowDialogDefProcResID = 65
|
||||
kWindowUtilityDefProcResID = 66
|
||||
kWindowUtilitySideTitleDefProcResID = 67
|
||||
kWindowSheetDefProcResID = 68
|
||||
kWindowSimpleDefProcResID = 69
|
||||
kWindowSheetAlertDefProcResID = 70
|
||||
kWindowDocumentProc = 1024
|
||||
kWindowGrowDocumentProc = 1025
|
||||
kWindowVertZoomDocumentProc = 1026
|
||||
kWindowVertZoomGrowDocumentProc = 1027
|
||||
kWindowHorizZoomDocumentProc = 1028
|
||||
kWindowHorizZoomGrowDocumentProc = 1029
|
||||
kWindowFullZoomDocumentProc = 1030
|
||||
kWindowFullZoomGrowDocumentProc = 1031
|
||||
kWindowPlainDialogProc = 1040
|
||||
kWindowShadowDialogProc = 1041
|
||||
kWindowModalDialogProc = 1042
|
||||
kWindowMovableModalDialogProc = 1043
|
||||
kWindowAlertProc = 1044
|
||||
kWindowMovableAlertProc = 1045
|
||||
kWindowMovableModalGrowProc = 1046
|
||||
kWindowFloatProc = 1057
|
||||
kWindowFloatGrowProc = 1059
|
||||
kWindowFloatVertZoomProc = 1061
|
||||
kWindowFloatVertZoomGrowProc = 1063
|
||||
kWindowFloatHorizZoomProc = 1065
|
||||
kWindowFloatHorizZoomGrowProc = 1067
|
||||
kWindowFloatFullZoomProc = 1069
|
||||
kWindowFloatFullZoomGrowProc = 1071
|
||||
kWindowFloatSideProc = 1073
|
||||
kWindowFloatSideGrowProc = 1075
|
||||
kWindowFloatSideVertZoomProc = 1077
|
||||
kWindowFloatSideVertZoomGrowProc = 1079
|
||||
kWindowFloatSideHorizZoomProc = 1081
|
||||
kWindowFloatSideHorizZoomGrowProc = 1083
|
||||
kWindowFloatSideFullZoomProc = 1085
|
||||
kWindowFloatSideFullZoomGrowProc = 1087
|
||||
kWindowSheetProc = 1088
|
||||
kWindowSheetAlertProc = 1120
|
||||
kWindowSimpleProc = 1104
|
||||
kWindowSimpleFrameProc = 1105
|
||||
kWindowNoPosition = 0x0000
|
||||
kWindowDefaultPosition = 0x0000
|
||||
kWindowCenterMainScreen = 0x280A
|
||||
kWindowAlertPositionMainScreen = 0x300A
|
||||
kWindowStaggerMainScreen = 0x380A
|
||||
kWindowCenterParentWindow = 0xA80A
|
||||
kWindowAlertPositionParentWindow = 0xB00A
|
||||
kWindowStaggerParentWindow = 0xB80A
|
||||
kWindowCenterParentWindowScreen = 0x680A
|
||||
kWindowAlertPositionParentWindowScreen = 0x700A
|
||||
kWindowStaggerParentWindowScreen = 0x780A
|
||||
kWindowCenterOnMainScreen = 1
|
||||
kWindowCenterOnParentWindow = 2
|
||||
kWindowCenterOnParentWindowScreen = 3
|
||||
kWindowCascadeOnMainScreen = 4
|
||||
kWindowCascadeOnParentWindow = 5
|
||||
kWindowCascadeOnParentWindowScreen = 6
|
||||
kWindowCascadeStartAtParentWindowScreen = 10
|
||||
kWindowAlertPositionOnMainScreen = 7
|
||||
kWindowAlertPositionOnParentWindow = 8
|
||||
kWindowAlertPositionOnParentWindowScreen = 9
|
||||
kWindowTitleBarRgn = 0
|
||||
kWindowTitleTextRgn = 1
|
||||
kWindowCloseBoxRgn = 2
|
||||
kWindowZoomBoxRgn = 3
|
||||
kWindowDragRgn = 5
|
||||
kWindowGrowRgn = 6
|
||||
kWindowCollapseBoxRgn = 7
|
||||
kWindowTitleProxyIconRgn = 8
|
||||
kWindowStructureRgn = 32
|
||||
kWindowContentRgn = 33
|
||||
kWindowUpdateRgn = 34
|
||||
kWindowOpaqueRgn = 35
|
||||
kWindowGlobalPortRgn = 40
|
||||
dialogKind = 2
|
||||
userKind = 8
|
||||
kDialogWindowKind = 2
|
||||
kApplicationWindowKind = 8
|
||||
inDesk = 0
|
||||
inNoWindow = 0
|
||||
inMenuBar = 1
|
||||
inSysWindow = 2
|
||||
inContent = 3
|
||||
inDrag = 4
|
||||
inGrow = 5
|
||||
inGoAway = 6
|
||||
inZoomIn = 7
|
||||
inZoomOut = 8
|
||||
inCollapseBox = 11
|
||||
inProxyIcon = 12
|
||||
inToolbarButton = 13
|
||||
inStructure = 15
|
||||
wNoHit = 0
|
||||
wInContent = 1
|
||||
wInDrag = 2
|
||||
wInGrow = 3
|
||||
wInGoAway = 4
|
||||
wInZoomIn = 5
|
||||
wInZoomOut = 6
|
||||
wInCollapseBox = 9
|
||||
wInProxyIcon = 10
|
||||
wInToolbarButton = 11
|
||||
wInStructure = 13
|
||||
kWindowMsgDraw = 0
|
||||
kWindowMsgHitTest = 1
|
||||
kWindowMsgCalculateShape = 2
|
||||
kWindowMsgInitialize = 3
|
||||
kWindowMsgCleanUp = 4
|
||||
kWindowMsgDrawGrowOutline = 5
|
||||
kWindowMsgDrawGrowBox = 6
|
||||
kWindowMsgGetFeatures = 7
|
||||
kWindowMsgGetRegion = 8
|
||||
kWindowMsgDragHilite = 9
|
||||
kWindowMsgModified = 10
|
||||
kWindowMsgDrawInCurrentPort = 11
|
||||
kWindowMsgSetupProxyDragImage = 12
|
||||
kWindowMsgStateChanged = 13
|
||||
kWindowMsgMeasureTitle = 14
|
||||
kWindowMsgGetGrowImageRegion = 19
|
||||
wDraw = 0
|
||||
wHit = 1
|
||||
wCalcRgns = 2
|
||||
wNew = 3
|
||||
wDispose = 4
|
||||
wGrow = 5
|
||||
wDrawGIcon = 6
|
||||
kWindowStateTitleChanged = (1 << 0)
|
||||
kWindowCanGrow = (1 << 0)
|
||||
kWindowCanZoom = (1 << 1)
|
||||
kWindowCanCollapse = (1 << 2)
|
||||
kWindowIsModal = (1 << 3)
|
||||
kWindowCanGetWindowRegion = (1 << 4)
|
||||
kWindowIsAlert = (1 << 5)
|
||||
kWindowHasTitleBar = (1 << 6)
|
||||
kWindowSupportsDragHilite = (1 << 7)
|
||||
kWindowSupportsModifiedBit = (1 << 8)
|
||||
kWindowCanDrawInCurrentPort = (1 << 9)
|
||||
kWindowCanSetupProxyDragImage = (1 << 10)
|
||||
kWindowCanMeasureTitle = (1 << 11)
|
||||
kWindowWantsDisposeAtProcessDeath = (1 << 12)
|
||||
kWindowSupportsGetGrowImageRegion = (1 << 13)
|
||||
kWindowDefSupportsColorGrafPort = 0x40000002
|
||||
kWindowIsOpaque = (1 << 14)
|
||||
kWindowSupportsSetGrowImageRegion = (1 << 13)
|
||||
deskPatID = 16
|
||||
wContentColor = 0
|
||||
wFrameColor = 1
|
||||
wTextColor = 2
|
||||
wHiliteColor = 3
|
||||
wTitleBarColor = 4
|
||||
# kMouseUpOutOfSlop = (long)0x80008000
|
||||
kWindowDefinitionVersionOne = 1
|
||||
kWindowDefinitionVersionTwo = 2
|
||||
kWindowIsCollapsedState = (1 << 0L)
|
||||
kStoredWindowSystemTag = FOUR_CHAR_CODE('appl')
|
||||
kStoredBasicWindowDescriptionID = FOUR_CHAR_CODE('sbas')
|
||||
kStoredWindowPascalTitleID = FOUR_CHAR_CODE('s255')
|
||||
kWindowDefProcPtr = 0
|
||||
kWindowDefObjectClass = 1
|
||||
kWindowDefProcID = 2
|
||||
kWindowModalityNone = 0
|
||||
kWindowModalitySystemModal = 1
|
||||
kWindowModalityAppModal = 2
|
||||
kWindowModalityWindowModal = 3
|
||||
kWindowGroupAttrSelectAsLayer = 1 << 0
|
||||
kWindowGroupAttrMoveTogether = 1 << 1
|
||||
kWindowGroupAttrLayerTogether = 1 << 2
|
||||
kWindowGroupAttrSharedActivation = 1 << 3
|
||||
kWindowGroupAttrHideOnCollapse = 1 << 4
|
||||
kWindowActivationScopeNone = 0
|
||||
kWindowActivationScopeIndependent = 1
|
||||
kWindowActivationScopeAll = 2
|
||||
kNextWindowGroup = true
|
||||
kPreviousWindowGroup = false
|
||||
kWindowGroupContentsReturnWindows = 1 << 0
|
||||
kWindowGroupContentsRecurse = 1 << 1
|
||||
kWindowGroupContentsVisible = 1 << 2
|
||||
kWindowPaintProcOptionsNone = 0
|
||||
kScrollWindowNoOptions = 0
|
||||
kScrollWindowInvalidate = (1L << 0)
|
||||
kScrollWindowEraseToPortBackground = (1L << 1)
|
||||
kWindowMenuIncludeRotate = 1 << 0
|
||||
kWindowZoomTransitionEffect = 1
|
||||
kWindowSheetTransitionEffect = 2
|
||||
kWindowSlideTransitionEffect = 3
|
||||
kWindowShowTransitionAction = 1
|
||||
kWindowHideTransitionAction = 2
|
||||
kWindowMoveTransitionAction = 3
|
||||
kWindowResizeTransitionAction = 4
|
||||
kWindowConstrainMayResize = (1L << 0)
|
||||
kWindowConstrainMoveRegardlessOfFit = (1L << 1)
|
||||
kWindowConstrainAllowPartial = (1L << 2)
|
||||
kWindowConstrainCalcOnly = (1L << 3)
|
||||
kWindowConstrainUseTransitionWindow = (1L << 4)
|
||||
kWindowConstrainStandardOptions = kWindowConstrainMoveRegardlessOfFit
|
||||
kWindowLatentVisibleFloater = 1 << 0
|
||||
kWindowLatentVisibleSuspend = 1 << 1
|
||||
kWindowLatentVisibleFullScreen = 1 << 2
|
||||
kWindowLatentVisibleAppHidden = 1 << 3
|
||||
kWindowLatentVisibleCollapsedOwner = 1 << 4
|
||||
kWindowLatentVisibleCollapsedGroup = 1 << 5
|
||||
kWindowPropertyPersistent = 0x00000001
|
||||
kWindowGroupAttrSelectable = kWindowGroupAttrSelectAsLayer
|
||||
kWindowGroupAttrPositionFixed = kWindowGroupAttrMoveTogether
|
||||
kWindowGroupAttrZOrderFixed = kWindowGroupAttrLayerTogether
|
||||
7
Darwin/lib/python2.7/plat-mac/Carbon/__init__.py
Normal file
7
Darwin/lib/python2.7/plat-mac/Carbon/__init__.py
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# Filter out warnings about signed/unsigned constants
|
||||
import warnings
|
||||
warnings.filterwarnings("ignore", "", FutureWarning, ".*Controls")
|
||||
warnings.filterwarnings("ignore", "", FutureWarning, ".*MacTextEditor")
|
||||
|
||||
from warnings import warnpy3k
|
||||
warnpy3k("In 3.x, the Carbon package is removed.", stacklevel=2)
|
||||
848
Darwin/lib/python2.7/plat-mac/EasyDialogs.py
Normal file
848
Darwin/lib/python2.7/plat-mac/EasyDialogs.py
Normal file
|
|
@ -0,0 +1,848 @@
|
|||
"""Easy to use dialogs.
|
||||
|
||||
Message(msg) -- display a message and an OK button.
|
||||
AskString(prompt, default) -- ask for a string, display OK and Cancel buttons.
|
||||
AskPassword(prompt, default) -- like AskString(), but shows text as bullets.
|
||||
AskYesNoCancel(question, default) -- display a question and Yes, No and Cancel buttons.
|
||||
GetArgv(optionlist, commandlist) -- fill a sys.argv-like list using a dialog
|
||||
AskFileForOpen(...) -- Ask the user for an existing file
|
||||
AskFileForSave(...) -- Ask the user for an output file
|
||||
AskFolder(...) -- Ask the user to select a folder
|
||||
bar = Progress(label, maxvalue) -- Display a progress bar
|
||||
bar.set(value) -- Set value
|
||||
bar.inc( *amount ) -- increment value by amount (default=1)
|
||||
bar.label( *newlabel ) -- get or set text label.
|
||||
|
||||
More documentation in each function.
|
||||
This module uses DLOG resources 260 and on.
|
||||
Based upon STDWIN dialogs with the same names and functions.
|
||||
"""
|
||||
|
||||
from warnings import warnpy3k
|
||||
warnpy3k("In 3.x, the EasyDialogs module is removed.", stacklevel=2)
|
||||
|
||||
from Carbon.Dlg import GetNewDialog, SetDialogItemText, GetDialogItemText, ModalDialog
|
||||
from Carbon import Qd
|
||||
from Carbon import QuickDraw
|
||||
from Carbon import Dialogs
|
||||
from Carbon import Windows
|
||||
from Carbon import Dlg,Win,Evt,Events # sdm7g
|
||||
from Carbon import Ctl
|
||||
from Carbon import Controls
|
||||
from Carbon import Menu
|
||||
from Carbon import AE
|
||||
import Nav
|
||||
import MacOS
|
||||
import string
|
||||
from Carbon.ControlAccessor import * # Also import Controls constants
|
||||
import Carbon.File
|
||||
import macresource
|
||||
import os
|
||||
import sys
|
||||
|
||||
__all__ = ['Message', 'AskString', 'AskPassword', 'AskYesNoCancel',
|
||||
'GetArgv', 'AskFileForOpen', 'AskFileForSave', 'AskFolder',
|
||||
'ProgressBar']
|
||||
|
||||
_initialized = 0
|
||||
|
||||
def _initialize():
|
||||
global _initialized
|
||||
if _initialized: return
|
||||
macresource.need("DLOG", 260, "dialogs.rsrc", __name__)
|
||||
|
||||
def _interact():
|
||||
"""Make sure the application is in the foreground"""
|
||||
AE.AEInteractWithUser(50000000)
|
||||
|
||||
def cr2lf(text):
|
||||
if '\r' in text:
|
||||
text = string.join(string.split(text, '\r'), '\n')
|
||||
return text
|
||||
|
||||
def lf2cr(text):
|
||||
if '\n' in text:
|
||||
text = string.join(string.split(text, '\n'), '\r')
|
||||
if len(text) > 253:
|
||||
text = text[:253] + '\311'
|
||||
return text
|
||||
|
||||
def Message(msg, id=260, ok=None):
|
||||
"""Display a MESSAGE string.
|
||||
|
||||
Return when the user clicks the OK button or presses Return.
|
||||
|
||||
The MESSAGE string can be at most 255 characters long.
|
||||
"""
|
||||
_initialize()
|
||||
_interact()
|
||||
d = GetNewDialog(id, -1)
|
||||
if not d:
|
||||
print "EasyDialogs: Can't get DLOG resource with id =", id, " (missing resource file?)"
|
||||
return
|
||||
h = d.GetDialogItemAsControl(2)
|
||||
SetDialogItemText(h, lf2cr(msg))
|
||||
if ok is not None:
|
||||
h = d.GetDialogItemAsControl(1)
|
||||
h.SetControlTitle(ok)
|
||||
d.SetDialogDefaultItem(1)
|
||||
d.AutoSizeDialog()
|
||||
d.GetDialogWindow().ShowWindow()
|
||||
while 1:
|
||||
n = ModalDialog(None)
|
||||
if n == 1:
|
||||
return
|
||||
|
||||
|
||||
def AskString(prompt, default = "", id=261, ok=None, cancel=None):
|
||||
"""Display a PROMPT string and a text entry field with a DEFAULT string.
|
||||
|
||||
Return the contents of the text entry field when the user clicks the
|
||||
OK button or presses Return.
|
||||
Return None when the user clicks the Cancel button.
|
||||
|
||||
If omitted, DEFAULT is empty.
|
||||
|
||||
The PROMPT and DEFAULT strings, as well as the return value,
|
||||
can be at most 255 characters long.
|
||||
"""
|
||||
|
||||
_initialize()
|
||||
_interact()
|
||||
d = GetNewDialog(id, -1)
|
||||
if not d:
|
||||
print "EasyDialogs: Can't get DLOG resource with id =", id, " (missing resource file?)"
|
||||
return
|
||||
h = d.GetDialogItemAsControl(3)
|
||||
SetDialogItemText(h, lf2cr(prompt))
|
||||
h = d.GetDialogItemAsControl(4)
|
||||
SetDialogItemText(h, lf2cr(default))
|
||||
d.SelectDialogItemText(4, 0, 999)
|
||||
# d.SetDialogItem(4, 0, 255)
|
||||
if ok is not None:
|
||||
h = d.GetDialogItemAsControl(1)
|
||||
h.SetControlTitle(ok)
|
||||
if cancel is not None:
|
||||
h = d.GetDialogItemAsControl(2)
|
||||
h.SetControlTitle(cancel)
|
||||
d.SetDialogDefaultItem(1)
|
||||
d.SetDialogCancelItem(2)
|
||||
d.AutoSizeDialog()
|
||||
d.GetDialogWindow().ShowWindow()
|
||||
while 1:
|
||||
n = ModalDialog(None)
|
||||
if n == 1:
|
||||
h = d.GetDialogItemAsControl(4)
|
||||
return cr2lf(GetDialogItemText(h))
|
||||
if n == 2: return None
|
||||
|
||||
def AskPassword(prompt, default='', id=264, ok=None, cancel=None):
|
||||
"""Display a PROMPT string and a text entry field with a DEFAULT string.
|
||||
The string is displayed as bullets only.
|
||||
|
||||
Return the contents of the text entry field when the user clicks the
|
||||
OK button or presses Return.
|
||||
Return None when the user clicks the Cancel button.
|
||||
|
||||
If omitted, DEFAULT is empty.
|
||||
|
||||
The PROMPT and DEFAULT strings, as well as the return value,
|
||||
can be at most 255 characters long.
|
||||
"""
|
||||
_initialize()
|
||||
_interact()
|
||||
d = GetNewDialog(id, -1)
|
||||
if not d:
|
||||
print "EasyDialogs: Can't get DLOG resource with id =", id, " (missing resource file?)"
|
||||
return
|
||||
h = d.GetDialogItemAsControl(3)
|
||||
SetDialogItemText(h, lf2cr(prompt))
|
||||
pwd = d.GetDialogItemAsControl(4)
|
||||
bullets = '\245'*len(default)
|
||||
## SetControlData(pwd, kControlEditTextPart, kControlEditTextTextTag, bullets)
|
||||
SetControlData(pwd, kControlEditTextPart, kControlEditTextPasswordTag, default)
|
||||
d.SelectDialogItemText(4, 0, 999)
|
||||
Ctl.SetKeyboardFocus(d.GetDialogWindow(), pwd, kControlEditTextPart)
|
||||
if ok is not None:
|
||||
h = d.GetDialogItemAsControl(1)
|
||||
h.SetControlTitle(ok)
|
||||
if cancel is not None:
|
||||
h = d.GetDialogItemAsControl(2)
|
||||
h.SetControlTitle(cancel)
|
||||
d.SetDialogDefaultItem(Dialogs.ok)
|
||||
d.SetDialogCancelItem(Dialogs.cancel)
|
||||
d.AutoSizeDialog()
|
||||
d.GetDialogWindow().ShowWindow()
|
||||
while 1:
|
||||
n = ModalDialog(None)
|
||||
if n == 1:
|
||||
h = d.GetDialogItemAsControl(4)
|
||||
return cr2lf(GetControlData(pwd, kControlEditTextPart, kControlEditTextPasswordTag))
|
||||
if n == 2: return None
|
||||
|
||||
def AskYesNoCancel(question, default = 0, yes=None, no=None, cancel=None, id=262):
|
||||
"""Display a QUESTION string which can be answered with Yes or No.
|
||||
|
||||
Return 1 when the user clicks the Yes button.
|
||||
Return 0 when the user clicks the No button.
|
||||
Return -1 when the user clicks the Cancel button.
|
||||
|
||||
When the user presses Return, the DEFAULT value is returned.
|
||||
If omitted, this is 0 (No).
|
||||
|
||||
The QUESTION string can be at most 255 characters.
|
||||
"""
|
||||
|
||||
_initialize()
|
||||
_interact()
|
||||
d = GetNewDialog(id, -1)
|
||||
if not d:
|
||||
print "EasyDialogs: Can't get DLOG resource with id =", id, " (missing resource file?)"
|
||||
return
|
||||
# Button assignments:
|
||||
# 1 = default (invisible)
|
||||
# 2 = Yes
|
||||
# 3 = No
|
||||
# 4 = Cancel
|
||||
# The question string is item 5
|
||||
h = d.GetDialogItemAsControl(5)
|
||||
SetDialogItemText(h, lf2cr(question))
|
||||
if yes is not None:
|
||||
if yes == '':
|
||||
d.HideDialogItem(2)
|
||||
else:
|
||||
h = d.GetDialogItemAsControl(2)
|
||||
h.SetControlTitle(yes)
|
||||
if no is not None:
|
||||
if no == '':
|
||||
d.HideDialogItem(3)
|
||||
else:
|
||||
h = d.GetDialogItemAsControl(3)
|
||||
h.SetControlTitle(no)
|
||||
if cancel is not None:
|
||||
if cancel == '':
|
||||
d.HideDialogItem(4)
|
||||
else:
|
||||
h = d.GetDialogItemAsControl(4)
|
||||
h.SetControlTitle(cancel)
|
||||
d.SetDialogCancelItem(4)
|
||||
if default == 1:
|
||||
d.SetDialogDefaultItem(2)
|
||||
elif default == 0:
|
||||
d.SetDialogDefaultItem(3)
|
||||
elif default == -1:
|
||||
d.SetDialogDefaultItem(4)
|
||||
d.AutoSizeDialog()
|
||||
d.GetDialogWindow().ShowWindow()
|
||||
while 1:
|
||||
n = ModalDialog(None)
|
||||
if n == 1: return default
|
||||
if n == 2: return 1
|
||||
if n == 3: return 0
|
||||
if n == 4: return -1
|
||||
|
||||
|
||||
|
||||
# The deprecated Carbon QuickDraw APIs are no longer available as of
|
||||
# OS X 10.8. Raise an ImportError here in that case so that callers
|
||||
# of EasyDialogs, like BuildApplet, will do the right thing.
|
||||
|
||||
try:
|
||||
screenbounds = Qd.GetQDGlobalsScreenBits().bounds
|
||||
except AttributeError:
|
||||
raise ImportError("QuickDraw APIs not available")
|
||||
|
||||
screenbounds = screenbounds[0]+4, screenbounds[1]+4, \
|
||||
screenbounds[2]-4, screenbounds[3]-4
|
||||
|
||||
kControlProgressBarIndeterminateTag = 'inde' # from Controls.py
|
||||
|
||||
|
||||
class ProgressBar:
|
||||
def __init__(self, title="Working...", maxval=0, label="", id=263):
|
||||
self.w = None
|
||||
self.d = None
|
||||
_initialize()
|
||||
self.d = GetNewDialog(id, -1)
|
||||
self.w = self.d.GetDialogWindow()
|
||||
self.label(label)
|
||||
self.title(title)
|
||||
self.set(0, maxval)
|
||||
self.d.AutoSizeDialog()
|
||||
self.w.ShowWindow()
|
||||
self.d.DrawDialog()
|
||||
|
||||
def __del__(self):
|
||||
if self.w:
|
||||
self.w.BringToFront()
|
||||
self.w.HideWindow()
|
||||
del self.w
|
||||
del self.d
|
||||
|
||||
def title(self, newstr=""):
|
||||
"""title(text) - Set title of progress window"""
|
||||
self.w.BringToFront()
|
||||
self.w.SetWTitle(newstr)
|
||||
|
||||
def label(self, *newstr):
|
||||
"""label(text) - Set text in progress box"""
|
||||
self.w.BringToFront()
|
||||
if newstr:
|
||||
self._label = lf2cr(newstr[0])
|
||||
text_h = self.d.GetDialogItemAsControl(2)
|
||||
SetDialogItemText(text_h, self._label)
|
||||
|
||||
def _update(self, value):
|
||||
maxval = self.maxval
|
||||
if maxval == 0: # an indeterminate bar
|
||||
Ctl.IdleControls(self.w) # spin the barber pole
|
||||
else: # a determinate bar
|
||||
if maxval > 32767:
|
||||
value = int(value/(maxval/32767.0))
|
||||
maxval = 32767
|
||||
maxval = int(maxval)
|
||||
value = int(value)
|
||||
progbar = self.d.GetDialogItemAsControl(3)
|
||||
progbar.SetControlMaximum(maxval)
|
||||
progbar.SetControlValue(value) # set the bar length
|
||||
|
||||
# Test for cancel button
|
||||
ready, ev = Evt.WaitNextEvent( Events.mDownMask, 1 )
|
||||
if ready :
|
||||
what,msg,when,where,mod = ev
|
||||
part = Win.FindWindow(where)[0]
|
||||
if Dlg.IsDialogEvent(ev):
|
||||
ds = Dlg.DialogSelect(ev)
|
||||
if ds[0] and ds[1] == self.d and ds[-1] == 1:
|
||||
self.w.HideWindow()
|
||||
self.w = None
|
||||
self.d = None
|
||||
raise KeyboardInterrupt, ev
|
||||
else:
|
||||
if part == 4: # inDrag
|
||||
self.w.DragWindow(where, screenbounds)
|
||||
else:
|
||||
MacOS.HandleEvent(ev)
|
||||
|
||||
|
||||
def set(self, value, max=None):
|
||||
"""set(value) - Set progress bar position"""
|
||||
if max is not None:
|
||||
self.maxval = max
|
||||
bar = self.d.GetDialogItemAsControl(3)
|
||||
if max <= 0: # indeterminate bar
|
||||
bar.SetControlData(0,kControlProgressBarIndeterminateTag,'\x01')
|
||||
else: # determinate bar
|
||||
bar.SetControlData(0,kControlProgressBarIndeterminateTag,'\x00')
|
||||
if value < 0:
|
||||
value = 0
|
||||
elif value > self.maxval:
|
||||
value = self.maxval
|
||||
self.curval = value
|
||||
self._update(value)
|
||||
|
||||
def inc(self, n=1):
|
||||
"""inc(amt) - Increment progress bar position"""
|
||||
self.set(self.curval + n)
|
||||
|
||||
ARGV_ID=265
|
||||
ARGV_ITEM_OK=1
|
||||
ARGV_ITEM_CANCEL=2
|
||||
ARGV_OPTION_GROUP=3
|
||||
ARGV_OPTION_EXPLAIN=4
|
||||
ARGV_OPTION_VALUE=5
|
||||
ARGV_OPTION_ADD=6
|
||||
ARGV_COMMAND_GROUP=7
|
||||
ARGV_COMMAND_EXPLAIN=8
|
||||
ARGV_COMMAND_ADD=9
|
||||
ARGV_ADD_OLDFILE=10
|
||||
ARGV_ADD_NEWFILE=11
|
||||
ARGV_ADD_FOLDER=12
|
||||
ARGV_CMDLINE_GROUP=13
|
||||
ARGV_CMDLINE_DATA=14
|
||||
|
||||
##def _myModalDialog(d):
|
||||
## while 1:
|
||||
## ready, ev = Evt.WaitNextEvent(0xffff, -1)
|
||||
## print 'DBG: WNE', ready, ev
|
||||
## if ready :
|
||||
## what,msg,when,where,mod = ev
|
||||
## part, window = Win.FindWindow(where)
|
||||
## if Dlg.IsDialogEvent(ev):
|
||||
## didit, dlgdone, itemdone = Dlg.DialogSelect(ev)
|
||||
## print 'DBG: DialogSelect', didit, dlgdone, itemdone, d
|
||||
## if didit and dlgdone == d:
|
||||
## return itemdone
|
||||
## elif window == d.GetDialogWindow():
|
||||
## d.GetDialogWindow().SelectWindow()
|
||||
## if part == 4: # inDrag
|
||||
## d.DragWindow(where, screenbounds)
|
||||
## else:
|
||||
## MacOS.HandleEvent(ev)
|
||||
## else:
|
||||
## MacOS.HandleEvent(ev)
|
||||
##
|
||||
def _setmenu(control, items):
|
||||
mhandle = control.GetControlData_Handle(Controls.kControlMenuPart,
|
||||
Controls.kControlPopupButtonMenuHandleTag)
|
||||
menu = Menu.as_Menu(mhandle)
|
||||
for item in items:
|
||||
if type(item) == type(()):
|
||||
label = item[0]
|
||||
else:
|
||||
label = item
|
||||
if label[-1] == '=' or label[-1] == ':':
|
||||
label = label[:-1]
|
||||
menu.AppendMenu(label)
|
||||
## mhandle, mid = menu.getpopupinfo()
|
||||
## control.SetControlData_Handle(Controls.kControlMenuPart,
|
||||
## Controls.kControlPopupButtonMenuHandleTag, mhandle)
|
||||
control.SetControlMinimum(1)
|
||||
control.SetControlMaximum(len(items)+1)
|
||||
|
||||
def _selectoption(d, optionlist, idx):
|
||||
if idx < 0 or idx >= len(optionlist):
|
||||
MacOS.SysBeep()
|
||||
return
|
||||
option = optionlist[idx]
|
||||
if type(option) == type(()):
|
||||
if len(option) == 4:
|
||||
help = option[2]
|
||||
elif len(option) > 1:
|
||||
help = option[-1]
|
||||
else:
|
||||
help = ''
|
||||
else:
|
||||
help = ''
|
||||
h = d.GetDialogItemAsControl(ARGV_OPTION_EXPLAIN)
|
||||
if help and len(help) > 250:
|
||||
help = help[:250] + '...'
|
||||
Dlg.SetDialogItemText(h, help)
|
||||
hasvalue = 0
|
||||
if type(option) == type(()):
|
||||
label = option[0]
|
||||
else:
|
||||
label = option
|
||||
if label[-1] == '=' or label[-1] == ':':
|
||||
hasvalue = 1
|
||||
h = d.GetDialogItemAsControl(ARGV_OPTION_VALUE)
|
||||
Dlg.SetDialogItemText(h, '')
|
||||
if hasvalue:
|
||||
d.ShowDialogItem(ARGV_OPTION_VALUE)
|
||||
d.SelectDialogItemText(ARGV_OPTION_VALUE, 0, 0)
|
||||
else:
|
||||
d.HideDialogItem(ARGV_OPTION_VALUE)
|
||||
|
||||
|
||||
def GetArgv(optionlist=None, commandlist=None, addoldfile=1, addnewfile=1, addfolder=1, id=ARGV_ID):
|
||||
_initialize()
|
||||
_interact()
|
||||
d = GetNewDialog(id, -1)
|
||||
if not d:
|
||||
print "EasyDialogs: Can't get DLOG resource with id =", id, " (missing resource file?)"
|
||||
return
|
||||
# h = d.GetDialogItemAsControl(3)
|
||||
# SetDialogItemText(h, lf2cr(prompt))
|
||||
# h = d.GetDialogItemAsControl(4)
|
||||
# SetDialogItemText(h, lf2cr(default))
|
||||
# d.SelectDialogItemText(4, 0, 999)
|
||||
# d.SetDialogItem(4, 0, 255)
|
||||
if optionlist:
|
||||
_setmenu(d.GetDialogItemAsControl(ARGV_OPTION_GROUP), optionlist)
|
||||
_selectoption(d, optionlist, 0)
|
||||
else:
|
||||
d.GetDialogItemAsControl(ARGV_OPTION_GROUP).DeactivateControl()
|
||||
if commandlist:
|
||||
_setmenu(d.GetDialogItemAsControl(ARGV_COMMAND_GROUP), commandlist)
|
||||
if type(commandlist[0]) == type(()) and len(commandlist[0]) > 1:
|
||||
help = commandlist[0][-1]
|
||||
h = d.GetDialogItemAsControl(ARGV_COMMAND_EXPLAIN)
|
||||
Dlg.SetDialogItemText(h, help)
|
||||
else:
|
||||
d.GetDialogItemAsControl(ARGV_COMMAND_GROUP).DeactivateControl()
|
||||
if not addoldfile:
|
||||
d.GetDialogItemAsControl(ARGV_ADD_OLDFILE).DeactivateControl()
|
||||
if not addnewfile:
|
||||
d.GetDialogItemAsControl(ARGV_ADD_NEWFILE).DeactivateControl()
|
||||
if not addfolder:
|
||||
d.GetDialogItemAsControl(ARGV_ADD_FOLDER).DeactivateControl()
|
||||
d.SetDialogDefaultItem(ARGV_ITEM_OK)
|
||||
d.SetDialogCancelItem(ARGV_ITEM_CANCEL)
|
||||
d.GetDialogWindow().ShowWindow()
|
||||
d.DrawDialog()
|
||||
if hasattr(MacOS, 'SchedParams'):
|
||||
appsw = MacOS.SchedParams(1, 0)
|
||||
try:
|
||||
while 1:
|
||||
stringstoadd = []
|
||||
n = ModalDialog(None)
|
||||
if n == ARGV_ITEM_OK:
|
||||
break
|
||||
elif n == ARGV_ITEM_CANCEL:
|
||||
raise SystemExit
|
||||
elif n == ARGV_OPTION_GROUP:
|
||||
idx = d.GetDialogItemAsControl(ARGV_OPTION_GROUP).GetControlValue()-1
|
||||
_selectoption(d, optionlist, idx)
|
||||
elif n == ARGV_OPTION_VALUE:
|
||||
pass
|
||||
elif n == ARGV_OPTION_ADD:
|
||||
idx = d.GetDialogItemAsControl(ARGV_OPTION_GROUP).GetControlValue()-1
|
||||
if 0 <= idx < len(optionlist):
|
||||
option = optionlist[idx]
|
||||
if type(option) == type(()):
|
||||
option = option[0]
|
||||
if option[-1] == '=' or option[-1] == ':':
|
||||
option = option[:-1]
|
||||
h = d.GetDialogItemAsControl(ARGV_OPTION_VALUE)
|
||||
value = Dlg.GetDialogItemText(h)
|
||||
else:
|
||||
value = ''
|
||||
if len(option) == 1:
|
||||
stringtoadd = '-' + option
|
||||
else:
|
||||
stringtoadd = '--' + option
|
||||
stringstoadd = [stringtoadd]
|
||||
if value:
|
||||
stringstoadd.append(value)
|
||||
else:
|
||||
MacOS.SysBeep()
|
||||
elif n == ARGV_COMMAND_GROUP:
|
||||
idx = d.GetDialogItemAsControl(ARGV_COMMAND_GROUP).GetControlValue()-1
|
||||
if 0 <= idx < len(commandlist) and type(commandlist[idx]) == type(()) and \
|
||||
len(commandlist[idx]) > 1:
|
||||
help = commandlist[idx][-1]
|
||||
h = d.GetDialogItemAsControl(ARGV_COMMAND_EXPLAIN)
|
||||
Dlg.SetDialogItemText(h, help)
|
||||
elif n == ARGV_COMMAND_ADD:
|
||||
idx = d.GetDialogItemAsControl(ARGV_COMMAND_GROUP).GetControlValue()-1
|
||||
if 0 <= idx < len(commandlist):
|
||||
command = commandlist[idx]
|
||||
if type(command) == type(()):
|
||||
command = command[0]
|
||||
stringstoadd = [command]
|
||||
else:
|
||||
MacOS.SysBeep()
|
||||
elif n == ARGV_ADD_OLDFILE:
|
||||
pathname = AskFileForOpen()
|
||||
if pathname:
|
||||
stringstoadd = [pathname]
|
||||
elif n == ARGV_ADD_NEWFILE:
|
||||
pathname = AskFileForSave()
|
||||
if pathname:
|
||||
stringstoadd = [pathname]
|
||||
elif n == ARGV_ADD_FOLDER:
|
||||
pathname = AskFolder()
|
||||
if pathname:
|
||||
stringstoadd = [pathname]
|
||||
elif n == ARGV_CMDLINE_DATA:
|
||||
pass # Nothing to do
|
||||
else:
|
||||
raise RuntimeError, "Unknown dialog item %d"%n
|
||||
|
||||
for stringtoadd in stringstoadd:
|
||||
if '"' in stringtoadd or "'" in stringtoadd or " " in stringtoadd:
|
||||
stringtoadd = repr(stringtoadd)
|
||||
h = d.GetDialogItemAsControl(ARGV_CMDLINE_DATA)
|
||||
oldstr = GetDialogItemText(h)
|
||||
if oldstr and oldstr[-1] != ' ':
|
||||
oldstr = oldstr + ' '
|
||||
oldstr = oldstr + stringtoadd
|
||||
if oldstr[-1] != ' ':
|
||||
oldstr = oldstr + ' '
|
||||
SetDialogItemText(h, oldstr)
|
||||
d.SelectDialogItemText(ARGV_CMDLINE_DATA, 0x7fff, 0x7fff)
|
||||
h = d.GetDialogItemAsControl(ARGV_CMDLINE_DATA)
|
||||
oldstr = GetDialogItemText(h)
|
||||
tmplist = string.split(oldstr)
|
||||
newlist = []
|
||||
while tmplist:
|
||||
item = tmplist[0]
|
||||
del tmplist[0]
|
||||
if item[0] == '"':
|
||||
while item[-1] != '"':
|
||||
if not tmplist:
|
||||
raise RuntimeError, "Unterminated quoted argument"
|
||||
item = item + ' ' + tmplist[0]
|
||||
del tmplist[0]
|
||||
item = item[1:-1]
|
||||
if item[0] == "'":
|
||||
while item[-1] != "'":
|
||||
if not tmplist:
|
||||
raise RuntimeError, "Unterminated quoted argument"
|
||||
item = item + ' ' + tmplist[0]
|
||||
del tmplist[0]
|
||||
item = item[1:-1]
|
||||
newlist.append(item)
|
||||
return newlist
|
||||
finally:
|
||||
if hasattr(MacOS, 'SchedParams'):
|
||||
MacOS.SchedParams(*appsw)
|
||||
del d
|
||||
|
||||
def _process_Nav_args(dftflags, **args):
|
||||
import Carbon.AppleEvents
|
||||
import Carbon.AE
|
||||
import Carbon.File
|
||||
for k in args.keys():
|
||||
if args[k] is None:
|
||||
del args[k]
|
||||
# Set some defaults, and modify some arguments
|
||||
if 'dialogOptionFlags' not in args:
|
||||
args['dialogOptionFlags'] = dftflags
|
||||
if 'defaultLocation' in args and \
|
||||
not isinstance(args['defaultLocation'], Carbon.AE.AEDesc):
|
||||
defaultLocation = args['defaultLocation']
|
||||
if isinstance(defaultLocation, Carbon.File.FSSpec):
|
||||
args['defaultLocation'] = Carbon.AE.AECreateDesc(
|
||||
Carbon.AppleEvents.typeFSS, defaultLocation.data)
|
||||
else:
|
||||
if not isinstance(defaultLocation, Carbon.File.FSRef):
|
||||
defaultLocation = Carbon.File.FSRef(defaultLocation)
|
||||
args['defaultLocation'] = Carbon.AE.AECreateDesc(
|
||||
Carbon.AppleEvents.typeFSRef, defaultLocation.data)
|
||||
if 'typeList' in args and not isinstance(args['typeList'], Carbon.Res.ResourceType):
|
||||
typeList = args['typeList'][:]
|
||||
# Workaround for OSX typeless files:
|
||||
if 'TEXT' in typeList and not '\0\0\0\0' in typeList:
|
||||
typeList = typeList + ('\0\0\0\0',)
|
||||
data = 'Pyth' + struct.pack("hh", 0, len(typeList))
|
||||
for type in typeList:
|
||||
data = data+type
|
||||
args['typeList'] = Carbon.Res.Handle(data)
|
||||
tpwanted = str
|
||||
if 'wanted' in args:
|
||||
tpwanted = args['wanted']
|
||||
del args['wanted']
|
||||
return args, tpwanted
|
||||
|
||||
def _dummy_Nav_eventproc(msg, data):
|
||||
pass
|
||||
|
||||
_default_Nav_eventproc = _dummy_Nav_eventproc
|
||||
|
||||
def SetDefaultEventProc(proc):
|
||||
global _default_Nav_eventproc
|
||||
rv = _default_Nav_eventproc
|
||||
if proc is None:
|
||||
proc = _dummy_Nav_eventproc
|
||||
_default_Nav_eventproc = proc
|
||||
return rv
|
||||
|
||||
def AskFileForOpen(
|
||||
message=None,
|
||||
typeList=None,
|
||||
# From here on the order is not documented
|
||||
version=None,
|
||||
defaultLocation=None,
|
||||
dialogOptionFlags=None,
|
||||
location=None,
|
||||
clientName=None,
|
||||
windowTitle=None,
|
||||
actionButtonLabel=None,
|
||||
cancelButtonLabel=None,
|
||||
preferenceKey=None,
|
||||
popupExtension=None,
|
||||
eventProc=_dummy_Nav_eventproc,
|
||||
previewProc=None,
|
||||
filterProc=None,
|
||||
wanted=None,
|
||||
multiple=None):
|
||||
"""Display a dialog asking the user for a file to open.
|
||||
|
||||
wanted is the return type wanted: FSSpec, FSRef, unicode or string (default)
|
||||
the other arguments can be looked up in Apple's Navigation Services documentation"""
|
||||
|
||||
default_flags = 0x56 # Or 0xe4?
|
||||
args, tpwanted = _process_Nav_args(default_flags, version=version,
|
||||
defaultLocation=defaultLocation, dialogOptionFlags=dialogOptionFlags,
|
||||
location=location,clientName=clientName,windowTitle=windowTitle,
|
||||
actionButtonLabel=actionButtonLabel,cancelButtonLabel=cancelButtonLabel,
|
||||
message=message,preferenceKey=preferenceKey,
|
||||
popupExtension=popupExtension,eventProc=eventProc,previewProc=previewProc,
|
||||
filterProc=filterProc,typeList=typeList,wanted=wanted,multiple=multiple)
|
||||
_interact()
|
||||
try:
|
||||
rr = Nav.NavChooseFile(args)
|
||||
good = 1
|
||||
except Nav.error, arg:
|
||||
if arg[0] != -128: # userCancelledErr
|
||||
raise Nav.error, arg
|
||||
return None
|
||||
if not rr.validRecord or not rr.selection:
|
||||
return None
|
||||
if issubclass(tpwanted, Carbon.File.FSRef):
|
||||
return tpwanted(rr.selection_fsr[0])
|
||||
if issubclass(tpwanted, Carbon.File.FSSpec):
|
||||
return tpwanted(rr.selection[0])
|
||||
if issubclass(tpwanted, str):
|
||||
return tpwanted(rr.selection_fsr[0].as_pathname())
|
||||
if issubclass(tpwanted, unicode):
|
||||
return tpwanted(rr.selection_fsr[0].as_pathname(), 'utf8')
|
||||
raise TypeError, "Unknown value for argument 'wanted': %s" % repr(tpwanted)
|
||||
|
||||
def AskFileForSave(
|
||||
message=None,
|
||||
savedFileName=None,
|
||||
# From here on the order is not documented
|
||||
version=None,
|
||||
defaultLocation=None,
|
||||
dialogOptionFlags=None,
|
||||
location=None,
|
||||
clientName=None,
|
||||
windowTitle=None,
|
||||
actionButtonLabel=None,
|
||||
cancelButtonLabel=None,
|
||||
preferenceKey=None,
|
||||
popupExtension=None,
|
||||
eventProc=_dummy_Nav_eventproc,
|
||||
fileType=None,
|
||||
fileCreator=None,
|
||||
wanted=None,
|
||||
multiple=None):
|
||||
"""Display a dialog asking the user for a filename to save to.
|
||||
|
||||
wanted is the return type wanted: FSSpec, FSRef, unicode or string (default)
|
||||
the other arguments can be looked up in Apple's Navigation Services documentation"""
|
||||
|
||||
|
||||
default_flags = 0x07
|
||||
args, tpwanted = _process_Nav_args(default_flags, version=version,
|
||||
defaultLocation=defaultLocation, dialogOptionFlags=dialogOptionFlags,
|
||||
location=location,clientName=clientName,windowTitle=windowTitle,
|
||||
actionButtonLabel=actionButtonLabel,cancelButtonLabel=cancelButtonLabel,
|
||||
savedFileName=savedFileName,message=message,preferenceKey=preferenceKey,
|
||||
popupExtension=popupExtension,eventProc=eventProc,fileType=fileType,
|
||||
fileCreator=fileCreator,wanted=wanted,multiple=multiple)
|
||||
_interact()
|
||||
try:
|
||||
rr = Nav.NavPutFile(args)
|
||||
good = 1
|
||||
except Nav.error, arg:
|
||||
if arg[0] != -128: # userCancelledErr
|
||||
raise Nav.error, arg
|
||||
return None
|
||||
if not rr.validRecord or not rr.selection:
|
||||
return None
|
||||
if issubclass(tpwanted, Carbon.File.FSRef):
|
||||
raise TypeError, "Cannot pass wanted=FSRef to AskFileForSave"
|
||||
if issubclass(tpwanted, Carbon.File.FSSpec):
|
||||
return tpwanted(rr.selection[0])
|
||||
if issubclass(tpwanted, (str, unicode)):
|
||||
# This is gross, and probably incorrect too
|
||||
vrefnum, dirid, name = rr.selection[0].as_tuple()
|
||||
pardir_fss = Carbon.File.FSSpec((vrefnum, dirid, ''))
|
||||
pardir_fsr = Carbon.File.FSRef(pardir_fss)
|
||||
pardir_path = pardir_fsr.FSRefMakePath() # This is utf-8
|
||||
name_utf8 = unicode(name, 'macroman').encode('utf8')
|
||||
fullpath = os.path.join(pardir_path, name_utf8)
|
||||
if issubclass(tpwanted, unicode):
|
||||
return unicode(fullpath, 'utf8')
|
||||
return tpwanted(fullpath)
|
||||
raise TypeError, "Unknown value for argument 'wanted': %s" % repr(tpwanted)
|
||||
|
||||
def AskFolder(
|
||||
message=None,
|
||||
# From here on the order is not documented
|
||||
version=None,
|
||||
defaultLocation=None,
|
||||
dialogOptionFlags=None,
|
||||
location=None,
|
||||
clientName=None,
|
||||
windowTitle=None,
|
||||
actionButtonLabel=None,
|
||||
cancelButtonLabel=None,
|
||||
preferenceKey=None,
|
||||
popupExtension=None,
|
||||
eventProc=_dummy_Nav_eventproc,
|
||||
filterProc=None,
|
||||
wanted=None,
|
||||
multiple=None):
|
||||
"""Display a dialog asking the user for select a folder.
|
||||
|
||||
wanted is the return type wanted: FSSpec, FSRef, unicode or string (default)
|
||||
the other arguments can be looked up in Apple's Navigation Services documentation"""
|
||||
|
||||
default_flags = 0x17
|
||||
args, tpwanted = _process_Nav_args(default_flags, version=version,
|
||||
defaultLocation=defaultLocation, dialogOptionFlags=dialogOptionFlags,
|
||||
location=location,clientName=clientName,windowTitle=windowTitle,
|
||||
actionButtonLabel=actionButtonLabel,cancelButtonLabel=cancelButtonLabel,
|
||||
message=message,preferenceKey=preferenceKey,
|
||||
popupExtension=popupExtension,eventProc=eventProc,filterProc=filterProc,
|
||||
wanted=wanted,multiple=multiple)
|
||||
_interact()
|
||||
try:
|
||||
rr = Nav.NavChooseFolder(args)
|
||||
good = 1
|
||||
except Nav.error, arg:
|
||||
if arg[0] != -128: # userCancelledErr
|
||||
raise Nav.error, arg
|
||||
return None
|
||||
if not rr.validRecord or not rr.selection:
|
||||
return None
|
||||
if issubclass(tpwanted, Carbon.File.FSRef):
|
||||
return tpwanted(rr.selection_fsr[0])
|
||||
if issubclass(tpwanted, Carbon.File.FSSpec):
|
||||
return tpwanted(rr.selection[0])
|
||||
if issubclass(tpwanted, str):
|
||||
return tpwanted(rr.selection_fsr[0].as_pathname())
|
||||
if issubclass(tpwanted, unicode):
|
||||
return tpwanted(rr.selection_fsr[0].as_pathname(), 'utf8')
|
||||
raise TypeError, "Unknown value for argument 'wanted': %s" % repr(tpwanted)
|
||||
|
||||
|
||||
def test():
|
||||
import time
|
||||
|
||||
Message("Testing EasyDialogs.")
|
||||
optionlist = (('v', 'Verbose'), ('verbose', 'Verbose as long option'),
|
||||
('flags=', 'Valued option'), ('f:', 'Short valued option'))
|
||||
commandlist = (('start', 'Start something'), ('stop', 'Stop something'))
|
||||
argv = GetArgv(optionlist=optionlist, commandlist=commandlist, addoldfile=0)
|
||||
Message("Command line: %s"%' '.join(argv))
|
||||
for i in range(len(argv)):
|
||||
print 'arg[%d] = %r' % (i, argv[i])
|
||||
ok = AskYesNoCancel("Do you want to proceed?")
|
||||
ok = AskYesNoCancel("Do you want to identify?", yes="Identify", no="No")
|
||||
if ok > 0:
|
||||
s = AskString("Enter your first name", "Joe")
|
||||
s2 = AskPassword("Okay %s, tell us your nickname"%s, s, cancel="None")
|
||||
if not s2:
|
||||
Message("%s has no secret nickname"%s)
|
||||
else:
|
||||
Message("Hello everybody!!\nThe secret nickname of %s is %s!!!"%(s, s2))
|
||||
else:
|
||||
s = 'Anonymous'
|
||||
rv = AskFileForOpen(message="Gimme a file, %s"%s, wanted=Carbon.File.FSSpec)
|
||||
Message("rv: %s"%rv)
|
||||
rv = AskFileForSave(wanted=Carbon.File.FSRef, savedFileName="%s.txt"%s)
|
||||
Message("rv.as_pathname: %s"%rv.as_pathname())
|
||||
rv = AskFolder()
|
||||
Message("Folder name: %s"%rv)
|
||||
text = ( "Working Hard...", "Hardly Working..." ,
|
||||
"So far, so good!", "Keep on truckin'" )
|
||||
bar = ProgressBar("Progress, progress...", 0, label="Ramping up...")
|
||||
try:
|
||||
if hasattr(MacOS, 'SchedParams'):
|
||||
appsw = MacOS.SchedParams(1, 0)
|
||||
for i in xrange(20):
|
||||
bar.inc()
|
||||
time.sleep(0.05)
|
||||
bar.set(0,100)
|
||||
for i in xrange(100):
|
||||
bar.set(i)
|
||||
time.sleep(0.05)
|
||||
if i % 10 == 0:
|
||||
bar.label(text[(i/10) % 4])
|
||||
bar.label("Done.")
|
||||
time.sleep(1.0) # give'em a chance to see "Done."
|
||||
finally:
|
||||
del bar
|
||||
if hasattr(MacOS, 'SchedParams'):
|
||||
MacOS.SchedParams(*appsw)
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
test()
|
||||
except KeyboardInterrupt:
|
||||
Message("Operation Canceled.")
|
||||
1126
Darwin/lib/python2.7/plat-mac/FrameWork.py
Normal file
1126
Darwin/lib/python2.7/plat-mac/FrameWork.py
Normal file
File diff suppressed because it is too large
Load diff
200
Darwin/lib/python2.7/plat-mac/MiniAEFrame.py
Normal file
200
Darwin/lib/python2.7/plat-mac/MiniAEFrame.py
Normal file
|
|
@ -0,0 +1,200 @@
|
|||
"""MiniAEFrame - A minimal AppleEvent Application framework.
|
||||
|
||||
There are two classes:
|
||||
AEServer -- a mixin class offering nice AE handling.
|
||||
MiniApplication -- a very minimal alternative to FrameWork.py,
|
||||
only suitable for the simplest of AppleEvent servers.
|
||||
"""
|
||||
|
||||
from warnings import warnpy3k
|
||||
warnpy3k("In 3.x, the MiniAEFrame module is removed.", stacklevel=2)
|
||||
|
||||
import traceback
|
||||
import MacOS
|
||||
from Carbon import AE
|
||||
from Carbon.AppleEvents import *
|
||||
from Carbon import Evt
|
||||
from Carbon.Events import *
|
||||
from Carbon import Menu
|
||||
from Carbon import Win
|
||||
from Carbon.Windows import *
|
||||
from Carbon import Qd
|
||||
|
||||
import aetools
|
||||
import EasyDialogs
|
||||
|
||||
kHighLevelEvent = 23 # Not defined anywhere for Python yet?
|
||||
|
||||
|
||||
class MiniApplication:
|
||||
|
||||
"""A minimal FrameWork.Application-like class"""
|
||||
|
||||
def __init__(self):
|
||||
self.quitting = 0
|
||||
# Initialize menu
|
||||
self.appleid = 1
|
||||
self.quitid = 2
|
||||
Menu.ClearMenuBar()
|
||||
self.applemenu = applemenu = Menu.NewMenu(self.appleid, "\024")
|
||||
applemenu.AppendMenu("%s;(-" % self.getaboutmenutext())
|
||||
if MacOS.runtimemodel == 'ppc':
|
||||
applemenu.AppendResMenu('DRVR')
|
||||
applemenu.InsertMenu(0)
|
||||
self.quitmenu = Menu.NewMenu(self.quitid, "File")
|
||||
self.quitmenu.AppendMenu("Quit")
|
||||
self.quitmenu.SetItemCmd(1, ord("Q"))
|
||||
self.quitmenu.InsertMenu(0)
|
||||
Menu.DrawMenuBar()
|
||||
|
||||
def __del__(self):
|
||||
self.close()
|
||||
|
||||
def close(self):
|
||||
pass
|
||||
|
||||
def mainloop(self, mask = everyEvent, timeout = 60*60):
|
||||
while not self.quitting:
|
||||
self.dooneevent(mask, timeout)
|
||||
|
||||
def _quit(self):
|
||||
self.quitting = 1
|
||||
|
||||
def dooneevent(self, mask = everyEvent, timeout = 60*60):
|
||||
got, event = Evt.WaitNextEvent(mask, timeout)
|
||||
if got:
|
||||
self.lowlevelhandler(event)
|
||||
|
||||
def lowlevelhandler(self, event):
|
||||
what, message, when, where, modifiers = event
|
||||
h, v = where
|
||||
if what == kHighLevelEvent:
|
||||
msg = "High Level Event: %r %r" % (code(message), code(h | (v<<16)))
|
||||
try:
|
||||
AE.AEProcessAppleEvent(event)
|
||||
except AE.Error, err:
|
||||
print 'AE error: ', err
|
||||
print 'in', msg
|
||||
traceback.print_exc()
|
||||
return
|
||||
elif what == keyDown:
|
||||
c = chr(message & charCodeMask)
|
||||
if modifiers & cmdKey:
|
||||
if c == '.':
|
||||
raise KeyboardInterrupt, "Command-period"
|
||||
if c == 'q':
|
||||
if hasattr(MacOS, 'OutputSeen'):
|
||||
MacOS.OutputSeen()
|
||||
self.quitting = 1
|
||||
return
|
||||
elif what == mouseDown:
|
||||
partcode, window = Win.FindWindow(where)
|
||||
if partcode == inMenuBar:
|
||||
result = Menu.MenuSelect(where)
|
||||
id = (result>>16) & 0xffff # Hi word
|
||||
item = result & 0xffff # Lo word
|
||||
if id == self.appleid:
|
||||
if item == 1:
|
||||
EasyDialogs.Message(self.getabouttext())
|
||||
elif item > 1 and hasattr(Menu, 'OpenDeskAcc'):
|
||||
name = self.applemenu.GetMenuItemText(item)
|
||||
Menu.OpenDeskAcc(name)
|
||||
elif id == self.quitid and item == 1:
|
||||
if hasattr(MacOS, 'OutputSeen'):
|
||||
MacOS.OutputSeen()
|
||||
self.quitting = 1
|
||||
Menu.HiliteMenu(0)
|
||||
return
|
||||
# Anything not handled is passed to Python/SIOUX
|
||||
if hasattr(MacOS, 'HandleEvent'):
|
||||
MacOS.HandleEvent(event)
|
||||
else:
|
||||
print "Unhandled event:", event
|
||||
|
||||
def getabouttext(self):
|
||||
return self.__class__.__name__
|
||||
|
||||
def getaboutmenutext(self):
|
||||
return "About %s\311" % self.__class__.__name__
|
||||
|
||||
|
||||
class AEServer:
|
||||
|
||||
def __init__(self):
|
||||
self.ae_handlers = {}
|
||||
|
||||
def installaehandler(self, classe, type, callback):
|
||||
AE.AEInstallEventHandler(classe, type, self.callback_wrapper)
|
||||
self.ae_handlers[(classe, type)] = callback
|
||||
|
||||
def close(self):
|
||||
for classe, type in self.ae_handlers.keys():
|
||||
AE.AERemoveEventHandler(classe, type)
|
||||
|
||||
def callback_wrapper(self, _request, _reply):
|
||||
_parameters, _attributes = aetools.unpackevent(_request)
|
||||
_class = _attributes['evcl'].type
|
||||
_type = _attributes['evid'].type
|
||||
|
||||
if (_class, _type) in self.ae_handlers:
|
||||
_function = self.ae_handlers[(_class, _type)]
|
||||
elif (_class, '****') in self.ae_handlers:
|
||||
_function = self.ae_handlers[(_class, '****')]
|
||||
elif ('****', '****') in self.ae_handlers:
|
||||
_function = self.ae_handlers[('****', '****')]
|
||||
else:
|
||||
raise 'Cannot happen: AE callback without handler', (_class, _type)
|
||||
|
||||
# XXXX Do key-to-name mapping here
|
||||
|
||||
_parameters['_attributes'] = _attributes
|
||||
_parameters['_class'] = _class
|
||||
_parameters['_type'] = _type
|
||||
if '----' in _parameters:
|
||||
_object = _parameters['----']
|
||||
del _parameters['----']
|
||||
# The try/except that used to be here can mask programmer errors.
|
||||
# Let the program crash, the programmer can always add a **args
|
||||
# to the formal parameter list.
|
||||
rv = _function(_object, **_parameters)
|
||||
else:
|
||||
#Same try/except comment as above
|
||||
rv = _function(**_parameters)
|
||||
|
||||
if rv is None:
|
||||
aetools.packevent(_reply, {})
|
||||
else:
|
||||
aetools.packevent(_reply, {'----':rv})
|
||||
|
||||
|
||||
def code(x):
|
||||
"Convert a long int to the 4-character code it really is"
|
||||
s = ''
|
||||
for i in range(4):
|
||||
x, c = divmod(x, 256)
|
||||
s = chr(c) + s
|
||||
return s
|
||||
|
||||
class _Test(AEServer, MiniApplication):
|
||||
"""Mini test application, handles required events"""
|
||||
|
||||
def __init__(self):
|
||||
MiniApplication.__init__(self)
|
||||
AEServer.__init__(self)
|
||||
self.installaehandler('aevt', 'oapp', self.open_app)
|
||||
self.installaehandler('aevt', 'quit', self.quit)
|
||||
self.installaehandler('****', '****', self.other)
|
||||
self.mainloop()
|
||||
|
||||
def quit(self, **args):
|
||||
self._quit()
|
||||
|
||||
def open_app(self, **args):
|
||||
pass
|
||||
|
||||
def other(self, _object=None, _class=None, _type=None, **args):
|
||||
print 'AppleEvent', (_class, _type), 'for', _object, 'Other args:', args
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
_Test()
|
||||
218
Darwin/lib/python2.7/plat-mac/PixMapWrapper.py
Normal file
218
Darwin/lib/python2.7/plat-mac/PixMapWrapper.py
Normal file
|
|
@ -0,0 +1,218 @@
|
|||
"""PixMapWrapper - defines the PixMapWrapper class, which wraps an opaque
|
||||
QuickDraw PixMap data structure in a handy Python class. Also provides
|
||||
methods to convert to/from pixel data (from, e.g., the img module) or a
|
||||
Python Imaging Library Image object.
|
||||
|
||||
J. Strout <joe@strout.net> February 1999"""
|
||||
|
||||
|
||||
from warnings import warnpy3k
|
||||
warnpy3k("In 3.x, the PixMapWrapper module is removed.", stacklevel=2)
|
||||
|
||||
from Carbon import Qd
|
||||
from Carbon import QuickDraw
|
||||
import struct
|
||||
import MacOS
|
||||
import img
|
||||
import imgformat
|
||||
|
||||
# PixMap data structure element format (as used with struct)
|
||||
_pmElemFormat = {
|
||||
'baseAddr':'l', # address of pixel data
|
||||
'rowBytes':'H', # bytes per row, plus 0x8000
|
||||
'bounds':'hhhh', # coordinates imposed over pixel data
|
||||
'top':'h',
|
||||
'left':'h',
|
||||
'bottom':'h',
|
||||
'right':'h',
|
||||
'pmVersion':'h', # flags for Color QuickDraw
|
||||
'packType':'h', # format of compression algorithm
|
||||
'packSize':'l', # size after compression
|
||||
'hRes':'l', # horizontal pixels per inch
|
||||
'vRes':'l', # vertical pixels per inch
|
||||
'pixelType':'h', # pixel format
|
||||
'pixelSize':'h', # bits per pixel
|
||||
'cmpCount':'h', # color components per pixel
|
||||
'cmpSize':'h', # bits per component
|
||||
'planeBytes':'l', # offset in bytes to next plane
|
||||
'pmTable':'l', # handle to color table
|
||||
'pmReserved':'l' # reserved for future use
|
||||
}
|
||||
|
||||
# PixMap data structure element offset
|
||||
_pmElemOffset = {
|
||||
'baseAddr':0,
|
||||
'rowBytes':4,
|
||||
'bounds':6,
|
||||
'top':6,
|
||||
'left':8,
|
||||
'bottom':10,
|
||||
'right':12,
|
||||
'pmVersion':14,
|
||||
'packType':16,
|
||||
'packSize':18,
|
||||
'hRes':22,
|
||||
'vRes':26,
|
||||
'pixelType':30,
|
||||
'pixelSize':32,
|
||||
'cmpCount':34,
|
||||
'cmpSize':36,
|
||||
'planeBytes':38,
|
||||
'pmTable':42,
|
||||
'pmReserved':46
|
||||
}
|
||||
|
||||
class PixMapWrapper:
|
||||
"""PixMapWrapper -- wraps the QD PixMap object in a Python class,
|
||||
with methods to easily get/set various pixmap fields. Note: Use the
|
||||
PixMap() method when passing to QD calls."""
|
||||
|
||||
def __init__(self):
|
||||
self.__dict__['data'] = ''
|
||||
self._header = struct.pack("lhhhhhhhlllhhhhlll",
|
||||
id(self.data)+MacOS.string_id_to_buffer,
|
||||
0, # rowBytes
|
||||
0, 0, 0, 0, # bounds
|
||||
0, # pmVersion
|
||||
0, 0, # packType, packSize
|
||||
72<<16, 72<<16, # hRes, vRes
|
||||
QuickDraw.RGBDirect, # pixelType
|
||||
16, # pixelSize
|
||||
2, 5, # cmpCount, cmpSize,
|
||||
0, 0, 0) # planeBytes, pmTable, pmReserved
|
||||
self.__dict__['_pm'] = Qd.RawBitMap(self._header)
|
||||
|
||||
def _stuff(self, element, bytes):
|
||||
offset = _pmElemOffset[element]
|
||||
fmt = _pmElemFormat[element]
|
||||
self._header = self._header[:offset] \
|
||||
+ struct.pack(fmt, bytes) \
|
||||
+ self._header[offset + struct.calcsize(fmt):]
|
||||
self.__dict__['_pm'] = None
|
||||
|
||||
def _unstuff(self, element):
|
||||
offset = _pmElemOffset[element]
|
||||
fmt = _pmElemFormat[element]
|
||||
return struct.unpack(fmt, self._header[offset:offset+struct.calcsize(fmt)])[0]
|
||||
|
||||
def __setattr__(self, attr, val):
|
||||
if attr == 'baseAddr':
|
||||
raise 'UseErr', "don't assign to .baseAddr -- assign to .data instead"
|
||||
elif attr == 'data':
|
||||
self.__dict__['data'] = val
|
||||
self._stuff('baseAddr', id(self.data) + MacOS.string_id_to_buffer)
|
||||
elif attr == 'rowBytes':
|
||||
# high bit is always set for some odd reason
|
||||
self._stuff('rowBytes', val | 0x8000)
|
||||
elif attr == 'bounds':
|
||||
# assume val is in official Left, Top, Right, Bottom order!
|
||||
self._stuff('left',val[0])
|
||||
self._stuff('top',val[1])
|
||||
self._stuff('right',val[2])
|
||||
self._stuff('bottom',val[3])
|
||||
elif attr == 'hRes' or attr == 'vRes':
|
||||
# 16.16 fixed format, so just shift 16 bits
|
||||
self._stuff(attr, int(val) << 16)
|
||||
elif attr in _pmElemFormat.keys():
|
||||
# any other pm attribute -- just stuff
|
||||
self._stuff(attr, val)
|
||||
else:
|
||||
self.__dict__[attr] = val
|
||||
|
||||
def __getattr__(self, attr):
|
||||
if attr == 'rowBytes':
|
||||
# high bit is always set for some odd reason
|
||||
return self._unstuff('rowBytes') & 0x7FFF
|
||||
elif attr == 'bounds':
|
||||
# return bounds in official Left, Top, Right, Bottom order!
|
||||
return ( \
|
||||
self._unstuff('left'),
|
||||
self._unstuff('top'),
|
||||
self._unstuff('right'),
|
||||
self._unstuff('bottom') )
|
||||
elif attr == 'hRes' or attr == 'vRes':
|
||||
# 16.16 fixed format, so just shift 16 bits
|
||||
return self._unstuff(attr) >> 16
|
||||
elif attr in _pmElemFormat.keys():
|
||||
# any other pm attribute -- just unstuff
|
||||
return self._unstuff(attr)
|
||||
else:
|
||||
return self.__dict__[attr]
|
||||
|
||||
|
||||
def PixMap(self):
|
||||
"Return a QuickDraw PixMap corresponding to this data."
|
||||
if not self.__dict__['_pm']:
|
||||
self.__dict__['_pm'] = Qd.RawBitMap(self._header)
|
||||
return self.__dict__['_pm']
|
||||
|
||||
def blit(self, x1=0,y1=0,x2=None,y2=None, port=None):
|
||||
"""Draw this pixmap into the given (default current) grafport."""
|
||||
src = self.bounds
|
||||
dest = [x1,y1,x2,y2]
|
||||
if x2 is None:
|
||||
dest[2] = x1 + src[2]-src[0]
|
||||
if y2 is None:
|
||||
dest[3] = y1 + src[3]-src[1]
|
||||
if not port: port = Qd.GetPort()
|
||||
Qd.CopyBits(self.PixMap(), port.GetPortBitMapForCopyBits(), src, tuple(dest),
|
||||
QuickDraw.srcCopy, None)
|
||||
|
||||
def fromstring(self,s,width,height,format=imgformat.macrgb):
|
||||
"""Stuff this pixmap with raw pixel data from a string.
|
||||
Supply width, height, and one of the imgformat specifiers."""
|
||||
# we only support 16- and 32-bit mac rgb...
|
||||
# so convert if necessary
|
||||
if format != imgformat.macrgb and format != imgformat.macrgb16:
|
||||
# (LATER!)
|
||||
raise "NotImplementedError", "conversion to macrgb or macrgb16"
|
||||
self.data = s
|
||||
self.bounds = (0,0,width,height)
|
||||
self.cmpCount = 3
|
||||
self.pixelType = QuickDraw.RGBDirect
|
||||
if format == imgformat.macrgb:
|
||||
self.pixelSize = 32
|
||||
self.cmpSize = 8
|
||||
else:
|
||||
self.pixelSize = 16
|
||||
self.cmpSize = 5
|
||||
self.rowBytes = width*self.pixelSize/8
|
||||
|
||||
def tostring(self, format=imgformat.macrgb):
|
||||
"""Return raw data as a string in the specified format."""
|
||||
# is the native format requested? if so, just return data
|
||||
if (format == imgformat.macrgb and self.pixelSize == 32) or \
|
||||
(format == imgformat.macrgb16 and self.pixelsize == 16):
|
||||
return self.data
|
||||
# otherwise, convert to the requested format
|
||||
# (LATER!)
|
||||
raise "NotImplementedError", "data format conversion"
|
||||
|
||||
def fromImage(self,im):
|
||||
"""Initialize this PixMap from a PIL Image object."""
|
||||
# We need data in ARGB format; PIL can't currently do that,
|
||||
# but it can do RGBA, which we can use by inserting one null
|
||||
# up frontpm =
|
||||
if im.mode != 'RGBA': im = im.convert('RGBA')
|
||||
data = chr(0) + im.tostring()
|
||||
self.fromstring(data, im.size[0], im.size[1])
|
||||
|
||||
def toImage(self):
|
||||
"""Return the contents of this PixMap as a PIL Image object."""
|
||||
import Image
|
||||
# our tostring() method returns data in ARGB format,
|
||||
# whereas Image uses RGBA; a bit of slicing fixes this...
|
||||
data = self.tostring()[1:] + chr(0)
|
||||
bounds = self.bounds
|
||||
return Image.fromstring('RGBA',(bounds[2]-bounds[0],bounds[3]-bounds[1]),data)
|
||||
|
||||
def test():
|
||||
import MacOS
|
||||
import EasyDialogs
|
||||
import Image
|
||||
path = EasyDialogs.AskFileForOpen("Image File:")
|
||||
if not path: return
|
||||
pm = PixMapWrapper()
|
||||
pm.fromImage( Image.open(path) )
|
||||
pm.blit(20,20)
|
||||
return pm
|
||||
369
Darwin/lib/python2.7/plat-mac/aepack.py
Normal file
369
Darwin/lib/python2.7/plat-mac/aepack.py
Normal file
|
|
@ -0,0 +1,369 @@
|
|||
"""Tools for use in AppleEvent clients and servers:
|
||||
conversion between AE types and python types
|
||||
|
||||
pack(x) converts a Python object to an AEDesc object
|
||||
unpack(desc) does the reverse
|
||||
coerce(x, wanted_sample) coerces a python object to another python object
|
||||
"""
|
||||
|
||||
#
|
||||
# This code was originally written by Guido, and modified/extended by Jack
|
||||
# to include the various types that were missing. The reference used is
|
||||
# Apple Event Registry, chapter 9.
|
||||
#
|
||||
|
||||
from warnings import warnpy3k
|
||||
warnpy3k("In 3.x, the aepack module is removed.", stacklevel=2)
|
||||
|
||||
import struct
|
||||
import types
|
||||
from types import *
|
||||
from Carbon import AE
|
||||
from Carbon.AppleEvents import *
|
||||
import MacOS
|
||||
import Carbon.File
|
||||
import aetypes
|
||||
from aetypes import mkenum, ObjectSpecifier
|
||||
|
||||
# These ones seem to be missing from AppleEvents
|
||||
# (they're in AERegistry.h)
|
||||
|
||||
#typeColorTable = 'clrt'
|
||||
#typeDrawingArea = 'cdrw'
|
||||
#typePixelMap = 'cpix'
|
||||
#typePixelMapMinus = 'tpmm'
|
||||
#typeRotation = 'trot'
|
||||
#typeTextStyles = 'tsty'
|
||||
#typeStyledText = 'STXT'
|
||||
#typeAEText = 'tTXT'
|
||||
#typeEnumeration = 'enum'
|
||||
|
||||
#
|
||||
# Some AE types are immedeately coerced into something
|
||||
# we like better (and which is equivalent)
|
||||
#
|
||||
unpacker_coercions = {
|
||||
typeComp : typeFloat,
|
||||
typeColorTable : typeAEList,
|
||||
typeDrawingArea : typeAERecord,
|
||||
typeFixed : typeFloat,
|
||||
typeExtended : typeFloat,
|
||||
typePixelMap : typeAERecord,
|
||||
typeRotation : typeAERecord,
|
||||
typeStyledText : typeAERecord,
|
||||
typeTextStyles : typeAERecord,
|
||||
};
|
||||
|
||||
#
|
||||
# Some python types we need in the packer:
|
||||
#
|
||||
AEDescType = AE.AEDescType
|
||||
try:
|
||||
FSSType = Carbon.File.FSSpecType
|
||||
except AttributeError:
|
||||
class FSSType:
|
||||
pass
|
||||
FSRefType = Carbon.File.FSRefType
|
||||
AliasType = Carbon.File.AliasType
|
||||
|
||||
def packkey(ae, key, value):
|
||||
if hasattr(key, 'which'):
|
||||
keystr = key.which
|
||||
elif hasattr(key, 'want'):
|
||||
keystr = key.want
|
||||
else:
|
||||
keystr = key
|
||||
ae.AEPutParamDesc(keystr, pack(value))
|
||||
|
||||
def pack(x, forcetype = None):
|
||||
"""Pack a python object into an AE descriptor"""
|
||||
|
||||
if forcetype:
|
||||
if type(x) is StringType:
|
||||
return AE.AECreateDesc(forcetype, x)
|
||||
else:
|
||||
return pack(x).AECoerceDesc(forcetype)
|
||||
|
||||
if x is None:
|
||||
return AE.AECreateDesc('null', '')
|
||||
|
||||
if isinstance(x, AEDescType):
|
||||
return x
|
||||
if isinstance(x, FSSType):
|
||||
return AE.AECreateDesc('fss ', x.data)
|
||||
if isinstance(x, FSRefType):
|
||||
return AE.AECreateDesc('fsrf', x.data)
|
||||
if isinstance(x, AliasType):
|
||||
return AE.AECreateDesc('alis', x.data)
|
||||
if isinstance(x, IntType):
|
||||
return AE.AECreateDesc('long', struct.pack('l', x))
|
||||
if isinstance(x, FloatType):
|
||||
return AE.AECreateDesc('doub', struct.pack('d', x))
|
||||
if isinstance(x, StringType):
|
||||
return AE.AECreateDesc('TEXT', x)
|
||||
if isinstance(x, UnicodeType):
|
||||
data = x.encode('utf16')
|
||||
if data[:2] == '\xfe\xff':
|
||||
data = data[2:]
|
||||
return AE.AECreateDesc('utxt', data)
|
||||
if isinstance(x, ListType):
|
||||
list = AE.AECreateList('', 0)
|
||||
for item in x:
|
||||
list.AEPutDesc(0, pack(item))
|
||||
return list
|
||||
if isinstance(x, DictionaryType):
|
||||
record = AE.AECreateList('', 1)
|
||||
for key, value in x.items():
|
||||
packkey(record, key, value)
|
||||
#record.AEPutParamDesc(key, pack(value))
|
||||
return record
|
||||
if type(x) == types.ClassType and issubclass(x, ObjectSpecifier):
|
||||
# Note: we are getting a class object here, not an instance
|
||||
return AE.AECreateDesc('type', x.want)
|
||||
if hasattr(x, '__aepack__'):
|
||||
return x.__aepack__()
|
||||
if hasattr(x, 'which'):
|
||||
return AE.AECreateDesc('TEXT', x.which)
|
||||
if hasattr(x, 'want'):
|
||||
return AE.AECreateDesc('TEXT', x.want)
|
||||
return AE.AECreateDesc('TEXT', repr(x)) # Copout
|
||||
|
||||
def unpack(desc, formodulename=""):
|
||||
"""Unpack an AE descriptor to a python object"""
|
||||
t = desc.type
|
||||
|
||||
if t in unpacker_coercions:
|
||||
desc = desc.AECoerceDesc(unpacker_coercions[t])
|
||||
t = desc.type # This is a guess by Jack....
|
||||
|
||||
if t == typeAEList:
|
||||
l = []
|
||||
for i in range(desc.AECountItems()):
|
||||
keyword, item = desc.AEGetNthDesc(i+1, '****')
|
||||
l.append(unpack(item, formodulename))
|
||||
return l
|
||||
if t == typeAERecord:
|
||||
d = {}
|
||||
for i in range(desc.AECountItems()):
|
||||
keyword, item = desc.AEGetNthDesc(i+1, '****')
|
||||
d[keyword] = unpack(item, formodulename)
|
||||
return d
|
||||
if t == typeAEText:
|
||||
record = desc.AECoerceDesc('reco')
|
||||
return mkaetext(unpack(record, formodulename))
|
||||
if t == typeAlias:
|
||||
return Carbon.File.Alias(rawdata=desc.data)
|
||||
# typeAppleEvent returned as unknown
|
||||
if t == typeBoolean:
|
||||
return struct.unpack('b', desc.data)[0]
|
||||
if t == typeChar:
|
||||
return desc.data
|
||||
if t == typeUnicodeText:
|
||||
return unicode(desc.data, 'utf16')
|
||||
# typeColorTable coerced to typeAEList
|
||||
# typeComp coerced to extended
|
||||
# typeData returned as unknown
|
||||
# typeDrawingArea coerced to typeAERecord
|
||||
if t == typeEnumeration:
|
||||
return mkenum(desc.data)
|
||||
# typeEPS returned as unknown
|
||||
if t == typeFalse:
|
||||
return 0
|
||||
if t == typeFloat:
|
||||
data = desc.data
|
||||
return struct.unpack('d', data)[0]
|
||||
if t == typeFSS:
|
||||
return Carbon.File.FSSpec(rawdata=desc.data)
|
||||
if t == typeFSRef:
|
||||
return Carbon.File.FSRef(rawdata=desc.data)
|
||||
if t == typeInsertionLoc:
|
||||
record = desc.AECoerceDesc('reco')
|
||||
return mkinsertionloc(unpack(record, formodulename))
|
||||
# typeInteger equal to typeLongInteger
|
||||
if t == typeIntlText:
|
||||
script, language = struct.unpack('hh', desc.data[:4])
|
||||
return aetypes.IntlText(script, language, desc.data[4:])
|
||||
if t == typeIntlWritingCode:
|
||||
script, language = struct.unpack('hh', desc.data)
|
||||
return aetypes.IntlWritingCode(script, language)
|
||||
if t == typeKeyword:
|
||||
return mkkeyword(desc.data)
|
||||
if t == typeLongInteger:
|
||||
return struct.unpack('l', desc.data)[0]
|
||||
if t == typeLongDateTime:
|
||||
a, b = struct.unpack('lL', desc.data)
|
||||
return (long(a) << 32) + b
|
||||
if t == typeNull:
|
||||
return None
|
||||
if t == typeMagnitude:
|
||||
v = struct.unpack('l', desc.data)
|
||||
if v < 0:
|
||||
v = 0x100000000L + v
|
||||
return v
|
||||
if t == typeObjectSpecifier:
|
||||
record = desc.AECoerceDesc('reco')
|
||||
# If we have been told the name of the module we are unpacking aedescs for,
|
||||
# we can attempt to create the right type of python object from that module.
|
||||
if formodulename:
|
||||
return mkobjectfrommodule(unpack(record, formodulename), formodulename)
|
||||
return mkobject(unpack(record, formodulename))
|
||||
# typePict returned as unknown
|
||||
# typePixelMap coerced to typeAERecord
|
||||
# typePixelMapMinus returned as unknown
|
||||
# typeProcessSerialNumber returned as unknown
|
||||
if t == typeQDPoint:
|
||||
v, h = struct.unpack('hh', desc.data)
|
||||
return aetypes.QDPoint(v, h)
|
||||
if t == typeQDRectangle:
|
||||
v0, h0, v1, h1 = struct.unpack('hhhh', desc.data)
|
||||
return aetypes.QDRectangle(v0, h0, v1, h1)
|
||||
if t == typeRGBColor:
|
||||
r, g, b = struct.unpack('hhh', desc.data)
|
||||
return aetypes.RGBColor(r, g, b)
|
||||
# typeRotation coerced to typeAERecord
|
||||
# typeScrapStyles returned as unknown
|
||||
# typeSessionID returned as unknown
|
||||
if t == typeShortFloat:
|
||||
return struct.unpack('f', desc.data)[0]
|
||||
if t == typeShortInteger:
|
||||
return struct.unpack('h', desc.data)[0]
|
||||
# typeSMFloat identical to typeShortFloat
|
||||
# typeSMInt indetical to typeShortInt
|
||||
# typeStyledText coerced to typeAERecord
|
||||
if t == typeTargetID:
|
||||
return mktargetid(desc.data)
|
||||
# typeTextStyles coerced to typeAERecord
|
||||
# typeTIFF returned as unknown
|
||||
if t == typeTrue:
|
||||
return 1
|
||||
if t == typeType:
|
||||
return mktype(desc.data, formodulename)
|
||||
#
|
||||
# The following are special
|
||||
#
|
||||
if t == 'rang':
|
||||
record = desc.AECoerceDesc('reco')
|
||||
return mkrange(unpack(record, formodulename))
|
||||
if t == 'cmpd':
|
||||
record = desc.AECoerceDesc('reco')
|
||||
return mkcomparison(unpack(record, formodulename))
|
||||
if t == 'logi':
|
||||
record = desc.AECoerceDesc('reco')
|
||||
return mklogical(unpack(record, formodulename))
|
||||
return mkunknown(desc.type, desc.data)
|
||||
|
||||
def coerce(data, egdata):
|
||||
"""Coerce a python object to another type using the AE coercers"""
|
||||
pdata = pack(data)
|
||||
pegdata = pack(egdata)
|
||||
pdata = pdata.AECoerceDesc(pegdata.type)
|
||||
return unpack(pdata)
|
||||
|
||||
#
|
||||
# Helper routines for unpack
|
||||
#
|
||||
def mktargetid(data):
|
||||
sessionID = getlong(data[:4])
|
||||
name = mkppcportrec(data[4:4+72])
|
||||
location = mklocationnamerec(data[76:76+36])
|
||||
rcvrName = mkppcportrec(data[112:112+72])
|
||||
return sessionID, name, location, rcvrName
|
||||
|
||||
def mkppcportrec(rec):
|
||||
namescript = getword(rec[:2])
|
||||
name = getpstr(rec[2:2+33])
|
||||
portkind = getword(rec[36:38])
|
||||
if portkind == 1:
|
||||
ctor = rec[38:42]
|
||||
type = rec[42:46]
|
||||
identity = (ctor, type)
|
||||
else:
|
||||
identity = getpstr(rec[38:38+33])
|
||||
return namescript, name, portkind, identity
|
||||
|
||||
def mklocationnamerec(rec):
|
||||
kind = getword(rec[:2])
|
||||
stuff = rec[2:]
|
||||
if kind == 0: stuff = None
|
||||
if kind == 2: stuff = getpstr(stuff)
|
||||
return kind, stuff
|
||||
|
||||
def mkunknown(type, data):
|
||||
return aetypes.Unknown(type, data)
|
||||
|
||||
def getpstr(s):
|
||||
return s[1:1+ord(s[0])]
|
||||
|
||||
def getlong(s):
|
||||
return (ord(s[0])<<24) | (ord(s[1])<<16) | (ord(s[2])<<8) | ord(s[3])
|
||||
|
||||
def getword(s):
|
||||
return (ord(s[0])<<8) | (ord(s[1])<<0)
|
||||
|
||||
def mkkeyword(keyword):
|
||||
return aetypes.Keyword(keyword)
|
||||
|
||||
def mkrange(dict):
|
||||
return aetypes.Range(dict['star'], dict['stop'])
|
||||
|
||||
def mkcomparison(dict):
|
||||
return aetypes.Comparison(dict['obj1'], dict['relo'].enum, dict['obj2'])
|
||||
|
||||
def mklogical(dict):
|
||||
return aetypes.Logical(dict['logc'], dict['term'])
|
||||
|
||||
def mkstyledtext(dict):
|
||||
return aetypes.StyledText(dict['ksty'], dict['ktxt'])
|
||||
|
||||
def mkaetext(dict):
|
||||
return aetypes.AEText(dict[keyAEScriptTag], dict[keyAEStyles], dict[keyAEText])
|
||||
|
||||
def mkinsertionloc(dict):
|
||||
return aetypes.InsertionLoc(dict[keyAEObject], dict[keyAEPosition])
|
||||
|
||||
def mkobject(dict):
|
||||
want = dict['want'].type
|
||||
form = dict['form'].enum
|
||||
seld = dict['seld']
|
||||
fr = dict['from']
|
||||
if form in ('name', 'indx', 'rang', 'test'):
|
||||
if want == 'text': return aetypes.Text(seld, fr)
|
||||
if want == 'cha ': return aetypes.Character(seld, fr)
|
||||
if want == 'cwor': return aetypes.Word(seld, fr)
|
||||
if want == 'clin': return aetypes.Line(seld, fr)
|
||||
if want == 'cpar': return aetypes.Paragraph(seld, fr)
|
||||
if want == 'cwin': return aetypes.Window(seld, fr)
|
||||
if want == 'docu': return aetypes.Document(seld, fr)
|
||||
if want == 'file': return aetypes.File(seld, fr)
|
||||
if want == 'cins': return aetypes.InsertionPoint(seld, fr)
|
||||
if want == 'prop' and form == 'prop' and aetypes.IsType(seld):
|
||||
return aetypes.Property(seld.type, fr)
|
||||
return aetypes.ObjectSpecifier(want, form, seld, fr)
|
||||
|
||||
# Note by Jack: I'm not 100% sure of the following code. This was
|
||||
# provided by Donovan Preston, but I wonder whether the assignment
|
||||
# to __class__ is safe. Moreover, shouldn't there be a better
|
||||
# initializer for the classes in the suites?
|
||||
def mkobjectfrommodule(dict, modulename):
|
||||
if type(dict['want']) == types.ClassType and issubclass(dict['want'], ObjectSpecifier):
|
||||
# The type has already been converted to Python. Convert back:-(
|
||||
classtype = dict['want']
|
||||
dict['want'] = aetypes.mktype(classtype.want)
|
||||
want = dict['want'].type
|
||||
module = __import__(modulename)
|
||||
codenamemapper = module._classdeclarations
|
||||
classtype = codenamemapper.get(want, None)
|
||||
newobj = mkobject(dict)
|
||||
if classtype:
|
||||
assert issubclass(classtype, ObjectSpecifier)
|
||||
newobj.__class__ = classtype
|
||||
return newobj
|
||||
|
||||
def mktype(typecode, modulename=None):
|
||||
if modulename:
|
||||
module = __import__(modulename)
|
||||
codenamemapper = module._classdeclarations
|
||||
classtype = codenamemapper.get(typecode, None)
|
||||
if classtype:
|
||||
return classtype
|
||||
return aetypes.mktype(typecode)
|
||||
363
Darwin/lib/python2.7/plat-mac/aetools.py
Normal file
363
Darwin/lib/python2.7/plat-mac/aetools.py
Normal file
|
|
@ -0,0 +1,363 @@
|
|||
"""Tools for use in AppleEvent clients and servers.
|
||||
|
||||
pack(x) converts a Python object to an AEDesc object
|
||||
unpack(desc) does the reverse
|
||||
|
||||
packevent(event, parameters, attributes) sets params and attrs in an AEAppleEvent record
|
||||
unpackevent(event) returns the parameters and attributes from an AEAppleEvent record
|
||||
|
||||
Plus... Lots of classes and routines that help representing AE objects,
|
||||
ranges, conditionals, logicals, etc., so you can write, e.g.:
|
||||
|
||||
x = Character(1, Document("foobar"))
|
||||
|
||||
and pack(x) will create an AE object reference equivalent to AppleScript's
|
||||
|
||||
character 1 of document "foobar"
|
||||
|
||||
Some of the stuff that appears to be exported from this module comes from other
|
||||
files: the pack stuff from aepack, the objects from aetypes.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
from warnings import warnpy3k
|
||||
warnpy3k("In 3.x, the aetools module is removed.", stacklevel=2)
|
||||
|
||||
from types import *
|
||||
from Carbon import AE
|
||||
from Carbon import Evt
|
||||
from Carbon import AppleEvents
|
||||
import MacOS
|
||||
import sys
|
||||
import time
|
||||
|
||||
from aetypes import *
|
||||
from aepack import packkey, pack, unpack, coerce, AEDescType
|
||||
|
||||
Error = 'aetools.Error'
|
||||
|
||||
# Amount of time to wait for program to be launched
|
||||
LAUNCH_MAX_WAIT_TIME=10
|
||||
|
||||
# Special code to unpack an AppleEvent (which is *not* a disguised record!)
|
||||
# Note by Jack: No??!? If I read the docs correctly it *is*....
|
||||
|
||||
aekeywords = [
|
||||
'tran',
|
||||
'rtid',
|
||||
'evcl',
|
||||
'evid',
|
||||
'addr',
|
||||
'optk',
|
||||
'timo',
|
||||
'inte', # this attribute is read only - will be set in AESend
|
||||
'esrc', # this attribute is read only
|
||||
'miss', # this attribute is read only
|
||||
'from' # new in 1.0.1
|
||||
]
|
||||
|
||||
def missed(ae):
|
||||
try:
|
||||
desc = ae.AEGetAttributeDesc('miss', 'keyw')
|
||||
except AE.Error, msg:
|
||||
return None
|
||||
return desc.data
|
||||
|
||||
def unpackevent(ae, formodulename=""):
|
||||
parameters = {}
|
||||
try:
|
||||
dirobj = ae.AEGetParamDesc('----', '****')
|
||||
except AE.Error:
|
||||
pass
|
||||
else:
|
||||
parameters['----'] = unpack(dirobj, formodulename)
|
||||
del dirobj
|
||||
# Workaround for what I feel is a bug in OSX 10.2: 'errn' won't show up in missed...
|
||||
try:
|
||||
dirobj = ae.AEGetParamDesc('errn', '****')
|
||||
except AE.Error:
|
||||
pass
|
||||
else:
|
||||
parameters['errn'] = unpack(dirobj, formodulename)
|
||||
del dirobj
|
||||
while 1:
|
||||
key = missed(ae)
|
||||
if not key: break
|
||||
parameters[key] = unpack(ae.AEGetParamDesc(key, '****'), formodulename)
|
||||
attributes = {}
|
||||
for key in aekeywords:
|
||||
try:
|
||||
desc = ae.AEGetAttributeDesc(key, '****')
|
||||
except (AE.Error, MacOS.Error), msg:
|
||||
if msg[0] != -1701 and msg[0] != -1704:
|
||||
raise
|
||||
continue
|
||||
attributes[key] = unpack(desc, formodulename)
|
||||
return parameters, attributes
|
||||
|
||||
def packevent(ae, parameters = {}, attributes = {}):
|
||||
for key, value in parameters.items():
|
||||
packkey(ae, key, value)
|
||||
for key, value in attributes.items():
|
||||
ae.AEPutAttributeDesc(key, pack(value))
|
||||
|
||||
#
|
||||
# Support routine for automatically generated Suite interfaces
|
||||
# These routines are also useable for the reverse function.
|
||||
#
|
||||
def keysubst(arguments, keydict):
|
||||
"""Replace long name keys by their 4-char counterparts, and check"""
|
||||
ok = keydict.values()
|
||||
for k in arguments.keys():
|
||||
if k in keydict:
|
||||
v = arguments[k]
|
||||
del arguments[k]
|
||||
arguments[keydict[k]] = v
|
||||
elif k != '----' and k not in ok:
|
||||
raise TypeError, 'Unknown keyword argument: %s'%k
|
||||
|
||||
def enumsubst(arguments, key, edict):
|
||||
"""Substitute a single enum keyword argument, if it occurs"""
|
||||
if key not in arguments or edict is None:
|
||||
return
|
||||
v = arguments[key]
|
||||
ok = edict.values()
|
||||
if v in edict:
|
||||
arguments[key] = Enum(edict[v])
|
||||
elif not v in ok:
|
||||
raise TypeError, 'Unknown enumerator: %s'%v
|
||||
|
||||
def decodeerror(arguments):
|
||||
"""Create the 'best' argument for a raise MacOS.Error"""
|
||||
errn = arguments['errn']
|
||||
err_a1 = errn
|
||||
if 'errs' in arguments:
|
||||
err_a2 = arguments['errs']
|
||||
else:
|
||||
err_a2 = MacOS.GetErrorString(errn)
|
||||
if 'erob' in arguments:
|
||||
err_a3 = arguments['erob']
|
||||
else:
|
||||
err_a3 = None
|
||||
|
||||
return (err_a1, err_a2, err_a3)
|
||||
|
||||
class TalkTo:
|
||||
"""An AE connection to an application"""
|
||||
_signature = None # Can be overridden by subclasses
|
||||
_moduleName = None # Can be overridden by subclasses
|
||||
_elemdict = {} # Can be overridden by subclasses
|
||||
_propdict = {} # Can be overridden by subclasses
|
||||
|
||||
__eventloop_initialized = 0
|
||||
def __ensure_WMAvailable(klass):
|
||||
if klass.__eventloop_initialized: return 1
|
||||
if not MacOS.WMAvailable(): return 0
|
||||
# Workaround for a but in MacOSX 10.2: we must have an event
|
||||
# loop before we can call AESend.
|
||||
Evt.WaitNextEvent(0,0)
|
||||
return 1
|
||||
__ensure_WMAvailable = classmethod(__ensure_WMAvailable)
|
||||
|
||||
def __init__(self, signature=None, start=0, timeout=0):
|
||||
"""Create a communication channel with a particular application.
|
||||
|
||||
Addressing the application is done by specifying either a
|
||||
4-byte signature, an AEDesc or an object that will __aepack__
|
||||
to an AEDesc.
|
||||
"""
|
||||
self.target_signature = None
|
||||
if signature is None:
|
||||
signature = self._signature
|
||||
if type(signature) == AEDescType:
|
||||
self.target = signature
|
||||
elif type(signature) == InstanceType and hasattr(signature, '__aepack__'):
|
||||
self.target = signature.__aepack__()
|
||||
elif type(signature) == StringType and len(signature) == 4:
|
||||
self.target = AE.AECreateDesc(AppleEvents.typeApplSignature, signature)
|
||||
self.target_signature = signature
|
||||
else:
|
||||
raise TypeError, "signature should be 4-char string or AEDesc"
|
||||
self.send_flags = AppleEvents.kAEWaitReply
|
||||
self.send_priority = AppleEvents.kAENormalPriority
|
||||
if timeout:
|
||||
self.send_timeout = timeout
|
||||
else:
|
||||
self.send_timeout = AppleEvents.kAEDefaultTimeout
|
||||
if start:
|
||||
self._start()
|
||||
|
||||
def _start(self):
|
||||
"""Start the application, if it is not running yet"""
|
||||
try:
|
||||
self.send('ascr', 'noop')
|
||||
except AE.Error:
|
||||
_launch(self.target_signature)
|
||||
for i in range(LAUNCH_MAX_WAIT_TIME):
|
||||
try:
|
||||
self.send('ascr', 'noop')
|
||||
except AE.Error:
|
||||
pass
|
||||
else:
|
||||
break
|
||||
time.sleep(1)
|
||||
|
||||
def start(self):
|
||||
"""Deprecated, used _start()"""
|
||||
self._start()
|
||||
|
||||
def newevent(self, code, subcode, parameters = {}, attributes = {}):
|
||||
"""Create a complete structure for an apple event"""
|
||||
|
||||
event = AE.AECreateAppleEvent(code, subcode, self.target,
|
||||
AppleEvents.kAutoGenerateReturnID, AppleEvents.kAnyTransactionID)
|
||||
packevent(event, parameters, attributes)
|
||||
return event
|
||||
|
||||
def sendevent(self, event):
|
||||
"""Send a pre-created appleevent, await the reply and unpack it"""
|
||||
if not self.__ensure_WMAvailable():
|
||||
raise RuntimeError, "No window manager access, cannot send AppleEvent"
|
||||
reply = event.AESend(self.send_flags, self.send_priority,
|
||||
self.send_timeout)
|
||||
parameters, attributes = unpackevent(reply, self._moduleName)
|
||||
return reply, parameters, attributes
|
||||
|
||||
def send(self, code, subcode, parameters = {}, attributes = {}):
|
||||
"""Send an appleevent given code/subcode/pars/attrs and unpack the reply"""
|
||||
return self.sendevent(self.newevent(code, subcode, parameters, attributes))
|
||||
|
||||
#
|
||||
# The following events are somehow "standard" and don't seem to appear in any
|
||||
# suite...
|
||||
#
|
||||
def activate(self):
|
||||
"""Send 'activate' command"""
|
||||
self.send('misc', 'actv')
|
||||
|
||||
def _get(self, _object, asfile=None, _attributes={}):
|
||||
"""_get: get data from an object
|
||||
Required argument: the object
|
||||
Keyword argument _attributes: AppleEvent attribute dictionary
|
||||
Returns: the data
|
||||
"""
|
||||
_code = 'core'
|
||||
_subcode = 'getd'
|
||||
|
||||
_arguments = {'----':_object}
|
||||
if asfile:
|
||||
_arguments['rtyp'] = mktype(asfile)
|
||||
|
||||
_reply, _arguments, _attributes = self.send(_code, _subcode,
|
||||
_arguments, _attributes)
|
||||
if 'errn' in _arguments:
|
||||
raise Error, decodeerror(_arguments)
|
||||
|
||||
if '----' in _arguments:
|
||||
return _arguments['----']
|
||||
if asfile:
|
||||
item.__class__ = asfile
|
||||
return item
|
||||
|
||||
get = _get
|
||||
|
||||
_argmap_set = {
|
||||
'to' : 'data',
|
||||
}
|
||||
|
||||
def _set(self, _object, _attributes={}, **_arguments):
|
||||
"""set: Set an object's data.
|
||||
Required argument: the object for the command
|
||||
Keyword argument to: The new value.
|
||||
Keyword argument _attributes: AppleEvent attribute dictionary
|
||||
"""
|
||||
_code = 'core'
|
||||
_subcode = 'setd'
|
||||
|
||||
keysubst(_arguments, self._argmap_set)
|
||||
_arguments['----'] = _object
|
||||
|
||||
|
||||
_reply, _arguments, _attributes = self.send(_code, _subcode,
|
||||
_arguments, _attributes)
|
||||
if _arguments.get('errn', 0):
|
||||
raise Error, decodeerror(_arguments)
|
||||
# XXXX Optionally decode result
|
||||
if '----' in _arguments:
|
||||
return _arguments['----']
|
||||
|
||||
set = _set
|
||||
|
||||
# Magic glue to allow suite-generated classes to function somewhat
|
||||
# like the "application" class in OSA.
|
||||
|
||||
def __getattr__(self, name):
|
||||
if name in self._elemdict:
|
||||
cls = self._elemdict[name]
|
||||
return DelayedComponentItem(cls, None)
|
||||
if name in self._propdict:
|
||||
cls = self._propdict[name]
|
||||
return cls()
|
||||
raise AttributeError, name
|
||||
|
||||
# Tiny Finder class, for local use only
|
||||
|
||||
class _miniFinder(TalkTo):
|
||||
def open(self, _object, _attributes={}, **_arguments):
|
||||
"""open: Open the specified object(s)
|
||||
Required argument: list of objects to open
|
||||
Keyword argument _attributes: AppleEvent attribute dictionary
|
||||
"""
|
||||
_code = 'aevt'
|
||||
_subcode = 'odoc'
|
||||
|
||||
if _arguments: raise TypeError, 'No optional args expected'
|
||||
_arguments['----'] = _object
|
||||
|
||||
|
||||
_reply, _arguments, _attributes = self.send(_code, _subcode,
|
||||
_arguments, _attributes)
|
||||
if 'errn' in _arguments:
|
||||
raise Error, decodeerror(_arguments)
|
||||
# XXXX Optionally decode result
|
||||
if '----' in _arguments:
|
||||
return _arguments['----']
|
||||
#pass
|
||||
|
||||
_finder = _miniFinder('MACS')
|
||||
|
||||
def _launch(appfile):
|
||||
"""Open a file thru the finder. Specify file by name or fsspec"""
|
||||
_finder.open(_application_file(('ID ', appfile)))
|
||||
|
||||
|
||||
class _application_file(ComponentItem):
|
||||
"""application file - An application's file on disk"""
|
||||
want = 'appf'
|
||||
|
||||
_application_file._propdict = {
|
||||
}
|
||||
_application_file._elemdict = {
|
||||
}
|
||||
|
||||
# Test program
|
||||
# XXXX Should test more, really...
|
||||
|
||||
def test():
|
||||
target = AE.AECreateDesc('sign', 'quil')
|
||||
ae = AE.AECreateAppleEvent('aevt', 'oapp', target, -1, 0)
|
||||
print unpackevent(ae)
|
||||
raw_input(":")
|
||||
ae = AE.AECreateAppleEvent('core', 'getd', target, -1, 0)
|
||||
obj = Character(2, Word(1, Document(1)))
|
||||
print obj
|
||||
print repr(obj)
|
||||
packevent(ae, {'----': obj})
|
||||
params, attrs = unpackevent(ae)
|
||||
print params['----']
|
||||
raw_input(":")
|
||||
|
||||
if __name__ == '__main__':
|
||||
test()
|
||||
sys.exit(1)
|
||||
571
Darwin/lib/python2.7/plat-mac/aetypes.py
Normal file
571
Darwin/lib/python2.7/plat-mac/aetypes.py
Normal file
|
|
@ -0,0 +1,571 @@
|
|||
"""aetypes - Python objects representing various AE types."""
|
||||
|
||||
from warnings import warnpy3k
|
||||
warnpy3k("In 3.x, the aetypes module is removed.", stacklevel=2)
|
||||
|
||||
from Carbon.AppleEvents import *
|
||||
import struct
|
||||
from types import *
|
||||
import string
|
||||
|
||||
#
|
||||
# convoluted, since there are cyclic dependencies between this file and
|
||||
# aetools_convert.
|
||||
#
|
||||
def pack(*args, **kwargs):
|
||||
from aepack import pack
|
||||
return pack( *args, **kwargs)
|
||||
|
||||
def nice(s):
|
||||
"""'nice' representation of an object"""
|
||||
if type(s) is StringType: return repr(s)
|
||||
else: return str(s)
|
||||
|
||||
class Unknown:
|
||||
"""An uninterpreted AE object"""
|
||||
|
||||
def __init__(self, type, data):
|
||||
self.type = type
|
||||
self.data = data
|
||||
|
||||
def __repr__(self):
|
||||
return "Unknown(%r, %r)" % (self.type, self.data)
|
||||
|
||||
def __aepack__(self):
|
||||
return pack(self.data, self.type)
|
||||
|
||||
class Enum:
|
||||
"""An AE enumeration value"""
|
||||
|
||||
def __init__(self, enum):
|
||||
self.enum = "%-4.4s" % str(enum)
|
||||
|
||||
def __repr__(self):
|
||||
return "Enum(%r)" % (self.enum,)
|
||||
|
||||
def __str__(self):
|
||||
return string.strip(self.enum)
|
||||
|
||||
def __aepack__(self):
|
||||
return pack(self.enum, typeEnumeration)
|
||||
|
||||
def IsEnum(x):
|
||||
return isinstance(x, Enum)
|
||||
|
||||
def mkenum(enum):
|
||||
if IsEnum(enum): return enum
|
||||
return Enum(enum)
|
||||
|
||||
# Jack changed the way this is done
|
||||
class InsertionLoc:
|
||||
def __init__(self, of, pos):
|
||||
self.of = of
|
||||
self.pos = pos
|
||||
|
||||
def __repr__(self):
|
||||
return "InsertionLoc(%r, %r)" % (self.of, self.pos)
|
||||
|
||||
def __aepack__(self):
|
||||
rec = {'kobj': self.of, 'kpos': self.pos}
|
||||
return pack(rec, forcetype='insl')
|
||||
|
||||
# Convenience functions for dsp:
|
||||
def beginning(of):
|
||||
return InsertionLoc(of, Enum('bgng'))
|
||||
|
||||
def end(of):
|
||||
return InsertionLoc(of, Enum('end '))
|
||||
|
||||
class Boolean:
|
||||
"""An AE boolean value"""
|
||||
|
||||
def __init__(self, bool):
|
||||
self.bool = (not not bool)
|
||||
|
||||
def __repr__(self):
|
||||
return "Boolean(%r)" % (self.bool,)
|
||||
|
||||
def __str__(self):
|
||||
if self.bool:
|
||||
return "True"
|
||||
else:
|
||||
return "False"
|
||||
|
||||
def __aepack__(self):
|
||||
return pack(struct.pack('b', self.bool), 'bool')
|
||||
|
||||
def IsBoolean(x):
|
||||
return isinstance(x, Boolean)
|
||||
|
||||
def mkboolean(bool):
|
||||
if IsBoolean(bool): return bool
|
||||
return Boolean(bool)
|
||||
|
||||
class Type:
|
||||
"""An AE 4-char typename object"""
|
||||
|
||||
def __init__(self, type):
|
||||
self.type = "%-4.4s" % str(type)
|
||||
|
||||
def __repr__(self):
|
||||
return "Type(%r)" % (self.type,)
|
||||
|
||||
def __str__(self):
|
||||
return string.strip(self.type)
|
||||
|
||||
def __aepack__(self):
|
||||
return pack(self.type, typeType)
|
||||
|
||||
def IsType(x):
|
||||
return isinstance(x, Type)
|
||||
|
||||
def mktype(type):
|
||||
if IsType(type): return type
|
||||
return Type(type)
|
||||
|
||||
|
||||
class Keyword:
|
||||
"""An AE 4-char keyword object"""
|
||||
|
||||
def __init__(self, keyword):
|
||||
self.keyword = "%-4.4s" % str(keyword)
|
||||
|
||||
def __repr__(self):
|
||||
return "Keyword(%r)" % repr(self.keyword)
|
||||
|
||||
def __str__(self):
|
||||
return string.strip(self.keyword)
|
||||
|
||||
def __aepack__(self):
|
||||
return pack(self.keyword, typeKeyword)
|
||||
|
||||
def IsKeyword(x):
|
||||
return isinstance(x, Keyword)
|
||||
|
||||
class Range:
|
||||
"""An AE range object"""
|
||||
|
||||
def __init__(self, start, stop):
|
||||
self.start = start
|
||||
self.stop = stop
|
||||
|
||||
def __repr__(self):
|
||||
return "Range(%r, %r)" % (self.start, self.stop)
|
||||
|
||||
def __str__(self):
|
||||
return "%s thru %s" % (nice(self.start), nice(self.stop))
|
||||
|
||||
def __aepack__(self):
|
||||
return pack({'star': self.start, 'stop': self.stop}, 'rang')
|
||||
|
||||
def IsRange(x):
|
||||
return isinstance(x, Range)
|
||||
|
||||
class Comparison:
|
||||
"""An AE Comparison"""
|
||||
|
||||
def __init__(self, obj1, relo, obj2):
|
||||
self.obj1 = obj1
|
||||
self.relo = "%-4.4s" % str(relo)
|
||||
self.obj2 = obj2
|
||||
|
||||
def __repr__(self):
|
||||
return "Comparison(%r, %r, %r)" % (self.obj1, self.relo, self.obj2)
|
||||
|
||||
def __str__(self):
|
||||
return "%s %s %s" % (nice(self.obj1), string.strip(self.relo), nice(self.obj2))
|
||||
|
||||
def __aepack__(self):
|
||||
return pack({'obj1': self.obj1,
|
||||
'relo': mkenum(self.relo),
|
||||
'obj2': self.obj2},
|
||||
'cmpd')
|
||||
|
||||
def IsComparison(x):
|
||||
return isinstance(x, Comparison)
|
||||
|
||||
class NComparison(Comparison):
|
||||
# The class attribute 'relo' must be set in a subclass
|
||||
|
||||
def __init__(self, obj1, obj2):
|
||||
Comparison.__init__(obj1, self.relo, obj2)
|
||||
|
||||
class Ordinal:
|
||||
"""An AE Ordinal"""
|
||||
|
||||
def __init__(self, abso):
|
||||
# self.obj1 = obj1
|
||||
self.abso = "%-4.4s" % str(abso)
|
||||
|
||||
def __repr__(self):
|
||||
return "Ordinal(%r)" % (self.abso,)
|
||||
|
||||
def __str__(self):
|
||||
return "%s" % (string.strip(self.abso))
|
||||
|
||||
def __aepack__(self):
|
||||
return pack(self.abso, 'abso')
|
||||
|
||||
def IsOrdinal(x):
|
||||
return isinstance(x, Ordinal)
|
||||
|
||||
class NOrdinal(Ordinal):
|
||||
# The class attribute 'abso' must be set in a subclass
|
||||
|
||||
def __init__(self):
|
||||
Ordinal.__init__(self, self.abso)
|
||||
|
||||
class Logical:
|
||||
"""An AE logical expression object"""
|
||||
|
||||
def __init__(self, logc, term):
|
||||
self.logc = "%-4.4s" % str(logc)
|
||||
self.term = term
|
||||
|
||||
def __repr__(self):
|
||||
return "Logical(%r, %r)" % (self.logc, self.term)
|
||||
|
||||
def __str__(self):
|
||||
if type(self.term) == ListType and len(self.term) == 2:
|
||||
return "%s %s %s" % (nice(self.term[0]),
|
||||
string.strip(self.logc),
|
||||
nice(self.term[1]))
|
||||
else:
|
||||
return "%s(%s)" % (string.strip(self.logc), nice(self.term))
|
||||
|
||||
def __aepack__(self):
|
||||
return pack({'logc': mkenum(self.logc), 'term': self.term}, 'logi')
|
||||
|
||||
def IsLogical(x):
|
||||
return isinstance(x, Logical)
|
||||
|
||||
class StyledText:
|
||||
"""An AE object respresenting text in a certain style"""
|
||||
|
||||
def __init__(self, style, text):
|
||||
self.style = style
|
||||
self.text = text
|
||||
|
||||
def __repr__(self):
|
||||
return "StyledText(%r, %r)" % (self.style, self.text)
|
||||
|
||||
def __str__(self):
|
||||
return self.text
|
||||
|
||||
def __aepack__(self):
|
||||
return pack({'ksty': self.style, 'ktxt': self.text}, 'STXT')
|
||||
|
||||
def IsStyledText(x):
|
||||
return isinstance(x, StyledText)
|
||||
|
||||
class AEText:
|
||||
"""An AE text object with style, script and language specified"""
|
||||
|
||||
def __init__(self, script, style, text):
|
||||
self.script = script
|
||||
self.style = style
|
||||
self.text = text
|
||||
|
||||
def __repr__(self):
|
||||
return "AEText(%r, %r, %r)" % (self.script, self.style, self.text)
|
||||
|
||||
def __str__(self):
|
||||
return self.text
|
||||
|
||||
def __aepack__(self):
|
||||
return pack({keyAEScriptTag: self.script, keyAEStyles: self.style,
|
||||
keyAEText: self.text}, typeAEText)
|
||||
|
||||
def IsAEText(x):
|
||||
return isinstance(x, AEText)
|
||||
|
||||
class IntlText:
|
||||
"""A text object with script and language specified"""
|
||||
|
||||
def __init__(self, script, language, text):
|
||||
self.script = script
|
||||
self.language = language
|
||||
self.text = text
|
||||
|
||||
def __repr__(self):
|
||||
return "IntlText(%r, %r, %r)" % (self.script, self.language, self.text)
|
||||
|
||||
def __str__(self):
|
||||
return self.text
|
||||
|
||||
def __aepack__(self):
|
||||
return pack(struct.pack('hh', self.script, self.language)+self.text,
|
||||
typeIntlText)
|
||||
|
||||
def IsIntlText(x):
|
||||
return isinstance(x, IntlText)
|
||||
|
||||
class IntlWritingCode:
|
||||
"""An object representing script and language"""
|
||||
|
||||
def __init__(self, script, language):
|
||||
self.script = script
|
||||
self.language = language
|
||||
|
||||
def __repr__(self):
|
||||
return "IntlWritingCode(%r, %r)" % (self.script, self.language)
|
||||
|
||||
def __str__(self):
|
||||
return "script system %d, language %d"%(self.script, self.language)
|
||||
|
||||
def __aepack__(self):
|
||||
return pack(struct.pack('hh', self.script, self.language),
|
||||
typeIntlWritingCode)
|
||||
|
||||
def IsIntlWritingCode(x):
|
||||
return isinstance(x, IntlWritingCode)
|
||||
|
||||
class QDPoint:
|
||||
"""A point"""
|
||||
|
||||
def __init__(self, v, h):
|
||||
self.v = v
|
||||
self.h = h
|
||||
|
||||
def __repr__(self):
|
||||
return "QDPoint(%r, %r)" % (self.v, self.h)
|
||||
|
||||
def __str__(self):
|
||||
return "(%d, %d)"%(self.v, self.h)
|
||||
|
||||
def __aepack__(self):
|
||||
return pack(struct.pack('hh', self.v, self.h),
|
||||
typeQDPoint)
|
||||
|
||||
def IsQDPoint(x):
|
||||
return isinstance(x, QDPoint)
|
||||
|
||||
class QDRectangle:
|
||||
"""A rectangle"""
|
||||
|
||||
def __init__(self, v0, h0, v1, h1):
|
||||
self.v0 = v0
|
||||
self.h0 = h0
|
||||
self.v1 = v1
|
||||
self.h1 = h1
|
||||
|
||||
def __repr__(self):
|
||||
return "QDRectangle(%r, %r, %r, %r)" % (self.v0, self.h0, self.v1, self.h1)
|
||||
|
||||
def __str__(self):
|
||||
return "(%d, %d)-(%d, %d)"%(self.v0, self.h0, self.v1, self.h1)
|
||||
|
||||
def __aepack__(self):
|
||||
return pack(struct.pack('hhhh', self.v0, self.h0, self.v1, self.h1),
|
||||
typeQDRectangle)
|
||||
|
||||
def IsQDRectangle(x):
|
||||
return isinstance(x, QDRectangle)
|
||||
|
||||
class RGBColor:
|
||||
"""An RGB color"""
|
||||
|
||||
def __init__(self, r, g, b):
|
||||
self.r = r
|
||||
self.g = g
|
||||
self.b = b
|
||||
|
||||
def __repr__(self):
|
||||
return "RGBColor(%r, %r, %r)" % (self.r, self.g, self.b)
|
||||
|
||||
def __str__(self):
|
||||
return "0x%x red, 0x%x green, 0x%x blue"% (self.r, self.g, self.b)
|
||||
|
||||
def __aepack__(self):
|
||||
return pack(struct.pack('hhh', self.r, self.g, self.b),
|
||||
typeRGBColor)
|
||||
|
||||
def IsRGBColor(x):
|
||||
return isinstance(x, RGBColor)
|
||||
|
||||
class ObjectSpecifier:
|
||||
|
||||
"""A class for constructing and manipulation AE object specifiers in python.
|
||||
|
||||
An object specifier is actually a record with four fields:
|
||||
|
||||
key type description
|
||||
--- ---- -----------
|
||||
|
||||
'want' type 4-char class code of thing we want,
|
||||
e.g. word, paragraph or property
|
||||
|
||||
'form' enum how we specify which 'want' thing(s) we want,
|
||||
e.g. by index, by range, by name, or by property specifier
|
||||
|
||||
'seld' any which thing(s) we want,
|
||||
e.g. its index, its name, or its property specifier
|
||||
|
||||
'from' object the object in which it is contained,
|
||||
or null, meaning look for it in the application
|
||||
|
||||
Note that we don't call this class plain "Object", since that name
|
||||
is likely to be used by the application.
|
||||
"""
|
||||
|
||||
def __init__(self, want, form, seld, fr = None):
|
||||
self.want = want
|
||||
self.form = form
|
||||
self.seld = seld
|
||||
self.fr = fr
|
||||
|
||||
def __repr__(self):
|
||||
s = "ObjectSpecifier(%r, %r, %r" % (self.want, self.form, self.seld)
|
||||
if self.fr:
|
||||
s = s + ", %r)" % (self.fr,)
|
||||
else:
|
||||
s = s + ")"
|
||||
return s
|
||||
|
||||
def __aepack__(self):
|
||||
return pack({'want': mktype(self.want),
|
||||
'form': mkenum(self.form),
|
||||
'seld': self.seld,
|
||||
'from': self.fr},
|
||||
'obj ')
|
||||
|
||||
def IsObjectSpecifier(x):
|
||||
return isinstance(x, ObjectSpecifier)
|
||||
|
||||
|
||||
# Backwards compatibility, sigh...
|
||||
class Property(ObjectSpecifier):
|
||||
|
||||
def __init__(self, which, fr = None, want='prop'):
|
||||
ObjectSpecifier.__init__(self, want, 'prop', mktype(which), fr)
|
||||
|
||||
def __repr__(self):
|
||||
if self.fr:
|
||||
return "Property(%r, %r)" % (self.seld.type, self.fr)
|
||||
else:
|
||||
return "Property(%r)" % (self.seld.type,)
|
||||
|
||||
def __str__(self):
|
||||
if self.fr:
|
||||
return "Property %s of %s" % (str(self.seld), str(self.fr))
|
||||
else:
|
||||
return "Property %s" % str(self.seld)
|
||||
|
||||
|
||||
class NProperty(ObjectSpecifier):
|
||||
# Subclasses *must* self baseclass attributes:
|
||||
# want is the type of this property
|
||||
# which is the property name of this property
|
||||
|
||||
def __init__(self, fr = None):
|
||||
#try:
|
||||
# dummy = self.want
|
||||
#except:
|
||||
# self.want = 'prop'
|
||||
self.want = 'prop'
|
||||
ObjectSpecifier.__init__(self, self.want, 'prop',
|
||||
mktype(self.which), fr)
|
||||
|
||||
def __repr__(self):
|
||||
rv = "Property(%r" % (self.seld.type,)
|
||||
if self.fr:
|
||||
rv = rv + ", fr=%r" % (self.fr,)
|
||||
if self.want != 'prop':
|
||||
rv = rv + ", want=%r" % (self.want,)
|
||||
return rv + ")"
|
||||
|
||||
def __str__(self):
|
||||
if self.fr:
|
||||
return "Property %s of %s" % (str(self.seld), str(self.fr))
|
||||
else:
|
||||
return "Property %s" % str(self.seld)
|
||||
|
||||
|
||||
class SelectableItem(ObjectSpecifier):
|
||||
|
||||
def __init__(self, want, seld, fr = None):
|
||||
t = type(seld)
|
||||
if t == StringType:
|
||||
form = 'name'
|
||||
elif IsRange(seld):
|
||||
form = 'rang'
|
||||
elif IsComparison(seld) or IsLogical(seld):
|
||||
form = 'test'
|
||||
elif t == TupleType:
|
||||
# Breakout: specify both form and seld in a tuple
|
||||
# (if you want ID or rele or somesuch)
|
||||
form, seld = seld
|
||||
else:
|
||||
form = 'indx'
|
||||
ObjectSpecifier.__init__(self, want, form, seld, fr)
|
||||
|
||||
|
||||
class ComponentItem(SelectableItem):
|
||||
# Derived classes *must* set the *class attribute* 'want' to some constant
|
||||
# Also, dictionaries _propdict and _elemdict must be set to map property
|
||||
# and element names to the correct classes
|
||||
|
||||
_propdict = {}
|
||||
_elemdict = {}
|
||||
def __init__(self, which, fr = None):
|
||||
SelectableItem.__init__(self, self.want, which, fr)
|
||||
|
||||
def __repr__(self):
|
||||
if not self.fr:
|
||||
return "%s(%r)" % (self.__class__.__name__, self.seld)
|
||||
return "%s(%r, %r)" % (self.__class__.__name__, self.seld, self.fr)
|
||||
|
||||
def __str__(self):
|
||||
seld = self.seld
|
||||
if type(seld) == StringType:
|
||||
ss = repr(seld)
|
||||
elif IsRange(seld):
|
||||
start, stop = seld.start, seld.stop
|
||||
if type(start) == InstanceType == type(stop) and \
|
||||
start.__class__ == self.__class__ == stop.__class__:
|
||||
ss = str(start.seld) + " thru " + str(stop.seld)
|
||||
else:
|
||||
ss = str(seld)
|
||||
else:
|
||||
ss = str(seld)
|
||||
s = "%s %s" % (self.__class__.__name__, ss)
|
||||
if self.fr: s = s + " of %s" % str(self.fr)
|
||||
return s
|
||||
|
||||
def __getattr__(self, name):
|
||||
if name in self._elemdict:
|
||||
cls = self._elemdict[name]
|
||||
return DelayedComponentItem(cls, self)
|
||||
if name in self._propdict:
|
||||
cls = self._propdict[name]
|
||||
return cls(self)
|
||||
raise AttributeError, name
|
||||
|
||||
|
||||
class DelayedComponentItem:
|
||||
def __init__(self, compclass, fr):
|
||||
self.compclass = compclass
|
||||
self.fr = fr
|
||||
|
||||
def __call__(self, which):
|
||||
return self.compclass(which, self.fr)
|
||||
|
||||
def __repr__(self):
|
||||
return "%s(???, %r)" % (self.__class__.__name__, self.fr)
|
||||
|
||||
def __str__(self):
|
||||
return "selector for element %s of %s"%(self.__class__.__name__, str(self.fr))
|
||||
|
||||
template = """
|
||||
class %s(ComponentItem): want = '%s'
|
||||
"""
|
||||
|
||||
exec template % ("Text", 'text')
|
||||
exec template % ("Character", 'cha ')
|
||||
exec template % ("Word", 'cwor')
|
||||
exec template % ("Line", 'clin')
|
||||
exec template % ("paragraph", 'cpar')
|
||||
exec template % ("Window", 'cwin')
|
||||
exec template % ("Document", 'docu')
|
||||
exec template % ("File", 'file')
|
||||
exec template % ("InsertionPoint", 'cins')
|
||||
146
Darwin/lib/python2.7/plat-mac/applesingle.py
Normal file
146
Darwin/lib/python2.7/plat-mac/applesingle.py
Normal file
|
|
@ -0,0 +1,146 @@
|
|||
r"""Routines to decode AppleSingle files
|
||||
"""
|
||||
|
||||
from warnings import warnpy3k
|
||||
warnpy3k("In 3.x, the applesingle module is removed.", stacklevel=2)
|
||||
|
||||
import struct
|
||||
import sys
|
||||
try:
|
||||
import MacOS
|
||||
import Carbon.File
|
||||
except:
|
||||
class MacOS:
|
||||
def openrf(path, mode):
|
||||
return open(path + '.rsrc', mode)
|
||||
openrf = classmethod(openrf)
|
||||
class Carbon:
|
||||
class File:
|
||||
class FSSpec:
|
||||
pass
|
||||
class FSRef:
|
||||
pass
|
||||
class Alias:
|
||||
pass
|
||||
|
||||
# all of the errors in this module are really errors in the input
|
||||
# so I think it should test positive against ValueError.
|
||||
class Error(ValueError):
|
||||
pass
|
||||
|
||||
# File header format: magic, version, unused, number of entries
|
||||
AS_HEADER_FORMAT=">LL16sh"
|
||||
AS_HEADER_LENGTH=26
|
||||
# The flag words for AppleSingle
|
||||
AS_MAGIC=0x00051600
|
||||
AS_VERSION=0x00020000
|
||||
|
||||
# Entry header format: id, offset, length
|
||||
AS_ENTRY_FORMAT=">lll"
|
||||
AS_ENTRY_LENGTH=12
|
||||
|
||||
# The id values
|
||||
AS_DATAFORK=1
|
||||
AS_RESOURCEFORK=2
|
||||
AS_IGNORE=(3,4,5,6,8,9,10,11,12,13,14,15)
|
||||
|
||||
class AppleSingle(object):
|
||||
datafork = None
|
||||
resourcefork = None
|
||||
|
||||
def __init__(self, fileobj, verbose=False):
|
||||
header = fileobj.read(AS_HEADER_LENGTH)
|
||||
try:
|
||||
magic, version, ig, nentry = struct.unpack(AS_HEADER_FORMAT, header)
|
||||
except ValueError, arg:
|
||||
raise Error, "Unpack header error: %s" % (arg,)
|
||||
if verbose:
|
||||
print 'Magic: 0x%8.8x' % (magic,)
|
||||
print 'Version: 0x%8.8x' % (version,)
|
||||
print 'Entries: %d' % (nentry,)
|
||||
if magic != AS_MAGIC:
|
||||
raise Error, "Unknown AppleSingle magic number 0x%8.8x" % (magic,)
|
||||
if version != AS_VERSION:
|
||||
raise Error, "Unknown AppleSingle version number 0x%8.8x" % (version,)
|
||||
if nentry <= 0:
|
||||
raise Error, "AppleSingle file contains no forks"
|
||||
headers = [fileobj.read(AS_ENTRY_LENGTH) for i in xrange(nentry)]
|
||||
self.forks = []
|
||||
for hdr in headers:
|
||||
try:
|
||||
restype, offset, length = struct.unpack(AS_ENTRY_FORMAT, hdr)
|
||||
except ValueError, arg:
|
||||
raise Error, "Unpack entry error: %s" % (arg,)
|
||||
if verbose:
|
||||
print "Fork %d, offset %d, length %d" % (restype, offset, length)
|
||||
fileobj.seek(offset)
|
||||
data = fileobj.read(length)
|
||||
if len(data) != length:
|
||||
raise Error, "Short read: expected %d bytes got %d" % (length, len(data))
|
||||
self.forks.append((restype, data))
|
||||
if restype == AS_DATAFORK:
|
||||
self.datafork = data
|
||||
elif restype == AS_RESOURCEFORK:
|
||||
self.resourcefork = data
|
||||
|
||||
def tofile(self, path, resonly=False):
|
||||
outfile = open(path, 'wb')
|
||||
data = False
|
||||
if resonly:
|
||||
if self.resourcefork is None:
|
||||
raise Error, "No resource fork found"
|
||||
fp = open(path, 'wb')
|
||||
fp.write(self.resourcefork)
|
||||
fp.close()
|
||||
elif (self.resourcefork is None and self.datafork is None):
|
||||
raise Error, "No useful forks found"
|
||||
else:
|
||||
if self.datafork is not None:
|
||||
fp = open(path, 'wb')
|
||||
fp.write(self.datafork)
|
||||
fp.close()
|
||||
if self.resourcefork is not None:
|
||||
fp = MacOS.openrf(path, '*wb')
|
||||
fp.write(self.resourcefork)
|
||||
fp.close()
|
||||
|
||||
def decode(infile, outpath, resonly=False, verbose=False):
|
||||
"""decode(infile, outpath [, resonly=False, verbose=False])
|
||||
|
||||
Creates a decoded file from an AppleSingle encoded file.
|
||||
If resonly is True, then it will create a regular file at
|
||||
outpath containing only the resource fork from infile.
|
||||
Otherwise it will create an AppleDouble file at outpath
|
||||
with the data and resource forks from infile. On platforms
|
||||
without the MacOS module, it will create inpath and inpath+'.rsrc'
|
||||
with the data and resource forks respectively.
|
||||
|
||||
"""
|
||||
if not hasattr(infile, 'read'):
|
||||
if isinstance(infile, Carbon.File.Alias):
|
||||
infile = infile.ResolveAlias()[0]
|
||||
|
||||
if hasattr(Carbon.File, "FSSpec"):
|
||||
if isinstance(infile, (Carbon.File.FSSpec, Carbon.File.FSRef)):
|
||||
infile = infile.as_pathname()
|
||||
else:
|
||||
if isinstance(infile, Carbon.File.FSRef):
|
||||
infile = infile.as_pathname()
|
||||
infile = open(infile, 'rb')
|
||||
|
||||
asfile = AppleSingle(infile, verbose=verbose)
|
||||
asfile.tofile(outpath, resonly=resonly)
|
||||
|
||||
def _test():
|
||||
if len(sys.argv) < 3 or sys.argv[1] == '-r' and len(sys.argv) != 4:
|
||||
print 'Usage: applesingle.py [-r] applesinglefile decodedfile'
|
||||
sys.exit(1)
|
||||
if sys.argv[1] == '-r':
|
||||
resonly = True
|
||||
del sys.argv[1]
|
||||
else:
|
||||
resonly = False
|
||||
decode(sys.argv[1], sys.argv[2], resonly=resonly)
|
||||
|
||||
if __name__ == '__main__':
|
||||
_test()
|
||||
67
Darwin/lib/python2.7/plat-mac/appletrawmain.py
Normal file
67
Darwin/lib/python2.7/plat-mac/appletrawmain.py
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
# Emulate sys.argv and run __main__.py or __main__.pyc in an environment that
|
||||
# is as close to "normal" as possible.
|
||||
#
|
||||
# This script is put into __rawmain__.pyc for applets that need argv
|
||||
# emulation, by BuildApplet and friends.
|
||||
#
|
||||
|
||||
from warnings import warnpy3k
|
||||
warnpy3k("In 3.x, the appletrawmain module is removed.", stacklevel=2)
|
||||
|
||||
import argvemulator
|
||||
import os
|
||||
import sys
|
||||
import marshal
|
||||
|
||||
#
|
||||
# Make sure we have an argv[0], and make _dir point to the Resources
|
||||
# directory.
|
||||
#
|
||||
if not sys.argv or sys.argv[0][:1] == '-':
|
||||
# Insert our (guessed) name.
|
||||
_dir = os.path.split(sys.executable)[0] # removes "python"
|
||||
_dir = os.path.split(_dir)[0] # Removes "MacOS"
|
||||
_dir = os.path.join(_dir, 'Resources')
|
||||
sys.argv.insert(0, '__rawmain__')
|
||||
else:
|
||||
_dir = os.path.split(sys.argv[0])[0]
|
||||
#
|
||||
# Add the Resources directory to the path. This is where files installed
|
||||
# by BuildApplet.py with the --extra option show up, and if those files are
|
||||
# modules this sys.path modification is necessary to be able to import them.
|
||||
#
|
||||
sys.path.insert(0, _dir)
|
||||
#
|
||||
# Create sys.argv
|
||||
#
|
||||
argvemulator.ArgvCollector().mainloop()
|
||||
#
|
||||
# Find the real main program to run
|
||||
#
|
||||
__file__ = os.path.join(_dir, '__main__.py')
|
||||
if os.path.exists(__file__):
|
||||
#
|
||||
# Setup something resembling a normal environment and go.
|
||||
#
|
||||
sys.argv[0] = __file__
|
||||
del argvemulator, os, sys, _dir
|
||||
execfile(__file__)
|
||||
else:
|
||||
__file__ = os.path.join(_dir, '__main__.pyc')
|
||||
if os.path.exists(__file__):
|
||||
#
|
||||
# If we have only a .pyc file we read the code object from that
|
||||
#
|
||||
sys.argv[0] = __file__
|
||||
_fp = open(__file__, 'rb')
|
||||
_fp.read(8)
|
||||
__code__ = marshal.load(_fp)
|
||||
#
|
||||
# Again, we create an almost-normal environment (only __code__ is
|
||||
# funny) and go.
|
||||
#
|
||||
del argvemulator, os, sys, marshal, _dir, _fp
|
||||
exec __code__
|
||||
else:
|
||||
sys.stderr.write("%s: neither __main__.py nor __main__.pyc found\n"%sys.argv[0])
|
||||
sys.exit(1)
|
||||
20
Darwin/lib/python2.7/plat-mac/appletrunner.py
Executable file
20
Darwin/lib/python2.7/plat-mac/appletrunner.py
Executable file
|
|
@ -0,0 +1,20 @@
|
|||
#!/usr/bin/env python
|
||||
# This file is meant as an executable script for running applets.
|
||||
# BuildApplet will use it as the main executable in the .app bundle if
|
||||
# we are not running in a framework build.
|
||||
|
||||
from warnings import warnpy3k
|
||||
warnpy3k("In 3.x, the appletrunner module is removed.", stacklevel=2)
|
||||
|
||||
import os
|
||||
import sys
|
||||
for name in ["__rawmain__.py", "__rawmain__.pyc", "__main__.py", "__main__.pyc"]:
|
||||
realmain = os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])),
|
||||
"Resources", name)
|
||||
if os.path.exists(realmain):
|
||||
break
|
||||
else:
|
||||
sys.stderr.write("%s: cannot find applet main program\n" % sys.argv[0])
|
||||
sys.exit(1)
|
||||
sys.argv.insert(1, realmain)
|
||||
os.execve(sys.executable, sys.argv, os.environ)
|
||||
92
Darwin/lib/python2.7/plat-mac/argvemulator.py
Normal file
92
Darwin/lib/python2.7/plat-mac/argvemulator.py
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
"""argvemulator - create sys.argv from OSA events. Used by applets that
|
||||
want unix-style arguments.
|
||||
"""
|
||||
|
||||
from warnings import warnpy3k
|
||||
warnpy3k("In 3.x, the argvemulator module is removed.", stacklevel=2)
|
||||
|
||||
import sys
|
||||
import traceback
|
||||
from Carbon import AE
|
||||
from Carbon.AppleEvents import *
|
||||
from Carbon import Evt
|
||||
from Carbon import File
|
||||
from Carbon.Events import *
|
||||
import aetools
|
||||
|
||||
class ArgvCollector:
|
||||
|
||||
"""A minimal FrameWork.Application-like class"""
|
||||
|
||||
def __init__(self):
|
||||
self.quitting = 0
|
||||
# Remove the funny -psn_xxx_xxx argument
|
||||
if len(sys.argv) > 1 and sys.argv[1][:4] == '-psn':
|
||||
del sys.argv[1]
|
||||
|
||||
AE.AEInstallEventHandler(kCoreEventClass, kAEOpenApplication, self.__runapp)
|
||||
AE.AEInstallEventHandler(kCoreEventClass, kAEOpenDocuments, self.__openfiles)
|
||||
|
||||
def close(self):
|
||||
AE.AERemoveEventHandler(kCoreEventClass, kAEOpenApplication)
|
||||
AE.AERemoveEventHandler(kCoreEventClass, kAEOpenDocuments)
|
||||
|
||||
def mainloop(self, mask = highLevelEventMask, timeout = 1*60):
|
||||
# Note: this is not the right way to run an event loop in OSX or even
|
||||
# "recent" versions of MacOS9. This is however code that has proven
|
||||
# itself.
|
||||
stoptime = Evt.TickCount() + timeout
|
||||
while not self.quitting and Evt.TickCount() < stoptime:
|
||||
self._dooneevent(mask, timeout)
|
||||
|
||||
if not self.quitting:
|
||||
print "argvemulator: timeout waiting for arguments"
|
||||
|
||||
self.close()
|
||||
|
||||
def _dooneevent(self, mask = highLevelEventMask, timeout = 1*60):
|
||||
got, event = Evt.WaitNextEvent(mask, timeout)
|
||||
if got:
|
||||
self._lowlevelhandler(event)
|
||||
|
||||
def _lowlevelhandler(self, event):
|
||||
what, message, when, where, modifiers = event
|
||||
h, v = where
|
||||
if what == kHighLevelEvent:
|
||||
try:
|
||||
AE.AEProcessAppleEvent(event)
|
||||
except AE.Error, err:
|
||||
msg = "High Level Event: %r %r" % (hex(message), hex(h | (v<<16)))
|
||||
print 'AE error: ', err
|
||||
print 'in', msg
|
||||
traceback.print_exc()
|
||||
return
|
||||
else:
|
||||
print "Unhandled event:", event
|
||||
|
||||
|
||||
def _quit(self):
|
||||
self.quitting = 1
|
||||
|
||||
def __runapp(self, requestevent, replyevent):
|
||||
self._quit()
|
||||
|
||||
def __openfiles(self, requestevent, replyevent):
|
||||
try:
|
||||
listdesc = requestevent.AEGetParamDesc(keyDirectObject, typeAEList)
|
||||
for i in range(listdesc.AECountItems()):
|
||||
aliasdesc = listdesc.AEGetNthDesc(i+1, typeAlias)[1]
|
||||
alias = File.Alias(rawdata=aliasdesc.data)
|
||||
fsref = alias.FSResolveAlias(None)[0]
|
||||
pathname = fsref.as_pathname()
|
||||
sys.argv.append(pathname)
|
||||
except Exception, e:
|
||||
print "argvemulator.py warning: can't unpack an open document event"
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
|
||||
self._quit()
|
||||
|
||||
if __name__ == '__main__':
|
||||
ArgvCollector().mainloop()
|
||||
print "sys.argv=", sys.argv
|
||||
58
Darwin/lib/python2.7/plat-mac/bgenlocations.py
Normal file
58
Darwin/lib/python2.7/plat-mac/bgenlocations.py
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
#
|
||||
# Local customizations for generating the Carbon interface modules.
|
||||
# Edit this file to reflect where things should be on your system.
|
||||
# Note that pathnames are unix-style for OSX MachoPython/unix-Python,
|
||||
# but mac-style for MacPython, whether running on OS9 or OSX.
|
||||
#
|
||||
|
||||
import os
|
||||
|
||||
from warnings import warnpy3k
|
||||
warnpy3k("In 3.x, the bgenlocations module is removed.", stacklevel=2)
|
||||
|
||||
Error = "bgenlocations.Error"
|
||||
#
|
||||
# Where bgen is. For unix-Python bgen isn't installed, so you have to refer to
|
||||
# the source tree here.
|
||||
BGENDIR="/Users/jack/src/python/Tools/bgen/bgen"
|
||||
|
||||
#
|
||||
# Where to find the Universal Header include files. If you have CodeWarrior
|
||||
# installed you can use the Universal Headers from there, otherwise you can
|
||||
# download them from the Apple website. Bgen can handle both unix- and mac-style
|
||||
# end of lines, so don't worry about that.
|
||||
#
|
||||
INCLUDEDIR="/Users/jack/src/Universal/Interfaces/CIncludes"
|
||||
|
||||
#
|
||||
# Where to put the python definitions files. Note that, on unix-Python,
|
||||
# if you want to commit your changes to the CVS repository this should refer to
|
||||
# your source directory, not your installed directory.
|
||||
#
|
||||
TOOLBOXDIR="/Users/jack/src/python/Lib/plat-mac/Carbon"
|
||||
|
||||
# Creator for C files:
|
||||
CREATOR="CWIE"
|
||||
|
||||
# The previous definitions can be overriden by creating a module
|
||||
# bgenlocationscustomize.py and putting it in site-packages (or anywere else
|
||||
# on sys.path, actually)
|
||||
try:
|
||||
from bgenlocationscustomize import *
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
if not os.path.exists(BGENDIR):
|
||||
raise Error, "Please fix bgenlocations.py, BGENDIR does not exist: %s" % BGENDIR
|
||||
if not os.path.exists(INCLUDEDIR):
|
||||
raise Error, "Please fix bgenlocations.py, INCLUDEDIR does not exist: %s" % INCLUDEDIR
|
||||
if not os.path.exists(TOOLBOXDIR):
|
||||
raise Error, "Please fix bgenlocations.py, TOOLBOXDIR does not exist: %s" % TOOLBOXDIR
|
||||
|
||||
# Sigh, due to the way these are used make sure they end with : or /.
|
||||
if BGENDIR[-1] != os.sep:
|
||||
BGENDIR = BGENDIR + os.sep
|
||||
if INCLUDEDIR[-1] != os.sep:
|
||||
INCLUDEDIR = INCLUDEDIR + os.sep
|
||||
if TOOLBOXDIR[-1] != os.sep:
|
||||
TOOLBOXDIR = TOOLBOXDIR + os.sep
|
||||
435
Darwin/lib/python2.7/plat-mac/buildtools.py
Normal file
435
Darwin/lib/python2.7/plat-mac/buildtools.py
Normal file
|
|
@ -0,0 +1,435 @@
|
|||
"""tools for BuildApplet and BuildApplication"""
|
||||
|
||||
import warnings
|
||||
warnings.warnpy3k("the buildtools module is deprecated and is removed in 3.0",
|
||||
stacklevel=2)
|
||||
|
||||
import sys
|
||||
import os
|
||||
import string
|
||||
import imp
|
||||
import marshal
|
||||
from Carbon import Res
|
||||
import Carbon.Files
|
||||
import Carbon.File
|
||||
import MacOS
|
||||
import macostools
|
||||
import macresource
|
||||
try:
|
||||
import EasyDialogs
|
||||
except ImportError:
|
||||
EasyDialogs = None
|
||||
import shutil
|
||||
|
||||
|
||||
BuildError = "BuildError"
|
||||
|
||||
# .pyc file (and 'PYC ' resource magic number)
|
||||
MAGIC = imp.get_magic()
|
||||
|
||||
# Template file (searched on sys.path)
|
||||
TEMPLATE = "PythonInterpreter"
|
||||
|
||||
# Specification of our resource
|
||||
RESTYPE = 'PYC '
|
||||
RESNAME = '__main__'
|
||||
|
||||
# A resource with this name sets the "owner" (creator) of the destination
|
||||
# It should also have ID=0. Either of these alone is not enough.
|
||||
OWNERNAME = "owner resource"
|
||||
|
||||
# Default applet creator code
|
||||
DEFAULT_APPLET_CREATOR="Pyta"
|
||||
|
||||
# OpenResFile mode parameters
|
||||
READ = 1
|
||||
WRITE = 2
|
||||
|
||||
# Parameter for FSOpenResourceFile
|
||||
RESOURCE_FORK_NAME=Carbon.File.FSGetResourceForkName()
|
||||
|
||||
def findtemplate(template=None):
|
||||
"""Locate the applet template along sys.path"""
|
||||
if MacOS.runtimemodel == 'macho':
|
||||
return None
|
||||
if not template:
|
||||
template=TEMPLATE
|
||||
for p in sys.path:
|
||||
file = os.path.join(p, template)
|
||||
try:
|
||||
file, d1, d2 = Carbon.File.FSResolveAliasFile(file, 1)
|
||||
break
|
||||
except (Carbon.File.Error, ValueError):
|
||||
continue
|
||||
else:
|
||||
raise BuildError, "Template %r not found on sys.path" % (template,)
|
||||
file = file.as_pathname()
|
||||
return file
|
||||
|
||||
def process(template, filename, destname, copy_codefragment=0,
|
||||
rsrcname=None, others=[], raw=0, progress="default", destroot=""):
|
||||
|
||||
if progress == "default":
|
||||
if EasyDialogs is None:
|
||||
print "Compiling %s"%(os.path.split(filename)[1],)
|
||||
process = None
|
||||
else:
|
||||
progress = EasyDialogs.ProgressBar("Processing %s..."%os.path.split(filename)[1], 120)
|
||||
progress.label("Compiling...")
|
||||
progress.inc(0)
|
||||
# check for the script name being longer than 32 chars. This may trigger a bug
|
||||
# on OSX that can destroy your sourcefile.
|
||||
if '#' in os.path.split(filename)[1]:
|
||||
raise BuildError, "BuildApplet could destroy your sourcefile on OSX, please rename: %s" % filename
|
||||
# Read the source and compile it
|
||||
# (there's no point overwriting the destination if it has a syntax error)
|
||||
|
||||
fp = open(filename, 'rU')
|
||||
text = fp.read()
|
||||
fp.close()
|
||||
try:
|
||||
code = compile(text + '\n', filename, "exec")
|
||||
except SyntaxError, arg:
|
||||
raise BuildError, "Syntax error in script %s: %s" % (filename, arg)
|
||||
except EOFError:
|
||||
raise BuildError, "End-of-file in script %s" % (filename,)
|
||||
|
||||
# Set the destination file name. Note that basename
|
||||
# does contain the whole filepath, only a .py is stripped.
|
||||
|
||||
if string.lower(filename[-3:]) == ".py":
|
||||
basename = filename[:-3]
|
||||
if MacOS.runtimemodel != 'macho' and not destname:
|
||||
destname = basename
|
||||
else:
|
||||
basename = filename
|
||||
|
||||
if not destname:
|
||||
if MacOS.runtimemodel == 'macho':
|
||||
destname = basename + '.app'
|
||||
else:
|
||||
destname = basename + '.applet'
|
||||
if not rsrcname:
|
||||
rsrcname = basename + '.rsrc'
|
||||
|
||||
# Try removing the output file. This fails in MachO, but it should
|
||||
# do any harm.
|
||||
try:
|
||||
os.remove(destname)
|
||||
except os.error:
|
||||
pass
|
||||
process_common(template, progress, code, rsrcname, destname, 0,
|
||||
copy_codefragment, raw, others, filename, destroot)
|
||||
|
||||
|
||||
def update(template, filename, output):
|
||||
if MacOS.runtimemodel == 'macho':
|
||||
raise BuildError, "No updating yet for MachO applets"
|
||||
if progress:
|
||||
if EasyDialogs is None:
|
||||
print "Updating %s"%(os.path.split(filename)[1],)
|
||||
progress = None
|
||||
else:
|
||||
progress = EasyDialogs.ProgressBar("Updating %s..."%os.path.split(filename)[1], 120)
|
||||
else:
|
||||
progress = None
|
||||
if not output:
|
||||
output = filename + ' (updated)'
|
||||
|
||||
# Try removing the output file
|
||||
try:
|
||||
os.remove(output)
|
||||
except os.error:
|
||||
pass
|
||||
process_common(template, progress, None, filename, output, 1, 1)
|
||||
|
||||
|
||||
def process_common(template, progress, code, rsrcname, destname, is_update,
|
||||
copy_codefragment, raw=0, others=[], filename=None, destroot=""):
|
||||
if MacOS.runtimemodel == 'macho':
|
||||
return process_common_macho(template, progress, code, rsrcname, destname,
|
||||
is_update, raw, others, filename, destroot)
|
||||
if others:
|
||||
raise BuildError, "Extra files only allowed for MachoPython applets"
|
||||
# Create FSSpecs for the various files
|
||||
template_fsr, d1, d2 = Carbon.File.FSResolveAliasFile(template, 1)
|
||||
template = template_fsr.as_pathname()
|
||||
|
||||
# Copy data (not resources, yet) from the template
|
||||
if progress:
|
||||
progress.label("Copy data fork...")
|
||||
progress.set(10)
|
||||
|
||||
if copy_codefragment:
|
||||
tmpl = open(template, "rb")
|
||||
dest = open(destname, "wb")
|
||||
data = tmpl.read()
|
||||
if data:
|
||||
dest.write(data)
|
||||
dest.close()
|
||||
tmpl.close()
|
||||
del dest
|
||||
del tmpl
|
||||
|
||||
# Open the output resource fork
|
||||
|
||||
if progress:
|
||||
progress.label("Copy resources...")
|
||||
progress.set(20)
|
||||
try:
|
||||
output = Res.FSOpenResourceFile(destname, RESOURCE_FORK_NAME, WRITE)
|
||||
except MacOS.Error:
|
||||
destdir, destfile = os.path.split(destname)
|
||||
Res.FSCreateResourceFile(destdir, unicode(destfile), RESOURCE_FORK_NAME)
|
||||
output = Res.FSOpenResourceFile(destname, RESOURCE_FORK_NAME, WRITE)
|
||||
|
||||
# Copy the resources from the target specific resource template, if any
|
||||
typesfound, ownertype = [], None
|
||||
try:
|
||||
input = Res.FSOpenResourceFile(rsrcname, RESOURCE_FORK_NAME, READ)
|
||||
except (MacOS.Error, ValueError):
|
||||
pass
|
||||
if progress:
|
||||
progress.inc(50)
|
||||
else:
|
||||
if is_update:
|
||||
skip_oldfile = ['cfrg']
|
||||
else:
|
||||
skip_oldfile = []
|
||||
typesfound, ownertype = copyres(input, output, skip_oldfile, 0, progress)
|
||||
Res.CloseResFile(input)
|
||||
|
||||
# Check which resource-types we should not copy from the template
|
||||
skiptypes = []
|
||||
if 'vers' in typesfound: skiptypes.append('vers')
|
||||
if 'SIZE' in typesfound: skiptypes.append('SIZE')
|
||||
if 'BNDL' in typesfound: skiptypes = skiptypes + ['BNDL', 'FREF', 'icl4',
|
||||
'icl8', 'ics4', 'ics8', 'ICN#', 'ics#']
|
||||
if not copy_codefragment:
|
||||
skiptypes.append('cfrg')
|
||||
## skipowner = (ownertype != None)
|
||||
|
||||
# Copy the resources from the template
|
||||
|
||||
input = Res.FSOpenResourceFile(template, RESOURCE_FORK_NAME, READ)
|
||||
dummy, tmplowner = copyres(input, output, skiptypes, 1, progress)
|
||||
|
||||
Res.CloseResFile(input)
|
||||
## if ownertype is None:
|
||||
## raise BuildError, "No owner resource found in either resource file or template"
|
||||
# Make sure we're manipulating the output resource file now
|
||||
|
||||
Res.UseResFile(output)
|
||||
|
||||
if ownertype is None:
|
||||
# No owner resource in the template. We have skipped the
|
||||
# Python owner resource, so we have to add our own. The relevant
|
||||
# bundle stuff is already included in the interpret/applet template.
|
||||
newres = Res.Resource('\0')
|
||||
newres.AddResource(DEFAULT_APPLET_CREATOR, 0, "Owner resource")
|
||||
ownertype = DEFAULT_APPLET_CREATOR
|
||||
|
||||
if code:
|
||||
# Delete any existing 'PYC ' resource named __main__
|
||||
|
||||
try:
|
||||
res = Res.Get1NamedResource(RESTYPE, RESNAME)
|
||||
res.RemoveResource()
|
||||
except Res.Error:
|
||||
pass
|
||||
|
||||
# Create the raw data for the resource from the code object
|
||||
if progress:
|
||||
progress.label("Write PYC resource...")
|
||||
progress.set(120)
|
||||
|
||||
data = marshal.dumps(code)
|
||||
del code
|
||||
data = (MAGIC + '\0\0\0\0') + data
|
||||
|
||||
# Create the resource and write it
|
||||
|
||||
id = 0
|
||||
while id < 128:
|
||||
id = Res.Unique1ID(RESTYPE)
|
||||
res = Res.Resource(data)
|
||||
res.AddResource(RESTYPE, id, RESNAME)
|
||||
attrs = res.GetResAttrs()
|
||||
attrs = attrs | 0x04 # set preload
|
||||
res.SetResAttrs(attrs)
|
||||
res.WriteResource()
|
||||
res.ReleaseResource()
|
||||
|
||||
# Close the output file
|
||||
|
||||
Res.CloseResFile(output)
|
||||
|
||||
# Now set the creator, type and bundle bit of the destination.
|
||||
# Done with FSSpec's, FSRef FInfo isn't good enough yet (2.3a1+)
|
||||
dest_fss = Carbon.File.FSSpec(destname)
|
||||
dest_finfo = dest_fss.FSpGetFInfo()
|
||||
dest_finfo.Creator = ownertype
|
||||
dest_finfo.Type = 'APPL'
|
||||
dest_finfo.Flags = dest_finfo.Flags | Carbon.Files.kHasBundle | Carbon.Files.kIsShared
|
||||
dest_finfo.Flags = dest_finfo.Flags & ~Carbon.Files.kHasBeenInited
|
||||
dest_fss.FSpSetFInfo(dest_finfo)
|
||||
|
||||
macostools.touched(destname)
|
||||
if progress:
|
||||
progress.label("Done.")
|
||||
progress.inc(0)
|
||||
|
||||
def process_common_macho(template, progress, code, rsrcname, destname, is_update,
|
||||
raw=0, others=[], filename=None, destroot=""):
|
||||
# Check that we have a filename
|
||||
if filename is None:
|
||||
raise BuildError, "Need source filename on MacOSX"
|
||||
# First make sure the name ends in ".app"
|
||||
if destname[-4:] != '.app':
|
||||
destname = destname + '.app'
|
||||
# Now deduce the short name
|
||||
destdir, shortname = os.path.split(destname)
|
||||
if shortname[-4:] == '.app':
|
||||
# Strip the .app suffix
|
||||
shortname = shortname[:-4]
|
||||
# And deduce the .plist and .icns names
|
||||
plistname = None
|
||||
icnsname = None
|
||||
if rsrcname and rsrcname[-5:] == '.rsrc':
|
||||
tmp = rsrcname[:-5]
|
||||
plistname = tmp + '.plist'
|
||||
if os.path.exists(plistname):
|
||||
icnsname = tmp + '.icns'
|
||||
if not os.path.exists(icnsname):
|
||||
icnsname = None
|
||||
else:
|
||||
plistname = None
|
||||
if not icnsname:
|
||||
dft_icnsname = os.path.join(sys.prefix, 'Resources/Python.app/Contents/Resources/PythonApplet.icns')
|
||||
if os.path.exists(dft_icnsname):
|
||||
icnsname = dft_icnsname
|
||||
if not os.path.exists(rsrcname):
|
||||
rsrcname = None
|
||||
if progress:
|
||||
progress.label('Creating bundle...')
|
||||
import bundlebuilder
|
||||
builder = bundlebuilder.AppBuilder(verbosity=0)
|
||||
builder.mainprogram = filename
|
||||
builder.builddir = destdir
|
||||
builder.name = shortname
|
||||
builder.destroot = destroot
|
||||
if rsrcname:
|
||||
realrsrcname = macresource.resource_pathname(rsrcname)
|
||||
builder.files.append((realrsrcname,
|
||||
os.path.join('Contents/Resources', os.path.basename(rsrcname))))
|
||||
for o in others:
|
||||
if type(o) == str:
|
||||
builder.resources.append(o)
|
||||
else:
|
||||
builder.files.append(o)
|
||||
if plistname:
|
||||
import plistlib
|
||||
builder.plist = plistlib.Plist.fromFile(plistname)
|
||||
if icnsname:
|
||||
builder.iconfile = icnsname
|
||||
if not raw:
|
||||
builder.argv_emulation = 1
|
||||
builder.setup()
|
||||
builder.build()
|
||||
if progress:
|
||||
progress.label('Done.')
|
||||
progress.inc(0)
|
||||
|
||||
## macostools.touched(dest_fss)
|
||||
|
||||
# Copy resources between two resource file descriptors.
|
||||
# skip a resource named '__main__' or (if skipowner is set) with ID zero.
|
||||
# Also skip resources with a type listed in skiptypes.
|
||||
#
|
||||
def copyres(input, output, skiptypes, skipowner, progress=None):
|
||||
ctor = None
|
||||
alltypes = []
|
||||
Res.UseResFile(input)
|
||||
ntypes = Res.Count1Types()
|
||||
progress_type_inc = 50/ntypes
|
||||
for itype in range(1, 1+ntypes):
|
||||
type = Res.Get1IndType(itype)
|
||||
if type in skiptypes:
|
||||
continue
|
||||
alltypes.append(type)
|
||||
nresources = Res.Count1Resources(type)
|
||||
progress_cur_inc = progress_type_inc/nresources
|
||||
for ires in range(1, 1+nresources):
|
||||
res = Res.Get1IndResource(type, ires)
|
||||
id, type, name = res.GetResInfo()
|
||||
lcname = string.lower(name)
|
||||
|
||||
if lcname == OWNERNAME and id == 0:
|
||||
if skipowner:
|
||||
continue # Skip this one
|
||||
else:
|
||||
ctor = type
|
||||
size = res.size
|
||||
attrs = res.GetResAttrs()
|
||||
if progress:
|
||||
progress.label("Copy %s %d %s"%(type, id, name))
|
||||
progress.inc(progress_cur_inc)
|
||||
res.LoadResource()
|
||||
res.DetachResource()
|
||||
Res.UseResFile(output)
|
||||
try:
|
||||
res2 = Res.Get1Resource(type, id)
|
||||
except MacOS.Error:
|
||||
res2 = None
|
||||
if res2:
|
||||
if progress:
|
||||
progress.label("Overwrite %s %d %s"%(type, id, name))
|
||||
progress.inc(0)
|
||||
res2.RemoveResource()
|
||||
res.AddResource(type, id, name)
|
||||
res.WriteResource()
|
||||
attrs = attrs | res.GetResAttrs()
|
||||
res.SetResAttrs(attrs)
|
||||
Res.UseResFile(input)
|
||||
return alltypes, ctor
|
||||
|
||||
def copyapptree(srctree, dsttree, exceptlist=[], progress=None):
|
||||
names = []
|
||||
if os.path.exists(dsttree):
|
||||
shutil.rmtree(dsttree)
|
||||
os.mkdir(dsttree)
|
||||
todo = os.listdir(srctree)
|
||||
while todo:
|
||||
this, todo = todo[0], todo[1:]
|
||||
if this in exceptlist:
|
||||
continue
|
||||
thispath = os.path.join(srctree, this)
|
||||
if os.path.isdir(thispath):
|
||||
thiscontent = os.listdir(thispath)
|
||||
for t in thiscontent:
|
||||
todo.append(os.path.join(this, t))
|
||||
names.append(this)
|
||||
for this in names:
|
||||
srcpath = os.path.join(srctree, this)
|
||||
dstpath = os.path.join(dsttree, this)
|
||||
if os.path.isdir(srcpath):
|
||||
os.mkdir(dstpath)
|
||||
elif os.path.islink(srcpath):
|
||||
endpoint = os.readlink(srcpath)
|
||||
os.symlink(endpoint, dstpath)
|
||||
else:
|
||||
if progress:
|
||||
progress.label('Copy '+this)
|
||||
progress.inc(0)
|
||||
shutil.copy2(srcpath, dstpath)
|
||||
|
||||
def writepycfile(codeobject, cfile):
|
||||
import marshal
|
||||
fc = open(cfile, 'wb')
|
||||
fc.write('\0\0\0\0') # MAGIC placeholder, written later
|
||||
fc.write('\0\0\0\0') # Timestap placeholder, not needed
|
||||
marshal.dump(codeobject, fc)
|
||||
fc.flush()
|
||||
fc.seek(0, 0)
|
||||
fc.write(MAGIC)
|
||||
fc.close()
|
||||
949
Darwin/lib/python2.7/plat-mac/bundlebuilder.py
Executable file
949
Darwin/lib/python2.7/plat-mac/bundlebuilder.py
Executable file
|
|
@ -0,0 +1,949 @@
|
|||
#! /usr/bin/env python
|
||||
|
||||
"""\
|
||||
bundlebuilder.py -- Tools to assemble MacOS X (application) bundles.
|
||||
|
||||
This module contains two classes to build so called "bundles" for
|
||||
MacOS X. BundleBuilder is a general tool, AppBuilder is a subclass
|
||||
specialized in building application bundles.
|
||||
|
||||
[Bundle|App]Builder objects are instantiated with a bunch of keyword
|
||||
arguments, and have a build() method that will do all the work. See
|
||||
the class doc strings for a description of the constructor arguments.
|
||||
|
||||
The module contains a main program that can be used in two ways:
|
||||
|
||||
% python bundlebuilder.py [options] build
|
||||
% python buildapp.py [options] build
|
||||
|
||||
Where "buildapp.py" is a user-supplied setup.py-like script following
|
||||
this model:
|
||||
|
||||
from bundlebuilder import buildapp
|
||||
buildapp(<lots-of-keyword-args>)
|
||||
|
||||
"""
|
||||
|
||||
|
||||
__all__ = ["BundleBuilder", "BundleBuilderError", "AppBuilder", "buildapp"]
|
||||
|
||||
|
||||
from warnings import warnpy3k
|
||||
warnpy3k("In 3.x, the bundlebuilder module is removed.", stacklevel=2)
|
||||
|
||||
import sys
|
||||
import os, errno, shutil
|
||||
import imp, marshal
|
||||
import re
|
||||
from copy import deepcopy
|
||||
import getopt
|
||||
from plistlib import Plist
|
||||
from types import FunctionType as function
|
||||
|
||||
class BundleBuilderError(Exception): pass
|
||||
|
||||
|
||||
class Defaults:
|
||||
|
||||
"""Class attributes that don't start with an underscore and are
|
||||
not functions or classmethods are (deep)copied to self.__dict__.
|
||||
This allows for mutable default values.
|
||||
"""
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
defaults = self._getDefaults()
|
||||
defaults.update(kwargs)
|
||||
self.__dict__.update(defaults)
|
||||
|
||||
def _getDefaults(cls):
|
||||
defaults = {}
|
||||
for base in cls.__bases__:
|
||||
if hasattr(base, "_getDefaults"):
|
||||
defaults.update(base._getDefaults())
|
||||
for name, value in cls.__dict__.items():
|
||||
if name[0] != "_" and not isinstance(value,
|
||||
(function, classmethod)):
|
||||
defaults[name] = deepcopy(value)
|
||||
return defaults
|
||||
_getDefaults = classmethod(_getDefaults)
|
||||
|
||||
|
||||
class BundleBuilder(Defaults):
|
||||
|
||||
"""BundleBuilder is a barebones class for assembling bundles. It
|
||||
knows nothing about executables or icons, it only copies files
|
||||
and creates the PkgInfo and Info.plist files.
|
||||
"""
|
||||
|
||||
# (Note that Defaults.__init__ (deep)copies these values to
|
||||
# instance variables. Mutable defaults are therefore safe.)
|
||||
|
||||
# Name of the bundle, with or without extension.
|
||||
name = None
|
||||
|
||||
# The property list ("plist")
|
||||
plist = Plist(CFBundleDevelopmentRegion = "English",
|
||||
CFBundleInfoDictionaryVersion = "6.0")
|
||||
|
||||
# The type of the bundle.
|
||||
type = "BNDL"
|
||||
# The creator code of the bundle.
|
||||
creator = None
|
||||
|
||||
# the CFBundleIdentifier (this is used for the preferences file name)
|
||||
bundle_id = None
|
||||
|
||||
# List of files that have to be copied to <bundle>/Contents/Resources.
|
||||
resources = []
|
||||
|
||||
# List of (src, dest) tuples; dest should be a path relative to the bundle
|
||||
# (eg. "Contents/Resources/MyStuff/SomeFile.ext).
|
||||
files = []
|
||||
|
||||
# List of shared libraries (dylibs, Frameworks) to bundle with the app
|
||||
# will be placed in Contents/Frameworks
|
||||
libs = []
|
||||
|
||||
# Directory where the bundle will be assembled.
|
||||
builddir = "build"
|
||||
|
||||
# Make symlinks instead copying files. This is handy during debugging, but
|
||||
# makes the bundle non-distributable.
|
||||
symlink = 0
|
||||
|
||||
# Verbosity level.
|
||||
verbosity = 1
|
||||
|
||||
# Destination root directory
|
||||
destroot = ""
|
||||
|
||||
def setup(self):
|
||||
# XXX rethink self.name munging, this is brittle.
|
||||
self.name, ext = os.path.splitext(self.name)
|
||||
if not ext:
|
||||
ext = ".bundle"
|
||||
bundleextension = ext
|
||||
# misc (derived) attributes
|
||||
self.bundlepath = pathjoin(self.builddir, self.name + bundleextension)
|
||||
|
||||
plist = self.plist
|
||||
plist.CFBundleName = self.name
|
||||
plist.CFBundlePackageType = self.type
|
||||
if self.creator is None:
|
||||
if hasattr(plist, "CFBundleSignature"):
|
||||
self.creator = plist.CFBundleSignature
|
||||
else:
|
||||
self.creator = "????"
|
||||
plist.CFBundleSignature = self.creator
|
||||
if self.bundle_id:
|
||||
plist.CFBundleIdentifier = self.bundle_id
|
||||
elif not hasattr(plist, "CFBundleIdentifier"):
|
||||
plist.CFBundleIdentifier = self.name
|
||||
|
||||
def build(self):
|
||||
"""Build the bundle."""
|
||||
builddir = self.builddir
|
||||
if builddir and not os.path.exists(builddir):
|
||||
os.mkdir(builddir)
|
||||
self.message("Building %s" % repr(self.bundlepath), 1)
|
||||
if os.path.exists(self.bundlepath):
|
||||
shutil.rmtree(self.bundlepath)
|
||||
if os.path.exists(self.bundlepath + '~'):
|
||||
shutil.rmtree(self.bundlepath + '~')
|
||||
bp = self.bundlepath
|
||||
|
||||
# Create the app bundle in a temporary location and then
|
||||
# rename the completed bundle. This way the Finder will
|
||||
# never see an incomplete bundle (where it might pick up
|
||||
# and cache the wrong meta data)
|
||||
self.bundlepath = bp + '~'
|
||||
try:
|
||||
os.mkdir(self.bundlepath)
|
||||
self.preProcess()
|
||||
self._copyFiles()
|
||||
self._addMetaFiles()
|
||||
self.postProcess()
|
||||
os.rename(self.bundlepath, bp)
|
||||
finally:
|
||||
self.bundlepath = bp
|
||||
self.message("Done.", 1)
|
||||
|
||||
def preProcess(self):
|
||||
"""Hook for subclasses."""
|
||||
pass
|
||||
def postProcess(self):
|
||||
"""Hook for subclasses."""
|
||||
pass
|
||||
|
||||
def _addMetaFiles(self):
|
||||
contents = pathjoin(self.bundlepath, "Contents")
|
||||
makedirs(contents)
|
||||
#
|
||||
# Write Contents/PkgInfo
|
||||
assert len(self.type) == len(self.creator) == 4, \
|
||||
"type and creator must be 4-byte strings."
|
||||
pkginfo = pathjoin(contents, "PkgInfo")
|
||||
f = open(pkginfo, "wb")
|
||||
f.write(self.type + self.creator)
|
||||
f.close()
|
||||
#
|
||||
# Write Contents/Info.plist
|
||||
infoplist = pathjoin(contents, "Info.plist")
|
||||
self.plist.write(infoplist)
|
||||
|
||||
def _copyFiles(self):
|
||||
files = self.files[:]
|
||||
for path in self.resources:
|
||||
files.append((path, pathjoin("Contents", "Resources",
|
||||
os.path.basename(path))))
|
||||
for path in self.libs:
|
||||
files.append((path, pathjoin("Contents", "Frameworks",
|
||||
os.path.basename(path))))
|
||||
if self.symlink:
|
||||
self.message("Making symbolic links", 1)
|
||||
msg = "Making symlink from"
|
||||
else:
|
||||
self.message("Copying files", 1)
|
||||
msg = "Copying"
|
||||
files.sort()
|
||||
for src, dst in files:
|
||||
if os.path.isdir(src):
|
||||
self.message("%s %s/ to %s/" % (msg, src, dst), 2)
|
||||
else:
|
||||
self.message("%s %s to %s" % (msg, src, dst), 2)
|
||||
dst = pathjoin(self.bundlepath, dst)
|
||||
if self.symlink:
|
||||
symlink(src, dst, mkdirs=1)
|
||||
else:
|
||||
copy(src, dst, mkdirs=1)
|
||||
|
||||
def message(self, msg, level=0):
|
||||
if level <= self.verbosity:
|
||||
indent = ""
|
||||
if level > 1:
|
||||
indent = (level - 1) * " "
|
||||
sys.stderr.write(indent + msg + "\n")
|
||||
|
||||
def report(self):
|
||||
# XXX something decent
|
||||
pass
|
||||
|
||||
|
||||
if __debug__:
|
||||
PYC_EXT = ".pyc"
|
||||
else:
|
||||
PYC_EXT = ".pyo"
|
||||
|
||||
MAGIC = imp.get_magic()
|
||||
USE_ZIPIMPORT = "zipimport" in sys.builtin_module_names
|
||||
|
||||
# For standalone apps, we have our own minimal site.py. We don't need
|
||||
# all the cruft of the real site.py.
|
||||
SITE_PY = """\
|
||||
import sys
|
||||
if not %(semi_standalone)s:
|
||||
del sys.path[1:] # sys.path[0] is Contents/Resources/
|
||||
"""
|
||||
|
||||
ZIP_ARCHIVE = "Modules.zip"
|
||||
SITE_PY_ZIP = SITE_PY + ("sys.path.append(sys.path[0] + '/%s')\n" % ZIP_ARCHIVE)
|
||||
|
||||
def getPycData(fullname, code, ispkg):
|
||||
if ispkg:
|
||||
fullname += ".__init__"
|
||||
path = fullname.replace(".", os.sep) + PYC_EXT
|
||||
return path, MAGIC + '\0\0\0\0' + marshal.dumps(code)
|
||||
|
||||
#
|
||||
# Extension modules can't be in the modules zip archive, so a placeholder
|
||||
# is added instead, that loads the extension from a specified location.
|
||||
#
|
||||
EXT_LOADER = """\
|
||||
def __load():
|
||||
import imp, sys, os
|
||||
for p in sys.path:
|
||||
path = os.path.join(p, "%(filename)s")
|
||||
if os.path.exists(path):
|
||||
break
|
||||
else:
|
||||
assert 0, "file not found: %(filename)s"
|
||||
mod = imp.load_dynamic("%(name)s", path)
|
||||
|
||||
__load()
|
||||
del __load
|
||||
"""
|
||||
|
||||
MAYMISS_MODULES = ['os2', 'nt', 'ntpath', 'dos', 'dospath',
|
||||
'win32api', 'ce', '_winreg', 'nturl2path', 'sitecustomize',
|
||||
'org.python.core', 'riscos', 'riscosenviron', 'riscospath'
|
||||
]
|
||||
|
||||
STRIP_EXEC = "/usr/bin/strip"
|
||||
|
||||
#
|
||||
# We're using a stock interpreter to run the app, yet we need
|
||||
# a way to pass the Python main program to the interpreter. The
|
||||
# bootstrapping script fires up the interpreter with the right
|
||||
# arguments. os.execve() is used as OSX doesn't like us to
|
||||
# start a real new process. Also, the executable name must match
|
||||
# the CFBundleExecutable value in the Info.plist, so we lie
|
||||
# deliberately with argv[0]. The actual Python executable is
|
||||
# passed in an environment variable so we can "repair"
|
||||
# sys.executable later.
|
||||
#
|
||||
BOOTSTRAP_SCRIPT = """\
|
||||
#!%(hashbang)s
|
||||
|
||||
import sys, os
|
||||
execdir = os.path.dirname(sys.argv[0])
|
||||
executable = os.path.join(execdir, "%(executable)s")
|
||||
resdir = os.path.join(os.path.dirname(execdir), "Resources")
|
||||
libdir = os.path.join(os.path.dirname(execdir), "Frameworks")
|
||||
mainprogram = os.path.join(resdir, "%(mainprogram)s")
|
||||
|
||||
if %(optimize)s:
|
||||
sys.argv.insert(1, '-O')
|
||||
|
||||
sys.argv.insert(1, mainprogram)
|
||||
if %(standalone)s or %(semi_standalone)s:
|
||||
os.environ["PYTHONPATH"] = resdir
|
||||
if %(standalone)s:
|
||||
os.environ["PYTHONHOME"] = resdir
|
||||
else:
|
||||
pypath = os.getenv("PYTHONPATH", "")
|
||||
if pypath:
|
||||
pypath = ":" + pypath
|
||||
os.environ["PYTHONPATH"] = resdir + pypath
|
||||
|
||||
os.environ["PYTHONEXECUTABLE"] = executable
|
||||
os.environ["DYLD_LIBRARY_PATH"] = libdir
|
||||
os.environ["DYLD_FRAMEWORK_PATH"] = libdir
|
||||
os.execve(executable, sys.argv, os.environ)
|
||||
"""
|
||||
|
||||
|
||||
#
|
||||
# Optional wrapper that converts "dropped files" into sys.argv values.
|
||||
#
|
||||
ARGV_EMULATOR = """\
|
||||
import argvemulator, os
|
||||
|
||||
argvemulator.ArgvCollector().mainloop()
|
||||
execfile(os.path.join(os.path.split(__file__)[0], "%(realmainprogram)s"))
|
||||
"""
|
||||
|
||||
#
|
||||
# When building a standalone app with Python.framework, we need to copy
|
||||
# a subset from Python.framework to the bundle. The following list
|
||||
# specifies exactly what items we'll copy.
|
||||
#
|
||||
PYTHONFRAMEWORKGOODIES = [
|
||||
"Python", # the Python core library
|
||||
"Resources/English.lproj",
|
||||
"Resources/Info.plist",
|
||||
]
|
||||
|
||||
def isFramework():
|
||||
return sys.exec_prefix.find("Python.framework") > 0
|
||||
|
||||
|
||||
LIB = os.path.join(sys.prefix, "lib", "python" + sys.version[:3])
|
||||
SITE_PACKAGES = os.path.join(LIB, "site-packages")
|
||||
|
||||
|
||||
class AppBuilder(BundleBuilder):
|
||||
|
||||
use_zipimport = USE_ZIPIMPORT
|
||||
|
||||
# Override type of the bundle.
|
||||
type = "APPL"
|
||||
|
||||
# platform, name of the subfolder of Contents that contains the executable.
|
||||
platform = "MacOS"
|
||||
|
||||
# A Python main program. If this argument is given, the main
|
||||
# executable in the bundle will be a small wrapper that invokes
|
||||
# the main program. (XXX Discuss why.)
|
||||
mainprogram = None
|
||||
|
||||
# The main executable. If a Python main program is specified
|
||||
# the executable will be copied to Resources and be invoked
|
||||
# by the wrapper program mentioned above. Otherwise it will
|
||||
# simply be used as the main executable.
|
||||
executable = None
|
||||
|
||||
# The name of the main nib, for Cocoa apps. *Must* be specified
|
||||
# when building a Cocoa app.
|
||||
nibname = None
|
||||
|
||||
# The name of the icon file to be copied to Resources and used for
|
||||
# the Finder icon.
|
||||
iconfile = None
|
||||
|
||||
# Symlink the executable instead of copying it.
|
||||
symlink_exec = 0
|
||||
|
||||
# If True, build standalone app.
|
||||
standalone = 0
|
||||
|
||||
# If True, build semi-standalone app (only includes third-party modules).
|
||||
semi_standalone = 0
|
||||
|
||||
# If set, use this for #! lines in stead of sys.executable
|
||||
python = None
|
||||
|
||||
# If True, add a real main program that emulates sys.argv before calling
|
||||
# mainprogram
|
||||
argv_emulation = 0
|
||||
|
||||
# The following attributes are only used when building a standalone app.
|
||||
|
||||
# Exclude these modules.
|
||||
excludeModules = []
|
||||
|
||||
# Include these modules.
|
||||
includeModules = []
|
||||
|
||||
# Include these packages.
|
||||
includePackages = []
|
||||
|
||||
# Strip binaries from debug info.
|
||||
strip = 0
|
||||
|
||||
# Found Python modules: [(name, codeobject, ispkg), ...]
|
||||
pymodules = []
|
||||
|
||||
# Modules that modulefinder couldn't find:
|
||||
missingModules = []
|
||||
maybeMissingModules = []
|
||||
|
||||
def setup(self):
|
||||
if ((self.standalone or self.semi_standalone)
|
||||
and self.mainprogram is None):
|
||||
raise BundleBuilderError, ("must specify 'mainprogram' when "
|
||||
"building a standalone application.")
|
||||
if self.mainprogram is None and self.executable is None:
|
||||
raise BundleBuilderError, ("must specify either or both of "
|
||||
"'executable' and 'mainprogram'")
|
||||
|
||||
self.execdir = pathjoin("Contents", self.platform)
|
||||
|
||||
if self.name is not None:
|
||||
pass
|
||||
elif self.mainprogram is not None:
|
||||
self.name = os.path.splitext(os.path.basename(self.mainprogram))[0]
|
||||
elif self.executable is not None:
|
||||
self.name = os.path.splitext(os.path.basename(self.executable))[0]
|
||||
if self.name[-4:] != ".app":
|
||||
self.name += ".app"
|
||||
|
||||
if self.executable is None:
|
||||
if not self.standalone and not isFramework():
|
||||
self.symlink_exec = 1
|
||||
if self.python:
|
||||
self.executable = self.python
|
||||
else:
|
||||
self.executable = sys.executable
|
||||
|
||||
if self.nibname:
|
||||
self.plist.NSMainNibFile = self.nibname
|
||||
if not hasattr(self.plist, "NSPrincipalClass"):
|
||||
self.plist.NSPrincipalClass = "NSApplication"
|
||||
|
||||
if self.standalone and isFramework():
|
||||
self.addPythonFramework()
|
||||
|
||||
BundleBuilder.setup(self)
|
||||
|
||||
self.plist.CFBundleExecutable = self.name
|
||||
|
||||
if self.standalone or self.semi_standalone:
|
||||
self.findDependencies()
|
||||
|
||||
def preProcess(self):
|
||||
resdir = "Contents/Resources"
|
||||
if self.executable is not None:
|
||||
if self.mainprogram is None:
|
||||
execname = self.name
|
||||
else:
|
||||
execname = os.path.basename(self.executable)
|
||||
execpath = pathjoin(self.execdir, execname)
|
||||
if not self.symlink_exec:
|
||||
self.files.append((self.destroot + self.executable, execpath))
|
||||
self.execpath = execpath
|
||||
|
||||
if self.mainprogram is not None:
|
||||
mainprogram = os.path.basename(self.mainprogram)
|
||||
self.files.append((self.mainprogram, pathjoin(resdir, mainprogram)))
|
||||
if self.argv_emulation:
|
||||
# Change the main program, and create the helper main program (which
|
||||
# does argv collection and then calls the real main).
|
||||
# Also update the included modules (if we're creating a standalone
|
||||
# program) and the plist
|
||||
realmainprogram = mainprogram
|
||||
mainprogram = '__argvemulator_' + mainprogram
|
||||
resdirpath = pathjoin(self.bundlepath, resdir)
|
||||
mainprogrampath = pathjoin(resdirpath, mainprogram)
|
||||
makedirs(resdirpath)
|
||||
open(mainprogrampath, "w").write(ARGV_EMULATOR % locals())
|
||||
if self.standalone or self.semi_standalone:
|
||||
self.includeModules.append("argvemulator")
|
||||
self.includeModules.append("os")
|
||||
if "CFBundleDocumentTypes" not in self.plist:
|
||||
self.plist["CFBundleDocumentTypes"] = [
|
||||
{ "CFBundleTypeOSTypes" : [
|
||||
"****",
|
||||
"fold",
|
||||
"disk"],
|
||||
"CFBundleTypeRole": "Viewer"}]
|
||||
# Write bootstrap script
|
||||
executable = os.path.basename(self.executable)
|
||||
execdir = pathjoin(self.bundlepath, self.execdir)
|
||||
bootstrappath = pathjoin(execdir, self.name)
|
||||
makedirs(execdir)
|
||||
if self.standalone or self.semi_standalone:
|
||||
# XXX we're screwed when the end user has deleted
|
||||
# /usr/bin/python
|
||||
hashbang = "/usr/bin/python"
|
||||
elif self.python:
|
||||
hashbang = self.python
|
||||
else:
|
||||
hashbang = os.path.realpath(sys.executable)
|
||||
standalone = self.standalone
|
||||
semi_standalone = self.semi_standalone
|
||||
optimize = sys.flags.optimize
|
||||
open(bootstrappath, "w").write(BOOTSTRAP_SCRIPT % locals())
|
||||
os.chmod(bootstrappath, 0775)
|
||||
|
||||
if self.iconfile is not None:
|
||||
iconbase = os.path.basename(self.iconfile)
|
||||
self.plist.CFBundleIconFile = iconbase
|
||||
self.files.append((self.iconfile, pathjoin(resdir, iconbase)))
|
||||
|
||||
def postProcess(self):
|
||||
if self.standalone or self.semi_standalone:
|
||||
self.addPythonModules()
|
||||
if self.strip and not self.symlink:
|
||||
self.stripBinaries()
|
||||
|
||||
if self.symlink_exec and self.executable:
|
||||
self.message("Symlinking executable %s to %s" % (self.executable,
|
||||
self.execpath), 2)
|
||||
dst = pathjoin(self.bundlepath, self.execpath)
|
||||
makedirs(os.path.dirname(dst))
|
||||
os.symlink(os.path.abspath(self.executable), dst)
|
||||
|
||||
if self.missingModules or self.maybeMissingModules:
|
||||
self.reportMissing()
|
||||
|
||||
def addPythonFramework(self):
|
||||
# If we're building a standalone app with Python.framework,
|
||||
# include a minimal subset of Python.framework, *unless*
|
||||
# Python.framework was specified manually in self.libs.
|
||||
for lib in self.libs:
|
||||
if os.path.basename(lib) == "Python.framework":
|
||||
# a Python.framework was specified as a library
|
||||
return
|
||||
|
||||
frameworkpath = sys.exec_prefix[:sys.exec_prefix.find(
|
||||
"Python.framework") + len("Python.framework")]
|
||||
|
||||
version = sys.version[:3]
|
||||
frameworkpath = pathjoin(frameworkpath, "Versions", version)
|
||||
destbase = pathjoin("Contents", "Frameworks", "Python.framework",
|
||||
"Versions", version)
|
||||
for item in PYTHONFRAMEWORKGOODIES:
|
||||
src = pathjoin(frameworkpath, item)
|
||||
dst = pathjoin(destbase, item)
|
||||
self.files.append((src, dst))
|
||||
|
||||
def _getSiteCode(self):
|
||||
if self.use_zipimport:
|
||||
return compile(SITE_PY % {"semi_standalone": self.semi_standalone},
|
||||
"<-bundlebuilder.py->", "exec")
|
||||
|
||||
def addPythonModules(self):
|
||||
self.message("Adding Python modules", 1)
|
||||
|
||||
if self.use_zipimport:
|
||||
# Create a zip file containing all modules as pyc.
|
||||
import zipfile
|
||||
relpath = pathjoin("Contents", "Resources", ZIP_ARCHIVE)
|
||||
abspath = pathjoin(self.bundlepath, relpath)
|
||||
zf = zipfile.ZipFile(abspath, "w", zipfile.ZIP_DEFLATED)
|
||||
for name, code, ispkg in self.pymodules:
|
||||
self.message("Adding Python module %s" % name, 2)
|
||||
path, pyc = getPycData(name, code, ispkg)
|
||||
zf.writestr(path, pyc)
|
||||
zf.close()
|
||||
# add site.pyc
|
||||
sitepath = pathjoin(self.bundlepath, "Contents", "Resources",
|
||||
"site" + PYC_EXT)
|
||||
writePyc(self._getSiteCode(), sitepath)
|
||||
else:
|
||||
# Create individual .pyc files.
|
||||
for name, code, ispkg in self.pymodules:
|
||||
if ispkg:
|
||||
name += ".__init__"
|
||||
path = name.split(".")
|
||||
path = pathjoin("Contents", "Resources", *path) + PYC_EXT
|
||||
|
||||
if ispkg:
|
||||
self.message("Adding Python package %s" % path, 2)
|
||||
else:
|
||||
self.message("Adding Python module %s" % path, 2)
|
||||
|
||||
abspath = pathjoin(self.bundlepath, path)
|
||||
makedirs(os.path.dirname(abspath))
|
||||
writePyc(code, abspath)
|
||||
|
||||
def stripBinaries(self):
|
||||
if not os.path.exists(STRIP_EXEC):
|
||||
self.message("Error: can't strip binaries: no strip program at "
|
||||
"%s" % STRIP_EXEC, 0)
|
||||
else:
|
||||
import stat
|
||||
self.message("Stripping binaries", 1)
|
||||
def walk(top):
|
||||
for name in os.listdir(top):
|
||||
path = pathjoin(top, name)
|
||||
if os.path.islink(path):
|
||||
continue
|
||||
if os.path.isdir(path):
|
||||
walk(path)
|
||||
else:
|
||||
mod = os.stat(path)[stat.ST_MODE]
|
||||
if not (mod & 0100):
|
||||
continue
|
||||
relpath = path[len(self.bundlepath):]
|
||||
self.message("Stripping %s" % relpath, 2)
|
||||
inf, outf = os.popen4("%s -S \"%s\"" %
|
||||
(STRIP_EXEC, path))
|
||||
output = outf.read().strip()
|
||||
if output:
|
||||
# usually not a real problem, like when we're
|
||||
# trying to strip a script
|
||||
self.message("Problem stripping %s:" % relpath, 3)
|
||||
self.message(output, 3)
|
||||
walk(self.bundlepath)
|
||||
|
||||
def findDependencies(self):
|
||||
self.message("Finding module dependencies", 1)
|
||||
import modulefinder
|
||||
mf = modulefinder.ModuleFinder(excludes=self.excludeModules)
|
||||
if self.use_zipimport:
|
||||
# zipimport imports zlib, must add it manually
|
||||
mf.import_hook("zlib")
|
||||
# manually add our own site.py
|
||||
site = mf.add_module("site")
|
||||
site.__code__ = self._getSiteCode()
|
||||
mf.scan_code(site.__code__, site)
|
||||
|
||||
# warnings.py gets imported implicitly from C
|
||||
mf.import_hook("warnings")
|
||||
|
||||
includeModules = self.includeModules[:]
|
||||
for name in self.includePackages:
|
||||
includeModules.extend(findPackageContents(name).keys())
|
||||
for name in includeModules:
|
||||
try:
|
||||
mf.import_hook(name)
|
||||
except ImportError:
|
||||
self.missingModules.append(name)
|
||||
|
||||
mf.run_script(self.mainprogram)
|
||||
modules = mf.modules.items()
|
||||
modules.sort()
|
||||
for name, mod in modules:
|
||||
path = mod.__file__
|
||||
if path and self.semi_standalone:
|
||||
# skip the standard library
|
||||
if path.startswith(LIB) and not path.startswith(SITE_PACKAGES):
|
||||
continue
|
||||
if path and mod.__code__ is None:
|
||||
# C extension
|
||||
filename = os.path.basename(path)
|
||||
pathitems = name.split(".")[:-1] + [filename]
|
||||
dstpath = pathjoin(*pathitems)
|
||||
if self.use_zipimport:
|
||||
if name != "zlib":
|
||||
# neatly pack all extension modules in a subdirectory,
|
||||
# except zlib, since it's necessary for bootstrapping.
|
||||
dstpath = pathjoin("ExtensionModules", dstpath)
|
||||
# Python modules are stored in a Zip archive, but put
|
||||
# extensions in Contents/Resources/. Add a tiny "loader"
|
||||
# program in the Zip archive. Due to Thomas Heller.
|
||||
source = EXT_LOADER % {"name": name, "filename": dstpath}
|
||||
code = compile(source, "<dynloader for %s>" % name, "exec")
|
||||
mod.__code__ = code
|
||||
self.files.append((path, pathjoin("Contents", "Resources", dstpath)))
|
||||
if mod.__code__ is not None:
|
||||
ispkg = mod.__path__ is not None
|
||||
if not self.use_zipimport or name != "site":
|
||||
# Our site.py is doing the bootstrapping, so we must
|
||||
# include a real .pyc file if self.use_zipimport is True.
|
||||
self.pymodules.append((name, mod.__code__, ispkg))
|
||||
|
||||
if hasattr(mf, "any_missing_maybe"):
|
||||
missing, maybe = mf.any_missing_maybe()
|
||||
else:
|
||||
missing = mf.any_missing()
|
||||
maybe = []
|
||||
self.missingModules.extend(missing)
|
||||
self.maybeMissingModules.extend(maybe)
|
||||
|
||||
def reportMissing(self):
|
||||
missing = [name for name in self.missingModules
|
||||
if name not in MAYMISS_MODULES]
|
||||
if self.maybeMissingModules:
|
||||
maybe = self.maybeMissingModules
|
||||
else:
|
||||
maybe = [name for name in missing if "." in name]
|
||||
missing = [name for name in missing if "." not in name]
|
||||
missing.sort()
|
||||
maybe.sort()
|
||||
if maybe:
|
||||
self.message("Warning: couldn't find the following submodules:", 1)
|
||||
self.message(" (Note that these could be false alarms -- "
|
||||
"it's not always", 1)
|
||||
self.message(" possible to distinguish between \"from package "
|
||||
"import submodule\" ", 1)
|
||||
self.message(" and \"from package import name\")", 1)
|
||||
for name in maybe:
|
||||
self.message(" ? " + name, 1)
|
||||
if missing:
|
||||
self.message("Warning: couldn't find the following modules:", 1)
|
||||
for name in missing:
|
||||
self.message(" ? " + name, 1)
|
||||
|
||||
def report(self):
|
||||
# XXX something decent
|
||||
import pprint
|
||||
pprint.pprint(self.__dict__)
|
||||
if self.standalone or self.semi_standalone:
|
||||
self.reportMissing()
|
||||
|
||||
#
|
||||
# Utilities.
|
||||
#
|
||||
|
||||
SUFFIXES = [_suf for _suf, _mode, _tp in imp.get_suffixes()]
|
||||
identifierRE = re.compile(r"[_a-zA-z][_a-zA-Z0-9]*$")
|
||||
|
||||
def findPackageContents(name, searchpath=None):
|
||||
head = name.split(".")[-1]
|
||||
if identifierRE.match(head) is None:
|
||||
return {}
|
||||
try:
|
||||
fp, path, (ext, mode, tp) = imp.find_module(head, searchpath)
|
||||
except ImportError:
|
||||
return {}
|
||||
modules = {name: None}
|
||||
if tp == imp.PKG_DIRECTORY and path:
|
||||
files = os.listdir(path)
|
||||
for sub in files:
|
||||
sub, ext = os.path.splitext(sub)
|
||||
fullname = name + "." + sub
|
||||
if sub != "__init__" and fullname not in modules:
|
||||
modules.update(findPackageContents(fullname, [path]))
|
||||
return modules
|
||||
|
||||
def writePyc(code, path):
|
||||
f = open(path, "wb")
|
||||
f.write(MAGIC)
|
||||
f.write("\0" * 4) # don't bother about a time stamp
|
||||
marshal.dump(code, f)
|
||||
f.close()
|
||||
|
||||
def copy(src, dst, mkdirs=0):
|
||||
"""Copy a file or a directory."""
|
||||
if mkdirs:
|
||||
makedirs(os.path.dirname(dst))
|
||||
if os.path.isdir(src):
|
||||
shutil.copytree(src, dst, symlinks=1)
|
||||
else:
|
||||
shutil.copy2(src, dst)
|
||||
|
||||
def copytodir(src, dstdir):
|
||||
"""Copy a file or a directory to an existing directory."""
|
||||
dst = pathjoin(dstdir, os.path.basename(src))
|
||||
copy(src, dst)
|
||||
|
||||
def makedirs(dir):
|
||||
"""Make all directories leading up to 'dir' including the leaf
|
||||
directory. Don't moan if any path element already exists."""
|
||||
try:
|
||||
os.makedirs(dir)
|
||||
except OSError, why:
|
||||
if why.errno != errno.EEXIST:
|
||||
raise
|
||||
|
||||
def symlink(src, dst, mkdirs=0):
|
||||
"""Copy a file or a directory."""
|
||||
if not os.path.exists(src):
|
||||
raise IOError, "No such file or directory: '%s'" % src
|
||||
if mkdirs:
|
||||
makedirs(os.path.dirname(dst))
|
||||
os.symlink(os.path.abspath(src), dst)
|
||||
|
||||
def pathjoin(*args):
|
||||
"""Safe wrapper for os.path.join: asserts that all but the first
|
||||
argument are relative paths."""
|
||||
for seg in args[1:]:
|
||||
assert seg[0] != "/"
|
||||
return os.path.join(*args)
|
||||
|
||||
|
||||
cmdline_doc = """\
|
||||
Usage:
|
||||
python bundlebuilder.py [options] command
|
||||
python mybuildscript.py [options] command
|
||||
|
||||
Commands:
|
||||
build build the application
|
||||
report print a report
|
||||
|
||||
Options:
|
||||
-b, --builddir=DIR the build directory; defaults to "build"
|
||||
-n, --name=NAME application name
|
||||
-r, --resource=FILE extra file or folder to be copied to Resources
|
||||
-f, --file=SRC:DST extra file or folder to be copied into the bundle;
|
||||
DST must be a path relative to the bundle root
|
||||
-e, --executable=FILE the executable to be used
|
||||
-m, --mainprogram=FILE the Python main program
|
||||
-a, --argv add a wrapper main program to create sys.argv
|
||||
-p, --plist=FILE .plist file (default: generate one)
|
||||
--nib=NAME main nib name
|
||||
-c, --creator=CCCC 4-char creator code (default: '????')
|
||||
--iconfile=FILE filename of the icon (an .icns file) to be used
|
||||
as the Finder icon
|
||||
--bundle-id=ID the CFBundleIdentifier, in reverse-dns format
|
||||
(eg. org.python.BuildApplet; this is used for
|
||||
the preferences file name)
|
||||
-l, --link symlink files/folder instead of copying them
|
||||
--link-exec symlink the executable instead of copying it
|
||||
--standalone build a standalone application, which is fully
|
||||
independent of a Python installation
|
||||
--semi-standalone build a standalone application, which depends on
|
||||
an installed Python, yet includes all third-party
|
||||
modules.
|
||||
--no-zipimport Do not copy code into a zip file
|
||||
--python=FILE Python to use in #! line in stead of current Python
|
||||
--lib=FILE shared library or framework to be copied into
|
||||
the bundle
|
||||
-x, --exclude=MODULE exclude module (with --(semi-)standalone)
|
||||
-i, --include=MODULE include module (with --(semi-)standalone)
|
||||
--package=PACKAGE include a whole package (with --(semi-)standalone)
|
||||
--strip strip binaries (remove debug info)
|
||||
-v, --verbose increase verbosity level
|
||||
-q, --quiet decrease verbosity level
|
||||
-h, --help print this message
|
||||
"""
|
||||
|
||||
def usage(msg=None):
|
||||
if msg:
|
||||
print msg
|
||||
print cmdline_doc
|
||||
sys.exit(1)
|
||||
|
||||
def main(builder=None):
|
||||
if builder is None:
|
||||
builder = AppBuilder(verbosity=1)
|
||||
|
||||
shortopts = "b:n:r:f:e:m:c:p:lx:i:hvqa"
|
||||
longopts = ("builddir=", "name=", "resource=", "file=", "executable=",
|
||||
"mainprogram=", "creator=", "nib=", "plist=", "link",
|
||||
"link-exec", "help", "verbose", "quiet", "argv", "standalone",
|
||||
"exclude=", "include=", "package=", "strip", "iconfile=",
|
||||
"lib=", "python=", "semi-standalone", "bundle-id=", "destroot="
|
||||
"no-zipimport"
|
||||
)
|
||||
|
||||
try:
|
||||
options, args = getopt.getopt(sys.argv[1:], shortopts, longopts)
|
||||
except getopt.error:
|
||||
usage()
|
||||
|
||||
for opt, arg in options:
|
||||
if opt in ('-b', '--builddir'):
|
||||
builder.builddir = arg
|
||||
elif opt in ('-n', '--name'):
|
||||
builder.name = arg
|
||||
elif opt in ('-r', '--resource'):
|
||||
builder.resources.append(os.path.normpath(arg))
|
||||
elif opt in ('-f', '--file'):
|
||||
srcdst = arg.split(':')
|
||||
if len(srcdst) != 2:
|
||||
usage("-f or --file argument must be two paths, "
|
||||
"separated by a colon")
|
||||
builder.files.append(srcdst)
|
||||
elif opt in ('-e', '--executable'):
|
||||
builder.executable = arg
|
||||
elif opt in ('-m', '--mainprogram'):
|
||||
builder.mainprogram = arg
|
||||
elif opt in ('-a', '--argv'):
|
||||
builder.argv_emulation = 1
|
||||
elif opt in ('-c', '--creator'):
|
||||
builder.creator = arg
|
||||
elif opt == '--bundle-id':
|
||||
builder.bundle_id = arg
|
||||
elif opt == '--iconfile':
|
||||
builder.iconfile = arg
|
||||
elif opt == "--lib":
|
||||
builder.libs.append(os.path.normpath(arg))
|
||||
elif opt == "--nib":
|
||||
builder.nibname = arg
|
||||
elif opt in ('-p', '--plist'):
|
||||
builder.plist = Plist.fromFile(arg)
|
||||
elif opt in ('-l', '--link'):
|
||||
builder.symlink = 1
|
||||
elif opt == '--link-exec':
|
||||
builder.symlink_exec = 1
|
||||
elif opt in ('-h', '--help'):
|
||||
usage()
|
||||
elif opt in ('-v', '--verbose'):
|
||||
builder.verbosity += 1
|
||||
elif opt in ('-q', '--quiet'):
|
||||
builder.verbosity -= 1
|
||||
elif opt == '--standalone':
|
||||
builder.standalone = 1
|
||||
elif opt == '--semi-standalone':
|
||||
builder.semi_standalone = 1
|
||||
elif opt == '--python':
|
||||
builder.python = arg
|
||||
elif opt in ('-x', '--exclude'):
|
||||
builder.excludeModules.append(arg)
|
||||
elif opt in ('-i', '--include'):
|
||||
builder.includeModules.append(arg)
|
||||
elif opt == '--package':
|
||||
builder.includePackages.append(arg)
|
||||
elif opt == '--strip':
|
||||
builder.strip = 1
|
||||
elif opt == '--destroot':
|
||||
builder.destroot = arg
|
||||
elif opt == '--no-zipimport':
|
||||
builder.use_zipimport = False
|
||||
|
||||
if len(args) != 1:
|
||||
usage("Must specify one command ('build', 'report' or 'help')")
|
||||
command = args[0]
|
||||
|
||||
if command == "build":
|
||||
builder.setup()
|
||||
builder.build()
|
||||
elif command == "report":
|
||||
builder.setup()
|
||||
builder.report()
|
||||
elif command == "help":
|
||||
usage()
|
||||
else:
|
||||
usage("Unknown command '%s'" % command)
|
||||
|
||||
|
||||
def buildapp(**kwargs):
|
||||
builder = AppBuilder(**kwargs)
|
||||
main(builder)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
187
Darwin/lib/python2.7/plat-mac/cfmfile.py
Normal file
187
Darwin/lib/python2.7/plat-mac/cfmfile.py
Normal file
|
|
@ -0,0 +1,187 @@
|
|||
"""codefragments.py -- wrapper to modify code fragments."""
|
||||
|
||||
# (c) 1998, Just van Rossum, Letterror
|
||||
|
||||
__version__ = "0.8b3"
|
||||
__author__ = "jvr"
|
||||
|
||||
import warnings
|
||||
warnings.warnpy3k("the cfmfile module is deprecated and is removed in 3,0",
|
||||
stacklevel=2)
|
||||
|
||||
import Carbon.File
|
||||
import struct
|
||||
from Carbon import Res
|
||||
import os
|
||||
import sys
|
||||
|
||||
DEBUG = 0
|
||||
|
||||
error = "cfm.error"
|
||||
|
||||
BUFSIZE = 0x80000
|
||||
|
||||
def mergecfmfiles(srclist, dst, architecture = 'fat'):
|
||||
"""Merge all files in srclist into a new file dst.
|
||||
|
||||
If architecture is given, only code fragments of that type will be used:
|
||||
"pwpc" for PPC, "m68k" for cfm68k. This does not work for "classic"
|
||||
68k code, since it does not use code fragments to begin with.
|
||||
If architecture is None, all fragments will be used, enabling FAT binaries.
|
||||
"""
|
||||
|
||||
srclist = list(srclist)
|
||||
for i in range(len(srclist)):
|
||||
srclist[i] = Carbon.File.pathname(srclist[i])
|
||||
dst = Carbon.File.pathname(dst)
|
||||
|
||||
dstfile = open(dst, "wb")
|
||||
rf = Res.FSpOpenResFile(dst, 3)
|
||||
try:
|
||||
dstcfrg = CfrgResource()
|
||||
for src in srclist:
|
||||
srccfrg = CfrgResource(src)
|
||||
for frag in srccfrg.fragments:
|
||||
if frag.architecture == 'pwpc' and architecture == 'm68k':
|
||||
continue
|
||||
if frag.architecture == 'm68k' and architecture == 'pwpc':
|
||||
continue
|
||||
dstcfrg.append(frag)
|
||||
|
||||
frag.copydata(dstfile)
|
||||
|
||||
cfrgres = Res.Resource(dstcfrg.build())
|
||||
Res.UseResFile(rf)
|
||||
cfrgres.AddResource('cfrg', 0, "")
|
||||
finally:
|
||||
dstfile.close()
|
||||
rf = Res.CloseResFile(rf)
|
||||
|
||||
|
||||
class CfrgResource:
|
||||
|
||||
def __init__(self, path = None):
|
||||
self.version = 1
|
||||
self.fragments = []
|
||||
self.path = path
|
||||
if path is not None and os.path.exists(path):
|
||||
currentresref = Res.CurResFile()
|
||||
resref = Res.FSpOpenResFile(path, 1)
|
||||
Res.UseResFile(resref)
|
||||
try:
|
||||
try:
|
||||
data = Res.Get1Resource('cfrg', 0).data
|
||||
except Res.Error:
|
||||
raise Res.Error, "no 'cfrg' resource found", sys.exc_traceback
|
||||
finally:
|
||||
Res.CloseResFile(resref)
|
||||
Res.UseResFile(currentresref)
|
||||
self.parse(data)
|
||||
if self.version != 1:
|
||||
raise error, "unknown 'cfrg' resource format"
|
||||
|
||||
def parse(self, data):
|
||||
(res1, res2, self.version,
|
||||
res3, res4, res5, res6,
|
||||
self.memberCount) = struct.unpack("8l", data[:32])
|
||||
data = data[32:]
|
||||
while data:
|
||||
frag = FragmentDescriptor(self.path, data)
|
||||
data = data[frag.memberSize:]
|
||||
self.fragments.append(frag)
|
||||
|
||||
def build(self):
|
||||
self.memberCount = len(self.fragments)
|
||||
data = struct.pack("8l", 0, 0, self.version, 0, 0, 0, 0, self.memberCount)
|
||||
for frag in self.fragments:
|
||||
data = data + frag.build()
|
||||
return data
|
||||
|
||||
def append(self, frag):
|
||||
self.fragments.append(frag)
|
||||
|
||||
|
||||
class FragmentDescriptor:
|
||||
|
||||
def __init__(self, path, data = None):
|
||||
self.path = path
|
||||
if data is not None:
|
||||
self.parse(data)
|
||||
|
||||
def parse(self, data):
|
||||
self.architecture = data[:4]
|
||||
( self.updatelevel,
|
||||
self.currentVersion,
|
||||
self.oldDefVersion,
|
||||
self.stacksize,
|
||||
self.applibdir,
|
||||
self.fragtype,
|
||||
self.where,
|
||||
self.offset,
|
||||
self.length,
|
||||
self.res1, self.res2,
|
||||
self.memberSize,) = struct.unpack("4lhBB4lh", data[4:42])
|
||||
pname = data[42:self.memberSize]
|
||||
self.name = pname[1:1+ord(pname[0])]
|
||||
|
||||
def build(self):
|
||||
data = self.architecture
|
||||
data = data + struct.pack("4lhBB4l",
|
||||
self.updatelevel,
|
||||
self.currentVersion,
|
||||
self.oldDefVersion,
|
||||
self.stacksize,
|
||||
self.applibdir,
|
||||
self.fragtype,
|
||||
self.where,
|
||||
self.offset,
|
||||
self.length,
|
||||
self.res1, self.res2)
|
||||
self.memberSize = len(data) + 2 + 1 + len(self.name)
|
||||
# pad to 4 byte boundaries
|
||||
if self.memberSize % 4:
|
||||
self.memberSize = self.memberSize + 4 - (self.memberSize % 4)
|
||||
data = data + struct.pack("hb", self.memberSize, len(self.name))
|
||||
data = data + self.name
|
||||
data = data + '\000' * (self.memberSize - len(data))
|
||||
return data
|
||||
|
||||
def getfragment(self):
|
||||
if self.where != 1:
|
||||
raise error, "can't read fragment, unsupported location"
|
||||
f = open(self.path, "rb")
|
||||
f.seek(self.offset)
|
||||
if self.length:
|
||||
frag = f.read(self.length)
|
||||
else:
|
||||
frag = f.read()
|
||||
f.close()
|
||||
return frag
|
||||
|
||||
def copydata(self, outfile):
|
||||
if self.where != 1:
|
||||
raise error, "can't read fragment, unsupported location"
|
||||
infile = open(self.path, "rb")
|
||||
if self.length == 0:
|
||||
infile.seek(0, 2)
|
||||
self.length = infile.tell()
|
||||
|
||||
# Position input file and record new offset from output file
|
||||
infile.seek(self.offset)
|
||||
|
||||
# pad to 16 byte boundaries
|
||||
offset = outfile.tell()
|
||||
if offset % 16:
|
||||
offset = offset + 16 - (offset % 16)
|
||||
outfile.seek(offset)
|
||||
self.offset = offset
|
||||
|
||||
l = self.length
|
||||
while l:
|
||||
if l > BUFSIZE:
|
||||
outfile.write(infile.read(BUFSIZE))
|
||||
l = l - BUFSIZE
|
||||
else:
|
||||
outfile.write(infile.read(l))
|
||||
l = 0
|
||||
infile.close()
|
||||
BIN
Darwin/lib/python2.7/plat-mac/dialogs.rsrc
Normal file
BIN
Darwin/lib/python2.7/plat-mac/dialogs.rsrc
Normal file
Binary file not shown.
BIN
Darwin/lib/python2.7/plat-mac/errors.rsrc
Normal file
BIN
Darwin/lib/python2.7/plat-mac/errors.rsrc
Normal file
Binary file not shown.
835
Darwin/lib/python2.7/plat-mac/findertools.py
Normal file
835
Darwin/lib/python2.7/plat-mac/findertools.py
Normal file
|
|
@ -0,0 +1,835 @@
|
|||
"""Utility routines depending on the finder,
|
||||
a combination of code by Jack Jansen and erik@letterror.com.
|
||||
|
||||
Most events have been captured from
|
||||
Lasso Capture AE and than translated to python code.
|
||||
|
||||
IMPORTANT
|
||||
Note that the processes() function returns different values
|
||||
depending on the OS version it is running on. On MacOS 9
|
||||
the Finder returns the process *names* which can then be
|
||||
used to find out more about them. On MacOS 8.6 and earlier
|
||||
the Finder returns a code which does not seem to work.
|
||||
So bottom line: the processes() stuff does not work on < MacOS9
|
||||
|
||||
Mostly written by erik@letterror.com
|
||||
"""
|
||||
|
||||
from warnings import warnpy3k
|
||||
warnpy3k("In 3.x, the findertools module is removed.", stacklevel=2)
|
||||
|
||||
import Finder
|
||||
from Carbon import AppleEvents
|
||||
import aetools
|
||||
import MacOS
|
||||
import sys
|
||||
import Carbon.File
|
||||
import Carbon.Folder
|
||||
import aetypes
|
||||
from types import *
|
||||
|
||||
__version__ = '1.1'
|
||||
Error = 'findertools.Error'
|
||||
|
||||
_finder_talker = None
|
||||
|
||||
def _getfinder():
|
||||
"""returns basic (recyclable) Finder AE interface object"""
|
||||
global _finder_talker
|
||||
if not _finder_talker:
|
||||
_finder_talker = Finder.Finder()
|
||||
_finder_talker.send_flags = ( _finder_talker.send_flags |
|
||||
AppleEvents.kAECanInteract | AppleEvents.kAECanSwitchLayer)
|
||||
return _finder_talker
|
||||
|
||||
def launch(file):
|
||||
"""Open a file thru the finder. Specify file by name or fsspec"""
|
||||
finder = _getfinder()
|
||||
fss = Carbon.File.FSSpec(file)
|
||||
return finder.open(fss)
|
||||
|
||||
def Print(file):
|
||||
"""Print a file thru the finder. Specify file by name or fsspec"""
|
||||
finder = _getfinder()
|
||||
fss = Carbon.File.FSSpec(file)
|
||||
return finder._print(fss)
|
||||
|
||||
def copy(src, dstdir):
|
||||
"""Copy a file to a folder"""
|
||||
finder = _getfinder()
|
||||
if type(src) == type([]):
|
||||
src_fss = []
|
||||
for s in src:
|
||||
src_fss.append(Carbon.File.FSSpec(s))
|
||||
else:
|
||||
src_fss = Carbon.File.FSSpec(src)
|
||||
dst_fss = Carbon.File.FSSpec(dstdir)
|
||||
return finder.duplicate(src_fss, to=dst_fss)
|
||||
|
||||
def move(src, dstdir):
|
||||
"""Move a file to a folder"""
|
||||
finder = _getfinder()
|
||||
if type(src) == type([]):
|
||||
src_fss = []
|
||||
for s in src:
|
||||
src_fss.append(Carbon.File.FSSpec(s))
|
||||
else:
|
||||
src_fss = Carbon.File.FSSpec(src)
|
||||
dst_fss = Carbon.File.FSSpec(dstdir)
|
||||
return finder.move(src_fss, to=dst_fss)
|
||||
|
||||
def sleep():
|
||||
"""Put the mac to sleep"""
|
||||
finder = _getfinder()
|
||||
finder.sleep()
|
||||
|
||||
def shutdown():
|
||||
"""Shut the mac down"""
|
||||
finder = _getfinder()
|
||||
finder.shut_down()
|
||||
|
||||
def restart():
|
||||
"""Restart the mac"""
|
||||
finder = _getfinder()
|
||||
finder.restart()
|
||||
|
||||
|
||||
#---------------------------------------------------
|
||||
# Additional findertools
|
||||
#
|
||||
|
||||
def reveal(file):
|
||||
"""Reveal a file in the finder. Specify file by name, fsref or fsspec."""
|
||||
finder = _getfinder()
|
||||
fsr = Carbon.File.FSRef(file)
|
||||
file_alias = fsr.FSNewAliasMinimal()
|
||||
return finder.reveal(file_alias)
|
||||
|
||||
def select(file):
|
||||
"""select a file in the finder. Specify file by name, fsref or fsspec."""
|
||||
finder = _getfinder()
|
||||
fsr = Carbon.File.FSRef(file)
|
||||
file_alias = fsr.FSNewAliasMinimal()
|
||||
return finder.select(file_alias)
|
||||
|
||||
def update(file):
|
||||
"""Update the display of the specified object(s) to match
|
||||
their on-disk representation. Specify file by name, fsref or fsspec."""
|
||||
finder = _getfinder()
|
||||
fsr = Carbon.File.FSRef(file)
|
||||
file_alias = fsr.FSNewAliasMinimal()
|
||||
return finder.update(file_alias)
|
||||
|
||||
|
||||
#---------------------------------------------------
|
||||
# More findertools
|
||||
#
|
||||
|
||||
def comment(object, comment=None):
|
||||
"""comment: get or set the Finder-comment of the item, displayed in the 'Get Info' window."""
|
||||
object = Carbon.File.FSRef(object)
|
||||
object_alias = object.FSNewAliasMinimal()
|
||||
if comment is None:
|
||||
return _getcomment(object_alias)
|
||||
else:
|
||||
return _setcomment(object_alias, comment)
|
||||
|
||||
def _setcomment(object_alias, comment):
|
||||
finder = _getfinder()
|
||||
args = {}
|
||||
attrs = {}
|
||||
aeobj_00 = aetypes.ObjectSpecifier(want=aetypes.Type('cobj'), form="alis", seld=object_alias, fr=None)
|
||||
aeobj_01 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), form="prop", seld=aetypes.Type('comt'), fr=aeobj_00)
|
||||
args['----'] = aeobj_01
|
||||
args["data"] = comment
|
||||
_reply, args, attrs = finder.send("core", "setd", args, attrs)
|
||||
if 'errn' in args:
|
||||
raise Error, aetools.decodeerror(args)
|
||||
if '----' in args:
|
||||
return args['----']
|
||||
|
||||
def _getcomment(object_alias):
|
||||
finder = _getfinder()
|
||||
args = {}
|
||||
attrs = {}
|
||||
aeobj_00 = aetypes.ObjectSpecifier(want=aetypes.Type('cobj'), form="alis", seld=object_alias, fr=None)
|
||||
aeobj_01 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), form="prop", seld=aetypes.Type('comt'), fr=aeobj_00)
|
||||
args['----'] = aeobj_01
|
||||
_reply, args, attrs = finder.send("core", "getd", args, attrs)
|
||||
if 'errn' in args:
|
||||
raise Error, aetools.decodeerror(args)
|
||||
if '----' in args:
|
||||
return args['----']
|
||||
|
||||
|
||||
#---------------------------------------------------
|
||||
# Get information about current processes in the Finder.
|
||||
|
||||
def processes():
|
||||
"""processes returns a list of all active processes running on this computer and their creators."""
|
||||
finder = _getfinder()
|
||||
args = {}
|
||||
attrs = {}
|
||||
processnames = []
|
||||
processnumbers = []
|
||||
creators = []
|
||||
partitions = []
|
||||
used = []
|
||||
## get the processnames or else the processnumbers
|
||||
args['----'] = aetypes.ObjectSpecifier(want=aetypes.Type('prcs'), form="indx", seld=aetypes.Unknown('abso', "all "), fr=None)
|
||||
_reply, args, attrs = finder.send('core', 'getd', args, attrs)
|
||||
if 'errn' in args:
|
||||
raise Error, aetools.decodeerror(args)
|
||||
p = []
|
||||
if '----' in args:
|
||||
p = args['----']
|
||||
for proc in p:
|
||||
if hasattr(proc, 'seld'):
|
||||
# it has a real name
|
||||
processnames.append(proc.seld)
|
||||
elif hasattr(proc, 'type'):
|
||||
if proc.type == "psn ":
|
||||
# it has a process number
|
||||
processnumbers.append(proc.data)
|
||||
## get the creators
|
||||
args = {}
|
||||
attrs = {}
|
||||
aeobj_0 = aetypes.ObjectSpecifier(want=aetypes.Type('prcs'), form="indx", seld=aetypes.Unknown('abso', "all "), fr=None)
|
||||
args['----'] = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), form="prop", seld=aetypes.Type('fcrt'), fr=aeobj_0)
|
||||
_reply, args, attrs = finder.send('core', 'getd', args, attrs)
|
||||
if 'errn' in args:
|
||||
raise Error, aetools.decodeerror(_arg)
|
||||
if '----' in args:
|
||||
p = args['----']
|
||||
creators = p[:]
|
||||
## concatenate in one dict
|
||||
result = []
|
||||
if len(processnames) > len(processnumbers):
|
||||
data = processnames
|
||||
else:
|
||||
data = processnumbers
|
||||
for i in range(len(creators)):
|
||||
result.append((data[i], creators[i]))
|
||||
return result
|
||||
|
||||
class _process:
|
||||
pass
|
||||
|
||||
def isactiveprocess(processname):
|
||||
"""Check of processname is active. MacOS9"""
|
||||
all = processes()
|
||||
ok = 0
|
||||
for n, c in all:
|
||||
if n == processname:
|
||||
return 1
|
||||
return 0
|
||||
|
||||
def processinfo(processname):
|
||||
"""Return an object with all process properties as attributes for processname. MacOS9"""
|
||||
p = _process()
|
||||
|
||||
if processname == "Finder":
|
||||
p.partition = None
|
||||
p.used = None
|
||||
else:
|
||||
p.partition = _processproperty(processname, 'appt')
|
||||
p.used = _processproperty(processname, 'pusd')
|
||||
p.visible = _processproperty(processname, 'pvis') #Is the process' layer visible?
|
||||
p.frontmost = _processproperty(processname, 'pisf') #Is the process the frontmost process?
|
||||
p.file = _processproperty(processname, 'file') #the file from which the process was launched
|
||||
p.filetype = _processproperty(processname, 'asty') #the OSType of the file type of the process
|
||||
p.creatortype = _processproperty(processname, 'fcrt') #the OSType of the creator of the process (the signature)
|
||||
p.accepthighlevel = _processproperty(processname, 'revt') #Is the process high-level event aware (accepts open application, open document, print document, and quit)?
|
||||
p.hasscripting = _processproperty(processname, 'hscr') #Does the process have a scripting terminology, i.e., can it be scripted?
|
||||
return p
|
||||
|
||||
def _processproperty(processname, property):
|
||||
"""return the partition size and memory used for processname"""
|
||||
finder = _getfinder()
|
||||
args = {}
|
||||
attrs = {}
|
||||
aeobj_00 = aetypes.ObjectSpecifier(want=aetypes.Type('prcs'), form="name", seld=processname, fr=None)
|
||||
aeobj_01 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), form="prop", seld=aetypes.Type(property), fr=aeobj_00)
|
||||
args['----'] = aeobj_01
|
||||
_reply, args, attrs = finder.send("core", "getd", args, attrs)
|
||||
if 'errn' in args:
|
||||
raise Error, aetools.decodeerror(args)
|
||||
if '----' in args:
|
||||
return args['----']
|
||||
|
||||
|
||||
#---------------------------------------------------
|
||||
# Mess around with Finder windows.
|
||||
|
||||
def openwindow(object):
|
||||
"""Open a Finder window for object, Specify object by name or fsspec."""
|
||||
finder = _getfinder()
|
||||
object = Carbon.File.FSRef(object)
|
||||
object_alias = object.FSNewAliasMinimal()
|
||||
args = {}
|
||||
attrs = {}
|
||||
_code = 'aevt'
|
||||
_subcode = 'odoc'
|
||||
aeobj_0 = aetypes.ObjectSpecifier(want=aetypes.Type('cfol'), form="alis", seld=object_alias, fr=None)
|
||||
args['----'] = aeobj_0
|
||||
_reply, args, attrs = finder.send(_code, _subcode, args, attrs)
|
||||
if 'errn' in args:
|
||||
raise Error, aetools.decodeerror(args)
|
||||
|
||||
def closewindow(object):
|
||||
"""Close a Finder window for folder, Specify by path."""
|
||||
finder = _getfinder()
|
||||
object = Carbon.File.FSRef(object)
|
||||
object_alias = object.FSNewAliasMinimal()
|
||||
args = {}
|
||||
attrs = {}
|
||||
_code = 'core'
|
||||
_subcode = 'clos'
|
||||
aeobj_0 = aetypes.ObjectSpecifier(want=aetypes.Type('cfol'), form="alis", seld=object_alias, fr=None)
|
||||
args['----'] = aeobj_0
|
||||
_reply, args, attrs = finder.send(_code, _subcode, args, attrs)
|
||||
if 'errn' in args:
|
||||
raise Error, aetools.decodeerror(args)
|
||||
|
||||
def location(object, pos=None):
|
||||
"""Set the position of a Finder window for folder to pos=(w, h). Specify file by name or fsspec.
|
||||
If pos=None, location will return the current position of the object."""
|
||||
object = Carbon.File.FSRef(object)
|
||||
object_alias = object.FSNewAliasMinimal()
|
||||
if not pos:
|
||||
return _getlocation(object_alias)
|
||||
return _setlocation(object_alias, pos)
|
||||
|
||||
def _setlocation(object_alias, (x, y)):
|
||||
"""_setlocation: Set the location of the icon for the object."""
|
||||
finder = _getfinder()
|
||||
args = {}
|
||||
attrs = {}
|
||||
aeobj_00 = aetypes.ObjectSpecifier(want=aetypes.Type('cfol'), form="alis", seld=object_alias, fr=None)
|
||||
aeobj_01 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), form="prop", seld=aetypes.Type('posn'), fr=aeobj_00)
|
||||
args['----'] = aeobj_01
|
||||
args["data"] = [x, y]
|
||||
_reply, args, attrs = finder.send("core", "setd", args, attrs)
|
||||
if 'errn' in args:
|
||||
raise Error, aetools.decodeerror(args)
|
||||
return (x,y)
|
||||
|
||||
def _getlocation(object_alias):
|
||||
"""_getlocation: get the location of the icon for the object."""
|
||||
finder = _getfinder()
|
||||
args = {}
|
||||
attrs = {}
|
||||
aeobj_00 = aetypes.ObjectSpecifier(want=aetypes.Type('cfol'), form="alis", seld=object_alias, fr=None)
|
||||
aeobj_01 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), form="prop", seld=aetypes.Type('posn'), fr=aeobj_00)
|
||||
args['----'] = aeobj_01
|
||||
_reply, args, attrs = finder.send("core", "getd", args, attrs)
|
||||
if 'errn' in args:
|
||||
raise Error, aetools.decodeerror(args)
|
||||
if '----' in args:
|
||||
pos = args['----']
|
||||
return pos.h, pos.v
|
||||
|
||||
def label(object, index=None):
|
||||
"""label: set or get the label of the item. Specify file by name or fsspec."""
|
||||
object = Carbon.File.FSRef(object)
|
||||
object_alias = object.FSNewAliasMinimal()
|
||||
if index is None:
|
||||
return _getlabel(object_alias)
|
||||
if index < 0 or index > 7:
|
||||
index = 0
|
||||
return _setlabel(object_alias, index)
|
||||
|
||||
def _getlabel(object_alias):
|
||||
"""label: Get the label for the object."""
|
||||
finder = _getfinder()
|
||||
args = {}
|
||||
attrs = {}
|
||||
aeobj_00 = aetypes.ObjectSpecifier(want=aetypes.Type('cobj'), form="alis", seld=object_alias, fr=None)
|
||||
aeobj_01 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), form="prop", seld=aetypes.Type('labi'), fr=aeobj_00)
|
||||
args['----'] = aeobj_01
|
||||
_reply, args, attrs = finder.send("core", "getd", args, attrs)
|
||||
if 'errn' in args:
|
||||
raise Error, aetools.decodeerror(args)
|
||||
if '----' in args:
|
||||
return args['----']
|
||||
|
||||
def _setlabel(object_alias, index):
|
||||
"""label: Set the label for the object."""
|
||||
finder = _getfinder()
|
||||
args = {}
|
||||
attrs = {}
|
||||
_code = 'core'
|
||||
_subcode = 'setd'
|
||||
aeobj_0 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'),
|
||||
form="alis", seld=object_alias, fr=None)
|
||||
aeobj_1 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'),
|
||||
form="prop", seld=aetypes.Type('labi'), fr=aeobj_0)
|
||||
args['----'] = aeobj_1
|
||||
args["data"] = index
|
||||
_reply, args, attrs = finder.send(_code, _subcode, args, attrs)
|
||||
if 'errn' in args:
|
||||
raise Error, aetools.decodeerror(args)
|
||||
return index
|
||||
|
||||
def windowview(folder, view=None):
|
||||
"""windowview: Set the view of the window for the folder. Specify file by name or fsspec.
|
||||
0 = by icon (default)
|
||||
1 = by name
|
||||
2 = by button
|
||||
"""
|
||||
fsr = Carbon.File.FSRef(folder)
|
||||
folder_alias = fsr.FSNewAliasMinimal()
|
||||
if view is None:
|
||||
return _getwindowview(folder_alias)
|
||||
return _setwindowview(folder_alias, view)
|
||||
|
||||
def _setwindowview(folder_alias, view=0):
|
||||
"""set the windowview"""
|
||||
attrs = {}
|
||||
args = {}
|
||||
if view == 1:
|
||||
_v = aetypes.Type('pnam')
|
||||
elif view == 2:
|
||||
_v = aetypes.Type('lgbu')
|
||||
else:
|
||||
_v = aetypes.Type('iimg')
|
||||
finder = _getfinder()
|
||||
aeobj_0 = aetypes.ObjectSpecifier(want = aetypes.Type('cfol'),
|
||||
form = 'alis', seld = folder_alias, fr=None)
|
||||
aeobj_1 = aetypes.ObjectSpecifier(want = aetypes.Type('prop'),
|
||||
form = 'prop', seld = aetypes.Type('cwnd'), fr=aeobj_0)
|
||||
aeobj_2 = aetypes.ObjectSpecifier(want = aetypes.Type('prop'),
|
||||
form = 'prop', seld = aetypes.Type('pvew'), fr=aeobj_1)
|
||||
aeobj_3 = aetypes.ObjectSpecifier(want = aetypes.Type('prop'),
|
||||
form = 'prop', seld = _v, fr=None)
|
||||
_code = 'core'
|
||||
_subcode = 'setd'
|
||||
args['----'] = aeobj_2
|
||||
args['data'] = aeobj_3
|
||||
_reply, args, attrs = finder.send(_code, _subcode, args, attrs)
|
||||
if 'errn' in args:
|
||||
raise Error, aetools.decodeerror(args)
|
||||
if '----' in args:
|
||||
return args['----']
|
||||
|
||||
def _getwindowview(folder_alias):
|
||||
"""get the windowview"""
|
||||
attrs = {}
|
||||
args = {}
|
||||
finder = _getfinder()
|
||||
args = {}
|
||||
attrs = {}
|
||||
aeobj_00 = aetypes.ObjectSpecifier(want=aetypes.Type('cfol'), form="alis", seld=folder_alias, fr=None)
|
||||
aeobj_01 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), form="prop", seld=aetypes.Type('cwnd'), fr=aeobj_00)
|
||||
aeobj_02 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), form="prop", seld=aetypes.Type('pvew'), fr=aeobj_01)
|
||||
args['----'] = aeobj_02
|
||||
_reply, args, attrs = finder.send("core", "getd", args, attrs)
|
||||
if 'errn' in args:
|
||||
raise Error, aetools.decodeerror(args)
|
||||
views = {'iimg':0, 'pnam':1, 'lgbu':2}
|
||||
if '----' in args:
|
||||
return views[args['----'].enum]
|
||||
|
||||
def windowsize(folder, size=None):
|
||||
"""Set the size of a Finder window for folder to size=(w, h), Specify by path.
|
||||
If size=None, windowsize will return the current size of the window.
|
||||
Specify file by name or fsspec.
|
||||
"""
|
||||
fsr = Carbon.File.FSRef(folder)
|
||||
folder_alias = fsr.FSNewAliasMinimal()
|
||||
openwindow(fsr)
|
||||
if not size:
|
||||
return _getwindowsize(folder_alias)
|
||||
return _setwindowsize(folder_alias, size)
|
||||
|
||||
def _setwindowsize(folder_alias, (w, h)):
|
||||
"""Set the size of a Finder window for folder to (w, h)"""
|
||||
finder = _getfinder()
|
||||
args = {}
|
||||
attrs = {}
|
||||
_code = 'core'
|
||||
_subcode = 'setd'
|
||||
aevar00 = [w, h]
|
||||
aeobj_0 = aetypes.ObjectSpecifier(want=aetypes.Type('cfol'),
|
||||
form="alis", seld=folder_alias, fr=None)
|
||||
aeobj_1 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'),
|
||||
form="prop", seld=aetypes.Type('cwnd'), fr=aeobj_0)
|
||||
aeobj_2 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'),
|
||||
form="prop", seld=aetypes.Type('ptsz'), fr=aeobj_1)
|
||||
args['----'] = aeobj_2
|
||||
args["data"] = aevar00
|
||||
_reply, args, attrs = finder.send(_code, _subcode, args, attrs)
|
||||
if 'errn' in args:
|
||||
raise Error, aetools.decodeerror(args)
|
||||
return (w, h)
|
||||
|
||||
def _getwindowsize(folder_alias):
|
||||
"""Set the size of a Finder window for folder to (w, h)"""
|
||||
finder = _getfinder()
|
||||
args = {}
|
||||
attrs = {}
|
||||
aeobj_0 = aetypes.ObjectSpecifier(want=aetypes.Type('cfol'),
|
||||
form="alis", seld=folder_alias, fr=None)
|
||||
aeobj_1 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'),
|
||||
form="prop", seld=aetypes.Type('cwnd'), fr=aeobj_0)
|
||||
aeobj_2 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'),
|
||||
form="prop", seld=aetypes.Type('posn'), fr=aeobj_1)
|
||||
args['----'] = aeobj_2
|
||||
_reply, args, attrs = finder.send('core', 'getd', args, attrs)
|
||||
if 'errn' in args:
|
||||
raise Error, aetools.decodeerror(args)
|
||||
if '----' in args:
|
||||
return args['----']
|
||||
|
||||
def windowposition(folder, pos=None):
|
||||
"""Set the position of a Finder window for folder to pos=(w, h)."""
|
||||
fsr = Carbon.File.FSRef(folder)
|
||||
folder_alias = fsr.FSNewAliasMinimal()
|
||||
openwindow(fsr)
|
||||
if not pos:
|
||||
return _getwindowposition(folder_alias)
|
||||
if type(pos) == InstanceType:
|
||||
# pos might be a QDPoint object as returned by _getwindowposition
|
||||
pos = (pos.h, pos.v)
|
||||
return _setwindowposition(folder_alias, pos)
|
||||
|
||||
def _setwindowposition(folder_alias, (x, y)):
|
||||
"""Set the size of a Finder window for folder to (w, h)."""
|
||||
finder = _getfinder()
|
||||
args = {}
|
||||
attrs = {}
|
||||
aeobj_0 = aetypes.ObjectSpecifier(want=aetypes.Type('cfol'),
|
||||
form="alis", seld=folder_alias, fr=None)
|
||||
aeobj_1 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'),
|
||||
form="prop", seld=aetypes.Type('cwnd'), fr=aeobj_0)
|
||||
aeobj_2 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'),
|
||||
form="prop", seld=aetypes.Type('posn'), fr=aeobj_1)
|
||||
args['----'] = aeobj_2
|
||||
args["data"] = [x, y]
|
||||
_reply, args, attrs = finder.send('core', 'setd', args, attrs)
|
||||
if 'errn' in args:
|
||||
raise Error, aetools.decodeerror(args)
|
||||
if '----' in args:
|
||||
return args['----']
|
||||
|
||||
def _getwindowposition(folder_alias):
|
||||
"""Get the size of a Finder window for folder, Specify by path."""
|
||||
finder = _getfinder()
|
||||
args = {}
|
||||
attrs = {}
|
||||
aeobj_0 = aetypes.ObjectSpecifier(want=aetypes.Type('cfol'),
|
||||
form="alis", seld=folder_alias, fr=None)
|
||||
aeobj_1 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'),
|
||||
form="prop", seld=aetypes.Type('cwnd'), fr=aeobj_0)
|
||||
aeobj_2 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'),
|
||||
form="prop", seld=aetypes.Type('ptsz'), fr=aeobj_1)
|
||||
args['----'] = aeobj_2
|
||||
_reply, args, attrs = finder.send('core', 'getd', args, attrs)
|
||||
if 'errn' in args:
|
||||
raise Error, aetools.decodeerror(args)
|
||||
if '----' in args:
|
||||
return args['----']
|
||||
|
||||
def icon(object, icondata=None):
|
||||
"""icon sets the icon of object, if no icondata is given,
|
||||
icon will return an AE object with binary data for the current icon.
|
||||
If left untouched, this data can be used to paste the icon on another file.
|
||||
Development opportunity: get and set the data as PICT."""
|
||||
fsr = Carbon.File.FSRef(object)
|
||||
object_alias = fsr.FSNewAliasMinimal()
|
||||
if icondata is None:
|
||||
return _geticon(object_alias)
|
||||
return _seticon(object_alias, icondata)
|
||||
|
||||
def _geticon(object_alias):
|
||||
"""get the icondata for object. Binary data of some sort."""
|
||||
finder = _getfinder()
|
||||
args = {}
|
||||
attrs = {}
|
||||
aeobj_00 = aetypes.ObjectSpecifier(want=aetypes.Type('cobj'),
|
||||
form="alis", seld=object_alias, fr=None)
|
||||
aeobj_01 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'),
|
||||
form="prop", seld=aetypes.Type('iimg'), fr=aeobj_00)
|
||||
args['----'] = aeobj_01
|
||||
_reply, args, attrs = finder.send("core", "getd", args, attrs)
|
||||
if 'errn' in args:
|
||||
raise Error, aetools.decodeerror(args)
|
||||
if '----' in args:
|
||||
return args['----']
|
||||
|
||||
def _seticon(object_alias, icondata):
|
||||
"""set the icondata for object, formatted as produced by _geticon()"""
|
||||
finder = _getfinder()
|
||||
args = {}
|
||||
attrs = {}
|
||||
aeobj_00 = aetypes.ObjectSpecifier(want=aetypes.Type('cobj'),
|
||||
form="alis", seld=object_alias, fr=None)
|
||||
aeobj_01 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'),
|
||||
form="prop", seld=aetypes.Type('iimg'), fr=aeobj_00)
|
||||
args['----'] = aeobj_01
|
||||
args["data"] = icondata
|
||||
_reply, args, attrs = finder.send("core", "setd", args, attrs)
|
||||
if 'errn' in args:
|
||||
raise Error, aetools.decodeerror(args)
|
||||
if '----' in args:
|
||||
return args['----'].data
|
||||
|
||||
|
||||
#---------------------------------------------------
|
||||
# Volumes and servers.
|
||||
|
||||
def mountvolume(volume, server=None, username=None, password=None):
|
||||
"""mount a volume, local or on a server on AppleTalk.
|
||||
Note: mounting a ASIP server requires a different operation.
|
||||
server is the name of the server where the volume belongs
|
||||
username, password belong to a registered user of the volume."""
|
||||
finder = _getfinder()
|
||||
args = {}
|
||||
attrs = {}
|
||||
if password:
|
||||
args["PASS"] = password
|
||||
if username:
|
||||
args["USER"] = username
|
||||
if server:
|
||||
args["SRVR"] = server
|
||||
args['----'] = volume
|
||||
_reply, args, attrs = finder.send("aevt", "mvol", args, attrs)
|
||||
if 'errn' in args:
|
||||
raise Error, aetools.decodeerror(args)
|
||||
if '----' in args:
|
||||
return args['----']
|
||||
|
||||
def unmountvolume(volume):
|
||||
"""unmount a volume that's on the desktop"""
|
||||
putaway(volume)
|
||||
|
||||
def putaway(object):
|
||||
"""puth the object away, whereever it came from."""
|
||||
finder = _getfinder()
|
||||
args = {}
|
||||
attrs = {}
|
||||
args['----'] = aetypes.ObjectSpecifier(want=aetypes.Type('cdis'), form="name", seld=object, fr=None)
|
||||
_reply, args, attrs = talker.send("fndr", "ptwy", args, attrs)
|
||||
if 'errn' in args:
|
||||
raise Error, aetools.decodeerror(args)
|
||||
if '----' in args:
|
||||
return args['----']
|
||||
|
||||
|
||||
#---------------------------------------------------
|
||||
# Miscellaneous functions
|
||||
#
|
||||
|
||||
def volumelevel(level):
|
||||
"""set the audio output level, parameter between 0 (silent) and 7 (full blast)"""
|
||||
finder = _getfinder()
|
||||
args = {}
|
||||
attrs = {}
|
||||
if level < 0:
|
||||
level = 0
|
||||
elif level > 7:
|
||||
level = 7
|
||||
args['----'] = level
|
||||
_reply, args, attrs = finder.send("aevt", "stvl", args, attrs)
|
||||
if 'errn' in args:
|
||||
raise Error, aetools.decodeerror(args)
|
||||
if '----' in args:
|
||||
return args['----']
|
||||
|
||||
def OSversion():
|
||||
"""return the version of the system software"""
|
||||
finder = _getfinder()
|
||||
args = {}
|
||||
attrs = {}
|
||||
aeobj_00 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), form="prop", seld=aetypes.Type('ver2'), fr=None)
|
||||
args['----'] = aeobj_00
|
||||
_reply, args, attrs = finder.send("core", "getd", args, attrs)
|
||||
if 'errn' in args:
|
||||
raise Error, aetools.decodeerror(args)
|
||||
if '----' in args:
|
||||
return args['----']
|
||||
|
||||
def filesharing():
|
||||
"""return the current status of filesharing and whether it is starting up or not:
|
||||
-1 file sharing is off and not starting up
|
||||
0 file sharing is off and starting up
|
||||
1 file sharing is on"""
|
||||
status = -1
|
||||
finder = _getfinder()
|
||||
# see if it is on
|
||||
args = {}
|
||||
attrs = {}
|
||||
args['----'] = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), form="prop", seld=aetypes.Type('fshr'), fr=None)
|
||||
_reply, args, attrs = finder.send("core", "getd", args, attrs)
|
||||
if 'errn' in args:
|
||||
raise Error, aetools.decodeerror(args)
|
||||
if '----' in args:
|
||||
if args['----'] == 0:
|
||||
status = -1
|
||||
else:
|
||||
status = 1
|
||||
# is it starting up perchance?
|
||||
args = {}
|
||||
attrs = {}
|
||||
args['----'] = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), form="prop", seld=aetypes.Type('fsup'), fr=None)
|
||||
_reply, args, attrs = finder.send("core", "getd", args, attrs)
|
||||
if 'errn' in args:
|
||||
raise Error, aetools.decodeerror(args)
|
||||
if '----' in args:
|
||||
if args['----'] == 1:
|
||||
status = 0
|
||||
return status
|
||||
|
||||
def movetotrash(path):
|
||||
"""move the object to the trash"""
|
||||
fss = Carbon.File.FSSpec(path)
|
||||
trashfolder = Carbon.Folder.FSFindFolder(fss.as_tuple()[0], 'trsh', 0)
|
||||
move(path, trashfolder)
|
||||
|
||||
def emptytrash():
|
||||
"""empty the trash"""
|
||||
finder = _getfinder()
|
||||
args = {}
|
||||
attrs = {}
|
||||
args['----'] = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), form="prop", seld=aetypes.Type('trsh'), fr=None)
|
||||
_reply, args, attrs = finder.send("fndr", "empt", args, attrs)
|
||||
if 'errn' in args:
|
||||
raise aetools.Error, aetools.decodeerror(args)
|
||||
|
||||
|
||||
def _test():
|
||||
import EasyDialogs
|
||||
print 'Original findertools functionality test...'
|
||||
print 'Testing launch...'
|
||||
pathname = EasyDialogs.AskFileForOpen('File to launch:')
|
||||
if pathname:
|
||||
result = launch(pathname)
|
||||
if result:
|
||||
print 'Result: ', result
|
||||
print 'Press return-',
|
||||
sys.stdin.readline()
|
||||
print 'Testing print...'
|
||||
pathname = EasyDialogs.AskFileForOpen('File to print:')
|
||||
if pathname:
|
||||
result = Print(pathname)
|
||||
if result:
|
||||
print 'Result: ', result
|
||||
print 'Press return-',
|
||||
sys.stdin.readline()
|
||||
print 'Testing copy...'
|
||||
pathname = EasyDialogs.AskFileForOpen('File to copy:')
|
||||
if pathname:
|
||||
destdir = EasyDialogs.AskFolder('Destination:')
|
||||
if destdir:
|
||||
result = copy(pathname, destdir)
|
||||
if result:
|
||||
print 'Result:', result
|
||||
print 'Press return-',
|
||||
sys.stdin.readline()
|
||||
print 'Testing move...'
|
||||
pathname = EasyDialogs.AskFileForOpen('File to move:')
|
||||
if pathname:
|
||||
destdir = EasyDialogs.AskFolder('Destination:')
|
||||
if destdir:
|
||||
result = move(pathname, destdir)
|
||||
if result:
|
||||
print 'Result:', result
|
||||
print 'Press return-',
|
||||
sys.stdin.readline()
|
||||
print 'Testing sleep...'
|
||||
if EasyDialogs.AskYesNoCancel('Sleep?') > 0:
|
||||
result = sleep()
|
||||
if result:
|
||||
print 'Result:', result
|
||||
print 'Press return-',
|
||||
sys.stdin.readline()
|
||||
print 'Testing shutdown...'
|
||||
if EasyDialogs.AskYesNoCancel('Shut down?') > 0:
|
||||
result = shutdown()
|
||||
if result:
|
||||
print 'Result:', result
|
||||
print 'Press return-',
|
||||
sys.stdin.readline()
|
||||
print 'Testing restart...'
|
||||
if EasyDialogs.AskYesNoCancel('Restart?') > 0:
|
||||
result = restart()
|
||||
if result:
|
||||
print 'Result:', result
|
||||
print 'Press return-',
|
||||
sys.stdin.readline()
|
||||
|
||||
def _test2():
|
||||
print '\nmorefindertools version %s\nTests coming up...' %__version__
|
||||
import os
|
||||
import random
|
||||
|
||||
# miscellaneous
|
||||
print '\tfilesharing on?', filesharing() # is file sharing on, off, starting up?
|
||||
print '\tOS version', OSversion() # the version of the system software
|
||||
|
||||
# set the soundvolume in a simple way
|
||||
print '\tSystem beep volume'
|
||||
for i in range(0, 7):
|
||||
volumelevel(i)
|
||||
MacOS.SysBeep()
|
||||
|
||||
# Finder's windows, file location, file attributes
|
||||
open("@findertoolstest", "w")
|
||||
f = "@findertoolstest"
|
||||
reveal(f) # reveal this file in a Finder window
|
||||
select(f) # select this file
|
||||
|
||||
base, file = os.path.split(f)
|
||||
closewindow(base) # close the window this file is in (opened by reveal)
|
||||
openwindow(base) # open it again
|
||||
windowview(base, 1) # set the view by list
|
||||
|
||||
label(f, 2) # set the label of this file to something orange
|
||||
print '\tlabel', label(f) # get the label of this file
|
||||
|
||||
# the file location only works in a window with icon view!
|
||||
print 'Random locations for an icon'
|
||||
windowview(base, 0) # set the view by icon
|
||||
windowsize(base, (600, 600))
|
||||
for i in range(50):
|
||||
location(f, (random.randint(10, 590), random.randint(10, 590)))
|
||||
|
||||
windowsize(base, (200, 400))
|
||||
windowview(base, 1) # set the view by icon
|
||||
|
||||
orgpos = windowposition(base)
|
||||
print 'Animated window location'
|
||||
for i in range(10):
|
||||
pos = (100+i*10, 100+i*10)
|
||||
windowposition(base, pos)
|
||||
print '\twindow position', pos
|
||||
windowposition(base, orgpos) # park it where it was before
|
||||
|
||||
print 'Put a comment in file', f, ':'
|
||||
print '\t', comment(f) # print the Finder comment this file has
|
||||
s = 'This is a comment no one reads!'
|
||||
comment(f, s) # set the Finder comment
|
||||
|
||||
def _test3():
|
||||
print 'MacOS9 or better specific functions'
|
||||
# processes
|
||||
pr = processes() # return a list of tuples with (active_processname, creatorcode)
|
||||
print 'Return a list of current active processes:'
|
||||
for p in pr:
|
||||
print '\t', p
|
||||
|
||||
# get attributes of the first process in the list
|
||||
print 'Attributes of the first process in the list:'
|
||||
pinfo = processinfo(pr[0][0])
|
||||
print '\t', pr[0][0]
|
||||
print '\t\tmemory partition', pinfo.partition # the memory allocated to this process
|
||||
print '\t\tmemory used', pinfo.used # the memory actuall used by this process
|
||||
print '\t\tis visible', pinfo.visible # is the process visible to the user
|
||||
print '\t\tis frontmost', pinfo.frontmost # is the process the front most one?
|
||||
print '\t\thas scripting', pinfo.hasscripting # is the process scriptable?
|
||||
print '\t\taccepts high level events', pinfo.accepthighlevel # does the process accept high level appleevents?
|
||||
|
||||
if __name__ == '__main__':
|
||||
_test()
|
||||
_test2()
|
||||
_test3()
|
||||
1216
Darwin/lib/python2.7/plat-mac/gensuitemodule.py
Normal file
1216
Darwin/lib/python2.7/plat-mac/gensuitemodule.py
Normal file
File diff suppressed because it is too large
Load diff
271
Darwin/lib/python2.7/plat-mac/ic.py
Normal file
271
Darwin/lib/python2.7/plat-mac/ic.py
Normal file
|
|
@ -0,0 +1,271 @@
|
|||
"""IC wrapper module, based on Internet Config 1.3"""
|
||||
|
||||
from warnings import warnpy3k
|
||||
warnpy3k("In 3.x, the ic module is removed.", stacklevel=2)
|
||||
|
||||
import icglue
|
||||
import string
|
||||
import sys
|
||||
import os
|
||||
from Carbon import Res
|
||||
import Carbon.File
|
||||
import macostools
|
||||
|
||||
error=icglue.error
|
||||
|
||||
# From ictypes.h:
|
||||
icPrefNotFoundErr = -666 # preference not found (duh!)
|
||||
icPermErr = -667 # cannot set preference
|
||||
icPrefDataErr = -668 # problem with preference data
|
||||
icInternalErr = -669 # hmm, this is not good
|
||||
icTruncatedErr = -670 # more data was present than was returned
|
||||
icNoMoreWritersErr = -671 # you cannot begin a write session because someone else is already doing it */
|
||||
icNothingToOverrideErr = -672 # no component for the override component to capture
|
||||
icNoURLErr = -673 # no URL found
|
||||
icConfigNotFoundErr = -674 # no configuration was found
|
||||
icConfigInappropriateErr = -675 # incorrect manufacturer code
|
||||
|
||||
ICattr_no_change = -1
|
||||
|
||||
icNoPerm = 0
|
||||
icReadOnlyPerm = 1
|
||||
icReadWritePerm = 2
|
||||
# End of ictypes.h
|
||||
|
||||
class ICOpaqueData:
|
||||
"""An unparseable IC entry"""
|
||||
def __init__(self, data):
|
||||
self.data = data
|
||||
|
||||
def __repr__(self):
|
||||
return "ICOpaqueData(%r)"%(self.data,)
|
||||
|
||||
_ICOpaqueDataType=type(ICOpaqueData(''))
|
||||
|
||||
def _decode_default(data, key):
|
||||
if len(data) == 0:
|
||||
return data
|
||||
if ord(data[0]) == len(data)-1:
|
||||
# Assume Pstring
|
||||
return data[1:]
|
||||
return ICOpaqueData(data)
|
||||
|
||||
|
||||
def _decode_multistr(data, key):
|
||||
numstr = ord(data[0]) << 8 | ord(data[1])
|
||||
rv = []
|
||||
ptr = 2
|
||||
for i in range(numstr):
|
||||
strlen = ord(data[ptr])
|
||||
str = data[ptr+1:ptr+strlen+1]
|
||||
rv.append(str)
|
||||
ptr = ptr + strlen + 1
|
||||
return rv
|
||||
|
||||
def _decode_fontrecord(data, key):
|
||||
size = ord(data[0]) << 8 | ord(data[1])
|
||||
face = ord(data[2])
|
||||
namelen = ord(data[4])
|
||||
return size, face, data[5:5+namelen]
|
||||
|
||||
def _decode_boolean(data, key):
|
||||
return ord(data[0])
|
||||
|
||||
def _decode_text(data, key):
|
||||
return data
|
||||
|
||||
def _decode_charset(data, key):
|
||||
return data[:256], data[256:]
|
||||
|
||||
def _decode_appspec(data, key):
|
||||
namelen = ord(data[4])
|
||||
return data[0:4], data[5:5+namelen]
|
||||
|
||||
def _code_default(data, key):
|
||||
return chr(len(data)) + data
|
||||
|
||||
def _code_multistr(data, key):
|
||||
numstr = len(data)
|
||||
rv = chr((numstr>>8) & 0xff) + chr(numstr & 0xff)
|
||||
for i in data:
|
||||
rv = rv + _code_default(i)
|
||||
return rv
|
||||
|
||||
def _code_fontrecord(data, key):
|
||||
size, face, name = data
|
||||
return chr((size>>8) & 0xff) + chr(size & 0xff) + chr(face & 0xff) + \
|
||||
chr(0) + _code_default(name)
|
||||
|
||||
def _code_boolean(data, key):
|
||||
print 'XXXX boolean:', repr(data)
|
||||
return chr(data)
|
||||
|
||||
def _code_text(data, key):
|
||||
return data
|
||||
|
||||
def _code_charset(data, key):
|
||||
return data[0] + data[1]
|
||||
|
||||
def _code_appspec(data, key):
|
||||
return data[0] + _code_default(data[1])
|
||||
|
||||
_decoder_table = {
|
||||
"ArchieAll" : (_decode_multistr , _code_multistr),
|
||||
"UMichAll" : (_decode_multistr , _code_multistr),
|
||||
"InfoMacAll" : (_decode_multistr , _code_multistr),
|
||||
"ListFont" : (_decode_fontrecord , _code_fontrecord),
|
||||
"ScreenFont" : (_decode_fontrecord , _code_fontrecord),
|
||||
"PrinterFont" : (_decode_fontrecord , _code_fontrecord),
|
||||
# "DownloadFolder" : (_decode_filespec , _code_filespec),
|
||||
"Signature": (_decode_text , _code_text),
|
||||
"Plan" : (_decode_text , _code_text),
|
||||
"MailHeaders" : (_decode_text , _code_text),
|
||||
"NewsHeaders" : (_decode_text , _code_text),
|
||||
# "Mapping"
|
||||
"CharacterSet" : (_decode_charset , _code_charset),
|
||||
"Helper\245" : (_decode_appspec , _code_appspec),
|
||||
# "Services" : (_decode_services, ????),
|
||||
"NewMailFlashIcon" : (_decode_boolean , _code_boolean),
|
||||
"NewMailDialog" : (_decode_boolean , _code_boolean),
|
||||
"NewMailPlaySound" : (_decode_boolean , _code_boolean),
|
||||
# "WebBackgroundColor" : _decode_color,
|
||||
"NoProxyDomains" : (_decode_multistr , _code_multistr),
|
||||
"UseHTTPProxy" : (_decode_boolean , _code_boolean),
|
||||
"UseGopherProxy": (_decode_boolean , _code_boolean),
|
||||
"UseFTPProxy" : (_decode_boolean , _code_boolean),
|
||||
"UsePassiveFTP" : (_decode_boolean , _code_boolean),
|
||||
}
|
||||
|
||||
def _decode(data, key):
|
||||
if '\245' in key:
|
||||
key2 = key[:string.index(key, '\245')+1]
|
||||
else:
|
||||
key2 = key
|
||||
if key2 in _decoder_table:
|
||||
decoder = _decoder_table[key2][0]
|
||||
else:
|
||||
decoder = _decode_default
|
||||
return decoder(data, key)
|
||||
|
||||
def _code(data, key):
|
||||
if type(data) == _ICOpaqueDataType:
|
||||
return data.data
|
||||
if '\245' in key:
|
||||
key2 = key[:string.index(key, '\245')+1]
|
||||
else:
|
||||
key2 = key
|
||||
if key2 in _decoder_table:
|
||||
coder = _decoder_table[key2][1]
|
||||
else:
|
||||
coder = _code_default
|
||||
return coder(data, key)
|
||||
|
||||
class IC:
|
||||
def __init__(self, signature='Pyth', ic=None):
|
||||
if ic:
|
||||
self.ic = ic
|
||||
else:
|
||||
self.ic = icglue.ICStart(signature)
|
||||
if hasattr(self.ic, 'ICFindConfigFile'):
|
||||
self.ic.ICFindConfigFile()
|
||||
self.h = Res.Resource('')
|
||||
|
||||
def keys(self):
|
||||
rv = []
|
||||
self.ic.ICBegin(icReadOnlyPerm)
|
||||
num = self.ic.ICCountPref()
|
||||
for i in range(num):
|
||||
rv.append(self.ic.ICGetIndPref(i+1))
|
||||
self.ic.ICEnd()
|
||||
return rv
|
||||
|
||||
def has_key(self, key):
|
||||
return self.__contains__(key)
|
||||
|
||||
def __contains__(self, key):
|
||||
try:
|
||||
dummy = self.ic.ICFindPrefHandle(key, self.h)
|
||||
except icglue.error:
|
||||
return 0
|
||||
return 1
|
||||
|
||||
def __getitem__(self, key):
|
||||
attr = self.ic.ICFindPrefHandle(key, self.h)
|
||||
return _decode(self.h.data, key)
|
||||
|
||||
def __setitem__(self, key, value):
|
||||
value = _code(value, key)
|
||||
self.ic.ICSetPref(key, ICattr_no_change, value)
|
||||
|
||||
def launchurl(self, url, hint=""):
|
||||
# Work around a bug in ICLaunchURL: file:/foo does
|
||||
# not work but file:///foo does.
|
||||
if url[:6] == 'file:/' and url[6] != '/':
|
||||
url = 'file:///' + url[6:]
|
||||
self.ic.ICLaunchURL(hint, url, 0, len(url))
|
||||
|
||||
def parseurl(self, data, start=None, end=None, hint=""):
|
||||
if start is None:
|
||||
selStart = 0
|
||||
selEnd = len(data)
|
||||
else:
|
||||
selStart = selEnd = start
|
||||
if end is not None:
|
||||
selEnd = end
|
||||
selStart, selEnd = self.ic.ICParseURL(hint, data, selStart, selEnd, self.h)
|
||||
return self.h.data, selStart, selEnd
|
||||
|
||||
def mapfile(self, file):
|
||||
if type(file) != type(''):
|
||||
file = file.as_tuple()[2]
|
||||
return self.ic.ICMapFilename(file)
|
||||
|
||||
def maptypecreator(self, type, creator, filename=""):
|
||||
return self.ic.ICMapTypeCreator(type, creator, filename)
|
||||
|
||||
def settypecreator(self, file):
|
||||
file = Carbon.File.pathname(file)
|
||||
record = self.mapfile(os.path.split(file)[1])
|
||||
MacOS.SetCreatorAndType(file, record[2], record[1])
|
||||
macostools.touched(fss)
|
||||
|
||||
# Convenience routines
|
||||
_dft_ic = None
|
||||
|
||||
def launchurl(url, hint=""):
|
||||
global _dft_ic
|
||||
if _dft_ic is None: _dft_ic = IC()
|
||||
return _dft_ic.launchurl(url, hint)
|
||||
|
||||
def parseurl(data, start=None, end=None, hint=""):
|
||||
global _dft_ic
|
||||
if _dft_ic is None: _dft_ic = IC()
|
||||
return _dft_ic.parseurl(data, start, end, hint)
|
||||
|
||||
def mapfile(filename):
|
||||
global _dft_ic
|
||||
if _dft_ic is None: _dft_ic = IC()
|
||||
return _dft_ic.mapfile(filename)
|
||||
|
||||
def maptypecreator(type, creator, filename=""):
|
||||
global _dft_ic
|
||||
if _dft_ic is None: _dft_ic = IC()
|
||||
return _dft_ic.maptypecreator(type, creator, filename)
|
||||
|
||||
def settypecreator(file):
|
||||
global _dft_ic
|
||||
if _dft_ic is None: _dft_ic = IC()
|
||||
return _dft_ic.settypecreator(file)
|
||||
|
||||
def _test():
|
||||
ic = IC()
|
||||
for k in ic.keys():
|
||||
try:
|
||||
v = ic[k]
|
||||
except error:
|
||||
v = '????'
|
||||
print k, '\t', v
|
||||
sys.exit(1)
|
||||
|
||||
if __name__ == '__main__':
|
||||
_test()
|
||||
69
Darwin/lib/python2.7/plat-mac/icopen.py
Normal file
69
Darwin/lib/python2.7/plat-mac/icopen.py
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
"""icopen patch
|
||||
|
||||
OVERVIEW
|
||||
|
||||
icopen patches MacOS Python to use the Internet Config file mappings to select
|
||||
the type and creator for a file.
|
||||
|
||||
Version 1 released to the public domain 3 November 1999
|
||||
by Oliver Steele (steele@cs.brandeis.edu).
|
||||
|
||||
DETAILS
|
||||
|
||||
This patch causes files created by Python's open(filename, 'w') command (and
|
||||
by functions and scripts that call it) to set the type and creator of the file
|
||||
to the type and creator associated with filename's extension (the
|
||||
portion of the filename after the last period), according to Internet Config.
|
||||
Thus, a script that creates a file foo.html will create one that opens in whatever
|
||||
browser you've set to handle *.html files, and so on.
|
||||
|
||||
Python IDE uses its own algorithm to select the type and creator for saved
|
||||
editor windows, so this patch won't effect their types.
|
||||
|
||||
As of System 8.6 at least, Internet Config is built into the system, and the
|
||||
file mappings are accessed from the Advanced pane of the Internet control
|
||||
panel. User Mode (in the Edit menu) needs to be set to Advanced in order to
|
||||
access this pane.
|
||||
|
||||
INSTALLATION
|
||||
|
||||
Put this file in your Python path, and create a file named {Python}:sitecustomize.py
|
||||
that contains:
|
||||
import icopen
|
||||
|
||||
(If {Python}:sitecustomizer.py already exists, just add the 'import' line to it.)
|
||||
|
||||
The next time you launch PythonInterpreter or Python IDE, the patch will take
|
||||
effect.
|
||||
"""
|
||||
|
||||
from warnings import warnpy3k
|
||||
warnpy3k("In 3.x, the icopen module is removed.", stacklevel=2)
|
||||
|
||||
import __builtin__
|
||||
|
||||
_builtin_open = globals().get('_builtin_open', __builtin__.open)
|
||||
|
||||
def _open_with_typer(*args):
|
||||
file = _builtin_open(*args)
|
||||
filename = args[0]
|
||||
mode = 'r'
|
||||
if args[1:]:
|
||||
mode = args[1]
|
||||
if mode[0] == 'w':
|
||||
from ic import error, settypecreator
|
||||
try:
|
||||
settypecreator(filename)
|
||||
except error:
|
||||
pass
|
||||
return file
|
||||
|
||||
__builtin__.open = _open_with_typer
|
||||
|
||||
"""
|
||||
open('test.py')
|
||||
_open_with_typer('test.py', 'w')
|
||||
_open_with_typer('test.txt', 'w')
|
||||
_open_with_typer('test.html', 'w')
|
||||
_open_with_typer('test.foo', 'w')
|
||||
"""
|
||||
|
|
@ -0,0 +1,682 @@
|
|||
"""Suite CodeWarrior suite: Terms for scripting the CodeWarrior IDE
|
||||
Level 0, version 0
|
||||
|
||||
Generated from /Volumes/Sap/Applications (Mac OS 9)/Metrowerks CodeWarrior 7.0/Metrowerks CodeWarrior/CodeWarrior IDE 4.2.5
|
||||
AETE/AEUT resource version 1/0, language 0, script 0
|
||||
"""
|
||||
|
||||
import aetools
|
||||
import MacOS
|
||||
|
||||
_code = 'CWIE'
|
||||
|
||||
class CodeWarrior_suite_Events:
|
||||
|
||||
_argmap_add = {
|
||||
'new' : 'kocl',
|
||||
'with_data' : 'data',
|
||||
'to_targets' : 'TTGT',
|
||||
'to_group' : 'TGRP',
|
||||
}
|
||||
|
||||
def add(self, _object, _attributes={}, **_arguments):
|
||||
"""add: add elements to a project or target
|
||||
Required argument: an AE object reference
|
||||
Keyword argument new: the class of the new element or elements to add
|
||||
Keyword argument with_data: the initial data for the element or elements
|
||||
Keyword argument to_targets: the targets to which the new element or elements will be added
|
||||
Keyword argument to_group: the group to which the new element or elements will be added
|
||||
Keyword argument _attributes: AppleEvent attribute dictionary
|
||||
"""
|
||||
_code = 'CWIE'
|
||||
_subcode = 'ADDF'
|
||||
|
||||
aetools.keysubst(_arguments, self._argmap_add)
|
||||
_arguments['----'] = _object
|
||||
|
||||
|
||||
_reply, _arguments, _attributes = self.send(_code, _subcode,
|
||||
_arguments, _attributes)
|
||||
if _arguments.get('errn', 0):
|
||||
raise aetools.Error, aetools.decodeerror(_arguments)
|
||||
# XXXX Optionally decode result
|
||||
if _arguments.has_key('----'):
|
||||
return _arguments['----']
|
||||
|
||||
def build(self, _no_object=None, _attributes={}, **_arguments):
|
||||
"""build: build a project or target (equivalent of the Make menu command)
|
||||
Keyword argument _attributes: AppleEvent attribute dictionary
|
||||
"""
|
||||
_code = 'CWIE'
|
||||
_subcode = 'MAKE'
|
||||
|
||||
if _arguments: raise TypeError, 'No optional args expected'
|
||||
if _no_object is not None: raise TypeError, 'No direct arg expected'
|
||||
|
||||
|
||||
_reply, _arguments, _attributes = self.send(_code, _subcode,
|
||||
_arguments, _attributes)
|
||||
if _arguments.get('errn', 0):
|
||||
raise aetools.Error, aetools.decodeerror(_arguments)
|
||||
# XXXX Optionally decode result
|
||||
if _arguments.has_key('----'):
|
||||
return _arguments['----']
|
||||
|
||||
def check(self, _object=None, _attributes={}, **_arguments):
|
||||
"""check: check the syntax of a file in a project or target
|
||||
Required argument: the file or files to be checked
|
||||
Keyword argument _attributes: AppleEvent attribute dictionary
|
||||
"""
|
||||
_code = 'CWIE'
|
||||
_subcode = 'CHEK'
|
||||
|
||||
if _arguments: raise TypeError, 'No optional args expected'
|
||||
_arguments['----'] = _object
|
||||
|
||||
|
||||
_reply, _arguments, _attributes = self.send(_code, _subcode,
|
||||
_arguments, _attributes)
|
||||
if _arguments.get('errn', 0):
|
||||
raise aetools.Error, aetools.decodeerror(_arguments)
|
||||
# XXXX Optionally decode result
|
||||
if _arguments.has_key('----'):
|
||||
return _arguments['----']
|
||||
|
||||
def compile_file(self, _object=None, _attributes={}, **_arguments):
|
||||
"""compile file: compile a file in a project or target
|
||||
Required argument: the file or files to be compiled
|
||||
Keyword argument _attributes: AppleEvent attribute dictionary
|
||||
"""
|
||||
_code = 'CWIE'
|
||||
_subcode = 'COMP'
|
||||
|
||||
if _arguments: raise TypeError, 'No optional args expected'
|
||||
_arguments['----'] = _object
|
||||
|
||||
|
||||
_reply, _arguments, _attributes = self.send(_code, _subcode,
|
||||
_arguments, _attributes)
|
||||
if _arguments.get('errn', 0):
|
||||
raise aetools.Error, aetools.decodeerror(_arguments)
|
||||
# XXXX Optionally decode result
|
||||
if _arguments.has_key('----'):
|
||||
return _arguments['----']
|
||||
|
||||
def disassemble_file(self, _object=None, _attributes={}, **_arguments):
|
||||
"""disassemble file: disassemble a file in a project or target
|
||||
Required argument: the file or files to be disassembled
|
||||
Keyword argument _attributes: AppleEvent attribute dictionary
|
||||
"""
|
||||
_code = 'CWIE'
|
||||
_subcode = 'DASM'
|
||||
|
||||
if _arguments: raise TypeError, 'No optional args expected'
|
||||
_arguments['----'] = _object
|
||||
|
||||
|
||||
_reply, _arguments, _attributes = self.send(_code, _subcode,
|
||||
_arguments, _attributes)
|
||||
if _arguments.get('errn', 0):
|
||||
raise aetools.Error, aetools.decodeerror(_arguments)
|
||||
# XXXX Optionally decode result
|
||||
if _arguments.has_key('----'):
|
||||
return _arguments['----']
|
||||
|
||||
_argmap_export = {
|
||||
'in_' : 'kfil',
|
||||
}
|
||||
|
||||
def export(self, _no_object=None, _attributes={}, **_arguments):
|
||||
"""export: Export the project file as an XML file
|
||||
Keyword argument in_: the XML file in which to export the project
|
||||
Keyword argument _attributes: AppleEvent attribute dictionary
|
||||
"""
|
||||
_code = 'CWIE'
|
||||
_subcode = 'EXPT'
|
||||
|
||||
aetools.keysubst(_arguments, self._argmap_export)
|
||||
if _no_object is not None: raise TypeError, 'No direct arg expected'
|
||||
|
||||
|
||||
_reply, _arguments, _attributes = self.send(_code, _subcode,
|
||||
_arguments, _attributes)
|
||||
if _arguments.get('errn', 0):
|
||||
raise aetools.Error, aetools.decodeerror(_arguments)
|
||||
# XXXX Optionally decode result
|
||||
if _arguments.has_key('----'):
|
||||
return _arguments['----']
|
||||
|
||||
def remove_object_code(self, _no_object=None, _attributes={}, **_arguments):
|
||||
"""remove object code: remove object code from a project or target
|
||||
Keyword argument _attributes: AppleEvent attribute dictionary
|
||||
"""
|
||||
_code = 'CWIE'
|
||||
_subcode = 'RMOB'
|
||||
|
||||
if _arguments: raise TypeError, 'No optional args expected'
|
||||
if _no_object is not None: raise TypeError, 'No direct arg expected'
|
||||
|
||||
|
||||
_reply, _arguments, _attributes = self.send(_code, _subcode,
|
||||
_arguments, _attributes)
|
||||
if _arguments.get('errn', 0):
|
||||
raise aetools.Error, aetools.decodeerror(_arguments)
|
||||
# XXXX Optionally decode result
|
||||
if _arguments.has_key('----'):
|
||||
return _arguments['----']
|
||||
|
||||
def remove_target_files(self, _object, _attributes={}, **_arguments):
|
||||
"""remove target files: remove files from a target
|
||||
Required argument: an AE object reference
|
||||
Keyword argument _attributes: AppleEvent attribute dictionary
|
||||
"""
|
||||
_code = 'CWIE'
|
||||
_subcode = 'RMFL'
|
||||
|
||||
if _arguments: raise TypeError, 'No optional args expected'
|
||||
_arguments['----'] = _object
|
||||
|
||||
|
||||
_reply, _arguments, _attributes = self.send(_code, _subcode,
|
||||
_arguments, _attributes)
|
||||
if _arguments.get('errn', 0):
|
||||
raise aetools.Error, aetools.decodeerror(_arguments)
|
||||
# XXXX Optionally decode result
|
||||
if _arguments.has_key('----'):
|
||||
return _arguments['----']
|
||||
|
||||
def run_target(self, _no_object=None, _attributes={}, **_arguments):
|
||||
"""run target: run a project or target
|
||||
Keyword argument _attributes: AppleEvent attribute dictionary
|
||||
"""
|
||||
_code = 'CWIE'
|
||||
_subcode = 'RUN '
|
||||
|
||||
if _arguments: raise TypeError, 'No optional args expected'
|
||||
if _no_object is not None: raise TypeError, 'No direct arg expected'
|
||||
|
||||
|
||||
_reply, _arguments, _attributes = self.send(_code, _subcode,
|
||||
_arguments, _attributes)
|
||||
if _arguments.get('errn', 0):
|
||||
raise aetools.Error, aetools.decodeerror(_arguments)
|
||||
# XXXX Optionally decode result
|
||||
if _arguments.has_key('----'):
|
||||
return _arguments['----']
|
||||
|
||||
def touch_file(self, _object=None, _attributes={}, **_arguments):
|
||||
"""touch file: touch a file in a project or target for compilation
|
||||
Required argument: the file or files to be touched
|
||||
Keyword argument _attributes: AppleEvent attribute dictionary
|
||||
"""
|
||||
_code = 'CWIE'
|
||||
_subcode = 'TOCH'
|
||||
|
||||
if _arguments: raise TypeError, 'No optional args expected'
|
||||
_arguments['----'] = _object
|
||||
|
||||
|
||||
_reply, _arguments, _attributes = self.send(_code, _subcode,
|
||||
_arguments, _attributes)
|
||||
if _arguments.get('errn', 0):
|
||||
raise aetools.Error, aetools.decodeerror(_arguments)
|
||||
# XXXX Optionally decode result
|
||||
if _arguments.has_key('----'):
|
||||
return _arguments['----']
|
||||
|
||||
def update(self, _no_object=None, _attributes={}, **_arguments):
|
||||
"""update: bring a project or target up to date
|
||||
Keyword argument _attributes: AppleEvent attribute dictionary
|
||||
"""
|
||||
_code = 'CWIE'
|
||||
_subcode = 'UP2D'
|
||||
|
||||
if _arguments: raise TypeError, 'No optional args expected'
|
||||
if _no_object is not None: raise TypeError, 'No direct arg expected'
|
||||
|
||||
|
||||
_reply, _arguments, _attributes = self.send(_code, _subcode,
|
||||
_arguments, _attributes)
|
||||
if _arguments.get('errn', 0):
|
||||
raise aetools.Error, aetools.decodeerror(_arguments)
|
||||
# XXXX Optionally decode result
|
||||
if _arguments.has_key('----'):
|
||||
return _arguments['----']
|
||||
|
||||
|
||||
class single_class_browser(aetools.ComponentItem):
|
||||
"""single class browser - a single class browser """
|
||||
want = '1BRW'
|
||||
class _Prop_inherits(aetools.NProperty):
|
||||
"""inherits - all properties and elements of the given class are inherited by this class. """
|
||||
which = 'c@#^'
|
||||
want = 'TXTD'
|
||||
|
||||
single_class_browsers = single_class_browser
|
||||
|
||||
class single_class_hierarchy(aetools.ComponentItem):
|
||||
"""single class hierarchy - a single class hierarchy document """
|
||||
want = '1HIR'
|
||||
|
||||
single_class_hierarchies = single_class_hierarchy
|
||||
|
||||
class class_browser(aetools.ComponentItem):
|
||||
"""class browser - a class browser """
|
||||
want = 'BROW'
|
||||
|
||||
class_browsers = class_browser
|
||||
|
||||
class file_compare_document(aetools.ComponentItem):
|
||||
"""file compare document - a file compare document """
|
||||
want = 'COMP'
|
||||
|
||||
file_compare_documents = file_compare_document
|
||||
|
||||
class catalog_document(aetools.ComponentItem):
|
||||
"""catalog document - a browser catalog document """
|
||||
want = 'CTLG'
|
||||
|
||||
catalog_documents = catalog_document
|
||||
|
||||
class editor_document(aetools.ComponentItem):
|
||||
"""editor document - an editor document """
|
||||
want = 'EDIT'
|
||||
|
||||
editor_documents = editor_document
|
||||
|
||||
class class_hierarchy(aetools.ComponentItem):
|
||||
"""class hierarchy - a class hierarchy document """
|
||||
want = 'HIER'
|
||||
|
||||
class_hierarchies = class_hierarchy
|
||||
|
||||
class project_inspector(aetools.ComponentItem):
|
||||
"""project inspector - the project inspector """
|
||||
want = 'INSP'
|
||||
|
||||
project_inspectors = project_inspector
|
||||
|
||||
class message_document(aetools.ComponentItem):
|
||||
"""message document - a message document """
|
||||
want = 'MSSG'
|
||||
|
||||
message_documents = message_document
|
||||
|
||||
class build_progress_document(aetools.ComponentItem):
|
||||
"""build progress document - a build progress document """
|
||||
want = 'PRGS'
|
||||
|
||||
build_progress_documents = build_progress_document
|
||||
|
||||
class project_document(aetools.ComponentItem):
|
||||
"""project document - a project document """
|
||||
want = 'PRJD'
|
||||
class _Prop_current_target(aetools.NProperty):
|
||||
"""current target - the current target """
|
||||
which = 'CURT'
|
||||
want = 'TRGT'
|
||||
# element 'TRGT' as ['indx', 'name', 'test', 'rang']
|
||||
|
||||
project_documents = project_document
|
||||
|
||||
class subtarget(aetools.ComponentItem):
|
||||
"""subtarget - a target that is prerequisite for another target """
|
||||
want = 'SBTG'
|
||||
class _Prop_link_against_output(aetools.NProperty):
|
||||
"""link against output - is the output of this subtarget linked into its dependent target? """
|
||||
which = 'LNKO'
|
||||
want = 'bool'
|
||||
class _Prop_target(aetools.NProperty):
|
||||
"""target - the target that is dependent on this subtarget """
|
||||
which = 'TrgT'
|
||||
want = 'TRGT'
|
||||
|
||||
subtargets = subtarget
|
||||
|
||||
class target_file(aetools.ComponentItem):
|
||||
"""target file - a source or header file in a target """
|
||||
want = 'SRCF'
|
||||
class _Prop_code_size(aetools.NProperty):
|
||||
"""code size - the size of the code (in bytes) produced by compiling this source file """
|
||||
which = 'CSZE'
|
||||
want = 'long'
|
||||
class _Prop_compiled_date(aetools.NProperty):
|
||||
"""compiled date - the date and this source file was last compiled """
|
||||
which = 'CMPD'
|
||||
want = 'ldt '
|
||||
class _Prop_data_size(aetools.NProperty):
|
||||
"""data size - the size of the date (in bytes) produced by compiling this source file """
|
||||
which = 'DSZE'
|
||||
want = 'long'
|
||||
class _Prop_debug(aetools.NProperty):
|
||||
"""debug - is debugging information generated for this source file? """
|
||||
which = 'DBUG'
|
||||
want = 'bool'
|
||||
class _Prop_dependents(aetools.NProperty):
|
||||
"""dependents - the source files that need this source file in order to build """
|
||||
which = 'DPND'
|
||||
want = 'list'
|
||||
class _Prop_id(aetools.NProperty):
|
||||
"""id - the unique ID number of the target file """
|
||||
which = 'ID '
|
||||
want = 'long'
|
||||
class _Prop_init_before(aetools.NProperty):
|
||||
"""init before - is the \xd4initialize before\xd5 flag set for this shared library? """
|
||||
which = 'INIT'
|
||||
want = 'bool'
|
||||
class _Prop_link_index(aetools.NProperty):
|
||||
"""link index - the index of the source file in its target\xd5s link order (-1 if source file is not in link order) """
|
||||
which = 'LIDX'
|
||||
want = 'long'
|
||||
class _Prop_linked(aetools.NProperty):
|
||||
"""linked - is the source file in the link order of its target? """
|
||||
which = 'LINK'
|
||||
want = 'bool'
|
||||
class _Prop_location(aetools.NProperty):
|
||||
"""location - the location of the target file on disk """
|
||||
which = 'FILE'
|
||||
want = 'fss '
|
||||
class _Prop_merge_output(aetools.NProperty):
|
||||
"""merge output - is this shared library merged into another code fragment? """
|
||||
which = 'MRGE'
|
||||
want = 'bool'
|
||||
class _Prop_modified_date(aetools.NProperty):
|
||||
"""modified date - the date and time this source file was last modified """
|
||||
which = 'MODD'
|
||||
want = 'ldt '
|
||||
class _Prop_path(aetools.NProperty):
|
||||
"""path - the path of the source file on disk """
|
||||
which = 'Path'
|
||||
want = 'itxt'
|
||||
class _Prop_prerequisites(aetools.NProperty):
|
||||
"""prerequisites - the source files needed to build this source file """
|
||||
which = 'PRER'
|
||||
want = 'list'
|
||||
class _Prop_type(aetools.NProperty):
|
||||
"""type - the type of source file """
|
||||
which = 'FTYP'
|
||||
want = 'FTYP'
|
||||
class _Prop_weak_link(aetools.NProperty):
|
||||
"""weak link - is this shared library linked weakly? """
|
||||
which = 'WEAK'
|
||||
want = 'bool'
|
||||
|
||||
target_files = target_file
|
||||
|
||||
class symbol_browser(aetools.ComponentItem):
|
||||
"""symbol browser - a symbol browser """
|
||||
want = 'SYMB'
|
||||
|
||||
symbol_browsers = symbol_browser
|
||||
|
||||
class ToolServer_worksheet(aetools.ComponentItem):
|
||||
"""ToolServer worksheet - a ToolServer worksheet """
|
||||
want = 'TOOL'
|
||||
|
||||
ToolServer_worksheets = ToolServer_worksheet
|
||||
|
||||
class target(aetools.ComponentItem):
|
||||
"""target - a target in a project """
|
||||
want = 'TRGT'
|
||||
class _Prop_name(aetools.NProperty):
|
||||
"""name - """
|
||||
which = 'pnam'
|
||||
want = 'itxt'
|
||||
class _Prop_project_document(aetools.NProperty):
|
||||
"""project document - the project document that contains this target """
|
||||
which = 'PrjD'
|
||||
want = 'PRJD'
|
||||
# element 'SBTG' as ['indx', 'test', 'rang']
|
||||
# element 'SRCF' as ['indx', 'test', 'rang']
|
||||
|
||||
targets = target
|
||||
|
||||
class text_document(aetools.ComponentItem):
|
||||
"""text document - a document that contains text """
|
||||
want = 'TXTD'
|
||||
class _Prop_modified(aetools.NProperty):
|
||||
"""modified - Has the document been modified since the last save? """
|
||||
which = 'imod'
|
||||
want = 'bool'
|
||||
class _Prop_selection(aetools.NProperty):
|
||||
"""selection - the selection visible to the user """
|
||||
which = 'sele'
|
||||
want = 'csel'
|
||||
# element 'cha ' as ['indx', 'rele', 'rang', 'test']
|
||||
# element 'cins' as ['rele']
|
||||
# element 'clin' as ['indx', 'rang', 'rele']
|
||||
# element 'ctxt' as ['rang']
|
||||
|
||||
text_documents = text_document
|
||||
single_class_browser._superclassnames = ['text_document']
|
||||
single_class_browser._privpropdict = {
|
||||
'inherits' : _Prop_inherits,
|
||||
}
|
||||
single_class_browser._privelemdict = {
|
||||
}
|
||||
import Standard_Suite
|
||||
single_class_hierarchy._superclassnames = ['document']
|
||||
single_class_hierarchy._privpropdict = {
|
||||
'inherits' : _Prop_inherits,
|
||||
}
|
||||
single_class_hierarchy._privelemdict = {
|
||||
}
|
||||
class_browser._superclassnames = ['text_document']
|
||||
class_browser._privpropdict = {
|
||||
'inherits' : _Prop_inherits,
|
||||
}
|
||||
class_browser._privelemdict = {
|
||||
}
|
||||
file_compare_document._superclassnames = ['text_document']
|
||||
file_compare_document._privpropdict = {
|
||||
'inherits' : _Prop_inherits,
|
||||
}
|
||||
file_compare_document._privelemdict = {
|
||||
}
|
||||
catalog_document._superclassnames = ['text_document']
|
||||
catalog_document._privpropdict = {
|
||||
'inherits' : _Prop_inherits,
|
||||
}
|
||||
catalog_document._privelemdict = {
|
||||
}
|
||||
editor_document._superclassnames = ['text_document']
|
||||
editor_document._privpropdict = {
|
||||
'inherits' : _Prop_inherits,
|
||||
}
|
||||
editor_document._privelemdict = {
|
||||
}
|
||||
class_hierarchy._superclassnames = ['document']
|
||||
class_hierarchy._privpropdict = {
|
||||
'inherits' : _Prop_inherits,
|
||||
}
|
||||
class_hierarchy._privelemdict = {
|
||||
}
|
||||
project_inspector._superclassnames = ['document']
|
||||
project_inspector._privpropdict = {
|
||||
'inherits' : _Prop_inherits,
|
||||
}
|
||||
project_inspector._privelemdict = {
|
||||
}
|
||||
message_document._superclassnames = ['text_document']
|
||||
message_document._privpropdict = {
|
||||
'inherits' : _Prop_inherits,
|
||||
}
|
||||
message_document._privelemdict = {
|
||||
}
|
||||
build_progress_document._superclassnames = ['document']
|
||||
build_progress_document._privpropdict = {
|
||||
'inherits' : _Prop_inherits,
|
||||
}
|
||||
build_progress_document._privelemdict = {
|
||||
}
|
||||
project_document._superclassnames = ['document']
|
||||
project_document._privpropdict = {
|
||||
'current_target' : _Prop_current_target,
|
||||
'inherits' : _Prop_inherits,
|
||||
}
|
||||
project_document._privelemdict = {
|
||||
'target' : target,
|
||||
}
|
||||
subtarget._superclassnames = ['target']
|
||||
subtarget._privpropdict = {
|
||||
'inherits' : _Prop_inherits,
|
||||
'link_against_output' : _Prop_link_against_output,
|
||||
'target' : _Prop_target,
|
||||
}
|
||||
subtarget._privelemdict = {
|
||||
}
|
||||
target_file._superclassnames = []
|
||||
target_file._privpropdict = {
|
||||
'code_size' : _Prop_code_size,
|
||||
'compiled_date' : _Prop_compiled_date,
|
||||
'data_size' : _Prop_data_size,
|
||||
'debug' : _Prop_debug,
|
||||
'dependents' : _Prop_dependents,
|
||||
'id' : _Prop_id,
|
||||
'init_before' : _Prop_init_before,
|
||||
'link_index' : _Prop_link_index,
|
||||
'linked' : _Prop_linked,
|
||||
'location' : _Prop_location,
|
||||
'merge_output' : _Prop_merge_output,
|
||||
'modified_date' : _Prop_modified_date,
|
||||
'path' : _Prop_path,
|
||||
'prerequisites' : _Prop_prerequisites,
|
||||
'type' : _Prop_type,
|
||||
'weak_link' : _Prop_weak_link,
|
||||
}
|
||||
target_file._privelemdict = {
|
||||
}
|
||||
symbol_browser._superclassnames = ['text_document']
|
||||
symbol_browser._privpropdict = {
|
||||
'inherits' : _Prop_inherits,
|
||||
}
|
||||
symbol_browser._privelemdict = {
|
||||
}
|
||||
ToolServer_worksheet._superclassnames = ['text_document']
|
||||
ToolServer_worksheet._privpropdict = {
|
||||
'inherits' : _Prop_inherits,
|
||||
}
|
||||
ToolServer_worksheet._privelemdict = {
|
||||
}
|
||||
target._superclassnames = []
|
||||
target._privpropdict = {
|
||||
'name' : _Prop_name,
|
||||
'project_document' : _Prop_project_document,
|
||||
}
|
||||
target._privelemdict = {
|
||||
'subtarget' : subtarget,
|
||||
'target_file' : target_file,
|
||||
}
|
||||
text_document._superclassnames = ['document']
|
||||
text_document._privpropdict = {
|
||||
'inherits' : _Prop_inherits,
|
||||
'modified' : _Prop_modified,
|
||||
'selection' : _Prop_selection,
|
||||
}
|
||||
text_document._privelemdict = {
|
||||
'character' : Standard_Suite.character,
|
||||
'insertion_point' : Standard_Suite.insertion_point,
|
||||
'line' : Standard_Suite.line,
|
||||
'text' : Standard_Suite.text,
|
||||
}
|
||||
_Enum_DKND = {
|
||||
'project' : 'PRJD', # a project document
|
||||
'editor_document' : 'EDIT', # an editor document
|
||||
'message' : 'MSSG', # a message document
|
||||
'file_compare' : 'COMP', # a file compare document
|
||||
'catalog_document' : 'CTLG', # a browser catalog
|
||||
'class_browser' : 'BROW', # a class browser document
|
||||
'single_class_browser' : '1BRW', # a single class browser document
|
||||
'symbol_browser' : 'SYMB', # a symbol browser document
|
||||
'class_hierarchy' : 'HIER', # a class hierarchy document
|
||||
'single_class_hierarchy' : '1HIR', # a single class hierarchy document
|
||||
'project_inspector' : 'INSP', # a project inspector
|
||||
'ToolServer_worksheet' : 'TOOL', # the ToolServer worksheet
|
||||
'build_progress_document' : 'PRGS', # the build progress window
|
||||
}
|
||||
|
||||
_Enum_FTYP = {
|
||||
'library_file' : 'LIBF', # a library file
|
||||
'project_file' : 'PRJF', # a project file
|
||||
'resource_file' : 'RESF', # a resource file
|
||||
'text_file' : 'TXTF', # a text file
|
||||
'unknown_file' : 'UNKN', # unknown file type
|
||||
}
|
||||
|
||||
_Enum_Inte = {
|
||||
'never_interact' : 'eNvr', # never allow user interactions
|
||||
'interact_with_self' : 'eInS', # allow user interaction only when an AppleEvent is sent from within CodeWarrior
|
||||
'interact_with_local' : 'eInL', # allow user interaction when AppleEvents are sent from applications on the same machine (default)
|
||||
'interact_with_all' : 'eInA', # allow user interaction from both local and remote AppleEvents
|
||||
}
|
||||
|
||||
_Enum_PERM = {
|
||||
'read_write' : 'RdWr', # the file is open with read/write permission
|
||||
'read_only' : 'Read', # the file is open with read/only permission
|
||||
'checked_out_read_write' : 'CkRW', # the file is checked out with read/write permission
|
||||
'checked_out_read_only' : 'CkRO', # the file is checked out with read/only permission
|
||||
'checked_out_read_modify' : 'CkRM', # the file is checked out with read/modify permission
|
||||
'locked' : 'Lock', # the file is locked on disk
|
||||
'none' : 'LNNO', # the file is new
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Indices of types declared in this module
|
||||
#
|
||||
_classdeclarations = {
|
||||
'1BRW' : single_class_browser,
|
||||
'1HIR' : single_class_hierarchy,
|
||||
'BROW' : class_browser,
|
||||
'COMP' : file_compare_document,
|
||||
'CTLG' : catalog_document,
|
||||
'EDIT' : editor_document,
|
||||
'HIER' : class_hierarchy,
|
||||
'INSP' : project_inspector,
|
||||
'MSSG' : message_document,
|
||||
'PRGS' : build_progress_document,
|
||||
'PRJD' : project_document,
|
||||
'SBTG' : subtarget,
|
||||
'SRCF' : target_file,
|
||||
'SYMB' : symbol_browser,
|
||||
'TOOL' : ToolServer_worksheet,
|
||||
'TRGT' : target,
|
||||
'TXTD' : text_document,
|
||||
}
|
||||
|
||||
_propdeclarations = {
|
||||
'CMPD' : _Prop_compiled_date,
|
||||
'CSZE' : _Prop_code_size,
|
||||
'CURT' : _Prop_current_target,
|
||||
'DBUG' : _Prop_debug,
|
||||
'DPND' : _Prop_dependents,
|
||||
'DSZE' : _Prop_data_size,
|
||||
'FILE' : _Prop_location,
|
||||
'FTYP' : _Prop_type,
|
||||
'ID ' : _Prop_id,
|
||||
'INIT' : _Prop_init_before,
|
||||
'LIDX' : _Prop_link_index,
|
||||
'LINK' : _Prop_linked,
|
||||
'LNKO' : _Prop_link_against_output,
|
||||
'MODD' : _Prop_modified_date,
|
||||
'MRGE' : _Prop_merge_output,
|
||||
'PRER' : _Prop_prerequisites,
|
||||
'Path' : _Prop_path,
|
||||
'PrjD' : _Prop_project_document,
|
||||
'TrgT' : _Prop_target,
|
||||
'WEAK' : _Prop_weak_link,
|
||||
'c@#^' : _Prop_inherits,
|
||||
'imod' : _Prop_modified,
|
||||
'pnam' : _Prop_name,
|
||||
'sele' : _Prop_selection,
|
||||
}
|
||||
|
||||
_compdeclarations = {
|
||||
}
|
||||
|
||||
_enumdeclarations = {
|
||||
'DKND' : _Enum_DKND,
|
||||
'FTYP' : _Enum_FTYP,
|
||||
'Inte' : _Enum_Inte,
|
||||
'PERM' : _Enum_PERM,
|
||||
}
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,62 @@
|
|||
"""Suite Required: Terms that every application should support
|
||||
Level 1, version 1
|
||||
|
||||
Generated from /Volumes/Sap/Applications (Mac OS 9)/Metrowerks CodeWarrior 7.0/Metrowerks CodeWarrior/CodeWarrior IDE 4.2.5
|
||||
AETE/AEUT resource version 1/0, language 0, script 0
|
||||
"""
|
||||
|
||||
import aetools
|
||||
import MacOS
|
||||
|
||||
_code = 'reqd'
|
||||
|
||||
from StdSuites.Required_Suite import *
|
||||
class Required_Events(Required_Suite_Events):
|
||||
|
||||
_argmap_open = {
|
||||
'converting' : 'Conv',
|
||||
}
|
||||
|
||||
def open(self, _object, _attributes={}, **_arguments):
|
||||
"""open: Open the specified object(s)
|
||||
Required argument: list of objects to open
|
||||
Keyword argument converting: Whether to convert project to latest version (yes/no; default is ask).
|
||||
Keyword argument _attributes: AppleEvent attribute dictionary
|
||||
"""
|
||||
_code = 'aevt'
|
||||
_subcode = 'odoc'
|
||||
|
||||
aetools.keysubst(_arguments, self._argmap_open)
|
||||
_arguments['----'] = _object
|
||||
|
||||
aetools.enumsubst(_arguments, 'Conv', _Enum_Conv)
|
||||
|
||||
_reply, _arguments, _attributes = self.send(_code, _subcode,
|
||||
_arguments, _attributes)
|
||||
if _arguments.get('errn', 0):
|
||||
raise aetools.Error, aetools.decodeerror(_arguments)
|
||||
# XXXX Optionally decode result
|
||||
if _arguments.has_key('----'):
|
||||
return _arguments['----']
|
||||
|
||||
_Enum_Conv = {
|
||||
'yes' : 'yes ', # Convert the project if necessary on open
|
||||
'no' : 'no ', # Do not convert the project if needed on open
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Indices of types declared in this module
|
||||
#
|
||||
_classdeclarations = {
|
||||
}
|
||||
|
||||
_propdeclarations = {
|
||||
}
|
||||
|
||||
_compdeclarations = {
|
||||
}
|
||||
|
||||
_enumdeclarations = {
|
||||
'Conv' : _Enum_Conv,
|
||||
}
|
||||
|
|
@ -0,0 +1,408 @@
|
|||
"""Suite Standard Suite: Common terms for most applications
|
||||
Level 1, version 1
|
||||
|
||||
Generated from /Volumes/Sap/Applications (Mac OS 9)/Metrowerks CodeWarrior 7.0/Metrowerks CodeWarrior/CodeWarrior IDE 4.2.5
|
||||
AETE/AEUT resource version 1/0, language 0, script 0
|
||||
"""
|
||||
|
||||
import aetools
|
||||
import MacOS
|
||||
|
||||
_code = 'CoRe'
|
||||
|
||||
from StdSuites.Standard_Suite import *
|
||||
class Standard_Suite_Events(Standard_Suite_Events):
|
||||
|
||||
_argmap_close = {
|
||||
'saving' : 'savo',
|
||||
'saving_in' : 'kfil',
|
||||
}
|
||||
|
||||
def close(self, _object, _attributes={}, **_arguments):
|
||||
"""close: close an object
|
||||
Required argument: the object to close
|
||||
Keyword argument saving: specifies whether or not changes should be saved before closing
|
||||
Keyword argument saving_in: the file in which to save the object
|
||||
Keyword argument _attributes: AppleEvent attribute dictionary
|
||||
"""
|
||||
_code = 'core'
|
||||
_subcode = 'clos'
|
||||
|
||||
aetools.keysubst(_arguments, self._argmap_close)
|
||||
_arguments['----'] = _object
|
||||
|
||||
aetools.enumsubst(_arguments, 'savo', _Enum_savo)
|
||||
|
||||
_reply, _arguments, _attributes = self.send(_code, _subcode,
|
||||
_arguments, _attributes)
|
||||
if _arguments.get('errn', 0):
|
||||
raise aetools.Error, aetools.decodeerror(_arguments)
|
||||
# XXXX Optionally decode result
|
||||
if _arguments.has_key('----'):
|
||||
return _arguments['----']
|
||||
|
||||
_argmap_count = {
|
||||
'each' : 'kocl',
|
||||
}
|
||||
|
||||
def count(self, _object, _attributes={}, **_arguments):
|
||||
"""count: return the number of elements of a particular class within an object
|
||||
Required argument: the object whose elements are to be counted
|
||||
Keyword argument each: the class of the elements to be counted. Keyword 'each' is optional in AppleScript
|
||||
Keyword argument _attributes: AppleEvent attribute dictionary
|
||||
Returns: the number of elements
|
||||
"""
|
||||
_code = 'core'
|
||||
_subcode = 'cnte'
|
||||
|
||||
aetools.keysubst(_arguments, self._argmap_count)
|
||||
_arguments['----'] = _object
|
||||
|
||||
|
||||
_reply, _arguments, _attributes = self.send(_code, _subcode,
|
||||
_arguments, _attributes)
|
||||
if _arguments.get('errn', 0):
|
||||
raise aetools.Error, aetools.decodeerror(_arguments)
|
||||
# XXXX Optionally decode result
|
||||
if _arguments.has_key('----'):
|
||||
return _arguments['----']
|
||||
|
||||
_argmap_get = {
|
||||
'as' : 'rtyp',
|
||||
}
|
||||
|
||||
def get(self, _object, _attributes={}, **_arguments):
|
||||
"""get: get the data for an object
|
||||
Required argument: the object whose data is to be returned
|
||||
Keyword argument as: the desired types for the data, in order of preference
|
||||
Keyword argument _attributes: AppleEvent attribute dictionary
|
||||
Returns: The data from the object
|
||||
"""
|
||||
_code = 'core'
|
||||
_subcode = 'getd'
|
||||
|
||||
aetools.keysubst(_arguments, self._argmap_get)
|
||||
_arguments['----'] = _object
|
||||
|
||||
|
||||
_reply, _arguments, _attributes = self.send(_code, _subcode,
|
||||
_arguments, _attributes)
|
||||
if _arguments.get('errn', 0):
|
||||
raise aetools.Error, aetools.decodeerror(_arguments)
|
||||
# XXXX Optionally decode result
|
||||
if _arguments.has_key('----'):
|
||||
return _arguments['----']
|
||||
|
||||
_argmap_make = {
|
||||
'new' : 'kocl',
|
||||
'as' : 'rtyp',
|
||||
'at' : 'insh',
|
||||
'with_data' : 'data',
|
||||
'with_properties' : 'prdt',
|
||||
}
|
||||
|
||||
def make(self, _no_object=None, _attributes={}, **_arguments):
|
||||
"""make: make a new element
|
||||
Keyword argument new: the class of the new element\xd1keyword 'new' is optional in AppleScript
|
||||
Keyword argument as: the desired types for the data, in order of preference
|
||||
Keyword argument at: the location at which to insert the element
|
||||
Keyword argument with_data: the initial data for the element
|
||||
Keyword argument with_properties: the initial values for the properties of the element
|
||||
Keyword argument _attributes: AppleEvent attribute dictionary
|
||||
Returns: to the new object(s)
|
||||
"""
|
||||
_code = 'core'
|
||||
_subcode = 'crel'
|
||||
|
||||
aetools.keysubst(_arguments, self._argmap_make)
|
||||
if _no_object is not None: raise TypeError, 'No direct arg expected'
|
||||
|
||||
|
||||
_reply, _arguments, _attributes = self.send(_code, _subcode,
|
||||
_arguments, _attributes)
|
||||
if _arguments.get('errn', 0):
|
||||
raise aetools.Error, aetools.decodeerror(_arguments)
|
||||
# XXXX Optionally decode result
|
||||
if _arguments.has_key('----'):
|
||||
return _arguments['----']
|
||||
|
||||
def select(self, _object=None, _attributes={}, **_arguments):
|
||||
"""select: select the specified object
|
||||
Required argument: the object to select
|
||||
Keyword argument _attributes: AppleEvent attribute dictionary
|
||||
"""
|
||||
_code = 'misc'
|
||||
_subcode = 'slct'
|
||||
|
||||
if _arguments: raise TypeError, 'No optional args expected'
|
||||
_arguments['----'] = _object
|
||||
|
||||
|
||||
_reply, _arguments, _attributes = self.send(_code, _subcode,
|
||||
_arguments, _attributes)
|
||||
if _arguments.get('errn', 0):
|
||||
raise aetools.Error, aetools.decodeerror(_arguments)
|
||||
# XXXX Optionally decode result
|
||||
if _arguments.has_key('----'):
|
||||
return _arguments['----']
|
||||
|
||||
_argmap_set = {
|
||||
'to' : 'data',
|
||||
}
|
||||
|
||||
def set(self, _object, _attributes={}, **_arguments):
|
||||
"""set: set an object's data
|
||||
Required argument: the object to change
|
||||
Keyword argument to: the new value
|
||||
Keyword argument _attributes: AppleEvent attribute dictionary
|
||||
"""
|
||||
_code = 'core'
|
||||
_subcode = 'setd'
|
||||
|
||||
aetools.keysubst(_arguments, self._argmap_set)
|
||||
_arguments['----'] = _object
|
||||
|
||||
|
||||
_reply, _arguments, _attributes = self.send(_code, _subcode,
|
||||
_arguments, _attributes)
|
||||
if _arguments.get('errn', 0):
|
||||
raise aetools.Error, aetools.decodeerror(_arguments)
|
||||
# XXXX Optionally decode result
|
||||
if _arguments.has_key('----'):
|
||||
return _arguments['----']
|
||||
|
||||
|
||||
class application(aetools.ComponentItem):
|
||||
"""application - an application program """
|
||||
want = 'capp'
|
||||
class _Prop_user_interaction(aetools.NProperty):
|
||||
"""user interaction - user interaction level """
|
||||
which = 'inte'
|
||||
want = 'Inte'
|
||||
user_interaction = _Prop_user_interaction()
|
||||
# element 'cwin' as ['indx', 'name', 'rang']
|
||||
# element 'docu' as ['indx', 'name', 'rang']
|
||||
|
||||
class character(aetools.ComponentItem):
|
||||
"""character - a character """
|
||||
want = 'cha '
|
||||
class _Prop_length(aetools.NProperty):
|
||||
"""length - length in characters of this object """
|
||||
which = 'pLen'
|
||||
want = 'long'
|
||||
class _Prop_offset(aetools.NProperty):
|
||||
"""offset - offset of a text object from the beginning of the document (first char has offset 1) """
|
||||
which = 'pOff'
|
||||
want = 'long'
|
||||
|
||||
class insertion_point(aetools.ComponentItem):
|
||||
"""insertion point - An insertion location between two objects """
|
||||
want = 'cins'
|
||||
|
||||
class line(aetools.ComponentItem):
|
||||
"""line - lines of text """
|
||||
want = 'clin'
|
||||
class _Prop_index(aetools.NProperty):
|
||||
"""index - index of a line object from the beginning of the document (first line has index 1) """
|
||||
which = 'pidx'
|
||||
want = 'long'
|
||||
# element 'cha ' as ['indx', 'rang', 'rele']
|
||||
|
||||
lines = line
|
||||
|
||||
class selection_2d_object(aetools.ComponentItem):
|
||||
"""selection-object - the selection visible to the user """
|
||||
want = 'csel'
|
||||
class _Prop_contents(aetools.NProperty):
|
||||
"""contents - the contents of the selection """
|
||||
which = 'pcnt'
|
||||
want = 'type'
|
||||
# element 'cha ' as ['indx', 'rele', 'rang', 'test']
|
||||
# element 'clin' as ['indx', 'rang', 'rele']
|
||||
# element 'ctxt' as ['rang']
|
||||
|
||||
class text(aetools.ComponentItem):
|
||||
"""text - Text """
|
||||
want = 'ctxt'
|
||||
# element 'cha ' as ['indx', 'rele', 'rang']
|
||||
# element 'cins' as ['rele']
|
||||
# element 'clin' as ['indx', 'rang', 'rele']
|
||||
# element 'ctxt' as ['rang']
|
||||
|
||||
class window(aetools.ComponentItem):
|
||||
"""window - A window """
|
||||
want = 'cwin'
|
||||
class _Prop_bounds(aetools.NProperty):
|
||||
"""bounds - the boundary rectangle for the window """
|
||||
which = 'pbnd'
|
||||
want = 'qdrt'
|
||||
class _Prop_document(aetools.NProperty):
|
||||
"""document - the document that owns this window """
|
||||
which = 'docu'
|
||||
want = 'docu'
|
||||
class _Prop_name(aetools.NProperty):
|
||||
"""name - the title of the window """
|
||||
which = 'pnam'
|
||||
want = 'itxt'
|
||||
class _Prop_position(aetools.NProperty):
|
||||
"""position - upper left coordinates of window """
|
||||
which = 'ppos'
|
||||
want = 'QDpt'
|
||||
class _Prop_visible(aetools.NProperty):
|
||||
"""visible - is the window visible? """
|
||||
which = 'pvis'
|
||||
want = 'bool'
|
||||
class _Prop_zoomed(aetools.NProperty):
|
||||
"""zoomed - Is the window zoomed? """
|
||||
which = 'pzum'
|
||||
want = 'bool'
|
||||
|
||||
windows = window
|
||||
|
||||
class document(aetools.ComponentItem):
|
||||
"""document - a document """
|
||||
want = 'docu'
|
||||
class _Prop_file_permissions(aetools.NProperty):
|
||||
"""file permissions - the file permissions for the document """
|
||||
which = 'PERM'
|
||||
want = 'PERM'
|
||||
class _Prop_kind(aetools.NProperty):
|
||||
"""kind - the kind of document """
|
||||
which = 'DKND'
|
||||
want = 'DKND'
|
||||
class _Prop_location(aetools.NProperty):
|
||||
"""location - the file of the document """
|
||||
which = 'FILE'
|
||||
want = 'fss '
|
||||
class _Prop_window(aetools.NProperty):
|
||||
"""window - the window of the document. """
|
||||
which = 'cwin'
|
||||
want = 'cwin'
|
||||
|
||||
documents = document
|
||||
|
||||
class files(aetools.ComponentItem):
|
||||
"""files - Every file """
|
||||
want = 'file'
|
||||
|
||||
file = files
|
||||
application._superclassnames = []
|
||||
application._privpropdict = {
|
||||
'user_interaction' : _Prop_user_interaction,
|
||||
}
|
||||
application._privelemdict = {
|
||||
'document' : document,
|
||||
'window' : window,
|
||||
}
|
||||
character._superclassnames = []
|
||||
character._privpropdict = {
|
||||
'length' : _Prop_length,
|
||||
'offset' : _Prop_offset,
|
||||
}
|
||||
character._privelemdict = {
|
||||
}
|
||||
insertion_point._superclassnames = []
|
||||
insertion_point._privpropdict = {
|
||||
'length' : _Prop_length,
|
||||
'offset' : _Prop_offset,
|
||||
}
|
||||
insertion_point._privelemdict = {
|
||||
}
|
||||
line._superclassnames = []
|
||||
line._privpropdict = {
|
||||
'index' : _Prop_index,
|
||||
'length' : _Prop_length,
|
||||
'offset' : _Prop_offset,
|
||||
}
|
||||
line._privelemdict = {
|
||||
'character' : character,
|
||||
}
|
||||
selection_2d_object._superclassnames = []
|
||||
selection_2d_object._privpropdict = {
|
||||
'contents' : _Prop_contents,
|
||||
'length' : _Prop_length,
|
||||
'offset' : _Prop_offset,
|
||||
}
|
||||
selection_2d_object._privelemdict = {
|
||||
'character' : character,
|
||||
'line' : line,
|
||||
'text' : text,
|
||||
}
|
||||
text._superclassnames = []
|
||||
text._privpropdict = {
|
||||
'length' : _Prop_length,
|
||||
'offset' : _Prop_offset,
|
||||
}
|
||||
text._privelemdict = {
|
||||
'character' : character,
|
||||
'insertion_point' : insertion_point,
|
||||
'line' : line,
|
||||
'text' : text,
|
||||
}
|
||||
window._superclassnames = []
|
||||
window._privpropdict = {
|
||||
'bounds' : _Prop_bounds,
|
||||
'document' : _Prop_document,
|
||||
'index' : _Prop_index,
|
||||
'name' : _Prop_name,
|
||||
'position' : _Prop_position,
|
||||
'visible' : _Prop_visible,
|
||||
'zoomed' : _Prop_zoomed,
|
||||
}
|
||||
window._privelemdict = {
|
||||
}
|
||||
document._superclassnames = []
|
||||
document._privpropdict = {
|
||||
'file_permissions' : _Prop_file_permissions,
|
||||
'index' : _Prop_index,
|
||||
'kind' : _Prop_kind,
|
||||
'location' : _Prop_location,
|
||||
'name' : _Prop_name,
|
||||
'window' : _Prop_window,
|
||||
}
|
||||
document._privelemdict = {
|
||||
}
|
||||
files._superclassnames = []
|
||||
files._privpropdict = {
|
||||
}
|
||||
files._privelemdict = {
|
||||
}
|
||||
|
||||
#
|
||||
# Indices of types declared in this module
|
||||
#
|
||||
_classdeclarations = {
|
||||
'capp' : application,
|
||||
'cha ' : character,
|
||||
'cins' : insertion_point,
|
||||
'clin' : line,
|
||||
'csel' : selection_2d_object,
|
||||
'ctxt' : text,
|
||||
'cwin' : window,
|
||||
'docu' : document,
|
||||
'file' : files,
|
||||
}
|
||||
|
||||
_propdeclarations = {
|
||||
'DKND' : _Prop_kind,
|
||||
'FILE' : _Prop_location,
|
||||
'PERM' : _Prop_file_permissions,
|
||||
'cwin' : _Prop_window,
|
||||
'docu' : _Prop_document,
|
||||
'inte' : _Prop_user_interaction,
|
||||
'pLen' : _Prop_length,
|
||||
'pOff' : _Prop_offset,
|
||||
'pbnd' : _Prop_bounds,
|
||||
'pcnt' : _Prop_contents,
|
||||
'pidx' : _Prop_index,
|
||||
'pnam' : _Prop_name,
|
||||
'ppos' : _Prop_position,
|
||||
'pvis' : _Prop_visible,
|
||||
'pzum' : _Prop_zoomed,
|
||||
}
|
||||
|
||||
_compdeclarations = {
|
||||
}
|
||||
|
||||
_enumdeclarations = {
|
||||
}
|
||||
|
|
@ -0,0 +1,193 @@
|
|||
"""
|
||||
Package generated from /Volumes/Sap/Applications (Mac OS 9)/Metrowerks CodeWarrior 7.0/Metrowerks CodeWarrior/CodeWarrior IDE 4.2.5
|
||||
"""
|
||||
|
||||
from warnings import warnpy3k
|
||||
warnpy3k("In 3.x, the CodeWarrior package is removed.", stacklevel=2)
|
||||
|
||||
import aetools
|
||||
Error = aetools.Error
|
||||
import CodeWarrior_suite
|
||||
import Standard_Suite
|
||||
import Metrowerks_Shell_Suite
|
||||
import Required
|
||||
|
||||
|
||||
_code_to_module = {
|
||||
'CWIE' : CodeWarrior_suite,
|
||||
'CoRe' : Standard_Suite,
|
||||
'MMPR' : Metrowerks_Shell_Suite,
|
||||
'reqd' : Required,
|
||||
}
|
||||
|
||||
|
||||
|
||||
_code_to_fullname = {
|
||||
'CWIE' : ('CodeWarrior.CodeWarrior_suite', 'CodeWarrior_suite'),
|
||||
'CoRe' : ('CodeWarrior.Standard_Suite', 'Standard_Suite'),
|
||||
'MMPR' : ('CodeWarrior.Metrowerks_Shell_Suite', 'Metrowerks_Shell_Suite'),
|
||||
'reqd' : ('CodeWarrior.Required', 'Required'),
|
||||
}
|
||||
|
||||
from CodeWarrior_suite import *
|
||||
from Standard_Suite import *
|
||||
from Metrowerks_Shell_Suite import *
|
||||
from Required import *
|
||||
|
||||
def getbaseclasses(v):
|
||||
if not getattr(v, '_propdict', None):
|
||||
v._propdict = {}
|
||||
v._elemdict = {}
|
||||
for superclassname in getattr(v, '_superclassnames', []):
|
||||
superclass = eval(superclassname)
|
||||
getbaseclasses(superclass)
|
||||
v._propdict.update(getattr(superclass, '_propdict', {}))
|
||||
v._elemdict.update(getattr(superclass, '_elemdict', {}))
|
||||
v._propdict.update(getattr(v, '_privpropdict', {}))
|
||||
v._elemdict.update(getattr(v, '_privelemdict', {}))
|
||||
|
||||
import StdSuites
|
||||
|
||||
#
|
||||
# Set property and element dictionaries now that all classes have been defined
|
||||
#
|
||||
getbaseclasses(character)
|
||||
getbaseclasses(selection_2d_object)
|
||||
getbaseclasses(application)
|
||||
getbaseclasses(document)
|
||||
getbaseclasses(text)
|
||||
getbaseclasses(window)
|
||||
getbaseclasses(file)
|
||||
getbaseclasses(line)
|
||||
getbaseclasses(insertion_point)
|
||||
getbaseclasses(single_class_browser)
|
||||
getbaseclasses(project_document)
|
||||
getbaseclasses(symbol_browser)
|
||||
getbaseclasses(editor_document)
|
||||
getbaseclasses(file_compare_document)
|
||||
getbaseclasses(class_browser)
|
||||
getbaseclasses(subtarget)
|
||||
getbaseclasses(message_document)
|
||||
getbaseclasses(project_inspector)
|
||||
getbaseclasses(text_document)
|
||||
getbaseclasses(catalog_document)
|
||||
getbaseclasses(class_hierarchy)
|
||||
getbaseclasses(target)
|
||||
getbaseclasses(build_progress_document)
|
||||
getbaseclasses(target_file)
|
||||
getbaseclasses(ToolServer_worksheet)
|
||||
getbaseclasses(single_class_hierarchy)
|
||||
getbaseclasses(File_Mapping)
|
||||
getbaseclasses(browser_catalog)
|
||||
getbaseclasses(Build_Settings)
|
||||
getbaseclasses(ProjectFile)
|
||||
getbaseclasses(VCS_Setup)
|
||||
getbaseclasses(data_member)
|
||||
getbaseclasses(Shielded_Folder)
|
||||
getbaseclasses(Custom_Keywords)
|
||||
getbaseclasses(Path_Information)
|
||||
getbaseclasses(Segment)
|
||||
getbaseclasses(Source_Tree)
|
||||
getbaseclasses(Access_Paths)
|
||||
getbaseclasses(Debugger_Windowing)
|
||||
getbaseclasses(Relative_Path)
|
||||
getbaseclasses(Environment_Variable)
|
||||
getbaseclasses(base_class)
|
||||
getbaseclasses(Debugger_Display)
|
||||
getbaseclasses(Build_Extras)
|
||||
getbaseclasses(Error_Information)
|
||||
getbaseclasses(Editor)
|
||||
getbaseclasses(Shielded_Folders)
|
||||
getbaseclasses(Extras)
|
||||
getbaseclasses(File_Mappings)
|
||||
getbaseclasses(Function_Information)
|
||||
getbaseclasses(Debugger_Target)
|
||||
getbaseclasses(Syntax_Coloring)
|
||||
getbaseclasses(class_)
|
||||
getbaseclasses(Global_Source_Trees)
|
||||
getbaseclasses(Target_Settings)
|
||||
getbaseclasses(Debugger_Global)
|
||||
getbaseclasses(member_function)
|
||||
getbaseclasses(Runtime_Settings)
|
||||
getbaseclasses(Plugin_Settings)
|
||||
getbaseclasses(Browser_Coloring)
|
||||
getbaseclasses(Font)
|
||||
getbaseclasses(Target_Source_Trees)
|
||||
|
||||
#
|
||||
# Indices of types declared in this module
|
||||
#
|
||||
_classdeclarations = {
|
||||
'cha ' : character,
|
||||
'csel' : selection_2d_object,
|
||||
'capp' : application,
|
||||
'docu' : document,
|
||||
'ctxt' : text,
|
||||
'cwin' : window,
|
||||
'file' : file,
|
||||
'clin' : line,
|
||||
'cins' : insertion_point,
|
||||
'1BRW' : single_class_browser,
|
||||
'PRJD' : project_document,
|
||||
'SYMB' : symbol_browser,
|
||||
'EDIT' : editor_document,
|
||||
'COMP' : file_compare_document,
|
||||
'BROW' : class_browser,
|
||||
'SBTG' : subtarget,
|
||||
'MSSG' : message_document,
|
||||
'INSP' : project_inspector,
|
||||
'TXTD' : text_document,
|
||||
'CTLG' : catalog_document,
|
||||
'HIER' : class_hierarchy,
|
||||
'TRGT' : target,
|
||||
'PRGS' : build_progress_document,
|
||||
'SRCF' : target_file,
|
||||
'TOOL' : ToolServer_worksheet,
|
||||
'1HIR' : single_class_hierarchy,
|
||||
'FMap' : File_Mapping,
|
||||
'Cata' : browser_catalog,
|
||||
'BSTG' : Build_Settings,
|
||||
'SrcF' : ProjectFile,
|
||||
'VCSs' : VCS_Setup,
|
||||
'DtMb' : data_member,
|
||||
'SFit' : Shielded_Folder,
|
||||
'CUKW' : Custom_Keywords,
|
||||
'PInf' : Path_Information,
|
||||
'Seg ' : Segment,
|
||||
'SrcT' : Source_Tree,
|
||||
'PATH' : Access_Paths,
|
||||
'DbWN' : Debugger_Windowing,
|
||||
'RlPt' : Relative_Path,
|
||||
'EnvV' : Environment_Variable,
|
||||
'BsCl' : base_class,
|
||||
'DbDS' : Debugger_Display,
|
||||
'LXTR' : Build_Extras,
|
||||
'ErrM' : Error_Information,
|
||||
'EDTR' : Editor,
|
||||
'SHFL' : Shielded_Folders,
|
||||
'GXTR' : Extras,
|
||||
'FLMP' : File_Mappings,
|
||||
'FDef' : Function_Information,
|
||||
'DbTG' : Debugger_Target,
|
||||
'SNTX' : Syntax_Coloring,
|
||||
'Clas' : class_,
|
||||
'GSTs' : Global_Source_Trees,
|
||||
'TARG' : Target_Settings,
|
||||
'DbGL' : Debugger_Global,
|
||||
'MbFn' : member_function,
|
||||
'RSTG' : Runtime_Settings,
|
||||
'PSTG' : Plugin_Settings,
|
||||
'BRKW' : Browser_Coloring,
|
||||
'mFNT' : Font,
|
||||
'TSTs' : Target_Source_Trees,
|
||||
}
|
||||
|
||||
|
||||
class CodeWarrior(CodeWarrior_suite_Events,
|
||||
Standard_Suite_Events,
|
||||
Metrowerks_Shell_Suite_Events,
|
||||
Required_Events,
|
||||
aetools.TalkTo):
|
||||
_signature = 'CWIE'
|
||||
|
||||
_moduleName = 'CodeWarrior'
|
||||
|
|
@ -0,0 +1,96 @@
|
|||
"""Suite Microsoft Internet Explorer Suite: Events defined by Internet Explorer
|
||||
Level 1, version 1
|
||||
|
||||
Generated from /Applications/Internet Explorer.app
|
||||
AETE/AEUT resource version 1/0, language 0, script 0
|
||||
"""
|
||||
|
||||
import aetools
|
||||
import MacOS
|
||||
|
||||
_code = 'MSIE'
|
||||
|
||||
class Microsoft_Internet_Explorer_Events:
|
||||
|
||||
def GetSource(self, _object=None, _attributes={}, **_arguments):
|
||||
"""GetSource: Get the HTML source of a browser window
|
||||
Required argument: Window Identifier of window from which to get the source. No value means get the source from the frontmost window.
|
||||
Keyword argument _attributes: AppleEvent attribute dictionary
|
||||
Returns: undocumented, typecode 'TEXT'
|
||||
"""
|
||||
_code = 'MSIE'
|
||||
_subcode = 'SORC'
|
||||
|
||||
if _arguments: raise TypeError, 'No optional args expected'
|
||||
_arguments['----'] = _object
|
||||
|
||||
|
||||
_reply, _arguments, _attributes = self.send(_code, _subcode,
|
||||
_arguments, _attributes)
|
||||
if _arguments.get('errn', 0):
|
||||
raise aetools.Error, aetools.decodeerror(_arguments)
|
||||
# XXXX Optionally decode result
|
||||
if _arguments.has_key('----'):
|
||||
return _arguments['----']
|
||||
|
||||
def PrintBrowserWindow(self, _object=None, _attributes={}, **_arguments):
|
||||
"""PrintBrowserWindow: Print contents of browser window (HTML)
|
||||
Required argument: Window Identifier of the window to print. No value means print the frontmost browser window.
|
||||
Keyword argument _attributes: AppleEvent attribute dictionary
|
||||
"""
|
||||
_code = 'misc'
|
||||
_subcode = 'pWND'
|
||||
|
||||
if _arguments: raise TypeError, 'No optional args expected'
|
||||
_arguments['----'] = _object
|
||||
|
||||
|
||||
_reply, _arguments, _attributes = self.send(_code, _subcode,
|
||||
_arguments, _attributes)
|
||||
if _arguments.get('errn', 0):
|
||||
raise aetools.Error, aetools.decodeerror(_arguments)
|
||||
# XXXX Optionally decode result
|
||||
if _arguments.has_key('----'):
|
||||
return _arguments['----']
|
||||
|
||||
_argmap_do_script = {
|
||||
'window' : 'WIND',
|
||||
}
|
||||
|
||||
def do_script(self, _object, _attributes={}, **_arguments):
|
||||
"""do script: Execute script commands
|
||||
Required argument: JavaScript text to execute
|
||||
Keyword argument window: optional Window Identifier (as supplied by the ListWindows event) specifying context in which to execute the script
|
||||
Keyword argument _attributes: AppleEvent attribute dictionary
|
||||
Returns: Return value
|
||||
"""
|
||||
_code = 'misc'
|
||||
_subcode = 'dosc'
|
||||
|
||||
aetools.keysubst(_arguments, self._argmap_do_script)
|
||||
_arguments['----'] = _object
|
||||
|
||||
|
||||
_reply, _arguments, _attributes = self.send(_code, _subcode,
|
||||
_arguments, _attributes)
|
||||
if _arguments.get('errn', 0):
|
||||
raise aetools.Error, aetools.decodeerror(_arguments)
|
||||
# XXXX Optionally decode result
|
||||
if _arguments.has_key('----'):
|
||||
return _arguments['----']
|
||||
|
||||
|
||||
#
|
||||
# Indices of types declared in this module
|
||||
#
|
||||
_classdeclarations = {
|
||||
}
|
||||
|
||||
_propdeclarations = {
|
||||
}
|
||||
|
||||
_compdeclarations = {
|
||||
}
|
||||
|
||||
_enumdeclarations = {
|
||||
}
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
"""Suite Netscape Suite: Events defined by Netscape
|
||||
Level 1, version 1
|
||||
|
||||
Generated from /Applications/Internet Explorer.app
|
||||
AETE/AEUT resource version 1/0, language 0, script 0
|
||||
"""
|
||||
|
||||
import aetools
|
||||
import MacOS
|
||||
|
||||
_code = 'MOSS'
|
||||
|
||||
class Netscape_Suite_Events:
|
||||
|
||||
def Open_bookmark(self, _object=None, _attributes={}, **_arguments):
|
||||
"""Open bookmark: Opens a bookmark file
|
||||
Required argument: If not available, reloads the current bookmark file
|
||||
Keyword argument _attributes: AppleEvent attribute dictionary
|
||||
"""
|
||||
_code = 'MOSS'
|
||||
_subcode = 'book'
|
||||
|
||||
if _arguments: raise TypeError, 'No optional args expected'
|
||||
_arguments['----'] = _object
|
||||
|
||||
|
||||
_reply, _arguments, _attributes = self.send(_code, _subcode,
|
||||
_arguments, _attributes)
|
||||
if _arguments.get('errn', 0):
|
||||
raise aetools.Error, aetools.decodeerror(_arguments)
|
||||
# XXXX Optionally decode result
|
||||
if _arguments.has_key('----'):
|
||||
return _arguments['----']
|
||||
|
||||
|
||||
#
|
||||
# Indices of types declared in this module
|
||||
#
|
||||
_classdeclarations = {
|
||||
}
|
||||
|
||||
_propdeclarations = {
|
||||
}
|
||||
|
||||
_compdeclarations = {
|
||||
}
|
||||
|
||||
_enumdeclarations = {
|
||||
}
|
||||
|
|
@ -0,0 +1,108 @@
|
|||
"""Suite Required Suite: Events that every application should support
|
||||
Level 1, version 1
|
||||
|
||||
Generated from /Applications/Internet Explorer.app
|
||||
AETE/AEUT resource version 1/0, language 0, script 0
|
||||
"""
|
||||
|
||||
import aetools
|
||||
import MacOS
|
||||
|
||||
_code = 'reqd'
|
||||
|
||||
from StdSuites.Required_Suite import *
|
||||
class Required_Suite_Events(Required_Suite_Events):
|
||||
|
||||
def open(self, _object, _attributes={}, **_arguments):
|
||||
"""open: Open documents
|
||||
Required argument: undocumented, typecode 'alis'
|
||||
Keyword argument _attributes: AppleEvent attribute dictionary
|
||||
"""
|
||||
_code = 'aevt'
|
||||
_subcode = 'odoc'
|
||||
|
||||
if _arguments: raise TypeError, 'No optional args expected'
|
||||
_arguments['----'] = _object
|
||||
|
||||
|
||||
_reply, _arguments, _attributes = self.send(_code, _subcode,
|
||||
_arguments, _attributes)
|
||||
if _arguments.get('errn', 0):
|
||||
raise aetools.Error, aetools.decodeerror(_arguments)
|
||||
# XXXX Optionally decode result
|
||||
if _arguments.has_key('----'):
|
||||
return _arguments['----']
|
||||
|
||||
def print_(self, _object, _attributes={}, **_arguments):
|
||||
"""print: Print documents
|
||||
Required argument: undocumented, typecode 'alis'
|
||||
Keyword argument _attributes: AppleEvent attribute dictionary
|
||||
"""
|
||||
_code = 'aevt'
|
||||
_subcode = 'pdoc'
|
||||
|
||||
if _arguments: raise TypeError, 'No optional args expected'
|
||||
_arguments['----'] = _object
|
||||
|
||||
|
||||
_reply, _arguments, _attributes = self.send(_code, _subcode,
|
||||
_arguments, _attributes)
|
||||
if _arguments.get('errn', 0):
|
||||
raise aetools.Error, aetools.decodeerror(_arguments)
|
||||
# XXXX Optionally decode result
|
||||
if _arguments.has_key('----'):
|
||||
return _arguments['----']
|
||||
|
||||
def quit(self, _no_object=None, _attributes={}, **_arguments):
|
||||
"""quit: Quit application
|
||||
Keyword argument _attributes: AppleEvent attribute dictionary
|
||||
"""
|
||||
_code = 'aevt'
|
||||
_subcode = 'quit'
|
||||
|
||||
if _arguments: raise TypeError, 'No optional args expected'
|
||||
if _no_object is not None: raise TypeError, 'No direct arg expected'
|
||||
|
||||
|
||||
_reply, _arguments, _attributes = self.send(_code, _subcode,
|
||||
_arguments, _attributes)
|
||||
if _arguments.get('errn', 0):
|
||||
raise aetools.Error, aetools.decodeerror(_arguments)
|
||||
# XXXX Optionally decode result
|
||||
if _arguments.has_key('----'):
|
||||
return _arguments['----']
|
||||
|
||||
def run(self, _no_object=None, _attributes={}, **_arguments):
|
||||
"""run:
|
||||
Keyword argument _attributes: AppleEvent attribute dictionary
|
||||
"""
|
||||
_code = 'aevt'
|
||||
_subcode = 'oapp'
|
||||
|
||||
if _arguments: raise TypeError, 'No optional args expected'
|
||||
if _no_object is not None: raise TypeError, 'No direct arg expected'
|
||||
|
||||
|
||||
_reply, _arguments, _attributes = self.send(_code, _subcode,
|
||||
_arguments, _attributes)
|
||||
if _arguments.get('errn', 0):
|
||||
raise aetools.Error, aetools.decodeerror(_arguments)
|
||||
# XXXX Optionally decode result
|
||||
if _arguments.has_key('----'):
|
||||
return _arguments['----']
|
||||
|
||||
|
||||
#
|
||||
# Indices of types declared in this module
|
||||
#
|
||||
_classdeclarations = {
|
||||
}
|
||||
|
||||
_propdeclarations = {
|
||||
}
|
||||
|
||||
_compdeclarations = {
|
||||
}
|
||||
|
||||
_enumdeclarations = {
|
||||
}
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
"""Suite Standard Suite: Common terms for most applications
|
||||
Level 1, version 1
|
||||
|
||||
Generated from /Applications/Internet Explorer.app
|
||||
AETE/AEUT resource version 1/0, language 0, script 0
|
||||
"""
|
||||
|
||||
import aetools
|
||||
import MacOS
|
||||
|
||||
_code = '****'
|
||||
|
||||
class Standard_Suite_Events:
|
||||
|
||||
_argmap_get = {
|
||||
'as' : 'rtyp',
|
||||
}
|
||||
|
||||
def get(self, _object, _attributes={}, **_arguments):
|
||||
"""get:
|
||||
Required argument: an AE object reference
|
||||
Keyword argument as: undocumented, typecode 'type'
|
||||
Keyword argument _attributes: AppleEvent attribute dictionary
|
||||
Returns: anything
|
||||
"""
|
||||
_code = 'core'
|
||||
_subcode = 'getd'
|
||||
|
||||
aetools.keysubst(_arguments, self._argmap_get)
|
||||
_arguments['----'] = _object
|
||||
|
||||
|
||||
_reply, _arguments, _attributes = self.send(_code, _subcode,
|
||||
_arguments, _attributes)
|
||||
if _arguments.get('errn', 0):
|
||||
raise aetools.Error, aetools.decodeerror(_arguments)
|
||||
# XXXX Optionally decode result
|
||||
if _arguments.has_key('----'):
|
||||
return _arguments['----']
|
||||
|
||||
|
||||
class application(aetools.ComponentItem):
|
||||
"""application - An application program """
|
||||
want = 'capp'
|
||||
class _Prop_selected_text(aetools.NProperty):
|
||||
"""selected text - the selected text """
|
||||
which = 'stxt'
|
||||
want = 'TEXT'
|
||||
selected_text = _Prop_selected_text()
|
||||
application._superclassnames = []
|
||||
application._privpropdict = {
|
||||
'selected_text' : _Prop_selected_text,
|
||||
}
|
||||
application._privelemdict = {
|
||||
}
|
||||
|
||||
#
|
||||
# Indices of types declared in this module
|
||||
#
|
||||
_classdeclarations = {
|
||||
'capp' : application,
|
||||
}
|
||||
|
||||
_propdeclarations = {
|
||||
'stxt' : _Prop_selected_text,
|
||||
}
|
||||
|
||||
_compdeclarations = {
|
||||
}
|
||||
|
||||
_enumdeclarations = {
|
||||
}
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
"""Suite URL Suite: Standard suite for Uniform Resource Locators
|
||||
Level 1, version 1
|
||||
|
||||
Generated from /Applications/Internet Explorer.app
|
||||
AETE/AEUT resource version 1/0, language 0, script 0
|
||||
"""
|
||||
|
||||
import aetools
|
||||
import MacOS
|
||||
|
||||
_code = 'GURL'
|
||||
|
||||
class URL_Suite_Events:
|
||||
|
||||
_argmap_GetURL = {
|
||||
'to' : 'dest',
|
||||
}
|
||||
|
||||
def GetURL(self, _object, _attributes={}, **_arguments):
|
||||
"""GetURL: Open the URL (and optionally save it to disk)
|
||||
Required argument: URL to open
|
||||
Keyword argument to: File into which to save resource located at URL.
|
||||
Keyword argument _attributes: AppleEvent attribute dictionary
|
||||
"""
|
||||
_code = 'GURL'
|
||||
_subcode = 'GURL'
|
||||
|
||||
aetools.keysubst(_arguments, self._argmap_GetURL)
|
||||
_arguments['----'] = _object
|
||||
|
||||
|
||||
_reply, _arguments, _attributes = self.send(_code, _subcode,
|
||||
_arguments, _attributes)
|
||||
if _arguments.get('errn', 0):
|
||||
raise aetools.Error, aetools.decodeerror(_arguments)
|
||||
# XXXX Optionally decode result
|
||||
if _arguments.has_key('----'):
|
||||
return _arguments['----']
|
||||
|
||||
|
||||
#
|
||||
# Indices of types declared in this module
|
||||
#
|
||||
_classdeclarations = {
|
||||
}
|
||||
|
||||
_propdeclarations = {
|
||||
}
|
||||
|
||||
_compdeclarations = {
|
||||
}
|
||||
|
||||
_enumdeclarations = {
|
||||
}
|
||||
|
|
@ -0,0 +1,226 @@
|
|||
"""Suite Web Browser Suite: Class of events supported by Web Browser applications
|
||||
Level 1, version 1
|
||||
|
||||
Generated from /Applications/Internet Explorer.app
|
||||
AETE/AEUT resource version 1/0, language 0, script 0
|
||||
"""
|
||||
|
||||
import aetools
|
||||
import MacOS
|
||||
|
||||
_code = 'WWW!'
|
||||
|
||||
class Web_Browser_Suite_Events:
|
||||
|
||||
def Activate(self, _object=None, _attributes={}, **_arguments):
|
||||
"""Activate: Activate Internet Explorer and optionally select window designated by Window Identifier.
|
||||
Required argument: Window Identifier
|
||||
Keyword argument _attributes: AppleEvent attribute dictionary
|
||||
Returns: Window Identifier of window to activate
|
||||
"""
|
||||
_code = 'WWW!'
|
||||
_subcode = 'ACTV'
|
||||
|
||||
if _arguments: raise TypeError, 'No optional args expected'
|
||||
_arguments['----'] = _object
|
||||
|
||||
|
||||
_reply, _arguments, _attributes = self.send(_code, _subcode,
|
||||
_arguments, _attributes)
|
||||
if _arguments.get('errn', 0):
|
||||
raise aetools.Error, aetools.decodeerror(_arguments)
|
||||
# XXXX Optionally decode result
|
||||
if _arguments.has_key('----'):
|
||||
return _arguments['----']
|
||||
|
||||
def CloseAllWindows(self, _no_object=None, _attributes={}, **_arguments):
|
||||
"""CloseAllWindows: Closes all windows
|
||||
Keyword argument _attributes: AppleEvent attribute dictionary
|
||||
Returns: Success
|
||||
"""
|
||||
_code = 'WWW!'
|
||||
_subcode = 'CLSA'
|
||||
|
||||
if _arguments: raise TypeError, 'No optional args expected'
|
||||
if _no_object is not None: raise TypeError, 'No direct arg expected'
|
||||
|
||||
|
||||
_reply, _arguments, _attributes = self.send(_code, _subcode,
|
||||
_arguments, _attributes)
|
||||
if _arguments.get('errn', 0):
|
||||
raise aetools.Error, aetools.decodeerror(_arguments)
|
||||
# XXXX Optionally decode result
|
||||
if _arguments.has_key('----'):
|
||||
return _arguments['----']
|
||||
|
||||
_argmap_CloseWindow = {
|
||||
'ID' : 'WIND',
|
||||
'Title' : 'TITL',
|
||||
}
|
||||
|
||||
def CloseWindow(self, _no_object=None, _attributes={}, **_arguments):
|
||||
"""CloseWindow: Close the window specified by either Window Identifier or Title. If no parameter is specified, close the top window.
|
||||
Keyword argument ID: ID of the window to close. (Can use -1 for top window)
|
||||
Keyword argument Title: Title of the window to close
|
||||
Keyword argument _attributes: AppleEvent attribute dictionary
|
||||
Returns: Success
|
||||
"""
|
||||
_code = 'WWW!'
|
||||
_subcode = 'CLOS'
|
||||
|
||||
aetools.keysubst(_arguments, self._argmap_CloseWindow)
|
||||
if _no_object is not None: raise TypeError, 'No direct arg expected'
|
||||
|
||||
|
||||
_reply, _arguments, _attributes = self.send(_code, _subcode,
|
||||
_arguments, _attributes)
|
||||
if _arguments.get('errn', 0):
|
||||
raise aetools.Error, aetools.decodeerror(_arguments)
|
||||
# XXXX Optionally decode result
|
||||
if _arguments.has_key('----'):
|
||||
return _arguments['----']
|
||||
|
||||
def GetWindowInfo(self, _object, _attributes={}, **_arguments):
|
||||
"""GetWindowInfo: Returns a window info record (URL/Title) for the specified window.
|
||||
Required argument: Window Identifier of the window
|
||||
Keyword argument _attributes: AppleEvent attribute dictionary
|
||||
Returns:
|
||||
"""
|
||||
_code = 'WWW!'
|
||||
_subcode = 'WNFO'
|
||||
|
||||
if _arguments: raise TypeError, 'No optional args expected'
|
||||
_arguments['----'] = _object
|
||||
|
||||
|
||||
_reply, _arguments, _attributes = self.send(_code, _subcode,
|
||||
_arguments, _attributes)
|
||||
if _arguments.get('errn', 0):
|
||||
raise aetools.Error, aetools.decodeerror(_arguments)
|
||||
# XXXX Optionally decode result
|
||||
if _arguments.has_key('----'):
|
||||
return _arguments['----']
|
||||
|
||||
def ListWindows(self, _no_object=None, _attributes={}, **_arguments):
|
||||
"""ListWindows: Returns list of Window Identifiers for all open windows.
|
||||
Keyword argument _attributes: AppleEvent attribute dictionary
|
||||
Returns: undocumented, typecode 'list'
|
||||
"""
|
||||
_code = 'WWW!'
|
||||
_subcode = 'LSTW'
|
||||
|
||||
if _arguments: raise TypeError, 'No optional args expected'
|
||||
if _no_object is not None: raise TypeError, 'No direct arg expected'
|
||||
|
||||
|
||||
_reply, _arguments, _attributes = self.send(_code, _subcode,
|
||||
_arguments, _attributes)
|
||||
if _arguments.get('errn', 0):
|
||||
raise aetools.Error, aetools.decodeerror(_arguments)
|
||||
# XXXX Optionally decode result
|
||||
if _arguments.has_key('----'):
|
||||
return _arguments['----']
|
||||
|
||||
_argmap_OpenURL = {
|
||||
'to' : 'INTO',
|
||||
'toWindow' : 'WIND',
|
||||
'Flags' : 'FLGS',
|
||||
'FormData' : 'POST',
|
||||
'MIME_Type' : 'MIME',
|
||||
}
|
||||
|
||||
def OpenURL(self, _object, _attributes={}, **_arguments):
|
||||
"""OpenURL: Retrieves URL off the Web.
|
||||
Required argument: Fully-qualified URL
|
||||
Keyword argument to: Target file for saving downloaded data
|
||||
Keyword argument toWindow: Target window for resource at URL (-1 for top window, 0 for new window)
|
||||
Keyword argument Flags: Valid Flags settings are: 1-Ignore the document cache; 2-Ignore the image cache; 4-Operate in background mode.
|
||||
Keyword argument FormData: data to post
|
||||
Keyword argument MIME_Type: MIME type of data being posted
|
||||
Keyword argument _attributes: AppleEvent attribute dictionary
|
||||
"""
|
||||
_code = 'WWW!'
|
||||
_subcode = 'OURL'
|
||||
|
||||
aetools.keysubst(_arguments, self._argmap_OpenURL)
|
||||
_arguments['----'] = _object
|
||||
|
||||
|
||||
_reply, _arguments, _attributes = self.send(_code, _subcode,
|
||||
_arguments, _attributes)
|
||||
if _arguments.get('errn', 0):
|
||||
raise aetools.Error, aetools.decodeerror(_arguments)
|
||||
# XXXX Optionally decode result
|
||||
if _arguments.has_key('----'):
|
||||
return _arguments['----']
|
||||
|
||||
_argmap_ParseAnchor = {
|
||||
'withURL' : 'RELA',
|
||||
}
|
||||
|
||||
def ParseAnchor(self, _object, _attributes={}, **_arguments):
|
||||
"""ParseAnchor: Combines a base URL and a relative URL to produce a fully-qualified URL
|
||||
Required argument: Base URL
|
||||
Keyword argument withURL: Relative URL that is combined with the Base URL (in the direct object) to produce a fully-qualified URL.
|
||||
Keyword argument _attributes: AppleEvent attribute dictionary
|
||||
Returns: Fully-qualified URL
|
||||
"""
|
||||
_code = 'WWW!'
|
||||
_subcode = 'PRSA'
|
||||
|
||||
aetools.keysubst(_arguments, self._argmap_ParseAnchor)
|
||||
_arguments['----'] = _object
|
||||
|
||||
|
||||
_reply, _arguments, _attributes = self.send(_code, _subcode,
|
||||
_arguments, _attributes)
|
||||
if _arguments.get('errn', 0):
|
||||
raise aetools.Error, aetools.decodeerror(_arguments)
|
||||
# XXXX Optionally decode result
|
||||
if _arguments.has_key('----'):
|
||||
return _arguments['----']
|
||||
|
||||
_argmap_ShowFile = {
|
||||
'MIME_Type' : 'MIME',
|
||||
'Window_Identifier' : 'WIND',
|
||||
'URL' : 'URL ',
|
||||
}
|
||||
|
||||
def ShowFile(self, _object, _attributes={}, **_arguments):
|
||||
"""ShowFile: FileSpec containing data of specified MIME type to be rendered in window specified by Window Identifier.
|
||||
Required argument: The file
|
||||
Keyword argument MIME_Type: MIME type
|
||||
Keyword argument Window_Identifier: Identifier of the target window for the URL. (Can use -1 for top window)
|
||||
Keyword argument URL: URL that allows this document to be reloaded.
|
||||
Keyword argument _attributes: AppleEvent attribute dictionary
|
||||
"""
|
||||
_code = 'WWW!'
|
||||
_subcode = 'SHWF'
|
||||
|
||||
aetools.keysubst(_arguments, self._argmap_ShowFile)
|
||||
_arguments['----'] = _object
|
||||
|
||||
|
||||
_reply, _arguments, _attributes = self.send(_code, _subcode,
|
||||
_arguments, _attributes)
|
||||
if _arguments.get('errn', 0):
|
||||
raise aetools.Error, aetools.decodeerror(_arguments)
|
||||
# XXXX Optionally decode result
|
||||
if _arguments.has_key('----'):
|
||||
return _arguments['----']
|
||||
|
||||
|
||||
#
|
||||
# Indices of types declared in this module
|
||||
#
|
||||
_classdeclarations = {
|
||||
}
|
||||
|
||||
_propdeclarations = {
|
||||
}
|
||||
|
||||
_compdeclarations = {
|
||||
}
|
||||
|
||||
_enumdeclarations = {
|
||||
}
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
"""
|
||||
Package generated from /Applications/Internet Explorer.app
|
||||
"""
|
||||
|
||||
from warnings import warnpy3k
|
||||
warnpy3k("In 3.x, the Explorer module is removed.", stacklevel=2)
|
||||
|
||||
import aetools
|
||||
Error = aetools.Error
|
||||
import Standard_Suite
|
||||
import URL_Suite
|
||||
import Netscape_Suite
|
||||
import Microsoft_Internet_Explorer
|
||||
import Web_Browser_Suite
|
||||
import Required_Suite
|
||||
|
||||
|
||||
_code_to_module = {
|
||||
'****' : Standard_Suite,
|
||||
'GURL' : URL_Suite,
|
||||
'MOSS' : Netscape_Suite,
|
||||
'MSIE' : Microsoft_Internet_Explorer,
|
||||
'WWW!' : Web_Browser_Suite,
|
||||
'reqd' : Required_Suite,
|
||||
}
|
||||
|
||||
|
||||
|
||||
_code_to_fullname = {
|
||||
'****' : ('Explorer.Standard_Suite', 'Standard_Suite'),
|
||||
'GURL' : ('Explorer.URL_Suite', 'URL_Suite'),
|
||||
'MOSS' : ('Explorer.Netscape_Suite', 'Netscape_Suite'),
|
||||
'MSIE' : ('Explorer.Microsoft_Internet_Explorer', 'Microsoft_Internet_Explorer'),
|
||||
'WWW!' : ('Explorer.Web_Browser_Suite', 'Web_Browser_Suite'),
|
||||
'reqd' : ('Explorer.Required_Suite', 'Required_Suite'),
|
||||
}
|
||||
|
||||
from Standard_Suite import *
|
||||
from URL_Suite import *
|
||||
from Netscape_Suite import *
|
||||
from Microsoft_Internet_Explorer import *
|
||||
from Web_Browser_Suite import *
|
||||
from Required_Suite import *
|
||||
|
||||
def getbaseclasses(v):
|
||||
if not getattr(v, '_propdict', None):
|
||||
v._propdict = {}
|
||||
v._elemdict = {}
|
||||
for superclassname in getattr(v, '_superclassnames', []):
|
||||
superclass = eval(superclassname)
|
||||
getbaseclasses(superclass)
|
||||
v._propdict.update(getattr(superclass, '_propdict', {}))
|
||||
v._elemdict.update(getattr(superclass, '_elemdict', {}))
|
||||
v._propdict.update(getattr(v, '_privpropdict', {}))
|
||||
v._elemdict.update(getattr(v, '_privelemdict', {}))
|
||||
|
||||
import StdSuites
|
||||
|
||||
#
|
||||
# Set property and element dictionaries now that all classes have been defined
|
||||
#
|
||||
getbaseclasses(application)
|
||||
|
||||
#
|
||||
# Indices of types declared in this module
|
||||
#
|
||||
_classdeclarations = {
|
||||
'capp' : application,
|
||||
}
|
||||
|
||||
|
||||
class Explorer(Standard_Suite_Events,
|
||||
URL_Suite_Events,
|
||||
Netscape_Suite_Events,
|
||||
Microsoft_Internet_Explorer_Events,
|
||||
Web_Browser_Suite_Events,
|
||||
Required_Suite_Events,
|
||||
aetools.TalkTo):
|
||||
_signature = 'MSIE'
|
||||
|
||||
_moduleName = 'Explorer'
|
||||
|
||||
_elemdict = application._elemdict
|
||||
_propdict = application._propdict
|
||||
|
|
@ -0,0 +1,279 @@
|
|||
"""Suite Containers and folders: Classes that can contain other file system items
|
||||
Level 1, version 1
|
||||
|
||||
Generated from /System/Library/CoreServices/Finder.app
|
||||
AETE/AEUT resource version 0/144, language 0, script 0
|
||||
"""
|
||||
|
||||
import aetools
|
||||
import MacOS
|
||||
|
||||
_code = 'fndr'
|
||||
|
||||
class Containers_and_folders_Events:
|
||||
|
||||
pass
|
||||
|
||||
|
||||
class disk(aetools.ComponentItem):
|
||||
"""disk - A disk """
|
||||
want = 'cdis'
|
||||
class _Prop__3c_Inheritance_3e_(aetools.NProperty):
|
||||
"""<Inheritance> - inherits some of its properties from the container class """
|
||||
which = 'c@#^'
|
||||
want = 'ctnr'
|
||||
class _Prop_capacity(aetools.NProperty):
|
||||
"""capacity - the total number of bytes (free or used) on the disk """
|
||||
which = 'capa'
|
||||
want = 'comp'
|
||||
class _Prop_ejectable(aetools.NProperty):
|
||||
"""ejectable - Can the media be ejected (floppies, CD's, and so on)? """
|
||||
which = 'isej'
|
||||
want = 'bool'
|
||||
class _Prop_format(aetools.NProperty):
|
||||
"""format - the filesystem format of this disk """
|
||||
which = 'dfmt'
|
||||
want = 'edfm'
|
||||
class _Prop_free_space(aetools.NProperty):
|
||||
"""free space - the number of free bytes left on the disk """
|
||||
which = 'frsp'
|
||||
want = 'comp'
|
||||
class _Prop_ignore_privileges(aetools.NProperty):
|
||||
"""ignore privileges - Ignore permissions on this disk? """
|
||||
which = 'igpr'
|
||||
want = 'bool'
|
||||
class _Prop_local_volume(aetools.NProperty):
|
||||
"""local volume - Is the media a local volume (as opposed to a file server)? """
|
||||
which = 'isrv'
|
||||
want = 'bool'
|
||||
class _Prop_startup(aetools.NProperty):
|
||||
"""startup - Is this disk the boot disk? """
|
||||
which = 'istd'
|
||||
want = 'bool'
|
||||
# element 'alia' as ['indx', 'name']
|
||||
# element 'appf' as ['indx', 'name', 'ID ']
|
||||
# element 'cfol' as ['indx', 'name', 'ID ']
|
||||
# element 'clpf' as ['indx', 'name']
|
||||
# element 'cobj' as ['indx', 'name']
|
||||
# element 'ctnr' as ['indx', 'name']
|
||||
# element 'docf' as ['indx', 'name']
|
||||
# element 'file' as ['indx', 'name']
|
||||
# element 'inlf' as ['indx', 'name']
|
||||
# element 'pack' as ['indx', 'name']
|
||||
|
||||
disks = disk
|
||||
|
||||
class desktop_2d_object(aetools.ComponentItem):
|
||||
"""desktop-object - Desktop-object is the class of the \xd2desktop\xd3 object """
|
||||
want = 'cdsk'
|
||||
# element 'alia' as ['indx', 'name']
|
||||
# element 'appf' as ['indx', 'name', 'ID ']
|
||||
# element 'cdis' as ['indx', 'name']
|
||||
# element 'cfol' as ['indx', 'name', 'ID ']
|
||||
# element 'clpf' as ['indx', 'name']
|
||||
# element 'cobj' as ['indx', 'name']
|
||||
# element 'ctnr' as ['indx', 'name']
|
||||
# element 'docf' as ['indx', 'name']
|
||||
# element 'file' as ['indx', 'name']
|
||||
# element 'inlf' as ['indx', 'name']
|
||||
# element 'pack' as ['indx', 'name']
|
||||
|
||||
class folder(aetools.ComponentItem):
|
||||
"""folder - A folder """
|
||||
want = 'cfol'
|
||||
# element 'alia' as ['indx', 'name']
|
||||
# element 'appf' as ['indx', 'name', 'ID ']
|
||||
# element 'cfol' as ['indx', 'name', 'ID ']
|
||||
# element 'clpf' as ['indx', 'name']
|
||||
# element 'cobj' as ['indx', 'name']
|
||||
# element 'ctnr' as ['indx', 'name']
|
||||
# element 'docf' as ['indx', 'name']
|
||||
# element 'file' as ['indx', 'name']
|
||||
# element 'inlf' as ['indx', 'name']
|
||||
# element 'pack' as ['indx', 'name']
|
||||
|
||||
folders = folder
|
||||
|
||||
class container(aetools.ComponentItem):
|
||||
"""container - An item that contains other items """
|
||||
want = 'ctnr'
|
||||
class _Prop_completely_expanded(aetools.NProperty):
|
||||
"""completely expanded - (NOT AVAILABLE YET) Are the container and all of its children opened as outlines? (can only be set for containers viewed as lists) """
|
||||
which = 'pexc'
|
||||
want = 'bool'
|
||||
class _Prop_container_window(aetools.NProperty):
|
||||
"""container window - the container window for this folder """
|
||||
which = 'cwnd'
|
||||
want = 'obj '
|
||||
class _Prop_entire_contents(aetools.NProperty):
|
||||
"""entire contents - the entire contents of the container, including the contents of its children """
|
||||
which = 'ects'
|
||||
want = 'obj '
|
||||
class _Prop_expandable(aetools.NProperty):
|
||||
"""expandable - (NOT AVAILABLE YET) Is the container capable of being expanded as an outline? """
|
||||
which = 'pexa'
|
||||
want = 'bool'
|
||||
class _Prop_expanded(aetools.NProperty):
|
||||
"""expanded - (NOT AVAILABLE YET) Is the container opened as an outline? (can only be set for containers viewed as lists) """
|
||||
which = 'pexp'
|
||||
want = 'bool'
|
||||
# element 'alia' as ['indx', 'name']
|
||||
# element 'appf' as ['indx', 'name', 'ID ']
|
||||
# element 'cfol' as ['indx', 'name', 'ID ']
|
||||
# element 'clpf' as ['indx', 'name']
|
||||
# element 'cobj' as ['indx', 'name']
|
||||
# element 'ctnr' as ['indx', 'name']
|
||||
# element 'docf' as ['indx', 'name']
|
||||
# element 'file' as ['indx', 'name']
|
||||
# element 'inlf' as ['indx', 'name']
|
||||
# element 'pack' as ['indx', 'name']
|
||||
|
||||
containers = container
|
||||
|
||||
class trash_2d_object(aetools.ComponentItem):
|
||||
"""trash-object - Trash-object is the class of the \xd2trash\xd3 object """
|
||||
want = 'ctrs'
|
||||
class _Prop_warns_before_emptying(aetools.NProperty):
|
||||
"""warns before emptying - Display a dialog when emptying the trash? """
|
||||
which = 'warn'
|
||||
want = 'bool'
|
||||
# element 'alia' as ['indx', 'name']
|
||||
# element 'appf' as ['indx', 'name', 'ID ']
|
||||
# element 'cfol' as ['indx', 'name', 'ID ']
|
||||
# element 'clpf' as ['indx', 'name']
|
||||
# element 'cobj' as ['indx', 'name']
|
||||
# element 'ctnr' as ['indx', 'name']
|
||||
# element 'docf' as ['indx', 'name']
|
||||
# element 'file' as ['indx', 'name']
|
||||
# element 'inlf' as ['indx', 'name']
|
||||
# element 'pack' as ['indx', 'name']
|
||||
disk._superclassnames = ['container']
|
||||
import Files
|
||||
import Finder_items
|
||||
disk._privpropdict = {
|
||||
'_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_,
|
||||
'capacity' : _Prop_capacity,
|
||||
'ejectable' : _Prop_ejectable,
|
||||
'format' : _Prop_format,
|
||||
'free_space' : _Prop_free_space,
|
||||
'ignore_privileges' : _Prop_ignore_privileges,
|
||||
'local_volume' : _Prop_local_volume,
|
||||
'startup' : _Prop_startup,
|
||||
}
|
||||
disk._privelemdict = {
|
||||
'alias_file' : Files.alias_file,
|
||||
'application_file' : Files.application_file,
|
||||
'clipping' : Files.clipping,
|
||||
'container' : container,
|
||||
'document_file' : Files.document_file,
|
||||
'file' : Files.file,
|
||||
'folder' : folder,
|
||||
'internet_location_file' : Files.internet_location_file,
|
||||
'item' : Finder_items.item,
|
||||
'package' : Files.package,
|
||||
}
|
||||
desktop_2d_object._superclassnames = ['container']
|
||||
desktop_2d_object._privpropdict = {
|
||||
'_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_,
|
||||
}
|
||||
desktop_2d_object._privelemdict = {
|
||||
'alias_file' : Files.alias_file,
|
||||
'application_file' : Files.application_file,
|
||||
'clipping' : Files.clipping,
|
||||
'container' : container,
|
||||
'disk' : disk,
|
||||
'document_file' : Files.document_file,
|
||||
'file' : Files.file,
|
||||
'folder' : folder,
|
||||
'internet_location_file' : Files.internet_location_file,
|
||||
'item' : Finder_items.item,
|
||||
'package' : Files.package,
|
||||
}
|
||||
folder._superclassnames = ['container']
|
||||
folder._privpropdict = {
|
||||
'_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_,
|
||||
}
|
||||
folder._privelemdict = {
|
||||
'alias_file' : Files.alias_file,
|
||||
'application_file' : Files.application_file,
|
||||
'clipping' : Files.clipping,
|
||||
'container' : container,
|
||||
'document_file' : Files.document_file,
|
||||
'file' : Files.file,
|
||||
'folder' : folder,
|
||||
'internet_location_file' : Files.internet_location_file,
|
||||
'item' : Finder_items.item,
|
||||
'package' : Files.package,
|
||||
}
|
||||
container._superclassnames = ['item']
|
||||
container._privpropdict = {
|
||||
'_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_,
|
||||
'completely_expanded' : _Prop_completely_expanded,
|
||||
'container_window' : _Prop_container_window,
|
||||
'entire_contents' : _Prop_entire_contents,
|
||||
'expandable' : _Prop_expandable,
|
||||
'expanded' : _Prop_expanded,
|
||||
}
|
||||
container._privelemdict = {
|
||||
'alias_file' : Files.alias_file,
|
||||
'application_file' : Files.application_file,
|
||||
'clipping' : Files.clipping,
|
||||
'container' : container,
|
||||
'document_file' : Files.document_file,
|
||||
'file' : Files.file,
|
||||
'folder' : folder,
|
||||
'internet_location_file' : Files.internet_location_file,
|
||||
'item' : Finder_items.item,
|
||||
'package' : Files.package,
|
||||
}
|
||||
trash_2d_object._superclassnames = ['container']
|
||||
trash_2d_object._privpropdict = {
|
||||
'_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_,
|
||||
'warns_before_emptying' : _Prop_warns_before_emptying,
|
||||
}
|
||||
trash_2d_object._privelemdict = {
|
||||
'alias_file' : Files.alias_file,
|
||||
'application_file' : Files.application_file,
|
||||
'clipping' : Files.clipping,
|
||||
'container' : container,
|
||||
'document_file' : Files.document_file,
|
||||
'file' : Files.file,
|
||||
'folder' : folder,
|
||||
'internet_location_file' : Files.internet_location_file,
|
||||
'item' : Finder_items.item,
|
||||
'package' : Files.package,
|
||||
}
|
||||
|
||||
#
|
||||
# Indices of types declared in this module
|
||||
#
|
||||
_classdeclarations = {
|
||||
'cdis' : disk,
|
||||
'cdsk' : desktop_2d_object,
|
||||
'cfol' : folder,
|
||||
'ctnr' : container,
|
||||
'ctrs' : trash_2d_object,
|
||||
}
|
||||
|
||||
_propdeclarations = {
|
||||
'c@#^' : _Prop__3c_Inheritance_3e_,
|
||||
'capa' : _Prop_capacity,
|
||||
'cwnd' : _Prop_container_window,
|
||||
'dfmt' : _Prop_format,
|
||||
'ects' : _Prop_entire_contents,
|
||||
'frsp' : _Prop_free_space,
|
||||
'igpr' : _Prop_ignore_privileges,
|
||||
'isej' : _Prop_ejectable,
|
||||
'isrv' : _Prop_local_volume,
|
||||
'istd' : _Prop_startup,
|
||||
'pexa' : _Prop_expandable,
|
||||
'pexc' : _Prop_completely_expanded,
|
||||
'pexp' : _Prop_expanded,
|
||||
'warn' : _Prop_warns_before_emptying,
|
||||
}
|
||||
|
||||
_compdeclarations = {
|
||||
}
|
||||
|
||||
_enumdeclarations = {
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue