using Cosmos.Kernel.System.Graphics; using RemSox.Processing; using RemSox.UI.GUI.Layout; using RemSox.UI.GUI.Rendering; using RemSox.UI.GUI.UIEelements.Controls; using RemSox.UI.GUI.Windows; using System.Drawing; namespace RemSox.Processes; internal class DesktopProcess() : Process("Desktop Manager") { private static bool isGraphicsInitialized = false; private static readonly (string Name, Func Spawn)[] AvailableApps = [ ("Terminal", () => ProcessManager.SpawnProcess()), ("Test Process",() => ProcessManager.SpawnProcess()), ("YesNt", () => ProcessManager.SpawnProcess()), ]; private Window taskbar = null!; private Window? startMenu; private Button startButton = null!; private readonly List<(int WindowId, Button Button)> windowButtons = []; private int tickCount; internal override void Start(string[] args) { if (!isGraphicsInitialized) { WindowManager.AddRenderSource(new CanvasRenderSource()); isGraphicsInitialized = true; } WindowManager.InvalidateAll(); CreateTaskbar(); } private void CreateTaskbar() { Canvas canvas = FullScreenCanvas.GetFullScreenCanvas(); int screenW = (int)canvas.Mode.Width; int screenH = (int)canvas.Mode.Height; const int taskbarH = 36; taskbar = WindowManager.CreateWindow(this, "Taskbar", new Size(screenW, taskbarH), new Point(0, screenH - taskbarH)); taskbar.HasChrome = false; taskbar.IsResizable = false; taskbar.IsDraggable = false; taskbar.ZIndex = int.MaxValue; taskbar.AutoFlush = true; startButton = taskbar.CreateUIElement