{
public:
- TestRenderSurface( PositionSize positionSize ) {};
+ TestRenderSurface( PositionSize positionSize ) : mPositionSize(positionSize) {};
- PositionSize GetPositionSize() const override { PositionSize size; return size; };
+ PositionSize GetPositionSize() const override { return mPositionSize; };
virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) { dpiHorizontal = dpiVertical = 96; }
bool ReplaceGraphicsSurface() override { return false; };
- void MoveResize( Dali::PositionSize positionSize ) override {};
+ void MoveResize( Dali::PositionSize positionSize ) override { mPositionSize = positionSize; };
void StartRender() override {};
void SetBackgroundColor( Vector4 color ) {};
Vector4 GetBackgroundColor() { return Color::WHITE; };
+
+private:
+ PositionSize mPositionSize;
};
namespace Internal
Dali::RenderSurfaceInterface& GetRenderSurface();
-private:
+protected:
TestRenderSurface mRenderSurface;
Integration::Scene mScene;
namespace Dali
{
-typedef Dali::Rect<int> PositionSize;
+using PositionSize = Dali::Rect<int>;
+using WindowPosition = Uint16Pair;
namespace Internal
{
Window( const PositionSize& positionSize );
virtual ~Window() = default;
static Window* New(const PositionSize& positionSize, const std::string& name, const std::string& className, bool isTransparent);
+
+ WindowPosition GetPosition() const;
+ PositionSize GetPositionSize() const;
+
+ void SetPositionSize(PositionSize positionSize);
+
FocusChangeSignalType mFocusChangeSignal;
ResizeSignalType mResizeSignal;
int mRotationAngle;
return new Window( positionSize );
}
+WindowPosition Window::GetPosition() const
+{
+ PositionSize positionSize = mRenderSurface.GetPositionSize();
+
+ return WindowPosition(positionSize.x, positionSize.y);
+}
+
+PositionSize Window::GetPositionSize() const
+{
+ return mRenderSurface.GetPositionSize();
+}
+
+void Window::SetPositionSize(PositionSize positionSize)
+{
+ mRenderSurface.MoveResize(positionSize);
+
+ Uint16Pair newSize(positionSize.width, positionSize.height);
+ Dali::Window handle(this);
+ mResizeSignal.Emit(handle, newSize);
+}
+
} // Adaptor
} // Internal
void SetPositionSize(Window window, PositionSize positionSize)
{
- Uint16Pair newSize(positionSize.width, positionSize.height);
- GetImplementation( window ).mResizeSignal.Emit(window,newSize);
+ GetImplementation( window ).SetPositionSize(positionSize);
}
int GetPhysicalOrientation(Window window)