home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2000 / MacHack 2000.toast / pc / The Hacks / MacHacksBug / Python 1.5.2c1 / Mac / Lib / lib-scripting / QuickDraw_Graphics_Suite.py < prev    next >
Encoding:
Python Source  |  2000-06-23  |  9.8 KB  |  412 lines

  1. """Suite QuickDraw Graphics Suite: A set of basic classes for graphics
  2. Level 1, version 1
  3.  
  4. Generated from flap:System Folder:Extensions:Scripting Additions:Dialects:English Dialect
  5. AETE/AEUT resource version 1/0, language 0, script 0
  6. """
  7.  
  8. import aetools
  9. import MacOS
  10.  
  11. _code = 'qdrw'
  12.  
  13. class QuickDraw_Graphics_Suite:
  14.  
  15.     pass
  16.  
  17.  
  18. class arc(aetools.ComponentItem):
  19.     """arc - An arc"""
  20.     want = 'carc'
  21. class arc_angle(aetools.NProperty):
  22.     """arc angle - Angle of the arc in degrees"""
  23.     which = 'parc'
  24.     want = 'fixd'
  25. class bounds(aetools.NProperty):
  26.     """bounds - the smallest rectangle that contains the entire arc"""
  27.     which = 'pbnd'
  28.     want = 'qdrt'
  29. class _class(aetools.NProperty):
  30.     """class - the class"""
  31.     which = 'pcls'
  32.     want = 'type'
  33. class definition_rect(aetools.NProperty):
  34.     """definition rect - the rectangle that contains the circle or oval used to define the arc"""
  35.     which = 'pdrt'
  36.     want = 'qdrt'
  37. class fill_color(aetools.NProperty):
  38.     """fill color - the fill color"""
  39.     which = 'flcl'
  40.     want = 'cRGB'
  41. class fill_pattern(aetools.NProperty):
  42.     """fill pattern - the fill pattern"""
  43.     which = 'flpt'
  44.     want = 'cpix'
  45. class pen_color(aetools.NProperty):
  46.     """pen color - the pen color"""
  47.     which = 'ppcl'
  48.     want = 'cRGB'
  49. class pen_pattern(aetools.NProperty):
  50.     """pen pattern - the pen pattern"""
  51.     which = 'pppa'
  52.     want = 'cpix'
  53. class pen_width(aetools.NProperty):
  54.     """pen width - the pen width"""
  55.     which = 'ppwd'
  56.     want = 'shor'
  57. class start_angle(aetools.NProperty):
  58.     """start angle - the angle that defines the start of the arc, in degrees"""
  59.     which = 'pang'
  60.     want = 'fixd'
  61. class transfer_mode(aetools.NProperty):
  62.     """transfer mode - the transfer mode"""
  63.     which = 'pptm'
  64.     want = 'tran'
  65.  
  66. arcs = arc
  67.  
  68. class drawing_area(aetools.ComponentItem):
  69.     """drawing area - Container for graphics and supporting information"""
  70.     want = 'cdrw'
  71. class background_color(aetools.NProperty):
  72.     """background color - the color used to fill in unoccupied areas"""
  73.     which = 'pbcl'
  74.     want = 'cRGB'
  75. class background_pattern(aetools.NProperty):
  76.     """background pattern - the pattern used to fill in unoccupied areas"""
  77.     which = 'pbpt'
  78.     want = 'cpix'
  79. class color_table(aetools.NProperty):
  80.     """color table - the color table"""
  81.     which = 'cltb'
  82.     want = 'clrt'
  83. class ordering(aetools.NProperty):
  84.     """ordering - the ordered list of graphic objects in the drawing area"""
  85.     which = 'gobs'
  86.     want = 'obj '
  87. class name(aetools.NProperty):
  88.     """name - the name"""
  89.     which = 'pnam'
  90.     want = 'itxt'
  91. class default_location(aetools.NProperty):
  92.     """default location - the default location of each new graphic object"""
  93.     which = 'pnel'
  94.     want = 'QDpt'
  95. class pixel_depth(aetools.NProperty):
  96.     """pixel depth - Bits per pixel"""
  97.     which = 'pdpt'
  98.     want = 'shor'
  99. class writing_code(aetools.NProperty):
  100.     """writing code - the script system and language of text objects in the drawing area"""
  101.     which = 'psct'
  102.     want = 'intl'
  103. class text_color(aetools.NProperty):
  104.     """text color - the default color for text objects"""
  105.     which = 'ptxc'
  106.     want = 'cRGB'
  107. class default_font(aetools.NProperty):
  108.     """default font - the name of the default font for text objects"""
  109.     which = 'ptxf'
  110.     want = 'itxt'
  111. class default_size(aetools.NProperty):
  112.     """default size - the default size for text objects"""
  113.     which = 'ptps'
  114.     want = 'fixd'
  115. class style(aetools.NProperty):
  116.     """style - the default text style for text objects"""
  117.     which = 'txst'
  118.     want = 'tsty'
  119. class update_on_change(aetools.NProperty):
  120.     """update on change - Redraw after each change?"""
  121.     which = 'pupd'
  122.     want = 'bool'
  123.  
  124. drawing_areas = drawing_area
  125.  
  126. class graphic_line(aetools.ComponentItem):
  127.     """graphic line - A graphic line"""
  128.     want = 'glin'
  129. class dash_style(aetools.NProperty):
  130.     """dash style - the dash style"""
  131.     which = 'pdst'
  132.     want = 'tdas'
  133. class end_point(aetools.NProperty):
  134.     """end point - the ending point of the line"""
  135.     which = 'pend'
  136.     want = 'QDpt'
  137. class arrow_style(aetools.NProperty):
  138.     """arrow style - the arrow style"""
  139.     which = 'arro'
  140.     want = 'arro'
  141. class start_point(aetools.NProperty):
  142.     """start point - the starting point of the line"""
  143.     which = 'pstp'
  144.     want = 'QDpt'
  145.  
  146. graphic_lines = graphic_line
  147.  
  148. class graphic_object(aetools.ComponentItem):
  149.     """graphic object - A graphic object"""
  150.     want = 'cgob'
  151.  
  152. graphic_objects = graphic_object
  153.  
  154. class graphic_shape(aetools.ComponentItem):
  155.     """graphic shape - A graphic shape"""
  156.     want = 'cgsh'
  157.  
  158. graphic_shapes = graphic_shape
  159.  
  160. class graphic_text(aetools.ComponentItem):
  161.     """graphic text - A series of characters within a drawing area"""
  162.     want = 'cgtx'
  163. class color(aetools.NProperty):
  164.     """color - the color of the first character"""
  165.     which = 'colr'
  166.     want = 'cRGB'
  167. class font(aetools.NProperty):
  168.     """font - the name of the font of the first character"""
  169.     which = 'font'
  170.     want = 'ctxt'
  171. class size(aetools.NProperty):
  172.     """size - the size in points of the first character"""
  173.     which = 'ptsz'
  174.     want = 'fixd'
  175. class uniform_styles(aetools.NProperty):
  176.     """uniform styles - the text styles that are uniform throughout the text"""
  177.     which = 'ustl'
  178.     want = 'tsty'
  179.  
  180. class graphic_group(aetools.ComponentItem):
  181.     """graphic group - Group of graphics"""
  182.     want = 'cpic'
  183.  
  184. graphic_groups = graphic_group
  185.  
  186. class oval(aetools.ComponentItem):
  187.     """oval - An oval"""
  188.     want = 'covl'
  189.  
  190. ovals = oval
  191.  
  192. class pixel(aetools.ComponentItem):
  193.     """pixel - A pixel"""
  194.     want = 'cpxl'
  195. # repeated property color the color
  196.  
  197. pixels = pixel
  198.  
  199. class pixel_map(aetools.ComponentItem):
  200.     """pixel map - A pixel map"""
  201.     want = 'cpix'
  202.  
  203. pixel_maps = pixel_map
  204.  
  205. class polygon(aetools.ComponentItem):
  206.     """polygon - A polygon"""
  207.     want = 'cpgn'
  208. class point_list(aetools.NProperty):
  209.     """point list - the list of points that define the polygon"""
  210.     which = 'ptlt'
  211.     want = 'QDpt'
  212.  
  213. polygons = polygon
  214.  
  215. class rectangle(aetools.ComponentItem):
  216.     """rectangle - A rectangle"""
  217.     want = 'crec'
  218.  
  219. rectangles = rectangle
  220.  
  221. class rounded_rectangle(aetools.ComponentItem):
  222.     """rounded rectangle - A rounded rectangle"""
  223.     want = 'crrc'
  224. class corner_curve_height(aetools.NProperty):
  225.     """corner curve height - the height of the oval used to define the shape of the rounded corners"""
  226.     which = 'pchd'
  227.     want = 'shor'
  228. class corner_curve_width(aetools.NProperty):
  229.     """corner curve width - the width of the oval used to define the shape of the rounded corners"""
  230.     which = 'pcwd'
  231.     want = 'shor'
  232.  
  233. rounded_rectangles = rounded_rectangle
  234. arc._propdict = {
  235.     'arc_angle' : arc_angle,
  236.     'bounds' : bounds,
  237.     '_class' : _class,
  238.     'definition_rect' : definition_rect,
  239.     'fill_color' : fill_color,
  240.     'fill_pattern' : fill_pattern,
  241.     'pen_color' : pen_color,
  242.     'pen_pattern' : pen_pattern,
  243.     'pen_width' : pen_width,
  244.     'start_angle' : start_angle,
  245.     'transfer_mode' : transfer_mode,
  246. }
  247. arc._elemdict = {
  248. }
  249. drawing_area._propdict = {
  250.     'background_color' : background_color,
  251.     'background_pattern' : background_pattern,
  252.     'color_table' : color_table,
  253.     'ordering' : ordering,
  254.     'name' : name,
  255.     'default_location' : default_location,
  256.     'pixel_depth' : pixel_depth,
  257.     'writing_code' : writing_code,
  258.     'text_color' : text_color,
  259.     'default_font' : default_font,
  260.     'default_size' : default_size,
  261.     'style' : style,
  262.     'update_on_change' : update_on_change,
  263. }
  264. drawing_area._elemdict = {
  265. }
  266. graphic_line._propdict = {
  267.     'dash_style' : dash_style,
  268.     'end_point' : end_point,
  269.     'arrow_style' : arrow_style,
  270.     'start_point' : start_point,
  271. }
  272. graphic_line._elemdict = {
  273. }
  274. graphic_object._propdict = {
  275. }
  276. graphic_object._elemdict = {
  277. }
  278. graphic_shape._propdict = {
  279. }
  280. graphic_shape._elemdict = {
  281. }
  282. graphic_text._propdict = {
  283.     'color' : color,
  284.     'font' : font,
  285.     'size' : size,
  286.     'uniform_styles' : uniform_styles,
  287. }
  288. graphic_text._elemdict = {
  289. }
  290. graphic_group._propdict = {
  291. }
  292. graphic_group._elemdict = {
  293. }
  294. oval._propdict = {
  295. }
  296. oval._elemdict = {
  297. }
  298. pixel._propdict = {
  299.     'color' : color,
  300. }
  301. pixel._elemdict = {
  302. }
  303. pixel_map._propdict = {
  304. }
  305. pixel_map._elemdict = {
  306. }
  307. polygon._propdict = {
  308.     'point_list' : point_list,
  309. }
  310. polygon._elemdict = {
  311. }
  312. rectangle._propdict = {
  313. }
  314. rectangle._elemdict = {
  315. }
  316. rounded_rectangle._propdict = {
  317.     'corner_curve_height' : corner_curve_height,
  318.     'corner_curve_width' : corner_curve_width,
  319. }
  320. rounded_rectangle._elemdict = {
  321. }
  322. _Enum_tran = {
  323.     'copy_pixels' : 'cpy ',    # 
  324.     'not_copy_pixels' : 'ncpy',    # 
  325.     'or_pixels' : 'or  ',    # 
  326.     'not_or_pixels' : 'ntor',    # 
  327.     'bic_pixels' : 'bic ',    # 
  328.     'not_bic_pixels' : 'nbic',    # 
  329.     'xor_pixels' : 'xor ',    # 
  330.     'not_xor_pixels' : 'nxor',    # 
  331.     'add_over_pixels' : 'addo',    # 
  332.     'add_pin_pixels' : 'addp',    # 
  333.     'sub_over_pixels' : 'subo',    # 
  334.     'sub_pin_pixels' : 'subp',    # 
  335.     'ad_max_pixels' : 'admx',    # 
  336.     'ad_min_pixels' : 'admn',    # 
  337.     'blend_pixels' : 'blnd',    # 
  338. }
  339.  
  340. _Enum_arro = {
  341.     'no_arrow' : 'arno',    # No arrow on line
  342.     'arrow_at_start' : 'arst',    # Arrow at start of line
  343.     'arrow_at_end' : 'aren',    # Arrow at end of line
  344.     'arrow_at_both_ends' : 'arbo',    # Arrow at both the start and the end of the line
  345. }
  346.  
  347.  
  348. #
  349. # Indices of types declared in this module
  350. #
  351. _classdeclarations = {
  352.     'crec' : rectangle,
  353.     'cpix' : pixel_map,
  354.     'carc' : arc,
  355.     'cgsh' : graphic_shape,
  356.     'cpxl' : pixel,
  357.     'crrc' : rounded_rectangle,
  358.     'cpgn' : polygon,
  359.     'cdrw' : drawing_area,
  360.     'cgob' : graphic_object,
  361.     'glin' : graphic_line,
  362.     'cgtx' : graphic_text,
  363.     'covl' : oval,
  364.     'cpic' : graphic_group,
  365. }
  366.  
  367. _propdeclarations = {
  368.     'pend' : end_point,
  369.     'pupd' : update_on_change,
  370.     'pstp' : start_point,
  371.     'pdrt' : definition_rect,
  372.     'pnam' : name,
  373.     'pbcl' : background_color,
  374.     'pptm' : transfer_mode,
  375.     'pnel' : default_location,
  376.     'pdpt' : pixel_depth,
  377.     'gobs' : ordering,
  378.     'ustl' : uniform_styles,
  379.     'ptlt' : point_list,
  380.     'pdst' : dash_style,
  381.     'psct' : writing_code,
  382.     'txst' : style,
  383.     'font' : font,
  384.     'pchd' : corner_curve_height,
  385.     'pcls' : _class,
  386.     'ppwd' : pen_width,
  387.     'ptps' : default_size,
  388.     'ppcl' : pen_color,
  389.     'ptxf' : default_font,
  390.     'pcwd' : corner_curve_width,
  391.     'ptxc' : text_color,
  392.     'cltb' : color_table,
  393.     'pppa' : pen_pattern,
  394.     'pang' : start_angle,
  395.     'flpt' : fill_pattern,
  396.     'colr' : color,
  397.     'arro' : arrow_style,
  398.     'pbnd' : bounds,
  399.     'ptsz' : size,
  400.     'parc' : arc_angle,
  401.     'flcl' : fill_color,
  402.     'pbpt' : background_pattern,
  403. }
  404.  
  405. _compdeclarations = {
  406. }
  407.  
  408. _enumdeclarations = {
  409.     'tran' : _Enum_tran,
  410.     'arro' : _Enum_arro,
  411. }
  412.