rhodes 3.3.3.beta.1 → 3.3.3.beta.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (146) hide show
  1. data/CHANGELOG +3 -0
  2. data/Manifest.txt +23 -9
  3. data/Rakefile +13 -2
  4. data/doc/build.txt +18 -11
  5. data/doc/device-caps.txt +4 -68
  6. data/doc/rhom.txt +33 -0
  7. data/doc/test-log-debug.txt +18 -42
  8. data/lib/framework/rho/render.rb +1 -1
  9. data/lib/framework/rho/rho.rb +31 -1
  10. data/lib/framework/rho/rhocontroller.rb +2 -2
  11. data/lib/framework/rhodes.rb +1 -1
  12. data/lib/framework/rhoframework.rb +4 -0
  13. data/lib/framework/rholang/localization_simplified.rb +1 -1
  14. data/lib/framework/rhom/rhom_object_factory.rb +22 -1
  15. data/lib/framework/version.rb +1 -1
  16. data/lib/rhodes.rb +1 -1
  17. data/platform/android/Rhodes/AndroidManifest.xml +2 -2
  18. data/platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_RhodesService.h +25 -9
  19. data/platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_extmanager_RhoExtManagerImpl.h +21 -0
  20. data/platform/android/Rhodes/jni/src/extmanager.cpp +36 -0
  21. data/platform/android/Rhodes/jni/src/nativeview.cpp +1 -1
  22. data/platform/android/Rhodes/jni/src/rhodesapp.cpp +14 -5
  23. data/platform/android/Rhodes/jni/src/rhodessystem.cpp +5 -0
  24. data/platform/android/Rhodes/jni/src/signature.cpp +29 -3
  25. data/platform/android/Rhodes/src/com/rhomobile/rhodes/NativeBar.java +3 -3
  26. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivity.java +4 -0
  27. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +42 -7
  28. data/platform/android/Rhodes/src/com/rhomobile/rhodes/WebView.java +61 -10
  29. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/IRhoExtData.java +6 -0
  30. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/IRhoExtManager.java +39 -0
  31. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/IRhoExtension.java +18 -0
  32. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/RhoExtDataImpl.java +18 -0
  33. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/RhoExtManagerImpl.java +142 -0
  34. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/RhoExtManagerSingleton.java +15 -0
  35. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/MainView.java +6 -3
  36. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SimpleMainView.java +25 -13
  37. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SplashScreen.java +15 -9
  38. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/TabbedMainView.java +15 -5
  39. data/platform/android/Rhodes/src/com/rhomobile/rhodes/nativeview/RhoNativeViewManager.java +3 -3
  40. data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/ImageCapture.java +14 -8
  41. data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/Signature.java +218 -51
  42. data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/SignatureProperties.java +94 -0
  43. data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/SignatureView.java +122 -37
  44. data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/GoogleWebView.java +6 -2
  45. data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/{WebView.java → IRhoWebView.java} +2 -1
  46. data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoWebViewClient.java +4 -0
  47. data/platform/android/build/RhodesSRC_build.files +8 -1
  48. data/platform/android/build/android.rake +5 -1
  49. data/platform/android/build/librhodes_build.files +1 -0
  50. data/platform/bb/RubyVM/src/com/rho/RhodesApp.java +22 -1
  51. data/platform/bb/RubyVM/src/com/rho/sync/SyncSource.java +15 -0
  52. data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RhoSupport.java +4 -0
  53. data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyRuntime.java +4 -2
  54. data/platform/bb/build/rhodes_build.files +2 -0
  55. data/platform/bb/rhodes/src/com/rho/RhoRubyHelper.java +1 -1
  56. data/platform/bb/rhodes/src/com/rho/rubyext/PNGEncoder.java +613 -0
  57. data/platform/bb/rhodes/src/com/rho/rubyext/SignatureCapture.java +314 -0
  58. data/platform/bb/rhodes/src/com/rho/rubyext/WebView.java +1 -1
  59. data/platform/iphone/Classes/AppManager/AppManager.m +11 -0
  60. data/platform/iphone/Classes/Rhodes.m +1 -1
  61. data/platform/iphone/Classes/Signature/SignatureDelegate.h +5 -1
  62. data/platform/iphone/Classes/Signature/SignatureDelegate.m +186 -5
  63. data/platform/iphone/Classes/Signature/SignatureView.h +12 -0
  64. data/platform/iphone/Classes/Signature/SignatureView.m +11 -3
  65. data/platform/iphone/Classes/SimpleMainView.m +4 -0
  66. data/platform/iphone/Classes/rho/net/NetRequestImpl.m +98 -3
  67. data/platform/iphone/Info.plist +1 -1
  68. data/platform/iphone/rbuild/iphone.rake +18 -5
  69. data/platform/shared/RhoConnectClient/RhoConnectClient.cpp +1 -1
  70. data/platform/shared/common/ExtManager.h +64 -9
  71. data/platform/shared/common/RhoSimConf.h +1 -0
  72. data/platform/shared/common/RhodesApp.cpp +77 -28
  73. data/platform/shared/common/RhodesApp.h +9 -4
  74. data/platform/shared/common/RhodesAppBase.cpp +4 -3
  75. data/platform/shared/common/RhodesAppBase.h +5 -3
  76. data/platform/shared/net/HttpServer.cpp +4 -4
  77. data/platform/shared/net/HttpServer.h +2 -2
  78. data/platform/shared/qt/rhodes/impl/MainWindowImpl.cpp +1 -1
  79. data/platform/shared/qt/rhodes/main.cpp +1 -1
  80. data/platform/shared/ruby/ext/rho/rhoruby.c +12 -2
  81. data/platform/shared/ruby/ext/rho/rhosupport.c +11 -1
  82. data/platform/shared/ruby/thread_win32.c +2 -1
  83. data/platform/shared/rubyext/System.cpp +6 -0
  84. data/platform/shared/sync/SyncSource.cpp +15 -0
  85. data/platform/wm/RhoLib/RhoLib.vcproj +0 -4
  86. data/platform/wm/build/build_inf.js +34 -4
  87. data/platform/wm/build/wm.rake +75 -25
  88. data/platform/wm/rhodes/AppManager.cpp +14 -3
  89. data/platform/wm/rhodes/IBrowserEngine.h +7 -0
  90. data/platform/wm/rhodes/IEBrowserEngine.cpp +43 -0
  91. data/platform/wm/rhodes/IEBrowserEngine.h +7 -0
  92. data/platform/wm/rhodes/LogOptionsDlg.cpp +1 -1
  93. data/platform/wm/rhodes/MainWindow.cpp +92 -7
  94. data/platform/wm/rhodes/MainWindow.h +28 -1
  95. data/platform/wm/rhodes/MapView/MapViewManager.cpp +4 -4
  96. data/platform/wm/rhodes/Rhodes.cpp +149 -10
  97. data/platform/wm/rhodes/resource.h +5 -1
  98. data/platform/wm/rhodes/rho/common/ExtManager.cpp +307 -0
  99. data/platform/wm/rhodes/rho/rubyext/NativeToolbar.cpp +1 -1
  100. data/platform/wm/rhodes/rho/rubyext/RhoSignature.cpp +1 -1
  101. data/platform/wm/rhodes/rho/rubyext/RhoSignature.h +1 -1
  102. data/platform/wm/rhodes/rho/rubyext/SystemImpl.cpp +14 -2
  103. data/platform/wm/rhodes/rho/rubyext/WebView.cpp +6 -3
  104. data/platform/wm/rhodes/rhodes.vcproj +5 -1
  105. data/platform/wm/rhodes/simulator/MainWindowQt.cpp +22 -1
  106. data/platform/wm/rhodes/simulator/MainWindowQt.h +4 -0
  107. data/platform/wp7/RhoRubyExtGen/RhoWebView.cs +1 -1
  108. data/platform/wp7/RhoRubyLib/Initializers.Generated.cs +1 -1
  109. data/platform/wp7/RhoRubyLib/common/RhodesApp.cs +33 -38
  110. data/platform/wp7/RhoRubyLib/net/HttpServer.cs +134 -29
  111. data/platform/wp7/RhoRubyLib/rubyext/RhoWebView.cs +12 -2
  112. data/platform/wp7/RhoRubyLib/sync/SyncSource.cs +17 -1
  113. data/platform/wp7/RhoRubyLib/views/RhoTabHeader.xaml +3 -3
  114. data/platform/wp7/RhoRubyLib/views/RhoView.xaml.cs +48 -8
  115. data/rakefile.rb +13 -2
  116. data/res/build-tools/iphonesim/build/Release/iphonesim_43 +0 -0
  117. data/res/build-tools/iphonesim/iphonesim.xcodeproj/project.pbxproj +158 -0
  118. data/res/generators/rhogen.rb +33 -28
  119. data/res/generators/templates/application/app/layout.erb +6 -5
  120. data/res/generators/templates/application/public/css/android.css +21 -315
  121. data/res/generators/templates/application/public/css/iphone.css +1 -499
  122. data/res/generators/templates/application/public/css/jqmobile-patch.css +18 -5
  123. data/res/generators/templates/application/public/css/windows_phone7.css +378 -0
  124. data/res/generators/templates/application/public/jqmobile/images/icons-18-black.png +0 -0
  125. data/res/generators/templates/application/public/jqmobile/images/icons-36-black.png +0 -0
  126. data/res/generators/templates/application/public/jqmobile/{jquery.mobile-1.0.css → jquery.mobile-1.0.1.css} +33 -11
  127. data/res/generators/templates/application/public/jqmobile/{jquery.mobile-1.0.js → jquery.mobile-1.0.1.js} +249 -125
  128. data/res/generators/templates/application/public/jqmobile/jquery.mobile-1.0.1.min.css +2 -0
  129. data/res/generators/templates/application/public/jqmobile/jquery.mobile-1.0.1.min.js +177 -0
  130. data/res/generators/templates/application/public/jqmobile/{jquery.mobile.structure-1.0.css → jquery.mobile.structure-1.0.1.css} +33 -11
  131. data/res/generators/templates/application/public/jqmobile/jquery.mobile.structure-1.0.1.min.css +2 -0
  132. data/res/generators/templates/application/public/jquery/jquery.json-2.3.js +193 -0
  133. data/res/generators/templates/application/public/jquery/jquery.json-2.3.min.js +23 -0
  134. data/res/generators/templates/application/public/js/jquery-wp7-patch.js +68 -20
  135. data/spec/phone_spec/app/Case/case.rb +22 -0
  136. data/spec/phone_spec/app/Customer/customer.rb +16 -0
  137. data/spec/phone_spec/app/spec/rhom_object_spec.rb +108 -11
  138. data/spec/phone_spec/app/spec/syncengine_spec.rb +43 -1
  139. data/spec/phone_spec/build.yml +2 -1
  140. data/version +1 -1
  141. metadata +27 -13
  142. data/platform/shared/common/ExtManager.cpp +0 -103
  143. data/res/generators/templates/application/public/jqmobile/jquery-mobile-iphone.css +0 -9
  144. data/res/generators/templates/application/public/jqmobile/jquery.mobile-1.0.min.css +0 -2
  145. data/res/generators/templates/application/public/jqmobile/jquery.mobile-1.0.min.js +0 -172
  146. data/res/generators/templates/application/public/jqmobile/jquery.mobile.structure-1.0.min.css +0 -2
@@ -35,10 +35,8 @@ public class WebView {
35
35
 
36
36
  private static final String TAG = "WebView";
37
37
 
38
- private static void reportFail(String name, Exception e) {
39
- Logger.E(TAG, "Call of \"" + name + "\" failed: " + e.getMessage());
40
- }
41
-
38
+ ///*** NavigateTask ***
39
+ ///
42
40
  private static class NavigateTask implements Runnable {
43
41
  private String url;
44
42
  private int index;
@@ -54,6 +52,8 @@ public class WebView {
54
52
  }
55
53
  };
56
54
 
55
+ ///*** NavigateBackTask ***
56
+ ///
57
57
  private static class NavigateBackTask implements Runnable {
58
58
  public NavigateBackTask(int index) {
59
59
  mIndex = index;
@@ -65,6 +65,21 @@ public class WebView {
65
65
  private int mIndex;
66
66
  };
67
67
 
68
+ ///*** NavigateForwardTask ***
69
+ ///
70
+ private static class NavigateForwardTask implements Runnable {
71
+ public NavigateForwardTask(int index) {
72
+ mIndex = index;
73
+ }
74
+ public void run() {
75
+ RhodesService r = RhodesService.getInstance();
76
+ r.getMainView().forward(mIndex);
77
+ }
78
+ private int mIndex;
79
+ };
80
+
81
+ ///*** RefreshTask ***
82
+ ///
68
83
  private static class RefreshTask implements Runnable {
69
84
  private int index;
70
85
 
@@ -78,6 +93,8 @@ public class WebView {
78
93
  }
79
94
  };
80
95
 
96
+ ///*** SetCookieTask ***
97
+ ///
81
98
  private static class SetCookieTask implements Runnable {
82
99
  private String url;
83
100
  private String cookie;
@@ -94,12 +111,28 @@ public class WebView {
94
111
  }
95
112
  };
96
113
 
114
+ ///*** StopNavigateTask ***
115
+ ///
116
+ private static class StopNavigateTask implements Runnable {
117
+ private int index;
118
+
119
+ public StopNavigateTask(int i) {
120
+ index = i;
121
+ }
122
+
123
+ public void run() {
124
+ RhodesService r = RhodesService.getInstance();
125
+ r.getMainView().stopNavigate(index);
126
+ }
127
+ };
128
+
129
+
97
130
  public static void navigate(String url, int index) {
98
131
  try {
99
132
  PerformOnUiThread.exec(new NavigateTask(url, index));
100
133
  }
101
134
  catch (Exception e) {
102
- reportFail("navigate", e);
135
+ Logger.E(TAG, e);
103
136
  }
104
137
  }
105
138
 
@@ -108,16 +141,25 @@ public class WebView {
108
141
  PerformOnUiThread.exec(new NavigateBackTask(activeTab()));
109
142
  }
110
143
  catch (Exception e) {
111
- reportFail("navigateBack", e);
144
+ Logger.E(TAG, e);
112
145
  }
113
146
  }
114
147
 
148
+ public static void navigateForward() {
149
+ try {
150
+ PerformOnUiThread.exec(new NavigateForwardTask(activeTab()));
151
+ }
152
+ catch (Exception e) {
153
+ Logger.E(TAG, e);
154
+ }
155
+ }
156
+
115
157
  public static void refresh(int index) {
116
158
  try {
117
159
  PerformOnUiThread.exec(new RefreshTask(index));
118
160
  }
119
161
  catch (Exception e) {
120
- reportFail("refresh", e);
162
+ Logger.E(TAG, e);
121
163
  }
122
164
  }
123
165
 
@@ -127,7 +169,7 @@ public class WebView {
127
169
  return r.getMainView().activeTab();
128
170
  }
129
171
  catch (Exception e) {
130
- reportFail("activeTab", e);
172
+ Logger.E(TAG, e);
131
173
  }
132
174
 
133
175
  return 0;
@@ -138,7 +180,7 @@ public class WebView {
138
180
  PerformOnUiThread.exec(new NavigateTask("javascript:" + js, index));
139
181
  }
140
182
  catch (Exception e) {
141
- reportFail("executeJs", e);
183
+ Logger.E(TAG, e);
142
184
  }
143
185
  }
144
186
 
@@ -147,7 +189,16 @@ public class WebView {
147
189
  PerformOnUiThread.exec(new SetCookieTask(url, cookie));
148
190
  }
149
191
  catch (Exception e) {
150
- reportFail("setCookie", e);
192
+ Logger.E(TAG, e);
151
193
  }
152
194
  }
195
+
196
+ public static void stopNavigate() {
197
+ try {
198
+ PerformOnUiThread.exec(new StopNavigateTask(activeTab()));
199
+ }
200
+ catch (Exception e) {
201
+ Logger.E(TAG, e);
202
+ }
203
+ }
153
204
  }
@@ -0,0 +1,6 @@
1
+ package com.rhomobile.rhodes.extmanager;
2
+
3
+ public interface IRhoExtData {
4
+
5
+ int getTabIndex();
6
+ }
@@ -0,0 +1,39 @@
1
+ package com.rhomobile.rhodes.extmanager;
2
+
3
+ import android.view.View;
4
+
5
+ public interface IRhoExtManager {
6
+
7
+ void registerExtension(String strName, IRhoExtension ext);
8
+
9
+ IRhoExtension getExtByName(String strName);
10
+
11
+ View getWebView();
12
+ View getTopView();
13
+
14
+ void onBeforeNavigate(String url);
15
+
16
+ void onUnhandledProperty(String pModuleName,String pName,String pValue, IRhoExtData ext);
17
+ void executeRubyCallback(String szCallback,String szCallbackBody,String szCallbackData, boolean waitForResponse);
18
+ void requireRubyFile(String szFilePath);
19
+
20
+ void navigate(String url);
21
+ //boolean existsJavascript(String jsFunction);
22
+ void executeJavascript(String jsFunction);
23
+
24
+ void rhoLog(int nSeverity,String szModule,String szMsg,String szFile, int nLine);
25
+ String getCurrentUrl();
26
+ void stopNavigate();
27
+ void historyForward();
28
+ void historyBack();
29
+ void refreshPage(boolean bFromCache);
30
+ void quitApp();
31
+ void minimizeApp();
32
+ void restoreApp();
33
+ //void resizeBrowserWindow(RECT rc);
34
+ void zoomPage(float fZoom);
35
+ void zoomText(int nZoom);
36
+
37
+ }
38
+
39
+
@@ -0,0 +1,18 @@
1
+ package com.rhomobile.rhodes.extmanager;
2
+
3
+ public interface IRhoExtension {
4
+
5
+ void onSetPropertiesData(String propId, String data, IRhoExtData ext);
6
+ void onSetProperty(String name, String value, IRhoExtData ext);
7
+ void onBeforeNavigate(String urlBeingNavigatedTo, IRhoExtData ext);
8
+ void onNavigateComplete(String urlBeingNavigatedTo, IRhoExtData ext);
9
+ void onDocumentComplete(String urlOfDocument, IRhoExtData ext);
10
+ //bool onWndMsg(MSG& oMsg){return false;}
11
+ long onNavigateTimeout(String urlBeingNavigatedTo, IRhoExtData ext);
12
+ long onSIPState(boolean bSIPState, IRhoExtData ext);
13
+ //long onAlertPopup(int nEnum, void pData, IRhoExtData ext);
14
+ long onNavigateError(String urlBeingNavigatedTo, IRhoExtData ext);
15
+ void onAppActivate(boolean bActivate, IRhoExtData ext);
16
+
17
+ }
18
+
@@ -0,0 +1,18 @@
1
+ package com.rhomobile.rhodes.extmanager;
2
+
3
+ class RhoExtDataImpl implements IRhoExtData {
4
+
5
+ private int mTabIndex;
6
+
7
+ public RhoExtDataImpl(int tabIndex) {
8
+ mTabIndex = tabIndex;
9
+ }
10
+
11
+ public int getTabIndex() {
12
+ return mTabIndex;
13
+ }
14
+
15
+ public void setTabIndex(int tab_index) {
16
+ mTabIndex = tab_index;
17
+ }
18
+ }
@@ -0,0 +1,142 @@
1
+ package com.rhomobile.rhodes.extmanager;
2
+
3
+ import java.util.Hashtable;
4
+
5
+ import android.view.View;
6
+
7
+ import com.rhomobile.rhodes.RhodesActivity;
8
+ import com.rhomobile.rhodes.RhodesService;
9
+ import com.rhomobile.rhodes.WebView;
10
+
11
+ class RhoExtManagerImpl extends Object implements IRhoExtManager {
12
+
13
+ private Hashtable<String, IRhoExtension> mExtensions;
14
+
15
+ private IRhoExtData makeDefExtData() {
16
+ return new RhoExtDataImpl(RhodesActivity.safeGetInstance().getMainView().activeTab());
17
+ }
18
+
19
+ private static native void nativeRequireRubyFile(String path);
20
+
21
+ public RhoExtManagerImpl() {
22
+ mExtensions = new Hashtable<String, IRhoExtension>();
23
+ }
24
+
25
+ public IRhoExtension getExtByName(String strName) {
26
+ return mExtensions.get(strName);
27
+ }
28
+
29
+ public void registerExtension(String strName, IRhoExtension ext) {
30
+ if (mExtensions.containsKey(strName)) {
31
+ mExtensions.remove(strName);
32
+ }
33
+ mExtensions.put(strName, ext);
34
+ }
35
+
36
+ @Override
37
+ public View getWebView() {
38
+ return RhodesActivity.safeGetInstance().getMainView().getWebView(WebView.activeTab()).getView();
39
+ }
40
+
41
+ @Override
42
+ public View getTopView() {
43
+ return RhodesActivity.safeGetInstance().getMainView().getView();
44
+ }
45
+
46
+ public void onSetPropertiesData(String propId, String data) {
47
+ for (IRhoExtension ext : mExtensions.values()) {
48
+ ext.onSetPropertiesData(propId, data, makeDefExtData());
49
+ }
50
+ }
51
+
52
+ @Override
53
+ public void onUnhandledProperty(String extName, String name, String value, IRhoExtData extData) {
54
+ IRhoExtension ext = mExtensions.get(extName);
55
+ if (ext != null) {
56
+ ext.onSetProperty(name, value, extData);
57
+ }
58
+ }
59
+
60
+ public void onBeforeNavigate(String url) {
61
+ int tabIndex = WebView.activeTab();
62
+ for (IRhoExtension ext : mExtensions.values()) {
63
+ RhoExtDataImpl data = new RhoExtDataImpl(tabIndex);
64
+ ext.onBeforeNavigate(url, data);
65
+ }
66
+ }
67
+
68
+ @Override
69
+ public void executeRubyCallback(String url, String body, String data, boolean waitForResponse) {
70
+ RhodesService.doRequestEx(url, body, data, waitForResponse);
71
+ }
72
+
73
+ @Override
74
+ public void requireRubyFile(String filePath) {
75
+ nativeRequireRubyFile(filePath);
76
+ }
77
+
78
+ @Override
79
+ public void navigate(String url) {
80
+ WebView.navigate(url, WebView.activeTab());
81
+ }
82
+
83
+ @Override
84
+ public void executeJavascript(String jsFunction) {
85
+ WebView.executeJs(jsFunction, WebView.activeTab());
86
+ }
87
+
88
+ @Override
89
+ public void rhoLog(int nSeverity, String szModule, String szMsg, String szFile, int nLine) {
90
+ }
91
+
92
+ @Override
93
+ public String getCurrentUrl() {
94
+ return RhodesActivity.safeGetInstance().getMainView().currentLocation(RhodesActivity.safeGetInstance().getMainView().activeTab());
95
+ }
96
+
97
+ @Override
98
+ public void stopNavigate() {
99
+ WebView.stopNavigate();
100
+ }
101
+
102
+ @Override
103
+ public void historyForward() {
104
+ WebView.navigateForward();
105
+ }
106
+
107
+ @Override
108
+ public void historyBack() {
109
+ WebView.navigateBack();
110
+ }
111
+
112
+ @Override
113
+ public void refreshPage(boolean bFromCache) {
114
+ WebView.refresh(WebView.activeTab());
115
+ }
116
+
117
+ @Override
118
+ public void quitApp() {
119
+ RhodesService.exit();
120
+ }
121
+
122
+ @Override
123
+ public void minimizeApp() {
124
+ // TODO Auto-generated method stub
125
+ }
126
+
127
+ @Override
128
+ public void restoreApp() {
129
+ // TODO Auto-generated method stub
130
+ }
131
+
132
+ @Override
133
+ public void zoomPage(float fZoom) {
134
+ // TODO Auto-generated method stub
135
+ }
136
+
137
+ @Override
138
+ public void zoomText(int nZoom) {
139
+ // TODO Auto-generated method stub
140
+ }
141
+
142
+ }
@@ -0,0 +1,15 @@
1
+ package com.rhomobile.rhodes.extmanager;
2
+
3
+ public class RhoExtManagerSingleton extends Object {
4
+
5
+ private static RhoExtManagerImpl ourRhoExtManager = null;
6
+
7
+
8
+ public static IRhoExtManager getRhoExtManagerInstance() {
9
+ if (ourRhoExtManager == null) {
10
+ ourRhoExtManager = new RhoExtManagerImpl();
11
+ }
12
+ return ourRhoExtManager;
13
+ }
14
+
15
+ }
@@ -28,7 +28,7 @@ package com.rhomobile.rhodes.mainview;
28
28
 
29
29
  import java.util.Map;
30
30
 
31
- import com.rhomobile.rhodes.webview.WebView;
31
+ import com.rhomobile.rhodes.webview.IRhoWebView;
32
32
 
33
33
  import android.view.View;
34
34
 
@@ -36,9 +36,9 @@ public interface MainView {
36
36
 
37
37
  public View getView();
38
38
 
39
- public WebView getWebView(int tab_index);
39
+ public IRhoWebView getWebView(int tab_index);
40
40
 
41
- public WebView detachWebView();
41
+ public IRhoWebView detachWebView();
42
42
 
43
43
  public void back(int index);
44
44
  public void forward(int index);
@@ -47,7 +47,10 @@ public interface MainView {
47
47
  public void goBack();
48
48
 
49
49
  public void navigate(String url, int index);
50
+ public void executeJS(String js, int index);
51
+ //public boolean existsJS(String js, int index);
50
52
  public void reload(int index);
53
+ public void stopNavigate(int index);
51
54
 
52
55
  public String currentLocation(int index);
53
56
 
@@ -43,7 +43,7 @@ import com.rhomobile.rhodes.nativeview.RhoNativeViewManager;
43
43
  import com.rhomobile.rhodes.util.ContextFactory;
44
44
  import com.rhomobile.rhodes.util.PerformOnUiThread;
45
45
  import com.rhomobile.rhodes.util.Utils;
46
- import com.rhomobile.rhodes.webview.WebView;
46
+ import com.rhomobile.rhodes.webview.IRhoWebView;
47
47
  import com.rhomobile.rhodes.webview.GoogleWebView;
48
48
 
49
49
  import android.app.Activity;
@@ -145,7 +145,7 @@ public class SimpleMainView implements MainView {
145
145
  };
146
146
 
147
147
  private LinearLayout view;
148
- private WebView webView;
148
+ private IRhoWebView webView;
149
149
  private RhoNativeViewManager.RhoNativeView mNativeView = null;
150
150
  private View mNativeViewView = null;
151
151
  private LinearLayout navBar = null;
@@ -159,7 +159,7 @@ public class SimpleMainView implements MainView {
159
159
  }
160
160
 
161
161
  @Override
162
- public WebView getWebView(int tab_index) {
162
+ public IRhoWebView getWebView(int tab_index) {
163
163
  return webView;
164
164
  }
165
165
 
@@ -300,9 +300,9 @@ public class SimpleMainView implements MainView {
300
300
  }
301
301
 
302
302
 
303
- public WebView detachWebView() {
303
+ public IRhoWebView detachWebView() {
304
304
  restoreWebView();
305
- WebView v = null;
305
+ IRhoWebView v = null;
306
306
  if (webView != null) {
307
307
  view.removeView(webView.getView());
308
308
  v = webView;
@@ -516,7 +516,7 @@ public class SimpleMainView implements MainView {
516
516
  }
517
517
  }
518
518
 
519
- private void init(WebView v, Object params) {
519
+ private void init(IRhoWebView v, Object params) {
520
520
  RhodesActivity activity = RhodesActivity.safeGetInstance();
521
521
 
522
522
  view = new MyView(activity);
@@ -530,8 +530,8 @@ public class SimpleMainView implements MainView {
530
530
  if (webView == null) {
531
531
  if (Capabilities.WEBKIT_BROWSER_ENABLED) {
532
532
  try {
533
- Class<? extends WebView> viewClass = (Class<? extends WebView>)Class.forName("com.rhomobile.rhodes.webview.EkiohWebView");
534
- Constructor<? extends WebView> viewCtor = viewClass.getConstructor(Activity.class);
533
+ Class<? extends IRhoWebView> viewClass = (Class<? extends IRhoWebView>)Class.forName("com.rhomobile.rhodes.webview.EkiohWebView");
534
+ Constructor<? extends IRhoWebView> viewCtor = viewClass.getConstructor(Activity.class);
535
535
  webView = viewCtor.newInstance(activity);
536
536
  } catch (Throwable e) {
537
537
  Logger.E(TAG, e);
@@ -561,11 +561,11 @@ public class SimpleMainView implements MainView {
561
561
  init(null, null);
562
562
  }
563
563
 
564
- public SimpleMainView(WebView v) {
564
+ public SimpleMainView(IRhoWebView v) {
565
565
  init(v, null);
566
566
  }
567
567
 
568
- public SimpleMainView(WebView v, Object params) {
568
+ public SimpleMainView(IRhoWebView v, Object params) {
569
569
  init(v, params);
570
570
  }
571
571
 
@@ -579,14 +579,15 @@ public class SimpleMainView implements MainView {
579
579
 
580
580
  boolean bStartPage = RhodesService.isOnStartPage();
581
581
 
582
- if ( !bStartPage && webView.canGoBack() )
582
+ if ( !bStartPage && webView.canGoBack() ) {
583
583
  webView.goBack();
584
+ }
584
585
  else
585
586
  {
586
587
  RhodesActivity ra = RhodesActivity.getInstance();
587
588
  if ( ra != null )
588
589
  ra.moveTaskToBack(true);
589
- }
590
+ }
590
591
  }
591
592
 
592
593
  public void goBack()
@@ -609,7 +610,12 @@ public class SimpleMainView implements MainView {
609
610
  }
610
611
  }
611
612
  }
612
-
613
+
614
+ @Override
615
+ public void executeJS(String js, int index) {
616
+ com.rhomobile.rhodes.WebView.executeJs(js, index);
617
+ }
618
+
613
619
  public void reload(int index) {
614
620
  if (mNativeViewView != null) {
615
621
  mNativeViewView.invalidate();
@@ -619,6 +625,12 @@ public class SimpleMainView implements MainView {
619
625
  }
620
626
  }
621
627
 
628
+ public void stopNavigate(int index) {
629
+ if (mNativeViewView == null) {
630
+ webView.stopLoad();
631
+ }
632
+ }
633
+
622
634
  public String currentLocation(int index) {
623
635
  return webView.getUrl();
624
636
  }