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:
gitlost 2021-10-09 00:13:39 +01:00
parent 206ae26d20
commit 72eac41c34
82 changed files with 5570 additions and 3774 deletions

View file

@ -130,6 +130,8 @@
2021-09-27 GL
- Added -structapp
- Split up -to parsing (could seg fault if given non-int for X0 or Y0)
2021-10-05 GL
- Added -compliantheight option
*/
#if defined(__WIN32__) || defined(_WIN32) || defined(WIN32)
@ -452,6 +454,7 @@ static char help_message[] = "zint tcl(stub,obj) dll\n"
" -box bool: box around bar code, size set be -border\n"
/* cli option --cmyk not supported as no corresponding output */
" -cols integer: PDF417, Codablock F, DotCode: number of columns\n"
" -compliantheight bool: warn if height not compliant, and use standard default\n"
/* cli option --data is standard parameter */
" -dmre bool: Allow Data Matrix Rectangular Extended\n"
" -dotsize number: radius ratio of dots from 0.01 to 1.0\n"
@ -715,8 +718,9 @@ static int Encode(Tcl_Interp *interp, int objc,
/* Option list and indexes */
char *optionList[] = {
"-addongap", "-barcode", "-bg", "-bind", "-bold", "-border", "-box",
"-cols", "-dmre", "-dotsize", "-dotty", "-eci", "-fg", "-format",
"-fullmultibyte", "-gs1nocheck", "-gs1parens", "-gssep", "-guarddescent",
"-cols", "-compliantheight", "-dmre", "-dotsize", "-dotty",
"-eci", "-fg", "-format", "-fullmultibyte",
"-gs1nocheck", "-gs1parens", "-gssep", "-guarddescent",
"-height", "-init", "-mask", "-mode",
"-nobackground", "-noquietzones", "-notext", "-primary", "-quietzones",
"-reverse", "-rotate", "-rows", "-scale", "-scmvv",
@ -725,8 +729,9 @@ static int Encode(Tcl_Interp *interp, int objc,
NULL};
enum iOption {
iAddonGap, iBarcode, iBG, iBind, iBold, iBorder, iBox,
iCols, iDMRE, iDotSize, iDotty, iECI, iFG, iFormat,
iFullMultiByte, iGS1NoCheck, iGS1Parens, iGSSep, iGuardDescent,
iCols, iCompliantHeight, iDMRE, iDotSize, iDotty,
iECI, iFG, iFormat, iFullMultiByte,
iGS1NoCheck, iGS1Parens, iGSSep, iGuardDescent,
iHeight, iInit, iMask, iMode,
iNoBackground, iNoQuietZones, iNoText, iPrimary, iQuietZones,
iReverse, iRotate, iRows, iScale, iSCMvv,
@ -751,6 +756,7 @@ static int Encode(Tcl_Interp *interp, int objc,
case iBind:
case iBold:
case iBox:
case iCompliantHeight:
case iDMRE:
case iDotty:
case iGS1NoCheck:
@ -862,6 +868,13 @@ static int Encode(Tcl_Interp *interp, int objc,
my_symbol->output_options &= ~BARCODE_BOX;
}
break;
case iCompliantHeight:
if (intValue) {
my_symbol->output_options |= COMPLIANT_HEIGHT;
} else {
my_symbol->output_options &= ~COMPLIANT_HEIGHT;
}
break;
case iDotSize:
if (doubleValue < 0.01) {
Tcl_SetObjResult(interp,