2 * Copyright(c) 2017 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.
20 using Tizen.NUI.BaseComponents;
21 internal class RenderTask : Animatable
23 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
25 internal RenderTask(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.RenderTask.RenderTask_SWIGUpcast(cPtr), cMemoryOwn)
27 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
30 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(RenderTask obj)
32 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
35 protected override void Dispose(DisposeTypes type)
42 if (type == DisposeTypes.Explicit)
45 //Release your own managed resources here.
46 //You should release all of your own disposable objects here.
50 //Release your own unmanaged resources here.
51 //You should not access any managed member here except static instance.
52 //because the execution order of Finalizes is non-deterministic.
55 if (swigCPtr.Handle != global::System.IntPtr.Zero)
60 Interop.RenderTask.delete_RenderTask(swigCPtr);
62 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
69 public static RenderTask GetRenderTaskFromPtr(global::System.IntPtr cPtr)
71 RenderTask ret = new RenderTask(cPtr, false);
72 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
76 /// <since_tizen> 3 </since_tizen>
77 public class Property : global::System.IDisposable
79 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
80 /// <since_tizen> 3 </since_tizen>
81 protected bool swigCMemOwn;
83 internal Property(global::System.IntPtr cPtr, bool cMemoryOwn)
85 swigCMemOwn = cMemoryOwn;
86 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
89 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj)
91 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
94 //A Flag to check who called Dispose(). (By User or DisposeQueue)
95 private bool isDisposeQueued = false;
96 //A Flat to check if it is already disposed.
97 /// <since_tizen> 3 </since_tizen>
98 protected bool disposed = false;
103 if (!isDisposeQueued)
105 isDisposeQueued = true;
106 DisposeQueue.Instance.Add(this);
110 /// <since_tizen> 3 </since_tizen>
111 public void Dispose()
113 //Throw excpetion if Dispose() is called in separate thread.
114 if (!Window.IsInstalled())
116 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
121 Dispose(DisposeTypes.Implicit);
125 Dispose(DisposeTypes.Explicit);
126 System.GC.SuppressFinalize(this);
130 /// <since_tizen> 3 </since_tizen>
131 protected virtual void Dispose(DisposeTypes type)
138 if (type == DisposeTypes.Explicit)
141 //Release your own managed resources here.
142 //You should release all of your own disposable objects here.
146 //Release your own unmanaged resources here.
147 //You should not access any managed member here except static instance.
148 //because the execution order of Finalizes is non-deterministic.
150 if (swigCPtr.Handle != global::System.IntPtr.Zero)
155 Interop.RenderTask.delete_RenderTask_Property(swigCPtr);
157 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
163 /// <since_tizen> 3 </since_tizen>
164 public Property() : this(Interop.RenderTask.new_RenderTask_Property(), true)
166 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
169 /// <since_tizen> 3 </since_tizen>
170 public static readonly int VIEWPORT_POSITION = Interop.RenderTask.RenderTask_Property_VIEWPORT_POSITION_get();
171 /// <since_tizen> 3 </since_tizen>
172 public static readonly int VIEWPORT_SIZE = Interop.RenderTask.RenderTask_Property_VIEWPORT_SIZE_get();
173 /// <since_tizen> 3 </since_tizen>
174 public static readonly int CLEAR_COLOR = Interop.RenderTask.RenderTask_Property_CLEAR_COLOR_get();
175 /// <since_tizen> 3 </since_tizen>
176 public static readonly int REQUIRES_SYNC = Interop.RenderTask.RenderTask_Property_REQUIRES_SYNC_get();
180 internal static SWIGTYPE_p_f_r_Dali__Vector2__bool DEFAULT_SCREEN_TO_FRAMEBUFFER_FUNCTION
184 global::System.IntPtr cPtr = Interop.RenderTask.RenderTask_DEFAULT_SCREEN_TO_FRAMEBUFFER_FUNCTION_get();
185 SWIGTYPE_p_f_r_Dali__Vector2__bool ret = (cPtr == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_f_r_Dali__Vector2__bool(cPtr, false);
186 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
191 internal static SWIGTYPE_p_f_r_Dali__Vector2__bool FULLSCREEN_FRAMEBUFFER_FUNCTION
195 global::System.IntPtr cPtr = Interop.RenderTask.RenderTask_FULLSCREEN_FRAMEBUFFER_FUNCTION_get();
196 SWIGTYPE_p_f_r_Dali__Vector2__bool ret = (cPtr == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_f_r_Dali__Vector2__bool(cPtr, false);
197 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
202 public static bool DEFAULT_EXCLUSIVE
206 bool ret = Interop.RenderTask.RenderTask_DEFAULT_EXCLUSIVE_get();
207 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
212 public static bool DEFAULT_INPUT_ENABLED
216 bool ret = Interop.RenderTask.RenderTask_DEFAULT_INPUT_ENABLED_get();
217 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
222 public static Vector4 DEFAULT_CLEAR_COLOR
226 global::System.IntPtr cPtr = Interop.RenderTask.RenderTask_DEFAULT_CLEAR_COLOR_get();
227 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
228 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
233 public static bool DEFAULT_CLEAR_ENABLED
237 bool ret = Interop.RenderTask.RenderTask_DEFAULT_CLEAR_ENABLED_get();
238 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
243 public static bool DEFAULT_CULL_MODE
247 bool ret = Interop.RenderTask.RenderTask_DEFAULT_CULL_MODE_get();
248 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
253 public static uint DEFAULT_REFRESH_RATE
257 uint ret = Interop.RenderTask.RenderTask_DEFAULT_REFRESH_RATE_get();
258 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
263 public RenderTask() : this(Interop.RenderTask.new_RenderTask__SWIG_0(), true)
265 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
268 public static RenderTask DownCast(BaseHandle handle)
270 RenderTask ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as RenderTask;
271 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
275 public RenderTask(RenderTask handle) : this(Interop.RenderTask.new_RenderTask__SWIG_1(RenderTask.getCPtr(handle)), true)
277 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
280 public RenderTask Assign(RenderTask rhs)
282 RenderTask ret = new RenderTask(Interop.RenderTask.RenderTask_Assign(swigCPtr, RenderTask.getCPtr(rhs)), false);
283 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
287 public void SetSourceView(View view)
289 Interop.RenderTask.RenderTask_SetSourceActor(swigCPtr, View.getCPtr(view));
290 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
293 public View GetSourceView()
295 View ret = new View(Interop.RenderTask.RenderTask_GetSourceActor(swigCPtr), true);
296 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
300 public void SetExclusive(bool exclusive)
302 Interop.RenderTask.RenderTask_SetExclusive(swigCPtr, exclusive);
303 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
306 public bool IsExclusive()
308 bool ret = Interop.RenderTask.RenderTask_IsExclusive(swigCPtr);
309 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
313 public void SetInputEnabled(bool enabled)
315 Interop.RenderTask.RenderTask_SetInputEnabled(swigCPtr, enabled);
316 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
319 public bool GetInputEnabled()
321 bool ret = Interop.RenderTask.RenderTask_GetInputEnabled(swigCPtr);
322 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
326 internal void SetCamera(Camera camera)
328 Interop.RenderTask.RenderTask_SetCameraActor(swigCPtr, Camera.getCPtr(camera));
329 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
332 internal Camera GetCamera()
334 Camera ret = new Camera(Interop.RenderTask.RenderTask_GetCameraActor(swigCPtr), true);
335 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
339 public void SetTargetFrameBuffer(FrameBufferImage frameBuffer)
341 Interop.RenderTask.RenderTask_SetTargetFrameBuffer(swigCPtr, FrameBufferImage.getCPtr(frameBuffer));
342 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
345 public FrameBufferImage GetTargetFrameBuffer()
347 FrameBufferImage ret = new FrameBufferImage(Interop.RenderTask.RenderTask_GetTargetFrameBuffer(swigCPtr), true);
348 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
352 public void SetFrameBuffer(FrameBuffer frameBuffer)
354 Interop.RenderTask.RenderTask_SetFrameBuffer(swigCPtr, FrameBuffer.getCPtr(frameBuffer));
355 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
358 public FrameBuffer GetFrameBuffer()
360 FrameBuffer ret = new FrameBuffer(Interop.RenderTask.RenderTask_GetFrameBuffer(swigCPtr), true);
361 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
365 internal void SetScreenToFrameBufferFunction(SWIGTYPE_p_f_r_Dali__Vector2__bool conversionFunction)
367 Interop.RenderTask.RenderTask_SetScreenToFrameBufferFunction(swigCPtr, SWIGTYPE_p_f_r_Dali__Vector2__bool.getCPtr(conversionFunction));
368 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
371 internal SWIGTYPE_p_f_r_Dali__Vector2__bool GetScreenToFrameBufferFunction()
373 global::System.IntPtr cPtr = Interop.RenderTask.RenderTask_GetScreenToFrameBufferFunction(swigCPtr);
374 SWIGTYPE_p_f_r_Dali__Vector2__bool ret = (cPtr == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_f_r_Dali__Vector2__bool(cPtr, false);
375 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
379 public void SetScreenToFrameBufferMappingView(View mappingView)
381 Interop.RenderTask.RenderTask_SetScreenToFrameBufferMappingActor(swigCPtr, View.getCPtr(mappingView));
382 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
385 public View GetScreenToFrameBufferMappingView()
387 View ret = new View(Interop.RenderTask.RenderTask_GetScreenToFrameBufferMappingActor(swigCPtr), true);
388 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
392 public void SetViewportPosition(Vector2 position)
394 Interop.RenderTask.RenderTask_SetViewportPosition(swigCPtr, Vector2.getCPtr(position));
395 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
398 public Vector2 GetCurrentViewportPosition()
400 Vector2 ret = new Vector2(Interop.RenderTask.RenderTask_GetCurrentViewportPosition(swigCPtr), true);
401 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
405 public void SetViewportSize(Vector2 size)
407 Interop.RenderTask.RenderTask_SetViewportSize(swigCPtr, Vector2.getCPtr(size));
408 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
411 public Vector2 GetCurrentViewportSize()
413 Vector2 ret = new Vector2(Interop.RenderTask.RenderTask_GetCurrentViewportSize(swigCPtr), true);
414 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
418 public void SetViewport(Rectangle viewport)
420 Interop.RenderTask.RenderTask_SetViewport(swigCPtr, Rectangle.getCPtr(viewport));
421 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
424 public Rectangle GetViewport()
426 Rectangle ret = new Rectangle(Interop.RenderTask.RenderTask_GetViewport(swigCPtr), true);
427 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
431 public void SetClearColor(Vector4 color)
433 Interop.RenderTask.RenderTask_SetClearColor(swigCPtr, Vector4.getCPtr(color));
434 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
437 public Vector4 GetClearColor()
439 Vector4 ret = new Vector4(Interop.RenderTask.RenderTask_GetClearColor(swigCPtr), true);
440 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
444 public void SetClearEnabled(bool enabled)
446 Interop.RenderTask.RenderTask_SetClearEnabled(swigCPtr, enabled);
447 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
450 public bool GetClearEnabled()
452 bool ret = Interop.RenderTask.RenderTask_GetClearEnabled(swigCPtr);
453 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
457 public void SetCullMode(bool cullMode)
459 Interop.RenderTask.RenderTask_SetCullMode(swigCPtr, cullMode);
460 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
463 public bool GetCullMode()
465 bool ret = Interop.RenderTask.RenderTask_GetCullMode(swigCPtr);
466 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
470 public void SetRefreshRate(uint refreshRate)
472 Interop.RenderTask.RenderTask_SetRefreshRate(swigCPtr, refreshRate);
473 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
476 public uint GetRefreshRate()
478 uint ret = Interop.RenderTask.RenderTask_GetRefreshRate(swigCPtr);
479 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
483 public bool WorldToViewport(Vector3 position, out float viewportX, out float viewportY)
485 bool ret = Interop.RenderTask.RenderTask_WorldToViewport(swigCPtr, Vector3.getCPtr(position), out viewportX, out viewportY);
486 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
490 public bool ViewportToLocal(View view, float viewportX, float viewportY, out float localX, out float localY)
492 bool ret = Interop.RenderTask.RenderTask_ViewportToLocal(swigCPtr, View.getCPtr(view), viewportX, viewportY, out localX, out localY);
493 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
497 internal RenderTaskSignal FinishedSignal()
499 RenderTaskSignal ret = new RenderTaskSignal(Interop.RenderTask.RenderTask_FinishedSignal(swigCPtr), false);
500 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
504 /// <since_tizen> 3 </since_tizen>
505 public enum RefreshRate
511 public Vector2 ViewportPosition
515 Vector2 temp = new Vector2(0.0f, 0.0f);
516 GetProperty(RenderTask.Property.VIEWPORT_POSITION).Get(temp);
521 SetProperty(RenderTask.Property.VIEWPORT_POSITION, new Tizen.NUI.PropertyValue(value));
524 public Vector2 ViewportSize
528 Vector2 temp = new Vector2(0.0f, 0.0f);
529 GetProperty(RenderTask.Property.VIEWPORT_SIZE).Get(temp);
534 SetProperty(RenderTask.Property.VIEWPORT_SIZE, new Tizen.NUI.PropertyValue(value));
537 public Vector4 ClearColor
541 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
542 GetProperty(RenderTask.Property.CLEAR_COLOR).Get(temp);
547 SetProperty(RenderTask.Property.CLEAR_COLOR, new Tizen.NUI.PropertyValue(value));
550 public bool RequiresSync
555 GetProperty(RenderTask.Property.REQUIRES_SYNC).Get(out temp);
560 SetProperty(RenderTask.Property.REQUIRES_SYNC, new Tizen.NUI.PropertyValue(value));