From 1c902230fe33b199fca4ad104916427d4cd66970 Mon Sep 17 00:00:00 2001 From: Jaye Evins Date: Wed, 7 Jan 2026 19:43:34 -0500 Subject: [PATCH] Big-Ugly Style Update (#278) * Bulk replaced tabs with spaces * Bulk removed trailing whitespace from lines * Replaced c-style comments with c++-style comments in file banners * Replace nested namespace definitions with single concise definitions (C++17), this keeps the indentation more manageable * Cleanup ordering and spacing of include directives * Bulk renaming of header file extensions from '.h' to '.hpp'. * Update CODING-STYLE.md * Update target_compile_features from cxx_std_11 to cxx_std_20. * Refresh .clang-format file. Still needs a lot of tweaking. --- .clang-format | 202 +- CMakeLists.txt | 1 + backends/barcode/Backends.cpp | 1012 +++--- backends/barcode/Backends.h | 98 - backends/barcode/Backends.hpp | 95 + backends/barcode/CMakeLists.txt | 9 +- backends/barcode/GnuBarcode.cpp | 1784 +++++----- backends/barcode/GnuBarcode.h | 424 --- backends/barcode/GnuBarcode.hpp | 419 +++ backends/barcode/QrEncode.cpp | 133 +- backends/barcode/QrEncode.h | 60 - backends/barcode/QrEncode.hpp | 55 + backends/barcode/Style.cpp | 382 +- backends/barcode/Style.h | 120 - backends/barcode/Style.hpp | 117 + backends/barcode/Zint.cpp | 3091 ++++++++-------- backends/barcode/Zint.h | 1159 ------ backends/barcode/Zint.hpp | 1154 ++++++ backends/merge/CMakeLists.txt | 9 +- backends/merge/Factory.cpp | 376 +- backends/merge/Factory.h | 110 - backends/merge/Factory.hpp | 107 + backends/merge/Merge.cpp | 337 +- backends/merge/Merge.h | 124 - backends/merge/Merge.hpp | 121 + backends/merge/None.cpp | 186 +- backends/merge/None.h | 78 - backends/merge/None.hpp | 76 + backends/merge/Record.cpp | 78 +- backends/merge/Record.h | 62 - backends/merge/Record.hpp | 59 + backends/merge/Text.cpp | 743 ++-- backends/merge/Text.h | 85 - backends/merge/Text.hpp | 82 + backends/merge/TextColon.cpp | 125 +- backends/merge/TextColon.h | 68 - backends/merge/TextColon.hpp | 65 + backends/merge/TextColonKeys.cpp | 129 +- backends/merge/TextColonKeys.h | 68 - backends/merge/TextColonKeys.hpp | 65 + backends/merge/TextCsv.cpp | 129 +- backends/merge/TextCsv.h | 68 - backends/merge/TextCsv.hpp | 65 + backends/merge/TextCsvKeys.cpp | 129 +- backends/merge/TextCsvKeys.h | 68 - backends/merge/TextCsvKeys.hpp | 65 + backends/merge/TextSemicolon.cpp | 125 +- backends/merge/TextSemicolon.h | 68 - backends/merge/TextSemicolon.hpp | 65 + backends/merge/TextSemicolonKeys.cpp | 125 +- backends/merge/TextSemicolonKeys.h | 68 - backends/merge/TextSemicolonKeys.hpp | 65 + backends/merge/TextTsv.cpp | 129 +- backends/merge/TextTsv.h | 68 - backends/merge/TextTsv.hpp | 65 + backends/merge/TextTsvKeys.cpp | 126 +- backends/merge/TextTsvKeys.h | 68 - backends/merge/TextTsvKeys.hpp | 65 + docs/CODING-STYLE.md | 59 +- glabels-batch/CMakeLists.txt | 2 +- glabels-batch/main.cpp | 521 +-- glabels/AboutDialog.cpp | 137 +- glabels/AboutDialog.h | 58 - glabels/AboutDialog.hpp | 58 + glabels/BarcodeMenu.cpp | 141 +- glabels/BarcodeMenu.h | 79 - glabels/BarcodeMenu.hpp | 79 + glabels/BarcodeMenuButton.cpp | 121 +- glabels/BarcodeMenuButton.h | 83 - glabels/BarcodeMenuButton.hpp | 83 + glabels/BarcodeMenuItem.cpp | 89 +- glabels/BarcodeMenuItem.h | 79 - glabels/BarcodeMenuItem.hpp | 79 + glabels/CMakeLists.txt | 60 +- glabels/ColorButton.cpp | 289 +- glabels/ColorButton.h | 105 - glabels/ColorButton.hpp | 105 + glabels/ColorHistory.cpp | 253 +- glabels/ColorHistory.h | 86 - glabels/ColorHistory.hpp | 86 + glabels/ColorPaletteDialog.cpp | 498 +-- glabels/ColorPaletteDialog.h | 119 - glabels/ColorPaletteDialog.hpp | 119 + glabels/ColorPaletteItem.cpp | 245 +- glabels/ColorPaletteItem.h | 89 - glabels/ColorPaletteItem.hpp | 89 + glabels/ColorSwatch.cpp | 93 +- glabels/ColorSwatch.h | 48 - glabels/ColorSwatch.hpp | 48 + glabels/Cursors.cpp | 121 +- glabels/Cursors.h | 98 - glabels/Cursors.hpp | 98 + glabels/EditVariableDialog.cpp | 375 +- glabels/EditVariableDialog.h | 76 - glabels/EditVariableDialog.hpp | 77 + glabels/FieldButton.cpp | 147 +- glabels/FieldButton.h | 84 - glabels/FieldButton.hpp | 84 + glabels/File.cpp | 519 +-- glabels/File.h | 62 - glabels/File.hpp | 62 + glabels/Help.cpp | 93 +- glabels/Help.h | 45 - glabels/Help.hpp | 45 + glabels/LabelEditor.cpp | 2708 +++++++------- glabels/LabelEditor.h | 224 -- glabels/LabelEditor.hpp | 224 ++ glabels/MainWindow.cpp | 3551 ++++++++++--------- glabels/MainWindow.h | 334 -- glabels/MainWindow.hpp | 334 ++ glabels/MergeTableModel.cpp | 280 +- glabels/MergeTableModel.h | 80 - glabels/MergeTableModel.hpp | 80 + glabels/MergeView.cpp | 304 +- glabels/MergeView.h | 103 - glabels/MergeView.hpp | 103 + glabels/MiniPreviewPixmap.cpp | 257 +- glabels/MiniPreviewPixmap.h | 56 - glabels/MiniPreviewPixmap.hpp | 56 + glabels/NotebookUtil.cpp | 95 +- glabels/NotebookUtil.h | 40 - glabels/NotebookUtil.hpp | 40 + glabels/ObjectEditor.cpp | 1633 ++++----- glabels/ObjectEditor.h | 127 - glabels/ObjectEditor.hpp | 127 + glabels/PreferencesDialog.cpp | 291 +- glabels/PreferencesDialog.h | 60 - glabels/PreferencesDialog.hpp | 60 + glabels/Preview.cpp | 417 +-- glabels/Preview.h | 99 - glabels/Preview.hpp | 99 + glabels/PreviewOverlayItem.cpp | 71 +- glabels/PreviewOverlayItem.h | 65 - glabels/PreviewOverlayItem.hpp | 65 + glabels/PrintView.cpp | 578 +-- glabels/PrintView.h | 91 - glabels/PrintView.hpp | 91 + glabels/PrinterMonitor.cpp | 160 +- glabels/PrinterMonitor.h | 99 - glabels/PrinterMonitor.hpp | 99 + glabels/PropertiesView.cpp | 412 +-- glabels/PropertiesView.h | 86 - glabels/PropertiesView.hpp | 86 + glabels/ReportBugDialog.cpp | 129 +- glabels/ReportBugDialog.h | 58 - glabels/ReportBugDialog.hpp | 58 + glabels/RollTemplatePath.cpp | 111 +- glabels/RollTemplatePath.h | 49 - glabels/RollTemplatePath.hpp | 49 + glabels/SelectProductDialog.cpp | 524 +-- glabels/SelectProductDialog.h | 89 - glabels/SelectProductDialog.hpp | 89 + glabels/SimplePreview.cpp | 460 +-- glabels/SimplePreview.h | 94 - glabels/SimplePreview.hpp | 94 + glabels/StartupView.cpp | 183 +- glabels/StartupView.h | 78 - glabels/StartupView.hpp | 78 + glabels/TemplateDesigner.cpp | 3095 ++++++++-------- glabels/TemplateDesigner.h | 322 -- glabels/TemplateDesigner.hpp | 322 ++ glabels/TemplatePicker.cpp | 498 +-- glabels/TemplatePicker.h | 97 - glabels/TemplatePicker.hpp | 97 + glabels/TemplatePickerItem.cpp | 132 +- glabels/TemplatePickerItem.h | 77 - glabels/TemplatePickerItem.hpp | 77 + glabels/UndoRedoModel.cpp | 431 +-- glabels/UndoRedoModel.h | 126 - glabels/UndoRedoModel.hpp | 126 + glabels/VariablesView.cpp | 389 +- glabels/VariablesView.h | 91 - glabels/VariablesView.hpp | 91 + glabels/main.cpp | 223 +- glabels/ui/EditVariableDialog.ui | 2 +- glabels/ui/ObjectEditor.ui | 6 +- glabels/ui/PrintView.ui | 2 +- glabels/ui/PropertiesView.ui | 2 +- glabels/ui/SelectProductDialog.ui | 4 +- glabels/ui/TemplateDesignerOneLayoutPage.ui | 2 +- glabels/ui/TemplateDesignerTwoLayoutPage.ui | 2 +- glbarcode/Barcode.cpp | 263 +- glbarcode/Barcode.h | 317 -- glbarcode/Barcode.hpp | 317 ++ glbarcode/Barcode1dBase.cpp | 175 +- glbarcode/Barcode1dBase.h | 164 - glbarcode/Barcode1dBase.hpp | 164 + glbarcode/Barcode2dBase.cpp | 241 +- glbarcode/Barcode2dBase.h | 151 - glbarcode/Barcode2dBase.hpp | 151 + glbarcode/BarcodeCepnet.cpp | 69 +- glbarcode/BarcodeCepnet.h | 66 - glbarcode/BarcodeCepnet.hpp | 66 + glbarcode/BarcodeCode39.cpp | 457 +-- glbarcode/BarcodeCode39.h | 100 - glbarcode/BarcodeCode39.hpp | 100 + glbarcode/BarcodeCode39Ext.cpp | 191 +- glbarcode/BarcodeCode39Ext.h | 132 - glbarcode/BarcodeCode39Ext.hpp | 132 + glbarcode/BarcodeDataMatrix.cpp | 1255 +++---- glbarcode/BarcodeDataMatrix.h | 61 - glbarcode/BarcodeDataMatrix.hpp | 61 + glbarcode/BarcodeEan13.cpp | 149 +- glbarcode/BarcodeEan13.h | 76 - glbarcode/BarcodeEan13.hpp | 76 + glbarcode/BarcodeOnecode.cpp | 1081 +++--- glbarcode/BarcodeOnecode.h | 72 - glbarcode/BarcodeOnecode.hpp | 72 + glbarcode/BarcodePostnet.cpp | 287 +- glbarcode/BarcodePostnet.h | 98 - glbarcode/BarcodePostnet.hpp | 98 + glbarcode/BarcodePostnet11.cpp | 69 +- glbarcode/BarcodePostnet11.h | 66 - glbarcode/BarcodePostnet11.hpp | 66 + glbarcode/BarcodePostnet5.cpp | 69 +- glbarcode/BarcodePostnet5.h | 66 - glbarcode/BarcodePostnet5.hpp | 66 + glbarcode/BarcodePostnet9.cpp | 69 +- glbarcode/BarcodePostnet9.h | 66 - glbarcode/BarcodePostnet9.hpp | 66 + glbarcode/BarcodeQrcode.cpp | 129 +- glbarcode/BarcodeQrcode.h | 59 - glbarcode/BarcodeQrcode.hpp | 59 + glbarcode/BarcodeUpcA.cpp | 151 +- glbarcode/BarcodeUpcA.h | 76 - glbarcode/BarcodeUpcA.hpp | 76 + glbarcode/BarcodeUpcBase.cpp | 481 +-- glbarcode/BarcodeUpcBase.h | 78 - glbarcode/BarcodeUpcBase.hpp | 78 + glbarcode/CMakeLists.txt | 2 +- glbarcode/Constants.h | 38 - glbarcode/Constants.hpp | 38 + glbarcode/DrawingPrimitives.cpp | 185 +- glbarcode/DrawingPrimitives.h | 269 -- glbarcode/DrawingPrimitives.hpp | 269 ++ glbarcode/Enums.h | 38 - glbarcode/Enums.hpp | 38 + glbarcode/Factory.cpp | 185 +- glbarcode/Factory.h | 124 - glbarcode/Factory.hpp | 126 + glbarcode/Matrix.h | 220 -- glbarcode/Matrix.hpp | 220 ++ glbarcode/QtRenderer.cpp | 281 +- glbarcode/QtRenderer.h | 92 - glbarcode/QtRenderer.hpp | 92 + glbarcode/Renderer.cpp | 103 +- glbarcode/Renderer.h | 170 - glbarcode/Renderer.hpp | 170 + glbarcode/TypeIdList.h | 44 - glbarcode/TypeIdList.hpp | 45 + model/CMakeLists.txt | 30 +- model/Category.cpp | 76 +- model/Category.h | 55 - model/Category.hpp | 52 + model/ColorNode.cpp | 354 +- model/ColorNode.h | 117 - model/ColorNode.hpp | 114 + model/Config.h.in | 40 - model/{StrUtil.h => Config.hpp.in} | 29 +- model/Constants.h | 41 - model/Constants.hpp | 39 + model/DataCache.cpp | 182 +- model/DataCache.h | 61 - model/DataCache.hpp | 58 + model/Db.cpp | 1408 ++++---- model/Db.h | 150 - model/Db.hpp | 147 + model/Distance.cpp | 378 +- model/Distance.h | 319 -- model/Distance.hpp | 313 ++ model/FileUtil.cpp | 202 +- model/FileUtil.h | 53 - model/FileUtil.hpp | 50 + model/Frame.cpp | 260 +- model/Frame.h | 101 - model/Frame.hpp | 98 + model/FrameCd.cpp | 407 ++- model/FrameCd.h | 83 - model/FrameCd.hpp | 80 + model/FrameContinuous.cpp | 291 +- model/FrameContinuous.h | 83 - model/FrameContinuous.hpp | 80 + model/FrameEllipse.cpp | 263 +- model/FrameEllipse.h | 77 - model/FrameEllipse.hpp | 74 + model/FramePath.cpp | 265 +- model/FramePath.h | 84 - model/FramePath.hpp | 81 + model/FrameRect.cpp | 289 +- model/FrameRect.h | 84 - model/FrameRect.hpp | 81 + model/FrameRound.cpp | 258 +- model/FrameRound.h | 76 - model/FrameRound.hpp | 73 + model/Handle.cpp | 385 +- model/Handle.h | 101 - model/Handle.hpp | 98 + model/Layout.cpp | 188 +- model/Layout.h | 78 - model/Layout.hpp | 75 + model/Markup.cpp | 523 ++- model/Markup.h | 192 - model/Markup.hpp | 190 + model/Model.cpp | 3213 +++++++++-------- model/Model.h | 260 -- model/Model.hpp | 257 ++ model/ModelBarcodeObject.cpp | 984 +++-- model/ModelBarcodeObject.h | 185 - model/ModelBarcodeObject.hpp | 182 + model/ModelBoxObject.cpp | 382 +- model/ModelBoxObject.h | 94 - model/ModelBoxObject.hpp | 91 + model/ModelEllipseObject.cpp | 382 +- model/ModelEllipseObject.h | 94 - model/ModelEllipseObject.hpp | 91 + model/ModelImageObject.cpp | 1229 ++++--- model/ModelImageObject.h | 180 - model/ModelImageObject.hpp | 177 + model/ModelLineObject.cpp | 455 ++- model/ModelLineObject.h | 126 - model/ModelLineObject.hpp | 123 + model/ModelObject.cpp | 2527 +++++++------ model/ModelObject.h | 479 --- model/ModelObject.hpp | 476 +++ model/ModelShapeObject.cpp | 346 +- model/ModelShapeObject.h | 114 - model/ModelShapeObject.hpp | 111 + model/ModelTextObject.cpp | 1715 +++++---- model/ModelTextObject.h | 247 -- model/ModelTextObject.hpp | 244 ++ model/Outline.cpp | 228 +- model/Outline.h | 84 - model/Outline.hpp | 81 + model/PageRenderer.cpp | 1184 +++---- model/PageRenderer.h | 144 - model/PageRenderer.hpp | 141 + model/Paper.cpp | 144 +- model/Paper.h | 73 - model/Paper.hpp | 70 + model/ParserState.cpp | 131 +- model/ParserState.h | 58 - model/ParserState.hpp | 55 + model/Point.cpp | 103 +- model/Point.h | 60 - model/Point.hpp | 57 + model/RawText.cpp | 267 +- model/RawText.h | 87 - model/RawText.hpp | 84 + model/Region.cpp | 234 +- model/Region.h | 106 - model/Region.hpp | 103 + model/Settings.cpp | 749 ++-- model/Settings.h | 127 - model/Settings.hpp | 124 + model/Size.cpp | 148 +- model/Size.h | 87 - model/Size.hpp | 84 + model/StrUtil.cpp | 412 ++- model/StrUtil.hpp | 43 + model/SubstitutionField.cpp | 569 ++- model/SubstitutionField.h | 82 - model/SubstitutionField.hpp | 79 + model/Template.cpp | 769 ++-- model/Template.h | 150 - model/Template.hpp | 146 + model/TextNode.cpp | 221 +- model/TextNode.h | 98 - model/TextNode.hpp | 95 + model/Units.cpp | 494 ++- model/Units.h | 72 - model/Units.hpp | 69 + model/Variable.cpp | 608 ++-- model/Variable.h | 109 - model/Variable.hpp | 106 + model/Variables.cpp | 320 +- model/Variables.h | 93 - model/Variables.hpp | 90 + model/Vendor.cpp | 78 +- model/Vendor.h | 52 - model/Vendor.hpp | 49 + model/Version.cpp | 86 +- model/Version.h.in | 57 - model/Version.hpp.in | 54 + model/XmlCategoryParser.cpp | 153 +- model/XmlCategoryParser.h | 53 - model/XmlCategoryParser.hpp | 50 + model/XmlLabelCreator.cpp | 1173 +++--- model/XmlLabelCreator.h | 141 - model/XmlLabelCreator.hpp | 138 + model/XmlLabelParser.cpp | 1639 +++++---- model/XmlLabelParser.h | 113 - model/XmlLabelParser.hpp | 110 + model/XmlLabelParser_3.cpp | 1658 +++++---- model/XmlLabelParser_3.h | 85 - model/XmlLabelParser_3.hpp | 83 + model/XmlPaperParser.cpp | 161 +- model/XmlPaperParser.h | 53 - model/XmlPaperParser.hpp | 50 + model/XmlTemplateCreator.cpp | 610 ++-- model/XmlTemplateCreator.h | 76 - model/XmlTemplateCreator.hpp | 73 + model/XmlTemplateParser.cpp | 1013 +++--- model/XmlTemplateParser.h | 75 - model/XmlTemplateParser.hpp | 72 + model/XmlUtil.cpp | 1204 ++++--- model/XmlUtil.h | 153 - model/XmlUtil.hpp | 150 + model/XmlVendorParser.cpp | 153 +- model/XmlVendorParser.h | 53 - model/XmlVendorParser.hpp | 50 + model/unit_tests/CMakeLists.txt | 26 +- model/unit_tests/TestColorNode.cpp | 270 +- model/unit_tests/TestColorNode.h | 30 - model/unit_tests/TestColorNode.hpp | 31 + model/unit_tests/TestFileUtil.cpp | 119 +- model/unit_tests/TestFileUtil.h | 36 - model/unit_tests/TestFileUtil.hpp | 37 + model/unit_tests/TestMerge.cpp | 512 +-- model/unit_tests/TestMerge.h | 37 - model/unit_tests/TestMerge.hpp | 38 + model/unit_tests/TestModel.cpp | 782 ++-- model/unit_tests/TestModel.h | 32 - model/unit_tests/TestModel.hpp | 33 + model/unit_tests/TestModelImageObject.cpp | 384 +- model/unit_tests/TestModelImageObject.h | 31 - model/unit_tests/TestModelImageObject.hpp | 32 + model/unit_tests/TestRawText.cpp | 136 +- model/unit_tests/TestRawText.h | 30 - model/unit_tests/TestRawText.hpp | 31 + model/unit_tests/TestStrUtil.cpp | 77 +- model/unit_tests/TestStrUtil.h | 30 - model/unit_tests/TestStrUtil.hpp | 31 + model/unit_tests/TestSubstitutionField.cpp | 556 +-- model/unit_tests/TestSubstitutionField.h | 40 - model/unit_tests/TestSubstitutionField.hpp | 41 + model/unit_tests/TestTextNode.cpp | 182 +- model/unit_tests/TestTextNode.h | 30 - model/unit_tests/TestTextNode.hpp | 31 + model/unit_tests/TestVariable.cpp | 467 +-- model/unit_tests/TestVariable.h | 31 - model/unit_tests/TestVariable.hpp | 32 + model/unit_tests/TestVariables.cpp | 235 +- model/unit_tests/TestVariables.h | 30 - model/unit_tests/TestVariables.hpp | 31 + model/unit_tests/TestXmlLabel.cpp | 1126 +++--- model/unit_tests/TestXmlLabel.h | 36 - model/unit_tests/TestXmlLabel.hpp | 37 + model/unit_tests/TestXmlUtil.cpp | 415 +-- model/unit_tests/TestXmlUtil.h | 42 - model/unit_tests/TestXmlUtil.hpp | 43 + model/unit_tests/Test_Constants.h | 41 - model/unit_tests/Test_Constants.hpp | 38 + translations/CMakeLists.txt | 16 +- translations/XmlStrings.cpp | 149 +- 454 files changed, 51827 insertions(+), 52031 deletions(-) delete mode 100644 backends/barcode/Backends.h create mode 100644 backends/barcode/Backends.hpp delete mode 100644 backends/barcode/GnuBarcode.h create mode 100644 backends/barcode/GnuBarcode.hpp delete mode 100644 backends/barcode/QrEncode.h create mode 100644 backends/barcode/QrEncode.hpp delete mode 100644 backends/barcode/Style.h create mode 100644 backends/barcode/Style.hpp delete mode 100644 backends/barcode/Zint.h create mode 100644 backends/barcode/Zint.hpp delete mode 100644 backends/merge/Factory.h create mode 100644 backends/merge/Factory.hpp delete mode 100644 backends/merge/Merge.h create mode 100644 backends/merge/Merge.hpp delete mode 100644 backends/merge/None.h create mode 100644 backends/merge/None.hpp delete mode 100644 backends/merge/Record.h create mode 100644 backends/merge/Record.hpp delete mode 100644 backends/merge/Text.h create mode 100644 backends/merge/Text.hpp delete mode 100644 backends/merge/TextColon.h create mode 100644 backends/merge/TextColon.hpp delete mode 100644 backends/merge/TextColonKeys.h create mode 100644 backends/merge/TextColonKeys.hpp delete mode 100644 backends/merge/TextCsv.h create mode 100644 backends/merge/TextCsv.hpp delete mode 100644 backends/merge/TextCsvKeys.h create mode 100644 backends/merge/TextCsvKeys.hpp delete mode 100644 backends/merge/TextSemicolon.h create mode 100644 backends/merge/TextSemicolon.hpp delete mode 100644 backends/merge/TextSemicolonKeys.h create mode 100644 backends/merge/TextSemicolonKeys.hpp delete mode 100644 backends/merge/TextTsv.h create mode 100644 backends/merge/TextTsv.hpp delete mode 100644 backends/merge/TextTsvKeys.h create mode 100644 backends/merge/TextTsvKeys.hpp delete mode 100644 glabels/AboutDialog.h create mode 100644 glabels/AboutDialog.hpp delete mode 100644 glabels/BarcodeMenu.h create mode 100644 glabels/BarcodeMenu.hpp delete mode 100644 glabels/BarcodeMenuButton.h create mode 100644 glabels/BarcodeMenuButton.hpp delete mode 100644 glabels/BarcodeMenuItem.h create mode 100644 glabels/BarcodeMenuItem.hpp delete mode 100644 glabels/ColorButton.h create mode 100644 glabels/ColorButton.hpp delete mode 100644 glabels/ColorHistory.h create mode 100644 glabels/ColorHistory.hpp delete mode 100644 glabels/ColorPaletteDialog.h create mode 100644 glabels/ColorPaletteDialog.hpp delete mode 100644 glabels/ColorPaletteItem.h create mode 100644 glabels/ColorPaletteItem.hpp delete mode 100644 glabels/ColorSwatch.h create mode 100644 glabels/ColorSwatch.hpp delete mode 100644 glabels/Cursors.h create mode 100644 glabels/Cursors.hpp delete mode 100644 glabels/EditVariableDialog.h create mode 100644 glabels/EditVariableDialog.hpp delete mode 100644 glabels/FieldButton.h create mode 100644 glabels/FieldButton.hpp delete mode 100644 glabels/File.h create mode 100644 glabels/File.hpp delete mode 100644 glabels/Help.h create mode 100644 glabels/Help.hpp delete mode 100644 glabels/LabelEditor.h create mode 100644 glabels/LabelEditor.hpp delete mode 100644 glabels/MainWindow.h create mode 100644 glabels/MainWindow.hpp delete mode 100644 glabels/MergeTableModel.h create mode 100644 glabels/MergeTableModel.hpp delete mode 100644 glabels/MergeView.h create mode 100644 glabels/MergeView.hpp delete mode 100644 glabels/MiniPreviewPixmap.h create mode 100644 glabels/MiniPreviewPixmap.hpp delete mode 100644 glabels/NotebookUtil.h create mode 100644 glabels/NotebookUtil.hpp delete mode 100644 glabels/ObjectEditor.h create mode 100644 glabels/ObjectEditor.hpp delete mode 100644 glabels/PreferencesDialog.h create mode 100644 glabels/PreferencesDialog.hpp delete mode 100644 glabels/Preview.h create mode 100644 glabels/Preview.hpp delete mode 100644 glabels/PreviewOverlayItem.h create mode 100644 glabels/PreviewOverlayItem.hpp delete mode 100644 glabels/PrintView.h create mode 100644 glabels/PrintView.hpp delete mode 100644 glabels/PrinterMonitor.h create mode 100644 glabels/PrinterMonitor.hpp delete mode 100644 glabels/PropertiesView.h create mode 100644 glabels/PropertiesView.hpp delete mode 100644 glabels/ReportBugDialog.h create mode 100644 glabels/ReportBugDialog.hpp delete mode 100644 glabels/RollTemplatePath.h create mode 100644 glabels/RollTemplatePath.hpp delete mode 100644 glabels/SelectProductDialog.h create mode 100644 glabels/SelectProductDialog.hpp delete mode 100644 glabels/SimplePreview.h create mode 100644 glabels/SimplePreview.hpp delete mode 100644 glabels/StartupView.h create mode 100644 glabels/StartupView.hpp delete mode 100644 glabels/TemplateDesigner.h create mode 100644 glabels/TemplateDesigner.hpp delete mode 100644 glabels/TemplatePicker.h create mode 100644 glabels/TemplatePicker.hpp delete mode 100644 glabels/TemplatePickerItem.h create mode 100644 glabels/TemplatePickerItem.hpp delete mode 100644 glabels/UndoRedoModel.h create mode 100644 glabels/UndoRedoModel.hpp delete mode 100644 glabels/VariablesView.h create mode 100644 glabels/VariablesView.hpp delete mode 100644 glbarcode/Barcode.h create mode 100644 glbarcode/Barcode.hpp delete mode 100644 glbarcode/Barcode1dBase.h create mode 100644 glbarcode/Barcode1dBase.hpp delete mode 100644 glbarcode/Barcode2dBase.h create mode 100644 glbarcode/Barcode2dBase.hpp delete mode 100644 glbarcode/BarcodeCepnet.h create mode 100644 glbarcode/BarcodeCepnet.hpp delete mode 100644 glbarcode/BarcodeCode39.h create mode 100644 glbarcode/BarcodeCode39.hpp delete mode 100644 glbarcode/BarcodeCode39Ext.h create mode 100644 glbarcode/BarcodeCode39Ext.hpp delete mode 100644 glbarcode/BarcodeDataMatrix.h create mode 100644 glbarcode/BarcodeDataMatrix.hpp delete mode 100644 glbarcode/BarcodeEan13.h create mode 100644 glbarcode/BarcodeEan13.hpp delete mode 100644 glbarcode/BarcodeOnecode.h create mode 100644 glbarcode/BarcodeOnecode.hpp delete mode 100644 glbarcode/BarcodePostnet.h create mode 100644 glbarcode/BarcodePostnet.hpp delete mode 100644 glbarcode/BarcodePostnet11.h create mode 100644 glbarcode/BarcodePostnet11.hpp delete mode 100644 glbarcode/BarcodePostnet5.h create mode 100644 glbarcode/BarcodePostnet5.hpp delete mode 100644 glbarcode/BarcodePostnet9.h create mode 100644 glbarcode/BarcodePostnet9.hpp delete mode 100644 glbarcode/BarcodeQrcode.h create mode 100644 glbarcode/BarcodeQrcode.hpp delete mode 100644 glbarcode/BarcodeUpcA.h create mode 100644 glbarcode/BarcodeUpcA.hpp delete mode 100644 glbarcode/BarcodeUpcBase.h create mode 100644 glbarcode/BarcodeUpcBase.hpp delete mode 100644 glbarcode/Constants.h create mode 100644 glbarcode/Constants.hpp delete mode 100644 glbarcode/DrawingPrimitives.h create mode 100644 glbarcode/DrawingPrimitives.hpp delete mode 100644 glbarcode/Enums.h create mode 100644 glbarcode/Enums.hpp delete mode 100644 glbarcode/Factory.h create mode 100644 glbarcode/Factory.hpp delete mode 100644 glbarcode/Matrix.h create mode 100644 glbarcode/Matrix.hpp delete mode 100644 glbarcode/QtRenderer.h create mode 100644 glbarcode/QtRenderer.hpp delete mode 100644 glbarcode/Renderer.h create mode 100644 glbarcode/Renderer.hpp delete mode 100644 glbarcode/TypeIdList.h create mode 100644 glbarcode/TypeIdList.hpp delete mode 100644 model/Category.h create mode 100644 model/Category.hpp delete mode 100644 model/ColorNode.h create mode 100644 model/ColorNode.hpp delete mode 100644 model/Config.h.in rename model/{StrUtil.h => Config.hpp.in} (70%) delete mode 100644 model/Constants.h create mode 100644 model/Constants.hpp delete mode 100644 model/DataCache.h create mode 100644 model/DataCache.hpp delete mode 100644 model/Db.h create mode 100644 model/Db.hpp delete mode 100644 model/Distance.h create mode 100644 model/Distance.hpp delete mode 100644 model/FileUtil.h create mode 100644 model/FileUtil.hpp delete mode 100644 model/Frame.h create mode 100644 model/Frame.hpp delete mode 100644 model/FrameCd.h create mode 100644 model/FrameCd.hpp delete mode 100644 model/FrameContinuous.h create mode 100644 model/FrameContinuous.hpp delete mode 100644 model/FrameEllipse.h create mode 100644 model/FrameEllipse.hpp delete mode 100644 model/FramePath.h create mode 100644 model/FramePath.hpp delete mode 100644 model/FrameRect.h create mode 100644 model/FrameRect.hpp delete mode 100644 model/FrameRound.h create mode 100644 model/FrameRound.hpp delete mode 100644 model/Handle.h create mode 100644 model/Handle.hpp delete mode 100644 model/Layout.h create mode 100644 model/Layout.hpp delete mode 100644 model/Markup.h create mode 100644 model/Markup.hpp delete mode 100644 model/Model.h create mode 100644 model/Model.hpp delete mode 100644 model/ModelBarcodeObject.h create mode 100644 model/ModelBarcodeObject.hpp delete mode 100644 model/ModelBoxObject.h create mode 100644 model/ModelBoxObject.hpp delete mode 100644 model/ModelEllipseObject.h create mode 100644 model/ModelEllipseObject.hpp delete mode 100644 model/ModelImageObject.h create mode 100644 model/ModelImageObject.hpp delete mode 100644 model/ModelLineObject.h create mode 100644 model/ModelLineObject.hpp delete mode 100644 model/ModelObject.h create mode 100644 model/ModelObject.hpp delete mode 100644 model/ModelShapeObject.h create mode 100644 model/ModelShapeObject.hpp delete mode 100644 model/ModelTextObject.h create mode 100644 model/ModelTextObject.hpp delete mode 100644 model/Outline.h create mode 100644 model/Outline.hpp delete mode 100644 model/PageRenderer.h create mode 100644 model/PageRenderer.hpp delete mode 100644 model/Paper.h create mode 100644 model/Paper.hpp delete mode 100644 model/ParserState.h create mode 100644 model/ParserState.hpp delete mode 100644 model/Point.h create mode 100644 model/Point.hpp delete mode 100644 model/RawText.h create mode 100644 model/RawText.hpp delete mode 100644 model/Region.h create mode 100644 model/Region.hpp delete mode 100644 model/Settings.h create mode 100644 model/Settings.hpp delete mode 100644 model/Size.h create mode 100644 model/Size.hpp create mode 100644 model/StrUtil.hpp delete mode 100644 model/SubstitutionField.h create mode 100644 model/SubstitutionField.hpp delete mode 100644 model/Template.h create mode 100644 model/Template.hpp delete mode 100644 model/TextNode.h create mode 100644 model/TextNode.hpp delete mode 100644 model/Units.h create mode 100644 model/Units.hpp delete mode 100644 model/Variable.h create mode 100644 model/Variable.hpp delete mode 100644 model/Variables.h create mode 100644 model/Variables.hpp delete mode 100644 model/Vendor.h create mode 100644 model/Vendor.hpp delete mode 100644 model/Version.h.in create mode 100644 model/Version.hpp.in delete mode 100644 model/XmlCategoryParser.h create mode 100644 model/XmlCategoryParser.hpp delete mode 100644 model/XmlLabelCreator.h create mode 100644 model/XmlLabelCreator.hpp delete mode 100644 model/XmlLabelParser.h create mode 100644 model/XmlLabelParser.hpp delete mode 100644 model/XmlLabelParser_3.h create mode 100644 model/XmlLabelParser_3.hpp delete mode 100644 model/XmlPaperParser.h create mode 100644 model/XmlPaperParser.hpp delete mode 100644 model/XmlTemplateCreator.h create mode 100644 model/XmlTemplateCreator.hpp delete mode 100644 model/XmlTemplateParser.h create mode 100644 model/XmlTemplateParser.hpp delete mode 100644 model/XmlUtil.h create mode 100644 model/XmlUtil.hpp delete mode 100644 model/XmlVendorParser.h create mode 100644 model/XmlVendorParser.hpp delete mode 100644 model/unit_tests/TestColorNode.h create mode 100644 model/unit_tests/TestColorNode.hpp delete mode 100644 model/unit_tests/TestFileUtil.h create mode 100644 model/unit_tests/TestFileUtil.hpp delete mode 100644 model/unit_tests/TestMerge.h create mode 100644 model/unit_tests/TestMerge.hpp delete mode 100644 model/unit_tests/TestModel.h create mode 100644 model/unit_tests/TestModel.hpp delete mode 100644 model/unit_tests/TestModelImageObject.h create mode 100644 model/unit_tests/TestModelImageObject.hpp delete mode 100644 model/unit_tests/TestRawText.h create mode 100644 model/unit_tests/TestRawText.hpp delete mode 100644 model/unit_tests/TestStrUtil.h create mode 100644 model/unit_tests/TestStrUtil.hpp delete mode 100644 model/unit_tests/TestSubstitutionField.h create mode 100644 model/unit_tests/TestSubstitutionField.hpp delete mode 100644 model/unit_tests/TestTextNode.h create mode 100644 model/unit_tests/TestTextNode.hpp delete mode 100644 model/unit_tests/TestVariable.h create mode 100644 model/unit_tests/TestVariable.hpp delete mode 100644 model/unit_tests/TestVariables.h create mode 100644 model/unit_tests/TestVariables.hpp delete mode 100644 model/unit_tests/TestXmlLabel.h create mode 100644 model/unit_tests/TestXmlLabel.hpp delete mode 100644 model/unit_tests/TestXmlUtil.h create mode 100644 model/unit_tests/TestXmlUtil.hpp delete mode 100644 model/unit_tests/Test_Constants.h create mode 100644 model/unit_tests/Test_Constants.hpp diff --git a/.clang-format b/.clang-format index 2dca92f..69ed632 100644 --- a/.clang-format +++ b/.clang-format @@ -1,28 +1,72 @@ --- Language: Cpp -# BasedOnStyle: Google AccessModifierOffset: -8 AlignAfterOpenBracket: Align -AlignConsecutiveAssignments: true -AlignConsecutiveDeclarations: true -AlignEscapedNewlinesLeft: true -AlignOperands: true -AlignTrailingComments: true +AlignArrayOfStructures: None +AlignConsecutiveAssignments: + Enabled: true + AcrossEmptyLines: false + AcrossComments: false + AlignCompound: false + AlignFunctionPointers: false + PadOperators: true +AlignConsecutiveBitFields: + Enabled: false + AcrossEmptyLines: false + AcrossComments: false + AlignCompound: false + AlignFunctionPointers: false + PadOperators: false +AlignConsecutiveDeclarations: + Enabled: true + AcrossEmptyLines: false + AcrossComments: false + AlignCompound: false + AlignFunctionPointers: false + PadOperators: true +AlignConsecutiveMacros: + Enabled: false + AcrossEmptyLines: false + AcrossComments: false + AlignCompound: false + AlignFunctionPointers: false + PadOperators: false +AlignConsecutiveShortCaseStatements: + Enabled: false + AcrossEmptyLines: false + AcrossComments: false + AlignCaseColons: false +AlignEscapedNewlines: Left +AlignOperands: Align +AlignTrailingComments: + Kind: Always + OverEmptyLines: 0 +AllowAllArgumentsOnNextLine: true AllowAllParametersOfDeclarationOnNextLine: true -AllowShortBlocksOnASingleLine: false +AllowBreakBeforeNoexceptSpecifier: Never +AllowShortBlocksOnASingleLine: Never AllowShortCaseLabelsOnASingleLine: false +AllowShortCompoundRequirementOnASingleLine: true +AllowShortEnumsOnASingleLine: true AllowShortFunctionsOnASingleLine: Inline -AllowShortIfStatementsOnASingleLine: false +AllowShortIfStatementsOnASingleLine: Never +AllowShortLambdasOnASingleLine: All AllowShortLoopsOnASingleLine: false +AlwaysBreakAfterDefinitionReturnType: None AlwaysBreakAfterReturnType: None AlwaysBreakBeforeMultilineStrings: false -AlwaysBreakTemplateDeclarations: true +AlwaysBreakTemplateDeclarations: Yes +AttributeMacros: + - __capability BinPackArguments: false BinPackParameters: false -BraceWrapping: +BitFieldColonSpacing: Both +BraceWrapping: + AfterCaseLabel: false AfterClass: true - AfterControlStatement: true + AfterControlStatement: Always AfterEnum: true + AfterExternBlock: false AfterFunction: true AfterNamespace: true AfterObjCDeclaration: true @@ -30,62 +74,176 @@ BraceWrapping: AfterUnion: true BeforeCatch: true BeforeElse: true + BeforeLambdaBody: false + BeforeWhile: false IndentBraces: false + SplitEmptyFunction: true + SplitEmptyRecord: true + SplitEmptyNamespace: true +BreakAdjacentStringLiterals: true +BreakAfterAttributes: Leave +BreakAfterJavaFieldAnnotations: false +BreakArrays: true BreakBeforeBinaryOperators: None +BreakBeforeConceptDeclarations: Always BreakBeforeBraces: Custom +BreakBeforeInlineASMColon: OnlyMultiline BreakBeforeTernaryOperators: true -BreakConstructorInitializersBeforeComma: false +BreakConstructorInitializers: BeforeColon +BreakInheritanceList: BeforeColon +BreakStringLiterals: true ColumnLimit: 110 CommentPragmas: '^ IWYU pragma:' -ConstructorInitializerAllOnOneLineOrOnePerLine: true +CompactNamespaces: false ConstructorInitializerIndentWidth: 8 ContinuationIndentWidth: 8 Cpp11BracedListStyle: true DerivePointerAlignment: true DisableFormat: false +EmptyLineAfterAccessModifier: Never +EmptyLineBeforeAccessModifier: LogicalBlock ExperimentalAutoDetectBinPacking: false -ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ] -IncludeCategories: +FixNamespaceComments: false +ForEachMacros: + - foreach + - Q_FOREACH + - BOOST_FOREACH +IfMacros: + - KJ_IF_MAYBE +IncludeBlocks: Preserve +IncludeCategories: - Regex: '^"[A-Z].*\.h' Priority: 1 + SortPriority: 0 + CaseSensitive: false - Regex: '^' Priority: 2 + SortPriority: 0 + CaseSensitive: false - Regex: '^<[a-z]*>' Priority: 3 + SortPriority: 0 + CaseSensitive: false - Regex: '.*' Priority: 4 + SortPriority: 0 + CaseSensitive: false +IncludeIsMainRegex: '(Test)?$' +IncludeIsMainSourceRegex: '' +IndentAccessModifiers: false +IndentCaseBlocks: false IndentCaseLabels: false +IndentExternBlock: AfterExternBlock +IndentGotoLabels: true +IndentPPDirectives: None +IndentRequiresClause: true IndentWidth: 8 IndentWrappedFunctionNames: false +InsertBraces: false +InsertNewlineAtEOF: false +InsertTrailingCommas: None +IntegerLiteralSeparator: + Binary: 0 + BinaryMinDigits: 0 + Decimal: 0 + DecimalMinDigits: 0 + Hex: 0 + HexMinDigits: 0 +JavaScriptQuotes: Leave +JavaScriptWrapImports: true KeepEmptyLinesAtTheStartOfBlocks: true +KeepEmptyLinesAtEOF: false +LambdaBodyIndentation: Signature +LineEnding: DeriveLF MacroBlockBegin: '' MacroBlockEnd: '' MaxEmptyLinesToKeep: 2 NamespaceIndentation: All +ObjCBinPackProtocolList: Auto ObjCBlockIndentWidth: 2 +ObjCBreakBeforeNestedBlockParam: true ObjCSpaceAfterProperty: false ObjCSpaceBeforeProtocolList: false +PackConstructorInitializers: NextLine +PenaltyBreakAssignment: 2 PenaltyBreakBeforeFirstCallParameter: 1 PenaltyBreakComment: 300 PenaltyBreakFirstLessLess: 120 +PenaltyBreakOpenParenthesis: 0 +PenaltyBreakScopeResolution: 500 PenaltyBreakString: 1000 +PenaltyBreakTemplateDeclaration: 10 PenaltyExcessCharacter: 1000000 +PenaltyIndentedWhitespace: 0 PenaltyReturnTypeOnItsOwnLine: 200 PointerAlignment: Left +PPIndentWidth: -1 +QualifierAlignment: Leave +ReferenceAlignment: Pointer ReflowComments: true -SortIncludes: true +RemoveBracesLLVM: false +RemoveParentheses: Leave +RemoveSemicolon: false +RequiresClausePosition: OwnLine +RequiresExpressionIndentation: OuterScope +SeparateDefinitionBlocks: Leave +ShortNamespaceLines: 1 +SkipMacroDefinitionBody: false +SortIncludes: CaseSensitive +SortJavaStaticImport: Before +SortUsingDeclarations: LexicographicNumeric SpaceAfterCStyleCast: false +SpaceAfterLogicalNot: false +SpaceAfterTemplateKeyword: true +SpaceAroundPointerQualifiers: Default SpaceBeforeAssignmentOperators: true +SpaceBeforeCaseColon: false +SpaceBeforeCpp11BracedList: false +SpaceBeforeCtorInitializerColon: true +SpaceBeforeInheritanceColon: true +SpaceBeforeJsonColon: false SpaceBeforeParens: ControlStatements -SpaceInEmptyParentheses: false +SpaceBeforeParensOptions: + AfterControlStatements: true + AfterForeachMacros: true + AfterFunctionDefinitionName: false + AfterFunctionDeclarationName: false + AfterIfMacros: true + AfterOverloadedOperator: false + AfterPlacementOperator: true + AfterRequiresInClause: false + AfterRequiresInExpression: false + BeforeNonEmptyParentheses: false +SpaceBeforeRangeBasedForLoopColon: true +SpaceBeforeSquareBrackets: false +SpaceInEmptyBlock: false SpacesBeforeTrailingComments: 1 -SpacesInAngles: false +SpacesInAngles: Never SpacesInContainerLiterals: true -SpacesInCStyleCastParentheses: false -SpacesInParentheses: true +SpacesInLineCommentPrefix: + Minimum: 1 + Maximum: -1 +SpacesInParens: Custom +SpacesInParensOptions: + InCStyleCasts: false + InConditionalStatements: true + InEmptyParentheses: false + Other: true SpacesInSquareBrackets: false -Standard: Cpp11 +Standard: c++20 +StatementAttributeLikeMacros: + - Q_EMIT +StatementMacros: + - Q_UNUSED + - QT_REQUIRE_VERSION TabWidth: 8 -UseTab: ForIndentation +UseTab: Never +VerilogBreakBetweenInstancePorts: true +WhitespaceSensitiveMacros: + - BOOST_PP_STRINGIZE + - CF_SWIFT_NAME + - NS_SWIFT_NAME + - PP_STRINGIZE + - STRINGIZE ... diff --git a/CMakeLists.txt b/CMakeLists.txt index c87f4d1..00bcfb5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -167,6 +167,7 @@ if (Qt6Test_FOUND) enable_testing () endif () + #======================================= # Subdirectories #======================================= diff --git a/backends/barcode/Backends.cpp b/backends/barcode/Backends.cpp index 0cb9db2..d295622 100644 --- a/backends/barcode/Backends.cpp +++ b/backends/barcode/Backends.cpp @@ -1,599 +1,597 @@ -/* Backends.cpp - * - * Copyright (C) 2014 Jaye Evins - * - * This file is part of gLabels-qt. - * - * gLabels-qt is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * gLabels-qt is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with gLabels-qt. If not, see . - */ - -#include "Backends.h" - -#include "GnuBarcode.h" -#include "QrEncode.h" -#include "Zint.h" - -#include "glbarcode/Factory.h" +// Backends.cpp +// +// Copyright (C) 2014 Jaye Evins +// +// This file is part of gLabels-qt. +// +// gLabels-qt is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// gLabels-qt is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with gLabels-qt. If not, see . +// -namespace glabels +#include "Backends.hpp" + +#include "GnuBarcode.hpp" +#include "QrEncode.hpp" +#include "Zint.hpp" + +#include "glbarcode/Factory.hpp" + + +namespace glabels::barcode { - namespace barcode - { - - // - // Static data - // - QStringList Backends::mBackendIdList; - QMap Backends::mBackendNameMap; - QList