Esempio n. 1
0
    void RunMessageLoop( ) throw( )
    {
#ifdef RHODES_EMULATOR
        m_appWindow.MessageLoop();
#else
        MSG msg;
        while (GetMessage(&msg, NULL, 0, 0))
        {
            if (!m_appWindow.TranslateAccelerator(&msg))
            {
                TranslateMessage(&msg);
                DispatchMessage(&msg);
            }
        }
#endif

#if defined(OS_WINCE)&& !defined( OS_PLATFORM_CE )
        CGPSController* pGPS = CGPSController::Instance();
        pGPS->DeleteInstance();
#endif
        rho_ringtone_manager_stop();

#if !defined(_WIN32_WCE)
        rho_clientregister_destroy();
#endif

#ifdef RHODES_EMULATOR
        m_appWindow.DestroyUi();
#endif

        rho::common::CRhodesApp::Destroy();

        net::CNetRequestImpl::deinitConnection();
    }
Esempio n. 2
0
void CRhodesModule::RunMessageLoop( ) throw( )
{
#ifdef RHODES_EMULATOR
    m_appWindow.MessageLoop();
#else
    m_appWindow.getWebKitEngine()->RunMessageLoop(m_appWindow);
#endif

#if defined(OS_WINCE)&& !defined( OS_PLATFORM_MOTCE )
    if (g_hNotify)
        RegistryCloseNotification(g_hNotify);

    if ( g_hNotifyCell )
        RegistryCloseNotification(g_hNotifyCell);

    CGPSController* pGPS = CGPSController::Instance();
    pGPS->DeleteInstance();
#endif
    rho_ringtone_manager_stop();

#if !defined(_WIN32_WCE)
    rho_clientregister_destroy();
#endif

#ifdef RHODES_EMULATOR
    m_appWindow.DestroyUi();
#endif

    rho::common::CRhodesApp::Destroy();

    net::CNetRequestImpl::deinitConnection();
}
Esempio n. 3
0
CHttpServer::~CHttpServer(void)
{
  rho_sync_destroy();

  shutdown_poll(ctx);
  m_thread.RemoveHandle(m_hEvent);
  m_thread.Shutdown();
  shttpd_fini(ctx);
  LOG(INFO) + "Http server thread shutdown";

#if defined(_WIN32_WCE)
  CGPSController* pGPS = CGPSController::Instance();
  pGPS->DeleteInstance();
#endif
  if (m_pStartPage) {
	  free(m_pStartPage);
  }
  if (m_pOptionsPage) {
      free(m_pOptionsPage);
  }
#ifdef ENABLE_DYNAMIC_RHOBUNDLE
  if ( m_szRhobundleReloadUrl )
	  free( m_szRhobundleReloadUrl );
#endif
}
Esempio n. 4
0
void CRhodesModule::RunMessageLoop( ) throw( )
{
    m_appWindow.getWebKitEngine()->RunMessageLoop(m_appWindow);

#if defined(OS_WINCE)
	if(RHO_IS_WMDEVICE)
	{
		if (g_hNotify)
		  lpfn_Registry_CloseNotification(g_hNotify);

	 if ( g_hNotifyCell )
		 lpfn_Registry_CloseNotification(g_hNotifyCell);

		CGPSController* pGPS = CGPSController::Instance();
		pGPS->DeleteInstance();
	}
#endif
    rho_ringtone_manager_stop();

    rho::common::CRhodesApp::Destroy();

//	ReleaseMutex(m_hMutex);

    rho_platform_check_restart_application();
}
Esempio n. 5
0
int rho_geo_known_position() 
{
#if defined(_WIN32_WCE)&& !defined( OS_PLATFORM_CE )
	CGPSController* gps = CGPSController::startInstance();
	return gps->IsKnownPosition();
#else
	return 0;
#endif
}
Esempio n. 6
0
double rho_geo_longitude() 
{
#if defined(_WIN32_WCE)&& !defined( OS_PLATFORM_CE )
  CGPSController* gps = CGPSController::startInstance();
	return gps->GetLongitude();
#else
	return 0.0;
#endif
}
Esempio n. 7
0
double rho_geo_latitude() 
{
#if defined(_WIN32_WCE)
	CGPSController* gps = CGPSController::startInstance();
	return gps->GetLatitude();
#else
	return 0.0;
#endif
}
Esempio n. 8
0
int rho_geo_satellites() {
#if defined(_WIN32_WCE)//&& !defined( OS_PLATFORM_MOTCE )
	if(winversion == 1)
	{
		CGPSController* gps = CGPSController::startInstance();
		return gps->GetSatelliteCount();
	}
	return 0;
#else
    return 0;
#endif
}
Esempio n. 9
0
double rho_geo_speed() {
#if defined(_WIN32_WCE)//&& !defined( OS_PLATFORM_MOTCE )
	if(winversion == 1)
	{
		CGPSController* gps = CGPSController::startInstance();
		return gps->GetSpeed();
	}
	return 0.0;
#else
    return 0.0;
#endif
}
Esempio n. 10
0
void CGPSController::CheckTimeout() {
	if( CGPSController::s_pInstance != NULL ) {
		CGPSController* gps = CGPSController::s_pInstance;
		gps->Lock();
		bool gpsOff = gps->m_gpsIsOn && (time(NULL)>=gps->m_timeout);
		gps->Unlock();
		if (gpsOff) {
			CGPSDevice::TurnOff();
			gps->m_gpsIsOn = false;
			gps->m_knownPosition = false;
		}
	}
}
Esempio n. 11
0
int rho_geo_known_position() 
{
#if defined(_WIN32_WCE)//&& !defined( OS_PLATFORM_MOTCE )
	if(winversion == 1)
	{
		CGPSController* gps = CGPSController::startInstance();
		return gps->IsKnownPosition();
	}
	return 0;
#else
	return 0;
#endif
}
Esempio n. 12
0
void CGPSController::TurnGpsOff() {
	if( CGPSController::s_pInstance != NULL ) {
		CGPSController* gps = CGPSController::s_pInstance;
		gps->Lock();
		bool gpsOff = gps->m_gpsIsOn;
		gps->Unlock();
		if (gpsOff) {
			CGPSDevice::TurnOff();
			gps->m_gpsIsOn = false;
			gps->m_knownPosition = false;
	    gps->m_latitude = 0;
	    gps->m_longitude = 0;
		}
	}
}
Esempio n. 13
0
void CGPSController::CheckTimeout() {
	if( CGPSController::s_pInstance != NULL ) {
		CGPSController* gps = CGPSController::s_pInstance;
		gps->Lock();
		bool gpsOff = gps->m_gpsIsOn && (time(NULL)>=gps->m_timeout);
		gps->Unlock();
		if (gpsOff) {
			CGPSDevice::TurnOff();
			gps->m_gpsIsOn = false;
			gps->m_knownPosition = false;
	    gps->m_latitude = 0;
	    gps->m_longitude = 0;
		gps->m_altitude = 0;
		gps->m_speed = 0;
		gps->m_satelliteCount = 0;
		}
	}
}
Esempio n. 14
0
void show_geolocation(struct shttpd_arg *arg) {
	char location[256];

	CGPSController* gps = CGPSController::Instance();
	gps->TurnGpsOn();

	gps->UpdateTimeout();
	if (gps->IsKnownPosition()) {
		double latitude = gps->GetLatitude();
		double longitude = gps->GetLongitude();
		sprintf(location,"%.4f° %s, %.4f° %s;%f;%f",
			fabs(latitude),latitude < 0 ? "South" : "North",
			fabs(longitude),longitude < 0 ? "West" : "East",
			latitude,longitude);
	} else {
		strcpy(location,"reading...;reading...;reading...");
	}

	printf("Location: %s\n",location);

	shttpd_printf(arg, "%s", "HTTP/1.1 200 OK\r\n");
	shttpd_printf(arg, "Content-Length: %lu\r\n", strlen(location));
	shttpd_printf(arg, "%s", "Connection: close\r\n");
	shttpd_printf(arg, "%s", "Pragma: no-cache\r\n" );
	shttpd_printf(arg, "%s", "Cache-Control: no-cache\r\n" );
	shttpd_printf(arg, "%s", "Expires: 0\r\n" );
	shttpd_printf(arg, "%s", "Content-Type: text/html; charset=ISO-8859-4\r\n\r\n");
	shttpd_printf(arg, "%s", location);

	arg->flags |= SHTTPD_END_OF_OUTPUT;
}
Esempio n. 15
0
void CRhodesModule::RunMessageLoop( ) throw( )
{
#if defined(OS_WINDOWS_DESKTOP)
    m_appWindow.MessageLoop();
#else
    m_appWindow.getWebKitEngine()->RunMessageLoop(m_appWindow);
#endif

#if defined(OS_WINCE)&& !defined( OS_PLATFORM_MOTCE )
    if (g_hNotify)
        RegistryCloseNotification(g_hNotify);

    if ( g_hNotifyCell )
        RegistryCloseNotification(g_hNotifyCell);

    CGPSController* pGPS = CGPSController::Instance();
    pGPS->DeleteInstance();
#endif
    rho_ringtone_manager_stop();

//#if !defined(_WIN32_WCE)
//    rho::sync::CClientRegister::Destroy();
//#endif

#if defined(OS_WINDOWS_DESKTOP)
    m_appWindow.DestroyUi();
#endif

    rho::common::CRhodesApp::Destroy();

//    net::CNetRequestImpl::deinitConnection();

#if !defined(OS_WINDOWS_DESKTOP)
//	ReleaseMutex(m_hMutex);
#endif

    rho_platform_check_restart_application();
}
Esempio n. 16
0
    void RunMessageLoop( ) throw( )
    {
        MSG msg;
        while (GetMessage(&msg, NULL, 0, 0))
        {
            if (!m_appWindow.TranslateAccelerator(&msg))
            {
                TranslateMessage(&msg);
                DispatchMessage(&msg);
            }
        }
        // Stop local server
        //m_pServerHost->Stop();
        //delete m_pServerHost;
        //m_pServerHost = NULL;

#if defined(OS_WINCE)
        CGPSController* pGPS = CGPSController::Instance();
        pGPS->DeleteInstance();
#endif

        rho::common::CRhodesApp::Destroy();
    }