Megre with develop

This commit is contained in:
dismine 2015-01-01 12:58:32 +02:00
commit ace8f00e16
945 changed files with 198741 additions and 41778 deletions

View File

@ -19,9 +19,68 @@ syntax: glob
# Ignore this directory.
html/
latex/
bin/
moc/
obj/
uic/
rcc/
man/
# Ignore file used QtCreator for user profile.
# Ignore Coverity Scan Build Tool
cov-int/
# Compiled Object files
*.slo
*.lo
*.o
*.obj
# Precompiled Headers
*.gch
*.pch
# Compiled Dynamic libraries
*.so
*.dylib
*.dll
# Fortran module files
*.mod
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# Executables
*.exe
*.out
*.app
# Qt-es
/.qmake.cache
/.qmake.stash
*.pro.user
*.pro.user.*
*.moc
moc_*.cpp
qrc_*.cpp
ui_*.h
Makefile*
*-build-*
# Ignore file Qt translation.
# Ignore Qt translation file .
*.qm
# QtCreator
*.autosave
# Ignore Mercurial .orig files
*.orig
*.rej
# QtCtreator Qml
*.qmlproject.user
*.qmlproject.user.*

View File

@ -1,5 +0,0 @@
Author:
(*) Roman Telezhinsky <dismine@gmail.com>
Founder of the project.

14
AUTHORS.txt Normal file
View File

@ -0,0 +1,14 @@
Our Team:
(*) Roman Telezhynskyi <dismine@gmail.com>
Maintainer and founder of the project.
(*) Christine Neupert <enaisoc@googlemail.com>
Testing, translation.
(*) Patrick Proy <patrick@proy.org>
Developing.
(*) Lindsay Williams <linzkitt@gmail.com>
Design logo.

63
README
View File

@ -1,63 +0,0 @@
Pattern making program
Copyright (C) 2013 Roman Telezhinsky <dismine@gmail.com>
https://dismine@bitbucket.org/dismine/valentina
Valentina
==========
Open source project of creating a pattern making program, whose allow
create and modeling patterns of clothing.
Supported Platforms
===================
The standalone binary packages support the following platforms:
Windows XP SP2 or later
Ubuntu Linux 11.10 (32-bit) or later
Building the sources requires Qt 5.0.0 or later.
Compiling Valentina
====================
Prerequisites:
* Qt 5.0.0 or later (On Unix development packages needed)
* mercurial
* On Unix:
- ccache
- g++ (at least GCC 4.6 is needed and GCC 4.8 is recommended)
* On Windows:
- MinGW or Visual Studio
The installed toolchains have to match the one Qt was compiled with.
You can build Valentina with
cd $SOURCE_DIRECTORY
qmake -r
make (or mingw32-make or nmake or jom, depending on your platform)
Note:In order to build and use Valentina, the PATH environment variable
needs to be extended:
PATH - to locate qmake, moc and other Qt tools
This is done by adding c:\Qt\%VERSION%\bin to the PATH variable.
For newer versions of Windows, PATH can be extended through the
Control Panel|System|Advanced|Environment variables menu.
You may also need to ensure that the locations of your compiler and
other build tools are listed in the PATH variable. This will depend on
your choice of software development environment.
LICENSING
==========
Valentina is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Valentina is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
See LICENSE file for further information

84
README.txt Normal file
View File

@ -0,0 +1,84 @@
Pattern making program
Copyright (C) 2013-2014 Roman Telezhynskyi <dismine@gmail.com>
Valentina Web page: http://www.valentina-project.org/
Valentina user manual https://bitbucket.org/dismine/valentina/wiki/manual/Content
Valentina main repository: https://bitbucket.org/dismine/valentina/overview
Valentina mail list (forum) https://groups.google.com/forum/#!forum/valentina-project-list
PPA for Ubuntu (develop): https://launchpad.net/~dismine/+archive/valentina-dev
Help translate https://www.transifex.com/organization/valentina
Valentina
==========
Valentina is a cross-platform patternmaking program which allows designers
to create and model patterns of clothing. This software allows pattern
creation, using either standard sizing tables or an individuals set of
measurements. It blends new technologies with traditional methods to create
a unique pattern making tool.
Supported Platforms
===================
The standalone binary packages support the following platforms:
Windows XP SP2 or later
Ubuntu Linux 14.04 (32-bit) or later
Building the sources requires Qt 5.2.1 or later.
Compiling Valentina
====================
Prerequisites:
* Qt 5.2.1 or later (On Unix development packages needed)
* mercurial
* On Unix:
- ccache
- g++ (at least GCC 4.6 is needed and GCC 4.8 is recommended) or
clang (clang 3.4 recommended)
- xpdf package (tool pdftops).
* On Windows:
- MinGW
- Xpdf is an open source viewer for Portable Document Format (PDF)
files. Website http://www.foolabs.com/xpdf/. Put tool pdftops.exe
in the same directory with Valentina's binary file.
The installed toolchains have to match the one Qt was compiled with.
You can build Valentina with
cd $SOURCE_DIRECTORY
qmake Valentina.pro -r (or qmake-qt5, depending on your platform)
make (or mingw32-make or nmake or jom, depending on your platform)
Note:In order to build and use Valentina, the PATH environment variable
needs to be extended:
PATH - to locate qmake, moc and other Qt tools
This is done by adding c:\Qt\%VERSION%\bin to the PATH variable.
For newer versions of Windows, PATH can be extended through the
Control Panel|System|Advanced|Environment variables menu.
You may also need to ensure that the locations of your compiler and
other build tools are listed in the PATH variable. This will depend on
your choice of software development environment.
Unix systems:
Default prefix for command "make install" is /usr. For using another
prefix build with qmake command:
qmake PREFIX=/usr/local Valentina.pro -r
where /usr/local is a new prefix for installation.
LICENSING
==========
Valentina is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Valentina is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
See LICENSE file for further information

33
TODO
View File

@ -1,33 +0,0 @@
Valentina TODO file.
For more information see https://bitbucket.org/dismine/valentina/issues
(c) Valentina Team 2013
* Rotate details.
* Reflection details.
* Theme with icon for windows version of program.
* Label on detail.
* Checking integrity of file.
* Description of pattern.
* Type of lines.
* New way create detail.
* Tuck transfer.
* Point on arc, curve and curve path.
* Union details.
* Сonditions.
* New format name.
* Standard table of measurements.
* Localization.
* Window "Option".
* Undo/redo functionality in applications.
* Checking file integrity.
* Sketch drawing.
* Graduation card.
* Individual mode of construction pattern.
* Description about pattern in SVG file.
* Visualization.

541
Valentina.pri Normal file
View File

@ -0,0 +1,541 @@
defineTest(minQtVersion) {
maj = $$1
min = $$2
patch = $$3
isEqual(QT_MAJOR_VERSION, $$maj) {
isEqual(QT_MINOR_VERSION, $$min) {
isEqual(QT_PATCH_VERSION, $$patch) {
return(true)
}
greaterThan(QT_PATCH_VERSION, $$patch) {
return(true)
}
}
greaterThan(QT_MINOR_VERSION, $$min) {
return(true)
}
}
greaterThan(QT_MAJOR_VERSION, $$maj) {
return(true)
}
return(false)
}
# Copies the given files to the destination directory
defineTest(copyToDestdir) {
files = $$1
DDIR = $$2
mkpath($$DDIR)
message("----------------------------------------------begin------------------------------------------------")
message("Copy to" $$DDIR "after link")
for(FILE, files) {
# Replace slashes in paths with backslashes for Windows
win32{
FILE ~= s,/,\\,g
DDIR ~= s,/,\\,g
}
QMAKE_POST_LINK += $$QMAKE_COPY $$quote($$FILE) $$quote($$DDIR) $$escape_expand(\\n\\t)
message("Command:" $$QMAKE_COPY $$quote($$FILE) $$quote($$DDIR))
}
export(QMAKE_POST_LINK)
message("----------------------------------------------end---------------------------------------------------")
}
# We use precompiled headers for more fast compilation source code.
defineReplace(set_PCH){
macx:clang*{
# Precompiled headers don't work with clang on macx.
} else {
CONFIG += precompile_header # Turn on creation precompiled headers (PCH).
export(CONFIG) # export value to global variable.
PRECOMPILED_HEADER = stable.h # Header file with all all static headers: libraries, static local headers.
export(PRECOMPILED_HEADER) # export value to global variable
win32-msvc* {
PRECOMPILED_SOURCE = stable.cpp # MSVC need also cpp file.
export(PRECOMPILED_SOURCE) # export value to global variable.
}
}
return(true)
}
defineReplace(enable_ccache){
# ccache support only Unix systems.
unix:{
# This need for turn on ccache.
*-g++{
QMAKE_CC = ccache gcc
export(QMAKE_CC) # export value to global variable.
QMAKE_CXX = ccache g++
export(QMAKE_CXX) # export value to global variable.
}
clang*{
QMAKE_CC = ccache clang
export(QMAKE_CC) # export value to global variable.
QMAKE_CXX = ccache clang++
export(QMAKE_CXX) # export value to global variable.
}
}
return(true)
}
# Default prefix. Use for creation install path.
DEFAULT_PREFIX = /usr
# In debug mode on Unix system we use all usefull for us compilers keys for checking errors.
# Also trying make all possible for speed up build time.
unix {
# Key -isystem disable checking errors in system headers. Mark ignore warnings Qt headers.
ISYSTEM += \
-isystem "$$[QT_INSTALL_HEADERS]" \
-isystem "$$[QT_INSTALL_HEADERS]/QtWidgets" \
-isystem "$$[QT_INSTALL_HEADERS]/QtXml" \
-isystem "$$[QT_INSTALL_HEADERS]/QtGui" \
-isystem "$$[QT_INSTALL_HEADERS]/QtXmlPatterns" \
-isystem "$$[QT_INSTALL_HEADERS]/QtCore"
# Usefull GCC warnings keys.
GCC_DEBUG_CXXFLAGS += \
-O0 \ # Turn off oprimization.
$$ISYSTEM \ # Ignore warnings Qt headers.
# Last gdb doesn't show debug symbols with Qt Creator (issue with Python 3 and debug scripts that use Python 2.7).
# Solution to use older version gdb, that's why we use old standard of debug information.
-gdwarf-3 \
-Wall \
-Wextra \
-pedantic \
-Weffc++ \
-Woverloaded-virtual \
-Wctor-dtor-privacy \
-Wnon-virtual-dtor \
-Wold-style-cast \
-Wconversion \
-Winit-self \
-Wstack-protector \
-Wunreachable-code \
-Wcast-align \
-Wcast-qual \
-Wdisabled-optimization \
-Wfloat-equal \
-Wformat=2 \
-Wimport \
-Wmissing-include-dirs \
-Wpacked \
-Wredundant-decls \
-Winline \
-Winvalid-pch \
-Wunsafe-loop-optimizations \
-Wlong-long \
-Wmissing-format-attribute \
-Wswitch-default \
-Wuninitialized \
-Wvariadic-macros \
-Wlogical-op \
-Wnoexcept \
-Wmissing-noreturn \
-Wpointer-arith \
-Wstrict-null-sentinel \
-Wstrict-overflow=5 \
-Wundef \
-Wno-unused \
-ftrapv \
-fsanitize=address #gccs 4.8.0 Address Sanitizer
# Usefull Clang warnings keys.
CLANG_DEBUG_CXXFLAGS += \
-O0 \ # Turn off oprimization.
$$ISYSTEM \ # Ignore warnings in Qt headers.
# Last gdb doesn't show debug symbols with Qt Creator (issue with Python 3 and debug scripts that use Python 2.7).
# Solution to use older version gdb, that's why we use old standard of debug information.
-gdwarf-3 \
-fparse-all-comments \
-Wabi \
-Wabstract-final-class \
-Wabstract-vbase-init \
-Waddress \
-Waddress-of-array-temporary \
-Waddress-of-temporary \
-Waggregate-return \
-Wall \
-Wambiguous-macro \
-Wambiguous-member-template \
-Wanalyzer-incompatible-plugin \
-Wanonymous-pack-parens \
-Warc \
-Warc-abi \
-Warc-bridge-casts-disallowed-in-nonarc \
-Warc-maybe-repeated-use-of-weak \
-Warc-non-pod-memaccess \
-Warc-performSelector-leaks \
-Warc-repeated-use-of-weak \
-Warc-retain-cycles \
-Warc-unsafe-retained-assign \
-Warray-bounds \
-Warray-bounds-pointer-arithmetic \
-Wasm \
-Wasm-operand-widths \
-Wassign-enum \
-Watomic-properties \
-Watomic-property-with-user-defined-accessor \
-Wattributes \
-Wauto-import \
-Wauto-storage-class \
-Wauto-var-id \
-Wavailability \
-Wbackslash-newline-escape \
-Wbad-array-new-length \
-Wbad-function-cast \
-Wbind-to-temporary-copy \
-Wbitfield-constant-conversion \
-Wbitwise-op-parentheses \
-Wbool-conversion \
-Wbool-conversions \
-Wbuiltin-macro-redefined \
-Wbuiltin-requires-header \
-Wc++-compat \
-Wc++0x-compat \
-Wc++0x-extensions \
-Wc++0x-narrowing \
-Wc++11-compat \
-Wc++11-compat-pedantic \
-Wc++11-compat-reserved-user-defined-literal \
-Wc++11-extensions \
-Wc++11-extra-semi \
-Wc++11-long-long \
-Wc++11-narrowing \
-Wc11-extensions \
-Wcast-align \
-Wcast-of-sel-type \
-Wcast-qual \
-WCFString-literal \
-Wchar-align \
-Wchar-subscripts \
-Wcomment \
-Wcomments \
-Wcompare-distinct-pointer-types \
-Wcomplex-component-init \
-Wconditional-type-mismatch \
-Wconditional-uninitialized \
-Wconfig-macros \
-Wconstant-conversion \
-Wconstant-logical-operand \
-Wconstexpr-not-const \
-Wconversion \
-Wconversion-null \
-Wno-covered-switch-default \
-Wctor-dtor-privacy \
-Wcustom-atomic-properties \
-Wdangling-else \
-Wdangling-field \
-Wdangling-initializer-list \
-Wdeclaration-after-statement \
-Wdelegating-ctor-cycles \
-Wdelete-incomplete \
-Wdelete-non-virtual-dtor \
-Wdeprecated \
-Wdeprecated-declarations \
-Wdeprecated-implementations \
-Wdeprecated-objc-isa-usage \
-Wdeprecated-objc-pointer-introspection \
-Wdeprecated-objc-pointer-introspection-performSelector \
-Wdeprecated-register \
-Wdeprecated-writable-strings \
-Wdirect-ivar-access \
-Wdisabled-macro-expansion \
-Wdisabled-optimization \
-Wdiscard-qual \
-Wdistributed-object-modifiers \
-Wdiv-by-zero \
-Wdivision-by-zero \
-Wdocumentation \
-Wdocumentation-deprecated-sync \
-Wdocumentation-html \
-Wdollar-in-identifier-extension \
-Wduplicate-decl-specifier \
-Wduplicate-enum \
-Wduplicate-method-arg \
-Wduplicate-method-match \
-Wdynamic-class-memaccess \
-Weffc++ \
-Wembedded-directive \
-Wempty-body \
-Wempty-translation-unit \
-Wendif-labels \
-Wenum-compare \
-Wenum-conversion \
-Wexplicit-ownership-type \
-Wextended-offsetof \
-Wextern-initializer \
-Wextra \
-Wextra-semi \
-Wextra-tokens \
-Wflexible-array-extensions \
-Wfloat-equal \
-Wformat \
-Wformat-extra-args \
-Wformat-invalid-specifier \
-Wformat-non-iso \
-Wformat-nonliteral \
-Wformat-security \
-Wformat-y2k \
-Wformat-zero-length \
-Wformat=2 \
-Wfour-char-constants \
-Wgcc-compat \
-Wgnu \
-Wgnu-array-member-paren-init \
-Wgnu-designator \
-Wgnu-static-float-init \
-Wheader-guard \
-Wheader-hygiene \
-Widiomatic-parentheses \
-Wignored-attributes \
-Wignored-qualifiers \
-Wimplicit \
-Wimplicit-atomic-properties \
-Wimplicit-conversion-floating-point-to-bool \
-Wimplicit-exception-spec-mismatch \
-Wimplicit-fallthrough \
-Wimplicit-fallthrough-per-function \
-Wimplicit-function-declaration \
-Wimplicit-int \
-Wimplicit-retain-self \
-Wimport \
-Wimport-preprocessor-directive-pedantic \
-Wincompatible-library-redeclaration \
-Wincompatible-pointer-types \
-Wincompatible-pointer-types-discards-qualifiers \
-Wincomplete-implementation \
-Wincomplete-module \
-Wincomplete-umbrella \
-Winherited-variadic-ctor \
-Winit-self \
-Winitializer-overrides \
-Winline \
-Wint-conversion \
-Wint-conversions \
-Wint-to-pointer-cast \
-Wint-to-void-pointer-cast \
-Winteger-overflow \
-Winvalid-constexpr \
-Winvalid-iboutlet \
-Winvalid-noreturn \
-Winvalid-offsetof \
-Winvalid-pch \
-Winvalid-pp-token \
-Winvalid-source-encoding \
-Winvalid-token-paste \
-Wknr-promoted-parameter \
-Wlanguage-extension-token \
-Wlarge-by-value-copy \
-Wliteral-conversion \
-Wliteral-range \
-Wlocal-type-template-args \
-Wlogical-not-parentheses \
-Wlogical-op-parentheses \
-Wlong-long \
-Wloop-analysis \
-Wmain \
-Wmain-return-type \
-Wmalformed-warning-check \
-Wmethod-signatures \
-Wmicrosoft \
-Wmicrosoft-exists \
-Wmismatched-parameter-types \
-Wmismatched-return-types \
-Wmismatched-tags \
-Wmissing-braces \
-Wmissing-declarations \
-Wmissing-field-initializers \
-Wmissing-format-attribute \
-Wmissing-include-dirs \
-Wmissing-method-return-type \
-Wmissing-noreturn \
-Wmissing-prototypes \
-Wmissing-selector-name \
-Wmissing-sysroot \
-Wmissing-variable-declarations \
-Wmodule-conflict \
-Wmost \
-Wmultichar \
-Wnarrowing \
-Wnested-externs \
-Wnewline-eof \
-Wnon-gcc \
-Wnon-literal-null-conversion \
-Wnon-pod-varargs \
-Wnon-virtual-dtor \
-Wnonnull \
-Wnonportable-cfstrings \
-WNSObject-attribute \
-Wnull-arithmetic \
-Wnull-character \
-Wnull-conversion \
-Wnull-dereference \
-Wodr \
-Wold-style-cast \
-Wold-style-definition \
-Wout-of-line-declaration \
-Wover-aligned \
-Woverflow \
-Woverlength-strings \
-Woverloaded-shift-op-parentheses \
-Woverloaded-virtual \
-Woverriding-method-mismatch \
-Wpacked \
-Wparentheses \
-Wparentheses-equality \
-Wpedantic \
-Wpointer-arith \
-Wpointer-sign \
-Wpointer-to-int-cast \
-Wpointer-type-mismatch \
-Wpredefined-identifier-outside-function \
-Wprivate-extern \
-Wprotocol \
-Wprotocol-property-synthesis-ambiguity \
-Wreadonly-iboutlet-property \
-Wreceiver-expr \
-Wreceiver-forward-class \
-Wreceiver-is-weak \
-Wredundant-decls \
-Wreinterpret-base-class \
-Wreorder \
-Wrequires-super-attribute \
-Wreserved-user-defined-literal \
-Wreturn-stack-address \
-Wreturn-type \
-Wreturn-type-c-linkage \
-Wsection \
-Wselector \
-Wselector-type-mismatch \
-Wself-assign \
-Wself-assign-field \
-Wsemicolon-before-method-body \
-Wsentinel \
-Wsequence-point \
-Wserialized-diagnostics \
-Wshadow-ivar \
-Wshift-count-negative \
-Wshift-count-overflow \
-Wshift-op-parentheses \
-Wshift-overflow \
-Wshift-sign-overflow \
-Wshorten-64-to-32 \
-Wsign-compare \
-Wsign-conversion \
-Wsign-promo \
-Wsizeof-array-argument \
-Wsizeof-array-decay \
-Wsizeof-pointer-memaccess \
-Wsometimes-uninitialized \
-Wsource-uses-openmp \
-Wstack-protector \
-Wstatic-float-init \
-Wstatic-in-inline \
-Wstatic-local-in-inline \
-Wstatic-self-init \
-Wstrict-aliasing \
-Wstrict-aliasing=0 \
-Wstrict-aliasing=1 \
-Wstrict-aliasing=2 \
-Wstrict-overflow \
-Wstrict-overflow=0 \
-Wstrict-overflow=1 \
-Wstrict-overflow=2 \
-Wstrict-overflow=3 \
-Wstrict-overflow=4 \
-Wstrict-overflow=5 \
-Wstrict-prototypes \
-Wstrict-selector-match \
-Wstring-compare \
-Wstring-conversion \
-Wstring-plus-int \
-Wstrlcpy-strlcat-size \
-Wstrncat-size \
-Wsuper-class-method-mismatch \
-Wswitch \
-Wswitch-default \
-Wsynth \
-Wtautological-compare \
-Wtautological-constant-out-of-range-compare \
-Wtentative-definition-incomplete-type \
-Wthread-safety \
-Wthread-safety-analysis \
-Wthread-safety-attributes \
-Wthread-safety-beta \
-Wthread-safety-precise \
-Wtrigraphs \
-Wtype-limits \
-Wtype-safety \
-Wtypedef-redefinition \
-Wtypename-missing \
-Wundeclared-selector \
-Wundef \
-Wundefined-inline \
-Wundefined-internal \
-Wundefined-reinterpret-cast \
-Wunicode \
-Wunicode-whitespace \
-Wuninitialized \
-Wunknown-warning-option \
-Wunnamed-type-template-args \
-Wunneeded-internal-declaration \
-Wunneeded-member-function \
-Wunsequenced \
-Wunsupported-visibility \
-Wunused \
-Wunused-argument \
-Wunused-command-line-argument \
-Wunused-comparison \
-Wunused-exception-parameter \
-Wunused-function \
-Wunused-label \
-Wunused-member-function \
-Wunused-parameter \
-Wunused-private-field \
-Wunused-result \
-Wunused-sanitize-argument \
-Wunused-value \
-Wunused-variable \
-Wunused-volatile-lvalue \
-Wuser-defined-literals \
-Wvarargs \
-Wvariadic-macros \
-Wvector-conversion \
-Wvector-conversions \
-Wvexing-parse \
-Wvisibility \
-Wvla \
-Wvla-extension \
-Wvolatile-register-var \
-Wweak-template-vtables \
-Wweak-vtables \
-Wwrite-strings \
-Wzero-length-array \
-Qunused-arguments \
-fcolor-diagnostics
} else {
# Don't use additional GCC and Clang keys on Windows system.
# Can't find way mark ignore Qt header on Windows.
GCC_DEBUG_CXXFLAGS += \
-O0 \
-Wall \
-Wextra \
-pedantic \
-fno-omit-frame-pointer # Need for exchndl.dll
CLANG_DEBUG_CXXFLAGS += \
-O0 \
-Wall \
-Wextra \
-pedantic \
-fno-omit-frame-pointer # Need for exchndl.dll
}

View File

@ -1,133 +1,10 @@
#-------------------------------------------------
#
# Project created by QtCreator 2013-06-18T12:36:43
#
#-------------------------------------------------
include(Valentina.pri)
# Use out-of-source builds (shadow builds)
QT += core gui widgets xml svg
TEMPLATE = app
TARGET = valentina
CONFIG -= debug_and_release debug_and_release_target
CONFIG += c++11
#DEFINES += ...
# directory for executable file
DESTDIR = bin
# files created moc
MOC_DIR = moc
# objecs files
OBJECTS_DIR = obj
# files created rcc
RCC_DIR = rcc
# files created uic
UI_DIR = uic
include(src/src.pri)
include(src/container/container.pri)
include(src/dialogs/dialogs.pri)
include(src/exception/exception.pri)
include(src/geometry/geometry.pri)
include(src/tools/tools.pri)
include(src/widgets/widgets.pri)
include(src/xml/xml.pri)
RESOURCES += \
share/resources/icon.qrc \
share/resources/cursor.qrc
OTHER_FILES += share/resources/valentina.rc \
share/resources/icon/64x64/icon64x64.ico
TRANSLATIONS += share/translations/valentina_ru.ts \
share/translations/valentina_uk.ts
unix:QMAKE_CXX = ccache g++
CONFIG += precompile_header
# Precompiled headers (PCH)
PRECOMPILED_HEADER = src/stable.h
win32-msvc* {
PRECOMPILED_SOURCE = src/stable.cpp
#Check if Qt version >= 5.2.0
!minQtVersion(5, 2, 0) {
message("Cannot build Valentina with Qt version $${QT_VERSION}.")
error("Use at least Qt 5.2.0.")
}
CONFIG(debug, debug|release){
# Debug
*-g++{
QMAKE_CXXFLAGS += -isystem "/usr/include/qt5" -isystem "/usr/include/qt5/QtWidgets" \
-isystem "/usr/include/qt5/QtXml" -isystem "/usr/include/qt5/QtGui" \
-isystem "/usr/include/qt5/QtCore" -isystem "$${UI_DIR}" -isystem "$${MOC_DIR}" \
-isystem "$${RCC_DIR}" \
-Og -Wall -Wextra -pedantic -Weffc++ -Woverloaded-virtual -Wctor-dtor-privacy \
-Wnon-virtual-dtor -Wold-style-cast -Wconversion -Winit-self \
-Wunreachable-code -Wcast-align -Wcast-qual -Wdisabled-optimization -Wfloat-equal \
-Wformat -Wformat=2 -Wformat-nonliteral -Wformat-security -Wformat-y2k \
-Winvalid-pch -Wunsafe-loop-optimizations -Wlong-long -Wmissing-format-attribute \
-Wmissing-include-dirs -Wpacked -Wredundant-decls \
-Wswitch-default -Wswitch-enum -Wuninitialized -Wunused-parameter -Wvariadic-macros \
-Wlogical-op -Wnoexcept \
-Wstrict-null-sentinel -Wstrict-overflow=5 -Wundef -Wno-unused -gdwarf-3
}
}else{
# Release
*-g++{
QMAKE_CXXFLAGS += -O1
}
DEFINES += QT_NO_DEBUG_OUTPUT
}
message(Qt version: $$[QT_VERSION])
message(Qt is installed in $$[QT_INSTALL_PREFIX])
message(Qt resources can be found in the following locations:)
message(Documentation: $$[QT_INSTALL_DOCS])
message(Header files: $$[QT_INSTALL_HEADERS])
message(Libraries: $$[QT_INSTALL_LIBS])
message(Binary files (executables): $$[QT_INSTALL_BINS])
message(Plugins: $$[QT_INSTALL_PLUGINS])
message(Data files: $$[QT_INSTALL_DATA])
message(Translation files: $$[QT_INSTALL_TRANSLATIONS])
message(Settings: $$[QT_INSTALL_SETTINGS])
message(Examples: $$[QT_INSTALL_EXAMPLES])
win32:RC_FILE = share/resources/valentina.rc
# Remove generated files at cleaning
QMAKE_DISTCLEAN += $${DESTDIR}/* \
$${OBJECTS_DIR}/* \
$${UI_DIR}/* \
$${MOC_DIR}/* \
$${RCC_DIR}/*
unix {
#VARIABLES
isEmpty(PREFIX) {
PREFIX = /usr
}
BINDIR = $$PREFIX/bin
DATADIR =$$PREFIX/share
DEFINES += DATADIR=\\\"$$DATADIR\\\" PKGDATADIR=\\\"$$PKGDATADIR\\\"
#MAKE INSTALL
target.path = $$BINDIR
desktop.path = $$DATADIR/applications/
desktop.files += dist/$${TARGET}.desktop
pixmaps.path = $$DATADIR/pixmaps/
pixmaps.files += dist/$${TARGET}.png
INSTALL_TRANSLATIONS += share/translations/valentina_ru.qm \
share/translations/valentina_uk.qm
translations.path = $$DATADIR/$${TARGET}/translations/
translations.files = $$INSTALL_TRANSLATIONS
INSTALLS += target \
desktop \
pixmaps \
translations
}
TEMPLATE = subdirs
SUBDIRS = src

97
dist/Launchpad_README vendored Normal file
View File

@ -0,0 +1,97 @@
README (English)
##################################################
Launchpad Package tools
##################################################
This file contains explanation how to publish
a package onto LaunchPad.
Some string useful for local testing creation recipe.
Here used technique when you have separate debian directory
and merge it with source using recipe file.
# This is standard command to work on DEB packaging:
#
# To install all packagers tools:
# sudo apt-get install bzr-builder bzr dpatch pbuilder debootstrap devscripts debhelper build-essential
# Init local working env
- Create account on launchpad.org
- Create Project
- Import branch from git mirror
- Create new recipe
- Upload SSH public key onto account
- Upload you GPG sign key
- Run from command line:
bzr launchpad-login yourlogin
bzr whoami "Your Name <email@email.com>"
- Create a file /.pbuilderrc with content (need for local testing creation recipe)
## Overrides /etc/pbuilderrc
# Default distribution
# Uncomment if you want different distribution system than you use now.
#DISTRIBUTION=saucy
COMPONENTS="main restricted universe multiverse"
# Repositories
MIRRORSITE=http://archive.ubuntu.com/ubuntu
OTHERMIRROR="deb ${MIRRORSITE} ${DISTRIBUTION} ${COMPONENTS} | deb ${MIRRORSITE} ${DISTRIBUTION}-backports ${COMPONENTS} | deb ${MIRRORSITE} ${DISTRIBUTION}-security ${COMPONENTS} | deb ${MIRRORSITE} ${DISTRIBUTION}-updates ${COMPONENTS} | deb http://ppa.launchpad.net/ubuntu-sdk-team/ppa/ubuntu ${DISTRIBUTION} main"
# Last PPA is example how to add additional PPA to your local build system. Useful when you want use packages that don't exist in standard repository.
# For build results (in this directory you will find deb packages. Don't forget this path!)
BUILDRESULT=${HOME}/pbuilder/result
# Mount directories inside chroot environment
BINDMOUNTS=${BUILDRESULT}
- Make our pbuilder trust packages from our PPA
For example you added PPA ubuntu-sdk-team, now you need add public key for using this PPA.
First, we'll login to our pbuilder environment:
sudo pbuilder --login --save-after-login
Then, we'll give it the public key to our PPA, just like if we were adding it to our own keyring:
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys [YOUR PUBLIC KEY HERE]
If all goes well, you can leave your pbuilder environment by typing:
exit
- Tell the pbuilder environment that it is going to act just like the Launchpad build farm
Still in our terminal:
sudo pbuilder create --debootstrapopts --variant=buildd
- Update our environment with these new packages
Still in our terminal, type:
sudo pbuilder --update --override-config
- Edit file ~/.bashrc ti add
DEBFULLNAME="<Your name>"
DEBEMAIL="<Your email address>"
# Init package tools for launchpad
- Create a Bazaar directory
mkdir bzr
- Create debian directory and upload it onto bzr branch ~dismine/valentina/debian
cd bzr
mkdir debian
cd debian
bzr init
cp -pr valentina/debian bzr/debian
bzr add debian
bzr commit -m "Init"
bzr push lp:~dismine/valentina/debian
or download it from launchpad bazaar:
cd bzr
bzr branch lp:~dismine/valentina/debian
- To update this debian directory, edit files into the bzr dir and run
bzr commit -m "Description of change"
bzr push lp:~dismine/valentina/debian
- Create a file valentina.recipe with content
cd bzr
vi valentina.recipe
# bzr-builder format 0.3 deb-version {debupstream}+{revno}+{revno:packaging}
lp:valentina
merge packaging lp:~dismine/valentina/debian
Next command usefull for local testing creation recipe.
- Run command
cd bzr
bzr dailydeb --allow-fallback-to-native valentina.recipe working-dir
This will create a directory "working-dir" with valentina sources and will add sources from ~dismine/valentina/debian
- Test package sources
sudo pbuilder build <working-dir>/<project>_<version>.dsc
Example: sudo pbuilder build working-dir/valentina_0.2.2.dsc

BIN
dist/Valentina.icns vendored Normal file

Binary file not shown.

BIN
dist/application-x-valentina-pattern.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

@ -1,5 +1,5 @@
valentina (0.2.2) saucy; urgency=low
valentina (0.2.8-alpha) trusty; urgency=low
* Add new dependions qttools5-dev-tools
* Auto build.
-- Roman Telezhinsky <dismine@gmail.com> Tue, 26 Nov 2013 21:28:15 +0200
-- dismine <dismine@dismine-To-be-filled-by-O-E-M> Fri, 27 Jun 2014 09:51:38 +0300

1
dist/debian/compat vendored Normal file
View File

@ -0,0 +1 @@
9

26
dist/debian/control vendored
View File

@ -1,14 +1,26 @@
Source: valentina
Section: graphics
Priority: optional
Maintainer: Roman Telezhinsky <dismine@gmail.com>
Build-Depends: debhelper (>= 8.0.0), qtbase5-dev (>= 5.0.0), libqt5svg5-dev (>= 5.0.0), ccache, g++ (>= 4.6.0), qt5-default (>= 5.0.0), qttools5-dev-tools (>= 5.0.0)
Standards-Version: 3.9.4
Homepage: https://bitbucket.org/dismine/valentina
Maintainer: Roman Telezhynskyi <dismine@gmail.com>
Build-Depends: debhelper (>= 8.0.0),
qtbase5-dev (>= 5.2.1),
libqt5svg5-dev (>= 5.2.1),
ccache,
g++ (>= 4.6.0),
qt5-default (>= 5.2.1),
qttools5-dev-tools (>= 5.2.1),
libqt5xmlpatterns5-dev (>= 5.2.1)
Standards-Version: 3.9.5
Homepage: http://www.valentina-project.org/
Vcs-Browser: https://bitbucket.org/dismine/valentina
Package: valentina
Architecture: i386 amd64
Depends: ${shlibs:Depends}, ${misc:Depends}
Depends: libc6 (>= 2.4), libgcc1 (>= 1:4.1.1), libqt5core5a (>= 5.2.0), libqt5gui5 (>= 5.2.0) | libqt5gui5-gles (>= 5.2.0), libqt5printsupport5 (>= 5.2.0), libqt5svg5 (>= 5.2.0), libqt5widgets5 (>= 5.2.0), libqt5xml5 (>= 5.2.0), libqt5xmlpatterns5 (>= 5.2.0), libstdc++6 (>= 4.6), xpdf
Description: Pattern making program.
Open source project of creating a pattern making program, whose allow
create and modeling patterns of clothing.
Valentina is a cross-platform patternmaking program which allows designers
to create and model patterns of clothing. This software allows pattern
creation, using either standard sizing tables or an individuals set of
measurements. It blends new technologies with traditional methods to create
a unique pattern making tool.
Supported langugages: En, Ru, Uk, Cz, It, Fr, De, Nl

43
dist/debian/copyright vendored
View File

@ -3,13 +3,21 @@ Upstream-Name: valentina
Source: https://bitbucket.org/dismine/valentina
Files: *
Copyright: 2013 Roman Telezhinsky <dismine@gmail.com>
Copyright: 2013-2014 Roman Telezhynskyi <dismine@gmail.com>
License: GPL-3.0+
Files: debian/*
Copyright: 2013 Roman Telezhinsky <dismine@gmail.com>
Copyright: 2013-2014 Roman Telezhynskyi <dismine@gmail.com>
License: GPL-3.0+
Files: usr/lib/libqmuparser.so.*
Copyright: 2004-2014 Ingo Berg <ingo_berg@gmx.de>, 2014 Roman Telezhynskyi <dismine@gmail.com>
License: MIT
Files: usr/lib/libvpropertyexplorer.so.*
Copyright: hedgeware <internal(at)hedgeware.net>, 2014 Roman Telezhynskyi <dismine@gmail.com>
License: LGPL-2.1
License: GPL-3.0+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -26,3 +34,34 @@ License: GPL-3.0+
.
On Debian systems, the complete text of the GNU General
Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".
License: MIT
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
License: LGPL-2.1
All rights reserved. This program and the accompanying materials
are made available under the terms of the GNU Lesser General Public License
(LGPL) version 2.1 which accompanies this distribution, and is available at
http://www.gnu.org/licenses/lgpl-2.1.html
.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

3
dist/debian/docs vendored
View File

@ -1,2 +1 @@
README
TODO
README.txt

1
dist/debian/files vendored Normal file
View File

@ -0,0 +1 @@
valentina_0.2.8+441+21+201406270651_i386.deb graphics optional

85
dist/debian/rules vendored
View File

@ -1,50 +1,67 @@
#!/usr/bin/make -f
APPNAME := valentina
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
APPNAME := Valentina
DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH)
ifeq ($(DEB_HOST_ARCH),amd64)
LIBPATH:= /debian/tmp/usr/lib/x86_64-linux-gnu
PREFIX_LIB:= /usr/lib/x86_64-linux-gnu
else
LIBPATH:= /debian/tmp/usr/lib/i386-linux-gnu
PREFIX_LIB:= /usr/lib/i386-linux-gnu
endif
builddir:
mkdir -p builddir
mkdir -p builddir
builddir/Makefile: builddir
lrelease src/src.pro
cd builddir && qmake PREFIX=/usr ../$(APPNAME).pro -r
cd builddir && qmake PREFIX=/usr PREFIX_LIB=$(PREFIX_LIB) ../$(APPNAME).pro -r
build: build-stamp
build-stamp: builddir/Makefile
dh_testdir
# Add here commands to compile the package.
cd builddir && $(MAKE)
touch $@
dh_testdir
# Add here commands to compile the package.
cd builddir && $(MAKE)
touch $@
clean:
dh_testdir
dh_testroot
rm -f build-stamp
# Add here commands to clean up after the build process.
rm -rf builddir
dh_clean
dh_testdir
dh_testroot
rm -f build-stamp
# Add here commands to clean up after the build process.
rm -rf builddir
dh_clean
install: build
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
# Add here commands to install the package into debian/your_appname
cd builddir && $(MAKE) INSTALL_ROOT=$(CURDIR)/debian/tmp install
dh_testdir
dh_testroot
dh_prep
dh_installdirs
# Add here commands to install the package into debian/valentina
cd builddir && $(MAKE) INSTALL_ROOT=$(CURDIR)/debian/tmp install
# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.
# Build architecture-dependent files here.
binary-arch: build install
dh_testdir
dh_testroot
dh_installdocs
dh_installchangelogs
dh_installexamples
dh_installman
dh_testdir
dh_testroot
dh_installchangelogs
dh_installdocs
dh_installmenu
dh_link
dh_compress
dh_fixperms
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
dh_installmime
dh_install --sourcedir=$(CURDIR) -v
dh_installman
dh_installinfo
dh_link
dh_compress
dh_fixperms
dh_makeshlibs
dh_installdeb
dh_shlibdeps -Llibqmuparser2 -l$(CURDIR)$(LIBPATH) -Llibvpropertyexplorer -l$(CURDIR)$(LIBPATH)
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure

2
dist/debian/shlibs.local vendored Normal file
View File

@ -0,0 +1,2 @@
libqmuparser 2 libqmuparser2
libvpropertyexplorer 1 libvpropertyexplorer

View File

@ -1 +1 @@
3.0 (quilt)
3.0 (native)

View File

@ -1,4 +1,10 @@
debian/usr/share/pixmaps/valentina.png
debian/valentina/usr/bin/valentina
debian/valentina/usr/share/valentina/translations/valentina_ru.qm
debian/valentina/usr/share/valentina/translations/valentina_uk.qm
debian/valentina/usr/share/valentina/translations/valentina_ru_RU.qm
debian/valentina/usr/share/valentina/translations/valentina_uk_UA.qm
debian/valentina/usr/share/valentina/translations/valentina_de_DE.qm
debian/valentina/usr/share/valentina/translations/valentina_cs_CZ.qm
debian/valentina/usr/share/valentina/translations/valentina_he_IL.qm
debian/valentina/usr/share/valentina/translations/valentina_fr_FR.qm
debian/valentina/usr/share/valentina/translations/valentina_it_IT.qm
debian/valentina/usr/share/valentina/translations/valentina_nl_NL.qm

1
dist/debian/substvars vendored Normal file
View File

@ -0,0 +1 @@
misc:Depends=

View File

@ -1,13 +1,23 @@
.\" Manpage for valentina.
.\" Contact dismine@gmail.com.in to correct errors.
.TH man 1 "25 Nov 2013" "1.0" "valentina man page"
.TH man 1 "29 May 2014" "valentina man page"
.SH NAME
valentina \- Pattern making program.
.SH SYNOPSIS
valentina
valentina [options] file
.SH DESCRIPTION
Open source project of creating a pattern making program, whose allow create and modeling patterns of clothing.
Valentina is a cross-platform patternmaking program which allows designers
to create and model patterns of clothing. This software allows pattern
creation, using either standard sizing tables or an individuals set of
measurements. It blends new technologies with traditional methods to create
a unique pattern making tool.
.SH OPTIONS
The valentina does not take any options.
-help Show summary of options.
-version
Show version of program.
file
Pattern file to load.
.SH AUTHOR
Roman Telezhinsky (dismine@gmail.com)
This manual page was written by Roman Telezhynskyi <dismine@gmail.com>

5
dist/debian/valentina.dirs vendored Normal file
View File

@ -0,0 +1,5 @@
/usr/share/valentina/translations
/usr/share/valentina/tables/standard
/usr/share/mime/packages
/usr/share/applications

6
dist/debian/valentina.install vendored Normal file
View File

@ -0,0 +1,6 @@
usr/bin/*
usr/lib/*
usr/share/valentina/translations/*
usr/share/valentina/tables/standard/*
usr/share/pixmaps/*
usr/share/applications/*

1
dist/debian/valentina.mime vendored Normal file
View File

@ -0,0 +1 @@
application/x-valentina-pattern; valentina %s; nametemplate=%s.val; description="Valentina pattern format" edit=valentina '%s'; priority=6

23
dist/debian/postinst → dist/debian/valentina.postinst vendored Normal file → Executable file
View File

@ -17,23 +17,16 @@ set -e
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
echo "ldconfig..." >&2
ldconfig
case "$1" in
configure)
if [ -x update-desktop-database ]; then
update-desktop-database
fi
if [ "$1" = "configure" ] && [ -x "`which update-menus 2>/dev/null`" ] ; then
update-menus
fi
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
if [ -x update-mime-database ]; then
update-mime-database /usr/share/mime
fi
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

37
dist/debian/valentina.postrm vendored Executable file
View File

@ -0,0 +1,37 @@
#!/bin/sh
# postrm script for valentina
#
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * <postrm> `remove'
# * <postrm> `purge'
# * <old-postrm> `upgrade' <new-version>
# * <new-postrm> `failed-upgrade' <old-version>
# * <new-postrm> `abort-install'
# * <new-postrm> `abort-install' <old-version>
# * <new-postrm> `abort-upgrade' <old-version>
# * <disappearer's-postrm> `disappear' <overwriter>
# <overwriter-version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
echo "ldconfig..." >&2
ldconfig
if [ -x update-desktop-database ]; then
update-desktop-database
fi
if [ -x update-mime-database ]; then
update-mime-database /usr/share/mime
fi
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0

96
dist/debian/valentina.sharedmimeinfo vendored Normal file
View File

@ -0,0 +1,96 @@
<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="application/x-valentina-pattern">
<_comment>Valentina pattern format</_comment>
<comment xml:lang="af">Valentina pattern format</comment>
<comment xml:lang="ar">Valentina pattern format</comment>
<comment xml:lang="as">Valentina pattern format</comment>
<comment xml:lang="ast">Valentina pattern format</comment>
<comment xml:lang="be">Valentina pattern format</comment>
<comment xml:lang="bg">Valentina pattern format</comment>
<comment xml:lang="bn">Valentina pattern format</comment>
<comment xml:lang="br">Valentina pattern format</comment>
<comment xml:lang="bs">Valentina pattern format</comment>
<comment xml:lang="ca">Valentina pattern format</comment>
<comment xml:lang="ca-valencia">Valentina pattern format</comment>
<comment xml:lang="cs">Valentina pattern format</comment>
<comment xml:lang="cy">Valentina pattern format</comment>
<comment xml:lang="da">Valentina pattern format</comment>
<comment xml:lang="de">Valentina pattern format</comment>
<comment xml:lang="dz">Valentina pattern format</comment>
<comment xml:lang="el">Valentina pattern format</comment>
<comment xml:lang="en-GB">Valentina pattern format</comment>
<comment xml:lang="en-ZA">Valentina pattern format</comment>
<comment xml:lang="eo">Valentina pattern format</comment>
<comment xml:lang="es">Valentina pattern format</comment>
<comment xml:lang="et">Valentina pattern format</comment>
<comment xml:lang="eu">Valentina pattern format</comment>
<comment xml:lang="fa">Valentina pattern format</comment>
<comment xml:lang="fi">Valentina pattern format</comment>
<comment xml:lang="fr">Valentina pattern format</comment>
<comment xml:lang="ga">Valentina pattern format</comment>
<comment xml:lang="gd">Valentina pattern format</comment>
<comment xml:lang="gl">Valentina pattern format</comment>
<comment xml:lang="gu">Valentina pattern format</comment>
<comment xml:lang="he">Valentina pattern format</comment>
<comment xml:lang="hi">Valentina pattern format</comment>
<comment xml:lang="hr">Valentina pattern format</comment>
<comment xml:lang="hu">Valentina pattern format</comment>
<comment xml:lang="id">Valentina pattern format</comment>
<comment xml:lang="is">Valentina pattern format</comment>
<comment xml:lang="it">Valentina pattern format</comment>
<comment xml:lang="ja">Valentina pattern format</comment>
<comment xml:lang="ka">Valentina pattern format</comment>
<comment xml:lang="kk">Valentina pattern format</comment>
<comment xml:lang="km">Valentina pattern format</comment>
<comment xml:lang="kmr-Latn">Valentina pattern format</comment>
<comment xml:lang="ko">Valentina pattern format</comment>
<comment xml:lang="lt">Valentina pattern format</comment>
<comment xml:lang="lv">Valentina pattern format</comment>
<comment xml:lang="mk">Valentina pattern format</comment>
<comment xml:lang="ml">Valentina pattern format</comment>
<comment xml:lang="mn">Valentina pattern format</comment>
<comment xml:lang="mr">Valentina pattern format</comment>
<comment xml:lang="nb">Valentina pattern format</comment>
<comment xml:lang="ne">Valentina pattern format</comment>
<comment xml:lang="nl">Valentina pattern format</comment>
<comment xml:lang="nn">Valentina pattern format</comment>
<comment xml:lang="nr">Valentina pattern format</comment>
<comment xml:lang="nso">Valentina pattern format</comment>
<comment xml:lang="oc">Valentina pattern format</comment>
<comment xml:lang="om">Valentina pattern format</comment>
<comment xml:lang="or">Valentina pattern format</comment>
<comment xml:lang="pa-IN">Valentina pattern format</comment>
<comment xml:lang="pl">Valentina pattern format</comment>
<comment xml:lang="pt">Valentina pattern format</comment>
<comment xml:lang="pt-BR">Valentina pattern format</comment>
<comment xml:lang="ro">Valentina pattern format</comment>
<comment xml:lang="ru">Valentina лекала</comment>
<comment xml:lang="rw">Valentina pattern format</comment>
<comment xml:lang="si">Valentina pattern format</comment>
<comment xml:lang="sk">Valentina pattern format</comment>
<comment xml:lang="sl">Valentina pattern format</comment>
<comment xml:lang="sr">Valentina pattern format</comment>
<comment xml:lang="ss">Valentina pattern format</comment>
<comment xml:lang="st">Valentina pattern format</comment>
<comment xml:lang="sv">Valentina pattern format</comment>
<comment xml:lang="ta">Valentina pattern format</comment>
<comment xml:lang="te">OValentina pattern format</comment>
<comment xml:lang="tg">OValentina pattern format</comment>
<comment xml:lang="th">Valentina pattern format</comment>
<comment xml:lang="tn">Valentina pattern format</comment>
<comment xml:lang="tr">Valentina pattern format</comment>
<comment xml:lang="ts">Valentina pattern format</comment>
<comment xml:lang="ug">Valentina pattern format</comment>
<comment xml:lang="uk">Valentina викрійки</comment>
<comment xml:lang="uz">Valentina pattern format</comment>
<comment xml:lang="ve">Valentina pattern format</comment>
<comment xml:lang="vi">Valentina pattern format</comment>
<comment xml:lang="xh">Valentina pattern format</comment>
<comment xml:lang="zh-CN">Valentina pattern format</comment>
<comment xml:lang="zh-TW">Valentina pattern format</comment>
<comment xml:lang="zu">Valentina pattern format</comment>
<glob pattern="*.val"/>
<icon name="application-x-valentina-pattern"/>
</mime-type>
</mime-info>

119
dist/nsis/headers/fileassoc.nsh vendored Normal file
View File

@ -0,0 +1,119 @@
; fileassoc.nsh
; File association helper macros
; Written by Saivert
;
; Features automatic backup system and UPDATEFILEASSOC macro for
; shell change notification.
;
; |> How to use <|
; To associate a file with an application so you can double-click it in explorer, use
; the APP_ASSOCIATE macro like this:
;
; Example:
; !insertmacro APP_ASSOCIATE "txt" "myapp.textfile" "Description of txt files" \
; "$INSTDIR\myapp.exe,0" "Open with myapp" "$INSTDIR\myapp.exe $\"%1$\""
;
; Never insert the APP_ASSOCIATE macro multiple times, it is only ment
; to associate an application with a single file and using the
; the "open" verb as default. To add more verbs (actions) to a file
; use the APP_ASSOCIATE_ADDVERB macro.
;
; Example:
; !insertmacro APP_ASSOCIATE_ADDVERB "myapp.textfile" "edit" "Edit with myapp" \
; "$INSTDIR\myapp.exe /edit $\"%1$\""
;
; To have access to more options when registering the file association use the
; APP_ASSOCIATE_EX macro. Here you can specify the verb and what verb is to be the
; standard action (default verb).
;
; And finally: To remove the association from the registry use the APP_UNASSOCIATE
; macro. Here is another example just to wrap it up:
; !insertmacro APP_UNASSOCIATE "txt" "myapp.textfile"
;
; |> Note <|
; When defining your file class string always use the short form of your application title
; then a period (dot) and the type of file. This keeps the file class sort of unique.
; Examples:
; Winamp.Playlist
; NSIS.Script
; Photoshop.JPEGFile
;
; |> Tech info <|
; The registry key layout for a file association is:
; HKEY_CLASSES_ROOT
; <applicationID> = <"description">
; shell
; <verb> = <"menu-item text">
; command = <"command string">
;
!macro APP_ASSOCIATE EXT FILECLASS DESCRIPTION ICON COMMANDTEXT COMMAND
; Backup the previously associated file class
ReadRegStr $R0 HKCR ".${EXT}" ""
WriteRegStr HKCR ".${EXT}" "${FILECLASS}_backup" "$R0"
WriteRegStr HKCR ".${EXT}" "" "${FILECLASS}"
WriteRegStr HKCR "${FILECLASS}" "" `${DESCRIPTION}`
WriteRegStr HKCR "${FILECLASS}\DefaultIcon" "" `${ICON}`
WriteRegStr HKCR "${FILECLASS}\shell" "" "open"
WriteRegStr HKCR "${FILECLASS}\shell\open" "" `${COMMANDTEXT}`
WriteRegStr HKCR "${FILECLASS}\shell\open\command" "" `${COMMAND}`
!macroend
!macro APP_ASSOCIATE_EX EXT FILECLASS DESCRIPTION ICON VERB DEFAULTVERB SHELLNEW COMMANDTEXT COMMAND
; Backup the previously associated file class
ReadRegStr $R0 HKCR ".${EXT}" ""
WriteRegStr HKCR ".${EXT}" "${FILECLASS}_backup" "$R0"
WriteRegStr HKCR ".${EXT}" "" "${FILECLASS}"
StrCmp "${SHELLNEW}" "0" +2
WriteRegStr HKCR ".${EXT}\ShellNew" "NullFile" ""
WriteRegStr HKCR "${FILECLASS}" "" `${DESCRIPTION}`
WriteRegStr HKCR "${FILECLASS}\DefaultIcon" "" `${ICON}`
WriteRegStr HKCR "${FILECLASS}\shell" "" `${DEFAULTVERB}`
WriteRegStr HKCR "${FILECLASS}\shell\${VERB}" "" `${COMMANDTEXT}`
WriteRegStr HKCR "${FILECLASS}\shell\${VERB}\command" "" `${COMMAND}`
!macroend
!macro APP_ASSOCIATE_ADDVERB FILECLASS VERB COMMANDTEXT COMMAND
WriteRegStr HKCR "${FILECLASS}\shell\${VERB}" "" `${COMMANDTEXT}`
WriteRegStr HKCR "${FILECLASS}\shell\${VERB}\command" "" `${COMMAND}`
!macroend
!macro APP_ASSOCIATE_REMOVEVERB FILECLASS VERB
DeleteRegKey HKCR `${FILECLASS}\shell\${VERB}`
!macroend
!macro APP_UNASSOCIATE EXT FILECLASS
; Backup the previously associated file class
ReadRegStr $R0 HKCR ".${EXT}" `${FILECLASS}_backup`
WriteRegStr HKCR ".${EXT}" "" "$R0"
DeleteRegKey HKCR `${FILECLASS}`
!macroend
!macro APP_ASSOCIATE_GETFILECLASS OUTPUT EXT
ReadRegStr ${OUTPUT} HKCR ".${EXT}" ""
!macroend
; !defines for use with SHChangeNotify
!ifdef SHCNE_ASSOCCHANGED
!undef SHCNE_ASSOCCHANGED
!endif
!define SHCNE_ASSOCCHANGED 0x08000000
!ifdef SHCNF_FLUSH
!undef SHCNF_FLUSH
!endif
!define SHCNF_FLUSH 0x1000
!macro UPDATEFILEASSOC
; Using the system.dll plugin to call the SHChangeNotify Win32 API function so we
; can update the shell.
System::Call "shell32::SHChangeNotify(i,i,i,i) (${SHCNE_ASSOCCHANGED}, ${SHCNF_FLUSH}, 0, 0)"
!macroend
;EOF

30
dist/nsis/headers/fileversion.nsh vendored Normal file
View File

@ -0,0 +1,30 @@
; fileversion.nsh
; Source http://nsis.sourceforge.net/GetDLLVersionLocal_as_define
;
; GetDLLVersionLocal only gives you two packed 32bit numbers, but
; sometimes you might need the unpacked numbers at compile time. This is
; where this ugly thing comes in.
;
; Example usage
; !insertmacro GetPEVersionLocal "$%windir%\system32\kernel32.dll" myver
; Outfile "$%temp%\hello ${myver_1}.${myver_2}.${myver_3}.${myver_4}.exe"
!macro GetPEVersionLocal file defbase
!verbose push
!verbose 2
!tempfile GetPEVersionLocal_nsi
!tempfile GetPEVersionLocal_exe
!define GetPEVersionLocal_doll "$"
!appendfile "${GetPEVersionLocal_nsi}" 'SilentInstall silent$\nRequestExecutionLevel user$\nOutFile "${GetPEVersionLocal_exe}"$\nPage instfiles$\nSection'
!appendfile "${GetPEVersionLocal_nsi}" '$\nFileOpen $0 "${GetPEVersionLocal_nsi}" w$\nGetDllVersion "${file}" $R0 $R1$\nIntOp $R2 $R0 / 0x00010000$\nIntOp $R3 $R0 & 0x0000FFFF$\nIntOp $R4 $R1 / 0x00010000$\nIntOp $R5 $R1 & 0x0000FFFF'
!appendfile "${GetPEVersionLocal_nsi}" '$\nFileWrite $0 "!define ${defbase}_1 $R2${GetPEVersionLocal_doll}\n"$\nFileWrite $0 "!define ${defbase}_2 $R3${GetPEVersionLocal_doll}\n"$\nFileWrite $0 "!define ${defbase}_3 $R4${GetPEVersionLocal_doll}\n"$\nFileWrite $0 "!define ${defbase}_4 $R5${GetPEVersionLocal_doll}\n"$\nFileClose $0$\nSectionEnd'
!system '"${NSISDIR}\makensis" /V2 "${GetPEVersionLocal_nsi}"' = 0
!system '"${GetPEVersionLocal_exe}"' = 0
!include "${GetPEVersionLocal_nsi}"
!delfile "${GetPEVersionLocal_nsi}"
!delfile "${GetPEVersionLocal_exe}"
!undef GetPEVersionLocal_nsi
!undef GetPEVersionLocal_exe
!undef GetPEVersionLocal_doll
!verbose pop
!macroend

267
dist/nsis/valentina.nsi vendored Normal file
View File

@ -0,0 +1,267 @@
; NSIS installer script for Valentina
; --------------- Headers --------------
!include "MUI2.nsh"
!include "headers\fileassoc.nsh"
!include "headers\fileversion.nsh"
!include "FileFunc.nsh"
; --------------- General --------------
CRCCheck force
XPStyle on
SetCompressor /FINAL /SOLID lzma
!define MUI_PRODUCT "Valentina"
!define MUI_FILE "valentina"
!insertmacro GetPEVersionLocal "c:\pack\valentina\valentina.exe" ver
!define MUI_VERSION "${ver_1}.${ver_2}.${ver_3}-alpha"
!define MUI_BRANDINGTEXT "Valentina ${MUI_VERSION}"
!define WEBSITE_LINK "http://www.valentina-project.org/"
!define PUBLISHER "Roman Telezhynskyi"
InstallDir "$LOCALAPPDATA\${MUI_PRODUCT}" ; Default installation folder
Name "${MUI_BRANDINGTEXT}" ; Name displayed on installer
Icon "valentina\${MUI_FILE}.ico"
Caption "${MUI_BRANDINGTEXT}"
!define /date MYTIMESTAMP "%Y%m%d%H%M%S"
OutFile "${MUI_FILE}_${MUI_VERSION}-${MYTIMESTAMP}_i386.exe" ; Resulting installer filename
InstallDirRegKey HKCU "$LOCALAPPDATA\${MUI_PRODUCT}" "" ; Get installation folder from registry if available
LicenseData "valentina\LICENSE_GPL.txt"
RequestExecutionLevel user ; Request application privileges for Windows Vista
ShowInstDetails show
ShowUninstDetails show
; ----------- Icon and Bitmap ---------
!define MUI_ICON "valentina\${MUI_FILE}.ico"
!define MUI_UNICON "valentina\${MUI_FILE}.ico"
;!define MUI_SPECIALBITMAP "Bitmap.bmp"
; -------------------------------------
!define MUI_ABORTWARNING
;------------- Language Selection Dialog Settings --------------
;Remember the installer language
!define MUI_LANGDLL_REGISTRY_ROOT "HKCU"
!define MUI_LANGDLL_REGISTRY_KEY "Software\${MUI_PRODUCT}"
!define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"
!define REG_UNINSTALL "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MUI_PRODUCT}"
!define REGISTRY_ROOT "HKCU"
;-------------- Install Pages -------------
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "valentina\LICENSE_GPL.txt"
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
; These indented statements modify settings for MUI_PAGE_FINISH
!define MUI_FINISHPAGE_NOAUTOCLOSE
!define MUI_FINISHPAGE_RUN "$INSTDIR\${MUI_FILE}.exe"
!define MUI_FINISHPAGE_RUN_CHECKED
!define MUI_FINISHPAGE_RUN_TEXT "Launch ${MUI_PRODUCT}"
!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\README.txt"
!insertmacro MUI_PAGE_FINISH
;-------------- Uninstall Pages -------------
!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
; These indented statements modify settings for MUI_UNPAGE_FINISH
!define MUI_UNFINISHPAGE_NOAUTOCLOSE
!insertmacro MUI_UNPAGE_FINISH
;--------------- Languages ---------------
!define MUI_LANGDLL_ALLLANGUAGES
!insertmacro MUI_LANGUAGE "English" ;first language is the default language
!insertmacro MUI_LANGUAGE "German"
!insertmacro MUI_LANGUAGE "French"
!insertmacro MUI_LANGUAGE "Russian"
!insertmacro MUI_LANGUAGE "Ukrainian"
!insertmacro MUI_LANGUAGE "Czech"
!insertmacro MUI_LANGUAGE "Hebrew"
!insertmacro MUI_LANGUAGE "Italian"
!insertmacro MUI_LANGUAGE "Dutch"
!insertmacro MUI_LANGUAGE "Spanish"
!insertmacro MUI_LANGUAGE "SpanishInternational"
!insertmacro MUI_LANGUAGE "SimpChinese"
!insertmacro MUI_LANGUAGE "TradChinese"
!insertmacro MUI_LANGUAGE "Japanese"
!insertmacro MUI_LANGUAGE "Korean"
!insertmacro MUI_LANGUAGE "Danish"
!insertmacro MUI_LANGUAGE "Swedish"
!insertmacro MUI_LANGUAGE "Norwegian"
!insertmacro MUI_LANGUAGE "NorwegianNynorsk"
!insertmacro MUI_LANGUAGE "Finnish"
!insertmacro MUI_LANGUAGE "Greek"
!insertmacro MUI_LANGUAGE "Portuguese"
!insertmacro MUI_LANGUAGE "PortugueseBR"
!insertmacro MUI_LANGUAGE "Polish"
!insertmacro MUI_LANGUAGE "Slovak"
!insertmacro MUI_LANGUAGE "Croatian"
!insertmacro MUI_LANGUAGE "Bulgarian"
!insertmacro MUI_LANGUAGE "Hungarian"
!insertmacro MUI_LANGUAGE "Thai"
!insertmacro MUI_LANGUAGE "Romanian"
!insertmacro MUI_LANGUAGE "Latvian"
!insertmacro MUI_LANGUAGE "Macedonian"
!insertmacro MUI_LANGUAGE "Estonian"
!insertmacro MUI_LANGUAGE "Turkish"
!insertmacro MUI_LANGUAGE "Lithuanian"
!insertmacro MUI_LANGUAGE "Slovenian"
!insertmacro MUI_LANGUAGE "Serbian"
!insertmacro MUI_LANGUAGE "SerbianLatin"
!insertmacro MUI_LANGUAGE "Arabic"
!insertmacro MUI_LANGUAGE "Farsi"
!insertmacro MUI_LANGUAGE "Indonesian"
!insertmacro MUI_LANGUAGE "Mongolian"
!insertmacro MUI_LANGUAGE "Luxembourgish"
!insertmacro MUI_LANGUAGE "Albanian"
!insertmacro MUI_LANGUAGE "Breton"
!insertmacro MUI_LANGUAGE "Belarusian"
!insertmacro MUI_LANGUAGE "Icelandic"
!insertmacro MUI_LANGUAGE "Malay"
!insertmacro MUI_LANGUAGE "Bosnian"
!insertmacro MUI_LANGUAGE "Kurdish"
!insertmacro MUI_LANGUAGE "Irish"
!insertmacro MUI_LANGUAGE "Uzbek"
!insertmacro MUI_LANGUAGE "Galician"
!insertmacro MUI_LANGUAGE "Afrikaans"
!insertmacro MUI_LANGUAGE "Catalan"
!insertmacro MUI_LANGUAGE "Esperanto"
; ------------- Reserve Files ---------------------
;If you are using solid compression, files that are required before
;the actual installation should be stored first in the data block,
;because this will make your installer start faster.
!insertmacro MUI_RESERVEFILE_LANGDLL
; ------------- Installer Functions ---------------
Function checkAlreadyInstalled
; check for already installed instance
ClearErrors
ReadRegStr $R0 "${REGISTRY_ROOT}" "${REG_UNINSTALL}" "UninstallString"
StrCmp $R0 "" done
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \
"${MUI_PRODUCT} is already installed. $\n$\nClick `OK` to remove the \
previous version or `Cancel` to cancel this upgrade." \
IDOK UnInstall
Abort
;Run the uninstaller
UnInstall:
ClearErrors
ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
;uninstall.exe is still here
;Delete Files
RMDir /r "$INSTDIR\*.*"
;Remove the installation directory
RMDir "$INSTDIR"
IfErrors no_remove_uninstaller done
;You can either use Delete /REBOOTOK in the uninstaller or add some code
;here to remove the uninstaller. Use a registry key to check
;whether the user has chosen to uninstall. If you are using an uninstaller
;components page, make sure all sections are uninstalled.
no_remove_uninstaller:
MessageBox MB_OK|MB_ICONSTOP "Error while uninstalling \
previously installed version. Please uninstall it manually \
and start the installer again."
Quit
done:
FunctionEnd
Function .onInit
!insertmacro MUI_LANGDLL_DISPLAY ;This has to come after the language macros
Call checkAlreadyInstalled
FunctionEnd
;-------------- Uninstaller Functions -------------
Function un.onInit
!insertmacro MUI_UNGETLANGUAGE
FunctionEnd
;-------------- Installer -------------------------
Section "Valentina (required)"
SectionIn RO ; define mandatory sections
;Add files
SetOutPath "$INSTDIR" ; Set output path to the installation directory.
File /r "c:\pack\valentina\*.*"
;create start-menu items
!define START_LINK_DIR "$SMPROGRAMS\${MUI_PRODUCT}"
!define START_LINK_RUN "$SMPROGRAMS\${MUI_PRODUCT}\${MUI_PRODUCT}.lnk"
!define START_LINK_UNINSTALLER "$SMPROGRAMS\${MUI_PRODUCT}\Uninstall ${MUI_PRODUCT}.lnk"
# In your main installer section...
SetShellVarContext current
CreateDirectory "${START_LINK_DIR}"
CreateShortCut "${START_LINK_RUN}" "$INSTDIR\${MUI_FILE}.exe"
CreateShortCut "${START_LINK_UNINSTALLER}" "$INSTDIR\Uninstall.exe"
;create desktop shortcut
CreateShortCut "$DESKTOP\${MUI_PRODUCT}.lnk" "$INSTDIR\${MUI_FILE}.exe" ""
;write uninstall information to the registry
!define UNINSTALLER_NAME "Uninstall.exe"
; File associations
!insertmacro APP_ASSOCIATE "val" "valentina.pattern" "Valentina pattern file" "$INSTDIR\${MUI_FILE}.exe,0" "Open with Valentina" "$\"$INSTDIR\${MUI_FILE}.exe$\" $\"%1$\""
; Example of association icon with file type
; !insertmacro APP_ASSOCIATE "osapp" "OSA.osapp" "Plugin Package" "$INSTDIR\PluginIcon.ico" "Open" "$INSTDIR\PluginInstaller.exe $\"%1$\""
!insertmacro UPDATEFILEASSOC
WriteRegStr "${REGISTRY_ROOT}" "${REG_UNINSTALL}" "DisplayName" "${MUI_PRODUCT}"
WriteRegStr "${REGISTRY_ROOT}" "${REG_UNINSTALL}" "DisplayIcon" "$\"$INSTDIR\${MUI_FILE}.exe$\""
WriteRegStr "${REGISTRY_ROOT}" "${REG_UNINSTALL}" "Publisher" "${PUBLISHER}"
WriteRegStr "${REGISTRY_ROOT}" "${REG_UNINSTALL}" "DisplayVersion" "${MUI_VERSION}"
; Run GetSize after coping all files
${GetSize} "$INSTDIR" "/S=0K" $0 $1 $2
IntFmt $0 "0x%08X" $0
WriteRegDWord "${REGISTRY_ROOT}" "${REG_UNINSTALL}" "EstimatedSize" "$0"
WriteRegStr "${REGISTRY_ROOT}" "${REG_UNINSTALL}" "HelpLink" "${WEBSITE_LINK}"
WriteRegStr "${REGISTRY_ROOT}" "${REG_UNINSTALL}" "URLInfoAbout" "${WEBSITE_LINK}"
WriteRegStr "${REGISTRY_ROOT}" "${REG_UNINSTALL}" "InstallLocation" "$\"$INSTDIR$\""
WriteRegStr "${REGISTRY_ROOT}" "${REG_UNINSTALL}" "InstallSource" "$\"$EXEDIR$\""
WriteRegDWord "${REGISTRY_ROOT}" "${REG_UNINSTALL}" "NoModify" 1
WriteRegDWord "${REGISTRY_ROOT}" "${REG_UNINSTALL}" "NoRepair" 1
WriteRegStr "${REGISTRY_ROOT}" "${REG_UNINSTALL}" "UninstallString" "$\"$INSTDIR\${UNINSTALLER_NAME}$\""
WriteRegStr "${REGISTRY_ROOT}" "${REG_UNINSTALL}" "Comments" "Uninstalls ${MUI_PRODUCT}."
WriteUninstaller "$INSTDIR\${UNINSTALLER_NAME}" ; Location of the uninstaller
SectionEnd
;--------------------------------
;Uninstaller Section
Section "Uninstall"
;Delete Files
RMDir /r "$INSTDIR\*.*"
;Remove the installation directory
RMDir "$INSTDIR"
;Delete Start Menu Shortcuts
SetShellVarContext current
Delete "$DESKTOP\${MUI_PRODUCT}.lnk"
Delete "${START_LINK_DIR}\*.*"
RmDir "${START_LINK_DIR}"
; Removing file associations
!insertmacro APP_UNASSOCIATE "val" "valentina.pattern"
;Delete Uninstaller And Unistall Registry Entries
DeleteRegKey "${REGISTRY_ROOT}" "SOFTWARE\${MUI_PRODUCT}"
DeleteRegKey "${REGISTRY_ROOT}" "${REG_UNINSTALL}"
SectionEnd
;eof

14
dist/rpm/_service vendored Normal file
View File

@ -0,0 +1,14 @@
<services>
<service name="tar_scm">
<param name="url">https://github.com/dismine/Valentina.git</param>
<param name="versionprefix">0.2.8</param>
<param name="filename">valentina</param>
<param name="scm">git</param>
<param name="versionformat">%at</param>
</service>
<service name="extract_file">
<param name="archive">*.tar</param>
<param name="files">*/dist/rpm/valentina.spec</param>
</service>
<service name="set_version"/>
</services>

View File

@ -2,67 +2,92 @@ Name:valentina
# Fedora specifics
%if 0%{?fedora_version} > 0 || 0%{?rhel_version} > 0 || 0%{?centos_version} > 0
BuildRequires: pkgconfig(Qt5Core) libqt5-qttools >= 5.0.0 libQtSvg-devel >= 5.0.0 ccache
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5Gui)
BuildRequires: pkgconfig(Qt5Network)
BuildRequires: pkgconfig(Qt5PrintSupport)
BuildRequires: pkgconfig(Qt5Widgets)
BuildRequires: pkgconfig(Qt5Xml)
BuildRequires: qt5-qtxmlpatterns-devel >= 5.2.0
BuildRequires: qt5-qtsvg-devel >= 5.2.0
BuildRequires: qt5-qttools-devel >= 5.2.0
BuildRequires: ccache
%endif
# SUSE Specifics
%if 0%{?suse_version} > 0
BuildRequires: libqt5-qtbase-devel >= 5.0.0 libqt5-qttools >= 5.0.0 libQt5Svg-devel >= 5.0.0 ccache update-desktop-files
BuildRequires: libqt5-qtbase-devel
BuildRequires: libqt5-qttools
BuildRequires: libQt5Svg-devel
BuildRequires: libqt5-qtxmlpatterns-devel
BuildRequires: libqt5-linguist-devel
BuildRequires: ccache
BuildRequires: update-desktop-files
%endif
Version: 0.2.2
Release: 1
Version: 0.2.8
Release: 0
URL: https://bitbucket.org/dismine/valentina
License: GPL-3.0+
Source0: %{name}-%{version}.tar.gz
Source0: %{name}-%{version}.tar
Requires: poppler-utils
Group: Graphics
Summary: Pattern Making Application
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Packager: Roman Telezhinsky <dismine@gmail.com>
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Packager: Roman Telezhinskyi <dismine@gmail.com>
%description
Open source project of creating a pattern making program, whose allow
create and modeling patterns of clothing.
Valentina is a cross-platform patternmaking program which allows designers
to create and model patterns of clothing. This software allows pattern
creation, using either standard sizing tables or an individuals set of
measurements. It blends new technologies with traditional methods to create
a unique pattern making tool.
%prep
%setup -q -n %{name}-%{version}
%build
qmake-qt5
%if 0%{?suse_version} >= 1320
qmake-qt5 PREFIX=%{buildroot}%{_prefix} LRELEASE=lrelease-qt5 Valentina.pro -r
%else
qmake-qt5 PREFIX=%{buildroot}%{_prefix} Valentina.pro -r
%endif
%{__make} %{?jobs:-j %jobs}
%install
mkdir -p $RPM_BUILD_ROOT/usr/{bin,share}
mkdir -p $RPM_BUILD_ROOT/usr/share/%{name}/translations
%{__install} -Dm 755 -s bin/%{name} %{buildroot}%{_bindir}/%{name}
%{__install} -Dm 644 dist/%{name}.desktop %{buildroot}%{_datadir}/applications/%{name}.desktop
%{__install} -Dm 644 dist/%{name}.png %{buildroot}%{_datadir}/pixmaps/%{name}.png
%{__install} -Dm 644 dist/%{name}.1.gz %{buildroot}%{_mandir}/man1/%{name}.1.gz
%{__install} -Dm 644 share/translations/valentina_uk.qm %{buildroot}%{_datadir}/%{name}/translations/valentina_uk.qm
%{__install} -Dm 644 share/translations/valentina_ru.qm %{buildroot}%{_datadir}/%{name}/translations/valentina_ru.qm
%{__make} install
gzip -9c dist/debian/%{name}.1 > dist/debian/%{name}.1.gz &&
%{__install} -Dm 644 dist/debian/%{name}.1.gz %{buildroot}%{_mandir}/man1/%{name}.1.gz
%if 0%{?suse_version} > 0
%suse_update_desktop_file -r %{name} VectorGraphics
%endif
%clean
[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}
%files
%defattr(-,root,root,-)
%doc README LICENSE
%doc README.txt LICENSE_GPL.txt
%doc %{_mandir}/man1/%{name}.1.gz
%{_bindir}/*
%{_libdir}/*
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/%{name}.png
%{_datadir}/%{name}/translations/valentina_uk.qm
%{_datadir}/%{name}/translations/valentina_ru.qm
%{_datadir}/pixmaps/*
%dir %{_datadir}/%{name}
%dir %{_datadir}/%{name}/translations
%{_datadir}/%{name}/translations/*.qm
%dir %{_datadir}/%{name}/tables
%dir %{_datadir}/%{name}/tables/standard
%{_datadir}/%{name}/tables/standard/*.vst
%clean
[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}
%post
ldconfig
%changelog
* Mon Dec 9 2013 Roman Telezhinsky
* Mon Dec 22 2014 Roman Telezhinskyi
- Initial build

View File

@ -1,10 +1,12 @@
[Desktop Entry]
Type=Application
Name=Valentina
GenericName=Pattern making program
Comment=Open source project of creating a pattern making program, whose allow create and modeling patterns of clothing
Icon=valentina
Exec=valentina
Categories=Graphics;VectorGraphics;2DGraphics;
Exec=valentina %U
Version=1.0
Name[uk]=valentina
Encoding=UTF-8
GenericName=Pattern making program
Comment=Valentina is a cross-platform patternmaking program which allows designers to create and model patterns of clothing. This software allows pattern creation, using either standard sizing tables or an individuals set of measurements. It blends new technologies with traditional methods to create a unique pattern making tool.
Icon=valentina
Terminal=false
MimeType=application/x-valentina-pattern;
Categories=Graphics;VectorGraphics;2DGraphics;

149
dist/valentina.nsi vendored
View File

@ -1,149 +0,0 @@
; -------------------------------
; Start
!define MUI_PRODUCT "Valentina"
!define MUI_FILE "valentina"
!define MUI_VERSION "0.2.2"
!define MUI_BRANDINGTEXT "Valentina ${MUI_VERSION}"
CRCCheck On
; Bij deze moeten we waarschijnlijk een absoluut pad gaan gebruiken
; dit moet effe uitgetest worden.
!include "${NSISDIR}\Contrib\Modern UI\System.nsh"
;--------------------------------
;General
Name "${MUI_BRANDINGTEXT}"
Caption "${MUI_BRANDINGTEXT}"
SetCompressor bzip2
OutFile "${MUI_FILE}-install-v.${MUI_VERSION}.exe"
; Request application privileges for Windows Vista
RequestExecutionLevel user
ShowInstDetails show
ShowUninstDetails show
!define MUI_ICON "valentina\${MUI_FILE}.ico"
!define MUI_UNICON "valentina\${MUI_FILE}.ico"
;!define MUI_SPECIALBITMAP "Bitmap.bmp"
;--------------------------------
;Folder selection page
InstallDir "$PROGRAMFILES\${MUI_PRODUCT}"
;--------------------------------
;Modern UI Configuration
InstallColors 061C79 E5F0E2
LicenseBkColor E5F0E2
InstProgressFlags smooth colored
!define MUI_WELCOMEPAGE
!define MUI_LICENSEPAGE
!define MUI_DIRECTORYPAGE
!define MUI_ABORTWARNING
!define MUI_UNINSTALLER
!define MUI_UNCONFIRMPAGE
!define MUI_FINISHPAGE
;--------------------------------
;Page
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "valentina\license"
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH
;--------------------------------
;Language
!insertmacro MUI_LANGUAGE "English"
;--------------------------------
;Modern UI System
;!insertmacro MUI_SYSTEM
!include "MUI2.nsh"
;--------------------------------
;Data
LicenseData "valentina\LICENSE"
;--------------------------------
;Installer Sections
Section "Valentina (required)"
;Add files
SetOutPath "$INSTDIR"
File /r "c:\pack\valentina\*.*"
;create desktop shortcut
CreateShortCut "$DESKTOP\${MUI_PRODUCT}.lnk" "$INSTDIR\${MUI_FILE}.exe" ""
;create start-menu items
CreateDirectory "$SMPROGRAMS\${MUI_PRODUCT}"
CreateShortCut "$SMPROGRAMS\${MUI_PRODUCT}\Uninstall.lnk" "$INSTDIR\Uninstall.exe" "" "$INSTDIR\Uninstall.exe" 0
CreateShortCut "$SMPROGRAMS\${MUI_PRODUCT}\${MUI_PRODUCT}.lnk" "$INSTDIR\${MUI_FILE}.exe" "" "$INSTDIR\${MUI_FILE}.exe" 0
;write uninstall information to the registry
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MUI_PRODUCT}" "DisplayName" "${MUI_PRODUCT} (remove only)"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MUI_PRODUCT}" "UninstallString" "$INSTDIR\Uninstall.exe"
WriteUninstaller "$INSTDIR\Uninstall.exe"
SectionEnd
;--------------------------------
;Uninstaller Section
Section "Uninstall"
;Delete Files
RMDir /r "$INSTDIR\*.*"
;Remove the installation directory
RMDir "$INSTDIR"
;Delete Start Menu Shortcuts
Delete "$DESKTOP\${MUI_PRODUCT}.lnk"
Delete "$SMPROGRAMS\${MUI_PRODUCT}\*.*"
RmDir "$SMPROGRAMS\${MUI_PRODUCT}"
;Delete Uninstaller And Unistall Registry Entries
DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\${MUI_PRODUCT}"
DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${MUI_PRODUCT}"
SectionEnd
;--------------------------------
;MessageBox Section
;Function that calls a messagebox when installation finished correctly
Function .onInstSuccess
MessageBox MB_OK "You have successfully installed ${MUI_PRODUCT}. Use the desktop icon to start the program."
FunctionEnd
Function un.onUninstSuccess
MessageBox MB_OK "You have successfully uninstalled ${MUI_PRODUCT}."
FunctionEnd
;eof

BIN
dist/valentina.png vendored

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

3
dist/valentina.recipe vendored Normal file
View File

@ -0,0 +1,3 @@
# bzr-builder format 0.3 deb-version {debupstream}+{revno}+{revno:packaging}+{time}
lp:valentina
merge packaging lp:~dismine/valentina/debian

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

100
scripts/alphabets.py Executable file
View File

@ -0,0 +1,100 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import codecs
import sys
#Alphabets was taken from website http://www.alphabet-letters.com/
#Use this script if you want get all unique symbols from all alphabets.
#This unique symbols need for math parser.
#Example:
# ցЀĆЈVӧĎАғΕĖӅИқΝĞơРңњΥĦШҫ̆جگĮаҳѕεشԶиһνԾрυلՆӝшËՎҔPÓՖXӛӟŞӣզhëծpóӞնxßվāŁЃֆĉЋCŬđҐГΒęҘЛΚŘġҠУGاհЫدԱҰгβطԹõлκKՁÀуςهՉÈыvیՑÐSOřӘћաőcӐթèkàѓżűðsķչøӥӔĀփїІĈЎґĐΗЖҙĘȚ
# ΟОҡĠآΧЦتЮұİزηжԸغοоÁՀقχцÉՈيюÑՐђӋіәťӆўáŠĺѐfөըnñŰӤӨӹոľЁրăЉŭċБӸēłΔҖЙŤěΜӜDСձģΤӰЩīņحҮбưԳصδHйԻŇμӲӴсՃمτƠщՋєLQŹՓŕÖYśÞaգĽæiŽիӓîqճöyջþĂօЄӦĊЌΑĒДҗјΙȘĚМΡéĵĢФūӚΩبĪЬүќ
# αذԲдҷιظԺмρՂфÇωوՊьÏՒTŚĻJբdçժlïӪղtպӫAւąЇčŃЏĕӯЗΖEțŮĝПΞأĥĹЧΦثÆӳЯIسŲԵзζԽпξكՅÄчφNMՍӌяӢՕÔWÎŝÜџёźեägխoӒյôwĶBžսüЂĄև̈ЊČƏљΓВҕĔӮΛКĜΣТҥĤکЪƯخγвŅԴŪضλкԼĴσтÅՄنъÍՌRӕ
# ՔZÝŜbåդjíլļrӵմzýռپêЅքćچЍďӱҒЕůėژșΘØҚНğńءΠFҢХħΨҪЭųįҶرҲеԷňعθҺнԿفπÂхՇψÊэšՏÒUəÚѝŻşҤӑâeէŐımկòuշÕúտŔ
RUSSIAN_ALPHABET = set(u'абвгдеёжзийклмнопрстуфхцчшщьыъэюяАБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЬЫЪЭЮЯ') #RUSSIAN ALPHABET
ENGLISH_ALPHABET = set(u'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ') #ENGLISH ALPHABET
AZERBAIJANI_ALPHABET = set(u'abcçdeəfgğhxıijkqlmnoöprsştuüvyzABCÇDEƏFGĞHXIİJKQLMNOÖPRSŞTUÜVYZ') #AZERBAIJANI ALPHABET
ALBANIAN_ALPHABET = set(u'abcçddheëfggjhijklllmnnjopqrrrsshtthuvxxhyzzhABCÇDDhEËFGGjHIJKLLlMNNjOPQRRrSShTThUVXXhYZZh') #ALBANIAN ALPHABET
ARABIC_ALPHABET = set(u'أبجدوﻩزحطيكلمنسعفصقرشتثخذضظغ') #ARABIC ALPHABET
ARMENIAN_ALPHABET = set(u'աբգդեզէըթժիլխծկհձղճմյնշոչպջռսվտրցւփքեւօֆԱԲԳԴԵԶԷԸԹԺԻԼԽԾԿՀՁՂՃՄՅՆՇՈՉՊՋՌՍՎՏՐՑՒՓՔԵվևՕՖ') #ARMENIAN ALPHABET
AFRIKAANS_ALPHABET = set(u'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ') #AFRIKAANS ALPHABET
BASQUE_ALPHABET = set(u'аbdefghijklmnñoprstuxzАBDEFGHIJKLMNÑOPRSTUXZ') #BASQUE ALPHABET
BASHKIR_ALPHABET = set(u'абвгғдҙеёжзийкҡлмнңоөпрсҫтуүфхһцчшщъыьэәюяАБВГҒДҘЕЁЖЗИЙКҠЛМНҢОӨПРСҪТУҮФХҺЦЧШЩЪЫЬЭӘЮЯ') #BASHKIR ALPHABET
BELORUSSIAN_ALPHABET = set(u'абвгддждзеёжзійклмнопрстуўфхцчшыьэюяАБВГДДжДзЕЁЖЗІЙКЛМНОПРСТУЎФХЦЧШЫЬЭЮЯ') #BELORUSSIAN ALPHABET
BULGARIAN_ALPHABET = set(u'абвгдежзийклмнопрстуфхцчшщъьюяАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЬЮЯ') #BULGARIAN ALPHABET
BURYATIAN_ALPHABET = set(u'абвгдеёжзийклмноөпрстуүфхһцчшщъыьэюяАБВГДЕЁЖЗИЙКЛМНОӨПРСТУҮФХҺЦЧШЩЪЫЬЭЮЯ') #BURYATIAN ALPHABET
WELSH_ALPHABET = set(u'abcchdddefffgnghilllmnopphrrhstthuwyABCCHDDDEFFFGNGHILLLMNOPPHRRHSTTHUWY') #WELSH ALPHABET
HUNGARIAN_ALPHABET = set(u'aábccsddzdzseéfggyhiíjkllymnnyoóöőprsszttyuúüűvzzsqwxyAÁBCCsDDzDzsEÉFGGyHIÍJKLLyMNNyOÓÖŐPRSSzTTyUÚÜŰVZZsQWXY') #HUNGARIAN ALPHABET
VIETNAMESE_ALPHABET = set(u'aăâbcdđeêghiklmnoôơpqrstuưvxyAĂÂBCDĐEÊGHIKLMNOÔƠPQRSTUƯVXY') #VIETNAMESE ALPHABET
HAITIAN_ALPHABET = set(u'aanbchdeèenfghijklmnngoòonouounprstuivwyzAAnBChDEèEnFGHIJKLMNNgOòOnOuOunPRSTUiVWYZ') #HAITIAN ALPHABET
GALICIAN_ALPHABET = set(u'abcdefghilmnñopqrstuvxzABCDEFGHILMNÑOPQRSTUVXZ') #GALICIAN ALPHABET
DUTCH_ALPHABET = set(u'abcdefghijklmnopqrstuvwxijyzABCDEFGHIJKLMNOPQRSTUVWXIJYZ') #DUTCH ALPHABET
GREEK_ALPHABET = set(u'αβγδεζηθικλμνξοπρσςτυφχψωΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ') #GREEK ALPHABET
DANISH_ALPHABET = set(u'аbcdefghijklmnopqrstuvwxyzæøåАBCDEFGHIJKLMNOPQRSTUVWXYZÆØÅ') #DANISH ALPHABET
INDONESIAN_ALPHABET = set(u'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ') #INDONESIAN ALPHABET
IRISH_ALPHABET = set(u'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ') #IRISH ALPHABET
ICELANDIC_ALPHABET = set(u'aábdðeéfghiíjklmnoóprstuúvxyýþæöAÁBDÐEÉFGHIÍJKLMNOÓPRSTUÚVXYÝÞÆÖ') #ICELANDIC ALPHABET
SPANISH_ALPHABET = set(u'abcdefghijklmnñopqrstuvwxyzABCDEFGHIJKLMNÑOPQRSTUVWXYZ') #SPANISH ALPHABET
ITALIAN_ALPHABET = set(u'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ') #ITALIAN ALPHABET
KAZAKH_ALPHABET = set(u'аәбвгғдеёжзийкқлмнңоөпрстуұүфхһцчшщъыіьэюяАӘБВГҒДЕЁЖЗИЙКҚЛМНҢОӨПРСТУҰҮФХҺЦЧШЩЪЫІЬЭЮЯ') #KAZAKH ALPHABET
KALMYK_ALPHABET = set(u'аəбвгһдеёжҗзийклмнңоөпрстуүфхцчшщыьэюяАƏБВГҺДЕЁЖҖЗИЙКЛМНҢОӨПРСТУҮФХЦЧШЩЫЬЭЮЯ') #KALMYK ALPHABET
KARAKALPAK_ALPHABET = set(u'аәбвгғдеёжзийкқлмнңоөпрстуүўфхҳцчшщъыьэюяАӘБВГҒДЕЁЖЗИЙКҚЛМНҢОӨПРСТУҮЎФХҲЦЧШЩЪЫЬЭЮЯ') #KARAKALPAK ALPHABET
KARELIAN_ALPHABET = set(u'abčdefghijklmnoprsšzžtuvyäöABČDEFGHIJKLMNOPRSŠZŽTUVYÄÖ') #KARELIAN ALPHABET
CATALAN_ALPHABET = set(u'aàbcçdeéèfghiíïjklmnoóòpqrstuúüvwxyzAÀBCÇDEÉÈFGHIÍÏJKLMNOÓÒPQRSTUÚÜVWXYZ') #CATALAN ALPHABET
KYRGYZ_ALPHABET = set(u'абвгдеёжзийклмнңоөпрстуүфхцчшщъыьэюяАБВГДЕЁЖЗИЙКЛМНҢОӨПРСТУҮФХЦЧШЩЪЫЬЭЮЯ') #KYRGYZ ALPHABET
LATIN_ALPHABET = set(u'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ') #LATIN ALPHABET
LATVIAN_ALPHABET = set(u'aābcčdeēfgģhiījkķlļmnņoprsštuūvzžAĀBCČDEĒFGĢHIĪJKĶLĻMNŅOPRSŠTUŪVZŽ') #LATVIAN ALPHABET
LITHUANIAN_ALPHABET = set(u'aąbcčdeęėfghiįyjklmnoprsštuųūvzžAĄBCČDEĘĖFGHIĮYJKLMNOPRSŠTUŲŪVZŽ') #LITHUANIAN ALPHABET
MACEDONIAN_ALPHABET = set(u'абвгдѓеѐжзѕиѝјклљмнњопрстќуфхцчџшАБВГДЃЕЀЖЗЅИЍЈКЛЉМНЊОПРСТЌУФХЦЧЏШ') #MACEDONIAN ALPHABET
MALTESE_ALPHABET = set(u'abċdefġggħhħiiejklmnopqrstuvwxzżABĊDEFĠGGĦHĦIIEJKLMNOPQRSTUVWXZŻ') #MALTESE ALPHABET
MARI_ALPHABET = set(u'аӓбвгдеёжзийклмноӧпрстуӱфхцчшщъыӹьэюяАӒБВГДЕЁЖЗИЙКЛМНОӦПРСТУӰФХЦЧШЩЪЫӸЬЭЮЯ') #MARI ALPHABET
MOLDAVIAN_ALPHABET = set(u'aăâbcdefghiîjklmnopqrsștțuvwxyzAĂÂBCDEFGHIÎJKLMNOPQRSȘTȚUVWXYZ') #MOLDAVIAN ALPHABET
MONGOLIAN_ALPHABET = set(u'абвгдеёжзийклмноөпрстуүфхцчшщъыьэюяАБВГДЕЁЖЗИЙКЛМНОӨПРСТУҮФХЦЧШЩЪЫЬЭЮЯ') #MONGOLIAN ALPHABET
GERMAN_ALPHABET = set(u'aäbcdefghijklmnoöpqrstuüvwxyzAÄBCDEFGHIJKLMNOÖPQRSßTUÜVWXYZ') #GERMAN ALPHABET
NORWEGIAN_ALPHABET = set(u'abcdefghijklmnopqrstuvwxyzæøåABCDEFGHIJKLMNOPQRSTUVWXYZÆØÅ') #NORWEGIAN ALPHABET
OSETIAN_ALPHABET = set(u'аӕбвггъддзджеёжзийккълмноппърсттъуфххъццъччъшщъыьэюяАӔБВГГъДДзДжЕЁЖЗИЙККъЛМНОППъРСТТъУФХХъЦЦъЧЧъШЩъЫьЭЮЯ') #OSETIAN ALPHABET
POLISH_ALPHABET = set(u'aąbcćdeęfghijklłmnńoóprsśtuwyzźżAĄBCĆDEĘFGHIJKLŁMNŃOÓPRSŚTUWYZŹŻ') #POLISH ALPHABET
PORTUGUESE_ALPHABET = set(u'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ') #PORTUGUESE ALPHABET
ROMANIAN_ALPHABET = set(u'aăâbcdefghiîjklmnopqrsștțuvwxyzAĂÂBCDEFGHIÎJKLMNOPQRSȘTȚUVWXYZ') #ROMANIAN ALPHABET
SERBIAN_ALPHABET = set(u'абвгдђежзијклљмнњопрстћуфхцчџшАБВГДЂЕЖЗИЈКЛЉМНЊОПРСТЋУФХЦЧЏШ') #SERBIAN ALPHABET
SLOVAK_ALPHABET = set(u'aáäbcčdďdzdžeéfghchiíjklĺľmnňoóôpqrŕsštťuúvwxyýzžAÁÄBCČDĎDzDžEÉFGHChIÍJKLĹĽMNŇOÓÔPQRŔSŠTŤUÚVWXYÝZŽ') #SLOVAK ALPHABET
SLOVENIAN_ALPHABET = set(u'abcčddžefghijklljmnnjoprsštuvzžABCČDDžEFGHIJKLLjMNNjOPRSŠTUVZŽ') #SLOVENIAN ALPHABET
TAJIK_ALPHABET = set(u'абвгғдеёжзийӣкқлмнопрстуӯфхҳчҷшъэюяАБВГҒДЕЁЖЗИЙӢКҚЛМНОПРСТУӮФХҲЧҶШЪЭЮЯ') #TAJIK ALPHABET
TATAR_ALPHABET = set(u'аәбвгдеёжҗзийклмнңоөпрстуүфхһцчшщъыьэюяАӘБВГДЕЁЖҖЗИЙКЛМНҢОӨПРСТУҮФХҺЦЧШЩЪЫЬЭЮ') #TATAR ALPHABET
TUVIN_ALPHABET = set(u'абвгдёжӝзийклмнңоӧпрстуӱхчшыАБВГДЁЖӜЗИЙКЛМНҢОӦПРСТУӰХЧШЫ') #TUVIN ALPHABET
TURKISH_ALPHABET = set(u'abcçdefgğhiıjklmnoöpqrsştuüvwxyzABCÇDEFGĞHIIJKLMNOÖPQRSŞTUÜVWXYZ') #TURKISH ALPHABET
UDMURT_ALPHABET = set(u'абвгдеёжӝзӟиӥйклмноӧпрстуфхцчӵшщъыьэюяАБВГДЕЁЖӜЗӞИӤЙКЛМНОӦПРСТУФХЦЧӴШЩЪЫЬЭЮЯ') #UDMURT ALPHABET
UZBEK_ALPHABET = set(u'абвгғдеёжзийкқлмнопрстуўфхҳцчшъьэюяАБВГҒДЕЁЖЗИЙКҚЛМНОПРСТУЎФХҲЦЧШЪЬЭЮЯ') #UZBEK ALPHABET
UKRAINIAN_ALPHABET = set(u'абвгґдежзіїийклмнопрстуфхцчшщьєюяАБВГҐДЕЖЗІЇИЙКЛМНОПРСТУФХЦЧШЩЬЄЮЯ') #UKRAINIAN ALPHABET
FARSI_ALPHABET = set(u'ءاآبپتثجچحخدذرزژسشصضطظعغفقكکگلمنوهيی') #FARSI ALPHABET
PHILIPPINES_ALPHABET = set(u'abcdefghijklmnñngoprstuvwxyzABCDEFGHIJKLMNÑNgOPRSTUVWXYZ') #PHILIPPINES ALPHABET
FINNISH_ALPHABET = set(u'abcdefghijklmnopqrsštuvwxyzžåäöABCDEFGHIJKLMNOPQRSŠTUVWXYZŽÅÄÖ') #FINNISH ALPHABET
FRENCH_ALPHABET = set(u'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ') #FRENCH ALPHABET
HAKASS_ALPHABET = set(u'абвгғдеёжзиiйклмнңoӧпрстуӱфхцчӌшщъыьэюяАБВГҒДЕЁЖЗИIЙКЛМНҢOӦПРСТУӰФХЦЧӋШЩЪЫЬЭЮЯ') #HAKASS ALPHABET
HANTY_ALPHABET = set(u'аӓӑбвгдеёәӛжзийкқлӆмнңн̆оӧөӫпрстуӱўфхҳцчҷшщъыьэєє̈юю̆яя̆АӒӐБВГДЕЁӘӚЖЗИЙКҚЛӅМНҢН̆ОӦӨӪПРСТУӰЎФХҲЦЧҶШЩЪЫЬЭЄЄ̈ЮЮ̆ЯЯ̆') #HANTY ALPHABET
CROATIAN_ALPHABET = set(u'abcčćddžðefghijklljmnnjoprsštuvzžABCČĆDDžÐEFGHIJKLLjMNNjOPRSŠTUVZŽ') #CROATIAN ALPHABET
BOSNIAN_ALPHABET = set(u'abcčćddžðefghijklljmnnjoprsštuvzžABCČĆDDžÐEFGHIJKLLjMNNjOPRSŠTUVZŽ') #BOSNIAN ALPHABET
CZECH_ALPHABET = set(u'aábcčdďeéěfghchiíjklmnňoópqrřsštťuúůvwxyýzžAÁBCČDĎEÉĚFGHChIÍJKLMNŇOÓPQRŘSŠTŤUÚŮVWXYÝZŽ') #CZECH ALPHABET
CHUVASH_ALPHABET = set(u'аăбвгдеёĕжзийклмнопрсçтуӳфхцчшщьыъэюяАĂБВГДЕЁĔЖЗИЙКЛМНОПРСÇТУӲФХЦЧШЩЬЫЪЭЮЯ') #CHUVASH ALPHABET
SWEDISH_ALPHABET = set(u'aåäbcdefghijklmnoöpqrstuvwxyzAÅÄBCDEFGHIJKLMNOÖPQRSTUVWXYZ') #SWEDISH ALPHABET
ESPERANTO_ALPHABET = set(u'abcĉdefgĝhĥijĵklmnoprsŝtuŭvzABCĈDEFGĜHĤIJĴKLMNOPRSŜTUŬVZ') #ESPERANTO ALPHABET
ESTONIAN_ALPHABET = set(u'abcdefghijklmnopqrsšzžtuvwõäöüxyABCDEFGHIJKLMNOPQRSŠZŽTUVWÕÄÖÜXY') #ESTONIAN ALPHABET
YAKUTIAN_ALPHABET = set(u'абвгҕддьеёжзийклмнҥньоөпрсһтуүфхцчшщъыьэАБВГҔДДьЕЁЖЗИЙКЛМНҤНьОӨПРСҺТУҮФХЦЧШЩЪЫЬЭ') #YAKUTIAN ALPHABET
MONTENEGRIN_ALPHABET = set(u'abcčćddžðefghijklljmnnjoprsštuvzžABCČĆDDžÐEFGHIJKLLjMNNjOPRSŠTUVZŽ') #MONTENEGRIN ALPHABET
UTF8Writer = codecs.getwriter('utf8')
sys.stdout = UTF8Writer(sys.stdout)
SYMBOLS = set(RUSSIAN_ALPHABET)
SYMBOLS.update(RUSSIAN_ALPHABET, ENGLISH_ALPHABET, AZERBAIJANI_ALPHABET, ALBANIAN_ALPHABET, ARABIC_ALPHABET, ARMENIAN_ALPHABET, AFRIKAANS_ALPHABET, BASQUE_ALPHABET, BASHKIR_ALPHABET,
BELORUSSIAN_ALPHABET, BULGARIAN_ALPHABET, BURYATIAN_ALPHABET, WELSH_ALPHABET, HUNGARIAN_ALPHABET, VIETNAMESE_ALPHABET, HAITIAN_ALPHABET, GALICIAN_ALPHABET, DUTCH_ALPHABET, GREEK_ALPHABET,
DANISH_ALPHABET, INDONESIAN_ALPHABET, IRISH_ALPHABET, ICELANDIC_ALPHABET, SPANISH_ALPHABET, ITALIAN_ALPHABET, KAZAKH_ALPHABET, KALMYK_ALPHABET, KARAKALPAK_ALPHABET, KARELIAN_ALPHABET,
CATALAN_ALPHABET, KYRGYZ_ALPHABET, LATIN_ALPHABET, LATVIAN_ALPHABET, LITHUANIAN_ALPHABET, MACEDONIAN_ALPHABET, MALTESE_ALPHABET, MARI_ALPHABET, MOLDAVIAN_ALPHABET, MONGOLIAN_ALPHABET,
GERMAN_ALPHABET, NORWEGIAN_ALPHABET, OSETIAN_ALPHABET, POLISH_ALPHABET, PORTUGUESE_ALPHABET, ROMANIAN_ALPHABET, SERBIAN_ALPHABET, SLOVAK_ALPHABET, SLOVENIAN_ALPHABET, TAJIK_ALPHABET, TATAR_ALPHABET,
TUVIN_ALPHABET, TURKISH_ALPHABET, UDMURT_ALPHABET, UZBEK_ALPHABET, UKRAINIAN_ALPHABET, FARSI_ALPHABET, PHILIPPINES_ALPHABET, FINNISH_ALPHABET, FRENCH_ALPHABET, HAKASS_ALPHABET,HANTY_ALPHABET,
BOSNIAN_ALPHABET, CROATIAN_ALPHABET, CZECH_ALPHABET, CHUVASH_ALPHABET, SWEDISH_ALPHABET, ESPERANTO_ALPHABET, ESTONIAN_ALPHABET, YAKUTIAN_ALPHABET, MONTENEGRIN_ALPHABET)
L = list(SYMBOLS)
print ''.join(L)

469
scripts/asan_symbolize.py Executable file
View File

@ -0,0 +1,469 @@
#!/usr/bin/env python
#===- lib/asan/scripts/asan_symbolize.py -----------------------------------===#
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
#===------------------------------------------------------------------------===#
import argparse
import bisect
import getopt
import os
import pty
import re
import subprocess
import sys
import termios
symbolizers = {}
DEBUG = False
demangle = False
binutils_prefix = None
sysroot_path = None
binary_name_filter = None
fix_filename_patterns = None
logfile = sys.stdin
# FIXME: merge the code that calls fix_filename().
def fix_filename(file_name):
if fix_filename_patterns:
for path_to_cut in fix_filename_patterns:
file_name = re.sub('.*' + path_to_cut, '', file_name)
file_name = re.sub('.*asan_[a-z_]*.cc:[0-9]*', '_asan_rtl_', file_name)
file_name = re.sub('.*crtstuff.c:0', '???:0', file_name)
return file_name
def sysroot_path_filter(binary_name):
return sysroot_path + binary_name
def guess_arch(addr):
# Guess which arch we're running. 10 = len('0x') + 8 hex digits.
if len(addr) > 10:
return 'x86_64'
else:
return 'i386'
class Symbolizer(object):
def __init__(self):
pass
def symbolize(self, addr, binary, offset):
"""Symbolize the given address (pair of binary and offset).
Overriden in subclasses.
Args:
addr: virtual address of an instruction.
binary: path to executable/shared object containing this instruction.
offset: instruction offset in the @binary.
Returns:
list of strings (one string for each inlined frame) describing
the code locations for this instruction (that is, function name, file
name, line and column numbers).
"""
return None
class LLVMSymbolizer(Symbolizer):
def __init__(self, symbolizer_path, default_arch, system, dsym_hints=[]):
super(LLVMSymbolizer, self).__init__()
self.symbolizer_path = symbolizer_path
self.default_arch = default_arch
self.system = system
self.dsym_hints = dsym_hints
self.pipe = self.open_llvm_symbolizer()
def open_llvm_symbolizer(self):
cmd = [self.symbolizer_path,
'--use-symbol-table=true',
'--demangle=%s' % demangle,
'--functions=short',
'--inlining=true',
'--default-arch=%s' % self.default_arch]
if self.system == 'Darwin':
for hint in self.dsym_hints:
cmd.append('--dsym-hint=%s' % hint)
if DEBUG:
print ' '.join(cmd)
try:
result = subprocess.Popen(cmd, stdin=subprocess.PIPE,
stdout=subprocess.PIPE)
except OSError:
result = None
return result
def symbolize(self, addr, binary, offset):
"""Overrides Symbolizer.symbolize."""
if not self.pipe:
return None
result = []
try:
symbolizer_input = '"%s" %s' % (binary, offset)
if DEBUG:
print symbolizer_input
print >> self.pipe.stdin, symbolizer_input
while True:
function_name = self.pipe.stdout.readline().rstrip()
if not function_name:
break
file_name = self.pipe.stdout.readline().rstrip()
file_name = fix_filename(file_name)
if (not function_name.startswith('??') or
not file_name.startswith('??')):
# Append only non-trivial frames.
result.append('%s in %s %s' % (addr, function_name,
file_name))
except Exception:
result = []
if not result:
result = None
return result
def LLVMSymbolizerFactory(system, default_arch, dsym_hints=[]):
symbolizer_path = os.getenv('LLVM_SYMBOLIZER_PATH')
if not symbolizer_path:
symbolizer_path = os.getenv('ASAN_SYMBOLIZER_PATH')
if not symbolizer_path:
# Assume llvm-symbolizer is in PATH.
symbolizer_path = 'llvm-symbolizer'
return LLVMSymbolizer(symbolizer_path, default_arch, system, dsym_hints)
class Addr2LineSymbolizer(Symbolizer):
def __init__(self, binary):
super(Addr2LineSymbolizer, self).__init__()
self.binary = binary
self.pipe = self.open_addr2line()
def open_addr2line(self):
addr2line_tool = 'addr2line'
if binutils_prefix:
addr2line_tool = binutils_prefix + addr2line_tool
cmd = [addr2line_tool, '-f']
if demangle:
cmd += ['--demangle']
cmd += ['-e', self.binary]
if DEBUG:
print ' '.join(cmd)
return subprocess.Popen(cmd,
stdin=subprocess.PIPE, stdout=subprocess.PIPE)
def symbolize(self, addr, binary, offset):
"""Overrides Symbolizer.symbolize."""
if self.binary != binary:
return None
try:
print >> self.pipe.stdin, offset
function_name = self.pipe.stdout.readline().rstrip()
file_name = self.pipe.stdout.readline().rstrip()
except Exception:
function_name = ''
file_name = ''
file_name = fix_filename(file_name)
return ['%s in %s %s' % (addr, function_name, file_name)]
class UnbufferedLineConverter(object):
"""
Wrap a child process that responds to each line of input with one line of
output. Uses pty to trick the child into providing unbuffered output.
"""
def __init__(self, args, close_stderr=False):
pid, fd = pty.fork()
if pid == 0:
# We're the child. Transfer control to command.
if close_stderr:
dev_null = os.open('/dev/null', 0)
os.dup2(dev_null, 2)
os.execvp(args[0], args)
else:
# Disable echoing.
attr = termios.tcgetattr(fd)
attr[3] = attr[3] & ~termios.ECHO
termios.tcsetattr(fd, termios.TCSANOW, attr)
# Set up a file()-like interface to the child process
self.r = os.fdopen(fd, "r", 1)
self.w = os.fdopen(os.dup(fd), "w", 1)
def convert(self, line):
self.w.write(line + "\n")
return self.readline()
def readline(self):
return self.r.readline().rstrip()
class DarwinSymbolizer(Symbolizer):
def __init__(self, addr, binary):
super(DarwinSymbolizer, self).__init__()
self.binary = binary
self.arch = guess_arch(addr)
self.open_atos()
def open_atos(self):
if DEBUG:
print 'atos -o %s -arch %s' % (self.binary, self.arch)
cmdline = ['atos', '-o', self.binary, '-arch', self.arch]
self.atos = UnbufferedLineConverter(cmdline, close_stderr=True)
def symbolize(self, addr, binary, offset):
"""Overrides Symbolizer.symbolize."""
if self.binary != binary:
return None
atos_line = self.atos.convert('0x%x' % int(offset, 16))
while "got symbolicator for" in atos_line:
atos_line = self.atos.readline()
# A well-formed atos response looks like this:
# foo(type1, type2) (in object.name) (filename.cc:80)
match = re.match('^(.*) \(in (.*)\) \((.*:\d*)\)$', atos_line)
if DEBUG:
print 'atos_line: ', atos_line
if match:
function_name = match.group(1)
function_name = re.sub('\(.*?\)', '', function_name)
file_name = fix_filename(match.group(3))
return ['%s in %s %s' % (addr, function_name, file_name)]
else:
return ['%s in %s' % (addr, atos_line)]
# Chain several symbolizers so that if one symbolizer fails, we fall back
# to the next symbolizer in chain.
class ChainSymbolizer(Symbolizer):
def __init__(self, symbolizer_list):
super(ChainSymbolizer, self).__init__()
self.symbolizer_list = symbolizer_list
def symbolize(self, addr, binary, offset):
"""Overrides Symbolizer.symbolize."""
for symbolizer in self.symbolizer_list:
if symbolizer:
result = symbolizer.symbolize(addr, binary, offset)
if result:
return result
return None
def append_symbolizer(self, symbolizer):
self.symbolizer_list.append(symbolizer)
def BreakpadSymbolizerFactory(binary):
suffix = os.getenv('BREAKPAD_SUFFIX')
if suffix:
filename = binary + suffix
if os.access(filename, os.F_OK):
return BreakpadSymbolizer(filename)
return None
def SystemSymbolizerFactory(system, addr, binary):
if system == 'Darwin':
return DarwinSymbolizer(addr, binary)
elif system == 'Linux':
return Addr2LineSymbolizer(binary)
class BreakpadSymbolizer(Symbolizer):
def __init__(self, filename):
super(BreakpadSymbolizer, self).__init__()
self.filename = filename
lines = file(filename).readlines()
self.files = []
self.symbols = {}
self.address_list = []
self.addresses = {}
# MODULE mac x86_64 A7001116478B33F18FF9BEDE9F615F190 t
fragments = lines[0].rstrip().split()
self.arch = fragments[2]
self.debug_id = fragments[3]
self.binary = ' '.join(fragments[4:])
self.parse_lines(lines[1:])
def parse_lines(self, lines):
cur_function_addr = ''
for line in lines:
fragments = line.split()
if fragments[0] == 'FILE':
assert int(fragments[1]) == len(self.files)
self.files.append(' '.join(fragments[2:]))
elif fragments[0] == 'PUBLIC':
self.symbols[int(fragments[1], 16)] = ' '.join(fragments[3:])
elif fragments[0] in ['CFI', 'STACK']:
pass
elif fragments[0] == 'FUNC':
cur_function_addr = int(fragments[1], 16)
if not cur_function_addr in self.symbols.keys():
self.symbols[cur_function_addr] = ' '.join(fragments[4:])
else:
# Line starting with an address.
addr = int(fragments[0], 16)
self.address_list.append(addr)
# Tuple of symbol address, size, line, file number.
self.addresses[addr] = (cur_function_addr,
int(fragments[1], 16),
int(fragments[2]),
int(fragments[3]))
self.address_list.sort()
def get_sym_file_line(self, addr):
key = None
if addr in self.addresses.keys():
key = addr
else:
index = bisect.bisect_left(self.address_list, addr)
if index == 0:
return None
else:
key = self.address_list[index - 1]
sym_id, size, line_no, file_no = self.addresses[key]
symbol = self.symbols[sym_id]
filename = self.files[file_no]
if addr < key + size:
return symbol, filename, line_no
else:
return None
def symbolize(self, addr, binary, offset):
if self.binary != binary:
return None
res = self.get_sym_file_line(int(offset, 16))
if res:
function_name, file_name, line_no = res
result = ['%s in %s %s:%d' % (
addr, function_name, file_name, line_no)]
print result
return result
else:
return None
class SymbolizationLoop(object):
def __init__(self, binary_name_filter=None, dsym_hint_producer=None):
# Used by clients who may want to supply a different binary name.
# E.g. in Chrome several binaries may share a single .dSYM.
self.binary_name_filter = binary_name_filter
self.dsym_hint_producer = dsym_hint_producer
self.system = os.uname()[0]
if self.system not in ['Linux', 'Darwin', 'FreeBSD']:
raise Exception('Unknown system')
self.llvm_symbolizers = {}
self.last_llvm_symbolizer = None
self.dsym_hints = set([])
self.frame_no = 0
def symbolize_address(self, addr, binary, offset):
# On non-Darwin (i.e. on platforms without .dSYM debug info) always use
# a single symbolizer binary.
# On Darwin, if the dsym hint producer is present:
# 1. check whether we've seen this binary already; if so,
# use |llvm_symbolizers[binary]|, which has already loaded the debug
# info for this binary (might not be the case for
# |last_llvm_symbolizer|);
# 2. otherwise check if we've seen all the hints for this binary already;
# if so, reuse |last_llvm_symbolizer| which has the full set of hints;
# 3. otherwise create a new symbolizer and pass all currently known
# .dSYM hints to it.
if not binary in self.llvm_symbolizers:
use_new_symbolizer = True
if self.system == 'Darwin' and self.dsym_hint_producer:
dsym_hints_for_binary = set(self.dsym_hint_producer(binary))
use_new_symbolizer = bool(dsym_hints_for_binary - self.dsym_hints)
self.dsym_hints |= dsym_hints_for_binary
if self.last_llvm_symbolizer and not use_new_symbolizer:
self.llvm_symbolizers[binary] = self.last_llvm_symbolizer
else:
self.last_llvm_symbolizer = LLVMSymbolizerFactory(
self.system, guess_arch(addr), self.dsym_hints)
self.llvm_symbolizers[binary] = self.last_llvm_symbolizer
# Use the chain of symbolizers:
# Breakpad symbolizer -> LLVM symbolizer -> addr2line/atos
# (fall back to next symbolizer if the previous one fails).
if not binary in symbolizers:
symbolizers[binary] = ChainSymbolizer(
[BreakpadSymbolizerFactory(binary), self.llvm_symbolizers[binary]])
result = symbolizers[binary].symbolize(addr, binary, offset)
if result is None:
# Initialize system symbolizer only if other symbolizers failed.
symbolizers[binary].append_symbolizer(
SystemSymbolizerFactory(self.system, addr, binary))
result = symbolizers[binary].symbolize(addr, binary, offset)
# The system symbolizer must produce some result.
assert result
return result
def get_symbolized_lines(self, symbolized_lines):
if not symbolized_lines:
return [self.current_line]
else:
result = []
for symbolized_frame in symbolized_lines:
result.append(' #%s %s' % (str(self.frame_no), symbolized_frame.rstrip()))
self.frame_no += 1
return result
def process_logfile(self):
self.frame_no = 0
while True:
line = logfile.readline()
if not line:
break
processed = self.process_line(line)
print '\n'.join(processed)
def process_line(self, line):
self.current_line = line.rstrip()
#0 0x7f6e35cf2e45 (/blah/foo.so+0x11fe45)
stack_trace_line_format = (
'^( *#([0-9]+) *)(0x[0-9a-f]+) *\((.*)\+(0x[0-9a-f]+)\)')
match = re.match(stack_trace_line_format, line)
if not match:
return [self.current_line]
if DEBUG:
print line
_, frameno_str, addr, binary, offset = match.groups()
if frameno_str == '0':
# Assume that frame #0 is the first frame of new stack trace.
self.frame_no = 0
original_binary = binary
if self.binary_name_filter:
binary = self.binary_name_filter(binary)
symbolized_line = self.symbolize_address(addr, binary, offset)
if not symbolized_line:
if original_binary != binary:
symbolized_line = self.symbolize_address(addr, binary, offset)
return self.get_symbolized_lines(symbolized_line)
if __name__ == '__main__':
parser = argparse.ArgumentParser(formatter_class=argparse.RawDescriptionHelpFormatter,
description='ASan symbolization script',
epilog='''Example of use:
asan_symbolize.py -c "$HOME/opt/cross/bin/arm-linux-gnueabi-" -s "$HOME/SymbolFiles" < asan.log''')
parser.add_argument('path_to_cut', nargs='*',
help='pattern to be cut from the result file path ')
parser.add_argument('-d','--demangle', action='store_true',
help='demangle function names')
parser.add_argument('-s', metavar='SYSROOT',
help='set path to sysroot for sanitized binaries')
parser.add_argument('-c', metavar='CROSS_COMPILE',
help='set prefix for binutils')
parser.add_argument('-l','--logfile', default=sys.stdin, type=argparse.FileType('r'),
help='set log file name to parse, default is stdin')
args = parser.parse_args()
if args.path_to_cut:
fix_filename_patterns = args.path_to_cut
if args.demangle:
demangle = True
if args.s:
binary_name_filter = sysroot_path_filter
sysroot_path = args.s
if args.c:
binutils_prefix = args.c
if args.logfile:
logfile = args.logfile
else:
logfile = sys.stdin
loop = SymbolizationLoop(binary_name_filter)
loop.process_logfile()

View File

@ -0,0 +1,41 @@
#!/usr/bin/python
# See https://api.launchpad.net/+apidoc/devel.html#binary_package_publishing_history
# See https://help.launchpad.net/API/launchpadlib
from launchpadlib.launchpad import Launchpad
import os
print 'Please, wait...'
USERNAME='dismine'
PPA='valentina-dev'
PACKAGE='valentina'
print 'Connect to Service.'
cachedir = os.environ['HOME'] + '/.launchpadlib/cache/'
launchpad = Launchpad.login_anonymously('just testing', 'production', cachedir)
print 'Getting package information.'
ppa = launchpad.people[USERNAME].getPPAByName(name=PPA)
bins = ppa.getPublishedBinaries(binary_name=PACKAGE)
builds = []
total = 0
print 'Creation statistic.'
for bin in bins:
count = bin.getDownloadCount()
total += count
if (count > 0):
builds.append([count,'%s %s' % (bin.binary_package_name,bin.binary_package_version)])
builds_sorted = sorted(builds,key=lambda count: count[0],reverse=True)
for build in builds_sorted:
print '%s:%s' % (build[0], build[1])
print 'Total: %s' % (total)

5
scripts/lrelease.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh
# Run this script if you want release all translated string in program.
# lrelease doesn't work with recursive *.pro file and without direct pointing to correct *.pro doesn't find anything.
# Please run this script from folder <root_folder>/scripts.
lrelease -removeidentical -nounfinished ../share/translations.pro

5
scripts/lupdate.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh
# Run this script if you want find and update all string in code.
# lupdate doesn't work with recursive *.pro file and without direct pointing to correct *.pro file just update exists strings in code.
# Please run this script from folder <root_folder>/scripts.
lupdate -recursive ../share/translations.pro

View File

@ -1,5 +1,10 @@
#!/bin/sh
# Script generate developer documentation for progect.
# Output directory doc/
# Run from root directory of project
# Script generate developer documentation for whole progect.
# Output directories src/app/doc/, src/libs/qmuparser/doc/
# Run from "scripts" directory
cd ..
cd src/app
doxygen doc/doxygen/Doxyfile
cd ..
cd libs/qmuparser
doxygen doc/doxygen/Doxyfile

BIN
share/Valentina-Logo_v1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

BIN
share/Valentina-Logo_v2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

View File

@ -0,0 +1,27 @@
/************************************************************************
**
** @file %FILENAME%
** @author Roman Telezhynskyi <dismine(at)gmail.com>
** @date %DAY% %MONTH%, %YEAR%
**
** @brief
** @copyright
** This source code is part of the Valentine project, a pattern making
** program, whose allow create and modeling patterns of clothing.
** Copyright (C) %YEAR% Valentina project
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
**
** Valentina is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** Valentina is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
**
*************************************************************************/

17
share/coverity_model.cpp Normal file
View File

@ -0,0 +1,17 @@
/* Coverity Scan model
*
* This is a modeling file for Coverity Scan. Modeling helps to avoid false
* positives.
*
* - A model file can't import any header files.
* - Therefore only some built-in primitives like int, char and void are
* available but not wchar_t, NULL etc.
* - Modeling doesn't need full structs and typedefs. Rudimentary structs
* and similar types are sufficient.
* - An uninitialized local pointer is not an error. It signifies that the
* variable could be either NULL or have some data.
*
* Coverity Scan doesn't pick up modifications automatically. The model file
* must be uploaded by an admin in the analysis settings of
* http://scan.coverity.com/projects/1820
*/

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 716 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 649 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 893 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 808 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 736 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 925 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 864 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 655 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 255 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 944 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 977 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

View File

@ -1 +0,0 @@
IDI_ICON1 ICON DISCARDABLE "icon/64x64/icon64x64.ico"

38
share/translations.pro Normal file
View File

@ -0,0 +1,38 @@
# Don't use this pro file for building project!!!
# I made this hack for creation one TS file for whole project.
# Because we have several libraries that also have strings for translation, have several TS files for each
# subproject annoying.
#
# Original idea "How to generate a single translation file for a large Qt project?"
# https://stackoverflow.com/questions/1829474/how-to-generate-a-single-translation-file-for-a-large-qt-project
TEMPLATE = app
DEPENDPATH += \
../src/app \
../src/libs/qmuparser \
../src/libs/vpropertyexplorer \
../src/libs/ifc \
../src/libs/vobj
include(../src/app/app.pri)
include(../src/libs/qmuparser/qmuparser.pri)
include(../src/libs/vpropertyexplorer/vpropertyexplorer.pri)
include(../src/libs/ifc/ifc.pri)
include(../src/libs/vobj/vobj.pri)
# Add here path to new translation file with name "valentina_*_*.ts" if you want to add new language.
# Same paths in variable INSTALL_TRANSLATIONS (app.pro).
# File valentina.ts we use in transifex.com. It is empty translation file only with english inside. transifex.com use
# this file like base for new language. Don't add path to valentina.ts to INSTALL_TRANSLATIONS variable (app.pro).
# When adding a translation here, also add it in the macx part (app.pro).
TRANSLATIONS += translations/valentina.ts \
translations/valentina_ru_RU.ts \
translations/valentina_uk_UA.ts \
translations/valentina_de_DE.ts \
translations/valentina_cs_CZ.ts \
translations/valentina_he_IL.ts \
translations/valentina_fr_FR.ts \
translations/valentina_it_IT.ts \
translations/valentina_nl_NL.ts \
translations/valentina_id_ID.ts

View File

@ -0,0 +1 @@
/* Intentionally empty */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorCodeStyle>
<!-- Written by QtCreator 3.0.1, 2014-05-11T15:41:32. -->
<qtcreator>
<data>
<variable>CodeStyleData</variable>
<valuemap type="QVariantMap">
<value type="bool" key="AlignAssignments">false</value>
<value type="bool" key="AutoSpacesForTabs">false</value>
<value type="bool" key="BindStarToIdentifier">true</value>
<value type="bool" key="BindStarToLeftSpecifier">false</value>
<value type="bool" key="BindStarToRightSpecifier">false</value>
<value type="bool" key="BindStarToTypeName">false</value>
<value type="bool" key="ExtraPaddingForConditionsIfConfusingAlign">true</value>
<value type="bool" key="IndentAccessSpecifiers">false</value>
<value type="bool" key="IndentBlockBody">true</value>
<value type="bool" key="IndentBlockBraces">false</value>
<value type="bool" key="IndentBlocksRelativeToSwitchLabels">false</value>
<value type="bool" key="IndentClassBraces">false</value>
<value type="bool" key="IndentControlFlowRelativeToSwitchLabels">true</value>
<value type="bool" key="IndentDeclarationsRelativeToAccessSpecifiers">true</value>
<value type="bool" key="IndentEnumBraces">false</value>
<value type="bool" key="IndentFunctionBody">true</value>
<value type="bool" key="IndentFunctionBraces">false</value>
<value type="bool" key="IndentNamespaceBody">false</value>
<value type="bool" key="IndentNamespaceBraces">false</value>
<value type="int" key="IndentSize">4</value>
<value type="bool" key="IndentStatementsRelativeToSwitchLabels">true</value>
<value type="bool" key="IndentSwitchLabels">true</value>
<value type="int" key="PaddingMode">2</value>
<value type="bool" key="SpacesForTabs">true</value>
<value type="int" key="TabSize">4</value>
</valuemap>
</data>
<data>
<variable>DisplayName</variable>
<value type="QString">Valentina</value>
</data>
</qtcreator>

37
src/app/app.pri Normal file
View File

@ -0,0 +1,37 @@
# Suport subdirectories. Just better project code tree.
include(container/container.pri)
include(dialogs/dialogs.pri)
include(geometry/geometry.pri)
include(tools/tools.pri)
include(widgets/widgets.pri)
include(xml/xml.pri)
include(undocommands/undocommands.pri)
include(visualization/visualization.pri)
include(core/core.pri)
# ADD TO EACH PATH $$PWD VARIABLE!!!!!!
# This need for corect working file translations.pro
# Some source files
SOURCES += \
$$PWD/main.cpp \
$$PWD/mainwindow.cpp \
$$PWD/tablewindow.cpp \
$$PWD/stable.cpp \
$$PWD/version.cpp \
$$PWD/options.cpp
# Some header files
HEADERS += \
$$PWD/mainwindow.h \
$$PWD/options.h \
$$PWD/tablewindow.h \
$$PWD/stable.h \
$$PWD/version.h
# Main forms
FORMS += \
$$PWD/mainwindow.ui \
$$PWD/tablewindow.ui

419
src/app/app.pro Normal file
View File

@ -0,0 +1,419 @@
#-------------------------------------------------
#
# Project created by QtCreator 2013-06-18T12:36:43
#
#-------------------------------------------------
# Compilation main binary file
# File with common stuff for whole project
include(../../Valentina.pri)
# Here we don't see "network" library, but, i think, "printsupport" depend on this library, so we still need this
# library in installer.
QT += core gui widgets xml svg printsupport xmlpatterns
# We want create executable file
TEMPLATE = app
# Name of binary file
TARGET = valentina
# Use out-of-source builds (shadow builds)
CONFIG -= debug_and_release debug_and_release_target
# We use C++11 standard
CONFIG += c++11
# Since Qt 5.4.0 the source code location is recorded only in debug builds.
# We need this information also in release builds. For this need define QT_MESSAGELOGCONTEXT.
DEFINES += QT_MESSAGELOGCONTEXT
# Directory for executable file
DESTDIR = bin
# Directory for files created moc
MOC_DIR = moc
# Directory for objecs files
OBJECTS_DIR = obj
# Directory for files created rcc
RCC_DIR = rcc
# Directory for files created uic
UI_DIR = uic
# Suport subdirectories. Just better project code tree.
include(app.pri)
# This include path help promoute VMainGraphicsView on main window. Without it compiler can't find path to custom view
INCLUDEPATH += "$${PWD}/widgets"
# Resource files. This files will be included in binary.
RESOURCES += \
share/resources/icon.qrc \ # All other icons except cursors and Windows theme.
share/resources/cursor.qrc \ # Tools cursor icons.
share/resources/theme.qrc \ # Windows theme icons.
share/resources/measurements.qrc \ # For measurements files that we save as resource.
share/resources/flags.qrc
# Compilation will fail without this files after we added them to this section.
OTHER_FILES += \
share/resources/valentina.rc \ # For Windows system.
share/resources/icon/64x64/icon64x64.ico # Valentina's logo.
# Set using ccache. Function enable_ccache() defined in Valentina.pri.
macx {
CONFIG(debug, debug|release){
$$enable_ccache()# Use only in debug mode on Mac
}
} else {
$$enable_ccache()
}
# Set precompiled headers. Function set_PCH() defined in Valentina.pri.
$$set_PCH()
CONFIG(debug, debug|release){
# Debug mode
unix {
#Turn on compilers warnings.
*-g++{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${UI_DIR}" \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
-isystem "$${OUT_PWD}/$${RCC_DIR}" \
$$GCC_DEBUG_CXXFLAGS # See Valentina.pri for more details.
#gccs 4.8.0 Address Sanitizer
#http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/
QMAKE_CFLAGS+=-fsanitize=address -fno-omit-frame-pointer
QMAKE_LFLAGS+=-fsanitize=address
}
clang*{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${UI_DIR}" \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
-isystem "$${OUT_PWD}/$${RCC_DIR}" \
$$CLANG_DEBUG_CXXFLAGS # See Valentina.pri for more details.
}
} else {
*-g++{
QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See Valentina.pri for more details.
}
}
#Calculate latest tag distance and build revision only in release mode. Change number each time requare
#recompilation precompiled headers file.
DEFINES += "LATEST_TAG_DISTANCE=0"
DEFINES += "BUILD_REVISION=\\\"uknown\\\""
}else{
# Release mode
DEFINES += V_NO_ASSERT
!unix:*-g++{
QMAKE_CXXFLAGS += -fno-omit-frame-pointer # Need for exchndl.dll
}
# Turn on debug symbols in release mode on Unix systems.
# On Mac OS X temporarily disabled. Need find way how to strip binary file.
!macx:!win32-msvc*{
QMAKE_CXXFLAGS_RELEASE += -g -gdwarf-3
QMAKE_CFLAGS_RELEASE += -g -gdwarf-3
QMAKE_LFLAGS_RELEASE =
}
#latest tag distance number for using in version
HG_DISTANCE=$$system(hg log -r tip --template '{latesttagdistance}')
isEmpty(HG_DISTANCE){
HG_DISTANCE = 0 # if we can't find local revision left 0.
}
message("Latest tag distance:" $${HG_DISTANCE})
DEFINES += "LATEST_TAG_DISTANCE=$${HG_DISTANCE}" # Make available latest tag distance number in sources.
#build revision number for using in version
unix {
HG_HESH=$$system("hg log -r tip --template '{node|short}'")
} else {
# Use escape character before "|" on Windows
HG_HESH=$$system(hg log -r tip --template "{node^|short}")
}
isEmpty(HG_HESH){
HG_HESH = "unknown" # if we can't find build revision left unknown.
}
message("Build revision:" $${HG_HESH})
DEFINES += "BUILD_REVISION=\\\"$${HG_HESH}\\\"" # Make available build revision number in sources.
}
# Some extra information about Qt. Can be usefull.
message(Qt version: $$[QT_VERSION])
message(Qt is installed in $$[QT_INSTALL_PREFIX])
message(Qt resources can be found in the following locations:)
message(Documentation: $$[QT_INSTALL_DOCS])
message(Header files: $$[QT_INSTALL_HEADERS])
message(Libraries: $$[QT_INSTALL_LIBS])
message(Binary files (executables): $$[QT_INSTALL_BINS])
message(Plugins: $$[QT_INSTALL_PLUGINS])
message(Data files: $$[QT_INSTALL_DATA])
message(Translation files: $$[QT_INSTALL_TRANSLATIONS])
message(Settings: $$[QT_INSTALL_SETTINGS])
message(Examples: $$[QT_INSTALL_EXAMPLES])
# Path to recource file.
win32:RC_FILE = share/resources/valentina.rc
# Keep path to all files with standard measurements we support right now
INSTALL_STANDARD_MEASHUREMENTS += share/resources/tables/standard/GOST_man_ru.vst
TRANSLATIONS_PATH = ../../share/translations
# Add to this variable all translation files that you want install with program.
# For generation *.qm file first you need create *.ts.
# See section TRANSLATIONS in file ../../share/translations/translations.pro.
INSTALL_TRANSLATIONS += \
$${TRANSLATIONS_PATH}/valentina_ru_RU.qm \
$${TRANSLATIONS_PATH}/valentina_uk_UA.qm \
$${TRANSLATIONS_PATH}/valentina_de_DE.qm \
$${TRANSLATIONS_PATH}/valentina_cs_CZ.qm \
$${TRANSLATIONS_PATH}/valentina_he_IL.qm \
$${TRANSLATIONS_PATH}/valentina_fr_FR.qm \
$${TRANSLATIONS_PATH}/valentina_it_IT.qm \
$${TRANSLATIONS_PATH}/valentina_nl_NL.qm \
$${TRANSLATIONS_PATH}/valentina_id_ID.qm
# Set "make install" command for Unix-like systems.
unix{
# Prefix for binary file.
isEmpty(PREFIX){
PREFIX = $$DEFAULT_PREFIX
}
unix:!macx{
DATADIR =$$PREFIX/share
DEFINES += DATADIR=\\\"$$DATADIR\\\" PKGDATADIR=\\\"$$PKGDATADIR\\\"
# Path to bin file after installation
target.path = $$PREFIX/bin
# .desktop file
desktop.path = $$DATADIR/applications/
desktop.files += ../../dist/$${TARGET}.desktop
# logo
pixmaps.path = $$DATADIR/pixmaps/
pixmaps.files += ../../dist/$${TARGET}.png \
../../dist/application-x-valentina-pattern.png
# Path to translation files after installation
translations.path = $$DATADIR/$${TARGET}/translations/
translations.files = $$INSTALL_TRANSLATIONS
# Path to standard measurement after installation
standard.path = $$DATADIR/$${TARGET}/tables/standard/
standard.files = $$INSTALL_STANDARD_MEASHUREMENTS
INSTALLS += \
target \
desktop \
pixmaps \
translations \
standard
}
macx{
# Some macx stuff
QMAKE_MAC_SDK = macosx
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.6
# Path to resources in app bundle
RESOURCES_DIR = "Contents/Resources"
FRAMEWORKS_DIR = "Contents/Frameworks"
# On macx we will use app bundle. Bundle doesn't need bin directory inside.
# See issue #166: Creating OSX Homebrew (Mac OS X package manager) formula.
target.path = $$PREFIX/
# Copy in bundle translation files.
exists($${TRANSLATIONS_PATH}/valentina_ru_RU.qm){
TRANSLATION_ru_RU.files += \
$${TRANSLATIONS_PATH}/valentina_ru_RU.qm \
$${TRANSLATIONS_PATH}/Localizable.strings
TRANSLATION_ru_RU.path = "$$RESOURCES_DIR/translations/ru_RU.lproj"
QMAKE_BUNDLE_DATA += TRANSLATION_ru_RU
}
exists($${TRANSLATIONS_PATH}/valentina_uk_UA.qm){
TRANSLATION_uk_UA.files += \
$${TRANSLATIONS_PATH}/valentina_uk_UA.qm \
$${TRANSLATIONS_PATH}/Localizable.strings
TRANSLATION_uk_UA.path = "$$RESOURCES_DIR/translations/uk_UA.lproj"
QMAKE_BUNDLE_DATA += TRANSLATION_uk_UA
}
exists($${TRANSLATIONS_PATH}/valentina_de_DE.qm){
TRANSLATION_de_DE.files += \
$${TRANSLATIONS_PATH}/valentina_de_DE.qm \
$${TRANSLATIONS_PATH}/Localizable.strings
TRANSLATION_de_DE.path = "$$RESOURCES_DIR/translations/de_DE.lproj"
QMAKE_BUNDLE_DATA += TRANSLATION_de_DE
}
exists($${TRANSLATIONS_PATH}/valentina_cs_CZ.qm){
TRANSLATION_cs_CZ.files += \
$${TRANSLATIONS_PATH}/valentina_cs_CZ.qm \
$${TRANSLATIONS_PATH}/Localizable.strings
TRANSLATION_cs_CZ.path = "$$RESOURCES_DIR/translations/cs_CZ.lproj"
QMAKE_BUNDLE_DATA += TRANSLATION_cs_CZ
}
exists($${TRANSLATIONS_PATH}/valentina_he_IL.qm){
TRANSLATION_he_IL.files += \
$${TRANSLATIONS_PATH}/valentina_he_IL.qm \
$${TRANSLATIONS_PATH}/Localizable.strings
TRANSLATION_he_IL.path = "$$RESOURCES_DIR/translations/he_IL.lproj"
QMAKE_BUNDLE_DATA += TRANSLATION_he_IL
}
exists($${TRANSLATIONS_PATH}/valentina_fr_FR.qm){
TRANSLATION_fr_FR.files += \
$${TRANSLATIONS_PATH}/valentina_fr_FR.qm \
$${TRANSLATIONS_PATH}/Localizable.strings
TRANSLATION_fr_FR.path = "$$RESOURCES_DIR/translations/fr_FR.lproj"
QMAKE_BUNDLE_DATA += TRANSLATION_fr_FR
}
exists($${TRANSLATIONS_PATH}/valentina_it_IT.qm){
TRANSLATION_it_IT.files += \
$${TRANSLATIONS_PATH}/valentina_it_IT.qm \
$${TRANSLATIONS_PATH}/Localizable.strings
TRANSLATION_it_IT.path = "$$RESOURCES_DIR/translations/it_IT.lproj"
QMAKE_BUNDLE_DATA += TRANSLATION_it_IT
}
exists($${TRANSLATIONS_PATH}/valentina_nl_NL.qm){
TRANSLATION_nl_NL.files += \
$${TRANSLATIONS_PATH}/valentina_nl_NL.qm \
$${TRANSLATIONS_PATH}/Localizable.strings
TRANSLATION_nl_NL.path = "$$RESOURCES_DIR/translations/nl_NL.lproj"
QMAKE_BUNDLE_DATA += TRANSLATION_nl_NL
}
exists($${TRANSLATIONS_PATH}/valentina_id_ID.qm){
TRANSLATION_id_ID.files += \
$${TRANSLATIONS_PATH}/valentina_id_ID.qm \
$${TRANSLATIONS_PATH}/Localizable.strings
TRANSLATION_id_ID.path = "$$RESOURCES_DIR/translations/id_ID.lproj"
QMAKE_BUNDLE_DATA += TRANSLATION_id_ID
}
qmuparser.path = $$FRAMEWORKS_DIR
qmuparser.files = $${OUT_PWD}/../libs/qmuparser/$${DESTDIR}/
qmuparser.files += $${OUT_PWD}/../libs/qmuparser/$${DESTDIR}/libqmuparser.2.dylib
vpropertyexplorer.path = $$FRAMEWORKS_DIR
vpropertyexplorer.files = $${OUT_PWD}/../libs/vpropertyexplorer/$${DESTDIR}/
# logo on macx.
ICON = ../../dist/Valentina.icns
# Copy to bundle standard measurements files
standard.path = $$RESOURCES_DIR/tables/standard/
standard.files = $$INSTALL_STANDARD_MEASHUREMENTS
QMAKE_BUNDLE_DATA += \
standard \
qmuparser \
vpropertyexplorer
}
}
# Some systems use special name for lrelease. For example opensuse 13.2 has lrelease-qt5.
isEmpty(LRELEASE){
LRELEASE = lrelease
}
# Run generation *.qm file for available *.ts files each time you run qmake.
for(_translation_name, INSTALL_TRANSLATIONS) {
_translation_name_qm = $$basename(_translation_name)
_translation_name_ts = $$section(_translation_name_qm, ".", 0, 0).ts
system($$shell_path($$[QT_INSTALL_BINS]/$$LRELEASE) -removeidentical -nounfinished $$shell_path($${PWD}/$${TRANSLATIONS_PATH}/$$_translation_name_ts) -qm $$shell_path($${PWD}/$$_translation_name))
}
for(DIR, INSTALL_TRANSLATIONS) {
#add these absolute paths to a variable which
#ends up as 'mkcommands = path1 path2 path3 ...'
tr_path += $${PWD}/$$DIR
}
# Make possible run program even you do not install it. Seek files in local directory.
copyToDestdir($$tr_path, $$shell_path($${OUT_PWD}/$$DESTDIR/translations))
for(DIR, INSTALL_STANDARD_MEASHUREMENTS) {
#add these absolute paths to a variable which
#ends up as 'mkcommands = path1 path2 path3 ...'
st_path += $${PWD}/$$DIR
}
copyToDestdir($$st_path, $$shell_path($${OUT_PWD}/$$DESTDIR/tables/standard))
# QMuParser library
win32:CONFIG(release, debug|release): LIBS += -L$${OUT_PWD}/../libs/qmuparser/$${DESTDIR} -lqmuparser2
else:win32:CONFIG(debug, debug|release): LIBS += -L$${OUT_PWD}/../libs/qmuparser/$${DESTDIR} -lqmuparser2
else:unix: LIBS += -L$${OUT_PWD}/../libs/qmuparser/$${DESTDIR} -lqmuparser
INCLUDEPATH += $${PWD}/../libs/qmuparser
DEPENDPATH += $${PWD}/../libs/qmuparser
# VPropertyExplorer library
win32:CONFIG(release, debug|release): LIBS += -L$${OUT_PWD}/../libs/vpropertyexplorer/$${DESTDIR} -lvpropertyexplorer
else:win32:CONFIG(debug, debug|release): LIBS += -L$${OUT_PWD}/../libs/vpropertyexplorer/$${DESTDIR} -lvpropertyexplorer
else:unix: LIBS += -L$${OUT_PWD}/../libs/vpropertyexplorer/$${DESTDIR} -lvpropertyexplorer
INCLUDEPATH += $${PWD}/../libs/vpropertyexplorer
DEPENDPATH += $${PWD}/../libs/vpropertyexplorer
# IFC static library
unix|win32: LIBS += -L$$OUT_PWD/../libs/ifc/$${DESTDIR}/ -lifc
INCLUDEPATH += $$PWD/../libs/ifc
DEPENDPATH += $$PWD/../libs/ifc
win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/ifc/$${DESTDIR}/ifc.lib
else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/ifc/$${DESTDIR}/libifc.a
# VObj static library
unix|win32: LIBS += -L$$OUT_PWD/../libs/vobj/$${DESTDIR}/ -lvobj
INCLUDEPATH += $$PWD/../libs/vobj
DEPENDPATH += $$PWD/../libs/vobj
win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/vobj/$${DESTDIR}/vobj.lib
else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/vobj/$${DESTDIR}/libvobj.a
# Strip after you link all libaries.
CONFIG(release, debug|release){
win32:!win32-msvc*{
# Strip debug symbols.
QMAKE_POST_LINK += objcopy --only-keep-debug bin/${TARGET} bin/${TARGET}.dbg &&
QMAKE_POST_LINK += objcopy --strip-debug bin/${TARGET} &&
QMAKE_POST_LINK += objcopy --add-gnu-debuglink="bin/${TARGET}.dbg" bin/${TARGET}
}
unix:!macx{
# Strip debug symbols.
QMAKE_POST_LINK += objcopy --only-keep-debug ${TARGET} ${TARGET}.dbg &&
QMAKE_POST_LINK += objcopy --strip-debug ${TARGET} &&
QMAKE_POST_LINK += objcopy --add-gnu-debuglink="${TARGET}.dbg" ${TARGET}
}
}
macx{
# run macdeployqt to include all qt libraries in packet
QMAKE_POST_LINK += $$[QT_INSTALL_BINS]/macdeployqt $${OUT_PWD}/$${DESTDIR}/$${TARGET}.app
}

View File

@ -0,0 +1,266 @@
/************************************************************************
**
** @file calculator.cpp
** @author Roman Telezhynskyi <dismine(at)gmail.com>
** @date November 15, 2013
**
** @brief
** @copyright
** This source code is part of the Valentine project, a pattern making
** program, whose allow create and modeling patterns of clothing.
** Copyright (C) 2013 Valentina project
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
**
** Valentina is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** Valentina is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
**
*************************************************************************/
#include "calculator.h"
#include <QDebug>
#include <QSettings>
#include "../core/vapplication.h"
#include "vcontainer.h"
#include "../core/vsettings.h"
using namespace qmu;
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief Calculator class constructor. Make easy initialization math parser.
*
* This constructor hide initialization variables, operators, character sets.
* Use this constuctor for evaluation formula. All formulas must be converted to internal look.
* Example:
*
* const QString formula = qApp->FormulaFromUser(edit->text());
* Calculator *cal = new Calculator(data);
* const qreal result = cal->EvalFormula(formula);
* delete cal;
*
* @param data pointer to a variable container.
*/
Calculator::Calculator(const VContainer *data)
:QmuParser(), vVarVal(nullptr), data(data)
{
SCASSERT(data != nullptr)
InitCharacterSets();
setAllowSubexpressions(false);//Only one expression per time
SetSepForEval();
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief Calculator class constructor. Make easy initialization math parser.
*
* This constructor hide initialization variables, operators, character sets.
* Use this constuctor to get tokens from formula. All formulas must be converted to external look.
* Example:
*
* Calculator *cal = new Calculator(formula, false);
* tokens = cal->GetTokens();
* numbers = cal->GetNumbers();
* delete cal;
*
* @param formula string with formula.
* @param fromUser true if we parse formula from user
*/
Calculator::Calculator(const QString &formula, bool fromUser)
:QmuParser(), vVarVal(nullptr), data(nullptr)
{
InitCharacterSets();
setAllowSubexpressions(false);//Only one expression per time
SetVarFactory(AddVariable, this);
SetSepForTr(fromUser);
SetExpr(formula);
//Need run for making tokens. Don't catch exception here, because we want know if formula has error.
Eval();
}
//---------------------------------------------------------------------------------------------------------------------
Calculator::~Calculator()
{
delete [] vVarVal;
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief eval calculate formula.
* @param formula string of formula.
* @return value of formula.
*/
qreal Calculator::EvalFormula(const QString &formula)
{
SetVarFactory(AddVariable, this);
SetSepForEval();//Reset separators options
SetExpr(formula);
qreal result = 0;
result = Eval();
QMap<int, QString> tokens = this->GetTokens();
// Remove "-" from tokens list if exist. If don't do that unary minus operation will broken.
RemoveAll(tokens, QStringLiteral("-"));
if (tokens.isEmpty())
{
return result;
}
// Add variables
InitVariables(data, tokens, formula);
return Eval();
}
//---------------------------------------------------------------------------------------------------------------------
void Calculator::InitVariables(const VContainer *data, const QMap<int, QString> &tokens, const QString &formula)
{
if (qApp->patternType() == MeasurementsType::Standard)
{
vVarVal = new qreal[2];
}
SCASSERT(data != nullptr)
const QHash<QString, QSharedPointer<VInternalVariable> > *vars = data->DataVariables();
QMap<int, QString>::const_iterator i = tokens.constBegin();
while (i != tokens.constEnd())
{
bool found = false;
if (vars->contains(i.value()))
{
QSharedPointer<VInternalVariable> var = vars->value(i.value());
if ((qApp->patternType() == MeasurementsType::Standard) &&
(var->GetType() == VarType::Measurement || var->GetType() == VarType::Increment))
{
QSharedPointer<VVariable> m = data->GetVariable<VVariable>(i.value());
m->SetValue(data->size(), data->height());
}
DefineVar(i.value(), var->GetValue());
found = true;
}
if (qApp->patternType() == MeasurementsType::Standard)
{
if (i.value() == data->SizeName())
{
vVarVal[0] = data->size();
DefineVar(data->SizeName(), &vVarVal[0]);
found = true;
}
if (i.value() == data->HeightName())
{
vVarVal[1] = data->height();
DefineVar(data->HeightName(), &vVarVal[1]);
found = true;
}
}
if (builInFunctions.contains(i.value()))
{// We found built-in function
found = true;
}
if (found == false)
{
throw qmu::QmuParserError (ecUNASSIGNABLE_TOKEN, i.value(), formula, i.key());
}
++i;
}
}
//---------------------------------------------------------------------------------------------------------------------
void Calculator::InitCharacterSets()
{
//String with all unique symbols for supported alpabets.
// See script alphabets.py for generation and more information.
//Note. MSVC doen't support normal string concatenation for long string. Thats why we use QStringList in this place.
QStringList symbols = QStringList() << "ցЀĆЈVӧĎАғΕĖӅИқΝĞơРңњΥĦШҫ̆جگĮаҳѕεشԶиһνԾрυلՆӝшËՎҔPÓՖXӛӟŞӣզhëծpóӞնxßվāŁЃֆĉЋ"
<< "CŬđҐГΒęҘЛΚŘġҠУGاհЫدԱҰгβطԹõлκKՁÀуςهՉÈыvیՑÐSOřӘћաőcӐթèkàѓżűðsķչøӥӔĀփїІĈЎ"
<< "ґĐΗЖҙĘȚΟОҡĠآΧЦتЮұİزηжԸغοоÁՀقχцÉՈيюÑՐђӋіәťӆўáŠĺѐfөըnñŰӤӨӹոľЁրăЉŭċБӸēłΔҖ"
<< "ЙŤěΜӜDСձģΤӰЩīņحҮбưԳصδHйԻŇμӲӴсՃمτƠщՋєLQŹՓŕÖYśÞaգĽæiŽիӓîqճöyջþĂօЄӦĊЌΑĒДҗј"
<< "ΙȘĚМΡéĵĢФūӚΩبĪЬүќαذԲдҷιظԺмρՂфÇωوՊьÏՒTŚĻJբdçժlïӪղtպӫAւąЇčŃЏĕӯЗΖEțŮĝПΞأĥ"
<< "ثĹЧΦÆӳЯIسŲԵзζԽпξكՅÄчφNMՍӌяӢՕÔWÎŝÜџёźեägխoӒյôwĶBžսüЂĄև̈ЊČƏљΓВҕĔӮΛКĜΣТҥĤک"
<< "ЪƯخγвŅԴŪضλкԼĴσтÅՄنъÍՌRӕՔZÝŜbåդjíլļrӵմzýռپêЅքćچЍďӱҒЕůėژșΘØҚНğńءΠFҢХħΨҪ"
<< "ЭųįҶرҲеԷňعθҺнԿفπÂхՇψÊэšՏÒUəÚѝŻşҤӑâeէŐımկòuշÕúտŔ";
// Defining identifier character sets
DefineNameChars(QStringLiteral("0123456789_") + symbols.join(""));
DefineOprtChars(symbols.join("") + QStringLiteral("+-*^/?<>=#!$%&|~_"));
}
//---------------------------------------------------------------------------------------------------------------------
// Factory function for creating new parser variables
// This could as well be a function performing database queries.
qreal* Calculator::AddVariable(const QString &a_szName, void *a_pUserData)
{
Q_UNUSED(a_szName)
Q_UNUSED(a_pUserData)
static qreal value = 0;
return &value;
}
//---------------------------------------------------------------------------------------------------------------------
void Calculator::SetSepForEval()
{
SetArgSep(',');
SetDecSep('.');
}
//---------------------------------------------------------------------------------------------------------------------
void Calculator::SetSepForTr(bool fromUser)
{
if (fromUser)
{
const bool osSeparatorValue = qApp->getSettings()->GetOsSeparator();
if (osSeparatorValue)
{
QLocale loc = QLocale::system();
SetDecSep(loc.decimalPoint().toLatin1());
SetThousandsSep(loc.groupSeparator().toLatin1());
SetArgSep(';');
}
else
{
SetArgSep(',');
SetDecSep('.');
}
}
else
{
SetArgSep(',');
SetDecSep('.');
}
}
//---------------------------------------------------------------------------------------------------------------------
void Calculator::RemoveAll(QMap<int, QString> &map, const QString &val)
{
QList<int> listKeys = map.keys(val);
if (listKeys.size() > 0)
{
for (int i = 0; i < listKeys.size(); ++i)
{
map.remove(listKeys.at(i));
}
}
}

View File

@ -0,0 +1,74 @@
/************************************************************************
**
** @file calculator.h
** @author Roman Telezhynskyi <dismine(at)gmail.com>
** @date November 15, 2013
**
** @brief
** @copyright
** This source code is part of the Valentine project, a pattern making
** program, whose allow create and modeling patterns of clothing.
** Copyright (C) 2013 Valentina project
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
**
** Valentina is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** Valentina is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
**
*************************************************************************/
#ifndef CALCULATOR_H
#define CALCULATOR_H
#include "../../libs/qmuparser/qmuparser.h"
class VContainer;
/**
* @brief The Calculator class for calculation formula.
*
* Main purpose make easy evaluate value of formula and get tokens.
* Note. If created to many parser for different purpes in the same time parser can work wrong.
* Example:
* DialogEditWrongFormula *dialog = new DialogEditWrongFormula(data);
* dialog->setFormula(formula);
* if (dialog->exec() == QDialog::Accepted)
* {
* formula = dialog->getFormula();
* //Need delete dialog here because parser in dialog don't allow use correct separator for parsing here.
* //Don't know why.
* delete dialog;
* Calculator *cal = new Calculator(data);
* result = cal->EvalFormula(formula);
* delete cal;//Here can be memory leak, but dialog already check this formula and probability very low.
* }
*/
class Calculator:public qmu::QmuParser
{
public:
Calculator(const VContainer *data);
Calculator(const QString &formula, bool fromUser = true);
~Calculator();
qreal EvalFormula(const QString &formula);
private:
Q_DISABLE_COPY(Calculator)
qreal *vVarVal;
const VContainer *data;
void InitVariables(const VContainer *data, const QMap<int, QString> &tokens, const QString &formula);
void InitCharacterSets();
static qreal* AddVariable(const QString &a_szName, void *a_pUserData);
void SetSepForEval();
void SetSepForTr(bool fromUser);
static void RemoveAll(QMap<int, QString> &map, const QString &val);
};
#endif // CALCULATOR_H

View File

@ -0,0 +1,38 @@
# ADD TO EACH PATH $$PWD VARIABLE!!!!!!
# This need for corect working file translations.pro
SOURCES += \
$$PWD/vcontainer.cpp \
$$PWD/calculator.cpp \
$$PWD/variables/vmeasurement.cpp \
$$PWD/variables/vincrement.cpp \
$$PWD/variables/vvariable.cpp \
$$PWD/variables/vinternalvariable.cpp \
$$PWD/variables/vlineangle.cpp \
$$PWD/variables/varclength.cpp \
$$PWD/variables/vcurvelength.cpp \
$$PWD/variables/vlinelength.cpp \
$$PWD/variables/vsplinelength.cpp \
$$PWD/vformula.cpp
HEADERS += \
$$PWD/vcontainer.h \
$$PWD/calculator.h \
$$PWD/variables/vmeasurement.h \
$$PWD/variables/vincrement.h \
$$PWD/variables/vvariable.h \
$$PWD/variables/vinternalvariable.h \
$$PWD/variables/vlineangle.h \
$$PWD/variables.h \
$$PWD/variables/vcurvelength.h \
$$PWD/variables/varclength.h \
$$PWD/variables/vlinelength.h \
$$PWD/variables/vsplinelength.h \
$$PWD/variables/vinternalvariable_p.h \
$$PWD/variables/vvariable_p.h \
$$PWD/variables/vincrement_p.h \
$$PWD/variables/vcurvelength_p.h \
$$PWD/variables/vlineangle_p.h \
$$PWD/variables/vlinelength_p.h \
$$PWD/variables/vmeasurement_p.h \
$$PWD/vformula.h

View File

@ -0,0 +1,40 @@
/************************************************************************
**
** @file variables.h
** @author Roman Telezhynskyi <dismine(at)gmail.com>
** @date 28 7, 2014
**
** @brief
** @copyright
** This source code is part of the Valentine project, a pattern making
** program, whose allow create and modeling patterns of clothing.
** Copyright (C) 2014 Valentina project
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
**
** Valentina is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** Valentina is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
**
*************************************************************************/
#ifndef VARIABLES_H
#define VARIABLES_H
#include "variables/vinternalvariable.h"
#include "variables/vmeasurement.h"
#include "variables/vincrement.h"
#include "variables/varclength.h"
#include "variables/vsplinelength.h"
#include "variables/vlinelength.h"
#include "variables/vlineangle.h"
#endif // VARIABLES_H

View File

@ -0,0 +1,65 @@
/************************************************************************
**
** @file varclength.cpp
** @author Roman Telezhynskyi <dismine(at)gmail.com>
** @date 28 7, 2014
**
** @brief
** @copyright
** This source code is part of the Valentine project, a pattern making
** program, whose allow create and modeling patterns of clothing.
** Copyright (C) 2014 Valentina project
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
**
** Valentina is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** Valentina is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
**
*************************************************************************/
#include "varclength.h"
#include "../geometry/vabstractcurve.h"
#include "../core/vapplication.h"
//---------------------------------------------------------------------------------------------------------------------
VArcLength::VArcLength()
:VCurveLength()
{
SetType(VarType::ArcLength);
}
//---------------------------------------------------------------------------------------------------------------------
VArcLength::VArcLength(const quint32 &id, const quint32 &parentId, const VAbstractCurve *arc)
:VCurveLength(id, parentId, arc)
{
SetType(VarType::ArcLength);
}
//---------------------------------------------------------------------------------------------------------------------
VArcLength::VArcLength(const VArcLength &var)
:VCurveLength(var)
{}
//---------------------------------------------------------------------------------------------------------------------
VArcLength &VArcLength::operator=(const VArcLength &var)
{
if ( &var == this )
{
return *this;
}
VCurveLength::operator=(var);
return *this;
}
//---------------------------------------------------------------------------------------------------------------------
VArcLength::~VArcLength()
{}

View File

@ -0,0 +1,46 @@
/************************************************************************
**
** @file varclength.h
** @author Roman Telezhynskyi <dismine(at)gmail.com>
** @date 28 7, 2014
**
** @brief
** @copyright
** This source code is part of the Valentine project, a pattern making
** program, whose allow create and modeling patterns of clothing.
** Copyright (C) 2014 Valentina project
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
**
** Valentina is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** Valentina is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
**
*************************************************************************/
#ifndef VARCLENGTH_H
#define VARCLENGTH_H
#include "vcurvelength.h"
class VAbstractCurve;
class VArcLength :public VCurveLength
{
public:
VArcLength();
VArcLength(const quint32 &id, const quint32 &parentId, const VAbstractCurve *arc);
VArcLength(const VArcLength &var);
VArcLength &operator=(const VArcLength &var);
virtual ~VArcLength();
};
#endif // VARCLENGTH_H

View File

@ -0,0 +1,107 @@
/************************************************************************
**
** @file vcurvelength.cpp
** @author Roman Telezhynskyi <dismine(at)gmail.com>
** @date 15 8, 2014
**
** @brief
** @copyright
** This source code is part of the Valentine project, a pattern making
** program, whose allow create and modeling patterns of clothing.
** Copyright (C) 2014 Valentina project
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
**
** Valentina is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** Valentina is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
**
*************************************************************************/
#include "vcurvelength.h"
#include "vcurvelength_p.h"
#include "../core/vapplication.h"
#include "../geometry/vabstractcurve.h"
//---------------------------------------------------------------------------------------------------------------------
VCurveLength::VCurveLength()
:VInternalVariable(), d(new VCurveLengthData)
{
SetType(VarType::Unknown);
}
//---------------------------------------------------------------------------------------------------------------------
VCurveLength::VCurveLength(const quint32 &id, const quint32 &parentId, const VAbstractCurve *curve)
:VInternalVariable(), d(new VCurveLengthData(id, parentId))
{
SetType(VarType::Unknown);
SCASSERT(curve != nullptr);
SetName(curve->name());
SetValue(qApp->fromPixel(curve->GetLength()));
}
//---------------------------------------------------------------------------------------------------------------------
VCurveLength::VCurveLength(const VCurveLength &var)
:VInternalVariable(var), d(var.d)
{}
//---------------------------------------------------------------------------------------------------------------------
VCurveLength &VCurveLength::operator=(const VCurveLength &var)
{
if ( &var == this )
{
return *this;
}
VInternalVariable::operator=(var);
d = var.d;
return *this;
}
//---------------------------------------------------------------------------------------------------------------------
VCurveLength::~VCurveLength()
{}
//---------------------------------------------------------------------------------------------------------------------
bool VCurveLength::Filter(quint32 id)
{
if (d->parentId != 0)//Do not check if value zero
{// Not all curves have parents. Only those who was created after cutting the parent curve.
return d->id == id || d->parentId == id;
}
else
{
return d->id == id;
}
}
//---------------------------------------------------------------------------------------------------------------------
quint32 VCurveLength::GetId() const
{
return d->id;
}
//---------------------------------------------------------------------------------------------------------------------
void VCurveLength::SetId(const quint32 &id)
{
d->id = id;
}
//---------------------------------------------------------------------------------------------------------------------
quint32 VCurveLength::GetParentId() const
{
return d->parentId;
}
//---------------------------------------------------------------------------------------------------------------------
void VCurveLength::SetParentId(const quint32 &value)
{
d->parentId = value;
}

View File

@ -0,0 +1,57 @@
/************************************************************************
**
** @file vcurvelength.h
** @author Roman Telezhynskyi <dismine(at)gmail.com>
** @date 15 8, 2014
**
** @brief
** @copyright
** This source code is part of the Valentine project, a pattern making
** program, whose allow create and modeling patterns of clothing.
** Copyright (C) 2014 Valentina project
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
**
** Valentina is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** Valentina is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
**
*************************************************************************/
#ifndef VCURVELENGTH_H
#define VCURVELENGTH_H
#include "vinternalvariable.h"
class VAbstractCurve;
class VCurveLengthData;
class VCurveLength : public VInternalVariable
{
public:
VCurveLength();
VCurveLength(const quint32 &id, const quint32 &parentId, const VAbstractCurve *curve);
VCurveLength(const VCurveLength &var);
VCurveLength &operator=(const VCurveLength &var);
virtual ~VCurveLength();
virtual bool Filter(quint32 id);
quint32 GetId() const;
void SetId(const quint32 &id);
quint32 GetParentId() const;
void SetParentId(const quint32 &value);
private:
QSharedDataPointer<VCurveLengthData> d;
};
#endif // VCURVELENGTH_H

View File

@ -0,0 +1,68 @@
/************************************************************************
**
** @file vcurvelength_p.h
** @author Roman Telezhynskyi <dismine(at)gmail.com>
** @date 20 8, 2014
**
** @brief
** @copyright
** This source code is part of the Valentine project, a pattern making
** program, whose allow create and modeling patterns of clothing.
** Copyright (C) 2014 Valentina project
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
**
** Valentina is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** Valentina is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
**
*************************************************************************/
#ifndef VCURVELENGTH_P_H
#define VCURVELENGTH_P_H
#include <QSharedData>
#ifdef Q_CC_GNU
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#endif
class VCurveLengthData : public QSharedData
{
public:
VCurveLengthData()
:id(NULL_ID), parentId(NULL_ID)
{}
VCurveLengthData(const quint32 &id, const quint32 &parentId)
:id(id), parentId(parentId)
{}
VCurveLengthData(const VCurveLengthData &var)
:QSharedData(var), id(var.id), parentId(var.parentId)
{}
virtual ~VCurveLengthData();
quint32 id;
quint32 parentId;
};
VCurveLengthData::~VCurveLengthData()
{}
#ifdef Q_CC_GNU
#pragma GCC diagnostic pop
#endif
#endif // VCURVELENGTH_P_H

View File

@ -0,0 +1,98 @@
/************************************************************************
**
** @file vincrementtablerow.cpp
** @author Roman Telezhynskyi <dismine(at)gmail.com>
** @date November 15, 2013
**
** @brief
** @copyright
** This source code is part of the Valentine project, a pattern making
** program, whose allow create and modeling patterns of clothing.
** Copyright (C) 2013 Valentina project
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
**
** Valentina is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** Valentina is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
**
*************************************************************************/
#include "vincrement.h"
#include "vincrement_p.h"
#include "../options.h"
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief VIncrement create enpty increment
*/
VIncrement::VIncrement()
:VVariable(), d(new VIncrementData)
{
SetType(VarType::Increment);
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief VIncrementTableRow create increment
* @param name increment's name
* @param id id
* @param base value in base size and height
* @param ksize increment in sizes
* @param kheight increment in heights
* @param description description of increment
*/
VIncrement::VIncrement(const QString &name, quint32 id, qreal base, qreal ksize, qreal kheight, QString description)
:VVariable(name, base, ksize, kheight, description), d(new VIncrementData(id))
{
SetType(VarType::Increment);
}
//---------------------------------------------------------------------------------------------------------------------
VIncrement::VIncrement(const VIncrement &incr)
:VVariable(incr), d(incr.d)
{}
//---------------------------------------------------------------------------------------------------------------------
VIncrement &VIncrement::operator=(const VIncrement &incr)
{
if ( &incr == this )
{
return *this;
}
VVariable::operator=(incr);
d = incr.d;
return *this;
}
//---------------------------------------------------------------------------------------------------------------------
VIncrement::~VIncrement()
{}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief getId return id of row
* @return id
*/
quint32 VIncrement::getId() const
{
return d->id;
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief setId set id of row
* @param value id
*/
void VIncrement::setId(const quint32 &value)
{
d->id = value;
}

View File

@ -0,0 +1,55 @@
/************************************************************************
**
** @file vincrementtablerow.h
** @author Roman Telezhynskyi <dismine(at)gmail.com>
** @date November 15, 2013
**
** @brief
** @copyright
** This source code is part of the Valentine project, a pattern making
** program, whose allow create and modeling patterns of clothing.
** Copyright (C) 2013 Valentina project
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
**
** Valentina is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** Valentina is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
**
*************************************************************************/
#ifndef VINCREMENTTABLEROW_H
#define VINCREMENTTABLEROW_H
#include "vvariable.h"
class VIncrementData;
/**
* @brief The VIncrement class keep data row of increment table
*/
class VIncrement :public VVariable
{
public:
VIncrement();
VIncrement(const QString &name, quint32 id, qreal base, qreal ksize, qreal kheight,
QString description = QString());
VIncrement(const VIncrement &incr);
VIncrement &operator=(const VIncrement &incr);
virtual ~VIncrement();
quint32 getId() const;
void setId(const quint32 &value);
private:
QSharedDataPointer<VIncrementData> d;
};
#endif // VINCREMENTTABLEROW_H

Some files were not shown because too many files have changed in this diff Show More