From 52bb010084c3b404679e6ca657245fe3852855e9 Mon Sep 17 00:00:00 2001 From: Umar Date: Fri, 21 Jul 2017 14:30:58 +0100 Subject: [PATCH] [Tizen] Fixed many issues. 1- Making DownCast APIs backward compatible. 2- Making use of Registry instead of creating extra managed object. 3- Corrected conversion of Uint16Pair to Size2D. 4- using correct swigCpt in few APIs (eg Window_ResizedSignal) Conflicts: NUISamples/NUISamples/NUISamples.TizenTV/examples/hello-world.cs Tizen.NUI/src/public/BaseComponents/View.cs Change-Id: Ib18446dbda2602757079145ae882c9b1fc075d08 --- .../date-picker-using-json.cs | 4 +- .../NUISamples.TizenTV/examples/hello-world.cs | 4 +- .../examples/sibling-order-test.cs | 14 ++++--- .../NUISamples.TizenTV/examples/test1.cs | 2 +- .../visuals-using-custom-view/ContactView.cs | 8 ++-- src/Tizen.NUI/src/internal/Alignment.cs | 2 +- src/Tizen.NUI/src/internal/AsyncImageLoader.cs | 2 +- src/Tizen.NUI/src/internal/BufferImage.cs | 2 +- src/Tizen.NUI/src/internal/Builder.cs | 4 +- src/Tizen.NUI/src/internal/Camera.cs | 2 +- src/Tizen.NUI/src/internal/CustomActor.cs | 2 +- src/Tizen.NUI/src/internal/EncodedBufferImage.cs | 2 +- src/Tizen.NUI/src/internal/FrameBuffer.cs | 4 +- src/Tizen.NUI/src/internal/FrameBufferImage.cs | 2 +- src/Tizen.NUI/src/internal/GaussianBlurView.cs | 2 +- src/Tizen.NUI/src/internal/GestureDetector.cs | 2 +- src/Tizen.NUI/src/internal/Image.cs | 2 +- src/Tizen.NUI/src/internal/ItemView.cs | 2 +- src/Tizen.NUI/src/internal/LinearConstrainer.cs | 2 +- .../src/internal/LongPressGestureDetector.cs | 2 +- src/Tizen.NUI/src/internal/Model3dView.cs | 2 +- src/Tizen.NUI/src/internal/NativeImage.cs | 2 +- .../src/internal/PageTurnLandscapeView.cs | 2 +- src/Tizen.NUI/src/internal/PageTurnPortraitView.cs | 2 +- src/Tizen.NUI/src/internal/PageTurnView.cs | 2 +- src/Tizen.NUI/src/internal/PanGestureDetector.cs | 2 +- src/Tizen.NUI/src/internal/PathConstrainer.cs | 2 +- src/Tizen.NUI/src/internal/PinchGestureDetector.cs | 2 +- src/Tizen.NUI/src/internal/PropertyNotification.cs | 2 +- src/Tizen.NUI/src/internal/RenderTask.cs | 2 +- src/Tizen.NUI/src/internal/RenderTaskList.cs | 2 +- .../src/internal/ScrollViewPagePathEffect.cs | 2 +- src/Tizen.NUI/src/internal/TapGestureDetector.cs | 2 +- src/Tizen.NUI/src/internal/TouchPoint.cs | 2 +- src/Tizen.NUI/src/internal/ViewImpl.cs | 43 ++++++++++++++++---- src/Tizen.NUI/src/internal/ViewWrapperImpl.cs | 47 ++++++++++++++++++---- src/Tizen.NUI/src/public/Animation.cs | 2 +- .../src/public/BaseComponents/ImageView.cs | 2 +- .../src/public/BaseComponents/TableView.cs | 10 +++-- .../src/public/BaseComponents/TextEditor.cs | 2 +- .../src/public/BaseComponents/TextField.cs | 2 +- .../src/public/BaseComponents/TextLabel.cs | 2 +- .../src/public/BaseComponents/VideoView.cs | 2 +- src/Tizen.NUI/src/public/BaseComponents/View.cs | 25 +++++------- .../src/public/BaseComponents/VisualView.cs | 4 +- src/Tizen.NUI/src/public/CustomView/Spin.cs | 9 ++--- src/Tizen.NUI/src/public/KeyFrames.cs | 2 +- src/Tizen.NUI/src/public/Layer.cs | 6 ++- src/Tizen.NUI/src/public/Path.cs | 2 +- src/Tizen.NUI/src/public/Renderer.cs | 12 ++++-- src/Tizen.NUI/src/public/TextureSet.cs | 8 +++- src/Tizen.NUI/src/public/Timer.cs | 2 +- src/Tizen.NUI/src/public/Touch.cs | 11 ++++- src/Tizen.NUI/src/public/UIComponents/Popup.cs | 14 +++++-- .../src/public/UIComponents/PushButton.cs | 2 +- src/Tizen.NUI/src/public/UIComponents/ScrollBar.cs | 2 +- src/Tizen.NUI/src/public/UIComponents/Slider.cs | 2 +- src/Tizen.NUI/src/public/VisualFactory.cs | 2 +- src/Tizen.NUI/src/public/Window.cs | 19 ++++++--- 59 files changed, 210 insertions(+), 118 deletions(-) diff --git a/NUISamples/NUISamples/NUISamples.TizenTV/examples/date-picker-using-json/date-picker-using-json.cs b/NUISamples/NUISamples/NUISamples.TizenTV/examples/date-picker-using-json/date-picker-using-json.cs index 5344d55..56e7ab9 100755 --- a/NUISamples/NUISamples/NUISamples.TizenTV/examples/date-picker-using-json/date-picker-using-json.cs +++ b/NUISamples/NUISamples/NUISamples.TizenTV/examples/date-picker-using-json/date-picker-using-json.cs @@ -64,9 +64,7 @@ namespace DatePickerUsingJson _builder.LoadFromFile(_resPath + "/json/date-picker-template.json" ); // create the date-picker from the template in the json file - BaseHandle handle = _builder.Create( "date-picker"); - - View actorTree = View.DownCast( handle ); + View actorTree = _builder.Create( "date-picker"); window.Add( actorTree ); diff --git a/NUISamples/NUISamples/NUISamples.TizenTV/examples/hello-world.cs b/NUISamples/NUISamples/NUISamples.TizenTV/examples/hello-world.cs index 58fbbe5..8cd8f1d 100755 --- a/NUISamples/NUISamples/NUISamples.TizenTV/examples/hello-world.cs +++ b/NUISamples/NUISamples/NUISamples.TizenTV/examples/hello-world.cs @@ -57,8 +57,8 @@ namespace HelloWorldTest window.KeyEvent += OnWindowKeyEvent; window.Resized += (obj, e) => { - Tizen.Log.Debug("NUI", "Height: " + e.WindowSize.GetHeight()); - Tizen.Log.Debug("NUI", "Width: " + e.WindowSize.GetWidth()); + Tizen.Log.Debug("NUI", "Height: " + e.WindowSize.Height); + Tizen.Log.Debug("NUI", "Width: " + e.WindowSize.Width); }; TextLabel pixelLabel = new TextLabel("Test Pixel Size 32.0f"); diff --git a/NUISamples/NUISamples/NUISamples.TizenTV/examples/sibling-order-test.cs b/NUISamples/NUISamples/NUISamples.TizenTV/examples/sibling-order-test.cs index e07f7d5..eaf9f69 100755 --- a/NUISamples/NUISamples/NUISamples.TizenTV/examples/sibling-order-test.cs +++ b/NUISamples/NUISamples/NUISamples.TizenTV/examples/sibling-order-test.cs @@ -104,9 +104,9 @@ namespace SiblingOrderTest _view.ParentOrigin = ParentOrigin.TopLeft; _view.PivotPoint = PivotPoint.TopLeft; _view.Position2D = _myPos + new Position2D(20 * i, 10 * i); - _view.SiblingOrder = i; _window.Add(_view); + _view.SiblingOrder = i; } } @@ -124,9 +124,9 @@ namespace SiblingOrderTest _view.ParentOrigin = ParentOrigin.TopLeft; _view.PivotPoint = PivotPoint.TopLeft; _view.Position2D = _myPos + new Position2D(20 * i, 10 * i); - _view.SiblingOrder = 10-i; _window.Add(_view); + _view.SiblingOrder = 10-i; } } @@ -144,6 +144,9 @@ namespace SiblingOrderTest _view.ParentOrigin = ParentOrigin.TopLeft; _view.PivotPoint = PivotPoint.TopLeft; _view.Position2D = _myPos + new Position2D(20 * i, 10 * i); + + _window.Add(_view); + if (i<5) { _view.SiblingOrder = 5-i; @@ -152,8 +155,6 @@ namespace SiblingOrderTest { _view.SiblingOrder = i-5; } - - _window.Add(_view); } } @@ -171,6 +172,9 @@ namespace SiblingOrderTest _view.ParentOrigin = ParentOrigin.TopLeft; _view.PivotPoint = PivotPoint.TopLeft; _view.Position2D = _myPos + new Position2D(20 * i, 10 * i); + + _window.Add(_view); + if (i<5) { _view.SiblingOrder = i; @@ -179,8 +183,6 @@ namespace SiblingOrderTest { _view.SiblingOrder = 10-i; } - - _window.Add(_view); } } diff --git a/NUISamples/NUISamples/NUISamples.TizenTV/examples/test1.cs b/NUISamples/NUISamples/NUISamples.TizenTV/examples/test1.cs index 42c79a6..583784d 100644 --- a/NUISamples/NUISamples/NUISamples.TizenTV/examples/test1.cs +++ b/NUISamples/NUISamples/NUISamples.TizenTV/examples/test1.cs @@ -161,7 +161,7 @@ namespace Test1 .Add(TextVisualProperty.PointSize, new PropertyValue(10)) .Add(TextVisualProperty.HorizontalAlignment, new PropertyValue("CENTER")) .Add(TextVisualProperty.VerticalAlignment, new PropertyValue("CENTER")); - _textVisual = VisualFactory.Get().CreateVisual(textVisual); + _textVisual = VisualFactory.Instance.CreateVisual(textVisual); RegisterVisual(TextVisualPropertyIndex, _textVisual); _textVisual.DepthIndex = TextVisualPropertyIndex; } diff --git a/NUISamples/NUISamples/NUISamples.TizenTV/examples/visuals-using-custom-view/ContactView.cs b/NUISamples/NUISamples/NUISamples.TizenTV/examples/visuals-using-custom-view/ContactView.cs index 1e25c73..7ab8794 100644 --- a/NUISamples/NUISamples/NUISamples.TizenTV/examples/visuals-using-custom-view/ContactView.cs +++ b/NUISamples/NUISamples/NUISamples.TizenTV/examples/visuals-using-custom-view/ContactView.cs @@ -53,7 +53,7 @@ namespace VisualsUsingCustomView CustomViewRegistry.Instance.Register( CreateInstance, typeof(ContactView)); } - public ContactView() : base(typeof(ContactView).Name, CustomViewBehaviour.RequiresKeyboardNavigationSupport) + public ContactView() : base(typeof(ContactView).FullName, CustomViewBehaviour.RequiresKeyboardNavigationSupport) { } @@ -79,7 +79,7 @@ namespace VisualsUsingCustomView imageVisual.Add( Visual.Property.Type, new PropertyValue( (int)Visual.Type.Image )) .Add( ImageVisualProperty.URL, new PropertyValue( _imageURL ) ) .Add( ImageVisualProperty.AlphaMaskURL, new PropertyValue( _maskURL )); - _imageVisual = VisualFactory.Get().CreateVisual( imageVisual ); + _imageVisual = VisualFactory.Instance.CreateVisual( imageVisual ); RegisterVisual( GetPropertyIndex("ImageURL"), _imageVisual ); @@ -107,7 +107,7 @@ namespace VisualsUsingCustomView .Add(TextVisualProperty.PointSize, new PropertyValue(7)) .Add( TextVisualProperty.HorizontalAlignment, new PropertyValue("CENTER")) .Add( TextVisualProperty.VerticalAlignment, new PropertyValue("CENTER")); - _textVisual = VisualFactory.Get().CreateVisual( textVisual ); + _textVisual = VisualFactory.Instance.CreateVisual( textVisual ); RegisterVisual( GetPropertyIndex("Name"), _textVisual ); @@ -149,7 +149,7 @@ namespace VisualsUsingCustomView .Add( PrimitiveVisualProperty.BevelSmoothness, new PropertyValue(0.0f)) .Add( PrimitiveVisualProperty.ScaleDimensions, new PropertyValue(new Vector3(1.0f,1.0f,0.3f))) .Add( PrimitiveVisualProperty.MixColor, new PropertyValue(new Vector4((245.0f/255.0f), (188.0f/255.0f), (73.0f/255.0f), 1.0f))); - _primitiveVisual = VisualFactory.Get().CreateVisual( primitiveVisual ); + _primitiveVisual = VisualFactory.Instance.CreateVisual( primitiveVisual ); RegisterVisual( GetPropertyIndex("Shape"), _primitiveVisual ); // Set the depth index for Primitive visual diff --git a/src/Tizen.NUI/src/internal/Alignment.cs b/src/Tizen.NUI/src/internal/Alignment.cs index e64520e..c49d4f7 100755 --- a/src/Tizen.NUI/src/internal/Alignment.cs +++ b/src/Tizen.NUI/src/internal/Alignment.cs @@ -242,7 +242,7 @@ namespace Tizen.NUI public new static Alignment DownCast(BaseHandle handle) { - Alignment ret = new Alignment(NDalicPINVOKE.Alignment_DownCast(BaseHandle.getCPtr(handle)), true); + Alignment ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Alignment; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/src/Tizen.NUI/src/internal/AsyncImageLoader.cs b/src/Tizen.NUI/src/internal/AsyncImageLoader.cs index f3f122d..d01e131 100755 --- a/src/Tizen.NUI/src/internal/AsyncImageLoader.cs +++ b/src/Tizen.NUI/src/internal/AsyncImageLoader.cs @@ -82,7 +82,7 @@ namespace Tizen.NUI public static AsyncImageLoader DownCast(BaseHandle handle) { - AsyncImageLoader ret = new AsyncImageLoader(NDalicPINVOKE.AsyncImageLoader_DownCast(BaseHandle.getCPtr(handle)), true); + AsyncImageLoader ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as AsyncImageLoader; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/src/Tizen.NUI/src/internal/BufferImage.cs b/src/Tizen.NUI/src/internal/BufferImage.cs index 0db41cf..0f15466 100755 --- a/src/Tizen.NUI/src/internal/BufferImage.cs +++ b/src/Tizen.NUI/src/internal/BufferImage.cs @@ -93,7 +93,7 @@ namespace Tizen.NUI } public new static BufferImage DownCast(BaseHandle handle) { - BufferImage ret = new BufferImage(NDalicPINVOKE.BufferImage_DownCast(BaseHandle.getCPtr(handle)), true); + BufferImage ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as BufferImage; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/src/Tizen.NUI/src/internal/Builder.cs b/src/Tizen.NUI/src/internal/Builder.cs index b826f65..aaa87be 100755 --- a/src/Tizen.NUI/src/internal/Builder.cs +++ b/src/Tizen.NUI/src/internal/Builder.cs @@ -218,9 +218,9 @@ namespace Tizen.NUI return ret; } - public BaseHandle Create(string templateName) + public View Create(string templateName) { - BaseHandle ret = new BaseHandle(NDalicPINVOKE.Builder_Create__SWIG_0(swigCPtr, templateName), true); + View ret = new View(NDalicPINVOKE.Builder_Create__SWIG_0(swigCPtr, templateName), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/src/Tizen.NUI/src/internal/Camera.cs b/src/Tizen.NUI/src/internal/Camera.cs index 7f98d94..f43ba7f 100755 --- a/src/Tizen.NUI/src/internal/Camera.cs +++ b/src/Tizen.NUI/src/internal/Camera.cs @@ -181,7 +181,7 @@ namespace Tizen.NUI } public new static Camera DownCast(BaseHandle handle) { - Camera ret = new Camera(NDalicPINVOKE.CameraActor_DownCast(BaseHandle.getCPtr(handle)), true); + Camera ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Camera; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/src/Tizen.NUI/src/internal/CustomActor.cs b/src/Tizen.NUI/src/internal/CustomActor.cs index 8bea2d1..6f7bf4d 100755 --- a/src/Tizen.NUI/src/internal/CustomActor.cs +++ b/src/Tizen.NUI/src/internal/CustomActor.cs @@ -70,7 +70,7 @@ namespace Tizen.NUI public new static CustomActor DownCast(BaseHandle handle) { - CustomActor ret = new CustomActor(NDalicPINVOKE.CustomActor_DownCast(BaseHandle.getCPtr(handle)), true); + CustomActor ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as CustomActor; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/src/Tizen.NUI/src/internal/EncodedBufferImage.cs b/src/Tizen.NUI/src/internal/EncodedBufferImage.cs index 6f801c7..4019bc6 100755 --- a/src/Tizen.NUI/src/internal/EncodedBufferImage.cs +++ b/src/Tizen.NUI/src/internal/EncodedBufferImage.cs @@ -80,7 +80,7 @@ namespace Tizen.NUI } public new static EncodedBufferImage DownCast(BaseHandle handle) { - EncodedBufferImage ret = new EncodedBufferImage(NDalicPINVOKE.EncodedBufferImage_DownCast(BaseHandle.getCPtr(handle)), true); + EncodedBufferImage ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as EncodedBufferImage; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/src/Tizen.NUI/src/internal/FrameBuffer.cs b/src/Tizen.NUI/src/internal/FrameBuffer.cs index aba063a..1db1867 100755 --- a/src/Tizen.NUI/src/internal/FrameBuffer.cs +++ b/src/Tizen.NUI/src/internal/FrameBuffer.cs @@ -94,7 +94,9 @@ namespace Tizen.NUI public Texture GetColorTexture() { - Texture ret = new Texture(NDalicPINVOKE.FrameBuffer_GetColorTexture(swigCPtr), true); + global::System.IntPtr cPtr = NDalicPINVOKE.FrameBuffer_GetColorTexture(swigCPtr); + Texture ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Texture; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/src/Tizen.NUI/src/internal/FrameBufferImage.cs b/src/Tizen.NUI/src/internal/FrameBufferImage.cs index 3646b8a..7cc5961 100755 --- a/src/Tizen.NUI/src/internal/FrameBufferImage.cs +++ b/src/Tizen.NUI/src/internal/FrameBufferImage.cs @@ -97,7 +97,7 @@ namespace Tizen.NUI } public new static FrameBufferImage DownCast(BaseHandle handle) { - FrameBufferImage ret = new FrameBufferImage(NDalicPINVOKE.FrameBufferImage_DownCast(BaseHandle.getCPtr(handle)), true); + FrameBufferImage ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as FrameBufferImage; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/src/Tizen.NUI/src/internal/GaussianBlurView.cs b/src/Tizen.NUI/src/internal/GaussianBlurView.cs index b9e2cdd..306c597 100755 --- a/src/Tizen.NUI/src/internal/GaussianBlurView.cs +++ b/src/Tizen.NUI/src/internal/GaussianBlurView.cs @@ -168,7 +168,7 @@ namespace Tizen.NUI public new static GaussianBlurView DownCast(BaseHandle handle) { - GaussianBlurView ret = new GaussianBlurView(NDalicPINVOKE.GaussianBlurView_DownCast(BaseHandle.getCPtr(handle)), true); + GaussianBlurView ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as GaussianBlurView; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/src/Tizen.NUI/src/internal/GestureDetector.cs b/src/Tizen.NUI/src/internal/GestureDetector.cs index faf27a3..a9e8217 100755 --- a/src/Tizen.NUI/src/internal/GestureDetector.cs +++ b/src/Tizen.NUI/src/internal/GestureDetector.cs @@ -70,7 +70,7 @@ namespace Tizen.NUI public new static GestureDetector DownCast(BaseHandle handle) { - GestureDetector ret = new GestureDetector(NDalicPINVOKE.GestureDetector_DownCast(BaseHandle.getCPtr(handle)), true); + GestureDetector ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as GestureDetector; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/src/Tizen.NUI/src/internal/Image.cs b/src/Tizen.NUI/src/internal/Image.cs index af70862..928305a 100755 --- a/src/Tizen.NUI/src/internal/Image.cs +++ b/src/Tizen.NUI/src/internal/Image.cs @@ -177,7 +177,7 @@ namespace Tizen.NUI public static Image DownCast(BaseHandle handle) { - Image ret = new Image(NDalicPINVOKE.Image_DownCast(BaseHandle.getCPtr(handle)), true); + Image ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Image; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/src/Tizen.NUI/src/internal/ItemView.cs b/src/Tizen.NUI/src/internal/ItemView.cs index ab4fc20..ad354db 100755 --- a/src/Tizen.NUI/src/internal/ItemView.cs +++ b/src/Tizen.NUI/src/internal/ItemView.cs @@ -107,7 +107,7 @@ namespace Tizen.NUI internal new static ItemView DownCast(BaseHandle handle) { - ItemView ret = new ItemView(NDalicPINVOKE.ItemView_DownCast(BaseHandle.getCPtr(handle)), true); + ItemView ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as ItemView; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/src/Tizen.NUI/src/internal/LinearConstrainer.cs b/src/Tizen.NUI/src/internal/LinearConstrainer.cs index 6004eb0..5a21f4c 100755 --- a/src/Tizen.NUI/src/internal/LinearConstrainer.cs +++ b/src/Tizen.NUI/src/internal/LinearConstrainer.cs @@ -162,7 +162,7 @@ namespace Tizen.NUI } internal new static LinearConstrainer DownCast(BaseHandle handle) { - LinearConstrainer ret = new LinearConstrainer(NDalicPINVOKE.LinearConstrainer_DownCast(BaseHandle.getCPtr(handle)), true); + LinearConstrainer ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as LinearConstrainer; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/src/Tizen.NUI/src/internal/LongPressGestureDetector.cs b/src/Tizen.NUI/src/internal/LongPressGestureDetector.cs index 2262b85..a168ca7 100755 --- a/src/Tizen.NUI/src/internal/LongPressGestureDetector.cs +++ b/src/Tizen.NUI/src/internal/LongPressGestureDetector.cs @@ -177,7 +177,7 @@ namespace Tizen.NUI } public new static LongPressGestureDetector DownCast(BaseHandle handle) { - LongPressGestureDetector ret = new LongPressGestureDetector(NDalicPINVOKE.LongPressGestureDetector_DownCast(BaseHandle.getCPtr(handle)), true); + LongPressGestureDetector ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as LongPressGestureDetector; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/src/Tizen.NUI/src/internal/Model3dView.cs b/src/Tizen.NUI/src/internal/Model3dView.cs index b7e274b..cb053aa 100755 --- a/src/Tizen.NUI/src/internal/Model3dView.cs +++ b/src/Tizen.NUI/src/internal/Model3dView.cs @@ -187,7 +187,7 @@ namespace Tizen.NUI public new static Model3dView DownCast(BaseHandle handle) { - Model3dView ret = new Model3dView(NDalicPINVOKE.Model3dView_DownCast(BaseHandle.getCPtr(handle)), true); + Model3dView ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Model3dView; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/src/Tizen.NUI/src/internal/NativeImage.cs b/src/Tizen.NUI/src/internal/NativeImage.cs index 8303c3f..a3a6183 100755 --- a/src/Tizen.NUI/src/internal/NativeImage.cs +++ b/src/Tizen.NUI/src/internal/NativeImage.cs @@ -89,7 +89,7 @@ namespace Tizen.NUI public new static NativeImage DownCast(BaseHandle handle) { - NativeImage ret = new NativeImage(NDalicPINVOKE.NativeImage_DownCast(BaseHandle.getCPtr(handle)), true); + NativeImage ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as NativeImage; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/src/Tizen.NUI/src/internal/PageTurnLandscapeView.cs b/src/Tizen.NUI/src/internal/PageTurnLandscapeView.cs index 84bba07..d2e501b 100755 --- a/src/Tizen.NUI/src/internal/PageTurnLandscapeView.cs +++ b/src/Tizen.NUI/src/internal/PageTurnLandscapeView.cs @@ -82,7 +82,7 @@ namespace Tizen.NUI public new static PageTurnLandscapeView DownCast(BaseHandle handle) { - PageTurnLandscapeView ret = new PageTurnLandscapeView(NDalicPINVOKE.PageTurnLandscapeView_DownCast(BaseHandle.getCPtr(handle)), true); + PageTurnLandscapeView ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as PageTurnLandscapeView; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/src/Tizen.NUI/src/internal/PageTurnPortraitView.cs b/src/Tizen.NUI/src/internal/PageTurnPortraitView.cs index 0d2c174..607b476 100755 --- a/src/Tizen.NUI/src/internal/PageTurnPortraitView.cs +++ b/src/Tizen.NUI/src/internal/PageTurnPortraitView.cs @@ -82,7 +82,7 @@ namespace Tizen.NUI public new static PageTurnPortraitView DownCast(BaseHandle handle) { - PageTurnPortraitView ret = new PageTurnPortraitView(NDalicPINVOKE.PageTurnPortraitView_DownCast(BaseHandle.getCPtr(handle)), true); + PageTurnPortraitView ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as PageTurnPortraitView; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/src/Tizen.NUI/src/internal/PageTurnView.cs b/src/Tizen.NUI/src/internal/PageTurnView.cs index 1203013..9a2ebbe 100755 --- a/src/Tizen.NUI/src/internal/PageTurnView.cs +++ b/src/Tizen.NUI/src/internal/PageTurnView.cs @@ -524,7 +524,7 @@ namespace Tizen.NUI public new static PageTurnView DownCast(BaseHandle handle) { - PageTurnView ret = new PageTurnView(NDalicPINVOKE.PageTurnView_DownCast(BaseHandle.getCPtr(handle)), true); + PageTurnView ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as PageTurnView; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/src/Tizen.NUI/src/internal/PanGestureDetector.cs b/src/Tizen.NUI/src/internal/PanGestureDetector.cs index 178b6c2..2573744 100755 --- a/src/Tizen.NUI/src/internal/PanGestureDetector.cs +++ b/src/Tizen.NUI/src/internal/PanGestureDetector.cs @@ -343,7 +343,7 @@ namespace Tizen.NUI } public new static PanGestureDetector DownCast(BaseHandle handle) { - PanGestureDetector ret = new PanGestureDetector(NDalicPINVOKE.PanGestureDetector_DownCast(BaseHandle.getCPtr(handle)), true); + PanGestureDetector ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as PanGestureDetector; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/src/Tizen.NUI/src/internal/PathConstrainer.cs b/src/Tizen.NUI/src/internal/PathConstrainer.cs index 9abb448..98e2d9e 100755 --- a/src/Tizen.NUI/src/internal/PathConstrainer.cs +++ b/src/Tizen.NUI/src/internal/PathConstrainer.cs @@ -166,7 +166,7 @@ namespace Tizen.NUI } public new static PathConstrainer DownCast(BaseHandle handle) { - PathConstrainer ret = new PathConstrainer(NDalicPINVOKE.PathConstrainer_DownCast(BaseHandle.getCPtr(handle)), true); + PathConstrainer ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as PathConstrainer; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/src/Tizen.NUI/src/internal/PinchGestureDetector.cs b/src/Tizen.NUI/src/internal/PinchGestureDetector.cs index 34c31c7..449509f 100755 --- a/src/Tizen.NUI/src/internal/PinchGestureDetector.cs +++ b/src/Tizen.NUI/src/internal/PinchGestureDetector.cs @@ -170,7 +170,7 @@ namespace Tizen.NUI } public new static PinchGestureDetector DownCast(BaseHandle handle) { - PinchGestureDetector ret = new PinchGestureDetector(NDalicPINVOKE.PinchGestureDetector_DownCast(BaseHandle.getCPtr(handle)), true); + PinchGestureDetector ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as PinchGestureDetector; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/src/Tizen.NUI/src/internal/PropertyNotification.cs b/src/Tizen.NUI/src/internal/PropertyNotification.cs index d084ca1..50dc344 100755 --- a/src/Tizen.NUI/src/internal/PropertyNotification.cs +++ b/src/Tizen.NUI/src/internal/PropertyNotification.cs @@ -161,7 +161,7 @@ namespace Tizen.NUI public static PropertyNotification DownCast(BaseHandle handle) { - PropertyNotification ret = new PropertyNotification(NDalicPINVOKE.PropertyNotification_DownCast(BaseHandle.getCPtr(handle)), true); + PropertyNotification ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as PropertyNotification; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/src/Tizen.NUI/src/internal/RenderTask.cs b/src/Tizen.NUI/src/internal/RenderTask.cs index 4964701..babb0ed 100755 --- a/src/Tizen.NUI/src/internal/RenderTask.cs +++ b/src/Tizen.NUI/src/internal/RenderTask.cs @@ -256,7 +256,7 @@ namespace Tizen.NUI public new static RenderTask DownCast(BaseHandle handle) { - RenderTask ret = new RenderTask(NDalicPINVOKE.RenderTask_DownCast(BaseHandle.getCPtr(handle)), true); + RenderTask ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as RenderTask; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/src/Tizen.NUI/src/internal/RenderTaskList.cs b/src/Tizen.NUI/src/internal/RenderTaskList.cs index 250ba24..2c82275 100755 --- a/src/Tizen.NUI/src/internal/RenderTaskList.cs +++ b/src/Tizen.NUI/src/internal/RenderTaskList.cs @@ -71,7 +71,7 @@ namespace Tizen.NUI public static RenderTaskList DownCast(BaseHandle handle) { - RenderTaskList ret = new RenderTaskList(NDalicPINVOKE.RenderTaskList_DownCast(BaseHandle.getCPtr(handle)), true); + RenderTaskList ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as RenderTaskList; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/src/Tizen.NUI/src/internal/ScrollViewPagePathEffect.cs b/src/Tizen.NUI/src/internal/ScrollViewPagePathEffect.cs index 7912eca..d710aa8 100755 --- a/src/Tizen.NUI/src/internal/ScrollViewPagePathEffect.cs +++ b/src/Tizen.NUI/src/internal/ScrollViewPagePathEffect.cs @@ -70,7 +70,7 @@ namespace Tizen.NUI } public static ScrollViewPagePathEffect DownCast(BaseHandle handle) { - ScrollViewPagePathEffect ret = new ScrollViewPagePathEffect(NDalicPINVOKE.ScrollViewPagePathEffect_DownCast(BaseHandle.getCPtr(handle)), true); + ScrollViewPagePathEffect ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as ScrollViewPagePathEffect; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/src/Tizen.NUI/src/internal/TapGestureDetector.cs b/src/Tizen.NUI/src/internal/TapGestureDetector.cs index a5908c4..a3c9c6e 100755 --- a/src/Tizen.NUI/src/internal/TapGestureDetector.cs +++ b/src/Tizen.NUI/src/internal/TapGestureDetector.cs @@ -172,7 +172,7 @@ namespace Tizen.NUI } public new static TapGestureDetector DownCast(BaseHandle handle) { - TapGestureDetector ret = new TapGestureDetector(NDalicPINVOKE.TapGestureDetector_DownCast(BaseHandle.getCPtr(handle)), true); + TapGestureDetector ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as TapGestureDetector; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/src/Tizen.NUI/src/internal/TouchPoint.cs b/src/Tizen.NUI/src/internal/TouchPoint.cs index 03da8fd..956a3c6 100755 --- a/src/Tizen.NUI/src/internal/TouchPoint.cs +++ b/src/Tizen.NUI/src/internal/TouchPoint.cs @@ -151,7 +151,7 @@ namespace Tizen.NUI get { global::System.IntPtr cPtr = NDalicPINVOKE.TouchPoint_hitActor_get(swigCPtr); - View ret = (cPtr == global::System.IntPtr.Zero) ? null : new View(cPtr, false); + View ret = (cPtr == global::System.IntPtr.Zero) ? null : Registry.GetManagedBaseHandleFromRefObject(cPtr) as View; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/src/Tizen.NUI/src/internal/ViewImpl.cs b/src/Tizen.NUI/src/internal/ViewImpl.cs index 1f3da0a..aea5d39 100755 --- a/src/Tizen.NUI/src/internal/ViewImpl.cs +++ b/src/Tizen.NUI/src/internal/ViewImpl.cs @@ -616,12 +616,22 @@ namespace Tizen.NUI private void SwigDirectorOnChildAdd(global::System.IntPtr child) { - OnChildAdd(new View(child, false)); + View view = Registry.GetManagedBaseHandleFromNativePtr(child) as View; + + if (view) + { + OnChildAdd(view); + } } private void SwigDirectorOnChildRemove(global::System.IntPtr child) { - OnChildRemove(new View(child, false)); + View view = Registry.GetManagedBaseHandleFromNativePtr(child) as View; + + if (view) + { + OnChildRemove(view); + } } private void SwigDirectorOnPropertySet(int index, global::System.IntPtr propertyValue) @@ -676,7 +686,12 @@ namespace Tizen.NUI private float SwigDirectorCalculateChildSize(global::System.IntPtr child, int dimension) { - return CalculateChildSize(new View(child, false), (DimensionType)dimension); + View view = Registry.GetManagedBaseHandleFromNativePtr(child) as View; + if (view) + { + return CalculateChildSize(view, (DimensionType)dimension); + } + return 0.0f; } private float SwigDirectorGetHeightForWidth(float width) @@ -716,17 +731,29 @@ namespace Tizen.NUI private void SwigDirectorOnControlChildAdd(global::System.IntPtr child) { - OnControlChildAdd(new View(child, false)); + View view = Registry.GetManagedBaseHandleFromNativePtr(child) as View; + if (view) + { + OnControlChildAdd(view); + } } private void SwigDirectorOnControlChildRemove(global::System.IntPtr child) { - OnControlChildRemove(new View(child, false)); + View view = Registry.GetManagedBaseHandleFromNativePtr(child) as View; + if (view) + { + OnControlChildRemove(view); + } } private void SwigDirectorOnStyleChange(global::System.IntPtr styleManager, int change) { - OnStyleChange(new StyleManager(styleManager, true), (StyleChangeType)change); + StyleManager stManager = Registry.GetManagedBaseHandleFromNativePtr(styleManager) as StyleManager; + if (stManager) + { + OnStyleChange(stManager, (StyleChangeType)change); + } } private bool SwigDirectorOnAccessibilityActivated() @@ -766,12 +793,12 @@ namespace Tizen.NUI private global::System.IntPtr SwigDirectorGetNextKeyboardFocusableView(global::System.IntPtr currentFocusedView, int direction, bool loopEnabled) { - return View.getCPtr(GetNextFocusableView(new View(currentFocusedView, true), (View.FocusDirection)direction, loopEnabled)).Handle; + return View.getCPtr(GetNextFocusableView(Registry.GetManagedBaseHandleFromNativePtr(currentFocusedView) as View, (View.FocusDirection)direction, loopEnabled)).Handle; } private void SwigDirectorOnKeyboardFocusChangeCommitted(global::System.IntPtr commitedFocusableView) { - OnFocusChangeCommitted(new View(commitedFocusableView, true)); + OnFocusChangeCommitted(Registry.GetManagedBaseHandleFromNativePtr(commitedFocusableView) as View); } private bool SwigDirectorOnKeyboardEnter() diff --git a/src/Tizen.NUI/src/internal/ViewWrapperImpl.cs b/src/Tizen.NUI/src/internal/ViewWrapperImpl.cs index 81489de..94e182e 100755 --- a/src/Tizen.NUI/src/internal/ViewWrapperImpl.cs +++ b/src/Tizen.NUI/src/internal/ViewWrapperImpl.cs @@ -214,7 +214,9 @@ namespace Tizen.NUI public VisualBase GetVisual(int index) { - VisualBase ret = new VisualBase(NDalicManualPINVOKE.ViewWrapperImpl_GetVisual(swigCPtr, index), true); + System.IntPtr cPtr = NDalicManualPINVOKE.ViewWrapperImpl_GetVisual(swigCPtr, index); + VisualBase ret = Registry.GetManagedBaseHandleFromRefObject(cPtr) as VisualBase; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -307,12 +309,20 @@ namespace Tizen.NUI private void DirectorOnChildAdd(global::System.IntPtr child) { - OnChildAdd(new View(child, false)); + View view = Registry.GetManagedBaseHandleFromNativePtr(child) as View; + if (view) + { + OnChildAdd(view); + } } private void DirectorOnChildRemove(global::System.IntPtr child) { - OnChildRemove(new View(child, false)); + View view = Registry.GetManagedBaseHandleFromNativePtr(child) as View; + if (view) + { + OnChildRemove(view); + } } private void DirectorOnPropertySet(int index, global::System.IntPtr propertyValue) @@ -370,7 +380,12 @@ namespace Tizen.NUI private float DirectorCalculateChildSize(global::System.IntPtr child, int dimension) { - return CalculateChildSize(new View(child, false), (DimensionType)dimension); + View view = Registry.GetManagedBaseHandleFromNativePtr(child) as View; + if (view) + { + return CalculateChildSize(view, (DimensionType)dimension); + } + return 0.0f; } private float DirectorGetHeightForWidth(float width) @@ -409,12 +424,20 @@ namespace Tizen.NUI private void DirectorOnControlChildAdd(global::System.IntPtr child) { - OnControlChildAdd(new View(child, false)); + View view = Registry.GetManagedBaseHandleFromNativePtr(child) as View; + if (view) + { + OnControlChildAdd(view); + } } private void DirectorOnControlChildRemove(global::System.IntPtr child) { - OnControlChildRemove(new View(child, false)); + View view = Registry.GetManagedBaseHandleFromNativePtr(child) as View; + if (view) + { + OnControlChildRemove(view); + } } private void DirectorOnStyleChange(global::System.IntPtr styleManager, int change) @@ -462,12 +485,20 @@ namespace Tizen.NUI private global::System.IntPtr DirectorGetNextFocusableActor(global::System.IntPtr currentFocusedActor, int direction, bool loopEnabled) { - return View.getCPtr(GetNextFocusableView(new View(currentFocusedActor, false), (View.FocusDirection)direction, loopEnabled)).Handle; + View view = GetNextFocusableView(Registry.GetManagedBaseHandleFromNativePtr(currentFocusedActor) as View, (View.FocusDirection)direction, loopEnabled); + if (view) + { + return View.getCPtr(view).Handle; + } + else + { + return currentFocusedActor; + } } private void DirectorOnFocusChangeCommitted(global::System.IntPtr commitedFocusableView) { - OnFocusChangeCommitted(new View(commitedFocusableView, false)); + OnFocusChangeCommitted(Registry.GetManagedBaseHandleFromNativePtr(commitedFocusableView) as View); } private bool DirectorOnKeyboardEnter() diff --git a/src/Tizen.NUI/src/public/Animation.cs b/src/Tizen.NUI/src/public/Animation.cs index 83b129f..3169ad3 100755 --- a/src/Tizen.NUI/src/public/Animation.cs +++ b/src/Tizen.NUI/src/public/Animation.cs @@ -767,7 +767,7 @@ namespace Tizen.NUI /// Handle to an Animation object or an uninitialized handle public static Animation DownCast(BaseHandle handle) { - Animation ret = new Animation(NDalicPINVOKE.Animation_DownCast(BaseHandle.getCPtr(handle)), true); + Animation ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Animation; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs b/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs index 27be697..5182c4f 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs @@ -183,7 +183,7 @@ namespace Tizen.NUI.BaseComponents [Obsolete("Please do not use! this will be deprecated")] public new static ImageView DownCast(BaseHandle handle) { - ImageView ret = new ImageView(NDalicPINVOKE.ImageView_DownCast(BaseHandle.getCPtr(handle)), true); + ImageView ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as ImageView; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/src/Tizen.NUI/src/public/BaseComponents/TableView.cs b/src/Tizen.NUI/src/public/BaseComponents/TableView.cs index 5744fc0..48b57d3 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TableView.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TableView.cs @@ -318,7 +318,7 @@ namespace Tizen.NUI.BaseComponents [Obsolete("Please do not use! this will be deprecated")] public new static TableView DownCast(BaseHandle handle) { - TableView ret = new TableView(NDalicPINVOKE.TableView_DownCast(BaseHandle.getCPtr(handle)), true); + TableView ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as TableView; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -344,7 +344,9 @@ namespace Tizen.NUI.BaseComponents /// Child that was in the cell or an uninitialized handle public View GetChildAt(TableView.CellPosition position) { - View ret = new View(NDalicPINVOKE.TableView_GetChildAt(swigCPtr, TableView.CellPosition.getCPtr(position)), true); + IntPtr cPtr = NDalicPINVOKE.TableView_GetChildAt(swigCPtr, TableView.CellPosition.getCPtr(position)); + View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -356,7 +358,9 @@ namespace Tizen.NUI.BaseComponents /// Child that was removed or an uninitialized handle public View RemoveChildAt(TableView.CellPosition position) { - View ret = new View(NDalicPINVOKE.TableView_RemoveChildAt(swigCPtr, TableView.CellPosition.getCPtr(position)), true); + IntPtr cPtr = NDalicPINVOKE.TableView_RemoveChildAt(swigCPtr, TableView.CellPosition.getCPtr(position)); + View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs b/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs index 23d3165..288a477 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs @@ -315,7 +315,7 @@ namespace Tizen.NUI.BaseComponents [Obsolete("Please do not use! this will be deprecated")] public new static TextEditor DownCast(BaseHandle handle) { - TextEditor ret = new TextEditor(NDalicPINVOKE.TextEditor_DownCast(BaseHandle.getCPtr(handle)), true); + TextEditor ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as TextEditor; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextField.cs b/src/Tizen.NUI/src/public/BaseComponents/TextField.cs index 7b896bc..bcf1a09 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextField.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextField.cs @@ -296,7 +296,7 @@ namespace Tizen.NUI.BaseComponents [Obsolete("Please do not use! this will be deprecated")] public new static TextField DownCast(BaseHandle handle) { - TextField ret = new TextField(NDalicPINVOKE.TextField_DownCast(BaseHandle.getCPtr(handle)), true); + TextField ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as TextField; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs b/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs index bc794d7..fe53cb7 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs @@ -131,7 +131,7 @@ namespace Tizen.NUI.BaseComponents [Obsolete("Please do not use! this will be deprecated")] public new static TextLabel DownCast(BaseHandle handle) { - TextLabel ret = new TextLabel(NDalicPINVOKE.TextLabel_DownCast(BaseHandle.getCPtr(handle)), true); + TextLabel ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as TextLabel; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/src/Tizen.NUI/src/public/BaseComponents/VideoView.cs b/src/Tizen.NUI/src/public/BaseComponents/VideoView.cs index 7c380b9..0c8e0de 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/VideoView.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/VideoView.cs @@ -174,7 +174,7 @@ namespace Tizen.NUI.BaseComponents [Obsolete("Please do not use! this will be deprecated")] public new static VideoView DownCast(BaseHandle handle) { - VideoView ret = new VideoView(NDalicPINVOKE.VideoView_DownCast(BaseHandle.getCPtr(handle)), true); + VideoView ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as VideoView; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/src/Tizen.NUI/src/public/BaseComponents/View.cs b/src/Tizen.NUI/src/public/BaseComponents/View.cs index 7646242..d0ddfee 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/View.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/View.cs @@ -820,28 +820,21 @@ namespace Tizen.NUI.BaseComponents if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - /// - /// Downcasts a handle to View handle.
- /// If handle points to a View, the downcast produces valid handle.
- /// If not, the returned handle is left uninitialized.
- ///
- /// Handle to an object - /// A handle to a View or an uninitialized handle - [Obsolete("Please do not use! this will be deprecated")] + [Obsolete("Please do not use! this will be deprecated, instead please us as keyword.")] public new static View DownCast(BaseHandle handle) { - View ret = new View(NDalicPINVOKE.View_DownCast(BaseHandle.getCPtr(handle)), true); + View ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as View; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } - [Obsolete("Please do not use! this will be deprecated")] + [Obsolete("Please do not use! this will be deprecated, instead please us as keyword.")] public static T DownCast(View view) where T : View { - View ret = Registry.GetManagedBaseHandleFromNativePtr(view) as View; + T ret = Registry.GetManagedBaseHandleFromNativePtr(view) as T; if (ret != null) { - return (T)ret; + return ret; } return null; } @@ -2021,7 +2014,9 @@ namespace Tizen.NUI.BaseComponents internal Layer GetLayer() { - Layer ret = new Layer(NDalicPINVOKE.Actor_GetLayer(swigCPtr), true); + IntPtr cPtr = NDalicPINVOKE.Actor_GetLayer(swigCPtr); + Layer ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Layer; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; @@ -2719,7 +2714,9 @@ namespace Tizen.NUI.BaseComponents public Renderer GetRendererAt(uint index) { - Renderer ret = new Renderer(NDalicPINVOKE.Actor_GetRendererAt(swigCPtr, index), true); + IntPtr cPtr = NDalicPINVOKE.Actor_GetRendererAt(swigCPtr, index); + Renderer ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Renderer; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; diff --git a/src/Tizen.NUI/src/public/BaseComponents/VisualView.cs b/src/Tizen.NUI/src/public/BaseComponents/VisualView.cs index f88b1ff..dc36895 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/VisualView.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/VisualView.cs @@ -104,7 +104,7 @@ namespace Tizen.NUI.BaseComponents if (visualIndex > 0) { - visual = VisualFactory.Get().CreateVisual(visualMap.OutputVisualMap); // Create a visual for the new one. + visual = VisualFactory.Instance.CreateVisual(visualMap.OutputVisualMap); // Create a visual for the new one. visual.Name = visualName; visual.DepthIndex = visualMap.DepthIndex; @@ -190,7 +190,7 @@ namespace Tizen.NUI.BaseComponents { VisualBase visual = null; - visual = VisualFactory.Get().CreateVisual(visualMap.OutputVisualMap); + visual = VisualFactory.Instance.CreateVisual(visualMap.OutputVisualMap); visual.Name = visualName; visual.DepthIndex = visualMap.DepthIndex; diff --git a/src/Tizen.NUI/src/public/CustomView/Spin.cs b/src/Tizen.NUI/src/public/CustomView/Spin.cs index f208769..cfed4a8 100755 --- a/src/Tizen.NUI/src/public/CustomView/Spin.cs +++ b/src/Tizen.NUI/src/public/CustomView/Spin.cs @@ -87,7 +87,7 @@ namespace Tizen.NUI // Create image visual for the arrow keys _arrowVisualPropertyIndex = RegisterProperty("ArrowImage", new PropertyValue(_arrowImage), Tizen.NUI.PropertyAccessMode.ReadWrite); - _arrowVisual = VisualFactory.Get().CreateVisual( + _arrowVisual = VisualFactory.Instance.CreateVisual( new PropertyMap().Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Image)) .Add(ImageVisualProperty.URL, new PropertyValue(_arrowImage)) .Add(ImageVisualProperty.DesiredHeight, new PropertyValue(150)) @@ -187,9 +187,8 @@ namespace Tizen.NUI } else { - // Return a native empty handle as nothing can be focused in the left or right - nextFocusedView = new View(); - nextFocusedView.Reset(); + // Return null + return null; } return nextFocusedView; @@ -378,7 +377,7 @@ namespace Tizen.NUI set { _arrowImage = value; - _arrowVisual = VisualFactory.Get().CreateVisual( + _arrowVisual = VisualFactory.Instance.CreateVisual( new PropertyMap().Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Image)) .Add(ImageVisualProperty.URL, new PropertyValue(_arrowImage)) .Add(ImageVisualProperty.DesiredHeight, new PropertyValue(150)) diff --git a/src/Tizen.NUI/src/public/KeyFrames.cs b/src/Tizen.NUI/src/public/KeyFrames.cs index 8b58ce5..92abafb 100755 --- a/src/Tizen.NUI/src/public/KeyFrames.cs +++ b/src/Tizen.NUI/src/public/KeyFrames.cs @@ -105,7 +105,7 @@ namespace Tizen.NUI [Obsolete("Please do not use! this will be deprecated")] public static KeyFrames DownCast(BaseHandle handle) { - KeyFrames ret = new KeyFrames(NDalicPINVOKE.KeyFrames_DownCast(BaseHandle.getCPtr(handle)), true); + KeyFrames ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as KeyFrames; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/src/Tizen.NUI/src/public/Layer.cs b/src/Tizen.NUI/src/public/Layer.cs index 474146c..17179f8 100755 --- a/src/Tizen.NUI/src/public/Layer.cs +++ b/src/Tizen.NUI/src/public/Layer.cs @@ -103,7 +103,7 @@ namespace Tizen.NUI [Obsolete("Please do not use! this will be deprecated")] public new static Layer DownCast(BaseHandle handle) { - Layer ret = new Layer(NDalicPINVOKE.Layer_DownCast(BaseHandle.getCPtr(handle)), true); + Layer ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Layer; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -117,7 +117,9 @@ namespace Tizen.NUI /// A handle to the view if found, or an empty handle if not. public View FindChildById(uint id) { - View ret = new View(NDalicPINVOKE.Actor_FindChildById(swigCPtr, id), true); + IntPtr cPtr = NDalicPINVOKE.Actor_FindChildById(swigCPtr, id); + View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; diff --git a/src/Tizen.NUI/src/public/Path.cs b/src/Tizen.NUI/src/public/Path.cs index 4090eaa..a13eb6a 100755 --- a/src/Tizen.NUI/src/public/Path.cs +++ b/src/Tizen.NUI/src/public/Path.cs @@ -88,7 +88,7 @@ namespace Tizen.NUI [Obsolete("Please do not use! this will be deprecated")] public new static Path DownCast(BaseHandle handle) { - Path ret = new Path(NDalicPINVOKE.Path_DownCast(BaseHandle.getCPtr(handle)), true); + Path ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Path; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/src/Tizen.NUI/src/public/Renderer.cs b/src/Tizen.NUI/src/public/Renderer.cs index d875000..6ff2db2 100755 --- a/src/Tizen.NUI/src/public/Renderer.cs +++ b/src/Tizen.NUI/src/public/Renderer.cs @@ -107,7 +107,9 @@ namespace Tizen.NUI public Geometry GetGeometry() { - Geometry ret = new Geometry(NDalicPINVOKE.Renderer_GetGeometry(swigCPtr), true); + System.IntPtr cPtr = NDalicPINVOKE.Renderer_GetGeometry(swigCPtr); + Geometry ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Geometry; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -126,7 +128,9 @@ namespace Tizen.NUI public TextureSet GetTextures() { - TextureSet ret = new TextureSet(NDalicPINVOKE.Renderer_GetTextures(swigCPtr), true); + System.IntPtr cPtr = NDalicPINVOKE.Renderer_GetTextures(swigCPtr); + TextureSet ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as TextureSet; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -139,7 +143,9 @@ namespace Tizen.NUI public Shader GetShader() { - Shader ret = new Shader(NDalicPINVOKE.Renderer_GetShader(swigCPtr), true); + System.IntPtr cPtr = NDalicPINVOKE.Renderer_GetShader(swigCPtr); + Shader ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Shader; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/src/Tizen.NUI/src/public/TextureSet.cs b/src/Tizen.NUI/src/public/TextureSet.cs index c7ee739..cbb0394 100755 --- a/src/Tizen.NUI/src/public/TextureSet.cs +++ b/src/Tizen.NUI/src/public/TextureSet.cs @@ -78,7 +78,9 @@ namespace Tizen.NUI public Texture GetTexture(uint index) { - Texture ret = new Texture(NDalicPINVOKE.TextureSet_GetTexture(swigCPtr, index), true); + System.IntPtr cPtr = NDalicPINVOKE.TextureSet_GetTexture(swigCPtr, index); + Texture ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Texture; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -91,7 +93,9 @@ namespace Tizen.NUI public Sampler GetSampler(uint index) { - Sampler ret = new Sampler(NDalicPINVOKE.TextureSet_GetSampler(swigCPtr, index), true); + System.IntPtr cPtr = NDalicPINVOKE.TextureSet_GetSampler(swigCPtr, index); + Sampler ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Sampler; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/src/Tizen.NUI/src/public/Timer.cs b/src/Tizen.NUI/src/public/Timer.cs index 8229740..41c9b7a 100755 --- a/src/Tizen.NUI/src/public/Timer.cs +++ b/src/Tizen.NUI/src/public/Timer.cs @@ -145,7 +145,7 @@ namespace Tizen.NUI [Obsolete("Please do not use! this will be deprecated")] public static Timer DownCast(BaseHandle handle) { - Timer ret = new Timer(NDalicPINVOKE.Timer_DownCast(BaseHandle.getCPtr(handle)), true); + Timer ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Timer; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/src/Tizen.NUI/src/public/Touch.cs b/src/Tizen.NUI/src/public/Touch.cs index a547720..a181fb5 100755 --- a/src/Tizen.NUI/src/public/Touch.cs +++ b/src/Tizen.NUI/src/public/Touch.cs @@ -70,7 +70,12 @@ namespace Tizen.NUI internal static Touch GetTouchFromPtr(global::System.IntPtr cPtr) { - Touch ret = new Touch(cPtr, false); + Touch ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Touch; + if (ret == null) + { + ret = new Touch(cPtr, false); + } + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -147,7 +152,9 @@ namespace Tizen.NUI /// The actor that was underneath the point specified public View GetHitView(uint point) { - View ret = new View(NDalicPINVOKE.Touch_GetHitActor(swigCPtr, point), true); + global::System.IntPtr cPtr = NDalicPINVOKE.Touch_GetHitActor(swigCPtr, point); + View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/src/Tizen.NUI/src/public/UIComponents/Popup.cs b/src/Tizen.NUI/src/public/UIComponents/Popup.cs index 1a933a4..24a606d 100755 --- a/src/Tizen.NUI/src/public/UIComponents/Popup.cs +++ b/src/Tizen.NUI/src/public/UIComponents/Popup.cs @@ -352,7 +352,7 @@ namespace Tizen.NUI.UIComponents [Obsolete("Please do not use! this will be deprecated")] public new static Popup DownCast(BaseHandle handle) { - Popup ret = new Popup(NDalicPINVOKE.Popup_DownCast(BaseHandle.getCPtr(handle)), true); + Popup ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Popup; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -369,7 +369,9 @@ namespace Tizen.NUI.UIComponents internal View GetTitle() { - View ret = new View(NDalicPINVOKE.Popup_GetTitle(swigCPtr), true); + IntPtr cPtr = NDalicPINVOKE.Popup_GetTitle(swigCPtr); + View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -386,7 +388,9 @@ namespace Tizen.NUI.UIComponents internal View GetContent() { - View ret = new View(NDalicPINVOKE.Popup_GetContent(swigCPtr), true); + IntPtr cPtr = NDalicPINVOKE.Popup_GetContent(swigCPtr); + View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -403,7 +407,9 @@ namespace Tizen.NUI.UIComponents internal View GetFooter() { - View ret = new View(NDalicPINVOKE.Popup_GetFooter(swigCPtr), true); + IntPtr cPtr = NDalicPINVOKE.Popup_GetFooter(swigCPtr); + View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/src/Tizen.NUI/src/public/UIComponents/PushButton.cs b/src/Tizen.NUI/src/public/UIComponents/PushButton.cs index 39bd34c..4c8ee8e 100755 --- a/src/Tizen.NUI/src/public/UIComponents/PushButton.cs +++ b/src/Tizen.NUI/src/public/UIComponents/PushButton.cs @@ -93,7 +93,7 @@ namespace Tizen.NUI.UIComponents [Obsolete("Please do not use! this will be deprecated")] public new static PushButton DownCast(BaseHandle handle) { - PushButton ret = new PushButton(NDalicPINVOKE.PushButton_DownCast(BaseHandle.getCPtr(handle)), true); + PushButton ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as PushButton; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/src/Tizen.NUI/src/public/UIComponents/ScrollBar.cs b/src/Tizen.NUI/src/public/UIComponents/ScrollBar.cs index d1d619f..51417f2 100755 --- a/src/Tizen.NUI/src/public/UIComponents/ScrollBar.cs +++ b/src/Tizen.NUI/src/public/UIComponents/ScrollBar.cs @@ -225,7 +225,7 @@ namespace Tizen.NUI.UIComponents [Obsolete("Please do not use! this will be deprecated")] public new static ScrollBar DownCast(BaseHandle handle) { - ScrollBar ret = new ScrollBar(NDalicPINVOKE.ScrollBar_DownCast(BaseHandle.getCPtr(handle)), true); + ScrollBar ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as ScrollBar; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/src/Tizen.NUI/src/public/UIComponents/Slider.cs b/src/Tizen.NUI/src/public/UIComponents/Slider.cs index 6783fe0..a7d6882 100755 --- a/src/Tizen.NUI/src/public/UIComponents/Slider.cs +++ b/src/Tizen.NUI/src/public/UIComponents/Slider.cs @@ -474,7 +474,7 @@ namespace Tizen.NUI.UIComponents /// Handle to a Slider or an uninitialized handle public new static Slider DownCast(BaseHandle handle) { - Slider ret = new Slider(NDalicPINVOKE.Slider_DownCast(BaseHandle.getCPtr(handle)), true); + Slider ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Slider; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/src/Tizen.NUI/src/public/VisualFactory.cs b/src/Tizen.NUI/src/public/VisualFactory.cs index 9c6e7c2..5d40948 100755 --- a/src/Tizen.NUI/src/public/VisualFactory.cs +++ b/src/Tizen.NUI/src/public/VisualFactory.cs @@ -70,7 +70,7 @@ namespace Tizen.NUI /// Create or retrieve VisualFactory singleton. /// /// A handle to the VisualFactory control. - public static VisualFactory Get() + private static VisualFactory Get() { VisualFactory ret = new VisualFactory(NDalicPINVOKE.VisualFactory_Get(), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/public/Window.cs b/src/Tizen.NUI/src/public/Window.cs index 793e1a5..6a1e21a 100755 --- a/src/Tizen.NUI/src/public/Window.cs +++ b/src/Tizen.NUI/src/public/Window.cs @@ -558,7 +558,9 @@ namespace Tizen.NUI public Layer GetLayer(uint depth) { - Layer ret = new Layer(NDalicPINVOKE.Stage_GetLayer(stageCPtr, depth), true); + IntPtr cPtr = NDalicPINVOKE.Stage_GetLayer(stageCPtr, depth); + Layer ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Layer; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -661,7 +663,7 @@ namespace Tizen.NUI internal ResizedSignal ResizedSignal() { - ResizedSignal ret = new ResizedSignal(NDalicManualPINVOKE.Window_ResizedSignal(stageCPtr), false); + ResizedSignal ret = new ResizedSignal(NDalicManualPINVOKE.Window_ResizedSignal(swigCPtr), false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -1179,7 +1181,7 @@ namespace Tizen.NUI private WindowResizedEventCallbackType _windowResizedEventCallback; [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void WindowResizedEventCallbackType(Size2D windowSize); + private delegate void WindowResizedEventCallbackType(IntPtr windowSize); private event EventHandler _windowResizedEventHandler; public event EventHandler Resized @@ -1205,10 +1207,12 @@ namespace Tizen.NUI } } - private void OnResized(Size2D windowSize) + private void OnResized(IntPtr windowSize) { ResizedEventArgs e = new ResizedEventArgs(); - e.WindowSize = windowSize; + var val = new Uint16Pair(windowSize, false); + e.WindowSize = new Size2D(val.GetWidth(), val.GetHeight()); + val.Dispose(); if (_windowResizedEventHandler != null) { @@ -1224,7 +1228,10 @@ namespace Tizen.NUI internal Size2D GetWindowSize() { - Size2D ret = new Size2D(NDalicManualPINVOKE.GetSize(swigCPtr), true); + var val = new Uint16Pair(NDalicManualPINVOKE.GetSize(swigCPtr), false); + Size2D ret = new Size2D(val.GetWidth(), val.GetHeight()); + val.Dispose(); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } -- 2.7.4