Structural changes and updates from tgotic

This commit is contained in:
hooper114 2009-11-17 22:36:04 +00:00
parent 7fa4b32c1d
commit 1695eae7dd
17 changed files with 671 additions and 439 deletions

View File

@ -23,7 +23,9 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include "common.h" #include "common.h"
#ifdef _MSC_VER
#include <malloc.h>
#endif
static char *C25MatrixTable[10] = {"113311", "311131", "131131", "331111", "113131", "313111", static char *C25MatrixTable[10] = {"113311", "311131", "131131", "331111", "113131", "313111",
"133111", "111331", "311311", "131311"}; "133111", "111331", "311311", "131311"};

View File

@ -55,7 +55,7 @@ all: $(DLL) $(STATLIB)
$(DLL):$(DLL_OBJ) $(DLL):$(DLL_OBJ)
@echo Linking $@... @echo Linking $@...
o2dll.sh -o $@ $(DLL_OBJ) $(LIBS) #-version-info 2:2:0 -version-number 2:2:0 o2dll.sh -o $@ $(DLL_OBJ) $(LIBS)
$(STATLIB): $(LIB_OBJ) $(STATLIB): $(LIB_OBJ)
@echo Linking $@... @echo Linking $@...

View File

@ -30,7 +30,7 @@
symbol->option_2 is used to adjust the width of the resulting symbol (i.e. the symbol->option_2 is used to adjust the width of the resulting symbol (i.e. the
number of codeword columns not including row start and end data) */ number of codeword columns not including row start and end data) */
/* @(#) $Id: pdf417.c,v 1.15 2009/10/06 19:31:43 hooper114 Exp $ */ /* @(#) $Id: pdf417.c,v 1.16 2009/11/17 22:36:04 hooper114 Exp $ */
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
@ -294,10 +294,8 @@ void textprocess(int *chainemc, int *mclength, char chaine[], int start, int len
wnet++; wnet++;
} }
/* Now translate the string chainet into codewords */ /* Now translate the string chainet into codewords */
if (block > 0) { chainemc[*(mclength)] = 900;
chainemc[*(mclength)] = 900; *(mclength) = *(mclength) + 1;
*(mclength) = *(mclength) + 1;
}
for(j = 0; j < wnet; j+= 2) { for(j = 0; j < wnet; j+= 2) {
int cw_number; int cw_number;

View File

@ -157,7 +157,7 @@ int estimate_binary_length(char mode[], int length, int gs1)
return count; return count;
} }
void qr_binary(int datastream[], int version, int target_binlen, char mode[], int jisdata[], int length, int gs1) void qr_binary(int datastream[], int version, int target_binlen, char mode[], int jisdata[], int length, int gs1, int est_binlen)
{ {
/* Convert input data to a binary stream and add padding */ /* Convert input data to a binary stream and add padding */
int position = 0, debug = 0; int position = 0, debug = 0;
@ -167,9 +167,9 @@ void qr_binary(int datastream[], int version, int target_binlen, char mode[], in
int toggle, percent; int toggle, percent;
#ifndef _MSC_VER #ifndef _MSC_VER
char binary[target_binlen * 8]; char binary[est_binlen + 12];
#else #else
char* binary = (char *)_alloca(target_binlen * 8); char* binary = (char *)_alloca(est_binlen + 12);
#endif #endif
strcpy(binary, ""); strcpy(binary, "");
@ -1241,7 +1241,7 @@ int qr_code(struct zint_symbol *symbol, unsigned char source[], int length)
int* fullstream = (int *)_alloca((qr_total_codewords[version - 1] + 1) * sizeof(int)); int* fullstream = (int *)_alloca((qr_total_codewords[version - 1] + 1) * sizeof(int));
#endif #endif
qr_binary(datastream, version, target_binlen, mode, jisdata, length, gs1); qr_binary(datastream, version, target_binlen, mode, jisdata, length, gs1, est_binlen);
add_ecc(fullstream, datastream, version, target_binlen, blocks); add_ecc(fullstream, datastream, version, target_binlen, blocks);
size = qr_sizes[version - 1]; size = qr_sizes[version - 1];

View File

@ -12,7 +12,7 @@ TARGET = QtZint
INCLUDEPATH += ../backend INCLUDEPATH += ../backend
#EDIT THIS !!!! #EDIT THIS !!!!
DEFINES += NO_PNG NO_QR ZINT_VERSION=\"2.1.3\" DEFINES += NO_PNG NO_QR ZINT_VERSION="2.3.0"
!contains(DEFINES, NO_PNG) { !contains(DEFINES, NO_PNG) {
SOURCES += ../backend/png.c SOURCES += ../backend/png.c
@ -97,7 +97,7 @@ SOURCES += ../backend/2of5.c \
../backend/code1.c \ ../backend/code1.c \
qzint.cpp qzint.cpp
VERSION = 2.1.3 VERSION = 2.3.0
#DESTDIR = . #DESTDIR = .

View File

@ -9,7 +9,7 @@
ZINT_VERSION:=-DZINT_VERSION=\"2.3.0\" ZINT_VERSION:=-DZINT_VERSION=\"2.3.0\"
CC := gcc CC := gcc
CFLAGS := -D_WIN32 -O2 -fms-extensions -mms-bitfields -fno-exceptions -fomit-frame-pointer -Wall CFLAGS := -D_WIN32 -O2 -fms-extensions -mms-bitfields -fno-exceptions -fomit-frame-pointer -Wall -I../backend
prefix := /mingw prefix := /mingw
bindir := $(prefix)/bin bindir := $(prefix)/bin
DESTDIR := DESTDIR :=
@ -20,10 +20,10 @@ all: zint zint_static
windres -O coff --input-format=rc -i $< -o $@ windres -O coff --input-format=rc -i $< -o $@
zint: main.c zint.res zint: main.c zint.res
$(CC) $(CFLAGS) -DZINT_DLL -DQRENCODE_DLL -DPNG_DLL -DZLIB_DLL $(ZINT_VERSION) $? zint.res -o $@ -lzint $(CC) $(CFLAGS) -DZINT_DLL -DPNG_DLL -DZLIB_DLL $(ZINT_VERSION) $? zint.res -o $@ -L../backend -lzint
zint_static: main.c zint.res zint_static: main.c zint.res
$(CC) -static $(CFLAGS) $(ZINT_VERSION) $? zint.res -o $@ -lzint -lqrencode -lpng -lz $(CC) -static $(CFLAGS) $(ZINT_VERSION) $? zint.res -o $@ -L../backend -lzint -lpng -lz
.PHONY: install uninstall clean dist .PHONY: install uninstall clean dist

View File

@ -1,42 +1,42 @@
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#include <windows.h> #include <windows.h>
#include <winver.h> #include <winver.h>
#ifdef GCC_WINDRES #ifdef GCC_WINDRES
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
#else #else
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
#endif #endif
FILEVERSION 2,1,3,0 FILEVERSION 2,3,0,0
PRODUCTVERSION 2,1,3,0 PRODUCTVERSION 2,3,0,0
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
#ifdef _DEBUG #ifdef _DEBUG
FILEFLAGS VS_FF_DEBUG FILEFLAGS VS_FF_DEBUG
#else #else
FILEFLAGS 0 FILEFLAGS 0
#endif #endif
FILEOS VOS_NT_WINDOWS32 FILEOS VOS_NT_WINDOWS32
FILETYPE VFT_APP FILETYPE VFT_APP
FILESUBTYPE VFT2_UNKNOWN FILESUBTYPE VFT2_UNKNOWN
BEGIN BEGIN
BLOCK "StringFileInfo" BLOCK "StringFileInfo"
BEGIN BEGIN
BLOCK "040904E4" BLOCK "040904E4"
//language ID = U.S. English, char set = Windows, Multilingual //language ID = U.S. English, char set = Windows, Multilingual
BEGIN BEGIN
VALUE "FileDescription", "libzint barcode library\0" VALUE "FileDescription", "zint barcode generator\0"
VALUE "FileVersion", "2.1.3.0\0" VALUE "FileVersion", "2.3.0.0\0"
VALUE "InternalName", "zint.exe\0" VALUE "InternalName", "zint.exe\0"
VALUE "LegalCopyright", "Copyright © 2009 Robin Stuart & BogDan Vatra\0" VALUE "LegalCopyright", "Copyright © 2009 Robin Stuart & BogDan Vatra\0"
VALUE "OriginalFilename", "zint.exe\0" VALUE "OriginalFilename", "zint.exe\0"
VALUE "ProductName", "libzint\0" VALUE "ProductName", "zint\0"
VALUE "ProductVersion", "2.1.3.0\0" VALUE "ProductVersion", "2.3.0.0\0"
VALUE "License", "GNU General Public License version 3\0" VALUE "License", "GNU General Public License version 3\0"
VALUE "WWW", "http://www.sourceforge.net/projects/zint\0" VALUE "WWW", "http://www.sourceforge.net/projects/zint\0"
END END
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"
BEGIN BEGIN
VALUE "Translation", 0x0409, 1250 VALUE "Translation", 0x0409, 1250
END END
END END

View File

@ -14,13 +14,13 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * * along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/ ***************************************************************************/
#include "mainwindow.h"
#include <QApplication> #include <QApplication>
#include "mainwindow.h"
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
QApplication app(argc, argv);
Q_INIT_RESOURCE(resources); Q_INIT_RESOURCE(resources);
QApplication app(argc, argv);
MainWindow w; MainWindow w;
w.show(); w.show();
return app.exec(); return app.exec();

View File

@ -2,6 +2,9 @@
<ui version="4.0"> <ui version="4.0">
<class>mainWindow</class> <class>mainWindow</class>
<widget class="QWidget" name="mainWindow"> <widget class="QWidget" name="mainWindow">
<property name="windowModality">
<enum>Qt::NonModal</enum>
</property>
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
@ -10,10 +13,16 @@
<height>711</height> <height>711</height>
</rect> </rect>
</property> </property>
<property name="minimumSize">
<size>
<width>749</width>
<height>711</height>
</size>
</property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>800</width> <width>749</width>
<height>800</height> <height>711</height>
</size> </size>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -21,10 +30,10 @@
</property> </property>
<property name="windowIcon"> <property name="windowIcon">
<iconset resource="resources.qrc"> <iconset resource="resources.qrc">
<normaloff>:/zico.png</normaloff>:/zico.png</iconset> <normaloff>:/images/zico.png</normaloff>:/images/zico.png</iconset>
</property> </property>
<property name="styleSheet"> <property name="locale">
<string notr="true">background-image: url(:/blueback.png);</string> <locale language="English" country="UnitedStates"/>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_7"> <layout class="QVBoxLayout" name="verticalLayout_7">
<item> <item>
@ -50,7 +59,19 @@
</widget> </widget>
</item> </item>
<item row="0" column="3"> <item row="0" column="3">
<widget class="QToolButton" name="toolButton_5"> <widget class="QToolButton" name="btnZoomOut">
<property name="minimumSize">
<size>
<width>28</width>
<height>28</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>28</width>
<height>28</height>
</size>
</property>
<property name="toolTip"> <property name="toolTip">
<string>Zoom out</string> <string>Zoom out</string>
</property> </property>
@ -59,7 +80,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="resources.qrc"> <iconset resource="resources.qrc">
<normaloff>:/zoomout.png</normaloff>:/zoomout.png</iconset> <normaloff>:/images/zoomout.png</normaloff>:/images/zoomout.png</iconset>
</property> </property>
<property name="iconSize"> <property name="iconSize">
<size> <size>
@ -74,6 +95,9 @@
<property name="toolTip"> <property name="toolTip">
<string>Adjust zoom</string> <string>Adjust zoom</string>
</property> </property>
<property name="locale">
<locale language="English" country="UnitedStates"/>
</property>
<property name="minimum"> <property name="minimum">
<number>50</number> <number>50</number>
</property> </property>
@ -95,13 +119,25 @@
</widget> </widget>
</item> </item>
<item row="2" column="3"> <item row="2" column="3">
<widget class="QToolButton" name="toolButton_4"> <widget class="QToolButton" name="btnZoomIn">
<property name="minimumSize">
<size>
<width>28</width>
<height>28</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>28</width>
<height>28</height>
</size>
</property>
<property name="toolTip"> <property name="toolTip">
<string>Zoom in</string> <string>Zoom in</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="resources.qrc"> <iconset resource="resources.qrc">
<normaloff>:/zoomin.png</normaloff>:/zoomin.png</iconset> <normaloff>:/images/zoomin.png</normaloff>:/images/zoomin.png</iconset>
</property> </property>
<property name="iconSize"> <property name="iconSize">
<size> <size>
@ -112,13 +148,28 @@
</widget> </widget>
</item> </item>
<item row="4" column="0"> <item row="4" column="0">
<widget class="QToolButton" name="toolButton"> <widget class="QToolButton" name="btnRotateLeft">
<property name="minimumSize">
<size>
<width>28</width>
<height>28</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>28</width>
<height>28</height>
</size>
</property>
<property name="toolTip"> <property name="toolTip">
<string>Rotate anti-clockwise</string> <string>Rotate anti-clockwise</string>
</property> </property>
<property name="locale">
<locale language="English" country="UnitedStates"/>
</property>
<property name="icon"> <property name="icon">
<iconset resource="resources.qrc"> <iconset resource="resources.qrc">
<normaloff>:/rotateleft.png</normaloff>:/rotateleft.png</iconset> <normaloff>:/images/rotateleft.png</normaloff>:/images/rotateleft.png</iconset>
</property> </property>
<property name="iconSize"> <property name="iconSize">
<size> <size>
@ -133,22 +184,46 @@
<property name="toolTip"> <property name="toolTip">
<string>Adjust Rotation</string> <string>Adjust Rotation</string>
</property> </property>
<property name="locale">
<locale language="English" country="UnitedStates"/>
</property>
<property name="maximum"> <property name="maximum">
<number>360</number> <number>360</number>
</property> </property>
<property name="pageStep">
<number>15</number>
</property>
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="tickPosition">
<enum>QSlider::TicksBelow</enum>
</property>
<property name="tickInterval">
<number>90</number>
</property>
</widget> </widget>
</item> </item>
<item row="4" column="2"> <item row="4" column="2">
<widget class="QToolButton" name="toolButton_2"> <widget class="QToolButton" name="btnRotatRight">
<property name="minimumSize">
<size>
<width>28</width>
<height>28</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>28</width>
<height>28</height>
</size>
</property>
<property name="toolTip"> <property name="toolTip">
<string>Rotate clockwise</string> <string>Rotate clockwise</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="resources.qrc"> <iconset resource="resources.qrc">
<normaloff>:/rotateright.png</normaloff>:/rotateright.png</iconset> <normaloff>:/images/rotateright.png</normaloff>:/images/rotateright.png</iconset>
</property> </property>
<property name="iconSize"> <property name="iconSize">
<size> <size>
@ -391,7 +466,7 @@
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt; <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt; &lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; } p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'DejaVu Sans'; font-size:8pt; font-weight:400; font-style:normal;&quot;&gt; &lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Sans Serif'; font-size:9pt;&quot;&gt;Your Data Here!&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Sans Serif'; font-size:9pt;&quot;&gt;Your Data Here!&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
<property name="acceptRichText"> <property name="acceptRichText">
@ -704,80 +779,15 @@ p, li { white-space: pre-wrap; }
<tabstop>btnSave</tabstop> <tabstop>btnSave</tabstop>
<tabstop>btnExit</tabstop> <tabstop>btnExit</tabstop>
<tabstop>view</tabstop> <tabstop>view</tabstop>
<tabstop>toolButton_5</tabstop> <tabstop>btnZoomOut</tabstop>
<tabstop>scaleSlider</tabstop> <tabstop>scaleSlider</tabstop>
<tabstop>toolButton_4</tabstop> <tabstop>btnZoomIn</tabstop>
<tabstop>toolButton</tabstop> <tabstop>btnRotateLeft</tabstop>
<tabstop>rotateSlider</tabstop> <tabstop>rotateSlider</tabstop>
<tabstop>toolButton_2</tabstop> <tabstop>btnRotatRight</tabstop>
</tabstops> </tabstops>
<resources> <resources>
<include location="resources.qrc"/> <include location="resources.qrc"/>
</resources> </resources>
<connections> <connections/>
<connection>
<sender>toolButton</sender>
<signal>clicked()</signal>
<receiver>rotateSlider</receiver>
<slot>subtractStep()</slot>
<hints>
<hint type="sourcelabel">
<x>29</x>
<y>265</y>
</hint>
<hint type="destinationlabel">
<x>76</x>
<y>265</y>
</hint>
</hints>
</connection>
<connection>
<sender>toolButton_2</sender>
<signal>clicked()</signal>
<receiver>rotateSlider</receiver>
<slot>addStep()</slot>
<hints>
<hint type="sourcelabel">
<x>491</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>431</x>
<y>260</y>
</hint>
</hints>
</connection>
<connection>
<sender>toolButton_4</sender>
<signal>clicked()</signal>
<receiver>scaleSlider</receiver>
<slot>addStep()</slot>
<hints>
<hint type="sourcelabel">
<x>532</x>
<y>231</y>
</hint>
<hint type="destinationlabel">
<x>528</x>
<y>191</y>
</hint>
</hints>
</connection>
<connection>
<sender>toolButton_5</sender>
<signal>clicked()</signal>
<receiver>scaleSlider</receiver>
<slot>subtractStep()</slot>
<hints>
<hint type="sourcelabel">
<x>530</x>
<y>56</y>
</hint>
<hint type="destinationlabel">
<x>530</x>
<y>94</y>
</hint>
</hints>
</connection>
</connections>
</ui> </ui>

View File

@ -132,6 +132,10 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags fl)
connect(btnMoreData, SIGNAL(clicked( bool )), SLOT(open_data_dialog())); connect(btnMoreData, SIGNAL(clicked( bool )), SLOT(open_data_dialog()));
connect(btnSequence, SIGNAL(clicked( bool )), SLOT(open_sequence_dialog())); connect(btnSequence, SIGNAL(clicked( bool )), SLOT(open_sequence_dialog()));
connect(chkHRTHide, SIGNAL(stateChanged( int )), SLOT(update_preview())); connect(chkHRTHide, SIGNAL(stateChanged( int )), SLOT(update_preview()));
connect(btnZoomIn, SIGNAL(clicked(void)), SLOT(zoomIn(void)));
connect(btnZoomOut, SIGNAL(clicked(void)), SLOT(zoomOut(void)));
connect(btnRotateLeft, SIGNAL(clicked(void)), SLOT(rotateLeft(void)));
connect(btnRotatRight, SIGNAL(clicked(void)), SLOT(rotateRight(void)));
} }
MainWindow::~MainWindow() MainWindow::~MainWindow()
@ -848,4 +852,23 @@ void MainWindow::update_preview()
view->scene()->update(); view->scene()->update();
} }
void
MainWindow::zoomIn(void)
{
scaleSlider->setValue(scaleSlider->value() + scaleSlider->singleStep());
}
void
MainWindow::zoomOut(void)
{
scaleSlider->setValue(scaleSlider->value() - scaleSlider->singleStep());
}
void
MainWindow::rotateLeft(void)
{
rotateSlider->setValue(rotateSlider->value() - rotateSlider->singleStep());
}
void
MainWindow::rotateRight(void)
{
rotateSlider->setValue(rotateSlider->value() + rotateSlider->singleStep());
}

View File

@ -118,6 +118,10 @@ public slots:
void maxi_primary(); void maxi_primary();
void change_print_scale(); void change_print_scale();
void scaleRotate(); void scaleRotate();
void zoomIn(void);
void zoomOut(void);
void rotateLeft(void);
void rotateRight(void);
private slots: private slots:
bool save(); bool save();

View File

@ -1,10 +1,10 @@
<!DOCTYPE RCC><RCC version="1.0"> <!DOCTYPE RCC><RCC version="1.0">
<qresource prefix="/"> <qresource>
<file>zoomin.png</file> <file>images/zoomout.png</file>
<file>zoomout.png</file> <file>images/rotateleft.png</file>
<file>rotateleft.png</file> <file>images/rotateright.png</file>
<file>rotateright.png</file> <file>images/zico.png</file>
<file>zico.png</file> <file>images/zoomin.png</file>
<file>grpAztec.ui</file> <file>grpAztec.ui</file>
<file>grpC39.ui</file> <file>grpC39.ui</file>
<file>grpDM.ui</file> <file>grpDM.ui</file>
@ -21,5 +21,5 @@
<file>grpCodeOne.ui</file> <file>grpCodeOne.ui</file>
<file>grpC49.ui</file> <file>grpC49.ui</file>
<file>grpGrid.ui</file> <file>grpGrid.ui</file>
</qresource> </qresource>
</RCC> </RCC>

View File

@ -1,196 +1,196 @@
/* /*
Zint Barcode Generator - the open source barcode generator Zint Barcode Generator - the open source barcode generator
Copyright (C) 2009 Robin Stuart <robin@zint.org.uk> Copyright (C) 2009 Robin Stuart <robin@zint.org.uk>
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or the Free Software Foundation; either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License along You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc., with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
#include <QDebug> #include <QDebug>
#include <QFile> #include <QFile>
#include <QUiLoader> #include <QUiLoader>
#include <QFileDialog> #include <QFileDialog>
#include <QMessageBox> #include <QMessageBox>
#include "sequencewindow.h" #include "sequencewindow.h"
#include "exportwindow.h" #include "exportwindow.h"
#include <stdio.h> #include <stdio.h>
SequenceWindow::SequenceWindow() SequenceWindow::SequenceWindow()
{ {
setupUi(this); setupUi(this);
QValidator *intvalid = new QIntValidator(this); QValidator *intvalid = new QIntValidator(this);
linStartVal->setValidator(intvalid); linStartVal->setValidator(intvalid);
linEndVal->setValidator(intvalid); linEndVal->setValidator(intvalid);
linIncVal->setValidator(intvalid); linIncVal->setValidator(intvalid);
connect(btnClose, SIGNAL( clicked( bool )), SLOT(quit_now())); connect(btnClose, SIGNAL( clicked( bool )), SLOT(quit_now()));
connect(btnReset, SIGNAL( clicked( bool )), SLOT(reset_preview())); connect(btnReset, SIGNAL( clicked( bool )), SLOT(reset_preview()));
connect(btnCreate, SIGNAL( clicked( bool )), SLOT(create_sequence())); connect(btnCreate, SIGNAL( clicked( bool )), SLOT(create_sequence()));
connect(txtPreview, SIGNAL( textChanged()), SLOT(check_generate())); connect(txtPreview, SIGNAL( textChanged()), SLOT(check_generate()));
connect(btnImport, SIGNAL( clicked( bool )), SLOT(import())); connect(btnImport, SIGNAL( clicked( bool )), SLOT(import()));
connect(btnExport, SIGNAL( clicked( bool )), SLOT(generate_sequence())); connect(btnExport, SIGNAL( clicked( bool )), SLOT(generate_sequence()));
} }
SequenceWindow::~SequenceWindow() SequenceWindow::~SequenceWindow()
{ {
} }
void SequenceWindow::quit_now() void SequenceWindow::quit_now()
{ {
close(); close();
} }
void SequenceWindow::reset_preview() void SequenceWindow::reset_preview()
{ {
txtPreview->clear(); txtPreview->clear();
} }
QString SequenceWindow::apply_format(QString raw_number) QString SequenceWindow::apply_format(QString raw_number)
{ {
QString adjusted, reversed; QString adjusted, reversed;
QString format; QString format;
int format_len, input_len, i, inpos; int format_len, input_len, i, inpos;
char format_char; char format_char;
QChar format_qchar; QChar format_qchar;
format = linFormat->text(); format = linFormat->text();
input_len = raw_number.length(); input_len = raw_number.length();
format_len = format.length(); format_len = format.length();
inpos = input_len; inpos = input_len;
for(i = format_len; i > 0; i--) { for(i = format_len; i > 0; i--) {
format_qchar = format[i - 1]; format_qchar = format[i - 1];
format_char = format_qchar.toAscii(); format_char = format_qchar.toAscii();
switch(format_char) { switch(format_char) {
case '#': case '#':
if (inpos > 0) { if (inpos > 0) {
adjusted += raw_number[inpos - 1]; adjusted += raw_number[inpos - 1];
inpos--; inpos--;
} else { } else {
adjusted += ' '; adjusted += ' ';
} }
break; break;
case '$': case '$':
if (inpos > 0) { if (inpos > 0) {
adjusted += raw_number[inpos - 1]; adjusted += raw_number[inpos - 1];
inpos--; inpos--;
} else { } else {
adjusted += '0'; adjusted += '0';
} }
break; break;
case '*': case '*':
if (inpos > 0) { if (inpos > 0) {
adjusted += raw_number[inpos - 1]; adjusted += raw_number[inpos - 1];
inpos--; inpos--;
} else { } else {
adjusted += '*'; adjusted += '*';
} }
break; break;
default: default:
adjusted += format_char; adjusted += format_char;
break; break;
} }
} }
for(i = format_len; i > 0; i--) { for(i = format_len; i > 0; i--) {
reversed += adjusted[i - 1]; reversed += adjusted[i - 1];
} }
return reversed; return reversed;
} }
void SequenceWindow::create_sequence() void SequenceWindow::create_sequence()
{ {
QString startval, endval, incval, part, outputtext; QString startval, endval, incval, part, outputtext;
int start, stop, step, i; int start, stop, step, i;
bool ok; bool ok;
startval = linStartVal->text(); startval = linStartVal->text();
endval = linEndVal->text(); endval = linEndVal->text();
incval = linIncVal->text(); incval = linIncVal->text();
start = startval.toInt(&ok, 10); start = startval.toInt(&ok, 10);
stop = endval.toInt(&ok, 10); stop = endval.toInt(&ok, 10);
step = incval.toInt(&ok, 10); step = incval.toInt(&ok, 10);
if((stop <= start) || (step <= 0)) { if((stop <= start) || (step <= 0)) {
QMessageBox::critical(this, tr("Sequence Error"), tr("One or more of the input values is incorrect.")); QMessageBox::critical(this, tr("Sequence Error"), tr("One or more of the input values is incorrect."));
return; return;
} }
for(i = start; i <= stop; i += step) { for(i = start; i <= stop; i += step) {
part = apply_format(QString::number(i, 10)); part = apply_format(QString::number(i, 10));
part += '\n'; part += '\n';
outputtext += part; outputtext += part;
} }
txtPreview->setPlainText(outputtext); txtPreview->setPlainText(outputtext);
} }
void SequenceWindow::check_generate() void SequenceWindow::check_generate()
{ {
QString preview_copy; QString preview_copy;
preview_copy = txtPreview->toPlainText(); preview_copy = txtPreview->toPlainText();
if(preview_copy.isEmpty()) { if(preview_copy.isEmpty()) {
btnExport->setEnabled(false); btnExport->setEnabled(false);
} else { } else {
btnExport->setEnabled(true); btnExport->setEnabled(true);
} }
} }
void SequenceWindow::import() void SequenceWindow::import()
{ {
//QString fileName; //QString fileName;
//QFileDialog fdialog; //QFileDialog fdialog;
QFile file; QFile file;
QString selectedFilter; QString selectedFilter;
//fdialog.setFileMode(QFileDialog::ExistingFile); //fdialog.setFileMode(QFileDialog::ExistingFile);
//if(fdialog.exec()) { //if(fdialog.exec()) {
// fileName = fdialog.selectedFiles().at(0); // fileName = fdialog.selectedFiles().at(0);
//} else { //} else {
// return; // return;
//} //}
QString fileName = QFileDialog::getOpenFileName(this, QString fileName = QFileDialog::getOpenFileName(this,
tr("Import File"), tr("Import File"),
"./", "./",
tr("All Files (*);;Text Files (*.txt)")); tr("All Files (*);;Text Files (*.txt)"));
if (fileName.isEmpty()) if (fileName.isEmpty())
return; return;
file.setFileName(fileName); file.setFileName(fileName);
if(!file.open(QIODevice::ReadOnly | QIODevice::Text)) { if(!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
QMessageBox::critical(this, tr("Open Error"), tr("Could not open selected file.")); QMessageBox::critical(this, tr("Open Error"), tr("Could not open selected file."));
return; return;
} }
QByteArray outstream = file.readAll(); QByteArray outstream = file.readAll();
txtPreview->setPlainText(QString(outstream)); txtPreview->setPlainText(QString(outstream));
file.close(); file.close();
} }
void SequenceWindow::generate_sequence() void SequenceWindow::generate_sequence()
{ {
int returnval; int returnval;
ExportWindow dlg; ExportWindow dlg;
dlg.barcode = barcode; dlg.barcode = barcode;
dlg.output_data = txtPreview->toPlainText(); dlg.output_data = txtPreview->toPlainText();
returnval = dlg.exec(); returnval = dlg.exec();
} }

View File

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="windows-1250"?> <?xml version="1.0" encoding="windows-1250"?>
<VisualStudioProject <VisualStudioProject
ProjectType="Visual C++" ProjectType="Visual C++"
Version="9.00" Version="9,00"
Name="libzint" Name="libzint"
ProjectGUID="{63287BBA-3B4C-44A8-B538-B2E8530B2BE6}" ProjectGUID="{5C08DC40-8F7D-475E-AA3C-814DED735A4B}"
RootNamespace="libzint" RootNamespace="libzint_png_qr"
Keyword="Win32Proj" Keyword="Win32Proj"
TargetFrameworkVersion="196613" TargetFrameworkVersion="196613"
> >
@ -41,8 +41,8 @@
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="" AdditionalIncludeDirectories="d:\opt\include"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;ZINT_VERSION=&quot;\&quot;2.1.3\&quot;&quot;;BUILD_ZINT_DLL;NO_PNG;NO_QR" PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;ZINT_VERSION=&quot;\&quot;2.3.0\&quot;&quot;;BUILD_ZINT_DLL;ZLIB_DLL;PNG_DLL"
MinimalRebuild="true" MinimalRebuild="true"
ExceptionHandling="0" ExceptionHandling="0"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
@ -68,9 +68,10 @@
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
LinkLibraryDependencies="false" LinkLibraryDependencies="false"
AdditionalDependencies="libpng13d.lib zlib1d.lib"
OutputFile="$(OutDir)\zintd.dll" OutputFile="$(OutDir)\zintd.dll"
LinkIncremental="2" LinkIncremental="2"
AdditionalLibraryDirectories="" AdditionalLibraryDirectories="d:\opt\lib"
GenerateDebugInformation="true" GenerateDebugInformation="true"
SubSystem="2" SubSystem="2"
TargetMachine="1" TargetMachine="1"
@ -124,7 +125,8 @@
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="2" Optimization="2"
EnableIntrinsicFunctions="false" EnableIntrinsicFunctions="false"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;ZINT_VERSION=&quot;\&quot;2.1.3\&quot;&quot;;BUILD_ZINT_DLL;NO_PNG;NO_QR" AdditionalIncludeDirectories="d:\opt\include"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;ZINT_VERSION=&quot;\&quot;2.3.0\&quot;&quot;;BUILD_ZINT_DLL;ZLIB_DLL;PNG_DLL"
StringPooling="true" StringPooling="true"
ExceptionHandling="0" ExceptionHandling="0"
RuntimeLibrary="2" RuntimeLibrary="2"
@ -149,8 +151,10 @@
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
LinkLibraryDependencies="false" LinkLibraryDependencies="false"
AdditionalDependencies="libpng13.lib zlib1.lib"
OutputFile="$(OutDir)\zint.dll" OutputFile="$(OutDir)\zint.dll"
LinkIncremental="1" LinkIncremental="1"
AdditionalLibraryDirectories="d:\opt\lib"
GenerateDebugInformation="false" GenerateDebugInformation="false"
SubSystem="2" SubSystem="2"
OptimizeReferences="2" OptimizeReferences="2"
@ -179,6 +183,76 @@
Name="VCPostBuildEventTool" Name="VCPostBuildEventTool"
/> />
</Configuration> </Configuration>
<Configuration
Name="Release_LIB|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="2"
WholeProgramOptimization="0"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="false"
AdditionalIncludeDirectories="d:\opt\include"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;ZINT_VERSION=&quot;\&quot;2.3.0\&quot;&quot;"
StringPooling="true"
ExceptionHandling="0"
RuntimeLibrary="2"
EnableFunctionLevelLinking="false"
RuntimeTypeInfo="false"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="0"
CompileAs="2"
DisableSpecificWarnings="4018;4244;4305"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile="$(OutDir)\libzintMD.lib"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations> </Configurations>
<References> <References>
</References> </References>
@ -235,6 +309,14 @@
<File <File
RelativePath="..\backend\dllversion.c" RelativePath="..\backend\dllversion.c"
> >
<FileConfiguration
Name="Release_LIB|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
</File> </File>
<File <File
RelativePath="..\backend\dm200.c" RelativePath="..\backend\dm200.c"
@ -244,6 +326,10 @@
RelativePath="..\backend\dmatrix.c" RelativePath="..\backend\dmatrix.c"
> >
</File> </File>
<File
RelativePath="..\backend\gridmtx.c"
>
</File>
<File <File
RelativePath="..\backend\gs1.c" RelativePath="..\backend\gs1.c"
> >
@ -268,10 +354,6 @@
RelativePath="..\backend\medical.c" RelativePath="..\backend\medical.c"
> >
</File> </File>
<File
RelativePath="..\backend\micqr.c"
>
</File>
<File <File
RelativePath="..\backend\pdf417.c" RelativePath="..\backend\pdf417.c"
> >
@ -280,6 +362,10 @@
RelativePath="..\backend\plessey.c" RelativePath="..\backend\plessey.c"
> >
</File> </File>
<File
RelativePath="..\backend\png.c"
>
</File>
<File <File
RelativePath="..\backend\postal.c" RelativePath="..\backend\postal.c"
> >
@ -350,6 +436,14 @@
RelativePath="..\backend\font.h" RelativePath="..\backend\font.h"
> >
</File> </File>
<File
RelativePath="..\backend\gb2312.h"
>
</File>
<File
RelativePath="..\backend\gridmtx.h"
>
</File>
<File <File
RelativePath="..\backend\gs1.h" RelativePath="..\backend\gs1.h"
> >
@ -367,17 +461,25 @@
> >
</File> </File>
<File <File
RelativePath="..\backend\micqr.h" RelativePath="..\backend\ms_stdint.h"
> >
</File> </File>
<File <File
RelativePath="..\backend\pdf417.h" RelativePath="..\backend\pdf417.h"
> >
</File> </File>
<File
RelativePath="..\backend\qr.h"
>
</File>
<File <File
RelativePath="..\backend\reedsol.h" RelativePath="..\backend\reedsol.h"
> >
</File> </File>
<File
RelativePath="..\backend\resource.h"
>
</File>
<File <File
RelativePath="..\backend\rss.h" RelativePath="..\backend\rss.h"
> >
@ -397,8 +499,16 @@
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
> >
<File <File
RelativePath="..\backend\zint.rc" RelativePath="..\backend\libzint.rc"
> >
<FileConfiguration
Name="Release_LIB|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCResourceCompilerTool"
/>
</FileConfiguration>
</File> </File>
</Filter> </Filter>
</Files> </Files>

View File

@ -1,26 +1,32 @@

Microsoft Visual Studio Solution File, Format Version 10.00 Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008 # Visual Studio 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zint", "zint.vcproj", "{3169C7FA-E52C-4BFC-B7BB-E55EBA133770}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zint", "zint.vcproj", "{3169C7FA-E52C-4BFC-B7BB-E55EBA133770}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
{63287BBA-3B4C-44A8-B538-B2E8530B2BE6} = {63287BBA-3B4C-44A8-B538-B2E8530B2BE6} {5C08DC40-8F7D-475E-AA3C-814DED735A4B} = {5C08DC40-8F7D-475E-AA3C-814DED735A4B}
EndProjectSection EndProjectSection
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libzint", "libzint.vcproj", "{63287BBA-3B4C-44A8-B538-B2E8530B2BE6}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libzint", "libzint.vcproj", "{5C08DC40-8F7D-475E-AA3C-814DED735A4B}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32 Debug|Win32 = Debug|Win32
Release_LIB|Win32 = Release_LIB|Win32
Release|Win32 = Release|Win32 Release|Win32 = Release|Win32
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3169C7FA-E52C-4BFC-B7BB-E55EBA133770}.Debug|Win32.ActiveCfg = Debug|Win32 {3169C7FA-E52C-4BFC-B7BB-E55EBA133770}.Debug|Win32.ActiveCfg = Debug|Win32
{3169C7FA-E52C-4BFC-B7BB-E55EBA133770}.Debug|Win32.Build.0 = Debug|Win32 {3169C7FA-E52C-4BFC-B7BB-E55EBA133770}.Debug|Win32.Build.0 = Debug|Win32
{3169C7FA-E52C-4BFC-B7BB-E55EBA133770}.Release_LIB|Win32.ActiveCfg = Release_LIB|Win32
{3169C7FA-E52C-4BFC-B7BB-E55EBA133770}.Release_LIB|Win32.Build.0 = Release_LIB|Win32
{3169C7FA-E52C-4BFC-B7BB-E55EBA133770}.Release|Win32.ActiveCfg = Release|Win32 {3169C7FA-E52C-4BFC-B7BB-E55EBA133770}.Release|Win32.ActiveCfg = Release|Win32
{3169C7FA-E52C-4BFC-B7BB-E55EBA133770}.Release|Win32.Build.0 = Release|Win32 {3169C7FA-E52C-4BFC-B7BB-E55EBA133770}.Release|Win32.Build.0 = Release|Win32
{63287BBA-3B4C-44A8-B538-B2E8530B2BE6}.Debug|Win32.ActiveCfg = Debug|Win32 {5C08DC40-8F7D-475E-AA3C-814DED735A4B}.Debug|Win32.ActiveCfg = Debug|Win32
{63287BBA-3B4C-44A8-B538-B2E8530B2BE6}.Debug|Win32.Build.0 = Debug|Win32 {5C08DC40-8F7D-475E-AA3C-814DED735A4B}.Debug|Win32.Build.0 = Debug|Win32
{63287BBA-3B4C-44A8-B538-B2E8530B2BE6}.Release|Win32.ActiveCfg = Release|Win32 {5C08DC40-8F7D-475E-AA3C-814DED735A4B}.Release_LIB|Win32.ActiveCfg = Release_LIB|Win32
{63287BBA-3B4C-44A8-B538-B2E8530B2BE6}.Release|Win32.Build.0 = Release|Win32 {5C08DC40-8F7D-475E-AA3C-814DED735A4B}.Release_LIB|Win32.Build.0 = Release_LIB|Win32
{5C08DC40-8F7D-475E-AA3C-814DED735A4B}.Release|Win32.ActiveCfg = Release|Win32
{5C08DC40-8F7D-475E-AA3C-814DED735A4B}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

View File

@ -42,7 +42,7 @@
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="..\backend" AdditionalIncludeDirectories="..\backend"
PreprocessorDefinitions="WIN32;_WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;ZINT_VERSION=&quot;\&quot;2.1.3\&quot;&quot;;ZINT_DLL" PreprocessorDefinitions="WIN32;_WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;ZINT_VERSION=&quot;\&quot;2.3.0\&quot;&quot;;ZINT_DLL"
MinimalRebuild="true" MinimalRebuild="true"
ExceptionHandling="0" ExceptionHandling="0"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
@ -114,12 +114,13 @@
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="2" Optimization="2"
EnableIntrinsicFunctions="true"
AdditionalIncludeDirectories="..\backend" AdditionalIncludeDirectories="..\backend"
PreprocessorDefinitions="WIN32;_WIN32;NDEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;ZINT_VERSION=&quot;\&quot;2.1.3\&quot;&quot;;ZINT_DLL" PreprocessorDefinitions="WIN32;_WIN32;NDEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;ZINT_VERSION=&quot;\&quot;2.3.0\&quot;&quot;;ZINT_DLL"
StringPooling="true"
ExceptionHandling="0" ExceptionHandling="0"
RuntimeLibrary="2" RuntimeLibrary="2"
EnableFunctionLevelLinking="false" EnableFunctionLevelLinking="false"
RuntimeTypeInfo="false"
UsePrecompiledHeader="0" UsePrecompiledHeader="0"
WarningLevel="3" WarningLevel="3"
DebugInformationFormat="0" DebugInformationFormat="0"
@ -135,6 +136,80 @@
/> />
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalLibraryDirectories="d:\opt\lib"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release_LIB|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="2"
WholeProgramOptimization="0"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories="..\backend"
PreprocessorDefinitions="WIN32;_WIN32;NDEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;ZINT_VERSION=&quot;\&quot;2.3.0\&quot;&quot;"
StringPooling="true"
ExceptionHandling="0"
RuntimeLibrary="2"
EnableFunctionLevelLinking="false"
RuntimeTypeInfo="false"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="libpngMD.lib zlibMD.lib"
AdditionalLibraryDirectories="d:\opt\lib"
/> />
<Tool <Tool
Name="VCALinkTool" Name="VCALinkTool"
@ -189,6 +264,10 @@
RelativePath=".\frontend\getopt.h" RelativePath=".\frontend\getopt.h"
> >
</File> </File>
<File
RelativePath="..\frontend\resource.h"
>
</File>
</Filter> </Filter>
<Filter <Filter
Name="Resource Files" Name="Resource Files"

138
zint.spec
View File

@ -1,70 +1,70 @@
Name: zint Name: zint
Version: 2.2 Version: 2.3
Release: 1 Release: 1
Summary: A barcode encoding library. Summary: A barcode encoding library.
Summary(ru_RU.UTF8): A barcode encoding library. Summary(ru_RU.UTF8): A barcode encoding library.
License: GPL License: GPL
Url: http://www.zint.org.uk Url: http://www.zint.org.uk
Vendor: Robin Stuart <robin@zint.org.uk> Vendor: Robin Stuart <robin@zint.org.uk>
Packager: Radist Tagan <radist@list.ru> Packager: Radist Tagan <radist@list.ru>
Group: Development/Libraries/C and C++ Group: Development/Libraries/C and C++
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
Source: %name-%version.tar.bz2 Source: %name-%version.tar.bz2
Patch: error_svg_plot_fix.patch Patch: error_svg_plot_fix.patch
##Requires: Qt >= 4.4 ##Requires: Qt >= 4.4
BuildRequires: cmake BuildRequires: cmake
BuildRequires: libqt4-devel BuildRequires: libqt4-devel
BuildRequires: libpng-devel BuildRequires: libpng-devel
BuildRequires: zlib-devel BuildRequires: zlib-devel
BuildRequires: qrencode-devel BuildRequires: qrencode-devel
%description %description
A library for encoding data in barcode symbols. Includes support for over 50 symbologies including A library for encoding data in barcode symbols. Includes support for over 50 symbologies including
all ISO/IEC standards. all ISO/IEC standards.
%package -n zint-devel %package -n zint-devel
Summary: Library and header files for zint. Summary: Library and header files for zint.
Group: Development/C Group: Development/C
Provides: %{name}-devel = %{version} Provides: %{name}-devel = %{version}
Requires: zint = %{version} Requires: zint = %{version}
%description -n zint-devel %description -n zint-devel
A library for encoding data in barcode symbols. Includes support for over 50 symbologies including A library for encoding data in barcode symbols. Includes support for over 50 symbologies including
all ISO/IEC standards. all ISO/IEC standards.
%debug_package %debug_package
%prep %prep
%setup %setup
%patch -p1 %patch -p1
%build %build
##mkdir 'build' ##mkdir 'build'
##cd build ##cd build
cmake CMakeLists.txt cmake CMakeLists.txt
make -j2 make -j2
%install %install
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
%makeinstall %makeinstall
cd %buildroot/usr/ && mv ./local/* ./ cd %buildroot/usr/ && mv ./local/* ./
##make install DESTDIR=$RPM_BUILD_ROOT ##make install DESTDIR=$RPM_BUILD_ROOT
%post %post
/sbin/ldconfig /sbin/ldconfig
%postun %postun
ldconfig ldconfig
%clean %clean
%files %files
%{_libdir}/* %{_libdir}/*
%{_datadir}/cmake/Modules/FindZint.cmake %{_datadir}/cmake/Modules/FindZint.cmake
%files -n zint-devel %files -n zint-devel
%defattr(-,root,root,-) %defattr(-,root,root,-)
%{_includedir}/*.h %{_includedir}/*.h
%changelog %changelog
* Thu Mar 17 2009 radist <radist@list.ru> * Thu Mar 17 2009 radist <radist@list.ru>
+ Make spec + Make spec