rhodes 3.3.3.beta.4 → 3.3.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (497) hide show
  1. data/CHANGELOG +7 -5
  2. data/CREDITS +2215 -0
  3. data/Rakefile +225 -59
  4. data/bin/c2dm.rb +0 -0
  5. data/bin/get-rhodes-info.bat +0 -0
  6. data/bin/migrate-rhodes-app +0 -0
  7. data/bin/migrate-rhodes-app.bat +0 -0
  8. data/bin/rhodes +0 -0
  9. data/bin/rhodes-setup +0 -0
  10. data/bin/rhodes-setup.bat +0 -0
  11. data/bin/rhogen +0 -0
  12. data/bin/rhogen.bat +0 -0
  13. data/bin/set-rhodes-sdk +0 -0
  14. data/bin/set-rhodes-sdk.bat +0 -0
  15. data/bin/upgrade-rhodes-app +0 -0
  16. data/bin/upgrade-rhodes-app.bat +0 -0
  17. data/doc/build.txt +20 -9
  18. data/doc/configuration.txt +8 -8
  19. data/doc/connect-to-web-services.txt +1 -1
  20. data/doc/device-caps.txt +63 -26
  21. data/doc/extensions.txt +14 -2
  22. data/doc/install.txt +28 -19
  23. data/doc/introduction.txt +6 -3
  24. data/doc/jqt-jqm-transition.txt +10 -9
  25. data/doc/release.txt +5 -1
  26. data/doc/rhodes-command-line.txt +130 -0
  27. data/doc/rhom.txt +16 -11
  28. data/doc/rhostudio-eclipse.txt +3 -3
  29. data/doc/simulator.txt +28 -31
  30. data/doc/syncengine-ajax-api.txt +246 -0
  31. data/doc/synchronization.txt +21 -3
  32. data/doc/test-log-debug.txt +3 -1
  33. data/doc/ui.txt +16 -16
  34. data/ext/extconf.rb +8 -0
  35. data/lib/build/jake.rb +5 -5
  36. data/lib/extensions/barcode/ext/barcode/platform/android/Rakefile +9 -9
  37. data/lib/extensions/barcode/ext/barcode/platform/android/jni/src/barcode.cpp +81 -1
  38. data/lib/extensions/barcode/ext/barcode/platform/android/src/com/google/zxing/client/android/CaptureActivityHandler.java +6 -13
  39. data/lib/extensions/barcode/ext/barcode/platform/android/src/com/google/zxing/client/android/DecodeHandler.java +2 -6
  40. data/lib/extensions/barcode/ext/barcode/platform/android/src/com/rhomobile/barcode/Barcode.java +12 -1
  41. data/lib/extensions/barcode/ext/barcode/platform/bb/run.bat +0 -0
  42. data/lib/extensions/barcode/ext/barcode/platform/iphone/Classes/BarcodeCallbackHelper.h +2 -0
  43. data/lib/extensions/barcode/ext/barcode/platform/iphone/Classes/BarcodeCallbackHelper.mm +36 -0
  44. data/lib/extensions/barcode/ext/barcode/platform/iphone/Classes/BarcodeViewController.h +0 -0
  45. data/lib/extensions/barcode/ext/barcode/platform/iphone/Classes/BarcodeViewController.m +15 -5
  46. data/lib/extensions/barcode/ext/barcode/platform/iphone/Classes/barcode.m +64 -1
  47. data/lib/extensions/barcode/ext/barcode/shared/ruby/barcode.i +35 -1
  48. data/lib/extensions/barcode/ext/barcode/shared/ruby/barcode_wrap.c +126 -2
  49. data/lib/extensions/barcode/ext/barcode/shared/src/zbar.c +18 -1
  50. data/lib/extensions/barcode/ext/build +0 -0
  51. data/lib/extensions/barcode/ext/build.bat +0 -0
  52. data/lib/extensions/digest-md5/ext/Rakefile +12 -10
  53. data/lib/extensions/digest-md5/ext/build +0 -0
  54. data/lib/extensions/digest-md5/ext/build.bat +0 -0
  55. data/lib/extensions/digest-md5/ext/digest-md5.sln +2 -2
  56. data/lib/extensions/digest-md5/ext/digest-md5.vcproj +41 -28
  57. data/lib/extensions/digest-sha1/ext/Rakefile +11 -10
  58. data/lib/extensions/digest-sha1/ext/build +0 -0
  59. data/lib/extensions/digest-sha1/ext/build.bat +0 -0
  60. data/lib/extensions/digest-sha1/ext/digest-sha1.sln +2 -2
  61. data/lib/extensions/digest-sha1/ext/digest-sha1.vcproj +41 -28
  62. data/lib/extensions/digest/ext/Rakefile +12 -11
  63. data/lib/extensions/digest/ext/build +0 -0
  64. data/lib/extensions/digest/ext/build.bat +0 -0
  65. data/lib/extensions/digest/ext/digest.sln +44 -0
  66. data/lib/extensions/digest/ext/digest.vcproj +40 -27
  67. data/lib/extensions/esri/ext/build +0 -0
  68. data/lib/extensions/esri/ext/build.bat +0 -0
  69. data/lib/extensions/fcntl/ext/Rakefile +10 -9
  70. data/lib/extensions/fcntl/ext/build +0 -0
  71. data/lib/extensions/fcntl/ext/build.bat +0 -0
  72. data/lib/extensions/fcntl/ext/fcntl.vcproj +1 -1
  73. data/lib/extensions/nfc/ext/build +0 -0
  74. data/lib/extensions/nfc/ext/build.bat +0 -0
  75. data/lib/extensions/nfc/ext/nfc/platform/android/Rakefile +11 -11
  76. data/lib/extensions/nfc/ext/nfc/platform/android/jni/src/nfc.cpp +0 -0
  77. data/lib/extensions/nfc/ext/nfc/platform/android/src/com/rhomobile/nfc/Nfc.java +12 -10
  78. data/lib/extensions/nfc/ext/nfc/shared/ruby/nfc_wrap.c +16 -9
  79. data/lib/extensions/pdf-writer/color.rb +145 -0
  80. data/lib/extensions/pdf-writer/color/cmyk.rb +279 -0
  81. data/lib/extensions/pdf-writer/color/css.rb +28 -0
  82. data/lib/extensions/pdf-writer/color/grayscale.rb +212 -0
  83. data/lib/extensions/pdf-writer/color/hsl.rb +221 -0
  84. data/lib/extensions/pdf-writer/color/palette.rb +16 -0
  85. data/lib/extensions/pdf-writer/color/palette/adobecolor.rb +272 -0
  86. data/lib/extensions/pdf-writer/color/palette/gimp.rb +116 -0
  87. data/lib/extensions/pdf-writer/color/palette/monocontrast.rb +180 -0
  88. data/lib/extensions/pdf-writer/color/rgb-colors.rb +355 -0
  89. data/lib/extensions/pdf-writer/color/rgb.rb +453 -0
  90. data/lib/extensions/pdf-writer/color/rgb/metallic.rb +43 -0
  91. data/lib/extensions/pdf-writer/color/yiq.rb +84 -0
  92. data/lib/extensions/pdf-writer/ext/LICENSES/color/Licence.txt +27 -0
  93. data/lib/extensions/pdf-writer/ext/LICENSES/color/README.txt +32 -0
  94. data/lib/extensions/pdf-writer/ext/LICENSES/pdf-writer/LICENCE +131 -0
  95. data/lib/extensions/pdf-writer/ext/LICENSES/pdf-writer/README +33 -0
  96. data/lib/extensions/pdf-writer/ext/LICENSES/transaction-simple/Licence.txt +25 -0
  97. data/lib/extensions/pdf-writer/ext/LICENSES/transaction-simple/Readme.txt +204 -0
  98. data/lib/extensions/pdf-writer/pdf/charts.rb +13 -0
  99. data/lib/extensions/pdf-writer/pdf/charts/stddev.rb +430 -0
  100. data/lib/extensions/pdf-writer/pdf/math.rb +108 -0
  101. data/lib/extensions/pdf-writer/pdf/quickref.rb +332 -0
  102. data/lib/extensions/pdf-writer/pdf/simpletable.rb +947 -0
  103. data/lib/extensions/pdf-writer/pdf/techbook.rb +901 -0
  104. data/lib/extensions/pdf-writer/pdf/writer.rb +2729 -0
  105. data/lib/extensions/pdf-writer/pdf/writer/arc4.rb +63 -0
  106. data/lib/extensions/pdf-writer/pdf/writer/fontmetrics.rb +203 -0
  107. data/lib/extensions/pdf-writer/pdf/writer/fonts/Courier-Bold.afm +342 -0
  108. data/lib/extensions/pdf-writer/pdf/writer/fonts/Courier-BoldOblique.afm +342 -0
  109. data/lib/extensions/pdf-writer/pdf/writer/fonts/Courier-Oblique.afm +342 -0
  110. data/lib/extensions/pdf-writer/pdf/writer/fonts/Courier.afm +342 -0
  111. data/lib/extensions/pdf-writer/pdf/writer/fonts/Helvetica-Bold.afm +2827 -0
  112. data/lib/extensions/pdf-writer/pdf/writer/fonts/Helvetica-BoldOblique.afm +2827 -0
  113. data/lib/extensions/pdf-writer/pdf/writer/fonts/Helvetica-Oblique.afm +3051 -0
  114. data/lib/extensions/pdf-writer/pdf/writer/fonts/Helvetica.afm +3051 -0
  115. data/lib/extensions/pdf-writer/pdf/writer/fonts/MustRead.html +19 -0
  116. data/lib/extensions/pdf-writer/pdf/writer/fonts/Symbol.afm +213 -0
  117. data/lib/extensions/pdf-writer/pdf/writer/fonts/Times-Bold.afm +2588 -0
  118. data/lib/extensions/pdf-writer/pdf/writer/fonts/Times-BoldItalic.afm +2384 -0
  119. data/lib/extensions/pdf-writer/pdf/writer/fonts/Times-Italic.afm +2667 -0
  120. data/lib/extensions/pdf-writer/pdf/writer/fonts/Times-Roman.afm +2419 -0
  121. data/lib/extensions/pdf-writer/pdf/writer/fonts/ZapfDingbats.afm +225 -0
  122. data/lib/extensions/pdf-writer/pdf/writer/graphics.rb +813 -0
  123. data/lib/extensions/pdf-writer/pdf/writer/graphics/imageinfo.rb +365 -0
  124. data/lib/extensions/pdf-writer/pdf/writer/lang.rb +43 -0
  125. data/lib/extensions/pdf-writer/pdf/writer/lang/en.rb +99 -0
  126. data/lib/extensions/pdf-writer/pdf/writer/object.rb +23 -0
  127. data/lib/extensions/pdf-writer/pdf/writer/object/action.rb +35 -0
  128. data/lib/extensions/pdf-writer/pdf/writer/object/annotation.rb +42 -0
  129. data/lib/extensions/pdf-writer/pdf/writer/object/catalog.rb +39 -0
  130. data/lib/extensions/pdf-writer/pdf/writer/object/contents.rb +65 -0
  131. data/lib/extensions/pdf-writer/pdf/writer/object/destination.rb +40 -0
  132. data/lib/extensions/pdf-writer/pdf/writer/object/encryption.rb +53 -0
  133. data/lib/extensions/pdf-writer/pdf/writer/object/font.rb +72 -0
  134. data/lib/extensions/pdf-writer/pdf/writer/object/fontdescriptor.rb +34 -0
  135. data/lib/extensions/pdf-writer/pdf/writer/object/fontencoding.rb +40 -0
  136. data/lib/extensions/pdf-writer/pdf/writer/object/image.rb +304 -0
  137. data/lib/extensions/pdf-writer/pdf/writer/object/info.rb +51 -0
  138. data/lib/extensions/pdf-writer/pdf/writer/object/outline.rb +30 -0
  139. data/lib/extensions/pdf-writer/pdf/writer/object/outlines.rb +30 -0
  140. data/lib/extensions/pdf-writer/pdf/writer/object/page.rb +195 -0
  141. data/lib/extensions/pdf-writer/pdf/writer/object/pages.rb +115 -0
  142. data/lib/extensions/pdf-writer/pdf/writer/object/procset.rb +46 -0
  143. data/lib/extensions/pdf-writer/pdf/writer/object/viewerpreferences.rb +74 -0
  144. data/lib/extensions/pdf-writer/pdf/writer/ohash.rb +58 -0
  145. data/lib/extensions/pdf-writer/pdf/writer/oreader.rb +25 -0
  146. data/lib/extensions/pdf-writer/pdf/writer/state.rb +48 -0
  147. data/lib/extensions/pdf-writer/pdf/writer/strokestyle.rb +138 -0
  148. data/lib/extensions/pdf-writer/transaction/simple.rb +486 -0
  149. data/lib/extensions/pdf-writer/transaction/simple/group.rb +146 -0
  150. data/lib/extensions/pdf-writer/transaction/simple/threadsafe.rb +68 -0
  151. data/lib/extensions/pdf-writer/transaction/simple/threadsafe/group.rb +36 -0
  152. data/lib/framework/builtinME.rb +0 -0
  153. data/lib/framework/dateOrig.rb +8 -2
  154. data/lib/framework/rational.rb +0 -0
  155. data/lib/framework/res/esri.wm.png +0 -0
  156. data/lib/framework/rho/rho.rb +6 -0
  157. data/lib/framework/rho/rhobluetooth.rb +0 -0
  158. data/lib/framework/rho/rhofsconnector.rb +0 -0
  159. data/lib/framework/rho/rhonativeviewmanager.rb +0 -0
  160. data/lib/framework/rhofsconnector.rb +0 -0
  161. data/lib/framework/rhom/rhom_object_factory.rb +8 -0
  162. data/lib/framework/rhomotoapi.rb +3 -2
  163. data/platform/android/Rhodes/jni/include/rhodes/JNIRhodes.h +9 -1
  164. data/platform/android/Rhodes/jni/include/rhodes/details/rhojava.inc +1 -0
  165. data/platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_file_RhoFileApi.h +26 -2
  166. data/platform/android/Rhodes/jni/src/callbacks.cpp +0 -5
  167. data/platform/android/Rhodes/jni/src/camera.cpp +1 -1
  168. data/platform/android/Rhodes/jni/src/fileapi.cpp +39 -19
  169. data/platform/android/Rhodes/jni/src/geolocation.cpp +3 -3
  170. data/platform/android/Rhodes/jni/src/mapview.cpp +206 -64
  171. data/platform/android/Rhodes/jni/src/nativeview.cpp +1 -1
  172. data/platform/android/Rhodes/jni/src/rhodes.cpp +13 -0
  173. data/platform/android/Rhodes/jni/src/rhodesapp.cpp +20 -0
  174. data/platform/android/Rhodes/jni/src/rhodessystem.cpp +36 -3
  175. data/platform/android/Rhodes/jni/src/signature.cpp +22 -2
  176. data/platform/android/Rhodes/res/drawable/alert_info.png +0 -0
  177. data/platform/android/Rhodes/res/drawable/esri.png +0 -0
  178. data/platform/android/Rhodes/src/com/rhomobile/rhodes/Capabilities.java +17 -16
  179. data/platform/android/Rhodes/src/com/rhomobile/rhodes/Logger.java +4 -1
  180. data/platform/android/Rhodes/src/com/rhomobile/rhodes/MemoryInfoCollector.java +67 -0
  181. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivity.java +139 -114
  182. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesApplication.java +106 -13
  183. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +11 -3
  184. data/platform/android/Rhodes/src/com/rhomobile/rhodes/WebView.java +71 -16
  185. data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/CameraNewService.java +4 -1
  186. data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/CameraSemiService.java +4 -1
  187. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/AbstractRhoExtension.java +22 -1
  188. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/Config.java +243 -0
  189. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/IRhoExtManager.java +19 -1
  190. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/IRhoExtension.java +9 -1
  191. data/platform/android/Rhodes/src/com/rhomobile/rhodes/{RhodesActivityListener.java → extmanager/IRhoListener.java} +16 -12
  192. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/RhoExtManager.java +63 -1
  193. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/RhoExtManagerImpl.java +239 -14
  194. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/RhodesStartupListeners.java +9 -0
  195. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/WebkitExtension.java +53 -0
  196. data/platform/android/Rhodes/src/com/rhomobile/rhodes/file/RhoFileApi.java +27 -12
  197. data/platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocation.java +124 -62
  198. data/platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocationImpl.java +49 -137
  199. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SimpleMainView.java +84 -114
  200. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SplashScreen.java +75 -82
  201. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/TabbedMainView.java +3 -2
  202. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/Callout.java +4 -0
  203. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/MapBitmapManager.java +124 -0
  204. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/MapView.java +232 -43
  205. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/Request.java +193 -0
  206. data/platform/android/Rhodes/src/com/rhomobile/rhodes/nativeview/IRhoCustomView.java +13 -0
  207. data/platform/android/Rhodes/src/com/rhomobile/rhodes/nativeview/RhoNativeViewManager.java +32 -23
  208. data/platform/android/Rhodes/src/com/rhomobile/rhodes/nativeview/RhoVideoView.java +74 -0
  209. data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality.java +6 -7
  210. data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality01.java +37 -0
  211. data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality03.java +14 -1
  212. data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality05.java +51 -38
  213. data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality07.java +9 -1
  214. data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality08.java +48 -31
  215. data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionalityManager.java +15 -16
  216. data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/Signature.java +52 -15
  217. data/platform/android/Rhodes/src/com/rhomobile/rhodes/uri/LocalFileHandler.java +20 -2
  218. data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/ChromeClientOld.java +1 -0
  219. data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/GoogleWebView.java +77 -34
  220. data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/IRhoWebView.java +9 -0
  221. data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoWebChromeClient.java +105 -0
  222. data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoWebViewClient.java +1 -1
  223. data/platform/android/build/RhodesSRC_build.files +8 -7
  224. data/platform/android/build/android.rake +326 -216
  225. data/platform/android/build/androidcommon.rb +27 -13
  226. data/platform/bb/RubyVM/src/com/rho/file/SimpleFile.java +27 -1
  227. data/platform/bb/RubyVM/src/j2me/io/File.java +104 -38
  228. data/platform/bb/build/bb.rake +1 -0
  229. data/platform/bb/build/runRAPC.bat +0 -0
  230. data/platform/bb/rhodes/resources/background.png +0 -0
  231. data/platform/bb/rhodes/resources/esri.png +0 -0
  232. data/platform/bb/rhodes/resources/mappin.png +0 -0
  233. data/platform/bb/rhodes/src/com/rho/rubyext/System.java +5 -1
  234. data/platform/bb/rhodes/src/rhomobile/PushListeningThread.java +2 -2
  235. data/platform/bb/rhodes/src/rhomobile/mapview/ESRIMapField.java +0 -0
  236. data/platform/bb/rhodes/src/rhomobile/mapview/ESRIMapProvider.java +0 -0
  237. data/platform/bb/rhodes/src/rhomobile/mapview/GeoCoding.java +0 -0
  238. data/platform/bb/rhodes/src/rhomobile/mapview/GoogleGeoCoding.java +0 -0
  239. data/platform/bb/rhodes/src/rhomobile/mapview/MapTools.java +0 -0
  240. data/platform/iphone/Classes/AppManager/AppManager.m +7 -1
  241. data/platform/iphone/Classes/Camera/PickImageDelegate.h +9 -0
  242. data/platform/iphone/Classes/Camera/PickImageDelegate.m +75 -4
  243. data/platform/iphone/Classes/GeoLocation/LocationController.h +8 -2
  244. data/platform/iphone/Classes/GeoLocation/LocationController.m +74 -76
  245. data/platform/iphone/Classes/InitMemoryInfoCollector.h +33 -0
  246. data/platform/iphone/Classes/InitMemoryInfoCollector.mm +52 -0
  247. data/platform/iphone/Classes/NativeView/NVViewController.h +0 -0
  248. data/platform/iphone/Classes/NativeView/NVViewController.m +34 -2
  249. data/platform/iphone/Classes/Rhodes.m +22 -2
  250. data/platform/iphone/Classes/Signature/SignatureDelegate.m +19 -0
  251. data/platform/iphone/Classes/Signature/SignatureViewController.h +0 -0
  252. data/platform/iphone/Classes/Signature/SignatureViewController.m +0 -0
  253. data/platform/iphone/Classes/SimpleMainView.h +0 -0
  254. data/platform/iphone/Classes/SimpleMainView.m +3 -3
  255. data/platform/iphone/ESRI/BluePushpin.png +0 -0
  256. data/platform/iphone/ESRI/BluePushpin@2x.png +0 -0
  257. data/platform/iphone/ESRI/esri.png +0 -0
  258. data/platform/iphone/ESRI/esri@2x.png +0 -0
  259. data/platform/iphone/rbuild/iphone.rake +75 -7
  260. data/platform/iphone/rhorunner.xcodeproj/project.pbxproj +13 -4
  261. data/platform/linux/target/compiler/rubylinux +0 -0
  262. data/platform/mac/target/compiler/RubyMac +0 -0
  263. data/platform/osx/Rhodes Launcher/rhorunner.app/rhorunner b/data/platform/osx/Rhodes → Launcher/rhorunner.app/rhorunner +0 -0
  264. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Frameworks/QtCore.framework/Versions/4/QtCore +0 -0
  265. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Frameworks/QtGui.framework/Resources/qt_menu.nib/keyedobjects.nib +0 -0
  266. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Frameworks/QtGui.framework/Versions/4/QtGui +0 -0
  267. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Frameworks/QtNetwork.framework/Versions/4/QtNetwork +0 -0
  268. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Frameworks/QtWebKit.framework/Versions/4/QtWebKit +0 -0
  269. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Info.plist +1 -1
  270. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/MacOS/RhoSimulator +0 -0
  271. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/accessible/libqtaccessiblewidgets.dylib +0 -0
  272. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/bearer/libqcorewlanbearer.dylib +0 -0
  273. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/bearer/libqgenericbearer.dylib +0 -0
  274. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/codecs/libqcncodecs.dylib +0 -0
  275. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/codecs/libqjpcodecs.dylib +0 -0
  276. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/codecs/libqkrcodecs.dylib +0 -0
  277. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/codecs/libqtwcodecs.dylib +0 -0
  278. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/graphicssystems/libqtracegraphicssystem.dylib +0 -0
  279. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/imageformats/libqgif.dylib +0 -0
  280. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/imageformats/libqico.dylib +0 -0
  281. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/imageformats/libqjpeg.dylib +0 -0
  282. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/imageformats/libqmng.dylib +0 -0
  283. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/imageformats/libqtga.dylib +0 -0
  284. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/imageformats/libqtiff.dylib +0 -0
  285. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/qmltooling/libqmldbg_inspector.dylib +0 -0
  286. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/qmltooling/libqmldbg_tcp.dylib +0 -0
  287. data/platform/osx/build/osx.rake +6 -8
  288. data/platform/shared/RhoConnectClient/RhoConnectClient.cpp +165 -33
  289. data/platform/shared/RhoConnectClient/RhoConnectClient.h +10 -1
  290. data/platform/shared/common/BundleManager.cpp +27 -16
  291. data/platform/shared/common/ExtManager.h +15 -2
  292. data/platform/shared/common/RhoConf.cpp +17 -2
  293. data/platform/shared/common/RhoConf.h +3 -1
  294. data/platform/shared/common/RhoDefs.h +6 -6
  295. data/platform/shared/common/RhoFatalError.h +1 -1
  296. data/platform/shared/common/RhoFile.cpp +9 -9
  297. data/platform/shared/common/RhoFilePath.h +7 -3
  298. data/platform/shared/common/RhoPort.h +3 -3
  299. data/platform/shared/common/RhoSystem.h +1 -1
  300. data/platform/shared/common/RhodesApp.cpp +426 -26
  301. data/platform/shared/common/RhodesApp.h +11 -3
  302. data/platform/shared/common/RhodesAppBase.cpp +4 -1
  303. data/platform/shared/common/StringConverter.h +3 -3
  304. data/platform/shared/common/app_build_capabilities.h +8 -0
  305. data/platform/shared/common/map/BaseMapEngine.cpp +302 -21
  306. data/platform/shared/common/map/BaseMapEngine.h +132 -6
  307. data/platform/shared/common/map/ESRIMapEngine.cpp +2 -1
  308. data/platform/shared/common/map/GeocodingMapEngine.cpp +22 -4
  309. data/platform/shared/common/map/GeocodingMapEngine.h +40 -0
  310. data/platform/shared/common/map/GoogleMapEngine.cpp +13 -1
  311. data/platform/shared/common/map/MapEngine.h +7 -0
  312. data/platform/shared/common/map/OSMMapEngine.cpp +12 -1
  313. data/platform/shared/json/JSONIterator.cpp +1 -1
  314. data/platform/shared/json/RJSONTokener.c +2 -0
  315. data/platform/shared/json/config.h +3 -3
  316. data/platform/shared/logging/RhoLog.cpp +12 -3
  317. data/platform/shared/logging/RhoLog.h +2 -1
  318. data/platform/shared/logging/RhoLogConf.cpp +147 -11
  319. data/platform/shared/logging/RhoLogConf.h +39 -1
  320. data/platform/shared/logging/RhoLogSink.cpp +1 -1
  321. data/platform/shared/net/HttpServer.cpp +8 -4
  322. data/platform/shared/net/INetRequest.cpp +7 -0
  323. data/platform/shared/net/INetRequest.h +2 -0
  324. data/platform/shared/net/RawSocket.cpp +1 -1
  325. data/platform/shared/qt/pbxproj2pro.pl +0 -0
  326. data/platform/shared/qt/pro_vcproj_diff.pl +0 -0
  327. data/platform/shared/qt/rhodes/QtMainWindow.cpp +1 -1
  328. data/platform/shared/qt/rhodes/impl/RhoClassFactoryImpl.h +2 -2
  329. data/platform/shared/qt/rhodes/impl/RhoThreadImpl.cpp +2 -2
  330. data/platform/shared/qt/rhodes/impl/SystemImpl.cpp +11 -1
  331. data/platform/shared/qt/rhodes/main.cpp +5 -5
  332. data/platform/shared/ruby/ext/alert/alert_wrap.c +8 -8
  333. data/platform/shared/ruby/ext/bluetooth/bluetooth.i +0 -0
  334. data/platform/shared/ruby/ext/bluetooth/bluetooth_wrap.c +16 -9
  335. data/platform/shared/ruby/ext/camera/camera.i +2 -2
  336. data/platform/shared/ruby/ext/camera/camera_wrap.c +18 -3
  337. data/platform/shared/ruby/ext/datetimepicker/datetimepicker_wrap.c +37 -8
  338. data/platform/shared/ruby/ext/geolocation/geolocation_wrap.c +8 -8
  339. data/platform/shared/ruby/ext/mapview/mapview_wrap.c +16 -9
  340. data/platform/shared/ruby/ext/nativebar/nativebar_wrap.c +16 -9
  341. data/platform/shared/ruby/ext/nativeviewmanager/nativeviewmanager.i +0 -0
  342. data/platform/shared/ruby/ext/nativeviewmanager/nativeviewmanager_wrap.c +16 -9
  343. data/platform/shared/ruby/ext/phonebook/phonebook_wrap.c +8 -1
  344. data/platform/shared/ruby/ext/rho/rhoruby.c +7 -1
  345. data/platform/shared/ruby/ext/rho/rhoruby.h +1 -0
  346. data/platform/shared/ruby/ext/rhoconf/rhoconf_wrap.c +16 -9
  347. data/platform/shared/ruby/ext/signature/signature.i +0 -0
  348. data/platform/shared/ruby/ext/signature/signature_wrap.c +9 -9
  349. data/platform/shared/ruby/ext/syncengine/syncengine_wrap.c +16 -9
  350. data/platform/shared/ruby/ext/system/system_wrap.c +16 -9
  351. data/platform/shared/ruby/ext/webview/webview_wrap.c +16 -9
  352. data/platform/shared/ruby/gc.c +1 -0
  353. data/platform/shared/ruby/regint.h +6 -4
  354. data/platform/shared/ruby/vm.c +1 -0
  355. data/platform/shared/ruby/wince/wince.h +1 -1
  356. data/platform/shared/rubyext/System.cpp +1 -1
  357. data/platform/shared/shttpd/src/rdispatcher.c +3 -3
  358. data/platform/shared/shttpd/src/std_includes.h +1 -1
  359. data/platform/shared/sqlite/sqlite3.c +1 -0
  360. data/platform/shared/statistic/test/TestProfiling.cpp +1 -1
  361. data/platform/shared/stlport/build/lib/configure +0 -0
  362. data/platform/shared/stlport/build/lib/configure.bat +0 -0
  363. data/platform/shared/sync/SyncEngine.cpp +9 -12
  364. data/platform/shared/sync/SyncNotify.cpp +36 -3
  365. data/platform/shared/sync/SyncNotify.h +11 -4
  366. data/platform/shared/sync/SyncSource.cpp +32 -16
  367. data/platform/shared/sync/SyncSource.h +2 -3
  368. data/platform/shared/sync/SyncThread.cpp +13 -4
  369. data/platform/shared/sync/SyncThread.h +4 -0
  370. data/platform/shared/tcmalloc/page_heap.h +1 -1
  371. data/platform/shared/tcmalloc/rhomem.h +1 -1
  372. data/platform/shared/tcmalloc/windows/port.cpp +12 -3
  373. data/platform/shared/test/Tests.cpp +4 -4
  374. data/platform/shared/test/test_helper.cpp +4 -4
  375. data/platform/symbian/sqlite3/src/sqlite3.h +1 -1
  376. data/platform/win32/RhoSimulator/Microsoft.VC90.CRT.manifest +6 -0
  377. data/platform/win32/RhoSimulator/Microsoft.VC90.OpenMP.manifest +6 -0
  378. data/platform/win32/RhoSimulator/QtCore4.dll +0 -0
  379. data/platform/win32/RhoSimulator/QtGui4.dll +0 -0
  380. data/platform/win32/RhoSimulator/QtNetwork4.dll +0 -0
  381. data/platform/win32/RhoSimulator/QtWebKit4.dll +0 -0
  382. data/platform/win32/RhoSimulator/RhoSimulator.exe +0 -0
  383. data/platform/win32/RhoSimulator/imageformats/qgif4.dll +0 -0
  384. data/platform/win32/RhoSimulator/imageformats/qico4.dll +0 -0
  385. data/platform/win32/RhoSimulator/imageformats/qjpeg4.dll +0 -0
  386. data/platform/win32/RhoSimulator/imageformats/qmng4.dll +0 -0
  387. data/platform/win32/RhoSimulator/imageformats/qsvg4.dll +0 -0
  388. data/platform/win32/RhoSimulator/imageformats/qtiff4.dll +0 -0
  389. data/platform/win32/RhoSimulator/libeay32.dll +0 -0
  390. data/platform/win32/RhoSimulator/msvcm90.dll +0 -0
  391. data/platform/win32/RhoSimulator/msvcp90.dll +0 -0
  392. data/platform/win32/RhoSimulator/msvcr90.dll +0 -0
  393. data/platform/win32/RhoSimulator/phonon4.dll +0 -0
  394. data/platform/win32/RhoSimulator/ssleay32.dll +0 -0
  395. data/platform/win32/RhoSimulator/vcomp90.dll +0 -0
  396. data/platform/win32/target/replaceicon/replaceicon.exe +0 -0
  397. data/platform/win32/target/updateresstring/updateresstring.exe +0 -0
  398. data/platform/wm/RhoLib/RhoLib.vcproj +394 -69
  399. data/platform/wm/build/build_inf.js +83 -23
  400. data/platform/wm/build/wm.rake +127 -81
  401. data/platform/wm/rhodes.sln +6 -6
  402. data/platform/wm/rhodes/DateTimePicker.h +2 -2
  403. data/platform/wm/rhodes/IBrowserEngine.h +3 -0
  404. data/platform/wm/rhodes/IEBrowserEngine.cpp +34 -2
  405. data/platform/wm/rhodes/IEBrowserEngine.h +4 -1
  406. data/platform/wm/rhodes/LicenseStub.cpp +73 -0
  407. data/platform/{android/Rhodes/src/com/rhomobile/rhodes/webview/ChromeClientNew.java → wm/rhodes/LogMemory.cpp} +32 -20
  408. data/platform/{android/Rhodes/src/com/rhomobile/rhodes/webview/RhoWebSettings.java → wm/rhodes/LogMemory.h} +11 -8
  409. data/platform/wm/rhodes/LogOptionsDlg.h +1 -1
  410. data/platform/wm/rhodes/LogView.cpp +10 -10
  411. data/platform/wm/rhodes/LogView.h +10 -10
  412. data/platform/wm/rhodes/MainWindow.cpp +431 -173
  413. data/platform/wm/rhodes/MainWindow.h +37 -19
  414. data/platform/wm/rhodes/MapView/MapViewManager.h +1 -1
  415. data/platform/wm/rhodes/OkCancelModalDialog.h +1 -1
  416. data/platform/wm/rhodes/Rhodes.cpp +210 -47
  417. data/platform/wm/rhodes/Rhodes.rc +38 -0
  418. data/platform/wm/rhodes/bluetooth/Bluetooth.cpp +2 -2
  419. data/platform/wm/rhodes/bluetooth/Bluetooth.h +3 -3
  420. data/platform/wm/rhodes/camera/Camera.cpp +2 -1
  421. data/platform/wm/rhodes/camera/Camera.h +1 -1
  422. data/platform/wm/rhodes/resource.h +1 -1
  423. data/platform/wm/rhodes/rho/common/ExtManager.cpp +93 -5
  424. data/platform/wm/rhodes/rho/net/NetRequestImpl.cpp +2 -2
  425. data/platform/wm/rhodes/rho/rubyext/NativeToolbar.cpp +2 -2
  426. data/platform/wm/rhodes/rho/rubyext/SystemImpl.cpp +13 -7
  427. data/platform/wm/rhodes/rhodes.vcproj +1409 -1008
  428. data/platform/wm/rhodes/simulator/MainWindowQt.h +1 -1
  429. data/platform/wm/rhodes/stdafx.h +2 -2
  430. data/platform/wm/rhoelements.sln +7 -9
  431. data/platform/wm/rubylib/rubylib.vcproj +62 -1
  432. data/platform/wm/sqlite3/sqlite3.vcproj +62 -1
  433. data/platform/wm/syncengine/syncengine.vcproj +62 -1
  434. data/platform/wm/tcmalloc/tcmalloc.vcproj +72 -53
  435. data/platform/wm/tools/detool/detool.cpp +1435 -1357
  436. data/platform/wp7/RhoRubyExtGen/GenerateInitializers.cmd +0 -0
  437. data/platform/wp7/RhoRubyLib/common/RhoLicense.cs +105 -0
  438. data/platform/wp7/RhoRubyLib/common/RhodesApp.cs +23 -5
  439. data/platform/wp7/RhoRubyLib/sync/SyncNotify.cs +5 -0
  440. data/platform/wp7/RhoRubyLib/views/RhoView.xaml.cs +22 -3
  441. data/platform/wp7/build/wp.rake +1 -0
  442. data/platform/wp7/rhodes/MainPage.xaml.cs +11 -0
  443. data/rakefile.rb +225 -59
  444. data/res/build-tools/7za.exe +0 -0
  445. data/res/build-tools/RhoAppRunner.exe +0 -0
  446. data/res/build-tools/RhoLogServer.exe +0 -0
  447. data/res/build-tools/RhoRuby.exe +0 -0
  448. data/res/build-tools/RubyMac +0 -0
  449. data/res/build-tools/detool.exe +0 -0
  450. data/res/build-tools/iphonesim/Source/iPhoneSimulator.m +1 -1
  451. data/res/build-tools/iphonesim/build/Release/iphonesim +0 -0
  452. data/res/build-tools/iphonesim/build/Release/iphonesim_43 +0 -0
  453. data/res/build-tools/license_rc.dll +0 -0
  454. data/res/build-tools/make.exe +0 -0
  455. data/res/build-tools/rubylinux +0 -0
  456. data/res/build-tools/swig_patch/Lib/typemaps/fragments.swg +235 -0
  457. data/res/build-tools/wmdc_connect.exe +0 -0
  458. data/res/build-tools/wp7explorer.exe +0 -0
  459. data/res/generators/rhogen.rb +2 -2
  460. data/res/generators/templates/application/app/Settings/controller.rb +1 -1
  461. data/res/generators/templates/application/app/layout.erb +1 -1
  462. data/res/generators/templates/application/app/loading.png +0 -0
  463. data/res/generators/templates/application/public/css/re_webkit.css +736 -0
  464. data/res/generators/templates/application/public/css/windows_mobile.css +0 -0
  465. data/res/generators/templates/application/public/images/listArrow.png +0 -0
  466. data/res/generators/templates/application/public/jqmobile/images/ajax-loader.png +0 -0
  467. data/res/generators/templates/application/public/jqmobile/images/icons-18-black.png +0 -0
  468. data/res/generators/templates/application/public/jqmobile/images/icons-18-white.png +0 -0
  469. data/res/generators/templates/application/public/jqmobile/images/icons-36-black.png +0 -0
  470. data/res/generators/templates/application/public/jqmobile/images/icons-36-white.png +0 -0
  471. data/res/generators/templates/application/public/js/syncengine.js +409 -52
  472. data/res/generators/templates/extension/extensions/montana/ext/build +0 -0
  473. data/res/generators/templates/extension/extensions/montana/ext/build.bat +0 -0
  474. data/res/generators/templates/extension/extensions/montana/ext/montana/platform/android/Rakefile +10 -10
  475. data/res/generators/templates/spec/app/SpecRunner/controller.rb +2 -0
  476. data/res/libs/motorolalicence/android/MotorolaLicence.h +13 -0
  477. data/res/libs/motorolalicence/android/libMotorolaLicence.a +0 -0
  478. data/res/libs/motorolalicence/iphone/MotorolaLicence.h +13 -0
  479. data/res/libs/motorolalicence/iphone/libMotorolaLicence.a +0 -0
  480. data/rhodes.gemspec +1 -1
  481. data/spec/framework_spec/app/SpecRunner/controller.rb +2 -0
  482. data/spec/phone_spec/app/SpecRunner/controller.rb +2 -0
  483. data/version +1 -1
  484. metadata +487 -412
  485. data/Manifest.txt +0 -7960
  486. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivityStartupListeners.java +0 -12
  487. data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoWebSettingsNew.java +0 -52
  488. data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoWebSettingsOld.java +0 -62
  489. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Frameworks/phonon.framework/Versions/4/phonon +0 -0
  490. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/phonon_backend/libphonon_qt7.dylib +0 -0
  491. data/platform/win32/RhoSimulator/Microsoft.VC80.CRT.manifest +0 -8
  492. data/platform/win32/RhoSimulator/Microsoft.VC80.OpenMP.manifest +0 -7
  493. data/platform/win32/RhoSimulator/msvcm80.dll +0 -0
  494. data/platform/win32/RhoSimulator/msvcp80.dll +0 -0
  495. data/platform/win32/RhoSimulator/msvcr80.dll +0 -0
  496. data/platform/win32/RhoSimulator/vcomp.dll +0 -0
  497. data/rhomobile-debug-1.0.6.gem +0 -0
@@ -0,0 +1,13 @@
1
+ #--
2
+ # PDF::Writer for Ruby.
3
+ # http://rubyforge.org/projects/ruby-pdf/
4
+ # Copyright 2003 - 2005 Austin Ziegler.
5
+ #
6
+ # Licensed under a MIT-style licence. See LICENCE in the main distribution
7
+ # for full licensing information.
8
+ #
9
+ # $Id: charts.rb 50 2005-05-16 03:59:21Z austin $
10
+ #++
11
+ # A namespace for charts that can be drawn on PDF::Writer canvases.
12
+ module PDF::Charts
13
+ end
@@ -0,0 +1,430 @@
1
+ #--
2
+ # PDF::Writer for Ruby.
3
+ # http://rubyforge.org/projects/ruby-pdf/
4
+ # Copyright 2003 - 2005 Austin Ziegler.
5
+ #
6
+ # Licensed under a MIT-style licence. See LICENCE in the main distribution
7
+ # for full licensing information.
8
+ #
9
+ # $Id: stddev.rb 186 2007-12-10 22:58:48Z sandal $
10
+ #++
11
+ require 'pdf/writer'
12
+ require 'pdf/charts'
13
+ require 'ostruct'
14
+
15
+ # Creates a standard deviation chart. This is a type of chart that is
16
+ # effective for the display of survey results or other data that can
17
+ # easily be measured in terms of the average and the standard deviation
18
+ # from that average.
19
+ #
20
+ # The scale of responses is the vertical scale; the average data points
21
+ # and standard deviation values are the horizontal scale.
22
+ class PDF::Charts::StdDev
23
+
24
+ # A data element.
25
+ DataPoint = Struct.new(:label, :average, :stddev)
26
+
27
+ # A label for displaying the scale (vertical) of data in the dataset or
28
+ # the data set identifiers.
29
+ class Label
30
+ def initialize
31
+ yield self if block_given?
32
+ end
33
+
34
+ # The height of the label, in PDF user units. Ignored for scale
35
+ # labels.
36
+ attr_accessor :height
37
+ # The background color of the label. Ignored for scale labels.
38
+ attr_accessor :background_color
39
+ # The text color of the label.
40
+ attr_accessor :text_color
41
+ # The text size, in points, of the label.
42
+ attr_accessor :text_size
43
+ # The padding of the label. Only used for scale labels.
44
+ attr_accessor :pad
45
+ # The decimal precision of the label. Only used for scale labels.
46
+ attr_accessor :decimal_precision
47
+ end
48
+
49
+ # The scale of the dataset.
50
+ class Scale
51
+ def initialize(args = { })
52
+ @range = args[:range]
53
+ @step = args[:step]
54
+ @style = args[:style]
55
+ @show_labels = false
56
+
57
+ yield self if block_given?
58
+
59
+ raise TypeError, PDF::Lange[:charts_stddev_scale_norange] if @range.nil?
60
+ raise TypeError, PDF::Lange[:charts_stddev_scale_nostep] if @step.nil?
61
+ end
62
+
63
+ # Range of the scale. This should be a Range object.
64
+ attr_accessor :range
65
+ # The lower end of the range of the scale. The scale range may be
66
+ # modified by changing this value.
67
+ attr_accessor :first
68
+ def first #:nodoc:
69
+ @range.first
70
+ end
71
+ def first=(ff) #:nodoc:
72
+ @range = (ff..@range.last)
73
+ end
74
+ # The upper end of the range of the scale. The scale range may be
75
+ # modified by changing this value.
76
+ attr_accessor :last
77
+ def last #:nodoc:
78
+ @range.last
79
+ end
80
+ def last=(ll) #:nodoc:
81
+ @range = (@range.first..ll)
82
+ end
83
+ # Defines the step of the scale. Each step represents a vertical
84
+ # position on the chart.
85
+ attr_accessor :step
86
+ # Defines the line style for the scale on the chart. If this is unset
87
+ # (+nil+), there will be no horizontal marks across the chart for the
88
+ # steps of the scale.
89
+ attr_accessor :style
90
+ # Shows the scale labels if +true+.
91
+ attr_accessor :show_labels
92
+ # Defines the label options.
93
+ attr_accessor :label
94
+ end
95
+
96
+ # This is any line that will be drawn; this is a combination of the line
97
+ # style (which must be a PDF::Writer::StrokeStyle object) and a color.
98
+ class Marker
99
+ def initialize
100
+ yield self if block_given?
101
+ end
102
+
103
+ # The stroke style of the marker.
104
+ attr_accessor :style
105
+ # The stroke color of the marker.
106
+ attr_accessor :color
107
+ end
108
+
109
+ def initialize
110
+ @data = []
111
+
112
+ @scale = Scale.new do |scale|
113
+ scale.range = 0..6
114
+ scale.step = 1
115
+ scale.style = PDF::Writer::StrokeStyle.new(0.25)
116
+ scale.show_labels = false
117
+ scale.label = Label.new do |label|
118
+ label.text_size = 8
119
+ label.text_color = Color::RGB::Black
120
+ label.pad = 2
121
+ label.decimal_precision = 1
122
+ end
123
+ end
124
+ @leading_gap = 10
125
+ @show_labels = true
126
+ @label = Label.new do |label|
127
+ label.height = 25
128
+ label.background_color = Color::RGB::Black
129
+ label.text_color = Color::RGB::White
130
+ label.text_size = 12
131
+ end
132
+
133
+ @outer_borders = Marker.new do |marker|
134
+ marker.style = PDF::Writer::StrokeStyle.new(1.5)
135
+ marker.color = Color::RGB::Black
136
+ end
137
+ @inner_borders = nil
138
+
139
+ @dot = Marker.new do |marker|
140
+ marker.style = PDF::Writer::StrokeStyle.new(5)
141
+ marker.color = Color::RGB::Black
142
+ end
143
+ @bar = Marker.new do |marker|
144
+ marker.style = PDF::Writer::StrokeStyle.new(0.5)
145
+ marker.color = Color::RGB::Black
146
+ end
147
+ @upper_crossbar = Marker.new do |marker|
148
+ marker.style = PDF::Writer::StrokeStyle.new(1)
149
+ marker.color = Color::RGB::Black
150
+ end
151
+ @lower_crossbar = Marker.new do |marker|
152
+ marker.style = PDF::Writer::StrokeStyle.new(1)
153
+ marker.color = Color::RGB::Black
154
+ end
155
+
156
+ @height = 200
157
+ @maximum_width = 500
158
+ @datapoint_width = 35
159
+
160
+ yield self if block_given?
161
+ end
162
+
163
+ # The data used to generate the standard deviation chart. This is an
164
+ # array of DataPoint objects, each containing a +label+, an +average+,
165
+ # and the +stddev+ (standard deviation) from that average.
166
+ attr_reader :data
167
+ # The scale of the chart. All values must be within this range. This
168
+ # will be a Scale object. It defaults to a scale of 0..6 with a step of
169
+ # 1.
170
+ attr_accessor :scale
171
+
172
+ # The minimum gap between the chart and the bottom of the page, in
173
+ # PDF user units.
174
+ attr_accessor :leading_gap
175
+
176
+ # This will be +true+ if labels are to be displayed.
177
+ attr_accessor :show_labels
178
+ # The label style of the labels if they are displayed. This must be a
179
+ # PDF::Charts::StdDev::Label object.
180
+ attr_accessor :label
181
+
182
+ # The inner border style. If +nil+, no inner borders are drawn. This is
183
+ # a PDF::Charts::StdDev::Marker object.
184
+ attr_accessor :inner_borders
185
+ # The outer border style. If +nil+, no inner borders are drawn. This is
186
+ # a PDF::Charts::StdDev::Marker object.
187
+ attr_accessor :outer_borders
188
+
189
+ # The dot marker. A filled circle will be drawn with this information.
190
+ # If +nil+, the dot will not be drawn. This is a
191
+ # PDF::Charts::StdDev::Marker object.
192
+ attr_accessor :dot
193
+ # The standard deviation bar. A line will be drawn through the dot
194
+ # marker (if drawn) from the upper to lower standard deviation.
195
+ # If +nil+, the line will not be drawn. This is a
196
+ # PDF::Charts::StdDev::Marker object.
197
+ attr_accessor :bar
198
+ # The upper crossbar. A line will be drawn across the top of the
199
+ # standard deviation bar to the width of the dot marker. If #dot is
200
+ # +nil+, then the line will be twice as wide as it is thick. If +nil+,
201
+ # the upper crossbar will not be drawn. This is a
202
+ # PDF::Charts::StdDev::Marker object.
203
+ attr_accessor :upper_crossbar
204
+ # The lower crossbar. A line will be drawn across the bottom of the
205
+ # standard deviation bar to the width of the dot marker. If #dot is
206
+ # +nil+, then the line will be twice as wide as it is thick. If +nil+,
207
+ # the lower crossbar will not be drawn. This is a
208
+ # PDF::Charts::StdDev::Marker object.
209
+ attr_accessor :lower_crossbar
210
+
211
+ # The height of the chart in PDF user units. Default 200 units.
212
+ attr_accessor :height
213
+ # The maximum width of the chart in PDF user units. Default 500 units.
214
+ attr_accessor :maximum_width
215
+ # The width of a single datapoint.
216
+ attr_accessor :datapoint_width
217
+
218
+ # Draw the standard deviation chart on the supplied PDF document.
219
+ def render_on(pdf)
220
+ raise TypeError, PDF::Writer::Lang[:charts_stddev_data_empty] if @data.empty?
221
+ data = @data.dup
222
+ leftover_data = nil
223
+
224
+ loop do
225
+ # Set up the scale information.
226
+ scale = []
227
+
228
+ (@scale.first + @scale.step).step(@scale.last, @scale.step) do |ii|
229
+ scale << "%01.#{@scale.label.decimal_precision}f" % ii
230
+ end
231
+
232
+ scales = PDF::Writer::OHash.new
233
+ scale.each_with_index do |gg, ii|
234
+ scales[ii] = OpenStruct.new
235
+ scales[ii].value = gg
236
+ end
237
+
238
+ # Add information about the scales' locations to the scales
239
+ # hash. Note that the count is one smaller than it should be, so we're
240
+ # increasing it. The first scale is the bottom of the chart.
241
+ scale_count = scale.size + 1
242
+
243
+ label_height_adjuster = 0
244
+ label_height_adjuster = @label.height if @show_labels
245
+
246
+ chart_area_height = @height - label_height_adjuster
247
+ scale_height = chart_area_height / scale_count.to_f
248
+
249
+ scales.each_key do |index|
250
+ this_height = scale_height * (index + 1) + @label.height
251
+ scales[index].line_height = this_height
252
+ if @scale.show_labels
253
+ scales[index].label_height = this_height -
254
+ (@scale.label.text_size / 3.0)
255
+ end
256
+ end
257
+
258
+ # How many sections do we need in this chart, and how wide will it
259
+ # need to be?
260
+ chunk_width = @datapoint_width
261
+ num_chunks = data.size
262
+ widest_scale_label = 0
263
+
264
+ if @scale.show_labels
265
+ scales.each_value do |scale|
266
+ this_width = pdf.text_width(scale.value, @scale.label.text_size)
267
+ widest_scale_label = this_width if this_width > widest_scale_label
268
+ end
269
+ end
270
+
271
+ chart_width = chunk_width * num_chunks
272
+ total_width = chart_width + widest_scale_label + @scale.label.pad
273
+
274
+ # What happens if the projected width of the chart is too big?
275
+ # Figure out how to break the chart in pieces.
276
+ if total_width > @maximum_width
277
+ max_column_count = 0
278
+ base_width = widest_scale_label + @scale.label.pad
279
+ (1..(num_chunks + 1)).each do |ii|
280
+ if (base_width + (ii * chunk_width)) > @maximum_width
281
+ break
282
+ else
283
+ max_column_count += 1
284
+ end
285
+ end
286
+
287
+ leftover_data = data.slice!(max_column_count, -1)
288
+
289
+ num_chunks = data.size
290
+ chart_width = chunk_width * num_chunks
291
+ total_width = chart_width + widest_scale_label + @scale.label.pad
292
+ end
293
+
294
+ chart_y = pdf.y - @height + @leading_gap
295
+ chart_y += (@outer_borders.style.width * 2.0) if @outer_borders
296
+
297
+ if chart_y < pdf.bottom_margin
298
+ pdf.start_new_page
299
+ chart_y = pdf.y - @height
300
+ chart_y += (@outer_borders.style.width * 2.0) if @outer_borders
301
+ end
302
+
303
+ chart_x = pdf.absolute_x_middle - (total_width / 2.0) + widest_scale_label
304
+
305
+ # Add labels, if needed.
306
+ if @show_labels
307
+ pdf.save_state
308
+ pdf.fill_color! @label.background_color
309
+ # Draw a rectangle for each label
310
+ num_chunks.times do |ii|
311
+ this_x = chart_x + ii * chunk_width
312
+ pdf.rectangle(this_x, chart_y, chunk_width, @label.height).fill
313
+ end
314
+
315
+ # Add a border above the label rectangle.
316
+ if @outer_borders
317
+ pdf.stroke_style! @outer_borders.style
318
+ pdf.line(chart_x, chart_y + @label.height, chart_x + chart_width, chart_y + @label.height).stroke
319
+ end
320
+ pdf.fill_color! @label.text_color
321
+
322
+ data.each_with_index do |datum, ii|
323
+ label = datum.label.to_s
324
+ label_width = pdf.text_width(label, @label.text_size)
325
+ this_x = chart_x + (ii * chunk_width) + (chunk_width / 2.0) - (label_width / 2.0)
326
+ this_y = chart_y + (@label.height / 2.0) - (@label.text_size / 3.0)
327
+ pdf.add_text(this_x, this_y, label, @label.text_size)
328
+ end
329
+ pdf.restore_state
330
+ end
331
+
332
+ if @inner_borders
333
+ pdf.save_state
334
+ pdf.stroke_color! @inner_borders.color
335
+ pdf.stroke_style! @inner_borders.style
336
+ (num_chunks - 1).times do |ii|
337
+ this_x = chart_x + (ii * chunk_width) + chunk_width
338
+ pdf.line(this_x, chart_y, this_x, chart_y + @height).stroke
339
+ end
340
+ pdf.restore_state
341
+ end
342
+
343
+ pdf.save_state
344
+ if @outer_borders
345
+ pdf.stroke_color! @outer_borders.color
346
+ pdf.stroke_style! @outer_borders.style
347
+ pdf.rectangle(chart_x, chart_y, chart_width, @height).stroke
348
+ end
349
+
350
+ if @scale.style
351
+ pdf.save_state
352
+ pdf.stroke_style! @scale.style
353
+ scales.each_value do |scale|
354
+ this_y = chart_y + scale.line_height
355
+ pdf.line(chart_x, this_y, chart_x + chart_width, this_y).stroke
356
+ end
357
+ pdf.restore_state
358
+ end
359
+
360
+ if @scale.show_labels
361
+ pdf.save_state
362
+ scales.each_value do |scale|
363
+ this_y = chart_y + scale.label_height
364
+ label_width = pdf.text_width(scale.value, @scale.label.text_size)
365
+ this_x = chart_x - label_width - @scale.label.pad
366
+ pdf.fill_color! @scale.label.text_color
367
+ pdf.add_text(this_x, this_y, scale.value, @scale.label.text_size)
368
+ end
369
+ pdf.restore_state
370
+ end
371
+
372
+ data.each_with_index do |datum, ii|
373
+ avg_height = datum.average * scale_height
374
+ stddev_height = datum.stddev * scale_height
375
+ this_y = chart_y + label_height_adjuster + avg_height
376
+ this_x = chart_x + (ii * chunk_width) + (chunk_width / 2.0)
377
+ line_top_y = this_y + (stddev_height / 2.0)
378
+ line_bot_y = this_y - (stddev_height / 2.0)
379
+
380
+ # Plot the dot
381
+ if @dot
382
+ pdf.stroke_color! @dot.color
383
+ pdf.stroke_style! @dot.style
384
+ pdf.circle_at(this_x, this_y, (@dot.style.width / 2.0)).fill
385
+ end
386
+
387
+ # Plot the bar
388
+ if @bar
389
+ pdf.stroke_color! @bar.color
390
+ pdf.stroke_style! @bar.style
391
+ pdf.line(this_x, line_top_y, this_x, line_bot_y).stroke
392
+ end
393
+
394
+ # Plot the crossbars
395
+ if @upper_crossbar
396
+ if @dot
397
+ cb_width = @dot.style.width
398
+ else
399
+ cb_width = @upper_crossbar.style.width
400
+ end
401
+ pdf.stroke_color! @upper_crossbar.color
402
+ pdf.stroke_style! @upper_crossbar.style
403
+ pdf.line(this_x - cb_width, line_top_y, this_x + cb_width, line_top_y).stroke
404
+ end
405
+ if @lower_crossbar
406
+ if @dot
407
+ cb_width = @dot.style.width
408
+ else
409
+ cb_width = @lower_crossbar.style.width
410
+ end
411
+ pdf.stroke_color! @lower_crossbar.color
412
+ pdf.stroke_style! @lower_crossbar.style
413
+
414
+ pdf.line(this_x - cb_width, line_bot_y, this_x + cb_width, line_bot_y).stroke
415
+ end
416
+ end
417
+
418
+ pdf.restore_state
419
+
420
+ pdf.y = chart_y
421
+
422
+ break if leftover_data.nil?
423
+
424
+ data = leftover_data
425
+ leftover_data = nil
426
+ end
427
+
428
+ pdf.y
429
+ end
430
+ end
@@ -0,0 +1,108 @@
1
+ #--
2
+ # PDF::Writer for Ruby.
3
+ # http://rubyforge.org/projects/ruby-pdf/
4
+ # Copyright 2003 - 2005 Austin Ziegler.
5
+ #
6
+ # Licensed under a MIT-style licence. See LICENCE in the main distribution
7
+ # for full licensing information.
8
+ #
9
+ # $Id: math.rb 52 2005-05-16 20:44:34Z austin $
10
+ #++
11
+ # Encapsulate some of the mathematical calculations that need to be
12
+ # performed when working with PDF documents. All angles in PDF::Writer are
13
+ # measured in degrees, but all angles in PDF documents are in radians. The
14
+ # standard conversions between radians, degrees, and gradians are
15
+ # provided.
16
+ #
17
+ # As with the Perl implementations of these conversions, they will be
18
+ # wrapped in the range of the target measurement (0..PI2 for radians,
19
+ # 0..360 for degrees, and 0..400 for gradians). To prevent this wrapping,
20
+ # provide a false value for the +wrap+ parameter.
21
+ #
22
+ # To wrap these values manually, use #rad2rad, #deg2deg, or #grad2grad.
23
+ module PDF::Math
24
+ class << self
25
+ PI2 = ::Math::PI * 2.0
26
+
27
+ # One degree of arc measured in terms of radians.
28
+ DR = PI2 / 360.0
29
+ # One radian of arc, measured in terms of degrees.
30
+ RD = 360 / PI2
31
+ # One degree of arc, measured in terms of gradians.
32
+ DG = 400 / 360.0
33
+ # One gradian of arc, measured in terms of degrees.
34
+ GD = 360 / 400.0
35
+ # One radian of arc, measured in terms of gradians.
36
+ RG = 400 / PI2
37
+ # One gradian of arc, measured in terms of radians.
38
+ GR = PI2 / 400.0
39
+
40
+ # Truncate the remainder.
41
+ def remt(num, den)
42
+ num - den * (num / den.to_f).to_i
43
+ end
44
+
45
+ # Wrap radian values within the range of radians (0..PI2).
46
+ def rad2rad(rad)
47
+ remt(rad, PI2)
48
+ end
49
+
50
+ # Wrap degree values within the range of degrees (0..360).
51
+ def deg2deg(deg)
52
+ remt(deg, 360)
53
+ end
54
+
55
+ # Wrap gradian values within the range of gradians (0..400).
56
+ def grad2grad(grad)
57
+ remt(grad, 400)
58
+ end
59
+
60
+ # Convert degrees to radians. The value will be constrained to the
61
+ # range of radians (0..PI2) unless +wrap+ is false.
62
+ def deg2rad(deg, wrap = true)
63
+ rad = DR * deg
64
+ rad = rad2rad(rad) if wrap
65
+ rad
66
+ end
67
+
68
+ # Convert degrees to gradians. The value will be constrained to the
69
+ # range of gradians (0..400) unless +wrap+ is false.
70
+ def deg2grad(deg, wrap = true)
71
+ grad = DG * deg
72
+ grad = grad2grad(grad) if wrap
73
+ grad
74
+ end
75
+
76
+ # Convert radians to degrees. The value will be constrained to the
77
+ # range of degrees (0..360) unless +wrap+ is false.
78
+ def rad2deg(rad, wrap = true)
79
+ deg = RD * rad
80
+ deg = deg2deg(deg) if wrap
81
+ deg
82
+ end
83
+
84
+ # Convert radians to gradians. The value will be constrained to the
85
+ # range of gradians (0..400) unless +wrap+ is false.
86
+ def rad2grad(rad, wrap = true)
87
+ grad = RG * rad
88
+ grad = grad2grad(grad) if wrap
89
+ grad
90
+ end
91
+
92
+ # Convert gradians to degrees. The value will be constrained to the
93
+ # range of degrees (0..360) unless +wrap+ is false.
94
+ def grad2deg(grad, wrap = true)
95
+ deg = GD * grad
96
+ deg = deg2deg(deg) if wrap
97
+ deg
98
+ end
99
+
100
+ # Convert gradians to radians. The value will be constrained to the
101
+ # range of radians (0..PI2) unless +wrap+ is false.
102
+ def grad2rad(grad, wrap = true)
103
+ rad = GR * grad
104
+ rad = rad2rad(rad) if wrap
105
+ rad
106
+ end
107
+ end
108
+ end