#include <callback-manager.h>
#include <trigger-event.h>
-#include <window-render-surface.h>
-#include <render-surface-impl.h>
+#include <render-surface.h>
#include <tts-player-impl.h>
#include <accessibility-manager-impl.h>
#include <timer-impl.h>
#include <clipboard-impl.h>
#include <vsync-monitor.h>
#include <object-profiler.h>
+#include <base/display-connection.h>
-#include <slp-logging.h>
-
-
+#include <tizen-logging.h>
namespace Dali
{
} // unnamed namespace
-Dali::Adaptor* Adaptor::New( RenderSurface *surface, const DeviceLayout& baseLayout,
+Dali::Adaptor* Adaptor::New( Any nativeWindow, RenderSurface *surface, const DeviceLayout& baseLayout,
Dali::Configuration::ContextLoss configuration )
{
- DALI_ASSERT_ALWAYS( surface->GetType() != Dali::RenderSurface::NO_SURFACE && "No surface for adaptor" );
-
Dali::Adaptor* adaptor = new Dali::Adaptor;
- Adaptor* impl = new Adaptor( *adaptor, surface, baseLayout );
+ Adaptor* impl = new Adaptor( nativeWindow, *adaptor, surface, baseLayout );
adaptor->mImpl = impl;
impl->Initialize(configuration);
unsigned int logPerformanceStats = GetIntegerEnvironmentVariable( DALI_ENV_LOG_PERFORMANCE_STATS, 0 );
unsigned int logPerformanceStatsFrequency = GetIntegerEnvironmentVariable( DALI_ENV_LOG_PERFORMANCE_STATS_FREQUENCY, 0 );
unsigned int performanceTimeStampOutput= GetIntegerEnvironmentVariable( DALI_ENV_PERFORMANCE_TIMESTAMP_OUTPUT, 0 );
-
+ unsigned int networkControl= GetIntegerEnvironmentVariable( DALI_ENV_NETWORK_CONTROL, 0 );
unsigned int logPanGesture = GetIntegerEnvironmentVariable( DALI_ENV_LOG_PAN_GESTURE, 0 );
- // all threads here (event, update, and render) will send their logs to SLP Platform's LogMessage handler.
- Dali::Integration::Log::LogFunction logFunction(Dali::SlpPlatform::LogMessage);
+ // all threads here (event, update, and render) will send their logs to TIZEN Platform's LogMessage handler.
+ Dali::Integration::Log::LogFunction logFunction(Dali::TizenPlatform::LogMessage);
- mEnvironmentOptions.SetLogOptions( logFunction, logFrameRateFrequency, logupdateStatusFrequency, logPerformanceStats, logPerformanceStatsFrequency, performanceTimeStampOutput, logPanGesture );
+ mEnvironmentOptions.SetLogOptions( logFunction, networkControl, logFrameRateFrequency, logupdateStatusFrequency, logPerformanceStats, logPerformanceStatsFrequency, performanceTimeStampOutput, logPanGesture );
int predictionMode;
if( GetIntegerEnvironmentVariable(DALI_ENV_PAN_PREDICTION_MODE, predictionMode) )
mEnvironmentOptions.SetGlesCallTime( glesCallTime );
}
+ int windowWidth(0), windowHeight(0);
+ if ( GetIntegerEnvironmentVariable( DALI_WINDOW_WIDTH, windowWidth ) && GetIntegerEnvironmentVariable( DALI_WINDOW_HEIGHT, windowHeight ) )
+ {
+ mEnvironmentOptions.SetWindowWidth( windowWidth );
+ mEnvironmentOptions.SetWindowHeight( windowHeight );
+ }
+
mEnvironmentOptions.InstallLogFunction();
}
{
ParseEnvironmentOptions();
- mPlatformAbstraction = new SlpPlatform::SlpPlatformAbstraction;
+ mPlatformAbstraction = new TizenPlatform::TizenPlatformAbstraction;
+
+ std::string path;
+ GetDataStoragePath( path );
+ mPlatformAbstraction->SetDataStoragePath( path );
ResourcePolicy::DataRetention dataRetentionPolicy = ResourcePolicy::DALI_DISCARDS_ALL_DATA;
if( configuration == Dali::Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS )
mObjectProfiler = new ObjectProfiler();
- mNotificationTrigger = new TriggerEvent( boost::bind(&Adaptor::ProcessCoreEvents, this) );
+ mNotificationTrigger = new TriggerEvent( MakeCallback( this, &Adaptor::ProcessCoreEvents ) );
mVSyncMonitor = new VSyncMonitor;
{
Integration::SetPanGestureSmoothingAmount(mEnvironmentOptions.GetPanGestureSmoothingAmount());
}
+ if( mEnvironmentOptions.GetWindowWidth() && mEnvironmentOptions.GetWindowHeight() )
+ {
+ SurfaceResized( PositionSize( 0, 0, mEnvironmentOptions.GetWindowWidth(), mEnvironmentOptions.GetWindowHeight() ));
+ }
}
Adaptor::~Adaptor()
mDeferredRotationObserver = NULL;
}
- // guarantee map the surface before starting render-thread.
- mSurface->Map();
-
// NOTE: dpi must be set before starting the render thread
// use default or command line settings if not run on device
-#ifdef __arm__
- // set the DPI value for font rendering
- unsigned int dpiHor, dpiVer;
- dpiHor = dpiVer = 0;
- mSurface->GetDpi(dpiHor, dpiVer);
-
- // tell core about the value
- mCore->SetDpi(dpiHor, dpiVer);
-#else
- mCore->SetDpi(mHDpi, mVDpi);
-#endif
+ if( mHDpi == 0 || mVDpi == 0 )
+ {
+ unsigned int dpiHor, dpiVer;
+ dpiHor = dpiVer = 0;
+ Dali::DisplayConnection::GetDpi(dpiHor, dpiVer);
+
+ // tell core about the value
+ mCore->SetDpi(dpiHor, dpiVer);
+ }
+ else
+ {
+ mCore->SetDpi(mHDpi, mVDpi);
+ }
// Tell the core the size of the surface just before we start the render-thread
PositionSize size = mSurface->GetPositionSize();
}
}
-void Adaptor::ReplaceSurface( Dali::RenderSurface& surface )
+void Adaptor::ReplaceSurface( Any nativeWindow, RenderSurface& surface )
{
- // adaptor implementation needs the implementation of
- RenderSurface* internalSurface = dynamic_cast<Internal::Adaptor::RenderSurface*>( &surface );
- DALI_ASSERT_ALWAYS( internalSurface && "Incorrect surface" );
+ mNativeWindow = nativeWindow;
+ mSurface = &surface;
- ECore::WindowRenderSurface* windowSurface = dynamic_cast<Internal::Adaptor::ECore::WindowRenderSurface*>( &surface);
- if( windowSurface != NULL )
- {
- windowSurface->Map();
- // @todo Restart event handler with new surface
- }
-
- mSurface = internalSurface;
-
- SurfaceSizeChanged( internalSurface->GetPositionSize() );
+ SurfaceSizeChanged(mSurface->GetPositionSize());
// flush the event queue to give update and render threads chance
// to start processing messages for new camera setup etc as soon as possible
mCore->GetContextNotifier()->NotifyContextLost(); // Inform stage
// this method blocks until the render thread has completed the replace.
- mUpdateRenderController->ReplaceSurface(internalSurface);
+ mUpdateRenderController->ReplaceSurface(mSurface);
// Inform core, so that texture resources can be reloaded
mCore->RecoverFromContextLoss();
mCore->GetContextNotifier()->NotifyContextRegained(); // Inform stage
}
-Dali::RenderSurface& Adaptor::GetSurface() const
+RenderSurface& Adaptor::GetSurface() const
{
return *mSurface;
}
return mTtsPlayers[mode];
}
-bool Adaptor::AddIdle(boost::function<void(void)> callBack)
+bool Adaptor::AddIdle( CallbackBase* callback )
{
bool idleAdded(false);
// Only add an idle if the Adaptor is actually running
if( RUNNING == mState )
{
- idleAdded = mCallbackManager->AddCallback(callBack, CallbackManager::IDLE_PRIORITY);
+ idleAdded = mCallbackManager->AddCallback( callback, CallbackManager::IDLE_PRIORITY );
}
return idleAdded;
}
-bool Adaptor::CallFromMainLoop(boost::function<void(void)> callBack)
+bool Adaptor::CallFromMainLoop( CallbackBase* callback )
{
bool callAdded(false);
// Only allow the callback if the Adaptor is actually running
if ( RUNNING == mState )
{
- callAdded = mCallbackManager->AddCallback(callBack, CallbackManager::DEFAULT_PRIORITY);
+ callAdded = mCallbackManager->AddCallback( callback, CallbackManager::DEFAULT_PRIORITY );
}
return callAdded;
{
return *mNotificationTrigger;
}
+
TriggerEventFactoryInterface& Adaptor::GetTriggerEventFactoryInterface()
{
return mTriggerEventFactory;
}
+
+SocketFactoryInterface& Adaptor::GetSocketFactoryInterface()
+{
+ return mSocketFactory;
+}
+
RenderSurface* Adaptor::GetRenderSurfaceInterface()
{
return mSurface;
}
+
VSyncMonitorInterface* Adaptor::GetVSyncMonitorInterface()
{
return mVSyncMonitor;
}
}
+Any Adaptor::GetNativeWindowHandle()
+{
+ return mNativeWindow;
+}
void Adaptor::AddObserver( LifeCycleObserver& observer )
{
// and we haven't installed the idle notification
if( ( ! mNotificationOnIdleInstalled ) && ( RUNNING == mState ) )
{
- mNotificationOnIdleInstalled = AddIdle( boost::bind( &Adaptor::ProcessCoreEventsFromIdle, this ) );
+ mNotificationOnIdleInstalled = AddIdle( MakeCallback( this, &Adaptor::ProcessCoreEventsFromIdle ) );
}
}
mNotificationOnIdleInstalled = false;
}
-Adaptor::Adaptor(Dali::Adaptor& adaptor, RenderSurface* surface, const DeviceLayout& baseLayout)
+Adaptor::Adaptor(Any nativeWindow, Dali::Adaptor& adaptor, RenderSurface* surface, const DeviceLayout& baseLayout)
: mResizedSignal(),
mLanguageChangedSignal(),
mAdaptor(adaptor),
mVSyncMonitor(NULL),
mGLES( NULL ),
mEglFactory( NULL ),
+ mNativeWindow( nativeWindow ),
mSurface( surface ),
mPlatformAbstraction( NULL ),
mEventHandler( NULL ),