Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: tried to add WASM and skia project #562

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType Condition="'$(Configuration)'=='Release'">WinExe</OutputType>
<OutputType Condition="'$(Configuration)'=='Debug'">Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>
<ItemGroup Condition="exists('..\MigrateRenderersSample.Windows')">
<EmbeddedResource Include="..\MigrateRenderersSample.Windows\Package.appxmanifest" LogicalName="Package.appxmanifest" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" />
<PackageReference Include="Uno.Resizetizer" Version="1.1.2" />
<PackageReference Include="Uno.WinUI.Skia.Gtk" Version="4.9.26" />
<PackageReference Include="Uno.WinUI.RemoteControl" Version="4.9.26" Condition="'$(Configuration)'=='Debug'" />
<PackageReference Include="Uno.UI.Adapter.Microsoft.Extensions.Logging" Version="4.9.26" />
<PackageReference Include="Uno.WinUI.Lottie" Version="4.9.26" />
<PackageReference Include="SkiaSharp.Views.Uno.WinUI" Version="2.88.3" />
<PackageReference Include="SkiaSharp.Skottie" Version="2.88.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MigrateRenderersSample\MigrateRenderersSample.csproj" />
</ItemGroup>
<Import Project="..\MigrateRenderersSample.Base\base.props" />
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using GLib;
using System;
using Uno.UI.Runtime.Skia;

namespace MigrateRenderersSample.Skia.Gtk
{
public sealed class Program
{
static void Main(string[] args)
{
ExceptionManager.UnhandledException += delegate (UnhandledExceptionArgs expArgs)
{
Console.WriteLine("GLIB UNHANDLED EXCEPTION" + expArgs.ExceptionObject.ToString());
expArgs.ExitApplication = true;
};

var host = new GtkHost(() => new AppHead());

host.Run();
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<linker>
<assembly fullname="MigrateRenderersSample.Wasm" />
<assembly fullname="Microsoft.Extensions.Options" />

<!--
Uncomment this section when using JSON.NET
<assembly fullname="System.Core">
<type fullname="System.Linq.Expressions*" />
</assembly>
-->
</linker>
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<NoWarn>NU1701</NoWarn>

</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<MonoRuntimeDebuggerEnabled>true</MonoRuntimeDebuggerEnabled>
<DefineConstants>$(DefineConstants);TRACE;DEBUG</DefineConstants>
<DebugType>portable</DebugType>
<DebugSymbols>true</DebugSymbols>
<!--
IL Linking is disabled in Debug configuration.
When building in Release, see https://aka.platform.uno/wasm-il-linker
-->
<WasmShellILLinkerEnabled>false</WasmShellILLinkerEnabled>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'">
<!-- XAML Resource trimming https://aka.platform.uno/xaml-trimming -->
<!--<UnoXamlResourcesTrimming>true</UnoXamlResourcesTrimming>-->
<!-- Improve performance with AOT builds https://aka.platform.uno/wasm-aot -->
<!-- <WasmShellMonoRuntimeExecutionMode>InterpreterAndAOT</WasmShellMonoRuntimeExecutionMode> -->
<!-- Temporarily uncomment to generate an AOT profile https://aka.platform.uno/wasm-aot-profile -->
<!-- <WasmShellGenerateAOTProfile>true</WasmShellGenerateAOTProfile> -->
</PropertyGroup>
<ItemGroup>
<Content Include="Assets\SplashScreen.png" />

</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="WasmCSS\Fonts.css" />
<EmbeddedResource Include="WasmScripts\AppManifest.js" />
</ItemGroup>
<ItemGroup>
<LinkerDescriptor Include="LinkerConfig.xml" />
</ItemGroup>
<ItemGroup>
<!--
This item group is required by the project template because of the
new SDK-Style project, otherwise some files are not added automatically.

You can safely remove this ItemGroup completely.
-->
<None Include="Program.cs" />
<None Include="LinkerConfig.xml" />
<None Include="wwwroot\web.config" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.1" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" />
<PackageReference Include="Microsoft.Windows.Compatibility" Version="7.0.1" />
<PackageReference Include="Uno.Extensions.Logging.WebAssembly.Console" Version="1.4.0" />
<PackageReference Include="Uno.Resizetizer" Version="1.1.2" />
<PackageReference Include="Uno.WinUI.WebAssembly" Version="4.9.26" />
<PackageReference Include="Uno.WinUI.RemoteControl" Version="4.9.26" Condition="'$(Configuration)'=='Debug'" />
<PackageReference Include="Uno.UI.Adapter.Microsoft.Extensions.Logging" Version="4.9.26" />
<PackageReference Include="Uno.Wasm.Bootstrap" Version="7.0.24" />
<PackageReference Include="Uno.Wasm.Bootstrap.DevServer" Version="7.0.24" />
<PackageReference Include="Uno.WinUI.Lottie" Version="4.9.26" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MigrateRenderersSample\MigrateRenderersSample.csproj" />
</ItemGroup>
<Import Project="..\MigrateRenderersSample.Base\base.props" />
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using Microsoft.UI.Xaml;
using System;

namespace MigrateRenderersSample.Wasm
{
public sealed class Program
{
private static App? _app;

static int Main(string[] args)
{
Microsoft.UI.Xaml.Application.Start(_ => _app = new AppHead());

return 0;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:8080",
"sslPort": 0
}
},
"profiles": {
"MigrateRenderersSample.Wasm": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "http://localhost:5000",
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
When adding fonts here, make sure to add them using a base64 data uri, otherwise
fonts loading are delayed, and text may get displayed incorrectly.
*/

/* https://github.com/unoplatform/uno/issues/3954 */
@font-face {
font-family: 'Segoe UI';
src: local('system-ui'), local('Segoe UI'), local('-apple-system'), local('BlinkMacSystemFont'), local('Inter'), local('Cantarell'), local('Ubuntu'), local('Roboto'), local('Open Sans'), local('Noto Sans'), local('Helvetica Neue'), local('sans-serif');
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
var UnoAppManifest = {

splashScreenImage: "Assets/SplashScreen.png",
splashScreenColor: "transparent",
displayName: "MigrateRenderersSample"

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>

<system.webServer>

<!-- Disable compression as we're doing it through pre-compressed files -->
<urlCompression doStaticCompression="false" doDynamicCompression="false" dynamicCompressionBeforeCache="false" />

<staticContent>
<remove fileExtension=".dll" />
<remove fileExtension=".wasm" />
<remove fileExtension=".woff" />
<remove fileExtension=".woff2" />
<mimeMap fileExtension=".wasm" mimeType="application/wasm" />
<mimeMap fileExtension=".clr" mimeType="application/octet-stream" />
<mimeMap fileExtension=".pdb" mimeType="application/octet-stream" />
<mimeMap fileExtension=".woff" mimeType="application/font-woff" />
<mimeMap fileExtension=".woff2" mimeType="application/font-woff" />
<mimeMap fileExtension=".dat" mimeType="application/octet-stream" />
<!-- Required for PWAs -->
<mimeMap fileExtension=".webmanifest" mimeType="application/octet-stream" />
</staticContent>

<rewrite>
<rules>
<rule name="Lookup for pre-compressed brotli file" stopProcessing="true">
<match url="(.*)$"/>
<conditions>
<!-- Match brotli requests -->
<add input="{HTTP_ACCEPT_ENCODING}" pattern="br" />

<!-- Match all but pre-compressed files -->
<add input="{REQUEST_URI}" pattern="^(?!/_compressed_br/)(.*)$" />

<!-- Check if the pre-compressed file exists on the disk -->
<add input="{DOCUMENT_ROOT}/_compressed_br/{C:0}" matchType="IsFile" negate="false" />
</conditions>
<action type="Rewrite" url="/_compressed_br{C:0}" />
</rule>

<rule name="Lookup for pre-compressed gzip file" stopProcessing="true">
<match url="(.*)$"/>
<conditions>
<!-- Match gzip requests -->
<add input="{HTTP_ACCEPT_ENCODING}" pattern="gzip" />

<!-- Match all but pre-compressed files -->
<add input="{REQUEST_URI}" pattern="^(?!/_compressed_gz/)(.*)$" />

<!-- Check if the pre-compressed file exists on the disk -->
<add input="{DOCUMENT_ROOT}/_compressed_gz/{C:0}" matchType="IsFile" negate="false" />
</conditions>
<action type="Rewrite" url="/_compressed_gz{C:0}" />
</rule>
</rules>

<outboundRules>
<rule name="Adjust content encoding for gzip pre-compressed files" enabled="true" stopProcessing="true">
<match serverVariable="RESPONSE_CONTENT_ENCODING" pattern="" />
<conditions>
<add input="{REQUEST_URI}" pattern="/_compressed_gz/.*$" />
</conditions>
<action type="Rewrite" value="gzip"/>
</rule>
<rule name="Adjust content encoding for brotli pre-compressed files" enabled="true" stopProcessing="true">
<match serverVariable="RESPONSE_CONTENT_ENCODING" pattern="" />
<conditions>
<add input="{REQUEST_URI}" pattern="/_compressed_br/.*$" />
</conditions>
<action type="Rewrite" value="br"/>
</rule>
</outboundRules>
</rewrite>
</system.webServer>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MigrateRenderersSample.Mobi
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MigrateRenderersSample.Windows", "MigrateRenderersSample.Windows\MigrateRenderersSample.Windows.csproj", "{48836282-D3A5-4179-8F16-B15217598D76}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MigrateRenderersSample.Skia.Gtk", "MigrateRenderersSample.Skia.Gtk\MigrateRenderersSample.Skia.Gtk.csproj", "{7F542EF5-F44D-4B83-A7D1-6B161D2DE347}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MigrateRenderersSample.Wasm", "MigrateRenderersSample.Wasm\MigrateRenderersSample.Wasm.csproj", "{988B42BB-557D-43A0-BE74-88AC21BD726E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -85,13 +89,47 @@ Global
{48836282-D3A5-4179-8F16-B15217598D76}.Release|x86.ActiveCfg = Release|x86
{48836282-D3A5-4179-8F16-B15217598D76}.Release|x86.Build.0 = Release|x86
{48836282-D3A5-4179-8F16-B15217598D76}.Release|x86.Deploy.0 = Release|x86
{7F542EF5-F44D-4B83-A7D1-6B161D2DE347}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7F542EF5-F44D-4B83-A7D1-6B161D2DE347}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7F542EF5-F44D-4B83-A7D1-6B161D2DE347}.Debug|arm64.ActiveCfg = Debug|Any CPU
{7F542EF5-F44D-4B83-A7D1-6B161D2DE347}.Debug|arm64.Build.0 = Debug|Any CPU
{7F542EF5-F44D-4B83-A7D1-6B161D2DE347}.Debug|x64.ActiveCfg = Debug|Any CPU
{7F542EF5-F44D-4B83-A7D1-6B161D2DE347}.Debug|x64.Build.0 = Debug|Any CPU
{7F542EF5-F44D-4B83-A7D1-6B161D2DE347}.Debug|x86.ActiveCfg = Debug|Any CPU
{7F542EF5-F44D-4B83-A7D1-6B161D2DE347}.Debug|x86.Build.0 = Debug|Any CPU
{7F542EF5-F44D-4B83-A7D1-6B161D2DE347}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7F542EF5-F44D-4B83-A7D1-6B161D2DE347}.Release|Any CPU.Build.0 = Release|Any CPU
{7F542EF5-F44D-4B83-A7D1-6B161D2DE347}.Release|arm64.ActiveCfg = Release|Any CPU
{7F542EF5-F44D-4B83-A7D1-6B161D2DE347}.Release|arm64.Build.0 = Release|Any CPU
{7F542EF5-F44D-4B83-A7D1-6B161D2DE347}.Release|x64.ActiveCfg = Release|Any CPU
{7F542EF5-F44D-4B83-A7D1-6B161D2DE347}.Release|x64.Build.0 = Release|Any CPU
{7F542EF5-F44D-4B83-A7D1-6B161D2DE347}.Release|x86.ActiveCfg = Release|Any CPU
{7F542EF5-F44D-4B83-A7D1-6B161D2DE347}.Release|x86.Build.0 = Release|Any CPU
{988B42BB-557D-43A0-BE74-88AC21BD726E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{988B42BB-557D-43A0-BE74-88AC21BD726E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{988B42BB-557D-43A0-BE74-88AC21BD726E}.Debug|arm64.ActiveCfg = Debug|Any CPU
{988B42BB-557D-43A0-BE74-88AC21BD726E}.Debug|arm64.Build.0 = Debug|Any CPU
{988B42BB-557D-43A0-BE74-88AC21BD726E}.Debug|x64.ActiveCfg = Debug|Any CPU
{988B42BB-557D-43A0-BE74-88AC21BD726E}.Debug|x64.Build.0 = Debug|Any CPU
{988B42BB-557D-43A0-BE74-88AC21BD726E}.Debug|x86.ActiveCfg = Debug|Any CPU
{988B42BB-557D-43A0-BE74-88AC21BD726E}.Debug|x86.Build.0 = Debug|Any CPU
{988B42BB-557D-43A0-BE74-88AC21BD726E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{988B42BB-557D-43A0-BE74-88AC21BD726E}.Release|Any CPU.Build.0 = Release|Any CPU
{988B42BB-557D-43A0-BE74-88AC21BD726E}.Release|arm64.ActiveCfg = Release|Any CPU
{988B42BB-557D-43A0-BE74-88AC21BD726E}.Release|arm64.Build.0 = Release|Any CPU
{988B42BB-557D-43A0-BE74-88AC21BD726E}.Release|x64.ActiveCfg = Release|Any CPU
{988B42BB-557D-43A0-BE74-88AC21BD726E}.Release|x64.Build.0 = Release|Any CPU
{988B42BB-557D-43A0-BE74-88AC21BD726E}.Release|x86.ActiveCfg = Release|Any CPU
{988B42BB-557D-43A0-BE74-88AC21BD726E}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{B1D21810-3259-4106-9565-491FD6E9AE65} = {8646C42D-5F28-4EF7-9AB6-C756E4984F73}
{48836282-D3A5-4179-8F16-B15217598D76} = {8646C42D-5F28-4EF7-9AB6-C756E4984F73}
{7F542EF5-F44D-4B83-A7D1-6B161D2DE347} = {8646C42D-5F28-4EF7-9AB6-C756E4984F73}
{988B42BB-557D-43A0-BE74-88AC21BD726E} = {8646C42D-5F28-4EF7-9AB6-C756E4984F73}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {33709CDE-D64E-4649-91E4-2E008EDC5F2C}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<MaterialResources xmlns="using:Uno.Material" />-->

<ResourceDictionary Source="Styles/Controls/ToggleButton.xaml" />
<ResourceDictionary Source="Styles/Controls/Button.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
xmlns:toolkit="using:CommunityToolkit.WinUI.UI.Controls"
xmlns:unoToolkit="using:Uno.UI.Toolkit"
xmlns:ent="using:WCTDataTreeTabSample.Entities"
xmlns:selectors="using:WCTDataTreeTabSample.TemplateSelectors"
mc:Ignorable="d">

<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
unoToolkit:VisibleBoundsPadding.PaddingMask="All">
<muxc:NavigationView x:Name="NavView"
OpenPaneLength="200"
IsSettingsVisible="False"
Expand Down Expand Up @@ -141,5 +143,14 @@

<Frame x:Name="ContentFrame"></Frame>
</muxc:NavigationView>

<!-- Custom pane toggle button -->
<Button x:Name="NavViewToggleButton"
Grid.Row="2"
Click="NavViewToggleButton_Click"
HorizontalAlignment="Left"
AutomationProperties.AutomationId="NavToggle"
Style="{StaticResource PaneToggleButtonStyle}" />

</Grid>
</Page>
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ private void Shell_Loaded(object sender, Microsoft.UI.Xaml.RoutedEventArgs e)
App.NavigateTo(typeof(TreeViewPage));
}

private void NavViewToggleButton_Click(object sender, RoutedEventArgs e)
{
NavView.IsPaneVisible = !NavView.IsPaneVisible;
NavView.IsPaneOpen = NavView.IsPaneVisible;
}


private void NavView_ItemInvoked(Microsoft.UI.Xaml.Controls.NavigationView sender, Microsoft.UI.Xaml.Controls.NavigationViewItemInvokedEventArgs args)
{
Expand Down
Loading