Manual binding for TextEditor,TextField,Application,Window
authorxb.teng <xb.teng@samsung.com>
Tue, 4 Jul 2017 10:39:26 +0000 (18:39 +0800)
committerxb.teng <xb.teng@samsung.com>
Thu, 13 Jul 2017 07:15:35 +0000 (15:15 +0800)
Here are changes:
1. Add EnableSelection,Placeholder property for TextEditor;
2. Add EnableSelection,Placeholder for TextField;
3. Add WindowSize,WindowPosition property for window;
4. Add a new constuctor for Application;
5. Rpdate Resized event argument for Window;
6. Fix a dispose issue of ImageView.

Change-Id: I34280cba24fdb28cfbaa5bc160350a579efe0358

src/Tizen.NUI/src/internal/Application.cs
src/Tizen.NUI/src/internal/ManualPINVOKE.cs
src/Tizen.NUI/src/internal/NDalicPINVOKE.cs
src/Tizen.NUI/src/internal/ResizedSignal.cs
src/Tizen.NUI/src/public/BaseComponents/ImageView.cs
src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs
src/Tizen.NUI/src/public/BaseComponents/TextField.cs
src/Tizen.NUI/src/public/Window.cs

index d3b8e47..45ef896 100755 (executable)
@@ -1179,6 +1179,13 @@ namespace Tizen.NUI
             return ret;
         }
 
+        public static Application New(int argc, string stylesheet, Application.WindowMode windowMode, Rectangle positionSize)
+        {
+            Application ret = new Application(NDalicPINVOKE.Application_New__SWIG_4(argc, stylesheet, (int)windowMode, Rectangle.getCPtr(positionSize)), true);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
         public Application() : this(NDalicPINVOKE.new_Application__SWIG_0(), true)
         {
             NUILog.Debug("Application() is called!");
index 7b257e1..92b772a 100755 (executable)
@@ -581,12 +581,24 @@ namespace Tizen.NUI
         [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_TextEditor_Property_PLACEHOLDER_TEXT_COLOR_get")]
         public static extern int TextEditor_Property_PLACEHOLDER_TEXT_COLOR_get();
 
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_TextEditor_Property_ENABLE_SELECTION_get")]
+        public static extern int TextEditor_Property_ENABLE_SELECTION_get();
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_TextEditor_Property_PLACEHOLDER_get")]
+        public static extern int TextEditor_Property_PLACEHOLDER_get();
+
         [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_TextField_Property_HIDDEN_INPUT_SETTINGS_get")]
         public static extern int TextField_Property_HIDDEN_INPUT_SETTINGS_get();
 
         [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_TextField_Property_PIXEL_SIZE_get")]
         public static extern int TextField_Property_PIXEL_SIZE_get();
 
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_TextField_Property_ENABLE_SELECTION_get")]
+        public static extern int TextField_Property_ENABLE_SELECTION_get();
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_TextField_Property_PLACEHOLDER_get")]
+        public static extern int TextField_Property_PLACEHOLDER_get();
+
         [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_TextLabel_Property_PIXEL_SIZE_get")]
         public static extern int TextLabel_Property_PIXEL_SIZE_get();
 
@@ -712,12 +724,24 @@ namespace Tizen.NUI
         public static extern void ResizedSignal_Disconnect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
 
         [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_ResizedSignal_Emit")]
-        public static extern void ResizedSignal_Emit(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3);
+        public static extern void ResizedSignal_Emit(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
 
         [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_ResizedSignal")]
         public static extern global::System.IntPtr new_ResizedSignal();
 
         [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_delete_ResizedSignal")]
         public static extern void delete_ResizedSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Window_SetSize")]
+        public static extern void SetSize(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Window_GetSize")]
+        public static extern global::System.IntPtr GetSize(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Window_SetPosition")]
+        public static extern void SetPosition(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Window_GetPosition")]
+        public static extern global::System.IntPtr GetPosition(global::System.Runtime.InteropServices.HandleRef jarg1);
     }
 }
index caee01f..5b57314 100755 (executable)
@@ -6421,6 +6421,10 @@ class NDalicPINVOKE {
   [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_delete_ApplicationControlSignal")]
   public static extern void delete_ApplicationControlSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
 
+  [global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_Dali_Application_New__SWIG_4")]
+  public static extern global::System.IntPtr Application_New__SWIG_4(int jarg1, string jarg3, int jarg4, global::System.Runtime.InteropServices.HandleRef jarg5);
+
+
   [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_TimerSignalType_Empty")]
   public static extern bool TimerSignalType_Empty(global::System.Runtime.InteropServices.HandleRef jarg1);
 
index ba4c40e..cc69abf 100755 (executable)
@@ -130,9 +130,9 @@ namespace Tizen.NUI
             }
         }
 
-        public void Emit(int arg1, int arg2)
+        public void Emit(Size2D arg)
         {
-            NDalicManualPINVOKE.ResizedSignal_Emit(swigCPtr, arg1, arg2);
+            NDalicManualPINVOKE.ResizedSignal_Emit(swigCPtr, Size2D.getCPtr(arg));
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
index 4a6ba14..9c449d7 100755 (executable)
@@ -113,7 +113,7 @@ namespace Tizen.NUI.BaseComponents
         //you can override it to clean-up your own resources.
         protected override void Dispose(DisposeTypes type)
         {
-            if (!disposed)
+            if (disposed)
             {
                 return;
             }
index e514a0a..16be393 100755 (executable)
@@ -281,6 +281,8 @@ namespace Tizen.NUI.BaseComponents
             internal static readonly int LINE_COUNT = NDalicManualPINVOKE.TextEditor_Property_LINE_COUNT_get();
             internal static readonly int PLACEHOLDER_TEXT = NDalicManualPINVOKE.TextEditor_Property_PLACEHOLDER_TEXT_get();
             internal static readonly int PLACEHOLDER_TEXT_COLOR = NDalicManualPINVOKE.TextEditor_Property_PLACEHOLDER_TEXT_COLOR_get();
+            internal static readonly int ENABLE_SELECTION = NDalicManualPINVOKE.TextEditor_Property_ENABLE_SELECTION_get();
+            internal static readonly int PLACEHOLDER = NDalicManualPINVOKE.TextEditor_Property_PLACEHOLDER_get();
 
         }
 
@@ -1193,6 +1195,60 @@ namespace Tizen.NUI.BaseComponents
             }
         }
 
+        /// <summary>
+        /// Enable selection property.
+        /// </summary>
+        public bool EnableSelection
+        {
+            get
+            {
+                bool temp = false;
+                GetProperty(TextEditor.Property.ENABLE_SELECTION).Get(out temp);
+                return temp;
+            }
+            set
+            {
+                SetProperty(TextEditor.Property.ENABLE_SELECTION, new Tizen.NUI.PropertyValue(value));
+            }
+        }
+
+        /// <summary>
+        /// Placeholder property.
+        /// Gets/Sets the placeholder : text, color, font family, font style, point size, and pixel size.
+        /// </summary>
+        /// <example>
+        /// The following example demonstrates how to set the placeholder property.
+        /// <code>
+        /// PropertyMap propertyMap = new PropertyMap();
+        /// propertyMap.Add("placeholderText", new PropertyValue("Setting Placeholder Text"));
+        /// propertyMap.Add("placeholderColor", new PropertyValue(Color.Red));
+        /// propertyMap.Add("placeholderFontFamily", new PropertyValue("Arial"));
+        /// propertyMap.Add("placeholderPointSize", new PropertyValue(12.0f));
+        ///
+        /// PropertyMap fontStyleMap = new PropertyMap();
+        /// fontStyleMap.Add("weight", new PropertyValue("bold"));
+        /// fontStyleMap.Add("width", new PropertyValue("condensed"));
+        /// fontStyleMap.Add("slant", new PropertyValue("italic"));
+        /// propertyMap.Add("placeholderFontStyle", new PropertyValue(fontStyleMap));
+        ///
+        /// TextEditor editor = new TextEditor();
+        /// editor.Placeholder = propertyMap;
+        /// </code>
+        /// </example>
+        public Tizen.NUI.PropertyMap Placeholder
+        {
+            get
+            {
+                Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
+                GetProperty(TextEditor.Property.PLACEHOLDER).Get(temp);
+                return temp;
+            }
+            set
+            {
+                SetProperty(TextEditor.Property.PLACEHOLDER, new Tizen.NUI.PropertyValue(value));
+            }
+        }
+
     }
 
 }
index 6ef5745..f6e6eba 100755 (executable)
@@ -262,6 +262,8 @@ namespace Tizen.NUI.BaseComponents
             internal static readonly int INPUT_OUTLINE = NDalicPINVOKE.TextField_Property_INPUT_OUTLINE_get();
             internal static readonly int HIDDEN_INPUT_SETTINGS = NDalicManualPINVOKE.TextField_Property_HIDDEN_INPUT_SETTINGS_get();
             internal static readonly int PIXEL_SIZE = NDalicManualPINVOKE.TextField_Property_PIXEL_SIZE_get();
+            internal static readonly int ENABLE_SELECTION = NDalicManualPINVOKE.TextField_Property_ENABLE_SELECTION_get();
+            internal static readonly int PLACEHOLDER = NDalicManualPINVOKE.TextField_Property_PLACEHOLDER_get();
 
         }
 
@@ -1222,6 +1224,60 @@ namespace Tizen.NUI.BaseComponents
             }
         }
 
+        /// <summary>
+        /// Enable selection property.
+        /// </summary>
+        public bool EnableSelection
+        {
+            get
+            {
+                bool temp = false;
+                GetProperty(TextField.Property.ENABLE_SELECTION).Get(out temp);
+                return temp;
+            }
+            set
+            {
+                SetProperty(TextField.Property.ENABLE_SELECTION, new Tizen.NUI.PropertyValue(value));
+            }
+        }
+
+        /// <summary>
+        /// Placeholder property.
+        /// Gets/Sets the placeholder : text, color, font family, font style, point size, and pixel size.
+        /// </summary>
+        /// <example>
+        /// The following example demonstrates how to set the placeholder property.
+        /// <code>
+        /// PropertyMap propertyMap = new PropertyMap();
+        /// propertyMap.Add("placeholderText", new PropertyValue("Setting Placeholder Text"));
+        /// propertyMap.Add("placeholderColor", new PropertyValue(Color.Red));
+        /// propertyMap.Add("placeholderFontFamily", new PropertyValue("Arial"));
+        /// propertyMap.Add("placeholderPointSize", new PropertyValue(12.0f));
+        ///
+        /// PropertyMap fontStyleMap = new PropertyMap();
+        /// fontStyleMap.Add("weight", new PropertyValue("bold"));
+        /// fontStyleMap.Add("width", new PropertyValue("condensed"));
+        /// fontStyleMap.Add("slant", new PropertyValue("italic"));
+        /// propertyMap.Add("placeholderFontStyle", new PropertyValue(fontStyleMap));
+        ///
+        /// TextField field = new TextField();
+        /// field.Placeholder = propertyMap;
+        /// </code>
+        /// </example>
+        public Tizen.NUI.PropertyMap Placeholder
+        {
+            get
+            {
+                Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
+                GetProperty(TextField.Property.PLACEHOLDER).Get(temp);
+                return temp;
+            }
+            set
+            {
+                SetProperty(TextField.Property.PLACEHOLDER, new Tizen.NUI.PropertyValue(value));
+            }
+        }
+
     }
 
 }
index 38b1da6..e81cc2b 100755 (executable)
@@ -1162,37 +1162,24 @@ namespace Tizen.NUI
 
         public class ResizedEventArgs : EventArgs
         {
-            int _width;
-            int _height;
+            Size2D _windowSize;
 
-            public int Width
+            public Size2D WindowSize
             {
                 get
                 {
-                    return _width;
+                    return _windowSize;
                 }
                 set
                 {
-                    _width = value;
-                }
-            }
-
-            public int Height
-            {
-                get
-                {
-                    return _height;
-                }
-                set
-                {
-                    _height = value;
+                    _windowSize = value;
                 }
             }
         }
 
         private WindowResizedEventCallbackType _windowResizedEventCallback;
         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
-        private delegate void WindowResizedEventCallbackType(int width, int height);
+        private delegate void WindowResizedEventCallbackType(Size2D windowSize);
         private event EventHandler<ResizedEventArgs> _windowResizedEventHandler;
 
         public event EventHandler<ResizedEventArgs> Resized
@@ -1218,11 +1205,10 @@ namespace Tizen.NUI
             }
         }
 
-        private void OnResized(int width, int height)
+        private void OnResized(Size2D windowSize)
         {
             ResizedEventArgs e = new ResizedEventArgs();
-            e.Width = width;
-            e.Height = height;
+            e.WindowSize = windowSize;
 
             if (_windowResizedEventHandler != null)
             {
@@ -1230,6 +1216,32 @@ namespace Tizen.NUI
             }
         }
 
+        internal void SetWindowSize(Size2D size)
+        {
+            NDalicManualPINVOKE.SetSize(swigCPtr, Size2D.getCPtr(size));
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        internal Size2D GetWindowSize()
+        {
+            Size2D ret = new Size2D(NDalicManualPINVOKE.GetSize(swigCPtr), true);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        internal void SetPosition(Position2D position)
+        {
+            NDalicManualPINVOKE.SetPosition(swigCPtr, Position2D.getCPtr(position));
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        internal Position2D GetPosition()
+        {
+            Position2D ret = new Position2D(NDalicManualPINVOKE.GetPosition(swigCPtr), true);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
         /// <summary>
         /// Window size property (read-only).
         /// </summary>
@@ -1354,7 +1366,35 @@ namespace Tizen.NUI
             }
         }
 
+        /// <summary>
+        /// Gets/Sets a size of the window.
+        /// </summary>
+        public Size2D WindowSize
+        {
+            get
+            {
+                return GetWindowSize();
+            }
+            set
+            {
+                SetWindowSize(value);
+            }
+        }
 
+        /// <summary>
+        /// Gets/Sets a position of the window.
+        /// </summary>
+        public Position2D WindowPosition
+        {
+            get
+            {
+                return GetPosition();
+            }
+            set
+            {
+                SetPosition(value);
+            }
+        }
 
 
     }