Merge "[Tizen] Remove Visible propert in View." into tizen
authorJinho, Lee <jeano.lee@samsung.com>
Tue, 1 Aug 2017 09:13:47 +0000 (09:13 +0000)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Tue, 1 Aug 2017 09:13:47 +0000 (09:13 +0000)
14 files changed:
.gitignore
packaging/csapi-nui.spec
src/Tizen.NUI/Tizen.NUI.csproj
src/Tizen.NUI/src/internal/Application.cs
src/Tizen.NUI/src/internal/NDalic.cs
src/Tizen.NUI/src/internal/NDalicPINVOKE.cs
src/Tizen.NUI/src/internal/NUICoreBackend.cs [new file with mode: 0755]
src/Tizen.NUI/src/internal/NUIEventType.cs [new file with mode: 0755]
src/Tizen.NUI/src/public/BaseComponents/View.cs
src/Tizen.NUI/src/public/CustomViewRegistry.cs
src/Tizen.NUI/src/public/NUIApplication.cs
src/Tizen.NUI/src/public/NUIConstants.cs
src/Tizen.NUI/src/public/VisualBase.cs
src/Tizen.NUI/src/public/VisualMaps.cs

index 953cfc3..3a33512 100755 (executable)
@@ -10,3 +10,4 @@ Tizen.NUI/obj
 Tizen.NUI/bin
 *.lock.json
 Tizen.NUI/.vs/
+Tizen.NUI.Code/
index c59f6d7..3f444eb 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       csapi-nui
 Summary:    dali-NUI
-Version:    0.2.49
+Version:    0.2.48.pre1
 Release:    1
 Group:      Development/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT
index 63d87d8..4b2d09f 100755 (executable)
@@ -25,7 +25,7 @@
 \r
   <ItemGroup>\r
     <PackageReference Include="System.Reflection.TypeExtensions" Version="4.3.0" PrivateAssets="All" />\r
-    <PackageReference Include="Tizen.Applications.UI" Version="1.5.8" />\r
+    <PackageReference Include="Tizen.Applications.Common" Version="1.5.8" />\r
   </ItemGroup>\r
 \r
 </Project>\r
index 105b893..4e68bfe 100755 (executable)
@@ -25,10 +25,10 @@ namespace Tizen.NUI
     {
         public const int ver1 = 1;
         public const int ver2 = 2;
-        public const int ver3 = 49;
+        public const int ver3 = 46;
         public const int nuiVer1 = 0;
         public const int nuiVer2 = 2;
-        public const int nuiVer3 = 49;
+        public const int nuiVer3 = 47;
         public const string nuiRelease = "";
     }
 
index 576a9dd..b9b3ce3 100755 (executable)
@@ -922,6 +922,11 @@ namespace Tizen.NUI
         internal static readonly int IMAGE_VISUAL_PIXEL_AREA = NDalicPINVOKE.IMAGE_VISUAL_PIXEL_AREA_get();
         internal static readonly int IMAGE_VISUAL_WRAP_MODE_U = NDalicPINVOKE.IMAGE_VISUAL_WRAP_MODE_U_get();
         internal static readonly int IMAGE_VISUAL_WRAP_MODE_V = NDalicPINVOKE.IMAGE_VISUAL_WRAP_MODE_V_get();
+        internal static readonly int IMAGE_VISUAL_BATCH_SIZE = NDalicPINVOKE.IMAGE_VISUAL_BATCH_SIZE_get();
+        internal static readonly int IMAGE_VISUAL_CACHE_SIZE = NDalicPINVOKE.IMAGE_VISUAL_CACHE_SIZE_get();
+        internal static readonly int IMAGE_VISUAL_FRAME_DELAY = NDalicPINVOKE.IMAGE_VISUAL_FRAME_DELAY_get();
+        internal static readonly int IMAGE_VISUAL_MASK_CONTENT_SCALE = NDalicPINVOKE.IMAGE_VISUAL_MASK_CONTENT_SCALE_get();
+        internal static readonly int IMAGE_VISUAL_CROP_TO_MASK = NDalicPINVOKE.IMAGE_VISUAL_CROP_TO_MASK_get();
 
         internal static readonly int MESH_VISUAL_OBJECT_URL = NDalicPINVOKE.MESH_VISUAL_OBJECT_URL_get();
         internal static readonly int MESH_VISUAL_MATERIAL_URL = NDalicPINVOKE.MESH_VISUAL_MATERIAL_URL_get();
index 5b57314..e02e7f2 100755 (executable)
@@ -6557,6 +6557,21 @@ class NDalicPINVOKE {
   [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_IMAGE_VISUAL_WRAP_MODE_V_get")]
   public static extern int IMAGE_VISUAL_WRAP_MODE_V_get();
 
+  [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_IMAGE_VISUAL_BATCH_SIZE_get")]
+  public static extern int IMAGE_VISUAL_BATCH_SIZE_get();
+
+  [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_IMAGE_VISUAL_CACHE_SIZE_get")]
+  public static extern int IMAGE_VISUAL_CACHE_SIZE_get();
+
+  [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_IMAGE_VISUAL_FRAME_DELAY_get")]
+  public static extern int IMAGE_VISUAL_FRAME_DELAY_get();
+
+  [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_IMAGE_VISUAL_MASK_CONTENT_SCALE_get")]
+  public static extern int IMAGE_VISUAL_MASK_CONTENT_SCALE_get();
+
+  [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_IMAGE_VISUAL_CROP_TO_MASK_get")]
+  public static extern int IMAGE_VISUAL_CROP_TO_MASK_get();
+
   [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_MESH_VISUAL_OBJECT_URL_get")]
   public static extern int MESH_VISUAL_OBJECT_URL_get();
 
diff --git a/src/Tizen.NUI/src/internal/NUICoreBackend.cs b/src/Tizen.NUI/src/internal/NUICoreBackend.cs
new file mode 100755 (executable)
index 0000000..20dff95
--- /dev/null
@@ -0,0 +1,247 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+using System;
+using System.Collections.Generic;
+
+using Tizen.Applications.CoreBackend;
+using Tizen.Applications;
+using Tizen.NUI;
+
+namespace Tizen.NUI
+{
+    class NUICoreBackend : ICoreBackend
+    {
+        /// <summary>
+        /// Application instance to connect event.
+        /// </summary>
+        protected Application _application;
+
+        /// <summary>
+        /// Dictionary to contain each type of event callback.
+        /// </summary>
+        protected IDictionary<EventType, object> Handlers = new Dictionary<EventType, object>();
+
+        /// <summary>
+        /// The default Constructor.
+        /// </summary>
+        public NUICoreBackend()
+        {
+            _application = Application.NewApplication();
+        }
+
+        /// <summary>
+        /// The constructor with stylesheet.
+        /// </summary>
+        public NUICoreBackend(string stylesheet)
+        {
+            _application = Application.NewApplication(stylesheet);
+        }
+
+        /// <summary>
+        /// The constructor with stylesheet and window mode.
+        /// </summary>
+        public NUICoreBackend(string stylesheet, NUIApplication.WindowMode windowMode)
+        {
+            _application = Application.NewApplication(stylesheet, (Application.WindowMode)windowMode );
+        }
+
+        /// <summary>
+        /// Add NUIApplication event to Application.
+        /// Put each type of event callback in Dictionary.
+        /// </summary>
+        /// <param name="evType">Type of event</param>
+        /// <param name="handler">Event callback</param>
+        public void AddEventHandler(EventType evType, Action handler)
+        {
+            Handlers.Add(evType, handler);
+        }
+
+        /// <summary>
+        /// Add NUIApplication event to Application.
+        /// Put each type of event callback in Dictionary.
+        /// </summary>
+        /// <typeparam name="TEventArgs">Argument type for the event</typeparam>
+        /// <param name="evType">Type of event</param>
+        /// <param name="handler">Event callback</param>
+        public void AddEventHandler<TEventArgs>(EventType evType, Action<TEventArgs> handler) where TEventArgs : EventArgs
+        {
+            Handlers.Add(evType, handler);
+        }
+
+
+        /// <summary>
+        /// Dispose function.
+        /// </summary>
+        public void Dispose()
+        {
+            _application.Dispose();
+        }
+
+        /// <summary>
+        /// Exit Application.
+        /// </summary>
+        public void Exit()
+        {
+            _application.Quit();
+        }
+
+        /// <summary>
+        /// Run Application.
+        /// </summary>
+        /// <param name="args">Arguments from commandline.</param>
+        public void Run(string[] args)
+        {
+            _application.BatteryLow += OnBatteryLow;
+            _application.LanguageChanged += OnLanguageChanged;
+            _application.MemoryLow += OnMemoryLow;
+            _application.RegionChanged += OnRegionChanged;
+
+            _application.Initialized += OnInitialized;
+            _application.Resumed += OnResumed;
+            _application.Terminating += OnTerminated;
+            _application.Paused += OnPaused;
+            _application.AppControl += OnAppControl;
+
+            _application.MainLoop();
+        }
+
+        /// <summary>
+        /// Region changed event callback function.
+        /// </summary>
+        /// <param name="source">Application instance</param>
+        /// <param name="e">Event argument for RegionChanged</param>
+        private void OnRegionChanged(object source, NUIApplicationRegionChangedEventArgs e)
+        {
+            Log.Debug("NUI", "NUICorebackend OnRegionChanged Called");
+            var handler = Handlers[EventType.RegionFormatChanged] as Action<RegionFormatChangedEventArgs>;
+            // Need to make new signal return in native to return right value.
+            handler?.Invoke( new RegionFormatChangedEventArgs(""));
+        }
+
+        /// <summary>
+        /// Memory Low event callback function.
+        /// </summary>
+        /// <param name="source">Application instance</param>
+        /// <param name="e">Event argument for MemoryLow</param>
+        private void OnMemoryLow(object source, NUIApplicationMemoryLowEventArgs e)
+        {
+            Log.Debug("NUI", "NUICorebackend OnMemoryLow Called");
+            var handler = Handlers[EventType.LowMemory] as Action<LowMemoryEventArgs>;
+            // Need to make new signal return in native to return right value.
+            handler?.Invoke( new LowMemoryEventArgs(LowMemoryStatus.None));
+        }
+
+        /// <summary>
+        /// Language changed event callback function.
+        /// </summary>
+        /// <param name="source">Application instance</param>
+        /// <param name="e">Event argument for LanguageChanged</param>
+        private void OnLanguageChanged(object source, NUIApplicationLanguageChangedEventArgs e)
+        {
+            Log.Debug("NUI", "NUICorebackend OnLanguageChanged Called");
+            var handler = Handlers[EventType.LocaleChanged] as Action<LocaleChangedEventArgs>;
+            // Need to make new signal return in native to return right value.
+            handler?.Invoke( new LocaleChangedEventArgs(""));
+        }
+
+        /// <summary>
+        /// Battery low event callback function.
+        /// </summary>
+        /// <param name="source">Application instance</param>
+        /// <param name="e">Event argument for BatteryLow</param>
+        private void OnBatteryLow(object source, NUIApplicationBatteryLowEventArgs e)
+        {
+            Log.Debug("NUI", "NUICorebackend OnBatteryLow Called");
+            var handler = Handlers[EventType.LowBattery] as Action<LowBatteryEventArgs>;
+            // Need to make new signal return in native to return right value.
+            handler?.Invoke(new LowBatteryEventArgs(LowBatteryStatus.None));
+        }
+
+        /// <summary>
+        /// Initialized event callback function.
+        /// </summary>
+        /// <param name="source">Application instance</param>
+        /// <param name="e">Event argument for Initialized</param>
+        private void OnInitialized(object source, NUIApplicationInitEventArgs e)
+        {
+            Log.Debug("NUI", "NUICorebackend OnInitialized Called");
+            var handler = Handlers[EventType.Created] as Action;
+            handler?.Invoke();
+        }
+
+        /// <summary>
+        /// Terminated event callback function.
+        /// </summary>
+        /// <param name="source">Application instance</param>
+        /// <param name="e">Event argument for Terminated</param>
+        private void OnTerminated(object source, NUIApplicationTerminatingEventArgs e)
+        {
+            Log.Debug("NUI", "NUICorebackend OnTerminated Called");
+            var handler = Handlers[EventType.Terminated] as Action;
+            handler?.Invoke();
+        }
+
+        /// <summary>
+        /// Resumed event callback function.
+        /// </summary>
+        /// <param name="source">Application instance</param>
+        /// <param name="e">Event argument for Resumed</param>
+        private void OnResumed(object source, NUIApplicationResumedEventArgs e)
+        {
+            Log.Debug("NUI", "NUICorebackend OnResumed Called");
+            var handler = Handlers[EventType.Resumed] as Action;
+            handler?.Invoke();
+        }
+
+        /// <summary>
+        /// App control event callback function.
+        /// </summary>
+        /// <param name="source">Application instance</param>
+        /// <param name="e">Event argument for AppControl</param>
+        private void OnAppControl(object source, NUIApplicationAppControlEventArgs e)
+        {
+            Log.Debug("NUI", "NUICorebackend OnAppControl Called");
+            /* can invoke after making new api which getting control handle at application.
+            var handler = Handlers[EventType.AppControlReceived] as Action<AppControlReceivedEventArgs>;
+            handler?.Invoke();
+            */
+        }
+
+        /// <summary>
+        /// Paused event callback function.
+        /// </summary>
+        /// <param name="source">Application instance</param>
+        /// <param name="e">Event argument for Paused</param>
+        private void OnPaused(object source, NUIApplicationPausedEventArgs e)
+        {
+            Log.Debug("NUI", "NUICorebackend OnPaused Called");
+            var handler = Handlers[EventType.Paused] as Action;
+            handler?.Invoke();
+        }
+
+
+       internal Application ApplicationHandle
+       {
+               get
+               {
+                       return _application;
+               }
+       }
+
+    }
+}
diff --git a/src/Tizen.NUI/src/internal/NUIEventType.cs b/src/Tizen.NUI/src/internal/NUIEventType.cs
new file mode 100755 (executable)
index 0000000..a9ee287
--- /dev/null
@@ -0,0 +1,47 @@
+/* Copyright(c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+using Tizen.Applications.CoreBackend;
+
+namespace Tizen.NUI
+{
+    /// <summary>
+    /// Class that represents the type of NUI event for backends. This class can be converted from string type.
+    /// </summary>
+    public class NUIEventType : EventType
+    {
+        /// <summary>
+        /// Initializes the EventType class.
+        /// </summary>
+        /// <param name="name">The name of event type.</param>
+        public NUIEventType(string name) : base(name)
+        {
+        }
+
+        /// <summary>
+        /// Pre-defined event type. "Reset"
+        /// </summary>
+        public static readonly NUIEventType Reset = "Reset";
+
+        /// <summary>
+        /// Converts a string to NUIEventType instance.
+        /// </summary>
+        public static implicit operator NUIEventType(string value)
+        {
+            return new NUIEventType(value);
+        }
+    }
+}
index 391dc41..cedb4d0 100755 (executable)
@@ -820,7 +820,14 @@ namespace Tizen.NUI.BaseComponents
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
-        [Obsolete("Please do not use! this will be deprecated, instead please us as keyword.")]
+        /// <summary>
+        /// Downcasts a handle to View handle.<br>
+        /// If handle points to a View, the downcast produces valid handle.<br>
+        /// If not, the returned handle is left uninitialized.<br>
+        /// </summary>
+        /// <param name="handle">Handle to an object</param>
+        /// <returns>A handle to a View or an uninitialized handle</returns>
+        [Obsolete("Please do not use! this will be deprecated, instead please use as keyword.")]
         public new static View DownCast(BaseHandle handle)
         {
             View ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as View;
@@ -828,7 +835,7 @@ namespace Tizen.NUI.BaseComponents
             return ret;
         }
 
-        [Obsolete("Please do not use! this will be deprecated, instead please us as keyword.")]
+        [Obsolete("Please do not use! this will be deprecated, instead please use as keyword.")]
         public static T DownCast<T>(View view) where T : View
         {
             T ret = Registry.GetManagedBaseHandleFromNativePtr(view) as T;
@@ -2145,9 +2152,19 @@ namespace Tizen.NUI.BaseComponents
 
         /*internal View GetParent()
         {
+            View ret;
             IntPtr cPtr = NDalicPINVOKE.Actor_GetParent(swigCPtr);
 
-            View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View;
+            BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(cPtr);
+
+            if(basehandle is Layer)
+            {
+                ret = new View(cPtr,false);
+            }
+            else
+            {
+                ret = basehandle as View;
+            }
 
             if (NDalicPINVOKE.SWIGPendingException.Pending)
                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
index e20f0f5..0b5cc21 100755 (executable)
@@ -164,6 +164,8 @@ namespace Tizen.NUI
       { "Size",    PropertyType.Vector2 },
       { "Position",PropertyType.Vector3 },
       { "Color",   PropertyType.Vector4 },
+      { "PropertyArray", PropertyType.Array },
+      { "PropertyMap",   PropertyType.Map },
             //  { "Matrix3", PropertyType.MATRIX3 }, commented out until we need to use Matrices from JSON
             //  { "Matrix",  PropertyType.MATRIX },
         };
@@ -279,10 +281,8 @@ namespace Tizen.NUI
             // Cycle through each property in the class
             foreach (System.Reflection.PropertyInfo propertyInfo in viewType.GetProperties(BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public))
             {
-
                 if (propertyInfo.CanRead)
                 {
-
                     IEnumerable<Attribute> ie_attrs = propertyInfo.GetCustomAttributes<Attribute>();
                     List<Attribute> li_attrs = new List<Attribute>(ie_attrs);
                     System.Attribute[] attrs = li_attrs.ToArray();
@@ -356,7 +356,6 @@ namespace Tizen.NUI
             if (view != null)
             {
                 System.Reflection.PropertyInfo propertyInfo = view.GetType().GetProperty(propertyName);
-
                 // We know the property name, we know it's type, we just need to convert from a DALi property value to native C# type
                 System.Type type = propertyInfo.PropertyType;
                 bool ok = false;
@@ -453,9 +452,27 @@ namespace Tizen.NUI
                         propertyInfo.SetValue(view, (Color)value);
                     };
                 }
+                else if (type.Equals(typeof(PropertyMap)))
+                {
+                    PropertyMap map = new PropertyMap();
+                    ok = propValue.Get(map);
+                    if( ok )
+                    {
+                        propertyInfo.SetValue( view, map );
+                    }
+                }
+                else if (type.Equals(typeof(PropertyArray)))
+                {
+                    PropertyArray array = new PropertyArray();
+                    ok = propValue.Get(array);
+                    if( ok )
+                    {
+                        propertyInfo.SetValue( view, array );
+                    }
+                }
                 else
                 {
-                    throw new global::System.InvalidOperationException("SetPropertyValue Unimplemented type for Property Value");
+                    throw new global::System.InvalidOperationException("SetPropertyValue Unimplemented type for Property Value for " + type.FullName );
                 }
                 if (!ok)
                 {
index 6f2fda0..b5bdacb 100755 (executable)
@@ -17,6 +17,7 @@
 
 using System;
 using Tizen.Applications;
+using Tizen.Applications.CoreBackend;
 using Tizen.NUI;
 
 namespace Tizen.NUI
@@ -25,203 +26,145 @@ namespace Tizen.NUI
     /// <summary>
     /// Represents an application that have UI screen. The NUIApplication class has a default stage.
     /// </summary>
-    public class NUIApplication : CoreUIApplication
+    public class NUIApplication : CoreApplication
     {
         /// <summary>
-        /// The instance of the Application.
-        /// </summary>
-        /// <remarks>
-        /// This application is created before OnCreate() or created event. And the NUIApplication will be terminated when this application is closed.
-        /// </remarks>
-        private Application _application;
-
-        /// <summary>
-        /// The instance of the Dali Application extension.
-        /// </summary>
-        private ApplicationExtensions _applicationExt;
-
-        /// <summary>
-        /// Store the stylesheet value.
-        /// </summary>
-        private string _stylesheet;
-
-        /// <summary>
-        /// Store the window mode value.
-        /// </summary>
-        private Application.WindowMode _windowMode;
-
-        /// <summary>
-        /// Store the app mode value.
-        /// </summary>
-        private AppMode _appMode;
-
-        /// <summary>
-        /// The instance of the Dali Stage.
-        /// </summary>
-        private Window _window;
-
-        /// <summary>
         /// The default constructor.
         /// </summary>
-        public NUIApplication() : base()
+        public NUIApplication() : base(new NUICoreBackend())
         {
-            _appMode = AppMode.Default;
         }
 
         /// <summary>
         /// The constructor with stylesheet.
         /// </summary>
-        public NUIApplication(string stylesheet) : base()
+        public NUIApplication(string stylesheet) : base(new NUICoreBackend(stylesheet))
         {
-            //handle the stylesheet
-            _appMode = AppMode.StyleSheetOnly;
-            _stylesheet = stylesheet;
         }
 
         /// <summary>
         /// The constructor with stylesheet and window mode.
         /// </summary>
-        public NUIApplication(string stylesheet, WindowMode windowMode) : base()
+        public NUIApplication(string stylesheet, WindowMode windowMode) : base(new NUICoreBackend(stylesheet,windowMode))
         {
-            //handle the stylesheet and windowMode
-            _appMode = AppMode.StyleSheetWithWindowMode;
-            _stylesheet = stylesheet;
-            _windowMode = (Application.WindowMode)windowMode;
         }
 
         /// <summary>
         /// Overrides this method if want to handle behavior.
         /// </summary>
-        protected override void OnPause()
+        protected override void OnLocaleChanged(LocaleChangedEventArgs e)
         {
-            base.OnPause();
-            _applicationExt.Pause();
-            NUILog.Debug("OnPause() is called!");
         }
 
         /// <summary>
-        /// Overrides this method if want to handle behavior before calling OnCreate().<br>
-        /// stage property is initialized in this overrided method.<br>
+        /// Overrides this method if want to handle behavior.
         /// </summary>
-        protected override void OnPreCreate()
+        protected override void OnLowBattery(LowBatteryEventArgs e)
         {
-            // Initialize DisposeQueue Singleton class.
-            DisposeQueue disposeQ = DisposeQueue.Instance;
-            NUILog.Debug("1) DisposeQueue.Instance.Initialize()!");
-            switch (_appMode)
-            {
-                case AppMode.Default:
-                    _application = Tizen.NUI.Application.NewApplication();
-                    break;
-                case AppMode.StyleSheetOnly:
-                    _application = Tizen.NUI.Application.NewApplication(_stylesheet);
-                    break;
-                case AppMode.StyleSheetWithWindowMode:
-                    _application = Tizen.NUI.Application.NewApplication(_stylesheet, _windowMode);
-                    break;
-                default:
-                    break;
-            }
-            _applicationExt = new ApplicationExtensions(_application);
-            _applicationExt.Init();
-            _applicationExt.Start();
-
-            // This is also required to create DisposeQueue on main thread.
-            disposeQ.Initialize();
-            NUILog.Debug("2) DisposeQueue.Instance.Initialize()!");
-            _window = Window.Instance;
-            _window.SetBackgroundColor(Color.White);
-            NUILog.Debug("OnPreCreate() is called!");
+            Log.Debug("NUI", "OnLowBattery() is called!");
         }
 
         /// <summary>
         /// Overrides this method if want to handle behavior.
         /// </summary>
-        protected override void OnResume()
+        protected override void OnLowMemory(LowMemoryEventArgs e)
         {
-            base.OnResume();
-            _applicationExt.Resume();
-            NUILog.Debug("OnResume() is called!");
+            Log.Debug("NUI", "OnLowMemory() is called!");
         }
 
         /// <summary>
         /// Overrides this method if want to handle behavior.
         /// </summary>
-        protected override void OnAppControlReceived(AppControlReceivedEventArgs e)
+        protected override void OnRegionFormatChanged(RegionFormatChangedEventArgs e)
         {
-            base.OnAppControlReceived(e);
-            NUILog.Debug("OnAppControlReceived() is called!");
-            if (e != null)
-            {
-                NUILog.Debug("OnAppControlReceived() is called! ApplicationId=" + e.ReceivedAppControl.ApplicationId);
-                NUILog.Debug("CallerApplicationId=" + e.ReceivedAppControl.CallerApplicationId + "   IsReplyRequest=" + e.ReceivedAppControl.IsReplyRequest);
-            }
+            Log.Debug("NUI", "OnRegionFormatChanged() is called!");
         }
 
         /// <summary>
         /// Overrides this method if want to handle behavior.
         /// </summary>
-        protected override void OnCreate()
+        protected override void OnTerminate()
         {
-            base.OnCreate();
-            NUILog.Debug("OnCreate() is called!");
+            Log.Debug("NUI", "OnTerminate() is called!");
         }
 
         /// <summary>
         /// Overrides this method if want to handle behavior.
         /// </summary>
-        protected override void OnLocaleChanged(LocaleChangedEventArgs e)
+        protected void OnPause()
         {
-            base.OnLocaleChanged(e);
-            _applicationExt.LanguageChange();
-            NUILog.Debug("OnLocaleChanged() is called!");
         }
 
         /// <summary>
         /// Overrides this method if want to handle behavior.
         /// </summary>
-        protected override void OnLowBattery(LowBatteryEventArgs e)
+        protected void OnResume()
         {
-            base.OnLowBattery(e);
-            NUILog.Debug("OnLowBattery() is called!");
+            Log.Debug("NUI", "OnResume() is called!");
         }
 
         /// <summary>
         /// Overrides this method if want to handle behavior.
         /// </summary>
-        protected override void OnLowMemory(LowMemoryEventArgs e)
+        protected override void OnAppControlReceived(AppControlReceivedEventArgs e)
         {
-            base.OnLowMemory(e);
-            NUILog.Debug("OnLowMemory() is called!");
+            Log.Debug("NUI", "OnAppControlReceived() is called!");
+            if (e != null)
+            {
+                Log.Debug("NUI", "OnAppControlReceived() is called! ApplicationId=" + e.ReceivedAppControl.ApplicationId);
+                Log.Debug("NUI", "CallerApplicationId=" + e.ReceivedAppControl.CallerApplicationId + "   IsReplyRequest=" + e.ReceivedAppControl.IsReplyRequest);
+            }
         }
 
         /// <summary>
         /// Overrides this method if want to handle behavior.
         /// </summary>
-        protected override void OnRegionFormatChanged(RegionFormatChangedEventArgs e)
+        protected override void OnCreate()
         {
-            base.OnRegionFormatChanged(e);
-            NUILog.Debug("OnRegionFormatChanged() is called!");
+            // This is also required to create DisposeQueue on main thread.
+            DisposeQueue disposeQ = DisposeQueue.Instance;
+            disposeQ.Initialize();
+            Log.Debug("NUI","OnCreate() is called!");
         }
 
         /// <summary>
-        /// Overrides this method if want to handle behavior.
+        /// Run NUIApplication.
         /// </summary>
-        protected override void OnTerminate()
+        /// <param name="args">Arguments from commandline.</param>
+        public override void Run(string[] args)
         {
-            base.OnTerminate();
-            _applicationExt.Terminate();
-            NUILog.Debug("OnTerminate() is called!");
+            string[] argsClone = null;
+
+            if (args == null)
+            {
+                argsClone = new string[1];
+            }
+            else
+            {
+                argsClone = new string[args.Length + 1];
+                args.CopyTo(argsClone, 1);
+            }
+            argsClone[0] = string.Empty;
+
+            Backend.AddEventHandler(EventType.Resumed, OnResume);
+            Backend.AddEventHandler<AppControlReceivedEventArgs>(EventType.AppControlReceived, OnAppControlReceived);
+            Backend.AddEventHandler(EventType.Paused, OnPause);
+            Backend.AddEventHandler(EventType.Terminated, OnTerminate);
+            Backend.AddEventHandler<RegionFormatChangedEventArgs>(EventType.RegionFormatChanged, OnRegionFormatChanged);
+            Backend.AddEventHandler<LowMemoryEventArgs>(EventType.LowMemory, OnLowMemory);
+            Backend.AddEventHandler<LowBatteryEventArgs>(EventType.LowBattery, OnLowBattery);
+            Backend.AddEventHandler<LocaleChangedEventArgs>(EventType.LocaleChanged, OnLocaleChanged);
+            Backend.AddEventHandler(EventType.Created, OnCreate);
+
+            Backend.Run(argsClone);
         }
 
         /// <summary>
-        /// The mode of creating NUI application.
+        /// Exit NUIApplication.
         /// </summary>
-        private enum AppMode
+        public override void Exit()
         {
-            Default = 0,
-            StyleSheetOnly = 1,
-            StyleSheetWithWindowMode = 2
+            Backend.Exit();
         }
 
         /// <summary>
@@ -233,23 +176,14 @@ namespace Tizen.NUI
             Transparent = 1
         }
 
-        /// <summary>
-        /// Get the window instance.
-        /// </summary>
-        public Window Window
-        {
-            get
-            {
-                return _application.GetWindow();
-            }
-        }
 
         internal Application ApplicationHandle
         {
             get
             {
-                return _application;
+                return ((NUICoreBackend)this.Backend).ApplicationHandle;
             }
         }
+
     }
 }
index 748b8fa..704ea52 100755 (executable)
@@ -824,6 +824,12 @@ namespace Tizen.NUI
         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 static readonly int MaskContentScale = NDalic.IMAGE_VISUAL_MASK_CONTENT_SCALE;
+        public static readonly int CropToMask = NDalic.IMAGE_VISUAL_CROP_TO_MASK;
+        public static readonly int BatchSize = NDalic.IMAGE_VISUAL_BATCH_SIZE;
+        public static readonly int CacheSize = NDalic.IMAGE_VISUAL_CACHE_SIZE;
+        public static readonly int FrameDelay = NDalic.IMAGE_VISUAL_FRAME_DELAY;
+
     }
 
     /// <summary>
index 42311b1..c360462 100755 (executable)
@@ -187,9 +187,11 @@ namespace Tizen.NUI
         /// </summary>
         public PropertyMap Creation
         {
-            set
+            get
             {
-                CreatePropertyMap(value);
+                PropertyMap map = new PropertyMap();
+                CreatePropertyMap(map);
+                return map;
             }
         }
         internal void CreatePropertyMap(PropertyMap map)
index eac2ecb..a26b8f4 100755 (executable)
@@ -15,6 +15,7 @@
 
 namespace Tizen.NUI
 {
+    using System.Collections.Generic;
     using Tizen.NUI.BaseComponents;
 
     /// <summary>
@@ -567,11 +568,14 @@ namespace Tizen.NUI
         private Vector4 _pixelArea = null;
         private WrapModeType? _wrapModeU = null;
         private WrapModeType? _wrapModeV = null;
+        private float? _maskContentScale = null;
+        private bool? _cropToMask = null;
 
         /// <summary>
         /// Get or set the URL of the image.<br>
         /// Mandatory.
         /// </summary>
+
         public string URL
         {
             get
@@ -585,6 +589,7 @@ namespace Tizen.NUI
             }
         }
 
+
         /// <summary>
         /// Get or set the URL of the alpha mask.<br>
         /// Optional.
@@ -778,6 +783,32 @@ namespace Tizen.NUI
             }
         }
 
+        public float MaskContentScale
+        {
+            get
+            {
+                return _maskContentScale ?? 1.0f;
+            }
+            set
+            {
+                _maskContentScale = value;
+                UpdateVisual();
+            }
+        }
+
+        public bool CropToMask
+        {
+            get
+            {
+                return _cropToMask ?? false;
+            }
+            set
+            {
+                _cropToMask = value;
+                UpdateVisual();
+            }
+        }
+
         protected override void ComposingPropertyMap()
         {
             if (_url != null)
@@ -799,6 +830,8 @@ namespace Tizen.NUI
                 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
                 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
                 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
+                if (_maskContentScale != null) { _outputVisualMap.Add((int)ImageVisualProperty.MaskContentScale, new PropertyValue((float)_maskContentScale)); }
+                if (_cropToMask != null) { _outputVisualMap.Add((int)ImageVisualProperty.CropToMask, new PropertyValue((bool)_cropToMask)); }
             }
         }
     }
@@ -1960,28 +1993,112 @@ namespace Tizen.NUI
         {
         }
 
-        private string _url = null;
+        private List<string> _urls = null;
+        private int? _batchSize = null;
+        private int? _cacheSize = null;
+        private float? _frameDelay = null;
 
         public string URL
         {
             get
             {
-                return _url;
+                if( _urls == null )
+                {
+                    return _urls[0];
+                }
+                else
+                {
+                    return null;
+                }
             }
             set
             {
-                _url = value;
+                if( _urls == null )
+                {
+                    _urls = new List<string>();
+                    _urls.Add(value);
+                }
+                else
+                {
+                    _urls[0] = value;
+                }
+                UpdateVisual();
+            }
+        }
+
+        public List<string> URLS
+        {
+            get
+            {
+                return _urls;
+            }
+            set
+            {
+                _urls = value;
+                UpdateVisual();
+            }
+        }
+
+        public int BatchSize
+        {
+            get
+            {
+                return _batchSize ?? 1;
+            }
+            set
+            {
+                _batchSize = value;
+                UpdateVisual();
+            }
+        }
+
+        public int CacheSize
+        {
+            get
+            {
+                return _cacheSize ?? 1;
+            }
+            set
+            {
+                _cacheSize = value;
+                UpdateVisual();
+            }
+        }
+        public float FrameDelay
+        {
+            get
+            {
+                return _frameDelay ?? 0.1f;
+            }
+            set
+            {
+                _frameDelay = value;
                 UpdateVisual();
             }
         }
 
         protected override void ComposingPropertyMap()
         {
-            if (_url != null)
+            if (_urls != null)
             {
                 _outputVisualMap = new PropertyMap();
                 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.AnimatedImage));
-                _outputVisualMap.Add(ImageVisualProperty.URL, new PropertyValue(_url));
+                if( _urls.Count == 1 )
+                {
+                    _outputVisualMap.Add(ImageVisualProperty.URL, new PropertyValue(_urls[0]));
+                }
+                else
+                {
+                    var urlArray = new PropertyArray();
+                    foreach( var url in _urls)
+                    {
+                        urlArray.Add(new PropertyValue(url));
+                    }
+                    _outputVisualMap.Add( ImageVisualProperty.URL, ( new PropertyValue( urlArray ) ) );
+                }
+                if (_batchSize != null ) {_outputVisualMap.Add((int)ImageVisualProperty.BatchSize, new PropertyValue((int)_batchSize)); }
+                if (_cacheSize != null ) {_outputVisualMap.Add((int)ImageVisualProperty.CacheSize, new PropertyValue((int)_cacheSize)); }
+                if (_frameDelay != null ) {_outputVisualMap.Add((int)ImageVisualProperty.FrameDelay, new PropertyValue((float)_frameDelay)); }
                 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
                 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
                 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }