X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=adaptors%2Fwayland%2Fwindow-impl-wl.cpp;h=4683b4c0f8f19c32b2699f1d1ccc86e9039f2cdf;hb=2aded12f94cb4af1815d171891538147b56fa6ea;hp=631681fe05123e194cda31f8f63ff1841e3bd4ea;hpb=d60db6f0ada02ad4207368b0f2f9f7818afc5cb2;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/adaptors/wayland/window-impl-wl.cpp b/adaptors/wayland/window-impl-wl.cpp index 631681f..4683b4c 100644 --- a/adaptors/wayland/window-impl-wl.cpp +++ b/adaptors/wayland/window-impl-wl.cpp @@ -48,11 +48,11 @@ struct Window::EventHandler // place holder }; -Window* Window::New(const PositionSize& posSize, 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 ) { Window* window = new Window(); window->mIsTransparent = isTransparent; - window->Initialize(posSize, name, className); + window->Initialize( positionSize, name, className ); return window; } @@ -112,6 +112,7 @@ Window::Window() mIsFocusAcceptable( true ), mVisible( true ), mOpaqueState( false ), + mResizeEnabled( true ), mIndicator( NULL ), mIndicatorOrientation( Dali::Window::PORTRAIT ), mNextIndicatorOrientation( Dali::Window::PORTRAIT ), @@ -121,7 +122,11 @@ Window::Window() mType( Dali::DevelWindow::NORMAL ), mPreferredOrientation( Dali::Window::PORTRAIT ), mSupportedAuxiliaryHints(), - mAuxiliaryHints() + mAuxiliaryHints(), + mIndicatorVisibilityChangedSignal(), + mFocusChangedSignal(), + mResizedSignal(), + mDeleteRequestSignal() { mEventHandler = NULL; } @@ -140,16 +145,15 @@ Window::~Window() delete mSurface; } -void Window::Initialize(const PositionSize& windowPosition, const std::string& name, const std::string& className) +void Window::Initialize(const PositionSize& positionSize, const std::string& name, const std::string& className) { // create an Wayland window by default Any surface; - Wayland::RenderSurface* windowSurface = new Wayland::RenderSurface( windowPosition, surface, name, mIsTransparent ); + Wayland::RenderSurface* windowSurface = new Wayland::RenderSurface( positionSize, surface, name, mIsTransparent ); mSurface = windowSurface; mOrientation = Orientation::New(this); - } void Window::DoShowIndicator( Dali::Window::WindowOrientation lastOrientation ) @@ -403,6 +407,55 @@ int Window::GetBrightness() return 0; } +void Window::SetSize( Dali::DevelWindow::WindowSize size ) +{ + PositionSize positionSize = mSurface->GetPositionSize(); + + if( positionSize.width != size.GetWidth() || positionSize.height != size.GetHeight() ) + { + positionSize.width = size.GetWidth(); + positionSize.height = size.GetHeight(); + + mSurface->MoveResize( positionSize ); + + mAdaptor->SurfaceSizeChanged( Dali::Adaptor::SurfaceSize( positionSize.width, positionSize.height ) ); + + // Emit signal + mResizedSignal.Emit( Dali::DevelWindow::WindowSize( positionSize.width, positionSize.height ) ); + } +} + +Dali::DevelWindow::WindowSize Window::GetSize() +{ + PositionSize positionSize = mSurface->GetPositionSize(); + + return Dali::DevelWindow::WindowSize( positionSize.width, positionSize.height ); +} + +void Window::SetPosition( Dali::DevelWindow::WindowPosition position ) +{ + PositionSize positionSize = mSurface->GetPositionSize(); + + if( positionSize.x != position.GetX() || positionSize.y != position.GetY() ) + { + positionSize.x = position.GetX(); + positionSize.y = position.GetY(); + + mSurface->MoveResize( positionSize ); + } +} + +Dali::DevelWindow::WindowPosition Window::GetPosition() +{ + PositionSize positionSize = mSurface->GetPositionSize(); + + return Dali::DevelWindow::WindowPosition( positionSize.x, positionSize.y ); +} + +void Window::SetTransparency( bool transparent ) +{ +} + } // Adaptor } // Internal } // Dali