2 * Copyright(c) 2021 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 using System.ComponentModel;
24 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
25 [EditorBrowsable(EditorBrowsableState.Never)]
26 public class FrameUpdateCallbackInterface : Disposable
28 private uint onUpdateCallbackVersion = 0u;
30 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
31 [EditorBrowsable(EditorBrowsableState.Never)]
32 internal FrameUpdateCallbackInterface(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
34 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
37 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
38 [EditorBrowsable(EditorBrowsableState.Never)]
39 public FrameUpdateCallbackInterface() : this(0u)
43 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
44 [EditorBrowsable(EditorBrowsableState.Never)]
45 public FrameUpdateCallbackInterface(uint updateCallbackVersion) : this(Interop.FrameUpdateCallbackInterface.newFrameUpdateCallbackInterface(), true)
47 onUpdateCallbackVersion = updateCallbackVersion;
49 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
52 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
53 [EditorBrowsable(EditorBrowsableState.Never)]
54 public uint UpdateCallbackVersion => onUpdateCallbackVersion;
56 private void DirectorConnect()
58 Delegate1 = new DelegateFrameUpdateCallbackInterfaceV1(DirectorOnUpdate);
59 Interop.FrameUpdateCallbackInterface.FrameUpdateCallbackInterfaceDirectorConnectV1(SwigCPtr, Delegate1);
62 private global::System.IntPtr proxyIntPtr = global::System.IntPtr.Zero;
64 private bool DirectorOnUpdate(global::System.IntPtr proxy, float elapsedSeconds)
69 if (onUpdateCallbackVersion == 0u)
71 OnUpdate(elapsedSeconds);
73 else if (onUpdateCallbackVersion == 1u)
75 ret = OnUpdate(this, elapsedSeconds);
77 proxyIntPtr = global::System.IntPtr.Zero;
82 internal delegate bool DelegateFrameUpdateCallbackInterfaceV1(global::System.IntPtr proxy, float elapsedSeconds);
83 private DelegateFrameUpdateCallbackInterfaceV1 Delegate1;
85 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
86 [EditorBrowsable(EditorBrowsableState.Never)]
87 public virtual void OnUpdate(float elapsedSeconds)
91 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
92 [EditorBrowsable(EditorBrowsableState.Never)]
93 public virtual bool OnUpdate(FrameUpdateCallbackInterface obj, float elapsedSeconds)
95 // Let we call Versoin 0 API. To keep backward capability.
96 OnUpdate(elapsedSeconds);
100 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
101 [EditorBrowsable(EditorBrowsableState.Never)]
102 protected bool GetPosition(uint id, Vector3 position)
104 if (proxyIntPtr == IntPtr.Zero)
108 bool ret = Interop.FrameUpdateCallbackInterface.FrameCallbackInterfaceGetPosition(proxyIntPtr, id, Vector3.getCPtr(position));
109 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
113 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
114 [EditorBrowsable(EditorBrowsableState.Never)]
115 protected bool SetPosition(uint id, Vector3 position)
117 if (proxyIntPtr == IntPtr.Zero)
121 bool ret = Interop.FrameUpdateCallbackInterface.FrameCallbackInterfaceSetPosition(proxyIntPtr, id, Vector3.getCPtr(position));
122 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
126 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
127 [EditorBrowsable(EditorBrowsableState.Never)]
128 protected bool BakePosition(uint id, Vector3 position)
130 if (proxyIntPtr == IntPtr.Zero)
134 bool ret = Interop.FrameUpdateCallbackInterface.FrameCallbackInterfaceBakePosition(proxyIntPtr, id, Vector3.getCPtr(position));
135 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
139 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
140 [EditorBrowsable(EditorBrowsableState.Never)]
141 protected bool GetSize(uint id, Vector3 size)
143 if (proxyIntPtr == IntPtr.Zero)
147 bool ret = Interop.FrameUpdateCallbackInterface.FrameCallbackInterfaceGetSize(proxyIntPtr, id, Vector3.getCPtr(size));
148 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
152 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
153 [EditorBrowsable(EditorBrowsableState.Never)]
154 protected bool SetSize(uint id, Vector3 size)
156 if (proxyIntPtr == IntPtr.Zero)
160 bool ret = Interop.FrameUpdateCallbackInterface.FrameCallbackInterfaceSetSize(proxyIntPtr, id, Vector3.getCPtr(size));
161 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
165 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
166 [EditorBrowsable(EditorBrowsableState.Never)]
167 protected bool BakeSize(uint id, Vector3 size)
169 if (proxyIntPtr == IntPtr.Zero)
173 bool ret = Interop.FrameUpdateCallbackInterface.FrameCallbackInterfaceBakeSize(proxyIntPtr, id, Vector3.getCPtr(size));
174 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
178 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
179 [EditorBrowsable(EditorBrowsableState.Never)]
180 protected bool GetScale(uint id, Vector3 scale)
182 if (proxyIntPtr == IntPtr.Zero)
186 bool ret = Interop.FrameUpdateCallbackInterface.FrameCallbackInterfaceGetScale(proxyIntPtr, id, Vector3.getCPtr(scale));
187 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
191 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
192 [EditorBrowsable(EditorBrowsableState.Never)]
193 protected bool SetScale(uint id, Vector3 scale)
195 if (proxyIntPtr == IntPtr.Zero)
199 bool ret = Interop.FrameUpdateCallbackInterface.FrameCallbackInterfaceSetScale(proxyIntPtr, id, Vector3.getCPtr(scale));
200 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
204 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
205 [EditorBrowsable(EditorBrowsableState.Never)]
206 protected bool BakeScale(uint id, Vector3 scale)
208 if (proxyIntPtr == IntPtr.Zero)
212 bool ret = Interop.FrameUpdateCallbackInterface.FrameCallbackInterfaceBakeScale(proxyIntPtr, id, Vector3.getCPtr(scale));
213 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
217 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
218 [EditorBrowsable(EditorBrowsableState.Never)]
219 protected bool GetColor(uint id, Vector4 color)
221 if (proxyIntPtr == IntPtr.Zero)
225 bool ret = Interop.FrameUpdateCallbackInterface.FrameCallbackInterfaceGetColor(proxyIntPtr, id, Vector4.getCPtr(color));
226 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
230 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
231 [EditorBrowsable(EditorBrowsableState.Never)]
232 protected bool SetColor(uint id, Vector4 color)
234 if (proxyIntPtr == IntPtr.Zero)
238 bool ret = Interop.FrameUpdateCallbackInterface.FrameCallbackInterfaceSetColor(proxyIntPtr, id, Vector4.getCPtr(color));
239 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
243 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
244 [EditorBrowsable(EditorBrowsableState.Never)]
245 protected bool BakeColor(uint id, Vector4 color)
247 if (proxyIntPtr == IntPtr.Zero)
251 bool ret = Interop.FrameUpdateCallbackInterface.FrameCallbackInterfaceBakeColor(proxyIntPtr, id, Vector4.getCPtr(color));
252 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
256 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
257 [EditorBrowsable(EditorBrowsableState.Never)]
258 protected bool GetPositionAndSize(uint id, Vector3 Position, Vector3 Size)
260 if (proxyIntPtr == IntPtr.Zero)
264 bool ret = Interop.FrameUpdateCallbackInterface.FrameCallbackInterfaceGetPositionAndSize(proxyIntPtr, id, Vector3.getCPtr(Position), Vector3.getCPtr(Size));
265 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
269 internal void AddFrameUpdateCallback(global::System.Runtime.InteropServices.HandleRef windowCPtr, global::System.Runtime.InteropServices.HandleRef layerCPtr)
271 Interop.FrameUpdateCallbackInterface.FrameCallbackInterfaceAddFrameUpdateCallback(windowCPtr, SwigCPtr, layerCPtr);
274 internal void RemoveFrameUpdateCallback(global::System.Runtime.InteropServices.HandleRef windowCPtr)
276 Interop.FrameUpdateCallbackInterface.FrameCallbackInterfaceRemoveFrameUpdateCallback(windowCPtr, SwigCPtr);