Verify Views files against decompiled, extract embedded types
Fixed files: - SkiaImageButton.cs: Added SVG support with multi-path search - SkiaNavigationPage.cs: Added LinuxApplication.IsGtkMode check - SkiaRefreshView.cs: Added ICommand support (Command, CommandParameter) - SkiaTemplatedView.cs: Added missing using statements Extracted embedded types to separate files (matching decompiled pattern): - From SkiaMenuBar.cs: MenuBarItem, MenuItem, SkiaMenuFlyout, MenuItemClickedEventArgs - From SkiaNavigationPage.cs: NavigationEventArgs - From SkiaTabbedPage.cs: TabItem - From SkiaVisualStateManager.cs: SkiaVisualStateGroupList, SkiaVisualStateGroup, SkiaVisualState, SkiaVisualStateSetter - From SkiaSwipeView.cs: SwipeItem, SwipeStartedEventArgs, SwipeEndedEventArgs - From SkiaFlyoutPage.cs: FlyoutLayoutBehavior (already separate) - From SkiaIndicatorView.cs: IndicatorShape (already separate) - From SkiaBorder.cs: SkiaFrame - From SkiaCarouselView.cs: PositionChangedEventArgs - From SkiaCollectionView.cs: SkiaSelectionMode, ItemsLayoutOrientation - From SkiaContentPresenter.cs: LayoutAlignment Verified matching decompiled: - SkiaContextMenu.cs, SkiaFlexLayout.cs, SkiaGraphicsView.cs Build: 0 errors 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -7,20 +7,6 @@ using Microsoft.Maui.Platform.Linux.Rendering;
|
||||
|
||||
namespace Microsoft.Maui.Platform.Linux.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Supported display server types.
|
||||
/// </summary>
|
||||
public enum DisplayServerType
|
||||
{
|
||||
Auto,
|
||||
X11,
|
||||
Wayland
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Factory for creating display server connections.
|
||||
/// Supports X11 and Wayland display servers.
|
||||
/// </summary>
|
||||
public static class DisplayServerFactory
|
||||
{
|
||||
private static DisplayServerType? _cachedServerType;
|
||||
@@ -139,136 +125,3 @@ public static class DisplayServerFactory
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Common interface for display server windows.
|
||||
/// </summary>
|
||||
public interface IDisplayWindow : IDisposable
|
||||
{
|
||||
int Width { get; }
|
||||
int Height { get; }
|
||||
bool IsRunning { get; }
|
||||
void Show();
|
||||
void Hide();
|
||||
void SetTitle(string title);
|
||||
void Resize(int width, int height);
|
||||
void ProcessEvents();
|
||||
void Stop();
|
||||
event EventHandler<KeyEventArgs>? KeyDown;
|
||||
event EventHandler<KeyEventArgs>? KeyUp;
|
||||
event EventHandler<TextInputEventArgs>? TextInput;
|
||||
event EventHandler<PointerEventArgs>? PointerMoved;
|
||||
event EventHandler<PointerEventArgs>? PointerPressed;
|
||||
event EventHandler<PointerEventArgs>? PointerReleased;
|
||||
event EventHandler<ScrollEventArgs>? Scroll;
|
||||
event EventHandler? Exposed;
|
||||
event EventHandler<(int Width, int Height)>? Resized;
|
||||
event EventHandler? CloseRequested;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// X11 display window wrapper implementing the common interface.
|
||||
/// </summary>
|
||||
public class X11DisplayWindow : IDisplayWindow
|
||||
{
|
||||
private readonly X11Window _window;
|
||||
|
||||
public int Width => _window.Width;
|
||||
public int Height => _window.Height;
|
||||
public bool IsRunning => _window.IsRunning;
|
||||
|
||||
public event EventHandler<KeyEventArgs>? KeyDown;
|
||||
public event EventHandler<KeyEventArgs>? KeyUp;
|
||||
public event EventHandler<TextInputEventArgs>? TextInput;
|
||||
public event EventHandler<PointerEventArgs>? PointerMoved;
|
||||
public event EventHandler<PointerEventArgs>? PointerPressed;
|
||||
public event EventHandler<PointerEventArgs>? PointerReleased;
|
||||
public event EventHandler<ScrollEventArgs>? Scroll;
|
||||
public event EventHandler? Exposed;
|
||||
public event EventHandler<(int Width, int Height)>? Resized;
|
||||
public event EventHandler? CloseRequested;
|
||||
|
||||
public X11DisplayWindow(string title, int width, int height)
|
||||
{
|
||||
_window = new X11Window(title, width, height);
|
||||
|
||||
_window.KeyDown += (s, e) => KeyDown?.Invoke(this, e);
|
||||
_window.KeyUp += (s, e) => KeyUp?.Invoke(this, e);
|
||||
_window.TextInput += (s, e) => TextInput?.Invoke(this, e);
|
||||
_window.PointerMoved += (s, e) => PointerMoved?.Invoke(this, e);
|
||||
_window.PointerPressed += (s, e) => PointerPressed?.Invoke(this, e);
|
||||
_window.PointerReleased += (s, e) => PointerReleased?.Invoke(this, e);
|
||||
_window.Scroll += (s, e) => Scroll?.Invoke(this, e);
|
||||
_window.Exposed += (s, e) => Exposed?.Invoke(this, e);
|
||||
_window.Resized += (s, e) => Resized?.Invoke(this, e);
|
||||
_window.CloseRequested += (s, e) => CloseRequested?.Invoke(this, e);
|
||||
}
|
||||
|
||||
public void Show() => _window.Show();
|
||||
public void Hide() => _window.Hide();
|
||||
public void SetTitle(string title) => _window.SetTitle(title);
|
||||
public void Resize(int width, int height) => _window.Resize(width, height);
|
||||
public void ProcessEvents() => _window.ProcessEvents();
|
||||
public void Stop() => _window.Stop();
|
||||
public void Dispose() => _window.Dispose();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Wayland display window wrapper implementing IDisplayWindow.
|
||||
/// Uses the full WaylandWindow implementation with xdg-shell protocol.
|
||||
/// </summary>
|
||||
public class WaylandDisplayWindow : IDisplayWindow
|
||||
{
|
||||
private readonly WaylandWindow _window;
|
||||
|
||||
public int Width => _window.Width;
|
||||
public int Height => _window.Height;
|
||||
public bool IsRunning => _window.IsRunning;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the pixel data pointer for rendering.
|
||||
/// </summary>
|
||||
public IntPtr PixelData => _window.PixelData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the stride (bytes per row) of the pixel buffer.
|
||||
/// </summary>
|
||||
public int Stride => _window.Stride;
|
||||
|
||||
public event EventHandler<KeyEventArgs>? KeyDown;
|
||||
public event EventHandler<KeyEventArgs>? KeyUp;
|
||||
public event EventHandler<TextInputEventArgs>? TextInput;
|
||||
public event EventHandler<PointerEventArgs>? PointerMoved;
|
||||
public event EventHandler<PointerEventArgs>? PointerPressed;
|
||||
public event EventHandler<PointerEventArgs>? PointerReleased;
|
||||
public event EventHandler<ScrollEventArgs>? Scroll;
|
||||
public event EventHandler? Exposed;
|
||||
public event EventHandler<(int Width, int Height)>? Resized;
|
||||
public event EventHandler? CloseRequested;
|
||||
|
||||
public WaylandDisplayWindow(string title, int width, int height)
|
||||
{
|
||||
_window = new WaylandWindow(title, width, height);
|
||||
|
||||
// Wire up events
|
||||
_window.KeyDown += (s, e) => KeyDown?.Invoke(this, e);
|
||||
_window.KeyUp += (s, e) => KeyUp?.Invoke(this, e);
|
||||
_window.TextInput += (s, e) => TextInput?.Invoke(this, e);
|
||||
_window.PointerMoved += (s, e) => PointerMoved?.Invoke(this, e);
|
||||
_window.PointerPressed += (s, e) => PointerPressed?.Invoke(this, e);
|
||||
_window.PointerReleased += (s, e) => PointerReleased?.Invoke(this, e);
|
||||
_window.Scroll += (s, e) => Scroll?.Invoke(this, e);
|
||||
_window.Exposed += (s, e) => Exposed?.Invoke(this, e);
|
||||
_window.Resized += (s, e) => Resized?.Invoke(this, e);
|
||||
_window.CloseRequested += (s, e) => CloseRequested?.Invoke(this, e);
|
||||
}
|
||||
|
||||
public void Show() => _window.Show();
|
||||
public void Hide() => _window.Hide();
|
||||
public void SetTitle(string title) => _window.SetTitle(title);
|
||||
public void Resize(int width, int height) => _window.Resize(width, height);
|
||||
public void ProcessEvents() => _window.ProcessEvents();
|
||||
public void Stop() => _window.Stop();
|
||||
public void CommitFrame() => _window.CommitFrame();
|
||||
public void Dispose() => _window.Dispose();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user