diff --git a/.github/workflows/avalonia-rust.yml b/.github/workflows/avalonia-rust.yml
index 0204819..d1c2286 100644
--- a/.github/workflows/avalonia-rust.yml
+++ b/.github/workflows/avalonia-rust.yml
@@ -6,7 +6,9 @@ on:
- '**'
- '.github/workflows/avalonia-rust.yml'
push:
- branches: [main]
+ # The default branch is `master`; targeting `main` (the fork's default) meant the
+ # upstream repository never ran this gate on its own default branch.
+ branches: [master]
paths:
- '**'
- '.github/workflows/avalonia-rust.yml'
diff --git a/host/Com/AvnApplication.Dialogs.cs b/host/Com/AvnApplication.Dialogs.cs
new file mode 100644
index 0000000..e5450f7
--- /dev/null
+++ b/host/Com/AvnApplication.Dialogs.cs
@@ -0,0 +1,50 @@
+using System;
+using System.Threading.Tasks;
+using Avalonia.Controls;
+using Avalonia.Host.Desktop;
+
+namespace Avalonia.Host.Com;
+
+///
+/// Stage 32 modal dialog activation. Window.ShowDialog returns a
+/// and never completes synchronously, so it composes onto the
+/// shared async operation registry the same way the storage pickers and clipboard do:
+/// exactly one completion, cancellable, and the UI thread is never blocked waiting on the
+/// dialog.
+///
+public partial class AvnApplication : IAvnApplication5
+{
+ public int StartShowDialog(
+ IAvnWindow? owner,
+ IAvnWindow? dialog,
+ IAvnAsyncCompletion? completion,
+ out long operationId)
+ {
+ operationId = 0;
+ if (owner is null || dialog is null)
+ return HResults.E_POINTER;
+ try
+ {
+ Avalonia.Threading.Dispatcher.UIThread.VerifyAccess();
+ var ownerWindow = (Window?)ProjectionRuntime.Unwrap(owner)
+ ?? throw new ObjectDisposedException(nameof(owner));
+ var dialogWindow = (Window?)ProjectionRuntime.Unwrap(dialog)
+ ?? throw new ObjectDisposedException(nameof(dialog));
+
+ return _asyncOperations.Start(
+ completion,
+ async cancellation =>
+ {
+ var result = await global::Avalonia.Host.Desktop.Dialogs
+ .ShowAsync(dialogWindow, ownerWindow, cancellation)
+ .ConfigureAwait(true);
+ return AvnAsyncValue.FromString(global::Avalonia.Host.Desktop.Dialogs.ResultToString(result));
+ },
+ out operationId);
+ }
+ catch (Exception e)
+ {
+ return AbiError.Capture(e);
+ }
+ }
+}
diff --git a/host/Com/AvnGuids.cs b/host/Com/AvnGuids.cs
index a847f1f..2537a77 100644
--- a/host/Com/AvnGuids.cs
+++ b/host/Com/AvnGuids.cs
@@ -27,4 +27,9 @@ internal static class AvnGuids
// file entries back, and nothing below is added to a published vtable.
public const string IAvnApplication4 = "6B2E8F10-4C91-4E3A-9A77-1F0C2B3A4D60";
public const string IAvnClipboardData = "6B2E8F10-4C91-4E3A-9A77-1F0C2B3A4D61";
+
+ // Stage 32 modal dialog activation. Another separately versioned capability;
+ // the completion rides the shared async operation registry, and nothing below
+ // is added to a published vtable.
+ public const string IAvnApplication5 = "6B2E8F10-4C91-4E3A-9A77-1F0C2B3A4D70";
}
diff --git a/host/Com/IAvnDialogs.cs b/host/Com/IAvnDialogs.cs
new file mode 100644
index 0000000..b16bb24
--- /dev/null
+++ b/host/Com/IAvnDialogs.cs
@@ -0,0 +1,27 @@
+using System.Runtime.InteropServices;
+using System.Runtime.InteropServices.Marshalling;
+
+namespace Avalonia.Host.Com;
+
+///
+/// The separately versioned dialog capability, queried from IAvnApplication .
+/// Nothing here is ever added to an already published vtable; a consumer that predates
+/// the capability reads E_NOINTERFACE from the query instead.
+///
+[GeneratedComInterface(StringMarshalling = StringMarshalling.Utf16)]
+[Guid(AvnGuids.IAvnApplication5)]
+public partial interface IAvnApplication5
+{
+ ///
+ /// Shows modally over and completes
+ /// through the shared async operation registry: exactly one completion, cancellable
+ /// through CancelAsyncOperation , never blocking the UI thread. The result string
+ /// is the dialog result converted by the host (null when the dialog returned no result).
+ ///
+ [PreserveSig]
+ int StartShowDialog(
+ IAvnWindow? owner,
+ IAvnWindow? dialog,
+ IAvnAsyncCompletion? completion,
+ out long operationId);
+}
diff --git a/host/Desktop/Dialogs.cs b/host/Desktop/Dialogs.cs
new file mode 100644
index 0000000..153c39d
--- /dev/null
+++ b/host/Desktop/Dialogs.cs
@@ -0,0 +1,68 @@
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+using Avalonia.Controls;
+using Avalonia.Threading;
+
+namespace Avalonia.Host.Desktop;
+
+///
+/// Runs from an ABI request.
+///
+///
+/// A modal dialog owns its owner while it is open: the dialog may outlive the originating
+/// call, so the caller's window tokens are resolved to managed windows up front and the
+/// task is awaited without blocking the UI thread. A cancellation request closes the
+/// dialog rather than abandoning the task, because an abandoned ShowDialog task
+/// still holds the owner.
+///
+internal static class Dialogs
+{
+ public static async Task ShowAsync(
+ Window dialog,
+ Window owner,
+ CancellationToken cancellationToken)
+ {
+ ArgumentNullException.ThrowIfNull(dialog);
+ ArgumentNullException.ThrowIfNull(owner);
+ cancellationToken.ThrowIfCancellationRequested();
+
+ var task = dialog.ShowDialog(owner);
+ if (!cancellationToken.CanBeCanceled)
+ return await task.ConfigureAwait(true);
+
+ using var registration = cancellationToken.Register(() =>
+ {
+ if (Dispatcher.UIThread.CheckAccess())
+ TryClose(dialog);
+ else
+ Dispatcher.UIThread.Post(() => TryClose(dialog));
+ });
+ return await task.ConfigureAwait(true);
+ }
+
+ ///
+ /// Converts a dialog result to its ABI string form: null stays null (the dialog
+ /// returned no result), a string crosses as-is, and anything else uses its invariant
+ /// form.
+ ///
+ public static string? ResultToString(object? result) => result switch
+ {
+ null => null,
+ string text => text,
+ _ => Convert.ToString(result, System.Globalization.CultureInfo.InvariantCulture),
+ };
+
+ private static void TryClose(Window dialog)
+ {
+ try
+ {
+ dialog.Close();
+ }
+ catch
+ {
+ // The dialog may already be closing or detached from its owner; a cancellation
+ // that races the natural close is satisfied either way.
+ }
+ }
+}
diff --git a/host/Generated/ObjectModel/.avalonia-projection.owned.json b/host/Generated/ObjectModel/.avalonia-projection.owned.json
index 46442aa..51bb1cc 100644
--- a/host/Generated/ObjectModel/.avalonia-projection.owned.json
+++ b/host/Generated/ObjectModel/.avalonia-projection.owned.json
@@ -19,11 +19,11 @@
},
{
"path": "IAvnArc.g.cs",
- "sha256": "cf76c44d5f898f5b96cb700b87000d69025d7736056ef37c2a7e1d9fbfc57c3a"
+ "sha256": "00e0a44802db1f6eb26fc09b357bbee5552a378b2f35a243dc4a71fef9b17b7a"
},
{
"path": "IAvnAutoCompleteBox.g.cs",
- "sha256": "bd4e9915200011d3ab055e800c8c18427ef19027891e3ab13351f0ae88043096"
+ "sha256": "0fbdba935bc85cb12fefd86fed7c09fe92ff1c337b9a76e3742616dc10f5a524"
},
{
"path": "IAvnAutoCompleteBoxDropDownClosedHandler.g.cs",
@@ -63,7 +63,7 @@
},
{
"path": "IAvnBorder.g.cs",
- "sha256": "9b9442d465134725ea84f88e80be8d437e6fe7e6848803e815779f14b3ad6873"
+ "sha256": "196a716a1a4a29d75b074eacde4f776152c927b736ac36f74b39e774c9672fdc"
},
{
"path": "IAvnBrush.g.cs",
@@ -71,7 +71,7 @@
},
{
"path": "IAvnButton.g.cs",
- "sha256": "09d31d3f7ddf6570af36f21d0f74557a7103ca25ccbd847a86527c5491803375"
+ "sha256": "757c07fe3b5ef996fb72038478eab5ffc8effe045b7bbcca6ffad83510acc500"
},
{
"path": "IAvnButtonClickHandler.g.cs",
@@ -79,15 +79,15 @@
},
{
"path": "IAvnButtonSpinner.g.cs",
- "sha256": "e3e36de62bf8fd9ae2b3ba0d055c8db68a8cb34ad733812b931c72f0a62203df"
+ "sha256": "0bb43a096e2aa2eab1865dc97a6d3b6aa0e6e88bcb2b8b637318c9e77ee77d8a"
},
{
"path": "IAvnCalendar.g.cs",
- "sha256": "129c6308e54a6db8b564f2362ddcea648df962cf9aa71895ba29f2ac874826e3"
+ "sha256": "c3575be6210d497b5edcd4c3c8f5d260fe26382df08456b255c26cc68f94850d"
},
{
"path": "IAvnCalendarDatePicker.g.cs",
- "sha256": "3832605d4759411bff694bbbb1ce04bebf7aa56a13b27aace601812f84eeefc1"
+ "sha256": "7a285fae9b060d74cf29e18b18df31d93778b62a3ea64062d004a92a441b5294"
},
{
"path": "IAvnCalendarDatePickerCalendarClosedHandler.g.cs",
@@ -119,7 +119,7 @@
},
{
"path": "IAvnCanvas.g.cs",
- "sha256": "00e3546e75469f62329c8a7b5b959e15341b873eae7aa05c02ad090b23d009b8"
+ "sha256": "2db2a639d6d241455c9f8602edef27ee95e71c54257163233a620f0d9fd24414"
},
{
"path": "IAvnCanvasStatics.g.cs",
@@ -127,15 +127,15 @@
},
{
"path": "IAvnCarousel.g.cs",
- "sha256": "15e3a6d9f2c3b8d5e5493851cfd3d6cb11193265a0a6b09a79340fc90775e900"
+ "sha256": "46d71726bc65d7ccce72051744488d4a86fcee87c3f0b82d6c8d6d9567323bde"
},
{
"path": "IAvnCheckBox.g.cs",
- "sha256": "6c19ad7f0277bda1da51f2211f0b08a10cd4b2790e0110e62d75c5d52ffd15a1"
+ "sha256": "adccd0d5836efe78539167a8e7982f01292184a7bf7a4dbae7b13f7f8028f55b"
},
{
"path": "IAvnComboBox.g.cs",
- "sha256": "13fddbf8a83c68f7862e1298181fc1c1593cdf83b486e7d31d930d4508b8c5c9"
+ "sha256": "f3a2bea6173d0579da2dd68be648bc8cebc8a422db9238e38b84c9f04dfaa05a"
},
{
"path": "IAvnComboBoxDropDownClosedHandler.g.cs",
@@ -147,7 +147,7 @@
},
{
"path": "IAvnComboBoxItem.g.cs",
- "sha256": "1b3ee79e6a37333bdd50dae8068c2a1edab11041a97dd00e68fbbebb21c60ce2"
+ "sha256": "c2bd08dd08ef8a102a45756d4498837ced28da7ed277370fd5edebd0d3a7b14a"
},
{
"path": "IAvnCommand.g.cs",
@@ -155,11 +155,11 @@
},
{
"path": "IAvnCommandBar.g.cs",
- "sha256": "cec81982e180a2705bdfb16eae9ee6cb549b7bcea04cbc6e43de30007cbd344a"
+ "sha256": "88dcd3af740ce737cc323c653361bf45ec9979352400ef948b1ab8ab37e051f3"
},
{
"path": "IAvnCommandBarButton.g.cs",
- "sha256": "597a94184c386077fad8e88126b7bb92f430b053cc473830117068445de0dfae"
+ "sha256": "8bcfe3aa51ca9f07dfd3ca0748fc92758788afb396b60aaaadb4a7aa5a445b78"
},
{
"path": "IAvnCommandBarClosedHandler.g.cs",
@@ -179,19 +179,19 @@
},
{
"path": "IAvnCommandBarSeparator.g.cs",
- "sha256": "8fd25de5c066083b1ecca93b6a0adf2771ce418c3f99ff74e5178b09488b9953"
+ "sha256": "b47615bf2b29889d5f1cdb0a806a089f1484827ab4a2380801f8d845552b8540"
},
{
"path": "IAvnCommandBarToggleButton.g.cs",
- "sha256": "92dd6eb5f9ac954a57ceb0e6868dd8e224bdcfd86581ccfeb0073e737616f6e1"
+ "sha256": "3de431339b94c979b7d114cd52d8120d175db3fcbb6f4e53d1fe022b4c9ce241"
},
{
"path": "IAvnContentControl.g.cs",
- "sha256": "cc0aa04814ce45eb57c62e86dd01173613ef2654143de815e60c9f18c1ebcf9a"
+ "sha256": "1b8206b9bd96fc8c12b7b5b358748e32b8d74be2e4d6e282b17f3d27ce139686"
},
{
"path": "IAvnContextMenu.g.cs",
- "sha256": "52e5c27095bf38aa7240206533f967cc5bafca0718f441a17dc10e4b8e53e17c"
+ "sha256": "f8aaf52378fa6ccffe538a2a5594dbdba886f54db741a57914fd823b6085de58"
},
{
"path": "IAvnContextMenuClosingHandler.g.cs",
@@ -203,16 +203,28 @@
},
{
"path": "IAvnControl.g.cs",
- "sha256": "7c4ad3eae384fee1fbe1322d5e87fd40f2878fc7a4485c8f2777f7e211e22175"
+ "sha256": "6163875a62d0e969ff7f17675b69e8cfa4ed3777fe9ed467946206a0cc143f2b"
+ },
+ {
+ "path": "IAvnControlDoubleTappedHandler.g.cs",
+ "sha256": "3910943c09f6a262602a5fa4b199e8513067ba9fc43857cb2f6dc75a0b6a31d8"
},
{
"path": "IAvnControlFactory.g.cs",
"sha256": "0b16561747ebc843651c90574e80d5b5d4047ed1de15580b1017579f521a3d0d"
},
+ {
+ "path": "IAvnControlGotFocusHandler.g.cs",
+ "sha256": "0710d53e5740ac3fbdc72e7b3383bdd764135bad29cf901d4c1c0c8df19da6d3"
+ },
{
"path": "IAvnControlKeyDownHandler.g.cs",
"sha256": "0b187d8c401d810731e7ce37872c7c90d34a855b8b15ccc65f025992cb2e6c5e"
},
+ {
+ "path": "IAvnControlKeyUpHandler.g.cs",
+ "sha256": "5c5b2ef592d3c407b1c77a5fdf2e1856878a2347644182d35f962d585e0b693d"
+ },
{
"path": "IAvnControlList.g.cs",
"sha256": "05b3f6dc9d5721431fdb72880db358d77b0243aff3b6f71dfdfe714619126738"
@@ -221,18 +233,30 @@
"path": "IAvnControlLoadedHandler.g.cs",
"sha256": "f0f5a66674b7a657c5ab2781d729398be89859bae808d536516a3f9b6393228c"
},
+ {
+ "path": "IAvnControlLostFocusHandler.g.cs",
+ "sha256": "685d800933f2f955b85cf11e9eb580977ebd786a911c2163c3aa0c18866bcb6a"
+ },
{
"path": "IAvnControlPointerEnteredHandler.g.cs",
- "sha256": "fd84807be1efb7f5509b2c4ae9e456bd06d52c9fc8727fed4dd305540636fbb0"
+ "sha256": "b5d3ad5ab7d33cdb52a991a61afd3080788561168b64c8c4ce9166dee1fbe69c"
},
{
"path": "IAvnControlPointerExitedHandler.g.cs",
- "sha256": "a86108c11b2bc1fce7052de8052a47320fac06fa01c30bbc9b4f9c200dae0fed"
+ "sha256": "fdcc1b4e2a736fd3a8486900000883469b18a2d3bda75c3e904e6a53f37e3b82"
+ },
+ {
+ "path": "IAvnControlPointerWheelChangedHandler.g.cs",
+ "sha256": "264a6c18e6a73f73b61da627d62ce3c165c8d38ab2ee609d54918661906aa2a2"
},
{
"path": "IAvnControlSizeChangedHandler.g.cs",
"sha256": "5f3f554e45973763235aad7350ad22b0c476e9643857b86a82b4b8b21fd89033"
},
+ {
+ "path": "IAvnControlTappedHandler.g.cs",
+ "sha256": "f6801edfac3857a990f1284eab945d7619cefe5ab6186255fc15dc95b47a2260"
+ },
{
"path": "IAvnControlUnloadedHandler.g.cs",
"sha256": "b154f456f0681a13c011d7ff99f5927815c63c24657cc21396ec5d40293ed482"
@@ -243,7 +267,7 @@
},
{
"path": "IAvnDatePicker.g.cs",
- "sha256": "f3d9f55f73f71ce820062b08df524ab67edfb02dd4a8e9148610550e9a035be3"
+ "sha256": "c47d22bd0e0ff087ce15750f7e8ac3e460db5c629b999ee919e713c1bf9016a4"
},
{
"path": "IAvnDatePickerSelectedDateChangedHandler.g.cs",
@@ -255,11 +279,11 @@
},
{
"path": "IAvnDecorator.g.cs",
- "sha256": "e88f6411672f29ffdfa08efbb978aba67ca17e6625f98b5bec255d116d637261"
+ "sha256": "b2d7ad554e5e4a3fe74febfc2eccc0401b12f39377710a6e324dbf4ad40af528"
},
{
"path": "IAvnDockPanel.g.cs",
- "sha256": "c0cfae3ed6ab616eaf82ae461792fa6277c7536bb68252337b8ad979a90bb46f"
+ "sha256": "4bda4dd0781bed694440963cc6daf25c7810ab6a749ea8376977c78e456b56f0"
},
{
"path": "IAvnDockPanelStatics.g.cs",
@@ -267,15 +291,15 @@
},
{
"path": "IAvnDropDownButton.g.cs",
- "sha256": "bd086cbf4585a746837b78304891529fba7539a7329374592094d6ce743589af"
+ "sha256": "4c407ebc8096c3abd9dc200902d0e435c15f8375d52646b61755d7ee22dd1b2f"
},
{
"path": "IAvnEllipse.g.cs",
- "sha256": "a20813f32ac4a0624a948f588203c0dfee506919a7019b2e9ba408ab58219d37"
+ "sha256": "dbf48e8c902e8eda288915f32d0725059b9e615e999dd1cfbf42674c389a4f23"
},
{
"path": "IAvnExpander.g.cs",
- "sha256": "0f77543fd5f39274aae5c2069e6969cba86c7061ff98665e35bca9e0e06e3769"
+ "sha256": "7a44a474807c06794ff6163a0e348ac30df51b8f6eb3062ed7cfb2ed34a65a1f"
},
{
"path": "IAvnExpanderCollapsedHandler.g.cs",
@@ -295,7 +319,7 @@
},
{
"path": "IAvnFlexPanel.g.cs",
- "sha256": "f0d7c81a4187a5d74c71f49ec34e6537f9257a25caccb7f25271ffe08ffed9bf"
+ "sha256": "7fe2f232e2320b1f1a8a5905fc749b902963b5a31e6a176c4376e9021a26469e"
},
{
"path": "IAvnFlyout.g.cs",
@@ -315,11 +339,11 @@
},
{
"path": "IAvnGrid.g.cs",
- "sha256": "dc657cbc69548c23cc9323b0b420f65370366147753fa2bb6ffc30144491da68"
+ "sha256": "7454a3819c730c3ce65e84e0c923321d052bdc231f8aabb178df4b522e4db447"
},
{
"path": "IAvnGridSplitter.g.cs",
- "sha256": "3a40de1ca8f994ec3d91d083bed2d14647185adfdfabb5e2e51eea0ec79040b7"
+ "sha256": "5e6334c8f2a7d6a7775b3ad3221780e061722c27ff7ad43dd1d555377e1cb113"
},
{
"path": "IAvnGridStatics.g.cs",
@@ -327,31 +351,31 @@
},
{
"path": "IAvnGroupBox.g.cs",
- "sha256": "8d3ac22d1adc8e41f1d4225845caa309f3b457944c3c7a7dc46b9453f828e645"
+ "sha256": "012d9f818c079bac409b8f8519ea5a80be7cee39203bda026db438dbfc0b9e78"
},
{
"path": "IAvnHeaderedContentControl.g.cs",
- "sha256": "a03bf91738cb9ddff0c9f12447b745766f3dbf13712a8bf0f40e55c7dc984a11"
+ "sha256": "27ebce6e0bdf190e7ef92b71b5d7805ea93cc67acde7b95c71dcb3b29de0d716"
},
{
"path": "IAvnHeaderedItemsControl.g.cs",
- "sha256": "598ecbd41eed14b65199417cbd5d7e19310c5a44f232b6a81889704b99d71f14"
+ "sha256": "fc1889a6dffdbc040c6c6fd829c8da548999dcc015fcc8b807b8dcadf7052928"
},
{
"path": "IAvnHeaderedSelectingItemsControl.g.cs",
- "sha256": "6f2058756b7f1f17faa2d1cc3da8ef76596e435ae05edb75adb2116e9018a999"
+ "sha256": "19fdb41e38293a3058e8862d099c3ebe68ca2d9d418a83d4d2feb52a5e77baaa"
},
{
"path": "IAvnHyperlinkButton.g.cs",
- "sha256": "009653523b1cbb1d9f26d1f10af36662493ecc50e911773899a45a77f994cb15"
+ "sha256": "4f6a3119695361f09b85c81a7c9ffb79b0b0efec9737f37cc6e7f173429c0c7e"
},
{
"path": "IAvnIconElement.g.cs",
- "sha256": "8570ceb12f28afb6e337127bbe2b317bc07d67c48c1e3561ba7f68c8e38e9b01"
+ "sha256": "d20c6c74f37643822d0e9166822c580191299c2e841c56f0531bfe584411a9d4"
},
{
"path": "IAvnImage.g.cs",
- "sha256": "a078374c92658fbed3b03cb9c52c2b71286b1319cb21b5a6da927a8cbd979ab7"
+ "sha256": "1224a47af364f1ae4d6aa9ac18e0b1b269d877c8e66fe1cfc7f3a4b16a4fa638"
},
{
"path": "IAvnItemList.g.cs",
@@ -359,39 +383,39 @@
},
{
"path": "IAvnItemsControl.g.cs",
- "sha256": "58826137b148c1c8b9f45aa6d0e2981f8258fa613e1ba9fe41c36c79400cc70f"
+ "sha256": "0975455292c73f892f3ae86ffeebc5655e7c61d9c5338eb699cba2fb3303871e"
},
{
"path": "IAvnLabel.g.cs",
- "sha256": "6fe6f30b88d6c895310e5f7e2f8bed1c09fc8c910573d0ea096ae3cdf4553ebd"
+ "sha256": "27606811481f29c5636b6871a80c6aa1b9f8ba854f015f17e76f06fdd82a295b"
},
{
"path": "IAvnLayoutTransformControl.g.cs",
- "sha256": "4a13dce5f3abc824990ba41093f43485a86c62f5c17b1d420365e0256959d437"
+ "sha256": "24aaa408e170e399306d61f2a4f4fe7d3e3aceff8c726ade8a7e9f2b321ae5ed"
},
{
"path": "IAvnLine.g.cs",
- "sha256": "1a9665cc44fe50b5eaa3acca50afd3e8c911939d2e80846f2ecc874b28632067"
+ "sha256": "2325afd9e580e3744291543343c990b2a172341bb54fc86ca493fa2dae96d2bf"
},
{
"path": "IAvnListBox.g.cs",
- "sha256": "b5cfd1d0673a227afad783ea8ebddd94abd5dc7173dc9f5ff419710a8045dc6c"
+ "sha256": "922ec3f6ac3eb868b7c52fe9458b72540e00e4ef514c086747ac1363063da931"
},
{
"path": "IAvnListBoxItem.g.cs",
- "sha256": "72c726a605d4dfcf80d32c4bfd793fd5ad20a49c1d751e4788802c1b6291099c"
+ "sha256": "29110579bfbf27364f43175fe4334b490e2de1da0cd69f993c1a7d5eb8234940"
},
{
"path": "IAvnMaskedTextBox.g.cs",
- "sha256": "c7e94917d4c63813619dc09c3c5935db256d600cd88796ee6cf9e19dfda63abc"
+ "sha256": "49afca44798be6ef527ba0602f81022cc38a96f939e660c206eefa3eb586783f"
},
{
"path": "IAvnMenu.g.cs",
- "sha256": "42ca3033d02246c386ac4e653ec5d15a4b3cab69b3828d48b10d849385dc6c1e"
+ "sha256": "8976fec9cea9f37bd1a9e2db6dad4a1e211f05a5712bf1d777eb494e746f2216"
},
{
"path": "IAvnMenuBase.g.cs",
- "sha256": "014eed75e3fbc261e299fcc563275a9288458711fcd9ab0500a41a1ccc4640ef"
+ "sha256": "71293d935e47aa3f91421740fc20f740296594bb881c28ac8466b6594f34730e"
},
{
"path": "IAvnMenuBaseClosedHandler.g.cs",
@@ -407,7 +431,7 @@
},
{
"path": "IAvnMenuItem.g.cs",
- "sha256": "7a24a3d7cf2cf96fccfe56722a2c9da6d649a4342a79ddf4388d8b3184cfb471"
+ "sha256": "54d95d620186fb51820d1acc5fea022a2be4d11f935440e1d192f8e95a3dcef1"
},
{
"path": "IAvnMenuItemClickHandler.g.cs",
@@ -423,7 +447,7 @@
},
{
"path": "IAvnNotificationCard.g.cs",
- "sha256": "d1a6f3e925f3b6fe58a33962b7d774b543ab25c8901727feb425b8efea6fdfaf"
+ "sha256": "7bfe0f57efb3faf751eaab55b65fe92d36a2d1c933c9b8f5e24779646246705d"
},
{
"path": "IAvnNotificationCardNotificationClosedHandler.g.cs",
@@ -431,7 +455,7 @@
},
{
"path": "IAvnNumericUpDown.g.cs",
- "sha256": "8abc87664fe645c99438748a1f2a92c1a81b7fa3c995798ddb60bbaa26d09523"
+ "sha256": "b9eb8d91a93969af7323473d7e24ca2b965582f63f11b46026f0f6e71e1e320f"
},
{
"path": "IAvnNumericUpDownSpinnedHandler.g.cs",
@@ -439,23 +463,23 @@
},
{
"path": "IAvnNumericUpDownValueChangedHandler.g.cs",
- "sha256": "9becd19a0ca1df6bfd0b9c858c2b05ede19d28f783461941373d8e94983959fd"
+ "sha256": "7f759b9baccf1a0c98d4c5783e3d5dea7d60e50c557354f3d4b24e751336d8e3"
},
{
"path": "IAvnPanel.g.cs",
- "sha256": "22a0029f737e24708c749fd8683a8717a4dbcaf6f0d8d133a32cf1dbbabec97a"
+ "sha256": "23f271f40ed2b48be39b922df0b6f3513fd6bbc36550d90529051c7f0d9e41ce"
},
{
"path": "IAvnPath.g.cs",
- "sha256": "3bef1e24d4e7e1474be698fe5e7696c22d8df13c41f97551ad5c1514dc7e9b17"
+ "sha256": "fc235b9360a7329a30e6f685faa667e508e343f54939e6cdfd21020f2f0af26b"
},
{
"path": "IAvnPathIcon.g.cs",
- "sha256": "fe01de95ae12514ed529a0441d59e8d51c39e1aac6d7b93e9e22c5fb155de761"
+ "sha256": "90d16b24aa62c71045d21481e1ffe3b4e7ff65f3d923fc8b7a44f4aade9d79b3"
},
{
"path": "IAvnPipsPager.g.cs",
- "sha256": "032a107f435761d27f7946930d41df132ad19be95ca1a310cb85afb01a022adc"
+ "sha256": "96f751be02d3cb9b995a7201e8433fc36343a745e1d2c0bb66a24c8a26ff04d8"
},
{
"path": "IAvnPipsPagerSelectedIndexChangedHandler.g.cs",
@@ -463,15 +487,15 @@
},
{
"path": "IAvnPolygon.g.cs",
- "sha256": "690bf87e16b2a64df999f5e3d76e5bc3623dc717029385e11dde104461901bff"
+ "sha256": "5937a73857c8a024e1857c0345ad4390a5bbc8b8fa1545f68ab1598c0b941ee8"
},
{
"path": "IAvnPolyline.g.cs",
- "sha256": "b43472481ac14f8565c6c2e0ce2300db603407961a2d68b19cacb1813c476d64"
+ "sha256": "edfcfc9b9eaea88a6fc5deea161f5fcf1232f8a62343a2601395ddc43621fa37"
},
{
"path": "IAvnPopup.g.cs",
- "sha256": "591223ebea51227778c11141d841b402e4d4e4800d3e7d450bb97193f746588d"
+ "sha256": "f78224f32e4710af43cc8f67fdaec0dab5973c638511757a0bfddfc1be0288e7"
},
{
"path": "IAvnPopupClosedHandler.g.cs",
@@ -495,27 +519,27 @@
},
{
"path": "IAvnProgressBar.g.cs",
- "sha256": "6750e0644e98fe809333a1f39dcbddb07fa26d43dbe63f907dcd14c8c8da7058"
+ "sha256": "53fd7d42021c311ef40fa06c43ac5039d7b9213d646b523b6fc0a815b2b0f1da"
},
{
"path": "IAvnRadioButton.g.cs",
- "sha256": "cf816262a98c157f64ded99510fb83e2af0b5bd59a3b5fa4a00b5c328e610bcd"
+ "sha256": "0ca82f80529567ee5a431b382007eb442fa6b3396a4f752a1bc8ccb6d4ed4f17"
},
{
"path": "IAvnRangeBase.g.cs",
- "sha256": "31a161e0b4e367d37276b0fb185281f3fa537fb40b89a6b196256f3eb32283a5"
+ "sha256": "a7a3065b908d47d94ee4b80ded9fc25dc3a23d86ec698d613192768c822b0a86"
},
{
"path": "IAvnRangeBaseValueChangedHandler.g.cs",
- "sha256": "33ffa6b1abdc3eb6d61b66c55eb107905272e0a0cf0629ec039d3c34d04094b6"
+ "sha256": "7907d0cc1291c5b40c079e95265c55826fc1c3f3f40c2a401a00b6750cd842fc"
},
{
"path": "IAvnRectangle.g.cs",
- "sha256": "db506b168e776f3ab4503511a0649893d63356b7fd303180e105a6f5f6a73d2f"
+ "sha256": "f418a458349ec6d2b9c09bea6011c8d7f1c2919331518ad4e327b59303d101de"
},
{
"path": "IAvnRefreshContainer.g.cs",
- "sha256": "552d5713fa1c0a279373a66b8199b16879dadfc5d3ddad23f05f2a11d7b4a083"
+ "sha256": "67a46c1cba92690fd2d49ac4f45abf514dbaf57c3861e8a4cc87e59284aa82e7"
},
{
"path": "IAvnRefreshContainerRefreshRequestedHandler.g.cs",
@@ -523,7 +547,7 @@
},
{
"path": "IAvnRelativePanel.g.cs",
- "sha256": "1fea4e93fc172deff8f26887a97cbb9b04ac3def99cd30d7f7d6be6e7a49b250"
+ "sha256": "a865c89796e6ad943f0dfd8fc6db716daa6af4d4b2699bd05fdfb7ab115855e3"
},
{
"path": "IAvnRelativePanelStatics.g.cs",
@@ -531,11 +555,11 @@
},
{
"path": "IAvnRepeatButton.g.cs",
- "sha256": "272ea31c7d619dda2399bed6224433af503a5924533fc60595f380dd23f4b7fe"
+ "sha256": "0e6b71ccb689f728dce351520514b41434c62e925df6338be56196156139d50f"
},
{
"path": "IAvnScrollViewer.g.cs",
- "sha256": "194bef1f63869856fffb597b42c435687d95411b00998d75d02eb1d6ba62a213"
+ "sha256": "3d14db2c119c494fb8731e439f83cae3d76f249d7b218480a741f529c05c4537"
},
{
"path": "IAvnScrollViewerScrollChangedHandler.g.cs",
@@ -543,11 +567,11 @@
},
{
"path": "IAvnSector.g.cs",
- "sha256": "c343262c56d93a33284df114670c6a9e74c00d8b6fe29121d59ae5de539b29af"
+ "sha256": "ed43a68670b29d34842d7cdb946e39df8e58c7b9d3a33dd65757c5286229bdad"
},
{
"path": "IAvnSelectableTextBlock.g.cs",
- "sha256": "cbe1e9113f8f97a92640ea2334b597224fa6cf9de4cb0373dfed90b52566c728"
+ "sha256": "fe23a1791ce3e725b5dbc28b4f91f432bff3a5349de5ca585848ea64393e22da"
},
{
"path": "IAvnSelectableTextBlockCopyingToClipboardHandler.g.cs",
@@ -559,27 +583,27 @@
},
{
"path": "IAvnSelectingItemsControl.g.cs",
- "sha256": "3cf409bc49a05c89847845b9bf2a273b7356a42b021ead86e572c83b9d0b7ab2"
+ "sha256": "a4a0e86f83dba5828a22dc0732a786bd29bf1151b01ff3e05e082adf4df66b16"
},
{
"path": "IAvnSelectingItemsControlSelectionChangedHandler.g.cs",
- "sha256": "4cae2baaa187b918a00b828e5e9778170b1288283dfc551737afc447658503df"
+ "sha256": "e991504e74d731418b19868ecee9edfd62c4e342aa59a8979b6b7b13a4fc7856"
},
{
"path": "IAvnSeparator.g.cs",
- "sha256": "096179351875e2648923a249660bf34fb660259460342684a0b47d665e269b1b"
+ "sha256": "88bb1b9bc22a7ffd6488aa32a5dec48c9d92a15d93ac0042323464a74c4b5699"
},
{
"path": "IAvnShape.g.cs",
- "sha256": "7e6666c36266a9e1423199a058ba2005b9fb700ea2858a6d0bfdb7cd3c021c0b"
+ "sha256": "7d5c3f6893e2fc53ac11f6b89ae3bd098e3156c9d1ebb125b3f5265e69c8d8a6"
},
{
"path": "IAvnSlider.g.cs",
- "sha256": "22a164334a903b4249c5bade1bea5b468e4bbaec0840f414d5c0ba07c4cb859e"
+ "sha256": "011cc94cf97a5d987e82c0a5d0a0402bacc0fa1cdb13a6c9e7c309214ef69cf3"
},
{
"path": "IAvnSpinner.g.cs",
- "sha256": "5af8f13b3a84a2b5a2b600c07c46f66a02e2d8b95147bbe1819da14af3236724"
+ "sha256": "7a5976ad4798646874bfd5c7a9efb167f79646301c08a1ca352b41d02bbfd6d6"
},
{
"path": "IAvnSpinnerSpinHandler.g.cs",
@@ -587,7 +611,7 @@
},
{
"path": "IAvnSplitButton.g.cs",
- "sha256": "faf86530faa1083290c2aae0583e13bc816fbb129336f26f7388afdad53f6101"
+ "sha256": "d44ed0ffb7a0f6d16fec418e62715f6fde6c5471768dac14ad79c44c8c9f08d2"
},
{
"path": "IAvnSplitButtonClickHandler.g.cs",
@@ -595,7 +619,7 @@
},
{
"path": "IAvnSplitView.g.cs",
- "sha256": "73e61c5ad47bfbbd4927832c213449b23804ffb051097d8c8f188fca6d2d447f"
+ "sha256": "8f36899220cf8440bb98bff13f55d34194e4814711da0b25781141b7dfc07801"
},
{
"path": "IAvnSplitViewPaneClosedHandler.g.cs",
@@ -615,7 +639,7 @@
},
{
"path": "IAvnStackPanel.g.cs",
- "sha256": "6391c33268fb7e921dadf1dcdead13629caf8e0a2295f6040037bb4f94d10272"
+ "sha256": "5e04aab867a33da9770c8c922079a9795208c8983f08c43cfbb810f2ce29a56e"
},
{
"path": "IAvnStringList.g.cs",
@@ -651,19 +675,19 @@
},
{
"path": "IAvnTabControl.g.cs",
- "sha256": "78d1cb91ca9d95b464edbc837e053ecb0a0b8567f2a3b093e527f1384c369090"
+ "sha256": "0579dacc0253cbcf140404782fe90ea7ef1d020ed5910efbbd9126366a87526d"
},
{
"path": "IAvnTabItem.g.cs",
- "sha256": "9e7ca461d2aff8a0724dc611f549b6988f551c9ee090ee369c911dbc4e3eccb1"
+ "sha256": "6c4052bcbae857dc875f4fbae638def215d96ed3b3d8df1eb13bd8cdc15bc9b0"
},
{
"path": "IAvnTableView.g.cs",
- "sha256": "0558cfb03d0cb8a994e34826c5ce5107b1722da38f6b361cdc11a0033c0e51b5"
+ "sha256": "3fb60c1c96e940e291770f68f966f2d763e863d3df5a378df3ee136ec54a3e49"
},
{
"path": "IAvnTableViewCell.g.cs",
- "sha256": "30cad4cc82f06b89f620bca8a3bd362f76be4a5d5a44c62fca9f5c8b4809ec32"
+ "sha256": "f1dcc70e28d67011b1bd636888e61304b9d9f7da2f569d407a165cbe11e9e346"
},
{
"path": "IAvnTableViewColumn.g.cs",
@@ -671,19 +695,19 @@
},
{
"path": "IAvnTableViewRow.g.cs",
- "sha256": "91bd6ae3f4da55e9a473e44d4d6e6e50ceec91ca20fcb1114572fb3cb92a0af4"
+ "sha256": "bc72771e6a88c2ebcd9a8a36effcd0f2b1a12e613fbdcc00bc6f145633a48d43"
},
{
"path": "IAvnTemplatedControl.g.cs",
- "sha256": "f8d9df6840076db806935a8519abf31b6c3369e7194937fd870241c1c44278b0"
+ "sha256": "25163bdcfa3e98ca3a61e7d10a9483c57521d6639d29b3904022d3078dd61d24"
},
{
"path": "IAvnTextBlock.g.cs",
- "sha256": "fa3d4dc2cb40892612c595f86e415a619fc23d133fcaef5ba6ee11859f99aa43"
+ "sha256": "8b786ca8df751727ab64c4702cec0ce5aad200e14727046d39140d802406fe8f"
},
{
"path": "IAvnTextBox.g.cs",
- "sha256": "20d5eeb221afcb9264aa78172ed5437def531ffecaca18eb2fd3711507f51399"
+ "sha256": "6e45247b03594f39d816ffd23b80e1c5be30b18cf5a4336eef571dac4370186a"
},
{
"path": "IAvnTextBoxCopyingToClipboardHandler.g.cs",
@@ -707,11 +731,11 @@
},
{
"path": "IAvnThemeVariantScope.g.cs",
- "sha256": "41e18d283f253862ef215ce36ba30adfbe2369038974700baa3689c7545ea8ab"
+ "sha256": "29fa26948c0501a53aa7b61e9cf792f15ce86814db984ffe9c18027288b8d57d"
},
{
"path": "IAvnThumb.g.cs",
- "sha256": "024cdb96ff4164e79bb5414ff08e334d352c915977f70ccf7759c1d656e1a12f"
+ "sha256": "6bdebdb9a78e38b3c72a569531e7bda268518c5f1aa416c2e59009ab6224b28e"
},
{
"path": "IAvnThumbDragCompletedHandler.g.cs",
@@ -727,7 +751,7 @@
},
{
"path": "IAvnTimePicker.g.cs",
- "sha256": "fa0a06e02dc51c2acbaccdd821c2946c5665b1807e3e0c0dec21313cfe6ac1d4"
+ "sha256": "c2df238b0b786754d344930aa3c7206b0996ed7ca110ca47050aad738eec2e8d"
},
{
"path": "IAvnTimePickerSelectedTimeChangedHandler.g.cs",
@@ -735,7 +759,7 @@
},
{
"path": "IAvnToggleButton.g.cs",
- "sha256": "15c556ef23f2893bba1d624ab58b7fcff9b8cfe999675659ed89613b11ebd030"
+ "sha256": "05a4e0496706f032e15698ff35e7ba84ee4a86fc9887e479bea57fa3646ccf11"
},
{
"path": "IAvnToggleButtonIsCheckedChangedHandler.g.cs",
@@ -743,7 +767,7 @@
},
{
"path": "IAvnToggleSplitButton.g.cs",
- "sha256": "6cbec36127112fc5fd38533e84a6f383861e09dc90dd92e125a453aa3160189c"
+ "sha256": "9be104b557e92ea5af2a03690e4813363a71b3afed5883d889ea9e9bcc93a737"
},
{
"path": "IAvnToggleSplitButtonIsCheckedChangedHandler.g.cs",
@@ -751,11 +775,11 @@
},
{
"path": "IAvnToggleSwitch.g.cs",
- "sha256": "0bef03f0aea59b43d00203f2e1c427b7805f81a33fd84797804841409f9d8b9d"
+ "sha256": "14d3d4d19e855bcd874192f1736ab104b195c4de677b596f6e959c474cd4b0b8"
},
{
"path": "IAvnToolTip.g.cs",
- "sha256": "3506635f21f669f8b3ffcbed985159d17b46ae602812ecb1332957c8118f13a2"
+ "sha256": "4a499259a9c6054d75f1c777d302be1982e357a73f88cae5d2667d6a3b6fac89"
},
{
"path": "IAvnToolTipStatics.g.cs",
@@ -763,7 +787,7 @@
},
{
"path": "IAvnTransitioningContentControl.g.cs",
- "sha256": "2b159ba0d27f1aaa9b795f0d6b054eb7497f4a2e7e0028bf758354afff4d4dc2"
+ "sha256": "8c0446b5019c4b4e3f7c4fed39da553e7910208806e3d9eabdb705b3012076b4"
},
{
"path": "IAvnTransitioningContentControlTransitionCompletedHandler.g.cs",
@@ -779,11 +803,11 @@
},
{
"path": "IAvnTreeView.g.cs",
- "sha256": "e511f48ca6f83685ae570b7f10ea11203e98bfe5f6686fb5db5c8f54148fc8d5"
+ "sha256": "106fd13fbbeb42a06c3c9f6b17c14823658089d1bcfdbc1a395893ca47fc607a"
},
{
"path": "IAvnTreeViewItem.g.cs",
- "sha256": "60b2e912018528c8e4b210a00cfe89a362516f27df83968fdac55c815c58a9f0"
+ "sha256": "1a9a7ec479dd0bc186de56bcbd62d7606063efa7521d50010b33d71ae45f947d"
},
{
"path": "IAvnTreeViewItemCollapsedHandler.g.cs",
@@ -795,15 +819,15 @@
},
{
"path": "IAvnTreeViewSelectionChangedHandler.g.cs",
- "sha256": "b12b8768eac176770ba3afa59846d31cb1fda1bf8815372f0b7e01c05a08c8cc"
+ "sha256": "01b826adb47611cb9281d075c7c397c6615a05a0e4a571bc665a4cca2b3e8655"
},
{
"path": "IAvnUniformGrid.g.cs",
- "sha256": "9bea5d2135ba8aeec70ec4d72be3aead2424fc5823fcaa7c162705ea6be3af01"
+ "sha256": "f026632e46c72f856075c50ad8ca5bae288dbf9022e6380c397a116ae4ba452f"
},
{
"path": "IAvnUserControl.g.cs",
- "sha256": "155e77dcd2abee2cf2a9ffecd98ce841fd3ba70ec16d62cc11e7d57b6e1adbcd"
+ "sha256": "9a26c05cfb34644014a601f6a45c161025116868675eccdcc09a572a0eb2c3c1"
},
{
"path": "IAvnVariantList.g.cs",
@@ -811,11 +835,11 @@
},
{
"path": "IAvnViewbox.g.cs",
- "sha256": "4e025bc31e0a358bc8710b2e952f0f838564f214207aa8586d8745fd82379795"
+ "sha256": "0d9fe54d76a203a6399567f1264dffaf64e1c74af3d3d43cd7bac5930686ae54"
},
{
"path": "IAvnWindow.g.cs",
- "sha256": "c9153c57041331265ecca0e7c35f35131768819bb7eae89a2e5905dd5f85cddd"
+ "sha256": "58fc4e7e8363d734b81f22fcec467782d09782b3949acb77f6f48202a962f46f"
},
{
"path": "IAvnWindowClosingHandler.g.cs",
@@ -823,11 +847,11 @@
},
{
"path": "IAvnWindowNotificationManager.g.cs",
- "sha256": "e52935ea45263f5c45745cd3ff003f85be2ddda1e4430dfe3cc97bb86566d0f1"
+ "sha256": "045ed08dfb347d9d10b4bb473ba2832ef9d0a99b87ee2f2e307c8e7a829885e6"
},
{
"path": "IAvnWrapPanel.g.cs",
- "sha256": "aa430137c7221d737ae2652b78883575a409f8770725dc2dd2c17b1f4977025e"
+ "sha256": "de88b27dc869fe6b6544fa236ffe2d0751c09559cd435537a9fc08c4756a6b77"
},
{
"path": "ProjectionAotRoots.g.cs",
diff --git a/host/Generated/ObjectModel/IAvnArc.g.cs b/host/Generated/ObjectModel/IAvnArc.g.cs
index ee3dcc5..076fe31 100644
--- a/host/Generated/ObjectModel/IAvnArc.g.cs
+++ b/host/Generated/ObjectModel/IAvnArc.g.cs
@@ -7,7 +7,7 @@
namespace Avalonia.Host.Com;
[GeneratedComInterface(StringMarshalling = StringMarshalling.Utf16)]
-[Guid("80597080-EEDD-5CAA-B4F1-88D78CA23B79")]
+[Guid("2DACA1F8-5364-5CB5-B471-81682B00E389")]
public partial interface IAvnArc : IAvnShape
{
[PreserveSig]
@@ -47,12 +47,24 @@ public sealed partial class AvnArc : IAvnArc
private long _nextUnloadedSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _sizeChangedSubscriptions = new();
private long _nextSizeChangedSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _gotFocusSubscriptions = new();
+ private long _nextGotFocusSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _lostFocusSubscriptions = new();
+ private long _nextLostFocusSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _keyDownSubscriptions = new();
private long _nextKeyDownSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _keyUpSubscriptions = new();
+ private long _nextKeyUpSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _pointerEnteredSubscriptions = new();
private long _nextPointerEnteredSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _pointerExitedSubscriptions = new();
private long _nextPointerExitedSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _pointerWheelChangedSubscriptions = new();
+ private long _nextPointerWheelChangedSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _tappedSubscriptions = new();
+ private long _nextTappedSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _doubleTappedSubscriptions = new();
+ private long _nextDoubleTappedSubscriptionId;
internal AvnArc(global::Avalonia.Controls.Shapes.Arc value)
{
@@ -959,6 +971,37 @@ public int SetVerticalAlignment(int value)
}
}
+ public int GetFocusable(out int value)
+ {
+ value = default;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ value = _value.Focusable ? 1 : 0;
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int SetFocusable(int value)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ _value.Focusable = value != 0;
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int GetIsEnabled(out int value)
{
value = default;
@@ -990,6 +1033,22 @@ public int SetIsEnabled(int value)
}
}
+ public int FocusWithNavigationMethodAndKeyModifiers(int method, int keyModifiers, out int value)
+ {
+ value = default;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ value = _value.Focus((global::Avalonia.Input.NavigationMethod)method, (global::Avalonia.Input.KeyModifiers)keyModifiers) ? 1 : 0;
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int AdviseLoaded(IAvnControlLoadedHandler? handler, out long subscriptionId)
{
subscriptionId = 0;
@@ -1128,6 +1187,98 @@ public int UnadviseSizeChanged(long subscriptionId)
}
}
+ public int AdviseGotFocus(IAvnControlGotFocusHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke((int)eventArgs.NavigationMethod, (int)eventArgs.KeyModifiers);
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.GotFocus += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextGotFocusSubscriptionId);
+ _gotFocusSubscriptions.Add(subscriptionId, (handler, () => eventSource.GotFocus -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseGotFocus(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_gotFocusSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int AdviseLostFocus(IAvnControlLostFocusHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke();
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.LostFocus += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextLostFocusSubscriptionId);
+ _lostFocusSubscriptions.Add(subscriptionId, (handler, () => eventSource.LostFocus -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseLostFocus(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_lostFocusSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int AdviseKeyDown(IAvnControlKeyDownHandler? handler, out long subscriptionId)
{
subscriptionId = 0;
@@ -1176,6 +1327,54 @@ public int UnadviseKeyDown(long subscriptionId)
}
}
+ public int AdviseKeyUp(IAvnControlKeyUpHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var handled = eventArgs.Handled ? 1 : 0;
+ var hr = handler.Invoke((int)eventArgs.Key, (int)eventArgs.PhysicalKey, (int)eventArgs.KeyModifiers, eventArgs.KeySymbol, ref handled);
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ eventArgs.Handled = handled != 0;
+ });
+ eventSource.KeyUp += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextKeyUpSubscriptionId);
+ _keyUpSubscriptions.Add(subscriptionId, (handler, () => eventSource.KeyUp -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseKeyUp(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_keyUpSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int AdvisePointerEntered(IAvnControlPointerEnteredHandler? handler, out long subscriptionId)
{
subscriptionId = 0;
@@ -1188,7 +1387,7 @@ public int AdvisePointerEntered(IAvnControlPointerEnteredHandler? handler, out l
var eventSource = _value;
var callback = new global::System.EventHandler((_, eventArgs) =>
{
- var hr = handler.Invoke();
+ var hr = handler.Invoke((int)eventArgs.KeyModifiers);
if (hr < 0)
global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
});
@@ -1234,7 +1433,7 @@ public int AdvisePointerExited(IAvnControlPointerExitedHandler? handler, out lon
var eventSource = _value;
var callback = new global::System.EventHandler((_, eventArgs) =>
{
- var hr = handler.Invoke();
+ var hr = handler.Invoke((int)eventArgs.KeyModifiers);
if (hr < 0)
global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
});
@@ -1268,6 +1467,144 @@ public int UnadvisePointerExited(long subscriptionId)
}
}
+ public int AdvisePointerWheelChanged(IAvnControlPointerWheelChangedHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke(AvnVector.FromAvalonia(eventArgs.Delta), (int)eventArgs.KeyModifiers);
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.PointerWheelChanged += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextPointerWheelChangedSubscriptionId);
+ _pointerWheelChangedSubscriptions.Add(subscriptionId, (handler, () => eventSource.PointerWheelChanged -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadvisePointerWheelChanged(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_pointerWheelChangedSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int AdviseTapped(IAvnControlTappedHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke((int)eventArgs.KeyModifiers);
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.Tapped += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextTappedSubscriptionId);
+ _tappedSubscriptions.Add(subscriptionId, (handler, () => eventSource.Tapped -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseTapped(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_tappedSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int AdviseDoubleTapped(IAvnControlDoubleTappedHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke();
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.DoubleTapped += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextDoubleTappedSubscriptionId);
+ _doubleTappedSubscriptions.Add(subscriptionId, (handler, () => eventSource.DoubleTapped -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseDoubleTapped(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_doubleTappedSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int GetFill(out IAvnBrush? value)
{
value = default;
@@ -1665,12 +2002,30 @@ private void ReleaseSubscriptions()
global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
}
_sizeChangedSubscriptions.Clear();
+ foreach (var subscription in _gotFocusSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _gotFocusSubscriptions.Clear();
+ foreach (var subscription in _lostFocusSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _lostFocusSubscriptions.Clear();
foreach (var subscription in _keyDownSubscriptions.Values)
{
subscription.Unsubscribe();
global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
}
_keyDownSubscriptions.Clear();
+ foreach (var subscription in _keyUpSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _keyUpSubscriptions.Clear();
foreach (var subscription in _pointerEnteredSubscriptions.Values)
{
subscription.Unsubscribe();
@@ -1683,5 +2038,23 @@ private void ReleaseSubscriptions()
global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
}
_pointerExitedSubscriptions.Clear();
+ foreach (var subscription in _pointerWheelChangedSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _pointerWheelChangedSubscriptions.Clear();
+ foreach (var subscription in _tappedSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _tappedSubscriptions.Clear();
+ foreach (var subscription in _doubleTappedSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _doubleTappedSubscriptions.Clear();
}
}
diff --git a/host/Generated/ObjectModel/IAvnAutoCompleteBox.g.cs b/host/Generated/ObjectModel/IAvnAutoCompleteBox.g.cs
index d797ed2..734a172 100644
--- a/host/Generated/ObjectModel/IAvnAutoCompleteBox.g.cs
+++ b/host/Generated/ObjectModel/IAvnAutoCompleteBox.g.cs
@@ -7,7 +7,7 @@
namespace Avalonia.Host.Com;
[GeneratedComInterface(StringMarshalling = StringMarshalling.Utf16)]
-[Guid("92CEFC39-4E40-5193-893F-F3E2C77ED24C")]
+[Guid("6D1670C7-0D52-5BB1-8289-6C2617B74A6C")]
public partial interface IAvnAutoCompleteBox : IAvnTemplatedControl
{
[PreserveSig]
@@ -221,12 +221,24 @@ public sealed partial class AvnAutoCompleteBox : IAvnAutoCompleteBox
private long _nextUnloadedSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _sizeChangedSubscriptions = new();
private long _nextSizeChangedSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _gotFocusSubscriptions = new();
+ private long _nextGotFocusSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _lostFocusSubscriptions = new();
+ private long _nextLostFocusSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _keyDownSubscriptions = new();
private long _nextKeyDownSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _keyUpSubscriptions = new();
+ private long _nextKeyUpSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _pointerEnteredSubscriptions = new();
private long _nextPointerEnteredSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _pointerExitedSubscriptions = new();
private long _nextPointerExitedSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _pointerWheelChangedSubscriptions = new();
+ private long _nextPointerWheelChangedSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _tappedSubscriptions = new();
+ private long _nextTappedSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _doubleTappedSubscriptions = new();
+ private long _nextDoubleTappedSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _textChangedSubscriptions = new();
private long _nextTextChangedSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _populatingSubscriptions = new();
@@ -1149,6 +1161,37 @@ public int SetVerticalAlignment(int value)
}
}
+ public int GetFocusable(out int value)
+ {
+ value = default;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ value = _value.Focusable ? 1 : 0;
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int SetFocusable(int value)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ _value.Focusable = value != 0;
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int GetIsEnabled(out int value)
{
value = default;
@@ -1180,6 +1223,22 @@ public int SetIsEnabled(int value)
}
}
+ public int FocusWithNavigationMethodAndKeyModifiers(int method, int keyModifiers, out int value)
+ {
+ value = default;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ value = _value.Focus((global::Avalonia.Input.NavigationMethod)method, (global::Avalonia.Input.KeyModifiers)keyModifiers) ? 1 : 0;
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int AdviseLoaded(IAvnControlLoadedHandler? handler, out long subscriptionId)
{
subscriptionId = 0;
@@ -1318,6 +1377,98 @@ public int UnadviseSizeChanged(long subscriptionId)
}
}
+ public int AdviseGotFocus(IAvnControlGotFocusHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke((int)eventArgs.NavigationMethod, (int)eventArgs.KeyModifiers);
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.GotFocus += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextGotFocusSubscriptionId);
+ _gotFocusSubscriptions.Add(subscriptionId, (handler, () => eventSource.GotFocus -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseGotFocus(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_gotFocusSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int AdviseLostFocus(IAvnControlLostFocusHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke();
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.LostFocus += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextLostFocusSubscriptionId);
+ _lostFocusSubscriptions.Add(subscriptionId, (handler, () => eventSource.LostFocus -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseLostFocus(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_lostFocusSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int AdviseKeyDown(IAvnControlKeyDownHandler? handler, out long subscriptionId)
{
subscriptionId = 0;
@@ -1366,6 +1517,54 @@ public int UnadviseKeyDown(long subscriptionId)
}
}
+ public int AdviseKeyUp(IAvnControlKeyUpHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var handled = eventArgs.Handled ? 1 : 0;
+ var hr = handler.Invoke((int)eventArgs.Key, (int)eventArgs.PhysicalKey, (int)eventArgs.KeyModifiers, eventArgs.KeySymbol, ref handled);
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ eventArgs.Handled = handled != 0;
+ });
+ eventSource.KeyUp += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextKeyUpSubscriptionId);
+ _keyUpSubscriptions.Add(subscriptionId, (handler, () => eventSource.KeyUp -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseKeyUp(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_keyUpSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int AdvisePointerEntered(IAvnControlPointerEnteredHandler? handler, out long subscriptionId)
{
subscriptionId = 0;
@@ -1378,7 +1577,7 @@ public int AdvisePointerEntered(IAvnControlPointerEnteredHandler? handler, out l
var eventSource = _value;
var callback = new global::System.EventHandler((_, eventArgs) =>
{
- var hr = handler.Invoke();
+ var hr = handler.Invoke((int)eventArgs.KeyModifiers);
if (hr < 0)
global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
});
@@ -1424,7 +1623,7 @@ public int AdvisePointerExited(IAvnControlPointerExitedHandler? handler, out lon
var eventSource = _value;
var callback = new global::System.EventHandler((_, eventArgs) =>
{
- var hr = handler.Invoke();
+ var hr = handler.Invoke((int)eventArgs.KeyModifiers);
if (hr < 0)
global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
});
@@ -1458,6 +1657,144 @@ public int UnadvisePointerExited(long subscriptionId)
}
}
+ public int AdvisePointerWheelChanged(IAvnControlPointerWheelChangedHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke(AvnVector.FromAvalonia(eventArgs.Delta), (int)eventArgs.KeyModifiers);
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.PointerWheelChanged += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextPointerWheelChangedSubscriptionId);
+ _pointerWheelChangedSubscriptions.Add(subscriptionId, (handler, () => eventSource.PointerWheelChanged -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadvisePointerWheelChanged(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_pointerWheelChangedSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int AdviseTapped(IAvnControlTappedHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke((int)eventArgs.KeyModifiers);
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.Tapped += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextTappedSubscriptionId);
+ _tappedSubscriptions.Add(subscriptionId, (handler, () => eventSource.Tapped -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseTapped(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_tappedSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int AdviseDoubleTapped(IAvnControlDoubleTappedHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke();
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.DoubleTapped += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextDoubleTappedSubscriptionId);
+ _doubleTappedSubscriptions.Add(subscriptionId, (handler, () => eventSource.DoubleTapped -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseDoubleTapped(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_doubleTappedSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int GetBackground(out IAvnBrush? value)
{
value = default;
@@ -3039,12 +3376,30 @@ private void ReleaseSubscriptions()
global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
}
_sizeChangedSubscriptions.Clear();
+ foreach (var subscription in _gotFocusSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _gotFocusSubscriptions.Clear();
+ foreach (var subscription in _lostFocusSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _lostFocusSubscriptions.Clear();
foreach (var subscription in _keyDownSubscriptions.Values)
{
subscription.Unsubscribe();
global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
}
_keyDownSubscriptions.Clear();
+ foreach (var subscription in _keyUpSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _keyUpSubscriptions.Clear();
foreach (var subscription in _pointerEnteredSubscriptions.Values)
{
subscription.Unsubscribe();
@@ -3057,6 +3412,24 @@ private void ReleaseSubscriptions()
global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
}
_pointerExitedSubscriptions.Clear();
+ foreach (var subscription in _pointerWheelChangedSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _pointerWheelChangedSubscriptions.Clear();
+ foreach (var subscription in _tappedSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _tappedSubscriptions.Clear();
+ foreach (var subscription in _doubleTappedSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _doubleTappedSubscriptions.Clear();
foreach (var subscription in _textChangedSubscriptions.Values)
{
subscription.Unsubscribe();
diff --git a/host/Generated/ObjectModel/IAvnBorder.g.cs b/host/Generated/ObjectModel/IAvnBorder.g.cs
index 7d53c87..0162400 100644
--- a/host/Generated/ObjectModel/IAvnBorder.g.cs
+++ b/host/Generated/ObjectModel/IAvnBorder.g.cs
@@ -7,7 +7,7 @@
namespace Avalonia.Host.Com;
[GeneratedComInterface(StringMarshalling = StringMarshalling.Utf16)]
-[Guid("80C1079E-AFDF-5483-A560-2DDB475CF894")]
+[Guid("430F4A36-8B46-5F3C-8E4D-BD11AA522969")]
public partial interface IAvnBorder : IAvnDecorator
{
[PreserveSig]
@@ -74,12 +74,24 @@ public sealed partial class AvnBorder : IAvnBorder
private long _nextUnloadedSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _sizeChangedSubscriptions = new();
private long _nextSizeChangedSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _gotFocusSubscriptions = new();
+ private long _nextGotFocusSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _lostFocusSubscriptions = new();
+ private long _nextLostFocusSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _keyDownSubscriptions = new();
private long _nextKeyDownSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _keyUpSubscriptions = new();
+ private long _nextKeyUpSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _pointerEnteredSubscriptions = new();
private long _nextPointerEnteredSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _pointerExitedSubscriptions = new();
private long _nextPointerExitedSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _pointerWheelChangedSubscriptions = new();
+ private long _nextPointerWheelChangedSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _tappedSubscriptions = new();
+ private long _nextTappedSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _doubleTappedSubscriptions = new();
+ private long _nextDoubleTappedSubscriptionId;
internal AvnBorder(global::Avalonia.Controls.Border value)
{
@@ -986,6 +998,37 @@ public int SetVerticalAlignment(int value)
}
}
+ public int GetFocusable(out int value)
+ {
+ value = default;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ value = _value.Focusable ? 1 : 0;
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int SetFocusable(int value)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ _value.Focusable = value != 0;
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int GetIsEnabled(out int value)
{
value = default;
@@ -1017,6 +1060,22 @@ public int SetIsEnabled(int value)
}
}
+ public int FocusWithNavigationMethodAndKeyModifiers(int method, int keyModifiers, out int value)
+ {
+ value = default;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ value = _value.Focus((global::Avalonia.Input.NavigationMethod)method, (global::Avalonia.Input.KeyModifiers)keyModifiers) ? 1 : 0;
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int AdviseLoaded(IAvnControlLoadedHandler? handler, out long subscriptionId)
{
subscriptionId = 0;
@@ -1155,6 +1214,98 @@ public int UnadviseSizeChanged(long subscriptionId)
}
}
+ public int AdviseGotFocus(IAvnControlGotFocusHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke((int)eventArgs.NavigationMethod, (int)eventArgs.KeyModifiers);
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.GotFocus += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextGotFocusSubscriptionId);
+ _gotFocusSubscriptions.Add(subscriptionId, (handler, () => eventSource.GotFocus -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseGotFocus(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_gotFocusSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int AdviseLostFocus(IAvnControlLostFocusHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke();
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.LostFocus += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextLostFocusSubscriptionId);
+ _lostFocusSubscriptions.Add(subscriptionId, (handler, () => eventSource.LostFocus -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseLostFocus(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_lostFocusSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int AdviseKeyDown(IAvnControlKeyDownHandler? handler, out long subscriptionId)
{
subscriptionId = 0;
@@ -1203,6 +1354,54 @@ public int UnadviseKeyDown(long subscriptionId)
}
}
+ public int AdviseKeyUp(IAvnControlKeyUpHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var handled = eventArgs.Handled ? 1 : 0;
+ var hr = handler.Invoke((int)eventArgs.Key, (int)eventArgs.PhysicalKey, (int)eventArgs.KeyModifiers, eventArgs.KeySymbol, ref handled);
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ eventArgs.Handled = handled != 0;
+ });
+ eventSource.KeyUp += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextKeyUpSubscriptionId);
+ _keyUpSubscriptions.Add(subscriptionId, (handler, () => eventSource.KeyUp -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseKeyUp(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_keyUpSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int AdvisePointerEntered(IAvnControlPointerEnteredHandler? handler, out long subscriptionId)
{
subscriptionId = 0;
@@ -1215,7 +1414,7 @@ public int AdvisePointerEntered(IAvnControlPointerEnteredHandler? handler, out l
var eventSource = _value;
var callback = new global::System.EventHandler((_, eventArgs) =>
{
- var hr = handler.Invoke();
+ var hr = handler.Invoke((int)eventArgs.KeyModifiers);
if (hr < 0)
global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
});
@@ -1261,7 +1460,7 @@ public int AdvisePointerExited(IAvnControlPointerExitedHandler? handler, out lon
var eventSource = _value;
var callback = new global::System.EventHandler((_, eventArgs) =>
{
- var hr = handler.Invoke();
+ var hr = handler.Invoke((int)eventArgs.KeyModifiers);
if (hr < 0)
global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
});
@@ -1295,6 +1494,144 @@ public int UnadvisePointerExited(long subscriptionId)
}
}
+ public int AdvisePointerWheelChanged(IAvnControlPointerWheelChangedHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke(AvnVector.FromAvalonia(eventArgs.Delta), (int)eventArgs.KeyModifiers);
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.PointerWheelChanged += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextPointerWheelChangedSubscriptionId);
+ _pointerWheelChangedSubscriptions.Add(subscriptionId, (handler, () => eventSource.PointerWheelChanged -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadvisePointerWheelChanged(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_pointerWheelChangedSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int AdviseTapped(IAvnControlTappedHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke((int)eventArgs.KeyModifiers);
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.Tapped += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextTappedSubscriptionId);
+ _tappedSubscriptions.Add(subscriptionId, (handler, () => eventSource.Tapped -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseTapped(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_tappedSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int AdviseDoubleTapped(IAvnControlDoubleTappedHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke();
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.DoubleTapped += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextDoubleTappedSubscriptionId);
+ _doubleTappedSubscriptions.Add(subscriptionId, (handler, () => eventSource.DoubleTapped -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseDoubleTapped(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_doubleTappedSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int GetChild(out IAvnControl? value)
{
value = default;
@@ -1615,12 +1952,30 @@ private void ReleaseSubscriptions()
global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
}
_sizeChangedSubscriptions.Clear();
+ foreach (var subscription in _gotFocusSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _gotFocusSubscriptions.Clear();
+ foreach (var subscription in _lostFocusSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _lostFocusSubscriptions.Clear();
foreach (var subscription in _keyDownSubscriptions.Values)
{
subscription.Unsubscribe();
global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
}
_keyDownSubscriptions.Clear();
+ foreach (var subscription in _keyUpSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _keyUpSubscriptions.Clear();
foreach (var subscription in _pointerEnteredSubscriptions.Values)
{
subscription.Unsubscribe();
@@ -1633,5 +1988,23 @@ private void ReleaseSubscriptions()
global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
}
_pointerExitedSubscriptions.Clear();
+ foreach (var subscription in _pointerWheelChangedSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _pointerWheelChangedSubscriptions.Clear();
+ foreach (var subscription in _tappedSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _tappedSubscriptions.Clear();
+ foreach (var subscription in _doubleTappedSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _doubleTappedSubscriptions.Clear();
}
}
diff --git a/host/Generated/ObjectModel/IAvnButton.g.cs b/host/Generated/ObjectModel/IAvnButton.g.cs
index bdc6215..43c1e7d 100644
--- a/host/Generated/ObjectModel/IAvnButton.g.cs
+++ b/host/Generated/ObjectModel/IAvnButton.g.cs
@@ -7,7 +7,7 @@
namespace Avalonia.Host.Com;
[GeneratedComInterface(StringMarshalling = StringMarshalling.Utf16)]
-[Guid("62D66949-2173-5007-9613-1F4B3E7C144E")]
+[Guid("085861C8-F91D-5AFE-B57A-E601477FC2D2")]
public partial interface IAvnButton : IAvnContentControl
{
[PreserveSig]
@@ -86,12 +86,24 @@ public sealed partial class AvnButton : IAvnButton
private long _nextUnloadedSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _sizeChangedSubscriptions = new();
private long _nextSizeChangedSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _gotFocusSubscriptions = new();
+ private long _nextGotFocusSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _lostFocusSubscriptions = new();
+ private long _nextLostFocusSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _keyDownSubscriptions = new();
private long _nextKeyDownSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _keyUpSubscriptions = new();
+ private long _nextKeyUpSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _pointerEnteredSubscriptions = new();
private long _nextPointerEnteredSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _pointerExitedSubscriptions = new();
private long _nextPointerExitedSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _pointerWheelChangedSubscriptions = new();
+ private long _nextPointerWheelChangedSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _tappedSubscriptions = new();
+ private long _nextTappedSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _doubleTappedSubscriptions = new();
+ private long _nextDoubleTappedSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _clickSubscriptions = new();
private long _nextClickSubscriptionId;
@@ -1000,6 +1012,37 @@ public int SetVerticalAlignment(int value)
}
}
+ public int GetFocusable(out int value)
+ {
+ value = default;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ value = _value.Focusable ? 1 : 0;
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int SetFocusable(int value)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ _value.Focusable = value != 0;
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int GetIsEnabled(out int value)
{
value = default;
@@ -1031,6 +1074,22 @@ public int SetIsEnabled(int value)
}
}
+ public int FocusWithNavigationMethodAndKeyModifiers(int method, int keyModifiers, out int value)
+ {
+ value = default;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ value = _value.Focus((global::Avalonia.Input.NavigationMethod)method, (global::Avalonia.Input.KeyModifiers)keyModifiers) ? 1 : 0;
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int AdviseLoaded(IAvnControlLoadedHandler? handler, out long subscriptionId)
{
subscriptionId = 0;
@@ -1169,6 +1228,98 @@ public int UnadviseSizeChanged(long subscriptionId)
}
}
+ public int AdviseGotFocus(IAvnControlGotFocusHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke((int)eventArgs.NavigationMethod, (int)eventArgs.KeyModifiers);
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.GotFocus += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextGotFocusSubscriptionId);
+ _gotFocusSubscriptions.Add(subscriptionId, (handler, () => eventSource.GotFocus -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseGotFocus(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_gotFocusSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int AdviseLostFocus(IAvnControlLostFocusHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke();
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.LostFocus += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextLostFocusSubscriptionId);
+ _lostFocusSubscriptions.Add(subscriptionId, (handler, () => eventSource.LostFocus -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseLostFocus(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_lostFocusSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int AdviseKeyDown(IAvnControlKeyDownHandler? handler, out long subscriptionId)
{
subscriptionId = 0;
@@ -1217,6 +1368,54 @@ public int UnadviseKeyDown(long subscriptionId)
}
}
+ public int AdviseKeyUp(IAvnControlKeyUpHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var handled = eventArgs.Handled ? 1 : 0;
+ var hr = handler.Invoke((int)eventArgs.Key, (int)eventArgs.PhysicalKey, (int)eventArgs.KeyModifiers, eventArgs.KeySymbol, ref handled);
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ eventArgs.Handled = handled != 0;
+ });
+ eventSource.KeyUp += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextKeyUpSubscriptionId);
+ _keyUpSubscriptions.Add(subscriptionId, (handler, () => eventSource.KeyUp -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseKeyUp(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_keyUpSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int AdvisePointerEntered(IAvnControlPointerEnteredHandler? handler, out long subscriptionId)
{
subscriptionId = 0;
@@ -1229,7 +1428,7 @@ public int AdvisePointerEntered(IAvnControlPointerEnteredHandler? handler, out l
var eventSource = _value;
var callback = new global::System.EventHandler((_, eventArgs) =>
{
- var hr = handler.Invoke();
+ var hr = handler.Invoke((int)eventArgs.KeyModifiers);
if (hr < 0)
global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
});
@@ -1275,7 +1474,7 @@ public int AdvisePointerExited(IAvnControlPointerExitedHandler? handler, out lon
var eventSource = _value;
var callback = new global::System.EventHandler((_, eventArgs) =>
{
- var hr = handler.Invoke();
+ var hr = handler.Invoke((int)eventArgs.KeyModifiers);
if (hr < 0)
global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
});
@@ -1309,6 +1508,144 @@ public int UnadvisePointerExited(long subscriptionId)
}
}
+ public int AdvisePointerWheelChanged(IAvnControlPointerWheelChangedHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke(AvnVector.FromAvalonia(eventArgs.Delta), (int)eventArgs.KeyModifiers);
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.PointerWheelChanged += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextPointerWheelChangedSubscriptionId);
+ _pointerWheelChangedSubscriptions.Add(subscriptionId, (handler, () => eventSource.PointerWheelChanged -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadvisePointerWheelChanged(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_pointerWheelChangedSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int AdviseTapped(IAvnControlTappedHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke((int)eventArgs.KeyModifiers);
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.Tapped += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextTappedSubscriptionId);
+ _tappedSubscriptions.Add(subscriptionId, (handler, () => eventSource.Tapped -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseTapped(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_tappedSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int AdviseDoubleTapped(IAvnControlDoubleTappedHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke();
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.DoubleTapped += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextDoubleTappedSubscriptionId);
+ _doubleTappedSubscriptions.Add(subscriptionId, (handler, () => eventSource.DoubleTapped -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseDoubleTapped(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_doubleTappedSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int GetBackground(out IAvnBrush? value)
{
value = default;
@@ -2202,12 +2539,30 @@ private void ReleaseSubscriptions()
global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
}
_sizeChangedSubscriptions.Clear();
+ foreach (var subscription in _gotFocusSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _gotFocusSubscriptions.Clear();
+ foreach (var subscription in _lostFocusSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _lostFocusSubscriptions.Clear();
foreach (var subscription in _keyDownSubscriptions.Values)
{
subscription.Unsubscribe();
global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
}
_keyDownSubscriptions.Clear();
+ foreach (var subscription in _keyUpSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _keyUpSubscriptions.Clear();
foreach (var subscription in _pointerEnteredSubscriptions.Values)
{
subscription.Unsubscribe();
@@ -2220,6 +2575,24 @@ private void ReleaseSubscriptions()
global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
}
_pointerExitedSubscriptions.Clear();
+ foreach (var subscription in _pointerWheelChangedSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _pointerWheelChangedSubscriptions.Clear();
+ foreach (var subscription in _tappedSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _tappedSubscriptions.Clear();
+ foreach (var subscription in _doubleTappedSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _doubleTappedSubscriptions.Clear();
foreach (var subscription in _clickSubscriptions.Values)
{
subscription.Unsubscribe();
diff --git a/host/Generated/ObjectModel/IAvnButtonSpinner.g.cs b/host/Generated/ObjectModel/IAvnButtonSpinner.g.cs
index 2324351..1e9f75f 100644
--- a/host/Generated/ObjectModel/IAvnButtonSpinner.g.cs
+++ b/host/Generated/ObjectModel/IAvnButtonSpinner.g.cs
@@ -7,7 +7,7 @@
namespace Avalonia.Host.Com;
[GeneratedComInterface(StringMarshalling = StringMarshalling.Utf16)]
-[Guid("046C4736-CECE-5455-98A8-F2DD3C84C846")]
+[Guid("907404D5-1DE4-574D-990E-2D8A79373D6D")]
public partial interface IAvnButtonSpinner : IAvnSpinner
{
[PreserveSig]
@@ -53,12 +53,24 @@ public sealed partial class AvnButtonSpinner : IAvnButtonSpinner
private long _nextUnloadedSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _sizeChangedSubscriptions = new();
private long _nextSizeChangedSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _gotFocusSubscriptions = new();
+ private long _nextGotFocusSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _lostFocusSubscriptions = new();
+ private long _nextLostFocusSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _keyDownSubscriptions = new();
private long _nextKeyDownSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _keyUpSubscriptions = new();
+ private long _nextKeyUpSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _pointerEnteredSubscriptions = new();
private long _nextPointerEnteredSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _pointerExitedSubscriptions = new();
private long _nextPointerExitedSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _pointerWheelChangedSubscriptions = new();
+ private long _nextPointerWheelChangedSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _tappedSubscriptions = new();
+ private long _nextTappedSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _doubleTappedSubscriptions = new();
+ private long _nextDoubleTappedSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _spinSubscriptions = new();
private long _nextSpinSubscriptionId;
@@ -967,6 +979,37 @@ public int SetVerticalAlignment(int value)
}
}
+ public int GetFocusable(out int value)
+ {
+ value = default;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ value = _value.Focusable ? 1 : 0;
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int SetFocusable(int value)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ _value.Focusable = value != 0;
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int GetIsEnabled(out int value)
{
value = default;
@@ -998,6 +1041,22 @@ public int SetIsEnabled(int value)
}
}
+ public int FocusWithNavigationMethodAndKeyModifiers(int method, int keyModifiers, out int value)
+ {
+ value = default;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ value = _value.Focus((global::Avalonia.Input.NavigationMethod)method, (global::Avalonia.Input.KeyModifiers)keyModifiers) ? 1 : 0;
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int AdviseLoaded(IAvnControlLoadedHandler? handler, out long subscriptionId)
{
subscriptionId = 0;
@@ -1136,6 +1195,98 @@ public int UnadviseSizeChanged(long subscriptionId)
}
}
+ public int AdviseGotFocus(IAvnControlGotFocusHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke((int)eventArgs.NavigationMethod, (int)eventArgs.KeyModifiers);
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.GotFocus += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextGotFocusSubscriptionId);
+ _gotFocusSubscriptions.Add(subscriptionId, (handler, () => eventSource.GotFocus -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseGotFocus(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_gotFocusSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int AdviseLostFocus(IAvnControlLostFocusHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke();
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.LostFocus += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextLostFocusSubscriptionId);
+ _lostFocusSubscriptions.Add(subscriptionId, (handler, () => eventSource.LostFocus -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseLostFocus(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_lostFocusSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int AdviseKeyDown(IAvnControlKeyDownHandler? handler, out long subscriptionId)
{
subscriptionId = 0;
@@ -1184,6 +1335,54 @@ public int UnadviseKeyDown(long subscriptionId)
}
}
+ public int AdviseKeyUp(IAvnControlKeyUpHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var handled = eventArgs.Handled ? 1 : 0;
+ var hr = handler.Invoke((int)eventArgs.Key, (int)eventArgs.PhysicalKey, (int)eventArgs.KeyModifiers, eventArgs.KeySymbol, ref handled);
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ eventArgs.Handled = handled != 0;
+ });
+ eventSource.KeyUp += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextKeyUpSubscriptionId);
+ _keyUpSubscriptions.Add(subscriptionId, (handler, () => eventSource.KeyUp -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseKeyUp(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_keyUpSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int AdvisePointerEntered(IAvnControlPointerEnteredHandler? handler, out long subscriptionId)
{
subscriptionId = 0;
@@ -1196,7 +1395,7 @@ public int AdvisePointerEntered(IAvnControlPointerEnteredHandler? handler, out l
var eventSource = _value;
var callback = new global::System.EventHandler((_, eventArgs) =>
{
- var hr = handler.Invoke();
+ var hr = handler.Invoke((int)eventArgs.KeyModifiers);
if (hr < 0)
global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
});
@@ -1242,7 +1441,7 @@ public int AdvisePointerExited(IAvnControlPointerExitedHandler? handler, out lon
var eventSource = _value;
var callback = new global::System.EventHandler((_, eventArgs) =>
{
- var hr = handler.Invoke();
+ var hr = handler.Invoke((int)eventArgs.KeyModifiers);
if (hr < 0)
global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
});
@@ -1276,6 +1475,144 @@ public int UnadvisePointerExited(long subscriptionId)
}
}
+ public int AdvisePointerWheelChanged(IAvnControlPointerWheelChangedHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke(AvnVector.FromAvalonia(eventArgs.Delta), (int)eventArgs.KeyModifiers);
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.PointerWheelChanged += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextPointerWheelChangedSubscriptionId);
+ _pointerWheelChangedSubscriptions.Add(subscriptionId, (handler, () => eventSource.PointerWheelChanged -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadvisePointerWheelChanged(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_pointerWheelChangedSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int AdviseTapped(IAvnControlTappedHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke((int)eventArgs.KeyModifiers);
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.Tapped += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextTappedSubscriptionId);
+ _tappedSubscriptions.Add(subscriptionId, (handler, () => eventSource.Tapped -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseTapped(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_tappedSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int AdviseDoubleTapped(IAvnControlDoubleTappedHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke();
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.DoubleTapped += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextDoubleTappedSubscriptionId);
+ _doubleTappedSubscriptions.Add(subscriptionId, (handler, () => eventSource.DoubleTapped -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseDoubleTapped(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_doubleTappedSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int GetBackground(out IAvnBrush? value)
{
value = default;
@@ -2060,12 +2397,30 @@ private void ReleaseSubscriptions()
global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
}
_sizeChangedSubscriptions.Clear();
+ foreach (var subscription in _gotFocusSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _gotFocusSubscriptions.Clear();
+ foreach (var subscription in _lostFocusSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _lostFocusSubscriptions.Clear();
foreach (var subscription in _keyDownSubscriptions.Values)
{
subscription.Unsubscribe();
global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
}
_keyDownSubscriptions.Clear();
+ foreach (var subscription in _keyUpSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _keyUpSubscriptions.Clear();
foreach (var subscription in _pointerEnteredSubscriptions.Values)
{
subscription.Unsubscribe();
@@ -2078,6 +2433,24 @@ private void ReleaseSubscriptions()
global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
}
_pointerExitedSubscriptions.Clear();
+ foreach (var subscription in _pointerWheelChangedSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _pointerWheelChangedSubscriptions.Clear();
+ foreach (var subscription in _tappedSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _tappedSubscriptions.Clear();
+ foreach (var subscription in _doubleTappedSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _doubleTappedSubscriptions.Clear();
foreach (var subscription in _spinSubscriptions.Values)
{
subscription.Unsubscribe();
diff --git a/host/Generated/ObjectModel/IAvnCalendar.g.cs b/host/Generated/ObjectModel/IAvnCalendar.g.cs
index dbbb56d..8d71dae 100644
--- a/host/Generated/ObjectModel/IAvnCalendar.g.cs
+++ b/host/Generated/ObjectModel/IAvnCalendar.g.cs
@@ -7,7 +7,7 @@
namespace Avalonia.Host.Com;
[GeneratedComInterface(StringMarshalling = StringMarshalling.Utf16)]
-[Guid("F1D659B7-93E5-5093-9D16-C480F7520E14")]
+[Guid("2ECA7A03-1AA5-5FC5-B1CC-7ECDDCF200D1")]
public partial interface IAvnCalendar : IAvnTemplatedControl
{
[PreserveSig]
@@ -131,12 +131,24 @@ public sealed partial class AvnCalendar : IAvnCalendar
private long _nextUnloadedSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _sizeChangedSubscriptions = new();
private long _nextSizeChangedSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _gotFocusSubscriptions = new();
+ private long _nextGotFocusSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _lostFocusSubscriptions = new();
+ private long _nextLostFocusSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _keyDownSubscriptions = new();
private long _nextKeyDownSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _keyUpSubscriptions = new();
+ private long _nextKeyUpSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _pointerEnteredSubscriptions = new();
private long _nextPointerEnteredSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _pointerExitedSubscriptions = new();
private long _nextPointerExitedSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _pointerWheelChangedSubscriptions = new();
+ private long _nextPointerWheelChangedSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _tappedSubscriptions = new();
+ private long _nextTappedSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _doubleTappedSubscriptions = new();
+ private long _nextDoubleTappedSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _selectedDatesChangedSubscriptions = new();
private long _nextSelectedDatesChangedSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _displayDateChangedSubscriptions = new();
@@ -1049,6 +1061,37 @@ public int SetVerticalAlignment(int value)
}
}
+ public int GetFocusable(out int value)
+ {
+ value = default;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ value = _value.Focusable ? 1 : 0;
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int SetFocusable(int value)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ _value.Focusable = value != 0;
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int GetIsEnabled(out int value)
{
value = default;
@@ -1080,6 +1123,22 @@ public int SetIsEnabled(int value)
}
}
+ public int FocusWithNavigationMethodAndKeyModifiers(int method, int keyModifiers, out int value)
+ {
+ value = default;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ value = _value.Focus((global::Avalonia.Input.NavigationMethod)method, (global::Avalonia.Input.KeyModifiers)keyModifiers) ? 1 : 0;
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int AdviseLoaded(IAvnControlLoadedHandler? handler, out long subscriptionId)
{
subscriptionId = 0;
@@ -1218,6 +1277,98 @@ public int UnadviseSizeChanged(long subscriptionId)
}
}
+ public int AdviseGotFocus(IAvnControlGotFocusHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke((int)eventArgs.NavigationMethod, (int)eventArgs.KeyModifiers);
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.GotFocus += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextGotFocusSubscriptionId);
+ _gotFocusSubscriptions.Add(subscriptionId, (handler, () => eventSource.GotFocus -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseGotFocus(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_gotFocusSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int AdviseLostFocus(IAvnControlLostFocusHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke();
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.LostFocus += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextLostFocusSubscriptionId);
+ _lostFocusSubscriptions.Add(subscriptionId, (handler, () => eventSource.LostFocus -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseLostFocus(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_lostFocusSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int AdviseKeyDown(IAvnControlKeyDownHandler? handler, out long subscriptionId)
{
subscriptionId = 0;
@@ -1266,6 +1417,54 @@ public int UnadviseKeyDown(long subscriptionId)
}
}
+ public int AdviseKeyUp(IAvnControlKeyUpHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var handled = eventArgs.Handled ? 1 : 0;
+ var hr = handler.Invoke((int)eventArgs.Key, (int)eventArgs.PhysicalKey, (int)eventArgs.KeyModifiers, eventArgs.KeySymbol, ref handled);
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ eventArgs.Handled = handled != 0;
+ });
+ eventSource.KeyUp += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextKeyUpSubscriptionId);
+ _keyUpSubscriptions.Add(subscriptionId, (handler, () => eventSource.KeyUp -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseKeyUp(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_keyUpSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int AdvisePointerEntered(IAvnControlPointerEnteredHandler? handler, out long subscriptionId)
{
subscriptionId = 0;
@@ -1278,7 +1477,7 @@ public int AdvisePointerEntered(IAvnControlPointerEnteredHandler? handler, out l
var eventSource = _value;
var callback = new global::System.EventHandler((_, eventArgs) =>
{
- var hr = handler.Invoke();
+ var hr = handler.Invoke((int)eventArgs.KeyModifiers);
if (hr < 0)
global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
});
@@ -1324,7 +1523,7 @@ public int AdvisePointerExited(IAvnControlPointerExitedHandler? handler, out lon
var eventSource = _value;
var callback = new global::System.EventHandler((_, eventArgs) =>
{
- var hr = handler.Invoke();
+ var hr = handler.Invoke((int)eventArgs.KeyModifiers);
if (hr < 0)
global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
});
@@ -1358,6 +1557,144 @@ public int UnadvisePointerExited(long subscriptionId)
}
}
+ public int AdvisePointerWheelChanged(IAvnControlPointerWheelChangedHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke(AvnVector.FromAvalonia(eventArgs.Delta), (int)eventArgs.KeyModifiers);
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.PointerWheelChanged += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextPointerWheelChangedSubscriptionId);
+ _pointerWheelChangedSubscriptions.Add(subscriptionId, (handler, () => eventSource.PointerWheelChanged -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadvisePointerWheelChanged(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_pointerWheelChangedSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int AdviseTapped(IAvnControlTappedHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke((int)eventArgs.KeyModifiers);
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.Tapped += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextTappedSubscriptionId);
+ _tappedSubscriptions.Add(subscriptionId, (handler, () => eventSource.Tapped -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseTapped(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_tappedSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int AdviseDoubleTapped(IAvnControlDoubleTappedHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke();
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.DoubleTapped += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextDoubleTappedSubscriptionId);
+ _doubleTappedSubscriptions.Add(subscriptionId, (handler, () => eventSource.DoubleTapped -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseDoubleTapped(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_doubleTappedSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int GetBackground(out IAvnBrush? value)
{
value = default;
@@ -2392,12 +2729,30 @@ private void ReleaseSubscriptions()
global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
}
_sizeChangedSubscriptions.Clear();
+ foreach (var subscription in _gotFocusSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _gotFocusSubscriptions.Clear();
+ foreach (var subscription in _lostFocusSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _lostFocusSubscriptions.Clear();
foreach (var subscription in _keyDownSubscriptions.Values)
{
subscription.Unsubscribe();
global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
}
_keyDownSubscriptions.Clear();
+ foreach (var subscription in _keyUpSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _keyUpSubscriptions.Clear();
foreach (var subscription in _pointerEnteredSubscriptions.Values)
{
subscription.Unsubscribe();
@@ -2410,6 +2765,24 @@ private void ReleaseSubscriptions()
global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
}
_pointerExitedSubscriptions.Clear();
+ foreach (var subscription in _pointerWheelChangedSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _pointerWheelChangedSubscriptions.Clear();
+ foreach (var subscription in _tappedSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _tappedSubscriptions.Clear();
+ foreach (var subscription in _doubleTappedSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _doubleTappedSubscriptions.Clear();
foreach (var subscription in _selectedDatesChangedSubscriptions.Values)
{
subscription.Unsubscribe();
diff --git a/host/Generated/ObjectModel/IAvnCalendarDatePicker.g.cs b/host/Generated/ObjectModel/IAvnCalendarDatePicker.g.cs
index b27fe39..7ad5467 100644
--- a/host/Generated/ObjectModel/IAvnCalendarDatePicker.g.cs
+++ b/host/Generated/ObjectModel/IAvnCalendarDatePicker.g.cs
@@ -7,7 +7,7 @@
namespace Avalonia.Host.Com;
[GeneratedComInterface(StringMarshalling = StringMarshalling.Utf16)]
-[Guid("DC5958DB-F3AD-5B9F-9C86-7B66DD3D2429")]
+[Guid("3CB1E562-6FEB-5E8B-A79A-9C1B3DB4AE62")]
public partial interface IAvnCalendarDatePicker : IAvnTemplatedControl
{
[PreserveSig]
@@ -167,12 +167,24 @@ public sealed partial class AvnCalendarDatePicker : IAvnCalendarDatePicker
private long _nextUnloadedSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _sizeChangedSubscriptions = new();
private long _nextSizeChangedSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _gotFocusSubscriptions = new();
+ private long _nextGotFocusSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _lostFocusSubscriptions = new();
+ private long _nextLostFocusSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _keyDownSubscriptions = new();
private long _nextKeyDownSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _keyUpSubscriptions = new();
+ private long _nextKeyUpSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _pointerEnteredSubscriptions = new();
private long _nextPointerEnteredSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _pointerExitedSubscriptions = new();
private long _nextPointerExitedSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _pointerWheelChangedSubscriptions = new();
+ private long _nextPointerWheelChangedSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _tappedSubscriptions = new();
+ private long _nextTappedSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _doubleTappedSubscriptions = new();
+ private long _nextDoubleTappedSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _calendarClosedSubscriptions = new();
private long _nextCalendarClosedSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _calendarOpenedSubscriptions = new();
@@ -1087,6 +1099,37 @@ public int SetVerticalAlignment(int value)
}
}
+ public int GetFocusable(out int value)
+ {
+ value = default;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ value = _value.Focusable ? 1 : 0;
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int SetFocusable(int value)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ _value.Focusable = value != 0;
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int GetIsEnabled(out int value)
{
value = default;
@@ -1118,6 +1161,22 @@ public int SetIsEnabled(int value)
}
}
+ public int FocusWithNavigationMethodAndKeyModifiers(int method, int keyModifiers, out int value)
+ {
+ value = default;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ value = _value.Focus((global::Avalonia.Input.NavigationMethod)method, (global::Avalonia.Input.KeyModifiers)keyModifiers) ? 1 : 0;
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int AdviseLoaded(IAvnControlLoadedHandler? handler, out long subscriptionId)
{
subscriptionId = 0;
@@ -1256,6 +1315,98 @@ public int UnadviseSizeChanged(long subscriptionId)
}
}
+ public int AdviseGotFocus(IAvnControlGotFocusHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke((int)eventArgs.NavigationMethod, (int)eventArgs.KeyModifiers);
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.GotFocus += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextGotFocusSubscriptionId);
+ _gotFocusSubscriptions.Add(subscriptionId, (handler, () => eventSource.GotFocus -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseGotFocus(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_gotFocusSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int AdviseLostFocus(IAvnControlLostFocusHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke();
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.LostFocus += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextLostFocusSubscriptionId);
+ _lostFocusSubscriptions.Add(subscriptionId, (handler, () => eventSource.LostFocus -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseLostFocus(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_lostFocusSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int AdviseKeyDown(IAvnControlKeyDownHandler? handler, out long subscriptionId)
{
subscriptionId = 0;
@@ -1304,6 +1455,54 @@ public int UnadviseKeyDown(long subscriptionId)
}
}
+ public int AdviseKeyUp(IAvnControlKeyUpHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var handled = eventArgs.Handled ? 1 : 0;
+ var hr = handler.Invoke((int)eventArgs.Key, (int)eventArgs.PhysicalKey, (int)eventArgs.KeyModifiers, eventArgs.KeySymbol, ref handled);
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ eventArgs.Handled = handled != 0;
+ });
+ eventSource.KeyUp += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextKeyUpSubscriptionId);
+ _keyUpSubscriptions.Add(subscriptionId, (handler, () => eventSource.KeyUp -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseKeyUp(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_keyUpSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int AdvisePointerEntered(IAvnControlPointerEnteredHandler? handler, out long subscriptionId)
{
subscriptionId = 0;
@@ -1316,7 +1515,7 @@ public int AdvisePointerEntered(IAvnControlPointerEnteredHandler? handler, out l
var eventSource = _value;
var callback = new global::System.EventHandler((_, eventArgs) =>
{
- var hr = handler.Invoke();
+ var hr = handler.Invoke((int)eventArgs.KeyModifiers);
if (hr < 0)
global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
});
@@ -1362,7 +1561,7 @@ public int AdvisePointerExited(IAvnControlPointerExitedHandler? handler, out lon
var eventSource = _value;
var callback = new global::System.EventHandler((_, eventArgs) =>
{
- var hr = handler.Invoke();
+ var hr = handler.Invoke((int)eventArgs.KeyModifiers);
if (hr < 0)
global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
});
@@ -1396,6 +1595,144 @@ public int UnadvisePointerExited(long subscriptionId)
}
}
+ public int AdvisePointerWheelChanged(IAvnControlPointerWheelChangedHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke(AvnVector.FromAvalonia(eventArgs.Delta), (int)eventArgs.KeyModifiers);
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.PointerWheelChanged += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextPointerWheelChangedSubscriptionId);
+ _pointerWheelChangedSubscriptions.Add(subscriptionId, (handler, () => eventSource.PointerWheelChanged -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadvisePointerWheelChanged(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_pointerWheelChangedSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int AdviseTapped(IAvnControlTappedHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke((int)eventArgs.KeyModifiers);
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.Tapped += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextTappedSubscriptionId);
+ _tappedSubscriptions.Add(subscriptionId, (handler, () => eventSource.Tapped -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseTapped(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_tappedSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int AdviseDoubleTapped(IAvnControlDoubleTappedHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke();
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.DoubleTapped += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextDoubleTappedSubscriptionId);
+ _doubleTappedSubscriptions.Add(subscriptionId, (handler, () => eventSource.DoubleTapped -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseDoubleTapped(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_doubleTappedSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int GetBackground(out IAvnBrush? value)
{
value = default;
@@ -2632,12 +2969,30 @@ private void ReleaseSubscriptions()
global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
}
_sizeChangedSubscriptions.Clear();
+ foreach (var subscription in _gotFocusSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _gotFocusSubscriptions.Clear();
+ foreach (var subscription in _lostFocusSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _lostFocusSubscriptions.Clear();
foreach (var subscription in _keyDownSubscriptions.Values)
{
subscription.Unsubscribe();
global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
}
_keyDownSubscriptions.Clear();
+ foreach (var subscription in _keyUpSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _keyUpSubscriptions.Clear();
foreach (var subscription in _pointerEnteredSubscriptions.Values)
{
subscription.Unsubscribe();
@@ -2650,6 +3005,24 @@ private void ReleaseSubscriptions()
global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
}
_pointerExitedSubscriptions.Clear();
+ foreach (var subscription in _pointerWheelChangedSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _pointerWheelChangedSubscriptions.Clear();
+ foreach (var subscription in _tappedSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _tappedSubscriptions.Clear();
+ foreach (var subscription in _doubleTappedSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _doubleTappedSubscriptions.Clear();
foreach (var subscription in _calendarClosedSubscriptions.Values)
{
subscription.Unsubscribe();
diff --git a/host/Generated/ObjectModel/IAvnCanvas.g.cs b/host/Generated/ObjectModel/IAvnCanvas.g.cs
index 000d9bf..0650c2f 100644
--- a/host/Generated/ObjectModel/IAvnCanvas.g.cs
+++ b/host/Generated/ObjectModel/IAvnCanvas.g.cs
@@ -7,7 +7,7 @@
namespace Avalonia.Host.Com;
[GeneratedComInterface(StringMarshalling = StringMarshalling.Utf16)]
-[Guid("D9F89602-BD30-55F3-84C5-69EF65A6D0DA")]
+[Guid("DB97347A-FE7E-5006-93B7-E4B555A261A9")]
public partial interface IAvnCanvas : IAvnPanel
{
}
@@ -35,12 +35,24 @@ public sealed partial class AvnCanvas : IAvnCanvas
private long _nextUnloadedSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _sizeChangedSubscriptions = new();
private long _nextSizeChangedSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _gotFocusSubscriptions = new();
+ private long _nextGotFocusSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _lostFocusSubscriptions = new();
+ private long _nextLostFocusSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _keyDownSubscriptions = new();
private long _nextKeyDownSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _keyUpSubscriptions = new();
+ private long _nextKeyUpSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _pointerEnteredSubscriptions = new();
private long _nextPointerEnteredSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _pointerExitedSubscriptions = new();
private long _nextPointerExitedSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _pointerWheelChangedSubscriptions = new();
+ private long _nextPointerWheelChangedSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _tappedSubscriptions = new();
+ private long _nextTappedSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _doubleTappedSubscriptions = new();
+ private long _nextDoubleTappedSubscriptionId;
internal AvnCanvas(global::Avalonia.Controls.Canvas value)
{
@@ -947,6 +959,37 @@ public int SetVerticalAlignment(int value)
}
}
+ public int GetFocusable(out int value)
+ {
+ value = default;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ value = _value.Focusable ? 1 : 0;
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int SetFocusable(int value)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ _value.Focusable = value != 0;
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int GetIsEnabled(out int value)
{
value = default;
@@ -978,6 +1021,22 @@ public int SetIsEnabled(int value)
}
}
+ public int FocusWithNavigationMethodAndKeyModifiers(int method, int keyModifiers, out int value)
+ {
+ value = default;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ value = _value.Focus((global::Avalonia.Input.NavigationMethod)method, (global::Avalonia.Input.KeyModifiers)keyModifiers) ? 1 : 0;
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int AdviseLoaded(IAvnControlLoadedHandler? handler, out long subscriptionId)
{
subscriptionId = 0;
@@ -1116,6 +1175,98 @@ public int UnadviseSizeChanged(long subscriptionId)
}
}
+ public int AdviseGotFocus(IAvnControlGotFocusHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke((int)eventArgs.NavigationMethod, (int)eventArgs.KeyModifiers);
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.GotFocus += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextGotFocusSubscriptionId);
+ _gotFocusSubscriptions.Add(subscriptionId, (handler, () => eventSource.GotFocus -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseGotFocus(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_gotFocusSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int AdviseLostFocus(IAvnControlLostFocusHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke();
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.LostFocus += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextLostFocusSubscriptionId);
+ _lostFocusSubscriptions.Add(subscriptionId, (handler, () => eventSource.LostFocus -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseLostFocus(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_lostFocusSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int AdviseKeyDown(IAvnControlKeyDownHandler? handler, out long subscriptionId)
{
subscriptionId = 0;
@@ -1164,6 +1315,54 @@ public int UnadviseKeyDown(long subscriptionId)
}
}
+ public int AdviseKeyUp(IAvnControlKeyUpHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var handled = eventArgs.Handled ? 1 : 0;
+ var hr = handler.Invoke((int)eventArgs.Key, (int)eventArgs.PhysicalKey, (int)eventArgs.KeyModifiers, eventArgs.KeySymbol, ref handled);
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ eventArgs.Handled = handled != 0;
+ });
+ eventSource.KeyUp += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextKeyUpSubscriptionId);
+ _keyUpSubscriptions.Add(subscriptionId, (handler, () => eventSource.KeyUp -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseKeyUp(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_keyUpSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int AdvisePointerEntered(IAvnControlPointerEnteredHandler? handler, out long subscriptionId)
{
subscriptionId = 0;
@@ -1176,7 +1375,7 @@ public int AdvisePointerEntered(IAvnControlPointerEnteredHandler? handler, out l
var eventSource = _value;
var callback = new global::System.EventHandler((_, eventArgs) =>
{
- var hr = handler.Invoke();
+ var hr = handler.Invoke((int)eventArgs.KeyModifiers);
if (hr < 0)
global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
});
@@ -1222,7 +1421,7 @@ public int AdvisePointerExited(IAvnControlPointerExitedHandler? handler, out lon
var eventSource = _value;
var callback = new global::System.EventHandler((_, eventArgs) =>
{
- var hr = handler.Invoke();
+ var hr = handler.Invoke((int)eventArgs.KeyModifiers);
if (hr < 0)
global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
});
@@ -1256,6 +1455,144 @@ public int UnadvisePointerExited(long subscriptionId)
}
}
+ public int AdvisePointerWheelChanged(IAvnControlPointerWheelChangedHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke(AvnVector.FromAvalonia(eventArgs.Delta), (int)eventArgs.KeyModifiers);
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.PointerWheelChanged += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextPointerWheelChangedSubscriptionId);
+ _pointerWheelChangedSubscriptions.Add(subscriptionId, (handler, () => eventSource.PointerWheelChanged -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadvisePointerWheelChanged(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_pointerWheelChangedSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int AdviseTapped(IAvnControlTappedHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke((int)eventArgs.KeyModifiers);
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.Tapped += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextTappedSubscriptionId);
+ _tappedSubscriptions.Add(subscriptionId, (handler, () => eventSource.Tapped -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseTapped(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_tappedSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int AdviseDoubleTapped(IAvnControlDoubleTappedHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke();
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.DoubleTapped += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextDoubleTappedSubscriptionId);
+ _doubleTappedSubscriptions.Add(subscriptionId, (handler, () => eventSource.DoubleTapped -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseDoubleTapped(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_doubleTappedSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int GetChildren(out IAvnControlList? value)
{
value = default;
@@ -1359,12 +1696,30 @@ private void ReleaseSubscriptions()
global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
}
_sizeChangedSubscriptions.Clear();
+ foreach (var subscription in _gotFocusSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _gotFocusSubscriptions.Clear();
+ foreach (var subscription in _lostFocusSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _lostFocusSubscriptions.Clear();
foreach (var subscription in _keyDownSubscriptions.Values)
{
subscription.Unsubscribe();
global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
}
_keyDownSubscriptions.Clear();
+ foreach (var subscription in _keyUpSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _keyUpSubscriptions.Clear();
foreach (var subscription in _pointerEnteredSubscriptions.Values)
{
subscription.Unsubscribe();
@@ -1377,5 +1732,23 @@ private void ReleaseSubscriptions()
global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
}
_pointerExitedSubscriptions.Clear();
+ foreach (var subscription in _pointerWheelChangedSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _pointerWheelChangedSubscriptions.Clear();
+ foreach (var subscription in _tappedSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _tappedSubscriptions.Clear();
+ foreach (var subscription in _doubleTappedSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _doubleTappedSubscriptions.Clear();
}
}
diff --git a/host/Generated/ObjectModel/IAvnCarousel.g.cs b/host/Generated/ObjectModel/IAvnCarousel.g.cs
index 89d719e..e3d3365 100644
--- a/host/Generated/ObjectModel/IAvnCarousel.g.cs
+++ b/host/Generated/ObjectModel/IAvnCarousel.g.cs
@@ -7,7 +7,7 @@
namespace Avalonia.Host.Com;
[GeneratedComInterface(StringMarshalling = StringMarshalling.Utf16)]
-[Guid("14D0DA2B-D8DF-5816-8B51-455DCF738DF0")]
+[Guid("062C586F-DB97-53CF-8DC3-A2F159E0BD23")]
public partial interface IAvnCarousel : IAvnSelectingItemsControl
{
[PreserveSig]
@@ -56,12 +56,24 @@ public sealed partial class AvnCarousel : IAvnCarousel
private long _nextUnloadedSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _sizeChangedSubscriptions = new();
private long _nextSizeChangedSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _gotFocusSubscriptions = new();
+ private long _nextGotFocusSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _lostFocusSubscriptions = new();
+ private long _nextLostFocusSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _keyDownSubscriptions = new();
private long _nextKeyDownSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _keyUpSubscriptions = new();
+ private long _nextKeyUpSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _pointerEnteredSubscriptions = new();
private long _nextPointerEnteredSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _pointerExitedSubscriptions = new();
private long _nextPointerExitedSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _pointerWheelChangedSubscriptions = new();
+ private long _nextPointerWheelChangedSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _tappedSubscriptions = new();
+ private long _nextTappedSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _doubleTappedSubscriptions = new();
+ private long _nextDoubleTappedSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _selectionChangedSubscriptions = new();
private long _nextSelectionChangedSubscriptionId;
@@ -970,6 +982,37 @@ public int SetVerticalAlignment(int value)
}
}
+ public int GetFocusable(out int value)
+ {
+ value = default;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ value = _value.Focusable ? 1 : 0;
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int SetFocusable(int value)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ _value.Focusable = value != 0;
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int GetIsEnabled(out int value)
{
value = default;
@@ -1001,6 +1044,22 @@ public int SetIsEnabled(int value)
}
}
+ public int FocusWithNavigationMethodAndKeyModifiers(int method, int keyModifiers, out int value)
+ {
+ value = default;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ value = _value.Focus((global::Avalonia.Input.NavigationMethod)method, (global::Avalonia.Input.KeyModifiers)keyModifiers) ? 1 : 0;
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int AdviseLoaded(IAvnControlLoadedHandler? handler, out long subscriptionId)
{
subscriptionId = 0;
@@ -1139,6 +1198,98 @@ public int UnadviseSizeChanged(long subscriptionId)
}
}
+ public int AdviseGotFocus(IAvnControlGotFocusHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke((int)eventArgs.NavigationMethod, (int)eventArgs.KeyModifiers);
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.GotFocus += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextGotFocusSubscriptionId);
+ _gotFocusSubscriptions.Add(subscriptionId, (handler, () => eventSource.GotFocus -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseGotFocus(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_gotFocusSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int AdviseLostFocus(IAvnControlLostFocusHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke();
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.LostFocus += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextLostFocusSubscriptionId);
+ _lostFocusSubscriptions.Add(subscriptionId, (handler, () => eventSource.LostFocus -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseLostFocus(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_lostFocusSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int AdviseKeyDown(IAvnControlKeyDownHandler? handler, out long subscriptionId)
{
subscriptionId = 0;
@@ -1187,6 +1338,54 @@ public int UnadviseKeyDown(long subscriptionId)
}
}
+ public int AdviseKeyUp(IAvnControlKeyUpHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var handled = eventArgs.Handled ? 1 : 0;
+ var hr = handler.Invoke((int)eventArgs.Key, (int)eventArgs.PhysicalKey, (int)eventArgs.KeyModifiers, eventArgs.KeySymbol, ref handled);
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ eventArgs.Handled = handled != 0;
+ });
+ eventSource.KeyUp += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextKeyUpSubscriptionId);
+ _keyUpSubscriptions.Add(subscriptionId, (handler, () => eventSource.KeyUp -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseKeyUp(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_keyUpSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int AdvisePointerEntered(IAvnControlPointerEnteredHandler? handler, out long subscriptionId)
{
subscriptionId = 0;
@@ -1199,7 +1398,7 @@ public int AdvisePointerEntered(IAvnControlPointerEnteredHandler? handler, out l
var eventSource = _value;
var callback = new global::System.EventHandler((_, eventArgs) =>
{
- var hr = handler.Invoke();
+ var hr = handler.Invoke((int)eventArgs.KeyModifiers);
if (hr < 0)
global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
});
@@ -1245,7 +1444,7 @@ public int AdvisePointerExited(IAvnControlPointerExitedHandler? handler, out lon
var eventSource = _value;
var callback = new global::System.EventHandler((_, eventArgs) =>
{
- var hr = handler.Invoke();
+ var hr = handler.Invoke((int)eventArgs.KeyModifiers);
if (hr < 0)
global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
});
@@ -1279,6 +1478,144 @@ public int UnadvisePointerExited(long subscriptionId)
}
}
+ public int AdvisePointerWheelChanged(IAvnControlPointerWheelChangedHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke(AvnVector.FromAvalonia(eventArgs.Delta), (int)eventArgs.KeyModifiers);
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.PointerWheelChanged += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextPointerWheelChangedSubscriptionId);
+ _pointerWheelChangedSubscriptions.Add(subscriptionId, (handler, () => eventSource.PointerWheelChanged -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadvisePointerWheelChanged(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_pointerWheelChangedSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int AdviseTapped(IAvnControlTappedHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke((int)eventArgs.KeyModifiers);
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.Tapped += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextTappedSubscriptionId);
+ _tappedSubscriptions.Add(subscriptionId, (handler, () => eventSource.Tapped -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseTapped(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_tappedSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int AdviseDoubleTapped(IAvnControlDoubleTappedHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke();
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.DoubleTapped += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextDoubleTappedSubscriptionId);
+ _doubleTappedSubscriptions.Add(subscriptionId, (handler, () => eventSource.DoubleTapped -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseDoubleTapped(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_doubleTappedSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int GetBackground(out IAvnBrush? value)
{
value = default;
@@ -2099,7 +2436,9 @@ public int AdviseSelectionChanged(IAvnSelectingItemsControlSelectionChangedHandl
var eventSource = _value;
var callback = new global::System.EventHandler((_, eventArgs) =>
{
- var hr = handler.Invoke();
+ var args = new AvnSelectingItemsControlSelectionChangedArgs(new global::System.Collections.IEnumerable?[]
+ {eventArgs.AddedItems, eventArgs.RemovedItems});
+ var hr = handler.Invoke(args);
if (hr < 0)
global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
});
@@ -2297,12 +2636,30 @@ private void ReleaseSubscriptions()
global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
}
_sizeChangedSubscriptions.Clear();
+ foreach (var subscription in _gotFocusSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _gotFocusSubscriptions.Clear();
+ foreach (var subscription in _lostFocusSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _lostFocusSubscriptions.Clear();
foreach (var subscription in _keyDownSubscriptions.Values)
{
subscription.Unsubscribe();
global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
}
_keyDownSubscriptions.Clear();
+ foreach (var subscription in _keyUpSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _keyUpSubscriptions.Clear();
foreach (var subscription in _pointerEnteredSubscriptions.Values)
{
subscription.Unsubscribe();
@@ -2315,6 +2672,24 @@ private void ReleaseSubscriptions()
global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
}
_pointerExitedSubscriptions.Clear();
+ foreach (var subscription in _pointerWheelChangedSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _pointerWheelChangedSubscriptions.Clear();
+ foreach (var subscription in _tappedSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _tappedSubscriptions.Clear();
+ foreach (var subscription in _doubleTappedSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _doubleTappedSubscriptions.Clear();
foreach (var subscription in _selectionChangedSubscriptions.Values)
{
subscription.Unsubscribe();
diff --git a/host/Generated/ObjectModel/IAvnCheckBox.g.cs b/host/Generated/ObjectModel/IAvnCheckBox.g.cs
index 4a3c2a6..a5eb910 100644
--- a/host/Generated/ObjectModel/IAvnCheckBox.g.cs
+++ b/host/Generated/ObjectModel/IAvnCheckBox.g.cs
@@ -7,7 +7,7 @@
namespace Avalonia.Host.Com;
[GeneratedComInterface(StringMarshalling = StringMarshalling.Utf16)]
-[Guid("2D002AFC-AAFB-5C2D-B747-D08DF78AC852")]
+[Guid("7A084E79-BA86-55BF-A9E8-E7786F3D4242")]
public partial interface IAvnCheckBox : IAvnToggleButton
{
}
@@ -35,12 +35,24 @@ public sealed partial class AvnCheckBox : IAvnCheckBox
private long _nextUnloadedSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _sizeChangedSubscriptions = new();
private long _nextSizeChangedSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _gotFocusSubscriptions = new();
+ private long _nextGotFocusSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _lostFocusSubscriptions = new();
+ private long _nextLostFocusSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _keyDownSubscriptions = new();
private long _nextKeyDownSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _keyUpSubscriptions = new();
+ private long _nextKeyUpSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _pointerEnteredSubscriptions = new();
private long _nextPointerEnteredSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _pointerExitedSubscriptions = new();
private long _nextPointerExitedSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _pointerWheelChangedSubscriptions = new();
+ private long _nextPointerWheelChangedSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _tappedSubscriptions = new();
+ private long _nextTappedSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _doubleTappedSubscriptions = new();
+ private long _nextDoubleTappedSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _clickSubscriptions = new();
private long _nextClickSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _isCheckedChangedSubscriptions = new();
@@ -951,6 +963,37 @@ public int SetVerticalAlignment(int value)
}
}
+ public int GetFocusable(out int value)
+ {
+ value = default;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ value = _value.Focusable ? 1 : 0;
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int SetFocusable(int value)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ _value.Focusable = value != 0;
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int GetIsEnabled(out int value)
{
value = default;
@@ -982,6 +1025,22 @@ public int SetIsEnabled(int value)
}
}
+ public int FocusWithNavigationMethodAndKeyModifiers(int method, int keyModifiers, out int value)
+ {
+ value = default;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ value = _value.Focus((global::Avalonia.Input.NavigationMethod)method, (global::Avalonia.Input.KeyModifiers)keyModifiers) ? 1 : 0;
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int AdviseLoaded(IAvnControlLoadedHandler? handler, out long subscriptionId)
{
subscriptionId = 0;
@@ -1120,6 +1179,98 @@ public int UnadviseSizeChanged(long subscriptionId)
}
}
+ public int AdviseGotFocus(IAvnControlGotFocusHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke((int)eventArgs.NavigationMethod, (int)eventArgs.KeyModifiers);
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.GotFocus += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextGotFocusSubscriptionId);
+ _gotFocusSubscriptions.Add(subscriptionId, (handler, () => eventSource.GotFocus -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseGotFocus(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_gotFocusSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int AdviseLostFocus(IAvnControlLostFocusHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke();
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.LostFocus += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextLostFocusSubscriptionId);
+ _lostFocusSubscriptions.Add(subscriptionId, (handler, () => eventSource.LostFocus -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseLostFocus(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_lostFocusSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int AdviseKeyDown(IAvnControlKeyDownHandler? handler, out long subscriptionId)
{
subscriptionId = 0;
@@ -1168,6 +1319,54 @@ public int UnadviseKeyDown(long subscriptionId)
}
}
+ public int AdviseKeyUp(IAvnControlKeyUpHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var handled = eventArgs.Handled ? 1 : 0;
+ var hr = handler.Invoke((int)eventArgs.Key, (int)eventArgs.PhysicalKey, (int)eventArgs.KeyModifiers, eventArgs.KeySymbol, ref handled);
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ eventArgs.Handled = handled != 0;
+ });
+ eventSource.KeyUp += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextKeyUpSubscriptionId);
+ _keyUpSubscriptions.Add(subscriptionId, (handler, () => eventSource.KeyUp -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseKeyUp(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_keyUpSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int AdvisePointerEntered(IAvnControlPointerEnteredHandler? handler, out long subscriptionId)
{
subscriptionId = 0;
@@ -1180,7 +1379,7 @@ public int AdvisePointerEntered(IAvnControlPointerEnteredHandler? handler, out l
var eventSource = _value;
var callback = new global::System.EventHandler((_, eventArgs) =>
{
- var hr = handler.Invoke();
+ var hr = handler.Invoke((int)eventArgs.KeyModifiers);
if (hr < 0)
global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
});
@@ -1226,7 +1425,7 @@ public int AdvisePointerExited(IAvnControlPointerExitedHandler? handler, out lon
var eventSource = _value;
var callback = new global::System.EventHandler((_, eventArgs) =>
{
- var hr = handler.Invoke();
+ var hr = handler.Invoke((int)eventArgs.KeyModifiers);
if (hr < 0)
global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
});
@@ -1260,6 +1459,144 @@ public int UnadvisePointerExited(long subscriptionId)
}
}
+ public int AdvisePointerWheelChanged(IAvnControlPointerWheelChangedHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke(AvnVector.FromAvalonia(eventArgs.Delta), (int)eventArgs.KeyModifiers);
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.PointerWheelChanged += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextPointerWheelChangedSubscriptionId);
+ _pointerWheelChangedSubscriptions.Add(subscriptionId, (handler, () => eventSource.PointerWheelChanged -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadvisePointerWheelChanged(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_pointerWheelChangedSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int AdviseTapped(IAvnControlTappedHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke((int)eventArgs.KeyModifiers);
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.Tapped += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextTappedSubscriptionId);
+ _tappedSubscriptions.Add(subscriptionId, (handler, () => eventSource.Tapped -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseTapped(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_tappedSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int AdviseDoubleTapped(IAvnControlDoubleTappedHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke();
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.DoubleTapped += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextDoubleTappedSubscriptionId);
+ _doubleTappedSubscriptions.Add(subscriptionId, (handler, () => eventSource.DoubleTapped -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseDoubleTapped(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_doubleTappedSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int GetBackground(out IAvnBrush? value)
{
value = default;
@@ -2261,12 +2598,30 @@ private void ReleaseSubscriptions()
global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
}
_sizeChangedSubscriptions.Clear();
+ foreach (var subscription in _gotFocusSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _gotFocusSubscriptions.Clear();
+ foreach (var subscription in _lostFocusSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _lostFocusSubscriptions.Clear();
foreach (var subscription in _keyDownSubscriptions.Values)
{
subscription.Unsubscribe();
global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
}
_keyDownSubscriptions.Clear();
+ foreach (var subscription in _keyUpSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _keyUpSubscriptions.Clear();
foreach (var subscription in _pointerEnteredSubscriptions.Values)
{
subscription.Unsubscribe();
@@ -2279,6 +2634,24 @@ private void ReleaseSubscriptions()
global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
}
_pointerExitedSubscriptions.Clear();
+ foreach (var subscription in _pointerWheelChangedSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _pointerWheelChangedSubscriptions.Clear();
+ foreach (var subscription in _tappedSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _tappedSubscriptions.Clear();
+ foreach (var subscription in _doubleTappedSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _doubleTappedSubscriptions.Clear();
foreach (var subscription in _clickSubscriptions.Values)
{
subscription.Unsubscribe();
diff --git a/host/Generated/ObjectModel/IAvnComboBox.g.cs b/host/Generated/ObjectModel/IAvnComboBox.g.cs
index df2b423..7c27da8 100644
--- a/host/Generated/ObjectModel/IAvnComboBox.g.cs
+++ b/host/Generated/ObjectModel/IAvnComboBox.g.cs
@@ -7,7 +7,7 @@
namespace Avalonia.Host.Com;
[GeneratedComInterface(StringMarshalling = StringMarshalling.Utf16)]
-[Guid("86CA773B-56AB-521C-BA29-D2579C59F7F3")]
+[Guid("1DA7FC0F-6D3F-5669-8644-030686AD4FD3")]
public partial interface IAvnComboBox : IAvnSelectingItemsControl
{
[PreserveSig]
@@ -95,12 +95,24 @@ public sealed partial class AvnComboBox : IAvnComboBox
private long _nextUnloadedSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _sizeChangedSubscriptions = new();
private long _nextSizeChangedSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _gotFocusSubscriptions = new();
+ private long _nextGotFocusSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _lostFocusSubscriptions = new();
+ private long _nextLostFocusSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _keyDownSubscriptions = new();
private long _nextKeyDownSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _keyUpSubscriptions = new();
+ private long _nextKeyUpSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _pointerEnteredSubscriptions = new();
private long _nextPointerEnteredSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _pointerExitedSubscriptions = new();
private long _nextPointerExitedSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _pointerWheelChangedSubscriptions = new();
+ private long _nextPointerWheelChangedSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _tappedSubscriptions = new();
+ private long _nextTappedSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _doubleTappedSubscriptions = new();
+ private long _nextDoubleTappedSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _selectionChangedSubscriptions = new();
private long _nextSelectionChangedSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _dropDownClosedSubscriptions = new();
@@ -1013,6 +1025,37 @@ public int SetVerticalAlignment(int value)
}
}
+ public int GetFocusable(out int value)
+ {
+ value = default;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ value = _value.Focusable ? 1 : 0;
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int SetFocusable(int value)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ _value.Focusable = value != 0;
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int GetIsEnabled(out int value)
{
value = default;
@@ -1044,6 +1087,22 @@ public int SetIsEnabled(int value)
}
}
+ public int FocusWithNavigationMethodAndKeyModifiers(int method, int keyModifiers, out int value)
+ {
+ value = default;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ value = _value.Focus((global::Avalonia.Input.NavigationMethod)method, (global::Avalonia.Input.KeyModifiers)keyModifiers) ? 1 : 0;
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int AdviseLoaded(IAvnControlLoadedHandler? handler, out long subscriptionId)
{
subscriptionId = 0;
@@ -1182,6 +1241,98 @@ public int UnadviseSizeChanged(long subscriptionId)
}
}
+ public int AdviseGotFocus(IAvnControlGotFocusHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke((int)eventArgs.NavigationMethod, (int)eventArgs.KeyModifiers);
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.GotFocus += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextGotFocusSubscriptionId);
+ _gotFocusSubscriptions.Add(subscriptionId, (handler, () => eventSource.GotFocus -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseGotFocus(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_gotFocusSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int AdviseLostFocus(IAvnControlLostFocusHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke();
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.LostFocus += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextLostFocusSubscriptionId);
+ _lostFocusSubscriptions.Add(subscriptionId, (handler, () => eventSource.LostFocus -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseLostFocus(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_lostFocusSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int AdviseKeyDown(IAvnControlKeyDownHandler? handler, out long subscriptionId)
{
subscriptionId = 0;
@@ -1230,6 +1381,54 @@ public int UnadviseKeyDown(long subscriptionId)
}
}
+ public int AdviseKeyUp(IAvnControlKeyUpHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var handled = eventArgs.Handled ? 1 : 0;
+ var hr = handler.Invoke((int)eventArgs.Key, (int)eventArgs.PhysicalKey, (int)eventArgs.KeyModifiers, eventArgs.KeySymbol, ref handled);
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ eventArgs.Handled = handled != 0;
+ });
+ eventSource.KeyUp += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextKeyUpSubscriptionId);
+ _keyUpSubscriptions.Add(subscriptionId, (handler, () => eventSource.KeyUp -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseKeyUp(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_keyUpSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int AdvisePointerEntered(IAvnControlPointerEnteredHandler? handler, out long subscriptionId)
{
subscriptionId = 0;
@@ -1242,7 +1441,7 @@ public int AdvisePointerEntered(IAvnControlPointerEnteredHandler? handler, out l
var eventSource = _value;
var callback = new global::System.EventHandler((_, eventArgs) =>
{
- var hr = handler.Invoke();
+ var hr = handler.Invoke((int)eventArgs.KeyModifiers);
if (hr < 0)
global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
});
@@ -1288,7 +1487,7 @@ public int AdvisePointerExited(IAvnControlPointerExitedHandler? handler, out lon
var eventSource = _value;
var callback = new global::System.EventHandler((_, eventArgs) =>
{
- var hr = handler.Invoke();
+ var hr = handler.Invoke((int)eventArgs.KeyModifiers);
if (hr < 0)
global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
});
@@ -1322,6 +1521,144 @@ public int UnadvisePointerExited(long subscriptionId)
}
}
+ public int AdvisePointerWheelChanged(IAvnControlPointerWheelChangedHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke(AvnVector.FromAvalonia(eventArgs.Delta), (int)eventArgs.KeyModifiers);
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.PointerWheelChanged += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextPointerWheelChangedSubscriptionId);
+ _pointerWheelChangedSubscriptions.Add(subscriptionId, (handler, () => eventSource.PointerWheelChanged -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadvisePointerWheelChanged(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_pointerWheelChangedSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int AdviseTapped(IAvnControlTappedHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke((int)eventArgs.KeyModifiers);
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.Tapped += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextTappedSubscriptionId);
+ _tappedSubscriptions.Add(subscriptionId, (handler, () => eventSource.Tapped -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseTapped(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_tappedSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int AdviseDoubleTapped(IAvnControlDoubleTappedHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke();
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.DoubleTapped += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextDoubleTappedSubscriptionId);
+ _doubleTappedSubscriptions.Add(subscriptionId, (handler, () => eventSource.DoubleTapped -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseDoubleTapped(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_doubleTappedSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int GetBackground(out IAvnBrush? value)
{
value = default;
@@ -2142,7 +2479,9 @@ public int AdviseSelectionChanged(IAvnSelectingItemsControlSelectionChangedHandl
var eventSource = _value;
var callback = new global::System.EventHandler((_, eventArgs) =>
{
- var hr = handler.Invoke();
+ var args = new AvnSelectingItemsControlSelectionChangedArgs(new global::System.Collections.IEnumerable?[]
+ {eventArgs.AddedItems, eventArgs.RemovedItems});
+ var hr = handler.Invoke(args);
if (hr < 0)
global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
});
@@ -2572,12 +2911,30 @@ private void ReleaseSubscriptions()
global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
}
_sizeChangedSubscriptions.Clear();
+ foreach (var subscription in _gotFocusSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _gotFocusSubscriptions.Clear();
+ foreach (var subscription in _lostFocusSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _lostFocusSubscriptions.Clear();
foreach (var subscription in _keyDownSubscriptions.Values)
{
subscription.Unsubscribe();
global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
}
_keyDownSubscriptions.Clear();
+ foreach (var subscription in _keyUpSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _keyUpSubscriptions.Clear();
foreach (var subscription in _pointerEnteredSubscriptions.Values)
{
subscription.Unsubscribe();
@@ -2590,6 +2947,24 @@ private void ReleaseSubscriptions()
global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
}
_pointerExitedSubscriptions.Clear();
+ foreach (var subscription in _pointerWheelChangedSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _pointerWheelChangedSubscriptions.Clear();
+ foreach (var subscription in _tappedSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _tappedSubscriptions.Clear();
+ foreach (var subscription in _doubleTappedSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _doubleTappedSubscriptions.Clear();
foreach (var subscription in _selectionChangedSubscriptions.Values)
{
subscription.Unsubscribe();
diff --git a/host/Generated/ObjectModel/IAvnComboBoxItem.g.cs b/host/Generated/ObjectModel/IAvnComboBoxItem.g.cs
index a3eb79d..63da94c 100644
--- a/host/Generated/ObjectModel/IAvnComboBoxItem.g.cs
+++ b/host/Generated/ObjectModel/IAvnComboBoxItem.g.cs
@@ -7,7 +7,7 @@
namespace Avalonia.Host.Com;
[GeneratedComInterface(StringMarshalling = StringMarshalling.Utf16)]
-[Guid("2B9D2E17-500A-56F0-A0DB-14B92FF28CCB")]
+[Guid("2D2F584F-6CD6-59C9-B536-463E6CC21B72")]
public partial interface IAvnComboBoxItem : IAvnListBoxItem
{
}
@@ -35,12 +35,24 @@ public sealed partial class AvnComboBoxItem : IAvnComboBoxItem
private long _nextUnloadedSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _sizeChangedSubscriptions = new();
private long _nextSizeChangedSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _gotFocusSubscriptions = new();
+ private long _nextGotFocusSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _lostFocusSubscriptions = new();
+ private long _nextLostFocusSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _keyDownSubscriptions = new();
private long _nextKeyDownSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _keyUpSubscriptions = new();
+ private long _nextKeyUpSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _pointerEnteredSubscriptions = new();
private long _nextPointerEnteredSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _pointerExitedSubscriptions = new();
private long _nextPointerExitedSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _pointerWheelChangedSubscriptions = new();
+ private long _nextPointerWheelChangedSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _tappedSubscriptions = new();
+ private long _nextTappedSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _doubleTappedSubscriptions = new();
+ private long _nextDoubleTappedSubscriptionId;
internal AvnComboBoxItem(global::Avalonia.Controls.ComboBoxItem value)
{
@@ -947,6 +959,37 @@ public int SetVerticalAlignment(int value)
}
}
+ public int GetFocusable(out int value)
+ {
+ value = default;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ value = _value.Focusable ? 1 : 0;
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int SetFocusable(int value)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ _value.Focusable = value != 0;
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int GetIsEnabled(out int value)
{
value = default;
@@ -978,6 +1021,22 @@ public int SetIsEnabled(int value)
}
}
+ public int FocusWithNavigationMethodAndKeyModifiers(int method, int keyModifiers, out int value)
+ {
+ value = default;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ value = _value.Focus((global::Avalonia.Input.NavigationMethod)method, (global::Avalonia.Input.KeyModifiers)keyModifiers) ? 1 : 0;
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int AdviseLoaded(IAvnControlLoadedHandler? handler, out long subscriptionId)
{
subscriptionId = 0;
@@ -1116,6 +1175,98 @@ public int UnadviseSizeChanged(long subscriptionId)
}
}
+ public int AdviseGotFocus(IAvnControlGotFocusHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke((int)eventArgs.NavigationMethod, (int)eventArgs.KeyModifiers);
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.GotFocus += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextGotFocusSubscriptionId);
+ _gotFocusSubscriptions.Add(subscriptionId, (handler, () => eventSource.GotFocus -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseGotFocus(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_gotFocusSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int AdviseLostFocus(IAvnControlLostFocusHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke();
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.LostFocus += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextLostFocusSubscriptionId);
+ _lostFocusSubscriptions.Add(subscriptionId, (handler, () => eventSource.LostFocus -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseLostFocus(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_lostFocusSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int AdviseKeyDown(IAvnControlKeyDownHandler? handler, out long subscriptionId)
{
subscriptionId = 0;
@@ -1164,6 +1315,54 @@ public int UnadviseKeyDown(long subscriptionId)
}
}
+ public int AdviseKeyUp(IAvnControlKeyUpHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var handled = eventArgs.Handled ? 1 : 0;
+ var hr = handler.Invoke((int)eventArgs.Key, (int)eventArgs.PhysicalKey, (int)eventArgs.KeyModifiers, eventArgs.KeySymbol, ref handled);
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ eventArgs.Handled = handled != 0;
+ });
+ eventSource.KeyUp += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextKeyUpSubscriptionId);
+ _keyUpSubscriptions.Add(subscriptionId, (handler, () => eventSource.KeyUp -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseKeyUp(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_keyUpSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int AdvisePointerEntered(IAvnControlPointerEnteredHandler? handler, out long subscriptionId)
{
subscriptionId = 0;
@@ -1176,7 +1375,7 @@ public int AdvisePointerEntered(IAvnControlPointerEnteredHandler? handler, out l
var eventSource = _value;
var callback = new global::System.EventHandler((_, eventArgs) =>
{
- var hr = handler.Invoke();
+ var hr = handler.Invoke((int)eventArgs.KeyModifiers);
if (hr < 0)
global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
});
@@ -1222,7 +1421,7 @@ public int AdvisePointerExited(IAvnControlPointerExitedHandler? handler, out lon
var eventSource = _value;
var callback = new global::System.EventHandler((_, eventArgs) =>
{
- var hr = handler.Invoke();
+ var hr = handler.Invoke((int)eventArgs.KeyModifiers);
if (hr < 0)
global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
});
@@ -1256,6 +1455,144 @@ public int UnadvisePointerExited(long subscriptionId)
}
}
+ public int AdvisePointerWheelChanged(IAvnControlPointerWheelChangedHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke(AvnVector.FromAvalonia(eventArgs.Delta), (int)eventArgs.KeyModifiers);
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.PointerWheelChanged += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextPointerWheelChangedSubscriptionId);
+ _pointerWheelChangedSubscriptions.Add(subscriptionId, (handler, () => eventSource.PointerWheelChanged -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadvisePointerWheelChanged(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_pointerWheelChangedSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int AdviseTapped(IAvnControlTappedHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke((int)eventArgs.KeyModifiers);
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.Tapped += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextTappedSubscriptionId);
+ _tappedSubscriptions.Add(subscriptionId, (handler, () => eventSource.Tapped -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseTapped(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_tappedSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int AdviseDoubleTapped(IAvnControlDoubleTappedHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke();
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.DoubleTapped += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextDoubleTappedSubscriptionId);
+ _doubleTappedSubscriptions.Add(subscriptionId, (handler, () => eventSource.DoubleTapped -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseDoubleTapped(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_doubleTappedSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int GetBackground(out IAvnBrush? value)
{
value = default;
@@ -1901,12 +2238,30 @@ private void ReleaseSubscriptions()
global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
}
_sizeChangedSubscriptions.Clear();
+ foreach (var subscription in _gotFocusSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _gotFocusSubscriptions.Clear();
+ foreach (var subscription in _lostFocusSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _lostFocusSubscriptions.Clear();
foreach (var subscription in _keyDownSubscriptions.Values)
{
subscription.Unsubscribe();
global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
}
_keyDownSubscriptions.Clear();
+ foreach (var subscription in _keyUpSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _keyUpSubscriptions.Clear();
foreach (var subscription in _pointerEnteredSubscriptions.Values)
{
subscription.Unsubscribe();
@@ -1919,5 +2274,23 @@ private void ReleaseSubscriptions()
global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
}
_pointerExitedSubscriptions.Clear();
+ foreach (var subscription in _pointerWheelChangedSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _pointerWheelChangedSubscriptions.Clear();
+ foreach (var subscription in _tappedSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _tappedSubscriptions.Clear();
+ foreach (var subscription in _doubleTappedSubscriptions.Values)
+ {
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ }
+ _doubleTappedSubscriptions.Clear();
}
}
diff --git a/host/Generated/ObjectModel/IAvnCommandBar.g.cs b/host/Generated/ObjectModel/IAvnCommandBar.g.cs
index e433f9b..9ffeb38 100644
--- a/host/Generated/ObjectModel/IAvnCommandBar.g.cs
+++ b/host/Generated/ObjectModel/IAvnCommandBar.g.cs
@@ -7,7 +7,7 @@
namespace Avalonia.Host.Com;
[GeneratedComInterface(StringMarshalling = StringMarshalling.Utf16)]
-[Guid("1A9B7C3D-4D24-5330-9F8F-D9D0BC712695")]
+[Guid("19280D2B-7145-59DC-AD55-557541EC0147")]
public partial interface IAvnCommandBar : IAvnTemplatedControl
{
[PreserveSig]
@@ -137,12 +137,24 @@ public sealed partial class AvnCommandBar : IAvnCommandBar
private long _nextUnloadedSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _sizeChangedSubscriptions = new();
private long _nextSizeChangedSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _gotFocusSubscriptions = new();
+ private long _nextGotFocusSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _lostFocusSubscriptions = new();
+ private long _nextLostFocusSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _keyDownSubscriptions = new();
private long _nextKeyDownSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _keyUpSubscriptions = new();
+ private long _nextKeyUpSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _pointerEnteredSubscriptions = new();
private long _nextPointerEnteredSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _pointerExitedSubscriptions = new();
private long _nextPointerExitedSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _pointerWheelChangedSubscriptions = new();
+ private long _nextPointerWheelChangedSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _tappedSubscriptions = new();
+ private long _nextTappedSubscriptionId;
+ private readonly global::System.Collections.Generic.Dictionary _doubleTappedSubscriptions = new();
+ private long _nextDoubleTappedSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _openingSubscriptions = new();
private long _nextOpeningSubscriptionId;
private readonly global::System.Collections.Generic.Dictionary _openedSubscriptions = new();
@@ -1057,6 +1069,37 @@ public int SetVerticalAlignment(int value)
}
}
+ public int GetFocusable(out int value)
+ {
+ value = default;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ value = _value.Focusable ? 1 : 0;
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int SetFocusable(int value)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ _value.Focusable = value != 0;
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int GetIsEnabled(out int value)
{
value = default;
@@ -1088,6 +1131,22 @@ public int SetIsEnabled(int value)
}
}
+ public int FocusWithNavigationMethodAndKeyModifiers(int method, int keyModifiers, out int value)
+ {
+ value = default;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ value = _value.Focus((global::Avalonia.Input.NavigationMethod)method, (global::Avalonia.Input.KeyModifiers)keyModifiers) ? 1 : 0;
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int AdviseLoaded(IAvnControlLoadedHandler? handler, out long subscriptionId)
{
subscriptionId = 0;
@@ -1226,6 +1285,98 @@ public int UnadviseSizeChanged(long subscriptionId)
}
}
+ public int AdviseGotFocus(IAvnControlGotFocusHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke((int)eventArgs.NavigationMethod, (int)eventArgs.KeyModifiers);
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.GotFocus += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextGotFocusSubscriptionId);
+ _gotFocusSubscriptions.Add(subscriptionId, (handler, () => eventSource.GotFocus -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseGotFocus(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_gotFocusSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int AdviseLostFocus(IAvnControlLostFocusHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke();
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.LostFocus += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextLostFocusSubscriptionId);
+ _lostFocusSubscriptions.Add(subscriptionId, (handler, () => eventSource.LostFocus -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseLostFocus(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_lostFocusSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int AdviseKeyDown(IAvnControlKeyDownHandler? handler, out long subscriptionId)
{
subscriptionId = 0;
@@ -1274,6 +1425,54 @@ public int UnadviseKeyDown(long subscriptionId)
}
}
+ public int AdviseKeyUp(IAvnControlKeyUpHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var handled = eventArgs.Handled ? 1 : 0;
+ var hr = handler.Invoke((int)eventArgs.Key, (int)eventArgs.PhysicalKey, (int)eventArgs.KeyModifiers, eventArgs.KeySymbol, ref handled);
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ eventArgs.Handled = handled != 0;
+ });
+ eventSource.KeyUp += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextKeyUpSubscriptionId);
+ _keyUpSubscriptions.Add(subscriptionId, (handler, () => eventSource.KeyUp -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseKeyUp(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_keyUpSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
public int AdvisePointerEntered(IAvnControlPointerEnteredHandler? handler, out long subscriptionId)
{
subscriptionId = 0;
@@ -1286,7 +1485,7 @@ public int AdvisePointerEntered(IAvnControlPointerEnteredHandler? handler, out l
var eventSource = _value;
var callback = new global::System.EventHandler((_, eventArgs) =>
{
- var hr = handler.Invoke();
+ var hr = handler.Invoke((int)eventArgs.KeyModifiers);
if (hr < 0)
global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
});
@@ -1332,7 +1531,7 @@ public int AdvisePointerExited(IAvnControlPointerExitedHandler? handler, out lon
var eventSource = _value;
var callback = new global::System.EventHandler((_, eventArgs) =>
{
- var hr = handler.Invoke();
+ var hr = handler.Invoke((int)eventArgs.KeyModifiers);
if (hr < 0)
global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
});
@@ -1366,6 +1565,144 @@ public int UnadvisePointerExited(long subscriptionId)
}
}
+ public int AdvisePointerWheelChanged(IAvnControlPointerWheelChangedHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke(AvnVector.FromAvalonia(eventArgs.Delta), (int)eventArgs.KeyModifiers);
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.PointerWheelChanged += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextPointerWheelChangedSubscriptionId);
+ _pointerWheelChangedSubscriptions.Add(subscriptionId, (handler, () => eventSource.PointerWheelChanged -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadvisePointerWheelChanged(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_pointerWheelChangedSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int AdviseTapped(IAvnControlTappedHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler((_, eventArgs) =>
+ {
+ var hr = handler.Invoke((int)eventArgs.KeyModifiers);
+ if (hr < 0)
+ global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr);
+ });
+ eventSource.Tapped += callback;
+ subscriptionId = global::System.Threading.Interlocked.Increment(ref _nextTappedSubscriptionId);
+ _tappedSubscriptions.Add(subscriptionId, (handler, () => eventSource.Tapped -= callback));
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionAdded();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int UnadviseTapped(long subscriptionId)
+ {
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ if (!_tappedSubscriptions.Remove(subscriptionId, out var subscription))
+ return global::Avalonia.Host.HResults.E_INVALIDARG;
+ subscription.Unsubscribe();
+ global::Avalonia.Host.ProjectionDiagnostics.SubscriptionRemoved();
+ return global::Avalonia.Host.HResults.S_OK;
+ }
+ catch (global::System.Exception e)
+ {
+ return global::System.Runtime.InteropServices.Marshal.GetHRForException(e);
+ }
+ }
+
+ public int AdviseDoubleTapped(IAvnControlDoubleTappedHandler? handler, out long subscriptionId)
+ {
+ subscriptionId = 0;
+ if (handler is null)
+ return global::Avalonia.Host.HResults.E_POINTER;
+ try
+ {
+ using var call = _state.EnterCall();
+ _value.VerifyAccess();
+ var eventSource = _value;
+ var callback = new global::System.EventHandler