summaryrefslogtreecommitdiffstats
path: root/share/extensions
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2015-03-18 18:16:36 +0000
committerJabiertxof <jtx@jtx.marker.es>2015-03-18 18:16:36 +0000
commit913372144fbee834867176885a5526d70243e4e0 (patch)
treea28957014d44a50067932243cc919f522efac898 /share/extensions
parentupdate to trunk (diff)
parentLatvian translation update (diff)
downloadinkscape-913372144fbee834867176885a5526d70243e4e0.tar.gz
inkscape-913372144fbee834867176885a5526d70243e4e0.zip
update to trunk
(bzr r13682.1.23)
Diffstat (limited to 'share/extensions')
-rwxr-xr-xshare/extensions/convert2dashes.py9
-rw-r--r--share/extensions/dxf_outlines.inx8
-rwxr-xr-xshare/extensions/dxf_outlines.py13
-rwxr-xr-xshare/extensions/funcplot.py4
-rwxr-xr-xshare/extensions/gimp_xcf.py10
-rw-r--r--share/extensions/hpgl_decoder.py87
-rw-r--r--share/extensions/inkscape_help_keys.inx2
-rwxr-xr-xshare/extensions/pathalongpath.py4
-rwxr-xr-xshare/extensions/pathscatter.py6
-rw-r--r--share/extensions/plotter.inx3
-rw-r--r--share/extensions/plotter.py30
-rw-r--r--share/extensions/seamless_pattern.inx4
-rw-r--r--share/extensions/seamless_pattern_procedural.inx4
-rwxr-xr-xshare/extensions/svg2xaml.xsl26
14 files changed, 112 insertions, 98 deletions
diff --git a/share/extensions/convert2dashes.py b/share/extensions/convert2dashes.py
index 9e7f6d439..1228b247c 100755
--- a/share/extensions/convert2dashes.py
+++ b/share/extensions/convert2dashes.py
@@ -54,17 +54,24 @@ class SplitIt(inkex.Effect):
for id, node in self.selected.iteritems():
if node.tag == inkex.addNS('path','svg'):
dashes = []
+ offset = 0
style = simplestyle.parseStyle(node.get('style'))
if style.has_key('stroke-dasharray'):
if style['stroke-dasharray'].find(',') > 0:
dashes = [float (dash) for dash in style['stroke-dasharray'].split(',')]
+ if style.has_key('stroke-dashoffset'):
+ offset = style['stroke-dashoffset']
if dashes:
p = cubicsuperpath.parsePath(node.get('d'))
new = []
for sub in p:
idash = 0
dash = dashes[0]
- length = 0
+ length = float (offset)
+ while dash < length:
+ length = length - dash
+ idash = (idash + 1) % len(dashes)
+ dash = dashes[idash]
new.append([sub[0][:]])
i = 1
while i < len(sub):
diff --git a/share/extensions/dxf_outlines.inx b/share/extensions/dxf_outlines.inx
index c6f71d269..3b90afcc8 100644
--- a/share/extensions/dxf_outlines.inx
+++ b/share/extensions/dxf_outlines.inx
@@ -9,7 +9,7 @@
<page name="options" _gui-text="Options">
<param name="ROBO" type="boolean" _gui-text="use ROBO-Master type of spline output">false</param>
<param name="POLY" type="boolean" _gui-text="use LWPOLYLINE type of line output">true</param>
- <param name="units" type="enum" _gui-text="Base unit">
+ <param name="units" type="enum" _gui-text="Base unit:">
<_item value="72./96">pt</_item>
<_item value="1./16">pc</_item>
<_item value="1.">px</_item>
@@ -19,18 +19,18 @@
<_item value="1./96">in</_item>
<_item value="1./1152">ft</_item>
</param>
- <param name="encoding" type="enum" _gui-text="Character Encoding">
+ <param name="encoding" type="enum" _gui-text="Character Encoding:">
<_item value="latin_1">Latin 1</_item>
<_item value="cp1250">CP 1250</_item>
<_item value="cp1252">CP 1252</_item>
<_item value="utf_8">UTF 8</_item>
</param>
- <param name="layer_option" type="enum" _gui-text="Layer export selection">
+ <param name="layer_option" type="enum" _gui-text="Layer export selection:">
<_item value="all">All (default)</_item>
<_item value="visible">Visible only</_item>
<_item value="name">By name match</_item>
</param>
- <param name="layer_name" type="string" _gui-text="Layer match name"></param>
+ <param name="layer_name" type="string" _gui-text="Layer match name:"></param>
</page>
<page name="help" _gui-text="Help">
<_param name="inputhelp" type="description" xml:space="preserve">- AutoCAD Release 14 DXF format.
diff --git a/share/extensions/dxf_outlines.py b/share/extensions/dxf_outlines.py
index f7e57c32e..091606ba3 100755
--- a/share/extensions/dxf_outlines.py
+++ b/share/extensions/dxf_outlines.py
@@ -113,14 +113,17 @@ class MyEffect(inkex.Effect):
self.poly = [csp[0]] # initiallize new polyline
self.color_LWPOLY = self.color
self.layer_LWPOLY = self.layer
- self.closed_LWPOLY = self.closed
self.poly.append(csp[1])
def LWPOLY_output(self):
if len(self.poly) == 1:
return
self.handle += 1
- self.dxf_add(" 0\nLWPOLYLINE\n 5\n%x\n100\nAcDbEntity\n 8\n%s\n 62\n%d\n100\nAcDbPolyline\n 90\n%d\n 70\n%d\n" % (self.handle, self.layer_LWPOLY, self.color_LWPOLY, len(self.poly), self.closed_LWPOLY))
- for i in range(len(self.poly)):
+ closed = 1
+ if (abs(self.poly[0][0] - self.poly[-1][0]) > .0001
+ or abs(self.poly[0][1] - self.poly[-1][1]) > .0001):
+ closed = 0
+ self.dxf_add(" 0\nLWPOLYLINE\n 5\n%x\n100\nAcDbEntity\n 8\n%s\n 62\n%d\n100\nAcDbPolyline\n 90\n%d\n 70\n%d\n" % (self.handle, self.layer_LWPOLY, self.color_LWPOLY, len(self.poly) - closed, closed))
+ for i in range(len(self.poly) - closed):
self.dxf_add(" 10\n%f\n 20\n%f\n 30\n0.0\n" % (self.poly[i][0],self.poly[i][1]))
def dxf_spline(self,csp):
knots = 8
@@ -195,7 +198,6 @@ class MyEffect(inkex.Effect):
if style['stroke'] and style['stroke'] != 'none' and style['stroke'][0:3] != 'url':
rgb = simplestyle.parseColor(style['stroke'])
hsl = coloreffect.ColorEffect.rgb_to_hsl(coloreffect.ColorEffect(),rgb[0]/255.0,rgb[1]/255.0,rgb[2]/255.0)
- self.closed = 0 # only for LWPOLYLINE
self.color = 7 # default is black
if hsl[2]:
self.color = 1 + (int(6*hsl[0] + 0.5) % 6) # use 6 hues
@@ -203,11 +205,8 @@ class MyEffect(inkex.Effect):
d = node.get('d')
if not d:
return
- if (d[-1] == 'z' or d[-1] == 'Z'):
- self.closed = 1
p = cubicsuperpath.parsePath(d)
elif node.tag == inkex.addNS('rect','svg'):
- self.closed = 1
x = float(node.get('x'))
y = float(node.get('y'))
width = float(node.get('width'))
diff --git a/share/extensions/funcplot.py b/share/extensions/funcplot.py
index 7f8fdafe1..f37bf335e 100755
--- a/share/extensions/funcplot.py
+++ b/share/extensions/funcplot.py
@@ -45,7 +45,7 @@ def drawfunction(xstart, xend, ybottom, ytop, samples, width, height, left, bott
# coords and scales based on the source rect
if xstart == xend:
- inkex.errormsg(_("x-interval cannot be zero. Please modify 'Start X' or 'End X'"))
+ inkex.errormsg(_("x-interval cannot be zero. Please modify 'Start X value' or 'End X value'"))
return []
scalex = width / (xend - xstart)
xoff = left
@@ -57,7 +57,7 @@ def drawfunction(xstart, xend, ybottom, ytop, samples, width, height, left, bott
coordx = lambda x: x * polar_scalex + centerx #convert x-value to coordinate
if ytop == ybottom:
- inkex.errormsg(_("y-interval cannot be zero. Please modify 'Y top' or 'Y bottom'"))
+ inkex.errormsg(_("y-interval cannot be zero. Please modify 'Y value of rectangle's top' or 'Y value of rectangle's bottom'"))
return []
scaley = height / (ytop - ybottom)
yoff = bottom
diff --git a/share/extensions/gimp_xcf.py b/share/extensions/gimp_xcf.py
index 11c9d041f..bdb0d1e4c 100755
--- a/share/extensions/gimp_xcf.py
+++ b/share/extensions/gimp_xcf.py
@@ -34,6 +34,10 @@ class GimpXCFError(Exception): pass
class GimpXCFExpectedIOError(GimpXCFError): pass
+class GimpXCFInkscapeNotInstalled(GimpXCFError):
+ def __init__(self):
+ inkex.errormsg(_('Inkscape must be installed and set in your path variable.'))
+
class GimpXCFGimpNotInstalled(GimpXCFError):
def __init__(self):
inkex.errormsg(_('Gimp must be installed and set in your path variable.'))
@@ -166,7 +170,11 @@ class MyEffect(inkex.Effect):
f.close()
err.close()
stdin.close()
-
+
+ if return_code != 0:
+ self.clear_tmp()
+ raise GimpXCFInkscapeNotInstalled
+
if os.name == 'nt':
filename = filename.replace("\\", "/")
pngs.append(filename)
diff --git a/share/extensions/hpgl_decoder.py b/share/extensions/hpgl_decoder.py
index e909790b7..cd900202b 100644
--- a/share/extensions/hpgl_decoder.py
+++ b/share/extensions/hpgl_decoder.py
@@ -41,84 +41,63 @@ class hpglDecoder:
self.scaleY = options.resolutionY / 25.4 # dots/inch to dots/mm
self.warning = ''
self.textMovements = _("Movements")
- self.textPenNumber = _("Pen #")
+ self.textPenNumber = _("Pen ")
+ self.layers = {}
+ self.oldCoordinates = (0.0, self.options.docHeight)
def getSvg(self):
+ actualLayer = 0
# prepare document
- self.doc = inkex.etree.parse(StringIO('<svg xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="%smm" height="%smm" viewBox="0 0 %s %s"></svg>' %
+ self.doc = inkex.etree.parse(StringIO('<svg xmlns:sodipodi="' + inkex.NSS['sodipodi'] + '" xmlns:inkscape="' + inkex.NSS['inkscape'] + '" width="%smm" height="%smm" viewBox="0 0 %s %s"></svg>' %
(self.options.docWidth, self.options.docHeight, self.options.docWidth, self.options.docHeight)))
inkex.etree.SubElement(self.doc.getroot(), inkex.addNS('namedview', 'sodipodi'), {inkex.addNS('document-units', 'inkscape'): 'mm'})
- actualLayer = 0
- self.layers = {}
if self.options.showMovements:
self.layers[0] = inkex.etree.SubElement(self.doc.getroot(), 'g', {inkex.addNS('groupmode', 'inkscape'): 'layer', inkex.addNS('label', 'inkscape'): self.textMovements, 'id': self.textMovements})
- # parse paths
+ # cut stream into commands
hpglData = self.hpglString.split(';')
+ # if number of commands is under needed minimum, no data was found
if len(hpglData) < 3:
raise Exception('NO_HPGL_DATA')
- oldCoordinates = (0.0, self.options.docHeight)
- path = ''
+ # decode commands into svg data
for i, command in enumerate(hpglData):
if command.strip() != '':
if command[:2] == 'IN' or command[:2] == 'FS' or command[:2] == 'VS':
- # if Initialize, force or speed command, ignore
+ # if Initialize, force or speed command ignore it
pass
elif command[:2] == 'SP':
# if Select Pen command
- actualLayer = command[2:]
- self.createLayer(actualLayer)
+ actualLayer = int(command[2:])
elif command[:2] == 'PU':
# if Pen Up command
- if ' L ' in path:
- self.addPathToLayer(path, actualLayer)
- if self.options.showMovements and oldCoordinates != self.getParameters(command[2:]):
- path = 'M %f,%f' % oldCoordinates
- path += ' L %f,%f' % self.getParameters(command[2:])
- self.addPathToLayer(path, 0)
- path = 'M %f,%f' % self.getParameters(command[2:])
- oldCoordinates = self.getParameters(command[2:])
+ self.parametersToPath(command[2:], 0, True)
elif command[:2] == 'PD':
# if Pen Down command
- parameterString = command[2:]
- if parameterString.strip() != '':
- parameterString = parameterString.replace(';', '').strip()
- parameter = parameterString.split(',')
- for i, param in enumerate(parameter):
- if i % 2 == 0:
- parameter[i] = str(float(param) / self.scaleX)
- else:
- parameter[i] = str(self.options.docHeight - (float(param) / self.scaleY))
- parameterString = ','.join(parameter)
- path += ' L %s' % parameterString
- oldCoordinates = (float(parameter[-2]), float(parameter[-1]))
+ self.parametersToPath(command[2:], actualLayer + 1, False)
else:
self.warning = 'UNKNOWN_COMMANDS'
- if ' L ' in path:
- self.addPathToLayer(path, actualLayer)
return (self.doc, self.warning)
- def createLayer(self, layerNumber):
- try:
- self.layers[layerNumber]
- except KeyError:
- self.layers[layerNumber] = inkex.etree.SubElement(self.doc.getroot(), 'g',
- {inkex.addNS('groupmode', 'inkscape'): 'layer', inkex.addNS('label', 'inkscape'): self.textPenNumber + layerNumber, 'id': self.textPenNumber + layerNumber})
-
- def addPathToLayer(self, path, layerNumber):
- lineColor = '000000'
- if layerNumber == 0:
- lineColor = 'ff0000'
- inkex.etree.SubElement(self.layers[layerNumber], 'path', {'d': path, 'style': 'stroke:#' + lineColor + '; stroke-width:0.4; fill:none;'})
+ def parametersToPath(self, parameters, layerNum, isPU):
+ # split params and sanity check them
+ parameters = parameters.strip().split(',')
+ if len(parameters) > 0 and len(parameters) % 2 == 0:
+ for i, param in enumerate(parameters):
+ # convert params to document units
+ if i % 2 == 0:
+ parameters[i] = str(float(param) / self.scaleX)
+ else:
+ parameters[i] = str(self.options.docHeight - (float(param) / self.scaleY))
+ # create path and add it to the corresponding layer
+ if not isPU or (self.options.showMovements and isPU):
+ # create layer if it does not exist
+ try:
+ self.layers[layerNum]
+ except KeyError:
+ self.layers[layerNum] = inkex.etree.SubElement(self.doc.getroot(), 'g',
+ {inkex.addNS('groupmode', 'inkscape'): 'layer', inkex.addNS('label', 'inkscape'): self.textPenNumber + str(layerNum - 1), 'id': self.textPenNumber + str(layerNum - 1)})
+ path = 'M %f,%f L %s' % (self.oldCoordinates[0], self.oldCoordinates[1], ','.join(parameters))
+ inkex.etree.SubElement(self.layers[layerNum], 'path', {'d': path, 'style': 'stroke:#' + ('ff0000' if isPU else '000000') + '; stroke-width:0.2; fill:none;'})
+ self.oldCoordinates = (float(parameters[-2]), float(parameters[-1]))
- def getParameters(self, parameterString):
- # process coordinates
- if parameterString.strip() == '':
- parameterString = '0,0;'
- # remove command delimiter
- parameterString = parameterString.replace(';', '').strip()
- # split parameter
- parameter = parameterString.split(',')
- # convert to svg coordinate system and return
- return (float(parameter[0]) / self.scaleX, self.options.docHeight - (float(parameter[1]) / self.scaleY))
# vim: expandtab shiftwidth=4 tabstop=8 softtabstop=4 fileencoding=utf-8 textwidth=99 \ No newline at end of file
diff --git a/share/extensions/inkscape_help_keys.inx b/share/extensions/inkscape_help_keys.inx
index 9608ac7b9..612524517 100644
--- a/share/extensions/inkscape_help_keys.inx
+++ b/share/extensions/inkscape_help_keys.inx
@@ -4,7 +4,7 @@
<id>org.inkscape.help.keys</id>
<dependency type="executable" location="extensions">launch_webbrowser.py</dependency>
<!-- i18n. Please don't translate it unless a page exists in your language -->
- <_param name="url" gui-hidden="true" type="string">http://inkscape.org/doc/keys048.html</_param>
+ <_param name="url" gui-hidden="true" type="string">http://inkscape.org/doc/keys091.html</_param>
<effect needs-document="false">
<object-type>all</object-type>
<effects-menu hidden="true" />
diff --git a/share/extensions/pathalongpath.py b/share/extensions/pathalongpath.py
index 7da7f1797..234430acd 100755
--- a/share/extensions/pathalongpath.py
+++ b/share/extensions/pathalongpath.py
@@ -66,7 +66,7 @@ def stretch(pathcomp,xscale,yscale,org):
def linearize(p,tolerance=0.001):
'''
- This function recieves a component of a 'cubicsuperpath' and returns two things:
+ This function receives a component of a 'cubicsuperpath' and returns two things:
The path subdivided in many straight segments, and an array containing the length of each segment.
We could work with bezier path as well, but bezier arc lengths are (re)computed for each point
@@ -153,7 +153,7 @@ class PathAlongPath(pathmodifier.Diffeo):
def lengthtotime(self,l):
'''
Recieves an arc length l, and returns the index of the segment in self.skelcomp
- containing the coresponding point, to gether with the position of the point on this segment.
+ containing the corresponding point, to gether with the position of the point on this segment.
If the deformer is closed, do computations modulo the toal length.
'''
diff --git a/share/extensions/pathscatter.py b/share/extensions/pathscatter.py
index 268e31069..5c2857979 100755
--- a/share/extensions/pathscatter.py
+++ b/share/extensions/pathscatter.py
@@ -80,7 +80,7 @@ def stretch(pathcomp,xscale,yscale,org):
def linearize(p,tolerance=0.001):
'''
- This function recieves a component of a 'cubicsuperpath' and returns two things:
+ This function receives a component of a 'cubicsuperpath' and returns two things:
The path subdivided in many straight segments, and an array containing the length of each segment.
We could work with bezier path as well, but bezier arc lengths are (re)computed for each point
@@ -186,7 +186,7 @@ class PathScatter(pathmodifier.Diffeo):
def lengthtotime(self,l):
'''
Recieves an arc length l, and returns the index of the segment in self.skelcomp
- containing the coresponding point, to gether with the position of the point on this segment.
+ containing the corresponding point, to gether with the position of the point on this segment.
If the deformer is closed, do computations modulo the toal length.
'''
@@ -203,7 +203,7 @@ class PathScatter(pathmodifier.Diffeo):
def localTransformAt(self,s,follow=True):
'''
- recieves a length, and returns the coresponding point and tangent of self.skelcomp
+ receives a length, and returns the coresponding point and tangent of self.skelcomp
if follow is set to false, returns only the translation
'''
i,t=self.lengthtotime(s)
diff --git a/share/extensions/plotter.inx b/share/extensions/plotter.inx
index 80543f02a..5a6d8ce06 100644
--- a/share/extensions/plotter.inx
+++ b/share/extensions/plotter.inx
@@ -36,8 +36,9 @@
<param name="commandLanguage" type="enum" _gui-text="Command language:" _gui-description="The command language to use (Default: HPGL)">
<_item value="HPGL">HPGL</_item>
<_item value="DMPL">DMPL</_item>
- <_item value="ZING">KNK Zing (HPGL variant)</_item>
+ <_item value="KNK">KNK Plotter (HPGL variant)</_item>
</param>
+ <param name="initCommands" type="string" _gui-text="Initialization commands:" _gui-description="Commands that will be sent to the plotter before the main data stream, only use this if you know what you are doing! (Default: Empty)"></param>
<param name="space" type="description">&#xa0;</param>
<_param name="freezeHelp" type="description">Using wrong settings can under certain circumstances cause Inkscape to freeze. Always save your work before plotting!</_param>
<_param name="serialHelp" type="description">This can be a physical serial connection or a USB-to-Serial bridge. Ask your plotter manufacturer for drivers if needed.</_param>
diff --git a/share/extensions/plotter.py b/share/extensions/plotter.py
index 398ab683e..7e24d0824 100644
--- a/share/extensions/plotter.py
+++ b/share/extensions/plotter.py
@@ -39,6 +39,7 @@ class Plot(inkex.Effect):
self.OptionParser.add_option('--serialBaudRate', action='store', type='string', dest='serialBaudRate', default='9600', help='Serial Baud rate')
self.OptionParser.add_option('--flowControl', action='store', type='string', dest='flowControl', default='0', help='Flow control')
self.OptionParser.add_option('--commandLanguage', action='store', type='string', dest='commandLanguage', default='hpgl', help='Command Language')
+ self.OptionParser.add_option('--initCommands', action='store', type='string', dest='initCommands', default='', help='Initialization commands')
self.OptionParser.add_option('--resolutionX', action='store', type='float', dest='resolutionX', default=1016.0, help='Resolution X (dpi)')
self.OptionParser.add_option('--resolutionY', action='store', type='float', dest='resolutionY', default=1016.0, help='Resolution Y (dpi)')
self.OptionParser.add_option('--pen', action='store', type='int', dest='pen', default=1, help='Pen number')
@@ -52,7 +53,7 @@ class Plot(inkex.Effect):
self.OptionParser.add_option('--toolOffset', action='store', type='float', dest='toolOffset', default=0.25, help='Tool offset (mm)')
self.OptionParser.add_option('--precut', action='store', type='inkbool', dest='precut', default='TRUE', help='Use precut')
self.OptionParser.add_option('--flat', action='store', type='float', dest='flat', default=1.2, help='Curve flatness')
- self.OptionParser.add_option('--autoAlign', action='store', type='inkbool', dest='autoAlign', default='TRUE', help='Auto align')
+ self.OptionParser.add_option('--autoAlign', action='store', type='inkbool', dest='autoAlign', default='TRUE', help='Auto align')
self.OptionParser.add_option('--debug', action='store', type='inkbool', dest='debug', default='FALSE', help='Show debug information')
def effect(self):
@@ -87,8 +88,8 @@ class Plot(inkex.Effect):
self.convertToHpgl()
if self.options.commandLanguage == 'DMPL':
self.convertToDmpl()
- if self.options.commandLanguage == 'ZING':
- self.convertToZing()
+ if self.options.commandLanguage == 'KNK':
+ self.convertToKNK()
# output
if self.options.debug:
self.showDebugInfo(debugObject)
@@ -102,7 +103,7 @@ class Plot(inkex.Effect):
hpglInit += ';FS%d' % self.options.force
if self.options.speed > 0:
hpglInit += ';VS%d' % self.options.speed
- self.hpgl = hpglInit + self.hpgl + ';PU0,0;SP0;IN;'
+ self.hpgl = hpglInit + self.hpgl + ';PU0,0;SP0;IN; '
def convertToDmpl(self):
# convert HPGL to DMPL
@@ -124,16 +125,16 @@ class Plot(inkex.Effect):
if self.options.speed > 0:
dmplInit += 'V%d' % self.options.speed
dmplInit += 'EC1'
- self.hpgl = dmplInit + self.hpgl[1:] + ',U0,0,P0Z'
+ self.hpgl = dmplInit + self.hpgl[1:] + ',U0,0,P0Z '
- def convertToZing(self):
- # convert HPGL to Zing
+ def convertToKNK(self):
+ # convert HPGL to KNK Plotter Language
hpglInit = 'ZG;SP%d' % self.options.pen
if self.options.force > 0:
hpglInit += ';FS%d' % self.options.force
if self.options.speed > 0:
hpglInit += ';VS%d' % self.options.speed
- self.hpgl = hpglInit + self.hpgl + ';PU0,0;SP0;@'
+ self.hpgl = hpglInit + self.hpgl + ';PU0,0;SP0;@ '
def sendHpglToSerial(self):
# gracefully exit script when pySerial is missing
@@ -165,6 +166,8 @@ class Plot(inkex.Effect):
else:
type, value, traceback = sys.exc_info()
raise ValueError, ('', type, value), traceback
+ if self.options.initCommands != '':
+ mySerial.write(self.options.initCommands.decode('string_escape'))
mySerial.write(self.hpgl)
mySerial.read(2)
mySerial.close()
@@ -172,16 +175,17 @@ class Plot(inkex.Effect):
def showDebugInfo(self, debugObject):
# show debug information
inkex.errormsg("---------------------------------\nDebug information\n---------------------------------\n\nSettings:\n")
- inkex.errormsg(' Serial Port: ' + str(self.options.serialPort))
- inkex.errormsg(' Serial baud rate: ' + str(self.options.serialBaudRate))
- inkex.errormsg(' Flow control: ' + str(self.options.flowControl))
- inkex.errormsg(' Command language: ' + str(self.options.commandLanguage))
+ inkex.errormsg(' Serial Port: ' + self.options.serialPort)
+ inkex.errormsg(' Serial baud rate: ' + self.options.serialBaudRate)
+ inkex.errormsg(' Flow control: ' + self.options.flowControl)
+ inkex.errormsg(' Command language: ' + self.options.commandLanguage)
+ inkex.errormsg(' Initialization commands: ' + self.options.initCommands)
inkex.errormsg(' Resolution X (dpi): ' + str(self.options.resolutionX))
inkex.errormsg(' Resolution Y (dpi): ' + str(self.options.resolutionY))
inkex.errormsg(' Pen number: ' + str(self.options.pen))
inkex.errormsg(' Pen force (g): ' + str(self.options.force))
inkex.errormsg(' Pen speed (cm/s): ' + str(self.options.speed))
- inkex.errormsg(' Rotation (Clockwise): ' + str(self.options.orientation))
+ inkex.errormsg(' Rotation (Clockwise): ' + self.options.orientation)
inkex.errormsg(' Mirror X axis: ' + str(self.options.mirrorX))
inkex.errormsg(' Mirror Y axis: ' + str(self.options.mirrorY))
inkex.errormsg(' Center zero point: ' + str(self.options.center))
diff --git a/share/extensions/seamless_pattern.inx b/share/extensions/seamless_pattern.inx
index fe4098e05..f63872272 100644
--- a/share/extensions/seamless_pattern.inx
+++ b/share/extensions/seamless_pattern.inx
@@ -4,8 +4,8 @@
<id>org.inkscape.render.seamless_pattern</id>
<dependency type="executable" location="extensions">seamless_pattern.py</dependency>
<dependency type="executable" location="extensions">inkex.py</dependency>
- <param name="width" _gui-text="Custom Width (px.):" type="int" min="1" max="99999999">100</param>
- <param name="height" _gui-text="Custom Height (px.):" type="int" min="1" max="99999999">100</param>
+ <param name="width" _gui-text="Custom Width (px):" type="int" min="1" max="99999999">100</param>
+ <param name="height" _gui-text="Custom Height (px):" type="int" min="1" max="99999999">100</param>
<_param name="help-info" type="description">This extension overwrite current document</_param>
<effect needs-live-preview="false">
diff --git a/share/extensions/seamless_pattern_procedural.inx b/share/extensions/seamless_pattern_procedural.inx
index f9800c63d..0c173fd0c 100644
--- a/share/extensions/seamless_pattern_procedural.inx
+++ b/share/extensions/seamless_pattern_procedural.inx
@@ -5,8 +5,8 @@
<dependency type="executable" location="extensions">seamless_pattern.py</dependency>
<dependency type="executable" location="extensions">inkex.py</dependency>
- <param name="width" _gui-text="Custom Width (px.):" type="int" min="1" max="99999999">100</param>
- <param name="height" _gui-text="Custom Height (px.):" type="int" min="1" max="99999999">100</param>
+ <param name="width" _gui-text="Custom Width (px):" type="int" min="1" max="99999999">100</param>
+ <param name="height" _gui-text="Custom Height (px):" type="int" min="1" max="99999999">100</param>
<effect needs-live-preview="false">
<object-type>all</object-type>
diff --git a/share/extensions/svg2xaml.xsl b/share/extensions/svg2xaml.xsl
index fa785fa4f..d2796c93c 100755
--- a/share/extensions/svg2xaml.xsl
+++ b/share/extensions/svg2xaml.xsl
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2005-2007 authors:
+Copyright (c) 2005-2015 authors:
Original version: Toine de Greef (a.degreef@chello.nl)
-Modified (2010-2014) by Nicolas Dufour (nicoduf@yahoo.fr) (blur support, units
+Modified (2010-2015) by Nicolas Dufour (nicoduf@yahoo.fr) (blur support, units
convertion, comments, and some other fixes)
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -34,7 +34,8 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:exsl="http://exslt.org/common"
xmlns:libxslt="http://xmlsoft.org/XSLT/namespace"
-exclude-result-prefixes="rdf xlink xs exsl libxslt">
+xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+exclude-result-prefixes="rdf xlink xs exsl libxslt inkscape">
<xsl:strip-space elements="*" />
<xsl:output method="xml" encoding="UTF-8" indent="yes"/>
@@ -80,9 +81,8 @@ exclude-result-prefixes="rdf xlink xs exsl libxslt">
<Canvas>
<xsl:apply-templates mode="id" select="." />
<xsl:apply-templates mode="filter_effect" select="." />
- <!--
<xsl:apply-templates mode="clip" select="." />
- -->
+
<xsl:if test="@style and contains(@style, 'display:none')">
<xsl:attribute name="Visibility">Collapsed</xsl:attribute>
</xsl:if>
@@ -178,6 +178,7 @@ exclude-result-prefixes="rdf xlink xs exsl libxslt">
* Parse transform
* Apply transform
+ * Rotation center
-->
<!--
@@ -417,6 +418,20 @@ exclude-result-prefixes="rdf xlink xs exsl libxslt">
</xsl:template>
<!--
+ // Rotation center //
+ In XAML, relative to the object's bounding box (RenderTransformOrigin="0.5,0.5" is the center)
+ Unfortunately, converting would require that the bounding box of all objects and groups is calculated, which is rather complex...
+-->
+<xsl:template mode="rotation-center" match="*">
+ <xsl:if test="@inkscape:transform-center-x">
+<!-- <xsl:attribute name="RenderTransformOrigin">
+ <xsl:value-of select="concat(@inkscape:transform-center-x, ',', @inkscape:transform-center-y)" />
+ </xsl:attribute>
+-->>
+ </xsl:if>
+</xsl:template>
+
+<!--
// Resources (defs) //
* Resources ids
@@ -2566,6 +2581,7 @@ exclude-result-prefixes="rdf xlink xs exsl libxslt">
<xsl:apply-templates mode="desc" select="." />
<xsl:apply-templates mode="clip" select="." />
+
<xsl:apply-templates mode="transform" select=".">
<xsl:with-param name="mapped_type" select="'Rectangle'" />
</xsl:apply-templates>