mirror of
https://github.com/zint/zint
synced 2024-11-16 20:57:25 +13:00
Take version information from CmakeLists.txt
Warning: potential incompatibility because version number is no longer stored in zint.h
This commit is contained in:
parent
44923349f3
commit
3eb31fe3f8
@ -12,8 +12,8 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
|||||||
set (ZINT_VERSION_MAJOR 2)
|
set (ZINT_VERSION_MAJOR 2)
|
||||||
set (ZINT_VERSION_MINOR 9)
|
set (ZINT_VERSION_MINOR 9)
|
||||||
set (ZINT_VERSION_RELEASE 1)
|
set (ZINT_VERSION_RELEASE 1)
|
||||||
set (ZINT_VERSION_BUILD ".9") # Set to "" before release, set to ".9" after release
|
set (ZINT_VERSION_BUILD 9) # Set to 0 before release, set to 9 after release
|
||||||
set (ZINT_VERSION "${ZINT_VERSION_MAJOR}.${ZINT_VERSION_MINOR}.${ZINT_VERSION_RELEASE}${ZINT_VERSION_BUILD}" )
|
set (ZINT_VERSION "${ZINT_VERSION_MAJOR}.${ZINT_VERSION_MINOR}.${ZINT_VERSION_RELEASE}.${ZINT_VERSION_BUILD}" )
|
||||||
|
|
||||||
add_definitions(-DZINT_VERSION=\"${ZINT_VERSION}\")
|
add_definitions(-DZINT_VERSION=\"${ZINT_VERSION}\")
|
||||||
|
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
project(zint)
|
project(zint)
|
||||||
|
|
||||||
|
configure_file(zintconfig.h.in zintconfig.h)
|
||||||
|
|
||||||
find_package(PNG)
|
find_package(PNG)
|
||||||
|
|
||||||
set(zint_COMMON_SRCS common.c library.c large.c reedsol.c gs1.c eci.c general_field.c sjis.c gb2312.c gb18030.c)
|
set(zint_COMMON_SRCS common.c library.c large.c reedsol.c gs1.c eci.c general_field.c sjis.c gb2312.c gb18030.c)
|
||||||
|
@ -47,6 +47,7 @@
|
|||||||
#define NEON "0123456789"
|
#define NEON "0123456789"
|
||||||
|
|
||||||
#include "zint.h"
|
#include "zint.h"
|
||||||
|
#include "zintconfig.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
@ -110,11 +110,6 @@ extern "C" {
|
|||||||
int warn_level;
|
int warn_level;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define ZINT_VERSION_MAJOR 2
|
|
||||||
#define ZINT_VERSION_MINOR 9
|
|
||||||
#define ZINT_VERSION_RELEASE 1
|
|
||||||
#define ZINT_VERSION_BUILD 9 /* Set to 0 before release, set to 9 after release */
|
|
||||||
|
|
||||||
/* Tbarcode 7 codes */
|
/* Tbarcode 7 codes */
|
||||||
#define BARCODE_CODE11 1
|
#define BARCODE_CODE11 1
|
||||||
#define BARCODE_C25STANDARD 2
|
#define BARCODE_C25STANDARD 2
|
||||||
|
5
backend/zintconfig.h.in
Normal file
5
backend/zintconfig.h.in
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
// the configured options and settings for libzint
|
||||||
|
#define ZINT_VERSION_MAJOR @ZINT_VERSION_MAJOR@
|
||||||
|
#define ZINT_VERSION_MINOR @ZINT_VERSION_MINOR@
|
||||||
|
#define ZINT_VERSION_RELEASE @ZINT_VERSION_RELEASE@
|
||||||
|
#define ZINT_VERSION_BUILD @ZINT_VERSION_BUILD@
|
@ -363,6 +363,10 @@ namespace Zint {
|
|||||||
bool QZint::hasErrors() const {
|
bool QZint::hasErrors() const {
|
||||||
return m_lastError.length();
|
return m_lastError.length();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int QZint::getVersion() const {
|
||||||
|
return ZBarcode_Version();
|
||||||
|
}
|
||||||
|
|
||||||
bool QZint::save_to_file(QString filename) {
|
bool QZint::save_to_file(QString filename) {
|
||||||
resetSymbol();
|
resetSymbol();
|
||||||
|
@ -119,6 +119,8 @@ public:
|
|||||||
bool save_to_file(QString filename);
|
bool save_to_file(QString filename);
|
||||||
|
|
||||||
void render(QPainter & painter, const QRectF & paintRect, AspectRatioMode mode=IgnoreAspectRatio);
|
void render(QPainter & painter, const QRectF & paintRect, AspectRatioMode mode=IgnoreAspectRatio);
|
||||||
|
|
||||||
|
int getVersion() const;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void encoded();
|
void encoded();
|
||||||
|
@ -76,12 +76,24 @@ static void types(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Output usage information */
|
/* Output usage information */
|
||||||
|
|
||||||
static void usage(void) {
|
static void usage(void) {
|
||||||
if (ZINT_VERSION_BUILD) {
|
int zint_version = ZBarcode_Version();
|
||||||
printf( "Zint version %d.%d.%d.%d\n", ZINT_VERSION_MAJOR, ZINT_VERSION_MINOR, ZINT_VERSION_RELEASE, ZINT_VERSION_BUILD);
|
int version_major = zint_version / 10000;
|
||||||
|
int version_minor = (zint_version % 10000) / 100;
|
||||||
|
int version_release = zint_version % 100;
|
||||||
|
int version_build;
|
||||||
|
|
||||||
|
if (version_release > 10) {
|
||||||
|
/* This is a test release */
|
||||||
|
version_release = version_release / 10;
|
||||||
|
version_build = zint_version % 10;
|
||||||
|
printf( "Zint version %d.%d.%d.%d\n", version_major, version_minor, version_release, version_build);
|
||||||
} else {
|
} else {
|
||||||
printf( "Zint version %d.%d.%d\n", ZINT_VERSION_MAJOR, ZINT_VERSION_MINOR, ZINT_VERSION_RELEASE);
|
/* This is a stable release */
|
||||||
|
printf( "Zint version %d.%d.%d\n", version_major, version_minor, version_release);
|
||||||
}
|
}
|
||||||
|
|
||||||
printf( "Encode input data in a barcode and save as BMP/EMF/EPS/GIF/PCX/PNG/SVG/TIF/TXT\n\n"
|
printf( "Encode input data in a barcode and save as BMP/EMF/EPS/GIF/PCX/PNG/SVG/TIF/TXT\n\n"
|
||||||
" -b, --barcode=NUMBER Number of barcode type. Default is 20 (Code 128)\n"
|
" -b, --barcode=NUMBER Number of barcode type. Default is 20 (Code 128)\n"
|
||||||
" --addongap=NUMBER Set add-on gap in multiples of X-dimension for UPC/EAN\n"
|
" --addongap=NUMBER Set add-on gap in multiples of X-dimension for UPC/EAN\n"
|
||||||
|
@ -344,10 +344,21 @@ bool MainWindow::save()
|
|||||||
void MainWindow::about()
|
void MainWindow::about()
|
||||||
{
|
{
|
||||||
QString zint_version;
|
QString zint_version;
|
||||||
if (ZINT_VERSION_BUILD) {
|
|
||||||
QTextStream(&zint_version) << ZINT_VERSION_MAJOR << "." << ZINT_VERSION_MINOR << "." << ZINT_VERSION_RELEASE << "." << ZINT_VERSION_BUILD;
|
int lib_version = ZBarcode_Version();
|
||||||
|
int version_major = lib_version / 10000;
|
||||||
|
int version_minor = (lib_version % 10000) / 100;
|
||||||
|
int version_release = lib_version % 100;
|
||||||
|
int version_build;
|
||||||
|
|
||||||
|
if (version_release > 10) {
|
||||||
|
/* This is a test release */
|
||||||
|
version_release = version_release / 10;
|
||||||
|
version_build = lib_version % 10;
|
||||||
|
QTextStream(&zint_version) << version_major << "." << version_minor << "." << version_release << "." << version_build;
|
||||||
} else {
|
} else {
|
||||||
QTextStream(&zint_version) << ZINT_VERSION_MAJOR << "." << ZINT_VERSION_MINOR << "." << ZINT_VERSION_RELEASE;
|
/* This is a stable release */
|
||||||
|
QTextStream(&zint_version) << version_major << "." << version_minor << "." << version_release;
|
||||||
}
|
}
|
||||||
|
|
||||||
QMessageBox::about(this, tr("About Zint"),
|
QMessageBox::about(this, tr("About Zint"),
|
||||||
|
Loading…
Reference in New Issue
Block a user