Added C# bindings for Window focus event and NPatchVisual property 79/122379/2
authorHeeyong Song <heeyong.song@samsung.com>
Fri, 31 Mar 2017 06:41:56 +0000 (15:41 +0900)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Wed, 5 Apr 2017 09:11:01 +0000 (02:11 -0700)
Change-Id: Ia4df7fae4ed598ecfa947b41c5869164d7469753

plugins/dali-swig/SWIG/adaptor/window.i
plugins/dali-swig/SWIG/dali-adaptor.i
plugins/dali-swig/SWIG/devel-properties.i
plugins/dali-swig/SWIG/signals.i [changed mode: 0644->0755]
plugins/dali-swig/manual/cpp/devel-property-wrap.cpp
plugins/dali-swig/manual/csharp/DaliEnumConstants.cs
plugins/dali-swig/manual/csharp/ManualPINVOKE.cs

index 5870e3662f59c70cd3da8a553eacc28cdd02fc48..ca70dc9a0f065c63862dbadceb53cea17ef3031c 100755 (executable)
  *
  */
 
+%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);
       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<WindowFocusChangedEventArgs> _windowFocusChangedEventHandler;
+
+    public event EventHandler<WindowFocusChangedEventArgs> 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();
index 5834e100c998e24d40948f827f352836ff744197..011437899708248fbd8de725659ae2a97a08f6d1 100755 (executable)
 %template(ApplicationSignal) Dali::Signal<void(Dali::Application&)>;
 %template(ApplicationControlSignal) Dali::Signal<void(Dali::Application&, void*)>;
 %template(TimerSignalType) Dali::Signal<bool()>;
+%template(WindowFocusSignalType) Dali::Signal<void(bool)>;
 
 
 // Application specialisation
index 30a2dfcc320d1ffd233eb79602baeeda55ee3b8f..131f16354383fdb6a1ff84f19a13bcd47cdf5375 100755 (executable)
   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 %{
old mode 100644 (file)
new mode 100755 (executable)
index 0842c9b..5605405
@@ -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& );
 
index a1d85ddaa90b2fa43131e257054fca2a7ed0c0da..573139c64380392ba351e1307af57351becb7c69 100755 (executable)
@@ -28,6 +28,7 @@
 #include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
 #include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
 #include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
+#include <dali-toolkit/devel-api/visuals/image-visual-properties-devel.h>
 
 #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
index a2565ba5d86229347259f81d3d6e3a36b9ec13f6..7a1e36e73f8fb6362faa8dbe2ac96fdafea2144b 100755 (executable)
@@ -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
index a7ce0a2dae2e4322131a0a537458de7b0bf07b5c..3998705f32ec08d1350d03296af865eefc3342f6 100755 (executable)
@@ -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();
     }
 }