// CLASS HEADER
#include <dali/internal/adaptor/common/adaptor-impl.h>
+#include <dali/internal/addons/common/addon-manager-impl.h>
+#include <dali/internal/addons/common/addon-manager-factory.h>
#include <dali/internal/adaptor/common/adaptor-builder-impl.h>
// EXTERNAL INCLUDES
#include <dali/public-api/actors/layer.h>
#include <dali/public-api/object/any.h>
#include <dali/public-api/object/object-registry.h>
+#include <dali/public-api/events/wheel-event.h>
#include <dali/devel-api/actors/actor-devel.h>
#include <dali/integration-api/debug.h>
#include <dali/integration-api/core.h>
#include <dali/integration-api/events/touch-event-integ.h>
#include <dali/integration-api/events/wheel-event-integ.h>
#include <dali/integration-api/processor-interface.h>
+#include <dali/integration-api/addon-manager.h>
// INTERNAL INCLUDES
#include <dali/public-api/dali-adaptor-common.h>
} // unnamed namespace
-Dali::Adaptor* Adaptor::New( Dali::Integration::SceneHolder window, Dali::RenderSurfaceInterface *surface, Dali::Configuration::ContextLoss configuration, EnvironmentOptions* environmentOptions )
+Dali::Adaptor* Adaptor::New( Dali::Integration::SceneHolder window, Dali::RenderSurfaceInterface *surface, EnvironmentOptions* environmentOptions )
{
Dali::Adaptor* adaptor = new Dali::Adaptor;
Adaptor* impl = new Adaptor( window, *adaptor, surface, environmentOptions );
Dali::Internal::Adaptor::AdaptorBuilder* mAdaptorBuilder = new AdaptorBuilder();
auto graphicsFactory = mAdaptorBuilder->GetGraphicsFactory();
- impl->Initialize( graphicsFactory, configuration );
+ impl->Initialize( graphicsFactory );
delete mAdaptorBuilder; // Not needed anymore as the graphics interface has now been created
return adaptor;
}
-Dali::Adaptor* Adaptor::New( Dali::Integration::SceneHolder window, Dali::Configuration::ContextLoss configuration, EnvironmentOptions* environmentOptions )
+Dali::Adaptor* Adaptor::New( Dali::Integration::SceneHolder window, EnvironmentOptions* environmentOptions )
{
Internal::Adaptor::SceneHolder& windowImpl = Dali::GetImplementation( window );
- Dali::Adaptor* adaptor = New( window, windowImpl.GetSurface(), configuration, environmentOptions );
+ Dali::Adaptor* adaptor = New( window, windowImpl.GetSurface(), environmentOptions );
windowImpl.SetAdaptor( *adaptor );
return adaptor;
}
-Dali::Adaptor* Adaptor::New( GraphicsFactory& graphicsFactory, Dali::Integration::SceneHolder window, Dali::RenderSurfaceInterface *surface, Dali::Configuration::ContextLoss configuration, EnvironmentOptions* environmentOptions )
+Dali::Adaptor* Adaptor::New( GraphicsFactory& graphicsFactory, Dali::Integration::SceneHolder window, Dali::RenderSurfaceInterface *surface, EnvironmentOptions* environmentOptions )
{
Dali::Adaptor* adaptor = new Dali::Adaptor; // Public adaptor
Adaptor* impl = new Adaptor( window, *adaptor, surface, environmentOptions ); // Impl adaptor
adaptor->mImpl = impl;
- impl->Initialize( graphicsFactory, configuration );
+ impl->Initialize( graphicsFactory );
return adaptor;
} // Called second
-Dali::Adaptor* Adaptor::New( GraphicsFactory& graphicsFactory, Dali::Integration::SceneHolder window, Dali::Configuration::ContextLoss configuration, EnvironmentOptions* environmentOptions )
+Dali::Adaptor* Adaptor::New( GraphicsFactory& graphicsFactory, Dali::Integration::SceneHolder window, EnvironmentOptions* environmentOptions )
{
Internal::Adaptor::SceneHolder& windowImpl = Dali::GetImplementation( window );
- Dali::Adaptor* adaptor = New( graphicsFactory, window, windowImpl.GetSurface(), configuration, environmentOptions );
+ Dali::Adaptor* adaptor = New( graphicsFactory, window, windowImpl.GetSurface(), environmentOptions );
windowImpl.SetAdaptor( *adaptor );
return adaptor;
} // Called first
-void Adaptor::Initialize( GraphicsFactory& graphicsFactory, Dali::Configuration::ContextLoss configuration )
+void Adaptor::Initialize( GraphicsFactory& graphicsFactory )
{
// 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 );
EglSyncImplementation& eglSyncImpl = eglGraphics->GetSyncImplementation();
EglContextHelperImplementation& eglContextHelperImpl = eglGraphics->GetContextHelperImplementation();
+ // Create the AddOnManager
+ mAddOnManager.reset( Dali::Internal::AddOnManagerFactory::CreateAddOnManager() );
+
mCore = Integration::Core::New( *this,
*mPlatformAbstraction,
mGLES,
mGraphics->GetStencilBufferRequired(),
mGraphics->GetPartialUpdateRequired() );
+
defaultWindow->SetAdaptor( Get() );
Dali::Integration::SceneHolder defaultSceneHolder( defaultWindow );
{
(*iter)->OnStart();
}
+
+ if (mAddOnManager)
+ {
+ mAddOnManager->Start();
+ }
}
// Dali::Internal::Adaptor::Adaptor::Pause
(*iter)->OnPause();
}
+ // Extensions
+ if (mAddOnManager)
+ {
+ mAddOnManager->Pause();
+ }
+
// Pause all windows event handlers when adaptor paused
for( auto window : mWindows )
{
window->Resume();
}
+ // Resume AddOnManager
+ if (mAddOnManager)
+ {
+ mAddOnManager->Resume();
+ }
+
// Inform observers that we have resumed.
for( ObserverContainer::iterator iter = mObservers.begin(), endIter = mObservers.end(); iter != endIter; ++iter )
{
(*iter)->OnStop();
}
+ if (mAddOnManager)
+ {
+ mAddOnManager->Stop();
+ }
+
mThreadController->Stop();
// Delete the TTS player
mWindows.front()->FeedTouchPoint( convertedPoint, timeStamp );
}
-void Adaptor::FeedWheelEvent( WheelEvent& wheelEvent )
+void Adaptor::FeedWheelEvent( Dali::WheelEvent& wheelEvent )
{
- Integration::WheelEvent event( static_cast< Integration::WheelEvent::Type >(wheelEvent.type), wheelEvent.direction, wheelEvent.modifiers, wheelEvent.point, wheelEvent.z, wheelEvent.timeStamp );
+ Integration::WheelEvent event( static_cast< Integration::WheelEvent::Type >( wheelEvent.GetType() ), wheelEvent.GetDirection(), wheelEvent.GetModifiers(), wheelEvent.GetPoint(), wheelEvent.GetDelta(), wheelEvent.GetTime() );
mWindows.front()->FeedWheelEvent( event );
}
-void Adaptor::FeedKeyEvent( KeyEvent& keyEvent )
+void Adaptor::FeedKeyEvent( Dali::KeyEvent& keyEvent )
{
- Integration::KeyEvent convertedEvent( keyEvent );
+ Integration::KeyEvent convertedEvent( keyEvent.GetKeyName(), keyEvent.GetLogicalKey(), keyEvent.GetKeyString(), keyEvent.GetKeyCode(), keyEvent.GetKeyModifier(), keyEvent.GetTime(), static_cast< Integration::KeyEvent::State >( keyEvent.GetState() ), keyEvent.GetCompose(), keyEvent.GetDeviceName(), keyEvent.GetDeviceClass(), keyEvent.GetDeviceSubclass() );
mWindows.front()->FeedKeyEvent( convertedEvent );
}
mThreadController->SetPreRenderCallback( callback );
}
-bool Adaptor::AddWindow( Dali::Integration::SceneHolder childWindow, const std::string& childWindowName, const std::string& childWindowClassName, bool childWindowMode )
+bool Adaptor::AddWindow( Dali::Integration::SceneHolder childWindow )
{
Internal::Adaptor::SceneHolder& windowImpl = Dali::GetImplementation( childWindow );
windowImpl.SetAdaptor( Get() );
+ // ChildWindow is set to the layout direction of the default window.
+ windowImpl.GetRootLayer().SetProperty( Dali::Actor::Property::LAYOUT_DIRECTION, mRootLayoutDirection );
+
// Add the new Window to the container - the order is not important
mWindows.push_back( &windowImpl );
DALI_LOG_RELEASE_INFO( "Adaptor::OnWindowShown: Update requested.\n" );
}
+ else if( PAUSED_WHILE_INITIALIZING == mState )
+ {
+ // Change the state to READY again. It will be changed to RUNNING after the adaptor is started.
+ mState = READY;
+ }
else
{
DALI_LOG_RELEASE_INFO( "Adaptor::OnWindowShown: Adaptor is not paused state.[%d]\n", mState );
mSocketFactory(),
mThreadMode( ThreadMode::NORMAL ),
mEnvironmentOptionsOwned( environmentOptions ? false : true /* If not provided then we own the object */ ),
- mUseRemoteSurface( false )
+ mUseRemoteSurface( false ),
+ mRootLayoutDirection( Dali::LayoutDirection::LEFT_TO_RIGHT )
{
DALI_ASSERT_ALWAYS( !IsAvailable() && "Cannot create more than one Adaptor per thread" );
mWindows.insert( mWindows.begin(), &Dali::GetImplementation( window ) );
void Adaptor::SetRootLayoutDirection( std::string locale )
{
+ mRootLayoutDirection = static_cast< LayoutDirection::Type >( Internal::Adaptor::Locale::GetDirection( std::string( locale ) ) );
for ( auto& window : mWindows )
{
Dali::Actor root = window->GetRootLayer();
- root.SetProperty( Dali::Actor::Property::LAYOUT_DIRECTION,
- static_cast< LayoutDirection::Type >( Internal::Adaptor::Locale::GetDirection( std::string( locale ) ) ) );
+ root.SetProperty( Dali::Actor::Property::LAYOUT_DIRECTION, mRootLayoutDirection );
}
}
idleAdded = mCallbackManager->AddIdleEntererCallback( callback );
}
+ if( !idleAdded )
+ {
+ // Delete callback
+ delete callback;
+ }
+
return idleAdded;
}