Browse Source

Merge branch 'master' into fixes/textProcessingBugs

pull/8094/head
Benedikt Stebner 4 years ago
committed by GitHub
parent
commit
88fd8f007a
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      build/ApiCompatAttributeExcludeList.txt
  2. 2
      native/Avalonia.Native/src/OSX/AutoFitContentView.mm
  3. 23
      native/Avalonia.Native/src/OSX/AvnWindow.mm
  4. 21
      native/Avalonia.Native/src/OSX/PopupImpl.mm
  5. 3
      native/Avalonia.Native/src/OSX/WindowBaseImpl.h
  6. 56
      native/Avalonia.Native/src/OSX/WindowBaseImpl.mm
  7. 6
      native/Avalonia.Native/src/OSX/WindowImpl.mm
  8. 3
      samples/ControlCatalog/Pages/CalendarDatePickerPage.xaml
  9. 2
      src/Avalonia.Base/Animation/IAnimation.cs
  10. 3
      src/Avalonia.Base/Animation/IAnimationSetter.cs
  11. 2
      src/Avalonia.Base/Animation/IAnimator.cs
  12. 4
      src/Avalonia.Base/Animation/IClock.cs
  13. 5
      src/Avalonia.Base/Animation/IGlobalClock.cs
  14. 2
      src/Avalonia.Base/Animation/ITransition.cs
  15. 4
      src/Avalonia.Base/Controls/INameScope.cs
  16. 2
      src/Avalonia.Base/Controls/IPseudoClasses.cs
  17. 4
      src/Avalonia.Base/Controls/IResourceHost.cs
  18. 4
      src/Avalonia.Base/Controls/IResourceNode.cs
  19. 3
      src/Avalonia.Base/Controls/ISetInheritanceParent.cs
  20. 4
      src/Avalonia.Base/Controls/ISetLogicalParent.cs
  21. 46
      src/Avalonia.Base/Data/Core/ExpressionNode.cs
  22. 2
      src/Avalonia.Base/Data/Core/IPropertyInfo.cs
  23. 3
      src/Avalonia.Base/Data/IBinding.cs
  24. 2
      src/Avalonia.Base/IAvaloniaObject.cs
  25. 3
      src/Avalonia.Base/IDataContextProvider.cs
  26. 1
      src/Avalonia.Base/IDirectPropertyAccessor.cs
  27. 3
      src/Avalonia.Base/IDirectPropertyMetadata.cs
  28. 4
      src/Avalonia.Base/IStyledElement.cs
  29. 3
      src/Avalonia.Base/IStyledPropertyMetadata.cs
  30. 3
      src/Avalonia.Base/Input/IAccessKeyHandler.cs
  31. 3
      src/Avalonia.Base/Input/IFocusManager.cs
  32. 2
      src/Avalonia.Base/Input/IInputDevice.cs
  33. 2
      src/Avalonia.Base/Input/IInputElement.cs
  34. 2
      src/Avalonia.Base/Input/IInputManager.cs
  35. 3
      src/Avalonia.Base/Input/IInputRoot.cs
  36. 2
      src/Avalonia.Base/Input/IKeyboardDevice.cs
  37. 3
      src/Avalonia.Base/Input/IKeyboardNavigationHandler.cs
  38. 2
      src/Avalonia.Base/Input/IMainMenu.cs
  39. 2
      src/Avalonia.Base/Input/IMouseDevice.cs
  40. 3
      src/Avalonia.Base/Input/IPointer.cs
  41. 2
      src/Avalonia.Base/Input/IPointerDevice.cs
  42. 2
      src/Avalonia.Base/Input/Platform/IClipboard.cs
  43. 2
      src/Avalonia.Base/Input/Platform/IPlatformDragSource.cs
  44. 5
      src/Avalonia.Base/Input/Raw/IDragDropDevice.cs
  45. 4
      src/Avalonia.Base/Input/TextInput/ITextInputMethodImpl.cs
  46. 2
      src/Avalonia.Base/Interactivity/IInteractive.cs
  47. 4
      src/Avalonia.Base/Layout/ILayoutManager.cs
  48. 3
      src/Avalonia.Base/Layout/ILayoutRoot.cs
  49. 4
      src/Avalonia.Base/Layout/ILayoutable.cs
  50. 20
      src/Avalonia.Base/Layout/Layoutable.cs
  51. 2
      src/Avalonia.Base/LogicalTree/ILogical.cs
  52. 5
      src/Avalonia.Base/LogicalTree/ILogicalRoot.cs
  53. 2
      src/Avalonia.Base/Media/IBrush.cs
  54. 5
      src/Avalonia.Base/Media/IConicGradientBrush.cs
  55. 2
      src/Avalonia.Base/Media/IDashStyle.cs
  56. 5
      src/Avalonia.Base/Media/IExperimentalAcrylicMaterial.cs
  57. 2
      src/Avalonia.Base/Media/IGradientBrush.cs
  58. 5
      src/Avalonia.Base/Media/IGradientStop.cs
  59. 4
      src/Avalonia.Base/Media/IImageBrush.cs
  60. 7
      src/Avalonia.Base/Media/ILinearGradientBrush.cs
  61. 2
      src/Avalonia.Base/Media/IMutableBrush.cs
  62. 5
      src/Avalonia.Base/Media/IMutableExperimentalAcrylicMaterial.cs
  63. 1
      src/Avalonia.Base/Media/IMutableTransform.cs
  64. 5
      src/Avalonia.Base/Media/IPen.cs
  65. 7
      src/Avalonia.Base/Media/IRadialGradientBrush.cs
  66. 5
      src/Avalonia.Base/Media/ISolidColorBrush.cs
  67. 4
      src/Avalonia.Base/Media/ITileBrush.cs
  68. 6
      src/Avalonia.Base/Media/IVisualBrush.cs
  69. 2
      src/Avalonia.Base/Media/Imaging/IBitmap.cs
  70. 4
      src/Avalonia.Base/Media/TextFormatting/ITextSource.cs
  71. 17
      src/Avalonia.Base/Metadata/NotClientImplementableAttribute.cs
  72. 12
      src/Avalonia.Base/Metadata/UnstableAttribute.cs
  73. 2
      src/Avalonia.Base/Platform/IAssetLoader.cs
  74. 2
      src/Avalonia.Base/Platform/IBitmapImpl.cs
  75. 2
      src/Avalonia.Base/Platform/ICursorImpl.cs
  76. 2
      src/Avalonia.Base/Platform/IDrawingContextImpl.cs
  77. 2
      src/Avalonia.Base/Platform/IFontManagerImpl.cs
  78. 2
      src/Avalonia.Base/Platform/IGeometryImpl.cs
  79. 2
      src/Avalonia.Base/Platform/IGlyphRunImpl.cs
  80. 2
      src/Avalonia.Base/Platform/IGlyphTypefaceImpl.cs
  81. 2
      src/Avalonia.Base/Platform/IMacOSTopLevelPlatformHandle.cs
  82. 2
      src/Avalonia.Base/Platform/IPlatformRenderInterface.cs
  83. 2
      src/Avalonia.Base/Platform/IPlatformSettings.cs
  84. 2
      src/Avalonia.Base/Platform/IPlatformThreadingInterface.cs
  85. 2
      src/Avalonia.Base/Platform/IRenderTargetBitmapImpl.cs
  86. 5
      src/Avalonia.Base/Platform/IRuntimePlatform.cs
  87. 3
      src/Avalonia.Base/Platform/IStreamGeometryContextImpl.cs
  88. 3
      src/Avalonia.Base/Platform/IStreamGeometryImpl.cs
  89. 2
      src/Avalonia.Base/Platform/ITextShaperImpl.cs
  90. 5
      src/Avalonia.Base/Platform/ITransformedGeometryImpl.cs
  91. 5
      src/Avalonia.Base/Platform/IWriteableBitmapImpl.cs
  92. 2
      src/Avalonia.Base/Platform/Interop/IDynamicLibraryLoader.cs
  93. 2
      src/Avalonia.Base/Rendering/IDeferredRendererLock.cs
  94. 5
      src/Avalonia.Base/Rendering/IRenderLoop.cs
  95. 2
      src/Avalonia.Base/Rendering/IRenderRoot.cs
  96. 2
      src/Avalonia.Base/Rendering/IRenderTimer.cs
  97. 2
      src/Avalonia.Base/Rendering/IVisualBrushInitialize.cs
  98. 2
      src/Avalonia.Base/Rendering/IVisualBrushRenderer.cs
  99. 6
      src/Avalonia.Base/Styling/Activators/IStyleActivator.cs
  100. 3
      src/Avalonia.Base/Styling/Activators/IStyleActivatorSink.cs

2
build/ApiCompatAttributeExcludeList.txt

@ -0,0 +1,2 @@
T:Avalonia.Metadata.NotClientImplementableAttribute
T:Avalonia.Metadata.UnstableAttribute

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

@ -85,7 +85,7 @@
_settingSize = true; _settingSize = true;
[super setFrameSize:newSize]; [super setFrameSize:newSize];
auto window = static_cast<id <AvnWindowProtocol>>([self window]); auto window = (id <AvnWindowProtocol>) [self window];
// TODO get actual titlebar size // TODO get actual titlebar size

23
native/Avalonia.Native/src/OSX/AvnWindow.mm

@ -174,6 +174,11 @@
[self setBackgroundColor: [NSColor clearColor]]; [self setBackgroundColor: [NSColor clearColor]];
_isExtended = false; _isExtended = false;
#ifdef IS_NSPANEL
[self setCollectionBehavior:NSWindowCollectionBehaviorCanJoinAllSpaces|NSWindowCollectionBehaviorFullScreenAuxiliary];
#endif
return self; return self;
} }
@ -194,6 +199,8 @@
[self backingScaleFactor]; [self backingScaleFactor];
} }
- (void)windowWillClose:(NSNotification *)notification - (void)windowWillClose:(NSNotification *)notification
{ {
_closed = true; _closed = true;
@ -212,11 +219,14 @@
// If the window has a child window being shown as a dialog then don't allow it to become the key window. // If the window has a child window being shown as a dialog then don't allow it to become the key window.
for(NSWindow* uch in [self childWindows]) for(NSWindow* uch in [self childWindows])
{ {
auto ch = static_cast<id <AvnWindowProtocol>>(uch); if (![uch conformsToProtocol:@protocol(AvnWindowProtocol)])
if(ch == nil) {
continue; continue;
if (ch.isDialog) }
return false;
id <AvnWindowProtocol> ch = (id <AvnWindowProtocol>) uch;
return !ch.isDialog;
} }
return true; return true;
@ -372,6 +382,11 @@
if(cparent != nullptr) if(cparent != nullptr)
{ {
if(!cparent->IsShown())
{
return;
}
if(cparent->WindowState() == Maximized) if(cparent->WindowState() == Maximized)
{ {
cparent->SetWindowState(Normal); cparent->SetWindowState(Normal);

21
native/Avalonia.Native/src/OSX/PopupImpl.mm

@ -34,27 +34,16 @@ protected:
return NSWindowStyleMaskBorderless; return NSWindowStyleMaskBorderless;
} }
virtual HRESULT Resize(double x, double y, AvnPlatformResizeReason reason) override
{
START_COM_CALL;
@autoreleasepool
{
if (Window != nullptr)
{
[Window setContentSize:NSSize{x, y}];
[Window setFrameTopLeftPoint:ToNSPoint(ConvertPointY(lastPositionSet))];
}
return S_OK;
}
}
public: public:
virtual bool ShouldTakeFocusOnShow() override virtual bool ShouldTakeFocusOnShow() override
{ {
return false; return false;
} }
virtual HRESULT Show(bool activate, bool isDialog) override
{
return WindowBaseImpl::Show(activate, true);
}
}; };

3
native/Avalonia.Native/src/OSX/WindowBaseImpl.h

@ -35,6 +35,7 @@ BEGIN_INTERFACE_MAP()
ComPtr<IAvnGlContext> _glContext; ComPtr<IAvnGlContext> _glContext;
NSObject <IRenderTarget> *renderTarget; NSObject <IRenderTarget> *renderTarget;
AvnPoint lastPositionSet; AvnPoint lastPositionSet;
bool hasPosition;
NSSize lastSize; NSSize lastSize;
NSSize lastMinSize; NSSize lastMinSize;
NSSize lastMaxSize; NSSize lastMaxSize;
@ -60,6 +61,8 @@ BEGIN_INTERFACE_MAP()
virtual HRESULT Show(bool activate, bool isDialog) override; virtual HRESULT Show(bool activate, bool isDialog) override;
virtual bool IsShown ();
virtual bool ShouldTakeFocusOnShow(); virtual bool ShouldTakeFocusOnShow();
virtual HRESULT Hide() override; virtual HRESULT Hide() override;

56
native/Avalonia.Native/src/OSX/WindowBaseImpl.mm

@ -30,8 +30,8 @@ WindowBaseImpl::WindowBaseImpl(IAvnWindowBaseEvents *events, IAvnGlContext *gl)
View = [[AvnView alloc] initWithParent:this]; View = [[AvnView alloc] initWithParent:this];
StandardContainer = [[AutoFitContentView new] initWithContent:View]; StandardContainer = [[AutoFitContentView new] initWithContent:View];
lastPositionSet.X = 100; lastPositionSet = { 0, 0 };
lastPositionSet.Y = 100; hasPosition = false;
lastSize = NSSize { 100, 100 }; lastSize = NSSize { 100, 100 };
lastMaxSize = NSSize { CGFLOAT_MAX, CGFLOAT_MAX}; lastMaxSize = NSSize { CGFLOAT_MAX, CGFLOAT_MAX};
lastMinSize = NSSize { 0, 0 }; lastMinSize = NSSize { 0, 0 };
@ -92,7 +92,14 @@ HRESULT WindowBaseImpl::Show(bool activate, bool isDialog) {
CreateNSWindow(isDialog); CreateNSWindow(isDialog);
InitialiseNSWindow(); InitialiseNSWindow();
SetPosition(lastPositionSet); if(hasPosition)
{
SetPosition(lastPositionSet);
} else
{
[Window center];
}
UpdateStyle(); UpdateStyle();
[Window setTitle:_lastTitle]; [Window setTitle:_lastTitle];
@ -112,6 +119,11 @@ HRESULT WindowBaseImpl::Show(bool activate, bool isDialog) {
} }
} }
bool WindowBaseImpl::IsShown ()
{
return _shown;
}
bool WindowBaseImpl::ShouldTakeFocusOnShow() { bool WindowBaseImpl::ShouldTakeFocusOnShow() {
return true; return true;
} }
@ -191,9 +203,8 @@ HRESULT WindowBaseImpl::GetClientSize(AvnSize *ret) {
if (ret == nullptr) if (ret == nullptr)
return E_POINTER; return E_POINTER;
auto frame = [View frame]; ret->Width = lastSize.width;
ret->Width = frame.size.width; ret->Height = lastSize.height;
ret->Height = frame.size.height;
return S_OK; return S_OK;
} }
@ -206,9 +217,11 @@ HRESULT WindowBaseImpl::GetFrameSize(AvnSize *ret) {
if (ret == nullptr) if (ret == nullptr)
return E_POINTER; return E_POINTER;
auto frame = [Window frame]; if(Window != nullptr){
ret->Width = frame.size.width; auto frame = [Window frame];
ret->Height = frame.size.height; ret->Width = frame.size.width;
ret->Height = frame.size.height;
}
return S_OK; return S_OK;
} }
@ -278,12 +291,12 @@ HRESULT WindowBaseImpl::Resize(double x, double y, AvnPlatformResizeReason reaso
} }
@try { @try {
lastSize = NSSize {x, y};
if (!_shown) { if (!_shown) {
BaseEvents->Resized(AvnSize{x, y}, reason); BaseEvents->Resized(AvnSize{x, y}, reason);
} }
lastSize = NSSize {x, y};
if(Window != nullptr) { if(Window != nullptr) {
[Window setContentSize:lastSize]; [Window setContentSize:lastSize];
} }
@ -354,12 +367,17 @@ HRESULT WindowBaseImpl::GetPosition(AvnPoint *ret) {
return E_POINTER; return E_POINTER;
} }
auto frame = [Window frame]; if(Window != nullptr) {
auto frame = [Window frame];
ret->X = frame.origin.x; ret->X = frame.origin.x;
ret->Y = frame.origin.y + frame.size.height; ret->Y = frame.origin.y + frame.size.height;
*ret = ConvertPointY(*ret); *ret = ConvertPointY(*ret);
} else
{
*ret = lastPositionSet;
}
return S_OK; return S_OK;
} }
@ -370,7 +388,11 @@ HRESULT WindowBaseImpl::SetPosition(AvnPoint point) {
@autoreleasepool { @autoreleasepool {
lastPositionSet = point; lastPositionSet = point;
[Window setFrameTopLeftPoint:ToNSPoint(ConvertPointY(point))]; hasPosition = true;
if(Window != nullptr) {
[Window setFrameTopLeftPoint:ToNSPoint(ConvertPointY(point))];
}
return S_OK; return S_OK;
} }
@ -576,7 +598,7 @@ id <AvnWindowProtocol> WindowBaseImpl::GetWindowProtocol() {
return nullptr; return nullptr;
} }
return static_cast<id <AvnWindowProtocol>>(Window); return (id <AvnWindowProtocol>) Window;
} }
extern IAvnWindow* CreateAvnWindow(IAvnWindowEvents*events, IAvnGlContext* gl) extern IAvnWindow* CreateAvnWindow(IAvnWindowEvents*events, IAvnGlContext* gl)

6
native/Avalonia.Native/src/OSX/WindowImpl.mm

@ -430,6 +430,9 @@ HRESULT WindowImpl::SetWindowState(AvnWindowState state) {
START_COM_CALL; START_COM_CALL;
@autoreleasepool { @autoreleasepool {
auto currentState = _actualWindowState;
_lastWindowState = state;
if (Window == nullptr) { if (Window == nullptr) {
return S_OK; return S_OK;
} }
@ -440,9 +443,6 @@ HRESULT WindowImpl::SetWindowState(AvnWindowState state) {
_inSetWindowState = true; _inSetWindowState = true;
auto currentState = _actualWindowState;
_lastWindowState = state;
if (currentState == Normal) { if (currentState == Normal) {
_preZoomSize = [Window frame]; _preZoomSize = [Window frame];
} }

3
samples/ControlCatalog/Pages/CalendarDatePickerPage.xaml

@ -10,8 +10,7 @@
Margin="0,16,0,0" Margin="0,16,0,0"
HorizontalAlignment="Center" HorizontalAlignment="Center"
Spacing="16"> Spacing="16">
<StackPanel Orientation="Vertical" <StackPanel Orientation="Vertical">
Width="200">
<TextBlock Text="SelectedDateFormat: Short"/> <TextBlock Text="SelectedDateFormat: Short"/>
<CalendarDatePicker Name="DatePicker1" <CalendarDatePicker Name="DatePicker1"
SelectedDateFormat="Short" SelectedDateFormat="Short"

2
src/Avalonia.Base/Animation/IAnimation.cs

@ -1,12 +1,14 @@
using System; using System;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Avalonia.Metadata;
namespace Avalonia.Animation namespace Avalonia.Animation
{ {
/// <summary> /// <summary>
/// Interface for Animation objects /// Interface for Animation objects
/// </summary> /// </summary>
[NotClientImplementable]
public interface IAnimation public interface IAnimation
{ {
/// <summary> /// <summary>

3
src/Avalonia.Base/Animation/IAnimationSetter.cs

@ -1,5 +1,8 @@
using Avalonia.Metadata;
namespace Avalonia.Animation namespace Avalonia.Animation
{ {
[NotClientImplementable]
public interface IAnimationSetter public interface IAnimationSetter
{ {
AvaloniaProperty? Property { get; set; } AvaloniaProperty? Property { get; set; }

2
src/Avalonia.Base/Animation/IAnimator.cs

@ -1,11 +1,13 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using Avalonia.Metadata;
namespace Avalonia.Animation namespace Avalonia.Animation
{ {
/// <summary> /// <summary>
/// Interface for Animator objects /// Interface for Animator objects
/// </summary> /// </summary>
[NotClientImplementable]
public interface IAnimator : IList<AnimatorKeyFrame> public interface IAnimator : IList<AnimatorKeyFrame>
{ {
/// <summary> /// <summary>

4
src/Avalonia.Base/Animation/IClock.cs

@ -1,9 +1,9 @@
using System; using System;
using System.Collections.Generic; using Avalonia.Metadata;
using System.Text;
namespace Avalonia.Animation namespace Avalonia.Animation
{ {
[NotClientImplementable]
public interface IClock : IObservable<TimeSpan> public interface IClock : IObservable<TimeSpan>
{ {
PlayState PlayState { get; set; } PlayState PlayState { get; set; }

5
src/Avalonia.Base/Animation/IGlobalClock.cs

@ -1,9 +1,8 @@
using System; using Avalonia.Metadata;
using System.Collections.Generic;
using System.Text;
namespace Avalonia.Animation namespace Avalonia.Animation
{ {
[NotClientImplementable]
public interface IGlobalClock : IClock public interface IGlobalClock : IClock
{ {
} }

2
src/Avalonia.Base/Animation/ITransition.cs

@ -1,10 +1,12 @@
using System; using System;
using Avalonia.Metadata;
namespace Avalonia.Animation namespace Avalonia.Animation
{ {
/// <summary> /// <summary>
/// Interface for Transition objects. /// Interface for Transition objects.
/// </summary> /// </summary>
[NotClientImplementable]
public interface ITransition public interface ITransition
{ {
/// <summary> /// <summary>

4
src/Avalonia.Base/Controls/INameScope.cs

@ -1,5 +1,4 @@
using System; using Avalonia.Metadata;
using System.Threading.Tasks;
using Avalonia.Utilities; using Avalonia.Utilities;
namespace Avalonia.Controls namespace Avalonia.Controls
@ -7,6 +6,7 @@ namespace Avalonia.Controls
/// <summary> /// <summary>
/// Defines a name scope. /// Defines a name scope.
/// </summary> /// </summary>
[NotClientImplementable]
public interface INameScope public interface INameScope
{ {
/// <summary> /// <summary>

2
src/Avalonia.Base/Controls/IPseudoClasses.cs

@ -1,9 +1,11 @@
using Avalonia.Metadata;
namespace Avalonia.Controls namespace Avalonia.Controls
{ {
/// <summary> /// <summary>
/// Exposes an interface for setting pseudoclasses on a <see cref="Classes"/> collection. /// Exposes an interface for setting pseudoclasses on a <see cref="Classes"/> collection.
/// </summary> /// </summary>
[NotClientImplementable]
public interface IPseudoClasses public interface IPseudoClasses
{ {
/// <summary> /// <summary>

4
src/Avalonia.Base/Controls/IResourceHost.cs

@ -1,6 +1,5 @@
using System; using System;
using Avalonia.Metadata;
#nullable enable
namespace Avalonia.Controls namespace Avalonia.Controls
{ {
@ -10,6 +9,7 @@ namespace Avalonia.Controls
/// <remarks> /// <remarks>
/// This interface is implemented by <see cref="StyledElement"/> and `Application`. /// This interface is implemented by <see cref="StyledElement"/> and `Application`.
/// </remarks> /// </remarks>
[NotClientImplementable]
public interface IResourceHost : IResourceNode public interface IResourceHost : IResourceNode
{ {
/// <summary> /// <summary>

4
src/Avalonia.Base/Controls/IResourceNode.cs

@ -1,6 +1,5 @@
using System; using System;
using Avalonia.Metadata;
#nullable enable
namespace Avalonia.Controls namespace Avalonia.Controls
{ {
@ -12,6 +11,7 @@ namespace Avalonia.Controls
/// (<see cref="IResourceHost"/>) and resource providers such as <see cref="ResourceDictionary"/> /// (<see cref="IResourceHost"/>) and resource providers such as <see cref="ResourceDictionary"/>
/// (see <see cref="IResourceProvider"/>). /// (see <see cref="IResourceProvider"/>).
/// </remarks> /// </remarks>
[NotClientImplementable]
public interface IResourceNode public interface IResourceNode
{ {
/// <summary> /// <summary>

3
src/Avalonia.Base/Controls/ISetInheritanceParent.cs

@ -1,4 +1,4 @@
#nullable enable using Avalonia.Metadata;
namespace Avalonia.Controls namespace Avalonia.Controls
{ {
@ -10,6 +10,7 @@ namespace Avalonia.Controls
/// Additionally, <see cref="ISetLogicalParent"/> also sets the inheritance parent; this /// Additionally, <see cref="ISetLogicalParent"/> also sets the inheritance parent; this
/// interface is only needed where the logical and inheritance parents differ. /// interface is only needed where the logical and inheritance parents differ.
/// </remarks> /// </remarks>
[NotClientImplementable]
public interface ISetInheritanceParent public interface ISetInheritanceParent
{ {
/// <summary> /// <summary>

4
src/Avalonia.Base/Controls/ISetLogicalParent.cs

@ -1,6 +1,5 @@
using Avalonia.LogicalTree; using Avalonia.LogicalTree;
using Avalonia.Metadata;
#nullable enable
namespace Avalonia.Controls namespace Avalonia.Controls
{ {
@ -10,6 +9,7 @@ namespace Avalonia.Controls
/// <remarks> /// <remarks>
/// You should not usually need to use this interface - it is for advanced scenarios only. /// You should not usually need to use this interface - it is for advanced scenarios only.
/// </remarks> /// </remarks>
[NotClientImplementable]
public interface ISetLogicalParent public interface ISetLogicalParent
{ {
/// <summary> /// <summary>

46
src/Avalonia.Base/Data/Core/ExpressionNode.cs

@ -98,36 +98,36 @@ namespace Avalonia.Data.Core
private void ValueChanged(object? value, bool notify) private void ValueChanged(object? value, bool notify)
{ {
if (_subscriber is null) if (_subscriber is { } subscriber)
return;
var notification = value as BindingNotification;
if (notification == null)
{ {
LastValue = value != null ? new WeakReference<object?>(value) : NullReference; var notification = value as BindingNotification;
var next = Next;
if (Next != null) if (notification == null)
{ {
Next.Target = LastValue; LastValue = value != null ? new WeakReference<object?>(value) : NullReference;
if (next != null)
{
next.Target = LastValue;
}
else if (notify)
{
subscriber(value);
}
} }
else if (notify) else
{ {
_subscriber(value); LastValue = notification.Value != null ? new WeakReference<object?>(notification.Value) : NullReference;
}
}
else
{
LastValue = notification.Value != null ? new WeakReference<object?>(notification.Value) : NullReference;
if (Next != null) if (next != null)
{ {
Next.Target = LastValue; next.Target = LastValue;
} }
if (Next == null || notification.Error != null) if (next == null || notification.Error != null)
{ {
_subscriber(value); subscriber(value);
}
} }
} }
} }

2
src/Avalonia.Base/Data/Core/IPropertyInfo.cs

@ -1,7 +1,9 @@
using System; using System;
using Avalonia.Metadata;
namespace Avalonia.Data.Core namespace Avalonia.Data.Core
{ {
[NotClientImplementable]
public interface IPropertyInfo public interface IPropertyInfo
{ {
string Name { get; } string Name { get; }

3
src/Avalonia.Base/Data/IBinding.cs

@ -1,8 +1,11 @@
using Avalonia.Metadata;
namespace Avalonia.Data namespace Avalonia.Data
{ {
/// <summary> /// <summary>
/// Holds a binding that can be applied to a property on an object. /// Holds a binding that can be applied to a property on an object.
/// </summary> /// </summary>
[NotClientImplementable]
public interface IBinding public interface IBinding
{ {
/// <summary> /// <summary>

2
src/Avalonia.Base/IAvaloniaObject.cs

@ -1,11 +1,13 @@
using System; using System;
using Avalonia.Data; using Avalonia.Data;
using Avalonia.Metadata;
namespace Avalonia namespace Avalonia
{ {
/// <summary> /// <summary>
/// Interface for getting/setting <see cref="AvaloniaProperty"/> values on an object. /// Interface for getting/setting <see cref="AvaloniaProperty"/> values on an object.
/// </summary> /// </summary>
[NotClientImplementable]
public interface IAvaloniaObject public interface IAvaloniaObject
{ {
/// <summary> /// <summary>

3
src/Avalonia.Base/IDataContextProvider.cs

@ -1,10 +1,11 @@
#nullable enable using Avalonia.Metadata;
namespace Avalonia namespace Avalonia
{ {
/// <summary> /// <summary>
/// Defines an element with a data context that can be used for binding. /// Defines an element with a data context that can be used for binding.
/// </summary> /// </summary>
[NotClientImplementable]
public interface IDataContextProvider : IAvaloniaObject public interface IDataContextProvider : IAvaloniaObject
{ {
/// <summary> /// <summary>

1
src/Avalonia.Base/IDirectPropertyAccessor.cs

@ -1,4 +1,5 @@
using System; using System;
using Avalonia.Metadata;
namespace Avalonia namespace Avalonia
{ {

3
src/Avalonia.Base/IDirectPropertyMetadata.cs

@ -1,8 +1,11 @@
using Avalonia.Metadata;
namespace Avalonia namespace Avalonia
{ {
/// <summary> /// <summary>
/// Untyped interface to <see cref="DirectPropertyMetadata{TValue}"/> /// Untyped interface to <see cref="DirectPropertyMetadata{TValue}"/>
/// </summary> /// </summary>
[NotClientImplementable]
public interface IDirectPropertyMetadata public interface IDirectPropertyMetadata
{ {
/// <summary> /// <summary>

4
src/Avalonia.Base/IStyledElement.cs

@ -2,12 +2,12 @@
using System.ComponentModel; using System.ComponentModel;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.LogicalTree; using Avalonia.LogicalTree;
using Avalonia.Metadata;
using Avalonia.Styling; using Avalonia.Styling;
#nullable enable
namespace Avalonia namespace Avalonia
{ {
[NotClientImplementable]
public interface IStyledElement : public interface IStyledElement :
IStyleable, IStyleable,
IStyleHost, IStyleHost,

3
src/Avalonia.Base/IStyledPropertyMetadata.cs

@ -1,8 +1,11 @@
using Avalonia.Metadata;
namespace Avalonia namespace Avalonia
{ {
/// <summary> /// <summary>
/// Untyped interface to <see cref="StyledPropertyMetadata{TValue}"/> /// Untyped interface to <see cref="StyledPropertyMetadata{TValue}"/>
/// </summary> /// </summary>
[NotClientImplementable]
public interface IStyledPropertyMetadata public interface IStyledPropertyMetadata
{ {
/// <summary> /// <summary>

3
src/Avalonia.Base/Input/IAccessKeyHandler.cs

@ -1,8 +1,11 @@
using Avalonia.Metadata;
namespace Avalonia.Input namespace Avalonia.Input
{ {
/// <summary> /// <summary>
/// Defines the interface for classes that handle access keys for a window. /// Defines the interface for classes that handle access keys for a window.
/// </summary> /// </summary>
[Unstable]
public interface IAccessKeyHandler public interface IAccessKeyHandler
{ {
/// <summary> /// <summary>

3
src/Avalonia.Base/Input/IFocusManager.cs

@ -1,8 +1,11 @@
using Avalonia.Metadata;
namespace Avalonia.Input namespace Avalonia.Input
{ {
/// <summary> /// <summary>
/// Manages focus for the application. /// Manages focus for the application.
/// </summary> /// </summary>
[NotClientImplementable]
public interface IFocusManager public interface IFocusManager
{ {
/// <summary> /// <summary>

2
src/Avalonia.Base/Input/IInputDevice.cs

@ -1,7 +1,9 @@
using Avalonia.Input.Raw; using Avalonia.Input.Raw;
using Avalonia.Metadata;
namespace Avalonia.Input namespace Avalonia.Input
{ {
[NotClientImplementable]
public interface IInputDevice public interface IInputDevice
{ {
/// <summary> /// <summary>

2
src/Avalonia.Base/Input/IInputElement.cs

@ -1,6 +1,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using Avalonia.Interactivity; using Avalonia.Interactivity;
using Avalonia.Metadata;
using Avalonia.VisualTree; using Avalonia.VisualTree;
#nullable enable #nullable enable
@ -10,6 +11,7 @@ namespace Avalonia.Input
/// <summary> /// <summary>
/// Defines input-related functionality for a control. /// Defines input-related functionality for a control.
/// </summary> /// </summary>
[NotClientImplementable]
public interface IInputElement : IInteractive, IVisual public interface IInputElement : IInteractive, IVisual
{ {
/// <summary> /// <summary>

2
src/Avalonia.Base/Input/IInputManager.cs

@ -1,5 +1,6 @@
using System; using System;
using Avalonia.Input.Raw; using Avalonia.Input.Raw;
using Avalonia.Metadata;
namespace Avalonia.Input namespace Avalonia.Input
{ {
@ -7,6 +8,7 @@ namespace Avalonia.Input
/// Receives input from the windowing subsystem and dispatches it to interested parties /// Receives input from the windowing subsystem and dispatches it to interested parties
/// for processing. /// for processing.
/// </summary> /// </summary>
[NotClientImplementable]
public interface IInputManager public interface IInputManager
{ {
/// <summary> /// <summary>

3
src/Avalonia.Base/Input/IInputRoot.cs

@ -1,8 +1,11 @@
using Avalonia.Metadata;
namespace Avalonia.Input namespace Avalonia.Input
{ {
/// <summary> /// <summary>
/// Defines the interface for top-level input elements. /// Defines the interface for top-level input elements.
/// </summary> /// </summary>
[NotClientImplementable]
public interface IInputRoot : IInputElement public interface IInputRoot : IInputElement
{ {
/// <summary> /// <summary>

2
src/Avalonia.Base/Input/IKeyboardDevice.cs

@ -1,5 +1,6 @@
using System; using System;
using System.ComponentModel; using System.ComponentModel;
using Avalonia.Metadata;
namespace Avalonia.Input namespace Avalonia.Input
{ {
@ -50,6 +51,7 @@ namespace Avalonia.Input
KeyboardMask = Alt | Control | Shift | Meta KeyboardMask = Alt | Control | Shift | Meta
} }
[NotClientImplementable]
public interface IKeyboardDevice : IInputDevice, INotifyPropertyChanged public interface IKeyboardDevice : IInputDevice, INotifyPropertyChanged
{ {
IInputElement? FocusedElement { get; } IInputElement? FocusedElement { get; }

3
src/Avalonia.Base/Input/IKeyboardNavigationHandler.cs

@ -1,8 +1,11 @@
using Avalonia.Metadata;
namespace Avalonia.Input namespace Avalonia.Input
{ {
/// <summary> /// <summary>
/// Defines the interface for classes that handle keyboard navigation for a window. /// Defines the interface for classes that handle keyboard navigation for a window.
/// </summary> /// </summary>
[Unstable]
public interface IKeyboardNavigationHandler public interface IKeyboardNavigationHandler
{ {
/// <summary> /// <summary>

2
src/Avalonia.Base/Input/IMainMenu.cs

@ -1,5 +1,6 @@
using System; using System;
using Avalonia.Interactivity; using Avalonia.Interactivity;
using Avalonia.Metadata;
using Avalonia.VisualTree; using Avalonia.VisualTree;
namespace Avalonia.Input namespace Avalonia.Input
@ -7,6 +8,7 @@ namespace Avalonia.Input
/// <summary> /// <summary>
/// Defines the interface for a window's main menu. /// Defines the interface for a window's main menu.
/// </summary> /// </summary>
[NotClientImplementable]
public interface IMainMenu : IVisual public interface IMainMenu : IVisual
{ {
/// <summary> /// <summary>

2
src/Avalonia.Base/Input/IMouseDevice.cs

@ -1,10 +1,12 @@
using System; using System;
using Avalonia.Metadata;
namespace Avalonia.Input namespace Avalonia.Input
{ {
/// <summary> /// <summary>
/// Represents a mouse device. /// Represents a mouse device.
/// </summary> /// </summary>
[NotClientImplementable]
public interface IMouseDevice : IPointerDevice public interface IMouseDevice : IPointerDevice
{ {
/// <summary> /// <summary>

3
src/Avalonia.Base/Input/IPointer.cs

@ -1,5 +1,8 @@
using Avalonia.Metadata;
namespace Avalonia.Input namespace Avalonia.Input
{ {
[NotClientImplementable]
public interface IPointer public interface IPointer
{ {
int Id { get; } int Id { get; }

2
src/Avalonia.Base/Input/IPointerDevice.cs

@ -1,9 +1,11 @@
using System; using System;
using Avalonia.VisualTree; using Avalonia.VisualTree;
using Avalonia.Input.Raw; using Avalonia.Input.Raw;
using Avalonia.Metadata;
namespace Avalonia.Input namespace Avalonia.Input
{ {
[NotClientImplementable]
public interface IPointerDevice : IInputDevice public interface IPointerDevice : IInputDevice
{ {
/// <inheritdoc cref="IPointer.Captured" /> /// <inheritdoc cref="IPointer.Captured" />

2
src/Avalonia.Base/Input/Platform/IClipboard.cs

@ -1,7 +1,9 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using Avalonia.Metadata;
namespace Avalonia.Input.Platform namespace Avalonia.Input.Platform
{ {
[NotClientImplementable]
public interface IClipboard public interface IClipboard
{ {
Task<string> GetTextAsync(); Task<string> GetTextAsync();

2
src/Avalonia.Base/Input/Platform/IPlatformDragSource.cs

@ -1,7 +1,9 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using Avalonia.Metadata;
namespace Avalonia.Input.Platform namespace Avalonia.Input.Platform
{ {
[Unstable]
public interface IPlatformDragSource public interface IPlatformDragSource
{ {
Task<DragDropEffects> DoDragDrop(PointerEventArgs triggerEvent, IDataObject data, DragDropEffects allowedEffects); Task<DragDropEffects> DoDragDrop(PointerEventArgs triggerEvent, IDataObject data, DragDropEffects allowedEffects);

5
src/Avalonia.Base/Input/Raw/IDragDropDevice.cs

@ -1,5 +1,8 @@
namespace Avalonia.Input.Raw using Avalonia.Metadata;
namespace Avalonia.Input.Raw
{ {
[NotClientImplementable]
public interface IDragDropDevice : IInputDevice public interface IDragDropDevice : IInputDevice
{ {
} }

4
src/Avalonia.Base/Input/TextInput/ITextInputMethodImpl.cs

@ -1,5 +1,8 @@
using Avalonia.Metadata;
namespace Avalonia.Input.TextInput namespace Avalonia.Input.TextInput
{ {
[Unstable]
public interface ITextInputMethodImpl public interface ITextInputMethodImpl
{ {
void SetClient(ITextInputMethodClient? client); void SetClient(ITextInputMethodClient? client);
@ -8,6 +11,7 @@ namespace Avalonia.Input.TextInput
void Reset(); void Reset();
} }
[NotClientImplementable]
public interface ITextInputMethodRoot : IInputRoot public interface ITextInputMethodRoot : IInputRoot
{ {
ITextInputMethodImpl? InputMethod { get; } ITextInputMethodImpl? InputMethod { get; }

2
src/Avalonia.Base/Interactivity/IInteractive.cs

@ -1,4 +1,5 @@
using System; using System;
using Avalonia.Metadata;
#nullable enable #nullable enable
@ -7,6 +8,7 @@ namespace Avalonia.Interactivity
/// <summary> /// <summary>
/// Interface for objects that raise routed events. /// Interface for objects that raise routed events.
/// </summary> /// </summary>
[NotClientImplementable]
public interface IInteractive public interface IInteractive
{ {
/// <summary> /// <summary>

4
src/Avalonia.Base/Layout/ILayoutManager.cs

@ -1,12 +1,12 @@
using System; using System;
using Avalonia.Metadata;
#nullable enable
namespace Avalonia.Layout namespace Avalonia.Layout
{ {
/// <summary> /// <summary>
/// Manages measuring and arranging of controls. /// Manages measuring and arranging of controls.
/// </summary> /// </summary>
[NotClientImplementable]
public interface ILayoutManager : IDisposable public interface ILayoutManager : IDisposable
{ {
/// <summary> /// <summary>

3
src/Avalonia.Base/Layout/ILayoutRoot.cs

@ -1,8 +1,11 @@
using Avalonia.Metadata;
namespace Avalonia.Layout namespace Avalonia.Layout
{ {
/// <summary> /// <summary>
/// Defines the root of a layoutable tree. /// Defines the root of a layoutable tree.
/// </summary> /// </summary>
[NotClientImplementable]
public interface ILayoutRoot : ILayoutable public interface ILayoutRoot : ILayoutable
{ {
/// <summary> /// <summary>

4
src/Avalonia.Base/Layout/ILayoutable.cs

@ -1,12 +1,12 @@
using Avalonia.Metadata;
using Avalonia.VisualTree; using Avalonia.VisualTree;
#nullable enable
namespace Avalonia.Layout namespace Avalonia.Layout
{ {
/// <summary> /// <summary>
/// Defines layout-related functionality for a control. /// Defines layout-related functionality for a control.
/// </summary> /// </summary>
[NotClientImplementable]
public interface ILayoutable : IVisual public interface ILayoutable : IVisual
{ {
/// <summary> /// <summary>

20
src/Avalonia.Base/Layout/Layoutable.cs

@ -141,7 +141,6 @@ namespace Avalonia.Layout
static Layoutable() static Layoutable()
{ {
AffectsMeasure<Layoutable>( AffectsMeasure<Layoutable>(
IsVisibleProperty,
WidthProperty, WidthProperty,
HeightProperty, HeightProperty,
MinWidthProperty, MinWidthProperty,
@ -791,6 +790,25 @@ namespace Avalonia.Layout
{ {
} }
protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change)
{
base.OnPropertyChanged(change);
if (change.Property == IsVisibleProperty)
{
DesiredSize = default;
// All changes to visibility cause the parent element to be notified.
this.GetVisualParent<ILayoutable>()?.ChildDesiredSizeChanged(this);
// We only invalidate outselves when visibility is changed to true.
if (change.GetNewValue<bool>())
{
InvalidateMeasure();
}
}
}
/// <inheritdoc/> /// <inheritdoc/>
protected sealed override void OnVisualParentChanged(IVisual? oldParent, IVisual? newParent) protected sealed override void OnVisualParentChanged(IVisual? oldParent, IVisual? newParent)
{ {

2
src/Avalonia.Base/LogicalTree/ILogical.cs

@ -1,12 +1,14 @@
using System; using System;
using Avalonia.Collections; using Avalonia.Collections;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Metadata;
namespace Avalonia.LogicalTree namespace Avalonia.LogicalTree
{ {
/// <summary> /// <summary>
/// Represents a node in the logical tree. /// Represents a node in the logical tree.
/// </summary> /// </summary>
[NotClientImplementable]
public interface ILogical public interface ILogical
{ {
/// <summary> /// <summary>

5
src/Avalonia.Base/LogicalTree/ILogicalRoot.cs

@ -1,8 +1,11 @@
namespace Avalonia.LogicalTree using Avalonia.Metadata;
namespace Avalonia.LogicalTree
{ {
/// <summary> /// <summary>
/// Represents a root of a logical tree. /// Represents a root of a logical tree.
/// </summary> /// </summary>
[NotClientImplementable]
public interface ILogicalRoot : ILogical public interface ILogicalRoot : ILogical
{ {
} }

2
src/Avalonia.Base/Media/IBrush.cs

@ -1,4 +1,5 @@
using System.ComponentModel; using System.ComponentModel;
using Avalonia.Metadata;
namespace Avalonia.Media namespace Avalonia.Media
{ {
@ -6,6 +7,7 @@ namespace Avalonia.Media
/// Describes how an area is painted. /// Describes how an area is painted.
/// </summary> /// </summary>
[TypeConverter(typeof(BrushConverter))] [TypeConverter(typeof(BrushConverter))]
[NotClientImplementable]
public interface IBrush public interface IBrush
{ {
/// <summary> /// <summary>

5
src/Avalonia.Base/Media/IConicGradientBrush.cs

@ -1,8 +1,11 @@
namespace Avalonia.Media using Avalonia.Metadata;
namespace Avalonia.Media
{ {
/// <summary> /// <summary>
/// Paints an area with a conic gradient. /// Paints an area with a conic gradient.
/// </summary> /// </summary>
[NotClientImplementable]
public interface IConicGradientBrush : IGradientBrush public interface IConicGradientBrush : IGradientBrush
{ {
/// <summary> /// <summary>

2
src/Avalonia.Base/Media/IDashStyle.cs

@ -1,10 +1,12 @@
using System.Collections.Generic; using System.Collections.Generic;
using Avalonia.Metadata;
namespace Avalonia.Media namespace Avalonia.Media
{ {
/// <summary> /// <summary>
/// Represents the sequence of dashes and gaps that will be applied by a <see cref="Pen"/>. /// Represents the sequence of dashes and gaps that will be applied by a <see cref="Pen"/>.
/// </summary> /// </summary>
[NotClientImplementable]
public interface IDashStyle public interface IDashStyle
{ {
/// <summary> /// <summary>

5
src/Avalonia.Base/Media/IExperimentalAcrylicMaterial.cs

@ -1,8 +1,11 @@
namespace Avalonia.Media using Avalonia.Metadata;
namespace Avalonia.Media
{ {
/// <summary> /// <summary>
/// Experimental Interface for producing Acrylic-like materials. /// Experimental Interface for producing Acrylic-like materials.
/// </summary> /// </summary>
[NotClientImplementable]
public interface IExperimentalAcrylicMaterial public interface IExperimentalAcrylicMaterial
{ {
/// <summary> /// <summary>

2
src/Avalonia.Base/Media/IGradientBrush.cs

@ -1,10 +1,12 @@
using System.Collections.Generic; using System.Collections.Generic;
using Avalonia.Metadata;
namespace Avalonia.Media namespace Avalonia.Media
{ {
/// <summary> /// <summary>
/// A brush that draws with a gradient. /// A brush that draws with a gradient.
/// </summary> /// </summary>
[NotClientImplementable]
public interface IGradientBrush : IBrush public interface IGradientBrush : IBrush
{ {
/// <summary> /// <summary>

5
src/Avalonia.Base/Media/IGradientStop.cs

@ -1,8 +1,11 @@
namespace Avalonia.Media using Avalonia.Metadata;
namespace Avalonia.Media
{ {
/// <summary> /// <summary>
/// Describes the location and color of a transition point in a gradient. /// Describes the location and color of a transition point in a gradient.
/// </summary> /// </summary>
[NotClientImplementable]
public interface IGradientStop public interface IGradientStop
{ {
/// <summary> /// <summary>

4
src/Avalonia.Base/Media/IImageBrush.cs

@ -1,10 +1,12 @@
using Avalonia.Media.Imaging; using Avalonia.Media.Imaging;
using Avalonia.Metadata;
namespace Avalonia.Media namespace Avalonia.Media
{ {
/// <summary> /// <summary>
/// Paints an area with an <see cref="IBitmap"/>. /// Paints an area with an <see cref="IBitmap"/>.
/// </summary> /// </summary>
[NotClientImplementable]
public interface IImageBrush : ITileBrush public interface IImageBrush : ITileBrush
{ {
/// <summary> /// <summary>
@ -12,4 +14,4 @@ namespace Avalonia.Media
/// </summary> /// </summary>
IBitmap Source { get; } IBitmap Source { get; }
} }
} }

7
src/Avalonia.Base/Media/ILinearGradientBrush.cs

@ -1,8 +1,11 @@
namespace Avalonia.Media using Avalonia.Metadata;
namespace Avalonia.Media
{ {
/// <summary> /// <summary>
/// A brush that draws with a linear gradient. /// A brush that draws with a linear gradient.
/// </summary> /// </summary>
[NotClientImplementable]
public interface ILinearGradientBrush : IGradientBrush public interface ILinearGradientBrush : IGradientBrush
{ {
/// <summary> /// <summary>
@ -15,4 +18,4 @@
/// </summary> /// </summary>
RelativePoint EndPoint { get; } RelativePoint EndPoint { get; }
} }
} }

2
src/Avalonia.Base/Media/IMutableBrush.cs

@ -1,10 +1,12 @@
using System; using System;
using Avalonia.Metadata;
namespace Avalonia.Media namespace Avalonia.Media
{ {
/// <summary> /// <summary>
/// Represents a mutable brush which can return an immutable clone of itself. /// Represents a mutable brush which can return an immutable clone of itself.
/// </summary> /// </summary>
[NotClientImplementable]
public interface IMutableBrush : IBrush, IAffectsRender public interface IMutableBrush : IBrush, IAffectsRender
{ {
/// <summary> /// <summary>

5
src/Avalonia.Base/Media/IMutableExperimentalAcrylicMaterial.cs

@ -1,8 +1,11 @@
namespace Avalonia.Media using Avalonia.Metadata;
namespace Avalonia.Media
{ {
/// <summary> /// <summary>
/// Represents a mutable brush which can return an immutable clone of itself. /// Represents a mutable brush which can return an immutable clone of itself.
/// </summary> /// </summary>
[NotClientImplementable]
public interface IMutableExperimentalAcrylicMaterial : IExperimentalAcrylicMaterial, IAffectsRender public interface IMutableExperimentalAcrylicMaterial : IExperimentalAcrylicMaterial, IAffectsRender
{ {
/// <summary> /// <summary>

1
src/Avalonia.Base/Media/IMutableTransform.cs

@ -1,4 +1,5 @@
using System; using System;
using Avalonia.Metadata;
namespace Avalonia.Media namespace Avalonia.Media
{ {

5
src/Avalonia.Base/Media/IPen.cs

@ -1,8 +1,11 @@
namespace Avalonia.Media using Avalonia.Metadata;
namespace Avalonia.Media
{ {
/// <summary> /// <summary>
/// Describes how a stroke is drawn. /// Describes how a stroke is drawn.
/// </summary> /// </summary>
[NotClientImplementable]
public interface IPen public interface IPen
{ {
/// <summary> /// <summary>

7
src/Avalonia.Base/Media/IRadialGradientBrush.cs

@ -1,8 +1,11 @@
namespace Avalonia.Media using Avalonia.Metadata;
namespace Avalonia.Media
{ {
/// <summary> /// <summary>
/// Paints an area with a radial gradient. /// Paints an area with a radial gradient.
/// </summary> /// </summary>
[NotClientImplementable]
public interface IRadialGradientBrush : IGradientBrush public interface IRadialGradientBrush : IGradientBrush
{ {
/// <summary> /// <summary>
@ -21,4 +24,4 @@
/// </summary> /// </summary>
double Radius { get; } double Radius { get; }
} }
} }

5
src/Avalonia.Base/Media/ISolidColorBrush.cs

@ -1,8 +1,11 @@
using Avalonia.Metadata;
namespace Avalonia.Media namespace Avalonia.Media
{ {
/// <summary> /// <summary>
/// Fills an area with a solid color. /// Fills an area with a solid color.
/// </summary> /// </summary>
[NotClientImplementable]
public interface ISolidColorBrush : IBrush public interface ISolidColorBrush : IBrush
{ {
/// <summary> /// <summary>
@ -10,4 +13,4 @@ namespace Avalonia.Media
/// </summary> /// </summary>
Color Color { get; } Color Color { get; }
} }
} }

4
src/Avalonia.Base/Media/ITileBrush.cs

@ -1,10 +1,12 @@
using Avalonia.Media.Imaging; using Avalonia.Media.Imaging;
using Avalonia.Metadata;
namespace Avalonia.Media namespace Avalonia.Media
{ {
/// <summary> /// <summary>
/// A brush which displays a repeating image. /// A brush which displays a repeating image.
/// </summary> /// </summary>
[NotClientImplementable]
public interface ITileBrush : IBrush public interface ITileBrush : IBrush
{ {
/// <summary> /// <summary>

6
src/Avalonia.Base/Media/IVisualBrush.cs

@ -1,10 +1,12 @@
using Avalonia.VisualTree; using Avalonia.Metadata;
using Avalonia.VisualTree;
namespace Avalonia.Media namespace Avalonia.Media
{ {
/// <summary> /// <summary>
/// Paints an area with an <see cref="IVisual"/>. /// Paints an area with an <see cref="IVisual"/>.
/// </summary> /// </summary>
[NotClientImplementable]
public interface IVisualBrush : ITileBrush public interface IVisualBrush : ITileBrush
{ {
/// <summary> /// <summary>
@ -12,4 +14,4 @@ namespace Avalonia.Media
/// </summary> /// </summary>
IVisual Visual { get; } IVisual Visual { get; }
} }
} }

2
src/Avalonia.Base/Media/Imaging/IBitmap.cs

@ -1,5 +1,6 @@
using System; using System;
using System.IO; using System.IO;
using Avalonia.Metadata;
using Avalonia.Platform; using Avalonia.Platform;
using Avalonia.Utilities; using Avalonia.Utilities;
@ -8,6 +9,7 @@ namespace Avalonia.Media.Imaging
/// <summary> /// <summary>
/// Represents a bitmap image. /// Represents a bitmap image.
/// </summary> /// </summary>
[NotClientImplementable]
public interface IBitmap : IImage, IDisposable public interface IBitmap : IImage, IDisposable
{ {
/// <summary> /// <summary>

4
src/Avalonia.Base/Media/TextFormatting/ITextSource.cs

@ -1,4 +1,6 @@
namespace Avalonia.Media.TextFormatting using Avalonia.Metadata;
namespace Avalonia.Media.TextFormatting
{ {
/// <summary> /// <summary>
/// Produces <see cref="TextRun"/> objects that are used by the <see cref="TextFormatter"/>. /// Produces <see cref="TextRun"/> objects that are used by the <see cref="TextFormatter"/>.

17
src/Avalonia.Base/Metadata/NotClientImplementableAttribute.cs

@ -0,0 +1,17 @@
using System;
namespace Avalonia.Metadata
{
/// <summary>
/// This interface is not intended to be implemented outside of the core Avalonia framework as
/// its API may change without warning.
/// </summary>
/// <remarks>
/// This interface is stable for consumption by a client, but should not be implemented as members
/// may be added to its API.
/// </remarks>
[AttributeUsage(AttributeTargets.Interface)]
public class NotClientImplementableAttribute : Attribute
{
}
}

12
src/Avalonia.Base/Metadata/UnstableAttribute.cs

@ -0,0 +1,12 @@
using System;
namespace Avalonia.Metadata
{
/// <summary>
/// This API is unstable and is not covered by API compatibility guarantees between minor and
/// patch releases.
/// </summary>
public class UnstableAttribute : Attribute
{
}
}

2
src/Avalonia.Base/Platform/IAssetLoader.cs

@ -2,12 +2,14 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Reflection; using System.Reflection;
using Avalonia.Metadata;
namespace Avalonia.Platform namespace Avalonia.Platform
{ {
/// <summary> /// <summary>
/// Loads assets compiled into the application binary. /// Loads assets compiled into the application binary.
/// </summary> /// </summary>
[Unstable]
public interface IAssetLoader public interface IAssetLoader
{ {
/// <summary> /// <summary>

2
src/Avalonia.Base/Platform/IBitmapImpl.cs

@ -1,11 +1,13 @@
using System; using System;
using System.IO; using System.IO;
using Avalonia.Metadata;
namespace Avalonia.Platform namespace Avalonia.Platform
{ {
/// <summary> /// <summary>
/// Defines the platform-specific interface for a <see cref="Avalonia.Media.Imaging.Bitmap"/>. /// Defines the platform-specific interface for a <see cref="Avalonia.Media.Imaging.Bitmap"/>.
/// </summary> /// </summary>
[Unstable]
public interface IBitmapImpl : IDisposable public interface IBitmapImpl : IDisposable
{ {
/// <summary> /// <summary>

2
src/Avalonia.Base/Platform/ICursorImpl.cs

@ -1,5 +1,6 @@
using System; using System;
using Avalonia.Input; using Avalonia.Input;
using Avalonia.Metadata;
#nullable enable #nullable enable
@ -8,6 +9,7 @@ namespace Avalonia.Platform
/// <summary> /// <summary>
/// Represents a platform implementation of a <see cref="Cursor"/>. /// Represents a platform implementation of a <see cref="Cursor"/>.
/// </summary> /// </summary>
[Unstable]
public interface ICursorImpl : IDisposable public interface ICursorImpl : IDisposable
{ {
} }

2
src/Avalonia.Base/Platform/IDrawingContextImpl.cs

@ -3,12 +3,14 @@ using Avalonia.Media;
using Avalonia.Rendering.SceneGraph; using Avalonia.Rendering.SceneGraph;
using Avalonia.Utilities; using Avalonia.Utilities;
using Avalonia.Media.Imaging; using Avalonia.Media.Imaging;
using Avalonia.Metadata;
namespace Avalonia.Platform namespace Avalonia.Platform
{ {
/// <summary> /// <summary>
/// Defines the interface through which drawing occurs. /// Defines the interface through which drawing occurs.
/// </summary> /// </summary>
[Unstable]
public interface IDrawingContextImpl : IDisposable public interface IDrawingContextImpl : IDisposable
{ {
/// <summary> /// <summary>

2
src/Avalonia.Base/Platform/IFontManagerImpl.cs

@ -1,9 +1,11 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization; using System.Globalization;
using Avalonia.Media; using Avalonia.Media;
using Avalonia.Metadata;
namespace Avalonia.Platform namespace Avalonia.Platform
{ {
[Unstable]
public interface IFontManagerImpl public interface IFontManagerImpl
{ {
/// <summary> /// <summary>

2
src/Avalonia.Base/Platform/IGeometryImpl.cs

@ -1,10 +1,12 @@
using Avalonia.Media; using Avalonia.Media;
using Avalonia.Metadata;
namespace Avalonia.Platform namespace Avalonia.Platform
{ {
/// <summary> /// <summary>
/// Defines the platform-specific interface for a <see cref="Geometry"/>. /// Defines the platform-specific interface for a <see cref="Geometry"/>.
/// </summary> /// </summary>
[Unstable]
public interface IGeometryImpl public interface IGeometryImpl
{ {
/// <summary> /// <summary>

2
src/Avalonia.Base/Platform/IGlyphRunImpl.cs

@ -1,9 +1,11 @@
using System; using System;
using Avalonia.Metadata;
namespace Avalonia.Platform namespace Avalonia.Platform
{ {
/// <summary> /// <summary>
/// Actual implementation of a glyph run that stores platform dependent resources. /// Actual implementation of a glyph run that stores platform dependent resources.
/// </summary> /// </summary>
[Unstable]
public interface IGlyphRunImpl : IDisposable { } public interface IGlyphRunImpl : IDisposable { }
} }

2
src/Avalonia.Base/Platform/IGlyphTypefaceImpl.cs

@ -1,7 +1,9 @@
using System; using System;
using Avalonia.Metadata;
namespace Avalonia.Platform namespace Avalonia.Platform
{ {
[Unstable]
public interface IGlyphTypefaceImpl : IDisposable public interface IGlyphTypefaceImpl : IDisposable
{ {
/// <summary> /// <summary>

2
src/Avalonia.Base/Platform/IMacOSTopLevelPlatformHandle.cs

@ -1,7 +1,9 @@
using System; using System;
using Avalonia.Metadata;
namespace Avalonia.Platform namespace Avalonia.Platform
{ {
[Unstable]
public interface IMacOSTopLevelPlatformHandle public interface IMacOSTopLevelPlatformHandle
{ {
IntPtr NSView { get; } IntPtr NSView { get; }

2
src/Avalonia.Base/Platform/IPlatformRenderInterface.cs

@ -3,12 +3,14 @@ using System.Collections.Generic;
using System.IO; using System.IO;
using Avalonia.Media; using Avalonia.Media;
using Avalonia.Media.Imaging; using Avalonia.Media.Imaging;
using Avalonia.Metadata;
namespace Avalonia.Platform namespace Avalonia.Platform
{ {
/// <summary> /// <summary>
/// Defines the main platform-specific interface for the rendering subsystem. /// Defines the main platform-specific interface for the rendering subsystem.
/// </summary> /// </summary>
[Unstable]
public interface IPlatformRenderInterface public interface IPlatformRenderInterface
{ {
/// <summary> /// <summary>

2
src/Avalonia.Base/Platform/IPlatformSettings.cs

@ -1,7 +1,9 @@
using System; using System;
using Avalonia.Metadata;
namespace Avalonia.Platform namespace Avalonia.Platform
{ {
[Unstable]
public interface IPlatformSettings public interface IPlatformSettings
{ {
Size DoubleClickSize { get; } Size DoubleClickSize { get; }

2
src/Avalonia.Base/Platform/IPlatformThreadingInterface.cs

@ -1,5 +1,6 @@
using System; using System;
using System.Threading; using System.Threading;
using Avalonia.Metadata;
using Avalonia.Threading; using Avalonia.Threading;
namespace Avalonia.Platform namespace Avalonia.Platform
@ -7,6 +8,7 @@ namespace Avalonia.Platform
/// <summary> /// <summary>
/// Provides platform-specific services relating to threading. /// Provides platform-specific services relating to threading.
/// </summary> /// </summary>
[Unstable]
public interface IPlatformThreadingInterface public interface IPlatformThreadingInterface
{ {
void RunLoop(CancellationToken cancellationToken); void RunLoop(CancellationToken cancellationToken);

2
src/Avalonia.Base/Platform/IRenderTargetBitmapImpl.cs

@ -1,3 +1,4 @@
using Avalonia.Metadata;
namespace Avalonia.Platform namespace Avalonia.Platform
{ {
@ -5,6 +6,7 @@ namespace Avalonia.Platform
/// Defines the platform-specific interface for a /// Defines the platform-specific interface for a
/// <see cref="Avalonia.Media.Imaging.RenderTargetBitmap"/>. /// <see cref="Avalonia.Media.Imaging.RenderTargetBitmap"/>.
/// </summary> /// </summary>
[Unstable]
public interface IRenderTargetBitmapImpl : IBitmapImpl, IRenderTarget public interface IRenderTargetBitmapImpl : IBitmapImpl, IRenderTarget
{ {
} }

5
src/Avalonia.Base/Platform/IRuntimePlatform.cs

@ -1,7 +1,9 @@
using System; using System;
using Avalonia.Metadata;
namespace Avalonia.Platform namespace Avalonia.Platform
{ {
[Unstable]
public interface IRuntimePlatform public interface IRuntimePlatform
{ {
IDisposable StartSystemTimer(TimeSpan interval, Action tick); IDisposable StartSystemTimer(TimeSpan interval, Action tick);
@ -9,6 +11,7 @@ namespace Avalonia.Platform
IUnmanagedBlob AllocBlob(int size); IUnmanagedBlob AllocBlob(int size);
} }
[Unstable]
public interface IUnmanagedBlob : IDisposable public interface IUnmanagedBlob : IDisposable
{ {
IntPtr Address { get; } IntPtr Address { get; }
@ -17,6 +20,7 @@ namespace Avalonia.Platform
} }
[Unstable]
public struct RuntimePlatformInfo public struct RuntimePlatformInfo
{ {
public OperatingSystemType OperatingSystem { get; set; } public OperatingSystemType OperatingSystem { get; set; }
@ -29,6 +33,7 @@ namespace Avalonia.Platform
public bool IsUnix { get; set; } public bool IsUnix { get; set; }
} }
[Unstable]
public enum OperatingSystemType public enum OperatingSystemType
{ {
Unknown, Unknown,

3
src/Avalonia.Base/Platform/IStreamGeometryContextImpl.cs

@ -1,8 +1,11 @@
using Avalonia.Metadata;
namespace Avalonia.Platform namespace Avalonia.Platform
{ {
/// <summary> /// <summary>
/// Describes a geometry using drawing commands. /// Describes a geometry using drawing commands.
/// </summary> /// </summary>
[Unstable]
public interface IStreamGeometryContextImpl : IGeometryContext public interface IStreamGeometryContextImpl : IGeometryContext
{ {
} }

3
src/Avalonia.Base/Platform/IStreamGeometryImpl.cs

@ -1,8 +1,11 @@
using Avalonia.Metadata;
namespace Avalonia.Platform namespace Avalonia.Platform
{ {
/// <summary> /// <summary>
/// Defines the platform-specific interface for a <see cref="Avalonia.Media.StreamGeometry"/>. /// Defines the platform-specific interface for a <see cref="Avalonia.Media.StreamGeometry"/>.
/// </summary> /// </summary>
[Unstable]
public interface IStreamGeometryImpl : IGeometryImpl public interface IStreamGeometryImpl : IGeometryImpl
{ {
/// <summary> /// <summary>

2
src/Avalonia.Base/Platform/ITextShaperImpl.cs

@ -1,4 +1,5 @@
using Avalonia.Media.TextFormatting; using Avalonia.Media.TextFormatting;
using Avalonia.Metadata;
using Avalonia.Utilities; using Avalonia.Utilities;
namespace Avalonia.Platform namespace Avalonia.Platform
@ -6,6 +7,7 @@ namespace Avalonia.Platform
/// <summary> /// <summary>
/// An abstraction that is used produce shaped text. /// An abstraction that is used produce shaped text.
/// </summary> /// </summary>
[Unstable]
public interface ITextShaperImpl public interface ITextShaperImpl
{ {
/// <summary> /// <summary>

5
src/Avalonia.Base/Platform/ITransformedGeometryImpl.cs

@ -1,4 +1,6 @@
namespace Avalonia.Platform using Avalonia.Metadata;
namespace Avalonia.Platform
{ {
/// <summary> /// <summary>
/// Represents a geometry with a transform applied. /// Represents a geometry with a transform applied.
@ -7,6 +9,7 @@
/// An <see cref="ITransformedGeometryImpl"/> transforms a geometry without transforming its /// An <see cref="ITransformedGeometryImpl"/> transforms a geometry without transforming its
/// stroke thickness. /// stroke thickness.
/// </remarks> /// </remarks>
[Unstable]
public interface ITransformedGeometryImpl : IGeometryImpl public interface ITransformedGeometryImpl : IGeometryImpl
{ {
/// <summary> /// <summary>

5
src/Avalonia.Base/Platform/IWriteableBitmapImpl.cs

@ -1,8 +1,11 @@
namespace Avalonia.Platform using Avalonia.Metadata;
namespace Avalonia.Platform
{ {
/// <summary> /// <summary>
/// Defines the platform-specific interface for a <see cref="Avalonia.Media.Imaging.WriteableBitmap"/>. /// Defines the platform-specific interface for a <see cref="Avalonia.Media.Imaging.WriteableBitmap"/>.
/// </summary> /// </summary>
[Unstable]
public interface IWriteableBitmapImpl : IBitmapImpl public interface IWriteableBitmapImpl : IBitmapImpl
{ {
ILockedFramebuffer Lock(); ILockedFramebuffer Lock();

2
src/Avalonia.Base/Platform/Interop/IDynamicLibraryLoader.cs

@ -1,7 +1,9 @@
using System; using System;
using Avalonia.Metadata;
namespace Avalonia.Platform.Interop namespace Avalonia.Platform.Interop
{ {
[Unstable]
public interface IDynamicLibraryLoader public interface IDynamicLibraryLoader
{ {
IntPtr LoadLibrary(string dll); IntPtr LoadLibrary(string dll);

2
src/Avalonia.Base/Rendering/IDeferredRendererLock.cs

@ -1,7 +1,9 @@
using System; using System;
using Avalonia.Metadata;
namespace Avalonia.Rendering namespace Avalonia.Rendering
{ {
[Unstable]
public interface IDeferredRendererLock public interface IDeferredRendererLock
{ {
IDisposable? TryLock(); IDisposable? TryLock();

5
src/Avalonia.Base/Rendering/IRenderLoop.cs

@ -1,4 +1,6 @@
namespace Avalonia.Rendering using Avalonia.Metadata;
namespace Avalonia.Rendering
{ {
/// <summary> /// <summary>
/// The application render loop. /// The application render loop.
@ -7,6 +9,7 @@
/// The render loop is responsible for advancing the animation timer and updating the scene /// The render loop is responsible for advancing the animation timer and updating the scene
/// graph for visible windows. /// graph for visible windows.
/// </remarks> /// </remarks>
[NotClientImplementable]
public interface IRenderLoop public interface IRenderLoop
{ {
/// <summary> /// <summary>

2
src/Avalonia.Base/Rendering/IRenderRoot.cs

@ -1,3 +1,4 @@
using Avalonia.Metadata;
using Avalonia.Platform; using Avalonia.Platform;
using Avalonia.VisualTree; using Avalonia.VisualTree;
@ -6,6 +7,7 @@ namespace Avalonia.Rendering
/// <summary> /// <summary>
/// Represents the root of a renderable tree. /// Represents the root of a renderable tree.
/// </summary> /// </summary>
[NotClientImplementable]
public interface IRenderRoot : IVisual public interface IRenderRoot : IVisual
{ {
/// <summary> /// <summary>

2
src/Avalonia.Base/Rendering/IRenderTimer.cs

@ -1,11 +1,13 @@
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using Avalonia.Metadata;
namespace Avalonia.Rendering namespace Avalonia.Rendering
{ {
/// <summary> /// <summary>
/// Defines the interface implemented by an application render timer. /// Defines the interface implemented by an application render timer.
/// </summary> /// </summary>
[NotClientImplementable]
public interface IRenderTimer public interface IRenderTimer
{ {
/// <summary> /// <summary>

2
src/Avalonia.Base/Rendering/IVisualBrushInitialize.cs

@ -1,4 +1,5 @@
using Avalonia.Media; using Avalonia.Media;
using Avalonia.Metadata;
namespace Avalonia.Rendering namespace Avalonia.Rendering
{ {
@ -6,6 +7,7 @@ namespace Avalonia.Rendering
/// Internal interface for initializing controls that are to be used as the visual in a /// Internal interface for initializing controls that are to be used as the visual in a
/// <see cref="VisualBrush"/>. /// <see cref="VisualBrush"/>.
/// </summary> /// </summary>
[Unstable]
public interface IVisualBrushInitialize public interface IVisualBrushInitialize
{ {
/// <summary> /// <summary>

2
src/Avalonia.Base/Rendering/IVisualBrushRenderer.cs

@ -1,4 +1,5 @@
using Avalonia.Media; using Avalonia.Media;
using Avalonia.Metadata;
using Avalonia.Platform; using Avalonia.Platform;
namespace Avalonia.Rendering namespace Avalonia.Rendering
@ -6,6 +7,7 @@ namespace Avalonia.Rendering
/// <summary> /// <summary>
/// Defines a renderer used to render a visual brush to a bitmap. /// Defines a renderer used to render a visual brush to a bitmap.
/// </summary> /// </summary>
[Unstable]
public interface IVisualBrushRenderer public interface IVisualBrushRenderer
{ {
/// <summary> /// <summary>

6
src/Avalonia.Base/Styling/Activators/IStyleActivator.cs

@ -1,6 +1,5 @@
#nullable enable using System;
using Avalonia.Metadata;
using System;
namespace Avalonia.Styling.Activators namespace Avalonia.Styling.Activators
{ {
@ -16,6 +15,7 @@ namespace Avalonia.Styling.Activators
/// - The subscription can have a tag associated with it, allowing a subscriber to index /// - The subscription can have a tag associated with it, allowing a subscriber to index
/// into a list of subscriptions without having to allocate additional objects. /// into a list of subscriptions without having to allocate additional objects.
/// </remarks> /// </remarks>
[Unstable]
public interface IStyleActivator : IDisposable public interface IStyleActivator : IDisposable
{ {
/// <summary> /// <summary>

3
src/Avalonia.Base/Styling/Activators/IStyleActivatorSink.cs

@ -1,10 +1,11 @@
#nullable enable using Avalonia.Metadata;
namespace Avalonia.Styling.Activators namespace Avalonia.Styling.Activators
{ {
/// <summary> /// <summary>
/// Receives notifications from an <see cref="IStyleActivator"/>. /// Receives notifications from an <see cref="IStyleActivator"/>.
/// </summary> /// </summary>
[Unstable]
public interface IStyleActivatorSink public interface IStyleActivatorSink
{ {
/// <summary> /// <summary>

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save