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
@@ -84,13 +84,17 @@
84
84
  #define ID_FULLSCREEN 40029
85
85
  #define ID_CANCEL 40030
86
86
  #define ID_SETCOOKIE 40032
87
+ #define IDM_EXECUTEJS 40033
88
+ #define IDM_STOPNAVIGATE 40034
89
+ #define IDM_ZOOMPAGE 40035
90
+ #define IDM_ZOOMTEXT 40036
87
91
 
88
92
  // Next default values for new objects
89
93
  //
90
94
  #ifdef APSTUDIO_INVOKED
91
95
  #ifndef APSTUDIO_READONLY_SYMBOLS
92
96
  #define _APS_NEXT_RESOURCE_VALUE 128
93
- #define _APS_NEXT_COMMAND_VALUE 40031
97
+ #define _APS_NEXT_COMMAND_VALUE 40037
94
98
  #define _APS_NEXT_CONTROL_VALUE 1022
95
99
  #define _APS_NEXT_SYMED_VALUE 111
96
100
  #endif
@@ -0,0 +1,307 @@
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
+ #include "stdafx.h"
28
+
29
+ #include "common/ExtManager.h"
30
+ #include "rubyext/WebView.h"
31
+ #include <common/RhodesApp.h>
32
+
33
+ #include "MainWindow.h"
34
+ #include "common/app_build_capabilities.h"
35
+
36
+ extern CMainWindow& getAppWindow();
37
+ //#define IDM_NAVIGATE 40022
38
+ //#define IDM_EXECUTEJS 40033
39
+ //#define IDM_STOPNAVIGATE 40034
40
+ //#define IDM_ZOOMPAGE 40035
41
+ //#define IDM_ZOOMTEXT 40036
42
+ extern "C" HWND getMainWnd();
43
+ extern "C" HINSTANCE rho_wmimpl_get_appinstance();
44
+ extern "C" void rho_sys_app_exit();
45
+ extern "C" WCHAR* rho_wmimpl_get_configfilepath();
46
+
47
+ namespace rho {
48
+ namespace common {
49
+
50
+ IMPLEMENT_LOGCLASS(CExtManager, "ExtManager");
51
+
52
+ void CExtManager::registerExtension(const String& strName, IRhoExtension* pExt)
53
+ {
54
+ m_hashExtensions.put(strName, pExt);
55
+ }
56
+
57
+ IRhoExtension* CExtManager::getExtByName(const String& strName)
58
+ {
59
+ return m_hashExtensions.get(strName);
60
+ }
61
+
62
+ CRhoExtData CExtManager::makeExtData()
63
+ {
64
+ CRhoExtData oData;
65
+ oData.m_hWnd = getMainWnd();
66
+ oData.m_hInstance = rho_wmimpl_get_appinstance();
67
+ oData.m_hBrowserWnd = getAppWindow().getWebKitEngine()->GetHTMLWND();
68
+
69
+ oData.m_iTabIndex = rho_webview_active_tab();
70
+ return oData;
71
+ }
72
+
73
+ void CExtManager::onSetPropertiesData( const wchar_t* pPropID, const wchar_t* pData)
74
+ {
75
+ for ( HashtablePtr<String, IRhoExtension*>::iterator it = m_hashExtensions.begin(); it != m_hashExtensions.end(); ++it )
76
+ {
77
+ (it->second)->onSetPropertiesData( pPropID, pData, makeExtData() );
78
+ }
79
+ }
80
+
81
+ void CExtManager::onUnhandledProperty( const wchar_t* pModuleName, const wchar_t* pName, const wchar_t* pValue, const CRhoExtData& oExtData )
82
+ {
83
+ rho::common::IRhoExtension* pExt = getExtByName( rho::common::convertToStringA(pModuleName) );
84
+ if (pExt)
85
+ pExt->onSetProperty( pName, pValue, oExtData );
86
+ }
87
+
88
+ void CExtManager::onBeforeNavigate(const wchar_t* szUrlBeingNavigatedTo)
89
+ {
90
+ for ( HashtablePtr<String, IRhoExtension*>::iterator it = m_hashExtensions.begin(); it != m_hashExtensions.end(); ++it )
91
+ {
92
+ (it->second)->onBeforeNavigate( szUrlBeingNavigatedTo, makeExtData() );
93
+ }
94
+ }
95
+
96
+ void CExtManager::onNavigateComplete(const wchar_t* szUrlBeingNavigatedTo)
97
+ {
98
+ for ( HashtablePtr<String, IRhoExtension*>::iterator it = m_hashExtensions.begin(); it != m_hashExtensions.end(); ++it )
99
+ {
100
+ (it->second)->onNavigateComplete( szUrlBeingNavigatedTo, makeExtData() );
101
+ }
102
+ }
103
+
104
+ void CExtManager::onDocumentComplete(const wchar_t* szUrlOfDocument)
105
+ {
106
+ for ( HashtablePtr<String, IRhoExtension*>::iterator it = m_hashExtensions.begin(); it != m_hashExtensions.end(); ++it )
107
+ {
108
+ (it->second)->onNavigateComplete( szUrlOfDocument, makeExtData() );
109
+ }
110
+ }
111
+
112
+ void CExtManager::close()
113
+ {
114
+ m_hashExtensions.clear();
115
+ }
116
+
117
+ void CExtManager::executeRubyCallback( const char* szCallback, const char* szCallbackBody, const char* szCallbackData, bool bWaitForResponse)
118
+ {
119
+ RHODESAPP().callCallbackWithData(szCallback, szCallbackBody, szCallbackData, bWaitForResponse );
120
+ }
121
+
122
+ void CExtManager::navigate(const wchar_t* szUrl)
123
+ {
124
+ ::PostMessage( getMainWnd(), WM_COMMAND, IDM_NAVIGATE, (LPARAM)_wcsdup(szUrl) );
125
+ }
126
+
127
+ bool CExtManager::existsJavascript(const wchar_t* szJSFunction)
128
+ {
129
+ #ifndef RHODES_EMULATOR
130
+ return getAppWindow().getWebKitEngine()->isExistJavascript(szJSFunction, rho_webview_active_tab());
131
+ #else
132
+ return true;
133
+ #endif
134
+ }
135
+
136
+ void CExtManager::executeJavascript(const wchar_t* szJSFunction)
137
+ {
138
+ ::PostMessage( getMainWnd(), WM_COMMAND, IDM_EXECUTEJS, (LPARAM)_wcsdup(szJSFunction) );
139
+ }
140
+
141
+ StringW CExtManager::getCurrentUrl()
142
+ {
143
+ return convertToStringW(RHODESAPP().getCurrentUrl(rho_webview_active_tab()));
144
+ }
145
+
146
+ void CExtManager::historyForward()
147
+ {
148
+ rho_webview_navigate_forward();
149
+ }
150
+
151
+ void CExtManager::historyBack()
152
+ {
153
+ rho_webview_navigate_back();
154
+ }
155
+
156
+ void CExtManager::refreshPage(bool bFromCache)
157
+ {
158
+ rho_webview_refresh(rho_webview_active_tab());
159
+ }
160
+
161
+ void CExtManager::stopNavigate()
162
+ {
163
+ ::PostMessage( getMainWnd(), WM_COMMAND, IDM_STOPNAVIGATE, (LPARAM)rho_webview_active_tab() );
164
+ }
165
+
166
+ void CExtManager::quitApp()
167
+ {
168
+ rho_sys_app_exit();
169
+ }
170
+
171
+ void CExtManager::minimizeApp()
172
+ {
173
+ ::ShowWindow(getMainWnd(), SW_MINIMIZE );
174
+ }
175
+
176
+ void CExtManager::restoreApp()
177
+ {
178
+ ::ShowWindow(getMainWnd(), SW_RESTORE );
179
+ }
180
+
181
+ void CExtManager::resizeBrowserWindow(RECT rc)
182
+ {
183
+ ::MoveWindow( getMainWnd(), rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top, TRUE );
184
+ }
185
+
186
+ void CExtManager::zoomPage(float fZoom)
187
+ {
188
+ ::PostMessage( getMainWnd(), WM_COMMAND, IDM_ZOOMPAGE, (LPARAM)fZoom );
189
+ }
190
+
191
+ void CExtManager::zoomText(int nZoom)
192
+ {
193
+ ::PostMessage( getMainWnd(), WM_COMMAND, IDM_ZOOMTEXT, (LPARAM)nZoom );
194
+ }
195
+
196
+ int CExtManager::getTextZoom() //Enum (0 to 4)
197
+ {
198
+ #ifndef RHODES_EMULATOR
199
+ return getAppWindow().getWebKitEngine()->GetTextZoomOnTab(rho_webview_active_tab());
200
+ #else
201
+ return 2;
202
+ #endif
203
+ }
204
+
205
+ StringW CExtManager::getConfigPath()
206
+ {
207
+ #if defined(APP_BUILD_CAPABILITY_MOTOROLA)
208
+ return rho_wmimpl_get_configfilepath();
209
+ #else
210
+ return L"";
211
+ #endif
212
+ }
213
+
214
+ StringW CExtManager::getPageTitle(UINT iTab)
215
+ {
216
+ #ifndef RHODES_EMULATOR
217
+ wchar_t szBuf[1025];
218
+ szBuf[0]=0;
219
+ getAppWindow().getWebKitEngine()->GetTitleOnTab( szBuf, 1024, iTab );
220
+ return szBuf ? szBuf : L"";
221
+ #else
222
+ return L"";
223
+ #endif
224
+ }
225
+
226
+ extern "C" unsigned long rb_require(const char *fname);
227
+
228
+ void CExtManager::requireRubyFile( const char* szFilePath )
229
+ {
230
+ rb_require(szFilePath);
231
+ }
232
+
233
+ void CExtManager::rhoLog(int nSeverity, const char* szModule, const char* szMsg, const char* szFile, int nLine)
234
+ {
235
+ rhoPlainLog(szFile, nLine, nSeverity, szModule, szMsg);
236
+ }
237
+
238
+ bool CExtManager::onWndMsg(MSG& oMsg)
239
+ {
240
+ for ( HashtablePtr<String, IRhoExtension*>::iterator it = m_hashExtensions.begin(); it != m_hashExtensions.end(); ++it )
241
+ {
242
+ if ( (it->second)->onWndMsg( oMsg ) )
243
+ return true;
244
+ }
245
+
246
+ return false;
247
+ }
248
+
249
+ long CExtManager::OnNavigateTimeout(const wchar_t* szUrlBeingNavigatedTo)
250
+ {
251
+ for ( HashtablePtr<String, IRhoExtension*>::iterator it = m_hashExtensions.begin(); it != m_hashExtensions.end(); ++it )
252
+ {
253
+ long lRes = (it->second)->OnNavigateTimeout( szUrlBeingNavigatedTo, makeExtData() );
254
+ if ( lRes )
255
+ return lRes;
256
+ }
257
+
258
+ return 0;
259
+ }
260
+
261
+ long CExtManager::OnSIPState(bool bSIPState)
262
+ {
263
+ for ( HashtablePtr<String, IRhoExtension*>::iterator it = m_hashExtensions.begin(); it != m_hashExtensions.end(); ++it )
264
+ {
265
+ long lRes = (it->second)->OnSIPState( bSIPState, makeExtData() );
266
+ if ( lRes )
267
+ return lRes;
268
+ }
269
+
270
+ return 0;
271
+ }
272
+
273
+ long CExtManager::OnAlertPopup(int nEnum, void* pData)
274
+ {
275
+ for ( HashtablePtr<String, IRhoExtension*>::iterator it = m_hashExtensions.begin(); it != m_hashExtensions.end(); ++it )
276
+ {
277
+ long lRes = (it->second)->OnAlertPopup( nEnum, pData, makeExtData() );
278
+ if ( lRes )
279
+ return lRes;
280
+ }
281
+
282
+ return 0;
283
+ }
284
+
285
+ long CExtManager::OnNavigateError(const wchar_t* szUrlBeingNavigatedTo)
286
+ {
287
+ for ( HashtablePtr<String, IRhoExtension*>::iterator it = m_hashExtensions.begin(); it != m_hashExtensions.end(); ++it )
288
+ {
289
+ long lRes = (it->second)->OnNavigateError( szUrlBeingNavigatedTo, makeExtData() );
290
+ if ( lRes )
291
+ return lRes;
292
+ }
293
+
294
+ return 0;
295
+ }
296
+
297
+ void CExtManager::OnAppActivate(bool bActivate)
298
+ {
299
+ for ( HashtablePtr<String, IRhoExtension*>::iterator it = m_hashExtensions.begin(); it != m_hashExtensions.end(); ++it )
300
+ {
301
+ (it->second)->OnAppActivate( bActivate, makeExtData() );
302
+ }
303
+ }
304
+
305
+ } //namespace common
306
+ } //namespace rho
307
+
@@ -385,7 +385,7 @@ String CNativeToolbar::CToolbarBtn::getDefaultImagePath(const String& strAction)
385
385
  else if ( strcasecmp(strAction.c_str(), "forward")==0 )
386
386
  strImagePath = "lib/res/forward_btn.png";
387
387
 
388
- return strImagePath.length() > 0 ? CFilePath::join( RHODESAPP().getRhoRootPath(), strImagePath) : String();
388
+ return strImagePath.length() > 0 ? CFilePath::join( RHODESAPP().getRhoRuntimePath(), strImagePath) : String();
389
389
  }
390
390
 
391
391
  CNativeToolbar::CToolbarBtn::CToolbarBtn( const char *label, const char *action, const char *icon, int nItemWidth )
@@ -880,7 +880,7 @@ void CRhoSignature::onSetProperty(const wchar_t* pName, const wchar_t* pValue, c
880
880
  // if action is coming like show/hide call correspondign methods
881
881
  }
882
882
 
883
- void CRhoSignature::onBeforeNavigate(const CRhoExtData& oExtData)
883
+ void CRhoSignature::onBeforeNavigate(const wchar_t* szUrlBeingNavigatedTo, const CRhoExtData& oExtData)
884
884
  {
885
885
  hideSignature();
886
886
  }
@@ -76,7 +76,7 @@ public:
76
76
 
77
77
  //IRhoExtension
78
78
  virtual void onSetProperty(const wchar_t* pName, const wchar_t* pValue, const common::CRhoExtData& oExtData);
79
- virtual void onBeforeNavigate(const common::CRhoExtData& oExtData);
79
+ virtual void onBeforeNavigate(const wchar_t* szUrlBeingNavigatedTo, const common::CRhoExtData& oExtData);
80
80
  };
81
81
 
82
82
  class CRhoSignatureWindow : public CDialogImpl <CRhoSignatureWindow>
@@ -422,6 +422,8 @@ int get_msie_version(rho::String& msieVer)
422
422
  }
423
423
  #endif
424
424
 
425
+ static int g_rho_has_network = 1, g_rho_has_cellnetwork = 0;
426
+
425
427
  int rho_sysimpl_get_property(char* szPropName, VALUE* resValue)
426
428
  {
427
429
  if (strcasecmp("webview_framework",szPropName) == 0)
@@ -576,6 +578,18 @@ int rho_sysimpl_get_property(char* szPropName, VALUE* resValue)
576
578
  }
577
579
  #endif
578
580
 
581
+ if (strcasecmp("has_cell_network",szPropName) == 0)
582
+ {
583
+ *resValue = rho_ruby_create_boolean( g_rho_has_cellnetwork != 0 );
584
+ return 1;
585
+ }
586
+
587
+ if (strcasecmp("has_wifi_network",szPropName) == 0)
588
+ {
589
+ *resValue = rho_ruby_create_boolean( g_rho_has_network != 0 );
590
+ return 1;
591
+ }
592
+
579
593
  return 0;
580
594
  }
581
595
 
@@ -584,8 +598,6 @@ VALUE rho_sys_makephonecall(const char* callname, int nparams, char** param_name
584
598
  return rho_ruby_get_NIL();
585
599
  }
586
600
 
587
- static int g_rho_has_network = 1, g_rho_has_cellnetwork = 0;
588
-
589
601
  void rho_sysimpl_sethas_network(int nValue)
590
602
  {
591
603
  g_rho_has_network = nValue > 1 ? 1 : 0;
@@ -81,12 +81,15 @@ void rho_webview_navigate_forward()
81
81
 
82
82
  const char* rho_webview_execute_js(const char* js, int index)
83
83
  {
84
- String strJS = "javascript:";
85
- strJS += js;
84
+ // String strJS = "javascript:";
85
+ //strJS += js;
86
86
 
87
87
  //RAWTRACEC1("Execute JS: %s", js);
88
88
 
89
- rho_webview_navigate(strJS.c_str(), index);
89
+ //rho_webview_navigate(strJS.c_str(), index);
90
+ StringW strJsW;
91
+ convertToStringW(js, strJsW);
92
+ ::PostMessage( getMainWnd(), WM_COMMAND, IDM_EXECUTEJS, (LPARAM)_tcsdup(strJsW.c_str()) );
90
93
  return "";
91
94
  }
92
95
 
@@ -707,7 +707,7 @@
707
707
  OutputFile="$(OutDir)/rhodes.exe"
708
708
  LinkIncremental="1"
709
709
  AdditionalLibraryDirectories="$(OutDir)"
710
- GenerateDebugInformation="false"
710
+ GenerateDebugInformation="true"
711
711
  SubSystem="0"
712
712
  StackReserveSize="196608"
713
713
  StackCommitSize="4096"
@@ -3869,6 +3869,10 @@
3869
3869
  <Filter
3870
3870
  Name="common"
3871
3871
  >
3872
+ <File
3873
+ RelativePath=".\rho\common\ExtManager.cpp"
3874
+ >
3875
+ </File>
3872
3876
  <File
3873
3877
  RelativePath=".\rho\common\RhoClassFactory.cpp"
3874
3878
  >
@@ -398,7 +398,7 @@ void CMainWindow::createToolbar(rho_param *p)
398
398
  strImagePath = "res/back_btn.wm.png";
399
399
  else if ( strcasecmp(action, "forward")==0 )
400
400
  strImagePath = "res/forward_btn.wm.png";
401
- strImagePath = strImagePath.length() > 0 ? CFilePath::join( RHOSIMCONF().getRhodesPath(), "lib/framework/" + strImagePath) : String();
401
+ strImagePath = strImagePath.length() > 0 ? CFilePath::join( RHOSIMCONF().getRhoRuntimePath(), "lib/framework/" + strImagePath) : String();
402
402
  }
403
403
 
404
404
  ((QtMainWindow*)qtMainWindow)->toolbarAddAction(QIcon(QString(strImagePath.c_str())), QString(label), action, wasSeparator);
@@ -712,6 +712,27 @@ LRESULT CMainWindow::OnNavigateCommand(WORD /*wNotifyCode*/, WORD /*wID*/, HWND
712
712
  return 0;
713
713
  }
714
714
 
715
+ LRESULT CMainWindow::OnExecuteJS(WORD /*wNotifyCode*/, WORD /*wID*/, HWND hWndCtl, BOOL& /*bHandled*/)
716
+ {
717
+ TNavigateData* nd = (TNavigateData*)hWndCtl;
718
+ if (nd) {
719
+ LPTSTR wcurl = (LPTSTR)(nd->url);
720
+ if (wcurl) {
721
+
722
+ StringW strUrlW;
723
+ if(_memicmp(wcurl,L"JavaScript:",11*2) != 0)
724
+ strUrlW = L"javascript:";
725
+
726
+ strUrlW += wcurl;
727
+
728
+ Navigate2((LPWSTR)strUrlW.c_str(), nd->index);
729
+ free(wcurl);
730
+ }
731
+ free(nd);
732
+ }
733
+ return 0;
734
+ }
735
+
715
736
  LRESULT CMainWindow::OnSetCookieCommand(WORD /*wNotifyCode*/, WORD /*wID*/, HWND hWndCtl, BOOL& /*bHandled*/)
716
737
  {
717
738
  TCookieData* cd = (TCookieData*)hWndCtl;