type == DisplayType.Overlay ? PlayerDisplayType.Overlay : PlayerDisplayType.Evas, evasObject);
}
- PlayerErrorCode IDisplayable<PlayerErrorCode>.ApplyEcoreWindow(IntPtr windowHandle, NUI.Rectangle rect)
+ PlayerErrorCode IDisplayable<PlayerErrorCode>.ApplyEcoreWindow(IntPtr windowHandle, Rectangle rect, Rotation rotation)
{
Debug.Assert(IsDisposed == false);
return NativeDisplay.SetEcoreDisplay(Handle,
- _uiSync ? PlayerDisplayType.OverlayUISync : PlayerDisplayType.Overlay, windowHandle, rect.X, rect.Y, rect.Width, rect.Height);
+ _uiSync ? PlayerDisplayType.OverlayUISync : PlayerDisplayType.Overlay, windowHandle, rect.X, rect.Y,
+ rotation == Rotation.Rotate0 || rotation == Rotation.Rotate180 ? rect.Height : rect.Width,
+ rotation == Rotation.Rotate0 || rotation == Rotation.Rotate180 ? rect.Width : rect.Height);
}
#endregion
internal interface IDisplayable<TError>
{
TError ApplyEvasDisplay(DisplayType type, EvasObject evasObject);
- TError ApplyEcoreWindow(IntPtr windowHandle, NUI.Rectangle rect);
+ TError ApplyEcoreWindow(IntPtr windowHandle, Rectangle rect, Rotation rotation);
}
internal interface IDisplaySetter
internal class EcoreDisplaySetter : IDisplaySetter
{
private readonly IntPtr _windowHandle;
- private readonly NUI.Rectangle _rect;
+ private readonly Rectangle _rect;
+ private readonly Rotation _rotation;
- internal EcoreDisplaySetter(IntPtr windowHandle, NUI.Rectangle rect)
+ internal EcoreDisplaySetter(IntPtr windowHandle, Rectangle rect, Rotation rotation)
{
_windowHandle = windowHandle;
_rect = rect;
+ _rotation = rotation;
}
public TError SetDisplay<TError>(IDisplayable<TError> target)
{
- return target.ApplyEcoreWindow(_windowHandle, _rect);
+ return target.ApplyEcoreWindow(_windowHandle, _rect, _rotation);
}
}
{
throw new ArgumentNullException(nameof(window));
}
- _setter = new EcoreDisplaySetter(window.GetNativeWindowHandler(), window.WindowPositionSize);
+
+ var windowSize = new Rectangle(window.WindowPositionSize.X, window.WindowPositionSize.Y,
+ window.WindowPositionSize.Width, window.WindowPositionSize.Height);
+
+ _setter = new EcoreDisplaySetter(window.GetNativeWindowHandler(), windowSize, window.GetCurrentOrientation().ToMmRotation());
UiSync = uiSync;
}
return _setter.SetDisplay(target);
}
}
+
+ internal static class WindowOrientationExtension
+ {
+ internal static Tizen.Multimedia.Rotation ToMmRotation(this NUI.Window.WindowOrientation rotation)
+ {
+ switch (rotation)
+ {
+ case NUI.Window.WindowOrientation.Portrait:
+ return Tizen.Multimedia.Rotation.Rotate0;
+ case NUI.Window.WindowOrientation.Landscape:
+ return Tizen.Multimedia.Rotation.Rotate90;
+ case NUI.Window.WindowOrientation.PortraitInverse:
+ return Tizen.Multimedia.Rotation.Rotate180;
+ case NUI.Window.WindowOrientation.LandscapeInverse:
+ return Tizen.Multimedia.Rotation.Rotate270;
+ default:
+ break;
+ }
+
+ return Tizen.Multimedia.Rotation.Rotate90;
+ }
+ }
}