1
0
mirror of https://git.code.sf.net/p/zint/code synced 2026-06-10 07:33:43 +00:00

DATAMATRIX: add new options DM_B256_START and DM_C40_START to

`options_3`, allowing forcing of Base 256 or C40 mode a la BWIPP
  for initial no. of characters specified in `option_1`, with 0
  meaning all (CLI "--dmb256=" and "--dmc40=", GUI also (apart
  from MAILMARK_2D, which may be added later);
  export masks `DM_B256_C40_START_MASK` & `DM_SQUARE_DMRE_MASK` in
  "zint.h"
ZBarcode_Encode_File: report filename (possibly truncated) in error
  message on failed open
GUI: uniquify some accelerators and add some child widget getter
  helpers to "mainwindow.cpp"
backend/DEVELOPER -> backend/README, with some expansion
debian/copyright: a few more fixes
BWIPP/pandoc: update to latest
tests/fuzz: adjust for new DATAMATRIX options
This commit is contained in:
gitlost
2026-03-30 21:25:22 +01:00
parent 3c193d7306
commit f9a493522f
40 changed files with 1706 additions and 920 deletions
+8 -3
View File
@@ -1,4 +1,4 @@
Version 2.16.0.9 (dev) not released yet (2026-03-26)
Version 2.16.0.9 (dev) not released yet (2026-03-30)
====================================================
**Incompatible changes**
@@ -9,6 +9,8 @@ Version 2.16.0.9 (dev) not released yet (2026-03-26)
- New Qt Backend method `save_as_memfile()` to save file to memory
- New Qt Backend methods `gs1Raw()` and `setGS1Raw()` for new `GS1RAW_MODE`
option for processing GS1 input
- CLI now warns if both "--dmre" and "--square" are given (previously silently
ignored "--dmre")
Changes
-------
@@ -22,11 +24,14 @@ Changes
- AZTEC: add improved encoding algorithm adapted from ZXing, props Frank Yellin
and Rustam Abdullaev; previous algorithm available via "--fast" (input_mode
|= FAST_MODE)
- AZTEC: add new option "--azfull" (option_3 = ZINT_AZTEC_FULL) to only
- AZTEC: add new option "--azfull" (`option_3 = ZINT_AZTEC_FULL`) to only
consider Full symbols (not Compact ones) on automatic sizing
- GS1: new `GS1RAW_MODE` (CLI "--gs1raw") and GS1 Syntax Engine "Unbracketed AI
element strings" (caret) options for specifying GS1 input (ticket #350, props
Mario Verbruggen)
- DATAMATRIX: new options "--dmb256=" (`option_3 = DM_B256_START`) & "--dmc40="
(`option_3 = DM_C40_START`) to allow forcing of initial encodation for given
no. (`option_1`) of initial characters, with 0 meaning all
Bugs
----
@@ -45,7 +50,7 @@ Bugs
- raster/vector: allow for separator height being > twice row height (buffer
overflow for raster, zero/negative height rects for vector) (ticket #353,
props Simon Resch)
- raster/vector: fix BARCODE_BIND_TOP trumping BARCODE_BOX
- raster/vector: fix `BARCODE_BIND_TOP` trumping `BARCODE_BOX`
- raster/vector: EAN/UPC: fix calculation of image/vector height to allow for
heights smaller than `textoffset` when have add-on (buffer overflow for
raster, outside vector height for vector)
-158
View File
@@ -1,158 +0,0 @@
2026-03-18
Here is a guide to which bit of source code does what.
library.c:
API entry points
2of5.c:
Code 2 of 5 Standard (Matrix)
Code 2 of 5 Industrial
Code 2 of 5 IATA
Code 2 of 5 Data Logic
2of5inter.c:
Code 2 of 5 Interleaved
2of5inter_based.c:
ITF-14
Deutsche Post Leitcode
Deutsche Post Identcode
auspost.c:
Australia Post Standard Customer
Australia Post Reply Paid
Australia Post Routing
Australia Post Redirection
aztec.c:
Aztec Code
Compact Aztec Code
Aztec Runes
bc412.c:
IBM BC412 (SEMI T1-95)
channel.c:
Channel Code
codabar.c:
Codabar
codablock.c:
Codablock F
code11.c:
Code 11
code128.c:
Code 128
Code 128 (Suppress Code Set C)
GS1-128 (UCC/EAN-128)
code128_based.c:
NVE-18
EAN-14
DPD Code
Universal Postal Union S10
code16k.c:
Code 16k
code.c:
Code 39
LOGMARS
Extended Code 39 (Code 39+)
Code 93
VIN
code1.c:
Code One
code49.c:
Code 49
composite.c:
CC-A Composite Symbology
CC-B Composite Symbology
CC-C Composite Symbology
dotcode.c:
Dot Code
dmatrix.c:
Data Matrix (ECC 200)
Royal Mail 2D Mailmark (CMDM)
dxfilmedge.c:
DX Film Edge Barcode
gridmtx.c:
Grid Matrix
hanxin.c:
Han Xin Code
imail.c:
USPS Intelligent Mail (OneCode)
maxicode.c:
UPS MaxiCode
medical.c:
Pharmacode One-Track
Pharmacode Two-Track
Code 32 (Italian Pharmacode)
Pharmazentral Nummer (PZN)
pdf417.c:
PDF417
Compact PDF417
MicroPDF417
plessey.c:
UK Plessey Code (bidirectional)
MSI Plessey
postal.c:
POSTNET
PLANET
Brazilian CEPNet
Facing Identification Mark (FIM)
Royal Mail 4-State Country Code (RM4SCC)
Dutch Post KIX Code
DAFT Code
Flattermarken
Korean Post Barcode
Japanese Postal Code
qr.c:
QR Code
Micro QR Code
UPNQR
Rectangular Micro QR Code (rMQR)
rss.c:
GS1 DataBar Omnidirectional (RSS-14)
GS1 DataBar Truncated
GS1 DataBar Stacked (RSS-14 Stacked)
GS1 DataBar Stacked Omnidirectional (DataBar-14 Stacked Omnidirectional)
(RSS-14 Stacked Omnidirectional)
GS1 DataBar Limited (RSS Limited)
GS1 DataBar Expanded (RSS Expanded)
GS1 DataBar Expanded Stacked (RSS Expanded Stacked)
telepen.c:
Telepen ASCII
Telepen Numeric
upcean.c:
UPC-A
UPC-E
EAN-2 add-on
EAN-5 add-on
EAN-8
EAN-13
SBN (verification)
ISBN (verification)
ISBN-13 (verification)
+243
View File
@@ -0,0 +1,243 @@
% backend/README 2026-03-30
% vim: set ts=4 sw=4 et :
Here is a guide to which bit of source code does what.
library.c:
API entry points
zint.h:
main include
zintconfig.h:
version defines
Barcodes
--------
2of5.c:
Code 2 of 5 Standard (Matrix)
Code 2 of 5 Industrial
Code 2 of 5 IATA
Code 2 of 5 Data Logic
2of5inter.c:
Code 2 of 5 Interleaved
2of5inter_based.c:
ITF-14
Deutsche Post Leitcode
Deutsche Post Identcode
auspost.c:
Australia Post Standard Customer
Australia Post Reply Paid
Australia Post Routing
Australia Post Redirection
aztec.c:
Aztec Code
Compact Aztec Code
Aztec Runes
bc412.c:
IBM BC412 (SEMI T1-95)
channel.c:
Channel Code
codabar.c:
Codabar
codablock.c:
Codablock F
code11.c:
Code 11
code128.c:
Code 128
Code 128 (Suppress Code Set C)
GS1-128 (UCC/EAN-128)
code128_based.c:
NVE-18
EAN-14
DPD Code
Universal Postal Union S10
code16k.c:
Code 16k
code.c:
Code 39
LOGMARS
Extended Code 39 (Code 39+)
Code 93
VIN
code1.c:
Code One
code49.c:
Code 49
composite.c:
CC-A Composite Symbology
CC-B Composite Symbology
CC-C Composite Symbology
dotcode.c:
Dot Code
dmatrix.c:
Data Matrix (ECC 200)
Royal Mail 2D Mailmark (CMDM)
dxfilmedge.c:
DX Film Edge Barcode
gridmtx.c:
Grid Matrix
hanxin.c:
Han Xin Code
imail.c:
USPS Intelligent Mail (OneCode)
maxicode.c:
UPS MaxiCode
medical.c:
Pharmacode One-Track
Pharmacode Two-Track
Code 32 (Italian Pharmacode)
Pharmazentral Nummer (PZN)
pdf417.c:
PDF417
Compact PDF417
MicroPDF417
plessey.c:
UK Plessey Code (bidirectional)
MSI Plessey
postal.c:
POSTNET
PLANET
Brazilian CEPNet
Facing Identification Mark (FIM)
Royal Mail 4-State Country Code (RM4SCC)
Dutch Post KIX Code
DAFT Code
Flattermarken
Korean Post Barcode
Japanese Postal Code
qr.c:
QR Code
Micro QR Code
UPNQR
Rectangular Micro QR Code (rMQR)
rss.c:
GS1 DataBar Omnidirectional (RSS-14)
GS1 DataBar Truncated
GS1 DataBar Stacked (RSS-14 Stacked)
GS1 DataBar Stacked Omnidirectional (DataBar-14 Stacked Omnidirectional)
(RSS-14 Stacked Omnidirectional)
GS1 DataBar Limited (RSS Limited)
GS1 DataBar Expanded (RSS Expanded)
GS1 DataBar Expanded Stacked (RSS Expanded Stacked)
telepen.c:
Telepen ASCII
Telepen Numeric
upcean.c:
UPC-A
UPC-E
EAN-2 add-on
EAN-5 add-on
EAN-8
EAN-13
SBN (verification)
ISBN (verification)
ISBN-13 (verification)
Common
------
common.c:
general routines used by all
eci.c:
ECI, tables in includes
big5.h, eci_sb.h, gb18030.h, gb2312.h, gbk.h, ksx1001.h, sjis.h
filemem.c:
Memory file (BARCODE_MEMORY_FILE)
general_field.c:
GS1 general field compaction (GS1 DataBar and composites)
gs1.c:
GS1 parsing & verifying, includes
gs1_lint.h, iso3166.h, iso4217.h
large.c:
128-bit arithmetic
reedsol.c:
Reed-Solomon
Output
------
bmp.c:
Windows Bitmap format (BMP)
emf.c:
Enhanced Metafile Format (EMF)
gif.c:
Graphics Interchange Format (GIF)
output.c:
general output routines
pcx.c:
ZSoft Paintbrush Format (PCX)
ps.c:
Encapsulated PostScript Format (EPS)
raster.c:
raster output, sets up bitmap arrays, includes
raster_font.h, zfiletypes.h
svg.c:
Scalable Vector Graphic Format (SVG), includes
fonts/normal_woff2.h, fonts/upcean_woff2.h
tif.c:
Tagged Image File Format (TIF)
vector.c:
vector output, sets up vector linked lists, includes
zfiletypes.h
Windows-only
------------
dllversion.c:
DllGetVersion()
libzint.rc:
resource script
+77 -39
View File
@@ -580,8 +580,6 @@ static int dm_edi_buffer_xfer(int process_buffer[8], int process_p, unsigned cha
return process_p;
}
#define DM_DMRE_SQUARE_MASK 0x65 /* 101 */
/* Get index of symbol size in codewords array `dm_matrixbytes`, as specified or
else smallest containing `minimum` codewords */
static int dm_get_symbolsize(struct zint_symbol *symbol, const int minimum) {
@@ -595,10 +593,11 @@ static int dm_get_symbolsize(struct zint_symbol *symbol, const int minimum) {
}
for (i = minimum >= 62 ? 23 : 0; minimum > dm_matrixbytes[i]; i++);
if ((symbol->option_3 & DM_DMRE_SQUARE_MASK) == DM_DMRE) {
/* `DM_DMRE` trumps `DM_SQUARE` */
if ((symbol->option_3 & DM_SQUARE_DMRE_MASK) == DM_DMRE) {
return i;
}
if ((symbol->option_3 & DM_DMRE_SQUARE_MASK) == DM_SQUARE) {
if ((symbol->option_3 & DM_SQUARE_DMRE_MASK) == DM_SQUARE) {
/* Skip rectangular symbols in square only mode */
for (; dm_matrixH[i] != dm_matrixW[i]; i++);
return i;
@@ -775,9 +774,9 @@ static int dm_getEndMode(struct zint_symbol *symbol, const unsigned char *source
#endif
/* Return number of C40/TEXT codewords needed to encode characters in full batches of 3 (or less if EOD).
The number of characters encoded is returned in `len` */
The number of characters encoded is returned in `p_len` */
static int dm_getNumberOfC40Words(const unsigned char *source, const int length, const int from, const int mode,
int *len) {
int *p_len) {
int thirdsCount = 0;
int i;
@@ -797,11 +796,11 @@ static int dm_getNumberOfC40Words(const unsigned char *source, const int length,
remainder = thirdsCount % 3;
if (remainder == 0 || (remainder == 2 && i + 1 == length)) {
*len = i - from + 1;
*p_len = i - from + 1;
return ((thirdsCount + 2) / 3) * 2;
}
}
*len = 0;
*p_len = 0;
return 0;
}
@@ -1248,8 +1247,7 @@ static int dm_minimalenc(struct zint_symbol *symbol, const unsigned char source[
/* Encode using algorithm based on ISO/IEC 21471:2020 Annex J (was ISO/IEC 21471:2006 Annex P) */
static int dm_isoenc(struct zint_symbol *symbol, const unsigned char source[], const int length, int *p_sp,
unsigned char target[], int *p_tp, int process_buffer[8], int *p_process_p, int *p_b256_start,
int *p_current_mode, const int gs1, const int debug_print) {
const int mailmark = symbol->symbology == BARCODE_MAILMARK_2D;
int *p_current_mode, const int gs1, const int b256_end, const int c40_end, const int debug_print) {
int sp = *p_sp;
int tp = *p_tp;
int process_p = *p_process_p;
@@ -1260,21 +1258,17 @@ static int dm_isoenc(struct zint_symbol *symbol, const unsigned char source[], c
/* step (a) */
int next_mode = DM_ASCII;
if (mailmark) { /* First 45 characters C40 */
assert(length >= 45);
assert(b256_end <= length && c40_end <= length && (b256_end == 0 || c40_end == 0));
if (b256_end) {
/* First characters in Base 256 */
next_mode = DM_BASE256;
tp = dm_switch_mode(next_mode, target, tp, p_b256_start, debug_print);
current_mode = next_mode;
} else if (c40_end) {
/* First characters in C40 */
next_mode = DM_C40;
tp = dm_switch_mode(next_mode, target, tp, p_b256_start, debug_print);
while (sp < 45) {
assert(dm_isc40(source[sp]));
process_buffer[process_p++] = dm_c40_value[source[sp]];
if (process_p >= 3) {
process_p = dm_ctx_buffer_xfer(process_buffer, process_p, target, &tp, debug_print);
}
sp++;
}
current_mode = next_mode;
not_first = 1;
}
while (sp < length) {
@@ -1322,7 +1316,7 @@ static int dm_isoenc(struct zint_symbol *symbol, const unsigned char source[], c
} else if (current_mode == DM_C40 || current_mode == DM_TEXT) {
next_mode = current_mode;
if (process_p == 0 && not_first) {
if (process_p == 0 && not_first && (sp >= c40_end)) { /* `c40_end` only set if `current_mode` DM_C40 */
next_mode = dm_look_ahead_test(source, length, sp, current_mode, process_p, gs1, debug_print);
}
@@ -1456,7 +1450,7 @@ static int dm_isoenc(struct zint_symbol *symbol, const unsigned char source[], c
next_mode = DM_ASCII;
} else {
next_mode = DM_BASE256;
if (not_first) {
if (not_first && sp >= b256_end) {
next_mode = dm_look_ahead_test(source, length, sp, current_mode, tp - (*p_b256_start + 1), gs1,
debug_print);
}
@@ -1473,12 +1467,7 @@ static int dm_isoenc(struct zint_symbol *symbol, const unsigned char source[], c
tp = dm_switch_mode(next_mode, target, tp, p_b256_start, debug_print);
not_first = 0;
} else {
if (gs1 == 2 && source[sp] == '\x1D') {
target[tp++] = 29; /* GS */
} else {
target[tp++] = source[sp];
}
sp++;
target[tp++] = source[sp++];
not_first = 1;
if (debug_print) printf("B%02X ", target[tp - 1]);
}
@@ -1501,8 +1490,9 @@ static int dm_isoenc(struct zint_symbol *symbol, const unsigned char source[], c
/* Encodes data using ASCII, C40, Text, X12, EDIFACT or Base 256 modes as appropriate
Supports encoding FNC1 in supporting systems */
static int dm_encode(struct zint_symbol *symbol, const unsigned char source[], const int length, const int eci,
const int last_seg, const int gs1, unsigned char target[], int *p_tp) {
static int dm_encode(struct zint_symbol *symbol, const unsigned char source[], const int length,
const int eci, const int last_seg, const int gs1, const int b256_end, const int c40_end,
unsigned char target[], int *p_tp) {
int sp = 0;
int tp = *p_tp;
int current_mode = DM_ASCII;
@@ -1531,9 +1521,9 @@ static int dm_encode(struct zint_symbol *symbol, const unsigned char source[], c
}
/* If FAST_MODE or MAILMARK_2D, do Annex J-based encodation */
if ((symbol->input_mode & FAST_MODE) || symbol->symbology == BARCODE_MAILMARK_2D) {
if ((symbol->input_mode & FAST_MODE) || b256_end || c40_end) {
error_number = dm_isoenc(symbol, source, length, &sp, target, &tp, process_buffer, &process_p,
&b256_start, &current_mode, gs1, debug_print);
&b256_start, &current_mode, gs1, b256_end, c40_end, debug_print);
} else { /* Do default minimal encodation */
error_number = dm_minimalenc(symbol, source, length, last_seg, &sp, target, &tp, process_buffer, &process_p,
&b256_start, &current_mode, gs1, debug_print);
@@ -1681,8 +1671,9 @@ static int dm_encode(struct zint_symbol *symbol, const unsigned char source[], c
#ifdef ZINT_TEST /* Wrapper for direct testing */
INTERNAL int zint_test_dm_encode(struct zint_symbol *symbol, const unsigned char source[], const int length,
const int eci, const int last_seg, const int gs1, unsigned char target[], int *p_tp) {
return dm_encode(symbol, source, length, eci, last_seg, gs1, target, p_tp);
const int eci, const int last_seg, const int gs1, const int b256_end, const int c40_end,
unsigned char target[], int *p_tp) {
return dm_encode(symbol, source, length, eci, last_seg, gs1, b256_end, c40_end, target, p_tp);
}
#endif
@@ -1694,9 +1685,13 @@ static int dm_encode_segs(struct zint_symbol *symbol, struct zint_seg segs[], co
int i;
int tp = 0;
int in_macro = 0;
int tot_length = 0, b256_have_fnc1 = 0;
const struct zint_seg *last_seg = &segs[seg_count - 1];
/* gs1 flag values: 0: no GS1, 1: GS1 with FNC1 serparator, 2: GS separator */
const int gs1 = (symbol->input_mode & 0x07) == GS1_MODE ? 1 + !!(symbol->output_options & GS1_GS_SEPARATOR) : 0;
const int mailmark = symbol->symbology == BARCODE_MAILMARK_2D;
const int have_c40 = (symbol->option_3 & DM_C40_START) && symbol->option_1 >= 0;
const int have_b256 = (symbol->option_3 & DM_B256_START) && symbol->option_1 >= 0;
/* Raw text dealt with by `ZBarcode_Encode_Segs()`, except for `eci` feedback.
Note not updating `eci` for GS1 mode as not converted */
const int content_segs = !gs1 && (symbol->output_options & BARCODE_CONTENT_SEGS);
@@ -1803,7 +1798,10 @@ static int dm_encode_segs(struct zint_symbol *symbol, struct zint_seg segs[], co
}
for (i = 0; i < seg_count; i++) {
const unsigned char *source;
int length;
int src_inc = 0, len_dec = 0;
int b256_end = 0, c40_end = 0;
if (in_macro) {
if (i == 0) {
src_inc = len_dec = 7; /* Skip over macro characters at beginning */
@@ -1812,14 +1810,54 @@ static int dm_encode_segs(struct zint_symbol *symbol, struct zint_seg segs[], co
len_dec += 2; /* Remove RS + EOT from end */
}
}
if ((error_number = dm_encode(symbol, segs[i].source + src_inc, segs[i].length - len_dec, segs[i].eci,
i + 1 == seg_count, gs1, target, &tp))) {
source = segs[i].source + src_inc;
length = segs[i].length - len_dec;
if (mailmark) {
assert(seg_count == 1);
assert(length >= 45);
c40_end = 45; /* Min */
/* Allow specifying greater than 45 */
if (have_c40 && (symbol->option_1 == 0 || symbol->option_1 > 45)) {
c40_end = symbol->option_1 > 0 && symbol->option_1 < length ? symbol->option_1 : length;
}
/* `DM_C40_START` trumps `DM_B256_START` */
} else if (have_c40) {
if (symbol->option_1 == 0) {
c40_end = length;
} else if (symbol->option_1 < tot_length) {
c40_end = 0;
} else {
c40_end = symbol->option_1 - tot_length < length ? symbol->option_1 - tot_length : length;
}
} else if (have_b256) {
if (b256_have_fnc1) {
b256_end = 0;
} else {
if (symbol->option_1 == 0) {
b256_end = length;
} else if (symbol->option_1 < tot_length) {
b256_end = 0;
} else {
b256_end = symbol->option_1 - tot_length < length ? symbol->option_1 - tot_length : length;
}
if (gs1 == 1) {
/* Stop at first FNC1 */
const int b256_len = b256_end;
for (b256_end = 0; b256_end < b256_len && source[b256_end] != '\x1D'; b256_end++);
b256_have_fnc1 = b256_end != b256_len;
}
}
}
if ((error_number = dm_encode(symbol, source, length, segs[i].eci, i + 1 == seg_count, gs1, b256_end, c40_end,
target, &tp))) {
assert(error_number >= ZINT_ERROR);
return error_number;
}
if (content_segs && segs[i].eci) {
z_ct_set_seg_eci(symbol, i, segs[i].eci);
}
tot_length += length;
}
*p_binlen = tp;
@@ -1973,7 +2011,7 @@ static int dm_ecc200(struct zint_symbol *symbol, struct zint_seg segs[], const i
INTERNAL int zint_datamatrix(struct zint_symbol *symbol, struct zint_seg segs[], const int seg_count) {
if (symbol->option_1 <= 1) {
if (symbol->option_1 <= 1 || (symbol->option_3 & DM_B256_C40_START_MASK)) {
/* ECC 200 */
return dm_ecc200(symbol, segs, seg_count);
}
+8 -1
View File
@@ -1569,7 +1569,14 @@ int ZBarcode_Encode_File(struct zint_symbol *symbol, const char *filename) {
file = fopen(filename, "rb");
#endif
if (!file) {
ZEXT z_errtxtf(0, symbol, 229, "Unable to read input file (%1$d: %2$s)", errno, strerror(errno));
const int len = (int) strlen(filename);
if (len > 40) {
ZEXT z_errtxtf(0, symbol, 233, "Unable to read input file \"%1$.10s...%2$.30s\" (%3$d: %4$s)",
filename, filename + (len - 30), errno, strerror(errno));
} else {
ZEXT z_errtxtf(0, symbol, 229, "Unable to read input file \"%1$s\" (%2$d: %3$s)",
filename, errno, strerror(errno));
}
return error_tag(ZINT_ERROR_INVALID_DATA, symbol, -1, NULL);
}
file_opened = 1;
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (C) 2009-2025 Robin Stuart <rstuart114@gmail.com>
# Copyright (C) 2019-2026 Robin Stuart <rstuart114@gmail.com>
# Adapted from qrencode/tests/CMakeLists.txt
# Copyright (C) 2006-2017 Kentaro Fukuchi <kentaro@fukuchi.org>
# vim: set ts=4 sw=4 et :
+1 -1
View File
@@ -235,7 +235,7 @@ static const struct settings_item settings[] = {
{ 68, BARCODE_AUSREDIRECT, GDSET_F, 0, -1, 0, -1, 0, -1, 1, 8 },
{ 69, BARCODE_ISBNX, ISBNX_ADDON_SANE_F, 0, -1, 0, -1, 0, -1, 9, 19 },
{ 70, BARCODE_RM4SCC, KRSET_F, 0, -1, 0, -1, 0, -1, 1, 50 },
{ 71, BARCODE_DATAMATRIX, 0, 0, -1, 0, 48, 128, 128, 1, 3550 },
{ 71, BARCODE_DATAMATRIX, 0, 0, 20, 0, 48, 0, 238, 1, 3550 },
{ 72, BARCODE_EAN14, NEON_F, 0, -1, 0, -1, 0, -1, 1, 13 },
{ 73, BARCODE_VIN, ARSENIC_F, 0, -1, 0, -1, 0, -1, 17, 17 },
{ 74, BARCODE_CODABLOCKF, 0, -1, 44, -1, 67, 4, 4, 1, 2725 },
File diff suppressed because it is too large Load Diff
+20 -4
View File
@@ -1524,9 +1524,12 @@ static void test_encode_file_directory(const testCtx *const p_ctx) {
static void test_encode_file(const testCtx *const p_ctx) {
int ret;
struct zint_symbol *symbol = NULL;
const char *data = "1";
const char *filename = "test_encode_file_in.txt";
const char *outfile = "test_encode_file_out.gif";
const char data[] = "1";
const char filename[] = "test_encode_file_in.txt";
const char outfile[] = "test_encode_file_out.gif";
const char long_filename[] = "test_encode_file_in_1234567890123456789012345678901234567890.txt";
const char long_filename_errtxt[]
= "Error 233: Unable to read input file \"test_encod...56789012345678901234567890.txt\" (";
FILE *fp;
(void)p_ctx;
@@ -1580,6 +1583,19 @@ static void test_encode_file(const testCtx *const p_ctx) {
ZBarcode_Delete(symbol);
}
{
symbol = ZBarcode_Create();
assert_nonnull(symbol, "Symbol not created\n");
strcpy(symbol->outfile, outfile);
ret = ZBarcode_Encode_File_and_Buffer_Vector(symbol, long_filename, 0);
assert_nonzero(ret, "ret %d == 0 (%s)\n", ret, symbol->errtxt);
assert_zero(strncmp(symbol->errtxt, long_filename_errtxt, sizeof(long_filename_errtxt) - 1),
"strncmp(%s, %s) != 0\n", symbol->errtxt, long_filename_errtxt);
ZBarcode_Delete(symbol);
}
ret = testUtilRemove(filename);
assert_zero(ret, "testUtilRemove(%s) != 0 (%d: %s)\n", filename, errno, strerror(errno));
@@ -1632,7 +1648,7 @@ static void test_bad_args(const testCtx *const p_ctx) {
"Error 200: Input segments NULL",
"Error 239: Filename NULL",
"Error 778: No input data",
"Error 229: Unable to read input file (", /* Excluding OS-dependent `errno` stuff */
"Error 229: Unable to read input file \"", /* Excluding filename and OS-dependent `errno` stuff */
"Error 771: Too many input segments (maximum 256)",
"Error 205: No input data",
"Error 777: Input too long",
+85 -13
View File
@@ -463,7 +463,9 @@ static void test_2d_encode(const testCtx *const p_ctx) {
int debug = p_ctx->debug;
struct item {
int option_1;
int option_2;
int option_3;
const char *data;
int ret;
@@ -478,7 +480,7 @@ static void test_2d_encode(const testCtx *const p_ctx) {
/* Mailmark Barcode Definition Document 15th Feb 2021 (MBDD)
https://www.royalmailtechnical.com/rmt_docs/User_Guides_2021/Mailmark_Barcode_definition_document_20210215.pdf */
static const struct item data[] = {
/* 0*/ { 8, "JGB 01Z999999900000001EC1A1AA1A0SN35TQ ", 0, 24, 24, 1, "MMRLLL Section 2.4 Code Type Format 7 figure **NOT SAME**, figure switches from C40 to ASC to C40 to ASC contrary to spec",
/* 0*/ { -1, 8, -1, "JGB 01Z999999900000001EC1A1AA1A0SN35TQ ", 0, 24, 24, 1, "MMRLLL Section 2.4 Code Type Format 7 figure **NOT SAME**, figure switches from C40 to ASC to C40 to ASC contrary to spec",
"101010101010101010101010"
"110000010100011001100001"
"101001011100001011111010"
@@ -504,7 +506,7 @@ static void test_2d_encode(const testCtx *const p_ctx) {
"100111100000101110001010"
"111111111111111111111111"
},
/* 1*/ { 10, "JGB 01Z999999900000001EC1A1AA1A0SN35TQ ", 0, 32, 32, 1, "MMRLLL Section 2.4 Code Type Format 9 figure **NOT SAME**, figure switches as above",
/* 1*/ { -1, 10, -1, "JGB 01Z999999900000001EC1A1AA1A0SN35TQ ", 0, 32, 32, 1, "MMRLLL Section 2.4 Code Type Format 9 figure **NOT SAME**, figure switches as above",
"10101010101010101010101010101010"
"11000001010001111001100100101111"
"10100101110000101011110000000000"
@@ -538,7 +540,7 @@ static void test_2d_encode(const testCtx *const p_ctx) {
"11001101100011101011101000001000"
"11111111111111111111111111111111"
},
/* 2*/ { 30, "JGB 01Z999999900000001EC1A1AA1A0SN35TQ ", 0, 16, 48, 1, "MMRLLL Section 2.4 Code Type Format 29 figure **NOT SAME**, figure switches as above",
/* 2*/ { -1, 30, -1, "JGB 01Z999999900000001EC1A1AA1A0SN35TQ ", 0, 16, 48, 1, "MMRLLL Section 2.4 Code Type Format 29 figure **NOT SAME**, figure switches as above",
"101010101010101010101010101010101010101010101010"
"110000010100011001101111111101100101100100011101"
"101001011100001011100010100100011001100010101100"
@@ -556,7 +558,7 @@ static void test_2d_encode(const testCtx *const p_ctx) {
"101101100011101110101010100001111111001010100010"
"111111111111111111111111111111111111111111111111"
},
/* 3*/ { 30, "JGB 012100123412345678AB19XY1A 0 REFERENCE 12300AB", 0, 16, 48, 1, "MBDD Table 4 example",
/* 3*/ { -1, 30, -1, "JGB 012100123412345678AB19XY1A 0 REFERENCE 12300AB", 0, 16, 48, 1, "MBDD Table 4 example",
"101010101010101010101010101010101010101010101010"
"110000010100010110001111111011100000001001111111"
"101001011100011001110010100100010100110011111100"
@@ -574,7 +576,7 @@ static void test_2d_encode(const testCtx *const p_ctx) {
"101111100001111111101010100010111101100101001100"
"111111111111111111111111111111111111111111111111"
},
/* 4*/ { 10, "JGB 012100123412345678AB19XY1A 0 www.xyz.com", 0, 32, 32, 1, "MBDD Table 5 (& BWIPP) example",
/* 4*/ { -1, 10, -1, "JGB 012100123412345678AB19XY1A 0 www.xyz.com", 0, 32, 32, 1, "MBDD Table 5 (& BWIPP) example",
"10101010101010101010101010101010"
"11000001010001011111111110001111"
"10100101110001101001111111000000"
@@ -608,7 +610,7 @@ static void test_2d_encode(const testCtx *const p_ctx) {
"11000011100001101111110101011100"
"11111111111111111111111111111111"
},
/* 5*/ { 10, "JGB 010100000700009001B707RH1A 0SN35XX ABCDEFGHIJ1234567890ABCDEFGHIJ1234567890A", 0, 32, 32, 1, "TEC-IT example, same",
/* 5*/ { -1, 10, -1, "JGB 010100000700009001B707RH1A 0SN35XX ABCDEFGHIJ1234567890ABCDEFGHIJ1234567890A", 0, 32, 32, 1, "TEC-IT example, same",
"10101010101010101010101010101010"
"11000001010001111000100110110001"
"10100101110000101010110010100000"
@@ -642,7 +644,75 @@ static void test_2d_encode(const testCtx *const p_ctx) {
"10111101100000001010110001010110"
"11111111111111111111111111111111"
},
/* 6*/ { 10, "JGB 010100000700009001B707RH1A 0SN35XX é", 0, 32, 32, 1, "",
/* 6*/ { -1, 10, -1, "JGB 010100000700009001B707RH1A 0SN35XX é", 0, 32, 32, 1, "",
"10101010101010101010101010101010"
"11000001010001111001101100001111"
"10100101110000101011111110000000"
"10101000010110011001101011000101"
"10001100111000101111000111011110"
"10011100011000011100101000100101"
"11001111001000101010010010011110"
"10100101011000111100001100101111"
"10101111010111101100111100110100"
"11001001100100111001110000010111"
"11001000001001001101001111011110"
"11010000001111111011011101101101"
"11001000010000101001101010011010"
"11010111000101011111111101111111"
"10111101100011101110001100110100"
"11111111111111111111111111111111"
"10101010101010101010101010101010"
"11011101100000011000000001110001"
"11110000111100101000011000101010"
"11001011110010011000011101110001"
"11011111000101001011100101011100"
"10010101101100011100010000011101"
"10011001101011101110100111101000"
"11101010110010111001111100100101"
"10011011111101001000101111110100"
"10011101010101111111111000111101"
"11100001010010101011001010000000"
"10011010101011111000011010001001"
"11101001100100001101010001011000"
"10001001100100011011110101100101"
"11001011100001001010111101010100"
"11111111111111111111111111111111"
},
/* 7*/ { 0, 10, DM_C40_START, "JGB 010100000700009001B707RH1A 0SN35XX é", 0, 32, 32, 0, "BWIPP fixes c40headerlength at 45",
"10101010101010101010101010101010"
"11000001010001111000000111101111"
"10100101110000101010011111000000"
"10101000010110011000111011000101"
"10001100111000101111000111011110"
"10011100011000011100101000100101"
"11001111001000101010010010011110"
"10100101011000111100001100101111"
"10101111010111101100111100110100"
"11001001100100111001110000010111"
"11001000001001001101000111010010"
"11010000001111111011011111100001"
"11001000010000101001010110001010"
"11010111000101011111111010110011"
"10111101100011101111010010010000"
"11111111111111111111111111111111"
"10101010101010101010101010101010"
"11011101100000011011100000000001"
"11110000111100001001011110110010"
"11001011110010011010101001010001"
"11011111000110001011101010011000"
"10010101101100011010001110010101"
"10011001101111101011100011110000"
"11101010110000011011000010101101"
"10011011011100101100100000010110"
"10011101010111111011000011110101"
"11100001000100101110110101110000"
"10011000100011011101111110110001"
"11100100110001001010010111001100"
"10001001110001011010101100000001"
"11000001100010101010110110001100"
"11111111111111111111111111111111"
},
/* 8*/ { 40, 10, DM_C40_START, "JGB 010100000700009001B707RH1A 0SN35XX é", 0, 32, 32, 1, "",
"10101010101010101010101010101010"
"11000001010001111001101100001111"
"10100101110000101011111110000000"
@@ -699,7 +769,7 @@ static void test_2d_encode(const testCtx *const p_ctx) {
assert_nonnull(symbol, "Symbol not created\n");
length = testUtilSetSymbol(symbol, BARCODE_MAILMARK_2D, -1 /*input_mode*/, -1 /*eci*/,
-1 /*option_1*/, data[i].option_2, -1 /*option_3*/, -1 /*output_options*/,
data[i].option_1, data[i].option_2, data[i].option_3, -1 /*output_options*/,
data[i].data, -1, debug);
ret = ZBarcode_Encode(symbol, TCU(data[i].data), length);
@@ -707,8 +777,9 @@ static void test_2d_encode(const testCtx *const p_ctx) {
i, ret, data[i].ret, symbol->errtxt);
if (p_ctx->generate) {
printf(" /*%3d*/ { %d, \"%s\", %s, %d, %d, %d, \"%s\",\n",
i, data[i].option_2, testUtilEscape(data[i].data, length, escaped, sizeof(escaped)),
printf(" /*%3d*/ { %d, %d, %s, \"%s\", %s, %d, %d, %d, \"%s\",\n",
i, data[i].option_1, data[i].option_2, testUtilOption3Name(symbol->symbology, data[i].option_3),
testUtilEscape(data[i].data, length, escaped, sizeof(escaped)),
testUtilErrorName(data[i].ret), symbol->rows, symbol->width, data[i].bwipp_cmp, data[i].comment);
testUtilModulesPrint(symbol, " ", "\n");
printf(" },\n");
@@ -725,15 +796,16 @@ static void test_2d_encode(const testCtx *const p_ctx) {
assert_zero(ret, "i:%d testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n",
i, ret, width, row, data[i].data);
if (do_bwipp && testUtilCanBwipp(i, symbol, -1, data[i].option_2, -1, debug)) {
if (do_bwipp && testUtilCanBwipp(i, symbol, data[i].option_1, data[i].option_2, data[i].option_3,
debug)) {
if (!data[i].bwipp_cmp) {
if (debug & ZINT_DEBUG_TEST_PRINT) {
printf("i:%d %s not BWIPP compatible (%s)\n",
i, testUtilBarcodeName(symbol->symbology), data[i].comment);
}
} else {
ret = testUtilBwipp(i, symbol, -1, data[i].option_2, -1, data[i].data, length, NULL, cmp_buf,
sizeof(cmp_buf), NULL);
ret = testUtilBwipp(i, symbol, data[i].option_1, data[i].option_2, data[i].option_3,
data[i].data, length, NULL, cmp_buf, sizeof(cmp_buf), NULL);
assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n",
i, testUtilBarcodeName(symbol->symbology), ret);
+22 -8
View File
@@ -624,20 +624,27 @@ const char *testUtilOption3Name(int symbology, int option_3) {
} else {
name = (option_3 & 0xFF) ? "-1" : "0";
}
} else if (symbology == BARCODE_DATAMATRIX || symbology == BARCODE_HIBC_DM) {
} else if (symbology == BARCODE_DATAMATRIX || symbology == BARCODE_HIBC_DM || symbology == BARCODE_MAILMARK_2D) {
if (option_3 > 0) {
if ((option_3 & 0x7F) == DM_SQUARE) {
/* Note only catering for commonly used combinations here */
if ((option_3 & DM_SQUARE_DMRE_MASK) == DM_SQUARE) {
if ((option_3 & DM_ISO_144) == DM_ISO_144) {
name = "DM_SQUARE | DM_ISO_144";
} else {
name = "DM_SQUARE";
}
} else if ((option_3 & 0x7F) == DM_DMRE) {
} else if ((option_3 & DM_SQUARE_DMRE_MASK) == DM_DMRE) {
if ((option_3 & DM_ISO_144) == DM_ISO_144) {
name = "DM_DMRE | DM_ISO_144";
} else {
name = "DM_DMRE";
}
} else if ((option_3 & DM_B256_C40_START_MASK) == DM_B256_C40_START_MASK) {
name = "DM_B256_START | DM_C40_START";
} else if ((option_3 & DM_B256_C40_START_MASK) == DM_B256_START) {
name = "DM_B256_START";
} else if ((option_3 & DM_B256_C40_START_MASK) == DM_C40_START) {
name = "DM_C40_START";
} else if ((option_3 & DM_ISO_144) == DM_ISO_144) {
name = "DM_ISO_144";
} else {
@@ -2380,7 +2387,7 @@ static const char *testUtilBwippName(int index, const struct zint_symbol *symbol
{ "", BARCODE_AUSREDIRECT, 68, 0, 0, 0, 0, 0, },
{ "isbn", BARCODE_ISBNX, 69, 0, 1, 0, 0, 1 /*gs1_cvt*/, },
{ "royalmail", BARCODE_RM4SCC, 70, 0, 0, 0, 0, 0, },
{ "datamatrix", BARCODE_DATAMATRIX, 71, 0, 1, 1, 1, 0, },
{ "datamatrix", BARCODE_DATAMATRIX, 71, 1, 1, 1, 1, 0, },
{ "ean14", BARCODE_EAN14, 72, 0, 0, 1 /*GS1CARET*/, 0, 1 /*gs1_cvt*/, },
{ "code39", BARCODE_VIN, 73, 0, 0, 0, 0, 0, },
{ "codablockf", BARCODE_CODABLOCKF, 74, 1, 1, 0, 10 /*linear_row_height*/, 0, },
@@ -2411,7 +2418,7 @@ static const char *testUtilBwippName(int index, const struct zint_symbol *symbol
{ "hibccode39", BARCODE_HIBC_39, 99, 0, 0, 0, 0, 0, },
{ "", -1, 100, 0, 0, 0, 0, 0, },
{ "", -1, 101, 0, 0, 0, 0, 0, },
{ "hibcdatamatrix", BARCODE_HIBC_DM, 102, 0, 1, 1, 0, 0, },
{ "hibcdatamatrix", BARCODE_HIBC_DM, 102, 1, 1, 1, 0, 0, },
{ "", -1, 103, 0, 0, 0, 0, 0, },
{ "hibcqrcode", BARCODE_HIBC_QR, 104, 1, 1, 1, 0, 0, },
{ "", -1, 105, 0, 0, 0, 0, 0, },
@@ -2428,7 +2435,7 @@ static const char *testUtilBwippName(int index, const struct zint_symbol *symbol
{ "hanxin", BARCODE_HANXIN, 116, 0, 0, 0, 0, 0, },
{ "", -1, 117, 0, 0, 0, 0, 0, },
{ "", -1, 118, 0, 0, 0, 0, 0, },
{ "mailmark", BARCODE_MAILMARK_2D, 119, 0, 1, 0, 0, 0, },
{ "mailmark", BARCODE_MAILMARK_2D, 119, 1, 1, 1, 0, 0, },
{ "code128", BARCODE_UPU_S10, 120, 0, 0, 0, 0, 0, },
{ "", BARCODE_MAILMARK_4S, 121, 0, 0, 0, 0, 0, }, /* Note BWIPP mailmark is BARCODE_MAILMARK_2D above */
{ "", -1, 122, 0, 0, 0, 0, 0, },
@@ -3446,8 +3453,9 @@ int testUtilBwipp(int index, const struct zint_symbol *symbol, int option_1, int
added_dmre = 1;
}
}
if ((option_3 & 0x7F) != DM_SQUARE && symbol->width != symbol->height) {
if ((option_3 & 0x7F) == DM_DMRE && !added_dmre) {
if ((option_3 == -1 || (option_3 & DM_SQUARE_DMRE_MASK) != DM_SQUARE)
&& symbol->width != symbol->height) {
if (option_3 != -1 && (option_3 & DM_SQUARE_DMRE_MASK) == DM_DMRE && !added_dmre) {
sprintf(bwipp_opts_buf + strlen(bwipp_opts_buf), "%sdmre", strlen(bwipp_opts_buf) ? " " : "");
/*added_dmre = 1; */
}
@@ -3455,6 +3463,12 @@ int testUtilBwipp(int index, const struct zint_symbol *symbol, int option_1, int
strlen(bwipp_opts_buf) ? " " : "");
bwipp_opts = bwipp_opts_buf;
}
if (option_3 != -1 && option_1 >= 0 &&
((option_3 & DM_B256_C40_START_MASK) == DM_C40_START
|| (option_3 & DM_B256_C40_START_MASK) == DM_B256_C40_START_MASK)) { /* DM_C40_START trumps */
sprintf(bwipp_opts_buf + strlen(bwipp_opts_buf), "%sc40headerlength=%d",
strlen(bwipp_opts_buf) ? " " : "", option_1 ? option_1 : 9999);
}
if (option_3 != -1) {
bwipp_opts = bwipp_opts_buf;
}
Binary file not shown.
+1
View File
@@ -103,6 +103,7 @@ static int tif_lzw_putCode(struct filemem *fmp, const int code, const int bitsPe
"manuscript in public domain" according to "Encyclopedia of Graphics File Formats" (2nd edition, 1996)
by James D. Murray and William vanRyper, Chapter 9 "Data Compression", p.178
*/
/* Copyright (C) 1988 Bob Montgomery */
static int tif_lzw_compress(struct filemem *fmp, const unsigned char *bp, const unsigned int blen) {
short suffixes[TIF_LZW_TABLE_SIZE] = {0}; /* "shade[]" in Montgomery diagram */
/* A child is made up of a parent (or prefix) code plus a suffix byte
+9 -3
View File
@@ -332,9 +332,15 @@ extern "C" {
#define ZINT_AZTEC_FULL 128 /* Only consider Full versions on automatic symbol size selection */
/* Data Matrix specific options (`symbol->option_3`) */
#define DM_SQUARE 100 /* Only consider square versions on automatic symbol size selection */
#define DM_DMRE 101 /* Consider DMRE versions on automatic symbol size selection */
#define DM_ISO_144 128 /* Use ISO instead of "de facto" format for 144x144 (i.e. don't skew ECC) */
/* OR-able, but only one of DM_BASE_256_START/DM_C40_START, and only one of DM_SQUARE/DM_DMRE */
#define DM_B256_START 0x02 /* Use Base 256 encodation initially, length given in `option_1` (0 = all) */
#define DM_C40_START 0x08 /* Use C40 encodation initially, length given in `option_1` (0 = all) */
#define DM_SQUARE 0x64 /* Only consider square versions on automatic symbol size selection */
#define DM_DMRE 0x65 /* Consider DMRE versions on automatic symbol size selection */
#define DM_ISO_144 0x80 /* Use ISO instead of "de facto" format for 144x144 (i.e. don't skew ECC) */
/* Masks for testing the exclusive pairs above */
#define DM_B256_C40_START_MASK 0x0A /* DM_B256_START or DM_C40_START */
#define DM_SQUARE_DMRE_MASK 0x65 /* DM_SQUARE or DM_DMRE */
/* QR, Han Xin, Grid Matrix specific options (`symbol->option_3`) */
#define ZINT_FULL_MULTIBYTE 200 /* Enable Kanji/Hanzi compression for Latin-1 & binary data */
+10 -2
View File
@@ -1380,8 +1380,16 @@ namespace Zint {
}
if (m_symbol == BARCODE_DATAMATRIX || m_symbol == BARCODE_HIBC_DM) {
if (option3() & DM_B256_C40_START_MASK) {
arg_int(cmd, option3() & DM_B256_START ? "--dmb256=" : "--dmc40=", option1(), true /*allowZero*/);
}
arg_bool(cmd, "--dmiso144", (option3() & DM_ISO_144) == DM_ISO_144);
arg_bool(cmd, "--dmre", (option3() & 0x7F) == DM_DMRE);
arg_bool(cmd, "--dmre", (option3() & DM_SQUARE_DMRE_MASK) == DM_DMRE);
} else if (m_symbol == BARCODE_MAILMARK_2D) {
/* Accessing C40_START for MAILMARK_2D not currently in GUI but may be added later */
if ((option3() & DM_B256_C40_START_MASK) == DM_C40_START) {
arg_int(cmd, "--dmc40=", option1(), true /*allowZero*/);
}
}
if ((m_symbol == BARCODE_DOTCODE || (isDotty() && dotty())) && dotSize() != 0.8f) {
@@ -1494,7 +1502,7 @@ namespace Zint {
arg_bool(cmd, "--small", !notext && (fontSetting() & SMALL_TEXT));
if (m_symbol == BARCODE_DATAMATRIX || m_symbol == BARCODE_HIBC_DM) {
arg_bool(cmd, "--square", (option3() & 0x7F) == DM_SQUARE);
arg_bool(cmd, "--square", (option3() & DM_SQUARE_DMRE_MASK) == DM_SQUARE);
}
if (supportsStructApp()) {
+22 -6
View File
@@ -1010,7 +1010,7 @@ private slots:
QTest::newRow("BARCODE_DATAMATRIX (GS1Raw + GS1SyntaxEngine)") << true << 0.0f << ""
<< BARCODE_DATAMATRIX << (GS1_MODE | ESCAPE_MODE) // symbology-inputMode
<< "010952012345678810BATCH4\\G2107" << "" // text-primary
<< 0.0f << -1 << 0 << DM_SQUARE << 1.0f // height-scale
<< 0.0f << 2 << 0 << (DM_B256_START | DM_SQUARE) << 1.0f // height-scale
<< 0.0f << false << 0.7f << 1.0f // dpmm-textGap
<< 5.0f << 0 << 0 << "" // guardDescent-structAppID
<< "" << "" << QColor(Qt::black) << QColor(Qt::white) << false // fgStr-cmyk
@@ -1019,14 +1019,14 @@ private slots:
<< 0 << false << false << true << true // eci-gs1SyntaxEngine
<< false << false << false << WARN_DEFAULT << false // readerInit-debug
<< 0.0 << 0 << 0 << 0 << 0 << 0 // xdimdp
<< "zint -b 71 -d '010952012345678810BATCH4\\G2107' --esc --gs1raw --gs1strict --gssep --square"
<< "zint.exe -b 71 -d \"010952012345678810BATCH4\\G2107\" --esc --gs1raw --gs1strict --gssep --square"
<< "zint -b 71 -d '010952012345678810BATCH4\\G2107' --dmb256=2 --esc --gs1raw --gs1strict --gssep --square"
<< "zint.exe -b 71 -d \"010952012345678810BATCH4\\G2107\" --dmb256=2 --esc --gs1raw --gs1strict --gssep --square"
<< "" << "" << "" << "";
QTest::newRow("BARCODE_DATAMATRIX") << false << 0.0f << ""
<< BARCODE_DATAMATRIX << (DATA_MODE | ESCAPE_MODE | FAST_MODE) // symbology-inputMode
<< "ABCDEFGH\\x01I" << "" // text-primary
<< 0.0f << -1 << 0 << DM_ISO_144 << 1.0f // height-scale
<< 0.0f << 0 << 0 << (DM_C40_START | DM_ISO_144) << 1.0f // height-scale
<< 0.0f << false << 0.7f << 1.0f // dpmm-textGap
<< 5.0f << 0 << 0 << "" // guardDescent-structAppID
<< "" << "" << QColor(Qt::black) << QColor(Qt::white) << false // fgStr-cmyk
@@ -1035,8 +1035,24 @@ private slots:
<< 0 << false << false << false << false // eci-gs1SyntaxEngine
<< false << false << false << WARN_DEFAULT << false // readerInit-debug
<< 0.0 << 0 << 0 << 0 << 0 << 0 // xdimdp
<< "zint -b 71 --binary -d 'ABCDEFGH\\x01I' --dmiso144 --esc --fast"
<< "zint.exe -b 71 --binary -d \"ABCDEFGH\\x01I\" --dmiso144 --esc --fast"
<< "zint -b 71 --binary -d 'ABCDEFGH\\x01I' --dmc40=0 --dmiso144 --esc --fast"
<< "zint.exe -b 71 --binary -d \"ABCDEFGH\\x01I\" --dmc40=0 --dmiso144 --esc --fast"
<< "" << "" << "" << "";
QTest::newRow("BARCODE_MAILMARK_2D") << false << 0.0f << ""
<< BARCODE_DATAMATRIX << UNICODE_MODE // symbology-inputMode
<< "JGB 012100123412345678AB19XY1A 0 www.xyz.com" << "" // text-primary
<< 0.0f << 0 << 0 << DM_C40_START << 1.0f // height-scale
<< 0.0f << false << 0.7f << 1.0f // dpmm-textGap
<< 5.0f << 0 << 0 << "" // guardDescent-structAppID
<< "" << "" << QColor(Qt::black) << QColor(Qt::white) << false // fgStr-cmyk
<< 0 << 0 << 0 << 0 << 0 // borderTypeIndex-fontSetting
<< true << false << false << false << true << 90 // showText-rotateAngle
<< 0 << false << false << false << false // eci-gs1SyntaxEngine
<< false << false << false << WARN_DEFAULT << false // readerInit-debug
<< 0.0 << 0 << 0 << 0 << 0 << 0 // xdimdp
<< "zint -b 71 -d 'JGB 012100123412345678AB19XY1A 0 www.xyz.com' --dmc40=0 --rotate=90"
<< "zint.exe -b 71 -d \"JGB 012100123412345678AB19XY1A 0 www.xyz.com\" --dmc40=0 --rotate=90"
<< "" << "" << "" << "";
QTest::newRow("BARCODE_DBAR_EXPSTK_CC") << false << 40.8f << ""
+32 -4
View File
@@ -191,6 +191,8 @@
- Fiddled with some help capitalization.
2026-02-25 GL
- Added -gs1raw switch.
2026-03-30 GL
- Added -dmb256 & -dmc40 switches.
*/
#if defined(__WIN32__) || defined(_WIN32) || defined(WIN32)
@@ -564,6 +566,8 @@ static const char help_message[] = "zint tcl(stub,obj) dll\n"
" -cols integer: Codablock F, DotCode, PDF417: number of columns\n"
" -compliantheight bool: warn if height not compliant, and use standard default\n"
/* cli option --data is standard parameter */
" -dmb256 integer: start Data Matrix in Base 256 mode for given length (0 means all)\n"
" -dmc40 integer: start Data Matrix in C40 mode for given length (0 means all)\n"
" -dmiso144 bool: use ISO format for 144x144 Data Matrix symbols\n"
" -dmre bool: allow Data Matrix Rectangular Extended\n"
" -dotsize number: radius ratio of dots from 0.01 to 1.0\n"
@@ -911,7 +915,8 @@ static int Encode(Tcl_Interp *interp, int objc,
static const char *optionList[] = {
"-addongap", "-azfull",
"-barcode", "-bg", "-bind", "-bindtop", "-bold", "-border", "-box",
"-cols", "-compliantheight", "-dmiso144", "-dmre", "-dotsize", "-dotty",
"-cols", "-compliantheight",
"-dmb256", "-dmc40", "-dmiso144", "-dmre", "-dotsize", "-dotty",
"-eci", "-esc", "-extraesc", "-fast", "-fg", "-format", "-fullmultibyte",
"-gs1nocheck", "-gs1parens", "-gs1raw", "-gs1strict",
"-gssep", "-guarddescent",
@@ -925,7 +930,8 @@ static int Encode(Tcl_Interp *interp, int objc,
enum iOption {
iAddonGap, iAzFull,
iBarcode, iBG, iBind, iBindTop, iBold, iBorder, iBox,
iCols, iCompliantHeight, iDMISO144, iDMRE, iDotSize, iDotty,
iCols, iCompliantHeight,
iDMB256, iDMC40, iDMISO144, iDMRE, iDotSize, iDotty,
iECI, iEsc, iExtraEsc, iFast, iFG, iFormat, iFullMultiByte,
iGS1NoCheck, iGS1Parens, iGS1Raw, iGS1Strict,
iGSSep, iGuardDescent,
@@ -1012,6 +1018,8 @@ static int Encode(Tcl_Interp *interp, int objc,
case iAddonGap:
case iBorder:
case iCols:
case iDMB256:
case iDMC40:
case iMask:
case iMode:
case iRotate:
@@ -1293,12 +1301,12 @@ static int Encode(Tcl_Interp *interp, int objc,
case iSquare:
/* DM_SQUARE overwrites DM_DMRE */
if (intValue)
my_symbol->option_3 = DM_SQUARE | (my_symbol->option_3 & ~0x7F);
my_symbol->option_3 = DM_SQUARE | (my_symbol->option_3 & ~DM_SQUARE_DMRE_MASK);
break;
case iDMRE:
/* DM_DMRE overwrites DM_SQUARE */
if (intValue)
my_symbol->option_3 = DM_DMRE | (my_symbol->option_3 & ~0x7F);
my_symbol->option_3 = DM_DMRE | (my_symbol->option_3 & ~DM_SQUARE_DMRE_MASK);
break;
case iDMISO144:
if (intValue)
@@ -1367,6 +1375,26 @@ static int Encode(Tcl_Interp *interp, int objc,
my_symbol->border_width = intValue;
}
break;
case iDMB256:
if (intValue < 0) {
Tcl_SetObjResult(interp,
Tcl_NewStringObj("Data Matrix Base 256 mode length out of range", -1));
fError = 1;
} else {
my_symbol->option_1 = intValue;
my_symbol->option_3 = DM_B256_START | (my_symbol->option_3 & ~DM_B256_C40_START_MASK);
}
break;
case iDMC40:
if (intValue < 0) {
Tcl_SetObjResult(interp,
Tcl_NewStringObj("Data Matrix C40 mode length out of range", -1));
fError = 1;
} else {
my_symbol->option_1 = intValue;
my_symbol->option_3 = DM_C40_START | (my_symbol->option_3 & ~DM_B256_C40_START_MASK);
}
break;
case iGuardDescent:
if ((float)doubleValue < 0.0f || (float)doubleValue > 50.0f) {
Tcl_SetObjResult(interp,
+8 -7
View File
@@ -13,11 +13,12 @@ License: GPL-3.0-or-later
Files: backend/*
Copyright:
Copyright (C) 2017-2026 Robin Stuart <rstuart114@gmail.com>
Copyright (C) 2007-2026 Robin Stuart <rstuart114@gmail.com>
Copyright (C) 2014-2026 Harald Oehlmann <oehhar@users.sourceforge.net>
Copyright (C) Cliff Hones 2004
Copyright (c) 2004 Adrian Kennard, Andrews & Arnold Ltd
Copyright (c) 2015, Harald Kuhr
Copyright (C) 1988 Bob Montgomery
Copyright (C) 2024-2025 Antoine Merino <antoine.merino.dev@gmail.com>
Copyright (c) 2006 Stefan Schmidt <stefan@datenfreihafen.org>
Copyright (C) 2016 Zoe Stuart
@@ -66,14 +67,14 @@ Files:
backend/ksx1001.h
backend/sjis.h
Copyright:
Copyright (C) 2017-2026 Robin Stuart <rstuart114@gmail.com>
Copyright (C) 2009-2026 Robin Stuart <rstuart114@gmail.com>
Copyright © 1991-2023 Unicode, Inc.
License: BSD-3-Clause and Unicode-3.0
Files:
backend/channel.c
Copyright:
Copyright (C) 2017-2026 Robin Stuart <rstuart114@gmail.com>
Copyright (C) 2008-2026 Robin Stuart <rstuart114@gmail.com>
Copyright © AIM 1997
Copyright (c) 2004-2026 Terry Burton
License: BSD-3-Clause and MIT and AIM
@@ -84,7 +85,7 @@ Files:
backend/hanxin.c
backend/qr.*
Copyright:
Copyright (C) 2017-2026 Robin Stuart <rstuart114@gmail.com>
Copyright (C) 2008-2026 Robin Stuart <rstuart114@gmail.com>
Copyright (c) 2004-2026 Terry Burton
Copyright (c) 2008-2009 Bjoern Hoehrmann <bjoern@hoehrmann.de>
Copyright (c) Project Nayuki
@@ -95,7 +96,7 @@ Files:
backend/rss.c
backend/tools/gen_pwr928_table.php
Copyright:
Copyright (C) 2017-2026 Robin Stuart <rstuart114@gmail.com>
Copyright (C) 2008-2026 Robin Stuart <rstuart114@gmail.com>
Copyright (c) 2004-2026 Terry Burton
Copyright (C) 2006 BSI
License: BSD-3-Clause and MIT and BSI
@@ -103,14 +104,14 @@ License: BSD-3-Clause and MIT and BSI
Files:
backend/pcx.c
Copyright:
Copyright (C) 2017-2026 Robin Stuart <rstuart114@gmail.com>
Copyright (C) 2009-2026 Robin Stuart <rstuart114@gmail.com>
Copyright 1999-2013 ImageMagick Studio LLC
License: BSD-3-Clause and ImageMagick
Files:
backend/pdf417.c
Copyright:
Copyright (C) 2017-2026 Robin Stuart <rstuart114@gmail.com>
Copyright (C) 2008-2026 Robin Stuart <rstuart114@gmail.com>
Copyright (C) 2004 (Grandzebu).
License: BSD-3-Clause and GPL-2.0-or-later
+16
View File
@@ -6504,6 +6504,12 @@ ISO/IEC standard placement, use option <code>--dmiso144</code> (API
<code>option_3 |= DM_ISO_144</code>).</p>
<p>For a faster but less optimal encodation, the <code>--fast</code>
option (API <code>input_mode |= FAST_MODE</code>) may be used.</p>
<p>The encodation mode of initial input characters may be forced using
the <code>--dmb256</code> (API <code>option_3 |= DM_B256_START</code>)
and <code>--dmc40</code> (API <code>option_3 |= DM_C40_START</code>)
options. Both take an integer (API <code>option_1</code>) which
specifies how many initial characters to encode in the respective mode,
with <code>0</code> meaning all.</p>
<p>Data Matrix supports Structured Append of up to 16 symbols and a
numeric ID (file identifications), which can be set by using the
<code>--structapp</code> option (see <a href="#structured-append">4.17
@@ -9249,6 +9255,16 @@ anything.</p>
pipe or a file. Use <code>--filetype</code> to specify output
format.</p>
</dd>
<dt><code>--dmb256=INTEGER</code></dt>
<dd>
<p>For Data Matrix symbols, encode the first <em>INTEGER</em> input
characters in Base 256 mode. 0 means all input.</p>
</dd>
<dt><code>--dmc40=INTEGER</code></dt>
<dd>
<p>For Data Matrix symbols, encode the first <em>INTEGER</em> input
characters in C40 mode. 0 means all input.</p>
</dd>
<dt><code>--dmiso144</code></dt>
<dd>
<p>For Data Matrix symbols, use the standard ISO/IEC codeword placement
+6
View File
@@ -4345,6 +4345,12 @@ placement, use option `--dmiso144` (API `option_3 |= DM_ISO_144`).
For a faster but less optimal encodation, the `--fast` option (API `input_mode
|= FAST_MODE`) may be used.
The encodation mode of initial input characters may be forced using the
`--dmb256` (API `option_3 |= DM_B256_START`) and `--dmc40` (API `option_3 |=
DM_C40_START`) options. Both take an integer (API `option_1`) which specifies
how many initial characters to encode in the respective mode, with `0` meaning
all.
Data Matrix supports Structured Append of up to 16 symbols and a numeric ID
(file identifications), which can be set by using the `--structapp` option (see
[4.17 Structured Append]) (API `structapp`). The ID consists of 2 numbers `ID1`
+15
View File
@@ -4143,6 +4143,11 @@ placement, use option --dmiso144 (API option_3 |= DM_ISO_144).
For a faster but less optimal encodation, the --fast option (API
input_mode |= FAST_MODE) may be used.
The encodation mode of initial input characters may be forced using the --dmb256
(API option_3 |= DM_B256_START) and --dmc40 (API option_3 |= DM_C40_START)
options. Both take an integer (API option_1) which specifies how many initial
characters to encode in the respective mode, with 0 meaning all.
Data Matrix supports Structured Append of up to 16 symbols and a numeric ID
(file identifications), which can be set by using the --structapp option (see
4.17 Structured Append) (API structapp). The ID consists of 2 numbers ID1 and
@@ -5321,6 +5326,16 @@ OPTIONS
Send output to stdout, which in most cases should be re-directed to a pipe
or a file. Use --filetype to specify output format.
--dmb256=INTEGER
For Data Matrix symbols, encode the first INTEGER input characters in Base
256 mode. 0 means all input.
--dmc40=INTEGER
For Data Matrix symbols, encode the first INTEGER input characters in C40
mode. 0 means all input.
--dmiso144
For Data Matrix symbols, use the standard ISO/IEC codeword placement for 144
+11 -1
View File
@@ -1,4 +1,4 @@
.\" Automatically generated by Pandoc 3.9
.\" Automatically generated by Pandoc 3.9.0.2
.\"
.TH "ZINT" "1" "March 2026" "Version 2.16.0.9"
.SH NAME
@@ -124,6 +124,16 @@ Send output to stdout, which in most cases should be re\-directed to a
pipe or a file.
Use \f[CR]\-\-filetype\f[R] to specify output format.
.TP
\f[CR]\-\-dmb256=INTEGER\f[R]
For Data Matrix symbols, encode the first \f[I]INTEGER\f[R] input
characters in Base 256 mode.
0 means all input.
.TP
\f[CR]\-\-dmc40=INTEGER\f[R]
For Data Matrix symbols, encode the first \f[I]INTEGER\f[R] input
characters in C40 mode.
0 means all input.
.TP
\f[CR]\-\-dmiso144\f[R]
For Data Matrix symbols, use the standard ISO/IEC codeword placement for
144 x 144 (\f[CR]\-\-vers=24\f[R]) sized symbols, instead of the default
+8
View File
@@ -113,6 +113,14 @@ Paintbrush (`PCX`), Portable Network Format (`PNG`), Scalable Vector Graphic (`S
: Send output to stdout, which in most cases should be re-directed to a pipe or a file. Use `--filetype` to specify
output format.
`--dmb256=INTEGER`
: For Data Matrix symbols, encode the first *INTEGER* input characters in Base 256 mode. 0 means all input.
`--dmc40=INTEGER`
: For Data Matrix symbols, encode the first *INTEGER* input characters in C40 mode. 0 means all input.
`--dmiso144`
: For Data Matrix symbols, use the standard ISO/IEC codeword placement for 144 x 144 (`--vers=24`) sized symbols,
+72 -29
View File
@@ -184,16 +184,18 @@ static void usage(const int no_png, const int have_gs1syntaxengine) {
" --compliantheight Warn if height not compliant, and use standard default\n"
" -d, --data=DATA Set the symbol data content (segment 0)\n", stdout);
fputs( " --direct Send output to stdout\n"
" --dmb256=INTEGER Start Data Matrix in Base 256 for given length (0 all)\n"
" --dmc40=INTERGER Start Data Matrix in C40 mode for given length (0 all)\n"
" --dmiso144 Use ISO format for 144x144 Data Matrix symbols\n"
" --dmre Allow Data Matrix Rectangular Extended\n"
" --dotsize=NUMBER Set radius of dots in dotty mode\n"
" --dotty Use dots instead of squares for matrix symbols\n", stdout);
fputs( " --dump Dump hexadecimal representation to stdout\n"
" --dmre Allow Data Matrix Rectangular Extended\n", stdout);
fputs( " --dotsize=NUMBER Set radius of dots in dotty mode\n"
" --dotty Use dots instead of squares for matrix symbols\n"
" --dump Dump hexadecimal representation to stdout\n"
" -e, --ecinos Display ECI (Extended Channel Interpretation) table\n"
" --eci=INTEGER Set the ECI code for the data (segment 0)\n"
" --embedfont Embed font in vector output (SVG only)\n"
" --esc Process escape sequences in input data\n", stdout);
fputs( " --extraesc Process symbology-specific escape sequences (Code 128)\n"
" --eci=INTEGER Set the ECI code for the data (segment 0)\n", stdout);
fputs( " --embedfont Embed font in vector output (SVG only)\n"
" --esc Process escape sequences in input data\n"
" --extraesc Process symbology-specific escape sequences (Code 128)\n"
" --fast Use faster encodation or other shortcuts if available\n"
" --fg=COLOUR Specify a foreground colour (as RGB(A) or \"C,M,Y,K\")\n", stdout);
printf(" --filetype=TYPE Set output file type BMP/EMF/EPS/GIF/PCX%s/SVG/TIF/TXT\n", no_png_type);
@@ -205,17 +207,17 @@ static void usage(const int no_png, const int have_gs1syntaxengine) {
if (have_gs1syntaxengine) {
fputs( " --gs1strict Use GS1 Syntax Engine to strictly validate GS1 data\n", stdout);
}
fputs( " --gssep Use separator GS for GS1 (Data Matrix)\n", stdout);
fputs( " --guarddescent=NUMBER Set height of guard bar descent in X-dims (EAN/UPC)\n"
fputs( " --gssep Use separator GS for GS1 (Data Matrix)\n"
" --guarddescent=NUMBER Set height of guard bar descent in X-dims (EAN/UPC)\n"
" --guardwhitespace Add quiet zone indicators (\"<\"/\">\") to HRT (EAN/UPC)\n"
" -h, --help Display help message\n"
" --height=NUMBER Set height of symbol in multiples of X-dimension\n"
" --heightperrow Treat height as per-row\n", stdout);
fputs( " -i, --input=FILE Read input data from FILE\n"
" --height=NUMBER Set height of symbol in multiples of X-dimension\n", stdout);
fputs( " --heightperrow Treat height as per-row\n"
" -i, --input=FILE Read input data from FILE\n"
" --init Create Reader Initialisation (Programming) symbol\n"
" --mask=INTEGER Set masking pattern to use (QR/Han Xin/DotCode)\n"
" --mirror Use batch data to determine filename\n"
" --mode=INTEGER Set encoding mode (MaxiCode/Composite)\n", stdout);
" --mirror Use batch data to determine filename\n", stdout);
fputs( " --mode=INTEGER Set encoding mode (MaxiCode/Composite)\n", stdout);
printf(" --nobackground Remove background (EMF/EPS/GIF%s/SVG/TIF only)\n", no_png_type);
fputs( " --noquietzones Disable default quiet zones\n"
" --notext Remove human readable text (HRT)\n", stdout);
@@ -1138,7 +1140,7 @@ static int batch_process(struct zint_symbol *const symbol, const char *const fil
}
/* Skip escape characters */
if ((buffer[i] == '\\') && (symbol->input_mode & ESCAPE_MODE)) {
if (buffer[i] == '\\' && (symbol->input_mode & ESCAPE_MODE)) {
i++;
if (buffer[i] == 'x') {
i += 2;
@@ -1183,9 +1185,9 @@ static int batch_process(struct zint_symbol *const symbol, const char *const fil
break;
}
character = (unsigned char) intChar;
} while ((!feof(file)) && (character != '\n'));
} while (!feof(file) && character != '\n');
}
} while ((!feof(file)) && (line_count < 2000000000));
} while (!feof(file) && line_count < 2000000000);
if (character != '\n') {
fprintf(stderr, "Warning 104: No newline at end of input file, last line **IGNORED**\n");
@@ -1548,7 +1550,7 @@ int main(int argc, char **argv) {
OPT_ADDONGAP = 128, OPT_AZFULL,
OPT_BATCH, OPT_BINARY, OPT_BG, OPT_BIND, OPT_BIND_TOP, OPT_BOLD, OPT_BORDER, OPT_BOX,
OPT_CMYK, OPT_COLS, OPT_COMPLIANTHEIGHT,
OPT_DIRECT, OPT_DMISO144, OPT_DMRE, OPT_DOTSIZE, OPT_DOTTY, OPT_DUMP,
OPT_DIRECT, OPT_DMISO144, OPT_DMRE, OPT_DMB256, OPT_DMC40, OPT_DOTSIZE, OPT_DOTTY, OPT_DUMP,
OPT_ECI, OPT_EMBEDFONT, OPT_ESC, OPT_EXTRAESC, OPT_FAST, OPT_FG, OPT_FILETYPE, OPT_FULLMULTIBYTE,
OPT_GS1, OPT_GS1NOCHECK, OPT_GS1PARENS, OPT_GS1RAW, OPT_GS1STRICT /*GS1SYNTAXENGINE_MODE*/,
OPT_GSSEP, OPT_GUARDDESCENT, OPT_GUARDWHITESPACE,
@@ -1581,6 +1583,8 @@ int main(int argc, char **argv) {
{"compliantheight", 0, NULL, OPT_COMPLIANTHEIGHT},
{"data", 1, NULL, 'd'},
{"direct", 0, NULL, OPT_DIRECT},
{"dmb256", 1, NULL, OPT_DMB256},
{"dmc40", 1, NULL, OPT_DMC40},
{"dmiso144", 0, NULL, OPT_DMISO144},
{"dmre", 0, NULL, OPT_DMRE},
{"dotsize", 1, NULL, OPT_DOTSIZE},
@@ -1721,7 +1725,7 @@ int main(int argc, char **argv) {
fprintf(stderr, "Error 131: Invalid columns value (digits only)\n");
return do_exit(ZINT_ERROR_INVALID_OPTION);
}
if ((val >= 1) && (val <= 200)) {
if (val >= 1 && val <= 200) {
my_symbol->option_2 = val;
} else {
fprintf(stderr, "Warning 111: Number of columns '%d' out of range (1 to 200), **IGNORED**\n",
@@ -1736,13 +1740,46 @@ int main(int argc, char **argv) {
case OPT_DIRECT:
my_symbol->output_options |= BARCODE_STDOUT;
break;
case OPT_DMB256:
if (!validate_int(optarg, -1 /*len*/, &val)) {
fprintf(stderr, "Error 158: Invalid Data Matrix Base 256 mode length value (digits only)\n");
return do_exit(ZINT_ERROR_INVALID_OPTION);
}
/* C40 overrides Base 256 */
if ((my_symbol->option_3 & DM_B256_C40_START_MASK) == DM_C40_START) {
fprintf(stderr, "Warning 159: '--dmc40' already set, '--dmb256' **IGNORED**\n");
fflush(stderr);
warn_number = ZINT_WARN_INVALID_OPTION;
} else {
my_symbol->option_1 = val;
my_symbol->option_3 = DM_B256_START | (my_symbol->option_3 & ~DM_B256_C40_START_MASK);
}
break;
case OPT_DMC40:
if (!validate_int(optarg, -1 /*len*/, &val)) {
fprintf(stderr, "Error 160: Invalid Data Matrix C40 mode length value (digits only)\n");
return do_exit(ZINT_ERROR_INVALID_OPTION);
}
/* C40 overwrites Base 256 */
if ((my_symbol->option_3 & DM_B256_C40_START_MASK) == DM_B256_START) {
fprintf(stderr, "Warning 161: previous '--dmb256' overwritten by '--dmc40'\n");
fflush(stderr);
warn_number = ZINT_WARN_INVALID_OPTION;
}
my_symbol->option_1 = val;
my_symbol->option_3 = DM_C40_START | (my_symbol->option_3 & ~DM_B256_C40_START_MASK);
break;
case OPT_DMISO144:
my_symbol->option_3 |= DM_ISO_144;
break;
case OPT_DMRE:
/* Square overwrites DMRE */
if ((my_symbol->option_3 & 0x7F) != DM_SQUARE) {
my_symbol->option_3 = DM_DMRE | (my_symbol->option_3 & ~0x7F);
/* Square overrides DMRE */
if ((my_symbol->option_3 & DM_SQUARE_DMRE_MASK) != DM_SQUARE) {
my_symbol->option_3 = DM_DMRE | (my_symbol->option_3 & ~DM_SQUARE_DMRE_MASK);
} else {
fprintf(stderr, "Warning 156: '--square' already set, '--dmre' **IGNORED**\n");
fflush(stderr);
warn_number = ZINT_WARN_INVALID_OPTION;
}
break;
case OPT_DOTSIZE:
@@ -1948,7 +1985,7 @@ int main(int argc, char **argv) {
fprintf(stderr, "Error 132: Invalid rows value (digits only)\n");
return do_exit(ZINT_ERROR_INVALID_OPTION);
}
if ((val >= 1) && (val <= 90)) {
if (val >= 1 && val <= 90) {
rows = val;
} else {
fprintf(stderr, "Warning 112: Number of rows '%d' out of range (1 to 90), **IGNORED**\n", val);
@@ -2062,7 +2099,13 @@ int main(int argc, char **argv) {
my_symbol->output_options |= SMALL_TEXT;
break;
case OPT_SQUARE:
my_symbol->option_3 = DM_SQUARE | (my_symbol->option_3 & ~0x7F);
/* Square overwrites DMRE */
if ((my_symbol->option_3 & DM_SQUARE_DMRE_MASK) == DM_DMRE) {
fprintf(stderr, "Warning 157: previous '--dmre' overwritten by '--square'\n");
fflush(stderr);
warn_number = ZINT_WARN_INVALID_OPTION;
}
my_symbol->option_3 = DM_SQUARE | (my_symbol->option_3 & ~DM_SQUARE_DMRE_MASK);
break;
case OPT_STRUCTAPP:
memset(&my_symbol->structapp, 0, sizeof(my_symbol->structapp));
@@ -2101,7 +2144,7 @@ int main(int argc, char **argv) {
fprintf(stderr, "Error 133: Invalid version value (digits only)\n");
return do_exit(ZINT_ERROR_INVALID_OPTION);
}
if ((val >= 1) && (val <= 999)) {
if (val >= 1 && val <= 999) {
my_symbol->option_2 = val;
} else {
fprintf(stderr, "Warning 113: Version value '%d' out of range (1 to 999), **IGNORED**\n", val);
@@ -2411,9 +2454,9 @@ int main(int argc, char **argv) {
if (error_number < ZINT_ERROR) {
error_number = ret;
}
if (error_number >= ZINT_ERROR) {
break;
}
}
if (error_number >= ZINT_ERROR) {
break;
}
}
if (error_number < ZINT_ERROR) {
+52 -44
View File
@@ -295,6 +295,8 @@ static void test_dump_args(const testCtx *const p_ctx) {
int output_options;
int batch;
int cols;
int dmb256;
int dmc40;
int dmre;
int eci;
int fullmultibyte;
@@ -310,50 +312,54 @@ static void test_dump_args(const testCtx *const p_ctx) {
};
/* s/\/\*[ 0-9]*\*\//\=printf("\/\*%3d*\/", line(".") - line("'<")): */
struct item data[] = {
/* 0*/ { -1, "123", NULL, NULL, NULL, -1, -1, 0, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "D3 96 72 F7 65 C9 61 8E B" },
/* 1*/ { BARCODE_CODE128, "123", NULL, NULL, NULL, -1, -1, 0, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "D3 96 72 F7 65 C9 61 8E B" },
/* 2*/ { BARCODE_CODE128, "123", "456", NULL, NULL, -1, -1, 0, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "D3 96 72 F7 65 C9 61 8E B\nD3 97 62 F7 67 49 19 8E B" },
/* 3*/ { BARCODE_CODE128, "123", NULL, NULL, NULL, -1, -1, 1, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "Warning 141: Can't use batch mode if data given, **IGNORED**\nD3 96 72 F7 65 C9 61 8E B" },
/* 4*/ { BARCODE_CODE128, NULL, NULL, "123\n45\n", NULL, -1, -1, 1, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "D3 96 72 F7 65 C9 61 8E B\nD3 97 62 3B 63 AC" },
/* 5*/ { BARCODE_CODE128, NULL, NULL, "123\n45\n", "7\n",-1, -1, 1, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "Warning 144: First input file 'test_dump_args1.txt' only processed, subsequent input files **IGNORED**\nD3 96 72 F7 65 C9 61 8E B\nD3 97 62 3B 63 AC" },
/* 6*/ { BARCODE_CODE128, "\t", NULL, NULL, NULL, -1, -1, 0, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "D0 90 D2 1A 63 AC" },
/* 7*/ { BARCODE_CODE128, "\\t", NULL, NULL, NULL, ESCAPE_MODE, -1, 0, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "D0 90 D2 1A 63 AC" },
/* 8*/ { BARCODE_CODE128, "\\^Ab\011", NULL, NULL, NULL, EXTRA_ESCAPE_MODE, -1, 0, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "D0 9E 8A 43 43 48 D1 8E B" },
/* 9*/ { BARCODE_CODE128, "\\^Ab\\t", NULL, NULL, NULL, ESCAPE_MODE | EXTRA_ESCAPE_MODE, -1, 0, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "D0 9E 8A 43 43 48 D1 8E B" },
/* 10*/ { BARCODE_CODE128, "123", NULL, NULL, NULL, -1, BARCODE_BIND | BARCODE_BOX | BARCODE_BIND_TOP | SMALL_TEXT | BOLD_TEXT | CMYK_COLOUR, 0, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "D3 96 72 F7 65 C9 61 8E B" },
/* 11*/ { BARCODE_CODE128, "123", NULL, NULL, NULL, -1, BARCODE_DOTTY_MODE, 0, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "Error 224: Selected symbology cannot be rendered as dots" },
/* 12*/ { BARCODE_CODABLOCKF, "ABCDEF", NULL, NULL, NULL, -1, -1, 0, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "D0 97 BA 86 51 88 B1 11 AC 46 D8 C7 58\nD0 97 BB 12 46 88 C5 1A 3C 55 CC C7 58" },
/* 13*/ { BARCODE_CODABLOCKF, "ABCDEF", NULL, NULL, NULL, -1, -1, 0, 10, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "D0 97 BA 86 51 88 B1 11 AC 44 68 BC 98 EB\nD0 97 BB 12 46 2B BD 7B A3 47 8A 8D 18 EB" },
/* 14*/ { BARCODE_CODABLOCKF, "ABCDEF", NULL, NULL, NULL, -1, -1, 0, -1, 0, -1, 0, -1, -1, NULL, 3, -1, 0, -1, "D0 97 BA 58 51 88 B1 11 AC 46 36 C7 58\nD0 97 BB 12 46 88 C5 77 AF 74 62 C7 58\nD0 97 BA CE 5D EB DD 1A 3C 56 88 C7 58" },
/* 15*/ { BARCODE_CODE11, NULL, NULL, "123", NULL, -1, -1, 0, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "B2 D6 96 CA B5 6D 64" },
/* 16*/ { BARCODE_CODE11, NULL, NULL, "123", NULL, -1, -1, 0, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, 1, "B2 D6 96 CA B5 64" },
/* 17*/ { BARCODE_CODE11, "123", NULL, "456", NULL, -1, -1, 0, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, 2, "B2 D6 96 CA B2\nB2 B6 DA 9A B2" },
/* 18*/ { BARCODE_CODE11, "123", "456", "789", "012", -1, -1, 0, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, 2, "B2 D6 96 CA B2\nB2 B6 DA 9A B2\nB2 A6 D2 D5 64\nB2 AD AD 2D 64" },
/* 19*/ { BARCODE_PDF417, "123", NULL, NULL, NULL, -1, -1, 0, -1, 0, -1, 0, -1, -1, NULL, -1, 0, 0, -1, "FF 54 7A BC 3A 9C 1D 5C 0F E8 A4\nFF 54 7E AE 3C 11 5F AB 8F E8 A4\nFF 54 6A F8 29 9F 1D 5F 8F E8 A4\nFF 54 57 9E 37 BA 1A F7 CF E8 A4\nFF 54 75 CC 36 F0 5D 73 0F E8 A4" },
/* 20*/ { BARCODE_DATAMATRIX, "ABC", NULL, NULL, NULL, -1, -1, 0, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "AA 8\nB3 4\n8F 0\nB2 C\nA6 0\nBA C\nD6 0\nEB 4\nE2 8\nFF C" },
/* 21*/ { BARCODE_DATAMATRIX, "ABC", NULL, NULL, NULL, -1, READER_INIT, 0, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "AA A\nAC 7\n8A 4\nA0 3\nC2 2\nB5 1\n82 2\nBA 7\n8C C\nA0 5\n86 A\nFF F" },
/* 22*/ { BARCODE_DATAMATRIX, "ABCDEFGH", NULL, NULL, NULL, FAST_MODE, -1, 0, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "AA A8\nA6 8C\nB2 F0\n98 B4\nB9 A8\nB8 CC\nF0 78\nA0 3C\n99 70\n85 1C\nDA B0\nE5 94\nA7 50\nFF FC" },
/* 23*/ { BARCODE_DATAMATRIX, "ABCDEFGH", NULL, NULL, NULL, -1, -1, 0, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "AA A8\n80 04\n82 60\nC5 24\n98 A8\nA3 9C\nCB B8\nAF DC\n86 58\nF6 44\nAC 18\n90 54\nCF 30\nFF FC" },
/* 24*/ { BARCODE_DATAMATRIX, "ABCDEFGHIJK", NULL, NULL, NULL, -1, -1, 0, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "AA AA AA AA\n80 09 F9 BD\n82 4A E2 58\nC5 CD C9 A5\nD8 5C A5 FC\nE0 35 88 69\nCC FC B3 E6\nFF FF FF FF" },
/* 25*/ { BARCODE_DATAMATRIX, "ABCDEFGHIJK", NULL, NULL, NULL, -1, -1, 0, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 1, -1, "AA AA\n80 25\n82 24\nC5 5D\n98 90\nA4 C7\nC8 A6\nB9 E9\n8E 02\nDE 91\nCD 6C\nA0 BB\n85 80\n98 2D\nE4 CA\nFF FF" },
/* 26*/ { BARCODE_DATAMATRIX, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEF", NULL, NULL, NULL, -1, -1, 0, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "AA AA A8\nBA 5A 44\n8B 4D 28\nBF 77 64\n97 85 50\nBA D8 AC\nCD ED B8\nD4 B5 2C\nD1 A8 00\n81 FB 2C\nE4 75 78\n96 E8 2C\nF3 75 78\nEE 1D 04\nCA BA 98\nB1 8F B4\nA0 4F 00\nE4 A7 74\nF1 D3 90\nEF E1 BC\n91 10 38\nFF FF FC" },
/* 27*/ { BARCODE_DATAMATRIX, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEF", NULL, NULL, NULL, -1, -1, 0, -1, 1, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "AA AA AA AA AA AA AA AA\nBA 03 BA 7D E5 31 B0 0D\n8B 6A 93 B6 E0 0A B8 3C\nBF 1D EA A7 EB ED A1 FB\n96 66 86 B6 C9 AE 92 40\nBF 65 E7 95 BC B7 FA E3\nCC 7C 90 CC D1 24 AB 5A\nFF FF FF FF FF FF FF FF" },
/* 28*/ { BARCODE_DATAMATRIX, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEF", NULL, NULL, NULL, -1, -1, 0, -1, 1, -1, 0, -1, -1, NULL, -1, -1, 1, -1, "AA AA A8\nBA 5A 44\n8B 4D 28\nBF 77 64\n97 85 50\nBA D8 AC\nCD ED B8\nD4 B5 2C\nD1 A8 00\n81 FB 2C\nE4 75 78\n96 E8 2C\nF3 75 78\nEE 1D 04\nCA BA 98\nB1 8F B4\nA0 4F 00\nE4 A7 74\nF1 D3 90\nEF E1 BC\n91 10 38\nFF FF FC" },
/* 29*/ { BARCODE_DATAMATRIX, "[91]12[92]34", NULL, NULL, NULL, GS1_MODE, -1, 0, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "AA A8\nFA 9C\nBC 00\nD7 84\nED E0\nA4 E4\nA7 40\n9D 3C\nBF 50\nFA 24\nB1 68\nE5 04\n92 70\nFF FC" },
/* 30*/ { BARCODE_DATAMATRIX, "[91]12[92]34", NULL, NULL, NULL, GS1_MODE, GS1_GS_SEPARATOR, 0, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "AA A8\nF9 DC\nBF 20\nD6 C4\nED 10\nA0 0C\nA7 C0\n96 5C\nBA 70\nBB A4\nE2 18\nDD 14\n9C 40\nFF FC" },
/* 31*/ { BARCODE_DATAMATRIX, "[9\\x31]12[92]34", NULL, NULL, NULL, GS1_MODE | ESCAPE_MODE, GS1_GS_SEPARATOR, 0, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "AA A8\nF9 DC\nBF 20\nD6 C4\nED 10\nA0 0C\nA7 C0\n96 5C\nBA 70\nBB A4\nE2 18\nDD 14\n9C 40\nFF FC" },
/* 32*/ { BARCODE_DATAMATRIX, "(9\\x31)12(92)34", NULL, NULL, NULL, GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, GS1_GS_SEPARATOR, 0, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "AA A8\nF9 DC\nBF 20\nD6 C4\nED 10\nA0 0C\nA7 C0\n96 5C\nBA 70\nBB A4\nE2 18\nDD 14\n9C 40\nFF FC" },
/* 33*/ { BARCODE_EANX_CC, "[91]12", NULL, NULL, NULL, -1, -1, 0, -1, 0, -1, 0, -1, -1, "12345678+12", -1, -1, 0, -1, "DB BC D3 9C 44 E9 D2 2C 19 E7 A2 D8 A0 00 00 00\nDB 31 1C 9C C7 29 92 47 D9 E9 40 C8 A0 00 00 00\nDA 3B EB 10 AF 09 9A 18 9D 7D 82 E8 A0 00 00 00\n10 00 00 00 00 00 00 00 00 00 00 00 40 00 00 00\n20 00 00 00 00 00 00 00 00 00 00 00 20 00 00 00\n10 00 00 00 00 00 00 00 00 00 00 00 40 00 00 00\n14 68 D1 A6 49 BD 55 C9 D4 22 48 B9 40 59 94 98" },
/* 34*/ { BARCODE_EANX_CC, "[91]12", NULL, NULL, NULL, -1, -1, 0, -1, 0, -1, 0, -1, 2, "12345678+12", -1, -1, 0, -1, "D3 A3 E9 DB F5 C9 DB 43 D9 CB 98 D2 20 00 00 00\nD3 25 0F 11 E4 49 D3 51 F1 AC FC D6 20 00 00 00\nD1 33 48 19 39 E9 93 18 49 D8 98 D7 20 00 00 00\nD1 A6 FC DA 1C 49 9B C5 05 E2 84 D7 A0 00 00 00\n10 00 00 00 00 00 00 00 00 00 00 00 40 00 00 00\n20 00 00 00 00 00 00 00 00 00 00 00 20 00 00 00\n10 00 00 00 00 00 00 00 00 00 00 00 40 00 00 00\n14 68 D1 A6 49 BD 55 C9 D4 22 48 B9 40 59 94 98" },
/* 35*/ { BARCODE_QRCODE, "", NULL, NULL, NULL, -1, -1, 0, -1, 0, -1, 0, -1, -1, NULL, -1, 1, 0, -1, "Warning 760: Converted to Shift JIS but no ECI specified\nFE 2B F8\n82 AA 08\nBA B2 E8\nBA 0A E8\nBA FA E8\n82 E2 08\nFE AB F8\n00 80 00\nD3 3B B0\n60 95 68\n7A B3 A0\n1D 0F 98\nAA D7 30\n00 E6 A8\nFE DA D0\n82 42 20\nBA 0E 38\nBA C7 18\nBA 17 68\n82 B9 40\nFE C5 28" },
/* 36*/ { BARCODE_QRCODE, "", NULL, NULL, NULL, -1, -1, 0, -1, 0, 26, 0, -1, -1, NULL, -1, 1, 0, -1, "FE 5B F8\n82 72 08\nBA DA E8\nBA 52 E8\nBA 2A E8\n82 0A 08\nFE AB F8\n00 D8 00\nEF F6 20\nB5 C2 28\n36 28 88\nFD 42 10\n62 2A C8\n00 95 70\nFE B7 38\n82 FD D8\nBA 97 00\nBA 43 60\nBA C8 C8\n82 C3 68\nFE EA F8" },
/* 37*/ { BARCODE_QRCODE, "\223\137", NULL, NULL, NULL, DATA_MODE, -1, 0, -1, 0, -1, 0, -1, -1, NULL, -1, 1, 0, -1, "FE 2B F8\n82 0A 08\nBA A2 E8\nBA 0A E8\nBA 5A E8\n82 72 08\nFE AB F8\n00 A0 00\nEF AE 20\n75 B5 20\n82 F7 58\nF4 9D C8\n5E 17 28\n00 C2 20\nFE 88 80\n82 82 38\nBA EA A8\nBA 55 50\nBA D7 68\n82 BD D0\nFE B7 78" },
/* 38*/ { BARCODE_QRCODE, "\223\137", NULL, NULL, NULL, DATA_MODE, -1, 0, -1, 0, -1, 1, -1, -1, NULL, -1, 1, 0, -1, "FE 2B F8\n82 AA 08\nBA B2 E8\nBA 0A E8\nBA FA E8\n82 E2 08\nFE AB F8\n00 80 00\nD3 3B B0\n60 95 68\n7A B3 A0\n1D 0F 98\nAA D7 30\n00 E6 A8\nFE DA D0\n82 42 20\nBA 0E 38\nBA C7 18\nBA 17 68\n82 B9 40\nFE C5 28" },
/* 39*/ { BARCODE_QRCODE, "\\x93\\x5F", NULL, NULL, NULL, DATA_MODE | ESCAPE_MODE, -1, 0, -1, 0, -1, 1, -1, -1, NULL, -1, 1, 0, -1, "FE 2B F8\n82 AA 08\nBA B2 E8\nBA 0A E8\nBA FA E8\n82 E2 08\nFE AB F8\n00 80 00\nD3 3B B0\n60 95 68\n7A B3 A0\n1D 0F 98\nAA D7 30\n00 E6 A8\nFE DA D0\n82 42 20\nBA 0E 38\nBA C7 18\nBA 17 68\n82 B9 40\nFE C5 28" },
/* 40*/ { BARCODE_QRCODE, "", NULL, NULL, NULL, -1, -1, 0, -1, 0, -1, 0, 2, -1, NULL, -1, 1, 0, -1, "Warning 760: Converted to Shift JIS but no ECI specified\nFE 4B F8\n82 92 08\nBA 42 E8\nBA 92 E8\nBA 3A E8\n82 EA 08\nFE AB F8\n00 38 00\nFB CD 50\nA5 89 18\n0B 74 B8\nFC 81 A0\n92 34 B8\n00 DE 48\nFE AB 10\n82 5E 50\nBA C9 20\nBA C9 20\nBA F4 E0\n82 81 A0\nFE B4 E8" },
/* 41*/ { BARCODE_HANXIN, "é", NULL, NULL, NULL, DATA_MODE, -1, 0, -1, 0, -1, 1, -1, -1, NULL, -1, -1, 0, -1, "FE 8A FE\n80 28 02\nBE E8 FA\nA0 94 0A\nAE 3E EA\nAE D2 EA\nAE 74 EA\n00 AA 00\n15 B4 80\n0B 48 74\nA2 4A A4\nB5 56 2C\nA8 5A A8\n9F 18 50\n02 07 50\n00 A6 00\nFE 20 EA\n02 C2 EA\nFA C4 EA\n0A 42 0A\nEA 52 FA\nEA 24 02\nEA AA FE" },
/* 42*/ { BARCODE_HANXIN, "é", NULL, NULL, NULL, DATA_MODE, -1, 0, -1, 0, -1, 1, 3, -1, NULL, -1, -1, 0, -1, "FE 16 FE\n80 E2 02\nBE C2 FA\nA0 A0 0A\nAE F6 EA\nAE 98 EA\nAE BA EA\n00 E0 00\n15 83 80\n44 7E AE\n92 9C 78\n25 BF 08\n47 4B 8C\n0D F9 74\n03 E7 50\n00 3A 00\nFE C2 EA\n02 22 EA\nFA DA EA\n0A 22 0A\nEA B2 FA\nEA 9A 02\nEA E8 FE" },
/* 43*/ { BARCODE_HANXIN, "é", NULL, NULL, NULL, DATA_MODE, -1, 0, -1, 0, -1, 1, 4, -1, NULL, -1, -1, 0, -1, "FE 8A FE\n80 28 02\nBE E8 FA\nA0 94 0A\nAE 3E EA\nAE D2 EA\nAE 74 EA\n00 AA 00\n15 B4 80\n0B 48 74\nA2 4A A4\nB5 56 2C\nA8 5A A8\n9F 18 50\n02 07 50\n00 A6 00\nFE 20 EA\n02 C2 EA\nFA C4 EA\n0A 42 0A\nEA 52 FA\nEA 24 02\nEA AA FE" },
/* 0*/ { -1, "123", NULL, NULL, NULL, -1, -1, 0, -1, -1, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "D3 96 72 F7 65 C9 61 8E B" },
/* 1*/ { BARCODE_CODE128, "123", NULL, NULL, NULL, -1, -1, 0, -1, -1, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "D3 96 72 F7 65 C9 61 8E B" },
/* 2*/ { BARCODE_CODE128, "123", "456", NULL, NULL, -1, -1, 0, -1, -1, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "D3 96 72 F7 65 C9 61 8E B\nD3 97 62 F7 67 49 19 8E B" },
/* 3*/ { BARCODE_CODE128, "123", NULL, NULL, NULL, -1, -1, 1, -1, -1, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "Warning 141: Can't use batch mode if data given, **IGNORED**\nD3 96 72 F7 65 C9 61 8E B" },
/* 4*/ { BARCODE_CODE128, NULL, NULL, "123\n45\n", NULL, -1, -1, 1, -1, -1, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "D3 96 72 F7 65 C9 61 8E B\nD3 97 62 3B 63 AC" },
/* 5*/ { BARCODE_CODE128, NULL, NULL, "123\n45\n", "7\n", -1, -1, 1, -1, -1, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "Warning 144: First input file 'test_dump_args1.txt' only processed, subsequent input files **IGNORED**\nD3 96 72 F7 65 C9 61 8E B\nD3 97 62 3B 63 AC" },
/* 6*/ { BARCODE_CODE128, "\t", NULL, NULL, NULL, -1, -1, 0, -1, -1, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "D0 90 D2 1A 63 AC" },
/* 7*/ { BARCODE_CODE128, "\\t", NULL, NULL, NULL, ESCAPE_MODE, -1, 0, -1, -1, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "D0 90 D2 1A 63 AC" },
/* 8*/ { BARCODE_CODE128, "\\^Ab\011", NULL, NULL, NULL, EXTRA_ESCAPE_MODE, -1, 0, -1, -1, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "D0 9E 8A 43 43 48 D1 8E B" },
/* 9*/ { BARCODE_CODE128, "\\^Ab\\t", NULL, NULL, NULL, ESCAPE_MODE | EXTRA_ESCAPE_MODE, -1, 0, -1, -1, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "D0 9E 8A 43 43 48 D1 8E B" },
/* 10*/ { BARCODE_CODE128, "123", NULL, NULL, NULL, -1, BARCODE_BIND | BARCODE_BOX | BARCODE_BIND_TOP | SMALL_TEXT | BOLD_TEXT | CMYK_COLOUR, 0, -1, -1, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "D3 96 72 F7 65 C9 61 8E B" },
/* 11*/ { BARCODE_CODE128, "123", NULL, NULL, NULL, -1, BARCODE_DOTTY_MODE, 0, -1, -1, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "Error 224: Selected symbology cannot be rendered as dots" },
/* 12*/ { BARCODE_CODABLOCKF, "ABCDEF", NULL, NULL, NULL, -1, -1, 0, -1, -1, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "D0 97 BA 86 51 88 B1 11 AC 46 D8 C7 58\nD0 97 BB 12 46 88 C5 1A 3C 55 CC C7 58" },
/* 13*/ { BARCODE_CODABLOCKF, "ABCDEF", NULL, NULL, NULL, -1, -1, 0, 10, -1, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "D0 97 BA 86 51 88 B1 11 AC 44 68 BC 98 EB\nD0 97 BB 12 46 2B BD 7B A3 47 8A 8D 18 EB" },
/* 14*/ { BARCODE_CODABLOCKF, "ABCDEF", NULL, NULL, NULL, -1, -1, 0, -1, -1, -1, 0, -1, 0, -1, -1, NULL, 3, -1, 0, -1, "D0 97 BA 58 51 88 B1 11 AC 46 36 C7 58\nD0 97 BB 12 46 88 C5 77 AF 74 62 C7 58\nD0 97 BA CE 5D EB DD 1A 3C 56 88 C7 58" },
/* 15*/ { BARCODE_CODE11, NULL, NULL, "123", NULL, -1, -1, 0, -1, -1, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "B2 D6 96 CA B5 6D 64" },
/* 16*/ { BARCODE_CODE11, NULL, NULL, "123", NULL, -1, -1, 0, -1, -1, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, 1, "B2 D6 96 CA B5 64" },
/* 17*/ { BARCODE_CODE11, "123", NULL, "456", NULL, -1, -1, 0, -1, -1, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, 2, "B2 D6 96 CA B2\nB2 B6 DA 9A B2" },
/* 18*/ { BARCODE_CODE11, "123", "456", "789", "012", -1, -1, 0, -1, -1, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, 2, "B2 D6 96 CA B2\nB2 B6 DA 9A B2\nB2 A6 D2 D5 64\nB2 AD AD 2D 64" },
/* 19*/ { BARCODE_PDF417, "123", NULL, NULL, NULL, -1, -1, 0, -1, -1, -1, 0, -1, 0, -1, -1, NULL, -1, 0, 0, -1, "FF 54 7A BC 3A 9C 1D 5C 0F E8 A4\nFF 54 7E AE 3C 11 5F AB 8F E8 A4\nFF 54 6A F8 29 9F 1D 5F 8F E8 A4\nFF 54 57 9E 37 BA 1A F7 CF E8 A4\nFF 54 75 CC 36 F0 5D 73 0F E8 A4" },
/* 20*/ { BARCODE_DATAMATRIX, "ABC", NULL, NULL, NULL, -1, -1, 0, -1, -1, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "AA 8\nB3 4\n8F 0\nB2 C\nA6 0\nBA C\nD6 0\nEB 4\nE2 8\nFF C" },
/* 21*/ { BARCODE_DATAMATRIX, "ABC", NULL, NULL, NULL, -1, READER_INIT, 0, -1, -1, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "AA A\nAC 7\n8A 4\nA0 3\nC2 2\nB5 1\n82 2\nBA 7\n8C C\nA0 5\n86 A\nFF F" },
/* 22*/ { BARCODE_DATAMATRIX, "ABCDEFGH", NULL, NULL, NULL, FAST_MODE, -1, 0, -1, -1, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "AA A8\nA6 8C\nB2 F0\n98 B4\nB9 A8\nB8 CC\nF0 78\nA0 3C\n99 70\n85 1C\nDA B0\nE5 94\nA7 50\nFF FC" },
/* 23*/ { BARCODE_DATAMATRIX, "ABCDEFGH", NULL, NULL, NULL, -1, -1, 0, -1, -1, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "AA A8\n80 04\n82 60\nC5 24\n98 A8\nA3 9C\nCB B8\nAF DC\n86 58\nF6 44\nAC 18\n90 54\nCF 30\nFF FC" },
/* 24*/ { BARCODE_DATAMATRIX, "ABCDEFGHIJK", NULL, NULL, NULL, -1, -1, 0, -1, -1, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "AA AA AA AA\n80 09 F9 BD\n82 4A E2 58\nC5 CD C9 A5\nD8 5C A5 FC\nE0 35 88 69\nCC FC B3 E6\nFF FF FF FF" },
/* 25*/ { BARCODE_DATAMATRIX, "ABCDEFGHIJK", NULL, NULL, NULL, -1, -1, 0, -1, -1, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 1, -1, "AA AA\n80 25\n82 24\nC5 5D\n98 90\nA4 C7\nC8 A6\nB9 E9\n8E 02\nDE 91\nCD 6C\nA0 BB\n85 80\n98 2D\nE4 CA\nFF FF" },
/* 26*/ { BARCODE_DATAMATRIX, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEF", NULL, NULL, NULL, -1, -1, 0, -1, -1, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "AA AA A8\nBA 5A 44\n8B 4D 28\nBF 77 64\n97 85 50\nBA D8 AC\nCD ED B8\nD4 B5 2C\nD1 A8 00\n81 FB 2C\nE4 75 78\n96 E8 2C\nF3 75 78\nEE 1D 04\nCA BA 98\nB1 8F B4\nA0 4F 00\nE4 A7 74\nF1 D3 90\nEF E1 BC\n91 10 38\nFF FF FC" },
/* 27*/ { BARCODE_DATAMATRIX, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEF", NULL, NULL, NULL, -1, -1, 0, -1, -1, -1, 1, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "AA AA AA AA AA AA AA AA\nBA 03 BA 7D E5 31 B0 0D\n8B 6A 93 B6 E0 0A B8 3C\nBF 1D EA A7 EB ED A1 FB\n96 66 86 B6 C9 AE 92 40\nBF 65 E7 95 BC B7 FA E3\nCC 7C 90 CC D1 24 AB 5A\nFF FF FF FF FF FF FF FF" },
/* 28*/ { BARCODE_DATAMATRIX, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEF", NULL, NULL, NULL, -1, -1, 0, -1, -1, -1, 1, -1, 0, -1, -1, NULL, -1, -1, 1, -1, "Warning 157: previous '--dmre' overwritten by '--square'\nAA AA A8\nBA 5A 44\n8B 4D 28\nBF 77 64\n97 85 50\nBA D8 AC\nCD ED B8\nD4 B5 2C\nD1 A8 00\n81 FB 2C\nE4 75 78\n96 E8 2C\nF3 75 78\nEE 1D 04\nCA BA 98\nB1 8F B4\nA0 4F 00\nE4 A7 74\nF1 D3 90\nEF E1 BC\n91 10 38\nFF FF FC" },
/* 29*/ { BARCODE_DATAMATRIX, "[91]12[92]34", NULL, NULL, NULL, GS1_MODE, -1, 0, -1, -1, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "AA A8\nFA 9C\nBC 00\nD7 84\nED E0\nA4 E4\nA7 40\n9D 3C\nBF 50\nFA 24\nB1 68\nE5 04\n92 70\nFF FC" },
/* 30*/ { BARCODE_DATAMATRIX, "[91]12[92]34", NULL, NULL, NULL, GS1_MODE, GS1_GS_SEPARATOR, 0, -1, -1, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "AA A8\nF9 DC\nBF 20\nD6 C4\nED 10\nA0 0C\nA7 C0\n96 5C\nBA 70\nBB A4\nE2 18\nDD 14\n9C 40\nFF FC" },
/* 31*/ { BARCODE_DATAMATRIX, "[9\\x31]12[92]34", NULL, NULL, NULL, GS1_MODE | ESCAPE_MODE, GS1_GS_SEPARATOR, 0, -1, -1, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "AA A8\nF9 DC\nBF 20\nD6 C4\nED 10\nA0 0C\nA7 C0\n96 5C\nBA 70\nBB A4\nE2 18\nDD 14\n9C 40\nFF FC" },
/* 32*/ { BARCODE_DATAMATRIX, "(9\\x31)12(92)34", NULL, NULL, NULL, GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, GS1_GS_SEPARATOR, 0, -1, -1, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "AA A8\nF9 DC\nBF 20\nD6 C4\nED 10\nA0 0C\nA7 C0\n96 5C\nBA 70\nBB A4\nE2 18\nDD 14\n9C 40\nFF FC" },
/* 33*/ { BARCODE_DATAMATRIX, "abc", NULL, NULL, NULL, -1, -1, 0, -1, -1, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "AA 8\nB3 C\nC6 0\nBA C\nBD 0\nB4 C\nDC 0\nEB C\nD1 8\nFF C" },
/* 34*/ { BARCODE_DATAMATRIX, "abc", NULL, NULL, NULL, -1, -1, 0, -1, 0, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "AA A\n8B F\nD4 C\nC2 7\n9E C\nCF 3\n8E 8\nBB F\n86 2\n95 D\nCB A\nFF F" },
/* 35*/ { BARCODE_DATAMATRIX, "abc", NULL, NULL, NULL, -1, -1, 0, -1, -1, 1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "AA A\n8C F\n9E 4\nC5 7\nA9 6\n9F F\n97 0\nFA 9\nAA C\nDD D\nD2 2\nFF F" },
/* 36*/ { BARCODE_DATAMATRIX, "abc", NULL, NULL, NULL, -1, -1, 0, -1, 0, 1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "Warning 161: previous '--dmb256' overwritten by '--dmc40'\nAA A\n8C F\n9E 4\nC5 7\nA9 6\n9F F\n97 0\nFA 9\nAA C\nDD D\nD2 2\nFF F" },
/* 37*/ { BARCODE_EANX_CC, "[91]12", NULL, NULL, NULL, -1, -1, 0, -1, -1, -1, 0, -1, 0, -1, -1, "12345678+12", -1, -1, 0, -1, "DB BC D3 9C 44 E9 D2 2C 19 E7 A2 D8 A0 00 00 00\nDB 31 1C 9C C7 29 92 47 D9 E9 40 C8 A0 00 00 00\nDA 3B EB 10 AF 09 9A 18 9D 7D 82 E8 A0 00 00 00\n10 00 00 00 00 00 00 00 00 00 00 00 40 00 00 00\n20 00 00 00 00 00 00 00 00 00 00 00 20 00 00 00\n10 00 00 00 00 00 00 00 00 00 00 00 40 00 00 00\n14 68 D1 A6 49 BD 55 C9 D4 22 48 B9 40 59 94 98" },
/* 38*/ { BARCODE_EANX_CC, "[91]12", NULL, NULL, NULL, -1, -1, 0, -1, -1, -1, 0, -1, 0, -1, 2, "12345678+12", -1, -1, 0, -1, "D3 A3 E9 DB F5 C9 DB 43 D9 CB 98 D2 20 00 00 00\nD3 25 0F 11 E4 49 D3 51 F1 AC FC D6 20 00 00 00\nD1 33 48 19 39 E9 93 18 49 D8 98 D7 20 00 00 00\nD1 A6 FC DA 1C 49 9B C5 05 E2 84 D7 A0 00 00 00\n10 00 00 00 00 00 00 00 00 00 00 00 40 00 00 00\n20 00 00 00 00 00 00 00 00 00 00 00 20 00 00 00\n10 00 00 00 00 00 00 00 00 00 00 00 40 00 00 00\n14 68 D1 A6 49 BD 55 C9 D4 22 48 B9 40 59 94 98" },
/* 39*/ { BARCODE_QRCODE, "", NULL, NULL, NULL, -1, -1, 0, -1, -1, -1, 0, -1, 0, -1, -1, NULL, -1, 1, 0, -1, "Warning 760: Converted to Shift JIS but no ECI specified\nFE 2B F8\n82 AA 08\nBA B2 E8\nBA 0A E8\nBA FA E8\n82 E2 08\nFE AB F8\n00 80 00\nD3 3B B0\n60 95 68\n7A B3 A0\n1D 0F 98\nAA D7 30\n00 E6 A8\nFE DA D0\n82 42 20\nBA 0E 38\nBA C7 18\nBA 17 68\n82 B9 40\nFE C5 28" },
/* 40*/ { BARCODE_QRCODE, "", NULL, NULL, NULL, -1, -1, 0, -1, -1, -1, 0, 26, 0, -1, -1, NULL, -1, 1, 0, -1, "FE 5B F8\n82 72 08\nBA DA E8\nBA 52 E8\nBA 2A E8\n82 0A 08\nFE AB F8\n00 D8 00\nEF F6 20\nB5 C2 28\n36 28 88\nFD 42 10\n62 2A C8\n00 95 70\nFE B7 38\n82 FD D8\nBA 97 00\nBA 43 60\nBA C8 C8\n82 C3 68\nFE EA F8" },
/* 41*/ { BARCODE_QRCODE, "\223\137", NULL, NULL, NULL, DATA_MODE, -1, 0, -1, -1, -1, 0, -1, 0, -1, -1, NULL, -1, 1, 0, -1, "FE 2B F8\n82 0A 08\nBA A2 E8\nBA 0A E8\nBA 5A E8\n82 72 08\nFE AB F8\n00 A0 00\nEF AE 20\n75 B5 20\n82 F7 58\nF4 9D C8\n5E 17 28\n00 C2 20\nFE 88 80\n82 82 38\nBA EA A8\nBA 55 50\nBA D7 68\n82 BD D0\nFE B7 78" },
/* 42*/ { BARCODE_QRCODE, "\223\137", NULL, NULL, NULL, DATA_MODE, -1, 0, -1, -1, -1, 0, -1, 1, -1, -1, NULL, -1, 1, 0, -1, "FE 2B F8\n82 AA 08\nBA B2 E8\nBA 0A E8\nBA FA E8\n82 E2 08\nFE AB F8\n00 80 00\nD3 3B B0\n60 95 68\n7A B3 A0\n1D 0F 98\nAA D7 30\n00 E6 A8\nFE DA D0\n82 42 20\nBA 0E 38\nBA C7 18\nBA 17 68\n82 B9 40\nFE C5 28" },
/* 43*/ { BARCODE_QRCODE, "\\x93\\x5F", NULL, NULL, NULL, DATA_MODE | ESCAPE_MODE, -1, 0, -1, -1, -1, 0, -1, 1, -1, -1, NULL, -1, 1, 0, -1, "FE 2B F8\n82 AA 08\nBA B2 E8\nBA 0A E8\nBA FA E8\n82 E2 08\nFE AB F8\n00 80 00\nD3 3B B0\n60 95 68\n7A B3 A0\n1D 0F 98\nAA D7 30\n00 E6 A8\nFE DA D0\n82 42 20\nBA 0E 38\nBA C7 18\nBA 17 68\n82 B9 40\nFE C5 28" },
/* 44*/ { BARCODE_QRCODE, "", NULL, NULL, NULL, -1, -1, 0, -1, -1, -1, 0, -1, 0, 2, -1, NULL, -1, 1, 0, -1, "Warning 760: Converted to Shift JIS but no ECI specified\nFE 4B F8\n82 92 08\nBA 42 E8\nBA 92 E8\nBA 3A E8\n82 EA 08\nFE AB F8\n00 38 00\nFB CD 50\nA5 89 18\n0B 74 B8\nFC 81 A0\n92 34 B8\n00 DE 48\nFE AB 10\n82 5E 50\nBA C9 20\nBA C9 20\nBA F4 E0\n82 81 A0\nFE B4 E8" },
/* 45*/ { BARCODE_HANXIN, "é", NULL, NULL, NULL, DATA_MODE, -1, 0, -1, -1, -1, 0, -1, 1, -1, -1, NULL, -1, -1, 0, -1, "FE 8A FE\n80 28 02\nBE E8 FA\nA0 94 0A\nAE 3E EA\nAE D2 EA\nAE 74 EA\n00 AA 00\n15 B4 80\n0B 48 74\nA2 4A A4\nB5 56 2C\nA8 5A A8\n9F 18 50\n02 07 50\n00 A6 00\nFE 20 EA\n02 C2 EA\nFA C4 EA\n0A 42 0A\nEA 52 FA\nEA 24 02\nEA AA FE" },
/* 46*/ { BARCODE_HANXIN, "é", NULL, NULL, NULL, DATA_MODE, -1, 0, -1, -1, -1, 0, -1, 1, 3, -1, NULL, -1, -1, 0, -1, "FE 16 FE\n80 E2 02\nBE C2 FA\nA0 A0 0A\nAE F6 EA\nAE 98 EA\nAE BA EA\n00 E0 00\n15 83 80\n44 7E AE\n92 9C 78\n25 BF 08\n47 4B 8C\n0D F9 74\n03 E7 50\n00 3A 00\nFE C2 EA\n02 22 EA\nFA DA EA\n0A 22 0A\nEA B2 FA\nEA 9A 02\nEA E8 FE" },
/* 47*/ { BARCODE_HANXIN, "é", NULL, NULL, NULL, DATA_MODE, -1, 0, -1, -1, -1, 0, -1, 1, 4, -1, NULL, -1, -1, 0, -1, "FE 8A FE\n80 28 02\nBE E8 FA\nA0 94 0A\nAE 3E EA\nAE D2 EA\nAE 74 EA\n00 AA 00\n15 B4 80\n0B 48 74\nA2 4A A4\nB5 56 2C\nA8 5A A8\n9F 18 50\n02 07 50\n00 A6 00\nFE 20 EA\n02 C2 EA\nFA C4 EA\n0A 42 0A\nEA 52 FA\nEA 24 02\nEA AA FE" },
};
int data_size = ARRAY_SIZE(data);
int i;
@@ -386,6 +392,8 @@ static void test_dump_args(const testCtx *const p_ctx) {
arg_output_options(cmd, data[i].output_options);
arg_bool(cmd, "--batch", data[i].batch);
arg_int(cmd, "--cols=", data[i].cols);
arg_int(cmd, "--dmb256=", data[i].dmb256);
arg_int(cmd, "--dmc40=", data[i].dmc40);
arg_bool(cmd, "--dmre", data[i].dmre);
arg_int(cmd, "--eci=", data[i].eci);
arg_bool(cmd, "--fullmultibyte", data[i].fullmultibyte);
+2 -2
View File
@@ -359,7 +359,7 @@ formatted with Application Identifiers (AIs)</string>
<item row="0" column="2">
<widget class="QRadioButton" name="radAztecHIBC">
<property name="text">
<string>H&amp;IBC</string>
<string>&amp;HIBC</string>
</property>
<property name="toolTip">
<string>Process data as a Health Industry Barcode (HIBC)
@@ -741,7 +741,7 @@ Maximum length 32 and cannot contain spaces
(ignored if disabled)</string>
</property>
<property name="text">
<string>I&amp;D:</string>
<string>&amp;ID:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeft|Qt::AlignLeading|Qt::AlignVCenter</set>
+1 -1
View File
@@ -71,7 +71,7 @@ formatted with Application Identifiers (AIs)</string>
<item row="2" column="1">
<widget class="QRadioButton" name="radC128HIBC">
<property name="text">
<string>H&amp;IBC</string>
<string>&amp;HIBC</string>
</property>
<property name="toolTip">
<string>Process data as a Health Industry Barcode (HIBC)
+3 -3
View File
@@ -348,7 +348,7 @@
<item row="1" column="0">
<widget class="QLabel" name="lblCbfHeight">
<property name="text">
<string>Number of Ro&amp;ws:</string>
<string>Nu&amp;mber of Rows:</string>
</property>
<property name="toolTip">
<string>Set number of rows</string>
@@ -605,7 +605,7 @@ the Appearance tab is not checked
(ignored if disabled)</string>
</property>
<property name="text">
<string>Row &amp;Height:</string>
<string>Ro&amp;w Height:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
@@ -777,7 +777,7 @@ separating rows</string>
<item>
<widget class="QRadioButton" name="radCbfHIBC">
<property name="text">
<string>H&amp;IBC</string>
<string>&amp;HIBC</string>
</property>
<property name="toolTip">
<string>Process data as a Health Industry Barcode (HIBC)
+106 -21
View File
@@ -23,7 +23,7 @@
<item>
<layout class="QGridLayout" name="gridLayoutDM">
<item row="0" column="0">
<widget class="QLabel" name="lblDM200Size">
<widget class="QLabel" name="lblDMSize">
<property name="text">
<string>Si&amp;ze:</string>
</property>
@@ -31,12 +31,12 @@
<string>Set height and width (H x W) of symbol</string>
</property>
<property name="buddy">
<cstring>cmbDM200Size</cstring>
<cstring>cmbDMSize</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="cmbDM200Size">
<widget class="QComboBox" name="cmbDMSize">
<property name="toolTip">
<string>Set height and width (H x W) of symbol</string>
</property>
@@ -341,19 +341,19 @@ versions on automatic symbol size selection
</layout>
</item>
<item>
<widget class="QGroupBox" name="groupBoxDM200EncodingMode">
<widget class="QGroupBox" name="groupBoxDMEncodingMode">
<property name="title">
<string>Encoding Mode</string>
</property>
<property name="toolTip">
<string>How to process data</string>
</property>
<layout class="QGridLayout" name="gridLayoutDM200EncodingMode">
<layout class="QGridLayout" name="gridLayoutDMEncodingMode">
<property name="sizeConstraint">
<enum>QLayout::SetMinimumSize</enum>
</property>
<item row="0" column="0">
<widget class="QRadioButton" name="radDM200Stand">
<widget class="QRadioButton" name="radDMStand">
<property name="text">
<string>S&amp;tandard</string>
</property>
@@ -366,7 +366,7 @@ versions on automatic symbol size selection
</widget>
</item>
<item row="0" column="1">
<widget class="QRadioButton" name="radDM200GS1">
<widget class="QRadioButton" name="radDMGS1">
<property name="text">
<string>GS&amp;1 Data</string>
</property>
@@ -377,9 +377,9 @@ formatted with Application Identifiers (AIs)</string>
</widget>
</item>
<item row="0" column="2">
<widget class="QRadioButton" name="radDM200HIBC">
<widget class="QRadioButton" name="radDMHIBC">
<property name="text">
<string>H&amp;IBC</string>
<string>&amp;HIBC</string>
</property>
<property name="toolTip">
<string>Process data as a Health Industry Barcode (HIBC)
@@ -393,19 +393,104 @@ the data with a slash &quot;/&quot;</string>
</widget>
</item>
<item>
<widget class="QCheckBox" name="chkDMGSSep">
<property name="text">
<string>Use separator GS &amp;for GS1</string>
</property>
<property name="toolTip">
<string>Use Group Separator (ASCII 0x1D) to separate GS1 AIs
<layout class="QGridLayout" name="gridLayoutModeOpts">
<item row="0" column="0">
<widget class="QCheckBox" name="chkDMGSSep">
<property name="text">
<string>Use separator &amp;GS for GS1</string>
</property>
<property name="toolTip">
<string>Use Group Separator (ASCII 0x1D) to separate GS1 AIs
instead of the preferred FNC1
(ignored if disabled)</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="1">
<layout class="QHBoxLayout" name="horzLayoutDMStartMode">
<item>
<widget class="QLabel" name="lblDMStartMode">
<property name="text">
<string>Start &amp;Mode:</string>
</property>
<property name="toolTip">
<string>Mode to start encodation in</string>
</property>
<property name="buddy">
<cstring>cmbDMStartMode</cstring>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="cmbDMStartMode">
<property name="toolTip">
<string>Select mode to start encodation in</string>
</property>
<item>
<property name="text">
<string>Disabled</string>
</property>
</item>
<item>
<property name="text">
<string>Base 256</string>
</property>
</item>
<item>
<property name="text">
<string>C40</string>
</property>
</item>
</widget>
</item>
<item>
<widget class="QLabel" name="lblDMStartModeLength">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Le&amp;ngth:</string>
</property>
<property name="toolTip">
<string>Number of initial characters
to encode in Start Mode
(ignored if disabled)</string>
</property>
<property name="buddy">
<cstring>spnDMStartModeLength</cstring>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spnDMStartModeLength">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Number of initial characters
to encode in Start Mode
(ignored if disabled)</string>
</property>
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>3116</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="specialValueText">
<string>All</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="chkDMISO144">
@@ -715,7 +800,7 @@ Value of each ID ranges from 1 to 254
(ignored if disabled)</string>
</property>
<property name="text">
<string>I&amp;D:</string>
<string>&amp;ID:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeft|Qt::AlignLeading|Qt::AlignVCenter</set>
+1 -1
View File
@@ -1056,7 +1056,7 @@
<item row="2" column="0">
<widget class="QLabel" name="lblDotMask">
<property name="text">
<string>&amp;Mask:</string>
<string>Mas&amp;k:</string>
</property>
<property name="toolTip">
<string>Manually specify which mask to use.
+1 -1
View File
@@ -485,7 +485,7 @@ Value ranges from 0 to 255
(ignored if disabled)</string>
</property>
<property name="text">
<string>I&amp;D:</string>
<string>&amp;ID:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeft|Qt::AlignLeading|Qt::AlignVCenter</set>
+1 -1
View File
@@ -520,7 +520,7 @@ error correction codewords</string>
<item row="2" column="0">
<widget class="QLabel" name="labelHXMask">
<property name="text">
<string>&amp;Mask:</string>
<string>Mas&amp;k:</string>
</property>
<property name="toolTip">
<string>Manually specify which mask to use</string>
+1 -1
View File
@@ -111,7 +111,7 @@ error correction codewords</string>
<item row="2" column="0">
<widget class="QLabel" name="lblMQRMask">
<property name="text">
<string>&amp;Mask:</string>
<string>Mas&amp;k:</string>
</property>
<property name="toolTip">
<string>Manually specify which mask to use</string>
+4 -4
View File
@@ -82,7 +82,7 @@ the Appearance tab is not checked
(ignored if disabled)</string>
</property>
<property name="text">
<string>Row &amp;Height:</string>
<string>Ro&amp;w Height:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
@@ -170,7 +170,7 @@ tab will be re-enabled)</string>
<string>Set height per row to default value</string>
</property>
<property name="text">
<string>De&amp;fault</string>
<string>Def&amp;ault</string>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
@@ -238,7 +238,7 @@ tab will be re-enabled)</string>
<item row="0" column="1">
<widget class="QRadioButton" name="radMPDFHIBC">
<property name="text">
<string>H&amp;IBC</string>
<string>&amp;HIBC</string>
</property>
<property name="toolTip">
<string>Process data as a Health Industry Barcode (HIBC)
@@ -375,7 +375,7 @@ Numbers only, in triplets, maximum length 30 (10 triplets)
(ignored if disabled)</string>
</property>
<property name="text">
<string>I&amp;D:</string>
<string>&amp;ID:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeft|Qt::AlignLeading|Qt::AlignVCenter</set>
+5 -5
View File
@@ -207,7 +207,7 @@ be set to more than this depending on data</string>
<item row="1" column="0">
<widget class="QLabel" name="lblPDFRows">
<property name="text">
<string>Number of Ro&amp;ws:</string>
<string>Nu&amp;mber of Rows:</string>
</property>
<property name="toolTip">
<string>Set number of rows - may be set to more than
@@ -689,7 +689,7 @@ the Appearance tab is not checked
(ignored if disabled)</string>
</property>
<property name="text">
<string>Row &amp;Height:</string>
<string>Ro&amp;w Height:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
@@ -777,7 +777,7 @@ tab will be re-enabled)</string>
<string>Set height per row to default value</string>
</property>
<property name="text">
<string>De&amp;fault</string>
<string>Def&amp;ault</string>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
@@ -898,7 +898,7 @@ tab will be re-enabled)</string>
<item row="0" column="1">
<widget class="QRadioButton" name="radPDFHIBC">
<property name="text">
<string>H&amp;IBC</string>
<string>&amp;HIBC</string>
</property>
<property name="toolTip">
<string>Process data as a Health Industry Barcode (HIBC)
@@ -1060,7 +1060,7 @@ Maximum length 30 (10 triplets)
(ignored if disabled)</string>
</property>
<property name="text">
<string>I&amp;D:</string>
<string>&amp;ID:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeft|Qt::AlignLeading|Qt::AlignVCenter</set>
+3 -3
View File
@@ -300,7 +300,7 @@ error correction codewords</string>
<item row="2" column="0">
<widget class="QLabel" name="labelQRMask">
<property name="text">
<string>&amp;Mask:</string>
<string>Mas&amp;k:</string>
</property>
<property name="toolTip">
<string>Manually specify which mask to use</string>
@@ -403,7 +403,7 @@ formatted with Application Identifiers (AIs)</string>
<item row="0" column="2">
<widget class="QRadioButton" name="radQRHIBC">
<property name="text">
<string>H&amp;IBC</string>
<string>&amp;HIBC</string>
</property>
<property name="toolTip">
<string>Process data as a Health Industry Barcode (HIBC)
@@ -724,7 +724,7 @@ Value ranges from 0 to 255
(ignored if disabled)</string>
</property>
<property name="text">
<string>I&amp;D:</string>
<string>&amp;ID:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeft|Qt::AlignLeading|Qt::AlignVCenter</set>
+1 -1
View File
@@ -62,7 +62,7 @@
<item row="1" column="0">
<widget class="QLabel" name="labelUPNQRMask">
<property name="text">
<string>&amp;Mask:</string>
<string>Mas&amp;k:</string>
</property>
<property name="toolTip">
<string>Manually specify which mask to use</string>
+3 -3
View File
@@ -52,7 +52,7 @@ based on data</string>
<item row="1" column="0">
<widget class="QRadioButton" name="radUltraEcc">
<property name="text">
<string>E&amp;rror Correction Level:</string>
<string>Error &amp;Correction Level:</string>
</property>
<property name="toolTip">
<string>Set percentage of capacity to use for
@@ -110,7 +110,7 @@ error correction codewords</string>
<item row="2" column="0">
<widget class="QLabel" name="labelUltraRevision">
<property name="text">
<string>Rev&amp;ision:</string>
<string>&amp;Revision:</string>
</property>
<property name="toolTip">
<string>Set revision to use on output</string>
@@ -378,7 +378,7 @@ Value ranges from 1 to 80088
(ignored if disabled)</string>
</property>
<property name="text">
<string>I&amp;D:</string>
<string>&amp;ID:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeft|Qt::AlignLeading|Qt::AlignVCenter</set>
+247 -164
View File
@@ -1222,7 +1222,7 @@ void MainWindow::codeone_ui_set()
if (symbology != BARCODE_CODEONE)
return;
QGroupBox *groupBox = m_optionWidget->findChild<QGroupBox*>(QSL("groupBoxC1StructApp"));
QGroupBox *groupBox = get_groupBox(QSL("groupBoxC1StructApp"));
if (groupBox) {
bool enabled = get_cmb_index(QSL("cmbC1Size")) != 9; // Not Version S
groupBox->setEnabled(enabled);
@@ -1238,8 +1238,8 @@ void MainWindow::upcean_no_quiet_zones_ui_set()
bool showHRT = chkHRTShow->isEnabled() && chkHRTShow->isChecked();
QCheckBox *noQZs, *guardWS;
noQZs = m_optionWidget ? m_optionWidget->findChild<QCheckBox*>(QSL("chkUPCEANNoQuietZones")) : nullptr;
guardWS = m_optionWidget ? m_optionWidget->findChild<QCheckBox*>(QSL("chkUPCEANGuardWhitespace")) : nullptr;
noQZs = get_chk(QSL("chkUPCEANNoQuietZones"));
guardWS = get_chk(QSL("chkUPCEANGuardWhitespace"));
if (noQZs && guardWS) {
guardWS->setEnabled(!noQZs->isChecked() && showHRT);
@@ -1257,11 +1257,11 @@ void MainWindow::upcae_no_quiet_zones_ui_set()
bool showHRT = chkHRTShow->isEnabled() && chkHRTShow->isChecked();
QCheckBox *noQZs, *guardWS;
if (is_upca) {
noQZs = m_optionWidget ? m_optionWidget->findChild<QCheckBox*>(QSL("chkUPCANoQuietZones")) : nullptr;
guardWS = m_optionWidget ? m_optionWidget->findChild<QCheckBox*>(QSL("chkUPCAGuardWhitespace")) : nullptr;
noQZs = get_chk(QSL("chkUPCANoQuietZones"));
guardWS = get_chk(QSL("chkUPCAGuardWhitespace"));
} else {
noQZs = m_optionWidget ? m_optionWidget->findChild<QCheckBox*>(QSL("chkUPCEANNoQuietZones")) : nullptr;
guardWS = m_optionWidget ? m_optionWidget->findChild<QCheckBox*>(QSL("chkUPCEANGuardWhitespace")) : nullptr;
noQZs = get_chk(QSL("chkUPCEANNoQuietZones"));
guardWS = get_chk(QSL("chkUPCEANGuardWhitespace"));
}
if (noQZs && guardWS) {
@@ -1283,8 +1283,8 @@ void MainWindow::eanaddon_no_quiet_zones_ui_set()
bool showHRT = chkHRTShow->isEnabled() && chkHRTShow->isChecked();
QCheckBox *noQZs, *guardWS;
noQZs = m_optionWidget ? m_optionWidget->findChild<QCheckBox*>(QSL("chkEANAddOnNoQuietZones")) : nullptr;
guardWS = m_optionWidget ? m_optionWidget->findChild<QCheckBox*>(QSL("chkEANAddOnGuardWhitespace")) : nullptr;
noQZs = get_chk(QSL("chkEANAddOnNoQuietZones"));
guardWS = get_chk(QSL("chkEANAddOnGuardWhitespace"));
if (noQZs && guardWS) {
guardWS->setEnabled(!noQZs->isChecked() && showHRT);
@@ -1307,6 +1307,18 @@ void MainWindow::aztec_ecc_index_changed()
update_preview();
}
void MainWindow::dm_startmode_ui_set()
{
const int idx = get_cmb_index(QSL("cmbDMStartMode"));
QLabel *lbl = get_lbl(QSL("lblDMStartModeLength"));
QSpinBox *spn = get_spn(QSL("spnDMStartModeLength"));
if (lbl && spn) {
lbl->setEnabled(idx != 0);
spn->setEnabled(idx != 0);
}
update_preview();
}
void MainWindow::structapp_ui_set()
{
int symbology = bstyle_items[bstyle->currentIndex()].symbology;
@@ -1321,7 +1333,7 @@ void MainWindow::structapp_ui_set()
widgetID = get_widget(QSL("txt") + name + QSL("StructAppID"));
} else if (symbology == BARCODE_CODEONE) {
name = QSL("C1");
QSpinBox *spnCount = m_optionWidget->findChild<QSpinBox*>(QSL("spn") + name + QSL("StructAppCount"));
QSpinBox *spnCount = get_spn(QSL("spn") + name + QSL("StructAppCount"));
enabled = spnCount ? spnCount->value() > 1 : false;
widgetCount = spnCount;
widgetIndex = get_widget(QSL("spn") + name + QSL("StructAppIndex"));
@@ -1335,7 +1347,7 @@ void MainWindow::structapp_ui_set()
name = QSL("Maxi");
} else if (symbology == BARCODE_PDF417 || symbology == BARCODE_MICROPDF417) {
name = symbology == BARCODE_PDF417 ? QSL("PDF") : QSL("MPDF");
QSpinBox *spnCount = m_optionWidget->findChild<QSpinBox*>(QSL("spn") + name + QSL("StructAppCount"));
QSpinBox *spnCount = get_spn(QSL("spn") + name + QSL("StructAppCount"));
enabled = spnCount ? spnCount->value() > 1 : false;
widgetCount = spnCount;
widgetIndex = get_widget(QSL("spn") + name + QSL("StructAppIndex"));
@@ -1351,9 +1363,9 @@ void MainWindow::structapp_ui_set()
widgetID = get_widget(QSL("spn") + name + QSL("StructAppID"));
}
if (!name.isEmpty()) {
QLabel *lblIndex = m_optionWidget->findChild<QLabel*>(QSL("lbl") + name + QSL("StructAppIndex"));
QLabel *lblIndex = get_lbl(QSL("lbl") + name + QSL("StructAppIndex"));
if (!widgetCount) {
QComboBox *cmbCount = m_optionWidget->findChild<QComboBox*>(QSL("cmb") + name + QSL("StructAppCount"));
QComboBox *cmbCount = get_cmb(QSL("cmb") + name + QSL("StructAppCount"));
enabled = cmbCount ? cmbCount->currentIndex() != 0 : false;
widgetCount = cmbCount;
}
@@ -1363,7 +1375,7 @@ void MainWindow::structapp_ui_set()
if (lblIndex && widgetCount && widgetIndex) {
lblIndex->setEnabled(enabled);
widgetIndex->setEnabled(enabled);
QLabel *lblID = m_optionWidget->findChild<QLabel*>(QSL("lbl") + name + QSL("StructAppID"));
QLabel *lblID = get_lbl(QSL("lbl") + name + QSL("StructAppID"));
if (lblID) {
lblID->setEnabled(enabled);
if (lblID2) {
@@ -1768,12 +1780,12 @@ void MainWindow::change_options()
connect(get_widget(QSL("cmbPDFECC")), SIGNAL(currentIndexChanged(int)), SLOT(update_preview()));
connect(get_widget(QSL("cmbPDFCols")), SIGNAL(currentIndexChanged(int)), SLOT(update_preview()));
connect(get_widget(QSL("cmbPDFRows")), SIGNAL(currentIndexChanged(int)), SLOT(update_preview()));
m_lblHeightPerRow = m_optionWidget->findChild<QLabel*>(QSL("lblPDFHeightPerRow"));
m_spnHeightPerRow = m_optionWidget->findChild<QDoubleSpinBox*>(QSL("spnPDFHeightPerRow"));
m_lblHeightPerRow = get_lbl(QSL("lblPDFHeightPerRow"));
m_spnHeightPerRow = get_dspn(QSL("spnPDFHeightPerRow"));
connect(m_spnHeightPerRow, SIGNAL(valueChanged(double)), SLOT(autoheight_ui_set()));
connect(m_spnHeightPerRow, SIGNAL(valueChanged(double)), SLOT(update_preview()));
m_btnHeightPerRowDisable = m_optionWidget->findChild<QPushButton*>(QSL("btnPDFHeightPerRowDisable"));
m_btnHeightPerRowDefault = m_optionWidget->findChild<QPushButton*>(QSL("btnPDFHeightPerRowDefault"));
m_btnHeightPerRowDisable = get_btn(QSL("btnPDFHeightPerRowDisable"));
m_btnHeightPerRowDefault = get_btn(QSL("btnPDFHeightPerRowDefault"));
connect(m_btnHeightPerRowDisable, SIGNAL(clicked(bool)), SLOT(height_per_row_disable()));
connect(m_btnHeightPerRowDefault, SIGNAL(clicked(bool)), SLOT(height_per_row_default()));
connect(get_widget(QSL("radPDFTruncated")), SIGNAL(toggled(bool)), SLOT(update_preview()));
@@ -1795,12 +1807,12 @@ void MainWindow::change_options()
structapp_ui_set();
tabMain->insertTab(1, m_optionWidget, tr("Micro PDF41&7"));
connect(get_widget(QSL("cmbMPDFCols")), SIGNAL(currentIndexChanged(int)), SLOT(update_preview()));
m_lblHeightPerRow = m_optionWidget->findChild<QLabel*>(QSL("lblMPDFHeightPerRow"));
m_spnHeightPerRow = m_optionWidget->findChild<QDoubleSpinBox*>(QSL("spnMPDFHeightPerRow"));
m_lblHeightPerRow = get_lbl(QSL("lblMPDFHeightPerRow"));
m_spnHeightPerRow = get_dspn(QSL("spnMPDFHeightPerRow"));
connect(m_spnHeightPerRow, SIGNAL(valueChanged(double)), SLOT(autoheight_ui_set()));
connect(m_spnHeightPerRow, SIGNAL(valueChanged(double)), SLOT(update_preview()));
m_btnHeightPerRowDisable = m_optionWidget->findChild<QPushButton*>(QSL("btnMPDFHeightPerRowDisable"));
m_btnHeightPerRowDefault = m_optionWidget->findChild<QPushButton*>(QSL("btnMPDFHeightPerRowDefault"));
m_btnHeightPerRowDisable = get_btn(QSL("btnMPDFHeightPerRowDisable"));
m_btnHeightPerRowDefault = get_btn(QSL("btnMPDFHeightPerRowDefault"));
connect(m_btnHeightPerRowDisable, SIGNAL(clicked(bool)), SLOT(height_per_row_disable()));
connect(m_btnHeightPerRowDefault, SIGNAL(clicked(bool)), SLOT(height_per_row_default()));
connect(get_widget(QSL("radMPDFStand")), SIGNAL(toggled(bool)), SLOT(update_preview()));
@@ -1904,11 +1916,11 @@ void MainWindow::change_options()
connect(get_widget(QSL("radC39Stand")), SIGNAL(toggled(bool)), SLOT(update_preview()));
connect(get_widget(QSL("radC39Check")), SIGNAL(toggled(bool)), SLOT(update_preview()));
connect(get_widget(QSL("radC39CheckHide")), SIGNAL(toggled(bool)), SLOT(update_preview()));
QRadioButton *radC39HIBC = m_optionWidget->findChild<QRadioButton*>(QSL("radC39HIBC"));
QRadioButton *radC39HIBC = get_rad(QSL("radC39HIBC"));
if (symbology == BARCODE_EXCODE39 || symbology == BARCODE_LOGMARS) {
if (radC39HIBC->isChecked()) {
radC39HIBC->setChecked(false);
m_optionWidget->findChild<QRadioButton*>(QSL("radC39Stand"))->setChecked(true);
get_rad(QSL("radC39Stand"))->setChecked(true);
}
radC39HIBC->setEnabled(false);
radC39HIBC->hide();
@@ -1928,12 +1940,12 @@ void MainWindow::change_options()
tabMain->insertTab(1, m_optionWidget, tr("Cod&e 16K"));
btype->setItemText(0, tr("Default (bind)"));
connect(get_widget(QSL("cmbC16kRows")), SIGNAL(currentIndexChanged(int)), SLOT(update_preview()));
m_lblHeightPerRow = m_optionWidget->findChild<QLabel*>(QSL("lblC16kHeightPerRow"));
m_spnHeightPerRow = m_optionWidget->findChild<QDoubleSpinBox*>(QSL("spnC16kHeightPerRow"));
m_lblHeightPerRow = get_lbl(QSL("lblC16kHeightPerRow"));
m_spnHeightPerRow = get_dspn(QSL("spnC16kHeightPerRow"));
connect(m_spnHeightPerRow, SIGNAL(valueChanged(double)), SLOT(autoheight_ui_set()));
connect(m_spnHeightPerRow, SIGNAL(valueChanged(double)), SLOT(update_preview()));
m_btnHeightPerRowDisable = m_optionWidget->findChild<QPushButton*>(QSL("btnC16kHeightPerRowDisable"));
m_btnHeightPerRowDefault = m_optionWidget->findChild<QPushButton*>(QSL("btnC16kHeightPerRowDefault"));
m_btnHeightPerRowDisable = get_btn(QSL("btnC16kHeightPerRowDisable"));
m_btnHeightPerRowDefault = get_btn(QSL("btnC16kHeightPerRowDefault"));
connect(m_btnHeightPerRowDisable, SIGNAL(clicked(bool)), SLOT(height_per_row_disable()));
connect(m_btnHeightPerRowDefault, SIGNAL(clicked(bool)), SLOT(height_per_row_default()));
connect(get_widget(QSL("cmbC16kRowSepHeight")), SIGNAL(currentIndexChanged(int)), SLOT(update_preview()));
@@ -1964,12 +1976,12 @@ void MainWindow::change_options()
btype->setItemText(0, tr("Default (bind)"));
connect(get_widget(QSL("cmbCbfWidth")), SIGNAL(currentIndexChanged(int)), SLOT(update_preview()));
connect(get_widget(QSL("cmbCbfHeight")), SIGNAL(currentIndexChanged(int)), SLOT(update_preview()));
m_lblHeightPerRow = m_optionWidget->findChild<QLabel*>(QSL("lblCbfHeightPerRow"));
m_spnHeightPerRow = m_optionWidget->findChild<QDoubleSpinBox*>(QSL("spnCbfHeightPerRow"));
m_lblHeightPerRow = get_lbl(QSL("lblCbfHeightPerRow"));
m_spnHeightPerRow = get_dspn(QSL("spnCbfHeightPerRow"));
connect(m_spnHeightPerRow, SIGNAL(valueChanged(double)), SLOT(autoheight_ui_set()));
connect(m_spnHeightPerRow, SIGNAL(valueChanged(double)), SLOT(update_preview()));
m_btnHeightPerRowDisable = m_optionWidget->findChild<QPushButton*>(QSL("btnCbfHeightPerRowDisable"));
m_btnHeightPerRowDefault = m_optionWidget->findChild<QPushButton*>(QSL("btnCbfHeightPerRowDefault"));
m_btnHeightPerRowDisable = get_btn(QSL("btnCbfHeightPerRowDisable"));
m_btnHeightPerRowDefault = get_btn(QSL("btnCbfHeightPerRowDefault"));
connect(m_btnHeightPerRowDisable, SIGNAL(clicked(bool)), SLOT(height_per_row_disable()));
connect(m_btnHeightPerRowDefault, SIGNAL(clicked(bool)), SLOT(height_per_row_default()));
connect(get_widget(QSL("cmbCbfRowSepHeight")), SIGNAL(currentIndexChanged(int)), SLOT(update_preview()));
@@ -2006,27 +2018,31 @@ void MainWindow::change_options()
} else if (symbology == BARCODE_DATAMATRIX) {
QFile file(QSL(":/grpDM.ui"));
if (!file.open(QIODevice::ReadOnly))
return;
m_optionWidget = uiload.load(&file);
file.close();
load_sub_settings(settings, symbology);
structapp_ui_set();
tabMain->insertTab(1, m_optionWidget, tr("D&ata Matrix"));
connect(get_widget(QSL("radDM200Stand")), SIGNAL(toggled(bool)), SLOT(update_preview()));
connect(get_widget(QSL("radDM200GS1")), SIGNAL(toggled(bool)), SLOT(update_preview()));
connect(get_widget(QSL("radDM200HIBC")), SIGNAL(toggled(bool)), SLOT(update_preview()));
connect(get_widget(QSL("cmbDM200Size")), SIGNAL(currentIndexChanged(int)), SLOT(update_preview()));
connect(get_widget(QSL("chkDMRectangle")), SIGNAL(toggled(bool)), SLOT(update_preview()));
connect(get_widget(QSL("chkDMRE")), SIGNAL(toggled(bool)), SLOT(update_preview()));
connect(get_widget(QSL("chkDMGSSep")), SIGNAL(toggled(bool)), SLOT(update_preview()));
connect(get_widget(QSL("chkDMISO144")), SIGNAL(toggled(bool)), SLOT(update_preview()));
connect(get_widget(QSL("chkDMFast")), SIGNAL(toggled(bool)), SLOT(update_preview()));
connect(get_widget(QSL("cmbDMStructAppCount")), SIGNAL(currentIndexChanged(int)), SLOT(update_preview()));
connect(get_widget(QSL("cmbDMStructAppCount")), SIGNAL(currentIndexChanged(int)), SLOT(structapp_ui_set()));
connect(get_widget(QSL("cmbDMStructAppIndex")), SIGNAL(currentIndexChanged(int)), SLOT(update_preview()));
connect(get_widget(QSL("spnDMStructAppID")), SIGNAL(valueChanged(int)), SLOT(update_preview()));
connect(get_widget(QSL("spnDMStructAppID2")), SIGNAL(valueChanged(int)), SLOT(update_preview()));
if (file.open(QIODevice::ReadOnly)) {
m_optionWidget = uiload.load(&file);
file.close();
load_sub_settings(settings, symbology);
structapp_ui_set();
dm_startmode_ui_set();
tabMain->insertTab(1, m_optionWidget, tr("D&ata Matrix"));
connect(get_widget(QSL("radDMStand")), SIGNAL(toggled(bool)), SLOT(update_preview()));
connect(get_widget(QSL("radDMGS1")), SIGNAL(toggled(bool)), SLOT(update_preview()));
connect(get_widget(QSL("radDMHIBC")), SIGNAL(toggled(bool)), SLOT(update_preview()));
connect(get_widget(QSL("cmbDMSize")), SIGNAL(currentIndexChanged(int)), SLOT(update_preview()));
connect(get_widget(QSL("chkDMRectangle")), SIGNAL(toggled(bool)), SLOT(update_preview()));
connect(get_widget(QSL("chkDMRE")), SIGNAL(toggled(bool)), SLOT(update_preview()));
connect(get_widget(QSL("chkDMGSSep")), SIGNAL(toggled(bool)), SLOT(update_preview()));
connect(get_widget(QSL("cmbDMStartMode")), SIGNAL(currentIndexChanged(int)), SLOT(dm_startmode_ui_set()));
connect(get_widget(QSL("spnDMStartModeLength")), SIGNAL(valueChanged(int)), SLOT(dm_startmode_ui_set()));
connect(get_widget(QSL("chkDMISO144")), SIGNAL(toggled(bool)), SLOT(update_preview()));
connect(get_widget(QSL("chkDMFast")), SIGNAL(toggled(bool)), SLOT(update_preview()));
connect(get_widget(QSL("cmbDMStructAppCount")), SIGNAL(currentIndexChanged(int)), SLOT(update_preview()));
connect(get_widget(QSL("cmbDMStructAppCount")), SIGNAL(currentIndexChanged(int)),
SLOT(structapp_ui_set()));
connect(get_widget(QSL("cmbDMStructAppIndex")), SIGNAL(currentIndexChanged(int)), SLOT(update_preview()));
connect(get_widget(QSL("spnDMStructAppID")), SIGNAL(valueChanged(int)), SLOT(update_preview()));
connect(get_widget(QSL("spnDMStructAppID2")), SIGNAL(valueChanged(int)), SLOT(update_preview()));
}
} else if (symbology == BARCODE_MAILMARK_2D) {
QFile file(QSL(":/grpMailmark2D.ui"));
@@ -2215,12 +2231,12 @@ void MainWindow::change_options()
tabMain->insertTab(1, m_optionWidget, tr("Cod&e 49"));
btype->setItemText(0, tr("Default (bind)"));
connect(get_widget(QSL("cmbC49Rows")), SIGNAL(currentIndexChanged(int)), SLOT(update_preview()));
m_lblHeightPerRow = m_optionWidget->findChild<QLabel*>(QSL("lblC49HeightPerRow"));
m_spnHeightPerRow = m_optionWidget->findChild<QDoubleSpinBox*>(QSL("spnC49HeightPerRow"));
m_lblHeightPerRow = get_lbl(QSL("lblC49HeightPerRow"));
m_spnHeightPerRow = get_dspn(QSL("spnC49HeightPerRow"));
connect(m_spnHeightPerRow, SIGNAL(valueChanged(double)), SLOT(autoheight_ui_set()));
connect(m_spnHeightPerRow, SIGNAL(valueChanged(double)), SLOT(update_preview()));
m_btnHeightPerRowDisable = m_optionWidget->findChild<QPushButton*>(QSL("btnC49HeightPerRowDisable"));
m_btnHeightPerRowDefault = m_optionWidget->findChild<QPushButton*>(QSL("btnC49HeightPerRowDefault"));
m_btnHeightPerRowDisable = get_btn(QSL("btnC49HeightPerRowDisable"));
m_btnHeightPerRowDefault = get_btn(QSL("btnC49HeightPerRowDefault"));
connect(m_btnHeightPerRowDisable, SIGNAL(clicked(bool)), SLOT(height_per_row_disable()));
connect(m_btnHeightPerRowDefault, SIGNAL(clicked(bool)), SLOT(height_per_row_default()));
connect(get_widget(QSL("cmbC49RowSepHeight")), SIGNAL(currentIndexChanged(int)), SLOT(update_preview()));
@@ -2250,12 +2266,12 @@ void MainWindow::change_options()
connect(get_widget(QSL("radDBESRows")), SIGNAL(toggled(bool)), SLOT(update_preview()));
connect(get_widget(QSL("cmbDBESCols")), SIGNAL(currentIndexChanged(int)), SLOT(update_preview()));
connect(get_widget(QSL("cmbDBESRows")), SIGNAL(currentIndexChanged(int)), SLOT(update_preview()));
m_lblHeightPerRow = m_optionWidget->findChild<QLabel*>(QSL("lblDBESHeightPerRow"));
m_spnHeightPerRow = m_optionWidget->findChild<QDoubleSpinBox*>(QSL("spnDBESHeightPerRow"));
m_lblHeightPerRow = get_lbl(QSL("lblDBESHeightPerRow"));
m_spnHeightPerRow = get_dspn(QSL("spnDBESHeightPerRow"));
connect(m_spnHeightPerRow, SIGNAL(valueChanged(double)), SLOT(autoheight_ui_set()));
connect(m_spnHeightPerRow, SIGNAL(valueChanged(double)), SLOT(update_preview()));
m_btnHeightPerRowDisable = m_optionWidget->findChild<QPushButton*>(QSL("btnDBESHeightPerRowDisable"));
m_btnHeightPerRowDefault = m_optionWidget->findChild<QPushButton*>(QSL("btnDBESHeightPerRowDefault"));
m_btnHeightPerRowDisable = get_btn(QSL("btnDBESHeightPerRowDisable"));
m_btnHeightPerRowDefault = get_btn(QSL("btnDBESHeightPerRowDefault"));
connect(m_btnHeightPerRowDisable, SIGNAL(clicked(bool)), SLOT(height_per_row_disable()));
connect(m_btnHeightPerRowDefault, SIGNAL(clicked(bool)), SLOT(height_per_row_default()));
@@ -2533,7 +2549,7 @@ void MainWindow::composite_ui_set()
if (enabled) {
if (bstyle_items[bstyle->currentIndex()].symbology == BARCODE_CODE128) {
QRadioButton *radioButton = m_optionWidget->findChild<QRadioButton*>(QSL("radC128EAN"));
QRadioButton *radioButton = get_rad(QSL("radC128EAN"));
if (radioButton) {
radioButton->setChecked(true);
}
@@ -2545,7 +2561,7 @@ void MainWindow::composite_ean_check()
{
if (bstyle_items[bstyle->currentIndex()].symbology != BARCODE_CODE128)
return;
QRadioButton *radioButton = m_optionWidget->findChild<QRadioButton*>(QSL("radC128EAN"));
QRadioButton *radioButton = get_rad(QSL("radC128EAN"));
if (radioButton && !radioButton->isChecked())
chkComposite->setChecked(false);
}
@@ -2554,28 +2570,28 @@ void MainWindow::maxi_scm_ui_set()
{
if (bstyle_items[bstyle->currentIndex()].symbology != BARCODE_MAXICODE)
return;
QCheckBox *chkMaxiSCMVV = m_optionWidget ? m_optionWidget->findChild<QCheckBox*>(QSL("chkMaxiSCMVV")) : nullptr;
QCheckBox *chkMaxiSCMVV = get_chk(QSL("chkMaxiSCMVV"));
if (!chkMaxiSCMVV)
return;
bool isMode2or3 = get_cmb_index(QSL("cmbMaxiMode")) == 0;
m_optionWidget->findChild<QLabel*>(QSL("lblMaxiSCMPostcode"))->setEnabled(isMode2or3);
m_optionWidget->findChild<QLineEdit*>(QSL("txtMaxiSCMPostcode"))->setEnabled(isMode2or3);
m_optionWidget->findChild<QLabel*>(QSL("lblMaxiSCMCountry"))->setEnabled(isMode2or3);
m_optionWidget->findChild<QSpinBox*>(QSL("spnMaxiSCMCountry"))->setEnabled(isMode2or3);
m_optionWidget->findChild<QLabel*>(QSL("lblMaxiSCMService"))->setEnabled(isMode2or3);
m_optionWidget->findChild<QSpinBox*>(QSL("spnMaxiSCMService"))->setEnabled(isMode2or3);
get_lbl(QSL("lblMaxiSCMPostcode"))->setEnabled(isMode2or3);
get_txt(QSL("txtMaxiSCMPostcode"))->setEnabled(isMode2or3);
get_lbl(QSL("lblMaxiSCMCountry"))->setEnabled(isMode2or3);
get_spn(QSL("spnMaxiSCMCountry"))->setEnabled(isMode2or3);
get_lbl(QSL("lblMaxiSCMService"))->setEnabled(isMode2or3);
get_spn(QSL("spnMaxiSCMService"))->setEnabled(isMode2or3);
chkMaxiSCMVV->setEnabled(isMode2or3);
m_optionWidget->findChild<QLabel*>(QSL("lblMaxiSCMVV"))->setEnabled(isMode2or3 && chkMaxiSCMVV->isChecked());
m_optionWidget->findChild<QSpinBox*>(QSL("spnMaxiSCMVV"))->setEnabled(isMode2or3 && chkMaxiSCMVV->isChecked());
get_lbl(QSL("lblMaxiSCMVV"))->setEnabled(isMode2or3 && chkMaxiSCMVV->isChecked());
get_spn(QSL("spnMaxiSCMVV"))->setEnabled(isMode2or3 && chkMaxiSCMVV->isChecked());
}
void MainWindow::msi_plessey_ui_set()
{
if (bstyle_items[bstyle->currentIndex()].symbology != BARCODE_MSI_PLESSEY)
return;
QCheckBox *checkBox = m_optionWidget ? m_optionWidget->findChild<QCheckBox*>(QSL("chkMSICheckText")) : nullptr;
QCheckBox *checkBox = get_chk(QSL("chkMSICheckText"));
if (checkBox) {
checkBox->setEnabled(get_cmb_index(QSL("cmbMSICheck")) > 0);
}
@@ -2595,8 +2611,8 @@ void MainWindow::combobox_item_enabled(QComboBox *comboBox, int index, bool enab
bool MainWindow::upcean_addon_gap(const QString &comboBoxName, const QString &labelName, int base)
{
QComboBox *comboBox = m_optionWidget->findChild<QComboBox*>(comboBoxName);
QLabel *label = m_optionWidget->findChild<QLabel*>(labelName);
QComboBox *comboBox = get_cmb(comboBoxName);
QLabel *label = get_lbl(labelName);
bool enabled = have_addon();
if (comboBox) {
@@ -2617,9 +2633,9 @@ bool MainWindow::upcean_addon_gap(const QString &comboBoxName, const QString &la
void MainWindow::upcean_guard_descent(const QString &spnBoxName, const QString &labelName,
const QString &btnDefaultName, bool enabled)
{
QDoubleSpinBox *spnBox = m_optionWidget->findChild<QDoubleSpinBox*>(spnBoxName);
QLabel *label = m_optionWidget->findChild<QLabel*>(labelName);
QPushButton *btnDefault = m_optionWidget->findChild<QPushButton*>(btnDefaultName);
QDoubleSpinBox *spnBox = get_dspn(spnBoxName);
QLabel *label = get_lbl(labelName);
QPushButton *btnDefault = get_btn(btnDefaultName);
if (spnBox) {
spnBox->setEnabled(enabled);
@@ -2644,7 +2660,7 @@ void MainWindow::upcean_guard_descent(const QString &spnBoxName, const QString &
void MainWindow::guard_default(const QString &spnBoxName)
{
QDoubleSpinBox *spnBox = m_optionWidget->findChild<QDoubleSpinBox*>(spnBoxName);
QDoubleSpinBox *spnBox = get_dspn(spnBoxName);
if (spnBox && spnBox->value() != 5.0) {
spnBox->setValue(5.0);
update_preview();
@@ -2653,8 +2669,8 @@ void MainWindow::guard_default(const QString &spnBoxName)
void MainWindow::daft_ui_set()
{
QDoubleSpinBox *spnBox = m_optionWidget->findChild<QDoubleSpinBox*>(QSL("spnDAFTTrackerRatio"));
QPushButton *btnDefault = m_optionWidget->findChild<QPushButton*>(QSL("btnDAFTTrackerDefault"));
QDoubleSpinBox *spnBox = get_dspn(QSL("spnDAFTTrackerRatio"));
QPushButton *btnDefault = get_btn(QSL("btnDAFTTrackerDefault"));
if (spnBox && spnBox->value() == 25.0) {
if (btnDefault) {
QWidget *focus = QApplication::focusWidget();
@@ -2670,7 +2686,7 @@ void MainWindow::daft_ui_set()
void MainWindow::daft_tracker_default()
{
QDoubleSpinBox *spnBox = m_optionWidget->findChild<QDoubleSpinBox*>(QSL("spnDAFTTrackerRatio"));
QDoubleSpinBox *spnBox = get_dspn(QSL("spnDAFTTrackerRatio"));
if (spnBox && spnBox->value() != 25.0) {
spnBox->setValue(25.0);
update_preview();
@@ -2689,7 +2705,7 @@ void MainWindow::set_gs1_mode(bool gs1_mode)
void MainWindow::set_smaller_font(const QString &labelName)
{
QLabel *label = m_optionWidget ? m_optionWidget->findChild<QLabel*>(labelName) : nullptr;
QLabel *label = get_lbl(labelName);
if (label) {
const QFont &appFont = QApplication::font();
qreal pointSize = appFont.pointSizeF();
@@ -2942,11 +2958,11 @@ void MainWindow::update_preview()
if (get_rad_val(QSL("radAztecSize"))) {
m_bc.bc.setOption2(get_cmb_index(QSL("cmbAztecSize")) + 1);
m_optionWidget->findChild<QCheckBox*>(QSL("chkAztecFull"))->setEnabled(false);
get_chk(QSL("chkAztecFull"))->setEnabled(false);
m_bc.bc.setOption3(0);
} else {
m_optionWidget->findChild<QCheckBox*>(QSL("chkAztecFull"))->setEnabled(true);
if (m_optionWidget->findChild<QCheckBox*>(QSL("chkAztecFull"))->isChecked()) {
get_chk(QSL("chkAztecFull"))->setEnabled(true);
if (get_chk(QSL("chkAztecFull"))->isChecked()) {
m_bc.bc.setOption3(ZINT_AZTEC_FULL);
}
}
@@ -3080,13 +3096,13 @@ void MainWindow::update_preview()
break;
case BARCODE_DATAMATRIX:
if (get_rad_val(QSL("radDM200HIBC")))
if (get_rad_val(QSL("radDMHIBC")))
m_bc.bc.setSymbol(BARCODE_HIBC_DM);
else
m_bc.bc.setSymbol(BARCODE_DATAMATRIX);
checkBox = m_optionWidget->findChild<QCheckBox*>(QSL("chkDMGSSep"));
if (get_rad_val(QSL("radDM200GS1"))) {
checkBox = get_chk(QSL("chkDMGSSep"));
if (get_rad_val(QSL("radDMGS1"))) {
set_gs1_mode(true);
checkBox->setEnabled(true);
if (checkBox->isChecked()) {
@@ -3097,29 +3113,38 @@ void MainWindow::update_preview()
checkBox->setEnabled(false);
}
m_bc.bc.setOption2(get_cmb_index(QSL("cmbDM200Size")));
m_bc.bc.setOption2(get_cmb_index(QSL("cmbDMSize")));
if (get_cmb_index(QSL("cmbDM200Size")) == 0) {
if (get_cmb_index(QSL("cmbDMSize")) == 0) {
// Suppressing rectangles or allowing DMRE only makes sense if in automatic size mode
m_optionWidget->findChild<QLabel*>(QSL("lblDMAutoSize"))->setEnabled(true);
m_optionWidget->findChild<QCheckBox*>(QSL("chkDMRectangle"))->setEnabled(true);
if (m_optionWidget->findChild<QCheckBox*>(QSL("chkDMRectangle"))->isChecked()) {
get_lbl(QSL("lblDMAutoSize"))->setEnabled(true);
get_chk(QSL("chkDMRectangle"))->setEnabled(true);
if (get_chk(QSL("chkDMRectangle"))->isChecked()) {
m_bc.bc.setOption3(DM_SQUARE);
m_optionWidget->findChild<QCheckBox*>(QSL("chkDMRE"))->setEnabled(false);
get_chk(QSL("chkDMRE"))->setEnabled(false);
} else {
m_optionWidget->findChild<QCheckBox*>(QSL("chkDMRE"))->setEnabled(true);
if (m_optionWidget->findChild<QCheckBox*>(QSL("chkDMRE"))->isChecked())
get_chk(QSL("chkDMRE"))->setEnabled(true);
if (get_chk(QSL("chkDMRE"))->isChecked())
m_bc.bc.setOption3(DM_DMRE);
else
m_bc.bc.setOption3(0);
}
} else {
m_optionWidget->findChild<QLabel*>(QSL("lblDMAutoSize"))->setEnabled(false);
m_optionWidget->findChild<QCheckBox*>(QSL("chkDMRectangle"))->setEnabled(false);
m_optionWidget->findChild<QCheckBox*>(QSL("chkDMRE"))->setEnabled(false);
get_lbl(QSL("lblDMAutoSize"))->setEnabled(false);
get_chk(QSL("chkDMRectangle"))->setEnabled(false);
get_chk(QSL("chkDMRE"))->setEnabled(false);
m_bc.bc.setOption3(0);
}
item_val = get_cmb_index(QSL("cmbDMStartMode"));
if (item_val) {
m_bc.bc.setOption1(get_spn_val(QSL("spnDMStartModeLength")));
m_bc.bc.setOption3(m_bc.bc.option3() | (item_val == 1 ? DM_B256_START : DM_C40_START));
} else {
m_bc.bc.setOption1(-1);
m_bc.bc.setOption3(m_bc.bc.option3() & ~(DM_B256_START | DM_C40_START));
}
if (get_chk_val(QSL("chkDMISO144"))) {
m_bc.bc.setOption3(m_bc.bc.option3() | DM_ISO_144);
}
@@ -3146,14 +3171,14 @@ void MainWindow::update_preview()
if (!item_val) {
// Suppressing rectangles only makes sense if in automatic size mode
m_optionWidget->findChild<QLabel*>(QSL("lblMailmark2DAutoSize"))->setEnabled(true);
m_optionWidget->findChild<QCheckBox*>(QSL("chkMailmark2DRectangle"))->setEnabled(true);
if (m_optionWidget->findChild<QCheckBox*>(QSL("chkMailmark2DRectangle"))->isChecked()) {
get_lbl(QSL("lblMailmark2DAutoSize"))->setEnabled(true);
get_chk(QSL("chkMailmark2DRectangle"))->setEnabled(true);
if (get_chk(QSL("chkMailmark2DRectangle"))->isChecked()) {
m_bc.bc.setOption3(DM_SQUARE);
}
} else {
m_optionWidget->findChild<QLabel*>(QSL("lblMailmark2DAutoSize"))->setEnabled(false);
m_optionWidget->findChild<QCheckBox*>(QSL("chkMailmark2DRectangle"))->setEnabled(false);
get_lbl(QSL("lblMailmark2DAutoSize"))->setEnabled(false);
get_chk(QSL("chkMailmark2DRectangle"))->setEnabled(false);
m_bc.bc.setOption3(0);
}
@@ -3272,7 +3297,7 @@ void MainWindow::update_preview()
m_bc.bc.setPrimaryMessage(QString::asprintf("%s%03d%03d",
get_txt_val(QSL("txtMaxiSCMPostcode")).toUtf8().constData(),
get_spn_val(QSL("spnMaxiSCMCountry")), get_spn_val(QSL("spnMaxiSCMService"))));
QCheckBox *chkMaxiSCMVV = m_optionWidget->findChild<QCheckBox*>(QSL("chkMaxiSCMVV"));
QCheckBox *chkMaxiSCMVV = get_chk(QSL("chkMaxiSCMVV"));
if (chkMaxiSCMVV && chkMaxiSCMVV->isEnabled() && chkMaxiSCMVV->isChecked()) {
m_bc.bc.setOption2(get_spn_val(QSL("spnMaxiSCMVV")) + 1);
}
@@ -3301,9 +3326,9 @@ void MainWindow::update_preview()
eci_not_set = false;
cmbECI->setEnabled(false);
lblECI->setEnabled(false);
m_optionWidget->findChild<QRadioButton*>(QSL("radC1GS1"))->setEnabled(false);
get_rad(QSL("radC1GS1"))->setEnabled(false);
} else {
m_optionWidget->findChild<QRadioButton*>(QSL("radC1GS1"))->setEnabled(true);
get_rad(QSL("radC1GS1"))->setEnabled(true);
set_gs1_mode(get_rad_val(QSL("radC1GS1")));
}
if (get_cmb_index(QSL("cmbC1Size")) != 9 && (item_val = get_spn_val(QSL("spnC1StructAppCount"))) > 1) {
@@ -3697,7 +3722,7 @@ void MainWindow::automatic_info_set()
}
if (symbology == BARCODE_AZTEC || symbology == BARCODE_HIBC_AZTEC) {
if ((txt = m_optionWidget->findChild<QLineEdit*>(QSL("txtAztecAutoInfo")))) {
if ((txt = get_txt(QSL("txtAztecAutoInfo")))) {
if (!isError) {
const int z = m_bc.bc.encodedOption2();
const int ecc = m_bc.bc.encodedOption1() >> 8; // Percentage
@@ -3731,7 +3756,7 @@ void MainWindow::automatic_info_set()
}
} else if (symbology == BARCODE_CHANNEL) {
if ((cmb = m_optionWidget->findChild<QComboBox*>(QSL("cmbChannel")))) {
if ((cmb = get_cmb(QSL("cmbChannel")))) {
if (!isError && cmb->currentIndex() == 0 && (opt = m_bc.bc.encodedOption2()) >= 3 && opt <= 8) {
cmb->setItemText(0, QSL("Automatic %1").arg(opt));
} else {
@@ -3740,14 +3765,14 @@ void MainWindow::automatic_info_set()
}
} else if (symbology == BARCODE_CODABLOCKF || symbology == BARCODE_HIBC_BLOCKF) {
if ((cmb = m_optionWidget->findChild<QComboBox*>(QSL("cmbCbfWidth")))) {
if ((cmb = get_cmb(QSL("cmbCbfWidth")))) {
if (!isError && cmb->currentIndex() == 0 && (opt = m_bc.bc.encodedOption2()) >= 9 && opt <= 67) {
cmb->setItemText(0, QSL("Automatic %1 (%2 data)").arg(opt).arg(opt - 5));
} else {
cmb->setItemText(0, QSL("Automatic"));
}
}
if ((cmb = m_optionWidget->findChild<QComboBox*>(QSL("cmbCbfHeight")))) {
if ((cmb = get_cmb(QSL("cmbCbfHeight")))) {
if (!isError && cmb->currentIndex() == 0 && (opt = m_bc.bc.encodedOption1()) >= 1 && opt <= 44) {
cmb->setItemText(0, QSL("Automatic %1").arg(opt));
} else {
@@ -3756,7 +3781,7 @@ void MainWindow::automatic_info_set()
}
} else if (symbology == BARCODE_CODE16K) {
if ((cmb = m_optionWidget->findChild<QComboBox*>(QSL("cmbC16kRows")))) {
if ((cmb = get_cmb(QSL("cmbC16kRows")))) {
if (!isError && cmb->currentIndex() == 0 && (opt = m_bc.bc.encodedOption1()) >= 2 && opt <= 16) {
cmb->setItemText(0, QSL("Automatic %1").arg(opt));
} else {
@@ -3765,7 +3790,7 @@ void MainWindow::automatic_info_set()
}
} else if (symbology == BARCODE_CODE49) {
if ((cmb = m_optionWidget->findChild<QComboBox*>(QSL("cmbC49Rows")))) {
if ((cmb = get_cmb(QSL("cmbC49Rows")))) {
if (!isError && cmb->currentIndex() == 0 && (opt = m_bc.bc.encodedOption1()) >= 2 && opt <= 8) {
cmb->setItemText(0, QSL("Automatic %1").arg(opt));
} else {
@@ -3774,7 +3799,7 @@ void MainWindow::automatic_info_set()
}
} else if (symbology == BARCODE_CODEONE) {
if ((cmb = m_optionWidget->findChild<QComboBox*>(QSL("cmbC1Size")))) {
if ((cmb = get_cmb(QSL("cmbC1Size")))) {
if (!isError && cmb->currentIndex() == 0 && (opt = m_bc.bc.encodedOption2()) >= 1 && opt <= 8) {
const int r = m_bc.bc.encodedRows();
const int w = m_bc.bc.encodedWidth();
@@ -3788,7 +3813,7 @@ void MainWindow::automatic_info_set()
}
} else if (symbology == BARCODE_DATAMATRIX || symbology == BARCODE_HIBC_DM) {
if ((cmb = m_optionWidget->findChild<QComboBox*>(QSL("cmbDM200Size")))) {
if ((cmb = get_cmb(QSL("cmbDMSize")))) {
if (!isError && cmb->currentIndex() == 0 && (opt = m_bc.bc.encodedOption2()) >= 1 && opt <= 48) {
const int r = m_bc.bc.encodedRows();
const int w = m_bc.bc.encodedWidth();
@@ -3803,7 +3828,7 @@ void MainWindow::automatic_info_set()
}
} else if (symbology == BARCODE_DBAR_EXPSTK) {
if ((cmb = m_optionWidget->findChild<QComboBox*>(QSL("cmbDBESCols")))) {
if ((cmb = get_cmb(QSL("cmbDBESCols")))) {
if (!isError && cmb->currentIndex() == 0 && (opt = m_bc.bc.encodedOption2()) >= 1 && opt <= 11) {
cmb->setItemText(0, QSL("Automatic %1 (%2 segments)").arg(opt).arg(opt * 2));
} else {
@@ -3812,7 +3837,7 @@ void MainWindow::automatic_info_set()
}
} else if (symbology == BARCODE_MAILMARK_2D) {
if ((cmb = m_optionWidget->findChild<QComboBox*>(QSL("cmbMailmark2DSize")))) {
if ((cmb = get_cmb(QSL("cmbMailmark2DSize")))) {
if (!isError && cmb->currentIndex() == 0 && (opt = m_bc.bc.encodedOption2())
&& (opt == 8 || opt == 10 || opt == 30)) {
const int r = m_bc.bc.encodedRows();
@@ -3824,21 +3849,21 @@ void MainWindow::automatic_info_set()
}
} else if (symbology == BARCODE_DOTCODE) {
if ((cmb = m_optionWidget->findChild<QComboBox*>(QSL("cmbDotCols")))) {
if ((cmb = get_cmb(QSL("cmbDotCols")))) {
if (!isError && cmb->currentIndex() == 0 && (opt = m_bc.bc.encodedOption2()) >= 5 && opt <= 200) {
cmb->setItemText(0, QSL("Automatic %1").arg(opt));
} else {
cmb->setItemText(0, QSL("Automatic"));
}
}
if ((lbl = m_optionWidget->findChild<QLabel*>(QSL("lblDotSizeMsg")))) {
if ((lbl = get_lbl(QSL("lblDotSizeMsg")))) {
if (!isError) {
lbl->setText(QSL("%1x%2 (HxW)").arg(m_bc.bc.encodedRows()).arg(m_bc.bc.encodedWidth()));
} else {
lbl->setText(QSEmpty);
}
}
if ((cmb = m_optionWidget->findChild<QComboBox*>(QSL("cmbDotMask")))) {
if ((cmb = get_cmb(QSL("cmbDotMask")))) {
if (!isError && cmb->currentIndex() == 0 && (opt = (m_bc.bc.encodedOption3() >> 8)) >= 1 && opt <= 8) {
QString mask = QString::number((opt - 1) & 0x3);
if (opt > 4) {
@@ -3851,7 +3876,7 @@ void MainWindow::automatic_info_set()
}
} else if (symbology == BARCODE_GRIDMATRIX) {
if ((cmb = m_optionWidget->findChild<QComboBox*>(QSL("cmbGridSize")))) {
if ((cmb = get_cmb(QSL("cmbGridSize")))) {
if (!isError && cmb->currentIndex() == 0 && (opt = m_bc.bc.encodedOption2()) >= 1 && opt <= 13) {
const int r = m_bc.bc.encodedRows();
cmb->setItemText(0, QSL("Automatic %1 x %2 (Version %3)").arg(r).arg(r).arg(opt));
@@ -3859,7 +3884,7 @@ void MainWindow::automatic_info_set()
cmb->setItemText(0, QSL("Automatic"));
}
}
if ((cmb = m_optionWidget->findChild<QComboBox*>(QSL("cmbGridECC")))) {
if ((cmb = get_cmb(QSL("cmbGridECC")))) {
if (!isError && cmb->currentIndex() == 0 && (opt = m_bc.bc.encodedOption1()) >= 1 && opt <= 5) {
cmb->setItemText(0, QSL("Automatic ~%1%").arg(opt * 10));
} else {
@@ -3868,7 +3893,7 @@ void MainWindow::automatic_info_set()
}
} else if (symbology == BARCODE_HANXIN) {
if ((cmb = m_optionWidget->findChild<QComboBox*>(QSL("cmbHXSize")))) {
if ((cmb = get_cmb(QSL("cmbHXSize")))) {
if (!isError && cmb->currentIndex() == 0 && (opt = m_bc.bc.encodedOption2()) >= 1 && opt <= 84) {
const int r = m_bc.bc.encodedRows();
cmb->setItemText(0, QSL("Automatic %1 x %2 (Version %3)").arg(r).arg(r).arg(opt));
@@ -3876,7 +3901,7 @@ void MainWindow::automatic_info_set()
cmb->setItemText(0, QSL("Automatic"));
}
}
if ((cmb = m_optionWidget->findChild<QComboBox*>(QSL("cmbHXECC")))) {
if ((cmb = get_cmb(QSL("cmbHXECC")))) {
if (!isError && cmb->currentIndex() == 0 && (opt = m_bc.bc.encodedOption1()) >= 1 && opt <= 4) {
static const char *eccPercents[4] = { "~8%", "~15%", "~23%", "~30%" };
cmb->setItemText(0, QSL("Automatic %1 (Level L%2)").arg(eccPercents[opt - 1]).arg(opt));
@@ -3884,7 +3909,7 @@ void MainWindow::automatic_info_set()
cmb->setItemText(0, QSL("Automatic"));
}
}
if ((cmb = m_optionWidget->findChild<QComboBox*>(QSL("cmbHXMask")))) {
if ((cmb = get_cmb(QSL("cmbHXMask")))) {
if (!isError && cmb->currentIndex() == 0 && (opt = (m_bc.bc.encodedOption3() >> 8)) >= 1 && opt <= 4) {
cmb->setItemText(0, QSL("Automatic %1").arg(opt - 1));
} else {
@@ -3893,14 +3918,14 @@ void MainWindow::automatic_info_set()
}
} else if (symbology == BARCODE_MICROPDF417 || symbology == BARCODE_HIBC_MICPDF) {
if ((cmb = m_optionWidget->findChild<QComboBox*>(QSL("cmbMPDFCols")))) {
if ((cmb = get_cmb(QSL("cmbMPDFCols")))) {
if (!isError && cmb->currentIndex() == 0 && (opt = m_bc.bc.encodedOption2()) >= 1 && opt <= 4) {
cmb->setItemText(0, QSL("Automatic %1").arg(opt));
} else {
cmb->setItemText(0, QSL("Automatic"));
}
}
if ((lbl = m_optionWidget->findChild<QLabel*>(QSL("lblMPDFECCMsg")))) {
if ((lbl = get_lbl(QSL("lblMPDFECCMsg")))) {
if (!isError && (opt = (m_bc.bc.encodedOption1() >> 8)) >= 0 && opt <= 99) {
lbl->setText(QSL("%1%").arg(opt));
} else {
@@ -3909,7 +3934,7 @@ void MainWindow::automatic_info_set()
}
} else if (symbology == BARCODE_MICROQR) {
if ((cmb = m_optionWidget->findChild<QComboBox*>(QSL("cmbMQRSize")))) {
if ((cmb = get_cmb(QSL("cmbMQRSize")))) {
if (!isError && cmb->currentIndex() == 0 && (opt = m_bc.bc.encodedOption2()) >= 1 && opt <= 4) {
const int r = m_bc.bc.encodedRows();
cmb->setItemText(0, QSL("Automatic %1 x %2 (M%3)").arg(r).arg(r).arg(opt));
@@ -3917,14 +3942,14 @@ void MainWindow::automatic_info_set()
cmb->setItemText(0, QSL("Automatic"));
}
}
if ((cmb = m_optionWidget->findChild<QComboBox*>(QSL("cmbMQRECC")))) {
if ((cmb = get_cmb(QSL("cmbMQRECC")))) {
if (!isError && cmb->currentIndex() == 0 && (opt = m_bc.bc.encodedOption1()) >= 1 && opt <= 3) {
cmb->setItemText(0, QSL("Automatic %1 (Level %2)").arg(qrECCPercents[opt - 1]).arg(qrECCs[opt - 1]));
} else {
cmb->setItemText(0, QSL("Automatic"));
}
}
if ((cmb = m_optionWidget->findChild<QComboBox*>(QSL("cmbMQRMask")))) {
if ((cmb = get_cmb(QSL("cmbMQRMask")))) {
if (!isError && cmb->currentIndex() == 0 && (opt = (m_bc.bc.encodedOption3() >> 8)) >= 1 && opt <= 4) {
cmb->setItemText(0, QSL("Automatic %1").arg(opt - 1));
} else {
@@ -3933,21 +3958,21 @@ void MainWindow::automatic_info_set()
}
} else if (symbology == BARCODE_PDF417 || symbology == BARCODE_PDF417COMP || symbology == BARCODE_HIBC_PDF) {
if ((cmb = m_optionWidget->findChild<QComboBox*>(QSL("cmbPDFCols")))) {
if ((cmb = get_cmb(QSL("cmbPDFCols")))) {
if (!isError && cmb->currentIndex() == 0 && (opt = m_bc.bc.encodedOption2()) >= 1 && opt <= 30) {
cmb->setItemText(0, QSL("Automatic %1").arg(opt));
} else {
cmb->setItemText(0, QSL("Automatic"));
}
}
if ((cmb = m_optionWidget->findChild<QComboBox*>(QSL("cmbPDFRows")))) {
if ((cmb = get_cmb(QSL("cmbPDFRows")))) {
if (!isError && cmb->currentIndex() == 0 && (opt = m_bc.bc.encodedRows()) >= 3 && opt <= 90) {
cmb->setItemText(0, QSL("Automatic %1").arg(opt));
} else {
cmb->setItemText(0, QSL("Automatic"));
}
}
if ((cmb = m_optionWidget->findChild<QComboBox*>(QSL("cmbPDFECC")))) {
if ((cmb = get_cmb(QSL("cmbPDFECC")))) {
if (!isError && cmb->currentIndex() == 0 && (opt = m_bc.bc.encodedOption1()) >= 0 && opt <= 8) {
cmb->setItemText(0, QSL("Automatic %1 (%2 words)").arg(opt).arg(2 << opt));
} else {
@@ -3956,7 +3981,7 @@ void MainWindow::automatic_info_set()
}
} else if (symbology == BARCODE_QRCODE || symbology == BARCODE_HIBC_QR) {
if ((cmb = m_optionWidget->findChild<QComboBox*>(QSL("cmbQRSize")))) {
if ((cmb = get_cmb(QSL("cmbQRSize")))) {
if (!isError && cmb->currentIndex() == 0 && (opt = m_bc.bc.encodedOption2()) >= 1 && opt <= 40) {
const int r = m_bc.bc.encodedRows();
cmb->setItemText(0, QSL("Automatic %1 x %2 (Version %3)").arg(r).arg(r).arg(opt));
@@ -3964,14 +3989,14 @@ void MainWindow::automatic_info_set()
cmb->setItemText(0, QSL("Automatic"));
}
}
if ((cmb = m_optionWidget->findChild<QComboBox*>(QSL("cmbQRECC")))) {
if ((cmb = get_cmb(QSL("cmbQRECC")))) {
if (!isError && cmb->currentIndex() == 0 && (opt = m_bc.bc.encodedOption1()) >= 1 && opt <= 4) {
cmb->setItemText(0, QSL("Automatic %1 (Level %2)").arg(qrECCPercents[opt - 1]).arg(qrECCs[opt - 1]));
} else {
cmb->setItemText(0, QSL("Automatic"));
}
}
if ((cmb = m_optionWidget->findChild<QComboBox*>(QSL("cmbQRMask")))) {
if ((cmb = get_cmb(QSL("cmbQRMask")))) {
if (!isError && cmb->currentIndex() == 0 && (opt = (m_bc.bc.encodedOption3() >> 8)) >= 1 && opt <= 8) {
cmb->setItemText(0, QSL("Automatic %1").arg(opt - 1));
} else {
@@ -3980,7 +4005,7 @@ void MainWindow::automatic_info_set()
}
} else if (symbology == BARCODE_RMQR) {
if ((cmb = m_optionWidget->findChild<QComboBox*>(QSL("cmbRMQRSize")))) {
if ((cmb = get_cmb(QSL("cmbRMQRSize")))) {
if (!isError && cmb->currentIndex() == 0 && (opt = m_bc.bc.encodedOption2()) >= 1 && opt <= 38) {
const int r = m_bc.bc.encodedRows();
const int w = m_bc.bc.encodedWidth();
@@ -3989,7 +4014,7 @@ void MainWindow::automatic_info_set()
cmb->setItemText(0, QSL("Automatic"));
}
}
if ((cmb = m_optionWidget->findChild<QComboBox*>(QSL("cmbRMQRECC")))) {
if ((cmb = get_cmb(QSL("cmbRMQRECC")))) {
if (!isError && cmb->currentIndex() == 0 && (opt = m_bc.bc.encodedOption1()) && (opt == 2 || opt == 4)) {
cmb->setItemText(0, QSL("Automatic %1 (Level %2)").arg(qrECCPercents[opt - 1]).arg(qrECCs[opt - 1]));
} else {
@@ -3998,7 +4023,7 @@ void MainWindow::automatic_info_set()
}
} else if (symbology == BARCODE_ULTRA) {
if ((txt = m_optionWidget->findChild<QLineEdit*>(QSL("txtUltraAutoInfo")))) {
if ((txt = get_txt(QSL("txtUltraAutoInfo")))) {
if (!isError) {
static const QString eccStrs[6] = {
"Error Detection Only", "Approx 5%", "Approx 9%", "Approx 17%", "Approx 25%", "Approx 33%"
@@ -4021,7 +4046,7 @@ void MainWindow::automatic_info_set()
}
} else if (symbology == BARCODE_UPNQR) {
if ((cmb = m_optionWidget->findChild<QComboBox*>(QSL("cmbUPNQRMask")))) {
if ((cmb = get_cmb(QSL("cmbUPNQRMask")))) {
if (!isError && cmb->currentIndex() == 0 && (opt = (m_bc.bc.encodedOption3() >> 8)) >= 1 && opt <= 8) {
cmb->setItemText(0, QSL("Automatic %1").arg(opt - 1));
} else {
@@ -4050,6 +4075,60 @@ QWidget *MainWindow::get_widget(const QString &name)
return m_optionWidget ? m_optionWidget->findChild<QWidget*>(name) : nullptr;
}
/* Shorthand to find pushbutton child */
QPushButton *MainWindow::get_btn(const QString &name)
{
return m_optionWidget ? m_optionWidget->findChild<QPushButton*>(name) : nullptr;
}
/* Shorthand to find checkbox child */
QCheckBox *MainWindow::get_chk(const QString &name)
{
return m_optionWidget ? m_optionWidget->findChild<QCheckBox*>(name) : nullptr;
}
/* Shorthand to find combobox child */
QComboBox *MainWindow::get_cmb(const QString &name)
{
return m_optionWidget ? m_optionWidget->findChild<QComboBox*>(name) : nullptr;
}
/* Shorthand to find doublespinbox child */
QDoubleSpinBox *MainWindow::get_dspn(const QString &name)
{
return m_optionWidget ? m_optionWidget->findChild<QDoubleSpinBox*>(name) : nullptr;
}
/* Shorthand to find groupbox child */
QGroupBox *MainWindow::get_groupBox(const QString &name)
{
return m_optionWidget ? m_optionWidget->findChild<QGroupBox*>(name) : nullptr;
}
/* Shorthand to find label child */
QLabel *MainWindow::get_lbl(const QString &name)
{
return m_optionWidget ? m_optionWidget->findChild<QLabel*>(name) : nullptr;
}
/* Shorthand to find radiobutton child */
QRadioButton *MainWindow::get_rad(const QString &name)
{
return m_optionWidget ? m_optionWidget->findChild<QRadioButton*>(name) : nullptr;
}
/* Shorthand to find spinbox child */
QSpinBox *MainWindow::get_spn(const QString &name)
{
return m_optionWidget ? m_optionWidget->findChild<QSpinBox*>(name) : nullptr;
}
/* Shorthand to find spinbox child */
QLineEdit *MainWindow::get_txt(const QString &name)
{
return m_optionWidget ? m_optionWidget->findChild<QLineEdit*>(name) : nullptr;
}
/* Return settings subsection name for a symbol */
QString MainWindow::get_setting_name(int symbology)
{
@@ -4124,7 +4203,7 @@ int MainWindow::get_rad_grp_index(const QStringList &names)
if (m_optionWidget) {
QRadioButton *radioButton;
for (int index = 0; index < names.size(); index++) {
radioButton = m_optionWidget->findChild<QRadioButton*>(names[index]);
radioButton = get_rad(names[index]);
if (radioButton && radioButton->isChecked()) {
return index;
}
@@ -4141,9 +4220,9 @@ void MainWindow::set_rad_from_setting(QSettings &settings, const QString &settin
int index = settings.value(setting, default_val).toInt();
QRadioButton *radioButton;
if (index >= 0 && index < names.size()) {
radioButton = m_optionWidget->findChild<QRadioButton*>(names[index]);
radioButton = get_rad(names[index]);
} else {
radioButton = m_optionWidget->findChild<QRadioButton*>(names[0]);
radioButton = get_rad(names[0]);
}
if (radioButton) {
radioButton->setChecked(true);
@@ -4154,21 +4233,21 @@ void MainWindow::set_rad_from_setting(QSettings &settings, const QString &settin
/* Helper to see if radio button checked, checking for NULL and whether enabled */
bool MainWindow::get_rad_val(const QString &name)
{
QRadioButton *radioButton = m_optionWidget ? m_optionWidget->findChild<QRadioButton*>(name) : nullptr;
QRadioButton *radioButton = get_rad(name);
return radioButton && radioButton->isEnabled() && radioButton->isChecked();
}
/* Helper to return index of selected item in combobox, checking for NULL */
int MainWindow::get_cmb_index(const QString &name)
{
QComboBox *comboBox = m_optionWidget ? m_optionWidget->findChild<QComboBox*>(name) : nullptr;
QComboBox *comboBox = get_cmb(name);
return comboBox ? comboBox->currentIndex() : 0;
}
/* Helper to set item in combobox from index in settings, checking for NULL */
void MainWindow::set_cmb_index(const QString &name, const int index)
{
QComboBox *comboBox = m_optionWidget ? m_optionWidget->findChild<QComboBox*>(name) : nullptr;
QComboBox *comboBox = get_cmb(name);
if (comboBox) {
comboBox->setCurrentIndex(index);
}
@@ -4178,7 +4257,7 @@ void MainWindow::set_cmb_index(const QString &name, const int index)
void MainWindow::set_cmb_from_setting(QSettings &settings, const QString &setting, const QString &name,
int default_val)
{
QComboBox *comboBox = m_optionWidget ? m_optionWidget->findChild<QComboBox*>(name) : nullptr;
QComboBox *comboBox = get_cmb(name);
if (comboBox) {
comboBox->setCurrentIndex(settings.value(setting, default_val).toInt());
}
@@ -4187,7 +4266,7 @@ void MainWindow::set_cmb_from_setting(QSettings &settings, const QString &settin
/* Helper to return if checkbox checked, checking for NULL */
int MainWindow::get_chk_val(const QString &name)
{
QCheckBox *checkBox = m_optionWidget ? m_optionWidget->findChild<QCheckBox*>(name) : nullptr;
QCheckBox *checkBox = get_chk(name);
return checkBox && checkBox->isChecked() ? 1 : 0;
}
@@ -4195,7 +4274,7 @@ int MainWindow::get_chk_val(const QString &name)
void MainWindow::set_chk_from_setting(QSettings &settings, const QString &setting, const QString &name,
int default_val)
{
QCheckBox *checkBox = m_optionWidget ? m_optionWidget->findChild<QCheckBox*>(name) : nullptr;
QCheckBox *checkBox = get_chk(name);
if (checkBox) {
checkBox->setChecked(settings.value(setting, default_val).toInt() ? true : false);
}
@@ -4204,7 +4283,7 @@ void MainWindow::set_chk_from_setting(QSettings &settings, const QString &settin
/* Helper to return value of double spinner, checking for NULL */
double MainWindow::get_dspn_val(const QString &name)
{
QDoubleSpinBox *spinBox = m_optionWidget->findChild<QDoubleSpinBox*>(name);
QDoubleSpinBox *spinBox = get_dspn(name);
return spinBox ? spinBox->value() : 0.0;
}
@@ -4212,7 +4291,7 @@ double MainWindow::get_dspn_val(const QString &name)
void MainWindow::set_dspn_from_setting(QSettings &settings, const QString &setting, const QString &name,
float default_val)
{
QDoubleSpinBox *spinBox = m_optionWidget->findChild<QDoubleSpinBox*>(name);
QDoubleSpinBox *spinBox = get_dspn(name);
if (spinBox) {
spinBox->setValue(settings.value(setting, default_val).toFloat());
}
@@ -4221,7 +4300,7 @@ void MainWindow::set_dspn_from_setting(QSettings &settings, const QString &setti
/* Helper to return text of line edit, checking for NULL */
QString MainWindow::get_txt_val(const QString &name)
{
QLineEdit *lineEdit = m_optionWidget ? m_optionWidget->findChild<QLineEdit*>(name) : nullptr;
QLineEdit *lineEdit = get_txt(name);
return lineEdit ? lineEdit->text() : QSEmpty;
}
@@ -4229,7 +4308,7 @@ QString MainWindow::get_txt_val(const QString &name)
void MainWindow::set_txt_from_setting(QSettings &settings, const QString &setting, const QString &name,
const QString &default_val)
{
QLineEdit *lineEdit = m_optionWidget ? m_optionWidget->findChild<QLineEdit*>(name) : nullptr;
QLineEdit *lineEdit = get_txt(name);
if (lineEdit) {
lineEdit->setText(settings.value(setting, default_val).toString());
}
@@ -4238,7 +4317,7 @@ void MainWindow::set_txt_from_setting(QSettings &settings, const QString &settin
/* Helper to return value of spin box, checking for NULL */
int MainWindow::get_spn_val(const QString &name)
{
QSpinBox *spinBox = m_optionWidget ? m_optionWidget->findChild<QSpinBox*>(name) : nullptr;
QSpinBox *spinBox = get_spn(name);
return spinBox ? spinBox->value() : 0;
}
@@ -4246,7 +4325,7 @@ int MainWindow::get_spn_val(const QString &name)
void MainWindow::set_spn_from_setting(QSettings &settings, const QString &setting, const QString &name,
int default_val)
{
QSpinBox *spinBox = m_optionWidget ? m_optionWidget->findChild<QSpinBox*>(name) : nullptr;
QSpinBox *spinBox = get_spn(name);
if (spinBox) {
spinBox->setValue(settings.value(setting, default_val).toInt());
}
@@ -4465,12 +4544,14 @@ void MainWindow::save_sub_settings(QSettings &settings, int symbology)
case BARCODE_DATAMATRIX:
case BARCODE_HIBC_DM:
settings.setValue(QSL("studio/bc/datamatrix/size"), get_cmb_index(QSL("cmbDM200Size")));
settings.setValue(QSL("studio/bc/datamatrix/size"), get_cmb_index(QSL("cmbDMSize")));
settings.setValue(QSL("studio/bc/datamatrix/encoding_mode"), get_rad_grp_index(
QStringList() << QSL("radDM200Stand") << QSL("radDM200GS1") << QSL("radDM200HIBC")));
QStringList() << QSL("radDMStand") << QSL("radDMGS1") << QSL("radDMHIBC")));
settings.setValue(QSL("studio/bc/datamatrix/chk_suppress_rect"), get_chk_val(QSL("chkDMRectangle")));
settings.setValue(QSL("studio/bc/datamatrix/chk_allow_dmre"), get_chk_val(QSL("chkDMRE")));
settings.setValue(QSL("studio/bc/datamatrix/chk_gs_sep"), get_chk_val(QSL("chkDMGSSep")));
settings.setValue(QSL("studio/bc/datamatrix/startmode"), get_cmb_index(QSL("cmbDMStartMode")));
settings.setValue(QSL("studio/bc/datamatrix/startmodelength"), get_spn_val(QSL("spnDMStartModeLength")));
settings.setValue(QSL("studio/bc/datamatrix/iso_144"), get_chk_val(QSL("chkDMISO144")));
settings.setValue(QSL("studio/bc/datamatrix/chk_fast"), get_chk_val(QSL("chkDMFast")));
settings.setValue(QSL("studio/bc/datamatrix/structapp_count"), get_cmb_index(QSL("cmbDMStructAppCount")));
@@ -4499,7 +4580,7 @@ void MainWindow::save_sub_settings(QSettings &settings, int symbology)
settings.setValue(QSL("studio/bc/qrcode/ecc"), get_cmb_index(QSL("cmbQRECC")));
settings.setValue(QSL("studio/bc/qrcode/mask"), get_cmb_index(QSL("cmbQRMask")));
settings.setValue(QSL("studio/bc/qrcode/encoding_mode"), get_rad_grp_index(
QStringList() << QSL("radDM200Stand") << QSL("radQRGS1") << QSL("radQRHIBC")));
QStringList() << QSL("radQRStand") << QSL("radQRGS1") << QSL("radQRHIBC")));
settings.setValue(QSL("studio/bc/qrcode/chk_full_multibyte"), get_chk_val(QSL("chkQRFullMultibyte")));
settings.setValue(QSL("studio/bc/qrcode/chk_fast_mode"), get_chk_val(QSL("chkQRFast")));
settings.setValue(QSL("studio/bc/qrcode/structapp_count"), get_cmb_index(QSL("cmbQRStructAppCount")));
@@ -4516,7 +4597,7 @@ void MainWindow::save_sub_settings(QSettings &settings, int symbology)
settings.setValue(QSL("studio/bc/rmqr/size"), get_cmb_index(QSL("cmbRMQRSize")));
settings.setValue(QSL("studio/bc/rmqr/ecc"), get_cmb_index(QSL("cmbRMQRECC")));
settings.setValue(QSL("studio/bc/rmqr/encoding_mode"), get_rad_grp_index(
QStringList() << QSL("radQRStand") << QSL("radRMQRGS1")));
QStringList() << QSL("radRMQRStand") << QSL("radRMQRGS1")));
settings.setValue(QSL("studio/bc/rmqr/chk_full_multibyte"), get_chk_val(QSL("chkRMQRFullMultibyte")));
break;
@@ -4941,12 +5022,14 @@ void MainWindow::load_sub_settings(QSettings &settings, int symbology)
case BARCODE_DATAMATRIX:
case BARCODE_HIBC_DM:
set_cmb_from_setting(settings, QSL("studio/bc/datamatrix/size"), QSL("cmbDM200Size"));
set_cmb_from_setting(settings, QSL("studio/bc/datamatrix/size"), QSL("cmbDMSize"));
set_rad_from_setting(settings, QSL("studio/bc/datamatrix/encoding_mode"),
QStringList() << QSL("radDM200Stand") << QSL("radDM200GS1") << QSL("radDM200HIBC"));
QStringList() << QSL("radDMStand") << QSL("radDMGS1") << QSL("radDMHIBC"));
set_chk_from_setting(settings, QSL("studio/bc/datamatrix/chk_suppress_rect"), QSL("chkDMRectangle"));
set_chk_from_setting(settings, QSL("studio/bc/datamatrix/chk_allow_dmre"), QSL("chkDMRE"));
set_chk_from_setting(settings, QSL("studio/bc/datamatrix/chk_gs_sep"), QSL("chkDMGSSep"));
set_cmb_from_setting(settings, QSL("studio/bc/datamatrix/startmode"), QSL("cmbDMStartMode"));
set_spn_from_setting(settings, QSL("studio/bc/datamatrix/startmodelength"), QSL("spnDMStartModeLength"), 0);
set_chk_from_setting(settings, QSL("studio/bc/datamatrix/iso_144"), QSL("chkDMISO144"));
set_chk_from_setting(settings, QSL("studio/bc/datamatrix/chk_fast"), QSL("chkDMFast"));
set_cmb_from_setting(settings, QSL("studio/bc/datamatrix/structapp_count"), QSL("cmbDMStructAppCount"));
@@ -4975,7 +5058,7 @@ void MainWindow::load_sub_settings(QSettings &settings, int symbology)
set_cmb_from_setting(settings, QSL("studio/bc/qrcode/ecc"), QSL("cmbQRECC"));
set_cmb_from_setting(settings, QSL("studio/bc/qrcode/mask"), QSL("cmbQRMask"));
set_rad_from_setting(settings, QSL("studio/bc/qrcode/encoding_mode"),
QStringList() << QSL("radDM200Stand") << QSL("radQRGS1") << QSL("radQRHIBC"));
QStringList() << QSL("radQRStand") << QSL("radQRGS1") << QSL("radQRHIBC"));
set_chk_from_setting(settings, QSL("studio/bc/qrcode/chk_full_multibyte"), QSL("chkQRFullMultibyte"));
set_chk_from_setting(settings, QSL("studio/bc/qrcode/chk_fast_mode"), QSL("chkQRFast"));
set_cmb_from_setting(settings, QSL("studio/bc/qrcode/structapp_count"), QSL("cmbQRStructAppCount"));
@@ -4992,7 +5075,7 @@ void MainWindow::load_sub_settings(QSettings &settings, int symbology)
set_cmb_from_setting(settings, QSL("studio/bc/rmqr/size"), QSL("cmbRMQRSize"));
set_cmb_from_setting(settings, QSL("studio/bc/rmqr/ecc"), QSL("cmbRMQRECC"));
set_rad_from_setting(settings, QSL("studio/bc/rmqr/encoding_mode"),
QStringList() << QSL("radQRStand") << QSL("radRMQRGS1"));
QStringList() << QSL("radRMQRStand") << QSL("radRMQRGS1"));
set_chk_from_setting(settings, QSL("studio/bc/rmqr/chk_full_multibyte"), QSL("chkRMQRFullMultibyte"));
break;
+14 -2
View File
@@ -24,10 +24,11 @@
#include <QGraphicsScene>
#include <QSettings>
class QLabel;
class QShortcut;
class QDoubleSpinBox;
class QPushButton;
class QRadioButton;
class QShortcut;
class QSpinBox;
class QToolButton;
#include "ui_mainWindow.h"
@@ -77,6 +78,7 @@ public slots:
void eanaddon_no_quiet_zones_ui_set();
void aztec_size_index_changed();
void aztec_ecc_index_changed();
void dm_startmode_ui_set();
void structapp_ui_set();
void clear_text_gap();
void on_encoded();
@@ -177,6 +179,16 @@ protected:
QWidget *get_widget(const QString &name);
QPushButton *get_btn(const QString &name);
QCheckBox *get_chk(const QString &name);
QComboBox *get_cmb(const QString &name);
QGroupBox *get_groupBox(const QString &name);
QLabel *get_lbl(const QString &name);
QRadioButton *get_rad(const QString &name);
QDoubleSpinBox *get_dspn(const QString &name);
QSpinBox *get_spn(const QString &name);
QLineEdit *get_txt(const QString &name);
static QString get_setting_name(int symbology);
int get_rad_grp_index(const QStringList &names);