X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fwindow-system%2Fcommon%2Fwindow-impl.cpp;h=b21ca778ff6e85779b7807396c530cdea02aec86;hb=8786ea8fbb26a9cb555a613518cf108017467c69;hp=b505b2247af1910c4846ece0ca888d564db07a56;hpb=e8e6f0fed1f6c63f3003ae968daab969a8a654fe;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/internal/window-system/common/window-impl.cpp b/dali/internal/window-system/common/window-impl.cpp old mode 100644 new mode 100755 index b505b22..b21ca77 --- a/dali/internal/window-system/common/window-impl.cpp +++ b/dali/internal/window-system/common/window-impl.cpp @@ -19,6 +19,7 @@ #include // EXTERNAL HEADERS +#include #include #include #include @@ -56,11 +57,17 @@ Debug::Filter* gWindowLogFilter = Debug::Filter::New( Debug::NoLogging, false, " } // unnamed namespace -Window* Window::New( const PositionSize& positionSize, const std::string& name, const std::string& className, bool isTransparent ) +Window* Window::New(const PositionSize& positionSize, const std::string& name, const std::string& className, bool isTransparent) +{ + Any surface; + return Window::New(surface, positionSize, name, className, isTransparent); +} + +Window* Window::New(Any surface, const PositionSize& positionSize, const std::string& name, const std::string& className, bool isTransparent) { Window* window = new Window(); window->mIsTransparent = isTransparent; - window->Initialize( positionSize, name, className ); + window->Initialize(surface, positionSize, name, className); return window; } @@ -98,10 +105,9 @@ Window::~Window() } } -void Window::Initialize(const PositionSize& positionSize, const std::string& name, const std::string& className) +void Window::Initialize(Any surface, const PositionSize& positionSize, const std::string& name, const std::string& className) { // Create a window render surface - Any surface; auto renderSurfaceFactory = Dali::Internal::Adaptor::GetRenderSurfaceFactory(); mSurface = renderSurfaceFactory->CreateWindowRenderSurface( positionSize, surface, mIsTransparent ); mWindowSurface = static_cast( mSurface.get() ); @@ -872,6 +878,43 @@ Dali::Window::WindowOrientation Window::GetCurrentOrientation() const return ConvertToOrientation( mRotationAngle ); } +void Window::SetAvailableOrientations( const Dali::Vector& orientations ) +{ + Dali::Vector::SizeType count = orientations.Count(); + for( Dali::Vector::SizeType index = 0; index < count; ++index ) + { + if( IsOrientationAvailable( orientations[index] ) == false ) + { + DALI_LOG_ERROR("Window::SetAvailableOrientations, invalid orientation: %d\n", orientations[index]); + continue; + } + + bool found = false; + int convertedAngle = ConvertToAngle( orientations[index] ); + + for( std::size_t i = 0; i < mAvailableAngles.size(); i++ ) + { + if( mAvailableAngles[i] == convertedAngle ) + { + found = true; + break; + } + } + + if( !found ) + { + DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), SetAvailableOrientations: %d\n", this, mNativeWindowId, convertedAngle ); + mAvailableAngles.push_back( convertedAngle ); + } + } + SetAvailableAnlges( mAvailableAngles ); +} + +int32_t Window::GetNativeId() const +{ + return mWindowBase->GetNativeWindowId(); +} + } // Adaptor } // Internal