Browse Source
remove some un-used code (#19146)
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
pull/19167/head
Simon Cropp
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with
0 additions and
99 deletions
-
src/Avalonia.X11/X11Window.cs
-
src/Headless/Avalonia.Headless/AvaloniaHeadlessPlatform.cs
-
src/Headless/Avalonia.Headless/HeadlessPlatformRenderInterface.cs
-
src/Headless/Avalonia.Headless/HeadlessWindowImpl.cs
-
src/Skia/Avalonia.Skia/DrawingContextImpl.cs
-
src/tools/Avalonia.Generators/NameGenerator/Options.cs
-
src/tools/DevGenerators/CompositionGenerator/Generator.Utils.cs
-
src/tools/DevGenerators/CompositionGenerator/Generator.cs
|
|
|
@ -948,11 +948,6 @@ namespace Avalonia.X11 |
|
|
|
XSyncSetCounter(_x11.Display, _xSyncCounter, _xSyncValue); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public void Invalidate(Rect rect) |
|
|
|
{ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public IInputRoot InputRoot |
|
|
|
=> _inputRoot ?? throw new InvalidOperationException($"{nameof(SetInputRoot)} must have been called"); |
|
|
|
|
|
|
|
@ -62,8 +62,6 @@ namespace Avalonia.Headless |
|
|
|
|
|
|
|
public IWindowImpl CreateEmbeddableWindow() => throw new PlatformNotSupportedException(); |
|
|
|
|
|
|
|
public IPopupImpl CreatePopup() => new HeadlessWindowImpl(true, _frameBufferFormat); |
|
|
|
|
|
|
|
public ITrayIconImpl? CreateTrayIcon() => null; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -23,8 +23,6 @@ namespace Avalonia.Headless |
|
|
|
.Bind<ITextShaperImpl>().ToConstant(new HeadlessTextShaperStub()); |
|
|
|
} |
|
|
|
|
|
|
|
public IEnumerable<string> InstalledFontNames { get; } = new[] { "Tahoma" }; |
|
|
|
|
|
|
|
public IPlatformRenderInterfaceContext CreateBackendContext(IPlatformGraphicsContext? graphicsContext) => this; |
|
|
|
|
|
|
|
public bool SupportsIndividualRoundRects => false; |
|
|
|
@ -452,8 +450,6 @@ namespace Avalonia.Headless |
|
|
|
|
|
|
|
public Matrix Transform { get; set; } |
|
|
|
|
|
|
|
public RenderOptions RenderOptions { get; set; } |
|
|
|
|
|
|
|
public void Clear(Color color) |
|
|
|
{ |
|
|
|
|
|
|
|
@ -517,16 +513,6 @@ namespace Avalonia.Headless |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public void PushBitmapBlendMode(BitmapBlendingMode blendingMode) |
|
|
|
{ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public void PopBitmapBlendMode() |
|
|
|
{ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public object? GetFeature(Type t) |
|
|
|
{ |
|
|
|
return null; |
|
|
|
@ -540,10 +526,6 @@ namespace Avalonia.Headless |
|
|
|
{ |
|
|
|
} |
|
|
|
|
|
|
|
public void DrawRectangle(IPen pen, Rect rect, float cornerRadius = 0) |
|
|
|
{ |
|
|
|
} |
|
|
|
|
|
|
|
public void DrawBitmap(IBitmapImpl source, double opacity, Rect sourceRect, Rect destRect) |
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
@ -59,10 +59,6 @@ namespace Avalonia.Headless |
|
|
|
|
|
|
|
public Compositor Compositor => AvaloniaHeadlessPlatform.Compositor!; |
|
|
|
|
|
|
|
public void Invalidate(Rect rect) |
|
|
|
{ |
|
|
|
} |
|
|
|
|
|
|
|
public void SetInputRoot(IInputRoot inputRoot) |
|
|
|
{ |
|
|
|
InputRoot = inputRoot; |
|
|
|
@ -96,16 +92,6 @@ namespace Avalonia.Headless |
|
|
|
Dispatcher.UIThread.Post(() => Deactivated?.Invoke(), DispatcherPriority.Input); |
|
|
|
} |
|
|
|
|
|
|
|
public void BeginMoveDrag() |
|
|
|
{ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public void BeginResizeDrag(WindowEdge edge) |
|
|
|
{ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public PixelPoint Position { get; set; } |
|
|
|
public Action<PixelPoint>? PositionChanged { get; set; } |
|
|
|
public void Activate() |
|
|
|
|
|
|
|
@ -1304,18 +1304,6 @@ namespace Avalonia.Skia |
|
|
|
return (byte)(r * 255); |
|
|
|
} |
|
|
|
|
|
|
|
private static Color Blend(Color left, Color right) |
|
|
|
{ |
|
|
|
var aa = left.A / 255d; |
|
|
|
var ab = right.A / 255d; |
|
|
|
return new Color( |
|
|
|
(byte)((aa + ab * (1 - aa)) * 255), |
|
|
|
Blend(left.R, left.A, right.R, right.A), |
|
|
|
Blend(left.G, left.A, right.G, right.A), |
|
|
|
Blend(left.B, left.A, right.B, right.A) |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
internal PaintWrapper CreateAcrylicPaint (SKPaint paint, IExperimentalAcrylicMaterial material) |
|
|
|
{ |
|
|
|
var paintWrapper = new PaintWrapper(paint); |
|
|
|
@ -1535,16 +1523,6 @@ namespace Avalonia.Skia |
|
|
|
_disposable3 = null; |
|
|
|
} |
|
|
|
|
|
|
|
public IDisposable ApplyTo(SKPaint paint) |
|
|
|
{ |
|
|
|
var state = new PaintState(paint, paint.Color, paint.Shader); |
|
|
|
|
|
|
|
paint.Color = Paint.Color; |
|
|
|
paint.Shader = Paint.Shader; |
|
|
|
|
|
|
|
return state; |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Add new disposable to a wrapper.
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
@ -1,13 +1,5 @@ |
|
|
|
namespace Avalonia.Generators.NameGenerator; |
|
|
|
|
|
|
|
internal enum Options |
|
|
|
{ |
|
|
|
Public = 0, |
|
|
|
Private = 1, |
|
|
|
Internal = 2, |
|
|
|
Protected = 3, |
|
|
|
} |
|
|
|
|
|
|
|
internal enum Behavior |
|
|
|
{ |
|
|
|
OnlyProperties = 0, |
|
|
|
|
|
|
|
@ -8,13 +8,6 @@ namespace Avalonia.SourceGenerator.CompositionGenerator |
|
|
|
{ |
|
|
|
public partial class Generator |
|
|
|
{ |
|
|
|
static void CleanDirectory(string path) |
|
|
|
{ |
|
|
|
Directory.CreateDirectory(path); |
|
|
|
Directory.Delete(path, true); |
|
|
|
Directory.CreateDirectory(path); |
|
|
|
} |
|
|
|
|
|
|
|
CompilationUnitSyntax Unit() |
|
|
|
=> CompilationUnit().WithUsings(List(new[] |
|
|
|
{ |
|
|
|
@ -40,16 +33,6 @@ namespace Avalonia.SourceGenerator.CompositionGenerator |
|
|
|
|
|
|
|
static SyntaxToken Semicolon() => Token(SyntaxKind.SemicolonToken); |
|
|
|
|
|
|
|
|
|
|
|
static FieldDeclarationSyntax DeclareConstant(string type, string name, LiteralExpressionSyntax value) |
|
|
|
=> FieldDeclaration( |
|
|
|
VariableDeclaration(ParseTypeName(type), |
|
|
|
SingletonSeparatedList( |
|
|
|
VariableDeclarator(name).WithInitializer(EqualsValueClause(value)) |
|
|
|
)) |
|
|
|
).WithSemicolonToken(Semicolon()) |
|
|
|
.WithModifiers(TokenList(Token(SyntaxKind.PublicKeyword), Token(SyntaxKind.ConstKeyword))); |
|
|
|
|
|
|
|
static FieldDeclarationSyntax DeclareField(string type, string name, params SyntaxKind[] modifiers) => |
|
|
|
DeclareField(type, name, null, modifiers); |
|
|
|
|
|
|
|
|
|
|
|
@ -530,19 +530,6 @@ return; |
|
|
|
return body.AddStatements(ParseStatement(code)); |
|
|
|
} |
|
|
|
|
|
|
|
static ClassDeclarationSyntax WithGetPropertyForAnimation(ClassDeclarationSyntax cl, BlockSyntax body) |
|
|
|
{ |
|
|
|
if (body.Statements.Count == 0) |
|
|
|
return cl; |
|
|
|
body = body.AddStatements( |
|
|
|
ParseStatement("return base.GetPropertyForAnimation(name);")); |
|
|
|
var method = ((MethodDeclarationSyntax) ParseMemberDeclaration( |
|
|
|
$"public override Avalonia.Rendering.Composition.Expressions.ExpressionVariant GetPropertyForAnimation(string name){{}}")!) |
|
|
|
.WithBody(body); |
|
|
|
|
|
|
|
return cl.AddMembers(method); |
|
|
|
} |
|
|
|
|
|
|
|
static ClassDeclarationSyntax WithGetCompositionProperty(ClassDeclarationSyntax cl, BlockSyntax body) |
|
|
|
{ |
|
|
|
if (body.Statements.Count == 0) |
|
|
|
|