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.
- data/CHANGELOG +3 -0
- data/Manifest.txt +23 -9
- data/Rakefile +13 -2
- data/doc/build.txt +18 -11
- data/doc/device-caps.txt +4 -68
- data/doc/rhom.txt +33 -0
- data/doc/test-log-debug.txt +18 -42
- data/lib/framework/rho/render.rb +1 -1
- data/lib/framework/rho/rho.rb +31 -1
- data/lib/framework/rho/rhocontroller.rb +2 -2
- data/lib/framework/rhodes.rb +1 -1
- data/lib/framework/rhoframework.rb +4 -0
- data/lib/framework/rholang/localization_simplified.rb +1 -1
- data/lib/framework/rhom/rhom_object_factory.rb +22 -1
- data/lib/framework/version.rb +1 -1
- data/lib/rhodes.rb +1 -1
- data/platform/android/Rhodes/AndroidManifest.xml +2 -2
- data/platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_RhodesService.h +25 -9
- data/platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_extmanager_RhoExtManagerImpl.h +21 -0
- data/platform/android/Rhodes/jni/src/extmanager.cpp +36 -0
- data/platform/android/Rhodes/jni/src/nativeview.cpp +1 -1
- data/platform/android/Rhodes/jni/src/rhodesapp.cpp +14 -5
- data/platform/android/Rhodes/jni/src/rhodessystem.cpp +5 -0
- data/platform/android/Rhodes/jni/src/signature.cpp +29 -3
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/NativeBar.java +3 -3
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivity.java +4 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +42 -7
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/WebView.java +61 -10
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/IRhoExtData.java +6 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/IRhoExtManager.java +39 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/IRhoExtension.java +18 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/RhoExtDataImpl.java +18 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/RhoExtManagerImpl.java +142 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/RhoExtManagerSingleton.java +15 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/MainView.java +6 -3
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SimpleMainView.java +25 -13
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SplashScreen.java +15 -9
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/TabbedMainView.java +15 -5
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/nativeview/RhoNativeViewManager.java +3 -3
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/ImageCapture.java +14 -8
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/Signature.java +218 -51
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/SignatureProperties.java +94 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/SignatureView.java +122 -37
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/GoogleWebView.java +6 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/{WebView.java → IRhoWebView.java} +2 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoWebViewClient.java +4 -0
- data/platform/android/build/RhodesSRC_build.files +8 -1
- data/platform/android/build/android.rake +5 -1
- data/platform/android/build/librhodes_build.files +1 -0
- data/platform/bb/RubyVM/src/com/rho/RhodesApp.java +22 -1
- data/platform/bb/RubyVM/src/com/rho/sync/SyncSource.java +15 -0
- data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RhoSupport.java +4 -0
- data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyRuntime.java +4 -2
- data/platform/bb/build/rhodes_build.files +2 -0
- data/platform/bb/rhodes/src/com/rho/RhoRubyHelper.java +1 -1
- data/platform/bb/rhodes/src/com/rho/rubyext/PNGEncoder.java +613 -0
- data/platform/bb/rhodes/src/com/rho/rubyext/SignatureCapture.java +314 -0
- data/platform/bb/rhodes/src/com/rho/rubyext/WebView.java +1 -1
- data/platform/iphone/Classes/AppManager/AppManager.m +11 -0
- data/platform/iphone/Classes/Rhodes.m +1 -1
- data/platform/iphone/Classes/Signature/SignatureDelegate.h +5 -1
- data/platform/iphone/Classes/Signature/SignatureDelegate.m +186 -5
- data/platform/iphone/Classes/Signature/SignatureView.h +12 -0
- data/platform/iphone/Classes/Signature/SignatureView.m +11 -3
- data/platform/iphone/Classes/SimpleMainView.m +4 -0
- data/platform/iphone/Classes/rho/net/NetRequestImpl.m +98 -3
- data/platform/iphone/Info.plist +1 -1
- data/platform/iphone/rbuild/iphone.rake +18 -5
- data/platform/shared/RhoConnectClient/RhoConnectClient.cpp +1 -1
- data/platform/shared/common/ExtManager.h +64 -9
- data/platform/shared/common/RhoSimConf.h +1 -0
- data/platform/shared/common/RhodesApp.cpp +77 -28
- data/platform/shared/common/RhodesApp.h +9 -4
- data/platform/shared/common/RhodesAppBase.cpp +4 -3
- data/platform/shared/common/RhodesAppBase.h +5 -3
- data/platform/shared/net/HttpServer.cpp +4 -4
- data/platform/shared/net/HttpServer.h +2 -2
- data/platform/shared/qt/rhodes/impl/MainWindowImpl.cpp +1 -1
- data/platform/shared/qt/rhodes/main.cpp +1 -1
- data/platform/shared/ruby/ext/rho/rhoruby.c +12 -2
- data/platform/shared/ruby/ext/rho/rhosupport.c +11 -1
- data/platform/shared/ruby/thread_win32.c +2 -1
- data/platform/shared/rubyext/System.cpp +6 -0
- data/platform/shared/sync/SyncSource.cpp +15 -0
- data/platform/wm/RhoLib/RhoLib.vcproj +0 -4
- data/platform/wm/build/build_inf.js +34 -4
- data/platform/wm/build/wm.rake +75 -25
- data/platform/wm/rhodes/AppManager.cpp +14 -3
- data/platform/wm/rhodes/IBrowserEngine.h +7 -0
- data/platform/wm/rhodes/IEBrowserEngine.cpp +43 -0
- data/platform/wm/rhodes/IEBrowserEngine.h +7 -0
- data/platform/wm/rhodes/LogOptionsDlg.cpp +1 -1
- data/platform/wm/rhodes/MainWindow.cpp +92 -7
- data/platform/wm/rhodes/MainWindow.h +28 -1
- data/platform/wm/rhodes/MapView/MapViewManager.cpp +4 -4
- data/platform/wm/rhodes/Rhodes.cpp +149 -10
- data/platform/wm/rhodes/resource.h +5 -1
- data/platform/wm/rhodes/rho/common/ExtManager.cpp +307 -0
- data/platform/wm/rhodes/rho/rubyext/NativeToolbar.cpp +1 -1
- data/platform/wm/rhodes/rho/rubyext/RhoSignature.cpp +1 -1
- data/platform/wm/rhodes/rho/rubyext/RhoSignature.h +1 -1
- data/platform/wm/rhodes/rho/rubyext/SystemImpl.cpp +14 -2
- data/platform/wm/rhodes/rho/rubyext/WebView.cpp +6 -3
- data/platform/wm/rhodes/rhodes.vcproj +5 -1
- data/platform/wm/rhodes/simulator/MainWindowQt.cpp +22 -1
- data/platform/wm/rhodes/simulator/MainWindowQt.h +4 -0
- data/platform/wp7/RhoRubyExtGen/RhoWebView.cs +1 -1
- data/platform/wp7/RhoRubyLib/Initializers.Generated.cs +1 -1
- data/platform/wp7/RhoRubyLib/common/RhodesApp.cs +33 -38
- data/platform/wp7/RhoRubyLib/net/HttpServer.cs +134 -29
- data/platform/wp7/RhoRubyLib/rubyext/RhoWebView.cs +12 -2
- data/platform/wp7/RhoRubyLib/sync/SyncSource.cs +17 -1
- data/platform/wp7/RhoRubyLib/views/RhoTabHeader.xaml +3 -3
- data/platform/wp7/RhoRubyLib/views/RhoView.xaml.cs +48 -8
- data/rakefile.rb +13 -2
- data/res/build-tools/iphonesim/build/Release/iphonesim_43 +0 -0
- data/res/build-tools/iphonesim/iphonesim.xcodeproj/project.pbxproj +158 -0
- data/res/generators/rhogen.rb +33 -28
- data/res/generators/templates/application/app/layout.erb +6 -5
- data/res/generators/templates/application/public/css/android.css +21 -315
- data/res/generators/templates/application/public/css/iphone.css +1 -499
- data/res/generators/templates/application/public/css/jqmobile-patch.css +18 -5
- data/res/generators/templates/application/public/css/windows_phone7.css +378 -0
- data/res/generators/templates/application/public/jqmobile/images/icons-18-black.png +0 -0
- data/res/generators/templates/application/public/jqmobile/images/icons-36-black.png +0 -0
- data/res/generators/templates/application/public/jqmobile/{jquery.mobile-1.0.css → jquery.mobile-1.0.1.css} +33 -11
- data/res/generators/templates/application/public/jqmobile/{jquery.mobile-1.0.js → jquery.mobile-1.0.1.js} +249 -125
- data/res/generators/templates/application/public/jqmobile/jquery.mobile-1.0.1.min.css +2 -0
- data/res/generators/templates/application/public/jqmobile/jquery.mobile-1.0.1.min.js +177 -0
- data/res/generators/templates/application/public/jqmobile/{jquery.mobile.structure-1.0.css → jquery.mobile.structure-1.0.1.css} +33 -11
- data/res/generators/templates/application/public/jqmobile/jquery.mobile.structure-1.0.1.min.css +2 -0
- data/res/generators/templates/application/public/jquery/jquery.json-2.3.js +193 -0
- data/res/generators/templates/application/public/jquery/jquery.json-2.3.min.js +23 -0
- data/res/generators/templates/application/public/js/jquery-wp7-patch.js +68 -20
- data/spec/phone_spec/app/Case/case.rb +22 -0
- data/spec/phone_spec/app/Customer/customer.rb +16 -0
- data/spec/phone_spec/app/spec/rhom_object_spec.rb +108 -11
- data/spec/phone_spec/app/spec/syncengine_spec.rb +43 -1
- data/spec/phone_spec/build.yml +2 -1
- data/version +1 -1
- metadata +27 -13
- data/platform/shared/common/ExtManager.cpp +0 -103
- data/res/generators/templates/application/public/jqmobile/jquery-mobile-iphone.css +0 -9
- data/res/generators/templates/application/public/jqmobile/jquery.mobile-1.0.min.css +0 -2
- data/res/generators/templates/application/public/jqmobile/jquery.mobile-1.0.min.js +0 -172
- data/res/generators/templates/application/public/jqmobile/jquery.mobile.structure-1.0.min.css +0 -2
@@ -52,7 +52,7 @@ public:
|
|
52
52
|
|
53
53
|
private:
|
54
54
|
|
55
|
-
CRhodesApp(const String& strRootPath, const String& strUserPath);
|
55
|
+
CRhodesApp(const String& strRootPath, const String& strUserPath, const String& strRuntimePath);
|
56
56
|
boolean m_bExit, m_bRestartServer;
|
57
57
|
|
58
58
|
String m_strListeningPorts;
|
@@ -61,7 +61,6 @@ private:
|
|
61
61
|
CSplashScreen m_oSplashScreen;
|
62
62
|
CAppMenu m_oAppMenu;
|
63
63
|
CRhoTimer m_oTimer;
|
64
|
-
CExtManager m_oExtManager;
|
65
64
|
|
66
65
|
String m_strLoadingPagePath, m_strLoadingPngPath;
|
67
66
|
String m_strStartUrl, m_strOptionsUrl, m_strRhobundleReloadUrl;//, m_strFirstStartUrl;
|
@@ -86,11 +85,12 @@ private:
|
|
86
85
|
|
87
86
|
common::CAutoPtr<common::CThreadQueue> m_appCallbacksQueue;
|
88
87
|
boolean m_bSendingLog;
|
88
|
+
CExtManager* m_pExtManager;
|
89
89
|
|
90
90
|
public:
|
91
91
|
~CRhodesApp(void);
|
92
92
|
|
93
|
-
static CRhodesApp* Create(const String& strRootPath, const String& strUserPath);
|
93
|
+
static CRhodesApp* Create(const String& strRootPath, const String& strUserPath, const String& strRuntimePath);
|
94
94
|
static void Destroy();
|
95
95
|
static CRhodesApp* getInstance(){ return (CRhodesApp*)m_pInstance; }
|
96
96
|
void startApp();
|
@@ -105,6 +105,7 @@ public:
|
|
105
105
|
|
106
106
|
const String& getRhobundleReloadUrl();
|
107
107
|
const String& getBaseUrl();
|
108
|
+
void setBaseUrl(const String& strBaseUrl);
|
108
109
|
const String& getStartUrl();
|
109
110
|
const String& getOptionsUrl();
|
110
111
|
const String& getCurrentUrl(int index = 0);
|
@@ -125,6 +126,7 @@ public:
|
|
125
126
|
StringW getAppNameW();
|
126
127
|
|
127
128
|
void callBarcodeCallback(String strCallbackUrl, const String& strBarcode, bool isError);
|
129
|
+
void callCallbackWithData(String strCallbackUrl, String strBody, const String& strCallbackData, bool bWaitForResponse);
|
128
130
|
void callCameraCallback(String strCallbackUrl, const String& strImagePath, const String& strError, boolean bCancel );
|
129
131
|
void callSignatureCallback(String strCallbackUrl, const String& strSignaturePath, const String& strError, boolean bCancel );
|
130
132
|
void callDateTimeCallback(String strCallbackUrl, long lDateTime, const char* szData, int bCancel );
|
@@ -138,7 +140,9 @@ public:
|
|
138
140
|
CAppMenu& getAppMenu (void) { return m_oAppMenu; }
|
139
141
|
CSplashScreen& getSplashScreen(){return m_oSplashScreen;}
|
140
142
|
CRhoTimer& getTimer(){ return m_oTimer; }
|
141
|
-
|
143
|
+
|
144
|
+
void setExtManager( CExtManager* pExtManager ){m_pExtManager = pExtManager; }
|
145
|
+
CExtManager& getExtManager(){ return *m_pExtManager; }
|
142
146
|
|
143
147
|
boolean sendLog(const String& strCallbackUrl);
|
144
148
|
|
@@ -192,6 +196,7 @@ extern "C" {
|
|
192
196
|
|
193
197
|
void rho_rhodesapp_create(const char* szRootPath);
|
194
198
|
void rho_rhodesapp_create_with_separate_user_path(const char* szRootPath, const char* szUserPath);
|
199
|
+
void rho_rhodesapp_create_with_separate_runtime(const char* szRootPath, const char* szRuntimePath);
|
195
200
|
void rho_rhodesapp_start();
|
196
201
|
void rho_rhodesapp_destroy();
|
197
202
|
|
@@ -36,12 +36,12 @@ namespace common{
|
|
36
36
|
IMPLEMENT_LOGCLASS(CRhodesAppBase,"RhodesApp");
|
37
37
|
CRhodesAppBase* CRhodesAppBase::m_pInstance = 0;
|
38
38
|
|
39
|
-
/*static*/ CRhodesAppBase* CRhodesAppBase::Create(const String& strRootPath, const String& strUserPath)
|
39
|
+
/*static*/ CRhodesAppBase* CRhodesAppBase::Create(const String& strRootPath, const String& strUserPath, const String& strRuntimePath)
|
40
40
|
{
|
41
41
|
if ( m_pInstance != null)
|
42
42
|
return m_pInstance;
|
43
43
|
|
44
|
-
m_pInstance = new CRhodesAppBase(strRootPath, strUserPath);
|
44
|
+
m_pInstance = new CRhodesAppBase(strRootPath, strUserPath, strRuntimePath);
|
45
45
|
return m_pInstance;
|
46
46
|
}
|
47
47
|
|
@@ -53,10 +53,11 @@ CRhodesAppBase* CRhodesAppBase::m_pInstance = 0;
|
|
53
53
|
m_pInstance = 0;
|
54
54
|
}
|
55
55
|
|
56
|
-
CRhodesAppBase::CRhodesAppBase(const String& strRootPath, const String& strUserPath) : CRhoThread()
|
56
|
+
CRhodesAppBase::CRhodesAppBase(const String& strRootPath, const String& strUserPath, const String& strRuntimePath) : CRhoThread()
|
57
57
|
{
|
58
58
|
m_strRhoRootPath = strRootPath;
|
59
59
|
m_strAppUserPath = strUserPath;
|
60
|
+
m_strRuntimePath = strRuntimePath;
|
60
61
|
|
61
62
|
initAppUrls();
|
62
63
|
}
|
@@ -47,12 +47,12 @@ protected:
|
|
47
47
|
|
48
48
|
static CRhodesAppBase* m_pInstance;
|
49
49
|
|
50
|
-
String m_strRhoRootPath, m_strBlobsDirPath, m_strDBDirPath, m_strAppRootPath, m_strAppUserPath;//, m_strRhodesPath;
|
50
|
+
String m_strRhoRootPath, m_strBlobsDirPath, m_strDBDirPath, m_strAppRootPath, m_strAppUserPath, m_strRuntimePath;//, m_strRhodesPath;
|
51
51
|
String m_strHomeUrl;
|
52
52
|
|
53
|
-
CRhodesAppBase(const String& strRootPath, const String& strUserPath);
|
53
|
+
CRhodesAppBase(const String& strRootPath, const String& strUserPath, const String& strRuntimePath);
|
54
54
|
public:
|
55
|
-
static CRhodesAppBase* Create(const String& strRootPath, const String& strUserPath);
|
55
|
+
static CRhodesAppBase* Create(const String& strRootPath, const String& strUserPath, const String& strRuntimePath);
|
56
56
|
static void Destroy();
|
57
57
|
static CRhodesAppBase* getInstance(){ return m_pInstance; }
|
58
58
|
|
@@ -60,6 +60,7 @@ public:
|
|
60
60
|
String getRelativeDBFilesPath(const String& strFilePath);
|
61
61
|
const String& getRhoRootPath(){return m_strRhoRootPath;}
|
62
62
|
const String& getRhoUserPath(){return m_strAppUserPath;}
|
63
|
+
const String& getRhoRuntimePath(){return m_strRuntimePath;}
|
63
64
|
//const String& getRhodesPath(){return m_strRhodesPath;}
|
64
65
|
//void setRhodesPath(const String& path){m_strRhodesPath = path;}
|
65
66
|
const String& getAppRootPath(){return m_strAppRootPath;}
|
@@ -87,6 +88,7 @@ inline rho::common::CRhodesAppBase& RHODESAPPBASE(){ return *rho::common::CRhode
|
|
87
88
|
extern "C" {
|
88
89
|
#endif //__cplusplus
|
89
90
|
|
91
|
+
const char* rho_native_reruntimepath();
|
90
92
|
const char* rho_native_rhopath();
|
91
93
|
const char* rho_native_rhouserpath();
|
92
94
|
const char* rho_native_rhodbpath();
|
@@ -275,11 +275,12 @@ static VALUE create_request_hash(String const &application, String const &model,
|
|
275
275
|
return hash;
|
276
276
|
}
|
277
277
|
|
278
|
-
CHttpServer::CHttpServer(int port, String const &root, String const &user_root)
|
278
|
+
CHttpServer::CHttpServer(int port, String const &root, String const &user_root, String const &runtime_root)
|
279
279
|
:m_active(false), m_port(port), verbose(true)
|
280
280
|
{
|
281
281
|
m_root = CFilePath::normalizePath(root);
|
282
282
|
m_strRhoRoot = m_root.substr(0, m_root.length()-5);
|
283
|
+
m_strRuntimeRoot = runtime_root.substr(0, runtime_root.length()-5);
|
283
284
|
m_userroot = CFilePath::normalizePath(user_root);
|
284
285
|
m_strRhoUserRoot = m_userroot;
|
285
286
|
}
|
@@ -288,10 +289,9 @@ CHttpServer::CHttpServer(int port, String const &root)
|
|
288
289
|
:m_active(false), m_port(port), verbose(true)
|
289
290
|
{
|
290
291
|
m_root = CFilePath::normalizePath(root);
|
291
|
-
m_strRhoRoot = m_root.substr(0, m_root.length()-5);
|
292
|
+
m_strRuntimeRoot = m_strRhoRoot = m_root.substr(0, m_root.length()-5);
|
292
293
|
m_userroot = CFilePath::normalizePath(root);
|
293
294
|
m_strRhoUserRoot = m_root.substr(0, m_root.length()-5);
|
294
|
-
|
295
295
|
}
|
296
296
|
|
297
297
|
CHttpServer::~CHttpServer()
|
@@ -972,7 +972,7 @@ bool CHttpServer::send_file(String const &path, HeaderList const &hdrs)
|
|
972
972
|
|
973
973
|
if (String_startsWith(fullPath,"/app/db/db-files") )
|
974
974
|
fullPath = CFilePath::join( rho_native_rhodbpath(), path.substr(4) );
|
975
|
-
else if (fullPath.find(m_root) != 0 && fullPath.find(m_strRhoRoot) != 0 && fullPath.find(m_userroot) != 0 && fullPath.find(m_strRhoUserRoot) != 0)
|
975
|
+
else if (fullPath.find(m_root) != 0 && fullPath.find(m_strRhoRoot) != 0 && fullPath.find(m_strRuntimeRoot) != 0 && fullPath.find(m_userroot) != 0 && fullPath.find(m_strRhoUserRoot) != 0)
|
976
976
|
fullPath = CFilePath::join( m_root, path );
|
977
977
|
|
978
978
|
if (verbose) RAWTRACE1("Sending file %s...", fullPath.c_str());
|
@@ -94,7 +94,7 @@ public:
|
|
94
94
|
|
95
95
|
public:
|
96
96
|
CHttpServer(int port, String const &root);
|
97
|
-
CHttpServer(int port, String const &root, String const &user_root);
|
97
|
+
CHttpServer(int port, String const &root, String const &user_root, String const &runtime_root);
|
98
98
|
~CHttpServer();
|
99
99
|
|
100
100
|
void register_uri(String const &uri, callback_t const &callback);
|
@@ -140,7 +140,7 @@ private:
|
|
140
140
|
private:
|
141
141
|
bool m_active;
|
142
142
|
int m_port;
|
143
|
-
String m_root, m_userroot, m_strRhoRoot, m_strRhoUserRoot;
|
143
|
+
String m_root, m_userroot, m_strRhoRoot, m_strRhoUserRoot, m_strRuntimeRoot;
|
144
144
|
SOCKET m_listener;
|
145
145
|
SOCKET m_sock;
|
146
146
|
std::map<String, callback_t> m_registered;
|
@@ -429,7 +429,7 @@ void CMainWindow::createToolbar(rho_param *p)
|
|
429
429
|
#ifdef RHODES_EMULATOR
|
430
430
|
strImagePath = strImagePath.length() > 0 ? CFilePath::join( RHOSIMCONF().getRhodesPath(), "lib/framework/" + strImagePath) : String();
|
431
431
|
#else
|
432
|
-
strImagePath = strImagePath.length() > 0 ? CFilePath::join(
|
432
|
+
strImagePath = strImagePath.length() > 0 ? CFilePath::join( rho_native_reruntimepath() , "lib/" + strImagePath) : String();
|
433
433
|
#endif
|
434
434
|
}
|
435
435
|
|
@@ -185,7 +185,7 @@ int main(int argc, char *argv[])
|
|
185
185
|
setenv("rho_debug_port", RHOSIMCONF().getString("debug_port").c_str(), 1 );
|
186
186
|
#endif // OS_WINDOWS
|
187
187
|
#endif // RHODES_EMULATOR
|
188
|
-
rho::common::CRhodesApp::Create(m_strRootPath, m_strRootPath);
|
188
|
+
rho::common::CRhodesApp::Create(m_strRootPath, m_strRootPath, m_strRootPath);
|
189
189
|
|
190
190
|
// Create the main application window
|
191
191
|
#ifdef RHODES_EMULATOR
|
@@ -36,6 +36,7 @@
|
|
36
36
|
#include "../stat/stat.h"
|
37
37
|
#endif
|
38
38
|
|
39
|
+
#include "common/app_build_capabilities.h"
|
39
40
|
#include "logging/RhoLog.h"
|
40
41
|
|
41
42
|
#ifdef RHODES_EMULATOR
|
@@ -77,6 +78,7 @@ extern void Init_RhoSupport(void);
|
|
77
78
|
extern VALUE require_compiled(VALUE fname, VALUE* result);
|
78
79
|
extern VALUE RhoPreparePath(VALUE path);
|
79
80
|
extern const char* rho_native_rhopath();
|
81
|
+
extern const char* rho_native_reruntimepath();
|
80
82
|
extern const char* rho_native_rhouserpath();
|
81
83
|
//extern void RhoSetCurAppPath(char* path);
|
82
84
|
|
@@ -192,7 +194,7 @@ void RhoRubyStart()
|
|
192
194
|
//rb_funcall(rb_mGC, rb_intern("stress="), 1, Qtrue);
|
193
195
|
|
194
196
|
ruby_init_loadpath(szRoot);
|
195
|
-
#
|
197
|
+
#if defined(RHODES_EMULATOR) || defined(APP_BUILD_CAPABILITY_MOTOROLA)
|
196
198
|
{
|
197
199
|
VALUE load_path = GET_VM()->load_path;
|
198
200
|
char* app_path = malloc(strlen(szRoot)+100);
|
@@ -200,12 +202,20 @@ void RhoRubyStart()
|
|
200
202
|
rb_ary_clear(load_path);
|
201
203
|
|
202
204
|
strcpy(app_path, szRoot);
|
205
|
+
#if defined(RHODES_EMULATOR)
|
203
206
|
strcat(app_path, "app");
|
204
|
-
|
207
|
+
#else
|
208
|
+
strcat(app_path, "apps/app");
|
209
|
+
#endif
|
205
210
|
rb_ary_push(load_path, rb_str_new2(app_path) );
|
206
211
|
|
212
|
+
#if defined(APP_BUILD_CAPABILITY_MOTOROLA)
|
213
|
+
strcpy(app_path, rho_native_reruntimepath());
|
214
|
+
strcat(app_path, "lib");
|
215
|
+
#else
|
207
216
|
strcpy(app_path, rho_simconf_getRhodesPath());
|
208
217
|
strcat(app_path, "/lib/framework");
|
218
|
+
#endif
|
209
219
|
rb_ary_push(load_path, rb_str_new2(app_path) );
|
210
220
|
}
|
211
221
|
|
@@ -60,6 +60,11 @@ VALUE __rhoGetCurrentDir(void)
|
|
60
60
|
return rb_str_new2(rho_native_rhopath());
|
61
61
|
}
|
62
62
|
|
63
|
+
VALUE __rhoGetRuntimeDir(void)
|
64
|
+
{
|
65
|
+
return rb_str_new2(rho_native_reruntimepath());
|
66
|
+
}
|
67
|
+
|
63
68
|
VALUE __rhoGetUserDir(void)
|
64
69
|
{
|
65
70
|
return rb_str_new2(rho_native_rhouserpath());
|
@@ -271,8 +276,8 @@ static VALUE check_extension(VALUE res, VALUE fname, int nAddExtName)
|
|
271
276
|
|
272
277
|
static VALUE check_app_file_exist(VALUE dir, VALUE fname1, const char* szPlatform)
|
273
278
|
{
|
274
|
-
//RAWLOG_INFO1("find_file: check dir %s", RSTRING_PTR(dir));
|
275
279
|
VALUE res = rb_str_dup(dir);
|
280
|
+
//RAWLOG_INFO1("find_file: check dir %s", RSTRING_PTR(dir));
|
276
281
|
|
277
282
|
#ifdef __SYMBIAN32__
|
278
283
|
if(*RSTRING_PTR(res) == '/')
|
@@ -309,6 +314,10 @@ static VALUE find_file(VALUE fname)
|
|
309
314
|
res = rb_str_dup(fname);
|
310
315
|
rb_str_cat(res,RHO_RB_EXT,strlen(RHO_RB_EXT));
|
311
316
|
//RAWLOG_INFO1("find_file: res: %s", RSTRING_PTR(res));
|
317
|
+
} else if ( strncmp(RSTRING_PTR(fname), rho_native_reruntimepath(), strlen(rho_native_reruntimepath())) == 0 ){
|
318
|
+
res = rb_str_dup(fname);
|
319
|
+
rb_str_cat(res,RHO_RB_EXT,strlen(RHO_RB_EXT));
|
320
|
+
//RAWLOG_INFO1("find_file: res: %s", RSTRING_PTR(res));
|
312
321
|
}else{
|
313
322
|
int i = 0;
|
314
323
|
VALUE load_path = GET_VM()->load_path;
|
@@ -582,6 +591,7 @@ void Init_RhoSupport()
|
|
582
591
|
rb_define_global_function("__rhoGetRhodesDir", __rhoGetRhodesDir, 0);
|
583
592
|
#endif
|
584
593
|
rb_define_global_function("__rhoGetCurrentDir", __rhoGetCurrentDir, 0);
|
594
|
+
rb_define_global_function("__rhoGetRuntimeDir", __rhoGetRuntimeDir, 0);
|
585
595
|
rb_define_global_function("__rhoGetUserDir", __rhoGetUserDir, 0);
|
586
596
|
rb_define_global_function("__rhoGetDBDir", __rhoGetDBDir, 0);
|
587
597
|
rb_define_global_function("load", rb_load_compiled, 1);
|
@@ -495,6 +495,7 @@ thread_start_func_1(void *th_ptr)
|
|
495
495
|
volatile HANDLE thread_id = th->thread_id;
|
496
496
|
|
497
497
|
native_thread_init_stack(th);
|
498
|
+
//RHO
|
498
499
|
/* th->native_thread_data.interrupt_event = CreateEvent(0, TRUE, FALSE, 0);
|
499
500
|
|
500
501
|
if ( !th->native_thread_data.interrupt_event)
|
@@ -503,7 +504,7 @@ thread_start_func_1(void *th_ptr)
|
|
503
504
|
thread_debug("thread interrupt_event error: %d\n", dwErr );
|
504
505
|
}
|
505
506
|
*/
|
506
|
-
|
507
|
+
//RHO
|
507
508
|
/* run */
|
508
509
|
thread_debug("thread created (th: %p, thid: %p, event: %p)\n", th,
|
509
510
|
th->thread_id, th->native_thread_data.interrupt_event);
|
@@ -141,6 +141,12 @@ VALUE rho_sys_get_property(char* szPropName)
|
|
141
141
|
return rho_ruby_create_boolean(0);
|
142
142
|
#endif
|
143
143
|
|
144
|
+
if (strcasecmp("has_cell_network",szPropName) == 0)
|
145
|
+
return rho_sys_has_network();
|
146
|
+
|
147
|
+
if (strcasecmp("has_wifi_network",szPropName) == 0)
|
148
|
+
return rho_sys_has_network();
|
149
|
+
|
144
150
|
RAWLOG_ERROR1("Unknown Rho::System property : %s", szPropName);
|
145
151
|
|
146
152
|
return rho_ruby_get_NIL();
|
@@ -867,6 +867,14 @@ void CSyncSource::processServerCmd_Ver3_Schema(const String& strCmd, const Strin
|
|
867
867
|
for( ; !attrIter.isEnd(); attrIter.next() )
|
868
868
|
{
|
869
869
|
CAttrValue oAttrValue(attrIter.getCurKey(),attrIter.getCurString());
|
870
|
+
|
871
|
+
String strFreezedProps = getSync().getSourceOptions().getProperty(getID(), "freezed");
|
872
|
+
if ( strFreezedProps.length() > 0 && strFreezedProps.find(oAttrValue.m_strAttrib) == String::npos )
|
873
|
+
{
|
874
|
+
LOG(INFO) + "Skip Non-exist property : " + oAttrValue.m_strAttrib + ". For model : " + getName();
|
875
|
+
continue;
|
876
|
+
}
|
877
|
+
|
870
878
|
if ( !processBlob(strCmd,strObject,oAttrValue) )
|
871
879
|
break;
|
872
880
|
|
@@ -1045,6 +1053,13 @@ void CSyncSource::processServerCmd_Ver3(const String& strCmd, const String& strO
|
|
1045
1053
|
|
1046
1054
|
if ( strCmd.compare("insert") == 0 )
|
1047
1055
|
{
|
1056
|
+
String strFreezedProps = getSync().getSourceOptions().getProperty(getID(), "freezed");
|
1057
|
+
if ( strFreezedProps.length() > 0 && strFreezedProps.find(oAttrValue.m_strAttrib) == String::npos )
|
1058
|
+
{
|
1059
|
+
LOG(INFO) + "Skip Non-exist property : " + oAttrValue.m_strAttrib + ". For model : " + getName();
|
1060
|
+
return;
|
1061
|
+
}
|
1062
|
+
|
1048
1063
|
if ( !processBlob(strCmd,strObject,oAttrValue) )
|
1049
1064
|
return;
|
1050
1065
|
|
@@ -15,25 +15,43 @@ function p(str) {
|
|
15
15
|
output_file.WriteLine(str);
|
16
16
|
}
|
17
17
|
|
18
|
-
function expand_source(es,name,path,section,destination) {
|
18
|
+
function expand_source(es,name,path,section,destination,flag) {
|
19
19
|
var s = new Object();
|
20
20
|
s.name = name;
|
21
21
|
s.path = path;
|
22
22
|
s.section = ""+section+"_"+name.replace(/ /g,"_");
|
23
|
-
|
23
|
+
|
24
|
+
if (destination == null || destination == "")
|
25
|
+
{
|
26
|
+
if (flag == true)
|
27
|
+
s.destination = "";
|
28
|
+
else
|
29
|
+
s.destination = name;
|
30
|
+
}
|
31
|
+
else {
|
32
|
+
s.destination = destination+"\\"+name;
|
33
|
+
}
|
34
|
+
|
24
35
|
s.folder = fso.GetFolder(path);
|
25
36
|
es.push(s);
|
26
37
|
|
27
38
|
var fc = new Enumerator(s.folder.SubFolders);
|
28
39
|
for (; !fc.atEnd(); fc.moveNext()) {
|
29
|
-
expand_source(es,fc.item().Name,fc.item().Path,s.section,s.destination);
|
40
|
+
expand_source(es,fc.item().Name,fc.item().Path,s.section,s.destination,false);
|
30
41
|
}
|
31
42
|
}
|
32
43
|
|
33
44
|
function expand_sources(sources) {
|
34
45
|
var es = new Array();
|
35
46
|
for (var i in sources) {
|
36
|
-
expand_source(es,sources[i][0],sources[i][1],"copyfiles","rho");
|
47
|
+
expand_source(es,sources[i][0],sources[i][1],"copyfiles","rho",false);
|
48
|
+
}
|
49
|
+
return es;
|
50
|
+
}
|
51
|
+
|
52
|
+
function expand_sources1(es, sources) {
|
53
|
+
for (var i in sources) {
|
54
|
+
expand_source(es, sources[i][0], sources[i][1], "copyfiles", "",true);
|
37
55
|
}
|
38
56
|
return es;
|
39
57
|
}
|
@@ -290,6 +308,7 @@ function main() {
|
|
290
308
|
// args(5) = hidden_app
|
291
309
|
// args(6) = include motorola webkit binaries and configs
|
292
310
|
// args(7) = rhoelements gem folder path
|
311
|
+
// args(8) = additional files
|
293
312
|
|
294
313
|
var args = WScript.Arguments;
|
295
314
|
fso = new ActiveXObject("Scripting.FileSystemObject");
|
@@ -302,6 +321,17 @@ function main() {
|
|
302
321
|
sources['apps']= ["apps",args(4)+"/apps"];
|
303
322
|
|
304
323
|
var es = expand_sources(sources);
|
324
|
+
|
325
|
+
for (var idx = 8; idx < args.length; idx++)
|
326
|
+
{
|
327
|
+
if (args(idx) == null)
|
328
|
+
break;
|
329
|
+
|
330
|
+
var sources_add = new Object();
|
331
|
+
sources_add['files']= ["add" + idx,args(idx)];
|
332
|
+
es = expand_sources1(es, sources_add);
|
333
|
+
}
|
334
|
+
|
305
335
|
var exts = expand_extensions(args(1));
|
306
336
|
pinf(args(1),es,exts,args(2),args(3), (args(5) == "0"), (args(6) == "1"), args(7));
|
307
337
|
|
data/platform/wm/build/wm.rake
CHANGED
@@ -106,6 +106,7 @@ namespace "config" do
|
|
106
106
|
$cabwiz = "cabwiz" if $cabwiz.nil?
|
107
107
|
$webkit_capability = !($app_config["capabilities"].nil? or $app_config["capabilities"].index("webkit_browser").nil?)
|
108
108
|
$wk_data_dir = "/Program Files" # its fake value for running without motorola extensions. do not delete
|
109
|
+
$additional_dlls_path = nil
|
109
110
|
|
110
111
|
begin
|
111
112
|
if $webkit_capability
|
@@ -144,10 +145,32 @@ namespace "build" do
|
|
144
145
|
namespace "wm" do
|
145
146
|
task :extensions => "config:wm" do
|
146
147
|
|
148
|
+
if $additional_dlls_path.nil?
|
149
|
+
puts 'new $additional_dlls_paths'
|
150
|
+
$additional_dlls_paths = Array.new
|
151
|
+
end
|
152
|
+
|
147
153
|
$app_config["extensions"].each do |ext|
|
148
154
|
$app_config["extpaths"].each do |p|
|
149
155
|
extpath = File.join(p, ext, 'ext')
|
156
|
+
commin_ext_path = File.join(p, ext)
|
157
|
+
ext_config_path = File.join(p, ext, "ext.yml")
|
158
|
+
ext_config = nil
|
159
|
+
|
150
160
|
next unless File.exists? File.join(extpath, "build.bat")
|
161
|
+
|
162
|
+
puts "ext_config_path - " + ext_config_path.to_s
|
163
|
+
if File.exist? ext_config_path
|
164
|
+
ext_config = YAML::load_file(ext_config_path)
|
165
|
+
end
|
166
|
+
|
167
|
+
puts "extpath - " + commin_ext_path.to_s
|
168
|
+
chdir commin_ext_path
|
169
|
+
if ext_config != nil && ext_config["files"] != nil
|
170
|
+
puts "ext_config[files] - " + ext_config["files"].to_s
|
171
|
+
$additional_dlls_paths << File.expand_path(ext_config["files"])
|
172
|
+
end
|
173
|
+
chdir $startdir
|
151
174
|
|
152
175
|
ENV['RHO_PLATFORM'] = $current_platform
|
153
176
|
ENV['RHO_BUILD_CONFIG'] = 'Release'
|
@@ -159,7 +182,6 @@ namespace "build" do
|
|
159
182
|
ENV['VCBUILD'] = $vcbuild
|
160
183
|
ENV['SDK'] = $sdk
|
161
184
|
|
162
|
-
#puts Jake.run("build.bat", [], extpath)
|
163
185
|
chdir extpath
|
164
186
|
puts `build.bat`
|
165
187
|
chdir $startdir
|
@@ -167,6 +189,11 @@ namespace "build" do
|
|
167
189
|
break
|
168
190
|
end
|
169
191
|
end
|
192
|
+
#test
|
193
|
+
$additional_dlls_paths.each do |x|
|
194
|
+
puts " - " + x.to_s
|
195
|
+
end
|
196
|
+
#exit
|
170
197
|
end
|
171
198
|
|
172
199
|
# desc "Build wm rhobundle"
|
@@ -360,8 +387,12 @@ namespace "device" do
|
|
360
387
|
File.open(filepath, "w") { |f| f.write(config) }
|
361
388
|
end
|
362
389
|
end
|
363
|
-
|
390
|
+
|
364
391
|
args = ['build_inf.js', $appname + ".inf", build_platform, '"' + $app_config["name"] +'"', $app_config["vendor"], '"' + $srcdir + '"', $hidden_app, ($webkit_capability ? "1" : "0"), $wk_data_dir]
|
392
|
+
|
393
|
+
$additional_dlls_paths.each do |path|
|
394
|
+
args << path
|
395
|
+
end
|
365
396
|
|
366
397
|
puts Jake.run('cscript',args)
|
367
398
|
unless $? == 0
|
@@ -448,23 +479,28 @@ namespace "run" do
|
|
448
479
|
puts "\nStarting application on the WM6 emulator\n\n"
|
449
480
|
log_file = gelLogPath
|
450
481
|
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
sleep(1)
|
461
|
-
end
|
482
|
+
File.delete($app_path + "/started") if File.exists?($app_path + "/started")
|
483
|
+
Jake.run_rho_log_server($app_path)
|
484
|
+
puts "RhoLogServer is starting"
|
485
|
+
while true do
|
486
|
+
if File.exists?($app_path + "/started")
|
487
|
+
break
|
488
|
+
end
|
489
|
+
sleep(1)
|
490
|
+
end
|
462
491
|
|
463
492
|
if $webkit_capability
|
464
493
|
wk_args = [ 'wk-emu', "\"#{$wm_emulator}\"", '"'+ $wk_data_dir.gsub(/"/,'\\"') + '"', '"'+ $appname + '"']
|
465
494
|
Jake.run2( detool, wk_args, {:nowait => false})
|
466
495
|
end
|
467
496
|
|
497
|
+
#if $additional_dlls_paths
|
498
|
+
# $additional_dlls_paths.each do |path|
|
499
|
+
# add_files_args = [ 'wk-emu', "\"#{$wm_emulator}\"", '"'+ path.gsub(/"/,'\\"') + '"', '"'+ $appname + '"']
|
500
|
+
# Jake.run2( detool, add_files_args, {:nowait => false})
|
501
|
+
# end
|
502
|
+
#end
|
503
|
+
|
468
504
|
args = [ 'emu', "\"#{$wm_emulator}\"", '"'+$appname.gsub(/"/,'\\"')+'"', '"'+$srcdir.gsub(/"/,'\\"')+'"', '"'+($startdir + "/" + $vcbindir + "/#{$sdk}" + "/rhodes/Release/" + $appname + ".exe").gsub(/"/,'\\"')+'"' , $port]
|
469
505
|
Jake.run2( detool, args, {:nowait => false})
|
470
506
|
end
|
@@ -496,25 +532,29 @@ namespace "run" do
|
|
496
532
|
puts "Please, connect you device via ActiveSync.\n\n"
|
497
533
|
log_file = gelLogPath
|
498
534
|
|
499
|
-
|
500
|
-
# Jake.run2( detool, ['log', log_file, $port], {:nowait => true})
|
501
|
-
|
502
|
-
File.delete($app_path + "/started") if File.exists?($app_path + "/started")
|
535
|
+
File.delete($app_path + "/started") if File.exists?($app_path + "/started")
|
503
536
|
|
504
537
|
Jake.run_rho_log_server($app_path)
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
538
|
+
puts "RhoLogServer is starting"
|
539
|
+
while true do
|
540
|
+
if File.exists?($app_path + "/started")
|
541
|
+
break
|
542
|
+
end
|
543
|
+
sleep(1)
|
544
|
+
end
|
512
545
|
|
513
546
|
if $webkit_capability
|
514
547
|
wk_args = [ 'wk-dev', '"'+ $wk_data_dir.gsub(/"/,'\\"') + '"', '"'+ $appname + '"']
|
515
548
|
Jake.run2( detool, wk_args, {:nowait => false})
|
516
549
|
end
|
517
550
|
|
551
|
+
#if $additional_dlls_paths
|
552
|
+
# $additional_dlls_paths.each do |path|
|
553
|
+
# add_files_args = [ 'wk-dev', '"'+ path.gsub(/"/,'\\"') + '"', '"'+ $appname + '"']
|
554
|
+
# Jake.run2( detool, add_files_args, {:nowait => false})
|
555
|
+
# end
|
556
|
+
#end
|
557
|
+
|
518
558
|
args = [ 'dev', '"'+$appname.gsub(/"/,'\\"')+'"', '"'+$srcdir.gsub(/"/,'\\"')+'"', '"'+($startdir + "/" + $vcbindir + "/#{$sdk}" + "/rhodes/Release/" + $appname + ".exe").gsub(/"/,'\\"')+'"', $port ]
|
519
559
|
Jake.run2( detool, args, {:nowait => false})
|
520
560
|
end
|
@@ -532,10 +572,20 @@ namespace "run" do
|
|
532
572
|
#remove log file
|
533
573
|
rm_rf log_file if File.exists?(log_file)
|
534
574
|
|
575
|
+
File.delete($app_path + "/started") if File.exists?($app_path + "/started")
|
576
|
+
Jake.run_rho_log_server($app_path)
|
577
|
+
puts "RhoLogServer is starting"
|
578
|
+
while true do
|
579
|
+
if File.exists?($app_path + "/started")
|
580
|
+
break
|
581
|
+
end
|
582
|
+
sleep(1)
|
583
|
+
end
|
584
|
+
|
535
585
|
Jake.before_run_spec
|
536
586
|
start = Time.now
|
537
587
|
|
538
|
-
Jake.run2( detool, ['log', log_file, $port], {:nowait => true})
|
588
|
+
#Jake.run2( detool, ['log', log_file, $port], {:nowait => true})
|
539
589
|
Jake.run2( detool, args, {:nowait => false})
|
540
590
|
|
541
591
|
puts "waiting for log: " + log_file
|