home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2010 November / maximum-cd-2010-11.iso / DiscContents / calibre-0.7.13.msi / file_2090 (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2010-08-06  |  8.6 KB  |  213 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. from namespaces import DRAWNS, STYLENS, PRESENTATIONNS
  5. from element import Element
  6.  
  7. def StyleRefElement(stylename = None, classnames = None, **args):
  8.     qattrs = { }
  9.     if stylename is not None:
  10.         f = stylename.getAttrNS(STYLENS, 'family')
  11.         if f == 'graphic':
  12.             qattrs[(DRAWNS, u'style-name')] = stylename
  13.         elif f == 'presentation':
  14.             qattrs[(PRESENTATIONNS, u'style-name')] = stylename
  15.         else:
  16.             raise ValueError, "Style's family must be either 'graphic' or 'presentation'"
  17.     f == 'graphic'
  18.     if classnames is not None:
  19.         f = classnames[0].getAttrNS(STYLENS, 'family')
  20.         if f == 'graphic':
  21.             qattrs[(DRAWNS, u'class-names')] = classnames
  22.         elif f == 'presentation':
  23.             qattrs[(PRESENTATIONNS, u'class-names')] = classnames
  24.         else:
  25.             raise ValueError, "Style's family must be either 'graphic' or 'presentation'"
  26.     f == 'graphic'
  27.     return Element(qattributes = qattrs, **args)
  28.  
  29.  
  30. def DrawElement(name = None, **args):
  31.     e = Element(name = name, **args)
  32.     if not args.has_key('displayname'):
  33.         e.setAttrNS(DRAWNS, 'display-name', name)
  34.     
  35.     return e
  36.  
  37.  
  38. def A(**args):
  39.     return Element(qname = (DRAWNS, 'a'), **args)
  40.  
  41.  
  42. def Applet(**args):
  43.     return Element(qname = (DRAWNS, 'applet'), **args)
  44.  
  45.  
  46. def AreaCircle(**args):
  47.     return Element(qname = (DRAWNS, 'area-circle'), **args)
  48.  
  49.  
  50. def AreaPolygon(**args):
  51.     return Element(qname = (DRAWNS, 'area-polygon'), **args)
  52.  
  53.  
  54. def AreaRectangle(**args):
  55.     return Element(qname = (DRAWNS, 'area-rectangle'), **args)
  56.  
  57.  
  58. def Caption(**args):
  59.     return StyleRefElement(qname = (DRAWNS, 'caption'), **args)
  60.  
  61.  
  62. def Circle(**args):
  63.     return StyleRefElement(qname = (DRAWNS, 'circle'), **args)
  64.  
  65.  
  66. def Connector(**args):
  67.     return StyleRefElement(qname = (DRAWNS, 'connector'), **args)
  68.  
  69.  
  70. def ContourPath(**args):
  71.     return Element(qname = (DRAWNS, 'contour-path'), **args)
  72.  
  73.  
  74. def ContourPolygon(**args):
  75.     return Element(qname = (DRAWNS, 'contour-polygon'), **args)
  76.  
  77.  
  78. def Control(**args):
  79.     return StyleRefElement(qname = (DRAWNS, 'control'), **args)
  80.  
  81.  
  82. def CustomShape(**args):
  83.     return StyleRefElement(qname = (DRAWNS, 'custom-shape'), **args)
  84.  
  85.  
  86. def Ellipse(**args):
  87.     return StyleRefElement(qname = (DRAWNS, 'ellipse'), **args)
  88.  
  89.  
  90. def EnhancedGeometry(**args):
  91.     return Element(qname = (DRAWNS, 'enhanced-geometry'), **args)
  92.  
  93.  
  94. def Equation(**args):
  95.     return Element(qname = (DRAWNS, 'equation'), **args)
  96.  
  97.  
  98. def FillImage(**args):
  99.     return DrawElement(qname = (DRAWNS, 'fill-image'), **args)
  100.  
  101.  
  102. def FloatingFrame(**args):
  103.     return Element(qname = (DRAWNS, 'floating-frame'), **args)
  104.  
  105.  
  106. def Frame(**args):
  107.     return StyleRefElement(qname = (DRAWNS, 'frame'), **args)
  108.  
  109.  
  110. def G(**args):
  111.     return StyleRefElement(qname = (DRAWNS, 'g'), **args)
  112.  
  113.  
  114. def GluePoint(**args):
  115.     return Element(qname = (DRAWNS, 'glue-point'), **args)
  116.  
  117.  
  118. def Gradient(**args):
  119.     return DrawElement(qname = (DRAWNS, 'gradient'), **args)
  120.  
  121.  
  122. def Handle(**args):
  123.     return Element(qname = (DRAWNS, 'handle'), **args)
  124.  
  125.  
  126. def Hatch(**args):
  127.     return DrawElement(qname = (DRAWNS, 'hatch'), **args)
  128.  
  129.  
  130. def Image(**args):
  131.     return Element(qname = (DRAWNS, 'image'), **args)
  132.  
  133.  
  134. def ImageMap(**args):
  135.     return Element(qname = (DRAWNS, 'image-map'), **args)
  136.  
  137.  
  138. def Layer(**args):
  139.     return Element(qname = (DRAWNS, 'layer'), **args)
  140.  
  141.  
  142. def LayerSet(**args):
  143.     return Element(qname = (DRAWNS, 'layer-set'), **args)
  144.  
  145.  
  146. def Line(**args):
  147.     return StyleRefElement(qname = (DRAWNS, 'line'), **args)
  148.  
  149.  
  150. def Marker(**args):
  151.     return DrawElement(qname = (DRAWNS, 'marker'), **args)
  152.  
  153.  
  154. def Measure(**args):
  155.     return StyleRefElement(qname = (DRAWNS, 'measure'), **args)
  156.  
  157.  
  158. def Object(**args):
  159.     return Element(qname = (DRAWNS, 'object'), **args)
  160.  
  161.  
  162. def ObjectOle(**args):
  163.     return Element(qname = (DRAWNS, 'object-ole'), **args)
  164.  
  165.  
  166. def Opacity(**args):
  167.     return DrawElement(qname = (DRAWNS, 'opacity'), **args)
  168.  
  169.  
  170. def Page(**args):
  171.     return Element(qname = (DRAWNS, 'page'), **args)
  172.  
  173.  
  174. def PageThumbnail(**args):
  175.     return StyleRefElement(qname = (DRAWNS, 'page-thumbnail'), **args)
  176.  
  177.  
  178. def Param(**args):
  179.     return Element(qname = (DRAWNS, 'param'), **args)
  180.  
  181.  
  182. def Path(**args):
  183.     return StyleRefElement(qname = (DRAWNS, 'path'), **args)
  184.  
  185.  
  186. def Plugin(**args):
  187.     return Element(qname = (DRAWNS, 'plugin'), **args)
  188.  
  189.  
  190. def Polygon(**args):
  191.     return StyleRefElement(qname = (DRAWNS, 'polygon'), **args)
  192.  
  193.  
  194. def Polyline(**args):
  195.     return StyleRefElement(qname = (DRAWNS, 'polyline'), **args)
  196.  
  197.  
  198. def Rect(**args):
  199.     return StyleRefElement(qname = (DRAWNS, 'rect'), **args)
  200.  
  201.  
  202. def RegularPolygon(**args):
  203.     return StyleRefElement(qname = (DRAWNS, 'regular-polygon'), **args)
  204.  
  205.  
  206. def StrokeDash(**args):
  207.     return DrawElement(qname = (DRAWNS, 'stroke-dash'), **args)
  208.  
  209.  
  210. def TextBox(**args):
  211.     return Element(qname = (DRAWNS, 'text-box'), **args)
  212.  
  213.