Skip to content

Commit 53f85f6

Browse files
mierzynskimknocte
authored andcommitted
GTK rendering support
See Redth#798 Fixes Redth#797
1 parent 729475c commit 53f85f6

File tree

72 files changed

+1263
-20
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+1263
-20
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,4 @@ tools/
4848
.DS_Store
4949
.vscode/
5050

51+
*.user

Samples/Forms/Core/FormsSample.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,6 @@
5454
</ProjectReference>
5555
</ItemGroup>
5656
<ItemGroup>
57-
<PackageReference Include="Xamarin.Forms" Version="2.3.4.270" />
57+
<PackageReference Include="Xamarin.Forms" Version="3.0.0.446417" />
5858
</ItemGroup>
5959
</Project>

Samples/Forms/Droid/FormsSample.Droid.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<AndroidUseLatestPlatformSdk>True</AndroidUseLatestPlatformSdk>
1616
<AssemblyName>FormsSample.Droid</AssemblyName>
1717
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
18-
<TargetFrameworkVersion>v7.1</TargetFrameworkVersion>
18+
<TargetFrameworkVersion>v9.0</TargetFrameworkVersion>
1919
<NuGetPackageImportStamp>
2020
</NuGetPackageImportStamp>
2121
</PropertyGroup>
@@ -98,6 +98,6 @@
9898
<ItemGroup>
9999
<PackageReference Include="Xamarin.Android.Support.v4" Version="25.4.0.2" />
100100
<PackageReference Include="FastAndroidCamera" Version="2.0.0" />
101-
<PackageReference Include="Xamarin.Forms" Version="2.4.0.18342" />
101+
<PackageReference Include="Xamarin.Forms" Version="3.0.0.446417" />
102102
</ItemGroup>
103103
</Project>
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<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')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{2BC36FB5-2164-4C6E-A2BC-4BF7101AE94F}</ProjectGuid>
8+
<OutputType>WinExe</OutputType>
9+
<RootNamespace>FormsSample.GTK</RootNamespace>
10+
<AssemblyName>FormsSample.GTK</AssemblyName>
11+
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
12+
</PropertyGroup>
13+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
14+
<DebugSymbols>true</DebugSymbols>
15+
<DebugType>full</DebugType>
16+
<Optimize>false</Optimize>
17+
<OutputPath>bin\Debug</OutputPath>
18+
<DefineConstants>DEBUG;</DefineConstants>
19+
<ErrorReport>prompt</ErrorReport>
20+
<WarningLevel>4</WarningLevel>
21+
</PropertyGroup>
22+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
23+
<Optimize>true</Optimize>
24+
<OutputPath>bin\Release</OutputPath>
25+
<ErrorReport>prompt</ErrorReport>
26+
<WarningLevel>4</WarningLevel>
27+
</PropertyGroup>
28+
<ItemGroup>
29+
30+
<Reference Include="OpenTK, Version=3.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4">
31+
<HintPath>..\packages\Xamarin.Forms.Platform.GTK.3.0.0.446417\lib\net45\OpenTK.dll</HintPath>
32+
<Private>True</Private>
33+
</Reference>
34+
<Reference Include="System" />
35+
<Reference Include="gdk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
36+
<HintPath>..\..\..\Source\ZXing.Net.Mobile.GTK\Libs\gtk-sharp\gtk-sharp-2.0\gdk-sharp.dll</HintPath>
37+
</Reference>
38+
<Reference Include="glib-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
39+
<HintPath>..\..\..\Source\ZXing.Net.Mobile.GTK\Libs\gtk-sharp\gtk-sharp-2.0\glib-sharp.dll</HintPath>
40+
</Reference>
41+
<Reference Include="gtk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
42+
<HintPath>..\..\..\Source\ZXing.Net.Mobile.GTK\Libs\gtk-sharp\gtk-sharp-2.0\gtk-sharp.dll</HintPath>
43+
</Reference>
44+
<Reference Include="glade-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
45+
<HintPath>..\..\..\Source\ZXing.Net.Mobile.GTK\Libs\gtk-sharp\gtk-sharp-2.0\glade-sharp.dll</HintPath>
46+
</Reference>
47+
<Reference Include="pango-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
48+
<HintPath>..\..\..\Source\ZXing.Net.Mobile.GTK\Libs\gtk-sharp\gtk-sharp-2.0\pango-sharp.dll</HintPath>
49+
</Reference>
50+
<Reference Include="pango-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
51+
<HintPath>..\..\..\Source\ZXing.Net.Mobile.GTK\Libs\gtk-sharp\gtk-sharp-2.0\pango-sharp.dll</HintPath>
52+
</Reference>
53+
<Reference Include="atk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
54+
<HintPath>..\..\..\Source\ZXing.Net.Mobile.GTK\Libs\gtk-sharp\gtk-sharp-2.0\atk-sharp.dll</HintPath>
55+
</Reference>
56+
<Reference Include="Mono.Cairo, Version=4.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756">
57+
<HintPath>..\..\..\Source\ZXing.Net.Mobile.GTK\Libs\gtk-sharp\Mono.Cairo\Mono.Cairo.dll</HintPath>
58+
</Reference>
59+
<Reference Include="Mono.Posix, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756">
60+
<HintPath>..\..\..\Source\ZXing.Net.Mobile.GTK\Libs\gtk-sharp\Mono.Posix\Mono.Posix.dll</HintPath>
61+
</Reference>
62+
<Reference Include="webkit-sharp, Version=1.1.15.0, Culture=neutral, PublicKeyToken=eaa1d335d2e19745">
63+
<HintPath>..\packages\Xamarin.Forms.Platform.GTK.3.0.0.446417\lib\net45\webkit-sharp.dll</HintPath>
64+
<Private>True</Private>
65+
</Reference>
66+
<Reference Include="Xamarin.Forms.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null">
67+
<HintPath>..\packages\Xamarin.Forms.3.0.0.446417\lib\netstandard2.0\Xamarin.Forms.Core.dll</HintPath>
68+
<Private>True</Private>
69+
</Reference>
70+
<Reference Include="Xamarin.Forms.Core.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null">
71+
<HintPath>..\packages\Xamarin.Forms.3.0.0.446417\lib\netstandard2.0\Design\Xamarin.Forms.Core.Design.dll</HintPath>
72+
<Private>True</Private>
73+
</Reference>
74+
<Reference Include="Xamarin.Forms.Platform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
75+
<HintPath>..\packages\Xamarin.Forms.3.0.0.446417\lib\netstandard2.0\Xamarin.Forms.Platform.dll</HintPath>
76+
<Private>True</Private>
77+
</Reference>
78+
<Reference Include="Xamarin.Forms.Platform.GTK, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null">
79+
<HintPath>..\packages\Xamarin.Forms.Platform.GTK.3.0.0.446417\lib\net45\Xamarin.Forms.Platform.GTK.dll</HintPath>
80+
<Private>True</Private>
81+
</Reference>
82+
<Reference Include="Xamarin.Forms.Xaml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null">
83+
<HintPath>..\packages\Xamarin.Forms.3.0.0.446417\lib\netstandard2.0\Xamarin.Forms.Xaml.dll</HintPath>
84+
<Private>True</Private>
85+
</Reference>
86+
<Reference Include="Xamarin.Forms.Xaml.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null">
87+
<HintPath>..\packages\Xamarin.Forms.3.0.0.446417\lib\netstandard2.0\Design\Xamarin.Forms.Xaml.Design.dll</HintPath>
88+
<Private>True</Private>
89+
</Reference>
90+
</ItemGroup>
91+
<ItemGroup>
92+
<Compile Include="Program.cs" />
93+
<Compile Include="Properties\AssemblyInfo.cs" />
94+
</ItemGroup>
95+
<ItemGroup>
96+
<None Include="OpenTK.dll.config" />
97+
<None Include="packages.config" />
98+
<None Include="webkit-sharp.dll.config" />
99+
</ItemGroup>
100+
<ItemGroup>
101+
<ProjectReference Include="..\..\..\Source\ZXing.Net.Mobile.Core\ZXing.Net.Mobile.Core.csproj">
102+
<Project>{7528dd0a-1781-47f4-adbf-eeddb011f6bb}</Project>
103+
<Name>ZXing.Net.Mobile.Core</Name>
104+
</ProjectReference>
105+
<ProjectReference Include="..\..\..\Source\ZXing.Net.Mobile.Forms.GTK\ZXing.Net.Mobile.Forms.GTK.csproj">
106+
<Project>{7aa0abcf-dbf1-4190-8e82-44dd736be2f3}</Project>
107+
<Name>ZXing.Net.Mobile.Forms.GTK</Name>
108+
</ProjectReference>
109+
<ProjectReference Include="..\..\..\Source\ZXing.Net.Mobile.GTK\ZXing.Net.Mobile.GTK.csproj">
110+
<Project>{007476ef-d7ca-4198-bded-3544d0ebd546}</Project>
111+
<Name>ZXing.Net.Mobile.GTK</Name>
112+
</ProjectReference>
113+
<ProjectReference Include="..\..\..\Source\ZXing.Net\Source\lib\zxing.portable.csproj">
114+
<Project>{24b441f2-cbe9-4405-9fd0-72ebcbea0ec3}</Project>
115+
<Name>zxing.portable</Name>
116+
</ProjectReference>
117+
<ProjectReference Include="..\Core\FormsSample.csproj">
118+
<Project>{0daf97ca-02db-4e4f-9163-b8f14eae2d90}</Project>
119+
<Name>FormsSample</Name>
120+
</ProjectReference>
121+
</ItemGroup>
122+
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
123+
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
124+
<PropertyGroup>
125+
<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>
126+
</PropertyGroup>
127+
<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'))" />
128+
<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'))" />
129+
</Target>
130+
<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')" />
131+
</Project>

Samples/Forms/GTK/OpenTK.dll.config

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<configuration>
2+
<dllmap os="linux" dll="opengl32.dll" target="libGL.so.1"/>
3+
<dllmap os="linux" dll="glu32.dll" target="libGLU.so.1"/>
4+
<dllmap os="linux" dll="openal32.dll" target="libopenal.so.1"/>
5+
<dllmap os="linux" dll="alut.dll" target="libalut.so.0"/>
6+
<dllmap os="linux" dll="opencl.dll" target="libOpenCL.so"/>
7+
<dllmap os="linux" dll="libX11" target="libX11.so.6"/>
8+
<dllmap os="linux" dll="libXi" target="libXi.so.6"/>
9+
<dllmap os="linux" dll="SDL2.dll" target="libSDL2-2.0.so.0"/>
10+
<dllmap os="osx" dll="opengl32.dll" target="/System/Library/Frameworks/OpenGL.framework/OpenGL"/>
11+
<dllmap os="osx" dll="openal32.dll" target="/System/Library/Frameworks/OpenAL.framework/OpenAL" />
12+
<dllmap os="osx" dll="alut.dll" target="/System/Library/Frameworks/OpenAL.framework/OpenAL" />
13+
<dllmap os="osx" dll="libGLES.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
14+
<dllmap os="osx" dll="libGLESv1_CM.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
15+
<dllmap os="osx" dll="libGLESv2.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
16+
<dllmap os="osx" dll="opencl.dll" target="/System/Library/Frameworks/OpenCL.framework/OpenCL"/>
17+
<dllmap os="osx" dll="SDL2.dll" target="libSDL2.dylib"/>
18+
<!-- XQuartz compatibility (X11 on Mac) -->
19+
<dllmap os="osx" dll="libGL.so.1" target="/usr/X11/lib/libGL.dylib"/>
20+
<dllmap os="osx" dll="libX11" target="/usr/X11/lib/libX11.dylib"/>
21+
<dllmap os="osx" dll="libXcursor.so.1" target="/usr/X11/lib/libXcursor.dylib"/>
22+
<dllmap os="osx" dll="libXi" target="/usr/X11/lib/libXi.dylib"/>
23+
<dllmap os="osx" dll="libXinerama" target="/usr/X11/lib/libXinerama.dylib"/>
24+
<dllmap os="osx" dll="libXrandr.so.2" target="/usr/X11/lib/libXrandr.dylib"/>
25+
</configuration>

Samples/Forms/GTK/Program.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using System;
2+
using Xamarin.Forms;
3+
using Xamarin.Forms.Platform.GTK;
4+
using Application = Gtk.Application;
5+
6+
namespace FormsSample.GTK
7+
{
8+
class MainClass
9+
{
10+
public static void Main(string[] args)
11+
{
12+
Application.Init();
13+
Forms.Init();
14+
ZXing.Net.Mobile.Forms.GTK.Platform.Init ();
15+
16+
var app = new App();
17+
var window = new FormsWindow();
18+
window.LoadApplication(app);
19+
window.SetApplicationTitle("GTK example");
20+
window.Show();
21+
Application.Run();
22+
}
23+
}
24+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
4+
// Information about this assembly is defined by the following attributes.
5+
// Change them to the values specific to your project.
6+
7+
[assembly: AssemblyTitle("FormsSample.GTK")]
8+
[assembly: AssemblyDescription("")]
9+
[assembly: AssemblyConfiguration("")]
10+
[assembly: AssemblyCompany("")]
11+
[assembly: AssemblyProduct("")]
12+
[assembly: AssemblyCopyright("${AuthorCopyright}")]
13+
[assembly: AssemblyTrademark("")]
14+
[assembly: AssemblyCulture("")]
15+
16+
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
17+
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
18+
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
19+
20+
[assembly: AssemblyVersion("1.0.*")]
21+
22+
// The following attributes are used to specify the signing key for the assembly,
23+
// if desired. See the Mono documentation for more information about signing.
24+
25+
//[assembly: AssemblyDelaySign(false)]
26+
//[assembly: AssemblyKeyFile("")]

Samples/Forms/GTK/packages.config

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="Xamarin.Forms" version="3.0.0.446417" targetFramework="net47" />
4+
<package id="Xamarin.Forms.Platform.GTK" version="3.0.0.446417" targetFramework="net47" />
5+
</packages>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<configuration>
2+
<dllmap dll="webkit-1.0" target="libwebkitgtk-1.0.0.dylib"/>
3+
<dllmap dll="webkit-1.0" os="linux" target="libwebkitgtk-1.0.so.0"/>
4+
<dllmap dll="webkit-1.0" os="windows" target="libwebkitgtk-1.0-0.dll"/>
5+
</configuration>

0 commit comments

Comments
 (0)