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,54 @@
1
+ /*------------------------------------------------------------------------
2
+ * (The MIT License)
3
+ *
4
+ * Copyright (c) 2008-2011 Rhomobile, Inc.
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in
14
+ * all copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
+ * THE SOFTWARE.
23
+ *
24
+ * http://rhomobile.com
25
+ *------------------------------------------------------------------------*/
26
+
27
+ #ifndef DATETIMEDIALOG_H
28
+ #define DATETIMEDIALOG_H
29
+
30
+ #include "impl/DateTimePickerImpl.h"
31
+ #undef null
32
+ #undef min
33
+ #include <QDialog>
34
+ #include <QDialogButtonBox>
35
+ #include <QVBoxLayout>
36
+ #include <QSizePolicy>
37
+
38
+
39
+ class DateTimeDialog : public QDialog
40
+ {
41
+ Q_OBJECT
42
+
43
+ public:
44
+ explicit DateTimeDialog(CDateTimeMessage* msg, QWidget *parent = 0);
45
+ ~DateTimeDialog();
46
+ time_t getUnixTime(void);
47
+
48
+ private:
49
+
50
+ void * mv_dte;
51
+ int m_type;
52
+ };
53
+
54
+ #endif // DATETIMEDIALOG_H
@@ -0,0 +1,45 @@
1
+ /*------------------------------------------------------------------------
2
+ * (The MIT License)
3
+ *
4
+ * Copyright (c) 2008-2011 Rhomobile, Inc.
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in
14
+ * all copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
+ * THE SOFTWARE.
23
+ *
24
+ * http://rhomobile.com
25
+ *------------------------------------------------------------------------*/
26
+
27
+ #include "ExternalWebView.h"
28
+
29
+ ExternalWebView::ExternalWebView(QWidget *parent) : QWidget(parent)
30
+ {
31
+ //this->ui->webView->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
32
+ QVBoxLayout * vblay = new QVBoxLayout(this);
33
+ webView = new QWebEngineView(this);
34
+ vblay->addWidget(webView);
35
+ this->move(0,0);
36
+ }
37
+
38
+ ExternalWebView::~ExternalWebView()
39
+ {
40
+ }
41
+
42
+ void ExternalWebView::navigate(QUrl url)
43
+ {
44
+ webView->setUrl(url);
45
+ }
@@ -0,0 +1,47 @@
1
+ /*------------------------------------------------------------------------
2
+ * (The MIT License)
3
+ *
4
+ * Copyright (c) 2008-2011 Rhomobile, Inc.
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in
14
+ * all copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
+ * THE SOFTWARE.
23
+ *
24
+ * http://rhomobile.com
25
+ *------------------------------------------------------------------------*/
26
+
27
+ #ifndef EXTERNALWEBVIEW_H
28
+ #define EXTERNALWEBVIEW_H
29
+
30
+ #include <QWidget>
31
+ #include <QUrl>
32
+ #include <QWebEngineView>
33
+ #include <QVBoxLayout>
34
+
35
+ class ExternalWebView : public QWidget
36
+ {
37
+ Q_OBJECT
38
+
39
+ public:
40
+ explicit ExternalWebView(QWidget *parent = 0);
41
+ ~ExternalWebView();
42
+ void navigate(QUrl url);
43
+ private:
44
+ QWebEngineView * webView;
45
+ };
46
+
47
+ #endif // EXTERNALWEBVIEW_H
@@ -0,0 +1,103 @@
1
+ /****************************************************************************
2
+ **
3
+ ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
4
+ ** All rights reserved.
5
+ ** Contact: Nokia Corporation (qt-info@nokia.com)
6
+ **
7
+ ** This file is part of the examples of the Qt Toolkit.
8
+ **
9
+ ** $QT_BEGIN_LICENSE:LGPL$
10
+ ** No Commercial Usage
11
+ ** This file contains pre-release code and may not be distributed.
12
+ ** You may use this file in accordance with the terms and conditions
13
+ ** contained in the Technology Preview License Agreement accompanying
14
+ ** this package.
15
+ **
16
+ ** GNU Lesser General Public License Usage
17
+ ** Alternatively, this file may be used under the terms of the GNU Lesser
18
+ ** General Public License version 2.1 as published by the Free Software
19
+ ** Foundation and appearing in the file LICENSE.LGPL included in the
20
+ ** packaging of this file. Please review the following information to
21
+ ** ensure the GNU Lesser General Public License version 2.1 requirements
22
+ ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
23
+ **
24
+ ** In addition, as a special exception, Nokia gives you certain additional
25
+ ** rights. These rights are described in the Nokia Qt LGPL Exception
26
+ ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
27
+ **
28
+ ** If you have questions regarding the use of this file, please contact
29
+ ** Nokia at qt-info@nokia.com.
30
+ **
31
+ **
32
+ **
33
+ **
34
+ **
35
+ **
36
+ **
37
+ **
38
+ ** $QT_END_LICENSE$
39
+ **
40
+ ****************************************************************************/
41
+
42
+ #ifndef QWEBENGINEVIEWSELECTIONSUPPRESSOR_H
43
+ #define QWEBENGINEVIEWSELECTIONSUPPRESSOR_H
44
+
45
+ #include <QWebEngineView>
46
+ #include <QtGui/qevent.h>
47
+ #include <QDebug>
48
+
49
+ class QWebEngineViewSelectionSuppressor : public QObject
50
+ {
51
+ Q_OBJECT
52
+ public:
53
+ QWebEngineViewSelectionSuppressor(QWebEngineView *v): QObject(v), view(v), enabled(false), mousePressed(false){
54
+ Q_ASSERT(view);
55
+ enable();
56
+ }
57
+ ~QWebEngineViewSelectionSuppressor() {}
58
+
59
+ inline void enable() {
60
+ if (enabled) return;
61
+ view->installEventFilter(this);
62
+ enabled = true;
63
+ }
64
+
65
+ inline void disable() {
66
+ if (!enabled) return;
67
+ view->removeEventFilter(this);
68
+ enabled = false;
69
+ }
70
+
71
+ inline bool isEnabled() const {return enabled;}
72
+
73
+ protected:
74
+ inline bool eventFilter(QObject *, QEvent *e);
75
+
76
+ private:
77
+ QWebEngineView *view;
78
+ bool enabled;
79
+ bool mousePressed;
80
+ };
81
+
82
+ bool QWebEngineViewSelectionSuppressor::eventFilter(QObject *, QEvent *e)
83
+ {
84
+ switch (e->type()) {
85
+ case QEvent::MouseButtonPress:
86
+ if (static_cast<QMouseEvent *>(e)->button() == Qt::LeftButton)
87
+ mousePressed = true;
88
+ break;
89
+ case QEvent::MouseButtonRelease:
90
+ if (static_cast<QMouseEvent *>(e)->button() == Qt::LeftButton)
91
+ mousePressed = false;
92
+ break;
93
+ case QEvent::MouseMove:
94
+ if (mousePressed)
95
+ return true;
96
+ break;
97
+ default:
98
+ break;
99
+ }
100
+ return false;
101
+ }
102
+
103
+ #endif
@@ -0,0 +1,1181 @@
1
+ /*------------------------------------------------------------------------
2
+ * (The MIT License)
3
+ *
4
+ * Copyright (c) 2008-2011 Rhomobile, Inc.
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in
14
+ * all copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
+ * THE SOFTWARE.
23
+ *
24
+ * http://rhomobile.com
25
+ *------------------------------------------------------------------------*/
26
+
27
+ #ifdef _MSC_VER
28
+ #pragma warning(disable:4018)
29
+ #pragma warning(disable:4996)
30
+ #endif
31
+ #include "QtMainWindow.h"
32
+ #include "RhoSimulator.h"
33
+ #include <sstream>
34
+ #include "../QtCustomStyle.h"
35
+ #include "ext/rho/rhoruby.h"
36
+ #include "common/RhoStd.h"
37
+ #include "common/RhodesApp.h"
38
+ #include "common/RhoConf.h"
39
+ #include "common/RhoSimConf.h"
40
+ #include "rubyext/WebView.h"
41
+ #include "rubyext/NativeToolbarExt.h"
42
+ #undef null
43
+ #include "RhoNativeApiCall.h"
44
+ #include "statistic/RhoProfiler.h"
45
+ #include <QStylePainter>
46
+ #include <QResizeEvent>
47
+ #include <QLabel>
48
+ #include <QtNetwork/QNetworkCookie>
49
+ #include <QFileDialog>
50
+ #include <QDesktopServices>
51
+ #include <QDesktopWidget>
52
+ #include <QScroller>
53
+ #include <QScrollArea>
54
+ #include <QWebEngineSettings>
55
+ #include "../guithreadfunchelper.h"
56
+
57
+ #if defined(OS_MACOSX) || defined(OS_LINUX)
58
+ #define stricmp strcasecmp
59
+ #define strnicmp strncasecmp
60
+ #endif
61
+
62
+ IMPLEMENT_LOGCLASS(QtMainWindow,"QtMainWindow");
63
+
64
+ extern "C" {
65
+ extern VALUE rb_thread_main(void);
66
+ extern VALUE rb_thread_wakeup(VALUE thread);
67
+ }
68
+ using namespace rho;
69
+ using namespace rho::common;
70
+
71
+ QtMainWindow::QtMainWindow(QWidget *parent) : QMainWindow(parent), mainWindowCallback(NULL),
72
+ cur_tbrp(0), m_alertDialog(0), m_LogicalDpiX(0), m_LogicalDpiY(0), firstShow(true), m_bFirstLoad(true),
73
+ toolBarSeparatorWidth(0), m_proxy(QNetworkProxy(QNetworkProxy::DefaultProxy)), m_logView(0)
74
+ {
75
+ #if !defined(RHODES_EMULATOR)
76
+ QPixmap icon(QCoreApplication::applicationDirPath().append(QDir::separator()).append("icon.png"));
77
+ QApplication::setWindowIcon(icon);
78
+ QApplication::setApplicationDisplayName(QString::fromStdString(RHOCONF().getString("title_text")));
79
+ QApplication::setApplicationName(QString::fromStdString(RHOCONF().getString("app_name")));
80
+ QApplication::setApplicationVersion(QString::fromStdString(RHOCONF().getString("app_version")));
81
+ QApplication::setOrganizationName(QString::fromStdString(RHOCONF().getString("org_name")));
82
+ #elif defined(OS_WINDOWS_DESKTOP)
83
+ QPixmap icon(":/images/rho.png");
84
+ QApplication::setWindowIcon(icon);
85
+ #endif
86
+ QApplication::setStyle(new QtCustomStyle());
87
+
88
+ setCentralWidget(new QWidget(this));
89
+ verticalLayout = new QVBoxLayout(centralWidget());
90
+
91
+ tabBar = new QtNativeTabBar(this);
92
+ verticalLayout->addWidget(tabBar);
93
+ QWebEngineView * webView = new QtWebEngineView(this);
94
+ verticalLayout->addWidget(webView);
95
+
96
+ QMenuBar * menuBar = new QMenuBar(this);
97
+ setMenuBar(menuBar);
98
+
99
+ menuMain = new QMenu("Main", this);
100
+ menuMain->addAction("Exit", this, SLOT(on_actionExit_triggered()));
101
+ menuBar->addMenu(menuMain);
102
+
103
+ #ifndef OS_WINDOWS_DESKTOP
104
+ QMenu * menuSimulate = new QMenu("Simulate", this);
105
+ menuSimulate->addAction("Back", this, SLOT(on_actionBack_triggered()));
106
+ menuSimulate->addSeparator();
107
+ menuSimulate->addAction("Rotate 90° Clockwise", this, SLOT(on_actionRotateRight_triggered()));
108
+ menuSimulate->addAction("Rotate 90° Countr-clockwise", this, SLOT(on_actionRotateLeft_triggered()));
109
+ menuSimulate->addAction("Rotate 180°", this, SLOT(on_actionRotate180_triggered()));
110
+ menuBar->addMenu(menuSimulate);
111
+ #else
112
+ QMenu * menuSimulate = new QMenu("Navigate", this);
113
+ menuSimulate->addAction("Back", this, SLOT(on_actionBack_triggered()));
114
+ menuBar->addMenu(menuSimulate);
115
+ #endif
116
+
117
+ QMenu * menuHelp = new QMenu("Help");
118
+ menuHelp->addAction("About", this, SLOT(on_actionAbout_triggered()));
119
+ menuBar->addMenu(menuHelp);
120
+
121
+ connect(this, SIGNAL(navigate(QString,int)), this,
122
+ SLOT(slotNavigate(QString,int)), Qt::QueuedConnection);
123
+
124
+ toolBar = new QToolBar(this);
125
+ toolBar->setFixedSize(4,12);
126
+ this->addToolBar(Qt::BottomToolBarArea, toolBar);
127
+
128
+ toolBarRight = new QToolBar(this);
129
+ toolBar->setFixedSize(396,12);
130
+ this->addToolBar(Qt::BottomToolBarArea, toolBarRight);
131
+
132
+ if (RHOCONF().isExist("http_proxy_host"))
133
+ {
134
+ setProxy(QString::fromStdString(RHOCONF().getString("http_proxy_host")),
135
+ QString::fromStdString(RHOCONF().getString("http_proxy_port")),
136
+ QString::fromStdString(RHOCONF().getString("http_proxy_login")),
137
+ QString::fromStdString(RHOCONF().getString("http_proxy_password")));
138
+ } else {
139
+ unsetProxy();
140
+ }
141
+
142
+ QWebEngineProfile * profile = QWebEngineProfile::defaultProfile();
143
+
144
+ rho::String rs_dir = RHODESAPP().getRhoRootPath()+RHO_EMULATOR_DIR;
145
+ QString path(QString(rs_dir.c_str()));
146
+ profile->setPersistentStoragePath(path);
147
+ profile->setCachePath(path);
148
+ profile->setHttpCacheMaximumSize(0x40000000);
149
+ profile->setPersistentCookiesPolicy(QWebEngineProfile::ForcePersistentCookies);
150
+
151
+ webView->setContextMenuPolicy(Qt::NoContextMenu);
152
+ webView->setPage(new QtWebEnginePage(this));
153
+ webView->setAttribute(Qt::WA_AcceptTouchEvents, false);
154
+
155
+ setUpWebPage(webView->page());
156
+ this->main_webView = webView;
157
+
158
+ this->move(0,0);
159
+ toolBar->hide();
160
+ toolBarRight->hide();
161
+ main_webView->hide();
162
+
163
+ GuiThreadFuncHelper::getInstance(this);
164
+ #ifdef RHODES_EMULATOR
165
+ int width = RHOSIMCONF().getInt("screen_width");
166
+ int height = RHOSIMCONF().getInt("screen_height");
167
+ #else
168
+ int width = RHOCONF().getInt("screen_width");
169
+ int height = RHOCONF().getInt("screen_height");
170
+ #endif
171
+
172
+ if ((width>0) && (height>0)) this->setSize(width, height);
173
+ else if (width>0) this->setSize(width, this->height());
174
+ else if (height>0) this->setSize(this->width(), height);
175
+
176
+ if (RHOCONF().isExist("use_kinetic_scroll_on_windows") && RHOCONF().getBool("use_kinetic_scroll_on_windows"))
177
+ {
178
+ QWebEngineViewSelectionSuppressor* suppressor = new QWebEngineViewSelectionSuppressor(webView);
179
+ }
180
+
181
+
182
+ }
183
+
184
+ QtMainWindow::~QtMainWindow()
185
+ {
186
+ tabbarRemoveAllTabs(false);
187
+ if (m_alertDialog) delete m_alertDialog;
188
+ //TODO: m_SyncStatusDlg
189
+ LOGCONF().setLogView(NULL);
190
+ if (m_logView)
191
+ {
192
+ delete m_logView;
193
+ m_logView = 0;
194
+ }
195
+
196
+ }
197
+
198
+ void QtMainWindow::paintEvent(QPaintEvent *p2)
199
+ {
200
+ if ( m_bFirstLoad )
201
+ {
202
+ QPainter paint(this);
203
+
204
+ QImage image;
205
+ image.load(RHODESAPP().getLoadingPngPath().c_str());
206
+ QSize imSize = image.size();
207
+
208
+ QRect rcClient = this->rect();
209
+ rcClient.setBottom( rcClient.bottom() - this->toolBar->rect().height() ) ;
210
+ RHODESAPP().getSplashScreen().start();
211
+ /*
212
+ CSplashScreen& splash = RHODESAPP().getSplashScreen();
213
+
214
+ int nLeft = rcClient.left(), nTop = rcClient.top(), nWidth = imSize.width(), nHeight = imSize.height(), Width = rcClient.right() - rcClient.left(), Height = rcClient.bottom() - rcClient.top();
215
+ if (splash.isFlag(CSplashScreen::HCENTER) )
216
+ nLeft = (Width-nWidth)/2;
217
+ if (splash.isFlag(CSplashScreen::VCENTER) )
218
+ nTop = (Height-nHeight)/2;
219
+ if (splash.isFlag(CSplashScreen::VZOOM) )
220
+ nHeight = Height;
221
+ if (splash.isFlag(CSplashScreen::HZOOM) )
222
+ nWidth = Width;
223
+
224
+ QRect rc( nLeft, nTop, nWidth, nHeight );*/
225
+
226
+ paint.drawImage( rcClient, image );
227
+ }
228
+
229
+ QMainWindow::paintEvent(p2);
230
+
231
+ }
232
+
233
+ void QtMainWindow::setCallback(IMainWindowCallback* callback)
234
+ {
235
+ mainWindowCallback = callback;
236
+ }
237
+
238
+ void QtMainWindow::hideEvent(QHideEvent *)
239
+ {
240
+ if (mainWindowCallback) mainWindowCallback->onActivate(0);
241
+ }
242
+
243
+ void QtMainWindow::showEvent(QShowEvent *)
244
+ {
245
+ if (mainWindowCallback) mainWindowCallback->onActivate(1);
246
+ }
247
+
248
+ void QtMainWindow::closeEvent(QCloseEvent *ce)
249
+ {
250
+ if ( rho_ruby_is_started() )
251
+ rb_thread_wakeup(rb_thread_main());
252
+
253
+ if (mainWindowCallback) mainWindowCallback->onWindowClose();
254
+ tabbarRemoveAllTabs(false);
255
+ if (m_logView)
256
+ m_logView->close();
257
+ QMainWindow::closeEvent(ce);
258
+ }
259
+
260
+ void QtMainWindow::resizeEvent(QResizeEvent *event)
261
+ {
262
+ m_LogicalDpiX = this->logicalDpiY();
263
+ m_LogicalDpiY = this->logicalDpiY();
264
+ if (mainWindowCallback)
265
+ mainWindowCallback->updateSizeProperties(event->size().width(), event->size().height());
266
+ if (m_logView == 0) {
267
+ m_logView = new QtLogView();
268
+ LOGCONF().setLogView(m_logView);
269
+ }
270
+ }
271
+
272
+ bool QtMainWindow::isStarted(void)
273
+ {
274
+ return (tabViews.size() > 0) ||
275
+ ( (toolBar->isVisible() || toolBarRight->isVisible()) &&
276
+ ((toolBar->actions().size() > 0) || (toolBarRight->actions().size() > 0))
277
+ );
278
+ }
279
+
280
+ void QtMainWindow::unsetProxy()
281
+ {
282
+ m_proxy = QNetworkProxy(QNetworkProxy::DefaultProxy);
283
+ internalSetProxy();
284
+
285
+ }
286
+
287
+ void QtMainWindow::setProxy(QString host, QString port, QString login, QString password)
288
+ {
289
+ m_proxy = QNetworkProxy(QNetworkProxy::HttpProxy, host, port.toUInt(), login, password);
290
+ internalSetProxy();
291
+ }
292
+
293
+ void QtMainWindow::internalSetProxy()
294
+ {
295
+ QNetworkProxy::setApplicationProxy(m_proxy);
296
+ }
297
+
298
+ void QtMainWindow::on_actionBack_triggered()
299
+ {
300
+ RHODESAPP().navigateBack();
301
+ }
302
+
303
+ void QtMainWindow::on_actionRotateRight_triggered()
304
+ {
305
+ this->resize(this->height(), this->width());
306
+ RHODESAPP().callScreenRotationCallback(this->width(), this->height(), 90);
307
+ }
308
+
309
+ void QtMainWindow::on_actionRotateLeft_triggered()
310
+ {
311
+ this->resize(this->height(), this->width());
312
+ RHODESAPP().callScreenRotationCallback(this->width(), this->height(), -90);
313
+ }
314
+
315
+ void QtMainWindow::on_actionRotate180_triggered()
316
+ {
317
+ RHODESAPP().callScreenRotationCallback(this->width(), this->height(), 180);
318
+ }
319
+
320
+ void QtMainWindow::on_actionExit_triggered()
321
+ {
322
+ this->close();
323
+ }
324
+
325
+ bool QtMainWindow::internalUrlProcessing(const QUrl& url)
326
+ {
327
+ int ipos;
328
+ QString sUrl = url.toString();
329
+ if (sUrl.startsWith("mailto:")) {
330
+ QDesktopServices::openUrl(url);
331
+ return true;
332
+ }
333
+ if (sUrl.startsWith("tel:")) {
334
+ sUrl.remove(0, 4);
335
+ if ((ipos = sUrl.indexOf('?')) >= 0) sUrl = sUrl.left(ipos);
336
+ QMessageBox::information(0, "Phone call", "Call to " + sUrl);
337
+ return true;
338
+ }
339
+ if (sUrl.startsWith("sms:")) {
340
+ sUrl.remove(0, 4);
341
+ if ((ipos = sUrl.indexOf('?')) >= 0) sUrl = sUrl.left(ipos);
342
+ QMessageBox::information(0, "SMS", "Send SMS to " + sUrl);
343
+ return true;
344
+ }
345
+ return false;
346
+ }
347
+
348
+ void QtMainWindow::on_webView_linkClicked(const QUrl& url)
349
+ {
350
+ QString sUrl = url.toString();
351
+ if (sUrl.contains("rho_open_target=_blank")) {
352
+ LOG(INFO) + "WebView: open external browser";
353
+ ExternalWebView* externalWebView = new ExternalWebView();
354
+ externalWebView->navigate(QUrl(sUrl.remove("rho_open_target=_blank")));
355
+ externalWebView->show();
356
+ externalWebView->activateWindow();
357
+ } else if (webView) {
358
+ if (!internalUrlProcessing(url)) {
359
+ sUrl.remove(QRegExp("#+$"));
360
+ if (sUrl.compare(webView->url().toString())!=0) {
361
+ if (mainWindowCallback && !sUrl.startsWith("javascript:", Qt::CaseInsensitive)) {
362
+ const QByteArray asc_url = sUrl.toLatin1();
363
+ mainWindowCallback->onWebViewUrlChanged(::std::string(asc_url.constData(), asc_url.length()));
364
+ }
365
+ webView->load(QUrl(sUrl));
366
+ }
367
+ }
368
+ }
369
+ }
370
+
371
+ void QtMainWindow::on_webView_loadStarted()
372
+ {
373
+ if (firstShow && RHOCONF().getBool("full_screen")) {
374
+ firstShow = false;
375
+ fullscreenCommand(1);
376
+ }
377
+ LOG(INFO) + "WebView: loading...";
378
+ PROF_START("BROWSER_PAGE");
379
+ }
380
+
381
+ void QtMainWindow::on_webView_loadFinished(bool ok)
382
+ {
383
+ if (ok)
384
+ LOG(INFO) + "Page load complete.";
385
+ else
386
+ {
387
+ LOG(ERROR) + "Page load failed.";
388
+ webView->setHtml("<html><head><title>Error Loading Page</title></head><body><h1>Error Loading Page.</h1></body></html>");
389
+ }
390
+
391
+ PROF_STOP("BROWSER_PAGE");
392
+
393
+ if (mainWindowCallback && ok) {
394
+ const QByteArray asc_url = webView->url().toString().toLatin1();
395
+ mainWindowCallback->onWebViewUrlChanged(::std::string(asc_url.constData(), asc_url.length()));
396
+ }
397
+
398
+ if ( m_bFirstLoad )
399
+ {
400
+ if ( webView->url().toString() != "about:blank" )
401
+ {
402
+ long lMS = RHODESAPP().getSplashScreen().howLongWaitMs();
403
+ if ( lMS > 0 )
404
+ m_SplashTimer.start(lMS, this);
405
+ else
406
+ {
407
+ m_bFirstLoad = false;
408
+ main_webView->show();
409
+ }
410
+ }
411
+ }
412
+
413
+ }
414
+
415
+ void QtMainWindow::timerEvent(QTimerEvent *ev)
416
+ {
417
+ if (ev->timerId() == m_SplashTimer.timerId())
418
+ {
419
+ m_bFirstLoad = false;
420
+ main_webView->show();
421
+ } else {
422
+ QWidget::timerEvent(ev);
423
+ }
424
+ }
425
+
426
+ void QtMainWindow::on_webView_urlChanged(QUrl url)
427
+ {
428
+ if (mainWindowCallback) {
429
+ const QByteArray asc_url = url.toString().toLatin1();
430
+ ::std::string sUrl = ::std::string(asc_url.constData(), asc_url.length());
431
+ LOG(INFO) + "WebView: URL changed to " + sUrl;
432
+ mainWindowCallback->onWebViewUrlChanged(sUrl);
433
+ }
434
+ }
435
+
436
+ void QtMainWindow::on_menuMain_aboutToShow()
437
+ {
438
+ if (mainWindowCallback) mainWindowCallback->createCustomMenu();
439
+ }
440
+
441
+ void QtMainWindow::slotNavigate(QString url, int index)
442
+ {
443
+ QWebEngineView* wv = (index < tabViews.size()) && (index >= 0) ? tabViews[index] : webView;
444
+ if (wv) {
445
+ if (url.startsWith("javascript:", Qt::CaseInsensitive)) {
446
+ url.remove(0,11);
447
+ //wv->stop();
448
+ wv->page()->runJavaScript(url);
449
+
450
+ } else if (!internalUrlProcessing(url)) {
451
+ if (mainWindowCallback) {
452
+ const QByteArray asc_url = url.toLatin1();
453
+ mainWindowCallback->onWebViewUrlChanged(std::string(asc_url.constData(),
454
+ asc_url.length()));
455
+ }
456
+ QUrl test(url);
457
+ QString errStr = test.errorString();
458
+ if (errStr.length() > 0 )
459
+ LOG(ERROR) + "WebView navigate: failed to parse URL: " + errStr.toStdString();
460
+
461
+ wv->load(test);
462
+ }
463
+ }
464
+ }
465
+
466
+ void QtMainWindow::GoBack(int index)
467
+ {
468
+ QWebEngineView* wv = (index < tabViews.size()) && (index >= 0) ? tabViews[index] : webView;
469
+ if (wv)
470
+ wv->back();
471
+ }
472
+
473
+ void QtMainWindow::GoForward(void)
474
+ {
475
+ if (webView)
476
+ webView->forward();
477
+ }
478
+
479
+ void QtMainWindow::Refresh(int index)
480
+ {
481
+ QWebEngineView* wv = (index < tabViews.size()) && (index >= 0) ? tabViews[index] : webView;
482
+ if (wv) {
483
+ if (mainWindowCallback) {
484
+ const QByteArray asc_url = wv->url().toString().toLatin1();
485
+ mainWindowCallback->onWebViewUrlChanged(::std::string(asc_url.constData(), asc_url.length()));
486
+ }
487
+ wv->reload();
488
+ }
489
+ }
490
+
491
+ int QtMainWindow::getLogicalDpiX()
492
+ {
493
+ return m_LogicalDpiX;
494
+ }
495
+
496
+ int QtMainWindow::getLogicalDpiY()
497
+ {
498
+ return m_LogicalDpiY;
499
+ }
500
+
501
+
502
+ // Tabbar:
503
+
504
+ void QtMainWindow::tabbarRemoveAllTabs(bool restore)
505
+ {
506
+ // removing WebViews
507
+ for (int i=0; i<tabViews.size(); ++i) {
508
+ tabbarDisconnectWebView(tabViews[i]);
509
+ if (tabViews[i] != main_webView) {
510
+ // destroy connected RhoNativeApiCall object
511
+ QVariant v = tabViews[i]->page()->property("__rhoNativeApi");
512
+ RhoNativeApiCall* rhoNativeApiCall = v.value<RhoNativeApiCall*>();
513
+ delete rhoNativeApiCall;
514
+
515
+ verticalLayout->removeWidget(tabViews[i]);
516
+ tabViews[i]->setParent(0);
517
+ if (webView == tabViews[i])
518
+ webView = 0;
519
+ delete tabViews[i];
520
+ }
521
+ }
522
+ tabViews.clear();
523
+
524
+ // removing Tabs
525
+ for (int i=tabBar->count()-1; i >= 0; --i)
526
+ tabBar->removeTab(i);
527
+
528
+ // restoring main WebView
529
+ tabbarWebViewRestore(restore);
530
+ }
531
+
532
+ void QtMainWindow::tabbarInitialize()
533
+ {
534
+ if (webView)
535
+ webView->stop();
536
+ tabbarRemoveAllTabs(false);
537
+ tabBar->clearStyleSheet();
538
+ }
539
+
540
+ void QtMainWindow::setUpWebPage(QWebEnginePage *page)
541
+ {
542
+ //page->networkAccessManager()->setProxy(m_proxy);
543
+ //page->setLinkDelegationPolicy(QWebEnginePage::DelegateAllLinks);
544
+ //page->securityOrigin().setDatabaseQuota(0x40000000);
545
+ //TODO Check this
546
+ page->setProperty("_q_webInspectorServerPort", getDebPort());
547
+
548
+ RhoNativeApiCall* rhoNativeApiCall = new RhoNativeApiCall(page);
549
+ //page->setProperty("__rhoNativeApi", QVariant::fromValue(rhoNativeApiCall));
550
+ connect(page, SIGNAL(javaScriptWindowObjectCleared()),rhoNativeApiCall, SLOT(populateJavaScriptWindowObject()));
551
+ }
552
+
553
+ int QtMainWindow::tabbarAddTab(const QString& label, const char* icon, bool disabled, const QColor* web_bkg_color,
554
+ QTabBarRuntimeParams& tbrp)
555
+ {
556
+ QWebEngineView* wv = main_webView;
557
+ if (!tbrp["use_current_view_for_tab"].toBool()) {
558
+ // creating web view
559
+ wv = new QtWebEngineView(this);
560
+ wv->setMaximumSize(0,0);
561
+ wv->setParent(centralWidget());
562
+ wv->setAttribute(Qt::WA_AcceptTouchEvents, false);
563
+ verticalLayout->addWidget(wv);
564
+ wv->setPage(new QtWebEnginePage(this));
565
+ setUpWebPage(wv->page());
566
+ if (web_bkg_color && (web_bkg_color->name().length()>0))
567
+ wv->setHtml( QString("<!DOCTYPE html><html><body style=\"background:") + web_bkg_color->name() +
568
+ QString("\"></body></html>") );
569
+ // creating and attaching web inspector
570
+ }
571
+ tabViews.push_back(wv);
572
+
573
+ cur_tbrp = &tbrp;
574
+ if (icon && (strlen(icon) > 0))
575
+ tabBar->addTab(QIcon(QString(icon)), label);
576
+ else
577
+ tabBar->addTab(label);
578
+ tabBar->setTabToolTip(tabBar->count()-1, label);
579
+ if (disabled)
580
+ tabBar->setTabEnabled(tabBar->count()-1, false);
581
+ cur_tbrp = 0;
582
+ tabBar->setTabData(tabBar->count()-1, tbrp);
583
+
584
+ return tabBar->count() - 1;
585
+ }
586
+
587
+ void QtMainWindow::tabbarShow()
588
+ {
589
+ tabBar->show();
590
+ }
591
+
592
+ void QtMainWindow::tabbarConnectWebView(QWebEngineView *webView)
593
+ {
594
+ if (webView) {
595
+ webView->setMaximumSize(QWIDGETSIZE_MAX,QWIDGETSIZE_MAX); //->show();
596
+ if (webView != main_webView) {
597
+ QObject::connect(webView, SIGNAL(linkClicked(const QUrl&)), this, SLOT(on_webView_linkClicked(const QUrl&)));
598
+ QObject::connect(webView, SIGNAL(loadStarted()), this, SLOT(on_webView_loadStarted()));
599
+ QObject::connect(webView, SIGNAL(loadFinished(bool)), this, SLOT(on_webView_loadFinished(bool)));
600
+ QObject::connect(webView, SIGNAL(urlChanged(QUrl)), this, SLOT(on_webView_urlChanged(QUrl)));
601
+ }
602
+ webView = webView;
603
+ }
604
+ }
605
+
606
+ void QtMainWindow::tabbarDisconnectWebView(QWebEngineView* webView)
607
+ {
608
+ if (webView) {
609
+ webView->setMaximumSize(0,0); //->hide();
610
+ if (webView != main_webView) {
611
+ QObject::disconnect(webView, SIGNAL(linkClicked(const QUrl&)), this, SLOT(on_webView_linkClicked(const QUrl&)));
612
+ QObject::disconnect(webView, SIGNAL(loadStarted()), this, SLOT(on_webView_loadStarted()));
613
+ QObject::disconnect(webView, SIGNAL(loadFinished(bool)), this, SLOT(on_webView_loadFinished(bool)));
614
+ QObject::disconnect(webView, SIGNAL(urlChanged(QUrl)), this, SLOT(on_webView_urlChanged(QUrl)));
615
+ }
616
+ }
617
+ }
618
+
619
+ void QtMainWindow::tabbarWebViewRestore(bool reload)
620
+ {
621
+ if ((webView == 0) || (webView != main_webView)) {
622
+ tabbarDisconnectWebView(webView);
623
+ tabbarConnectWebView(main_webView);
624
+ } else if (reload) {
625
+ main_webView->setMaximumSize(QWIDGETSIZE_MAX,QWIDGETSIZE_MAX); //->show();
626
+
627
+ }
628
+ }
629
+
630
+ void QtMainWindow::tabbarHide()
631
+ {
632
+ tabbarRemoveAllTabs(true);
633
+ }
634
+
635
+ int QtMainWindow::tabbarGetHeight()
636
+ {
637
+ return tabBar->height();
638
+ }
639
+
640
+ void QtMainWindow::tabbarSwitch(int index)
641
+ {
642
+ tabBar->setCurrentIndex(index);
643
+ }
644
+
645
+ int QtMainWindow::tabbarGetCurrent()
646
+ {
647
+ return tabViews.size() > 0 ? tabBar->currentIndex() : 0;
648
+ }
649
+
650
+ void QtMainWindow::tabbarSetBadge(int index, const char* badge)
651
+ {
652
+ tabBar->setTabButton(index, QTabBar::RightSide, (badge && (*badge != '\0') ? new QLabel(badge) : 0));
653
+ }
654
+
655
+ void QtMainWindow::tabbarSetSwitchCallback(rho::apiGenerator::CMethodResult& oResult)
656
+ {
657
+ m_oTabBarSwitchCallback = oResult;
658
+ }
659
+
660
+ quint16 QtMainWindow::getDebPort()
661
+ {
662
+ quint16 webkit_debug_port =
663
+ #ifdef RHODES_EMULATOR
664
+ RHOSIMCONF().getInt("webkit_debug_port");
665
+ #else
666
+ 0;
667
+ #endif
668
+ if (webkit_debug_port == 0) webkit_debug_port = 9090;
669
+ return webkit_debug_port;
670
+ }
671
+
672
+ void QtMainWindow::on_tabBar_currentChanged(int index)
673
+ {
674
+ if ((index < tabViews.size()) && (index >= 0)) {
675
+ QTabBarRuntimeParams tbrp = cur_tbrp != 0 ? *cur_tbrp : tabBar->tabData(index).toHash();
676
+ bool use_current_view_for_tab = tbrp["use_current_view_for_tab"].toBool();
677
+
678
+ if (use_current_view_for_tab) {
679
+ tabbarConnectWebView(main_webView);
680
+ } else {
681
+ tabbarDisconnectWebView(main_webView);
682
+ }
683
+
684
+ for (unsigned int i=0; i<tabViews.size(); ++i) {
685
+ if (tabViews[i] != main_webView) {
686
+ if (use_current_view_for_tab || (i != index)) {
687
+ tabbarDisconnectWebView(tabViews[i]);
688
+ } else {
689
+ tabbarConnectWebView(tabViews[i]);
690
+ }
691
+ }
692
+ }
693
+
694
+ if (m_oTabBarSwitchCallback.hasCallback())
695
+ {
696
+ /*QString body = QString("&rho_callback=1&tab_index=") + QVariant(index).toString();
697
+ rho::String* cbStr = new rho::String(tbrp["on_change_tab_callback"].toString().toStdString());
698
+ rho::String* bStr = new rho::String(body.toStdString());
699
+ const char* b = bStr->c_str();
700
+ rho_net_request_with_data(RHODESAPP().canonicalizeRhoUrl(*cbStr).c_str(), b);*/
701
+ Hashtable<String,String> mapRes;
702
+ mapRes["tab_index"] = convertToStringA(index);
703
+ m_oTabBarSwitchCallback.set(mapRes);
704
+ }
705
+
706
+ if (tbrp["reload"].toBool() || (webView && (webView->history()->count()==0)))
707
+ {
708
+ const QByteArray asc = tbrp["action"].toString().toLatin1();
709
+ rho::String strAction = std::string(asc.constData(), asc.length());//new rho::String(tbrp["action"].toString().toStdString());
710
+ RHODESAPP().loadUrl(strAction);
711
+
712
+ }
713
+ }
714
+ }
715
+
716
+
717
+ // Toolbar:
718
+
719
+ void QtMainWindow::toolbarRemoveAllButtons()
720
+ {
721
+ toolBar->clear();
722
+ toolBarRight->clear();
723
+ toolBarSeparatorWidth = 0;
724
+ }
725
+
726
+ void QtMainWindow::toolbarShow()
727
+ {
728
+ toolBar->show();
729
+ toolBarRight->show();
730
+ }
731
+
732
+ void QtMainWindow::toolbarHide()
733
+ {
734
+ toolBar->hide();
735
+ toolBarRight->hide();
736
+ }
737
+
738
+ int QtMainWindow::toolbarGetHeight()
739
+ {
740
+ return toolBar->height();
741
+ }
742
+
743
+ void QtMainWindow::toolbarAddAction(const QString & text)
744
+ {
745
+ toolBar->addAction(text);
746
+ }
747
+
748
+ void QtMainWindow::toolbarActionEvent(bool checked)
749
+ {
750
+ QObject* sender = QObject::sender();
751
+ QAction* action;
752
+ if (sender && (action = dynamic_cast<QAction*>(sender)))
753
+ {
754
+ const QByteArray asc = action->data().toString().toLatin1();
755
+ rho::String strAction = std::string(asc.constData(), asc.length());//new rho::String(action->data().toString().toStdString());
756
+ if ( strcasecmp(strAction.c_str(), "forward") == 0 )
757
+ rho_webview_navigate_forward();
758
+ else
759
+ RHODESAPP().loadUrl(strAction);
760
+ }
761
+ }
762
+
763
+ void QtMainWindow::toolbarAddAction(const QIcon & icon, const QString & text, const char* action, bool rightAlign)
764
+ {
765
+ QAction* qAction = new QAction(icon, text, toolBar);
766
+ qAction->setData(QVariant(action));
767
+ QObject::connect(qAction, SIGNAL(triggered(bool)), this, SLOT(toolbarActionEvent(bool)) );
768
+ if (rightAlign)
769
+ toolBarRight->insertAction( (toolBarRight->actions().size() > 0 ? toolBarRight->actions().last() : 0), qAction);
770
+ else
771
+ toolBar->addAction(qAction);
772
+ }
773
+
774
+ void QtMainWindow::toolbarAddSeparator(int width)
775
+ {
776
+ toolBarSeparatorWidth = width;
777
+ toolBar->addSeparator();
778
+ }
779
+
780
+ void QtMainWindow::setToolbarStyle(bool border, QString background, int viewHeight)
781
+ {
782
+ toolBar->setMinimumHeight(viewHeight);
783
+ toolBarRight->setMinimumHeight(viewHeight);
784
+ QString style = "";
785
+ if (!border) style += "border:0px;";
786
+ if (background.length()>0)
787
+ style += "background:"+background+";";
788
+ if (style.length()>0) {
789
+ style = "QToolBar{"+style+"}";
790
+ if (toolBarSeparatorWidth > 0)
791
+ style += "QToolBar::separator{width:"+QString::number(toolBarSeparatorWidth)+"px;}";
792
+ toolBar->setStyleSheet(style);
793
+ toolBarRight->setStyleSheet(style);
794
+ }
795
+ }
796
+
797
+
798
+ // Menu:
799
+
800
+ void QtMainWindow::menuAddAction(const QString & text, int item, bool enabled)
801
+ {
802
+ QAction* qAction = new QAction(text, toolBar);
803
+ qAction->setData(QVariant(item));
804
+ qAction->setEnabled(enabled);
805
+ QObject::connect(qAction, SIGNAL(triggered(bool)), this, SLOT(menuActionEvent(bool)) );
806
+ menuMain->addAction(qAction);
807
+ }
808
+
809
+ void QtMainWindow::menuClear(void)
810
+ {
811
+ menuMain->clear();
812
+ }
813
+
814
+ void QtMainWindow::menuAddSeparator()
815
+ {
816
+ menuMain->addSeparator();
817
+ }
818
+
819
+ void QtMainWindow::menuActionEvent(bool checked)
820
+ {
821
+ QObject* sender = QObject::sender();
822
+ QAction* action;
823
+ if (sender && (action = dynamic_cast<QAction*>(sender)) && mainWindowCallback)
824
+ mainWindowCallback->onCustomMenuItemCommand(action->data().toInt());
825
+ }
826
+
827
+ void QtMainWindow::on_actionAbout_triggered()
828
+ {
829
+ QString OSDetails= QString("\nOS : %1 \nApp Compiled with QT Version : %2 \nRunning with QT Version %3")
830
+ .arg(QtLogView::getOsDetails().toStdString().c_str(),QT_VERSION_STR,qVersion());
831
+ #ifndef RHO_SYMBIAN
832
+ #ifdef RHODES_EMULATOR
833
+ QMessageBox::about(this, RHOSIMULATOR_NAME, QString(RHOSIMULATOR_NAME " v" RHOSIMULATOR_VERSION "\n(QtWebEngine v" QTWEBENGINECORE_VERSION_STR ")\n(WebKit v%1) \nPlatform : %2 %3").arg(QTWEBENGINECORE_VERSION_STR)
834
+ .arg(RHOSIMCONF().getString( "platform").c_str())
835
+ .arg(OSDetails)
836
+ );
837
+ #else
838
+ QMessageBox::about(this, QString::fromStdString(RHOCONF().getString("title_text")), QString("%1 v%2 %3")
839
+ .arg(QString::fromStdString(RHOCONF().getString("app_name")))
840
+ .arg(QString::fromStdString(RHOCONF().getString("app_version")))
841
+ .arg(OSDetails)
842
+ );
843
+ #endif
844
+
845
+ #endif
846
+ }
847
+
848
+ // slots:
849
+
850
+ void QtMainWindow::exitCommand()
851
+ {
852
+ this->close();
853
+ }
854
+
855
+ void QtMainWindow::navigateBackCommand()
856
+ {
857
+ RHODESAPP().navigateBack();
858
+ }
859
+
860
+ void QtMainWindow::navigateForwardCommand()
861
+ {
862
+ this->GoForward();
863
+ }
864
+
865
+ void QtMainWindow::webviewNavigateBackCommand(int tab_index)
866
+ {
867
+ this->GoBack(tab_index);
868
+ }
869
+
870
+ void QtMainWindow::logCommand()
871
+ {
872
+ if (m_logView)
873
+ m_logView->show();
874
+ }
875
+
876
+ void QtMainWindow::refreshCommand(int tab_index)
877
+ {
878
+ this->Refresh(tab_index);
879
+ }
880
+
881
+ void QtMainWindow::navigateCommand(TNavigateData* nd)
882
+ {
883
+ if (nd) {
884
+ if (nd->url) {
885
+ this->navigate(QString::fromWCharArray(nd->url), nd->index);
886
+ free(nd->url);
887
+ }
888
+ free(nd);
889
+ }
890
+ }
891
+
892
+ void QtMainWindow::executeJavaScriptCommand(TNavigateData* nd)
893
+ {
894
+ if (nd) {
895
+ if (nd->url) {
896
+ QWebEngineView* wv = (nd->index < tabViews.size()) && (nd->index >= 0) ? tabViews[nd->index] : webView;
897
+ if (wv)
898
+ wv->page()->runJavaScript(QString::fromWCharArray(nd->url));
899
+ free(nd->url);
900
+ }
901
+ free(nd);
902
+ }
903
+ }
904
+
905
+ void QtMainWindow::takePicture(char* callbackUrl)
906
+ {
907
+ selectPicture(callbackUrl);
908
+ }
909
+
910
+ void QtMainWindow::selectPicture(char* callbackUrl)
911
+ {
912
+ bool wasError = false;
913
+ rho::StringW strBlobRoot = rho::common::convertToStringW( RHODESAPP().getBlobsDirPath() );
914
+ QString fileName = QFileDialog::getOpenFileName(this, "Open Image", QString::fromStdWString(strBlobRoot),
915
+ "Image Files (*.png *.jpg *.gif *.bmp)");
916
+ char image_uri[4096];
917
+ image_uri[0] = '\0';
918
+
919
+ if (!fileName.isNull()) {
920
+
921
+ int ixExt = fileName.lastIndexOf('.');
922
+ QString szExt = (ixExt >= 0) && (fileName.lastIndexOf('/') < ixExt) ? fileName.right(fileName.length()-ixExt) : "";
923
+ QDateTime now = QDateTime::currentDateTimeUtc();
924
+ int tz = (int)(now.secsTo(QDateTime::currentDateTime())/3600);
925
+
926
+ char file_name[4096];
927
+ const QByteArray asc = szExt.toLatin1();
928
+ rho::String strExt = std::string(asc.constData(), asc.length());
929
+
930
+ ::sprintf(file_name, "Image_%02i-%02i-%0004i_%02i.%02i.%02i_%c%03i%s",
931
+ now.date().month(), now.date().day(), now.date().year(),
932
+ now.time().hour(), now.time().minute(), now.time().second(),
933
+ tz>0?'_':'-',abs(tz), strExt.c_str() );
934
+
935
+ QString full_name = QString::fromStdWString(strBlobRoot);
936
+ full_name.append("/");
937
+ full_name.append(file_name);
938
+
939
+ if (QFile::copy(fileName,full_name))
940
+ strcpy( image_uri, file_name );
941
+ else
942
+ wasError = true;
943
+ }
944
+
945
+ RHODESAPP().callCameraCallback( (const char*)callbackUrl, rho::common::convertToStringA(image_uri),
946
+ (wasError ? "Error" : ""), fileName.isNull());
947
+
948
+ free(callbackUrl);
949
+ }
950
+
951
+ void QtMainWindow::doAlertCallback(CAlertParams* params, int btnNum, CAlertParams::CAlertButton &button)
952
+ {
953
+ if (params->m_callback.length()==0) {
954
+ rho::Hashtable<rho::String, rho::String> mapRes;
955
+ std::ostringstream sBtnIndex;
956
+ sBtnIndex << btnNum;
957
+ mapRes["button_index"] = sBtnIndex.str();
958
+ mapRes["button_id"] = button.m_strID;
959
+ mapRes["button_title"] = button.m_strCaption;
960
+ params->m_callback_ex.set(mapRes);
961
+ } else
962
+ RHODESAPP().callPopupCallback(params->m_callback, button.m_strID, button.m_strCaption);
963
+ }
964
+
965
+ void QtMainWindow::alertShowPopup(CAlertParams * params)
966
+ {
967
+ rho::StringW strAppName = RHODESAPP().getAppNameW();
968
+
969
+ //In some scenarios m_alertDialog variable is not cleaned properly now the following code will ensure the proper cleanup
970
+
971
+ if (m_alertDialog!=NULL)
972
+ {
973
+ delete m_alertDialog;
974
+ m_alertDialog=NULL;
975
+ }
976
+
977
+ if (params->m_dlgType == CAlertParams::DLG_STATUS) {
978
+ m_alertDialog = new QMessageBox(QMessageBox::NoIcon,
979
+ QString::fromWCharArray(rho::common::convertToStringW(params->m_title).c_str()),
980
+ QString::fromWCharArray(rho::common::convertToStringW(params->m_message).c_str()));
981
+ m_alertDialog->setStandardButtons(QMessageBox::Cancel);
982
+
983
+ //exec() is model popup and show() is modeless popup
984
+ //m_alertDialog->exec();
985
+ m_alertDialog->show();
986
+
987
+ } else if (params->m_dlgType == CAlertParams::DLG_DEFAULT) {
988
+ QMessageBox::warning(0, QString::fromWCharArray(strAppName.c_str()),
989
+ QString::fromWCharArray(rho::common::convertToStringW(params->m_message).c_str()));
990
+ } else if (params->m_dlgType == CAlertParams::DLG_CUSTOM) {
991
+ if ( params->m_buttons.size() == 1 && strcasecmp(params->m_buttons[0].m_strCaption.c_str(), "ok") == 0)
992
+ QMessageBox::warning(0, QString::fromWCharArray(rho::common::convertToStringW(params->m_title).c_str()),
993
+ QString::fromWCharArray(rho::common::convertToStringW(params->m_message).c_str()));
994
+ else if (params->m_buttons.size() == 2 && strcasecmp(params->m_buttons[0].m_strCaption.c_str(), "ok") == 0 &&
995
+ strcasecmp(params->m_buttons[1].m_strCaption.c_str(), "cancel") == 0)
996
+ {
997
+ QMessageBox::StandardButton response = QMessageBox::warning(0,
998
+ QString::fromWCharArray(rho::common::convertToStringW(params->m_title).c_str()),
999
+ QString::fromWCharArray(rho::common::convertToStringW(params->m_message).c_str()),
1000
+ QMessageBox::Ok | QMessageBox::Cancel);
1001
+ int nBtn = response == QMessageBox::Cancel ? 1 : 0;
1002
+ doAlertCallback(params, nBtn, params->m_buttons[nBtn]);
1003
+ } else if (m_alertDialog == NULL) {
1004
+ QMessageBox::Icon icon = QMessageBox::NoIcon;
1005
+ if (stricmp(params->m_icon.c_str(),"alert")==0) {
1006
+ icon = QMessageBox::Warning;
1007
+ } else if (stricmp(params->m_icon.c_str(),"question")==0) {
1008
+ icon = QMessageBox::Question;
1009
+ } else if (stricmp(params->m_icon.c_str(),"info")==0) {
1010
+ icon = QMessageBox::Information;
1011
+ }
1012
+ m_alertDialog = new QMessageBox(icon, //new DateTimeDialog(params, 0);
1013
+ QString::fromWCharArray(rho::common::convertToStringW(params->m_title).c_str()),
1014
+ QString::fromWCharArray(rho::common::convertToStringW(params->m_message).c_str()));
1015
+ m_alertDialog->setStandardButtons(0);
1016
+ for (int i = 0; i < (int)params->m_buttons.size(); i++) {
1017
+ #ifdef OS_SYMBIAN
1018
+ if(i == 0)
1019
+ #endif
1020
+ m_alertDialog->addButton(QString::fromWCharArray(
1021
+ rho::common::convertToStringW(params->m_buttons[i].m_strCaption).c_str()),
1022
+ QMessageBox::ActionRole);
1023
+ #ifdef OS_SYMBIAN
1024
+ else if( i == 1)
1025
+ m_alertDialog->addButton(QString::fromWCharArray(
1026
+ rho::common::convertToStringW(params->m_buttons[i].m_strCaption).c_str()),
1027
+ QMessageBox::RejectRole);
1028
+ else if(i == 2)
1029
+ break;
1030
+ #endif
1031
+ }
1032
+ m_alertDialog->exec();
1033
+ if (m_alertDialog) {
1034
+ const QAbstractButton* btn = m_alertDialog->clickedButton();
1035
+ if (btn) {
1036
+ for (int i = 0; i < m_alertDialog->buttons().count(); ++i) {
1037
+ if (btn == m_alertDialog->buttons().at(i)) {
1038
+ #ifdef OS_SYMBIAN
1039
+ RHODESAPP().callPopupCallback(params->m_callback,
1040
+ params->m_buttons[m_alertDialog->buttons().count() - i - 1].m_strID,
1041
+ params->m_buttons[m_alertDialog->buttons().count() - i - 1].m_strCaption);
1042
+ #else
1043
+ doAlertCallback(params, i, params->m_buttons[i]);
1044
+ #endif
1045
+ break;
1046
+ }
1047
+ }
1048
+ }
1049
+ delete m_alertDialog;
1050
+ m_alertDialog = 0;
1051
+ }
1052
+ } else {
1053
+ LOG(WARNING) + "Trying to show alert dialog while it exists.";
1054
+ }
1055
+ }
1056
+
1057
+ if (params)
1058
+ delete params;
1059
+ }
1060
+
1061
+ void QtMainWindow::alertHidePopup()
1062
+ {
1063
+ if (m_alertDialog) {
1064
+ m_alertDialog->done(QMessageBox::Accepted);
1065
+ delete m_alertDialog;
1066
+ m_alertDialog = 0;
1067
+ }
1068
+ }
1069
+
1070
+ void QtMainWindow::dateTimePicker(CDateTimeMessage* msg)
1071
+ {
1072
+ if (msg) {
1073
+ int retCode = -1;
1074
+
1075
+ DateTimeDialog timeDialog(msg, this);
1076
+ retCode = timeDialog.exec();
1077
+
1078
+ rho_rhodesapp_callDateTimeCallback( msg->m_callback,
1079
+ retCode == QDialog::Accepted ? (long) timeDialog.getUnixTime() : 0,
1080
+ msg->m_data,
1081
+ retCode == QDialog::Accepted ? 0 : 1);
1082
+
1083
+ delete msg;
1084
+ }
1085
+ }
1086
+
1087
+ void QtMainWindow::executeCommand(RhoNativeViewRunnable* runnable)
1088
+ {
1089
+ if (runnable) {
1090
+ runnable->run();
1091
+ delete runnable;
1092
+ }
1093
+ }
1094
+
1095
+ void QtMainWindow::executeRunnable(rho::common::IRhoRunnable* pTask)
1096
+ {
1097
+ if (pTask) {
1098
+ pTask->runObject();
1099
+ delete pTask;
1100
+ }
1101
+ }
1102
+
1103
+ void QtMainWindow::takeSignature(void*) //TODO: Signature::Params*
1104
+ {
1105
+ //TODO: takeSignature
1106
+ }
1107
+
1108
+ void QtMainWindow::fullscreenCommand(int enable)
1109
+ {
1110
+ #if defined(OS_WINDOWS_DESKTOP) && !defined(RHODES_EMULATOR)
1111
+ if ((enable && !isFullScreen()) || (!enable && isFullScreen())) {
1112
+ this->menuBar()->setVisible(RHOCONF().getBool("w32_fullscreen_menu") || (!enable));
1113
+ setWindowModality(enable ? Qt::ApplicationModal : Qt::NonModal);
1114
+ setWindowState(windowState() ^ Qt::WindowFullScreen);
1115
+ }
1116
+ #else
1117
+ if ((enable && !isMaximized()) || (!enable && isMaximized()))
1118
+ setWindowState(windowState() ^ Qt::WindowMaximized);
1119
+ #endif
1120
+ LOG(INFO) + (enable ? "Switched to Fullscreen mode" : "Switched to Normal mode" );
1121
+ }
1122
+
1123
+ bool QtMainWindow::getFullScreen()
1124
+ {
1125
+ #if defined(OS_WINDOWS_DESKTOP) && !defined(RHODES_EMULATOR)
1126
+ return windowState() & Qt::WindowFullScreen;
1127
+ #else
1128
+ return windowState() & Qt::WindowMaximized;
1129
+ #endif
1130
+ }
1131
+
1132
+ void QtMainWindow::setCookie(const char* url, const char* cookie)
1133
+ {
1134
+ if (url && cookie) {
1135
+ QUrl urlStr = QUrl(QString::fromUtf8(url));
1136
+ cookieStore = main_webView->page()->profile()->cookieStore();
1137
+ QStringList cookieList = QString::fromUtf8(cookie).split(";");
1138
+ for (int i=0; i<cookieList.size(); ++i)
1139
+ foreach (QNetworkCookie cookie, QNetworkCookie::parseCookies(cookieList.at(i).toLatin1())) {
1140
+ cookieStore->setCookie(cookie, urlStr);
1141
+ }
1142
+ }
1143
+ }
1144
+
1145
+ void QtMainWindow::bringToFront()
1146
+ {
1147
+ this->show();
1148
+ this->raise();
1149
+ this->activateWindow();
1150
+ }
1151
+
1152
+ // Window frame
1153
+ void QtMainWindow::setFrame(int x, int y, int width, int height)
1154
+ {
1155
+ this->move(x, y);
1156
+ this->resize(width, height);
1157
+ }
1158
+
1159
+ void QtMainWindow::setPosition(int x, int y)
1160
+ {
1161
+ this->move(x, y);
1162
+ }
1163
+
1164
+ void QtMainWindow::setSize(int width, int height)
1165
+ {
1166
+ this->resize(width, height);
1167
+ }
1168
+
1169
+ void QtMainWindow::lockSize(int locked)
1170
+ {
1171
+ if (locked)
1172
+ this->setFixedSize(this->width(), this->height());
1173
+ else
1174
+ this->setFixedSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX);
1175
+ }
1176
+
1177
+ void QtMainWindow::setTitle(const char* title)
1178
+ {
1179
+ this->setWindowTitle(QString::fromUtf8(title));
1180
+ }
1181
+