#include <dali/public-api/render-tasks/render-task.h>
#include <dali/public-api/render-tasks/render-task-list.h>
#include <dali/public-api/rendering/frame-buffer.h>
+#include <dali/public-api/adaptor-framework/window-enumerations.h>
#include <dali/devel-api/adaptor-framework/orientation.h>
#include <dali/integration-api/events/touch-event-integ.h>
#include <dali/internal/window-system/common/window-system.h>
#include <dali/internal/window-system/common/window-render-surface.h>
#include <dali/internal/window-system/common/window-visibility-observer.h>
+#include <dali/devel-api/adaptor-framework/accessibility-impl.h>
namespace Dali
{
mIconified( false ),
mOpaqueState( false ),
mResizeEnabled( false ),
- mType( Dali::Window::NORMAL ),
+ mType( WindowType::NORMAL ),
mParentWindow( NULL ),
- mPreferredAngle( Dali::Window::NO_ORIENTATION_PREFERENCE ),
+ mPreferredAngle( static_cast< int >( WindowOrientation::NO_ORIENTATION_PREFERENCE ) ),
mRotationAngle( -1 ),
mWindowWidth( 0 ),
mWindowHeight( 0 ),
mOrientationMode( Internal::Adaptor::Window::OrientationMode::PORTRAIT ),
mNativeWindowId( -1 ),
- mResizedSignal(),
mDeleteRequestSignal(),
mFocusChangeSignal(),
mResizeSignal(),
Window::~Window()
{
+ if ( mAdaptor )
+ {
+ auto bridge = Accessibility::Bridge::GetCurrentBridge();
+ auto accessible2 = mScene.GetRootLayer();
+ auto accessible = Accessibility::Accessible::Get( accessible2 );
+ bridge->RemoveTopLevelWindow( accessible );
+
+ mAdaptor->RemoveWindow( this );
+ }
+
if ( mEventHandler )
{
mEventHandler->RemoveObserver( *this );
mWindowBase->DeleteRequestSignal().Connect( this, &Window::OnDeleteRequest );
mWindowBase->TransitionEffectEventSignal().Connect( this, &Window::OnTransitionEffectEvent );
mWindowBase->KeyboardRepeatSettingsChangedSignal().Connect( this, &Window::OnKeyboardRepeatSettingsChanged );
+ mWindowBase->WindowRedrawRequestSignal().Connect( this, &Window::OnWindowRedrawRequest );
mWindowSurface->OutputTransformedSignal().Connect( this, &Window::OnOutputTransformed );
void Window::OnAdaptorSet(Dali::Adaptor& adaptor)
{
- mEventHandler = EventHandlerPtr(new EventHandler( mWindowSurface, *mAdaptor ) );
+ mEventHandler = EventHandlerPtr(new EventHandler( mWindowSurface->GetWindowBase(), *mAdaptor ) );
mEventHandler->AddObserver( *this );
+
+ auto bridge = Accessibility::Bridge::GetCurrentBridge();
+ auto v = mScene.GetRootLayer();
+ auto accessible = Accessibility::Accessible::Get( v, true );
+ bridge->AddTopLevelWindow( accessible );
+
+ //FIXME: line below is temporary solution for missing "activate" signal and should be removed
+ Show();
}
void Window::OnSurfaceSet( Dali::RenderSurfaceInterface* surface )
{
mWindowBase->Raise();
- GraphicsInterface& graphics = mAdaptor->GetGraphicsInterface();
- EglGraphics* eglGraphics = static_cast<EglGraphics*>(&graphics);
- if (eglGraphics)
- {
- eglGraphics->SetFullSwapNextFrame();
- }
+ mSurface->SetFullSwapNextFrame();
DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), Raise() \n", this, mNativeWindowId );
}
{
mWindowBase->Lower();
- GraphicsInterface& graphics = mAdaptor->GetGraphicsInterface();
- EglGraphics* eglGraphics = static_cast<EglGraphics*>(&graphics);
- if (eglGraphics)
- {
- eglGraphics->SetFullSwapNextFrame();
- }
+ mSurface->SetFullSwapNextFrame();
DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), Lower() \n", this, mNativeWindowId );
}
{
mWindowBase->Activate();
- GraphicsInterface& graphics = mAdaptor->GetGraphicsInterface();
- EglGraphics* eglGraphics = static_cast<EglGraphics*>(&graphics);
- if (eglGraphics)
- {
- eglGraphics->SetFullSwapNextFrame();
- }
+ mSurface->SetFullSwapNextFrame();
DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), Activate() \n", this, mNativeWindowId );
}
return mScene.GetRenderTaskList();
}
-void Window::AddAvailableOrientation( Dali::Window::WindowOrientation orientation )
+void Window::AddAvailableOrientation( WindowOrientation orientation )
{
if( IsOrientationAvailable( orientation ) == false )
{
}
}
-void Window::RemoveAvailableOrientation( Dali::Window::WindowOrientation orientation )
+void Window::RemoveAvailableOrientation( WindowOrientation orientation )
{
if( IsOrientationAvailable( orientation ) == false )
{
SetAvailableAnlges( mAvailableAngles );
}
-void Window::SetPreferredOrientation( Dali::Window::WindowOrientation orientation )
+void Window::SetPreferredOrientation( WindowOrientation orientation )
{
- if( orientation < Dali::Window::NO_ORIENTATION_PREFERENCE || orientation > Dali::Window::LANDSCAPE_INVERSE )
+ if( orientation < WindowOrientation::NO_ORIENTATION_PREFERENCE || orientation > WindowOrientation::LANDSCAPE_INVERSE )
{
DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::CheckOrientation: Invalid input orientation [%d]\n", orientation );
return;
mWindowBase->SetPreferredAngle( mPreferredAngle );
}
-Dali::Window::WindowOrientation Window::GetPreferredOrientation()
+WindowOrientation Window::GetPreferredOrientation()
{
DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), GetPreferredOrientation: %d\n", this, mNativeWindowId, mPreferredAngle );
- Dali::Window::WindowOrientation preferredOrientation = ConvertToOrientation( mPreferredAngle );
+ WindowOrientation preferredOrientation = ConvertToOrientation( mPreferredAngle );
return preferredOrientation;
}
mWindowBase->SetAvailableAnlges( angles );
}
-int Window::ConvertToAngle( Dali::Window::WindowOrientation orientation )
+int Window::ConvertToAngle( WindowOrientation orientation )
{
int convertAngle = static_cast< int >( orientation );
if( mOrientationMode == Internal::Adaptor::Window::OrientationMode::LANDSCAPE )
{
switch( orientation )
{
- case Dali::Window::LANDSCAPE:
+ case WindowOrientation::LANDSCAPE:
{
convertAngle = 0;
break;
}
- case Dali::Window::PORTRAIT:
+ case WindowOrientation::PORTRAIT:
{
convertAngle = 90;
break;
}
- case Dali::Window::LANDSCAPE_INVERSE:
+ case WindowOrientation::LANDSCAPE_INVERSE:
{
convertAngle = 180;
break;
}
- case Dali::Window::PORTRAIT_INVERSE:
+ case WindowOrientation::PORTRAIT_INVERSE:
{
convertAngle = 270;
break;
}
- case Dali::Window::NO_ORIENTATION_PREFERENCE:
+ case WindowOrientation::NO_ORIENTATION_PREFERENCE:
{
convertAngle = -1;
break;
return convertAngle;
}
-Dali::Window::WindowOrientation Window::ConvertToOrientation( int angle ) const
+WindowOrientation Window::ConvertToOrientation( int angle ) const
{
- Dali::Window::WindowOrientation orientation = static_cast< Dali::Window::WindowOrientation >( angle );
+ WindowOrientation orientation = static_cast< WindowOrientation >( angle );
if( mOrientationMode == Internal::Adaptor::Window::OrientationMode::LANDSCAPE )
{
switch( angle )
{
case 0:
{
- orientation = Dali::Window::LANDSCAPE;
+ orientation = WindowOrientation::LANDSCAPE;
break;
}
case 90:
{
- orientation = Dali::Window::PORTRAIT;
+ orientation = WindowOrientation::PORTRAIT;
break;
}
case 180:
{
- orientation = Dali::Window::LANDSCAPE_INVERSE;
+ orientation = WindowOrientation::LANDSCAPE_INVERSE;
break;
}
case 270:
{
- orientation = Dali::Window::PORTRAIT_INVERSE;
+ orientation = WindowOrientation::PORTRAIT_INVERSE;
break;
}
case -1:
{
- orientation = Dali::Window::NO_ORIENTATION_PREFERENCE;
+ orientation = WindowOrientation::NO_ORIENTATION_PREFERENCE;
break;
}
}
return orientation;
}
-bool Window::IsOrientationAvailable( Dali::Window::WindowOrientation orientation ) const
+bool Window::IsOrientationAvailable( WindowOrientation orientation ) const
{
- if( orientation <= Dali::Window::NO_ORIENTATION_PREFERENCE || orientation > Dali::Window::LANDSCAPE_INVERSE )
+ if( orientation <= WindowOrientation::NO_ORIENTATION_PREFERENCE || orientation > WindowOrientation::LANDSCAPE_INVERSE )
{
DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::IsOrientationAvailable: Invalid input orientation [%d]\n", orientation );
return false;
mVisibilityChangedSignal.Emit( handle, true );
}
- GraphicsInterface& graphics = mAdaptor->GetGraphicsInterface();
- EglGraphics* eglGraphics = static_cast<EglGraphics*>(&graphics);
- if (eglGraphics)
- {
- eglGraphics->SetFullSwapNextFrame();
- }
+ mSurface->SetFullSwapNextFrame();
DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), Show(): iconified = %d, visible = %d\n", this, mNativeWindowId, mIconified, mVisible );
}
mVisibilityChangedSignal.Emit( handle, false );
}
-
- GraphicsInterface& graphics = mAdaptor->GetGraphicsInterface();
- EglGraphics* eglGraphics = static_cast<EglGraphics*>(&graphics);
- if (eglGraphics)
- {
- eglGraphics->SetFullSwapNextFrame();
- }
-
DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), Hide(): iconified = %d, visible = %d\n", this, mNativeWindowId, mIconified, mVisible );
}
{
mWindowBase->SetInputRegion( inputRegion );
- GraphicsInterface& graphics = mAdaptor->GetGraphicsInterface();
- EglGraphics* eglGraphics = static_cast<EglGraphics*>(&graphics);
- if (eglGraphics)
- {
- eglGraphics->SetFullSwapNextFrame();
- }
-
DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetInputRegion: x = %d, y = %d, w = %d, h = %d\n", inputRegion.x, inputRegion.y, inputRegion.width, inputRegion.height );
}
-void Window::SetType( Dali::Window::Type type )
+void Window::SetType( WindowType type )
{
if( type != mType )
{
}
}
-Dali::Window::Type Window::GetType() const
+WindowType Window::GetType() const
{
return mType;
}
-bool Window::SetNotificationLevel( Dali::Window::NotificationLevel::Type level )
+bool Window::SetNotificationLevel( WindowNotificationLevel level )
{
- if( mType != Dali::Window::NOTIFICATION )
+ if( mType != WindowType::NOTIFICATION )
{
DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetNotificationLevel: Not supported window type [%d]\n", mType );
return false;
return mWindowBase->SetNotificationLevel( level );
}
-Dali::Window::NotificationLevel::Type Window::GetNotificationLevel() const
+WindowNotificationLevel Window::GetNotificationLevel() const
{
- if( mType != Dali::Window::NOTIFICATION )
+ if( mType != WindowType::NOTIFICATION )
{
DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::GetNotificationLevel: Not supported window type [%d]\n", mType );
- return Dali::Window::NotificationLevel::NONE;
+ return WindowNotificationLevel::NONE;
}
return mWindowBase->GetNotificationLevel();
return mOpaqueState;
}
-bool Window::SetScreenOffMode(Dali::Window::ScreenOffMode::Type screenOffMode)
+bool Window::SetScreenOffMode(WindowScreenOffMode screenOffMode)
{
return mWindowBase->SetScreenOffMode( screenOffMode );
}
-Dali::Window::ScreenOffMode::Type Window::GetScreenOffMode() const
+WindowScreenOffMode Window::GetScreenOffMode() const
{
return mWindowBase->GetScreenOffMode();
}
DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), SetSize(): resize signal [%d x %d]\n", this, mNativeWindowId, newRect.width, newRect.height );
Dali::Window handle( this );
- mResizedSignal.Emit( newSize );
mResizeSignal.Emit( handle, newSize );
mAdaptor->SurfaceResizeComplete( mSurface.get(), newSize );
}
- GraphicsInterface& graphics = mAdaptor->GetGraphicsInterface();
- EglGraphics* eglGraphics = static_cast<EglGraphics*>(&graphics);
- if (eglGraphics)
- {
- eglGraphics->SetFullSwapNextFrame();
- }
+ mSurface->SetFullSwapNextFrame();
}
Dali::Window::WindowSize Window::GetSize() const
mWindowSurface->MoveResize( PositionSize( position.GetX(), position.GetY(), oldRect.width, oldRect.height ) );
- GraphicsInterface& graphics = mAdaptor->GetGraphicsInterface();
- EglGraphics* eglGraphics = static_cast<EglGraphics*>(&graphics);
- if (eglGraphics)
- {
- eglGraphics->SetFullSwapNextFrame();
- }
+ mSurface->SetFullSwapNextFrame();
}
Dali::Window::WindowPosition Window::GetPosition() const
DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), SetPositionSize():resize signal [%d x %d]\n", this, mNativeWindowId, newRect.width, newRect.height );
Dali::Window handle( this );
- mResizedSignal.Emit( newSize );
mResizeSignal.Emit( handle, newSize );
mAdaptor->SurfaceResizeComplete( mSurface.get(), newSize );
}
- GraphicsInterface& graphics = mAdaptor->GetGraphicsInterface();
- EglGraphics* eglGraphics = static_cast<EglGraphics*>(&graphics);
- if (eglGraphics)
- {
- eglGraphics->SetFullSwapNextFrame();
- }
+ mSurface->SetFullSwapNextFrame();
}
Dali::Layer Window::GetRootLayer() const
DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), Deiconified: visible = %d\n", this, mNativeWindowId, mVisible );
}
- GraphicsInterface& graphics = mAdaptor->GetGraphicsInterface();
- EglGraphics* eglGraphics = static_cast<EglGraphics*>(&graphics);
- if (eglGraphics)
- {
- eglGraphics->SetFullSwapNextFrame();
- }
+ mSurface->SetFullSwapNextFrame();
}
void Window::OnFocusChanged( bool focusIn )
Dali::Window handle( this );
mFocusChangeSignal.Emit( handle, focusIn );
- GraphicsInterface& graphics = mAdaptor->GetGraphicsInterface();
- EglGraphics* eglGraphics = static_cast<EglGraphics*>(&graphics);
- if (eglGraphics)
+ mSurface->SetFullSwapNextFrame();
+
+ if (auto b = Dali::Accessibility::Bridge::GetCurrentBridge())
{
- eglGraphics->SetFullSwapNextFrame();
+ if (focusIn)
+ {
+ b->ApplicationShown();
+ }
+ else
+ {
+ b->ApplicationHidden();
+ }
}
}
mDeleteRequestSignal.Emit();
}
-void Window::OnTransitionEffectEvent( DevelWindow::EffectState state, DevelWindow::EffectType type )
+void Window::OnTransitionEffectEvent( WindowEffectState state, WindowEffectType type )
{
Dali::Window handle( this );
mTransitionEffectEventSignal.Emit( handle, state, type );
mKeyboardRepeatSettingsChangedSignal.Emit();
}
+void Window::OnWindowRedrawRequest()
+{
+ mAdaptor->RenderOnce();
+}
+
void Window::OnTouchPoint( Dali::Integration::Point& point, int timeStamp )
{
FeedTouchPoint( point, timeStamp );
DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), OnRotation(): resize signal emit [%d x %d]\n", this, mNativeWindowId, mWindowWidth, mWindowHeight );
// Emit signal
Dali::Window handle( this );
- mResizedSignal.Emit( Dali::Window::WindowSize( mWindowWidth, mWindowHeight ) );
mResizeSignal.Emit( handle, Dali::Window::WindowSize( mWindowWidth, mWindowHeight ) );
mAdaptor->SurfaceResizeComplete( mSurface.get(), Adaptor::SurfaceSize( mWindowWidth, mWindowHeight ) );
{
mEventHandler->Pause();
}
-
- GraphicsInterface& graphics = mAdaptor->GetGraphicsInterface();
- EglGraphics* eglGraphics = static_cast<EglGraphics*>(&graphics);
- if (eglGraphics)
- {
- eglGraphics->SetFullSwapNextFrame();
- }
}
void Window::OnResume()
mEventHandler->Resume();
}
- GraphicsInterface& graphics = mAdaptor->GetGraphicsInterface();
- EglGraphics* eglGraphics = static_cast<EglGraphics*>(&graphics);
- if (eglGraphics)
- {
- eglGraphics->SetFullSwapNextFrame();
- }
+ mSurface->SetFullSwapNextFrame();
}
void Window::RecalculateTouchPosition( Integration::Point& point )
return mParentWindow;
}
-Dali::Window::WindowOrientation Window::GetCurrentOrientation() const
+WindowOrientation Window::GetCurrentOrientation() const
{
DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), GetCurrentOrientation(): %d\n", this, mNativeWindowId, mRotationAngle );
return ConvertToOrientation( mRotationAngle );
}
-void Window::SetAvailableOrientations( const Dali::Vector<Dali::Window::WindowOrientation>& orientations )
+void Window::SetAvailableOrientations( const Dali::Vector<WindowOrientation>& orientations )
{
Dali::Vector<float>::SizeType count = orientations.Count();
for( Dali::Vector<float>::SizeType index = 0; index < count; ++index )
return mWindowBase->GetNativeWindowId();
}
-void Window::SetDamagedAreas(std::vector<Dali::Rect<int>>& areas)
-{
- GraphicsInterface& graphics = mAdaptor->GetGraphicsInterface();
- EglGraphics* eglGraphics = static_cast<EglGraphics*>(&graphics);
- if (eglGraphics)
- {
- eglGraphics->SetDamagedAreas(areas);
- }
-}
-
} // Adaptor
} // Internal