This commit was manufactured by cvs2svn to create tag 'r212'.
[python/dscho.git] / Mac / Lib / lib-scriptpackages / CodeWarrior / Standard_Suite.py
blob96581c57585de2802df3f6bd61b7d1b422bfa702
1 """Suite Standard Suite: Common terms for most applications
2 Level 1, version 1
4 Generated from Macintosh HD:SWdev:CodeWarrior 6 MPTP:Metrowerks CodeWarrior:CodeWarrior IDE 4.1B9
5 AETE/AEUT resource version 1/0, language 0, script 0
6 """
8 import aetools
9 import MacOS
11 _code = 'CoRe'
13 class Standard_Suite_Events:
15 _argmap_close = {
16 'saving' : 'savo',
17 'saving_in' : 'kfil',
20 def close(self, _object, _attributes={}, **_arguments):
21 """close: close an object
22 Required argument: the object to close
23 Keyword argument saving: specifies whether or not changes should be saved before closing
24 Keyword argument saving_in: the file in which to save the object
25 Keyword argument _attributes: AppleEvent attribute dictionary
26 """
27 _code = 'core'
28 _subcode = 'clos'
30 aetools.keysubst(_arguments, self._argmap_close)
31 _arguments['----'] = _object
33 aetools.enumsubst(_arguments, 'savo', _Enum_savo)
35 _reply, _arguments, _attributes = self.send(_code, _subcode,
36 _arguments, _attributes)
37 if _arguments.has_key('errn'):
38 raise aetools.Error, aetools.decodeerror(_arguments)
39 # XXXX Optionally decode result
40 if _arguments.has_key('----'):
41 return _arguments['----']
43 _argmap_count = {
44 'each' : 'kocl',
47 def count(self, _object, _attributes={}, **_arguments):
48 """count: return the number of elements of a particular class within an object
49 Required argument: the object whose elements are to be counted
50 Keyword argument each: the class of the elements to be counted. Keyword 'each' is optional in AppleScript
51 Keyword argument _attributes: AppleEvent attribute dictionary
52 Returns: the number of elements
53 """
54 _code = 'core'
55 _subcode = 'cnte'
57 aetools.keysubst(_arguments, self._argmap_count)
58 _arguments['----'] = _object
61 _reply, _arguments, _attributes = self.send(_code, _subcode,
62 _arguments, _attributes)
63 if _arguments.has_key('errn'):
64 raise aetools.Error, aetools.decodeerror(_arguments)
65 # XXXX Optionally decode result
66 if _arguments.has_key('----'):
67 return _arguments['----']
69 _argmap_get = {
70 'as' : 'rtyp',
73 def get(self, _object, _attributes={}, **_arguments):
74 """get: get the data for an object
75 Required argument: the object whose data is to be returned
76 Keyword argument as: the desired types for the data, in order of preference
77 Keyword argument _attributes: AppleEvent attribute dictionary
78 Returns: The data from the object
79 """
80 _code = 'core'
81 _subcode = 'getd'
83 aetools.keysubst(_arguments, self._argmap_get)
84 _arguments['----'] = _object
87 _reply, _arguments, _attributes = self.send(_code, _subcode,
88 _arguments, _attributes)
89 if _arguments.has_key('errn'):
90 raise aetools.Error, aetools.decodeerror(_arguments)
91 # XXXX Optionally decode result
92 if _arguments.has_key('----'):
93 return _arguments['----']
95 _argmap_make = {
96 'new' : 'kocl',
97 'as' : 'rtyp',
98 'at' : 'insh',
99 'with_data' : 'data',
100 'with_properties' : 'prdt',
103 def make(self, _no_object=None, _attributes={}, **_arguments):
104 """make: make a new element
105 Keyword argument new: the class of the new element„keyword 'new' is optional in AppleScript
106 Keyword argument as: the desired types for the data, in order of preference
107 Keyword argument at: the location at which to insert the element
108 Keyword argument with_data: the initial data for the element
109 Keyword argument with_properties: the initial values for the properties of the element
110 Keyword argument _attributes: AppleEvent attribute dictionary
111 Returns: to the new object(s)
113 _code = 'core'
114 _subcode = 'crel'
116 aetools.keysubst(_arguments, self._argmap_make)
117 if _no_object != None: raise TypeError, 'No direct arg expected'
120 _reply, _arguments, _attributes = self.send(_code, _subcode,
121 _arguments, _attributes)
122 if _arguments.has_key('errn'):
123 raise aetools.Error, aetools.decodeerror(_arguments)
124 # XXXX Optionally decode result
125 if _arguments.has_key('----'):
126 return _arguments['----']
128 def select(self, _object=None, _attributes={}, **_arguments):
129 """select: select the specified object
130 Required argument: the object to select
131 Keyword argument _attributes: AppleEvent attribute dictionary
133 _code = 'misc'
134 _subcode = 'slct'
136 if _arguments: raise TypeError, 'No optional args expected'
137 _arguments['----'] = _object
140 _reply, _arguments, _attributes = self.send(_code, _subcode,
141 _arguments, _attributes)
142 if _arguments.has_key('errn'):
143 raise aetools.Error, aetools.decodeerror(_arguments)
144 # XXXX Optionally decode result
145 if _arguments.has_key('----'):
146 return _arguments['----']
148 _argmap_set = {
149 'to' : 'data',
152 def set(self, _object, _attributes={}, **_arguments):
153 """set: set an object's data
154 Required argument: the object to change
155 Keyword argument to: the new value
156 Keyword argument _attributes: AppleEvent attribute dictionary
158 _code = 'core'
159 _subcode = 'setd'
161 aetools.keysubst(_arguments, self._argmap_set)
162 _arguments['----'] = _object
165 _reply, _arguments, _attributes = self.send(_code, _subcode,
166 _arguments, _attributes)
167 if _arguments.has_key('errn'):
168 raise aetools.Error, aetools.decodeerror(_arguments)
169 # XXXX Optionally decode result
170 if _arguments.has_key('----'):
171 return _arguments['----']
174 class application(aetools.ComponentItem):
175 """application - an application program """
176 want = 'capp'
177 class user_interaction(aetools.NProperty):
178 """user interaction - user interaction level """
179 which = 'inte'
180 want = 'Inte'
181 # element 'docu' as ['indx', 'name', 'rang']
182 # element 'cwin' as ['indx', 'name', 'rang']
184 class character(aetools.ComponentItem):
185 """character - a character """
186 want = 'cha '
187 class offset(aetools.NProperty):
188 """offset - offset of a text object from the beginning of the document (first char has offset 1) """
189 which = 'pOff'
190 want = 'long'
191 class length(aetools.NProperty):
192 """length - length in characters of this object """
193 which = 'pLen'
194 want = 'long'
196 class document(aetools.ComponentItem):
197 """document - a document """
198 want = 'docu'
199 class name(aetools.NProperty):
200 """name - the title of the document """
201 which = 'pnam'
202 want = 'itxt'
203 class kind(aetools.NProperty):
204 """kind - the kind of document """
205 which = 'DKND'
206 want = 'DKND'
207 class index(aetools.NProperty):
208 """index - the number of the document """
209 which = 'pidx'
210 want = 'long'
211 class location(aetools.NProperty):
212 """location - the file of the document """
213 which = 'FILE'
214 want = 'fss '
215 class file_permissions(aetools.NProperty):
216 """file permissions - the file permissions for the document """
217 which = 'PERM'
218 want = 'PERM'
219 class window(aetools.NProperty):
220 """window - the window of the document. """
221 which = 'cwin'
222 want = 'cwin'
224 documents = document
226 class file(aetools.ComponentItem):
227 """file - A file """
228 want = 'file'
230 files = file
232 class insertion_point(aetools.ComponentItem):
233 """insertion point - An insertion location between two objects """
234 want = 'cins'
235 # repeated property length length of text object (in characters)
236 # repeated property offset offset of a text object from the beginning of the document (first char has offset 1)
238 class line(aetools.ComponentItem):
239 """line - lines of text """
240 want = 'clin'
241 # repeated property index index of a line object from the beginning of the document (first line has index 1)
242 # repeated property offset offset (in characters) of a line object from the beginning of the document
243 # repeated property length length in characters of this object
244 # element 'cha ' as ['indx', 'rang', 'rele']
246 lines = line
248 class selection_2d_object(aetools.ComponentItem):
249 """selection-object - the selection visible to the user """
250 want = 'csel'
251 class contents(aetools.NProperty):
252 """contents - the contents of the selection """
253 which = 'pcnt'
254 want = 'type'
255 # repeated property length length of text object (in characters)
256 # repeated property offset offset of a text object from the beginning of the document (first char has offset 1)
257 # element 'cha ' as ['indx', 'rele', 'rang', 'test']
258 # element 'clin' as ['indx', 'rang', 'rele']
259 # element 'ctxt' as ['rang']
261 class text(aetools.ComponentItem):
262 """text - Text """
263 want = 'ctxt'
264 # repeated property length length of text object (in characters)
265 # repeated property offset offset of a text object from the beginning of the document (first char has offset 1)
266 # element 'cha ' as ['indx', 'rele', 'rang']
267 # element 'cins' as ['rele']
268 # element 'clin' as ['indx', 'rang', 'rele']
269 # element 'ctxt' as ['rang']
271 class window(aetools.ComponentItem):
272 """window - A window """
273 want = 'cwin'
274 # repeated property name the title of the window
275 # repeated property index the number of the window
276 class bounds(aetools.NProperty):
277 """bounds - the boundary rectangle for the window """
278 which = 'pbnd'
279 want = 'qdrt'
280 class document(aetools.NProperty):
281 """document - the document that owns this window """
282 which = 'docu'
283 want = 'docu'
284 class position(aetools.NProperty):
285 """position - upper left coordinates of window """
286 which = 'ppos'
287 want = 'QDpt'
288 class visible(aetools.NProperty):
289 """visible - is the window visible? """
290 which = 'pvis'
291 want = 'bool'
292 class zoomed(aetools.NProperty):
293 """zoomed - Is the window zoomed? """
294 which = 'pzum'
295 want = 'bool'
297 windows = window
298 application._propdict = {
299 'user_interaction' : user_interaction,
301 application._elemdict = {
302 'document' : document,
303 'window' : window,
305 character._propdict = {
306 'offset' : offset,
307 'length' : length,
309 character._elemdict = {
311 document._propdict = {
312 'name' : name,
313 'kind' : kind,
314 'index' : index,
315 'location' : location,
316 'file_permissions' : file_permissions,
317 'window' : window,
319 document._elemdict = {
321 file._propdict = {
323 file._elemdict = {
325 insertion_point._propdict = {
326 'length' : length,
327 'offset' : offset,
329 insertion_point._elemdict = {
331 line._propdict = {
332 'index' : index,
333 'offset' : offset,
334 'length' : length,
336 line._elemdict = {
337 'character' : character,
339 selection_2d_object._propdict = {
340 'contents' : contents,
341 'length' : length,
342 'offset' : offset,
344 selection_2d_object._elemdict = {
345 'character' : character,
346 'line' : line,
347 'text' : text,
349 text._propdict = {
350 'length' : length,
351 'offset' : offset,
353 text._elemdict = {
354 'character' : character,
355 'insertion_point' : insertion_point,
356 'line' : line,
357 'text' : text,
359 window._propdict = {
360 'name' : name,
361 'index' : index,
362 'bounds' : bounds,
363 'document' : document,
364 'position' : position,
365 'visible' : visible,
366 'zoomed' : zoomed,
368 window._elemdict = {
370 import Metrowerks_Shell_Suite
371 from Metrowerks_Shell_Suite import _Enum_savo
374 # Indices of types declared in this module
376 _classdeclarations = {
377 'docu' : document,
378 'cins' : insertion_point,
379 'capp' : application,
380 'ctxt' : text,
381 'csel' : selection_2d_object,
382 'clin' : line,
383 'file' : file,
384 'cwin' : window,
385 'cha ' : character,
388 _propdeclarations = {
389 'pzum' : zoomed,
390 'DKND' : kind,
391 'pOff' : offset,
392 'pLen' : length,
393 'pnam' : name,
394 'FILE' : location,
395 'pcnt' : contents,
396 'cwin' : window,
397 'ppos' : position,
398 'pidx' : index,
399 'docu' : document,
400 'PERM' : file_permissions,
401 'pbnd' : bounds,
402 'pvis' : visible,
403 'inte' : user_interaction,
406 _compdeclarations = {
409 _enumdeclarations = {