ResourceDictionary _resources;
public bool IsResourcesCreated => _resources != null;
- public delegate void resChangeCb (object sender, ResourcesChangedEventArgs e);
+ public delegate void resChangeCb(object sender, ResourcesChangedEventArgs e);
static private Dictionary<object, Dictionary<resChangeCb, int>> resourceChangeCallbackDict = new Dictionary<object, Dictionary<resChangeCb, int>>();
static public void AddResourceChangedCallback(object handle, resChangeCb cb)
// Initialize DisposeQueue Singleton class. This is also required to create DisposeQueue on main thread.
DisposeQueue.Instance.Initialize();
- NUIApplicationInitEventArgs e = new NUIApplicationInitEventArgs();
- // Populate all members of "e" (NUIApplicationInitEventArgs) with real data
- using (e.Application = Application.GetApplicationFromPtr(data))
+ if (_applicationInitEventHandler != null)
{
- if (_applicationInitEventHandler != null)
- {
- //here we send all data to user event handlers
- _applicationInitEventHandler(this, e);
- }
+ NUIApplicationInitEventArgs e = new NUIApplicationInitEventArgs();
+ e.Application = this;
+ _applicationInitEventHandler.Invoke(this, e);
}
-
}
/**
// Callback for Application TerminateSignal
private void OnNUIApplicationTerminate(IntPtr data)
{
- NUIApplicationTerminatingEventArgs e = new NUIApplicationTerminatingEventArgs();
-
- // Populate all members of "e" (NUIApplicationTerminateEventArgs) with real data
- using (e.Application = Application.GetApplicationFromPtr(data))
+ if (_applicationTerminateEventHandler != null)
{
- if (_applicationTerminateEventHandler != null)
- {
- //here we send all data to user event handlers
- _applicationTerminateEventHandler(this, e);
- }
+ NUIApplicationTerminatingEventArgs e = new NUIApplicationTerminatingEventArgs();
+ e.Application = this;
+ _applicationTerminateEventHandler.Invoke(this, e);
}
+
+ Window.Instance.DisconnectNativeSignals();
}
/**
// Callback for Application PauseSignal
private void OnNUIApplicationPause(IntPtr data)
{
- NUIApplicationPausedEventArgs e = new NUIApplicationPausedEventArgs();
-
- // Populate all members of "e" (NUIApplicationPauseEventArgs) with real data
- using (e.Application = Application.GetApplicationFromPtr(data))
+ if (_applicationPauseEventHandler != null)
{
- if (_applicationPauseEventHandler != null)
- {
- //here we send all data to user event handlers
- _applicationPauseEventHandler(this, e);
- }
+ NUIApplicationPausedEventArgs e = new NUIApplicationPausedEventArgs();
+ e.Application = this;
+ _applicationPauseEventHandler.Invoke(this, e);
}
}
// Callback for Application ResumeSignal
private void OnNUIApplicationResume(IntPtr data)
{
- NUIApplicationResumedEventArgs e = new NUIApplicationResumedEventArgs();
-
- // Populate all members of "e" (NUIApplicationResumeEventArgs) with real data
- using (e.Application = Application.GetApplicationFromPtr(data))
+ if (_applicationResumeEventHandler != null)
{
- if (_applicationResumeEventHandler != null)
- {
- //here we send all data to user event handlers
- _applicationResumeEventHandler(this, e);
- }
+ NUIApplicationResumedEventArgs e = new NUIApplicationResumedEventArgs();
+ e.Application = this;
+ _applicationResumeEventHandler.Invoke(this, e);
}
}
// Callback for Application ResetSignal
private void OnNUIApplicationReset(IntPtr data)
{
- NUIApplicationResetEventArgs e = new NUIApplicationResetEventArgs();
-
- // Populate all members of "e" (NUIApplicationResetEventArgs) with real data
- using (e.Application = Application.GetApplicationFromPtr(data))
+ if (_applicationResetEventHandler != null)
{
- if (_applicationResetEventHandler != null)
- {
- //here we send all data to user event handlers
- _applicationResetEventHandler(this, e);
- }
+ NUIApplicationResetEventArgs e = new NUIApplicationResetEventArgs();
+ e.Application = this;
+ _applicationResetEventHandler.Invoke(this, e);
}
}
// Callback for Application ResizeSignal
private void OnNUIApplicationResize(IntPtr data)
{
- NUIApplicationResizedEventArgs e = new NUIApplicationResizedEventArgs();
-
- // Populate all members of "e" (NUIApplicationResizeEventArgs) with real data
- using (e.Application = Application.GetApplicationFromPtr(data))
+ if (_applicationResizeEventHandler != null)
{
- if (_applicationResizeEventHandler != null)
- {
- //here we send all data to user event handlers
- _applicationResizeEventHandler(this, e);
- }
+ NUIApplicationResizedEventArgs e = new NUIApplicationResizedEventArgs();
+ e.Application = this;
+ _applicationResizeEventHandler.Invoke(this, e);
}
}
// Callback for Application LanguageChangedSignal
private void OnNUIApplicationLanguageChanged(IntPtr data)
{
- NUIApplicationLanguageChangedEventArgs e = new NUIApplicationLanguageChangedEventArgs();
-
- // Populate all members of "e" (NUIApplicationLanguageChangedEventArgs) with real data
- using (e.Application = Application.GetApplicationFromPtr(data))
+ if (_applicationLanguageChangedEventHandler != null)
{
- if (_applicationLanguageChangedEventHandler != null)
- {
- //here we send all data to user event handlers
- _applicationLanguageChangedEventHandler(this, e);
- }
+ NUIApplicationLanguageChangedEventArgs e = new NUIApplicationLanguageChangedEventArgs();
+ e.Application = this;
+ _applicationLanguageChangedEventHandler.Invoke(this, e);
}
}
// Callback for Application RegionChangedSignal
private void OnNUIApplicationRegionChanged(IntPtr data)
{
- NUIApplicationRegionChangedEventArgs e = new NUIApplicationRegionChangedEventArgs();
-
- // Populate all members of "e" (NUIApplicationRegionChangedEventArgs) with real data
- using (e.Application = Application.GetApplicationFromPtr(data))
+ if (_applicationRegionChangedEventHandler != null)
{
- if (_applicationRegionChangedEventHandler != null)
- {
- //here we send all data to user event handlers
- _applicationRegionChangedEventHandler(this, e);
- }
+ NUIApplicationRegionChangedEventArgs e = new NUIApplicationRegionChangedEventArgs();
+ e.Application = this;
+ _applicationRegionChangedEventHandler.Invoke(this, e);
}
}
// Populate all members of "e" (NUIApplicationBatteryLowEventArgs) with real data
e.BatteryStatus = status;
-
- if (_applicationBatteryLowEventHandler != null)
- {
- //here we send all data to user event handlers
- _applicationBatteryLowEventHandler(this, e);
- }
+ _applicationBatteryLowEventHandler?.Invoke(this, e);
}
/**
// Populate all members of "e" (NUIApplicationMemoryLowEventArgs) with real data
e.MemoryStatus = status;
-
- if (_applicationMemoryLowEventHandler != null)
- {
- //here we send all data to user event handlers
- _applicationMemoryLowEventHandler(this, e);
- }
+ _applicationMemoryLowEventHandler?.Invoke(this, e);
}
/**
// Callback for Application AppControlSignal
private void OnNUIApplicationAppControl(IntPtr application, IntPtr voidp)
{
- NUIApplicationAppControlEventArgs e = new NUIApplicationAppControlEventArgs();
- e.VoidP = voidp;
-
- // Populate all members of "e" (NUIApplicationAppControlEventArgs) with real data
- using (e.Application = Application.GetApplicationFromPtr(application))
+ if (_applicationAppControlEventHandler != null)
{
- if (_applicationAppControlEventHandler != null)
- {
- //here we send all data to user event handlers
- _applicationAppControlEventHandler(this, e);
- }
+ NUIApplicationAppControlEventArgs e = new NUIApplicationAppControlEventArgs();
+ e.VoidP = voidp;
+ e.Application = this;
+ _applicationAppControlEventHandler.Invoke(this, e);
}
}
return null;
}
- Application ret = new Application(cPtr, false);
+ Application ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Application;
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
}
}
- private void ProcessDisposables()
+ internal void ProcessDisposables()
{
lock (_listLock)
{
protected override void OnMeasure(LayoutMeasureSpec widthMeasureSpec, LayoutMeasureSpec heightMeasureSpec)
{
Log.Info("NUI", "OnMeasure\n");
- LayoutLength childWidth = new LayoutLength( 0 );
- LayoutLength childHeight = new LayoutLength( 0 );
+ LayoutLength childWidth = new LayoutLength(0);
+ LayoutLength childHeight = new LayoutLength(0);
LayoutLength measuredWidth = childWidth;
LayoutLength measuredHeight = childHeight;
- for( uint i = 0; i < ChildCount; ++i )
+ for (uint i = 0; i < ChildCount; ++i)
{
- var childLayout = GetChildAt( i );
+ var childLayout = GetChildAt(i);
- if( childLayout )
+ if (childLayout)
{
- MeasureChild( childLayout, widthMeasureSpec, heightMeasureSpec );
+ MeasureChild(childLayout, widthMeasureSpec, heightMeasureSpec);
childWidth = childLayout.MeasuredWidth;
childHeight = childLayout.MeasuredHeight;
// Layout takes size of largest width and height dimension of children
- measuredWidth.Value = System.Math.Max( measuredWidth.Value, childWidth.Value );
- measuredHeight.Value = System.Math.Max( measuredHeight.Value, childHeight.Value );
+ measuredWidth.Value = System.Math.Max(measuredWidth.Value, childWidth.Value);
+ measuredHeight.Value = System.Math.Max(measuredHeight.Value, childHeight.Value);
}
}
- if( 0 == ChildCount )
+ if (0 == ChildCount)
{
// Must be a leaf as has no children
- measuredWidth = GetDefaultSize( SuggestedMinimumWidth, widthMeasureSpec );
- measuredHeight = GetDefaultSize( SuggestedMinimumHeight, heightMeasureSpec );
+ measuredWidth = GetDefaultSize(SuggestedMinimumWidth, widthMeasureSpec);
+ measuredHeight = GetDefaultSize(SuggestedMinimumHeight, heightMeasureSpec);
}
- SetMeasuredDimensions( new MeasuredSize( measuredWidth ),
- new MeasuredSize( measuredHeight ) );
+ SetMeasuredDimensions(new MeasuredSize(measuredWidth),
+ new MeasuredSize(measuredHeight));
}
/// <summary>
{
Log.Info("NUI", "OnLayout\n");
- for( uint i = 0; i < ChildCount; ++i )
+ for (uint i = 0; i < ChildCount; ++i)
{
- var childLayout = GetChildAt( i );
- if( childLayout )
+ var childLayout = GetChildAt(i);
+ if (childLayout)
{
View childOwner = childLayout.GetOwner();
// Use position if explicitly set to child otherwise will be top left.
- var childLeft = new LayoutLength( childOwner.Position2D.X );
- var childTop = new LayoutLength( childOwner.Position2D.Y );
+ var childLeft = new LayoutLength(childOwner.Position2D.X);
+ var childTop = new LayoutLength(childOwner.Position2D.Y);
View owner = GetOwner();
- if ( owner )
+ if (owner)
{
// Margin and Padding only supported when child anchor point is TOP_LEFT.
- if ( owner.PivotPoint == PivotPoint.TopLeft || ( owner.PositionUsesPivotPoint == false ) )
+ if (owner.PivotPoint == PivotPoint.TopLeft || (owner.PositionUsesPivotPoint == false))
{
- childLeft = childLeft + owner.Padding.Start + childOwner.Margin.Start;
- childTop = childTop + owner.Padding.Top + childOwner.Margin.Top;
+ childLeft = childLeft + owner.Padding.Start + childOwner.Margin.Start;
+ childTop = childTop + owner.Padding.Top + childOwner.Margin.Top;
}
}
- childLayout.Layout( childLeft, childTop, childLeft + childLayout.MeasuredWidth, childTop + childLayout.MeasuredHeight );
+ childLayout.Layout(childLeft, childTop, childLeft + childLayout.MeasuredWidth, childTop + childLayout.MeasuredHeight);
}
}
}
}
}
+ [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_Window_SetPositionSize")]
+ public static extern void Window_SetPositionSize_gl(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+
+ [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_Window_SetPositionSize")]
+ public static extern void Window_SetPositionSize_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+
+ public static void Window_SetPositionSize(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
+ {
+ if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan)
+ {
+ Window_SetPositionSize_vulkan(jarg1, jarg2);
+ }
+ else
+ {
+ Window_SetPositionSize_gl(jarg1, jarg2);
+ }
+ }
+
[global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_Application_New__SWIG_0")]
public static extern global::System.IntPtr Application_New__SWIG_0_gl();
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
_application.AppControl += OnAppControl;
_application.MainLoop();
+
_application.Dispose();
+
}
/// <summary>
{
Log.Info("NUI", "NUICorebackend OnRegionChanged Called");
var handler = Handlers[EventType.RegionFormatChanged] as Action<RegionFormatChangedEventArgs>;
- handler?.Invoke( new RegionFormatChangedEventArgs(e.Application.GetRegion()));
+ handler?.Invoke( new RegionFormatChangedEventArgs((source as Application)?.GetRegion()));
}
/// <summary>
{
Log.Info("NUI", "NUICorebackend OnLanguageChanged Called");
var handler = Handlers[EventType.LocaleChanged] as Action<LocaleChangedEventArgs>;
- handler?.Invoke( new LocaleChangedEventArgs(e.Application.GetLanguage()));
+ handler?.Invoke( new LocaleChangedEventArgs((source as Application)?.GetLanguage()));
}
/// <summary>
private void OnTimeTick(IntPtr application, IntPtr watchTime)
{
TimeTickEventArgs e = new TimeTickEventArgs();
- using (e.Application = Application.GetApplicationFromPtr(application))
- {
- using (e.WatchTime = WatchTime.GetWatchTimeFromPtr(watchTime))
- {
+ e.Application = this;
+ e.WatchTime = WatchTime.GetWatchTimeFromPtr(watchTime);
+
_timeTickEventHandler?.Invoke(this, e);
- }
- }
}
{
AmbientTickEventArgs e = new AmbientTickEventArgs();
- using (e.Application = Application.GetApplicationFromPtr(application))
- {
- using (e.WatchTime = WatchTime.GetWatchTimeFromPtr(watchTime))
- {
+ e.Application = this;
+ e.WatchTime = WatchTime.GetWatchTimeFromPtr(watchTime);
_ambientTickEventHandler?.Invoke(this, e);
}
- }
- }
internal WatchTimeSignal AmbientTickSignal()
{
private void OnAmbientChanged(IntPtr application, bool changed)
{
AmbientChangedEventArgs e = new AmbientChangedEventArgs();
- using (e.Application = Application.GetApplicationFromPtr(application))
- {
+ e.Application = this;
e.Changed = changed;
_ambientChangedEventHandler?.Invoke(this, e);
}
- }
internal WatchBoolSignal AmbientChangedSignal()
{
var type = typeResolver.Resolve(typename, serviceProvider);
- var pinfo = type.GetRuntimeProperties().FirstOrDefault(pi => pi.Name == membername && pi.GetMethod.IsStatic);
+ var pinfo = type.GetRuntimeProperties().FirstOrDefault(pi => pi.GetMethod != null && pi.Name == membername && pi.GetMethod.IsStatic);
if (pinfo != null)
- return pinfo.GetMethod.Invoke(null, new object[] { });
+ return pinfo.GetMethod?.Invoke(null, Array.Empty<object>());
var finfo = type.GetRuntimeFields().FirstOrDefault(fi => fi.Name == membername && fi.IsStatic);
if (finfo != null)
string indexerName = defaultMember != null ? defaultMember.MemberName : "Item";
MethodInfo getterInfo =
- declarerType.GetProperties().Where(pi => pi.Name == indexerName && pi.CanRead && pi.GetMethod.IsPublic && !pi.GetMethod.IsStatic).Select(pi => pi.GetMethod).FirstOrDefault();
+ declarerType.GetProperties().Where(pi => (pi.GetMethod != null) && pi.Name == indexerName && pi.CanRead && pi.GetMethod.IsPublic && !pi.GetMethod.IsStatic).Select(pi => pi.GetMethod).FirstOrDefault();
if (getterInfo != null)
{
if (getterInfo == methodCall.Method)
public IEnumerator<T> GetEnumerator()
{
- ReadOnlyCollection<T> snap = _snapshot;
- if (snap == null)
+ lock (_list)
{
- lock (_list)
+ ReadOnlyCollection<T> snap = _snapshot;
+ if (snap == null)
+ {
_snapshot = snap = new ReadOnlyCollection<T>(_list.ToList());
+ }
+ return snap?.GetEnumerator();
}
-
- return snap?.GetEnumerator();
}
public int IndexOf(T item)
return _list[index];
}
-
}
set
public static readonly BindableProperty ResourceUrlProperty = BindableProperty.Create(nameof(ImageView.ResourceUrl), typeof(string), typeof(ImageView), string.Empty, propertyChanged: (bindable, oldValue, newValue) =>
{
var imageView = (ImageView)bindable;
- imageView._url = (string)newValue;
-
- if (imageView._url != null)
+ if (newValue != null)
{
- if (imageView.IsCreateByXaml && imageView._url.Contains("*Resource*"))
+ string url = (string)newValue;
+ if (imageView.IsCreateByXaml && url.Contains("*Resource*"))
{
string resource = Tizen.Applications.Application.Current.DirectoryInfo.Resource;
- imageView._url = imageView._url.Replace("*Resource*", resource);
+ url = url.Replace("*Resource*", resource);
}
+ imageView._url = url;
+ imageView.UpdateImage();
}
- imageView.UpdateImage();
},
defaultValueCreator:(bindable) =>
{
var imageView = (ImageView)bindable;
- if(imageView._url != null)
- {
Tizen.NUI.Object.GetProperty(imageView.swigCPtr, ImageView.Property.IMAGE).Get(out imageView._url);
- }
return imageView._url;
});
/// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
/// <summary>
/// ImageView ResourceUrl, type string.
+ /// This is one of mandatory property. Even if not set or null set, it sets empty string ("") internally.
+ /// When it is set as null, it gives empty string ("") to be read.
/// </summary>
/// <since_tizen> 3 </since_tizen>
public string ResourceUrl
}
set
{
- SetValue(ResourceUrlProperty, value);
+ _url = (value == null? "" : value);
+ SetValue(ResourceUrlProperty, _url);
NotifyPropertyChanged();
}
}
SetProperty(ImageView.Property.IMAGE, new PropertyValue(_url));
}
}
- else
- {
- SetProperty(ImageView.Property.IMAGE, new PropertyValue(""));
- }
}
private Rectangle _border = null;
/// <since_tizen> 3 </since_tizen>
public class View : Container, IResourcesProvider
{
+ /// Flag to allow Layouting to be disabled for Views.
+ /// Once a View has a Layout set then any children added to Views from then on will receive
+ /// automatic Layouts.
+ private static bool layoutingDisabled = true;
+
/// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public bool IsResourcesCreated
// Only give children a layout if their parent is an explicit container or a pure View.
// Pure View meaning not derived from a View, e.g a Legacy container.
- // layoutSet flag is true when the View became a layout using the SetLayout API
- if (true == layoutSet && null == child.Layout)
+ // layoutSet flag is true when the View became a layout using the set Layout API opposed to automatically due to it's parent.
+ // First time the set Layout API is used by any View the Window no longer has layoutingDisabled.
+ if ((true == layoutSet || GetType() == typeof(View)) && null == child.Layout && false == layoutingDisabled )
{
Log.Info("NUI", "Parent[" + Name + "] Layout set[" + layoutSet.ToString() + "] Pure View[" + (!layoutSet).ToString() + "]\n");
// If child is a View or explicitly set to require layouting then set child as a LayoutGroup.
if( child.GetType() == typeof(View) || true == child.LayoutingRequired )
{
Log.Info("NUI", "Creating LayoutGroup for " + child.Name + " LayoutingRequired[" + child.LayoutingRequired.ToString() + "]\n");
- child.Layout = new LayoutGroup();
+ child.SetLayout( new LayoutGroup() );
}
else
{
// Adding child as a leaf, layouting will not propagate past this child.
// Legacy containers will be a LayoutItems too and layout their children how they wish.
Log.Info("NUI", "Creating LayoutItem for " + child.Name + "\n");
- child.Layout = new LayoutItem();
+ child.SetLayout( new LayoutItem() );
}
}
}
set
{
- Tizen.NUI.NDalicManualPINVOKE.SetLayout__SWIG_1(View.getCPtr(this), LayoutItem.getCPtr(value));
- value.LayoutChildren.Clear();
+ Log.Info("NUI", "Set Layout on:" + Name + "\n");
+ layoutingDisabled = false;
layoutSet = true;
- foreach (View view in Children)
- {
- value.LayoutChildren.Add(view.Layout);
- }
+ SetLayout( value );
+ }
+ }
+
+ internal void SetLayout( LayoutItem layout )
+ {
+ Tizen.NUI.NDalicManualPINVOKE.SetLayout__SWIG_1(View.getCPtr(this), LayoutItem.getCPtr(layout) );
+ layout.LayoutChildren.Clear();
+ foreach (View view in Children)
+ {
+ layout.LayoutChildren.Add(view.Layout);
}
}
set
{
SetValue(SizeWidthProperty, value);
+ SetProperty(LayoutItemWrapper.ChildProperty.WIDTH_SPECIFICATION, new Tizen.NUI.PropertyValue(value));
NotifyPropertyChanged();
}
}
set
{
SetValue(SizeHeightProperty, value);
+ SetProperty(LayoutItemWrapper.ChildProperty.HEIGHT_SPECIFICATION, new Tizen.NUI.PropertyValue(value));
NotifyPropertyChanged();
}
}
set
{
SetValue(WidthResizePolicyProperty, value);
+ // Match ResizePolicy to new Layouting.
+ // Parent relative policies can not be mapped at this point as parent size unknown.
+ switch( value )
+ {
+ case ResizePolicyType.UseNaturalSize :
+ {
+ SetProperty(LayoutItemWrapper.ChildProperty.WIDTH_SPECIFICATION, new Tizen.NUI.PropertyValue( (int)ChildLayoutData.WrapContent ) );
+ break;
+ }
+ case ResizePolicyType.FillToParent :
+ {
+ SetProperty(LayoutItemWrapper.ChildProperty.WIDTH_SPECIFICATION, new Tizen.NUI.PropertyValue( (int)ChildLayoutData.MatchParent ) );
+ break;
+ }
+ case ResizePolicyType.FitToChildren :
+ {
+ SetProperty(LayoutItemWrapper.ChildProperty.WIDTH_SPECIFICATION, new Tizen.NUI.PropertyValue( (int)ChildLayoutData.WrapContent ) );
+ break;
+ }
+ default:
+ break;
+ }
NotifyPropertyChanged();
}
}
set
{
SetValue(HeightResizePolicyProperty, value);
+ // Match ResizePolicy to new Layouting.
+ // Parent relative policies can not be mapped at this point as parent size unknown.
+ switch( value )
+ {
+ case ResizePolicyType.UseNaturalSize :
+ {
+ SetProperty(LayoutItemWrapper.ChildProperty.HEIGHT_SPECIFICATION, new Tizen.NUI.PropertyValue( (int)ChildLayoutData.WrapContent ) );
+ break;
+ }
+ case ResizePolicyType.FillToParent :
+ {
+ SetProperty(LayoutItemWrapper.ChildProperty.HEIGHT_SPECIFICATION, new Tizen.NUI.PropertyValue( (int)ChildLayoutData.MatchParent ) );
+ break;
+ }
+ case ResizePolicyType.FitToChildren :
+ {
+ SetProperty(LayoutItemWrapper.ChildProperty.HEIGHT_SPECIFICATION, new Tizen.NUI.PropertyValue( (int)ChildLayoutData.WrapContent ) );
+ break;
+ }
+ default:
+ break;
+ }
NotifyPropertyChanged();
}
}
{
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
private global::System.Runtime.InteropServices.HandleRef stageCPtr;
- private global::System.Runtime.InteropServices.HandleRef rootLayoutCPtr;
- private global::System.IntPtr rootLayoutIntPtr;
+ private readonly global::System.Runtime.InteropServices.HandleRef rootLayoutCPtr;
private Layer _rootLayer;
private string _windowTitle;
+ private readonly LayoutItem rootLayoutItem;
private List<Layer> _childLayers = new List<Layer>();
internal List<Layer> LayersChildren
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
if (NDalicPINVOKE.Stage_IsInstalled())
{
+ global::System.IntPtr rootLayoutIntPtr;
stageCPtr = new global::System.Runtime.InteropServices.HandleRef(this, NDalicPINVOKE.Stage_GetCurrent());
// Create a root layout (AbsoluteLayout) that is invisible to the user but enables layouts added to the Window
// Enables layouts added to the Window to have a parent layout. As parent layout is needed to store measure spec properties.
Layer rootLayer = GetRootLayer();
// Add the root layout created above to the root layer.
NDalicPINVOKE.Actor_Add( Layer.getCPtr(rootLayer), rootLayoutCPtr );
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+
+ global::System.IntPtr rootControlLayoutIntPtr = Tizen.NUI.NDalicManualPINVOKE.GetLayout__SWIG_1(rootLayoutCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+
+ rootLayoutItem = new LayoutItem(rootControlLayoutIntPtr, true);
}
}
NDalicManualPINVOKE.SetSize(swigCPtr, Uint16Pair.getCPtr(val));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+
+ if(rootLayoutItem != null)
+ {
+ rootLayoutItem.RequestLayout();
+ }
}
internal Size2D GetWindowSize()
NDalicManualPINVOKE.SetPosition(swigCPtr, Uint16Pair.getCPtr(val));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+
+ if(rootLayoutItem != null)
+ {
+ rootLayoutItem.RequestLayout();
+ }
}
internal Position2D GetPosition()
return ret;
}
+ internal void SetPositionSize(Rectangle positionSize)
+ {
+ NDalicPINVOKE.Window_SetPositionSize(swigCPtr, Rectangle.getCPtr(positionSize));
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+
+ if(rootLayoutItem != null)
+ {
+ rootLayoutItem.RequestLayout();
+ }
+ }
+
/// <summary>
/// Sets whether the window is transparent or not.
/// </summary>
}
/// <summary>
+ /// Sets position and size of the window. This API guarantees that
+ /// both moving and resizing of window will appear on the screen at once.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Rectangle WindowPositionSize
+ {
+ get
+ {
+ Position2D position = GetPosition();
+ Size2D size = GetSize();
+ Rectangle ret = new Rectangle(position.X, position.Y, size.Width, size.Height);
+ return ret;
+ }
+ set
+ {
+ SetPositionSize(value);
+ }
+ }
+
+ /// <summary>
/// Feeds a key event into the window.
/// </summary>
/// <param name="keyEvent">The key event to feed.</param>
}
}
+ /// <summary>
+ /// Disconnect all native signals
+ /// </summary>
+ /// <since_tizen> 5 </since_tizen>
+ internal void DisconnectNativeSignals()
+ {
+ if( _windowFocusChangedEventCallback != null )
+ {
+ WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback);
+ }
+
+ if( _rootLayerTouchDataCallback != null )
+ {
+ TouchDataSignal().Disconnect(_rootLayerTouchDataCallback);
+ }
+
+ if( _wheelEventCallback != null )
+ {
+ StageWheelEventSignal().Disconnect(_wheelEventCallback);
+ }
+
+ if( _stageKeyCallbackDelegate != null )
+ {
+ KeyEventSignal().Disconnect(_stageKeyCallbackDelegate);
+ }
+
+ if( _stageEventProcessingFinishedEventCallbackDelegate != null )
+ {
+ EventProcessingFinishedSignal().Disconnect(_stageEventProcessingFinishedEventCallbackDelegate);
+ }
+
+ if( _stageContextLostEventCallbackDelegate != null )
+ {
+ ContextLostSignal().Disconnect(_stageContextLostEventCallbackDelegate);
+ }
+
+ if( _stageContextRegainedEventCallbackDelegate != null )
+ {
+ ContextRegainedSignal().Disconnect(_stageContextRegainedEventCallbackDelegate);
+ }
+
+ if( _stageSceneCreatedEventCallbackDelegate != null )
+ {
+ SceneCreatedSignal().Disconnect(_stageSceneCreatedEventCallbackDelegate);
+ }
+
+ if( _windowResizedEventCallback != null )
+ {
+ ResizedSignal().Disconnect(_windowResizedEventCallback);
+ }
+
+ if( _windowFocusChangedEventCallback2 != null )
+ {
+ WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback2);
+ }
+
+ }
+
}
}