rhodes 3.3.1 → 3.3.2.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (157) hide show
  1. data/CHANGELOG +9 -2
  2. data/Manifest.txt +20 -0
  3. data/Rakefile +2 -1
  4. data/doc/build.txt +9 -3
  5. data/doc/configuration.txt +5 -1
  6. data/doc/device-caps.txt +112 -27
  7. data/doc/extensions.txt +0 -51
  8. data/doc/generator.txt +6 -0
  9. data/doc/rhom.txt +3 -0
  10. data/doc/simulator.txt +57 -17
  11. data/doc/ui.txt +24 -27
  12. data/installer/RHOELEMENTS-EULA.txt +295 -0
  13. data/installer/Rakefile +75 -49
  14. data/installer/rhostudio-moto.nsi +534 -0
  15. data/installer/rhostudio.nsi +13 -4
  16. data/lib/extensions/barcode/ext/barcode/platform/iphone/Classes/barcode.m +3 -0
  17. data/lib/framework/rho/rhoapplication.rb +4 -0
  18. data/lib/framework/rho/rhoevent.rb +2 -3
  19. data/lib/framework/rho/rhoevent_c.rb +2 -2
  20. data/lib/framework/rho/rhofsconnector.rb +24 -2
  21. data/lib/framework/rhodes.rb +1 -1
  22. data/lib/framework/version.rb +1 -1
  23. data/lib/rhodes.rb +1 -1
  24. data/platform/android/Rhodes/AndroidManifest.xml +3 -3
  25. data/platform/android/Rhodes/gen/com/rhomobile/rhodes/R.java +164 -90
  26. data/platform/android/Rhodes/jni/src/signature.cpp +13 -3
  27. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhoCryptImpl.java +76 -34
  28. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivity.java +3 -4
  29. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +1 -1
  30. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SplashScreen.java +10 -2
  31. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/AnnotationsOverlay.java +0 -3
  32. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/Callout.java +6 -5
  33. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/GoogleMapView.java +0 -1
  34. data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/ImageCapture.java +7 -1
  35. data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/Signature.java +46 -6
  36. data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/SignatureView.java +29 -1
  37. data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/ChromeClientOld.java +2 -0
  38. data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/GoogleWebView.java +4 -0
  39. data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoWebSettingsOld.java +10 -2
  40. data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoWebViewClient.java +3 -2
  41. data/platform/android/build/android.rake +6 -27
  42. data/platform/android/build/androidcommon.rb +1 -1
  43. data/platform/bb/rhodes/src/com/rho/rubyext/GeoLocation.java +26 -0
  44. data/platform/iphone/Classes/AppManager/AppManager.h +1 -0
  45. data/platform/iphone/Classes/AppManager/AppManager.m +70 -12
  46. data/platform/iphone/Classes/Camera/PickImageDelegate.m +1 -1
  47. data/platform/iphone/Classes/Event/Event.m +38 -3
  48. data/platform/iphone/Classes/Rhodes.m +3 -2
  49. data/platform/iphone/Classes/Signature/SignatureDelegate.m +1 -1
  50. data/platform/iphone/Info.plist +1 -1
  51. data/platform/iphone/rbuild/iphone.rake +8 -8
  52. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Frameworks/QtCore.framework/Versions/4/QtCore +0 -0
  53. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Frameworks/QtGui.framework/Versions/4/QtGui +0 -0
  54. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Frameworks/QtNetwork.framework/Versions/4/QtNetwork +0 -0
  55. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Frameworks/QtWebKit.framework/Versions/4/QtWebKit +0 -0
  56. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Frameworks/phonon.framework/Versions/4/phonon +0 -0
  57. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Info.plist +1 -1
  58. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/MacOS/RhoSimulator +0 -0
  59. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/accessible/libqtaccessiblewidgets.dylib +0 -0
  60. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/bearer/libqcorewlanbearer.dylib +0 -0
  61. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/bearer/libqgenericbearer.dylib +0 -0
  62. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/codecs/libqcncodecs.dylib +0 -0
  63. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/codecs/libqjpcodecs.dylib +0 -0
  64. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/codecs/libqkrcodecs.dylib +0 -0
  65. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/codecs/libqtwcodecs.dylib +0 -0
  66. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/graphicssystems/libqtracegraphicssystem.dylib +0 -0
  67. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/imageformats/libqgif.dylib +0 -0
  68. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/imageformats/libqico.dylib +0 -0
  69. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/imageformats/libqjpeg.dylib +0 -0
  70. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/imageformats/libqmng.dylib +0 -0
  71. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/imageformats/libqtiff.dylib +0 -0
  72. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/phonon_backend/libphonon_qt7.dylib +0 -0
  73. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/qmltooling/libqmldbg_tcp.dylib +0 -0
  74. data/platform/osx/bin/RhoSimulator/RhoSimulatorMac.zip +0 -0
  75. data/platform/osx/build/osx.rake +1 -1
  76. data/platform/shared/RhoConnectClient/RhoConnectClient.cpp +1 -1
  77. data/platform/shared/common/RhoConf.cpp +15 -6
  78. data/platform/shared/common/RhoConf.h +6 -1
  79. data/platform/shared/common/RhodesApp.cpp +19 -6
  80. data/platform/shared/common/RhodesApp.h +4 -2
  81. data/platform/shared/common/RhodesAppBase.cpp +18 -10
  82. data/platform/shared/common/RhodesAppBase.h +6 -3
  83. data/platform/shared/common/map/GeocodingMapEngine.h +2 -2
  84. data/platform/shared/logging/RhoLogConf.cpp +14 -8
  85. data/platform/shared/logging/RhoLogConf.h +1 -0
  86. data/platform/shared/net/HttpServer.cpp +15 -3
  87. data/platform/shared/net/HttpServer.h +2 -1
  88. data/platform/shared/qt/curl/curl.pro +1 -1
  89. data/platform/shared/qt/rhodes/QtMainWindow.h +1 -1
  90. data/platform/shared/qt/rhodes/impl/MainWindowImpl.cpp +2 -2
  91. data/platform/shared/qt/rhodes/main.cpp +2 -1
  92. data/platform/shared/ruby/ext/rho/rhoruby.c +1 -0
  93. data/platform/shared/ruby/ext/rho/rhosupport.c +11 -1
  94. data/platform/shared/sync/SyncNotify.cpp +1 -2
  95. data/platform/shared/sync/SyncNotify.h +2 -2
  96. data/platform/shared/sync/SyncThread.cpp +27 -12
  97. data/platform/shared/sync/SyncThread.h +2 -0
  98. data/platform/shared/unzip/unzip.cpp +3 -2
  99. data/platform/win32/RhoSimulator/Microsoft.VC80.CRT.manifest +8 -0
  100. data/platform/win32/RhoSimulator/Microsoft.VC80.OpenMP.manifest +7 -0
  101. data/platform/win32/RhoSimulator/QtCore4.dll +0 -0
  102. data/platform/win32/RhoSimulator/QtGui4.dll +0 -0
  103. data/platform/win32/RhoSimulator/QtNetwork4.dll +0 -0
  104. data/platform/win32/RhoSimulator/QtWebKit4.dll +0 -0
  105. data/platform/win32/RhoSimulator/RhoSimulator.exe +0 -0
  106. data/platform/win32/RhoSimulator/imageformats/qgif4.dll +0 -0
  107. data/platform/win32/RhoSimulator/imageformats/qico4.dll +0 -0
  108. data/platform/win32/RhoSimulator/imageformats/qjpeg4.dll +0 -0
  109. data/platform/win32/RhoSimulator/imageformats/qmng4.dll +0 -0
  110. data/platform/win32/RhoSimulator/imageformats/qsvg4.dll +0 -0
  111. data/platform/win32/RhoSimulator/imageformats/qtiff4.dll +0 -0
  112. data/platform/win32/RhoSimulator/libeay32.dll +0 -0
  113. data/platform/win32/RhoSimulator/msvcm80.dll +0 -0
  114. data/platform/win32/RhoSimulator/msvcp80.dll +0 -0
  115. data/platform/win32/RhoSimulator/msvcr80.dll +0 -0
  116. data/platform/win32/RhoSimulator/ssleay32.dll +0 -0
  117. data/platform/win32/RhoSimulator/vcomp.dll +0 -0
  118. data/platform/wm/build/rhodes.nsi +316 -0
  119. data/platform/wm/build/wm.rake +57 -10
  120. data/platform/wm/rhodes/Rhodes.cpp +2 -1
  121. data/platform/wm/rhodes/rhodes.vcproj +2 -0
  122. data/platform/wm/tools/wmdc_connect.sln +20 -0
  123. data/platform/wm/tools/wmdc_connect/stdafx.cpp +27 -0
  124. data/platform/wm/tools/wmdc_connect/stdafx.h +35 -0
  125. data/platform/wm/tools/wmdc_connect/wmdc_connect.cpp +119 -0
  126. data/platform/wm/tools/wmdc_connect/wmdc_connect.vcproj +205 -0
  127. data/platform/wp7/RhoRubyExtGen/RhoAlert.cs +73 -0
  128. data/platform/wp7/RhoRubyExtGen/RhoRubyExtGen.csproj +1 -0
  129. data/platform/wp7/RhoRubyExtGen/RhoSyncEngine.cs +8 -8
  130. data/platform/wp7/RhoRubyLib/Initializers.Generated.cs +47 -6
  131. data/platform/wp7/RhoRubyLib/RhoRuby.cs +8 -0
  132. data/platform/wp7/RhoRubyLib/RhoRubyLib.csproj +5 -0
  133. data/platform/wp7/RhoRubyLib/WP_PlatformAdaptationLayer.cs +5 -0
  134. data/platform/wp7/RhoRubyLib/common/RhoParams.cs +2 -1
  135. data/platform/wp7/RhoRubyLib/common/RhodesApp.cs +58 -37
  136. data/platform/wp7/RhoRubyLib/db/DBAdapter.cs +37 -0
  137. data/platform/wp7/RhoRubyLib/db/DBAttrManager.cs +63 -1
  138. data/platform/wp7/RhoRubyLib/db/IDBStorage.cs +2 -0
  139. data/platform/wp7/RhoRubyLib/db/SqliteStorage.cs +27 -0
  140. data/platform/wp7/RhoRubyLib/logging/RhoLogServerSink.cs +2 -2
  141. data/platform/wp7/RhoRubyLib/net/NetRequest.cs +4 -3
  142. data/platform/wp7/RhoRubyLib/rubyext/RhoAlert.cs +160 -0
  143. data/platform/wp7/RhoRubyLib/rubyext/RhoSyncEngine.cs +44 -12
  144. data/platform/wp7/RhoRubyLib/sync/ClientRegister.cs +4 -3
  145. data/platform/wp7/RhoRubyLib/sync/SyncEngine.cs +27 -32
  146. data/platform/wp7/RhoRubyLib/sync/SyncNotify.cs +31 -11
  147. data/platform/wp7/RhoRubyLib/sync/SyncProtocol_3.cs +6 -1
  148. data/platform/wp7/RhoRubyLib/sync/SyncSource.cs +4 -0
  149. data/platform/wp7/RhoRubyLib/sync/SyncThread.cs +21 -15
  150. data/platform/wp7/build/wp.rake +6 -0
  151. data/rakefile.rb +2 -1
  152. data/res/build-tools/Coding4Fun.Phone.Controls.dll +0 -0
  153. data/res/build-tools/wmdc_connect.exe +0 -0
  154. data/res/generators/templates/spec/app/SpecRunner/index.erb +14 -13
  155. data/spec/phone_spec/app/spec/rhom_object_spec.rb +10 -1
  156. data/version +1 -1
  157. metadata +26 -4
@@ -0,0 +1,73 @@
1
+ /*------------------------------------------------------------------------
2
+ * (The MIT License)
3
+ *
4
+ * Copyright (c) 2008-2011 Rhomobile, Inc.
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in
14
+ * all copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
+ * THE SOFTWARE.
23
+ *
24
+ * http://rhomobile.com
25
+ *------------------------------------------------------------------------*/
26
+
27
+ using Microsoft.Scripting.Utils;
28
+ using Microsoft.Scripting.Runtime;
29
+ using IronRuby.Runtime;
30
+ using IronRuby.Builtins;
31
+ using System;
32
+ using System.Runtime.InteropServices;
33
+
34
+ namespace rho.rubyext
35
+ {
36
+ [RubyModule("Alert")]
37
+ public static class RhoAlert
38
+ {
39
+ #region Private Implementation Details
40
+
41
+ #endregion
42
+
43
+ #region Private Instance & Singleton Methods
44
+
45
+ [RubyMethodAttribute("show_popup", RubyMethodAttributes.PublicSingleton)]
46
+ public static void ShowPopup(RubyModule/*!*/ self, Hash args)
47
+ {
48
+
49
+ }
50
+
51
+ [RubyMethodAttribute("hide_popup", RubyMethodAttributes.PublicSingleton)]
52
+ public static void HidePopup(RubyModule/*!*/ self)
53
+ {
54
+ }
55
+
56
+ [RubyMethodAttribute("vibrate", RubyMethodAttributes.PublicSingleton)]
57
+ public static void Vibrate(RubyModule/*!*/ self, int duration)
58
+ {
59
+ }
60
+
61
+ [RubyMethodAttribute("play_file", RubyMethodAttributes.PublicSingleton)]
62
+ public static void PlayFile(RubyModule/*!*/ self, [NotNull]String/*!*/ fileName, [NotNull]String/*!*/ mediaType)
63
+ {
64
+ }
65
+
66
+ [RubyMethodAttribute("show_status", RubyMethodAttributes.PublicSingleton)]
67
+ public static void ShowStatus(RubyModule/*!*/ self, [NotNull]String/*!*/ title, [NotNull]String/*!*/ text, String/*!*/ hideLabel)
68
+ {
69
+ }
70
+
71
+ #endregion
72
+ }
73
+ }
@@ -53,6 +53,7 @@
53
53
  <Reference Include="System.Xml" />
54
54
  </ItemGroup>
55
55
  <ItemGroup>
56
+ <Compile Include="RhoAlert.cs" />
56
57
  <Compile Include="RhoAsyncHttp.cs" />
57
58
  <Compile Include="RhoCamera.cs" />
58
59
  <Compile Include="RhoConfig.cs" />
@@ -37,28 +37,28 @@ namespace rho.rubyext
37
37
  public static class RhoSyncEngine
38
38
  {
39
39
  [RubyMethod("dosync", RubyMethodAttributes.PublicSingleton)]
40
- public static object dosync(RubyModule/*!*/ self)
40
+ public static object dosync(RubyModule/*!*/ self, RubyArray args)
41
41
  {
42
42
  return null;
43
43
  }
44
44
 
45
- [RubyMethod("dosync", RubyMethodAttributes.PublicSingleton)]
46
- public static object dosync(RubyModule/*!*/ self, bool/*!*/ show_status_popup)
45
+ /*[RubyMethod("dosync", RubyMethodAttributes.PublicSingleton)]
46
+ public static object dosync(RubyModule self, bool show_status_popup)
47
47
  {
48
48
  return null;
49
- }
49
+ }*/
50
50
 
51
51
  [RubyMethod("dosync_source", RubyMethodAttributes.PublicSingleton)]
52
- public static object dosync_source(RubyModule/*!*/ self, [NotNull]object/*!*/ srcID)
52
+ public static object dosync_source(RubyModule/*!*/ self, RubyArray args)
53
53
  {
54
54
  return null;
55
55
  }
56
56
 
57
- [RubyMethod("dosync_source", RubyMethodAttributes.PublicSingleton)]
58
- public static object dosync_source(RubyModule/*!*/ self, [NotNull]object/*!*/ srcID, bool/*!*/ show_status_popup)
57
+ /*[RubyMethod("dosync_source", RubyMethodAttributes.PublicSingleton)]
58
+ public static object dosync_source(RubyModule self, [NotNull]object srcID, bool show_status_popup)
59
59
  {
60
60
  return null;
61
- }
61
+ }*/
62
62
 
63
63
  [RubyMethod("dosearch", RubyMethodAttributes.PublicSingleton)]
64
64
  public static object dosearch(RubyModule/*!*/ self, [NotNull]RubyArray/*!*/ arSources, [NotNull]String/*!*/ from, [NotNull]String/*!*/ strParams,
@@ -26,6 +26,8 @@ namespace rho.rubyext {
26
26
  IronRuby.Builtins.RubyClass classRef0 = GetClass(typeof(System.Object));
27
27
 
28
28
 
29
+ DefineGlobalModule("Alert", typeof(rho.rubyext.RhoAlert), 0x00000008, null, LoadAlert_Class, null, IronRuby.Builtins.RubyModule.EmptyArray);
30
+ DefineGlobalModule("Camera", typeof(rho.rubyext.RhoCamera), 0x00000008, null, LoadCamera_Class, null, IronRuby.Builtins.RubyModule.EmptyArray);
29
31
  DefineGlobalModule("NativeBar", typeof(rho.rubyext.RhoNativeBar), 0x00000008, null, LoadNativeBar_Class, null, IronRuby.Builtins.RubyModule.EmptyArray);
30
32
  IronRuby.Builtins.RubyModule def3 = DefineGlobalModule("Rho", typeof(rho.rubyext.RhoRoot), 0x00000008, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray);
31
33
  IronRuby.Builtins.RubyModule def1 = DefineGlobalModule("Rho", typeof(rho.rubyext.Rho), 0x00000008, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray);
@@ -44,6 +46,47 @@ namespace rho.rubyext {
44
46
  SetConstant(def5, "Database", def6);
45
47
  }
46
48
 
49
+ private static void LoadAlert_Class(IronRuby.Builtins.RubyModule/*!*/ module) {
50
+ DefineLibraryMethod(module, "hide_popup", 0x21,
51
+ 0x00000000U,
52
+ new Action<IronRuby.Builtins.RubyModule>(rho.rubyext.RhoAlert.HidePopup)
53
+ );
54
+
55
+ DefineLibraryMethod(module, "play_file", 0x21,
56
+ 0x00000006U,
57
+ new Action<IronRuby.Builtins.RubyModule, System.String, System.String>(rho.rubyext.RhoAlert.PlayFile)
58
+ );
59
+
60
+ DefineLibraryMethod(module, "show_popup", 0x21,
61
+ 0x00000000U,
62
+ new Action<IronRuby.Builtins.RubyModule, IronRuby.Builtins.Hash>(rho.rubyext.RhoAlert.ShowPopup)
63
+ );
64
+
65
+ DefineLibraryMethod(module, "show_status", 0x21,
66
+ 0x00000006U,
67
+ new Action<IronRuby.Builtins.RubyModule, System.String, System.String, System.String>(rho.rubyext.RhoAlert.ShowStatus)
68
+ );
69
+
70
+ DefineLibraryMethod(module, "vibrate", 0x21,
71
+ 0x00000000U,
72
+ new Action<IronRuby.Builtins.RubyModule, System.Int32>(rho.rubyext.RhoAlert.Vibrate)
73
+ );
74
+
75
+ }
76
+
77
+ private static void LoadCamera_Class(IronRuby.Builtins.RubyModule/*!*/ module) {
78
+ DefineLibraryMethod(module, "choose_picture", 0x21,
79
+ 0x00000002U,
80
+ new Action<IronRuby.Builtins.RubyModule, System.String>(rho.rubyext.RhoCamera.choosePicture)
81
+ );
82
+
83
+ DefineLibraryMethod(module, "take_picture", 0x21,
84
+ 0x00000002U,
85
+ new Action<IronRuby.Builtins.RubyModule, System.String>(rho.rubyext.RhoCamera.takePicture)
86
+ );
87
+
88
+ }
89
+
47
90
  private static void LoadNativeBar_Class(IronRuby.Builtins.RubyModule/*!*/ module) {
48
91
  DefineLibraryMethod(module, "create", 0x21,
49
92
  0x00000000U,
@@ -242,15 +285,13 @@ namespace rho.rubyext {
242
285
  );
243
286
 
244
287
  DefineLibraryMethod(module, "dosync", 0x21,
245
- 0x00000000U, 0x00000000U,
246
- new Func<IronRuby.Builtins.RubyModule, System.Object>(rho.rubyext.RhoSyncEngine.dosync),
247
- new Func<IronRuby.Builtins.RubyModule, System.Boolean, System.Object>(rho.rubyext.RhoSyncEngine.dosync)
288
+ 0x00000000U,
289
+ new Func<IronRuby.Builtins.RubyModule, IronRuby.Builtins.RubyArray, System.Object>(rho.rubyext.RhoSyncEngine.dosync)
248
290
  );
249
291
 
250
292
  DefineLibraryMethod(module, "dosync_source", 0x21,
251
- 0x00000002U, 0x00000002U,
252
- new Func<IronRuby.Builtins.RubyModule, System.Object, System.Object>(rho.rubyext.RhoSyncEngine.dosync_source),
253
- new Func<IronRuby.Builtins.RubyModule, System.Object, System.Boolean, System.Object>(rho.rubyext.RhoSyncEngine.dosync_source)
293
+ 0x00000000U,
294
+ new Func<IronRuby.Builtins.RubyModule, IronRuby.Builtins.RubyArray, System.Object>(rho.rubyext.RhoSyncEngine.dosync_source)
254
295
  );
255
296
 
256
297
  DefineLibraryMethod(module, "enable_status_popup", 0x21,
@@ -392,6 +392,14 @@ namespace rho
392
392
  return MutableString.Create(str);
393
393
  }
394
394
 
395
+ public static object CreateSymbol(String name)
396
+ {
397
+ if (m_instance != null && m_instance.rubyContext != null)
398
+ return (object)m_instance.rubyContext.CreateSymbol(name, RubyEncoding.UTF8);
399
+
400
+ return (object)name;
401
+ }
402
+
395
403
  public static Hashtable<String, String> enum_strhash(Object valHash)
396
404
  {
397
405
  Hashtable<String, String> hash = new Hashtable<String, String>();
@@ -45,6 +45,9 @@
45
45
  <WarningLevel>4</WarningLevel>
46
46
  </PropertyGroup>
47
47
  <ItemGroup>
48
+ <Reference Include="Coding4Fun.Phone.Controls">
49
+ <HintPath>..\..\..\res\build-tools\Coding4Fun.Phone.Controls.dll</HintPath>
50
+ </Reference>
48
51
  <Reference Include="IronRuby">
49
52
  <HintPath>..\ironruby\bin\Silverlight3$(Configuration)\IronRuby.dll</HintPath>
50
53
  </Reference>
@@ -118,6 +121,7 @@
118
121
  <Compile Include="net\NetRequest.cs" />
119
122
  <Compile Include="net\HttpServer.cs" />
120
123
  <Compile Include="Properties\AssemblyInfo.cs" />
124
+ <Compile Include="rubyext\RhoAlert.cs" />
121
125
  <Compile Include="rubyext\RhoAsyncHttp.cs" />
122
126
  <Compile Include="rubyext\RhoCamera.cs" />
123
127
  <Compile Include="rubyext\RhoConfig.cs" />
@@ -168,6 +172,7 @@
168
172
  <SubType>Designer</SubType>
169
173
  </Page>
170
174
  </ItemGroup>
175
+ <ItemGroup />
171
176
  <Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight for Phone\$(TargetFrameworkVersion)\Microsoft.Silverlight.$(TargetFrameworkProfile).Overrides.targets" />
172
177
  <Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight for Phone\$(TargetFrameworkVersion)\Microsoft.Silverlight.CSharp.targets" />
173
178
  <ProjectExtensions />
@@ -41,6 +41,11 @@ namespace rho
41
41
  return CRhoFile.isResourceFileExist(path) || CRhoFile.isFileExist(path);
42
42
  }
43
43
 
44
+ public override void DeleteFile(string path, bool deleteReadOnly)
45
+ {
46
+ CRhoFile.deleteFile(path);
47
+ }
48
+
44
49
  public override string GetDirectoryName(string path)
45
50
  {
46
51
  return Path.GetDirectoryName(CFilePath.removeLastSlash(path));
@@ -33,6 +33,7 @@ namespace rho.common
33
33
  {
34
34
  public class RhoParams
35
35
  {
36
+
36
37
  protected Object m_pParams;
37
38
 
38
39
  public RhoParams(Object p)
@@ -52,7 +53,7 @@ namespace rho.common
52
53
 
53
54
  Object val = null;
54
55
  Hash values = (Hash)m_pParams;
55
- values.TryGetValue((object)MutableString.Create(name), out val);
56
+ values.TryGetValue(CRhoRuby.CreateSymbol(name), out val);
56
57
  return (val != null) ? val : null;
57
58
  }
58
59
 
@@ -54,6 +54,7 @@ namespace rho.common
54
54
 
55
55
  private WebBrowser m_webBrowser;
56
56
  private PhoneApplicationPage m_appMainPage;
57
+ public PhoneApplicationPage MainPage { get { return m_appMainPage; } }
57
58
  private Grid m_layoutRoot;
58
59
  private TabControl m_tabControl;
59
60
  private Stack<Uri> m_backHistory = new Stack<Uri>();
@@ -219,24 +220,30 @@ namespace rho.common
219
220
  {
220
221
  m_webBrowser.Dispatcher.BeginInvoke( () =>
221
222
  {
222
- if (index > 0)
223
- {
224
- if (m_tabControl != null && m_tabControl.Items.Count > 0)
223
+ try{
224
+ if (index > 0)
225
+ {
226
+ if (m_tabControl != null && m_tabControl.Items.Count > 0)
227
+ {
228
+ ((RhoView)((TabItem)m_tabControl.Items[index]).Content).webBrowser1.IsScriptEnabled = true;
229
+ if (isExternalUrl(strUrl))
230
+ ((RhoView)((TabItem)m_tabControl.Items[index]).Content).webBrowser1.Navigate(new Uri(strUrl, UriKind.Absolute));
231
+ else
232
+ ((RhoView)((TabItem)m_tabControl.Items[index]).Content).webBrowser1.Navigate(new Uri(strUrl, UriKind.Relative));
233
+ }
234
+ }
235
+ else
225
236
  {
226
- ((RhoView)((TabItem)m_tabControl.Items[index]).Content).webBrowser1.IsScriptEnabled = true;
237
+ m_webBrowser.IsScriptEnabled = true;
227
238
  if (isExternalUrl(strUrl))
228
- ((RhoView)((TabItem)m_tabControl.Items[index]).Content).webBrowser1.Navigate(new Uri(strUrl, UriKind.Absolute));
239
+ m_webBrowser.Navigate(new Uri(strUrl, UriKind.Absolute));
229
240
  else
230
- ((RhoView)((TabItem)m_tabControl.Items[index]).Content).webBrowser1.Navigate(new Uri(strUrl, UriKind.Relative));
241
+ m_webBrowser.Navigate(new Uri(strUrl, UriKind.Relative));
231
242
  }
232
243
  }
233
- else
244
+ catch (Exception exc)
234
245
  {
235
- m_webBrowser.IsScriptEnabled = true;
236
- if (isExternalUrl(strUrl))
237
- m_webBrowser.Navigate(new Uri(strUrl, UriKind.Absolute));
238
- else
239
- m_webBrowser.Navigate(new Uri(strUrl, UriKind.Relative));
246
+ LOG.ERROR("WebView.navigate failed : " + strUrl + ", index: " + index, exc);
240
247
  }
241
248
  });
242
249
  }
@@ -245,16 +252,23 @@ namespace rho.common
245
252
  {
246
253
  m_webBrowser.Dispatcher.BeginInvoke(() =>
247
254
  {
248
- if (index > 0)
255
+ try
249
256
  {
250
- if (m_tabControl != null && m_tabControl.Items.Count > 0)
257
+ if (index > 0)
258
+ {
259
+ if (m_tabControl != null && m_tabControl.Items.Count > 0)
260
+ {
261
+ ((RhoView)((TabItem)m_tabControl.Items[index]).Content).webBrowser1.Navigate(m_webBrowser.Source);
262
+ }
263
+ }
264
+ else
251
265
  {
252
- ((RhoView)((TabItem)m_tabControl.Items[index]).Content).webBrowser1.Navigate(m_webBrowser.Source);
266
+ m_webBrowser.Navigate(m_webBrowser.Source);
253
267
  }
254
268
  }
255
- else
269
+ catch (Exception exc)
256
270
  {
257
- m_webBrowser.Navigate(m_webBrowser.Source);
271
+ LOG.ERROR("WebView.refresh failed : " + index, exc);
258
272
  }
259
273
  });
260
274
  }
@@ -277,16 +291,23 @@ namespace rho.common
277
291
 
278
292
  m_webBrowser.Dispatcher.BeginInvoke(() =>
279
293
  {
280
- if (index > 0)
294
+ try
281
295
  {
282
- if (m_tabControl != null && m_tabControl.Items.Count > 0)
296
+ if (index > 0)
283
297
  {
284
- ((RhoView)((TabItem)m_tabControl.Items[index]).Content).webBrowser1.InvokeScript(arr[0], arrParams);
298
+ if (m_tabControl != null && m_tabControl.Items.Count > 0)
299
+ {
300
+ ((RhoView)((TabItem)m_tabControl.Items[index]).Content).webBrowser1.InvokeScript(arr[0], arrParams);
301
+ }
302
+ }
303
+ else
304
+ {
305
+ m_webBrowser.InvokeScript(arr[0], arrParams);
285
306
  }
286
307
  }
287
- else
308
+ catch (Exception exc)
288
309
  {
289
- m_webBrowser.InvokeScript(arr[0], arrParams);
310
+ LOG.ERROR("WebView.execute_js failed: " + arr[0] + "(" + String.Join(",", arrParams), exc);
290
311
  }
291
312
  });
292
313
  }
@@ -369,11 +390,11 @@ namespace rho.common
369
390
  object val = null;
370
391
 
371
392
  Hash values = (Hash)hashArray[i];
372
- if (values.TryGetValue((object)MutableString.Create("action"), out val))
393
+ if (values.TryGetValue(CRhoRuby.CreateSymbol("action"), out val))
373
394
  action = val.ToString();
374
- if (values.TryGetValue((object)MutableString.Create("icon"), out val))
395
+ if (values.TryGetValue(CRhoRuby.CreateSymbol("icon"), out val))
375
396
  icon = val.ToString();
376
- if (values.TryGetValue((object)MutableString.Create("label"), out val))
397
+ if (values.TryGetValue(CRhoRuby.CreateSymbol("label"), out val))
377
398
  label = val.ToString();
378
399
 
379
400
  if (label == null && barType == 0)
@@ -462,10 +483,10 @@ namespace rho.common
462
483
  else
463
484
  paramHash = (Hash)barParams;
464
485
 
465
- if (paramHash != null && paramHash.TryGetValue((object)MutableString.Create("background_color"), out val))
486
+ if (paramHash != null && paramHash.TryGetValue(CRhoRuby.CreateSymbol("background_color"), out val))
466
487
  m_appMainPage.ApplicationBar.BackgroundColor = getColorFromString(val.ToString());
467
488
 
468
- if (paramHash != null && paramHash.TryGetValue((object)MutableString.Create("buttons"), out val) && val is RubyArray)
489
+ if (paramHash != null && paramHash.TryGetValue(CRhoRuby.CreateSymbol("buttons"), out val) && val is RubyArray)
469
490
  hashArray = ((RubyArray)val).ToArray();
470
491
 
471
492
  createToolBarButtons(barType, hashArray);
@@ -643,17 +664,17 @@ namespace rho.common
643
664
  object val = null;
644
665
 
645
666
  Hash values = (Hash)hashArray[i];
646
- if (values.TryGetValue((object)MutableString.Create("action"), out val))
667
+ if (values.TryGetValue(CRhoRuby.CreateSymbol("action"), out val))
647
668
  action = val.ToString();
648
- if (values.TryGetValue((object)MutableString.Create("icon"), out val))
669
+ if (values.TryGetValue(CRhoRuby.CreateSymbol("icon"), out val))
649
670
  icon = val.ToString();
650
- if (values.TryGetValue((object)MutableString.Create("label"), out val))
671
+ if (values.TryGetValue(CRhoRuby.CreateSymbol("label"), out val))
651
672
  label = val.ToString();
652
- if (values.TryGetValue((object)MutableString.Create("reload"), out val))
673
+ if (values.TryGetValue(CRhoRuby.CreateSymbol("reload"), out val))
653
674
  reload = Convert.ToBoolean(val);
654
- if (values.TryGetValue((object)MutableString.Create("web_bkg_color"), out val))
675
+ if (values.TryGetValue(CRhoRuby.CreateSymbol("web_bkg_color"), out val))
655
676
  web_bkg_color = new SolidColorBrush(getColorFromString(val.ToString()));
656
- if (values.TryGetValue((object)MutableString.Create("use_current_view_for_tab"), out val))
677
+ if (values.TryGetValue(CRhoRuby.CreateSymbol("use_current_view_for_tab"), out val))
657
678
  use_current_view_for_tab = Convert.ToBoolean(val);
658
679
 
659
680
  //if (label == null && barType == 0)
@@ -673,9 +694,9 @@ namespace rho.common
673
694
  tabItem.Header = new RhoTabHeader(label, icon);
674
695
  //if (i == 0)// && use_current_view_for_tab)
675
696
  tabItem.Content = new RhoView(m_appMainPage, m_layoutRoot, action, reload, web_bkg_color);
676
- if (values.TryGetValue((object)MutableString.Create("selected_color"), out val))
697
+ if (values.TryGetValue(CRhoRuby.CreateSymbol("selected_color"), out val))
677
698
  tabItem.Background = new SolidColorBrush(getColorFromString(val.ToString()));
678
- if (values.TryGetValue((object)MutableString.Create("disabled"), out val))
699
+ if (values.TryGetValue(CRhoRuby.CreateSymbol("disabled"), out val))
679
700
  tabItem.IsEnabled = !Convert.ToBoolean(val);
680
701
  m_tabControl.Items.Add(tabItem);
681
702
  }
@@ -701,10 +722,10 @@ namespace rho.common
701
722
  else
702
723
  paramHash = (Hash)tabBarParams;
703
724
 
704
- if (paramHash != null && paramHash.TryGetValue((object)MutableString.Create("background_color"), out val))
725
+ if (paramHash != null && paramHash.TryGetValue(CRhoRuby.CreateSymbol("background_color"), out val))
705
726
  m_tabControl.Background = new SolidColorBrush(getColorFromString(val.ToString()));
706
727
 
707
- if (paramHash != null && paramHash.TryGetValue((object)MutableString.Create("tabs"), out val) && val is RubyArray)
728
+ if (paramHash != null && paramHash.TryGetValue(CRhoRuby.CreateSymbol("tabs"), out val) && val is RubyArray)
708
729
  hashArray = ((RubyArray)val).ToArray();
709
730
 
710
731
  createTabBarButtons(tabBarType, hashArray);