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

Add GTK support #798

Open
wants to merge 24 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
23e0183
Added support for barcode rendering for GTK
mierzynskim Jan 14, 2019
78e7659
Added support for XF GTK backend
mierzynskim Jan 14, 2019
46eda14
Improved XF renderer performance
mierzynskim Jan 14, 2019
2a9ec55
Downgraded XF to latest version with GTK support
mierzynskim Jan 15, 2019
c01c561
Fixed and simplified pixel drawing
mierzynskim Jan 15, 2019
990ed23
Nuspec changes for gtk rendering support
mierzynskim Jan 15, 2019
0d0a29b
Fixed assembly info
mierzynskim Jan 16, 2019
43eca9f
Fixed one more assembly info
mierzynskim Jan 16, 2019
f7eb6f1
Merge branch 'dev' into gtkSupport
mierzynskim Jan 16, 2019
120157c
Removed redundant .user file and updated readme
mierzynskim Jan 16, 2019
1cb223a
Resolve sln error that appeared during the merge
mierzynskim Jan 16, 2019
9d9f2c8
Added GTK dependencies to the project
mierzynskim Jan 17, 2019
7c7debe
Updated XF to 3.0.0.446417 to fix build problems
mierzynskim Jan 17, 2019
3982cc1
Referenced netstandard in XF UWP project
mierzynskim Jan 17, 2019
b62b6de
Removed .user files and added them to gitignore
mierzynskim Jan 17, 2019
0777bd6
Added netstandard library as external dependency
mierzynskim Jan 17, 2019
9256355
Fixed problem with references for Forms.GTK project
mierzynskim Jan 17, 2019
adc0f2f
Fixed build configuration
mierzynskim Jan 18, 2019
8edf3db
Fix build configuration for AnyCPU
mierzynskim Jan 18, 2019
08e1718
GTK: dispose cairo objs earlier
knocte Jan 19, 2019
69b1dc2
GTK: remove bindings from the nuspec files
knocte Jan 19, 2019
63cc45b
GTK: normalize OutputPath properties to include trailing slash
knocte Jan 19, 2019
bd14452
Extracted constant for bitpersample parameter
mierzynskim Jan 21, 2019
d2d36c1
Better name or bits per sample constant
mierzynskim Jan 23, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -48,3 +48,4 @@ tools/
.DS_Store
.vscode/

*.user
2 changes: 1 addition & 1 deletion Samples/Forms/Core/FormsSample.csproj
Expand Up @@ -54,6 +54,6 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="2.3.4.270" />
<PackageReference Include="Xamarin.Forms" Version="3.0.0.446417" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions Samples/Forms/Droid/FormsSample.Droid.csproj
Expand Up @@ -15,7 +15,7 @@
<AndroidUseLatestPlatformSdk>True</AndroidUseLatestPlatformSdk>
<AssemblyName>FormsSample.Droid</AssemblyName>
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
<TargetFrameworkVersion>v7.1</TargetFrameworkVersion>
<TargetFrameworkVersion>v9.0</TargetFrameworkVersion>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
Expand Down Expand Up @@ -98,6 +98,6 @@
<ItemGroup>
<PackageReference Include="Xamarin.Android.Support.v4" Version="25.4.0.2" />
<PackageReference Include="FastAndroidCamera" Version="2.0.0" />
<PackageReference Include="Xamarin.Forms" Version="2.4.0.18342" />
<PackageReference Include="Xamarin.Forms" Version="3.0.0.446417" />
</ItemGroup>
</Project>
131 changes: 131 additions & 0 deletions Samples/Forms/GTK/FormsSample.GTK.csproj
@@ -0,0 +1,131 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Xamarin.Forms.3.0.0.446417\build\netstandard2.0\Xamarin.Forms.props" Condition="Exists('..\packages\Xamarin.Forms.3.0.0.446417\build\netstandard2.0\Xamarin.Forms.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{2BC36FB5-2164-4C6E-A2BC-4BF7101AE94F}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>FormsSample.GTK</RootNamespace>
<AssemblyName>FormsSample.GTK</AssemblyName>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
</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>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>

<Reference Include="OpenTK, Version=3.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4">
<HintPath>..\packages\Xamarin.Forms.Platform.GTK.3.0.0.446417\lib\net45\OpenTK.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="gdk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
<HintPath>..\..\..\Source\ZXing.Net.Mobile.GTK\Libs\gtk-sharp\gtk-sharp-2.0\gdk-sharp.dll</HintPath>
</Reference>
<Reference Include="glib-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
<HintPath>..\..\..\Source\ZXing.Net.Mobile.GTK\Libs\gtk-sharp\gtk-sharp-2.0\glib-sharp.dll</HintPath>
</Reference>
<Reference Include="gtk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
<HintPath>..\..\..\Source\ZXing.Net.Mobile.GTK\Libs\gtk-sharp\gtk-sharp-2.0\gtk-sharp.dll</HintPath>
</Reference>
<Reference Include="glade-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
<HintPath>..\..\..\Source\ZXing.Net.Mobile.GTK\Libs\gtk-sharp\gtk-sharp-2.0\glade-sharp.dll</HintPath>
</Reference>
<Reference Include="pango-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
<HintPath>..\..\..\Source\ZXing.Net.Mobile.GTK\Libs\gtk-sharp\gtk-sharp-2.0\pango-sharp.dll</HintPath>
</Reference>
<Reference Include="pango-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
<HintPath>..\..\..\Source\ZXing.Net.Mobile.GTK\Libs\gtk-sharp\gtk-sharp-2.0\pango-sharp.dll</HintPath>
</Reference>
<Reference Include="atk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
<HintPath>..\..\..\Source\ZXing.Net.Mobile.GTK\Libs\gtk-sharp\gtk-sharp-2.0\atk-sharp.dll</HintPath>
</Reference>
<Reference Include="Mono.Cairo, Version=4.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756">
<HintPath>..\..\..\Source\ZXing.Net.Mobile.GTK\Libs\gtk-sharp\Mono.Cairo\Mono.Cairo.dll</HintPath>
</Reference>
<Reference Include="Mono.Posix, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756">
<HintPath>..\..\..\Source\ZXing.Net.Mobile.GTK\Libs\gtk-sharp\Mono.Posix\Mono.Posix.dll</HintPath>
</Reference>
<Reference Include="webkit-sharp, Version=1.1.15.0, Culture=neutral, PublicKeyToken=eaa1d335d2e19745">
<HintPath>..\packages\Xamarin.Forms.Platform.GTK.3.0.0.446417\lib\net45\webkit-sharp.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Xamarin.Forms.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\packages\Xamarin.Forms.3.0.0.446417\lib\netstandard2.0\Xamarin.Forms.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Xamarin.Forms.Core.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\packages\Xamarin.Forms.3.0.0.446417\lib\netstandard2.0\Design\Xamarin.Forms.Core.Design.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Xamarin.Forms.Platform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\packages\Xamarin.Forms.3.0.0.446417\lib\netstandard2.0\Xamarin.Forms.Platform.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Xamarin.Forms.Platform.GTK, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\packages\Xamarin.Forms.Platform.GTK.3.0.0.446417\lib\net45\Xamarin.Forms.Platform.GTK.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Xamarin.Forms.Xaml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\packages\Xamarin.Forms.3.0.0.446417\lib\netstandard2.0\Xamarin.Forms.Xaml.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Xamarin.Forms.Xaml.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\packages\Xamarin.Forms.3.0.0.446417\lib\netstandard2.0\Design\Xamarin.Forms.Xaml.Design.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="OpenTK.dll.config" />
<None Include="packages.config" />
<None Include="webkit-sharp.dll.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Source\ZXing.Net.Mobile.Core\ZXing.Net.Mobile.Core.csproj">
<Project>{7528dd0a-1781-47f4-adbf-eeddb011f6bb}</Project>
<Name>ZXing.Net.Mobile.Core</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\Source\ZXing.Net.Mobile.Forms.GTK\ZXing.Net.Mobile.Forms.GTK.csproj">
<Project>{7aa0abcf-dbf1-4190-8e82-44dd736be2f3}</Project>
<Name>ZXing.Net.Mobile.Forms.GTK</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\Source\ZXing.Net.Mobile.GTK\ZXing.Net.Mobile.GTK.csproj">
<Project>{007476ef-d7ca-4198-bded-3544d0ebd546}</Project>
<Name>ZXing.Net.Mobile.GTK</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\Source\ZXing.Net\Source\lib\zxing.portable.csproj">
<Project>{24b441f2-cbe9-4405-9fd0-72ebcbea0ec3}</Project>
<Name>zxing.portable</Name>
</ProjectReference>
<ProjectReference Include="..\Core\FormsSample.csproj">
<Project>{0daf97ca-02db-4e4f-9163-b8f14eae2d90}</Project>
<Name>FormsSample</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105.The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Xamarin.Forms.3.0.0.446417\build\netstandard2.0\Xamarin.Forms.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Forms.3.0.0.446417\build\netstandard2.0\Xamarin.Forms.props'))" />
<Error Condition="!Exists('..\packages\Xamarin.Forms.3.0.0.446417\build\netstandard2.0\Xamarin.Forms.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Forms.3.0.0.446417\build\netstandard2.0\Xamarin.Forms.targets'))" />
</Target>
<Import Project="..\packages\Xamarin.Forms.3.0.0.446417\build\netstandard2.0\Xamarin.Forms.targets" Condition="Exists('..\packages\Xamarin.Forms.3.0.0.446417\build\netstandard2.0\Xamarin.Forms.targets')" />
</Project>
25 changes: 25 additions & 0 deletions Samples/Forms/GTK/OpenTK.dll.config
@@ -0,0 +1,25 @@
<configuration>
<dllmap os="linux" dll="opengl32.dll" target="libGL.so.1"/>
<dllmap os="linux" dll="glu32.dll" target="libGLU.so.1"/>
<dllmap os="linux" dll="openal32.dll" target="libopenal.so.1"/>
<dllmap os="linux" dll="alut.dll" target="libalut.so.0"/>
<dllmap os="linux" dll="opencl.dll" target="libOpenCL.so"/>
<dllmap os="linux" dll="libX11" target="libX11.so.6"/>
<dllmap os="linux" dll="libXi" target="libXi.so.6"/>
<dllmap os="linux" dll="SDL2.dll" target="libSDL2-2.0.so.0"/>
<dllmap os="osx" dll="opengl32.dll" target="/System/Library/Frameworks/OpenGL.framework/OpenGL"/>
<dllmap os="osx" dll="openal32.dll" target="/System/Library/Frameworks/OpenAL.framework/OpenAL" />
<dllmap os="osx" dll="alut.dll" target="/System/Library/Frameworks/OpenAL.framework/OpenAL" />
<dllmap os="osx" dll="libGLES.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
<dllmap os="osx" dll="libGLESv1_CM.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
<dllmap os="osx" dll="libGLESv2.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
<dllmap os="osx" dll="opencl.dll" target="/System/Library/Frameworks/OpenCL.framework/OpenCL"/>
<dllmap os="osx" dll="SDL2.dll" target="libSDL2.dylib"/>
<!-- XQuartz compatibility (X11 on Mac) -->
<dllmap os="osx" dll="libGL.so.1" target="/usr/X11/lib/libGL.dylib"/>
<dllmap os="osx" dll="libX11" target="/usr/X11/lib/libX11.dylib"/>
<dllmap os="osx" dll="libXcursor.so.1" target="/usr/X11/lib/libXcursor.dylib"/>
<dllmap os="osx" dll="libXi" target="/usr/X11/lib/libXi.dylib"/>
<dllmap os="osx" dll="libXinerama" target="/usr/X11/lib/libXinerama.dylib"/>
<dllmap os="osx" dll="libXrandr.so.2" target="/usr/X11/lib/libXrandr.dylib"/>
</configuration>
24 changes: 24 additions & 0 deletions Samples/Forms/GTK/Program.cs
@@ -0,0 +1,24 @@
using System;
using Xamarin.Forms;
using Xamarin.Forms.Platform.GTK;
using Application = Gtk.Application;

namespace FormsSample.GTK
{
class MainClass
{
public static void Main(string[] args)
{
Application.Init();
Forms.Init();
ZXing.Net.Mobile.Forms.GTK.Platform.Init ();

var app = new App();
var window = new FormsWindow();
window.LoadApplication(app);
window.SetApplicationTitle("GTK example");
window.Show();
Application.Run();
}
}
}
26 changes: 26 additions & 0 deletions Samples/Forms/GTK/Properties/AssemblyInfo.cs
@@ -0,0 +1,26 @@
using System.Reflection;
using System.Runtime.CompilerServices;

// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.

[assembly: AssemblyTitle("FormsSample.GTK")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("${AuthorCopyright}")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.

[assembly: AssemblyVersion("1.0.*")]

// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.

//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]
5 changes: 5 additions & 0 deletions Samples/Forms/GTK/packages.config
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Xamarin.Forms" version="3.0.0.446417" targetFramework="net47" />
<package id="Xamarin.Forms.Platform.GTK" version="3.0.0.446417" targetFramework="net47" />
</packages>
5 changes: 5 additions & 0 deletions Samples/Forms/GTK/webkit-sharp.dll.config
@@ -0,0 +1,5 @@
<configuration>
<dllmap dll="webkit-1.0" target="libwebkitgtk-1.0.0.dylib"/>
<dllmap dll="webkit-1.0" os="linux" target="libwebkitgtk-1.0.so.0"/>
<dllmap dll="webkit-1.0" os="windows" target="libwebkitgtk-1.0-0.dll"/>
</configuration>