diff --git a/samples/ControlCatalog/Pages/DataGridPage.xaml b/samples/ControlCatalog/Pages/DataGridPage.xaml index 31b4039d33..27272a9ff7 100644 --- a/samples/ControlCatalog/Pages/DataGridPage.xaml +++ b/samples/ControlCatalog/Pages/DataGridPage.xaml @@ -10,11 +10,11 @@ + + + - @@ -54,7 +54,8 @@ - diff --git a/src/Avalonia.Base/Platform/IGeometryImpl.cs b/src/Avalonia.Base/Platform/IGeometryImpl.cs index c80f8923ef..5826cfb2ff 100644 --- a/src/Avalonia.Base/Platform/IGeometryImpl.cs +++ b/src/Avalonia.Base/Platform/IGeometryImpl.cs @@ -38,8 +38,8 @@ namespace Avalonia.Platform /// Intersects the geometry with another geometry. /// /// The other geometry. - /// A new representing the intersection. - IGeometryImpl Intersect(IGeometryImpl geometry); + /// A new representing the intersection or null when the operation failed. + IGeometryImpl? Intersect(IGeometryImpl geometry); /// /// Indicates whether the geometry's stroke contains the specified point. diff --git a/src/Avalonia.Base/Rendering/Composition/Animations/AnimationInstanceBase.cs b/src/Avalonia.Base/Rendering/Composition/Animations/AnimationInstanceBase.cs index 80e64118ee..889c1d34c8 100644 --- a/src/Avalonia.Base/Rendering/Composition/Animations/AnimationInstanceBase.cs +++ b/src/Avalonia.Base/Rendering/Composition/Animations/AnimationInstanceBase.cs @@ -3,8 +3,9 @@ using System.Collections.Generic; using Avalonia.Rendering.Composition.Expressions; using Avalonia.Rendering.Composition.Server; -namespace Avalonia.Rendering.Composition.Animations; +// Special license applies License.md +namespace Avalonia.Rendering.Composition.Animations; /// /// The base class for both key-frame and expression animation instances @@ -79,4 +80,4 @@ internal abstract class AnimationInstanceBase : IAnimationInstance _invalidated = true; TargetObject.NotifyAnimatedValueChanged(Property); } -} \ No newline at end of file +} diff --git a/src/Avalonia.Base/Rendering/Composition/Animations/CompositionAnimation.cs b/src/Avalonia.Base/Rendering/Composition/Animations/CompositionAnimation.cs index c5102a2d7d..19d316eb85 100644 --- a/src/Avalonia.Base/Rendering/Composition/Animations/CompositionAnimation.cs +++ b/src/Avalonia.Base/Rendering/Composition/Animations/CompositionAnimation.cs @@ -8,6 +8,8 @@ using Avalonia.Rendering.Composition.Expressions; using Avalonia.Rendering.Composition.Server; using Avalonia.Rendering.Composition.Transport; +// Special license applies License.md + namespace Avalonia.Rendering.Composition.Animations { /// @@ -72,4 +74,4 @@ namespace Avalonia.Rendering.Composition.Animations } } -} \ No newline at end of file +} diff --git a/src/Avalonia.Base/Rendering/Composition/Animations/CompositionAnimationGroup.cs b/src/Avalonia.Base/Rendering/Composition/Animations/CompositionAnimationGroup.cs index 89f8ba411d..bad3991f43 100644 --- a/src/Avalonia.Base/Rendering/Composition/Animations/CompositionAnimationGroup.cs +++ b/src/Avalonia.Base/Rendering/Composition/Animations/CompositionAnimationGroup.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using Avalonia.Rendering.Composition.Transport; +// Special license applies License.md + namespace Avalonia.Rendering.Composition.Animations { public class CompositionAnimationGroup : CompositionObject, ICompositionAnimationBase @@ -21,4 +23,4 @@ namespace Avalonia.Rendering.Composition.Animations { } } -} \ No newline at end of file +} diff --git a/src/Avalonia.Base/Rendering/Composition/Animations/ExpressionAnimation.cs b/src/Avalonia.Base/Rendering/Composition/Animations/ExpressionAnimation.cs index 163f4e99ba..577910d975 100644 --- a/src/Avalonia.Base/Rendering/Composition/Animations/ExpressionAnimation.cs +++ b/src/Avalonia.Base/Rendering/Composition/Animations/ExpressionAnimation.cs @@ -3,6 +3,8 @@ using System; using Avalonia.Rendering.Composition.Expressions; using Avalonia.Rendering.Composition.Server; +// Special license applies License.md + namespace Avalonia.Rendering.Composition.Animations { /// @@ -50,4 +52,4 @@ namespace Avalonia.Rendering.Composition.Animations => new ExpressionAnimationInstance(ParsedExpression, targetObject, finalValue, CreateSnapshot()); } -} \ No newline at end of file +} diff --git a/src/Avalonia.Base/Rendering/Composition/Animations/ExpressionAnimationInstance.cs b/src/Avalonia.Base/Rendering/Composition/Animations/ExpressionAnimationInstance.cs index 764bac9931..6c7c556456 100644 --- a/src/Avalonia.Base/Rendering/Composition/Animations/ExpressionAnimationInstance.cs +++ b/src/Avalonia.Base/Rendering/Composition/Animations/ExpressionAnimationInstance.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using Avalonia.Rendering.Composition.Expressions; using Avalonia.Rendering.Composition.Server; +// Special license applies License.md + namespace Avalonia.Rendering.Composition.Animations { @@ -46,4 +48,4 @@ namespace Avalonia.Rendering.Composition.Animations _finalValue = finalValue; } } -} \ No newline at end of file +} diff --git a/src/Avalonia.Base/Rendering/Composition/Animations/IAnimationInstance.cs b/src/Avalonia.Base/Rendering/Composition/Animations/IAnimationInstance.cs index 4e1972f2c6..8ec4ec19bc 100644 --- a/src/Avalonia.Base/Rendering/Composition/Animations/IAnimationInstance.cs +++ b/src/Avalonia.Base/Rendering/Composition/Animations/IAnimationInstance.cs @@ -2,6 +2,8 @@ using System; using Avalonia.Rendering.Composition.Expressions; using Avalonia.Rendering.Composition.Server; +// Special license applies License.md + namespace Avalonia.Rendering.Composition.Animations { internal interface IAnimationInstance @@ -13,4 +15,4 @@ namespace Avalonia.Rendering.Composition.Animations void Deactivate(); void Invalidate(); } -} \ No newline at end of file +} diff --git a/src/Avalonia.Base/Rendering/Composition/Animations/ICompositionAnimationBase.cs b/src/Avalonia.Base/Rendering/Composition/Animations/ICompositionAnimationBase.cs index 87e5ad757a..91b37a81af 100644 --- a/src/Avalonia.Base/Rendering/Composition/Animations/ICompositionAnimationBase.cs +++ b/src/Avalonia.Base/Rendering/Composition/Animations/ICompositionAnimationBase.cs @@ -2,6 +2,8 @@ using Avalonia.Rendering.Composition.Server; +// Special license applies License.md + namespace Avalonia.Rendering.Composition.Animations { /// @@ -12,4 +14,4 @@ namespace Avalonia.Rendering.Composition.Animations internal void InternalOnly(); } -} \ No newline at end of file +} diff --git a/src/Avalonia.Base/Rendering/Composition/Animations/ImplicitAnimationCollection.cs b/src/Avalonia.Base/Rendering/Composition/Animations/ImplicitAnimationCollection.cs index f4bcc6ff38..72be4edd07 100644 --- a/src/Avalonia.Base/Rendering/Composition/Animations/ImplicitAnimationCollection.cs +++ b/src/Avalonia.Base/Rendering/Composition/Animations/ImplicitAnimationCollection.cs @@ -4,6 +4,8 @@ using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using Avalonia.Rendering.Composition.Transport; +// Special license applies License.md + namespace Avalonia.Rendering.Composition.Animations { /// @@ -79,4 +81,4 @@ namespace Avalonia.Rendering.Composition.Animations return rv; } } -} \ No newline at end of file +} diff --git a/src/Avalonia.Base/Rendering/Composition/Animations/Interpolators.cs b/src/Avalonia.Base/Rendering/Composition/Animations/Interpolators.cs index a4eeacef32..e19c0ff098 100644 --- a/src/Avalonia.Base/Rendering/Composition/Animations/Interpolators.cs +++ b/src/Avalonia.Base/Rendering/Composition/Animations/Interpolators.cs @@ -1,6 +1,8 @@ using System; using System.Numerics; +// Special license applies License.md + namespace Avalonia.Rendering.Composition.Animations { /// @@ -73,4 +75,4 @@ namespace Avalonia.Rendering.Composition.Animations public static BooleanInterpolator Instance { get; } = new BooleanInterpolator(); } -} \ No newline at end of file +} diff --git a/src/Avalonia.Base/Rendering/Composition/Animations/KeyFrameAnimation.cs b/src/Avalonia.Base/Rendering/Composition/Animations/KeyFrameAnimation.cs index 49b3ab753a..4692fde5e3 100644 --- a/src/Avalonia.Base/Rendering/Composition/Animations/KeyFrameAnimation.cs +++ b/src/Avalonia.Base/Rendering/Composition/Animations/KeyFrameAnimation.cs @@ -2,6 +2,8 @@ using System; using Avalonia.Animation; using Avalonia.Animation.Easings; +// Special license applies License.md + namespace Avalonia.Rendering.Composition.Animations { @@ -131,4 +133,4 @@ namespace Avalonia.Rendering.Composition.Animations /// SetToFinalValue } -} \ No newline at end of file +} diff --git a/src/Avalonia.Base/Rendering/Composition/Animations/KeyFrameAnimationInstance.cs b/src/Avalonia.Base/Rendering/Composition/Animations/KeyFrameAnimationInstance.cs index 0c0fcfaf2b..e20a4a9ad8 100644 --- a/src/Avalonia.Base/Rendering/Composition/Animations/KeyFrameAnimationInstance.cs +++ b/src/Avalonia.Base/Rendering/Composition/Animations/KeyFrameAnimationInstance.cs @@ -4,6 +4,8 @@ using Avalonia.Animation; using Avalonia.Rendering.Composition.Expressions; using Avalonia.Rendering.Composition.Server; +// Special license applies License.md + namespace Avalonia.Rendering.Composition.Animations { /// @@ -175,4 +177,4 @@ namespace Avalonia.Rendering.Composition.Animations base.Deactivate(); } } -} \ No newline at end of file +} diff --git a/src/Avalonia.Base/Rendering/Composition/Animations/KeyFrames.cs b/src/Avalonia.Base/Rendering/Composition/Animations/KeyFrames.cs index 369cc80b95..79045ccff8 100644 --- a/src/Avalonia.Base/Rendering/Composition/Animations/KeyFrames.cs +++ b/src/Avalonia.Base/Rendering/Composition/Animations/KeyFrames.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using Avalonia.Animation.Easings; using Avalonia.Rendering.Composition.Expressions; +// Special license applies License.md + namespace Avalonia.Rendering.Composition.Animations { @@ -86,4 +88,4 @@ namespace Avalonia.Rendering.Composition.Animations { public void InsertExpressionKeyFrame(float normalizedProgressKey, string value, IEasing easingFunction); } -} \ No newline at end of file +} diff --git a/src/Avalonia.Base/Rendering/Composition/Animations/PropertySetSnapshot.cs b/src/Avalonia.Base/Rendering/Composition/Animations/PropertySetSnapshot.cs index fc6cfc9f3d..af3c344999 100644 --- a/src/Avalonia.Base/Rendering/Composition/Animations/PropertySetSnapshot.cs +++ b/src/Avalonia.Base/Rendering/Composition/Animations/PropertySetSnapshot.cs @@ -1,6 +1,8 @@ using System.Collections.Generic; using Avalonia.Rendering.Composition.Expressions; +// Special license applies License.md + namespace Avalonia.Rendering.Composition.Animations { /// @@ -46,4 +48,4 @@ namespace Avalonia.Rendering.Composition.Animations public ExpressionVariant GetProperty(string name) => GetParameter(name); } -} \ No newline at end of file +} diff --git a/src/Avalonia.Base/Rendering/Composition/CompositingRenderer.cs b/src/Avalonia.Base/Rendering/Composition/CompositingRenderer.cs index a571a0518b..db773bc43c 100644 --- a/src/Avalonia.Base/Rendering/Composition/CompositingRenderer.cs +++ b/src/Avalonia.Base/Rendering/Composition/CompositingRenderer.cs @@ -11,6 +11,8 @@ using Avalonia.Rendering.Composition.Server; using Avalonia.Threading; using Avalonia.VisualTree; +// Special license applies License.md + namespace Avalonia.Rendering.Composition; /// diff --git a/src/Avalonia.Base/Rendering/Composition/CompositionDrawListVisual.cs b/src/Avalonia.Base/Rendering/Composition/CompositionDrawListVisual.cs index 49aea1c3dc..77b392eee5 100644 --- a/src/Avalonia.Base/Rendering/Composition/CompositionDrawListVisual.cs +++ b/src/Avalonia.Base/Rendering/Composition/CompositionDrawListVisual.cs @@ -5,6 +5,8 @@ using Avalonia.Rendering.Composition.Server; using Avalonia.Rendering.Composition.Transport; using Avalonia.VisualTree; +// Special license applies License.md + namespace Avalonia.Rendering.Composition; @@ -72,4 +74,4 @@ internal class CompositionDrawListVisual : CompositionContainerVisual return true; return false; } -} \ No newline at end of file +} diff --git a/src/Avalonia.Base/Rendering/Composition/CompositionObject.cs b/src/Avalonia.Base/Rendering/Composition/CompositionObject.cs index f529ee9cff..50332926ad 100644 --- a/src/Avalonia.Base/Rendering/Composition/CompositionObject.cs +++ b/src/Avalonia.Base/Rendering/Composition/CompositionObject.cs @@ -5,6 +5,8 @@ using Avalonia.Rendering.Composition.Server; using Avalonia.Rendering.Composition.Transport; using Avalonia.Utilities; +// Special license applies License.md + namespace Avalonia.Rendering.Composition { /// @@ -138,4 +140,4 @@ namespace Avalonia.Rendering.Composition writer.Write((byte)(IsDisposed ? 1 : 0)); } } -} \ No newline at end of file +} diff --git a/src/Avalonia.Base/Rendering/Composition/CompositionPropertySet.cs b/src/Avalonia.Base/Rendering/Composition/CompositionPropertySet.cs index ee4552d154..7d794af9a2 100644 --- a/src/Avalonia.Base/Rendering/Composition/CompositionPropertySet.cs +++ b/src/Avalonia.Base/Rendering/Composition/CompositionPropertySet.cs @@ -5,6 +5,8 @@ using Avalonia.Rendering.Composition.Animations; using Avalonia.Rendering.Composition.Expressions; using Avalonia.Rendering.Composition.Transport; +// Special license applies License.md + namespace Avalonia.Rendering.Composition { /// @@ -144,4 +146,4 @@ namespace Avalonia.Rendering.Composition TypeMismatch, NotFound } -} \ No newline at end of file +} diff --git a/src/Avalonia.Base/Rendering/Composition/CompositionTarget.cs b/src/Avalonia.Base/Rendering/Composition/CompositionTarget.cs index 01b2d0d5d9..4e53e163ec 100644 --- a/src/Avalonia.Base/Rendering/Composition/CompositionTarget.cs +++ b/src/Avalonia.Base/Rendering/Composition/CompositionTarget.cs @@ -4,6 +4,8 @@ using System.Numerics; using Avalonia.Collections.Pooled; using Avalonia.VisualTree; +// Special license applies License.md + namespace Avalonia.Rendering.Composition { /// @@ -127,4 +129,4 @@ namespace Avalonia.Rendering.Composition Compositor.Server.Render(); } } -} \ No newline at end of file +} diff --git a/src/Avalonia.Base/Rendering/Composition/Compositor.cs b/src/Avalonia.Base/Rendering/Composition/Compositor.cs index 1bdae44cb9..45212d0f36 100644 --- a/src/Avalonia.Base/Rendering/Composition/Compositor.cs +++ b/src/Avalonia.Base/Rendering/Composition/Compositor.cs @@ -12,6 +12,8 @@ using Avalonia.Rendering.Composition.Transport; using Avalonia.Threading; +// Special license applies License.md + namespace Avalonia.Rendering.Composition { /// @@ -138,4 +140,4 @@ namespace Avalonia.Rendering.Composition _invokeOnNextCommit.Add(action); } } -} \ No newline at end of file +} diff --git a/src/Avalonia.Base/Rendering/Composition/ContainerVisual.cs b/src/Avalonia.Base/Rendering/Composition/ContainerVisual.cs index caf074dd6b..9b9c44b95f 100644 --- a/src/Avalonia.Base/Rendering/Composition/ContainerVisual.cs +++ b/src/Avalonia.Base/Rendering/Composition/ContainerVisual.cs @@ -1,5 +1,7 @@ using Avalonia.Rendering.Composition.Server; +// Special license applies License.md + namespace Avalonia.Rendering.Composition { /// @@ -21,4 +23,4 @@ namespace Avalonia.Rendering.Composition base.OnRootChangedCore(); } } -} \ No newline at end of file +} diff --git a/src/Avalonia.Base/Rendering/Composition/Drawing/CompositionDrawList.cs b/src/Avalonia.Base/Rendering/Composition/Drawing/CompositionDrawList.cs index 432a0832f2..10a7c3e360 100644 --- a/src/Avalonia.Base/Rendering/Composition/Drawing/CompositionDrawList.cs +++ b/src/Avalonia.Base/Rendering/Composition/Drawing/CompositionDrawList.cs @@ -4,6 +4,8 @@ using Avalonia.Rendering.Composition.Server; using Avalonia.Rendering.SceneGraph; using Avalonia.Utilities; +// Special license applies License.md + namespace Avalonia.Rendering.Composition.Drawing; /// @@ -99,4 +101,4 @@ internal class CompositionDrawListBuilder if (count < Count) _operations!.RemoveRange(count, _operations.Count - count); } -} \ No newline at end of file +} diff --git a/src/Avalonia.Base/Rendering/Composition/Drawing/CompositionDrawingContext.cs b/src/Avalonia.Base/Rendering/Composition/Drawing/CompositionDrawingContext.cs index d7c1ef125d..01216d19ed 100644 --- a/src/Avalonia.Base/Rendering/Composition/Drawing/CompositionDrawingContext.cs +++ b/src/Avalonia.Base/Rendering/Composition/Drawing/CompositionDrawingContext.cs @@ -8,6 +8,9 @@ using Avalonia.Rendering.Composition.Drawing; using Avalonia.Rendering.SceneGraph; using Avalonia.Utilities; using Avalonia.VisualTree; + +// Special license applies License.md + namespace Avalonia.Rendering.Composition; /// @@ -388,4 +391,4 @@ internal class CompositionDrawingContext : IDrawingContextImpl, IDrawingContextW } return null; } -} \ No newline at end of file +} diff --git a/src/Avalonia.Base/Rendering/Composition/ElementCompositionPreview.cs b/src/Avalonia.Base/Rendering/Composition/ElementCompositionPreview.cs index 1397a20fb6..5bd8e4a4d3 100644 --- a/src/Avalonia.Base/Rendering/Composition/ElementCompositionPreview.cs +++ b/src/Avalonia.Base/Rendering/Composition/ElementCompositionPreview.cs @@ -1,3 +1,5 @@ +// Special license applies License.md + namespace Avalonia.Rendering.Composition; /// @@ -11,4 +13,4 @@ public static class ElementComposition /// /// public static CompositionVisual? GetElementVisual(Visual visual) => visual.CompositionVisual; -} \ No newline at end of file +} diff --git a/src/Avalonia.Base/Rendering/Composition/Enums.cs b/src/Avalonia.Base/Rendering/Composition/Enums.cs index e349845cbf..cc37b25701 100644 --- a/src/Avalonia.Base/Rendering/Composition/Enums.cs +++ b/src/Avalonia.Base/Rendering/Composition/Enums.cs @@ -1,5 +1,7 @@ using System; +// Special license applies License.md + namespace Avalonia.Rendering.Composition { public enum CompositionBlendMode @@ -117,4 +119,4 @@ namespace Avalonia.Rendering.Composition Fill = 1, //TODO: Uniform, UniformToFill } -} \ No newline at end of file +} diff --git a/src/Avalonia.Base/Rendering/Composition/Expressions/BuiltInExpressionFfi.cs b/src/Avalonia.Base/Rendering/Composition/Expressions/BuiltInExpressionFfi.cs index 44347d2c7a..896ae4fc3a 100644 --- a/src/Avalonia.Base/Rendering/Composition/Expressions/BuiltInExpressionFfi.cs +++ b/src/Avalonia.Base/Rendering/Composition/Expressions/BuiltInExpressionFfi.cs @@ -4,6 +4,8 @@ using System.Numerics; using Avalonia.Rendering.Composition.Animations; using Avalonia.Utilities; +// Special license applies License.md + namespace Avalonia.Rendering.Composition.Expressions { /// @@ -234,4 +236,4 @@ namespace Avalonia.Rendering.Composition.Expressions public static BuiltInExpressionFfi Instance { get; } = new BuiltInExpressionFfi(); } -} \ No newline at end of file +} diff --git a/src/Avalonia.Base/Rendering/Composition/Expressions/DelegateExpressionFfi.cs b/src/Avalonia.Base/Rendering/Composition/Expressions/DelegateExpressionFfi.cs index 85c6141409..c15487065c 100644 --- a/src/Avalonia.Base/Rendering/Composition/Expressions/DelegateExpressionFfi.cs +++ b/src/Avalonia.Base/Rendering/Composition/Expressions/DelegateExpressionFfi.cs @@ -5,6 +5,8 @@ using System.Linq; using System.Numerics; using Avalonia.Media; +// Special license applies License.md + namespace Avalonia.Rendering.Composition.Expressions { /// @@ -181,4 +183,4 @@ namespace Avalonia.Rendering.Composition.Expressions ); } } -} \ No newline at end of file +} diff --git a/src/Avalonia.Base/Rendering/Composition/Expressions/Expression.cs b/src/Avalonia.Base/Rendering/Composition/Expressions/Expression.cs index 5abba00365..ff2069e71e 100644 --- a/src/Avalonia.Base/Rendering/Composition/Expressions/Expression.cs +++ b/src/Avalonia.Base/Rendering/Composition/Expressions/Expression.cs @@ -4,6 +4,8 @@ using System.Globalization; using System.Reflection; using Avalonia.Rendering.Composition.Server; +// Special license applies License.md + namespace Avalonia.Rendering.Composition.Expressions { /// @@ -374,4 +376,4 @@ namespace Avalonia.Rendering.Composition.Expressions -} \ No newline at end of file +} diff --git a/src/Avalonia.Base/Rendering/Composition/Expressions/ExpressionEvaluationContext.cs b/src/Avalonia.Base/Rendering/Composition/Expressions/ExpressionEvaluationContext.cs index 9d23551e43..9086c59aad 100644 --- a/src/Avalonia.Base/Rendering/Composition/Expressions/ExpressionEvaluationContext.cs +++ b/src/Avalonia.Base/Rendering/Composition/Expressions/ExpressionEvaluationContext.cs @@ -1,6 +1,8 @@ using System.Collections.Generic; using Avalonia.Rendering.Composition.Server; +// Special license applies License.md + namespace Avalonia.Rendering.Composition.Expressions { internal struct ExpressionEvaluationContext @@ -29,4 +31,4 @@ namespace Avalonia.Rendering.Composition.Expressions { bool Call(string name, IReadOnlyList arguments, out ExpressionVariant result); } -} \ No newline at end of file +} diff --git a/src/Avalonia.Base/Rendering/Composition/Expressions/ExpressionParseException.cs b/src/Avalonia.Base/Rendering/Composition/Expressions/ExpressionParseException.cs index 6a207a3bf7..c32a7832a6 100644 --- a/src/Avalonia.Base/Rendering/Composition/Expressions/ExpressionParseException.cs +++ b/src/Avalonia.Base/Rendering/Composition/Expressions/ExpressionParseException.cs @@ -1,5 +1,7 @@ using System; +// Special license applies License.md + namespace Avalonia.Rendering.Composition.Expressions { internal class ExpressionParseException : Exception @@ -11,4 +13,4 @@ namespace Avalonia.Rendering.Composition.Expressions Position = position; } } -} \ No newline at end of file +} diff --git a/src/Avalonia.Base/Rendering/Composition/Expressions/ExpressionParser.cs b/src/Avalonia.Base/Rendering/Composition/Expressions/ExpressionParser.cs index 5924bb8f1b..3937d48187 100644 --- a/src/Avalonia.Base/Rendering/Composition/Expressions/ExpressionParser.cs +++ b/src/Avalonia.Base/Rendering/Composition/Expressions/ExpressionParser.cs @@ -5,6 +5,8 @@ using System.Linq; // ReSharper disable StringLiteralTypo +// Special license applies License.md + namespace Avalonia.Rendering.Composition.Expressions { internal class ExpressionParser @@ -295,4 +297,4 @@ namespace Avalonia.Rendering.Composition.Expressions } } -} \ No newline at end of file +} diff --git a/src/Avalonia.Base/Rendering/Composition/Expressions/ExpressionTrackedValues.cs b/src/Avalonia.Base/Rendering/Composition/Expressions/ExpressionTrackedValues.cs index 334f975aa0..e386e058df 100644 --- a/src/Avalonia.Base/Rendering/Composition/Expressions/ExpressionTrackedValues.cs +++ b/src/Avalonia.Base/Rendering/Composition/Expressions/ExpressionTrackedValues.cs @@ -2,6 +2,8 @@ using System.Collections; using System.Collections.Generic; using Avalonia.Rendering.Composition.Server; +// Special license applies License.md + namespace Avalonia.Rendering.Composition.Expressions; internal class ExpressionTrackedObjects : IEnumerable @@ -54,4 +56,4 @@ internal class ExpressionTrackedObjects : IEnumerable _stack.Push(obj); } } -} \ No newline at end of file +} diff --git a/src/Avalonia.Base/Rendering/Composition/Expressions/ExpressionVariant.cs b/src/Avalonia.Base/Rendering/Composition/Expressions/ExpressionVariant.cs index 7b900534d8..6e53a138cd 100644 --- a/src/Avalonia.Base/Rendering/Composition/Expressions/ExpressionVariant.cs +++ b/src/Avalonia.Base/Rendering/Composition/Expressions/ExpressionVariant.cs @@ -4,6 +4,8 @@ using System.Numerics; using System.Runtime.InteropServices; using Avalonia.Media; +// Special license applies License.md + namespace Avalonia.Rendering.Composition.Expressions { internal enum VariantType @@ -727,4 +729,4 @@ namespace Avalonia.Rendering.Composition.Expressions } } -} \ No newline at end of file +} diff --git a/src/Avalonia.Base/Rendering/Composition/Expressions/TokenParser.cs b/src/Avalonia.Base/Rendering/Composition/Expressions/TokenParser.cs index 27782c8c2c..bb7372c375 100644 --- a/src/Avalonia.Base/Rendering/Composition/Expressions/TokenParser.cs +++ b/src/Avalonia.Base/Rendering/Composition/Expressions/TokenParser.cs @@ -1,6 +1,8 @@ using System; using System.Globalization; +// Special license applies License.md + namespace Avalonia.Rendering.Composition.Expressions { /// @@ -256,4 +258,4 @@ namespace Avalonia.Rendering.Composition.Expressions public override string ToString() => _s.ToString(); } -} \ No newline at end of file +} diff --git a/src/Avalonia.Base/Rendering/Composition/ICompositionTargetDebugEvents.cs b/src/Avalonia.Base/Rendering/Composition/ICompositionTargetDebugEvents.cs index 045a4f8cc6..131a51b5e6 100644 --- a/src/Avalonia.Base/Rendering/Composition/ICompositionTargetDebugEvents.cs +++ b/src/Avalonia.Base/Rendering/Composition/ICompositionTargetDebugEvents.cs @@ -1,6 +1,8 @@ +// Special license applies License.md + namespace Avalonia.Rendering.Composition; internal interface ICompositionTargetDebugEvents { void RectInvalidated(Rect rc); -} \ No newline at end of file +} diff --git a/src/Avalonia.Base/Rendering/Composition/License.md b/src/Avalonia.Base/Rendering/Composition/License.md new file mode 100644 index 0000000000..d1b709859e --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/License.md @@ -0,0 +1,7 @@ +Please note: Any code in this directory is excluded from the normal MIT license. + +This code is owned and copyright to Avalonia OU. + +This code may be used free of charge by any application that consumes Avalonia binary packages as a direct or indirect dependency. + +Explicit permission is required for any other use outside of Avalonia applications. \ No newline at end of file diff --git a/src/Avalonia.Base/Rendering/Composition/MatrixUtils.cs b/src/Avalonia.Base/Rendering/Composition/MatrixUtils.cs index 2cb500cae4..3d8d5bae78 100644 --- a/src/Avalonia.Base/Rendering/Composition/MatrixUtils.cs +++ b/src/Avalonia.Base/Rendering/Composition/MatrixUtils.cs @@ -1,5 +1,7 @@ using System.Numerics; +// Special license applies License.md + namespace Avalonia.Rendering.Composition { static class MatrixUtils @@ -63,4 +65,4 @@ namespace Avalonia.Rendering.Composition matrix44.M42, matrix44.M44); } -} \ No newline at end of file +} diff --git a/src/Avalonia.Base/Rendering/Composition/Server/CompositionProperty.cs b/src/Avalonia.Base/Rendering/Composition/Server/CompositionProperty.cs index 282c0e113d..5d63c8a4b3 100644 --- a/src/Avalonia.Base/Rendering/Composition/Server/CompositionProperty.cs +++ b/src/Avalonia.Base/Rendering/Composition/Server/CompositionProperty.cs @@ -1,6 +1,8 @@ using System.Collections.Generic; using System.Threading; +// Special license applies License.md + namespace Avalonia.Rendering.Composition.Server; internal class CompositionProperty @@ -12,4 +14,4 @@ internal class CompositionProperty { Id = Interlocked.Increment(ref s_NextId) }; -} \ No newline at end of file +} diff --git a/src/Avalonia.Base/Rendering/Composition/Server/DrawingContextProxy.cs b/src/Avalonia.Base/Rendering/Composition/Server/DrawingContextProxy.cs index e261507f60..7eb35a68ed 100644 --- a/src/Avalonia.Base/Rendering/Composition/Server/DrawingContextProxy.cs +++ b/src/Avalonia.Base/Rendering/Composition/Server/DrawingContextProxy.cs @@ -6,6 +6,8 @@ using Avalonia.Rendering.Composition.Drawing; using Avalonia.Rendering.SceneGraph; using Avalonia.Utilities; +// Special license applies License.md + namespace Avalonia.Rendering.Composition.Server; /// @@ -176,4 +178,4 @@ internal class CompositorDrawingContextProxy : IDrawingContextImpl, IDrawingCont if (_impl is IDrawingContextWithAcrylicLikeSupport acrylic) acrylic.DrawRectangle(material, rect); } -} \ No newline at end of file +} diff --git a/src/Avalonia.Base/Rendering/Composition/Server/FpsCounter.cs b/src/Avalonia.Base/Rendering/Composition/Server/FpsCounter.cs index 7585710540..b0b3982ed5 100644 --- a/src/Avalonia.Base/Rendering/Composition/Server/FpsCounter.cs +++ b/src/Avalonia.Base/Rendering/Composition/Server/FpsCounter.cs @@ -6,6 +6,8 @@ using Avalonia.Media.TextFormatting; using Avalonia.Platform; using Avalonia.Utilities; +// Special license applies License.md + namespace Avalonia.Rendering.Composition.Server; /// @@ -73,4 +75,4 @@ internal class FpsCounter offset += run.Size.Width; } } -} \ No newline at end of file +} diff --git a/src/Avalonia.Base/Rendering/Composition/Server/ReadbackIndices.cs b/src/Avalonia.Base/Rendering/Composition/Server/ReadbackIndices.cs index c9592b70ab..d9df176e66 100644 --- a/src/Avalonia.Base/Rendering/Composition/Server/ReadbackIndices.cs +++ b/src/Avalonia.Base/Rendering/Composition/Server/ReadbackIndices.cs @@ -1,3 +1,5 @@ +// Special license applies License.md + namespace Avalonia.Rendering.Composition.Server { /// @@ -43,4 +45,4 @@ namespace Avalonia.Rendering.Composition.Server } } } -} \ No newline at end of file +} diff --git a/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositionContainerVisual.cs b/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositionContainerVisual.cs index f7152293cc..19349a5196 100644 --- a/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositionContainerVisual.cs +++ b/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositionContainerVisual.cs @@ -1,6 +1,8 @@ using System.Numerics; using Avalonia.Platform; +// Special license applies License.md + namespace Avalonia.Rendering.Composition.Server { /// @@ -41,4 +43,4 @@ namespace Avalonia.Rendering.Composition.Server Children = new ServerCompositionVisualCollection(Compositor); } } -} \ No newline at end of file +} diff --git a/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositionDrawListVisual.cs b/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositionDrawListVisual.cs index 93a5226f83..6cbd2797f9 100644 --- a/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositionDrawListVisual.cs +++ b/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositionDrawListVisual.cs @@ -7,6 +7,8 @@ using Avalonia.Rendering.Composition.Transport; using Avalonia.Rendering.SceneGraph; using Avalonia.Utilities; +// Special license applies License.md + namespace Avalonia.Rendering.Composition.Server; /// @@ -72,4 +74,4 @@ internal class ServerCompositionDrawListVisual : ServerCompositionContainerVisua return UiVisual.GetType().ToString(); } #endif -} \ No newline at end of file +} diff --git a/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositionSurface.cs b/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositionSurface.cs index 462a193a86..32a99fa187 100644 --- a/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositionSurface.cs +++ b/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositionSurface.cs @@ -1,3 +1,5 @@ +// Special license applies License.md + namespace Avalonia.Rendering.Composition.Server { internal abstract class ServerCompositionSurface : ServerObject @@ -6,4 +8,4 @@ namespace Avalonia.Rendering.Composition.Server { } } -} \ No newline at end of file +} diff --git a/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositionTarget.cs b/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositionTarget.cs index 882b66bf70..c20594aaca 100644 --- a/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositionTarget.cs +++ b/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositionTarget.cs @@ -9,6 +9,8 @@ using Avalonia.Platform; using Avalonia.Rendering.Composition.Transport; using Avalonia.Utilities; +// Special license applies License.md + namespace Avalonia.Rendering.Composition.Server { /// @@ -218,4 +220,4 @@ namespace Avalonia.Rendering.Composition.Server public void EnqueueAdornerUpdate(ServerCompositionVisual visual) => _adornerUpdateQueue.Enqueue(visual); } -} \ No newline at end of file +} diff --git a/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositionVisual.DirtyProperties.cs b/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositionVisual.DirtyProperties.cs index c5af74e2dd..405c7879b7 100644 --- a/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositionVisual.DirtyProperties.cs +++ b/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositionVisual.DirtyProperties.cs @@ -1,3 +1,5 @@ +// Special license applies License.md + namespace Avalonia.Rendering.Composition.Server; partial class ServerCompositionVisual @@ -73,4 +75,4 @@ partial class ServerCompositionVisual || offset == s_IdOfSizeProperty) _clipSizeDirty = true; } -} \ No newline at end of file +} diff --git a/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositionVisual.cs b/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositionVisual.cs index c0e487f209..b742f1d44a 100644 --- a/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositionVisual.cs +++ b/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositionVisual.cs @@ -6,6 +6,8 @@ using Avalonia.Rendering.Composition.Animations; using Avalonia.Rendering.Composition.Transport; using Avalonia.Utilities; +// Special license applies License.md + namespace Avalonia.Rendering.Composition.Server { /// @@ -234,4 +236,4 @@ namespace Avalonia.Rendering.Composition.Server } -} \ No newline at end of file +} diff --git a/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositor.cs b/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositor.cs index 564f792ebe..621bc84f4a 100644 --- a/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositor.cs +++ b/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositor.cs @@ -6,6 +6,8 @@ using Avalonia.Rendering.Composition.Animations; using Avalonia.Rendering.Composition.Expressions; using Avalonia.Rendering.Composition.Transport; +// Special license applies License.md + namespace Avalonia.Rendering.Composition.Server { /// @@ -137,4 +139,4 @@ namespace Avalonia.Rendering.Composition.Server public void RemoveFromClock(IAnimationInstance animationInstance) => _activeAnimations.Remove(animationInstance); } -} \ No newline at end of file +} diff --git a/src/Avalonia.Base/Rendering/Composition/Server/ServerList.cs b/src/Avalonia.Base/Rendering/Composition/Server/ServerList.cs index 39d6a8dc70..08a3fdce22 100644 --- a/src/Avalonia.Base/Rendering/Composition/Server/ServerList.cs +++ b/src/Avalonia.Base/Rendering/Composition/Server/ServerList.cs @@ -2,6 +2,8 @@ using System; using System.Collections.Generic; using Avalonia.Rendering.Composition.Transport; +// Special license applies License.md + namespace Avalonia.Rendering.Composition.Server { /// @@ -41,4 +43,4 @@ namespace Avalonia.Rendering.Composition.Server { } } -} \ No newline at end of file +} diff --git a/src/Avalonia.Base/Rendering/Composition/Server/ServerObject.cs b/src/Avalonia.Base/Rendering/Composition/Server/ServerObject.cs index 93ea8e8dee..257d3b29a2 100644 --- a/src/Avalonia.Base/Rendering/Composition/Server/ServerObject.cs +++ b/src/Avalonia.Base/Rendering/Composition/Server/ServerObject.cs @@ -7,6 +7,8 @@ using Avalonia.Rendering.Composition.Expressions; using Avalonia.Rendering.Composition.Transport; using Avalonia.Utilities; +// Special license applies License.md + namespace Avalonia.Rendering.Composition.Server { /// @@ -177,4 +179,4 @@ namespace Avalonia.Rendering.Composition.Server ItselfLastChangedBy = batch.SequenceId; } } -} \ No newline at end of file +} diff --git a/src/Avalonia.Base/Rendering/Composition/Transport/Batch.cs b/src/Avalonia.Base/Rendering/Composition/Transport/Batch.cs index e69768d3bf..0cf1650ccf 100644 --- a/src/Avalonia.Base/Rendering/Composition/Transport/Batch.cs +++ b/src/Avalonia.Base/Rendering/Composition/Transport/Batch.cs @@ -4,6 +4,8 @@ using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; +// Special license applies License.md + namespace Avalonia.Rendering.Composition.Transport { /// @@ -36,4 +38,4 @@ namespace Avalonia.Rendering.Composition.Transport public Task Completed => _tcs.Task; } -} \ No newline at end of file +} diff --git a/src/Avalonia.Base/Rendering/Composition/Transport/BatchStream.cs b/src/Avalonia.Base/Rendering/Composition/Transport/BatchStream.cs index 6db480a966..8b68900994 100644 --- a/src/Avalonia.Base/Rendering/Composition/Transport/BatchStream.cs +++ b/src/Avalonia.Base/Rendering/Composition/Transport/BatchStream.cs @@ -5,6 +5,8 @@ using System.Runtime.CompilerServices; using Avalonia.Rendering.Composition.Animations; using Avalonia.Rendering.Composition.Server; +// Special license applies License.md + namespace Avalonia.Rendering.Composition.Transport; /// diff --git a/src/Avalonia.Base/Rendering/Composition/Transport/BatchStreamArrayPool.cs b/src/Avalonia.Base/Rendering/Composition/Transport/BatchStreamArrayPool.cs index b0a89c6f92..f24f449551 100644 --- a/src/Avalonia.Base/Rendering/Composition/Transport/BatchStreamArrayPool.cs +++ b/src/Avalonia.Base/Rendering/Composition/Transport/BatchStreamArrayPool.cs @@ -5,6 +5,8 @@ using System.Runtime.InteropServices; using Avalonia.Platform; using Avalonia.Threading; +// Special license applies License.md + namespace Avalonia.Rendering.Composition.Transport; /// @@ -153,4 +155,4 @@ internal sealed class BatchStreamMemoryPool : BatchStreamPoolBase protected override IntPtr CreateItem() => Marshal.AllocHGlobal(BufferSize); protected override void DestroyItem(IntPtr item) => Marshal.FreeHGlobal(item); -} \ No newline at end of file +} diff --git a/src/Avalonia.Base/Rendering/Composition/Transport/BatchStreamDebugMarker.cs b/src/Avalonia.Base/Rendering/Composition/Transport/BatchStreamDebugMarker.cs index 7d21b03f24..fed0f4d4aa 100644 --- a/src/Avalonia.Base/Rendering/Composition/Transport/BatchStreamDebugMarker.cs +++ b/src/Avalonia.Base/Rendering/Composition/Transport/BatchStreamDebugMarker.cs @@ -1,9 +1,11 @@ using System; +// Special license applies License.md + namespace Avalonia.Rendering.Composition.Transport; internal class BatchStreamDebugMarkers { public static object ObjectEndMarker = new object(); public static Guid ObjectEndMagic = Guid.NewGuid(); -} \ No newline at end of file +} diff --git a/src/Avalonia.Base/Rendering/Composition/Transport/ServerListProxyHelper.cs b/src/Avalonia.Base/Rendering/Composition/Transport/ServerListProxyHelper.cs index e295c3c2c8..603c7582a1 100644 --- a/src/Avalonia.Base/Rendering/Composition/Transport/ServerListProxyHelper.cs +++ b/src/Avalonia.Base/Rendering/Composition/Transport/ServerListProxyHelper.cs @@ -2,6 +2,8 @@ using System.Collections; using System.Collections.Generic; using Avalonia.Rendering.Composition.Server; +// Special license applies License.md + namespace Avalonia.Rendering.Composition.Transport { /// @@ -95,4 +97,4 @@ namespace Avalonia.Rendering.Composition.Transport _changed = false; } } -} \ No newline at end of file +} diff --git a/src/Avalonia.Base/Rendering/Composition/Visual.cs b/src/Avalonia.Base/Rendering/Composition/Visual.cs index 7ebbb0aa96..7356b7b9e8 100644 --- a/src/Avalonia.Base/Rendering/Composition/Visual.cs +++ b/src/Avalonia.Base/Rendering/Composition/Visual.cs @@ -3,6 +3,8 @@ using System.Numerics; using Avalonia.Media; using Avalonia.VisualTree; +// Special license applies License.md + namespace Avalonia.Rendering.Composition { /// @@ -53,4 +55,4 @@ namespace Avalonia.Rendering.Composition internal virtual bool HitTest(Point point, Func? filter) => true; } -} \ No newline at end of file +} diff --git a/src/Avalonia.Base/Rendering/Composition/VisualCollection.cs b/src/Avalonia.Base/Rendering/Composition/VisualCollection.cs index 60ebd9271c..6981dc39e3 100644 --- a/src/Avalonia.Base/Rendering/Composition/VisualCollection.cs +++ b/src/Avalonia.Base/Rendering/Composition/VisualCollection.cs @@ -1,6 +1,8 @@ using System; using Avalonia.Rendering.Composition.Server; +// Special license applies License.md + namespace Avalonia.Rendering.Composition { /// @@ -70,4 +72,4 @@ namespace Avalonia.Rendering.Composition item.Parent = item; } } -} \ No newline at end of file +} diff --git a/src/Avalonia.Base/Rendering/Composition/readme.md b/src/Avalonia.Base/Rendering/Composition/readme.md new file mode 100644 index 0000000000..6c238db191 --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/readme.md @@ -0,0 +1,3 @@ +Please note the composition renderer is not subject to the usual MIT license. + +Please contact us for more details and see [License.md](https://raw.githubusercontent.com/AvaloniaUI/Avalonia/master/src/Avalonia.Base/Rendering/Composition/License.md) diff --git a/src/Avalonia.Controls.ColorPicker/Themes/Default/Default.xaml b/src/Avalonia.Controls.ColorPicker/Themes/Default/Default.xaml index ebecd65cc3..db1fa3ee4e 100644 --- a/src/Avalonia.Controls.ColorPicker/Themes/Default/Default.xaml +++ b/src/Avalonia.Controls.ColorPicker/Themes/Default/Default.xaml @@ -37,4 +37,8 @@ + + + + diff --git a/src/Avalonia.Controls.ColorPicker/Themes/Fluent/ColorPicker.xaml b/src/Avalonia.Controls.ColorPicker/Themes/Fluent/ColorPicker.xaml index a4d5ff673f..907b00dfff 100644 --- a/src/Avalonia.Controls.ColorPicker/Themes/Fluent/ColorPicker.xaml +++ b/src/Avalonia.Controls.ColorPicker/Themes/Fluent/ColorPicker.xaml @@ -1,14 +1,13 @@ - + - - - 5,5,0,0 - + + 5,5,0,0 - + - + --> - + diff --git a/src/Avalonia.Controls.ColorPicker/Themes/Fluent/ColorPreviewer.xaml b/src/Avalonia.Controls.ColorPicker/Themes/Fluent/ColorPreviewer.xaml index 74f33d1258..1c4a44d081 100644 --- a/src/Avalonia.Controls.ColorPicker/Themes/Fluent/ColorPreviewer.xaml +++ b/src/Avalonia.Controls.ColorPicker/Themes/Fluent/ColorPreviewer.xaml @@ -1,15 +1,14 @@ - + - - - 80 - 40 - + + 80 + 40 - + - + diff --git a/src/Avalonia.Controls.ColorPicker/Themes/Fluent/ColorSlider.xaml b/src/Avalonia.Controls.ColorPicker/Themes/Fluent/ColorSlider.xaml index 162ac372de..eb67ada334 100644 --- a/src/Avalonia.Controls.ColorPicker/Themes/Fluent/ColorSlider.xaml +++ b/src/Avalonia.Controls.ColorPicker/Themes/Fluent/ColorSlider.xaml @@ -1,188 +1,190 @@ - + - + - + - + - - + + + + + + - - - - + + - - + - + diff --git a/src/Avalonia.Controls.ColorPicker/Themes/Fluent/ColorSpectrum.xaml b/src/Avalonia.Controls.ColorPicker/Themes/Fluent/ColorSpectrum.xaml index dba4ad19f5..f95721c881 100644 --- a/src/Avalonia.Controls.ColorPicker/Themes/Fluent/ColorSpectrum.xaml +++ b/src/Avalonia.Controls.ColorPicker/Themes/Fluent/ColorSpectrum.xaml @@ -1,9 +1,10 @@ - + - - - - + + + - - - + + + - - - - - + + + + + - - + + - - - + + + - + + + diff --git a/src/Avalonia.Controls.ColorPicker/Themes/Fluent/ColorView.xaml b/src/Avalonia.Controls.ColorPicker/Themes/Fluent/ColorView.xaml index e25e822f3f..993745b1e5 100644 --- a/src/Avalonia.Controls.ColorPicker/Themes/Fluent/ColorView.xaml +++ b/src/Avalonia.Controls.ColorPicker/Themes/Fluent/ColorView.xaml @@ -1,86 +1,85 @@ - + - - - - - - - 48 - 30 - 80 - - - M3 2C3.27614 2 3.5 2.22386 3.5 2.5V5.5C3.5 5.77614 3.72386 6 4 6H16C16.2761 6 16.5 5.77614 - 16.5 5.5V2.5C16.5 2.22386 16.7239 2 17 2C17.2761 2 17.5 2.22386 17.5 2.5V5.5C17.5 6.32843 - 16.8284 7 16 7H15.809L12.2236 14.1708C12.0615 14.4951 11.7914 14.7431 11.4695 - 14.8802C11.4905 15.0808 11.5 15.2891 11.5 15.5C11.5 16.0818 11.4278 16.6623 11.2268 - 17.1165C11.019 17.5862 10.6266 18 10 18C9.37343 18 8.98105 17.5862 8.77323 17.1165C8.57222 - 16.6623 8.5 16.0818 8.5 15.5C8.5 15.2891 8.50952 15.0808 8.53051 14.8802C8.20863 14.7431 - 7.93851 14.4951 7.77639 14.1708L4.19098 7H4C3.17157 7 2.5 6.32843 2.5 5.5V2.5C2.5 2.22386 - 2.72386 2 3 2ZM9.11803 14H10.882C11.0714 14 11.2445 13.893 11.3292 13.7236L14.691 - 7H5.30902L8.67082 13.7236C8.75552 13.893 8.92865 14 9.11803 14ZM9.52346 15C9.50787 15.1549 - 9.5 15.3225 9.5 15.5C9.5 16.0228 9.56841 16.4423 9.6877 16.7119C9.8002 16.9661 9.90782 17 - 10 17C10.0922 17 10.1998 16.9661 10.3123 16.7119C10.4316 16.4423 10.5 16.0228 10.5 - 15.5C10.5 15.3225 10.4921 15.1549 10.4765 15H9.52346Z - - - - M9.75003 6.5C10.1642 6.5 10.5 6.16421 10.5 5.75C10.5 5.33579 10.1642 5 9.75003 5C9.33582 - 5 9.00003 5.33579 9.00003 5.75C9.00003 6.16421 9.33582 6.5 9.75003 6.5ZM12.75 7.5C13.1642 - 7.5 13.5 7.16421 13.5 6.75C13.5 6.33579 13.1642 6 12.75 6C12.3358 6 12 6.33579 12 6.75C12 - 7.16421 12.3358 7.5 12.75 7.5ZM15.25 9C15.25 9.41421 14.9142 9.75 14.5 9.75C14.0858 9.75 - 13.75 9.41421 13.75 9C13.75 8.58579 14.0858 8.25 14.5 8.25C14.9142 8.25 15.25 8.58579 - 15.25 9ZM14.5 12.75C14.9142 12.75 15.25 12.4142 15.25 12C15.25 11.5858 14.9142 11.25 14.5 - 11.25C14.0858 11.25 13.75 11.5858 13.75 12C13.75 12.4142 14.0858 12.75 14.5 12.75ZM13.25 - 14C13.25 14.4142 12.9142 14.75 12.5 14.75C12.0858 14.75 11.75 14.4142 11.75 14C11.75 - 13.5858 12.0858 13.25 12.5 13.25C12.9142 13.25 13.25 13.5858 13.25 14ZM13.6972 - 2.99169C10.9426 1.57663 8.1432 1.7124 5.77007 3.16636C4.55909 3.9083 3.25331 5.46925 - 2.51605 7.05899C2.14542 7.85816 1.89915 8.70492 1.90238 9.49318C1.90566 10.2941 2.16983 - 11.0587 2.84039 11.6053C3.45058 12.1026 3.98165 12.353 4.49574 12.3784C5.01375 12.404 - 5.41804 12.1942 5.73429 12.0076C5.80382 11.9666 5.86891 11.927 5.93113 11.8892C6.17332 - 11.7421 6.37205 11.6214 6.62049 11.5426C6.90191 11.4534 7.2582 11.4205 7.77579 - 11.5787C7.96661 11.637 8.08161 11.7235 8.16212 11.8229C8.24792 11.9289 8.31662 12.0774 - 8.36788 12.2886C8.41955 12.5016 8.44767 12.7527 8.46868 13.0491C8.47651 13.1594 8.48379 - 13.2855 8.49142 13.4176C8.50252 13.6098 8.51437 13.8149 8.52974 14.0037C8.58435 14.6744 - 8.69971 15.4401 9.10362 16.1357C9.51764 16.8488 10.2047 17.439 11.307 17.8158C12.9093 - 18.3636 14.3731 17.9191 15.5126 17.0169C16.6391 16.125 17.4691 14.7761 17.8842 - 13.4272C19.1991 9.15377 17.6728 5.03394 13.6972 2.99169ZM6.29249 4.01905C8.35686 2.75426 - 10.7844 2.61959 13.2403 3.88119C16.7473 5.68275 18.1135 9.28161 16.9284 13.1332C16.5624 - 14.3227 15.8338 15.4871 14.8919 16.2329C13.963 16.9684 12.8486 17.286 11.6305 - 16.8696C10.7269 16.5607 10.2467 16.1129 9.96842 15.6336C9.68001 15.1369 9.57799 14.5556 - 9.52644 13.9225C9.51101 13.733 9.50132 13.5621 9.49147 13.3884C9.48399 13.2564 9.47642 - 13.1229 9.46618 12.9783C9.44424 12.669 9.41175 12.3499 9.33968 12.0529C9.26719 11.7541 - 9.14902 11.4527 8.93935 11.1937C8.72439 10.9282 8.43532 10.7346 8.06801 10.6223C7.36648 - 10.408 6.80266 10.4359 6.31839 10.5893C5.94331 10.7082 5.62016 10.9061 5.37179 - 11.0582C5.31992 11.0899 5.2713 11.1197 5.22616 11.1463C4.94094 11.3146 4.75357 11.39 - 4.54514 11.3796C4.33279 11.3691 4.00262 11.2625 3.47218 10.8301C3.0866 10.5158 2.90473 - 10.0668 2.90237 9.48908C2.89995 8.89865 3.08843 8.20165 3.42324 7.47971C4.09686 6.0272 - 5.28471 4.63649 6.29249 4.01905Z - - - - M14.95 5C14.7184 3.85888 13.7095 3 12.5 3C11.2905 3 10.2816 3.85888 10.05 5H2.5C2.22386 - 5 2 5.22386 2 5.5C2 5.77614 2.22386 6 2.5 6H10.05C10.2816 7.14112 11.2905 8 12.5 8C13.7297 - 8 14.752 7.11217 14.961 5.94254C14.9575 5.96177 14.9539 5.98093 14.95 6H17.5C17.7761 6 18 - 5.77614 18 5.5C18 5.22386 17.7761 5 17.5 5H14.95ZM12.5 7C11.6716 7 11 6.32843 11 5.5C11 - 4.67157 11.6716 4 12.5 4C13.3284 4 14 4.67157 14 5.5C14 6.32843 13.3284 7 12.5 7ZM9.94999 - 14C9.71836 12.8589 8.70948 12 7.5 12C6.29052 12 5.28164 12.8589 5.05001 14H2.5C2.22386 - 14 2 14.2239 2 14.5C2 14.7761 2.22386 15 2.5 15H5.05001C5.28164 16.1411 6.29052 17 7.5 - 17C8.70948 17 9.71836 16.1411 9.94999 15H17.5C17.7761 15 18 14.7761 18 14.5C18 14.2239 - 17.7761 14 17.5 14H9.94999ZM7.5 16C6.67157 16 6 15.3284 6 14.5C6 13.6716 6.67157 13 7.5 - 13C8.32843 13 9 13.6716 9 14.5C9 15.3284 8.32843 16 7.5 16Z - - + + + + + + 48 + 30 + 80 + + + M3 2C3.27614 2 3.5 2.22386 3.5 2.5V5.5C3.5 5.77614 3.72386 6 4 6H16C16.2761 6 16.5 5.77614 + 16.5 5.5V2.5C16.5 2.22386 16.7239 2 17 2C17.2761 2 17.5 2.22386 17.5 2.5V5.5C17.5 6.32843 + 16.8284 7 16 7H15.809L12.2236 14.1708C12.0615 14.4951 11.7914 14.7431 11.4695 + 14.8802C11.4905 15.0808 11.5 15.2891 11.5 15.5C11.5 16.0818 11.4278 16.6623 11.2268 + 17.1165C11.019 17.5862 10.6266 18 10 18C9.37343 18 8.98105 17.5862 8.77323 17.1165C8.57222 + 16.6623 8.5 16.0818 8.5 15.5C8.5 15.2891 8.50952 15.0808 8.53051 14.8802C8.20863 14.7431 + 7.93851 14.4951 7.77639 14.1708L4.19098 7H4C3.17157 7 2.5 6.32843 2.5 5.5V2.5C2.5 2.22386 + 2.72386 2 3 2ZM9.11803 14H10.882C11.0714 14 11.2445 13.893 11.3292 13.7236L14.691 + 7H5.30902L8.67082 13.7236C8.75552 13.893 8.92865 14 9.11803 14ZM9.52346 15C9.50787 15.1549 + 9.5 15.3225 9.5 15.5C9.5 16.0228 9.56841 16.4423 9.6877 16.7119C9.8002 16.9661 9.90782 17 + 10 17C10.0922 17 10.1998 16.9661 10.3123 16.7119C10.4316 16.4423 10.5 16.0228 10.5 + 15.5C10.5 15.3225 10.4921 15.1549 10.4765 15H9.52346Z + + + + M9.75003 6.5C10.1642 6.5 10.5 6.16421 10.5 5.75C10.5 5.33579 10.1642 5 9.75003 5C9.33582 + 5 9.00003 5.33579 9.00003 5.75C9.00003 6.16421 9.33582 6.5 9.75003 6.5ZM12.75 7.5C13.1642 + 7.5 13.5 7.16421 13.5 6.75C13.5 6.33579 13.1642 6 12.75 6C12.3358 6 12 6.33579 12 6.75C12 + 7.16421 12.3358 7.5 12.75 7.5ZM15.25 9C15.25 9.41421 14.9142 9.75 14.5 9.75C14.0858 9.75 + 13.75 9.41421 13.75 9C13.75 8.58579 14.0858 8.25 14.5 8.25C14.9142 8.25 15.25 8.58579 + 15.25 9ZM14.5 12.75C14.9142 12.75 15.25 12.4142 15.25 12C15.25 11.5858 14.9142 11.25 14.5 + 11.25C14.0858 11.25 13.75 11.5858 13.75 12C13.75 12.4142 14.0858 12.75 14.5 12.75ZM13.25 + 14C13.25 14.4142 12.9142 14.75 12.5 14.75C12.0858 14.75 11.75 14.4142 11.75 14C11.75 + 13.5858 12.0858 13.25 12.5 13.25C12.9142 13.25 13.25 13.5858 13.25 14ZM13.6972 + 2.99169C10.9426 1.57663 8.1432 1.7124 5.77007 3.16636C4.55909 3.9083 3.25331 5.46925 + 2.51605 7.05899C2.14542 7.85816 1.89915 8.70492 1.90238 9.49318C1.90566 10.2941 2.16983 + 11.0587 2.84039 11.6053C3.45058 12.1026 3.98165 12.353 4.49574 12.3784C5.01375 12.404 + 5.41804 12.1942 5.73429 12.0076C5.80382 11.9666 5.86891 11.927 5.93113 11.8892C6.17332 + 11.7421 6.37205 11.6214 6.62049 11.5426C6.90191 11.4534 7.2582 11.4205 7.77579 + 11.5787C7.96661 11.637 8.08161 11.7235 8.16212 11.8229C8.24792 11.9289 8.31662 12.0774 + 8.36788 12.2886C8.41955 12.5016 8.44767 12.7527 8.46868 13.0491C8.47651 13.1594 8.48379 + 13.2855 8.49142 13.4176C8.50252 13.6098 8.51437 13.8149 8.52974 14.0037C8.58435 14.6744 + 8.69971 15.4401 9.10362 16.1357C9.51764 16.8488 10.2047 17.439 11.307 17.8158C12.9093 + 18.3636 14.3731 17.9191 15.5126 17.0169C16.6391 16.125 17.4691 14.7761 17.8842 + 13.4272C19.1991 9.15377 17.6728 5.03394 13.6972 2.99169ZM6.29249 4.01905C8.35686 2.75426 + 10.7844 2.61959 13.2403 3.88119C16.7473 5.68275 18.1135 9.28161 16.9284 13.1332C16.5624 + 14.3227 15.8338 15.4871 14.8919 16.2329C13.963 16.9684 12.8486 17.286 11.6305 + 16.8696C10.7269 16.5607 10.2467 16.1129 9.96842 15.6336C9.68001 15.1369 9.57799 14.5556 + 9.52644 13.9225C9.51101 13.733 9.50132 13.5621 9.49147 13.3884C9.48399 13.2564 9.47642 + 13.1229 9.46618 12.9783C9.44424 12.669 9.41175 12.3499 9.33968 12.0529C9.26719 11.7541 + 9.14902 11.4527 8.93935 11.1937C8.72439 10.9282 8.43532 10.7346 8.06801 10.6223C7.36648 + 10.408 6.80266 10.4359 6.31839 10.5893C5.94331 10.7082 5.62016 10.9061 5.37179 + 11.0582C5.31992 11.0899 5.2713 11.1197 5.22616 11.1463C4.94094 11.3146 4.75357 11.39 + 4.54514 11.3796C4.33279 11.3691 4.00262 11.2625 3.47218 10.8301C3.0866 10.5158 2.90473 + 10.0668 2.90237 9.48908C2.89995 8.89865 3.08843 8.20165 3.42324 7.47971C4.09686 6.0272 + 5.28471 4.63649 6.29249 4.01905Z + + + + M14.95 5C14.7184 3.85888 13.7095 3 12.5 3C11.2905 3 10.2816 3.85888 10.05 5H2.5C2.22386 + 5 2 5.22386 2 5.5C2 5.77614 2.22386 6 2.5 6H10.05C10.2816 7.14112 11.2905 8 12.5 8C13.7297 + 8 14.752 7.11217 14.961 5.94254C14.9575 5.96177 14.9539 5.98093 14.95 6H17.5C17.7761 6 18 + 5.77614 18 5.5C18 5.22386 17.7761 5 17.5 5H14.95ZM12.5 7C11.6716 7 11 6.32843 11 5.5C11 + 4.67157 11.6716 4 12.5 4C13.3284 4 14 4.67157 14 5.5C14 6.32843 13.3284 7 12.5 7ZM9.94999 + 14C9.71836 12.8589 8.70948 12 7.5 12C6.29052 12 5.28164 12.8589 5.05001 14H2.5C2.22386 + 14 2 14.2239 2 14.5C2 14.7761 2.22386 15 2.5 15H5.05001C5.28164 16.1411 6.29052 17 7.5 + 17C8.70948 17 9.71836 16.1411 9.94999 15H17.5C17.7761 15 18 14.7761 18 14.5C18 14.2239 + 17.7761 14 17.5 14H9.94999ZM7.5 16C6.67157 16 6 15.3284 6 14.5C6 13.6716 6.67157 13 7.5 + 13C8.32843 13 9 13.6716 9 14.5C9 15.3284 8.32843 16 7.5 16Z + - + - + diff --git a/src/Avalonia.Controls.ColorPicker/Themes/Fluent/Fluent.xaml b/src/Avalonia.Controls.ColorPicker/Themes/Fluent/Fluent.xaml index 186b6de9bc..a5a94a2322 100644 --- a/src/Avalonia.Controls.ColorPicker/Themes/Fluent/Fluent.xaml +++ b/src/Avalonia.Controls.ColorPicker/Themes/Fluent/Fluent.xaml @@ -3,42 +3,48 @@ xmlns:converters="using:Avalonia.Controls.Converters"> - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - + - - - + + + + + + + + + + + diff --git a/src/Avalonia.Controls.DataGrid/DataGridCell.cs b/src/Avalonia.Controls.DataGrid/DataGridCell.cs index f9685b3682..dd802678d4 100644 --- a/src/Avalonia.Controls.DataGrid/DataGridCell.cs +++ b/src/Avalonia.Controls.DataGrid/DataGridCell.cs @@ -14,7 +14,7 @@ namespace Avalonia.Controls /// Represents an individual cell. /// [TemplatePart(DATAGRIDCELL_elementRightGridLine, typeof(Rectangle))] - [PseudoClasses(":selected", ":current", ":edited", ":invalid")] + [PseudoClasses(":selected", ":current", ":edited", ":invalid", ":focus")] public class DataGridCell : ContentControl { private const string DATAGRIDCELL_elementRightGridLine = "PART_RightGridLine"; @@ -216,6 +216,8 @@ namespace Avalonia.Controls PseudoClasses.Set(":edited", IsEdited); PseudoClasses.Set(":invalid", !IsValid); + + PseudoClasses.Set(":focus", OwningGrid.IsFocused && IsCurrent); } // Makes sure the right gridline has the proper stroke and visibility. If lastVisibleColumn is specified, the @@ -245,9 +247,15 @@ namespace Avalonia.Controls if (column == null) { Classes.Clear(); + ClearValue(ThemeProperty); } else { + if (Theme != column.CellTheme) + { + Theme = column.CellTheme; + } + Classes.Replace(column.CellStyleClasses); } } diff --git a/src/Avalonia.Controls.DataGrid/DataGridColumn.cs b/src/Avalonia.Controls.DataGrid/DataGridColumn.cs index e57d6bbde2..fbdb979e24 100644 --- a/src/Avalonia.Controls.DataGrid/DataGridColumn.cs +++ b/src/Avalonia.Controls.DataGrid/DataGridColumn.cs @@ -16,6 +16,7 @@ using Avalonia.Controls.Templates; using Avalonia.Controls.Utils; using Avalonia.Layout; using Avalonia.Markup.Xaml.MarkupExtensions; +using Avalonia.Styling; namespace Avalonia.Controls { @@ -36,6 +37,7 @@ namespace Avalonia.Controls private IControl _editingElement; private ICellEditBinding _editBinding; private IBinding _clipboardContentBinding; + private ControlTheme _cellTheme; private readonly Classes _cellStyleClasses = new Classes(); /// @@ -399,6 +401,24 @@ namespace Avalonia.Controls } } } + + /// + /// Backing field for CellTheme property. + /// + public static readonly DirectProperty CellThemeProperty = + AvaloniaProperty.RegisterDirect( + nameof(CellTheme), + o => o.CellTheme, + (o, v) => o.CellTheme = v); + + /// + /// Gets or sets the cell theme. + /// + public ControlTheme CellTheme + { + get { return _cellTheme; } + set { SetAndRaise(CellThemeProperty, ref _cellTheme, value); } + } /// /// Backing field for Header property diff --git a/src/Avalonia.Controls.DataGrid/DataGridRowGroupHeader.cs b/src/Avalonia.Controls.DataGrid/DataGridRowGroupHeader.cs index 9f37e8a6aa..d63c738133 100644 --- a/src/Avalonia.Controls.DataGrid/DataGridRowGroupHeader.cs +++ b/src/Avalonia.Controls.DataGrid/DataGridRowGroupHeader.cs @@ -113,7 +113,6 @@ namespace Avalonia.Controls /// public DataGridRowGroupHeader() { - //DefaultStyleKey = typeof(DataGridRowGroupHeader); AddHandler(InputElement.PointerPressedEvent, (s, e) => DataGridRowGroupHeader_PointerPressed(e), handledEventsToo: true); } diff --git a/src/Avalonia.Controls.DataGrid/DataGridTextColumn.cs b/src/Avalonia.Controls.DataGrid/DataGridTextColumn.cs index bb8637cda2..79247aa87f 100644 --- a/src/Avalonia.Controls.DataGrid/DataGridTextColumn.cs +++ b/src/Avalonia.Controls.DataGrid/DataGridTextColumn.cs @@ -11,6 +11,7 @@ using System.ComponentModel; using Avalonia.Layout; using Avalonia.Markup.Xaml.MarkupExtensions; using Avalonia.Controls.Documents; +using Avalonia.Styling; namespace Avalonia.Controls { @@ -19,12 +20,20 @@ namespace Avalonia.Controls /// public class DataGridTextColumn : DataGridBoundColumn { + private readonly Lazy _cellTextBoxTheme; + private readonly Lazy _cellTextBlockTheme; + /// /// Initializes a new instance of the class. /// public DataGridTextColumn() { BindingTarget = TextBox.TextProperty; + + _cellTextBoxTheme = new Lazy(() => + OwningGrid.TryFindResource("DataGridCellTextBoxTheme", out var theme) ? (ControlTheme)theme : null); + _cellTextBlockTheme = new Lazy(() => + OwningGrid.TryFindResource("DataGridCellTextBlockTheme", out var theme) ? (ControlTheme)theme : null); } /// @@ -156,16 +165,19 @@ namespace Avalonia.Controls protected override IControl GenerateEditingElementDirect(DataGridCell cell, object dataItem) { var textBox = new TextBox - { - VerticalAlignment = VerticalAlignment.Stretch, - Background = new SolidColorBrush(Colors.Transparent) + { + Name = "CellTextBox" }; + if (_cellTextBoxTheme.Value is { } theme) + { + textBox.Theme = theme; + } SyncProperties(textBox); return textBox; } - + /// /// Gets a read-only element that is bound to the column's property value. /// @@ -174,10 +186,14 @@ namespace Avalonia.Controls /// A new, read-only element that is bound to the column's property value. protected override IControl GenerateElement(DataGridCell cell, object dataItem) { - TextBlock textBlockElement = new TextBlock + var textBlockElement = new TextBlock { Name = "CellTextBlock" }; + if (_cellTextBlockTheme.Value is { } theme) + { + textBlockElement.Theme = theme; + } SyncProperties(textBlockElement); @@ -227,7 +243,7 @@ namespace Avalonia.Controls { if (element == null) { - throw new ArgumentNullException("element"); + throw new ArgumentNullException(nameof(element)); } if (element is AvaloniaObject content) diff --git a/src/Avalonia.Controls.DataGrid/Themes/Fluent.xaml b/src/Avalonia.Controls.DataGrid/Themes/Fluent.xaml index fb032fec3e..a80cc2173c 100644 --- a/src/Avalonia.Controls.DataGrid/Themes/Fluent.xaml +++ b/src/Avalonia.Controls.DataGrid/Themes/Fluent.xaml @@ -1,8 +1,8 @@ - + 0.6 0.8 - 12,0,12,0 M1875 1011l-787 787v-1798h-128v1798l-787 -787l-90 90l941 941l941 -941z M1965 947l-941 -941l-941 941l90 90l787 -787v1798h128v-1798l787 787z @@ -13,10 +13,12 @@ - + - + @@ -27,14 +29,12 @@ - + - - - - + @@ -44,157 +44,425 @@ Opacity="0.4" Color="{DynamicResource SystemBaseMediumLowColor}" /> - + - - + + + + + + + + + + + + + + + - + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Fill="{TemplateBinding SeparatorBrush}" + IsVisible="{TemplateBinding AreSeparatorsVisible}" /> - + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + diff --git a/src/Avalonia.Controls/Platform/PlatformManager.cs b/src/Avalonia.Controls/Platform/PlatformManager.cs index 92f6f1cb52..de7708e869 100644 --- a/src/Avalonia.Controls/Platform/PlatformManager.cs +++ b/src/Avalonia.Controls/Platform/PlatformManager.cs @@ -20,17 +20,8 @@ namespace Avalonia.Controls.Platform { } - public static ITrayIconImpl? CreateTrayIcon() - { - var platform = AvaloniaLocator.Current.GetService(); - - if (platform == null) - { - throw new Exception("Could not CreateTrayIcon(): IWindowingPlatform is not registered."); - } - - return s_designerMode ? null : platform.CreateTrayIcon(); - } + public static ITrayIconImpl? CreateTrayIcon() => + s_designerMode ? null : AvaloniaLocator.Current.GetService()?.CreateTrayIcon(); public static IWindowImpl CreateWindow() diff --git a/src/Linux/Avalonia.LinuxFramebuffer/DrmOutputOptions.cs b/src/Linux/Avalonia.LinuxFramebuffer/DrmOutputOptions.cs new file mode 100644 index 0000000000..e92ad02c7a --- /dev/null +++ b/src/Linux/Avalonia.LinuxFramebuffer/DrmOutputOptions.cs @@ -0,0 +1,27 @@ +using Avalonia.LinuxFramebuffer.Output; +using Avalonia.Media; +using JetBrains.Annotations; + +namespace Avalonia.LinuxFramebuffer +{ + public class DrmOutputOptions + { + /// + /// Scaling factor. + /// Default: 1.0 + /// + public double Scaling { get; set; } = 1.0; + + /// + /// If true an two cycle buffer swapping is processed at init. + /// Default: True + /// + public bool EnableInitialBufferSwapping { get; set; } = true; + + /// + /// Color for + /// Default: R0 G0 B0 A0 + /// + public Color InitialBufferSwappingColor { get; set; } = new Color(0, 0, 0, 0); + } +} diff --git a/src/Linux/Avalonia.LinuxFramebuffer/LinuxFramebufferPlatform.cs b/src/Linux/Avalonia.LinuxFramebuffer/LinuxFramebufferPlatform.cs index 4add4c423b..a642766809 100644 --- a/src/Linux/Avalonia.LinuxFramebuffer/LinuxFramebufferPlatform.cs +++ b/src/Linux/Avalonia.LinuxFramebuffer/LinuxFramebufferPlatform.cs @@ -140,6 +140,8 @@ public static class LinuxFramebufferPlatformExtensions public static int StartLinuxDrm(this T builder, string[] args, string card = null, double scaling = 1) where T : AppBuilderBase, new() => StartLinuxDirect(builder, args, new DrmOutput(card) {Scaling = scaling}); + public static int StartLinuxDrm(this T builder, string[] args, string card = null, bool connectorsForceProbe = false, [CanBeNull] DrmOutputOptions options = null) + where T : AppBuilderBase, new() => StartLinuxDirect(builder, args, new DrmOutput(card, connectorsForceProbe, options)); public static int StartLinuxDirect(this T builder, string[] args, IOutputBackend backend) where T : AppBuilderBase, new() diff --git a/src/Linux/Avalonia.LinuxFramebuffer/Output/Drm.cs b/src/Linux/Avalonia.LinuxFramebuffer/Output/Drm.cs index 9c476b1b63..04bc2c1f67 100644 --- a/src/Linux/Avalonia.LinuxFramebuffer/Output/Drm.cs +++ b/src/Linux/Avalonia.LinuxFramebuffer/Output/Drm.cs @@ -162,6 +162,8 @@ namespace Avalonia.LinuxFramebuffer.Output [DllImport(libdrm, SetLastError = true)] public static extern drmModeConnector* drmModeGetConnector(int fd, uint connector); [DllImport(libdrm, SetLastError = true)] + public static extern drmModeConnector* drmModeGetConnectorCurrent(int fd, uint connector); + [DllImport(libdrm, SetLastError = true)] public static extern void drmModeFreeConnector(drmModeConnector* res); [DllImport(libdrm, SetLastError = true)] diff --git a/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmBindings.cs b/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmBindings.cs index de281245f1..070e1a95bc 100644 --- a/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmBindings.cs +++ b/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmBindings.cs @@ -84,7 +84,7 @@ namespace Avalonia.LinuxFramebuffer.Output { public List Connectors { get; }= new List(); internal Dictionary Encoders { get; } = new Dictionary(); - public DrmResources(int fd) + public DrmResources(int fd, bool connectorsForceProbe = false) { var res = drmModeGetResources(fd); if (res == null) @@ -107,7 +107,7 @@ namespace Avalonia.LinuxFramebuffer.Output for (var c = 0; c < res->count_connectors; c++) { - var conn = drmModeGetConnector(fd, res->connectors[c]); + var conn = connectorsForceProbe ? drmModeGetConnector(fd, res->connectors[c]) : drmModeGetConnectorCurrent(fd, res->connectors[c]); Connectors.Add(new DrmConnector(conn)); drmModeFreeConnector(conn); } @@ -168,7 +168,7 @@ namespace Avalonia.LinuxFramebuffer.Output } } - public DrmResources GetResources() => new DrmResources(Fd); + public DrmResources GetResources(bool connectorsForceProbe = false) => new DrmResources(Fd, connectorsForceProbe); public void Dispose() { close(Fd); diff --git a/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmOutput.cs b/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmOutput.cs index 99c4b62716..ce210019c0 100644 --- a/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmOutput.cs +++ b/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmOutput.cs @@ -7,6 +7,7 @@ using Avalonia.OpenGL; using Avalonia.OpenGL.Egl; using Avalonia.OpenGL.Surfaces; using Avalonia.Platform.Interop; +using JetBrains.Annotations; using static Avalonia.LinuxFramebuffer.NativeUnsafeMethods; using static Avalonia.LinuxFramebuffer.Output.LibDrm; using static Avalonia.LinuxFramebuffer.Output.LibDrm.GbmColorFormats; @@ -15,20 +16,35 @@ namespace Avalonia.LinuxFramebuffer.Output { public unsafe class DrmOutput : IGlOutputBackend, IGlPlatformSurface { + private DrmOutputOptions _outputOptions = new(); private DrmCard _card; public PixelSize PixelSize => _mode.Resolution; - public double Scaling { get; set; } + + public double Scaling + { + get => _outputOptions.Scaling; + set => _outputOptions.Scaling = value; + } public IGlContext PrimaryContext => _deferredContext; private EglPlatformOpenGlInterface _platformGl; public IPlatformOpenGlInterface PlatformOpenGlInterface => _platformGl; - public DrmOutput(string path = null) + public DrmOutput(DrmCard card, DrmResources resources, DrmConnector connector, DrmModeInfo modeInfo, + DrmOutputOptions? options = null) { + if(options != null) + _outputOptions = options; + Init(card, resources, connector, modeInfo); + } + public DrmOutput(string path = null, bool connectorsForceProbe = false, [CanBeNull] DrmOutputOptions options = null) + { + if(options != null) + _outputOptions = options; + var card = new DrmCard(path); - var resources = card.GetResources(); - + var resources = card.GetResources(connectorsForceProbe); var connector = resources.Connectors.FirstOrDefault(x => x.Connection == DrmModeConnection.DRM_MODE_CONNECTED); @@ -142,9 +158,14 @@ namespace Avalonia.LinuxFramebuffer.Output _deferredContext = _platformGl.PrimaryEglContext; + var initialBufferSwappingColorR = _outputOptions.InitialBufferSwappingColor.R / 255.0f; + var initialBufferSwappingColorG = _outputOptions.InitialBufferSwappingColor.G / 255.0f; + var initialBufferSwappingColorB = _outputOptions.InitialBufferSwappingColor.B / 255.0f; + var initialBufferSwappingColorA = _outputOptions.InitialBufferSwappingColor.A / 255.0f; using (_deferredContext.MakeCurrent(_eglSurface)) { - _deferredContext.GlInterface.ClearColor(0, 0, 0, 0); + _deferredContext.GlInterface.ClearColor(initialBufferSwappingColorR, initialBufferSwappingColorG, + initialBufferSwappingColorB, initialBufferSwappingColorA); _deferredContext.GlInterface.Clear(GlConsts.GL_COLOR_BUFFER_BIT | GlConsts.GL_STENCIL_BUFFER_BIT); _eglSurface.SwapBuffers(); } @@ -162,13 +183,17 @@ namespace Avalonia.LinuxFramebuffer.Output _mode = mode; _currentBo = bo; - // Go trough two cycles of buffer swapping (there are render artifacts otherwise) - for(var c=0;c<2;c++) - using (CreateGlRenderTarget().BeginDraw()) - { - _deferredContext.GlInterface.ClearColor(0, 0, 0, 0); - _deferredContext.GlInterface.Clear(GlConsts.GL_COLOR_BUFFER_BIT | GlConsts.GL_STENCIL_BUFFER_BIT); - } + if (_outputOptions.EnableInitialBufferSwapping) + { + //Go trough two cycles of buffer swapping (there are render artifacts otherwise) + for(var c=0;c<2;c++) + using (CreateGlRenderTarget().BeginDraw()) + { + _deferredContext.GlInterface.ClearColor(initialBufferSwappingColorR, initialBufferSwappingColorG, + initialBufferSwappingColorB, initialBufferSwappingColorA); + _deferredContext.GlInterface.Clear(GlConsts.GL_COLOR_BUFFER_BIT | GlConsts.GL_STENCIL_BUFFER_BIT); + } + } } diff --git a/src/Skia/Avalonia.Skia/ImmutableBitmap.cs b/src/Skia/Avalonia.Skia/ImmutableBitmap.cs index 5628ae177c..a80f406989 100644 --- a/src/Skia/Avalonia.Skia/ImmutableBitmap.cs +++ b/src/Skia/Avalonia.Skia/ImmutableBitmap.cs @@ -57,7 +57,8 @@ namespace Avalonia.Skia public ImmutableBitmap(Stream stream, int decodeSize, bool horizontal, BitmapInterpolationMode interpolationMode) { using (var skStream = new SKManagedStream(stream)) - using (var codec = SKCodec.Create(skStream)) + using (var skData = SKData.Create(skStream)) + using (var codec = SKCodec.Create(skData)) { var info = codec.Info; diff --git a/src/Skia/Avalonia.Skia/WriteableBitmapImpl.cs b/src/Skia/Avalonia.Skia/WriteableBitmapImpl.cs index 506edf0627..80bfcc5973 100644 --- a/src/Skia/Avalonia.Skia/WriteableBitmapImpl.cs +++ b/src/Skia/Avalonia.Skia/WriteableBitmapImpl.cs @@ -4,7 +4,6 @@ using System.Threading; using Avalonia.Media.Imaging; using Avalonia.Platform; using Avalonia.Skia.Helpers; -using Avalonia.Media.Imaging; using SkiaSharp; namespace Avalonia.Skia @@ -25,8 +24,9 @@ namespace Avalonia.Skia public WriteableBitmapImpl(Stream stream) { using (var skiaStream = new SKManagedStream(stream)) + using (var skData = SKData.Create(skiaStream)) { - _bitmap = SKBitmap.Decode(skiaStream); + _bitmap = SKBitmap.Decode(skData); if (_bitmap == null) { @@ -41,7 +41,8 @@ namespace Avalonia.Skia public WriteableBitmapImpl(Stream stream, int decodeSize, bool horizontal, BitmapInterpolationMode interpolationMode) { using (var skStream = new SKManagedStream(stream)) - using (var codec = SKCodec.Create(skStream)) + using (var skData = SKData.Create(skStream)) + using (var codec = SKCodec.Create(skData)) { var info = codec.Info; diff --git a/src/Windows/Avalonia.Win32/WinRT/Composition/WinUICompositorConnection.cs b/src/Windows/Avalonia.Win32/WinRT/Composition/WinUICompositorConnection.cs index 5334b90d62..84c3cc5c51 100644 --- a/src/Windows/Avalonia.Win32/WinRT/Composition/WinUICompositorConnection.cs +++ b/src/Windows/Avalonia.Win32/WinRT/Composition/WinUICompositorConnection.cs @@ -120,16 +120,14 @@ namespace Avalonia.Win32.WinRT.Composition private void RunLoop() { + using (var act = _compositor5.RequestCommitAsync()) + act.SetCompleted(new RunLoopHandler(this)); + + while (true) { - var st = Stopwatch.StartNew(); - using (var act = _compositor5.RequestCommitAsync()) - act.SetCompleted(new RunLoopHandler(this)); - while (true) - { - UnmanagedMethods.GetMessage(out var msg, IntPtr.Zero, 0, 0); - lock (_pumpLock) - UnmanagedMethods.DispatchMessage(ref msg); - } + UnmanagedMethods.GetMessage(out var msg, IntPtr.Zero, 0, 0); + lock (_pumpLock) + UnmanagedMethods.DispatchMessage(ref msg); } } diff --git a/src/tools/DevGenerators/CompositionGenerator/Generator.KeyFrameAnimation.cs b/src/tools/DevGenerators/CompositionGenerator/Generator.KeyFrameAnimation.cs index 7ad40f68e4..9455f5fac2 100644 --- a/src/tools/DevGenerators/CompositionGenerator/Generator.KeyFrameAnimation.cs +++ b/src/tools/DevGenerators/CompositionGenerator/Generator.KeyFrameAnimation.cs @@ -8,6 +8,8 @@ namespace Avalonia.SourceGenerator.CompositionGenerator using Avalonia.Rendering.Composition.Animations; using Avalonia.Rendering.Composition.Expressions; +// Special license applies License.md + namespace Avalonia.Rendering.Composition {{ "; @@ -56,4 +58,4 @@ namespace Avalonia.Rendering.Composition _output.AddSource("CompositionAnimations.cs", code); } } -} \ No newline at end of file +} diff --git a/tests/Avalonia.IntegrationTests.Appium/MenuTests.cs b/tests/Avalonia.IntegrationTests.Appium/MenuTests.cs index d1d231466f..3f1fe7de12 100644 --- a/tests/Avalonia.IntegrationTests.Appium/MenuTests.cs +++ b/tests/Avalonia.IntegrationTests.Appium/MenuTests.cs @@ -60,6 +60,8 @@ namespace Avalonia.IntegrationTests.Appium [PlatformFact(TestPlatforms.Windows)] public void Select_Child_With_Alt_Arrow_Keys() { + MovePointerOutOfTheWay(); + new Actions(_session) .KeyDown(Keys.Alt).KeyUp(Keys.Alt) .SendKeys(Keys.Down + Keys.Enter) @@ -72,6 +74,8 @@ namespace Avalonia.IntegrationTests.Appium [PlatformFact(TestPlatforms.Windows)] public void Select_Grandchild_With_Alt_Arrow_Keys() { + MovePointerOutOfTheWay(); + new Actions(_session) .KeyDown(Keys.Alt).KeyUp(Keys.Alt) .SendKeys(Keys.Down + Keys.Down + Keys.Right + Keys.Enter) @@ -84,6 +88,8 @@ namespace Avalonia.IntegrationTests.Appium [PlatformFact(TestPlatforms.Windows)] public void Select_Child_With_Alt_Access_Keys() { + MovePointerOutOfTheWay(); + new Actions(_session) .KeyDown(Keys.Alt).KeyUp(Keys.Alt) .SendKeys("rc") @@ -96,6 +102,8 @@ namespace Avalonia.IntegrationTests.Appium [PlatformFact(TestPlatforms.Windows)] public void Select_Grandchild_With_Alt_Access_Keys() { + MovePointerOutOfTheWay(); + new Actions(_session) .KeyDown(Keys.Alt).KeyUp(Keys.Alt) .SendKeys("rhg") @@ -111,6 +119,8 @@ namespace Avalonia.IntegrationTests.Appium var rootMenuItem = _session.FindElementByAccessibilityId("RootMenuItem"); rootMenuItem.SendClick(); + MovePointerOutOfTheWay(); + new Actions(_session) .SendKeys(Keys.Down + Keys.Enter) .Perform(); @@ -125,6 +135,8 @@ namespace Avalonia.IntegrationTests.Appium var rootMenuItem = _session.FindElementByAccessibilityId("RootMenuItem"); rootMenuItem.SendClick(); + MovePointerOutOfTheWay(); + new Actions(_session) .SendKeys(Keys.Down + Keys.Down + Keys.Right + Keys.Enter) .Perform(); @@ -159,5 +171,15 @@ namespace Avalonia.IntegrationTests.Appium Assert.True(textBox.GetIsFocused()); } + + private void MovePointerOutOfTheWay() + { + // Move the pointer to the menu tab item so that it's not over the menu in preparation + // for key press tests. This prevents the mouse accidentially selecting the wrong item + // by hovering. + var tabs = _session.FindElementByAccessibilityId("MainTabs"); + var tab = tabs.FindElementByName("Menu"); + tab.MovePointerOver(); + } } }