Repository: unoplatform/uno
File: src/Uno.UI.Runtime.Skia.MacOS/Native/NativeUno.cs (C#)

Code before:

	[LibraryImport("libUnoNativeMac.dylib")]
	internal static partial void uno_native_set_opacity(nint element, double opacity);

	[LibraryImport("libUnoNativeMac.dylib")]
	internal static partial void uno_native_measure(nint element, double childWidth, double childHeight, double availableWidth, double availableHeight, out double width, out double height);

	[LibraryImport("libUnoNativeMac.dylib")]
	internal static partial void uno_native_dispose(nint element);

	[LibraryImport("libUnoNativeMac.dylib")]
	internal static unsafe partial nint uno_set_execute_callback(delegate* unmanaged[Cdecl]<IntPtr, sbyte*, sbyte*, void> callback);

	[LibraryImport("libUnoNativeMac.dylib")]
	internal static unsafe partial nint uno_set_invoke_callback(delegate* unmanaged[Cdecl]<IntPtr, sbyte*, sbyte*, void> callback);

	[LibraryImport("libUnoNativeMac.dylib")]
	internal static unsafe partial void uno_set_webview_navigation_callbacks(
		delegate* unmanaged[Cdecl]<IntPtr, sbyte*, int> starting,
		delegate* unmanaged[Cdecl]<IntPtr, sbyte*, void> finishing,
		delegate* unmanaged[Cdecl]<IntPtr, long, void> notification,
		delegate* unmanaged[Cdecl]<IntPtr, sbyte*, void> receiveWebMessage,
		delegate* unmanaged[Cdecl]<IntPtr, sbyte*, CoreWebView2WebErrorStatus, void> failing
		);

	[DllImport("libUnoNativeMac.dylib")]
	public static extern unsafe void uno_set_webview_new_window_requested_callback(
		delegate* unmanaged[Cdecl]<nint, sbyte*, sbyte*, int> callback
	);

	[LibraryImport("libUnoNativeMac.dylib")]
	internal static unsafe partial void uno_set_webview_unsupported_scheme_identified_callback(delegate* unmanaged[Cdecl]<IntPtr, sbyte*, int> callback);

	[LibraryImport("libUnoNativeMac.dylib", StringMarshalling = StringMarshalling.Utf8)]
	internal static partial nint uno_webview_create(nint window, string ok, string cancel);

	[LibraryImport("libUnoNativeMac.dylib", StringMarshalling = StringMarshalling.Utf8)]
	internal static partial string uno_webview_get_title(nint webview);

	[LibraryImport("libUnoNativeMac.dylib")]
	[return: MarshalAs(UnmanagedType.I1)]
	internal static partial bool uno_webview_can_go_back(nint webview);

	[LibraryImport("libUnoNativeMac.dylib")]
	[return: MarshalAs(UnmanagedType.I1)]
	internal static partial bool uno_webview_can_go_forward(nint webview);

	[LibraryImport("libUnoNativeMac.dylib")]
	internal static partial void uno_webview_go_back(nint webview);

	[LibraryImport("libUnoNativeMac.dylib")]

Review comment (bug):
minor: use the newer `LibraryImport` like other p/invokes declarations, it's easier to debug (the generated code) if something goes wrong

Code after:

	[LibraryImport("libUnoNativeMac.dylib")]
	internal static partial void uno_native_set_opacity(nint element, double opacity);

	[LibraryImport("libUnoNativeMac.dylib")]
	internal static partial void uno_native_measure(nint element, double childWidth, double childHeight, double availableWidth, double availableHeight, out double width, out double height);

	[LibraryImport("libUnoNativeMac.dylib")]
	internal static partial void uno_native_dispose(nint element);

	[LibraryImport("libUnoNativeMac.dylib")]
	internal static unsafe partial nint uno_set_execute_callback(delegate* unmanaged[Cdecl]<IntPtr, sbyte*, sbyte*, void> callback);

	[LibraryImport("libUnoNativeMac.dylib")]
	internal static unsafe partial nint uno_set_invoke_callback(delegate* unmanaged[Cdecl]<IntPtr, sbyte*, sbyte*, void> callback);

	[LibraryImport("libUnoNativeMac.dylib")]
	internal static unsafe partial void uno_set_webview_navigation_callbacks(
		delegate* unmanaged[Cdecl]<IntPtr, sbyte*, int> starting,
		delegate* unmanaged[Cdecl]<IntPtr, sbyte*, void> finishing,
		delegate* unmanaged[Cdecl]<IntPtr, long, void> notification,
		delegate* unmanaged[Cdecl]<IntPtr, sbyte*, void> receiveWebMessage,
		delegate* unmanaged[Cdecl]<IntPtr, sbyte*, CoreWebView2WebErrorStatus, void> failing
		);

	[LibraryImport("libUnoNativeMac.dylib")]
	internal static unsafe partial void uno_set_webview_new_window_requested_callback(
		delegate* unmanaged[Cdecl]<nint, sbyte*, sbyte*, int> callback
	);

	[LibraryImport("libUnoNativeMac.dylib")]
	internal static unsafe partial void uno_set_webview_unsupported_scheme_identified_callback(delegate* unmanaged[Cdecl]<IntPtr, sbyte*, int> callback);

	[LibraryImport("libUnoNativeMac.dylib", StringMarshalling = StringMarshalling.Utf8)]
	internal static partial nint uno_webview_create(nint window, string ok, string cancel);

	[LibraryImport("libUnoNativeMac.dylib", StringMarshalling = StringMarshalling.Utf8)]
	internal static partial string uno_webview_get_title(nint webview);

	[LibraryImport("libUnoNativeMac.dylib")]
	[return: MarshalAs(UnmanagedType.I1)]
	internal static partial bool uno_webview_can_go_back(nint webview);

	[LibraryImport("libUnoNativeMac.dylib")]
	[return: MarshalAs(UnmanagedType.I1)]
	internal static partial bool uno_webview_can_go_forward(nint webview);

	[LibraryImport("libUnoNativeMac.dylib")]
	internal static partial void uno_webview_go_back(nint webview);

	[LibraryImport("libUnoNativeMac.dylib")]