comparison tools/svg2code.py @ 78:3645e29e4986

Add runtime for Xlib.
author Thinker K.F. Li <thinker@branda.to>
date Wed, 20 Aug 2008 23:33:04 +0800
parents 35c2b7ba140b
children e548221c04eb
comparison
equal deleted inserted replaced
77:a6763f080da5 78:3645e29e4986
49 translate_stops(linear, codefo, linear_id) 49 translate_stops(linear, codefo, linear_id)
50 print >> codefo, '])dnl' 50 print >> codefo, '])dnl'
51 51
52 href = linear.getAttributeNS(xlinkns, 'href').strip() 52 href = linear.getAttributeNS(xlinkns, 'href').strip()
53 if href and href[0] == '#': 53 if href and href[0] == '#':
54 print >> codefo, 'REF_STOPS([%s], [%s])dnl' % (linear_id, href[1:]) 54 print >> codefo, 'REF_STOPS_LINEAR([%s], [%s])dnl' % (
55 linear_id, href[1:])
55 pass 56 pass
56 pass 57 pass
57 58
58 def translate_radialGradient(radial, codefo, doc): 59 def translate_radialGradient(radial, codefo, doc):
59 radial_id = radial.getAttribute('id') 60 radial_id = radial.getAttribute('id')
73 translate_stops(radial, codefo, radial_id) 74 translate_stops(radial, codefo, radial_id)
74 print >>codefo, '])dnl' 75 print >>codefo, '])dnl'
75 76
76 href = radial.getAttributeNS(xlinkns, 'href').strip() 77 href = radial.getAttributeNS(xlinkns, 'href').strip()
77 if href[0] == '#': 78 if href[0] == '#':
78 print >> codefo, 'REF_STOPS([%s], [%s])dnl' % (radial_id, href[1:]) 79 print >> codefo, 'REF_STOPS_RADIAL([%s], [%s])dnl' % (
80 radial_id, href[1:])
79 pass 81 pass
80 pass 82 pass
81 83
82 def translate_defs(defs, codefo, doc): 84 def translate_defs(defs, codefo, doc):
83 for node in defs.childNodes: 85 for node in defs.childNodes: