X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=adaptors%2Fcommon%2Fadaptor.cpp;h=847f42e29760f9e35bb3859c8b8d496a1185f4a3;hb=88d565576965f2b4a0a5c1cb870606194cd7b241;hp=cf13b18a0dd1a2d2ad905b6705270ae49ef67f78;hpb=eab81035044cc7398ed941f5e92bdef45ed0f58c;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/adaptors/common/adaptor.cpp b/adaptors/common/adaptor.cpp index cf13b18..847f42e 100644 --- a/adaptors/common/adaptor.cpp +++ b/adaptors/common/adaptor.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2017 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. @@ -20,29 +20,37 @@ // EXTERNAL INCLUDES #include -#include -#include -#include -#include // INTERNAL INCLUDES +#include +#include +#include +#include #include -#include -#include namespace Dali { Adaptor& Adaptor::New( Window window ) { - return New( window, DeviceLayout::DEFAULT_BASE_LAYOUT, Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS ); + return New( window, Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS ); +} + +Adaptor& Adaptor::New( Window window, Configuration::ContextLoss configuration ) +{ + Adaptor* adaptor = Internal::Adaptor::Adaptor::New( window, configuration, NULL ); + return *adaptor; +} + +Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurface& surface ) +{ + return New( nativeWindow, surface, Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS ); } -Adaptor& Adaptor::New( Window window, const DeviceLayout& baseLayout, Configuration::ContextLoss configuration ) +Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurface& surface, Configuration::ContextLoss configuration ) { - Internal::Adaptor::Window& windowImpl = GetImplementation(window); - Adaptor* adaptor = Internal::Adaptor::Adaptor::New( windowImpl.GetSurface(), baseLayout, configuration ); - windowImpl.SetAdaptor(*adaptor); + Dali::RenderSurface* pSurface = const_cast(&surface); + Adaptor* adaptor = Internal::Adaptor::Adaptor::New( nativeWindow, pSurface, configuration, NULL ); return *adaptor; } @@ -71,9 +79,19 @@ void Adaptor::Stop() mImpl->Stop(); } -bool Adaptor::AddIdle( boost::function callBack ) +bool Adaptor::AddIdle( CallbackBase* callback ) { - return mImpl->AddIdle(callBack); + return mImpl->AddIdle( callback ); +} + +void Adaptor::RemoveIdle( CallbackBase* callback ) +{ + mImpl->RemoveIdle( callback ); +} + +void Adaptor::ReplaceSurface( Any nativeWindow, Dali::RenderSurface& surface ) +{ + mImpl->ReplaceSurface(nativeWindow, surface); } Adaptor::AdaptorSignalType& Adaptor::ResizedSignal() @@ -91,6 +109,11 @@ RenderSurface& Adaptor::GetSurface() return mImpl->GetSurface(); } +Any Adaptor::GetNativeWindowHandle() +{ + return mImpl->GetNativeWindowHandle(); +} + void Adaptor::ReleaseSurfaceLock() { mImpl->ReleaseSurfaceLock(); @@ -116,6 +139,11 @@ bool Adaptor::IsAvailable() return Internal::Adaptor::Adaptor::IsAvailable(); } +void Adaptor::NotifySceneCreated() +{ + mImpl->NotifySceneCreated(); +} + void Adaptor::NotifyLanguageChanged() { mImpl->NotifyLanguageChanged(); @@ -126,6 +154,36 @@ void Adaptor::SetMinimumPinchDistance(float distance) mImpl->SetMinimumPinchDistance(distance); } +void Adaptor::FeedTouchPoint( TouchPoint& point, int timeStamp ) +{ + mImpl->FeedTouchPoint(point, timeStamp); +} + +void Adaptor::FeedWheelEvent( WheelEvent& wheelEvent ) +{ + mImpl->FeedWheelEvent(wheelEvent); +} + +void Adaptor::FeedKeyEvent( KeyEvent& keyEvent ) +{ + mImpl->FeedKeyEvent(keyEvent); +} + +void Adaptor::SceneCreated() +{ + mImpl->SceneCreated(); +} + +void Adaptor::SetViewMode( ViewMode mode ) +{ + mImpl->SetViewMode( mode ); +} + +void Adaptor::SetStereoBase( float stereoBase ) +{ + mImpl->SetStereoBase( stereoBase ); +} + Adaptor::Adaptor() : mImpl( NULL ) {