Show CPU core count in CLI and add window creation helper methods

This commit is contained in:
Stone_Red
2026-06-12 02:48:52 +02:00
parent 5a7b1d1f97
commit a47656320a
4 changed files with 16 additions and 3 deletions
+1
View File
@@ -18,6 +18,7 @@ internal class CliProcess() : Process("Cli")
Console.Clear(); Console.Clear();
Console.WriteLine("Welcome RemSox!"); Console.WriteLine("Welcome RemSox!");
Console.WriteLine("Type 'help' to see available commands."); Console.WriteLine("Type 'help' to see available commands.");
Console.WriteLine(Environment.ProcessorCount + " CPU cores detected");
Console.Write("> "); Console.Write("> ");
historyIndex = CommandManager.GetCommandHistory().Count; historyIndex = CommandManager.GetCommandHistory().Count;
+1 -1
View File
@@ -24,7 +24,7 @@ public class TerminalProcess() : Process("Terminal")
internal override void Start(string[] args) internal override void Start(string[] args)
{ {
window = WindowManager.CreateWindow(this, "Terminal", new Size(400, 300)); window = CreateWindow("Terminal", new Size(400, 300), new Point(100, 100));
PrintLine("RemSox GUI Terminal v1.0"); PrintLine("RemSox GUI Terminal v1.0");
PrintLine("Type 'help' for commands."); PrintLine("Type 'help' for commands.");
+12
View File
@@ -1,5 +1,7 @@
using System.Drawing;
using RemSox.Logging; using RemSox.Logging;
using RemSox.Processing.IPC; using RemSox.Processing.IPC;
using RemSox.UI.GUI.Windows;
namespace RemSox.Processing; namespace RemSox.Processing;
@@ -25,6 +27,16 @@ public abstract class Process(string name)
{ {
} }
protected Window CreateWindow(string title, Size size)
{
return WindowManager.CreateWindow(this, title, size);
}
protected Window CreateWindow(string title, Size size, Point position)
{
return WindowManager.CreateWindow(this, title, size, position);
}
protected void SendMessageToProcess(int targetProcessId, Message message) protected void SendMessageToProcess(int targetProcessId, Message message)
{ {
InterProcessCommunicator.Send(targetProcessId, message, this); InterProcessCommunicator.Send(targetProcessId, message, this);
+2 -2
View File
@@ -84,7 +84,7 @@ public static class WindowManager
/// <summary> /// <summary>
/// Creates and registers a new window for the specified process. /// Creates and registers a new window for the specified process.
/// </summary> /// </summary>
public static Window CreateWindow(Process process, string title, Point position, Size size) public static Window CreateWindow(Process process, string title, Size size, Point position)
{ {
Window window = new(title, process.Id, GetNextWindowId(), renderSource) Window window = new(title, process.Id, GetNextWindowId(), renderSource)
{ {
@@ -208,7 +208,7 @@ public static class WindowManager
} }
} }
return CreateWindow(process, title, new Point(bestX, bestY), size); return CreateWindow(process, title, size, new Point(bestX, bestY));
} }
/// <summary> /// <summary>