From: Heeyong Song Date: Fri, 31 Mar 2017 06:41:56 +0000 (+0900) Subject: Added C# bindings for Window focus event and NPatchVisual property X-Git-Tag: dali_1.2.34~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=13f7f10f99c5253c500ffd644a1ac4a9039d4a07;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git Added C# bindings for Window focus event and NPatchVisual property Change-Id: Ia4df7fae4ed598ecfa947b41c5869164d7469753 --- diff --git a/plugins/dali-swig/SWIG/adaptor/window.i b/plugins/dali-swig/SWIG/adaptor/window.i index 5870e36..ca70dc9 100755 --- a/plugins/dali-swig/SWIG/adaptor/window.i +++ b/plugins/dali-swig/SWIG/adaptor/window.i @@ -15,7 +15,26 @@ * */ +%typemap(csimports) Dali::Window %{ + using System; + using System.Runtime.InteropServices; +%} + + %typemap(cscode) Dali::Window %{ + + public void SetAcceptFocus( bool accept ) + { + NDalicPINVOKE.SetAcceptFocus(swigCPtr, accept); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + public bool IsFocusAcceptable() + { + return NDalicPINVOKE.IsFocusAcceptable(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + public void Show() { NDalicPINVOKE.Show(swigCPtr); @@ -33,4 +52,62 @@ NDalicPINVOKE.IsVisible(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } + + public class WindowFocusChangedEventArgs : EventArgs + { + public bool FocusGained + { + get; + set; + } + } + + private WindowFocusChangedEventCallbackType _windowFocusChangedEventCallback; + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void WindowFocusChangedEventCallbackType(bool focusGained); + private event EventHandler _windowFocusChangedEventHandler; + + public event EventHandler WindowFocusChanged + { + add + { + if (_windowFocusChangedEventHandler == null) + { + _windowFocusChangedEventCallback = OnWindowFocusedChanged; + WindowFocusChangedSignal().Connect(_windowFocusChangedEventCallback); + } + + _windowFocusChangedEventHandler += value; + } + remove + { + _windowFocusChangedEventHandler -= value; + + if (_windowFocusChangedEventHandler == null && _windowFocusChangedEventCallback != null) + { + WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback); + } + } + } + + private void OnWindowFocusedChanged(bool focusGained) + { + WindowFocusChangedEventArgs e = new WindowFocusChangedEventArgs(); + + e.FocusGained = focusGained; + + if (_windowFocusChangedEventHandler != null) + { + _windowFocusChangedEventHandler(this, e); + } + } + + public WindowFocusSignalType WindowFocusChangedSignal() { + WindowFocusSignalType ret = new WindowFocusSignalType(NDalicPINVOKE.FocusChangedSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + %} + +%ignore Dali::Window::IndicatorVisibilityChangedSignal(); diff --git a/plugins/dali-swig/SWIG/dali-adaptor.i b/plugins/dali-swig/SWIG/dali-adaptor.i index 5834e10..0114378 100755 --- a/plugins/dali-swig/SWIG/dali-adaptor.i +++ b/plugins/dali-swig/SWIG/dali-adaptor.i @@ -107,6 +107,7 @@ %template(ApplicationSignal) Dali::Signal; %template(ApplicationControlSignal) Dali::Signal; %template(TimerSignalType) Dali::Signal; +%template(WindowFocusSignalType) Dali::Signal; // Application specialisation diff --git a/plugins/dali-swig/SWIG/devel-properties.i b/plugins/dali-swig/SWIG/devel-properties.i index 30a2dfc..131f163 100755 --- a/plugins/dali-swig/SWIG/devel-properties.i +++ b/plugins/dali-swig/SWIG/devel-properties.i @@ -19,11 +19,15 @@ public static readonly int VISUAL_PROPERTY_TRANSFORM = NDalicManualPINVOKE.Visual_Property_TRANSFORM_get(); public static readonly int VISUAL_PROPERTY_PREMULTIPLIED_ALPHA = NDalicManualPINVOKE.Visual_Property_PREMULTIPLIED_ALPHA_get(); public static readonly int VISUAL_PROPERTY_MIX_COLOR = NDalicManualPINVOKE.Visual_Property_MIX_COLOR_get(); + public static readonly int IMAGE_VISUAL_BORDER = NDalicManualPINVOKE.Image_Visual_BORDER_get(); %} %typemap(cscode) Dali::Toolkit::Visual::Type %{ , - TEXT + TEXT, + N_PATCH, + SVG, + ANIMATED_IMAGE %} %typemap(cscode) Dali::Actor::Property %{ diff --git a/plugins/dali-swig/SWIG/signals.i b/plugins/dali-swig/SWIG/signals.i old mode 100644 new mode 100755 index 0842c9b..5605405 --- a/plugins/dali-swig/SWIG/signals.i +++ b/plugins/dali-swig/SWIG/signals.i @@ -265,6 +265,9 @@ DALI_SIGNAL_1_PARAM( Dali::Actor ); // Signal< void (float) > DALI_SIGNAL_1_PARAM( float ); +// Signal< void (bool) > +DALI_SIGNAL_1_PARAM( bool ); + // Signal< void (Dali::Application&) > DALI_SIGNAL_1_PARAM( Dali::Application& ); diff --git a/plugins/dali-swig/manual/cpp/devel-property-wrap.cpp b/plugins/dali-swig/manual/cpp/devel-property-wrap.cpp index a1d85dd..573139c 100755 --- a/plugins/dali-swig/manual/cpp/devel-property-wrap.cpp +++ b/plugins/dali-swig/manual/cpp/devel-property-wrap.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #ifdef __cplusplus extern "C" { @@ -231,6 +232,15 @@ SWIGEXPORT int SWIGSTDCALL CSharp_Visual_Property_MIX_COLOR_get() { return jresult; } +SWIGEXPORT int SWIGSTDCALL CSharp_Image_Visual_BORDER_get() { + int jresult ; + int result; + + result = (int)Dali::Toolkit::DevelImageVisual::Property::BORDER; + jresult = (int)result; + return jresult; +} + #ifdef __cplusplus } #endif diff --git a/plugins/dali-swig/manual/csharp/DaliEnumConstants.cs b/plugins/dali-swig/manual/csharp/DaliEnumConstants.cs index a2565ba..7a1e36e 100755 --- a/plugins/dali-swig/manual/csharp/DaliEnumConstants.cs +++ b/plugins/dali-swig/manual/csharp/DaliEnumConstants.cs @@ -82,7 +82,10 @@ namespace Dali Mesh = Dali.VisualType.MESH, Primitive = Dali.VisualType.PRIMITIVE, WireFrame = Dali.VisualType.WIREFRAME, - Text = Dali.VisualType.TEXT + Text = Dali.VisualType.TEXT, + NPatch = Dali.VisualType.N_PATCH, + Svg = Dali.VisualType.SVG, + AnimatedImage = Dali.VisualType.ANIMATED_IMAGE } public struct Property @@ -140,6 +143,7 @@ namespace Dali public static readonly int PixelArea = NDalic.IMAGE_VISUAL_PIXEL_AREA; public static readonly int WrapModeU = NDalic.IMAGE_VISUAL_WRAP_MODE_U; public static readonly int WrapModeV = NDalic.IMAGE_VISUAL_WRAP_MODE_V; + public static readonly int Border = NDalic.IMAGE_VISUAL_BORDER; } public struct MeshVisualProperty diff --git a/plugins/dali-swig/manual/csharp/ManualPINVOKE.cs b/plugins/dali-swig/manual/csharp/ManualPINVOKE.cs index a7ce0a2..3998705 100755 --- a/plugins/dali-swig/manual/csharp/ManualPINVOKE.cs +++ b/plugins/dali-swig/manual/csharp/ManualPINVOKE.cs @@ -270,5 +270,8 @@ namespace Dali [global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_Visual_Property_MIX_COLOR_get")] public static extern int Visual_Property_MIX_COLOR_get(); + + [global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_Image_Visual_BORDER_get")] + public static extern int Image_Visual_BORDER_get(); } }