Browse Source

Rename to FrameSize

pull/6076/head
Nathan Garside 5 years ago
parent
commit
d77d1fd5da
  1. 2
      native/Avalonia.Native/src/OSX/window.mm
  2. 2
      src/Android/Avalonia.Android/Platform/SkiaPlatform/TopLevelImpl.cs
  3. 4
      src/Avalonia.Controls/ApiCompatBaseline.txt
  4. 10
      src/Avalonia.Controls/Embedding/Offscreen/OffscreenTopLevelImpl.cs
  5. 2
      src/Avalonia.Controls/Platform/ITopLevelImpl.cs
  6. 25
      src/Avalonia.Controls/TopLevel.cs
  7. 1
      src/Avalonia.Controls/Window.cs
  8. 2
      src/Avalonia.DesignerSupport/Remote/Stubs.cs
  9. 2
      src/Avalonia.Headless/HeadlessWindowImpl.cs
  10. 4
      src/Avalonia.Native/WindowImplBase.cs
  11. 2
      src/Avalonia.Native/avn.idl
  12. 4
      src/Avalonia.X11/X11Window.cs
  13. 2
      src/Linux/Avalonia.LinuxFramebuffer/FramebufferToplevelImpl.cs
  14. 2
      src/Windows/Avalonia.Win32.Interop/Wpf/WpfTopLevelImpl.cs
  15. 2
      src/Windows/Avalonia.Win32/WindowImpl.cs
  16. 2
      src/iOS/Avalonia.iOS/AvaloniaView.cs
  17. 2
      tests/Avalonia.UnitTests/MockWindowingPlatform.cs

2
native/Avalonia.Native/src/OSX/window.mm

@ -202,7 +202,7 @@ public:
} }
} }
virtual HRESULT GetTotalSize(AvnSize* ret) override virtual HRESULT GetFrameSize(AvnSize* ret) override
{ {
@autoreleasepool @autoreleasepool
{ {

2
src/Android/Avalonia.Android/Platform/SkiaPlatform/TopLevelImpl.cs

@ -55,7 +55,7 @@ namespace Avalonia.Android.Platform.SkiaPlatform
public virtual Size ClientSize => Size.ToSize(RenderScaling); public virtual Size ClientSize => Size.ToSize(RenderScaling);
public Size TotalSize => ClientSize; public Size FrameSize => ClientSize;
public IMouseDevice MouseDevice { get; } = new MouseDevice(); public IMouseDevice MouseDevice { get; } = new MouseDevice();

4
src/Avalonia.Controls/ApiCompatBaseline.txt

@ -11,6 +11,6 @@ EnumValuesMustMatch : Enum value 'Avalonia.Platform.ExtendClientAreaChromeHints
InterfacesShouldHaveSameMembers : Interface member 'public void Avalonia.Platform.ITopLevelImpl.SetCursor(Avalonia.Platform.ICursorImpl)' is present in the implementation but not in the contract. InterfacesShouldHaveSameMembers : Interface member 'public void Avalonia.Platform.ITopLevelImpl.SetCursor(Avalonia.Platform.ICursorImpl)' is present in the implementation but not in the contract.
InterfacesShouldHaveSameMembers : Interface member 'public void Avalonia.Platform.ITopLevelImpl.SetCursor(Avalonia.Platform.IPlatformHandle)' is present in the contract but not in the implementation. InterfacesShouldHaveSameMembers : Interface member 'public void Avalonia.Platform.ITopLevelImpl.SetCursor(Avalonia.Platform.IPlatformHandle)' is present in the contract but not in the implementation.
MembersMustExist : Member 'public void Avalonia.Platform.ITopLevelImpl.SetCursor(Avalonia.Platform.IPlatformHandle)' does not exist in the implementation but it does exist in the contract. MembersMustExist : Member 'public void Avalonia.Platform.ITopLevelImpl.SetCursor(Avalonia.Platform.IPlatformHandle)' does not exist in the implementation but it does exist in the contract.
InterfacesShouldHaveSameMembers : Interface member 'public Avalonia.Size Avalonia.Platform.ITopLevelImpl.TotalSize' is present in the implementation but not in the contract. InterfacesShouldHaveSameMembers : Interface member 'public Avalonia.Size Avalonia.Platform.ITopLevelImpl.FrameSize' is present in the implementation but not in the contract.
InterfacesShouldHaveSameMembers : Interface member 'public Avalonia.Size Avalonia.Platform.ITopLevelImpl.TotalSize.get()' is present in the implementation but not in the contract. InterfacesShouldHaveSameMembers : Interface member 'public Avalonia.Size Avalonia.Platform.ITopLevelImpl.FrameSize.get()' is present in the implementation but not in the contract.
Total Issues: 14 Total Issues: 14

10
src/Avalonia.Controls/Embedding/Offscreen/OffscreenTopLevelImpl.cs

@ -35,15 +35,7 @@ namespace Avalonia.Controls.Embedding.Offscreen
} }
} }
public Size TotalSize public Size FrameSize => _clientSize;
{
get { return _clientSize; }
set
{
_clientSize = value;
Resized?.Invoke(value);
}
}
public double RenderScaling public double RenderScaling
{ {

2
src/Avalonia.Controls/Platform/ITopLevelImpl.cs

@ -25,7 +25,7 @@ namespace Avalonia.Platform
/// <summary> /// <summary>
/// Gets the total size of the toplevel, excluding shadows. /// Gets the total size of the toplevel, excluding shadows.
/// </summary> /// </summary>
Size TotalSize { get; } Size FrameSize { get; }
/// <summary> /// <summary>
/// Gets the scaling factor for the toplevel. This is used for rendering. /// Gets the scaling factor for the toplevel. This is used for rendering.

25
src/Avalonia.Controls/TopLevel.cs

@ -43,10 +43,10 @@ namespace Avalonia.Controls
AvaloniaProperty.RegisterDirect<TopLevel, Size>(nameof(ClientSize), o => o.ClientSize); AvaloniaProperty.RegisterDirect<TopLevel, Size>(nameof(ClientSize), o => o.ClientSize);
/// <summary> /// <summary>
/// Defines the <see cref="TotalSize"/> property. /// Defines the <see cref="FrameSize"/> property.
/// </summary> /// </summary>
public static readonly DirectProperty<TopLevel, Size> TotalSizeProperty = public static readonly DirectProperty<TopLevel, Size> FrameSizeProperty =
AvaloniaProperty.RegisterDirect<TopLevel, Size>(nameof(TotalSize), o => o.TotalSize); AvaloniaProperty.RegisterDirect<TopLevel, Size>(nameof(FrameSize), o => o.FrameSize);
/// <summary> /// <summary>
/// Defines the <see cref="IInputRoot.PointerOverElement"/> property. /// Defines the <see cref="IInputRoot.PointerOverElement"/> property.
@ -80,7 +80,7 @@ namespace Avalonia.Controls
private readonly IPlatformRenderInterface _renderInterface; private readonly IPlatformRenderInterface _renderInterface;
private readonly IGlobalStyles _globalStyles; private readonly IGlobalStyles _globalStyles;
private Size _clientSize; private Size _clientSize;
private Size _totalSize; private Size _frameSize;
private WindowTransparencyLevel _actualTransparencyLevel; private WindowTransparencyLevel _actualTransparencyLevel;
private ILayoutManager _layoutManager; private ILayoutManager _layoutManager;
private Border _transparencyFallbackBorder; private Border _transparencyFallbackBorder;
@ -91,7 +91,6 @@ namespace Avalonia.Controls
static TopLevel() static TopLevel()
{ {
AffectsMeasure<TopLevel>(ClientSizeProperty); AffectsMeasure<TopLevel>(ClientSizeProperty);
AffectsMeasure<TopLevel>(TotalSizeProperty);
TransparencyLevelHintProperty.Changed.AddClassHandler<TopLevel>( TransparencyLevelHintProperty.Changed.AddClassHandler<TopLevel>(
(tl, e) => (tl, e) =>
@ -202,17 +201,13 @@ namespace Avalonia.Controls
public Size ClientSize public Size ClientSize
{ {
get { return _clientSize; } get { return _clientSize; }
protected set protected set { SetAndRaise(ClientSizeProperty, ref _clientSize, value); }
{
SetAndRaise(ClientSizeProperty, ref _clientSize, value);
SetAndRaise(TotalSizeProperty, ref _totalSize, PlatformImpl.TotalSize);
}
} }
/// <summary> /// <summary>
/// Gets or sets the total size of the window. /// Gets or sets the total size of the window.
/// </summary> /// </summary>
public Size TotalSize => _totalSize; public Size FrameSize => _frameSize;
/// <summary> /// <summary>
/// Gets or sets the <see cref="WindowTransparencyLevel"/> that the TopLevel should use when possible. /// Gets or sets the <see cref="WindowTransparencyLevel"/> that the TopLevel should use when possible.
@ -462,6 +457,14 @@ namespace Avalonia.Controls
/// <param name="e">The event args.</param> /// <param name="e">The event args.</param>
protected virtual void OnClosed(EventArgs e) => Closed?.Invoke(this, e); protected virtual void OnClosed(EventArgs e) => Closed?.Invoke(this, e);
protected override void OnPropertyChanged<T>(AvaloniaPropertyChangedEventArgs<T> change)
{
if (change.Property == ClientSizeProperty)
{
SetAndRaise(FrameSizeProperty, ref _frameSize, PlatformImpl.FrameSize);
}
}
/// <summary> /// <summary>
/// Tries to get a service from an <see cref="IAvaloniaDependencyResolver"/>, logging a /// Tries to get a service from an <see cref="IAvaloniaDependencyResolver"/>, logging a
/// warning if not found. /// warning if not found.

1
src/Avalonia.Controls/Window.cs

@ -950,6 +950,7 @@ namespace Avalonia.Controls
protected override void OnPropertyChanged<T>(AvaloniaPropertyChangedEventArgs<T> change) protected override void OnPropertyChanged<T>(AvaloniaPropertyChangedEventArgs<T> change)
{ {
base.OnPropertyChanged(change);
if (change.Property == SystemDecorationsProperty) if (change.Property == SystemDecorationsProperty)
{ {
var typedNewValue = change.NewValue.GetValueOrDefault<SystemDecorations>(); var typedNewValue = change.NewValue.GetValueOrDefault<SystemDecorations>();

2
src/Avalonia.DesignerSupport/Remote/Stubs.cs

@ -21,7 +21,7 @@ namespace Avalonia.DesignerSupport.Remote
public IPlatformHandle Handle { get; } public IPlatformHandle Handle { get; }
public Size MaxAutoSizeHint { get; } public Size MaxAutoSizeHint { get; }
public Size ClientSize { get; } public Size ClientSize { get; }
public Size TotalSize => ClientSize; public Size FrameSize => ClientSize;
public double RenderScaling { get; } = 1.0; public double RenderScaling { get; } = 1.0;
public double DesktopScaling => 1.0; public double DesktopScaling => 1.0;
public IEnumerable<object> Surfaces { get; } public IEnumerable<object> Surfaces { get; }

2
src/Avalonia.Headless/HeadlessWindowImpl.cs

@ -41,7 +41,7 @@ namespace Avalonia.Headless
} }
public Size ClientSize { get; set; } public Size ClientSize { get; set; }
public Size TotalSize => ClientSize; public Size FrameSize => ClientSize;
public double RenderScaling { get; } = 1; public double RenderScaling { get; } = 1;
public double DesktopScaling => RenderScaling; public double DesktopScaling => RenderScaling;
public IEnumerable<object> Surfaces { get; } public IEnumerable<object> Surfaces { get; }

4
src/Avalonia.Native/WindowImplBase.cs

@ -104,13 +104,13 @@ namespace Avalonia.Native
} }
} }
public Size TotalSize public Size FrameSize
{ {
get get
{ {
if (_native != null) if (_native != null)
{ {
var s = _native.TotalSize; var s = _native.FrameSize;
return new Size(s.Width, s.Height); return new Size(s.Width, s.Height);
} }

2
src/Avalonia.Native/avn.idl

@ -435,7 +435,7 @@ interface IAvnWindowBase : IUnknown
HRESULT Close(); HRESULT Close();
HRESULT Activate(); HRESULT Activate();
HRESULT GetClientSize(AvnSize*ret); HRESULT GetClientSize(AvnSize*ret);
HRESULT GetTotalSize(AvnSize*ret); HRESULT GetFrameSize(AvnSize*ret);
HRESULT GetScaling(double*ret); HRESULT GetScaling(double*ret);
HRESULT SetMinMaxSize(AvnSize minSize, AvnSize maxSize); HRESULT SetMinMaxSize(AvnSize minSize, AvnSize maxSize);
HRESULT Resize(double width, double height); HRESULT Resize(double width, double height);

4
src/Avalonia.X11/X11Window.cs

@ -297,7 +297,7 @@ namespace Avalonia.X11
public Size ClientSize => new Size(_realSize.Width / RenderScaling, _realSize.Height / RenderScaling); public Size ClientSize => new Size(_realSize.Width / RenderScaling, _realSize.Height / RenderScaling);
public Size TotalSize public Size FrameSize
{ {
get get
{ {
@ -616,7 +616,7 @@ namespace Avalonia.X11
if (atom == _x11.Atoms._NET_FRAME_EXTENTS) if (atom == _x11.Atoms._NET_FRAME_EXTENTS)
{ {
// Occurs once the window has been mapped, which is the earliest the extents // Occurs once the window has been mapped, which is the earliest the extents
// can be retrieved, so invoke event to force update of TopLevel.TotalSize. // can be retrieved, so invoke event to force update of TopLevel.FrameSize.
Resized.Invoke(ClientSize); Resized.Invoke(ClientSize);
} }

2
src/Linux/Avalonia.LinuxFramebuffer/FramebufferToplevelImpl.cs

@ -62,7 +62,7 @@ namespace Avalonia.LinuxFramebuffer
} }
public Size ClientSize => ScaledSize; public Size ClientSize => ScaledSize;
public Size TotalSize => ClientSize; public Size FrameSize => ClientSize;
public IMouseDevice MouseDevice => new MouseDevice(); public IMouseDevice MouseDevice => new MouseDevice();
public IPopupImpl CreatePopup() => null; public IPopupImpl CreatePopup() => null;

2
src/Windows/Avalonia.Win32.Interop/Wpf/WpfTopLevelImpl.cs

@ -100,7 +100,7 @@ namespace Avalonia.Win32.Interop.Wpf
} }
Size ITopLevelImpl.ClientSize => _finalSize; Size ITopLevelImpl.ClientSize => _finalSize;
Size ITopLevelImpl.TotalSize => _finalSize; Size ITopLevelImpl.FrameSize => _finalSize;
IMouseDevice ITopLevelImpl.MouseDevice => _mouse; IMouseDevice ITopLevelImpl.MouseDevice => _mouse;
double ITopLevelImpl.RenderScaling => PresentationSource.FromVisual(this)?.CompositionTarget?.TransformToDevice.M11 ?? 1; double ITopLevelImpl.RenderScaling => PresentationSource.FromVisual(this)?.CompositionTarget?.TransformToDevice.M11 ?? 1;

2
src/Windows/Avalonia.Win32/WindowImpl.cs

@ -213,7 +213,7 @@ namespace Avalonia.Win32
} }
} }
public Size TotalSize public Size FrameSize
{ {
get get
{ {

2
src/iOS/Avalonia.iOS/AvaloniaView.cs

@ -91,7 +91,7 @@ namespace Avalonia.iOS
} }
public Size ClientSize => new Size(_view.Bounds.Width, _view.Bounds.Height); public Size ClientSize => new Size(_view.Bounds.Width, _view.Bounds.Height);
public Size TotalSize => ClientSize; public Size FrameSize => ClientSize;
public double RenderScaling => _view.ContentScaleFactor; public double RenderScaling => _view.ContentScaleFactor;
public IEnumerable<object> Surfaces { get; set; } public IEnumerable<object> Surfaces { get; set; }
public Action<RawInputEventArgs> Input { get; set; } public Action<RawInputEventArgs> Input { get; set; }

2
tests/Avalonia.UnitTests/MockWindowingPlatform.cs

@ -29,7 +29,7 @@ namespace Avalonia.UnitTests
windowImpl.SetupAllProperties(); windowImpl.SetupAllProperties();
windowImpl.Setup(x => x.ClientSize).Returns(() => clientSize); windowImpl.Setup(x => x.ClientSize).Returns(() => clientSize);
windowImpl.Setup(x => x.TotalSize).Returns(() => clientSize); windowImpl.Setup(x => x.FrameSize).Returns(() => clientSize);
windowImpl.Setup(x => x.MaxAutoSizeHint).Returns(s_screenSize); windowImpl.Setup(x => x.MaxAutoSizeHint).Returns(s_screenSize);
windowImpl.Setup(x => x.DesktopScaling).Returns(1); windowImpl.Setup(x => x.DesktopScaling).Returns(1);
windowImpl.Setup(x => x.RenderScaling).Returns(1); windowImpl.Setup(x => x.RenderScaling).Returns(1);

Loading…
Cancel
Save