X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=plugins%2Fdali-swig%2FSWIG%2Fdali-gc.i;h=cf7bdab3896cd9d1ff7d3a9089b5db0a84645856;hp=2e860458560c4d3c68f2ed1536fcc594cdf6000c;hb=refs%2Fchanges%2F15%2F112215%2F14;hpb=139f1932acd42bbc9ad3c89c86d4f500052e1ef1 diff --git a/plugins/dali-swig/SWIG/dali-gc.i b/plugins/dali-swig/SWIG/dali-gc.i index 2e86045..cf7bdab 100644 --- a/plugins/dali-swig/SWIG/dali-gc.i +++ b/plugins/dali-swig/SWIG/dali-gc.i @@ -66,6 +66,57 @@ %} %enddef +%define DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( NameSpace, ClassName, NewClassName ) +%typemap(csfinalize) NameSpace::ClassName %{ + ~NewClassName() { + DisposeQueue.Instance.Add(this); + } +%} +%enddef + +%define DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( NameSpace, ClassName, NewClassName ) +%typemap(csdestruct, methodname="Dispose", methodmodifiers="public") NameSpace::ClassName %{{ + if (!Stage.IsInstalled()) { + DisposeQueue.Instance.Add(this); + return; + } + + lock(this) { + if (swigCPtr.Handle != global::System.IntPtr.Zero) { + if (swigCMemOwn) { + swigCMemOwn = false; + NDalicPINVOKE.delete_##NewClassName(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + global::System.GC.SuppressFinalize(this); + } + } +%} +%enddef + +%define DALI_CREATE_CUSTOM_DISPOSE_DERIVED_FUNCTION_RENAME( NameSpace, ClassName, NewClassName ) +%typemap(csdestruct_derived, methodname="Dispose", methodmodifiers="public") NameSpace::ClassName %{{ + if (!Stage.IsInstalled()) { + DisposeQueue.Instance.Add(this); + return; + } + + lock(this) { + if (swigCPtr.Handle != global::System.IntPtr.Zero) { + if (swigCMemOwn) { + swigCMemOwn = false; + NDalicPINVOKE.delete_##NewClassName(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + global::System.GC.SuppressFinalize(this); + base.Dispose(); + } + } +%} +%enddef + %define DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_VIDEOVIEWSIGNAL( NameSpace, ClassName ) %typemap(csfinalize) NameSpace::ClassName %{ ~VideoViewSignal() { @@ -996,7 +1047,7 @@ %define DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_STAGESIGNAL( NameSpace, ClassName ) %typemap(csfinalize) NameSpace::ClassName %{ - ~StageWheelEventSignal() { + ~StageWheelSignal() { DisposeQueue.Instance.Add(this); } %} @@ -1013,7 +1064,7 @@ if (swigCPtr.Handle != global::System.IntPtr.Zero) { if (swigCMemOwn) { swigCMemOwn = false; - NDalicPINVOKE.delete_StageWheelEventSignal(swigCPtr); + NDalicPINVOKE.delete_StageWheelSignal(swigCPtr); } swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); } @@ -1205,12 +1256,14 @@ DALI_CREATE_CUSTOM_DISPOSE_DERIVED_FUNCTION( Dali, LongPressGesture ); DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION( Dali, LongPressGestureDetector ); DALI_CREATE_CUSTOM_DISPOSE_DERIVED_FUNCTION( Dali, LongPressGestureDetector ); -DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION( Dali, KeyEvent ); -DALI_CREATE_CUSTOM_DISPOSE_FUNCTION( Dali, KeyEvent ); +DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, KeyEvent, Key ); +DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, KeyEvent, Key ); +DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, HoverEvent, Hover ); +DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, HoverEvent, Hover ); DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION( Dali, TouchEvent ); DALI_CREATE_CUSTOM_DISPOSE_FUNCTION( Dali, TouchEvent ); -DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION( Dali, WheelEvent ); -DALI_CREATE_CUSTOM_DISPOSE_FUNCTION( Dali, WheelEvent ); +DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, WheelEvent, Wheel ); +DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, WheelEvent, Wheel ); DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION( Dali, Renderer ); DALI_CREATE_CUSTOM_DISPOSE_DERIVED_FUNCTION( Dali, Renderer ); @@ -1295,8 +1348,8 @@ DALI_CREATE_CUSTOM_DISPOSE_DERIVED_FUNCTION( Dali, PathConstrainer ); DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION( Dali, TouchPoint ); DALI_CREATE_CUSTOM_DISPOSE_FUNCTION( Dali, TouchPoint ); -DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION( Dali, TouchData ); -DALI_CREATE_CUSTOM_DISPOSE_DERIVED_FUNCTION( Dali, TouchData ); +DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, TouchData, Touch ); +DALI_CREATE_CUSTOM_DISPOSE_DERIVED_FUNCTION_RENAME( Dali, TouchData, Touch ); DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION( Dali, Application ); DALI_CREATE_CUSTOM_DISPOSE_DERIVED_FUNCTION( Dali, Application );