platform/shared/common/RhodesApp.h in rhodes-6.2.0 vs platform/shared/common/RhodesApp.h in rhodes-7.1.17
- old
+ new
@@ -38,10 +38,13 @@
#include "SplashScreen.h"
#include "AppMenu.h"
#include "ExtManager.h"
#include "api_generator/MethodResult.h"
+#include <condition_variable>
+#include <mutex>
+
#undef DEFAULT_LOGCATEGORY
#define DEFAULT_LOGCATEGORY "RhodesApp"
@@ -147,10 +150,13 @@
boolean m_bExit, m_bRestartServer;
String m_strListeningPorts;
String m_strNodeJSListeningPorts;
int m_nNodeJSListeningPorts;
+
+ String m_strRubyServerHomeURL;
+ String m_strNodeServerHomeURL;
common::CAutoPtr<net::CHttpServer> m_httpServer;
CSplashScreen m_oSplashScreen;
CAppMenu m_oAppMenu;
CRhoTimer m_oTimer;
@@ -166,10 +172,14 @@
Vector<String> m_currentUrls;
Vector<String> m_arAppBackUrl, m_arAppBackUrlOrig;
Vector<ICallbackObject*> m_arCallbackObjects;
mutable common::CMutex m_mxCallbackObjects;
+#if defined(WINDOWS_PLATFORM)
+ std::mutex wait_mutex;
+ std::condition_variable activated_cond;
+#endif
common::CMutex m_mxScreenRotationCallback;
String m_strScreenRotationCallback, m_strScreenRotationCallbackParams;
boolean m_bDeactivationMode;
@@ -242,11 +252,14 @@
CAppMenu& getAppMenu (void) { return m_oAppMenu; }
CSplashScreen& getSplashScreen(){return m_oSplashScreen;}
CRhoTimer& getTimer(){ return m_oTimer; }
- CExtManager& getExtManager(){ return m_oExtManager; }
+ CExtManager& getExtManager()
+ {
+ return m_oExtManager;
+ }
String addCallbackObject(ICallbackObject* pCallbackObject, String strName);
unsigned long getCallbackObject(int nIndex);
void callScreenOnCallbackAsync();
@@ -286,20 +299,28 @@
void registerLocalServerUrl(const String& strUrl, rho::net::CHttpServer::callback_t const &callback);
bool isLocalServerRunning() { return ( (m_httpServer) && (m_httpServer->started()) ); }
unsigned int getLocalServerPort() { return (m_httpServer!=0)?(m_httpServer->getPort()):0; }
unsigned int getNodeJSServerPort() { return m_nNodeJSListeningPorts; }
+
+ String& getRubyHomeURL() {return m_strRubyServerHomeURL;}
+ String& getNodeHomeURL() {return m_strNodeServerHomeURL;}
+
#ifdef OS_MACOSX
String directHttpRequest( const String& method, const String& uri, const String& query, const rho::net::HttpHeaderList& headers, const String& body ) { return m_httpServer->directRequest(method, uri, query, headers, body ); }
#endif
void callCallbackProcWithData(unsigned long oRubyCallbackProc, String strBody, const String& strCallbackData, bool bWaitForResponse);
#ifdef OS_WINCE
bool isWebkitOutofProcess();
#endif
virtual bool isApplicationActive() { return getApplicationEventReceiver()->isApplicationActive(); }
+#if defined(WINDOWS_PLATFORM)
+ void waitAppStarted();
+ void notifyAppStared();
+#endif
protected:
virtual void run();
void initHttpServer();
@@ -419,9 +440,12 @@
void rho_sys_set_network_status_notify(const char* url, int poll_interval);
void rho_sys_clear_network_status_notify();
int rho_rhodesapp_is_application_active();
int rho_rhodesapp_is_nodejs_app();
+int rho_rhodesapp_is_rubynodejs_app();
+const char* rho_rhodesapp_rubyhomeurl();
+
#ifdef __cplusplus
};
#endif //__cplusplus