home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1994 November / macformat-018.iso / Utility Spectacular / Text / Emacs-1.12d folder / lisp / mac / headers.el < prev    next >
Encoding:
Text File  |  1993-12-26  |  23.9 KB  |  755 lines  |  [TEXT/EMAC]

  1. ;;;
  2. ;;; This file is part of a Macintosh port of GNU Emacs.
  3. ;;; Copyright (C) 1993 Marc Parmet.  All rights reserved.
  4. ;;;
  5.  
  6. ;;;
  7. ;;; Header file for Macintosh traps
  8. ;;;
  9. ;;; This file is included by site-init.el, so that this file is part of
  10. ;;; the dump and available at startup.  If you hack it, you can make
  11. ;;; your changes part of the dump by once launching Emacs and holding
  12. ;;; down the option key.
  13. ;;;
  14.  
  15. ;;;
  16. ;;; File system errors
  17. ;;;
  18.  
  19. (defconst noErr                     0    "no error")
  20. (defconst nsvErr                    -35    "no such volume")
  21. (defconst fnfErr                    -43    "file not found")
  22.  
  23. ;;;
  24. ;;; *** From EPPC.h
  25. ;;;
  26.  
  27. (defconst receiverIDMask            61440 "0x0000F000")
  28. (defconst receiverIDisPSN           32768 "0x00008000")
  29. (defconst receiverIDisSignature     28672 "0x00007000")
  30. (defconst receiverIDisSessionID     24576 "0x00006000")
  31. (defconst receiverIDisTargetID      20480 "0x00005000")
  32.  
  33. (defconst systemOptionsMask         3840 "0x00000F00")
  34. (defconst nReturnReceipt            512 "0x00000200")
  35.  
  36. (defconst priorityMask              255 "0x000000FF")
  37. (defconst nAttnMsg                  1 "0x00000001")
  38.  
  39. (defconst bufferIsSmall             -607)
  40. (defconst noOutstandingHLE          -608)
  41. (defconst connectionInvalid         -609        "nonexistent target or session ID")
  42. (defconst noUserInteractionAllowed  -610)
  43.  
  44. ;;;
  45. ;;; *** From AppleEvents.h ***
  46. ;;;
  47.  
  48. ;;; Apple event descriptor types
  49. (defconst typeBoolean               "bool")
  50. (defconst typeChar                  "TEXT")
  51. (defconst typeSMInt                 "shor")
  52. (defconst typeInteger               "long")
  53. (defconst typeSMFloat               "sing")
  54. (defconst typeFloat                 "doub")
  55. (defconst typeLongInteger           "long")
  56. (defconst typeShortInteger          "shor")
  57. (defconst typeLongFloat             "doub")
  58. (defconst typeShortFloat            "sing")
  59. (defconst typeExtended              "exte")
  60. (defconst typeComp                  "comp")
  61. (defconst typeMagnitude             "magn")
  62. (defconst typeAEList                "list")
  63. (defconst typeAERecord              "reco")
  64. (defconst typeTrue                  "true")
  65. (defconst typeFalse                 "fals")
  66. (defconst typeAlias                 "alis")
  67. (defconst typeEnumerated            "enum")
  68. (defconst typeType                  "type")
  69. (defconst typeAppParameters         "appa")
  70. (defconst typeProperty              "prop")
  71. (defconst typeFSS                   "fss ")
  72. (defconst typeKeyword               "keyw")
  73. (defconst typeSectionH              "sect")
  74. (defconst typeWildCard              "****")
  75. (defconst typeApplSignature         "sign")
  76. (defconst typeSessionID             "ssid")
  77. (defconst typeTargetID              "targ")
  78. (defconst typeProcessSerialNumber   "psn ")
  79. (defconst typeNull                  "null")
  80.  
  81. ;;; Keywords for Apple event parameters
  82. (defconst keyDirectObject           "----")
  83. (defconst keyErrorNumber            "errn")
  84. (defconst keyErrorString            "errs")
  85. (defconst keyProcessSerialNumber    "psn ")
  86.  
  87. ;;; Keywords for Apple event attributes
  88. (defconst keyTransactionIDAttr      "tran")
  89. (defconst keyReturnIDAttr           "rtid")
  90. (defconst keyEventClassAttr         "evcl")
  91. (defconst keyEventIDAttr            "evid")
  92. (defconst keyAddressAttr            "addr")
  93. (defconst keyOptionalKeywordAttr    "optk")
  94. (defconst keyTimeoutAttr            "timo")
  95. (defconst keyInteractLevelAttr      "inte")
  96. (defconst keyEventSourceAttr        "esrc")
  97. (defconst keyMissedKeywordAttr      "miss")
  98.  
  99. ;;; Keywords for special handlers
  100. (defconst keyPreDispatch            "phac")
  101. (defconst keySelectProc             "selh")
  102.  
  103. ;;; Event class
  104. (defconst kCoreEventClass           "aevt")
  105.  
  106. ;;; Event ID's
  107. (defconst kAEOpenApplication        "oapp")
  108. (defconst kAEOpenDocuments          "odoc")
  109. (defconst kAEPrintDocuments         "pdoc")
  110. (defconst kAEQuitApplication        "quit")
  111. (defconst kAEAnswer                 "ansr")
  112. (defconst kAEApplicationDied        "obit")
  113. (defconst kAECreatorType            "crea")
  114. (defconst kAEQuitAll                "quia")
  115. (defconst kAEShutDown               "shut")
  116. (defconst kAERestart                "rest")
  117.  
  118. ;;; Constants for setting the sendMode parameter of AESend and for
  119. ;;; the KeyInteractiveLevel attribute
  120. (defconst kAENoReply                1)
  121. (defconst kAEQueueReply             2)
  122. (defconst kAEWaitReply              3)
  123. (defconst kAENeverInteract          16)
  124. (defconst kAECanInteract            32)
  125. (defconst kAEAlwaysInteract         48)
  126. (defconst kAECanSwitchLayer         64)
  127. (defconst kAEDontReconnect          128)
  128. (defconst kAEWantReceipt nReturnReceipt)
  129.  
  130. ;;; Constants for the sendPriority parameter of AESend
  131. (defconst kAENormalPriority         0)
  132. (defconst kAEHighPriority           nAttnMsg)
  133.  
  134. ;;; Constant for the returnID parameter of AECreateAppleEvent
  135. (defconst kAutoGenerateReturnID     -1)
  136.  
  137. ;;; Constant for transaction ID's
  138. (defconst kAnyTransactionID         0)
  139.  
  140. ;;; Constants for timeout durations
  141. (defconst kAEDefaultTimeout         -1)
  142. (defconst kNoTimeOut                -2)
  143.  
  144. ;;; Constants for the dispatcher parameter of AEResumeTheCurrentEvent
  145. (defconst kAENoDispatch             0)
  146. (defconst kAEUseStandardDispatch    -1)
  147.  
  148. ;;; Error messages in response to reading and writing event contents
  149. (defconst errAECoercionFail         -1700)
  150. (defconst errAEDescNotFound         -1701        "descriptor record not found")
  151. (defconst errAECorruptData          -1702)
  152. (defconst errAEWrongDataType        -1703)
  153. (defconst errAENotAEDesc            -1704)
  154. (defconst errAEBadListItem          -1705)
  155. (defconst errAENewerVersion         -1706)
  156. (defconst errAENotAppleEvent        -1707)
  157. (defconst errAEEventNotHandled      -1708        "event not handled")
  158. (defconst errAEReplyNotValid        -1709)
  159. (defconst errAEUnknownSendMode      -1710)
  160. (defconst errAEWaitCanceled         -1711)
  161. (defconst errAETimeout              -1712)
  162. (defconst errAENoUserInteraction    -1713        "no user interaction allowed")
  163. (defconst errAENotASpecialFunction  -1714)
  164. (defconst errAEParamMissed          -1715)
  165. (defconst errAEUnknownAddressType   -1716)
  166. (defconst errAEHandlerNotFound      -1717)
  167. (defconst errAEReplyNotArrived      -1718)
  168. (defconst errAEIllegalIndex         -1719)
  169.  
  170. ;;;
  171. ;;; *** From AERegistry.h ***
  172. ;;;
  173.  
  174. (defconst cAEList "list")
  175. (defconst cApplication "capp")
  176. (defconst cArc "carc")
  177. (defconst cBoolean "bool")
  178. (defconst cCell "ccel")
  179. (defconst cChar "cha ")
  180. (defconst cColorTable "clrt")
  181. (defconst cColumn "ccol")
  182. (defconst cDocument "docu")
  183. (defconst cDrawingArea "cdrw")
  184. (defconst cEnumeration "enum")
  185. (defconst cFile "file")
  186. (defconst cFixed "fixd")
  187. (defconst cGraphicLine "glin")
  188. (defconst cGraphicObject "cgob")
  189. (defconst cGraphicShape "cgsh")
  190. (defconst cGraphicText "cgtx")
  191. (defconst cGroupedGraphic "cpic")
  192. (defconst cInsertionLoc "insl")
  193. (defconst cIntlText "itxt")
  194. (defconst cIntlWritingCode "intl")
  195. (defconst cItem "citm")
  196. (defconst cLine "clin")
  197. (defconst cLongInteger "long")
  198. (defconst cMenu "cmnu")
  199. (defconst cMenuItem "cmen")
  200. (defconst cObject "cobj")
  201. (defconst cObjectSpecifier "obj ")
  202. (defconst cOpenableObject "coob")
  203. (defconst cOval "covl")
  204. (defconst cParagraph "cpar")
  205. (defconst cPixel "cpxl")
  206. (defconst cPixelMap "cpix")
  207. (defconst cPolygon "cpgn")
  208. (defconst cQDPoint "QDpt")
  209. (defconst cQDRectangle "qdrt")
  210. (defconst cRectangle "crec")
  211. (defconst cRGBColor "cRGB")
  212. (defconst cRotation "trot")
  213. (defconst cRoundedRectangle "crrc")
  214. (defconst cRow "crow")
  215. (defconst cSelection "csel")
  216. (defconst cShortInteger "shor")
  217. (defconst cTable "ctbl")
  218. (defconst cText "ctxt")
  219. (defconst cTextFlow "cflo")
  220. (defconst cTextStyles "tsty")
  221. (defconst cType "type")
  222. (defconst cWindow "cwin")
  223. (defconst cWord "cwor")
  224. (defconst errAEBadKeyForm -10002)
  225. (defconst errAECantHandleClass -10010)
  226. (defconst errAECantSupplyType -10009)
  227. (defconst errAEEventFailed -10000)
  228. (defconst errAEIndexTooLarge -10007)
  229. (defconst errAEInTransaction -10011)
  230. (defconst errAELocalOnly -10016)
  231. (defconst errAENoSuchTransaction -10012)
  232. (defconst errAENotAnElement -10008)
  233. (defconst errAENotASingleObject -10014)
  234. (defconst errAENotModifiable -10003)
  235. (defconst errAENoUserSelection -10013)
  236. (defconst errAEPrivilegeError -10004)
  237. (defconst errAEReadDenied -10005)
  238. (defconst errAETypeError -10001)
  239. (defconst errAEWriteDenied -10006)
  240. (defconst kAEAbout "abou")
  241. (defconst kAEAfter "afte")
  242. (defconst kAEAliasSelection "sali")
  243. (defconst kAEAllCaps "alcp")
  244. (defconst kAEArrowAtEnd "aren")
  245. (defconst kAEArrowAtStart "arst")
  246. (defconst kAEArrowBothEnds "arbo")
  247. (defconst kAEAsk "ask ")
  248. (defconst kAEBefore "befo")
  249. (defconst kAEBeginning "bgng")
  250. (defconst kAEBeginsWith "bgwt")
  251. (defconst kAEBeginTransaction "begi")
  252. (defconst kAEBold "bold")
  253. (defconst kAECaseSensEquals "cseq")
  254. (defconst kAECentered "cent")
  255. (defconst kAEChangeView "view")
  256. (defconst kAEClone "clon")
  257. (defconst kAEClose "clos")
  258. (defconst kAECondensed "cond")
  259. (defconst kAEContains "cont")
  260. (defconst kAECopy "copy")
  261. (defconst kAECoreSuite "core")
  262. (defconst kAECountElements "cnte")
  263. (defconst kAECreateElement "crel")
  264. (defconst kAECreatePublisher "cpub")
  265. (defconst kAECut "cut ")
  266. (defconst kAEDelete "delo")
  267. (defconst kAEDoObjectsExist "doex")
  268. (defconst kAEDoScript "dosc")
  269. (defconst kAEDrag "drag")
  270. (defconst kAEDuplicateSelection "sdup")
  271. (defconst kAEEditGraphic "edit")
  272. (defconst kAEEmptyTrash "empt")
  273. (defconst kAEEnd "end ")
  274. (defconst kAEEndsWith "ends")
  275. (defconst kAEEndTransaction "endt")
  276. (defconst kAEEquals "=   ")
  277. (defconst kAEExpanded "pexp")
  278. (defconst kAEFast "fast")
  279. (defconst kAEFinderEvents "FNDR")
  280. (defconst kAEFormulaProtect "fpro")
  281. (defconst kAEFullyJustified "full")
  282. (defconst kAEGetClassInfo "qobj")
  283. (defconst kAEGetData "getd")
  284. (defconst kAEGetDataSize "dsiz")
  285. (defconst kAEGetEventInfo "gtei")
  286. (defconst kAEGetInfoSelection "sinf")
  287. (defconst kAEGetPrivilegeSelection "sprv")
  288. (defconst kAEGreaterThan ">   ")
  289. (defconst kAEGreaterThanEquals ">=  ")
  290. (defconst kAEGrow "grow")
  291. (defconst kAEHidden "hidn")
  292. (defconst kAEHiQuality "hiqu")
  293. (defconst kAEImageGraphic "imgr")
  294. (defconst kAEInfo 11)
  295. (defconst kAEIsUniform "isun")
  296. (defconst kAEItalic "ital")
  297. (defconst kAELeftJustified "left")
  298. (defconst kAELessThan "<   ")
  299. (defconst kAELessThanEquals "<=  ")
  300. (defconst kAELowercase "lowc")
  301. (defconst kAEMain 0)
  302. (defconst kAEMakeObjectsVisible "mvis")
  303. (defconst kAEMiscStandards "misc")
  304. (defconst kAEModifiable "modf")
  305. (defconst kAEMove "move")
  306. (defconst kAENo "no  ")
  307. (defconst kAENoArrow "arno")
  308. (defconst kAENonmodifiable "nmod")
  309. (defconst kAEOpen "odoc")
  310. (defconst kAEOpenSelection "sope")
  311. (defconst kAEOutline "outl")
  312. (defconst kAEPageSetup "pgsu")
  313. (defconst kAEPaste "past")
  314. (defconst kAEPlain "plan")
  315. (defconst kAEPrint "pdoc")
  316. (defconst kAEPrintSelection "spri")
  317. (defconst kAEPrintWindow "pwin")
  318. (defconst kAEPutAwaySelection "sput")
  319. (defconst kAEQDAddOver "addo")
  320. (defconst kAEQDAddPin "addp")
  321. (defconst kAEQDAdMax "admx")
  322. (defconst kAEQDAdMin "admn")
  323. (defconst kAEQDBic "bic ")
  324. (defconst kAEQDBlend "blnd")
  325. (defconst kAEQDCopy "cpy ")
  326. (defconst kAEQDNotBic "nbic")
  327. (defconst kAEQDNotCopy "ncpy")
  328. (defconst kAEQDNotOr "ntor")
  329. (defconst kAEQDNotXor "nxor")
  330. (defconst kAEQDOr "or  ")
  331. (defconst kAEQDSubOver "subo")
  332. (defconst kAEQDSubPin "subp")
  333. (defconst kAEQDXor "xor ")
  334. (defconst kAERedo "redo")
  335. (defconst kAERegular "regl")
  336. (defconst kAEReplace "rplc")
  337. (defconst kAERevealSelection "srev")
  338. (defconst kAERevert "rvrt")
  339. (defconst kAERightJustified "rght")
  340. (defconst kAESave "save")
  341. (defconst kAESetData "setd")
  342. (defconst kAESetPosition "posn")
  343. (defconst kAEShadow "shad")
  344. (defconst kAESharing 13)
  345. (defconst kAEShowClipboard "shcl")
  346. (defconst kAESleep "slep")
  347. (defconst kAESmallCaps "smcp")
  348. (defconst kAEStrikethrough "strk")
  349. (defconst kAESubscript "sbsc")
  350. (defconst kAESuperscript "spsc")
  351. (defconst kAETransactionTerminated "ttrm")
  352. (defconst kAEUnderline "undl")
  353. (defconst kAEUndo "undo")
  354. (defconst kAEWholeWordEquals "wweq")
  355. (defconst kAEYes "yes ")
  356. (defconst kAEZoom "zoom")
  357. (defconst kByCommentView 6)
  358. (defconst kByDateView 3)
  359. (defconst kByIconView 1)
  360. (defconst kByKindView 5)
  361. (defconst kByLabelView 7)
  362. (defconst kByNameView 2)
  363. (defconst kBySizeView 4)
  364. (defconst kBySmallIcon 0)
  365. (defconst kByVersionView 8)
  366. (defconst keyAEAngle "kang")
  367. (defconst keyAEArcAngle "kend")
  368. (defconst keyAEBaseAddr "badd")
  369. (defconst keyAEBgndColor "kbcl")
  370. (defconst keyAEBgndPattern "kbpt")
  371. (defconst keyAEBounds "kbnd")
  372. (defconst keyAECellList "kclt")
  373. (defconst keyAEClassID "clID")
  374. (defconst keyAEColor "kclr")
  375. (defconst keyAEColorTable "kcls")
  376. (defconst keyAECurveHeight "kchd")
  377. (defconst keyAECurveWidth "kcwd")
  378. (defconst keyAEDashStyle "dsty")
  379. (defconst keyAEData "data")
  380. (defconst keyAEDefinitionRect "kdef")
  381. (defconst keyAEDescType "dstp")
  382. (defconst keyAEDestination "dest")
  383. (defconst keyAEDoAntiAlias "anta")
  384. (defconst keyAEDoDithered "gdit")
  385. (defconst keyAEDoRotate "kdrt")
  386. (defconst keyAEDoScale "ksca")
  387. (defconst keyAEDoTranslate "ktra")
  388. (defconst keyAEEditionFileLoc "eloc")
  389. (defconst keyAEElements "elms")
  390. (defconst keyAEEndPoint "kedp")
  391. (defconst keyAEEventClass "evcl")
  392. (defconst keyAEEventID "evti")
  393. (defconst keyAEFile "kfil")
  394. (defconst keyAEFileType "fltp")
  395. (defconst keyAEFillColor "kfcl")
  396. (defconst keyAEFillPattern "kfpt")
  397. (defconst keyAEFlipHorizontal "kfho")
  398. (defconst keyAEFlipVertical "kfvt")
  399. (defconst keyAEFont "kfnt")
  400. (defconst keyAEFormula "kfla")
  401. (defconst keyAEGraphicObjects "kgrs")
  402. (defconst keyAEImageQuality "gqua")
  403. (defconst keyAEInsertHere "insh")
  404. (defconst keyAEKeyForms "keyf")
  405. (defconst keyAEKeyword "kywd")
  406. (defconst keyAELineArrow "lnar")
  407. (defconst keyAEName "knam")
  408. (defconst keyAENewElementLoc "knel")
  409. (defconst keyAEObject "kobj")
  410. (defconst keyAEObjectClass "kocl")
  411. (defconst keyAEOffStyles "ofst")
  412. (defconst keyAEOnStyles "onst")
  413. (defconst keyAEParameters "prms")
  414. (defconst keyAEParamFlags "pmfg")
  415. (defconst keyAEPenColor "kpcl")
  416. (defconst keyAEPenPattern "kpat")
  417. (defconst keyAEPenWidth "kpwd")
  418. (defconst keyAEPixelDepth "kpdp")
  419. (defconst keyAEPixMapMinus "kpmm")
  420. (defconst keyAEPMTable "kpmt")
  421. (defconst keyAEPointList "kpts")
  422. (defconst keyAEPointSize "kptz")
  423. (defconst keyAEPosition "kpos")
  424. (defconst keyAEPropData "prdt")
  425. (defconst keyAEProperties "qpro")
  426. (defconst keyAEProperty "kprp")
  427. (defconst keyAEPropFlags "prfg")
  428. (defconst keyAEPropID "prop")
  429. (defconst keyAEProtection "kptc")
  430. (defconst keyAERenderAs "kren")
  431. (defconst keyAERequestedType "rtyp")
  432. (defconst keyAEResult "----")
  433. (defconst keyAEResultInfo "rsin")
  434. (defconst keyAERotation "krot")
  435. (defconst keyAERotPoint "krtp")
  436. (defconst keyAERowList "krls")
  437. (defconst keyAESaveOptions "savo")
  438. (defconst keyAEScale "kscl")
  439. (defconst keyAEScriptTag "kStg")
  440. (defconst keyAEShowWhere "show")
  441. (defconst keyAEStartAngle "ksta")
  442. (defconst keyAEStartPoint "kstr")
  443. (defconst keyAEStyles "ksty")
  444. (defconst keyAEText "ktxt")
  445. (defconst keyAETextColor "ktxc")
  446. (defconst keyAETextFont "ktxf")
  447. (defconst keyAETextPointSize "ktps")
  448. (defconst keyAETextStyles "txts")
  449. (defconst keyAETheText "thtx")
  450. (defconst keyAETransferMode "ktrn")
  451. (defconst keyAETranslation "ktrl")
  452. (defconst keyAETryAsStructGraf "toog")
  453. (defconst keyAEUniformStyles "unis")
  454. (defconst keyAEUpdateOn "kupd")
  455. (defconst keyAEUserTerm "utrm")
  456. (defconst keyAEWindow "wndw")
  457. (defconst keyAEWritingCode "wrcd")
  458. (defconst keyMiscellaneous "fmsc")
  459. (defconst keySelection "fsel")
  460. (defconst keyWindow "kwnd")
  461. (defconst pArcAngle "parc")
  462. (defconst pBackgroundColor "pbcl")
  463. (defconst pBackgroundPattern "pbpt")
  464. (defconst pBestType "pbst")
  465. (defconst pBounds "pbnd")
  466. (defconst pClass "pcls")
  467. (defconst pClipboard "pcli")
  468. (defconst pColor "colr")
  469. (defconst pColorTable "cltb")
  470. (defconst pCornerCurveHeight "pchd")
  471. (defconst pCornerCurveWidth "pcwd")
  472. (defconst pDashStyle "pdst")
  473. (defconst pDefaultType "deft")
  474. (defconst pDefinitionRect "pdrt")
  475. (defconst pEnabled "enbl")
  476. (defconst pEndPoint "pend")
  477. (defconst pFillColor "flcl")
  478. (defconst pFillPattern "flpt")
  479. (defconst pFont "font")
  480. (defconst pFormula "pfor")
  481. (defconst pGraphicObjects "gobs")
  482. (defconst pHasCloseBox "hclb")
  483. (defconst pHasTitleBar "ptit")
  484. (defconst pIndex "pidx")
  485. (defconst pInsertionLoc "pins")
  486. (defconst pIsFloating "isfl")
  487. (defconst pIsFrontProcess "pisf")
  488. (defconst pIsModal "pmod")
  489. (defconst pIsModified "imod")
  490. (defconst pIsResizable "prsz")
  491. (defconst pIsStationeryPad "pspd")
  492. (defconst pIsZoomable "iszm")
  493. (defconst pIsZoomed "pzum")
  494. (defconst pItemNumber "itmn")
  495. (defconst pJustification "pjst")
  496. (defconst pLineArrow "arro")
  497. (defconst pMenuID "mnid")
  498. (defconst pName "pnam")
  499. (defconst pNewElementLoc "pnel")
  500. (defconst pPenColor "ppcl")
  501. (defconst pPenPattern "pppa")
  502. (defconst pPenWidth "ppwd")
  503. (defconst pPixelDepth "pdpt")
  504. (defconst pPointList "ptlt")
  505. (defconst pPointSize "ptsz")
  506. (defconst pProtection "ppro")
  507. (defconst pRotation "prot")
  508. (defconst pScale "pscl")
  509. (defconst pScriptTag "psct")
  510. (defconst pSelection "sele")
  511. (defconst pStartAngle "pang")
  512. (defconst pStartPoint "pstp")
  513. (defconst pTextColor "ptxc")
  514. (defconst pTextFont "ptxf")
  515. (defconst pTextItemDelimiters "txdl")
  516. (defconst pTextPointSize "ptps")
  517. (defconst pTextStyles "txst")
  518. (defconst pTransferMode "pptm")
  519. (defconst pTranslation "ptrs")
  520. (defconst pUniformStyles "ustl")
  521. (defconst pUpdateOn "pupd")
  522. (defconst pUserSelection "pusl")
  523. (defconst pVersion "vers")
  524. (defconst pVisible "pvis")
  525. (defconst typeAEText "tTXT")
  526. (defconst typeAppleEvent "AEVT")
  527. (defconst typeArc "tarc")
  528. (defconst typeBest "best")
  529. (defconst typeCell "cell")
  530. (defconst typeClassInfo "clin")
  531. (defconst typeColorTable "clrt")
  532. (defconst typeColumn "colm")
  533. (defconst typeDashStyle "tdas")
  534. (defconst typeData "tdta")
  535. (defconst typeDrawingArea "tdar")
  536. (defconst typeElemInfo "elin")
  537. (defconst typeEPS "EPS ")
  538. (defconst typeEventInfo "evin")
  539. (defconst typeFinderWindow "fwin")
  540. (defconst typeFixed "fixd")
  541. (defconst typeGraphicLine "tgln")
  542. (defconst typeGraphicText "gtxt")
  543. (defconst typeGroupedGraphic "tgru")
  544. (defconst typeInsertionLoc "insl")
  545. (defconst typeIntlText "itxt")
  546. (defconst typeIntlWritingCode "intl")
  547. (defconst typeOval "tovl")
  548. (defconst typeParamInfo "pmin")
  549. (defconst typePict "PICT")
  550. (defconst typePixelMap "tpix")
  551. (defconst typePixMapMinus "tpmm")
  552. (defconst typePolygon "tpol")
  553. (defconst typePropInfo "pinf")
  554. (defconst typeQDPoint "QDpt")
  555. (defconst typeQDRectangle "qdrt")
  556. (defconst typeRectangle "rcte")
  557. (defconst typeRGB16 "tr16")
  558. (defconst typeRGB96 "tr96")
  559. (defconst typeRGBColor "RGB ")
  560. (defconst typeRotation "trot")
  561. (defconst typeRoundedRectangle "trdr")
  562. (defconst typeRow "row ")
  563. (defconst typeScrapStyles "styl")
  564. (defconst typeStyledText "STXT")
  565. (defconst typeTable "tabl")
  566. (defconst typeTextStyles "tsty")
  567. (defconst typeTIFF "TIFF")
  568. (defconst zoomIn 7)
  569. (defconst zoomOut 8)
  570.  
  571. ;;;
  572. ;;; *** From AEObjects.h ***
  573. ;;;
  574.  
  575. (defconst kAEAND                    "AND ")
  576. (defconst kAEOR                     "OR  ")
  577. (defconst kAENOT                    "NOT ")
  578. (defconst kAEFirst                  "firs")
  579. (defconst kAELast                   "last")
  580. (defconst kAEMiddle                 "midd")
  581. (defconst kAEAny                    "any ")
  582. (defconst kAEAll                    "all ")
  583. (defconst kAENext                   "next")
  584. (defconst kAEPrevious               "prev")
  585. (defconst keyAEDesiredClass         "want")
  586. (defconst keyAEContainer            "from")
  587. (defconst keyAEKeyForm              "form")
  588. (defconst keyAEKeyData              "seld")
  589. (defconst keyAERangeStart           "star")
  590. (defconst keyAERangeStop            "stop")
  591. (defconst formAbsolutePosition      "indx")
  592. (defconst formRelativePosition      "rele")
  593. (defconst formTest                  "test")
  594. (defconst formRange                 "rang")
  595. (defconst formPropertyID            "prop")
  596. (defconst formName                  "name")
  597. (defconst typeObjectSpecifier       "obj ")
  598. (defconst typeObjectBeingExamined   "exmn")
  599. (defconst typeCurrentContainer      "ccnt")
  600. (defconst typeToken                 "toke")
  601. (defconst typeRelativeDescriptor    "rel ")
  602. (defconst typeAbsoluteOrdinal       "abso")
  603. (defconst typeIndexDescriptor       "inde")
  604. (defconst typeRangeDescriptor       "rang")
  605. (defconst typeLogicalDescriptor     "logi")
  606. (defconst typeCompDescriptor        "cmpd")
  607. (defconst keyAECompOperator         "relo")
  608. (defconst keyAELogicalTerms         "term")
  609. (defconst keyAELogicalOperator      "logc")
  610. (defconst keyAEObject1              "obj1")
  611. (defconst keyAEObject2              "obj2")
  612. (defconst keyDisposeTokenProc       "xtok")
  613. (defconst keyAECompareProc          "cmpr")
  614. (defconst keyAECountProc            "cont")
  615. (defconst keyAEMarkTokenProc        "mkid")
  616. (defconst keyAEMarkProc             "mark")
  617. (defconst keyAEAdjustMarksProc      "adjm")
  618. (defconst keyAEGetErrDescProc       "indc")
  619.  
  620. (defconst errAEImpossibleRange      -1720)
  621. (defconst errAEWrongNumberArgs      -1721)
  622. (defconst errAEAccessorNotFound     -1723)
  623. (defconst errAENoSuchLogical        -1725)
  624. (defconst errAEBadTestKey           -1726)
  625. (defconst errAENotAnObjSpec         -1727)
  626. (defconst errAENoSuchObject         -1728        "no such object")
  627. (defconst errAENegativeCount        -1729)
  628. (defconst errAEEmptyListContainer   -1730)
  629.  
  630. (defconst kAEIDoMinimum             0)
  631. (defconst kAEIDoWhose               1)
  632. (defconst kAEIDoMarking             4)
  633.  
  634. (defconst typeWhoseDescriptor       "whos")
  635. (defconst formWhose                 "whos")
  636. (defconst typeWhoseRange            "wrng")
  637. (defconst keyAEWhoseRangeStart      "wstr")
  638. (defconst keyAEWhoseRangeStop       "wstp")
  639. (defconst keyAEIndex                "kidx")
  640. (defconst keyAETest                 "ktst")
  641.  
  642. ;;;
  643. ;;; Other constants
  644. ;;;
  645.  
  646. (defconst sizeof-char 1)
  647. (defconst sizeof-short 2)
  648. (defconst sizeof-long 4)
  649. (defconst sizeof-int 4)
  650. (defconst sizeof-FSSpec 70)
  651. (defconst sizeof-AEDesc 8)
  652. (defconst sizeof-AEDescList 8)
  653. (defconst sizeof-AERecord 8)
  654. (defconst sizeof-AppleEvent 8)
  655. (defconst sizeof-FInfo 16)
  656.  
  657. (defun hex-string-to-int (string)
  658.   (if (zerop (length string))
  659.       0
  660.     (let* ((c (string-to-char (substring string -1)))
  661.            (place (cond
  662.                    ((and (>= c (string-to-char "0")) (<= c (string-to-char "9")))
  663.                     (- c (string-to-char "0")))
  664.                    ((and (>= c (string-to-char "a")) (<= c (string-to-char "f")))
  665.                     (+ 10 (- c (string-to-char "a"))))
  666.                    ((and (>= c (string-to-char "A")) (<= c (string-to-char "F")))
  667.                     (+ 10 (- c (string-to-char "A"))))
  668.                    (t
  669.                     0))))
  670.       (+ place (* 16 (hex-string-to-int (substring string 0 -1)))))))
  671.  
  672. (defun ae-encode (base offset type data)
  673.   (cond
  674.    ((equal type "string")
  675.     (let ((i 0)
  676.           (n (length data)))
  677.       (while (< i n)
  678.         (encode-internal base (+ offset i) sizeof-char
  679.                          (extract-internal data i sizeof-char nil) nil)
  680.         (setq i (1+ i))))
  681.     base)
  682.    ((equal type typeBoolean)
  683.     (encode-internal base offset sizeof-char
  684.                      (if (stringp data) (hex-string-to-int data) data)
  685.                      nil)
  686.     base)
  687.    ((equal type typeShortInteger)
  688.     (encode-internal base offset sizeof-short
  689.                      (if (stringp data) (hex-string-to-int data) data)
  690.                      nil)
  691.     base)
  692.    ((equal type typeLongInteger)
  693.     (encode-internal base offset sizeof-long
  694.                      (if (stringp data) (hex-string-to-int data) data)
  695.                      nil)
  696.     base)
  697.    ((equal type "lisp-object")
  698.     (encode-internal base offset sizeof-long data nil)
  699.     base)
  700.    (t
  701.     nil)))
  702.  
  703. (defun ae-encode-long-integer (i)
  704.   (ae-encode (make-string 4 0) 0 typeLongInteger i))
  705.  
  706. (defun ae-extract (type data offset &optional length)
  707.   (cond
  708.    ((equal type typeBoolean)
  709.     (not (zerop (extract-internal data offset 1 nil))))
  710.    ((equal type typeShortInteger)
  711.     (extract-internal data offset sizeof-short t))
  712.    ((equal type typeLongInteger)
  713.     (extract-internal data offset sizeof-long t))
  714.    ((equal type "char")
  715.     (extract-internal data offset sizeof-char nil))
  716.    ((equal type "string")
  717.     (let ((result (make-string length 0))
  718.           (i 0))
  719.       (while (< i length)
  720.         (encode-internal result i sizeof-char
  721.                          (extract-internal data (+ offset i) sizeof-char nil) nil)
  722.         (setq i (1+ i)))
  723.       result))
  724.    ((equal type "pascal-string")
  725.     (let ((length (extract-internal data offset sizeof-char nil)))
  726.       (ae-extract "string" data (1+ offset) length)))
  727.    ((equal type typeFSS)
  728.     (ae-extract "string" data offset sizeof-FSSpec))
  729.    (t
  730.     nil)))
  731.  
  732. (defun PtoCstr (s)
  733.   (let* ((n (extract-internal s 0 1 nil)))
  734.     (substring s 1 (1+ n))))
  735.     
  736. (defun CtoPstr (s)
  737.   (let* ((n (length s))
  738.          (m (if (> n 255) 255 n))
  739.          (u (concat " " s)))
  740.     (encode-internal u 0 1 m nil)
  741.     u))
  742.  
  743. (defvar documented-error-list
  744.   (mapcar (function (lambda (x) (cons (eval x) x)))
  745.           '(nsvErr fnfErr connectionInvalid errAEEventNotHandled
  746.                    errAENoSuchObject errAEDescNotFound errAENoUserInteraction)))
  747.  
  748. (defun lookup-error-string (err)
  749.   (let ((match (assoc err documented-error-list)))
  750.     (if match
  751.         (get (cdr match) 'variable-documentation)
  752.       nil)))
  753.  
  754. (provide 'mac-headers)
  755.