rhodes 5.5.15 → 5.5.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (458) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +48 -13
  3. data/doc/oss/WM_CE_Installation_And_Build_Guidelines.md +1 -1
  4. data/lib/commonAPI/barcode/ext.yml +6 -2
  5. data/lib/commonAPI/barcode/ext/barcode.xml +1 -1
  6. data/lib/commonAPI/barcode/ext/build.bat +8 -0
  7. data/lib/commonAPI/barcode/ext/platform/qt/Barcode.pro +90 -0
  8. data/lib/commonAPI/barcode/ext/platform/qt/Rakefile +35 -0
  9. data/lib/commonAPI/barcode/ext/platform/qt/resources/barcode.qrc +10 -0
  10. data/lib/commonAPI/barcode/ext/platform/qt/resources/buttonBack.png +0 -0
  11. data/lib/commonAPI/barcode/ext/platform/qt/resources/buttonRetry.png +0 -0
  12. data/lib/commonAPI/barcode/ext/platform/qt/resources/buttonSave.png +0 -0
  13. data/lib/commonAPI/barcode/ext/platform/qt/resources/scanner_sound.wav +0 -0
  14. data/lib/commonAPI/barcode/ext/platform/qt/src/BarcodeController.cpp +40 -0
  15. data/lib/commonAPI/barcode/ext/platform/qt/src/BarcodeController.h +57 -0
  16. data/lib/commonAPI/barcode/ext/platform/qt/src/BarcodeDialogBuilder.h +52 -0
  17. data/lib/commonAPI/barcode/ext/platform/qt/src/BarcodeDialogView.cpp +175 -0
  18. data/lib/commonAPI/barcode/ext/platform/qt/src/BarcodeDialogView.h +68 -0
  19. data/lib/commonAPI/barcode/ext/platform/qt/src/Barcode_impl.cpp +109 -0
  20. data/lib/commonAPI/barcode/ext/platform/qt/src/decoderthread.cpp +39 -0
  21. data/lib/commonAPI/barcode/ext/platform/qt/src/decoderthread.h +29 -0
  22. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/CameraImageWrapper.cpp +131 -0
  23. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/CameraImageWrapper.h +39 -0
  24. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/QZXing.h +173 -0
  25. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/QZXing.pri +277 -0
  26. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/QZXing_global.h +13 -0
  27. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/imagehandler.cpp +45 -0
  28. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/imagehandler.h +23 -0
  29. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/qzxing.cpp +303 -0
  30. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/bigint/BigInteger.cc +405 -0
  31. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/bigint/BigInteger.hh +215 -0
  32. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/bigint/BigIntegerAlgorithms.cc +70 -0
  33. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/bigint/BigIntegerAlgorithms.hh +25 -0
  34. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/bigint/BigIntegerLibrary.hh +8 -0
  35. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/bigint/BigIntegerUtils.cc +50 -0
  36. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/bigint/BigIntegerUtils.hh +72 -0
  37. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/bigint/BigUnsigned.cc +697 -0
  38. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/bigint/BigUnsigned.hh +418 -0
  39. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/bigint/BigUnsignedInABase.cc +125 -0
  40. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/bigint/BigUnsignedInABase.hh +122 -0
  41. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/bigint/ChangeLog +146 -0
  42. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/bigint/NumberlikeArray.hh +177 -0
  43. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/bigint/README +71 -0
  44. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/win32/zxing/iconv.h +14 -0
  45. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/win32/zxing/msvc/stdint.h +247 -0
  46. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/win32/zxing/win_iconv.c +2035 -0
  47. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/BarcodeFormat.cpp +40 -0
  48. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/BarcodeFormat.h +60 -0
  49. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/Binarizer.cpp +45 -0
  50. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/Binarizer.h +50 -0
  51. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/BinaryBitmap.cpp +70 -0
  52. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/BinaryBitmap.h +56 -0
  53. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/ChecksumException.cpp +28 -0
  54. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/ChecksumException.h +34 -0
  55. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/DecodeHints.cpp +148 -0
  56. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/DecodeHints.h +85 -0
  57. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/Exception.cpp +43 -0
  58. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/Exception.h +51 -0
  59. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/FormatException.cpp +41 -0
  60. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/FormatException.h +37 -0
  61. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/IllegalStateException.h +35 -0
  62. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/InvertedLuminanceSource.cpp +68 -0
  63. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/InvertedLuminanceSource.h +48 -0
  64. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/LuminanceSource.cpp +86 -0
  65. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/LuminanceSource.h +59 -0
  66. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/MultiFormatReader.cpp +124 -0
  67. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/MultiFormatReader.h +48 -0
  68. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/NotFoundException.h +35 -0
  69. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/Reader.cpp +31 -0
  70. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/Reader.h +40 -0
  71. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/ReaderException.h +37 -0
  72. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/Result.cpp +66 -0
  73. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/Result.h +57 -0
  74. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/ResultIO.cpp +34 -0
  75. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/ResultPoint.cpp +108 -0
  76. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/ResultPoint.h +55 -0
  77. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/ResultPointCallback.cpp +26 -0
  78. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/ResultPointCallback.h +39 -0
  79. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/WriterException.h +17 -0
  80. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/ZXing.h +140 -0
  81. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/aztec/AztecDetectorResult.cpp +54 -0
  82. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/aztec/AztecDetectorResult.h +48 -0
  83. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/aztec/AztecReader.cpp +68 -0
  84. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/aztec/AztecReader.h +49 -0
  85. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/aztec/decoder/AztecDecoder.cpp +495 -0
  86. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/aztec/decoder/Decoder.h +69 -0
  87. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/aztec/detector/AztecDetector.cpp +548 -0
  88. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/aztec/detector/Detector.h +92 -0
  89. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/common/Array.h +173 -0
  90. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/common/BitArray.cpp +237 -0
  91. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/common/BitArray.h +97 -0
  92. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/common/BitArrayIO.cpp +31 -0
  93. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/common/BitMatrix.cpp +143 -0
  94. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/common/BitMatrix.h +91 -0
  95. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/common/BitSource.cpp +76 -0
  96. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/common/BitSource.h +74 -0
  97. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/common/CharacterSetECI.cpp +104 -0
  98. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/common/CharacterSetECI.h +53 -0
  99. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/common/Counted.h +140 -0
  100. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/common/DecoderResult.cpp +51 -0
  101. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/common/DecoderResult.h +54 -0
  102. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/common/DetectorResult.cpp +39 -0
  103. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/common/DetectorResult.h +43 -0
  104. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/common/GlobalHistogramBinarizer.cpp +212 -0
  105. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/common/GlobalHistogramBinarizer.h +48 -0
  106. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/common/GreyscaleLuminanceSource.cpp +80 -0
  107. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/common/GreyscaleLuminanceSource.h +53 -0
  108. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/common/GreyscaleRotatedLuminanceSource.cpp +81 -0
  109. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/common/GreyscaleRotatedLuminanceSource.h +46 -0
  110. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/common/GridSampler.cpp +122 -0
  111. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/common/GridSampler.h +45 -0
  112. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/common/HybridBinarizer.cpp +226 -0
  113. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/common/HybridBinarizer.h +67 -0
  114. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/common/IllegalArgumentException.cpp +27 -0
  115. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/common/IllegalArgumentException.h +36 -0
  116. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/common/PerspectiveTransform.cpp +107 -0
  117. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/common/PerspectiveTransform.h +49 -0
  118. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/common/Point.h +47 -0
  119. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/common/Str.cpp +61 -0
  120. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/common/Str.h +51 -0
  121. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/common/StringUtils.cpp +198 -0
  122. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/common/StringUtils.h +52 -0
  123. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/common/detector/JavaMath.h +43 -0
  124. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/common/detector/MathUtils.h +57 -0
  125. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/common/detector/MonochromeRectangleDetector.cpp +175 -0
  126. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/common/detector/MonochromeRectangleDetector.h +62 -0
  127. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/common/detector/WhiteRectangleDetector.cpp +330 -0
  128. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/common/detector/WhiteRectangleDetector.h +59 -0
  129. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/common/reedsolomon/GenericGF.cpp +150 -0
  130. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/common/reedsolomon/GenericGF.h +73 -0
  131. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/common/reedsolomon/GenericGFPoly.cpp +218 -0
  132. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/common/reedsolomon/GenericGFPoly.h +56 -0
  133. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/common/reedsolomon/ReedSolomonDecoder.cpp +174 -0
  134. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/common/reedsolomon/ReedSolomonDecoder.h +49 -0
  135. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/common/reedsolomon/ReedSolomonException.cpp +30 -0
  136. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/common/reedsolomon/ReedSolomonException.h +33 -0
  137. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/datamatrix/DataMatrixReader.cpp +54 -0
  138. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/datamatrix/DataMatrixReader.h +45 -0
  139. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/datamatrix/DataMatrixVersion.cpp +199 -0
  140. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/datamatrix/Version.h +87 -0
  141. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/datamatrix/decoder/BitMatrixParser.h +59 -0
  142. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/datamatrix/decoder/DataBlock.h +49 -0
  143. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/datamatrix/decoder/DataMatrixBitMatrixParser.cpp +361 -0
  144. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/datamatrix/decoder/DataMatrixDataBlock.cpp +113 -0
  145. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/datamatrix/decoder/DataMatrixDecodedBitStreamParser.cpp +416 -0
  146. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/datamatrix/decoder/DataMatrixDecoder.cpp +93 -0
  147. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/datamatrix/decoder/DecodedBitStreamParser.h +104 -0
  148. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/datamatrix/decoder/Decoder.h +49 -0
  149. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/datamatrix/detector/CornerPoint.h +43 -0
  150. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/datamatrix/detector/DataMatrixCornerPoint.cpp +46 -0
  151. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/datamatrix/detector/DataMatrixDetector.cpp +447 -0
  152. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/datamatrix/detector/DataMatrixDetectorException.cpp +23 -0
  153. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/datamatrix/detector/Detector.h +94 -0
  154. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/datamatrix/detector/DetectorException.h +23 -0
  155. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/multi/ByQuadrantReader.cpp +75 -0
  156. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/multi/ByQuadrantReader.h +42 -0
  157. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/multi/GenericMultipleBarcodeReader.cpp +137 -0
  158. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/multi/GenericMultipleBarcodeReader.h +51 -0
  159. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/multi/MultipleBarcodeReader.cpp +29 -0
  160. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/multi/MultipleBarcodeReader.h +41 -0
  161. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/multi/qrcode/QRCodeMultiReader.cpp +58 -0
  162. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/multi/qrcode/QRCodeMultiReader.h +36 -0
  163. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/multi/qrcode/detector/MultiDetector.cpp +47 -0
  164. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/multi/qrcode/detector/MultiDetector.h +37 -0
  165. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/multi/qrcode/detector/MultiFinderPatternFinder.cpp +236 -0
  166. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/multi/qrcode/detector/MultiFinderPatternFinder.h +47 -0
  167. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/oned/CodaBarReader.cpp +340 -0
  168. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/oned/CodaBarReader.h +57 -0
  169. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/oned/Code128Reader.cpp +497 -0
  170. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/oned/Code128Reader.h +48 -0
  171. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/oned/Code39Reader.cpp +329 -0
  172. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/oned/Code39Reader.h +63 -0
  173. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/oned/Code93Reader.cpp +293 -0
  174. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/oned/Code93Reader.h +58 -0
  175. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/oned/EAN13Reader.cpp +85 -0
  176. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/oned/EAN13Reader.h +49 -0
  177. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/oned/EAN8Reader.cpp +65 -0
  178. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/oned/EAN8Reader.h +47 -0
  179. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/oned/ITFReader.cpp +337 -0
  180. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/oned/ITFReader.h +54 -0
  181. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/oned/MultiFormatOneDReader.cpp +96 -0
  182. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/oned/MultiFormatOneDReader.h +38 -0
  183. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/oned/MultiFormatUPCEANReader.cpp +110 -0
  184. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/oned/MultiFormatUPCEANReader.h +41 -0
  185. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/oned/OneDReader.cpp +228 -0
  186. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/oned/OneDReader.h +81 -0
  187. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/oned/OneDResultPoint.cpp +28 -0
  188. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/oned/OneDResultPoint.h +35 -0
  189. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/oned/UPCAReader.cpp +71 -0
  190. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/oned/UPCAReader.h +50 -0
  191. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/oned/UPCEANReader.cpp +309 -0
  192. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/oned/UPCEANReader.h +88 -0
  193. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/oned/UPCEReader.cpp +146 -0
  194. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/oned/UPCEReader.h +47 -0
  195. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/pdf417/PDF417Reader.cpp +170 -0
  196. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/pdf417/PDF417Reader.h +49 -0
  197. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/pdf417/decoder/BitMatrixParser.h +84 -0
  198. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/pdf417/decoder/DecodedBitStreamParser.h +84 -0
  199. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/pdf417/decoder/Decoder.h +62 -0
  200. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/pdf417/decoder/PDF417BitMatrixParser.cpp +997 -0
  201. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/pdf417/decoder/PDF417DecodedBitStreamParser.cpp +563 -0
  202. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/pdf417/decoder/PDF417Decoder.cpp +118 -0
  203. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/pdf417/decoder/ec/ErrorCorrection.cpp +214 -0
  204. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/pdf417/decoder/ec/ErrorCorrection.h +71 -0
  205. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/pdf417/decoder/ec/ModulusGF.cpp +120 -0
  206. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/pdf417/decoder/ec/ModulusGF.h +72 -0
  207. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/pdf417/decoder/ec/ModulusPoly.cpp +284 -0
  208. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/pdf417/decoder/ec/ModulusPoly.h +68 -0
  209. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/pdf417/detector/Detector.h +106 -0
  210. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/pdf417/detector/LinesSampler.cpp +719 -0
  211. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/pdf417/detector/LinesSampler.h +122 -0
  212. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/pdf417/detector/PDF417Detector.cpp +664 -0
  213. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/qrcode/ErrorCorrectionLevel.h +55 -0
  214. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/qrcode/FormatInformation.h +54 -0
  215. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/qrcode/QRCodeReader.cpp +52 -0
  216. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/qrcode/QRCodeReader.h +48 -0
  217. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/qrcode/QRErrorCorrectionLevel.cpp +70 -0
  218. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/qrcode/QRFormatInformation.cpp +117 -0
  219. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/qrcode/QRVersion.cpp +566 -0
  220. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/qrcode/Version.h +86 -0
  221. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/qrcode/decoder/BitMatrixParser.h +56 -0
  222. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/qrcode/decoder/DataBlock.h +50 -0
  223. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/qrcode/decoder/DataMask.h +50 -0
  224. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/qrcode/decoder/DecodedBitStreamParser.h +72 -0
  225. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/qrcode/decoder/Decoder.h +46 -0
  226. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/qrcode/decoder/Mode.h +68 -0
  227. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/qrcode/decoder/QRBitMatrixParser.cpp +183 -0
  228. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/qrcode/decoder/QRDataBlock.cpp +118 -0
  229. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/qrcode/decoder/QRDataMask.cpp +159 -0
  230. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/qrcode/decoder/QRDecodedBitStreamParser.cpp +433 -0
  231. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/qrcode/decoder/QRDecoder.cpp +107 -0
  232. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/qrcode/decoder/QRMode.cpp +118 -0
  233. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/qrcode/detector/AlignmentPattern.h +45 -0
  234. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/qrcode/detector/AlignmentPatternFinder.h +68 -0
  235. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/qrcode/detector/Detector.h +69 -0
  236. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/qrcode/detector/FinderPattern.h +48 -0
  237. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/qrcode/detector/FinderPatternFinder.h +80 -0
  238. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/qrcode/detector/FinderPatternInfo.h +47 -0
  239. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/qrcode/detector/QRAlignmentPattern.cpp +47 -0
  240. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/qrcode/detector/QRAlignmentPatternFinder.cpp +208 -0
  241. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/qrcode/detector/QRDetector.cpp +315 -0
  242. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/qrcode/detector/QRFinderPattern.cpp +69 -0
  243. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/qrcode/detector/QRFinderPatternFinder.cpp +638 -0
  244. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/zxing/zxing/qrcode/detector/QRFinderPatternInfo.cpp +41 -0
  245. data/lib/commonAPI/coreapi/ext.yml +1 -1
  246. data/lib/commonAPI/coreapi/ext/platform/android/src/com/rho/network/Network.java +21 -7
  247. data/lib/commonAPI/coreapi/ext/platform/qt/coreapi.pro +10 -0
  248. data/lib/commonAPI/coreapi/ext/platform/wm/src/Registry.cpp +57 -7
  249. data/lib/commonAPI/coreapi/ext/shared/SystemImplBase.cpp +11 -0
  250. data/lib/commonAPI/coreapi/ext/shared/SystemImplBase.h +2 -0
  251. data/lib/commonAPI/coreapi/ext/shared/qt/NavbarImpl.cpp +1 -1
  252. data/lib/commonAPI/coreapi/ext/system.xml +3 -0
  253. data/lib/commonAPI/coreapi/ext/webview.xml +0 -2
  254. data/lib/commonAPI/coreapi/public/api/rhonodejsapi.js +921 -0
  255. data/lib/commonAPI/mediacapture/ext.yml +1 -0
  256. data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraObject.java +3 -2
  257. data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraRhoListener.java +260 -230
  258. data/lib/commonAPI/mediacapture/ext/platform/qt/MediaCapture.pro +17 -5
  259. data/lib/commonAPI/mediacapture/ext/platform/qt/resources/buttonBack.png +0 -0
  260. data/lib/commonAPI/mediacapture/ext/platform/qt/resources/mediacapture.qrc +1 -0
  261. data/lib/commonAPI/mediacapture/ext/platform/qt/src/CCameraData.cpp +11 -4
  262. data/lib/commonAPI/mediacapture/ext/platform/qt/src/CCameraData.h +4 -7
  263. data/lib/commonAPI/mediacapture/ext/platform/qt/src/CameraDialogView.h +1 -6
  264. data/lib/commonAPI/mediacapture/ext/platform/qt/src/CameraRefresher.h +54 -0
  265. data/lib/commonAPI/mediacapture/ext/platform/qt/src/Camera_impl.cpp +15 -21
  266. data/lib/commonAPI/mediacapture/ext/platform/qt/src/ImageFilenameGetterResult.h +7 -2
  267. data/lib/commonAPI/mediacapture/ext/platform/qt/src/cameradialogview.cpp +34 -32
  268. data/lib/extensions/zlib/ext/zlib.pro +11 -0
  269. data/platform/android/Rhodes/jni/src/fileapi.cpp +36 -22
  270. data/platform/iphone/Classes/SimpleMainView.m +1 -1
  271. data/platform/shared/api_generator/MethodResult.cpp +22 -7
  272. data/platform/shared/api_generator/MethodResult.h +3 -1
  273. data/platform/shared/api_generator/iphone/CMethodResult.m +6 -2
  274. data/platform/shared/api_generator/js_helpers.cpp +19 -0
  275. data/platform/shared/api_generator/js_helpers.h +23 -0
  276. data/platform/shared/common/RhoConf.cpp +0 -1
  277. data/platform/shared/common/RhoPort.h +3 -0
  278. data/platform/shared/common/RhodesApp.cpp +46 -11
  279. data/platform/shared/common/RhodesApp.h +7 -0
  280. data/platform/shared/common/RhodesAppBase.cpp +5 -1
  281. data/platform/shared/common/RhodesAppBase.h +8 -1
  282. data/platform/shared/common/ThreadQueue.h +1 -1
  283. data/platform/shared/common/map/BaseMapEngine.cpp +2 -0
  284. data/platform/shared/net/HttpServer.cpp +0 -1
  285. data/platform/shared/qt/RhoSimulator.pro +11 -0
  286. data/platform/shared/qt/RhoSimulator_dev.pro +12 -2
  287. data/platform/shared/qt/curl/curl.pro +10 -0
  288. data/platform/shared/qt/rhodes/guithreadfunchelper.h +29 -0
  289. data/platform/shared/qt/rhodes/iexecutable.h +9 -0
  290. data/platform/shared/qt/rhodes/impl/MainWindowImpl.cpp +10 -21
  291. data/platform/shared/qt/rhodes/impl/MainWindowImpl.h +1 -1
  292. data/platform/shared/qt/rhodes/impl/QtSystemImpl.cpp +15 -1
  293. data/platform/shared/qt/rhodes/impl/RhoThreadImpl.cpp +7 -7
  294. data/platform/shared/qt/rhodes/mainwindowinterface.h +12 -0
  295. data/platform/shared/qt/rhodes/newVersion/DateTimeDialog.cpp +96 -0
  296. data/platform/shared/qt/rhodes/newVersion/DateTimeDialog.h +54 -0
  297. data/platform/shared/qt/rhodes/newVersion/ExternalWebView.cpp +45 -0
  298. data/platform/shared/qt/rhodes/newVersion/ExternalWebView.h +47 -0
  299. data/platform/shared/qt/rhodes/newVersion/QWebEngineViewSelectionSuppressor.h +103 -0
  300. data/platform/shared/qt/rhodes/newVersion/QtMainWindow.cpp +1181 -0
  301. data/platform/shared/qt/rhodes/newVersion/QtMainWindow.h +194 -0
  302. data/platform/shared/qt/rhodes/newVersion/QtNativeTabBar.cpp +107 -0
  303. data/platform/shared/qt/rhodes/newVersion/QtNativeTabBar.h +40 -0
  304. data/platform/shared/qt/rhodes/newVersion/RhoNativeApiCall.cpp +51 -0
  305. data/platform/shared/qt/rhodes/newVersion/RhoNativeApiCall.h +52 -0
  306. data/platform/shared/qt/rhodes/newVersion/main.cpp +280 -0
  307. data/platform/shared/qt/rhodes/newVersion/qtwebenginepage.cpp +19 -0
  308. data/platform/shared/qt/rhodes/newVersion/qtwebenginepage.h +21 -0
  309. data/platform/shared/qt/rhodes/newVersion/qtwebengineview.cpp +6 -0
  310. data/platform/shared/qt/rhodes/newVersion/qtwebengineview.h +18 -0
  311. data/platform/shared/qt/rhodes/{DateTimeDialog.cpp → oldVersion/DateTimeDialog.cpp} +0 -0
  312. data/platform/shared/qt/rhodes/{DateTimeDialog.h → oldVersion/DateTimeDialog.h} +0 -0
  313. data/platform/shared/qt/rhodes/{DateTimeDialog.ui → oldVersion/DateTimeDialog.ui} +0 -0
  314. data/platform/shared/qt/rhodes/{ExternalWebView.cpp → oldVersion/ExternalWebView.cpp} +0 -0
  315. data/platform/shared/qt/rhodes/{ExternalWebView.h → oldVersion/ExternalWebView.h} +0 -0
  316. data/platform/shared/qt/rhodes/{ExternalWebView.ui → oldVersion/ExternalWebView.ui} +0 -0
  317. data/platform/shared/qt/rhodes/{QtMainWindow.cpp → oldVersion/QtMainWindow.cpp} +4 -1
  318. data/platform/shared/qt/rhodes/{QtMainWindow.h → oldVersion/QtMainWindow.h} +8 -5
  319. data/platform/shared/qt/rhodes/{QtMainWindow.ui → oldVersion/QtMainWindow.ui} +0 -0
  320. data/platform/shared/qt/rhodes/{QtNativeTabBar.cpp → oldVersion/QtNativeTabBar.cpp} +0 -0
  321. data/platform/shared/qt/rhodes/{QtNativeTabBar.h → oldVersion/QtNativeTabBar.h} +0 -0
  322. data/platform/shared/qt/rhodes/{QtWebInspector.cpp → oldVersion/QtWebInspector.cpp} +0 -0
  323. data/platform/shared/qt/rhodes/{QtWebInspector.h → oldVersion/QtWebInspector.h} +0 -0
  324. data/platform/shared/qt/rhodes/{QtWebInspector.ui → oldVersion/QtWebInspector.ui} +0 -0
  325. data/platform/shared/qt/rhodes/{QtWebPage.cpp → oldVersion/QtWebPage.cpp} +0 -0
  326. data/platform/shared/qt/rhodes/{QtWebPage.h → oldVersion/QtWebPage.h} +0 -0
  327. data/platform/shared/qt/rhodes/{RhoNativeApiCall.cpp → oldVersion/RhoNativeApiCall.cpp} +0 -0
  328. data/platform/shared/qt/rhodes/{RhoNativeApiCall.h → oldVersion/RhoNativeApiCall.h} +0 -0
  329. data/platform/shared/qt/rhodes/{main.cpp → oldVersion/main.cpp} +2 -0
  330. data/platform/shared/qt/rhodes/{qkineticscroller.cpp → oldVersion/qkineticscroller.cpp} +0 -0
  331. data/platform/shared/qt/rhodes/{qkineticscroller.h → oldVersion/qkineticscroller.h} +0 -0
  332. data/platform/shared/qt/rhodes/{qkineticscroller_p.h → oldVersion/qkineticscroller_p.h} +0 -0
  333. data/platform/shared/qt/rhodes/{qtflickgesture.cpp → oldVersion/qtflickgesture.cpp} +0 -0
  334. data/platform/shared/qt/rhodes/{qtflickgesture_p.h → oldVersion/qtflickgesture_p.h} +0 -0
  335. data/platform/shared/qt/rhodes/{qtscroller.cpp → oldVersion/qtscroller.cpp} +0 -0
  336. data/platform/shared/qt/rhodes/{qtscroller.h → oldVersion/qtscroller.h} +0 -0
  337. data/platform/shared/qt/rhodes/{qtscroller_p.h → oldVersion/qtscroller_p.h} +0 -0
  338. data/platform/shared/qt/rhodes/{qtscrollerfilter.cpp → oldVersion/qtscrollerfilter.cpp} +0 -0
  339. data/platform/shared/qt/rhodes/{qtscrollerfilter_p.h → oldVersion/qtscrollerfilter_p.h} +0 -0
  340. data/platform/shared/qt/rhodes/{qtscrollerproperties.cpp → oldVersion/qtscrollerproperties.cpp} +0 -0
  341. data/platform/shared/qt/rhodes/{qtscrollerproperties.h → oldVersion/qtscrollerproperties.h} +0 -0
  342. data/platform/shared/qt/rhodes/{qtscrollerproperties_p.h → oldVersion/qtscrollerproperties_p.h} +0 -0
  343. data/platform/shared/qt/rhodes/{qtscrollevent.cpp → oldVersion/qtscrollevent.cpp} +0 -0
  344. data/platform/shared/qt/rhodes/{qtscrollevent.h → oldVersion/qtscrollevent.h} +0 -0
  345. data/platform/shared/qt/rhodes/{qtscrollevent_p.h → oldVersion/qtscrollevent_p.h} +0 -0
  346. data/platform/shared/qt/rhodes/{qwebviewkineticscroller.cpp → oldVersion/qwebviewkineticscroller.cpp} +0 -0
  347. data/platform/shared/qt/rhodes/{qwebviewkineticscroller.h → oldVersion/qwebviewkineticscroller.h} +0 -0
  348. data/platform/shared/qt/rhodes/{qwebviewselectionsuppressor.h → oldVersion/qwebviewselectionsuppressor.h} +0 -0
  349. data/platform/shared/qt/rhodes/rhodes.pro +92 -47
  350. data/platform/shared/qt/rholib/rholib.pro +32 -19
  351. data/platform/shared/qt/rubylib/rubylib.pro +12 -0
  352. data/platform/shared/qt/sqlite3/sqlite3.pro +11 -1
  353. data/platform/shared/qt/syncengine/syncengine.pro +10 -0
  354. data/platform/shared/ruby/eval.c +2 -4
  355. data/platform/shared/ruby/eval_intern.h +12 -0
  356. data/platform/shared/ruby/ext/rho/extensions.c +6 -2
  357. data/platform/shared/ruby/include/ruby/missing.h +6 -4
  358. data/platform/shared/ruby/io.c +27 -0
  359. data/platform/shared/ruby/numeric.c +5 -2
  360. data/platform/shared/ruby/time.c +4 -0
  361. data/platform/shared/ruby/win32/win32 backup.c +5808 -0
  362. data/platform/shared/ruby/win32/win32.c +2254 -2131
  363. data/platform/shared/unzip/deflate.cpp +6 -1
  364. data/platform/shared/unzip/gunzip.cpp +1 -1
  365. data/platform/shared/unzip/unzip.cpp +3 -6
  366. data/platform/shared/unzip/zip.cpp +1 -25
  367. data/platform/shared/unzip/zutil.cpp +1 -1
  368. data/platform/shared/unzip/zutil.h +1 -1
  369. data/platform/win32/RhoSimulator/rho/Databases/Databases.db +0 -0
  370. data/platform/win32/RhoSimulator/rho/WebpageIcons.db +0 -0
  371. data/platform/win32/RhoSimulator/rho/rholog.txt_pos +0 -0
  372. data/platform/win32/RhoSimulator/rhosimulator/Databases/Databases.db +0 -0
  373. data/platform/win32/RhoSimulator/rhosimulator/WebpageIcons.db +0 -0
  374. data/platform/win32/RhoSimulator/rhosimulator/rholog.txt_pos +0 -0
  375. data/platform/wm/build/build_inf.js +7 -3
  376. data/platform/wm/build/wm.rake +96 -30
  377. data/platform/wm/rhodes/rho/rubyext/SystemImpl.cpp +3 -1
  378. data/rakefile.rb +48 -13
  379. data/res/generators/rhogen.rb +87 -8
  380. data/res/generators/templates/api/cpp/montana_js_wrap.cpp +1 -1
  381. data/res/generators/templates/application/nodejs/main.js +501 -0
  382. data/res/generators/templates/application/nodejs/rhoapp.js +71 -0
  383. data/res/generators/templates/application/nodejs/server/app.js +19 -0
  384. data/res/generators/templates/application/nodejs/server/package.json +16 -0
  385. data/res/generators/templates/application/nodejs/server/public/bootstrap-3.3.7/css/bootstrap-theme.css +587 -0
  386. data/res/generators/templates/application/nodejs/server/public/bootstrap-3.3.7/css/bootstrap-theme.css.map +1 -0
  387. data/res/generators/templates/application/nodejs/server/public/bootstrap-3.3.7/css/bootstrap-theme.min.css +6 -0
  388. data/res/generators/templates/application/nodejs/server/public/bootstrap-3.3.7/css/bootstrap-theme.min.css.map +1 -0
  389. data/res/generators/templates/application/nodejs/server/public/bootstrap-3.3.7/css/bootstrap.css +6757 -0
  390. data/res/generators/templates/application/nodejs/server/public/bootstrap-3.3.7/css/bootstrap.css.map +1 -0
  391. data/res/generators/templates/application/nodejs/server/public/bootstrap-3.3.7/css/bootstrap.min.css +6 -0
  392. data/res/generators/templates/application/nodejs/server/public/bootstrap-3.3.7/css/bootstrap.min.css.map +1 -0
  393. data/res/generators/templates/application/nodejs/server/public/bootstrap-3.3.7/fonts/glyphicons-halflings-regular.eot +0 -0
  394. data/res/generators/templates/application/nodejs/server/public/bootstrap-3.3.7/fonts/glyphicons-halflings-regular.svg +288 -0
  395. data/res/generators/templates/application/nodejs/server/public/bootstrap-3.3.7/fonts/glyphicons-halflings-regular.ttf +0 -0
  396. data/res/generators/templates/application/nodejs/server/public/bootstrap-3.3.7/fonts/glyphicons-halflings-regular.woff +0 -0
  397. data/res/generators/templates/application/nodejs/server/public/bootstrap-3.3.7/fonts/glyphicons-halflings-regular.woff2 +0 -0
  398. data/res/generators/templates/application/nodejs/server/public/bootstrap-3.3.7/js/bootstrap.js +2377 -0
  399. data/res/generators/templates/application/nodejs/server/public/bootstrap-3.3.7/js/bootstrap.min.js +7 -0
  400. data/res/generators/templates/application/nodejs/server/public/bootstrap-3.3.7/js/npm.js +13 -0
  401. data/res/generators/templates/application/nodejs/server/public/images/bar/back_btn.png +0 -0
  402. data/res/generators/templates/application/nodejs/server/public/images/bar/back_btn@2x.png +0 -0
  403. data/res/generators/templates/application/nodejs/server/public/images/bar/back_btn@3x.png +0 -0
  404. data/res/generators/templates/application/nodejs/server/public/images/bar/forward_btn.png +0 -0
  405. data/res/generators/templates/application/nodejs/server/public/images/bar/forward_btn@2x.png +0 -0
  406. data/res/generators/templates/application/nodejs/server/public/images/bar/forward_btn@3x.png +0 -0
  407. data/res/generators/templates/application/nodejs/server/public/images/bar/gears.png +0 -0
  408. data/res/generators/templates/application/nodejs/server/public/images/bar/gears@2x.png +0 -0
  409. data/res/generators/templates/application/nodejs/server/public/images/bar/gears@3x.png +0 -0
  410. data/res/generators/templates/application/nodejs/server/public/images/bar/home_btn.png +0 -0
  411. data/res/generators/templates/application/nodejs/server/public/images/bar/home_btn@2x.png +0 -0
  412. data/res/generators/templates/application/nodejs/server/public/images/bar/home_btn@3x.png +0 -0
  413. data/res/generators/templates/application/nodejs/server/public/images/bar/sync_btn.png +0 -0
  414. data/res/generators/templates/application/nodejs/server/public/images/bar/sync_btn@2x.png +0 -0
  415. data/res/generators/templates/application/nodejs/server/public/images/bar/sync_btn@3x.png +0 -0
  416. data/res/generators/templates/application/nodejs/server/public/jquery/jquery-3.1.1.min.js +4 -0
  417. data/res/generators/templates/application/nodejs/server/public/jquery/jquery-3.1.1.min.map +1 -0
  418. data/res/generators/templates/application/nodejs_build.yml +76 -0
  419. data/res/generators/templates/application/nodejs_rhoconfig.txt +137 -0
  420. data/version +1 -1
  421. metadata +345 -77
  422. data/platform/win32/RhoSimulator/D3Dcompiler_46.dll +0 -0
  423. data/platform/win32/RhoSimulator/Qt5Core.dll +0 -0
  424. data/platform/win32/RhoSimulator/Qt5Gui.dll +0 -0
  425. data/platform/win32/RhoSimulator/Qt5Multimedia.dll +0 -0
  426. data/platform/win32/RhoSimulator/Qt5MultimediaWidgets.dll +0 -0
  427. data/platform/win32/RhoSimulator/Qt5Network.dll +0 -0
  428. data/platform/win32/RhoSimulator/Qt5OpenGL.dll +0 -0
  429. data/platform/win32/RhoSimulator/Qt5PrintSupport.dll +0 -0
  430. data/platform/win32/RhoSimulator/Qt5Qml.dll +0 -0
  431. data/platform/win32/RhoSimulator/Qt5Quick.dll +0 -0
  432. data/platform/win32/RhoSimulator/Qt5Sensors.dll +0 -0
  433. data/platform/win32/RhoSimulator/Qt5Sql.dll +0 -0
  434. data/platform/win32/RhoSimulator/Qt5V8.dll +0 -0
  435. data/platform/win32/RhoSimulator/Qt5WebKit.dll +0 -0
  436. data/platform/win32/RhoSimulator/Qt5WebKitWidgets.dll +0 -0
  437. data/platform/win32/RhoSimulator/Qt5Widgets.dll +0 -0
  438. data/platform/win32/RhoSimulator/RhoSimulator.exe +0 -0
  439. data/platform/win32/RhoSimulator/icudt52.dll +0 -0
  440. data/platform/win32/RhoSimulator/icuin52.dll +0 -0
  441. data/platform/win32/RhoSimulator/icuuc52.dll +0 -0
  442. data/platform/win32/RhoSimulator/imageformats/qgif.dll +0 -0
  443. data/platform/win32/RhoSimulator/imageformats/qico.dll +0 -0
  444. data/platform/win32/RhoSimulator/imageformats/qjpeg.dll +0 -0
  445. data/platform/win32/RhoSimulator/imageformats/qmng.dll +0 -0
  446. data/platform/win32/RhoSimulator/imageformats/qsvg.dll +0 -0
  447. data/platform/win32/RhoSimulator/imageformats/qtga.dll +0 -0
  448. data/platform/win32/RhoSimulator/imageformats/qtiff.dll +0 -0
  449. data/platform/win32/RhoSimulator/imageformats/qwbmp.dll +0 -0
  450. data/platform/win32/RhoSimulator/libEGL.dll +0 -0
  451. data/platform/win32/RhoSimulator/libGLESv2.dll +0 -0
  452. data/platform/win32/RhoSimulator/libeay32.dll +0 -0
  453. data/platform/win32/RhoSimulator/msvcp110.dll +0 -0
  454. data/platform/win32/RhoSimulator/msvcr110.dll +0 -0
  455. data/platform/win32/RhoSimulator/platforms/qwindows.dll +0 -0
  456. data/platform/win32/RhoSimulator/ssleay32.dll +0 -0
  457. data/platform/win32/RhoSimulator/vccorlib110.dll +0 -0
  458. data/platform/win32/RhoSimulator/vcomp110.dll +0 -0
@@ -0,0 +1,13 @@
1
+ #ifndef QZXING_GLOBAL_H
2
+ #define QZXING_GLOBAL_H
3
+
4
+ #include <QtCore>
5
+ #include <qglobal.h>
6
+
7
+ #if defined(QZXING_LIBRARY)
8
+ # define QZXINGSHARED_EXPORT Q_DECL_EXPORT
9
+ #else
10
+ # define QZXINGSHARED_EXPORT Q_DECL_IMPORT
11
+ #endif
12
+
13
+ #endif //QZXING_GLOBAL_H
@@ -0,0 +1,45 @@
1
+ #include "imagehandler.h"
2
+ #include <QGraphicsObject>
3
+ #include <QImage>
4
+ #include <QPainter>
5
+ #include <QStyleOptionGraphicsItem>
6
+ #include <QDebug>
7
+
8
+ ImageHandler::ImageHandler(QObject *parent) :
9
+ QObject(parent)
10
+ {
11
+ }
12
+
13
+ QImage ImageHandler::extractQImage(QObject *imageObj,
14
+ const double offsetX, const double offsetY,
15
+ const double width, const double height)
16
+ {
17
+ QGraphicsObject *item = qobject_cast<QGraphicsObject*>(imageObj);
18
+
19
+ if (!item) {
20
+ qDebug() << "Item is NULL";
21
+ return QImage();
22
+ }
23
+
24
+ QImage img(item->boundingRect().size().toSize(), QImage::Format_RGB32);
25
+ img.fill(QColor(255, 255, 255).rgb());
26
+ QPainter painter(&img);
27
+ QStyleOptionGraphicsItem styleOption;
28
+ item->paint(&painter, &styleOption);
29
+
30
+ if(offsetX == 0 && offsetY == 0 && width == 0 && height == 0)
31
+ return img;
32
+ else
33
+ {
34
+ return img.copy(offsetX, offsetY, width, height);
35
+ }
36
+ }
37
+
38
+ void ImageHandler::save(QObject *imageObj, const QString &path,
39
+ const double offsetX, const double offsetY,
40
+ const double width, const double height)
41
+ {
42
+ QImage img = extractQImage(imageObj, offsetX, offsetY, width, height);
43
+ img.save(path);
44
+ }
45
+
@@ -0,0 +1,23 @@
1
+ #ifndef IMAGEHANDLER_H
2
+ #define IMAGEHANDLER_H
3
+
4
+ #include <QObject>
5
+ #include <QImage>
6
+
7
+ class ImageHandler : public QObject
8
+ {
9
+ Q_OBJECT
10
+ public:
11
+ explicit ImageHandler(QObject *parent = 0);
12
+
13
+ QImage extractQImage(QObject *imageObj,
14
+ const double offsetX = 0 , const double offsetY = 0,
15
+ const double width = 0, const double height = 0);
16
+
17
+ public slots:
18
+ void save(QObject *item, const QString &path,
19
+ const double offsetX = 0, const double offsetY = 0,
20
+ const double width = 0, const double height = 0);
21
+ };
22
+
23
+ #endif // IMAGEHANDLER_H
@@ -0,0 +1,303 @@
1
+ #include "QZXing.h"
2
+
3
+ #include <zxing/common/GlobalHistogramBinarizer.h>
4
+ #include <zxing/Binarizer.h>
5
+ #include <zxing/BinaryBitmap.h>
6
+ #include <zxing/MultiFormatReader.h>
7
+ #include <zxing/DecodeHints.h>
8
+ #include "CameraImageWrapper.h"
9
+ #include "imagehandler.h"
10
+ #include <QTime>
11
+ #include <QUrl>
12
+ #include <zxing/qrcode/ErrorCorrectionLevel.h>
13
+ #include <QColor>
14
+
15
+ using namespace zxing;
16
+
17
+ QZXing::QZXing(QObject *parent) : QObject(parent)
18
+ {
19
+ isThreaded = true;
20
+
21
+ decoder = new MultiFormatReader();
22
+ setDecoder(DecoderFormat_QR_CODE |
23
+ DecoderFormat_DATA_MATRIX |
24
+ DecoderFormat_UPC_E |
25
+ DecoderFormat_UPC_A |
26
+ DecoderFormat_UPC_EAN_EXTENSION |
27
+ DecoderFormat_RSS_14 |
28
+ DecoderFormat_RSS_EXPANDED | //?
29
+ DecoderFormat_PDF_417 | //?
30
+ DecoderFormat_MAXICODE | //?
31
+ DecoderFormat_EAN_8 |
32
+ DecoderFormat_EAN_13 |
33
+ DecoderFormat_CODE_128 |
34
+ DecoderFormat_CODE_93 |
35
+ DecoderFormat_CODE_39 |
36
+ DecoderFormat_CODABAR |
37
+ DecoderFormat_ITF |
38
+ DecoderFormat_Aztec);
39
+ imageHandler = new ImageHandler();
40
+ }
41
+
42
+ QZXing::~QZXing()
43
+ {
44
+ if (imageHandler) delete imageHandler;
45
+ if (decoder) delete decoder;
46
+ }
47
+
48
+ QZXing::QZXing(QZXing::DecoderFormat decodeHints, QObject *parent) : QObject(parent)
49
+ {
50
+ decoder = new MultiFormatReader();
51
+ imageHandler = new ImageHandler();
52
+
53
+ setDecoder(decodeHints);
54
+ }
55
+
56
+ QString QZXing::decoderFormatToString(int fmt)
57
+ {
58
+ switch (fmt) {
59
+ case 1:
60
+ return "AZTEC";
61
+
62
+ case 2:
63
+ return "CODABAR";
64
+
65
+ case 3:
66
+ return "CODE_39";
67
+
68
+ case 4:
69
+ return "CODE_93";
70
+
71
+ case 5:
72
+ return "CODE_128";
73
+
74
+ case 6:
75
+ return "DATA_MATRIX";
76
+
77
+ case 7:
78
+ return "EAN_8";
79
+
80
+ case 8:
81
+ return "EAN_13";
82
+
83
+ case 9:
84
+ return "ITF";
85
+
86
+ case 10:
87
+ return "MAXICODE";
88
+
89
+ case 11:
90
+ return "PDF_417";
91
+
92
+ case 12:
93
+ return "QR_CODE";
94
+
95
+ case 13:
96
+ return "RSS_14";
97
+
98
+ case 14:
99
+ return "RSS_EXPANDED";
100
+
101
+ case 15:
102
+ return "UPC_A";
103
+
104
+ case 16:
105
+ return "UPC_E";
106
+
107
+ case 17:
108
+ return "UPC_EAN_EXTENSION";
109
+ } // switch
110
+ return QString();
111
+ }
112
+
113
+ QString QZXing::foundedFormat() const
114
+ {
115
+ return foundedFmt;
116
+ }
117
+
118
+ QString QZXing::charSet() const
119
+ {
120
+ return charSet_;
121
+ }
122
+
123
+ void QZXing::setDecoder(const uint &hint)
124
+ {
125
+ unsigned int newHints = 0;
126
+
127
+ if(hint & DecoderFormat_Aztec)
128
+ newHints |= DecodeHints::AZTEC_HINT;
129
+
130
+ if(hint & DecoderFormat_CODABAR)
131
+ newHints |= DecodeHints::CODABAR_HINT;
132
+
133
+ if(hint & DecoderFormat_CODE_39)
134
+ newHints |= DecodeHints::CODE_39_HINT;
135
+
136
+ if(hint & DecoderFormat_CODE_93)
137
+ newHints |= DecodeHints::CODE_93_HINT;
138
+
139
+ if(hint & DecoderFormat_CODE_128)
140
+ newHints |= DecodeHints::CODE_128_HINT;
141
+
142
+ if(hint & DecoderFormat_DATA_MATRIX)
143
+ newHints |= DecodeHints::DATA_MATRIX_HINT;
144
+
145
+ if(hint & DecoderFormat_EAN_8)
146
+ newHints |= DecodeHints::EAN_8_HINT;
147
+
148
+ if(hint & DecoderFormat_EAN_13)
149
+ newHints |= DecodeHints::EAN_13_HINT;
150
+
151
+ if(hint & DecoderFormat_ITF)
152
+ newHints |= DecodeHints::ITF_HINT;
153
+
154
+ if(hint & DecoderFormat_MAXICODE)
155
+ newHints |= DecodeHints::MAXICODE_HINT;
156
+
157
+ if(hint & DecoderFormat_PDF_417)
158
+ newHints |= DecodeHints::PDF_417_HINT;
159
+
160
+ if(hint & DecoderFormat_QR_CODE)
161
+ newHints |= DecodeHints::QR_CODE_HINT;
162
+
163
+ if(hint & DecoderFormat_RSS_14)
164
+ newHints |= DecodeHints::RSS_14_HINT;
165
+
166
+ if(hint & DecoderFormat_RSS_EXPANDED)
167
+ newHints |= DecodeHints::RSS_EXPANDED_HINT;
168
+
169
+ if(hint & DecoderFormat_UPC_A)
170
+ newHints |= DecodeHints::UPC_A_HINT;
171
+
172
+ if(hint & DecoderFormat_UPC_E)
173
+ newHints |= DecodeHints::UPC_E_HINT;
174
+
175
+ if(hint & DecoderFormat_UPC_EAN_EXTENSION)
176
+ newHints |= DecodeHints::UPC_EAN_EXTENSION_HINT;
177
+
178
+ enabledDecoders = newHints;
179
+
180
+ emit enabledFormatsChanged();
181
+ }
182
+
183
+ QString QZXing::decodeImage(QImage &image, int maxWidth, int maxHeight, bool smoothTransformation)
184
+ {
185
+ QTime t;
186
+ t.start();
187
+ Ref<Result> res;
188
+ emit decodingStarted();
189
+
190
+ if(image.isNull())
191
+ {
192
+ emit decodingFinished(false);
193
+ processingTime = t.elapsed();
194
+ return "";
195
+ }
196
+
197
+ CameraImageWrapper *ciw = NULL;
198
+ try {
199
+ if ((maxWidth > 0) || (maxHeight > 0))
200
+ ciw = CameraImageWrapper::Factory(image, maxWidth, maxHeight, smoothTransformation);
201
+ else
202
+ ciw = new CameraImageWrapper(image);
203
+
204
+ Ref<LuminanceSource> imageRef(ciw);
205
+ GlobalHistogramBinarizer *binz = new GlobalHistogramBinarizer(imageRef);
206
+
207
+ Ref<Binarizer> bz(binz);
208
+ BinaryBitmap *bb = new BinaryBitmap(bz);
209
+
210
+ Ref<BinaryBitmap> ref(bb);
211
+
212
+ res = decoder->decode(ref, DecodeHints((int)enabledDecoders));
213
+
214
+ QString string = QString(res->getText()->getText().c_str());
215
+ if (!string.isEmpty()) {
216
+ int fmt = res->getBarcodeFormat().value;
217
+ foundedFmt = decoderFormatToString(fmt);
218
+ charSet_ = QString::fromStdString(res->getCharSet());
219
+ if (!charSet_.isEmpty()) {
220
+ QTextCodec *codec = QTextCodec::codecForName(res->getCharSet().c_str());
221
+ if (codec)
222
+ string = codec->toUnicode(res->getText()->getText().c_str());
223
+ }
224
+ emit tagFound(string);
225
+ emit tagFoundAdvanced(string, foundedFmt, charSet_);
226
+ }
227
+ processingTime = t.elapsed();
228
+ emit decodingFinished(true);
229
+ return string;
230
+ }
231
+ catch(zxing::Exception &e)
232
+ {
233
+ emit error(QString(e.what()));
234
+ emit decodingFinished(false);
235
+ processingTime = t.elapsed();
236
+ return "";
237
+ }
238
+ }
239
+
240
+ QString QZXing::decodeImageFromFile(const QString& imageFilePath, int maxWidth, int maxHeight, bool smoothTransformation)
241
+ {
242
+ // used to have a check if this image exists
243
+ // but was removed because if the image file path doesn't point to a valid image
244
+ // then the QImage::isNull will return true and the decoding will fail eitherway.
245
+ QUrl imageUrl(imageFilePath);
246
+ QImage tmpImage = QImage(imageUrl.toLocalFile());
247
+ return decodeImage(tmpImage, maxWidth, maxHeight, smoothTransformation);
248
+ }
249
+
250
+ QString QZXing::decodeImageQML(QObject *item)
251
+ {
252
+ return decodeSubImageQML(item);
253
+ }
254
+
255
+ QString QZXing::decodeSubImageQML(QObject *item,
256
+ const double offsetX, const double offsetY,
257
+ const double width, const double height)
258
+ {
259
+ if(item == NULL)
260
+ {
261
+ processingTime = 0;
262
+ emit decodingFinished(false);
263
+ return "";
264
+ }
265
+
266
+ QImage img = imageHandler->extractQImage(item, offsetX, offsetY, width, height);
267
+
268
+ return decodeImage(img);
269
+ }
270
+
271
+ QString QZXing::decodeImageQML(const QUrl &imageUrl)
272
+ {
273
+ return decodeSubImageQML(imageUrl);
274
+ }
275
+
276
+ QString QZXing::decodeSubImageQML(const QUrl &imageUrl,
277
+ const double offsetX, const double offsetY,
278
+ const double width, const double height)
279
+ {
280
+ QString imagePath = imageUrl.path();
281
+ imagePath = imagePath.trimmed();
282
+ QFile file(imagePath);
283
+ if (!file.exists()) {
284
+ qDebug() << "[decodeSubImageQML()] The file" << file.fileName() << "does not exist.";
285
+ emit decodingFinished(false);
286
+ return "";
287
+ }
288
+ QImage img(imageUrl.path());
289
+ if(!(offsetX == 0 && offsetY == 0 && width == 0 && height == 0)) {
290
+ img = img.copy(offsetX, offsetY, width, height);
291
+ }
292
+ return decodeImage(img);
293
+ }
294
+
295
+ int QZXing::getProcessTimeOfLastDecoding()
296
+ {
297
+ return processingTime;
298
+ }
299
+
300
+ uint QZXing::getEnabledFormats() const
301
+ {
302
+ return enabledDecoders;
303
+ }
@@ -0,0 +1,405 @@
1
+ #include "BigInteger.hh"
2
+
3
+ void BigInteger::operator =(const BigInteger &x) {
4
+ // Calls like a = a have no effect
5
+ if (this == &x)
6
+ return;
7
+ // Copy sign
8
+ sign = x.sign;
9
+ // Copy the rest
10
+ mag = x.mag;
11
+ }
12
+
13
+ BigInteger::BigInteger(const Blk *b, Index blen, Sign s) : mag(b, blen) {
14
+ switch (s) {
15
+ case zero:
16
+ if (!mag.isZero())
17
+ throw "BigInteger::BigInteger(const Blk *, Index, Sign): Cannot use a sign of zero with a nonzero magnitude";
18
+ sign = zero;
19
+ break;
20
+ case positive:
21
+ case negative:
22
+ // If the magnitude is zero, force the sign to zero.
23
+ sign = mag.isZero() ? zero : s;
24
+ break;
25
+ default:
26
+ /* g++ seems to be optimizing out this case on the assumption
27
+ * that the sign is a valid member of the enumeration. Oh well. */
28
+ throw "BigInteger::BigInteger(const Blk *, Index, Sign): Invalid sign";
29
+ }
30
+ }
31
+
32
+ BigInteger::BigInteger(const BigUnsigned &x, Sign s) : mag(x) {
33
+ switch (s) {
34
+ case zero:
35
+ if (!mag.isZero())
36
+ throw "BigInteger::BigInteger(const BigUnsigned &, Sign): Cannot use a sign of zero with a nonzero magnitude";
37
+ sign = zero;
38
+ break;
39
+ case positive:
40
+ case negative:
41
+ // If the magnitude is zero, force the sign to zero.
42
+ sign = mag.isZero() ? zero : s;
43
+ break;
44
+ default:
45
+ /* g++ seems to be optimizing out this case on the assumption
46
+ * that the sign is a valid member of the enumeration. Oh well. */
47
+ throw "BigInteger::BigInteger(const BigUnsigned &, Sign): Invalid sign";
48
+ }
49
+ }
50
+
51
+ /* CONSTRUCTION FROM PRIMITIVE INTEGERS
52
+ * Same idea as in BigUnsigned.cc, except that negative input results in a
53
+ * negative BigInteger instead of an exception. */
54
+
55
+ // Done longhand to let us use initialization.
56
+ BigInteger::BigInteger(unsigned long x) : mag(x) { sign = mag.isZero() ? zero : positive; }
57
+ BigInteger::BigInteger(unsigned int x) : mag(x) { sign = mag.isZero() ? zero : positive; }
58
+ BigInteger::BigInteger(unsigned short x) : mag(x) { sign = mag.isZero() ? zero : positive; }
59
+
60
+ // For signed input, determine the desired magnitude and sign separately.
61
+
62
+ namespace {
63
+ template <class X, class UX>
64
+ BigInteger::Blk magOf(X x) {
65
+ /* UX(...) cast needed to stop short(-2^15), which negates to
66
+ * itself, from sign-extending in the conversion to Blk. */
67
+ return BigInteger::Blk(x < 0 ? UX(-x) : x);
68
+ }
69
+ template <class X>
70
+ BigInteger::Sign signOf(X x) {
71
+ return (x == 0) ? BigInteger::zero
72
+ : (x > 0) ? BigInteger::positive
73
+ : BigInteger::negative;
74
+ }
75
+ }
76
+
77
+ BigInteger::BigInteger(long x) : sign(signOf(x)), mag(magOf<long , unsigned long >(x)) {}
78
+ BigInteger::BigInteger(int x) : sign(signOf(x)), mag(magOf<int , unsigned int >(x)) {}
79
+ BigInteger::BigInteger(short x) : sign(signOf(x)), mag(magOf<short, unsigned short>(x)) {}
80
+
81
+ // CONVERSION TO PRIMITIVE INTEGERS
82
+
83
+ /* Reuse BigUnsigned's conversion to an unsigned primitive integer.
84
+ * The friend is a separate function rather than
85
+ * BigInteger::convertToUnsignedPrimitive to avoid requiring BigUnsigned to
86
+ * declare BigInteger. */
87
+ template <class X>
88
+ inline X convertBigUnsignedToPrimitiveAccess(const BigUnsigned &a) {
89
+ return a.convertToPrimitive<X>();
90
+ }
91
+
92
+ template <class X>
93
+ X BigInteger::convertToUnsignedPrimitive() const {
94
+ if (sign == negative)
95
+ throw "BigInteger::to<Primitive>: "
96
+ "Cannot convert a negative integer to an unsigned type";
97
+ else
98
+ return convertBigUnsignedToPrimitiveAccess<X>(mag);
99
+ }
100
+
101
+ /* Similar to BigUnsigned::convertToPrimitive, but split into two cases for
102
+ * nonnegative and negative numbers. */
103
+ template <class X, class UX>
104
+ X BigInteger::convertToSignedPrimitive() const {
105
+ if (sign == zero)
106
+ return 0;
107
+ else if (mag.getLength() == 1) {
108
+ // The single block might fit in an X. Try the conversion.
109
+ Blk b = mag.getBlock(0);
110
+ if (sign == positive) {
111
+ X x = X(b);
112
+ if (x >= 0 && Blk(x) == b)
113
+ return x;
114
+ } else {
115
+ X x = -X(b);
116
+ /* UX(...) needed to avoid rejecting conversion of
117
+ * -2^15 to a short. */
118
+ if (x < 0 && Blk(UX(-x)) == b)
119
+ return x;
120
+ }
121
+ // Otherwise fall through.
122
+ }
123
+ throw "BigInteger::to<Primitive>: "
124
+ "Value is too big to fit in the requested type";
125
+ }
126
+
127
+ unsigned long BigInteger::toUnsignedLong () const { return convertToUnsignedPrimitive<unsigned long > (); }
128
+ unsigned int BigInteger::toUnsignedInt () const { return convertToUnsignedPrimitive<unsigned int > (); }
129
+ unsigned short BigInteger::toUnsignedShort() const { return convertToUnsignedPrimitive<unsigned short> (); }
130
+ long BigInteger::toLong () const { return convertToSignedPrimitive <long , unsigned long> (); }
131
+ int BigInteger::toInt () const { return convertToSignedPrimitive <int , unsigned int> (); }
132
+ short BigInteger::toShort () const { return convertToSignedPrimitive <short, unsigned short>(); }
133
+
134
+ // COMPARISON
135
+ BigInteger::CmpRes BigInteger::compareTo(const BigInteger &x) const {
136
+ // A greater sign implies a greater number
137
+ if (sign < x.sign)
138
+ return less;
139
+ else if (sign > x.sign)
140
+ return greater;
141
+ else switch (sign) {
142
+ // If the signs are the same...
143
+ case zero:
144
+ return equal; // Two zeros are equal
145
+ case positive:
146
+ // Compare the magnitudes
147
+ return mag.compareTo(x.mag);
148
+ case negative:
149
+ // Compare the magnitudes, but return the opposite result
150
+ return CmpRes(-mag.compareTo(x.mag));
151
+ default:
152
+ throw "BigInteger internal error";
153
+ }
154
+ }
155
+
156
+ /* COPY-LESS OPERATIONS
157
+ * These do some messing around to determine the sign of the result,
158
+ * then call one of BigUnsigned's copy-less operations. */
159
+
160
+ // See remarks about aliased calls in BigUnsigned.cc .
161
+ #define DTRT_ALIASED(cond, op) \
162
+ if (cond) { \
163
+ BigInteger tmpThis; \
164
+ tmpThis.op; \
165
+ *this = tmpThis; \
166
+ return; \
167
+ }
168
+
169
+ void BigInteger::add(const BigInteger &a, const BigInteger &b) {
170
+ DTRT_ALIASED(this == &a || this == &b, add(a, b));
171
+ // If one argument is zero, copy the other.
172
+ if (a.sign == zero)
173
+ operator =(b);
174
+ else if (b.sign == zero)
175
+ operator =(a);
176
+ // If the arguments have the same sign, take the
177
+ // common sign and add their magnitudes.
178
+ else if (a.sign == b.sign) {
179
+ sign = a.sign;
180
+ mag.add(a.mag, b.mag);
181
+ } else {
182
+ // Otherwise, their magnitudes must be compared.
183
+ switch (a.mag.compareTo(b.mag)) {
184
+ case equal:
185
+ // If their magnitudes are the same, copy zero.
186
+ mag = 0;
187
+ sign = zero;
188
+ break;
189
+ // Otherwise, take the sign of the greater, and subtract
190
+ // the lesser magnitude from the greater magnitude.
191
+ case greater:
192
+ sign = a.sign;
193
+ mag.subtract(a.mag, b.mag);
194
+ break;
195
+ case less:
196
+ sign = b.sign;
197
+ mag.subtract(b.mag, a.mag);
198
+ break;
199
+ }
200
+ }
201
+ }
202
+
203
+ void BigInteger::subtract(const BigInteger &a, const BigInteger &b) {
204
+ // Notice that this routine is identical to BigInteger::add,
205
+ // if one replaces b.sign by its opposite.
206
+ DTRT_ALIASED(this == &a || this == &b, subtract(a, b));
207
+ // If a is zero, copy b and flip its sign. If b is zero, copy a.
208
+ if (a.sign == zero) {
209
+ mag = b.mag;
210
+ // Take the negative of _b_'s, sign, not ours.
211
+ // Bug pointed out by Sam Larkin on 2005.03.30.
212
+ sign = Sign(-b.sign);
213
+ } else if (b.sign == zero)
214
+ operator =(a);
215
+ // If their signs differ, take a.sign and add the magnitudes.
216
+ else if (a.sign != b.sign) {
217
+ sign = a.sign;
218
+ mag.add(a.mag, b.mag);
219
+ } else {
220
+ // Otherwise, their magnitudes must be compared.
221
+ switch (a.mag.compareTo(b.mag)) {
222
+ // If their magnitudes are the same, copy zero.
223
+ case equal:
224
+ mag = 0;
225
+ sign = zero;
226
+ break;
227
+ // If a's magnitude is greater, take a.sign and
228
+ // subtract a from b.
229
+ case greater:
230
+ sign = a.sign;
231
+ mag.subtract(a.mag, b.mag);
232
+ break;
233
+ // If b's magnitude is greater, take the opposite
234
+ // of b.sign and subtract b from a.
235
+ case less:
236
+ sign = Sign(-b.sign);
237
+ mag.subtract(b.mag, a.mag);
238
+ break;
239
+ }
240
+ }
241
+ }
242
+
243
+ void BigInteger::multiply(const BigInteger &a, const BigInteger &b) {
244
+ DTRT_ALIASED(this == &a || this == &b, multiply(a, b));
245
+ // If one object is zero, copy zero and return.
246
+ if (a.sign == zero || b.sign == zero) {
247
+ sign = zero;
248
+ mag = 0;
249
+ return;
250
+ }
251
+ // If the signs of the arguments are the same, the result
252
+ // is positive, otherwise it is negative.
253
+ sign = (a.sign == b.sign) ? positive : negative;
254
+ // Multiply the magnitudes.
255
+ mag.multiply(a.mag, b.mag);
256
+ }
257
+
258
+ /*
259
+ * DIVISION WITH REMAINDER
260
+ * Please read the comments before the definition of
261
+ * `BigUnsigned::divideWithRemainder' in `BigUnsigned.cc' for lots of
262
+ * information you should know before reading this function.
263
+ *
264
+ * Following Knuth, I decree that x / y is to be
265
+ * 0 if y==0 and floor(real-number x / y) if y!=0.
266
+ * Then x % y shall be x - y*(integer x / y).
267
+ *
268
+ * Note that x = y * (x / y) + (x % y) always holds.
269
+ * In addition, (x % y) is from 0 to y - 1 if y > 0,
270
+ * and from -(|y| - 1) to 0 if y < 0. (x % y) = x if y = 0.
271
+ *
272
+ * Examples: (q = a / b, r = a % b)
273
+ * a b q r
274
+ * === === === ===
275
+ * 4 3 1 1
276
+ * -4 3 -2 2
277
+ * 4 -3 -2 -2
278
+ * -4 -3 1 -1
279
+ */
280
+ void BigInteger::divideWithRemainder(const BigInteger &b, BigInteger &q) {
281
+ // Defend against aliased calls;
282
+ // same idea as in BigUnsigned::divideWithRemainder .
283
+ if (this == &q)
284
+ throw "BigInteger::divideWithRemainder: Cannot write quotient and remainder into the same variable";
285
+ if (this == &b || &q == &b) {
286
+ BigInteger tmpB(b);
287
+ divideWithRemainder(tmpB, q);
288
+ return;
289
+ }
290
+
291
+ // Division by zero gives quotient 0 and remainder *this
292
+ if (b.sign == zero) {
293
+ q.mag = 0;
294
+ q.sign = zero;
295
+ return;
296
+ }
297
+ // 0 / b gives quotient 0 and remainder 0
298
+ if (sign == zero) {
299
+ q.mag = 0;
300
+ q.sign = zero;
301
+ return;
302
+ }
303
+
304
+ // Here *this != 0, b != 0.
305
+
306
+ // Do the operands have the same sign?
307
+ if (sign == b.sign) {
308
+ // Yes: easy case. Quotient is zero or positive.
309
+ q.sign = positive;
310
+ } else {
311
+ // No: harder case. Quotient is negative.
312
+ q.sign = negative;
313
+ // Decrease the magnitude of the dividend by one.
314
+ mag--;
315
+ /*
316
+ * We tinker with the dividend before and with the
317
+ * quotient and remainder after so that the result
318
+ * comes out right. To see why it works, consider the following
319
+ * list of examples, where A is the magnitude-decreased
320
+ * a, Q and R are the results of BigUnsigned division
321
+ * with remainder on A and |b|, and q and r are the
322
+ * final results we want:
323
+ *
324
+ * a A b Q R q r
325
+ * -3 -2 3 0 2 -1 0
326
+ * -4 -3 3 1 0 -2 2
327
+ * -5 -4 3 1 1 -2 1
328
+ * -6 -5 3 1 2 -2 0
329
+ *
330
+ * It appears that we need a total of 3 corrections:
331
+ * Decrease the magnitude of a to get A. Increase the
332
+ * magnitude of Q to get q (and make it negative).
333
+ * Find r = (b - 1) - R and give it the desired sign.
334
+ */
335
+ }
336
+
337
+ // Divide the magnitudes.
338
+ mag.divideWithRemainder(b.mag, q.mag);
339
+
340
+ if (sign != b.sign) {
341
+ // More for the harder case (as described):
342
+ // Increase the magnitude of the quotient by one.
343
+ q.mag++;
344
+ // Modify the remainder.
345
+ mag.subtract(b.mag, mag);
346
+ mag--;
347
+ }
348
+
349
+ // Sign of the remainder is always the sign of the divisor b.
350
+ sign = b.sign;
351
+
352
+ // Set signs to zero as necessary. (Thanks David Allen!)
353
+ if (mag.isZero())
354
+ sign = zero;
355
+ if (q.mag.isZero())
356
+ q.sign = zero;
357
+
358
+ // WHEW!!!
359
+ }
360
+
361
+ // Negation
362
+ void BigInteger::negate(const BigInteger &a) {
363
+ DTRT_ALIASED(this == &a, negate(a));
364
+ // Copy a's magnitude
365
+ mag = a.mag;
366
+ // Copy the opposite of a.sign
367
+ sign = Sign(-a.sign);
368
+ }
369
+
370
+ // INCREMENT/DECREMENT OPERATORS
371
+
372
+ // Prefix increment
373
+ void BigInteger::operator ++() {
374
+ if (sign == negative) {
375
+ mag--;
376
+ if (mag == 0)
377
+ sign = zero;
378
+ } else {
379
+ mag++;
380
+ sign = positive; // if not already
381
+ }
382
+ }
383
+
384
+ // Postfix increment: same as prefix
385
+ void BigInteger::operator ++(int) {
386
+ operator ++();
387
+ }
388
+
389
+ // Prefix decrement
390
+ void BigInteger::operator --() {
391
+ if (sign == positive) {
392
+ mag--;
393
+ if (mag == 0)
394
+ sign = zero;
395
+ } else {
396
+ mag++;
397
+ sign = negative;
398
+ }
399
+ }
400
+
401
+ // Postfix decrement: same as prefix
402
+ void BigInteger::operator --(int) {
403
+ operator --();
404
+ }
405
+