if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
+ /// <summary>
+ /// Get native player handle.
+ /// <example>
+ /// How to get native player handle
+ /// <code>
+ /// VideoView videoView = new VideoView();
+ /// videoView.ResourceUrl = "some xxx video path";
+ /// var handle = videoView.NativeHandle;
+ /// if(handle?.IsInvalid == false)
+ /// {
+ /// IntPtr nativeHandle = handle.DangerousGetHandle();
+ /// // do something with nativeHandle
+ /// }
+ /// </code>
+ /// </example>
+ /// </summary>
+ /// <since_tizen> 9 </since_tizen>
+ public SafeHandle NativeHandle
+ {
+ get
+ {
+ return new NUI.SafeNativePlayerHandle(this);
+ }
+ }
+
internal VideoViewSignal FinishedSignal()
{
VideoViewSignal ret = new VideoViewSignal(Interop.VideoView.FinishedSignal(SwigCPtr), false);
/// Contains and encapsulates Native Player handle.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
+ [Obsolete("Deprecated in API9, will be removed in API11. Please use VideoView.NativeHandle instead!")]
public class SafeNativePlayerHandle : SafeHandle
{
/// <summary>
--- /dev/null
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+using System.ComponentModel;
+using System.Runtime.InteropServices;
+using Tizen.NUI.BaseComponents;
+
+namespace Tizen.NUI
+{
+ /// <summary>
+ /// Contains and encapsulates Native Player handle.
+ /// </summary>
+ internal class SafeNativePlayerHandle : SafeHandle
+ {
+ /// <summary>
+ /// Constructor, Native player handle is set to handle.
+ /// </summary>
+ internal SafeNativePlayerHandle(VideoView videoView) : base(global::System.IntPtr.Zero, false)
+ {
+ if (videoView != null)
+ {
+ SetHandle(videoView.GetNativePlayerHandle());
+ }
+ }
+
+ /// <summary>
+ /// Null check if the handle is valid or not.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool IsInvalid
+ {
+ get
+ {
+ return handle == global::System.IntPtr.Zero;
+ }
+ }
+ /// <summary>
+ /// Release handle itself.
+ /// </summary>
+ /// <returns>true when released successfully.</returns>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ protected override bool ReleaseHandle()
+ {
+ SetHandle(global::System.IntPtr.Zero);
+ return true;
+ }
+ }
+}
[EditorBrowsable(EditorBrowsableState.Never)]
static public Window Get(View view)
{
- if(view == null)
+ if (view == null)
{
NUILog.Error("if there is no view, it can not get a window");
return null;
return ret;
}
+ /// <summary>
+ /// Get Native Window handle.
+ /// <example>
+ /// How to get Native Window handle
+ /// <code>
+ /// Window window = NUIApplication.GetDefaultWindow();
+ /// var handle = window.NativeHandle;
+ /// if(handle?.IsInvalid == false)
+ /// {
+ /// IntPtr nativeHandle = handle.DangerousGetHandle();
+ /// // do something with nativeHandle
+ /// }
+ /// </code>
+ /// </example>
+ /// </summary>
+ /// <since_tizen> 9 </since_tizen>
+ public SafeHandle NativeHandle
+ {
+ get
+ {
+ return new NUI.SafeNativeWindowHandle(this);
+ }
+ }
}
}
/// Contains and encapsulates Native Window handle.
/// </summary>
/// <since_tizen> 4 </since_tizen>
+ [Obsolete("Deprecated in API9, will be removed in API11. Please use Window.NativeHandle instead!")]
public class SafeNativeWindowHandle : SafeHandle
{
/// <summary>
--- /dev/null
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+using System;
+using System.ComponentModel;
+using System.Runtime.InteropServices;
+
+namespace Tizen.NUI
+{
+ /// <summary>
+ /// Contains and encapsulates Native Window handle.
+ /// </summary>
+ internal class SafeNativeWindowHandle : SafeHandle
+ {
+ /// <summary>
+ ///Constructor, Native window handle is set to handle.
+ /// </summary>
+ internal SafeNativeWindowHandle(Window currentWindow) : base(IntPtr.Zero, false)
+ {
+ SetHandle(currentWindow != null ? currentWindow.GetNativeWindowHandler() : IntPtr.Zero);
+ }
+ /// <summary>
+ /// Null check if the handle is valid or not.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool IsInvalid
+ {
+ get
+ {
+ return this.handle == IntPtr.Zero;
+ }
+ }
+ /// <summary>
+ /// Release handle itself.
+ /// </summary>
+ /// <returns>true when released successfully.</returns>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ protected override bool ReleaseHandle()
+ {
+ SetHandle(global::System.IntPtr.Zero);
+ return true;
+ }
+ }
+}