mirror of
https://github.com/zint/zint
synced 2024-11-16 20:57:25 +13:00
Add compliant height, using ZINT_COMPLIANT_HEIGHT flag for back-compatibility
Rename barcode funcs to same as BARCODE_XXX name library: barcode funcs array for dispatch, used for ZBarcode_ValidID() also general: change is_sane() comparison to nonzero from ZINT_ERROR_INVALID_OPTION MAILMARK: fuller error messages CODABAR: add option to show check character in HRT zint.h: use 0xNNNN for OR-able defines GUI: add guard descent height reset button, add Zint version to window title, static get_zint_version() method, use QStringLiteral (QSL shorthand), use SIGNAL(toggled()), add errtxt "popup" and status bar, add icons, add saveAs shortcut, add main menu, context menus and actions, add help, reset_view() -> reset_colours(), add copy to clipboard as EMF/GIF/PNG/TIF, lessen triggering of update_preview(), shorten names of getters/setters, simplify/shorten some update_preview() logic in switch, CODEONE disable structapp for Version S qzint.cpp: add on_errored signal, add missing getters, add test
This commit is contained in:
@ -127,6 +127,7 @@ static void usage(void) {
|
||||
" --box Add a box around the symbol\n"
|
||||
" --cmyk Use CMYK colour space in EPS/TIF symbols\n"
|
||||
" --cols=NUMBER Set the number of data columns in symbol\n"
|
||||
" --compliantheight Warn if height not compliant, and use standard default\n"
|
||||
" -d, --data=DATA Set the symbol content\n"
|
||||
" --direct Send output to stdout\n"
|
||||
" --dmre Allow Data Matrix Rectangular Extended\n"
|
||||
@ -856,8 +857,8 @@ int main(int argc, char **argv) {
|
||||
|
||||
while (no_getopt_error) {
|
||||
enum options {
|
||||
OPT_ADDONGAP = 128, OPT_BATCH, OPT_BINARY, OPT_BG, OPT_BIND, OPT_BOLD, OPT_BORDER,
|
||||
OPT_BOX, OPT_CMYK, OPT_COLS, OPT_DIRECT, OPT_DMRE, OPT_DOTSIZE, OPT_DOTTY, OPT_DUMP,
|
||||
OPT_ADDONGAP = 128, OPT_BATCH, OPT_BINARY, OPT_BG, OPT_BIND, OPT_BOLD, OPT_BORDER, OPT_BOX,
|
||||
OPT_CMYK, OPT_COLS, OPT_COMPLIANTHEIGHT, OPT_DIRECT, OPT_DMRE, OPT_DOTSIZE, OPT_DOTTY, OPT_DUMP,
|
||||
OPT_ECI, OPT_ESC, OPT_FG, OPT_FILETYPE, OPT_FONTSIZE, OPT_FULLMULTIBYTE,
|
||||
OPT_GS1, OPT_GS1NOCHECK, OPT_GS1PARENS, OPT_GSSEP, OPT_GUARDDESCENT,
|
||||
OPT_HEIGHT, OPT_INIT, OPT_MIRROR, OPT_MASK, OPT_MODE,
|
||||
@ -879,6 +880,7 @@ int main(int argc, char **argv) {
|
||||
{"box", 0, NULL, OPT_BOX},
|
||||
{"cmyk", 0, NULL, OPT_CMYK},
|
||||
{"cols", 1, NULL, OPT_COLS},
|
||||
{"compliantheight", 0, NULL, OPT_COMPLIANTHEIGHT},
|
||||
{"data", 1, NULL, 'd'},
|
||||
{"direct", 0, NULL, OPT_DIRECT},
|
||||
{"dmre", 0, NULL, OPT_DMRE},
|
||||
@ -995,6 +997,9 @@ int main(int argc, char **argv) {
|
||||
fflush(stderr);
|
||||
}
|
||||
break;
|
||||
case OPT_COMPLIANTHEIGHT:
|
||||
my_symbol->output_options |= COMPLIANT_HEIGHT;
|
||||
break;
|
||||
case OPT_DIRECT:
|
||||
my_symbol->output_options |= BARCODE_STDOUT;
|
||||
break;
|
||||
|
@ -220,6 +220,15 @@ static void arg_output_options(char *cmd, int output_options) {
|
||||
if (output_options & GS1_GS_SEPARATOR) {
|
||||
sprintf(cmd + (int) strlen(cmd), "%s--gssep", strlen(cmd) ? " " : "");
|
||||
}
|
||||
if (output_options & BARCODE_QUIET_ZONES) {
|
||||
sprintf(cmd + (int) strlen(cmd), "%s--quietzones", strlen(cmd) ? " " : "");
|
||||
}
|
||||
if (output_options & BARCODE_NO_QUIET_ZONES) {
|
||||
sprintf(cmd + (int) strlen(cmd), "%s--noquietzones", strlen(cmd) ? " " : "");
|
||||
}
|
||||
if (output_options & COMPLIANT_HEIGHT) {
|
||||
sprintf(cmd + (int) strlen(cmd), "%s--compliantheight", strlen(cmd) ? " " : "");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -906,38 +915,39 @@ static void test_other_opts(int index, int debug) {
|
||||
/* 5*/ { BARCODE_CODE128, "1", -1, " --fg=", "00000000", "" },
|
||||
/* 6*/ { BARCODE_CODE128, "1", -1, " --fg=", "000000F", "Error 651: Malformed foreground colour target" },
|
||||
/* 7*/ { BARCODE_CODE128, "1", -1, " --fg=", "000000FG", "Error 653: Malformed foreground colour target" },
|
||||
/* 8*/ { BARCODE_CODE128, "1", -1, " --fontsize=", "10", "" },
|
||||
/* 9*/ { BARCODE_CODE128, "1", -1, " --fontsize=", "101", "Warning 126: Font size out of range (0 to 100), ignoring" },
|
||||
/* 10*/ { BARCODE_CODE128, "1", -1, " --nobackground", "", "" },
|
||||
/* 11*/ { BARCODE_CODE128, "1", -1, " --noquietzones", "", "" },
|
||||
/* 12*/ { BARCODE_CODE128, "1", -1, " --notext", "", "" },
|
||||
/* 13*/ { BARCODE_CODE128, "1", -1, " --quietzones", "", "" },
|
||||
/* 14*/ { BARCODE_CODE128, "1", -1, " --reverse", "", "" },
|
||||
/* 15*/ { BARCODE_CODE128, "1", -1, " --werror", NULL, "" },
|
||||
/* 16*/ { 19, "1", -1, " --werror", NULL, "Error 207: Codabar 18 not supported" },
|
||||
/* 17*/ { BARCODE_GS1_128, "[01]12345678901231", -1, "", NULL, "" },
|
||||
/* 18*/ { BARCODE_GS1_128, "0112345678901231", -1, "", NULL, "Error 252: Data does not start with an AI" },
|
||||
/* 19*/ { BARCODE_GS1_128, "0112345678901231", -1, " --gs1nocheck", NULL, "Error 252: Data does not start with an AI" },
|
||||
/* 20*/ { BARCODE_GS1_128, "[00]376104250021234569", -1, "", NULL, "" },
|
||||
/* 21*/ { BARCODE_GS1_128, "[00]376104250021234568", -1, "", NULL, "Warning 261: AI (00) position 18: Bad checksum '8', expected '9'" },
|
||||
/* 22*/ { BARCODE_GS1_128, "[00]376104250021234568", -1, " --gs1nocheck", NULL, "" },
|
||||
/* 23*/ { BARCODE_GS1_128, "[00]376104250021234568", -1, " --werror", NULL, "Error 261: AI (00) position 18: Bad checksum '8', expected '9'" },
|
||||
/* 24*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "1", "Error 155: Invalid Structured Append argument, expect \"index,count[,ID]\"" },
|
||||
/* 25*/ { BARCODE_AZTEC, "1", -1, " --structapp=", ",", "Error 156: Structured Append index too short" },
|
||||
/* 26*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "1234567890,", "Error 156: Structured Append index too long" },
|
||||
/* 27*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "123456789,", "Error 159: Structured Append count too short" },
|
||||
/* 28*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "123456789,1234567890", "Error 159: Structured Append count too long" },
|
||||
/* 29*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "123456789,123456789,", "Error 158: Structured Append ID too short" },
|
||||
/* 30*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "123456789,1234567890,", "Error 157: Structured Append count too long" },
|
||||
/* 31*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "123456789,123456789,123456789012345678901234567890123", "Error 158: Structured Append ID too long" },
|
||||
/* 32*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "123456789,123456789,12345678901234567890123456789012", "Error 701: Structured Append count out of range (2-26)" },
|
||||
/* 33*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "26,26,12345678901234567890123456789012", "" },
|
||||
/* 34*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "A,26,12345678901234567890123456789012", "Error 160: Invalid Structured Append index (digits only)" },
|
||||
/* 35*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "26,A,12345678901234567890123456789012", "Error 161: Invalid Structured Append count (digits only)" },
|
||||
/* 36*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "26,1,12345678901234567890123456789012", "Error 162: Invalid Structured Append count, must be >= 2" },
|
||||
/* 37*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "0,2,12345678901234567890123456789012", "Error 163: Structured Append index out of range (1-2)" },
|
||||
/* 38*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "3,2,12345678901234567890123456789012", "Error 163: Structured Append index out of range (1-2)" },
|
||||
/* 39*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "2,3,12345678901234567890123456789012", "" },
|
||||
/* 8*/ { BARCODE_CODE128, "1", -1, " --compliantheight", "", "" },
|
||||
/* 9*/ { BARCODE_CODE128, "1", -1, " --fontsize=", "10", "" },
|
||||
/* 10*/ { BARCODE_CODE128, "1", -1, " --fontsize=", "101", "Warning 126: Font size out of range (0 to 100), ignoring" },
|
||||
/* 11*/ { BARCODE_CODE128, "1", -1, " --nobackground", "", "" },
|
||||
/* 12*/ { BARCODE_CODE128, "1", -1, " --noquietzones", "", "" },
|
||||
/* 13*/ { BARCODE_CODE128, "1", -1, " --notext", "", "" },
|
||||
/* 14*/ { BARCODE_CODE128, "1", -1, " --quietzones", "", "" },
|
||||
/* 15*/ { BARCODE_CODE128, "1", -1, " --reverse", "", "" },
|
||||
/* 16*/ { BARCODE_CODE128, "1", -1, " --werror", NULL, "" },
|
||||
/* 17*/ { 19, "1", -1, " --werror", NULL, "Error 207: Codabar 18 not supported" },
|
||||
/* 18*/ { BARCODE_GS1_128, "[01]12345678901231", -1, "", NULL, "" },
|
||||
/* 19*/ { BARCODE_GS1_128, "0112345678901231", -1, "", NULL, "Error 252: Data does not start with an AI" },
|
||||
/* 20*/ { BARCODE_GS1_128, "0112345678901231", -1, " --gs1nocheck", NULL, "Error 252: Data does not start with an AI" },
|
||||
/* 21*/ { BARCODE_GS1_128, "[00]376104250021234569", -1, "", NULL, "" },
|
||||
/* 22*/ { BARCODE_GS1_128, "[00]376104250021234568", -1, "", NULL, "Warning 261: AI (00) position 18: Bad checksum '8', expected '9'" },
|
||||
/* 23*/ { BARCODE_GS1_128, "[00]376104250021234568", -1, " --gs1nocheck", NULL, "" },
|
||||
/* 24*/ { BARCODE_GS1_128, "[00]376104250021234568", -1, " --werror", NULL, "Error 261: AI (00) position 18: Bad checksum '8', expected '9'" },
|
||||
/* 25*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "1", "Error 155: Invalid Structured Append argument, expect \"index,count[,ID]\"" },
|
||||
/* 26*/ { BARCODE_AZTEC, "1", -1, " --structapp=", ",", "Error 156: Structured Append index too short" },
|
||||
/* 27*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "1234567890,", "Error 156: Structured Append index too long" },
|
||||
/* 28*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "123456789,", "Error 159: Structured Append count too short" },
|
||||
/* 29*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "123456789,1234567890", "Error 159: Structured Append count too long" },
|
||||
/* 30*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "123456789,123456789,", "Error 158: Structured Append ID too short" },
|
||||
/* 31*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "123456789,1234567890,", "Error 157: Structured Append count too long" },
|
||||
/* 32*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "123456789,123456789,123456789012345678901234567890123", "Error 158: Structured Append ID too long" },
|
||||
/* 33*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "123456789,123456789,12345678901234567890123456789012", "Error 701: Structured Append count out of range (2-26)" },
|
||||
/* 34*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "26,26,12345678901234567890123456789012", "" },
|
||||
/* 35*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "A,26,12345678901234567890123456789012", "Error 160: Invalid Structured Append index (digits only)" },
|
||||
/* 36*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "26,A,12345678901234567890123456789012", "Error 161: Invalid Structured Append count (digits only)" },
|
||||
/* 37*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "26,1,12345678901234567890123456789012", "Error 162: Invalid Structured Append count, must be >= 2" },
|
||||
/* 38*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "0,2,12345678901234567890123456789012", "Error 163: Structured Append index out of range (1-2)" },
|
||||
/* 39*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "3,2,12345678901234567890123456789012", "Error 163: Structured Append index out of range (1-2)" },
|
||||
/* 40*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "2,3,12345678901234567890123456789012", "" },
|
||||
};
|
||||
int data_size = ARRAY_SIZE(data);
|
||||
int i;
|
||||
|
Reference in New Issue
Block a user