diff options
Diffstat (limited to 'Tizen.NUI')
-rwxr-xr-x | Tizen.NUI/src/public/BaseComponents/ImageView.cs | 52 | ||||
-rwxr-xr-x | Tizen.NUI/src/public/Layer.cs | 62 | ||||
-rwxr-xr-x | Tizen.NUI/src/public/VisualMaps.cs | 7 | ||||
-rwxr-xr-x | Tizen.NUI/src/public/Window.cs | 65 |
4 files changed, 115 insertions, 71 deletions
diff --git a/Tizen.NUI/src/public/BaseComponents/ImageView.cs b/Tizen.NUI/src/public/BaseComponents/ImageView.cs index 2c721a7..f1da24c 100755 --- a/Tizen.NUI/src/public/BaseComponents/ImageView.cs +++ b/Tizen.NUI/src/public/BaseComponents/ImageView.cs @@ -448,7 +448,7 @@ namespace Tizen.NUI.BaseComponents { get { - return _borderOnly; + return _borderOnly ?? false; } set { @@ -457,27 +457,53 @@ namespace Tizen.NUI.BaseComponents } } - private void UpdateImage() + public bool SynchronosLoading { - if (_border != null && _url != null) + get + { + return _synchronousLoading ?? false; + } + set { - _nPatchMap = new PropertyMap(); - _nPatchMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.NPatch)); - _nPatchMap.Add(NpatchImageVisualProperty.URL, new PropertyValue(_url)); - _nPatchMap.Add(NpatchImageVisualProperty.Border, new PropertyValue(_border)); - if (_borderOnly) { _nPatchMap.Add(NpatchImageVisualProperty.BorderOnly, new PropertyValue(_borderOnly)); } - SetProperty(ImageView.Property.IMAGE, new PropertyValue(_nPatchMap)); + _synchronousLoading = value; + UpdateImage(); } - else + } + + private void UpdateImage() + { + if (_url != null) { - if (_url != null) { SetProperty(ImageView.Property.RESOURCE_URL, new PropertyValue(_url)); } + if (_border != null) + { // for nine-patch image + _nPatchMap = new PropertyMap(); + _nPatchMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.NPatch)); + _nPatchMap.Add(NpatchImageVisualProperty.URL, new PropertyValue(_url)); + _nPatchMap.Add(NpatchImageVisualProperty.Border, new PropertyValue(_border)); + if (_borderOnly != null) { _nPatchMap.Add(NpatchImageVisualProperty.BorderOnly, new PropertyValue((bool)_borderOnly)); } + if (_synchronousLoading != null) _nPatchMap.Add(NpatchImageVisualProperty.SynchronousLoading, new PropertyValue((bool)_synchronousLoading)); + SetProperty(ImageView.Property.IMAGE, new PropertyValue(_nPatchMap)); + } + else if(_synchronousLoading != null) + { // for normal image, with synchronous loading property + PropertyMap imageMap = new PropertyMap(); + imageMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Image)); + imageMap.Add(ImageVisualProperty.URL, new PropertyValue(_url)); + imageMap.Add(ImageVisualProperty.SynchronousLoading, new PropertyValue((bool)_synchronousLoading)); + SetProperty(ImageView.Property.IMAGE, new PropertyValue(imageMap)); + } + else + { // just for normal image + SetProperty(ImageView.Property.RESOURCE_URL, new PropertyValue(_url)); + } } } private Rectangle _border = null; - private bool _borderOnly = false; - private string _url = null; private PropertyMap _nPatchMap = null; + private bool? _synchronousLoading = null; + private bool? _borderOnly = null; + private string _url = null; } diff --git a/Tizen.NUI/src/public/Layer.cs b/Tizen.NUI/src/public/Layer.cs index 1aff277..26df66c 100755 --- a/Tizen.NUI/src/public/Layer.cs +++ b/Tizen.NUI/src/public/Layer.cs @@ -202,6 +202,13 @@ namespace Tizen.NUI return ret; } + /// <summary> + /// Search through this layer's hierarchy for an view with the given unique ID. + /// </summary> + /// <pre>This layer(the parent) has been initialized.</pre> + /// <remarks>The actor itself is also considered in the search.</remarks> + /// <param name="child">The id of the child to find</param> + /// <returns> A handle to the view if found, or an empty handle if not. </returns> public View FindChildById(uint id) { View ret = new View(NDalicPINVOKE.Actor_FindChildById(swigCPtr, id), true); @@ -210,6 +217,13 @@ namespace Tizen.NUI return ret; } + /// <summary> + /// Adds a child view to this layer. + /// </summary> + /// <pre>This layer(the parent) has been initialized. The child view has been initialized. The child view is not the same as the parent layer.</pre> + /// <post>The child will be referenced by its parent. This means that the child will be kept alive, even if the handle passed into this method is reset or destroyed.</post> + /// <remarks>If the child already has a parent, it will be removed from old parent and reparented to this layer. This may change child's position, color, scale etc as it now inherits them from this layer.</remarks> + /// <param name="child">The child</param> public void Add(View child) { NDalicPINVOKE.Actor_Add(swigCPtr, View.getCPtr(child)); @@ -217,6 +231,11 @@ namespace Tizen.NUI throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } + /// <summary> + /// Removes a child View from this layer. If the view was not a child of this layer, this is a no-op. + /// </summary> + /// <pre>This layer(the parent) has been initialized. The child view is not the same as the parent view.</pre> + /// <param name="child">The child</param> public void Remove(View child) { NDalicPINVOKE.Actor_Remove(swigCPtr, View.getCPtr(child)); @@ -489,6 +508,49 @@ namespace Tizen.NUI } } + /// <summary> + /// Gets/Sets the Layer's name. + /// </summary> + public string Name + { + get + { + return GetName(); + } + set + { + SetName(value); + } + } + + internal string GetName() + { + string ret = NDalicPINVOKE.Actor_GetName(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal void SetName(string name) + { + NDalicPINVOKE.Actor_SetName(swigCPtr, name); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// <summary> + /// Retrieves the number of children held by the layer. + /// </summary> + /// <pre>The layer has been initialized.</pre> + /// <returns>The number of children</returns> + public uint GetChildCount() + { + uint ret = NDalicPINVOKE.Actor_GetChildCount(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } } diff --git a/Tizen.NUI/src/public/VisualMaps.cs b/Tizen.NUI/src/public/VisualMaps.cs index 1e76181..c417461 100755 --- a/Tizen.NUI/src/public/VisualMaps.cs +++ b/Tizen.NUI/src/public/VisualMaps.cs @@ -15,9 +15,6 @@ namespace Tizen.NUI { - using System; - using System.Runtime.InteropServices; - using Tizen.NUI.UIComponents; using Tizen.NUI.BaseComponents; /// <summary> @@ -65,11 +62,11 @@ namespace Tizen.NUI /// or absolute (in world units).<br> /// Optional. /// </summary> - public Vector2 Size + public Size2D Size { get { - return _visualSize ?? (new Vector2(1.0f, 1.0f)); + return _visualSize ?? (new Size2D(1, 1)); } set { diff --git a/Tizen.NUI/src/public/Window.cs b/Tizen.NUI/src/public/Window.cs index 812bd60..7da0d14 100755 --- a/Tizen.NUI/src/public/Window.cs +++ b/Tizen.NUI/src/public/Window.cs @@ -399,55 +399,26 @@ namespace Tizen.NUI return ret; } - - - /// <summary> - /// Creates an initialized handle to a new Window. - /// </summary> - /// <param name="windowPosition">The position and size of the Window</param> - /// <param name="name">The Window title</param> - /// <param name="isTransparent">Whether Window is transparent</param> - public Window(Rectangle windowPosition, string name, bool isTransparent) : this(NDalicPINVOKE.Window_New__SWIG_0(Rectangle.getCPtr(windowPosition), name, isTransparent), true) + internal Window(Rectangle windowPosition, string name, bool isTransparent) : this(NDalicPINVOKE.Window_New__SWIG_0(Rectangle.getCPtr(windowPosition), name, isTransparent), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - /// <summary> - /// Creates an initialized handle to a new Window. - /// </summary> - /// <param name="windowPosition">The position and size of the Window</param> - /// <param name="name">The Window title</param> - public Window(Rectangle windowPosition, string name) : this(NDalicPINVOKE.Window_New__SWIG_1(Rectangle.getCPtr(windowPosition), name), true) + internal Window(Rectangle windowPosition, string name) : this(NDalicPINVOKE.Window_New__SWIG_1(Rectangle.getCPtr(windowPosition), name), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - /// <summary> - /// Creates an initialized handle to a new Window. - /// </summary> - /// <param name="windowPosition">The position and size of the Window</param> - /// <param name="name">The Window title</param> - /// <param name="className">The Window class name</param> - /// <param name="isTransparent">Whether Window is transparent</param> - public Window(Rectangle windowPosition, string name, string className, bool isTransparent) : this(NDalicPINVOKE.Window_New__SWIG_2(Rectangle.getCPtr(windowPosition), name, className, isTransparent), true) + internal Window(Rectangle windowPosition, string name, string className, bool isTransparent) : this(NDalicPINVOKE.Window_New__SWIG_2(Rectangle.getCPtr(windowPosition), name, className, isTransparent), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - /// <summary> - /// Creates an initialized handle to a new Window. - /// </summary> - /// <param name="windowPosition">The position and size of the Window</param> - /// <param name="name">The Window title</param> - /// <param name="className">The Window class name</param> - public Window(Rectangle windowPosition, string name, string className) : this(NDalicPINVOKE.Window_New__SWIG_3(Rectangle.getCPtr(windowPosition), name, className), true) + internal Window(Rectangle windowPosition, string name, string className) : this(NDalicPINVOKE.Window_New__SWIG_3(Rectangle.getCPtr(windowPosition), name, className), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } + internal Window(Window handle) : this(NDalicPINVOKE.new_Window__SWIG_1(Window.getCPtr(handle)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -460,31 +431,18 @@ namespace Tizen.NUI return ret; } - /// <summary> - /// This sets whether the indicator bar should be shown or not. - /// </summary> - /// <param name="visibleMode">Visible mode for indicator bar, Visible in default</param> internal void ShowIndicator(Window.IndicatorVisibleMode visibleMode) { NDalicPINVOKE.Window_ShowIndicator(swigCPtr, (int)visibleMode); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - /// <summary> - /// This sets the opacity mode of indicator bar. - /// </summary> - /// <param name="opacity">The opacity mode</param> internal void SetIndicatorBgOpacity(Window.IndicatorBgOpacity opacity) { NDalicPINVOKE.Window_SetIndicatorBgOpacity(swigCPtr, (int)opacity); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - /// <summary> - /// This sets the orientation of indicator bar.<br> - /// It does not implicitly show the indicator if it is currently hidden.<br> - /// </summary> - /// <param name="orientation">The orientation</param> internal void RotateIndicator(Window.WindowOrientation orientation) { NDalicPINVOKE.Window_RotateIndicator(swigCPtr, (int)orientation); @@ -799,6 +757,7 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } + /// <summary> /// Grabs the key specified by a key for a window in a GrabMode. <br> /// Details: This function can be used for following example scenarios: <br> @@ -815,6 +774,7 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } + /// <summary> /// Ungrabs the key specified by a key for a window. <br> /// Note: If this function is called between key down and up events of a grabbed key, an application doesn't receive the key up event. <br> @@ -827,6 +787,7 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } + internal System.IntPtr GetNativeWindowHandler() { System.IntPtr ret = NDalicManualPINVOKE.GetNativeWindowHandler(HandleRef.ToIntPtr(this.swigCPtr)); @@ -834,8 +795,6 @@ namespace Tizen.NUI return ret; } - - /// <summary> /// Enumeration for orientation of the window is the way in which a rectangular page is oriented for normal viewing. /// </summary> @@ -1233,11 +1192,11 @@ namespace Tizen.NUI /// <summary> /// Window size property (read-only). /// </summary> - public Vector2 Size + public Size2D Size { get { - Vector2 ret = GetSize(); + Size2D ret = GetSize(); return ret; } } @@ -1245,7 +1204,7 @@ namespace Tizen.NUI /// <summary> /// Background color property. /// </summary> - public Vector4 BackgroundColor + public Color BackgroundColor { set { @@ -1253,7 +1212,7 @@ namespace Tizen.NUI } get { - Vector4 ret = GetBackgroundColor(); + Color ret = GetBackgroundColor(); return ret; } } |