X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fdevel-api%2Fadaptor-framework%2Fwindow-devel.cpp;h=0713159863b67e83155cd96f68b9389b62cc910c;hb=abe404aa50089e1042631d5bb3254ad760552b65;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..0713159 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,227 @@ 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(); +} + +AuxiliaryMessageSignalType& AuxiliaryMessageSignal(Window window) +{ + return GetImplementation(window).AuxiliaryMessageSignal(); +} + +AccessibilityHighlightSignalType& AccessibilityHighlightSignal(Window window) +{ + return GetImplementation(window).AccessibilityHighlightSignal(); +} + +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(); +} + +Window DownCast(BaseHandle handle) +{ + return Window(dynamic_cast(handle.GetObjectPtr())); +} + +WindowOrientation GetCurrentOrientation(Window window) +{ + return GetImplementation(window).GetCurrentOrientation(); +} + +int GetPhysicalOrientation(Window window) +{ + return GetImplementation(window).GetPhysicalOrientation(); +} + +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 callback, int32_t frameId) +{ + GetImplementation(window).AddFrameRenderedCallback(std::move(callback), frameId); +} + +void AddFramePresentedCallback(Window window, std::unique_ptr callback, int32_t frameId) +{ + GetImplementation(window).AddFramePresentedCallback(std::move(callback), frameId); +} + +void SetPositionSizeWithOrientation(Window window, PositionSize positionSize, WindowOrientation orientation) +{ + GetImplementation(window).SetPositionSizeWithOrientation(positionSize, orientation); +} -void SetPositionSize( Window window, PositionSize positionSize ) +void RequestMoveToServer(Window window) { - GetImplementation( window ).SetPositionSize( positionSize ); + GetImplementation(window).RequestMoveToServer(); } -Dali::RenderTaskList GetRenderTaskList( Window window ) +void RequestResizeToServer(Window window, WindowResizeDirection direction) { - return GetImplementation( window ).GetRenderTaskList(); + GetImplementation(window).RequestResizeToServer(direction); } -Window Get( Actor actor ) +void EnableFloatingMode(Window window, bool enable) { - return Internal::Adaptor::Window::Get( actor ); + GetImplementation(window).EnableFloatingMode(enable); } -EventProcessingFinishedSignalType& EventProcessingFinishedSignal( Window window ) +void IncludeInputRegion(Window window, const Rect& inputRegion) { - return GetImplementation( window ).EventProcessingFinishedSignal(); + GetImplementation(window).IncludeInputRegion(inputRegion); } -KeyEventSignalType& KeyEventSignal( Window window ) +void ExcludeInputRegion(Window window, const Rect& inputRegion) { - return GetImplementation( window ).KeyEventSignal(); + GetImplementation(window).ExcludeInputRegion(inputRegion); } -TouchSignalType& TouchSignal( Window window ) +void SetNeedsRotationCompletedAcknowledgement(Window window, bool needAcknowledgement) { - return GetImplementation( window ).TouchSignal(); + GetImplementation(window).SetNeedsRotationCompletedAcknowledgement(needAcknowledgement); } -WheelEventSignalType& WheelEventSignal( Window window ) +void SendRotationCompletedAcknowledgement(Window window) { - return GetImplementation( window ).WheelEventSignal(); + GetImplementation(window).SendRotationCompletedAcknowledgement(); } -VisibilityChangedSignalType& VisibilityChangedSignal( Window window ) +void FeedTouchPoint(Window window, const Dali::TouchPoint& point, int32_t timeStamp) { - return GetImplementation( window ).VisibilityChangedSignal(); + Integration::Point convertedPoint(point); + GetImplementation(window).FeedTouchPoint(convertedPoint, timeStamp); } -TransitionEffectEventSignalType& TransitionEffectEventSignal( Window window ) +void FeedWheelEvent(Window window, const Dali::WheelEvent& wheelEvent) { - return GetImplementation( window ).TransitionEffectEventSignal(); + Integration::WheelEvent convertedEvent(static_cast(wheelEvent.GetType()), wheelEvent.GetDirection(), wheelEvent.GetModifiers(), wheelEvent.GetPoint(), wheelEvent.GetDelta(), wheelEvent.GetTime()); + GetImplementation(window).FeedWheelEvent(convertedEvent); } -void SetParent( Window window, Window parent ) +void FeedKeyEvent(Window window, const Dali::KeyEvent& keyEvent) { - GetImplementation( window ).SetParent( parent ); + Integration::KeyEvent convertedEvent(keyEvent.GetKeyName(), keyEvent.GetLogicalKey(), keyEvent.GetKeyString(), keyEvent.GetKeyCode(), keyEvent.GetKeyModifier(), keyEvent.GetTime(), static_cast(keyEvent.GetState()), keyEvent.GetCompose(), keyEvent.GetDeviceName(), keyEvent.GetDeviceClass(), keyEvent.GetDeviceSubclass()); + GetImplementation(window).FeedKeyEvent(convertedEvent); } -void Unparent( Window window ) +void Maximize(Window window, bool maximize) { - GetImplementation( window ).Unparent(); + GetImplementation(window).Maximize(maximize); } -Window GetParent( Window window ) +bool IsMaximized(Window window) { - return GetImplementation( window ).GetParent(); + return GetImplementation(window).IsMaximized(); } -Window DownCast( BaseHandle handle ) +void Minimize(Window window, bool miniimize) { - return Window( dynamic_cast( handle.GetObjectPtr()) ); + GetImplementation(window).Minimize(miniimize); } -Dali::Window::WindowOrientation GetCurrentOrientation( Window window ) +bool IsMinimized(Window window) { - return GetImplementation( window ).GetCurrentOrientation(); + return GetImplementation(window).IsMinimized(); } -void SetAvailableOrientations( Window window, const Dali::Vector& orientations ) +bool IsWindowRotating(Window window) { - GetImplementation( window ).SetAvailableOrientations( orientations ); + return GetImplementation(window).IsWindowRotating(); } } // namespace DevelWindow