csharpc-sharpdotnetxamlavaloniauicross-platformcross-platform-xamlavaloniaguimulti-platformuser-interfacedotnetcore
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.1 KiB
45 lines
1.1 KiB
// Copyright (c) The Avalonia Project. All rights reserved.
|
|
// Licensed under the MIT license. See licence.md file in the project root for full license information.
|
|
|
|
using System;
|
|
using Avalonia.Input;
|
|
using Avalonia.Platform;
|
|
using Avalonia.Native.Interop;
|
|
|
|
namespace Avalonia.Native
|
|
{
|
|
class AvaloniaNativeCursor : IPlatformHandle, IDisposable
|
|
{
|
|
public IAvnCursor Cursor { get; private set; }
|
|
public IntPtr Handle => IntPtr.Zero;
|
|
|
|
public string HandleDescriptor => "<none>";
|
|
|
|
public AvaloniaNativeCursor(IAvnCursor cursor)
|
|
{
|
|
Cursor = cursor;
|
|
}
|
|
|
|
public void Dispose()
|
|
{
|
|
Cursor.Dispose();
|
|
Cursor = null;
|
|
}
|
|
}
|
|
|
|
class CursorFactory : IStandardCursorFactory
|
|
{
|
|
IAvnCursorFactory _native;
|
|
|
|
public CursorFactory(IAvnCursorFactory native)
|
|
{
|
|
_native = native;
|
|
}
|
|
|
|
public IPlatformHandle GetCursor(StandardCursorType cursorType)
|
|
{
|
|
var cursor = _native.GetCursor((AvnStandardCursorType)cursorType);
|
|
return new AvaloniaNativeCursor( cursor );
|
|
}
|
|
}
|
|
}
|
|
|