cd5f37014e19cf2eed37a3665d4ec8e5842f5638
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Layer.cs
1 /*
2  * Copyright(c) 2019 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17 using System;
18 using Tizen.NUI.BaseComponents;
19 using System.ComponentModel;
20 using System.Runtime.InteropServices;
21 using Tizen.NUI.Binding;
22
23 namespace Tizen.NUI
24 {
25
26     /// <summary>
27     /// Layers provide a mechanism for overlaying groups of actors on top of each other.
28     /// </summary>
29     /// <since_tizen> 3 </since_tizen>
30     public class Layer : Container
31     {
32         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
33         private Window window;
34
35         /// <summary>
36         /// Creates a Layer object.
37         /// </summary>
38         /// <since_tizen> 3 </since_tizen>
39         public Layer() : this(Interop.Layer.Layer_New(), true)
40         {
41             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
42             if (Window.Instance != null)
43             {
44                 this.SetAnchorPoint(Tizen.NUI.PivotPoint.TopLeft);
45                 this.SetResizePolicy(ResizePolicyType.FillToParent, DimensionType.AllDimensions);
46             }
47         }
48
49         internal Layer(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.Layer.Layer_SWIGUpcast(cPtr), cMemoryOwn)
50         {
51             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
52         }
53
54         /// <summary>
55         /// Enumeration for the behavior of the layer.
56         /// </summary>
57         /// <since_tizen> 3 </since_tizen>
58         public enum LayerBehavior
59         {
60             /// <summary>
61             /// UI control rendering mode (default mode).
62             /// This mode is designed for UI controls that can overlap. In this
63             /// mode renderer order will be respective to the tree hierarchy of
64             /// Actors.<br />
65             /// The rendering order is depth first, so for the following actor tree,
66             /// A will be drawn first, then B, D, E, then C, F.  This ensures that
67             /// overlapping actors are drawn as expected (whereas, with breadth first
68             /// traversal, the actors would interleave).<br />
69             /// </summary>
70             /// <since_tizen> 3 </since_tizen>
71             LayerUI,
72
73             /// <summary>
74             /// UI control rendering mode.
75             /// </summary>
76             /// <since_tizen> 3 </since_tizen>
77             Layer2D = LayerUI,
78
79             /// <summary>
80             /// Layer will use depth test.
81             /// This mode is designed for a 3 dimensional scene where actors in front
82             /// of other actors will obscure them, i.e. the actors are sorted by the
83             /// distance from the camera.<br />
84             /// When using this mode, a depth test will be used. A depth clear will
85             /// happen for each layer, which means actors in a layer "above" other
86             /// layers will be rendered in front of actors in those layers regardless
87             /// of their Z positions (see Layer::Raise() and Layer::Lower()).<br />
88             /// Opaque renderers are drawn first and write to the depth buffer.  Then
89             /// transparent renderers are drawn with depth test enabled but depth
90             /// write switched off.  Transparent renderers are drawn based on their
91             /// distance from the camera.  A renderer's DEPTH_INDEX property is used to
92             /// offset the distance to the camera when ordering transparent renderers.
93             /// This is useful if you want to define the draw order of two or more
94             /// transparent renderers that are equal distance from the camera.  Unlike
95             /// LAYER_UI, parent-child relationship does not affect rendering order at
96             /// all.
97             /// </summary>
98             /// <since_tizen> 3 </since_tizen>
99             Layer3D
100         }
101
102         internal enum TreeDepthMultiplier
103         {
104             TREE_DEPTH_MULTIPLIER = 10000
105         }
106
107         /// <summary>
108         /// Layer behavior, type String (Layer.LayerBehavior).
109         /// </summary>
110         /// <since_tizen> 3 </since_tizen>
111         public Layer.LayerBehavior Behavior
112         {
113             get
114             {
115                 return GetBehavior();
116             }
117             set
118             {
119                 SetBehavior(value);
120             }
121         }
122
123         /// <summary>
124         /// Sets the viewport (in window coordinates), type rectangle.
125         /// The contents of the layer will not be visible outside this box, when ViewportEnabled is true.
126         /// </summary>
127         /// <since_tizen> 4 </since_tizen>
128         public Rectangle Viewport
129         {
130             get
131             {
132                 if (ClippingEnabled)
133                 {
134                     Rectangle ret = new Rectangle(Interop.Layer.Layer_GetClippingBox(swigCPtr), true);
135                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
136                     return ret;
137                 }
138                 else
139                 {
140                     // Clipping not enabled so return the window size
141                     Size2D windowSize = window?.Size;
142                     Rectangle ret = new Rectangle(0, 0, windowSize.Width, windowSize.Height);
143                     return ret;
144                 }
145             }
146             set
147             {
148                 Interop.Layer.Layer_SetClippingBox__SWIG_1(swigCPtr, Rectangle.getCPtr(value));
149                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
150                 ClippingEnabled = true;
151             }
152         }
153
154         /// <summary>
155         /// Retrieves and sets the layer's opacity.<br />
156         /// </summary>
157         /// <since_tizen> 3 </since_tizen>
158         public float Opacity
159         {
160             get
161             {
162                 float temp = 0.0f;
163                 GetProperty(View.Property.OPACITY).Get(out temp);
164                 return temp;
165             }
166             set
167             {
168                 SetProperty(View.Property.OPACITY, new Tizen.NUI.PropertyValue(value));
169             }
170         }
171
172         /// <summary>
173         /// Retrieves and sets the layer's visibility.
174         /// </summary>
175         /// <since_tizen> 3 </since_tizen>
176         public bool Visibility
177         {
178             get
179             {
180                 bool temp = false;
181                 GetProperty(View.Property.VISIBLE).Get(out temp);
182                 return temp;
183             }
184             set
185             {
186                 SetProperty(View.Property.VISIBLE, new Tizen.NUI.PropertyValue(value));
187             }
188         }
189
190         /// <summary>
191         /// Get the number of children held by the layer.
192         /// </summary>
193         /// <since_tizen> 3 </since_tizen>
194         public new uint ChildCount
195         {
196             get
197             {
198                 return Convert.ToUInt32(Children.Count);
199             }
200         }
201
202         /// <summary>
203         /// Gets or sets the layer's name.
204         /// </summary>
205         /// <since_tizen> 3 </since_tizen>
206         public string Name
207         {
208             get
209             {
210                 return GetName();
211             }
212             set
213             {
214                 SetName(value);
215             }
216         }
217
218         /// <summary>
219         /// Queries the depth of the layer.<br />
220         /// 0 is the bottommost layer, higher number is on the top.<br />
221         /// </summary>
222         /// <since_tizen> 3 </since_tizen>
223         public uint Depth
224         {
225             get
226             {
227                 return GetDepth();
228             }
229         }
230
231         /// <summary>
232         /// Internal only property to enable or disable clipping, type boolean.
233         /// By default, this is false, i.e., the viewport of the layer is the entire window.
234         /// </summary>
235         internal bool ClippingEnabled
236         {
237             get
238             {
239                 bool ret = Interop.Layer.Layer_IsClipping(swigCPtr);
240                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
241                 return ret;
242             }
243             set
244             {
245                 Interop.Layer.Layer_SetClipping(swigCPtr, value);
246                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
247             }
248         }
249
250         /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API.
251         [EditorBrowsable(EditorBrowsableState.Never)]
252         public ResourceDictionary XamlResources
253         {
254             get
255             {
256                 return Application.Current.XamlResources;
257             }
258             set
259             {
260                 Application.Current.XamlResources = value;
261             }
262         }
263
264         /// From the Container base class.
265
266         /// <summary>
267         /// Adds a child view to this layer.
268         /// </summary>
269         /// <seealso cref="Container.Add">
270         /// </seealso>
271         /// <since_tizen> 4 </since_tizen>
272         public override void Add(View child)
273         {
274             Container oldParent = child.GetParent();
275
276             if (oldParent != this)
277             {
278                 if (oldParent != null)
279                 {
280                     oldParent.Remove(child);
281                 }
282                 else
283                 {
284                     child.InternalParent = this;
285                 }
286                 Interop.Actor.Actor_Add( swigCPtr , View.getCPtr(child));
287                 if (NDalicPINVOKE.SWIGPendingException.Pending)
288                     throw NDalicPINVOKE.SWIGPendingException.Retrieve();
289                 Children.Add(child);
290             }
291         }
292
293         /// <summary>
294         /// Removes a child view from this layer. If the view was not a child of this layer, this is a no-op.
295         /// </summary>
296         /// <seealso cref="Container.Remove">
297         /// </seealso>
298         /// <since_tizen> 4 </since_tizen>
299         public override void Remove(View child)
300         {
301             Interop.Actor.Actor_Remove( swigCPtr, View.getCPtr(child));
302             if (NDalicPINVOKE.SWIGPendingException.Pending)
303                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
304
305             Children.Remove(child);
306             child.InternalParent = null;
307         }
308
309         /// <summary>
310         /// Retrieves a child view by the index.
311         /// </summary>
312         /// <pre>The view has been initialized.</pre>
313         /// <param name="index">The index of the child to retrieve.</param>
314         /// <returns>The view for the given index or empty handle if children not initialized.</returns>
315         /// <since_tizen> 4 </since_tizen>
316         public override View GetChildAt(uint index)
317         {
318             if (index < Children.Count)
319             {
320                 return Children[Convert.ToInt32(index)];
321             }
322             else
323             {
324                 return null;
325             }
326         }
327
328         /// <summary>
329         /// Get parent of the layer.
330         /// </summary>
331         /// <returns>The view's container</returns>
332         /// <since_tizen> 4 </since_tizen>
333         public override Container GetParent()
334         {
335             return null;
336         }
337
338         /// <summary>
339         /// Get the child count of the layer.
340         /// </summary>
341         /// <returns>The child count of the layer.</returns>
342         /// <since_tizen> 4 </since_tizen>
343         public override uint GetChildCount()
344         {
345             return Convert.ToUInt32(Children.Count);
346         }
347
348         /// <summary>
349         /// Downcasts a handle to layer handle.
350         /// </summary>
351         /// <since_tizen> 3 </since_tizen>
352         /// Please do not use! this will be deprecated!
353         /// Instead please use as keyword.
354         [Obsolete("Please do not use! This will be deprecated! Please use as keyword instead!")]
355         [EditorBrowsable(EditorBrowsableState.Never)]
356         public static Layer DownCast(BaseHandle handle)
357         {
358             Layer ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Layer;
359             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
360             return ret;
361         }
362
363         /// <summary>
364         /// Search through this layer's hierarchy for a view with the given unique ID.
365         /// </summary>
366         /// <pre>This layer (the parent) has been initialized.</pre>
367         /// <remarks>The actor itself is also considered in the search.</remarks>
368         /// <param name="id">The id of the child to find</param>
369         /// <returns> A handle to the view if found, or an empty handle if not. </returns>
370         /// <since_tizen> 3 </since_tizen>
371         public View FindChildById(uint id)
372         {
373             //to fix memory leak issue, match the handle count with native side.
374             IntPtr cPtr = Interop.Actor.Actor_FindChildById(swigCPtr, id);
375             HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
376             View ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as View;
377             Interop.BaseHandle.delete_BaseHandle(CPtr);
378             CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
379
380             if (NDalicPINVOKE.SWIGPendingException.Pending)
381                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
382             return ret;
383         }
384
385         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
386         [EditorBrowsable(EditorBrowsableState.Never)]
387         public View FindChildByName(string viewName)
388         {
389             //to fix memory leak issue, match the handle count with native side.
390             IntPtr cPtr = Interop.Actor.Actor_FindChildByName(swigCPtr, viewName);
391             HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
392             View ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as View;
393             Interop.BaseHandle.delete_BaseHandle(CPtr);
394             CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
395
396             if (NDalicPINVOKE.SWIGPendingException.Pending)
397                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
398             return ret;
399         }
400
401         /// <summary>
402         /// Increments the depth of the layer.
403         /// </summary>
404         /// <since_tizen> 3 </since_tizen>
405         public void Raise()
406         {
407             var parentChildren = window?.LayersChildren;
408             if (parentChildren != null)
409             {
410                 int currentIdx = parentChildren.IndexOf(this);
411
412                 if (currentIdx >= 0 && currentIdx < parentChildren.Count - 1)
413                 {
414                     var upper = parentChildren[currentIdx + 1];
415                     RaiseAbove(upper);
416                 }
417             }
418         }
419
420         /// <summary>
421         /// Decrements the depth of the layer.
422         /// </summary>
423         /// <since_tizen> 3 </since_tizen>
424         public void Lower()
425         {
426             var parentChildren = window?.LayersChildren;
427             if (parentChildren != null)
428             {
429                 int currentIdx = parentChildren.IndexOf(this);
430
431                 if (currentIdx > 0 && currentIdx < parentChildren.Count)
432                 {
433                     var low = parentChildren[currentIdx - 1];
434                     LowerBelow(low);
435                 }
436             }
437         }
438
439         /// <summary>
440         /// Raises the layer to the top.
441         /// </summary>
442         /// <since_tizen> 3 </since_tizen>
443         public void RaiseToTop()
444         {
445             var parentChildren = window?.LayersChildren;
446
447             if (parentChildren != null)
448             {
449                 parentChildren.Remove(this);
450                 parentChildren.Add(this);
451
452                 Interop.Layer.Layer_RaiseToTop(swigCPtr);
453                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
454             }
455         }
456
457         /// <summary>
458         /// Lowers the layer to the bottom.
459         /// </summary>
460         /// <since_tizen> 3 </since_tizen>
461         public void LowerToBottom()
462         {
463             var parentChildren = window?.LayersChildren;
464
465             if (parentChildren != null)
466             {
467                 parentChildren.Remove(this);
468                 parentChildren.Insert(0, this);
469
470                 Interop.Layer.Layer_LowerToBottom(swigCPtr);
471                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
472             }
473
474         }
475
476         /// <summary>
477         /// Moves the layer directly above the given layer.<br />
478         /// After the call, this layer's depth will be immediately above target.<br />
479         /// </summary>
480         /// <param name="target">The layer to get on top of.</param>
481         /// <since_tizen> 3 </since_tizen>
482         public void MoveAbove(Layer target)
483         {
484             Interop.Layer.Layer_MoveAbove(swigCPtr, Layer.getCPtr(target));
485             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
486         }
487
488         /// <summary>
489         /// Moves the layer directly below the given layer.<br />
490         /// After the call, this layer's depth will be immediately below target.<br />
491         /// </summary>
492         /// <param name="target">The layer to get below of.</param>
493         /// <since_tizen> 3 </since_tizen>
494         public void MoveBelow(Layer target)
495         {
496             Interop.Layer.Layer_MoveBelow(swigCPtr, Layer.getCPtr(target));
497             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
498         }
499
500         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Layer obj)
501         {
502             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
503         }
504
505         internal void SetAnchorPoint(Vector3 anchorPoint)
506         {
507             Interop.Actor.Actor_SetAnchorPoint(swigCPtr, Vector3.getCPtr(anchorPoint));
508             if (NDalicPINVOKE.SWIGPendingException.Pending)
509                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
510         }
511
512         internal void SetResizePolicy(ResizePolicyType policy, DimensionType dimension)
513         {
514             Interop.Actor.Actor_SetResizePolicy(swigCPtr, (int)policy, (int)dimension);
515             if (NDalicPINVOKE.SWIGPendingException.Pending)
516                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
517         }
518
519         internal uint GetDepth()
520         {
521             var parentChildren = window?.LayersChildren;
522             if (parentChildren != null)
523             {
524                 int idx = parentChildren.IndexOf(this);
525                 if (idx >= 0)
526                 {
527                     return Convert.ToUInt32(idx); ;
528                 }
529             }
530             return 0u;
531         }
532         internal void RaiseAbove(Layer target)
533         {
534             var parentChildren = window?.LayersChildren;
535             if (parentChildren != null)
536             {
537                 int currentIndex = parentChildren.IndexOf(this);
538                 int targetIndex = parentChildren.IndexOf(target);
539
540                 if (currentIndex < 0 || targetIndex < 0 ||
541                     currentIndex >= parentChildren.Count || targetIndex >= parentChildren.Count)
542                 {
543                     NUILog.Error("index should be bigger than 0 and less than children of layer count");
544                     return;
545                 }
546
547                 // If the currentIndex is less than the target index and the target has the same parent.
548                 if (currentIndex < targetIndex)
549                 {
550                     parentChildren.Remove(this);
551                     parentChildren.Insert(targetIndex, this);
552
553                     Interop.Layer.Layer_MoveAbove(swigCPtr, Layer.getCPtr(target));
554                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
555                 }
556             }
557         }
558
559         internal void LowerBelow(Layer target)
560         {
561             var parentChildren = window?.LayersChildren;
562
563             if (parentChildren != null)
564             {
565                 int currentIndex = parentChildren.IndexOf(this);
566                 int targetIndex = parentChildren.IndexOf(target);
567
568                 if (currentIndex < 0 || targetIndex < 0 ||
569                     currentIndex >= parentChildren.Count || targetIndex >= parentChildren.Count)
570                 {
571                     NUILog.Error("index should be bigger than 0 and less than children of layer count");
572                     return;
573                 }
574
575                 // If the currentIndex is not already the 0th index and the target has the same parent.
576                 if ((currentIndex != 0) && (targetIndex != -1) &&
577                     (currentIndex > targetIndex))
578                 {
579                     parentChildren.Remove(this);
580                     parentChildren.Insert(targetIndex, this);
581
582                     Interop.Layer.Layer_MoveBelow(swigCPtr, Layer.getCPtr(target));
583                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
584                 }
585             }
586         }
587
588         internal void SetSortFunction(SWIGTYPE_p_f_r_q_const__Dali__Vector3__float function)
589         {
590             Interop.Layer.Layer_SetSortFunction(swigCPtr, SWIGTYPE_p_f_r_q_const__Dali__Vector3__float.getCPtr(function));
591             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
592         }
593
594         internal void SetTouchConsumed(bool consume)
595         {
596             Interop.Layer.Layer_SetTouchConsumed(swigCPtr, consume);
597             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
598         }
599
600         internal bool IsTouchConsumed()
601         {
602             bool ret = Interop.Layer.Layer_IsTouchConsumed(swigCPtr);
603             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
604             return ret;
605         }
606
607         internal void SetHoverConsumed(bool consume)
608         {
609             Interop.Layer.Layer_SetHoverConsumed(swigCPtr, consume);
610             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
611         }
612
613         internal bool IsHoverConsumed()
614         {
615             bool ret = Interop.Layer.Layer_IsHoverConsumed(swigCPtr);
616             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
617             return ret;
618         }
619
620         internal void AddViewToLayerList(View view)
621         {
622             Children.Add(view);
623         }
624
625         internal void RemoveViewFromLayerList(View view)
626         {
627             Children.Remove(view);
628         }
629
630         internal string GetName()
631         {
632             string ret = Interop.Actor.Actor_GetName(swigCPtr);
633             if (NDalicPINVOKE.SWIGPendingException.Pending)
634                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
635             return ret;
636         }
637
638         internal void SetName(string name)
639         {
640             Interop.Actor.Actor_SetName(swigCPtr, name);
641             if (NDalicPINVOKE.SWIGPendingException.Pending)
642                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
643         }
644
645         internal void SetWindow(Window win)
646         {
647             window = win;
648         }
649
650         /// <summary>
651         /// Dispose.
652         /// </summary>
653         /// <since_tizen> 3 </since_tizen>
654         protected override void Dispose(DisposeTypes type)
655         {
656             if (disposed)
657             {
658                 return;
659             }
660
661             if (type == DisposeTypes.Explicit)
662             {
663                 //Called by User
664                 //Release your own managed resources here.
665                 //You should release all of your own disposable objects here.
666             }
667
668             //Release your own unmanaged resources here.
669             //You should not access any managed member here except static instance.
670             //because the execution order of Finalizes is non-deterministic.
671
672             if (swigCPtr.Handle != global::System.IntPtr.Zero)
673             {
674                 if (swigCMemOwn)
675                 {
676                     swigCMemOwn = false;
677                     Interop.Layer.delete_Layer(swigCPtr);
678                 }
679                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
680             }
681
682             base.Dispose(type);
683
684         }
685
686         private void SetBehavior(LayerBehavior behavior)
687         {
688             Interop.Layer.Layer_SetBehavior(swigCPtr, (int)behavior);
689             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
690         }
691
692         private LayerBehavior GetBehavior()
693         {
694             Layer.LayerBehavior ret = (Layer.LayerBehavior)Interop.Layer.Layer_GetBehavior(swigCPtr);
695             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
696             return ret;
697         }
698
699         internal class Property
700         {
701             internal static readonly int BEHAVIOR = Interop.Layer.Layer_Property_BEHAVIOR_get();
702         }
703     }
704 }