diff --git a/src/Tizen.NUI/src/internal/Common/Disposable.cs b/src/Tizen.NUI/src/internal/Common/Disposable.cs index 7884c303e28..72d1dc8ef47 100644 --- a/src/Tizen.NUI/src/internal/Common/Disposable.cs +++ b/src/Tizen.NUI/src/internal/Common/Disposable.cs @@ -25,6 +25,11 @@ namespace Tizen.NUI /// 6 public class Disposable : global::System.IDisposable { + static internal void Preload() + { + // Do nothing. Just call for load static values. + } + /// /// The flag to check if it is already disposed of. /// diff --git a/src/Tizen.NUI/src/internal/Interop/NDalicPINVOKE.cs b/src/Tizen.NUI/src/internal/Interop/NDalicPINVOKE.cs index a55f6227534..560684c28b5 100755 --- a/src/Tizen.NUI/src/internal/Interop/NDalicPINVOKE.cs +++ b/src/Tizen.NUI/src/internal/Interop/NDalicPINVOKE.cs @@ -245,6 +245,14 @@ static NDalicPINVOKE() { } + static internal void Preload() + { + // Do nothing. Just call for load static values. + var temporalSwigExceptionHelper = swigExceptionHelper; + var temporalSwigStringHelper = swigStringHelper; + ThrowExceptionIfExists(); + } + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_BaseHandle")] public static extern void DeleteBaseHandle(global::System.Runtime.InteropServices.HandleRef jarg1); diff --git a/src/Tizen.NUI/src/public/Animation/Animatable.cs b/src/Tizen.NUI/src/public/Animation/Animatable.cs index 91233e65d70..b587488e575 100755 --- a/src/Tizen.NUI/src/public/Animation/Animatable.cs +++ b/src/Tizen.NUI/src/public/Animation/Animatable.cs @@ -26,6 +26,11 @@ namespace Tizen.NUI /// 3 public class Animatable : BaseHandle { + static internal new void Preload() + { + BaseHandle.Preload(); + // Do nothing. Just call for load static values. + } /// /// Create an instance of animatable. diff --git a/src/Tizen.NUI/src/public/Application/NUIApplication.cs b/src/Tizen.NUI/src/public/Application/NUIApplication.cs index 457b5916e09..eabcdef9ef4 100755 --- a/src/Tizen.NUI/src/public/Application/NUIApplication.cs +++ b/src/Tizen.NUI/src/public/Application/NUIApplication.cs @@ -640,6 +640,22 @@ protected override void OnCreate() static public void Preload() { Interop.Application.PreInitialize(); + + // Initialize some static utility + var disposalbeQueue = DisposeQueue.Instance; + var registry = Registry.Instance; + + // Initialize some BaseComponent static variables now + BaseComponents.View.Preload(); + BaseComponents.ImageView.Preload(); + BaseComponents.TextLabel.Preload(); + BaseComponents.TextEditor.Preload(); + BaseComponents.TextField.Preload(); + Disposable.Preload(); + + // Initialize exception tasks. It must be called end of Preload() + NDalicPINVOKE.Preload(); + IsPreload = true; } diff --git a/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs b/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs index dd9f625486e..407d042d46b 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs @@ -32,6 +32,15 @@ public partial class ImageView : View { static ImageView() { } + static internal new void Preload() + { + // Do not call View.Preload(), since we already call it + + Property.Preload(); + // Do nothing. Just call for load static values. + var temporalCachedImagePropertyKeyList = cachedImagePropertyKeyList; + } + private EventHandler _resourceReadyEventHandler; private ResourceReadyEventCallbackType _resourceReadyEventCallback; private EventHandler _resourceLoadedEventHandler; @@ -1882,6 +1891,11 @@ public ResourceLoadingStatusType Status internal static readonly int PixelArea = Interop.ImageView.PixelAreaGet(); internal static readonly int PlaceHolderUrl = Interop.ImageView.PlaceHolderImageGet(); internal static readonly int TransitionEffect = Interop.ImageView.TransitionEffectGet(); + + internal static void Preload() + { + // Do nothing. Just call for load static values. + } } private enum ImageType diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs b/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs index 85f6d988080..61b41598341 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs @@ -57,6 +57,14 @@ public partial class TextEditor : View static TextEditor() { } + static internal new void Preload() + { + // Do not call View.Preload(), since we already call it + + Property.Preload(); + // Do nothing. Just call for load static values. + } + /// /// Creates the TextEditor control. /// @@ -2767,6 +2775,11 @@ private void TextEditorTextChanged(object sender, TextChangedEventArgs e) internal static readonly int InputFilter = Interop.TextEditor.InputFilterGet(); internal static readonly int Strikethrough = Interop.TextEditor.StrikethroughGet(); internal static readonly int CharacterSpacing = Interop.TextEditor.CharacterSpacingGet(); + + internal static void Preload() + { + // Do nothing. Just call for load static values. + } } internal class InputStyle diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextField.cs b/src/Tizen.NUI/src/public/BaseComponents/TextField.cs index 36f50b05b27..e2506a78f7a 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextField.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextField.cs @@ -57,6 +57,14 @@ public partial class TextField : View static TextField() { } + static internal new void Preload() + { + // Do not call View.Preload(), since we already call it + + Property.Preload(); + // Do nothing. Just call for load static values. + } + /// /// Creates the TextField control. /// @@ -2765,6 +2773,11 @@ private void TextFieldTextChanged(object sender, TextChangedEventArgs e) internal static readonly int InputFilter = Interop.TextField.InputFilterGet(); internal static readonly int Strikethrough = Interop.TextField.StrikethroughGet(); internal static readonly int CharacterSpacing = Interop.TextField.CharacterSpacingGet(); + + internal static void Preload() + { + // Do nothing. Just call for load static values. + } } internal class InputStyle diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs b/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs index 1c979212c11..98474f4e8a7 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs @@ -84,6 +84,14 @@ protected override void OnMeasure(MeasureSpecification widthMeasureSpec, Measure static TextLabel() { } + static internal new void Preload() + { + // Do not call View.Preload(), since we already call it + + Property.Preload(); + // Do nothing. Just call for load static values. + } + private static SystemFontTypeChanged systemFontTypeChanged = new SystemFontTypeChanged(); private static SystemLocaleLanguageChanged systemLocaleLanguageChanged = new SystemLocaleLanguageChanged(); static private string defaultStyleName = "Tizen.NUI.BaseComponents.TextLabel"; @@ -1847,6 +1855,11 @@ private void RequestLayout() internal static readonly int EllipsisPosition = Interop.TextLabel.EllipsisPositionGet(); internal static readonly int Strikethrough = Interop.TextLabel.StrikethroughGet(); internal static readonly int CharacterSpacing = Interop.TextLabel.CharacterSpacingGet(); + + internal static void Preload() + { + // Do nothing. Just call for load static values. + } } private void OnShadowColorChanged(float x, float y, float z, float w) diff --git a/src/Tizen.NUI/src/public/BaseComponents/View.cs b/src/Tizen.NUI/src/public/BaseComponents/View.cs index 059284387b0..a2ca0546522 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/View.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/View.cs @@ -105,6 +105,16 @@ static View() RegisterAccessibilityDelegate(); } + static internal new void Preload() + { + Container.Preload(); + + // Do nothing. Just call for load static values. + var temporalPositionPropertyGroup = positionPropertyGroup; + var temporalSizePropertyGroup = sizePropertyGroup; + var temporalScalePropertyGroup = scalePropertyGroup; + } + /// /// Accessibility mode for controlling View's Accessible implementation. /// It is only relevant when deriving custom controls from View directly, diff --git a/src/Tizen.NUI/src/public/Common/BaseHandle.cs b/src/Tizen.NUI/src/public/Common/BaseHandle.cs index 5f85509181b..b8e7eb3ce76 100755 --- a/src/Tizen.NUI/src/public/Common/BaseHandle.cs +++ b/src/Tizen.NUI/src/public/Common/BaseHandle.cs @@ -28,6 +28,11 @@ namespace Tizen.NUI /// 3 public class BaseHandle : Element, global::System.IDisposable { + static internal void Preload() + { + // Do nothing. Just call for load static values. + } + /// /// swigCMemOwn /// diff --git a/src/Tizen.NUI/src/public/Common/Container.cs b/src/Tizen.NUI/src/public/Common/Container.cs index 13577bf0c79..fdfbf2c9c81 100755 --- a/src/Tizen.NUI/src/public/Common/Container.cs +++ b/src/Tizen.NUI/src/public/Common/Container.cs @@ -41,6 +41,14 @@ public abstract class Container : Animatable, IResourcesProvider ResourceDictionary _resources; bool IResourcesProvider.IsResourcesCreated => _resources != null; + static internal new void Preload() + { + Animatable.Preload(); + + // Do nothing. Just call for load static values. + var temporalXamlStyleProperty = XamlStyleProperty; + } + internal Container(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn) { // No un-managed data hence no need to store a native ptr