/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
  2. Level 1, version 1
  3. Generated from /Volumes/Sap/Applications (Mac OS 9)/Netscape Communicator\xe2\x84\xa2 Folder/Netscape Communicator\xe2\x84\xa2
  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. def close(self, _object, _attributes={}, **_arguments):
  12. """close: Close an object
  13. Required argument: the objects to close
  14. Keyword argument _attributes: AppleEvent attribute dictionary
  15. """
  16. _code = 'core'
  17. _subcode = 'clos'
  18. if _arguments: raise TypeError, 'No optional args expected'
  19. _arguments['----'] = _object
  20. _reply, _arguments, _attributes = self.send(_code, _subcode,
  21. _arguments, _attributes)
  22. if _arguments.get('errn', 0):
  23. raise aetools.Error, aetools.decodeerror(_arguments)
  24. # XXXX Optionally decode result
  25. if _arguments.has_key('----'):
  26. return _arguments['----']
  27. def data_size(self, _object, _attributes={}, **_arguments):
  28. """data size: Return the size in bytes of an object
  29. Required argument: the object whose data size is to be returned
  30. Keyword argument _attributes: AppleEvent attribute dictionary
  31. Returns: the size of the object in bytes
  32. """
  33. _code = 'core'
  34. _subcode = 'dsiz'
  35. if _arguments: raise TypeError, 'No optional args expected'
  36. _arguments['----'] = _object
  37. _reply, _arguments, _attributes = self.send(_code, _subcode,
  38. _arguments, _attributes)
  39. if _arguments.get('errn', 0):
  40. raise aetools.Error, aetools.decodeerror(_arguments)
  41. # XXXX Optionally decode result
  42. if _arguments.has_key('----'):
  43. return _arguments['----']
  44. def get(self, _object, _attributes={}, **_arguments):
  45. """get: Get the data for an object
  46. Required argument: the object whose data is to be returned
  47. Keyword argument _attributes: AppleEvent attribute dictionary
  48. Returns: The data from the object
  49. """
  50. _code = 'core'
  51. _subcode = 'getd'
  52. if _arguments: raise TypeError, 'No optional args expected'
  53. _arguments['----'] = _object
  54. _reply, _arguments, _attributes = self.send(_code, _subcode,
  55. _arguments, _attributes)
  56. if _arguments.get('errn', 0):
  57. raise aetools.Error, aetools.decodeerror(_arguments)
  58. # XXXX Optionally decode result
  59. if _arguments.has_key('----'):
  60. return _arguments['----']
  61. _argmap_set = {
  62. 'to' : 'data',
  63. }
  64. def set(self, _object, _attributes={}, **_arguments):
  65. """set: Set an object\xd5s data
  66. Required argument: the object to change
  67. Keyword argument to: the new value
  68. Keyword argument _attributes: AppleEvent attribute dictionary
  69. """
  70. _code = 'core'
  71. _subcode = 'setd'
  72. aetools.keysubst(_arguments, self._argmap_set)
  73. _arguments['----'] = _object
  74. _reply, _arguments, _attributes = self.send(_code, _subcode,
  75. _arguments, _attributes)
  76. if _arguments.get('errn', 0):
  77. raise aetools.Error, aetools.decodeerror(_arguments)
  78. # XXXX Optionally decode result
  79. if _arguments.has_key('----'):
  80. return _arguments['----']
  81. class application(aetools.ComponentItem):
  82. """application - An application program """
  83. want = 'capp'
  84. class _Prop_alert_application(aetools.NProperty):
  85. """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. """
  86. which = 'ALAP'
  87. want = 'type'
  88. alert_application = _Prop_alert_application()
  89. class _Prop_kiosk_mode(aetools.NProperty):
  90. """kiosk mode - Kiosk mode leaves very few menus enabled """
  91. which = 'KOSK'
  92. want = 'long'
  93. kiosk_mode = _Prop_kiosk_mode()
  94. # element 'cwin' as ['indx', 'name', 'ID ']
  95. class window(aetools.ComponentItem):
  96. """window - A Window """
  97. want = 'cwin'
  98. class _Prop_URL(aetools.NProperty):
  99. """URL - Current URL """
  100. which = 'curl'
  101. want = 'TEXT'
  102. class _Prop_bounds(aetools.NProperty):
  103. """bounds - the boundary rectangle for the window """
  104. which = 'pbnd'
  105. want = 'qdrt'
  106. class _Prop_busy(aetools.NProperty):
  107. """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 """
  108. which = 'busy'
  109. want = 'long'
  110. class _Prop_closeable(aetools.NProperty):
  111. """closeable - Does the window have a close box? """
  112. which = 'hclb'
  113. want = 'bool'
  114. class _Prop_floating(aetools.NProperty):
  115. """floating - Does the window float? """
  116. which = 'isfl'
  117. want = 'bool'
  118. class _Prop_index(aetools.NProperty):
  119. """index - the number of the window """
  120. which = 'pidx'
  121. want = 'long'
  122. class _Prop_modal(aetools.NProperty):
  123. """modal - Is the window modal? """
  124. which = 'pmod'
  125. want = 'bool'
  126. class _Prop_name(aetools.NProperty):
  127. """name - the title of the window """
  128. which = 'pnam'
  129. want = 'itxt'
  130. class _Prop_position(aetools.NProperty):
  131. """position - upper left coordinates of window """
  132. which = 'ppos'
  133. want = 'QDpt'
  134. class _Prop_resizable(aetools.NProperty):
  135. """resizable - Is the window resizable? """
  136. which = 'prsz'
  137. want = 'bool'
  138. class _Prop_titled(aetools.NProperty):
  139. """titled - Does the window have a title bar? """
  140. which = 'ptit'
  141. want = 'bool'
  142. class _Prop_unique_ID(aetools.NProperty):
  143. """unique ID - Window\xd5s unique ID (a bridge between WWW! suite window id\xd5s and standard AE windows) """
  144. which = 'wiid'
  145. want = 'long'
  146. class _Prop_visible(aetools.NProperty):
  147. """visible - is the window visible? """
  148. which = 'pvis'
  149. want = 'bool'
  150. class _Prop_zoomable(aetools.NProperty):
  151. """zoomable - Is the window zoomable? """
  152. which = 'iszm'
  153. want = 'bool'
  154. class _Prop_zoomed(aetools.NProperty):
  155. """zoomed - Is the window zoomed? """
  156. which = 'pzum'
  157. want = 'bool'
  158. application._superclassnames = []
  159. application._privpropdict = {
  160. 'alert_application' : _Prop_alert_application,
  161. 'kiosk_mode' : _Prop_kiosk_mode,
  162. }
  163. application._privelemdict = {
  164. 'window' : window,
  165. }
  166. window._superclassnames = []
  167. window._privpropdict = {
  168. 'URL' : _Prop_URL,
  169. 'bounds' : _Prop_bounds,
  170. 'busy' : _Prop_busy,
  171. 'closeable' : _Prop_closeable,
  172. 'floating' : _Prop_floating,
  173. 'index' : _Prop_index,
  174. 'modal' : _Prop_modal,
  175. 'name' : _Prop_name,
  176. 'position' : _Prop_position,
  177. 'resizable' : _Prop_resizable,
  178. 'titled' : _Prop_titled,
  179. 'unique_ID' : _Prop_unique_ID,
  180. 'visible' : _Prop_visible,
  181. 'zoomable' : _Prop_zoomable,
  182. 'zoomed' : _Prop_zoomed,
  183. }
  184. window._privelemdict = {
  185. }
  186. #
  187. # Indices of types declared in this module
  188. #
  189. _classdeclarations = {
  190. 'capp' : application,
  191. 'cwin' : window,
  192. }
  193. _propdeclarations = {
  194. 'ALAP' : _Prop_alert_application,
  195. 'KOSK' : _Prop_kiosk_mode,
  196. 'busy' : _Prop_busy,
  197. 'curl' : _Prop_URL,
  198. 'hclb' : _Prop_closeable,
  199. 'isfl' : _Prop_floating,
  200. 'iszm' : _Prop_zoomable,
  201. 'pbnd' : _Prop_bounds,
  202. 'pidx' : _Prop_index,
  203. 'pmod' : _Prop_modal,
  204. 'pnam' : _Prop_name,
  205. 'ppos' : _Prop_position,
  206. 'prsz' : _Prop_resizable,
  207. 'ptit' : _Prop_titled,
  208. 'pvis' : _Prop_visible,
  209. 'pzum' : _Prop_zoomed,
  210. 'wiid' : _Prop_unique_ID,
  211. }
  212. _compdeclarations = {
  213. }
  214. _enumdeclarations = {
  215. }