X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fdevel-api%2Fadaptor-framework%2Fwindow-devel.cpp;h=f883ae8bde8784d39cb4ab13f5d773c41d50d06b;hb=66ebc91833b3a2da6ca84c24c08f078de2d893be;hp=9d93348203f048a04440198b071259a4649f0f2f;hpb=36a297be6c289ecbda9c2a8db3a9d1052da99d86;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/devel-api/adaptor-framework/window-devel.cpp b/dali/devel-api/adaptor-framework/window-devel.cpp index 9d93348..f883ae8 100644 --- a/dali/devel-api/adaptor-framework/window-devel.cpp +++ b/dali/devel-api/adaptor-framework/window-devel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,6 @@ // EXTERNAL INCLUDES #include -#include #include // INTERNAL INCLUDES @@ -30,14 +29,47 @@ namespace Dali namespace DevelWindow { -void SetPositionSize( Window window, PositionSize positionSize ) +Window New(Any surface, PositionSize windowPosition, const std::string& name, bool isTransparent) { - GetImplementation( window ).SetPositionSize( positionSize ); + return DevelWindow::New(surface, windowPosition, name, "", isTransparent); +} + +Window New(Any surface, PositionSize windowPosition, const std::string& name, const std::string& className, bool isTransparent) +{ + Window newWindow; + + const bool isAdaptorAvailable = Dali::Adaptor::IsAvailable(); + bool isNewWindowAllowed = true; + + if (isAdaptorAvailable) + { + Dali::Adaptor& adaptor = Internal::Adaptor::Adaptor::Get(); + isNewWindowAllowed = Internal::Adaptor::Adaptor::GetImplementation(adaptor).IsMultipleWindowSupported(); + } + + if (isNewWindowAllowed) + { + Internal::Adaptor::Window* window = Internal::Adaptor::Window::New(surface, windowPosition, name, className, isTransparent); + + Integration::SceneHolder sceneHolder = Integration::SceneHolder(window); + if (isAdaptorAvailable) + { + Dali::Adaptor& adaptor = Internal::Adaptor::Adaptor::Get(); + Internal::Adaptor::Adaptor::GetImplementation(adaptor).AddWindow(sceneHolder); + } + newWindow = Window(window); + } + else + { + DALI_LOG_ERROR("This device can't support multiple windows.\n"); + } + + return newWindow; } -Dali::RenderTaskList GetRenderTaskList( Window window ) +void SetPositionSize( Window window, PositionSize positionSize ) { - return GetImplementation( window ).GetRenderTaskList(); + GetImplementation( window ).SetPositionSize( positionSize ); } Window Get( Actor actor ) @@ -50,19 +82,24 @@ EventProcessingFinishedSignalType& EventProcessingFinishedSignal( Window window return GetImplementation( window ).EventProcessingFinishedSignal(); } -KeyEventSignalType& KeyEventSignal( Window window ) +WheelEventSignalType& WheelEventSignal( Window window ) { - return GetImplementation( window ).KeyEventSignal(); + return GetImplementation( window ).WheelEventSignal(); } -TouchSignalType& TouchSignal( Window window ) +VisibilityChangedSignalType& VisibilityChangedSignal( Window window ) { - return GetImplementation( window ).TouchSignal(); + return GetImplementation( window ).VisibilityChangedSignal(); } -WheelEventSignalType& WheelEventSignal( Window window ) +TransitionEffectEventSignalType& TransitionEffectEventSignal( Window window ) { - return GetImplementation( window ).WheelEventSignal(); + return GetImplementation( window ).TransitionEffectEventSignal(); +} + +KeyboardRepeatSettingsChangedSignalType& KeyboardRepeatSettingsChangedSignal( Window window ) +{ + return GetImplementation( window ).KeyboardRepeatSettingsChangedSignal(); } void SetParent( Window window, Window parent ) @@ -84,6 +121,32 @@ Window DownCast( BaseHandle handle ) { return Window( dynamic_cast( handle.GetObjectPtr()) ); } + +Dali::Window::WindowOrientation GetCurrentOrientation( Window window ) +{ + return GetImplementation( window ).GetCurrentOrientation(); +} + +void SetAvailableOrientations( Window window, const Dali::Vector& orientations ) +{ + GetImplementation( window ).SetAvailableOrientations( orientations ); +} + +int32_t GetNativeId( Window window ) +{ + return GetImplementation( window ).GetNativeId(); +} + +void AddFrameRenderedCallback( Window window, std::unique_ptr< CallbackBase > callback, int32_t frameId ) +{ + GetImplementation( window ).AddFrameRenderedCallback( std::move( callback ), frameId ); +} + +void AddFramePresentedCallback( Window window, std::unique_ptr< CallbackBase > callback, int32_t frameId ) +{ + GetImplementation( window ).AddFramePresentedCallback( std::move( callback ), frameId ); +} + } // namespace DevelWindow } // namespace Dali