From: Jean-Philippe Bruyère Date: Wed, 16 Jul 2025 18:08:03 +0000 (+0200) Subject: DebugLogViewer, DockTests X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=149205e8ebe5c4ab1ca52ca700ff754aabdf14aa;p=jp%2Fcrow.git DebugLogViewer, DockTests --- diff --git a/Backends/CairoBackend/Crow.CairoBackend.csproj b/Backends/CairoBackend/Crow.CairoBackend.csproj index 60a301ce..0a6d6529 100644 --- a/Backends/CairoBackend/Crow.CairoBackend.csproj +++ b/Backends/CairoBackend/Crow.CairoBackend.csproj @@ -3,7 +3,7 @@ netcoreapp3.1 - 1.2.3 + 1.2.4 $(AssemblyVersion)-beta C.R.O.W Cairo Backend diff --git a/Crow.sln b/Crow.sln index df9d9f8c..50981c0e 100644 --- a/Crow.sln +++ b/Crow.sln @@ -1,4 +1,5 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 + +Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.30104.148 MinimumVisualStudioVersion = 10.0.40219.1 @@ -35,48 +36,160 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BasicTests", "Samples\Basic EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AnimTest", "Samples\AnimTest\AnimTest.csproj", "{17DEFFB4-AA0C-4C92-999B-1F3DD4BB9AA1}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DockTests", "Samples\DockTests\DockTests.csproj", "{769CA47D-A65B-4902-B6B7-13AFF52085E8}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DebugLogViewer", "Samples\DebugLogViewer\DebugLogViewer.csproj", "{72318A7E-B2DE-474A-AC48-26936DCCA718}" +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 + {C2980F9B-4798-4C05-99E2-E174810F7C7B}.Debug|x64.ActiveCfg = Debug|Any CPU + {C2980F9B-4798-4C05-99E2-E174810F7C7B}.Debug|x64.Build.0 = Debug|Any CPU + {C2980F9B-4798-4C05-99E2-E174810F7C7B}.Debug|x86.ActiveCfg = Debug|Any CPU + {C2980F9B-4798-4C05-99E2-E174810F7C7B}.Debug|x86.Build.0 = Debug|Any CPU + {C2980F9B-4798-4C05-99E2-E174810F7C7B}.Release|x64.ActiveCfg = Release|Any CPU + {C2980F9B-4798-4C05-99E2-E174810F7C7B}.Release|x64.Build.0 = Release|Any CPU + {C2980F9B-4798-4C05-99E2-E174810F7C7B}.Release|x86.ActiveCfg = Release|Any CPU + {C2980F9B-4798-4C05-99E2-E174810F7C7B}.Release|x86.Build.0 = Release|Any CPU {F535A8AB-CD93-49AB-B1B0-FFF9AE51ED6A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F535A8AB-CD93-49AB-B1B0-FFF9AE51ED6A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F535A8AB-CD93-49AB-B1B0-FFF9AE51ED6A}.Debug|x64.ActiveCfg = Debug|Any CPU + {F535A8AB-CD93-49AB-B1B0-FFF9AE51ED6A}.Debug|x64.Build.0 = Debug|Any CPU + {F535A8AB-CD93-49AB-B1B0-FFF9AE51ED6A}.Debug|x86.ActiveCfg = Debug|Any CPU + {F535A8AB-CD93-49AB-B1B0-FFF9AE51ED6A}.Debug|x86.Build.0 = Debug|Any CPU {F535A8AB-CD93-49AB-B1B0-FFF9AE51ED6A}.Release|Any CPU.ActiveCfg = Release|Any CPU {F535A8AB-CD93-49AB-B1B0-FFF9AE51ED6A}.Release|Any CPU.Build.0 = Release|Any CPU + {F535A8AB-CD93-49AB-B1B0-FFF9AE51ED6A}.Release|x64.ActiveCfg = Release|Any CPU + {F535A8AB-CD93-49AB-B1B0-FFF9AE51ED6A}.Release|x64.Build.0 = Release|Any CPU + {F535A8AB-CD93-49AB-B1B0-FFF9AE51ED6A}.Release|x86.ActiveCfg = Release|Any CPU + {F535A8AB-CD93-49AB-B1B0-FFF9AE51ED6A}.Release|x86.Build.0 = Release|Any CPU {56329D48-D382-4850-93DE-59C453894E8A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {56329D48-D382-4850-93DE-59C453894E8A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {56329D48-D382-4850-93DE-59C453894E8A}.Debug|x64.ActiveCfg = Debug|Any CPU + {56329D48-D382-4850-93DE-59C453894E8A}.Debug|x64.Build.0 = Debug|Any CPU + {56329D48-D382-4850-93DE-59C453894E8A}.Debug|x86.ActiveCfg = Debug|Any CPU + {56329D48-D382-4850-93DE-59C453894E8A}.Debug|x86.Build.0 = Debug|Any CPU {56329D48-D382-4850-93DE-59C453894E8A}.Release|Any CPU.ActiveCfg = Release|Any CPU {56329D48-D382-4850-93DE-59C453894E8A}.Release|Any CPU.Build.0 = Release|Any CPU + {56329D48-D382-4850-93DE-59C453894E8A}.Release|x64.ActiveCfg = Release|Any CPU + {56329D48-D382-4850-93DE-59C453894E8A}.Release|x64.Build.0 = Release|Any CPU + {56329D48-D382-4850-93DE-59C453894E8A}.Release|x86.ActiveCfg = Release|Any CPU + {56329D48-D382-4850-93DE-59C453894E8A}.Release|x86.Build.0 = Release|Any CPU {18EBB41F-815E-4BF5-B80F-C9E2FAB2993A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {18EBB41F-815E-4BF5-B80F-C9E2FAB2993A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {18EBB41F-815E-4BF5-B80F-C9E2FAB2993A}.Debug|x64.ActiveCfg = Debug|Any CPU + {18EBB41F-815E-4BF5-B80F-C9E2FAB2993A}.Debug|x64.Build.0 = Debug|Any CPU + {18EBB41F-815E-4BF5-B80F-C9E2FAB2993A}.Debug|x86.ActiveCfg = Debug|Any CPU + {18EBB41F-815E-4BF5-B80F-C9E2FAB2993A}.Debug|x86.Build.0 = Debug|Any CPU {18EBB41F-815E-4BF5-B80F-C9E2FAB2993A}.Release|Any CPU.ActiveCfg = Release|Any CPU {18EBB41F-815E-4BF5-B80F-C9E2FAB2993A}.Release|Any CPU.Build.0 = Release|Any CPU + {18EBB41F-815E-4BF5-B80F-C9E2FAB2993A}.Release|x64.ActiveCfg = Release|Any CPU + {18EBB41F-815E-4BF5-B80F-C9E2FAB2993A}.Release|x64.Build.0 = Release|Any CPU + {18EBB41F-815E-4BF5-B80F-C9E2FAB2993A}.Release|x86.ActiveCfg = Release|Any CPU + {18EBB41F-815E-4BF5-B80F-C9E2FAB2993A}.Release|x86.Build.0 = Release|Any CPU {B9E665AC-92A5-4F53-A021-7B27A8014BC3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B9E665AC-92A5-4F53-A021-7B27A8014BC3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B9E665AC-92A5-4F53-A021-7B27A8014BC3}.Debug|x64.ActiveCfg = Debug|Any CPU + {B9E665AC-92A5-4F53-A021-7B27A8014BC3}.Debug|x64.Build.0 = Debug|Any CPU + {B9E665AC-92A5-4F53-A021-7B27A8014BC3}.Debug|x86.ActiveCfg = Debug|Any CPU + {B9E665AC-92A5-4F53-A021-7B27A8014BC3}.Debug|x86.Build.0 = Debug|Any CPU {B9E665AC-92A5-4F53-A021-7B27A8014BC3}.Release|Any CPU.ActiveCfg = Release|Any CPU {B9E665AC-92A5-4F53-A021-7B27A8014BC3}.Release|Any CPU.Build.0 = Release|Any CPU + {B9E665AC-92A5-4F53-A021-7B27A8014BC3}.Release|x64.ActiveCfg = Release|Any CPU + {B9E665AC-92A5-4F53-A021-7B27A8014BC3}.Release|x64.Build.0 = Release|Any CPU + {B9E665AC-92A5-4F53-A021-7B27A8014BC3}.Release|x86.ActiveCfg = Release|Any CPU + {B9E665AC-92A5-4F53-A021-7B27A8014BC3}.Release|x86.Build.0 = Release|Any CPU {E06441A9-0CFD-45BB-9478-99D28CEB327F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E06441A9-0CFD-45BB-9478-99D28CEB327F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E06441A9-0CFD-45BB-9478-99D28CEB327F}.Debug|x64.ActiveCfg = Debug|Any CPU + {E06441A9-0CFD-45BB-9478-99D28CEB327F}.Debug|x64.Build.0 = Debug|Any CPU + {E06441A9-0CFD-45BB-9478-99D28CEB327F}.Debug|x86.ActiveCfg = Debug|Any CPU + {E06441A9-0CFD-45BB-9478-99D28CEB327F}.Debug|x86.Build.0 = Debug|Any CPU {E06441A9-0CFD-45BB-9478-99D28CEB327F}.Release|Any CPU.ActiveCfg = Release|Any CPU {E06441A9-0CFD-45BB-9478-99D28CEB327F}.Release|Any CPU.Build.0 = Release|Any CPU + {E06441A9-0CFD-45BB-9478-99D28CEB327F}.Release|x64.ActiveCfg = Release|Any CPU + {E06441A9-0CFD-45BB-9478-99D28CEB327F}.Release|x64.Build.0 = Release|Any CPU + {E06441A9-0CFD-45BB-9478-99D28CEB327F}.Release|x86.ActiveCfg = Release|Any CPU + {E06441A9-0CFD-45BB-9478-99D28CEB327F}.Release|x86.Build.0 = Release|Any CPU {34976828-80CF-4AC5-8C81-F66F635DC5FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {34976828-80CF-4AC5-8C81-F66F635DC5FC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {34976828-80CF-4AC5-8C81-F66F635DC5FC}.Debug|x64.ActiveCfg = Debug|Any CPU + {34976828-80CF-4AC5-8C81-F66F635DC5FC}.Debug|x64.Build.0 = Debug|Any CPU + {34976828-80CF-4AC5-8C81-F66F635DC5FC}.Debug|x86.ActiveCfg = Debug|Any CPU + {34976828-80CF-4AC5-8C81-F66F635DC5FC}.Debug|x86.Build.0 = Debug|Any CPU {34976828-80CF-4AC5-8C81-F66F635DC5FC}.Release|Any CPU.ActiveCfg = Release|Any CPU {34976828-80CF-4AC5-8C81-F66F635DC5FC}.Release|Any CPU.Build.0 = Release|Any CPU + {34976828-80CF-4AC5-8C81-F66F635DC5FC}.Release|x64.ActiveCfg = Release|Any CPU + {34976828-80CF-4AC5-8C81-F66F635DC5FC}.Release|x64.Build.0 = Release|Any CPU + {34976828-80CF-4AC5-8C81-F66F635DC5FC}.Release|x86.ActiveCfg = Release|Any CPU + {34976828-80CF-4AC5-8C81-F66F635DC5FC}.Release|x86.Build.0 = Release|Any CPU {ADAABC24-0152-41E2-BBEC-3AC9ACEE1175}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {ADAABC24-0152-41E2-BBEC-3AC9ACEE1175}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ADAABC24-0152-41E2-BBEC-3AC9ACEE1175}.Debug|x64.ActiveCfg = Debug|Any CPU + {ADAABC24-0152-41E2-BBEC-3AC9ACEE1175}.Debug|x64.Build.0 = Debug|Any CPU + {ADAABC24-0152-41E2-BBEC-3AC9ACEE1175}.Debug|x86.ActiveCfg = Debug|Any CPU + {ADAABC24-0152-41E2-BBEC-3AC9ACEE1175}.Debug|x86.Build.0 = Debug|Any CPU {ADAABC24-0152-41E2-BBEC-3AC9ACEE1175}.Release|Any CPU.ActiveCfg = Release|Any CPU {ADAABC24-0152-41E2-BBEC-3AC9ACEE1175}.Release|Any CPU.Build.0 = Release|Any CPU + {ADAABC24-0152-41E2-BBEC-3AC9ACEE1175}.Release|x64.ActiveCfg = Release|Any CPU + {ADAABC24-0152-41E2-BBEC-3AC9ACEE1175}.Release|x64.Build.0 = Release|Any CPU + {ADAABC24-0152-41E2-BBEC-3AC9ACEE1175}.Release|x86.ActiveCfg = Release|Any CPU + {ADAABC24-0152-41E2-BBEC-3AC9ACEE1175}.Release|x86.Build.0 = Release|Any CPU {1A0FF3B6-E97B-4F1D-9CDE-9C54742317BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {1A0FF3B6-E97B-4F1D-9CDE-9C54742317BA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1A0FF3B6-E97B-4F1D-9CDE-9C54742317BA}.Debug|x64.ActiveCfg = Debug|Any CPU + {1A0FF3B6-E97B-4F1D-9CDE-9C54742317BA}.Debug|x64.Build.0 = Debug|Any CPU + {1A0FF3B6-E97B-4F1D-9CDE-9C54742317BA}.Debug|x86.ActiveCfg = Debug|Any CPU + {1A0FF3B6-E97B-4F1D-9CDE-9C54742317BA}.Debug|x86.Build.0 = Debug|Any CPU {1A0FF3B6-E97B-4F1D-9CDE-9C54742317BA}.Release|Any CPU.ActiveCfg = Release|Any CPU {1A0FF3B6-E97B-4F1D-9CDE-9C54742317BA}.Release|Any CPU.Build.0 = Release|Any CPU + {1A0FF3B6-E97B-4F1D-9CDE-9C54742317BA}.Release|x64.ActiveCfg = Release|Any CPU + {1A0FF3B6-E97B-4F1D-9CDE-9C54742317BA}.Release|x64.Build.0 = Release|Any CPU + {1A0FF3B6-E97B-4F1D-9CDE-9C54742317BA}.Release|x86.ActiveCfg = Release|Any CPU + {1A0FF3B6-E97B-4F1D-9CDE-9C54742317BA}.Release|x86.Build.0 = Release|Any CPU {17DEFFB4-AA0C-4C92-999B-1F3DD4BB9AA1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {17DEFFB4-AA0C-4C92-999B-1F3DD4BB9AA1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {17DEFFB4-AA0C-4C92-999B-1F3DD4BB9AA1}.Debug|x64.ActiveCfg = Debug|Any CPU + {17DEFFB4-AA0C-4C92-999B-1F3DD4BB9AA1}.Debug|x64.Build.0 = Debug|Any CPU + {17DEFFB4-AA0C-4C92-999B-1F3DD4BB9AA1}.Debug|x86.ActiveCfg = Debug|Any CPU + {17DEFFB4-AA0C-4C92-999B-1F3DD4BB9AA1}.Debug|x86.Build.0 = Debug|Any CPU {17DEFFB4-AA0C-4C92-999B-1F3DD4BB9AA1}.Release|Any CPU.ActiveCfg = Release|Any CPU {17DEFFB4-AA0C-4C92-999B-1F3DD4BB9AA1}.Release|Any CPU.Build.0 = Release|Any CPU + {17DEFFB4-AA0C-4C92-999B-1F3DD4BB9AA1}.Release|x64.ActiveCfg = Release|Any CPU + {17DEFFB4-AA0C-4C92-999B-1F3DD4BB9AA1}.Release|x64.Build.0 = Release|Any CPU + {17DEFFB4-AA0C-4C92-999B-1F3DD4BB9AA1}.Release|x86.ActiveCfg = Release|Any CPU + {17DEFFB4-AA0C-4C92-999B-1F3DD4BB9AA1}.Release|x86.Build.0 = Release|Any CPU + {769CA47D-A65B-4902-B6B7-13AFF52085E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {769CA47D-A65B-4902-B6B7-13AFF52085E8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {769CA47D-A65B-4902-B6B7-13AFF52085E8}.Debug|x64.ActiveCfg = Debug|Any CPU + {769CA47D-A65B-4902-B6B7-13AFF52085E8}.Debug|x64.Build.0 = Debug|Any CPU + {769CA47D-A65B-4902-B6B7-13AFF52085E8}.Debug|x86.ActiveCfg = Debug|Any CPU + {769CA47D-A65B-4902-B6B7-13AFF52085E8}.Debug|x86.Build.0 = Debug|Any CPU + {769CA47D-A65B-4902-B6B7-13AFF52085E8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {769CA47D-A65B-4902-B6B7-13AFF52085E8}.Release|Any CPU.Build.0 = Release|Any CPU + {769CA47D-A65B-4902-B6B7-13AFF52085E8}.Release|x64.ActiveCfg = Release|Any CPU + {769CA47D-A65B-4902-B6B7-13AFF52085E8}.Release|x64.Build.0 = Release|Any CPU + {769CA47D-A65B-4902-B6B7-13AFF52085E8}.Release|x86.ActiveCfg = Release|Any CPU + {769CA47D-A65B-4902-B6B7-13AFF52085E8}.Release|x86.Build.0 = Release|Any CPU + {72318A7E-B2DE-474A-AC48-26936DCCA718}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {72318A7E-B2DE-474A-AC48-26936DCCA718}.Debug|Any CPU.Build.0 = Debug|Any CPU + {72318A7E-B2DE-474A-AC48-26936DCCA718}.Debug|x64.ActiveCfg = Debug|Any CPU + {72318A7E-B2DE-474A-AC48-26936DCCA718}.Debug|x64.Build.0 = Debug|Any CPU + {72318A7E-B2DE-474A-AC48-26936DCCA718}.Debug|x86.ActiveCfg = Debug|Any CPU + {72318A7E-B2DE-474A-AC48-26936DCCA718}.Debug|x86.Build.0 = Debug|Any CPU + {72318A7E-B2DE-474A-AC48-26936DCCA718}.Release|Any CPU.ActiveCfg = Release|Any CPU + {72318A7E-B2DE-474A-AC48-26936DCCA718}.Release|Any CPU.Build.0 = Release|Any CPU + {72318A7E-B2DE-474A-AC48-26936DCCA718}.Release|x64.ActiveCfg = Release|Any CPU + {72318A7E-B2DE-474A-AC48-26936DCCA718}.Release|x64.Build.0 = Release|Any CPU + {72318A7E-B2DE-474A-AC48-26936DCCA718}.Release|x86.ActiveCfg = Release|Any CPU + {72318A7E-B2DE-474A-AC48-26936DCCA718}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -90,6 +203,8 @@ Global {ADAABC24-0152-41E2-BBEC-3AC9ACEE1175} = {451F5727-2A2E-4361-A41B-089429ADE8F9} {1A0FF3B6-E97B-4F1D-9CDE-9C54742317BA} = {B2C7855A-2878-47FD-AD32-9A83DB4AB8C6} {17DEFFB4-AA0C-4C92-999B-1F3DD4BB9AA1} = {B2C7855A-2878-47FD-AD32-9A83DB4AB8C6} + {769CA47D-A65B-4902-B6B7-13AFF52085E8} = {B2C7855A-2878-47FD-AD32-9A83DB4AB8C6} + {72318A7E-B2DE-474A-AC48-26936DCCA718} = {B2C7855A-2878-47FD-AD32-9A83DB4AB8C6} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {00D4E149-7131-49F4-BAAD-559AA961A78E} diff --git a/Crow/src/DebugUtils/DbgEvent.cs b/Crow/src/DebugUtils/DbgEvent.cs index 791dc544..20747fb8 100644 --- a/Crow/src/DebugUtils/DbgEvent.cs +++ b/Crow/src/DebugUtils/DbgEvent.cs @@ -97,7 +97,7 @@ namespace Crow.DebugLogger public virtual string Print () => $"{begin,10}:{threadId,-2}:{type,-20}:{Message}"; public override string ToString () - => $"{begin};{end};{threadId};{type};{Message}"; + => $"{begin};{end};{threadId};{type};{Message?.Replace("\n", @"\n")}"; public virtual Color Color { get { switch (type) { diff --git a/Crow/src/DebugUtils/DbgWidgetRecord.cs b/Crow/src/DebugUtils/DbgWidgetRecord.cs index 6b0bfb5f..92868c5a 100644 --- a/Crow/src/DebugUtils/DbgWidgetRecord.cs +++ b/Crow/src/DebugUtils/DbgWidgetRecord.cs @@ -19,6 +19,7 @@ namespace Crow.DebugLogger public int listIndex;//prevent doing an IndexOf on list for each event to know y pos on screen //public int instanceNum;//class instantiation order, used to bind events to objs public string name; + public string nameAndIndex => $"{name}{listIndex}"; //0 is the main graphic tree, for other obj tree not added to main tree, it range from 1->n //useful to track events for obj shown later, not on start public int InstanceIndex; diff --git a/Crow/src/DebugUtils/DebugLogger.cs b/Crow/src/DebugUtils/DebugLogger.cs index f7078ed8..9355c256 100644 --- a/Crow/src/DebugUtils/DebugLogger.cs +++ b/Crow/src/DebugUtils/DebugLogger.cs @@ -31,6 +31,7 @@ namespace Crow static object logMutex = new object (); static Stopwatch chrono = Stopwatch.StartNew (); static List events = new List (); + public static IEnumerable Events => events; //started events per thread static Dictionary> startedEvents = new Dictionary> (); //helper for fetching current event list to add next event to while recording @@ -49,6 +50,7 @@ namespace Crow } public static readonly bool IsEnabled = true; #else + public static IEnumerable Events => null; public static readonly bool IsEnabled = false; #endif @@ -179,18 +181,20 @@ lock (logMutex) { Monitor.Exit(logMutex); if (ConsoleOutput) { - if (evt.type.HasFlag (DbgEvtType.Error)) { - Console.ForegroundColor = ConsoleColor.Red; - } - if (evt is DbgWidgetEvent we) { - Console.WriteLine ($"{evt.Print()} {Widget.GraphicObjects[we.InstanceIndex]}"); - } else - Console.WriteLine ($"{evt.Print()}"); - Console.ResetColor (); - } + printToConsole(evt); + } + } + static void printToConsole(DbgEvent evt) { + if (evt.type.HasFlag (DbgEvtType.Error)) { + Console.ForegroundColor = ConsoleColor.Red; + } + if (evt is DbgWidgetEvent we) { + Console.WriteLine ($"{evt.Print()} {Widget.GraphicObjects[we.InstanceIndex]}"); + } else + Console.WriteLine ($"{evt.Print()}"); + Console.ResetColor (); #endif } - #if DEBUG_LOG static DbgEvent addEventInternal (DbgEvtType evtType, params object [] data) { @@ -236,6 +240,8 @@ lock (logMutex) { foreach (DbgEvent e in evts) { if (e == null) continue; + /*if (e.type == DbgEvtType.GOSetProperty) + Debugger.Break();*/ s.WriteLine (new string ('\t', level) + e); if (e.Events != null) saveEventList (s, e.Events, level + 1); diff --git a/Crow/src/DebugUtils/Utils.cs b/Crow/src/DebugUtils/Utils.cs deleted file mode 100644 index ce3d5c38..00000000 --- a/Crow/src/DebugUtils/Utils.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) 2013-2020 Jean-Philippe Bruyère -// -// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) -using System; -using System.Diagnostics; -using System.Runtime.CompilerServices; - -namespace Crow -{ - public static class Logger - { - [Flags] - public enum LogType - { - Info = 1, - Warning = 2, - Error = 4, - } - - public static LogType CurrentLogLevel = LogType.Error; - - static Stopwatch timer = Stopwatch.StartNew (); - - - public static void LOG(string message = null, [CallerMemberName] string caller = null) { - Console.WriteLine ($"{timer.ElapsedMilliseconds, 10} {caller}: {message}"); - } - } -} diff --git a/Crow/src/Interface.cs b/Crow/src/Interface.cs index 0b4491f5..8a56c754 100644 --- a/Crow/src/Interface.cs +++ b/Crow/src/Interface.cs @@ -88,7 +88,7 @@ namespace Crow /// Allow rendering of interface in development environment public static bool DesignerMode = false; /// Disable caching for a widget if this threshold is reached - public const int MaxCacheSize = 2048; + public const int MaxCacheSize = 4096; /// Above this count, the layouting is discard from the current /// update cycle and requeued for the next public static int MaxLayoutingTries = 30; @@ -589,9 +589,6 @@ namespace Crow } protected virtual void OnInitialized () { - /*try { - Load ("#main.crow").DataSource = this; - } catch { }*/ Initialized.Raise (this, null); } /// @@ -1248,7 +1245,7 @@ namespace Crow } if (lastDragImageBounds != DragImageBounds) { - /*ctx.LineWidth = 1; + ctx.LineWidth = 1; ctx.SetSource(1,0,0,0.6); ctx.Rectangle(DragImageBounds); ctx.Stroke (); @@ -1256,7 +1253,7 @@ namespace Crow ctx.Rectangle(lastDragImageBounds); ctx.Stroke (); ctx.Arc(lastDragImageBounds.X, lastDragImageBounds.Y, 5,0,Math.PI*2.0); - ctx.Fill ();*/ + ctx.Fill (); DirtyRect += lastDragImageBounds; ctx.Save (); @@ -1911,8 +1908,8 @@ namespace Crow Widget g = _hoverWidget; while (g != null) { if (!string.IsNullOrEmpty (g.Tooltip)) { - if (g.Tooltip.StartsWith("#", StringComparison.Ordinal)) { - //custom tooltip container + if (g.Tooltip.StartsWith("#", StringComparison.Ordinal) && g.Tooltip.Length > 1) { + //custom tooltip container ToolTipContainer = CreateInstance (g.Tooltip); } else ToolTipContainer = CreateInstance ("#Crow.Tooltip.template"); diff --git a/Crow/src/Text/SpanCharReader.cs b/Crow/src/Text/SpanCharReader.cs index 60fb432b..1a259b4a 100644 --- a/Crow/src/Text/SpanCharReader.cs +++ b/Crow/src/Text/SpanCharReader.cs @@ -40,7 +40,12 @@ namespace Crow.Text c = Read(); return true; } - public bool TryRead (char c) => EndOfSpan ? false : Read() == c; + public bool TryRead (char c) { + if (!TryPeek(c)) + return false; + Read(); + return true; + } public ReadOnlySpan Read (int length) => buffer.Slice (curPos += length, length); public void Advance (int increment = 1) => curPos += increment; @@ -145,8 +150,8 @@ namespace Crow.Text /// /// public bool Eol () { - return Peek == '\x85' || Peek == '\x2028' || Peek == '\xA' || curPos + 1 == buffer.Length || - (Peek == '\xD' && (buffer [curPos + 1] == '\xA' || buffer [curPos + 1] == '\x85')); + return Peek == '\x85' || Peek == '\x2028' || Peek == '\xA' || Peek == '\xD' | + (curPos < buffer.Length - 1 && Peek == '\xD' && (buffer [curPos + 1] == '\xA' || buffer [curPos + 1] == '\x85')); } /// diff --git a/Crow/src/Widgets/ColorPicker.cs b/Crow/src/Widgets/ColorPicker.cs index 7b250be5..e86b42ef 100644 --- a/Crow/src/Widgets/ColorPicker.cs +++ b/Crow/src/Widgets/ColorPicker.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2013-2019 Bruyère Jean-Philippe jp_bruyere@hotmail.com +// Copyright (c) 2013-2025 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 System.Xml.Serialization; using System.ComponentModel; using System.Collections.Generic; using System.Linq; @@ -106,10 +104,11 @@ namespace Crow public IList AvailableColors => //Enum.GetValues (typeof (Color)).ToList ();// Colors. ColorDic.Values.OrderBy (c => c.Hue).ToList (); EnumsNET.Enums.GetValues ().ToList (); + //EnumsNET.Enums.GetValues ().OrderBy(c=>(((Color)c).Value << 8) + (((Color)c).Hue << 16) + (((Color)c).Saturation)).ToList (); public void onSelectedItemChanged(object sender, SelectionChangeEventArgs e) { CurrentColor = (Color)(Colors)e.NewValue; } - } + } } diff --git a/Crow/src/Widgets/DockWindow.cs b/Crow/src/Widgets/DockWindow.cs index d3e343e0..920e1c0a 100644 --- a/Crow/src/Widgets/DockWindow.cs +++ b/Crow/src/Widgets/DockWindow.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2013-2022 Jean-Philippe Bruyère +// Copyright (c) 2013-2025 Jean-Philippe Bruyère // // This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) @@ -210,11 +210,17 @@ namespace Crow r.Inflate(-2,-2); ISurface dragImg = IFace.Backend.CreateSurface (r.Width, r.Height); using (IContext gr = IFace.Backend.CreateContext (dragImg)) { - gr.LineWidth = 1; + /*gr.LineWidth = 1; gr.Rectangle (0,0,r.Width,r.Height); gr.SetSource (0.2,0.3,0.9,0.5); gr.FillPreserve (); gr.SetSource (0.1,0.2,1); + gr.Stroke ();*/ + gr.LineWidth = 2; + gr.Rectangle (0,0,r.Width,r.Height); + gr.SetSource (0.2,0.3,0.9,0.5); + gr.FillPreserve (); + gr.SetSource (1.0,0.2,1); gr.Stroke (); } IFace.CreateDragImage (dragImg, r, false); @@ -311,7 +317,7 @@ namespace Crow if (Parent == IFace) { IFace.RemoveWidget (this); } else { - floatingGroup = Parent as Group; + FloatingGroup = Parent as Group; floatingGroup.RemoveChild(this); } diff --git a/Crow/src/Widgets/GenericStack.cs b/Crow/src/Widgets/GenericStack.cs index d5375c5f..9325238d 100644 --- a/Crow/src/Widgets/GenericStack.cs +++ b/Crow/src/Widgets/GenericStack.cs @@ -5,7 +5,7 @@ using System; using System.ComponentModel; using System.Linq; -using static Crow.Logger; + namespace Crow { /// /// group container that stacked its children horizontally or vertically diff --git a/Crow/src/Widgets/Group.cs b/Crow/src/Widgets/Group.cs index e6e6caf6..a7734733 100644 --- a/Crow/src/Widgets/Group.cs +++ b/Crow/src/Widgets/Group.cs @@ -1,14 +1,8 @@ -// Copyright (c) 2013-2021 Jean-Philippe Bruyère +// Copyright (c) 2013-2025 Jean-Philippe Bruyère // // This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) using System; -using System.Collections.Generic; -using System.ComponentModel; - -using System.Threading; - -using static Crow.Logger; namespace Crow { diff --git a/Crow/src/Widgets/GroupBase.cs b/Crow/src/Widgets/GroupBase.cs index 65fe860f..c98b5b5b 100644 --- a/Crow/src/Widgets/GroupBase.cs +++ b/Crow/src/Widgets/GroupBase.cs @@ -1,15 +1,12 @@ -// Copyright (c) 2013-2021 Jean-Philippe Bruyère +// Copyright (c) 2013-2025 Jean-Philippe Bruyère // // This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) using System; using System.Collections.Generic; using System.ComponentModel; - using System.Threading; using Drawing2D; -using static Crow.Logger; - namespace Crow { diff --git a/Crow/src/Widgets/PrivateContainer.cs b/Crow/src/Widgets/PrivateContainer.cs index addb54c7..bd30ddd5 100644 --- a/Crow/src/Widgets/PrivateContainer.cs +++ b/Crow/src/Widgets/PrivateContainer.cs @@ -1,12 +1,11 @@ -// Copyright (c) 2013-2022 Bruyère Jean-Philippe +// Copyright (c) 2013-2025 Bruyère Jean-Philippe // // This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) using System; - using Drawing2D; -using static Crow.Logger; + namespace Crow { /// diff --git a/Crow/src/Widgets/Table.cs b/Crow/src/Widgets/Table.cs index 86338573..f5eb3188 100644 --- a/Crow/src/Widgets/Table.cs +++ b/Crow/src/Widgets/Table.cs @@ -67,6 +67,7 @@ namespace Crow public Table () {} public Table (Interface iface, string style = null) : base (iface, style) { } #endregion + int columnSpacing, borderLineWidth, verticalLineWidth, horizontalLineWidth, rowsMargin; ObservableList columns; HorizontalStack HeaderRow; diff --git a/Crow/src/Widgets/TemplatedGroup.cs b/Crow/src/Widgets/TemplatedGroup.cs index 4cbace6e..1b4cf320 100644 --- a/Crow/src/Widgets/TemplatedGroup.cs +++ b/Crow/src/Widgets/TemplatedGroup.cs @@ -12,6 +12,7 @@ using System.Threading; using Drawing2D; using Crow.IML; +using System.Diagnostics; namespace Crow { public abstract class TemplatedGroup : TemplatedControl @@ -289,7 +290,7 @@ namespace Crow { void Ol_ListRemove (object sender, ListChangedEventArg e) { cancelLoadingThread (); - + Debug.WriteLine($"{e.Index}"); if (selectedItemContainer == itemsContainer.Children[e.Index]) SelectedItem = null; diff --git a/Crow/src/Widgets/TestWidget.cs b/Crow/src/Widgets/TestWidget.cs new file mode 100644 index 00000000..a575af66 --- /dev/null +++ b/Crow/src/Widgets/TestWidget.cs @@ -0,0 +1,28 @@ +// Copyright (c) 2013-2022 Jean-Philippe Bruyère +// +// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) +using System; +using System.ComponentModel; + +using Drawing2D; + +namespace Crow +{ public class TestWidget : Widget + { + #region CTOR + protected TestWidget () {} + public TestWidget (Interface iface, string style = null) : base (iface, style) { } + #endregion + protected override void onDraw(IContext gr) + { + base.onDraw(gr); + Rectangle rBack = new Rectangle (Slot.Size); + gr.SetSource(Foreground); + rBack.Position = new Point(-100,-100); + gr.Rectangle(rBack); + gr.FillPreserve(); + gr.Stroke(); + } + } +} + diff --git a/Drawing2D/src/Colors.cs b/Drawing2D/src/Colors.cs index a20770e6..d7db8e7e 100644 --- a/Drawing2D/src/Colors.cs +++ b/Drawing2D/src/Colors.cs @@ -164,10 +164,10 @@ namespace Drawing2D public struct Color : IEquatable { #region CTOR - public Color (int r, int g, int b, int a) : + public Color (int r, int g, int b, int a = 255) : this ((uint)r, (uint)g, (uint)b, (uint)a) { } - public Color(uint r, uint g, uint b, uint a) + public Color(uint r, uint g, uint b, uint a = 255) { value = ((r & 0xFF) << 24) + @@ -175,7 +175,7 @@ namespace Drawing2D ((b & 0xFF) << 8) + ((a & 0xFF)); } - public Color (byte r, byte g, byte b, byte a) + public Color (byte r, byte g, byte b, byte a = 0xff) { value = ((uint)r << 24) + ((uint)g << 16) + ((uint)b << 8) + a; } @@ -223,13 +223,6 @@ namespace Drawing2D set => this.value = (value & 0x000000FF); } - - - - /*public string Name; - public string htmlCode; - internal bool predefinied;*/ - #region Operators /*public static implicit operator string(Color c) => c.ToString(); @@ -382,5 +375,6 @@ namespace Drawing2D return new Color (X + m, C + m, m, _alpha / 255.0); return new Color (C + m, X + m, m, _alpha / 255.0); } + public static Color FromRGBA (int r, int g, int b, int a = 255) => new Color(r, g, b, a); } } diff --git a/Samples/DebugLogViewer/DebugLogViewer.csproj b/Samples/DebugLogViewer/DebugLogViewer.csproj new file mode 100644 index 00000000..10728d4c --- /dev/null +++ b/Samples/DebugLogViewer/DebugLogViewer.csproj @@ -0,0 +1,14 @@ + + + + + ui.%(Filename)%(Extension) + + + icons.%(Filename)%(Extension) + + + + \ No newline at end of file diff --git a/Samples/DebugLogViewer/icons/IconAlerte.svg b/Samples/DebugLogViewer/icons/IconAlerte.svg new file mode 100644 index 00000000..286dbf3a --- /dev/null +++ b/Samples/DebugLogViewer/icons/IconAlerte.svg @@ -0,0 +1,177 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Samples/DebugLogViewer/icons/at.svg b/Samples/DebugLogViewer/icons/at.svg new file mode 100644 index 00000000..f8f8aae0 --- /dev/null +++ b/Samples/DebugLogViewer/icons/at.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Samples/DebugLogViewer/icons/automation.svg b/Samples/DebugLogViewer/icons/automation.svg new file mode 100644 index 00000000..1f4c3cad --- /dev/null +++ b/Samples/DebugLogViewer/icons/automation.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/Samples/DebugLogViewer/icons/ban.svg b/Samples/DebugLogViewer/icons/ban.svg new file mode 100644 index 00000000..6040dd7b --- /dev/null +++ b/Samples/DebugLogViewer/icons/ban.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/basic_floppydisk.svg b/Samples/DebugLogViewer/icons/basic_floppydisk.svg new file mode 100644 index 00000000..85fbab94 --- /dev/null +++ b/Samples/DebugLogViewer/icons/basic_floppydisk.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + diff --git a/Samples/DebugLogViewer/icons/binding.svg b/Samples/DebugLogViewer/icons/binding.svg new file mode 100644 index 00000000..04f669ec --- /dev/null +++ b/Samples/DebugLogViewer/icons/binding.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Samples/DebugLogViewer/icons/blank-file.svg b/Samples/DebugLogViewer/icons/blank-file.svg new file mode 100644 index 00000000..8136979e --- /dev/null +++ b/Samples/DebugLogViewer/icons/blank-file.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/bolt.svg b/Samples/DebugLogViewer/icons/bolt.svg new file mode 100644 index 00000000..1a846623 --- /dev/null +++ b/Samples/DebugLogViewer/icons/bolt.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/bug.svg b/Samples/DebugLogViewer/icons/bug.svg new file mode 100644 index 00000000..8c739463 --- /dev/null +++ b/Samples/DebugLogViewer/icons/bug.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/Samples/DebugLogViewer/icons/cancel-button.svg b/Samples/DebugLogViewer/icons/cancel-button.svg new file mode 100644 index 00000000..5f52bb8d --- /dev/null +++ b/Samples/DebugLogViewer/icons/cancel-button.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Samples/DebugLogViewer/icons/categories/Appearance.svg b/Samples/DebugLogViewer/icons/categories/Appearance.svg new file mode 100644 index 00000000..8e425f70 --- /dev/null +++ b/Samples/DebugLogViewer/icons/categories/Appearance.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/categories/Behaviour.svg b/Samples/DebugLogViewer/icons/categories/Behaviour.svg new file mode 100644 index 00000000..1f4c3cad --- /dev/null +++ b/Samples/DebugLogViewer/icons/categories/Behaviour.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/Samples/DebugLogViewer/icons/categories/Data.svg b/Samples/DebugLogViewer/icons/categories/Data.svg new file mode 100644 index 00000000..65a8f065 --- /dev/null +++ b/Samples/DebugLogViewer/icons/categories/Data.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/Samples/DebugLogViewer/icons/categories/Divers.svg b/Samples/DebugLogViewer/icons/categories/Divers.svg new file mode 100644 index 00000000..de5dd372 --- /dev/null +++ b/Samples/DebugLogViewer/icons/categories/Divers.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/categories/Layout.svg b/Samples/DebugLogViewer/icons/categories/Layout.svg new file mode 100644 index 00000000..bbc97197 --- /dev/null +++ b/Samples/DebugLogViewer/icons/categories/Layout.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/center-align.svg b/Samples/DebugLogViewer/icons/center-align.svg new file mode 100644 index 00000000..92e3fac8 --- /dev/null +++ b/Samples/DebugLogViewer/icons/center-align.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/Samples/DebugLogViewer/icons/circle-red.svg b/Samples/DebugLogViewer/icons/circle-red.svg new file mode 100644 index 00000000..823837f5 --- /dev/null +++ b/Samples/DebugLogViewer/icons/circle-red.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/circle.svg b/Samples/DebugLogViewer/icons/circle.svg new file mode 100644 index 00000000..dc9e78df --- /dev/null +++ b/Samples/DebugLogViewer/icons/circle.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/coffee.svg b/Samples/DebugLogViewer/icons/coffee.svg new file mode 100644 index 00000000..6ecefe6c --- /dev/null +++ b/Samples/DebugLogViewer/icons/coffee.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Samples/DebugLogViewer/icons/cogwheel.svg b/Samples/DebugLogViewer/icons/cogwheel.svg new file mode 100644 index 00000000..c104c470 --- /dev/null +++ b/Samples/DebugLogViewer/icons/cogwheel.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Samples/DebugLogViewer/icons/comment.svg b/Samples/DebugLogViewer/icons/comment.svg new file mode 100644 index 00000000..d3bb7998 --- /dev/null +++ b/Samples/DebugLogViewer/icons/comment.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/compile.svg b/Samples/DebugLogViewer/icons/compile.svg new file mode 100644 index 00000000..c1a14e77 --- /dev/null +++ b/Samples/DebugLogViewer/icons/compile.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/Samples/DebugLogViewer/icons/compiler_error.svg b/Samples/DebugLogViewer/icons/compiler_error.svg new file mode 100644 index 00000000..1b505681 --- /dev/null +++ b/Samples/DebugLogViewer/icons/compiler_error.svg @@ -0,0 +1,13 @@ + + + + Layer 1 + + X + + + Layer 2 + + ! + + \ No newline at end of file diff --git a/Samples/DebugLogViewer/icons/compiler_warning.svg b/Samples/DebugLogViewer/icons/compiler_warning.svg new file mode 100644 index 00000000..9dac3772 --- /dev/null +++ b/Samples/DebugLogViewer/icons/compiler_warning.svg @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + 3D effect warning triangle + 18/9/07 + + + Tim O'Ryan + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Samples/DebugLogViewer/icons/compiler_warning_orange.svg b/Samples/DebugLogViewer/icons/compiler_warning_orange.svg new file mode 100644 index 00000000..233437ff --- /dev/null +++ b/Samples/DebugLogViewer/icons/compiler_warning_orange.svg @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + 3D effect warning triangle + 18/9/07 + + + Tim O'Ryan + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Samples/DebugLogViewer/icons/computing-code.svg b/Samples/DebugLogViewer/icons/computing-code.svg new file mode 100644 index 00000000..b5687bac --- /dev/null +++ b/Samples/DebugLogViewer/icons/computing-code.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/Samples/DebugLogViewer/icons/connect.svg b/Samples/DebugLogViewer/icons/connect.svg new file mode 100644 index 00000000..51a39c7b --- /dev/null +++ b/Samples/DebugLogViewer/icons/connect.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/copy-file.svg b/Samples/DebugLogViewer/icons/copy-file.svg new file mode 100644 index 00000000..63c2dd37 --- /dev/null +++ b/Samples/DebugLogViewer/icons/copy-file.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/crow.svg b/Samples/DebugLogViewer/icons/crow.svg new file mode 100644 index 00000000..94f5cfc6 --- /dev/null +++ b/Samples/DebugLogViewer/icons/crow.svg @@ -0,0 +1,16 @@ + + + + diff --git a/Samples/DebugLogViewer/icons/curly-brackets.svg b/Samples/DebugLogViewer/icons/curly-brackets.svg new file mode 100644 index 00000000..89ef798c --- /dev/null +++ b/Samples/DebugLogViewer/icons/curly-brackets.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Samples/DebugLogViewer/icons/debug-bug.svg b/Samples/DebugLogViewer/icons/debug-bug.svg new file mode 100644 index 00000000..8c739463 --- /dev/null +++ b/Samples/DebugLogViewer/icons/debug-bug.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/Samples/DebugLogViewer/icons/debug-pause.svg b/Samples/DebugLogViewer/icons/debug-pause.svg new file mode 100644 index 00000000..33f4c868 --- /dev/null +++ b/Samples/DebugLogViewer/icons/debug-pause.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Samples/DebugLogViewer/icons/debug-play.svg b/Samples/DebugLogViewer/icons/debug-play.svg new file mode 100644 index 00000000..91ee85d9 --- /dev/null +++ b/Samples/DebugLogViewer/icons/debug-play.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/debug-step-into.svg b/Samples/DebugLogViewer/icons/debug-step-into.svg new file mode 100644 index 00000000..f60dbf4d --- /dev/null +++ b/Samples/DebugLogViewer/icons/debug-step-into.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Samples/DebugLogViewer/icons/debug-step-out.svg b/Samples/DebugLogViewer/icons/debug-step-out.svg new file mode 100644 index 00000000..8d052bfe --- /dev/null +++ b/Samples/DebugLogViewer/icons/debug-step-out.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Samples/DebugLogViewer/icons/debug-step-over.svg b/Samples/DebugLogViewer/icons/debug-step-over.svg new file mode 100644 index 00000000..6deaf2a6 --- /dev/null +++ b/Samples/DebugLogViewer/icons/debug-step-over.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Samples/DebugLogViewer/icons/debug-stop.svg b/Samples/DebugLogViewer/icons/debug-stop.svg new file mode 100644 index 00000000..27d810a0 --- /dev/null +++ b/Samples/DebugLogViewer/icons/debug-stop.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/dentist-chair.svg b/Samples/DebugLogViewer/icons/dentist-chair.svg new file mode 100644 index 00000000..a5675353 --- /dev/null +++ b/Samples/DebugLogViewer/icons/dentist-chair.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/drop.svg b/Samples/DebugLogViewer/icons/drop.svg new file mode 100644 index 00000000..164aaa6d --- /dev/null +++ b/Samples/DebugLogViewer/icons/drop.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/earth-globe.svg b/Samples/DebugLogViewer/icons/earth-globe.svg new file mode 100644 index 00000000..2d851ccf --- /dev/null +++ b/Samples/DebugLogViewer/icons/earth-globe.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/edit.svg b/Samples/DebugLogViewer/icons/edit.svg new file mode 100644 index 00000000..366862c7 --- /dev/null +++ b/Samples/DebugLogViewer/icons/edit.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/eraser.svg b/Samples/DebugLogViewer/icons/eraser.svg new file mode 100644 index 00000000..5dd73bac --- /dev/null +++ b/Samples/DebugLogViewer/icons/eraser.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/event.svg b/Samples/DebugLogViewer/icons/event.svg new file mode 100644 index 00000000..cedebd5e --- /dev/null +++ b/Samples/DebugLogViewer/icons/event.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/exclamation.svg b/Samples/DebugLogViewer/icons/exclamation.svg new file mode 100644 index 00000000..cc1b2689 --- /dev/null +++ b/Samples/DebugLogViewer/icons/exclamation.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/Samples/DebugLogViewer/icons/file-code.svg b/Samples/DebugLogViewer/icons/file-code.svg new file mode 100644 index 00000000..2dc00db0 --- /dev/null +++ b/Samples/DebugLogViewer/icons/file-code.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/Samples/DebugLogViewer/icons/file-cube.svg b/Samples/DebugLogViewer/icons/file-cube.svg new file mode 100644 index 00000000..6df0f4ab --- /dev/null +++ b/Samples/DebugLogViewer/icons/file-cube.svg @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/Samples/DebugLogViewer/icons/file.svg b/Samples/DebugLogViewer/icons/file.svg new file mode 100644 index 00000000..9d06b00b --- /dev/null +++ b/Samples/DebugLogViewer/icons/file.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/fill.svg b/Samples/DebugLogViewer/icons/fill.svg new file mode 100644 index 00000000..afb69224 --- /dev/null +++ b/Samples/DebugLogViewer/icons/fill.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Samples/DebugLogViewer/icons/filter.svg b/Samples/DebugLogViewer/icons/filter.svg new file mode 100644 index 00000000..7776fda4 --- /dev/null +++ b/Samples/DebugLogViewer/icons/filter.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Samples/DebugLogViewer/icons/folder.svg b/Samples/DebugLogViewer/icons/folder.svg new file mode 100644 index 00000000..f59e2dac --- /dev/null +++ b/Samples/DebugLogViewer/icons/folder.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/Samples/DebugLogViewer/icons/font-file.svg b/Samples/DebugLogViewer/icons/font-file.svg new file mode 100644 index 00000000..20beac14 --- /dev/null +++ b/Samples/DebugLogViewer/icons/font-file.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Samples/DebugLogViewer/icons/forward-arrow.svg b/Samples/DebugLogViewer/icons/forward-arrow.svg new file mode 100644 index 00000000..59fcc904 --- /dev/null +++ b/Samples/DebugLogViewer/icons/forward-arrow.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/inbox.svg b/Samples/DebugLogViewer/icons/inbox.svg new file mode 100644 index 00000000..6aa6714e --- /dev/null +++ b/Samples/DebugLogViewer/icons/inbox.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Samples/DebugLogViewer/icons/level-up.svg b/Samples/DebugLogViewer/icons/level-up.svg new file mode 100644 index 00000000..cf86fcc6 --- /dev/null +++ b/Samples/DebugLogViewer/icons/level-up.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/light-bulb.svg b/Samples/DebugLogViewer/icons/light-bulb.svg new file mode 100644 index 00000000..89ff2364 --- /dev/null +++ b/Samples/DebugLogViewer/icons/light-bulb.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Samples/DebugLogViewer/icons/log.svg b/Samples/DebugLogViewer/icons/log.svg new file mode 100644 index 00000000..0f8a3586 --- /dev/null +++ b/Samples/DebugLogViewer/icons/log.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Samples/DebugLogViewer/icons/magic-wand.svg b/Samples/DebugLogViewer/icons/magic-wand.svg new file mode 100644 index 00000000..8b406918 --- /dev/null +++ b/Samples/DebugLogViewer/icons/magic-wand.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/Samples/DebugLogViewer/icons/move-arrows.svg b/Samples/DebugLogViewer/icons/move-arrows.svg new file mode 100644 index 00000000..ecbb2f91 --- /dev/null +++ b/Samples/DebugLogViewer/icons/move-arrows.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/open.svg b/Samples/DebugLogViewer/icons/open.svg new file mode 100644 index 00000000..bd8d7d9b --- /dev/null +++ b/Samples/DebugLogViewer/icons/open.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Samples/DebugLogViewer/icons/outbox.svg b/Samples/DebugLogViewer/icons/outbox.svg new file mode 100644 index 00000000..bd8d7d9b --- /dev/null +++ b/Samples/DebugLogViewer/icons/outbox.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Samples/DebugLogViewer/icons/paint-brush.svg b/Samples/DebugLogViewer/icons/paint-brush.svg new file mode 100644 index 00000000..2bdd5bed --- /dev/null +++ b/Samples/DebugLogViewer/icons/paint-brush.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/Samples/DebugLogViewer/icons/palette.svg b/Samples/DebugLogViewer/icons/palette.svg new file mode 100644 index 00000000..8e425f70 --- /dev/null +++ b/Samples/DebugLogViewer/icons/palette.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/paragraph.svg b/Samples/DebugLogViewer/icons/paragraph.svg new file mode 100644 index 00000000..826aa63f --- /dev/null +++ b/Samples/DebugLogViewer/icons/paragraph.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/paste-on-document.svg b/Samples/DebugLogViewer/icons/paste-on-document.svg new file mode 100644 index 00000000..b0a705ee --- /dev/null +++ b/Samples/DebugLogViewer/icons/paste-on-document.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/pause-symbol.svg b/Samples/DebugLogViewer/icons/pause-symbol.svg new file mode 100644 index 00000000..33f4c868 --- /dev/null +++ b/Samples/DebugLogViewer/icons/pause-symbol.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Samples/DebugLogViewer/icons/pin.svg b/Samples/DebugLogViewer/icons/pin.svg new file mode 100644 index 00000000..b36340b8 --- /dev/null +++ b/Samples/DebugLogViewer/icons/pin.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/play-button.svg b/Samples/DebugLogViewer/icons/play-button.svg new file mode 100644 index 00000000..91ee85d9 --- /dev/null +++ b/Samples/DebugLogViewer/icons/play-button.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/plugins.svg b/Samples/DebugLogViewer/icons/plugins.svg new file mode 100644 index 00000000..14ea6f37 --- /dev/null +++ b/Samples/DebugLogViewer/icons/plugins.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/presentation.svg b/Samples/DebugLogViewer/icons/presentation.svg new file mode 100644 index 00000000..c79f5a41 --- /dev/null +++ b/Samples/DebugLogViewer/icons/presentation.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Samples/DebugLogViewer/icons/previous.svg b/Samples/DebugLogViewer/icons/previous.svg new file mode 100644 index 00000000..566c8a3e --- /dev/null +++ b/Samples/DebugLogViewer/icons/previous.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/processing-file.svg b/Samples/DebugLogViewer/icons/processing-file.svg new file mode 100644 index 00000000..c5bcbb5d --- /dev/null +++ b/Samples/DebugLogViewer/icons/processing-file.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/Samples/DebugLogViewer/icons/property.svg b/Samples/DebugLogViewer/icons/property.svg new file mode 100644 index 00000000..de5dd372 --- /dev/null +++ b/Samples/DebugLogViewer/icons/property.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/question.svg b/Samples/DebugLogViewer/icons/question.svg new file mode 100644 index 00000000..fb8e3d3f --- /dev/null +++ b/Samples/DebugLogViewer/icons/question.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Samples/DebugLogViewer/icons/recycling.svg b/Samples/DebugLogViewer/icons/recycling.svg new file mode 100644 index 00000000..e86ca134 --- /dev/null +++ b/Samples/DebugLogViewer/icons/recycling.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/Samples/DebugLogViewer/icons/redo.svg b/Samples/DebugLogViewer/icons/redo.svg new file mode 100644 index 00000000..59fcc904 --- /dev/null +++ b/Samples/DebugLogViewer/icons/redo.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/refresh.svg b/Samples/DebugLogViewer/icons/refresh.svg new file mode 100644 index 00000000..464473ec --- /dev/null +++ b/Samples/DebugLogViewer/icons/refresh.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Samples/DebugLogViewer/icons/reply.svg b/Samples/DebugLogViewer/icons/reply.svg new file mode 100644 index 00000000..d008cb34 --- /dev/null +++ b/Samples/DebugLogViewer/icons/reply.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/save.svg b/Samples/DebugLogViewer/icons/save.svg new file mode 100644 index 00000000..6aa6714e --- /dev/null +++ b/Samples/DebugLogViewer/icons/save.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Samples/DebugLogViewer/icons/scissors.svg b/Samples/DebugLogViewer/icons/scissors.svg new file mode 100644 index 00000000..4b5a2255 --- /dev/null +++ b/Samples/DebugLogViewer/icons/scissors.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/search.svg b/Samples/DebugLogViewer/icons/search.svg new file mode 100644 index 00000000..f3eb3682 --- /dev/null +++ b/Samples/DebugLogViewer/icons/search.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/services.svg b/Samples/DebugLogViewer/icons/services.svg new file mode 100644 index 00000000..c1a14e77 --- /dev/null +++ b/Samples/DebugLogViewer/icons/services.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/Samples/DebugLogViewer/icons/share-arrow.svg b/Samples/DebugLogViewer/icons/share-arrow.svg new file mode 100644 index 00000000..e0eb2462 --- /dev/null +++ b/Samples/DebugLogViewer/icons/share-arrow.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/sign-out.svg b/Samples/DebugLogViewer/icons/sign-out.svg new file mode 100644 index 00000000..c5951fc0 --- /dev/null +++ b/Samples/DebugLogViewer/icons/sign-out.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Samples/DebugLogViewer/icons/startup.svg b/Samples/DebugLogViewer/icons/startup.svg new file mode 100644 index 00000000..6605f3cb --- /dev/null +++ b/Samples/DebugLogViewer/icons/startup.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/stop.svg b/Samples/DebugLogViewer/icons/stop.svg new file mode 100644 index 00000000..27d810a0 --- /dev/null +++ b/Samples/DebugLogViewer/icons/stop.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/text-file.svg b/Samples/DebugLogViewer/icons/text-file.svg new file mode 100644 index 00000000..826bc326 --- /dev/null +++ b/Samples/DebugLogViewer/icons/text-file.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/Samples/DebugLogViewer/icons/text-label.svg b/Samples/DebugLogViewer/icons/text-label.svg new file mode 100644 index 00000000..8fa91967 --- /dev/null +++ b/Samples/DebugLogViewer/icons/text-label.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/Crow.Border.svg b/Samples/DebugLogViewer/icons/toolbox/Crow.Border.svg new file mode 100644 index 00000000..09eb7ac7 --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/Crow.Border.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/Crow.Button.svg b/Samples/DebugLogViewer/icons/toolbox/Crow.Button.svg new file mode 100644 index 00000000..01f5c6c3 --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/Crow.Button.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/Crow.CheckBox.svg b/Samples/DebugLogViewer/icons/toolbox/Crow.CheckBox.svg new file mode 100644 index 00000000..2f0b0834 --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/Crow.CheckBox.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/Crow.ColorPicker.svg b/Samples/DebugLogViewer/icons/toolbox/Crow.ColorPicker.svg new file mode 100644 index 00000000..517a26a9 --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/Crow.ColorPicker.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/Crow.ComboBox.svg b/Samples/DebugLogViewer/icons/toolbox/Crow.ComboBox.svg new file mode 100644 index 00000000..1cb88fa2 --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/Crow.ComboBox.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/Crow.Container.svg b/Samples/DebugLogViewer/icons/toolbox/Crow.Container.svg new file mode 100644 index 00000000..d7d1dc8a --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/Crow.Container.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/Crow.DirectoryView.svg b/Samples/DebugLogViewer/icons/toolbox/Crow.DirectoryView.svg new file mode 100644 index 00000000..90294692 --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/Crow.DirectoryView.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/Crow.Docker.svg b/Samples/DebugLogViewer/icons/toolbox/Crow.Docker.svg new file mode 100644 index 00000000..e38a283e --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/Crow.Docker.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/Crow.Expandable.svg b/Samples/DebugLogViewer/icons/toolbox/Crow.Expandable.svg new file mode 100644 index 00000000..1c56d56d --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/Crow.Expandable.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/Crow.FileDialog.svg b/Samples/DebugLogViewer/icons/toolbox/Crow.FileDialog.svg new file mode 100644 index 00000000..25142ea0 --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/Crow.FileDialog.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/Crow.Grid.svg b/Samples/DebugLogViewer/icons/toolbox/Crow.Grid.svg new file mode 100644 index 00000000..6151f971 --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/Crow.Grid.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/Crow.Group.svg b/Samples/DebugLogViewer/icons/toolbox/Crow.Group.svg new file mode 100644 index 00000000..eae67f63 --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/Crow.Group.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/Crow.GroupBox.svg b/Samples/DebugLogViewer/icons/toolbox/Crow.GroupBox.svg new file mode 100644 index 00000000..e4697799 --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/Crow.GroupBox.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/Crow.HorizontalStack.svg b/Samples/DebugLogViewer/icons/toolbox/Crow.HorizontalStack.svg new file mode 100644 index 00000000..f8e70257 --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/Crow.HorizontalStack.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/Crow.IMLContainer.svg b/Samples/DebugLogViewer/icons/toolbox/Crow.IMLContainer.svg new file mode 100644 index 00000000..b5687bac --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/Crow.IMLContainer.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/Crow.Image.svg b/Samples/DebugLogViewer/icons/toolbox/Crow.Image.svg new file mode 100644 index 00000000..11356c0e --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/Crow.Image.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/Crow.Label.svg b/Samples/DebugLogViewer/icons/toolbox/Crow.Label.svg new file mode 100644 index 00000000..65bb85b7 --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/Crow.Label.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/Crow.ListBox.svg b/Samples/DebugLogViewer/icons/toolbox/Crow.ListBox.svg new file mode 100644 index 00000000..40d16734 --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/Crow.ListBox.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/Crow.Menu.svg b/Samples/DebugLogViewer/icons/toolbox/Crow.Menu.svg new file mode 100644 index 00000000..b6b21119 --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/Crow.Menu.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/Crow.MenuItem.svg b/Samples/DebugLogViewer/icons/toolbox/Crow.MenuItem.svg new file mode 100644 index 00000000..c8bd8470 --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/Crow.MenuItem.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/Crow.MessageBox.svg b/Samples/DebugLogViewer/icons/toolbox/Crow.MessageBox.svg new file mode 100644 index 00000000..16ebd72c --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/Crow.MessageBox.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/Crow.ProgressBar.svg b/Samples/DebugLogViewer/icons/toolbox/Crow.ProgressBar.svg new file mode 100644 index 00000000..884f1854 --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/Crow.ProgressBar.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/Crow.RadioButton.svg b/Samples/DebugLogViewer/icons/toolbox/Crow.RadioButton.svg new file mode 100644 index 00000000..6c33e84b --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/Crow.RadioButton.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/Crow.ScrollBar.svg b/Samples/DebugLogViewer/icons/toolbox/Crow.ScrollBar.svg new file mode 100644 index 00000000..91a1f847 --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/Crow.ScrollBar.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/Crow.Scroller.svg b/Samples/DebugLogViewer/icons/toolbox/Crow.Scroller.svg new file mode 100644 index 00000000..bbc97197 --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/Crow.Scroller.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/Crow.Shape.svg b/Samples/DebugLogViewer/icons/toolbox/Crow.Shape.svg new file mode 100644 index 00000000..de5dd372 --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/Crow.Shape.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/Crow.Slider.svg b/Samples/DebugLogViewer/icons/toolbox/Crow.Slider.svg new file mode 100644 index 00000000..fe41c2ba --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/Crow.Slider.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/Crow.Spinner.svg b/Samples/DebugLogViewer/icons/toolbox/Crow.Spinner.svg new file mode 100644 index 00000000..5fa848ac --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/Crow.Spinner.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/Crow.Splitter.svg b/Samples/DebugLogViewer/icons/toolbox/Crow.Splitter.svg new file mode 100644 index 00000000..9fcd9dd7 --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/Crow.Splitter.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/Crow.TabItem.svg b/Samples/DebugLogViewer/icons/toolbox/Crow.TabItem.svg new file mode 100644 index 00000000..a9aaed33 --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/Crow.TabItem.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/Crow.TabView.svg b/Samples/DebugLogViewer/icons/toolbox/Crow.TabView.svg new file mode 100644 index 00000000..942358b4 --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/Crow.TabView.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/Crow.Table.svg b/Samples/DebugLogViewer/icons/toolbox/Crow.Table.svg new file mode 100644 index 00000000..0b421224 --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/Crow.Table.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/Crow.TemplatedContainer.svg b/Samples/DebugLogViewer/icons/toolbox/Crow.TemplatedContainer.svg new file mode 100644 index 00000000..34a0aa26 --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/Crow.TemplatedContainer.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/Crow.TemplatedGroup.svg b/Samples/DebugLogViewer/icons/toolbox/Crow.TemplatedGroup.svg new file mode 100644 index 00000000..14ea6f37 --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/Crow.TemplatedGroup.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/Crow.TextBox.svg b/Samples/DebugLogViewer/icons/toolbox/Crow.TextBox.svg new file mode 100644 index 00000000..c1fc2bb2 --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/Crow.TextBox.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/Crow.TreeView.svg b/Samples/DebugLogViewer/icons/toolbox/Crow.TreeView.svg new file mode 100644 index 00000000..b863291b --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/Crow.TreeView.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/Crow.VerticalStack.svg b/Samples/DebugLogViewer/icons/toolbox/Crow.VerticalStack.svg new file mode 100644 index 00000000..c3c3ec9c --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/Crow.VerticalStack.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/Crow.Window.svg b/Samples/DebugLogViewer/icons/toolbox/Crow.Window.svg new file mode 100644 index 00000000..74b0a24b --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/Crow.Window.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/Crow.Wrapper.svg b/Samples/DebugLogViewer/icons/toolbox/Crow.Wrapper.svg new file mode 100644 index 00000000..9e69e415 --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/Crow.Wrapper.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/bar-chart.svg b/Samples/DebugLogViewer/icons/toolbox/bar-chart.svg new file mode 100644 index 00000000..ff86c961 --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/bar-chart.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/bar-menu.svg b/Samples/DebugLogViewer/icons/toolbox/bar-menu.svg new file mode 100644 index 00000000..87ec0610 --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/bar-menu.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/bullets.svg b/Samples/DebugLogViewer/icons/toolbox/bullets.svg new file mode 100644 index 00000000..81fb1f06 --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/bullets.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/calendar.svg b/Samples/DebugLogViewer/icons/toolbox/calendar.svg new file mode 100644 index 00000000..9ceaa1ea --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/calendar.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/check-square-1.svg b/Samples/DebugLogViewer/icons/toolbox/check-square-1.svg new file mode 100644 index 00000000..e198007c --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/check-square-1.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/database.svg b/Samples/DebugLogViewer/icons/toolbox/database.svg new file mode 100644 index 00000000..65a8f065 --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/database.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/ellipsis.svg b/Samples/DebugLogViewer/icons/toolbox/ellipsis.svg new file mode 100644 index 00000000..cff94ccf --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/ellipsis.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/grab.svg b/Samples/DebugLogViewer/icons/toolbox/grab.svg new file mode 100644 index 00000000..25bc5719 --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/grab.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/hash.svg b/Samples/DebugLogViewer/icons/toolbox/hash.svg new file mode 100644 index 00000000..82196fbc --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/hash.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/line-list.svg b/Samples/DebugLogViewer/icons/toolbox/line-list.svg new file mode 100644 index 00000000..ec15f7b8 --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/line-list.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/list.svg b/Samples/DebugLogViewer/icons/toolbox/list.svg new file mode 100644 index 00000000..9aad88fa --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/list.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/modal-list.svg b/Samples/DebugLogViewer/icons/toolbox/modal-list.svg new file mode 100644 index 00000000..f1d8f70b --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/modal-list.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/options.svg b/Samples/DebugLogViewer/icons/toolbox/options.svg new file mode 100644 index 00000000..a56f6bed --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/options.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/package.svg b/Samples/DebugLogViewer/icons/toolbox/package.svg new file mode 100644 index 00000000..07f8b37e --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/package.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/padding.svg b/Samples/DebugLogViewer/icons/toolbox/padding.svg new file mode 100644 index 00000000..d93b2464 --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/padding.svg @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/picture-file.svg b/Samples/DebugLogViewer/icons/toolbox/picture-file.svg new file mode 100644 index 00000000..c45a6ad2 --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/picture-file.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/pointer.svg b/Samples/DebugLogViewer/icons/toolbox/pointer.svg new file mode 100644 index 00000000..605c0e28 --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/pointer.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/puzzle-piece.svg b/Samples/DebugLogViewer/icons/toolbox/puzzle-piece.svg new file mode 100644 index 00000000..b09c47e4 --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/puzzle-piece.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/refresh-file.svg b/Samples/DebugLogViewer/icons/toolbox/refresh-file.svg new file mode 100644 index 00000000..248e4203 --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/refresh-file.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/sliders.svg b/Samples/DebugLogViewer/icons/toolbox/sliders.svg new file mode 100644 index 00000000..81f72d18 --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/sliders.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/split-browser-1.svg b/Samples/DebugLogViewer/icons/toolbox/split-browser-1.svg new file mode 100644 index 00000000..4dfd93a3 --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/split-browser-1.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/table.svg b/Samples/DebugLogViewer/icons/toolbox/table.svg new file mode 100644 index 00000000..0b421224 --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/table.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/tasks.svg b/Samples/DebugLogViewer/icons/toolbox/tasks.svg new file mode 100644 index 00000000..8793c884 --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/tasks.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/Samples/DebugLogViewer/icons/toolbox/warning.svg b/Samples/DebugLogViewer/icons/toolbox/warning.svg new file mode 100644 index 00000000..f5a25735 --- /dev/null +++ b/Samples/DebugLogViewer/icons/toolbox/warning.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/tools.svg b/Samples/DebugLogViewer/icons/tools.svg new file mode 100644 index 00000000..5ad8a8d9 --- /dev/null +++ b/Samples/DebugLogViewer/icons/tools.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/Samples/DebugLogViewer/icons/trash.svg b/Samples/DebugLogViewer/icons/trash.svg new file mode 100644 index 00000000..e73a5e33 --- /dev/null +++ b/Samples/DebugLogViewer/icons/trash.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Samples/DebugLogViewer/icons/undo.svg b/Samples/DebugLogViewer/icons/undo.svg new file mode 100644 index 00000000..f78f1349 --- /dev/null +++ b/Samples/DebugLogViewer/icons/undo.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/DebugLogViewer/icons/zoom-in.svg b/Samples/DebugLogViewer/icons/zoom-in.svg new file mode 100644 index 00000000..540a93bb --- /dev/null +++ b/Samples/DebugLogViewer/icons/zoom-in.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Samples/DebugLogViewer/icons/zoom-out.svg b/Samples/DebugLogViewer/icons/zoom-out.svg new file mode 100644 index 00000000..6bd256f9 --- /dev/null +++ b/Samples/DebugLogViewer/icons/zoom-out.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Samples/DebugLogViewer/src/DbgEventWidget.cs b/Samples/DebugLogViewer/src/DbgEventWidget.cs new file mode 100644 index 00000000..570cc2f9 --- /dev/null +++ b/Samples/DebugLogViewer/src/DbgEventWidget.cs @@ -0,0 +1,161 @@ +// Copyright (c) 2025 Jean-Philippe Bruyère +// +// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) +using System; +using System.Collections.Generic; +using System.ComponentModel; +using Drawing2D; +using Crow.DebugLogger; + +namespace Crow +{ + public class DbgEventView : TemplatedContainer { + DbgEvent evt; + public DbgEvent Event { + get => evt; + set { + if (evt == value) + return; + evt = value; + NotifyValueChangedAuto (evt); + } + } + } + public class DbgEventWidget : Widget + { + public DbgEventWidget (){} + + DbgEvent evt, hoverEvt; + long ticksPerPixel; + double pixelPerTick; + + object dataMutex = new object(); + + public DbgEvent Event { + get => evt; + set { + if (evt == value) + return; + lock (dataMutex) + evt = value; + updatePixelPerTicks (); + NotifyValueChangedAuto (evt); + RegisterForRedraw (); + } + } + public DbgEvent HoverEvent { + get => hoverEvt; + private set { + if (hoverEvt == value) + return; + lock (dataMutex) + evt = value; + hoverEvt = value; + NotifyValueChangedAuto (hoverEvt); + } + } + + [DefaultValue ("1000")] + public long TicksPerPixel { + get => ticksPerPixel; + set { + if (ticksPerPixel == value) + return; + ticksPerPixel = value; + NotifyValueChangedAuto (ticksPerPixel); + if (Width == Measure.Fit) + RegisterForLayouting (LayoutingType.Width); + } + } + + public override int measureRawSize (LayoutingType lt) + { + updatePixelPerTicks (); + if (lt == LayoutingType.Width) + contentSize.Width = Event == null ? 0 : (int)Math.Max(pixelPerTick * Event.Duration, 2); + + return base.measureRawSize (lt); + } + + public override void OnLayoutChanges (LayoutingType layoutType) + { + if (layoutType == LayoutingType.Width) + updatePixelPerTicks (); + + base.OnLayoutChanges (layoutType); + } + + protected override void onDraw (IContext gr) + { + lock (dataMutex) { + + if (Event == null) { + base.onDraw (gr); + return; + } + + gr.LineWidth = 1; + gr.SetDash (new double [] { 1.0, 3.0 }, 0); + + Rectangle cb = ClientRectangle; + + if (Event.Duration == 0) { + gr.SetSource (Event.Color); + gr.Rectangle (cb); + gr.Fill (); + return; + } + + drawEvent (gr, cb.Height, Event); + } + } + void drawEvent (IContext ctx, int h, DbgEvent dbge) + { + double w = Math.Max(dbge.Duration * pixelPerTick, 2.0); + double x = (dbge.begin - Event.begin) * pixelPerTick; + + ctx.Rectangle (x, 0, w, h); + ctx.SetSource (dbge.Color); + /*if (dbge.IsSelected) { + ctx.FillPreserve (); + ctx.SetSource (1, 1, 1); + ctx.Stroke (); + }else*/ + ctx.Fill (); + + if (dbge.Events == null) + return; + foreach (DbgEvent e in dbge.Events) + drawEvent (ctx, h, e); + } + + public override void onMouseMove (object sender, MouseMoveEventArgs e) + { + if (Event != null) { + Point m = ScreenPointToLocal (e.Position); + long curTick = (long)(m.X / pixelPerTick) + Event.begin; + HoverEvent = hoverEvent (Event, curTick); + + e.Handled = true; + } + base.onMouseMove (sender, e); + } + + DbgEvent hoverEvent (DbgEvent hevt, long curTick){ + if (hevt.Events != null) { + foreach (DbgEvent e in hevt.Events) { + if (curTick >= e.begin && curTick <= e.end) + return hoverEvent (e, curTick); + } + } + return hevt; + } + void updatePixelPerTicks () + { + if (Width == Measure.Fit) + pixelPerTick = 1.0 / ticksPerPixel; + else + pixelPerTick = Event == null ? 0 : (double)ClientRectangle.Width / Event.Duration; + } + } +} \ No newline at end of file diff --git a/Samples/DebugLogViewer/src/DbgLogViewer.cs b/Samples/DebugLogViewer/src/DbgLogViewer.cs new file mode 100644 index 00000000..265f031c --- /dev/null +++ b/Samples/DebugLogViewer/src/DbgLogViewer.cs @@ -0,0 +1,800 @@ +// Copyright (c) 2013-2025 Jean-Philippe Bruyère +// +// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using Drawing2D; +using Crow.DebugLogger; +using System.Diagnostics; + +namespace Crow +{ + public class DbgLogViewer : Widget + { + public static Dictionary colors; + + #region CTOR + protected DbgLogViewer () : base(){} + public DbgLogViewer (Interface iface, string style = null) : base(iface, style){} + #endregion + + FontExtents fe; + + + double xScale = 1.0/1024.0, yScale = 1.0, leftMargin, topMargin = 0.0; + DbgWidgetRecord curWidget, hoverWidget; + DbgEvent curEvent, hoverEvent; + + IList events = new List (); + IList widgets = new List (); + + + public DbgEvtType Filter { + get => Configuration.Global.Get ("DbgLogViewFilter"); + set { + if (Filter == value) + return; + Configuration.Global.Set ("DbgLogViewFilter", value); + NotifyValueChangedAuto(Filter); + RegisterForGraphicUpdate(); + } + } + public IList Events { + get => events; + set { + if (events == value) + return; + events = value; + NotifyValueChanged (nameof (Events), events); + + maxTicks = minTicks = 0; + if (events != null && events.Count > 0) { + minTicks = long.MaxValue; + foreach (DbgEvent e in events) { + if (e.begin < minTicks) + minTicks = e.begin; + if (e.end > maxTicks) + maxTicks = e.end; + } + visibleTicks = maxTicks - minTicks; + XScale = (ClientRectangle.Width - leftMargin)/visibleTicks; + ScrollX = 0; + ScrollY = 0; + } else { + maxTicks = 1; + XScale = 1.0/1024.0; + } + + + RegisterForGraphicUpdate (); + } + } + public IList Widgets { + get => widgets; + set { + if (widgets == value) + return; + widgets = value; + NotifyValueChanged (nameof (Widgets), widgets); + updateMargins (); + updateMaxScrollX (); + updateMaxScrollY (); + } + } + public DbgWidgetRecord CurrentWidget { + get => curWidget; + set { + if (curWidget == value) + return; + curWidget = value; + NotifyValueChanged (nameof (CurrentWidget), curWidget); + if (CurrentWidget == null) + return; + if (CurrentWidget.listIndex < scrollY || CurrentWidget.listIndex > scrollY + visibleLines) + ScrollY = CurrentWidget.listIndex - (visibleLines / 2); + + currentLine = CurrentWidget.listIndex; + RegisterForRedraw(); + } + } + public DbgEvent CurrentEvent { + get => curEvent; + set { + if (curEvent == value) + return; + /*if (curEvent != null) + curEvent.IsSelected = false;*/ + curEvent = value; + if (curEvent != null) { + //curEvent.IsSelected = true; + if (curEvent is DbgWidgetEvent we) { + //CurrentWidget = Widgets [we.InstanceIndex]; + hoverLine = we.InstanceIndex; + } + currentTick = curEvent.begin; + if (curEvent.begin > minTicks + ScrollX + visibleTicks || + curEvent.end < minTicks + ScrollX) + ScrollX = curEvent.begin - minTicks - visibleTicks / 2; + } + NotifyValueChanged (nameof (CurrentEvent), curEvent); + RegisterForRedraw (); + } + } + public DbgWidgetRecord HoverWidget { + get => hoverWidget; + internal set { + if (hoverWidget == value) + return; + hoverWidget = value; + NotifyValueChanged (nameof (HoverWidget), hoverWidget); + } + } + + public DbgEvent HoverEvent { + get => hoverEvent; + set { + if (hoverEvent == value) + return; + hoverEvent = value; + NotifyValueChanged (nameof (HoverEvent), hoverEvent); + RegisterForRepaint (); + } + } + + long hoverTick = 0, currentTick, selStart = -1, selEnd = -1, minTicks = 0, maxTicks = 0, visibleTicks = 0; + int hoverLine = -1, currentLine = -1; + int visibleLines = 1; + Point mousePos; + + public double XScale { + get => xScale; + set { + if (xScale == value) + return; + xScale = value; + NotifyValueChanged ("XScale", xScale); + updateVisibleTicks (); + RegisterForGraphicUpdate (); + } + } + public double YScale { + get => yScale; + set { + if (yScale == value) + return; + yScale = value; + NotifyValueChanged ("YScale", yScale); + RegisterForGraphicUpdate (); + } + } + public override Font Font { + get { return base.Font; } + set { + base.Font = value; + using (IContext gr = IFace.Backend.CreateContext (IFace.MainSurface)) { + gr.SelectFontFace (Font.Name, Font.Slant, Font.Wheight); + gr.SetFontSize (Font.Size); + + fe = gr.FontExtents; + } + updateMargins (); + } + } + RectangleD getWidgetEvtBounds (DbgEvent evt, ref Rectangle cb, double penY) { + double x = xScale * (evt.begin - minTicks - ScrollX); + double w = Math.Max (Math.Max (2.0, 2.0 * xScale), (double)(evt.end - evt.begin) * xScale); + if (x < 0.0) { + w += x; + x = 0.0; + } + x += leftMargin + cb.Left; + double rightDiff = x + w - cb.Right; + if (rightDiff > 0) + w -= rightDiff; + return new RectangleD(x, penY, w, fe.Height); + } + void drawEvents (IContext ctx, IList evts) + { + if (evts == null || evts.Count == 0) + return; + Rectangle cb = ClientRectangle; + + foreach (DbgEvent evt in evts) { + if ((evt.Category & currentFilter) == currentFilter) { + if (evt.end - minTicks <= ScrollX) + continue; + if (evt.begin - minTicks > ScrollX + visibleTicks) + break; + double penY = topMargin + ClientRectangle.Top; + + if (evt.type.HasFlag (DbgEvtType.Widget)) { + DbgWidgetEvent eW = evt as DbgWidgetEvent; + int lIdx = eW.InstanceIndex - ScrollY; + if (lIdx >= 0 && lIdx <= visibleLines) { + + penY += (lIdx) * fe.Height; + + ctx.SetSource (evt.Color); + RectangleD r = getWidgetEvtBounds (evt, ref cb, penY); + if (r.Width > 0){ + ctx.Rectangle (r.X,r.Y,r.Width,r.Height); + ctx.Fill (); + } + } + } else if (evt.type.HasFlag (DbgEvtType.IFace)) { + double x = xScale * (evt.begin - minTicks - ScrollX); + double w = Math.Max (Math.Max (2.0, 2.0 * xScale), (double)(evt.end - evt.begin) * xScale); + if (x < 0.0) { + w += x; + x = 0.0; + } + x += leftMargin + cb.Left; + double rightDiff = x + w - cb.Right; + if (rightDiff > 0) + w -= rightDiff; + //ctx.SetSource (0.9,0.9,0.0,0.1); + ctx.SetSource (evt.Color.AdjustAlpha(0.13)); + ctx.Rectangle (x, cb.Top + topMargin, w, cb.Height); + ctx.Fill (); + } + } + drawEvents (ctx, evt.Events); + } + } + + DbgEvtType currentFilter; + protected override void onDraw (IContext gr) + { + base.onDraw (gr); + + gr.SelectFontFace (Font.Name, Font.Slant, Font.Wheight); + gr.SetFontSize (Font.Size); + + if (widgets == null) + return; + + gr.LineWidth = 1.0; + + Rectangle cb = ClientRectangle; + + double penY = topMargin + ClientRectangle.Top; + + for (int i = 0; i < visibleLines; i++) { + if (i + ScrollY >= widgets.Count) + break; + int gIdx = i + ScrollY; + DbgWidgetRecord g = widgets [gIdx]; + + penY += fe.Height; + + gr.SetSource (Colors.Jet); + gr.MoveTo (cb.X, penY - 0.5); + gr.LineTo (cb.Right, penY - 0.5); + gr.Stroke (); + + double penX = 5.0 * g.xLevel + cb.Left; + + if (g.xLevel == 0) + gr.SetSource (Colors.LightSalmon); + else if (currentLine == g.listIndex) + gr.SetSource(Colors.RoyalBlue); + else + Foreground.SetAsSource (IFace, gr); + + gr.MoveTo (penX, penY - gr.FontExtents.Descent); + gr.ShowText (g.name + gIdx); + } + + currentFilter = Filter; + drawEvents (gr, events); + + gr.MoveTo (cb.Left, topMargin - 0.5 + cb.Top); + gr.LineTo (cb.Right, topMargin - 0.5 + cb.Top); + + gr.MoveTo (leftMargin + cb.Left, cb.Top); + gr.LineTo (leftMargin + cb.Left, cb.Bottom); + gr.SetSource (Colors.Grey); + + penY = topMargin + ClientRectangle.Top; + + //graduation + long largeGrad = long.Parse ("1" + new string ('0', visibleTicks.ToString ().Length - 1)); + long smallGrad = Math.Max (1, largeGrad / 10); + + long firstVisibleTicks = minTicks + ScrollX; + long curGrad = firstVisibleTicks - firstVisibleTicks % smallGrad + smallGrad; + + long gg = curGrad - ScrollX - minTicks; + while (gg < visibleTicks ) { + double x = (double)gg * xScale + leftMargin + cb.Left; + + gr.MoveTo (x, penY - 0.5); + if (curGrad % largeGrad == 0) { + gr.LineTo (x, penY - 8.5); + string str = ticksToMS(curGrad); + TextExtents te = gr.TextExtents (str); + gr.RelMoveTo (-0.5 * te.Width, -2.0); + gr.ShowText (str); + }else + gr.LineTo (x, penY - 2.5); + + curGrad += smallGrad; + gg = curGrad - ScrollX - minTicks; + } + + gr.Stroke (); + + + + } + string ticksToMS(long ticks) => Math.Round ((double)ticks / Stopwatch.Frequency * 1000.0, 2).ToString(); + public override bool Paint (IContext ctx) + { + base.Paint (ctx); + + Rectangle r = new Rectangle(mousePos.X, 0, 1, Slot.Height); + Rectangle ctxR = ContextCoordinates (r); + Rectangle cb = ClientRectangle; + ctx.LineWidth = 1.0; + if (hoverTick >= 0) { + double x = xScale * (hoverTick - minTicks - ScrollX) + leftMargin; + if (x - Math.Truncate (x) > 0.5) + x = Math.Truncate (x) + 0.5; + else + x = Math.Truncate (x) - 0.5; + ctx.MoveTo (x, cb.Top + topMargin - 4.0); + ctx.LineTo (x, cb.Bottom); + ctx.SetSource (0.7,0.7,0.7,0.5); + ctx.Stroke(); + } + if (currentTick >= 0) { + double x = xScale * (currentTick - minTicks - ScrollX) + leftMargin; + if (x > leftMargin && x < cb.Right) { + if (x - Math.Truncate (x) > 0.5) + x = Math.Truncate (x) + 0.5; + else + x = Math.Truncate (x) - 0.5; + ctx.MoveTo (x, cb.Top); + ctx.LineTo (x, cb.Bottom); + ctx.SetSource (0.2,0.7,1.0,0.6); + ctx.Stroke(); + } + } + + ctx.SelectFontFace (Font.Name, Font.Slant, Font.Wheight); + ctx.SetFontSize (Font.Size); + + string str = ticksToMS(hoverTick); + + ctx.MoveTo (ctxR.X - ctx.TextExtents (str).Width / 2, ctxR.Y + fe.Height); + ctx.ShowText (str); + + ctx.Operator = Operator.Add; + + if (hoverLine >= 0) { + double y = fe.Height * (hoverLine - ScrollY) + topMargin + cb.Top; + r = new Rectangle (cb.Left, (int)y, cb.Width, (int)fe.Height); + + ctx.SetSource (0.1, 0.1, 0.1, 0.4); + ctx.Rectangle (ContextCoordinates (r)); + ctx.Fill (); + + if (hoverEvent is DbgWidgetEvent wevt) { + ctx.SetSource (1.0,1.0,1.0,0.7); + ctx.SetDash (new double[] {1, 2}); + ctx.Rectangle ((Rectangle)getWidgetEvtBounds (wevt, ref cb, y).Inflated (1), 1); + } + } + + if (currentLine >= ScrollY && currentLine < scrollY + visibleLines) { + double y = fe.Height * (currentLine - ScrollY) + topMargin + cb.Top; + r = new Rectangle (cb.Left, (int)y, cb.Width, (int)fe.Height); + + ctx.SetSource (0.1, 0.1, 0.7, 0.2); + ctx.Rectangle (ContextCoordinates (r)); + ctx.Fill (); + } + + if (selStart < 0 || selEnd < 0) { + ctx.Operator = Operator.Over; + return true; + } + double selStartX = (double)(selStart - ScrollX - minTicks) * xScale + leftMargin + cb.Left; + double selEndX = (double)(selEnd - ScrollX - minTicks) * xScale + leftMargin + cb.Left; + + if (selStartX < selEndX) { + ctxR.X = (int)selStartX; + ctxR.Width = (int)(selEndX - selStartX); + } else { + ctxR.X = (int)selEndX; + ctxR.Width = (int)(selStartX - selEndX); + } + + ctxR.Width = Math.Max (1, ctxR.Width); + ctx.Rectangle (ctxR); + ctx.SetSource (0.0,0.2,0.8,0.15); + //ctx.SetSource (Colors.Jet); + ctx.Fill(); + ctx.Operator = Operator.Over; + + str = $"{ticksToMS(Math.Abs (selEnd - selStart))} (ms)"; + + ctx.MoveTo (ctxR.Center.X - ctx.TextExtents (str).Width / 2, ctxR.Y + fe.Height); + ctx.SetSource (Colors.Black); + ctx.ShowText (str); + + return true; + } + public override void OnLayoutChanges (LayoutingType layoutType) + { + base.OnLayoutChanges (layoutType); + switch (layoutType) { + case LayoutingType.Width: + if (xScale < 0) { + visibleTicks = maxTicks - minTicks; + XScale = (ClientRectangle.Width - leftMargin) / visibleTicks; + } + updateVisibleTicks (); + break; + case LayoutingType.Height: + updateVisibleLines (); + break; + } + } + + public override void onMouseLeave (object sender, MouseMoveEventArgs e) + { + base.onMouseLeave (sender, e); + hoverLine = -1; + hoverTick = 0; + } + public override void onMouseMove (object sender, MouseMoveEventArgs e) + { + long lastTick = hoverTick; + int lastLine = hoverLine; + updateMouseLocalPos (e.Position); + + if ((IFace.IsDown (Glfw.MouseButton.Left) || IFace.IsDown (Glfw.MouseButton.Middle)) && selStart >= 0) + selEnd = hoverTick; + else if (IFace.IsDown(Glfw.MouseButton.Right)) { + if (lastTick >= 0 && hoverTick >= 0) + ScrollX += lastTick - hoverTick; + if (lastLine >= 0 && hoverLine >= 0) + ScrollY += lastLine - hoverLine; + updateMouseLocalPos (e.Position); + } else if (widgets != null) { + HoverWidget = (hoverLine < 0 || hoverLine >= widgets.Count) ? null : widgets [hoverLine]; + //HoverEvent = hoverWidget?.Events.FirstOrDefault (ev => ev.begin <= hoverTick && ev.end >= hoverTick); + double tickPerPixel = (double)visibleTicks / ClientRectangle.Width; + //Console.WriteLine ($"ticks per pixel: {tickPerPixel}"); + Task.Run (() => findHoverEvent (hoverWidget, hoverTick, (int)tickPerPixel)); + } + + RegisterForRepaint(); + + e.Handled = true; + base.onMouseMove (sender, e); + } + void findHoverEvent (DbgWidgetRecord widget, long tick, long precision = 0) { + DbgEvent tmp = widget?.Events.FirstOrDefault (ev => ev.begin - precision <= tick && ev.end + precision >= tick); + if (tmp == null) { + tmp = Events.Where(e=>e.type.HasFlag(DbgEvtType.IFace)).Where (ev => ev.begin - precision <= tick && ev.end + precision >= tick).FirstOrDefault(); + while(tmp != null) { + DbgEvent che = tmp.Events?.Where(e=>e.type.HasFlag(DbgEvtType.IFace)).Where (ev => ev.begin - precision <= tick && ev.end + precision >= tick).FirstOrDefault(); + if (che == null) + break; + tmp = che; + } + } else { + while(tmp != null) { + DbgEvent che = tmp.Events?.OfType()?.Where(ev=>ev.InstanceIndex == widget.listIndex && ev.begin - precision <= tick && ev.end + precision >= tick).FirstOrDefault(); + if (che == null) + break; + tmp = che; + } + } + HoverEvent = tmp; + } + public override void onMouseClick(object sender, MouseButtonEventArgs e) + { + if (e.Button == Glfw.MouseButton.Left) { + if (selEnd < 0) { + currentTick = hoverTick; + currentLine = hoverLine; + CurrentWidget = hoverWidget; + CurrentEvent = hoverEvent; + } + selStart = -1; + selEnd = -1; + } + + e.Handled = true; + base.onMouseClick(sender, e); + } + public override void onMouseDown (object sender, MouseButtonEventArgs e) + { + if (e.Button == Glfw.MouseButton.Left || e.Button == Glfw.MouseButton.Middle) { + selStart = hoverTick; + selEnd = -1; + } + + RegisterForRedraw (); + e.Handled = true; + base.onMouseDown (sender, e); + } + public override void onMouseUp (object sender, MouseButtonEventArgs e) + { + + if (e.Button == Glfw.MouseButton.Left && selEnd > 0 && selEnd != selStart) { + long scrX = 0; + if (selStart < selEnd) { + visibleTicks = selEnd - selStart; + scrX = selStart - minTicks; + } else { + visibleTicks = selStart - selEnd; + scrX = selEnd - minTicks; + } + XScale = (ClientRectangle.Width - leftMargin) / visibleTicks; + ScrollX = scrX; + } + + RegisterForRedraw (); + e.Handled = true; + base.onMouseUp (sender, e); + } + + /// Process scrolling vertically, or if shift is down, vertically + public override void onMouseWheel (object sender, MouseWheelEventArgs e) + { + //base.onMouseWheel (sender, e); + + if (IFace.Shift) + ScrollX -= (int)((double)(e.Delta * MouseWheelSpeed) / xScale); + else if (IFace.Ctrl) + ScrollY -= e.Delta * MouseWheelSpeed; + else { + if (e.Delta > 0) { + XScale *= 2.0; + } else { + if (MaxScrollX > 0) + XScale *= 0.5; + } + ScrollX = (long)(hoverTick - (long)((double)Math.Max(0, mousePos.X - (long)leftMargin) / xScale) - minTicks); + } + } + + public override void onKeyDown (object sender, KeyEventArgs e) + { + base.onKeyDown (sender, e); + + if (e.Key == Glfw.Key.F3) { + if (selEnd < 0) + return; + if (selEnd < selStart) + zoom (selEnd, selStart); + else + zoom (selStart, selEnd); + selEnd = selStart = -1; + } + } + + void updateMargins () + { + leftMargin = topMargin = 0.0; + + if (widgets == null) + return; + + using (IContext gr = IFace.Backend.CreateContext (IFace.MainSurface)) { + gr.SelectFontFace (Font.Name, Font.Slant, Font.Wheight); + gr.SetFontSize (Font.Size); + + double maxNameWidth = 0.0; + + foreach (DbgWidgetRecord o in widgets) { + double nameWidth = gr.TextExtents (o.name).Width + 5.0 * o.xLevel; + if (nameWidth > maxNameWidth) + maxNameWidth = nameWidth; + } + + leftMargin = 10.5 + maxNameWidth; + topMargin = 2.0 * fe.Height; + + RegisterForGraphicUpdate (); + } + } + + void updateVisibleLines () + { + visibleLines = fe.Height < 1 ? 1 : (int)Math.Ceiling (((double)ClientRectangle.Height - topMargin) / fe.Height); + NotifyValueChanged ("VisibleLines", visibleLines); + updateMaxScrollY (); + } + void updateVisibleTicks () + { + visibleTicks = Math.Max (0, (long)((double)(ClientRectangle.Width - leftMargin) / XScale)); + NotifyValueChanged ("VisibleTicks", visibleTicks); + updateMaxScrollX (); + } + + void updateMaxScrollX () + { + if (widgets == null) { + MaxScrollX = 0; + } else { + long tot = maxTicks - minTicks; + MaxScrollX = Math.Max (0L, tot - visibleTicks); + NotifyValueChanged ("ChildWidthRatio", (double)visibleTicks / tot); + } + } + void updateMaxScrollY () + { + if (widgets == null) + MaxScrollY = 0; + else { + MaxScrollY = Math.Max (0, widgets.Count + 1 - visibleLines); + NotifyValueChanged ("ChildHeightRatio", (double)visibleLines / (widgets.Count + 1)); + } + } + + void updateMouseLocalPos (Point mPos) + { + Rectangle r = ScreenCoordinates (Slot); + Rectangle cb = ClientRectangle; + cb.Left += (int)leftMargin; + cb.Width -= (int)leftMargin; + cb.Y += (int)topMargin; + cb.Height -= (int)topMargin; + + mousePos = mPos - r.Position; + + mousePos.X = Math.Max (cb.X, mousePos.X); + mousePos.X = Math.Min (cb.Right, mousePos.X); + + if (mousePos.Y < cb.Top || mousePos.Y > cb.Bottom) + hoverLine = -1; + else + hoverLine = (int)((double)(mousePos.Y - cb.Top) / fe.Height) + ScrollY; + + NotifyValueChanged ("CurrentLine", hoverLine); + + mousePos.Y = Math.Max (cb.Y, mousePos.Y); + mousePos.Y = Math.Min (cb.Bottom, mousePos.Y); + + hoverTick = (long)((double)(mousePos.X - cb.X) / xScale) + minTicks + ScrollX; + RegisterForRedraw (); + } + void zoom (long start, long end) { + //Rectangle cb = ClientRectangle; + //cb.X += (int)leftMargin; + XScale = ((double)ClientRectangle.Width - leftMargin)/(end - start); + ScrollX = (int)(start - minTicks); + } + + + long scrollX, maxScrollX; + int scrollY, maxScrollY, mouseWheelSpeed; + + /// + /// if true, key stroke are handled in derrived class + /// + protected bool KeyEventsOverrides = false; + + /// Horizontal Scrolling Position + [DefaultValue(0)] + public virtual long ScrollX { + get => scrollX; + set { + if (scrollX == value) + return; + + long newS = value; + if (newS < 0) + newS = 0; + else if (newS > maxScrollX) + newS = maxScrollX; + + if (newS == scrollX) + return; + + scrollX = newS; + + NotifyValueChangedAuto (scrollX); + RegisterForGraphicUpdate (); + } + } + /// Vertical Scrolling Position + [DefaultValue(0)] + public virtual int ScrollY { + get => scrollY; + set { + if (scrollY == value) + return; + + int newS = value; + if (newS < 0) + newS = 0; + else if (newS > maxScrollY) + newS = maxScrollY; + + if (newS == scrollY) + return; + + scrollY = newS; + + NotifyValueChangedAuto (scrollY); + RegisterForGraphicUpdate (); + + if (widgets == null) + return; + + Rectangle cb = ClientRectangle; + cb.Left += (int)leftMargin; + cb.Width -= (int)leftMargin; + cb.Y += (int)topMargin; + cb.Height -= (int)topMargin; + + if (mousePos.Y < cb.Top || mousePos.Y > cb.Bottom) + hoverLine = -1; + else + hoverLine = (int)((double)(mousePos.Y - cb.Top) / fe.Height) + ScrollY; + + NotifyValueChanged ("CurrentLine", hoverLine); + } + } + /// Horizontal Scrolling maximum value + [DefaultValue(0)] + public virtual long MaxScrollX { + get => maxScrollX; + set { + if (maxScrollX == value) + return; + + maxScrollX = Math.Max(0, value); + + if (scrollX > maxScrollX) + ScrollX = maxScrollX; + + NotifyValueChangedAuto (maxScrollX); + RegisterForGraphicUpdate (); + } + } + /// Vertical Scrolling maximum value + [DefaultValue(0)] + public virtual int MaxScrollY { + get => maxScrollY; + set { + if (maxScrollY == value) + return; + + maxScrollY = Math.Max (0, value); + + if (scrollY > maxScrollY) + ScrollY = maxScrollY; + + NotifyValueChangedAuto (maxScrollY); + RegisterForGraphicUpdate (); + } + } + /// Mouse Wheel Scrolling multiplier + [DefaultValue(1)] + public virtual int MouseWheelSpeed { + get => mouseWheelSpeed; + set { + if (mouseWheelSpeed == value) + return; + + mouseWheelSpeed = value; + + NotifyValueChangedAuto (mouseWheelSpeed); + } + } + } +} + + diff --git a/Samples/DebugLogViewer/src/main.cs b/Samples/DebugLogViewer/src/main.cs new file mode 100644 index 00000000..ac1c9d37 --- /dev/null +++ b/Samples/DebugLogViewer/src/main.cs @@ -0,0 +1,281 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using Crow; +using Crow.DebugLogger; +using Drawing2D; +using Glfw; +using Samples; + +namespace DebugLogViewer +{ + class DebugLogViewer : Interface { + static void Main (string[] args) { + using (DebugLogViewer app = new DebugLogViewer ()) + app.Run (); + } + + public DebugLogViewer () : base (Configuration.Global.Get("MainWinWidth", 800), Configuration.Global.Get("MainWinHeight", 600), true) { } + public override void ProcessResize(Rectangle bounds) + { + base.ProcessResize(bounds); + Configuration.Global.Set ("MainWinWidth", clientRectangle.Width); + Configuration.Global.Set ("MainWinHeight", clientRectangle.Height); + //Console.WriteLine($"{clientRectangle.Width}x{clientRectangle.Height}"); + } + protected override void OnInitialized () { + base.OnInitialized (); + + initCommands (); + + SetWindowIcon ("#Crow.Icons.crow.png"); + + if (ReopenLastLog) + loadLog(CurrentLogFilePath); + + Load ("#ui.main.crow").DataSource = this; + } + + #region Commands + public Command CMDQuit, CMDHelp, CMDAbout, CMDOptions; + public Command CMDStartRecording, CMDStopRecording, CMDRefresh, CMDAddEventToRecord, CMDRemoveEventToRecord; + public Command CMDGotoParentEvent, CMDEventHistoryForward, CMDEventHistoryBackward; + public CommandGroup LoggerCommands => new CommandGroup (CMDRefresh, CMDStartRecording, CMDStopRecording); + public CommandGroup EventCommands => new CommandGroup( + CMDGotoParentEvent, CMDEventHistoryBackward, CMDEventHistoryForward); + public CommandGroup CommandsRoot, FileCommands; + + void initCommands () + { + FileCommands = new CommandGroup ("File", + new ActionCommand("Open Log...", openFileDialog, "#icons.outbox.svg"), + new ActionCommand("Options", openOptionsDialog, "#icons.tools.svg"), + new ActionCommand("Quit", base.Quit, "#icons.sign-out.svg") + ); + + + CMDGotoParentEvent = new ActionCommand("parent", ()=> { CurrentEvent = CurrentEvent?.parentEvent; }, "#icons.level-up.svg", false); + CMDEventHistoryBackward = new ActionCommand("back.", currentEventHistoryGoBack, "#icons.previous.svg", false); + CMDEventHistoryForward = new ActionCommand("forw.", currentEventHistoryGoForward, "#icons.forward-arrow.svg", false); + + CMDHelp = new ActionCommand("Help", () => System.Diagnostics.Debug.WriteLine("help"), "#icons.question.svg"); + + CommandsRoot = new CommandGroup ( + FileCommands, + new CommandGroup ("Help", CMDHelp) + ); + } + void openOptionsDialog() => Load ("#ui.Options.crow").DataSource = this; + void openFileDialog() => + LoadIMLFragment ( + @"").DataSource = this; + + void openFileDialog_OkClicked (object sender, EventArgs e) + { + loadLog (CurrentLogFilePath); + } + + #endregion + + + IList events; + IList widgets; + + public string CurrentDir { + get => Configuration.Global.Get("CurrentDir", Environment.GetFolderPath (Environment.SpecialFolder.MyDocuments)); + set { + if (CurrentDir == value) + return; + Configuration.Global.Set ("CurrentDir", value); + NotifyValueChanged (CurrentDir); + } + } + public string CurrentLogFileName { + get => Configuration.Global.Get ("CurrentLogFileName"); + set { + if (CurrentLogFileName == value) + return; + Configuration.Global.Set ("CurrentLogFileName", value); + NotifyValueChanged (value); + } + } + public string CurrentLogFilePath => Path.Combine(CurrentDir,CurrentLogFileName); + public bool ReopenLastLog + { + get => Configuration.Global.Get ("ReopenLastLog", true); + set { + if (ReopenLastLog == value) + return; + Configuration.Global.Set ("ReopenLastLog", value); + NotifyValueChanged (value); + } + } + + public IList Events { + get => events; + set { + if (events == value) + return; + events = value; + NotifyValueChanged (nameof (Events), events); + } + } + public IList Widgets { + get => widgets; + set { + if (widgets == value) + return; + widgets = value; + NotifyValueChanged (nameof (Widgets), widgets); + } + } + + void loadLog (string logFile) { + if (!File.Exists(logFile)) + return; + //lock(UpdateMutex) { + using (Stream stream = new FileStream (logFile, FileMode.Open, FileAccess.Read)) { + List widgets = new List(); + List events = new List(); + DbgLogger.Load (stream, events, widgets); + + for (int i = 0; i < widgets.Count; i++) { + widgets[i].listIndex = i; + //Widgets.Add (widgets[i]); + } + for (int i = 0; i < events.Count; i++) { + //Events.Add (events[i]); + updateWidgetEvents (widgets, events[i]); + } + + Events = events; + Widgets = widgets; + } + //} + } + void updateWidgetEvents (IList widgets, DbgEvent evt) { + if (evt is DbgWidgetEvent we) + widgets.FirstOrDefault (w => w.InstanceIndex == we.InstanceIndex)?.Events.Add (we); + if (evt.Events == null) + return; + foreach (DbgEvent e in evt.Events) + updateWidgetEvents (widgets, e); + } + void saveLogToDebugLogFilePath () { + + } + void loadLogFromDebugLogFilePath () { + + } + + DbgEvent curEvent; + bool disableCurrentEventHistory; + Stack CurrentEventHistoryForward = new Stack(); + Stack CurrentEventHistoryBackward = new Stack(); + DbgWidgetRecord curWidgetRecord = new DbgWidgetRecord(); + public string[] AllEventTypes => Enum.GetNames (typeof(DbgEvtType)); + string searchEventType; + DbgWidgetRecord searchWidget; + public string SearchEventType { + get => searchEventType; + set { + if (searchEventType == value) + return; + searchEventType = value; + NotifyValueChanged (searchEventType); + } + } + public DbgWidgetRecord SearchWidget { + get => searchWidget; + set { + if (searchWidget == value) + return; + searchWidget = value; + NotifyValueChanged (searchWidget); + } + } + + public DbgEvent CurrentEvent { + get => curEvent; + set { + if (curEvent == value) + return; + + if (!disableCurrentEventHistory) { + CurrentEventHistoryForward.Clear (); + CMDEventHistoryForward.CanExecute = false; + if (!(value == null || curEvent == null)) { + CurrentEventHistoryBackward.Push (curEvent); + CMDEventHistoryBackward.CanExecute = true; + } + } + + curEvent = value; + + NotifyValueChanged (nameof (CurrentEvent), curEvent); + NotifyValueChanged ("CurEventChildEvents", curEvent?.Events); + NotifyValueChanged ("CurWidgetProperties", CurWidgetProperties); + + if (CurrentEvent != null && CurrentEvent.parentEvent != null) + CMDGotoParentEvent.CanExecute = true; + else + CMDGotoParentEvent.CanExecute = false; + } + } + public DbgWidgetRecord CurrentWidget { + get => curWidgetRecord; + set { + if (curWidgetRecord == value) + return; + curWidgetRecord = value; + NotifyValueChanged ("CurrentWidget", curWidgetRecord); + NotifyValueChanged ("CurWidgetRootEvents", curWidgetRecord?.RootEvents); + NotifyValueChanged ("CurrentWidgetEvents", curWidgetRecord?.Events); + NotifyValueChanged ("CurWidgetProperties", CurWidgetProperties); + } + } + public List CurWidgetRootEvents => curWidgetRecord == null? new List() : curWidgetRecord.RootEvents; + + public IEnumerable> CurWidgetProperties { + get { + if (curWidgetRecord == null) + return null; + long endTime = curEvent == null ? long.MaxValue : curEvent.end; + Dictionary result = new Dictionary (); + foreach (DbgWidgetEvent evt in curWidgetRecord?.Events?.Where (e => e.type == DbgEvtType.GOSetProperty && e.begin <= endTime)){ + string[] tmp = evt.Message.Split('='); + if (result.ContainsKey (tmp[0])) + result[tmp[0]] = tmp[1]; + else + result.Add (tmp[0], tmp[1]); + } + return result; + } + } + + void currentEventHistoryGoBack () { + disableCurrentEventHistory = true; + if (CurrentEvent != null) { + CurrentEventHistoryForward.Push (CurrentEvent); + CMDEventHistoryForward.CanExecute = true; + } + CurrentEvent = CurrentEventHistoryBackward.Pop (); + CMDEventHistoryBackward.CanExecute = CurrentEventHistoryBackward.Count > 0; + + disableCurrentEventHistory = false; + } + void currentEventHistoryGoForward () { + disableCurrentEventHistory = true; + CurrentEventHistoryBackward.Push (CurrentEvent); + CMDEventHistoryBackward.CanExecute = true; + CurrentEvent = CurrentEventHistoryForward.Pop (); + CMDEventHistoryForward.CanExecute = CurrentEventHistoryForward.Count > 0; + + disableCurrentEventHistory = false; + } + } +} diff --git a/Samples/DebugLogViewer/ui/CrowEdit.style b/Samples/DebugLogViewer/ui/CrowEdit.style new file mode 100644 index 00000000..eccf2c6d --- /dev/null +++ b/Samples/DebugLogViewer/ui/CrowEdit.style @@ -0,0 +1,141 @@ +SmallUIFont = "sans, 12"; +SmallFont = "consolas, 12"; +InactiveTabBackground = "DarkGrey"; +SelectedTabBackground = "Onyx"; +InactiveTabForeground = "Grey"; +SelectedTabForeground = "White"; +MenuIconSize = "22"; + +ControlForeground = "LightGrey"; +ControlCaptionHoverColor = "White"; + +ControlHighlight = "RoyalBlue"; +ControlIdle = "Jet"; + +DockWindowBackground = "DarkGrey"; + +TreeItemBorderCornerRadius = "0"; +TreeItemBorderFG = "Transparent"; +TreeItemBorderHighlightFG = "DimGrey"; +TreeItemBackground = "Transparent"; +//TreeItemHighlight = " + +TxtInFileDialog { + Margin = "2"; + Font = "mono, 14"; +} + +Editor { + Focusable="true"; + Height="Stretched"; + Width="Stretched"; + Background="White"; + Foreground="Black"; + MouseWheelSpeed = "20"; + BubbleEvents ="None"; + ClipToClientRect = "true"; + MouseCursor = "ibeam"; + CacheEnabled = "true"; +} + +icon { + Width="14"; + Height="14"; +} +MemberViewLabel { + Margin="1"; + Height="Fit"; + Width="50%"; + Background="White"; +} +MemberViewHStack { + Focusable="true"; + Height="Fit"; + Spacing="1"; + MouseEnter="{Background=SteelBlue}"; + MouseLeave="{Background=Transparent}"; +} + +IcoBut { + Template = "#ui.IcoBut.template"; + MinimumSize = "10,10"; + Width = "32"; + Height = "32"; +} +Spinner { + Template = "#ui.spinner.template"; +} +TreeIcon { + Width="16"; + Height="16"; +} +TreeIconSmall { + Width="12"; + Height="12"; +} +TreeLabel { + Foreground="White"; + Margin = "1"; +} +TreeLabel2 { + Foreground="Black"; + Background="LightGrey"; + Margin = "1"; + Font = "sans, 9"; +} + +Splitter { + Thickness="1"; + Background="Transparent"; + Hover="{Background=White}"; + Unhover="{Background=Transparent}"; +} + +MenuItem { + Template = "#ui.MenuItem.template"; +} + +MenuIcon { + Margin = "1"; + Width = "${MenuIconSize}"; + Height = "${MenuIconSize}"; +} + +EnumSelector { + Template = "#ui.EnumSelector.template"; + ItemStyle = "CheckBoxEvtType"; +} +CheckBox { + Template= "#Crow.CheckBox2.template"; + Width = "Stretched"; + Height = "Fit"; + CornerRadius = "2"; + Background = "${ControlIdle}"; + Foreground = "${ControlForeground}"; + Checked = "{Background=${ControlHighlight}}"; + Unchecked = "{Background=${ControlIdle}}"; + MouseEnter = "{Foreground=${ControlCaptionHoverColor}}"; + MouseLeave = "{Foreground=${ControlForeground}}"; +} +StateBox { + Template= "#Crow.CheckBox2.template"; + Width = "Stretched"; + Height = "Fit"; + CornerRadius = "2"; + Background = "${ControlIdle}"; + Foreground = "${ControlForeground}"; + Checked = "{Background=Green}"; + Unchecked = "{Background=DarkRed}"; + Focusable = "false"; +} +StateBoxSmall { + Template= "#ui.SimpleStatus.template"; + Checked = "{Background=Green}"; + Unchecked = "{Background=DarkRed}"; + Focusable = "false"; + Background = "DarkRed"; + Foreground = "${ControlForeground}"; + Width = "Fit"; + Height = "Fit"; +} + diff --git a/Samples/DebugLogViewer/ui/DbgEventTreeItems.itemp b/Samples/DebugLogViewer/ui/DbgEventTreeItems.itemp new file mode 100644 index 00000000..1267fa54 --- /dev/null +++ b/Samples/DebugLogViewer/ui/DbgEventTreeItems.itemp @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Samples/DebugLogViewer/ui/DbgEventView.template b/Samples/DebugLogViewer/ui/DbgEventView.template new file mode 100644 index 00000000..8b6f5482 --- /dev/null +++ b/Samples/DebugLogViewer/ui/DbgEventView.template @@ -0,0 +1,44 @@ + + + \ No newline at end of file diff --git a/Samples/DebugLogViewer/ui/DbgEvtTooltip.crow b/Samples/DebugLogViewer/ui/DbgEvtTooltip.crow new file mode 100644 index 00000000..a3369249 --- /dev/null +++ b/Samples/DebugLogViewer/ui/DbgEvtTooltip.crow @@ -0,0 +1,42 @@ + + + + + \ No newline at end of file diff --git a/Samples/DebugLogViewer/ui/DbgWidgetEventListItems.itemp b/Samples/DebugLogViewer/ui/DbgWidgetEventListItems.itemp new file mode 100644 index 00000000..d7a397ae --- /dev/null +++ b/Samples/DebugLogViewer/ui/DbgWidgetEventListItems.itemp @@ -0,0 +1,11 @@ + + + + + diff --git a/Samples/DebugLogViewer/ui/EnumSelector.template b/Samples/DebugLogViewer/ui/EnumSelector.template new file mode 100644 index 00000000..3472ec0d --- /dev/null +++ b/Samples/DebugLogViewer/ui/EnumSelector.template @@ -0,0 +1,21 @@ + + + + + + \ No newline at end of file diff --git a/Samples/DebugLogViewer/ui/IconCommand.itmp b/Samples/DebugLogViewer/ui/IconCommand.itmp new file mode 100644 index 00000000..8f648dd5 --- /dev/null +++ b/Samples/DebugLogViewer/ui/IconCommand.itmp @@ -0,0 +1,10 @@ + + + + diff --git a/Samples/DebugLogViewer/ui/MenuButton.template b/Samples/DebugLogViewer/ui/MenuButton.template new file mode 100644 index 00000000..3a3e2c61 --- /dev/null +++ b/Samples/DebugLogViewer/ui/MenuButton.template @@ -0,0 +1,11 @@ + + diff --git a/Samples/DebugLogViewer/ui/MenuItem.itmp b/Samples/DebugLogViewer/ui/MenuItem.itmp new file mode 100644 index 00000000..8dfb3301 --- /dev/null +++ b/Samples/DebugLogViewer/ui/MenuItem.itmp @@ -0,0 +1,16 @@ + + + + + + + + diff --git a/Samples/DebugLogViewer/ui/WidgetRecord.itemp b/Samples/DebugLogViewer/ui/WidgetRecord.itemp new file mode 100644 index 00000000..e9d15d1e --- /dev/null +++ b/Samples/DebugLogViewer/ui/WidgetRecord.itemp @@ -0,0 +1,12 @@ + + + + + \ No newline at end of file diff --git a/Samples/DebugLogViewer/ui/main.crow b/Samples/DebugLogViewer/ui/main.crow new file mode 100644 index 00000000..a1f99e19 --- /dev/null +++ b/Samples/DebugLogViewer/ui/main.crow @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Samples/DebugLogViewer/ui/winDebugLog.crow b/Samples/DebugLogViewer/ui/winDebugLog.crow new file mode 100644 index 00000000..90557a09 --- /dev/null +++ b/Samples/DebugLogViewer/ui/winDebugLog.crow @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Samples/DebugLogViewer/ui/winLogGraph.crow b/Samples/DebugLogViewer/ui/winLogGraph.crow new file mode 100644 index 00000000..085596a0 --- /dev/null +++ b/Samples/DebugLogViewer/ui/winLogGraph.crow @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + diff --git a/Samples/DebugLogViewer/ui/winLogNavigation.crow b/Samples/DebugLogViewer/ui/winLogNavigation.crow new file mode 100644 index 00000000..62d71a53 --- /dev/null +++ b/Samples/DebugLogViewer/ui/winLogNavigation.crow @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Samples/Directory.Build.props b/Samples/Directory.Build.props index 823ee37e..a921afcf 100644 --- a/Samples/Directory.Build.props +++ b/Samples/Directory.Build.props @@ -31,6 +31,10 @@ PreserveNewest Interfaces\%(RecursiveDir)%(Filename)%(Extension) + + ui.%(Filename)%(Extension) + Interfaces\%(RecursiveDir)%(Filename)%(Extension) + ui.%(Filename)%(Extension) Templates\%(Filename)%(Extension) diff --git a/Samples/DockTests/DockTests.csproj b/Samples/DockTests/DockTests.csproj new file mode 100644 index 00000000..4c64f057 --- /dev/null +++ b/Samples/DockTests/DockTests.csproj @@ -0,0 +1,8 @@ + + + + + ui.%(Filename)%(Extension) + + + \ No newline at end of file diff --git a/Samples/DockTests/main.cs b/Samples/DockTests/main.cs new file mode 100644 index 00000000..99e58f27 --- /dev/null +++ b/Samples/DockTests/main.cs @@ -0,0 +1,68 @@ +using System; +using System.Collections.Generic; +using Crow; +using Glfw; +using Samples; + +namespace DockTests +{ + class Program : Interface { + Program() : base (1400, 1000, true) {} + static void Main (string[] args) { + //Interface.PreferedBackendType = Drawing2D.BackendType.Egl; + using (Program app = new Program ()) { + //app.Initialized += (sender, e) => app.LoadIMLFragment (@"