[NUI] Rebase DevelNUI (#2507)
authorhuiyueun <35286162+huiyueun@users.noreply.github.com>
Mon, 11 Jan 2021 05:29:41 +0000 (14:29 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Wed, 27 Jan 2021 12:55:18 +0000 (21:55 +0900)
* [NUI] Fix a build warning CA1717 (#2422)

- Only FlagsAttribute enums should have plural names
 https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1717

- Some enums cannot be fixed because they're already public APIs,
 so added suppress messages for CA1717 build warning.
- Some enums are already used as hidden APIs,
 so added Obsolete tags and made a fixed version as singular name.
- Tizen.NUI.Components.ControlStates enum should be marked with the FlagsAttribute.

Signed-off-by: Seoyeon Kim <seoyeon2.kim@samsung.com>
Co-authored-by: Jiyun Yang <ji.yang@samsung.com>
* [NUI] Fix CA2000 warning for Window

* Modify dispose issue for window

* [NUI] Fix CA2002

Do not lock on objects with weak identity
https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2002

* [NUI] Fix CA2000 issue in DefaultTheme(Dispose object before losing scope)

* [NUI] Add internal and hidden APIs which are currently used

- Add internal and hidden APIs which are currently used. otherwise removing them causes build errors.
- Let users to use proper APIs by deleting these deprecated APIs
- User can be informed that these are deprecated and should not be used by warning messeges during build time.

* [NUI] Fix the behavior as for View.BackgroundImage to be cleared when null set

- Change the behavior of View.BackgroundImage property from API9
- https://code.sec.samsung.net/jira/browse/GRE-2078

* [NUI] Adds StopBehavior and CurrentFrame properties to the AnimatedImageView

Signed-off-by: Seungho Baek <sbsh.baek@samsung.com>
* [NUI] Modify CA2000 warnings for Visual

* [NUI] Add Obsolete Attribute for ControlStates enum

`ControlStates` enum will be removed in API10.

We can use `ControlState` class instead.

* Revert "[NUI] Modify CA2000 warnings for Visual"

This reverts commit afa5fef90e7c8b370fc0e505d2420a7a87083344.

* [NUI] Override Dispose() in Navigator

Pages pushed into Navigator are disposed if Navigator is disposed.

To override Dispose() in Navigator, two dictionaries are required to
remove disposed navigator from dictionary.

TODO: Needs to consider how to remove disposed window from dictionary.

* [NUI] Modify CA2000 Warnings for VisualMap (#2460)

* Revert "[NUI] Fix CA2000 issue in DefaultTheme(Dispose object before losing scope)" (#2463)

This reverts commit cff3fd4d9fd6fd461263e742e296a5397e9563a0.

This causes segfault to dispose styles after passing them through `AddStyleWithoutClone` method.
Because the theme object holds the passed style objects.
Which means the responsibility to dispose the object is transferred to the theme object.

In this case, we can suppress this warning.
https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2000

Instead revert the patch, it suppressed CA2000 warning.

* [NUI] Fix crash issue in PaginationStyle. (#2448)

* [NUI] Add ImageList property (#2449)

Signed-off-by: huiyu.eun <huiyu.eun@samsung.com>
Co-authored-by: YeongJong Lee <cleanlyj@naver.com>
* [NUI] Modify CA2000 Warnings for TextVisual and VisualAnimator

* Use correct calling convention

Some callback and functions from DALi expected the calling convention to
be cdecl, this commit makes it right. The amd64 platforms this is rarely
a problem since arguments are passed through CPU registers, but in x86
this leads to stack corruption.

* [NUI] Fix CA2000 issues in Model3dView and RenderTask.

* [NUI] remove needless null validation in LayoutItem.SetFrame (#2469)

* [NUI] Fix CA1716 build warning

* [NUI] Fix CA2000 issues for Visuals (#2473)

Co-authored-by: Jiyun Yang <ji.yang@samsung.com>
* [NUI] Fix build error and large text size issue

* [NUI] Fix null exception in Loading and improve code (#2478)

This fixes null pointer exception in Loading when running following sample,

```C#
var loading1 = new Loading(new LoadingStyle
{
    Size = new Size(100, 100),
    Position = new Position(0, 100),
    Images  = imageArray
});
```

Plus, this patch removes redundant behaviors when applying a style to a Loading component.
All components copies a default style to the component properties when it is created.
When copying a style, all bindable properties defined in the style class that is not null value are copied to the component properties,
so it is important to keep null value for the property that is not set by user.
Hence this patch removes code that allocates empty list object in the getter of ImageList bindable property.

Signed-off-by: Jiyun Yang <ji.yang@samsung.com>
Co-authored-by: Seoyeon2Kim <34738918+Seoyeon2Kim@users.noreply.github.com>
* [NUI] remove unnecessary using in Size2D.cs (#2487)

Co-authored-by: Yeongjong Lee <yj34.lee@samsung.com>
Co-authored-by: Jiyun Yang <ji.yang@samsung.com>
* [NUI] Add AppBar class (#2435)

AppBar shows title text and provides navigation and action functions on
Page.

Co-authored-by: Jaehyun Cho <jae_hyun.cho@samsung.com>
* [NUI] Fix CA2000 issues for Visual (#2491)

Co-authored-by: Jiyun Yang <ji.yang@samsung.com>
* [NUI] fixed memory leak

* [NUI] Update AccessibilitySample for readability (#2500)

- Updated the sample to fit the size and make it easier to read.

Signed-off-by: Seoyeon Kim <seoyeon2.kim@samsung.com>
* [NUI] Fix CA2000 warning issues of View and ViewImpl.

* [NUI] Fix the incorrect parameter for XamlBinding

 - Change to `SizeTypeConverter` for the correct compiledVersion

Signed-off-by: Seoyeon Kim <seoyeon2.kim@samsung.com>
* [NUI] Fix CA2000 issues for Render Shadow (#2493)

* [NUI] Fix CA2000 issues for Render Shadow

* [NUI] Fix CA2000 for Render

* [NUI] Fix CA2000 Warnings

* [NUI] Update description of Transition classes

Signed-off-by: Jiyun Yang <ji.yang@samsung.com>
* [NUI] Remove since_tizen tag for internal APIs

Signed-off-by: Jiyun Yang <ji.yang@samsung.com>
* [NUI] Fix build warning CA1712

CA1712: Do not prefix enum values with type name

The name can not be changed becuase this enum is publicly open.
Suppress warning messages.

* Revert "[NUI] Fix CA2000 Warnings"

This reverts commit 92f2d926ec881a0ccacd447401526dcd19cf01b0.

* Revert "[NUI] Fix CA2000 warning issues of View and ViewImpl."

This reverts commit 424bdae58a6f7d71ad3e531fd157a92d513255c4.

Co-authored-by: Seoyeon2Kim <34738918+Seoyeon2Kim@users.noreply.github.com>
Co-authored-by: Jiyun Yang <ji.yang@samsung.com>
Co-authored-by: zhouleonlei <zhouleon.lei@samsung.com>
Co-authored-by: Daekwang Ryu <dkdk.ryu@samsung.com>
Co-authored-by: guowei.wang <guowei.wang@samsung.com>
Co-authored-by: Dongsug Song <dongsug.song@samsung.com>
Co-authored-by: Seungho Baek <sbsh.baek@samsung.com>
Co-authored-by: Yeongjong Lee <cleanlyj@naver.com>
Co-authored-by: Jaehyun Cho <jae_hyun.cho@samsung.com>
Co-authored-by: zhouleonlei <56956725+zhouleonlei@users.noreply.github.com>
Co-authored-by: Wander Lairson Costa <wander.lairson@gmail.com>
Co-authored-by: Moonhee, Choi <mh0310.choi@samsung.com>
Co-authored-by: Yeongjong Lee <yj34.lee@samsung.com>
Co-authored-by: Jaehyun Cho <29364140+jaehyun0cho@users.noreply.github.com>
Co-authored-by: Joogab Yun <joogab.yun@samsung.com>
Co-authored-by: Seoyeon Kim <seoyeon2.kim@samsung.com>
Co-authored-by: Bowon Ryu <bowon.ryu@samsung.com>
src/Tizen.NUI/src/public/BaseComponents/AnimatedVectorImageView.cs
src/Tizen.NUI/src/public/Window.cs

index 511a274..dc0d0e3 100755 (executable)
@@ -179,8 +179,8 @@ namespace Tizen.NUI.BaseComponents
                     value = totalFrameNum - 1;
                 }
 
-                currentFrame = value;
-                AnimationState = AnimationStates.Paused;
+                mCurrentFrame = value;
+                AnimationState = State.Paused;
 
                 base.SetMinMaxFrame(0, totalFrameNum - 1);
                 base.CurrentFrame = currentFrame;
@@ -194,7 +194,7 @@ namespace Tizen.NUI.BaseComponents
         /// RepeatMode of animation.
         /// </summary>
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public RepeatModes RepeatMode
+        public RepeatModeType RepeatMode
         {
             set
             {
@@ -203,10 +203,10 @@ namespace Tizen.NUI.BaseComponents
 
                 switch (repeatMode)
                 {
-                    case RepeatModes.Restart:
+                    case RepeatModeType.Restart:
                         LoopingMode = LoopingModeType.Restart;
                         break;
-                    case RepeatModes.Reverse:
+                    case RepeatModeType.Reverse:
                         LoopingMode = LoopingModeType.AutoReverse;
                         break;
                     default:
@@ -252,7 +252,7 @@ namespace Tizen.NUI.BaseComponents
         /// Get state of animation.
         /// </summary>
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public AnimationStates AnimationState
+        public State AnimationState
         {
             private set
             {
@@ -260,11 +260,11 @@ namespace Tizen.NUI.BaseComponents
             }
             get
             {
-                if (CurrentAnimationState == AnimationStates.Playing)
+                if (CurrentAnimationState == State.Playing)
                 {
                     if (PlayState == PlayStateType.Stopped)
                     {
-                        CurrentAnimationState = AnimationStates.Stopped;
+                        CurrentAnimationState = State.Stopped;
                     }
                 }
                 return CurrentAnimationState;
@@ -385,7 +385,7 @@ namespace Tizen.NUI.BaseComponents
             base.Margin = tmp;
 
             base.Play();
-            AnimationState = AnimationStates.Playing;
+            AnimationState = State.Playing;
 
             tlog.Fatal(tag, $" [{GetId()}] isMinMaxSet={isMinMaxSet}) ]VAV END]");
         }
@@ -404,7 +404,7 @@ namespace Tizen.NUI.BaseComponents
             }
 
             base.Pause();
-            AnimationState = AnimationStates.Paused;
+            AnimationState = State.Paused;
 
             tlog.Fatal(tag, $" [{GetId()}] ]VAV END]");
         }
@@ -418,7 +418,7 @@ namespace Tizen.NUI.BaseComponents
         /// End action is StopFinal, Animation Stops at the Max Frame
         /// </param>
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public void Stop(EndActions endAction = EndActions.Cancel)
+        public void Stop(EndAction endAction = EndAction.Cancel)
         {
             tlog.Fatal(tag, $"[VAV START[ [{GetId()}] endAction:({endAction}), PlayState={PlayState}");
 
@@ -427,7 +427,7 @@ namespace Tizen.NUI.BaseComponents
                 throw new InvalidOperationException("Resource Url not yet Set");
             }
 
-            if (AnimationState == AnimationStates.Stopped)
+            if (AnimationState == State.Stopped)
             {
                 return;
             }
@@ -437,13 +437,13 @@ namespace Tizen.NUI.BaseComponents
                 internalEndAction = endAction;
                 switch (endAction)
                 {
-                    case EndActions.Cancel:
+                    case EndAction.Cancel:
                         StopBehavior = StopBehaviorType.CurrentFrame;
                         break;
-                    case EndActions.Discard:
+                    case EndAction.Discard:
                         StopBehavior = StopBehaviorType.MinimumFrame;
                         break;
-                    case EndActions.StopFinal:
+                    case EndAction.StopFinal:
                         StopBehavior = StopBehaviorType.MaximumFrame;
                         break;
                     default:
@@ -451,11 +451,11 @@ namespace Tizen.NUI.BaseComponents
                         break;
                 }
             }
-            AnimationState = AnimationStates.Stopped;
+            AnimationState = State.Stopped;
 
             base.Stop();
 
-            if (endAction == EndActions.StopFinal)
+            if (endAction == EndAction.StopFinal)
             {
                 switch (isMinMaxSet)
                 {
@@ -515,6 +515,7 @@ namespace Tizen.NUI.BaseComponents
         /// <summary>
         /// RepeatMode type of animation.
         /// </summary>
+        // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
         [EditorBrowsable(EditorBrowsableState.Never)]
         public enum RepeatModeType
         {
@@ -556,6 +557,28 @@ namespace Tizen.NUI.BaseComponents
         /// <summary>
         /// EndAction of animation.
         /// </summary>
+        // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public enum EndAction
+        {
+            /// <summary> End action is Cancel, Animation Stops at the Current Frame.</summary>
+            // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
+            [EditorBrowsable(EditorBrowsableState.Never)]
+            Cancel = 0,
+            /// <summary>  End action is Discard, Animation Stops at the Min Frame</summary>
+            [Obsolete("Please do not use! This will be removed. Please use AnimatedVectorImageView.EndAction.Discard instead!")]
+            [EditorBrowsable(EditorBrowsableState.Never)]
+            Discard = 1,
+            /// <summary> End action is StopFinal, Animation Stops at the Max Frame</summary>
+            [Obsolete("Please do not use! This will be removed. Please use AnimatedVectorImageView.EndAction.StopFinal instead!")]
+            [EditorBrowsable(EditorBrowsableState.Never)]
+            StopFinal = 2
+        }
+
+        /// <summary>
+        /// AnimationState of animation.
+        /// </summary>
+        [Obsolete("Please do not use! This will be removed. Please use AnimatedVectorImageView.State instead!")]
         [EditorBrowsable(EditorBrowsableState.Never)]
         public enum EndAction
         {
@@ -596,6 +619,27 @@ namespace Tizen.NUI.BaseComponents
         /// <summary>
         /// Animation State of animation.
         /// </summary>
+        // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public enum State
+        {
+            /// <summary> The animation has stopped.</summary>
+            // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
+            [EditorBrowsable(EditorBrowsableState.Never)]
+            Stopped = PlayStateType.Stopped,
+            /// <summary> The animation is playing.</summary>
+            [Obsolete("Please do not use! This will be removed. Please use AnimatedVectorImageView.State.Playing instead!")]
+            [EditorBrowsable(EditorBrowsableState.Never)]
+            Playing = PlayStateType.Playing,
+            /// <summary> The animation is paused.</summary>
+            [Obsolete("Please do not use! This will be removed. Please use AnimatedVectorImageView.State.Paused instead!")]
+            [EditorBrowsable(EditorBrowsableState.Never)]
+            Paused = PlayStateType.Paused
+        }
+
+        /// <summary>
+        /// Animation State of animation.
+        /// </summary>
         [EditorBrowsable(EditorBrowsableState.Never)]
         public new enum State
         {
@@ -615,15 +659,14 @@ namespace Tizen.NUI.BaseComponents
         #endregion Internal
 
         #region Private
-        private string resourceURL = null;
-        private int repeatCount = 0;
-        private int totalFrameNum = 0;
-        private int minFrame = -1, mMaxFrame = -1;
-        private minMaxSetTypes isMinMaxSet = minMaxSetTypes.NotSetByUser;
-        private int currentFrame = -1;
-        private EndActions internalEndAction = EndActions.Cancel;
-        private RepeatModeType repeat = RepeatModeType.Restart;
-        private RepeatModes repeatMode = RepeatModes.Restart;
+        private string mResourceURL = null;
+        private int mRepeatCount = 0;
+        private int mTotalFrameNum = 0;
+        private RepeatModeType mRepeatMode = RepeatModeType.Restart;
+        private int mMinFrame = -1, mMaxFrame = -1;
+        private minMaxSetTypes mIsMinMaxSet = minMaxSetTypes.NotSetByUser;
+        private int mCurrentFrame = -1;
+        private EndAction mEndAction = EndAction.Cancel;
         private enum minMaxSetTypes
         {
             NotSetByUser,
@@ -633,7 +676,7 @@ namespace Tizen.NUI.BaseComponents
         }
 
         private string tag = "NUITEST";
-        private AnimationStates CurrentAnimationState = AnimationStates.Stopped;
+        private State CurrentAnimationState = State.Stopped;
         #endregion Private
     }
 }
index 113a327..fa510b9 100755 (executable)
@@ -1230,6 +1230,7 @@ namespace Tizen.NUI
         {
             var val = new Uint16Pair(Interop.Window.GetSize(SwigCPtr), true);
             Vector2 ret = new Vector2(val.GetWidth(), val.GetHeight());
+            val.Dispose();
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
@@ -1326,6 +1327,7 @@ namespace Tizen.NUI
         {
             var val = new Uint16Pair(Interop.Window.GetSize(SwigCPtr), true);
             Size2D ret = new Size2D(val.GetWidth(), val.GetHeight());
+            val.Dispose();
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }