From 8b0f4f799e0e6fd468c36bc5d70165ad2131fabc Mon Sep 17 00:00:00 2001 From: Umar Date: Thu, 8 Jun 2017 18:31:07 +0100 Subject: [PATCH] Making Renderer and related classes public Change-Id: I166212ca138810c412efdae00ae7ca328e7064b3 --- src/Tizen.NUI/src/internal/Shader.cs | 307 --------------------- .../src/{internal => public}/FilterModeType.cs | 3 +- src/Tizen.NUI/src/{internal => public}/Geometry.cs | 15 +- .../src/{internal => public}/PixelData.cs | 2 +- .../src/{internal => public}/PixelFormat.cs | 3 +- .../src/{internal => public}/PropertyBuffer.cs | 15 +- src/Tizen.NUI/src/{internal => public}/Renderer.cs | 102 +------ src/Tizen.NUI/src/{internal => public}/Sampler.cs | 15 +- src/Tizen.NUI/src/public/Shader.cs | 125 +++++++++ src/Tizen.NUI/src/{internal => public}/Texture.cs | 17 +- .../src/{internal => public}/TextureSet.cs | 15 +- .../src/{internal => public}/TextureType.cs | 3 +- 12 files changed, 143 insertions(+), 479 deletions(-) delete mode 100755 src/Tizen.NUI/src/internal/Shader.cs rename src/Tizen.NUI/src/{internal => public}/FilterModeType.cs (94%) rename src/Tizen.NUI/src/{internal => public}/Geometry.cs (88%) rename src/Tizen.NUI/src/{internal => public}/PixelData.cs (98%) rename src/Tizen.NUI/src/{internal => public}/PixelFormat.cs (98%) rename src/Tizen.NUI/src/{internal => public}/PropertyBuffer.cs (83%) rename src/Tizen.NUI/src/{internal => public}/Renderer.cs (83%) rename src/Tizen.NUI/src/{internal => public}/Sampler.cs (86%) create mode 100755 src/Tizen.NUI/src/public/Shader.cs rename src/Tizen.NUI/src/{internal => public}/Texture.cs (86%) rename src/Tizen.NUI/src/{internal => public}/TextureSet.cs (87%) rename src/Tizen.NUI/src/{internal => public}/TextureType.cs (93%) diff --git a/src/Tizen.NUI/src/internal/Shader.cs b/src/Tizen.NUI/src/internal/Shader.cs deleted file mode 100755 index 2bb4dd6..0000000 --- a/src/Tizen.NUI/src/internal/Shader.cs +++ /dev/null @@ -1,307 +0,0 @@ -/** Copyright (c) 2017 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. -* -*/ -// This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts -//------------------------------------------------------------------------------ -// -// -// This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.9 -// -// Do not make changes to this file unless you know what you are doing--modify -// the SWIG interface file instead. -//------------------------------------------------------------------------------ - -namespace Tizen.NUI -{ - - internal class Shader : Animatable - { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - - internal Shader(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Shader_SWIGUpcast(cPtr), cMemoryOwn) - { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Shader obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - protected override void Dispose(DisposeTypes type) - { - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_Shader(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - base.Dispose(type); - } - - - public class Hint : global::System.IDisposable - { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - protected bool swigCMemOwn; - - internal Hint(global::System.IntPtr cPtr, bool cMemoryOwn) - { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Hint obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - //A Flag to check who called Dispose(). (By User or DisposeQueue) - private bool isDisposeQueued = false; - //A Flat to check if it is already disposed. - protected bool disposed = false; - - ~Hint() - { - if (!isDisposeQueued) - { - isDisposeQueued = true; - DisposeQueue.Instance.Add(this); - } - } - - public void Dispose() - { - //Throw excpetion if Dispose() is called in separate thread. - if (!Window.IsInstalled()) - { - throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); - } - - if (isDisposeQueued) - { - Dispose(DisposeTypes.Implicit); - } - else - { - Dispose(DisposeTypes.Explicit); - System.GC.SuppressFinalize(this); - } - } - - protected virtual void Dispose(DisposeTypes type) - { - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_Shader_Hint(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - disposed = true; - } - - public Hint() : this(NDalicPINVOKE.new_Shader_Hint(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - public enum Value - { - NONE = 0x00, - OUTPUT_IS_TRANSPARENT = 0x01, - MODIFIES_GEOMETRY = 0x02 - } - - } - - public class Property : global::System.IDisposable - { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - protected bool swigCMemOwn; - - internal Property(global::System.IntPtr cPtr, bool cMemoryOwn) - { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - //A Flag to check who called Dispose(). (By User or DisposeQueue) - private bool isDisposeQueued = false; - //A Flat to check if it is already disposed. - protected bool disposed = false; - - ~Property() - { - if (!isDisposeQueued) - { - isDisposeQueued = true; - DisposeQueue.Instance.Add(this); - } - } - - public void Dispose() - { - //Throw excpetion if Dispose() is called in separate thread. - if (!Window.IsInstalled()) - { - throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); - } - - if (isDisposeQueued) - { - Dispose(DisposeTypes.Implicit); - } - else - { - Dispose(DisposeTypes.Explicit); - System.GC.SuppressFinalize(this); - } - } - - protected virtual void Dispose(DisposeTypes type) - { - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_Shader_Property(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - disposed = true; - } - - public Property() : this(NDalicPINVOKE.new_Shader_Property(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - public static readonly int PROGRAM = NDalicPINVOKE.Shader_Property_PROGRAM_get(); - - } - - public Shader(string vertexShader, string fragmentShader, Shader.Hint.Value hints) : this(NDalicPINVOKE.Shader_New__SWIG_0(vertexShader, fragmentShader, (int)hints), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - - } - public Shader(string vertexShader, string fragmentShader) : this(NDalicPINVOKE.Shader_New__SWIG_1(vertexShader, fragmentShader), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - - } - public Shader(Shader handle) : this(NDalicPINVOKE.new_Shader__SWIG_1(Shader.getCPtr(handle)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - public new static Shader DownCast(BaseHandle handle) - { - Shader ret = new Shader(NDalicPINVOKE.Shader_DownCast(BaseHandle.getCPtr(handle)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - public Shader Assign(Shader handle) - { - Shader ret = new Shader(NDalicPINVOKE.Shader_Assign(swigCPtr, Shader.getCPtr(handle)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - public Tizen.NUI.PropertyMap Program - { - get - { - Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap(); - Tizen.NUI.Object.GetProperty(swigCPtr, Shader.Property.PROGRAM).Get(temp); - return temp; - } - set - { - Tizen.NUI.Object.SetProperty(swigCPtr, Shader.Property.PROGRAM, new Tizen.NUI.PropertyValue(value)); - } - } - - } - -} diff --git a/src/Tizen.NUI/src/internal/FilterModeType.cs b/src/Tizen.NUI/src/public/FilterModeType.cs similarity index 94% rename from src/Tizen.NUI/src/internal/FilterModeType.cs rename to src/Tizen.NUI/src/public/FilterModeType.cs index 5401232..8d2366b 100755 --- a/src/Tizen.NUI/src/internal/FilterModeType.cs +++ b/src/Tizen.NUI/src/public/FilterModeType.cs @@ -10,8 +10,7 @@ namespace Tizen.NUI { - - internal enum FilterModeType + public enum FilterModeType { NONE = 0, DEFAULT, diff --git a/src/Tizen.NUI/src/internal/Geometry.cs b/src/Tizen.NUI/src/public/Geometry.cs similarity index 88% rename from src/Tizen.NUI/src/internal/Geometry.cs rename to src/Tizen.NUI/src/public/Geometry.cs index f070d1c..a4430b5 100755 --- a/src/Tizen.NUI/src/internal/Geometry.cs +++ b/src/Tizen.NUI/src/public/Geometry.cs @@ -27,7 +27,7 @@ namespace Tizen.NUI { - internal class Geometry : BaseHandle + public class Geometry : BaseHandle { private global::System.Runtime.InteropServices.HandleRef swigCPtr; @@ -78,25 +78,14 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - public Geometry(Geometry handle) : this(NDalicPINVOKE.new_Geometry__SWIG_1(Geometry.getCPtr(handle)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - public static Geometry DownCast(BaseHandle handle) + internal static Geometry DownCast(BaseHandle handle) { Geometry ret = new Geometry(NDalicPINVOKE.Geometry_DownCast(BaseHandle.getCPtr(handle)), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } - public Geometry Assign(Geometry handle) - { - Geometry ret = new Geometry(NDalicPINVOKE.Geometry_Assign(swigCPtr, Geometry.getCPtr(handle)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - public uint AddVertexBuffer(PropertyBuffer vertexBuffer) { uint ret = NDalicPINVOKE.Geometry_AddVertexBuffer(swigCPtr, PropertyBuffer.getCPtr(vertexBuffer)); diff --git a/src/Tizen.NUI/src/internal/PixelData.cs b/src/Tizen.NUI/src/public/PixelData.cs similarity index 98% rename from src/Tizen.NUI/src/internal/PixelData.cs rename to src/Tizen.NUI/src/public/PixelData.cs index 3f373ca..7b40ee3 100755 --- a/src/Tizen.NUI/src/internal/PixelData.cs +++ b/src/Tizen.NUI/src/public/PixelData.cs @@ -27,7 +27,7 @@ namespace Tizen.NUI { - internal class PixelData : BaseHandle + public class PixelData : BaseHandle { private global::System.Runtime.InteropServices.HandleRef swigCPtr; diff --git a/src/Tizen.NUI/src/internal/PixelFormat.cs b/src/Tizen.NUI/src/public/PixelFormat.cs similarity index 98% rename from src/Tizen.NUI/src/internal/PixelFormat.cs rename to src/Tizen.NUI/src/public/PixelFormat.cs index 6b5b01f..6b94ca9 100755 --- a/src/Tizen.NUI/src/internal/PixelFormat.cs +++ b/src/Tizen.NUI/src/public/PixelFormat.cs @@ -10,8 +10,7 @@ namespace Tizen.NUI { - - internal enum PixelFormat + public enum PixelFormat { INVALID = 0, A8 = 1, diff --git a/src/Tizen.NUI/src/internal/PropertyBuffer.cs b/src/Tizen.NUI/src/public/PropertyBuffer.cs similarity index 83% rename from src/Tizen.NUI/src/internal/PropertyBuffer.cs rename to src/Tizen.NUI/src/public/PropertyBuffer.cs index 4038fa7..b661796 100755 --- a/src/Tizen.NUI/src/internal/PropertyBuffer.cs +++ b/src/Tizen.NUI/src/public/PropertyBuffer.cs @@ -27,7 +27,7 @@ namespace Tizen.NUI { - internal class PropertyBuffer : BaseHandle + public class PropertyBuffer : BaseHandle { private global::System.Runtime.InteropServices.HandleRef swigCPtr; @@ -79,25 +79,14 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - public PropertyBuffer(PropertyBuffer handle) : this(NDalicPINVOKE.new_PropertyBuffer__SWIG_1(PropertyBuffer.getCPtr(handle)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - public static PropertyBuffer DownCast(BaseHandle handle) + internal static PropertyBuffer DownCast(BaseHandle handle) { PropertyBuffer ret = new PropertyBuffer(NDalicPINVOKE.PropertyBuffer_DownCast(BaseHandle.getCPtr(handle)), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } - public PropertyBuffer Assign(PropertyBuffer handle) - { - PropertyBuffer ret = new PropertyBuffer(NDalicPINVOKE.PropertyBuffer_Assign(swigCPtr, PropertyBuffer.getCPtr(handle)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - public void SetData(System.IntPtr data, uint size) { NDalicPINVOKE.PropertyBuffer_SetData(swigCPtr, data, size); diff --git a/src/Tizen.NUI/src/internal/Renderer.cs b/src/Tizen.NUI/src/public/Renderer.cs similarity index 83% rename from src/Tizen.NUI/src/internal/Renderer.cs rename to src/Tizen.NUI/src/public/Renderer.cs index 0ea27a9..6535767 100755 --- a/src/Tizen.NUI/src/internal/Renderer.cs +++ b/src/Tizen.NUI/src/public/Renderer.cs @@ -27,7 +27,7 @@ namespace Tizen.NUI { - internal class Renderer : Animatable + public class Renderer : Animatable { private global::System.Runtime.InteropServices.HandleRef swigCPtr; @@ -74,93 +74,8 @@ namespace Tizen.NUI base.Dispose(type); } - public class Property : global::System.IDisposable + public class Property { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - protected bool swigCMemOwn; - - internal Property(global::System.IntPtr cPtr, bool cMemoryOwn) - { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - //A Flag to check who called Dispose(). (By User or DisposeQueue) - private bool isDisposeQueued = false; - //A Flat to check if it is already disposed. - protected bool disposed = false; - - - ~Property() - { - if (!isDisposeQueued) - { - isDisposeQueued = true; - DisposeQueue.Instance.Add(this); - } - } - - public void Dispose() - { - //Throw excpetion if Dispose() is called in separate thread. - if (!Window.IsInstalled()) - { - throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); - } - - if (isDisposeQueued) - { - Dispose(DisposeTypes.Implicit); - } - else - { - Dispose(DisposeTypes.Explicit); - System.GC.SuppressFinalize(this); - } - } - - protected virtual void Dispose(DisposeTypes type) - { - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_Renderer_Property(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - disposed = true; - } - - public Property() : this(NDalicPINVOKE.new_Renderer_Property(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - public static readonly int DEPTH_INDEX = NDalicPINVOKE.Renderer_Property_DEPTH_INDEX_get(); public static readonly int FACE_CULLING_MODE = NDalicPINVOKE.Renderer_Property_FACE_CULLING_MODE_get(); public static readonly int BLEND_MODE = NDalicPINVOKE.Renderer_Property_BLEND_MODE_get(); @@ -193,25 +108,14 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - public Renderer(Renderer handle) : this(NDalicPINVOKE.new_Renderer__SWIG_1(Renderer.getCPtr(handle)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - public new static Renderer DownCast(BaseHandle handle) + internal new static Renderer DownCast(BaseHandle handle) { Renderer ret = new Renderer(NDalicPINVOKE.Renderer_DownCast(BaseHandle.getCPtr(handle)), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } - public Renderer Assign(Renderer handle) - { - Renderer ret = new Renderer(NDalicPINVOKE.Renderer_Assign(swigCPtr, Renderer.getCPtr(handle)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - public void SetGeometry(Geometry geometry) { NDalicPINVOKE.Renderer_SetGeometry(swigCPtr, Geometry.getCPtr(geometry)); diff --git a/src/Tizen.NUI/src/internal/Sampler.cs b/src/Tizen.NUI/src/public/Sampler.cs similarity index 86% rename from src/Tizen.NUI/src/internal/Sampler.cs rename to src/Tizen.NUI/src/public/Sampler.cs index a44de08..2a5bfb2 100755 --- a/src/Tizen.NUI/src/internal/Sampler.cs +++ b/src/Tizen.NUI/src/public/Sampler.cs @@ -27,7 +27,7 @@ namespace Tizen.NUI { - internal class Sampler : BaseHandle + public class Sampler : BaseHandle { private global::System.Runtime.InteropServices.HandleRef swigCPtr; @@ -80,25 +80,14 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - public Sampler(Sampler handle) : this(NDalicPINVOKE.new_Sampler__SWIG_1(Sampler.getCPtr(handle)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - public static Sampler DownCast(BaseHandle handle) + internal static Sampler DownCast(BaseHandle handle) { Sampler ret = new Sampler(NDalicPINVOKE.Sampler_DownCast(BaseHandle.getCPtr(handle)), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } - public Sampler Assign(Sampler handle) - { - Sampler ret = new Sampler(NDalicPINVOKE.Sampler_Assign(swigCPtr, Sampler.getCPtr(handle)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - public void SetFilterMode(FilterModeType minFilter, FilterModeType magFilter) { NDalicPINVOKE.Sampler_SetFilterMode(swigCPtr, (int)minFilter, (int)magFilter); diff --git a/src/Tizen.NUI/src/public/Shader.cs b/src/Tizen.NUI/src/public/Shader.cs new file mode 100755 index 0000000..aaccc8c --- /dev/null +++ b/src/Tizen.NUI/src/public/Shader.cs @@ -0,0 +1,125 @@ +/** Copyright (c) 2017 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. +* +*/ +// This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts +//------------------------------------------------------------------------------ +// +// +// This file was automatically generated by SWIG (http://www.swig.org). +// Version 3.0.9 +// +// Do not make changes to this file unless you know what you are doing--modify +// the SWIG interface file instead. +//------------------------------------------------------------------------------ + +namespace Tizen.NUI +{ + + public class Shader : Animatable + { + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + + internal Shader(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Shader_SWIGUpcast(cPtr), cMemoryOwn) + { + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Shader obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + protected override void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_Shader(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + base.Dispose(type); + } + + + public class Hint + { + public enum Value + { + NONE = 0x00, + OUTPUT_IS_TRANSPARENT = 0x01, + MODIFIES_GEOMETRY = 0x02 + } + } + + public class Property + { + public static readonly int PROGRAM = NDalicPINVOKE.Shader_Property_PROGRAM_get(); + } + + public Shader(string vertexShader, string fragmentShader, Shader.Hint.Value hints) : this(NDalicPINVOKE.Shader_New__SWIG_0(vertexShader, fragmentShader, (int)hints), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + } + public Shader(string vertexShader, string fragmentShader) : this(NDalicPINVOKE.Shader_New__SWIG_1(vertexShader, fragmentShader), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + } + + internal new static Shader DownCast(BaseHandle handle) + { + Shader ret = new Shader(NDalicPINVOKE.Shader_DownCast(BaseHandle.getCPtr(handle)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + public Tizen.NUI.PropertyMap Program + { + get + { + Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap(); + Tizen.NUI.Object.GetProperty(swigCPtr, Shader.Property.PROGRAM).Get(temp); + return temp; + } + set + { + Tizen.NUI.Object.SetProperty(swigCPtr, Shader.Property.PROGRAM, new Tizen.NUI.PropertyValue(value)); + } + } + } + +} diff --git a/src/Tizen.NUI/src/internal/Texture.cs b/src/Tizen.NUI/src/public/Texture.cs similarity index 86% rename from src/Tizen.NUI/src/internal/Texture.cs rename to src/Tizen.NUI/src/public/Texture.cs index 11c1292..7c857a3 100755 --- a/src/Tizen.NUI/src/internal/Texture.cs +++ b/src/Tizen.NUI/src/public/Texture.cs @@ -27,7 +27,7 @@ namespace Tizen.NUI { - internal class Texture : BaseHandle + public class Texture : BaseHandle { private global::System.Runtime.InteropServices.HandleRef swigCPtr; @@ -79,30 +79,19 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - public Texture(NativeImageInterface nativeImageInterface) : this(NDalicPINVOKE.Texture_New__SWIG_1(NativeImageInterface.getCPtr(nativeImageInterface)), true) + internal Texture(NativeImageInterface nativeImageInterface) : this(NDalicPINVOKE.Texture_New__SWIG_1(NativeImageInterface.getCPtr(nativeImageInterface)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - public Texture(Texture handle) : this(NDalicPINVOKE.new_Texture__SWIG_1(Texture.getCPtr(handle)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - public static Texture DownCast(BaseHandle handle) + internal static Texture DownCast(BaseHandle handle) { Texture ret = new Texture(NDalicPINVOKE.Texture_DownCast(BaseHandle.getCPtr(handle)), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } - public Texture Assign(Texture handle) - { - Texture ret = new Texture(NDalicPINVOKE.Texture_Assign(swigCPtr, Texture.getCPtr(handle)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - public bool Upload(PixelData pixelData) { bool ret = NDalicPINVOKE.Texture_Upload__SWIG_0(swigCPtr, PixelData.getCPtr(pixelData)); diff --git a/src/Tizen.NUI/src/internal/TextureSet.cs b/src/Tizen.NUI/src/public/TextureSet.cs similarity index 87% rename from src/Tizen.NUI/src/internal/TextureSet.cs rename to src/Tizen.NUI/src/public/TextureSet.cs index ec9c4fa..d43d490 100755 --- a/src/Tizen.NUI/src/internal/TextureSet.cs +++ b/src/Tizen.NUI/src/public/TextureSet.cs @@ -27,7 +27,7 @@ namespace Tizen.NUI { - internal class TextureSet : BaseHandle + public class TextureSet : BaseHandle { private global::System.Runtime.InteropServices.HandleRef swigCPtr; @@ -79,25 +79,14 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - public TextureSet(TextureSet handle) : this(NDalicPINVOKE.new_TextureSet__SWIG_1(TextureSet.getCPtr(handle)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - public static TextureSet DownCast(BaseHandle handle) + internal static TextureSet DownCast(BaseHandle handle) { TextureSet ret = new TextureSet(NDalicPINVOKE.TextureSet_DownCast(BaseHandle.getCPtr(handle)), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } - public TextureSet Assign(TextureSet handle) - { - TextureSet ret = new TextureSet(NDalicPINVOKE.TextureSet_Assign(swigCPtr, TextureSet.getCPtr(handle)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - public void SetTexture(uint index, Texture texture) { NDalicPINVOKE.TextureSet_SetTexture(swigCPtr, index, Texture.getCPtr(texture)); diff --git a/src/Tizen.NUI/src/internal/TextureType.cs b/src/Tizen.NUI/src/public/TextureType.cs similarity index 93% rename from src/Tizen.NUI/src/internal/TextureType.cs rename to src/Tizen.NUI/src/public/TextureType.cs index e73f8a1..00540a9 100755 --- a/src/Tizen.NUI/src/internal/TextureType.cs +++ b/src/Tizen.NUI/src/public/TextureType.cs @@ -10,8 +10,7 @@ namespace Tizen.NUI { - - internal enum TextureType + public enum TextureType { TEXTURE_2D, TEXTURE_CUBE -- 2.7.4