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,225 @@
1
+ StartFontMetrics 4.1
2
+ Comment Copyright (c) 1985, 1987, 1988, 1989, 1997 Adobe Systems Incorporated. All Rights Reserved.
3
+ Comment Creation Date: Thu May 1 15:14:13 1997
4
+ Comment UniqueID 43082
5
+ Comment VMusage 45775 55535
6
+ FontName ZapfDingbats
7
+ FullName ITC Zapf Dingbats
8
+ FamilyName ZapfDingbats
9
+ Weight Medium
10
+ ItalicAngle 0
11
+ IsFixedPitch false
12
+ CharacterSet Special
13
+ FontBBox -1 -143 981 820
14
+ UnderlinePosition -100
15
+ UnderlineThickness 50
16
+ Version 002.000
17
+ Notice Copyright (c) 1985, 1987, 1988, 1989, 1997 Adobe Systems Incorporated. All Rights Reserved.ITC Zapf Dingbats is a registered trademark of International Typeface Corporation.
18
+ EncodingScheme FontSpecific
19
+ StdHW 28
20
+ StdVW 90
21
+ StartCharMetrics 202
22
+ C 32 ; WX 278 ; N space ; B 0 0 0 0 ;
23
+ C 33 ; WX 974 ; N a1 ; B 35 72 939 621 ;
24
+ C 34 ; WX 961 ; N a2 ; B 35 81 927 611 ;
25
+ C 35 ; WX 974 ; N a202 ; B 35 72 939 621 ;
26
+ C 36 ; WX 980 ; N a3 ; B 35 0 945 692 ;
27
+ C 37 ; WX 719 ; N a4 ; B 34 139 685 566 ;
28
+ C 38 ; WX 789 ; N a5 ; B 35 -14 755 705 ;
29
+ C 39 ; WX 790 ; N a119 ; B 35 -14 755 705 ;
30
+ C 40 ; WX 791 ; N a118 ; B 35 -13 761 705 ;
31
+ C 41 ; WX 690 ; N a117 ; B 34 138 655 553 ;
32
+ C 42 ; WX 960 ; N a11 ; B 35 123 925 568 ;
33
+ C 43 ; WX 939 ; N a12 ; B 35 134 904 559 ;
34
+ C 44 ; WX 549 ; N a13 ; B 29 -11 516 705 ;
35
+ C 45 ; WX 855 ; N a14 ; B 34 59 820 632 ;
36
+ C 46 ; WX 911 ; N a15 ; B 35 50 876 642 ;
37
+ C 47 ; WX 933 ; N a16 ; B 35 139 899 550 ;
38
+ C 48 ; WX 911 ; N a105 ; B 35 50 876 642 ;
39
+ C 49 ; WX 945 ; N a17 ; B 35 139 909 553 ;
40
+ C 50 ; WX 974 ; N a18 ; B 35 104 938 587 ;
41
+ C 51 ; WX 755 ; N a19 ; B 34 -13 721 705 ;
42
+ C 52 ; WX 846 ; N a20 ; B 36 -14 811 705 ;
43
+ C 53 ; WX 762 ; N a21 ; B 35 0 727 692 ;
44
+ C 54 ; WX 761 ; N a22 ; B 35 0 727 692 ;
45
+ C 55 ; WX 571 ; N a23 ; B -1 -68 571 661 ;
46
+ C 56 ; WX 677 ; N a24 ; B 36 -13 642 705 ;
47
+ C 57 ; WX 763 ; N a25 ; B 35 0 728 692 ;
48
+ C 58 ; WX 760 ; N a26 ; B 35 0 726 692 ;
49
+ C 59 ; WX 759 ; N a27 ; B 35 0 725 692 ;
50
+ C 60 ; WX 754 ; N a28 ; B 35 0 720 692 ;
51
+ C 61 ; WX 494 ; N a6 ; B 35 0 460 692 ;
52
+ C 62 ; WX 552 ; N a7 ; B 35 0 517 692 ;
53
+ C 63 ; WX 537 ; N a8 ; B 35 0 503 692 ;
54
+ C 64 ; WX 577 ; N a9 ; B 35 96 542 596 ;
55
+ C 65 ; WX 692 ; N a10 ; B 35 -14 657 705 ;
56
+ C 66 ; WX 786 ; N a29 ; B 35 -14 751 705 ;
57
+ C 67 ; WX 788 ; N a30 ; B 35 -14 752 705 ;
58
+ C 68 ; WX 788 ; N a31 ; B 35 -14 753 705 ;
59
+ C 69 ; WX 790 ; N a32 ; B 35 -14 756 705 ;
60
+ C 70 ; WX 793 ; N a33 ; B 35 -13 759 705 ;
61
+ C 71 ; WX 794 ; N a34 ; B 35 -13 759 705 ;
62
+ C 72 ; WX 816 ; N a35 ; B 35 -14 782 705 ;
63
+ C 73 ; WX 823 ; N a36 ; B 35 -14 787 705 ;
64
+ C 74 ; WX 789 ; N a37 ; B 35 -14 754 705 ;
65
+ C 75 ; WX 841 ; N a38 ; B 35 -14 807 705 ;
66
+ C 76 ; WX 823 ; N a39 ; B 35 -14 789 705 ;
67
+ C 77 ; WX 833 ; N a40 ; B 35 -14 798 705 ;
68
+ C 78 ; WX 816 ; N a41 ; B 35 -13 782 705 ;
69
+ C 79 ; WX 831 ; N a42 ; B 35 -14 796 705 ;
70
+ C 80 ; WX 923 ; N a43 ; B 35 -14 888 705 ;
71
+ C 81 ; WX 744 ; N a44 ; B 35 0 710 692 ;
72
+ C 82 ; WX 723 ; N a45 ; B 35 0 688 692 ;
73
+ C 83 ; WX 749 ; N a46 ; B 35 0 714 692 ;
74
+ C 84 ; WX 790 ; N a47 ; B 34 -14 756 705 ;
75
+ C 85 ; WX 792 ; N a48 ; B 35 -14 758 705 ;
76
+ C 86 ; WX 695 ; N a49 ; B 35 -14 661 706 ;
77
+ C 87 ; WX 776 ; N a50 ; B 35 -6 741 699 ;
78
+ C 88 ; WX 768 ; N a51 ; B 35 -7 734 699 ;
79
+ C 89 ; WX 792 ; N a52 ; B 35 -14 757 705 ;
80
+ C 90 ; WX 759 ; N a53 ; B 35 0 725 692 ;
81
+ C 91 ; WX 707 ; N a54 ; B 35 -13 672 704 ;
82
+ C 92 ; WX 708 ; N a55 ; B 35 -14 672 705 ;
83
+ C 93 ; WX 682 ; N a56 ; B 35 -14 647 705 ;
84
+ C 94 ; WX 701 ; N a57 ; B 35 -14 666 705 ;
85
+ C 95 ; WX 826 ; N a58 ; B 35 -14 791 705 ;
86
+ C 96 ; WX 815 ; N a59 ; B 35 -14 780 705 ;
87
+ C 97 ; WX 789 ; N a60 ; B 35 -14 754 705 ;
88
+ C 98 ; WX 789 ; N a61 ; B 35 -14 754 705 ;
89
+ C 99 ; WX 707 ; N a62 ; B 34 -14 673 705 ;
90
+ C 100 ; WX 687 ; N a63 ; B 36 0 651 692 ;
91
+ C 101 ; WX 696 ; N a64 ; B 35 0 661 691 ;
92
+ C 102 ; WX 689 ; N a65 ; B 35 0 655 692 ;
93
+ C 103 ; WX 786 ; N a66 ; B 34 -14 751 705 ;
94
+ C 104 ; WX 787 ; N a67 ; B 35 -14 752 705 ;
95
+ C 105 ; WX 713 ; N a68 ; B 35 -14 678 705 ;
96
+ C 106 ; WX 791 ; N a69 ; B 35 -14 756 705 ;
97
+ C 107 ; WX 785 ; N a70 ; B 36 -14 751 705 ;
98
+ C 108 ; WX 791 ; N a71 ; B 35 -14 757 705 ;
99
+ C 109 ; WX 873 ; N a72 ; B 35 -14 838 705 ;
100
+ C 110 ; WX 761 ; N a73 ; B 35 0 726 692 ;
101
+ C 111 ; WX 762 ; N a74 ; B 35 0 727 692 ;
102
+ C 112 ; WX 762 ; N a203 ; B 35 0 727 692 ;
103
+ C 113 ; WX 759 ; N a75 ; B 35 0 725 692 ;
104
+ C 114 ; WX 759 ; N a204 ; B 35 0 725 692 ;
105
+ C 115 ; WX 892 ; N a76 ; B 35 0 858 705 ;
106
+ C 116 ; WX 892 ; N a77 ; B 35 -14 858 692 ;
107
+ C 117 ; WX 788 ; N a78 ; B 35 -14 754 705 ;
108
+ C 118 ; WX 784 ; N a79 ; B 35 -14 749 705 ;
109
+ C 119 ; WX 438 ; N a81 ; B 35 -14 403 705 ;
110
+ C 120 ; WX 138 ; N a82 ; B 35 0 104 692 ;
111
+ C 121 ; WX 277 ; N a83 ; B 35 0 242 692 ;
112
+ C 122 ; WX 415 ; N a84 ; B 35 0 380 692 ;
113
+ C 123 ; WX 392 ; N a97 ; B 35 263 357 705 ;
114
+ C 124 ; WX 392 ; N a98 ; B 34 263 357 705 ;
115
+ C 125 ; WX 668 ; N a99 ; B 35 263 633 705 ;
116
+ C 126 ; WX 668 ; N a100 ; B 36 263 634 705 ;
117
+ C 128 ; WX 390 ; N a89 ; B 35 -14 356 705 ;
118
+ C 129 ; WX 390 ; N a90 ; B 35 -14 355 705 ;
119
+ C 130 ; WX 317 ; N a93 ; B 35 0 283 692 ;
120
+ C 131 ; WX 317 ; N a94 ; B 35 0 283 692 ;
121
+ C 132 ; WX 276 ; N a91 ; B 35 0 242 692 ;
122
+ C 133 ; WX 276 ; N a92 ; B 35 0 242 692 ;
123
+ C 134 ; WX 509 ; N a205 ; B 35 0 475 692 ;
124
+ C 135 ; WX 509 ; N a85 ; B 35 0 475 692 ;
125
+ C 136 ; WX 410 ; N a206 ; B 35 0 375 692 ;
126
+ C 137 ; WX 410 ; N a86 ; B 35 0 375 692 ;
127
+ C 138 ; WX 234 ; N a87 ; B 35 -14 199 705 ;
128
+ C 139 ; WX 234 ; N a88 ; B 35 -14 199 705 ;
129
+ C 140 ; WX 334 ; N a95 ; B 35 0 299 692 ;
130
+ C 141 ; WX 334 ; N a96 ; B 35 0 299 692 ;
131
+ C 161 ; WX 732 ; N a101 ; B 35 -143 697 806 ;
132
+ C 162 ; WX 544 ; N a102 ; B 56 -14 488 706 ;
133
+ C 163 ; WX 544 ; N a103 ; B 34 -14 508 705 ;
134
+ C 164 ; WX 910 ; N a104 ; B 35 40 875 651 ;
135
+ C 165 ; WX 667 ; N a106 ; B 35 -14 633 705 ;
136
+ C 166 ; WX 760 ; N a107 ; B 35 -14 726 705 ;
137
+ C 167 ; WX 760 ; N a108 ; B 0 121 758 569 ;
138
+ C 168 ; WX 776 ; N a112 ; B 35 0 741 705 ;
139
+ C 169 ; WX 595 ; N a111 ; B 34 -14 560 705 ;
140
+ C 170 ; WX 694 ; N a110 ; B 35 -14 659 705 ;
141
+ C 171 ; WX 626 ; N a109 ; B 34 0 591 705 ;
142
+ C 172 ; WX 788 ; N a120 ; B 35 -14 754 705 ;
143
+ C 173 ; WX 788 ; N a121 ; B 35 -14 754 705 ;
144
+ C 174 ; WX 788 ; N a122 ; B 35 -14 754 705 ;
145
+ C 175 ; WX 788 ; N a123 ; B 35 -14 754 705 ;
146
+ C 176 ; WX 788 ; N a124 ; B 35 -14 754 705 ;
147
+ C 177 ; WX 788 ; N a125 ; B 35 -14 754 705 ;
148
+ C 178 ; WX 788 ; N a126 ; B 35 -14 754 705 ;
149
+ C 179 ; WX 788 ; N a127 ; B 35 -14 754 705 ;
150
+ C 180 ; WX 788 ; N a128 ; B 35 -14 754 705 ;
151
+ C 181 ; WX 788 ; N a129 ; B 35 -14 754 705 ;
152
+ C 182 ; WX 788 ; N a130 ; B 35 -14 754 705 ;
153
+ C 183 ; WX 788 ; N a131 ; B 35 -14 754 705 ;
154
+ C 184 ; WX 788 ; N a132 ; B 35 -14 754 705 ;
155
+ C 185 ; WX 788 ; N a133 ; B 35 -14 754 705 ;
156
+ C 186 ; WX 788 ; N a134 ; B 35 -14 754 705 ;
157
+ C 187 ; WX 788 ; N a135 ; B 35 -14 754 705 ;
158
+ C 188 ; WX 788 ; N a136 ; B 35 -14 754 705 ;
159
+ C 189 ; WX 788 ; N a137 ; B 35 -14 754 705 ;
160
+ C 190 ; WX 788 ; N a138 ; B 35 -14 754 705 ;
161
+ C 191 ; WX 788 ; N a139 ; B 35 -14 754 705 ;
162
+ C 192 ; WX 788 ; N a140 ; B 35 -14 754 705 ;
163
+ C 193 ; WX 788 ; N a141 ; B 35 -14 754 705 ;
164
+ C 194 ; WX 788 ; N a142 ; B 35 -14 754 705 ;
165
+ C 195 ; WX 788 ; N a143 ; B 35 -14 754 705 ;
166
+ C 196 ; WX 788 ; N a144 ; B 35 -14 754 705 ;
167
+ C 197 ; WX 788 ; N a145 ; B 35 -14 754 705 ;
168
+ C 198 ; WX 788 ; N a146 ; B 35 -14 754 705 ;
169
+ C 199 ; WX 788 ; N a147 ; B 35 -14 754 705 ;
170
+ C 200 ; WX 788 ; N a148 ; B 35 -14 754 705 ;
171
+ C 201 ; WX 788 ; N a149 ; B 35 -14 754 705 ;
172
+ C 202 ; WX 788 ; N a150 ; B 35 -14 754 705 ;
173
+ C 203 ; WX 788 ; N a151 ; B 35 -14 754 705 ;
174
+ C 204 ; WX 788 ; N a152 ; B 35 -14 754 705 ;
175
+ C 205 ; WX 788 ; N a153 ; B 35 -14 754 705 ;
176
+ C 206 ; WX 788 ; N a154 ; B 35 -14 754 705 ;
177
+ C 207 ; WX 788 ; N a155 ; B 35 -14 754 705 ;
178
+ C 208 ; WX 788 ; N a156 ; B 35 -14 754 705 ;
179
+ C 209 ; WX 788 ; N a157 ; B 35 -14 754 705 ;
180
+ C 210 ; WX 788 ; N a158 ; B 35 -14 754 705 ;
181
+ C 211 ; WX 788 ; N a159 ; B 35 -14 754 705 ;
182
+ C 212 ; WX 894 ; N a160 ; B 35 58 860 634 ;
183
+ C 213 ; WX 838 ; N a161 ; B 35 152 803 540 ;
184
+ C 214 ; WX 1016 ; N a163 ; B 34 152 981 540 ;
185
+ C 215 ; WX 458 ; N a164 ; B 35 -127 422 820 ;
186
+ C 216 ; WX 748 ; N a196 ; B 35 94 698 597 ;
187
+ C 217 ; WX 924 ; N a165 ; B 35 140 890 552 ;
188
+ C 218 ; WX 748 ; N a192 ; B 35 94 698 597 ;
189
+ C 219 ; WX 918 ; N a166 ; B 35 166 884 526 ;
190
+ C 220 ; WX 927 ; N a167 ; B 35 32 892 660 ;
191
+ C 221 ; WX 928 ; N a168 ; B 35 129 891 562 ;
192
+ C 222 ; WX 928 ; N a169 ; B 35 128 893 563 ;
193
+ C 223 ; WX 834 ; N a170 ; B 35 155 799 537 ;
194
+ C 224 ; WX 873 ; N a171 ; B 35 93 838 599 ;
195
+ C 225 ; WX 828 ; N a172 ; B 35 104 791 588 ;
196
+ C 226 ; WX 924 ; N a173 ; B 35 98 889 594 ;
197
+ C 227 ; WX 924 ; N a162 ; B 35 98 889 594 ;
198
+ C 228 ; WX 917 ; N a174 ; B 35 0 882 692 ;
199
+ C 229 ; WX 930 ; N a175 ; B 35 84 896 608 ;
200
+ C 230 ; WX 931 ; N a176 ; B 35 84 896 608 ;
201
+ C 231 ; WX 463 ; N a177 ; B 35 -99 429 791 ;
202
+ C 232 ; WX 883 ; N a178 ; B 35 71 848 623 ;
203
+ C 233 ; WX 836 ; N a179 ; B 35 44 802 648 ;
204
+ C 234 ; WX 836 ; N a193 ; B 35 44 802 648 ;
205
+ C 235 ; WX 867 ; N a180 ; B 35 101 832 591 ;
206
+ C 236 ; WX 867 ; N a199 ; B 35 101 832 591 ;
207
+ C 237 ; WX 696 ; N a181 ; B 35 44 661 648 ;
208
+ C 238 ; WX 696 ; N a200 ; B 35 44 661 648 ;
209
+ C 239 ; WX 874 ; N a182 ; B 35 77 840 619 ;
210
+ C 241 ; WX 874 ; N a201 ; B 35 73 840 615 ;
211
+ C 242 ; WX 760 ; N a183 ; B 35 0 725 692 ;
212
+ C 243 ; WX 946 ; N a184 ; B 35 160 911 533 ;
213
+ C 244 ; WX 771 ; N a197 ; B 34 37 736 655 ;
214
+ C 245 ; WX 865 ; N a185 ; B 35 207 830 481 ;
215
+ C 246 ; WX 771 ; N a194 ; B 34 37 736 655 ;
216
+ C 247 ; WX 888 ; N a198 ; B 34 -19 853 712 ;
217
+ C 248 ; WX 967 ; N a186 ; B 35 124 932 568 ;
218
+ C 249 ; WX 888 ; N a195 ; B 34 -19 853 712 ;
219
+ C 250 ; WX 831 ; N a187 ; B 35 113 796 579 ;
220
+ C 251 ; WX 873 ; N a188 ; B 36 118 838 578 ;
221
+ C 252 ; WX 927 ; N a189 ; B 35 150 891 542 ;
222
+ C 253 ; WX 970 ; N a190 ; B 35 76 931 616 ;
223
+ C 254 ; WX 918 ; N a191 ; B 34 99 884 593 ;
224
+ EndCharMetrics
225
+ EndFontMetrics
@@ -0,0 +1,813 @@
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: graphics.rb 166 2007-11-08 18:22:05Z sandal $
10
+ #++
11
+ # Points for use in the drawing of polygons.
12
+ class PDF::Writer::PolygonPoint
13
+ def initialize(x, y, connector = :line)
14
+ @x, @y, @connector = x, y, connector
15
+ end
16
+
17
+ attr_reader :x, :y, :connector
18
+ end
19
+
20
+ # This module contains graphics primitives. Objects that include this
21
+ # module must respond to #add_content.
22
+ #
23
+ # The PDF::Writer coordinate system is in PDF userspace units. The
24
+ # coordinate system in PDF::Writer is slightly different than might be
25
+ # expected, in that <tt>(0, 0)</tt> is at the lower left-hand corner of
26
+ # the canvas (page), not the normal top left-hand corner of the canvas.
27
+ # (See the diagram below.)
28
+ #
29
+ # Y Y
30
+ # 0+-----+X
31
+ # | |
32
+ # | |
33
+ # | |
34
+ # 0+-----+X
35
+ # 0 0
36
+ #
37
+ # Each primitive provided below indicates the <em>New Point</em>, or the
38
+ # coordinates new drawing point at the completion of the drawing
39
+ # operation. Drawing operations themselves do *not* draw or fill the path.
40
+ # This must be done by one of the stroke or fill operators, #stroke,
41
+ # #close_stroke, #fill, #close_fill, #fill_stroke, or #close_fill_stroke.
42
+ #
43
+ # Drawing operations return +self+ (the canvas) so that operations may be
44
+ # chained.
45
+ module PDF::Writer::Graphics
46
+ # Close the current path by appending a straight line segment from the
47
+ # drawing point to the starting point of the path. If the path is
48
+ # closed, this does nothing. This operator terminates the current
49
+ # subpath.
50
+ def close
51
+ add_content(" h")
52
+ self
53
+ end
54
+
55
+ # Stroke the path. This operation terminates a path object and draws it.
56
+ def stroke
57
+ add_content(" S")
58
+ self
59
+ end
60
+
61
+ # Close the current path by appending a straight line segment from the
62
+ # drawing point to the starting point of the path, and then stroke it.
63
+ # This does the same as #close followed by #stroke.
64
+ def close_stroke
65
+ add_content(" s")
66
+ self
67
+ end
68
+
69
+ # Fills the path. Open subpaths are implicitly closed before being
70
+ # filled. PDF offers two methods for determining the fill region. The
71
+ # first is called the "nonzero winding number" and is the default fill.
72
+ # The second is called "even-odd".
73
+ #
74
+ # Use the even-odd rule (called with <tt>#fill(:even_odd)</tt>) with
75
+ # caution, as this will cause certain portions of the path to be
76
+ # considered outside of the fill region, resulting in interesting cutout
77
+ # patterns.
78
+ def fill(rule = nil)
79
+ if :even_odd == rule
80
+ add_content(" f*")
81
+ else
82
+ add_content(" f")
83
+ end
84
+ self
85
+ end
86
+
87
+ # Close the current path by appending a straight line segment from the
88
+ # drawing point to the starting point of the path, and then fill it.
89
+ # This does the same as #close followed by #fill.
90
+ #
91
+ # See #fill for more information on fill rules.
92
+ def close_fill(rule = nil)
93
+ close
94
+ fill(rule)
95
+ self
96
+ end
97
+
98
+ # Fills and then strokes the path. Open subpaths are implicitly closed
99
+ # before being filled. This is the same as constructing two identical
100
+ # path objects, calling #fill on one and #stroke on the other. Paths
101
+ # filled and stroked in this manner are treated as if they were one
102
+ # object for PDF transparency purposes (the PDF transparency model is
103
+ # not yet supported by PDF::Writer).
104
+ #
105
+ # See #fill for more information on fill rules.
106
+ def fill_stroke(rule = nil)
107
+ if :even_odd == rule
108
+ add_content(" B*")
109
+ else
110
+ add_content(" B")
111
+ end
112
+ self
113
+ end
114
+
115
+ # Closes, fills and then strokes the path. Open subpaths are explicitly
116
+ # closed before being filled (as if #close and then #fill_stroke had
117
+ # been called). This is the same as constructing two identical path
118
+ # objects, calling #fill on one and #stroke on the other. Paths filled
119
+ # and stroked in this manner are treated as if they were one object for
120
+ # PDF transparency purposes (PDF transparency is not yet supported by
121
+ # PDF::Writer).
122
+ #
123
+ # See #fill for more information on fill rules.
124
+ def close_fill_stroke(rule = nil)
125
+ if :even_odd == rule
126
+ add_content(" b*")
127
+ else
128
+ add_content(" b")
129
+ end
130
+ self
131
+ end
132
+
133
+ # Move the drawing point to the specified coordinates <tt>(x, y)</tt>.
134
+ #
135
+ # New Point:: <tt>(x, y)</tt>
136
+ # Subpath:: New
137
+ def move_to(x, y)
138
+ add_content("\n%.3f %.3f m" % [ x, y ])
139
+ self
140
+ end
141
+
142
+ # Draw a straight line from the drawing point to <tt>(x, y)</tt>.
143
+ #
144
+ # New Point:: <tt>(x, y)</tt>
145
+ # Subpath:: Current
146
+ def line_to(x, y)
147
+ add_content("\n%.3f %.3f l" % [ x, y ])
148
+ self
149
+ end
150
+
151
+ # Draws a cubic Bezier curve from the drawing point to <tt>(x2, y2)</tt>
152
+ # using <tt>(x0, y0)</tt> and <tt>(x1, y1)</tt> as the control points
153
+ # for the curve.
154
+ #
155
+ # New Point:: <tt>(x2, y2)</tt>
156
+ # Subpath:: Current
157
+ def curve_to(x0, y0, x1, y1, x2, y2)
158
+ add_content("\n%.3f %.3f %.3f %.3f %.3f %.3f c" % [ x0, y0, x1, y1, x2, y2 ])
159
+ self
160
+ end
161
+
162
+ # Draws a cubic Bezier curve from the drawing point to <tt>(x1, y1)</tt>
163
+ # using the drawing point and <tt>(x0, y0)</tt> as the control points
164
+ # for the curve.
165
+ #
166
+ # New Point:: <tt>(x1, y1)</tt>
167
+ # Subpath:: Current
168
+ def scurve_to(x0, y0, x1, y1)
169
+ add_content("\n%.3f %.3f %.3f %.3f v" % [ x0, y0, x1, y1 ])
170
+ self
171
+ end
172
+
173
+ # Draws a cubic Bezier curve from the drawing point to <tt>(x1, y1)</tt>
174
+ # using <tt>(x0, y0)</tt> and <tt>(x1, y1)</tt> as the control points
175
+ # for the curve.
176
+ #
177
+ # New Point:: <tt>(x1, y1)</tt>
178
+ # Subpath:: Current
179
+ def ecurve_to(x0, y0, x1, y1)
180
+ add_content("\n%.3f %.3f %.3f %.3f y" % [ x0, y0, x1, y1 ])
181
+ self
182
+ end
183
+
184
+ # Draw a straight line from <tt>(x0, y0)</tt> to <tt>(x1, y1)</tt>. The
185
+ # line is a new subpath.
186
+ #
187
+ # New Point:: <tt>(x1, y1)</tt>.
188
+ # Subpath:: New
189
+ def line(x0, y0, x1, y1)
190
+ move_to(x0, y0).line_to(x1, y1)
191
+ end
192
+
193
+ # Draw a cubic Bezier curve from <tt>(x0, y0)</tt> to <tt>(x3, y3)</tt>
194
+ # using <tt>(x1, y1)</tt> and <tt>(x2, y2)</tt> as control points.
195
+ #
196
+ # New Point:: <tt>(x3, y3)</tt>
197
+ # Subpath:: New
198
+ def curve(x0, y0, x1, y1, x2, y2, x3, y3)
199
+ move_to(x0, y0).curve_to(x1, y1, x2, y2, x3, y3)
200
+ end
201
+
202
+ # Draw a cubic Bezier curve from <tt>(x0, y0)</tt> to <tt>(x2, y2)</tt>
203
+ # using <tt>(x0, y0)</tt> and <tt>(x1, y1)</tt> as control points.
204
+ #
205
+ # New Point:: <tt>(x2, y2)</tt>
206
+ # Subpath:: New
207
+ def scurve(x0, y0, x1, y1, x2, y2)
208
+ move_to(x0, y0).scurve_to(x1, y1, x2, y2)
209
+ end
210
+
211
+ # Draw a cubic Bezier curve from <tt>(x0, y0)</tt> to <tt>(x2, y2)</tt>
212
+ # using <tt>(x1, y1)</tt> and <tt>(x2, y2)</tt> as control points.
213
+ #
214
+ # New Point:: <tt>(x2, y2)</tt>
215
+ # Subpath:: New
216
+ def ecurve(x0, y0, x1, y1, x2, y2)
217
+ move_to(x0, y0).ecurve_to(x1, y1, x2, y2)
218
+ end
219
+
220
+ # This constant is used to approximate a symmetrical arc using a cubic
221
+ # Bezier curve.
222
+ KAPPA = 4.0 * ((Math.sqrt(2) - 1.0) / 3.0)
223
+
224
+ # Draws a circle of radius +r+ with the centre-point at <tt>(x, y)</tt>
225
+ # as a complete subpath. The drawing point will be moved to the
226
+ # centre-point upon completion of the drawing the circle.
227
+ def circle_at(x, y, r)
228
+ ellipse_at(x, y, r, r)
229
+ end
230
+
231
+ # Draws an ellipse of +x+ radius <tt>r1</tt> and +y+ radius <tt>r2</tt>
232
+ # with the centre-point at <tt>(x, y)</tt> as a complete subpath. The
233
+ # drawing point will be moved to the centre-point upon completion of the
234
+ # drawing the ellipse.
235
+ def ellipse_at(x, y, r1, r2 = r1)
236
+ l1 = r1 * KAPPA
237
+ l2 = r2 * KAPPA
238
+ move_to(x + r1, y)
239
+ # Upper right hand corner
240
+ curve_to(x + r1, y + l1, x + l2, y + r2, x, y + r2)
241
+ # Upper left hand corner
242
+ curve_to(x - l2, y + r2, x - r1, y + l1, x - r1, y)
243
+ # Lower left hand corner
244
+ curve_to(x - r1, y - l1, x - l2, y - r2, x, y - r2)
245
+ # Lower right hand corner
246
+ curve_to(x + l2, y - r2, x + r1, y - l1, x + r1, y)
247
+ move_to(x, y)
248
+ end
249
+
250
+ # Draw an ellipse centered at <tt>(x, y)</tt> with +x+ radius
251
+ # <tt>r1</tt> and +y+ radius <tt>r2</tt>. A partial ellipse can be drawn
252
+ # by specifying the starting and finishing angles.
253
+ #
254
+ # New Point:: <tt>(x, y)</tt>
255
+ # Subpath:: New
256
+ def ellipse2_at(x, y, r1, r2 = r1, start = 0, stop = 359.99, segments = 8)
257
+ segments = 2 if segments < 2
258
+
259
+ start = PDF::Math.deg2rad(start)
260
+ stop = PDF::Math.deg2rad(stop)
261
+
262
+ arc = stop - start
263
+ segarc = arc / segments.to_f
264
+ dtm = segarc / 3.0
265
+
266
+ theta = start
267
+ a0 = x + r1 * Math.cos(theta)
268
+ b0 = y + r2 * Math.sin(theta)
269
+ c0 = -r1 * Math.sin(theta)
270
+ d0 = r2 * Math.cos(theta)
271
+
272
+ move_to(a0, b0)
273
+
274
+ (1..segments).each do |ii|
275
+ theta = ii * segarc + start
276
+
277
+ a1 = x + r1 * Math.cos(theta)
278
+ b1 = y + r2 * Math.sin(theta)
279
+ c1 = -r1 * Math.sin(theta)
280
+ d1 = r2 * Math.cos(theta)
281
+
282
+ curve_to(a0 + (c0 * dtm),
283
+ b0 + (d0 * dtm),
284
+ a1 - (c1 * dtm),
285
+ b1 - (d1 * dtm), a1, b1)
286
+
287
+ a0 = a1
288
+ b0 = b1
289
+ c0 = c1
290
+ d0 = d1
291
+ end
292
+
293
+ move_to(x, y)
294
+ self
295
+ end
296
+
297
+ # Draws an ellipse segment. Draws a closed partial ellipse.
298
+ #
299
+ # New Point:: <tt>(x, y)</tt>
300
+ # Subpath:: New
301
+ def segment_at(x, y, r1, r2 = r1, start = 0, stop = 360, segments = 8)
302
+ ellipse2_at(x, y, r1, r2, start, stop, segments)
303
+
304
+ start = PDF::Math.deg2rad(start)
305
+ stop = PDF::Math.deg2rad(stop)
306
+
307
+ ax = x + r1 * Math.cos(start)
308
+ ay = y + r2 * Math.sin(start)
309
+ bx = x + r1 * Math.cos(stop)
310
+ by = y + r2 * Math.sin(stop)
311
+
312
+ move_to(ax, ay)
313
+ line_to(x, y)
314
+ line_to(bx, by)
315
+ move_to(x, y)
316
+ self
317
+ end
318
+
319
+ # Draw a polygon. +points+ is an array of PolygonPoint objects, or an
320
+ # array that can be converted to an array of PolygonPoint objects with
321
+ # <tt>PDF::Writer::PolygonPoint.new(*value)</tt>.
322
+ #
323
+ # New Point:: <tt>(points[-1].x, points[-1].y)</tt>
324
+ # Subpath:: New
325
+ def polygon(points)
326
+ points = points.map { |pp|
327
+ pp.kind_of?(Array) ? PDF::Writer::PolygonPoint.new(*pp) : pp
328
+ }
329
+
330
+ point = points.shift
331
+
332
+ move_to(point.x, point.y)
333
+
334
+ while not points.empty?
335
+ point = points.shift
336
+
337
+ case point.connector
338
+ when :curve
339
+ c1 = point
340
+ c2 = points.shift
341
+ point = points.shift
342
+
343
+ curve_to(c1.x, c1.y, c2.x, c2.y, point.x, point.y)
344
+ when :scurve
345
+ c1 = point
346
+ point = points.shift
347
+ scurve_to(c1.x, c1.y, point.x, point.y)
348
+ when :ecurve
349
+ c1 = point
350
+ point = points.shift
351
+ ecurve_to(c1.x, c1.y, point.x, point.y)
352
+ else
353
+ line_to(point.x, point.y)
354
+ end
355
+ end
356
+
357
+ self
358
+ end
359
+
360
+ # Draw a rectangle. The first corner is <tt>(x, y)</tt> and the second
361
+ # corner is <tt>(x + w, y - h)</tt>.
362
+ #
363
+ # New Point:: <tt>(x + w, y - h)</tt>
364
+ # Subpath:: Current
365
+ def rectangle(x, y, w, h = w)
366
+ add_content("\n%.3f %.3f %.3f %.3f re" % [ x, y, w, h ])
367
+ self
368
+ end
369
+
370
+ # Draw a rounded rectangle with corners <tt>(x, y)</tt> and <tt>(x + w,
371
+ # y - h)</tt> and corner radius +r+. The radius should be significantly
372
+ # smaller than +h+ and +w+.
373
+ #
374
+ # New Point:: <tt>(x + w, y - h)</tt>
375
+ # Subpath:: New
376
+ def rounded_rectangle(x, y, w, h, r)
377
+ x1 = x
378
+ x2 = x1 + w
379
+ y1 = y
380
+ y2 = y1 - h
381
+
382
+ r1 = r
383
+ r2 = r / 2.0
384
+
385
+ points = [
386
+ [ x1 + r1, y1, :line ],
387
+ [ x2 - r1, y1, :line ],
388
+ [ x2 - r2, y1, :curve ], # cp1
389
+ [ x2, y1 - r2, ], # cp2
390
+ [ x2, y1 - r1, ], # ep
391
+ [ x2, y2 + r1, :line ],
392
+ [ x2, y2 + r2, :curve ], # cp1
393
+ [ x2 - r2, y2, ], # cp2
394
+ [ x2 - r1, y2, ], # ep
395
+ [ x1 + r1, y2, :line ],
396
+ [ x1 + r2, y2, :curve ], # cp1
397
+ [ x1, y2 + r2, ], # cp2
398
+ [ x1, y2 + r1, ], # ep
399
+ [ x1, y1 - r1, :line ],
400
+ [ x1, y1 - r2, :curve ], # cp1
401
+ [ x1 + r2, y1, ], # cp2
402
+ [ x1 + r1, y1, ], # ep
403
+ ]
404
+ polygon(points)
405
+ move_to(x2, y2)
406
+ self
407
+ end
408
+
409
+ # Draws a star centered on <tt>(x, y)</tt> with +rays+ portions of
410
+ # +length+ from the centre. Stars with an odd number of rays should have
411
+ # the top ray pointing toward the top of the document. This will not
412
+ # create a "star" with fewer than four points.
413
+ #
414
+ # New Point:: <tt>(cx, cy)</tt>
415
+ # Subpath:: New
416
+ def star(cx, cy, length, rays = 5)
417
+ rays = 4 if rays < 4
418
+ points = []
419
+ part = Math::PI / rays.to_f
420
+
421
+ 0.step((rays * 4), 2) do |ray|
422
+ if ((ray / 2) % 2 == 0)
423
+ dist = length / 2.0
424
+ else
425
+ dist = length
426
+ end
427
+
428
+ x = cx + Math.cos((1.5 + ray / 2.0) * part) * dist
429
+ y = cy + Math.sin((1.5 + ray / 2.0) * part) * dist
430
+ points << [ x, y ]
431
+ end
432
+
433
+ polygon(points)
434
+ move_to(cx, cy)
435
+ self
436
+ end
437
+
438
+ # This sets the line drawing style. This *must* be a
439
+ # PDF::Writer::StrokeStyle object.
440
+ def stroke_style(style)
441
+ stroke_style!(style) if @current_stroke_style.nil? or style != @current_stroke_style
442
+ end
443
+
444
+ # Forces the line drawing style to be set, even if it's the same as the
445
+ # current color. Emits the current stroke style if +nil+ is provided.
446
+ def stroke_style!(style = nil)
447
+ @current_stroke_style = style if style
448
+ add_content "\n#{@current_stroke_style.render}" if @current_stroke_style
449
+ end
450
+
451
+ # Returns the current stroke style.
452
+ def stroke_style?
453
+ @current_stroke_style
454
+ end
455
+
456
+ # Set the text rendering style. This may be one of the following
457
+ # options:
458
+ #
459
+ # 0:: fill
460
+ # 1:: stroke
461
+ # 2:: fill then stroke
462
+ # 3:: invisible
463
+ # 4:: fill and add to clipping path
464
+ # 5:: stroke and add to clipping path
465
+ # 6:: fill and stroke and add to clipping path
466
+ # 7:: add to clipping path
467
+ def text_render_style(style)
468
+ text_render_style!(style) unless @current_text_render_style and style == @current_text_render_style
469
+ end
470
+
471
+ # Forces the text rendering style to be set, even if it's the same as
472
+ # the current style.
473
+ def text_render_style!(style)
474
+ @current_text_render_style = style
475
+ end
476
+
477
+ # Reutnrs the current text rendering style.
478
+ def text_render_style?
479
+ @current_text_render_style
480
+ end
481
+
482
+ # Sets the color for fill operations.
483
+ def fill_color(color)
484
+ fill_color!(color) if @current_fill_color.nil? or color != @current_fill_color
485
+ end
486
+
487
+ # Forces the color for fill operations to be set, even if the color
488
+ # is the same as the current color. Does nothing if +nil+ is provided.
489
+ def fill_color!(color = nil)
490
+ if color
491
+ @current_fill_color = color
492
+ add_content "\n#{@current_fill_color.pdf_fill}"
493
+ end
494
+ end
495
+
496
+ # Returns the current fill color.
497
+ def fill_color?
498
+ @current_fill_color
499
+ end
500
+
501
+ # Sets the color for stroke operations.
502
+ def stroke_color(color)
503
+ stroke_color!(color) if @current_stroke_color.nil? or color != @current_stroke_color
504
+ end
505
+
506
+ # Forces the color for stroke operations to be set, even if the color
507
+ # is the same as the current color. Does nothing if +nil+ is provided.
508
+ def stroke_color!(color = nil)
509
+ if color
510
+ @current_stroke_color = color
511
+ add_content "\n#{@current_stroke_color.pdf_stroke}"
512
+ end
513
+ end
514
+
515
+ # Returns the current stroke color.
516
+ def stroke_color?
517
+ @current_stroke_color
518
+ end
519
+
520
+ # Add an image from a file to the current page at position <tt>(x,
521
+ # y)</tt> (the lower left-hand corner of the image). The image will be
522
+ # scaled to +width+ by +height+ units. The image may be a PNG or JPEG
523
+ # image.
524
+ #
525
+ # The +image+ parameter may be a filename or an object that returns the
526
+ # full image data when #read is called with no parameters (such as an IO
527
+ # object). If 'open-uri' is loaded, then the image name may be an URI.
528
+ #
529
+ # In PDF::Writer 1.1 or later, the new +link+ parameter is a hash with
530
+ # two keys:
531
+ #
532
+ # <tt>:type</tt>:: The type of link, either <tt>:internal</tt> or
533
+ # <tt>:external</tt>.
534
+ # <tt>:target</tt>:: The destination of the link. For an
535
+ # <tt>:internal</tt> link, this is an internal
536
+ # cross-reference destination. For an
537
+ # <tt>:external</tt> link, this is an URI.
538
+ #
539
+ # This will automatically make the image a clickable link if set.
540
+ def add_image_from_file(image, x, y, width = nil, height = nil, link = nil)
541
+ data = nil
542
+
543
+ if image.respond_to?(:read)
544
+ data = image.read
545
+ else
546
+ open(image, 'rb') { |ff| data = ff.read }
547
+ end
548
+
549
+ add_image(data, x, y, width, height, nil, link)
550
+ end
551
+
552
+ # Add an image from a loaded image (JPEG or PNG) resource at position
553
+ # <tt>(x, y)</tt> (the lower left-hand corner of the image) and scaled
554
+ # to +width+ by +height+ units. If provided, +image_info+ is a
555
+ # PDF::Writer::Graphics::ImageInfo object.
556
+ #
557
+ # In PDF::Writer 1.1 or later, the new +link+ parameter is a hash with
558
+ # two keys:
559
+ #
560
+ # <tt>:type</tt>:: The type of link, either <tt>:internal</tt> or
561
+ # <tt>:external</tt>.
562
+ # <tt>:target</tt>:: The destination of the link. For an
563
+ # <tt>:internal</tt> link, this is an internal
564
+ # cross-reference destination. For an
565
+ # <tt>:external</tt> link, this is an URI.
566
+ #
567
+ # This will automatically make the image a clickable link if set.
568
+ def add_image(image, x, y, width = nil, height = nil, image_info = nil, link = nil)
569
+ if image.kind_of?(PDF::Writer::External::Image)
570
+ label = image.label
571
+ image_obj = image
572
+ image_info ||= image.image_info
573
+ else
574
+ image_info ||= PDF::Writer::Graphics::ImageInfo.new(image)
575
+
576
+ tt = Time.now
577
+ @images << tt
578
+ id = @images.index(tt)
579
+ label = "I#{id}"
580
+ image_obj = PDF::Writer::External::Image.new(self, image, image_info, label)
581
+ @images[id] = image_obj
582
+ end
583
+
584
+ if width.nil? and height.nil?
585
+ width = image_info.width
586
+ height = image_info.height
587
+ end
588
+
589
+ width ||= height / image_info.height.to_f * image_info.width
590
+ height ||= width * image_info.height / image_info.width.to_f
591
+
592
+ tt = "\nq\n%.3f 0 0 %.3f %.3f %.3f cm\n/%s Do\nQ"
593
+ add_content(tt % [ width, height, x, y, label ])
594
+
595
+ if link
596
+ case link[:type]
597
+ when :internal
598
+ add_internal_link(link[:target], x, y, x + width, y + height)
599
+ when :external
600
+ add_link(link[:target], x, y, x + width, y + height)
601
+ end
602
+ end
603
+
604
+ image_obj
605
+ end
606
+
607
+ # Add an image easily to a PDF document. +image+ is the name of a JPG or
608
+ # PNG image. +options+ is a Hash:
609
+ #
610
+ # <tt>:pad</tt>:: The number of PDF userspace units that will
611
+ # be on all sides of the image. The default is
612
+ # <tt>5</tt> units.
613
+ # <tt>:width</tt>:: The desired width of the image. The image
614
+ # will be resized to this width with the
615
+ # aspect ratio kept. If unspecified, the
616
+ # image's natural width will be used.
617
+ # <tt>:resize</tt>:: How to resize the image, either :width
618
+ # (resizes the image to be as wide as the
619
+ # margins) or :full (resizes the image to be
620
+ # as large as possible). May be a numeric
621
+ # value, used as a multiplier for the image
622
+ # size (e.g., 0.5 will shrink the image to
623
+ # half-sized). If this and <tt>:width</tt> are
624
+ # unspecified, the image's natural size will be
625
+ # used. Mutually exclusive with the
626
+ # <tt>:width<tt> option.
627
+ # <tt>:justification</tt>:: The placement of the image. May be :center,
628
+ # :right, or :left. Defaults to :left.
629
+ # <tt>:border</tt>:: The border options. No default border. If
630
+ # specified, must be either +true+, which uses
631
+ # the default border, or a Hash.
632
+ # <tt>:link</tt>:: Makes the image a clickable link.
633
+ #
634
+ # Image borders are specified as a hash with two options:
635
+ #
636
+ # <tt>:color</tt>:: The colour of the border. Defaults to 50% grey.
637
+ # <tt>:style</tt>:: The stroke style of the border. This must be a
638
+ # StrokeStyle object and defaults to the default line.
639
+ #
640
+ # Image links are defined as a hash with two options:
641
+ #
642
+ # <tt>:type</tt>:: The type of link, either <tt>:internal</tt> or
643
+ # <tt>:external</tt>.
644
+ # <tt>:target</tt>:: The destination of the link. For an
645
+ # <tt>:internal</tt> link, this is an internal
646
+ # cross-reference destination. For an
647
+ # <tt>:external</tt> link, this is an URI.
648
+ def image(image, options = {})
649
+ width = options[:width]
650
+ pad = options[:pad] || 5
651
+ resize = options[:resize]
652
+ just = options[:justification] || :left
653
+ border = options[:border]
654
+ link = options[:link]
655
+
656
+ if image.kind_of?(PDF::Writer::External::Image)
657
+ info = image.image_info
658
+ image_data = image
659
+ else
660
+ if image.respond_to?(:read)
661
+ image_data = image.read
662
+ else
663
+ image_data = open(image, "rb") { |file| file.read }
664
+ end
665
+ info = PDF::Writer::Graphics::ImageInfo.new(image_data)
666
+ end
667
+
668
+ raise "Unsupported Image Type" unless %w(JPEG PNG).include?(info.format)
669
+
670
+ width = info.width if width.nil?
671
+ aspect = info.width.to_f / info.height.to_f
672
+
673
+ # Get the maximum width of the image on insertion.
674
+ if @columns_on
675
+ max_width = @columns[:width] - (pad * 2)
676
+ else
677
+ max_width = @page_width - (pad * 2) - @left_margin - @right_margin
678
+ end
679
+
680
+ if resize == :full or resize == :width or width > max_width
681
+ width = max_width
682
+ end
683
+
684
+ # Keep the height in an appropriate aspect ratio of the width.
685
+ height = (width / aspect.to_f)
686
+
687
+ # Resize the image.
688
+ if resize.kind_of?(Numeric)
689
+ width *= resize
690
+ height *= resize
691
+ end
692
+
693
+ # Resize the image *again*, if it is wider than what is available.
694
+ if width > max_width
695
+ height = (width / aspect.to_f)
696
+ end
697
+
698
+ # If the height is greater than the available space:
699
+ havail = @y - @bottom_margin - (pad * 2)
700
+ if height > havail
701
+ # If the image is to be resized to :full (remaining space
702
+ # available), adjust the image size appropriately. Otherwise, start
703
+ # a new page and flow to the next page.
704
+ if resize == :full
705
+ height = havail
706
+ width = (height * aspect)
707
+ else
708
+ start_new_page
709
+ end
710
+ end
711
+
712
+ # Find the x and y positions.
713
+ y = @y - pad - height
714
+ x = @left_margin + pad
715
+
716
+ if (width < max_width)
717
+ case just
718
+ when :center
719
+ x += (max_width - width) / 2.0
720
+ when :right
721
+ x += (max_width - width)
722
+ end
723
+ end
724
+
725
+ image_obj = add_image(image_data, x, y, width, height, info)
726
+
727
+ if border
728
+ border = {} if true == border
729
+ border[:color] ||= Color::RGB::Grey50
730
+ border[:style] ||= PDF::Writer::StrokeStyle::DEFAULT
731
+
732
+ save_state
733
+ stroke_color border[:color]
734
+ stroke_style border[:style]
735
+ rectangle(x, y - pad, width, height - pad).stroke
736
+ restore_state
737
+ end
738
+
739
+ if link
740
+ case link[:type]
741
+ when :internal
742
+ add_internal_link(link[:target], x, y - pad, x + width, y + height - pad)
743
+ when :external
744
+ add_link(link[:target], x, y - pad, x + width, y + height - pad)
745
+ end
746
+ end
747
+
748
+ @y = @y - pad - height
749
+
750
+ image_obj
751
+ end
752
+
753
+ # Translate the coordinate system axis by the specified user space
754
+ # coordinates.
755
+ def translate_axis(x, y)
756
+ add_content("\n1 0 0 1 %.3f %.3f cm" % [ x, y ])
757
+ self
758
+ end
759
+
760
+ # Rotate the axis of the coordinate system by the specified clockwise
761
+ # angle.
762
+ def rotate_axis(angle)
763
+ rad = PDF::Math.deg2rad(angle)
764
+ tt = "\n%.3f %.3f %.3f %.3f 0 0 cm"
765
+ tx = [ Math.cos(rad), Math.sin(rad), -Math.sin(rad), Math.cos(rad) ]
766
+ add_content(tt % tx)
767
+ self
768
+ end
769
+
770
+ # Scale the coordinate system axis by the specified factors.
771
+ def scale_axis(x = 1, y = 1)
772
+ add_content("\n%.3f 0 0 %.3f 0 0 cm" % [ x, y ])
773
+ self
774
+ end
775
+
776
+ # Skew the coordinate system axis by the specified angles.
777
+ def skew_axis(xangle = 0, yangle = 0)
778
+ xr = PDF::Math.deg2rad(xangle)
779
+ yr = PDF::Math.deg2rad(yangle)
780
+
781
+ xr = Math.tan(xr) if xangle != 0
782
+ yr = Math.tan(yr) if yangle != 0
783
+
784
+ add_content("\n1 %.3f %.3f 1 0 0 cm" % [ xr, yr ])
785
+ self
786
+ end
787
+
788
+ # Transforms the coordinate axis with the appended matrix. All
789
+ # transformations (including those above) are performed with this
790
+ # matrix. The transformation matrix is:
791
+ #
792
+ # +- -+
793
+ # | a c e |
794
+ # | b d f |
795
+ # | 0 0 1 |
796
+ # +- -+
797
+ #
798
+ # The six values are represented as a six-digit vector: [ a b c d e f ]
799
+ #
800
+ # * Axis translation uses [ 1 0 0 1 x y ] where x and y are the new
801
+ # (0,0) coordinates in the old axis system.
802
+ # * Scaling uses [ sx 0 0 sy 0 0 ] where sx and sy are the scaling
803
+ # factors.
804
+ # * Rotation uses [ cos(a) sin(a) -sin(a) cos(a) 0 0 ] where a is the
805
+ # angle, measured in radians.
806
+ # * X axis skewing uses [ 1 0 tan(a) 1 0 0 ] where a is the angle,
807
+ # measured in radians.
808
+ # * Y axis skewing uses [ 1 tan(a) 0 1 0 0 ] where a is the angle,
809
+ # measured in radians.
810
+ def transform_matrix(a, b, c, d, e, f)
811
+ add_content("\n%.3f %.3f %.3f %.3f %.3f %.3f cm" % [ a, b, c, d, e, f ])
812
+ end
813
+ end