diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5d4e7c83e7..742f4e3323 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,14 +9,14 @@ on: types: [ published ] env: - DotNetVersion: "6.0.100" + DotNetVersion: "6.0.202" BuildConfiguration: "Release" BuildParameters: "build/Build.proj /v:Minimal /consoleLoggerParameters:NoSummary /p:Configuration=Release /p:BuildVersion=${{ github.run_id }} /p:BuildBranch=${{ github.ref }}" jobs: build-windows: - runs-on: windows-2019 + runs-on: windows-2022 steps: - uses: actions/checkout@v2 @@ -45,14 +45,14 @@ jobs: with: name: test path: | - artifacts/test/${{ env.BuildConfiguration }}/**/* - !artifacts/test/${{ env.BuildConfiguration }}/**/*Mac64.* + artifacts/test/*/${{ env.BuildConfiguration }}/**/* + !artifacts/test/Eto.Test.Mac64/**/* - name: Upload sample artifacts uses: actions/upload-artifact@v2 with: name: samples - path: artifacts/samples/${{ env.BuildConfiguration }}/**/* + path: artifacts/samples/*/${{ env.BuildConfiguration }}/**/* - name: Upload log files if: ${{ failure() }} @@ -111,6 +111,7 @@ jobs: name: nuget path: | artifacts/nuget/${{ env.BuildConfiguration }}/Eto.Platform.XamMac2*.nupkg + artifacts/nuget/${{ env.BuildConfiguration }}/Eto.Platform.macOS*.nupkg artifacts/nuget/${{ env.BuildConfiguration }}/Eto.Platform.Gtk2*.nupkg - name: Upload test artifacts @@ -118,9 +119,9 @@ jobs: with: name: test path: | - artifacts/test/${{ env.BuildConfiguration }}/**/*XamMac2.* - artifacts/test/${{ env.BuildConfiguration }}/**/*Mac64.* - artifacts/test/${{ env.BuildConfiguration }}/**/*Gtk2.* + artifacts/test/Eto.Test.Mac64/${{ env.BuildConfiguration }}/**/Eto.Test.Mac64.dmg + artifacts/test/Eto.Test.XamMac2/${{ env.BuildConfiguration }}/**/Eto.Test.XamMac2.app + artifacts/test/Eto.Test.macOS/${{ env.BuildConfiguration }}/*/Eto.Test.macOS.app - name: Upload log files if: ${{ failure() }} diff --git a/.vscode/launch.json b/.vscode/launch.json index 7f5e7b004c..67f59d709a 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -6,7 +6,7 @@ "type": "coreclr", "request": "launch", "preLaunchTask": "build-mac64", - "program": "${workspaceFolder}/artifacts/test/${config:var.configuration}/net6.0/Eto.Test.Mac64.app/Contents/MacOS/Eto.Test.Mac64", + "program": "${workspaceFolder}/artifacts/test/Eto.Test.Mac64/${config:var.configuration}/net6.0/Eto.Test.Mac64.app/Contents/MacOS/Eto.Test.Mac64", // "targetArchitecture": "x86_64", // uncomment to test intel on M1 "args": [], "console": "internalConsole", @@ -19,7 +19,7 @@ "request": "launch", "preLaunchTask": "build-mac64", "program": ".", - "runtimeExecutable": "${workspaceFolder}/artifacts/test/${config:var.configuration}/net48/Eto.Test.Mac64.app/Contents/MacOS/Eto.Test.Mac64", + "runtimeExecutable": "${workspaceFolder}/artifacts/test/Eto.Test.Mac64/${config:var.configuration}/net48/Eto.Test.Mac64.app/Contents/MacOS/Eto.Test.Mac64", "passDebugOptionsViaEnvironmentVariable": true, "args": [], "console": "internalConsole", @@ -27,11 +27,11 @@ "justMyCode": false }, { - "name": "Eto.Test.XamMac2", + "name": "Eto.Test.macOS", "type": "coreclr", "request": "launch", - "preLaunchTask": "build-xammac2", - "program": "${workspaceFolder}/artifacts/test/${config:var.configuration}/net6.0-macos/Eto.Test.XamMac2.app/Contents/MacOS/Eto.Test.XamMac2", + "preLaunchTask": "build-macos", + "program": "${workspaceFolder}/artifacts/test/Eto.Test.macOS/${config:var.configuration}/net6.0-macos/Eto.Test.macOS.app/Contents/MacOS/Eto.Test.macOS", "args": [], "console": "internalConsole", "internalConsoleOptions": "openOnSessionStart", @@ -43,7 +43,7 @@ "request": "launch", "preLaunchTask": "build-xammac2", "program": ".", - "runtimeExecutable": "${workspaceFolder}/artifacts/test/${config:var.configuration}/net48/Eto.Test.XamMac2.app/Contents/MacOS/Eto.Test.XamMac2", + "runtimeExecutable": "${workspaceFolder}/artifacts/test/Eto.Test.XamMac2/${config:var.configuration}/net48/Eto.Test.XamMac2.app/Contents/MacOS/Eto.Test.XamMac2", "passDebugOptionsViaEnvironmentVariable": true, "args": [], "console": "internalConsole", @@ -55,7 +55,7 @@ "type": "coreclr", "request": "launch", "preLaunchTask": "build-gtk", - "program": "${workspaceFolder}/artifacts/test/${config:var.configuration}/net6.0/Eto.Test.Gtk.dll", + "program": "${workspaceFolder}/artifacts/test/Eto.Test.Gtk/${config:var.configuration}/net6.0/Eto.Test.Gtk.dll", "args": [], "osx": { "env": { @@ -72,7 +72,7 @@ "type": "mono", "request": "launch", "preLaunchTask": "build-gtk", - "program": "${workspaceFolder}/artifacts/test/${config:var.configuration}/net48/Eto.Test.Gtk.exe", + "program": "${workspaceFolder}/artifacts/test/Eto.Test.Gtk/${config:var.configuration}/net48/Eto.Test.Gtk.exe", "passDebugOptionsViaEnvironmentVariable": true, "args": [], "osx": { @@ -89,7 +89,7 @@ "type": "mono", "request": "launch", "preLaunchTask": "build-gtk2", - "program": "${workspaceFolder}/artifacts/test/${config:var.configuration}/net48/Eto.Test.Gtk2.exe", + "program": "${workspaceFolder}/artifacts/test/Eto.Test.Gtk2/${config:var.configuration}/net48/Eto.Test.Gtk2.exe", "passDebugOptionsViaEnvironmentVariable": true, "args": [], "console": "internalConsole", @@ -101,7 +101,7 @@ "type": "coreclr", "request": "launch", "preLaunchTask": "build-wpf", - "program": "${workspaceFolder}/artifacts/test/${config:var.configuration}/net6.0-windows/Eto.Test.Wpf.exe", + "program": "${workspaceFolder}/artifacts/test/Eto.Test.Wpf/${config:var.configuration}/net6.0-windows/Eto.Test.Wpf.exe", "targetArchitecture": "x86_64", "args": [], "console": "internalConsole", @@ -113,7 +113,7 @@ "type": "clr", "request": "launch", "preLaunchTask": "build-wpf", - "program": "${workspaceFolder}/artifacts/test/${config:var.configuration}/net48/Eto.Test.Wpf.exe", + "program": "${workspaceFolder}/artifacts/test/Eto.Test.Wpf/${config:var.configuration}/net48/Eto.Test.Wpf.exe", "args": [], "console": "internalConsole", "internalConsoleOptions": "openOnSessionStart", @@ -124,7 +124,7 @@ "type": "coreclr", "request": "launch", "preLaunchTask": "build-winforms", - "program": "${workspaceFolder}/artifacts/test/${config:var.configuration}/net6.0-windows/Eto.Test.WinForms.exe", + "program": "${workspaceFolder}/artifacts/test/Eto.Test.WinForms/${config:var.configuration}/net6.0-windows/Eto.Test.WinForms.exe", "args": [], "console": "internalConsole", "internalConsoleOptions": "openOnSessionStart", @@ -135,7 +135,7 @@ "type": "clr", "request": "launch", "preLaunchTask": "build-winforms", - "program": "${workspaceFolder}/artifacts/test/${config:var.configuration}/net48/Eto.Test.WinForms.exe", + "program": "${workspaceFolder}/artifacts/test/Eto.Test.WinForms/${config:var.configuration}/net48/Eto.Test.WinForms.exe", "args": [], "console": "internalConsole", "internalConsoleOptions": "openOnSessionStart", @@ -146,7 +146,7 @@ "type": "coreclr", "request": "launch", "preLaunchTask": "build-direct2d", - "program": "${workspaceFolder}/artifacts/test/${config:var.configuration}/net6.0-windows/Eto.Test.Direct2D.exe", + "program": "${workspaceFolder}/artifacts/test/Eto.Test.Direct2D/${config:var.configuration}/net6.0-windows/Eto.Test.Direct2D.exe", "args": [], "console": "internalConsole", "internalConsoleOptions": "openOnSessionStart", diff --git a/.vscode/tasks.json b/.vscode/tasks.json index af35f34ad2..83a5701650 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -3,7 +3,7 @@ "tasks": [ { "label": "build", - "command": "dotnet build ${config:var.buildProperties} /p:Configuration=${config:var.configuration} ${workspaceFolder}/build/Build.proj", + "command": "dotnet build ${config:var.buildProperties} /p:Configuration=${input:configuration} ${workspaceFolder}/build/Build.proj", "type": "shell", "problemMatcher": "$msCompile", "group": { @@ -88,6 +88,16 @@ "clear": true } }, + { + "label": "build-macos", + "command": "dotnet build ${config:var.buildProperties} /p:Configuration=${config:var.configuration} ${workspaceFolder}/test/Eto.Test.Mac/Eto.Test.macOS.csproj", + "type": "shell", + "group": "build", + "problemMatcher": "$msCompile", + "presentation": { + "clear": true + } + }, { "label": "build-xammac2", "command": "dotnet build ${config:var.buildProperties} /p:Configuration=${config:var.configuration} ${workspaceFolder}/test/Eto.Test.Mac/Eto.Test.XamMac2.csproj", @@ -177,6 +187,15 @@ "Yes" ] }, + { + "type": "pickString", + "id": "configuration", + "description": "Build Configuration", + "options": [ + "Debug", + "Release" + ] + }, { "type": "promptString", "id": "version", diff --git a/build/Build.proj b/build/Build.proj index 1d85d16ff5..71f8d9b8c3 100644 --- a/build/Build.proj +++ b/build/Build.proj @@ -268,10 +268,10 @@ - - - - + + + + diff --git a/lib/monomac b/lib/monomac index bf33732843..e574f586dc 160000 --- a/lib/monomac +++ b/lib/monomac @@ -1 +1 @@ -Subproject commit bf337328430b062ed0adc2010540fe3b72e2803f +Subproject commit e574f586dcce19cab2fb34e34d61c29bc42c5bdb diff --git a/samples/Directory.Build.props b/samples/Directory.Build.props index 923fe25e88..3887e5d85e 100644 --- a/samples/Directory.Build.props +++ b/samples/Directory.Build.props @@ -3,6 +3,6 @@ false - $(BasePath)artifacts\samples\ + $(BasePath)artifacts\samples\$(MSBuildProjectName)\ \ No newline at end of file diff --git a/samples/XamarinMac/EmbedEtoInXamarinMac/EmbedEtoInXamarinMac.csproj b/samples/XamarinMac/EmbedEtoInXamarinMac/EmbedEtoInXamarinMac.csproj index 0730dd4bf4..a00b99e943 100644 --- a/samples/XamarinMac/EmbedEtoInXamarinMac/EmbedEtoInXamarinMac.csproj +++ b/samples/XamarinMac/EmbedEtoInXamarinMac/EmbedEtoInXamarinMac.csproj @@ -3,7 +3,7 @@ True Exe - net48 + xamarinmac20 False False Mac Developer @@ -11,6 +11,7 @@ --nowarn:2006 --nowarn:5220 10.14 False + SdkOnly diff --git a/samples/XamarinMac/EmbedXamarinMacInEto/EmbedXamarinMacInEto.csproj b/samples/XamarinMac/EmbedXamarinMacInEto/EmbedXamarinMacInEto.csproj index cdd02c65d8..8469fab1fa 100644 --- a/samples/XamarinMac/EmbedXamarinMacInEto/EmbedXamarinMacInEto.csproj +++ b/samples/XamarinMac/EmbedXamarinMacInEto/EmbedXamarinMacInEto.csproj @@ -3,7 +3,7 @@ True Exe - net48 + xamarinmac20 False False Mac Developer @@ -11,6 +11,7 @@ --nowarn:2006 --nowarn:5220 10.14 False + SdkOnly diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 40c281af25..4a3bb4f4ed 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -2,6 +2,6 @@ - $(BasePath)artifacts\core\ + $(BasePath)artifacts\core\$(MSBuildProjectName)\ \ No newline at end of file diff --git a/src/Eto.Core.sln b/src/Eto.Core.sln index 8cf1d79fd5..70ff74d7f4 100644 --- a/src/Eto.Core.sln +++ b/src/Eto.Core.sln @@ -35,14 +35,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "monomac", "monomac", "{E77D EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "generator", "..\lib\monomac\src\generator.csproj", "{EE5D4296-DFD7-4D1B-B9F9-C43AD9ED4F6F}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Eto.macOS", "Eto.Mac\Eto.macOS.csproj", "{B3AB773A-BCF6-4679-AC13-E2879F61DF33}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Eto.Test.macOS", "..\test\Eto.Test.Mac\Eto.Test.macOS.csproj", "{8A002565-996A-45F9-8D74-89E8D272717F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - Release|x86 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -50,184 +50,72 @@ Global GlobalSection(ProjectConfigurationPlatforms) = postSolution {FE25EE53-3993-4463-AB8E-CCDCE5E3BDC2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {FE25EE53-3993-4463-AB8E-CCDCE5E3BDC2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FE25EE53-3993-4463-AB8E-CCDCE5E3BDC2}.Debug|x64.ActiveCfg = Debug|x64 - {FE25EE53-3993-4463-AB8E-CCDCE5E3BDC2}.Debug|x64.Build.0 = Debug|x64 - {FE25EE53-3993-4463-AB8E-CCDCE5E3BDC2}.Debug|x86.ActiveCfg = Debug|x86 - {FE25EE53-3993-4463-AB8E-CCDCE5E3BDC2}.Debug|x86.Build.0 = Debug|x86 {FE25EE53-3993-4463-AB8E-CCDCE5E3BDC2}.Release|Any CPU.ActiveCfg = Release|Any CPU {FE25EE53-3993-4463-AB8E-CCDCE5E3BDC2}.Release|Any CPU.Build.0 = Release|Any CPU - {FE25EE53-3993-4463-AB8E-CCDCE5E3BDC2}.Release|x64.ActiveCfg = Release|x64 - {FE25EE53-3993-4463-AB8E-CCDCE5E3BDC2}.Release|x64.Build.0 = Release|x64 - {FE25EE53-3993-4463-AB8E-CCDCE5E3BDC2}.Release|x86.ActiveCfg = Release|x86 - {FE25EE53-3993-4463-AB8E-CCDCE5E3BDC2}.Release|x86.Build.0 = Release|x86 {503A9238-E2D0-4849-8B62-4CEFB799A252}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {503A9238-E2D0-4849-8B62-4CEFB799A252}.Debug|Any CPU.Build.0 = Debug|Any CPU - {503A9238-E2D0-4849-8B62-4CEFB799A252}.Debug|x64.ActiveCfg = Debug|x64 - {503A9238-E2D0-4849-8B62-4CEFB799A252}.Debug|x64.Build.0 = Debug|x64 - {503A9238-E2D0-4849-8B62-4CEFB799A252}.Debug|x86.ActiveCfg = Debug|x86 - {503A9238-E2D0-4849-8B62-4CEFB799A252}.Debug|x86.Build.0 = Debug|x86 {503A9238-E2D0-4849-8B62-4CEFB799A252}.Release|Any CPU.ActiveCfg = Release|Any CPU {503A9238-E2D0-4849-8B62-4CEFB799A252}.Release|Any CPU.Build.0 = Release|Any CPU - {503A9238-E2D0-4849-8B62-4CEFB799A252}.Release|x64.ActiveCfg = Release|x64 - {503A9238-E2D0-4849-8B62-4CEFB799A252}.Release|x64.Build.0 = Release|x64 - {503A9238-E2D0-4849-8B62-4CEFB799A252}.Release|x86.ActiveCfg = Release|x86 - {503A9238-E2D0-4849-8B62-4CEFB799A252}.Release|x86.Build.0 = Release|x86 {5830F6AC-68BE-4444-9160-0739F36BD761}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {5830F6AC-68BE-4444-9160-0739F36BD761}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5830F6AC-68BE-4444-9160-0739F36BD761}.Debug|x64.ActiveCfg = Debug|x64 - {5830F6AC-68BE-4444-9160-0739F36BD761}.Debug|x64.Build.0 = Debug|x64 - {5830F6AC-68BE-4444-9160-0739F36BD761}.Debug|x86.ActiveCfg = Debug|x86 - {5830F6AC-68BE-4444-9160-0739F36BD761}.Debug|x86.Build.0 = Debug|x86 {5830F6AC-68BE-4444-9160-0739F36BD761}.Release|Any CPU.ActiveCfg = Release|Any CPU {5830F6AC-68BE-4444-9160-0739F36BD761}.Release|Any CPU.Build.0 = Release|Any CPU - {5830F6AC-68BE-4444-9160-0739F36BD761}.Release|x64.ActiveCfg = Release|x64 - {5830F6AC-68BE-4444-9160-0739F36BD761}.Release|x64.Build.0 = Release|x64 - {5830F6AC-68BE-4444-9160-0739F36BD761}.Release|x86.ActiveCfg = Release|x86 - {5830F6AC-68BE-4444-9160-0739F36BD761}.Release|x86.Build.0 = Release|x86 {509D49DE-8BDD-43D2-B5D9-EDD390FDA8F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {509D49DE-8BDD-43D2-B5D9-EDD390FDA8F3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {509D49DE-8BDD-43D2-B5D9-EDD390FDA8F3}.Debug|x64.ActiveCfg = Debug|x64 - {509D49DE-8BDD-43D2-B5D9-EDD390FDA8F3}.Debug|x64.Build.0 = Debug|x64 - {509D49DE-8BDD-43D2-B5D9-EDD390FDA8F3}.Debug|x86.ActiveCfg = Debug|x86 - {509D49DE-8BDD-43D2-B5D9-EDD390FDA8F3}.Debug|x86.Build.0 = Debug|x86 {509D49DE-8BDD-43D2-B5D9-EDD390FDA8F3}.Release|Any CPU.ActiveCfg = Release|Any CPU {509D49DE-8BDD-43D2-B5D9-EDD390FDA8F3}.Release|Any CPU.Build.0 = Release|Any CPU - {509D49DE-8BDD-43D2-B5D9-EDD390FDA8F3}.Release|x64.ActiveCfg = Release|x64 - {509D49DE-8BDD-43D2-B5D9-EDD390FDA8F3}.Release|x64.Build.0 = Release|x64 - {509D49DE-8BDD-43D2-B5D9-EDD390FDA8F3}.Release|x86.ActiveCfg = Release|x86 - {509D49DE-8BDD-43D2-B5D9-EDD390FDA8F3}.Release|x86.Build.0 = Release|x86 {0C792DAE-8855-44CF-87F9-CE7385E3F141}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0C792DAE-8855-44CF-87F9-CE7385E3F141}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0C792DAE-8855-44CF-87F9-CE7385E3F141}.Debug|x64.ActiveCfg = Debug|x64 - {0C792DAE-8855-44CF-87F9-CE7385E3F141}.Debug|x64.Build.0 = Debug|x64 - {0C792DAE-8855-44CF-87F9-CE7385E3F141}.Debug|x86.ActiveCfg = Debug|x86 - {0C792DAE-8855-44CF-87F9-CE7385E3F141}.Debug|x86.Build.0 = Debug|x86 {0C792DAE-8855-44CF-87F9-CE7385E3F141}.Release|Any CPU.ActiveCfg = Release|Any CPU {0C792DAE-8855-44CF-87F9-CE7385E3F141}.Release|Any CPU.Build.0 = Release|Any CPU - {0C792DAE-8855-44CF-87F9-CE7385E3F141}.Release|x64.ActiveCfg = Release|x64 - {0C792DAE-8855-44CF-87F9-CE7385E3F141}.Release|x64.Build.0 = Release|x64 - {0C792DAE-8855-44CF-87F9-CE7385E3F141}.Release|x86.ActiveCfg = Release|x86 - {0C792DAE-8855-44CF-87F9-CE7385E3F141}.Release|x86.Build.0 = Release|x86 {9122333E-56EF-4A18-BBC4-0100589EA49C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {9122333E-56EF-4A18-BBC4-0100589EA49C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9122333E-56EF-4A18-BBC4-0100589EA49C}.Debug|x64.ActiveCfg = Debug|x64 - {9122333E-56EF-4A18-BBC4-0100589EA49C}.Debug|x64.Build.0 = Debug|x64 - {9122333E-56EF-4A18-BBC4-0100589EA49C}.Debug|x86.ActiveCfg = Debug|x86 - {9122333E-56EF-4A18-BBC4-0100589EA49C}.Debug|x86.Build.0 = Debug|x86 {9122333E-56EF-4A18-BBC4-0100589EA49C}.Release|Any CPU.ActiveCfg = Release|Any CPU {9122333E-56EF-4A18-BBC4-0100589EA49C}.Release|Any CPU.Build.0 = Release|Any CPU - {9122333E-56EF-4A18-BBC4-0100589EA49C}.Release|x64.ActiveCfg = Release|x64 - {9122333E-56EF-4A18-BBC4-0100589EA49C}.Release|x64.Build.0 = Release|x64 - {9122333E-56EF-4A18-BBC4-0100589EA49C}.Release|x86.ActiveCfg = Release|x86 - {9122333E-56EF-4A18-BBC4-0100589EA49C}.Release|x86.Build.0 = Release|x86 {675E4CC9-41B2-45A6-925D-4E21DD23FAFB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {675E4CC9-41B2-45A6-925D-4E21DD23FAFB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {675E4CC9-41B2-45A6-925D-4E21DD23FAFB}.Debug|x64.ActiveCfg = Debug|Any CPU - {675E4CC9-41B2-45A6-925D-4E21DD23FAFB}.Debug|x64.Build.0 = Debug|Any CPU - {675E4CC9-41B2-45A6-925D-4E21DD23FAFB}.Debug|x86.ActiveCfg = Debug|Any CPU - {675E4CC9-41B2-45A6-925D-4E21DD23FAFB}.Debug|x86.Build.0 = Debug|Any CPU {675E4CC9-41B2-45A6-925D-4E21DD23FAFB}.Release|Any CPU.ActiveCfg = Release|Any CPU {675E4CC9-41B2-45A6-925D-4E21DD23FAFB}.Release|Any CPU.Build.0 = Release|Any CPU - {675E4CC9-41B2-45A6-925D-4E21DD23FAFB}.Release|x64.ActiveCfg = Release|Any CPU - {675E4CC9-41B2-45A6-925D-4E21DD23FAFB}.Release|x64.Build.0 = Release|Any CPU - {675E4CC9-41B2-45A6-925D-4E21DD23FAFB}.Release|x86.ActiveCfg = Release|Any CPU - {675E4CC9-41B2-45A6-925D-4E21DD23FAFB}.Release|x86.Build.0 = Release|Any CPU {BC4CAE43-F35A-47FD-9284-1D76502A4F2B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {BC4CAE43-F35A-47FD-9284-1D76502A4F2B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BC4CAE43-F35A-47FD-9284-1D76502A4F2B}.Debug|x64.ActiveCfg = Debug|Any CPU - {BC4CAE43-F35A-47FD-9284-1D76502A4F2B}.Debug|x64.Build.0 = Debug|Any CPU - {BC4CAE43-F35A-47FD-9284-1D76502A4F2B}.Debug|x86.ActiveCfg = Debug|Any CPU - {BC4CAE43-F35A-47FD-9284-1D76502A4F2B}.Debug|x86.Build.0 = Debug|Any CPU {BC4CAE43-F35A-47FD-9284-1D76502A4F2B}.Release|Any CPU.ActiveCfg = Release|Any CPU {BC4CAE43-F35A-47FD-9284-1D76502A4F2B}.Release|Any CPU.Build.0 = Release|Any CPU - {BC4CAE43-F35A-47FD-9284-1D76502A4F2B}.Release|x64.ActiveCfg = Release|Any CPU - {BC4CAE43-F35A-47FD-9284-1D76502A4F2B}.Release|x64.Build.0 = Release|Any CPU - {BC4CAE43-F35A-47FD-9284-1D76502A4F2B}.Release|x86.ActiveCfg = Release|Any CPU - {BC4CAE43-F35A-47FD-9284-1D76502A4F2B}.Release|x86.Build.0 = Release|Any CPU {4BF1720D-10C5-468E-A419-95EE76BF3C98}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4BF1720D-10C5-468E-A419-95EE76BF3C98}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4BF1720D-10C5-468E-A419-95EE76BF3C98}.Debug|x64.ActiveCfg = Debug|Any CPU - {4BF1720D-10C5-468E-A419-95EE76BF3C98}.Debug|x64.Build.0 = Debug|Any CPU - {4BF1720D-10C5-468E-A419-95EE76BF3C98}.Debug|x86.ActiveCfg = Debug|Any CPU - {4BF1720D-10C5-468E-A419-95EE76BF3C98}.Debug|x86.Build.0 = Debug|Any CPU {4BF1720D-10C5-468E-A419-95EE76BF3C98}.Release|Any CPU.ActiveCfg = Release|Any CPU {4BF1720D-10C5-468E-A419-95EE76BF3C98}.Release|Any CPU.Build.0 = Release|Any CPU - {4BF1720D-10C5-468E-A419-95EE76BF3C98}.Release|x64.ActiveCfg = Release|Any CPU - {4BF1720D-10C5-468E-A419-95EE76BF3C98}.Release|x64.Build.0 = Release|Any CPU - {4BF1720D-10C5-468E-A419-95EE76BF3C98}.Release|x86.ActiveCfg = Release|Any CPU - {4BF1720D-10C5-468E-A419-95EE76BF3C98}.Release|x86.Build.0 = Release|Any CPU {AE451719-9FDC-4C53-A34A-2788D564A1E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {AE451719-9FDC-4C53-A34A-2788D564A1E3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AE451719-9FDC-4C53-A34A-2788D564A1E3}.Debug|x64.ActiveCfg = Debug|Any CPU - {AE451719-9FDC-4C53-A34A-2788D564A1E3}.Debug|x64.Build.0 = Debug|Any CPU - {AE451719-9FDC-4C53-A34A-2788D564A1E3}.Debug|x86.ActiveCfg = Debug|Any CPU - {AE451719-9FDC-4C53-A34A-2788D564A1E3}.Debug|x86.Build.0 = Debug|Any CPU {AE451719-9FDC-4C53-A34A-2788D564A1E3}.Release|Any CPU.ActiveCfg = Release|Any CPU {AE451719-9FDC-4C53-A34A-2788D564A1E3}.Release|Any CPU.Build.0 = Release|Any CPU - {AE451719-9FDC-4C53-A34A-2788D564A1E3}.Release|x64.ActiveCfg = Release|Any CPU - {AE451719-9FDC-4C53-A34A-2788D564A1E3}.Release|x64.Build.0 = Release|Any CPU - {AE451719-9FDC-4C53-A34A-2788D564A1E3}.Release|x86.ActiveCfg = Release|Any CPU - {AE451719-9FDC-4C53-A34A-2788D564A1E3}.Release|x86.Build.0 = Release|Any CPU {0B436044-9251-4922-BC41-51365EBBD771}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0B436044-9251-4922-BC41-51365EBBD771}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0B436044-9251-4922-BC41-51365EBBD771}.Debug|x64.ActiveCfg = Debug|Any CPU - {0B436044-9251-4922-BC41-51365EBBD771}.Debug|x64.Build.0 = Debug|Any CPU - {0B436044-9251-4922-BC41-51365EBBD771}.Debug|x86.ActiveCfg = Debug|Any CPU - {0B436044-9251-4922-BC41-51365EBBD771}.Debug|x86.Build.0 = Debug|Any CPU {0B436044-9251-4922-BC41-51365EBBD771}.Release|Any CPU.ActiveCfg = Release|Any CPU {0B436044-9251-4922-BC41-51365EBBD771}.Release|Any CPU.Build.0 = Release|Any CPU - {0B436044-9251-4922-BC41-51365EBBD771}.Release|x64.ActiveCfg = Release|Any CPU - {0B436044-9251-4922-BC41-51365EBBD771}.Release|x64.Build.0 = Release|Any CPU - {0B436044-9251-4922-BC41-51365EBBD771}.Release|x86.ActiveCfg = Release|Any CPU - {0B436044-9251-4922-BC41-51365EBBD771}.Release|x86.Build.0 = Release|Any CPU {FD8900C4-1EB6-4D8A-A91C-32047D27A430}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {FD8900C4-1EB6-4D8A-A91C-32047D27A430}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FD8900C4-1EB6-4D8A-A91C-32047D27A430}.Debug|x64.ActiveCfg = Debug|Any CPU - {FD8900C4-1EB6-4D8A-A91C-32047D27A430}.Debug|x64.Build.0 = Debug|Any CPU - {FD8900C4-1EB6-4D8A-A91C-32047D27A430}.Debug|x86.ActiveCfg = Debug|Any CPU - {FD8900C4-1EB6-4D8A-A91C-32047D27A430}.Debug|x86.Build.0 = Debug|Any CPU {FD8900C4-1EB6-4D8A-A91C-32047D27A430}.Release|Any CPU.ActiveCfg = Release|Any CPU {FD8900C4-1EB6-4D8A-A91C-32047D27A430}.Release|Any CPU.Build.0 = Release|Any CPU - {FD8900C4-1EB6-4D8A-A91C-32047D27A430}.Release|x64.ActiveCfg = Release|Any CPU - {FD8900C4-1EB6-4D8A-A91C-32047D27A430}.Release|x64.Build.0 = Release|Any CPU - {FD8900C4-1EB6-4D8A-A91C-32047D27A430}.Release|x86.ActiveCfg = Release|Any CPU - {FD8900C4-1EB6-4D8A-A91C-32047D27A430}.Release|x86.Build.0 = Release|Any CPU {9114D372-999B-4894-9460-8A0FF02131E1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {9114D372-999B-4894-9460-8A0FF02131E1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9114D372-999B-4894-9460-8A0FF02131E1}.Debug|x64.ActiveCfg = Debug|Any CPU - {9114D372-999B-4894-9460-8A0FF02131E1}.Debug|x64.Build.0 = Debug|Any CPU - {9114D372-999B-4894-9460-8A0FF02131E1}.Debug|x86.ActiveCfg = Debug|Any CPU - {9114D372-999B-4894-9460-8A0FF02131E1}.Debug|x86.Build.0 = Debug|Any CPU {9114D372-999B-4894-9460-8A0FF02131E1}.Release|Any CPU.ActiveCfg = Release|Any CPU {9114D372-999B-4894-9460-8A0FF02131E1}.Release|Any CPU.Build.0 = Release|Any CPU - {9114D372-999B-4894-9460-8A0FF02131E1}.Release|x64.ActiveCfg = Release|Any CPU - {9114D372-999B-4894-9460-8A0FF02131E1}.Release|x64.Build.0 = Release|Any CPU - {9114D372-999B-4894-9460-8A0FF02131E1}.Release|x86.ActiveCfg = Release|Any CPU - {9114D372-999B-4894-9460-8A0FF02131E1}.Release|x86.Build.0 = Release|Any CPU {549BAAA1-9355-41D7-9755-BF30CB92E4FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {549BAAA1-9355-41D7-9755-BF30CB92E4FA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {549BAAA1-9355-41D7-9755-BF30CB92E4FA}.Debug|x64.ActiveCfg = Debug|Any CPU - {549BAAA1-9355-41D7-9755-BF30CB92E4FA}.Debug|x64.Build.0 = Debug|Any CPU - {549BAAA1-9355-41D7-9755-BF30CB92E4FA}.Debug|x86.ActiveCfg = Debug|Any CPU - {549BAAA1-9355-41D7-9755-BF30CB92E4FA}.Debug|x86.Build.0 = Debug|Any CPU {549BAAA1-9355-41D7-9755-BF30CB92E4FA}.Release|Any CPU.ActiveCfg = Release|Any CPU {549BAAA1-9355-41D7-9755-BF30CB92E4FA}.Release|Any CPU.Build.0 = Release|Any CPU - {549BAAA1-9355-41D7-9755-BF30CB92E4FA}.Release|x64.ActiveCfg = Release|Any CPU - {549BAAA1-9355-41D7-9755-BF30CB92E4FA}.Release|x64.Build.0 = Release|Any CPU - {549BAAA1-9355-41D7-9755-BF30CB92E4FA}.Release|x86.ActiveCfg = Release|Any CPU - {549BAAA1-9355-41D7-9755-BF30CB92E4FA}.Release|x86.Build.0 = Release|Any CPU {EE5D4296-DFD7-4D1B-B9F9-C43AD9ED4F6F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {EE5D4296-DFD7-4D1B-B9F9-C43AD9ED4F6F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EE5D4296-DFD7-4D1B-B9F9-C43AD9ED4F6F}.Debug|x64.ActiveCfg = Debug|Any CPU - {EE5D4296-DFD7-4D1B-B9F9-C43AD9ED4F6F}.Debug|x64.Build.0 = Debug|Any CPU - {EE5D4296-DFD7-4D1B-B9F9-C43AD9ED4F6F}.Debug|x86.ActiveCfg = Debug|Any CPU - {EE5D4296-DFD7-4D1B-B9F9-C43AD9ED4F6F}.Debug|x86.Build.0 = Debug|Any CPU {EE5D4296-DFD7-4D1B-B9F9-C43AD9ED4F6F}.Release|Any CPU.ActiveCfg = Release|Any CPU {EE5D4296-DFD7-4D1B-B9F9-C43AD9ED4F6F}.Release|Any CPU.Build.0 = Release|Any CPU - {EE5D4296-DFD7-4D1B-B9F9-C43AD9ED4F6F}.Release|x64.ActiveCfg = Release|Any CPU - {EE5D4296-DFD7-4D1B-B9F9-C43AD9ED4F6F}.Release|x64.Build.0 = Release|Any CPU - {EE5D4296-DFD7-4D1B-B9F9-C43AD9ED4F6F}.Release|x86.ActiveCfg = Release|Any CPU - {EE5D4296-DFD7-4D1B-B9F9-C43AD9ED4F6F}.Release|x86.Build.0 = Release|Any CPU + {B3AB773A-BCF6-4679-AC13-E2879F61DF33}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B3AB773A-BCF6-4679-AC13-E2879F61DF33}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B3AB773A-BCF6-4679-AC13-E2879F61DF33}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B3AB773A-BCF6-4679-AC13-E2879F61DF33}.Release|Any CPU.Build.0 = Release|Any CPU + {8A002565-996A-45F9-8D74-89E8D272717F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8A002565-996A-45F9-8D74-89E8D272717F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8A002565-996A-45F9-8D74-89E8D272717F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8A002565-996A-45F9-8D74-89E8D272717F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(NestedProjects) = preSolution {EE5D4296-DFD7-4D1B-B9F9-C43AD9ED4F6F} = {E77D6350-0CCF-11EB-A5F5-69BE9D4F31C9} diff --git a/src/Eto.Forms.Templates/content/App-CSharp/.template.config/template.json b/src/Eto.Forms.Templates/content/App-CSharp/.template.config/template.json index f4114c5793..51684cb5fb 100755 --- a/src/Eto.Forms.Templates/content/App-CSharp/.template.config/template.json +++ b/src/Eto.Forms.Templates/content/App-CSharp/.template.config/template.json @@ -72,8 +72,8 @@ "type": "parameter", "description": "Specify the framework(s) to support", "dataType": "choice", - "defaultValue": "net5.0", - "replaces": "net5.0", + "defaultValue": "net6.0", + "replaces": "net6.0", "choices": [ { "choice": "net6.0", diff --git a/src/Eto.Forms.Templates/content/App-CSharp/EtoApp.1/EtoApp.1.csproj b/src/Eto.Forms.Templates/content/App-CSharp/EtoApp.1/EtoApp.1.csproj index e099d73833..c85529d1ae 100755 --- a/src/Eto.Forms.Templates/content/App-CSharp/EtoApp.1/EtoApp.1.csproj +++ b/src/Eto.Forms.Templates/content/App-CSharp/EtoApp.1/EtoApp.1.csproj @@ -8,7 +8,7 @@ --> - net5.0 + net6.0 TargetFrameworkOverride EtoApp._1 diff --git a/src/Eto.Forms.Templates/content/App-CSharp/Separate/EtoApp.1.Gtk/EtoApp.1.Gtk.csproj b/src/Eto.Forms.Templates/content/App-CSharp/Separate/EtoApp.1.Gtk/EtoApp.1.Gtk.csproj index 7a935b314f..0685f0a313 100755 --- a/src/Eto.Forms.Templates/content/App-CSharp/Separate/EtoApp.1.Gtk/EtoApp.1.Gtk.csproj +++ b/src/Eto.Forms.Templates/content/App-CSharp/Separate/EtoApp.1.Gtk/EtoApp.1.Gtk.csproj @@ -2,7 +2,7 @@ WinExe - net5.0 + net6.0 TargetFrameworkOverride EtoApp._1.Gtk diff --git a/src/Eto.Forms.Templates/content/App-CSharp/Separate/EtoApp.1.Mac/EtoApp.1.Mac.csproj b/src/Eto.Forms.Templates/content/App-CSharp/Separate/EtoApp.1.Mac/EtoApp.1.Mac.csproj index b1ce9b6da1..9ec19a21d6 100755 --- a/src/Eto.Forms.Templates/content/App-CSharp/Separate/EtoApp.1.Mac/EtoApp.1.Mac.csproj +++ b/src/Eto.Forms.Templates/content/App-CSharp/Separate/EtoApp.1.Mac/EtoApp.1.Mac.csproj @@ -2,11 +2,11 @@ Exe - net5.0 + net6.0 TargetFrameworkOverride EtoApp._1.Mac - osx-x64 + osx-x64;osx-arm64 diff --git a/src/Eto.Forms.Templates/content/App-CSharp/Separate/EtoApp.1.WinForms/EtoApp.1.WinForms.csproj b/src/Eto.Forms.Templates/content/App-CSharp/Separate/EtoApp.1.WinForms/EtoApp.1.WinForms.csproj index 8019b36fc9..dd781a37b2 100755 --- a/src/Eto.Forms.Templates/content/App-CSharp/Separate/EtoApp.1.WinForms/EtoApp.1.WinForms.csproj +++ b/src/Eto.Forms.Templates/content/App-CSharp/Separate/EtoApp.1.WinForms/EtoApp.1.WinForms.csproj @@ -2,8 +2,8 @@ WinExe - net5.0-windows - net5.0 + net6.0-windows + net6.0 TargetFrameworkOverride-windows TargetFrameworkOverride EtoApp._1.WinForms diff --git a/src/Eto.Forms.Templates/content/App-CSharp/Separate/EtoApp.1.Wpf/EtoApp.1.Wpf.csproj b/src/Eto.Forms.Templates/content/App-CSharp/Separate/EtoApp.1.Wpf/EtoApp.1.Wpf.csproj index 8bbca56e09..d6a3d7467d 100755 --- a/src/Eto.Forms.Templates/content/App-CSharp/Separate/EtoApp.1.Wpf/EtoApp.1.Wpf.csproj +++ b/src/Eto.Forms.Templates/content/App-CSharp/Separate/EtoApp.1.Wpf/EtoApp.1.Wpf.csproj @@ -2,8 +2,8 @@ WinExe - net5.0-windows - net5.0 + net6.0-windows + net6.0 TargetFrameworkOverride-windows TargetFrameworkOverride EtoApp._1.Wpf diff --git a/src/Eto.Forms.Templates/content/App-FSharp/.template.config/template.json b/src/Eto.Forms.Templates/content/App-FSharp/.template.config/template.json index b30e4c481e..6b0450e207 100755 --- a/src/Eto.Forms.Templates/content/App-FSharp/.template.config/template.json +++ b/src/Eto.Forms.Templates/content/App-FSharp/.template.config/template.json @@ -72,8 +72,8 @@ "type": "parameter", "description": "Specify the framework(s) to support", "dataType": "choice", - "defaultValue": "net5.0", - "replaces": "net5.0", + "defaultValue": "net6.0", + "replaces": "net6.0", "choices": [ { "choice": "net6.0", diff --git a/src/Eto.Forms.Templates/content/App-FSharp/EtoApp.1/EtoApp.1.fsproj b/src/Eto.Forms.Templates/content/App-FSharp/EtoApp.1/EtoApp.1.fsproj index 52fe1cdd9d..f37f14dfa4 100644 --- a/src/Eto.Forms.Templates/content/App-FSharp/EtoApp.1/EtoApp.1.fsproj +++ b/src/Eto.Forms.Templates/content/App-FSharp/EtoApp.1/EtoApp.1.fsproj @@ -8,7 +8,7 @@ --> - net5.0 + net6.0 TargetFrameworkOverride EtoApp._1 diff --git a/src/Eto.Forms.Templates/content/App-FSharp/Separate/EtoApp.1.Gtk/EtoApp.1.Gtk.fsproj b/src/Eto.Forms.Templates/content/App-FSharp/Separate/EtoApp.1.Gtk/EtoApp.1.Gtk.fsproj index 3ebc633f87..71c3c80257 100755 --- a/src/Eto.Forms.Templates/content/App-FSharp/Separate/EtoApp.1.Gtk/EtoApp.1.Gtk.fsproj +++ b/src/Eto.Forms.Templates/content/App-FSharp/Separate/EtoApp.1.Gtk/EtoApp.1.Gtk.fsproj @@ -2,7 +2,7 @@ WinExe - net5.0 + net6.0 TargetFrameworkOverride EtoApp._1.Gtk diff --git a/src/Eto.Forms.Templates/content/App-FSharp/Separate/EtoApp.1.Mac/EtoApp.1.Mac.fsproj b/src/Eto.Forms.Templates/content/App-FSharp/Separate/EtoApp.1.Mac/EtoApp.1.Mac.fsproj index 05fc4e04cd..41af683a6c 100755 --- a/src/Eto.Forms.Templates/content/App-FSharp/Separate/EtoApp.1.Mac/EtoApp.1.Mac.fsproj +++ b/src/Eto.Forms.Templates/content/App-FSharp/Separate/EtoApp.1.Mac/EtoApp.1.Mac.fsproj @@ -2,11 +2,11 @@ Exe - net5.0 + net6.0 TargetFrameworkOverride EtoApp._1.Mac - osx-x64 + osx-x64;osx-arm64 diff --git a/src/Eto.Forms.Templates/content/App-FSharp/Separate/EtoApp.1.WinForms/EtoApp.1.WinForms.fsproj b/src/Eto.Forms.Templates/content/App-FSharp/Separate/EtoApp.1.WinForms/EtoApp.1.WinForms.fsproj index f88dd75037..ba89bc69f6 100755 --- a/src/Eto.Forms.Templates/content/App-FSharp/Separate/EtoApp.1.WinForms/EtoApp.1.WinForms.fsproj +++ b/src/Eto.Forms.Templates/content/App-FSharp/Separate/EtoApp.1.WinForms/EtoApp.1.WinForms.fsproj @@ -2,8 +2,8 @@ WinExe - net5.0-windows - net5.0 + net6.0-windows + net6.0 TargetFrameworkOverride-windows TargetFrameworkOverride EtoApp._1.WinForms diff --git a/src/Eto.Forms.Templates/content/App-FSharp/Separate/EtoApp.1.Wpf/EtoApp.1.Wpf.fsproj b/src/Eto.Forms.Templates/content/App-FSharp/Separate/EtoApp.1.Wpf/EtoApp.1.Wpf.fsproj index 48a21fc48b..d90de0e87e 100755 --- a/src/Eto.Forms.Templates/content/App-FSharp/Separate/EtoApp.1.Wpf/EtoApp.1.Wpf.fsproj +++ b/src/Eto.Forms.Templates/content/App-FSharp/Separate/EtoApp.1.Wpf/EtoApp.1.Wpf.fsproj @@ -2,8 +2,8 @@ WinExe - net5.0-windows - net5.0 + net6.0-windows + net6.0 TargetFrameworkOverride-windows TargetFrameworkOverride EtoApp._1.Wpf diff --git a/src/Eto.Forms.Templates/content/App-VisualBasic/.template.config/template.json b/src/Eto.Forms.Templates/content/App-VisualBasic/.template.config/template.json index 5ab15ac0a8..bdabaae422 100755 --- a/src/Eto.Forms.Templates/content/App-VisualBasic/.template.config/template.json +++ b/src/Eto.Forms.Templates/content/App-VisualBasic/.template.config/template.json @@ -72,8 +72,8 @@ "type": "parameter", "description": "Specify the framework(s) to support", "dataType": "choice", - "defaultValue": "net5.0", - "replaces": "net5.0", + "defaultValue": "net6.0", + "replaces": "net6.0", "choices": [ { "choice": "net6.0", diff --git a/src/Eto.Forms.Templates/content/App-VisualBasic/EtoApp.1/EtoApp.1.vbproj b/src/Eto.Forms.Templates/content/App-VisualBasic/EtoApp.1/EtoApp.1.vbproj index e099d73833..c85529d1ae 100755 --- a/src/Eto.Forms.Templates/content/App-VisualBasic/EtoApp.1/EtoApp.1.vbproj +++ b/src/Eto.Forms.Templates/content/App-VisualBasic/EtoApp.1/EtoApp.1.vbproj @@ -8,7 +8,7 @@ --> - net5.0 + net6.0 TargetFrameworkOverride EtoApp._1 diff --git a/src/Eto.Forms.Templates/content/App-VisualBasic/Separate/EtoApp.1.Gtk/EtoApp.1.Gtk.vbproj b/src/Eto.Forms.Templates/content/App-VisualBasic/Separate/EtoApp.1.Gtk/EtoApp.1.Gtk.vbproj index ae95f72301..5dd39124ae 100755 --- a/src/Eto.Forms.Templates/content/App-VisualBasic/Separate/EtoApp.1.Gtk/EtoApp.1.Gtk.vbproj +++ b/src/Eto.Forms.Templates/content/App-VisualBasic/Separate/EtoApp.1.Gtk/EtoApp.1.Gtk.vbproj @@ -2,7 +2,7 @@ WinExe - net5.0 + net6.0 TargetFrameworkOverride EtoApp._1 diff --git a/src/Eto.Forms.Templates/content/App-VisualBasic/Separate/EtoApp.1.Mac/EtoApp.1.Mac.vbproj b/src/Eto.Forms.Templates/content/App-VisualBasic/Separate/EtoApp.1.Mac/EtoApp.1.Mac.vbproj index 7a42b579e2..7641e652ac 100755 --- a/src/Eto.Forms.Templates/content/App-VisualBasic/Separate/EtoApp.1.Mac/EtoApp.1.Mac.vbproj +++ b/src/Eto.Forms.Templates/content/App-VisualBasic/Separate/EtoApp.1.Mac/EtoApp.1.Mac.vbproj @@ -2,11 +2,11 @@ Exe - net5.0 + net6.0 TargetFrameworkOverride EtoApp._1 - osx-x64 + osx-x64;osx-arm64 diff --git a/src/Eto.Forms.Templates/content/App-VisualBasic/Separate/EtoApp.1.WinForms/EtoApp.1.WinForms.vbproj b/src/Eto.Forms.Templates/content/App-VisualBasic/Separate/EtoApp.1.WinForms/EtoApp.1.WinForms.vbproj index a4fde130e5..6c228c7db0 100755 --- a/src/Eto.Forms.Templates/content/App-VisualBasic/Separate/EtoApp.1.WinForms/EtoApp.1.WinForms.vbproj +++ b/src/Eto.Forms.Templates/content/App-VisualBasic/Separate/EtoApp.1.WinForms/EtoApp.1.WinForms.vbproj @@ -2,8 +2,8 @@ WinExe - net5.0-windows - net5.0 + net6.0-windows + net6.0 TargetFrameworkOverride-windows TargetFrameworkOverride EtoApp._1 diff --git a/src/Eto.Forms.Templates/content/App-VisualBasic/Separate/EtoApp.1.Wpf/EtoApp.1.Wpf.vbproj b/src/Eto.Forms.Templates/content/App-VisualBasic/Separate/EtoApp.1.Wpf/EtoApp.1.Wpf.vbproj index d6d5f45baa..fb77367d3f 100755 --- a/src/Eto.Forms.Templates/content/App-VisualBasic/Separate/EtoApp.1.Wpf/EtoApp.1.Wpf.vbproj +++ b/src/Eto.Forms.Templates/content/App-VisualBasic/Separate/EtoApp.1.Wpf/EtoApp.1.Wpf.vbproj @@ -2,8 +2,8 @@ WinExe - net5.0-windows - net5.0 + net6.0-windows + net6.0 TargetFrameworkOverride-windows TargetFrameworkOverride EtoApp._1 diff --git a/src/Eto.Mac/AppDelegate.cs b/src/Eto.Mac/AppDelegate.cs index f9eaca5d85..bc595f5b37 100644 --- a/src/Eto.Mac/AppDelegate.cs +++ b/src/Eto.Mac/AppDelegate.cs @@ -2,35 +2,7 @@ using System.ComponentModel; using Eto.Mac.Forms; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif + namespace Eto.Mac { diff --git a/src/Eto.Mac/AsyncQueue.cs b/src/Eto.Mac/AsyncQueue.cs index 30336a47a5..73b13e5b90 100644 --- a/src/Eto.Mac/AsyncQueue.cs +++ b/src/Eto.Mac/AsyncQueue.cs @@ -2,12 +2,6 @@ using System.Collections.Generic; using Eto.Forms; using Eto.Mac.Forms; -#if XAMMAC2 -using AppKit; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -#endif namespace Eto.Mac { @@ -64,11 +58,7 @@ public static void Add(IQueueAction action) if (_actionQueue.Count == 1) { // first one added, schedule a layout! -#if XAMMAC1 - NSApplication.SharedApplication.BeginInvokeOnMainThread(new NSAction(FlushQueue)); -#else NSApplication.SharedApplication.BeginInvokeOnMainThread(FlushQueue); -#endif } } diff --git a/src/Eto.Mac/CGConversions.cs b/src/Eto.Mac/CGConversions.cs index 5993a0014f..851cd34063 100644 --- a/src/Eto.Mac/CGConversions.cs +++ b/src/Eto.Mac/CGConversions.cs @@ -1,34 +1,6 @@ using System; using Eto.Drawing; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#elif OSX -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif - #if OSX using Eto.Mac.Drawing; diff --git a/src/Eto.Mac/ColorizeView.cs b/src/Eto.Mac/ColorizeView.cs index 5e953874be..c8a179c88e 100644 --- a/src/Eto.Mac/ColorizeView.cs +++ b/src/Eto.Mac/ColorizeView.cs @@ -1,33 +1,5 @@ using System; using Eto.Drawing; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreImage; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif namespace Eto.Mac { @@ -84,17 +56,15 @@ public void End() var cgImage = _image.CGImage; var ciImage = CIImage.FromCGImage(cgImage); -#pragma warning disable CS0618 // Image => InputImage in Xamarin.Mac 6.6 var filter2 = new CIColorControls(); filter2.SetDefaults(); - filter2.Image = ciImage; + filter2.InputImage = ciImage; filter2.Saturation = 0.0f; ciImage = (CIImage)filter2.ValueForKey(CIOutputImage); var filter3 = new CIColorMatrix(); filter3.SetDefaults(); - filter3.Image = ciImage; -#pragma warning restore CS0618 + filter3.InputImage = ciImage; var cgColor = Color.ToCG(); var components = cgColor.Components; diff --git a/src/Eto.Mac/Drawing/BitmapHandler.cs b/src/Eto.Mac/Drawing/BitmapHandler.cs index 5cdd0502d6..d507589e46 100644 --- a/src/Eto.Mac/Drawing/BitmapHandler.cs +++ b/src/Eto.Mac/Drawing/BitmapHandler.cs @@ -8,35 +8,7 @@ using System.Collections.Generic; using Eto.Forms; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif + namespace Eto.Mac.Drawing { diff --git a/src/Eto.Mac/Drawing/EtoFontManager.cs b/src/Eto.Mac/Drawing/EtoFontManager.cs index cead1c27fe..bb18fac32d 100644 --- a/src/Eto.Mac/Drawing/EtoFontManager.cs +++ b/src/Eto.Mac/Drawing/EtoFontManager.cs @@ -1,32 +1,4 @@ using System; -#if XAMMAC2 -using AppKit; -using Foundation; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#elif OSX -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif namespace Eto.Mac.Drawing { diff --git a/src/Eto.Mac/Drawing/FontExtensions.cs b/src/Eto.Mac/Drawing/FontExtensions.cs index c45ced3f83..0ba586bcb7 100644 --- a/src/Eto.Mac/Drawing/FontExtensions.cs +++ b/src/Eto.Mac/Drawing/FontExtensions.cs @@ -1,33 +1,4 @@ using Eto.Drawing; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#elif OSX -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif #if OSX namespace Eto.Mac.Drawing @@ -72,7 +43,11 @@ public SizeF MeasureString(NSAttributedString str, SizeF? availableSize = null) { SetContainerSize(availableSize); storage.SetString(str); +#if MACOS_NET + return layout.GetBoundingRect(new NSRange(0, (int)str.Length), container).Size.ToEto(); +#else return layout.BoundingRectForGlyphRange(new NSRange(0, (int)str.Length), container).Size.ToEto(); +#endif } void SetContainerSize(SizeF? availableSize) diff --git a/src/Eto.Mac/Drawing/FontFamilyHandler.cs b/src/Eto.Mac/Drawing/FontFamilyHandler.cs index 8ae8ae80fc..60879caddc 100644 --- a/src/Eto.Mac/Drawing/FontFamilyHandler.cs +++ b/src/Eto.Mac/Drawing/FontFamilyHandler.cs @@ -3,22 +3,6 @@ using System.Collections.Generic; using System.Linq; using System.IO; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreFoundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreText; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreText; -#endif namespace Eto.Mac.Drawing { @@ -40,7 +24,7 @@ public string LocalizedName return Name; var facePtr = IntPtr.Zero; -#if XAMMAC && NET6_0_OR_GREATER +#if USE_CFSTRING var familyPtr = CFString.CreateNative(MacName); var result = CFString.FromHandle(Messaging.IntPtr_objc_msgSend_IntPtr_IntPtr(NSFontManager.SharedFontManager.Handle, sel_LocalizedNameForFamilyFace, familyPtr, facePtr)); CFString.ReleaseNative(familyPtr); diff --git a/src/Eto.Mac/Drawing/FontHandler.cs b/src/Eto.Mac/Drawing/FontHandler.cs index 2ffeb9078a..60f879cb32 100644 --- a/src/Eto.Mac/Drawing/FontHandler.cs +++ b/src/Eto.Mac/Drawing/FontHandler.cs @@ -2,37 +2,6 @@ using System.Globalization; using Eto.Drawing; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#elif OSX -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -using MonoMac.CoreText; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif - #if IOS using UIKit; @@ -271,7 +240,11 @@ public float XHeight public float Baseline => LineHeight - Leading - Descent; +#if MACOS_NET + public float LineHeight => (float)SharedLayoutManager.GetDefaultLineHeight(Control); +#else public float LineHeight => (float)SharedLayoutManager.DefaultLineHeightForFont(Control); +#endif public NSDictionary Attributes { diff --git a/src/Eto.Mac/Drawing/FontTypefaceHandler.cs b/src/Eto.Mac/Drawing/FontTypefaceHandler.cs index b89407706b..d72e1a04f6 100644 --- a/src/Eto.Mac/Drawing/FontTypefaceHandler.cs +++ b/src/Eto.Mac/Drawing/FontTypefaceHandler.cs @@ -6,22 +6,6 @@ using Eto.Forms; using System.IO; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreText; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreText; -#endif - namespace Eto.Mac.Drawing { public class FontTypefaceHandler : WidgetHandler, FontTypeface.IHandler diff --git a/src/Eto.Mac/Drawing/FontsHandler.cs b/src/Eto.Mac/Drawing/FontsHandler.cs index 9bcd79ed2e..bd0e98b736 100644 --- a/src/Eto.Mac/Drawing/FontsHandler.cs +++ b/src/Eto.Mac/Drawing/FontsHandler.cs @@ -3,19 +3,6 @@ using System.Collections.Generic; using System.Linq; #if OSX -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#endif namespace Eto.Mac.Drawing #elif IOS diff --git a/src/Eto.Mac/Drawing/FormattedTextHandler.cs b/src/Eto.Mac/Drawing/FormattedTextHandler.cs index c27d1f51fd..a85ae693f1 100644 --- a/src/Eto.Mac/Drawing/FormattedTextHandler.cs +++ b/src/Eto.Mac/Drawing/FormattedTextHandler.cs @@ -1,37 +1,6 @@ using Eto.Drawing; using System; using System.Runtime.InteropServices; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -using CoreText; -#elif OSX -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -using MonoMac.CoreText; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif #if OSX namespace Eto.Mac.Drawing @@ -184,7 +153,11 @@ private float GetMaxTextWidth() while (newlineIndex >= 0) { var glyphRange = new NSRange(startIndex, newlineIndex - startIndex); +#if MACOS_NET + var rect = Control.GetBoundingRect(glyphRange, container).Size.ToEto(); +#else var rect = Control.BoundingRectForGlyphRange(glyphRange, container).Size.ToEto(); +#endif maxWidth = Math.Max(maxWidth, rect.Width); startIndex = newlineIndex + 1; newlineIndex = _text.IndexOf(newline, startIndex); diff --git a/src/Eto.Mac/Drawing/GraphicsHandler.cs b/src/Eto.Mac/Drawing/GraphicsHandler.cs index 148ef19cfd..31b776aa54 100644 --- a/src/Eto.Mac/Drawing/GraphicsHandler.cs +++ b/src/Eto.Mac/Drawing/GraphicsHandler.cs @@ -5,44 +5,14 @@ using System.Collections.Generic; using System.Runtime.InteropServices; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#elif OSX -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -using MonoMac; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif #if OSX using Eto.Mac.Forms; -#if XAMMAC2 -using GraphicsBase = Eto.Mac.Forms.MacBase; -#else +#if MONOMAC using GraphicsBase = Eto.Mac.Forms.MacBase; +#else +using GraphicsBase = Eto.Mac.Forms.MacBase; #endif namespace Eto.Mac.Drawing diff --git a/src/Eto.Mac/Drawing/GraphicsPathHandler.cs b/src/Eto.Mac/Drawing/GraphicsPathHandler.cs index 3a162b9162..ee10b52b0a 100644 --- a/src/Eto.Mac/Drawing/GraphicsPathHandler.cs +++ b/src/Eto.Mac/Drawing/GraphicsPathHandler.cs @@ -4,33 +4,6 @@ using Eto.Drawing; #if OSX -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif namespace Eto.Mac.Drawing #elif IOS diff --git a/src/Eto.Mac/Drawing/IconFrameHandler.cs b/src/Eto.Mac/Drawing/IconFrameHandler.cs index 53a3eb146b..4736ad97c0 100644 --- a/src/Eto.Mac/Drawing/IconFrameHandler.cs +++ b/src/Eto.Mac/Drawing/IconFrameHandler.cs @@ -7,35 +7,7 @@ using Eto.Forms; using System.Runtime.InteropServices; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif + namespace Eto.Mac.Drawing { @@ -80,7 +52,7 @@ public NSBitmapImageRep Rep } } -#if XAMMAC && NET6_0_OR_GREATER +#if MACOS_NET // .NET 6 on ARM64 crashes when using the override in macos workload preview 11, remove this when fixed. [Export("CGImageForProposedRect:context:hints:")] public CGImage AsCGImage(IntPtr proposedDestRectPtr, NSGraphicsContext context, NSDictionary hints) diff --git a/src/Eto.Mac/Drawing/IconHandler.cs b/src/Eto.Mac/Drawing/IconHandler.cs index c9e6d527fe..552e804bf0 100644 --- a/src/Eto.Mac/Drawing/IconHandler.cs +++ b/src/Eto.Mac/Drawing/IconHandler.cs @@ -6,35 +6,7 @@ using System.Linq; using Eto.Forms; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif + namespace Eto.Mac.Drawing { diff --git a/src/Eto.Mac/Drawing/ImageHandler.cs b/src/Eto.Mac/Drawing/ImageHandler.cs index 765c51060e..84d7d4c97e 100644 --- a/src/Eto.Mac/Drawing/ImageHandler.cs +++ b/src/Eto.Mac/Drawing/ImageHandler.cs @@ -1,35 +1,7 @@ using Eto.Drawing; using Eto.Mac.Forms; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif + namespace Eto.Mac.Drawing { diff --git a/src/Eto.Mac/Drawing/IndexedBitmapHandler.cs b/src/Eto.Mac/Drawing/IndexedBitmapHandler.cs index 6e547bea0f..f29532987b 100644 --- a/src/Eto.Mac/Drawing/IndexedBitmapHandler.cs +++ b/src/Eto.Mac/Drawing/IndexedBitmapHandler.cs @@ -5,35 +5,7 @@ using Eto.Drawing; using Eto.Shared.Drawing; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif + namespace Eto.Mac.Drawing { diff --git a/src/Eto.Mac/Drawing/LinearGradientBrushHandler.cs b/src/Eto.Mac/Drawing/LinearGradientBrushHandler.cs index 0d1303fc0d..1191f0e9d1 100644 --- a/src/Eto.Mac/Drawing/LinearGradientBrushHandler.cs +++ b/src/Eto.Mac/Drawing/LinearGradientBrushHandler.cs @@ -3,35 +3,6 @@ using System.Collections.Generic; using System.Linq; -#if XAMMAC2 -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#elif OSX -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif - #if OSX namespace Eto.Mac.Drawing diff --git a/src/Eto.Mac/Drawing/MatrixHandler.cs b/src/Eto.Mac/Drawing/MatrixHandler.cs index e9d17fce3a..473b4b5117 100644 --- a/src/Eto.Mac/Drawing/MatrixHandler.cs +++ b/src/Eto.Mac/Drawing/MatrixHandler.cs @@ -1,35 +1,6 @@ using System; using Eto.Drawing; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#elif OSX -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif #if OSX diff --git a/src/Eto.Mac/Drawing/PenHandler.cs b/src/Eto.Mac/Drawing/PenHandler.cs index bd4213294b..e07cbfd41e 100644 --- a/src/Eto.Mac/Drawing/PenHandler.cs +++ b/src/Eto.Mac/Drawing/PenHandler.cs @@ -1,35 +1,6 @@ using System; using Eto.Drawing; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#elif OSX -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif #if OSX diff --git a/src/Eto.Mac/Drawing/RadialGradientBrushHandler.cs b/src/Eto.Mac/Drawing/RadialGradientBrushHandler.cs index cba58e8d34..733cb9abbe 100644 --- a/src/Eto.Mac/Drawing/RadialGradientBrushHandler.cs +++ b/src/Eto.Mac/Drawing/RadialGradientBrushHandler.cs @@ -3,34 +3,6 @@ using System.Collections.Generic; using System.Linq; -#if XAMMAC2 -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#elif OSX -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif #if OSX diff --git a/src/Eto.Mac/Drawing/SolidBrushHandler.cs b/src/Eto.Mac/Drawing/SolidBrushHandler.cs index a402b56af3..3ffca76251 100644 --- a/src/Eto.Mac/Drawing/SolidBrushHandler.cs +++ b/src/Eto.Mac/Drawing/SolidBrushHandler.cs @@ -1,19 +1,6 @@ using Eto.Drawing; #if OSX -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#endif namespace Eto.Mac.Drawing #elif IOS diff --git a/src/Eto.Mac/Drawing/SystemColorsHandler.cs b/src/Eto.Mac/Drawing/SystemColorsHandler.cs index 83e88c6725..2353b3f627 100644 --- a/src/Eto.Mac/Drawing/SystemColorsHandler.cs +++ b/src/Eto.Mac/Drawing/SystemColorsHandler.cs @@ -2,19 +2,6 @@ using Eto.Drawing; using System.Threading; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#endif namespace Eto.Mac.Drawing { diff --git a/src/Eto.Mac/Drawing/TextureBrushHandler.cs b/src/Eto.Mac/Drawing/TextureBrushHandler.cs index 5f5bbe93d6..57589fd142 100644 --- a/src/Eto.Mac/Drawing/TextureBrushHandler.cs +++ b/src/Eto.Mac/Drawing/TextureBrushHandler.cs @@ -1,34 +1,6 @@ using System; using Eto.Drawing; -#if XAMMAC2 -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#elif OSX -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif #if OSX diff --git a/src/Eto.Mac/Eto.Mac64.csproj b/src/Eto.Mac/Eto.Mac64.csproj index e2724cdf3f..b75f350696 100644 --- a/src/Eto.Mac/Eto.Mac64.csproj +++ b/src/Eto.Mac/Eto.Mac64.csproj @@ -6,6 +6,7 @@ $(DefineConstants);OSX;DESKTOP;MONOMAC;Mac64 true build\* + 10.0 $(TargetsForTfmSpecificBuildOutput);CopyProjectReferencesToPackage @@ -28,6 +29,24 @@ Use Eto.Platform.XamMac2 if you want to distribute your app to the Mac App Store You do not need to use any of the classes of this assembly (unless customizing the MonoMac functionality of the platform), and should just use the UI controls from the Eto assembly. + + + + + + + + + + + + + + + + + + PlatformDetect.cs diff --git a/src/Eto.Mac/Eto.XamMac2.csproj b/src/Eto.Mac/Eto.XamMac2.csproj index 1e66fe6997..807322b5f0 100644 --- a/src/Eto.Mac/Eto.XamMac2.csproj +++ b/src/Eto.Mac/Eto.XamMac2.csproj @@ -3,13 +3,26 @@ True net462;xamarinmac20 - net6.0-macos10.15;$(TargetFrameworks) + net6.0-macos10.15;$(TargetFrameworks) Eto.Mac - $(DefineConstants);OSX;DESKTOP;XAMMAC;XAMMAC2;UNIFIED + $(DefineConstants);OSX;DESKTOP;XAMMAC;XAMMAC2;UNIFIED;USE_CFSTRING true build\* CA1416 + 10 + + + + + + + + + + + + Eto.Platform.XamMac2 @@ -59,5 +72,9 @@ You do not need to use any of the classes of this assembly (unless customizing t + + + + \ No newline at end of file diff --git a/src/Eto.Mac/Eto.macOS.csproj b/src/Eto.Mac/Eto.macOS.csproj new file mode 100644 index 0000000000..461eaff738 --- /dev/null +++ b/src/Eto.Mac/Eto.macOS.csproj @@ -0,0 +1,76 @@ + + + + net6.0-macos10.15 + Eto.Mac + $(DefineConstants);OSX;DESKTOP;UNIFIED;MACOS_NET;USE_CFSTRING + true + build\* + CA1416 + + + + + + + + + + + + + + + + Eto.Platform.macOS + Eto.Forms - Microsoft MacOS Platform + OS X Platform for the Eto.Forms UI Framework using the macos workload + cross platform gui ui framework desktop osx macos mac eto.forms + +This is the Microsoft MacOS platform for Eto.Forms UI Framework. + +Include this along with your Eto.Forms application to provide an macOS interface for Mac users. + +When used in a desktop project, this package will automatically create a macOS application bundle to run on a Mac. + +You must build MacOS projects on a Mac using dotnet command line or Visual Studio for Mac. + +You do not need to use any of the classes of this assembly (unless customizing the macOS functionality of the platform), and should just use the UI controls from the Eto assembly. + + + + + + PlatformDetect.cs + + + Forms\FixedMaskedTextProviderHandler.cs + + + Drawing\GradientHelper.cs + + + Forms\Cells\MutableCellEventArgs.cs + + + Drawing\BaseBitmapData.cs + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Eto.Mac/EtoBundle.cs b/src/Eto.Mac/EtoBundle.cs index 55b481ffe2..9f781d2e78 100644 --- a/src/Eto.Mac/EtoBundle.cs +++ b/src/Eto.Mac/EtoBundle.cs @@ -1,21 +1,5 @@ using System; using System.Runtime.InteropServices; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#endif namespace Eto.Mac { diff --git a/src/Eto.Mac/EtoEnvironmentHandler.cs b/src/Eto.Mac/EtoEnvironmentHandler.cs index 690e1fd51b..4e07811f64 100644 --- a/src/Eto.Mac/EtoEnvironmentHandler.cs +++ b/src/Eto.Mac/EtoEnvironmentHandler.cs @@ -3,19 +3,6 @@ using System.IO; using System.Diagnostics; using System.Reflection; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#endif namespace Eto.Mac { diff --git a/src/Eto.Mac/Forms/Actions/MacCommand.cs b/src/Eto.Mac/Forms/Actions/MacCommand.cs index 3e27e22b46..e29bd4c113 100644 --- a/src/Eto.Mac/Forms/Actions/MacCommand.cs +++ b/src/Eto.Mac/Forms/Actions/MacCommand.cs @@ -1,17 +1,4 @@ using Eto.Forms; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#endif namespace Eto.Mac.Forms.Actions { diff --git a/src/Eto.Mac/Forms/ApplicationHandler.cs b/src/Eto.Mac/Forms/ApplicationHandler.cs index d45a2b0aac..cdc343ecd5 100644 --- a/src/Eto.Mac/Forms/ApplicationHandler.cs +++ b/src/Eto.Mac/Forms/ApplicationHandler.cs @@ -8,39 +8,6 @@ using System.Runtime.CompilerServices; using System.Threading; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -using CoreFoundation; -#else -using MonoMac; -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -using MonoMac.CoreFoundation; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif - namespace Eto.Mac.Forms { public class ApplicationHandler : WidgetHandler, Application.IHandler diff --git a/src/Eto.Mac/Forms/Cells/CellHandler.cs b/src/Eto.Mac/Forms/Cells/CellHandler.cs index c379cb0382..913a7e25c7 100644 --- a/src/Eto.Mac/Forms/Cells/CellHandler.cs +++ b/src/Eto.Mac/Forms/Cells/CellHandler.cs @@ -3,39 +3,6 @@ using System; using Eto.Mac.Forms.Controls; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif - -#if XAMMAC2 -using nnuint = System.nint; -#else -using nnuint = System.Int32; -#endif namespace Eto.Mac.Forms.Cells { @@ -176,7 +143,7 @@ protected virtual void ReloadColumnData() if (handler?.Loaded == true) { var column = handler.Widget.Columns.IndexOf(ColumnHandler.Widget); - var rows = NSIndexSet.FromNSRange(new NSRange(0, (nnuint)handler.Table.RowCount)); + var rows = NSIndexSet.FromNSRange(new NSRange(0, handler.Table.RowCount)); handler.Table.ReloadData(rows, new NSIndexSet(column)); } } diff --git a/src/Eto.Mac/Forms/Cells/CheckBoxCellHandler.cs b/src/Eto.Mac/Forms/Cells/CheckBoxCellHandler.cs index 5fba6cb5ee..b8b0642fa8 100644 --- a/src/Eto.Mac/Forms/Cells/CheckBoxCellHandler.cs +++ b/src/Eto.Mac/Forms/Cells/CheckBoxCellHandler.cs @@ -3,33 +3,6 @@ using Eto.Drawing; using Eto.Mac.Forms.Controls; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif namespace Eto.Mac.Forms.Cells { diff --git a/src/Eto.Mac/Forms/Cells/ComboBoxCellHandler.cs b/src/Eto.Mac/Forms/Cells/ComboBoxCellHandler.cs index f376703fdb..11e63048ed 100644 --- a/src/Eto.Mac/Forms/Cells/ComboBoxCellHandler.cs +++ b/src/Eto.Mac/Forms/Cells/ComboBoxCellHandler.cs @@ -6,33 +6,6 @@ using Eto.Mac.Forms.Controls; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif namespace Eto.Mac.Forms.Cells { diff --git a/src/Eto.Mac/Forms/Cells/CustomCellHandler.cs b/src/Eto.Mac/Forms/Cells/CustomCellHandler.cs index f4f20e9f0f..0a2760984a 100644 --- a/src/Eto.Mac/Forms/Cells/CustomCellHandler.cs +++ b/src/Eto.Mac/Forms/Cells/CustomCellHandler.cs @@ -5,35 +5,7 @@ using Eto.Mac.Forms.Controls; using Eto.Shared; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif + namespace Eto.Mac.Forms.Cells { diff --git a/src/Eto.Mac/Forms/Cells/DrawableCellHandler.cs b/src/Eto.Mac/Forms/Cells/DrawableCellHandler.cs index 5013c1101d..618f7df457 100644 --- a/src/Eto.Mac/Forms/Cells/DrawableCellHandler.cs +++ b/src/Eto.Mac/Forms/Cells/DrawableCellHandler.cs @@ -5,35 +5,7 @@ using System.Runtime.InteropServices; using Eto.Mac.Forms.Controls; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif + namespace Eto.Mac.Forms.Cells diff --git a/src/Eto.Mac/Forms/Cells/ImageTextCellHandler.cs b/src/Eto.Mac/Forms/Cells/ImageTextCellHandler.cs index 6d73784dac..31bad0f77e 100644 --- a/src/Eto.Mac/Forms/Cells/ImageTextCellHandler.cs +++ b/src/Eto.Mac/Forms/Cells/ImageTextCellHandler.cs @@ -4,33 +4,6 @@ using Eto.Mac.Drawing; using Eto.Mac.Forms.Controls; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif namespace Eto.Mac.Forms.Cells { diff --git a/src/Eto.Mac/Forms/Cells/ImageViewCellHandler.cs b/src/Eto.Mac/Forms/Cells/ImageViewCellHandler.cs index 35766dc6a5..e6b1daaf17 100644 --- a/src/Eto.Mac/Forms/Cells/ImageViewCellHandler.cs +++ b/src/Eto.Mac/Forms/Cells/ImageViewCellHandler.cs @@ -4,33 +4,6 @@ using Eto.Mac.Drawing; using Eto.Mac.Forms.Controls; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif namespace Eto.Mac.Forms.Cells { diff --git a/src/Eto.Mac/Forms/Cells/ProgressCellHandler.cs b/src/Eto.Mac/Forms/Cells/ProgressCellHandler.cs index ac2805ac99..02224ada32 100644 --- a/src/Eto.Mac/Forms/Cells/ProgressCellHandler.cs +++ b/src/Eto.Mac/Forms/Cells/ProgressCellHandler.cs @@ -5,33 +5,6 @@ using Eto.Mac.Forms.Controls; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif namespace Eto.Mac.Forms.Cells { diff --git a/src/Eto.Mac/Forms/Cells/TextBoxCellHandler.cs b/src/Eto.Mac/Forms/Cells/TextBoxCellHandler.cs index 72b5972e1f..c9d4a2478e 100644 --- a/src/Eto.Mac/Forms/Cells/TextBoxCellHandler.cs +++ b/src/Eto.Mac/Forms/Cells/TextBoxCellHandler.cs @@ -4,33 +4,6 @@ using Eto.Mac.Forms.Controls; using Eto.Mac.Drawing; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif namespace Eto.Mac.Forms.Cells { diff --git a/src/Eto.Mac/Forms/ClipboardHandler.cs b/src/Eto.Mac/Forms/ClipboardHandler.cs index 8c8544b793..8970b3ddff 100644 --- a/src/Eto.Mac/Forms/ClipboardHandler.cs +++ b/src/Eto.Mac/Forms/ClipboardHandler.cs @@ -4,33 +4,6 @@ using Eto.Mac.Drawing; using Eto.Drawing; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif namespace Eto.Mac.Forms { diff --git a/src/Eto.Mac/Forms/ColorDialogHandler.cs b/src/Eto.Mac/Forms/ColorDialogHandler.cs index d122cfee09..a564d2add1 100644 --- a/src/Eto.Mac/Forms/ColorDialogHandler.cs +++ b/src/Eto.Mac/Forms/ColorDialogHandler.cs @@ -1,19 +1,6 @@ using System; using Eto.Forms; using Eto.Drawing; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#endif namespace Eto.Mac.Forms { diff --git a/src/Eto.Mac/Forms/Controls/ButtonHandler.cs b/src/Eto.Mac/Forms/Controls/ButtonHandler.cs index 5905746da0..2668c0e88f 100644 --- a/src/Eto.Mac/Forms/Controls/ButtonHandler.cs +++ b/src/Eto.Mac/Forms/Controls/ButtonHandler.cs @@ -4,35 +4,7 @@ using Eto.Drawing; using Eto.Forms; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif + namespace Eto.Mac.Forms.Controls { diff --git a/src/Eto.Mac/Forms/Controls/CalendarHandler.cs b/src/Eto.Mac/Forms/Controls/CalendarHandler.cs index 43c789e0c2..c8de920151 100644 --- a/src/Eto.Mac/Forms/Controls/CalendarHandler.cs +++ b/src/Eto.Mac/Forms/Controls/CalendarHandler.cs @@ -1,18 +1,5 @@ using System; using Eto.Forms; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#endif namespace Eto.Mac.Forms.Controls { diff --git a/src/Eto.Mac/Forms/Controls/CheckBoxHandler.cs b/src/Eto.Mac/Forms/Controls/CheckBoxHandler.cs index 3f760c0dc1..cda2d1550c 100644 --- a/src/Eto.Mac/Forms/Controls/CheckBoxHandler.cs +++ b/src/Eto.Mac/Forms/Controls/CheckBoxHandler.cs @@ -2,35 +2,7 @@ using Eto.Forms; using Eto.Drawing; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif + namespace Eto.Mac.Forms.Controls { diff --git a/src/Eto.Mac/Forms/Controls/ColorPickerHandler.cs b/src/Eto.Mac/Forms/Controls/ColorPickerHandler.cs index 36b15cbd02..957ded8b3c 100644 --- a/src/Eto.Mac/Forms/Controls/ColorPickerHandler.cs +++ b/src/Eto.Mac/Forms/Controls/ColorPickerHandler.cs @@ -4,19 +4,6 @@ using Eto.Mac.Drawing; using System.Text.RegularExpressions; using System.Linq; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#endif namespace Eto.Mac.Forms.Controls { diff --git a/src/Eto.Mac/Forms/Controls/ComboBoxHandler.cs b/src/Eto.Mac/Forms/Controls/ComboBoxHandler.cs index 056e888af4..4adc0330c3 100644 --- a/src/Eto.Mac/Forms/Controls/ComboBoxHandler.cs +++ b/src/Eto.Mac/Forms/Controls/ComboBoxHandler.cs @@ -5,35 +5,7 @@ using System.Collections; using Eto.Drawing; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif + namespace Eto.Mac.Forms.Controls { diff --git a/src/Eto.Mac/Forms/Controls/DateTimePickerHandler.cs b/src/Eto.Mac/Forms/Controls/DateTimePickerHandler.cs index 98d5a4bd5b..598ada8ebb 100644 --- a/src/Eto.Mac/Forms/Controls/DateTimePickerHandler.cs +++ b/src/Eto.Mac/Forms/Controls/DateTimePickerHandler.cs @@ -1,33 +1,6 @@ using System; using Eto.Forms; using Eto.Drawing; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif namespace Eto.Mac.Forms.Controls { diff --git a/src/Eto.Mac/Forms/Controls/DrawableHandler.cs b/src/Eto.Mac/Forms/Controls/DrawableHandler.cs index 8993fb469d..f231d4b451 100644 --- a/src/Eto.Mac/Forms/Controls/DrawableHandler.cs +++ b/src/Eto.Mac/Forms/Controls/DrawableHandler.cs @@ -1,33 +1,6 @@ using Eto.Drawing; using Eto.Forms; using Eto.Mac.Drawing; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif namespace Eto.Mac.Forms.Controls { diff --git a/src/Eto.Mac/Forms/Controls/DropDownHandler.cs b/src/Eto.Mac/Forms/Controls/DropDownHandler.cs index 714380c88e..8834e8cd0f 100644 --- a/src/Eto.Mac/Forms/Controls/DropDownHandler.cs +++ b/src/Eto.Mac/Forms/Controls/DropDownHandler.cs @@ -5,35 +5,7 @@ using System.Collections; using Eto.Drawing; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif + namespace Eto.Mac.Forms.Controls { diff --git a/src/Eto.Mac/Forms/Controls/ExpanderHandler.cs b/src/Eto.Mac/Forms/Controls/ExpanderHandler.cs index 074c8a03dd..69e0a29652 100644 --- a/src/Eto.Mac/Forms/Controls/ExpanderHandler.cs +++ b/src/Eto.Mac/Forms/Controls/ExpanderHandler.cs @@ -3,35 +3,7 @@ using Eto.Forms; using System.Linq; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif + namespace Eto.Mac.Forms.Controls { diff --git a/src/Eto.Mac/Forms/Controls/GridColumnHandler.cs b/src/Eto.Mac/Forms/Controls/GridColumnHandler.cs index 539395c499..f98c76f1d4 100644 --- a/src/Eto.Mac/Forms/Controls/GridColumnHandler.cs +++ b/src/Eto.Mac/Forms/Controls/GridColumnHandler.cs @@ -5,33 +5,6 @@ using Eto.Mac.Forms.Cells; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif namespace Eto.Mac.Forms.Controls { diff --git a/src/Eto.Mac/Forms/Controls/GridHandler.cs b/src/Eto.Mac/Forms/Controls/GridHandler.cs index be3d270a6f..59678972e4 100644 --- a/src/Eto.Mac/Forms/Controls/GridHandler.cs +++ b/src/Eto.Mac/Forms/Controls/GridHandler.cs @@ -7,42 +7,6 @@ using Eto.Mac.Drawing; using Eto.Mac.Forms.Cells; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif - -#if XAMMAC -using nnint = System.Int32; -#elif Mac64 -using nnint = System.UInt64; -#else -using nnint = System.UInt32; -#endif - namespace Eto.Mac.Forms.Controls { public interface IGridHandler : IMacViewHandler @@ -506,7 +470,7 @@ public void SelectAll() public void SelectRow(int row) { - Control.SelectRow((nnint)row, AllowMultipleSelection); + Control.SelectRow(row, AllowMultipleSelection); } public void UnselectRow(int row) @@ -523,7 +487,7 @@ public void BeginEdit(int row, int column) { if (!Control.IsRowSelected(row)) { - Control.SelectRow((nnint)row, false); + Control.SelectRow((nint)row, false); } Control.EditColumn((nint)column, (nint)row, new NSEvent(), true); } @@ -671,7 +635,7 @@ void IDataViewHandler.OnCellEdited(GridViewCellEventArgs e) // reload this entire row if (e.Row >= 0) { - Control.ReloadData(NSIndexSet.FromIndex((nnint)e.Row), NSIndexSet.FromNSRange(new NSRange(0, Control.ColumnCount))); + Control.ReloadData(NSIndexSet.FromIndex((nint)e.Row), NSIndexSet.FromNSRange(new NSRange(0, Control.ColumnCount))); } if (e.GridColumn.AutoSize) diff --git a/src/Eto.Mac/Forms/Controls/GridViewHandler.cs b/src/Eto.Mac/Forms/Controls/GridViewHandler.cs index c78d638ab5..68df78bd0e 100644 --- a/src/Eto.Mac/Forms/Controls/GridViewHandler.cs +++ b/src/Eto.Mac/Forms/Controls/GridViewHandler.cs @@ -6,34 +6,11 @@ using System.Linq; using Eto.Mac.Forms.Cells; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif +#if MACOS_NET +using NSDraggingInfo = AppKit.INSDraggingInfo; #endif + namespace Eto.Mac.Forms.Controls { public class GridViewHandler : GridHandler, GridView.IHandler @@ -145,6 +122,18 @@ public override NSImage DragImageForRowsWithIndexestableColumnseventoffset(NSInd } return base.DragImageForRowsWithIndexestableColumnseventoffset(dragRows, tableColumns, dragEvent, ref dragImageOffset); } +#elif MACOS_NET + public override NSImage DragImageForRows(NSIndexSet dragRows, NSTableColumn[] tableColumns, NSEvent dragEvent, ref CGPoint dragImageOffset) + { + var dragInfo = Handler?.DragInfo; + var img = dragInfo?.DragImage; + if (img != null) + { + dragImageOffset = dragInfo.GetDragImageOffset(); + return img; + } + return base.DragImageForRows(dragRows, tableColumns, dragEvent, ref dragImageOffset); + } #else static readonly IntPtr selDragImageForRowsWithIndexes_TableColumns_Event_Offset_Handle = Selector.GetHandle("dragImageForRowsWithIndexes:tableColumns:event:offset:"); diff --git a/src/Eto.Mac/Forms/Controls/GroupBoxHandler.cs b/src/Eto.Mac/Forms/Controls/GroupBoxHandler.cs index 08d8dac16d..de9a5c646a 100644 --- a/src/Eto.Mac/Forms/Controls/GroupBoxHandler.cs +++ b/src/Eto.Mac/Forms/Controls/GroupBoxHandler.cs @@ -3,35 +3,7 @@ using Eto.Drawing; using Eto.Mac.Drawing; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif + namespace Eto.Mac.Forms.Controls { diff --git a/src/Eto.Mac/Forms/Controls/ImageViewHandler.cs b/src/Eto.Mac/Forms/Controls/ImageViewHandler.cs index ac0976f9b0..3ddd51fae2 100644 --- a/src/Eto.Mac/Forms/Controls/ImageViewHandler.cs +++ b/src/Eto.Mac/Forms/Controls/ImageViewHandler.cs @@ -3,35 +3,7 @@ using Eto.Drawing; using Eto.Mac.Drawing; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif + namespace Eto.Mac.Forms.Controls { diff --git a/src/Eto.Mac/Forms/Controls/LabelHandler.cs b/src/Eto.Mac/Forms/Controls/LabelHandler.cs index 4fe22709a3..d0a1c61110 100644 --- a/src/Eto.Mac/Forms/Controls/LabelHandler.cs +++ b/src/Eto.Mac/Forms/Controls/LabelHandler.cs @@ -5,43 +5,7 @@ using System.Text.RegularExpressions; using System.Linq; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif -#if XAMMAC2 -using nnint = System.nint; -#elif Mac64 -using nnint = System.UInt64; -#else -using nnint = System.Int32; -#endif namespace Eto.Mac.Forms.Controls { diff --git a/src/Eto.Mac/Forms/Controls/LinkButtonHandler.cs b/src/Eto.Mac/Forms/Controls/LinkButtonHandler.cs index db00a28723..bdbecfbfd9 100644 --- a/src/Eto.Mac/Forms/Controls/LinkButtonHandler.cs +++ b/src/Eto.Mac/Forms/Controls/LinkButtonHandler.cs @@ -4,33 +4,6 @@ using Eto.Mac.Drawing; using System.Runtime.InteropServices; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif namespace Eto.Mac.Forms.Controls { diff --git a/src/Eto.Mac/Forms/Controls/ListBoxHandler.cs b/src/Eto.Mac/Forms/Controls/ListBoxHandler.cs index aa033092d4..0477f12c7e 100644 --- a/src/Eto.Mac/Forms/Controls/ListBoxHandler.cs +++ b/src/Eto.Mac/Forms/Controls/ListBoxHandler.cs @@ -7,43 +7,6 @@ using System.Collections; using System.Linq; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif - -#if XAMMAC -using nnint = System.Int32; -#elif Mac64 -using nnint = System.UInt64; -#else -using nnint = System.UInt32; -#endif - - namespace Eto.Mac.Forms.Controls { public class EtoScrollView : NSScrollView, IMacControl @@ -302,7 +265,7 @@ public int SelectedIndex Control.DeselectAll(Control); else { - Control.SelectRow((nnint)value, false); + Control.SelectRow((nint)value, false); Control.ScrollRowToVisible(value); } } diff --git a/src/Eto.Mac/Forms/Controls/MacButton.cs b/src/Eto.Mac/Forms/Controls/MacButton.cs index 9b995ade64..4fa765cb85 100644 --- a/src/Eto.Mac/Forms/Controls/MacButton.cs +++ b/src/Eto.Mac/Forms/Controls/MacButton.cs @@ -2,22 +2,6 @@ using Eto.Drawing; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreText; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreText; -#endif - namespace Eto.Mac.Forms.Controls { public abstract class MacButton : MacControl, TextControl.IHandler diff --git a/src/Eto.Mac/Forms/Controls/MacControl.cs b/src/Eto.Mac/Forms/Controls/MacControl.cs index 9cc46ac83c..7054cb26d6 100644 --- a/src/Eto.Mac/Forms/Controls/MacControl.cs +++ b/src/Eto.Mac/Forms/Controls/MacControl.cs @@ -1,19 +1,6 @@ using Eto.Forms; using Eto.Drawing; using Eto.Mac.Drawing; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#endif namespace Eto.Mac.Forms.Controls { diff --git a/src/Eto.Mac/Forms/Controls/MacEventView.cs b/src/Eto.Mac/Forms/Controls/MacEventView.cs index 535353bafa..99d0440832 100644 --- a/src/Eto.Mac/Forms/Controls/MacEventView.cs +++ b/src/Eto.Mac/Forms/Controls/MacEventView.cs @@ -2,35 +2,7 @@ using Eto.Forms; using Eto.Drawing; using System.Diagnostics; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif + namespace Eto.Mac.Forms.Controls { diff --git a/src/Eto.Mac/Forms/Controls/MacImageAndTextCell.cs b/src/Eto.Mac/Forms/Controls/MacImageAndTextCell.cs index 1cc85b0608..18d58aa90d 100644 --- a/src/Eto.Mac/Forms/Controls/MacImageAndTextCell.cs +++ b/src/Eto.Mac/Forms/Controls/MacImageAndTextCell.cs @@ -2,33 +2,6 @@ using Eto.Forms; using Eto.Mac.Drawing; using Eto.Drawing; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif namespace Eto.Mac.Forms.Controls { diff --git a/src/Eto.Mac/Forms/Controls/MacImageTextView.cs b/src/Eto.Mac/Forms/Controls/MacImageTextView.cs index e6a5152046..b0474056cb 100644 --- a/src/Eto.Mac/Forms/Controls/MacImageTextView.cs +++ b/src/Eto.Mac/Forms/Controls/MacImageTextView.cs @@ -1,30 +1,4 @@ using System; -#if XAMMAC2 -using AppKit; -using CoreGraphics; -using Foundation; -using ObjCRuntime; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif namespace Eto.Mac.Forms.Controls { diff --git a/src/Eto.Mac/Forms/Controls/MacLabel.cs b/src/Eto.Mac/Forms/Controls/MacLabel.cs index 99600d66ab..cb33840385 100644 --- a/src/Eto.Mac/Forms/Controls/MacLabel.cs +++ b/src/Eto.Mac/Forms/Controls/MacLabel.cs @@ -5,44 +5,6 @@ using System.Text.RegularExpressions; using System.Linq; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif - -#if XAMMAC -using nnint = System.Int32; -#elif Mac64 -using nnint = System.UInt64; -#else -using nnint = System.UInt32; -#endif - namespace Eto.Mac.Forms.Controls { diff --git a/src/Eto.Mac/Forms/Controls/MacText.cs b/src/Eto.Mac/Forms/Controls/MacText.cs index 604703b79f..dd3e027f79 100644 --- a/src/Eto.Mac/Forms/Controls/MacText.cs +++ b/src/Eto.Mac/Forms/Controls/MacText.cs @@ -4,19 +4,6 @@ using System; using System.Diagnostics; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#endif namespace Eto.Mac.Forms.Controls { diff --git a/src/Eto.Mac/Forms/Controls/NativeControlHandler.cs b/src/Eto.Mac/Forms/Controls/NativeControlHandler.cs index 4c8d066991..d17b1c7ebe 100644 --- a/src/Eto.Mac/Forms/Controls/NativeControlHandler.cs +++ b/src/Eto.Mac/Forms/Controls/NativeControlHandler.cs @@ -3,34 +3,6 @@ using Eto.Forms; using Eto.Drawing; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using nnint = System.nint; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif namespace Eto.Mac.Forms.Controls { diff --git a/src/Eto.Mac/Forms/Controls/NumericStepperHandler.cs b/src/Eto.Mac/Forms/Controls/NumericStepperHandler.cs index 4832718556..5245ba8046 100644 --- a/src/Eto.Mac/Forms/Controls/NumericStepperHandler.cs +++ b/src/Eto.Mac/Forms/Controls/NumericStepperHandler.cs @@ -8,43 +8,6 @@ using System.Runtime.InteropServices; using System.Reflection; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreFoundation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif - -#if XAMMAC -using nnint = System.Int32; -#elif Mac64 -using nnint = System.UInt64; -#else -using nnint = System.UInt32; -#endif - namespace Eto.Mac.Forms.Controls { public class NumericStepperHandler : MacView, NumericStepper.IHandler @@ -457,7 +420,7 @@ public bool GetObjectValue(IntPtr obj, IntPtr strPtr, IntPtr errorDescription) if (h != null && h.NeedsFormat) { double result; -#if XAMMAC && NET6_0_OR_GREATER +#if USE_CFSTRING var str = CFString.FromHandle(strPtr); #else var str = NSString.FromHandle(strPtr); @@ -507,8 +470,8 @@ void SetFormatter() NumberStyle = NSNumberFormatterStyle.Decimal, Lenient = true, UsesGroupingSeparator = false, - MinimumFractionDigits = (nnint)DecimalPlaces, - MaximumFractionDigits = (nnint)MaximumDecimalPlaces + MinimumFractionDigits = DecimalPlaces, + MaximumFractionDigits = MaximumDecimalPlaces }; Stepper.Formatter = formatter; diff --git a/src/Eto.Mac/Forms/Controls/PanelHandler.cs b/src/Eto.Mac/Forms/Controls/PanelHandler.cs index 0a8cb194b0..5601655675 100644 --- a/src/Eto.Mac/Forms/Controls/PanelHandler.cs +++ b/src/Eto.Mac/Forms/Controls/PanelHandler.cs @@ -1,19 +1,6 @@ using System; using Eto.Forms; using Eto.Drawing; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#endif namespace Eto.Mac.Forms.Controls { diff --git a/src/Eto.Mac/Forms/Controls/PasswordBoxHandler.cs b/src/Eto.Mac/Forms/Controls/PasswordBoxHandler.cs index a0a5fe03a9..13a1617d99 100644 --- a/src/Eto.Mac/Forms/Controls/PasswordBoxHandler.cs +++ b/src/Eto.Mac/Forms/Controls/PasswordBoxHandler.cs @@ -3,35 +3,7 @@ using Eto.Mac.Forms.Controls; using Eto.Drawing; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif + namespace Eto.Mac.Forms.Controls { diff --git a/src/Eto.Mac/Forms/Controls/ProgressBarHandler.cs b/src/Eto.Mac/Forms/Controls/ProgressBarHandler.cs index e0dbe4ee57..d27e93470f 100644 --- a/src/Eto.Mac/Forms/Controls/ProgressBarHandler.cs +++ b/src/Eto.Mac/Forms/Controls/ProgressBarHandler.cs @@ -2,35 +2,7 @@ using Eto.Forms; using Eto.Drawing; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif + namespace Eto.Mac.Forms.Controls { diff --git a/src/Eto.Mac/Forms/Controls/RadioButtonHandler.cs b/src/Eto.Mac/Forms/Controls/RadioButtonHandler.cs index ed344ddf6a..f374ef889b 100644 --- a/src/Eto.Mac/Forms/Controls/RadioButtonHandler.cs +++ b/src/Eto.Mac/Forms/Controls/RadioButtonHandler.cs @@ -4,35 +4,7 @@ using System.Linq; using Eto.Drawing; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif + namespace Eto.Mac.Forms.Controls { diff --git a/src/Eto.Mac/Forms/Controls/RichTextAreaHandler.cs b/src/Eto.Mac/Forms/Controls/RichTextAreaHandler.cs index 3428d12a05..64a6f5da51 100644 --- a/src/Eto.Mac/Forms/Controls/RichTextAreaHandler.cs +++ b/src/Eto.Mac/Forms/Controls/RichTextAreaHandler.cs @@ -6,44 +6,6 @@ using System.Collections.Generic; using System.Text; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif - -#if XAMMAC -using nnint = System.Int32; -#elif Mac64 -using nnint = System.UInt64; -#else -using nnint = System.UInt32; -#endif - namespace Eto.Mac.Forms.Controls { public class RichTextAreaHandler : TextAreaHandler, RichTextArea.IHandler, ITextBuffer @@ -298,7 +260,7 @@ public void Delete(Range range) public void Insert(int position, string text) { - Control.TextStorage.Insert(new NSAttributedString(text), (nnint)position); + Control.TextStorage.Insert(new NSAttributedString(text), (nint)position); } public IEnumerable SupportedFormats diff --git a/src/Eto.Mac/Forms/Controls/ScrollableHandler.cs b/src/Eto.Mac/Forms/Controls/ScrollableHandler.cs index 74ce27db53..8038d9017c 100644 --- a/src/Eto.Mac/Forms/Controls/ScrollableHandler.cs +++ b/src/Eto.Mac/Forms/Controls/ScrollableHandler.cs @@ -5,33 +5,6 @@ using System; using Eto.Drawing; using Eto.Forms; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif namespace Eto.Mac.Forms.Controls { diff --git a/src/Eto.Mac/Forms/Controls/SearchBoxHandler.cs b/src/Eto.Mac/Forms/Controls/SearchBoxHandler.cs index b704470bb1..7a5fdfb5b4 100644 --- a/src/Eto.Mac/Forms/Controls/SearchBoxHandler.cs +++ b/src/Eto.Mac/Forms/Controls/SearchBoxHandler.cs @@ -2,35 +2,7 @@ using Eto.Drawing; using Eto.Forms; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif + namespace Eto.Mac.Forms.Controls { diff --git a/src/Eto.Mac/Forms/Controls/SegmentedButtonHandler.cs b/src/Eto.Mac/Forms/Controls/SegmentedButtonHandler.cs index 692fa9c865..08d0be01c8 100644 --- a/src/Eto.Mac/Forms/Controls/SegmentedButtonHandler.cs +++ b/src/Eto.Mac/Forms/Controls/SegmentedButtonHandler.cs @@ -4,35 +4,7 @@ using Eto.Drawing; using System.Linq; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif + namespace Eto.Mac.Forms.Controls { diff --git a/src/Eto.Mac/Forms/Controls/SliderHandler.cs b/src/Eto.Mac/Forms/Controls/SliderHandler.cs index 37083739c5..6a21e19a9d 100644 --- a/src/Eto.Mac/Forms/Controls/SliderHandler.cs +++ b/src/Eto.Mac/Forms/Controls/SliderHandler.cs @@ -2,35 +2,7 @@ using Eto.Forms; using Eto.Drawing; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif + namespace Eto.Mac.Forms.Controls { @@ -54,7 +26,11 @@ public SliderHandler Handler set { WeakHandler = new WeakReference(value); } } +#if MACOS_NET + public override bool IsVertical => Handler?.Orientation == Orientation.Vertical; +#else public override nint IsVertical => Handler?.Orientation == Orientation.Vertical ? 1 : 0; +#endif } protected override bool DefaultUseAlignmentFrame => true; diff --git a/src/Eto.Mac/Forms/Controls/SpinnerHandler.cs b/src/Eto.Mac/Forms/Controls/SpinnerHandler.cs index d741696f37..ac30c65bac 100644 --- a/src/Eto.Mac/Forms/Controls/SpinnerHandler.cs +++ b/src/Eto.Mac/Forms/Controls/SpinnerHandler.cs @@ -1,19 +1,6 @@ using System; using Eto.Forms; using Eto.Drawing; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#endif namespace Eto.Mac.Forms.Controls { diff --git a/src/Eto.Mac/Forms/Controls/SplitterHandler.cs b/src/Eto.Mac/Forms/Controls/SplitterHandler.cs index 5627e8c8aa..ffc8ff3c83 100644 --- a/src/Eto.Mac/Forms/Controls/SplitterHandler.cs +++ b/src/Eto.Mac/Forms/Controls/SplitterHandler.cs @@ -2,33 +2,6 @@ using Eto.Forms; using Eto.Drawing; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif namespace Eto.Mac.Forms.Controls { diff --git a/src/Eto.Mac/Forms/Controls/StepperHandler.cs b/src/Eto.Mac/Forms/Controls/StepperHandler.cs index d34217e9e7..efa6965852 100644 --- a/src/Eto.Mac/Forms/Controls/StepperHandler.cs +++ b/src/Eto.Mac/Forms/Controls/StepperHandler.cs @@ -2,33 +2,6 @@ using Eto.Forms; using Eto.Drawing; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif namespace Eto.Mac.Forms.Controls { diff --git a/src/Eto.Mac/Forms/Controls/TabControlHandler.cs b/src/Eto.Mac/Forms/Controls/TabControlHandler.cs index 05bceac4fd..04b56dc84b 100644 --- a/src/Eto.Mac/Forms/Controls/TabControlHandler.cs +++ b/src/Eto.Mac/Forms/Controls/TabControlHandler.cs @@ -3,19 +3,6 @@ using Eto.Forms; using Eto.Drawing; using System.Collections.Generic; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#endif namespace Eto.Mac.Forms.Controls { diff --git a/src/Eto.Mac/Forms/Controls/TabPageHandler.cs b/src/Eto.Mac/Forms/Controls/TabPageHandler.cs index 5eba4ac52a..37779d772b 100644 --- a/src/Eto.Mac/Forms/Controls/TabPageHandler.cs +++ b/src/Eto.Mac/Forms/Controls/TabPageHandler.cs @@ -2,33 +2,6 @@ using Eto.Forms; using Eto.Drawing; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif namespace Eto.Mac.Forms.Controls { diff --git a/src/Eto.Mac/Forms/Controls/TextAreaHandler.cs b/src/Eto.Mac/Forms/Controls/TextAreaHandler.cs index 292ccfbbae..59a1788d20 100644 --- a/src/Eto.Mac/Forms/Controls/TextAreaHandler.cs +++ b/src/Eto.Mac/Forms/Controls/TextAreaHandler.cs @@ -3,42 +3,6 @@ using Eto.Drawing; using Eto.Mac.Drawing; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif - -#if XAMMAC -using nnint = System.Int32; -#elif Mac64 -using nnint = System.UInt64; -#else -using nnint = System.UInt32; -#endif - namespace Eto.Mac.Forms.Controls { public class TextAreaHandler : TextAreaHandler, TextArea.IHandler @@ -102,10 +66,17 @@ public object Handler set { WeakHandler = new WeakReference(value); } } +#if MACOS_NET + public override void ChangeColor(NSColorPanel sender) + { + // ignore color changes + } +#else public override void ChangeColor(NSObject sender) { // ignore color changes } +#endif public EtoTextView(ITextAreaHandler handler) { diff --git a/src/Eto.Mac/Forms/Controls/TextBoxHandler.cs b/src/Eto.Mac/Forms/Controls/TextBoxHandler.cs index 81fd8d4f47..e64244a4df 100644 --- a/src/Eto.Mac/Forms/Controls/TextBoxHandler.cs +++ b/src/Eto.Mac/Forms/Controls/TextBoxHandler.cs @@ -2,19 +2,6 @@ using Eto.Forms; using Eto.Mac.Forms.Controls; using Eto.Drawing; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#endif namespace Eto.Mac.Forms.Controls { diff --git a/src/Eto.Mac/Forms/Controls/ToggleButtonHandler.cs b/src/Eto.Mac/Forms/Controls/ToggleButtonHandler.cs index da7c683bc1..c070d143a3 100644 --- a/src/Eto.Mac/Forms/Controls/ToggleButtonHandler.cs +++ b/src/Eto.Mac/Forms/Controls/ToggleButtonHandler.cs @@ -2,35 +2,7 @@ using Eto.Drawing; using Eto.Forms; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif + namespace Eto.Mac.Forms.Controls { diff --git a/src/Eto.Mac/Forms/Controls/TreeGridViewHandler.cs b/src/Eto.Mac/Forms/Controls/TreeGridViewHandler.cs index 30bac2e688..ea6869f8d1 100644 --- a/src/Eto.Mac/Forms/Controls/TreeGridViewHandler.cs +++ b/src/Eto.Mac/Forms/Controls/TreeGridViewHandler.cs @@ -5,50 +5,8 @@ using Eto.Mac.Forms.Cells; using Eto.Drawing; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif - -#if XAMMAC -using nnint = System.Int32; -using nnint2 = System.Int32; -#if XAMMAC2 -using nnuint = System.UInt32; -#else -using nnuint = System.Int32; -#endif -#elif Mac64 -using nnint = System.UInt64; -using nnint2 = System.Int64; -using nnuint = System.UInt64; -#else -using nnint = System.UInt32; -using nnint2 = System.Int32; -using nnuint = System.UInt32; +#if MACOS_NET +using NSDraggingInfo = AppKit.INSDraggingInfo; #endif namespace Eto.Mac.Forms.Controls @@ -574,7 +532,19 @@ public EtoOutlineView(IntPtr handle) : base(handle) { } -#if XAMMAC2 +#if MACOS_NET + public override NSImage DragImageForRows(NSIndexSet dragRows, NSTableColumn[] tableColumns, NSEvent dragEvent, ref CGPoint dragImageOffset) + { + var dragInfo = Handler?.DragInfo; + var img = dragInfo?.DragImage; + if (img != null) + { + dragImageOffset = dragInfo.GetDragImageOffset(); + return img; + } + return base.DragImageForRows(dragRows, tableColumns, dragEvent, ref dragImageOffset); + } +#elif XAMMAC2 public override NSImage DragImageForRowsWithIndexestableColumnseventoffset(NSIndexSet dragRows, NSTableColumn[] tableColumns, NSEvent dragEvent, ref CGPoint dragImageOffset) { var dragInfo = Handler?.DragInfo; @@ -862,7 +832,7 @@ public ITreeGridItem SelectedItem var cachedRow = Control.RowForItem(myitem); if (cachedRow >= 0) { - Control.SelectRow((nnint)cachedRow, false); + Control.SelectRow((nint)cachedRow, false); ScrollToRow((int)cachedRow); return; } @@ -873,7 +843,7 @@ public ITreeGridItem SelectedItem Control.EndUpdates(); if (row != null) { - Control.SelectRow((nnint)row.Value, false); + Control.SelectRow((nint)row.Value, false); ScrollToRow((int)row.Value); } } @@ -944,7 +914,7 @@ public void ReloadData() continue; var row = Control.RowForItem(cachedItem); if (row >= 0) - Control.SelectRow((nnint)row, true); + Control.SelectRow((nint)row, true); else isSelectionChanged = true; } @@ -983,7 +953,7 @@ IEnumerable SelectedItemsFromRows() { foreach (var row in Control.SelectedRows) { - var item = Control.ItemAtRow((nnint2)row) as EtoTreeItem; + var item = Control.ItemAtRow((nint)row) as EtoTreeItem; if (item != null) yield return item.Item; } @@ -1014,7 +984,7 @@ public void ReloadItem(ITreeGridItem item, bool reloadChildren) { row = Control.RowForItem(GetCachedItem(sel as ITreeGridItem)); if (row >= 0) - Control.SelectRow((nnint)row, true); + Control.SelectRow((nint)row, true); else isSelectionChanged = true; } @@ -1080,7 +1050,7 @@ IList CustomSelectedItems static IEnumerable GetItems(NSArray items) { - for (nnuint i = 0; i < items.Count; i++) + for (nuint i = 0; i < items.Count; i++) { var item = items.GetItem(i); if (item != null) diff --git a/src/Eto.Mac/Forms/Controls/TreeViewHandler.cs b/src/Eto.Mac/Forms/Controls/TreeViewHandler.cs index d5b8e629f2..ae7e5e09f3 100644 --- a/src/Eto.Mac/Forms/Controls/TreeViewHandler.cs +++ b/src/Eto.Mac/Forms/Controls/TreeViewHandler.cs @@ -5,44 +5,6 @@ using System.Linq; using Eto.Drawing; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif - -#if XAMMAC -using nnint = System.Int32; -#elif Mac64 -using nnint = System.UInt64; -#else -using nnint = System.UInt32; -#endif - namespace Eto.Mac.Forms.Controls { [Obsolete("Since 2.4. TreeView is deprecated, please use TreeGridView instead.")] @@ -426,7 +388,7 @@ void PerformSelect(ITreeItem item, bool scrollToRow) { if (scrollToRow) Control.ScrollRowToVisible(cachedRow); - Control.SelectRow((nnint)cachedRow, false); + Control.SelectRow((nint)cachedRow, false); return; } } @@ -436,7 +398,7 @@ void PerformSelect(ITreeItem item, bool scrollToRow) { if (scrollToRow) Control.ScrollRowToVisible(row.Value); - Control.SelectRow((nnint)row.Value, false); + Control.SelectRow((nint)row.Value, false); } } } diff --git a/src/Eto.Mac/Forms/Controls/WKWebViewHandler.cs b/src/Eto.Mac/Forms/Controls/WKWebViewHandler.cs index a24cedfaa7..eedef2b54c 100644 --- a/src/Eto.Mac/Forms/Controls/WKWebViewHandler.cs +++ b/src/Eto.Mac/Forms/Controls/WKWebViewHandler.cs @@ -4,20 +4,10 @@ using Eto.Drawing; using System.Threading.Tasks; using System.Runtime.InteropServices; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using wk = WebKit; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; +#if MONOMAC using wk = MonoMac.WebKit; +#else +using wk = WebKit; #endif namespace Eto.Mac.Forms.Controls diff --git a/src/Eto.Mac/Forms/Controls/WebViewHandler.cs b/src/Eto.Mac/Forms/Controls/WebViewHandler.cs index 4a5dab9d3f..8e27ac25b1 100644 --- a/src/Eto.Mac/Forms/Controls/WebViewHandler.cs +++ b/src/Eto.Mac/Forms/Controls/WebViewHandler.cs @@ -3,20 +3,12 @@ using System.Linq; using Eto.Drawing; using System.Threading.Tasks; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using wk = WebKit; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; +#if MONOMAC using wk = MonoMac.WebKit; +using IWebOpenPanelResultListener = MonoMac.WebKit.WebOpenPanelResultListener; +#else +using wk = WebKit; +using IWebOpenPanelResultListener = WebKit.IWebOpenPanelResultListener; #endif namespace Eto.Mac.Forms.Controls @@ -224,25 +216,18 @@ public override NSMenuItem[] UIGetContextMenuItems(wk.WebView sender, NSDictiona return Handler.BrowserContextMenuEnabled ? defaultMenuItems : null; } - #if XAMMAC2 - public override void UIRunOpenPanelForFileButton(wk.WebView sender, wk.IWebOpenPanelResultListener resultListener) - { - var openDlg = new OpenFileDialog(); - if (openDlg.ShowDialog(Handler.Widget.ParentWindow) == DialogResult.Ok) - { - wk.WebOpenPanelResultListener_Extensions.ChooseFilenames(resultListener, openDlg.Filenames.ToArray()); - } - } - #else - public override void UIRunOpenPanelForFileButton(wk.WebView sender, wk.WebOpenPanelResultListener resultListener) + public override void UIRunOpenPanelForFileButton(wk.WebView sender, IWebOpenPanelResultListener resultListener) { var openDlg = new OpenFileDialog(); if (openDlg.ShowDialog(Handler.Widget.ParentWindow) == DialogResult.Ok) { +#if MACOS_NET || MONOMAC resultListener.ChooseFilenames(openDlg.Filenames.ToArray()); +#else + wk.WebOpenPanelResultListener_Extensions.ChooseFilenames(resultListener, openDlg.Filenames.ToArray()); +#endif } } - #endif public override void UIPrintFrameView(wk.WebView sender, wk.WebFrameView frameView) { diff --git a/src/Eto.Mac/Forms/CursorHandler.cs b/src/Eto.Mac/Forms/CursorHandler.cs index 62f388a5dc..eeea6c68fe 100644 --- a/src/Eto.Mac/Forms/CursorHandler.cs +++ b/src/Eto.Mac/Forms/CursorHandler.cs @@ -2,38 +2,6 @@ using Eto.Forms; using Eto.Drawing; using System.IO; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -using ImageIO; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -using MonoMac.ImageIO; -using NSRectEdge = MonoMac.AppKit.NSRectEdge; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif namespace Eto.Mac.Forms { diff --git a/src/Eto.Mac/Forms/DataObjectHandler.cs b/src/Eto.Mac/Forms/DataObjectHandler.cs index f856af368e..629c8f0ce6 100644 --- a/src/Eto.Mac/Forms/DataObjectHandler.cs +++ b/src/Eto.Mac/Forms/DataObjectHandler.cs @@ -7,36 +7,6 @@ using System.Runtime.InteropServices; using System.Collections.Generic; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using MobileCoreServices; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.MobileCoreServices; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif - namespace Eto.Mac.Forms { public class DataFormatsHandler : DataFormats.IHandler diff --git a/src/Eto.Mac/Forms/DialogHandler.cs b/src/Eto.Mac/Forms/DialogHandler.cs index a909026712..bdb95d6b2f 100644 --- a/src/Eto.Mac/Forms/DialogHandler.cs +++ b/src/Eto.Mac/Forms/DialogHandler.cs @@ -5,37 +5,6 @@ using Eto.Forms; using Eto.Drawing; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -using NSRectEdge = MonoMac.AppKit.NSRectEdge; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif - namespace Eto.Mac.Forms { public class DialogHandler : MacWindow, Dialog.IHandler diff --git a/src/Eto.Mac/Forms/EtoDragSource.cs b/src/Eto.Mac/Forms/EtoDragSource.cs index 4be8f9cc1a..d38b8ae6fe 100644 --- a/src/Eto.Mac/Forms/EtoDragSource.cs +++ b/src/Eto.Mac/Forms/EtoDragSource.cs @@ -1,30 +1,5 @@ using System; -#if XAMMAC2 -using AppKit; -using Foundation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif namespace Eto.Mac.Forms { diff --git a/src/Eto.Mac/Forms/FloatingFormHandler.cs b/src/Eto.Mac/Forms/FloatingFormHandler.cs index f5b773e57f..922b6c68a8 100644 --- a/src/Eto.Mac/Forms/FloatingFormHandler.cs +++ b/src/Eto.Mac/Forms/FloatingFormHandler.cs @@ -1,28 +1,5 @@ using Eto.Forms; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#else -using MonoMac.AppKit; -using MonoMac.CoreGraphics; -#if Mac64 -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif - namespace Eto.Mac.Forms { public class FloatingFormHandler : FormHandler, FloatingForm.IHandler diff --git a/src/Eto.Mac/Forms/FontDialogHandler.cs b/src/Eto.Mac/Forms/FontDialogHandler.cs index 8ec9b9dbea..a39e1bb4a4 100644 --- a/src/Eto.Mac/Forms/FontDialogHandler.cs +++ b/src/Eto.Mac/Forms/FontDialogHandler.cs @@ -2,19 +2,6 @@ using Eto.Forms; using Eto.Drawing; using Eto.Mac.Drawing; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#endif namespace Eto.Mac.Forms { diff --git a/src/Eto.Mac/Forms/FormHandler.cs b/src/Eto.Mac/Forms/FormHandler.cs index 853a55ed17..e70cdf5462 100644 --- a/src/Eto.Mac/Forms/FormHandler.cs +++ b/src/Eto.Mac/Forms/FormHandler.cs @@ -1,35 +1,7 @@ using System; using Eto.Forms; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif + namespace Eto.Mac.Forms { diff --git a/src/Eto.Mac/Forms/KeyboardHandler.cs b/src/Eto.Mac/Forms/KeyboardHandler.cs index 3060e4d8b8..f93476e923 100644 --- a/src/Eto.Mac/Forms/KeyboardHandler.cs +++ b/src/Eto.Mac/Forms/KeyboardHandler.cs @@ -1,11 +1,6 @@ using System; using Eto.Forms; using System.Collections.Generic; -#if XAMMAC2 -using AppKit; -#else -using MonoMac.AppKit; -#endif namespace Eto.Mac.Forms { diff --git a/src/Eto.Mac/Forms/MacBase.cs b/src/Eto.Mac/Forms/MacBase.cs index 2859bec0cf..6793fd1f79 100644 --- a/src/Eto.Mac/Forms/MacBase.cs +++ b/src/Eto.Mac/Forms/MacBase.cs @@ -3,23 +3,6 @@ using System.Globalization; using Eto.Drawing; using Eto.Forms; -#if IOS -using NSView = UIKit.UIView; -using ObjCRuntime; -using Foundation; -#elif XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#elif OSX -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#endif namespace Eto.Mac.Forms { diff --git a/src/Eto.Mac/Forms/MacCommon.cs b/src/Eto.Mac/Forms/MacCommon.cs index 8add125cd5..38d1736a1a 100644 --- a/src/Eto.Mac/Forms/MacCommon.cs +++ b/src/Eto.Mac/Forms/MacCommon.cs @@ -1,17 +1,4 @@ using System; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#endif namespace Eto.Mac.Forms { diff --git a/src/Eto.Mac/Forms/MacContainer.cs b/src/Eto.Mac/Forms/MacContainer.cs index 260bfe63fc..4efa9e754f 100644 --- a/src/Eto.Mac/Forms/MacContainer.cs +++ b/src/Eto.Mac/Forms/MacContainer.cs @@ -4,35 +4,6 @@ using Eto.Drawing; using System.Collections.Generic; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#elif OSX -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif #if IOS using Foundation; diff --git a/src/Eto.Mac/Forms/MacControlExtensions.cs b/src/Eto.Mac/Forms/MacControlExtensions.cs index 07eb14213e..4c8be9c039 100644 --- a/src/Eto.Mac/Forms/MacControlExtensions.cs +++ b/src/Eto.Mac/Forms/MacControlExtensions.cs @@ -3,45 +3,6 @@ using System; using System.Text.RegularExpressions; - -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreText; -#elif OSX -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreText; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif - -#if IOS -using NSView = UIKit.UIView; -using NSControl = UIKit.UIControl; -using Foundation; -using CoreText; -using CoreGraphics; -using Eto.iOS; -#endif namespace Eto.Mac.Forms { public static class MacControlExtensions diff --git a/src/Eto.Mac/Forms/MacFieldEditor.cs b/src/Eto.Mac/Forms/MacFieldEditor.cs index fafa740c09..84c4ec7e5b 100644 --- a/src/Eto.Mac/Forms/MacFieldEditor.cs +++ b/src/Eto.Mac/Forms/MacFieldEditor.cs @@ -2,31 +2,6 @@ using Eto.Forms; using Eto.Mac.Forms.Controls; -#if XAMMAC2 -using AppKit; -using Foundation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif namespace Eto.Mac.Forms { diff --git a/src/Eto.Mac/Forms/MacFileDialog.cs b/src/Eto.Mac/Forms/MacFileDialog.cs index 902dbadfa3..a7d552009e 100644 --- a/src/Eto.Mac/Forms/MacFileDialog.cs +++ b/src/Eto.Mac/Forms/MacFileDialog.cs @@ -4,35 +4,7 @@ using System.IO; using System.Linq; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif + namespace Eto.Mac.Forms { diff --git a/src/Eto.Mac/Forms/MacModal.cs b/src/Eto.Mac/Forms/MacModal.cs index 85620ceb4a..3edf3349b9 100644 --- a/src/Eto.Mac/Forms/MacModal.cs +++ b/src/Eto.Mac/Forms/MacModal.cs @@ -1,18 +1,5 @@ using System; using Eto.Forms; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#endif namespace Eto.Mac.Forms { @@ -112,7 +99,11 @@ protected virtual bool RunSessionInternal() var result = (int)app.RunModalSession(Session); // Give the main loop some time: +#if MACOS_NET + NSRunLoop.Current.RunUntil(NSRunLoopMode.Default, NSDate.DistantFuture); +#else NSRunLoop.Current.RunUntil(NSRunLoop.NSDefaultRunLoopMode, NSDate.DistantFuture); +#endif var continues = result == (int)NSRun.ContinuesResponse; if (Stopped && continues) { diff --git a/src/Eto.Mac/Forms/MacObject.cs b/src/Eto.Mac/Forms/MacObject.cs index a618c33323..5f8960f23c 100644 --- a/src/Eto.Mac/Forms/MacObject.cs +++ b/src/Eto.Mac/Forms/MacObject.cs @@ -1,34 +1,5 @@ using System; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#elif OSX -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif #if IOS using Foundation; diff --git a/src/Eto.Mac/Forms/MacPanel.cs b/src/Eto.Mac/Forms/MacPanel.cs index 1ca1c8d52f..39dff35bb8 100644 --- a/src/Eto.Mac/Forms/MacPanel.cs +++ b/src/Eto.Mac/Forms/MacPanel.cs @@ -2,33 +2,6 @@ using Eto.Forms; using Eto.Drawing; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#elif OSX -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif #if IOS using NSResponder = UIKit.UIResponder; diff --git a/src/Eto.Mac/Forms/MacView.cs b/src/Eto.Mac/Forms/MacView.cs index f685ebc975..6fdc0887f5 100644 --- a/src/Eto.Mac/Forms/MacView.cs +++ b/src/Eto.Mac/Forms/MacView.cs @@ -7,39 +7,11 @@ using System.Linq; using System.Runtime.InteropServices; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -using MobileCoreServices; -#else -using MonoMac; -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -using MonoMac.MobileCoreServices; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif +#if MACOS_NET +using NSDraggingInfo = AppKit.INSDraggingInfo; #endif + namespace Eto.Mac.Forms { class MouseDelegate : NSObject @@ -350,7 +322,7 @@ static void TriggerKeyUp(IntPtr sender, IntPtr sel, IntPtr e) static bool TriggerPerformDragOperation(IntPtr sender, IntPtr sel, IntPtr draggingInfoPtr) { var handler = MacBase.GetHandler(Runtime.GetNSObject(sender)) as IMacViewHandler; - var e = handler?.GetDragEventArgs(Runtime.GetNSObject(draggingInfoPtr), null); + var e = handler?.GetDragEventArgs(Runtime.GetINativeObject(draggingInfoPtr, false), null); if (e != null) { handler.Callback.OnDragLeave(handler.Widget, e); @@ -366,7 +338,7 @@ static NSDragOperation TriggerDraggingUpdated(IntPtr sender, IntPtr sel, IntPtr var obj = Runtime.GetNSObject(sender); var effect = (NSDragOperation)Messaging.IntPtr_objc_msgSendSuper_IntPtr(obj.SuperHandle, sel, draggingInfoPtr); var handler = MacBase.GetHandler(Runtime.GetNSObject(sender)) as IMacViewHandler; - var e = handler?.GetDragEventArgs(Runtime.GetNSObject(draggingInfoPtr), null); + var e = handler?.GetDragEventArgs(Runtime.GetINativeObject(draggingInfoPtr, false), null); if (e != null) { @@ -384,7 +356,7 @@ static NSDragOperation TriggerDraggingEntered(IntPtr sender, IntPtr sel, IntPtr var obj = Runtime.GetNSObject(sender); var effect = (NSDragOperation)Messaging.IntPtr_objc_msgSendSuper_IntPtr(obj.SuperHandle, sel, draggingInfoPtr); var handler = MacBase.GetHandler(Runtime.GetNSObject(sender)) as IMacViewHandler; - var draggingInfo = Runtime.GetNSObject(draggingInfoPtr); + var draggingInfo = Runtime.GetINativeObject(draggingInfoPtr, false); var e = handler?.GetDragEventArgs(draggingInfo, null); if (e != null) { @@ -401,7 +373,7 @@ static void TriggerDraggingExited(IntPtr sender, IntPtr sel, IntPtr draggingInfo { var obj = Runtime.GetNSObject(sender); var handler = MacBase.GetHandler(Runtime.GetNSObject(sender)) as IMacViewHandler; - var e = handler?.GetDragEventArgs(Runtime.GetNSObject(draggingInfoPtr), null); + var e = handler?.GetDragEventArgs(Runtime.GetINativeObject(draggingInfoPtr, false), null); if (e != null) { handler.Callback.OnDragLeave(handler.Widget, e); @@ -1300,11 +1272,11 @@ public virtual void DoDragDrop(DataObject data, DragEffects allowedAction, Image s_etoDragImageType = UTType.CreatePreferredIdentifier(UTType.TagClassNSPboardType, "eto.dragimage", UTType.Image); pasteboardItem.SetStringForType(string.Empty, s_etoDragImageType); -#if XAMMAC2 - var draggingItem = new NSDraggingItem(pasteboardItem); -#else +#if MONOMAC var draggingItem = new NSDraggingItem(NSObjectFlag.Empty); Messaging.bool_objc_msgSend_IntPtr(draggingItem.Handle, MacView.selInitWithPasteboardWriter_Handle, pasteboardItem.Handle); +#else + var draggingItem = new NSDraggingItem(pasteboardItem); #endif var mouseLocation = PointFromScreen(Mouse.Position); diff --git a/src/Eto.Mac/Forms/MacViewTextInput.cs b/src/Eto.Mac/Forms/MacViewTextInput.cs index 434c2edcb9..c434930d49 100644 --- a/src/Eto.Mac/Forms/MacViewTextInput.cs +++ b/src/Eto.Mac/Forms/MacViewTextInput.cs @@ -5,28 +5,6 @@ using Eto.Forms; using System.Diagnostics; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -using MobileCoreServices; -#else -using MonoMac; -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -using MonoMac.MobileCoreServices; -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#endif - namespace Eto.Mac.Forms { class MacViewTextInput diff --git a/src/Eto.Mac/Forms/MacWindow.cs b/src/Eto.Mac/Forms/MacWindow.cs index f6b2b85f47..8594a5e850 100644 --- a/src/Eto.Mac/Forms/MacWindow.cs +++ b/src/Eto.Mac/Forms/MacWindow.cs @@ -5,37 +5,6 @@ using Eto.Forms; using System.Threading; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -using Eto.Mac.Forms.Controls; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif - namespace Eto.Mac.Forms { public class EtoWindow : NSWindow, IMacControl @@ -499,7 +468,8 @@ static void HandleWillMove(object sender, EventArgs e) handler.oldLocation = newLocation; } // check for mouse up event - tracking = NSApplication.SharedApplication.NextEventEx(NSEventMask.LeftMouseUp, null, NSRunLoop.NSRunLoopEventTracking, false) == null; + + tracking = NSApplication.SharedApplication.NextEvent(NSEventMask.LeftMouseUp, null, NSRunLoopMode.EventTracking, false) == null; }); } handler.oldLocation = null; diff --git a/src/Eto.Mac/Forms/MemoryDataObjectHandler.cs b/src/Eto.Mac/Forms/MemoryDataObjectHandler.cs index ecd4697030..39996cc174 100644 --- a/src/Eto.Mac/Forms/MemoryDataObjectHandler.cs +++ b/src/Eto.Mac/Forms/MemoryDataObjectHandler.cs @@ -5,33 +5,6 @@ using System.Linq; using System.Collections.Generic; -#if XAMMAC2 -using AppKit; -using Foundation; -using ObjCRuntime; -using MobileCoreServices; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.MobileCoreServices; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif namespace Eto.Mac.Forms { diff --git a/src/Eto.Mac/Forms/Menu/ButtonMenuItemHandler.cs b/src/Eto.Mac/Forms/Menu/ButtonMenuItemHandler.cs index 7db16b8d7a..5132adef91 100644 --- a/src/Eto.Mac/Forms/Menu/ButtonMenuItemHandler.cs +++ b/src/Eto.Mac/Forms/Menu/ButtonMenuItemHandler.cs @@ -2,19 +2,6 @@ using Eto.Drawing; using Eto.Forms; using Eto.Mac.Forms.Actions; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#endif namespace Eto.Mac.Forms.Menu { diff --git a/src/Eto.Mac/Forms/Menu/CheckMenuItemHandler.cs b/src/Eto.Mac/Forms/Menu/CheckMenuItemHandler.cs index 5e4006cc22..fe764b734f 100644 --- a/src/Eto.Mac/Forms/Menu/CheckMenuItemHandler.cs +++ b/src/Eto.Mac/Forms/Menu/CheckMenuItemHandler.cs @@ -1,21 +1,6 @@ using System; using Eto.Forms; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; - -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#endif - namespace Eto.Mac.Forms.Menu { public class CheckMenuItemHandler : MenuHandler, CheckMenuItem.IHandler, IMenuActionHandler diff --git a/src/Eto.Mac/Forms/Menu/ContextMenuHandler.cs b/src/Eto.Mac/Forms/Menu/ContextMenuHandler.cs index f15b992abc..174fbdb926 100644 --- a/src/Eto.Mac/Forms/Menu/ContextMenuHandler.cs +++ b/src/Eto.Mac/Forms/Menu/ContextMenuHandler.cs @@ -1,35 +1,7 @@ using System; using Eto.Forms; using Eto.Drawing; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif + namespace Eto.Mac.Forms.Menu { diff --git a/src/Eto.Mac/Forms/Menu/MenuActionHandler.cs b/src/Eto.Mac/Forms/Menu/MenuActionHandler.cs index 9ce1712c9c..fdaf788be0 100644 --- a/src/Eto.Mac/Forms/Menu/MenuActionHandler.cs +++ b/src/Eto.Mac/Forms/Menu/MenuActionHandler.cs @@ -1,18 +1,5 @@ using System; using Eto.Forms; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#endif namespace Eto.Mac.Forms.Menu { diff --git a/src/Eto.Mac/Forms/Menu/MenuBarHandler.cs b/src/Eto.Mac/Forms/Menu/MenuBarHandler.cs index a479fd8043..468ded18ad 100644 --- a/src/Eto.Mac/Forms/Menu/MenuBarHandler.cs +++ b/src/Eto.Mac/Forms/Menu/MenuBarHandler.cs @@ -6,19 +6,6 @@ using System.Collections.ObjectModel; using System; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#endif namespace Eto.Mac.Forms.Menu { diff --git a/src/Eto.Mac/Forms/Menu/MenuHandler.cs b/src/Eto.Mac/Forms/Menu/MenuHandler.cs index 9b58433e2f..cab1249f1a 100644 --- a/src/Eto.Mac/Forms/Menu/MenuHandler.cs +++ b/src/Eto.Mac/Forms/Menu/MenuHandler.cs @@ -2,19 +2,6 @@ using Eto.Mac.Forms.Actions; using System; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#endif namespace Eto.Mac.Forms.Menu { diff --git a/src/Eto.Mac/Forms/Menu/RadioMenuItemHandler.cs b/src/Eto.Mac/Forms/Menu/RadioMenuItemHandler.cs index 849a49cd9a..327813dfbb 100644 --- a/src/Eto.Mac/Forms/Menu/RadioMenuItemHandler.cs +++ b/src/Eto.Mac/Forms/Menu/RadioMenuItemHandler.cs @@ -3,21 +3,6 @@ using System.Collections.Generic; using System.Linq; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; - -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#endif - namespace Eto.Mac.Forms.Menu { public class RadioMenuItemHandler : MenuHandler, RadioMenuItem.IHandler, IMenuActionHandler diff --git a/src/Eto.Mac/Forms/Menu/SeparatorMenuItem.cs b/src/Eto.Mac/Forms/Menu/SeparatorMenuItem.cs index 3ceb3fd23f..9a49c892b2 100644 --- a/src/Eto.Mac/Forms/Menu/SeparatorMenuItem.cs +++ b/src/Eto.Mac/Forms/Menu/SeparatorMenuItem.cs @@ -1,18 +1,5 @@ using System; using Eto.Forms; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#endif namespace Eto.Mac.Forms.Menu { diff --git a/src/Eto.Mac/Forms/Menu/SubMenuItemHandler.cs b/src/Eto.Mac/Forms/Menu/SubMenuItemHandler.cs index 4bd0180512..1aba6a419c 100644 --- a/src/Eto.Mac/Forms/Menu/SubMenuItemHandler.cs +++ b/src/Eto.Mac/Forms/Menu/SubMenuItemHandler.cs @@ -1,18 +1,5 @@ using System; using Eto.Forms; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#endif namespace Eto.Mac.Forms.Menu { diff --git a/src/Eto.Mac/Forms/MessageBoxHandler.cs b/src/Eto.Mac/Forms/MessageBoxHandler.cs index 05c2650bf8..63b43dd9c0 100644 --- a/src/Eto.Mac/Forms/MessageBoxHandler.cs +++ b/src/Eto.Mac/Forms/MessageBoxHandler.cs @@ -1,25 +1,6 @@ using System; using Eto.Forms; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#endif - namespace Eto.Mac.Forms { public class MessageBoxHandler : MessageBox.IHandler diff --git a/src/Eto.Mac/Forms/MouseHandler.cs b/src/Eto.Mac/Forms/MouseHandler.cs index ae2a6e60ea..4109aedc26 100644 --- a/src/Eto.Mac/Forms/MouseHandler.cs +++ b/src/Eto.Mac/Forms/MouseHandler.cs @@ -2,37 +2,6 @@ using Eto.Forms; using System.Runtime.InteropServices; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#else -using MonoMac; -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif - namespace Eto.Mac.Forms { public class MouseHandler : Mouse.IHandler diff --git a/src/Eto.Mac/Forms/NativeFormHandler.cs b/src/Eto.Mac/Forms/NativeFormHandler.cs index 4b15fd2d27..0676fd0d5f 100644 --- a/src/Eto.Mac/Forms/NativeFormHandler.cs +++ b/src/Eto.Mac/Forms/NativeFormHandler.cs @@ -1,18 +1,5 @@ using System; using Eto.Drawing; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#endif namespace Eto.Mac.Forms { diff --git a/src/Eto.Mac/Forms/NotificationHandler.cs b/src/Eto.Mac/Forms/NotificationHandler.cs index d0b010ea57..96d296c594 100644 --- a/src/Eto.Mac/Forms/NotificationHandler.cs +++ b/src/Eto.Mac/Forms/NotificationHandler.cs @@ -4,35 +4,6 @@ using System.Collections.Generic; using System.Linq; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#elif OSX -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif namespace Eto.Mac.Forms { diff --git a/src/Eto.Mac/Forms/OpenFileDialog.cs b/src/Eto.Mac/Forms/OpenFileDialog.cs index e03c9299e0..b50b42d1e8 100644 --- a/src/Eto.Mac/Forms/OpenFileDialog.cs +++ b/src/Eto.Mac/Forms/OpenFileDialog.cs @@ -2,35 +2,7 @@ using Eto.Forms; using System.Collections.Generic; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif + namespace Eto.Mac.Forms { diff --git a/src/Eto.Mac/Forms/OpenWithDialogHandler.cs b/src/Eto.Mac/Forms/OpenWithDialogHandler.cs index bc9fdeab01..f44ffc9217 100644 --- a/src/Eto.Mac/Forms/OpenWithDialogHandler.cs +++ b/src/Eto.Mac/Forms/OpenWithDialogHandler.cs @@ -2,35 +2,7 @@ using System.Diagnostics; using Eto.Forms; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif + namespace Eto.Mac.Forms { diff --git a/src/Eto.Mac/Forms/PixelLayoutHandler.cs b/src/Eto.Mac/Forms/PixelLayoutHandler.cs index 1641263987..808cd3145d 100644 --- a/src/Eto.Mac/Forms/PixelLayoutHandler.cs +++ b/src/Eto.Mac/Forms/PixelLayoutHandler.cs @@ -5,35 +5,7 @@ using System.Linq; using Eto.Mac.Forms.Controls; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif + namespace Eto.Mac.Forms { diff --git a/src/Eto.Mac/Forms/Printing/PrintDialogHandler.cs b/src/Eto.Mac/Forms/Printing/PrintDialogHandler.cs index 51b9bf5bb7..4d4a5af50b 100644 --- a/src/Eto.Mac/Forms/Printing/PrintDialogHandler.cs +++ b/src/Eto.Mac/Forms/Printing/PrintDialogHandler.cs @@ -1,18 +1,5 @@ using System; using Eto.Forms; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#endif namespace Eto.Mac.Forms.Printing { diff --git a/src/Eto.Mac/Forms/Printing/PrintDocumentHandler.cs b/src/Eto.Mac/Forms/Printing/PrintDocumentHandler.cs index 4c011eac96..a320ee6aae 100644 --- a/src/Eto.Mac/Forms/Printing/PrintDocumentHandler.cs +++ b/src/Eto.Mac/Forms/Printing/PrintDocumentHandler.cs @@ -2,33 +2,6 @@ using Eto.Forms; using Eto.Drawing; using Eto.Mac.Drawing; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif namespace Eto.Mac.Forms.Printing { diff --git a/src/Eto.Mac/Forms/Printing/PrintSettingsHandler.cs b/src/Eto.Mac/Forms/Printing/PrintSettingsHandler.cs index 321e7b36b6..602c0e2be7 100644 --- a/src/Eto.Mac/Forms/Printing/PrintSettingsHandler.cs +++ b/src/Eto.Mac/Forms/Printing/PrintSettingsHandler.cs @@ -1,18 +1,5 @@ using System; using Eto.Forms; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#endif namespace Eto.Mac.Forms.Printing { diff --git a/src/Eto.Mac/Forms/SaveFileDialogHandler.cs b/src/Eto.Mac/Forms/SaveFileDialogHandler.cs index b0bb16bef5..e7443dfa43 100644 --- a/src/Eto.Mac/Forms/SaveFileDialogHandler.cs +++ b/src/Eto.Mac/Forms/SaveFileDialogHandler.cs @@ -1,18 +1,5 @@ using System; using Eto.Forms; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#endif namespace Eto.Mac.Forms { diff --git a/src/Eto.Mac/Forms/ScreenHandler.cs b/src/Eto.Mac/Forms/ScreenHandler.cs index 1d0840aae8..95b7498409 100644 --- a/src/Eto.Mac/Forms/ScreenHandler.cs +++ b/src/Eto.Mac/Forms/ScreenHandler.cs @@ -3,19 +3,6 @@ using Eto.Drawing; using System.Runtime.InteropServices; using Eto.Mac.Drawing; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#endif namespace Eto.Mac.Forms { @@ -89,7 +76,7 @@ public Image GetImage(RectangleF rect) var logicalRect = rect; logicalRect.Size *= Widget.LogicalPixelSize; var cgimagePtr = CGDisplayCreateImageForRect(id.UInt32Value, logicalRect.ToNS()); -#if XAMMAC +#if XAMMAC || MACOS_NET var cgimage = Runtime.GetINativeObject(cgimagePtr, true); #else var cgimage = cgimagePtr == IntPtr.Zero ? null : new CGImage(cgimagePtr); diff --git a/src/Eto.Mac/Forms/ScreensHandler.cs b/src/Eto.Mac/Forms/ScreensHandler.cs index 98fc9906f1..d55e80d84a 100644 --- a/src/Eto.Mac/Forms/ScreensHandler.cs +++ b/src/Eto.Mac/Forms/ScreensHandler.cs @@ -1,18 +1,5 @@ using Eto.Forms; using System.Collections.Generic; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#endif namespace Eto.Mac.Forms { diff --git a/src/Eto.Mac/Forms/SelectFolderDialogHandler.cs b/src/Eto.Mac/Forms/SelectFolderDialogHandler.cs index a1c10fa480..499bca32b9 100644 --- a/src/Eto.Mac/Forms/SelectFolderDialogHandler.cs +++ b/src/Eto.Mac/Forms/SelectFolderDialogHandler.cs @@ -1,18 +1,5 @@ using System; using Eto.Forms; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#endif namespace Eto.Mac.Forms { diff --git a/src/Eto.Mac/Forms/TableLayoutHandler.cs b/src/Eto.Mac/Forms/TableLayoutHandler.cs index 8729978785..c2e3bcd144 100644 --- a/src/Eto.Mac/Forms/TableLayoutHandler.cs +++ b/src/Eto.Mac/Forms/TableLayoutHandler.cs @@ -3,35 +3,6 @@ using System.Linq; using Eto.Drawing; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#elif OSX -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif #if IOS using UIKit; @@ -44,10 +15,10 @@ #elif OSX using Eto.Mac.Forms.Controls; -#if XAMMAC2 -using BaseMacContainer = Eto.Mac.Forms.MacContainer; -#else +#if MONOMAC using BaseMacContainer = Eto.Mac.Forms.MacContainer; +#else +using BaseMacContainer = Eto.Mac.Forms.MacContainer; #endif #endif diff --git a/src/Eto.Mac/Forms/TaskbarHandler.cs b/src/Eto.Mac/Forms/TaskbarHandler.cs index 2ea460145b..3d96547fe6 100644 --- a/src/Eto.Mac/Forms/TaskbarHandler.cs +++ b/src/Eto.Mac/Forms/TaskbarHandler.cs @@ -2,25 +2,6 @@ using System.Diagnostics; using Eto.Forms; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#endif - namespace Eto.Mac.Forms { public class TaskbarHandler : Taskbar.IHandler diff --git a/src/Eto.Mac/Forms/ToolBar/ButtonToolItemHandler.cs b/src/Eto.Mac/Forms/ToolBar/ButtonToolItemHandler.cs index 930906b15b..5b32679f0b 100644 --- a/src/Eto.Mac/Forms/ToolBar/ButtonToolItemHandler.cs +++ b/src/Eto.Mac/Forms/ToolBar/ButtonToolItemHandler.cs @@ -1,18 +1,5 @@ using System; using Eto.Forms; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#endif namespace Eto.Mac.Forms.ToolBar { diff --git a/src/Eto.Mac/Forms/ToolBar/CheckToolItemHandler.cs b/src/Eto.Mac/Forms/ToolBar/CheckToolItemHandler.cs index ae97efb98e..ffd93ef347 100644 --- a/src/Eto.Mac/Forms/ToolBar/CheckToolItemHandler.cs +++ b/src/Eto.Mac/Forms/ToolBar/CheckToolItemHandler.cs @@ -1,18 +1,5 @@ using System; using Eto.Forms; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#endif namespace Eto.Mac.Forms.ToolBar { diff --git a/src/Eto.Mac/Forms/ToolBar/RadioToolItemHandler.cs b/src/Eto.Mac/Forms/ToolBar/RadioToolItemHandler.cs index c62f250a80..44232b264a 100644 --- a/src/Eto.Mac/Forms/ToolBar/RadioToolItemHandler.cs +++ b/src/Eto.Mac/Forms/ToolBar/RadioToolItemHandler.cs @@ -1,19 +1,6 @@ using System; using Eto.Forms; using System.Linq; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#endif namespace Eto.Mac.Forms.ToolBar { diff --git a/src/Eto.Mac/Forms/ToolBar/SeparatorToolItemHandler.cs b/src/Eto.Mac/Forms/ToolBar/SeparatorToolItemHandler.cs index da21d70288..22ab4e516d 100644 --- a/src/Eto.Mac/Forms/ToolBar/SeparatorToolItemHandler.cs +++ b/src/Eto.Mac/Forms/ToolBar/SeparatorToolItemHandler.cs @@ -2,33 +2,6 @@ using System; using Eto.Drawing; using Eto.Mac.Drawing; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif namespace Eto.Mac.Forms.ToolBar { diff --git a/src/Eto.Mac/Forms/ToolBar/ToolBarHandler.cs b/src/Eto.Mac/Forms/ToolBar/ToolBarHandler.cs index 33f0b19311..575a413d41 100644 --- a/src/Eto.Mac/Forms/ToolBar/ToolBarHandler.cs +++ b/src/Eto.Mac/Forms/ToolBar/ToolBarHandler.cs @@ -4,33 +4,6 @@ using System.Collections.Generic; using Eto.Drawing; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif namespace Eto.Mac.Forms.ToolBar { @@ -59,14 +32,14 @@ public DividerToolbarItem(bool willBeInserted) : base(DividerIdentifier) View.AutoresizingMask = NSViewResizingMask.HeightSizable | NSViewResizingMask.WidthSizable; PaletteLabel = Application.Instance.Localize(this, "Divider"); MenuFormRepresentation = NSMenuItem.SeparatorItem; -#if MONOMAC || XAMMAC2 if (supportsSeparatorColor) +#if XAMMAC2 _color = NSColor.SeparatorColor.ToEto(); - else - _color = new Color(SystemColors.WindowBackground, 0.5f); #else - _color = new Color(SystemColors.WindowBackground, 0.5f); + _color = NSColor.Separator.ToEto(); #endif + else + _color = new Color(SystemColors.WindowBackground, 0.5f); } public override bool AllowsDuplicatesInToolbar => true; diff --git a/src/Eto.Mac/Forms/ToolBar/ToolItemHandler.cs b/src/Eto.Mac/Forms/ToolBar/ToolItemHandler.cs index 6edffe4bbe..656f602d70 100644 --- a/src/Eto.Mac/Forms/ToolBar/ToolItemHandler.cs +++ b/src/Eto.Mac/Forms/ToolBar/ToolItemHandler.cs @@ -2,33 +2,6 @@ using Eto.Forms; using Eto.Drawing; using Eto.Mac.Forms.Actions; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif namespace Eto.Mac.Forms.ToolBar { diff --git a/src/Eto.Mac/Forms/TrayIndicatorHandler.cs b/src/Eto.Mac/Forms/TrayIndicatorHandler.cs index 382ed79a93..4abb8c6938 100644 --- a/src/Eto.Mac/Forms/TrayIndicatorHandler.cs +++ b/src/Eto.Mac/Forms/TrayIndicatorHandler.cs @@ -2,35 +2,6 @@ using Eto.Forms; using Eto.Drawing; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#elif OSX -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif namespace Eto.Mac.Forms { diff --git a/src/Eto.Mac/Forms/UITimerHandler.cs b/src/Eto.Mac/Forms/UITimerHandler.cs index 7ce29cd228..a58c091840 100644 --- a/src/Eto.Mac/Forms/UITimerHandler.cs +++ b/src/Eto.Mac/Forms/UITimerHandler.cs @@ -3,19 +3,6 @@ #if IOS using Foundation; #else -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#endif #endif #if IOS @@ -34,10 +21,10 @@ class Helper WeakReference handler; public UITimerHandler Handler { get { return (UITimerHandler)handler.Target; } set { handler = new WeakReference(value); } } - #if XAMMAC2 || IOS - public void Elapsed(NSTimer timer) - #else + #if MONOMAC public void Elapsed() + #else + public void Elapsed(NSTimer timer) #endif { var h = Handler; diff --git a/src/Eto.Mac/Forms/WindowHandler.cs b/src/Eto.Mac/Forms/WindowHandler.cs index a3afe023cf..a098369c12 100644 --- a/src/Eto.Mac/Forms/WindowHandler.cs +++ b/src/Eto.Mac/Forms/WindowHandler.cs @@ -1,19 +1,6 @@ using Eto.Drawing; using Eto.Forms; using System.Linq; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#endif namespace Eto.Mac.Forms { diff --git a/src/Eto.Mac/Forms/iosCompatibility.cs b/src/Eto.Mac/Forms/iosCompatibility.cs index fa7c15f566..92c810a1b1 100644 --- a/src/Eto.Mac/Forms/iosCompatibility.cs +++ b/src/Eto.Mac/Forms/iosCompatibility.cs @@ -1,16 +1,3 @@ -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#endif namespace Eto.Mac.Forms { diff --git a/src/Eto.Mac/IO/SystemIconsHandler.cs b/src/Eto.Mac/IO/SystemIconsHandler.cs index 90ef1d46aa..7baea88fa6 100644 --- a/src/Eto.Mac/IO/SystemIconsHandler.cs +++ b/src/Eto.Mac/IO/SystemIconsHandler.cs @@ -4,35 +4,7 @@ using Eto.Mac.Drawing; using System; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif + namespace Eto.Mac.IO { diff --git a/src/Eto.Mac/KeyMap.cs b/src/Eto.Mac/KeyMap.cs index 12cd5f2021..db5964b8bd 100644 --- a/src/Eto.Mac/KeyMap.cs +++ b/src/Eto.Mac/KeyMap.cs @@ -2,35 +2,7 @@ using Eto.Forms; using System.Diagnostics; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif + namespace Eto.Mac { diff --git a/src/Eto.Mac/Mac64Extensions.cs b/src/Eto.Mac/Mac64Extensions.cs index e447484a78..2d610c9a83 100644 --- a/src/Eto.Mac/Mac64Extensions.cs +++ b/src/Eto.Mac/Mac64Extensions.cs @@ -1,38 +1,6 @@ using System; using Eto.Drawing; using System.Runtime.InteropServices; -#if IOS -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#elif XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#elif OSX -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif #if IOS namespace Eto.iOS diff --git a/src/Eto.Mac/MacConversions.cs b/src/Eto.Mac/MacConversions.cs index 04f1606519..3ed8772a1f 100644 --- a/src/Eto.Mac/MacConversions.cs +++ b/src/Eto.Mac/MacConversions.cs @@ -7,37 +7,6 @@ using System.Linq; using Eto.Mac.Forms.Menu; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -using ImageIO; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -using MonoMac.ImageIO; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif namespace Eto.Mac { diff --git a/src/Eto.Mac/MacConversions.ns.cs b/src/Eto.Mac/MacConversions.ns.cs index dc5c132360..57f3eeaac5 100644 --- a/src/Eto.Mac/MacConversions.ns.cs +++ b/src/Eto.Mac/MacConversions.ns.cs @@ -1,17 +1,4 @@ using System; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#endif namespace Eto.Mac { diff --git a/src/Eto.Mac/MacExtensions.cs b/src/Eto.Mac/MacExtensions.cs index bb5871afb8..8991d78796 100644 --- a/src/Eto.Mac/MacExtensions.cs +++ b/src/Eto.Mac/MacExtensions.cs @@ -1,35 +1,5 @@ using System; using System.Runtime.InteropServices; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -using CoreFoundation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif namespace Eto.Mac { @@ -54,12 +24,6 @@ public static CGRect BoundingRect(this NSAttributedString str, CGSize size, NSSt static readonly IntPtr selNextEventMatchingMask = Selector.GetHandle("nextEventMatchingMask:untilDate:inMode:dequeue:"); - // untilDate isn't allowed null - public static NSEvent NextEventEx(this NSApplication app, NSEventMask mask, NSDate untilDate, NSString mode, bool dequeue) - { - return Runtime.GetNSObject(Messaging.IntPtr_objc_msgSend_nuint_IntPtr_IntPtr_bool(app.Handle, selNextEventMatchingMask, (nuint)(uint)mask, untilDate != null ? untilDate.Handle : IntPtr.Zero, mode.Handle, dequeue)); - } - static readonly IntPtr selDrawGlyphs = Selector.GetHandle("drawGlyphsForGlyphRange:atPoint:"); @@ -87,7 +51,7 @@ public static void Release(IntPtr handle) // replacementString should allow nulls public static bool ShouldChangeTextNew(this NSTextView textView, NSRange affectedCharRange, string replacementString) { -#if XAMMAC && NET6_0_OR_GREATER +#if USE_CFSTRING IntPtr intPtr = replacementString != null ? CFString.CreateNative(replacementString) : IntPtr.Zero; bool result; result = Messaging.bool_objc_msgSend_NSRange_IntPtr(textView.Handle, selShouldChangeTextInRangeReplacementString_Handle, affectedCharRange, intPtr); @@ -128,7 +92,7 @@ public static bool CanReadItemWithDataConformingToTypes(this NSPasteboard pasteb } -#if !XAMMAC +#if MONOMAC public static void DangerousRetain(this NSObject obj) { obj.Retain(); diff --git a/src/Eto.Mac/MacHelpers.cs b/src/Eto.Mac/MacHelpers.cs index cb2ebca675..6806ebb554 100644 --- a/src/Eto.Mac/MacHelpers.cs +++ b/src/Eto.Mac/MacHelpers.cs @@ -5,20 +5,12 @@ using Eto.Mac.Forms.Controls; using Eto.Drawing; -#if XAMMAC2 -using AppKit; -using Foundation; -using ObjCRuntime; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.ObjCRuntime; -#endif - namespace Eto.Forms { public static class -#if XAMMAC2 +#if MACOS_NET + MacOSHelpers +#elif XAMMAC2 XamMac2Helpers #elif XAMMAC XamMacHelpers diff --git a/src/Eto.Mac/MacVersion.cs b/src/Eto.Mac/MacVersion.cs index a65b8ddf3c..0e5b882efe 100644 --- a/src/Eto.Mac/MacVersion.cs +++ b/src/Eto.Mac/MacVersion.cs @@ -1,12 +1,5 @@ using System; using System.Runtime.InteropServices; -#if XAMMAC2 -using Foundation; -using ObjCRuntime; -#else -using MonoMac.Foundation; -using MonoMac.ObjCRuntime; -#endif namespace Eto.Mac { @@ -39,7 +32,7 @@ public static bool IsAtLeast(int major, int minor, int patch = 0) static MacVersion() { -#if XAMMAC +#if !MONOMAC // TODO: Can't use IsOperatingSystemAtLeastVersion in monomac yet, it's not mapped. if (NSProcessInfo.ProcessInfo.RespondsToSelector(new Selector("operatingSystemVersion"))) { diff --git a/src/Eto.Mac/Messaging.cs b/src/Eto.Mac/Messaging.cs index 05fed6d2dc..253cb6bd40 100644 --- a/src/Eto.Mac/Messaging.cs +++ b/src/Eto.Mac/Messaging.cs @@ -1,39 +1,6 @@ using System; using System.Runtime.InteropServices; -#if IOS -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#elif XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#elif OSX -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif - #if IOS namespace Eto.iOS #else diff --git a/src/Eto.Mac/NSImageExtensions.cs b/src/Eto.Mac/NSImageExtensions.cs index 44c91b0418..47f0959e72 100644 --- a/src/Eto.Mac/NSImageExtensions.cs +++ b/src/Eto.Mac/NSImageExtensions.cs @@ -1,34 +1,6 @@ using System; using Eto.Drawing; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif + namespace Eto.Mac { @@ -45,12 +17,12 @@ public static NSImage Resize(this NSImage image, CGSize newsize, ImageInterpolat NSGraphicsContext.GlobalSaveGraphicsState(); NSGraphicsContext.CurrentContext = graphics; graphics.GraphicsPort.InterpolationQuality = interpolation.ToCG(); - image.DrawInRect(new CGRect(CGPoint.Empty, newimage.Size), CGRect.Empty, NSCompositingOperation.SourceOver, 1f); + image.Draw(new CGRect(CGPoint.Empty, newimage.Size), CGRect.Empty, NSCompositingOperation.SourceOver, 1f); NSGraphicsContext.GlobalRestoreGraphicsState(); return newimage; } -#if XAMMAC +#if XAMMAC || MACOS_NET static IntPtr selDrawInRect_FromRect_Operation_Fraction_RespectFlipped_Hints_Handle = Selector.GetHandle("drawInRect:fromRect:operation:fraction:respectFlipped:hints:"); #endif @@ -63,7 +35,7 @@ public static NSImageRep Resize(this NSImageRep image, CGSize newsize, ImageInte NSGraphicsContext.GlobalSaveGraphicsState(); NSGraphicsContext.CurrentContext = graphics; graphics.GraphicsPort.InterpolationQuality = interpolation.ToCG(); -#if XAMMAC +#if XAMMAC || MACOS_NET // Xamarin.Mac doesn't allow null for hints, remove this when it does. Messaging.bool_objc_msgSend_CGRect_CGRect_UIntPtr_nfloat_bool_IntPtr(image.Handle, selDrawInRect_FromRect_Operation_Fraction_RespectFlipped_Hints_Handle, new CGRect(CGPoint.Empty, newrep.Size), CGRect.Empty, (UIntPtr)(ulong)NSCompositingOperation.SourceOver, 1f, true, IntPtr.Zero); #else @@ -80,10 +52,9 @@ public static NSImage Tint(this NSImage image, NSColor tint) Color = CIColor.FromCGColor(tint.ToCG()) }; -#pragma warning disable CS0618 // Image => InputImage in Xamarin.Mac 6.6 var colorFilter = new CIColorControls { - Image = (CIImage)colorGenerator.ValueForKey(CIFilterOutputKey.Image), + InputImage = (CIImage)colorGenerator.ValueForKey(CIFilterOutputKey.Image), Saturation = 3f, Brightness = 0.35f, Contrast = 1f @@ -91,17 +62,16 @@ public static NSImage Tint(this NSImage image, NSColor tint) var monochromeFilter = new CIColorMonochrome { - Image = CIImage.FromCGImage(image.CGImage), + InputImage = CIImage.FromCGImage(image.CGImage), Color = CIColor.FromRgb(0.75f, 0.75f, 0.75f), Intensity = 1f }; var compositingFilter = new CIMultiplyCompositing { - Image = (CIImage)colorFilter.ValueForKey(CIFilterOutputKey.Image), + InputImage = (CIImage)colorFilter.ValueForKey(CIFilterOutputKey.Image), BackgroundImage = (CIImage)monochromeFilter.ValueForKey(CIFilterOutputKey.Image) }; -#pragma warning restore CS0618 var outputImage = (CIImage)compositingFilter.ValueForKey(CIFilterOutputKey.Image); var extent = outputImage.Extent; diff --git a/src/Eto.Mac/ObjCExtensions.cs b/src/Eto.Mac/ObjCExtensions.cs index 78adbceb7e..efc7be7b86 100644 --- a/src/Eto.Mac/ObjCExtensions.cs +++ b/src/Eto.Mac/ObjCExtensions.cs @@ -1,21 +1,5 @@ using System; using System.Runtime.InteropServices; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#elif OSX -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#elif IOS -using ObjCRuntime; -using Eto.iOS; -#endif namespace Eto.Mac { diff --git a/src/Eto.Mac/Platform.cs b/src/Eto.Mac/Platform.cs index 7224aea28e..71b789bdcb 100644 --- a/src/Eto.Mac/Platform.cs +++ b/src/Eto.Mac/Platform.cs @@ -17,35 +17,7 @@ using Eto.Shared.Forms; using Eto.Forms.ThemedControls; -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -using CoreImage; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -using MonoMac.CoreImage; -#if Mac64 -using nfloat = System.Double; -using nint = System.Int64; -using nuint = System.UInt64; -#else -using nfloat = System.Single; -using nint = System.Int32; -using nuint = System.UInt32; -#endif -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif -#endif + namespace Eto.Mac { @@ -59,7 +31,9 @@ public class Platform : Eto.Platform public override bool IsMac { get { return true; } } -#if XAMMAC2 +#if MACOS_NET + public override string ID { get { return "macOS"; } } +#elif XAMMAC2 public override string ID { get { return "XamMac2"; } } #elif XAMMAC1 public override string ID { get { return "XamMac"; } } diff --git a/src/Eto.Mac/Threading/ThreadHandler.cs b/src/Eto.Mac/Threading/ThreadHandler.cs index 6e19fa90c1..9cc5ca0195 100644 --- a/src/Eto.Mac/Threading/ThreadHandler.cs +++ b/src/Eto.Mac/Threading/ThreadHandler.cs @@ -2,19 +2,6 @@ using Eto.Threading; #if OSX -#if XAMMAC2 -using AppKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; -using CoreAnimation; -#else -using MonoMac.AppKit; -using MonoMac.Foundation; -using MonoMac.CoreGraphics; -using MonoMac.ObjCRuntime; -using MonoMac.CoreAnimation; -#endif namespace Eto.Mac.Threading #elif IOS diff --git a/src/Eto.Mac/build/BundleDotNetCore.targets b/src/Eto.Mac/build/BundleDotNetCore.targets index 23d2123ae3..dfeed4012f 100644 --- a/src/Eto.Mac/build/BundleDotNetCore.targets +++ b/src/Eto.Mac/build/BundleDotNetCore.targets @@ -1,6 +1,7 @@ - + - + + @@ -48,6 +49,9 @@ + @@ -62,6 +66,7 @@ CreateNoWindow = true, RedirectStandardOutput = true, RedirectStandardError = true, + UseShellExecute = false, FileName = command, Arguments = args } diff --git a/src/Eto.Mac/build/Dmg.targets b/src/Eto.Mac/build/Dmg.targets index adc8a301a6..caac4c3f68 100644 --- a/src/Eto.Mac/build/Dmg.targets +++ b/src/Eto.Mac/build/Dmg.targets @@ -74,7 +74,8 @@ - + + $(MSBuildProjectDirectory)\$(DmgBackgroundImage) diff --git a/src/Eto.Mac/build/README.txt b/src/Eto.Mac/build/README.txt index 8a7e4fc602..09f2e01d54 100644 --- a/src/Eto.Mac/build/README.txt +++ b/src/Eto.Mac/build/README.txt @@ -1,9 +1,10 @@ -This package will create a macOS application that runs on OS X using Eto.Forms. +This package will create a macOS application that runs on Mac using Eto.Forms. -If you are using Xamarin Studio on OS X, you can use a Xamarin.Mac project to embed -the mono runtime with your app. This template creates an app that will require the user -to install the mono runtime. +If you are using Visual Studio for Mac, you can use a Xamarin.Mac or net6.0-macos +project to embed the runtime with your app. + +This template creates an app that will require the user to install the mono runtime. The nuget package automatically adds a targets file to your project, which will package up your application into $(TargetName).app in the output directory. @@ -27,5 +28,7 @@ Add Mac/Info.plist and set these properties: Notes: - - The MacOS/MyProject must have the executable bit set. Simply zipping the .app folder - and unzipping on OS X will set things up properly. \ No newline at end of file + - If you compile on Windows/Linux then download to a Mac, you must execute these commands to run the app: + + xattr -c MyApp.app + chmod +x MyApp.app/Contents/MacOS/MyApp diff --git a/src/Eto.Mac/build/RunConfiguration.Default.targets b/src/Eto.Mac/build/RunConfiguration.Default.targets index 27bb5dc758..831cb5abb3 100644 --- a/src/Eto.Mac/build/RunConfiguration.Default.targets +++ b/src/Eto.Mac/build/RunConfiguration.Default.targets @@ -1,8 +1,8 @@ - - Program - $(_MacRunConfigurationStartPath) - false - + + Program + $(_MacRunConfigurationStartPath) + false + \ No newline at end of file diff --git a/src/Eto.Mac/build/RunConfiguration.DotNetRun.targets b/src/Eto.Mac/build/RunConfiguration.DotNetRun.targets deleted file mode 100644 index e9ba2188f0..0000000000 --- a/src/Eto.Mac/build/RunConfiguration.DotNetRun.targets +++ /dev/null @@ -1,10 +0,0 @@ - - - - Program - - run - . - false - - \ No newline at end of file diff --git a/src/Eto.Mac/build/RunConfiguration.Mac.targets b/src/Eto.Mac/build/RunConfiguration.Mac.targets index 18ef16a652..ce338034b1 100644 --- a/src/Eto.Mac/build/RunConfiguration.Mac.targets +++ b/src/Eto.Mac/build/RunConfiguration.Mac.targets @@ -1,8 +1,8 @@ - - Program - $(_MacRunConfigurationStartPath) - false - + + Program + $(_MacRunConfigurationStartPath) + false + \ No newline at end of file diff --git a/src/Eto.sln b/src/Eto.sln index e408a23153..19f49c18cb 100644 --- a/src/Eto.sln +++ b/src/Eto.sln @@ -68,6 +68,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "generator", "..\lib\monomac EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Eto.Forms.Templates", "Eto.Forms.Templates\Eto.Forms.Templates.csproj", "{AC238CEB-D54C-4DC5-A141-C3B8CC0E384D}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Eto.macOS", "Eto.Mac\Eto.macOS.csproj", "{0C899B62-5F6D-4B12-AA52-814AF3B69AF9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Eto.Test.macOS", "..\test\Eto.Test.Mac\Eto.Test.macOS.csproj", "{A5237C58-9EF0-4A34-A1F6-9D4C394A7EE4}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Linux = Debug|Linux @@ -330,11 +334,28 @@ Global {AC238CEB-D54C-4DC5-A141-C3B8CC0E384D}.Release|Mac.Build.0 = Release|Any CPU {AC238CEB-D54C-4DC5-A141-C3B8CC0E384D}.Release|Windows.ActiveCfg = Release|Any CPU {AC238CEB-D54C-4DC5-A141-C3B8CC0E384D}.Release|Windows.Build.0 = Release|Any CPU + {0C899B62-5F6D-4B12-AA52-814AF3B69AF9}.Debug|Linux.ActiveCfg = Debug|Any CPU + {0C899B62-5F6D-4B12-AA52-814AF3B69AF9}.Debug|Mac.ActiveCfg = Debug|Any CPU + {0C899B62-5F6D-4B12-AA52-814AF3B69AF9}.Debug|Mac.Build.0 = Debug|Any CPU + {0C899B62-5F6D-4B12-AA52-814AF3B69AF9}.Debug|Windows.ActiveCfg = Debug|Any CPU + {0C899B62-5F6D-4B12-AA52-814AF3B69AF9}.Release|Linux.ActiveCfg = Release|Any CPU + {0C899B62-5F6D-4B12-AA52-814AF3B69AF9}.Release|Mac.ActiveCfg = Release|Any CPU + {0C899B62-5F6D-4B12-AA52-814AF3B69AF9}.Release|Mac.Build.0 = Release|Any CPU + {0C899B62-5F6D-4B12-AA52-814AF3B69AF9}.Release|Windows.ActiveCfg = Release|Any CPU + {A5237C58-9EF0-4A34-A1F6-9D4C394A7EE4}.Debug|Linux.ActiveCfg = Debug|Any CPU + {A5237C58-9EF0-4A34-A1F6-9D4C394A7EE4}.Debug|Mac.ActiveCfg = Debug|Any CPU + {A5237C58-9EF0-4A34-A1F6-9D4C394A7EE4}.Debug|Mac.Build.0 = Debug|Any CPU + {A5237C58-9EF0-4A34-A1F6-9D4C394A7EE4}.Debug|Windows.ActiveCfg = Debug|Any CPU + {A5237C58-9EF0-4A34-A1F6-9D4C394A7EE4}.Release|Linux.ActiveCfg = Release|Any CPU + {A5237C58-9EF0-4A34-A1F6-9D4C394A7EE4}.Release|Mac.ActiveCfg = Release|Any CPU + {A5237C58-9EF0-4A34-A1F6-9D4C394A7EE4}.Release|Mac.Build.0 = Release|Any CPU + {A5237C58-9EF0-4A34-A1F6-9D4C394A7EE4}.Release|Windows.ActiveCfg = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution + {A5237C58-9EF0-4A34-A1F6-9D4C394A7EE4} = {E121B009-AB4B-4585-B3FB-D70E3DF8D3CC} {DD0C2B40-CA55-11E3-9C1A-0800200C9A66} = {E121B009-AB4B-4585-B3FB-D70E3DF8D3CC} {B5BC1D10-24ED-441C-A4D6-1F3AB9FF3689} = {E121B009-AB4B-4585-B3FB-D70E3DF8D3CC} {063AF7E7-18BD-488F-85BF-53B6E3D75685} = {E121B009-AB4B-4585-B3FB-D70E3DF8D3CC} diff --git a/src/Eto/Platform.cs b/src/Eto/Platform.cs index 6fb25501f6..277687bd24 100644 --- a/src/Eto/Platform.cs +++ b/src/Eto/Platform.cs @@ -393,14 +393,11 @@ public static Platform Detect if (EtoEnvironment.Platform.IsMac) { - if (EtoEnvironment.Is64BitProcess) - detected = Get(Platforms.Mac64, true, errors); + detected = Get(Platforms.Mac64, true, errors); if (detected == null) - detected = Get(Platforms.XamMac2, true, errors); - if (detected == null) - detected = Get(Platforms.XamMac, true, errors); + detected = Get(Platforms.macOS, true, errors); if (detected == null) - detected = Get(Platforms.Mac, true, errors); + detected = Get(Platforms.XamMac2, true, errors); } else if (EtoEnvironment.Platform.IsWindows) { diff --git a/src/Eto/Platforms.cs b/src/Eto/Platforms.cs index b91d6893c2..16e9ae9ee6 100644 --- a/src/Eto/Platforms.cs +++ b/src/Eto/Platforms.cs @@ -30,31 +30,27 @@ public static class Platforms [Obsolete("Gtk3 platform is obsolete, please use Platforms.Gtk instead.")] public static readonly string Gtk3 = "Eto.GtkSharp.Platform, Eto.Gtk3"; /// - /// Type of the Mac OS X platform - /// - public static readonly string Mac = "Eto.Mac.Platform, Eto.Mac"; - /// - /// Type of the Mac OS X platform on 64-bit mono + /// Type of the macOS platform on .NET 6+ or mono /// public static readonly string Mac64 = "Eto.Mac.Platform, Eto.Mac64"; /// - /// Type of the Xamarin.Mac v1 OS X platform + /// Type of the Xamarin.Mac v2 macOS platform on mono /// - public static readonly string XamMac = "Eto.Mac.Platform, Eto.XamMac"; + public static readonly string XamMac2 = "Eto.Mac.Platform, Eto.XamMac2"; /// - /// Type of the Xamarin.Mac v2 OS X platform + /// Type of the macOS platform on .NET 6.0.2xx+ SDK /// - public static readonly string XamMac2 = "Eto.Mac.Platform, Eto.XamMac2"; + public static readonly string macOS = "Eto.Mac.Platform, Eto.macOS"; /// - /// Type of the Windows forms platform + /// Type of the Windows Forms platform /// public static readonly string WinForms = "Eto.WinForms.Platform, Eto.WinForms"; /// - /// ID of the WPF platform + /// Type of the WPF platform /// public static readonly string Wpf = "Eto.Wpf.Platform, Eto.Wpf"; /// - /// ID of the Android platform + /// Type of the Android platform /// public static readonly string Android = "Eto.Android.Platform, Eto.Android"; } diff --git a/src/Eto/sdk/Sdk.targets b/src/Eto/sdk/Sdk.targets index 1e9cf00d1e..b75feaeb06 100755 --- a/src/Eto/sdk/Sdk.targets +++ b/src/Eto/sdk/Sdk.targets @@ -4,14 +4,16 @@ Windows True + True Wpf Windows - Mac64 + Mac64 XamMac2 + MacOS Gtk @@ -19,8 +21,8 @@ <_TfmSuffix Condition="$(BuildPlatform) == 'Wpf' or $(BuildPlatform) == 'Windows'">-windows - - <_TfmSuffix Condition="$(BuildPlatform) == 'XamMac2'">-macos + + <_TfmSuffix Condition="$(BuildPlatform) == 'MacOS'">-macos WinExe @@ -66,12 +68,12 @@ - osx-x64;osx-arm64 + osx-x64;osx-arm64 win-x64 linux-x64 - + diff --git a/src/Shared/PlatformDetect.cs b/src/Shared/PlatformDetect.cs index cb5d307933..e85f6d28ce 100644 --- a/src/Shared/PlatformDetect.cs +++ b/src/Shared/PlatformDetect.cs @@ -5,11 +5,9 @@ namespace Eto { - #if XAMMAC2 - [Foundation.Preserve(AllMembers = true)] - #elif OSX - [MonoMac.Foundation.Preserve(AllMembers = true)] - #endif +#if OSX + [Preserve(AllMembers = true)] +#endif static class PlatformDetect { [DllImport("libc")] diff --git a/test/Directory.Build.props b/test/Directory.Build.props index fd8a5270b9..1f3a787b85 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -3,6 +3,6 @@ False - $(BasePath)artifacts\test\ + $(BasePath)artifacts\test\$(MSBuildProjectName)\ \ No newline at end of file diff --git a/test/Eto.Test.Mac/Eto.Test.Mac64.csproj b/test/Eto.Test.Mac/Eto.Test.Mac64.csproj index 8f2f077c7b..74f5a1bfb3 100644 --- a/test/Eto.Test.Mac/Eto.Test.Mac64.csproj +++ b/test/Eto.Test.Mac/Eto.Test.Mac64.csproj @@ -10,6 +10,7 @@ WinExe osx-x64;osx-arm64 + MONOMAC @@ -27,9 +28,6 @@ - - - diff --git a/test/Eto.Test.Mac/Eto.Test.XamMac2.csproj b/test/Eto.Test.Mac/Eto.Test.XamMac2.csproj index 546fd575b7..680bff1fa1 100644 --- a/test/Eto.Test.Mac/Eto.Test.XamMac2.csproj +++ b/test/Eto.Test.Mac/Eto.Test.XamMac2.csproj @@ -3,20 +3,20 @@ True Exe - net6.0-macos;net48;xamarinmac20 - osx-x64;osx-arm64 + net48;xamarinmac20 Eto.Test.Mac False False Mac Developer 3rd Party Mac Developer Installer --nowarn:2006 --nowarn:0176 + $(MonoBundlingExtraArgs) --registrar:dynamic XAMMAC;XAMMAC2 10.15 CA1416 - + SdkOnly @@ -46,10 +46,6 @@ - - - - - + \ No newline at end of file diff --git a/test/Eto.Test.Mac/Eto.Test.macOS.csproj b/test/Eto.Test.Mac/Eto.Test.macOS.csproj new file mode 100644 index 0000000000..9a6d044fb8 --- /dev/null +++ b/test/Eto.Test.Mac/Eto.Test.macOS.csproj @@ -0,0 +1,46 @@ + + + + Exe + net6.0-macos + osx-x64;osx-arm64 + Eto.Test.Mac + False + False + Mac Developer + 3rd Party Mac Developer Installer + --nowarn:2006 --nowarn:0176 + MACOS_NET + 10.15 + CA1416 + + SdkOnly + + + + + + + + + + + + + + + + + + + PreserveNewest + + + + + + + + + + \ No newline at end of file diff --git a/test/Eto.Test.Mac/Startup.cs b/test/Eto.Test.Mac/Startup.cs index 95920c20f1..c4948bd3ca 100644 --- a/test/Eto.Test.Mac/Startup.cs +++ b/test/Eto.Test.Mac/Startup.cs @@ -6,10 +6,10 @@ using Eto.Mac.Forms.ToolBar; using Eto.Forms; -#if XAMMAC2 -using AppKit; -#else +#if MONOMAC using MonoMac.AppKit; +#else +using AppKit; #endif namespace Eto.Test.Mac diff --git a/test/Eto.Test.Mac/UnitTests/BitmapTests.cs b/test/Eto.Test.Mac/UnitTests/BitmapTests.cs index 7e26bce43e..5c7ea3ad26 100644 --- a/test/Eto.Test.Mac/UnitTests/BitmapTests.cs +++ b/test/Eto.Test.Mac/UnitTests/BitmapTests.cs @@ -3,12 +3,12 @@ using Eto.Test.UnitTests; using NUnit.Framework; -#if XAMMAC2 -using AppKit; -using CoreGraphics; -#else +#if MONOMAC using MonoMac.AppKit; using MonoMac.CoreGraphics; +#else +using AppKit; +using CoreGraphics; #endif namespace Eto.Test.Mac.UnitTests diff --git a/test/Eto.Test.Mac/UnitTests/ButtonTests.cs b/test/Eto.Test.Mac/UnitTests/ButtonTests.cs index cfb080755d..f9599b65c5 100644 --- a/test/Eto.Test.Mac/UnitTests/ButtonTests.cs +++ b/test/Eto.Test.Mac/UnitTests/ButtonTests.cs @@ -7,19 +7,14 @@ using System.Runtime.ExceptionServices; using System.Threading.Tasks; using Eto.Mac; -#if XAMMAC2 -using AppKit; -using CoreGraphics; -#else + +#if MONOMAC using MonoMac.AppKit; using MonoMac.CoreGraphics; -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif +#else +using AppKit; +using CoreGraphics; #endif - namespace Eto.Test.Mac.UnitTests { [TestFixture] diff --git a/test/Eto.Test.Mac/UnitTests/CheckBoxTests.cs b/test/Eto.Test.Mac/UnitTests/CheckBoxTests.cs index 60012ceb47..44731c1e98 100644 --- a/test/Eto.Test.Mac/UnitTests/CheckBoxTests.cs +++ b/test/Eto.Test.Mac/UnitTests/CheckBoxTests.cs @@ -4,17 +4,13 @@ using Eto.Mac.Forms.Controls; using Eto.Test.UnitTests; using NUnit.Framework; -#if XAMMAC2 -using AppKit; -using CoreGraphics; -#else + +#if MONOMAC using MonoMac.AppKit; using MonoMac.CoreGraphics; -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif +#else +using AppKit; +using CoreGraphics; #endif namespace Eto.Test.Mac.UnitTests diff --git a/test/Eto.Test.Mac/UnitTests/IconTests.cs b/test/Eto.Test.Mac/UnitTests/IconTests.cs index 33f8c5f178..f638ef0961 100644 --- a/test/Eto.Test.Mac/UnitTests/IconTests.cs +++ b/test/Eto.Test.Mac/UnitTests/IconTests.cs @@ -4,12 +4,13 @@ using Eto.Test.UnitTests; using NUnit.Framework; using Eto.Mac; -#if XAMMAC2 -using AppKit; -using CoreGraphics; -#else + +#if MONOMAC using MonoMac.AppKit; using MonoMac.CoreGraphics; +#else +using AppKit; +using CoreGraphics; #endif namespace Eto.Test.Mac64.UnitTests diff --git a/test/Eto.Test.Mac/UnitTests/NativeParentWindowTests.cs b/test/Eto.Test.Mac/UnitTests/NativeParentWindowTests.cs index d1ee9cc8c0..d903428dd7 100644 --- a/test/Eto.Test.Mac/UnitTests/NativeParentWindowTests.cs +++ b/test/Eto.Test.Mac/UnitTests/NativeParentWindowTests.cs @@ -4,17 +4,12 @@ using Eto.Forms; using System.Threading; -#if XAMMAC2 -using AppKit; -using CoreGraphics; -#else +#if MONOMAC using MonoMac.AppKit; using MonoMac.CoreGraphics; -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif +#else +using AppKit; +using CoreGraphics; #endif namespace Eto.Test.Mac.UnitTests diff --git a/test/Eto.Test.Mac/UnitTests/RadioButtonTests.cs b/test/Eto.Test.Mac/UnitTests/RadioButtonTests.cs index 0856eddb7c..9d38407222 100644 --- a/test/Eto.Test.Mac/UnitTests/RadioButtonTests.cs +++ b/test/Eto.Test.Mac/UnitTests/RadioButtonTests.cs @@ -4,17 +4,13 @@ using Eto.Mac.Forms.Controls; using Eto.Test.UnitTests; using NUnit.Framework; -#if XAMMAC2 -using AppKit; -using CoreGraphics; -#else + +#if MONOMAC using MonoMac.AppKit; using MonoMac.CoreGraphics; -#if SDCOMPAT -using CGSize = System.Drawing.SizeF; -using CGRect = System.Drawing.RectangleF; -using CGPoint = System.Drawing.PointF; -#endif +#else +using AppKit; +using CoreGraphics; #endif namespace Eto.Test.Mac.UnitTests