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(NDalicPINVOKE.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 NDalicPINVOKE.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 public class Property : global::System.IDisposable
78 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
79 protected bool swigCMemOwn;
81 internal Property(global::System.IntPtr cPtr, bool cMemoryOwn)
83 swigCMemOwn = cMemoryOwn;
84 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
87 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj)
89 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
92 //A Flag to check who called Dispose(). (By User or DisposeQueue)
93 private bool isDisposeQueued = false;
94 //A Flat to check if it is already disposed.
95 protected bool disposed = false;
100 if (!isDisposeQueued)
102 isDisposeQueued = true;
103 DisposeQueue.Instance.Add(this);
107 public void Dispose()
109 //Throw excpetion if Dispose() is called in separate thread.
110 if (!Window.IsInstalled())
112 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
117 Dispose(DisposeTypes.Implicit);
121 Dispose(DisposeTypes.Explicit);
122 System.GC.SuppressFinalize(this);
126 protected virtual void Dispose(DisposeTypes type)
133 if (type == DisposeTypes.Explicit)
136 //Release your own managed resources here.
137 //You should release all of your own disposable objects here.
141 //Release your own unmanaged resources here.
142 //You should not access any managed member here except static instance.
143 //because the execution order of Finalizes is non-deterministic.
145 if (swigCPtr.Handle != global::System.IntPtr.Zero)
150 NDalicPINVOKE.delete_RenderTask_Property(swigCPtr);
152 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
158 public Property() : this(NDalicPINVOKE.new_RenderTask_Property(), true)
160 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
163 public static readonly int VIEWPORT_POSITION = NDalicPINVOKE.RenderTask_Property_VIEWPORT_POSITION_get();
164 public static readonly int VIEWPORT_SIZE = NDalicPINVOKE.RenderTask_Property_VIEWPORT_SIZE_get();
165 public static readonly int CLEAR_COLOR = NDalicPINVOKE.RenderTask_Property_CLEAR_COLOR_get();
166 public static readonly int REQUIRES_SYNC = NDalicPINVOKE.RenderTask_Property_REQUIRES_SYNC_get();
170 internal static SWIGTYPE_p_f_r_Dali__Vector2__bool DEFAULT_SCREEN_TO_FRAMEBUFFER_FUNCTION
174 global::System.IntPtr cPtr = NDalicPINVOKE.RenderTask_DEFAULT_SCREEN_TO_FRAMEBUFFER_FUNCTION_get();
175 SWIGTYPE_p_f_r_Dali__Vector2__bool ret = (cPtr == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_f_r_Dali__Vector2__bool(cPtr, false);
176 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
181 internal static SWIGTYPE_p_f_r_Dali__Vector2__bool FULLSCREEN_FRAMEBUFFER_FUNCTION
185 global::System.IntPtr cPtr = NDalicPINVOKE.RenderTask_FULLSCREEN_FRAMEBUFFER_FUNCTION_get();
186 SWIGTYPE_p_f_r_Dali__Vector2__bool ret = (cPtr == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_f_r_Dali__Vector2__bool(cPtr, false);
187 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
192 public static bool DEFAULT_EXCLUSIVE
196 bool ret = NDalicPINVOKE.RenderTask_DEFAULT_EXCLUSIVE_get();
197 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
202 public static bool DEFAULT_INPUT_ENABLED
206 bool ret = NDalicPINVOKE.RenderTask_DEFAULT_INPUT_ENABLED_get();
207 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
212 public static Vector4 DEFAULT_CLEAR_COLOR
216 global::System.IntPtr cPtr = NDalicPINVOKE.RenderTask_DEFAULT_CLEAR_COLOR_get();
217 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
218 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
223 public static bool DEFAULT_CLEAR_ENABLED
227 bool ret = NDalicPINVOKE.RenderTask_DEFAULT_CLEAR_ENABLED_get();
228 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
233 public static bool DEFAULT_CULL_MODE
237 bool ret = NDalicPINVOKE.RenderTask_DEFAULT_CULL_MODE_get();
238 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
243 public static uint DEFAULT_REFRESH_RATE
247 uint ret = NDalicPINVOKE.RenderTask_DEFAULT_REFRESH_RATE_get();
248 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
253 public RenderTask() : this(NDalicPINVOKE.new_RenderTask__SWIG_0(), true)
255 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
258 public static RenderTask DownCast(BaseHandle handle)
260 RenderTask ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as RenderTask;
261 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
265 public RenderTask(RenderTask handle) : this(NDalicPINVOKE.new_RenderTask__SWIG_1(RenderTask.getCPtr(handle)), true)
267 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
270 public RenderTask Assign(RenderTask rhs)
272 RenderTask ret = new RenderTask(NDalicPINVOKE.RenderTask_Assign(swigCPtr, RenderTask.getCPtr(rhs)), false);
273 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
277 public void SetSourceView(View view)
279 NDalicPINVOKE.RenderTask_SetSourceActor(swigCPtr, View.getCPtr(view));
280 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
283 public View GetSourceView()
285 View ret = new View(NDalicPINVOKE.RenderTask_GetSourceActor(swigCPtr), true);
286 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
290 public void SetExclusive(bool exclusive)
292 NDalicPINVOKE.RenderTask_SetExclusive(swigCPtr, exclusive);
293 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
296 public bool IsExclusive()
298 bool ret = NDalicPINVOKE.RenderTask_IsExclusive(swigCPtr);
299 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
303 public void SetInputEnabled(bool enabled)
305 NDalicPINVOKE.RenderTask_SetInputEnabled(swigCPtr, enabled);
306 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
309 public bool GetInputEnabled()
311 bool ret = NDalicPINVOKE.RenderTask_GetInputEnabled(swigCPtr);
312 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
316 internal void SetCamera(Camera camera)
318 NDalicPINVOKE.RenderTask_SetCameraActor(swigCPtr, Camera.getCPtr(camera));
319 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
322 internal Camera GetCamera()
324 Camera ret = new Camera(NDalicPINVOKE.RenderTask_GetCameraActor(swigCPtr), true);
325 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
329 public void SetTargetFrameBuffer(FrameBufferImage frameBuffer)
331 NDalicPINVOKE.RenderTask_SetTargetFrameBuffer(swigCPtr, FrameBufferImage.getCPtr(frameBuffer));
332 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
335 public FrameBufferImage GetTargetFrameBuffer()
337 FrameBufferImage ret = new FrameBufferImage(NDalicPINVOKE.RenderTask_GetTargetFrameBuffer(swigCPtr), true);
338 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
342 public void SetFrameBuffer(FrameBuffer frameBuffer)
344 NDalicPINVOKE.RenderTask_SetFrameBuffer(swigCPtr, FrameBuffer.getCPtr(frameBuffer));
345 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
348 public FrameBuffer GetFrameBuffer()
350 FrameBuffer ret = new FrameBuffer(NDalicPINVOKE.RenderTask_GetFrameBuffer(swigCPtr), true);
351 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
355 internal void SetScreenToFrameBufferFunction(SWIGTYPE_p_f_r_Dali__Vector2__bool conversionFunction)
357 NDalicPINVOKE.RenderTask_SetScreenToFrameBufferFunction(swigCPtr, SWIGTYPE_p_f_r_Dali__Vector2__bool.getCPtr(conversionFunction));
358 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
361 internal SWIGTYPE_p_f_r_Dali__Vector2__bool GetScreenToFrameBufferFunction()
363 global::System.IntPtr cPtr = NDalicPINVOKE.RenderTask_GetScreenToFrameBufferFunction(swigCPtr);
364 SWIGTYPE_p_f_r_Dali__Vector2__bool ret = (cPtr == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_f_r_Dali__Vector2__bool(cPtr, false);
365 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
369 public void SetScreenToFrameBufferMappingView(View mappingView)
371 NDalicPINVOKE.RenderTask_SetScreenToFrameBufferMappingActor(swigCPtr, View.getCPtr(mappingView));
372 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
375 public View GetScreenToFrameBufferMappingView()
377 View ret = new View(NDalicPINVOKE.RenderTask_GetScreenToFrameBufferMappingActor(swigCPtr), true);
378 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
382 public void SetViewportPosition(Vector2 position)
384 NDalicPINVOKE.RenderTask_SetViewportPosition(swigCPtr, Vector2.getCPtr(position));
385 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
388 public Vector2 GetCurrentViewportPosition()
390 Vector2 ret = new Vector2(NDalicPINVOKE.RenderTask_GetCurrentViewportPosition(swigCPtr), true);
391 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
395 public void SetViewportSize(Vector2 size)
397 NDalicPINVOKE.RenderTask_SetViewportSize(swigCPtr, Vector2.getCPtr(size));
398 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
401 public Vector2 GetCurrentViewportSize()
403 Vector2 ret = new Vector2(NDalicPINVOKE.RenderTask_GetCurrentViewportSize(swigCPtr), true);
404 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
408 public void SetViewport(Rectangle viewport)
410 NDalicPINVOKE.RenderTask_SetViewport(swigCPtr, Rectangle.getCPtr(viewport));
411 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
414 public Rectangle GetViewport()
416 Rectangle ret = new Rectangle(NDalicPINVOKE.RenderTask_GetViewport(swigCPtr), true);
417 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
421 public void SetClearColor(Vector4 color)
423 NDalicPINVOKE.RenderTask_SetClearColor(swigCPtr, Vector4.getCPtr(color));
424 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
427 public Vector4 GetClearColor()
429 Vector4 ret = new Vector4(NDalicPINVOKE.RenderTask_GetClearColor(swigCPtr), true);
430 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
434 public void SetClearEnabled(bool enabled)
436 NDalicPINVOKE.RenderTask_SetClearEnabled(swigCPtr, enabled);
437 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
440 public bool GetClearEnabled()
442 bool ret = NDalicPINVOKE.RenderTask_GetClearEnabled(swigCPtr);
443 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
447 public void SetCullMode(bool cullMode)
449 NDalicPINVOKE.RenderTask_SetCullMode(swigCPtr, cullMode);
450 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
453 public bool GetCullMode()
455 bool ret = NDalicPINVOKE.RenderTask_GetCullMode(swigCPtr);
456 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
460 public void SetRefreshRate(uint refreshRate)
462 NDalicPINVOKE.RenderTask_SetRefreshRate(swigCPtr, refreshRate);
463 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
466 public uint GetRefreshRate()
468 uint ret = NDalicPINVOKE.RenderTask_GetRefreshRate(swigCPtr);
469 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
473 public bool WorldToViewport(Vector3 position, out float viewportX, out float viewportY)
475 bool ret = NDalicPINVOKE.RenderTask_WorldToViewport(swigCPtr, Vector3.getCPtr(position), out viewportX, out viewportY);
476 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
480 public bool ViewportToLocal(View view, float viewportX, float viewportY, out float localX, out float localY)
482 bool ret = NDalicPINVOKE.RenderTask_ViewportToLocal(swigCPtr, View.getCPtr(view), viewportX, viewportY, out localX, out localY);
483 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
487 internal RenderTaskSignal FinishedSignal()
489 RenderTaskSignal ret = new RenderTaskSignal(NDalicPINVOKE.RenderTask_FinishedSignal(swigCPtr), false);
490 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
494 public enum RefreshRate
500 public Vector2 ViewportPosition
504 Vector2 temp = new Vector2(0.0f, 0.0f);
505 GetProperty(RenderTask.Property.VIEWPORT_POSITION).Get(temp);
510 SetProperty(RenderTask.Property.VIEWPORT_POSITION, new Tizen.NUI.PropertyValue(value));
513 public Vector2 ViewportSize
517 Vector2 temp = new Vector2(0.0f, 0.0f);
518 GetProperty(RenderTask.Property.VIEWPORT_SIZE).Get(temp);
523 SetProperty(RenderTask.Property.VIEWPORT_SIZE, new Tizen.NUI.PropertyValue(value));
526 public Vector4 ClearColor
530 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
531 GetProperty(RenderTask.Property.CLEAR_COLOR).Get(temp);
536 SetProperty(RenderTask.Property.CLEAR_COLOR, new Tizen.NUI.PropertyValue(value));
539 public bool RequiresSync
544 GetProperty(RenderTask.Property.REQUIRES_SYNC).Get(out temp);
549 SetProperty(RenderTask.Property.REQUIRES_SYNC, new Tizen.NUI.PropertyValue(value));