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
@@ -31,6 +31,7 @@
31
31
  #ifdef ENABLE_DYNAMIC_RHOBUNDLE
32
32
  #include "net/INetRequest.h"
33
33
 
34
+ #include "common/app_build_capabilities.h"
34
35
  #include "common/RhodesApp.h"
35
36
 
36
37
  #include "unzip/unzip.h"
@@ -221,10 +222,20 @@ int CAppManager::removeOldRhoBundle (void)
221
222
  return RRB_REMOVEOLD_ERR;
222
223
  }
223
224
 
224
- if (!RemoveFolder(root + "lib")) {
225
- LOG(ERROR) + "Failed to remove" + "\"" + (root + "lib ") + "\"";
226
- return RRB_REMOVEOLD_ERR;
225
+ #if defined(APP_BUILD_CAPABILITY_MOTOROLA)
226
+ const char *rhopath = rho_native_rhopath();
227
+ const char *runtimepath = rho_native_reruntimepath();
228
+ int rhopath_len = strlen(rhopath);
229
+ int runtimepath_len = strlen(runtimepath);
230
+ if ((rhopath_len > 0) && (rhopath_len == runtimepath_len) && (_strnicmp(rhopath, runtimepath, rhopath_len)==0)) {
231
+ #endif
232
+ if (!RemoveFolder(root + "lib")) {
233
+ LOG(ERROR) + "Failed to remove" + "\"" + (root + "lib ") + "\"";
234
+ return RRB_REMOVEOLD_ERR;
235
+ }
236
+ #if defined(APP_BUILD_CAPABILITY_MOTOROLA)
227
237
  }
238
+ #endif
228
239
 
229
240
  return RRB_NONE_ERR;
230
241
  }
@@ -15,10 +15,17 @@ public:
15
15
  virtual BOOL BackOnTab(int iInstID,int iPagesBack = 1) = 0;
16
16
  virtual BOOL ForwardOnTab(int iInstID) = 0;
17
17
  virtual BOOL ReloadOnTab(bool bFromCache, UINT iTab) = 0;
18
+ virtual BOOL StopOnTab(UINT iTab) = 0;
18
19
  virtual BOOL NavigateToHtml(LPCTSTR szHtml) = 0;
19
20
  virtual LRESULT OnWebKitMessages(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) = 0;
20
21
  virtual void RunMessageLoop(CMainWindow& mainWnd) = 0;
21
22
  virtual void SetCookie(char* url, char* cookie) = 0;
23
+ virtual bool isExistJavascript(const wchar_t* szJSFunction, int index) = 0;
24
+ virtual void executeJavascript(const wchar_t* szJSFunction, int index) = 0;
25
+ virtual BOOL ZoomPageOnTab(float fZoom, UINT iTab) = 0;
26
+ virtual BOOL ZoomTextOnTab(int nZoom, UINT iTab) = 0;
27
+ virtual int GetTextZoomOnTab(UINT iTab) = 0;
28
+ virtual BOOL GetTitleOnTab(LPTSTR szURL, UINT iMaxLen, UINT iTab) = 0;
22
29
  };
23
30
 
24
31
  }
@@ -70,6 +70,31 @@ BOOL CIEBrowserEngine::ReloadOnTab(bool bFromCache, UINT iTab)
70
70
  return m_spIWebBrowser2->Refresh() == S_OK;
71
71
  }
72
72
 
73
+ BOOL CIEBrowserEngine::StopOnTab(UINT iTab)
74
+ {
75
+ return FALSE;
76
+ }
77
+
78
+ BOOL CIEBrowserEngine::ZoomPageOnTab(float fZoom, UINT iTab)
79
+ {
80
+ return FALSE;
81
+ }
82
+
83
+ BOOL CIEBrowserEngine::ZoomTextOnTab(int nZoom, UINT iTab)
84
+ {
85
+ return FALSE;
86
+ }
87
+
88
+ int CIEBrowserEngine::GetTextZoomOnTab(UINT iTab)
89
+ {
90
+ return 2; //Normal
91
+ }
92
+
93
+ BOOL CIEBrowserEngine::GetTitleOnTab(LPTSTR szURL, UINT iMaxLen, UINT iTab)
94
+ {
95
+ return FALSE;
96
+ }
97
+
73
98
  static void writeHtmlToTheDoc (
74
99
  #if defined(_WIN32_WCE) && !defined( OS_PLATFORM_MOTCE )
75
100
  IPIEHTMLDocument2 *document
@@ -140,6 +165,9 @@ void CIEBrowserEngine::RunMessageLoop(CMainWindow& mainWnd)
140
165
  MSG msg;
141
166
  while (GetMessage(&msg, NULL, 0, 0))
142
167
  {
168
+ if ( RHODESAPP().getExtManager().onWndMsg(msg) )
169
+ continue;
170
+
143
171
  if (!mainWnd.TranslateAccelerator(&msg))
144
172
  {
145
173
  TranslateMessage(&msg);
@@ -148,6 +176,21 @@ void CIEBrowserEngine::RunMessageLoop(CMainWindow& mainWnd)
148
176
  }
149
177
  }
150
178
 
179
+ bool CIEBrowserEngine::isExistJavascript(const wchar_t* szJSFunction, int index)
180
+ {
181
+ return true;
182
+ }
183
+
184
+ void CIEBrowserEngine::executeJavascript(const wchar_t* szJSFunction, int index)
185
+ {
186
+ StringW strUrlW;
187
+ if(_memicmp(szJSFunction,L"JavaScript:",11*2) != 0)
188
+ strUrlW = L"javascript:";
189
+
190
+ strUrlW += szJSFunction;
191
+ Navigate(strUrlW.c_str());
192
+ }
193
+
151
194
  void CIEBrowserEngine::SetCookie(char* url, char* cookie)
152
195
  {
153
196
  URL_COMPONENTSA uri;
@@ -29,8 +29,15 @@ public:
29
29
  virtual BOOL BackOnTab(int iInstID,int iPagesBack = 1);
30
30
  virtual BOOL ForwardOnTab(int iInstID);
31
31
  virtual BOOL ReloadOnTab(bool bFromCache, UINT iTab);
32
+ virtual BOOL StopOnTab(UINT iTab);
32
33
  virtual BOOL NavigateToHtml(LPCTSTR szHtml);
33
34
  virtual LRESULT OnWebKitMessages(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
34
35
  virtual void RunMessageLoop(CMainWindow& mainWnd);
35
36
  virtual void SetCookie(char* url, char* cookie);
37
+ virtual bool isExistJavascript(const wchar_t* szJSFunction, int index);
38
+ virtual void executeJavascript(const wchar_t* szJSFunction, int index);
39
+ virtual BOOL ZoomPageOnTab(float fZoom, UINT iTab);
40
+ virtual BOOL ZoomTextOnTab(int nZoom, UINT iTab);
41
+ virtual int GetTextZoomOnTab(UINT iTab);
42
+ virtual BOOL GetTitleOnTab(LPTSTR szURL, UINT iMaxLen, UINT iTab);
36
43
  };
@@ -54,7 +54,7 @@ LRESULT CLogOptionsDlg::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BO
54
54
  mbi.hInstRes = _AtlBaseModule.GetResourceInstance();
55
55
  mbi.dwFlags = SHCMBF_HMENU;
56
56
  SHCreateMenuBar(&mbi);
57
- #else
57
+ #elif defined (OS_PLATFORM_MOTCE)
58
58
  SetWindowLong(GWL_STYLE,(long)WS_BORDER);
59
59
 
60
60
  m_hWndCommandBar = CommandBar_Create(_AtlBaseModule.GetResourceInstance(), m_hWnd, 1);
@@ -140,6 +140,29 @@ LRESULT CMainWindow::OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*
140
140
  return S_OK;
141
141
  }
142
142
 
143
+ #if defined( OS_PLATFORM_MOTCE )
144
+ void CMainWindow::SetFullScreen(bool bFull)
145
+ {
146
+ HWND hTaskBar = FindWindow(_T("HHTaskBar"), NULL);
147
+ if(!hTaskBar)
148
+ return;
149
+ ::ShowWindow(hTaskBar, !bFull ? SW_SHOW : SW_HIDE);
150
+
151
+ if(g_hWndCommandBar)
152
+ ::ShowWindow(g_hWndCommandBar, !bFull ? SW_SHOW : SW_HIDE);
153
+
154
+ RECT rect = { 0 };
155
+ SystemParametersInfo(SPI_GETWORKAREA, NULL, &rect, FALSE);
156
+
157
+ if(bFull)
158
+ rect.bottom = GetSystemMetrics(SM_CYSCREEN);
159
+
160
+ MoveWindow(&rect);
161
+
162
+ m_bFullScreen = bFull;
163
+ }
164
+ #endif
165
+
143
166
  LRESULT CMainWindow::InitMainWindow()
144
167
  {
145
168
  HRESULT hr = S_OK;
@@ -256,9 +279,12 @@ LRESULT CMainWindow::InitMainWindow()
256
279
 
257
280
  #endif
258
281
 
259
- #if defined(_WIN32_WCE) && !defined( OS_PLATFORM_MOTCE )
282
+ #if defined(_WIN32_WCE)
260
283
  //Set fullscreen after window resizing
261
- if ( RHOCONF().getBool("full_screen"))
284
+ #if defined( OS_PLATFORM_MOTCE )
285
+ m_bFullScreen = RHOCONF().getBool("full_screen");
286
+ #endif
287
+ if (RHOCONF().getBool("full_screen"))
262
288
  SetFullScreen(true);
263
289
  #endif
264
290
 
@@ -325,8 +351,10 @@ LRESULT CMainWindow::OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam
325
351
  {
326
352
  rho_rhodesapp_callUiDestroyedCallback();
327
353
 
328
- #if defined (_WIN32_WCE)
354
+ #if defined (_WIN32_WCE) && !defined(OS_PLATFORM_MOTCE)
329
355
  m_menuBar = NULL;
356
+ ShowTaskBar(true, false);
357
+ //SetFullScreen(false);
330
358
  #endif
331
359
 
332
360
  #if defined(OS_WINDOWS)
@@ -377,7 +405,7 @@ LRESULT CMainWindow::OnSize(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOO
377
405
  rect.bottom -= m_toolbar.getHeight();
378
406
 
379
407
  #if defined( OS_PLATFORM_MOTCE )
380
- if (g_hWndCommandBar)
408
+ if (!m_bFullScreen && g_hWndCommandBar)
381
409
  {
382
410
  CRect rcCmdBar;
383
411
  ::GetWindowRect(g_hWndCommandBar, &rcCmdBar);
@@ -435,6 +463,26 @@ LRESULT CMainWindow::OnBeforeNavigate(UINT uMsg, WPARAM wParam, LPARAM lParam, B
435
463
  return 0;
436
464
  }
437
465
 
466
+ LRESULT CMainWindow::OnNavigateTimeout (UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/)
467
+ {
468
+ return RHODESAPP().getExtManager().OnNavigateTimeout((LPCTSTR)lParam);
469
+ }
470
+
471
+ LRESULT CMainWindow::OnNavigateError (UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/)
472
+ {
473
+ return RHODESAPP().getExtManager().OnNavigateError((LPCTSTR)lParam);
474
+ }
475
+
476
+ LRESULT CMainWindow::OnSetSIPState (UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/)
477
+ {
478
+ return RHODESAPP().getExtManager().OnSIPState(lParam != 0 ? true:false);
479
+ }
480
+
481
+ LRESULT CMainWindow::OnAlertPopup (UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)
482
+ {
483
+ return RHODESAPP().getExtManager().OnAlertPopup(wParam, (void*)lParam);
484
+ }
485
+
438
486
  #endif //APP_BUILD_CAPABILITY_WEBKIT_BROWSER
439
487
 
440
488
  LRESULT CMainWindow::OnActivate(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)
@@ -444,6 +492,7 @@ LRESULT CMainWindow::OnActivate(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOO
444
492
 
445
493
  int fActive = LOWORD(wParam);
446
494
  rho_rhodesapp_callAppActiveCallback(fActive);
495
+ RHODESAPP().getExtManager().OnAppActivate(fActive!=0);
447
496
 
448
497
  #if defined(_WIN32_WCE) && !defined (OS_PLATFORM_MOTCE)
449
498
  // Notify shell of our WM_ACTIVATE message
@@ -672,8 +721,8 @@ LRESULT CMainWindow::OnLogCommand(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWn
672
721
 
673
722
  LRESULT CMainWindow::OnFullscreenCommand (WORD /*wNotifyCode*/, WORD /*wID*/, HWND hwnd, BOOL& /*bHandled*/)
674
723
  {
675
- #if defined (_WIN32_WCE) && !defined( OS_PLATFORM_MOTCE )
676
- SetFullScreen(!m_bFullScreen);
724
+ #if defined (_WIN32_WCE)
725
+ SetFullScreen( hwnd != 0 ? true : false);
677
726
  #endif
678
727
  return 0;
679
728
  };
@@ -695,6 +744,37 @@ LRESULT CMainWindow::OnNavigateCommand(WORD /*wNotifyCode*/, WORD /*wID*/, HWND
695
744
  return 0;
696
745
  }
697
746
 
747
+ LRESULT CMainWindow::OnExecuteJSCommand(WORD /*wNotifyCode*/, WORD /*wID*/, HWND hWndCtl, BOOL& /*bHandled*/)
748
+ {
749
+ LPTSTR wcurl = (LPTSTR)hWndCtl;
750
+ if (wcurl)
751
+ {
752
+ m_pBrowserEng->executeJavascript(wcurl,0);
753
+ free(wcurl);
754
+ }
755
+ return 0;
756
+ }
757
+
758
+ LRESULT CMainWindow::OnStopNavigate(WORD /*wNotifyCode*/, WORD /*wID*/, HWND hWndCtl, BOOL& /*bHandled*/)
759
+ {
760
+ m_pBrowserEng->StopOnTab((UINT)hWndCtl);
761
+ return 0;
762
+ }
763
+
764
+ LRESULT CMainWindow::OnZoomPage(WORD /*wNotifyCode*/, WORD /*wID*/, HWND hWndCtl, BOOL& /*bHandled*/)
765
+ {
766
+ float fZoom = (float)(long)(hWndCtl);
767
+ m_pBrowserEng->ZoomPageOnTab(fZoom, rho_webview_active_tab());
768
+ return 0;
769
+ }
770
+
771
+ LRESULT CMainWindow::OnZoomText(WORD /*wNotifyCode*/, WORD /*wID*/, HWND hWndCtl, BOOL& /*bHandled*/)
772
+ {
773
+ int nZoom = (int)hWndCtl;
774
+ m_pBrowserEng->ZoomTextOnTab(nZoom, rho_webview_active_tab());
775
+ return 0;
776
+ }
777
+
698
778
  #if defined(OS_WINDOWS) || defined( OS_PLATFORM_MOTCE )
699
779
  LRESULT CMainWindow::OnPopupMenuCommand(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
700
780
  {
@@ -926,7 +1006,7 @@ bool Rhodes_WM_ProcessBeforeNavigate(LPCTSTR url)
926
1006
  {
927
1007
  LOG(TRACE) + "OnBeforeNavigate2: " + url;
928
1008
 
929
- RHODESAPP().getExtManager().onBeforeNavigate();
1009
+ RHODESAPP().getExtManager().onBeforeNavigate(url);
930
1010
 
931
1011
  const wchar_t *to_remove;
932
1012
  if ( (to_remove = wcsstr(url, L"rho_open_target=_blank")) != 0)
@@ -1000,7 +1080,10 @@ void CMainWindow::ProcessNavigateComplete(LPCTSTR url)
1000
1080
  if ( !m_bLoading && !mIsBrowserViewHided )
1001
1081
  ::ShowWindow(m_pBrowserEng->GetHTMLWND(), SW_SHOW);
1002
1082
 
1083
+
1003
1084
  LOG(TRACE) + "OnNavigateComplete2: " + url;
1085
+
1086
+ RHODESAPP().getExtManager().onNavigateComplete(url);
1004
1087
  }
1005
1088
 
1006
1089
  void CMainWindow::ShowLoadingPage()
@@ -1054,6 +1137,8 @@ void CMainWindow::ProcessDocumentComplete(LPCTSTR url)
1054
1137
  #endif
1055
1138
 
1056
1139
  //CMetaHandler oHandler(m_spIWebBrowser2);
1140
+
1141
+ RHODESAPP().getExtManager().onDocumentComplete(url);
1057
1142
  }
1058
1143
 
1059
1144
  void __stdcall CMainWindow::OnCommandStateChange(long lCommand, BOOL bEnable)
@@ -68,6 +68,11 @@ extern UINT WM_BROWSER_ONDOCUMENTCOMPLETE;
68
68
  extern UINT WM_BROWSER_ONNAVIGATECOMPLETE;
69
69
  extern UINT WM_BROWSER_ONTITLECHANGE;
70
70
  extern UINT WM_BROWSER_ONBEFORENAVIGATE;
71
+ extern UINT WM_BROWSER_ONNAVIGATIONTIMEOUT;
72
+ extern UINT WM_BROWSER_ONNAVIGATIONERROR;
73
+ extern UINT WM_BROWSER_ONSETSIPSTATE;
74
+ extern UINT WM_BROWSER_ONALERTPOPUP;
75
+
71
76
  #else
72
77
  #if defined (_WIN32_WCE) && !defined( OS_PLATFORM_MOTCE )
73
78
  #include <pvdispid.h>
@@ -129,12 +134,17 @@ public:
129
134
  // Required to forward messages to the PIEWebBrowser control
130
135
  BOOL TranslateAccelerator(MSG* pMsg);
131
136
 
137
+ #if defined( OS_PLATFORM_MOTCE )
138
+ void SetFullScreen(bool bFull);
139
+ bool m_bFullScreen;
140
+ #endif
141
+
132
142
  void openNativeView( NativeViewFactory* nativeViewFactory,
133
143
  NativeView* nativeView,
134
144
  String nativeViewType);
135
145
  void closeNativeView();
136
146
  rho::IBrowserEngine* getWebKitEngine(){return m_pBrowserEng; }
137
-
147
+
138
148
  #if defined(OS_WINDOWS)
139
149
  DECLARE_WND_CLASS(TEXT("Rhodes.MainWindow"))
140
150
  #else
@@ -165,6 +175,10 @@ public:
165
175
  COMMAND_ID_HANDLER(IDM_SK1_EXIT, OnBackCommand)
166
176
  COMMAND_ID_HANDLER(IDM_REFRESH, OnRefreshCommand)
167
177
  COMMAND_ID_HANDLER(IDM_NAVIGATE, OnNavigateCommand)
178
+ COMMAND_ID_HANDLER(IDM_EXECUTEJS, OnExecuteJSCommand)
179
+ COMMAND_ID_HANDLER(IDM_STOPNAVIGATE, OnStopNavigate)
180
+ COMMAND_ID_HANDLER(IDM_ZOOMPAGE, OnZoomPage)
181
+ COMMAND_ID_HANDLER(IDM_ZOOMTEXT, OnZoomText)
168
182
  COMMAND_ID_HANDLER(IDM_LOG,OnLogCommand)
169
183
  COMMAND_ID_HANDLER(ID_FULLSCREEN, OnFullscreenCommand)
170
184
  COMMAND_ID_HANDLER(ID_SETCOOKIE, OnSetCookieCommand)
@@ -195,6 +209,11 @@ public:
195
209
  MESSAGE_HANDLER(WM_BROWSER_ONNAVIGATECOMPLETE, OnNavigateComplete);
196
210
  MESSAGE_HANDLER(WM_BROWSER_ONTITLECHANGE, OnTitleChange);
197
211
  MESSAGE_HANDLER(WM_BROWSER_ONBEFORENAVIGATE, OnBeforeNavigate);
212
+ MESSAGE_HANDLER(WM_BROWSER_ONNAVIGATIONTIMEOUT, OnNavigateTimeout);
213
+ MESSAGE_HANDLER(WM_BROWSER_ONNAVIGATIONERROR, OnNavigateError);
214
+ MESSAGE_HANDLER(WM_BROWSER_ONSETSIPSTATE, OnSetSIPState);
215
+ MESSAGE_HANDLER(WM_BROWSER_ONALERTPOPUP, OnAlertPopup);
216
+
198
217
  MESSAGE_RANGE_HANDLER(PB_NAVIGATETAB, PB_NEWGPSDATA, OnWebKitMessages)
199
218
  #endif
200
219
 
@@ -218,6 +237,10 @@ private:
218
237
  LRESULT OnNavigateForwardCommand(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
219
238
  LRESULT OnRefreshCommand(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
220
239
  LRESULT OnNavigateCommand(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
240
+ LRESULT OnExecuteJSCommand(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
241
+ LRESULT OnStopNavigate(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
242
+ LRESULT OnZoomPage(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
243
+ LRESULT OnZoomText(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
221
244
  LRESULT OnLogCommand(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
222
245
  LRESULT OnFullscreenCommand (WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
223
246
  LRESULT OnSetCookieCommand (WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
@@ -251,6 +274,10 @@ private:
251
274
  LRESULT OnTitleChange (UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/);
252
275
  LRESULT OnWebKitMessages (UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/);
253
276
  LRESULT OnBeforeNavigate (UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/);
277
+ LRESULT OnNavigateTimeout (UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/);
278
+ LRESULT OnNavigateError (UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/);
279
+ LRESULT OnSetSIPState (UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/);
280
+ LRESULT OnAlertPopup (UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/);
254
281
  #endif
255
282
 
256
283
  public:
@@ -144,7 +144,7 @@ LRESULT CRhoMapViewDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*
144
144
  ::SendMessage(GetDlgItem(IDC_SLIDER_ZOOM).m_hWnd, TBM_SETPOS, TRUE, dwPos);
145
145
 
146
146
  String strImagePath = "lib/res/blue_pushpin.png";
147
- String fullImagePath = CFilePath::join( RHODESAPP().getRhoRootPath(), strImagePath);
147
+ String fullImagePath = CFilePath::join( RHODESAPP().getRhoRuntimePath(), strImagePath);
148
148
  IDrawingImage* pinImg = ourDrawingDevice.createImage(fullImagePath, true);
149
149
 
150
150
  PIN_INFO pin_info = {0};
@@ -158,7 +158,7 @@ LRESULT CRhoMapViewDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*
158
158
  ourMapView->setPinImage(pinImg, pin_info);
159
159
 
160
160
  strImagePath = "lib/res/callout.png";
161
- fullImagePath = CFilePath::join( RHODESAPP().getRhoRootPath(), strImagePath);
161
+ fullImagePath = CFilePath::join( RHODESAPP().getRhoRuntimePath(), strImagePath);
162
162
  IDrawingImage* pinCalloutImg = ourDrawingDevice.createImage(fullImagePath, true);
163
163
 
164
164
  PIN_INFO pin_callout_info = {0};
@@ -170,12 +170,12 @@ LRESULT CRhoMapViewDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*
170
170
  ourMapView->setPinCalloutImage(pinCalloutImg, pin_callout_info);
171
171
 
172
172
  strImagePath = "lib/res/callout_link.png";
173
- fullImagePath = CFilePath::join( RHODESAPP().getRhoRootPath(), strImagePath);
173
+ fullImagePath = CFilePath::join( RHODESAPP().getRhoRuntimePath(), strImagePath);
174
174
  IDrawingImage* pinCalloutLinkImg = ourDrawingDevice.createImage(fullImagePath, true);
175
175
  ourMapView->setPinCalloutLinkImage(pinCalloutLinkImg, pin_callout_info);
176
176
 
177
177
  strImagePath = "lib/res/esri.png";
178
- fullImagePath = CFilePath::join( RHODESAPP().getRhoRootPath(), strImagePath);
178
+ fullImagePath = CFilePath::join( RHODESAPP().getRhoRuntimePath(), strImagePath);
179
179
  IDrawingImage* esriLogoImg = ourDrawingDevice.createImage(fullImagePath, true);
180
180
  ourMapView->setESRILogoImage(esriLogoImg);
181
181
  }
@@ -38,6 +38,8 @@
38
38
  #include "common/RhoFilePath.h"
39
39
  #include "common/app_build_capabilities.h"
40
40
 
41
+ #include <algorithm>
42
+
41
43
  using namespace rho;
42
44
  using namespace rho::common;
43
45
  using namespace std;
@@ -59,7 +61,6 @@ extern "C" int rho_sys_check_rollback_bundle(const char* szRhoPath);
59
61
  class CEng;
60
62
  extern "C" CEng* rho_wmimpl_get_webkitbrowser(HWND hParentWnd, HINSTANCE hInstance);
61
63
  extern rho::IBrowserEngine* rho_wmimpl_get_webkitBrowserEngine(HWND hwndParent, HINSTANCE rhoAppInstance);
62
-
63
64
  #endif
64
65
 
65
66
 
@@ -117,8 +118,14 @@ class CRhodesModule : public CAtlExeModuleT< CRhodesModule >
117
118
  {
118
119
  static HINSTANCE m_hInstance;
119
120
  CMainWindow m_appWindow;
120
- rho::String m_strRootPath, m_strRhodesPath, m_logPort;//, m_strDebugHost, m_strDebugPort;*/
121
+ rho::String m_strRootPath, m_strRhodesPath, m_logPort, m_strRuntimePath;//, m_strDebugHost, m_strDebugPort;*/
121
122
  int m_nRestarting;
123
+ CExtManager m_oExtManager;
124
+
125
+ #if defined(APP_BUILD_CAPABILITY_MOTOROLA)
126
+ static WCHAR g_ConfigFilePath[MAX_PATH + 1];
127
+ static TCHAR g_StartPage[MAX_PATH + 1];
128
+ #endif // APP_BUILD_CAPABILITY_MOTOROLA
122
129
 
123
130
  #ifdef OS_WINDOWS
124
131
  String m_strHttpProxy;
@@ -128,6 +135,14 @@ public :
128
135
  static HINSTANCE GetModuleInstance(){return m_hInstance;}
129
136
  static void SetModuleInstance(HINSTANCE hInstance){m_hInstance = hInstance;}
130
137
 
138
+ #if defined(APP_BUILD_CAPABILITY_MOTOROLA)
139
+ static void setConfigFilePath(const char* path);
140
+ static void setStartPage(const char* path);
141
+ static void setStartPage(const TCHAR* tpath);
142
+ static WCHAR* getConfigFilePath();
143
+ static TCHAR* getStartPage();
144
+ #endif // APP_BUILD_CAPABILITY_MOTOROLA
145
+
131
146
  HWND GetMainWindow() { return m_appWindow.m_hWnd;}
132
147
  CMainWindow* GetMainWindowObject() { return &m_appWindow;}
133
148
  CMainWindow& GetAppWindow() { return m_appWindow; }
@@ -142,6 +157,7 @@ public :
142
157
  HRESULT PreMessageLoop(int nShowCmd) throw();
143
158
  void RunMessageLoop( ) throw( );
144
159
  const rho::String& getRhoRootPath();
160
+ const rho::String& getRhoRuntimePath();
145
161
  void parseHttpProxyURI(const rho::String &http_proxy);
146
162
  };
147
163
 
@@ -150,6 +166,33 @@ HINSTANCE CRhodesModule::m_hInstance;
150
166
  CRhodesModule _AtlModule;
151
167
  bool g_restartOnExit = false;
152
168
 
169
+ #if defined(APP_BUILD_CAPABILITY_MOTOROLA)
170
+ WCHAR CRhodesModule::g_ConfigFilePath[MAX_PATH + 1] = {0};
171
+ TCHAR CRhodesModule::g_StartPage[MAX_PATH + 1] = {0};
172
+
173
+ extern "C" WCHAR* rho_wmimpl_get_configfilepath()
174
+ {
175
+ return CRhodesModule::getConfigFilePath();
176
+ }
177
+ extern "C" TCHAR* rho_wmimpl_get_startpage()
178
+ {
179
+ return CRhodesModule::getStartPage();
180
+ }
181
+ extern "C" void rho_wmimpl_set_configfilepath(const char* path)
182
+ {
183
+ CRhodesModule::setConfigFilePath(path);
184
+ }
185
+ extern "C" void rho_wmimpl_set_startpage(const char* path)
186
+ {
187
+ CRhodesModule::setStartPage(path);
188
+ }
189
+ extern "C" void rho_wmimpl_set_startpage_tchar(const TCHAR* path)
190
+ {
191
+ CRhodesModule::setStartPage(path);
192
+ }
193
+ #endif // APP_BUILD_CAPABILITY_MOTOROLA
194
+
195
+
153
196
  #ifndef RHODES_EMULATOR
154
197
  rho::IBrowserEngine* rho_wmimpl_createBrowserEngine(HWND hwndParent)
155
198
  {
@@ -190,6 +233,41 @@ bool CRhodesModule::ParseCommandLine(LPCTSTR lpCmdLine, HRESULT* pnRetCode ) thr
190
233
  m_logPort = rho::String("11000");
191
234
  }
192
235
  }
236
+
237
+ #if defined(APP_BUILD_CAPABILITY_MOTOROLA)
238
+ else if (wcsnicmp(lpszToken, _T("s"),1)==0)
239
+ {
240
+ String token = convertToStringA(lpszToken);
241
+ char* path = parseToken( token.c_str(), token.length() );
242
+ if (path) {
243
+ if ((_strnicmp(path+strlen(path)-1,".html",5)==0) || (_strnicmp(path+strlen(path)-5,".htm",4)==0))
244
+ {
245
+ // RhoElements v1.0 compatibility mode
246
+ rho_wmimpl_set_startpage(path);
247
+ } else {
248
+ // RhoElements v2.0 mode
249
+ m_strRootPath = path;
250
+ if (m_strRootPath.substr(0,7).compare("file://")==0)
251
+ m_strRootPath.erase(0,7);
252
+ ::std::replace(m_strRootPath.begin(), m_strRootPath.end(), '\\', '/');
253
+ if (m_strRootPath.at(m_strRootPath.length()-1)!='/')
254
+ m_strRootPath.append("/");
255
+ m_strRootPath.append("rho/");
256
+ }
257
+ free(path);
258
+ }
259
+ }
260
+ else if (wcsnicmp(lpszToken, _T("c"),1)==0)
261
+ {
262
+ String token = convertToStringA(lpszToken);
263
+ char* path = parseToken( token.c_str(), token.length() );
264
+ if (path) {
265
+ rho_wmimpl_set_configfilepath(path);
266
+ free(path);
267
+ }
268
+ }
269
+ #endif // APP_BUILD_CAPABILITY_MOTOROLA
270
+
193
271
  #if defined(OS_WINDOWS)
194
272
  else if (wcsncmp(lpszToken, _T("http_proxy_url"),14)==0)
195
273
  {
@@ -278,6 +356,46 @@ extern "C" void rho_sys_impl_exit_with_errormessage(const char* szTitle, const c
278
356
  extern "C" void rho_scanner_TEST(HWND hwnd);
279
357
  extern "C" void rho_scanner_TEST2();
280
358
 
359
+ #if defined(APP_BUILD_CAPABILITY_MOTOROLA)
360
+
361
+ WCHAR* CRhodesModule::getConfigFilePath()
362
+ {
363
+ return g_ConfigFilePath;
364
+ }
365
+
366
+ TCHAR* CRhodesModule::getStartPage()
367
+ {
368
+ return g_StartPage;
369
+ }
370
+
371
+ void CRhodesModule::setConfigFilePath(const char* path)
372
+ {
373
+ USES_CONVERSION;
374
+ WCHAR* wpath = A2W(path);
375
+ _tcscpy(g_ConfigFilePath, wpath);
376
+ }
377
+
378
+ void CRhodesModule::setStartPage(const char* path)
379
+ {
380
+ USES_CONVERSION;
381
+ TCHAR* tpath = A2T(path);
382
+ setStartPage(tpath);
383
+ }
384
+
385
+ void CRhodesModule::setStartPage(const TCHAR* tpath)
386
+ {
387
+ _tcscpy(g_StartPage, tpath);
388
+ // Store command line parameter in the registry
389
+ HKEY hKey;
390
+ DWORD Disposition;
391
+ RegCreateKeyEx( HKEY_CURRENT_USER, L"Software\\Symbol\\SymbolPB\\Temp", 0, NULL, 0, 0, 0, &hKey, &Disposition );
392
+ RegSetValueEx(hKey, L"cmdline", 0, REG_MULTI_SZ, (const BYTE *) tpath, (wcslen(tpath)+1)*2);
393
+ RegCloseKey(hKey);
394
+ }
395
+
396
+ #endif // APP_BUILD_CAPABILITY_MOTOROLA
397
+
398
+
281
399
  // This method is called immediately before entering the message loop.
282
400
  // It contains initialization code for the application.
283
401
  // Returns:
@@ -397,7 +515,8 @@ HRESULT CRhodesModule::PreMessageLoop(int nShowCmd) throw()
397
515
  return S_FALSE;
398
516
  }
399
517
 
400
- rho::common::CRhodesApp::Create(m_strRootPath, m_strRootPath);
518
+ rho::common::CRhodesApp::Create(m_strRootPath, m_strRootPath, m_strRuntimePath);
519
+ RHODESAPP().setExtManager( &m_oExtManager );
401
520
 
402
521
  DWORD dwStyle = WS_VISIBLE;
403
522
 
@@ -422,6 +541,14 @@ HRESULT CRhodesModule::PreMessageLoop(int nShowCmd) throw()
422
541
  }
423
542
  #endif
424
543
 
544
+ #if defined(APP_BUILD_CAPABILITY_MOTOROLA)
545
+ if (rho_wmimpl_get_startpage()[0] != 0) {
546
+ String spath = convertToStringA(rho_wmimpl_get_startpage());
547
+ RHOCONF().setString("start_path", spath, false);
548
+ }
549
+ #endif // APP_BUILD_CAPABILITY_MOTOROLA
550
+
551
+
425
552
  m_appWindow.InitMainWindow();
426
553
  #endif
427
554
  if (NULL == m_appWindow.m_hWnd)
@@ -521,6 +648,13 @@ void CRhodesModule::RunMessageLoop( ) throw( )
521
648
  const rho::String& CRhodesModule::getRhoRootPath()
522
649
  {
523
650
  if ( m_strRootPath.length() == 0 )
651
+ m_strRootPath = getRhoRuntimePath();
652
+ return m_strRootPath;
653
+ }
654
+
655
+ const rho::String& CRhodesModule::getRhoRuntimePath()
656
+ {
657
+ if ( m_strRuntimePath.length() == 0 )
524
658
  {
525
659
  char rootpath[MAX_PATH];
526
660
  int len;
@@ -533,15 +667,15 @@ const rho::String& CRhodesModule::getRhoRootPath()
533
667
  rootpath[len+1]=0;
534
668
  }
535
669
 
536
- m_strRootPath = rootpath;
537
- m_strRootPath += "rho\\";
670
+ m_strRuntimePath = rootpath;
671
+ m_strRuntimePath += "rho\\";
538
672
 
539
- for(unsigned int i = 0; i < m_strRootPath.length(); i++ )
540
- if ( m_strRootPath.at(i) == '\\' )
541
- m_strRootPath[i] = '/';
673
+ for(unsigned int i = 0; i < m_strRuntimePath.length(); i++ )
674
+ if ( m_strRuntimePath.at(i) == '\\' )
675
+ m_strRuntimePath[i] = '/';
542
676
  }
543
677
 
544
- return m_strRootPath;
678
+ return m_strRuntimePath;
545
679
  }
546
680
 
547
681
  extern "C" int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/,
@@ -609,6 +743,11 @@ extern "C" const char* rho_native_rhopath()
609
743
  return _AtlModule.getRhoRootPath().c_str();
610
744
  }
611
745
 
746
+ extern "C" const char* rho_native_reruntimepath()
747
+ {
748
+ return _AtlModule.getRhoRuntimePath().c_str();
749
+ }
750
+
612
751
  extern "C" HINSTANCE rho_wmimpl_get_appinstance()
613
752
  {
614
753
  return _AtlModule.GetModuleInstance();
@@ -712,7 +851,7 @@ char* parseToken( const char* start, int len ) {
712
851
 
713
852
  int i = 0;
714
853
  for( i = 0; i < len; i++ ){
715
- if ( start[i] == '=' ){
854
+ if (( start[i] == '=' ) || ( start[i] == ':' ) || ( start[i] == ' ' )) {
716
855
  if ( i > 0 ){
717
856
  int s = i-1;
718
857
  for(; s >= 0 && start[s]==' '; s-- );