├── spine-qml-converter.pro ├── resources ├── Attachment.qml ├── Bone.qml ├── Skeleton.qml ├── Slot.qml ├── SpineImage.qml ├── private │ └── SourceProxy.qml └── SpineColorShader.qml ├── .gitignore ├── README.md ├── main.cpp └── LICENSE /spine-qml-converter.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | CONFIG += console 3 | CONFIG -= app_bundle 4 | 5 | QT += core 6 | 7 | SOURCES += main.cpp 8 | -------------------------------------------------------------------------------- /resources/Attachment.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | 3 | Item { 4 | property Item setupParent: null 5 | parent: null 6 | 7 | Component.onCompleted: { 8 | reset(); 9 | } 10 | 11 | function reset() { 12 | parent = setupParent; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # C++ objects and libs 2 | 3 | *.slo 4 | *.lo 5 | *.o 6 | *.a 7 | *.la 8 | *.lai 9 | *.so 10 | *.dll 11 | *.dylib 12 | 13 | # Qt-es 14 | 15 | /.qmake.cache 16 | /.qmake.stash 17 | *.pro.user 18 | *.pro.user.* 19 | *.moc 20 | moc_*.cpp 21 | qrc_*.cpp 22 | ui_*.h 23 | Makefile* 24 | *-build-* 25 | 26 | # QtCreator 27 | 28 | *.autosave 29 | 30 | #QtCtreator Qml 31 | *.qmlproject.user 32 | *.qmlproject.user.* 33 | -------------------------------------------------------------------------------- /resources/Bone.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | 3 | QtObject { 4 | id: bone 5 | property QtObject bone: null 6 | 7 | property Rotation setupRot: Rotation {} 8 | property Translate setupTrans: Translate {} 9 | property Scale setupScale: Scale {} 10 | 11 | property Rotation rot: Rotation {} 12 | property Translate trans: Translate {} 13 | property Scale scale: Scale {} 14 | 15 | Component.onCompleted: { 16 | reset(); 17 | } 18 | 19 | function reset() { 20 | rot.angle = setupRot.angle; 21 | trans.x = setupTrans.x; 22 | trans.y = setupTrans.y; 23 | scale.xScale = setupScale.xScale; 24 | scale.yScale = setupScale.yScale; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /resources/Skeleton.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | 3 | Item { 4 | property ParallelAnimation currentAnimation: null 5 | 6 | function animate(animation) { 7 | if (currentAnimation !== null) { 8 | currentAnimation.stop(); 9 | reset(); 10 | } 11 | animation.start(); 12 | currentAnimation = animation; 13 | } 14 | 15 | function reset() { 16 | for (var i = 0; i < children.length; i++) { 17 | if (children[i].reset !== undefined) { 18 | children[i].reset(); 19 | } 20 | } 21 | for (i = 0; i < resources.length; i++) { 22 | if (resources[i].reset !== undefined) { 23 | resources[i].reset(); 24 | } 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /resources/Slot.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import QtGraphicalEffects 1.0 3 | 4 | Item { 5 | id: slot 6 | property Bone bone: null 7 | 8 | property Item setupAttachment: null 9 | property Item attachment: null 10 | 11 | property color setupColor: "#FFFFFFFF" 12 | property color color: null 13 | 14 | function attach(item) { 15 | if (attachment === item) 16 | return; 17 | if (attachment !== null) 18 | attachment.parent = null 19 | if (item !== null) 20 | item.parent = slot 21 | this.attachment = item 22 | } 23 | 24 | Component.onCompleted: { 25 | reset(); 26 | } 27 | 28 | function reset() { 29 | attach(setupAttachment); 30 | color = setupColor; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /resources/SpineImage.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import QtGraphicalEffects 1.0 3 | 4 | Image { 5 | id: image 6 | property Rotation rot: Rotation {} 7 | property Translate trans: Translate {} 8 | property Scale scale: Scale { } 9 | property Translate center: Translate { x: -width/2; y: -height/2 } 10 | property color color: parent !== null ? parent.parent !== null ? parent.parent.color !== undefined ? parent.parent.color : "#ffffffff" : "#ffffffff" : "#ffffffff" 11 | 12 | opacity: color !== null ? color.a : 1.0 13 | 14 | transform: [ center, scale, rot, trans ] 15 | 16 | SpineColorShader { 17 | parent: !Qt.colorEqual(image.color, "#ffffffff") ? image : null 18 | anchors.fill: parent 19 | source: image 20 | color: image.color 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | spine-qml-converter 2 | =================== 3 | Converts Spine by Esoteric Software export json format into native QML items and animations. 4 | 5 | The idea is to convert animations and UI's from Spine to QML which in turn can be modified 6 | by hand to integrate fluidly to your Qt/QML games and apps. 7 | 8 | Usage 9 | ========= 10 | spine-qml-converter input.json Output.qml 11 | 12 | Then add the converted qml, the files in resources/ and any required images to your qml project. 13 | 14 | Skeleton format 15 | ========= 16 | The animations are exposed properties named as "walkAnimation", "shootAnimation" etc. 17 | 18 | They can be controlled as native animations, but function animate(animation) is preferred, as 19 | it resets the pose before starting the animation. 20 | 21 | If using skins, you must set skeleton.skin.state = "GOBLIN". 22 | 23 | The root bone will be in the x and y position of the item. 24 | reset function can be used to set the skeleton back to setup pose. 25 | 26 | Notes 27 | ========= 28 | * Does not (yet) support IK or FFD. Texture atlases are not used. 29 | * Tested with Spine example json export, so might have a number of issues left. 30 | 31 | Version 32 | ========= 33 | 0.1 34 | * Proof of concept implementation 35 | * The QML format and that data it exposes is in early format 36 | 37 | Environment 38 | ========= 39 | Has been tested in Windows 7 and Ubuntu 14.04 with Qt 5.1 and 5.3. 40 | 41 | Known issues 42 | ========= 43 | * The intendation in the output is not correct (so ctrl+a + ctrl+i is your friend). 44 | -------------------------------------------------------------------------------- /resources/private/SourceProxy.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the Qt Graphical Effects module. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names 21 | ** of its contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | import QtQuick 2.0 42 | 43 | Item { 44 | id: rootItem 45 | property variant input 46 | property variant output 47 | property variant sourceRect 48 | visible: false 49 | 50 | Component.onCompleted: evaluateInput() 51 | 52 | onInputChanged: evaluateInput() 53 | 54 | onSourceRectChanged: evaluateInput() 55 | 56 | function evaluateInput() { 57 | if (input == undefined) { 58 | output = input 59 | } 60 | else if (sourceRect != undefined && sourceRect != Qt.rect(0, 0, 0, 0) && !isQQuickShaderEffectSource(input)) { 61 | proxySource.sourceItem = input 62 | output = proxySource 63 | proxySource.sourceRect = sourceRect 64 | } 65 | else if (isQQuickItemLayerEnabled(input)) { 66 | output = input 67 | } 68 | else if ((isQQuickImage(input) && !hasTileMode(input) && !hasChildren(input))) { 69 | output = input 70 | } 71 | else if (isQQuickShaderEffectSource(input)) { 72 | output = input 73 | } 74 | else { 75 | proxySource.sourceItem = input 76 | output = proxySource 77 | proxySource.sourceRect = Qt.rect(0, 0, 0, 0) 78 | } 79 | } 80 | 81 | function isQQuickItemLayerEnabled(item) { 82 | if (item.hasOwnProperty("layer")) { 83 | var l = item["layer"] 84 | if (l.hasOwnProperty("enabled") && l["enabled"].toString() == "true") 85 | return true 86 | } 87 | return false 88 | } 89 | 90 | function isQQuickImage(item) { 91 | var imageProperties = [ "fillMode", "progress", "asynchronous", "sourceSize", "status", "smooth" ] 92 | return hasProperties(item, imageProperties) 93 | } 94 | 95 | function isQQuickShaderEffectSource(item) { 96 | var shaderEffectSourceProperties = [ "hideSource", "format", "sourceItem", "mipmap", "wrapMode", "live", "recursive", "sourceRect" ] 97 | return hasProperties(item, shaderEffectSourceProperties) 98 | } 99 | 100 | function hasProperties(item, properties) { 101 | var counter = 0 102 | for (var j = 0; j < properties.length; j++) { 103 | if (item.hasOwnProperty(properties [j])) 104 | counter++ 105 | } 106 | return properties.length == counter 107 | } 108 | 109 | function hasChildren(item) { 110 | if (item.hasOwnProperty("childrenRect")) { 111 | if (item["childrenRect"].toString() != "QRectF(0, 0, 0, 0)") 112 | return true 113 | else 114 | return false 115 | } 116 | return false 117 | } 118 | 119 | function hasTileMode(item) { 120 | if (item.hasOwnProperty("fillMode")) { 121 | if (item["fillMode"].toString() != "0") 122 | return true 123 | else 124 | return false 125 | } 126 | return false 127 | } 128 | 129 | ShaderEffectSource { 130 | id: proxySource 131 | live: rootItem.input != rootItem.output 132 | hideSource: false 133 | smooth: true 134 | visible: false 135 | } 136 | } 137 | -------------------------------------------------------------------------------- /resources/SpineColorShader.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the Qt Graphical Effects module. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names 21 | ** of its contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | import QtQuick 2.0 42 | import "private" 43 | 44 | /*! 45 | \qmltype ColorOverlay 46 | \inqmlmodule QtGraphicalEffects 1.0 47 | \since QtGraphicalEffects 1.0 48 | \inherits QtQuick2::Item 49 | \ingroup qtgraphicaleffects-color 50 | \brief Alters the colors of the source item by applying an overlay color. 51 | 52 | The effect is similar to what happens when a colorized glass is put on top 53 | of a grayscale image. The color for the overlay is given in the RGBA format. 54 | 55 | \table 56 | \header 57 | \li Source 58 | \li Effect applied 59 | \row 60 | \li \image Original_butterfly.png 61 | \li \image ColorOverlay_butterfly.png 62 | \endtable 63 | 64 | \section1 Example 65 | 66 | The following example shows how to apply the effect. 67 | \snippet ColorOverlay-example.qml example 68 | 69 | */ 70 | Item { 71 | id: rootItem 72 | 73 | /*! 74 | This property defines the source item that provides the source pixels 75 | for the effect. 76 | */ 77 | property variant source 78 | 79 | /*! 80 | This property defines the RGBA color value which is used to colorize the 81 | source. 82 | 83 | By default, the property is set to \c "transparent". 84 | 85 | \table 86 | \header 87 | \li Output examples with different color values 88 | \li 89 | \li 90 | \row 91 | \li \image ColorOverlay_color1.png 92 | \li \image ColorOverlay_color2.png 93 | \li \image ColorOverlay_color3.png 94 | \row 95 | \li \b { color: #80ff0000 } 96 | \li \b { color: #8000ff00 } 97 | \li \b { color: #800000ff } 98 | \endtable 99 | 100 | */ 101 | property color color: "transparent" 102 | 103 | /*! 104 | This property allows the effect output pixels to be cached in order to 105 | improve the rendering performance. 106 | 107 | Every time the source or effect properties are changed, the pixels in 108 | the cache must be updated. Memory consumption is increased, because an 109 | extra buffer of memory is required for storing the effect output. 110 | 111 | It is recommended to disable the cache when the source or the effect 112 | properties are animated. 113 | 114 | By default, the property is set to \c false. 115 | 116 | */ 117 | property bool cached: false 118 | 119 | SourceProxy { 120 | id: sourceProxy 121 | input: rootItem.source 122 | } 123 | 124 | ShaderEffectSource { 125 | id: cacheItem 126 | anchors.fill: parent 127 | visible: rootItem.cached 128 | smooth: true 129 | sourceItem: shaderItem 130 | live: true 131 | hideSource: visible 132 | } 133 | 134 | ShaderEffect { 135 | id: shaderItem 136 | property variant source: sourceProxy.output 137 | property color color: rootItem.color 138 | 139 | anchors.fill: parent 140 | 141 | fragmentShader: " 142 | varying mediump vec2 qt_TexCoord0; 143 | uniform highp float qt_Opacity; 144 | uniform lowp sampler2D source; 145 | uniform highp vec4 color; 146 | void main() { 147 | highp vec4 pixelColor = texture2D(source, qt_TexCoord0); 148 | gl_FragColor = vec4(vec3(pixelColor.rgb * color.rgb), pixelColor.a * qt_Opacity); 149 | } 150 | " 151 | } 152 | } 153 | -------------------------------------------------------------------------------- /main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | spine-qml-converter 3 | Copyright (C) 2014 Vikke Matikainen 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | #include 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | using namespace std; 29 | 30 | const QString boneStr = "Bone"; 31 | const QString slotStr = "Slot"; 32 | const QString attachmentStr = "Attachment"; 33 | const QString animationStr = "Animation"; 34 | 35 | QString recursiveBoneTransform(int level); 36 | QString toStateQml(QString skin, QJsonObject skinObject); 37 | 38 | bool readDocumentFromFile(const QString& fileName, QJsonDocument& document) { 39 | QFile file(fileName); 40 | 41 | if (!file.open(QIODevice::ReadOnly)) { 42 | qWarning("Couldn't open save file."); 43 | return false; 44 | } 45 | 46 | QByteArray data = file.readAll(); 47 | 48 | document = QJsonDocument::fromJson(data); 49 | 50 | return true; 51 | } 52 | 53 | QString indent(QString data, int amount = 1) 54 | { 55 | QString tab; 56 | tab.fill('\t', amount); 57 | QString ret = data; 58 | if (ret.length() > 0) { 59 | int i = 0; 60 | do { 61 | ret.insert(i, tab); 62 | i = ret.indexOf("\n", i) + 1; 63 | } while (i > 0); 64 | } 65 | 66 | return ret; 67 | } 68 | 69 | bool wrapQml(QString& data) 70 | { 71 | data = indent(data); 72 | data.prepend("import QtQuick 2.0\n" \ 73 | "\n" \ 74 | "Skeleton {\n" \ 75 | "\tid: root\n"); 76 | 77 | data.append("}\n"); 78 | 79 | return true; 80 | } 81 | 82 | QString formatName(QJsonValue value) { 83 | QStringList words = value.toString().split(" "); 84 | QString ret = words.at(0); 85 | 86 | for(int i = 1; i < words.count(); i++) { 87 | QString word = words.at(i); 88 | ret += word.left(1).toUpper() + word.right(word.length()-1); 89 | } 90 | 91 | if (ret.at(0).isUpper()) { 92 | QChar temp = ret.at(0).toLower(); 93 | ret.remove(0,1); 94 | ret.prepend(temp); 95 | } 96 | 97 | while (true) { 98 | int i = ret.indexOf("-"); 99 | if (i == -1) 100 | break; 101 | ret.replace(i,1, '_'); 102 | } 103 | 104 | return ret; 105 | } 106 | 107 | QString toResetFunctionLine(QString target, QString property, double value) { 108 | return target + "." + property + " = " + QString::number(value); 109 | } 110 | 111 | QString toResetFunctionLine(QString target, QString property, QString value) { 112 | return target + "." + property + " = " + value; 113 | } 114 | 115 | QString toBoneQml(QJsonObject object) { 116 | QString ret; 117 | ret += "Bone {\n"; 118 | ret += "\tid: " + formatName(object.value("name")) + boneStr + "\n"; 119 | if (object.contains("parent")) { 120 | ret += "\tbone: " + formatName(object.value("parent")) + boneStr + "\n"; 121 | } 122 | if (object.contains("x")) { 123 | ret += "\tsetupTrans.x: " + QString::number(object.value("x").toDouble()) + "\n"; 124 | } 125 | if (object.contains("y")) { 126 | // pay attention to inverse here * -1 127 | ret += "\tsetupTrans.y: " + QString::number(object.value("y").toDouble() * -1) + "\n"; 128 | } 129 | if (object.contains("scaleX")) { 130 | ret += "\tsetupScale.xScale: " + QString::number(object.value("scaleX").toDouble()) + "\n"; 131 | } 132 | if (object.contains("scaleY")) { 133 | ret += "\tsetupScale.yScale: " + QString::number(object.value("scaleY").toDouble()) + "\n"; 134 | } 135 | if (object.contains("rotation")) { 136 | // pay attention to inverse here * -1 137 | ret += "\tsetupRot.angle: " + QString::number(object.value("rotation").toDouble() * -1) + "\n"; 138 | } 139 | 140 | ret += "}\n"; 141 | 142 | return ret; 143 | } 144 | 145 | QString recursiveBoneTransform(int level) { 146 | if (level == 0) { 147 | return QString(); 148 | } else { 149 | QString bone; 150 | for( int i = 0; i < level; i++) { 151 | bone += "bone."; 152 | } 153 | return recursiveBoneTransform(level-1) + QString((level!=1 ? ", " : "") + bone + "scale, " + bone + "rot, " + bone + "trans"); 154 | } 155 | } 156 | 157 | int findSlotLevel(QJsonObject slot, QJsonArray bones) { 158 | QJsonValue bone = slot.value("bone"); 159 | int count = 0; 160 | bool end = false; 161 | while(end == false) { 162 | foreach(const QJsonValue& value, bones) { 163 | if (bone.isUndefined()) { 164 | end = true; 165 | break; 166 | }else if (value.toObject().value("name") == bone) { 167 | count++; 168 | bone = value.toObject().value("parent"); 169 | break; 170 | } 171 | } 172 | } 173 | 174 | return count; 175 | } 176 | 177 | QString toARGBColor(QString rgbaColor) { 178 | QString ret = rgbaColor.left(6); 179 | ret.prepend(rgbaColor.right(2)); 180 | return ret; 181 | } 182 | 183 | QString toSlotQml(QJsonObject object, int level) { 184 | QString ret; 185 | ret += "Slot {\n"; 186 | ret += "\tid: " + formatName(object.value("name")) + slotStr + "\n"; 187 | ret += "\tparent: root\n"; 188 | ret += "\tbone: " + formatName(object.value("bone")) + boneStr + "\n"; 189 | if (object.contains("attachment")) { 190 | ret += "\tsetupAttachment: " + formatName(object.value("attachment")) + attachmentStr + "\n"; 191 | } 192 | if (object.contains("color")) { 193 | ret += "\tsetupColor: \"#" + toARGBColor(object.value("color").toString()) + "\"\n"; 194 | } 195 | 196 | ret += "\ttransform: [ " + recursiveBoneTransform(level)+ " ]\n"; 197 | 198 | ret += "}\n"; 199 | 200 | return ret; 201 | } 202 | 203 | QString toImageQml(QJsonObject object, QString name, QString slot, QString skin) { 204 | QString ret; 205 | ret += "SpineImage {\n"; 206 | ret += "\tid: " + formatName(skin + " " + slot + " " + name) + "\n"; 207 | if (object.contains("name")) { 208 | ret += "\tsource: \"" + object.value("name").toString() + ".png\"" + "\n"; 209 | } else { 210 | ret += "\tsource: \"" + name + ".png\"" + "\n"; 211 | } 212 | // temp hack 213 | if (skin == "default skin") { 214 | ret += "\tparent: " + formatName(name) + attachmentStr + "\n"; 215 | } 216 | 217 | if (object.contains("x")) { 218 | ret += "\ttrans.x: " + QString::number(object.value("x").toDouble()) + "\n"; 219 | } 220 | if (object.contains("y")) { 221 | // pay attention to inverse here * -1 222 | ret += "\ttrans.y: " + QString::number(object.value("y").toDouble() * -1) + "\n"; 223 | } 224 | if (object.contains("scaleX")) { 225 | ret += "\tscale.xScale: " + QString::number(object.value("scaleX").toDouble()) + "\n"; 226 | } 227 | if (object.contains("scaleY")) { 228 | ret += "\tscale.yScale: " + QString::number(object.value("scaleY").toDouble()) + "\n"; 229 | } 230 | if (object.contains("rotation")) { 231 | // pay attention to inverse here * -1 232 | ret += "\trot.angle: " + QString::number(object.value("rotation").toDouble() * -1) + "\n"; 233 | } 234 | if (object.contains("width")) { 235 | ret += "\twidth: " + QString::number(object.value("width").toDouble()) + "\n"; 236 | } 237 | if (object.contains("height")) { 238 | ret += "\theight: " + QString::number(object.value("height").toDouble()) + "\n"; 239 | } 240 | 241 | ret += "}\n"; 242 | 243 | return ret; 244 | } 245 | 246 | QString skinsToQml(QJsonObject object) { 247 | QString ret; 248 | ret += "property Item skins: Item {\n" \ 249 | "visible: false\n\n"; 250 | 251 | if (object.keys().count() > 0) { 252 | ret += "states: [\n"; 253 | bool first = true; 254 | foreach(QString skin, object.keys()) { 255 | if (!first) { 256 | ret.insert(ret.length()-1,","); 257 | } 258 | first = false; 259 | QJsonObject skinObject = object.value(skin).toObject(); 260 | 261 | ret += toStateQml(skin, skinObject); 262 | } 263 | ret += "]\n"; 264 | } 265 | foreach(QString skin, object.keys()) { 266 | QJsonObject skinObject = object.value(skin).toObject(); 267 | if (skin == "default") { 268 | skin = "default skin"; 269 | } 270 | ret += "Item {\n" \ 271 | "\tid: " + formatName(skin) + "\n\n"; 272 | foreach(QString slot, skinObject.keys()) { 273 | QJsonObject slotObject = skinObject.value(slot).toObject(); 274 | foreach(QString image, slotObject.keys()) { 275 | ret += indent(toImageQml(slotObject.value(image).toObject(), image, slot, skin)); 276 | } 277 | } 278 | ret += "}\n"; 279 | } 280 | ret += "}\n"; 281 | 282 | return ret; 283 | } 284 | 285 | QString toPropertyActionQml(QString target, QString property, double value) 286 | { 287 | QString ret; 288 | ret += "PropertyAction { target: " + target + "; property: \"" + property + "\"; value: " + QString::number(value) + " }\n"; 289 | return ret; 290 | } 291 | 292 | QString toPropertyActionQml(QString target, QString property, QString value) 293 | { 294 | QString ret; 295 | ret += "PropertyAction { target: " + target + "; property: \"" + property + "\"; value: " + value + " }\n"; 296 | return ret; 297 | } 298 | 299 | QString toPropertyAnimationQml(QString target, QString property, double from, double to, double duration, QJsonValue curve) 300 | { 301 | QString ret; 302 | int intDuration = (int) (duration * 1000.0); 303 | 304 | if (curve.isString() && curve.toString() == "stepped") { 305 | ret += "PauseAnimation { duration: " + QString::number(intDuration) + " }\n"; 306 | ret += toPropertyActionQml(target, property, to); 307 | } else { 308 | ret += "PropertyAnimation { target: " + target + "; property: \"" + property + 309 | "\"; from: " + QString::number(from) + "; to: " + QString::number(to) + 310 | "; duration: " + QString::number(intDuration); 311 | if (curve.isArray()) { 312 | QJsonArray curveArray = curve.toArray(); 313 | ret += "; easing.bezierCurve: [ "; 314 | foreach(QJsonValue item, curveArray) { 315 | ret += QString::number(item.toDouble()) + ", "; 316 | } 317 | ret += "1,1 ]"; 318 | } 319 | 320 | ret += " }\n"; 321 | } 322 | return ret; 323 | } 324 | 325 | QString toColorAnimationQml(QString target, QString from, QString to, double duration) 326 | { 327 | QString ret; 328 | from = toARGBColor(from); 329 | to = toARGBColor(to); 330 | ret += "ColorAnimation { target: " + formatName(target) + slotStr + "; property: \"color\"" + "; from: \"#" + from + "\"; to: \"#" + to + "\"; duration: " + 331 | QString::number((int)(duration*1000)) + " }\n"; 332 | 333 | return ret; 334 | } 335 | 336 | QString toAnimationQml(QJsonObject animations, QString animationStr, QJsonArray bones, QJsonArray slotArray) 337 | { 338 | QString ret; 339 | QJsonObject animation = animations.value(animationStr).toObject(); 340 | 341 | ret += "ParallelAnimation {\n"; 342 | ret += "\tid: " + formatName(animationStr) + "\n"; 343 | 344 | QJsonObject slotAnimation = animation.value("slots").toObject(); 345 | foreach(QString slot, slotAnimation.keys()) { 346 | QJsonObject slotObject = slotAnimation.value(slot).toObject(); 347 | QJsonArray attachmentChanges = slotObject.value("attachment").toArray(); 348 | QJsonArray colorChanges = slotObject.value("color").toArray(); 349 | 350 | if (attachmentChanges.count() > 0) { 351 | double previousTime = 0; 352 | ret += "\tSequentialAnimation {\n"; 353 | foreach(QJsonValue item, attachmentChanges) { 354 | QJsonObject itemObject = item.toObject(); 355 | double time = itemObject.value("time").toDouble(); 356 | QJsonValue attachmentName = itemObject.value("name"); 357 | QString attachment = "null"; 358 | 359 | if (time > 0) { 360 | ret += "PauseAnimation { duration: " + QString::number((int)((time-previousTime)*1000)) + " }\n"; 361 | } 362 | 363 | if (!attachmentName.isNull()) { 364 | attachment = formatName(attachmentName.toString()) + attachmentStr ; 365 | } 366 | 367 | ret += "ScriptAction { script: "+ formatName(slot) + slotStr + ".attach(" + 368 | attachment + "); }\n"; 369 | 370 | previousTime = time; 371 | } 372 | ret += "}\n"; 373 | } 374 | 375 | if (colorChanges.count() > 0) { 376 | double previousTime = 0; 377 | ret += "\tSequentialAnimation {\n"; 378 | QString setupColor = "ffffffff"; 379 | QString previousColor = setupColor; 380 | foreach(QJsonValue item, colorChanges) { 381 | QJsonObject itemObject = item.toObject(); 382 | double time = itemObject.value("time").toDouble(); 383 | QString color = itemObject.value("color").toString(); 384 | foreach(QJsonValue value, slotArray) { 385 | QJsonObject object = value.toObject(); 386 | if (object.value("name").toString() == slot) { 387 | if (object.contains("color")) 388 | setupColor = object.value("color").toString(); 389 | break; 390 | } 391 | } 392 | 393 | if (time == 0.0) { 394 | ret += toPropertyActionQml(formatName(slot) + slotStr, "color", "\"#" + toARGBColor(color) + "\""); 395 | previousColor = color; 396 | continue; 397 | } 398 | 399 | ret += toColorAnimationQml(slot, previousColor, color, time - previousTime); 400 | 401 | previousColor = color; 402 | previousTime = time; 403 | } 404 | ret += "}\n"; 405 | } 406 | 407 | } 408 | QJsonObject boneAnimation = animation.value("bones").toObject(); 409 | foreach(QString bone, boneAnimation.keys()) { 410 | // this is retarded, I need coffee or sleep, I will not remember this 411 | QJsonObject boneBoneObject; 412 | foreach(QJsonValue item, bones) { 413 | if (item.toObject().value("name").toString() == bone) { 414 | boneBoneObject = item.toObject(); 415 | break; 416 | } 417 | } 418 | 419 | QJsonObject boneObject = boneAnimation.value(bone).toObject(); 420 | QJsonValue rotateValue = boneObject.value("rotate"); 421 | QJsonArray rotateArray = rotateValue.toArray(); 422 | QJsonValue scaleValue = boneObject.value("scale"); 423 | QJsonArray scaleArray = scaleValue.toArray(); 424 | QJsonValue translateValue = boneObject.value("translate"); 425 | QJsonArray translateArray = translateValue.toArray(); 426 | 427 | QJsonValue curve, previousCurve; // in spine they announce the curve in starting keyframe. In qml its different. 428 | 429 | if (!rotateValue.isUndefined()) { 430 | ret += "\tSequentialAnimation {\n"; 431 | double previousTime = 0; 432 | double setupAngle = boneBoneObject.value("rotation").toDouble() * -1; 433 | double previousAngle = setupAngle; 434 | foreach(QJsonValue item, rotateArray) { 435 | QJsonObject object = item.toObject(); 436 | double time = object.value("time").toDouble(); 437 | // note the inverse 438 | double angle = object.value("angle").toDouble() * -1; 439 | if (angle < -180) 440 | angle += 360; 441 | if (angle > 180) 442 | angle -= 360; 443 | curve = object.value("curve"); 444 | 445 | if(time == 0.0) { 446 | ret += toPropertyActionQml(formatName(bone)+boneStr+".rot", "angle", setupAngle + angle); 447 | previousAngle += angle; 448 | continue; 449 | } 450 | ret += toPropertyAnimationQml(formatName(bone)+boneStr+".rot", "angle", previousAngle, 451 | setupAngle + angle, time - previousTime, previousCurve); 452 | previousCurve = curve; 453 | previousTime = time; 454 | previousAngle = setupAngle + angle; 455 | } 456 | ret += "\t}\n"; 457 | } 458 | 459 | if (!scaleValue.isUndefined()) { 460 | double previousTime = 0; 461 | ret += "\tSequentialAnimation {\n"; 462 | double setupScaleX = 1.0; 463 | if (boneBoneObject.contains("scaleX")) 464 | setupScaleX = boneBoneObject.value("scaleX").toDouble(); 465 | double previousScaleX = setupScaleX; 466 | foreach(QJsonValue item, scaleArray) { 467 | QJsonObject object = item.toObject(); 468 | double time = object.value("time").toDouble(); 469 | double scaleX = object.value("x").toDouble(); 470 | curve = object.value("curve"); 471 | 472 | if(time == 0.0) { 473 | ret += toPropertyActionQml(formatName(bone)+boneStr+".scale", "xScale", setupScaleX * scaleX); 474 | previousScaleX = setupScaleX * scaleX; 475 | continue; 476 | } 477 | ret += toPropertyAnimationQml(formatName(bone)+boneStr+".scale", "xScale", previousScaleX, 478 | setupScaleX * scaleX, time - previousTime, previousCurve); 479 | previousCurve = curve; 480 | previousTime = time; 481 | previousScaleX = setupScaleX * scaleX; 482 | } 483 | ret += "\t}\n"; 484 | 485 | previousTime = 0; 486 | ret += "\tSequentialAnimation {\n"; 487 | double setupScaleY = 1.0; 488 | if (boneBoneObject.contains("scaleY")) 489 | setupScaleY = boneBoneObject.value("scaleY").toDouble(); 490 | double previousScaleY = setupScaleY; 491 | foreach(QJsonValue item, scaleArray) { 492 | QJsonObject object = item.toObject(); 493 | double time = object.value("time").toDouble(); 494 | double scaleY = object.value("y").toDouble(); 495 | curve = object.value("curve"); 496 | 497 | if(time == 0.0) { 498 | ret += toPropertyActionQml(formatName(bone)+boneStr+".scale", "yScale", setupScaleY * scaleY); 499 | previousScaleY = setupScaleY * scaleY; 500 | continue; 501 | } 502 | ret += toPropertyAnimationQml(formatName(bone)+boneStr+".scale", "yScale", previousScaleY, 503 | setupScaleY * scaleY, time - previousTime, previousCurve); 504 | previousCurve = curve; 505 | previousTime = time; 506 | previousScaleY = setupScaleY * scaleY; 507 | } 508 | ret += "\t}\n"; 509 | } 510 | 511 | 512 | if (!translateValue.isUndefined()) { 513 | double previousTime = 0; 514 | ret += "\tSequentialAnimation {\n"; 515 | double setupX = boneBoneObject.value("x").toDouble(); 516 | double previousX = setupX; 517 | foreach(QJsonValue item, translateArray) { 518 | QJsonObject object = item.toObject(); 519 | double time = object.value("time").toDouble(); 520 | double x = object.value("x").toDouble(); 521 | curve = object.value("curve"); 522 | 523 | if(time == 0.0) { 524 | ret += toPropertyActionQml(formatName(bone)+boneStr+".trans", "x", setupX + x); 525 | previousX += x; 526 | continue; 527 | } 528 | ret += toPropertyAnimationQml(formatName(bone)+boneStr+".trans", "x", previousX, 529 | setupX + x, time - previousTime, previousCurve); 530 | previousCurve = curve; 531 | previousTime = time; 532 | previousX = setupX + x; 533 | } 534 | ret += "\t}\n"; 535 | 536 | previousTime = 0; 537 | ret += "\tSequentialAnimation {\n"; 538 | double setupY = boneBoneObject.value("y").toDouble() * -1; 539 | double previousY = setupY; 540 | foreach(QJsonValue item, translateArray) { 541 | QJsonObject object = item.toObject(); 542 | double time = object.value("time").toDouble(); 543 | double y = object.value("y").toDouble() * -1; 544 | curve = object.value("curve"); 545 | 546 | if(time == 0.0) { 547 | ret += toPropertyActionQml(formatName(bone)+boneStr+".trans", "y", setupY + y); 548 | previousY += y; 549 | continue; 550 | } 551 | ret += toPropertyAnimationQml(formatName(bone)+boneStr+".trans", "y", previousY, 552 | setupY + y, time - previousTime, previousCurve); 553 | previousCurve = curve; 554 | previousTime = time; 555 | previousY = setupY + y; 556 | } 557 | ret += "\t}\n"; 558 | } 559 | } 560 | 561 | ret += "}\n"; 562 | 563 | return ret; 564 | } 565 | 566 | QString toPropertyChangeQml(QString target, QString property, QString value) { 567 | return QString("PropertyChanges { target: " + target + "; " + property + ": " + value + " }\n"); 568 | } 569 | 570 | QMap findAttachmentParentPairs(QJsonObject skeleton) { 571 | QMap ret; 572 | 573 | QJsonObject skinsObject = skeleton.value("skins").toObject(); 574 | foreach(QString skin, skinsObject.keys()) { 575 | QJsonObject skinObject = skinsObject.value(skin).toObject(); 576 | foreach(QString slot, skinObject.keys()) { 577 | QJsonObject slotObject= skinObject.value(slot).toObject(); 578 | foreach(QString attachment, slotObject.keys()) { 579 | ret[attachment] = QString(); 580 | } 581 | } 582 | } 583 | 584 | QJsonArray slotsArray = skeleton.value("slots").toArray(); 585 | 586 | foreach(QJsonValue item, slotsArray) { 587 | QJsonObject itemObject = item.toObject(); 588 | if (!itemObject.contains("attachment")) 589 | continue; 590 | 591 | 592 | QString attachment = itemObject.value("attachment").toString(); 593 | QString slot = itemObject.value("name").toString(); 594 | ret[attachment] = slot; 595 | } 596 | 597 | return ret; 598 | } 599 | 600 | QString parseAttachmentToQml(QString attachment, QString slot) { 601 | QString ret; 602 | bool hasParent = slot != QString(); 603 | ret += "Attachment { id: " + formatName(attachment) + attachmentStr + 604 | (hasParent ? "; setupParent: " + formatName(slot) + slotStr : "") + " }\n"; 605 | 606 | return ret; 607 | } 608 | 609 | QString toAttachmentsQml(QJsonObject skeleton) { 610 | QString ret; 611 | 612 | QMap attachments = findAttachmentParentPairs(skeleton); 613 | 614 | ret += "Item {\n"; 615 | ret += "\tid: attachments\n"; 616 | ret += "\tvisible: false\n\n"; 617 | 618 | foreach(QString key, attachments.keys()) { 619 | ret += parseAttachmentToQml(key, attachments.value(key)); 620 | } 621 | 622 | ret += "}\n"; 623 | 624 | return ret; 625 | } 626 | 627 | 628 | QString toStateQml(QString skin, QJsonObject skinObject) { 629 | QString ret; 630 | ret += "State {\n"; 631 | ret += "\tname: \"" + skin.toUpper() + "\"\n"; 632 | 633 | foreach(QString slot, skinObject.keys()) { 634 | QJsonObject slotObject = skinObject.value(slot).toObject(); 635 | foreach(QString attachment, slotObject.keys()) { 636 | QString target = formatName(formatName(skin + " " + slot + " " + attachment)); 637 | ret += toPropertyChangeQml(target, "parent", formatName(attachment) + attachmentStr); 638 | } 639 | } 640 | 641 | ret += "}\n"; 642 | 643 | return ret; 644 | } 645 | 646 | int main(int argc, char *argv[]) 647 | { 648 | if (argc < 2 || argc > 3) { 649 | QTextStream(stdout) << "Usage: spine-qml-convert input.json Output.qml\n"; 650 | return 0; 651 | } 652 | 653 | QStringList arguments; 654 | for (int i = 1; i < argc; i++) { 655 | arguments += QString(QByteArray(argv[i])); 656 | } 657 | 658 | QString output; 659 | QFile outputFile(arguments[1]); 660 | 661 | if(!outputFile.open(QIODevice::WriteOnly)) { 662 | return 1; 663 | } 664 | 665 | QJsonDocument document; 666 | 667 | if (!readDocumentFromFile(arguments[0], document)) { 668 | return 1; 669 | } 670 | 671 | QJsonObject object = document.object(); 672 | 673 | QJsonArray bones = object.value("bones").toArray(); 674 | 675 | foreach(const QJsonValue& value, bones) { 676 | QJsonObject item = value.toObject(); 677 | 678 | output += toBoneQml(item); 679 | } 680 | 681 | QJsonArray slotArray = object.value("slots").toArray(); 682 | 683 | foreach(const QJsonValue& value, slotArray) { 684 | QJsonObject item = value.toObject(); 685 | 686 | int level = findSlotLevel(item, bones); 687 | output += toSlotQml(item, level); 688 | } 689 | 690 | output += toAttachmentsQml(object); 691 | 692 | QJsonObject skins = object.value("skins").toObject(); 693 | output += skinsToQml(skins); 694 | 695 | QJsonObject animations = object.value("animations").toObject(); 696 | 697 | foreach(QString animation, animations.keys()) { 698 | output += "property alias " + formatName(animation) + animationStr + ": " + formatName(animation) + "\n"; 699 | output += "Item {\n"; 700 | output += toAnimationQml(animations, animation, bones, slotArray); 701 | output += "}\n"; 702 | } 703 | 704 | wrapQml(output); 705 | 706 | QTextStream out(&outputFile); 707 | out << output; 708 | 709 | outputFile.close(); 710 | 711 | QTextStream(stdout) << "The deed is done.\n"; 712 | 713 | return 0; 714 | } 715 | 716 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | NOTE 2 | ========================== 3 | Some files inside resources are licensed differently and have a separate license header. 4 | 5 | 6 | 7 | GNU GENERAL PUBLIC LICENSE 8 | ========================== 9 | 10 | Version 3, 29 June 2007 11 | 12 | Copyright © 2007 Free Software Foundation, Inc. <> 13 | 14 | Everyone is permitted to copy and distribute verbatim copies of this license 15 | document, but changing it is not allowed. 16 | 17 | ## Preamble 18 | 19 | The GNU General Public License is a free, copyleft license for software and other 20 | kinds of works. 21 | 22 | The licenses for most software and other practical works are designed to take away 23 | your freedom to share and change the works. By contrast, the GNU General Public 24 | License is intended to guarantee your freedom to share and change all versions of a 25 | program--to make sure it remains free software for all its users. We, the Free 26 | Software Foundation, use the GNU General Public License for most of our software; it 27 | applies also to any other work released this way by its authors. You can apply it to 28 | your programs, too. 29 | 30 | When we speak of free software, we are referring to freedom, not price. Our General 31 | Public Licenses are designed to make sure that you have the freedom to distribute 32 | copies of free software (and charge for them if you wish), that you receive source 33 | code or can get it if you want it, that you can change the software or use pieces of 34 | it in new free programs, and that you know you can do these things. 35 | 36 | To protect your rights, we need to prevent others from denying you these rights or 37 | asking you to surrender the rights. Therefore, you have certain responsibilities if 38 | you distribute copies of the software, or if you modify it: responsibilities to 39 | respect the freedom of others. 40 | 41 | For example, if you distribute copies of such a program, whether gratis or for a fee, 42 | you must pass on to the recipients the same freedoms that you received. You must make 43 | sure that they, too, receive or can get the source code. And you must show them these 44 | terms so they know their rights. 45 | 46 | Developers that use the GNU GPL protect your rights with two steps: (1) assert 47 | copyright on the software, and (2) offer you this License giving you legal permission 48 | to copy, distribute and/or modify it. 49 | 50 | For the developers' and authors' protection, the GPL clearly explains that there is 51 | no warranty for this free software. For both users' and authors' sake, the GPL 52 | requires that modified versions be marked as changed, so that their problems will not 53 | be attributed erroneously to authors of previous versions. 54 | 55 | Some devices are designed to deny users access to install or run modified versions of 56 | the software inside them, although the manufacturer can do so. This is fundamentally 57 | incompatible with the aim of protecting users' freedom to change the software. The 58 | systematic pattern of such abuse occurs in the area of products for individuals to 59 | use, which is precisely where it is most unacceptable. Therefore, we have designed 60 | this version of the GPL to prohibit the practice for those products. If such problems 61 | arise substantially in other domains, we stand ready to extend this provision to 62 | those domains in future versions of the GPL, as needed to protect the freedom of 63 | users. 64 | 65 | Finally, every program is threatened constantly by software patents. States should 66 | not allow patents to restrict development and use of software on general-purpose 67 | computers, but in those that do, we wish to avoid the special danger that patents 68 | applied to a free program could make it effectively proprietary. To prevent this, the 69 | GPL assures that patents cannot be used to render the program non-free. 70 | 71 | The precise terms and conditions for copying, distribution and modification follow. 72 | 73 | ## TERMS AND CONDITIONS 74 | 75 | ### 0. Definitions. 76 | 77 | “This License” refers to version 3 of the GNU General Public License. 78 | 79 | “Copyright” also means copyright-like laws that apply to other kinds of 80 | works, such as semiconductor masks. 81 | 82 | “The Program” refers to any copyrightable work licensed under this 83 | License. Each licensee is addressed as “you”. “Licensees” and 84 | “recipients” may be individuals or organizations. 85 | 86 | To “modify” a work means to copy from or adapt all or part of the work in 87 | a fashion requiring copyright permission, other than the making of an exact copy. The 88 | resulting work is called a “modified version” of the earlier work or a 89 | work “based on” the earlier work. 90 | 91 | A “covered work” means either the unmodified Program or a work based on 92 | the Program. 93 | 94 | To “propagate” a work means to do anything with it that, without 95 | permission, would make you directly or secondarily liable for infringement under 96 | applicable copyright law, except executing it on a computer or modifying a private 97 | copy. Propagation includes copying, distribution (with or without modification), 98 | making available to the public, and in some countries other activities as well. 99 | 100 | To “convey” a work means any kind of propagation that enables other 101 | parties to make or receive copies. Mere interaction with a user through a computer 102 | network, with no transfer of a copy, is not conveying. 103 | 104 | An interactive user interface displays “Appropriate Legal Notices” to the 105 | extent that it includes a convenient and prominently visible feature that (1) 106 | displays an appropriate copyright notice, and (2) tells the user that there is no 107 | warranty for the work (except to the extent that warranties are provided), that 108 | licensees may convey the work under this License, and how to view a copy of this 109 | License. If the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | ### 1. Source Code. 113 | 114 | The “source code” for a work means the preferred form of the work for 115 | making modifications to it. “Object code” means any non-source form of a 116 | work. 117 | 118 | A “Standard Interface” means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of interfaces 120 | specified for a particular programming language, one that is widely used among 121 | developers working in that language. 122 | 123 | The “System Libraries” of an executable work include anything, other than 124 | the work as a whole, that (a) is included in the normal form of packaging a Major 125 | Component, but which is not part of that Major Component, and (b) serves only to 126 | enable use of the work with that Major Component, or to implement a Standard 127 | Interface for which an implementation is available to the public in source code form. 128 | A “Major Component”, in this context, means a major essential component 129 | (kernel, window system, and so on) of the specific operating system (if any) on which 130 | the executable work runs, or a compiler used to produce the work, or an object code 131 | interpreter used to run it. 132 | 133 | The “Corresponding Source” for a work in object code form means all the 134 | source code needed to generate, install, and (for an executable work) run the object 135 | code and to modify the work, including scripts to control those activities. However, 136 | it does not include the work's System Libraries, or general-purpose tools or 137 | generally available free programs which are used unmodified in performing those 138 | activities but which are not part of the work. For example, Corresponding Source 139 | includes interface definition files associated with source files for the work, and 140 | the source code for shared libraries and dynamically linked subprograms that the work 141 | is specifically designed to require, such as by intimate data communication or 142 | control flow between those subprograms and other parts of the work. 143 | 144 | The Corresponding Source need not include anything that users can regenerate 145 | automatically from other parts of the Corresponding Source. 146 | 147 | The Corresponding Source for a work in source code form is that same work. 148 | 149 | ### 2. Basic Permissions. 150 | 151 | All rights granted under this License are granted for the term of copyright on the 152 | Program, and are irrevocable provided the stated conditions are met. This License 153 | explicitly affirms your unlimited permission to run the unmodified Program. The 154 | output from running a covered work is covered by this License only if the output, 155 | given its content, constitutes a covered work. This License acknowledges your rights 156 | of fair use or other equivalent, as provided by copyright law. 157 | 158 | You may make, run and propagate covered works that you do not convey, without 159 | conditions so long as your license otherwise remains in force. You may convey covered 160 | works to others for the sole purpose of having them make modifications exclusively 161 | for you, or provide you with facilities for running those works, provided that you 162 | comply with the terms of this License in conveying all material for which you do not 163 | control copyright. Those thus making or running the covered works for you must do so 164 | exclusively on your behalf, under your direction and control, on terms that prohibit 165 | them from making any copies of your copyrighted material outside their relationship 166 | with you. 167 | 168 | Conveying under any other circumstances is permitted solely under the conditions 169 | stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 170 | 171 | ### 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 172 | 173 | No covered work shall be deemed part of an effective technological measure under any 174 | applicable law fulfilling obligations under article 11 of the WIPO copyright treaty 175 | adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention 176 | of such measures. 177 | 178 | When you convey a covered work, you waive any legal power to forbid circumvention of 179 | technological measures to the extent such circumvention is effected by exercising 180 | rights under this License with respect to the covered work, and you disclaim any 181 | intention to limit operation or modification of the work as a means of enforcing, 182 | against the work's users, your or third parties' legal rights to forbid circumvention 183 | of technological measures. 184 | 185 | ### 4. Conveying Verbatim Copies. 186 | 187 | You may convey verbatim copies of the Program's source code as you receive it, in any 188 | medium, provided that you conspicuously and appropriately publish on each copy an 189 | appropriate copyright notice; keep intact all notices stating that this License and 190 | any non-permissive terms added in accord with section 7 apply to the code; keep 191 | intact all notices of the absence of any warranty; and give all recipients a copy of 192 | this License along with the Program. 193 | 194 | You may charge any price or no price for each copy that you convey, and you may offer 195 | support or warranty protection for a fee. 196 | 197 | ### 5. Conveying Modified Source Versions. 198 | 199 | You may convey a work based on the Program, or the modifications to produce it from 200 | the Program, in the form of source code under the terms of section 4, provided that 201 | you also meet all of these conditions: 202 | 203 | * **a)** The work must carry prominent notices stating that you modified it, and giving a 204 | relevant date. 205 | * **b)** The work must carry prominent notices stating that it is released under this 206 | License and any conditions added under section 7. This requirement modifies the 207 | requirement in section 4 to “keep intact all notices”. 208 | * **c)** You must license the entire work, as a whole, under this License to anyone who 209 | comes into possession of a copy. This License will therefore apply, along with any 210 | applicable section 7 additional terms, to the whole of the work, and all its parts, 211 | regardless of how they are packaged. This License gives no permission to license the 212 | work in any other way, but it does not invalidate such permission if you have 213 | separately received it. 214 | * **d)** If the work has interactive user interfaces, each must display Appropriate Legal 215 | Notices; however, if the Program has interactive interfaces that do not display 216 | Appropriate Legal Notices, your work need not make them do so. 217 | 218 | A compilation of a covered work with other separate and independent works, which are 219 | not by their nature extensions of the covered work, and which are not combined with 220 | it such as to form a larger program, in or on a volume of a storage or distribution 221 | medium, is called an “aggregate” if the compilation and its resulting 222 | copyright are not used to limit the access or legal rights of the compilation's users 223 | beyond what the individual works permit. Inclusion of a covered work in an aggregate 224 | does not cause this License to apply to the other parts of the aggregate. 225 | 226 | ### 6. Conveying Non-Source Forms. 227 | 228 | You may convey a covered work in object code form under the terms of sections 4 and 229 | 5, provided that you also convey the machine-readable Corresponding Source under the 230 | terms of this License, in one of these ways: 231 | 232 | * **a)** Convey the object code in, or embodied in, a physical product (including a 233 | physical distribution medium), accompanied by the Corresponding Source fixed on a 234 | durable physical medium customarily used for software interchange. 235 | * **b)** Convey the object code in, or embodied in, a physical product (including a 236 | physical distribution medium), accompanied by a written offer, valid for at least 237 | three years and valid for as long as you offer spare parts or customer support for 238 | that product model, to give anyone who possesses the object code either (1) a copy of 239 | the Corresponding Source for all the software in the product that is covered by this 240 | License, on a durable physical medium customarily used for software interchange, for 241 | a price no more than your reasonable cost of physically performing this conveying of 242 | source, or (2) access to copy the Corresponding Source from a network server at no 243 | charge. 244 | * **c)** Convey individual copies of the object code with a copy of the written offer to 245 | provide the Corresponding Source. This alternative is allowed only occasionally and 246 | noncommercially, and only if you received the object code with such an offer, in 247 | accord with subsection 6b. 248 | * **d)** Convey the object code by offering access from a designated place (gratis or for 249 | a charge), and offer equivalent access to the Corresponding Source in the same way 250 | through the same place at no further charge. You need not require recipients to copy 251 | the Corresponding Source along with the object code. If the place to copy the object 252 | code is a network server, the Corresponding Source may be on a different server 253 | (operated by you or a third party) that supports equivalent copying facilities, 254 | provided you maintain clear directions next to the object code saying where to find 255 | the Corresponding Source. Regardless of what server hosts the Corresponding Source, 256 | you remain obligated to ensure that it is available for as long as needed to satisfy 257 | these requirements. 258 | * **e)** Convey the object code using peer-to-peer transmission, provided you inform 259 | other peers where the object code and Corresponding Source of the work are being 260 | offered to the general public at no charge under subsection 6d. 261 | 262 | A separable portion of the object code, whose source code is excluded from the 263 | Corresponding Source as a System Library, need not be included in conveying the 264 | object code work. 265 | 266 | A “User Product” is either (1) a “consumer product”, which 267 | means any tangible personal property which is normally used for personal, family, or 268 | household purposes, or (2) anything designed or sold for incorporation into a 269 | dwelling. In determining whether a product is a consumer product, doubtful cases 270 | shall be resolved in favor of coverage. For a particular product received by a 271 | particular user, “normally used” refers to a typical or common use of 272 | that class of product, regardless of the status of the particular user or of the way 273 | in which the particular user actually uses, or expects or is expected to use, the 274 | product. A product is a consumer product regardless of whether the product has 275 | substantial commercial, industrial or non-consumer uses, unless such uses represent 276 | the only significant mode of use of the product. 277 | 278 | “Installation Information” for a User Product means any methods, 279 | procedures, authorization keys, or other information required to install and execute 280 | modified versions of a covered work in that User Product from a modified version of 281 | its Corresponding Source. The information must suffice to ensure that the continued 282 | functioning of the modified object code is in no case prevented or interfered with 283 | solely because modification has been made. 284 | 285 | If you convey an object code work under this section in, or with, or specifically for 286 | use in, a User Product, and the conveying occurs as part of a transaction in which 287 | the right of possession and use of the User Product is transferred to the recipient 288 | in perpetuity or for a fixed term (regardless of how the transaction is 289 | characterized), the Corresponding Source conveyed under this section must be 290 | accompanied by the Installation Information. But this requirement does not apply if 291 | neither you nor any third party retains the ability to install modified object code 292 | on the User Product (for example, the work has been installed in ROM). 293 | 294 | The requirement to provide Installation Information does not include a requirement to 295 | continue to provide support service, warranty, or updates for a work that has been 296 | modified or installed by the recipient, or for the User Product in which it has been 297 | modified or installed. Access to a network may be denied when the modification itself 298 | materially and adversely affects the operation of the network or violates the rules 299 | and protocols for communication across the network. 300 | 301 | Corresponding Source conveyed, and Installation Information provided, in accord with 302 | this section must be in a format that is publicly documented (and with an 303 | implementation available to the public in source code form), and must require no 304 | special password or key for unpacking, reading or copying. 305 | 306 | ### 7. Additional Terms. 307 | 308 | “Additional permissions” are terms that supplement the terms of this 309 | License by making exceptions from one or more of its conditions. Additional 310 | permissions that are applicable to the entire Program shall be treated as though they 311 | were included in this License, to the extent that they are valid under applicable 312 | law. If additional permissions apply only to part of the Program, that part may be 313 | used separately under those permissions, but the entire Program remains governed by 314 | this License without regard to the additional permissions. 315 | 316 | When you convey a copy of a covered work, you may at your option remove any 317 | additional permissions from that copy, or from any part of it. (Additional 318 | permissions may be written to require their own removal in certain cases when you 319 | modify the work.) You may place additional permissions on material, added by you to a 320 | covered work, for which you have or can give appropriate copyright permission. 321 | 322 | Notwithstanding any other provision of this License, for material you add to a 323 | covered work, you may (if authorized by the copyright holders of that material) 324 | supplement the terms of this License with terms: 325 | 326 | * **a)** Disclaiming warranty or limiting liability differently from the terms of 327 | sections 15 and 16 of this License; or 328 | * **b)** Requiring preservation of specified reasonable legal notices or author 329 | attributions in that material or in the Appropriate Legal Notices displayed by works 330 | containing it; or 331 | * **c)** Prohibiting misrepresentation of the origin of that material, or requiring that 332 | modified versions of such material be marked in reasonable ways as different from the 333 | original version; or 334 | * **d)** Limiting the use for publicity purposes of names of licensors or authors of the 335 | material; or 336 | * **e)** Declining to grant rights under trademark law for use of some trade names, 337 | trademarks, or service marks; or 338 | * **f)** Requiring indemnification of licensors and authors of that material by anyone 339 | who conveys the material (or modified versions of it) with contractual assumptions of 340 | liability to the recipient, for any liability that these contractual assumptions 341 | directly impose on those licensors and authors. 342 | 343 | All other non-permissive additional terms are considered “further 344 | restrictions” within the meaning of section 10. If the Program as you received 345 | it, or any part of it, contains a notice stating that it is governed by this License 346 | along with a term that is a further restriction, you may remove that term. If a 347 | license document contains a further restriction but permits relicensing or conveying 348 | under this License, you may add to a covered work material governed by the terms of 349 | that license document, provided that the further restriction does not survive such 350 | relicensing or conveying. 351 | 352 | If you add terms to a covered work in accord with this section, you must place, in 353 | the relevant source files, a statement of the additional terms that apply to those 354 | files, or a notice indicating where to find the applicable terms. 355 | 356 | Additional terms, permissive or non-permissive, may be stated in the form of a 357 | separately written license, or stated as exceptions; the above requirements apply 358 | either way. 359 | 360 | ### 8. Termination. 361 | 362 | You may not propagate or modify a covered work except as expressly provided under 363 | this License. Any attempt otherwise to propagate or modify it is void, and will 364 | automatically terminate your rights under this License (including any patent licenses 365 | granted under the third paragraph of section 11). 366 | 367 | However, if you cease all violation of this License, then your license from a 368 | particular copyright holder is reinstated (a) provisionally, unless and until the 369 | copyright holder explicitly and finally terminates your license, and (b) permanently, 370 | if the copyright holder fails to notify you of the violation by some reasonable means 371 | prior to 60 days after the cessation. 372 | 373 | Moreover, your license from a particular copyright holder is reinstated permanently 374 | if the copyright holder notifies you of the violation by some reasonable means, this 375 | is the first time you have received notice of violation of this License (for any 376 | work) from that copyright holder, and you cure the violation prior to 30 days after 377 | your receipt of the notice. 378 | 379 | Termination of your rights under this section does not terminate the licenses of 380 | parties who have received copies or rights from you under this License. If your 381 | rights have been terminated and not permanently reinstated, you do not qualify to 382 | receive new licenses for the same material under section 10. 383 | 384 | ### 9. Acceptance Not Required for Having Copies. 385 | 386 | You are not required to accept this License in order to receive or run a copy of the 387 | Program. Ancillary propagation of a covered work occurring solely as a consequence of 388 | using peer-to-peer transmission to receive a copy likewise does not require 389 | acceptance. However, nothing other than this License grants you permission to 390 | propagate or modify any covered work. These actions infringe copyright if you do not 391 | accept this License. Therefore, by modifying or propagating a covered work, you 392 | indicate your acceptance of this License to do so. 393 | 394 | ### 10. Automatic Licensing of Downstream Recipients. 395 | 396 | Each time you convey a covered work, the recipient automatically receives a license 397 | from the original licensors, to run, modify and propagate that work, subject to this 398 | License. You are not responsible for enforcing compliance by third parties with this 399 | License. 400 | 401 | An “entity transaction” is a transaction transferring control of an 402 | organization, or substantially all assets of one, or subdividing an organization, or 403 | merging organizations. If propagation of a covered work results from an entity 404 | transaction, each party to that transaction who receives a copy of the work also 405 | receives whatever licenses to the work the party's predecessor in interest had or 406 | could give under the previous paragraph, plus a right to possession of the 407 | Corresponding Source of the work from the predecessor in interest, if the predecessor 408 | has it or can get it with reasonable efforts. 409 | 410 | You may not impose any further restrictions on the exercise of the rights granted or 411 | affirmed under this License. For example, you may not impose a license fee, royalty, 412 | or other charge for exercise of rights granted under this License, and you may not 413 | initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging 414 | that any patent claim is infringed by making, using, selling, offering for sale, or 415 | importing the Program or any portion of it. 416 | 417 | ### 11. Patents. 418 | 419 | A “contributor” is a copyright holder who authorizes use under this 420 | License of the Program or a work on which the Program is based. The work thus 421 | licensed is called the contributor's “contributor version”. 422 | 423 | A contributor's “essential patent claims” are all patent claims owned or 424 | controlled by the contributor, whether already acquired or hereafter acquired, that 425 | would be infringed by some manner, permitted by this License, of making, using, or 426 | selling its contributor version, but do not include claims that would be infringed 427 | only as a consequence of further modification of the contributor version. For 428 | purposes of this definition, “control” includes the right to grant patent 429 | sublicenses in a manner consistent with the requirements of this License. 430 | 431 | Each contributor grants you a non-exclusive, worldwide, royalty-free patent license 432 | under the contributor's essential patent claims, to make, use, sell, offer for sale, 433 | import and otherwise run, modify and propagate the contents of its contributor 434 | version. 435 | 436 | In the following three paragraphs, a “patent license” is any express 437 | agreement or commitment, however denominated, not to enforce a patent (such as an 438 | express permission to practice a patent or covenant not to sue for patent 439 | infringement). To “grant” such a patent license to a party means to make 440 | such an agreement or commitment not to enforce a patent against the party. 441 | 442 | If you convey a covered work, knowingly relying on a patent license, and the 443 | Corresponding Source of the work is not available for anyone to copy, free of charge 444 | and under the terms of this License, through a publicly available network server or 445 | other readily accessible means, then you must either (1) cause the Corresponding 446 | Source to be so available, or (2) arrange to deprive yourself of the benefit of the 447 | patent license for this particular work, or (3) arrange, in a manner consistent with 448 | the requirements of this License, to extend the patent license to downstream 449 | recipients. “Knowingly relying” means you have actual knowledge that, but 450 | for the patent license, your conveying the covered work in a country, or your 451 | recipient's use of the covered work in a country, would infringe one or more 452 | identifiable patents in that country that you have reason to believe are valid. 453 | 454 | If, pursuant to or in connection with a single transaction or arrangement, you 455 | convey, or propagate by procuring conveyance of, a covered work, and grant a patent 456 | license to some of the parties receiving the covered work authorizing them to use, 457 | propagate, modify or convey a specific copy of the covered work, then the patent 458 | license you grant is automatically extended to all recipients of the covered work and 459 | works based on it. 460 | 461 | A patent license is “discriminatory” if it does not include within the 462 | scope of its coverage, prohibits the exercise of, or is conditioned on the 463 | non-exercise of one or more of the rights that are specifically granted under this 464 | License. You may not convey a covered work if you are a party to an arrangement with 465 | a third party that is in the business of distributing software, under which you make 466 | payment to the third party based on the extent of your activity of conveying the 467 | work, and under which the third party grants, to any of the parties who would receive 468 | the covered work from you, a discriminatory patent license (a) in connection with 469 | copies of the covered work conveyed by you (or copies made from those copies), or (b) 470 | primarily for and in connection with specific products or compilations that contain 471 | the covered work, unless you entered into that arrangement, or that patent license 472 | was granted, prior to 28 March 2007. 473 | 474 | Nothing in this License shall be construed as excluding or limiting any implied 475 | license or other defenses to infringement that may otherwise be available to you 476 | under applicable patent law. 477 | 478 | ### 12. No Surrender of Others' Freedom. 479 | 480 | If conditions are imposed on you (whether by court order, agreement or otherwise) 481 | that contradict the conditions of this License, they do not excuse you from the 482 | conditions of this License. If you cannot convey a covered work so as to satisfy 483 | simultaneously your obligations under this License and any other pertinent 484 | obligations, then as a consequence you may not convey it at all. For example, if you 485 | agree to terms that obligate you to collect a royalty for further conveying from 486 | those to whom you convey the Program, the only way you could satisfy both those terms 487 | and this License would be to refrain entirely from conveying the Program. 488 | 489 | ### 13. Use with the GNU Affero General Public License. 490 | 491 | Notwithstanding any other provision of this License, you have permission to link or 492 | combine any covered work with a work licensed under version 3 of the GNU Affero 493 | General Public License into a single combined work, and to convey the resulting work. 494 | The terms of this License will continue to apply to the part which is the covered 495 | work, but the special requirements of the GNU Affero General Public License, section 496 | 13, concerning interaction through a network will apply to the combination as such. 497 | 498 | ### 14. Revised Versions of this License. 499 | 500 | The Free Software Foundation may publish revised and/or new versions of the GNU 501 | General Public License from time to time. Such new versions will be similar in spirit 502 | to the present version, but may differ in detail to address new problems or concerns. 503 | 504 | Each version is given a distinguishing version number. If the Program specifies that 505 | a certain numbered version of the GNU General Public License “or any later 506 | version” applies to it, you have the option of following the terms and 507 | conditions either of that numbered version or of any later version published by the 508 | Free Software Foundation. If the Program does not specify a version number of the GNU 509 | General Public License, you may choose any version ever published by the Free 510 | Software Foundation. 511 | 512 | If the Program specifies that a proxy can decide which future versions of the GNU 513 | General Public License can be used, that proxy's public statement of acceptance of a 514 | version permanently authorizes you to choose that version for the Program. 515 | 516 | Later license versions may give you additional or different permissions. However, no 517 | additional obligations are imposed on any author or copyright holder as a result of 518 | your choosing to follow a later version. 519 | 520 | ### 15. Disclaimer of Warranty. 521 | 522 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. 523 | EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 524 | PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER 525 | EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 526 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE 527 | QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE 528 | DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 529 | 530 | ### 16. Limitation of Liability. 531 | 532 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY 533 | COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS 534 | PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, 535 | INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE 536 | PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE 537 | OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE 538 | WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 539 | POSSIBILITY OF SUCH DAMAGES. 540 | 541 | ### 17. Interpretation of Sections 15 and 16. 542 | 543 | If the disclaimer of warranty and limitation of liability provided above cannot be 544 | given local legal effect according to their terms, reviewing courts shall apply local 545 | law that most closely approximates an absolute waiver of all civil liability in 546 | connection with the Program, unless a warranty or assumption of liability accompanies 547 | a copy of the Program in return for a fee. 548 | 549 | END OF TERMS AND CONDITIONS 550 | 551 | ## How to Apply These Terms to Your New Programs 552 | 553 | If you develop a new program, and you want it to be of the greatest possible use to 554 | the public, the best way to achieve this is to make it free software which everyone 555 | can redistribute and change under these terms. 556 | 557 | To do so, attach the following notices to the program. It is safest to attach them 558 | to the start of each source file to most effectively state the exclusion of warranty; 559 | and each file should have at least the “copyright” line and a pointer to 560 | where the full notice is found. 561 | 562 | 563 | Copyright (C) 564 | 565 | This program is free software: you can redistribute it and/or modify 566 | it under the terms of the GNU General Public License as published by 567 | the Free Software Foundation, either version 3 of the License, or 568 | (at your option) any later version. 569 | 570 | This program is distributed in the hope that it will be useful, 571 | but WITHOUT ANY WARRANTY; without even the implied warranty of 572 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 573 | GNU General Public License for more details. 574 | 575 | You should have received a copy of the GNU General Public License 576 | along with this program. If not, see . 577 | 578 | Also add information on how to contact you by electronic and paper mail. 579 | 580 | If the program does terminal interaction, make it output a short notice like this 581 | when it starts in an interactive mode: 582 | 583 | Copyright (C) 584 | This program comes with ABSOLUTELY NO WARRANTY; for details type 'show w'. 585 | This is free software, and you are welcome to redistribute it 586 | under certain conditions; type 'show c' for details. 587 | 588 | The hypothetical commands 'show w' and 'show c' should show the appropriate parts of 589 | the General Public License. Of course, your program's commands might be different; 590 | for a GUI interface, you would use an “about box”. 591 | 592 | You should also get your employer (if you work as a programmer) or school, if any, to 593 | sign a “copyright disclaimer” for the program, if necessary. For more 594 | information on this, and how to apply and follow the GNU GPL, see 595 | <>. 596 | 597 | The GNU General Public License does not permit incorporating your program into 598 | proprietary programs. If your program is a subroutine library, you may consider it 599 | more useful to permit linking proprietary applications with the library. If this is 600 | what you want to do, use the GNU Lesser General Public License instead of this 601 | License. But first, please read 602 | <>. --------------------------------------------------------------------------------