diff --git a/.github/workflows/build-gtk.yml b/.github/workflows/build-gtk.yml new file mode 100644 index 000000000000..04ced063e254 --- /dev/null +++ b/.github/workflows/build-gtk.yml @@ -0,0 +1,50 @@ +name: Build Controls.Sample.Gtk +on: [push, pull_request] + +jobs: + build_and_test: + name: Build & Test + runs-on: ubuntu-22.04 + env: + GtkSharpVersion: 3.24.24.117-develop + GtkSharpManifestVersion: 8.0.200 + DotnetVersion: 8.0.200 + steps: + - name: Checkout MAUI repo + uses: actions/checkout@v2 + - name: Setup .NET SDK ${{ env.DotnetVersion }} + uses: actions/setup-dotnet@v1.7.2 + with: + dotnet-version: ${{ env.DotnetVersion }} + - name: Install gtk workload + run: | + # For some reason automatic workload manifest detection doesn't work (see https://github.com/GtkSharp/GtkSharp/issues/355#issuecomment-1446262239), so download and uzip mainfest file manually + dotnet nuget add source --name nuget.org "https://api.nuget.org/v3/index.json" + wget https://www.nuget.org/api/v2/package/gtksharp.net.sdk.gtk.manifest-${{ env.GtkSharpManifestVersion }}/$GtkSharpVersion -O gtksharp.net.sdk.gtk.manifest-${{ env.GtkSharpManifestVersion }}.nupkg + DOTNET_DIR=/home/runner/.dotnet + WORKLOAD_MANIFEST_DIR=$DOTNET_DIR/sdk-manifests/${{ env.DotnetVersion }}/gtksharp.net.sdk.gtk + mkdir -p $WORKLOAD_MANIFEST_DIR + unzip -j gtksharp.net.sdk.gtk.manifest-${{ env.GtkSharpManifestVersion }}.nupkg "data/*" -d $WORKLOAD_MANIFEST_DIR/ + rm gtksharp.net.sdk.gtk.manifest-${{ env.GtkSharpManifestVersion }}.nupkg + chmod 764 $WORKLOAD_MANIFEST_DIR/* + dotnet workload search + dotnet workload install gtk --skip-manifest-update + - name: Build MAUI + run: | + sed -i 's/_IncludeAndroid>true/_IncludeAndroid>/g' Directory.Build.Override.props + dotnet build Microsoft.Maui.BuildTasks.slnf + dotnet build Microsoft.Maui.Gtk.slnf + + dotnet-format: + needs: build_and_test + runs-on: ubuntu-22.04 + steps: + - name: Checkout repo + uses: actions/checkout@v2 + + - name: Run dotnet format + run: | + # remark: doesnt work, alwasy fails: + # dotnet format whitespace ./src --folder --exclude Templates/src + git diff --exit-code + diff --git a/.gitignore b/.gitignore index 69887dd81422..afa55e5f2c8a 100644 --- a/.gitignore +++ b/.gitignore @@ -372,7 +372,7 @@ FodyWeavers.xsd local.properties # Directory Build overrides for local setups -Directory.Build.Override.props +#Directory.Build.Override.props # Only the "snapshots" directory should be added to Git, not the "snapshots-diff" directory snapshots-diff/ diff --git a/Directory.Build.Override.props b/Directory.Build.Override.props new file mode 100644 index 000000000000..3ec3a76eb25b --- /dev/null +++ b/Directory.Build.Override.props @@ -0,0 +1,30 @@ + + + + + <_IncludeWindows> + <_IncludeTizen> + <_IncludeGtk>true + <_IncludeAndroid>true + <_IncludeIos> + <_IncludeMacCatalyst> + <_IncludeMacOS> + <_IncludeNoPlatforms> + + + + <_SpecificPlatformRequested Condition="'$(_IncludeGtk)' == 'true' OR '$(_IncludeAndroid)' == 'true' OR '$(_IncludeWindows)' == 'true' OR '$(_IncludeTizen)' == 'true' OR '$(_IncludeIos)' == 'true' OR '$(_IncludeMacCatalyst)' == 'true' OR '$(_IncludeMacOS)' == 'true'">true + false + false + false + false + false + false + false + true + + + + diff --git a/Directory.Build.Override.props.in b/Directory.Build.Override.props.in index c04c2e7095b8..66a22c93e65c 100644 --- a/Directory.Build.Override.props.in +++ b/Directory.Build.Override.props.in @@ -6,6 +6,7 @@ --> <_IncludeWindows> <_IncludeTizen> + <_IncludeGtk> <_IncludeAndroid> <_IncludeIos> <_IncludeMacCatalyst> @@ -13,13 +14,14 @@ - <_SpecificPlatformRequested Condition="'$(_IncludeAndroid)' == 'true' OR '$(_IncludeWindows)' == 'true' OR '$(_IncludeTizen)' == 'true' OR '$(_IncludeIos)' == 'true' OR '$(_IncludeMacCatalyst)' == 'true' OR '$(_IncludeMacOS)' == 'true'">true + <_SpecificPlatformRequested Condition="'$(_IncludeAndroid)' == 'true' OR '$(_IncludeWindows)' == 'true' OR '$(_IncludeTizen)' == 'true' OR '$(_IncludeIos)' == 'true' OR '$(_IncludeMacCatalyst)' == 'true' OR '$(_IncludeGtk)' == 'true'">true false false false false false false + false diff --git a/Directory.Build.props b/Directory.Build.props index 5ce21d045967..7abf80742891 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,12 +1,12 @@ - + <_MauiDotNetVersionMajor Condition="'$(_MauiDotNetVersionMajor)' == ''">8 <_MauiDotNetVersionMinor Condition="'$(_MauiDotNetVersionMinor)' == ''">0 <_MauiDotNetVersion Condition="'$(_MauiDotNetVersion)' == ''">$(_MauiDotNetVersionMajor).$(_MauiDotNetVersionMinor) <_MauiDotNetTfm Condition="'$(_MauiDotNetTfm)' == ''">net$(_MauiDotNetVersion) - + <_MauiPreviousDotNetVersionMajor Condition="'$(_MauiPreviousDotNetVersionMajor)' == ''">7 <_MauiPreviousDotNetVersionMinor Condition="'$(_MauiPreviousDotNetVersionMinor)' == ''">0 <_MauiPreviousDotNetVersion Condition="'$(_MauiPreviousDotNetVersion)' == ''">$(_MauiPreviousDotNetVersionMajor).$(_MauiPreviousDotNetVersionMinor) @@ -30,6 +30,8 @@ <_MauiTargetPlatformIsWindows Condition="$(_MauiTargetPlatformIdentifier.Contains('windows')) == 'True'">True <_MauiTargetPlatformIsTizen>false <_MauiTargetPlatformIsTizen Condition="'$(_MauiTargetPlatformIdentifier)' == 'tizen'">True + <_MauiTargetPlatformIsGtk>false + <_MauiTargetPlatformIsGtk Condition="'$(_MauiTargetPlatformIdentifier)' == 'gtk'">True @@ -47,9 +49,11 @@ $([System.Text.RegularExpressions.Regex]::Match($([System.IO.File]::ReadAllText('$(DotNetWorkloadInstallLocation)\microsoft.net.sdk.macos\WorkloadManifest.json')), '$(DotNetWorkloadVersionRegex)')) $([System.Text.RegularExpressions.Regex]::Match($([System.IO.File]::ReadAllText('$(DotNetWorkloadInstallLocation)\samsung.net.sdk.tizen\WorkloadManifest.json')), $(DotNetWorkloadVersionRegex))) + $([System.Text.RegularExpressions.Regex]::Match($([System.IO.File]::ReadAllText('$(DotNetWorkloadInstallLocation)\GtkSharp.NET.Sdk.Gtk\WorkloadManifest.json')), $(DotNetWorkloadVersionRegex))) true true + true true true @@ -57,6 +61,7 @@ true true true + true false true @@ -92,9 +97,10 @@ 10.0.19041.0 10.0.20348.0 6.5 + 3.24.24.95 - + @@ -105,6 +111,7 @@ net$(_MauiDotNetVersion)-android;$(MauiPlatforms) net$(_MauiDotNetVersion)-maccatalyst;$(MauiPlatforms) net$(_MauiDotNetVersion)-ios;$(MauiPlatforms) + net$(_MauiDotNetVersion)-gtk;$(MauiPlatforms) net$(_MauiPreviousDotNetVersion)-windows$(WindowsTargetFrameworkVersion);net$(_MauiPreviousDotNetVersion)-windows$(Windows2TargetFrameworkVersion) net$(_MauiPreviousDotNetVersion)-tizen;$(MauiPreviousPlatforms) @@ -173,14 +180,15 @@ $(MSBuildThisFileDirectory)THIRD-PARTY-NOTICES.TXT dotnet-maui;dotnet;maui;cross-platform;ios;android;macos;maccatalyst;windows;winui;tizen true + $(NoWarn);RS0016;RS0017;CA1822;CA1805;CS0649;CS1589 - - - - + + + + - + @@ -188,4 +196,7 @@ true + + + diff --git a/Microsoft.Maui.Graphics.slnf b/Microsoft.Maui.Graphics.slnf index b3ab761d769f..0b3bcba48995 100644 --- a/Microsoft.Maui.Graphics.slnf +++ b/Microsoft.Maui.Graphics.slnf @@ -13,9 +13,11 @@ "src\\Graphics\\samples\\GraphicsTester.Skia.Windows\\GraphicsTester.Skia.Windows.csproj", "src\\Graphics\\samples\\GraphicsTester.WinUI.Desktop\\GraphicsTester.WinUI.Desktop.csproj", "src\\Graphics\\samples\\GraphicsTester.iOS\\GraphicsTester.iOS.csproj", + "src\\Graphics\\samples\\GraphicsTester.Gtk\\GraphicsTester.Gtk.csproj", "src\\Graphics\\src\\Graphics.Skia.GtkSharp\\Graphics.Skia.GtkSharp.csproj", "src\\Graphics\\src\\Graphics.Skia.WPF\\Graphics.Skia.WPF.csproj", "src\\Graphics\\src\\Graphics.Skia\\Graphics.Skia.csproj", + "src\\Graphics\\src\\Graphics.Gtk\\Graphics.Gtk.csproj", "src\\Graphics\\src\\Graphics.Win2D\\Graphics.Win2D.csproj", "src\\Graphics\\src\\Graphics\\Graphics.csproj", "src\\Graphics\\src\\Text.Markdig\\Graphics.Text.Markdig.csproj", @@ -23,4 +25,4 @@ "src\\Graphics\\tests\\Graphics.Tests\\Graphics.Tests.csproj" ] } -} \ No newline at end of file +} diff --git a/Microsoft.Maui.Gtk.slnf b/Microsoft.Maui.Gtk.slnf new file mode 100644 index 000000000000..a45a8f95510c --- /dev/null +++ b/Microsoft.Maui.Gtk.slnf @@ -0,0 +1,32 @@ +{ + "solution": { + "path": "Microsoft.Maui.sln", + "projects": [ + "src\\BlazorWebView\\samples\\BlazorGtkApp\\BlazorGtkApp.csproj", + "src\\BlazorWebView\\samples\\MauiRazorClassLibrarySample\\MauiRazorClassLibrarySample.csproj", + "src\\BlazorWebView\\samples\\WebViewAppShared\\WebViewAppShared.csproj", + "src\\BlazorWebView\\src\\Gtk\\Microsoft.AspNetCore.Components.WebView.Gtk.csproj", + "src\\BlazorWebView\\src\\Maui\\Microsoft.AspNetCore.Components.WebView.Maui.csproj", + "src\\Compatibility\\Core\\src\\Compatibility.csproj", + "src\\Controls\\samples\\Controls.Sample.Gtk\\Controls.Sample.Gtk.csproj", + "src\\Controls\\samples\\Controls.Sample\\Maui.Controls.Sample.csproj", + "src\\Controls\\src\\Build.Tasks\\Controls.Build.Tasks.csproj", + "src\\Controls\\src\\Core\\Controls.Core.csproj", + "src\\Controls\\src\\Xaml\\Controls.Xaml.csproj", + "src\\Core\\src\\Core.csproj", + "src\\Essentials\\src\\Essentials.csproj", + "src\\Graphics\\samples\\GraphicsTester.Gtk\\GraphicsTester.Gtk.csproj", + "src\\Graphics\\samples\\GraphicsTester.Portable\\GraphicsTester.Portable.csproj", + "src\\Graphics\\samples\\GraphicsTester.Skia.Console\\GraphicsTester.Skia.Console.csproj", + "src\\Graphics\\samples\\GraphicsTester.Skia.Gtk\\GraphicsTester.Skia.Gtk.csproj", + "src\\Graphics\\src\\Graphics.Gtk\\Graphics.Gtk.csproj", + "src\\Graphics\\src\\Graphics.Skia.GtkSharp\\Graphics.Skia.GtkSharp.csproj", + "src\\Graphics\\src\\Graphics.Skia\\Graphics.Skia.csproj", + "src\\Graphics\\src\\Graphics\\Graphics.csproj", + "src\\Graphics\\src\\Text.Markdig\\Graphics.Text.Markdig.csproj", + "src\\Graphics\\tests\\Graphics.Benchmarks\\Graphics.Benchmarks.csproj", + "src\\Graphics\\tests\\Graphics.Tests\\Graphics.Tests.csproj", + "src\\SingleProject\\Resizetizer\\src\\Resizetizer.csproj" + ] + } +} \ No newline at end of file diff --git a/Microsoft.Maui.sln b/Microsoft.Maui.sln index 3ae8942ce0ec..eb53276c2992 100644 --- a/Microsoft.Maui.sln +++ b/Microsoft.Maui.sln @@ -197,6 +197,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Graphics.Skia", "src\Graphi EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Graphics.Win2D", "src\Graphics\src\Graphics.Win2D\Graphics.Win2D.csproj", "{291F634A-2D8D-48B6-A1A0-BB9BC265D6E4}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Graphics.Gtk", "src\Graphics\src\Graphics.Gtk\Graphics.Gtk.csproj", "{4EDE89FC-7C84-4855-8DD8-D7C8B128A974}" +EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Graphics.Text.Markdig", "src\Graphics\src\Text.Markdig\Graphics.Text.Markdig.csproj", "{375B22F5-9D79-4D17-B759-F8220DFB8B70}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Graphics.Tests", "src\Graphics\tests\Graphics.Tests\Graphics.Tests.csproj", "{56BBFDBD-254F-42B6-9984-46E19C53FB00}" @@ -211,6 +213,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GraphicsTester.Mac", "src\G EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GraphicsTester.MacCatalyst", "src\Graphics\samples\GraphicsTester.MacCatalyst\GraphicsTester.MacCatalyst.csproj", "{B3DD0741-2EC3-4A54-82B7-73923DE4CF48}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GraphicsTester.Gtk", "src\Graphics\samples\GraphicsTester.Gtk\GraphicsTester.Gtk.csproj", "{624D161D-762C-45F7-9CBC-9929BA5D13EF}" +EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GraphicsTester.Portable", "src\Graphics\samples\GraphicsTester.Portable\GraphicsTester.Portable.csproj", "{546614BB-07AA-4E8E-B6AE-EBDC183C4DAB}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GraphicsTester.Skia.Console", "src\Graphics\samples\GraphicsTester.Skia.Console\GraphicsTester.Skia.Console.csproj", "{EF6ACA06-D4DF-4C21-9F65-FBFEC6325094}" @@ -255,6 +259,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UITest.Appium", "src\TestUt EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UITest.NUnit", "src\TestUtils\src\UITest.NUnit\UITest.NUnit.csproj", "{8050448A-E08F-4972-9B47-16042A5DFE82}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Controls.Sample.Gtk", "src\Controls\samples\Controls.Sample.Gtk\Controls.Sample.Gtk.csproj", "{E3FD165E-E0BE-4263-AC0E-260BA6713AD3}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorGtkApp", "src\BlazorWebView\samples\BlazorGtkApp\BlazorGtkApp.csproj", "{1FBAE048-FE7A-4D26-AF5A-23C35320A061}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNetCore.Components.WebView.Gtk", "src\BlazorWebView\src\Gtk\Microsoft.AspNetCore.Components.WebView.Gtk.csproj", "{544312DA-10C9-4B90-B21D-0C5081BA4EDD}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -644,6 +654,26 @@ Global {8050448A-E08F-4972-9B47-16042A5DFE82}.Debug|Any CPU.Build.0 = Debug|Any CPU {8050448A-E08F-4972-9B47-16042A5DFE82}.Release|Any CPU.ActiveCfg = Release|Any CPU {8050448A-E08F-4972-9B47-16042A5DFE82}.Release|Any CPU.Build.0 = Release|Any CPU + {4EDE89FC-7C84-4855-8DD8-D7C8B128A974}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4EDE89FC-7C84-4855-8DD8-D7C8B128A974}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4EDE89FC-7C84-4855-8DD8-D7C8B128A974}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4EDE89FC-7C84-4855-8DD8-D7C8B128A974}.Release|Any CPU.Build.0 = Release|Any CPU + {624D161D-762C-45F7-9CBC-9929BA5D13EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {624D161D-762C-45F7-9CBC-9929BA5D13EF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {624D161D-762C-45F7-9CBC-9929BA5D13EF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {624D161D-762C-45F7-9CBC-9929BA5D13EF}.Release|Any CPU.Build.0 = Release|Any CPU + {E3FD165E-E0BE-4263-AC0E-260BA6713AD3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E3FD165E-E0BE-4263-AC0E-260BA6713AD3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E3FD165E-E0BE-4263-AC0E-260BA6713AD3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E3FD165E-E0BE-4263-AC0E-260BA6713AD3}.Release|Any CPU.Build.0 = Release|Any CPU + {1FBAE048-FE7A-4D26-AF5A-23C35320A061}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1FBAE048-FE7A-4D26-AF5A-23C35320A061}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1FBAE048-FE7A-4D26-AF5A-23C35320A061}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1FBAE048-FE7A-4D26-AF5A-23C35320A061}.Release|Any CPU.Build.0 = Release|Any CPU + {544312DA-10C9-4B90-B21D-0C5081BA4EDD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {544312DA-10C9-4B90-B21D-0C5081BA4EDD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {544312DA-10C9-4B90-B21D-0C5081BA4EDD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {544312DA-10C9-4B90-B21D-0C5081BA4EDD}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -762,6 +792,11 @@ Global {352C2381-1DEC-4487-819D-340D1EA98FBE} = {7AC28763-9C68-4BF9-A1BA-25CBFFD2D15C} {8C8CD467-11F9-4A14-8AF3-047B2CFD19A7} = {7AC28763-9C68-4BF9-A1BA-25CBFFD2D15C} {8050448A-E08F-4972-9B47-16042A5DFE82} = {7AC28763-9C68-4BF9-A1BA-25CBFFD2D15C} + {4EDE89FC-7C84-4855-8DD8-D7C8B128A974} = {42AB9AE1-631D-4AD4-85B7-910FF0940BDB} + {624D161D-762C-45F7-9CBC-9929BA5D13EF} = {1BA0121E-0B83-4C8F-81BE-C293E7E35DCE} + {E3FD165E-E0BE-4263-AC0E-260BA6713AD3} = {E1082E26-D700-4127-9329-66D673FD2D55} + {1FBAE048-FE7A-4D26-AF5A-23C35320A061} = {A8E9400E-70DD-421F-8609-1C2FA4AE8E71} + {544312DA-10C9-4B90-B21D-0C5081BA4EDD} = {ED7F28E0-D0AF-417D-983D-3D874EEE8554} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {0B8ABEAD-D2B5-4370-A187-62B5ABE4EE50} diff --git a/Status.md b/Status.md new file mode 100644 index 000000000000..401ca3c3aa9e --- /dev/null +++ b/Status.md @@ -0,0 +1,459 @@ +We have created a detailed list to easily show the **.NET MAUI - Gtk status** and evolution. + +Note that only the Gtk-Section is actual in this Page. + +| Icon | Description | +| ----|:-------| +| ⚠️ | Pending +| ⏳ | Underway +| βœ… | Done +| πŸ’” | Never implemented in Maui.Controls for this platform + +## Overview + +To track ongoing progress, filter on the [handlers label](https://github.com/xamarin/Xamarin.Forms/labels/handlers). + +### Pages + +| API | Android | iOS / Mac Catalyst | Windows | Gtk | +| ----|:-------:|:------------------:|:-------:|:----:| +| ContentPage | βœ… | βœ… | βœ… | ⚠️ | +| FlyoutPage | ⚠️ | ⚠️ | ⚠️ | ⚠️ | +| NavigationPage | βœ… | βœ… | βœ… | ⚠️ | +| TabbedPage | βœ… | βœ… | βœ… | ⚠️ | + +### Views + +### βœ… ActivityIndicator + +| API | Android | iOS / Mac Catalyst | Windows | Gtk | +| ----|:-------:|:------------------:|:-------:|:----:| +| Color | βœ… | βœ… | βœ… | βœ… | +| IsRunning | βœ… | βœ… | βœ… | βœ… | + +### ⚠️ Button + +| API | Android | iOS / Mac Catalyst | Windows | Gtk | +| ----|:-------:|:------------------:|:-------:|:----:| +| BackgroundColor | βœ… | βœ… | βœ… | βœ… | +| BorderColor | ⚠️ | ⚠️ | ⚠️ | βœ… | +| BorderWidth | ⚠️ | ⚠️ | ⚠️ | ⚠️ | +| CharacterSpacing | βœ… | βœ… | βœ… | βœ… | +| Clicked | βœ… | βœ… | βœ… | βœ… | +| Command | βœ… | βœ… | βœ… | βœ… | +| CommandParameter | βœ… | βœ… | βœ… | ⚠️ | +| ContentLayout | ⚠️ | ⚠️ | ⚠️ | ⚠️ | +| CornerRadius | ⚠️ | ⚠️ | ⚠️ | ⚠️ | +| FontAttributes | βœ… | βœ… | βœ… | βœ… | +| FontFamily | βœ… | βœ… | βœ… | βœ… | +| FontSize | βœ… | βœ… | βœ… | βœ… | +| ImageSource | ⚠️ | ⚠️ | ⚠️ | ⚠️ | +| Padding | βœ… | βœ… | βœ… | βœ… | +| Pressed | βœ… | βœ… | βœ… | βœ… | +| Released | βœ… | βœ… | βœ… | βœ… | +| Text | βœ… | βœ… | βœ… | βœ… | +| TextColor | βœ… | βœ… | βœ… | βœ… | + + + +### βœ… CheckBox + +| API | Android | iOS / Mac Catalyst | Windows | Gtk | +| ----|:-------:|:------------------:|:-------:|:----:| +| Color | βœ… | βœ… | βœ… | βœ… | +| CheckedChanged | βœ… | βœ… | βœ… | βœ… | +| IsChecked | βœ… | βœ… | βœ… | βœ… | + +### βœ… DatePicker + +| API | Android | iOS / Mac Catalyst | Windows | Gtk | +| ----|:-------:|:------------------:|:-------:|:----:| +| BackgroundColor | βœ… | βœ… | βœ… | ⚠️ | +| CharacterSpacing | βœ… | βœ… | βœ… | ⚠️ | +| Date | βœ… | βœ… | βœ… | ⚠️ | +| DateSelected | βœ… | βœ… | βœ… | ⚠️ | +| FontAttributes | βœ… | βœ… | βœ… | ⚠️ | +| FontFamily | βœ… | βœ… | βœ… | ⚠️ | +| FontSize | βœ… | βœ… | βœ… | ⚠️ | +| Format | βœ… | βœ… | βœ… | ⚠️ | +| MaximumDate | βœ… | βœ… | βœ… | ⚠️ | +| MinimumDate | βœ… | βœ… | βœ… | ⚠️ | +| TextColor | βœ… | βœ… | βœ… | ⚠️ | + +### ⚠️ Editor + +| API | Android | iOS / Mac Catalyst | Windows | Gtk | +| ----|:-------:|:------------------:|:-------:|:----:| +| AutoSize | ⏳ | ⏳ | ⏳ | ⚠️ | +| Completed | βœ… | βœ… | βœ… | ⚠️ | +| CharacterSpacing | βœ… | βœ… | βœ… | ⚠️ | +| FontAttributes | βœ… | βœ… | βœ… | βœ… | +| FontFamily | βœ… | βœ… | βœ… | βœ… +| FontSize | βœ… | βœ… | βœ… | βœ… +| IsReadOnly | βœ… | βœ… | βœ… | βœ… +| IsTextPredictionEnabled | βœ… | βœ… | ⏳ |⚠️ +| PlaceHolder | βœ… | βœ… | βœ… | ⚠️ +| PlaceHolderColor | βœ… | βœ… | βœ… | ⚠️ +| Text | βœ… | βœ… | βœ… | βœ… | +| TextColor | βœ… | βœ… | βœ… | βœ… | +| MaxLength | βœ… | βœ… | βœ… | ⚠️ + +### ⚠️ Entry + +| API | Android | iOS / Mac Catalyst | Windows | Gtk | +| ----|:-------:|:------------------:|:-------:|:----:| +| ClearButtonVisibility | βœ… | βœ… | βœ… | ⚠️ +| CharacterSpacing | βœ… | βœ… | βœ… | βœ… | +| Completed | βœ… | βœ… | βœ… | ⚠️ +| CursorPosition | βœ… | βœ… | ⚠️ | βœ… +| FontAttributes | βœ… | βœ… | βœ… | βœ… +| FontFamily | βœ… | βœ… | βœ… | βœ… +| FontSize | βœ… | βœ… | βœ… | βœ… +| HorizontalTextAlignment | βœ… | βœ… | ⏳ | βœ… | +| IsTextPredictionEnabled | βœ… | βœ… | ⏳ | ⚠️ +| IsPassword | βœ… | βœ… | ⏳ | βœ… +| PlaceHolder | βœ… | βœ… | βœ… | βœ… +| PlaceHolderColor | ⏳ | ⏳ | ⏳ | ⚠️ +| VerticalTextAlignment | ⏳ | ⏳ | ⏳ | ⚠️ +| ReturnCommand | βœ… | βœ… | βœ… | ⚠️ +| ReturnCommandParameter | βœ… | βœ… | βœ… | ⚠️ +| ReturnType | βœ… | βœ… | βœ… | ⚠️ +| SelectionLength | βœ… | βœ… | ⚠️ | βœ… +| Text | βœ… | βœ… | βœ… | βœ… +| TextColor | βœ… | βœ… | βœ… | βœ… + +### ⚠️ Frame + +| API | Android | iOS / Mac Catalyst | Windows | Gtk | +| ----|:-------:|:------------------:|:-------:|:----:| +| BorderColor | ⏳ | ⏳ | ⚠️ | ⚠️ | +| CornerRadius | ⏳ | ⏳ | ⚠️ | ⚠️ | +| HasShadow | ⏳ | ⏳ | ⚠️ | ⚠️ | + + + +### βœ… Image + +| API | Android | iOS / Mac Catalyst | Windows | Gtk | +| ----|:-------:|:------------------:|:-------:|:----:| +| Aspect | βœ… | βœ… | βœ… | ⚠️ | +| IsLoading | βœ… | βœ… | βœ… | βœ… | +| Source | βœ… | βœ… | βœ… | βœ… | + + + +### ⚠️ Label + +| API | Android | iOS / Mac Catalyst | Windows | Gtk | +| ----|:-------:|:------------------:|:-------:|:----:| +| CharacterSpacing | βœ… | βœ… | βœ… | βœ… | +| Font | βœ… | βœ… | βœ… | βœ… | +| FontAttributes | βœ… | βœ… | βœ… | βœ… | +| FontFamily | βœ… | βœ… | βœ… | βœ… | +| FontSize | βœ… | βœ… | βœ… | βœ… | +| FormattedText | βœ… | βœ… | ⚠️ | ⚠️ | +| HorizontalTextAlignment | βœ… | βœ… | βœ… | βœ… | +| LineBreakMode | βœ… | βœ… | βœ… | βœ… | +| LineHeight | βœ… | βœ… | βœ… | βœ… | +| MaxLines | βœ… | βœ… | βœ… | βœ… | +| Padding | βœ… | βœ… | βœ… | βœ… | +| Text | βœ… | βœ… | βœ… | βœ… | +| TextColor | βœ… | βœ… | βœ… | βœ… | +| TextDecorations | βœ… | βœ… | βœ… | βœ… | +| TextType | ⏳ | ⏳ | ⏳ | ⚠️ | +| VerticalTextAlignment | ⚠️ | ⚠️ | ⏳ | βœ… | + + + +### ⚠️ Picker + +| API | Android | iOS / Mac Catalyst | Windows | Gtk | +| ----|:-------:|:------------------:|:-------:|:----:| +| CharacterSpacing | βœ… | βœ… | βœ… | βœ… | +| FontAttributes | βœ… | βœ… | βœ… | βœ… | +| FontFamily | βœ… | βœ… | βœ… | βœ… | +| FontSize | βœ… | βœ… | βœ… | βœ… | +| HorizontalTextAlignment | βœ… | βœ… | βœ… | βœ… | +| ItemDisplayBinding | βœ… | βœ… | βœ… | βœ… | +| Items | βœ… | βœ… | βœ… | βœ… +| ItemsSource | βœ… | βœ… | βœ… | βœ… +| SelectedIndex | βœ… | βœ… | βœ… | βœ… +| SelectedIndexChanged | βœ… | βœ… | βœ… | βœ… | +| SelectedItem | βœ… | βœ… | ⚠️ | βœ… +| TextColor | βœ… | βœ… | ⏳ | βœ… +| Title | βœ… | βœ… | βœ… | ⚠️ +| TitleColor | βœ… | βœ… | βœ… | ⚠️ +| VerticalTextAlignment | ⏳ | ⏳ | ⏳ | ⚠️ + +### ⚠️ ProgressBar + +| API | Android | iOS / Mac Catalyst | Windows | Gtk | +| ----|:-------:|:------------------:|:-------:|:----:| +| Progress | βœ… | βœ… | βœ… | βœ… | +| ProgressColor | ⏳ | ⏳ | ⏳ | βœ… | +| ProgressTo | βœ… | βœ… | βœ… | βœ… | + +### ⚠️ RadioButton + +| API | Android | iOS / Mac Catalyst | Windows | Gtk | +| ----|:-------:|:------------------:|:-------:|:----:| +| CheckedChanged | ⚠️ | ⚠️ | ⚠️ | ⚠️ | +| GroupName | ⚠️ | ⚠️ | ⚠️ | ⚠️ | +| IsChecked | ⏳ | ⏳ | ⚠️ | ⚠️ | + + + +### ⚠️ SearchBar + +| API | Android | iOS / Mac Catalyst | Windows | Gtk | +| ----|:-------:|:------------------:|:-------:|:----:| +| BackgroundColor | βœ… | βœ… | βœ… | βœ… | +| CharacterSpacing | βœ… | βœ… | βœ… | βœ… | +| CancelButtonColor | ⏳ | ⏳ | βœ… | ⚠️ | +| FontAttributes | βœ… | βœ… | ⏳ | βœ… | +| FontSize | βœ… | βœ… | ⏳ | βœ… | +| HorizontalTextAlignment | βœ… | βœ… | βœ… | βœ… | +| MaxLength | βœ… | βœ… | ⏳ | βœ… | +| SearchCommand | ⏳ | βœ… | βœ… | ⚠️ | +| SearchCommandParameter | ⏳ | βœ… | βœ… | ⚠️ | +| Text | βœ… | βœ… | βœ… | βœ… | +| TextColor | βœ… | βœ… | ⏳ | βœ… | +| VerticalTextAlignment | ⚠️ | ⚠️ | ⚠️ | ⚠️ | + +### βœ… Shapes + +| API | Android | iOS / Mac Catalyst | Windows | Gtk | +| ----|:-------:|:------------------:|:-------:|:----:| +| Fill | βœ… | βœ… | βœ… | βœ… | +| Stroke | βœ… | βœ… | βœ… | βœ… | +| StrokeDashArray | βœ… | βœ… | βœ… | βœ… +| StrokeDashOffset | βœ… | βœ… | βœ… | βœ… +| StrokeLineCap | βœ… | βœ… | βœ… | βœ… +| StrokeLineJoin | βœ… | βœ… | βœ… | βœ… +| StrokeMiterLimit | βœ… | βœ… | βœ… | βœ… +| StrokeThickness | βœ… | βœ… | βœ… | βœ… | + +### ⚠️ Slider + +| API | Android | iOS / Mac Catalyst | Windows | Gtk | +| ----|:-------:|:------------------:|:-------:|:----:| +| DragCompleted | βœ… | βœ… | βœ… | ⚠️ | +| DragCompletedCommand | βœ… | βœ… | βœ… | ⚠️ | +| DragStarted | βœ… | βœ… | βœ… | ⚠️ | +| DragStartedCommand | βœ… | βœ… | βœ… | ⚠️ | +| Maximum | βœ… | βœ… | βœ… | βœ… | +| MaximumTrackColor | βœ… | βœ… | βœ… | ⚠️ | +| Minimum | βœ… | βœ… | βœ… | βœ… | +| MinimumTrackColor | βœ… | βœ… | βœ… | ⚠️ | +| ThumbColor | βœ… | βœ… | ⏳ | βœ… | +| ThumbImageSource | ⏳ | ⏳ | βœ… | βœ… | +| Value | βœ… | βœ… | βœ… | βœ… | βœ… | +| ValueChanged | βœ… | βœ… | βœ… | βœ… | + +### βœ… Stepper + +| API | Android | iOS / Mac Catalyst | Windows | Gtk | +| ----|:-------:|:------------------:|:-------:|:----:| +| Increment | βœ… | βœ… | βœ… | βœ… | +| Maximum | βœ… | βœ… | βœ… | βœ… | +| Minimum | βœ… | βœ… | βœ… | βœ… | +| Value | βœ… | βœ… | βœ… | βœ… | +| ValueChanged | βœ… | βœ… | βœ… | βœ… | + + + +### ⚠️ Switch + +| API | Android | iOS / Mac Catalyst | Windows | Gtk | +| ----|:-------:|:------------------:|:-------:|:----:| +| IsToggled | βœ… | βœ… | βœ… | βœ… | +| OnColor | βœ… | βœ… | ⏳ | ⚠️ | +| ThumbColor | βœ… | βœ… | ⏳ | ⚠️ | + +### βœ… TimePicker + +| API | Android | iOS / Mac Catalyst | Windows | Gtk | +| ----|:-------:|:------------------:|:-------:|:----:| +| BackgroundColor | βœ… | βœ… | βœ… | ⚠️ | +| CharacterSpacing | βœ… | βœ… | βœ… | ⚠️ | +| FontAttributes | βœ… | βœ… | βœ… | ⚠️ | +| FontFamily | βœ… | βœ… | βœ… | ⚠️ | +| FontSize | βœ… | βœ… | βœ… | ⚠️ | +| Format | βœ… | βœ… | βœ… | ⚠️ | +| Time | βœ… | βœ… | βœ… | ⚠️ | +| TextColor | βœ… | βœ… | βœ… | ⚠️ | + +### ⚠️ WebView + +| API | Android | iOS / Mac Catalyst | Windows | Gtk | +| ----|:-------:|:------------------:|:-------:|:----:| +| CanGoBack | ⚠️ | ⚠️ | ⚠️ | ⚠️ | +| CanGoForward | ⚠️ | ⚠️ | ⚠️ | ⚠️ | +| Cookies | ⚠️ | ⚠️ | ⚠️ | ⚠️ | +| Source | ⏳ | ⏳ | ⏳ | ⚠️ | +| Eval | ⚠️ | ⚠️ | ⚠️ | ⚠️ | +| EvaluateJavaScriptAsync | ⚠️ | ⚠️ | ⚠️ | ⚠️ | +| GoBack | ⚠️ | ⚠️ | ⚠️ | ⚠️ | +| GoForward | ⚠️ | ⚠️ | ⚠️ | ⚠️ | +| Reload | ⚠️ | ⚠️ | ⚠️ | ⚠️ | + +### Renderer Based Views + +| API | Android | iOS / Mac Catalyst | Windows | Gtk | +| ----|:-------:|:------------------:|:-------:|:----:| +| CarouselView | βœ… | βœ… | ⚠️ | ⚠️ | +| CollectionView | βœ… | βœ… | ⚠️ | ⚠️ | +| IndicatorView| ⏳ | βœ… | ⚠️ | ⚠️ | +| ImageButton| βœ… | βœ… | βœ… | ⚠️ | +| Map | ⏳ | ⏳ | ⚠️ | ⚠️ | +| RefreshView| ⚠️ | ⚠️ | ⚠️ | ⚠️ | +| SwipeView| βœ… | βœ… | ⚠️ | ⚠️ | + +### Layouts + +| API | Android | iOS / Mac Catalyst | Windows | Gtk | +| ----|:-------:|:------------------:|:-------:|:----:| +| AbsoluteLayout | βœ… | βœ… | βœ… | ⚠️ | +| ContentPresenter | ⚠️ | ⚠️ | ⚠️ | ⚠️ | +| ContentView | ⚠️ | ⚠️ | ⚠️ | ⚠️ | +| FlexLayout | βœ… | βœ… | βœ… | βœ… | +| Grid | βœ… | βœ… | βœ… | βœ… | +| RelativeLayout | βœ… | βœ… | βœ… | ⚠️ | +| ScrollView | βœ… | βœ… | βœ… | βœ… | +| StackLayout | βœ… | βœ… | βœ… | βœ… | +| TemplatedView | ⚠️ | ⚠️ | ⚠️ | ⚠️ | + +### Features + +| API | Android | iOS / Mac Catalyst | Windows | Gtk | +| ----|:-------:|:------------------:|:-------:|:----:| +| Accessibility | βœ… | βœ… | βœ… | ⚠️ | +| Animation | βœ… | βœ… | βœ… | ⚠️ | +| Border Everywhere | ⏳ | ⏳ | ⏳ | ⚠️ | +| Brushes Everywhere | βœ… | βœ… | βœ… | ⚠️ | +| CornerRadius Everywhere | ⏳ | ⏳ | ⏳ | ⚠️ | +| Device | ⚠️ | ⚠️ | ⚠️ | ⚠️ | +| Gestures | βœ… | βœ… | βœ… | ⚠️ | +| ImageHandlers | βœ… | βœ… | βœ… | βœ… | +| Interactivity (Behaviors, Triggers, Visual State Manager) | βœ… | βœ… | βœ… | ⚠️ | +| FlowDirection (RTL) | ⏳ | ⏳ | ⏳ | ⚠️ | +| Fonts | βœ… | βœ… | βœ… | βœ… | +| Lifecycle Events | ⏳ | ⏳ | ⏳ | ⏳ | +| Themes | ⏳ | ⏳ | ⚠️ | ⚠️ | +| Shell | ⏳ | ⏳ | ⏳ | ⚠️ | +| Styles | βœ… | βœ… | βœ… | ⚠️ | +| View Transforms | βœ… | βœ… | βœ… | ⚠️ | + diff --git a/eng/NuGetVersions.targets b/eng/NuGetVersions.targets index 3e033acd17d5..bb5fbe316e92 100644 --- a/eng/NuGetVersions.targets +++ b/eng/NuGetVersions.targets @@ -238,5 +238,9 @@ Version="0.1.0-beta.5" PrivateAssets="All" /> + diff --git a/eng/Versions.props b/eng/Versions.props index a6cc47429bff..ef467399b531 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -92,6 +92,7 @@ 2.4.5 4.3.0 3.2.0 + 3.24.24.95 $([System.Text.RegularExpressions.Regex]::Match($(MicrosoftDotnetSdkInternalPackageVersion), `^\d+\.\d+\.\d`))00 diff --git a/eng/cake/dotnet.cake b/eng/cake/dotnet.cake index d3c977ee0b07..1d1582a976fa 100644 --- a/eng/cake/dotnet.cake +++ b/eng/cake/dotnet.cake @@ -850,6 +850,9 @@ void ProcessTFMSwitches() if(HasArgument("tizen")) replaceTarget.Add("_IncludeTizen"); + if(HasArgument("gtk")) + replaceTarget.Add("_IncludeGtk"); + if (replaceTarget.Count > 0) { CopyFile("Directory.Build.Override.props.in", "Directory.Build.Override.props"); diff --git a/src/BlazorWebView/samples/BlazorGtkApp/AppState.cs b/src/BlazorWebView/samples/BlazorGtkApp/AppState.cs new file mode 100644 index 000000000000..ac81a0bb65f6 --- /dev/null +++ b/src/BlazorWebView/samples/BlazorGtkApp/AppState.cs @@ -0,0 +1,10 @@ +ο»Ώ// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +namespace BlazorGtkApp +{ + public class AppState + { + public int Counter { get; set; } + } +} diff --git a/src/BlazorWebView/samples/BlazorGtkApp/BlazorGtkApp.csproj b/src/BlazorWebView/samples/BlazorGtkApp/BlazorGtkApp.csproj new file mode 100644 index 000000000000..8dbefb4c92d8 --- /dev/null +++ b/src/BlazorWebView/samples/BlazorGtkApp/BlazorGtkApp.csproj @@ -0,0 +1,23 @@ + + + + + + $(_MauiDotNetTfm)-gtk + 3.24 + Exe + enable + + + + + + + + + + + + + + diff --git a/src/BlazorWebView/samples/BlazorGtkApp/CustomFilesBlazorWebView.cs b/src/BlazorWebView/samples/BlazorGtkApp/CustomFilesBlazorWebView.cs new file mode 100644 index 000000000000..560ad5040e28 --- /dev/null +++ b/src/BlazorWebView/samples/BlazorGtkApp/CustomFilesBlazorWebView.cs @@ -0,0 +1,26 @@ +ο»Ώ// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System.Collections.Generic; +using Microsoft.AspNetCore.Components.WebView.Gtk; +using Microsoft.Extensions.FileProviders; +using WebViewAppShared; + +namespace BlazorGtkApp +{ + public class CustomFilesBlazorWebView : BlazorWebView + { + public override IFileProvider CreateFileProvider(string contentRootDir) + { + var inMemoryFiles = new InMemoryStaticFileProvider( + fileContentsMap: new Dictionary + { + { "customindex.html", StaticFilesContents.CustomIndexHtmlContent }, + }, + // The contentRoot is ignored here because in WinForms it would include the absolute physical path to the app's content, which this provider doesn't care about + contentRoot: null); + + return new CompositeFileProvider(inMemoryFiles, base.CreateFileProvider(contentRootDir)); + } + } +} diff --git a/src/BlazorWebView/samples/BlazorGtkApp/Main.razor b/src/BlazorWebView/samples/BlazorGtkApp/Main.razor new file mode 100644 index 000000000000..92540ddde04c --- /dev/null +++ b/src/BlazorWebView/samples/BlazorGtkApp/Main.razor @@ -0,0 +1,12 @@ +ο»Ώ + + Home | + Other +
+ +
+ +

Not found

+

Sorry, there's nothing here.

+
+
diff --git a/src/BlazorWebView/samples/BlazorGtkApp/Pages/Index.razor b/src/BlazorWebView/samples/BlazorGtkApp/Pages/Index.razor new file mode 100644 index 000000000000..84aafcb5dfbd --- /dev/null +++ b/src/BlazorWebView/samples/BlazorGtkApp/Pages/Index.razor @@ -0,0 +1,25 @@ +ο»Ώ@page "/" +@inject AppState AppState +@using WebViewAppShared + +

Hello, world!

+ +

The current count is @AppState.Counter

+ + + + +

This is a shared component

+ + +@code { + void IncrementCount() + { + AppState.Counter++; + } + + void TriggerException() + { + throw new InvalidTimeZoneException("This is an exception from an event handler"); + } +} diff --git a/src/BlazorWebView/samples/BlazorGtkApp/Pages/Other.razor b/src/BlazorWebView/samples/BlazorGtkApp/Pages/Other.razor new file mode 100644 index 000000000000..b763f9c0cb85 --- /dev/null +++ b/src/BlazorWebView/samples/BlazorGtkApp/Pages/Other.razor @@ -0,0 +1,26 @@ +ο»Ώ@page "/other" +@inject NavigationManager NavigationManager + +
+ Here is another page. Looks like navigation works. + + +
+ +
+ +