X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fpublic-api%2Fadaptor-framework%2Fwindow.cpp;h=9d8c8306b5d6ba85059ad618358b013617ff8026;hb=c903b5edb3947f9c1db972436ce613031f8cb1b5;hp=14e8c04ccd542600ba1086ae2d0b44590bf8eb53;hpb=ae5ebea9bccaf7db4da5b0fd76b628dcf9f1fb46;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/public-api/adaptor-framework/window.cpp b/dali/public-api/adaptor-framework/window.cpp index 14e8c04..9d8c830 100644 --- a/dali/public-api/adaptor-framework/window.cpp +++ b/dali/public-api/adaptor-framework/window.cpp @@ -33,24 +33,41 @@ class DALI_INTERNAL DragAndDropDetector : public BaseHandle {}; // Empty class o Window Window::New(PositionSize posSize, const std::string& name, bool isTransparent) { - Internal::Adaptor::Window* window = Internal::Adaptor::Window::New(posSize, name, "", isTransparent); - - Dali::Adaptor& adaptor = Internal::Adaptor::Adaptor::Get(); - Integration::SceneHolder sceneHolder = Integration::SceneHolder( window ); - Internal::Adaptor::Adaptor::GetImplementation( adaptor ).AddWindow( sceneHolder, name, "", isTransparent ); - - return Window(window); + return Dali::Window::New(posSize, name, "", isTransparent); } Window Window::New(PositionSize posSize, const std::string& name, const std::string& className, bool isTransparent) { - Internal::Adaptor::Window* window = Internal::Adaptor::Window::New(posSize, name, className, 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(posSize, name, className, isTransparent); + + Integration::SceneHolder sceneHolder = Integration::SceneHolder(window); - Dali::Adaptor& adaptor = Internal::Adaptor::Adaptor::Get(); - Integration::SceneHolder sceneHolder = Integration::SceneHolder( window ); - Internal::Adaptor::Adaptor::GetImplementation( adaptor ).AddWindow( sceneHolder, name, className, isTransparent ); + if (isAdaptorAvailable) + { + Dali::Adaptor& adaptor = Internal::Adaptor::Adaptor::Get(); + Internal::Adaptor::Adaptor::GetImplementation(adaptor).AddWindow(sceneHolder, name, className, isTransparent); + } + newWindow = Window(window); + } + else + { + DALI_LOG_ERROR("This device can't support multiple windows.\n"); + } - return Window(window); + return newWindow; } Window::Window() @@ -165,7 +182,7 @@ void Window::RemoveAvailableOrientation( WindowOrientation orientation ) GetImplementation(*this).RemoveAvailableOrientation( orientation ); } -void Window::SetPreferredOrientation( Dali::Window::WindowOrientation orientation ) +void Window::SetPreferredOrientation( WindowOrientation orientation ) { GetImplementation(*this).SetPreferredOrientation( orientation ); }