X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fdevel-api%2Fadaptor-framework%2Fwindow-devel.cpp;h=09f070c570a581798bb402d131584422cb817734;hb=62480e7eb3bb946a5e41d118aaf58e4596bed5fc;hp=ad84d9575e2856c70d9e503ee78ec72306edefdf;hpb=ba73d31ff2edf8662acfcc9a44f145af07bbadb3;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 ad84d95..09f070c 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) 2021 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. @@ -16,8 +16,8 @@ */ // EXTERNAL INCLUDES +#include #include -#include #include // INTERNAL INCLUDES @@ -26,83 +26,174 @@ namespace Dali { - namespace DevelWindow { +Window New(Any surface, PositionSize windowPosition, const std::string& name, bool isTransparent) +{ + 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, WindowType::NORMAL, 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; +} + +void SetPositionSize(Window window, PositionSize positionSize) +{ + GetImplementation(window).SetPositionSize(positionSize); +} + +Window Get(Actor actor) +{ + return Internal::Adaptor::Window::Get(actor); +} + +EventProcessingFinishedSignalType& EventProcessingFinishedSignal(Window window) +{ + return GetImplementation(window).EventProcessingFinishedSignal(); +} + +WheelEventSignalType& WheelEventSignal(Window window) +{ + return GetImplementation(window).WheelEventSignal(); +} + +VisibilityChangedSignalType& VisibilityChangedSignal(Window window) +{ + return GetImplementation(window).VisibilityChangedSignal(); +} + +TransitionEffectEventSignalType& TransitionEffectEventSignal(Window window) +{ + return GetImplementation(window).TransitionEffectEventSignal(); +} + +KeyboardRepeatSettingsChangedSignalType& KeyboardRepeatSettingsChangedSignal(Window window) +{ + return GetImplementation(window).KeyboardRepeatSettingsChangedSignal(); +} + +void SetParent(Window window, Window parent) +{ + GetImplementation(window).SetParent(parent); +} + +void SetParent(Window window, Window parent, bool belowParent) +{ + GetImplementation(window).SetParent(parent, belowParent); +} + +void Unparent(Window window) +{ + GetImplementation(window).Unparent(); +} + +Window GetParent(Window window) +{ + return GetImplementation(window).GetParent(); +} -void SetPositionSize( Window window, PositionSize positionSize ) +Window DownCast(BaseHandle handle) { - GetImplementation( window ).SetPositionSize( positionSize ); + return Window(dynamic_cast(handle.GetObjectPtr())); } -Dali::RenderTaskList GetRenderTaskList( Window window ) +WindowOrientation GetCurrentOrientation(Window window) { - return GetImplementation( window ).GetRenderTaskList(); + return GetImplementation(window).GetCurrentOrientation(); } -Window Get( Actor actor ) +int GetPhysicalOrientation(Window window) { - return Internal::Adaptor::Window::Get( actor ); + return GetImplementation(window).GetPhysicalOrientation(); } -EventProcessingFinishedSignalType& EventProcessingFinishedSignal( Window window ) +void SetAvailableOrientations(Window window, const Dali::Vector& orientations) { - return GetImplementation( window ).EventProcessingFinishedSignal(); + GetImplementation(window).SetAvailableOrientations(orientations); } -KeyEventSignalType& KeyEventSignal( Window window ) +int32_t GetNativeId(Window window) { - return GetImplementation( window ).KeyEventSignal(); + return GetImplementation(window).GetNativeId(); } -TouchSignalType& TouchSignal( Window window ) +void AddFrameRenderedCallback(Window window, std::unique_ptr callback, int32_t frameId) { - return GetImplementation( window ).TouchSignal(); + GetImplementation(window).AddFrameRenderedCallback(std::move(callback), frameId); } -WheelEventSignalType& WheelEventSignal( Window window ) +void AddFramePresentedCallback(Window window, std::unique_ptr callback, int32_t frameId) { - return GetImplementation( window ).WheelEventSignal(); + GetImplementation(window).AddFramePresentedCallback(std::move(callback), frameId); } -VisibilityChangedSignalType& VisibilityChangedSignal( Window window ) +void SetPositionSizeWithOrientation(Window window, PositionSize positionSize, WindowOrientation orientation) { - return GetImplementation( window ).VisibilityChangedSignal(); + GetImplementation(window).SetPositionSizeWithOrientation(positionSize, orientation); } -TransitionEffectEventSignalType& TransitionEffectEventSignal( Window window ) +void RequestMoveToServer(Window window) { - return GetImplementation( window ).TransitionEffectEventSignal(); + GetImplementation(window).RequestMoveToServer(); } -void SetParent( Window window, Window parent ) +void RequestResizeToServer(Window window, WindowResizeDirection direction) { - GetImplementation( window ).SetParent( parent ); + GetImplementation(window).RequestResizeToServer(direction); } -void Unparent( Window window ) +void EnableFloatingMode(Window window, bool enable) { - GetImplementation( window ).Unparent(); + GetImplementation(window).EnableFloatingMode(enable); } -Window GetParent( Window window ) +void IncludeInputRegion(Window window, const Rect& inputRegion) { - return GetImplementation( window ).GetParent(); + GetImplementation(window).IncludeInputRegion(inputRegion); } -Window DownCast( BaseHandle handle ) +void ExcludeInputRegion(Window window, const Rect& inputRegion) { - return Window( dynamic_cast( handle.GetObjectPtr()) ); + GetImplementation(window).ExcludeInputRegion(inputRegion); } -Dali::Window::WindowOrientation GetCurrentOrientation( Window window ) +void SetNeedsRotationCompletedAcknowledgement(Window window, bool needAcknowledgement) { - return GetImplementation( window ).GetCurrentOrientation(); + GetImplementation(window).SetNeedsRotationCompletedAcknowledgement(needAcknowledgement); } -void SetAvailableOrientations( Window window, const Dali::Vector& orientations ) +void SendRotationCompletedAcknowledgement(Window window) { - GetImplementation( window ).SetAvailableOrientations( orientations ); + GetImplementation(window).SendRotationCompletedAcknowledgement(); } } // namespace DevelWindow