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,304 @@
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: image.rb 177 2007-11-26 16:06:58Z sandal $
10
+ #++
11
+ require 'pdf/writer/oreader'
12
+
13
+ # An image object. This will be an /XObject dictionary in the document. This
14
+ # includes description and data. The diectionary includes:
15
+ #
16
+ # Type:: (name, Optional) The type of PDF object that this
17
+ # dictionary describes; if present, must be /XObject for
18
+ # an image XObject.
19
+ # Subtype:: (name, Required) The type of XObject that this
20
+ # dictionary describes; must be /Image for an image
21
+ # /XObject.
22
+ # Width:: (integer, Required) The width of the image, in samples.
23
+ # Height:: (integer, Required) The height of the image, in samples.
24
+ # ColorSpace:: (name or array, Required for images, except those that
25
+ # use the /JPXDecode filter; not allowed for image
26
+ # masks) The color space in which image samples are
27
+ # specified; it can be any type of color space except
28
+ # /Pattern. If the image uses the JPXDecode filter, this
29
+ # entry is optional: * If /ColorSpace is present, any
30
+ # color space specifications in the JPEG2000 data are
31
+ # ignored. * If /ColorSpace is absent, the color space
32
+ # specifications in the JPEG2000 data are used. The
33
+ # /Decode array is also ignored unless /ImageMask is
34
+ # true.
35
+ # BitsPerComponent:: (integer, Required except for image masks and images
36
+ # that use the JPXDecode filter) The number of bits used
37
+ # to represent each color component. Only a single value
38
+ # may be specified; the number of bits is the same for
39
+ # all color components. Valid values are 1, 2, 4, 8, and
40
+ # (in PDF 1.5) 16. If /ImageMask is true, this entry is
41
+ # optional, and if specified, its value must be 1. If
42
+ # the image stream uses a filter, the value of
43
+ # BitsPerComponent must be consistent with the size of
44
+ # the data samples that the filter delivers. In
45
+ # particular, a CCITTFaxDecode or JBIG2Decode filter
46
+ # always delivers 1-bit samples, a RunLengthDecode or
47
+ # DCTDecode filter delivers 8-bit samples, and an
48
+ # LZWDecode or FlateDecode filter delivers samples of a
49
+ # specified size if a predictor function is used. If the
50
+ # image stream uses the JPXDecode filter, this entry is
51
+ # optional and ignored if present. The bit depth is
52
+ # determined in the process of decoding the JPEG2000
53
+ # image.
54
+ # Intent:: (name, Optional; PDF 1.1) The name of a color
55
+ # rendering intent to be used in rendering the image
56
+ # (see �Rendering Intents� on page 230). Default value:
57
+ # the current rendering intent in the graphics state.
58
+ # ImageMask:: (boolean, Optional) A flag indicating whether the
59
+ # image is to be treated as an image mask (see Section
60
+ # 4.8.5, �Masked Images�). If this flag is true, the
61
+ # value of /BitsPerComponent must be 1 and Mask and
62
+ # /ColorSpace should not be specified; unmasked areas
63
+ # are painted using the current nonstroking color.
64
+ # Default value: false.
65
+ # Mask:: (stream or array, Optional except for image masks; not
66
+ # allowed for image masks; PDF 1.3) An image XObject
67
+ # defining an image mask to be applied to this image
68
+ # (see �Explicit Masking� on page 321), or an array
69
+ # specifying a range of colors to be applied to it as a
70
+ # color key mask (see �Color Key Masking� on page 321).
71
+ # If ImageMask is true, this entry must not be present.
72
+ # (See implementation note 51 in Appendix H.)
73
+ # Decode:: (array, Optional) An array of numbers describing how
74
+ # to map image samples into the range of values
75
+ # appropriate for the image�s color space (see �Decode
76
+ # Arrays� on page 314). If ImageMask is true, the array
77
+ # must be either [0 1] or [1 0]; otherwise, its length
78
+ # must be twice the number of color components required
79
+ # by ColorSpace. If the image uses the JPXDecode filter
80
+ # and ImageMask is false, Decode is ignored. Default
81
+ # value: see �Decode Arrays� on page 314.
82
+ # Interpolate:: (boolean, Optional) A flag indicating whether image
83
+ # interpolation is to be performed (see �Image
84
+ # Interpolation� on page 316). Default value: false.
85
+ # Alternates:: (array, Optional; PDF 1.3) An array of alternate image
86
+ # dictionaries for this image (see �Alternate Images� on
87
+ # page 317). The order of elements within the array has
88
+ # no significance. This entry may not be present in an
89
+ # image XObject that is itself an alternate image.
90
+ # SMask:: (stream, Optional; PDF 1.4) A subsidiary image XObject
91
+ # defining a soft-mask image (see �Soft-Mask Images� on
92
+ # page 522) to be used as a source of mask shape or mask
93
+ # opacity values in the transparent imaging model. The
94
+ # alpha source parameter in the graphics state
95
+ # determines whether the mask values are interpreted as
96
+ # shape or opacity. If present, this entry overrides the
97
+ # current soft mask in the graphics state, as well as
98
+ # the image�s Mask entry, if any. (However, the other
99
+ # transparency related graphics state parameters�blend
100
+ # mode and alpha constant�remain in effect.) If SMask is
101
+ # absent, the image has no associated soft mask
102
+ # (although the current soft mask in the graphics state
103
+ # may still apply).
104
+ # SMaskInData:: (integer, Optional for images that use the JPXDecode
105
+ # filter, meaningless otherwise; PDF 1.5) A code
106
+ # specifying how soft-mask information (see �Soft-Mask
107
+ # Images� on page 522) encoded with image samples should
108
+ # be used: (0) If present, encoded soft-mask image
109
+ # information should be ignored. (1) The image�s data
110
+ # stream includes encoded soft-mask values. An
111
+ # application can create a soft-mask image from the
112
+ # information to be used as a source of mask shape or
113
+ # mask opacity in the transparency imaging model. (2)
114
+ # The image�s data stream includes color channels that
115
+ # have been preblended with a background; the image data
116
+ # also includes an opacity channel. An application can
117
+ # create a soft-mask image with a Matte entry from the
118
+ # opacity channel information to be used as a source of
119
+ # mask shape or mask opacity in the transparency model.
120
+ # * If this entry has a nonzero value, SMask should not
121
+ # be specified. See also Section 3.3.8, �JPXDecode
122
+ # Filter.� Default value: 0.
123
+ # Name:: (name, Required in PDF 1.0; optional otherwise) The
124
+ # name by which this image XObject is referenced in the
125
+ # XObject subdictionary of the current resource
126
+ # dictionary (see Section 3.7.2, �Resource
127
+ # Dictionaries�). Note: This entry is obsolescent and
128
+ # its use is no longer recommended. (See implementation
129
+ # note 52 in Appendix H.)
130
+ # StructParent:: (integer, Required if the image is a structural
131
+ # content item; PDF 1.3) The integer key of the image�s
132
+ # entry in the structural parent tree (see �Finding
133
+ # Structure Elements from Content Items� on page 797).
134
+ # ID:: (string, Optional; PDF 1.3; indirect reference
135
+ # preferred) The digital identifier of the image�s
136
+ # parent Web Capture content set (see Section 10.9.5,
137
+ # �Object Attributes Related to Web Capture�).
138
+ # OPI:: (dictionary, Optional; PDF 1.2) An OPI version
139
+ # dictionary for the image (see Section 10.10.6, �Open
140
+ # Prepress Interface (OPI)�). If ImageMask is true, this
141
+ # entry is ignored.
142
+ # Metadata:: (stream, Optional; PDF 1.4) A metadata stream
143
+ # containing metadata for the image (see Section 10.2.2,
144
+ # �Metadata Streams�).
145
+ # OC:: (dictionary, Optional; PDF 1.5) An optional content
146
+ # group or optional content membership dictionary (see
147
+ # Section 4.10, �Optional Content�), specifying the
148
+ # optional content properties for this image XObject.
149
+ # Before the image is processed, its visibility is
150
+ # determined based on this entry. If it is determined to
151
+ # be invisible, the entire image is skipped, as if there
152
+ # were no Do operator to invoke it.
153
+ class PDF::Writer::External::Image < PDF::Writer::External
154
+ attr_reader :label
155
+ attr_reader :image_info
156
+
157
+ def initialize(parent, data, image, label)
158
+ super(parent)
159
+
160
+ @data = data
161
+
162
+ @image_info = image
163
+
164
+ @info = {
165
+ 'Type' => '/XObject',
166
+ 'Subtype' => '/Image',
167
+ 'Width' => image.width,
168
+ 'Height' => image.height
169
+ }
170
+
171
+ case image.format
172
+ when "JPEG"
173
+ case image.channels
174
+ when 1
175
+ @info['ColorSpace'] = '/DeviceGray'
176
+ when 4
177
+ @info['ColorSpace'] = '/DeviceCMYK'
178
+ # This should fix problems with CMYK JPEG colours inverted in
179
+ # Adobe Acrobat. Enable only if appropriate.
180
+ # @info['Decode'] = '[1.0 0.0 1.0 0.0 1.0 0.0 1.0 0.0]'
181
+ else
182
+ @info['ColorSpace'] = '/DeviceRGB'
183
+ end
184
+ @info['Filter'] = '/DCTDecode'
185
+ @info['BitsPerComponent'] = 8
186
+ when "PNG"
187
+ if image.info[:compression_method] != 0
188
+ raise TypeError, PDF::Writer::Lang[:png_unsupp_compres]
189
+ end
190
+
191
+ if image.info[:filter_method] != 0
192
+ raise TypeError, PDF::Writer::Lang[:png_unsupp_filter]
193
+ end
194
+
195
+ data = data.dup
196
+ data.extend(PDF::Writer::OffsetReader)
197
+
198
+ data.read_o(8) # Skip the default header
199
+
200
+ ok = true
201
+ length = data.size
202
+ palette = ""
203
+ idat = ""
204
+
205
+ while ok
206
+ chunk_size = data.read_o(4).unpack("N")[0]
207
+ section = data.read_o(4)
208
+ case section
209
+ when 'PLTE'
210
+ palette << data.read_o(chunk_size)
211
+ when 'IDAT'
212
+ idat << data.read_o(chunk_size)
213
+ when 'tRNS'
214
+ # This chunk can only occur once and it must occur after the
215
+ # PLTE chunk and before the IDAT chunk
216
+ trans = {}
217
+ case image.info[:color_type]
218
+ when 3
219
+ # Indexed colour, RGB. Each byte in this chunk is an alpha for
220
+ # the palette index in the PLTE ("palette") chunk up until the
221
+ # last non-opaque entry. Set up an array, stretching over all
222
+ # palette entries which will be 0 (opaque) or 1 (transparent).
223
+ trans[:type] = 'indexed'
224
+ trans[:data] = data.read_o(chunk_size).unpack("C*")
225
+ when 0
226
+ # Greyscale. Corresponding to entries in the PLTE chunk.
227
+ # Grey is two bytes, range 0 .. (2 ^ bit-depth) - 1
228
+ trans[:grayscale] = data.read_o(2).unpack("n")
229
+ trans[:type] = 'indexed'
230
+ # trans[:data] = data.read_o.unpack("C")
231
+ when 2
232
+ # True colour with proper alpha channel.
233
+ trans[:rgb] = data.read_o(6).unpack("nnn")
234
+ end
235
+ else
236
+ data.offset += chunk_size
237
+ end
238
+
239
+ ok = (section != "IEND")
240
+
241
+ data.read_o(4) # Skip the CRC
242
+ end
243
+
244
+ if image.bits > 8
245
+ raise TypeError, PDF::Writer::Lang[:png_8bit_colour]
246
+ end
247
+ if image.info[:interlace_method] != 0
248
+ raise TypeError, PDF::Writer::Lang[:png_interlace]
249
+ end
250
+
251
+ ncolor = 1
252
+ colour = 'DeviceRGB'
253
+ case image.info[:color_type]
254
+ when 3
255
+ nil
256
+ when 2
257
+ ncolor = 3
258
+ when 0
259
+ colour = 'DeviceGray'
260
+ else
261
+ raise TypeError, PDF::Writer::Lang[:png_alpha_trans]
262
+ end
263
+
264
+ @info['Filter'] = '[/FlateDecode]'
265
+ @info['DecodeParms'] = "[<</Predictor 15 /Colors #{ncolor} /Columns #{image.width}>>]"
266
+ @info['BitsPerComponent'] = image.bits.to_s
267
+
268
+ unless palette.empty?
269
+ @info['ColorSpace'] = " [ /Indexed /DeviceRGB #{(palette.size / 3) - 1} "
270
+ contents = PDF::Writer::Object::Contents.new(parent,
271
+ self)
272
+ contents.data = palette
273
+ @info['ColorSpace'] << "#{contents.oid} 0 R ]"
274
+
275
+ if trans
276
+ case trans[:type]
277
+ when 'indexed'
278
+ @info['Mask'] = " [ #{trans[:data].join(' ')} ] "
279
+ end
280
+ end
281
+ else
282
+ @info['ColorSpace'] = "/#{colour}"
283
+ end
284
+
285
+ @data = idat
286
+ end
287
+
288
+ @label = label
289
+
290
+ # assign it a place in the named resource dictionary as an external
291
+ # object, according to the label passed in with it.
292
+ @parent.pages << self
293
+ # also make sure that we have the right procset object for it.
294
+ @parent.procset << 'ImageC'
295
+ end
296
+
297
+ def to_s
298
+ tmp = @data.dup
299
+ res = "\n#{@oid} 0 obj\n<<"
300
+ @info.each { |k, v| res << "\n/#{k} #{v}"}
301
+ res << "\n/Length #{tmp.size} >>\nstream\n#{tmp}\nendstream\nendobj\n"
302
+ res
303
+ end
304
+ end
@@ -0,0 +1,51 @@
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: info.rb 177 2007-11-26 16:06:58Z sandal $
10
+ #++
11
+ # Define the document information -- metadata.
12
+ class PDF::Writer::Object::Info < PDF::Writer::Object
13
+ Info = %w{CreationDate Creator Title Author Subject Keywords ModDate Trapped Producer}
14
+ def initialize(parent)
15
+ super(parent)
16
+
17
+ @parent.instance_variable_set('@info', self)
18
+ @creationdate = Time.now
19
+
20
+ @creator = nil #File.basename($0)
21
+ @producer = "PDF::Writer for Ruby"
22
+ @title = nil
23
+ @author = nil
24
+ @subject = nil
25
+ @keywords = nil
26
+ @moddate = nil
27
+ @trapped = nil
28
+ end
29
+
30
+ Info.each do |i|
31
+ attr_accessor i.downcase.intern
32
+ end
33
+
34
+ def to_s
35
+ res = "\n#{@oid} 0 obj\n<<\n"
36
+ Info.each do |i|
37
+ v = __send__("#{i.downcase}".intern)
38
+ next if v.nil?
39
+ res << "/#{i} ("
40
+ if v.kind_of?(Time)
41
+ s = "D:%04d%02d%02d%02d%02d"
42
+ v = v.utc
43
+ v = s % [ v.year, v.month, v.day, v.hour, v.min ]
44
+ end
45
+
46
+ res << PDF::Writer.escape(v)
47
+ res << ")\n"
48
+ end
49
+ res << ">>\nendobj"
50
+ end
51
+ end
@@ -0,0 +1,30 @@
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: outline.rb 50 2005-05-16 03:59:21Z austin $
10
+ #++
11
+ # Define the outlines in the doc, empty for now
12
+ class PDF::Writer::Object::Outline < PDF::Writer::Object
13
+ def initialize(parent, label, title = label)
14
+ super(parent)
15
+
16
+ @action = PDF::Writer::Action.new(parent, label, :ilink)
17
+ @title = title
18
+
19
+ parent.outlines.list << self
20
+ end
21
+
22
+ def to_s
23
+ pos = @parent.outlines.list.index(self)
24
+ res = "\n#{@oid} 0 obj\n<< /Title (#{@title})"
25
+ res << " /Prev #{@parent.outlines.list[pos - 1].oid} 0 R" if pos.nonzero?
26
+ res << " /Next #{@parent.outlines.list[pos + 1].oid} 0 R" if @oid != parent.outlines.list[-1].oid
27
+ res << " /A #{@action.oid} 0 R>>\nendobj"
28
+ res
29
+ end
30
+ end
@@ -0,0 +1,30 @@
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: outlines.rb 50 2005-05-16 03:59:21Z austin $
10
+ #++
11
+ # Define the outlines in the doc, empty for now
12
+ class PDF::Writer::Object::Outlines < PDF::Writer::Object
13
+ def initialize(parent)
14
+ super(parent)
15
+
16
+ @list = []
17
+ @parent.catalog.outlines = self
18
+ end
19
+
20
+ attr_reader :list
21
+
22
+ def to_s
23
+ if @list.empty?
24
+ "\n#{@oid} 0 obj\n<< /Type /Outlines >>\nendobj"
25
+ else
26
+ "\n#{@oid} 0 obj\n<< /Type /Outlines /First #{@list[0].oid} 0 R /Last
27
+ #{@list[-1].oid} 0 R>>\nendobj"
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,195 @@
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: page.rb 75 2005-06-02 21:20:35Z austin $
10
+ #++
11
+ # A page object, it also creates a contents object to hold its contents
12
+ class PDF::Writer::Object::Page < PDF::Writer::Object
13
+ # Create a page. The optional +relative+ is a Hash with keys :pos =>
14
+ # :before|:after and :rpage, the page to which this new page will be
15
+ # added relative.
16
+ def initialize(parent, relative = nil)
17
+ super(parent)
18
+
19
+ @parent.current_page = self
20
+ @owner = @parent.instance_variable_get('@current_node')
21
+ @page_number = @parent.pages.size
22
+ @contents = []
23
+
24
+ if relative.nil?
25
+ @parent.pages << self
26
+ else
27
+ relative[:page] = self
28
+ @parent.pages.add(relative)
29
+ end
30
+
31
+ # make a contents object to go with this page
32
+ @contents << PDF::Writer::Object::Contents.new(@parent, self)
33
+ @parent.instance_variable_set('@current_contents', @contents[-1])
34
+ match = (@parent.pages.size % 2 == 0 ? :even_pages : :odd_pages)
35
+ # Cheat here. I don't want to add an unnecessary attribute.
36
+ @parent.instance_variable_get('@add_loose_objects').each do |obj, target|
37
+ @contents << obj if target == :all_pages or match == target
38
+ end
39
+
40
+ @annotations = []
41
+
42
+ @media_box = nil
43
+ @crop_box = nil
44
+ @bleed_box = nil
45
+ @trim_box = nil
46
+ @art_box = nil
47
+ end
48
+
49
+ attr_accessor :contents
50
+ attr_reader :page_number
51
+
52
+ def add_annotation(a)
53
+ @annotations << a
54
+ end
55
+
56
+ def to_s
57
+ res = "\n#{@oid} 0 obj\n<< /Type /Page\n/Parent #{@owner.oid} 0 R"
58
+ unless @annotations.empty?
59
+ res << "\n/Annots ["
60
+ @annotations.each { |e| res << " #{e.oid} 0 R"}
61
+ res << "]"
62
+ end
63
+
64
+ if @contents.size == 1
65
+ res << "\n/Contents #{@contents[0].oid} 0 R"
66
+ else
67
+ res << "\n/Contents [\n"
68
+ @contents.each { |c| res << "#{c.oid} 0 R\n" }
69
+ res << "]"
70
+ end
71
+
72
+ # MediaBox:: rectangle (Required; inheritable). A rectangle (see
73
+ # Section 3.8.4, �Rectangles�), expressed in default user
74
+ # space units, defining the boundaries of the physical
75
+ # medium on which the page is intended to be displayed or
76
+ # printed (see Section 10.10.1, �Page Boundaries�).
77
+ res << "\n/MediaBox [#{@media_box.join(' ')}]" unless @media_box.nil? or @media_box.empty?
78
+ # CropBox:: rectangle (Optional; inheritable) A rectangle, expressed
79
+ # in default user space units, defining the visible region
80
+ # of default user space. When the page is displayed or
81
+ # printed, its contents are to be clipped (cropped) to
82
+ # this rectangle and then imposed on the output medium in
83
+ # some implementation-defined manner (see Section 10.10.1,
84
+ # �Page Boundaries�). Default value: the value of MediaBox.
85
+ res << "\n/CropBox [#{@crop_box.join(' ')}]" unless @crop_box.nil? or @crop_box.empty?
86
+ # BleedBox:: rectangle (Optional; PDF 1.3) A rectangle, expressed in
87
+ # default user space units, defining the region to which
88
+ # the contents of the page should be clipped when output
89
+ # in a production environment (see Section 10.10.1, �Page
90
+ # Boundaries�). Default value: the value of CropBox.
91
+ res << "\n/BleedBox [#{@bleed_box.join(' ')}]" unless @bleed_box.nil? or @bleed_box.empty?
92
+ # TrimBox:: rectangle (Optional; PDF 1.3) A rectangle, expressed in
93
+ # default user space units, defining the intended
94
+ # dimensions of the finished page after trimming (see
95
+ # Section 10.10.1, �Page Boundaries�). Default value: the
96
+ # value of CropBox.
97
+ res << "\n/TrimBox [#{@trim_box.join(' ')}]" unless @trim_box.nil? or @trim_box.empty?
98
+ # ArtBox:: rectangle (Optional; PDF 1.3) A rectangle, expressed in
99
+ # default user space units, defining the extent of the
100
+ # page�s meaningful content (including potential white
101
+ # space) as intended by the page�s creator (see Section
102
+ # 10.10.1, �Page Boundaries�). Default value: the value of
103
+ # CropBox.
104
+ res << "\n/ArtBox [#{@art_box.join(' ')}]" unless @art_box.nil? or @art_box.empty?
105
+
106
+ res << "\n>>\nendobj"
107
+ end
108
+ end
109
+
110
+ # BoxColorInfo:: dictionary (Optional; PDF 1.4) A box color information
111
+ # dictionary specifying the colors and other visual
112
+ # characteristics to be used in displaying guidelines on
113
+ # the screen for the various page boundaries (see �Display
114
+ # of Page Boundaries� on page 893). If this entry is
115
+ # absent, the application should use its own current
116
+ # default settings.
117
+ #
118
+ # Rotate:: integer (Optional; inheritable) The number of degrees by
119
+ # which the page should be rotated clockwise when
120
+ # displayed or printed. The value must be a multiple of
121
+ # 90. Default value: 0.
122
+ # Group:: dictionary (Optional; PDF 1.4) A group attributes
123
+ # dictionary specifying the attributes of the page�s page
124
+ # group for use in the transparent imaging model (see
125
+ # Sections 7.3.6, �Page Group,� and 7.5.5, �Transparency
126
+ # Group XObjects�).
127
+ # Thumb:: stream (Optional) A stream object defining the page�s
128
+ # thumbnail image (see Section 8.2.3, �Thumbnail Images�).
129
+ # B:: array (Optional; PDF 1.1; recommended if the page
130
+ # contains article beads) An array of indirect references
131
+ # to article beads appearing on the page (see Section
132
+ # 8.3.2, �Articles�; see also implementation note 37 in
133
+ # Appendix H). The beads are listed in the array in
134
+ # natural reading order.
135
+ # Dur:: number (Optional; PDF 1.1) The page�s display duration
136
+ # (also called its advance timing): the maximum length of
137
+ # time, in seconds, that the page is displayed during
138
+ # presentations before the viewer application
139
+ # automatically advances to the next page (see Section
140
+ # 8.3.3, �Presentations�). By default, the viewer does not
141
+ # advance automatically.
142
+ # Trans:: dictionary (Optional; PDF 1.1) A transition dictionary
143
+ # describing the transition effect to be used when
144
+ # displaying the page during presentations (see Section
145
+ # 8.3.3, �Presentations�).
146
+ # Annots:: array (Optional) An array of annotation dictionaries
147
+ # representing annotations associated with the page (see
148
+ # Section 8.4, �Annotations�).
149
+ # AA:: dictionary (Optional; PDF 1.2) An additional-actions
150
+ # dictionary defining actions to be performed when the
151
+ # page is opened or closed (see Section 8.5.2, �Trigger
152
+ # Events�; see also implementation note 38 in Appendix H).
153
+ # Metadata:: stream (Optional; PDF 1.4) A metadata stream containing
154
+ # metadata for the page (see Section 10.2.2, �Metadata
155
+ # Streams�).
156
+ # PieceInfo:: dictionary (Optional; PDF 1.3) A page-piece dictionary
157
+ # associated with the page (see Section 10.4, �Page-Piece
158
+ # Dictionaries�).
159
+ # StructParents:: integer (Required if the page contains structural
160
+ # content items; PDF 1.3) The integer key of the page�s
161
+ # entry in the structural parent tree (see �Finding
162
+ # Structure Elements from Content Items� on page 797).
163
+ # ID:: string (Optional; PDF 1.3; indirect reference preferred)
164
+ # The digital identifier of the page�s parent Web Capture
165
+ # content set (see Section 10.9.5, �Object Attributes
166
+ # Related to Web Capture�).
167
+ # PZ:: number (Optional; PDF 1.3) The page�s preferred zoom
168
+ # (magnification) factor: the factor by which it should be
169
+ # scaled to achieve the natural display magnification (see
170
+ # Section 10.9.5, �Object Attributes Related to Web
171
+ # Capture�).
172
+ # SeparationInfo:: dictionary (Optional; PDF 1.3) A separation dictionary
173
+ # containing information needed to generate color
174
+ # separations for the page (see Section 10.10.3,
175
+ # �Separation Dictionaries�).
176
+ # Tabs:: name (Optional; PDF 1.5) A name specifying the tab order
177
+ # to be used for annotations on the page. The possible
178
+ # values are R (row order), C (column order), and S
179
+ # (structure order). See Section 8.4, �Annotations,� for
180
+ # details.
181
+ # TemplateInstantiated:: name (Required if this page was created from a
182
+ # named page object; PDF 1.5) The name of the
183
+ # originating page object (see Section 8.6.5,
184
+ # �Named Pages�).
185
+ # PresSteps:: dictionary (Optional; PDF 1.5) A navigation node
186
+ # dictionary representing the first node on the page (see
187
+ # �Sub-page Navigation� on page 566).
188
+ # UserUnit:: number (Optional; PDF 1.6) A positive number giving the
189
+ # size of default user space units, in multiples of 1/72
190
+ # inch. The range of supported values is
191
+ # implementation-dependent; see implementation note 171 in
192
+ # Appendix H. Default value: 1.0 (user unit is 1/72 inch).
193
+ # VP:: dictionary (Optional; PDF 1.6) An array of viewport
194
+ # dictionaries (see Table 8.105) specifying rectangular
195
+ # regions of the page.