// 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 <errno.h>
#include <sys/stat.h>
-#include <dali/public-api/common/stage.h>
#include <dali/public-api/actors/layer.h>
#include <dali/public-api/object/any.h>
+#include <dali/public-api/object/object-registry.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>
EglSyncImplementation& eglSyncImpl = eglGraphics->GetSyncImplementation();
EglContextHelperImplementation& eglContextHelperImpl = eglGraphics->GetContextHelperImplementation();
+ // Create the AddOnManager
+ mAddOnManager.reset( Dali::Internal::AddOnManagerFactory::CreateAddOnManager() );
+
mCore = Integration::Core::New( *this,
*mPlatformAbstraction,
mGLES,
eglContextHelperImpl,
( 0u != mEnvironmentOptions->GetRenderToFboInterval() ) ? Integration::RenderToFrameBuffer::TRUE : Integration::RenderToFrameBuffer::FALSE,
mGraphics->GetDepthBufferRequired(),
- mGraphics->GetStencilBufferRequired() );
+ mGraphics->GetStencilBufferRequired(),
+ mGraphics->GetPartialUpdateRequired() );
+
defaultWindow->SetAdaptor( Get() );
const unsigned int timeInterval = mEnvironmentOptions->GetObjectProfilerInterval();
if( 0u < timeInterval )
{
- mObjectProfiler = new ObjectProfiler( timeInterval );
+ mObjectProfiler = new ObjectProfiler( mCore->GetObjectRegistry(), timeInterval );
}
mNotificationTrigger = TriggerEventFactory::CreateTriggerEvent( MakeCallback( this, &Adaptor::ProcessCoreEvents ), TriggerEventInterface::KEEP_ALIVE_AFTER_TRIGGER);
mDisplayConnection = Dali::DisplayConnection::New( *mGraphics, defaultWindow->GetSurface()->GetSurfaceType() );
- mThreadController = new ThreadController( *this, *mEnvironmentOptions );
+ mThreadController = new ThreadController( *this, *mEnvironmentOptions, mThreadMode );
// Should be called after Core creation
if( mEnvironmentOptions->GetPanGestureLoggingLevel() )
else
{
unsigned int maxTextureSize = mConfigurationManager->GetMaxTextureSize();
- setenv( DALI_ENV_MAX_TEXTURE_SIZE, std::to_string( maxTextureSize ).c_str(), 1 );
Dali::TizenPlatform::ImageLoader::SetMaxTextureSize( maxTextureSize );
}
{
(*iter)->OnStart();
}
+
+ mAddOnManager->Start();
}
// Dali::Internal::Adaptor::Adaptor::Pause
(*iter)->OnPause();
}
+ // Extensions
+ mAddOnManager->Pause();
+
// Pause all windows event handlers when adaptor paused
for( auto window : mWindows )
{
window->Resume();
}
+ // Resume AddOnManager
+ mAddOnManager->Resume();
+
// Inform observers that we have resumed.
for( ObserverContainer::iterator iter = mObservers.begin(), endIter = mObservers.end(); iter != endIter; ++iter )
{
(*iter)->OnStop();
}
+ mAddOnManager->Stop();
+
mThreadController->Stop();
// Delete the TTS player
void Adaptor::RenderOnce()
{
- RequestUpdateOnce();
+ if( mThreadController )
+ {
+ UpdateMode updateMode;
+ if( mThreadMode == ThreadMode::NORMAL )
+ {
+ updateMode = UpdateMode::NORMAL;
+ }
+ else
+ {
+ updateMode = UpdateMode::FORCE_RENDER;
+
+ ProcessCoreEvents();
+ }
+ mThreadController->RequestUpdateOnce( updateMode );
+ }
}
const LogFactoryInterface& Adaptor::GetLogFactory()
return sceneHolderList;
}
+Dali::ObjectRegistry Adaptor::GetObjectRegistry() const
+{
+ Dali::ObjectRegistry registry;
+ if( mCore )
+ {
+ registry = mCore->GetObjectRegistry();
+ }
+ return registry;
+}
+
Adaptor::Adaptor(Dali::Integration::SceneHolder window, Dali::Adaptor& adaptor, Dali::RenderSurfaceInterface* surface, EnvironmentOptions* environmentOptions)
: mResizedSignal(),
mLanguageChangedSignal(),
mSystemTracer(),
mObjectProfiler( nullptr ),
mSocketFactory(),
+ mThreadMode( ThreadMode::NORMAL ),
mEnvironmentOptionsOwned( environmentOptions ? false : true /* If not provided then we own the object */ ),
mUseRemoteSurface( false )
{
void Adaptor::SetRootLayoutDirection( std::string locale )
{
- Dali::Stage stage = Dali::Stage::GetCurrent();
-
- stage.GetRootLayer().SetProperty( Dali::Actor::Property::LAYOUT_DIRECTION,
- 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 ) ) ) );
+ }
}
bool Adaptor::AddIdleEnterer( CallbackBase* callback, bool forceAdd )
idleAdded = mCallbackManager->AddIdleEntererCallback( callback );
}
+ if( !idleAdded )
+ {
+ // Delete callback
+ delete callback;
+ }
+
return idleAdded;
}