X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fadaptor%2Fcommon%2Fadaptor-impl.cpp;h=addc893d1b242c5cf5df597e67cc78eec712fadf;hb=3259f7e05d09669ec473725ac360652beb6ed0b3;hp=cd41ed781f5a0c1642e83d0ccb7d4cff43732623;hpb=eb7c98d6eb61212e10a62ddd88f36b69f74a4e2f;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/internal/adaptor/common/adaptor-impl.cpp b/dali/internal/adaptor/common/adaptor-impl.cpp index cd41ed7..addc893 100755 --- a/dali/internal/adaptor/common/adaptor-impl.cpp +++ b/dali/internal/adaptor/common/adaptor-impl.cpp @@ -49,7 +49,6 @@ #include #include -#include #include #include #include @@ -61,6 +60,7 @@ #include #include +#include #include #include @@ -189,9 +189,11 @@ void Adaptor::Initialize( GraphicsFactory& graphicsFactory, Dali::Configuration: defaultWindow->SetAdaptor( Get() ); - Dali::Integration::SceneHolder defaultSceneHolder( defaultWindow ); - - mWindowCreatedSignal.Emit( defaultSceneHolder ); + Dali::Window window( dynamic_cast( defaultWindow ) ); + if ( window ) + { + mWindowCreatedSignal.Emit( window ); + } const unsigned int timeInterval = mEnvironmentOptions->GetObjectProfilerInterval(); if( 0u < timeInterval ) @@ -322,10 +324,36 @@ void Adaptor::Initialize( GraphicsFactory& graphicsFactory, Dali::Configuration: DALI_LOG_ERROR( "Fail to open file : %s\n", ( systemCachePath + "gpu-environment.conf" ).c_str() ); } } + auto appName = GetApplicationPackageName(); + auto bridge = Accessibility::Bridge::GetCurrentBridge(); + bridge->SetApplicationName( appName ); + bridge->Initialize(); + Dali::Stage stage = Dali::Stage::GetCurrent(); + Dali::Stage::GetCurrent().KeyEventSignal().Connect( &accessibilityObserver, &AccessibilityObserver::OnAccessibleKeyEvent ); +} + +void Adaptor::AccessibilityObserver::OnAccessibleKeyEvent( const KeyEvent& event ) +{ + Accessibility::KeyEventType type; + if( event.state == KeyEvent::Down ) + { + type = Accessibility::KeyEventType::KEY_PRESSED; + } + else if( event.state == KeyEvent::Up ) + { + type = Accessibility::KeyEventType::KEY_RELEASED; + } + else + { + return; + } + Dali::Accessibility::Bridge::GetCurrentBridge()->Emit( type, event.keyCode, event.keyPressedName, event.time, !event.keyPressed.empty() ); } Adaptor::~Adaptor() { + Accessibility::Bridge::GetCurrentBridge()->Terminate(); + // Ensure stop status Stop(); @@ -398,7 +426,7 @@ void Adaptor::Start() Dali::TizenPlatform::ImageLoader::SetMaxTextureSize( mGLES.GetMaxTextureSize() ); std::string systemCachePath = GetSystemCachePath(); - if( systemCachePath.c_str() != NULL ) + if( ! systemCachePath.empty() ) { const int dir_err = system( std::string( "mkdir " + systemCachePath ).c_str() ); if (-1 == dir_err) @@ -644,7 +672,11 @@ bool Adaptor::AddWindow( Dali::Integration::SceneHolder childWindow, const std:: // Add the new Window to the container - the order is not important mWindows.push_back( &windowImpl ); - mWindowCreatedSignal.Emit( childWindow ); + Dali::Window window( dynamic_cast( &windowImpl ) ); + if ( window ) + { + mWindowCreatedSignal.Emit( window ); + } return true; } @@ -918,6 +950,8 @@ void Adaptor::RequestProcessEventsOnIdle( bool forceProcess ) void Adaptor::OnWindowShown() { + Dali::Accessibility::Bridge::GetCurrentBridge()->ApplicationShown(); + if( PAUSED_WHILE_HIDDEN == mState ) { // Adaptor can now be resumed @@ -943,6 +977,8 @@ void Adaptor::OnWindowShown() void Adaptor::OnWindowHidden() { + Dali::Accessibility::Bridge::GetCurrentBridge()->ApplicationHidden(); + if( RUNNING == mState || READY == mState ) { bool allWindowsHidden = true; @@ -1111,18 +1147,6 @@ Dali::WindowContainer Adaptor::GetWindows() const return windows; } -Dali::SceneHolderList Adaptor::GetSceneHolders() const -{ - Dali::SceneHolderList sceneHolderList; - - for( auto iter = mWindows.begin(); iter != mWindows.end(); ++iter ) - { - sceneHolderList.push_back( Dali::Integration::SceneHolder( *iter ) ); - } - - return sceneHolderList; -} - Adaptor::Adaptor(Dali::Integration::SceneHolder window, Dali::Adaptor& adaptor, Dali::RenderSurfaceInterface* surface, EnvironmentOptions* environmentOptions) : mResizedSignal(), mLanguageChangedSignal(),