Skip to content
Merged
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
23 changes: 23 additions & 0 deletions Samples/macOS/Sample.macOS/AppDelegate.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using AppKit;
using Foundation;

namespace Sample.macOS
{
[Register("AppDelegate")]
public class AppDelegate : NSApplicationDelegate
{
public AppDelegate()
{
}

public override void DidFinishLaunching(NSNotification notification)
{
// Insert code here to initialize your application
}

public override void WillTerminate(NSNotification notification)
{
// Insert code here to tear down your application
}
}
}
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.
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,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"
}
}
6 changes: 6 additions & 0 deletions Samples/macOS/Sample.macOS/Assets.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
6 changes: 6 additions & 0 deletions Samples/macOS/Sample.macOS/Entitlements.plist
Original file line number Diff line number Diff line change
@@ -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>
33 changes: 33 additions & 0 deletions Samples/macOS/Sample.macOS/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?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>macOS</string>
<key>CFBundleIdentifier</key>
<string>Sample.macOS</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSMinimumSystemVersion</key>
<string>10.14</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>${AuthorCopyright:HtmlEncode}</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>NSMainStoryboardFile</key>
<string>Main</string>
<key>XSAppIconAssets</key>
<string>Assets.xcassets/AppIcon.appiconset</string>

</dict>
</plist>
13 changes: 13 additions & 0 deletions Samples/macOS/Sample.macOS/Main.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using AppKit;

namespace Sample.macOS
{
static class MainClass
{
static void Main(string[] args)
{
NSApplication.Init();
NSApplication.Main(args);
}
}
}
681 changes: 681 additions & 0 deletions Samples/macOS/Sample.macOS/Main.storyboard

Large diffs are not rendered by default.

95 changes: 95 additions & 0 deletions Samples/macOS/Sample.macOS/Sample.macOS.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
<?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)' == '' ">x86</Platform>
<ProjectGuid>{C6529362-90CE-46A8-8822-1782F897FAF4}</ProjectGuid>
<ProjectTypeGuids>{A3F8F2AB-B479-4A4A-A458-A89E7DC349F1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Exe</OutputType>
<RootNamespace>Sample.macOS</RootNamespace>
<AssemblyName>macOS</AssemblyName>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<TargetFrameworkIdentifier>Xamarin.Mac</TargetFrameworkIdentifier>
<MonoMacResourcePrefix>Resources</MonoMacResourcePrefix>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<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>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<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>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="Xamarin.Mac" />
</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>
<Compile Include="Main.cs" />
<Compile Include="AppDelegate.cs" />
<Compile Include="ViewController.cs" />
<Compile Include="ViewController.designer.cs">
<DependentUpon>ViewController.cs</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<InterfaceDefinition Include="Main.storyboard" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Source\ZXing.Net\Source\lib\zxing.portable.csproj">
<Project>{24B441F2-CBE9-4405-9FD0-72EBCBEA0EC3}</Project>
<Name>zxing.portable</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\Source\ZXing.Net.Mobile.macOS\ZXing.Net.Mobile.macOS.csproj">
<Project>{A7E26AE0-12AF-4CFD-9B1E-3101347CC6F4}</Project>
<Name>ZXing.Net.Mobile.macOS</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Mac\Xamarin.Mac.CSharp.targets" />
</Project>
29 changes: 29 additions & 0 deletions Samples/macOS/Sample.macOS/Sample.macOS.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sample.macOS", "Sample.macOS.csproj", "{C6529362-90CE-46A8-8822-1782F897FAF4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "zxing.portable", "..\..\..\Source\ZXing.Net\Source\lib\zxing.portable.csproj", "{24B441F2-CBE9-4405-9FD0-72EBCBEA0EC3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ZXing.Net.Mobile.macOS", "..\..\..\Source\ZXing.Net.Mobile.macOS\ZXing.Net.Mobile.macOS.csproj", "{A7E26AE0-12AF-4CFD-9B1E-3101347CC6F4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x86 = Debug|x86
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C6529362-90CE-46A8-8822-1782F897FAF4}.Debug|x86.ActiveCfg = Debug|x86
{C6529362-90CE-46A8-8822-1782F897FAF4}.Debug|x86.Build.0 = Debug|x86
{C6529362-90CE-46A8-8822-1782F897FAF4}.Release|x86.ActiveCfg = Release|x86
{C6529362-90CE-46A8-8822-1782F897FAF4}.Release|x86.Build.0 = Release|x86
{24B441F2-CBE9-4405-9FD0-72EBCBEA0EC3}.Debug|x86.ActiveCfg = Debug|Any CPU
{24B441F2-CBE9-4405-9FD0-72EBCBEA0EC3}.Debug|x86.Build.0 = Debug|Any CPU
{24B441F2-CBE9-4405-9FD0-72EBCBEA0EC3}.Release|x86.ActiveCfg = Release|Any CPU
{24B441F2-CBE9-4405-9FD0-72EBCBEA0EC3}.Release|x86.Build.0 = Release|Any CPU
{A7E26AE0-12AF-4CFD-9B1E-3101347CC6F4}.Debug|x86.ActiveCfg = Debug|Any CPU
{A7E26AE0-12AF-4CFD-9B1E-3101347CC6F4}.Debug|x86.Build.0 = Debug|Any CPU
{A7E26AE0-12AF-4CFD-9B1E-3101347CC6F4}.Release|x86.ActiveCfg = Release|Any CPU
{A7E26AE0-12AF-4CFD-9B1E-3101347CC6F4}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
55 changes: 55 additions & 0 deletions Samples/macOS/Sample.macOS/ViewController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
using System;

using AppKit;
using CoreGraphics;
using Foundation;
using ZXing.Mobile;

namespace Sample.macOS
{
public partial class ViewController : NSViewController
{
public ViewController(IntPtr handle) : base(handle)
{
}

NSImageView imageBarcode;

public override void ViewDidLoad()
{
base.ViewDidLoad();

imageBarcode = new NSImageView(new CGRect(20, 80, View.Frame.Width - 40, View.Frame.Height - 120));

View.AddSubview(imageBarcode);

var barcodeWriter = new BarcodeWriter
{
Format = ZXing.BarcodeFormat.QR_CODE,
Options = new ZXing.Common.EncodingOptions
{
Width = 300,
Height = 300,
Margin = 30
}
};

var barcode = barcodeWriter.Write("ZXing.Net.Mobile");

imageBarcode.Image = barcode;
}

public override NSObject RepresentedObject
{
get
{
return base.RepresentedObject;
}
set
{
base.RepresentedObject = value;
// Update the view, if already loaded.
}
}
}
}
18 changes: 18 additions & 0 deletions Samples/macOS/Sample.macOS/ViewController.designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions Source/ZXing.Net.Mobile.Forms.macOS/Platform.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;

namespace ZXing.Net.Mobile.Forms.macOS
{
public class Platform
{
public Platform ()
{
}

public static void Init ()
{
ZXing.Net.Mobile.Forms.macOS.ZXingBarcodeImageViewRenderer.Init ();
}
}
}

Loading