UiSync = uiSync;
}
+ /// <summary>
+ /// Initializes a new instance of the <see cref="Display"/> class with an <see cref="IWindowProvider"/> interface.
+ /// </summary>
+ /// <param name="window">An <see cref="IWindowProvider"/> object that provides a handle to a window.</param>
+ /// <since_tizen> 12 </since_tizen>
+ public Display(IWindowProvider window)
+ : this(window, false)
+ {
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="Display"/> class with an <see cref="IWindowProvider"/> interface.
+ /// </summary>
+ /// <param name="window">An <see cref="IWindowProvider"/> object that provides a handle to a window.</param>
+ /// <param name="uiSync">A value indicating whether video and UI are in sync or not.</param>
+ /// <remarks>
+ /// UI sync is only for <see cref="T:Tizen.Multimedia.Player"/> and
+ /// <see cref="T:Tizen.Multimedia.Player.DisplaySettings"/> will not work in UI sync mode.
+ /// </remarks>
+ /// <since_tizen> 12 </since_tizen>
+ public Display(IWindowProvider window, bool uiSync)
+ {
+ if (window == null)
+ {
+ throw new ArgumentNullException(nameof(window));
+ }
+
+ _setter = new EcoreDisplaySetter(window.WindowHandle,
+ new Rectangle((int)window.X, (int)window.Y, (int)window.Width, (int)window.Height),
+ window.Rotation.ToMmRotation());
+
+ UiSync = uiSync;
+ }
+
+
private EvasObject EvasObject { get; }
private DisplayType Type { get; }
return Tizen.Multimedia.Rotation.Rotate90;
}
+
+ internal static Rotation ToMmRotation(this int rotation)
+ {
+ switch (rotation)
+ {
+ case 0:
+ return Rotation.Rotate0;
+ case 90:
+ return Rotation.Rotate90;
+ case 180:
+ return Rotation.Rotate180;
+ case 270:
+ return Rotation.Rotate270;
+ default:
+ break;
+ }
+
+ return Rotation.Rotate90;
+ }
}
}
--- /dev/null
+using System;
+
+namespace Tizen.Multimedia
+{
+ /// <summary>
+ /// The IWindowProvider interface provides the window handle and information about the window's position, size, and rotation.
+ /// </summary>
+ /// <since_tizen> 12 </since_tizen>
+ public interface IWindowProvider
+ {
+ /// <summary>
+ /// Gets the window handle
+ /// </summary>
+ /// <remarks>
+ /// This handle represents Ecore_Wl2_Window on native.
+ /// </remarks>
+ IntPtr WindowHandle { get; }
+
+ /// <summary>
+ /// Gets the x-coordinate of the window's position.
+ /// </summary>
+ float X { get; }
+ /// <summary>
+ /// Gets the y-coordinate of the window's position.
+ /// </summary>
+ float Y { get; }
+
+ /// <summary>
+ /// Gets the width of the window.
+ /// </summary>
+ float Width { get; }
+
+ /// <summary>
+ /// Gets the height of the window.
+ /// </summary>
+ float Height { get; }
+
+ /// <summary>
+ /// Gets the rotation of the window in degrees. The value can only be 0, 90, 180, or 270.
+ /// </summary>
+ int Rotation { get; }
+ }
+}