Skip to content

Commit

Permalink
* Add empty Template for GTK
Browse files Browse the repository at this point in the history
* Add GTK to the dotnet template
  • Loading branch information
mallibone committed Jan 2, 2019
1 parent d2030ef commit 6b3ecbc
Show file tree
Hide file tree
Showing 8 changed files with 260 additions and 0 deletions.
21 changes: 21 additions & 0 deletions templates/content/blank/.template.config/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
"condition": "Android",
"path": "NewApp.Android\\NewApp.Android.fsproj"
},
{
"condition": "GTK",
"path": "NewApp.GTK\\NewApp.GTK.fsproj"
},
{
"condition": "WPF",
"path": "NewApp.WPF\\NewApp.WPF.fsproj"
Expand Down Expand Up @@ -178,6 +182,11 @@
"dataType": "bool",
"defaultValue": "false"
},
"GTK": {
"type": "parameter",
"dataType": "bool",
"defaultValue": "false"
},
"WPF": {
"type": "parameter",
"dataType": "bool",
Expand Down Expand Up @@ -216,6 +225,12 @@
"NewApp.Android/**/*"
]
},
{
"condition": "(!GTK)",
"exclude": [
"NewApp.GTK/**/*"
]
},
{
"condition": "(!WPF)",
"exclude": [
Expand Down Expand Up @@ -246,6 +261,12 @@
"NewApp.Android/**/*"
]
},
{
"condition": "(!GTK)",
"exclude": [
"NewApp.GTK/**/*"
]
},
{
"condition": "(!WPF)",
"exclude": [
Expand Down
20 changes: 20 additions & 0 deletions templates/content/blank/NewApp.Gtk/AssemblyInfo.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
namespace NewApp.Gtk
open System.Reflection
open System.Runtime.CompilerServices

[<assembly: AssemblyTitle("NewApp.Gtk")>]
[<assembly: AssemblyDescription("")>]
[<assembly: AssemblyConfiguration("")>]
[<assembly: AssemblyCompany("")>]
[<assembly: AssemblyProduct("")>]
[<assembly: AssemblyCopyright("")>]
[<assembly: AssemblyTrademark("")>]

// The assembly version has the format {Major}.{Minor}.{Build}.{Revision}

[<assembly: AssemblyVersion("1.0.0.0")>]

//[<assembly: AssemblyDelaySign(false)>]
//[<assembly: AssemblyKeyFile("")>]

()
20 changes: 20 additions & 0 deletions templates/content/blank/NewApp.Gtk/Main.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
namespace NewApp.Gtk
module Main =

open System
open Xamarin.Forms
open Xamarin.Forms.Platform.GTK

[<EntryPoint>]
let Main(args) =
Gtk.Application.Init()
Forms.Init()

let app = new NewApp.App()
let window = new FormsWindow()
window.LoadApplication(app)
window.SetApplicationTitle("Hello Fabulous GTK#")
window.Show();

Gtk.Application.Run()
0
109 changes: 109 additions & 0 deletions templates/content/blank/NewApp.Gtk/NewApp.Gtk.fsproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
<?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.XamarinFormsSdk\build\netstandard2.0\Xamarin.Forms.props" Condition="Exists('..\packages\Xamarin.Forms.XamarinFormsSdk\build\netstandard2.0\Xamarin.Forms.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{C6A6BA94-897C-48B5-8046-3DF33897BA94}</ProjectGuid>
<UseStandardResourceNames>true</UseStandardResourceNames>
<OutputType>WinExe</OutputType>
<RootNamespace>NewApp.Gtk</RootNamespace>
<AssemblyName>NewApp.Gtk</AssemblyName>
<TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<PlatformTarget></PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<DefineConstants></DefineConstants>
<ErrorReport>prompt</ErrorReport>
<GenerateTailCalls>true</GenerateTailCalls>
<PlatformTarget></PlatformTarget>
</PropertyGroup>
<PropertyGroup>
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>
<PropertyGroup Condition="'$(VisualStudioVersion)' == '10.0' OR '$(VisualStudioVersion)' == '11.0'">
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>
<ItemGroup>
<Reference Include="mscorlib" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="gtk-sharp, Version=2.4.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
<Package>gtk-sharp-2.0</Package>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="gdk-sharp, Version=2.4.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
<Package>gtk-sharp-2.0</Package>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="glib-sharp, Version=2.4.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
<Package>glib-sharp-2.0</Package>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="glade-sharp, Version=2.4.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="pango-sharp, Version=2.4.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
<Package>gtk-sharp-2.0</Package>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="atk-sharp, Version=2.4.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
<Package>gtk-sharp-2.0</Package>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="OpenTK">
<HintPath>..\packages\Xamarin.Forms.Platform.GTK.XamarinFormsSdk\lib\net45\OpenTK.dll</HintPath>
</Reference>
<Reference Include="webkit-sharp">
<HintPath>..\packages\Xamarin.Forms.Platform.GTK.XamarinFormsSdk\lib\net45\webkit-sharp.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform.GTK">
<HintPath>..\packages\Xamarin.Forms.Platform.GTK.XamarinFormsSdk\lib\net45\Xamarin.Forms.Platform.GTK.dll</HintPath>
</Reference>
<Reference Include="FSharp.Core">
<HintPath>..\packages\FSharp.Core.FSharpCorePkgVersion\lib\net45\FSharp.Core.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Core">
<HintPath>..\packages\Xamarin.Forms.XamarinFormsSdk\lib\netstandard2.0\Xamarin.Forms.Core.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform">
<HintPath>..\packages\Xamarin.Forms.XamarinFormsSdk\lib\netstandard2.0\Xamarin.Forms.Platform.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Xaml">
<HintPath>..\packages\Xamarin.Forms.XamarinFormsSdk\lib\netstandard2.0\Xamarin.Forms.Xaml.dll</HintPath>
</Reference>
<Reference Include="Fabulous.Core">
<HintPath>..\packages\Fabulous.Core.FabulousPkgsVersion\lib\netstandard2.0\Fabulous.Core.dll</HintPath>
</Reference>
<Reference Include="Fabulous.CustomControls">
<HintPath>..\packages\Fabulous.CustomControls.FabulousPkgsVersion\lib\netstandard2.0\Fabulous.CustomControls.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>..\packages\Newtonsoft.Json.NewtonsoftJsonPkg\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.fs" />
<Compile Include="Main.fs" />
<None Include="packages.config" />
<None Include="webkit-sharp.dll.config" />
<None Include="OpenTK.dll.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NewApp\NewApp.fsproj">
<Project>{B7ADC7B5-53E0-424E-A43F-D59B8638B9C5}</Project>
<Name>NewApp</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(FSharpTargetsPath)" />
<Import Project="..\packages\Xamarin.Forms.XamarinFormsSdk\build\netstandard2.0\Xamarin.Forms.targets" Condition="Exists('..\packages\Xamarin.Forms.XamarinFormsSdk\build\netstandard2.0\Xamarin.Forms.targets')" />
</Project>
25 changes: 25 additions & 0 deletions templates/content/blank/NewApp.Gtk/OpenTK.dll.config
Original file line number Diff line number Diff line change
@@ -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>
9 changes: 9 additions & 0 deletions templates/content/blank/NewApp.Gtk/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Fabulous.Core" version="FabulousPkgsVersion" targetFramework="net471" />
<package id="Fabulous.CustomControls" version="FabulousPkgsVersion" targetFramework="net472" />
<package id="FSharp.Core" version="FSharpCorePkgVersion" targetFramework="net451" />
<package id="Newtonsoft.Json" version="NewtonsoftJsonPkg" targetFramework="net471" />
<package id="Xamarin.Forms" version="XamarinFormsSdk" targetFramework="net471" />
<package id="Xamarin.Forms.Platform.GTK" version="XamarinFormsSdk" targetFramework="net451" />
</packages>
3 changes: 3 additions & 0 deletions templates/content/blank/NewApp.Gtk/webkit-sharp.dll.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<configuration>
<dllmap dll="webkit-1.0" target="/usr/lib/x86_64-linux-gnu/libwebkitgtk-1.0.so"/>
</configuration>
53 changes: 53 additions & 0 deletions templates/content/blank/NewApp.sln
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "NewApp.Android", "NewApp.An
EndProject
#//#endif

#//#if (GTK)
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "NewApp.GTK", "NewApp.GTK\NewApp.GTK.fsproj", "{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}"
EndProject
#//#endif

#//#if (iOS)
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "NewApp.iOS", "NewApp.iOS\NewApp.iOS.fsproj", "{91D74A40-E440-42AD-B51F-C2D641C49384}"
EndProject
Expand Down Expand Up @@ -346,6 +351,54 @@ Global
{8D9F8CF0-E178-402D-8D40-A88B7B5F3D42}.Release|x64.Build.0 = Release|Any CPU
{8D9F8CF0-E178-402D-8D40-A88B7B5F3D42}.Release|x86.ActiveCfg = Release|Any CPU
{8D9F8CF0-E178-402D-8D40-A88B7B5F3D42}.Release|x86.Build.0 = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Ad-Hoc|ARM.ActiveCfg = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Ad-Hoc|ARM.Build.0 = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Ad-Hoc|iPhone.Build.0 = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Ad-Hoc|iPhoneSimulator.Build.0 = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Ad-Hoc|x64.ActiveCfg = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Ad-Hoc|x64.Build.0 = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Ad-Hoc|x86.ActiveCfg = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Ad-Hoc|x86.Build.0 = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.AppStore|Any CPU.ActiveCfg = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.AppStore|Any CPU.Build.0 = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.AppStore|ARM.ActiveCfg = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.AppStore|ARM.Build.0 = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.AppStore|iPhone.ActiveCfg = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.AppStore|iPhone.Build.0 = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.AppStore|iPhoneSimulator.ActiveCfg = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.AppStore|iPhoneSimulator.Build.0 = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.AppStore|x64.ActiveCfg = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.AppStore|x64.Build.0 = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.AppStore|x86.ActiveCfg = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.AppStore|x86.Build.0 = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Debug|ARM.ActiveCfg = Debug|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Debug|ARM.Build.0 = Debug|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Debug|iPhone.Build.0 = Debug|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Debug|x64.ActiveCfg = Debug|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Debug|x64.Build.0 = Debug|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Debug|x86.ActiveCfg = Debug|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Debug|x86.Build.0 = Debug|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Release|Any CPU.Build.0 = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Release|ARM.ActiveCfg = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Release|ARM.Build.0 = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Release|iPhone.ActiveCfg = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Release|iPhone.Build.0 = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Release|x64.ActiveCfg = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Release|x64.Build.0 = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Release|x86.ActiveCfg = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down

0 comments on commit 6b3ecbc

Please sign in to comment.