PageRenderTime 51ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/lib-python/2.7/plat-mac/lib-scriptpackages/CodeWarrior/Standard_Suite.py

https://bitbucket.org/dac_io/pypy
Python | 408 lines | 382 code | 10 blank | 16 comment | 2 complexity | c798221a5d8f999824f7ac4919aecb0a MD5 | raw file
  1. """Suite Standard Suite: Common terms for most applications
  2. Level 1, version 1
  3. Generated from /Volumes/Sap/Applications (Mac OS 9)/Metrowerks CodeWarrior 7.0/Metrowerks CodeWarrior/CodeWarrior IDE 4.2.5
  4. AETE/AEUT resource version 1/0, language 0, script 0
  5. """
  6. import aetools
  7. import MacOS
  8. _code = 'CoRe'
  9. from StdSuites.Standard_Suite import *
  10. class Standard_Suite_Events(Standard_Suite_Events):
  11. _argmap_close = {
  12. 'saving' : 'savo',
  13. 'saving_in' : 'kfil',
  14. }
  15. def close(self, _object, _attributes={}, **_arguments):
  16. """close: close an object
  17. Required argument: the object to close
  18. Keyword argument saving: specifies whether or not changes should be saved before closing
  19. Keyword argument saving_in: the file in which to save the object
  20. Keyword argument _attributes: AppleEvent attribute dictionary
  21. """
  22. _code = 'core'
  23. _subcode = 'clos'
  24. aetools.keysubst(_arguments, self._argmap_close)
  25. _arguments['----'] = _object
  26. aetools.enumsubst(_arguments, 'savo', _Enum_savo)
  27. _reply, _arguments, _attributes = self.send(_code, _subcode,
  28. _arguments, _attributes)
  29. if _arguments.get('errn', 0):
  30. raise aetools.Error, aetools.decodeerror(_arguments)
  31. # XXXX Optionally decode result
  32. if _arguments.has_key('----'):
  33. return _arguments['----']
  34. _argmap_count = {
  35. 'each' : 'kocl',
  36. }
  37. def count(self, _object, _attributes={}, **_arguments):
  38. """count: return the number of elements of a particular class within an object
  39. Required argument: the object whose elements are to be counted
  40. Keyword argument each: the class of the elements to be counted. Keyword 'each' is optional in AppleScript
  41. Keyword argument _attributes: AppleEvent attribute dictionary
  42. Returns: the number of elements
  43. """
  44. _code = 'core'
  45. _subcode = 'cnte'
  46. aetools.keysubst(_arguments, self._argmap_count)
  47. _arguments['----'] = _object
  48. _reply, _arguments, _attributes = self.send(_code, _subcode,
  49. _arguments, _attributes)
  50. if _arguments.get('errn', 0):
  51. raise aetools.Error, aetools.decodeerror(_arguments)
  52. # XXXX Optionally decode result
  53. if _arguments.has_key('----'):
  54. return _arguments['----']
  55. _argmap_get = {
  56. 'as' : 'rtyp',
  57. }
  58. def get(self, _object, _attributes={}, **_arguments):
  59. """get: get the data for an object
  60. Required argument: the object whose data is to be returned
  61. Keyword argument as: the desired types for the data, in order of preference
  62. Keyword argument _attributes: AppleEvent attribute dictionary
  63. Returns: The data from the object
  64. """
  65. _code = 'core'
  66. _subcode = 'getd'
  67. aetools.keysubst(_arguments, self._argmap_get)
  68. _arguments['----'] = _object
  69. _reply, _arguments, _attributes = self.send(_code, _subcode,
  70. _arguments, _attributes)
  71. if _arguments.get('errn', 0):
  72. raise aetools.Error, aetools.decodeerror(_arguments)
  73. # XXXX Optionally decode result
  74. if _arguments.has_key('----'):
  75. return _arguments['----']
  76. _argmap_make = {
  77. 'new' : 'kocl',
  78. 'as' : 'rtyp',
  79. 'at' : 'insh',
  80. 'with_data' : 'data',
  81. 'with_properties' : 'prdt',
  82. }
  83. def make(self, _no_object=None, _attributes={}, **_arguments):
  84. """make: make a new element
  85. Keyword argument new: the class of the new element\xd1keyword 'new' is optional in AppleScript
  86. Keyword argument as: the desired types for the data, in order of preference
  87. Keyword argument at: the location at which to insert the element
  88. Keyword argument with_data: the initial data for the element
  89. Keyword argument with_properties: the initial values for the properties of the element
  90. Keyword argument _attributes: AppleEvent attribute dictionary
  91. Returns: to the new object(s)
  92. """
  93. _code = 'core'
  94. _subcode = 'crel'
  95. aetools.keysubst(_arguments, self._argmap_make)
  96. if _no_object is not None: raise TypeError, 'No direct arg expected'
  97. _reply, _arguments, _attributes = self.send(_code, _subcode,
  98. _arguments, _attributes)
  99. if _arguments.get('errn', 0):
  100. raise aetools.Error, aetools.decodeerror(_arguments)
  101. # XXXX Optionally decode result
  102. if _arguments.has_key('----'):
  103. return _arguments['----']
  104. def select(self, _object=None, _attributes={}, **_arguments):
  105. """select: select the specified object
  106. Required argument: the object to select
  107. Keyword argument _attributes: AppleEvent attribute dictionary
  108. """
  109. _code = 'misc'
  110. _subcode = 'slct'
  111. if _arguments: raise TypeError, 'No optional args expected'
  112. _arguments['----'] = _object
  113. _reply, _arguments, _attributes = self.send(_code, _subcode,
  114. _arguments, _attributes)
  115. if _arguments.get('errn', 0):
  116. raise aetools.Error, aetools.decodeerror(_arguments)
  117. # XXXX Optionally decode result
  118. if _arguments.has_key('----'):
  119. return _arguments['----']
  120. _argmap_set = {
  121. 'to' : 'data',
  122. }
  123. def set(self, _object, _attributes={}, **_arguments):
  124. """set: set an object's data
  125. Required argument: the object to change
  126. Keyword argument to: the new value
  127. Keyword argument _attributes: AppleEvent attribute dictionary
  128. """
  129. _code = 'core'
  130. _subcode = 'setd'
  131. aetools.keysubst(_arguments, self._argmap_set)
  132. _arguments['----'] = _object
  133. _reply, _arguments, _attributes = self.send(_code, _subcode,
  134. _arguments, _attributes)
  135. if _arguments.get('errn', 0):
  136. raise aetools.Error, aetools.decodeerror(_arguments)
  137. # XXXX Optionally decode result
  138. if _arguments.has_key('----'):
  139. return _arguments['----']
  140. class application(aetools.ComponentItem):
  141. """application - an application program """
  142. want = 'capp'
  143. class _Prop_user_interaction(aetools.NProperty):
  144. """user interaction - user interaction level """
  145. which = 'inte'
  146. want = 'Inte'
  147. user_interaction = _Prop_user_interaction()
  148. # element 'cwin' as ['indx', 'name', 'rang']
  149. # element 'docu' as ['indx', 'name', 'rang']
  150. class character(aetools.ComponentItem):
  151. """character - a character """
  152. want = 'cha '
  153. class _Prop_length(aetools.NProperty):
  154. """length - length in characters of this object """
  155. which = 'pLen'
  156. want = 'long'
  157. class _Prop_offset(aetools.NProperty):
  158. """offset - offset of a text object from the beginning of the document (first char has offset 1) """
  159. which = 'pOff'
  160. want = 'long'
  161. class insertion_point(aetools.ComponentItem):
  162. """insertion point - An insertion location between two objects """
  163. want = 'cins'
  164. class line(aetools.ComponentItem):
  165. """line - lines of text """
  166. want = 'clin'
  167. class _Prop_index(aetools.NProperty):
  168. """index - index of a line object from the beginning of the document (first line has index 1) """
  169. which = 'pidx'
  170. want = 'long'
  171. # element 'cha ' as ['indx', 'rang', 'rele']
  172. lines = line
  173. class selection_2d_object(aetools.ComponentItem):
  174. """selection-object - the selection visible to the user """
  175. want = 'csel'
  176. class _Prop_contents(aetools.NProperty):
  177. """contents - the contents of the selection """
  178. which = 'pcnt'
  179. want = 'type'
  180. # element 'cha ' as ['indx', 'rele', 'rang', 'test']
  181. # element 'clin' as ['indx', 'rang', 'rele']
  182. # element 'ctxt' as ['rang']
  183. class text(aetools.ComponentItem):
  184. """text - Text """
  185. want = 'ctxt'
  186. # element 'cha ' as ['indx', 'rele', 'rang']
  187. # element 'cins' as ['rele']
  188. # element 'clin' as ['indx', 'rang', 'rele']
  189. # element 'ctxt' as ['rang']
  190. class window(aetools.ComponentItem):
  191. """window - A window """
  192. want = 'cwin'
  193. class _Prop_bounds(aetools.NProperty):
  194. """bounds - the boundary rectangle for the window """
  195. which = 'pbnd'
  196. want = 'qdrt'
  197. class _Prop_document(aetools.NProperty):
  198. """document - the document that owns this window """
  199. which = 'docu'
  200. want = 'docu'
  201. class _Prop_name(aetools.NProperty):
  202. """name - the title of the window """
  203. which = 'pnam'
  204. want = 'itxt'
  205. class _Prop_position(aetools.NProperty):
  206. """position - upper left coordinates of window """
  207. which = 'ppos'
  208. want = 'QDpt'
  209. class _Prop_visible(aetools.NProperty):
  210. """visible - is the window visible? """
  211. which = 'pvis'
  212. want = 'bool'
  213. class _Prop_zoomed(aetools.NProperty):
  214. """zoomed - Is the window zoomed? """
  215. which = 'pzum'
  216. want = 'bool'
  217. windows = window
  218. class document(aetools.ComponentItem):
  219. """document - a document """
  220. want = 'docu'
  221. class _Prop_file_permissions(aetools.NProperty):
  222. """file permissions - the file permissions for the document """
  223. which = 'PERM'
  224. want = 'PERM'
  225. class _Prop_kind(aetools.NProperty):
  226. """kind - the kind of document """
  227. which = 'DKND'
  228. want = 'DKND'
  229. class _Prop_location(aetools.NProperty):
  230. """location - the file of the document """
  231. which = 'FILE'
  232. want = 'fss '
  233. class _Prop_window(aetools.NProperty):
  234. """window - the window of the document. """
  235. which = 'cwin'
  236. want = 'cwin'
  237. documents = document
  238. class files(aetools.ComponentItem):
  239. """files - Every file """
  240. want = 'file'
  241. file = files
  242. application._superclassnames = []
  243. application._privpropdict = {
  244. 'user_interaction' : _Prop_user_interaction,
  245. }
  246. application._privelemdict = {
  247. 'document' : document,
  248. 'window' : window,
  249. }
  250. character._superclassnames = []
  251. character._privpropdict = {
  252. 'length' : _Prop_length,
  253. 'offset' : _Prop_offset,
  254. }
  255. character._privelemdict = {
  256. }
  257. insertion_point._superclassnames = []
  258. insertion_point._privpropdict = {
  259. 'length' : _Prop_length,
  260. 'offset' : _Prop_offset,
  261. }
  262. insertion_point._privelemdict = {
  263. }
  264. line._superclassnames = []
  265. line._privpropdict = {
  266. 'index' : _Prop_index,
  267. 'length' : _Prop_length,
  268. 'offset' : _Prop_offset,
  269. }
  270. line._privelemdict = {
  271. 'character' : character,
  272. }
  273. selection_2d_object._superclassnames = []
  274. selection_2d_object._privpropdict = {
  275. 'contents' : _Prop_contents,
  276. 'length' : _Prop_length,
  277. 'offset' : _Prop_offset,
  278. }
  279. selection_2d_object._privelemdict = {
  280. 'character' : character,
  281. 'line' : line,
  282. 'text' : text,
  283. }
  284. text._superclassnames = []
  285. text._privpropdict = {
  286. 'length' : _Prop_length,
  287. 'offset' : _Prop_offset,
  288. }
  289. text._privelemdict = {
  290. 'character' : character,
  291. 'insertion_point' : insertion_point,
  292. 'line' : line,
  293. 'text' : text,
  294. }
  295. window._superclassnames = []
  296. window._privpropdict = {
  297. 'bounds' : _Prop_bounds,
  298. 'document' : _Prop_document,
  299. 'index' : _Prop_index,
  300. 'name' : _Prop_name,
  301. 'position' : _Prop_position,
  302. 'visible' : _Prop_visible,
  303. 'zoomed' : _Prop_zoomed,
  304. }
  305. window._privelemdict = {
  306. }
  307. document._superclassnames = []
  308. document._privpropdict = {
  309. 'file_permissions' : _Prop_file_permissions,
  310. 'index' : _Prop_index,
  311. 'kind' : _Prop_kind,
  312. 'location' : _Prop_location,
  313. 'name' : _Prop_name,
  314. 'window' : _Prop_window,
  315. }
  316. document._privelemdict = {
  317. }
  318. files._superclassnames = []
  319. files._privpropdict = {
  320. }
  321. files._privelemdict = {
  322. }
  323. #
  324. # Indices of types declared in this module
  325. #
  326. _classdeclarations = {
  327. 'capp' : application,
  328. 'cha ' : character,
  329. 'cins' : insertion_point,
  330. 'clin' : line,
  331. 'csel' : selection_2d_object,
  332. 'ctxt' : text,
  333. 'cwin' : window,
  334. 'docu' : document,
  335. 'file' : files,
  336. }
  337. _propdeclarations = {
  338. 'DKND' : _Prop_kind,
  339. 'FILE' : _Prop_location,
  340. 'PERM' : _Prop_file_permissions,
  341. 'cwin' : _Prop_window,
  342. 'docu' : _Prop_document,
  343. 'inte' : _Prop_user_interaction,
  344. 'pLen' : _Prop_length,
  345. 'pOff' : _Prop_offset,
  346. 'pbnd' : _Prop_bounds,
  347. 'pcnt' : _Prop_contents,
  348. 'pidx' : _Prop_index,
  349. 'pnam' : _Prop_name,
  350. 'ppos' : _Prop_position,
  351. 'pvis' : _Prop_visible,
  352. 'pzum' : _Prop_zoomed,
  353. }
  354. _compdeclarations = {
  355. }
  356. _enumdeclarations = {
  357. }