diff options
70 files changed, 1315 insertions, 89 deletions
@@ -1,4 +1,4 @@ -EXTENSIONS:=embroider embroider_params embroider_simulate embroider_print +EXTENSIONS:=embroider embroider_params embroider_simulate embroider_print embroider_input # This gets the branch name or the name of the tag VERSION:=$(TRAVIS_BRANCH) @@ -7,7 +7,7 @@ ARCH:=$(shell uname -m) dist: distclean locales bin/build-dist $(EXTENSIONS) - cp *.inx dist + cp inx/*.inx dist cp -a images/examples dist/inkstitch mkdir -p dist/inkstitch/bin/locales cp -a locales/* dist/inkstitch/bin/locales diff --git a/bin/gen-input-inx b/bin/gen-input-inx new file mode 100755 index 00000000..918adfb9 --- /dev/null +++ b/bin/gen-input-inx @@ -0,0 +1,45 @@ +#!/usr/bin/env python + +import sys, os +from os.path import dirname +from libembroidery import * +from jinja2 import Environment, FileSystemLoader, select_autoescape + + +def build_environment(): + template_dir = os.path.join(dirname(dirname(os.path.realpath(__file__))), "templates") + + return Environment( + loader = FileSystemLoader(template_dir), + autoescape = True + ) + + +def libembroidery_input_formats(): + formatList = embFormatList_create() + curFormat = formatList + while(curFormat): + extension = embFormat_extension(curFormat) + description = embFormat_description(curFormat) + writerState = embFormat_readerState(curFormat) + + if writerState.strip() and embFormat_type(curFormat) != EMBFORMAT_OBJECTONLY: + # extension includes the dot, so we'll remove it + yield extension[1:], description + + curFormat = curFormat.next + + +def main(): + env = build_environment() + template = env.get_template('embroider_input.inx') + + for format, description in libembroidery_input_formats(): + inx = template.render(format=format, description=description) + + with open("inx/embroider_input_%s.inx" % format.upper(), 'w') as inx_file: + inx_file.write(inx) + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/bin/gen-format-list b/bin/gen-output-format-option-list index 674813bb..674813bb 100755 --- a/bin/gen-format-list +++ b/bin/gen-output-format-option-list diff --git a/embroider_input.py b/embroider_input.py new file mode 100644 index 00000000..04d79d4f --- /dev/null +++ b/embroider_input.py @@ -0,0 +1,61 @@ +import sys +import os +from libembroidery import * +from inkex import etree +import inkex +from inkstitch import PIXELS_PER_MM, INKSCAPE_LABEL, _ +from inkstitch.stitch_plan import StitchPlan +from inkstitch.svg import render_stitch_plan + + +def pattern_stitches(pattern): + stitch_pointer = pattern.stitchList + while stitch_pointer: + yield stitch_pointer.stitch + stitch_pointer = stitch_pointer.next + + +def main(embroidery_file): + pattern = embPattern_create() + embPattern_read(pattern, embroidery_file) + embPattern_flipVertical(pattern) + + stitch_plan = StitchPlan() + color_block = None + current_color = None + + for stitch in pattern_stitches(pattern): + if stitch.color != current_color: + thread = embThreadList_getAt(pattern.threadList, stitch.color) + color = thread.color + color_block = stitch_plan.new_color_block((color.r, color.g, color.b)) + current_color = stitch.color + + if not stitch.flags & END: + color_block.add_stitch(stitch.xx * PIXELS_PER_MM, stitch.yy * PIXELS_PER_MM, + jump=stitch.flags & JUMP, + stop=stitch.flags & STOP, + trim=stitch.flags & TRIM) + + extents = stitch_plan.extents + svg = etree.Element("svg", nsmap=inkex.NSS, attrib= + { + "width": str(extents[0] * 2), + "height": str(extents[1] * 2), + "viewBox": "0 0 %s %s" % (extents[0] * 2, extents[1] * 2), + }) + render_stitch_plan(svg, stitch_plan) + + # rename the Stitch Plan layer so that it doesn't get overwritten by Embroider + layer = svg.find(".//*[@id='__inkstitch_stitch_plan__']") + layer.set(INKSCAPE_LABEL, os.path.basename(embroidery_file)) + layer.attrib.pop('id') + + # Shift the design so that its origin is at the center of the canvas + # Note: this is NOT the same as centering the design in the canvas! + layer.set('transform', 'translate(%s,%s)' % (extents[0], extents[1])) + + print etree.tostring(svg) + +if __name__ == '__main__': + sys.exit(main(*sys.argv[1:])) diff --git a/embroider_print.py b/embroider_print.py index c0b49bf2..bc96b2cd 100644 --- a/embroider_print.py +++ b/embroider_print.py @@ -9,7 +9,10 @@ import socket import errno import time import logging +from copy import deepcopy import wx +import appdirs +import json import inkex import inkstitch @@ -23,7 +26,7 @@ from jinja2 import Environment, FileSystemLoader, select_autoescape from datetime import date import base64 -from flask import Flask, request, Response, send_from_directory +from flask import Flask, request, Response, send_from_directory, jsonify import webbrowser import requests @@ -32,6 +35,29 @@ def datetimeformat(value, format='%Y/%m/%d'): return value.strftime(format) +def defaults_path(): + defaults_dir = appdirs.user_config_dir('inkstitch') + + if not os.path.exists(defaults_dir): + os.makedirs(defaults_dir) + + return os.path.join(defaults_dir, 'print_settings.json') + + +def load_defaults(): + try: + with open(defaults_path(), 'r') as defaults_file: + defaults = json.load(defaults_file) + return defaults + except: + return {} + + +def save_defaults(defaults): + with open(defaults_path(), 'w') as defaults_file: + json.dump(defaults, defaults_file) + + def open_url(url): # Avoid spurious output from xdg-open. Any output on stdout will crash # inkscape. @@ -71,6 +97,7 @@ def open_url(url): class PrintPreviewServer(Thread): def __init__(self, *args, **kwargs): self.html = kwargs.pop('html') + self.metadata = kwargs.pop('metadata') Thread.__init__(self, *args, **kwargs) self.daemon = True self.last_request_time = None @@ -129,6 +156,27 @@ class PrintPreviewServer(Thread): # nothing to do here -- request_started() will restart the watcher return "OK" + @self.app.route('/settings/<field_name>', methods=['POST']) + def set_field(field_name): + self.metadata[field_name] = request.json['value'] + return "OK" + + @self.app.route('/settings/<field_mame>', methods=['GET']) + def get_field(field_name): + return jsonify(self.metadata[field_name]) + + @self.app.route('/settings', methods=['GET']) + def get_settings(): + settings = {} + settings.update(load_defaults()) + settings.update(self.metadata) + return jsonify(settings) + + @self.app.route('/defaults', methods=['POST']) + def set_defaults(): + save_defaults(request.json['value']) + return "OK" + def stop(self): # for whatever reason, shutting down only seems possible in # the context of a flask request, so we'll just make one @@ -299,7 +347,11 @@ class Print(InkstitchExtension): color_blocks = stitch_plan.color_blocks, ) - print_server = PrintPreviewServer(html=html) + # We've totally mucked with the SVG. Restore it so that we can save + # metadata into it. + self.document = deepcopy(self.original_document) + + print_server = PrintPreviewServer(html=html, metadata=self.get_inkstitch_metadata()) print_server.start() time.sleep(1) @@ -310,12 +362,9 @@ class Print(InkstitchExtension): info_frame.Show() app.MainLoop() - # don't let inkex print the document out - sys.exit(0) - if __name__ == '__main__': - save_stderr() + #save_stderr() effect = Print() effect.affect() - restore_stderr() + #restore_stderr() diff --git a/inkstitch/__init__.py b/inkstitch/__init__.py index 2e7a55f6..45eed3a6 100644 --- a/inkstitch/__init__.py +++ b/inkstitch/__init__.py @@ -161,16 +161,17 @@ def get_stroke_scale(node): class Stitch(Point): - def __init__(self, x, y, color=None, jump=False, stop=False, trim=False): + def __init__(self, x, y, color=None, jump=False, stop=False, trim=False, no_ties=False): self.x = x self.y = y self.color = color self.jump = jump self.trim = trim self.stop = stop + self.no_ties = no_ties def __repr__(self): - return "Stitch(%s, %s, %s, %s, %s, %s)" % (self.x, self.y, self.color, "JUMP" if self.jump else "", "TRIM" if self.trim else "", "STOP" if self.stop else "") + return "Stitch(%s, %s, %s, %s, %s, %s, %s)" % (self.x, self.y, self.color, "JUMP" if self.jump else " ", "TRIM" if self.trim else " ", "STOP" if self.stop else " ", "NO TIES" if self.no_ties else " ") def make_thread(color): diff --git a/inkstitch/elements/element.py b/inkstitch/elements/element.py index 7a029eac..cfca3782 100644 --- a/inkstitch/elements/element.py +++ b/inkstitch/elements/element.py @@ -14,11 +14,12 @@ from cspsubdiv import cspsubdiv class Patch: """A raw collection of stitches with attached instructions.""" - def __init__(self, color=None, stitches=None, trim_after=False, stop_after=False): + def __init__(self, color=None, stitches=None, trim_after=False, stop_after=False, stitch_as_is=False): self.color = color self.stitches = stitches or [] self.trim_after = trim_after self.stop_after = stop_after + self.stitch_as_is = stitch_as_is def __add__(self, other): if isinstance(other, Patch): @@ -203,25 +204,18 @@ class EmbroideryElement(object): # apply the combined transform to this node's path simpletransform.applyTransformToPath(transform, path) - return path + def strip_control_points(self, subpath): + return [point for control_before, point, control_after in subpath] + def flatten(self, path): """approximate a path containing beziers with a series of points""" path = deepcopy(path) - cspsubdiv(path, 0.1) - flattened = [] - - for comp in path: - vertices = [] - for ctl in comp: - vertices.append((ctl[1][0], ctl[1][1])) - flattened.append(vertices) - - return flattened + return [self.strip_control_points(subpath) for subpath in path] @property @param('trim_after', diff --git a/inkstitch/elements/stroke.py b/inkstitch/elements/stroke.py index b0e7d23f..0ce3fa67 100644 --- a/inkstitch/elements/stroke.py +++ b/inkstitch/elements/stroke.py @@ -37,7 +37,17 @@ class Stroke(EmbroideryElement): @property def paths(self): - return self.flatten(self.parse_path()) + path = self.parse_path() + + if self.manual_stitch_mode: + return [self.strip_control_points(subpath) for subpath in path] + else: + return self.flatten(path) + + @property + @param('manual_stitch', _('Manual stitch placement'), tooltip=_("Stitch every node in the path. Stitch length and zig-zag spacing are ignored."), type='boolean', default=False) + def manual_stitch_mode(self): + return self.get_boolean_param('manual_stitch') def is_running_stitch(self): # stroke width <= 0.5 pixels is deprecated in favor of dashed lines @@ -99,7 +109,9 @@ class Stroke(EmbroideryElement): for path in self.paths: path = [Point(x, y) for x, y in path] - if self.is_running_stitch(): + if self.manual_stitch_mode: + patch = Patch(color=self.color, stitches=path, stitch_as_is=True) + elif self.is_running_stitch(): patch = self.stroke_points(path, self.running_stitch_length, stroke_width=0.0) else: patch = self.stroke_points(path, self.zigzag_spacing / 2.0, stroke_width=self.stroke_width) diff --git a/inkstitch/extensions.py b/inkstitch/extensions.py index 7795abb8..70341cd3 100644 --- a/inkstitch/extensions.py +++ b/inkstitch/extensions.py @@ -1,6 +1,94 @@ import inkex +import re +import json +from collections import MutableMapping from .elements import AutoFill, Fill, Stroke, SatinColumn, Polyline, EmbroideryElement from . import SVG_POLYLINE_TAG, SVG_GROUP_TAG, SVG_DEFS_TAG, INKSCAPE_GROUPMODE, EMBROIDERABLE_TAGS, PIXELS_PER_MM +from .utils import cache + + +SVG_METADATA_TAG = inkex.addNS("metadata", "svg") + + +def strip_namespace(tag): + """Remove xml namespace from a tag name. + + >>> {http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd}namedview + <<< namedview + """ + + match = re.match('^\{[^}]+\}(.+)$', tag) + + if match: + return match.group(1) + else: + return tag + + +class InkStitchMetadata(MutableMapping): + """Helper class to get and set inkstitch-specific metadata attributes. + + Operates on a document and acts like a dict. Setting an item adds or + updates a metadata element in the document. Getting an item retrieves + a metadata element's text contents or None if an element by that name + doesn't exist. + """ + + def __init__(self, document): + self.document = document + self.metadata = self._get_or_create_metadata() + + def _get_or_create_metadata(self): + metadata = self.document.find(SVG_METADATA_TAG) + + if metadata is None: + metadata = inkex.etree.SubElement(self.document.getroot(), SVG_METADATA_TAG) + + # move it so that it goes right after the first element, sodipodi:namedview + self.document.getroot().remove(metadata) + self.document.getroot().insert(1, metadata) + + return metadata + + # Because this class inherints from MutableMapping, all we have to do is + # implement these five methods and we get a full dict-like interface. + + def __setitem__(self, name, value): + self._find_item(name).text = json.dumps(value) + + def _find_item(self, name): + tag = inkex.addNS(name, "inkstitch") + item = self.metadata.find(tag) + if item is None: + item = inkex.etree.SubElement(self.metadata, tag) + + return item + + def __getitem__(self, name): + item = self._find_item(name) + + try: + return json.loads(item.text) + except ValueError: + return None + + def __delitem__(self, name): + item = self[name] + + if item: + self.metadata.remove(item) + + def __iter__(self): + for child in self.metadata: + if child.prefix == "inkstitch": + yield strip_namespace(child.tag) + + def __len__(self): + i = 0 + for i, item in enumerate(self): + pass + + return i + 1 class InkstitchExtension(inkex.Effect): @@ -101,3 +189,27 @@ class InkstitchExtension(inkex.Effect): patches.extend(element.embroider(last_patch)) return patches + + def get_inkstitch_metadata(self): + return InkStitchMetadata(self.document) + + def parse(self): + """Override inkex.Effect to add Ink/Stitch xml namespace""" + + # SVG parsers don't actually look for anything at this URL. They just + # care that it's unique. That defines a "namespace" of element and + # attribute names to disambiguate conflicts with element and + # attribute names other XML namespaces. + # + # Updating inkex.NSS here allows us to pass 'inkstitch' into + # inkex.addNS(). + inkex.NSS['inkstitch'] = 'http://inkstitch.org/namespace' + + # call the superclass's method first + inkex.Effect.parse(self) + + # This is the only way I could find to add a namespace to an existing + # element tree at the top without getting ugly prefixes like "ns0". + inkex.etree.cleanup_namespaces(self.document, + top_nsmap=inkex.NSS, + keep_ns_prefixes=inkex.NSS.keys()) diff --git a/inkstitch/stitch_plan/stitch_plan.py b/inkstitch/stitch_plan/stitch_plan.py index 3a7b8f18..fab87876 100644 --- a/inkstitch/stitch_plan/stitch_plan.py +++ b/inkstitch/stitch_plan/stitch_plan.py @@ -36,6 +36,7 @@ def patches_to_stitch_plan(patches, collapse_len=3.0 * PIXELS_PER_MM): if color_block.last_stitch: if (patch.stitches[0] - color_block.last_stitch).length() > collapse_len: color_block.add_stitch(patch.stitches[0].x, patch.stitches[0].y, jump=True) + else: # add a color change color_block.add_stitch(color_block.last_stitch.x, color_block.last_stitch.y, stop=True) @@ -43,7 +44,7 @@ def patches_to_stitch_plan(patches, collapse_len=3.0 * PIXELS_PER_MM): color_block.color = patch.color color_block.filter_duplicate_stitches() - color_block.add_stitches(patch.stitches) + color_block.add_stitches(patch.stitches, no_ties=patch.stitch_as_is) if patch.trim_after: # a trim needs to be followed by a jump to the next stitch, so @@ -75,6 +76,9 @@ class StitchPlan(object): def __len__(self): return len(self.color_blocks) + def __repr__(self): + return "StitchPlan(%s)" % ", ".join(repr(cb) for cb in self.color_blocks) + @property def num_colors(self): """Number of unique colors in the stitch plan.""" @@ -93,10 +97,30 @@ class StitchPlan(object): return sum(block.num_stitches for block in self) @property + def bounding_box(self): + color_block_bounding_boxes = [cb.bounding_box for cb in self] + minx = min(bb[0] for bb in color_block_bounding_boxes) + miny = min(bb[1] for bb in color_block_bounding_boxes) + maxx = max(bb[2] for bb in color_block_bounding_boxes) + maxy = max(bb[3] for bb in color_block_bounding_boxes) + + return minx, miny, maxx, maxy + + @property + def dimensions(self): + minx, miny, maxx, maxy = self.bounding_box + return (maxx - minx, maxy - miny) + + @property + def extents(self): + minx, miny, maxx, maxy = self.bounding_box + + return max(-minx, maxx), max(-miny, maxy) + + @property def dimensions_mm(self): - # TODO: implement this. Should do a bounding box calculation and - # convert to millimeters. - return "" + dimensions = self.dimensions + return (dimensions[0] / PIXELS_PER_MM, dimensions[1] / PIXELS_PER_MM) class ColorBlock(object): @@ -109,6 +133,9 @@ class ColorBlock(object): def __iter__(self): return iter(self.stitches) + def __repr__(self): + return "ColorBlock(%s, %s)" % (self.color, self.stitches) + def has_color(self): return self._color is not None @@ -159,10 +186,14 @@ class ColorBlock(object): stitches = [self.stitches[0]] for stitch in self.stitches[1:]: - l = (stitch - stitches[-1]).length() - if l <= 0.1: - # duplicate stitch, skip this one - continue + if stitches[-1].jump or stitch.stop or stitch.trim: + # Don't consider jumps, stops, or trims as candidates for filtering + pass + else: + l = (stitch - stitches[-1]).length() + if l <= 0.1: + # duplicate stitch, skip this one + continue stitches.append(stitch) @@ -172,16 +203,25 @@ class ColorBlock(object): if isinstance(args[0], Stitch): self.stitches.append(args[0]) elif isinstance(args[0], Point): - self.stitches.append(Stitch(args[0].x, args[0].y)) + self.stitches.append(Stitch(args[0].x, args[0].y, *args[1:], **kwargs)) else: self.stitches.append(Stitch(*args, **kwargs)) - def add_stitches(self, stitches): + def add_stitches(self, stitches, *args, **kwargs): for stitch in stitches: if isinstance(stitch, (Stitch, Point)): - self.add_stitch(stitch) + self.add_stitch(stitch, *args, **kwargs) else: - self.add_stitch(*stitch) + self.add_stitch(*(list(stitch) + args), **kwargs) def replace_stitches(self, stitches): self.stitches = stitches + + @property + def bounding_box(self): + minx = min(stitch.x for stitch in self) + miny = min(stitch.y for stitch in self) + maxx = max(stitch.x for stitch in self) + maxy = max(stitch.y for stitch in self) + + return minx, miny, maxx, maxy diff --git a/inkstitch/stitch_plan/ties.py b/inkstitch/stitch_plan/ties.py index 9c688e6b..1207ea51 100644 --- a/inkstitch/stitch_plan/ties.py +++ b/inkstitch/stitch_plan/ties.py @@ -4,6 +4,11 @@ from .. import Stitch from copy import deepcopy def add_tie(stitches, tie_path): + if stitches[-1].no_ties: + # It's from a manual stitch block, so don't add tie stitches. The user + # will add them if they want them. + return + tie_path = cut_path(tie_path, 0.6) tie_stitches = running_stitch(tie_path, 0.3) tie_stitches = [Stitch(stitch.x, stitch.y) for stitch in tie_stitches] diff --git a/inkstitch/svg.py b/inkstitch/svg.py index d9258f19..0728309b 100644 --- a/inkstitch/svg.py +++ b/inkstitch/svg.py @@ -1,5 +1,5 @@ import simpletransform, simplestyle, inkex -from . import _, get_viewbox_transform, cache, SVG_GROUP_TAG, INKSCAPE_LABEL, INKSCAPE_GROUPMODE, SVG_POLYLINE_TAG +from . import _, get_viewbox_transform, cache, SVG_GROUP_TAG, INKSCAPE_LABEL, INKSCAPE_GROUPMODE, SVG_PATH_TAG def color_block_to_point_lists(color_block): point_lists = [[]] @@ -27,21 +27,29 @@ def get_correction_transform(svg): return transform -def color_block_to_polylines(color_block, svg): - polylines = [] +def color_block_to_paths(color_block, svg): + paths = [] + # We could emit just a single path with one subpath per point list, but + # emitting multiple paths makes it easier for the user to manipulate them. for point_list in color_block_to_point_lists(color_block): color = color_block.color.visible_on_white.to_hex_str() - polylines.append(inkex.etree.Element( - SVG_POLYLINE_TAG, + paths.append(inkex.etree.Element( + SVG_PATH_TAG, {'style': simplestyle.formatStyle( {'stroke': color, 'stroke-width': "0.4", 'fill': 'none'}), - 'points': " ".join(",".join(str(coord) for coord in point) for point in point_list), - 'transform': get_correction_transform(svg) + 'd': "M" + " ".join(" ".join(str(coord) for coord in point) for point in point_list), + 'transform': get_correction_transform(svg), + 'embroider_manual_stitch': 'true', + 'embroider_trim_after': 'true', })) - return polylines + # no need to trim at the end of a thread color + if paths: + paths[-1].attrib.pop('embroider_trim_after') + + return paths def render_stitch_plan(svg, stitch_plan): @@ -63,6 +71,6 @@ def render_stitch_plan(svg, stitch_plan): SVG_GROUP_TAG, {'id': '__color_block_%d__' % i, INKSCAPE_LABEL: "color block %d" % (i + 1)}) - group.extend(color_block_to_polylines(color_block, svg)) + group.extend(color_block_to_paths(color_block, svg)) svg.append(layer) diff --git a/embroider.inx b/inx/embroider.inx index 74217b73..74217b73 100644 --- a/embroider.inx +++ b/inx/embroider.inx diff --git a/inx/embroider_input_100.inx b/inx/embroider_input_100.inx new file mode 100644 index 00000000..9bbad780 --- /dev/null +++ b/inx/embroider_input_100.inx @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> + <_name>100 file input</_name> + <id>org.inkstitch.input.100</id> + <dependency type="executable" location="extensions">embroider_input.py</dependency> + <dependency type="executable" location="extensions">inkex.py</dependency> + <input> + <extension>.100</extension> + <mimetype>application/x-embroidery-100</mimetype> + <_filetypename>Ink/Stitch: Toyota Embroidery Format (.100)</_filetypename> + <_filetypetooltip>convert 100 file to Ink/Stitch manual-stitch paths</_filetypetooltip> + </input> + <script> + <command reldir="extensions" interpreter="python">embroider_input.py</command> + </script> +</inkscape-extension> diff --git a/inx/embroider_input_10O.inx b/inx/embroider_input_10O.inx new file mode 100644 index 00000000..42f1850e --- /dev/null +++ b/inx/embroider_input_10O.inx @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> + <_name>10O file input</_name> + <id>org.inkstitch.input.10o</id> + <dependency type="executable" location="extensions">embroider_input.py</dependency> + <dependency type="executable" location="extensions">inkex.py</dependency> + <input> + <extension>.10o</extension> + <mimetype>application/x-embroidery-10o</mimetype> + <_filetypename>Ink/Stitch: Toyota Embroidery Format (.10o)</_filetypename> + <_filetypetooltip>convert 10O file to Ink/Stitch manual-stitch paths</_filetypetooltip> + </input> + <script> + <command reldir="extensions" interpreter="python">embroider_input.py</command> + </script> +</inkscape-extension> diff --git a/inx/embroider_input_BRO.inx b/inx/embroider_input_BRO.inx new file mode 100644 index 00000000..0dc576bf --- /dev/null +++ b/inx/embroider_input_BRO.inx @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> + <_name>BRO file input</_name> + <id>org.inkstitch.input.bro</id> + <dependency type="executable" location="extensions">embroider_input.py</dependency> + <dependency type="executable" location="extensions">inkex.py</dependency> + <input> + <extension>.bro</extension> + <mimetype>application/x-embroidery-bro</mimetype> + <_filetypename>Ink/Stitch: Bits & Volts Embroidery Format (.bro)</_filetypename> + <_filetypetooltip>convert BRO file to Ink/Stitch manual-stitch paths</_filetypetooltip> + </input> + <script> + <command reldir="extensions" interpreter="python">embroider_input.py</command> + </script> +</inkscape-extension> diff --git a/inx/embroider_input_COL.inx b/inx/embroider_input_COL.inx new file mode 100644 index 00000000..81002dd7 --- /dev/null +++ b/inx/embroider_input_COL.inx @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> + <_name>COL file input</_name> + <id>org.inkstitch.input.col</id> + <dependency type="executable" location="extensions">embroider_input.py</dependency> + <dependency type="executable" location="extensions">inkex.py</dependency> + <input> + <extension>.col</extension> + <mimetype>application/x-embroidery-col</mimetype> + <_filetypename>Ink/Stitch: Embroidery Thread Color Format (.col)</_filetypename> + <_filetypetooltip>convert COL file to Ink/Stitch manual-stitch paths</_filetypetooltip> + </input> + <script> + <command reldir="extensions" interpreter="python">embroider_input.py</command> + </script> +</inkscape-extension> diff --git a/inx/embroider_input_CSD.inx b/inx/embroider_input_CSD.inx new file mode 100644 index 00000000..8ebb94b9 --- /dev/null +++ b/inx/embroider_input_CSD.inx @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> + <_name>CSD file input</_name> + <id>org.inkstitch.input.csd</id> + <dependency type="executable" location="extensions">embroider_input.py</dependency> + <dependency type="executable" location="extensions">inkex.py</dependency> + <input> + <extension>.csd</extension> + <mimetype>application/x-embroidery-csd</mimetype> + <_filetypename>Ink/Stitch: Singer Embroidery Format (.csd)</_filetypename> + <_filetypetooltip>convert CSD file to Ink/Stitch manual-stitch paths</_filetypetooltip> + </input> + <script> + <command reldir="extensions" interpreter="python">embroider_input.py</command> + </script> +</inkscape-extension> diff --git a/inx/embroider_input_CSV.inx b/inx/embroider_input_CSV.inx new file mode 100644 index 00000000..c3f972d9 --- /dev/null +++ b/inx/embroider_input_CSV.inx @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> + <_name>CSV file input</_name> + <id>org.inkstitch.input.csv</id> + <dependency type="executable" location="extensions">embroider_input.py</dependency> + <dependency type="executable" location="extensions">inkex.py</dependency> + <input> + <extension>.csv</extension> + <mimetype>application/x-embroidery-csv</mimetype> + <_filetypename>Ink/Stitch: Comma Separated Values Format (.csv)</_filetypename> + <_filetypetooltip>convert CSV file to Ink/Stitch manual-stitch paths</_filetypetooltip> + </input> + <script> + <command reldir="extensions" interpreter="python">embroider_input.py</command> + </script> +</inkscape-extension> diff --git a/inx/embroider_input_DAT.inx b/inx/embroider_input_DAT.inx new file mode 100644 index 00000000..1045153a --- /dev/null +++ b/inx/embroider_input_DAT.inx @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> + <_name>DAT file input</_name> + <id>org.inkstitch.input.dat</id> + <dependency type="executable" location="extensions">embroider_input.py</dependency> + <dependency type="executable" location="extensions">inkex.py</dependency> + <input> + <extension>.dat</extension> + <mimetype>application/x-embroidery-dat</mimetype> + <_filetypename>Ink/Stitch: Barudan Embroidery Format (.dat)</_filetypename> + <_filetypetooltip>convert DAT file to Ink/Stitch manual-stitch paths</_filetypetooltip> + </input> + <script> + <command reldir="extensions" interpreter="python">embroider_input.py</command> + </script> +</inkscape-extension> diff --git a/inx/embroider_input_DSB.inx b/inx/embroider_input_DSB.inx new file mode 100644 index 00000000..f81c7ca2 --- /dev/null +++ b/inx/embroider_input_DSB.inx @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> + <_name>DSB file input</_name> + <id>org.inkstitch.input.dsb</id> + <dependency type="executable" location="extensions">embroider_input.py</dependency> + <dependency type="executable" location="extensions">inkex.py</dependency> + <input> + <extension>.dsb</extension> + <mimetype>application/x-embroidery-dsb</mimetype> + <_filetypename>Ink/Stitch: Barudan Embroidery Format (.dsb)</_filetypename> + <_filetypetooltip>convert DSB file to Ink/Stitch manual-stitch paths</_filetypetooltip> + </input> + <script> + <command reldir="extensions" interpreter="python">embroider_input.py</command> + </script> +</inkscape-extension> diff --git a/inx/embroider_input_DST.inx b/inx/embroider_input_DST.inx new file mode 100644 index 00000000..414b7470 --- /dev/null +++ b/inx/embroider_input_DST.inx @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> + <_name>DST file input</_name> + <id>org.inkstitch.input.dst</id> + <dependency type="executable" location="extensions">embroider_input.py</dependency> + <dependency type="executable" location="extensions">inkex.py</dependency> + <input> + <extension>.dst</extension> + <mimetype>application/x-embroidery-dst</mimetype> + <_filetypename>Ink/Stitch: Tajima Embroidery Format (.dst)</_filetypename> + <_filetypetooltip>convert DST file to Ink/Stitch manual-stitch paths</_filetypetooltip> + </input> + <script> + <command reldir="extensions" interpreter="python">embroider_input.py</command> + </script> +</inkscape-extension> diff --git a/inx/embroider_input_DSZ.inx b/inx/embroider_input_DSZ.inx new file mode 100644 index 00000000..9c81a0ad --- /dev/null +++ b/inx/embroider_input_DSZ.inx @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> + <_name>DSZ file input</_name> + <id>org.inkstitch.input.dsz</id> + <dependency type="executable" location="extensions">embroider_input.py</dependency> + <dependency type="executable" location="extensions">inkex.py</dependency> + <input> + <extension>.dsz</extension> + <mimetype>application/x-embroidery-dsz</mimetype> + <_filetypename>Ink/Stitch: ZSK USA Embroidery Format (.dsz)</_filetypename> + <_filetypetooltip>convert DSZ file to Ink/Stitch manual-stitch paths</_filetypetooltip> + </input> + <script> + <command reldir="extensions" interpreter="python">embroider_input.py</command> + </script> +</inkscape-extension> diff --git a/inx/embroider_input_EDR.inx b/inx/embroider_input_EDR.inx new file mode 100644 index 00000000..9276fd17 --- /dev/null +++ b/inx/embroider_input_EDR.inx @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> + <_name>EDR file input</_name> + <id>org.inkstitch.input.edr</id> + <dependency type="executable" location="extensions">embroider_input.py</dependency> + <dependency type="executable" location="extensions">inkex.py</dependency> + <input> + <extension>.edr</extension> + <mimetype>application/x-embroidery-edr</mimetype> + <_filetypename>Ink/Stitch: Embird Embroidery Format (.edr)</_filetypename> + <_filetypetooltip>convert EDR file to Ink/Stitch manual-stitch paths</_filetypetooltip> + </input> + <script> + <command reldir="extensions" interpreter="python">embroider_input.py</command> + </script> +</inkscape-extension> diff --git a/inx/embroider_input_EMD.inx b/inx/embroider_input_EMD.inx new file mode 100644 index 00000000..bb20f977 --- /dev/null +++ b/inx/embroider_input_EMD.inx @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> + <_name>EMD file input</_name> + <id>org.inkstitch.input.emd</id> + <dependency type="executable" location="extensions">embroider_input.py</dependency> + <dependency type="executable" location="extensions">inkex.py</dependency> + <input> + <extension>.emd</extension> + <mimetype>application/x-embroidery-emd</mimetype> + <_filetypename>Ink/Stitch: Elna Embroidery Format (.emd)</_filetypename> + <_filetypetooltip>convert EMD file to Ink/Stitch manual-stitch paths</_filetypetooltip> + </input> + <script> + <command reldir="extensions" interpreter="python">embroider_input.py</command> + </script> +</inkscape-extension> diff --git a/inx/embroider_input_EXP.inx b/inx/embroider_input_EXP.inx new file mode 100644 index 00000000..41bae8ce --- /dev/null +++ b/inx/embroider_input_EXP.inx @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> + <_name>EXP file input</_name> + <id>org.inkstitch.input.exp</id> + <dependency type="executable" location="extensions">embroider_input.py</dependency> + <dependency type="executable" location="extensions">inkex.py</dependency> + <input> + <extension>.exp</extension> + <mimetype>application/x-embroidery-exp</mimetype> + <_filetypename>Ink/Stitch: Melco Embroidery Format (.exp)</_filetypename> + <_filetypetooltip>convert EXP file to Ink/Stitch manual-stitch paths</_filetypetooltip> + </input> + <script> + <command reldir="extensions" interpreter="python">embroider_input.py</command> + </script> +</inkscape-extension> diff --git a/inx/embroider_input_EXY.inx b/inx/embroider_input_EXY.inx new file mode 100644 index 00000000..a2e792c4 --- /dev/null +++ b/inx/embroider_input_EXY.inx @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> + <_name>EXY file input</_name> + <id>org.inkstitch.input.exy</id> + <dependency type="executable" location="extensions">embroider_input.py</dependency> + <dependency type="executable" location="extensions">inkex.py</dependency> + <input> + <extension>.exy</extension> + <mimetype>application/x-embroidery-exy</mimetype> + <_filetypename>Ink/Stitch: Eltac Embroidery Format (.exy)</_filetypename> + <_filetypetooltip>convert EXY file to Ink/Stitch manual-stitch paths</_filetypetooltip> + </input> + <script> + <command reldir="extensions" interpreter="python">embroider_input.py</command> + </script> +</inkscape-extension> diff --git a/inx/embroider_input_FXY.inx b/inx/embroider_input_FXY.inx new file mode 100644 index 00000000..4d77022e --- /dev/null +++ b/inx/embroider_input_FXY.inx @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> + <_name>FXY file input</_name> + <id>org.inkstitch.input.fxy</id> + <dependency type="executable" location="extensions">embroider_input.py</dependency> + <dependency type="executable" location="extensions">inkex.py</dependency> + <input> + <extension>.fxy</extension> + <mimetype>application/x-embroidery-fxy</mimetype> + <_filetypename>Ink/Stitch: Fortron Embroidery Format (.fxy)</_filetypename> + <_filetypetooltip>convert FXY file to Ink/Stitch manual-stitch paths</_filetypetooltip> + </input> + <script> + <command reldir="extensions" interpreter="python">embroider_input.py</command> + </script> +</inkscape-extension> diff --git a/inx/embroider_input_GT.inx b/inx/embroider_input_GT.inx new file mode 100644 index 00000000..3b482244 --- /dev/null +++ b/inx/embroider_input_GT.inx @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> + <_name>GT file input</_name> + <id>org.inkstitch.input.gt</id> + <dependency type="executable" location="extensions">embroider_input.py</dependency> + <dependency type="executable" location="extensions">inkex.py</dependency> + <input> + <extension>.gt</extension> + <mimetype>application/x-embroidery-gt</mimetype> + <_filetypename>Ink/Stitch: Gold Thread Embroidery Format (.gt)</_filetypename> + <_filetypetooltip>convert GT file to Ink/Stitch manual-stitch paths</_filetypetooltip> + </input> + <script> + <command reldir="extensions" interpreter="python">embroider_input.py</command> + </script> +</inkscape-extension> diff --git a/inx/embroider_input_HUS.inx b/inx/embroider_input_HUS.inx new file mode 100644 index 00000000..3b19ee87 --- /dev/null +++ b/inx/embroider_input_HUS.inx @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> + <_name>HUS file input</_name> + <id>org.inkstitch.input.hus</id> + <dependency type="executable" location="extensions">embroider_input.py</dependency> + <dependency type="executable" location="extensions">inkex.py</dependency> + <input> + <extension>.hus</extension> + <mimetype>application/x-embroidery-hus</mimetype> + <_filetypename>Ink/Stitch: Husqvarna Viking Embroidery Format (.hus)</_filetypename> + <_filetypetooltip>convert HUS file to Ink/Stitch manual-stitch paths</_filetypetooltip> + </input> + <script> + <command reldir="extensions" interpreter="python">embroider_input.py</command> + </script> +</inkscape-extension> diff --git a/inx/embroider_input_INB.inx b/inx/embroider_input_INB.inx new file mode 100644 index 00000000..24c6535d --- /dev/null +++ b/inx/embroider_input_INB.inx @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> + <_name>INB file input</_name> + <id>org.inkstitch.input.inb</id> + <dependency type="executable" location="extensions">embroider_input.py</dependency> + <dependency type="executable" location="extensions">inkex.py</dependency> + <input> + <extension>.inb</extension> + <mimetype>application/x-embroidery-inb</mimetype> + <_filetypename>Ink/Stitch: Inbro Embroidery Format (.inb)</_filetypename> + <_filetypetooltip>convert INB file to Ink/Stitch manual-stitch paths</_filetypetooltip> + </input> + <script> + <command reldir="extensions" interpreter="python">embroider_input.py</command> + </script> +</inkscape-extension> diff --git a/inx/embroider_input_INF.inx b/inx/embroider_input_INF.inx new file mode 100644 index 00000000..db7e5d57 --- /dev/null +++ b/inx/embroider_input_INF.inx @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> + <_name>INF file input</_name> + <id>org.inkstitch.input.inf</id> + <dependency type="executable" location="extensions">embroider_input.py</dependency> + <dependency type="executable" location="extensions">inkex.py</dependency> + <input> + <extension>.inf</extension> + <mimetype>application/x-embroidery-inf</mimetype> + <_filetypename>Ink/Stitch: Embroidery Color Format (.inf)</_filetypename> + <_filetypetooltip>convert INF file to Ink/Stitch manual-stitch paths</_filetypetooltip> + </input> + <script> + <command reldir="extensions" interpreter="python">embroider_input.py</command> + </script> +</inkscape-extension> diff --git a/inx/embroider_input_JEF.inx b/inx/embroider_input_JEF.inx new file mode 100644 index 00000000..c2030622 --- /dev/null +++ b/inx/embroider_input_JEF.inx @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> + <_name>JEF file input</_name> + <id>org.inkstitch.input.jef</id> + <dependency type="executable" location="extensions">embroider_input.py</dependency> + <dependency type="executable" location="extensions">inkex.py</dependency> + <input> + <extension>.jef</extension> + <mimetype>application/x-embroidery-jef</mimetype> + <_filetypename>Ink/Stitch: Janome Embroidery Format (.jef)</_filetypename> + <_filetypetooltip>convert JEF file to Ink/Stitch manual-stitch paths</_filetypetooltip> + </input> + <script> + <command reldir="extensions" interpreter="python">embroider_input.py</command> + </script> +</inkscape-extension> diff --git a/inx/embroider_input_KSM.inx b/inx/embroider_input_KSM.inx new file mode 100644 index 00000000..2869ea07 --- /dev/null +++ b/inx/embroider_input_KSM.inx @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> + <_name>KSM file input</_name> + <id>org.inkstitch.input.ksm</id> + <dependency type="executable" location="extensions">embroider_input.py</dependency> + <dependency type="executable" location="extensions">inkex.py</dependency> + <input> + <extension>.ksm</extension> + <mimetype>application/x-embroidery-ksm</mimetype> + <_filetypename>Ink/Stitch: Pfaff Embroidery Format (.ksm)</_filetypename> + <_filetypetooltip>convert KSM file to Ink/Stitch manual-stitch paths</_filetypetooltip> + </input> + <script> + <command reldir="extensions" interpreter="python">embroider_input.py</command> + </script> +</inkscape-extension> diff --git a/inx/embroider_input_MAX.inx b/inx/embroider_input_MAX.inx new file mode 100644 index 00000000..2dbbe2cc --- /dev/null +++ b/inx/embroider_input_MAX.inx @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> + <_name>MAX file input</_name> + <id>org.inkstitch.input.max</id> + <dependency type="executable" location="extensions">embroider_input.py</dependency> + <dependency type="executable" location="extensions">inkex.py</dependency> + <input> + <extension>.max</extension> + <mimetype>application/x-embroidery-max</mimetype> + <_filetypename>Ink/Stitch: Pfaff Embroidery Format (.max)</_filetypename> + <_filetypetooltip>convert MAX file to Ink/Stitch manual-stitch paths</_filetypetooltip> + </input> + <script> + <command reldir="extensions" interpreter="python">embroider_input.py</command> + </script> +</inkscape-extension> diff --git a/inx/embroider_input_MIT.inx b/inx/embroider_input_MIT.inx new file mode 100644 index 00000000..10f5dfd3 --- /dev/null +++ b/inx/embroider_input_MIT.inx @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> + <_name>MIT file input</_name> + <id>org.inkstitch.input.mit</id> + <dependency type="executable" location="extensions">embroider_input.py</dependency> + <dependency type="executable" location="extensions">inkex.py</dependency> + <input> + <extension>.mit</extension> + <mimetype>application/x-embroidery-mit</mimetype> + <_filetypename>Ink/Stitch: Mitsubishi Embroidery Format (.mit)</_filetypename> + <_filetypetooltip>convert MIT file to Ink/Stitch manual-stitch paths</_filetypetooltip> + </input> + <script> + <command reldir="extensions" interpreter="python">embroider_input.py</command> + </script> +</inkscape-extension> diff --git a/inx/embroider_input_NEW.inx b/inx/embroider_input_NEW.inx new file mode 100644 index 00000000..f13a7009 --- /dev/null +++ b/inx/embroider_input_NEW.inx @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> + <_name>NEW file input</_name> + <id>org.inkstitch.input.new</id> + <dependency type="executable" location="extensions">embroider_input.py</dependency> + <dependency type="executable" location="extensions">inkex.py</dependency> + <input> + <extension>.new</extension> + <mimetype>application/x-embroidery-new</mimetype> + <_filetypename>Ink/Stitch: Ameco Embroidery Format (.new)</_filetypename> + <_filetypetooltip>convert NEW file to Ink/Stitch manual-stitch paths</_filetypetooltip> + </input> + <script> + <command reldir="extensions" interpreter="python">embroider_input.py</command> + </script> +</inkscape-extension> diff --git a/inx/embroider_input_OFM.inx b/inx/embroider_input_OFM.inx new file mode 100644 index 00000000..9086900d --- /dev/null +++ b/inx/embroider_input_OFM.inx @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> + <_name>OFM file input</_name> + <id>org.inkstitch.input.ofm</id> + <dependency type="executable" location="extensions">embroider_input.py</dependency> + <dependency type="executable" location="extensions">inkex.py</dependency> + <input> + <extension>.ofm</extension> + <mimetype>application/x-embroidery-ofm</mimetype> + <_filetypename>Ink/Stitch: Melco Embroidery Format (.ofm)</_filetypename> + <_filetypetooltip>convert OFM file to Ink/Stitch manual-stitch paths</_filetypetooltip> + </input> + <script> + <command reldir="extensions" interpreter="python">embroider_input.py</command> + </script> +</inkscape-extension> diff --git a/inx/embroider_input_PCD.inx b/inx/embroider_input_PCD.inx new file mode 100644 index 00000000..fc9c7362 --- /dev/null +++ b/inx/embroider_input_PCD.inx @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> + <_name>PCD file input</_name> + <id>org.inkstitch.input.pcd</id> + <dependency type="executable" location="extensions">embroider_input.py</dependency> + <dependency type="executable" location="extensions">inkex.py</dependency> + <input> + <extension>.pcd</extension> + <mimetype>application/x-embroidery-pcd</mimetype> + <_filetypename>Ink/Stitch: Pfaff Embroidery Format (.pcd)</_filetypename> + <_filetypetooltip>convert PCD file to Ink/Stitch manual-stitch paths</_filetypetooltip> + </input> + <script> + <command reldir="extensions" interpreter="python">embroider_input.py</command> + </script> +</inkscape-extension> diff --git a/inx/embroider_input_PCM.inx b/inx/embroider_input_PCM.inx new file mode 100644 index 00000000..fe6c3e22 --- /dev/null +++ b/inx/embroider_input_PCM.inx @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> + <_name>PCM file input</_name> + <id>org.inkstitch.input.pcm</id> + <dependency type="executable" location="extensions">embroider_input.py</dependency> + <dependency type="executable" location="extensions">inkex.py</dependency> + <input> + <extension>.pcm</extension> + <mimetype>application/x-embroidery-pcm</mimetype> + <_filetypename>Ink/Stitch: Pfaff Embroidery Format (.pcm)</_filetypename> + <_filetypetooltip>convert PCM file to Ink/Stitch manual-stitch paths</_filetypetooltip> + </input> + <script> + <command reldir="extensions" interpreter="python">embroider_input.py</command> + </script> +</inkscape-extension> diff --git a/inx/embroider_input_PCQ.inx b/inx/embroider_input_PCQ.inx new file mode 100644 index 00000000..932a9568 --- /dev/null +++ b/inx/embroider_input_PCQ.inx @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> + <_name>PCQ file input</_name> + <id>org.inkstitch.input.pcq</id> + <dependency type="executable" location="extensions">embroider_input.py</dependency> + <dependency type="executable" location="extensions">inkex.py</dependency> + <input> + <extension>.pcq</extension> + <mimetype>application/x-embroidery-pcq</mimetype> + <_filetypename>Ink/Stitch: Pfaff Embroidery Format (.pcq)</_filetypename> + <_filetypetooltip>convert PCQ file to Ink/Stitch manual-stitch paths</_filetypetooltip> + </input> + <script> + <command reldir="extensions" interpreter="python">embroider_input.py</command> + </script> +</inkscape-extension> diff --git a/inx/embroider_input_PCS.inx b/inx/embroider_input_PCS.inx new file mode 100644 index 00000000..d9d058c0 --- /dev/null +++ b/inx/embroider_input_PCS.inx @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> + <_name>PCS file input</_name> + <id>org.inkstitch.input.pcs</id> + <dependency type="executable" location="extensions">embroider_input.py</dependency> + <dependency type="executable" location="extensions">inkex.py</dependency> + <input> + <extension>.pcs</extension> + <mimetype>application/x-embroidery-pcs</mimetype> + <_filetypename>Ink/Stitch: Pfaff Embroidery Format (.pcs)</_filetypename> + <_filetypetooltip>convert PCS file to Ink/Stitch manual-stitch paths</_filetypetooltip> + </input> + <script> + <command reldir="extensions" interpreter="python">embroider_input.py</command> + </script> +</inkscape-extension> diff --git a/inx/embroider_input_PEC.inx b/inx/embroider_input_PEC.inx new file mode 100644 index 00000000..382dedff --- /dev/null +++ b/inx/embroider_input_PEC.inx @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> + <_name>PEC file input</_name> + <id>org.inkstitch.input.pec</id> + <dependency type="executable" location="extensions">embroider_input.py</dependency> + <dependency type="executable" location="extensions">inkex.py</dependency> + <input> + <extension>.pec</extension> + <mimetype>application/x-embroidery-pec</mimetype> + <_filetypename>Ink/Stitch: Brother Embroidery Format (.pec)</_filetypename> + <_filetypetooltip>convert PEC file to Ink/Stitch manual-stitch paths</_filetypetooltip> + </input> + <script> + <command reldir="extensions" interpreter="python">embroider_input.py</command> + </script> +</inkscape-extension> diff --git a/inx/embroider_input_PES.inx b/inx/embroider_input_PES.inx new file mode 100644 index 00000000..451a4da6 --- /dev/null +++ b/inx/embroider_input_PES.inx @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> + <_name>PES file input</_name> + <id>org.inkstitch.input.pes</id> + <dependency type="executable" location="extensions">embroider_input.py</dependency> + <dependency type="executable" location="extensions">inkex.py</dependency> + <input> + <extension>.pes</extension> + <mimetype>application/x-embroidery-pes</mimetype> + <_filetypename>Ink/Stitch: Brother Embroidery Format (.pes)</_filetypename> + <_filetypetooltip>convert PES file to Ink/Stitch manual-stitch paths</_filetypetooltip> + </input> + <script> + <command reldir="extensions" interpreter="python">embroider_input.py</command> + </script> +</inkscape-extension> diff --git a/inx/embroider_input_PHB.inx b/inx/embroider_input_PHB.inx new file mode 100644 index 00000000..ab4daf67 --- /dev/null +++ b/inx/embroider_input_PHB.inx @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> + <_name>PHB file input</_name> + <id>org.inkstitch.input.phb</id> + <dependency type="executable" location="extensions">embroider_input.py</dependency> + <dependency type="executable" location="extensions">inkex.py</dependency> + <input> + <extension>.phb</extension> + <mimetype>application/x-embroidery-phb</mimetype> + <_filetypename>Ink/Stitch: Brother Embroidery Format (.phb)</_filetypename> + <_filetypetooltip>convert PHB file to Ink/Stitch manual-stitch paths</_filetypetooltip> + </input> + <script> + <command reldir="extensions" interpreter="python">embroider_input.py</command> + </script> +</inkscape-extension> diff --git a/inx/embroider_input_PHC.inx b/inx/embroider_input_PHC.inx new file mode 100644 index 00000000..e36739af --- /dev/null +++ b/inx/embroider_input_PHC.inx @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> + <_name>PHC file input</_name> + <id>org.inkstitch.input.phc</id> + <dependency type="executable" location="extensions">embroider_input.py</dependency> + <dependency type="executable" location="extensions">inkex.py</dependency> + <input> + <extension>.phc</extension> + <mimetype>application/x-embroidery-phc</mimetype> + <_filetypename>Ink/Stitch: Brother Embroidery Format (.phc)</_filetypename> + <_filetypetooltip>convert PHC file to Ink/Stitch manual-stitch paths</_filetypetooltip> + </input> + <script> + <command reldir="extensions" interpreter="python">embroider_input.py</command> + </script> +</inkscape-extension> diff --git a/inx/embroider_input_PLT.inx b/inx/embroider_input_PLT.inx new file mode 100644 index 00000000..ec2374da --- /dev/null +++ b/inx/embroider_input_PLT.inx @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> + <_name>PLT file input</_name> + <id>org.inkstitch.input.plt</id> + <dependency type="executable" location="extensions">embroider_input.py</dependency> + <dependency type="executable" location="extensions">inkex.py</dependency> + <input> + <extension>.plt</extension> + <mimetype>application/x-embroidery-plt</mimetype> + <_filetypename>Ink/Stitch: AutoCAD Plot Drawing Format (.plt)</_filetypename> + <_filetypetooltip>convert PLT file to Ink/Stitch manual-stitch paths</_filetypetooltip> + </input> + <script> + <command reldir="extensions" interpreter="python">embroider_input.py</command> + </script> +</inkscape-extension> diff --git a/inx/embroider_input_RGB.inx b/inx/embroider_input_RGB.inx new file mode 100644 index 00000000..a73955c1 --- /dev/null +++ b/inx/embroider_input_RGB.inx @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> + <_name>RGB file input</_name> + <id>org.inkstitch.input.rgb</id> + <dependency type="executable" location="extensions">embroider_input.py</dependency> + <dependency type="executable" location="extensions">inkex.py</dependency> + <input> + <extension>.rgb</extension> + <mimetype>application/x-embroidery-rgb</mimetype> + <_filetypename>Ink/Stitch: RGB Embroidery Format (.rgb)</_filetypename> + <_filetypetooltip>convert RGB file to Ink/Stitch manual-stitch paths</_filetypetooltip> + </input> + <script> + <command reldir="extensions" interpreter="python">embroider_input.py</command> + </script> +</inkscape-extension> diff --git a/inx/embroider_input_SEW.inx b/inx/embroider_input_SEW.inx new file mode 100644 index 00000000..8cb41136 --- /dev/null +++ b/inx/embroider_input_SEW.inx @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> + <_name>SEW file input</_name> + <id>org.inkstitch.input.sew</id> + <dependency type="executable" location="extensions">embroider_input.py</dependency> + <dependency type="executable" location="extensions">inkex.py</dependency> + <input> + <extension>.sew</extension> + <mimetype>application/x-embroidery-sew</mimetype> + <_filetypename>Ink/Stitch: Janome Embroidery Format (.sew)</_filetypename> + <_filetypetooltip>convert SEW file to Ink/Stitch manual-stitch paths</_filetypetooltip> + </input> + <script> + <command reldir="extensions" interpreter="python">embroider_input.py</command> + </script> +</inkscape-extension> diff --git a/inx/embroider_input_SHV.inx b/inx/embroider_input_SHV.inx new file mode 100644 index 00000000..20735cc8 --- /dev/null +++ b/inx/embroider_input_SHV.inx @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> + <_name>SHV file input</_name> + <id>org.inkstitch.input.shv</id> + <dependency type="executable" location="extensions">embroider_input.py</dependency> + <dependency type="executable" location="extensions">inkex.py</dependency> + <input> + <extension>.shv</extension> + <mimetype>application/x-embroidery-shv</mimetype> + <_filetypename>Ink/Stitch: Husqvarna Viking Embroidery Format (.shv)</_filetypename> + <_filetypetooltip>convert SHV file to Ink/Stitch manual-stitch paths</_filetypetooltip> + </input> + <script> + <command reldir="extensions" interpreter="python">embroider_input.py</command> + </script> +</inkscape-extension> diff --git a/inx/embroider_input_SST.inx b/inx/embroider_input_SST.inx new file mode 100644 index 00000000..61f7c782 --- /dev/null +++ b/inx/embroider_input_SST.inx @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> + <_name>SST file input</_name> + <id>org.inkstitch.input.sst</id> + <dependency type="executable" location="extensions">embroider_input.py</dependency> + <dependency type="executable" location="extensions">inkex.py</dependency> + <input> + <extension>.sst</extension> + <mimetype>application/x-embroidery-sst</mimetype> + <_filetypename>Ink/Stitch: Sunstar Embroidery Format (.sst)</_filetypename> + <_filetypetooltip>convert SST file to Ink/Stitch manual-stitch paths</_filetypetooltip> + </input> + <script> + <command reldir="extensions" interpreter="python">embroider_input.py</command> + </script> +</inkscape-extension> diff --git a/inx/embroider_input_STX.inx b/inx/embroider_input_STX.inx new file mode 100644 index 00000000..5043d6f2 --- /dev/null +++ b/inx/embroider_input_STX.inx @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> + <_name>STX file input</_name> + <id>org.inkstitch.input.stx</id> + <dependency type="executable" location="extensions">embroider_input.py</dependency> + <dependency type="executable" location="extensions">inkex.py</dependency> + <input> + <extension>.stx</extension> + <mimetype>application/x-embroidery-stx</mimetype> + <_filetypename>Ink/Stitch: Data Stitch Embroidery Format (.stx)</_filetypename> + <_filetypetooltip>convert STX file to Ink/Stitch manual-stitch paths</_filetypetooltip> + </input> + <script> + <command reldir="extensions" interpreter="python">embroider_input.py</command> + </script> +</inkscape-extension> diff --git a/inx/embroider_input_T01.inx b/inx/embroider_input_T01.inx new file mode 100644 index 00000000..5090310e --- /dev/null +++ b/inx/embroider_input_T01.inx @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> + <_name>T01 file input</_name> + <id>org.inkstitch.input.t01</id> + <dependency type="executable" location="extensions">embroider_input.py</dependency> + <dependency type="executable" location="extensions">inkex.py</dependency> + <input> + <extension>.t01</extension> + <mimetype>application/x-embroidery-t01</mimetype> + <_filetypename>Ink/Stitch: Pfaff Embroidery Format (.t01)</_filetypename> + <_filetypetooltip>convert T01 file to Ink/Stitch manual-stitch paths</_filetypetooltip> + </input> + <script> + <command reldir="extensions" interpreter="python">embroider_input.py</command> + </script> +</inkscape-extension> diff --git a/inx/embroider_input_T09.inx b/inx/embroider_input_T09.inx new file mode 100644 index 00000000..5c64541d --- /dev/null +++ b/inx/embroider_input_T09.inx @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> + <_name>T09 file input</_name> + <id>org.inkstitch.input.t09</id> + <dependency type="executable" location="extensions">embroider_input.py</dependency> + <dependency type="executable" location="extensions">inkex.py</dependency> + <input> + <extension>.t09</extension> + <mimetype>application/x-embroidery-t09</mimetype> + <_filetypename>Ink/Stitch: Pfaff Embroidery Format (.t09)</_filetypename> + <_filetypetooltip>convert T09 file to Ink/Stitch manual-stitch paths</_filetypetooltip> + </input> + <script> + <command reldir="extensions" interpreter="python">embroider_input.py</command> + </script> +</inkscape-extension> diff --git a/inx/embroider_input_TAP.inx b/inx/embroider_input_TAP.inx new file mode 100644 index 00000000..496105e2 --- /dev/null +++ b/inx/embroider_input_TAP.inx @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> + <_name>TAP file input</_name> + <id>org.inkstitch.input.tap</id> + <dependency type="executable" location="extensions">embroider_input.py</dependency> + <dependency type="executable" location="extensions">inkex.py</dependency> + <input> + <extension>.tap</extension> + <mimetype>application/x-embroidery-tap</mimetype> + <_filetypename>Ink/Stitch: Happy Embroidery Format (.tap)</_filetypename> + <_filetypetooltip>convert TAP file to Ink/Stitch manual-stitch paths</_filetypetooltip> + </input> + <script> + <command reldir="extensions" interpreter="python">embroider_input.py</command> + </script> +</inkscape-extension> diff --git a/inx/embroider_input_THR.inx b/inx/embroider_input_THR.inx new file mode 100644 index 00000000..d01d6184 --- /dev/null +++ b/inx/embroider_input_THR.inx @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> + <_name>THR file input</_name> + <id>org.inkstitch.input.thr</id> + <dependency type="executable" location="extensions">embroider_input.py</dependency> + <dependency type="executable" location="extensions">inkex.py</dependency> + <input> + <extension>.thr</extension> + <mimetype>application/x-embroidery-thr</mimetype> + <_filetypename>Ink/Stitch: ThredWorks Embroidery Format (.thr)</_filetypename> + <_filetypetooltip>convert THR file to Ink/Stitch manual-stitch paths</_filetypetooltip> + </input> + <script> + <command reldir="extensions" interpreter="python">embroider_input.py</command> + </script> +</inkscape-extension> diff --git a/inx/embroider_input_U00.inx b/inx/embroider_input_U00.inx new file mode 100644 index 00000000..a98ddaa1 --- /dev/null +++ b/inx/embroider_input_U00.inx @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> + <_name>U00 file input</_name> + <id>org.inkstitch.input.u00</id> + <dependency type="executable" location="extensions">embroider_input.py</dependency> + <dependency type="executable" location="extensions">inkex.py</dependency> + <input> + <extension>.u00</extension> + <mimetype>application/x-embroidery-u00</mimetype> + <_filetypename>Ink/Stitch: Barudan Embroidery Format (.u00)</_filetypename> + <_filetypetooltip>convert U00 file to Ink/Stitch manual-stitch paths</_filetypetooltip> + </input> + <script> + <command reldir="extensions" interpreter="python">embroider_input.py</command> + </script> +</inkscape-extension> diff --git a/inx/embroider_input_VIP.inx b/inx/embroider_input_VIP.inx new file mode 100644 index 00000000..f607bfd7 --- /dev/null +++ b/inx/embroider_input_VIP.inx @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> + <_name>VIP file input</_name> + <id>org.inkstitch.input.vip</id> + <dependency type="executable" location="extensions">embroider_input.py</dependency> + <dependency type="executable" location="extensions">inkex.py</dependency> + <input> + <extension>.vip</extension> + <mimetype>application/x-embroidery-vip</mimetype> + <_filetypename>Ink/Stitch: Pfaff Embroidery Format (.vip)</_filetypename> + <_filetypetooltip>convert VIP file to Ink/Stitch manual-stitch paths</_filetypetooltip> + </input> + <script> + <command reldir="extensions" interpreter="python">embroider_input.py</command> + </script> +</inkscape-extension> diff --git a/inx/embroider_input_VP3.inx b/inx/embroider_input_VP3.inx new file mode 100644 index 00000000..cb24f60a --- /dev/null +++ b/inx/embroider_input_VP3.inx @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> + <_name>VP3 file input</_name> + <id>org.inkstitch.input.vp3</id> + <dependency type="executable" location="extensions">embroider_input.py</dependency> + <dependency type="executable" location="extensions">inkex.py</dependency> + <input> + <extension>.vp3</extension> + <mimetype>application/x-embroidery-vp3</mimetype> + <_filetypename>Ink/Stitch: Pfaff Embroidery Format (.vp3)</_filetypename> + <_filetypetooltip>convert VP3 file to Ink/Stitch manual-stitch paths</_filetypetooltip> + </input> + <script> + <command reldir="extensions" interpreter="python">embroider_input.py</command> + </script> +</inkscape-extension> diff --git a/inx/embroider_input_XXX.inx b/inx/embroider_input_XXX.inx new file mode 100644 index 00000000..64093628 --- /dev/null +++ b/inx/embroider_input_XXX.inx @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> + <_name>XXX file input</_name> + <id>org.inkstitch.input.xxx</id> + <dependency type="executable" location="extensions">embroider_input.py</dependency> + <dependency type="executable" location="extensions">inkex.py</dependency> + <input> + <extension>.xxx</extension> + <mimetype>application/x-embroidery-xxx</mimetype> + <_filetypename>Ink/Stitch: Singer Embroidery Format (.xxx)</_filetypename> + <_filetypetooltip>convert XXX file to Ink/Stitch manual-stitch paths</_filetypetooltip> + </input> + <script> + <command reldir="extensions" interpreter="python">embroider_input.py</command> + </script> +</inkscape-extension> diff --git a/inx/embroider_input_ZSK.inx b/inx/embroider_input_ZSK.inx new file mode 100644 index 00000000..badb36da --- /dev/null +++ b/inx/embroider_input_ZSK.inx @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> + <_name>ZSK file input</_name> + <id>org.inkstitch.input.zsk</id> + <dependency type="executable" location="extensions">embroider_input.py</dependency> + <dependency type="executable" location="extensions">inkex.py</dependency> + <input> + <extension>.zsk</extension> + <mimetype>application/x-embroidery-zsk</mimetype> + <_filetypename>Ink/Stitch: ZSK USA Embroidery Format (.zsk)</_filetypename> + <_filetypetooltip>convert ZSK file to Ink/Stitch manual-stitch paths</_filetypetooltip> + </input> + <script> + <command reldir="extensions" interpreter="python">embroider_input.py</command> + </script> +</inkscape-extension> diff --git a/embroider_params.inx b/inx/embroider_params.inx index f3987502..f3987502 100644 --- a/embroider_params.inx +++ b/inx/embroider_params.inx diff --git a/embroider_print.inx b/inx/embroider_print.inx index cbba82cc..cbba82cc 100644 --- a/embroider_print.inx +++ b/inx/embroider_print.inx diff --git a/embroider_simulate.inx b/inx/embroider_simulate.inx index 9c38ec97..9c38ec97 100644 --- a/embroider_simulate.inx +++ b/inx/embroider_simulate.inx diff --git a/messages.po b/messages.po index 92630bb0..92b6aa61 100644 --- a/messages.po +++ b/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2018-03-30 20:26-0400\n" +"POT-Creation-Date: 2018-04-16 21:03-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -272,6 +272,14 @@ msgstr "" msgid "Repeats" msgstr "" +msgid "Manual stitch placement" +msgstr "" + +msgid "" +"Stitch every node in the path. Stitch length and zig-zag spacing are " +"ignored." +msgstr "" + msgid "" "Unable to autofill. This most often happens because your shape is made " "up of multiple sections that aren't connected." @@ -355,9 +363,18 @@ msgstr "" msgid "Job estimated time" msgstr "" +msgid "Ctrl + Scroll to Zoom" +msgstr "" + msgid "Scale" msgstr "" +msgid "Fit" +msgstr "" + +msgid "Apply to all" +msgstr "" + msgid "COLOR" msgstr "" @@ -385,3 +402,12 @@ msgstr "" msgid "Printing Size" msgstr "" +msgid "Print Layouts" +msgstr "" + +msgid "Includes all settings visible here and also the icon." +msgstr "" + +msgid "Save as defaults" +msgstr "" + diff --git a/print/resources/inkstitch.js b/print/resources/inkstitch.js index c6e88e52..253e9243 100644 --- a/print/resources/inkstitch.js +++ b/print/resources/inkstitch.js @@ -1,3 +1,12 @@ +$.postJSON = function(url, data, success=null) { + return $.ajax(url, { + type: 'POST', + data: JSON.stringify(data), + contentType: 'application/json', + success: success + }); +}; + function ping() { $.get("/ping") .done(function() { setTimeout(ping, 1000) }) @@ -130,45 +139,62 @@ $(function() { }) }); - + /* Contendeditable Fields */ - - document.querySelectorAll('[contenteditable="true"]').forEach(function(elem) { - elem.addEventListener('focusout', function() { + + $('[contenteditable="true"]').on('focusout', function() { /* change svg scale */ - var content = $(this).html(); - var field_name = $(this).attr('data-field-name'); - if(field_name == 'svg-scale') { - var scale = parseInt(content); - var svg = $(this).parent().siblings('svg'); - var transform = svg.css('transform').match(/-?[\d\.]+/g); - - transform[0] = scale / 100; - transform[3] = scale / 100; - svg.css({ transform: 'matrix(' + transform + ')' }); - } - /* When we focus out from a contenteditable field, we want to - set the same content to all fields with the same classname */ - else { - $('[data-field-name="' + field_name + '"]').html(content); - } - }); + var content = $(this).html(); + var field_name = $(this).attr('data-field-name'); + if(field_name == 'svg-scale') { + var scale = parseInt(content); + var svg = $(this).parent().siblings('svg'); + var transform = svg.css('transform').match(/-?[\d\.]+/g); + + transform[0] = scale / 100; + transform[3] = scale / 100; + svg.css({ transform: 'matrix(' + transform + ')' }); + } else { + /* When we focus out from a contenteditable field, we want to + * set the same content to all fields with the same classname */ + $('[data-field-name="' + field_name + '"]').html(content); + $.postJSON('/settings/' + field_name, {value: content}); + } }); - + + // load up initial metadata values + $.getJSON('/settings', function(settings) { + $.each(settings, function(field_name, value) { + $('[data-field-name="' + field_name + '"]').each(function(i, item) { + var item = $(item); + if (item.is(':checkbox')) { + item.prop('checked', value).trigger('change'); + } else if (item.is('img')) { + item.attr('src', value); + } else if (item.is('select')) { + item.val(value).trigger('change'); + } else { + item.text(value); + } + }); + }); + }); + $('[contenteditable="true"]').keypress(function(e) { if (e.which == 13) { // pressing enter defocuses the element this.blur(); + // also suppress the enter keystroke to avoid adding a new line return false; } else { return true; } }); - - + + /* Settings Bar */ - + $('button.close').click(function() { $.post('/shutdown', {}) .done(function(data) { @@ -193,20 +219,55 @@ $(function() { $('#close-settings').click(function(){ $('#settings-ui').hide(); }); - + /* Settings */ - + // Paper Size $('select#printing-size').change(function(){ - $('.page').toggleClass('a4'); + var size = $(this).find(':selected').val(); + $('.page').toggleClass('a4', size == 'a4'); + $.postJSON('/settings/paper-size', {value: size}); }); - + //Checkbox $(':checkbox').change(function() { - $('.' + this.id).toggle(); + var checked = $(this).prop('checked'); + var field_name = $(this).attr('data-field-name'); + + $('.' + field_name).toggle(checked); setPageNumbers(); scaleAllSvg(); + + $.postJSON('/settings/' + field_name, {value: checked}); + }); + + // Logo + $('#logo-picker').change(function(e) { + var file = e.originalEvent.srcElement.files[0]; + var reader = new FileReader(); + reader.onloadend = function() { + var data = reader.result; + $('figure.brandlogo img').attr('src', data); + $.postJSON('/settings/logo', {value: data}); + }; + reader.readAsDataURL(file); + }); + + // "save as defaults" button + $('#save-settings').click(function(e) { + var settings = {}; + settings["client-overview"] = $("[data-field-name='client-overview']").is(':checked'); + settings["client-detailedview"] = $("[data-field-name='client-detailedview']").is(':checked'); + settings["operator-overview"] = $("[data-field-name='operator-overview']").is(':checked'); + settings["operator-detailedview"] = $("[data-field-name='operator-detailedview']").is(':checked'); + settings["paper-size"] = $('select#printing-size').find(':selected').val(); + + var logo = $("figure.brandlogo img").attr('src'); + if (logo.startsWith("data:")) { + settings["logo"] = logo; + } + + $.postJSON('/defaults', {'value': settings}); }); - }); diff --git a/print/resources/style.css b/print/resources/style.css index 333af7aa..013f567c 100644 --- a/print/resources/style.css +++ b/print/resources/style.css @@ -230,6 +230,10 @@ body { cursor: pointer; } + #settings-ui fieldset { + margin-bottom: 1em; + } + /* Header */ @@ -251,11 +255,30 @@ body { margin: 2.5mm; } + figure.brandlogo label { + display: block; + width: 100%; + height: 100%; + line-height: 30mm; + text-align: center; + } + figure.brandlogo img { max-width: 30mm; max-height: 30mm; + display: inline; + vertical-align: middle; } - + + /* hide the actual file picker control, since we just want them to click the + * image instead + */ + #logo-picker { + width: 0px; + height: 0px; + opacity: 0%; + } + .operator-detailedview figure.brandlogo { height: 20mm; width: 30mm; diff --git a/print/templates/headline.html b/print/templates/headline.html index 649c02ea..421202e4 100644 --- a/print/templates/headline.html +++ b/print/templates/headline.html @@ -1,11 +1,14 @@ <figure class="brandlogo"> - <img src="{{ logo.src or "resources/inkstitch-logo.svg" }}" alt="{{ logo.title }}" title="{{ logo.title }}"> + <label for="logo-picker"> + <img src="{{ logo.src or "resources/inkstitch-logo.svg" }}" alt="{{ logo.title }}" title="{{ logo.title }}" data-field-name="logo"> + <input type=file id="logo-picker" /> + </label> </figure> <div class="headline"> <div class="pageTitle"> - <h1><span class="jobtitle" contenteditable="true" data-placeholder="{{ _('Enter job title...') }}" data-field-name="job-title">{{ job.title }}</span></h1> - <p class="header-field" data-label="{{ _('CLIENT') }}:" contenteditable="true" data-placeholder="{{ _('Enter client name...') }}" data-field-name="client-name">{{ client }}</p> - <p class="header-field" data-label="{{ _('PURCHASE ORDER #:') }}" contenteditable="true" data-placeholder="{{ _('Enter purchase order number...') }}" data-field-name="purchase-order">{{ purchase_order }}</p> + <h1><span class="jobtitle" contenteditable="true" data-placeholder="{{ _('Enter job title...') }}" data-field-name="title"></span></h1> + <p class="header-field" data-label="{{ _('CLIENT') }}:" contenteditable="true" data-placeholder="{{ _('Enter client name...') }}" data-field-name="client-name"></p> + <p class="header-field" data-label="{{ _('PURCHASE ORDER #:') }}" contenteditable="true" data-placeholder="{{ _('Enter purchase order number...') }}" data-field-name="purchase-order"></p> </div> <div class="currentDate">{{ date|datetimeformat(_('%Y.%m.%d')) }}</div> diff --git a/print/templates/ui.html b/print/templates/ui.html index 078f1a4c..f7246962 100644 --- a/print/templates/ui.html +++ b/print/templates/ui.html @@ -15,7 +15,7 @@ <h1>{{ _('Settings') }}</h1> <div> <p>{{ _('Printing Size') }}: - <select id="printing-size"> + <select id="printing-size" data-field-name="paper-size"> <option value="letter" selected="selected">Letter</option> <option value="a4">A4</option> </select> @@ -23,11 +23,12 @@ </div> <div> <fieldset> - <legend>{{ ('Print Layouts') }}:</legend> - <p><input type="checkbox" id="client-overview" {{ 'checked' if view.client_overview else '' }}><label for="client-overview">Client Overview</label></p> - <p><input type="checkbox" id="client-detailedview" {{ 'checked' if view.client_detailedview else '' }}><label for="client-detailedview">Client Detailed View</label></p> - <p><input type="checkbox" id="operator-overview" {{ 'checked' if view.operator_overview else '' }}><label for="operator-overview">Operator Overview</label></p> - <p><input type="checkbox" id="operator-detailedview" {{ 'checked' if view.operator_detailedview else '' }}><label for="operator-overview">Operator Detailed View</label></p> + <legend>{{ _('Print Layouts') }}:</legend> + <p><input type="checkbox" id="client-overview" data-field-name="client-overview" /><label for="client-overview">Client Overview</label></p> + <p><input type="checkbox" id="client-detailedview" data-field-name="client-detailedview" /><label for="client-detailedview">Client Detailed View</label></p> + <p><input type="checkbox" id="operator-overview" data-field-name="operator-overview" CHECKED /><label for="operator-overview">Operator Overview</label></p> + <p><input type="checkbox" id="operator-detailedview" data-field-name="operator-detailedview" CHECKED /><label for="operator-detailedview">Operator Detailed View</label></p> </fieldset> + <button id="save-settings" title="{{ _("Includes all settings visible here and also the icon.") }}">{{ _("Save as defaults") }}</button> </div> </div> diff --git a/templates/embroider_input.inx b/templates/embroider_input.inx new file mode 100644 index 00000000..3af8f79e --- /dev/null +++ b/templates/embroider_input.inx @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> + <_name>{{ format | upper }} file input</_name> + <id>org.inkstitch.input.{{ format }}</id> + <dependency type="executable" location="extensions">embroider_input.py</dependency> + <dependency type="executable" location="extensions">inkex.py</dependency> + <input> + <extension>.{{ format }}</extension> + <mimetype>application/x-embroidery-{{ format }}</mimetype> + <_filetypename>Ink/Stitch: {{ description }} (.{{ format }})</_filetypename> + <_filetypetooltip>convert {{ format | upper }} file to Ink/Stitch manual-stitch paths</_filetypetooltip> + </input> + <script> + <command reldir="extensions" interpreter="python">embroider_input.py</command> + </script> +</inkscape-extension> + |
