Standard_Suite.py 12 KB
Newer Older
1 2 3
"""Suite Standard Suite: Common terms for most applications
Level 1, version 1

4
Generated from /Volumes/Sap/Applications (Mac OS 9)/Metrowerks CodeWarrior 7.0/Metrowerks CodeWarrior/CodeWarrior IDE 4.2.5
5 6 7 8 9 10 11 12
AETE/AEUT resource version 1/0, language 0, script 0
"""

import aetools
import MacOS

_code = 'CoRe'

13 14
from StdSuites.Standard_Suite import *
class Standard_Suite_Events(Standard_Suite_Events):
15

16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172
    _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 != 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['----']
173 174 175


class application(aetools.ComponentItem):
176 177
    """application - an application program """
    want = 'capp'
178
class _Prop_user_interaction(aetools.NProperty):
179 180 181
    """user interaction - user interaction level """
    which = 'inte'
    want = 'Inte'
182
user_interaction = _Prop_user_interaction()
183
#        element 'cwin' as ['indx', 'name', 'rang']
184
#        element 'docu' as ['indx', 'name', 'rang']
185 186

class character(aetools.ComponentItem):
187 188
    """character - a character """
    want = 'cha '
189
class _Prop_length(aetools.NProperty):
190 191 192
    """length - length in characters of this object """
    which = 'pLen'
    want = 'long'
193
class _Prop_offset(aetools.NProperty):
194 195 196
    """offset - offset of a text object from the beginning of the document (first char has offset 1) """
    which = 'pOff'
    want = 'long'
197 198

class insertion_point(aetools.ComponentItem):
199 200
    """insertion point - An insertion location between two objects """
    want = 'cins'
201 202

class line(aetools.ComponentItem):
203 204
    """line - lines of text """
    want = 'clin'
205
class _Prop_index(aetools.NProperty):
206 207 208
    """index - index of a line object from the beginning of the document (first line has index 1) """
    which = 'pidx'
    want = 'long'
209 210 211 212 213
#        element 'cha ' as ['indx', 'rang', 'rele']

lines = line

class selection_2d_object(aetools.ComponentItem):
214 215
    """selection-object - the selection visible to the user """
    want = 'csel'
216
class _Prop_contents(aetools.NProperty):
217 218 219
    """contents - the contents of the selection """
    which = 'pcnt'
    want = 'type'
220 221 222 223 224
#        element 'cha ' as ['indx', 'rele', 'rang', 'test']
#        element 'clin' as ['indx', 'rang', 'rele']
#        element 'ctxt' as ['rang']

class text(aetools.ComponentItem):
225 226
    """text - Text """
    want = 'ctxt'
227 228 229 230 231 232
#        element 'cha ' as ['indx', 'rele', 'rang']
#        element 'cins' as ['rele']
#        element 'clin' as ['indx', 'rang', 'rele']
#        element 'ctxt' as ['rang']

class window(aetools.ComponentItem):
233 234
    """window - A window """
    want = 'cwin'
235
class _Prop_bounds(aetools.NProperty):
236 237 238
    """bounds - the boundary rectangle for the window """
    which = 'pbnd'
    want = 'qdrt'
239
class _Prop_document(aetools.NProperty):
240 241 242
    """document - the document that owns this window """
    which = 'docu'
    want = 'docu'
243
class _Prop_name(aetools.NProperty):
244 245 246
    """name - the title of the window """
    which = 'pnam'
    want = 'itxt'
247
class _Prop_position(aetools.NProperty):
248 249 250
    """position - upper left coordinates of window """
    which = 'ppos'
    want = 'QDpt'
251
class _Prop_visible(aetools.NProperty):
252 253 254
    """visible - is the window visible? """
    which = 'pvis'
    want = 'bool'
255
class _Prop_zoomed(aetools.NProperty):
256 257 258
    """zoomed - Is the window zoomed? """
    which = 'pzum'
    want = 'bool'
259 260

windows = window
261 262

class document(aetools.ComponentItem):
263 264
    """document - a document """
    want = 'docu'
265
class _Prop_file_permissions(aetools.NProperty):
266 267 268
    """file permissions - the file permissions for the document """
    which = 'PERM'
    want = 'PERM'
269
class _Prop_kind(aetools.NProperty):
270 271 272
    """kind - the kind of document """
    which = 'DKND'
    want = 'DKND'
273
class _Prop_location(aetools.NProperty):
274 275 276
    """location - the file of the document """
    which = 'FILE'
    want = 'fss '
277
class _Prop_window(aetools.NProperty):
278 279 280
    """window - the window of the document. """
    which = 'cwin'
    want = 'cwin'
281 282 283 284

documents = document

class files(aetools.ComponentItem):
285 286
    """files - Every file """
    want = 'file'
287 288

file = files
289 290
application._superclassnames = []
application._privpropdict = {
291
    'user_interaction' : _Prop_user_interaction,
292
}
293
application._privelemdict = {
294 295
    'document' : document,
    'window' : window,
296
}
297 298
character._superclassnames = []
character._privpropdict = {
299 300
    'length' : _Prop_length,
    'offset' : _Prop_offset,
301
}
302
character._privelemdict = {
303
}
304 305
insertion_point._superclassnames = []
insertion_point._privpropdict = {
306 307
    'length' : _Prop_length,
    'offset' : _Prop_offset,
308
}
309
insertion_point._privelemdict = {
310
}
311 312
line._superclassnames = []
line._privpropdict = {
313 314 315
    'index' : _Prop_index,
    'length' : _Prop_length,
    'offset' : _Prop_offset,
316
}
317
line._privelemdict = {
318
    'character' : character,
319
}
320 321
selection_2d_object._superclassnames = []
selection_2d_object._privpropdict = {
322 323 324
    'contents' : _Prop_contents,
    'length' : _Prop_length,
    'offset' : _Prop_offset,
325
}
326
selection_2d_object._privelemdict = {
327 328 329
    'character' : character,
    'line' : line,
    'text' : text,
330
}
331 332
text._superclassnames = []
text._privpropdict = {
333 334
    'length' : _Prop_length,
    'offset' : _Prop_offset,
335
}
336
text._privelemdict = {
337 338 339 340
    'character' : character,
    'insertion_point' : insertion_point,
    'line' : line,
    'text' : text,
341
}
342 343
window._superclassnames = []
window._privpropdict = {
344 345 346 347 348 349 350
    'bounds' : _Prop_bounds,
    'document' : _Prop_document,
    'index' : _Prop_index,
    'name' : _Prop_name,
    'position' : _Prop_position,
    'visible' : _Prop_visible,
    'zoomed' : _Prop_zoomed,
351
}
352
window._privelemdict = {
353
}
354 355
document._superclassnames = []
document._privpropdict = {
356 357 358 359 360 361
    'file_permissions' : _Prop_file_permissions,
    'index' : _Prop_index,
    'kind' : _Prop_kind,
    'location' : _Prop_location,
    'name' : _Prop_name,
    'window' : _Prop_window,
362 363 364 365 366 367 368 369
}
document._privelemdict = {
}
files._superclassnames = []
files._privpropdict = {
}
files._privelemdict = {
}
370 371 372 373 374

#
# Indices of types declared in this module
#
_classdeclarations = {
375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407
    '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 = {
408
}