From aeb08c7ae3b3ad800ec2cc70ec73088a04152c10 Mon Sep 17 00:00:00 2001 From: Nikita Tsukanov Date: Wed, 28 Oct 2020 16:56:26 +0300 Subject: [PATCH] Use MicroCom instead of SharpGen (NOT TESTED YET) --- src/Avalonia.MicroCom/IUnknown.cs | 4 - src/Avalonia.MicroCom/MicroComProxyBase.cs | 33 +- src/Avalonia.MicroCom/MicroComRuntime.cs | 11 +- src/Avalonia.MicroCom/MicroComShadow.cs | 2 +- src/Avalonia.Native/.gitignore | 1 + src/Avalonia.Native/Avalonia.Native.csproj | 27 +- .../AvaloniaNativeMenuExporter.cs | 7 +- src/Avalonia.Native/AvaloniaNativePlatform.cs | 12 +- .../AvaloniaNativePlatformOpenGlInterface.cs | 4 +- src/Avalonia.Native/AvnString.cs | 22 +- src/Avalonia.Native/CallbackBase.cs | 78 +- src/Avalonia.Native/ClipboardImpl.cs | 16 +- src/Avalonia.Native/DeferredFramebuffer.cs | 7 +- src/Avalonia.Native/Generated/Enumerations.cs | 628 ---- src/Avalonia.Native/Generated/Functions.cs | 5 - src/Avalonia.Native/Generated/Interfaces.cs | 3092 ----------------- src/Avalonia.Native/Generated/LocalInterop.cs | 202 -- src/Avalonia.Native/Generated/Structures.cs | 246 -- src/Avalonia.Native/Helpers.cs | 2 +- src/Avalonia.Native/IAvnMenu.cs | 45 +- src/Avalonia.Native/IAvnMenuItem.cs | 41 +- src/Avalonia.Native/NativeControlHostImpl.cs | 4 +- .../PlatformThreadingInterface.cs | 5 +- src/Avalonia.Native/ScreenImpl.cs | 2 +- src/Avalonia.Native/SystemDialogs.cs | 8 +- src/Avalonia.Native/WindowImpl.cs | 28 +- src/Avalonia.Native/WindowImplBase.cs | 18 +- src/Avalonia.Native/avn.idl | 42 +- src/tools/MicroComGenerator/Ast.cs | 175 +- src/tools/MicroComGenerator/AstParser.cs | 17 +- .../CSharpGen.InterfaceGen.cs | 18 +- .../MicroComGenerator/CSharpGen.Utils.cs | 25 +- src/tools/MicroComGenerator/CSharpGen.cs | 52 +- src/tools/MicroComGenerator/CppGen.cs | 7 +- .../MicroComGenerator.csproj | 2 - 35 files changed, 457 insertions(+), 4431 deletions(-) delete mode 100644 src/Avalonia.Native/Generated/Enumerations.cs delete mode 100644 src/Avalonia.Native/Generated/Functions.cs delete mode 100644 src/Avalonia.Native/Generated/Interfaces.cs delete mode 100644 src/Avalonia.Native/Generated/LocalInterop.cs delete mode 100644 src/Avalonia.Native/Generated/Structures.cs diff --git a/src/Avalonia.MicroCom/IUnknown.cs b/src/Avalonia.MicroCom/IUnknown.cs index a46953ced9..0dc4106423 100644 --- a/src/Avalonia.MicroCom/IUnknown.cs +++ b/src/Avalonia.MicroCom/IUnknown.cs @@ -4,9 +4,5 @@ namespace Avalonia.MicroCom { public interface IUnknown : IDisposable { - void AddRef(); - void Release(); - int QueryInterface(Guid guid, out IntPtr ppv); - T QueryInterface() where T : IUnknown; } } diff --git a/src/Avalonia.MicroCom/MicroComProxyBase.cs b/src/Avalonia.MicroCom/MicroComProxyBase.cs index 56b80c2632..6a13fb10c4 100644 --- a/src/Avalonia.MicroCom/MicroComProxyBase.cs +++ b/src/Avalonia.MicroCom/MicroComProxyBase.cs @@ -1,12 +1,15 @@ using System; +using System.Runtime.ConstrainedExecution; using System.Runtime.InteropServices; +using System.Threading; namespace Avalonia.MicroCom { - public unsafe class MicroComProxyBase : IUnknown + public unsafe class MicroComProxyBase : CriticalFinalizerObject, IUnknown { private IntPtr _nativePointer; private bool _ownsHandle; + private SynchronizationContext _synchronizationContext; public IntPtr NativePointer { @@ -24,6 +27,9 @@ namespace Avalonia.MicroCom { _nativePointer = nativePointer; _ownsHandle = ownsHandle; + _synchronizationContext = SynchronizationContext.Current; + if(!_ownsHandle) + GC.SuppressFinalize(this); } protected virtual int VTableSize => 3; @@ -56,13 +62,16 @@ namespace Avalonia.MicroCom } public bool IsDisposed => _nativePointer == IntPtr.Zero; - - public void Dispose() + + protected virtual void Dispose(bool disposing) { if (_ownsHandle) Release(); _nativePointer = IntPtr.Zero; + GC.SuppressFinalize(this); } + + public void Dispose() => Dispose(true); public bool OwnsHandle => _ownsHandle; @@ -70,9 +79,27 @@ namespace Avalonia.MicroCom { if (!_ownsHandle) { + GC.ReRegisterForFinalize(true); AddRef(); _ownsHandle = true; } } + + private static readonly SendOrPostCallback _disposeDelegate = DisposeOnContext; + + private static void DisposeOnContext(object state) + { + (state as MicroComProxyBase)?.Dispose(false); + } + + ~MicroComProxyBase() + { + if(!_ownsHandle) + return; + if (_synchronizationContext == null) + Dispose(); + else + _synchronizationContext.Post(_disposeDelegate, this); + } } } diff --git a/src/Avalonia.MicroCom/MicroComRuntime.cs b/src/Avalonia.MicroCom/MicroComRuntime.cs index eccf24b496..d43568631a 100644 --- a/src/Avalonia.MicroCom/MicroComRuntime.cs +++ b/src/Avalonia.MicroCom/MicroComRuntime.cs @@ -34,9 +34,10 @@ namespace Avalonia.MicroCom public static Guid GetGuidFor(Type type) => _guids[type]; - public static T CreateProxyFor(void* ppv, bool ownsHandle) => (T)CreateProxyFor(typeof(T), new IntPtr(ppv), ownsHandle); + public static T CreateProxyFor(void* pObject, bool ownsHandle) => (T)CreateProxyFor(typeof(T), new IntPtr(pObject), ownsHandle); + public static T CreateProxyFor(IntPtr pObject, bool ownsHandle) => (T)CreateProxyFor(typeof(T), pObject, ownsHandle); - public static object CreateProxyFor(Type type, IntPtr ppv, bool ownsHandle) => _factories[type](ppv, ownsHandle); + public static object CreateProxyFor(Type type, IntPtr pObject, bool ownsHandle) => _factories[type](pObject, ownsHandle); public static void* GetNativePointer(T obj, bool owned = false) where T : IUnknown { @@ -84,5 +85,11 @@ namespace Avalonia.MicroCom } } + + public static T CloneReference(T iface) where T : IUnknown + { + var ownedPointer = GetNativePointer(iface, true); + return CreateProxyFor(ownedPointer, true); + } } } diff --git a/src/Avalonia.MicroCom/MicroComShadow.cs b/src/Avalonia.MicroCom/MicroComShadow.cs index c9411a089e..a6a0fd519e 100644 --- a/src/Avalonia.MicroCom/MicroComShadow.cs +++ b/src/Avalonia.MicroCom/MicroComShadow.cs @@ -77,7 +77,7 @@ namespace Avalonia.MicroCom { try { - Target.OnUnreferencedFromNative(); + Target.OnReferencedFromNative(); } catch (Exception e) { diff --git a/src/Avalonia.Native/.gitignore b/src/Avalonia.Native/.gitignore index b1153e777c..b270c05962 100644 --- a/src/Avalonia.Native/.gitignore +++ b/src/Avalonia.Native/.gitignore @@ -1 +1,2 @@ Generated/*.cs +*.Generated.cs diff --git a/src/Avalonia.Native/Avalonia.Native.csproj b/src/Avalonia.Native/Avalonia.Native.csproj index 49bd578290..a3e99595c2 100644 --- a/src/Avalonia.Native/Avalonia.Native.csproj +++ b/src/Avalonia.Native/Avalonia.Native.csproj @@ -21,11 +21,30 @@ - - - - + + + + + false + all + true + + + + + + + + + + + + + + <_AvaloniaPatchComInterop>true + + \ No newline at end of file diff --git a/src/Avalonia.Native/AvaloniaNativeMenuExporter.cs b/src/Avalonia.Native/AvaloniaNativeMenuExporter.cs index 6d1b95b997..b192de95de 100644 --- a/src/Avalonia.Native/AvaloniaNativeMenuExporter.cs +++ b/src/Avalonia.Native/AvaloniaNativeMenuExporter.cs @@ -4,6 +4,7 @@ using Avalonia.Controls.ApplicationLifetimes; using Avalonia.Controls.Platform; using Avalonia.Dialogs; using Avalonia.Native.Interop; +using Avalonia.Native.Interop.Impl; using Avalonia.Threading; namespace Avalonia.Native @@ -15,7 +16,7 @@ namespace Avalonia.Native private bool _exported = false; private IAvnWindow _nativeWindow; private NativeMenu _menu; - private IAvnMenu _nativeMenu; + private __MicroComIAvnMenuProxy _nativeMenu; public AvaloniaNativeMenuExporter(IAvnWindow nativeWindow, IAvaloniaNativeFactory factory) { @@ -135,7 +136,7 @@ namespace Avalonia.Native if (_nativeMenu is null) { - _nativeMenu = IAvnMenu.Create(_factory); + _nativeMenu = (__MicroComIAvnMenuProxy)__MicroComIAvnMenuProxy.Create(_factory); _nativeMenu.Initialise(this, appMenuHolder, ""); @@ -156,7 +157,7 @@ namespace Avalonia.Native if (_nativeMenu is null) { - _nativeMenu = IAvnMenu.Create(_factory); + _nativeMenu = __MicroComIAvnMenuProxy.Create(_factory); _nativeMenu.Initialise(this, menu, ""); diff --git a/src/Avalonia.Native/AvaloniaNativePlatform.cs b/src/Avalonia.Native/AvaloniaNativePlatform.cs index e8b2f065c7..6ce55e17b3 100644 --- a/src/Avalonia.Native/AvaloniaNativePlatform.cs +++ b/src/Avalonia.Native/AvaloniaNativePlatform.cs @@ -4,6 +4,7 @@ using System.Security.Cryptography; using Avalonia.Controls.Platform; using Avalonia.Input; using Avalonia.Input.Platform; +using Avalonia.MicroCom; using Avalonia.Native.Interop; using Avalonia.OpenGL; using Avalonia.Platform; @@ -29,7 +30,7 @@ namespace Avalonia.Native public static AvaloniaNativePlatform Initialize(IntPtr factory, AvaloniaNativePlatformOptions options) { - var result = new AvaloniaNativePlatform(new IAvaloniaNativeFactory(factory)); + var result = new AvaloniaNativePlatform(MicroComRuntime.CreateProxyFor(factory, true)); result.DoInitialize(options); return result; @@ -65,10 +66,7 @@ namespace Avalonia.Native { if(!string.IsNullOrWhiteSpace(Application.Current.Name)) { - using (var buffer = new Utf8Buffer(Application.Current.Name)) - { - _factory.MacOptions.SetApplicationTitle(buffer.DangerousGetHandle()); - } + _factory.MacOptions.SetApplicationTitle(Application.Current.Name); } } @@ -93,7 +91,7 @@ namespace Avalonia.Native { var macOpts = AvaloniaLocator.Current.GetService(); - _factory.MacOptions.ShowInDock = macOpts?.ShowInDock != false ? 1 : 0; + _factory.MacOptions.SetShowInDock(macOpts?.ShowInDock != false ? 1 : 0); } AvaloniaLocator.CurrentMutable @@ -153,7 +151,7 @@ namespace Avalonia.Native set { _showInDock = value; - _opts.ShowInDock = value ? 1 : 0; + _opts.SetShowInDock(value ? 1 : 0); } } } diff --git a/src/Avalonia.Native/AvaloniaNativePlatformOpenGlInterface.cs b/src/Avalonia.Native/AvaloniaNativePlatformOpenGlInterface.cs index dbe968b82f..3b3d8836fd 100644 --- a/src/Avalonia.Native/AvaloniaNativePlatformOpenGlInterface.cs +++ b/src/Avalonia.Native/AvaloniaNativePlatformOpenGlInterface.cs @@ -150,12 +150,12 @@ namespace Avalonia.Native { get { - var s = _session.GetPixelSize(); + var s = _session.PixelSize; return new PixelSize(s.Width, s.Height); } } - public double Scaling => _session.GetScaling(); + public double Scaling => _session.Scaling; public bool IsYFlipped => true; diff --git a/src/Avalonia.Native/AvnString.cs b/src/Avalonia.Native/AvnString.cs index 11b1a33276..dcd473bae3 100644 --- a/src/Avalonia.Native/AvnString.cs +++ b/src/Avalonia.Native/AvnString.cs @@ -1,8 +1,22 @@ +using System; using System.Runtime.InteropServices; namespace Avalonia.Native.Interop { - unsafe partial class IAvnString + partial interface IAvnString + { + public string String { get; } + public byte[] Bytes { get; } + } + + partial interface IAvnStringArray + { + string[] ToStringArray(); + } +} +namespace Avalonia.Native.Interop.Impl +{ + unsafe partial class __MicroComIAvnStringProxy { private string _managed; private byte[] _bytes; @@ -16,7 +30,7 @@ namespace Avalonia.Native.Interop var ptr = Pointer(); if (ptr == null) return null; - _managed = System.Text.Encoding.UTF8.GetString((byte*)ptr.ToPointer(), Length()); + _managed = System.Text.Encoding.UTF8.GetString((byte*)ptr, Length()); } return _managed; @@ -30,7 +44,7 @@ namespace Avalonia.Native.Interop if (_bytes == null) { _bytes = new byte[Length()]; - Marshal.Copy(Pointer(), _bytes, 0, _bytes.Length); + Marshal.Copy(new IntPtr(Pointer()), _bytes, 0, _bytes.Length); } return _bytes; @@ -40,7 +54,7 @@ namespace Avalonia.Native.Interop public override string ToString() => String; } - partial class IAvnStringArray + partial class __MicroComIAvnStringArrayProxy { public string[] ToStringArray() { diff --git a/src/Avalonia.Native/CallbackBase.cs b/src/Avalonia.Native/CallbackBase.cs index 4cda358d0a..455ed4b159 100644 --- a/src/Avalonia.Native/CallbackBase.cs +++ b/src/Avalonia.Native/CallbackBase.cs @@ -1,44 +1,30 @@ using System; using System.Runtime.ExceptionServices; -using SharpGen.Runtime; +using Avalonia.MicroCom; using Avalonia.Platform; namespace Avalonia.Native { - public class CallbackBase : SharpGen.Runtime.IUnknown, IExceptionCallback + public class CallbackBase : IUnknown, IMicroComShadowContainer, IMicroComExceptionCallback { - private uint _refCount; - private bool _disposed; private readonly object _lock = new object(); - private ShadowContainer _shadow; + private bool _referencedFromManaged = true; + private bool _referencedFromNative = false; + private bool _destroyed; + - public CallbackBase() - { - _refCount = 1; - } - - public ShadowContainer Shadow + protected virtual void Destroyed() { - get => _shadow; - set - { - lock (_lock) - { - if (_disposed && value != null) - { - throw new ObjectDisposedException("CallbackBase"); - } - _shadow = value; - } - } } - public uint AddRef() + public void RaiseException(Exception e) { - lock (_lock) + if (AvaloniaLocator.Current.GetService() is PlatformThreadingInterface threadingInterface) { - return ++_refCount; + threadingInterface.TerminateNativeApp(); + + threadingInterface.DispatchException(ExceptionDispatchInfo.Capture(e)); } } @@ -46,43 +32,35 @@ namespace Avalonia.Native { lock (_lock) { - if (!_disposed) - { - _disposed = true; - Release(); - } + _referencedFromManaged = false; + DestroyIfNeeded(); } } - public uint Release() + void DestroyIfNeeded() { - lock (_lock) + if(_destroyed) + return; + if (_referencedFromManaged == false && _referencedFromNative == false) { - _refCount--; - - if (_refCount == 0) - { - Shadow?.Dispose(); - Shadow = null; - Destroyed(); - } - - return _refCount; + _destroyed = true; + Destroyed(); } } - protected virtual void Destroyed() + public MicroComShadow Shadow { get; set; } + public void OnReferencedFromNative() { - + lock (_lock) + _referencedFromNative = true; } - public void RaiseException(Exception e) + public void OnUnreferencedFromNative() { - if (AvaloniaLocator.Current.GetService() is PlatformThreadingInterface threadingInterface) + lock (_lock) { - threadingInterface.TerminateNativeApp(); - - threadingInterface.DispatchException(ExceptionDispatchInfo.Capture(e)); + _referencedFromNative = false; + DestroyIfNeeded(); } } } diff --git a/src/Avalonia.Native/ClipboardImpl.cs b/src/Avalonia.Native/ClipboardImpl.cs index 554e7a497a..4ee590516b 100644 --- a/src/Avalonia.Native/ClipboardImpl.cs +++ b/src/Avalonia.Native/ClipboardImpl.cs @@ -35,17 +35,12 @@ namespace Avalonia.Native return Task.FromResult(text.String); } - public Task SetTextAsync(string text) + public unsafe Task SetTextAsync(string text) { _native.Clear(); - if (text != null) - { - using (var buffer = new Utf8Buffer(text)) - { - _native.SetText(NSPasteboardTypeString, buffer.DangerousGetHandle()); - } - } + if (text != null) + _native.SetText(NSPasteboardTypeString, text); return Task.CompletedTask; } @@ -90,11 +85,10 @@ namespace Avalonia.Native { var o = data.Get(fmt); if(o is string s) - using (var b = new Utf8Buffer(s)) - _native.SetText(fmt, b.DangerousGetHandle()); + _native.SetText(fmt, s); else if(o is byte[] bytes) fixed (byte* pbytes = bytes) - _native.SetBytes(fmt, new IntPtr(pbytes), bytes.Length); + _native.SetBytes(fmt, pbytes, bytes.Length); } return Task.CompletedTask; } diff --git a/src/Avalonia.Native/DeferredFramebuffer.cs b/src/Avalonia.Native/DeferredFramebuffer.cs index 8ea7b20b8c..950b6a3197 100644 --- a/src/Avalonia.Native/DeferredFramebuffer.cs +++ b/src/Avalonia.Native/DeferredFramebuffer.cs @@ -2,11 +2,10 @@ using System.Runtime.InteropServices; using Avalonia.Native.Interop; using Avalonia.Platform; -using SharpGen.Runtime; namespace Avalonia.Native { - public class DeferredFramebuffer : ILockedFramebuffer + internal unsafe class DeferredFramebuffer : ILockedFramebuffer { private readonly Func, bool> _lockWindow; @@ -56,7 +55,7 @@ namespace Avalonia.Native { var fb = new AvnFramebuffer { - Data = Address, + Data = Address.ToPointer(), Dpi = new AvnVector { X = Dpi.X, @@ -70,7 +69,7 @@ namespace Avalonia.Native using (var d = new Disposer(Address)) { - win.ThreadSafeSetSwRenderedFrame(ref fb, d); + win.ThreadSafeSetSwRenderedFrame(&fb, d); } })) { diff --git a/src/Avalonia.Native/Generated/Enumerations.cs b/src/Avalonia.Native/Generated/Enumerations.cs deleted file mode 100644 index 0b30ce50c0..0000000000 --- a/src/Avalonia.Native/Generated/Enumerations.cs +++ /dev/null @@ -1,628 +0,0 @@ -// - -namespace Avalonia.Native.Interop -{ - /// - /// No documentation. - /// - /// AvnDragDropEffects - /// AvnDragDropEffects - public enum AvnDragDropEffects : System.Int32 - { - /// - /// No documentation. - /// - /// None - /// None - None = unchecked ((System.Int32)(0)), - /// - /// No documentation. - /// - /// Copy - /// Copy - Copy = unchecked ((System.Int32)(1)), - /// - /// No documentation. - /// - /// Move - /// Move - Move = unchecked ((System.Int32)(2)), - /// - /// No documentation. - /// - /// Link - /// Link - Link = unchecked ((System.Int32)(4))} - - /// - /// No documentation. - /// - /// AvnDragEventType - /// AvnDragEventType - public enum AvnDragEventType : System.Int32 - { - /// - /// No documentation. - /// - /// Enter - /// Enter - Enter = unchecked ((System.Int32)(0)), - /// - /// No documentation. - /// - /// Over - /// Over - Over = unchecked ((System.Int32)(1)), - /// - /// No documentation. - /// - /// Leave - /// Leave - Leave = unchecked ((System.Int32)(2)), - /// - /// No documentation. - /// - /// Drop - /// Drop - Drop = unchecked ((System.Int32)(3))} - - /// - /// No documentation. - /// - /// AvnExtendClientAreaChromeHints - /// AvnExtendClientAreaChromeHints - public enum AvnExtendClientAreaChromeHints : System.Int32 - { - /// - /// No documentation. - /// - /// AvnNoChrome - /// AvnNoChrome - AvnNoChrome = unchecked ((System.Int32)(0)), - /// - /// No documentation. - /// - /// AvnSystemChrome - /// AvnSystemChrome - AvnSystemChrome = unchecked ((System.Int32)(1)), - /// - /// No documentation. - /// - /// AvnPreferSystemChrome - /// AvnPreferSystemChrome - AvnPreferSystemChrome = unchecked ((System.Int32)(2)), - /// - /// No documentation. - /// - /// AvnOSXThickTitleBar - /// AvnOSXThickTitleBar - AvnOSXThickTitleBar = unchecked ((System.Int32)(8)), - /// - /// No documentation. - /// - /// AvnDefaultChrome - /// AvnDefaultChrome - AvnDefaultChrome = unchecked ((System.Int32)(1))} - - /// - /// No documentation. - /// - /// AvnInputModifiers - /// AvnInputModifiers - public enum AvnInputModifiers : System.Int32 - { - /// - /// No documentation. - /// - /// AvnInputModifiersNone - /// AvnInputModifiersNone - AvnInputModifiersNone = unchecked ((System.Int32)(0)), - /// - /// No documentation. - /// - /// Alt - /// Alt - Alt = unchecked ((System.Int32)(1)), - /// - /// No documentation. - /// - /// Control - /// Control - Control = unchecked ((System.Int32)(2)), - /// - /// No documentation. - /// - /// Shift - /// Shift - Shift = unchecked ((System.Int32)(4)), - /// - /// No documentation. - /// - /// Windows - /// Windows - Windows = unchecked ((System.Int32)(8)), - /// - /// No documentation. - /// - /// LeftMouseButton - /// LeftMouseButton - LeftMouseButton = unchecked ((System.Int32)(16)), - /// - /// No documentation. - /// - /// RightMouseButton - /// RightMouseButton - RightMouseButton = unchecked ((System.Int32)(32)), - /// - /// No documentation. - /// - /// MiddleMouseButton - /// MiddleMouseButton - MiddleMouseButton = unchecked ((System.Int32)(64)), - /// - /// No documentation. - /// - /// XButton1MouseButton - /// XButton1MouseButton - XButton1MouseButton = unchecked ((System.Int32)(128)), - /// - /// No documentation. - /// - /// XButton2MouseButton - /// XButton2MouseButton - XButton2MouseButton = unchecked ((System.Int32)(256))} - - /// - /// No documentation. - /// - /// AvnMenuItemToggleType - /// AvnMenuItemToggleType - public enum AvnMenuItemToggleType : System.Int32 - { - /// - /// No documentation. - /// - /// None - /// None - None = unchecked ((System.Int32)(0)), - /// - /// No documentation. - /// - /// CheckMark - /// CheckMark - CheckMark = unchecked ((System.Int32)(1)), - /// - /// No documentation. - /// - /// Radio - /// Radio - Radio = unchecked ((System.Int32)(2))} - - /// - /// No documentation. - /// - /// AvnPixelFormat - /// AvnPixelFormat - public enum AvnPixelFormat : System.Int32 - { - /// - /// No documentation. - /// - /// kAvnRgb565 - /// kAvnRgb565 - KAvnRgb565 = unchecked ((System.Int32)(0)), - /// - /// No documentation. - /// - /// kAvnRgba8888 - /// kAvnRgba8888 - KAvnRgba8888 = unchecked ((System.Int32)(1)), - /// - /// No documentation. - /// - /// kAvnBgra8888 - /// kAvnBgra8888 - KAvnBgra8888 = unchecked ((System.Int32)(2))} - - /// - /// No documentation. - /// - /// AvnRawKeyEventType - /// AvnRawKeyEventType - public enum AvnRawKeyEventType : System.Int32 - { - /// - /// No documentation. - /// - /// KeyDown - /// KeyDown - KeyDown = unchecked ((System.Int32)(0)), - /// - /// No documentation. - /// - /// KeyUp - /// KeyUp - KeyUp = unchecked ((System.Int32)(1))} - - /// - /// No documentation. - /// - /// AvnRawMouseEventType - /// AvnRawMouseEventType - public enum AvnRawMouseEventType : System.Int32 - { - /// - /// No documentation. - /// - /// LeaveWindow - /// LeaveWindow - LeaveWindow = unchecked ((System.Int32)(0)), - /// - /// No documentation. - /// - /// LeftButtonDown - /// LeftButtonDown - LeftButtonDown = unchecked ((System.Int32)(1)), - /// - /// No documentation. - /// - /// LeftButtonUp - /// LeftButtonUp - LeftButtonUp = unchecked ((System.Int32)(2)), - /// - /// No documentation. - /// - /// RightButtonDown - /// RightButtonDown - RightButtonDown = unchecked ((System.Int32)(3)), - /// - /// No documentation. - /// - /// RightButtonUp - /// RightButtonUp - RightButtonUp = unchecked ((System.Int32)(4)), - /// - /// No documentation. - /// - /// MiddleButtonDown - /// MiddleButtonDown - MiddleButtonDown = unchecked ((System.Int32)(5)), - /// - /// No documentation. - /// - /// MiddleButtonUp - /// MiddleButtonUp - MiddleButtonUp = unchecked ((System.Int32)(6)), - /// - /// No documentation. - /// - /// XButton1Down - /// XButton1Down - XButton1Down = unchecked ((System.Int32)(7)), - /// - /// No documentation. - /// - /// XButton1Up - /// XButton1Up - XButton1Up = unchecked ((System.Int32)(8)), - /// - /// No documentation. - /// - /// XButton2Down - /// XButton2Down - XButton2Down = unchecked ((System.Int32)(9)), - /// - /// No documentation. - /// - /// XButton2Up - /// XButton2Up - XButton2Up = unchecked ((System.Int32)(10)), - /// - /// No documentation. - /// - /// Move - /// Move - Move = unchecked ((System.Int32)(11)), - /// - /// No documentation. - /// - /// Wheel - /// Wheel - Wheel = unchecked ((System.Int32)(12)), - /// - /// No documentation. - /// - /// NonClientLeftButtonDown - /// NonClientLeftButtonDown - NonClientLeftButtonDown = unchecked ((System.Int32)(13)), - /// - /// No documentation. - /// - /// TouchBegin - /// TouchBegin - TouchBegin = unchecked ((System.Int32)(14)), - /// - /// No documentation. - /// - /// TouchUpdate - /// TouchUpdate - TouchUpdate = unchecked ((System.Int32)(15)), - /// - /// No documentation. - /// - /// TouchEnd - /// TouchEnd - TouchEnd = unchecked ((System.Int32)(16)), - /// - /// No documentation. - /// - /// TouchCancel - /// TouchCancel - TouchCancel = unchecked ((System.Int32)(17))} - - /// - /// No documentation. - /// - /// AvnStandardCursorType - /// AvnStandardCursorType - public enum AvnStandardCursorType : System.Int32 - { - /// - /// No documentation. - /// - /// CursorArrow - /// CursorArrow - CursorArrow = unchecked ((System.Int32)(0)), - /// - /// No documentation. - /// - /// CursorIbeam - /// CursorIbeam - CursorIbeam = unchecked ((System.Int32)(1)), - /// - /// No documentation. - /// - /// CursorWait - /// CursorWait - CursorWait = unchecked ((System.Int32)(2)), - /// - /// No documentation. - /// - /// CursorCross - /// CursorCross - CursorCross = unchecked ((System.Int32)(3)), - /// - /// No documentation. - /// - /// CursorUpArrow - /// CursorUpArrow - CursorUpArrow = unchecked ((System.Int32)(4)), - /// - /// No documentation. - /// - /// CursorSizeWestEast - /// CursorSizeWestEast - CursorSizeWestEast = unchecked ((System.Int32)(5)), - /// - /// No documentation. - /// - /// CursorSizeNorthSouth - /// CursorSizeNorthSouth - CursorSizeNorthSouth = unchecked ((System.Int32)(6)), - /// - /// No documentation. - /// - /// CursorSizeAll - /// CursorSizeAll - CursorSizeAll = unchecked ((System.Int32)(7)), - /// - /// No documentation. - /// - /// CursorNo - /// CursorNo - CursorNo = unchecked ((System.Int32)(8)), - /// - /// No documentation. - /// - /// CursorHand - /// CursorHand - CursorHand = unchecked ((System.Int32)(9)), - /// - /// No documentation. - /// - /// CursorAppStarting - /// CursorAppStarting - CursorAppStarting = unchecked ((System.Int32)(10)), - /// - /// No documentation. - /// - /// CursorHelp - /// CursorHelp - CursorHelp = unchecked ((System.Int32)(11)), - /// - /// No documentation. - /// - /// CursorTopSide - /// CursorTopSide - CursorTopSide = unchecked ((System.Int32)(12)), - /// - /// No documentation. - /// - /// CursorBottomSize - /// CursorBottomSize - CursorBottomSize = unchecked ((System.Int32)(13)), - /// - /// No documentation. - /// - /// CursorLeftSide - /// CursorLeftSide - CursorLeftSide = unchecked ((System.Int32)(14)), - /// - /// No documentation. - /// - /// CursorRightSide - /// CursorRightSide - CursorRightSide = unchecked ((System.Int32)(15)), - /// - /// No documentation. - /// - /// CursorTopLeftCorner - /// CursorTopLeftCorner - CursorTopLeftCorner = unchecked ((System.Int32)(16)), - /// - /// No documentation. - /// - /// CursorTopRightCorner - /// CursorTopRightCorner - CursorTopRightCorner = unchecked ((System.Int32)(17)), - /// - /// No documentation. - /// - /// CursorBottomLeftCorner - /// CursorBottomLeftCorner - CursorBottomLeftCorner = unchecked ((System.Int32)(18)), - /// - /// No documentation. - /// - /// CursorBottomRightCorner - /// CursorBottomRightCorner - CursorBottomRightCorner = unchecked ((System.Int32)(19)), - /// - /// No documentation. - /// - /// CursorDragMove - /// CursorDragMove - CursorDragMove = unchecked ((System.Int32)(20)), - /// - /// No documentation. - /// - /// CursorDragCopy - /// CursorDragCopy - CursorDragCopy = unchecked ((System.Int32)(21)), - /// - /// No documentation. - /// - /// CursorDragLink - /// CursorDragLink - CursorDragLink = unchecked ((System.Int32)(22)), - /// - /// No documentation. - /// - /// CursorNone - /// CursorNone - CursorNone = unchecked ((System.Int32)(23))} - - /// - /// No documentation. - /// - /// AvnWindowEdge - /// AvnWindowEdge - public enum AvnWindowEdge : System.Int32 - { - /// - /// No documentation. - /// - /// WindowEdgeNorthWest - /// WindowEdgeNorthWest - WindowEdgeNorthWest = unchecked ((System.Int32)(0)), - /// - /// No documentation. - /// - /// WindowEdgeNorth - /// WindowEdgeNorth - WindowEdgeNorth = unchecked ((System.Int32)(1)), - /// - /// No documentation. - /// - /// WindowEdgeNorthEast - /// WindowEdgeNorthEast - WindowEdgeNorthEast = unchecked ((System.Int32)(2)), - /// - /// No documentation. - /// - /// WindowEdgeWest - /// WindowEdgeWest - WindowEdgeWest = unchecked ((System.Int32)(3)), - /// - /// No documentation. - /// - /// WindowEdgeEast - /// WindowEdgeEast - WindowEdgeEast = unchecked ((System.Int32)(4)), - /// - /// No documentation. - /// - /// WindowEdgeSouthWest - /// WindowEdgeSouthWest - WindowEdgeSouthWest = unchecked ((System.Int32)(5)), - /// - /// No documentation. - /// - /// WindowEdgeSouth - /// WindowEdgeSouth - WindowEdgeSouth = unchecked ((System.Int32)(6)), - /// - /// No documentation. - /// - /// WindowEdgeSouthEast - /// WindowEdgeSouthEast - WindowEdgeSouthEast = unchecked ((System.Int32)(7))} - - /// - /// No documentation. - /// - /// AvnWindowState - /// AvnWindowState - public enum AvnWindowState : System.Int32 - { - /// - /// No documentation. - /// - /// Normal - /// Normal - Normal = unchecked ((System.Int32)(0)), - /// - /// No documentation. - /// - /// Minimized - /// Minimized - Minimized = unchecked ((System.Int32)(1)), - /// - /// No documentation. - /// - /// Maximized - /// Maximized - Maximized = unchecked ((System.Int32)(2)), - /// - /// No documentation. - /// - /// FullScreen - /// FullScreen - FullScreen = unchecked ((System.Int32)(3))} - - /// - /// No documentation. - /// - /// SystemDecorations - /// SystemDecorations - public enum SystemDecorations : System.Int32 - { - /// - /// No documentation. - /// - /// SystemDecorationsNone - /// SystemDecorationsNone - SystemDecorationsNone = unchecked ((System.Int32)(0)), - /// - /// No documentation. - /// - /// SystemDecorationsBorderOnly - /// SystemDecorationsBorderOnly - SystemDecorationsBorderOnly = unchecked ((System.Int32)(1)), - /// - /// No documentation. - /// - /// SystemDecorationsFull - /// SystemDecorationsFull - SystemDecorationsFull = unchecked ((System.Int32)(2))} -} \ No newline at end of file diff --git a/src/Avalonia.Native/Generated/Functions.cs b/src/Avalonia.Native/Generated/Functions.cs deleted file mode 100644 index 6ab648dc50..0000000000 --- a/src/Avalonia.Native/Generated/Functions.cs +++ /dev/null @@ -1,5 +0,0 @@ -// - -namespace Avalonia.Native.Interop -{ -} \ No newline at end of file diff --git a/src/Avalonia.Native/Generated/Interfaces.cs b/src/Avalonia.Native/Generated/Interfaces.cs deleted file mode 100644 index 161ada1e50..0000000000 --- a/src/Avalonia.Native/Generated/Interfaces.cs +++ /dev/null @@ -1,3092 +0,0 @@ -// - -namespace Avalonia.Native.Interop -{ - [System.Runtime.InteropServices.GuidAttribute("2e2cda0a-9ae5-4f1b-8e20-081a04279f01")] - public partial class IAvaloniaNativeFactory : SharpGen.Runtime.ComObject - { - public IAvaloniaNativeFactory(System.IntPtr nativePtr): base (nativePtr) - { - } - - public static explicit operator IAvaloniaNativeFactory(System.IntPtr nativePtr) => nativePtr == System.IntPtr.Zero ? null : new IAvaloniaNativeFactory(nativePtr); - /// - /// No documentation. - /// - /// GetMacOptions - /// GetMacOptions - public Avalonia.Native.Interop.IAvnMacOptions MacOptions - { - get => GetMacOptions(); - } - - /// - /// No documentation. - /// - /// SetAppMenu - /// SetAppMenu - public Avalonia.Native.Interop.IAvnMenu AppMenu - { - set => SetAppMenu(value); - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// HRESULT IAvaloniaNativeFactory::Initialize([In] IAvnGCHandleDeallocatorCallback* deallocator) - /// IAvaloniaNativeFactory::Initialize - public unsafe void Initialize(Avalonia.Native.Interop.IAvnGCHandleDeallocatorCallback deallocator) - { - System.IntPtr deallocator_ = System.IntPtr.Zero; - SharpGen.Runtime.Result __result__; - deallocator_ = SharpGen.Runtime.CppObject.ToCallbackPtr(deallocator); - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, (void *)deallocator_, (*(void ***)this._nativePointer)[3]); - System.GC.KeepAlive(deallocator); - __result__.CheckError(); - } - - /// - /// No documentation. - /// - /// No documentation. - /// IAvnMacOptions* IAvaloniaNativeFactory::GetMacOptions() - /// IAvaloniaNativeFactory::GetMacOptions - internal unsafe Avalonia.Native.Interop.IAvnMacOptions GetMacOptions() - { - Avalonia.Native.Interop.IAvnMacOptions __result__; - System.IntPtr __result__native = System.IntPtr.Zero; - __result__native = Avalonia.Native.LocalInterop.CalliThisCallSystemIntPtr(this._nativePointer, (*(void ***)this._nativePointer)[4]); - if (__result__native != System.IntPtr.Zero) - __result__ = new Avalonia.Native.Interop.IAvnMacOptions(__result__native); - else - __result__ = null; - return __result__; - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// No documentation. - /// HRESULT IAvaloniaNativeFactory::CreateWindow([In] IAvnWindowEvents* cb,[In] IAvnGlContext* gl,[In] IAvnWindow** ppv) - /// IAvaloniaNativeFactory::CreateWindow - public unsafe Avalonia.Native.Interop.IAvnWindow CreateWindow(Avalonia.Native.Interop.IAvnWindowEvents cb, Avalonia.Native.Interop.IAvnGlContext gl) - { - System.IntPtr cb_ = System.IntPtr.Zero; - System.IntPtr gl_ = System.IntPtr.Zero; - Avalonia.Native.Interop.IAvnWindow vOut; - System.IntPtr vOut_ = System.IntPtr.Zero; - SharpGen.Runtime.Result __result__; - cb_ = SharpGen.Runtime.CppObject.ToCallbackPtr(cb); - gl_ = SharpGen.Runtime.CppObject.ToCallbackPtr(gl); - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, (void *)cb_, (void *)gl_, &vOut_, (*(void ***)this._nativePointer)[5]); - if (vOut_ != System.IntPtr.Zero) - vOut = new Avalonia.Native.Interop.IAvnWindow(vOut_); - else - vOut = null; - System.GC.KeepAlive(cb); - System.GC.KeepAlive(gl); - __result__.CheckError(); - return vOut; - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// No documentation. - /// HRESULT IAvaloniaNativeFactory::CreatePopup([In] IAvnWindowEvents* cb,[In] IAvnGlContext* gl,[In] IAvnPopup** ppv) - /// IAvaloniaNativeFactory::CreatePopup - public unsafe Avalonia.Native.Interop.IAvnPopup CreatePopup(Avalonia.Native.Interop.IAvnWindowEvents cb, Avalonia.Native.Interop.IAvnGlContext gl) - { - System.IntPtr cb_ = System.IntPtr.Zero; - System.IntPtr gl_ = System.IntPtr.Zero; - Avalonia.Native.Interop.IAvnPopup vOut; - System.IntPtr vOut_ = System.IntPtr.Zero; - SharpGen.Runtime.Result __result__; - cb_ = SharpGen.Runtime.CppObject.ToCallbackPtr(cb); - gl_ = SharpGen.Runtime.CppObject.ToCallbackPtr(gl); - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, (void *)cb_, (void *)gl_, &vOut_, (*(void ***)this._nativePointer)[6]); - if (vOut_ != System.IntPtr.Zero) - vOut = new Avalonia.Native.Interop.IAvnPopup(vOut_); - else - vOut = null; - System.GC.KeepAlive(cb); - System.GC.KeepAlive(gl); - __result__.CheckError(); - return vOut; - } - - /// - /// No documentation. - /// - /// No documentation. - /// HRESULT IAvaloniaNativeFactory::CreatePlatformThreadingInterface([In] IAvnPlatformThreadingInterface** ppv) - /// IAvaloniaNativeFactory::CreatePlatformThreadingInterface - public unsafe Avalonia.Native.Interop.IAvnPlatformThreadingInterface CreatePlatformThreadingInterface() - { - Avalonia.Native.Interop.IAvnPlatformThreadingInterface vOut; - System.IntPtr vOut_ = System.IntPtr.Zero; - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, &vOut_, (*(void ***)this._nativePointer)[7]); - if (vOut_ != System.IntPtr.Zero) - vOut = new Avalonia.Native.Interop.IAvnPlatformThreadingInterface(vOut_); - else - vOut = null; - __result__.CheckError(); - return vOut; - } - - /// - /// No documentation. - /// - /// No documentation. - /// HRESULT IAvaloniaNativeFactory::CreateSystemDialogs([In] IAvnSystemDialogs** ppv) - /// IAvaloniaNativeFactory::CreateSystemDialogs - public unsafe Avalonia.Native.Interop.IAvnSystemDialogs CreateSystemDialogs() - { - Avalonia.Native.Interop.IAvnSystemDialogs vOut; - System.IntPtr vOut_ = System.IntPtr.Zero; - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, &vOut_, (*(void ***)this._nativePointer)[8]); - if (vOut_ != System.IntPtr.Zero) - vOut = new Avalonia.Native.Interop.IAvnSystemDialogs(vOut_); - else - vOut = null; - __result__.CheckError(); - return vOut; - } - - /// - /// No documentation. - /// - /// No documentation. - /// HRESULT IAvaloniaNativeFactory::CreateScreens([In] IAvnScreens** ppv) - /// IAvaloniaNativeFactory::CreateScreens - public unsafe Avalonia.Native.Interop.IAvnScreens CreateScreens() - { - Avalonia.Native.Interop.IAvnScreens vOut; - System.IntPtr vOut_ = System.IntPtr.Zero; - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, &vOut_, (*(void ***)this._nativePointer)[9]); - if (vOut_ != System.IntPtr.Zero) - vOut = new Avalonia.Native.Interop.IAvnScreens(vOut_); - else - vOut = null; - __result__.CheckError(); - return vOut; - } - - /// - /// No documentation. - /// - /// No documentation. - /// HRESULT IAvaloniaNativeFactory::CreateClipboard([In] IAvnClipboard** ppv) - /// IAvaloniaNativeFactory::CreateClipboard - public unsafe Avalonia.Native.Interop.IAvnClipboard CreateClipboard() - { - Avalonia.Native.Interop.IAvnClipboard vOut; - System.IntPtr vOut_ = System.IntPtr.Zero; - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, &vOut_, (*(void ***)this._nativePointer)[10]); - if (vOut_ != System.IntPtr.Zero) - vOut = new Avalonia.Native.Interop.IAvnClipboard(vOut_); - else - vOut = null; - __result__.CheckError(); - return vOut; - } - - /// - /// No documentation. - /// - /// No documentation. - /// HRESULT IAvaloniaNativeFactory::CreateDndClipboard([In] IAvnClipboard** ppv) - /// IAvaloniaNativeFactory::CreateDndClipboard - public unsafe Avalonia.Native.Interop.IAvnClipboard CreateDndClipboard() - { - Avalonia.Native.Interop.IAvnClipboard vOut; - System.IntPtr vOut_ = System.IntPtr.Zero; - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, &vOut_, (*(void ***)this._nativePointer)[11]); - if (vOut_ != System.IntPtr.Zero) - vOut = new Avalonia.Native.Interop.IAvnClipboard(vOut_); - else - vOut = null; - __result__.CheckError(); - return vOut; - } - - /// - /// No documentation. - /// - /// No documentation. - /// HRESULT IAvaloniaNativeFactory::CreateCursorFactory([In] IAvnCursorFactory** ppv) - /// IAvaloniaNativeFactory::CreateCursorFactory - public unsafe Avalonia.Native.Interop.IAvnCursorFactory CreateCursorFactory() - { - Avalonia.Native.Interop.IAvnCursorFactory vOut; - System.IntPtr vOut_ = System.IntPtr.Zero; - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, &vOut_, (*(void ***)this._nativePointer)[12]); - if (vOut_ != System.IntPtr.Zero) - vOut = new Avalonia.Native.Interop.IAvnCursorFactory(vOut_); - else - vOut = null; - __result__.CheckError(); - return vOut; - } - - /// - /// No documentation. - /// - /// No documentation. - /// HRESULT IAvaloniaNativeFactory::ObtainGlDisplay([In] IAvnGlDisplay** ppv) - /// IAvaloniaNativeFactory::ObtainGlDisplay - public unsafe Avalonia.Native.Interop.IAvnGlDisplay ObtainGlDisplay() - { - Avalonia.Native.Interop.IAvnGlDisplay vOut; - System.IntPtr vOut_ = System.IntPtr.Zero; - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, &vOut_, (*(void ***)this._nativePointer)[13]); - if (vOut_ != System.IntPtr.Zero) - vOut = new Avalonia.Native.Interop.IAvnGlDisplay(vOut_); - else - vOut = null; - __result__.CheckError(); - return vOut; - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// HRESULT IAvaloniaNativeFactory::SetAppMenu([In] IAvnMenu* menu) - /// IAvaloniaNativeFactory::SetAppMenu - internal unsafe void SetAppMenu(Avalonia.Native.Interop.IAvnMenu menu) - { - System.IntPtr menu_ = System.IntPtr.Zero; - SharpGen.Runtime.Result __result__; - menu_ = SharpGen.Runtime.CppObject.ToCallbackPtr(menu); - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, (void *)menu_, (*(void ***)this._nativePointer)[14]); - System.GC.KeepAlive(menu); - __result__.CheckError(); - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// HRESULT IAvaloniaNativeFactory::CreateMenu([In] IAvnMenuEvents* cb,[In] IAvnMenu** ppv) - /// IAvaloniaNativeFactory::CreateMenu - public unsafe Avalonia.Native.Interop.IAvnMenu CreateMenu(Avalonia.Native.Interop.IAvnMenuEvents cb) - { - System.IntPtr cb_ = System.IntPtr.Zero; - Avalonia.Native.Interop.IAvnMenu vOut; - System.IntPtr vOut_ = System.IntPtr.Zero; - SharpGen.Runtime.Result __result__; - cb_ = SharpGen.Runtime.CppObject.ToCallbackPtr(cb); - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, (void *)cb_, &vOut_, (*(void ***)this._nativePointer)[15]); - if (vOut_ != System.IntPtr.Zero) - vOut = new Avalonia.Native.Interop.IAvnMenu(vOut_); - else - vOut = null; - System.GC.KeepAlive(cb); - __result__.CheckError(); - return vOut; - } - - /// - /// No documentation. - /// - /// No documentation. - /// HRESULT IAvaloniaNativeFactory::CreateMenuItem([In] IAvnMenuItem** ppv) - /// IAvaloniaNativeFactory::CreateMenuItem - public unsafe Avalonia.Native.Interop.IAvnMenuItem CreateMenuItem() - { - Avalonia.Native.Interop.IAvnMenuItem vOut; - System.IntPtr vOut_ = System.IntPtr.Zero; - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, &vOut_, (*(void ***)this._nativePointer)[16]); - if (vOut_ != System.IntPtr.Zero) - vOut = new Avalonia.Native.Interop.IAvnMenuItem(vOut_); - else - vOut = null; - __result__.CheckError(); - return vOut; - } - - /// - /// No documentation. - /// - /// No documentation. - /// HRESULT IAvaloniaNativeFactory::CreateMenuItemSeperator([In] IAvnMenuItem** ppv) - /// IAvaloniaNativeFactory::CreateMenuItemSeperator - public unsafe Avalonia.Native.Interop.IAvnMenuItem CreateMenuItemSeperator() - { - Avalonia.Native.Interop.IAvnMenuItem vOut; - System.IntPtr vOut_ = System.IntPtr.Zero; - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, &vOut_, (*(void ***)this._nativePointer)[17]); - if (vOut_ != System.IntPtr.Zero) - vOut = new Avalonia.Native.Interop.IAvnMenuItem(vOut_); - else - vOut = null; - __result__.CheckError(); - return vOut; - } - } - - class IAvnActionCallbackShadow : SharpGen.Runtime.ComObjectShadow - { - protected unsafe class IAvnActionCallbackVtbl : SharpGen.Runtime.ComObjectShadow.ComObjectVtbl - { - public IAvnActionCallbackVtbl(int numberOfCallbackMethods): base (numberOfCallbackMethods + 1) - { - AddMethod(new RunDelegate(Run)); - } - - [System.Runtime.InteropServices.UnmanagedFunctionPointerAttribute(System.Runtime.InteropServices.CallingConvention.ThisCall)] - private delegate void RunDelegate(System.IntPtr thisObject); - private static unsafe void Run(System.IntPtr thisObject) - { - try - { - IAvnActionCallback @this = (IAvnActionCallback)ToShadow(thisObject).Callback; - @this.Run(); - } - catch (System.Exception __exception__) - { - IAvnActionCallback @this = (IAvnActionCallback)ToShadow(thisObject).Callback; - (@this as SharpGen.Runtime.IExceptionCallback)?.RaiseException(__exception__); - } - } - } - - protected override SharpGen.Runtime.CppObjectVtbl Vtbl - { - get; - } - - = new Avalonia.Native.Interop.IAvnActionCallbackShadow.IAvnActionCallbackVtbl(0); - } - - [System.Runtime.InteropServices.GuidAttribute("2e2cda0a-9ae5-4f1b-8e20-081a04279f08"), SharpGen.Runtime.ShadowAttribute(typeof (Avalonia.Native.Interop.IAvnActionCallbackShadow))] - public partial interface IAvnActionCallback : SharpGen.Runtime.IUnknown - { - void Run(); - } - - [System.Runtime.InteropServices.GuidAttribute("2e2cda0a-9ae5-4f1b-8e20-081a04279f0f")] - public partial class IAvnClipboard : SharpGen.Runtime.ComObject - { - public IAvnClipboard(System.IntPtr nativePtr): base (nativePtr) - { - } - - public static explicit operator IAvnClipboard(System.IntPtr nativePtr) => nativePtr == System.IntPtr.Zero ? null : new IAvnClipboard(nativePtr); - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// HRESULT IAvnClipboard::GetText([In] char* type,[In] IAvnString** ppv) - /// IAvnClipboard::GetText - public unsafe Avalonia.Native.Interop.IAvnString GetText(System.String type) - { - System.IntPtr type_; - Avalonia.Native.Interop.IAvnString vOut; - System.IntPtr vOut_ = System.IntPtr.Zero; - SharpGen.Runtime.Result __result__; - type_ = System.Runtime.InteropServices.Marshal.StringToHGlobalAnsi(type); - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, (void *)type_, &vOut_, (*(void ***)this._nativePointer)[3]); - if (vOut_ != System.IntPtr.Zero) - vOut = new Avalonia.Native.Interop.IAvnString(vOut_); - else - vOut = null; - System.Runtime.InteropServices.Marshal.FreeHGlobal(type_); - __result__.CheckError(); - return vOut; - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// No documentation. - /// HRESULT IAvnClipboard::SetText([In] char* type,[In] void* utf8Text) - /// IAvnClipboard::SetText - public unsafe void SetText(System.String type, System.IntPtr utf8Text) - { - System.IntPtr type_; - SharpGen.Runtime.Result __result__; - type_ = System.Runtime.InteropServices.Marshal.StringToHGlobalAnsi(type); - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, (void *)type_, (void *)utf8Text, (*(void ***)this._nativePointer)[4]); - System.Runtime.InteropServices.Marshal.FreeHGlobal(type_); - __result__.CheckError(); - } - - /// - /// No documentation. - /// - /// No documentation. - /// HRESULT IAvnClipboard::ObtainFormats([In] IAvnStringArray** ppv) - /// IAvnClipboard::ObtainFormats - public unsafe Avalonia.Native.Interop.IAvnStringArray ObtainFormats() - { - Avalonia.Native.Interop.IAvnStringArray vOut; - System.IntPtr vOut_ = System.IntPtr.Zero; - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, &vOut_, (*(void ***)this._nativePointer)[5]); - if (vOut_ != System.IntPtr.Zero) - vOut = new Avalonia.Native.Interop.IAvnStringArray(vOut_); - else - vOut = null; - __result__.CheckError(); - return vOut; - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// HRESULT IAvnClipboard::GetStrings([In] char* type,[In] IAvnStringArray** ppv) - /// IAvnClipboard::GetStrings - public unsafe Avalonia.Native.Interop.IAvnStringArray GetStrings(System.String type) - { - System.IntPtr type_; - Avalonia.Native.Interop.IAvnStringArray vOut; - System.IntPtr vOut_ = System.IntPtr.Zero; - SharpGen.Runtime.Result __result__; - type_ = System.Runtime.InteropServices.Marshal.StringToHGlobalAnsi(type); - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, (void *)type_, &vOut_, (*(void ***)this._nativePointer)[6]); - if (vOut_ != System.IntPtr.Zero) - vOut = new Avalonia.Native.Interop.IAvnStringArray(vOut_); - else - vOut = null; - System.Runtime.InteropServices.Marshal.FreeHGlobal(type_); - __result__.CheckError(); - return vOut; - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// No documentation. - /// No documentation. - /// HRESULT IAvnClipboard::SetBytes([In] char* type,[In] void* utf8Text,[In] int len) - /// IAvnClipboard::SetBytes - public unsafe void SetBytes(System.String type, System.IntPtr utf8Text, System.Int32 len) - { - System.IntPtr type_; - SharpGen.Runtime.Result __result__; - type_ = System.Runtime.InteropServices.Marshal.StringToHGlobalAnsi(type); - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, (void *)type_, (void *)utf8Text, len, (*(void ***)this._nativePointer)[7]); - System.Runtime.InteropServices.Marshal.FreeHGlobal(type_); - __result__.CheckError(); - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// HRESULT IAvnClipboard::GetBytes([In] char* type,[In] IAvnString** ppv) - /// IAvnClipboard::GetBytes - public unsafe Avalonia.Native.Interop.IAvnString GetBytes(System.String type) - { - System.IntPtr type_; - Avalonia.Native.Interop.IAvnString vOut; - System.IntPtr vOut_ = System.IntPtr.Zero; - SharpGen.Runtime.Result __result__; - type_ = System.Runtime.InteropServices.Marshal.StringToHGlobalAnsi(type); - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, (void *)type_, &vOut_, (*(void ***)this._nativePointer)[8]); - if (vOut_ != System.IntPtr.Zero) - vOut = new Avalonia.Native.Interop.IAvnString(vOut_); - else - vOut = null; - System.Runtime.InteropServices.Marshal.FreeHGlobal(type_); - __result__.CheckError(); - return vOut; - } - - /// - /// No documentation. - /// - /// No documentation. - /// HRESULT IAvnClipboard::Clear() - /// IAvnClipboard::Clear - public unsafe void Clear() - { - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, (*(void ***)this._nativePointer)[9]); - __result__.CheckError(); - } - } - - [System.Runtime.InteropServices.GuidAttribute("2e2cda0a-9ae5-4f1b-8e20-081a04279f10")] - public partial class IAvnCursor : SharpGen.Runtime.ComObject - { - public IAvnCursor(System.IntPtr nativePtr): base (nativePtr) - { - } - - public static explicit operator IAvnCursor(System.IntPtr nativePtr) => nativePtr == System.IntPtr.Zero ? null : new IAvnCursor(nativePtr); - } - - [System.Runtime.InteropServices.GuidAttribute("2e2cda0a-9ae5-4f1b-8e20-081a04279f11")] - public partial class IAvnCursorFactory : SharpGen.Runtime.ComObject - { - public IAvnCursorFactory(System.IntPtr nativePtr): base (nativePtr) - { - } - - public static explicit operator IAvnCursorFactory(System.IntPtr nativePtr) => nativePtr == System.IntPtr.Zero ? null : new IAvnCursorFactory(nativePtr); - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// HRESULT IAvnCursorFactory::GetCursor([In] AvnStandardCursorType cursorType,[Out] IAvnCursor** retOut) - /// IAvnCursorFactory::GetCursor - public unsafe Avalonia.Native.Interop.IAvnCursor GetCursor(Avalonia.Native.Interop.AvnStandardCursorType cursorType) - { - Avalonia.Native.Interop.IAvnCursor retOut; - System.IntPtr retOut_ = System.IntPtr.Zero; - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, unchecked ((System.Int32)cursorType), &retOut_, (*(void ***)this._nativePointer)[3]); - if (retOut_ != System.IntPtr.Zero) - retOut = new Avalonia.Native.Interop.IAvnCursor(retOut_); - else - retOut = null; - __result__.CheckError(); - return retOut; - } - } - - class IAvnDndResultCallbackShadow : SharpGen.Runtime.ComObjectShadow - { - protected unsafe class IAvnDndResultCallbackVtbl : SharpGen.Runtime.ComObjectShadow.ComObjectVtbl - { - public IAvnDndResultCallbackVtbl(int numberOfCallbackMethods): base (numberOfCallbackMethods + 1) - { - AddMethod(new OnDragAndDropCompleteDelegate(OnDragAndDropComplete)); - } - - [System.Runtime.InteropServices.UnmanagedFunctionPointerAttribute(System.Runtime.InteropServices.CallingConvention.ThisCall)] - private delegate void OnDragAndDropCompleteDelegate(System.IntPtr thisObject, int arg0); - private static unsafe void OnDragAndDropComplete(System.IntPtr thisObject, int param0) - { - try - { - Avalonia.Native.Interop.AvnDragDropEffects effecct = default (Avalonia.Native.Interop.AvnDragDropEffects); - effecct = (Avalonia.Native.Interop.AvnDragDropEffects)param0; - IAvnDndResultCallback @this = (IAvnDndResultCallback)ToShadow(thisObject).Callback; - @this.OnDragAndDropComplete(effecct); - } - catch (System.Exception __exception__) - { - IAvnDndResultCallback @this = (IAvnDndResultCallback)ToShadow(thisObject).Callback; - (@this as SharpGen.Runtime.IExceptionCallback)?.RaiseException(__exception__); - } - } - } - - protected override SharpGen.Runtime.CppObjectVtbl Vtbl - { - get; - } - - = new Avalonia.Native.Interop.IAvnDndResultCallbackShadow.IAvnDndResultCallbackVtbl(0); - } - - [System.Runtime.InteropServices.GuidAttribute("2e2cda0a-9ae5-4f1b-8e20-081a04279f21"), SharpGen.Runtime.ShadowAttribute(typeof (Avalonia.Native.Interop.IAvnDndResultCallbackShadow))] - public partial interface IAvnDndResultCallback : SharpGen.Runtime.IUnknown - { - void OnDragAndDropComplete(Avalonia.Native.Interop.AvnDragDropEffects effecct); - } - - class IAvnGCHandleDeallocatorCallbackShadow : SharpGen.Runtime.ComObjectShadow - { - protected unsafe class IAvnGCHandleDeallocatorCallbackVtbl : SharpGen.Runtime.ComObjectShadow.ComObjectVtbl - { - public IAvnGCHandleDeallocatorCallbackVtbl(int numberOfCallbackMethods): base (numberOfCallbackMethods + 1) - { - AddMethod(new FreeGCHandleDelegate(FreeGCHandle)); - } - - [System.Runtime.InteropServices.UnmanagedFunctionPointerAttribute(System.Runtime.InteropServices.CallingConvention.ThisCall)] - private delegate void FreeGCHandleDelegate(System.IntPtr thisObject, void *arg0); - private static unsafe void FreeGCHandle(System.IntPtr thisObject, void *param0) - { - try - { - System.IntPtr handle = default (System.IntPtr); - handle = (System.IntPtr)param0; - IAvnGCHandleDeallocatorCallback @this = (IAvnGCHandleDeallocatorCallback)ToShadow(thisObject).Callback; - @this.FreeGCHandle(handle); - } - catch (System.Exception __exception__) - { - IAvnGCHandleDeallocatorCallback @this = (IAvnGCHandleDeallocatorCallback)ToShadow(thisObject).Callback; - (@this as SharpGen.Runtime.IExceptionCallback)?.RaiseException(__exception__); - } - } - } - - protected override SharpGen.Runtime.CppObjectVtbl Vtbl - { - get; - } - - = new Avalonia.Native.Interop.IAvnGCHandleDeallocatorCallbackShadow.IAvnGCHandleDeallocatorCallbackVtbl(0); - } - - [System.Runtime.InteropServices.GuidAttribute("2e2cda0a-9ae5-4f1b-8e20-081a04279f22"), SharpGen.Runtime.ShadowAttribute(typeof (Avalonia.Native.Interop.IAvnGCHandleDeallocatorCallbackShadow))] - public partial interface IAvnGCHandleDeallocatorCallback : SharpGen.Runtime.IUnknown - { - void FreeGCHandle(System.IntPtr handle); - } - - [System.Runtime.InteropServices.GuidAttribute("2e2cda0a-9ae5-4f1b-8e20-081a04279f14")] - public partial class IAvnGlContext : SharpGen.Runtime.ComObject - { - public IAvnGlContext(System.IntPtr nativePtr): base (nativePtr) - { - } - - public static explicit operator IAvnGlContext(System.IntPtr nativePtr) => nativePtr == System.IntPtr.Zero ? null : new IAvnGlContext(nativePtr); - /// - /// No documentation. - /// - /// GetSampleCount - /// GetSampleCount - public System.Int32 SampleCount - { - get => GetSampleCount(); - } - - /// - /// No documentation. - /// - /// GetStencilSize - /// GetStencilSize - public System.Int32 StencilSize - { - get => GetStencilSize(); - } - - /// - /// No documentation. - /// - /// GetNativeHandle - /// GetNativeHandle - public System.IntPtr NativeHandle - { - get => GetNativeHandle(); - } - - /// - /// No documentation. - /// - /// No documentation. - /// HRESULT IAvnGlContext::MakeCurrent([In] IUnknown** ppv) - /// IAvnGlContext::MakeCurrent - public unsafe SharpGen.Runtime.IUnknown MakeCurrent() - { - SharpGen.Runtime.IUnknown vOut; - System.IntPtr vOut_ = System.IntPtr.Zero; - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, &vOut_, (*(void ***)this._nativePointer)[3]); - if (vOut_ != System.IntPtr.Zero) - vOut = new SharpGen.Runtime.ComObject(vOut_); - else - vOut = null; - __result__.CheckError(); - return vOut; - } - - /// - /// No documentation. - /// - /// No documentation. - /// HRESULT IAvnGlContext::LegacyMakeCurrent() - /// IAvnGlContext::LegacyMakeCurrent - public unsafe void LegacyMakeCurrent() - { - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, (*(void ***)this._nativePointer)[4]); - __result__.CheckError(); - } - - /// - /// No documentation. - /// - /// No documentation. - /// int IAvnGlContext::GetSampleCount() - /// IAvnGlContext::GetSampleCount - internal unsafe System.Int32 GetSampleCount() - { - System.Int32 __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, (*(void ***)this._nativePointer)[5]); - return __result__; - } - - /// - /// No documentation. - /// - /// No documentation. - /// int IAvnGlContext::GetStencilSize() - /// IAvnGlContext::GetStencilSize - internal unsafe System.Int32 GetStencilSize() - { - System.Int32 __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, (*(void ***)this._nativePointer)[6]); - return __result__; - } - - /// - /// No documentation. - /// - /// No documentation. - /// void* IAvnGlContext::GetNativeHandle() - /// IAvnGlContext::GetNativeHandle - internal unsafe System.IntPtr GetNativeHandle() - { - System.IntPtr __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallSystemIntPtr(this._nativePointer, (*(void ***)this._nativePointer)[7]); - return __result__; - } - } - - [System.Runtime.InteropServices.GuidAttribute("2e2cda0a-9ae5-4f1b-8e20-081a04279f13")] - public partial class IAvnGlDisplay : SharpGen.Runtime.ComObject - { - public IAvnGlDisplay(System.IntPtr nativePtr): base (nativePtr) - { - } - - public static explicit operator IAvnGlDisplay(System.IntPtr nativePtr) => nativePtr == System.IntPtr.Zero ? null : new IAvnGlDisplay(nativePtr); - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// HRESULT IAvnGlDisplay::CreateContext([In] IAvnGlContext* share,[In] IAvnGlContext** ppv) - /// IAvnGlDisplay::CreateContext - public unsafe Avalonia.Native.Interop.IAvnGlContext CreateContext(Avalonia.Native.Interop.IAvnGlContext share) - { - System.IntPtr share_ = System.IntPtr.Zero; - Avalonia.Native.Interop.IAvnGlContext vOut; - System.IntPtr vOut_ = System.IntPtr.Zero; - SharpGen.Runtime.Result __result__; - share_ = SharpGen.Runtime.CppObject.ToCallbackPtr(share); - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, (void *)share_, &vOut_, (*(void ***)this._nativePointer)[3]); - if (vOut_ != System.IntPtr.Zero) - vOut = new Avalonia.Native.Interop.IAvnGlContext(vOut_); - else - vOut = null; - System.GC.KeepAlive(share); - __result__.CheckError(); - return vOut; - } - - /// - /// No documentation. - /// - /// void IAvnGlDisplay::LegacyClearCurrentContext() - /// IAvnGlDisplay::LegacyClearCurrentContext - public unsafe void LegacyClearCurrentContext() - { - Avalonia.Native.LocalInterop.CalliThisCallvoid(this._nativePointer, (*(void ***)this._nativePointer)[4]); - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// HRESULT IAvnGlDisplay::WrapContext([In] void* native,[In] IAvnGlContext** ppv) - /// IAvnGlDisplay::WrapContext - public unsafe Avalonia.Native.Interop.IAvnGlContext WrapContext(System.IntPtr native) - { - Avalonia.Native.Interop.IAvnGlContext vOut; - System.IntPtr vOut_ = System.IntPtr.Zero; - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, (void *)native, &vOut_, (*(void ***)this._nativePointer)[5]); - if (vOut_ != System.IntPtr.Zero) - vOut = new Avalonia.Native.Interop.IAvnGlContext(vOut_); - else - vOut = null; - __result__.CheckError(); - return vOut; - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// void* IAvnGlDisplay::GetProcAddress([In] char* proc) - /// IAvnGlDisplay::GetProcAddress - public unsafe System.IntPtr GetProcAddress(System.String rocRef) - { - System.IntPtr rocRef_; - System.IntPtr __result__; - rocRef_ = System.Runtime.InteropServices.Marshal.StringToHGlobalAnsi(rocRef); - __result__ = Avalonia.Native.LocalInterop.CalliThisCallSystemIntPtr(this._nativePointer, (void *)rocRef_, (*(void ***)this._nativePointer)[6]); - System.Runtime.InteropServices.Marshal.FreeHGlobal(rocRef_); - return __result__; - } - } - - [System.Runtime.InteropServices.GuidAttribute("2e2cda0a-9ae5-4f1b-8e20-081a04279f16")] - public partial class IAvnGlSurfaceRenderingSession : SharpGen.Runtime.ComObject - { - public IAvnGlSurfaceRenderingSession(System.IntPtr nativePtr): base (nativePtr) - { - } - - public static explicit operator IAvnGlSurfaceRenderingSession(System.IntPtr nativePtr) => nativePtr == System.IntPtr.Zero ? null : new IAvnGlSurfaceRenderingSession(nativePtr); - /// - /// No documentation. - /// - /// No documentation. - /// HRESULT IAvnGlSurfaceRenderingSession::GetPixelSize([In] AvnPixelSize* ret) - /// IAvnGlSurfaceRenderingSession::GetPixelSize - public unsafe Avalonia.Native.Interop.AvnPixelSize GetPixelSize() - { - Avalonia.Native.Interop.AvnPixelSize ret; - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, &ret, (*(void ***)this._nativePointer)[3]); - __result__.CheckError(); - return ret; - } - - /// - /// No documentation. - /// - /// No documentation. - /// HRESULT IAvnGlSurfaceRenderingSession::GetScaling([In] double* ret) - /// IAvnGlSurfaceRenderingSession::GetScaling - public unsafe System.Double GetScaling() - { - System.Double ret; - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, &ret, (*(void ***)this._nativePointer)[4]); - __result__.CheckError(); - return ret; - } - } - - [System.Runtime.InteropServices.GuidAttribute("2e2cda0a-9ae5-4f1b-8e20-081a04279f15")] - public partial class IAvnGlSurfaceRenderTarget : SharpGen.Runtime.ComObject - { - public IAvnGlSurfaceRenderTarget(System.IntPtr nativePtr): base (nativePtr) - { - } - - public static explicit operator IAvnGlSurfaceRenderTarget(System.IntPtr nativePtr) => nativePtr == System.IntPtr.Zero ? null : new IAvnGlSurfaceRenderTarget(nativePtr); - /// - /// No documentation. - /// - /// No documentation. - /// HRESULT IAvnGlSurfaceRenderTarget::BeginDrawing([In] IAvnGlSurfaceRenderingSession** ret) - /// IAvnGlSurfaceRenderTarget::BeginDrawing - public unsafe Avalonia.Native.Interop.IAvnGlSurfaceRenderingSession BeginDrawing() - { - Avalonia.Native.Interop.IAvnGlSurfaceRenderingSession ret; - System.IntPtr ret_ = System.IntPtr.Zero; - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, &ret_, (*(void ***)this._nativePointer)[3]); - if (ret_ != System.IntPtr.Zero) - ret = new Avalonia.Native.Interop.IAvnGlSurfaceRenderingSession(ret_); - else - ret = null; - __result__.CheckError(); - return ret; - } - } - - [System.Runtime.InteropServices.GuidAttribute("2e2cda0a-9ae5-4f1b-8e20-081a04279f0a")] - public partial class IAvnLoopCancellation : SharpGen.Runtime.ComObject - { - public IAvnLoopCancellation(System.IntPtr nativePtr): base (nativePtr) - { - } - - public static explicit operator IAvnLoopCancellation(System.IntPtr nativePtr) => nativePtr == System.IntPtr.Zero ? null : new IAvnLoopCancellation(nativePtr); - /// - /// No documentation. - /// - /// void IAvnLoopCancellation::Cancel() - /// IAvnLoopCancellation::Cancel - public unsafe void Cancel() - { - Avalonia.Native.LocalInterop.CalliThisCallvoid(this._nativePointer, (*(void ***)this._nativePointer)[3]); - } - } - - [System.Runtime.InteropServices.GuidAttribute("2e2cda0a-9ae5-4f1b-8e20-081a04279f07")] - public partial class IAvnMacOptions : SharpGen.Runtime.ComObject - { - public IAvnMacOptions(System.IntPtr nativePtr): base (nativePtr) - { - } - - public static explicit operator IAvnMacOptions(System.IntPtr nativePtr) => nativePtr == System.IntPtr.Zero ? null : new IAvnMacOptions(nativePtr); - /// - /// No documentation. - /// - /// SetShowInDock - /// SetShowInDock - public System.Int32 ShowInDock - { - set => SetShowInDock(value); - } - - /// - /// No documentation. - /// - /// SetApplicationTitle - /// SetApplicationTitle - public System.IntPtr ApplicationTitle - { - set => SetApplicationTitle(value); - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// HRESULT IAvnMacOptions::SetShowInDock([In] int show) - /// IAvnMacOptions::SetShowInDock - internal unsafe void SetShowInDock(System.Int32 show) - { - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, show, (*(void ***)this._nativePointer)[3]); - __result__.CheckError(); - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// HRESULT IAvnMacOptions::SetApplicationTitle([In] void* utf8string) - /// IAvnMacOptions::SetApplicationTitle - internal unsafe void SetApplicationTitle(System.IntPtr utf8string) - { - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, (void *)utf8string, (*(void ***)this._nativePointer)[4]); - __result__.CheckError(); - } - } - - [System.Runtime.InteropServices.GuidAttribute("2e2cda0a-9ae5-4f1b-8e20-081a04279f17")] - public partial class IAvnMenu : SharpGen.Runtime.ComObject - { - public IAvnMenu(System.IntPtr nativePtr): base (nativePtr) - { - } - - public static explicit operator IAvnMenu(System.IntPtr nativePtr) => nativePtr == System.IntPtr.Zero ? null : new IAvnMenu(nativePtr); - /// - /// No documentation. - /// - /// SetTitle - /// SetTitle - public System.IntPtr Title - { - set => SetTitle(value); - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// No documentation. - /// HRESULT IAvnMenu::InsertItem([In] int index,[In] IAvnMenuItem* item) - /// IAvnMenu::InsertItem - public unsafe void InsertItem(System.Int32 index, Avalonia.Native.Interop.IAvnMenuItem item) - { - System.IntPtr item_ = System.IntPtr.Zero; - SharpGen.Runtime.Result __result__; - item_ = SharpGen.Runtime.CppObject.ToCallbackPtr(item); - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, index, (void *)item_, (*(void ***)this._nativePointer)[3]); - System.GC.KeepAlive(item); - __result__.CheckError(); - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// HRESULT IAvnMenu::RemoveItem([In] IAvnMenuItem* item) - /// IAvnMenu::RemoveItem - public unsafe void RemoveItem(Avalonia.Native.Interop.IAvnMenuItem item) - { - System.IntPtr item_ = System.IntPtr.Zero; - SharpGen.Runtime.Result __result__; - item_ = SharpGen.Runtime.CppObject.ToCallbackPtr(item); - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, (void *)item_, (*(void ***)this._nativePointer)[4]); - System.GC.KeepAlive(item); - __result__.CheckError(); - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// HRESULT IAvnMenu::SetTitle([In] void* utf8String) - /// IAvnMenu::SetTitle - internal unsafe void SetTitle(System.IntPtr utf8String) - { - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, (void *)utf8String, (*(void ***)this._nativePointer)[5]); - __result__.CheckError(); - } - - /// - /// No documentation. - /// - /// No documentation. - /// HRESULT IAvnMenu::Clear() - /// IAvnMenu::Clear - public unsafe void Clear() - { - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, (*(void ***)this._nativePointer)[6]); - __result__.CheckError(); - } - } - - class IAvnMenuEventsShadow : SharpGen.Runtime.ComObjectShadow - { - protected unsafe class IAvnMenuEventsVtbl : SharpGen.Runtime.ComObjectShadow.ComObjectVtbl - { - public IAvnMenuEventsVtbl(int numberOfCallbackMethods): base (numberOfCallbackMethods + 1) - { - AddMethod(new NeedsUpdateDelegate(NeedsUpdate)); - } - - [System.Runtime.InteropServices.UnmanagedFunctionPointerAttribute(System.Runtime.InteropServices.CallingConvention.ThisCall)] - private delegate void NeedsUpdateDelegate(System.IntPtr thisObject); - private static unsafe void NeedsUpdate(System.IntPtr thisObject) - { - try - { - IAvnMenuEvents @this = (IAvnMenuEvents)ToShadow(thisObject).Callback; - @this.NeedsUpdate(); - } - catch (System.Exception __exception__) - { - IAvnMenuEvents @this = (IAvnMenuEvents)ToShadow(thisObject).Callback; - (@this as SharpGen.Runtime.IExceptionCallback)?.RaiseException(__exception__); - } - } - } - - protected override SharpGen.Runtime.CppObjectVtbl Vtbl - { - get; - } - - = new Avalonia.Native.Interop.IAvnMenuEventsShadow.IAvnMenuEventsVtbl(0); - } - - [System.Runtime.InteropServices.GuidAttribute("2e2cda0a-9ae5-4f1b-8e20-081a04279f1A"), SharpGen.Runtime.ShadowAttribute(typeof (Avalonia.Native.Interop.IAvnMenuEventsShadow))] - public partial interface IAvnMenuEvents : SharpGen.Runtime.IUnknown - { - void NeedsUpdate(); - } - - [System.Runtime.InteropServices.GuidAttribute("2e2cda0a-9ae5-4f1b-8e20-081a04279f19")] - public partial class IAvnMenuItem : SharpGen.Runtime.ComObject - { - public IAvnMenuItem(System.IntPtr nativePtr): base (nativePtr) - { - } - - public static explicit operator IAvnMenuItem(System.IntPtr nativePtr) => nativePtr == System.IntPtr.Zero ? null : new IAvnMenuItem(nativePtr); - /// - /// No documentation. - /// - /// SetSubMenu - /// SetSubMenu - public Avalonia.Native.Interop.IAvnMenu SubMenu - { - set => SetSubMenu(value); - } - - /// - /// No documentation. - /// - /// SetTitle - /// SetTitle - public System.IntPtr Title - { - set => SetTitle(value); - } - - /// - /// No documentation. - /// - /// SetIsChecked - /// SetIsChecked - public System.Boolean IsChecked - { - set => SetIsChecked(value); - } - - /// - /// No documentation. - /// - /// SetToggleType - /// SetToggleType - public Avalonia.Native.Interop.AvnMenuItemToggleType ToggleType - { - set => SetToggleType(value); - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// HRESULT IAvnMenuItem::SetSubMenu([In] IAvnMenu* menu) - /// IAvnMenuItem::SetSubMenu - internal unsafe void SetSubMenu(Avalonia.Native.Interop.IAvnMenu menu) - { - System.IntPtr menu_ = System.IntPtr.Zero; - SharpGen.Runtime.Result __result__; - menu_ = SharpGen.Runtime.CppObject.ToCallbackPtr(menu); - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, (void *)menu_, (*(void ***)this._nativePointer)[3]); - System.GC.KeepAlive(menu); - __result__.CheckError(); - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// HRESULT IAvnMenuItem::SetTitle([In] void* utf8String) - /// IAvnMenuItem::SetTitle - internal unsafe void SetTitle(System.IntPtr utf8String) - { - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, (void *)utf8String, (*(void ***)this._nativePointer)[4]); - __result__.CheckError(); - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// No documentation. - /// HRESULT IAvnMenuItem::SetGesture([In] void* utf8String,[In] AvnInputModifiers modifiers) - /// IAvnMenuItem::SetGesture - public unsafe void SetGesture(System.IntPtr utf8String, Avalonia.Native.Interop.AvnInputModifiers modifiers) - { - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, (void *)utf8String, unchecked ((System.Int32)modifiers), (*(void ***)this._nativePointer)[5]); - __result__.CheckError(); - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// No documentation. - /// HRESULT IAvnMenuItem::SetAction([In] IAvnPredicateCallback* predicate,[In] IAvnActionCallback* callback) - /// IAvnMenuItem::SetAction - public unsafe void SetAction(Avalonia.Native.Interop.IAvnPredicateCallback redicateRef, Avalonia.Native.Interop.IAvnActionCallback callback) - { - System.IntPtr redicateRef_ = System.IntPtr.Zero; - System.IntPtr callback_ = System.IntPtr.Zero; - SharpGen.Runtime.Result __result__; - redicateRef_ = SharpGen.Runtime.CppObject.ToCallbackPtr(redicateRef); - callback_ = SharpGen.Runtime.CppObject.ToCallbackPtr(callback); - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, (void *)redicateRef_, (void *)callback_, (*(void ***)this._nativePointer)[6]); - System.GC.KeepAlive(redicateRef); - System.GC.KeepAlive(callback); - __result__.CheckError(); - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// HRESULT IAvnMenuItem::SetIsChecked([In] bool isChecked) - /// IAvnMenuItem::SetIsChecked - internal unsafe void SetIsChecked(System.Boolean isChecked) - { - System.Byte isChecked_; - SharpGen.Runtime.Result __result__; - isChecked_ = (System.Byte)(isChecked ? 1 : 0); - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, isChecked_, (*(void ***)this._nativePointer)[7]); - __result__.CheckError(); - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// HRESULT IAvnMenuItem::SetToggleType([In] AvnMenuItemToggleType toggleType) - /// IAvnMenuItem::SetToggleType - internal unsafe void SetToggleType(Avalonia.Native.Interop.AvnMenuItemToggleType toggleType) - { - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, unchecked ((System.Int32)toggleType), (*(void ***)this._nativePointer)[8]); - __result__.CheckError(); - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// No documentation. - /// HRESULT IAvnMenuItem::SetIcon([In] void* data,[In] size_t length) - /// IAvnMenuItem::SetIcon - public unsafe void SetIcon(System.IntPtr data, SharpGen.Runtime.PointerSize length) - { - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, (void *)data, (void *)length, (*(void ***)this._nativePointer)[9]); - __result__.CheckError(); - } - } - - [System.Runtime.InteropServices.GuidAttribute("2e2cda0a-9ae5-4f1b-8e20-081a04279f20")] - public partial class IAvnNativeControlHost : SharpGen.Runtime.ComObject - { - public IAvnNativeControlHost(System.IntPtr nativePtr): base (nativePtr) - { - } - - public static explicit operator IAvnNativeControlHost(System.IntPtr nativePtr) => nativePtr == System.IntPtr.Zero ? null : new IAvnNativeControlHost(nativePtr); - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// HRESULT IAvnNativeControlHost::CreateDefaultChild([In] void* parent,[Out] void** retOut) - /// IAvnNativeControlHost::CreateDefaultChild - public unsafe System.IntPtr CreateDefaultChild(System.IntPtr arentRef) - { - System.IntPtr retOut; - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, (void *)arentRef, &retOut, (*(void ***)this._nativePointer)[3]); - __result__.CheckError(); - return retOut; - } - - /// - /// No documentation. - /// - /// No documentation. - /// IAvnNativeControlHostTopLevelAttachment* IAvnNativeControlHost::CreateAttachment() - /// IAvnNativeControlHost::CreateAttachment - public unsafe Avalonia.Native.Interop.IAvnNativeControlHostTopLevelAttachment CreateAttachment() - { - Avalonia.Native.Interop.IAvnNativeControlHostTopLevelAttachment __result__; - System.IntPtr __result__native = System.IntPtr.Zero; - __result__native = Avalonia.Native.LocalInterop.CalliThisCallSystemIntPtr(this._nativePointer, (*(void ***)this._nativePointer)[4]); - if (__result__native != System.IntPtr.Zero) - __result__ = new Avalonia.Native.Interop.IAvnNativeControlHostTopLevelAttachment(__result__native); - else - __result__ = null; - return __result__; - } - - /// - /// No documentation. - /// - /// No documentation. - /// void IAvnNativeControlHost::DestroyDefaultChild([In] void* child) - /// IAvnNativeControlHost::DestroyDefaultChild - public unsafe void DestroyDefaultChild(System.IntPtr child) - { - Avalonia.Native.LocalInterop.CalliThisCallvoid(this._nativePointer, (void *)child, (*(void ***)this._nativePointer)[5]); - } - } - - [System.Runtime.InteropServices.GuidAttribute("2e2cda0a-9ae5-4f1b-8e20-081a04279f21")] - public partial class IAvnNativeControlHostTopLevelAttachment : SharpGen.Runtime.ComObject - { - public IAvnNativeControlHostTopLevelAttachment(System.IntPtr nativePtr): base (nativePtr) - { - } - - public static explicit operator IAvnNativeControlHostTopLevelAttachment(System.IntPtr nativePtr) => nativePtr == System.IntPtr.Zero ? null : new IAvnNativeControlHostTopLevelAttachment(nativePtr); - /// - /// No documentation. - /// - /// GetParentHandle - /// GetParentHandle - public System.IntPtr ParentHandle - { - get => GetParentHandle(); - } - - /// - /// No documentation. - /// - /// No documentation. - /// void* IAvnNativeControlHostTopLevelAttachment::GetParentHandle() - /// IAvnNativeControlHostTopLevelAttachment::GetParentHandle - internal unsafe System.IntPtr GetParentHandle() - { - System.IntPtr __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallSystemIntPtr(this._nativePointer, (*(void ***)this._nativePointer)[3]); - return __result__; - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// HRESULT IAvnNativeControlHostTopLevelAttachment::InitializeWithChildHandle([In] void* child) - /// IAvnNativeControlHostTopLevelAttachment::InitializeWithChildHandle - public unsafe void InitializeWithChildHandle(System.IntPtr child) - { - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, (void *)child, (*(void ***)this._nativePointer)[4]); - __result__.CheckError(); - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// HRESULT IAvnNativeControlHostTopLevelAttachment::AttachTo([In] IAvnNativeControlHost* host) - /// IAvnNativeControlHostTopLevelAttachment::AttachTo - public unsafe void AttachTo(Avalonia.Native.Interop.IAvnNativeControlHost host) - { - System.IntPtr host_ = System.IntPtr.Zero; - SharpGen.Runtime.Result __result__; - host_ = SharpGen.Runtime.CppObject.ToCallbackPtr(host); - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, (void *)host_, (*(void ***)this._nativePointer)[5]); - System.GC.KeepAlive(host); - __result__.CheckError(); - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// No documentation. - /// No documentation. - /// void IAvnNativeControlHostTopLevelAttachment::ShowInBounds([In] float x,[In] float y,[In] float width,[In] float height) - /// IAvnNativeControlHostTopLevelAttachment::ShowInBounds - public unsafe void ShowInBounds(System.Single x, System.Single y, System.Single width, System.Single height) - { - Avalonia.Native.LocalInterop.CalliThisCallvoid(this._nativePointer, x, y, width, height, (*(void ***)this._nativePointer)[6]); - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// void IAvnNativeControlHostTopLevelAttachment::HideWithSize([In] float width,[In] float height) - /// IAvnNativeControlHostTopLevelAttachment::HideWithSize - public unsafe void HideWithSize(System.Single width, System.Single height) - { - Avalonia.Native.LocalInterop.CalliThisCallvoid(this._nativePointer, width, height, (*(void ***)this._nativePointer)[7]); - } - - /// - /// No documentation. - /// - /// void IAvnNativeControlHostTopLevelAttachment::ReleaseChild() - /// IAvnNativeControlHostTopLevelAttachment::ReleaseChild - public unsafe void ReleaseChild() - { - Avalonia.Native.LocalInterop.CalliThisCallvoid(this._nativePointer, (*(void ***)this._nativePointer)[8]); - } - } - - [System.Runtime.InteropServices.GuidAttribute("2e2cda0a-9ae5-4f1b-8e20-081a04279f0b")] - public partial class IAvnPlatformThreadingInterface : SharpGen.Runtime.ComObject - { - public IAvnPlatformThreadingInterface(System.IntPtr nativePtr): base (nativePtr) - { - } - - public static explicit operator IAvnPlatformThreadingInterface(System.IntPtr nativePtr) => nativePtr == System.IntPtr.Zero ? null : new IAvnPlatformThreadingInterface(nativePtr); - /// - /// No documentation. - /// - /// GetCurrentThreadIsLoopThread - /// GetCurrentThreadIsLoopThread - public System.Boolean CurrentThreadIsLoopThread - { - get => GetCurrentThreadIsLoopThread(); - } - - /// - /// No documentation. - /// - /// SetSignaledCallback - /// SetSignaledCallback - public Avalonia.Native.Interop.IAvnSignaledCallback SignaledCallback - { - set => SetSignaledCallback(value); - } - - /// - /// No documentation. - /// - /// No documentation. - /// bool IAvnPlatformThreadingInterface::GetCurrentThreadIsLoopThread() - /// IAvnPlatformThreadingInterface::GetCurrentThreadIsLoopThread - internal unsafe System.Boolean GetCurrentThreadIsLoopThread() - { - System.Boolean __result__; - System.Byte __result__native; - __result__native = Avalonia.Native.LocalInterop.CalliThisCallSystemByte(this._nativePointer, (*(void ***)this._nativePointer)[3]); - __result__ = __result__native != 0; - return __result__; - } - - /// - /// No documentation. - /// - /// No documentation. - /// void IAvnPlatformThreadingInterface::SetSignaledCallback([In] IAvnSignaledCallback* cb) - /// IAvnPlatformThreadingInterface::SetSignaledCallback - internal unsafe void SetSignaledCallback(Avalonia.Native.Interop.IAvnSignaledCallback cb) - { - System.IntPtr cb_ = System.IntPtr.Zero; - cb_ = SharpGen.Runtime.CppObject.ToCallbackPtr(cb); - Avalonia.Native.LocalInterop.CalliThisCallvoid(this._nativePointer, (void *)cb_, (*(void ***)this._nativePointer)[4]); - System.GC.KeepAlive(cb); - } - - /// - /// No documentation. - /// - /// No documentation. - /// IAvnLoopCancellation* IAvnPlatformThreadingInterface::CreateLoopCancellation() - /// IAvnPlatformThreadingInterface::CreateLoopCancellation - public unsafe Avalonia.Native.Interop.IAvnLoopCancellation CreateLoopCancellation() - { - Avalonia.Native.Interop.IAvnLoopCancellation __result__; - System.IntPtr __result__native = System.IntPtr.Zero; - __result__native = Avalonia.Native.LocalInterop.CalliThisCallSystemIntPtr(this._nativePointer, (*(void ***)this._nativePointer)[5]); - if (__result__native != System.IntPtr.Zero) - __result__ = new Avalonia.Native.Interop.IAvnLoopCancellation(__result__native); - else - __result__ = null; - return __result__; - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// HRESULT IAvnPlatformThreadingInterface::RunLoop([In] IAvnLoopCancellation* cancel) - /// IAvnPlatformThreadingInterface::RunLoop - public unsafe void RunLoop(Avalonia.Native.Interop.IAvnLoopCancellation cancel) - { - System.IntPtr cancel_ = System.IntPtr.Zero; - SharpGen.Runtime.Result __result__; - cancel_ = SharpGen.Runtime.CppObject.ToCallbackPtr(cancel); - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, (void *)cancel_, (*(void ***)this._nativePointer)[6]); - System.GC.KeepAlive(cancel); - __result__.CheckError(); - } - - /// - /// No documentation. - /// - /// No documentation. - /// void IAvnPlatformThreadingInterface::Signal([In] int priority) - /// IAvnPlatformThreadingInterface::Signal - public unsafe void Signal(System.Int32 priority) - { - Avalonia.Native.LocalInterop.CalliThisCallvoid(this._nativePointer, priority, (*(void ***)this._nativePointer)[7]); - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// No documentation. - /// No documentation. - /// IUnknown* IAvnPlatformThreadingInterface::StartTimer([In] int priority,[In] int ms,[In] IAvnActionCallback* callback) - /// IAvnPlatformThreadingInterface::StartTimer - public unsafe SharpGen.Runtime.ComObject StartTimer(System.Int32 priority, System.Int32 ms, Avalonia.Native.Interop.IAvnActionCallback callback) - { - System.IntPtr callback_ = System.IntPtr.Zero; - SharpGen.Runtime.ComObject __result__; - System.IntPtr __result__native = System.IntPtr.Zero; - callback_ = SharpGen.Runtime.CppObject.ToCallbackPtr(callback); - __result__native = Avalonia.Native.LocalInterop.CalliThisCallSystemIntPtr(this._nativePointer, priority, ms, (void *)callback_, (*(void ***)this._nativePointer)[8]); - if (__result__native != System.IntPtr.Zero) - __result__ = new SharpGen.Runtime.ComObject(__result__native); - else - __result__ = null; - System.GC.KeepAlive(callback); - return __result__; - } - } - - [System.Runtime.InteropServices.GuidAttribute("2e2cda0a-9ae5-4f1b-8e20-081a04279f03")] - public partial class IAvnPopup : Avalonia.Native.Interop.IAvnWindowBase - { - public IAvnPopup(System.IntPtr nativePtr): base (nativePtr) - { - } - - public static explicit operator IAvnPopup(System.IntPtr nativePtr) => nativePtr == System.IntPtr.Zero ? null : new IAvnPopup(nativePtr); - } - - class IAvnPredicateCallbackShadow : SharpGen.Runtime.ComObjectShadow - { - protected unsafe class IAvnPredicateCallbackVtbl : SharpGen.Runtime.ComObjectShadow.ComObjectVtbl - { - public IAvnPredicateCallbackVtbl(int numberOfCallbackMethods): base (numberOfCallbackMethods + 1) - { - AddMethod(new EvaluateDelegate(Evaluate)); - } - - [System.Runtime.InteropServices.UnmanagedFunctionPointerAttribute(System.Runtime.InteropServices.CallingConvention.ThisCall)] - private delegate System.Byte EvaluateDelegate(System.IntPtr thisObject); - private static unsafe System.Byte Evaluate(System.IntPtr thisObject) - { - try - { - System.Boolean __result__ = default (System.Boolean); - System.Byte __result__native; - IAvnPredicateCallback @this = (IAvnPredicateCallback)ToShadow(thisObject).Callback; - __result__ = @this.Evaluate(); - __result__native = (System.Byte)(__result__ ? 1 : 0); - return __result__native; - } - catch (System.Exception __exception__) - { - IAvnPredicateCallback @this = (IAvnPredicateCallback)ToShadow(thisObject).Callback; - (@this as SharpGen.Runtime.IExceptionCallback)?.RaiseException(__exception__); - return default (System.Byte); - } - } - } - - protected override SharpGen.Runtime.CppObjectVtbl Vtbl - { - get; - } - - = new Avalonia.Native.Interop.IAvnPredicateCallbackShadow.IAvnPredicateCallbackVtbl(0); - } - - [System.Runtime.InteropServices.GuidAttribute("2e2cda0a-9ae5-4f1b-8e20-081a04279f18"), SharpGen.Runtime.ShadowAttribute(typeof (Avalonia.Native.Interop.IAvnPredicateCallbackShadow))] - public partial interface IAvnPredicateCallback : SharpGen.Runtime.IUnknown - { - System.Boolean Evaluate(); - } - - [System.Runtime.InteropServices.GuidAttribute("2e2cda0a-9ae5-4f1b-8e20-081a04279f0e")] - public partial class IAvnScreens : SharpGen.Runtime.ComObject - { - public IAvnScreens(System.IntPtr nativePtr): base (nativePtr) - { - } - - public static explicit operator IAvnScreens(System.IntPtr nativePtr) => nativePtr == System.IntPtr.Zero ? null : new IAvnScreens(nativePtr); - /// - /// No documentation. - /// - /// No documentation. - /// HRESULT IAvnScreens::GetScreenCount([In] int* ret) - /// IAvnScreens::GetScreenCount - public unsafe System.Int32 GetScreenCount() - { - System.Int32 ret; - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, &ret, (*(void ***)this._nativePointer)[3]); - __result__.CheckError(); - return ret; - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// HRESULT IAvnScreens::GetScreen([In] int index,[In] AvnScreen* ret) - /// IAvnScreens::GetScreen - public unsafe Avalonia.Native.Interop.AvnScreen GetScreen(System.Int32 index) - { - Avalonia.Native.Interop.AvnScreen ret; - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, index, &ret, (*(void ***)this._nativePointer)[4]); - __result__.CheckError(); - return ret; - } - } - - class IAvnSignaledCallbackShadow : SharpGen.Runtime.ComObjectShadow - { - protected unsafe class IAvnSignaledCallbackVtbl : SharpGen.Runtime.ComObjectShadow.ComObjectVtbl - { - public IAvnSignaledCallbackVtbl(int numberOfCallbackMethods): base (numberOfCallbackMethods + 1) - { - AddMethod(new SignaledDelegate(Signaled)); - } - - [System.Runtime.InteropServices.UnmanagedFunctionPointerAttribute(System.Runtime.InteropServices.CallingConvention.ThisCall)] - private delegate void SignaledDelegate(System.IntPtr thisObject, int arg0, System.Byte arg1); - private static unsafe void Signaled(System.IntPtr thisObject, int param0, System.Byte param1) - { - try - { - System.Int32 priority = default (System.Int32); - priority = (System.Int32)param0; - System.Boolean priorityContainsMeaningfulValue = default (System.Boolean); - System.Byte priorityContainsMeaningfulValue_ = (System.Byte)param1; - IAvnSignaledCallback @this = (IAvnSignaledCallback)ToShadow(thisObject).Callback; - priorityContainsMeaningfulValue = priorityContainsMeaningfulValue_ != 0; - @this.Signaled(priority, priorityContainsMeaningfulValue); - } - catch (System.Exception __exception__) - { - IAvnSignaledCallback @this = (IAvnSignaledCallback)ToShadow(thisObject).Callback; - (@this as SharpGen.Runtime.IExceptionCallback)?.RaiseException(__exception__); - } - } - } - - protected override SharpGen.Runtime.CppObjectVtbl Vtbl - { - get; - } - - = new Avalonia.Native.Interop.IAvnSignaledCallbackShadow.IAvnSignaledCallbackVtbl(0); - } - - [System.Runtime.InteropServices.GuidAttribute("2e2cda0a-9ae5-4f1b-8e20-081a04279f09"), SharpGen.Runtime.ShadowAttribute(typeof (Avalonia.Native.Interop.IAvnSignaledCallbackShadow))] - public partial interface IAvnSignaledCallback : SharpGen.Runtime.IUnknown - { - void Signaled(System.Int32 priority, System.Boolean priorityContainsMeaningfulValue); - } - - [System.Runtime.InteropServices.GuidAttribute("2e2cda0a-9ae5-4f1b-8e20-081a04279f17")] - public partial class IAvnString : SharpGen.Runtime.ComObject - { - public IAvnString(System.IntPtr nativePtr): base (nativePtr) - { - } - - public static explicit operator IAvnString(System.IntPtr nativePtr) => nativePtr == System.IntPtr.Zero ? null : new IAvnString(nativePtr); - /// - /// No documentation. - /// - /// No documentation. - /// HRESULT IAvnString::Pointer([Out] void** retOut) - /// IAvnString::Pointer - public unsafe System.IntPtr Pointer() - { - System.IntPtr retOut; - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, &retOut, (*(void ***)this._nativePointer)[3]); - __result__.CheckError(); - return retOut; - } - - /// - /// No documentation. - /// - /// No documentation. - /// HRESULT IAvnString::Length([In] int* ret) - /// IAvnString::Length - public unsafe System.Int32 Length() - { - System.Int32 ret; - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, &ret, (*(void ***)this._nativePointer)[4]); - __result__.CheckError(); - return ret; - } - } - - [System.Runtime.InteropServices.GuidAttribute("2e2cda0a-9ae5-4f1b-8e20-081a04279f20")] - public partial class IAvnStringArray : SharpGen.Runtime.ComObject - { - public IAvnStringArray(System.IntPtr nativePtr): base (nativePtr) - { - } - - public static explicit operator IAvnStringArray(System.IntPtr nativePtr) => nativePtr == System.IntPtr.Zero ? null : new IAvnStringArray(nativePtr); - /// - /// No documentation. - /// - /// GetCount - /// GetCount - public System.UInt32 Count - { - get => GetCount(); - } - - /// - /// No documentation. - /// - /// No documentation. - /// unsigned int IAvnStringArray::GetCount() - /// IAvnStringArray::GetCount - internal unsafe System.UInt32 GetCount() - { - System.UInt32 __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallSystemUInt32(this._nativePointer, (*(void ***)this._nativePointer)[3]); - return __result__; - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// HRESULT IAvnStringArray::Get([In] unsigned int index,[In] IAvnString** ppv) - /// IAvnStringArray::Get - public unsafe Avalonia.Native.Interop.IAvnString Get(System.UInt32 index) - { - Avalonia.Native.Interop.IAvnString vOut; - System.IntPtr vOut_ = System.IntPtr.Zero; - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, index, &vOut_, (*(void ***)this._nativePointer)[4]); - if (vOut_ != System.IntPtr.Zero) - vOut = new Avalonia.Native.Interop.IAvnString(vOut_); - else - vOut = null; - __result__.CheckError(); - return vOut; - } - } - - class IAvnSystemDialogEventsShadow : SharpGen.Runtime.ComObjectShadow - { - protected unsafe class IAvnSystemDialogEventsVtbl : SharpGen.Runtime.ComObjectShadow.ComObjectVtbl - { - public IAvnSystemDialogEventsVtbl(int numberOfCallbackMethods): base (numberOfCallbackMethods + 1) - { - AddMethod(new OnCompletedDelegate(OnCompleted)); - } - - [System.Runtime.InteropServices.UnmanagedFunctionPointerAttribute(System.Runtime.InteropServices.CallingConvention.ThisCall)] - private delegate void OnCompletedDelegate(System.IntPtr thisObject, int arg0, void *arg1); - private static unsafe void OnCompleted(System.IntPtr thisObject, int param0, void *param1) - { - try - { - System.Int32 numResults = default (System.Int32); - numResults = (System.Int32)param0; - System.IntPtr trFirstResultRef = default (System.IntPtr); - trFirstResultRef = (System.IntPtr)param1; - IAvnSystemDialogEvents @this = (IAvnSystemDialogEvents)ToShadow(thisObject).Callback; - @this.OnCompleted(numResults, trFirstResultRef); - } - catch (System.Exception __exception__) - { - IAvnSystemDialogEvents @this = (IAvnSystemDialogEvents)ToShadow(thisObject).Callback; - (@this as SharpGen.Runtime.IExceptionCallback)?.RaiseException(__exception__); - } - } - } - - protected override SharpGen.Runtime.CppObjectVtbl Vtbl - { - get; - } - - = new Avalonia.Native.Interop.IAvnSystemDialogEventsShadow.IAvnSystemDialogEventsVtbl(0); - } - - [System.Runtime.InteropServices.GuidAttribute("2e2cda0a-9ae5-4f1b-8e20-081a04279f0c"), SharpGen.Runtime.ShadowAttribute(typeof (Avalonia.Native.Interop.IAvnSystemDialogEventsShadow))] - public partial interface IAvnSystemDialogEvents : SharpGen.Runtime.IUnknown - { - void OnCompleted(System.Int32 numResults, System.IntPtr trFirstResultRef); - } - - [System.Runtime.InteropServices.GuidAttribute("2e2cda0a-9ae5-4f1b-8e20-081a04279f0d")] - public partial class IAvnSystemDialogs : SharpGen.Runtime.ComObject - { - public IAvnSystemDialogs(System.IntPtr nativePtr): base (nativePtr) - { - } - - public static explicit operator IAvnSystemDialogs(System.IntPtr nativePtr) => nativePtr == System.IntPtr.Zero ? null : new IAvnSystemDialogs(nativePtr); - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// No documentation. - /// No documentation. - /// void IAvnSystemDialogs::SelectFolderDialog([In] IAvnWindow* parentWindowHandle,[In] IAvnSystemDialogEvents* events,[In] const char* title,[In] const char* initialPath) - /// IAvnSystemDialogs::SelectFolderDialog - public unsafe void SelectFolderDialog(Avalonia.Native.Interop.IAvnWindow arentWindowHandleRef, Avalonia.Native.Interop.IAvnSystemDialogEvents events, System.String title, System.String initialPath) - { - System.IntPtr arentWindowHandleRef_ = System.IntPtr.Zero; - System.IntPtr events_ = System.IntPtr.Zero; - System.IntPtr title_; - System.IntPtr initialPath_; - arentWindowHandleRef_ = SharpGen.Runtime.CppObject.ToCallbackPtr(arentWindowHandleRef); - events_ = SharpGen.Runtime.CppObject.ToCallbackPtr(events); - title_ = System.Runtime.InteropServices.Marshal.StringToHGlobalAnsi(title); - initialPath_ = System.Runtime.InteropServices.Marshal.StringToHGlobalAnsi(initialPath); - Avalonia.Native.LocalInterop.CalliThisCallvoid(this._nativePointer, (void *)arentWindowHandleRef_, (void *)events_, (void *)title_, (void *)initialPath_, (*(void ***)this._nativePointer)[3]); - System.GC.KeepAlive(arentWindowHandleRef); - System.GC.KeepAlive(events); - System.Runtime.InteropServices.Marshal.FreeHGlobal(title_); - System.Runtime.InteropServices.Marshal.FreeHGlobal(initialPath_); - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// No documentation. - /// No documentation. - /// No documentation. - /// No documentation. - /// No documentation. - /// void IAvnSystemDialogs::OpenFileDialog([In] IAvnWindow* parentWindowHandle,[In] IAvnSystemDialogEvents* events,[In] bool allowMultiple,[In] const char* title,[In] const char* initialDirectory,[In] const char* initialFile,[In] const char* filters) - /// IAvnSystemDialogs::OpenFileDialog - public unsafe void OpenFileDialog(Avalonia.Native.Interop.IAvnWindow arentWindowHandleRef, Avalonia.Native.Interop.IAvnSystemDialogEvents events, System.Boolean allowMultiple, System.String title, System.String initialDirectory, System.String initialFile, System.String filters) - { - System.IntPtr arentWindowHandleRef_ = System.IntPtr.Zero; - System.IntPtr events_ = System.IntPtr.Zero; - System.Byte allowMultiple_; - System.IntPtr title_; - System.IntPtr initialDirectory_; - System.IntPtr initialFile_; - System.IntPtr filters_; - arentWindowHandleRef_ = SharpGen.Runtime.CppObject.ToCallbackPtr(arentWindowHandleRef); - events_ = SharpGen.Runtime.CppObject.ToCallbackPtr(events); - allowMultiple_ = (System.Byte)(allowMultiple ? 1 : 0); - title_ = System.Runtime.InteropServices.Marshal.StringToHGlobalAnsi(title); - initialDirectory_ = System.Runtime.InteropServices.Marshal.StringToHGlobalAnsi(initialDirectory); - initialFile_ = System.Runtime.InteropServices.Marshal.StringToHGlobalAnsi(initialFile); - filters_ = System.Runtime.InteropServices.Marshal.StringToHGlobalAnsi(filters); - Avalonia.Native.LocalInterop.CalliThisCallvoid(this._nativePointer, (void *)arentWindowHandleRef_, (void *)events_, allowMultiple_, (void *)title_, (void *)initialDirectory_, (void *)initialFile_, (void *)filters_, (*(void ***)this._nativePointer)[4]); - System.GC.KeepAlive(arentWindowHandleRef); - System.GC.KeepAlive(events); - System.Runtime.InteropServices.Marshal.FreeHGlobal(title_); - System.Runtime.InteropServices.Marshal.FreeHGlobal(initialDirectory_); - System.Runtime.InteropServices.Marshal.FreeHGlobal(initialFile_); - System.Runtime.InteropServices.Marshal.FreeHGlobal(filters_); - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// No documentation. - /// No documentation. - /// No documentation. - /// No documentation. - /// void IAvnSystemDialogs::SaveFileDialog([In] IAvnWindow* parentWindowHandle,[In] IAvnSystemDialogEvents* events,[In] const char* title,[In] const char* initialDirectory,[In] const char* initialFile,[In] const char* filters) - /// IAvnSystemDialogs::SaveFileDialog - public unsafe void SaveFileDialog(Avalonia.Native.Interop.IAvnWindow arentWindowHandleRef, Avalonia.Native.Interop.IAvnSystemDialogEvents events, System.String title, System.String initialDirectory, System.String initialFile, System.String filters) - { - System.IntPtr arentWindowHandleRef_ = System.IntPtr.Zero; - System.IntPtr events_ = System.IntPtr.Zero; - System.IntPtr title_; - System.IntPtr initialDirectory_; - System.IntPtr initialFile_; - System.IntPtr filters_; - arentWindowHandleRef_ = SharpGen.Runtime.CppObject.ToCallbackPtr(arentWindowHandleRef); - events_ = SharpGen.Runtime.CppObject.ToCallbackPtr(events); - title_ = System.Runtime.InteropServices.Marshal.StringToHGlobalAnsi(title); - initialDirectory_ = System.Runtime.InteropServices.Marshal.StringToHGlobalAnsi(initialDirectory); - initialFile_ = System.Runtime.InteropServices.Marshal.StringToHGlobalAnsi(initialFile); - filters_ = System.Runtime.InteropServices.Marshal.StringToHGlobalAnsi(filters); - Avalonia.Native.LocalInterop.CalliThisCallvoid(this._nativePointer, (void *)arentWindowHandleRef_, (void *)events_, (void *)title_, (void *)initialDirectory_, (void *)initialFile_, (void *)filters_, (*(void ***)this._nativePointer)[5]); - System.GC.KeepAlive(arentWindowHandleRef); - System.GC.KeepAlive(events); - System.Runtime.InteropServices.Marshal.FreeHGlobal(title_); - System.Runtime.InteropServices.Marshal.FreeHGlobal(initialDirectory_); - System.Runtime.InteropServices.Marshal.FreeHGlobal(initialFile_); - System.Runtime.InteropServices.Marshal.FreeHGlobal(filters_); - } - } - - [System.Runtime.InteropServices.GuidAttribute("2e2cda0a-9ae5-4f1b-8e20-081a04279f04")] - public partial class IAvnWindow : Avalonia.Native.Interop.IAvnWindowBase - { - public IAvnWindow(System.IntPtr nativePtr): base (nativePtr) - { - } - - public static explicit operator IAvnWindow(System.IntPtr nativePtr) => nativePtr == System.IntPtr.Zero ? null : new IAvnWindow(nativePtr); - /// - /// No documentation. - /// - /// SetEnabled - /// SetEnabled - public System.Boolean Enabled - { - set => SetEnabled(value); - } - - /// - /// No documentation. - /// - /// SetParent - /// SetParent - public Avalonia.Native.Interop.IAvnWindow Parent - { - set => SetParent(value); - } - - /// - /// No documentation. - /// - /// SetCanResize - /// SetCanResize - public System.Boolean CanResize - { - set => SetCanResize(value); - } - - /// - /// No documentation. - /// - /// SetDecorations - /// SetDecorations - public Avalonia.Native.Interop.SystemDecorations Decorations - { - set => SetDecorations(value); - } - - /// - /// No documentation. - /// - /// SetTitle - /// SetTitle - public System.IntPtr Title - { - set => SetTitle(value); - } - - /// - /// No documentation. - /// - /// SetTitleBarColor - /// SetTitleBarColor - public Avalonia.Native.Interop.AvnColor TitleBarColor - { - set => SetTitleBarColor(value); - } - - /// - /// No documentation. - /// - /// SetExtendClientArea - /// SetExtendClientArea - public System.Boolean ExtendClientArea - { - set => SetExtendClientArea(value); - } - - /// - /// No documentation. - /// - /// SetExtendClientAreaHints - /// SetExtendClientAreaHints - public Avalonia.Native.Interop.AvnExtendClientAreaChromeHints ExtendClientAreaHints - { - set => SetExtendClientAreaHints(value); - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// HRESULT IAvnWindow::SetEnabled([In] bool enable) - /// IAvnWindow::SetEnabled - internal unsafe void SetEnabled(System.Boolean enable) - { - System.Byte enable_; - SharpGen.Runtime.Result __result__; - enable_ = (System.Byte)(enable ? 1 : 0); - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, enable_, (*(void ***)this._nativePointer)[30]); - __result__.CheckError(); - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// HRESULT IAvnWindow::SetParent([In] IAvnWindow* parent) - /// IAvnWindow::SetParent - internal unsafe void SetParent(Avalonia.Native.Interop.IAvnWindow arentRef) - { - System.IntPtr arentRef_ = System.IntPtr.Zero; - SharpGen.Runtime.Result __result__; - arentRef_ = SharpGen.Runtime.CppObject.ToCallbackPtr(arentRef); - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, (void *)arentRef_, (*(void ***)this._nativePointer)[31]); - System.GC.KeepAlive(arentRef); - __result__.CheckError(); - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// HRESULT IAvnWindow::SetCanResize([In] bool value) - /// IAvnWindow::SetCanResize - internal unsafe void SetCanResize(System.Boolean value) - { - System.Byte value_; - SharpGen.Runtime.Result __result__; - value_ = (System.Byte)(value ? 1 : 0); - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, value_, (*(void ***)this._nativePointer)[32]); - __result__.CheckError(); - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// HRESULT IAvnWindow::SetDecorations([In] SystemDecorations value) - /// IAvnWindow::SetDecorations - internal unsafe void SetDecorations(Avalonia.Native.Interop.SystemDecorations value) - { - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, unchecked ((System.Int32)value), (*(void ***)this._nativePointer)[33]); - __result__.CheckError(); - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// HRESULT IAvnWindow::SetTitle([In] void* utf8Title) - /// IAvnWindow::SetTitle - internal unsafe void SetTitle(System.IntPtr utf8Title) - { - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, (void *)utf8Title, (*(void ***)this._nativePointer)[34]); - __result__.CheckError(); - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// HRESULT IAvnWindow::SetTitleBarColor([In] AvnColor color) - /// IAvnWindow::SetTitleBarColor - internal unsafe void SetTitleBarColor(Avalonia.Native.Interop.AvnColor color) - { - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint0(this._nativePointer, color, (*(void ***)this._nativePointer)[35]); - __result__.CheckError(); - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// HRESULT IAvnWindow::SetWindowState([In] AvnWindowState state) - /// IAvnWindow::SetWindowState - public unsafe void SetWindowState(Avalonia.Native.Interop.AvnWindowState state) - { - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, unchecked ((System.Int32)state), (*(void ***)this._nativePointer)[36]); - __result__.CheckError(); - } - - /// - /// No documentation. - /// - /// No documentation. - /// HRESULT IAvnWindow::GetWindowState([In] AvnWindowState* ret) - /// IAvnWindow::GetWindowState - public unsafe Avalonia.Native.Interop.AvnWindowState GetWindowState() - { - Avalonia.Native.Interop.AvnWindowState ret; - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, &ret, (*(void ***)this._nativePointer)[37]); - __result__.CheckError(); - return ret; - } - - /// - /// No documentation. - /// - /// No documentation. - /// HRESULT IAvnWindow::TakeFocusFromChildren() - /// IAvnWindow::TakeFocusFromChildren - public unsafe void TakeFocusFromChildren() - { - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, (*(void ***)this._nativePointer)[38]); - __result__.CheckError(); - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// HRESULT IAvnWindow::SetExtendClientArea([In] bool enable) - /// IAvnWindow::SetExtendClientArea - internal unsafe void SetExtendClientArea(System.Boolean enable) - { - System.Byte enable_; - SharpGen.Runtime.Result __result__; - enable_ = (System.Byte)(enable ? 1 : 0); - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, enable_, (*(void ***)this._nativePointer)[39]); - __result__.CheckError(); - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// HRESULT IAvnWindow::SetExtendClientAreaHints([In] AvnExtendClientAreaChromeHints hints) - /// IAvnWindow::SetExtendClientAreaHints - internal unsafe void SetExtendClientAreaHints(Avalonia.Native.Interop.AvnExtendClientAreaChromeHints hints) - { - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, unchecked ((System.Int32)hints), (*(void ***)this._nativePointer)[40]); - __result__.CheckError(); - } - - /// - /// No documentation. - /// - /// No documentation. - /// HRESULT IAvnWindow::GetExtendTitleBarHeight([In] double* ret) - /// IAvnWindow::GetExtendTitleBarHeight - public unsafe System.Double GetExtendTitleBarHeight() - { - System.Double ret; - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, &ret, (*(void ***)this._nativePointer)[41]); - __result__.CheckError(); - return ret; - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// HRESULT IAvnWindow::SetExtendTitleBarHeight([In] double value) - /// IAvnWindow::SetExtendTitleBarHeight - public unsafe void SetExtendTitleBarHeight(System.Double value) - { - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, value, (*(void ***)this._nativePointer)[42]); - __result__.CheckError(); - } - } - - [System.Runtime.InteropServices.GuidAttribute("2e2cda0a-9ae5-4f1b-8e20-081a04279f02")] - public partial class IAvnWindowBase : SharpGen.Runtime.ComObject - { - public IAvnWindowBase(System.IntPtr nativePtr): base (nativePtr) - { - } - - public static explicit operator IAvnWindowBase(System.IntPtr nativePtr) => nativePtr == System.IntPtr.Zero ? null : new IAvnWindowBase(nativePtr); - /// - /// No documentation. - /// - /// SetTopMost - /// SetTopMost - public System.Boolean TopMost - { - set => SetTopMost(value); - } - - /// - /// No documentation. - /// - /// SetCursor - /// SetCursor - public Avalonia.Native.Interop.IAvnCursor Cursor - { - set => SetCursor(value); - } - - /// - /// No documentation. - /// - /// SetMainMenu - /// SetMainMenu - public Avalonia.Native.Interop.IAvnMenu MainMenu - { - set => SetMainMenu(value); - } - - /// - /// No documentation. - /// - /// SetBlurEnabled - /// SetBlurEnabled - public System.Boolean BlurEnabled - { - set => SetBlurEnabled(value); - } - - /// - /// No documentation. - /// - /// No documentation. - /// HRESULT IAvnWindowBase::Show() - /// IAvnWindowBase::Show - public unsafe void Show() - { - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, (*(void ***)this._nativePointer)[3]); - __result__.CheckError(); - } - - /// - /// No documentation. - /// - /// No documentation. - /// HRESULT IAvnWindowBase::Hide() - /// IAvnWindowBase::Hide - public unsafe void Hide() - { - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, (*(void ***)this._nativePointer)[4]); - __result__.CheckError(); - } - - /// - /// No documentation. - /// - /// No documentation. - /// HRESULT IAvnWindowBase::Close() - /// IAvnWindowBase::Close - public unsafe void Close() - { - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, (*(void ***)this._nativePointer)[5]); - __result__.CheckError(); - } - - /// - /// No documentation. - /// - /// No documentation. - /// HRESULT IAvnWindowBase::Activate() - /// IAvnWindowBase::Activate - public unsafe void Activate() - { - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, (*(void ***)this._nativePointer)[6]); - __result__.CheckError(); - } - - /// - /// No documentation. - /// - /// No documentation. - /// HRESULT IAvnWindowBase::GetClientSize([In] AvnSize* ret) - /// IAvnWindowBase::GetClientSize - public unsafe Avalonia.Native.Interop.AvnSize GetClientSize() - { - Avalonia.Native.Interop.AvnSize ret; - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, &ret, (*(void ***)this._nativePointer)[7]); - __result__.CheckError(); - return ret; - } - - /// - /// No documentation. - /// - /// No documentation. - /// HRESULT IAvnWindowBase::GetScaling([In] double* ret) - /// IAvnWindowBase::GetScaling - public unsafe System.Double GetScaling() - { - System.Double ret; - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, &ret, (*(void ***)this._nativePointer)[8]); - __result__.CheckError(); - return ret; - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// No documentation. - /// HRESULT IAvnWindowBase::SetMinMaxSize([In] AvnSize minSize,[In] AvnSize maxSize) - /// IAvnWindowBase::SetMinMaxSize - public unsafe void SetMinMaxSize(Avalonia.Native.Interop.AvnSize minSize, Avalonia.Native.Interop.AvnSize maxSize) - { - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint0(this._nativePointer, minSize, maxSize, (*(void ***)this._nativePointer)[9]); - __result__.CheckError(); - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// No documentation. - /// HRESULT IAvnWindowBase::Resize([In] double width,[In] double height) - /// IAvnWindowBase::Resize - public unsafe void Resize(System.Double width, System.Double height) - { - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, width, height, (*(void ***)this._nativePointer)[10]); - __result__.CheckError(); - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// HRESULT IAvnWindowBase::Invalidate([In] AvnRect rect) - /// IAvnWindowBase::Invalidate - public unsafe void Invalidate(Avalonia.Native.Interop.AvnRect rect) - { - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint0(this._nativePointer, rect, (*(void ***)this._nativePointer)[11]); - __result__.CheckError(); - } - - /// - /// No documentation. - /// - /// No documentation. - /// HRESULT IAvnWindowBase::BeginMoveDrag() - /// IAvnWindowBase::BeginMoveDrag - public unsafe void BeginMoveDrag() - { - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, (*(void ***)this._nativePointer)[12]); - __result__.CheckError(); - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// HRESULT IAvnWindowBase::BeginResizeDrag([In] AvnWindowEdge edge) - /// IAvnWindowBase::BeginResizeDrag - public unsafe void BeginResizeDrag(Avalonia.Native.Interop.AvnWindowEdge edge) - { - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, unchecked ((System.Int32)edge), (*(void ***)this._nativePointer)[13]); - __result__.CheckError(); - } - - /// - /// No documentation. - /// - /// No documentation. - /// HRESULT IAvnWindowBase::GetPosition([In] AvnPoint* ret) - /// IAvnWindowBase::GetPosition - public unsafe Avalonia.Native.Interop.AvnPoint GetPosition() - { - Avalonia.Native.Interop.AvnPoint ret; - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, &ret, (*(void ***)this._nativePointer)[14]); - __result__.CheckError(); - return ret; - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// HRESULT IAvnWindowBase::SetPosition([In] AvnPoint point) - /// IAvnWindowBase::SetPosition - public unsafe void SetPosition(Avalonia.Native.Interop.AvnPoint point) - { - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint0(this._nativePointer, point, (*(void ***)this._nativePointer)[15]); - __result__.CheckError(); - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// HRESULT IAvnWindowBase::PointToClient([In] AvnPoint point,[In] AvnPoint* ret) - /// IAvnWindowBase::PointToClient - public unsafe Avalonia.Native.Interop.AvnPoint PointToClient(Avalonia.Native.Interop.AvnPoint point) - { - Avalonia.Native.Interop.AvnPoint ret; - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint0(this._nativePointer, point, &ret, (*(void ***)this._nativePointer)[16]); - __result__.CheckError(); - return ret; - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// HRESULT IAvnWindowBase::PointToScreen([In] AvnPoint point,[In] AvnPoint* ret) - /// IAvnWindowBase::PointToScreen - public unsafe Avalonia.Native.Interop.AvnPoint PointToScreen(Avalonia.Native.Interop.AvnPoint point) - { - Avalonia.Native.Interop.AvnPoint ret; - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint0(this._nativePointer, point, &ret, (*(void ***)this._nativePointer)[17]); - __result__.CheckError(); - return ret; - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// No documentation. - /// HRESULT IAvnWindowBase::ThreadSafeSetSwRenderedFrame([In] AvnFramebuffer* fb,[In] IUnknown* dispose) - /// IAvnWindowBase::ThreadSafeSetSwRenderedFrame - public unsafe void ThreadSafeSetSwRenderedFrame(ref Avalonia.Native.Interop.AvnFramebuffer fb, SharpGen.Runtime.IUnknown dispose) - { - System.IntPtr dispose_ = System.IntPtr.Zero; - SharpGen.Runtime.Result __result__; - dispose_ = SharpGen.Runtime.CppObject.ToCallbackPtr(dispose); - fixed (void *fb_ = &fb) - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, fb_, (void *)dispose_, (*(void ***)this._nativePointer)[18]); - System.GC.KeepAlive(dispose); - __result__.CheckError(); - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// HRESULT IAvnWindowBase::SetTopMost([In] bool value) - /// IAvnWindowBase::SetTopMost - internal unsafe void SetTopMost(System.Boolean value) - { - System.Byte value_; - SharpGen.Runtime.Result __result__; - value_ = (System.Byte)(value ? 1 : 0); - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, value_, (*(void ***)this._nativePointer)[19]); - __result__.CheckError(); - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// HRESULT IAvnWindowBase::SetCursor([In] IAvnCursor* cursor) - /// IAvnWindowBase::SetCursor - internal unsafe void SetCursor(Avalonia.Native.Interop.IAvnCursor cursor) - { - System.IntPtr cursor_ = System.IntPtr.Zero; - SharpGen.Runtime.Result __result__; - cursor_ = SharpGen.Runtime.CppObject.ToCallbackPtr(cursor); - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, (void *)cursor_, (*(void ***)this._nativePointer)[20]); - System.GC.KeepAlive(cursor); - __result__.CheckError(); - } - - /// - /// No documentation. - /// - /// No documentation. - /// HRESULT IAvnWindowBase::CreateGlRenderTarget([In] IAvnGlSurfaceRenderTarget** ret) - /// IAvnWindowBase::CreateGlRenderTarget - public unsafe Avalonia.Native.Interop.IAvnGlSurfaceRenderTarget CreateGlRenderTarget() - { - Avalonia.Native.Interop.IAvnGlSurfaceRenderTarget ret; - System.IntPtr ret_ = System.IntPtr.Zero; - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, &ret_, (*(void ***)this._nativePointer)[21]); - if (ret_ != System.IntPtr.Zero) - ret = new Avalonia.Native.Interop.IAvnGlSurfaceRenderTarget(ret_); - else - ret = null; - __result__.CheckError(); - return ret; - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// HRESULT IAvnWindowBase::SetMainMenu([In] IAvnMenu* menu) - /// IAvnWindowBase::SetMainMenu - internal unsafe void SetMainMenu(Avalonia.Native.Interop.IAvnMenu menu) - { - System.IntPtr menu_ = System.IntPtr.Zero; - SharpGen.Runtime.Result __result__; - menu_ = SharpGen.Runtime.CppObject.ToCallbackPtr(menu); - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, (void *)menu_, (*(void ***)this._nativePointer)[22]); - System.GC.KeepAlive(menu); - __result__.CheckError(); - } - - /// - /// No documentation. - /// - /// No documentation. - /// HRESULT IAvnWindowBase::ObtainNSWindowHandle([Out] void** retOut) - /// IAvnWindowBase::ObtainNSWindowHandle - public unsafe System.IntPtr ObtainNSWindowHandle() - { - System.IntPtr retOut; - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, &retOut, (*(void ***)this._nativePointer)[23]); - __result__.CheckError(); - return retOut; - } - - /// - /// No documentation. - /// - /// No documentation. - /// HRESULT IAvnWindowBase::ObtainNSWindowHandleRetained([Out] void** retOut) - /// IAvnWindowBase::ObtainNSWindowHandleRetained - public unsafe System.IntPtr ObtainNSWindowHandleRetained() - { - System.IntPtr retOut; - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, &retOut, (*(void ***)this._nativePointer)[24]); - __result__.CheckError(); - return retOut; - } - - /// - /// No documentation. - /// - /// No documentation. - /// HRESULT IAvnWindowBase::ObtainNSViewHandle([Out] void** retOut) - /// IAvnWindowBase::ObtainNSViewHandle - public unsafe System.IntPtr ObtainNSViewHandle() - { - System.IntPtr retOut; - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, &retOut, (*(void ***)this._nativePointer)[25]); - __result__.CheckError(); - return retOut; - } - - /// - /// No documentation. - /// - /// No documentation. - /// HRESULT IAvnWindowBase::ObtainNSViewHandleRetained([Out] void** retOut) - /// IAvnWindowBase::ObtainNSViewHandleRetained - public unsafe System.IntPtr ObtainNSViewHandleRetained() - { - System.IntPtr retOut; - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, &retOut, (*(void ***)this._nativePointer)[26]); - __result__.CheckError(); - return retOut; - } - - /// - /// No documentation. - /// - /// No documentation. - /// HRESULT IAvnWindowBase::CreateNativeControlHost([Out] IAvnNativeControlHost** retOut) - /// IAvnWindowBase::CreateNativeControlHost - public unsafe Avalonia.Native.Interop.IAvnNativeControlHost CreateNativeControlHost() - { - Avalonia.Native.Interop.IAvnNativeControlHost retOut; - System.IntPtr retOut_ = System.IntPtr.Zero; - SharpGen.Runtime.Result __result__; - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, &retOut_, (*(void ***)this._nativePointer)[27]); - if (retOut_ != System.IntPtr.Zero) - retOut = new Avalonia.Native.Interop.IAvnNativeControlHost(retOut_); - else - retOut = null; - __result__.CheckError(); - return retOut; - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// No documentation. - /// No documentation. - /// No documentation. - /// No documentation. - /// HRESULT IAvnWindowBase::BeginDragAndDropOperation([In] AvnDragDropEffects effects,[In] AvnPoint point,[In] IAvnClipboard* clipboard,[In] IAvnDndResultCallback* cb,[In] void* sourceHandle) - /// IAvnWindowBase::BeginDragAndDropOperation - public unsafe void BeginDragAndDropOperation(Avalonia.Native.Interop.AvnDragDropEffects effects, Avalonia.Native.Interop.AvnPoint point, Avalonia.Native.Interop.IAvnClipboard clipboard, Avalonia.Native.Interop.IAvnDndResultCallback cb, System.IntPtr sourceHandle) - { - System.IntPtr clipboard_ = System.IntPtr.Zero; - System.IntPtr cb_ = System.IntPtr.Zero; - SharpGen.Runtime.Result __result__; - clipboard_ = SharpGen.Runtime.CppObject.ToCallbackPtr(clipboard); - cb_ = SharpGen.Runtime.CppObject.ToCallbackPtr(cb); - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint0(this._nativePointer, unchecked ((System.Int32)effects), point, (void *)clipboard_, (void *)cb_, (void *)sourceHandle, (*(void ***)this._nativePointer)[28]); - System.GC.KeepAlive(clipboard); - System.GC.KeepAlive(cb); - __result__.CheckError(); - } - - /// - /// No documentation. - /// - /// No documentation. - /// No documentation. - /// HRESULT IAvnWindowBase::SetBlurEnabled([In] bool enable) - /// IAvnWindowBase::SetBlurEnabled - internal unsafe void SetBlurEnabled(System.Boolean enable) - { - System.Byte enable_; - SharpGen.Runtime.Result __result__; - enable_ = (System.Byte)(enable ? 1 : 0); - __result__ = Avalonia.Native.LocalInterop.CalliThisCallint(this._nativePointer, enable_, (*(void ***)this._nativePointer)[29]); - __result__.CheckError(); - } - } - - class IAvnWindowBaseEventsShadow : SharpGen.Runtime.ComObjectShadow - { - protected unsafe class IAvnWindowBaseEventsVtbl : SharpGen.Runtime.ComObjectShadow.ComObjectVtbl - { - public IAvnWindowBaseEventsVtbl(int numberOfCallbackMethods): base (numberOfCallbackMethods + 13) - { - AddMethod(new PaintDelegate(Paint)); - AddMethod(new ClosedDelegate(Closed)); - AddMethod(new ActivatedDelegate(Activated)); - AddMethod(new DeactivatedDelegate(Deactivated)); - AddMethod(new ResizedDelegate(Resized)); - AddMethod(new PositionChangedDelegate(PositionChanged)); - AddMethod(new RawMouseEventDelegate(RawMouseEvent)); - AddMethod(new RawKeyEventDelegate(RawKeyEvent)); - AddMethod(new RawTextInputEventDelegate(RawTextInputEvent)); - AddMethod(new ScalingChangedDelegate(ScalingChanged)); - AddMethod(new RunRenderPriorityJobsDelegate(RunRenderPriorityJobs)); - AddMethod(new LostFocusDelegate(LostFocus)); - AddMethod(new DragEventDelegate(DragEvent)); - } - - [System.Runtime.InteropServices.UnmanagedFunctionPointerAttribute(System.Runtime.InteropServices.CallingConvention.ThisCall)] - private delegate int PaintDelegate(System.IntPtr thisObject); - private static unsafe int Paint(System.IntPtr thisObject) - { - try - { - IAvnWindowBaseEvents @this = (IAvnWindowBaseEvents)ToShadow(thisObject).Callback; - @this.Paint(); - return SharpGen.Runtime.Result.Ok.Code; - } - catch (System.Exception __exception__) - { - IAvnWindowBaseEvents @this = (IAvnWindowBaseEvents)ToShadow(thisObject).Callback; - (@this as SharpGen.Runtime.IExceptionCallback)?.RaiseException(__exception__); - return SharpGen.Runtime.Result.GetResultFromException(__exception__).Code; - } - } - - [System.Runtime.InteropServices.UnmanagedFunctionPointerAttribute(System.Runtime.InteropServices.CallingConvention.ThisCall)] - private delegate void ClosedDelegate(System.IntPtr thisObject); - private static unsafe void Closed(System.IntPtr thisObject) - { - try - { - IAvnWindowBaseEvents @this = (IAvnWindowBaseEvents)ToShadow(thisObject).Callback; - @this.Closed(); - } - catch (System.Exception __exception__) - { - IAvnWindowBaseEvents @this = (IAvnWindowBaseEvents)ToShadow(thisObject).Callback; - (@this as SharpGen.Runtime.IExceptionCallback)?.RaiseException(__exception__); - } - } - - [System.Runtime.InteropServices.UnmanagedFunctionPointerAttribute(System.Runtime.InteropServices.CallingConvention.ThisCall)] - private delegate void ActivatedDelegate(System.IntPtr thisObject); - private static unsafe void Activated(System.IntPtr thisObject) - { - try - { - IAvnWindowBaseEvents @this = (IAvnWindowBaseEvents)ToShadow(thisObject).Callback; - @this.Activated(); - } - catch (System.Exception __exception__) - { - IAvnWindowBaseEvents @this = (IAvnWindowBaseEvents)ToShadow(thisObject).Callback; - (@this as SharpGen.Runtime.IExceptionCallback)?.RaiseException(__exception__); - } - } - - [System.Runtime.InteropServices.UnmanagedFunctionPointerAttribute(System.Runtime.InteropServices.CallingConvention.ThisCall)] - private delegate void DeactivatedDelegate(System.IntPtr thisObject); - private static unsafe void Deactivated(System.IntPtr thisObject) - { - try - { - IAvnWindowBaseEvents @this = (IAvnWindowBaseEvents)ToShadow(thisObject).Callback; - @this.Deactivated(); - } - catch (System.Exception __exception__) - { - IAvnWindowBaseEvents @this = (IAvnWindowBaseEvents)ToShadow(thisObject).Callback; - (@this as SharpGen.Runtime.IExceptionCallback)?.RaiseException(__exception__); - } - } - - [System.Runtime.InteropServices.UnmanagedFunctionPointerAttribute(System.Runtime.InteropServices.CallingConvention.ThisCall)] - private delegate void ResizedDelegate(System.IntPtr thisObject, void *arg0); - private static unsafe void Resized(System.IntPtr thisObject, void *param0) - { - try - { - Avalonia.Native.Interop.AvnSize size = System.Runtime.CompilerServices.Unsafe.AsRef(param0); - IAvnWindowBaseEvents @this = (IAvnWindowBaseEvents)ToShadow(thisObject).Callback; - @this.Resized(size); - } - catch (System.Exception __exception__) - { - IAvnWindowBaseEvents @this = (IAvnWindowBaseEvents)ToShadow(thisObject).Callback; - (@this as SharpGen.Runtime.IExceptionCallback)?.RaiseException(__exception__); - } - } - - [System.Runtime.InteropServices.UnmanagedFunctionPointerAttribute(System.Runtime.InteropServices.CallingConvention.ThisCall)] - private delegate void PositionChangedDelegate(System.IntPtr thisObject, Avalonia.Native.Interop.AvnPoint arg0); - private static unsafe void PositionChanged(System.IntPtr thisObject, Avalonia.Native.Interop.AvnPoint param0) - { - try - { - Avalonia.Native.Interop.AvnPoint position = default (Avalonia.Native.Interop.AvnPoint); - position = (Avalonia.Native.Interop.AvnPoint)param0; - IAvnWindowBaseEvents @this = (IAvnWindowBaseEvents)ToShadow(thisObject).Callback; - @this.PositionChanged(position); - } - catch (System.Exception __exception__) - { - IAvnWindowBaseEvents @this = (IAvnWindowBaseEvents)ToShadow(thisObject).Callback; - (@this as SharpGen.Runtime.IExceptionCallback)?.RaiseException(__exception__); - } - } - - [System.Runtime.InteropServices.UnmanagedFunctionPointerAttribute(System.Runtime.InteropServices.CallingConvention.ThisCall)] - private delegate void RawMouseEventDelegate(System.IntPtr thisObject, int arg0, System.UInt32 arg1, int arg2, Avalonia.Native.Interop.AvnPoint arg3, Avalonia.Native.Interop.AvnVector arg4); - private static unsafe void RawMouseEvent(System.IntPtr thisObject, int param0, System.UInt32 param1, int param2, Avalonia.Native.Interop.AvnPoint param3, Avalonia.Native.Interop.AvnVector param4) - { - try - { - Avalonia.Native.Interop.AvnRawMouseEventType type = default (Avalonia.Native.Interop.AvnRawMouseEventType); - type = (Avalonia.Native.Interop.AvnRawMouseEventType)param0; - System.UInt32 timeStamp = default (System.UInt32); - timeStamp = (System.UInt32)param1; - Avalonia.Native.Interop.AvnInputModifiers modifiers = default (Avalonia.Native.Interop.AvnInputModifiers); - modifiers = (Avalonia.Native.Interop.AvnInputModifiers)param2; - Avalonia.Native.Interop.AvnPoint point = default (Avalonia.Native.Interop.AvnPoint); - point = (Avalonia.Native.Interop.AvnPoint)param3; - Avalonia.Native.Interop.AvnVector delta = default (Avalonia.Native.Interop.AvnVector); - delta = (Avalonia.Native.Interop.AvnVector)param4; - IAvnWindowBaseEvents @this = (IAvnWindowBaseEvents)ToShadow(thisObject).Callback; - @this.RawMouseEvent(type, timeStamp, modifiers, point, delta); - } - catch (System.Exception __exception__) - { - IAvnWindowBaseEvents @this = (IAvnWindowBaseEvents)ToShadow(thisObject).Callback; - (@this as SharpGen.Runtime.IExceptionCallback)?.RaiseException(__exception__); - } - } - - [System.Runtime.InteropServices.UnmanagedFunctionPointerAttribute(System.Runtime.InteropServices.CallingConvention.ThisCall)] - private delegate System.Byte RawKeyEventDelegate(System.IntPtr thisObject, int arg0, System.UInt32 arg1, int arg2, System.UInt32 arg3); - private static unsafe System.Byte RawKeyEvent(System.IntPtr thisObject, int param0, System.UInt32 param1, int param2, System.UInt32 param3) - { - try - { - System.Boolean __result__ = default (System.Boolean); - System.Byte __result__native; - Avalonia.Native.Interop.AvnRawKeyEventType type = default (Avalonia.Native.Interop.AvnRawKeyEventType); - type = (Avalonia.Native.Interop.AvnRawKeyEventType)param0; - System.UInt32 timeStamp = default (System.UInt32); - timeStamp = (System.UInt32)param1; - Avalonia.Native.Interop.AvnInputModifiers modifiers = default (Avalonia.Native.Interop.AvnInputModifiers); - modifiers = (Avalonia.Native.Interop.AvnInputModifiers)param2; - System.UInt32 key = default (System.UInt32); - key = (System.UInt32)param3; - IAvnWindowBaseEvents @this = (IAvnWindowBaseEvents)ToShadow(thisObject).Callback; - __result__ = @this.RawKeyEvent(type, timeStamp, modifiers, key); - __result__native = (System.Byte)(__result__ ? 1 : 0); - return __result__native; - } - catch (System.Exception __exception__) - { - IAvnWindowBaseEvents @this = (IAvnWindowBaseEvents)ToShadow(thisObject).Callback; - (@this as SharpGen.Runtime.IExceptionCallback)?.RaiseException(__exception__); - return default (System.Byte); - } - } - - [System.Runtime.InteropServices.UnmanagedFunctionPointerAttribute(System.Runtime.InteropServices.CallingConvention.ThisCall)] - private delegate System.Byte RawTextInputEventDelegate(System.IntPtr thisObject, System.UInt32 arg0, void *arg1); - private static unsafe System.Byte RawTextInputEvent(System.IntPtr thisObject, System.UInt32 param0, void *param1) - { - try - { - System.Boolean __result__ = default (System.Boolean); - System.Byte __result__native; - System.UInt32 timeStamp = default (System.UInt32); - timeStamp = (System.UInt32)param0; - System.String text = default (System.String); - System.IntPtr text_ = (System.IntPtr)param1; - IAvnWindowBaseEvents @this = (IAvnWindowBaseEvents)ToShadow(thisObject).Callback; - text = System.Runtime.InteropServices.Marshal.PtrToStringAnsi(text_); - __result__ = @this.RawTextInputEvent(timeStamp, text); - __result__native = (System.Byte)(__result__ ? 1 : 0); - return __result__native; - } - catch (System.Exception __exception__) - { - IAvnWindowBaseEvents @this = (IAvnWindowBaseEvents)ToShadow(thisObject).Callback; - (@this as SharpGen.Runtime.IExceptionCallback)?.RaiseException(__exception__); - return default (System.Byte); - } - } - - [System.Runtime.InteropServices.UnmanagedFunctionPointerAttribute(System.Runtime.InteropServices.CallingConvention.ThisCall)] - private delegate void ScalingChangedDelegate(System.IntPtr thisObject, double arg0); - private static unsafe void ScalingChanged(System.IntPtr thisObject, double param0) - { - try - { - System.Double scaling = default (System.Double); - scaling = (System.Double)param0; - IAvnWindowBaseEvents @this = (IAvnWindowBaseEvents)ToShadow(thisObject).Callback; - @this.ScalingChanged(scaling); - } - catch (System.Exception __exception__) - { - IAvnWindowBaseEvents @this = (IAvnWindowBaseEvents)ToShadow(thisObject).Callback; - (@this as SharpGen.Runtime.IExceptionCallback)?.RaiseException(__exception__); - } - } - - [System.Runtime.InteropServices.UnmanagedFunctionPointerAttribute(System.Runtime.InteropServices.CallingConvention.ThisCall)] - private delegate void RunRenderPriorityJobsDelegate(System.IntPtr thisObject); - private static unsafe void RunRenderPriorityJobs(System.IntPtr thisObject) - { - try - { - IAvnWindowBaseEvents @this = (IAvnWindowBaseEvents)ToShadow(thisObject).Callback; - @this.RunRenderPriorityJobs(); - } - catch (System.Exception __exception__) - { - IAvnWindowBaseEvents @this = (IAvnWindowBaseEvents)ToShadow(thisObject).Callback; - (@this as SharpGen.Runtime.IExceptionCallback)?.RaiseException(__exception__); - } - } - - [System.Runtime.InteropServices.UnmanagedFunctionPointerAttribute(System.Runtime.InteropServices.CallingConvention.ThisCall)] - private delegate void LostFocusDelegate(System.IntPtr thisObject); - private static unsafe void LostFocus(System.IntPtr thisObject) - { - try - { - IAvnWindowBaseEvents @this = (IAvnWindowBaseEvents)ToShadow(thisObject).Callback; - @this.LostFocus(); - } - catch (System.Exception __exception__) - { - IAvnWindowBaseEvents @this = (IAvnWindowBaseEvents)ToShadow(thisObject).Callback; - (@this as SharpGen.Runtime.IExceptionCallback)?.RaiseException(__exception__); - } - } - - [System.Runtime.InteropServices.UnmanagedFunctionPointerAttribute(System.Runtime.InteropServices.CallingConvention.ThisCall)] - private delegate Avalonia.Native.Interop.AvnDragDropEffects DragEventDelegate(System.IntPtr thisObject, int arg0, Avalonia.Native.Interop.AvnPoint arg1, int arg2, int arg3, void *arg4, void *arg5); - private static unsafe Avalonia.Native.Interop.AvnDragDropEffects DragEvent(System.IntPtr thisObject, int param0, Avalonia.Native.Interop.AvnPoint param1, int param2, int param3, void *param4, void *param5) - { - try - { - Avalonia.Native.Interop.AvnDragDropEffects __result__ = default (Avalonia.Native.Interop.AvnDragDropEffects); - Avalonia.Native.Interop.AvnDragEventType type = default (Avalonia.Native.Interop.AvnDragEventType); - type = (Avalonia.Native.Interop.AvnDragEventType)param0; - Avalonia.Native.Interop.AvnPoint position = default (Avalonia.Native.Interop.AvnPoint); - position = (Avalonia.Native.Interop.AvnPoint)param1; - Avalonia.Native.Interop.AvnInputModifiers modifiers = default (Avalonia.Native.Interop.AvnInputModifiers); - modifiers = (Avalonia.Native.Interop.AvnInputModifiers)param2; - Avalonia.Native.Interop.AvnDragDropEffects effects = default (Avalonia.Native.Interop.AvnDragDropEffects); - effects = (Avalonia.Native.Interop.AvnDragDropEffects)param3; - Avalonia.Native.Interop.IAvnClipboard clipboard = default (Avalonia.Native.Interop.IAvnClipboard); - System.IntPtr clipboard_ = (System.IntPtr)param4; - System.IntPtr dataObjectHandle = default (System.IntPtr); - dataObjectHandle = (System.IntPtr)param5; - IAvnWindowBaseEvents @this = (IAvnWindowBaseEvents)ToShadow(thisObject).Callback; - if (clipboard_ != System.IntPtr.Zero) - clipboard = new Avalonia.Native.Interop.IAvnClipboard(clipboard_); - else - clipboard = null; - __result__ = @this.DragEvent(type, position, modifiers, effects, clipboard, dataObjectHandle); - return __result__; - } - catch (System.Exception __exception__) - { - IAvnWindowBaseEvents @this = (IAvnWindowBaseEvents)ToShadow(thisObject).Callback; - (@this as SharpGen.Runtime.IExceptionCallback)?.RaiseException(__exception__); - return default (Avalonia.Native.Interop.AvnDragDropEffects); - } - } - } - - protected override SharpGen.Runtime.CppObjectVtbl Vtbl - { - get; - } - - = new Avalonia.Native.Interop.IAvnWindowBaseEventsShadow.IAvnWindowBaseEventsVtbl(0); - } - - [System.Runtime.InteropServices.GuidAttribute("2e2cda0a-9ae5-4f1b-8e20-081a04279f05"), SharpGen.Runtime.ShadowAttribute(typeof (Avalonia.Native.Interop.IAvnWindowBaseEventsShadow))] - public partial interface IAvnWindowBaseEvents : SharpGen.Runtime.IUnknown - { - void Paint(); - void Closed(); - void Activated(); - void Deactivated(); - void Resized(Avalonia.Native.Interop.AvnSize size); - void PositionChanged(Avalonia.Native.Interop.AvnPoint position); - void RawMouseEvent(Avalonia.Native.Interop.AvnRawMouseEventType type, System.UInt32 timeStamp, Avalonia.Native.Interop.AvnInputModifiers modifiers, Avalonia.Native.Interop.AvnPoint point, Avalonia.Native.Interop.AvnVector delta); - System.Boolean RawKeyEvent(Avalonia.Native.Interop.AvnRawKeyEventType type, System.UInt32 timeStamp, Avalonia.Native.Interop.AvnInputModifiers modifiers, System.UInt32 key); - System.Boolean RawTextInputEvent(System.UInt32 timeStamp, System.String text); - void ScalingChanged(System.Double scaling); - void RunRenderPriorityJobs(); - void LostFocus(); - Avalonia.Native.Interop.AvnDragDropEffects DragEvent(Avalonia.Native.Interop.AvnDragEventType type, Avalonia.Native.Interop.AvnPoint position, Avalonia.Native.Interop.AvnInputModifiers modifiers, Avalonia.Native.Interop.AvnDragDropEffects effects, Avalonia.Native.Interop.IAvnClipboard clipboard, System.IntPtr dataObjectHandle); - } - - class IAvnWindowEventsShadow : Avalonia.Native.Interop.IAvnWindowBaseEventsShadow - { - protected unsafe class IAvnWindowEventsVtbl : Avalonia.Native.Interop.IAvnWindowBaseEventsShadow.IAvnWindowBaseEventsVtbl - { - public IAvnWindowEventsVtbl(int numberOfCallbackMethods): base (numberOfCallbackMethods + 3) - { - AddMethod(new ClosingDelegate(Closing)); - AddMethod(new WindowStateChangedDelegate(WindowStateChanged)); - AddMethod(new GotInputWhenDisabledDelegate(GotInputWhenDisabled)); - } - - [System.Runtime.InteropServices.UnmanagedFunctionPointerAttribute(System.Runtime.InteropServices.CallingConvention.ThisCall)] - private delegate System.Byte ClosingDelegate(System.IntPtr thisObject); - private static unsafe System.Byte Closing(System.IntPtr thisObject) - { - try - { - System.Boolean __result__ = default (System.Boolean); - System.Byte __result__native; - IAvnWindowEvents @this = (IAvnWindowEvents)ToShadow(thisObject).Callback; - __result__ = @this.Closing(); - __result__native = (System.Byte)(__result__ ? 1 : 0); - return __result__native; - } - catch (System.Exception __exception__) - { - IAvnWindowEvents @this = (IAvnWindowEvents)ToShadow(thisObject).Callback; - (@this as SharpGen.Runtime.IExceptionCallback)?.RaiseException(__exception__); - return default (System.Byte); - } - } - - [System.Runtime.InteropServices.UnmanagedFunctionPointerAttribute(System.Runtime.InteropServices.CallingConvention.ThisCall)] - private delegate void WindowStateChangedDelegate(System.IntPtr thisObject, int arg0); - private static unsafe void WindowStateChanged(System.IntPtr thisObject, int param0) - { - try - { - Avalonia.Native.Interop.AvnWindowState state = default (Avalonia.Native.Interop.AvnWindowState); - state = (Avalonia.Native.Interop.AvnWindowState)param0; - IAvnWindowEvents @this = (IAvnWindowEvents)ToShadow(thisObject).Callback; - @this.WindowStateChanged(state); - } - catch (System.Exception __exception__) - { - IAvnWindowEvents @this = (IAvnWindowEvents)ToShadow(thisObject).Callback; - (@this as SharpGen.Runtime.IExceptionCallback)?.RaiseException(__exception__); - } - } - - [System.Runtime.InteropServices.UnmanagedFunctionPointerAttribute(System.Runtime.InteropServices.CallingConvention.ThisCall)] - private delegate void GotInputWhenDisabledDelegate(System.IntPtr thisObject); - private static unsafe void GotInputWhenDisabled(System.IntPtr thisObject) - { - try - { - IAvnWindowEvents @this = (IAvnWindowEvents)ToShadow(thisObject).Callback; - @this.GotInputWhenDisabled(); - } - catch (System.Exception __exception__) - { - IAvnWindowEvents @this = (IAvnWindowEvents)ToShadow(thisObject).Callback; - (@this as SharpGen.Runtime.IExceptionCallback)?.RaiseException(__exception__); - } - } - } - - protected override SharpGen.Runtime.CppObjectVtbl Vtbl - { - get; - } - - = new Avalonia.Native.Interop.IAvnWindowEventsShadow.IAvnWindowEventsVtbl(0); - } - - [System.Runtime.InteropServices.GuidAttribute("2e2cda0a-9ae5-4f1b-8e20-081a04279f06"), SharpGen.Runtime.ShadowAttribute(typeof (Avalonia.Native.Interop.IAvnWindowEventsShadow))] - public partial interface IAvnWindowEvents : Avalonia.Native.Interop.IAvnWindowBaseEvents - { - System.Boolean Closing(); - void WindowStateChanged(Avalonia.Native.Interop.AvnWindowState state); - void GotInputWhenDisabled(); - } -} \ No newline at end of file diff --git a/src/Avalonia.Native/Generated/LocalInterop.cs b/src/Avalonia.Native/Generated/LocalInterop.cs deleted file mode 100644 index 41e69a6bdc..0000000000 --- a/src/Avalonia.Native/Generated/LocalInterop.cs +++ /dev/null @@ -1,202 +0,0 @@ -// - -namespace Avalonia.Native -{ - internal static partial class LocalInterop - { - public static unsafe int CalliThisCallint(void *thisObject, void *methodPtr) - { - throw null; - } - - public static unsafe void CalliThisCallvoid(void *thisObject, void *methodPtr) - { - throw null; - } - - public static unsafe void CalliThisCallvoid(void *thisObject, void *param0, void *methodPtr) - { - throw null; - } - - public static unsafe void CalliThisCallvoid0(void *thisObject, Avalonia.Native.Interop.AvnPoint param0, void *methodPtr) - { - throw null; - } - - public static unsafe void CalliThisCallvoid0(void *thisObject, int param0, System.UInt32 param1, int param2, Avalonia.Native.Interop.AvnPoint param3, Avalonia.Native.Interop.AvnVector param4, void *methodPtr) - { - throw null; - } - - public static unsafe System.Byte CalliThisCallSystemByte(void *thisObject, int param0, System.UInt32 param1, int param2, System.UInt32 param3, void *methodPtr) - { - throw null; - } - - public static unsafe System.Byte CalliThisCallSystemByte(void *thisObject, System.UInt32 param0, void *param1, void *methodPtr) - { - throw null; - } - - public static unsafe void CalliThisCallvoid(void *thisObject, double param0, void *methodPtr) - { - throw null; - } - - public static unsafe Avalonia.Native.Interop.AvnDragDropEffects CalliThisCallAvaloniaNativeInteropAvnDragDropEffects0(void *thisObject, int param0, Avalonia.Native.Interop.AvnPoint param1, int param2, int param3, void *param4, void *param5, void *methodPtr) - { - throw null; - } - - public static unsafe System.Byte CalliThisCallSystemByte(void *thisObject, void *methodPtr) - { - throw null; - } - - public static unsafe void CalliThisCallvoid(void *thisObject, int param0, void *methodPtr) - { - throw null; - } - - public static unsafe int CalliThisCallint(void *thisObject, void *param0, void *methodPtr) - { - throw null; - } - - public static unsafe int CalliThisCallint0(void *thisObject, Avalonia.Native.Interop.AvnSize param0, Avalonia.Native.Interop.AvnSize param1, void *methodPtr) - { - throw null; - } - - public static unsafe int CalliThisCallint(void *thisObject, double param0, double param1, void *methodPtr) - { - throw null; - } - - public static unsafe int CalliThisCallint0(void *thisObject, Avalonia.Native.Interop.AvnRect param0, void *methodPtr) - { - throw null; - } - - public static unsafe int CalliThisCallint(void *thisObject, int param0, void *methodPtr) - { - throw null; - } - - public static unsafe int CalliThisCallint0(void *thisObject, Avalonia.Native.Interop.AvnPoint param0, void *methodPtr) - { - throw null; - } - - public static unsafe int CalliThisCallint0(void *thisObject, Avalonia.Native.Interop.AvnPoint param0, void *param1, void *methodPtr) - { - throw null; - } - - public static unsafe int CalliThisCallint(void *thisObject, void *param0, void *param1, void *methodPtr) - { - throw null; - } - - public static unsafe int CalliThisCallint(void *thisObject, System.Byte param0, void *methodPtr) - { - throw null; - } - - public static unsafe int CalliThisCallint0(void *thisObject, int param0, Avalonia.Native.Interop.AvnPoint param1, void *param2, void *param3, void *param4, void *methodPtr) - { - throw null; - } - - public static unsafe int CalliThisCallint0(void *thisObject, Avalonia.Native.Interop.AvnColor param0, void *methodPtr) - { - throw null; - } - - public static unsafe int CalliThisCallint(void *thisObject, double param0, void *methodPtr) - { - throw null; - } - - public static unsafe System.IntPtr CalliThisCallSystemIntPtr(void *thisObject, void *methodPtr) - { - throw null; - } - - public static unsafe System.IntPtr CalliThisCallSystemIntPtr(void *thisObject, int param0, int param1, void *param2, void *methodPtr) - { - throw null; - } - - public static unsafe void CalliThisCallvoid(void *thisObject, int param0, void *param1, void *methodPtr) - { - throw null; - } - - public static unsafe void CalliThisCallvoid(void *thisObject, void *param0, void *param1, void *param2, void *param3, void *methodPtr) - { - throw null; - } - - public static unsafe void CalliThisCallvoid(void *thisObject, void *param0, void *param1, System.Byte param2, void *param3, void *param4, void *param5, void *param6, void *methodPtr) - { - throw null; - } - - public static unsafe void CalliThisCallvoid(void *thisObject, void *param0, void *param1, void *param2, void *param3, void *param4, void *param5, void *methodPtr) - { - throw null; - } - - public static unsafe int CalliThisCallint(void *thisObject, int param0, void *param1, void *methodPtr) - { - throw null; - } - - public static unsafe int CalliThisCallint(void *thisObject, void *param0, void *param1, int param2, void *methodPtr) - { - throw null; - } - - public static unsafe System.IntPtr CalliThisCallSystemIntPtr(void *thisObject, void *param0, void *methodPtr) - { - throw null; - } - - public static unsafe int CalliThisCallint(void *thisObject, void *param0, int param1, void *methodPtr) - { - throw null; - } - - public static unsafe System.UInt32 CalliThisCallSystemUInt32(void *thisObject, void *methodPtr) - { - throw null; - } - - public static unsafe int CalliThisCallint(void *thisObject, System.UInt32 param0, void *param1, void *methodPtr) - { - throw null; - } - - public static unsafe void CalliThisCallvoid(void *thisObject, float param0, float param1, float param2, float param3, void *methodPtr) - { - throw null; - } - - public static unsafe void CalliThisCallvoid(void *thisObject, float param0, float param1, void *methodPtr) - { - throw null; - } - - public static unsafe int CalliThisCallint(void *thisObject, void *param0, void *param1, void *param2, void *methodPtr) - { - throw null; - } - - public static unsafe void CalliThisCallvoid(void *thisObject, int param0, System.Byte param1, void *methodPtr) - { - throw null; - } - } -} \ No newline at end of file diff --git a/src/Avalonia.Native/Generated/Structures.cs b/src/Avalonia.Native/Generated/Structures.cs deleted file mode 100644 index fc871a2516..0000000000 --- a/src/Avalonia.Native/Generated/Structures.cs +++ /dev/null @@ -1,246 +0,0 @@ -// - -namespace Avalonia.Native.Interop -{ - /// - /// No documentation. - /// - /// AvnColor - /// AvnColor - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential, Pack = 0, CharSet = System.Runtime.InteropServices.CharSet.Unicode)] - public partial struct AvnColor - { - /// - /// No documentation. - /// - /// Alpha - /// Alpha - public System.Byte Alpha; - /// - /// No documentation. - /// - /// Red - /// Red - public System.Byte Red; - /// - /// No documentation. - /// - /// Green - /// Green - public System.Byte Green; - /// - /// No documentation. - /// - /// Blue - /// Blue - public System.Byte Blue; - } - - /// - /// No documentation. - /// - /// AvnFramebuffer - /// AvnFramebuffer - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential, Pack = 0, CharSet = System.Runtime.InteropServices.CharSet.Unicode)] - public partial struct AvnFramebuffer - { - /// - /// No documentation. - /// - /// Data - /// Data - public System.IntPtr Data; - /// - /// No documentation. - /// - /// Width - /// Width - public System.Int32 Width; - /// - /// No documentation. - /// - /// Height - /// Height - public System.Int32 Height; - /// - /// No documentation. - /// - /// Stride - /// Stride - public System.Int32 Stride; - /// - /// No documentation. - /// - /// Dpi - /// Dpi - public Avalonia.Native.Interop.AvnVector Dpi; - /// - /// No documentation. - /// - /// PixelFormat - /// PixelFormat - public Avalonia.Native.Interop.AvnPixelFormat PixelFormat; - } - - /// - /// No documentation. - /// - /// AvnPixelSize - /// AvnPixelSize - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential, Pack = 0, CharSet = System.Runtime.InteropServices.CharSet.Unicode)] - public partial struct AvnPixelSize - { - /// - /// No documentation. - /// - /// Width - /// Width - public System.Int32 Width; - /// - /// No documentation. - /// - /// Height - /// Height - public System.Int32 Height; - } - - /// - /// No documentation. - /// - /// AvnPoint - /// AvnPoint - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential, Pack = 0, CharSet = System.Runtime.InteropServices.CharSet.Unicode)] - public partial struct AvnPoint - { - /// - /// No documentation. - /// - /// X - /// X - public System.Double X; - /// - /// No documentation. - /// - /// Y - /// Y - public System.Double Y; - } - - /// - /// No documentation. - /// - /// AvnRect - /// AvnRect - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential, Pack = 0, CharSet = System.Runtime.InteropServices.CharSet.Unicode)] - public partial struct AvnRect - { - /// - /// No documentation. - /// - /// X - /// X - public System.Double X; - /// - /// No documentation. - /// - /// Y - /// Y - public System.Double Y; - /// - /// No documentation. - /// - /// Width - /// Width - public System.Double Width; - /// - /// No documentation. - /// - /// Height - /// Height - public System.Double Height; - } - - /// - /// No documentation. - /// - /// AvnScreen - /// AvnScreen - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential, Pack = 0, CharSet = System.Runtime.InteropServices.CharSet.Unicode)] - public partial struct AvnScreen - { - /// - /// No documentation. - /// - /// Bounds - /// Bounds - public Avalonia.Native.Interop.AvnRect Bounds; - /// - /// No documentation. - /// - /// WorkingArea - /// WorkingArea - public Avalonia.Native.Interop.AvnRect WorkingArea; - /// - /// No documentation. - /// - /// PixelDensity - /// PixelDensity - public System.Single PixelDensity; - /// - /// No documentation. - /// - /// Primary - /// Primary - public bool Primary - { - get => 0 != _Primary; - set => _Primary = (System.Byte)(value ? 1 : 0); - } - - internal System.Byte _Primary; - } - - /// - /// No documentation. - /// - /// AvnSize - /// AvnSize - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential, Pack = 0, CharSet = System.Runtime.InteropServices.CharSet.Unicode)] - public partial struct AvnSize - { - /// - /// No documentation. - /// - /// Width - /// Width - public System.Double Width; - /// - /// No documentation. - /// - /// Height - /// Height - public System.Double Height; - } - - /// - /// No documentation. - /// - /// AvnVector - /// AvnVector - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential, Pack = 0, CharSet = System.Runtime.InteropServices.CharSet.Unicode)] - public partial struct AvnVector - { - /// - /// No documentation. - /// - /// X - /// X - public System.Double X; - /// - /// No documentation. - /// - /// Y - /// Y - public System.Double Y; - } -} \ No newline at end of file diff --git a/src/Avalonia.Native/Helpers.cs b/src/Avalonia.Native/Helpers.cs index 25e8250232..564434a04c 100644 --- a/src/Avalonia.Native/Helpers.cs +++ b/src/Avalonia.Native/Helpers.cs @@ -2,7 +2,7 @@ namespace Avalonia.Native { - public static class Helpers + internal static class Helpers { public static Point ToAvaloniaPoint (this AvnPoint pt) { diff --git a/src/Avalonia.Native/IAvnMenu.cs b/src/Avalonia.Native/IAvnMenu.cs index 8a49559a02..dd9464284f 100644 --- a/src/Avalonia.Native/IAvnMenu.cs +++ b/src/Avalonia.Native/IAvnMenu.cs @@ -22,15 +22,23 @@ namespace Avalonia.Native.Interop } } - public partial class IAvnMenu + partial interface IAvnMenu + { + void RaiseNeedsUpdate(); + void Deinitialise(); + } +} +namespace Avalonia.Native.Interop.Impl +{ + partial class __MicroComIAvnMenuProxy { private MenuEvents _events; private AvaloniaNativeMenuExporter _exporter; - private List _menuItems = new List(); - private Dictionary _menuItemLookup = new Dictionary(); + private List<__MicroComIAvnMenuItemProxy> _menuItems = new List<__MicroComIAvnMenuItemProxy>(); + private Dictionary _menuItemLookup = new Dictionary(); private CompositeDisposable _propertyDisposables = new CompositeDisposable(); - internal void RaiseNeedsUpdate() + public void RaiseNeedsUpdate() { (ManagedMenu as INativeMenuExporterEventsImplBridge).RaiseNeedsUpdate(); @@ -39,11 +47,11 @@ namespace Avalonia.Native.Interop internal NativeMenu ManagedMenu { get; private set; } - public static IAvnMenu Create(IAvaloniaNativeFactory factory) + public static __MicroComIAvnMenuProxy Create(IAvaloniaNativeFactory factory) { var events = new MenuEvents(); - var menu = factory.CreateMenu(events); + var menu = (__MicroComIAvnMenuProxy)factory.CreateMenu(events); events.Initialise(menu); @@ -60,7 +68,7 @@ namespace Avalonia.Native.Interop } } - private void RemoveAndDispose(IAvnMenuItem item) + private void RemoveAndDispose(__MicroComIAvnMenuItemProxy item) { _menuItemLookup.Remove(item.ManagedMenuItem); _menuItems.Remove(item); @@ -70,7 +78,7 @@ namespace Avalonia.Native.Interop item.Dispose(); } - private void MoveExistingTo(int index, IAvnMenuItem item) + private void MoveExistingTo(int index, __MicroComIAvnMenuItemProxy item) { _menuItems.Remove(item); _menuItems.Insert(index, item); @@ -79,7 +87,7 @@ namespace Avalonia.Native.Interop InsertItem(index, item); } - private IAvnMenuItem CreateNewAt(IAvaloniaNativeFactory factory, int index, NativeMenuItemBase item) + private __MicroComIAvnMenuItemProxy CreateNewAt(IAvaloniaNativeFactory factory, int index, NativeMenuItemBase item) { var result = CreateNew(factory, item); @@ -93,9 +101,11 @@ namespace Avalonia.Native.Interop return result; } - private IAvnMenuItem CreateNew(IAvaloniaNativeFactory factory, NativeMenuItemBase item) + private __MicroComIAvnMenuItemProxy CreateNew(IAvaloniaNativeFactory factory, NativeMenuItemBase item) { - var nativeItem = item is NativeMenuItemSeperator ? factory.CreateMenuItemSeperator() : factory.CreateMenuItem(); + var nativeItem = (__MicroComIAvnMenuItemProxy)(item is NativeMenuItemSeperator ? + factory.CreateMenuItemSeperator() : + factory.CreateMenuItem()); nativeItem.ManagedMenuItem = item; return nativeItem; @@ -108,16 +118,11 @@ namespace Avalonia.Native.Interop ((INotifyCollectionChanged)ManagedMenu.Items).CollectionChanged += OnMenuItemsChanged; - if (!string.IsNullOrWhiteSpace(title)) - { - using (var buffer = new Utf8Buffer(title)) - { - Title = buffer.DangerousGetHandle(); - } - } + if (!string.IsNullOrWhiteSpace(title)) + SetTitle(title); } - internal void Deinitialise() + public void Deinitialise() { ((INotifyCollectionChanged)ManagedMenu.Items).CollectionChanged -= OnMenuItemsChanged; @@ -137,7 +142,7 @@ namespace Avalonia.Native.Interop for (int i = 0; i < menu.Items.Count; i++) { - IAvnMenuItem nativeItem; + __MicroComIAvnMenuItemProxy nativeItem; if (i >= _menuItems.Count) { diff --git a/src/Avalonia.Native/IAvnMenuItem.cs b/src/Avalonia.Native/IAvnMenuItem.cs index c8819d1994..e2feffaa33 100644 --- a/src/Avalonia.Native/IAvnMenuItem.cs +++ b/src/Avalonia.Native/IAvnMenuItem.cs @@ -7,37 +7,35 @@ using Avalonia.Platform.Interop; namespace Avalonia.Native.Interop { - public partial class IAvnMenuItem + partial interface IAvnMenuItem { - private IAvnMenu _subMenu; + + } +} +namespace Avalonia.Native.Interop.Impl +{ + partial class __MicroComIAvnMenuItemProxy + { + private __MicroComIAvnMenuProxy _subMenu; private CompositeDisposable _propertyDisposables = new CompositeDisposable(); private IDisposable _currentActionDisposable; public NativeMenuItemBase ManagedMenuItem { get; set; } - private void UpdateTitle(string title) - { - using (var buffer = new Utf8Buffer(string.IsNullOrWhiteSpace(title) ? "" : title)) - { - Title = buffer.DangerousGetHandle(); - } - } + private void UpdateTitle(string title) => SetTitle(title ?? ""); - private void UpdateIsChecked(bool isChecked) - { - IsChecked = isChecked; - } + private void UpdateIsChecked(bool isChecked) => SetIsChecked(isChecked); private void UpdateToggleType(NativeMenuItemToggleType toggleType) { - ToggleType = (AvnMenuItemToggleType)toggleType; + SetToggleType((AvnMenuItemToggleType)toggleType); } private unsafe void UpdateIcon (IBitmap icon) { if(icon is null) { - SetIcon(IntPtr.Zero, 0); + SetIcon(null, IntPtr.Zero); } else { @@ -49,7 +47,7 @@ namespace Avalonia.Native.Interop fixed(void* ptr = imageData) { - SetIcon(new IntPtr(ptr), imageData.Length); + SetIcon(ptr, new IntPtr(imageData.Length)); } } } @@ -57,12 +55,9 @@ namespace Avalonia.Native.Interop private void UpdateGesture(Input.KeyGesture gesture) { - // todo ensure backend can cope with setting null gesture. - using (var buffer = new Utf8Buffer(gesture == null ? "" : OsxUnicodeKeys.ConvertOSXSpecialKeyCodes(gesture.Key))) - { - var modifiers = gesture == null ? AvnInputModifiers.AvnInputModifiersNone : (AvnInputModifiers)gesture.KeyModifiers; - SetGesture(buffer.DangerousGetHandle(), modifiers); - } + var text = gesture == null ? "" : OsxUnicodeKeys.ConvertOSXSpecialKeyCodes(gesture.Key); + var modifiers = gesture == null ? AvnInputModifiers.AvnInputModifiersNone : (AvnInputModifiers)gesture.KeyModifiers; + SetGesture(text, modifiers); } private void UpdateAction(NativeMenuItem item) @@ -153,7 +148,7 @@ namespace Avalonia.Native.Interop { if (_subMenu == null) { - _subMenu = IAvnMenu.Create(factory); + _subMenu = __MicroComIAvnMenuProxy.Create(factory); _subMenu.Initialise(exporter, item.Menu, item.Header); diff --git a/src/Avalonia.Native/NativeControlHostImpl.cs b/src/Avalonia.Native/NativeControlHostImpl.cs index a46528dc48..2c9c1728d3 100644 --- a/src/Avalonia.Native/NativeControlHostImpl.cs +++ b/src/Avalonia.Native/NativeControlHostImpl.cs @@ -1,5 +1,6 @@ using System; using Avalonia.Controls.Platform; +using Avalonia.MicroCom; using Avalonia.Native.Interop; using Avalonia.Platform; using Avalonia.VisualTree; @@ -28,8 +29,7 @@ namespace Avalonia.Native public DestroyableNSView(IAvnNativeControlHost impl) { - _impl = new IAvnNativeControlHost(impl.NativePointer); - _impl.AddRef(); + _impl = MicroComRuntime.CloneReference(impl); _nsView = _impl.CreateDefaultChild(IntPtr.Zero); } diff --git a/src/Avalonia.Native/PlatformThreadingInterface.cs b/src/Avalonia.Native/PlatformThreadingInterface.cs index 5a81f6a3bf..df69f2eafb 100644 --- a/src/Avalonia.Native/PlatformThreadingInterface.cs +++ b/src/Avalonia.Native/PlatformThreadingInterface.cs @@ -4,11 +4,10 @@ using System.Threading; using Avalonia.Native.Interop; using Avalonia.Platform; using Avalonia.Threading; -using SharpGen.Runtime; namespace Avalonia.Native { - public class PlatformThreadingInterface : IPlatformThreadingInterface + internal class PlatformThreadingInterface : IPlatformThreadingInterface { class TimerCallback : CallbackBase, IAvnActionCallback { @@ -48,7 +47,7 @@ namespace Avalonia.Native { _native = native; using (var cb = new SignaledCallback(this)) - _native.SignaledCallback = cb; + _native.SetSignaledCallback(cb); } public bool CurrentThreadIsLoopThread => _native.CurrentThreadIsLoopThread; diff --git a/src/Avalonia.Native/ScreenImpl.cs b/src/Avalonia.Native/ScreenImpl.cs index f28be52dd5..ae6da01388 100644 --- a/src/Avalonia.Native/ScreenImpl.cs +++ b/src/Avalonia.Native/ScreenImpl.cs @@ -14,7 +14,7 @@ namespace Avalonia.Native _native = native; } - public int ScreenCount => _native.GetScreenCount(); + public int ScreenCount => _native.ScreenCount; public IReadOnlyList AllScreens { diff --git a/src/Avalonia.Native/SystemDialogs.cs b/src/Avalonia.Native/SystemDialogs.cs index 98e3e383dc..0239fc680d 100644 --- a/src/Avalonia.Native/SystemDialogs.cs +++ b/src/Avalonia.Native/SystemDialogs.cs @@ -8,7 +8,7 @@ using Avalonia.Native.Interop; namespace Avalonia.Native { - public class SystemDialogs : ISystemDialogImpl + internal class SystemDialogs : ISystemDialogImpl { IAvnSystemDialogs _native; @@ -62,7 +62,7 @@ namespace Avalonia.Native } } - public class SystemDialogEvents : CallbackBase, IAvnSystemDialogEvents + internal unsafe class SystemDialogEvents : CallbackBase, IAvnSystemDialogEvents { private TaskCompletionSource _tcs; @@ -73,13 +73,13 @@ namespace Avalonia.Native public Task Task => _tcs.Task; - public void OnCompleted(int numResults, IntPtr trFirstResultRef) + public void OnCompleted(int numResults, void* trFirstResultRef) { string[] results = new string[numResults]; unsafe { - var ptr = (IntPtr*)trFirstResultRef.ToPointer(); + var ptr = (IntPtr*)trFirstResultRef; for (int i = 0; i < numResults; i++) { diff --git a/src/Avalonia.Native/WindowImpl.cs b/src/Avalonia.Native/WindowImpl.cs index 11a0ebce61..b42831854d 100644 --- a/src/Avalonia.Native/WindowImpl.cs +++ b/src/Avalonia.Native/WindowImpl.cs @@ -10,7 +10,7 @@ using Avalonia.Platform.Interop; namespace Avalonia.Native { - public class WindowImpl : WindowBaseImpl, IWindowImpl, ITopLevelImplWithNativeMenuExporter + internal class WindowImpl : WindowBaseImpl, IWindowImpl, ITopLevelImplWithNativeMenuExporter { private readonly IAvaloniaNativeFactory _factory; private readonly AvaloniaNativePlatformOptions _opts; @@ -69,12 +69,12 @@ namespace Avalonia.Native public void CanResize(bool value) { - _native.CanResize = value; + _native.SetCanResize(value); } public void SetSystemDecorations(Controls.SystemDecorations enabled) { - _native.Decorations = (Interop.SystemDecorations)enabled; + _native.SetDecorations((Interop.SystemDecorations)enabled); } public void SetTitleBarColor(Avalonia.Media.Color color) @@ -82,24 +82,12 @@ namespace Avalonia.Native _native.SetTitleBarColor(new AvnColor { Alpha = color.A, Red = color.R, Green = color.G, Blue = color.B }); } - public void SetTitle(string title) - { - using (var buffer = new Utf8Buffer(title)) - { - _native.SetTitle(buffer.DangerousGetHandle()); - } - } + public void SetTitle(string title) => _native.SetTitle(title); public WindowState WindowState { - get - { - return (WindowState)_native.GetWindowState(); - } - set - { - _native.SetWindowState((AvnWindowState)value); - } + get => (WindowState)_native.WindowState; + set => _native.SetWindowState((AvnWindowState)value); } public Action WindowStateChanged { get; set; } @@ -146,7 +134,7 @@ namespace Avalonia.Native } else { - ExtendedMargins = _isExtended ? new Thickness(0, _extendTitleBarHeight == -1 ? _native.GetExtendTitleBarHeight() : _extendTitleBarHeight, 0, 0) : new Thickness(); + ExtendedMargins = _isExtended ? new Thickness(0, _extendTitleBarHeight == -1 ? _native.ExtendTitleBarHeight : _extendTitleBarHeight, 0, 0) : new Thickness(); } ExtendClientAreaToDecorationsChanged?.Invoke(_isExtended); @@ -174,7 +162,7 @@ namespace Avalonia.Native _extendTitleBarHeight = titleBarHeight; _native.SetExtendTitleBarHeight(titleBarHeight); - ExtendedMargins = _isExtended ? new Thickness(0, titleBarHeight == -1 ? _native.GetExtendTitleBarHeight() : titleBarHeight, 0, 0) : new Thickness(); + ExtendedMargins = _isExtended ? new Thickness(0, titleBarHeight == -1 ? _native.ExtendTitleBarHeight : titleBarHeight, 0, 0) : new Thickness(); ExtendClientAreaToDecorationsChanged?.Invoke(_isExtended); } diff --git a/src/Avalonia.Native/WindowImplBase.cs b/src/Avalonia.Native/WindowImplBase.cs index 824f62aee5..bc0916c8da 100644 --- a/src/Avalonia.Native/WindowImplBase.cs +++ b/src/Avalonia.Native/WindowImplBase.cs @@ -15,7 +15,7 @@ using Avalonia.Threading; namespace Avalonia.Native { - public class MacOSTopLevelWindowHandle : IPlatformHandle, IMacOSTopLevelPlatformHandle + internal class MacOSTopLevelWindowHandle : IPlatformHandle, IMacOSTopLevelPlatformHandle { IAvnWindowBase _native; @@ -43,7 +43,7 @@ namespace Avalonia.Native } } - public abstract class WindowBaseImpl : IWindowBaseImpl, + internal abstract class WindowBaseImpl : IWindowBaseImpl, IFramebufferPlatformSurface, ITopLevelImplWithNativeControlHost { protected IInputRoot _inputRoot; @@ -96,7 +96,7 @@ namespace Avalonia.Native { if (_native != null) { - var s = _native.GetClientSize(); + var s = _native.ClientSize; return new Size(s.Width, s.Height); } @@ -137,7 +137,7 @@ namespace Avalonia.Native public IMouseDevice MouseDevice => _mouse; public abstract IPopupImpl CreatePopup(); - protected class WindowBaseEvents : CallbackBase, IAvnWindowBaseEvents + protected unsafe class WindowBaseEvents : CallbackBase, IAvnWindowBaseEvents { private readonly WindowBaseImpl _parent; @@ -172,11 +172,11 @@ namespace Avalonia.Native _parent.Paint?.Invoke(new Rect(0, 0, s.Width, s.Height)); } - void IAvnWindowBaseEvents.Resized(AvnSize size) + void IAvnWindowBaseEvents.Resized(AvnSize* size) { if (_parent._native != null) { - var s = new Size(size.Width, size.Height); + var s = new Size(size->Width, size->Height); _parent._savedLogicalSize = s; _parent.Resized?.Invoke(s); } @@ -359,7 +359,7 @@ namespace Avalonia.Native public PixelPoint Position { - get => _native.GetPosition().ToAvaloniaPixelPoint(); + get => _native.Position.ToAvaloniaPixelPoint(); set => _native.SetPosition(value.ToAvnPoint()); } @@ -391,7 +391,7 @@ namespace Avalonia.Native _native.SetTopMost(value); } - public double RenderScaling => _native?.GetScaling() ?? 1; + public double RenderScaling => _native?.Scaling ?? 1; public double DesktopScaling => 1; @@ -407,7 +407,7 @@ namespace Avalonia.Native var newCursor = cursor as AvaloniaNativeCursor; newCursor = newCursor ?? (_cursorFactory.GetCursor(StandardCursorType.Arrow) as AvaloniaNativeCursor); - _native.Cursor = newCursor.Cursor; + _native.SetCursor(newCursor.Cursor); } public Action PositionChanged { get; set; } diff --git a/src/Avalonia.Native/avn.idl b/src/Avalonia.Native/avn.idl index c763007826..dc139cf8e3 100644 --- a/src/Avalonia.Native/avn.idl +++ b/src/Avalonia.Native/avn.idl @@ -1,4 +1,4 @@ -@clr-namespace Avalonia.Native.MicroCom +@clr-namespace Avalonia.Native.Interop @clr-access internal @cpp-preamble @@ #include "com.h" @@ -244,13 +244,13 @@ interface IAvnWindowBase : IUnknown HRESULT SetCursor(IAvnCursor* cursor); HRESULT CreateGlRenderTarget(IAvnGlSurfaceRenderTarget** ret); HRESULT SetMainMenu(IAvnMenu* menu); - HRESULT ObtainNSWindowHandle(void** retOut); - HRESULT ObtainNSWindowHandleRetained(void** retOut); - HRESULT ObtainNSViewHandle(void** retOut); - HRESULT ObtainNSViewHandleRetained(void** retOut); + HRESULT ObtainNSWindowHandle([intptr]void** retOut); + HRESULT ObtainNSWindowHandleRetained([intptr]void** retOut); + HRESULT ObtainNSViewHandle([intptr]void** retOut); + HRESULT ObtainNSViewHandleRetained([intptr]void** retOut); HRESULT CreateNativeControlHost(IAvnNativeControlHost** retOut); HRESULT BeginDragAndDropOperation(AvnDragDropEffects effects, AvnPoint point, - IAvnClipboard* clipboard, IAvnDndResultCallback* cb, void* sourceHandle); + IAvnClipboard* clipboard, IAvnDndResultCallback* cb, [intptr]void* sourceHandle); HRESULT SetBlurEnabled(bool enable); } @@ -267,7 +267,7 @@ interface IAvnWindow : IAvnWindowBase HRESULT SetParent(IAvnWindow* parent); HRESULT SetCanResize(bool value); HRESULT SetDecorations(SystemDecorations value); - HRESULT SetTitle(void* utf8Title); + HRESULT SetTitle(char* utf8Title); HRESULT SetTitleBarColor(AvnColor color); HRESULT SetWindowState(AvnWindowState state); HRESULT GetWindowState(AvnWindowState*ret); @@ -299,7 +299,7 @@ interface IAvnWindowBaseEvents : IUnknown void LostFocus(); AvnDragDropEffects DragEvent(AvnDragEventType type, AvnPoint position, AvnInputModifiers modifiers, AvnDragDropEffects effects, - IAvnClipboard* clipboard, void* dataObjectHandle); + IAvnClipboard* clipboard, [intptr]void* dataObjectHandle); } [uuid(1ae178ee-1fcc-447f-b6dd-b7bb727f934c)] @@ -321,7 +321,7 @@ interface IAvnWindowEvents : IAvnWindowBaseEvents interface IAvnMacOptions : IUnknown { HRESULT SetShowInDock(int show); - HRESULT SetApplicationTitle(void* utf8string); + HRESULT SetApplicationTitle(char* utf8string); } [uuid(04c1b049-1f43-418a-9159-cae627ec1367)] @@ -395,7 +395,7 @@ interface IAvnScreens : IUnknown interface IAvnClipboard : IUnknown { HRESULT GetText(char* type, IAvnString**ppv); - HRESULT SetText(char* type, void* utf8Text); + HRESULT SetText(char* type, char* utf8Text); HRESULT ObtainFormats(IAvnStringArray**ppv); HRESULT GetStrings(char* type, IAvnStringArray**ppv); HRESULT SetBytes(char* type, void* utf8Text, int len); @@ -420,8 +420,8 @@ interface IAvnGlDisplay : IUnknown { HRESULT CreateContext(IAvnGlContext* share, IAvnGlContext**ppv); void LegacyClearCurrentContext(); - HRESULT WrapContext(void* native, IAvnGlContext**ppv); - void* GetProcAddress(char* proc); + HRESULT WrapContext([intptr]void* native, IAvnGlContext**ppv); + [intptr]void* GetProcAddress(char* proc); } [uuid(78c5711e-2a98-40d2-bac4-0cc9a49dc4f3)] @@ -431,7 +431,7 @@ interface IAvnGlContext : IUnknown HRESULT LegacyMakeCurrent(); int GetSampleCount(); int GetStencilSize(); - void* GetNativeHandle(); + [intptr]void* GetNativeHandle(); } [uuid(931062d2-5bc8-4062-8588-83dd8deb99c2)] @@ -452,7 +452,7 @@ interface IAvnMenu : IUnknown { HRESULT InsertItem(int index, IAvnMenuItem* item); HRESULT RemoveItem(IAvnMenuItem* item); - HRESULT SetTitle(void* utf8String); + HRESULT SetTitle(char* utf8String); HRESULT Clear(); } @@ -466,8 +466,8 @@ interface IAvnPredicateCallback : IUnknown interface IAvnMenuItem : IUnknown { HRESULT SetSubMenu(IAvnMenu* menu); - HRESULT SetTitle(void* utf8String); - HRESULT SetGesture(void* utf8String, AvnInputModifiers modifiers); + HRESULT SetTitle(char* utf8String); + HRESULT SetGesture(char* utf8String, AvnInputModifiers modifiers); HRESULT SetAction(IAvnPredicateCallback* predicate, IAvnActionCallback* callback); HRESULT SetIsChecked(bool isChecked); HRESULT SetToggleType(AvnMenuItemToggleType toggleType); @@ -499,22 +499,22 @@ interface IAvnDndResultCallback : IUnknown [uuid(f07c608e-52e9-422d-836e-c70f6e9b80f5)] interface IAvnGCHandleDeallocatorCallback : IUnknown { - void FreeGCHandle(void* handle); + void FreeGCHandle([intptr]void* handle); } [uuid(91c7f677-f26b-4ff3-93cc-cf15aa966ffa)] interface IAvnNativeControlHost : IUnknown { - HRESULT CreateDefaultChild(void* parent, void** retOut); + HRESULT CreateDefaultChild([intptr]void* parent, [intptr]void** retOut); IAvnNativeControlHostTopLevelAttachment* CreateAttachment(); - void DestroyDefaultChild(void* child); + void DestroyDefaultChild([intptr]void* child); } [uuid(14a9e164-1aae-4271-bb78-7b5230999b52)] interface IAvnNativeControlHostTopLevelAttachment : IUnknown { - void* GetParentHandle(); - HRESULT InitializeWithChildHandle(void* child); + [intptr]void* GetParentHandle(); + HRESULT InitializeWithChildHandle([intptr]void* child); HRESULT AttachTo(IAvnNativeControlHost* host); void ShowInBounds(float x, float y, float width, float height); void HideWithSize(float width, float height); diff --git a/src/tools/MicroComGenerator/Ast.cs b/src/tools/MicroComGenerator/Ast.cs index 8613cbba88..2c366b143d 100644 --- a/src/tools/MicroComGenerator/Ast.cs +++ b/src/tools/MicroComGenerator/Ast.cs @@ -1,4 +1,6 @@ +using System; using System.Collections.Generic; +using System.Linq; namespace MicroComGenerator.Ast { @@ -14,13 +16,38 @@ namespace MicroComGenerator.Ast } public override string ToString() => $"{Name} = {Value}"; + public AstAttributeNode Clone() => new AstAttributeNode(Name, Value); } - public class AstEnumNode : List + public class AstAttributes : List { - public List Attributes { get; set; } = new List(); + public bool HasAttribute(string a) => this.Any(x => x.Name == a); + + public AstAttributes Clone() + { + var rv= new AstAttributes(); + rv.AddRange(this.Select(x => x.Clone())); + return rv; + } + } + + public interface IAstNodeWithAttributes + { + public AstAttributes Attributes { get; set; } + } + + public class AstEnumNode : List, IAstNodeWithAttributes + { + public AstAttributes Attributes { get; set; } = new AstAttributes(); public string Name { get; set; } - public override string ToString() => Name; + public override string ToString() => "Enum " + Name; + + public AstEnumNode Clone() + { + var rv = new AstEnumNode { Name = Name, Attributes = Attributes.Clone() }; + rv.AddRange(this.Select(x => x.Clone())); + return rv; + } } public class AstEnumMemberNode @@ -34,14 +61,22 @@ namespace MicroComGenerator.Ast Value = value; } - public override string ToString() => $"{Name} = {Value}"; + public override string ToString() => $"Enum member {Name} = {Value}"; + public AstEnumMemberNode Clone() => new AstEnumMemberNode(Name, Value); } - public class AstStructNode : List + public class AstStructNode : List, IAstNodeWithAttributes { - public List Attributes { get; set; } = new List(); + public AstAttributes Attributes { get; set; } = new AstAttributes(); public string Name { get; set; } - public override string ToString() => Name; + public override string ToString() => "Struct " + Name; + + public AstStructNode Clone() + { + var rv = new AstStructNode { Name = Name, Attributes = Attributes.Clone() }; + rv.AddRange(this.Select(x => x.Clone())); + return rv; + } } public class AstTypeNode @@ -49,20 +84,24 @@ namespace MicroComGenerator.Ast public string Name { get; set; } public int PointerLevel { get; set; } - public override string ToString() => Name + new string('*', PointerLevel); + public string Format() => Name + new string('*', PointerLevel); + public override string ToString() => Format(); + public AstTypeNode Clone() => new AstTypeNode() { Name = Name, PointerLevel = PointerLevel }; } - public class AstStructMemberNode + public class AstStructMemberNode : IAstNodeWithAttributes { public string Name { get; set; } public AstTypeNode Type { get; set; } - public override string ToString() => $"{Type} {Name}"; + public override string ToString() => $"Struct member {Type.Format()} {Name}"; + public AstStructMemberNode Clone() => new AstStructMemberNode() { Name = Name, Type = Type.Clone() }; + public AstAttributes Attributes { get; set; } = new AstAttributes(); } - public class AstInterfaceNode : List + public class AstInterfaceNode : List, IAstNodeWithAttributes { - public List Attributes { get; set; } = new List(); + public AstAttributes Attributes { get; set; } = new AstAttributes(); public string Name { get; set; } public string Inherits { get; set; } @@ -70,33 +109,127 @@ namespace MicroComGenerator.Ast { if (Inherits == null) return Name; - return $"{Name} : {Inherits}"; + return $"Interface {Name} : {Inherits}"; + } + public AstInterfaceNode Clone() + { + var rv = new AstInterfaceNode { Name = Name, Inherits = Inherits, Attributes = Attributes.Clone() }; + rv.AddRange(this.Select(x => x.Clone())); + return rv; } } - public class AstInterfaceMemberNode : List + public class AstInterfaceMemberNode : List, IAstNodeWithAttributes { public string Name { get; set; } public AstTypeNode ReturnType { get; set; } - public List Attributes { get; set; } = new List(); + public AstAttributes Attributes { get; set; } = new AstAttributes(); - public override string ToString() => $"{ReturnType} {Name} ({string.Join(", ", this)})"; + public AstInterfaceMemberNode Clone() + { + var rv = new AstInterfaceMemberNode() + { + Name = Name, Attributes = Attributes.Clone(), ReturnType = ReturnType + }; + rv.AddRange(this.Select(x => x.Clone())); + return rv; + } + + public override string ToString() => + $"Interface member {ReturnType.Format()} {Name} ({string.Join(", ", this.Select(x => x.Format()))})"; } - public class AstInterfaceMemberArgumentNode + public class AstInterfaceMemberArgumentNode : IAstNodeWithAttributes { public string Name { get; set; } public AstTypeNode Type { get; set; } - public List Attributes { get; set; } = new List(); + public AstAttributes Attributes { get; set; } = new AstAttributes(); + + + public string Format() => $"{Type.Format()} {Name}"; + public override string ToString() => "Argument " + Format(); - public override string ToString() => $"{Type} {Name}"; + public AstInterfaceMemberArgumentNode Clone() => new AstInterfaceMemberArgumentNode + { + Name = Name, Type = Type.Clone(), Attributes = Attributes.Clone() + }; } - public class AstIdlNode + public static class AstExtensions { - public List Attributes { get; set; } = new List(); + public static bool HasAttribute(this IAstNodeWithAttributes node, string s) => node.Attributes.HasAttribute(s); + + public static string GetAttribute(this IAstNodeWithAttributes node, string s) + { + var value = node.Attributes.FirstOrDefault(a => a.Name == s)?.Value; + if (value == null) + throw new CodeGenException("Expected attribute " + s + " for node " + node); + return value; + } + + public static string GetAttributeOrDefault(this IAstNodeWithAttributes node, string s) + => node.Attributes.FirstOrDefault(a => a.Name == s)?.Value; + } + + class AstVisitor + { + protected virtual void VisitType(AstTypeNode type) + { + } + + protected virtual void VisitArgument(AstInterfaceMemberArgumentNode argument) + { + VisitType(argument.Type); + } + + protected virtual void VisitInterfaceMember(AstInterfaceMemberNode member) + { + foreach(var a in member) + VisitArgument(a); + VisitType(member.ReturnType); + } + + protected virtual void VisitInterface(AstInterfaceNode iface) + { + foreach(var m in iface) + VisitInterfaceMember(m); + } + + protected virtual void VisitStructMember(AstStructMemberNode member) + { + VisitType(member.Type); + } + + protected virtual void VisitStruct(AstStructNode node) + { + foreach(var m in node) + VisitStructMember(m); + } + + public virtual void VisitAst(AstIdlNode ast) + { + foreach(var iface in ast.Interfaces) + VisitInterface(iface); + foreach (var s in ast.Structs) + VisitStruct(s); + } + + + } + + public class AstIdlNode : IAstNodeWithAttributes + { + public AstAttributes Attributes { get; set; } = new AstAttributes(); public List Enums { get; set; } = new List(); public List Structs { get; set; } = new List(); public List Interfaces { get; set; } = new List(); + + public AstIdlNode Clone() => new AstIdlNode() + { + Attributes = Attributes.Clone(), + Enums = Enums.Select(x => x.Clone()).ToList(), + Structs = Structs.Select(x => x.Clone()).ToList(), + Interfaces = Interfaces.Select(x => x.Clone()).ToList() + }; } } diff --git a/src/tools/MicroComGenerator/AstParser.cs b/src/tools/MicroComGenerator/AstParser.cs index 46404da3d7..a003fb3096 100644 --- a/src/tools/MicroComGenerator/AstParser.cs +++ b/src/tools/MicroComGenerator/AstParser.cs @@ -27,9 +27,9 @@ namespace MicroComGenerator return idl; } - static List ParseGlobalAttributes(ref TokenParser parser) + static AstAttributes ParseGlobalAttributes(ref TokenParser parser) { - var rv = new List(); + var rv = new AstAttributes(); while (!parser.Eof) { parser.SkipWhitespace(); @@ -61,9 +61,9 @@ namespace MicroComGenerator return rv; } - static List ParseLocalAttributes(ref TokenParser parser) + static AstAttributes ParseLocalAttributes(ref TokenParser parser) { - var rv = new List(); + var rv = new AstAttributes(); if (parser.TryConsume("[")) { while (!parser.TryConsume("]") && !parser.Eof) @@ -107,7 +107,7 @@ namespace MicroComGenerator throw new ParseException("{ expected", ref parser); } - static AstEnumNode ParseEnum(List attrs, ref TokenParser parser) + static AstEnumNode ParseEnum(AstAttributes attrs, ref TokenParser parser) { var name = parser.ParseIdentifier(); EnsureOpenBracket(ref parser); @@ -149,13 +149,14 @@ namespace MicroComGenerator return t; } - static AstStructNode ParseStruct(List attrs, ref TokenParser parser) + static AstStructNode ParseStruct(AstAttributes attrs, ref TokenParser parser) { var name = parser.ParseIdentifier(); EnsureOpenBracket(ref parser); var rv = new AstStructNode { Name = name, Attributes = attrs }; while (!parser.TryConsume('}') && !parser.Eof) { + var memberAttrs = ParseLocalAttributes(ref parser); var t = ParseType(ref parser); bool parsedAtLeastOneMember = false; while (!parser.TryConsume(';')) @@ -165,7 +166,7 @@ namespace MicroComGenerator var ident = parser.ParseIdentifier(); parsedAtLeastOneMember = true; - rv.Add(new AstStructMemberNode { Name = ident, Type = t }); + rv.Add(new AstStructMemberNode { Name = ident, Type = t, Attributes = memberAttrs}); } if (!parsedAtLeastOneMember) @@ -175,7 +176,7 @@ namespace MicroComGenerator return rv; } - static AstInterfaceNode ParseInterface(List interfaceAttrs, ref TokenParser parser) + static AstInterfaceNode ParseInterface(AstAttributes interfaceAttrs, ref TokenParser parser) { var interfaceName = parser.ParseIdentifier(); string inheritsFrom = null; diff --git a/src/tools/MicroComGenerator/CSharpGen.InterfaceGen.cs b/src/tools/MicroComGenerator/CSharpGen.InterfaceGen.cs index 2fcf1b404b..d6848dc48e 100644 --- a/src/tools/MicroComGenerator/CSharpGen.InterfaceGen.cs +++ b/src/tools/MicroComGenerator/CSharpGen.InterfaceGen.cs @@ -167,12 +167,12 @@ namespace MicroComGenerator if (type.PointerLevel == 2) { - if (type.Name.StartsWith("I")) + if (IsInterface(type)) return new InterfaceReturnArg { Name = name, InterfaceType = type.Name, NativeType = "void**" }; } else if (type.PointerLevel == 1) { - if (type.Name.StartsWith("I")) + if (IsInterface(type)) return new InterfaceArg { Name = name, InterfaceType = type.Name, NativeType = "void*" }; if (type.Name == "char") return new StringArg { Name = name, NativeType = "byte*" }; @@ -197,8 +197,7 @@ namespace MicroComGenerator && args.Count > 0 && (args.Last().Name == "ppv" || args.Last().Name == "retOut" || args.Last().Name == "ret") && ((member.Last().Type.PointerLevel > 0 - && !member.Last().Type.Name - .StartsWith("I")) + && !IsInterface(member.Last().Type)) || member.Last().Type.PointerLevel == 2); bool isVoidReturn = member.ReturnType.Name == "void" && member.ReturnType.PointerLevel == 0; @@ -390,21 +389,20 @@ namespace MicroComGenerator void GenerateInterface(ref NamespaceDeclarationSyntax ns, ref NamespaceDeclarationSyntax implNs, AstInterfaceNode iface) { - var guidString = iface.Attributes.FirstOrDefault(x => x.Name == "uuid")?.Value; - if (guidString == null) - throw new CodeGenException("Missing GUID for " + iface.Name); + var guidString = iface.GetAttribute("uuid"); var inheritsUnknown = iface.Inherits == null || iface.Inherits == "IUnknown"; var ifaceDec = InterfaceDeclaration(iface.Name) .WithBaseType(inheritsUnknown ? "Avalonia.MicroCom.IUnknown" : iface.Inherits) - .AddModifiers(Token(_visibility), Token(SyntaxKind.UnsafeKeyword)); + .AddModifiers(Token(_visibility), Token(SyntaxKind.UnsafeKeyword), Token(SyntaxKind.PartialKeyword)); var proxyClassName = "__MicroCom" + iface.Name + "Proxy"; var proxy = ClassDeclaration(proxyClassName) - .AddModifiers(Token(SyntaxKind.UnsafeKeyword), Token(_visibility)) + .AddModifiers(Token(SyntaxKind.UnsafeKeyword), Token(_visibility), Token(SyntaxKind.PartialKeyword)) .WithBaseType(inheritsUnknown ? "Avalonia.MicroCom.MicroComProxyBase" : - ("__MicroCom" + iface.Inherits + "Proxy")); + ("__MicroCom" + iface.Inherits + "Proxy")) + .AddBaseListTypes(SimpleBaseType(ParseTypeName(iface.Name))); // Generate vtable diff --git a/src/tools/MicroComGenerator/CSharpGen.Utils.cs b/src/tools/MicroComGenerator/CSharpGen.Utils.cs index ed2bcdd6d8..3a62220d12 100644 --- a/src/tools/MicroComGenerator/CSharpGen.Utils.cs +++ b/src/tools/MicroComGenerator/CSharpGen.Utils.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; +using MicroComGenerator.Ast; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Formatting; @@ -23,13 +24,16 @@ namespace MicroComGenerator string Format(CompilationUnitSyntax unit) { var cw = new AdhocWorkspace(); - return Microsoft.CodeAnalysis.Formatting.Formatter.Format(unit.NormalizeWhitespace(), cw, cw.Options - .WithChangedOption(CSharpFormattingOptions.NewLineForMembersInObjectInit, true) - .WithChangedOption(CSharpFormattingOptions.NewLinesForBracesInObjectCollectionArrayInitializers, true) - .WithChangedOption(CSharpFormattingOptions.NewLineForMembersInAnonymousTypes, true) - .WithChangedOption(CSharpFormattingOptions.NewLinesForBracesInMethods, true) + return + "#pragma warning disable 108\n" + + Microsoft.CodeAnalysis.Formatting.Formatter.Format(unit.NormalizeWhitespace(), cw, cw.Options + .WithChangedOption(CSharpFormattingOptions.NewLineForMembersInObjectInit, true) + .WithChangedOption(CSharpFormattingOptions.NewLinesForBracesInObjectCollectionArrayInitializers, + true) + .WithChangedOption(CSharpFormattingOptions.NewLineForMembersInAnonymousTypes, true) + .WithChangedOption(CSharpFormattingOptions.NewLinesForBracesInMethods, true) - ).ToFullString(); + ).ToFullString(); } @@ -93,5 +97,14 @@ namespace MicroComGenerator return decl.ReplaceNodes(replace.Keys, (m, m2) => replace[m]); } + bool IsInterface(string name) + { + if (name == "IUnknown") + return true; + return _idl.Interfaces.Any(i => i.Name == name); + } + + private bool IsInterface(AstTypeNode type) => IsInterface(type.Name); + } } diff --git a/src/tools/MicroComGenerator/CSharpGen.cs b/src/tools/MicroComGenerator/CSharpGen.cs index 49e4f7a09e..93fce16dfc 100644 --- a/src/tools/MicroComGenerator/CSharpGen.cs +++ b/src/tools/MicroComGenerator/CSharpGen.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using System.Linq; using System.Runtime.CompilerServices; @@ -20,14 +21,12 @@ namespace MicroComGenerator public CSharpGen(AstIdlNode idl) { - _idl = idl; + _idl = idl.Clone(); + new AstRewriter().VisitAst(_idl); _extraUsings = _idl.Attributes.Where(u => u.Name == "clr-using").Select(u => u.Value).ToList(); - _namespace = _idl.Attributes.FirstOrDefault(x => x.Name == "clr-namespace")?.Value; - if (_namespace == null) - throw new CodeGenException("Missing clr-namespace attribute"); - var visibilityString = _idl.Attributes.FirstOrDefault(x => x.Name == "clr-access")?.Value; - if (visibilityString == null) - throw new CodeGenException("Missing clr-visibility attribute"); + _namespace = _idl.GetAttribute("clr-namespace"); + var visibilityString = _idl.GetAttribute("clr-access"); + if (visibilityString == "internal") _visibility = SyntaxKind.InternalKeyword; else if (visibilityString == "public") @@ -36,6 +35,45 @@ namespace MicroComGenerator throw new CodeGenException("Invalid clr-access attribute"); } + class AstRewriter : AstVisitor + { + void ConvertIntPtr(AstTypeNode type) + { + if (type.Name == "void" && type.PointerLevel > 0) + { + type.Name = "IntPtr"; + type.PointerLevel--; + } + } + + protected override void VisitStructMember(AstStructMemberNode member) + { + if (member.HasAttribute("intptr")) + ConvertIntPtr(member.Type); + base.VisitStructMember(member); + } + + protected override void VisitArgument(AstInterfaceMemberArgumentNode argument) + { + if (argument.HasAttribute("intptr")) + { + if(argument.Name == "retOut") + Console.WriteLine(); + ConvertIntPtr(argument.Type); + } + + base.VisitArgument(argument); + } + + protected override void VisitInterfaceMember(AstInterfaceMemberNode member) + { + if (member.HasAttribute("intptr")) + ConvertIntPtr(member.ReturnType); + base.VisitInterfaceMember(member); + } + } + + public string Generate() { var ns = NamespaceDeclaration(ParseName(_namespace)); diff --git a/src/tools/MicroComGenerator/CppGen.cs b/src/tools/MicroComGenerator/CppGen.cs index 133902f764..f2b748787f 100644 --- a/src/tools/MicroComGenerator/CppGen.cs +++ b/src/tools/MicroComGenerator/CppGen.cs @@ -20,7 +20,7 @@ namespace MicroComGenerator public static string GenerateCpp(AstIdlNode idl) { var sb = new StringBuilder(); - var preamble = idl.Attributes.FirstOrDefault(x => x.Name == "cpp-preamble")?.Value; + var preamble = idl.GetAttributeOrDefault("cpp-preamble"); if (preamble != null) sb.AppendLine(preamble); @@ -60,10 +60,7 @@ namespace MicroComGenerator foreach (var i in idl.Interfaces) { - var guidString = i.Attributes.FirstOrDefault(x => x.Name == "uuid")?.Value; - if (guidString == null) - throw new CodeGenException("Missing uuid for " + i.Name); - + var guidString = i.GetAttribute("uuid"); var guid = Guid.Parse(guidString).ToString().Replace("-", ""); diff --git a/src/tools/MicroComGenerator/MicroComGenerator.csproj b/src/tools/MicroComGenerator/MicroComGenerator.csproj index 193bb9a100..5ae431b4b9 100644 --- a/src/tools/MicroComGenerator/MicroComGenerator.csproj +++ b/src/tools/MicroComGenerator/MicroComGenerator.csproj @@ -1,5 +1,4 @@ - Exe netcoreapp3.1 @@ -8,5 +7,4 @@ -