Added the basic macOS Forms sample

This commit is contained in:
Matthew Leibowitz 2018-01-31 16:12:00 +02:00
Родитель 75a85e5c08
Коммит f3ed60bca4
19 изменённых файлов: 361 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,40 @@
using AppKit;
using Foundation;
using Xamarin.Forms;
using Xamarin.Forms.Platform.MacOS;
namespace SkiaSharpSample.macOS
{
[Register(nameof(AppDelegate))]
public class AppDelegate : FormsApplicationDelegate
{
private NSWindow window;
public AppDelegate()
{
var style = NSWindowStyle.Closable | NSWindowStyle.Resizable | NSWindowStyle.Titled;
var screenSize = NSScreen.MainScreen.VisibleFrame;
var w = 640;
var h = 480;
var rect = new CoreGraphics.CGRect((screenSize.Width - w) / 2, (screenSize.Height - h) / 2, w, h);
window = new NSWindow(rect, style, NSBackingStore.Buffered, false);
window.Title = "SkiaSharpSample.macOS";
window.TitleVisibility = NSWindowTitleVisibility.Hidden;
}
public override NSWindow MainWindow => window;
public override bool ApplicationShouldTerminateAfterLastWindowClosed(NSApplication sender) => true;
public override void DidFinishLaunching(NSNotification notification)
{
Forms.Init();
LoadApplication(new App());
base.DidFinishLaunching(notification);
}
}
}

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 7.9 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 20 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 711 B

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.4 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 20 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 58 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.4 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 3.3 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 58 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 174 KiB

Просмотреть файл

@ -0,0 +1,68 @@
{
"images": [
{
"filename": "AppIcon-16.png",
"size": "16x16",
"scale": "1x",
"idiom": "mac"
},
{
"filename": "AppIcon-16@2x.png",
"size": "16x16",
"scale": "2x",
"idiom": "mac"
},
{
"filename": "AppIcon-32.png",
"size": "32x32",
"scale": "1x",
"idiom": "mac"
},
{
"filename": "AppIcon-32@2x.png",
"size": "32x32",
"scale": "2x",
"idiom": "mac"
},
{
"filename": "AppIcon-128.png",
"size": "128x128",
"scale": "1x",
"idiom": "mac"
},
{
"filename": "AppIcon-128@2x.png",
"size": "128x128",
"scale": "2x",
"idiom": "mac"
},
{
"filename": "AppIcon-256.png",
"size": "256x256",
"scale": "1x",
"idiom": "mac"
},
{
"filename": "AppIcon-256@2x.png",
"size": "256x256",
"scale": "2x",
"idiom": "mac"
},
{
"filename": "AppIcon-512.png",
"size": "512x512",
"scale": "1x",
"idiom": "mac"
},
{
"filename": "AppIcon-512@2x.png",
"size": "512x512",
"scale": "2x",
"idiom": "mac"
}
],
"info": {
"version": 1,
"author": "xcode"
}
}

Просмотреть файл

@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Просмотреть файл

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
</dict>
</plist>

Просмотреть файл

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleName</key>
<string>SkiaSharpSample.macOS</string>
<key>CFBundleIdentifier</key>
<string>com.companyname.SkiaSharpSample-macOS</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSMinimumSystemVersion</key>
<string>10.10</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>NSHumanReadableCopyright</key>
<string>(c) Matthew Leibowitz</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>XSAppIconAssets</key>
<string>Assets.xcassets/AppIcon.appiconset</string>
<key>NSMainStoryboardFile</key>
<string>Main</string>
</dict>
</plist>

Просмотреть файл

@ -0,0 +1,14 @@
using AppKit;
namespace SkiaSharpSample.macOS
{
static class MainClass
{
static void Main(string[] args)
{
NSApplication.Init();
NSApplication.SharedApplication.Delegate = new AppDelegate();
NSApplication.Main(args);
}
}
}

Просмотреть файл

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="13771"/>
</dependencies>
<scenes>
<!--Application-->
<scene sceneID="JPo-4y-FX3">
<objects>
<application id="hnw-xV-0zn" sceneMemberID="viewController">
<menu key="mainMenu" title="Main Menu" systemMenu="main" id="AYu-sK-qS6">
<items>
<menuItem title="SkiaSharpSample.macOS" id="1Xt-HY-uBw">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="SkiaSharpSample.macOS" systemMenu="apple" id="uQy-DD-JDr">
<items>
<menuItem title="Quit SkiaSharpSample.macOS" keyEquivalent="q" id="4sb-4s-VLi">
<connections>
<action selector="terminate:" target="Ady-hI-5gd" id="Te7-pn-YzF"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
</items>
</menu>
<connections>
<outlet property="delegate" destination="Voe-Tx-rLC" id="PrD-fu-P6m"/>
</connections>
</application>
<customObject id="Voe-Tx-rLC" customClass="AppDelegate"/>
<customObject id="Ady-hI-5gd" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="75" y="0.0"/>
</scene>
</scenes>
</document>

Просмотреть файл

@ -0,0 +1,107 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{1D7EC18C-1780-4C46-8736-A3661DA20AEE}</ProjectGuid>
<ProjectTypeGuids>{A3F8F2AB-B479-4A4A-A458-A89E7DC349F1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Exe</OutputType>
<RootNamespace>SkiaSharpSample.macOS</RootNamespace>
<AssemblyName>SkiaSharpSample.macOS</AssemblyName>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<TargetFrameworkIdentifier>Xamarin.Mac</TargetFrameworkIdentifier>
<MonoMacResourcePrefix>Resources</MonoMacResourcePrefix>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<EnableCodeSigning>false</EnableCodeSigning>
<CodeSigningKey>Mac Developer</CodeSigningKey>
<CreatePackage>false</CreatePackage>
<EnablePackageSigning>false</EnablePackageSigning>
<IncludeMonoRuntime>false</IncludeMonoRuntime>
<UseSGen>true</UseSGen>
<UseRefCounting>true</UseRefCounting>
<Profiling>true</Profiling>
<HttpClientHandler></HttpClientHandler>
<LinkMode></LinkMode>
<XamMacArch></XamMacArch>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<DefineConstants></DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<EnableCodeSigning>false</EnableCodeSigning>
<CreatePackage>true</CreatePackage>
<EnablePackageSigning>false</EnablePackageSigning>
<IncludeMonoRuntime>true</IncludeMonoRuntime>
<UseSGen>true</UseSGen>
<UseRefCounting>true</UseRefCounting>
<LinkMode>SdkOnly</LinkMode>
<HttpClientHandler></HttpClientHandler>
<XamMacArch></XamMacArch>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="Xamarin.Mac" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="2.5.0.122203" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\source\SkiaSharp.Views\SkiaSharp.Views.Mac\SkiaSharp.Views.Mac.csproj">
<Project>{809A15DC-E675-4A24-83FA-DF13160F7E4C}</Project>
<Name>SkiaSharp.Views.Mac</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\..\source\SkiaSharp.Views.Forms\SkiaSharp.Views.Forms.Mac\SkiaSharp.Views.Forms.Mac.csproj">
<Project>{DA5DA4D8-4885-4AF2-96BB-AE803C344AB0}</Project>
<Name>SkiaSharp.Views.Forms.Mac</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\..\binding\SkiaSharp.OSX\SkiaSharp.OSX.csproj">
<Project>{4588A759-3853-49B8-8A68-6C7917BE9220}</Project>
<Name>SkiaSharp.OSX</Name>
</ProjectReference>
<ProjectReference Include="..\SkiaSharpSample\SkiaSharpSample.csproj">
<Project>{B178E8E3-A5AD-4C98-B365-86E05EE53643}</Project>
<Name>SkiaSharpSample</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Contents.json" />
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\AppIcon-128.png" />
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\AppIcon-128%402x.png" />
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\AppIcon-16.png" />
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\AppIcon-16%402x.png" />
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\AppIcon-256.png" />
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\AppIcon-256%402x.png" />
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\AppIcon-32.png" />
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\AppIcon-32%402x.png" />
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\AppIcon-512.png" />
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\AppIcon-512%402x.png" />
<ImageAsset Include="Assets.xcassets\Contents.json" />
</ItemGroup>
<ItemGroup>
<Folder Include="Resources\" />
</ItemGroup>
<ItemGroup>
<None Include="Info.plist" />
<None Include="Entitlements.plist" />
</ItemGroup>
<ItemGroup>
<InterfaceDefinition Include="Main.storyboard" />
</ItemGroup>
<ItemGroup>
<Compile Include="Main.cs" />
<Compile Include="AppDelegate.cs" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Mac\Xamarin.Mac.CSharp.targets" />
</Project>

Просмотреть файл

@ -63,6 +63,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SkiaSharpSample.UWP", "Skia
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SkiaSharpSample", "SkiaSharpSample\SkiaSharpSample.csproj", "{B178E8E3-A5AD-4C98-B365-86E05EE53643}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SkiaSharpSample.macOS", "SkiaSharpSample.macOS\SkiaSharpSample.macOS.csproj", "{1D7EC18C-1780-4C46-8736-A3661DA20AEE}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
..\..\..\source\SkiaSharp.Views.Forms\SkiaSharp.Views.Forms.Native.Shared\SkiaSharp.Views.Forms.Native.Shared.projitems*{2f94f024-1841-47e8-b521-74aa4e3eba54}*SharedItemsImports = 4
@ -1181,6 +1183,54 @@ Global
{B178E8E3-A5AD-4C98-B365-86E05EE53643}.Release|x64.Build.0 = Release|Any CPU
{B178E8E3-A5AD-4C98-B365-86E05EE53643}.Release|x86.ActiveCfg = Release|Any CPU
{B178E8E3-A5AD-4C98-B365-86E05EE53643}.Release|x86.Build.0 = Release|Any CPU
{1D7EC18C-1780-4C46-8736-A3661DA20AEE}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU
{1D7EC18C-1780-4C46-8736-A3661DA20AEE}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU
{1D7EC18C-1780-4C46-8736-A3661DA20AEE}.Ad-Hoc|ARM.ActiveCfg = Release|Any CPU
{1D7EC18C-1780-4C46-8736-A3661DA20AEE}.Ad-Hoc|ARM.Build.0 = Release|Any CPU
{1D7EC18C-1780-4C46-8736-A3661DA20AEE}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU
{1D7EC18C-1780-4C46-8736-A3661DA20AEE}.Ad-Hoc|iPhone.Build.0 = Release|Any CPU
{1D7EC18C-1780-4C46-8736-A3661DA20AEE}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|Any CPU
{1D7EC18C-1780-4C46-8736-A3661DA20AEE}.Ad-Hoc|iPhoneSimulator.Build.0 = Release|Any CPU
{1D7EC18C-1780-4C46-8736-A3661DA20AEE}.Ad-Hoc|x64.ActiveCfg = Release|Any CPU
{1D7EC18C-1780-4C46-8736-A3661DA20AEE}.Ad-Hoc|x64.Build.0 = Release|Any CPU
{1D7EC18C-1780-4C46-8736-A3661DA20AEE}.Ad-Hoc|x86.ActiveCfg = Release|Any CPU
{1D7EC18C-1780-4C46-8736-A3661DA20AEE}.Ad-Hoc|x86.Build.0 = Release|Any CPU
{1D7EC18C-1780-4C46-8736-A3661DA20AEE}.AppStore|Any CPU.ActiveCfg = Release|Any CPU
{1D7EC18C-1780-4C46-8736-A3661DA20AEE}.AppStore|Any CPU.Build.0 = Release|Any CPU
{1D7EC18C-1780-4C46-8736-A3661DA20AEE}.AppStore|ARM.ActiveCfg = Release|Any CPU
{1D7EC18C-1780-4C46-8736-A3661DA20AEE}.AppStore|ARM.Build.0 = Release|Any CPU
{1D7EC18C-1780-4C46-8736-A3661DA20AEE}.AppStore|iPhone.ActiveCfg = Release|Any CPU
{1D7EC18C-1780-4C46-8736-A3661DA20AEE}.AppStore|iPhone.Build.0 = Release|Any CPU
{1D7EC18C-1780-4C46-8736-A3661DA20AEE}.AppStore|iPhoneSimulator.ActiveCfg = Release|Any CPU
{1D7EC18C-1780-4C46-8736-A3661DA20AEE}.AppStore|iPhoneSimulator.Build.0 = Release|Any CPU
{1D7EC18C-1780-4C46-8736-A3661DA20AEE}.AppStore|x64.ActiveCfg = Release|Any CPU
{1D7EC18C-1780-4C46-8736-A3661DA20AEE}.AppStore|x64.Build.0 = Release|Any CPU
{1D7EC18C-1780-4C46-8736-A3661DA20AEE}.AppStore|x86.ActiveCfg = Release|Any CPU
{1D7EC18C-1780-4C46-8736-A3661DA20AEE}.AppStore|x86.Build.0 = Release|Any CPU
{1D7EC18C-1780-4C46-8736-A3661DA20AEE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1D7EC18C-1780-4C46-8736-A3661DA20AEE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1D7EC18C-1780-4C46-8736-A3661DA20AEE}.Debug|ARM.ActiveCfg = Debug|Any CPU
{1D7EC18C-1780-4C46-8736-A3661DA20AEE}.Debug|ARM.Build.0 = Debug|Any CPU
{1D7EC18C-1780-4C46-8736-A3661DA20AEE}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{1D7EC18C-1780-4C46-8736-A3661DA20AEE}.Debug|iPhone.Build.0 = Debug|Any CPU
{1D7EC18C-1780-4C46-8736-A3661DA20AEE}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{1D7EC18C-1780-4C46-8736-A3661DA20AEE}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{1D7EC18C-1780-4C46-8736-A3661DA20AEE}.Debug|x64.ActiveCfg = Debug|Any CPU
{1D7EC18C-1780-4C46-8736-A3661DA20AEE}.Debug|x64.Build.0 = Debug|Any CPU
{1D7EC18C-1780-4C46-8736-A3661DA20AEE}.Debug|x86.ActiveCfg = Debug|Any CPU
{1D7EC18C-1780-4C46-8736-A3661DA20AEE}.Debug|x86.Build.0 = Debug|Any CPU
{1D7EC18C-1780-4C46-8736-A3661DA20AEE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1D7EC18C-1780-4C46-8736-A3661DA20AEE}.Release|Any CPU.Build.0 = Release|Any CPU
{1D7EC18C-1780-4C46-8736-A3661DA20AEE}.Release|ARM.ActiveCfg = Release|Any CPU
{1D7EC18C-1780-4C46-8736-A3661DA20AEE}.Release|ARM.Build.0 = Release|Any CPU
{1D7EC18C-1780-4C46-8736-A3661DA20AEE}.Release|iPhone.ActiveCfg = Release|Any CPU
{1D7EC18C-1780-4C46-8736-A3661DA20AEE}.Release|iPhone.Build.0 = Release|Any CPU
{1D7EC18C-1780-4C46-8736-A3661DA20AEE}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{1D7EC18C-1780-4C46-8736-A3661DA20AEE}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{1D7EC18C-1780-4C46-8736-A3661DA20AEE}.Release|x64.ActiveCfg = Release|Any CPU
{1D7EC18C-1780-4C46-8736-A3661DA20AEE}.Release|x64.Build.0 = Release|Any CPU
{1D7EC18C-1780-4C46-8736-A3661DA20AEE}.Release|x86.ActiveCfg = Release|Any CPU
{1D7EC18C-1780-4C46-8736-A3661DA20AEE}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE