EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BasicTests", "Samples\BasicTests\BasicTests.csproj", "{7AEB6DD5-916E-4415-84E1-78EC6E5881CE}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PerfTests", "PerfTests\PerfTests.csproj", "{18EBB41F-815E-4BF5-B80F-C9E2FAB2993A}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PerfTests", "Samples\PerfTests\PerfTests.csproj", "{18EBB41F-815E-4BF5-B80F-C9E2FAB2993A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
{56329D48-D382-4850-93DE-59C453894E8A} = {B2C7855A-2878-47FD-AD32-9A83DB4AB8C6}
{91F1CE07-EECE-4F1D-A3EE-7239B563654A} = {B2C7855A-2878-47FD-AD32-9A83DB4AB8C6}
{7AEB6DD5-916E-4415-84E1-78EC6E5881CE} = {B2C7855A-2878-47FD-AD32-9A83DB4AB8C6}
+ {18EBB41F-815E-4BF5-B80F-C9E2FAB2993A} = {B2C7855A-2878-47FD-AD32-9A83DB4AB8C6}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {00D4E149-7131-49F4-BAAD-559AA961A78E}
$6.LineAlign = 0
$6.Wrap = False
description = @C.R.O.W. c# Rapid Open Widgets\n\nCrow is a pure c# widget toolkit with XML definition of interface, bindings, styling...\n
- version = 0.8.0
EndGlobalSection
EndGlobal
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" ?>
+<configuration>
+ <dllmap dll="glfw3" target="libglfw.so" os="!windows"/>
+ <dllmap dll="glfw3.dll" target="libglfw.so" os="!windows"/>
+ <dllmap dll="rsvg-2.40" target="librsvg-2.so" os="!windows"/>
+</configuration>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<AssemblyVersion>$(CrowVersion)</AssemblyVersion>
- <ReleaseVersion>$(CrowVersion)</ReleaseVersion>
<PackageVersion>$(CrowPackageVersion)</PackageVersion>
<Title>C# Rapid Open Widget Toolkit</Title>
<DefineConstants>_DESIGN_MODE</DefineConstants>
<EnableDefaultItems>false</EnableDefaultItems>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
+ <AppConfig>App.config</AppConfig>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugType>full</DebugType>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project Sdk="Microsoft.NET.Sdk">
- <PropertyGroup>
- <TargetFrameworks>net472</TargetFrameworks>
- <OutputType>Exe</OutputType>
- <ReleaseVersion>0.8.0</ReleaseVersion>
- </PropertyGroup>
- <ItemGroup>
- <ProjectReference Include="..\Crow\Crow.csproj" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="$(SolutionDir)Samples\common\ui\Interfaces\**\*.*">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <Link>Interfaces\%(RecursiveDir)%(Filename)%(Extension)</Link>
- </None>
- <EmbeddedResource Include="$(SolutionDir)Samples\common\ui\templates\**\*.*">
- <LogicalName>ui.%(Filename)%(Extension)</LogicalName>
- <Link>Templates\%(Filename)%(Extension)</Link>
- </EmbeddedResource>
- <EmbeddedResource Include="$(SolutionDir)Samples\common\samples.style" />
- <EmbeddedResource Include="$(SolutionDir)Samples\common\ui\images\**\*.*">
- <LogicalName>images.%(Filename)%(Extension)</LogicalName>
- <Link>Images\%(Filename)%(Extension)</Link>
- </EmbeddedResource>
- <EmbeddedResource Include="$(SolutionDir)Samples\common\ui\Icons\*.*">
- <LogicalName>Icons.%(Filename)%(Extension)</LogicalName>
- <Link>Icons\%(Filename)%(Extension)</Link>
- </EmbeddedResource>
- </ItemGroup>
- <ItemGroup>
- <PackageReference Include="GitInfo" Version="2.0.26" />
- </ItemGroup>
-</Project>
\ No newline at end of file
+++ /dev/null
-// Copyright (c) 2013-2020 Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
-//
-// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
-using System;
-using System.CodeDom.Compiler;
-using System.Diagnostics;
-using System.IO;
-using Crow;
-
-namespace PerfTests
-{
- class TestInterface : Interface
- {
- public TestInterface (int width = 800, int height = 600)
- : base (width, height, false, false)
- {
- surf = new Crow.Cairo.ImageSurface (Crow.Cairo.Format.Argb32, ClientRectangle.Width, ClientRectangle.Height);
- Init ();
- }
-
- long Test (string path, out long min, out long max, int count = 10)
- {
- min = long.MaxValue;
- max = long.MinValue;
-
- long total = 0;
-
- Stopwatch sw = new Stopwatch ();
-
- for (int i = 0; i < count; i++) {
- sw.Restart ();
-
-
- Load (path);
- while (LayoutingQueue.Count > 0)
- Update ();
-
- sw.Stop ();
-
- if (sw.ElapsedTicks < min)
- min = sw.ElapsedMilliseconds;
- if (sw.ElapsedTicks > max)
- max = sw.ElapsedMilliseconds;
- total += sw.ElapsedMilliseconds;
-
- }
-
- return total / count;
- }
-
- void testDir (string dirPath, int level = 0)
- {
- Console.WriteLine ($"{new string (' ', level * 4)}- {dirPath}");
- level++;
-
- foreach (string d in Directory.GetDirectories (dirPath))
- testDir (d, level);
-
- foreach (string f in Directory.GetFiles (dirPath)) {
- try {
- long mean = Test (f, out long min, out long max);
- Console.WriteLine ($"{new string (' ', level * 4)}{ Path.GetFileName (f),-30}|{min,5}|{mean,5}|{max,5}");
- } catch (Exception ex) {
- Console.ForegroundColor = ConsoleColor.Red;
- Console.WriteLine ($"- {ex.Message}");
- Console.ResetColor ();
- }
- }
- }
-
-
- public static void Main (string [] args)
- {
- Console.WriteLine ($"git:{ThisAssembly.Git.Commit} {ThisAssembly.Git.Branch} {ThisAssembly.Git.SemVer.Major}.{ThisAssembly.Git.SemVer.Minor}.{ThisAssembly.Git.SemVer.Patch} {ThisAssembly.Git.SemVer.Label}");
- //IndentedTextWriter w = new IndentedTextWriter()
- using (TestInterface iface = new TestInterface ()) {
- iface.testDir ("Interfaces");
- }
- }
- }
-}
{
public class BasicTests : SampleBase
{
- [STAThread]
static void Main ()
{
+#if NETCOREAPP3_1
+ DllMapCore.Resolve.Enable (true);
+#endif
using (BasicTests app = new BasicTests ()) {
app.Run ();
}
else if (idx < 0)
idx = testFiles.Length - 1;
- Console.WriteLine ($"Loading {testFiles [idx]}.");
+ Console.WriteLine ($"Loading {testFiles [idx]}. {AppDomain.CurrentDomain.MonitoringSurvivedMemorySize}");
Load (testFiles [idx]).DataSource = this;
} catch (Exception ex) {
<PropertyGroup>
<TargetFrameworks>net472;netstandard2.0</TargetFrameworks>
<EnableDefaultNoneItems>false</EnableDefaultNoneItems>
- <ReleaseVersion>0.8.0</ReleaseVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<EnableDefaultNoneItems>false</EnableDefaultNoneItems>
<SamplesDir>$(SolutionDir)Samples\</SamplesDir>
</PropertyGroup>
- <PropertyGroup>
- </PropertyGroup>
+
<ItemGroup>
+ <PackageReference Include="DllMapCore" Version="0.1.0" Condition="'$(TargetFramework)'=='netcoreapp3.1'" />
<ProjectReference Include="$(SolutionDir)Crow\Crow.csproj" />
</ItemGroup>
<ItemGroup>
{
class Program {
static void Main (string[] args) {
+#if NETCOREAPP3_1
+ DllMapCore.Resolve.Enable (true);
+#endif
using (Interface app = new Interface ()) {
app.Initialized += (sender, e) => (sender as Interface).Load ("#HelloWorld.helloworld.crow");
app.Run ();
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <!--<ItemGroup>
+ <None Include="$(SolutionDir)Samples\common\ui\Interfaces\**\*.*">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ <Link>Interfaces\%(RecursiveDir)%(Filename)%(Extension)</Link>
+ </None>
+ <EmbeddedResource Include="$(SolutionDir)Samples\common\ui\templates\**\*.*">
+ <LogicalName>ui.%(Filename)%(Extension)</LogicalName>
+ <Link>Templates\%(Filename)%(Extension)</Link>
+ </EmbeddedResource>
+ <EmbeddedResource Include="$(SolutionDir)Samples\common\samples.style" />
+ <EmbeddedResource Include="$(SolutionDir)Samples\common\ui\images\**\*.*">
+ <LogicalName>images.%(Filename)%(Extension)</LogicalName>
+ <Link>Images\%(Filename)%(Extension)</Link>
+ </EmbeddedResource>
+ <EmbeddedResource Include="$(SolutionDir)Samples\common\ui\Icons\*.*">
+ <LogicalName>Icons.%(Filename)%(Extension)</LogicalName>
+ <Link>Icons\%(Filename)%(Extension)</Link>
+ </EmbeddedResource>
+ </ItemGroup>-->
+ <ItemGroup>
+ <PackageReference Include="GitInfo" Version="2.0.26" />
+ </ItemGroup>
+</Project>
\ No newline at end of file
--- /dev/null
+// Copyright (c) 2013-2020 Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
+//
+// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
+using System;
+using System.CodeDom.Compiler;
+using System.Diagnostics;
+using System.IO;
+using Crow;
+
+namespace PerfTests
+{
+ class TestInterface : Interface
+ {
+ public TestInterface (int width = 800, int height = 600)
+ : base (width, height, false, false)
+ {
+ surf = new Crow.Cairo.ImageSurface (Crow.Cairo.Format.Argb32, ClientRectangle.Width, ClientRectangle.Height);
+ Init ();
+ }
+
+ long Test (string path, out long min, out long max, int count = 10)
+ {
+ min = long.MaxValue;
+ max = long.MinValue;
+
+ long total = 0;
+
+ Stopwatch sw = new Stopwatch ();
+
+ for (int i = 0; i < count; i++) {
+ sw.Restart ();
+
+
+ Load (path);
+ while (LayoutingQueue.Count > 0)
+ Update ();
+
+ sw.Stop ();
+
+ if (sw.ElapsedTicks < min)
+ min = sw.ElapsedMilliseconds;
+ if (sw.ElapsedTicks > max)
+ max = sw.ElapsedMilliseconds;
+ total += sw.ElapsedMilliseconds;
+
+ }
+
+ return total / count;
+ }
+
+ void testDir (string dirPath, int level = 0)
+ {
+ Console.WriteLine ($"{new string (' ', level * 4)}- {dirPath}");
+ level++;
+
+ foreach (string d in Directory.GetDirectories (dirPath))
+ testDir (d, level);
+
+ foreach (string f in Directory.GetFiles (dirPath)) {
+ try {
+ long mean = Test (f, out long min, out long max);
+ Console.WriteLine ($"{new string (' ', level * 4)}{ Path.GetFileName (f),-30}|{min,5}|{mean,5}|{max,5}");
+ } catch (Exception ex) {
+ Console.ForegroundColor = ConsoleColor.Red;
+ Console.WriteLine ($"- {ex.Message}");
+ Console.ResetColor ();
+ }
+ }
+ }
+
+
+ public static void Main (string [] args)
+ {
+ Console.WriteLine ($"git:{ThisAssembly.Git.Commit} {ThisAssembly.Git.Branch} {ThisAssembly.Git.SemVer.Major}.{ThisAssembly.Git.SemVer.Minor}.{ThisAssembly.Git.SemVer.Patch} {ThisAssembly.Git.SemVer.Label}");
+ //IndentedTextWriter w = new IndentedTextWriter()
+ using (TestInterface iface = new TestInterface ()) {
+ iface.testDir ("Interfaces");
+ }
+ }
+ }
+}
--- /dev/null
+// Copyright (c) 2013-2019 Bruyère Jean-Philippe <jp_bruyere@hotmail.com>
+//
+// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
+
+using System;
+using Crow;
+using System.IO;
+using System.Text;
+using Crow.IML;
+
+namespace ShowCase
+{
+ class Showcase : Interface
+ {
+
+ static void Main ()
+ {
+#if NETCOREAPP3_1
+ DllMapCore.Resolve.Enable (true);
+#endif
+ using (Showcase app = new Showcase ())
+ app.Run ();
+ }
+
+ public Container crowContainer;
+
+ protected override void OnInitialized ()
+ {
+ Widget g = Load ("#ShowCase.showcase.crow");
+ g.DataSource = this;
+ crowContainer = g.FindByName ("CrowContainer") as Container;
+ //I set an empty object as datasource at this level to force update when new
+ //widgets are added to the interface
+ crowContainer.DataSource = new object ();
+ hideError ();
+ }
+
+ static void App_KeyboardKeyDown (object sender, KeyEventArgs e)
+ {
+#if DEBUG_LOG
+ switch (e.Key) {
+ case Key.F2:
+ DebugLog.save (sender as Interface);
+ break;
+ }
+#endif
+ }
+
+ public Showcase ()
+ : base (1024, 800)
+ {
+ }
+
+
+ void Dv_SelectedItemChanged (object sender, SelectionChangeEventArgs e)
+ {
+ FileSystemInfo fi = e.NewValue as FileSystemInfo;
+ if (fi == null)
+ return;
+ if (fi is DirectoryInfo)
+ return;
+ hideError ();
+ lock (UpdateMutex) {
+ try {
+ Widget g = CreateInstance (fi.FullName);
+ crowContainer.SetChild (g);
+ g.DataSource = this;
+ } catch (Exception ex) {
+ Console.WriteLine (ex.ToString ());
+ showError (ex);
+ }
+ }
+
+ string source = "";
+ using (Stream s = new FileStream (fi.FullName, FileMode.Open)) {
+ using (StreamReader sr = new StreamReader (s)) {
+ source = sr.ReadToEnd ();
+ }
+ }
+ NotifyValueChanged ("source", source);
+ }
+
+ void showError (Exception ex)
+ {
+ NotifyValueChanged ("ErrorMessage", ex.Message);
+ NotifyValueChanged ("ShowError", true);
+ }
+ void hideError ()
+ {
+ NotifyValueChanged ("ShowError", false);
+ }
+
+ void Tb_TextChanged (object sender, TextChangeEventArgs e)
+ {
+ hideError ();
+ Widget g = null;
+ try {
+ lock (UpdateMutex) {
+ Instantiator inst = null;
+ using (MemoryStream ms = new MemoryStream (Encoding.UTF8.GetBytes (e.Text))) {
+ inst = new Instantiator (this, ms);
+ }
+ g = inst.CreateInstance ();
+ crowContainer.SetChild (g);
+ g.DataSource = this;
+ }
+ } catch (Exception ex) {
+ Console.WriteLine (ex.ToString ());
+ showError ((Exception)ex);
+ }
+ }
+
+
+ }
+}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
-
<ItemGroup>
<EmbeddedResource Include="ui\*.*">
<LogicalName>ShowCase.%(Filename)%(Extension)</LogicalName>
</ItemGroup>
<ItemGroup>
<None Remove="..\common\ui\Interfaces\basicTests\7.crow" />
- </ItemGroup>
+ </ItemGroup>
</Project>
\ No newline at end of file
+++ /dev/null
-// Copyright (c) 2013-2019 Bruyère Jean-Philippe <jp_bruyere@hotmail.com>
-//
-// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
-
-using System;
-using Crow;
-using System.IO;
-using System.Collections.Generic;
-using System.Reflection;
-using System.Linq;
-using System.Text;
-using Crow.IML;
-
-namespace tests
-{
- class Showcase : Interface
- {
- public Container crowContainer;
-
- [STAThread]
- static void Main ()
- {
- using (Showcase app = new Showcase ()) {
- //app.Keyboard.KeyDown += App_KeyboardKeyDown;
-
- app.Run ();
-
- }
- }
-
- protected override void OnInitialized ()
- {
- Widget g = Load ("#ShowCase.showcase.crow");
- g.DataSource = this;
- crowContainer = g.FindByName ("CrowContainer") as Container;
- //I set an empty object as datasource at this level to force update when new
- //widgets are added to the interface
- crowContainer.DataSource = new object ();
- hideError ();
- }
-
- static void App_KeyboardKeyDown (object sender, KeyEventArgs e)
- {
-#if DEBUG_LOG
- switch (e.Key) {
- case Key.F2:
- DebugLog.save (sender as Interface);
- break;
- }
-#endif
- }
-
- public Showcase ()
- : base (1024, 800)
- {
- }
-
-
- void Dv_SelectedItemChanged (object sender, SelectionChangeEventArgs e)
- {
- FileSystemInfo fi = e.NewValue as FileSystemInfo;
- if (fi == null)
- return;
- if (fi is DirectoryInfo)
- return;
- hideError ();
- lock (UpdateMutex) {
- try {
- Widget g = CreateInstance (fi.FullName);
- crowContainer.SetChild (g);
- g.DataSource = this;
- } catch (Exception ex) {
- Console.WriteLine (ex.ToString ());
- showError (ex);
- }
- }
-
- string source = "";
- using (Stream s = new FileStream (fi.FullName, FileMode.Open)) {
- using (StreamReader sr = new StreamReader (s)) {
- source = sr.ReadToEnd ();
- }
- }
- NotifyValueChanged ("source", source);
- }
-
- void showError (Exception ex)
- {
- NotifyValueChanged ("ErrorMessage", ex.Message);
- NotifyValueChanged ("ShowError", true);
- }
- void hideError ()
- {
- NotifyValueChanged ("ShowError", false);
- }
-
- void Tb_TextChanged (object sender, TextChangeEventArgs e)
- {
- hideError ();
- Widget g = null;
- try {
- lock (UpdateMutex) {
- Instantiator inst = null;
- using (MemoryStream ms = new MemoryStream (Encoding.UTF8.GetBytes (e.Text))) {
- inst = new Instantiator (this, ms);
- }
- g = inst.CreateInstance ();
- crowContainer.SetChild (g);
- g.DataSource = this;
- }
- } catch (Exception ex) {
- Console.WriteLine (ex.ToString ());
- showError ((Exception)ex);
- }
- }
-
-
- }
-}
\ No newline at end of file
namespace Crow
{
- public class SampleBase : Interface {
+ public class SampleBase : Interface {
public Version CrowVersion => Assembly.GetAssembly (typeof (Widget)).GetName ().Version;
#region Test values for Binding
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
- <ReleaseVersion>0.8.0</ReleaseVersion>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugType>full</DebugType>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="NUnit" Version="3.12.0" />