diff options
35 files changed, 297 insertions, 427 deletions
diff --git a/BuildHelpers.targets b/BuildHelpers.targets index 2c904d52..ba7b5c5d 100644 --- a/BuildHelpers.targets +++ b/BuildHelpers.targets @@ -1,3 +1,3 @@ -<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project> <!-- This file contains all the build helpers we require to build our projects in different contexts --> </Project> diff --git a/Directory.Build.props b/Directory.Build.props index 938c2baf..a4dfa642 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,9 +1,21 @@ <Project> <PropertyGroup> - <InMonoDevelopTree Condition="Exists('$(MSBuildThisFileDirectory)..\..\msbuild\MonoDevelop.AfterCommon.props')">true</InMonoDevelopTree> - <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion> - <TargetFrameworks>net472</TargetFrameworks> + <InMonoDevelopTree>False</InMonoDevelopTree> + <Net6>False</Net6> + <InMonoDevelopTree Condition="Exists('$(MSBuildThisFileDirectory)..\..\msbuild\MonoDevelop.AfterCommon.props')">True</InMonoDevelopTree> + <Net6 Condition="Exists('$(MSBuildThisFileDirectory)..\..\msbuild\Net6.props')">True</Net6> + + <DotNetFrameworkTarget>net461</DotNetFrameworkTarget> + <DotNetCoreTarget>netstandard2.0</DotNetCoreTarget> + + <MacTargetFramework Condition="!$(Net6)">$(DotNetFrameworkTarget)</MacTargetFramework> + <MacTargetFramework Condition="$(Net6)">net6.0-macos</MacTargetFramework> + + <TargetFramework Condition="!$(Net6)">$(DotNetFrameworkTarget)</TargetFramework> + <TargetFramework Condition="$(Net6)">$(DotNetCoreTarget)</TargetFramework> + + <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath> </PropertyGroup> </Project> diff --git a/Directory.Build.targets b/Directory.Build.targets index 4f5ba19f..bc0b5297 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -1,7 +1,5 @@ <Project> <PropertyGroup> - <InMonoDevelopTree Condition="Exists('$(MSBuildThisFileDirectory)..\..\msbuild\MonoDevelop.AfterCommon.props')">true</InMonoDevelopTree> - <TargetFrameworks>net472</TargetFrameworks> <PublishRepositoryUrl>true</PublishRepositoryUrl> </PropertyGroup> diff --git a/TestApps/Samples/Samples.csproj b/TestApps/Samples/Samples.csproj index 01e07561..6000fb96 100644 --- a/TestApps/Samples/Samples.csproj +++ b/TestApps/Samples/Samples.csproj @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> @@ -37,97 +37,17 @@ <Reference Include="System.Xml" /> </ItemGroup> <ItemGroup> - <Compile Include="Samples\ChartSample.cs" /> - <Compile Include="Samples\Mnemonics.cs" /> - <Compile Include="Samples\Spinners.cs" /> - <Compile Include="Samples\LinkLabels.cs" /> - <Compile Include="Samples\NotebookSample.cs" /> - <Compile Include="Samples\Boxes.cs" /> - <Compile Include="Samples\ListView1.cs" /> - <Compile Include="Samples\DragDrop.cs" /> - <Compile Include="MainWindow.cs"> + <Compile Update="MainWindow.cs"> <DeployService-Deploy>True</DeployService-Deploy> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </Compile> - <Compile Include="App.cs"> + <Compile Update="App.cs"> <DeployService-Deploy>True</DeployService-Deploy> <Gettext-ScanForTranslations>False</Gettext-ScanForTranslations> </Compile> - <Compile Include="MonoDevelop.Components.Chart\Axis.cs" /> - <Compile Include="MonoDevelop.Components.Chart\AxisDimension.cs" /> - <Compile Include="MonoDevelop.Components.Chart\AxisPosition.cs" /> - <Compile Include="MonoDevelop.Components.Chart\BasicChart.cs" /> - <Compile Include="MonoDevelop.Components.Chart\ChartCursor.cs" /> - <Compile Include="MonoDevelop.Components.Chart\DateTimeAxis.cs" /> - <Compile Include="MonoDevelop.Components.Chart\IntegerAxis.cs" /> - <Compile Include="MonoDevelop.Components.Chart\Serie.cs" /> - <Compile Include="MonoDevelop.Components.Chart\TickEnumerator.cs" /> - <Compile Include="Samples\PartialImages.cs" /> - <Compile Include="Samples\ScrollWindowSample.cs" /> - <Compile Include="Samples\ButtonSample.cs" /> - <Compile Include="Samples\DrawingTransforms.cs" /> - <Compile Include="Samples\ComboBoxes.cs" /> - <Compile Include="Samples\Designer.cs" /> - <Compile Include="Samples\TextInput.cs" /> - <Compile Include="Samples\Windows.cs" /> - <Compile Include="Samples\TextEntries.cs" /> - <Compile Include="Samples\Images.cs" /> - <Compile Include="Samples\ThemedImages.cs" /> - <Compile Include="Samples\CanvasWithWidget.cs" /> - <Compile Include="Samples\Tables.cs" /> - <Compile Include="Samples\Labels.cs" /> - <Compile Include="Samples\Colors.cs" /> - <Compile Include="Samples\Frames.cs" /> - <Compile Include="Samples\Checkboxes.cs" /> - <Compile Include="Samples\WidgetEvents.cs" /> - <Compile Include="Samples\ClipboardSample.cs" /> - <Compile Include="Samples\MenuSamples.cs" /> - <Compile Include="Samples\Tooltips.cs" /> - <Compile Include="Samples\TreeViews.cs" /> - <Compile Include="Samples\PanedViews.cs" /> - <Compile Include="Samples\DrawingText.cs" /> - <Compile Include="Samples\DrawingFigures.cs" /> - <Compile Include="Samples\DrawingPatternsAndImages.cs" /> - <Compile Include="Samples\ListBoxSample.cs" /> - <Compile Include="Samples\ColorSelectorSample.cs" /> - <Compile Include="Samples\ProgressBarSample.cs" /> - <Compile Include="Samples\ExpanderSample.cs" /> - <Compile Include="Samples\Markdown.cs" /> - <Compile Include="Samples\PopoverSample.cs" /> - <Compile Include="Samples\ScreensSample.cs" /> - <Compile Include="Samples\ImageScaling.cs" /> - <Compile Include="Samples\RadioButtonSample.cs" /> - <Compile Include="Samples\WidgetRendering.cs" /> - <Compile Include="Samples\ScrollbarSample.cs" /> - <Compile Include="Samples\DatePickerSample.cs" /> - <Compile Include="Samples\SliderSample.cs" /> - <Compile Include="Samples\ListView2.cs" /> - <Compile Include="Samples\OpacitySample.cs" /> - <Compile Include="Samples\PasswordEntries.cs" /> - <Compile Include="Samples\Image9Patch.cs" /> - <Compile Include="Samples\WebViewSample.cs" /> - <Compile Include="Samples\SpinButtonSample.cs" /> - <Compile Include="Samples\MouseCursors.cs" /> - <Compile Include="Samples\MessageDialogs.cs" /> - <Compile Include="Samples\MultithreadingSample.cs" /> - <Compile Include="Samples\WidgetFocus.cs" /> - <Compile Include="Samples\ListViewCellBounds.cs" /> - <Compile Include="Samples\TreeViewCellBounds.cs" /> - <Compile Include="Samples\CalendarSample.cs" /> - <Compile Include="Samples\FontSelectorSample.cs" /> - <Compile Include="Samples\ListViewEntries.cs" /> - <Compile Include="Samples\FileSelectorSample.cs" /> - <Compile Include="Samples\FolderSelectorSample.cs" /> - <Compile Include="Samples\ListViewCombos.cs" /> - <Compile Include="Samples\PopupWindows.cs" /> - <Compile Include="Samples\TreeViewCustomStore.cs" /> - <Compile Include="Samples\TreeViewEvents.cs" /> </ItemGroup> - <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <ItemGroup> <ProjectReference Include="..\..\Xwt\Xwt.csproj"> - <Project>{92494904-35FA-4DC9-BDE9-3A3E87AC49D3}</Project> - <Name>Xwt</Name> </ProjectReference> </ItemGroup> <ItemGroup> diff --git a/TestApps/XamMacTest/XamMacTest.csproj b/TestApps/XamMacTest/XamMacTest.csproj index eb578e3a..a1e2f922 100644 --- a/TestApps/XamMacTest/XamMacTest.csproj +++ b/TestApps/XamMacTest/XamMacTest.csproj @@ -29,6 +29,7 @@ <Profiling>false</Profiling> <AOTMode>None</AOTMode> <LangVersion>6</LangVersion> + <LinkMode>None</LinkMode> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <DebugType>pdbonly</DebugType> @@ -47,6 +48,7 @@ <DebugSymbols>true</DebugSymbols> <AOTMode>None</AOTMode> <LangVersion>6</LangVersion> + <LinkMode>None</LinkMode> </PropertyGroup> <ItemGroup> <Reference Include="System" /> diff --git a/Xwt.XamMac/AssemblyInfo.cs b/Xwt.XamMac/AssemblyInfo.cs deleted file mode 100755 index ea440b81..00000000 --- a/Xwt.XamMac/AssemblyInfo.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// Information about this assembly is defined by the following attributes. -// Change them to the values specific to your project. - -[assembly: AssemblyTitle("Xwt.XamMac")] -[assembly: AssemblyDescription("Xamarin Mac Toolkit for the Xwt UI Framework")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Xwt UI Framework")] -[assembly: AssemblyCopyright("Xamarin, Inc (http://www.xamarin.com)")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". -// The form "{Major}.{Minor}.*" will automatically update the build and revision, -// and "{Major}.{Minor}.{Build}.*" will update just the revision. - -[assembly: AssemblyVersion("0.1.0.0")] -[assembly: AssemblyInformationalVersion("0.1.0.0-prerelease")] - -// The following attributes are used to specify the signing key for the assembly, -// if desired. See the Mono documentation for more information about signing. - -//[assembly: AssemblyDelaySign(false)] -//[assembly: AssemblyKeyFile("")] - diff --git a/Xwt.XamMac/Xwt.Mac.CellViews/CanvasTableCell.cs b/Xwt.XamMac/Xwt.Mac.CellViews/CanvasTableCell.cs index 566dd9b0..9676c639 100644 --- a/Xwt.XamMac/Xwt.Mac.CellViews/CanvasTableCell.cs +++ b/Xwt.XamMac/Xwt.Mac.CellViews/CanvasTableCell.cs @@ -26,6 +26,7 @@ using System; using AppKit; using CoreGraphics; +using ObjCRuntime; using Xwt.Backends; namespace Xwt.Mac diff --git a/Xwt.XamMac/Xwt.Mac/AlertDialogBackend.cs b/Xwt.XamMac/Xwt.Mac/AlertDialogBackend.cs index 99efaaaa..7c2b2e56 100644 --- a/Xwt.XamMac/Xwt.Mac/AlertDialogBackend.cs +++ b/Xwt.XamMac/Xwt.Mac/AlertDialogBackend.cs @@ -117,7 +117,7 @@ namespace Xwt.Mac public bool ApplyToAll { get; set; } #endregion - public override bool ConformsToProtocol (IntPtr protocol) + public override bool ConformsToProtocol (NativeHandle protocol) { // HACK: for some reason on systems with a TouchBar this might be called // after the window has been closed and released, resulting in diff --git a/Xwt.XamMac/Xwt.Mac/BoxBackend.cs b/Xwt.XamMac/Xwt.Mac/BoxBackend.cs index 53f12d33..a2cd4dcd 100644 --- a/Xwt.XamMac/Xwt.Mac/BoxBackend.cs +++ b/Xwt.XamMac/Xwt.Mac/BoxBackend.cs @@ -27,6 +27,7 @@ using System; using AppKit; using CoreGraphics; +using ObjCRuntime; using Xwt.Backends; namespace Xwt.Mac diff --git a/Xwt.XamMac/Xwt.Mac/CanvasBackend.cs b/Xwt.XamMac/Xwt.Mac/CanvasBackend.cs index 66204936..3e361758 100644 --- a/Xwt.XamMac/Xwt.Mac/CanvasBackend.cs +++ b/Xwt.XamMac/Xwt.Mac/CanvasBackend.cs @@ -28,6 +28,7 @@ using System; using AppKit; using CoreGraphics; +using ObjCRuntime; using Xwt.Backends; namespace Xwt.Mac diff --git a/Xwt.XamMac/Xwt.Mac/ContextBackendHandler.cs b/Xwt.XamMac/Xwt.Mac/ContextBackendHandler.cs index 005a143a..b0533309 100644 --- a/Xwt.XamMac/Xwt.Mac/ContextBackendHandler.cs +++ b/Xwt.XamMac/Xwt.Mac/ContextBackendHandler.cs @@ -29,6 +29,7 @@ using System; using System.Collections.Generic; using AppKit; using CoreGraphics; +using ObjCRuntime; using Xwt.Backends; using Xwt.Drawing; @@ -360,7 +361,7 @@ namespace Xwt.Mac public override Matrix GetCTM (object backend) { CGAffineTransform t = GetContextTransform ((CGContextBackend)backend); - Matrix ctm = new Matrix (t.xx, t.yx, t.xy, t.yy, t.x0, t.y0); + Matrix ctm = new Matrix (t.A, t.B, t.C, t.D, t.Tx, t.Ty); return ctm; } diff --git a/Xwt.XamMac/Xwt.Mac/DialogBackend.cs b/Xwt.XamMac/Xwt.Mac/DialogBackend.cs index c163956a..446113aa 100644 --- a/Xwt.XamMac/Xwt.Mac/DialogBackend.cs +++ b/Xwt.XamMac/Xwt.Mac/DialogBackend.cs @@ -29,6 +29,7 @@ using System.Linq; using AppKit; using CoreGraphics; using Foundation; +using ObjCRuntime; using Xwt.Backends; using Xwt.Drawing; diff --git a/Xwt.XamMac/Xwt.Mac/FrameBackend.cs b/Xwt.XamMac/Xwt.Mac/FrameBackend.cs index 199362cf..91b681c0 100644 --- a/Xwt.XamMac/Xwt.Mac/FrameBackend.cs +++ b/Xwt.XamMac/Xwt.Mac/FrameBackend.cs @@ -26,6 +26,7 @@ using System; using AppKit; using CoreGraphics; +using ObjCRuntime; using Xwt.Backends; using Xwt.Drawing; diff --git a/Xwt.XamMac/Xwt.Mac/GradientBackendHandler.cs b/Xwt.XamMac/Xwt.Mac/GradientBackendHandler.cs index 2735fc02..7aaed1e8 100644 --- a/Xwt.XamMac/Xwt.Mac/GradientBackendHandler.cs +++ b/Xwt.XamMac/Xwt.Mac/GradientBackendHandler.cs @@ -27,6 +27,7 @@ using System; using System.Collections.Generic; using CoreGraphics; +using ObjCRuntime; using Xwt.Backends; namespace Xwt.Mac diff --git a/Xwt.XamMac/Xwt.Mac/KeyboardUtil.cs b/Xwt.XamMac/Xwt.Mac/KeyboardUtil.cs index b41c0a30..a2e317da 100644 --- a/Xwt.XamMac/Xwt.Mac/KeyboardUtil.cs +++ b/Xwt.XamMac/Xwt.Mac/KeyboardUtil.cs @@ -33,170 +33,147 @@ namespace Xwt.Mac { public static KeyEventArgs ToXwtKeyEventArgs (this NSEvent keyEvent) { - Key key = GetXwtKey(keyEvent); - ModifierKeys mod = keyEvent.ModifierFlags.ToXwtValue (); + NSEventModifierMask mask; + Key key = GetXwtKey(keyEvent, out mask); + ModifierKeys mod = mask.ToXwtValue (); return new KeyEventArgs (key, keyEvent.KeyCode, mod, keyEvent.IsARepeat, (long)TimeSpan.FromSeconds (keyEvent.Timestamp).TotalMilliseconds, keyEvent.Characters, keyEvent.CharactersIgnoringModifiers, keyEvent); } - static Key GetXwtKey (NSEvent keyEvent) + static Key RemoveShift(Key key, ref NSEventModifierMask mask) + { + mask &= ~NSEventModifierMask.ShiftKeyMask; + return key; + } + + static Key GetXwtKey (NSEvent keyEvent, out NSEventModifierMask modMask) { + // NSEvent.KeyCode is the physical key pressed according to an ANSI US keyboard. + // With this pressing the м key on a Cyrillac keyboard or ㅍ in Korean both return v + // Parsing keyboard shortcuts should be based off this. + // Handling text input should be based off the Characters and CharactersIgnoringModifiers fields. + // For compatibility reasons the Key field parses Characters/CharactersIgnoringModifiers into a + // Xwt.Key enum value, but most of unicode characters are not parsed so KeyEventArgs.Key probably + // should be considered obsolete. + modMask = keyEvent.ModifierFlags; + // special keys switch (keyEvent.KeyCode) { - case 65: return Key.NumPadDecimal; // kVK_ANSI_KeypadDecimal = 0x41 + case 0: return Key.a; + case 1: return Key.s; + case 2: return Key.d; + case 3: return Key.f; + case 4: return Key.h; + case 5: return Key.g; + case 6: return Key.z; + case 7: return Key.x; + case 8: return Key.c; + case 9: return Key.v; + case 11: return Key.b; + case 12: return Key.q; + case 13: return Key.w; + case 14: return Key.e; + case 15: return Key.r; + case 16: return Key.y; + case 17: return Key.t; + case 18: return Key.K1; + case 19: return Key.K2; + case 20: return Key.K3; + case 21: return Key.K4; + case 22: return Key.K6; + case 23: return Key.K5; + case 24: return Key.Equal; + case 25: return Key.K9; + case 26: return Key.K7; + case 27: return Key.Minus; + case 28: return Key.K8; + case 29: return Key.K0; + case 30: return Key.RightSquareBracket; + case 31: return Key.o; + case 32: return Key.u; + case 33: return Key.LeftSquareBracket; + case 34: return Key.I; + case 35: return Key.P; + case 37: return Key.L; + case 38: return Key.J; + case 39: return Key.Quote; + case 40: return Key.K; + case 41: return Key.Semicolon; + case 42: return Key.Backslash; + case 43: return Key.Comma; + case 44: return Key.Slash; + case 45: return Key.N; + case 46: return Key.M; + case 47: return Key.Period; + case 50: return Key.Backtick; + + case 65: return Key.NumPadDecimal; // kVK_ANSI_KeypadDecimal = 0x41 case 67: return Key.NumPadMultiply; // kVK_ANSI_KeypadMultiply = 0x43 - case 69: return Key.NumPadAdd; // kVK_ANSI_KeypadPlus = 0x45 - case 71: return Key.NumLock; // kVK_ANSI_KeypadClear = 0x47 - case 75: return Key.NumPadDivide; // kVK_ANSI_KeypadDivide = 0x4B - case 76: return Key.NumPadEnter; // kVK_ANSI_KeypadEnter = 0x4C + case 69: return Key.NumPadAdd; // kVK_ANSI_KeypadPlus = 0x45 + case 71: return Key.NumLock; // kVK_ANSI_KeypadClear = 0x47 + case 75: return Key.NumPadDivide; // kVK_ANSI_KeypadDivide = 0x4B + case 76: return Key.NumPadEnter; // kVK_ANSI_KeypadEnter = 0x4C case 78: return Key.NumPadSubtract; // kVK_ANSI_KeypadMinus = 0x4E - case 81: return Key.NumPadEnter; // kVK_ANSI_KeypadEquals = 0x51 - case 82: return Key.NumPad0; // kVK_ANSI_Keypad0 = 0x52 - case 83: return Key.NumPad1; // kVK_ANSI_Keypad1 = 0x53 - case 84: return Key.NumPad2; // kVK_ANSI_Keypad2 = 0x54 - case 85: return Key.NumPad3; // kVK_ANSI_Keypad3 = 0x55 - case 86: return Key.NumPad4; // kVK_ANSI_Keypad4 = 0x56 - case 87: return Key.NumPad5; // kVK_ANSI_Keypad5 = 0x57 - case 88: return Key.NumPad6; // kVK_ANSI_Keypad6 = 0x58 - case 89: return Key.NumPad7; // kVK_ANSI_Keypad7 = 0x59 - case 91: return Key.NumPad8; // kVK_ANSI_Keypad8 = 0x5B - case 92: return Key.NumPad9; // kVK_ANSI_Keypad9 = 0x5C + case 81: return Key.NumPadEnter; // kVK_ANSI_KeypadEquals = 0x51 + case 82: return Key.NumPad0; // kVK_ANSI_Keypad0 = 0x52 + case 83: return Key.NumPad1; // kVK_ANSI_Keypad1 = 0x53 + case 84: return Key.NumPad2; // kVK_ANSI_Keypad2 = 0x54 + case 85: return Key.NumPad3; // kVK_ANSI_Keypad3 = 0x55 + case 86: return Key.NumPad4; // kVK_ANSI_Keypad4 = 0x56 + case 87: return Key.NumPad5; // kVK_ANSI_Keypad5 = 0x57 + case 88: return Key.NumPad6; // kVK_ANSI_Keypad6 = 0x58 + case 89: return Key.NumPad7; // kVK_ANSI_Keypad7 = 0x59 + case 91: return Key.NumPad8; // kVK_ANSI_Keypad8 = 0x5B + case 92: return Key.NumPad9; // kVK_ANSI_Keypad9 = 0x5C - case 36: return Key.Return; // kVK_Return = 0x24 - case 48: return Key.Tab; // kVK_Tab = 0x30 - case 49: return Key.Space; // kVK_Space = 0x31 - case 51: return Key.BackSpace; // kVK_Delete = 0x33 - case 53: return Key.Escape; // kVK_Escape = 0x35 - case 55: return Key.MetaLeft; // kVK_Command = 0x37 - case 56: return Key.ShiftLeft; // kVK_Shift = 0x38 - case 57: return Key.CapsLock; // kVK_CapsLock = 0x39 - case 58: return Key.AltLeft; // kVK_Option = 0x3A - case 59: return Key.ControlLeft; // kVK_Control = 0x3B - case 60: return Key.ShiftRight; // kVK_RightShift = 0x3C - case 61: return Key.AltRight; // kVK_RightOption = 0x3D - case 62: return Key.ControlRight; // kVK_RightControl = 0x3E - case 0x3F: return Key.function; // kVK_Function = 0x3F - case 0x40: return Key.F17; // kVK_F17 = 0x40 - case 0x48: return Key.AudioRaiseVolume; // kVK_VolumeUp = 0x48 - case 0x49: return Key.AudioLowerVolume; // kVK_VolumeDown = 0x49 - case 0x4A: return Key.AudioMute; // kVK_Mute = 0x4A - case 0x4F: return Key.F18; // kVK_F18 = 0x4F - case 0x50: return Key.F19; // kVK_F19 = 0x50 - case 0x5A: return Key.F20; // kVK_F20 = 0x5A - case 96: return Key.F5; // kVK_F5 = 0x60 - case 97: return Key.F6; // kVK_F6 = 0x61 - case 98: return Key.F7; // kVK_F7 = 0x62 - case 99: return Key.F3; // kVK_F3 = 0x63 - case 100: return Key.F8; // kVK_F8 = 0x64 - case 101: return Key.F9; // kVK_F9 = 0x65 - case 0x67: return Key.F11; // kVK_F11 = 0x67 - case 105: return Key.Print; // kVK_F13 = 0x69 - case 0x6A: return Key.F16; // kVK_F16 = 0x6A - case 0x6B: return Key.F14; // kVK_F14 = 0x6B - case 109: return Key.F10; // kVK_F10 = 0x6D - case 0x6F: return Key.F12; // kVK_F12 = 0x6F - case 0x71: return Key.F15; // kVK_F15 = 0x71 - case 114: return Key.Help; // kVK_Help = 0x72 - case 115: return Key.Home; // kVK_Home = 0x73 - case 116: return Key.PageUp; // kVK_PageUp = 0x74 - case 117: return Key.Delete; // kVK_ForwardDelete = 0x75 - case 118: return Key.F4; // kVK_F4 = 0x76 - case 119: return Key.End; // kVK_End = 0x77 - case 120: return Key.F2; // kVK_F2 = 0x78 - case 121: return Key.PageDown; // kVK_PageDown = 0x79 - case 122: return Key.F1; // kVK_F1 = 0x7A - case 123: return Key.Left; // kVK_LeftArrow = 0x7B - case 124: return Key.Right; // kVK_RightArrow = 0x7C - case 125: return Key.Down; // kVK_DownArrow = 0x7D - case 126: return Key.Up; // kVK_UpArrow = 0x7E + case 36: return Key.Return; // kVK_Return = 0x24 + case 48: return Key.Tab; // kVK_Tab = 0x30 + case 49: return Key.Space; // kVK_Space = 0x31 + case 51: return Key.BackSpace; // kVK_Delete = 0x33 + case 53: return Key.Escape; // kVK_Escape = 0x35 + case 55: return Key.MetaLeft; // kVK_Command = 0x37 + case 56: return Key.ShiftLeft; // kVK_Shift = 0x38 + case 57: return Key.CapsLock; // kVK_CapsLock = 0x39 + case 58: return Key.AltLeft; // kVK_Option = 0x3A + case 59: return Key.ControlLeft; // kVK_Control = 0x3B + case 60: return Key.ShiftRight; // kVK_RightShift = 0x3C + case 61: return Key.AltRight; // kVK_RightOption = 0x3D + case 62: return Key.ControlRight; // kVK_RightControl = 0x3E + case 0x3F: return Key.function; // kVK_Function = 0x3F + case 0x40: return Key.F17; // kVK_F17 = 0x40 + case 0x48: return Key.AudioRaiseVolume; // kVK_VolumeUp = 0x48 + case 0x49: return Key.AudioLowerVolume; // kVK_VolumeDown = 0x49 + case 0x4A: return Key.AudioMute; // kVK_Mute = 0x4A + case 0x4F: return Key.F18; // kVK_F18 = 0x4F + case 0x50: return Key.F19; // kVK_F19 = 0x50 + case 0x5A: return Key.F20; // kVK_F20 = 0x5A + case 96: return Key.F5; // kVK_F5 = 0x60 + case 97: return Key.F6; // kVK_F6 = 0x61 + case 98: return Key.F7; // kVK_F7 = 0x62 + case 99: return Key.F3; // kVK_F3 = 0x63 + case 100: return Key.F8; // kVK_F8 = 0x64 + case 101: return Key.F9; // kVK_F9 = 0x65 + case 0x67: return Key.F11; // kVK_F11 = 0x67 + case 105: return Key.Print; // kVK_F13 = 0x69 + case 0x6A: return Key.F16; // kVK_F16 = 0x6A + case 0x6B: return Key.F14; // kVK_F14 = 0x6B + case 109: return Key.F10; // kVK_F10 = 0x6D + case 0x6F: return Key.F12; // kVK_F12 = 0x6F + case 0x71: return Key.F15; // kVK_F15 = 0x71 + case 114: return Key.Help; // kVK_Help = 0x72 + case 115: return Key.Home; // kVK_Home = 0x73 + case 116: return Key.PageUp; // kVK_PageUp = 0x74 + case 117: return Key.Delete; // kVK_ForwardDelete = 0x75 + case 118: return Key.F4; // kVK_F4 = 0x76 + case 119: return Key.End; // kVK_End = 0x77 + case 120: return Key.F2; // kVK_F2 = 0x78 + case 121: return Key.PageDown; // kVK_PageDown = 0x79 + case 122: return Key.F1; // kVK_F1 = 0x7A + case 123: return Key.Left; // kVK_LeftArrow = 0x7B + case 124: return Key.Right; // kVK_RightArrow = 0x7C + case 125: return Key.Down; // kVK_DownArrow = 0x7D + case 126: return Key.Up; // kVK_UpArrow = 0x7E } - // character keys: use character comparison, since KeyCode is always US - // and does not honor inernationalization like WPF or GTK - if (keyEvent.CharactersIgnoringModifiers.Length > 0) - switch (keyEvent.CharactersIgnoringModifiers[0]) { - case 'A': return Key.A; - case 'B': return Key.B; - case 'C': return Key.C; - case 'D': return Key.D; - case 'E': return Key.E; - case 'F': return Key.F; - case 'G': return Key.G; - case 'H': return Key.H; - case 'I': return Key.I; - case 'J': return Key.J; - case 'K': return Key.K; - case 'L': return Key.L; - case 'M': return Key.M; - case 'N': return Key.N; - case 'O': return Key.O; - case 'P': return Key.P; - case 'Q': return Key.Q; - case 'R': return Key.R; - case 'S': return Key.S; - case 'T': return Key.T; - case 'U': return Key.U; - case 'V': return Key.V; - case 'W': return Key.W; - case 'X': return Key.X; - case 'Y': return Key.Y; - case 'Z': return Key.Z; - case 'a': return Key.a; - case 'b': return Key.b; - case 'c': return Key.c; - case 'd': return Key.d; - case 'e': return Key.e; - case 'f': return Key.f; - case 'g': return Key.g; - case 'h': return Key.h; - case 'i': return Key.i; - case 'j': return Key.j; - case 'k': return Key.k; - case 'l': return Key.l; - case 'm': return Key.m; - case 'n': return Key.n; - case 'o': return Key.o; - case 'p': return Key.p; - case 'q': return Key.q; - case 'r': return Key.r; - case 's': return Key.s; - case 't': return Key.t; - case 'u': return Key.u; - case 'v': return Key.v; - case 'w': return Key.w; - case 'x': return Key.x; - case 'y': return Key.y; - case 'z': return Key.z; - - case '1': return Key.K1; - case '2': return Key.K2; - case '3': return Key.K3; - case '4': return Key.K4; - case '5': return Key.K5; - case '6': return Key.K6; - case '7': return Key.K7; - case '8': return Key.K8; - case '9': return Key.K9; - case '0': return Key.K0; - - case '^': return Key.Caret; - case '\'': return Key.Quote; - case '(': return Key.LeftBracket; - case ')': return Key.RightBracket; - case '*': return Key.Asterisk; - case '+': return Key.Plus; - case ',': return Key.Comma; - case '-': return Key.Minus; - case '.': return Key.Period; - case '/': return Key.Slash; - case '\\': return Key.Backslash; - case ':': return Key.Colon; - case ';': return Key.Semicolon; - case '<': return Key.Less; - case '>': return Key.Greater; - case '=': return Key.Equal; - case '?': return Key.Question; - case '@': return Key.At; - } return (Key)0; } } diff --git a/Xwt.XamMac/Xwt.Mac/ListViewBackend.cs b/Xwt.XamMac/Xwt.Mac/ListViewBackend.cs index 0566e606..6a8a3199 100644 --- a/Xwt.XamMac/Xwt.Mac/ListViewBackend.cs +++ b/Xwt.XamMac/Xwt.Mac/ListViewBackend.cs @@ -33,6 +33,7 @@ using System.Linq; using AppKit; using CoreGraphics; using Foundation; +using ObjCRuntime; using Xwt.Backends; namespace Xwt.Mac @@ -278,7 +279,8 @@ namespace Xwt.Mac this.source = source; } - public override bool AcceptDrop (NSTableView tableView, NSDraggingInfo info, nint row, NSTableViewDropOperation dropOperation) + [Export("tableView:acceptDrop:row:dropOperation:")] + public bool AcceptDrop (NSTableView tableView, INSDraggingInfo info, nint row, NSTableViewDropOperation dropOperation) { return false; } @@ -306,7 +308,8 @@ namespace Xwt.Mac { } - public override NSDragOperation ValidateDrop (NSTableView tableView, NSDraggingInfo info, nint row, NSTableViewDropOperation dropOperation) + [Export("tableView:validateDrop:proposedRow:proposedDropOperation:")] + public NSDragOperation ValidateDrop (NSTableView tableView, INSDraggingInfo info, nint row, NSTableViewDropOperation dropOperation) { return NSDragOperation.None; } diff --git a/Xwt.XamMac/Xwt.Mac/MacDesktopBackend.cs b/Xwt.XamMac/Xwt.Mac/MacDesktopBackend.cs index c52fa9a2..9920a12e 100644 --- a/Xwt.XamMac/Xwt.Mac/MacDesktopBackend.cs +++ b/Xwt.XamMac/Xwt.Mac/MacDesktopBackend.cs @@ -28,6 +28,7 @@ using System; using System.Collections.Generic; using AppKit; using CoreGraphics; +using ObjCRuntime; using Xwt.Backends; namespace Xwt.Mac diff --git a/Xwt.XamMac/Xwt.Mac/MacEngine.cs b/Xwt.XamMac/Xwt.Mac/MacEngine.cs index 84985143..3195ed7d 100644 --- a/Xwt.XamMac/Xwt.Mac/MacEngine.cs +++ b/Xwt.XamMac/Xwt.Mac/MacEngine.cs @@ -166,14 +166,6 @@ namespace Xwt.Mac static Selector hijackedSel = new Selector ("hijacked_loadNibNamed:owner:"); static Selector originalSel = new Selector ("loadNibNamed:owner:"); - static void Hijack () - { - Class c = ObjcHelper.GetMetaClass ("NSBundle"); - if (!c.AddMethod (hijackedSel.Handle, new Func<IntPtr, IntPtr, IntPtr, IntPtr,bool>(HijackedLoadNibNamed), "B@:@@")) - throw new Exception ("Failed to add method"); - c.MethodExchange (originalSel.Handle, hijackedSel.Handle); - } - static bool HijackedLoadNibNamed (IntPtr self, IntPtr sel, IntPtr filePath, IntPtr owner) { var str = (NSString) Runtime.GetNSObject (filePath); diff --git a/Xwt.XamMac/Xwt.Mac/OutlineViewBackend.cs b/Xwt.XamMac/Xwt.Mac/OutlineViewBackend.cs index d424dec6..d24917aa 100644 --- a/Xwt.XamMac/Xwt.Mac/OutlineViewBackend.cs +++ b/Xwt.XamMac/Xwt.Mac/OutlineViewBackend.cs @@ -26,6 +26,8 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. +global using ObjCRuntime; + using System; using System.Linq; using AppKit; diff --git a/Xwt.XamMac/Xwt.Mac/PanedBackend.cs b/Xwt.XamMac/Xwt.Mac/PanedBackend.cs index 02624533..16757b30 100644 --- a/Xwt.XamMac/Xwt.Mac/PanedBackend.cs +++ b/Xwt.XamMac/Xwt.Mac/PanedBackend.cs @@ -24,8 +24,11 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. +using System; using AppKit; +using CoreGraphics; using Foundation; +using ObjCRuntime; using Xwt.Backends; namespace Xwt.Mac @@ -35,7 +38,8 @@ namespace Xwt.Mac SplitViewDelegate viewDelegate; NSView view1; NSView view2; - + double position; + class SplitViewDelegate: NSSplitViewDelegate { public PanedBackend PanedBackend; @@ -120,9 +124,12 @@ namespace Xwt.Mac public double Position { get { - return 0; + return position; } set { + ((CustomSplitView)Widget)?.SetDividerPosition ((nfloat) value); + position = value; + this.DidResizeSubviews(); } } #endregion @@ -130,6 +137,8 @@ namespace Xwt.Mac class CustomSplitView: NSSplitView, IViewObject { + nfloat delayedSetDividerPosition = -1; + public NSView View { get { return this; @@ -137,6 +146,31 @@ namespace Xwt.Mac } public ViewBackend Backend { get; set; } + + public override CGRect Frame + { + get { + return base.Frame; + } + + set { + base.Frame = value; + if (delayedSetDividerPosition != -1 && Frame.Width != 0) { + SetPositionOfDivider(delayedSetDividerPosition, 0); + delayedSetDividerPosition = -1; + } + } + } + + public void SetDividerPosition(nfloat position) + { + // When the split view is first created we need to wait to set the divider position, + // until the pane has its full (non zero) width. If set too early, it'll be ignored. + if (Frame.Width == 0) + delayedSetDividerPosition = position; + else + SetPositionOfDivider(position, 0); + } } } diff --git a/Xwt.XamMac/Xwt.Mac/PathBackendHandler.cs b/Xwt.XamMac/Xwt.Mac/PathBackendHandler.cs index 6427ba42..c719144b 100644 --- a/Xwt.XamMac/Xwt.Mac/PathBackendHandler.cs +++ b/Xwt.XamMac/Xwt.Mac/PathBackendHandler.cs @@ -26,6 +26,7 @@ using System; using CoreGraphics; +using ObjCRuntime; using Xwt.Backends; namespace Xwt.Mac diff --git a/Xwt.XamMac/Xwt.Mac/PopoverBackend.cs b/Xwt.XamMac/Xwt.Mac/PopoverBackend.cs index ea95fab3..c0c1c7ef 100644 --- a/Xwt.XamMac/Xwt.Mac/PopoverBackend.cs +++ b/Xwt.XamMac/Xwt.Mac/PopoverBackend.cs @@ -30,6 +30,7 @@ using System.Collections.Generic; using AppKit; using CoreGraphics; using Foundation; +using ObjCRuntime; using Xwt.Backends; using Xwt.Drawing; @@ -258,7 +259,7 @@ namespace Xwt.Mac controller.EffectiveAppearanceName = refView.EffectiveAppearance.Name; if (popover is INSAppearanceCustomization) - ((INSAppearanceCustomization)popover).SetAppearance (refView.EffectiveAppearance); + ((INSAppearanceCustomization)popover).Appearance = refView.EffectiveAppearance; } popover.Show (positionRect.ToCGRect (), @@ -304,7 +305,7 @@ namespace Xwt.Mac public NSAppearanceCustomizationPopover () { } - protected NSAppearanceCustomizationPopover (IntPtr handle) : base (handle) + protected NSAppearanceCustomizationPopover (NativeHandle handle) : base (handle) { } } } diff --git a/Xwt.XamMac/Xwt.Mac/RichTextViewBackend.cs b/Xwt.XamMac/Xwt.Mac/RichTextViewBackend.cs index e539eb7f..d5495168 100644 --- a/Xwt.XamMac/Xwt.Mac/RichTextViewBackend.cs +++ b/Xwt.XamMac/Xwt.Mac/RichTextViewBackend.cs @@ -326,7 +326,7 @@ namespace Xwt.Mac TextStorage.EnumerateAttributes (new NSRange (0, TextStorage.Length), NSAttributedStringEnumeration.None, (NSDictionary attrs, NSRange range, ref bool stop) => { stop = false; if (attrs.ContainsKey (NSStringAttributeKey.Link)) { - var rects = RectsForCharacterRange (range); + var rects = GetRects (range); for (nuint i = 0; i < rects.Count; i++) AddCursorRect (rects.GetItem<NSValue> (i).CGRectValue, NSCursor.PointingHandCursor); } diff --git a/Xwt.XamMac/Xwt.Mac/ScrollControlBackend.cs b/Xwt.XamMac/Xwt.Mac/ScrollControlBackend.cs index f5c415d3..4d635ab0 100644 --- a/Xwt.XamMac/Xwt.Mac/ScrollControlBackend.cs +++ b/Xwt.XamMac/Xwt.Mac/ScrollControlBackend.cs @@ -27,6 +27,7 @@ using System; using AppKit; using CoreGraphics; +using ObjCRuntime; using Xwt.Backends; namespace Xwt.Mac diff --git a/Xwt.XamMac/Xwt.Mac/ScrollViewBackend.cs b/Xwt.XamMac/Xwt.Mac/ScrollViewBackend.cs index 58e0dbca..24fbc9a2 100644 --- a/Xwt.XamMac/Xwt.Mac/ScrollViewBackend.cs +++ b/Xwt.XamMac/Xwt.Mac/ScrollViewBackend.cs @@ -27,6 +27,7 @@ using System; using AppKit; using CoreGraphics; +using ObjCRuntime; using Xwt.Backends; namespace Xwt.Mac diff --git a/Xwt.XamMac/Xwt.Mac/TextLayoutBackendHandler.cs b/Xwt.XamMac/Xwt.Mac/TextLayoutBackendHandler.cs index 844031f2..c8fb79a8 100644 --- a/Xwt.XamMac/Xwt.Mac/TextLayoutBackendHandler.cs +++ b/Xwt.XamMac/Xwt.Mac/TextLayoutBackendHandler.cs @@ -31,6 +31,7 @@ using AppKit; using CoreGraphics; using CoreText; using Foundation; +using ObjCRuntime; using Xwt.Backends; using Xwt.Drawing; @@ -146,7 +147,7 @@ namespace Xwt.Mac // paragraph style TextContainer.LineBreakMode = TextTrimming == TextTrimming.WordElipsis ? NSLineBreakMode.TruncatingTail : NSLineBreakMode.ByWordWrapping; - var pstyle = NSParagraphStyle.DefaultParagraphStyle.MutableCopy () as NSMutableParagraphStyle; + var pstyle = NSParagraphStyle.Default.MutableCopy () as NSMutableParagraphStyle; pstyle.Alignment = TextAlignment.ToNSTextAlignment (); if (TextTrimming == TextTrimming.WordElipsis) pstyle.LineBreakMode = NSLineBreakMode.TruncatingTail; @@ -259,8 +260,8 @@ namespace Xwt.Mac TextLayout.AddTextContainer (TextContainer); TextStorage.AddLayoutManager (TextLayout); - TextLayout.DrawBackgroundForGlyphRange (new NSRange(0, Text.Length), new CGPoint (x, y)); - TextLayout.DrawGlyphsForGlyphRange (new NSRange(0, Text.Length), new CGPoint (x, y)); + TextLayout.DrawBackground (new NSRange(0, Text.Length), new CGPoint (x, y)); + TextLayout.DrawGlyphs (new NSRange(0, Text.Length), new CGPoint (x, y)); TextStorage.RemoveLayoutManager (TextLayout); TextLayout.RemoveTextContainer (0); } @@ -279,8 +280,8 @@ namespace Xwt.Mac { TextLayout.AddTextContainer (TextContainer); TextStorage.AddLayoutManager (TextLayout); - TextLayout.GlyphRangeForBoundingRect (new CGRect (CGPoint.Empty, TextContainer.Size), TextContainer); - var s = TextLayout.GetUsedRectForTextContainer (TextContainer); + TextLayout.GetGlyphRangeForBoundingRect (new CGRect (CGPoint.Empty, TextContainer.Size), TextContainer); + var s = TextLayout.GetUsedRect (TextContainer); TextStorage.RemoveLayoutManager (TextLayout); TextLayout.RemoveTextContainer (0); return s.Size; @@ -303,9 +304,8 @@ namespace Xwt.Mac { TextLayout.AddTextContainer (TextContainer); TextStorage.AddLayoutManager (TextLayout); - TextLayout.GlyphRangeForBoundingRect (new CGRect (CGPoint.Empty, TextContainer.Size), TextContainer); - nfloat fraction = 0; - var index = TextLayout.CharacterIndexForPoint (new CGPoint (x, y), TextContainer, ref fraction); + TextLayout.GetGlyphRangeForBoundingRect (new CGRect (CGPoint.Empty, TextContainer.Size), TextContainer); + var index = TextLayout.GetCharacterIndex (new CGPoint (x, y), TextContainer, out var fraction); TextStorage.RemoveLayoutManager (TextLayout); TextLayout.RemoveTextContainer (0); return index; @@ -318,9 +318,9 @@ namespace Xwt.Mac { TextLayout.AddTextContainer (TextContainer); TextStorage.AddLayoutManager (TextLayout); - TextLayout.GlyphRangeForBoundingRect (new CGRect (CGPoint.Empty, TextContainer.Size), TextContainer); - var glyphIndex = TextLayout.GlyphIndexForCharacterAtIndex (index); - var p = TextLayout.LocationForGlyphAtIndex ((nint)glyphIndex); + TextLayout.GetGlyphRangeForBoundingRect (new CGRect (CGPoint.Empty, TextContainer.Size), TextContainer); + var glyphIndex = TextLayout.GetGlyphIndex ((nuint)index); + var p = TextLayout.GetLocationForGlyph ((nuint)glyphIndex); TextStorage.RemoveLayoutManager (TextLayout); TextLayout.RemoveTextContainer (0); return p; diff --git a/Xwt.XamMac/Xwt.Mac/TreeViewBackend.cs b/Xwt.XamMac/Xwt.Mac/TreeViewBackend.cs index c9d83a76..167a241e 100644 --- a/Xwt.XamMac/Xwt.Mac/TreeViewBackend.cs +++ b/Xwt.XamMac/Xwt.Mac/TreeViewBackend.cs @@ -29,6 +29,7 @@ using System.Collections.Generic; using AppKit; using CoreGraphics; using Foundation; +using ObjCRuntime; using Xwt.Backends; namespace Xwt.Mac @@ -448,8 +449,9 @@ namespace Xwt.Mac items.TryGetValue (pos, out it); return it; } - - public override bool AcceptDrop (NSOutlineView outlineView, NSDraggingInfo info, NSObject item, nint index) + + [Export("tableView:acceptDrop:row:dropOperation:")] + public bool AcceptDrop (NSOutlineView outlineView, INSDraggingInfo info, NSObject item, nint index) { return false; } @@ -512,7 +514,8 @@ namespace Xwt.Mac { } - public override NSDragOperation ValidateDrop (NSOutlineView outlineView, NSDraggingInfo info, NSObject item, nint index) + [Export("tableView:validateDrop:proposedRow:proposedDropOperation:")] + public NSDragOperation ValidateDrop (NSOutlineView outlineView, INSDraggingInfo info, NSObject item, nint index) { return NSDragOperation.None; } diff --git a/Xwt.XamMac/Xwt.Mac/Util.cs b/Xwt.XamMac/Xwt.Mac/Util.cs index 9d7799cb..3f6f75dd 100644 --- a/Xwt.XamMac/Xwt.Mac/Util.cs +++ b/Xwt.XamMac/Xwt.Mac/Util.cs @@ -438,7 +438,7 @@ namespace Xwt.Mac ns.BeginEditing (); var r = new NSRange (0, ns.Length); ns.RemoveAttribute (NSStringAttributeKey.ParagraphStyle, r); - var pstyle = NSParagraphStyle.DefaultParagraphStyle.MutableCopy () as NSMutableParagraphStyle; + var pstyle = NSParagraphStyle.Default.MutableCopy () as NSMutableParagraphStyle; pstyle.Alignment = alignment; ns.AddAttribute (NSStringAttributeKey.ParagraphStyle, pstyle, r); ns.EndEditing (); diff --git a/Xwt.XamMac/Xwt.Mac/ViewBackend.cs b/Xwt.XamMac/Xwt.Mac/ViewBackend.cs index a492011e..68dd61e3 100644 --- a/Xwt.XamMac/Xwt.Mac/ViewBackend.cs +++ b/Xwt.XamMac/Xwt.Mac/ViewBackend.cs @@ -535,6 +535,13 @@ namespace Xwt.Mac static Selector becomeFirstResponderSel = new Selector ("becomeFirstResponder"); static Selector resignFirstResponderSel = new Selector ("resignFirstResponder"); + static DelegateIntPtrIntPtrIntPtrNSDragOperation draggingEnteredDelegate = new DelegateIntPtrIntPtrIntPtrNSDragOperation(DraggingEntered); + static DelegateIntPtrIntPtrIntPtrNSDragOperation draggingUpdatedDelegate = new DelegateIntPtrIntPtrIntPtrNSDragOperation(DraggingUpdated); + static DelegateIntPtrIntPtrIntPtrVoid draggingExitedDelegate = new DelegateIntPtrIntPtrIntPtrVoid(DraggingExited); + static DelegateIntPtrIntPtrIntPtrBool prepareForDragOperationDelegate = new DelegateIntPtrIntPtrIntPtrBool(PrepareForDragOperation); + static DelegateIntPtrIntPtrIntPtrBool performDragOperationDelegate = new DelegateIntPtrIntPtrIntPtrBool(PerformDragOperation); + static DelegateIntPtrIntPtrIntPtrVoid concludeDragOperationDelegate = new DelegateIntPtrIntPtrIntPtrVoid(ConcludeDragOperation); + static HashSet<Type> typesConfiguredForDragDrop = new HashSet<Type> (); static HashSet<Type> typesConfiguredForFocusEvents = new HashSet<Type> (); @@ -543,23 +550,31 @@ namespace Xwt.Mac lock (typesConfiguredForDragDrop) { if (typesConfiguredForDragDrop.Add (type)) { Class c = new Class (type); - c.AddMethod (draggingEnteredSel.Handle, new Func<IntPtr,IntPtr,IntPtr,NSDragOperation> (DraggingEntered), "i@:@"); - c.AddMethod (draggingUpdatedSel.Handle, new Func<IntPtr,IntPtr,IntPtr,NSDragOperation> (DraggingUpdated), "i@:@"); - c.AddMethod (draggingExitedSel.Handle, new Action<IntPtr,IntPtr,IntPtr> (DraggingExited), "v@:@"); - c.AddMethod (prepareForDragOperationSel.Handle, new Func<IntPtr,IntPtr,IntPtr,bool> (PrepareForDragOperation), "B@:@"); - c.AddMethod (performDragOperationSel.Handle, new Func<IntPtr,IntPtr,IntPtr,bool> (PerformDragOperation), "B@:@"); - c.AddMethod (concludeDragOperationSel.Handle, new Action<IntPtr,IntPtr,IntPtr> (ConcludeDragOperation), "v@:@"); + c.AddMethod (draggingEnteredSel.Handle, draggingEnteredDelegate, "i@:@"); + c.AddMethod (draggingUpdatedSel.Handle, draggingUpdatedDelegate, "i@:@"); + c.AddMethod (draggingExitedSel.Handle, draggingExitedDelegate, "v@:@"); + c.AddMethod (prepareForDragOperationSel.Handle, prepareForDragOperationDelegate, "B@:@"); + c.AddMethod (performDragOperationSel.Handle, performDragOperationDelegate, "B@:@"); + c.AddMethod (concludeDragOperationSel.Handle, concludeDragOperationDelegate, "v@:@"); } } } + delegate bool DelegateIntPtrIntPtrBool(IntPtr p1, IntPtr p2); + delegate NSDragOperation DelegateIntPtrIntPtrIntPtrNSDragOperation(IntPtr p1, IntPtr p2, IntPtr p3); + delegate void DelegateIntPtrIntPtrIntPtrVoid(IntPtr p1, IntPtr p2, IntPtr p3); + delegate bool DelegateIntPtrIntPtrIntPtrBool(IntPtr p1, IntPtr p2, IntPtr p3); + + static DelegateIntPtrIntPtrBool onBecomeFirstResponderDelegate = new DelegateIntPtrIntPtrBool(OnBecomeFirstResponder); + static DelegateIntPtrIntPtrBool onResignFirstResponderDelegate = new DelegateIntPtrIntPtrBool(OnResignFirstResponder); + static void SetupFocusEvents (Type type) { lock (typesConfiguredForFocusEvents) { if (typesConfiguredForFocusEvents.Add (type)) { Class c = new Class (type); - c.AddMethod (becomeFirstResponderSel.Handle, new Func<IntPtr,IntPtr,bool> (OnBecomeFirstResponder), "B@:"); - c.AddMethod (resignFirstResponderSel.Handle, new Func<IntPtr,IntPtr,bool> (OnResignFirstResponder), "B@:"); + c.AddMethod (becomeFirstResponderSel.Handle, onBecomeFirstResponderDelegate, "B@:"); + c.AddMethod (resignFirstResponderSel.Handle, onResignFirstResponderDelegate, "B@:"); } } } @@ -603,7 +618,7 @@ namespace Xwt.Mac return NSDragOperation.None; var backend = ob.Backend; - NSDraggingInfo di = (NSDraggingInfo) Runtime.GetNSObject (dragInfo); + INSDraggingInfo di = (INSDraggingInfo) Runtime.GetNSObject (dragInfo); var types = di.DraggingPasteboard.Types.Select (ToXwtDragType).ToArray (); var pos = new Point (di.DraggingLocation.X, di.DraggingLocation.Y); @@ -649,7 +664,7 @@ namespace Xwt.Mac var backend = ob.Backend; - NSDraggingInfo di = (NSDraggingInfo) Runtime.GetNSObject (dragInfo); + INSDraggingInfo di = (INSDraggingInfo) Runtime.GetNSObject (dragInfo); var types = di.DraggingPasteboard.Types.Select (ToXwtDragType).ToArray (); var pos = new Point (di.DraggingLocation.X, di.DraggingLocation.Y); @@ -672,7 +687,7 @@ namespace Xwt.Mac var backend = ob.Backend; - NSDraggingInfo di = (NSDraggingInfo) Runtime.GetNSObject (dragInfo); + INSDraggingInfo di = (INSDraggingInfo) Runtime.GetNSObject (dragInfo); var pos = new Point (di.DraggingLocation.X, di.DraggingLocation.Y); if ((backend.currentEvents & WidgetEvent.DragDrop) != 0) { @@ -692,14 +707,14 @@ namespace Xwt.Mac Console.WriteLine ("ConcludeDragOperation"); } - protected virtual void OnDragOverCheck (NSDraggingInfo di, DragOverCheckEventArgs args) + protected virtual void OnDragOverCheck (INSDraggingInfo di, DragOverCheckEventArgs args) { ApplicationContext.InvokeUserCode (delegate { eventSink.OnDragOverCheck (args); }); } - protected virtual void OnDragOver (NSDraggingInfo di, DragOverEventArgs args) + protected virtual void OnDragOver (INSDraggingInfo di, DragOverEventArgs args) { ApplicationContext.InvokeUserCode (delegate { eventSink.OnDragOver (args); diff --git a/Xwt.XamMac/Xwt.Mac/WindowBackend.cs b/Xwt.XamMac/Xwt.Mac/WindowBackend.cs index 2d874eb1..709b689c 100644 --- a/Xwt.XamMac/Xwt.Mac/WindowBackend.cs +++ b/Xwt.XamMac/Xwt.Mac/WindowBackend.cs @@ -567,7 +567,7 @@ namespace Xwt.Mac } } - public override bool ConformsToProtocol (IntPtr protocol) + public override bool ConformsToProtocol (NativeHandle protocol) { // HACK: for some reason on systems with a TouchBar this might be called // after the window has been closed and released, resulting in diff --git a/Xwt.XamMac/Xwt.Mac/WindowFrameBackend.cs b/Xwt.XamMac/Xwt.Mac/WindowFrameBackend.cs index 16c84b8a..d5bde8af 100644 --- a/Xwt.XamMac/Xwt.Mac/WindowFrameBackend.cs +++ b/Xwt.XamMac/Xwt.Mac/WindowFrameBackend.cs @@ -29,6 +29,7 @@ using System.Linq; using AppKit; using CoreGraphics; using Foundation; +using ObjCRuntime; using Xwt.Backends; namespace Xwt.Mac diff --git a/Xwt.XamMac/Xwt.XamMac.csproj b/Xwt.XamMac/Xwt.XamMac.csproj index 4857485e..c170efe0 100644 --- a/Xwt.XamMac/Xwt.XamMac.csproj +++ b/Xwt.XamMac/Xwt.XamMac.csproj @@ -1,5 +1,4 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> @@ -7,11 +6,19 @@ <OutputType>Library</OutputType> <RootNamespace>Xwt.Mac</RootNamespace> <AssemblyName>Xwt.XamMac</AssemblyName> - <ProductVersion>8.0.30703</ProductVersion> - <SchemaVersion>2.0</SchemaVersion> <SignAssembly>True</SignAssembly> <AssemblyOriginatorKeyFile>..\xwt.snk</AssemblyOriginatorKeyFile> - <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion> + <TargetFramework>$(MacTargetFramework)</TargetFramework> + <DisableImplicitNamespaceImports>True</DisableImplicitNamespaceImports> + + <SupportedOSPlatformVersion>10.14</SupportedOSPlatformVersion> + + <AssemblyTitle>Xwt.XamMac</AssemblyTitle> + <AssemblyDescription>Xamarin Mac Toolkit for the Xwt UI Framework</AssemblyDescription> + <Product>Xwt UI Framework</Product> + <Copyright>Microsoft, Inc (https://www.microsoft.com/)</Copyright> + <AssemblyVersion>0.1.0.0</AssemblyVersion> + <InformationalVersion>0.1.0.0-prerelease</InformationalVersion> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>True</DebugSymbols> @@ -22,7 +29,6 @@ <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> <AllowUnsafeBlocks>True</AllowUnsafeBlocks> - <LangVersion>6</LangVersion> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <DebugType>pdbonly</DebugType> @@ -32,9 +38,8 @@ <WarningLevel>4</WarningLevel> <AllowUnsafeBlocks>True</AllowUnsafeBlocks> <DebugSymbols>true</DebugSymbols> - <LangVersion>6</LangVersion> </PropertyGroup> - <PropertyGroup> + <PropertyGroup Condition="!$(Net6)"> <XamMacPath>\Library\Frameworks\Xamarin.Mac.framework\Versions\Current\lib\x86_64\full\Xamarin.Mac.dll</XamMacPath> <XamMacPath Condition="Exists('\Library\Frameworks\Xamarin.Mac.framework\Versions\Current\lib\64bits\full\Xamarin.Mac.dll')">\Library\Frameworks\Xamarin.Mac.framework\Versions\Current\lib\64bits\full\Xamarin.Mac.dll</XamMacPath> <XamMacPath Condition="Exists('$(MSBuildProgramFiles32)\Reference Assemblies\Microsoft\Framework\Xamarin.Mac\v2.0\Xamarin.Mac.dll')">$(MSBuildProgramFiles32)\Reference Assemblies\Microsoft\Framework\Xamarin.Mac\v2.0\Xamarin.Mac.dll</XamMacPath> @@ -47,112 +52,13 @@ <Reference Include="System.Core" /> <Reference Include="System.Xml.Linq" /> <Reference Include="System.Drawing" /> - <Reference Include="Xamarin.Mac"> + <Reference Include="Xamarin.Mac" Condition="!$(Net6)"> <HintPath>$(XamMacPath)</HintPath> </Reference> </ItemGroup> - <ItemGroup> - <Compile Include="AssemblyInfo.cs" /> - <Compile Include="Xwt.Mac\BoxBackend.cs" /> - <Compile Include="Xwt.Mac\ButtonBackend.cs" /> - <Compile Include="Xwt.Mac\LabelBackend.cs" /> - <Compile Include="Xwt.Mac\MacEngine.cs" /> - <Compile Include="Xwt.Mac\NotebookBackend.cs" /> - <Compile Include="Xwt.Mac\TreeViewBackend.cs" /> - <Compile Include="Xwt.Mac\Util.cs" /> - <Compile Include="Xwt.Mac\ViewBackend.cs" /> - <Compile Include="Xwt.Mac\WindowBackend.cs" /> - <Compile Include="Xwt.Mac.CellViews\CompositeCell.cs" /> - <Compile Include="Xwt.Mac.CellViews\ICellRenderer.cs" /> - <Compile Include="Xwt.Mac.CellViews\ICellSource.cs" /> - <Compile Include="Xwt.Mac.CellViews\TextTableCell.cs" /> - <Compile Include="Xwt.Mac.CellViews\CellUtil.cs" /> - <Compile Include="Xwt.Mac\ImageHandler.cs" /> - <Compile Include="Xwt.Mac.CellViews\ImageTableCell.cs" /> - <Compile Include="Xwt.Mac\ContextBackendHandler.cs" /> - <Compile Include="Xwt.Mac\CanvasBackend.cs" /> - <Compile Include="Xwt.Mac\GradientBackendHandler.cs" /> - <Compile Include="Xwt.Mac\TextLayoutBackendHandler.cs" /> - <Compile Include="Xwt.Mac\FontBackendHandler.cs" /> - <Compile Include="Xwt.Mac\ListViewBackend.cs" /> - <Compile Include="Xwt.Mac\TableViewBackend.cs" /> - <Compile Include="Xwt.Mac\MenuBackend.cs" /> - <Compile Include="Xwt.Mac\MenuItemBackend.cs" /> - <Compile Include="Xwt.Mac\ObjcHelper.cs" /> - <Compile Include="Xwt.Mac\IViewObject.cs" /> - <Compile Include="Xwt.Mac\ComboBoxBackend.cs" /> - <Compile Include="Xwt.Mac\TextEntryBackend.cs" /> - <Compile Include="Xwt.Mac\ImageViewBackend.cs" /> - <Compile Include="Xwt.Mac\CheckBoxMenuItemBackend.cs" /> - <Compile Include="Xwt.Mac\RadioButtonMenuItemBackend.cs" /> - <Compile Include="Xwt.Mac\SeparatorMenuItemBackend.cs" /> - <Compile Include="Xwt.Mac\CheckBoxBackend.cs" /> - <Compile Include="Xwt.Mac\ComboBoxEntryBackend.cs" /> - <Compile Include="Xwt.Mac\ImageBuilderBackendHandler.cs" /> - <Compile Include="Xwt.Mac\ImagePatternBackendHandler.cs" /> - <Compile Include="Xwt.Mac\FrameBackend.cs" /> - <Compile Include="Xwt.Mac\ToggleButtonBackend.cs" /> - <Compile Include="Xwt.Mac\ScrollViewBackend.cs" /> - <Compile Include="Xwt.Mac\SeparatorBackend.cs" /> - <Compile Include="Xwt.Mac\PanedBackend.cs" /> - <Compile Include="Xwt.Mac\ScrollAdjustmentBackend.cs" /> - <Compile Include="Xwt.Mac\AlertDialogBackend.cs" /> - <Compile Include="Xwt.Mac\StatusIconBackend.cs" /> - <Compile Include="Xwt.Mac\ProgressBarBackend.cs" /> - <Compile Include="Xwt.Mac\SpinButtonBackend.cs" /> - <Compile Include="Xwt.Mac\ExpanderBackend.cs" /> - <Compile Include="Xwt.Mac\SpinnerBackend.cs" /> - <Compile Include="Xwt.Mac\PopoverBackend.cs" /> - <Compile Include="Xwt.Mac\LinkLabelBackend.cs" /> - <Compile Include="Xwt.Mac\FileDialogBackend.cs" /> - <Compile Include="Xwt.Mac\SelectFolderDialogBackend.cs" /> - <Compile Include="Xwt.Mac\OpenFileDialogBackend.cs" /> - <Compile Include="Xwt.Mac\MacClipboardBackend.cs" /> - <Compile Include="Xwt.Mac\PathBackendHandler.cs" /> - <Compile Include="Xwt.Mac\CustomWidgetBackend.cs" /> - <Compile Include="Xwt.Mac\MacDesktopBackend.cs" /> - <Compile Include="Xwt.Mac\MenuButtonBackend.cs" /> - <Compile Include="Xwt.Mac.CellViews\CanvasTableCell.cs" /> - <Compile Include="Xwt.Mac\ListBoxBackend.cs" /> - <Compile Include="Xwt.Mac\DialogBackend.cs" /> - <Compile Include="Xwt.Mac\MacSystemInformation.cs" /> - <Compile Include="Xwt.Mac\RichTextViewBackend.cs" /> - <Compile Include="Xwt.Mac\RadioButtonBackend.cs" /> - <Compile Include="Xwt.Mac\ScrollbarBackend.cs" /> - <Compile Include="Xwt.Mac\DatePickerBackend.cs" /> - <Compile Include="Xwt.Mac\SliderBackend.cs" /> - <Compile Include="Xwt.Mac.CellViews\CheckBoxTableCell.cs" /> - <Compile Include="Xwt.Mac\EmbedNativeWidgetBackend.cs" /> - <Compile Include="Xwt.Mac\MacKeyboardHandler.cs" /> - <Compile Include="Xwt.Mac\PasswordEntryBackend.cs" /> - <Compile Include="Xwt.Mac\WebViewBackend.cs" /> - <Compile Include="Xwt.Mac\ScrollControlBackend.cs" /> - <Compile Include="Xwt.Mac.CellViews\CellViewBackend.cs" /> - <Compile Include="Xwt.Mac\WidgetView.cs" /> - <Compile Include="Xwt.Mac\NSTableViewBackend.cs" /> - <Compile Include="Xwt.Mac\Messaging.cs" /> - <Compile Include="Xwt.Mac\KeyboardUtil.cs" /> - <Compile Include="Xwt.Mac\SaveFileDialogBackend.cs" /> - <Compile Include="Xwt.Mac\ColorPickerBackend.cs" /> - <Compile Include="Xwt.Mac\OutlineViewBackend.cs" /> - <Compile Include="Xwt.Mac\CalendarBackend.cs" /> - <Compile Include="Xwt.Mac\SelectFontDialogBackend.cs" /> - <Compile Include="Xwt.Mac\NSApplicationInitializer.cs" /> - <Compile Include="Xwt.Mac.CellViews\RadioButtonTableCell.cs" /> - <Compile Include="Xwt.Mac\GtkQuartz.cs" /> - <Compile Include="Xwt.Mac\AccessibleBackend.cs" /> - <Compile Include="Xwt.Mac\PopupWindowBackend.cs" /> - <Compile Include="Xwt.Mac\SearchTextEntryBackend.cs" /> - <Compile Include="Xwt.Mac\WindowFrameBackend.cs" /> - <Compile Include="Xwt.Mac\AccessibleBackend.AccessibilityHelper.cs" /> - <Compile Include="Xwt.Mac\AccerssibilityHelper.cs" /> - </ItemGroup> <Import Project="..\BuildHelpers.targets" /> - <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <ItemGroup> <ProjectReference Include="..\Xwt\Xwt.csproj"> - <Project>{92494904-35FA-4DC9-BDE9-3A3E87AC49D3}</Project> - <Name>Xwt</Name> </ProjectReference> </ItemGroup> <ItemGroup> @@ -54,6 +54,7 @@ Global Mac-Debug|x86 = Mac-Debug|x86
Release|x86 = Release|x86
XamMac-Debug|Any CPU = XamMac-Debug|Any CPU
+ XamMac-Net6-Debug|Any CPU = XamMac-Net6-Debug|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0AF50CE4-E455-4A9D-92AD-711CBD068A55}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
@@ -66,6 +67,7 @@ Global {0AF50CE4-E455-4A9D-92AD-711CBD068A55}.Win-Debug|Any CPU.Build.0 = Debug|x86
{0AF50CE4-E455-4A9D-92AD-711CBD068A55}.XamMac-Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0AF50CE4-E455-4A9D-92AD-711CBD068A55}.XamMac-Debug|Any CPU.Build.0 = Debug|Any CPU
+ {0AF50CE4-E455-4A9D-92AD-711CBD068A55}.XamMac-Net6-Debug|Any CPU.ActiveCfg = Debug|Any CPU
{14CF6E75-0D08-4BBD-B0F5-742196E5656D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{14CF6E75-0D08-4BBD-B0F5-742196E5656D}.Mac-Debug|Any CPU.ActiveCfg = Debug|Any CPU
{14CF6E75-0D08-4BBD-B0F5-742196E5656D}.Mac-Debug|Any CPU.Build.0 = Debug|Any CPU
@@ -75,6 +77,7 @@ Global {14CF6E75-0D08-4BBD-B0F5-742196E5656D}.Win-Debug|x86.ActiveCfg = Debug|Any CPU
{14CF6E75-0D08-4BBD-B0F5-742196E5656D}.XamMac-Debug|Any CPU.ActiveCfg = Debug|Any CPU
{14CF6E75-0D08-4BBD-B0F5-742196E5656D}.XamMac-Debug|Any CPU.Build.0 = Debug|Any CPU
+ {14CF6E75-0D08-4BBD-B0F5-742196E5656D}.XamMac-Net6-Debug|Any CPU.ActiveCfg = Debug|Any CPU
{22524E1F-A94D-4204-AD90-A5FFE73970EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{22524E1F-A94D-4204-AD90-A5FFE73970EC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{22524E1F-A94D-4204-AD90-A5FFE73970EC}.Debug|x86.ActiveCfg = Debug|x86
@@ -93,6 +96,7 @@ Global {22524E1F-A94D-4204-AD90-A5FFE73970EC}.Win-Debug|Any CPU.ActiveCfg = Debug|x86
{22524E1F-A94D-4204-AD90-A5FFE73970EC}.Win-Debug|x86.ActiveCfg = Debug|x86
{22524E1F-A94D-4204-AD90-A5FFE73970EC}.XamMac-Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {22524E1F-A94D-4204-AD90-A5FFE73970EC}.XamMac-Net6-Debug|Any CPU.ActiveCfg = Debug|Any CPU
{252117CA-0ABB-4F36-BFC8-DE23A8089BB9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{252117CA-0ABB-4F36-BFC8-DE23A8089BB9}.Mac-Debug|Any CPU.ActiveCfg = Debug|Any CPU
{252117CA-0ABB-4F36-BFC8-DE23A8089BB9}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -100,6 +104,7 @@ Global {252117CA-0ABB-4F36-BFC8-DE23A8089BB9}.Win-Debug|Any CPU.ActiveCfg = Debug|Any CPU
{252117CA-0ABB-4F36-BFC8-DE23A8089BB9}.Win-Debug|Any CPU.Build.0 = Debug|Any CPU
{252117CA-0ABB-4F36-BFC8-DE23A8089BB9}.XamMac-Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {252117CA-0ABB-4F36-BFC8-DE23A8089BB9}.XamMac-Net6-Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2B7FF081-FE53-42F7-9D5D-D4B38E548F94}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2B7FF081-FE53-42F7-9D5D-D4B38E548F94}.Mac-Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2B7FF081-FE53-42F7-9D5D-D4B38E548F94}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -116,6 +121,7 @@ Global {2B7FF081-FE53-42F7-9D5D-D4B38E548F94}.Mac-Debug|x86.Build.0 = Debug|Any CPU
{2B7FF081-FE53-42F7-9D5D-D4B38E548F94}.Release|x86.ActiveCfg = Release|Any CPU
{2B7FF081-FE53-42F7-9D5D-D4B38E548F94}.Release|x86.Build.0 = Release|Any CPU
+ {2B7FF081-FE53-42F7-9D5D-D4B38E548F94}.XamMac-Net6-Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3B25FD1F-CEBA-4450-8893-DC330FDB56A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3B25FD1F-CEBA-4450-8893-DC330FDB56A7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3B25FD1F-CEBA-4450-8893-DC330FDB56A7}.Debug|x86.ActiveCfg = Debug|Any CPU
@@ -133,6 +139,7 @@ Global {3B25FD1F-CEBA-4450-8893-DC330FDB56A7}.Win-Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3B25FD1F-CEBA-4450-8893-DC330FDB56A7}.Win-Debug|x86.ActiveCfg = Debug|Any CPU
{3B25FD1F-CEBA-4450-8893-DC330FDB56A7}.XamMac-Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {3B25FD1F-CEBA-4450-8893-DC330FDB56A7}.XamMac-Net6-Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5CFB1ABA-0CD0-45B9-ABC5-8A32096C0687}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5CFB1ABA-0CD0-45B9-ABC5-8A32096C0687}.Mac-Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5CFB1ABA-0CD0-45B9-ABC5-8A32096C0687}.Mac-Debug|Any CPU.Build.0 = Debug|Any CPU
@@ -141,6 +148,7 @@ Global {5CFB1ABA-0CD0-45B9-ABC5-8A32096C0687}.Win-Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5CFB1ABA-0CD0-45B9-ABC5-8A32096C0687}.XamMac-Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5CFB1ABA-0CD0-45B9-ABC5-8A32096C0687}.XamMac-Debug|Any CPU.Build.0 = Debug|Any CPU
+ {5CFB1ABA-0CD0-45B9-ABC5-8A32096C0687}.XamMac-Net6-Debug|Any CPU.ActiveCfg = Debug|Any CPU
{88C04B85-B69B-47B4-AB9F-64F6DD4E0897}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{88C04B85-B69B-47B4-AB9F-64F6DD4E0897}.Debug|Any CPU.Build.0 = Debug|Any CPU
{88C04B85-B69B-47B4-AB9F-64F6DD4E0897}.Mac-Debug|Any CPU.ActiveCfg = Debug|Any CPU
@@ -151,6 +159,8 @@ Global {88C04B85-B69B-47B4-AB9F-64F6DD4E0897}.Win-Debug|Any CPU.Build.0 = Debug|Any CPU
{88C04B85-B69B-47B4-AB9F-64F6DD4E0897}.XamMac-Debug|Any CPU.ActiveCfg = Debug|Any CPU
{88C04B85-B69B-47B4-AB9F-64F6DD4E0897}.XamMac-Debug|Any CPU.Build.0 = Debug|Any CPU
+ {88C04B85-B69B-47B4-AB9F-64F6DD4E0897}.XamMac-Net6-Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {88C04B85-B69B-47B4-AB9F-64F6DD4E0897}.XamMac-Net6-Debug|Any CPU.Build.0 = Debug|Any CPU
{92494904-35FA-4DC9-BDE9-3A3E87AC49D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{92494904-35FA-4DC9-BDE9-3A3E87AC49D3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{92494904-35FA-4DC9-BDE9-3A3E87AC49D3}.Mac-Debug|Any CPU.ActiveCfg = Debug|Any CPU
@@ -161,6 +171,8 @@ Global {92494904-35FA-4DC9-BDE9-3A3E87AC49D3}.Win-Debug|Any CPU.Build.0 = Debug|Any CPU
{92494904-35FA-4DC9-BDE9-3A3E87AC49D3}.XamMac-Debug|Any CPU.ActiveCfg = Debug|Any CPU
{92494904-35FA-4DC9-BDE9-3A3E87AC49D3}.XamMac-Debug|Any CPU.Build.0 = Debug|Any CPU
+ {92494904-35FA-4DC9-BDE9-3A3E87AC49D3}.XamMac-Net6-Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {92494904-35FA-4DC9-BDE9-3A3E87AC49D3}.XamMac-Net6-Debug|Any CPU.Build.0 = Debug|Any CPU
{B7C1673E-5124-4BE5-8D21-EC8B12F85B6B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B7C1673E-5124-4BE5-8D21-EC8B12F85B6B}.Mac-Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B7C1673E-5124-4BE5-8D21-EC8B12F85B6B}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -176,6 +188,8 @@ Global {B7C1673E-5124-4BE5-8D21-EC8B12F85B6B}.Debug|x86.Build.0 = Debug|Any CPU
{B7C1673E-5124-4BE5-8D21-EC8B12F85B6B}.Release|x86.ActiveCfg = Release|Any CPU
{B7C1673E-5124-4BE5-8D21-EC8B12F85B6B}.Release|x86.Build.0 = Release|Any CPU
+ {B7C1673E-5124-4BE5-8D21-EC8B12F85B6B}.XamMac-Net6-Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {B7C1673E-5124-4BE5-8D21-EC8B12F85B6B}.XamMac-Net6-Debug|Any CPU.Build.0 = Debug|Any CPU
{BC764278-4141-483C-8643-2EA8C40373B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BC764278-4141-483C-8643-2EA8C40373B2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BC764278-4141-483C-8643-2EA8C40373B2}.Mac-Debug|Any CPU.ActiveCfg = Debug|Any CPU
@@ -186,6 +200,7 @@ Global {BC764278-4141-483C-8643-2EA8C40373B2}.Win-Debug|Any CPU.Build.0 = Debug|Any CPU
{BC764278-4141-483C-8643-2EA8C40373B2}.XamMac-Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BC764278-4141-483C-8643-2EA8C40373B2}.XamMac-Debug|Any CPU.Build.0 = Debug|Any CPU
+ {BC764278-4141-483C-8643-2EA8C40373B2}.XamMac-Net6-Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C13CB518-B840-4FE7-AF3D-8C517A2FAD1F}.Debug|Any CPU.ActiveCfg = Debug|x86
{C13CB518-B840-4FE7-AF3D-8C517A2FAD1F}.Mac-Debug|Any CPU.ActiveCfg = Debug|x86
{C13CB518-B840-4FE7-AF3D-8C517A2FAD1F}.Release|Any CPU.ActiveCfg = Release|x86
@@ -193,6 +208,7 @@ Global {C13CB518-B840-4FE7-AF3D-8C517A2FAD1F}.Win-Debug|Any CPU.ActiveCfg = Debug|x86
{C13CB518-B840-4FE7-AF3D-8C517A2FAD1F}.Win-Debug|Any CPU.Build.0 = Debug|x86
{C13CB518-B840-4FE7-AF3D-8C517A2FAD1F}.XamMac-Debug|Any CPU.ActiveCfg = Debug|x86
+ {C13CB518-B840-4FE7-AF3D-8C517A2FAD1F}.XamMac-Net6-Debug|Any CPU.ActiveCfg = Debug|x86
{C1DF0C90-0C4C-4AB5-A45C-A1805587A844}.Debug|Any CPU.ActiveCfg = Debug|x86
{C1DF0C90-0C4C-4AB5-A45C-A1805587A844}.Mac-Debug|Any CPU.ActiveCfg = Debug|x86
{C1DF0C90-0C4C-4AB5-A45C-A1805587A844}.Mac-Debug|Any CPU.Build.0 = Debug|x86
@@ -205,6 +221,7 @@ Global {C1DF0C90-0C4C-4AB5-A45C-A1805587A844}.Win-Debug|x86.ActiveCfg = Debug|x86
{C1DF0C90-0C4C-4AB5-A45C-A1805587A844}.Win-Debug|x86.Build.0 = Debug|x86
{C1DF0C90-0C4C-4AB5-A45C-A1805587A844}.XamMac-Debug|Any CPU.ActiveCfg = Debug|x86
+ {C1DF0C90-0C4C-4AB5-A45C-A1805587A844}.XamMac-Net6-Debug|Any CPU.ActiveCfg = Debug|x86
{C3887A93-B2BD-4097-8E2F-3A063EFF32FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C3887A93-B2BD-4097-8E2F-3A063EFF32FD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C3887A93-B2BD-4097-8E2F-3A063EFF32FD}.Debug|x86.ActiveCfg = Debug|Any CPU
@@ -225,6 +242,7 @@ Global {C3887A93-B2BD-4097-8E2F-3A063EFF32FD}.Win-Debug|Any CPU.Build.0 = Debug|Any CPU
{C3887A93-B2BD-4097-8E2F-3A063EFF32FD}.XamMac-Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C3887A93-B2BD-4097-8E2F-3A063EFF32FD}.XamMac-Debug|Any CPU.Build.0 = Debug|Any CPU
+ {C3887A93-B2BD-4097-8E2F-3A063EFF32FD}.XamMac-Net6-Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C93D746E-1586-4D4F-B411-BF5A966E6A08}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C93D746E-1586-4D4F-B411-BF5A966E6A08}.Mac-Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C93D746E-1586-4D4F-B411-BF5A966E6A08}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -232,6 +250,7 @@ Global {C93D746E-1586-4D4F-B411-BF5A966E6A08}.Win-Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C93D746E-1586-4D4F-B411-BF5A966E6A08}.Win-Debug|Any CPU.Build.0 = Debug|Any CPU
{C93D746E-1586-4D4F-B411-BF5A966E6A08}.XamMac-Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {C93D746E-1586-4D4F-B411-BF5A966E6A08}.XamMac-Net6-Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E41F4448-15C3-4E95-B310-FD333FDF5D2F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E41F4448-15C3-4E95-B310-FD333FDF5D2F}.Mac-Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E41F4448-15C3-4E95-B310-FD333FDF5D2F}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -239,6 +258,7 @@ Global {E41F4448-15C3-4E95-B310-FD333FDF5D2F}.Win-Debug|Any CPU.ActiveCfg = Debug|x86
{E41F4448-15C3-4E95-B310-FD333FDF5D2F}.Win-Debug|Any CPU.Build.0 = Debug|x86
{E41F4448-15C3-4E95-B310-FD333FDF5D2F}.XamMac-Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {E41F4448-15C3-4E95-B310-FD333FDF5D2F}.XamMac-Net6-Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E95833C9-90AA-4366-9262-0A1BED148249}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E95833C9-90AA-4366-9262-0A1BED148249}.Mac-Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E95833C9-90AA-4366-9262-0A1BED148249}.Mac-Debug|Any CPU.Build.0 = Debug|Any CPU
@@ -247,6 +267,7 @@ Global {E95833C9-90AA-4366-9262-0A1BED148249}.Win-Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E95833C9-90AA-4366-9262-0A1BED148249}.XamMac-Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E95833C9-90AA-4366-9262-0A1BED148249}.XamMac-Debug|Any CPU.Build.0 = Debug|Any CPU
+ {E95833C9-90AA-4366-9262-0A1BED148249}.XamMac-Net6-Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F0C03C12-F08A-4378-958D-86DD4CFE966F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F0C03C12-F08A-4378-958D-86DD4CFE966F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F0C03C12-F08A-4378-958D-86DD4CFE966F}.Mac-Debug|Any CPU.ActiveCfg = Debug|Any CPU
@@ -269,6 +290,7 @@ Global {F0C03C12-F08A-4378-958D-86DD4CFE966F}.Release|x86.Build.0 = Release|Any CPU
{F0C03C12-F08A-4378-958D-86DD4CFE966F}.XamMac-Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F0C03C12-F08A-4378-958D-86DD4CFE966F}.XamMac-Debug|Any CPU.Build.0 = Debug|Any CPU
+ {F0C03C12-F08A-4378-958D-86DD4CFE966F}.XamMac-Net6-Debug|Any CPU.ActiveCfg = Debug|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{BC764278-4141-483C-8643-2EA8C40373B2} = {164E1FED-7688-4AE9-B19B-012F8784F9DD}
diff --git a/Xwt/Xwt.csproj b/Xwt/Xwt.csproj index 6878696b..5744433b 100644 --- a/Xwt/Xwt.csproj +++ b/Xwt/Xwt.csproj @@ -1,12 +1,11 @@ <Project Sdk="Microsoft.NET.Sdk">
-
<PropertyGroup>
- <TargetFrameworks>netstandard2.0</TargetFrameworks>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\xwt.snk</AssemblyOriginatorKeyFile>
<RootNamespace>Xwt</RootNamespace>
<AssemblyName>Xwt</AssemblyName>
+ <DisableImplicitNamespaceImports>True</DisableImplicitNamespaceImports>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugType>full</DebugType>
diff --git a/Xwt/Xwt/Key.cs b/Xwt/Xwt/Key.cs index e0ff3124..1cceb120 100644 --- a/Xwt/Xwt/Key.cs +++ b/Xwt/Xwt/Key.cs @@ -143,7 +143,6 @@ namespace Xwt Find = 0xff68, Break = 0xff6b, NumLock = 0xff7f, - Equal = 0xffbd, ShiftLeft = 0xffe1, ShiftRight = 0xffe2, ControlLeft = 0xffe3, @@ -182,6 +181,7 @@ namespace Xwt Colon = 0x3a, Semicolon = 0x3b, Less = 0x3c, + Equal = 0x3d, Greater = 0x3e, Question = 0x3f, At = 0x40, |