X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2FTizen.NUI%2Fsrc%2Finternal%2FViewWrapperImpl.cs;h=fe457b53e717316afe0750cc1f9b6d3c7eb40f57;hb=46b8a31f5c1c75a22b648ca394a4de8a50898513;hp=94e182e16d431484b2b84a4d4d570901685b448a;hpb=b60d5fc9b0fdc923893d7434cba320fd69653e3a;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git diff --git a/src/Tizen.NUI/src/internal/ViewWrapperImpl.cs b/src/Tizen.NUI/src/internal/ViewWrapperImpl.cs index 94e182e..fe457b5 100755 --- a/src/Tizen.NUI/src/internal/ViewWrapperImpl.cs +++ b/src/Tizen.NUI/src/internal/ViewWrapperImpl.cs @@ -14,91 +14,131 @@ * limitations under the License. * */ +using System.Runtime.InteropServices; using Tizen.NUI.BaseComponents; + namespace Tizen.NUI { internal sealed class ViewWrapperImpl : ViewImpl { private global::System.Runtime.InteropServices.HandleRef swigCPtr; + /// 3 public delegate void OnStageConnectionDelegate(int depth); + /// 3 public delegate void OnStageDisconnectionDelegate(); + /// 3 public delegate void OnChildAddDelegate(View view); + /// 3 public delegate void OnChildRemoveDelegate(View view); + /// 3 public delegate void OnPropertySetDelegate(int index, PropertyValue propertyValue); + /// 3 public delegate void OnSizeSetDelegate(Vector3 targetSize); + /// 3 public delegate void OnSizeAnimationDelegate(Animation animation, Vector3 targetSize); + /// 3 public delegate bool OnTouchDelegate(Touch touch); + /// 3 public delegate bool OnHoverDelegate(Hover hover); + /// 3 public delegate bool OnKeyDelegate(Key key); + /// 3 public delegate bool OnWheelDelegate(Wheel wheel); + /// 3 public delegate void OnRelayoutDelegate(Vector2 size, RelayoutContainer container); + /// 3 public delegate void OnSetResizePolicyDelegate(ResizePolicyType policy, DimensionType dimension); + /// 3 public delegate Size2D GetNaturalSizeDelegate(); + /// 3 public delegate float CalculateChildSizeDelegate(View child, DimensionType dimension); + /// 3 public delegate float GetHeightForWidthDelegate(float width); + /// 3 public delegate float GetWidthForHeightDelegate(float height); + /// 3 public delegate bool RelayoutDependentOnChildrenDimensionDelegate(DimensionType dimension); + /// 3 public delegate bool RelayoutDependentOnChildrenDelegate(); + /// 3 public delegate void OnCalculateRelayoutSizeDelegate(DimensionType dimension); + /// 3 public delegate void OnLayoutNegotiatedDelegate(float size, DimensionType dimension); + /// 3 public delegate void OnControlChildAddDelegate(View child); + /// 3 public delegate void OnControlChildRemoveDelegate(View child); + /// 3 public delegate void OnStyleChangeDelegate(StyleManager styleManager, StyleChangeType change); + /// 3 public delegate bool OnAccessibilityActivatedDelegate(); + /// 3 public delegate bool OnAccessibilityPanDelegate(PanGesture gestures); + /// 3 public delegate bool OnAccessibilityTouchDelegate(Touch touch); + /// 3 public delegate bool OnAccessibilityValueChangeDelegate(bool isIncrease); + /// 3 public delegate bool OnAccessibilityZoomDelegate(); + /// 3 public delegate void OnFocusGainedDelegate(); + /// 3 public delegate void OnFocusLostDelegate(); + /// 3 public delegate View GetNextFocusableViewDelegate(View currentFocusedView, View.FocusDirection direction, bool loopEnabled); + /// 3 public delegate void OnFocusChangeCommittedDelegate(View commitedFocusableView); + /// 3 public delegate bool OnKeyboardEnterDelegate(); + /// 3 public delegate void OnPinchDelegate(PinchGesture pinch); + /// 3 public delegate void OnPanDelegate(PanGesture pan); + /// 3 public delegate void OnTapDelegate(TapGesture tap); + /// 3 public delegate void OnLongPressDelegate(LongPressGesture longPress); - public OnStageConnectionDelegate OnStageConnection; - public OnStageDisconnectionDelegate OnStageDisconnection; - public OnChildAddDelegate OnChildAdd; - public OnChildRemoveDelegate OnChildRemove; - public OnPropertySetDelegate OnPropertySet; - public OnSizeSetDelegate OnSizeSet; - public OnSizeAnimationDelegate OnSizeAnimation; + public new OnStageConnectionDelegate OnStageConnection; + public new OnStageDisconnectionDelegate OnStageDisconnection; + public new OnChildAddDelegate OnChildAdd; + public new OnChildRemoveDelegate OnChildRemove; + public new OnPropertySetDelegate OnPropertySet; + public new OnSizeSetDelegate OnSizeSet; + public new OnSizeAnimationDelegate OnSizeAnimation; public OnTouchDelegate OnTouch; public OnHoverDelegate OnHover; public OnKeyDelegate OnKey; public OnWheelDelegate OnWheel; - public OnRelayoutDelegate OnRelayout; - public OnSetResizePolicyDelegate OnSetResizePolicy; - public GetNaturalSizeDelegate GetNaturalSize; - public CalculateChildSizeDelegate CalculateChildSize; - public GetHeightForWidthDelegate GetHeightForWidth; - public GetWidthForHeightDelegate GetWidthForHeight; + public new OnRelayoutDelegate OnRelayout; + public new OnSetResizePolicyDelegate OnSetResizePolicy; + public new GetNaturalSizeDelegate GetNaturalSize; + public new CalculateChildSizeDelegate CalculateChildSize; + public new GetHeightForWidthDelegate GetHeightForWidth; + public new GetWidthForHeightDelegate GetWidthForHeight; public RelayoutDependentOnChildrenDimensionDelegate RelayoutDependentOnChildrenDimension; - public RelayoutDependentOnChildrenDelegate RelayoutDependentOnChildren; - public OnCalculateRelayoutSizeDelegate OnCalculateRelayoutSize; - public OnLayoutNegotiatedDelegate OnLayoutNegotiated; - public OnControlChildAddDelegate OnControlChildAdd; - public OnControlChildRemoveDelegate OnControlChildRemove; - public OnStyleChangeDelegate OnStyleChange; - public OnAccessibilityActivatedDelegate OnAccessibilityActivated; - public OnAccessibilityPanDelegate OnAccessibilityPan; - public OnAccessibilityTouchDelegate OnAccessibilityTouch; - public OnAccessibilityValueChangeDelegate OnAccessibilityValueChange; - public OnAccessibilityZoomDelegate OnAccessibilityZoom; + public new RelayoutDependentOnChildrenDelegate RelayoutDependentOnChildren; + public new OnCalculateRelayoutSizeDelegate OnCalculateRelayoutSize; + public new OnLayoutNegotiatedDelegate OnLayoutNegotiated; + public new OnControlChildAddDelegate OnControlChildAdd; + public new OnControlChildRemoveDelegate OnControlChildRemove; + public new OnStyleChangeDelegate OnStyleChange; + public new OnAccessibilityActivatedDelegate OnAccessibilityActivated; + public new OnAccessibilityPanDelegate OnAccessibilityPan; + public new OnAccessibilityTouchDelegate OnAccessibilityTouch; + public new OnAccessibilityValueChangeDelegate OnAccessibilityValueChange; + public new OnAccessibilityZoomDelegate OnAccessibilityZoom; public OnFocusGainedDelegate OnFocusGained; public OnFocusLostDelegate OnFocusLost; - public GetNextFocusableViewDelegate GetNextFocusableView; - public OnFocusChangeCommittedDelegate OnFocusChangeCommitted; - public OnKeyboardEnterDelegate OnKeyboardEnter; - public OnPinchDelegate OnPinch; - public OnPanDelegate OnPan; - public OnTapDelegate OnTap; - public OnLongPressDelegate OnLongPress; + public new GetNextFocusableViewDelegate GetNextFocusableView; + public new OnFocusChangeCommittedDelegate OnFocusChangeCommitted; + public new OnKeyboardEnterDelegate OnKeyboardEnter; + public new OnPinchDelegate OnPinch; + public new OnPanDelegate OnPan; + public new OnTapDelegate OnTap; + public new OnLongPressDelegate OnLongPress; - internal ViewWrapperImpl(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicManualPINVOKE.ViewWrapperImpl_SWIGUpcast(cPtr), cMemoryOwn) + internal ViewWrapperImpl(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.ViewWrapperImpl.ViewWrapperImpl_SWIGUpcast(cPtr), cMemoryOwn) { swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } @@ -115,14 +155,6 @@ namespace Tizen.NUI return; } - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - - } - //Release your own unmanaged resources here. //You should not access any managed member here except static instance. //because the execution order of Finalizes is non-deterministic. @@ -132,7 +164,6 @@ namespace Tizen.NUI if (swigCMemOwn) { swigCMemOwn = false; - NDalicManualPINVOKE.delete_ViewWrapperImpl(swigCPtr); } swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); } @@ -140,7 +171,7 @@ namespace Tizen.NUI base.Dispose(type); } - public ViewWrapperImpl(CustomViewBehaviour behaviourFlags) : this(NDalicManualPINVOKE.new_ViewWrapperImpl((int)behaviourFlags), true) + public ViewWrapperImpl(CustomViewBehaviour behaviourFlags) : this(Interop.ViewWrapperImpl.new_ViewWrapperImpl((int)behaviourFlags), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); DirectorConnect(); @@ -148,74 +179,78 @@ namespace Tizen.NUI public static ViewWrapper New(string typeName, ViewWrapperImpl viewWrapper) { - ViewWrapper ret = new ViewWrapper(NDalicManualPINVOKE.ViewWrapperImpl_New(typeName, ViewWrapperImpl.getCPtr(viewWrapper)), true); + ViewWrapper ret = new ViewWrapper(Interop.ViewWrapperImpl.ViewWrapperImpl_New(typeName, ViewWrapperImpl.getCPtr(viewWrapper)), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } public void RelayoutRequest() { - NDalicManualPINVOKE.ViewWrapperImpl_RelayoutRequest(swigCPtr); + Interop.ViewWrapperImpl.ViewWrapperImpl_RelayoutRequest(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public float GetHeightForWidthBase(float width) { - float ret = NDalicManualPINVOKE.ViewWrapperImpl_GetHeightForWidthBase(swigCPtr, width); + float ret = Interop.ViewWrapperImpl.ViewWrapperImpl_GetHeightForWidthBase(swigCPtr, width); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } public float GetWidthForHeightBase(float height) { - float ret = NDalicManualPINVOKE.ViewWrapperImpl_GetWidthForHeightBase(swigCPtr, height); + float ret = Interop.ViewWrapperImpl.ViewWrapperImpl_GetWidthForHeightBase(swigCPtr, height); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } public float CalculateChildSizeBase(View child, DimensionType dimension) { - float ret = NDalicManualPINVOKE.ViewWrapperImpl_CalculateChildSizeBase(swigCPtr, View.getCPtr(child), (int)dimension); + float ret = Interop.ViewWrapperImpl.ViewWrapperImpl_CalculateChildSizeBase(swigCPtr, View.getCPtr(child), (int)dimension); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } public bool RelayoutDependentOnChildrenBase(DimensionType dimension) { - bool ret = NDalicManualPINVOKE.ViewWrapperImpl_RelayoutDependentOnChildrenBase__SWIG_0(swigCPtr, (int)dimension); + bool ret = Interop.ViewWrapperImpl.ViewWrapperImpl_RelayoutDependentOnChildrenBase__SWIG_0(swigCPtr, (int)dimension); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } public bool RelayoutDependentOnChildrenBase() { - bool ret = NDalicManualPINVOKE.ViewWrapperImpl_RelayoutDependentOnChildrenBase__SWIG_1(swigCPtr); + bool ret = Interop.ViewWrapperImpl.ViewWrapperImpl_RelayoutDependentOnChildrenBase__SWIG_1(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } public void RegisterVisual(int index, VisualBase visual) { - NDalicManualPINVOKE.ViewWrapperImpl_RegisterVisual__SWIG_0(swigCPtr, index, VisualBase.getCPtr(visual)); + Interop.ViewWrapperImpl.ViewWrapperImpl_RegisterVisual__SWIG_0(swigCPtr, index, VisualBase.getCPtr(visual)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public void RegisterVisual(int index, VisualBase visual, bool enabled) { - NDalicManualPINVOKE.ViewWrapperImpl_RegisterVisual__SWIG_1(swigCPtr, index, VisualBase.getCPtr(visual), enabled); + Interop.ViewWrapperImpl.ViewWrapperImpl_RegisterVisual__SWIG_1(swigCPtr, index, VisualBase.getCPtr(visual), enabled); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public void UnregisterVisual(int index) { - NDalicManualPINVOKE.ViewWrapperImpl_UnregisterVisual(swigCPtr, index); + Interop.ViewWrapperImpl.ViewWrapperImpl_UnregisterVisual(swigCPtr, index); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public VisualBase GetVisual(int index) { - System.IntPtr cPtr = NDalicManualPINVOKE.ViewWrapperImpl_GetVisual(swigCPtr, index); - VisualBase ret = Registry.GetManagedBaseHandleFromRefObject(cPtr) as VisualBase; + //to fix memory leak issue, match the handle count with native side. + System.IntPtr cPtr = Interop.ViewWrapperImpl.ViewWrapperImpl_GetVisual(swigCPtr, index); + HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + VisualBase ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as VisualBase; + Interop.BaseHandle.delete_BaseHandle(CPtr); + CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; @@ -223,33 +258,33 @@ namespace Tizen.NUI public void EnableVisual(int index, bool enable) { - NDalicManualPINVOKE.ViewWrapperImpl_EnableVisual(swigCPtr, index, enable); + Interop.ViewWrapperImpl.ViewWrapperImpl_EnableVisual(swigCPtr, index, enable); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public bool IsVisualEnabled(int index) { - bool ret = NDalicManualPINVOKE.ViewWrapperImpl_IsVisualEnabled(swigCPtr, index); + bool ret = Interop.ViewWrapperImpl.ViewWrapperImpl_IsVisualEnabled(swigCPtr, index); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } public Animation CreateTransition(TransitionData transitionData) { - Animation ret = new Animation(NDalicManualPINVOKE.ViewWrapperImpl_CreateTransition(swigCPtr, TransitionData.getCPtr(transitionData)), true); + Animation ret = new Animation(Interop.ViewWrapperImpl.ViewWrapperImpl_CreateTransition(swigCPtr, TransitionData.getCPtr(transitionData)), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } public void EmitFocusSignal(bool focusGained) { - NDalicManualPINVOKE.ViewWrapperImpl_EmitKeyInputFocusSignal(swigCPtr, focusGained); + Interop.ViewWrapperImpl.ViewWrapperImpl_EmitKeyInputFocusSignal(swigCPtr, focusGained); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public void ApplyThemeStyle() { - NDalicManualPINVOKE.ViewWrapperImpl_ApplyThemeStyle(swigCPtr); + Interop.ViewWrapperImpl.ViewWrapperImpl_ApplyThemeStyle(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } @@ -294,7 +329,7 @@ namespace Tizen.NUI Delegate36 = new DelegateViewWrapperImpl_36(DirectorOnPan); Delegate37 = new DelegateViewWrapperImpl_37(DirectorOnTap); Delegate38 = new DelegateViewWrapperImpl_38(DirectorOnLongPress); - NDalicManualPINVOKE.ViewWrapperImpl_director_connect(swigCPtr, Delegate0, Delegate1, Delegate2, Delegate3, Delegate4, Delegate5, Delegate6, Delegate7, Delegate8, Delegate9, Delegate10, Delegate11, Delegate12, Delegate13, Delegate14, Delegate15, Delegate16, Delegate17, Delegate18, Delegate19, Delegate20, Delegate21, Delegate22, Delegate23, Delegate24, Delegate25, Delegate26, Delegate27, Delegate28, Delegate29, Delegate30, Delegate31, Delegate32, Delegate33, Delegate34, Delegate35, Delegate36, Delegate37, Delegate38, null, null); + Interop.ViewWrapperImpl.ViewWrapperImpl_director_connect(swigCPtr, Delegate0, Delegate1, Delegate2, Delegate3, Delegate4, Delegate5, Delegate6, Delegate7, Delegate8, Delegate9, Delegate10, Delegate11, Delegate12, Delegate13, Delegate14, Delegate15, Delegate16, Delegate17, Delegate18, Delegate19, Delegate20, Delegate21, Delegate22, Delegate23, Delegate24, Delegate25, Delegate26, Delegate27, Delegate28, Delegate29, Delegate30, Delegate31, Delegate32, Delegate33, Delegate34, Delegate35, Delegate36, Delegate37, Delegate38, null, null); } private void DirectorOnStageConnection(int depth) @@ -526,46 +561,87 @@ namespace Tizen.NUI OnLongPress(new LongPressGesture(longPress, false)); } + /// 3 public delegate void DelegateViewWrapperImpl_0(int depth); + /// 3 public delegate void DelegateViewWrapperImpl_1(); + /// 3 public delegate void DelegateViewWrapperImpl_2(global::System.IntPtr child); + /// 3 public delegate void DelegateViewWrapperImpl_3(global::System.IntPtr child); + /// 3 public delegate void DelegateViewWrapperImpl_4(int index, global::System.IntPtr propertyValue); + /// 3 public delegate void DelegateViewWrapperImpl_5(global::System.IntPtr targetSize); + /// 3 public delegate void DelegateViewWrapperImpl_6(global::System.IntPtr animation, global::System.IntPtr targetSize); + /// 3 public delegate bool DelegateViewWrapperImpl_7(global::System.IntPtr arg0); + /// 3 public delegate bool DelegateViewWrapperImpl_8(global::System.IntPtr arg0); + /// 3 public delegate bool DelegateViewWrapperImpl_9(global::System.IntPtr arg0); + /// 3 public delegate bool DelegateViewWrapperImpl_10(global::System.IntPtr arg0); + /// 3 public delegate void DelegateViewWrapperImpl_11(global::System.IntPtr size, global::System.IntPtr container); + /// 3 public delegate void DelegateViewWrapperImpl_12(int policy, int dimension); + /// 3 public delegate global::System.IntPtr DelegateViewWrapperImpl_13(); + /// 3 public delegate float DelegateViewWrapperImpl_14(global::System.IntPtr child, int dimension); + /// 3 public delegate float DelegateViewWrapperImpl_15(float width); + /// 3 public delegate float DelegateViewWrapperImpl_16(float height); + /// 3 public delegate bool DelegateViewWrapperImpl_17(int dimension); + /// 3 public delegate bool DelegateViewWrapperImpl_18(); + /// 3 public delegate void DelegateViewWrapperImpl_19(int dimension); + /// 3 public delegate void DelegateViewWrapperImpl_20(float size, int dimension); + /// 3 public delegate void DelegateViewWrapperImpl_21(); + /// 3 public delegate void DelegateViewWrapperImpl_22(global::System.IntPtr child); + /// 3 public delegate void DelegateViewWrapperImpl_23(global::System.IntPtr child); + /// 3 public delegate void DelegateViewWrapperImpl_24(global::System.IntPtr styleManager, int change); + /// 3 public delegate bool DelegateViewWrapperImpl_25(); + /// 3 public delegate bool DelegateViewWrapperImpl_26(global::System.IntPtr gesture); + /// 3 public delegate bool DelegateViewWrapperImpl_27(global::System.IntPtr touch); + /// 3 public delegate bool DelegateViewWrapperImpl_28(bool isIncrease); + /// 3 public delegate bool DelegateViewWrapperImpl_29(); + /// 3 public delegate void DelegateViewWrapperImpl_30(); + /// 3 public delegate void DelegateViewWrapperImpl_31(); + /// 3 public delegate global::System.IntPtr DelegateViewWrapperImpl_32(global::System.IntPtr currentFocusedActor, int direction, bool loopEnabled); + /// 3 public delegate void DelegateViewWrapperImpl_33(global::System.IntPtr commitedFocusableActor); + /// 3 public delegate bool DelegateViewWrapperImpl_34(); + /// 3 public delegate void DelegateViewWrapperImpl_35(global::System.IntPtr pinch); + /// 3 public delegate void DelegateViewWrapperImpl_36(global::System.IntPtr pan); + /// 3 public delegate void DelegateViewWrapperImpl_37(global::System.IntPtr tap); + /// 3 public delegate void DelegateViewWrapperImpl_38(global::System.IntPtr longPress); + /// 3 public delegate void DelegateViewWrapperImpl_39(global::System.IntPtr slotObserver, global::System.IntPtr callback); + /// 3 public delegate void DelegateViewWrapperImpl_40(global::System.IntPtr slotObserver, global::System.IntPtr callback); private DelegateViewWrapperImpl_0 Delegate0; @@ -607,9 +683,7 @@ namespace Tizen.NUI private DelegateViewWrapperImpl_36 Delegate36; private DelegateViewWrapperImpl_37 Delegate37; private DelegateViewWrapperImpl_38 Delegate38; - private DelegateViewWrapperImpl_39 Delegate39; - private DelegateViewWrapperImpl_40 Delegate40; - public static readonly int VIEW_BEHAVIOUR_FLAG_COUNT = NDalicManualPINVOKE.ViewWrapperImpl_CONTROL_BEHAVIOUR_FLAG_COUNT_get(); + public static readonly int VIEW_BEHAVIOUR_FLAG_COUNT = Interop.ViewWrapperImpl.ViewWrapperImpl_CONTROL_BEHAVIOUR_FLAG_COUNT_get(); } }