PageRenderTime 63ms CodeModel.GetById 20ms app.highlight 20ms RepoModel.GetById 20ms app.codeStats 0ms

/Lib/plat-mac/lib-scriptpackages/Netscape/Standard_Suite.py

http://unladen-swallow.googlecode.com/
Python | 243 lines | 164 code | 27 blank | 52 comment | 11 complexity | fcfa3e64ec9c3c1a64dfd97f62f9ab34 MD5 | raw file
  1"""Suite Standard Suite: Common terms for most applications
  2Level 1, version 1
  3
  4Generated from /Volumes/Sap/Applications (Mac OS 9)/Netscape Communicator\xe2\x84\xa2 Folder/Netscape Communicator\xe2\x84\xa2
  5AETE/AEUT resource version 1/0, language 0, script 0
  6"""
  7
  8import aetools
  9import MacOS
 10
 11_code = 'CoRe'
 12
 13from StdSuites.Standard_Suite import *
 14class Standard_Suite_Events(Standard_Suite_Events):
 15
 16    def close(self, _object, _attributes={}, **_arguments):
 17        """close: Close an object
 18        Required argument: the objects to close
 19        Keyword argument _attributes: AppleEvent attribute dictionary
 20        """
 21        _code = 'core'
 22        _subcode = 'clos'
 23
 24        if _arguments: raise TypeError, 'No optional args expected'
 25        _arguments['----'] = _object
 26
 27
 28        _reply, _arguments, _attributes = self.send(_code, _subcode,
 29                _arguments, _attributes)
 30        if _arguments.get('errn', 0):
 31            raise aetools.Error, aetools.decodeerror(_arguments)
 32        # XXXX Optionally decode result
 33        if _arguments.has_key('----'):
 34            return _arguments['----']
 35
 36    def data_size(self, _object, _attributes={}, **_arguments):
 37        """data size: Return the size in bytes of an object
 38        Required argument: the object whose data size is to be returned
 39        Keyword argument _attributes: AppleEvent attribute dictionary
 40        Returns: the size of the object in bytes
 41        """
 42        _code = 'core'
 43        _subcode = 'dsiz'
 44
 45        if _arguments: raise TypeError, 'No optional args expected'
 46        _arguments['----'] = _object
 47
 48
 49        _reply, _arguments, _attributes = self.send(_code, _subcode,
 50                _arguments, _attributes)
 51        if _arguments.get('errn', 0):
 52            raise aetools.Error, aetools.decodeerror(_arguments)
 53        # XXXX Optionally decode result
 54        if _arguments.has_key('----'):
 55            return _arguments['----']
 56
 57    def get(self, _object, _attributes={}, **_arguments):
 58        """get: Get the data for an object
 59        Required argument: the object whose data is to be returned
 60        Keyword argument _attributes: AppleEvent attribute dictionary
 61        Returns: The data from the object
 62        """
 63        _code = 'core'
 64        _subcode = 'getd'
 65
 66        if _arguments: raise TypeError, 'No optional args expected'
 67        _arguments['----'] = _object
 68
 69
 70        _reply, _arguments, _attributes = self.send(_code, _subcode,
 71                _arguments, _attributes)
 72        if _arguments.get('errn', 0):
 73            raise aetools.Error, aetools.decodeerror(_arguments)
 74        # XXXX Optionally decode result
 75        if _arguments.has_key('----'):
 76            return _arguments['----']
 77
 78    _argmap_set = {
 79        'to' : 'data',
 80    }
 81
 82    def set(self, _object, _attributes={}, **_arguments):
 83        """set: Set an object\xd5s data
 84        Required argument: the object to change
 85        Keyword argument to: the new value
 86        Keyword argument _attributes: AppleEvent attribute dictionary
 87        """
 88        _code = 'core'
 89        _subcode = 'setd'
 90
 91        aetools.keysubst(_arguments, self._argmap_set)
 92        _arguments['----'] = _object
 93
 94
 95        _reply, _arguments, _attributes = self.send(_code, _subcode,
 96                _arguments, _attributes)
 97        if _arguments.get('errn', 0):
 98            raise aetools.Error, aetools.decodeerror(_arguments)
 99        # XXXX Optionally decode result
100        if _arguments.has_key('----'):
101            return _arguments['----']
102
103
104class application(aetools.ComponentItem):
105    """application - An application program """
106    want = 'capp'
107class _Prop_alert_application(aetools.NProperty):
108    """alert application - Most of the alerts will be sent to this application using yet unspecified AE interface. We need a few alert boxes: alert, confirm and notify. Any ideas on how to design this event? mailto:atotic@netscape.com. I\xd5d like to conform to the standard. """
109    which = 'ALAP'
110    want = 'type'
111alert_application = _Prop_alert_application()
112class _Prop_kiosk_mode(aetools.NProperty):
113    """kiosk mode - Kiosk mode leaves very few menus enabled """
114    which = 'KOSK'
115    want = 'long'
116kiosk_mode = _Prop_kiosk_mode()
117#        element 'cwin' as ['indx', 'name', 'ID  ']
118
119class window(aetools.ComponentItem):
120    """window - A Window """
121    want = 'cwin'
122class _Prop_URL(aetools.NProperty):
123    """URL - Current URL """
124    which = 'curl'
125    want = 'TEXT'
126class _Prop_bounds(aetools.NProperty):
127    """bounds - the boundary rectangle for the window """
128    which = 'pbnd'
129    want = 'qdrt'
130class _Prop_busy(aetools.NProperty):
131    """busy - Is window loading something right now. 2, window is busy and will reject load requests. 1, window is busy, but will interrupt outstanding loads """
132    which = 'busy'
133    want = 'long'
134class _Prop_closeable(aetools.NProperty):
135    """closeable - Does the window have a close box? """
136    which = 'hclb'
137    want = 'bool'
138class _Prop_floating(aetools.NProperty):
139    """floating - Does the window float? """
140    which = 'isfl'
141    want = 'bool'
142class _Prop_index(aetools.NProperty):
143    """index - the number of the window """
144    which = 'pidx'
145    want = 'long'
146class _Prop_modal(aetools.NProperty):
147    """modal - Is the window modal? """
148    which = 'pmod'
149    want = 'bool'
150class _Prop_name(aetools.NProperty):
151    """name - the title of the window """
152    which = 'pnam'
153    want = 'itxt'
154class _Prop_position(aetools.NProperty):
155    """position - upper left coordinates of window """
156    which = 'ppos'
157    want = 'QDpt'
158class _Prop_resizable(aetools.NProperty):
159    """resizable - Is the window resizable? """
160    which = 'prsz'
161    want = 'bool'
162class _Prop_titled(aetools.NProperty):
163    """titled - Does the window have a title bar? """
164    which = 'ptit'
165    want = 'bool'
166class _Prop_unique_ID(aetools.NProperty):
167    """unique ID - Window\xd5s unique ID (a bridge between WWW! suite window id\xd5s and standard AE windows) """
168    which = 'wiid'
169    want = 'long'
170class _Prop_visible(aetools.NProperty):
171    """visible - is the window visible? """
172    which = 'pvis'
173    want = 'bool'
174class _Prop_zoomable(aetools.NProperty):
175    """zoomable - Is the window zoomable? """
176    which = 'iszm'
177    want = 'bool'
178class _Prop_zoomed(aetools.NProperty):
179    """zoomed - Is the window zoomed? """
180    which = 'pzum'
181    want = 'bool'
182application._superclassnames = []
183application._privpropdict = {
184    'alert_application' : _Prop_alert_application,
185    'kiosk_mode' : _Prop_kiosk_mode,
186}
187application._privelemdict = {
188    'window' : window,
189}
190window._superclassnames = []
191window._privpropdict = {
192    'URL' : _Prop_URL,
193    'bounds' : _Prop_bounds,
194    'busy' : _Prop_busy,
195    'closeable' : _Prop_closeable,
196    'floating' : _Prop_floating,
197    'index' : _Prop_index,
198    'modal' : _Prop_modal,
199    'name' : _Prop_name,
200    'position' : _Prop_position,
201    'resizable' : _Prop_resizable,
202    'titled' : _Prop_titled,
203    'unique_ID' : _Prop_unique_ID,
204    'visible' : _Prop_visible,
205    'zoomable' : _Prop_zoomable,
206    'zoomed' : _Prop_zoomed,
207}
208window._privelemdict = {
209}
210
211#
212# Indices of types declared in this module
213#
214_classdeclarations = {
215    'capp' : application,
216    'cwin' : window,
217}
218
219_propdeclarations = {
220    'ALAP' : _Prop_alert_application,
221    'KOSK' : _Prop_kiosk_mode,
222    'busy' : _Prop_busy,
223    'curl' : _Prop_URL,
224    'hclb' : _Prop_closeable,
225    'isfl' : _Prop_floating,
226    'iszm' : _Prop_zoomable,
227    'pbnd' : _Prop_bounds,
228    'pidx' : _Prop_index,
229    'pmod' : _Prop_modal,
230    'pnam' : _Prop_name,
231    'ppos' : _Prop_position,
232    'prsz' : _Prop_resizable,
233    'ptit' : _Prop_titled,
234    'pvis' : _Prop_visible,
235    'pzum' : _Prop_zoomed,
236    'wiid' : _Prop_unique_ID,
237}
238
239_compdeclarations = {
240}
241
242_enumdeclarations = {
243}