Compare commits
11 Commits
3b52649ad2
...
blurg-test
| Author | SHA1 | Date | |
|---|---|---|---|
| 3f1875252e | |||
| 65609bf685 | |||
| a95ddb46ad | |||
| dadd9f137a | |||
| 23fc485b2a | |||
| c6c76aa8be | |||
| 6670667ff6 | |||
| d06264e424 | |||
| a1f4e6a4dc | |||
| 470475092a | |||
| 1ee492ccd4 |
26
Dashboard.BlurgText/BlurgCommand.cs
Normal file
26
Dashboard.BlurgText/BlurgCommand.cs
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
using BlurgText;
|
||||||
|
using Dashboard.CommandMachine;
|
||||||
|
|
||||||
|
namespace Dashboard.BlurgText
|
||||||
|
{
|
||||||
|
public static class BlurgCommand
|
||||||
|
{
|
||||||
|
public static void PutBlurgText(this CommandList list, DashboardBlurg blurg, BlurgResult result, QVec2 origin)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < result.Count; i++)
|
||||||
|
{
|
||||||
|
BlurgRect rect = result[i];
|
||||||
|
|
||||||
|
QRectangle pos = new QRectangle()
|
||||||
|
{
|
||||||
|
Min = origin + new QVec2(rect.X, rect.Y),
|
||||||
|
Size = new QVec2(rect.Width, rect.Height)
|
||||||
|
};
|
||||||
|
|
||||||
|
QRectangle uv = new QRectangle(rect.U1, rect.V1, rect.U0, rect.V0);
|
||||||
|
|
||||||
|
list.Image(blurg.Images[(int)rect.UserData], pos, uv);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
14
Dashboard.BlurgText/Dashboard.BlurgText.csproj
Normal file
14
Dashboard.BlurgText/Dashboard.BlurgText.csproj
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Dashboard\Dashboard.csproj" />
|
||||||
|
<PackageReference Include="BlurgText" Version="0.1.0-nightly-4" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
63
Dashboard.BlurgText/DashboardBlurg.cs
Normal file
63
Dashboard.BlurgText/DashboardBlurg.cs
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
|
||||||
|
using BlurgText;
|
||||||
|
using Dashboard.Media;
|
||||||
|
using Dashboard.Media.Color;
|
||||||
|
|
||||||
|
namespace Dashboard.BlurgText
|
||||||
|
{
|
||||||
|
public class DashboardBlurg : IDisposable
|
||||||
|
{
|
||||||
|
private readonly List<QImageBuffer> images = new List<QImageBuffer>();
|
||||||
|
|
||||||
|
public Blurg Blurg { get; }
|
||||||
|
|
||||||
|
public IReadOnlyList<QImageBuffer> Images => images.AsReadOnly();
|
||||||
|
|
||||||
|
public DashboardBlurg()
|
||||||
|
{
|
||||||
|
Blurg = new Blurg(TextureAllocationCallback, TextureUpdateCallback);
|
||||||
|
}
|
||||||
|
|
||||||
|
private nint TextureAllocationCallback(int width, int height)
|
||||||
|
{
|
||||||
|
QImageBuffer image = new QImageBuffer(QImageFormat.RgbaU8, width, height);
|
||||||
|
images.Add(image);
|
||||||
|
return images.Count - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void TextureUpdateCallback(nint userData, nint buffer, int x, int y, int width, int height)
|
||||||
|
{
|
||||||
|
if (width == 0 || height == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
QImageLock src = new QImageLock(QImageFormat.RgbaU8, width, height, 1, buffer);
|
||||||
|
QImageBuffer image = images[(int)userData];
|
||||||
|
image.LockBits2d(out QImageLock dest, QImageLockOptions.Default);
|
||||||
|
|
||||||
|
src.CopyTo(dest, x, y);
|
||||||
|
image.UnlockBits();
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool _isDisposed = false;
|
||||||
|
private void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (_isDisposed) return;
|
||||||
|
|
||||||
|
if (disposing)
|
||||||
|
{
|
||||||
|
Blurg.Dispose();
|
||||||
|
|
||||||
|
foreach (QImageBuffer image in images)
|
||||||
|
{
|
||||||
|
image.Dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
images.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
_isDisposed = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Dispose() => Dispose(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -8,12 +8,12 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="ReFuel.FreeType" Version="0.1.0-rc.3" />
|
<PackageReference Include="ReFuel.FreeType" Version="0.1.0-rc.5" />
|
||||||
<PackageReference Include="ReFuel.StbImage" Version="2.0.0-rc.3" />
|
<PackageReference Include="ReFuel.StbImage" Version="2.0.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\Quik\Quik.csproj" />
|
<ProjectReference Include="..\Dashboard\Dashboard.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace Quik.Media.Defaults
|
namespace Dashboard.Media.Defaults
|
||||||
{
|
{
|
||||||
internal static class EnvironmentVariables
|
internal static class EnvironmentVariables
|
||||||
{
|
{
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using ReFuel.FreeType;
|
using ReFuel.FreeType;
|
||||||
|
|
||||||
namespace Quik.Media.Defaults
|
namespace Dashboard.Media.Defaults
|
||||||
{
|
{
|
||||||
public static class FTProvider
|
public static class FTProvider
|
||||||
{
|
{
|
||||||
@@ -5,11 +5,11 @@ using System.Linq;
|
|||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using ReFuel.FreeType;
|
using ReFuel.FreeType;
|
||||||
using Quik.Media.Font;
|
using Dashboard.Media.Font;
|
||||||
using Quik.PAL;
|
using Dashboard.PAL;
|
||||||
using Quik.Media.Defaults.Linux;
|
using Dashboard.Media.Defaults.Linux;
|
||||||
|
|
||||||
namespace Quik.Media.Defaults.Fallback
|
namespace Dashboard.Media.Defaults.Fallback
|
||||||
{
|
{
|
||||||
public class FallbackFontDatabase : IFontDataBase
|
public class FallbackFontDatabase : IFontDataBase
|
||||||
{
|
{
|
||||||
@@ -4,12 +4,12 @@ using System.IO;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using ReFuel.FreeType;
|
using ReFuel.FreeType;
|
||||||
using Quik.Media.Defaults.Fallback;
|
using Dashboard.Media.Defaults.Fallback;
|
||||||
using Quik.Media.Defaults.Linux;
|
using Dashboard.Media.Defaults.Linux;
|
||||||
using Quik.Media.Font;
|
using Dashboard.Media.Font;
|
||||||
using Quik.PAL;
|
using Dashboard.PAL;
|
||||||
|
|
||||||
namespace Quik.Media.Defaults
|
namespace Dashboard.Media.Defaults
|
||||||
{
|
{
|
||||||
public static class FontDataBaseProvider
|
public static class FontDataBaseProvider
|
||||||
{
|
{
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
|
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using Quik.PAL;
|
using Dashboard.PAL;
|
||||||
|
|
||||||
namespace Quik.Media.Defaults
|
namespace Dashboard.Media.Defaults
|
||||||
{
|
{
|
||||||
public class FreeTypeFontFactory : IFontFactory
|
public class FreeTypeFontFactory : IFontFactory
|
||||||
{
|
{
|
||||||
@@ -2,9 +2,9 @@ using System;
|
|||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Quik;
|
using Dashboard;
|
||||||
|
|
||||||
namespace Quik.Media.Defaults
|
namespace Dashboard.Media.Defaults
|
||||||
{
|
{
|
||||||
public static unsafe class FontConfig
|
public static unsafe class FontConfig
|
||||||
{
|
{
|
||||||
@@ -6,10 +6,10 @@ using System.Runtime.CompilerServices;
|
|||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using ReFuel.FreeType;
|
using ReFuel.FreeType;
|
||||||
using Quik.Media.Font;
|
using Dashboard.Media.Font;
|
||||||
using Quik.PAL;
|
using Dashboard.PAL;
|
||||||
|
|
||||||
namespace Quik.Media.Defaults.Linux
|
namespace Dashboard.Media.Defaults.Linux
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Font database for Linux libfontconfig systems.
|
/// Font database for Linux libfontconfig systems.
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace Quik.Media.Defaults.Linux
|
namespace Dashboard.Media.Defaults.Linux
|
||||||
{
|
{
|
||||||
internal static class LinuxFonts
|
internal static class LinuxFonts
|
||||||
{
|
{
|
||||||
@@ -2,10 +2,10 @@ using System;
|
|||||||
using System.Buffers;
|
using System.Buffers;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using ReFuel.FreeType;
|
using ReFuel.FreeType;
|
||||||
using Quik.Media.Color;
|
using Dashboard.Media.Color;
|
||||||
using Quik.Media.Font;
|
using Dashboard.Media.Font;
|
||||||
|
|
||||||
namespace Quik.Media.Defaults
|
namespace Dashboard.Media.Defaults
|
||||||
{
|
{
|
||||||
public class QFontFreeType : QFont
|
public class QFontFreeType : QFont
|
||||||
{
|
{
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using Quik.Media.Color;
|
using Dashboard.Media.Color;
|
||||||
using ReFuel.Stb;
|
using ReFuel.Stb;
|
||||||
|
|
||||||
namespace Quik.Media.Defaults
|
namespace Dashboard.Media.Defaults
|
||||||
{
|
{
|
||||||
public unsafe class QImageStbi : QImage
|
public unsafe class QImageStbi : QImage
|
||||||
{
|
{
|
||||||
@@ -4,12 +4,12 @@ using System.Collections;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using Quik.Media.Font;
|
using Dashboard.Media.Font;
|
||||||
|
|
||||||
// WebRequest is obsolete but runs on .NET framework.
|
// WebRequest is obsolete but runs on .NET framework.
|
||||||
#pragma warning disable SYSLIB0014
|
#pragma warning disable SYSLIB0014
|
||||||
|
|
||||||
namespace Quik.Media.Defaults
|
namespace Dashboard.Media.Defaults
|
||||||
{
|
{
|
||||||
public class StbMediaLoader : MediaLoader<string>, MediaLoader<Uri>, MediaLoader<FileInfo>, MediaLoader<FontFace>
|
public class StbMediaLoader : MediaLoader<string>, MediaLoader<Uri>, MediaLoader<FileInfo>, MediaLoader<FontFace>
|
||||||
{
|
{
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\Quik\Quik.csproj" />
|
<ProjectReference Include="..\Dashboard\Dashboard.csproj" />
|
||||||
<EmbeddedResource Include="glsl\**"/>
|
<EmbeddedResource Include="glsl\**"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
@@ -2,14 +2,14 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using OpenTK.Windowing.Desktop;
|
using OpenTK.Windowing.Desktop;
|
||||||
using OpenTK.Windowing.GraphicsLibraryFramework;
|
using OpenTK.Windowing.GraphicsLibraryFramework;
|
||||||
using Quik.CommandMachine;
|
using Dashboard.CommandMachine;
|
||||||
using Quik.Media;
|
using Dashboard.Media;
|
||||||
using Quik.OpenGL;
|
using Dashboard.OpenGL;
|
||||||
using Quik.PAL;
|
using Dashboard.PAL;
|
||||||
|
|
||||||
namespace Quik.OpenTK
|
namespace Dashboard.OpenTK
|
||||||
{
|
{
|
||||||
public class OpenTKPlatform : IQuikPlatform
|
public class OpenTKPlatform : IDashboardPlatform
|
||||||
{
|
{
|
||||||
private readonly List<OpenTKPort> _ports = new List<OpenTKPort>();
|
private readonly List<OpenTKPort> _ports = new List<OpenTKPort>();
|
||||||
|
|
||||||
@@ -25,7 +25,7 @@ namespace Quik.OpenTK
|
|||||||
|
|
||||||
private bool IsGLInitialized = false;
|
private bool IsGLInitialized = false;
|
||||||
|
|
||||||
public IQuikPortHandle CreatePort()
|
public IDashHandle CreatePort()
|
||||||
{
|
{
|
||||||
NativeWindow window = new NativeWindow(DefaultSettings);
|
NativeWindow window = new NativeWindow(DefaultSettings);
|
||||||
OpenTKPort port = new OpenTKPort(window);
|
OpenTKPort port = new OpenTKPort(window);
|
||||||
@@ -62,31 +62,31 @@ namespace Quik.OpenTK
|
|||||||
NativeWindow.ProcessWindowEvents(block);
|
NativeWindow.ProcessWindowEvents(block);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DestroyPort(IQuikPortHandle port) => ((OpenTKPort)port).Dispose();
|
public void DestroyPort(IDashHandle port) => ((OpenTKPort)port).Dispose();
|
||||||
|
|
||||||
public string PortGetTitle(IQuikPortHandle port) => ((OpenTKPort)port).Title;
|
public string PortGetTitle(IDashHandle port) => ((OpenTKPort)port).Title;
|
||||||
|
|
||||||
public void PortSetTitle(IQuikPortHandle port, string title) => ((OpenTKPort)port).Title = title;
|
public void PortSetTitle(IDashHandle port, string title) => ((OpenTKPort)port).Title = title;
|
||||||
|
|
||||||
public QVec2 PortGetSize(IQuikPortHandle port) => ((OpenTKPort)port).Size;
|
public QVec2 PortGetSize(IDashHandle port) => ((OpenTKPort)port).Size;
|
||||||
|
|
||||||
public void PortSetSize(IQuikPortHandle port, QVec2 size) => ((OpenTKPort)port).Size = size;
|
public void PortSetSize(IDashHandle port, QVec2 size) => ((OpenTKPort)port).Size = size;
|
||||||
|
|
||||||
public QVec2 PortGetPosition(IQuikPortHandle port) => ((OpenTKPort)port).Position;
|
public QVec2 PortGetPosition(IDashHandle port) => ((OpenTKPort)port).Position;
|
||||||
|
|
||||||
public void PortSetPosition(IQuikPortHandle port, QVec2 position) => ((OpenTKPort)port).Position = position;
|
public void PortSetPosition(IDashHandle port, QVec2 position) => ((OpenTKPort)port).Position = position;
|
||||||
|
|
||||||
public bool PortIsValid(IQuikPortHandle port) => ((OpenTKPort)port).IsValid;
|
public bool PortIsValid(IDashHandle port) => ((OpenTKPort)port).IsValid;
|
||||||
|
|
||||||
public void PortSubscribeEvent(IQuikPortHandle port, EventHandler handler) => ((OpenTKPort)port).EventRaised += handler;
|
public void PortSubscribeEvent(IDashHandle port, EventHandler handler) => ((OpenTKPort)port).EventRaised += handler;
|
||||||
|
|
||||||
public void PortUnsubscribeEvent(IQuikPortHandle port, EventHandler handler) => ((OpenTKPort)port).EventRaised -= handler;
|
public void PortUnsubscribeEvent(IDashHandle port, EventHandler handler) => ((OpenTKPort)port).EventRaised -= handler;
|
||||||
|
|
||||||
public void PortFocus(IQuikPortHandle port) => ((OpenTKPort)port).Focus();
|
public void PortFocus(IDashHandle port) => ((OpenTKPort)port).Focus();
|
||||||
|
|
||||||
public void PortShow(IQuikPortHandle port, bool shown = true) => ((OpenTKPort)port).Show(shown);
|
public void PortShow(IDashHandle port, bool shown = true) => ((OpenTKPort)port).Show(shown);
|
||||||
|
|
||||||
public void PortPaint(IQuikPortHandle port, CommandList commands) => ((OpenTKPort)port).Paint(commands);
|
public void PortPaint(IDashHandle port, CommandList commands) => ((OpenTKPort)port).Paint(commands);
|
||||||
|
|
||||||
public void GetMaximumImage(out int width, out int height)
|
public void GetMaximumImage(out int width, out int height)
|
||||||
{
|
{
|
||||||
@@ -1,14 +1,14 @@
|
|||||||
using System;
|
using System;
|
||||||
using OpenTK.Mathematics;
|
using OpenTK.Mathematics;
|
||||||
using OpenTK.Windowing.Desktop;
|
using OpenTK.Windowing.Desktop;
|
||||||
using Quik.OpenGL;
|
using Dashboard.OpenGL;
|
||||||
using Quik.CommandMachine;
|
using Dashboard.CommandMachine;
|
||||||
using Quik.PAL;
|
using Dashboard.PAL;
|
||||||
using Quik.VertexGenerator;
|
using Dashboard.VertexGenerator;
|
||||||
|
|
||||||
namespace Quik.OpenTK
|
namespace Dashboard.OpenTK
|
||||||
{
|
{
|
||||||
public class OpenTKPort : IQuikPortHandle
|
public class OpenTKPort : IDashHandle
|
||||||
{
|
{
|
||||||
private readonly NativeWindow _window;
|
private readonly NativeWindow _window;
|
||||||
private readonly GL21Driver _glDriver;
|
private readonly GL21Driver _glDriver;
|
||||||
51
Dashboard.sln
Normal file
51
Dashboard.sln
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio Version 17
|
||||||
|
VisualStudioVersion = 17.0.31903.59
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dashboard", "Dashboard\Dashboard.csproj", "{4FE772DD-F424-4EAC-BF88-CB8F751B4926}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dashboard.Media.Defaults", "Dashboard.Media.Defaults\Dashboard.Media.Defaults.csproj", "{3798F6DD-8F84-4B7D-A810-B0D4B5ACB672}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dashboard.OpenTK", "Dashboard.OpenTK\Dashboard.OpenTK.csproj", "{2013470A-915C-46F2-BDD3-FCAA39C845EE}"
|
||||||
|
EndProject
|
||||||
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{40F3B724-88A1-4D4F-93AB-FE0DC07A347E}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dashboard.Demo", "tests\Dashboard.Demo\Dashboard.Demo.csproj", "{EAA5488E-ADF0-4D68-91F4-FAE98C8691FC}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dashboard.BlurgText", "Dashboard.BlurgText\Dashboard.BlurgText.csproj", "{D05A9DEA-A5D1-43DC-AB41-36B07598B749}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{4FE772DD-F424-4EAC-BF88-CB8F751B4926}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{4FE772DD-F424-4EAC-BF88-CB8F751B4926}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{4FE772DD-F424-4EAC-BF88-CB8F751B4926}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{4FE772DD-F424-4EAC-BF88-CB8F751B4926}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{3798F6DD-8F84-4B7D-A810-B0D4B5ACB672}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{3798F6DD-8F84-4B7D-A810-B0D4B5ACB672}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{3798F6DD-8F84-4B7D-A810-B0D4B5ACB672}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{3798F6DD-8F84-4B7D-A810-B0D4B5ACB672}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{2013470A-915C-46F2-BDD3-FCAA39C845EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{2013470A-915C-46F2-BDD3-FCAA39C845EE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{2013470A-915C-46F2-BDD3-FCAA39C845EE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{2013470A-915C-46F2-BDD3-FCAA39C845EE}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{EAA5488E-ADF0-4D68-91F4-FAE98C8691FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{EAA5488E-ADF0-4D68-91F4-FAE98C8691FC}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{EAA5488E-ADF0-4D68-91F4-FAE98C8691FC}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{EAA5488E-ADF0-4D68-91F4-FAE98C8691FC}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{D05A9DEA-A5D1-43DC-AB41-36B07598B749}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{D05A9DEA-A5D1-43DC-AB41-36B07598B749}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{D05A9DEA-A5D1-43DC-AB41-36B07598B749}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{D05A9DEA-A5D1-43DC-AB41-36B07598B749}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(NestedProjects) = preSolution
|
||||||
|
{EAA5488E-ADF0-4D68-91F4-FAE98C8691FC} = {40F3B724-88A1-4D4F-93AB-FE0DC07A347E}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace Quik.CommandMachine
|
namespace Dashboard.CommandMachine
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Enumeration of built-in Quik commands.
|
/// Enumeration of built-in Quik commands.
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace Quik.CommandMachine
|
namespace Dashboard.CommandMachine
|
||||||
{
|
{
|
||||||
public class CommandEngine
|
public class CommandEngine
|
||||||
{
|
{
|
||||||
@@ -170,5 +170,63 @@ namespace Quik.CommandMachine
|
|||||||
iterator.Dequeue();
|
iterator.Dequeue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static readonly Dictionary<Type, ICommandListSerializer> s_serializers = new Dictionary<Type, ICommandListSerializer>();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Add a custom serializer to the command engine.
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="T">Type object type.</typeparam>
|
||||||
|
/// <param name="serializer">The serializer.</param>
|
||||||
|
/// <param name="overwrite">True to allow overwriting.</param>
|
||||||
|
public static void AddSerializer<T>(ICommandListSerializer serializer, bool overwrite = false)
|
||||||
|
{
|
||||||
|
if (overwrite)
|
||||||
|
{
|
||||||
|
s_serializers[typeof(T)] = serializer;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
s_serializers.Add(typeof(T), serializer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Add a custom serializer to the command engine.
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="T">Type object type.</typeparam>
|
||||||
|
/// <param name="serializer">The serializer.</param>
|
||||||
|
/// <param name="overwrite">True to allow overwriting.</param>
|
||||||
|
public static void AddSerializer<T>(ICommandListSerializer<T> serializer, bool overwrite = false)
|
||||||
|
=> AddSerializer<T>((ICommandListSerializer)serializer, overwrite);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get a serializer for the given object.
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="T">The object type.</typeparam>
|
||||||
|
/// <param name="value">Required parameter for the C# type inference to work.</param>
|
||||||
|
/// <returns>The serializer.</returns>
|
||||||
|
public static ICommandListSerializer<T> GetSerializer<T>(ICommandListSerializable<T>? value)
|
||||||
|
where T : ICommandListSerializable<T>, new()
|
||||||
|
{
|
||||||
|
if (!s_serializers.TryGetValue(typeof(T), out var serializer))
|
||||||
|
{
|
||||||
|
serializer = new CommandListSerializableSerializer<T>();
|
||||||
|
AddSerializer<T>(serializer);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (ICommandListSerializer<T>)serializer;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get a serializer for the given object.
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="T">The object type.</typeparam>
|
||||||
|
/// <param name="value">Required parameter for the C# type inference to work.</param>
|
||||||
|
/// <returns>The serializer.</returns>
|
||||||
|
public static ICommandListSerializer<T> GetSerializer<T>(T? value)
|
||||||
|
{
|
||||||
|
return (ICommandListSerializer<T>)s_serializers[typeof(T)];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace Quik.CommandMachine
|
namespace Dashboard.CommandMachine
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A delegate for a QUIK command.
|
/// A delegate for a QUIK command.
|
||||||
@@ -1,11 +1,10 @@
|
|||||||
using Quik.Media;
|
using Dashboard.Media;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using System.Runtime.CompilerServices;
|
|
||||||
|
|
||||||
namespace Quik.CommandMachine
|
namespace Dashboard.CommandMachine
|
||||||
{
|
{
|
||||||
public class CommandList : IEnumerable<Frame>
|
public class CommandList : IEnumerable<Frame>
|
||||||
{
|
{
|
||||||
@@ -316,6 +315,27 @@ namespace Quik.CommandMachine
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Serialize an object into the command list.
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="T">The type of the value to serialize.</typeparam>
|
||||||
|
/// <param name="value">What to write into the command list.</param>
|
||||||
|
public void Write<T>(T value)
|
||||||
|
{
|
||||||
|
CommandEngine.GetSerializer(value).Serialize(value, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Serialize an object into the command list.
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="T">The type of the value to serialize.</typeparam>
|
||||||
|
/// <param name="value">What to write into the command list.</param>
|
||||||
|
public void Write<T>(ICommandListSerializable<T> value)
|
||||||
|
where T : ICommandListSerializable<T>, new()
|
||||||
|
{
|
||||||
|
CommandEngine.GetSerializer(value).Serialize((T)value, this);
|
||||||
|
}
|
||||||
|
|
||||||
public CommandQueue GetEnumerator() => new CommandQueue(_frames);
|
public CommandQueue GetEnumerator() => new CommandQueue(_frames);
|
||||||
IEnumerator<Frame> IEnumerable<Frame>.GetEnumerator() => GetEnumerator();
|
IEnumerator<Frame> IEnumerable<Frame>.GetEnumerator() => GetEnumerator();
|
||||||
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
|
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
|
||||||
@@ -372,6 +392,28 @@ namespace Quik.CommandMachine
|
|||||||
|
|
||||||
public Frame Peek() => TryPeek(out Frame frame) ? frame : throw new Exception("No more frames left.");
|
public Frame Peek() => TryPeek(out Frame frame) ? frame : throw new Exception("No more frames left.");
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Deserialize an object from the command queue.
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="T">Type of the object to deserialize.</typeparam>
|
||||||
|
/// <param name="value">The deserialized value.</param>
|
||||||
|
public void Read<T>([NotNull] out T? value)
|
||||||
|
{
|
||||||
|
value = CommandEngine.GetSerializer(default(T)).Deserialize(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Deserialize an object from the command queue.
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="T">Type of the object to deserialize.</typeparam>
|
||||||
|
/// <param name="value">The deserialized value.</param>
|
||||||
|
public void Read<T>([NotNull] out ICommandListSerializable<T>? value)
|
||||||
|
where T : ICommandListSerializable<T>, new()
|
||||||
|
{
|
||||||
|
value = CommandEngine.GetSerializer(value = null).Deserialize(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
public bool MoveNext()
|
public bool MoveNext()
|
||||||
{
|
{
|
||||||
if (_current + 1 < _frames.Count)
|
if (_current + 1 < _frames.Count)
|
||||||
@@ -382,6 +424,7 @@ namespace Quik.CommandMachine
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
public void Reset()
|
public void Reset()
|
||||||
{
|
{
|
||||||
_current = -1;
|
_current = -1;
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
namespace Quik.CommandMachine
|
namespace Dashboard.CommandMachine
|
||||||
{
|
{
|
||||||
[StructLayout(LayoutKind.Explicit)]
|
[StructLayout(LayoutKind.Explicit)]
|
||||||
public struct Frame
|
public struct Frame
|
||||||
68
Dashboard/CommandMachine/FrameType.cs
Normal file
68
Dashboard/CommandMachine/FrameType.cs
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
namespace Dashboard.CommandMachine
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Enumeration of command types in the Dashboard command lists.
|
||||||
|
/// </summary>
|
||||||
|
public enum FrameType
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// A null value.
|
||||||
|
/// </summary>
|
||||||
|
None,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// A command frame.
|
||||||
|
/// </summary>
|
||||||
|
Command,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// An integer frame.
|
||||||
|
/// </summary>
|
||||||
|
IVec1,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// A two dimensional integer vector frame.
|
||||||
|
/// </summary>
|
||||||
|
IVec2,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// A three dimensional integer vector frame.
|
||||||
|
/// </summary>
|
||||||
|
IVec3,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// A four dimensional integer vector frame.
|
||||||
|
/// </summary>
|
||||||
|
IVec4,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// A floating point frame.
|
||||||
|
/// </summary>
|
||||||
|
Vec1,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// A two dimensional floating point vector frame.
|
||||||
|
/// </summary>
|
||||||
|
Vec2,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// A three dimensional floating point vector frame.
|
||||||
|
/// </summary>
|
||||||
|
Vec3,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// A four dimensional floating point vector frame.
|
||||||
|
/// </summary>
|
||||||
|
Vec4,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// A serialized object frame.
|
||||||
|
/// </summary>
|
||||||
|
Serialized,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// A .Net object frame.
|
||||||
|
/// </summary>
|
||||||
|
Object,
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace Quik.CommandMachine
|
namespace Dashboard.CommandMachine
|
||||||
{
|
{
|
||||||
public enum ImageCommandFlags
|
public enum ImageCommandFlags
|
||||||
{
|
{
|
||||||
69
Dashboard/CommandMachine/Serializers.cs
Normal file
69
Dashboard/CommandMachine/Serializers.cs
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
|
||||||
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
using System.Threading;
|
||||||
|
|
||||||
|
namespace Dashboard.CommandMachine
|
||||||
|
{
|
||||||
|
public interface ICommandListSerializable { }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Interface for objects that can be serialized into the Dashboard command stream.
|
||||||
|
/// </summary>
|
||||||
|
public interface ICommandListSerializable<T> : ICommandListSerializable
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Seralize object.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="list">The object to serialize into.</param>
|
||||||
|
void Serialize(CommandList list);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Deserialize object.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="queue">The command queue to deserialize from.</param>
|
||||||
|
void Deserialize(CommandQueue queue);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Base interface for all Command List serializers.
|
||||||
|
/// </summary>
|
||||||
|
public interface ICommandListSerializer { }
|
||||||
|
|
||||||
|
public interface ICommandListSerializer<T> : ICommandListSerializer
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Serialize an object into the command list.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="value">The object to serialize.</param>
|
||||||
|
/// <param name="list">The command list to serialize into.</param>
|
||||||
|
void Serialize(T value, CommandList list);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Deserialize an object from the command queue.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="queue">The command queue.</param>
|
||||||
|
/// <returns>The object deserialized from the command queue.</returns>
|
||||||
|
[return: NotNull]
|
||||||
|
T Deserialize(CommandQueue queue);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Class for automatic serialization of <see cref="ICommandListSerializable"/> objects.
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="T">The object type to convert.</typeparam>
|
||||||
|
internal class CommandListSerializableSerializer<T> : ICommandListSerializer<T>
|
||||||
|
where T : ICommandListSerializable<T>, new()
|
||||||
|
{
|
||||||
|
public T Deserialize(CommandQueue queue)
|
||||||
|
{
|
||||||
|
T value = new T();
|
||||||
|
value.Deserialize(queue);
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Serialize(T value, CommandList list)
|
||||||
|
{
|
||||||
|
value.Serialize(list);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Quik.Controls
|
namespace Dashboard.Controls
|
||||||
{
|
{
|
||||||
public enum Dock
|
public enum Dock
|
||||||
{
|
{
|
||||||
@@ -2,7 +2,7 @@ using System;
|
|||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace Quik.Controls
|
namespace Dashboard.Controls
|
||||||
{
|
{
|
||||||
public abstract class ContainerControl : Control, ICollection<Control>
|
public abstract class ContainerControl : Control, ICollection<Control>
|
||||||
{
|
{
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
using System;
|
using System;
|
||||||
using Quik.CommandMachine;
|
using System.Collections.Generic;
|
||||||
|
using Dashboard.CommandMachine;
|
||||||
|
|
||||||
namespace Quik.Controls
|
namespace Dashboard.Controls
|
||||||
{
|
{
|
||||||
public abstract class Control : UIBase
|
public abstract class Control : UIBase
|
||||||
{
|
{
|
||||||
@@ -106,5 +107,19 @@ namespace Quik.Controls
|
|||||||
{
|
{
|
||||||
LayoutValidated?.Invoke(sender, ea);
|
LayoutValidated?.Invoke(sender, ea);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void ValidateChildrenLayout()
|
||||||
|
{
|
||||||
|
if (this is IEnumerable<Control> enumerable)
|
||||||
|
{
|
||||||
|
foreach (Control child in enumerable)
|
||||||
|
{
|
||||||
|
if (child.IsLayoutValid)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
child.ValidateLayout();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
100
Dashboard/Controls/FlowBox.cs
Normal file
100
Dashboard/Controls/FlowBox.cs
Normal file
@@ -0,0 +1,100 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using Dashboard.CommandMachine;
|
||||||
|
|
||||||
|
namespace Dashboard.Controls
|
||||||
|
{
|
||||||
|
public class FlowBox : ContainerControl
|
||||||
|
{
|
||||||
|
public Direction FlowDirection { get; set; }
|
||||||
|
public bool AllowWrap { get; set; }
|
||||||
|
public VerticalAlignment VerticalAlignment { get; set; }
|
||||||
|
public HorizontalAlignment HorizontalAlignment { get; set; }
|
||||||
|
public float ItemPadding { get; set; } = 4f;
|
||||||
|
|
||||||
|
protected override void ValidateLayout()
|
||||||
|
{
|
||||||
|
ValidateChildrenLayout();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void ValidateVisual(CommandList cmd)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void FlowHorizontal()
|
||||||
|
{
|
||||||
|
IEnumerator<Control> controls = this.GetEnumerator();
|
||||||
|
List<Control> row;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Enumerate a row.
|
||||||
|
private bool EnumerateRows(IEnumerator<Control> iterator, List<Control> row)
|
||||||
|
{
|
||||||
|
float width = 0;
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
if (width + iterator.Current.Size.X < Size.X)
|
||||||
|
{
|
||||||
|
row.Add(iterator.Current);
|
||||||
|
width += iterator.Current.Size.X + ItemPadding;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} while (iterator.MoveNext());
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Flows a row of children.
|
||||||
|
private void FlowRow(List<Control> line, QVec2 offset, QVec2 size, float packedWidth)
|
||||||
|
{
|
||||||
|
QVec2 pointer = offset;
|
||||||
|
|
||||||
|
pointer.X += hstart();
|
||||||
|
|
||||||
|
foreach (Control child in line)
|
||||||
|
{
|
||||||
|
child.Position = pointer;
|
||||||
|
pointer += new QVec2(child.Size.X + hoffset(child), voffset(child));
|
||||||
|
}
|
||||||
|
|
||||||
|
float hstart()
|
||||||
|
{
|
||||||
|
return HorizontalAlignment switch {
|
||||||
|
HorizontalAlignment.Center => (size.Y - packedWidth) / 2,
|
||||||
|
HorizontalAlignment.Right => size.Y - packedWidth,
|
||||||
|
_ => 0f
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
float hoffset(Control child)
|
||||||
|
{
|
||||||
|
if (line.Count == 1)
|
||||||
|
return 0;
|
||||||
|
else if (HorizontalAlignment == HorizontalAlignment.Justify)
|
||||||
|
{
|
||||||
|
return ItemPadding + ((size.Y - packedWidth) / (line.Count - 1));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return ItemPadding;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
float voffset(Control child)
|
||||||
|
{
|
||||||
|
return VerticalAlignment switch {
|
||||||
|
VerticalAlignment.Top => 0f,
|
||||||
|
VerticalAlignment.Bottom => size.Y - child.Size.Y,
|
||||||
|
_ => (size.Y - child.Size.Y) / 2,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
using Quik.CommandMachine;
|
using Dashboard.CommandMachine;
|
||||||
using Quik.Media;
|
using Dashboard.Media;
|
||||||
using Quik.Typography;
|
using Dashboard.Typography;
|
||||||
|
|
||||||
namespace Quik.Controls
|
namespace Dashboard.Controls
|
||||||
{
|
{
|
||||||
public class Label : Control
|
public class Label : Control
|
||||||
{
|
{
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using Quik.CommandMachine;
|
using Dashboard.CommandMachine;
|
||||||
|
|
||||||
namespace Quik.Controls
|
namespace Dashboard.Controls
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Bases for all UI elements.
|
/// Bases for all UI elements.
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Quik.Controls
|
namespace Dashboard.Controls
|
||||||
{
|
{
|
||||||
public class View : UIBase
|
public class View : UIBase
|
||||||
{
|
{
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Quik.Media.Color
|
namespace Dashboard.Media.Color
|
||||||
{
|
{
|
||||||
public static class FormatConvert
|
public static class FormatConvert
|
||||||
{
|
{
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
namespace Quik.Media.Color
|
namespace Dashboard.Media.Color
|
||||||
{
|
{
|
||||||
public class QImageBuffer : QImage
|
public class QImageBuffer : QImage
|
||||||
{
|
{
|
||||||
@@ -22,7 +22,7 @@ namespace Quik.Media.Color
|
|||||||
Height = height;
|
Height = height;
|
||||||
Depth = depth;
|
Depth = depth;
|
||||||
|
|
||||||
buffer = new byte[width * height * depth];
|
buffer = new byte[(long)width * height * depth * format.BytesPerPixel()];
|
||||||
}
|
}
|
||||||
~QImageBuffer()
|
~QImageBuffer()
|
||||||
{
|
{
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Quik.Media.Color
|
namespace Dashboard.Media.Color
|
||||||
{
|
{
|
||||||
public unsafe struct LockIO
|
public unsafe struct LockIO
|
||||||
{
|
{
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace Quik.Media
|
namespace Dashboard.Media
|
||||||
{
|
{
|
||||||
public static class Extensions
|
public static class Extensions
|
||||||
{
|
{
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Quik.Media.Color;
|
using Dashboard.Media.Color;
|
||||||
|
|
||||||
namespace Quik.Media.Font
|
namespace Dashboard.Media.Font
|
||||||
{
|
{
|
||||||
public struct FontAtlasGlyphInfo
|
public struct FontAtlasGlyphInfo
|
||||||
{
|
{
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace Quik.Media.Font
|
namespace Dashboard.Media.Font
|
||||||
{
|
{
|
||||||
public readonly struct FontFace : IEquatable<FontFace>
|
public readonly struct FontFace : IEquatable<FontFace>
|
||||||
{
|
{
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace Quik.Media.Font
|
namespace Dashboard.Media.Font
|
||||||
{
|
{
|
||||||
public enum FontSlant
|
public enum FontSlant
|
||||||
{
|
{
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace Quik.Media.Font
|
namespace Dashboard.Media.Font
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Enumeration of font stretch values.
|
/// Enumeration of font stretch values.
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Quik.Media.Font
|
namespace Dashboard.Media.Font
|
||||||
{
|
{
|
||||||
public enum FontWeight
|
public enum FontWeight
|
||||||
{
|
{
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace Quik.Media.Font
|
namespace Dashboard.Media.Font
|
||||||
{
|
{
|
||||||
public enum SystemFontFamily
|
public enum SystemFontFamily
|
||||||
{
|
{
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Quik.Media
|
namespace Dashboard.Media
|
||||||
{
|
{
|
||||||
public enum QImageFormat
|
public enum QImageFormat
|
||||||
{
|
{
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
||||||
namespace Quik.Media
|
namespace Dashboard.Media
|
||||||
{
|
{
|
||||||
public enum MediaHint
|
public enum MediaHint
|
||||||
{
|
{
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using Quik.Media;
|
using Dashboard.Media;
|
||||||
using Quik.Media.Font;
|
using Dashboard.Media.Font;
|
||||||
|
|
||||||
namespace Quik.Media
|
namespace Dashboard.Media
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Abstract class that represents a font.
|
/// Abstract class that represents a font.
|
||||||
@@ -59,14 +59,14 @@ namespace Quik.Media
|
|||||||
{
|
{
|
||||||
Size = size;
|
Size = size;
|
||||||
|
|
||||||
QuikApplication.Current.Platform.GetMaximumImage(out int height, out int width);
|
DashboardApplication.Current.Platform.GetMaximumImage(out int height, out int width);
|
||||||
|
|
||||||
// Do no allow to create a texture that is greater than 16 square characters at 200 DPI.
|
// Do no allow to create a texture that is greater than 16 square characters at 200 DPI.
|
||||||
width = Math.Min(width, (int)(size * 200 * 16));
|
width = Math.Min(width, (int)(size * 200 * 16));
|
||||||
height = Math.Min(height, (int)(size * 200 * 16));
|
height = Math.Min(height, (int)(size * 200 * 16));
|
||||||
// width = height = 256;
|
// width = height = 256;
|
||||||
|
|
||||||
atlas = new FontAtlas(width, height, QuikApplication.Current.FontProvider.RasterizerOptions.Sdf);
|
atlas = new FontAtlas(width, height, DashboardApplication.Current.FontProvider.RasterizerOptions.Sdf);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Get(int codepoint, out FontGlyph glyph, QFont font)
|
public void Get(int codepoint, out FontGlyph glyph, QFont font)
|
||||||
@@ -78,7 +78,7 @@ namespace Quik.Media
|
|||||||
out QGlyphMetrics metrics,
|
out QGlyphMetrics metrics,
|
||||||
codepoint,
|
codepoint,
|
||||||
Size,
|
Size,
|
||||||
QuikApplication.Current.FontProvider.RasterizerOptions);
|
DashboardApplication.Current.FontProvider.RasterizerOptions);
|
||||||
|
|
||||||
if (image != null)
|
if (image != null)
|
||||||
{
|
{
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace Quik.Media
|
namespace Dashboard.Media
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Glyph properties with metrics based on FreeType glyph metrics.
|
/// Glyph properties with metrics based on FreeType glyph metrics.
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
namespace Quik.Media
|
namespace Dashboard.Media
|
||||||
{
|
{
|
||||||
public abstract class QImage : IDisposable
|
public abstract class QImage : IDisposable
|
||||||
{
|
{
|
||||||
@@ -65,8 +65,8 @@ namespace Quik.Media
|
|||||||
public unsafe void CopyTo(QImageLock destination, int x, int y)
|
public unsafe void CopyTo(QImageLock destination, int x, int y)
|
||||||
{
|
{
|
||||||
if (
|
if (
|
||||||
Width + x > destination.Width ||
|
Width + x >= destination.Width ||
|
||||||
Height + y > destination.Height)
|
Height + y >= destination.Height)
|
||||||
{
|
{
|
||||||
throw new Exception("Image falls outside the bounds of the destination.");
|
throw new Exception("Image falls outside the bounds of the destination.");
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Quik
|
namespace Dashboard
|
||||||
{
|
{
|
||||||
public enum MouseButton : byte
|
public enum MouseButton : byte
|
||||||
{
|
{
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
|
|
||||||
namespace Quik.OpenGL
|
namespace Dashboard.OpenGL
|
||||||
{
|
{
|
||||||
public unsafe static partial class GL
|
public unsafe static partial class GL
|
||||||
{
|
{
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using static Quik.OpenGL.GLEnum;
|
using static Dashboard.OpenGL.GLEnum;
|
||||||
|
|
||||||
namespace Quik.OpenGL
|
namespace Dashboard.OpenGL
|
||||||
{
|
{
|
||||||
public unsafe static partial class GL
|
public unsafe static partial class GL
|
||||||
{
|
{
|
||||||
@@ -2,9 +2,9 @@ using System;
|
|||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using static Quik.OpenGL.GLEnum;
|
using static Dashboard.OpenGL.GLEnum;
|
||||||
|
|
||||||
namespace Quik.OpenGL
|
namespace Dashboard.OpenGL
|
||||||
{
|
{
|
||||||
public unsafe static partial class GL
|
public unsafe static partial class GL
|
||||||
{
|
{
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
|
|
||||||
namespace Quik.OpenGL
|
namespace Dashboard.OpenGL
|
||||||
{
|
{
|
||||||
public unsafe static partial class GL
|
public unsafe static partial class GL
|
||||||
{
|
{
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
|
|
||||||
namespace Quik.OpenGL
|
namespace Dashboard.OpenGL
|
||||||
{
|
{
|
||||||
public unsafe static partial class GL
|
public unsafe static partial class GL
|
||||||
{
|
{
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
|
|
||||||
namespace Quik.OpenGL
|
namespace Dashboard.OpenGL
|
||||||
{
|
{
|
||||||
public unsafe static partial class GL
|
public unsafe static partial class GL
|
||||||
{
|
{
|
||||||
@@ -2,7 +2,7 @@ using System;
|
|||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
namespace Quik.OpenGL
|
namespace Dashboard.OpenGL
|
||||||
{
|
{
|
||||||
public delegate IntPtr GetProcAddressProc(string procName);
|
public delegate IntPtr GetProcAddressProc(string procName);
|
||||||
|
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Quik.VertexGenerator;
|
using Dashboard.VertexGenerator;
|
||||||
using static Quik.OpenGL.GLEnum;
|
using static Dashboard.OpenGL.GLEnum;
|
||||||
using Quik.Media;
|
using Dashboard.Media;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
|
||||||
namespace Quik.OpenGL
|
namespace Dashboard.OpenGL
|
||||||
{
|
{
|
||||||
public class GL21Driver : IDisposable
|
public class GL21Driver : IDisposable
|
||||||
{
|
{
|
||||||
@@ -46,8 +46,8 @@ namespace Quik.OpenGL
|
|||||||
{
|
{
|
||||||
if (IsInit) return;
|
if (IsInit) return;
|
||||||
|
|
||||||
int vs = CreateShader(GL_VERTEX_SHADER, "Quik.res.gl21.vert");
|
int vs = CreateShader(GL_VERTEX_SHADER, "Dashboard.res.gl21.vert");
|
||||||
int fs = CreateShader(GL_FRAGMENT_SHADER, "Quik.res.gl21.frag");
|
int fs = CreateShader(GL_FRAGMENT_SHADER, "Dashboard.res.gl21.frag");
|
||||||
|
|
||||||
program = GL.CreateProgram();
|
program = GL.CreateProgram();
|
||||||
GL.AttachShader(program, vs);
|
GL.AttachShader(program, vs);
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace Quik.OpenGL
|
namespace Dashboard.OpenGL
|
||||||
{
|
{
|
||||||
public enum GLEnum : int
|
public enum GLEnum : int
|
||||||
{
|
{
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using static Quik.OpenGL.GLEnum;
|
using static Dashboard.OpenGL.GLEnum;
|
||||||
|
|
||||||
namespace Quik.OpenGL
|
namespace Dashboard.OpenGL
|
||||||
{
|
{
|
||||||
[System.Serializable]
|
[System.Serializable]
|
||||||
public class GraphicsException : System.Exception
|
public class GraphicsException : System.Exception
|
||||||
@@ -1,20 +1,20 @@
|
|||||||
using Quik.CommandMachine;
|
using Dashboard.CommandMachine;
|
||||||
using Quik.Controls;
|
using Dashboard.Controls;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Quik.PAL
|
namespace Dashboard.PAL
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An abstraction layer over the UI input and output.
|
/// An abstraction layer over the UI input and output.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class QuikPort
|
public class Dash
|
||||||
{
|
{
|
||||||
private readonly IQuikPortHandle handle;
|
private readonly IDashHandle handle;
|
||||||
private readonly IQuikPlatform platform;
|
private readonly IDashboardPlatform platform;
|
||||||
|
|
||||||
public string Title
|
public string Title
|
||||||
{
|
{
|
||||||
@@ -50,7 +50,7 @@ namespace Quik.PAL
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public QuikPort(IQuikPlatform platform)
|
public Dash(IDashboardPlatform platform)
|
||||||
{
|
{
|
||||||
this.platform = platform;
|
this.platform = platform;
|
||||||
handle = platform.CreatePort();
|
handle = platform.CreatePort();
|
||||||
@@ -1,20 +1,20 @@
|
|||||||
using System;
|
using System;
|
||||||
using Quik.CommandMachine;
|
using Dashboard.CommandMachine;
|
||||||
using Quik.Media;
|
using Dashboard.Media;
|
||||||
|
|
||||||
namespace Quik.PAL
|
namespace Dashboard.PAL
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An empty interface to statically type Quik port handles.
|
/// An empty interface to statically type Quik port handles.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IQuikPortHandle
|
public interface IDashHandle
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The primary primary platform abstraction interface for Quik hosts.
|
/// The primary primary platform abstraction interface for dashboard hosts.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IQuikPlatform : IDisposable
|
public interface IDashboardPlatform : IDisposable
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The title of the application.
|
/// The title of the application.
|
||||||
@@ -41,20 +41,20 @@ namespace Quik.PAL
|
|||||||
/// Create a window.
|
/// Create a window.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>The window instance.</returns>
|
/// <returns>The window instance.</returns>
|
||||||
IQuikPortHandle CreatePort();
|
IDashHandle CreatePort();
|
||||||
void DestroyPort(IQuikPortHandle port);
|
void DestroyPort(IDashHandle port);
|
||||||
string PortGetTitle(IQuikPortHandle port);
|
string PortGetTitle(IDashHandle port);
|
||||||
void PortSetTitle(IQuikPortHandle port, string title);
|
void PortSetTitle(IDashHandle port, string title);
|
||||||
QVec2 PortGetSize(IQuikPortHandle port);
|
QVec2 PortGetSize(IDashHandle port);
|
||||||
void PortSetSize(IQuikPortHandle port, QVec2 size);
|
void PortSetSize(IDashHandle port, QVec2 size);
|
||||||
QVec2 PortGetPosition(IQuikPortHandle port);
|
QVec2 PortGetPosition(IDashHandle port);
|
||||||
void PortSetPosition(IQuikPortHandle port, QVec2 position);
|
void PortSetPosition(IDashHandle port, QVec2 position);
|
||||||
bool PortIsValid(IQuikPortHandle port);
|
bool PortIsValid(IDashHandle port);
|
||||||
void PortSubscribeEvent(IQuikPortHandle port, EventHandler handler);
|
void PortSubscribeEvent(IDashHandle port, EventHandler handler);
|
||||||
void PortUnsubscribeEvent(IQuikPortHandle port, EventHandler handler);
|
void PortUnsubscribeEvent(IDashHandle port, EventHandler handler);
|
||||||
void PortFocus(IQuikPortHandle port);
|
void PortFocus(IDashHandle port);
|
||||||
void PortShow(IQuikPortHandle port, bool shown = true);
|
void PortShow(IDashHandle port, bool shown = true);
|
||||||
void PortPaint(IQuikPortHandle port, CommandList commands);
|
void PortPaint(IDashHandle port, CommandList commands);
|
||||||
void GetMaximumImage(out int width, out int height);
|
void GetMaximumImage(out int width, out int height);
|
||||||
void GetMaximumImage(out int width, out int height, out int depth);
|
void GetMaximumImage(out int width, out int height, out int depth);
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using Quik.Media.Font;
|
using Dashboard.Media.Font;
|
||||||
|
|
||||||
namespace Quik.PAL
|
namespace Dashboard.PAL
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Flags that effect font search criterea.
|
/// Flags that effect font search criterea.
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
|
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using Quik.Media;
|
using Dashboard.Media;
|
||||||
|
|
||||||
namespace Quik.PAL
|
namespace Dashboard.PAL
|
||||||
{
|
{
|
||||||
public interface IFontFactory
|
public interface IFontFactory
|
||||||
{
|
{
|
||||||
@@ -1,23 +1,23 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using Quik.CommandMachine;
|
using Dashboard.CommandMachine;
|
||||||
using Quik.Controls;
|
using Dashboard.Controls;
|
||||||
using Quik.Media;
|
using Dashboard.Media;
|
||||||
using Quik.PAL;
|
using Dashboard.PAL;
|
||||||
using Quik.Typography;
|
using Dashboard.Typography;
|
||||||
|
|
||||||
namespace Quik
|
namespace Dashboard
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Main class for Quik applications.
|
/// Main class for Quik applications.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class QuikApplication
|
public class DashboardApplication
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The application platform driver.
|
/// The application platform driver.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public IQuikPlatform Platform { get; }
|
public IDashboardPlatform Platform { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Title of the application.
|
/// Title of the application.
|
||||||
@@ -37,7 +37,7 @@ namespace Quik
|
|||||||
set => Platform.Icon = value;
|
set => Platform.Icon = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public QuikPort? MainPort { get; private set; } = null;
|
public PAL.Dash? MainPort { get; private set; } = null;
|
||||||
|
|
||||||
public FontProvider FontProvider { get; }
|
public FontProvider FontProvider { get; }
|
||||||
|
|
||||||
@@ -46,7 +46,7 @@ namespace Quik
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public List<MediaLoader> MediaLoaders { get; } = new List<MediaLoader>();
|
public List<MediaLoader> MediaLoaders { get; } = new List<MediaLoader>();
|
||||||
|
|
||||||
public QuikApplication(IQuikPlatform platform)
|
public DashboardApplication(IDashboardPlatform platform)
|
||||||
{
|
{
|
||||||
Platform = platform;
|
Platform = platform;
|
||||||
FontProvider = new FontProvider(this);
|
FontProvider = new FontProvider(this);
|
||||||
@@ -103,7 +103,7 @@ namespace Quik
|
|||||||
|
|
||||||
public void Init(View mainView)
|
public void Init(View mainView)
|
||||||
{
|
{
|
||||||
MainPort = new QuikPort(Platform) { UIElement = mainView };
|
MainPort = new PAL.Dash(Platform) { UIElement = mainView };
|
||||||
MainPort.EventRaised += (sender, ea) => mainView.NotifyEvent(sender, ea);
|
MainPort.EventRaised += (sender, ea) => mainView.NotifyEvent(sender, ea);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -123,9 +123,9 @@ namespace Quik
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static QuikApplication Current { get; private set; } = null!;
|
public static DashboardApplication Current { get; private set; } = null!;
|
||||||
|
|
||||||
public static void SetCurrentApplication(QuikApplication application)
|
public static void SetCurrentApplication(DashboardApplication application)
|
||||||
{
|
{
|
||||||
Current = application;
|
Current = application;
|
||||||
}
|
}
|
||||||
@@ -2,7 +2,7 @@ using System;
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
|
||||||
namespace Quik
|
namespace Dashboard
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A 2 dimensional Vector.
|
/// A 2 dimensional Vector.
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Quik.Media;
|
using Dashboard.Media;
|
||||||
using Quik.Media.Font;
|
using Dashboard.Media.Font;
|
||||||
|
|
||||||
namespace Quik
|
namespace Dashboard
|
||||||
{
|
{
|
||||||
public enum TextAlignment
|
public enum TextAlignment
|
||||||
{
|
{
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
using Quik.Media;
|
using Dashboard.Media;
|
||||||
using Quik.Media.Font;
|
using Dashboard.Media.Font;
|
||||||
using Quik.PAL;
|
using Dashboard.PAL;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
namespace Quik.Typography
|
namespace Dashboard.Typography
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The font provider is a caching object that provides fonts for typesetting classes.
|
/// The font provider is a caching object that provides fonts for typesetting classes.
|
||||||
@@ -18,7 +18,7 @@ namespace Quik.Typography
|
|||||||
public readonly FontRasterizerOptions RasterizerOptions;
|
public readonly FontRasterizerOptions RasterizerOptions;
|
||||||
public IFontDataBase? Database { get; set; }
|
public IFontDataBase? Database { get; set; }
|
||||||
public IFontFactory? FontFactory { get; set; }
|
public IFontFactory? FontFactory { get; set; }
|
||||||
private readonly QuikApplication App;
|
private readonly DashboardApplication App;
|
||||||
|
|
||||||
public QFont this[FontFace info]
|
public QFont this[FontFace info]
|
||||||
{
|
{
|
||||||
@@ -51,7 +51,7 @@ namespace Quik.Typography
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public FontProvider(QuikApplication app, in FontRasterizerOptions options)
|
public FontProvider(DashboardApplication app, in FontRasterizerOptions options)
|
||||||
{
|
{
|
||||||
RasterizerOptions = options;
|
RasterizerOptions = options;
|
||||||
App = app;
|
App = app;
|
||||||
@@ -73,7 +73,7 @@ namespace Quik.Typography
|
|||||||
FontFactory = (IFontFactory?)ctor?.Invoke(null);
|
FontFactory = (IFontFactory?)ctor?.Invoke(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public FontProvider(QuikApplication app)
|
public FontProvider(DashboardApplication app)
|
||||||
: this(app, FontRasterizerOptions.Default)
|
: this(app, FontRasterizerOptions.Default)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -3,9 +3,9 @@ using System.Collections;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Quik.Media;
|
using Dashboard.Media;
|
||||||
|
|
||||||
namespace Quik.Typography
|
namespace Dashboard.Typography
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An atomic horizontal block of text which cannot be further divided.
|
/// An atomic horizontal block of text which cannot be further divided.
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
using Quik.CommandMachine;
|
using Dashboard.CommandMachine;
|
||||||
using Quik.Media;
|
using Dashboard.Media;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace Quik.Typography
|
namespace Dashboard.Typography
|
||||||
{
|
{
|
||||||
public static class Typesetter
|
public static class Typesetter
|
||||||
{
|
{
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace Quik.Typography
|
namespace Dashboard.Typography
|
||||||
{
|
{
|
||||||
public static class UnicodeUtil
|
public static class UnicodeUtil
|
||||||
{
|
{
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
using Quik.Media;
|
using Dashboard.Media;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
|
|
||||||
namespace Quik.VertexGenerator
|
namespace Dashboard.VertexGenerator
|
||||||
{
|
{
|
||||||
public class DrawQueue : IEnumerable<DrawCall>
|
public class DrawQueue : IEnumerable<DrawCall>
|
||||||
{
|
{
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
|
||||||
namespace Quik.VertexGenerator
|
namespace Dashboard.VertexGenerator
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a GPU vertex.
|
/// Represents a GPU vertex.
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Quik.VertexGenerator
|
namespace Dashboard.VertexGenerator
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A small list which whose items can be used by reference.
|
/// A small list which whose items can be used by reference.
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Quik.CommandMachine;
|
using Dashboard.CommandMachine;
|
||||||
using Quik.Media;
|
using Dashboard.Media;
|
||||||
using Quik.Typography;
|
using Dashboard.Typography;
|
||||||
|
|
||||||
namespace Quik.VertexGenerator
|
namespace Dashboard.VertexGenerator
|
||||||
{
|
{
|
||||||
public class VertexGeneratorEngine : CommandEngine
|
public class VertexGeneratorEngine : CommandEngine
|
||||||
{
|
{
|
||||||
84
Quik.sln
84
Quik.sln
@@ -1,84 +0,0 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
|
||||||
# Visual Studio Version 17
|
|
||||||
VisualStudioVersion = 17.9.34701.34
|
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Quik", "Quik\Quik.csproj", "{B86B2B99-DAE4-43CE-A040-1D8E143B94A7}"
|
|
||||||
EndProject
|
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Quik.OpenTK", "Quik.OpenTK\Quik.OpenTK.csproj", "{586E5E28-1D07-4CC2-B04F-0BC420564F57}"
|
|
||||||
EndProject
|
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{AE05ADE5-A809-479F-97D5-BEAFE7604285}"
|
|
||||||
EndProject
|
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "QuikDemo", "tests\QuikDemo\QuikDemo.csproj", "{79CBF97F-4884-4692-94FB-75DDEB61E26F}"
|
|
||||||
EndProject
|
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Quik.Media.Defaults", "Quik.Media.Defaults\Quik.Media.Defaults.csproj", "{B517D2BF-CB9D-4448-BE50-EA85E100EB47}"
|
|
||||||
EndProject
|
|
||||||
Global
|
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
|
||||||
Debug|Any CPU = Debug|Any CPU
|
|
||||||
Debug|x64 = Debug|x64
|
|
||||||
Debug|x86 = Debug|x86
|
|
||||||
Release|Any CPU = Release|Any CPU
|
|
||||||
Release|x64 = Release|x64
|
|
||||||
Release|x86 = Release|x86
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
|
||||||
{B86B2B99-DAE4-43CE-A040-1D8E143B94A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{B86B2B99-DAE4-43CE-A040-1D8E143B94A7}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{B86B2B99-DAE4-43CE-A040-1D8E143B94A7}.Debug|x64.ActiveCfg = Debug|Any CPU
|
|
||||||
{B86B2B99-DAE4-43CE-A040-1D8E143B94A7}.Debug|x64.Build.0 = Debug|Any CPU
|
|
||||||
{B86B2B99-DAE4-43CE-A040-1D8E143B94A7}.Debug|x86.ActiveCfg = Debug|Any CPU
|
|
||||||
{B86B2B99-DAE4-43CE-A040-1D8E143B94A7}.Debug|x86.Build.0 = Debug|Any CPU
|
|
||||||
{B86B2B99-DAE4-43CE-A040-1D8E143B94A7}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{B86B2B99-DAE4-43CE-A040-1D8E143B94A7}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{B86B2B99-DAE4-43CE-A040-1D8E143B94A7}.Release|x64.ActiveCfg = Release|Any CPU
|
|
||||||
{B86B2B99-DAE4-43CE-A040-1D8E143B94A7}.Release|x64.Build.0 = Release|Any CPU
|
|
||||||
{B86B2B99-DAE4-43CE-A040-1D8E143B94A7}.Release|x86.ActiveCfg = Release|Any CPU
|
|
||||||
{B86B2B99-DAE4-43CE-A040-1D8E143B94A7}.Release|x86.Build.0 = Release|Any CPU
|
|
||||||
{586E5E28-1D07-4CC2-B04F-0BC420564F57}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{586E5E28-1D07-4CC2-B04F-0BC420564F57}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{586E5E28-1D07-4CC2-B04F-0BC420564F57}.Debug|x64.ActiveCfg = Debug|Any CPU
|
|
||||||
{586E5E28-1D07-4CC2-B04F-0BC420564F57}.Debug|x64.Build.0 = Debug|Any CPU
|
|
||||||
{586E5E28-1D07-4CC2-B04F-0BC420564F57}.Debug|x86.ActiveCfg = Debug|Any CPU
|
|
||||||
{586E5E28-1D07-4CC2-B04F-0BC420564F57}.Debug|x86.Build.0 = Debug|Any CPU
|
|
||||||
{586E5E28-1D07-4CC2-B04F-0BC420564F57}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{586E5E28-1D07-4CC2-B04F-0BC420564F57}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{586E5E28-1D07-4CC2-B04F-0BC420564F57}.Release|x64.ActiveCfg = Release|Any CPU
|
|
||||||
{586E5E28-1D07-4CC2-B04F-0BC420564F57}.Release|x64.Build.0 = Release|Any CPU
|
|
||||||
{586E5E28-1D07-4CC2-B04F-0BC420564F57}.Release|x86.ActiveCfg = Release|Any CPU
|
|
||||||
{586E5E28-1D07-4CC2-B04F-0BC420564F57}.Release|x86.Build.0 = Release|Any CPU
|
|
||||||
{79CBF97F-4884-4692-94FB-75DDEB61E26F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{79CBF97F-4884-4692-94FB-75DDEB61E26F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{79CBF97F-4884-4692-94FB-75DDEB61E26F}.Debug|x64.ActiveCfg = Debug|Any CPU
|
|
||||||
{79CBF97F-4884-4692-94FB-75DDEB61E26F}.Debug|x64.Build.0 = Debug|Any CPU
|
|
||||||
{79CBF97F-4884-4692-94FB-75DDEB61E26F}.Debug|x86.ActiveCfg = Debug|Any CPU
|
|
||||||
{79CBF97F-4884-4692-94FB-75DDEB61E26F}.Debug|x86.Build.0 = Debug|Any CPU
|
|
||||||
{79CBF97F-4884-4692-94FB-75DDEB61E26F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{79CBF97F-4884-4692-94FB-75DDEB61E26F}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{79CBF97F-4884-4692-94FB-75DDEB61E26F}.Release|x64.ActiveCfg = Release|Any CPU
|
|
||||||
{79CBF97F-4884-4692-94FB-75DDEB61E26F}.Release|x64.Build.0 = Release|Any CPU
|
|
||||||
{79CBF97F-4884-4692-94FB-75DDEB61E26F}.Release|x86.ActiveCfg = Release|Any CPU
|
|
||||||
{79CBF97F-4884-4692-94FB-75DDEB61E26F}.Release|x86.Build.0 = Release|Any CPU
|
|
||||||
{B517D2BF-CB9D-4448-BE50-EA85E100EB47}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{B517D2BF-CB9D-4448-BE50-EA85E100EB47}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{B517D2BF-CB9D-4448-BE50-EA85E100EB47}.Debug|x64.ActiveCfg = Debug|Any CPU
|
|
||||||
{B517D2BF-CB9D-4448-BE50-EA85E100EB47}.Debug|x64.Build.0 = Debug|Any CPU
|
|
||||||
{B517D2BF-CB9D-4448-BE50-EA85E100EB47}.Debug|x86.ActiveCfg = Debug|Any CPU
|
|
||||||
{B517D2BF-CB9D-4448-BE50-EA85E100EB47}.Debug|x86.Build.0 = Debug|Any CPU
|
|
||||||
{B517D2BF-CB9D-4448-BE50-EA85E100EB47}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{B517D2BF-CB9D-4448-BE50-EA85E100EB47}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{B517D2BF-CB9D-4448-BE50-EA85E100EB47}.Release|x64.ActiveCfg = Release|Any CPU
|
|
||||||
{B517D2BF-CB9D-4448-BE50-EA85E100EB47}.Release|x64.Build.0 = Release|Any CPU
|
|
||||||
{B517D2BF-CB9D-4448-BE50-EA85E100EB47}.Release|x86.ActiveCfg = Release|Any CPU
|
|
||||||
{B517D2BF-CB9D-4448-BE50-EA85E100EB47}.Release|x86.Build.0 = Release|Any CPU
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
|
||||||
HideSolutionNode = FALSE
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(NestedProjects) = preSolution
|
|
||||||
{79CBF97F-4884-4692-94FB-75DDEB61E26F} = {AE05ADE5-A809-479F-97D5-BEAFE7604285}
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
|
||||||
SolutionGuid = {EF011093-DA56-4E14-B2AB-D565B64F73E1}
|
|
||||||
EndGlobalSection
|
|
||||||
EndGlobal
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
namespace Quik.CommandMachine
|
|
||||||
{
|
|
||||||
public enum FrameType
|
|
||||||
{
|
|
||||||
None,
|
|
||||||
Command,
|
|
||||||
IVec1,
|
|
||||||
IVec2,
|
|
||||||
IVec3,
|
|
||||||
IVec4,
|
|
||||||
Vec1,
|
|
||||||
Vec2,
|
|
||||||
Vec3,
|
|
||||||
Vec4,
|
|
||||||
Object,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Quik.CommandMachine;
|
|
||||||
|
|
||||||
namespace Quik.Controls
|
|
||||||
{
|
|
||||||
public class FlowBox : ContainerControl
|
|
||||||
{
|
|
||||||
public Direction FlowDirection { get; set; }
|
|
||||||
public bool AllowWrap { get; set; }
|
|
||||||
public VerticalAlignment VerticalAlignment { get; set; }
|
|
||||||
public HorizontalAlignment HorizontalAlignment { get; set; }
|
|
||||||
|
|
||||||
protected override void ValidateLayout()
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void ValidateVisual(CommandList cmd)
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
17
tests/Dashboard.Demo/Dashboard.Demo.csproj
Normal file
17
tests/Dashboard.Demo/Dashboard.Demo.csproj
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\..\Dashboard\Dashboard.csproj" />
|
||||||
|
<ProjectReference Include="..\..\Dashboard.Media.Defaults\Dashboard.Media.Defaults.csproj" />
|
||||||
|
<ProjectReference Include="..\..\Dashboard.OpenTK\Dashboard.OpenTK.csproj" />
|
||||||
|
<ProjectReference Include="..\..\Dashboard.BlurgText\Dashboard.BlurgText.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<OutputType>Exe</OutputType>
|
||||||
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
|
<ImplicitUsings>disable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
52
tests/Dashboard.Demo/Program.cs
Normal file
52
tests/Dashboard.Demo/Program.cs
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
using Dashboard;
|
||||||
|
using Dashboard.CommandMachine;
|
||||||
|
using Dashboard.Controls;
|
||||||
|
using Dashboard.OpenTK;
|
||||||
|
using Dashboard.Media.Defaults;
|
||||||
|
using Dashboard.Media;
|
||||||
|
using Dashboard.PAL;
|
||||||
|
using Dashboard.BlurgText;
|
||||||
|
using BlurgText;
|
||||||
|
|
||||||
|
namespace Dashboard.Demo
|
||||||
|
{
|
||||||
|
public static class Program
|
||||||
|
{
|
||||||
|
public static readonly DashboardApplication Application = new DashboardApplication(new OpenTKPlatform());
|
||||||
|
|
||||||
|
public static void Main(string[] args)
|
||||||
|
{
|
||||||
|
Application.Run(new EmptyView());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class EmptyView : View
|
||||||
|
{
|
||||||
|
private QFont? font;
|
||||||
|
DashboardBlurg dblurg = new DashboardBlurg();
|
||||||
|
BlurgResult? result;
|
||||||
|
// private readonly Label Label = new Label() { Text = "Hello world!", Position = new QVec2(300, 300) };
|
||||||
|
|
||||||
|
protected override void PaintBegin(CommandList cmd)
|
||||||
|
{
|
||||||
|
base.PaintBegin(cmd);
|
||||||
|
|
||||||
|
if (result == null)
|
||||||
|
{
|
||||||
|
// IFontDataBase db = FontDataBaseProvider.Instance;
|
||||||
|
// font = new QFontFreeType(db.FontFileInfo(db.Sans).OpenRead());
|
||||||
|
|
||||||
|
// Label.Font = font;
|
||||||
|
// Label.TextSize = 12;
|
||||||
|
// Label.InvalidateVisual();
|
||||||
|
|
||||||
|
var font = dblurg.Blurg.AddFontFile("/usr/share/fonts/google-noto/NotoSans-Regular.ttf");
|
||||||
|
result = dblurg.Blurg.BuildString(font!, 12, BlurgColor.White, "Hello World");
|
||||||
|
}
|
||||||
|
|
||||||
|
cmd.PutBlurgText(dblurg, result!, new QVec2(300, 300));
|
||||||
|
cmd.Rectangle(new QRectangle(16, 16, 0, 0));
|
||||||
|
// Label.Paint(cmd);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
using Quik;
|
|
||||||
using Quik.CommandMachine;
|
|
||||||
using Quik.Controls;
|
|
||||||
using Quik.OpenTK;
|
|
||||||
using Quik.Media.Defaults;
|
|
||||||
using Quik.Media;
|
|
||||||
using Quik.PAL;
|
|
||||||
|
|
||||||
namespace QuikDemo
|
|
||||||
{
|
|
||||||
public static class Program
|
|
||||||
{
|
|
||||||
public static readonly QuikApplication Application = new QuikApplication(new OpenTKPlatform());
|
|
||||||
|
|
||||||
public static void Main(string[] args)
|
|
||||||
{
|
|
||||||
Application.Run(new EmptyView());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class EmptyView : View
|
|
||||||
{
|
|
||||||
private QFont? font;
|
|
||||||
private readonly Label Label = new Label() { Text = "Hello world!", Position = new QVec2(300, 300) };
|
|
||||||
|
|
||||||
protected override void PaintBegin(CommandList cmd)
|
|
||||||
{
|
|
||||||
base.PaintBegin(cmd);
|
|
||||||
|
|
||||||
if (font == null)
|
|
||||||
{
|
|
||||||
IFontDataBase db = FontDataBaseProvider.Instance;
|
|
||||||
font = new QFontFreeType(db.FontFileInfo(db.Sans).OpenRead());
|
|
||||||
|
|
||||||
Label.Font = font;
|
|
||||||
Label.TextSize = 12;
|
|
||||||
Label.InvalidateVisual();
|
|
||||||
}
|
|
||||||
|
|
||||||
cmd.Rectangle(new QRectangle(16, 16, 0, 0));
|
|
||||||
Label.Paint(cmd);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\..\Quik\Quik.csproj" />
|
|
||||||
<ProjectReference Include="..\..\Quik.Media.Defaults\Quik.Media.Defaults.csproj" />
|
|
||||||
<ProjectReference Include="..\..\Quik.OpenTK\Quik.OpenTK.csproj" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<OutputType>Exe</OutputType>
|
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
|
||||||
<ImplicitUsings>disable</ImplicitUsings>
|
|
||||||
<Nullable>enable</Nullable>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
||||||
Reference in New Issue
Block a user