*/
using System;
+using System.Drawing;
using System.Runtime.InteropServices;
+using Tizen.Multimedia;
using Tizen.Multimedia.Remoting;
internal static partial class Interop
[DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_set_display")]
internal static extern ScreenMirroringErrorCode SetDisplay(IntPtr handle, int type, IntPtr display);
+ [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_set_display_mode")]
+ internal static extern ScreenMirroringErrorCode SetDisplayMode(IntPtr handle, ScreenMirroringDisplayMode mode);
+
+ [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_set_display_roi")]
+ internal static extern ScreenMirroringErrorCode SetDisplayRoi(IntPtr handle, int x, int y, int width, int height);
+
+ [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_set_display_rotation")]
+ internal static extern ScreenMirroringErrorCode SetDisplayRotation(IntPtr handle, Rotation rotatjion);
+
[DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_set_ecore_wl_display")]
internal static extern ScreenMirroringErrorCode SetEcoreDisplay(IntPtr handle, IntPtr display);
[DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_set_resolution")]
internal static extern ScreenMirroringErrorCode SetResolution(IntPtr handle, ScreenMirroringResolutions resolution);
+ [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_set_src_device_type")]
+ internal static extern ScreenMirroringErrorCode SetSrcDeviceType(IntPtr handle, ScreenMirroringDeviceType type);
+
[DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_prepare")]
internal static extern ScreenMirroringErrorCode Prepare(IntPtr handle);
}
}
+ private ScreenMirroringDisplayMode _displayMode;
+ /// <summary>
+ /// Gets or sets the display mode.
+ /// </summary>
+ /// <exception cref="ObjectDisposedException">The <see cref="ScreenMirroring"/> has already been disposed.</exception>
+ /// <since_tizen> 13 </since_tizen>
+ public ScreenMirroringDisplayMode DisplayMode
+ {
+ get
+ {
+ ThrowIfDisposed();
+
+ return _displayMode;
+ }
+ set
+ {
+ Native.SetDisplayMode(Handle, value).ThrowIfError("Failed to set display mode");
+ _displayMode = value;
+ }
+ }
+
+ private Rectangle _displayRoi;
+ /// <summary>
+ /// Gets or sets the display position and size of the receiver screen view.
+ /// </summary>
+ /// <remarks>
+ /// DisplayRoi will be applied when <see cref="DisplayMode"/> is <see cref="ScreenMirroringDisplayMode.CustomRoi"/>.
+ /// </remarks>
+ /// <exception cref="ArgumentOutOfRangeException">
+ /// DisplayRoi.X or DisplayRoi.Y is less than 0.<br/>
+ /// -or-<br/>
+ /// DisplayRoi.Width or DisplayRoi.Height is less than or equal to 0.<br/>
+ /// </exception>
+ /// <exception cref="ObjectDisposedException">The <see cref="ScreenMirroring"/> has already been disposed.</exception>
+ /// <seealso cref="DisplayMode"/>
+ /// <since_tizen> 13 </since_tizen>
+ public Rectangle DisplayRoi
+ {
+ get
+ {
+ ThrowIfDisposed();
+
+ return _displayRoi;
+ }
+ set
+ {
+ if (value.X < 0)
+ {
+ throw new ArgumentOutOfRangeException("X", value.X,
+ $"The X of the roi can't be less than zero.");
+ }
+ if (value.Y < 0)
+ {
+ throw new ArgumentOutOfRangeException("Y", value.Y,
+ $"The Y of the roi can't be less than zero.");
+ }
+ if (value.Width <= 0)
+ {
+ throw new ArgumentOutOfRangeException("Width", value.Width,
+ $"The Width of the roi can't be less than or equal to zero.");
+ }
+ if (value.Height <= 0)
+ {
+ throw new ArgumentOutOfRangeException("Height", value.Height,
+ $"The Height of the roi can't be less than or equal to zero.");
+ }
+
+ Native.SetDisplayRoi(Handle, value.X, value.Y, value.Width, value.Height)
+ .ThrowIfError("Failed to set display ROI");
+ _displayRoi = value;
+ }
+ }
+
+ private Rotation _displayRotation;
+ /// <summary>
+ /// Gets or sets the display rotation.
+ /// </summary>
+ /// <exception cref="ObjectDisposedException">The <see cref="ScreenMirroring"/> has already been disposed.</exception>
+ /// <since_tizen> 13 </since_tizen>
+ public Rotation DisplayRotation
+ {
+ get
+ {
+ ThrowIfDisposed();
+
+ return _displayRotation;
+ }
+ set
+ {
+ Native.SetDisplayRotation(Handle, value).ThrowIfError("Failed to set display rotation");
+ _displayRotation = value;
+ }
+ }
+
+ private ScreenMirroringDeviceType _srcDeviceType;
+ /// <summary>
+ /// Gets or sets the source device type.
+ /// </summary>
+ /// <exception cref="ObjectDisposedException">The <see cref="ScreenMirroring"/> has already been disposed.</exception>
+ /// <since_tizen> 13 </since_tizen>
+ public ScreenMirroringDeviceType SourceDeviceType
+ {
+ get
+ {
+ ThrowIfDisposed();
+
+ return _srcDeviceType;
+ }
+ set
+ {
+ Native.SetSrcDeviceType(Handle, value).ThrowIfError("Failed to set source device type");
+ _srcDeviceType = value;
+ }
+ }
+
/// <summary>
/// Releases all resource used by the <see cref="ScreenMirroring"/> object.
/// </summary>
/// </summary>
InvalidOperation = ScreenMirroringErrorCode.InvalidOperation
}
+
+ /// <summary>
+ /// Specifies the display mode for <see cref="ScreenMirroring"/>.
+ /// </summary>
+ /// <since_tizen> 13 </since_tizen>
+ public enum ScreenMirroringDisplayMode
+ {
+ /// <summary>
+ /// Letter box.
+ /// </summary>
+ LetterBox,
+
+ /// <summary>
+ /// Original size.
+ /// </summary>
+ OriginSize,
+
+ /// <summary>
+ /// Full screen.
+ /// </summary>
+ Full,
+
+ /// <summary>
+ /// Cropped full screen.
+ /// </summary>
+ CroppedFull,
+
+ /// <summary>
+ /// Original size or letter box.
+ /// </summary>
+ OriginOrLetterBox,
+
+ /// <summary>
+ /// Custom ROI.
+ /// </summary>
+ CustomRoi
+ }
+
+ /// <summary>
+ /// Specifies the device type for <see cref="ScreenMirroring"/>.
+ /// </summary>
+ /// <since_tizen> 13 </since_tizen>
+ public enum ScreenMirroringDeviceType
+ {
+ /// <summary>
+ /// All other devices except TV and Mobile.
+ /// </summary>
+ Generic,
+
+ /// <summary>
+ /// TV device.
+ /// </summary>
+ Tv,
+
+ /// <summary>
+ /// Mobile device.
+ /// </summary>
+ Mobile
+ }
}