From: dongsug.song Date: Tue, 25 Jul 2017 02:05:25 +0000 (+0900) Subject: [Tizen] Temporary Fix to return the Layer as a View when Parent is a Layer. X-Git-Tag: submit/trunk/20170823.075128~91^2~69 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8174dc2ed894dd9508e5e21eb91ce1f55c57507b;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [Tizen] Temporary Fix to return the Layer as a View when Parent is a Layer. This reverts commit 4dd97de9109fd7fde6951110d937681df086ab6e. Conflicts: Tizen.NUI/src/public/BaseHandle.cs Change-Id: Ic8d99215c4752c2841380570e37d04dfbfead24f --- diff --git a/src/Tizen.NUI/src/public/BaseComponents/View.cs b/src/Tizen.NUI/src/public/BaseComponents/View.cs index 7c51b00..2e38f1f 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/View.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/View.cs @@ -2123,7 +2123,7 @@ namespace Tizen.NUI.BaseComponents return ret; } - internal View GetParent() + /*internal View GetParent() { View ret; IntPtr cPtr = NDalicPINVOKE.Actor_GetParent(swigCPtr); @@ -2142,6 +2142,26 @@ namespace Tizen.NUI.BaseComponents if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; + }*/ + + internal View GetParent() + { + View ret; + IntPtr cPtr = NDalicPINVOKE.Actor_GetParent(swigCPtr); + + BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(cPtr); + + if(basehandle is Layer) + { + View ret2 = new View(cPtr,false); + return ret2; + } + + ret = basehandle as View; + + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } internal void SetParentOrigin(Vector3 origin) diff --git a/src/Tizen.NUI/src/public/BaseHandle.cs b/src/Tizen.NUI/src/public/BaseHandle.cs index 69d904e..3088fb7 100755 --- a/src/Tizen.NUI/src/public/BaseHandle.cs +++ b/src/Tizen.NUI/src/public/BaseHandle.cs @@ -26,6 +26,7 @@ namespace Tizen.NUI internal BaseHandle(global::System.IntPtr cPtr, bool cMemoryOwn) { _registerMe = swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); // using copy constructor to create another native handle so Registry.Unregister works fine. @@ -41,18 +42,22 @@ namespace Tizen.NUI internal BaseHandle(global::System.IntPtr cPtr) { _registerMe = swigCMemOwn = true; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); // using copy constructor to create another native handle so Registry.Unregister works fine. swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, NDalicPINVOKE.new_BaseHandle__SWIG_2(swigCPtr)); - // Register this instance of BaseHandle in the registry. - Registry.Register(this); + if (_registerMe) + { + // Register this instance of BaseHandle in the registry. + Registry.Register(this); + } } internal BaseHandle(global::System.IntPtr cPtr) { - swigCMemOwn = true; + _registerMe = swigCMemOwn = true; swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); // Register this instance of BaseHandle in the registry.