171378af58c6cf97b633ec6d82e3100f8d1acf36
[platform/core/csapi/nui.git] / Tizen.NUI / src / internal / Renderer.cs
1 /** Copyright (c) 2017 Samsung Electronics Co., Ltd.
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 *
15 */
16 // This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts
17 //------------------------------------------------------------------------------
18 // <auto-generated />
19 //
20 // This file was automatically generated by SWIG (http://www.swig.org).
21 // Version 3.0.9
22 //
23 // Do not make changes to this file unless you know what you are doing--modify
24 // the SWIG interface file instead.
25 //------------------------------------------------------------------------------
26
27 namespace Tizen.NUI {
28
29 public class Renderer : Handle {
30   private global::System.Runtime.InteropServices.HandleRef swigCPtr;
31
32   internal Renderer(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Renderer_SWIGUpcast(cPtr), cMemoryOwn) {
33     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
34   }
35
36   internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Renderer obj) {
37     return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
38   }
39
40   ~Renderer() {
41     DisposeQueue.Instance.Add(this);
42   }
43
44   public override void Dispose() {
45     if (!Stage.IsInstalled()) {
46       DisposeQueue.Instance.Add(this);
47       return;
48     }
49
50     lock(this) {
51       if (swigCPtr.Handle != global::System.IntPtr.Zero) {
52         if (swigCMemOwn) {
53           swigCMemOwn = false;
54           NDalicPINVOKE.delete_Renderer(swigCPtr);
55         }
56         swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
57       }
58       global::System.GC.SuppressFinalize(this);
59       base.Dispose();
60     }
61   }
62
63
64   public bool BatchingEnabled
65   {
66     get
67     {
68       bool temp = false;
69       GetProperty( Renderer.Property.BATCHING_ENABLED).Get( ref temp );
70       return temp;
71     }
72     set
73     {
74       SetProperty( Renderer.Property.BATCHING_ENABLED, new Tizen.NUI.PropertyValue( value ) );
75     }
76   }
77
78   public class Property : global::System.IDisposable {
79     private global::System.Runtime.InteropServices.HandleRef swigCPtr;
80     protected bool swigCMemOwn;
81   
82     internal Property(global::System.IntPtr cPtr, bool cMemoryOwn) {
83       swigCMemOwn = cMemoryOwn;
84       swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
85     }
86   
87     internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj) {
88       return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
89     }
90   
91     ~Property() {
92       Dispose();
93     }
94   
95     public virtual void Dispose() {
96       lock(this) {
97         if (swigCPtr.Handle != global::System.IntPtr.Zero) {
98           if (swigCMemOwn) {
99             swigCMemOwn = false;
100             NDalicPINVOKE.delete_Renderer_Property(swigCPtr);
101           }
102           swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
103         }
104         global::System.GC.SuppressFinalize(this);
105       }
106     }
107   
108     public static readonly int BATCHING_ENABLED = NDalicManualPINVOKE.Renderer_Property_BATCHING_ENABLED_get();
109   
110     public Property() : this(NDalicPINVOKE.new_Renderer_Property(), true) {
111       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
112     }
113   
114     public static readonly int DEPTH_INDEX = NDalicPINVOKE.Renderer_Property_DEPTH_INDEX_get();
115     public static readonly int FACE_CULLING_MODE = NDalicPINVOKE.Renderer_Property_FACE_CULLING_MODE_get();
116     public static readonly int BLEND_MODE = NDalicPINVOKE.Renderer_Property_BLEND_MODE_get();
117     public static readonly int BLEND_EQUATION_RGB = NDalicPINVOKE.Renderer_Property_BLEND_EQUATION_RGB_get();
118     public static readonly int BLEND_EQUATION_ALPHA = NDalicPINVOKE.Renderer_Property_BLEND_EQUATION_ALPHA_get();
119     public static readonly int BLEND_FACTOR_SRC_RGB = NDalicPINVOKE.Renderer_Property_BLEND_FACTOR_SRC_RGB_get();
120     public static readonly int BLEND_FACTOR_DEST_RGB = NDalicPINVOKE.Renderer_Property_BLEND_FACTOR_DEST_RGB_get();
121     public static readonly int BLEND_FACTOR_SRC_ALPHA = NDalicPINVOKE.Renderer_Property_BLEND_FACTOR_SRC_ALPHA_get();
122     public static readonly int BLEND_FACTOR_DEST_ALPHA = NDalicPINVOKE.Renderer_Property_BLEND_FACTOR_DEST_ALPHA_get();
123     public static readonly int BLEND_COLOR = NDalicPINVOKE.Renderer_Property_BLEND_COLOR_get();
124     public static readonly int BLEND_PRE_MULTIPLIED_ALPHA = NDalicPINVOKE.Renderer_Property_BLEND_PRE_MULTIPLIED_ALPHA_get();
125     public static readonly int INDEX_RANGE_FIRST = NDalicPINVOKE.Renderer_Property_INDEX_RANGE_FIRST_get();
126     public static readonly int INDEX_RANGE_COUNT = NDalicPINVOKE.Renderer_Property_INDEX_RANGE_COUNT_get();
127     public static readonly int DEPTH_WRITE_MODE = NDalicPINVOKE.Renderer_Property_DEPTH_WRITE_MODE_get();
128     public static readonly int DEPTH_FUNCTION = NDalicPINVOKE.Renderer_Property_DEPTH_FUNCTION_get();
129     public static readonly int DEPTH_TEST_MODE = NDalicPINVOKE.Renderer_Property_DEPTH_TEST_MODE_get();
130     public static readonly int RENDER_MODE = NDalicPINVOKE.Renderer_Property_RENDER_MODE_get();
131     public static readonly int STENCIL_FUNCTION = NDalicPINVOKE.Renderer_Property_STENCIL_FUNCTION_get();
132     public static readonly int STENCIL_FUNCTION_MASK = NDalicPINVOKE.Renderer_Property_STENCIL_FUNCTION_MASK_get();
133     public static readonly int STENCIL_FUNCTION_REFERENCE = NDalicPINVOKE.Renderer_Property_STENCIL_FUNCTION_REFERENCE_get();
134     public static readonly int STENCIL_MASK = NDalicPINVOKE.Renderer_Property_STENCIL_MASK_get();
135     public static readonly int STENCIL_OPERATION_ON_FAIL = NDalicPINVOKE.Renderer_Property_STENCIL_OPERATION_ON_FAIL_get();
136     public static readonly int STENCIL_OPERATION_ON_Z_FAIL = NDalicPINVOKE.Renderer_Property_STENCIL_OPERATION_ON_Z_FAIL_get();
137     public static readonly int STENCIL_OPERATION_ON_Z_PASS = NDalicPINVOKE.Renderer_Property_STENCIL_OPERATION_ON_Z_PASS_get();
138   
139   }
140
141   public Renderer (Geometry geometry, Shader shader) : this (NDalicPINVOKE.Renderer_New(Geometry.getCPtr(geometry), Shader.getCPtr(shader)), true) {
142       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
143
144   }
145   public Renderer(Renderer handle) : this(NDalicPINVOKE.new_Renderer__SWIG_1(Renderer.getCPtr(handle)), true) {
146     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
147   }
148
149   public new static Renderer DownCast(BaseHandle handle) {
150     Renderer ret = new Renderer(NDalicPINVOKE.Renderer_DownCast(BaseHandle.getCPtr(handle)), true);
151     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
152     return ret;
153   }
154
155   public Renderer Assign(Renderer handle) {
156     Renderer ret = new Renderer(NDalicPINVOKE.Renderer_Assign(swigCPtr, Renderer.getCPtr(handle)), false);
157     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
158     return ret;
159   }
160
161   public void SetGeometry(Geometry geometry) {
162     NDalicPINVOKE.Renderer_SetGeometry(swigCPtr, Geometry.getCPtr(geometry));
163     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
164   }
165
166   public Geometry GetGeometry() {
167     Geometry ret = new Geometry(NDalicPINVOKE.Renderer_GetGeometry(swigCPtr), true);
168     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
169     return ret;
170   }
171
172   public void SetIndexRange(int firstElement, int elementsCount) {
173     NDalicPINVOKE.Renderer_SetIndexRange(swigCPtr, firstElement, elementsCount);
174     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
175   }
176
177   public void SetTextures(TextureSet textureSet) {
178     NDalicPINVOKE.Renderer_SetTextures(swigCPtr, TextureSet.getCPtr(textureSet));
179     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
180   }
181
182   public TextureSet GetTextures() {
183     TextureSet ret = new TextureSet(NDalicPINVOKE.Renderer_GetTextures(swigCPtr), true);
184     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
185     return ret;
186   }
187
188   public void SetShader(Shader shader) {
189     NDalicPINVOKE.Renderer_SetShader(swigCPtr, Shader.getCPtr(shader));
190     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
191   }
192
193   public Shader GetShader() {
194     Shader ret = new Shader(NDalicPINVOKE.Renderer_GetShader(swigCPtr), true);
195     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
196     return ret;
197   }
198
199   public int DepthIndex
200   {
201     get
202     {
203       int temp = 0;
204       GetProperty( Renderer.Property.DEPTH_INDEX).Get( ref temp );
205       return temp;
206     }
207     set
208     {
209       SetProperty( Renderer.Property.DEPTH_INDEX, new Tizen.NUI.PropertyValue( value ) );
210     }
211   }
212   public int FaceCullingMode
213   {
214     get
215     {
216       int temp = 0;
217       GetProperty( Renderer.Property.FACE_CULLING_MODE).Get( ref temp );
218       return temp;
219     }
220     set
221     {
222       SetProperty( Renderer.Property.FACE_CULLING_MODE, new Tizen.NUI.PropertyValue( value ) );
223     }
224   }
225   public int BlendMode
226   {
227     get
228     {
229       int temp = 0;
230       GetProperty( Renderer.Property.BLEND_MODE).Get( ref temp );
231       return temp;
232     }
233     set
234     {
235       SetProperty( Renderer.Property.BLEND_MODE, new Tizen.NUI.PropertyValue( value ) );
236     }
237   }
238   public int BlendEquationRgb
239   {
240     get
241     {
242       int temp = 0;
243       GetProperty( Renderer.Property.BLEND_EQUATION_RGB).Get( ref temp );
244       return temp;
245     }
246     set
247     {
248       SetProperty( Renderer.Property.BLEND_EQUATION_RGB, new Tizen.NUI.PropertyValue( value ) );
249     }
250   }
251   public int BlendEquationAlpha
252   {
253     get
254     {
255       int temp = 0;
256       GetProperty( Renderer.Property.BLEND_EQUATION_ALPHA).Get( ref temp );
257       return temp;
258     }
259     set
260     {
261       SetProperty( Renderer.Property.BLEND_EQUATION_ALPHA, new Tizen.NUI.PropertyValue( value ) );
262     }
263   }
264   public int BlendFactorSrcRgb
265   {
266     get
267     {
268       int temp = 0;
269       GetProperty( Renderer.Property.BLEND_FACTOR_SRC_RGB).Get( ref temp );
270       return temp;
271     }
272     set
273     {
274       SetProperty( Renderer.Property.BLEND_FACTOR_SRC_RGB, new Tizen.NUI.PropertyValue( value ) );
275     }
276   }
277   public int BlendFactorDestRgb
278   {
279     get
280     {
281       int temp = 0;
282       GetProperty( Renderer.Property.BLEND_FACTOR_DEST_RGB).Get( ref temp );
283       return temp;
284     }
285     set
286     {
287       SetProperty( Renderer.Property.BLEND_FACTOR_DEST_RGB, new Tizen.NUI.PropertyValue( value ) );
288     }
289   }
290   public int BlendFactorSrcAlpha
291   {
292     get
293     {
294       int temp = 0;
295       GetProperty( Renderer.Property.BLEND_FACTOR_SRC_ALPHA).Get( ref temp );
296       return temp;
297     }
298     set
299     {
300       SetProperty( Renderer.Property.BLEND_FACTOR_SRC_ALPHA, new Tizen.NUI.PropertyValue( value ) );
301     }
302   }
303   public int BlendFactorDestAlpha
304   {
305     get
306     {
307       int temp = 0;
308       GetProperty( Renderer.Property.BLEND_FACTOR_DEST_ALPHA).Get( ref temp );
309       return temp;
310     }
311     set
312     {
313       SetProperty( Renderer.Property.BLEND_FACTOR_DEST_ALPHA, new Tizen.NUI.PropertyValue( value ) );
314     }
315   }
316   public Vector4 BlendColor
317   {
318     get
319     {
320       Vector4 temp = new Vector4(0.0f,0.0f,0.0f,0.0f);
321       GetProperty( Renderer.Property.BLEND_COLOR).Get(  temp );
322       return temp;
323     }
324     set
325     {
326       SetProperty( Renderer.Property.BLEND_COLOR, new Tizen.NUI.PropertyValue( value ) );
327     }
328   }
329   public bool BlendPreMultipliedAlpha
330   {
331     get
332     {
333       bool temp = false;
334       GetProperty( Renderer.Property.BLEND_PRE_MULTIPLIED_ALPHA).Get( ref temp );
335       return temp;
336     }
337     set
338     {
339       SetProperty( Renderer.Property.BLEND_PRE_MULTIPLIED_ALPHA, new Tizen.NUI.PropertyValue( value ) );
340     }
341   }
342   public int IndexRangeFirst
343   {
344     get
345     {
346       int temp = 0;
347       GetProperty( Renderer.Property.INDEX_RANGE_FIRST).Get( ref temp );
348       return temp;
349     }
350     set
351     {
352       SetProperty( Renderer.Property.INDEX_RANGE_FIRST, new Tizen.NUI.PropertyValue( value ) );
353     }
354   }
355   public int IndexRangeCount
356   {
357     get
358     {
359       int temp = 0;
360       GetProperty( Renderer.Property.INDEX_RANGE_COUNT).Get( ref temp );
361       return temp;
362     }
363     set
364     {
365       SetProperty( Renderer.Property.INDEX_RANGE_COUNT, new Tizen.NUI.PropertyValue( value ) );
366     }
367   }
368   public int DepthWriteMode
369   {
370     get
371     {
372       int temp = 0;
373       GetProperty( Renderer.Property.DEPTH_WRITE_MODE).Get( ref temp );
374       return temp;
375     }
376     set
377     {
378       SetProperty( Renderer.Property.DEPTH_WRITE_MODE, new Tizen.NUI.PropertyValue( value ) );
379     }
380   }
381   public int DepthFunction
382   {
383     get
384     {
385       int temp = 0;
386       GetProperty( Renderer.Property.DEPTH_FUNCTION).Get( ref temp );
387       return temp;
388     }
389     set
390     {
391       SetProperty( Renderer.Property.DEPTH_FUNCTION, new Tizen.NUI.PropertyValue( value ) );
392     }
393   }
394   public int DepthTestMode
395   {
396     get
397     {
398       int temp = 0;
399       GetProperty( Renderer.Property.DEPTH_TEST_MODE).Get( ref temp );
400       return temp;
401     }
402     set
403     {
404       SetProperty( Renderer.Property.DEPTH_TEST_MODE, new Tizen.NUI.PropertyValue( value ) );
405     }
406   }
407   public int RenderMode
408   {
409     get
410     {
411       int temp = 0;
412       GetProperty( Renderer.Property.RENDER_MODE).Get( ref temp );
413       return temp;
414     }
415     set
416     {
417       SetProperty( Renderer.Property.RENDER_MODE, new Tizen.NUI.PropertyValue( value ) );
418     }
419   }
420   public int StencilFunction
421   {
422     get
423     {
424       int temp = 0;
425       GetProperty( Renderer.Property.STENCIL_FUNCTION).Get( ref temp );
426       return temp;
427     }
428     set
429     {
430       SetProperty( Renderer.Property.STENCIL_FUNCTION, new Tizen.NUI.PropertyValue( value ) );
431     }
432   }
433   public int StencilFunctionMask
434   {
435     get
436     {
437       int temp = 0;
438       GetProperty( Renderer.Property.STENCIL_FUNCTION_MASK).Get( ref temp );
439       return temp;
440     }
441     set
442     {
443       SetProperty( Renderer.Property.STENCIL_FUNCTION_MASK, new Tizen.NUI.PropertyValue( value ) );
444     }
445   }
446   public int StencilFunctionReference
447   {
448     get
449     {
450       int temp = 0;
451       GetProperty( Renderer.Property.STENCIL_FUNCTION_REFERENCE).Get( ref temp );
452       return temp;
453     }
454     set
455     {
456       SetProperty( Renderer.Property.STENCIL_FUNCTION_REFERENCE, new Tizen.NUI.PropertyValue( value ) );
457     }
458   }
459   public int StencilMask
460   {
461     get
462     {
463       int temp = 0;
464       GetProperty( Renderer.Property.STENCIL_MASK).Get( ref temp );
465       return temp;
466     }
467     set
468     {
469       SetProperty( Renderer.Property.STENCIL_MASK, new Tizen.NUI.PropertyValue( value ) );
470     }
471   }
472   public int StencilOperationOnFail
473   {
474     get
475     {
476       int temp = 0;
477       GetProperty( Renderer.Property.STENCIL_OPERATION_ON_FAIL).Get( ref temp );
478       return temp;
479     }
480     set
481     {
482       SetProperty( Renderer.Property.STENCIL_OPERATION_ON_FAIL, new Tizen.NUI.PropertyValue( value ) );
483     }
484   }
485   public int StencilOperationOnZFail
486   {
487     get
488     {
489       int temp = 0;
490       GetProperty( Renderer.Property.STENCIL_OPERATION_ON_Z_FAIL).Get( ref temp );
491       return temp;
492     }
493     set
494     {
495       SetProperty( Renderer.Property.STENCIL_OPERATION_ON_Z_FAIL, new Tizen.NUI.PropertyValue( value ) );
496     }
497   }
498   public int StencilOperationOnZPass
499   {
500     get
501     {
502       int temp = 0;
503       GetProperty( Renderer.Property.STENCIL_OPERATION_ON_Z_PASS).Get( ref temp );
504       return temp;
505     }
506     set
507     {
508       SetProperty( Renderer.Property.STENCIL_OPERATION_ON_Z_PASS, new Tizen.NUI.PropertyValue( value ) );
509     }
510   }
511
512 }
513
514 }