Compare commits
20 Commits
87d30be421
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6c514df84e | ||
|
|
29a68b4ca9 | ||
|
|
5c952e7861 | ||
|
|
6a9d39abd9 | ||
|
|
1f385ac18a | ||
|
|
f0a9223520 | ||
|
|
545f40cf95 | ||
|
|
ec7e0978d3 | ||
|
|
c5fc081977 | ||
|
|
58df162054 | ||
|
|
02ff8295ef | ||
|
|
b67e0e7a03 | ||
|
|
fefb7e737a | ||
|
|
c83988458a | ||
|
|
ffbc58eb40 | ||
|
|
c1e0651e4b | ||
|
|
5f4d97729a | ||
|
|
e8e45ef7ae | ||
|
|
2e8ef4ef91 | ||
|
|
0724502225 |
171
.VSCodeCounter/2026-02-28_22-08-29/details.md
Normal file
@@ -0,0 +1,171 @@
|
||||
# Details
|
||||
|
||||
Date : 2026-02-28 22:08:29
|
||||
|
||||
Directory c:\\Users\\leon\\source\\repos\\CMLeonOS\\CMLeonOS
|
||||
|
||||
Total : 156 files, 52081 codes, 1281 comments, 5298 blanks, all 58660 lines
|
||||
|
||||
[Summary](results.md) / Details / [Diff Summary](diff.md) / [Diff Details](diff-details.md)
|
||||
|
||||
## Files
|
||||
| filename | language | code | comment | blank | total |
|
||||
| :--- | :--- | ---: | ---: | ---: | ---: |
|
||||
| [BootMenu.cs](/BootMenu.cs) | C# | 131 | 2 | 25 | 158 |
|
||||
| [Branswe.md](/Branswe.md) | Markdown | 261 | 0 | 67 | 328 |
|
||||
| [Build.bat](/Build.bat) | Batch | 1 | 1 | 0 | 2 |
|
||||
| [BuildTime.ps1](/BuildTime.ps1) | PowerShell | 3 | 0 | 1 | 4 |
|
||||
| [CMLeonOS.csproj](/CMLeonOS.csproj) | XML | 88 | 1 | 14 | 103 |
|
||||
| [Editor/Editor.cs](/Editor/Editor.cs) | C# | 267 | 29 | 35 | 331 |
|
||||
| [Editor/Nano.cs](/Editor/Nano.cs) | C# | 1,339 | 16 | 160 | 1,515 |
|
||||
| [GenerateGitCommit.ps1](/GenerateGitCommit.ps1) | PowerShell | 22 | 0 | 3 | 25 |
|
||||
| [Interpreter/Branswe.cs](/Interpreter/Branswe.cs) | C# | 482 | 28 | 53 | 563 |
|
||||
| [Interpreter/UniLua/ByteString.cs](/Interpreter/UniLua/ByteString.cs) | C# | 41 | 0 | 7 | 48 |
|
||||
| [Interpreter/UniLua/Coder.cs](/Interpreter/UniLua/Coder.cs) | C# | 1,101 | 26 | 157 | 1,284 |
|
||||
| [Interpreter/UniLua/Common.cs](/Interpreter/UniLua/Common.cs) | C# | 99 | 3 | 27 | 129 |
|
||||
| [Interpreter/UniLua/Do.cs](/Interpreter/UniLua/Do.cs) | C# | 269 | 25 | 50 | 344 |
|
||||
| [Interpreter/UniLua/Dump.cs](/Interpreter/UniLua/Dump.cs) | C# | 187 | 0 | 33 | 220 |
|
||||
| [Interpreter/UniLua/LLex.cs](/Interpreter/UniLua/LLex.cs) | C# | 627 | 40 | 93 | 760 |
|
||||
| [Interpreter/UniLua/LuaAPI.cs](/Interpreter/UniLua/LuaAPI.cs) | C# | 1,335 | 64 | 240 | 1,639 |
|
||||
| [Interpreter/UniLua/LuaAuxLib.cs](/Interpreter/UniLua/LuaAuxLib.cs) | C# | 643 | 21 | 92 | 756 |
|
||||
| [Interpreter/UniLua/LuaBaseLib.cs](/Interpreter/UniLua/LuaBaseLib.cs) | C# | 406 | 9 | 43 | 458 |
|
||||
| [Interpreter/UniLua/LuaBitLib.cs](/Interpreter/UniLua/LuaBitLib.cs) | C# | 179 | 0 | 26 | 205 |
|
||||
| [Interpreter/UniLua/LuaCoroLib.cs](/Interpreter/UniLua/LuaCoroLib.cs) | C# | 137 | 0 | 16 | 153 |
|
||||
| [Interpreter/UniLua/LuaDebug.cs](/Interpreter/UniLua/LuaDebug.cs) | C# | 443 | 19 | 55 | 517 |
|
||||
| [Interpreter/UniLua/LuaDebugLib.cs](/Interpreter/UniLua/LuaDebugLib.cs) | C# | 20 | 0 | 6 | 26 |
|
||||
| [Interpreter/UniLua/LuaEncLib.cs](/Interpreter/UniLua/LuaEncLib.cs) | C# | 51 | 0 | 13 | 64 |
|
||||
| [Interpreter/UniLua/LuaFile.cs](/Interpreter/UniLua/LuaFile.cs) | C# | 115 | 2 | 18 | 135 |
|
||||
| [Interpreter/UniLua/LuaFunc.cs](/Interpreter/UniLua/LuaFunc.cs) | C# | 69 | 6 | 20 | 95 |
|
||||
| [Interpreter/UniLua/LuaIOLib.cs](/Interpreter/UniLua/LuaIOLib.cs) | C# | 70 | 12 | 19 | 101 |
|
||||
| [Interpreter/UniLua/LuaJsonLib.cs](/Interpreter/UniLua/LuaJsonLib.cs) | C# | 461 | 0 | 65 | 526 |
|
||||
| [Interpreter/UniLua/LuaMathLib.cs](/Interpreter/UniLua/LuaMathLib.cs) | C# | 285 | 10 | 49 | 344 |
|
||||
| [Interpreter/UniLua/LuaObject.cs](/Interpreter/UniLua/LuaObject.cs) | C# | 367 | 1 | 52 | 420 |
|
||||
| [Interpreter/UniLua/LuaOsLib.cs](/Interpreter/UniLua/LuaOsLib.cs) | C# | 316 | 0 | 50 | 366 |
|
||||
| [Interpreter/UniLua/LuaPkgLib.cs](/Interpreter/UniLua/LuaPkgLib.cs) | C# | 256 | 57 | 47 | 360 |
|
||||
| [Interpreter/UniLua/LuaState.cs](/Interpreter/UniLua/LuaState.cs) | C# | 250 | 6 | 51 | 307 |
|
||||
| [Interpreter/UniLua/LuaStrLib.cs](/Interpreter/UniLua/LuaStrLib.cs) | C# | 869 | 8 | 61 | 938 |
|
||||
| [Interpreter/UniLua/LuaTable.cs](/Interpreter/UniLua/LuaTable.cs) | C# | 465 | 37 | 80 | 582 |
|
||||
| [Interpreter/UniLua/LuaTableLib.cs](/Interpreter/UniLua/LuaTableLib.cs) | C# | 250 | 8 | 24 | 282 |
|
||||
| [Interpreter/UniLua/OpCodes.cs](/Interpreter/UniLua/OpCodes.cs) | C# | 131 | 7 | 27 | 165 |
|
||||
| [Interpreter/UniLua/Parser.cs](/Interpreter/UniLua/Parser.cs) | C# | 1,588 | 139 | 219 | 1,946 |
|
||||
| [Interpreter/UniLua/TagMethod.cs](/Interpreter/UniLua/TagMethod.cs) | C# | 91 | 2 | 10 | 103 |
|
||||
| [Interpreter/UniLua/ULDebug.cs](/Interpreter/UniLua/ULDebug.cs) | C# | 13 | 2 | 5 | 20 |
|
||||
| [Interpreter/UniLua/Undump.cs](/Interpreter/UniLua/Undump.cs) | C# | 321 | 6 | 50 | 377 |
|
||||
| [Interpreter/UniLua/Util.cs](/Interpreter/UniLua/Util.cs) | C# | 192 | 8 | 39 | 239 |
|
||||
| [Interpreter/UniLua/VM.cs](/Interpreter/UniLua/VM.cs) | C# | 1,038 | 58 | 161 | 1,257 |
|
||||
| [Kernel.cs](/Kernel.cs) | C# | 391 | 87 | 74 | 552 |
|
||||
| [LISENCE.md](/LISENCE.md) | Markdown | 485 | 0 | 110 | 595 |
|
||||
| [Logger/LogEntry.cs](/Logger/LogEntry.cs) | C# | 41 | 0 | 5 | 46 |
|
||||
| [Logger/LogLevel.cs](/Logger/LogLevel.cs) | C# | 11 | 0 | 1 | 12 |
|
||||
| [Logger/Logger.cs](/Logger/Logger.cs) | C# | 94 | 0 | 18 | 112 |
|
||||
| [LuaApps.cs](/LuaApps.cs) | C# | 13 | 0 | 3 | 16 |
|
||||
| [LuaApps/calculator.lua](/LuaApps/calculator.lua) | Lua | 87 | 0 | 11 | 98 |
|
||||
| [LuaApps/helloworld.lua](/LuaApps/helloworld.lua) | Lua | 3 | 0 | 0 | 3 |
|
||||
| [LuaApps/testspeed.lua](/LuaApps/testspeed.lua) | Lua | 6 | 1 | 0 | 7 |
|
||||
| [README.md](/README.md) | Markdown | 2 | 0 | 0 | 2 |
|
||||
| [Settings/Settings.cs](/Settings/Settings.cs) | C# | 160 | 0 | 18 | 178 |
|
||||
| [Shell/CommandList.cs](/Shell/CommandList.cs) | C# | 232 | 0 | 1 | 233 |
|
||||
| [Shell/Commands/Editor/EditCommand.cs](/Shell/Commands/Editor/EditCommand.cs) | C# | 24 | 0 | 3 | 27 |
|
||||
| [Shell/Commands/Editor/NanoCommand.cs](/Shell/Commands/Editor/NanoCommand.cs) | C# | 24 | 0 | 3 | 27 |
|
||||
| [Shell/Commands/Environment/EnvCommand.cs](/Shell/Commands/Environment/EnvCommand.cs) | C# | 175 | 0 | 10 | 185 |
|
||||
| [Shell/Commands/FileSystem/CatCommand.cs](/Shell/Commands/FileSystem/CatCommand.cs) | C# | 18 | 0 | 2 | 20 |
|
||||
| [Shell/Commands/FileSystem/CdCommand.cs](/Shell/Commands/FileSystem/CdCommand.cs) | C# | 10 | 0 | 1 | 11 |
|
||||
| [Shell/Commands/FileSystem/CopyCommand.cs](/Shell/Commands/FileSystem/CopyCommand.cs) | C# | 40 | 0 | 6 | 46 |
|
||||
| [Shell/Commands/FileSystem/DiskInfoCommand.cs](/Shell/Commands/FileSystem/DiskInfoCommand.cs) | C# | 28 | 0 | 5 | 33 |
|
||||
| [Shell/Commands/FileSystem/FindCommand.cs](/Shell/Commands/FileSystem/FindCommand.cs) | C# | 37 | 0 | 5 | 42 |
|
||||
| [Shell/Commands/FileSystem/HeadCommand.cs](/Shell/Commands/FileSystem/HeadCommand.cs) | C# | 46 | 0 | 8 | 54 |
|
||||
| [Shell/Commands/FileSystem/LsCommand.cs](/Shell/Commands/FileSystem/LsCommand.cs) | C# | 10 | 0 | 1 | 11 |
|
||||
| [Shell/Commands/FileSystem/MkdirCommand.cs](/Shell/Commands/FileSystem/MkdirCommand.cs) | C# | 20 | 0 | 2 | 22 |
|
||||
| [Shell/Commands/FileSystem/MoveCommand.cs](/Shell/Commands/FileSystem/MoveCommand.cs) | C# | 41 | 0 | 7 | 48 |
|
||||
| [Shell/Commands/FileSystem/PwdCommand.cs](/Shell/Commands/FileSystem/PwdCommand.cs) | C# | 11 | 0 | 2 | 13 |
|
||||
| [Shell/Commands/FileSystem/RenameCommand.cs](/Shell/Commands/FileSystem/RenameCommand.cs) | C# | 48 | 0 | 9 | 57 |
|
||||
| [Shell/Commands/FileSystem/RmCommand.cs](/Shell/Commands/FileSystem/RmCommand.cs) | C# | 60 | 0 | 6 | 66 |
|
||||
| [Shell/Commands/FileSystem/RmdirCommand.cs](/Shell/Commands/FileSystem/RmdirCommand.cs) | C# | 27 | 0 | 3 | 30 |
|
||||
| [Shell/Commands/FileSystem/TailCommand.cs](/Shell/Commands/FileSystem/TailCommand.cs) | C# | 47 | 0 | 8 | 55 |
|
||||
| [Shell/Commands/FileSystem/TouchCommand.cs](/Shell/Commands/FileSystem/TouchCommand.cs) | C# | 25 | 0 | 3 | 28 |
|
||||
| [Shell/Commands/FileSystem/TreeCommand.cs](/Shell/Commands/FileSystem/TreeCommand.cs) | C# | 67 | 0 | 11 | 78 |
|
||||
| [Shell/Commands/FileSystem/WordCountCommand.cs](/Shell/Commands/FileSystem/WordCountCommand.cs) | C# | 45 | 0 | 6 | 51 |
|
||||
| [Shell/Commands/Help/Help.cs](/Shell/Commands/Help/Help.cs) | C# | 554 | 0 | 29 | 583 |
|
||||
| [Shell/Commands/Info/About.cs](/Shell/Commands/Info/About.cs) | C# | 12 | 0 | 2 | 14 |
|
||||
| [Shell/Commands/Info/Version.cs](/Shell/Commands/Info/Version.cs) | C# | 22 | 0 | 3 | 25 |
|
||||
| [Shell/Commands/LabyrinthCommand.cs](/Shell/Commands/LabyrinthCommand.cs) | C# | 224 | 0 | 24 | 248 |
|
||||
| [Shell/Commands/Power/RestartCommand.cs](/Shell/Commands/Power/RestartCommand.cs) | C# | 13 | 0 | 2 | 15 |
|
||||
| [Shell/Commands/Power/ShutdownCommand.cs](/Shell/Commands/Power/ShutdownCommand.cs) | C# | 13 | 0 | 2 | 15 |
|
||||
| [Shell/Commands/Script/BransweCommand.cs](/Shell/Commands/Script/BransweCommand.cs) | C# | 42 | 0 | 6 | 48 |
|
||||
| [Shell/Commands/Script/ClaCommand.cs](/Shell/Commands/Script/ClaCommand.cs) | C# | 69 | 0 | 14 | 83 |
|
||||
| [Shell/Commands/Script/ComCommand.cs](/Shell/Commands/Script/ComCommand.cs) | C# | 54 | 0 | 9 | 63 |
|
||||
| [Shell/Commands/Script/Lua2ClaCommand.cs](/Shell/Commands/Script/Lua2ClaCommand.cs) | C# | 58 | 0 | 13 | 71 |
|
||||
| [Shell/Commands/Script/LuaCommand.cs](/Shell/Commands/Script/LuaCommand.cs) | C# | 230 | 0 | 27 | 257 |
|
||||
| [Shell/Commands/System/ClearCommand.cs](/Shell/Commands/System/ClearCommand.cs) | C# | 11 | 0 | 2 | 13 |
|
||||
| [Shell/Commands/System/DateCommand.cs](/Shell/Commands/System/DateCommand.cs) | C# | 11 | 0 | 2 | 13 |
|
||||
| [Shell/Commands/System/EchoCommand.cs](/Shell/Commands/System/EchoCommand.cs) | C# | 12 | 0 | 2 | 14 |
|
||||
| [Shell/Commands/System/KillCommand.cs](/Shell/Commands/System/KillCommand.cs) | C# | 50 | 0 | 8 | 58 |
|
||||
| [Shell/Commands/System/PsCommand.cs](/Shell/Commands/System/PsCommand.cs) | C# | 51 | 0 | 7 | 58 |
|
||||
| [Shell/Commands/System/SettingsCommand.cs](/Shell/Commands/System/SettingsCommand.cs) | C# | 74 | 0 | 8 | 82 |
|
||||
| [Shell/Commands/System/TimeCommand.cs](/Shell/Commands/System/TimeCommand.cs) | C# | 11 | 0 | 2 | 13 |
|
||||
| [Shell/Commands/System/UptimeCommand.cs](/Shell/Commands/System/UptimeCommand.cs) | C# | 40 | 0 | 6 | 46 |
|
||||
| [Shell/Commands/System/WhoamiCommand.cs](/Shell/Commands/System/WhoamiCommand.cs) | C# | 16 | 0 | 2 | 18 |
|
||||
| [Shell/Commands/TestGuiCommand.cs](/Shell/Commands/TestGuiCommand.cs) | C# | 77 | 0 | 9 | 86 |
|
||||
| [Shell/Commands/TestTUICommand.cs](/Shell/Commands/TestTUICommand.cs) | C# | 583 | 0 | 102 | 685 |
|
||||
| [Shell/Commands/User/CpassCommand.cs](/Shell/Commands/User/CpassCommand.cs) | C# | 10 | 0 | 1 | 11 |
|
||||
| [Shell/Commands/User/HostnameCommand.cs](/Shell/Commands/User/HostnameCommand.cs) | C# | 27 | 0 | 4 | 31 |
|
||||
| [Shell/Commands/User/UserCommand.cs](/Shell/Commands/User/UserCommand.cs) | C# | 114 | 0 | 14 | 128 |
|
||||
| [Shell/Commands/Utility/AliasCommand.cs](/Shell/Commands/Utility/AliasCommand.cs) | C# | 140 | 0 | 19 | 159 |
|
||||
| [Shell/Commands/Utility/AppManagerCommand.cs](/Shell/Commands/Utility/AppManagerCommand.cs) | C# | 165 | 0 | 30 | 195 |
|
||||
| [Shell/Commands/Utility/BackgroundCommand.cs](/Shell/Commands/Utility/BackgroundCommand.cs) | C# | 108 | 0 | 9 | 117 |
|
||||
| [Shell/Commands/Utility/Base64Command.cs](/Shell/Commands/Utility/Base64Command.cs) | C# | 89 | 0 | 12 | 101 |
|
||||
| [Shell/Commands/Utility/BeepCommand.cs](/Shell/Commands/Utility/BeepCommand.cs) | C# | 11 | 0 | 2 | 13 |
|
||||
| [Shell/Commands/Utility/CalcCommand.cs](/Shell/Commands/Utility/CalcCommand.cs) | C# | 56 | 0 | 4 | 60 |
|
||||
| [Shell/Commands/Utility/CalcGuiCommand.cs](/Shell/Commands/Utility/CalcGuiCommand.cs) | C# | 307 | 0 | 28 | 335 |
|
||||
| [Shell/Commands/Utility/CalendarCommand.cs](/Shell/Commands/Utility/CalendarCommand.cs) | C# | 57 | 0 | 13 | 70 |
|
||||
| [Shell/Commands/Utility/HexCommand.cs](/Shell/Commands/Utility/HexCommand.cs) | C# | 45 | 0 | 5 | 50 |
|
||||
| [Shell/Commands/Utility/HexEditor.cs](/Shell/Commands/Utility/HexEditor.cs) | C# | 234 | 0 | 25 | 259 |
|
||||
| [Shell/Commands/Utility/HistoryCommand.cs](/Shell/Commands/Utility/HistoryCommand.cs) | C# | 15 | 0 | 2 | 17 |
|
||||
| [Shell/Commands/Utility/MatrixCommand.cs](/Shell/Commands/Utility/MatrixCommand.cs) | C# | 62 | 0 | 13 | 75 |
|
||||
| [Shell/Commands/Utility/PromptCommand.cs](/Shell/Commands/Utility/PromptCommand.cs) | C# | 18 | 0 | 2 | 20 |
|
||||
| [Shell/Commands/Utility/SnakeCommand.cs](/Shell/Commands/Utility/SnakeCommand.cs) | C# | 164 | 0 | 27 | 191 |
|
||||
| [Shell/Shell.cs](/Shell/Shell.cs) | C# | 1,509 | 19 | 271 | 1,799 |
|
||||
| [Shell/UsageGenerator.cs](/Shell/UsageGenerator.cs) | C# | 211 | 0 | 31 | 242 |
|
||||
| [System/FileSystem.cs](/System/FileSystem.cs) | C# | 493 | 18 | 63 | 574 |
|
||||
| [System/Process.cs](/System/Process.cs) | C# | 164 | 0 | 20 | 184 |
|
||||
| [System/ProcessManager.cs](/System/ProcessManager.cs) | C# | 77 | 0 | 15 | 92 |
|
||||
| [System/ShellProcess.cs](/System/ShellProcess.cs) | C# | 53 | 0 | 11 | 64 |
|
||||
| [System/UserSystem.cs](/System/UserSystem.cs) | C# | 736 | 11 | 111 | 858 |
|
||||
| [UI/CUI.cs](/UI/CUI.cs) | C# | 122 | 8 | 28 | 158 |
|
||||
| [UI/Components.cs](/UI/Components.cs) | C# | 960 | 0 | 144 | 1,104 |
|
||||
| [UI/TUI.cs](/UI/TUI.cs) | C# | 260 | 2 | 42 | 304 |
|
||||
| [UI/TUIDemo.cs](/UI/TUIDemo.cs) | C# | 279 | 0 | 54 | 333 |
|
||||
| [Utils/Base64.cs](/Utils/Base64.cs) | C# | 86 | 56 | 22 | 164 |
|
||||
| [Utils/EnvironmentVariableManager.cs](/Utils/EnvironmentVariableManager.cs) | C# | 151 | 5 | 17 | 173 |
|
||||
| [Utils/NetworkConfigManager.cs](/Utils/NetworkConfigManager.cs) | C# | 111 | 0 | 16 | 127 |
|
||||
| [Utils/SHA256.cs](/Utils/SHA256.cs) | C# | 179 | 6 | 41 | 226 |
|
||||
| [Utils/Version.cs](/Utils/Version.cs) | C# | 28 | 0 | 6 | 34 |
|
||||
| [docs/cmleonos/docs/.vuepress/.cache/deps/@vue\_devtools-api.js](/docs/cmleonos/docs/.vuepress/.cache/deps/@vue_devtools-api.js) | JavaScript | 4,356 | 145 | 5 | 4,506 |
|
||||
| [docs/cmleonos/docs/.vuepress/.cache/deps/@vuepress\_shared.js](/docs/cmleonos/docs/.vuepress/.cache/deps/@vuepress_shared.js) | JavaScript | 134 | 2 | 1 | 137 |
|
||||
| [docs/cmleonos/docs/.vuepress/.cache/deps/\_metadata.json](/docs/cmleonos/docs/.vuepress/.cache/deps/_metadata.json) | JSON | 37 | 0 | 0 | 37 |
|
||||
| [docs/cmleonos/docs/.vuepress/.cache/deps/chunk-OARA6QKZ.js](/docs/cmleonos/docs/.vuepress/.cache/deps/chunk-OARA6QKZ.js) | JavaScript | 12,582 | 238 | 5 | 12,825 |
|
||||
| [docs/cmleonos/docs/.vuepress/.cache/deps/package.json](/docs/cmleonos/docs/.vuepress/.cache/deps/package.json) | JSON | 3 | 0 | 1 | 4 |
|
||||
| [docs/cmleonos/docs/.vuepress/.cache/deps/vue-router.js](/docs/cmleonos/docs/.vuepress/.cache/deps/vue-router.js) | JavaScript | 2,371 | 25 | 9 | 2,405 |
|
||||
| [docs/cmleonos/docs/.vuepress/.cache/deps/vue.js](/docs/cmleonos/docs/.vuepress/.cache/deps/vue.js) | JavaScript | 346 | 0 | 1 | 347 |
|
||||
| [docs/cmleonos/docs/.vuepress/config.js](/docs/cmleonos/docs/.vuepress/config.js) | JavaScript | 12 | 1 | 7 | 20 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/404.html](/docs/cmleonos/docs/.vuepress/dist/404.html) | HTML | 40 | 0 | 4 | 44 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/assets/404.html-ByTdGTSm.js](/docs/cmleonos/docs/.vuepress/dist/assets/404.html-ByTdGTSm.js) | JavaScript | 1 | 0 | 1 | 2 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/assets/app-C1vKFkGc.js](/docs/cmleonos/docs/.vuepress/dist/assets/app-C1vKFkGc.js) | JavaScript | 28 | 4 | 1 | 33 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/assets/commands.html-DsR2axk8.js](/docs/cmleonos/docs/.vuepress/dist/assets/commands.html-DsR2axk8.js) | JavaScript | 153 | 0 | 1 | 154 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/assets/get-started.html-CfHiKCXZ.js](/docs/cmleonos/docs/.vuepress/dist/assets/get-started.html-CfHiKCXZ.js) | JavaScript | 1 | 0 | 1 | 2 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/assets/index.html-BMbDjf\_W.js](/docs/cmleonos/docs/.vuepress/dist/assets/index.html-BMbDjf_W.js) | JavaScript | 1 | 0 | 1 | 2 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/assets/lua.html-3\_L4TJjQ.js](/docs/cmleonos/docs/.vuepress/dist/assets/lua.html-3_L4TJjQ.js) | JavaScript | 303 | 0 | 1 | 304 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/assets/style-BmL0kmLr.css](/docs/cmleonos/docs/.vuepress/dist/assets/style-BmL0kmLr.css) | PostCSS | 1 | 0 | 1 | 2 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/commands.html](/docs/cmleonos/docs/.vuepress/dist/commands.html) | HTML | 192 | 0 | 4 | 196 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/get-started.html](/docs/cmleonos/docs/.vuepress/dist/get-started.html) | HTML | 40 | 0 | 4 | 44 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/index.html](/docs/cmleonos/docs/.vuepress/dist/index.html) | HTML | 40 | 0 | 4 | 44 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/lua.html](/docs/cmleonos/docs/.vuepress/dist/lua.html) | HTML | 342 | 0 | 4 | 346 |
|
||||
| [docs/cmleonos/docs/README.md](/docs/cmleonos/docs/README.md) | Markdown | 33 | 0 | 4 | 37 |
|
||||
| [docs/cmleonos/docs/commands.md](/docs/cmleonos/docs/commands.md) | Markdown | 742 | 0 | 215 | 957 |
|
||||
| [docs/cmleonos/docs/get-started.md](/docs/cmleonos/docs/get-started.md) | Markdown | 16 | 0 | 4 | 20 |
|
||||
| [docs/cmleonos/docs/lua.md](/docs/cmleonos/docs/lua.md) | Markdown | 996 | 0 | 356 | 1,352 |
|
||||
| [docs/cmleonos/package.json](/docs/cmleonos/package.json) | JSON | 20 | 0 | 1 | 21 |
|
||||
| [docs/cmleonos/pnpm-lock.yaml](/docs/cmleonos/pnpm-lock.yaml) | YAML | 2,410 | 0 | 674 | 3,084 |
|
||||
| [global.json](/global.json) | JSON | 6 | 0 | 0 | 6 |
|
||||
|
||||
[Summary](results.md) / Details / [Diff Summary](diff.md) / [Diff Details](diff-details.md)
|
||||
41
.VSCodeCounter/2026-02-28_22-08-29/diff-details.md
Normal file
@@ -0,0 +1,41 @@
|
||||
# Diff Details
|
||||
|
||||
Date : 2026-02-28 22:08:29
|
||||
|
||||
Directory c:\\Users\\leon\\source\\repos\\CMLeonOS\\CMLeonOS
|
||||
|
||||
Total : 26 files, 1908 codes, 19 comments, 268 blanks, all 2195 lines
|
||||
|
||||
[Summary](results.md) / [Details](details.md) / [Diff Summary](diff.md) / Diff Details
|
||||
|
||||
## Files
|
||||
| filename | language | code | comment | blank | total |
|
||||
| :--- | :--- | ---: | ---: | ---: | ---: |
|
||||
| [BootMenu.cs](/BootMenu.cs) | C# | 131 | 2 | 25 | 158 |
|
||||
| [BuildTime.ps1](/BuildTime.ps1) | PowerShell | 3 | 0 | 1 | 4 |
|
||||
| [CMLeonOS.csproj](/CMLeonOS.csproj) | XML | 4 | 0 | 0 | 4 |
|
||||
| [Editor/Nano.cs](/Editor/Nano.cs) | C# | 612 | 0 | 67 | 679 |
|
||||
| [Interpreter/UniLua/LuaOsLib.cs](/Interpreter/UniLua/LuaOsLib.cs) | C# | 7 | 0 | 1 | 8 |
|
||||
| [Kernel.cs](/Kernel.cs) | C# | 42 | 24 | 7 | 73 |
|
||||
| [Settings/Settings.cs](/Settings/Settings.cs) | C# | 20 | 0 | 1 | 21 |
|
||||
| [Shell/CommandList.cs](/Shell/CommandList.cs) | C# | 9 | 0 | 0 | 9 |
|
||||
| [Shell/Commands/Help/Help.cs](/Shell/Commands/Help/Help.cs) | C# | 23 | 0 | 3 | 26 |
|
||||
| [Shell/Commands/Info/Version.cs](/Shell/Commands/Info/Version.cs) | C# | 5 | 0 | 1 | 6 |
|
||||
| [Shell/Commands/Script/ClaCommand.cs](/Shell/Commands/Script/ClaCommand.cs) | C# | 69 | 0 | 14 | 83 |
|
||||
| [Shell/Commands/Script/Lua2ClaCommand.cs](/Shell/Commands/Script/Lua2ClaCommand.cs) | C# | 58 | 0 | 13 | 71 |
|
||||
| [Shell/Commands/Script/LuaCommand.cs](/Shell/Commands/Script/LuaCommand.cs) | C# | 49 | 0 | 5 | 54 |
|
||||
| [Shell/Commands/System/KillCommand.cs](/Shell/Commands/System/KillCommand.cs) | C# | 50 | 0 | 8 | 58 |
|
||||
| [Shell/Commands/System/PsCommand.cs](/Shell/Commands/System/PsCommand.cs) | C# | 51 | 0 | 7 | 58 |
|
||||
| [Shell/Commands/System/SettingsCommand.cs](/Shell/Commands/System/SettingsCommand.cs) | C# | 12 | 0 | 0 | 12 |
|
||||
| [Shell/Commands/User/UserCommand.cs](/Shell/Commands/User/UserCommand.cs) | C# | 17 | 0 | 2 | 19 |
|
||||
| [Shell/Commands/Utility/HexCommand.cs](/Shell/Commands/Utility/HexCommand.cs) | C# | 45 | 0 | 5 | 50 |
|
||||
| [Shell/Commands/Utility/HexEditor.cs](/Shell/Commands/Utility/HexEditor.cs) | C# | 234 | 0 | 25 | 259 |
|
||||
| [Shell/Shell.cs](/Shell/Shell.cs) | C# | -28 | -4 | -7 | -39 |
|
||||
| [System/FileSystem.cs](/System/FileSystem.cs) | C# | 89 | -3 | 23 | 109 |
|
||||
| [System/Process.cs](/System/Process.cs) | C# | 164 | 0 | 20 | 184 |
|
||||
| [System/ProcessManager.cs](/System/ProcessManager.cs) | C# | 77 | 0 | 15 | 92 |
|
||||
| [System/ShellProcess.cs](/System/ShellProcess.cs) | C# | 53 | 0 | 11 | 64 |
|
||||
| [System/UserSystem.cs](/System/UserSystem.cs) | C# | 45 | 0 | 7 | 52 |
|
||||
| [docs/cmleonos/docs/commands.md](/docs/cmleonos/docs/commands.md) | Markdown | 67 | 0 | 14 | 81 |
|
||||
|
||||
[Summary](results.md) / [Details](details.md) / [Diff Summary](diff.md) / Diff Details
|
||||
28
.VSCodeCounter/2026-02-28_22-08-29/diff.csv
Normal file
@@ -0,0 +1,28 @@
|
||||
"filename", "language", "C#", "PowerShell", "XML", "Markdown", "comment", "blank", "total"
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\BootMenu.cs", "C#", 131, 0, 0, 0, 2, 25, 158
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\BuildTime.ps1", "PowerShell", 0, 3, 0, 0, 0, 1, 4
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\CMLeonOS.csproj", "XML", 0, 0, 4, 0, 0, 0, 4
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Editor\Nano.cs", "C#", 612, 0, 0, 0, 0, 67, 679
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaOsLib.cs", "C#", 7, 0, 0, 0, 0, 1, 8
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Kernel.cs", "C#", 42, 0, 0, 0, 24, 7, 73
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Settings\Settings.cs", "C#", 20, 0, 0, 0, 0, 1, 21
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\CommandList.cs", "C#", 9, 0, 0, 0, 0, 0, 9
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Help\Help.cs", "C#", 23, 0, 0, 0, 0, 3, 26
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Info\Version.cs", "C#", 5, 0, 0, 0, 0, 1, 6
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Script\ClaCommand.cs", "C#", 69, 0, 0, 0, 0, 14, 83
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Script\Lua2ClaCommand.cs", "C#", 58, 0, 0, 0, 0, 13, 71
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Script\LuaCommand.cs", "C#", 49, 0, 0, 0, 0, 5, 54
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\KillCommand.cs", "C#", 50, 0, 0, 0, 0, 8, 58
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\PsCommand.cs", "C#", 51, 0, 0, 0, 0, 7, 58
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\SettingsCommand.cs", "C#", 12, 0, 0, 0, 0, 0, 12
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\User\UserCommand.cs", "C#", 17, 0, 0, 0, 0, 2, 19
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\HexCommand.cs", "C#", 45, 0, 0, 0, 0, 5, 50
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\HexEditor.cs", "C#", 234, 0, 0, 0, 0, 25, 259
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Shell.cs", "C#", -28, 0, 0, 0, -4, -7, -39
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\System\FileSystem.cs", "C#", 89, 0, 0, 0, -3, 23, 109
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\System\Process.cs", "C#", 164, 0, 0, 0, 0, 20, 184
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\System\ProcessManager.cs", "C#", 77, 0, 0, 0, 0, 15, 92
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\System\ShellProcess.cs", "C#", 53, 0, 0, 0, 0, 11, 64
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\System\UserSystem.cs", "C#", 45, 0, 0, 0, 0, 7, 52
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\commands.md", "Markdown", 0, 0, 0, 67, 0, 14, 81
|
||||
"Total", "-", 1834, 3, 4, 67, 19, 268, 2195
|
||||
|
42
.VSCodeCounter/2026-02-28_22-08-29/diff.md
Normal file
@@ -0,0 +1,42 @@
|
||||
# Diff Summary
|
||||
|
||||
Date : 2026-02-28 22:08:29
|
||||
|
||||
Directory c:\\Users\\leon\\source\\repos\\CMLeonOS\\CMLeonOS
|
||||
|
||||
Total : 26 files, 1908 codes, 19 comments, 268 blanks, all 2195 lines
|
||||
|
||||
[Summary](results.md) / [Details](details.md) / Diff Summary / [Diff Details](diff-details.md)
|
||||
|
||||
## Languages
|
||||
| language | files | code | comment | blank | total |
|
||||
| :--- | ---: | ---: | ---: | ---: | ---: |
|
||||
| C# | 23 | 1,834 | 19 | 253 | 2,106 |
|
||||
| Markdown | 1 | 67 | 0 | 14 | 81 |
|
||||
| XML | 1 | 4 | 0 | 0 | 4 |
|
||||
| PowerShell | 1 | 3 | 0 | 1 | 4 |
|
||||
|
||||
## Directories
|
||||
| path | files | code | comment | blank | total |
|
||||
| :--- | ---: | ---: | ---: | ---: | ---: |
|
||||
| . | 26 | 1,908 | 19 | 268 | 2,195 |
|
||||
| . (Files) | 4 | 180 | 26 | 33 | 239 |
|
||||
| Editor | 1 | 612 | 0 | 67 | 679 |
|
||||
| Interpreter | 1 | 7 | 0 | 1 | 8 |
|
||||
| Interpreter\\UniLua | 1 | 7 | 0 | 1 | 8 |
|
||||
| Settings | 1 | 20 | 0 | 1 | 21 |
|
||||
| Shell | 13 | 594 | -4 | 76 | 666 |
|
||||
| Shell (Files) | 2 | -19 | -4 | -7 | -30 |
|
||||
| Shell\\Commands | 11 | 613 | 0 | 83 | 696 |
|
||||
| Shell\\Commands\\Help | 1 | 23 | 0 | 3 | 26 |
|
||||
| Shell\\Commands\\Info | 1 | 5 | 0 | 1 | 6 |
|
||||
| Shell\\Commands\\Script | 3 | 176 | 0 | 32 | 208 |
|
||||
| Shell\\Commands\\System | 3 | 113 | 0 | 15 | 128 |
|
||||
| Shell\\Commands\\User | 1 | 17 | 0 | 2 | 19 |
|
||||
| Shell\\Commands\\Utility | 2 | 279 | 0 | 30 | 309 |
|
||||
| System | 5 | 428 | -3 | 76 | 501 |
|
||||
| docs | 1 | 67 | 0 | 14 | 81 |
|
||||
| docs\\cmleonos | 1 | 67 | 0 | 14 | 81 |
|
||||
| docs\\cmleonos\\docs | 1 | 67 | 0 | 14 | 81 |
|
||||
|
||||
[Summary](results.md) / [Details](details.md) / Diff Summary / [Diff Details](diff-details.md)
|
||||
71
.VSCodeCounter/2026-02-28_22-08-29/diff.txt
Normal file
@@ -0,0 +1,71 @@
|
||||
Date : 2026-02-28 22:08:29
|
||||
Directory : c:\Users\leon\source\repos\CMLeonOS\CMLeonOS
|
||||
Total : 26 files, 1908 codes, 19 comments, 268 blanks, all 2195 lines
|
||||
|
||||
Languages
|
||||
+------------+------------+------------+------------+------------+------------+
|
||||
| language | files | code | comment | blank | total |
|
||||
+------------+------------+------------+------------+------------+------------+
|
||||
| C# | 23 | 1,834 | 19 | 253 | 2,106 |
|
||||
| Markdown | 1 | 67 | 0 | 14 | 81 |
|
||||
| XML | 1 | 4 | 0 | 0 | 4 |
|
||||
| PowerShell | 1 | 3 | 0 | 1 | 4 |
|
||||
+------------+------------+------------+------------+------------+------------+
|
||||
|
||||
Directories
|
||||
+---------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
|
||||
| path | files | code | comment | blank | total |
|
||||
+---------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
|
||||
| . | 26 | 1,908 | 19 | 268 | 2,195 |
|
||||
| . (Files) | 4 | 180 | 26 | 33 | 239 |
|
||||
| Editor | 1 | 612 | 0 | 67 | 679 |
|
||||
| Interpreter | 1 | 7 | 0 | 1 | 8 |
|
||||
| Interpreter\UniLua | 1 | 7 | 0 | 1 | 8 |
|
||||
| Settings | 1 | 20 | 0 | 1 | 21 |
|
||||
| Shell | 13 | 594 | -4 | 76 | 666 |
|
||||
| Shell (Files) | 2 | -19 | -4 | -7 | -30 |
|
||||
| Shell\Commands | 11 | 613 | 0 | 83 | 696 |
|
||||
| Shell\Commands\Help | 1 | 23 | 0 | 3 | 26 |
|
||||
| Shell\Commands\Info | 1 | 5 | 0 | 1 | 6 |
|
||||
| Shell\Commands\Script | 3 | 176 | 0 | 32 | 208 |
|
||||
| Shell\Commands\System | 3 | 113 | 0 | 15 | 128 |
|
||||
| Shell\Commands\User | 1 | 17 | 0 | 2 | 19 |
|
||||
| Shell\Commands\Utility | 2 | 279 | 0 | 30 | 309 |
|
||||
| System | 5 | 428 | -3 | 76 | 501 |
|
||||
| docs | 1 | 67 | 0 | 14 | 81 |
|
||||
| docs\cmleonos | 1 | 67 | 0 | 14 | 81 |
|
||||
| docs\cmleonos\docs | 1 | 67 | 0 | 14 | 81 |
|
||||
+---------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
|
||||
|
||||
Files
|
||||
+---------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
|
||||
| filename | language | code | comment | blank | total |
|
||||
+---------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\BootMenu.cs | C# | 131 | 2 | 25 | 158 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\BuildTime.ps1 | PowerShell | 3 | 0 | 1 | 4 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\CMLeonOS.csproj | XML | 4 | 0 | 0 | 4 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Editor\Nano.cs | C# | 612 | 0 | 67 | 679 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaOsLib.cs | C# | 7 | 0 | 1 | 8 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Kernel.cs | C# | 42 | 24 | 7 | 73 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Settings\Settings.cs | C# | 20 | 0 | 1 | 21 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\CommandList.cs | C# | 9 | 0 | 0 | 9 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Help\Help.cs | C# | 23 | 0 | 3 | 26 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Info\Version.cs | C# | 5 | 0 | 1 | 6 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Script\ClaCommand.cs | C# | 69 | 0 | 14 | 83 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Script\Lua2ClaCommand.cs | C# | 58 | 0 | 13 | 71 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Script\LuaCommand.cs | C# | 49 | 0 | 5 | 54 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\KillCommand.cs | C# | 50 | 0 | 8 | 58 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\PsCommand.cs | C# | 51 | 0 | 7 | 58 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\SettingsCommand.cs | C# | 12 | 0 | 0 | 12 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\User\UserCommand.cs | C# | 17 | 0 | 2 | 19 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\HexCommand.cs | C# | 45 | 0 | 5 | 50 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\HexEditor.cs | C# | 234 | 0 | 25 | 259 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Shell.cs | C# | -28 | -4 | -7 | -39 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\System\FileSystem.cs | C# | 89 | -3 | 23 | 109 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\System\Process.cs | C# | 164 | 0 | 20 | 184 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\System\ProcessManager.cs | C# | 77 | 0 | 15 | 92 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\System\ShellProcess.cs | C# | 53 | 0 | 11 | 64 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\System\UserSystem.cs | C# | 45 | 0 | 7 | 52 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\commands.md | Markdown | 67 | 0 | 14 | 81 |
|
||||
| Total | | 1,908 | 19 | 268 | 2,195 |
|
||||
+---------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
|
||||
158
.VSCodeCounter/2026-02-28_22-08-29/results.csv
Normal file
@@ -0,0 +1,158 @@
|
||||
"filename", "language", "C#", "PowerShell", "Markdown", "Batch", "XML", "JSON", "Lua", "YAML", "HTML", "JavaScript", "PostCSS", "comment", "blank", "total"
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\BootMenu.cs", "C#", 131, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 25, 158
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Branswe.md", "Markdown", 0, 0, 261, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67, 328
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Build.bat", "Batch", 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\BuildTime.ps1", "PowerShell", 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\CMLeonOS.csproj", "XML", 0, 0, 0, 0, 88, 0, 0, 0, 0, 0, 0, 1, 14, 103
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Editor\Editor.cs", "C#", 267, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 35, 331
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Editor\Nano.cs", "C#", 1339, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 160, 1515
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\GenerateGitCommit.ps1", "PowerShell", 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 25
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\Branswe.cs", "C#", 482, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 53, 563
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\ByteString.cs", "C#", 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 48
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Coder.cs", "C#", 1101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 157, 1284
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Common.cs", "C#", 99, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 27, 129
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Do.cs", "C#", 269, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 50, 344
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Dump.cs", "C#", 187, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 220
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LLex.cs", "C#", 627, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 93, 760
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaAPI.cs", "C#", 1335, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 240, 1639
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaAuxLib.cs", "C#", 643, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 92, 756
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaBaseLib.cs", "C#", 406, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 43, 458
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaBitLib.cs", "C#", 179, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 205
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaCoroLib.cs", "C#", 137, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 153
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaDebug.cs", "C#", 443, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 55, 517
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaDebugLib.cs", "C#", 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 26
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaEncLib.cs", "C#", 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 64
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaFile.cs", "C#", 115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 18, 135
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaFunc.cs", "C#", 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 20, 95
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaIOLib.cs", "C#", 70, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 19, 101
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaJsonLib.cs", "C#", 461, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 526
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaMathLib.cs", "C#", 285, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 49, 344
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaObject.cs", "C#", 367, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 52, 420
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaOsLib.cs", "C#", 316, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 366
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaPkgLib.cs", "C#", 256, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 57, 47, 360
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaState.cs", "C#", 250, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 51, 307
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaStrLib.cs", "C#", 869, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 61, 938
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaTable.cs", "C#", 465, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 80, 582
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaTableLib.cs", "C#", 250, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 24, 282
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\OpCodes.cs", "C#", 131, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 27, 165
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Parser.cs", "C#", 1588, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 139, 219, 1946
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\TagMethod.cs", "C#", 91, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 10, 103
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\ULDebug.cs", "C#", 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 5, 20
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Undump.cs", "C#", 321, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 50, 377
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Util.cs", "C#", 192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 39, 239
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\VM.cs", "C#", 1038, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 58, 161, 1257
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Kernel.cs", "C#", 391, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87, 74, 552
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\LISENCE.md", "Markdown", 0, 0, 485, 0, 0, 0, 0, 0, 0, 0, 0, 0, 110, 595
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Logger\LogEntry.cs", "C#", 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 46
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Logger\LogLevel.cs", "C#", 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 12
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Logger\Logger.cs", "C#", 94, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 112
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\LuaApps.cs", "C#", 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 16
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\LuaApps\calculator.lua", "Lua", 0, 0, 0, 0, 0, 0, 87, 0, 0, 0, 0, 0, 11, 98
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\LuaApps\helloworld.lua", "Lua", 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 3
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\LuaApps\testspeed.lua", "Lua", 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 1, 0, 7
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\README.md", "Markdown", 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Settings\Settings.cs", "C#", 160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 178
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\CommandList.cs", "C#", 232, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 233
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Editor\EditCommand.cs", "C#", 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 27
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Editor\NanoCommand.cs", "C#", 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 27
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Environment\EnvCommand.cs", "C#", 175, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 185
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\CatCommand.cs", "C#", 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 20
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\CdCommand.cs", "C#", 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 11
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\CopyCommand.cs", "C#", 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 46
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\DiskInfoCommand.cs", "C#", 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 33
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\FindCommand.cs", "C#", 37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 42
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\HeadCommand.cs", "C#", 46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 54
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\LsCommand.cs", "C#", 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 11
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\MkdirCommand.cs", "C#", 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 22
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\MoveCommand.cs", "C#", 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 48
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\PwdCommand.cs", "C#", 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 13
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\RenameCommand.cs", "C#", 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 57
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\RmCommand.cs", "C#", 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 66
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\RmdirCommand.cs", "C#", 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 30
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\TailCommand.cs", "C#", 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 55
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\TouchCommand.cs", "C#", 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 28
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\TreeCommand.cs", "C#", 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 78
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\WordCountCommand.cs", "C#", 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 51
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Help\Help.cs", "C#", 554, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 583
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Info\About.cs", "C#", 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 14
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Info\Version.cs", "C#", 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 25
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\LabyrinthCommand.cs", "C#", 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 248
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Power\RestartCommand.cs", "C#", 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 15
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Power\ShutdownCommand.cs", "C#", 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 15
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Script\BransweCommand.cs", "C#", 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 48
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Script\ClaCommand.cs", "C#", 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 83
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Script\ComCommand.cs", "C#", 54, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 63
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Script\Lua2ClaCommand.cs", "C#", 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 71
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Script\LuaCommand.cs", "C#", 230, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 257
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\ClearCommand.cs", "C#", 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 13
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\DateCommand.cs", "C#", 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 13
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\EchoCommand.cs", "C#", 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 14
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\KillCommand.cs", "C#", 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 58
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\PsCommand.cs", "C#", 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 58
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\SettingsCommand.cs", "C#", 74, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 82
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\TimeCommand.cs", "C#", 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 13
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\UptimeCommand.cs", "C#", 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 46
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\WhoamiCommand.cs", "C#", 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 18
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\TestGuiCommand.cs", "C#", 77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 86
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\TestTUICommand.cs", "C#", 583, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 102, 685
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\User\CpassCommand.cs", "C#", 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 11
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\User\HostnameCommand.cs", "C#", 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 31
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\User\UserCommand.cs", "C#", 114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 128
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\AliasCommand.cs", "C#", 140, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 159
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\AppManagerCommand.cs", "C#", 165, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 195
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\BackgroundCommand.cs", "C#", 108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 117
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\Base64Command.cs", "C#", 89, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 101
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\BeepCommand.cs", "C#", 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 13
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\CalcCommand.cs", "C#", 56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 60
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\CalcGuiCommand.cs", "C#", 307, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 335
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\CalendarCommand.cs", "C#", 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 70
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\HexCommand.cs", "C#", 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 50
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\HexEditor.cs", "C#", 234, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 259
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\HistoryCommand.cs", "C#", 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 17
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\MatrixCommand.cs", "C#", 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 75
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\PromptCommand.cs", "C#", 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 20
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\SnakeCommand.cs", "C#", 164, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 191
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Shell.cs", "C#", 1509, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 271, 1799
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\UsageGenerator.cs", "C#", 211, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 242
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\System\FileSystem.cs", "C#", 493, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 63, 574
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\System\Process.cs", "C#", 164, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 184
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\System\ProcessManager.cs", "C#", 77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 92
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\System\ShellProcess.cs", "C#", 53, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 64
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\System\UserSystem.cs", "C#", 736, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 111, 858
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\UI\CUI.cs", "C#", 122, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 28, 158
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\UI\Components.cs", "C#", 960, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 144, 1104
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\UI\TUI.cs", "C#", 260, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 42, 304
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\UI\TUIDemo.cs", "C#", 279, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 333
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Utils\Base64.cs", "C#", 86, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56, 22, 164
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Utils\EnvironmentVariableManager.cs", "C#", 151, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 17, 173
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Utils\NetworkConfigManager.cs", "C#", 111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 127
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Utils\SHA256.cs", "C#", 179, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 41, 226
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Utils\Version.cs", "C#", 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 34
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\@vue_devtools-api.js", "JavaScript", 0, 0, 0, 0, 0, 0, 0, 0, 0, 4356, 0, 145, 5, 4506
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\@vuepress_shared.js", "JavaScript", 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 0, 2, 1, 137
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\_metadata.json", "JSON", 0, 0, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 0, 37
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\chunk-OARA6QKZ.js", "JavaScript", 0, 0, 0, 0, 0, 0, 0, 0, 0, 12582, 0, 238, 5, 12825
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\package.json", "JSON", 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 1, 4
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\vue-router.js", "JavaScript", 0, 0, 0, 0, 0, 0, 0, 0, 0, 2371, 0, 25, 9, 2405
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\vue.js", "JavaScript", 0, 0, 0, 0, 0, 0, 0, 0, 0, 346, 0, 0, 1, 347
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\config.js", "JavaScript", 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 1, 7, 20
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\404.html", "HTML", 0, 0, 0, 0, 0, 0, 0, 0, 40, 0, 0, 0, 4, 44
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\404.html-ByTdGTSm.js", "JavaScript", 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 2
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\app-C1vKFkGc.js", "JavaScript", 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 4, 1, 33
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\commands.html-DsR2axk8.js", "JavaScript", 0, 0, 0, 0, 0, 0, 0, 0, 0, 153, 0, 0, 1, 154
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\get-started.html-CfHiKCXZ.js", "JavaScript", 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 2
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\index.html-BMbDjf_W.js", "JavaScript", 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 2
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\lua.html-3_L4TJjQ.js", "JavaScript", 0, 0, 0, 0, 0, 0, 0, 0, 0, 303, 0, 0, 1, 304
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\style-BmL0kmLr.css", "PostCSS", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 2
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\commands.html", "HTML", 0, 0, 0, 0, 0, 0, 0, 0, 192, 0, 0, 0, 4, 196
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\get-started.html", "HTML", 0, 0, 0, 0, 0, 0, 0, 0, 40, 0, 0, 0, 4, 44
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\index.html", "HTML", 0, 0, 0, 0, 0, 0, 0, 0, 40, 0, 0, 0, 4, 44
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\lua.html", "HTML", 0, 0, 0, 0, 0, 0, 0, 0, 342, 0, 0, 0, 4, 346
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\README.md", "Markdown", 0, 0, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 37
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\commands.md", "Markdown", 0, 0, 742, 0, 0, 0, 0, 0, 0, 0, 0, 0, 215, 957
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\get-started.md", "Markdown", 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 20
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\lua.md", "Markdown", 0, 0, 996, 0, 0, 0, 0, 0, 0, 0, 0, 0, 356, 1352
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\package.json", "JSON", 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 1, 21
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\pnpm-lock.yaml", "YAML", 0, 0, 0, 0, 0, 0, 0, 2410, 0, 0, 0, 0, 674, 3084
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\global.json", "JSON", 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 6
|
||||
"Total", "-", 25917, 25, 2535, 1, 88, 66, 96, 2410, 654, 20288, 1, 1281, 5298, 58660
|
||||
|
1
.VSCodeCounter/2026-02-28_22-08-29/results.json
Normal file
68
.VSCodeCounter/2026-02-28_22-08-29/results.md
Normal file
@@ -0,0 +1,68 @@
|
||||
# Summary
|
||||
|
||||
Date : 2026-02-28 22:08:29
|
||||
|
||||
Directory c:\\Users\\leon\\source\\repos\\CMLeonOS\\CMLeonOS
|
||||
|
||||
Total : 156 files, 52081 codes, 1281 comments, 5298 blanks, all 58660 lines
|
||||
|
||||
Summary / [Details](details.md) / [Diff Summary](diff.md) / [Diff Details](diff-details.md)
|
||||
|
||||
## Languages
|
||||
| language | files | code | comment | blank | total |
|
||||
| :--- | ---: | ---: | ---: | ---: | ---: |
|
||||
| C# | 119 | 25,917 | 863 | 3,782 | 30,562 |
|
||||
| JavaScript | 12 | 20,288 | 415 | 34 | 20,737 |
|
||||
| Markdown | 7 | 2,535 | 0 | 756 | 3,291 |
|
||||
| YAML | 1 | 2,410 | 0 | 674 | 3,084 |
|
||||
| HTML | 5 | 654 | 0 | 20 | 674 |
|
||||
| Lua | 3 | 96 | 1 | 11 | 108 |
|
||||
| XML | 1 | 88 | 1 | 14 | 103 |
|
||||
| JSON | 4 | 66 | 0 | 2 | 68 |
|
||||
| PowerShell | 2 | 25 | 0 | 4 | 29 |
|
||||
| Batch | 1 | 1 | 1 | 0 | 2 |
|
||||
| PostCSS | 1 | 1 | 0 | 1 | 2 |
|
||||
|
||||
## Directories
|
||||
| path | files | code | comment | blank | total |
|
||||
| :--- | ---: | ---: | ---: | ---: | ---: |
|
||||
| . | 156 | 52,081 | 1,281 | 5,298 | 58,660 |
|
||||
| . (Files) | 11 | 1,403 | 91 | 297 | 1,791 |
|
||||
| Editor | 2 | 1,606 | 45 | 195 | 1,846 |
|
||||
| Interpreter | 34 | 13,167 | 604 | 1,958 | 15,729 |
|
||||
| Interpreter (Files) | 1 | 482 | 28 | 53 | 563 |
|
||||
| Interpreter\\UniLua | 33 | 12,685 | 576 | 1,905 | 15,166 |
|
||||
| Logger | 3 | 146 | 0 | 24 | 170 |
|
||||
| LuaApps | 3 | 96 | 1 | 11 | 108 |
|
||||
| Settings | 1 | 160 | 0 | 18 | 178 |
|
||||
| Shell | 62 | 6,604 | 19 | 895 | 7,518 |
|
||||
| Shell (Files) | 3 | 1,952 | 19 | 303 | 2,274 |
|
||||
| Shell\\Commands | 59 | 4,652 | 0 | 592 | 5,244 |
|
||||
| Shell\\Commands (Files) | 3 | 884 | 0 | 135 | 1,019 |
|
||||
| Shell\\Commands\\Editor | 2 | 48 | 0 | 6 | 54 |
|
||||
| Shell\\Commands\\Environment | 1 | 175 | 0 | 10 | 185 |
|
||||
| Shell\\Commands\\FileSystem | 17 | 580 | 0 | 85 | 665 |
|
||||
| Shell\\Commands\\Help | 1 | 554 | 0 | 29 | 583 |
|
||||
| Shell\\Commands\\Info | 2 | 34 | 0 | 5 | 39 |
|
||||
| Shell\\Commands\\Power | 2 | 26 | 0 | 4 | 30 |
|
||||
| Shell\\Commands\\Script | 5 | 453 | 0 | 69 | 522 |
|
||||
| Shell\\Commands\\System | 9 | 276 | 0 | 39 | 315 |
|
||||
| Shell\\Commands\\User | 3 | 151 | 0 | 19 | 170 |
|
||||
| Shell\\Commands\\Utility | 14 | 1,471 | 0 | 191 | 1,662 |
|
||||
| System | 5 | 1,523 | 29 | 220 | 1,772 |
|
||||
| UI | 4 | 1,621 | 10 | 268 | 1,899 |
|
||||
| Utils | 5 | 555 | 67 | 102 | 724 |
|
||||
| docs | 26 | 25,200 | 415 | 1,310 | 26,925 |
|
||||
| docs\\cmleonos | 26 | 25,200 | 415 | 1,310 | 26,925 |
|
||||
| docs\\cmleonos (Files) | 2 | 2,430 | 0 | 675 | 3,105 |
|
||||
| docs\\cmleonos\\docs | 24 | 22,770 | 415 | 635 | 23,820 |
|
||||
| docs\\cmleonos\\docs (Files) | 4 | 1,787 | 0 | 579 | 2,366 |
|
||||
| docs\\cmleonos\\docs\\.vuepress | 20 | 20,983 | 415 | 56 | 21,454 |
|
||||
| docs\\cmleonos\\docs\\.vuepress (Files) | 1 | 12 | 1 | 7 | 20 |
|
||||
| docs\\cmleonos\\docs\\.vuepress\\.cache | 7 | 19,829 | 410 | 22 | 20,261 |
|
||||
| docs\\cmleonos\\docs\\.vuepress\\.cache\\deps | 7 | 19,829 | 410 | 22 | 20,261 |
|
||||
| docs\\cmleonos\\docs\\.vuepress\\dist | 12 | 1,142 | 4 | 27 | 1,173 |
|
||||
| docs\\cmleonos\\docs\\.vuepress\\dist (Files) | 5 | 654 | 0 | 20 | 674 |
|
||||
| docs\\cmleonos\\docs\\.vuepress\\dist\\assets | 7 | 488 | 4 | 7 | 499 |
|
||||
|
||||
Summary / [Details](details.md) / [Diff Summary](diff.md) / [Diff Details](diff-details.md)
|
||||
227
.VSCodeCounter/2026-02-28_22-08-29/results.txt
Normal file
@@ -0,0 +1,227 @@
|
||||
Date : 2026-02-28 22:08:29
|
||||
Directory : c:\Users\leon\source\repos\CMLeonOS\CMLeonOS
|
||||
Total : 156 files, 52081 codes, 1281 comments, 5298 blanks, all 58660 lines
|
||||
|
||||
Languages
|
||||
+------------+------------+------------+------------+------------+------------+
|
||||
| language | files | code | comment | blank | total |
|
||||
+------------+------------+------------+------------+------------+------------+
|
||||
| C# | 119 | 25,917 | 863 | 3,782 | 30,562 |
|
||||
| JavaScript | 12 | 20,288 | 415 | 34 | 20,737 |
|
||||
| Markdown | 7 | 2,535 | 0 | 756 | 3,291 |
|
||||
| YAML | 1 | 2,410 | 0 | 674 | 3,084 |
|
||||
| HTML | 5 | 654 | 0 | 20 | 674 |
|
||||
| Lua | 3 | 96 | 1 | 11 | 108 |
|
||||
| XML | 1 | 88 | 1 | 14 | 103 |
|
||||
| JSON | 4 | 66 | 0 | 2 | 68 |
|
||||
| PowerShell | 2 | 25 | 0 | 4 | 29 |
|
||||
| Batch | 1 | 1 | 1 | 0 | 2 |
|
||||
| PostCSS | 1 | 1 | 0 | 1 | 2 |
|
||||
+------------+------------+------------+------------+------------+------------+
|
||||
|
||||
Directories
|
||||
+--------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
|
||||
| path | files | code | comment | blank | total |
|
||||
+--------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
|
||||
| . | 156 | 52,081 | 1,281 | 5,298 | 58,660 |
|
||||
| . (Files) | 11 | 1,403 | 91 | 297 | 1,791 |
|
||||
| Editor | 2 | 1,606 | 45 | 195 | 1,846 |
|
||||
| Interpreter | 34 | 13,167 | 604 | 1,958 | 15,729 |
|
||||
| Interpreter (Files) | 1 | 482 | 28 | 53 | 563 |
|
||||
| Interpreter\UniLua | 33 | 12,685 | 576 | 1,905 | 15,166 |
|
||||
| Logger | 3 | 146 | 0 | 24 | 170 |
|
||||
| LuaApps | 3 | 96 | 1 | 11 | 108 |
|
||||
| Settings | 1 | 160 | 0 | 18 | 178 |
|
||||
| Shell | 62 | 6,604 | 19 | 895 | 7,518 |
|
||||
| Shell (Files) | 3 | 1,952 | 19 | 303 | 2,274 |
|
||||
| Shell\Commands | 59 | 4,652 | 0 | 592 | 5,244 |
|
||||
| Shell\Commands (Files) | 3 | 884 | 0 | 135 | 1,019 |
|
||||
| Shell\Commands\Editor | 2 | 48 | 0 | 6 | 54 |
|
||||
| Shell\Commands\Environment | 1 | 175 | 0 | 10 | 185 |
|
||||
| Shell\Commands\FileSystem | 17 | 580 | 0 | 85 | 665 |
|
||||
| Shell\Commands\Help | 1 | 554 | 0 | 29 | 583 |
|
||||
| Shell\Commands\Info | 2 | 34 | 0 | 5 | 39 |
|
||||
| Shell\Commands\Power | 2 | 26 | 0 | 4 | 30 |
|
||||
| Shell\Commands\Script | 5 | 453 | 0 | 69 | 522 |
|
||||
| Shell\Commands\System | 9 | 276 | 0 | 39 | 315 |
|
||||
| Shell\Commands\User | 3 | 151 | 0 | 19 | 170 |
|
||||
| Shell\Commands\Utility | 14 | 1,471 | 0 | 191 | 1,662 |
|
||||
| System | 5 | 1,523 | 29 | 220 | 1,772 |
|
||||
| UI | 4 | 1,621 | 10 | 268 | 1,899 |
|
||||
| Utils | 5 | 555 | 67 | 102 | 724 |
|
||||
| docs | 26 | 25,200 | 415 | 1,310 | 26,925 |
|
||||
| docs\cmleonos | 26 | 25,200 | 415 | 1,310 | 26,925 |
|
||||
| docs\cmleonos (Files) | 2 | 2,430 | 0 | 675 | 3,105 |
|
||||
| docs\cmleonos\docs | 24 | 22,770 | 415 | 635 | 23,820 |
|
||||
| docs\cmleonos\docs (Files) | 4 | 1,787 | 0 | 579 | 2,366 |
|
||||
| docs\cmleonos\docs\.vuepress | 20 | 20,983 | 415 | 56 | 21,454 |
|
||||
| docs\cmleonos\docs\.vuepress (Files) | 1 | 12 | 1 | 7 | 20 |
|
||||
| docs\cmleonos\docs\.vuepress\.cache | 7 | 19,829 | 410 | 22 | 20,261 |
|
||||
| docs\cmleonos\docs\.vuepress\.cache\deps | 7 | 19,829 | 410 | 22 | 20,261 |
|
||||
| docs\cmleonos\docs\.vuepress\dist | 12 | 1,142 | 4 | 27 | 1,173 |
|
||||
| docs\cmleonos\docs\.vuepress\dist (Files) | 5 | 654 | 0 | 20 | 674 |
|
||||
| docs\cmleonos\docs\.vuepress\dist\assets | 7 | 488 | 4 | 7 | 499 |
|
||||
+--------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
|
||||
|
||||
Files
|
||||
+--------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
|
||||
| filename | language | code | comment | blank | total |
|
||||
+--------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\BootMenu.cs | C# | 131 | 2 | 25 | 158 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Branswe.md | Markdown | 261 | 0 | 67 | 328 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Build.bat | Batch | 1 | 1 | 0 | 2 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\BuildTime.ps1 | PowerShell | 3 | 0 | 1 | 4 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\CMLeonOS.csproj | XML | 88 | 1 | 14 | 103 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Editor\Editor.cs | C# | 267 | 29 | 35 | 331 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Editor\Nano.cs | C# | 1,339 | 16 | 160 | 1,515 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\GenerateGitCommit.ps1 | PowerShell | 22 | 0 | 3 | 25 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\Branswe.cs | C# | 482 | 28 | 53 | 563 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\ByteString.cs | C# | 41 | 0 | 7 | 48 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Coder.cs | C# | 1,101 | 26 | 157 | 1,284 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Common.cs | C# | 99 | 3 | 27 | 129 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Do.cs | C# | 269 | 25 | 50 | 344 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Dump.cs | C# | 187 | 0 | 33 | 220 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LLex.cs | C# | 627 | 40 | 93 | 760 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaAPI.cs | C# | 1,335 | 64 | 240 | 1,639 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaAuxLib.cs | C# | 643 | 21 | 92 | 756 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaBaseLib.cs | C# | 406 | 9 | 43 | 458 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaBitLib.cs | C# | 179 | 0 | 26 | 205 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaCoroLib.cs | C# | 137 | 0 | 16 | 153 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaDebug.cs | C# | 443 | 19 | 55 | 517 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaDebugLib.cs | C# | 20 | 0 | 6 | 26 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaEncLib.cs | C# | 51 | 0 | 13 | 64 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaFile.cs | C# | 115 | 2 | 18 | 135 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaFunc.cs | C# | 69 | 6 | 20 | 95 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaIOLib.cs | C# | 70 | 12 | 19 | 101 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaJsonLib.cs | C# | 461 | 0 | 65 | 526 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaMathLib.cs | C# | 285 | 10 | 49 | 344 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaObject.cs | C# | 367 | 1 | 52 | 420 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaOsLib.cs | C# | 316 | 0 | 50 | 366 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaPkgLib.cs | C# | 256 | 57 | 47 | 360 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaState.cs | C# | 250 | 6 | 51 | 307 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaStrLib.cs | C# | 869 | 8 | 61 | 938 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaTable.cs | C# | 465 | 37 | 80 | 582 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaTableLib.cs | C# | 250 | 8 | 24 | 282 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\OpCodes.cs | C# | 131 | 7 | 27 | 165 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Parser.cs | C# | 1,588 | 139 | 219 | 1,946 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\TagMethod.cs | C# | 91 | 2 | 10 | 103 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\ULDebug.cs | C# | 13 | 2 | 5 | 20 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Undump.cs | C# | 321 | 6 | 50 | 377 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Util.cs | C# | 192 | 8 | 39 | 239 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\VM.cs | C# | 1,038 | 58 | 161 | 1,257 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Kernel.cs | C# | 391 | 87 | 74 | 552 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\LISENCE.md | Markdown | 485 | 0 | 110 | 595 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Logger\LogEntry.cs | C# | 41 | 0 | 5 | 46 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Logger\LogLevel.cs | C# | 11 | 0 | 1 | 12 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Logger\Logger.cs | C# | 94 | 0 | 18 | 112 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\LuaApps.cs | C# | 13 | 0 | 3 | 16 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\LuaApps\calculator.lua | Lua | 87 | 0 | 11 | 98 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\LuaApps\helloworld.lua | Lua | 3 | 0 | 0 | 3 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\LuaApps\testspeed.lua | Lua | 6 | 1 | 0 | 7 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\README.md | Markdown | 2 | 0 | 0 | 2 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Settings\Settings.cs | C# | 160 | 0 | 18 | 178 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\CommandList.cs | C# | 232 | 0 | 1 | 233 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Editor\EditCommand.cs | C# | 24 | 0 | 3 | 27 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Editor\NanoCommand.cs | C# | 24 | 0 | 3 | 27 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Environment\EnvCommand.cs | C# | 175 | 0 | 10 | 185 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\CatCommand.cs | C# | 18 | 0 | 2 | 20 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\CdCommand.cs | C# | 10 | 0 | 1 | 11 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\CopyCommand.cs | C# | 40 | 0 | 6 | 46 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\DiskInfoCommand.cs | C# | 28 | 0 | 5 | 33 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\FindCommand.cs | C# | 37 | 0 | 5 | 42 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\HeadCommand.cs | C# | 46 | 0 | 8 | 54 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\LsCommand.cs | C# | 10 | 0 | 1 | 11 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\MkdirCommand.cs | C# | 20 | 0 | 2 | 22 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\MoveCommand.cs | C# | 41 | 0 | 7 | 48 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\PwdCommand.cs | C# | 11 | 0 | 2 | 13 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\RenameCommand.cs | C# | 48 | 0 | 9 | 57 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\RmCommand.cs | C# | 60 | 0 | 6 | 66 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\RmdirCommand.cs | C# | 27 | 0 | 3 | 30 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\TailCommand.cs | C# | 47 | 0 | 8 | 55 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\TouchCommand.cs | C# | 25 | 0 | 3 | 28 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\TreeCommand.cs | C# | 67 | 0 | 11 | 78 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\WordCountCommand.cs | C# | 45 | 0 | 6 | 51 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Help\Help.cs | C# | 554 | 0 | 29 | 583 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Info\About.cs | C# | 12 | 0 | 2 | 14 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Info\Version.cs | C# | 22 | 0 | 3 | 25 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\LabyrinthCommand.cs | C# | 224 | 0 | 24 | 248 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Power\RestartCommand.cs | C# | 13 | 0 | 2 | 15 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Power\ShutdownCommand.cs | C# | 13 | 0 | 2 | 15 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Script\BransweCommand.cs | C# | 42 | 0 | 6 | 48 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Script\ClaCommand.cs | C# | 69 | 0 | 14 | 83 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Script\ComCommand.cs | C# | 54 | 0 | 9 | 63 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Script\Lua2ClaCommand.cs | C# | 58 | 0 | 13 | 71 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Script\LuaCommand.cs | C# | 230 | 0 | 27 | 257 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\ClearCommand.cs | C# | 11 | 0 | 2 | 13 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\DateCommand.cs | C# | 11 | 0 | 2 | 13 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\EchoCommand.cs | C# | 12 | 0 | 2 | 14 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\KillCommand.cs | C# | 50 | 0 | 8 | 58 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\PsCommand.cs | C# | 51 | 0 | 7 | 58 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\SettingsCommand.cs | C# | 74 | 0 | 8 | 82 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\TimeCommand.cs | C# | 11 | 0 | 2 | 13 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\UptimeCommand.cs | C# | 40 | 0 | 6 | 46 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\WhoamiCommand.cs | C# | 16 | 0 | 2 | 18 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\TestGuiCommand.cs | C# | 77 | 0 | 9 | 86 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\TestTUICommand.cs | C# | 583 | 0 | 102 | 685 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\User\CpassCommand.cs | C# | 10 | 0 | 1 | 11 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\User\HostnameCommand.cs | C# | 27 | 0 | 4 | 31 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\User\UserCommand.cs | C# | 114 | 0 | 14 | 128 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\AliasCommand.cs | C# | 140 | 0 | 19 | 159 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\AppManagerCommand.cs | C# | 165 | 0 | 30 | 195 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\BackgroundCommand.cs | C# | 108 | 0 | 9 | 117 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\Base64Command.cs | C# | 89 | 0 | 12 | 101 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\BeepCommand.cs | C# | 11 | 0 | 2 | 13 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\CalcCommand.cs | C# | 56 | 0 | 4 | 60 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\CalcGuiCommand.cs | C# | 307 | 0 | 28 | 335 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\CalendarCommand.cs | C# | 57 | 0 | 13 | 70 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\HexCommand.cs | C# | 45 | 0 | 5 | 50 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\HexEditor.cs | C# | 234 | 0 | 25 | 259 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\HistoryCommand.cs | C# | 15 | 0 | 2 | 17 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\MatrixCommand.cs | C# | 62 | 0 | 13 | 75 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\PromptCommand.cs | C# | 18 | 0 | 2 | 20 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\SnakeCommand.cs | C# | 164 | 0 | 27 | 191 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Shell.cs | C# | 1,509 | 19 | 271 | 1,799 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\UsageGenerator.cs | C# | 211 | 0 | 31 | 242 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\System\FileSystem.cs | C# | 493 | 18 | 63 | 574 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\System\Process.cs | C# | 164 | 0 | 20 | 184 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\System\ProcessManager.cs | C# | 77 | 0 | 15 | 92 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\System\ShellProcess.cs | C# | 53 | 0 | 11 | 64 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\System\UserSystem.cs | C# | 736 | 11 | 111 | 858 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\UI\CUI.cs | C# | 122 | 8 | 28 | 158 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\UI\Components.cs | C# | 960 | 0 | 144 | 1,104 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\UI\TUI.cs | C# | 260 | 2 | 42 | 304 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\UI\TUIDemo.cs | C# | 279 | 0 | 54 | 333 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Utils\Base64.cs | C# | 86 | 56 | 22 | 164 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Utils\EnvironmentVariableManager.cs | C# | 151 | 5 | 17 | 173 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Utils\NetworkConfigManager.cs | C# | 111 | 0 | 16 | 127 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Utils\SHA256.cs | C# | 179 | 6 | 41 | 226 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Utils\Version.cs | C# | 28 | 0 | 6 | 34 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\@vue_devtools-api.js | JavaScript | 4,356 | 145 | 5 | 4,506 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\@vuepress_shared.js | JavaScript | 134 | 2 | 1 | 137 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\_metadata.json | JSON | 37 | 0 | 0 | 37 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\chunk-OARA6QKZ.js | JavaScript | 12,582 | 238 | 5 | 12,825 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\package.json | JSON | 3 | 0 | 1 | 4 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\vue-router.js | JavaScript | 2,371 | 25 | 9 | 2,405 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\vue.js | JavaScript | 346 | 0 | 1 | 347 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\config.js | JavaScript | 12 | 1 | 7 | 20 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\404.html | HTML | 40 | 0 | 4 | 44 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\404.html-ByTdGTSm.js | JavaScript | 1 | 0 | 1 | 2 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\app-C1vKFkGc.js | JavaScript | 28 | 4 | 1 | 33 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\commands.html-DsR2axk8.js | JavaScript | 153 | 0 | 1 | 154 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\get-started.html-CfHiKCXZ.js | JavaScript | 1 | 0 | 1 | 2 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\index.html-BMbDjf_W.js | JavaScript | 1 | 0 | 1 | 2 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\lua.html-3_L4TJjQ.js | JavaScript | 303 | 0 | 1 | 304 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\style-BmL0kmLr.css | PostCSS | 1 | 0 | 1 | 2 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\commands.html | HTML | 192 | 0 | 4 | 196 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\get-started.html | HTML | 40 | 0 | 4 | 44 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\index.html | HTML | 40 | 0 | 4 | 44 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\lua.html | HTML | 342 | 0 | 4 | 346 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\README.md | Markdown | 33 | 0 | 4 | 37 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\commands.md | Markdown | 742 | 0 | 215 | 957 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\get-started.md | Markdown | 16 | 0 | 4 | 20 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\lua.md | Markdown | 996 | 0 | 356 | 1,352 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\package.json | JSON | 20 | 0 | 1 | 21 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\pnpm-lock.yaml | YAML | 2,410 | 0 | 674 | 3,084 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\global.json | JSON | 6 | 0 | 0 | 6 |
|
||||
| Total | | 52,081 | 1,281 | 5,298 | 58,660 |
|
||||
+--------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
|
||||
2
.gitignore
vendored
@@ -56,3 +56,5 @@ coverage/
|
||||
|
||||
# Release files
|
||||
*.release
|
||||
|
||||
main.map
|
||||
59
BootMenu.cs
@@ -3,18 +3,24 @@ using Sys = Cosmos.System;
|
||||
using Cosmos.HAL;
|
||||
using Cosmos.Core;
|
||||
using System.Threading;
|
||||
using System.IO;
|
||||
|
||||
namespace CMLeonOS
|
||||
{
|
||||
public enum BootMenuAction
|
||||
{
|
||||
NormalBoot,
|
||||
GuiBoot,
|
||||
Reboot,
|
||||
Shutdown
|
||||
}
|
||||
|
||||
internal static class BootMenu
|
||||
{
|
||||
private static bool UserDatExists()
|
||||
{
|
||||
return File.Exists(@"0:\system\user.dat");
|
||||
}
|
||||
private static void PrintOption(string text, bool selected)
|
||||
{
|
||||
Console.SetCursorPosition(1, Console.GetCursorPosition().Top);
|
||||
@@ -34,8 +40,6 @@ namespace CMLeonOS
|
||||
|
||||
uint mem = Cosmos.Core.CPU.GetAmountOfRAM();
|
||||
Console.WriteLine($"{Version.DisplayVersion} [{mem} MB memory]");
|
||||
// 这里老显示 unknown,谁知道为啥
|
||||
// Console.WriteLine($"Git Commit: {Version.GitCommit}");
|
||||
Console.WriteLine($"Build Time: {GetBuildTime()}");
|
||||
Console.WriteLine();
|
||||
Console.WriteLine($"Auto-select in {remainingTime} seconds...");
|
||||
@@ -43,9 +47,16 @@ namespace CMLeonOS
|
||||
Console.WriteLine("Select an option:");
|
||||
Console.WriteLine();
|
||||
|
||||
PrintOption("Normal Boot", selIdx == 0);
|
||||
PrintOption("Reboot", selIdx == 1);
|
||||
PrintOption("Shutdown", selIdx == 2);
|
||||
bool userDatExists = UserDatExists();
|
||||
int optionIndex = 0;
|
||||
|
||||
PrintOption("Normal Boot", selIdx == optionIndex++);
|
||||
if (userDatExists)
|
||||
{
|
||||
PrintOption("GUI Boot", selIdx == optionIndex++);
|
||||
}
|
||||
PrintOption("Reboot", selIdx == optionIndex++);
|
||||
PrintOption("Shutdown", selIdx == optionIndex++);
|
||||
}
|
||||
|
||||
private static BootMenuAction Confirm(int selIdx)
|
||||
@@ -59,19 +70,29 @@ namespace CMLeonOS
|
||||
|
||||
Console.CursorVisible = true;
|
||||
|
||||
switch (selIdx)
|
||||
bool userDatExists = UserDatExists();
|
||||
int optionIndex = 0;
|
||||
|
||||
if (selIdx == optionIndex++)
|
||||
{
|
||||
case 0:
|
||||
return BootMenuAction.NormalBoot;
|
||||
case 1:
|
||||
Sys.Power.Reboot();
|
||||
return BootMenuAction.Reboot;
|
||||
case 2:
|
||||
Sys.Power.Shutdown();
|
||||
return BootMenuAction.Shutdown;
|
||||
default:
|
||||
return BootMenuAction.NormalBoot;
|
||||
return BootMenuAction.NormalBoot;
|
||||
}
|
||||
if (userDatExists && selIdx == optionIndex++)
|
||||
{
|
||||
return BootMenuAction.GuiBoot;
|
||||
}
|
||||
if (selIdx == optionIndex++)
|
||||
{
|
||||
Sys.Power.Reboot();
|
||||
return BootMenuAction.Reboot;
|
||||
}
|
||||
if (selIdx == optionIndex++)
|
||||
{
|
||||
Sys.Power.Shutdown();
|
||||
return BootMenuAction.Shutdown;
|
||||
}
|
||||
|
||||
return BootMenuAction.NormalBoot;
|
||||
}
|
||||
|
||||
public static BootMenuAction Show()
|
||||
@@ -127,12 +148,14 @@ namespace CMLeonOS
|
||||
}
|
||||
}
|
||||
|
||||
int maxOptionIndex = UserDatExists() ? 3 : 2;
|
||||
|
||||
if (selIdx < 0)
|
||||
{
|
||||
selIdx = 2;
|
||||
selIdx = maxOptionIndex;
|
||||
}
|
||||
|
||||
if (selIdx > 2)
|
||||
if (selIdx > maxOptionIndex)
|
||||
{
|
||||
selIdx = 0;
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
2026-02-25 15:29:49
|
||||
2026-03-03 21:19:17
|
||||
@@ -1,4 +1,4 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
@@ -20,15 +20,17 @@
|
||||
<Description>Use VMware Player or Workstation to deploy and debug.</Description>
|
||||
<PxeInterface>192.168.0.8</PxeInterface>
|
||||
<CompressionType>Gzip</CompressionType>
|
||||
<BinFormat>Elf</BinFormat>
|
||||
<BinFormat>Bin</BinFormat>
|
||||
<DebugEnabled>False</DebugEnabled>
|
||||
<CompileVBEMultiboot>False</CompileVBEMultiboot>
|
||||
<RemoveBootDebugOutput>False</RemoveBootDebugOutput>
|
||||
<RemoveBootDebugOutput>True</RemoveBootDebugOutput>
|
||||
<CosmosDisableDebugger>true</CosmosDisableDebugger>
|
||||
<CosmosDebugLevel>None</CosmosDebugLevel>
|
||||
<OptimizationLevel>2</OptimizationLevel>
|
||||
<VBEResolution>800x600x32</VBEResolution>
|
||||
<RunPostBuildEvent>Always</RunPostBuildEvent>
|
||||
<Timeout>1</Timeout>
|
||||
<UseUEFI>False</UseUEFI>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
@@ -68,7 +70,68 @@
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="font.psf" />
|
||||
<EmbeddedResource Include="Wallpapers\wallpaper.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\AppIcons\Calculator.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\AppIcons\Calendar.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\AppIcons\Clock.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\AppIcons\CodeStudio.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\AppIcons\Default.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\AppIcons\DemoLauncher.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\AppIcons\Demos\Mandelbrot.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\AppIcons\Demos\Starfield.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\AppIcons\Files.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\AppIcons\Info.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\AppIcons\Logs.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\AppIcons\MemoryStatistics.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\AppIcons\Notepad.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\AppIcons\Paint.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\AppIcons\Settings.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\AppIcons\Stopwatch.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\AppIcons\Tasks.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\ButtonBackground.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\Calculator\Display.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\Calculator\GridButton.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\Check.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\Clock\ClockBackground.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\Close.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\CodeStudio\Run.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\CodeStudio\Splash.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\Cursor.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\Dock\StartMenu.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\Files\Directory.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\Files\Drive.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\Files\File.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\Files\File_Config.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\Files\File_Rs.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\Files\File_Text.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\Files\Home.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\Files\Up.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\Lock\Background.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\Lock\Gradient.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\Lock\Key.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\Lock\ShutDown.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\Lock\User.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\Lock\UserArrow.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\Logs\Error.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\Logs\Info.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\Logs\Warning.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\Maximise.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\Minimise.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\Restore.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\ScrollbarDown.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\ScrollbarUp.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\Settings\Admin.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\Settings\Info.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\Settings\User.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\Sounds\Alert.wav" />
|
||||
<EmbeddedResource Include="Gui\Resources\Sounds\Login.wav" />
|
||||
<EmbeddedResource Include="Gui\Resources\Start.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\StartMenu\User.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\SwitchKnob.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\SwitchOff.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\SwitchOn.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\TitlebarBackground.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\WaitCursor.bmp" />
|
||||
<EmbeddedResource Include="Gui\Resources\Wallpaper_1280_800.bmp" />
|
||||
<EmbeddedResource Include="GitCommit.txt" />
|
||||
<EmbeddedResource Include="BuildTime.txt" />
|
||||
<EmbeddedResource Include="LuaApps\*.lua" />
|
||||
@@ -89,7 +152,7 @@
|
||||
<PackageReference Include="Cosmos.System2_Plugs" Version="0.1.0-localbuild20260201071815" />
|
||||
<PackageReference Include="CosmosFtpServer" Version="1.0.9" />
|
||||
<PackageReference Include="CosmosHttp" Version="1.0.4" />
|
||||
<PackageReference Include="IL2CPU.API" Version="0.1.0-localbuild20260203125852" />
|
||||
<PackageReference Include="IL2CPU.API" Version="0.1.0-localbuild20260225062300" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
|
||||
|
||||
@@ -1 +1 @@
|
||||
9b783e0
|
||||
29a68b4
|
||||
36
Gui/App.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using Cosmos.System.Graphics;
|
||||
using CMLeonOS;
|
||||
using System;
|
||||
using System.Drawing;
|
||||
|
||||
namespace CMLeonOS.Gui
|
||||
{
|
||||
internal class AppMetadata
|
||||
{
|
||||
public AppMetadata(string name, Func<Process> createProcess, Bitmap icon, Color themeColor)
|
||||
{
|
||||
Name = name;
|
||||
CreateProcess = createProcess;
|
||||
Icon = icon;
|
||||
ThemeColor = themeColor;
|
||||
}
|
||||
|
||||
internal void Start(Process parent)
|
||||
{
|
||||
ProcessManager.AddProcess(parent, CreateProcess()).Start();
|
||||
}
|
||||
|
||||
internal void Start()
|
||||
{
|
||||
ProcessManager.AddProcess(CreateProcess()).Start();
|
||||
}
|
||||
|
||||
internal string Name { get; private set; }
|
||||
|
||||
internal Func<Process> CreateProcess { get; private set; }
|
||||
|
||||
internal Bitmap Icon { get; private set; }
|
||||
|
||||
internal Color ThemeColor { get; private set; }
|
||||
}
|
||||
}
|
||||
130
Gui/AppManager.cs
Normal file
@@ -0,0 +1,130 @@
|
||||
using Cosmos.System.Graphics;
|
||||
using CMLeonOS.Gui.Apps;
|
||||
using CMLeonOS.Logger;
|
||||
using CMLeonOS.Utils;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
|
||||
namespace CMLeonOS.Gui
|
||||
{
|
||||
internal static class AppManager
|
||||
{
|
||||
internal static List<AppMetadata> AppMetadatas { get; private set; } = new List<AppMetadata>();
|
||||
|
||||
private static bool appsLoaded = false;
|
||||
|
||||
internal static Bitmap DefaultAppIcon
|
||||
{
|
||||
get
|
||||
{
|
||||
return Icons.Icon_Default;
|
||||
}
|
||||
}
|
||||
|
||||
private static class Icons
|
||||
{
|
||||
[IL2CPU.API.Attribs.ManifestResourceStream(ResourceName = "CMLeonOS.Gui.Resources.AppIcons.Default.bmp")]
|
||||
private static byte[] _iconBytes_Default;
|
||||
internal static Bitmap Icon_Default = new Bitmap(_iconBytes_Default);
|
||||
|
||||
[IL2CPU.API.Attribs.ManifestResourceStream(ResourceName = "CMLeonOS.Gui.Resources.AppIcons.Info.bmp")]
|
||||
private static byte[] _iconBytes_Info;
|
||||
internal static Bitmap Icon_Info = new Bitmap(_iconBytes_Info);
|
||||
|
||||
[IL2CPU.API.Attribs.ManifestResourceStream(ResourceName = "CMLeonOS.Gui.Resources.AppIcons.Settings.bmp")]
|
||||
private static byte[] _iconBytes_Settings;
|
||||
internal static Bitmap Icon_Settings = new Bitmap(_iconBytes_Settings);
|
||||
|
||||
[IL2CPU.API.Attribs.ManifestResourceStream(ResourceName = "CMLeonOS.Gui.Resources.AppIcons.Clock.bmp")]
|
||||
private static byte[] _iconBytes_Clock;
|
||||
internal static Bitmap Icon_Clock = new Bitmap(_iconBytes_Clock);
|
||||
|
||||
[IL2CPU.API.Attribs.ManifestResourceStream(ResourceName = "CMLeonOS.Gui.Resources.AppIcons.Tasks.bmp")]
|
||||
private static byte[] _iconBytes_Tasks;
|
||||
internal static Bitmap Icon_Tasks = new Bitmap(_iconBytes_Tasks);
|
||||
|
||||
[IL2CPU.API.Attribs.ManifestResourceStream(ResourceName = "CMLeonOS.Gui.Resources.AppIcons.Calculator.bmp")]
|
||||
private static byte[] _iconBytes_Calculator;
|
||||
internal static Bitmap Icon_Calculator = new Bitmap(_iconBytes_Calculator);
|
||||
|
||||
[IL2CPU.API.Attribs.ManifestResourceStream(ResourceName = "CMLeonOS.Gui.Resources.AppIcons.CodeStudio.bmp")]
|
||||
private static byte[] _iconBytes_CodeStudio;
|
||||
internal static Bitmap Icon_CodeStudio = new Bitmap(_iconBytes_CodeStudio);
|
||||
|
||||
[IL2CPU.API.Attribs.ManifestResourceStream(ResourceName = "CMLeonOS.Gui.Resources.AppIcons.Notepad.bmp")]
|
||||
private static byte[] _iconBytes_Notepad;
|
||||
internal static Bitmap Icon_Notepad = new Bitmap(_iconBytes_Notepad);
|
||||
|
||||
[IL2CPU.API.Attribs.ManifestResourceStream(ResourceName = "CMLeonOS.Gui.Resources.AppIcons.Calendar.bmp")]
|
||||
private static byte[] _iconBytes_Calendar;
|
||||
internal static Bitmap Icon_Calendar = new Bitmap(_iconBytes_Calendar);
|
||||
|
||||
[IL2CPU.API.Attribs.ManifestResourceStream(ResourceName = "CMLeonOS.Gui.Resources.AppIcons.Files.bmp")]
|
||||
private static byte[] _iconBytes_Files;
|
||||
internal static Bitmap Icon_Files = new Bitmap(_iconBytes_Files);
|
||||
|
||||
[IL2CPU.API.Attribs.ManifestResourceStream(ResourceName = "CMLeonOS.Gui.Resources.AppIcons.Logs.bmp")]
|
||||
private static byte[] _iconBytes_Logs;
|
||||
internal static Bitmap Icon_Logs = new Bitmap(_iconBytes_Logs);
|
||||
|
||||
[IL2CPU.API.Attribs.ManifestResourceStream(ResourceName = "CMLeonOS.Gui.Resources.AppIcons.DemoLauncher.bmp")]
|
||||
private static byte[] _iconBytes_DemoLauncher;
|
||||
internal static Bitmap Icon_DemoLauncher = new Bitmap(_iconBytes_DemoLauncher);
|
||||
|
||||
[IL2CPU.API.Attribs.ManifestResourceStream(ResourceName = "CMLeonOS.Gui.Resources.AppIcons.Stopwatch.bmp")]
|
||||
private static byte[] _iconBytes_Stopwatch;
|
||||
internal static Bitmap Icon_Stopwatch = new Bitmap(_iconBytes_Stopwatch);
|
||||
|
||||
[IL2CPU.API.Attribs.ManifestResourceStream(ResourceName = "CMLeonOS.Gui.Resources.AppIcons.Paint.bmp")]
|
||||
private static byte[] _iconBytes_Paint;
|
||||
internal static Bitmap Icon_Paint = new Bitmap(_iconBytes_Paint);
|
||||
|
||||
[IL2CPU.API.Attribs.ManifestResourceStream(ResourceName = "CMLeonOS.Gui.Resources.AppIcons.MemoryStatistics.bmp")]
|
||||
private static byte[] _iconBytes_MemoryStatistics;
|
||||
internal static Bitmap Icon_MemoryStatistics = new Bitmap(_iconBytes_MemoryStatistics);
|
||||
}
|
||||
|
||||
internal static void RegisterApp(AppMetadata app)
|
||||
{
|
||||
AppMetadatas.Add(app);
|
||||
}
|
||||
|
||||
internal static AppMetadata GetAppMetadata(string name)
|
||||
{
|
||||
foreach (AppMetadata app in AppMetadatas)
|
||||
{
|
||||
if (app.Name == name)
|
||||
{
|
||||
return app;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
internal static void LoadAllApps()
|
||||
{
|
||||
if (appsLoaded)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
RegisterApp(new AppMetadata("Files", () => { return new Files(); }, Icons.Icon_Files, Color.FromArgb(25, 84, 97)));
|
||||
RegisterApp(new AppMetadata("Clock", () => { return new Clock(); }, Icons.Icon_Clock, Color.FromArgb(168, 55, 47)));
|
||||
RegisterApp(new AppMetadata("Notepad", () => { return new Notepad(); }, Icons.Icon_Notepad, Color.FromArgb(14, 59, 76)));
|
||||
RegisterApp(new AppMetadata("Settings", () => { return new Apps.Settings(); }, Icons.Icon_Settings, Color.FromArgb(0, 115, 186)));
|
||||
RegisterApp(new AppMetadata("Tasks", () => { return new Tasks(); }, Icons.Icon_Tasks, Color.FromArgb(204, 241, 255)));
|
||||
RegisterApp(new AppMetadata("Calculator", () => { return new Calculator(); }, Icons.Icon_Calculator, Color.FromArgb(0, 115, 186)));
|
||||
RegisterApp(new AppMetadata("Event Log", () => { return new Logs(); }, Icons.Icon_Logs, Color.FromArgb(14, 59, 76)));
|
||||
RegisterApp(new AppMetadata("Demos", () => { return new DemoLauncher(); }, Icons.Icon_DemoLauncher, Color.FromArgb(25, 25, 25)));
|
||||
RegisterApp(new AppMetadata("Info", () => { return new Info(); }, Icons.Icon_Info, Color.FromArgb(0, 115, 186)));
|
||||
RegisterApp(new AppMetadata("Stopwatch", () => { return new Stopwatch(); }, Icons.Icon_Stopwatch, Color.FromArgb(168, 55, 47)));
|
||||
RegisterApp(new AppMetadata("Paint", () => { return new Apps.Paint.Paint(); }, Icons.Icon_Paint, Color.FromArgb(0, 115, 186)));
|
||||
RegisterApp(new AppMetadata("Memory Statistics", () => { return new Apps.MemoryStatistics(); }, Icons.Icon_MemoryStatistics, Color.FromArgb(25, 25, 25)));
|
||||
RegisterApp(new AppMetadata("CodeStudio", () => { return new Apps.CodeStudio.CodeStudio(); }, Icons.Icon_CodeStudio, Color.FromArgb(14, 59, 76)));
|
||||
|
||||
Logger.Logger.Instance.Info("AppManager", $"{AppMetadatas.Count} apps were registered.");
|
||||
|
||||
appsLoaded = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
290
Gui/Apps/Calculator.cs
Normal file
@@ -0,0 +1,290 @@
|
||||
using Cosmos.System.Graphics;
|
||||
using CMLeonOS;
|
||||
using CMLeonOS.Gui.UILib;
|
||||
using System;
|
||||
using System.Drawing;
|
||||
|
||||
namespace CMLeonOS.Gui.Apps
|
||||
{
|
||||
internal class Calculator : Process
|
||||
{
|
||||
internal Calculator() : base("Calculator", ProcessType.Application) { }
|
||||
|
||||
AppWindow window;
|
||||
|
||||
WindowManager wm = ProcessManager.GetProcess<WindowManager>();
|
||||
|
||||
private enum Operator
|
||||
{
|
||||
None,
|
||||
Add,
|
||||
Subtract,
|
||||
Multiply,
|
||||
Divide
|
||||
}
|
||||
|
||||
[IL2CPU.API.Attribs.ManifestResourceStream(ResourceName = "CMLeonOS.Gui.Resources.Calculator.GridButton.bmp")]
|
||||
private static byte[] gridButtonBytes;
|
||||
private static Bitmap gridButtonBitmap = new Bitmap(gridButtonBytes);
|
||||
|
||||
[IL2CPU.API.Attribs.ManifestResourceStream(ResourceName = "CMLeonOS.Gui.Resources.Calculator.Display.bmp")]
|
||||
private static byte[] displayBytes;
|
||||
private static Bitmap displayBitmap = new Bitmap(displayBytes);
|
||||
|
||||
private const int padding = 16;
|
||||
private const int gridButtonSize = 40;
|
||||
private const int resultHeight = 40;
|
||||
|
||||
private long num1 = 0;
|
||||
private long num2 = 0;
|
||||
private Operator op = Operator.None;
|
||||
|
||||
private void RenderGridButton(string text, int x, int y)
|
||||
{
|
||||
int buttonX = (x * gridButtonSize);
|
||||
int buttonY = (y * gridButtonSize) + resultHeight;
|
||||
window.DrawImage(gridButtonBitmap, buttonX, buttonY);
|
||||
window.DrawString(text, Color.Black, buttonX + (gridButtonSize / 2) - ((text.Length * 8) / 2), buttonY + (gridButtonSize / 2) - (16 / 2));
|
||||
}
|
||||
|
||||
private void WindowClick(int x, int y)
|
||||
{
|
||||
int gridX = x / gridButtonSize;
|
||||
int gridY = (y - resultHeight) / gridButtonSize;
|
||||
if (gridY < 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
switch (gridY)
|
||||
{
|
||||
case 0:
|
||||
switch (gridX)
|
||||
{
|
||||
case 0:
|
||||
InputNum("7");
|
||||
break;
|
||||
case 1:
|
||||
InputNum("8");
|
||||
break;
|
||||
case 2:
|
||||
InputNum("9");
|
||||
break;
|
||||
case 3:
|
||||
InputOp(Operator.Add);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
switch (gridX)
|
||||
{
|
||||
case 0:
|
||||
InputNum("4");
|
||||
break;
|
||||
case 1:
|
||||
InputNum("5");
|
||||
break;
|
||||
case 2:
|
||||
InputNum("6");
|
||||
break;
|
||||
case 3:
|
||||
InputOp(Operator.Subtract);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
switch (gridX)
|
||||
{
|
||||
case 0:
|
||||
InputNum("1");
|
||||
break;
|
||||
case 1:
|
||||
InputNum("2");
|
||||
break;
|
||||
case 2:
|
||||
InputNum("3");
|
||||
break;
|
||||
case 3:
|
||||
InputOp(Operator.Multiply);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
switch (gridX)
|
||||
{
|
||||
case 0:
|
||||
InputNum("0");
|
||||
break;
|
||||
case 1:
|
||||
InputBksp();
|
||||
break;
|
||||
case 2:
|
||||
InputEquals();
|
||||
break;
|
||||
case 3:
|
||||
InputOp(Operator.Divide);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void RenderDisplay(bool updateWindow = true)
|
||||
{
|
||||
window.DrawImage(displayBitmap, 0, 0);
|
||||
string text;
|
||||
if (op != Operator.None)
|
||||
{
|
||||
char opChar;
|
||||
opChar = op switch
|
||||
{
|
||||
Operator.Add => '+',
|
||||
Operator.Subtract => '-',
|
||||
Operator.Multiply => '*',
|
||||
Operator.Divide => '/',
|
||||
_ => throw new Exception("Unrecognised operator.")
|
||||
};
|
||||
text = num1.ToString().TrimEnd('.') + opChar + num2.ToString().TrimEnd('.');
|
||||
}
|
||||
else
|
||||
{
|
||||
text = num1.ToString().TrimEnd('.');
|
||||
}
|
||||
window.DrawString(text, Color.Black, window.Width - 12 - (text.Length * 8), 12);
|
||||
if (updateWindow)
|
||||
{
|
||||
wm.Update(window);
|
||||
}
|
||||
}
|
||||
|
||||
private void InputNum(string num)
|
||||
{
|
||||
if (op != Operator.None)
|
||||
{
|
||||
num2 = long.Parse(num2.ToString() + num);
|
||||
}
|
||||
else
|
||||
{
|
||||
num1 = long.Parse(num1.ToString() + num);
|
||||
}
|
||||
RenderDisplay();
|
||||
}
|
||||
|
||||
private void InputOp(Operator @operator)
|
||||
{
|
||||
if (op != Operator.None)
|
||||
{
|
||||
num1 = num2;
|
||||
}
|
||||
op = @operator;
|
||||
num2 = 0;
|
||||
RenderDisplay();
|
||||
}
|
||||
|
||||
private void InputBksp()
|
||||
{
|
||||
long num = op != Operator.None ? num2 : num1;
|
||||
string numStr = num.ToString();
|
||||
if (numStr.Length > 1)
|
||||
{
|
||||
num = long.Parse(numStr.Substring(0, numStr.Length - 1));
|
||||
}
|
||||
else
|
||||
{
|
||||
num = 0;
|
||||
}
|
||||
if (op != Operator.None)
|
||||
{
|
||||
num2 = num;
|
||||
}
|
||||
else
|
||||
{
|
||||
num1 = num;
|
||||
}
|
||||
RenderDisplay();
|
||||
}
|
||||
|
||||
private void InputEquals()
|
||||
{
|
||||
if (op == Operator.None) return;
|
||||
|
||||
switch (op)
|
||||
{
|
||||
case Operator.Add:
|
||||
num1 = num1 + num2;
|
||||
break;
|
||||
case Operator.Subtract:
|
||||
num1 = num1 - num2;
|
||||
break;
|
||||
case Operator.Multiply:
|
||||
num1 = num1 * num2;
|
||||
break;
|
||||
case Operator.Divide:
|
||||
if (num2 == 0)
|
||||
{
|
||||
MessageBox messageBox = new MessageBox(this, "Calculator", "Cannot divide by zero.");
|
||||
messageBox.Show();
|
||||
return;
|
||||
}
|
||||
num1 = num1 / num2;
|
||||
break;
|
||||
default:
|
||||
throw new Exception("Unrecognised operator.");
|
||||
}
|
||||
num2 = 0;
|
||||
op = Operator.None;
|
||||
RenderDisplay();
|
||||
}
|
||||
|
||||
private void RenderGridButtons()
|
||||
{
|
||||
RenderGridButton("7", 0, 0);
|
||||
RenderGridButton("8", 1, 0);
|
||||
RenderGridButton("9", 2, 0);
|
||||
RenderGridButton("+", 3, 0);
|
||||
|
||||
RenderGridButton("4", 0, 1);
|
||||
RenderGridButton("5", 1, 1);
|
||||
RenderGridButton("6", 2, 1);
|
||||
RenderGridButton("-", 3, 1);
|
||||
|
||||
RenderGridButton("1", 0, 2);
|
||||
RenderGridButton("2", 1, 2);
|
||||
RenderGridButton("3", 2, 2);
|
||||
RenderGridButton("*", 3, 2);
|
||||
|
||||
RenderGridButton("0", 0, 3);
|
||||
RenderGridButton("<-", 1, 3);
|
||||
RenderGridButton("=", 2, 3);
|
||||
RenderGridButton("/", 3, 3);
|
||||
}
|
||||
|
||||
public override void Start()
|
||||
{
|
||||
base.Start();
|
||||
window = new AppWindow(this, 256, 256, gridButtonSize * 4, (gridButtonSize * 4) + resultHeight);
|
||||
wm.AddWindow(window);
|
||||
|
||||
window.Title = "Calculator";
|
||||
window.Clear(Color.Gray);
|
||||
window.Icon = AppManager.GetAppMetadata("Calculator").Icon;
|
||||
window.OnClick = WindowClick;
|
||||
window.Closing = TryStop;
|
||||
|
||||
/*inputTextBlock = new TextBlock(window, padding / 2, padding / 2, window.Width - padding, resultHeight - padding);
|
||||
inputTextBlock.Background = Color.Gray;
|
||||
inputTextBlock.Foreground = Color.White;
|
||||
wm.AddWindow(inputTextBlock);*/
|
||||
|
||||
RenderDisplay(updateWindow: false);
|
||||
|
||||
RenderGridButtons();
|
||||
|
||||
wm.Update(window);
|
||||
}
|
||||
|
||||
public override void Run()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
88
Gui/Apps/Calendar.cs
Normal file
@@ -0,0 +1,88 @@
|
||||
using CMLeonOS;
|
||||
using CMLeonOS.Gui.UILib;
|
||||
using System;
|
||||
|
||||
namespace CMLeonOS.Gui.Apps
|
||||
{
|
||||
internal class Calendar : Process
|
||||
{
|
||||
internal Calendar() : base("Calendar", ProcessType.Application) { }
|
||||
|
||||
AppWindow window;
|
||||
|
||||
WindowManager wm = ProcessManager.GetProcess<WindowManager>();
|
||||
|
||||
UILib.Calendar cal;
|
||||
|
||||
Button nextButton;
|
||||
|
||||
Button prevButton;
|
||||
|
||||
private void PrevClicked(int x, int y)
|
||||
{
|
||||
if (cal.Month == 1)
|
||||
{
|
||||
cal.SetCalendar(cal.Year - 1, 12);
|
||||
}
|
||||
else
|
||||
{
|
||||
cal.SetCalendar(cal.Year, cal.Month - 1);
|
||||
}
|
||||
}
|
||||
|
||||
private void NextClicked(int x, int y)
|
||||
{
|
||||
if (cal.Month == 12)
|
||||
{
|
||||
|
||||
cal.SetCalendar(cal.Year + 1, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
cal.SetCalendar(cal.Year, cal.Month + 1);
|
||||
}
|
||||
}
|
||||
|
||||
private void WindowResized()
|
||||
{
|
||||
cal.Resize(window.Width, window.Height);
|
||||
|
||||
cal.Render();
|
||||
}
|
||||
|
||||
public override void Start()
|
||||
{
|
||||
base.Start();
|
||||
window = new AppWindow(this, 320, 256, 384, 288);
|
||||
wm.AddWindow(window);
|
||||
window.Title = "Calendar";
|
||||
window.Icon = AppManager.GetAppMetadata("Calendar").Icon;
|
||||
window.CanResize = true;
|
||||
window.UserResized = WindowResized;
|
||||
window.Closing = TryStop;
|
||||
|
||||
cal = new UILib.Calendar(window, 0, 0, window.Width, window.Height);
|
||||
wm.AddWindow(cal);
|
||||
|
||||
DateTime now = DateTime.Now;
|
||||
cal.Year = now.Year;
|
||||
cal.Month = now.Month;
|
||||
|
||||
prevButton = new Button(window, 8, 8, 24, 24);
|
||||
prevButton.Text = "<";
|
||||
prevButton.OnClick = PrevClicked;
|
||||
wm.AddWindow(prevButton);
|
||||
|
||||
nextButton = new Button(window, 40, 8, 24, 24);
|
||||
nextButton.Text = ">";
|
||||
nextButton.OnClick = NextClicked;
|
||||
wm.AddWindow(nextButton);
|
||||
|
||||
wm.Update(window);
|
||||
}
|
||||
|
||||
public override void Run()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
122
Gui/Apps/Clock.cs
Normal file
@@ -0,0 +1,122 @@
|
||||
using Cosmos.System.Graphics;
|
||||
using CMLeonOS;
|
||||
using CMLeonOS.Gui.UILib;
|
||||
using System;
|
||||
using System.Drawing;
|
||||
|
||||
namespace CMLeonOS.Gui.Apps
|
||||
{
|
||||
internal class Clock : Process
|
||||
{
|
||||
internal Clock() : base("Clock", ProcessType.Application) { }
|
||||
|
||||
AppWindow window;
|
||||
|
||||
WindowManager wm = ProcessManager.GetProcess<WindowManager>();
|
||||
|
||||
private int lastSecond = DateTime.Now.Second;
|
||||
|
||||
private SettingsService settingsService;
|
||||
|
||||
[IL2CPU.API.Attribs.ManifestResourceStream(ResourceName = "CMLeonOS.Gui.Resources.Clock.ClockBackground.bmp")]
|
||||
private static byte[] clockBackgroundBytes;
|
||||
private static Bitmap clockBackgroundBitmap = new Bitmap(clockBackgroundBytes);
|
||||
|
||||
private void RenderHand(int originX, int originY, int handLength, double radians, Color color)
|
||||
{
|
||||
int x = originX + (int)(handLength * Math.Sin(radians));
|
||||
int y = originY - (int)(handLength * Math.Cos(radians));
|
||||
window.DrawLine(originX, originY, x, y, color);
|
||||
}
|
||||
|
||||
private void RenderClock()
|
||||
{
|
||||
if (settingsService == null)
|
||||
{
|
||||
settingsService = ProcessManager.GetProcess<SettingsService>();
|
||||
}
|
||||
|
||||
DateTime now = DateTime.Now;
|
||||
|
||||
string timeText;
|
||||
if (settingsService.TwelveHourClock)
|
||||
{
|
||||
timeText = DateTime.Now.ToString("h:mm:ss tt");
|
||||
}
|
||||
else
|
||||
{
|
||||
timeText = DateTime.Now.ToString("HH:mm:ss");
|
||||
}
|
||||
|
||||
int originX = window.Width / 2;
|
||||
int originY = window.Height / 2;
|
||||
int diameter = (int)(Math.Min(window.Width, window.Height) * 0.75f);
|
||||
int radius = diameter / 2;
|
||||
|
||||
/* Background */
|
||||
if (window.Width == 192 && window.Height == 192)
|
||||
{
|
||||
window.DrawImage(clockBackgroundBitmap, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
window.Clear(Color.White);
|
||||
window.DrawCircle(originX, originY, radius, Color.Black);
|
||||
|
||||
for (int i = 1; i <= 12; i++)
|
||||
{
|
||||
int numX = (int)(originX + (Math.Sin(i * Math.PI / 6) * radius * 0.8)) - 4;
|
||||
int numY = (int)(originY - Math.Cos(i * Math.PI / 6) * radius * 0.8) - 8;
|
||||
window.DrawString(i.ToString(), Color.Black, numX, numY);
|
||||
}
|
||||
}
|
||||
|
||||
window.DrawString(timeText, Color.Black, (window.Width / 2) - ((timeText.Length * 8) / 2), 4);
|
||||
|
||||
/* Second hand */
|
||||
double second = now.Second;
|
||||
double secondRad = second * Math.PI / 30;
|
||||
RenderHand(originX, originY, radius, secondRad, Color.Red);
|
||||
|
||||
/* Minute hand*/
|
||||
double minute = now.Minute + (second / 60);
|
||||
double minuteRad = minute * Math.PI / 30;
|
||||
RenderHand(originX, originY, (int)(radius * 0.75f), minuteRad, Color.Black);
|
||||
|
||||
/* Hour hand */
|
||||
double hour = now.Hour + (minute / 60);
|
||||
double hourRad = hour * Math.PI / 6;
|
||||
RenderHand(originX, originY, (int)(radius * 0.5f), hourRad, Color.Black);
|
||||
|
||||
wm.Update(window);
|
||||
}
|
||||
|
||||
#region Process
|
||||
public override void Start()
|
||||
{
|
||||
base.Start();
|
||||
window = new AppWindow(this, 256, 256, 192, 192);
|
||||
window.Icon = AppManager.GetAppMetadata("Clock").Icon;
|
||||
window.CanResize = true;
|
||||
window.UserResized = RenderClock;
|
||||
window.Closing = TryStop;
|
||||
wm.AddWindow(window);
|
||||
|
||||
window.Title = "Clock";
|
||||
|
||||
RenderClock();
|
||||
}
|
||||
|
||||
|
||||
public override void Run()
|
||||
{
|
||||
DateTime now = DateTime.Now;
|
||||
if (lastSecond != now.Second)
|
||||
{
|
||||
RenderClock();
|
||||
lastSecond = now.Second;
|
||||
}
|
||||
}
|
||||
#endregion Process
|
||||
}
|
||||
}
|
||||
50
Gui/Apps/CodeStudio/CodeEditor.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
using CMLeonOS.Gui.UILib;
|
||||
using Cosmos.System.Graphics;
|
||||
using System.Drawing;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace CMLeonOS.Gui.Apps.CodeStudio
|
||||
{
|
||||
internal class CodeEditor : TextBox
|
||||
{
|
||||
private bool enableSyntaxHighlighting = false;
|
||||
private string fileExtension = "";
|
||||
|
||||
public CodeEditor(Window parent, int x, int y, int width, int height) : base(parent, x, y, width, height)
|
||||
{
|
||||
}
|
||||
|
||||
internal void SetSyntaxHighlighting(bool enable, string extension = "")
|
||||
{
|
||||
enableSyntaxHighlighting = enable;
|
||||
fileExtension = extension.ToLower();
|
||||
MarkAllLines();
|
||||
Render();
|
||||
}
|
||||
|
||||
internal override void RenderLine(int lineIndex, string lineText, int lineY, int xOffset)
|
||||
{
|
||||
if (enableSyntaxHighlighting && fileExtension == ".lua")
|
||||
{
|
||||
var tokens = LuaSyntaxHighlighter.HighlightLine(lineText);
|
||||
int currentXOffset = xOffset;
|
||||
|
||||
foreach (var token in tokens)
|
||||
{
|
||||
if (currentXOffset + token.Text.Length * 8 > 0 && currentXOffset < Width)
|
||||
{
|
||||
DrawString(token.Text, token.Color, currentXOffset, lineY);
|
||||
}
|
||||
currentXOffset += token.Text.Length * 8;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
base.RenderLine(lineIndex, lineText, lineY, xOffset);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
47
Gui/Apps/CodeStudio/CodeStudio.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using CMLeonOS;
|
||||
using CMLeonOS.Gui.UILib;
|
||||
using System.Drawing;
|
||||
using Cosmos.System.Graphics;
|
||||
|
||||
namespace CMLeonOS.Gui.Apps.CodeStudio
|
||||
{
|
||||
internal class CodeStudio : Process
|
||||
{
|
||||
internal CodeStudio() : base("CodeStudio", ProcessType.Application) { }
|
||||
|
||||
Window splash;
|
||||
|
||||
WindowManager wm = ProcessManager.GetProcess<WindowManager>();
|
||||
|
||||
[IL2CPU.API.Attribs.ManifestResourceStream(ResourceName = "CMLeonOS.Gui.Resources.CodeStudio.Splash.bmp")]
|
||||
private static byte[] _splashBytes;
|
||||
private static Bitmap splashBitmap = new Bitmap(_splashBytes);
|
||||
|
||||
private Ide ide;
|
||||
|
||||
private bool ideCreated = false;
|
||||
|
||||
public override void Start()
|
||||
{
|
||||
base.Start();
|
||||
splash = new Window(this, 372, 250, 535, 300);
|
||||
wm.AddWindow(splash);
|
||||
|
||||
splash.DrawImage(splashBitmap, 0, 0);
|
||||
//splash.DrawString("Starting...", Color.White, 20, splash.Height - 16 - 20);
|
||||
|
||||
wm.Update(splash);
|
||||
}
|
||||
|
||||
public override void Run()
|
||||
{
|
||||
if (!ideCreated)
|
||||
{
|
||||
ide = new Ide(this, wm);
|
||||
ide.Start();
|
||||
wm.RemoveWindow(splash);
|
||||
ideCreated = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
320
Gui/Apps/CodeStudio/Ide.cs
Normal file
@@ -0,0 +1,320 @@
|
||||
using CMLeonOS;
|
||||
using CMLeonOS.Gui.UILib;
|
||||
using Cosmos.System.Graphics;
|
||||
using System.Drawing;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using UniLua;
|
||||
|
||||
namespace CMLeonOS.Gui.Apps.CodeStudio
|
||||
{
|
||||
internal class Ide
|
||||
{
|
||||
internal Ide(Process process, WindowManager wm)
|
||||
{
|
||||
this.process = process;
|
||||
this.wm = wm;
|
||||
}
|
||||
|
||||
[IL2CPU.API.Attribs.ManifestResourceStream(ResourceName = "CMLeonOS.Gui.Resources.CodeStudio.Run.bmp")]
|
||||
private static byte[] _runBytes;
|
||||
private static Bitmap runBitmap = new Bitmap(_runBytes);
|
||||
|
||||
Process process;
|
||||
|
||||
WindowManager wm;
|
||||
|
||||
AppWindow mainWindow;
|
||||
|
||||
Button runButton;
|
||||
|
||||
CodeEditor editor;
|
||||
|
||||
TextBox problems;
|
||||
|
||||
TextBox output;
|
||||
|
||||
FileBrowser fileBrowser;
|
||||
|
||||
private const int headersHeight = 24;
|
||||
private const int problemsHeight = 128;
|
||||
private const int outputHeight = 128;
|
||||
|
||||
private string? path = null;
|
||||
|
||||
private bool modified = false;
|
||||
|
||||
private void TextChanged()
|
||||
{
|
||||
modified = true;
|
||||
|
||||
UpdateTitle();
|
||||
}
|
||||
|
||||
private static class Theme
|
||||
{
|
||||
internal static Color Background = Color.FromArgb(68, 76, 84);
|
||||
internal static Color CodeBackground = Color.FromArgb(41, 46, 51);
|
||||
}
|
||||
|
||||
private void UpdateTitle()
|
||||
{
|
||||
if (path == null)
|
||||
{
|
||||
mainWindow.Title = "Untitled - Lua CodeStudio";
|
||||
return;
|
||||
}
|
||||
|
||||
if (modified)
|
||||
{
|
||||
mainWindow.Title = $"{Path.GetFileName(path)}* - Lua CodeStudio";
|
||||
}
|
||||
else
|
||||
{
|
||||
mainWindow.Title = $"{Path.GetFileName(path)} - Lua CodeStudio";
|
||||
}
|
||||
}
|
||||
|
||||
internal void Open(string newPath, bool readFile = true)
|
||||
{
|
||||
if (newPath == null) return;
|
||||
|
||||
if (readFile && !File.Exists(newPath))
|
||||
{
|
||||
MessageBox messageBox = new MessageBox(process, "Lua CodeStudio", $"No such file '{Path.GetFileName(newPath)}'.");
|
||||
messageBox.Show();
|
||||
}
|
||||
|
||||
path = newPath;
|
||||
|
||||
if (readFile)
|
||||
{
|
||||
editor.Text = File.ReadAllText(path);
|
||||
|
||||
string extension = Path.GetExtension(path).ToLower();
|
||||
editor.SetSyntaxHighlighting(extension == ".lua", extension);
|
||||
|
||||
editor.MarkAllLines();
|
||||
editor.Render();
|
||||
|
||||
modified = false;
|
||||
}
|
||||
|
||||
UpdateTitle();
|
||||
}
|
||||
|
||||
private void OpenFilePrompt()
|
||||
{
|
||||
fileBrowser = new FileBrowser(process, wm, (string selectedPath) =>
|
||||
{
|
||||
if (selectedPath != null)
|
||||
{
|
||||
Open(selectedPath);
|
||||
}
|
||||
});
|
||||
fileBrowser.Show();
|
||||
}
|
||||
|
||||
private void SaveAsPrompt()
|
||||
{
|
||||
fileBrowser = new FileBrowser(process, wm, (string selectedPath) =>
|
||||
{
|
||||
if (selectedPath != null)
|
||||
{
|
||||
path = selectedPath;
|
||||
Save();
|
||||
}
|
||||
}, selectDirectoryOnly: true);
|
||||
fileBrowser.Show();
|
||||
}
|
||||
|
||||
private void Save()
|
||||
{
|
||||
if (path == null)
|
||||
{
|
||||
SaveAsPrompt();
|
||||
return;
|
||||
}
|
||||
|
||||
File.WriteAllText(path, editor.Text);
|
||||
|
||||
modified = false;
|
||||
UpdateTitle();
|
||||
}
|
||||
|
||||
private void RunClicked(int x, int y)
|
||||
{
|
||||
try
|
||||
{
|
||||
output.Text = "";
|
||||
|
||||
ILuaState lua = LuaAPI.NewState();
|
||||
lua.L_OpenLibs();
|
||||
|
||||
lua.PushCSharpFunction(L =>
|
||||
{
|
||||
int n = L.GetTop();
|
||||
string result = "";
|
||||
for (int i = 1; i <= n; i++)
|
||||
{
|
||||
if (i > 1) result += "\t";
|
||||
LuaType type = L.Type(i);
|
||||
if (type == LuaType.LUA_TSTRING)
|
||||
{
|
||||
result += L.ToString(i);
|
||||
}
|
||||
else if (type == LuaType.LUA_TBOOLEAN)
|
||||
{
|
||||
result += L.ToBoolean(i) ? "true" : "false";
|
||||
}
|
||||
else if (type == LuaType.LUA_TNUMBER)
|
||||
{
|
||||
result += L.ToNumber(i).ToString();
|
||||
}
|
||||
else if (type == LuaType.LUA_TNIL)
|
||||
{
|
||||
result += "nil";
|
||||
}
|
||||
}
|
||||
output.Text += result + "\n";
|
||||
return 0;
|
||||
});
|
||||
lua.SetGlobal("print");
|
||||
|
||||
UniLua.ThreadStatus loadResult = lua.L_LoadString(editor.Text);
|
||||
|
||||
if (loadResult == UniLua.ThreadStatus.LUA_OK)
|
||||
{
|
||||
UniLua.ThreadStatus callResult = lua.PCall(0, 0, 0);
|
||||
|
||||
if (callResult == UniLua.ThreadStatus.LUA_OK)
|
||||
{
|
||||
problems.Foreground = Color.LimeGreen;
|
||||
problems.Text = "Execution successful";
|
||||
}
|
||||
else
|
||||
{
|
||||
string errorMsg = lua.ToString(-1);
|
||||
problems.Foreground = Color.Pink;
|
||||
problems.Text = $"Script execution error: {errorMsg}";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
string errorMsg = lua.ToString(-1);
|
||||
problems.Foreground = Color.Pink;
|
||||
problems.Text = $"Script load error: {errorMsg}";
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
problems.Foreground = Color.Pink;
|
||||
problems.Text = e.Message;
|
||||
}
|
||||
}
|
||||
|
||||
private void Evaluate()
|
||||
{
|
||||
try
|
||||
{
|
||||
ILuaState lua = LuaAPI.NewState();
|
||||
lua.L_OpenLibs();
|
||||
UniLua.ThreadStatus loadResult = lua.L_LoadString(editor.Text);
|
||||
|
||||
if (loadResult == UniLua.ThreadStatus.LUA_OK)
|
||||
{
|
||||
problems.Foreground = Color.LimeGreen;
|
||||
problems.Text = "No syntax errors";
|
||||
}
|
||||
else
|
||||
{
|
||||
string errorMsg = lua.ToString(-1);
|
||||
if (string.IsNullOrWhiteSpace(errorMsg))
|
||||
{
|
||||
problems.Foreground = Color.Pink;
|
||||
problems.Text = "Script load error: Unknown error";
|
||||
}
|
||||
else
|
||||
{
|
||||
problems.Foreground = Color.Pink;
|
||||
problems.Text = $"Script load error: {errorMsg}";
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
problems.Foreground = Color.Pink;
|
||||
problems.Text = e.Message;
|
||||
}
|
||||
}
|
||||
|
||||
internal void Start()
|
||||
{
|
||||
mainWindow = new AppWindow(process, 96, 96, 800, 600);
|
||||
mainWindow.Clear(Theme.Background);
|
||||
mainWindow.Closing = process.TryStop;
|
||||
UpdateTitle();
|
||||
wm.AddWindow(mainWindow);
|
||||
|
||||
runButton = new Button(mainWindow, 0, 0, 60, headersHeight);
|
||||
runButton.Background = Theme.Background;
|
||||
runButton.Border = Theme.Background;
|
||||
runButton.Foreground = Color.White;
|
||||
runButton.Text = "Run";
|
||||
runButton.Image = runBitmap;
|
||||
runButton.ImageLocation = Button.ButtonImageLocation.Left;
|
||||
runButton.OnClick = RunClicked;
|
||||
wm.AddWindow(runButton);
|
||||
|
||||
editor = new CodeEditor(mainWindow, 0, headersHeight, mainWindow.Width, mainWindow.Height - headersHeight - problemsHeight - outputHeight - (headersHeight * 3))
|
||||
{
|
||||
Background = Theme.CodeBackground,
|
||||
Foreground = Color.White,
|
||||
Text = "print(\"Hello World!\")",
|
||||
Changed = TextChanged,
|
||||
MultiLine = true
|
||||
};
|
||||
editor.SetSyntaxHighlighting(true, ".lua");
|
||||
wm.AddWindow(editor);
|
||||
|
||||
problems = new TextBox(mainWindow, 0, headersHeight + editor.Height + headersHeight, mainWindow.Width, problemsHeight + (headersHeight * 2))
|
||||
{
|
||||
Background = Theme.CodeBackground,
|
||||
Foreground = Color.Gray,
|
||||
Text = "Click Evaluate to check your program for syntax errors.",
|
||||
ReadOnly = true,
|
||||
MultiLine = true
|
||||
};
|
||||
wm.AddWindow(problems);
|
||||
|
||||
mainWindow.DrawString("Problems", Color.White, 0, headersHeight + editor.Height);
|
||||
|
||||
output = new TextBox(mainWindow, 0, headersHeight + editor.Height + problemsHeight + (headersHeight * 2), mainWindow.Width, outputHeight + (headersHeight * 2))
|
||||
{
|
||||
Background = Theme.CodeBackground,
|
||||
Foreground = Color.White,
|
||||
Text = "Output will appear here...",
|
||||
ReadOnly = true,
|
||||
MultiLine = true
|
||||
};
|
||||
wm.AddWindow(output);
|
||||
|
||||
mainWindow.DrawString("Output", Color.White, 0, headersHeight + editor.Height + problemsHeight + headersHeight);
|
||||
|
||||
var shortcutBar = new ShortcutBar(mainWindow, runButton.Width, 0, mainWindow.Width - runButton.Width, headersHeight)
|
||||
{
|
||||
Background = Theme.Background,
|
||||
Foreground = Color.White
|
||||
};
|
||||
shortcutBar.Cells.Add(new ShortcutBarCell("Open", OpenFilePrompt));
|
||||
shortcutBar.Cells.Add(new ShortcutBarCell("Save", Save));
|
||||
shortcutBar.Cells.Add(new ShortcutBarCell("Save As", SaveAsPrompt));
|
||||
shortcutBar.Cells.Add(new ShortcutBarCell("Evaluate", Evaluate));
|
||||
shortcutBar.Render();
|
||||
wm.AddWindow(shortcutBar);
|
||||
|
||||
wm.Update(mainWindow);
|
||||
}
|
||||
}
|
||||
}
|
||||
180
Gui/Apps/CodeStudio/LuaSyntaxHighlighter.cs
Normal file
@@ -0,0 +1,180 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
|
||||
namespace CMLeonOS.Gui.Apps.CodeStudio
|
||||
{
|
||||
internal static class LuaSyntaxHighlighter
|
||||
{
|
||||
private static readonly List<string> Keywords = new List<string>
|
||||
{
|
||||
"and", "break", "do", "else", "elseif", "end", "false", "for", "function", "if", "in", "local", "nil", "not", "or", "repeat", "return", "then", "true", "until", "while",
|
||||
"goto", "self"
|
||||
};
|
||||
|
||||
private static readonly List<string> Builtins = new List<string>
|
||||
{
|
||||
"print", "type", "tostring", "tonumber", "ipairs", "pairs", "table", "string", "math", "io", "os", "coroutine", "debug", "package", "utf8", "bit32",
|
||||
"assert", "collectgarbage", "dofile", "error", "getmetatable", "load", "loadfile", "next", "pcall", "rawequal", "rawget", "rawlen", "rawset", "require", "select", "setmetatable", "xpcall",
|
||||
"byte", "char", "dump", "find", "format", "gmatch", "gsub", "len", "lower", "match", "rep", "reverse", "sub", "upper",
|
||||
"abs", "acos", "asin", "atan", "atan2", "ceil", "cos", "cosh", "deg", "exp", "floor", "fmod", "frexp", "huge", "ldexp", "log", "log10", "max", "min", "modf", "pi", "pow", "rad", "random", "randomseed", "sin", "sinh", "sqrt", "tan", "tanh",
|
||||
"close", "flush", "input", "lines", "open", "output", "popen", "read", "tmpfile", "type", "write",
|
||||
"clock", "date", "difftime", "execute", "exit", "getenv", "remove", "rename", "setlocale", "time", "tmpname",
|
||||
"create", "resume", "running", "status", "wrap", "yield",
|
||||
"concat", "insert", "maxn", "remove", "sort",
|
||||
"getinfo", "getlocal", "getmetatable", "setmetatable", "setlocal", "traceback",
|
||||
"loadlib", "seeall", "loaded", "loaders", "path", "cpath", "preload"
|
||||
};
|
||||
|
||||
private static readonly List<string> Operators = new List<string>
|
||||
{
|
||||
"+", "-", "*", "/", "%", "^", "#", "==", "~=", "<=", ">=", "<", ">", "=", "(", ")", "[", "]", "{", "}", ";", ":", ",", "..", "...", "."
|
||||
};
|
||||
|
||||
internal static class Colors
|
||||
{
|
||||
internal static Color Keyword = Color.FromArgb(255, 0, 128);
|
||||
internal static Color Builtin = Color.FromArgb(0, 128, 0);
|
||||
internal static Color String = Color.FromArgb(163, 21, 21);
|
||||
internal static Color Number = Color.FromArgb(0, 0, 255);
|
||||
internal static Color Comment = Color.FromArgb(128, 128, 128);
|
||||
internal static Color Operator = Color.FromArgb(255, 128, 0);
|
||||
internal static Color Default = Color.White;
|
||||
}
|
||||
|
||||
internal class HighlightedToken
|
||||
{
|
||||
internal string Text;
|
||||
internal Color Color;
|
||||
|
||||
internal HighlightedToken(string text, Color color)
|
||||
{
|
||||
Text = text;
|
||||
Color = color;
|
||||
}
|
||||
}
|
||||
|
||||
internal static List<HighlightedToken> HighlightLine(string line)
|
||||
{
|
||||
var tokens = new List<HighlightedToken>();
|
||||
int i = 0;
|
||||
|
||||
while (i < line.Length)
|
||||
{
|
||||
char c = line[i];
|
||||
|
||||
if (char.IsWhiteSpace(c))
|
||||
{
|
||||
int start = i;
|
||||
while (i < line.Length && char.IsWhiteSpace(line[i]))
|
||||
{
|
||||
i++;
|
||||
}
|
||||
tokens.Add(new HighlightedToken(line.Substring(start, i - start), Colors.Default));
|
||||
continue;
|
||||
}
|
||||
|
||||
if (i + 3 < line.Length && line.Substring(i, 4) == "--[[")
|
||||
{
|
||||
int start = i;
|
||||
i += 4;
|
||||
|
||||
int endPos = line.IndexOf("--]]", i);
|
||||
if (endPos != -1)
|
||||
{
|
||||
i = endPos + 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
i = line.Length;
|
||||
}
|
||||
|
||||
tokens.Add(new HighlightedToken(line.Substring(start, i - start), Colors.Comment));
|
||||
continue;
|
||||
}
|
||||
|
||||
if (c == '-' && i + 1 < line.Length && line[i + 1] == '-')
|
||||
{
|
||||
int start = i;
|
||||
i += 2;
|
||||
while (i < line.Length && line[i] != '\n')
|
||||
{
|
||||
i++;
|
||||
}
|
||||
tokens.Add(new HighlightedToken(line.Substring(start, i - start), Colors.Comment));
|
||||
continue;
|
||||
}
|
||||
|
||||
if (c == '"' || c == '\'')
|
||||
{
|
||||
int start = i;
|
||||
i++;
|
||||
while (i < line.Length && line[i] != c)
|
||||
{
|
||||
if (line[i] == '\\' && i + 1 < line.Length)
|
||||
{
|
||||
i += 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
i++;
|
||||
}
|
||||
}
|
||||
if (i < line.Length)
|
||||
{
|
||||
i++;
|
||||
}
|
||||
tokens.Add(new HighlightedToken(line.Substring(start, i - start), Colors.String));
|
||||
continue;
|
||||
}
|
||||
|
||||
if (char.IsDigit(c) || (c == '0' && i + 1 < line.Length && (line[i + 1] == 'x' || line[i + 1] == 'X')))
|
||||
{
|
||||
int start = i;
|
||||
i++;
|
||||
while (i < line.Length && (char.IsDigit(line[i]) || line[i] == '.' || line[i] == 'e' || line[i] == 'E' || line[i] == 'x' || line[i] == 'X' || line[i] == 'a' || line[i] == 'A' || line[i] == 'b' || line[i] == 'B' || line[i] == 'c' || line[i] == 'C' || line[i] == 'd' || line[i] == 'D' || line[i] == 'f' || line[i] == 'F'))
|
||||
{
|
||||
i++;
|
||||
}
|
||||
tokens.Add(new HighlightedToken(line.Substring(start, i - start), Colors.Number));
|
||||
continue;
|
||||
}
|
||||
|
||||
if (char.IsLetter(c) || c == '_')
|
||||
{
|
||||
int start = i;
|
||||
while (i < line.Length && (char.IsLetterOrDigit(line[i]) || line[i] == '_'))
|
||||
{
|
||||
i++;
|
||||
}
|
||||
string word = line.Substring(start, i - start);
|
||||
|
||||
if (Keywords.Contains(word))
|
||||
{
|
||||
tokens.Add(new HighlightedToken(word, Colors.Keyword));
|
||||
}
|
||||
else if (Builtins.Contains(word))
|
||||
{
|
||||
tokens.Add(new HighlightedToken(word, Colors.Builtin));
|
||||
}
|
||||
else
|
||||
{
|
||||
tokens.Add(new HighlightedToken(word, Colors.Default));
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (Operators.Contains(c.ToString()))
|
||||
{
|
||||
tokens.Add(new HighlightedToken(c.ToString(), Colors.Operator));
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
|
||||
tokens.Add(new HighlightedToken(c.ToString(), Colors.Default));
|
||||
i++;
|
||||
}
|
||||
|
||||
return tokens;
|
||||
}
|
||||
}
|
||||
}
|
||||
86
Gui/Apps/DemoLauncher.cs
Normal file
@@ -0,0 +1,86 @@
|
||||
using Cosmos.System.Graphics;
|
||||
using CMLeonOS;
|
||||
using CMLeonOS.Gui.SmoothMono;
|
||||
using CMLeonOS.Gui.UILib;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
|
||||
namespace CMLeonOS.Gui.Apps
|
||||
{
|
||||
internal class DemoLauncher : Process
|
||||
{
|
||||
internal DemoLauncher() : base("DemoLauncher", ProcessType.Application) { }
|
||||
|
||||
AppWindow window;
|
||||
|
||||
Table table;
|
||||
|
||||
WindowManager wm = ProcessManager.GetProcess<WindowManager>();
|
||||
|
||||
private static class Icons
|
||||
{
|
||||
[IL2CPU.API.Attribs.ManifestResourceStream(ResourceName = "CMLeonOS.Gui.Resources.AppIcons.Demos.Starfield.bmp")]
|
||||
private static byte[] _iconBytes_Starfield;
|
||||
internal static Bitmap Icon_Starfield = new Bitmap(_iconBytes_Starfield);
|
||||
|
||||
[IL2CPU.API.Attribs.ManifestResourceStream(ResourceName = "CMLeonOS.Gui.Resources.AppIcons.Demos.Mandelbrot.bmp")]
|
||||
private static byte[] _iconBytes_Mandelbrot;
|
||||
internal static Bitmap Icon_Mandelbrot = new Bitmap(_iconBytes_Mandelbrot);
|
||||
}
|
||||
|
||||
List<AppMetadata> demoApps = new()
|
||||
{
|
||||
new AppMetadata("Starfield", () => { return new Apps.Demos.Starfield(); }, Icons.Icon_Starfield, Color.Black ),
|
||||
new AppMetadata("Mandelbrot", () => { return new Apps.Demos.Mandelbrot(); }, Icons.Icon_Mandelbrot, Color.Black ),
|
||||
};
|
||||
|
||||
private const string message = "Demo Launcher";
|
||||
|
||||
private void PopulateTable()
|
||||
{
|
||||
table.Cells.Clear();
|
||||
foreach (AppMetadata app in demoApps)
|
||||
{
|
||||
table.Cells.Add(new TableCell(app.Icon.Resize(32, 32), app.Name));
|
||||
}
|
||||
table.Render();
|
||||
}
|
||||
|
||||
public override void Start()
|
||||
{
|
||||
base.Start();
|
||||
window = new AppWindow(this, 256, 256, 384, 256);
|
||||
wm.AddWindow(window);
|
||||
window.Title = "Demos";
|
||||
window.Icon = AppManager.GetAppMetadata("Demos").Icon;
|
||||
window.Closing = TryStop;
|
||||
|
||||
window.Clear(Color.FromArgb(56, 56, 71));
|
||||
|
||||
window.DrawString(message, Color.White, (window.Width / 2) - ((FontData.Width * message.Length) / 2), 12);
|
||||
|
||||
table = new Table(window, 12, 40, window.Width - 24, window.Height - 52);
|
||||
table.Background = Color.FromArgb(56, 56, 71);
|
||||
table.Border = Color.FromArgb(56, 56, 71);
|
||||
table.Foreground = Color.White;
|
||||
table.CellHeight = 32;
|
||||
table.OnDoubleClick = (int x, int y) =>
|
||||
{
|
||||
if (table.SelectedCellIndex != -1)
|
||||
{
|
||||
AppMetadata app = demoApps[table.SelectedCellIndex];
|
||||
ProcessManager.AddProcess(app.CreateProcess()).Start();
|
||||
}
|
||||
};
|
||||
PopulateTable();
|
||||
wm.AddWindow(table);
|
||||
|
||||
wm.Update(window);
|
||||
}
|
||||
|
||||
public override void Run()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
91
Gui/Apps/Demos/Mandelbrot.cs
Normal file
@@ -0,0 +1,91 @@
|
||||
using CMLeonOS;
|
||||
using CMLeonOS.Gui.UILib;
|
||||
using System;
|
||||
using System.Drawing;
|
||||
|
||||
namespace CMLeonOS.Gui.Apps.Demos
|
||||
{
|
||||
internal class Mandelbrot : Process
|
||||
{
|
||||
internal Mandelbrot() : base("Mandelbrot", ProcessType.Application) { }
|
||||
|
||||
AppWindow window;
|
||||
|
||||
WindowManager wm = ProcessManager.GetProcess<WindowManager>();
|
||||
|
||||
private Color GetColor(double v)
|
||||
{
|
||||
int red = Math.Clamp((int)(255 * v), 0, 255);
|
||||
int green = 0;
|
||||
int blue = Math.Clamp((int)(255 * (1 - v)), 0, 255);
|
||||
|
||||
return Color.FromArgb(red, green, blue);
|
||||
}
|
||||
|
||||
private void RenderMandelbrot()
|
||||
{
|
||||
window.Clear(Color.Black);
|
||||
wm.Update(window);
|
||||
|
||||
int width = window.Width;
|
||||
int height = window.Height;
|
||||
|
||||
const int max = 20;
|
||||
const double bail = 2.0;
|
||||
|
||||
for (int y = 0; y < height; y++)
|
||||
{
|
||||
for (int x = 0; x < width; x++)
|
||||
{
|
||||
double zx = 0;
|
||||
double zy = 0;
|
||||
double cx = (x - width / 2.0) / (width / 4.0);
|
||||
double cy = (y - height / 2.0) / (height / 4.0);
|
||||
|
||||
int iteration = 0;
|
||||
|
||||
while (zx * zx + zy * zy < bail && iteration < max)
|
||||
{
|
||||
double zxNew = zx * zx - zy * zy + cx;
|
||||
zy = 2 * zx * zy + cy;
|
||||
zx = zxNew;
|
||||
iteration++;
|
||||
}
|
||||
|
||||
double smooth = iteration + 1 - Math.Log(Math.Log(Math.Sqrt(zx * zx + zy * zy)) / Math.Log(bail)) / Math.Log(2);
|
||||
window.DrawPoint(x, y, GetColor(smooth / max));
|
||||
|
||||
if (x % 32 == 0)
|
||||
{
|
||||
ProcessManager.Yield();
|
||||
}
|
||||
}
|
||||
|
||||
if (y % 8 == 0)
|
||||
{
|
||||
wm.Update(window);
|
||||
}
|
||||
}
|
||||
|
||||
wm.Update(window);
|
||||
}
|
||||
|
||||
public override void Start()
|
||||
{
|
||||
base.Start();
|
||||
window = new AppWindow(this, 256, 256, 256, 256);
|
||||
wm.AddWindow(window);
|
||||
window.Title = "Mandelbrot";
|
||||
window.CanResize = true;
|
||||
window.Closing = TryStop;
|
||||
window.UserResized = RenderMandelbrot;
|
||||
|
||||
RenderMandelbrot();
|
||||
}
|
||||
|
||||
public override void Run()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
105
Gui/Apps/Demos/Starfield.cs
Normal file
@@ -0,0 +1,105 @@
|
||||
using CMLeonOS;
|
||||
using CMLeonOS.Gui.UILib;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
|
||||
namespace CMLeonOS.Gui.Apps.Demos
|
||||
{
|
||||
internal class Starfield : Process
|
||||
{
|
||||
internal Starfield() : base("Starfield", ProcessType.Application) { }
|
||||
|
||||
AppWindow window;
|
||||
|
||||
WindowManager wm = ProcessManager.GetProcess<WindowManager>();
|
||||
|
||||
private readonly Random random = new Random();
|
||||
|
||||
private readonly List<Star> stars = new List<Star>();
|
||||
|
||||
private int timerId;
|
||||
|
||||
private class Star
|
||||
{
|
||||
internal double X { get; set; }
|
||||
internal double Y { get; set; }
|
||||
internal double Z { get; set; }
|
||||
internal double Velocity { get; set; }
|
||||
|
||||
internal Star(double x, double y, double z, double velocity)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
Z = z;
|
||||
Velocity = velocity;
|
||||
}
|
||||
}
|
||||
|
||||
internal (double, double) TransformCoordinates(double x, double y, double z, double fov)
|
||||
{
|
||||
double screenX = x / (z * Math.Tan(fov / 2)) + 0.5;
|
||||
double screenY = y / (z * Math.Tan(fov / 2)) + 0.5;
|
||||
|
||||
return (screenX, screenY);
|
||||
}
|
||||
|
||||
public override void Start()
|
||||
{
|
||||
base.Start();
|
||||
window = new AppWindow(this, 256, 256, 256, 256);
|
||||
wm.AddWindow(window);
|
||||
window.Title = "Starfield";
|
||||
window.CanResize = true;
|
||||
window.Closing = TryStop;
|
||||
|
||||
for (int i = 0; i < 100; i++)
|
||||
{
|
||||
stars.Add(new Star(
|
||||
x: random.NextDouble() * 2 - 1.5,
|
||||
y: random.NextDouble() * 2 - 1.5,
|
||||
z: 3,
|
||||
velocity: random.NextDouble() * 0.05 + 0.05));
|
||||
}
|
||||
|
||||
timerId = Cosmos.HAL.Global.PIT.RegisterTimer(new Cosmos.HAL.PIT.PITTimer(() =>
|
||||
{
|
||||
foreach (var star in stars)
|
||||
{
|
||||
star.Z -= star.Velocity;
|
||||
|
||||
if (star.Z < 0)
|
||||
{
|
||||
star.X = random.NextDouble() * 2 - 1.5;
|
||||
star.Y = random.NextDouble() * 2 - 1.5;
|
||||
star.Z = 3;
|
||||
}
|
||||
}
|
||||
}, (ulong)((1000 /* ms */ / 30) * 1e+6 /* ms -> ns */ ), true));
|
||||
}
|
||||
|
||||
public override void Run()
|
||||
{
|
||||
window.Clear(Color.Black);
|
||||
|
||||
foreach (var star in stars)
|
||||
{
|
||||
(double X, double Y) pos = TransformCoordinates(star.X, star.Y, star.Z, Math.PI / 2);
|
||||
|
||||
int screenX = (int)((pos.X + 1) * (window.Width / 2));
|
||||
int screenY = (int)((pos.Y + 1) * (window.Height / 2));
|
||||
|
||||
window.DrawPoint(screenX, screenY, Color.White);
|
||||
}
|
||||
|
||||
wm.Update(window);
|
||||
}
|
||||
|
||||
public override void Stop()
|
||||
{
|
||||
base.Stop();
|
||||
|
||||
Cosmos.HAL.Global.PIT.UnregisterTimer(timerId);
|
||||
}
|
||||
}
|
||||
}
|
||||
329
Gui/Apps/Files.cs
Normal file
@@ -0,0 +1,329 @@
|
||||
using Cosmos.System.Graphics;
|
||||
using CMLeonOS;
|
||||
using CMLeonOS.Gui.UILib;
|
||||
using CMLeonOS.Logger;
|
||||
using CMLeonOS.Utils;
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
|
||||
namespace CMLeonOS.Gui.Apps
|
||||
{
|
||||
internal class Files : Process
|
||||
{
|
||||
internal Files() : base("Files", ProcessType.Application) { }
|
||||
|
||||
AppWindow window;
|
||||
|
||||
Table entryTable;
|
||||
Table shortcutsTable;
|
||||
|
||||
ImageBlock up;
|
||||
|
||||
TextBox pathBox;
|
||||
|
||||
Window header;
|
||||
|
||||
WindowManager wm = ProcessManager.GetProcess<WindowManager>();
|
||||
|
||||
private static class Icons
|
||||
{
|
||||
[IL2CPU.API.Attribs.ManifestResourceStream(ResourceName = "CMLeonOS.Gui.Resources.Files.Directory.bmp")]
|
||||
private static byte[] _iconBytes_Directory;
|
||||
internal static Bitmap Icon_Directory = new Bitmap(_iconBytes_Directory);
|
||||
|
||||
[IL2CPU.API.Attribs.ManifestResourceStream(ResourceName = "CMLeonOS.Gui.Resources.Files.File.bmp")]
|
||||
private static byte[] _iconBytes_File;
|
||||
internal static Bitmap Icon_File = new Bitmap(_iconBytes_File);
|
||||
|
||||
[IL2CPU.API.Attribs.ManifestResourceStream(ResourceName = "CMLeonOS.Gui.Resources.Files.File_Config.bmp")]
|
||||
private static byte[] _iconBytes_File_Config;
|
||||
internal static Bitmap Icon_File_Config = new Bitmap(_iconBytes_File_Config);
|
||||
|
||||
[IL2CPU.API.Attribs.ManifestResourceStream(ResourceName = "CMLeonOS.Gui.Resources.Files.File_Rs.bmp")]
|
||||
private static byte[] _iconBytes_File_Rs;
|
||||
internal static Bitmap Icon_File_Rs = new Bitmap(_iconBytes_File_Rs);
|
||||
|
||||
[IL2CPU.API.Attribs.ManifestResourceStream(ResourceName = "CMLeonOS.Gui.Resources.Files.File_Text.bmp")]
|
||||
private static byte[] _iconBytes_File_Text;
|
||||
internal static Bitmap Icon_File_Text = new Bitmap(_iconBytes_File_Text);
|
||||
|
||||
[IL2CPU.API.Attribs.ManifestResourceStream(ResourceName = "CMLeonOS.Gui.Resources.Files.Drive.bmp")]
|
||||
private static byte[] _iconBytes_Drive;
|
||||
internal static Bitmap Icon_Drive = new Bitmap(_iconBytes_Drive);
|
||||
|
||||
[IL2CPU.API.Attribs.ManifestResourceStream(ResourceName = "CMLeonOS.Gui.Resources.Files.Home.bmp")]
|
||||
private static byte[] _iconBytes_Home;
|
||||
internal static Bitmap Icon_Home = new Bitmap(_iconBytes_Home);
|
||||
|
||||
[IL2CPU.API.Attribs.ManifestResourceStream(ResourceName = "CMLeonOS.Gui.Resources.Files.Up.bmp")]
|
||||
private static byte[] _iconBytes_Up;
|
||||
internal static Bitmap Icon_Up = new Bitmap(_iconBytes_Up);
|
||||
}
|
||||
|
||||
private string currentDir = @"0:\";
|
||||
|
||||
private const int pathBoxMargin = 4;
|
||||
private const int pathBoxHeight = 24;
|
||||
private const int shortcutsWidth = 128;
|
||||
private const int headerHeight = 32;
|
||||
|
||||
private const string dirEmptyMessage = "This folder is empty.";
|
||||
|
||||
private readonly (string Name, string Path)[] shortcuts = new (string, string)[]
|
||||
{
|
||||
("CMLeonOS (0:)", @"0:\"),
|
||||
("My Home", @$"0:\user\{UserSystem.CurrentLoggedInUser.Username}"),
|
||||
("Users", @"0:\user"),
|
||||
};
|
||||
|
||||
private Bitmap GetFileIcon(string path)
|
||||
{
|
||||
string extension = Path.GetExtension(path).ToLower();
|
||||
|
||||
return extension switch
|
||||
{
|
||||
".txt" or ".md" or ".log" => Icons.Icon_File_Text,
|
||||
".rs" => Icons.Icon_File_Rs,
|
||||
".ini" or ".cfg" => Icons.Icon_File_Config,
|
||||
_ => Icons.Icon_File
|
||||
};
|
||||
}
|
||||
|
||||
private Bitmap GetDirectoryIcon(string path)
|
||||
{
|
||||
if (Path.TrimEndingDirectorySeparator(path).StartsWith(@"0:\user\"))
|
||||
{
|
||||
return Icons.Icon_Home;
|
||||
}
|
||||
|
||||
switch (path)
|
||||
{
|
||||
case @"0:\":
|
||||
return Icons.Icon_Drive;
|
||||
default:
|
||||
return Icons.Icon_Directory;
|
||||
}
|
||||
}
|
||||
|
||||
private void PopulateEntryTable()
|
||||
{
|
||||
entryTable.Cells.Clear();
|
||||
entryTable.SelectedCellIndex = -1;
|
||||
|
||||
bool empty = true;
|
||||
foreach (string path in Directory.GetDirectories(currentDir))
|
||||
{
|
||||
entryTable.Cells.Add(new TableCell(GetDirectoryIcon(path), Path.GetFileName(path), tag: "Directory"));
|
||||
empty = false;
|
||||
}
|
||||
foreach (string path in Directory.GetFiles(currentDir))
|
||||
{
|
||||
entryTable.Cells.Add(new TableCell(GetFileIcon(path), Path.GetFileName(path), tag: "File"));
|
||||
empty = false;
|
||||
}
|
||||
|
||||
if (empty)
|
||||
{
|
||||
entryTable.Clear(entryTable.Background);
|
||||
entryTable.DrawString(dirEmptyMessage, Color.Black, (entryTable.Width / 2) - ((dirEmptyMessage.Length * 8) / 2), 12);
|
||||
wm.Update(entryTable);
|
||||
}
|
||||
else
|
||||
{
|
||||
entryTable.Render();
|
||||
}
|
||||
}
|
||||
|
||||
private void PopulateShortcutTable()
|
||||
{
|
||||
shortcutsTable.Cells.Clear();
|
||||
foreach ((string Name, string Path) item in shortcuts)
|
||||
{
|
||||
shortcutsTable.Cells.Add(new TableCell(GetDirectoryIcon(item.Path), item.Name, tag: item.Path));
|
||||
}
|
||||
shortcutsTable.Render();
|
||||
}
|
||||
|
||||
private bool NavigateTo(string path)
|
||||
{
|
||||
string sanitised = PathUtil.Sanitize(path);
|
||||
|
||||
if (!Directory.Exists(sanitised))
|
||||
{
|
||||
MessageBox messageBox = new MessageBox(this, "Files", $"CMLeonOS can't find that folder.\nCheck the spelling and try again.");
|
||||
messageBox.Show();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
currentDir = sanitised;
|
||||
pathBox.Text = sanitised;
|
||||
|
||||
PopulateEntryTable();
|
||||
UpdateSelectedShortcut();
|
||||
RenderHeader();
|
||||
|
||||
if (sanitised == @"0:\")
|
||||
{
|
||||
window.Title = "Files";
|
||||
}
|
||||
else
|
||||
{
|
||||
window.Title = Path.GetDirectoryName(sanitised);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private void UpdateSelectedShortcut()
|
||||
{
|
||||
for (int i = 0; i < shortcuts.Length; i++)
|
||||
{
|
||||
if (shortcuts[i].Path == currentDir)
|
||||
{
|
||||
shortcutsTable.SelectedCellIndex = i;
|
||||
return;
|
||||
}
|
||||
}
|
||||
shortcutsTable.SelectedCellIndex = -1;
|
||||
}
|
||||
|
||||
private void EntryTableDoubleClicked(int x, int y)
|
||||
{
|
||||
if (entryTable.SelectedCellIndex != -1)
|
||||
{
|
||||
TableCell cell = entryTable.Cells[entryTable.SelectedCellIndex];
|
||||
string path = PathUtil.Combine(currentDir, cell.Text);
|
||||
if ((string)cell.Tag == "Directory")
|
||||
{
|
||||
NavigateTo(path);
|
||||
}
|
||||
else if ((string)cell.Tag == "File")
|
||||
{
|
||||
try
|
||||
{
|
||||
string extension = Path.GetExtension(path).ToLower();
|
||||
if (extension == ".txt" || extension == ".md")
|
||||
{
|
||||
var notepad = new Notepad(path);
|
||||
var metadata = AppManager.GetAppMetadata("Notepad");
|
||||
metadata.Start();
|
||||
}
|
||||
else
|
||||
{
|
||||
Logger.Logger.Instance.Warning("Files", $"Cannot open file: {path}");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.Logger.Instance.Error("Files", $"Error opening file: {ex.Message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ShortcutsTableCellSelected(int index)
|
||||
{
|
||||
if (index != -1)
|
||||
{
|
||||
bool success = NavigateTo(shortcuts[index].Path);
|
||||
if (!success)
|
||||
{
|
||||
UpdateSelectedShortcut();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void PathBoxSubmitted()
|
||||
{
|
||||
bool success = NavigateTo(pathBox.Text);
|
||||
if (!success)
|
||||
{
|
||||
pathBox.Text = currentDir;
|
||||
}
|
||||
}
|
||||
|
||||
private void UpClicked()
|
||||
{
|
||||
DirectoryInfo parent = Directory.GetParent(currentDir);
|
||||
if (parent != null)
|
||||
{
|
||||
NavigateTo(parent.FullName);
|
||||
}
|
||||
}
|
||||
|
||||
private void RenderHeader(bool updateWindow = true)
|
||||
{
|
||||
header.Clear(Color.DarkBlue);
|
||||
|
||||
header.DrawImageAlpha(GetDirectoryIcon(currentDir), 8, 8);
|
||||
|
||||
DirectoryInfo info = new DirectoryInfo(currentDir);
|
||||
|
||||
string currentDirFriendlyName = Path.GetFileName(currentDir);
|
||||
if (currentDir == $@"0:\user\{UserSystem.CurrentLoggedInUser.Username}")
|
||||
{
|
||||
currentDirFriendlyName = "My Home";
|
||||
}
|
||||
header.DrawString(info.Parent == null ? currentDir : currentDirFriendlyName, Color.White, 32, 8);
|
||||
|
||||
if (updateWindow)
|
||||
{
|
||||
wm.Update(header);
|
||||
}
|
||||
}
|
||||
|
||||
private void WindowClicked(int x, int y)
|
||||
{
|
||||
if (x < pathBoxHeight && y < pathBoxHeight)
|
||||
{
|
||||
UpClicked();
|
||||
}
|
||||
}
|
||||
|
||||
public override void Start()
|
||||
{
|
||||
base.Start();
|
||||
window = new AppWindow(this, 288, 240, 512, 304);
|
||||
wm.AddWindow(window);
|
||||
window.Title = "Files";
|
||||
window.Icon = AppManager.GetAppMetadata("Files").Icon;
|
||||
window.OnClick = WindowClicked;
|
||||
window.Closing = TryStop;
|
||||
|
||||
window.Clear(Color.DarkGray);
|
||||
|
||||
window.DrawImageAlpha(Icons.Icon_Up, 0, 0);
|
||||
|
||||
pathBox = new TextBox(window, (pathBoxMargin / 2) + pathBoxHeight, pathBoxMargin / 2, window.Width - pathBoxMargin - pathBoxHeight, 24 - pathBoxMargin);
|
||||
pathBox.Text = currentDir;
|
||||
pathBox.Submitted = PathBoxSubmitted;
|
||||
wm.AddWindow(pathBox);
|
||||
|
||||
entryTable = new Table(window, shortcutsWidth, pathBoxHeight + headerHeight, window.Width - shortcutsWidth, window.Height - pathBoxHeight - headerHeight);
|
||||
entryTable.OnDoubleClick = EntryTableDoubleClicked;
|
||||
PopulateEntryTable();
|
||||
wm.AddWindow(entryTable);
|
||||
|
||||
header = new Window(this, window, shortcutsWidth, pathBoxHeight, window.Width - shortcutsWidth, headerHeight);
|
||||
wm.AddWindow(header);
|
||||
RenderHeader(updateWindow: false);
|
||||
|
||||
shortcutsTable = new Table(window, 0, pathBoxHeight, shortcutsWidth, window.Height - pathBoxHeight);
|
||||
shortcutsTable.AllowDeselection = false;
|
||||
shortcutsTable.Background = Color.DarkGray;
|
||||
shortcutsTable.Foreground = Color.White;
|
||||
PopulateShortcutTable();
|
||||
shortcutsTable.SelectedCellIndex = 0;
|
||||
shortcutsTable.TableCellSelected = ShortcutsTableCellSelected;
|
||||
wm.AddWindow(shortcutsTable);
|
||||
|
||||
wm.Update(window);
|
||||
}
|
||||
|
||||
public override void Run()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
52
Gui/Apps/Info.cs
Normal file
@@ -0,0 +1,52 @@
|
||||
using CMLeonOS;
|
||||
using CMLeonOS.Gui.UILib;
|
||||
using CMLeonOS.Utils;
|
||||
using System.Drawing;
|
||||
|
||||
namespace CMLeonOS.Gui.Apps
|
||||
{
|
||||
internal class Info : Process
|
||||
{
|
||||
internal Info() : base("Info", ProcessType.Application) { }
|
||||
|
||||
AppWindow window;
|
||||
|
||||
WindowManager wm = ProcessManager.GetProcess<WindowManager>();
|
||||
|
||||
public override void Start()
|
||||
{
|
||||
base.Start();
|
||||
window = new AppWindow(this, 256, 256, 320, 256);
|
||||
wm.AddWindow(window);
|
||||
window.Title = "Info";
|
||||
window.Icon = AppManager.GetAppMetadata("Info").Icon;
|
||||
window.Closing = TryStop;
|
||||
|
||||
window.Clear(Color.LightGray);
|
||||
window.DrawFilledRectangle(0, 0, window.Width, 40, Color.Black);
|
||||
window.DrawString("CMLeonOS", System.Drawing.Color.White, 12, 12);
|
||||
|
||||
window.DrawString($"OS: CMLeonOS {Kernel.Version}", Color.Black, 12, 52);
|
||||
window.DrawString($"Memory: {Cosmos.Core.CPU.GetAmountOfRAM()} MB", Color.Black, 12, 80);
|
||||
|
||||
window.DrawString("Credits", Color.DarkBlue, 12, 108);
|
||||
window.DrawString("Microsoft - .NET Runtime", Color.Black, 12, 132);
|
||||
window.DrawString("Google Fonts - Font", Color.Black, 12, 156);
|
||||
|
||||
Button button = new Button(window, window.Width - 80 - 12, window.Height - 20 - 12, 80, 20);
|
||||
button.Text = "OK";
|
||||
button.OnClick = (int x, int y) =>
|
||||
{
|
||||
wm.RemoveWindow(window);
|
||||
};
|
||||
wm.AddWindow(button);
|
||||
|
||||
wm.Update(window);
|
||||
}
|
||||
|
||||
public override void Run()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
138
Gui/Apps/Logs.cs
Normal file
@@ -0,0 +1,138 @@
|
||||
using Cosmos.System.Graphics;
|
||||
using CMLeonOS;
|
||||
using CMLeonOS.Gui.SmoothMono;
|
||||
using CMLeonOS.Gui.UILib;
|
||||
using CMLeonOS.Logger;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
|
||||
namespace CMLeonOS.Gui.Apps
|
||||
{
|
||||
internal class Logs : Process
|
||||
{
|
||||
internal Logs() : base("Logs", ProcessType.Application) { }
|
||||
|
||||
AppWindow window;
|
||||
|
||||
Table table;
|
||||
|
||||
WindowManager wm = ProcessManager.GetProcess<WindowManager>();
|
||||
|
||||
private static class Icons
|
||||
{
|
||||
[IL2CPU.API.Attribs.ManifestResourceStream(ResourceName = "CMLeonOS.Gui.Resources.Logs.Info.bmp")]
|
||||
private static byte[] _iconBytes_Info;
|
||||
internal static Bitmap Icon_Info = new Bitmap(_iconBytes_Info);
|
||||
|
||||
[IL2CPU.API.Attribs.ManifestResourceStream(ResourceName = "CMLeonOS.Gui.Resources.Logs.Warning.bmp")]
|
||||
private static byte[] _iconBytes_Warning;
|
||||
internal static Bitmap Icon_Warning = new Bitmap(_iconBytes_Warning);
|
||||
|
||||
[IL2CPU.API.Attribs.ManifestResourceStream(ResourceName = "CMLeonOS.Gui.Resources.Logs.Error.bmp")]
|
||||
private static byte[] _iconBytes_Error;
|
||||
internal static Bitmap Icon_Error = new Bitmap(_iconBytes_Error);
|
||||
}
|
||||
|
||||
private void AddLogToTable(LogEntry log)
|
||||
{
|
||||
Bitmap icon;
|
||||
switch (log.Priority)
|
||||
{
|
||||
case LogLevel.Info:
|
||||
icon = Icons.Icon_Info;
|
||||
break;
|
||||
case LogLevel.Warning:
|
||||
icon = Icons.Icon_Warning;
|
||||
break;
|
||||
case LogLevel.Error:
|
||||
icon = Icons.Icon_Error;
|
||||
break;
|
||||
default:
|
||||
icon = null;
|
||||
break;
|
||||
}
|
||||
table.Cells.Add(new TableCell(icon, $"{log.Date.ToString("HH:mm")} - {log.Source}: {log.Message}", log));
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
window.Clear(Color.Gray);
|
||||
|
||||
string text = $"{Log.Logs.Count} messages";
|
||||
window.DrawString(text, Color.White, window.Width - (FontData.Width * text.Length) - 12, window.Height - FontData.Height - 12);
|
||||
|
||||
table.Render();
|
||||
table.ScrollToBottom();
|
||||
|
||||
wm.Update(window);
|
||||
}
|
||||
|
||||
public override void Start()
|
||||
{
|
||||
base.Start();
|
||||
|
||||
if (UserSystem.CurrentLoggedInUser == null || !UserSystem.CurrentLoggedInUser.Admin)
|
||||
{
|
||||
MessageBox messageBox = new MessageBox(Parent, Name, "You must be an admin to run this app.");
|
||||
messageBox.Show();
|
||||
|
||||
TryStop();
|
||||
return;
|
||||
}
|
||||
|
||||
window = new AppWindow(this, 256, 256, 512, 352);
|
||||
wm.AddWindow(window);
|
||||
window.Icon = AppManager.GetAppMetadata("Event Log").Icon;
|
||||
window.Title = "Event Log";
|
||||
window.Closing = TryStop;
|
||||
|
||||
table = new Table(window, 12, 12, window.Width - 24, window.Height - 24 - 16 - 12);
|
||||
table.OnDoubleClick = (int x, int y) =>
|
||||
{
|
||||
if (table.SelectedCellIndex != -1)
|
||||
{
|
||||
LogEntry log = (LogEntry)table.Cells[table.SelectedCellIndex].Tag;
|
||||
|
||||
string priority = log.Priority switch
|
||||
{
|
||||
LogLevel.Info => "Info",
|
||||
LogLevel.Warning => "Warning",
|
||||
LogLevel.Error => "Error",
|
||||
_ => "Unknown"
|
||||
};
|
||||
|
||||
StringBuilder builder = new StringBuilder();
|
||||
|
||||
builder.AppendLine($"Date: {log.Date.ToLongDateString()} {log.Date.ToLongTimeString()}");
|
||||
builder.AppendLine($"Source: {log.Source}");
|
||||
builder.AppendLine($"Priority: {priority}");
|
||||
builder.AppendLine();
|
||||
builder.Append(log.Message);
|
||||
|
||||
MessageBox messageBox = new MessageBox(this, $"{log.Source}: Log Event", builder.ToString());
|
||||
messageBox.Show();
|
||||
}
|
||||
};
|
||||
wm.AddWindow(table);
|
||||
|
||||
table.Cells.Clear();
|
||||
foreach (LogEntry log in Log.Logs)
|
||||
{
|
||||
AddLogToTable(log);
|
||||
}
|
||||
|
||||
Log.LogEmittedReceivers.Add((LogEntry log) =>
|
||||
{
|
||||
AddLogToTable(log);
|
||||
Update();
|
||||
});
|
||||
|
||||
Update();
|
||||
}
|
||||
|
||||
public override void Run()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
71
Gui/Apps/MemoryStatistics.cs
Normal file
@@ -0,0 +1,71 @@
|
||||
using CMLeonOS;
|
||||
using CMLeonOS.Utils;
|
||||
using CMLeonOS.Gui.SmoothMono;
|
||||
using CMLeonOS.Gui.UILib;
|
||||
using System;
|
||||
using System.Drawing;
|
||||
|
||||
namespace CMLeonOS.Gui.Apps
|
||||
{
|
||||
internal class MemoryStatistics : Process
|
||||
{
|
||||
internal MemoryStatistics() : base("MemoryStatistics", ProcessType.Application) { }
|
||||
|
||||
AppWindow window;
|
||||
|
||||
WindowManager wm = ProcessManager.GetProcess<WindowManager>();
|
||||
|
||||
private int lastSecond;
|
||||
|
||||
private static int padding = 12;
|
||||
private static int barHeight = 12;
|
||||
private static Color barColour = Color.FromArgb(0, 155, 254);
|
||||
|
||||
private void Update()
|
||||
{
|
||||
window.Clear(Color.LightGray);
|
||||
|
||||
var statistics = MemoryStatisticsProvider.GetMemoryStatistics();
|
||||
|
||||
window.DrawString("Memory Statistics", Color.DarkBlue, padding, padding);
|
||||
|
||||
window.DrawString(string.Format(@"Total: {0} MB
|
||||
Unavailable: {1} MB
|
||||
Used: {2:d1} MB
|
||||
Free: {3} MB
|
||||
Percentage Used: {4:d1}%",
|
||||
statistics.TotalMB,
|
||||
statistics.UnavailableMB,
|
||||
statistics.UsedMB,
|
||||
statistics.FreeMB,
|
||||
statistics.PercentUsed), Color.Black, padding, padding + FontData.Height + padding);
|
||||
|
||||
window.DrawFilledRectangle(0, window.Height - barHeight, window.Width, barHeight, Color.Black);
|
||||
window.DrawFilledRectangle(0, window.Height - barHeight, (int)(window.Width * ((float)statistics.PercentUsed / 100f)), barHeight, barColour);
|
||||
|
||||
wm.Update(window);
|
||||
}
|
||||
|
||||
public override void Start()
|
||||
{
|
||||
base.Start();
|
||||
window = new AppWindow(this, 256, 256, 256, 192);
|
||||
wm.AddWindow(window);
|
||||
window.Title = "Memory Statistics";
|
||||
window.Icon = AppManager.GetAppMetadata("Memory Statistics").Icon;
|
||||
window.Closing = TryStop;
|
||||
|
||||
Update();
|
||||
}
|
||||
|
||||
public override void Run()
|
||||
{
|
||||
int second = DateTime.Now.Second;
|
||||
if (lastSecond != second)
|
||||
{
|
||||
lastSecond = second;
|
||||
Update();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
212
Gui/Apps/Notepad.cs
Normal file
@@ -0,0 +1,212 @@
|
||||
using CMLeonOS;
|
||||
using CMLeonOS.Gui.SmoothMono;
|
||||
using CMLeonOS.Gui.UILib;
|
||||
using CMLeonOS.Utils;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
|
||||
namespace CMLeonOS.Gui.Apps
|
||||
{
|
||||
internal class Notepad : Process
|
||||
{
|
||||
internal Notepad() : base("Notepad", ProcessType.Application) { }
|
||||
|
||||
internal Notepad(string path) : base("Notepad", ProcessType.Application)
|
||||
{
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
AppWindow window;
|
||||
|
||||
WindowManager wm = ProcessManager.GetProcess<WindowManager>();
|
||||
SettingsService settingsService = ProcessManager.GetProcess<SettingsService>();
|
||||
TextBox textBox;
|
||||
|
||||
ShortcutBar shortcutBar;
|
||||
|
||||
FileBrowser fileBrowser;
|
||||
|
||||
private string? path = null;
|
||||
|
||||
private bool modified = false;
|
||||
|
||||
private void TextChanged()
|
||||
{
|
||||
modified = true;
|
||||
|
||||
UpdateTitle();
|
||||
}
|
||||
|
||||
private void WindowResized()
|
||||
{
|
||||
textBox.Resize(window.Width, window.Height - 20);
|
||||
shortcutBar.Resize(window.Width, 20);
|
||||
|
||||
shortcutBar.Render();
|
||||
|
||||
textBox.MarkAllLines();
|
||||
textBox.Render();
|
||||
}
|
||||
|
||||
private void UpdateTitle()
|
||||
{
|
||||
if (path == null)
|
||||
{
|
||||
window.Title = "Untitled - Notepad";
|
||||
return;
|
||||
}
|
||||
|
||||
if (modified)
|
||||
{
|
||||
window.Title = $"{Path.GetFileName(path)}* - Notepad";
|
||||
}
|
||||
else
|
||||
{
|
||||
window.Title = $"{Path.GetFileName(path)} - Notepad";
|
||||
}
|
||||
}
|
||||
|
||||
internal void Open(string newPath, bool readFile = true)
|
||||
{
|
||||
if (newPath == null) return;
|
||||
|
||||
if (readFile && !File.Exists(newPath))
|
||||
{
|
||||
MessageBox messageBox = new MessageBox(this, "Notepad", $"No such file '{Path.GetFileName(newPath)}'.");
|
||||
messageBox.Show();
|
||||
}
|
||||
|
||||
path = newPath;
|
||||
|
||||
if (readFile)
|
||||
{
|
||||
textBox.Text = File.ReadAllText(path);
|
||||
|
||||
textBox.MarkAllLines();
|
||||
textBox.Render();
|
||||
|
||||
modified = false;
|
||||
}
|
||||
|
||||
UpdateTitle();
|
||||
}
|
||||
|
||||
private void OpenFilePrompt()
|
||||
{
|
||||
fileBrowser = new FileBrowser(this, wm, (string selectedPath) =>
|
||||
{
|
||||
if (selectedPath != null)
|
||||
{
|
||||
Open(selectedPath);
|
||||
}
|
||||
});
|
||||
fileBrowser.Show();
|
||||
}
|
||||
|
||||
private void SaveAsPrompt()
|
||||
{
|
||||
fileBrowser = new FileBrowser(this, wm, (string selectedPath) =>
|
||||
{
|
||||
if (selectedPath != null)
|
||||
{
|
||||
path = selectedPath;
|
||||
Save();
|
||||
}
|
||||
}, selectDirectoryOnly: true);
|
||||
fileBrowser.Show();
|
||||
}
|
||||
|
||||
private void Save()
|
||||
{
|
||||
if (path == null)
|
||||
{
|
||||
SaveAsPrompt();
|
||||
return;
|
||||
}
|
||||
|
||||
File.WriteAllText(path, textBox.Text);
|
||||
|
||||
modified = false;
|
||||
UpdateTitle();
|
||||
}
|
||||
|
||||
private void ApplyTheme()
|
||||
{
|
||||
if (settingsService.DarkNotepad)
|
||||
{
|
||||
textBox.Background = Color.FromArgb(24, 24, 30);
|
||||
textBox.Foreground = Color.White;
|
||||
|
||||
shortcutBar.Background = Color.FromArgb(56, 56, 71);
|
||||
shortcutBar.Foreground = Color.White;
|
||||
}
|
||||
else
|
||||
{
|
||||
textBox.Background = Color.White;
|
||||
textBox.Foreground = Color.Black;
|
||||
|
||||
shortcutBar.Background = Color.LightGray;
|
||||
shortcutBar.Foreground = Color.Black;
|
||||
}
|
||||
|
||||
textBox.MarkAllLines();
|
||||
textBox.Render();
|
||||
}
|
||||
|
||||
private void OpenViewSettings()
|
||||
{
|
||||
AppWindow settingsWindow = new AppWindow(this, 320, 264, 256, 192);
|
||||
settingsWindow.DrawString("Notepad Settings", Color.DarkBlue, 12, 12);
|
||||
settingsWindow.DrawString($"Notepad v{Kernel.Version}", Color.DarkGray, 12, settingsWindow.Height - 12 - FontData.Height);
|
||||
wm.AddWindow(settingsWindow);
|
||||
settingsWindow.Title = "Notepad";
|
||||
|
||||
Switch darkSwitch = new Switch(settingsWindow, 12, 40, settingsWindow.Width - 16, 20);
|
||||
darkSwitch.Text = "Dark theme";
|
||||
darkSwitch.Checked = settingsService.DarkNotepad;
|
||||
darkSwitch.CheckBoxChanged = (bool @checked) =>
|
||||
{
|
||||
settingsService.DarkNotepad = @checked;
|
||||
ApplyTheme();
|
||||
};
|
||||
wm.AddWindow(darkSwitch);
|
||||
|
||||
wm.Update(settingsWindow);
|
||||
}
|
||||
|
||||
public override void Start()
|
||||
{
|
||||
base.Start();
|
||||
window = new AppWindow(this, 320, 264, 384, 240);
|
||||
wm.AddWindow(window);
|
||||
UpdateTitle();
|
||||
window.Closing = TryStop;
|
||||
window.Icon = AppManager.GetAppMetadata("Notepad").Icon;
|
||||
window.CanResize = true;
|
||||
window.UserResized = WindowResized;
|
||||
|
||||
shortcutBar = new ShortcutBar(window, 0, 0, window.Width, 20);
|
||||
shortcutBar.Cells.Add(new ShortcutBarCell("Open", OpenFilePrompt));
|
||||
shortcutBar.Cells.Add(new ShortcutBarCell("Save", Save));
|
||||
shortcutBar.Cells.Add(new ShortcutBarCell("Save As", SaveAsPrompt));
|
||||
shortcutBar.Cells.Add(new ShortcutBarCell("View", OpenViewSettings));
|
||||
shortcutBar.Render();
|
||||
wm.AddWindow(shortcutBar);
|
||||
|
||||
textBox = new TextBox(window, 0, 20, window.Width, window.Height - 20);
|
||||
textBox.MultiLine = true;
|
||||
textBox.Changed = TextChanged;
|
||||
wm.AddWindow(textBox);
|
||||
|
||||
ApplyTheme();
|
||||
|
||||
Open(path);
|
||||
|
||||
wm.Update(window);
|
||||
}
|
||||
|
||||
public override void Run()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
89
Gui/Apps/Paint/ColourPicker.cs
Normal file
@@ -0,0 +1,89 @@
|
||||
using CMLeonOS.Gui.UILib;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
|
||||
namespace CMLeonOS.Gui.Apps.Paint
|
||||
{
|
||||
internal class ColourPicker : Window
|
||||
{
|
||||
private Paint paintInstance;
|
||||
|
||||
private Table table;
|
||||
|
||||
internal readonly List<Color> Colours = new List<Color>()
|
||||
{
|
||||
Color.Black,
|
||||
Color.White,
|
||||
Color.Red,
|
||||
Color.Blue,
|
||||
Color.Orange,
|
||||
Color.Green,
|
||||
Color.Pink,
|
||||
Color.Gray,
|
||||
Color.Purple,
|
||||
Color.DarkGoldenrod,
|
||||
Color.DarkGray,
|
||||
Color.DarkGreen,
|
||||
Color.DarkCyan,
|
||||
Color.Cyan,
|
||||
Color.BlueViolet,
|
||||
Color.AliceBlue,
|
||||
Color.Brown,
|
||||
Color.CornflowerBlue,
|
||||
Color.Azure,
|
||||
Color.Beige,
|
||||
Color.DarkBlue,
|
||||
Color.DarkSlateBlue,
|
||||
Color.SeaGreen
|
||||
};
|
||||
|
||||
private void TableClicked(int x, int y)
|
||||
{
|
||||
// Clear 'Selected' text on previously selected colour.
|
||||
foreach (var cell in table.Cells)
|
||||
{
|
||||
cell.Text = string.Empty;
|
||||
}
|
||||
|
||||
var selectedCell = table.Cells[table.SelectedCellIndex];
|
||||
Color color = (Color)selectedCell.Tag;
|
||||
|
||||
paintInstance.SelectedColor = color;
|
||||
|
||||
selectedCell.Text = "Selected";
|
||||
|
||||
table.Render();
|
||||
}
|
||||
|
||||
internal ColourPicker(Paint paint, int x, int y, int width, int height) : base(paint, x, y, width, height)
|
||||
{
|
||||
paintInstance = paint;
|
||||
|
||||
Clear(Color.FromArgb(107, 107, 107));
|
||||
DrawString("Colours", Color.White, 8, 8);
|
||||
|
||||
table = new Table(this, 0, 32, Width, Height - 32);
|
||||
table.AllowDeselection = false;
|
||||
table.CellHeight = 20;
|
||||
table.TextAlignment = Alignment.Middle;
|
||||
table.OnClick = TableClicked;
|
||||
|
||||
foreach (Color colour in Colours)
|
||||
{
|
||||
TableCell cell = new(string.Empty, tag: colour);
|
||||
cell.BackgroundColourOverride = colour;
|
||||
cell.ForegroundColourOverride = colour.GetForegroundColour();
|
||||
if (colour == paint.SelectedColor)
|
||||
{
|
||||
cell.Text = "Selected";
|
||||
}
|
||||
table.Cells.Add(cell);
|
||||
}
|
||||
|
||||
table.Render();
|
||||
|
||||
WM.AddWindow(this);
|
||||
WM.AddWindow(table);
|
||||
}
|
||||
}
|
||||
}
|
||||
88
Gui/Apps/Paint/Paint.cs
Normal file
@@ -0,0 +1,88 @@
|
||||
using Cosmos.System;
|
||||
using CMLeonOS;
|
||||
using CMLeonOS.Gui.UILib;
|
||||
using System.Drawing;
|
||||
|
||||
namespace CMLeonOS.Gui.Apps.Paint
|
||||
{
|
||||
internal class Paint : Process
|
||||
{
|
||||
internal Paint() : base("Paint", ProcessType.Application)
|
||||
{
|
||||
}
|
||||
|
||||
AppWindow window;
|
||||
|
||||
Window canvas;
|
||||
|
||||
ToolBox toolBox;
|
||||
|
||||
ColourPicker colourPicker;
|
||||
|
||||
WindowManager wm = ProcessManager.GetProcess<WindowManager>();
|
||||
|
||||
private bool down = false;
|
||||
|
||||
internal Color SelectedColor { get; set; } = Color.Black;
|
||||
|
||||
internal bool IsInBounds(int x, int y)
|
||||
{
|
||||
if (x >= canvas.Width || y >= canvas.Height) return false;
|
||||
if (x < 0 || y < 0) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private void CanvasDown(int x, int y)
|
||||
{
|
||||
down = true;
|
||||
}
|
||||
|
||||
public override void Start()
|
||||
{
|
||||
base.Start();
|
||||
window = new AppWindow(this, 256, 256, 768, 448);
|
||||
window.Title = "Paint";
|
||||
window.Icon = AppManager.GetAppMetadata("Paint").Icon;
|
||||
window.Closing = TryStop;
|
||||
window.Clear(Color.FromArgb(73, 73, 73));
|
||||
wm.AddWindow(window);
|
||||
|
||||
int canvasWidth = 384;
|
||||
int canvasHeight = 256;
|
||||
canvas = new Window(this, (window.Width / 2) - (canvasWidth / 2), (window.Height / 2) - (canvasHeight / 2), canvasWidth, canvasHeight);
|
||||
canvas.RelativeTo = window;
|
||||
canvas.OnDown = CanvasDown;
|
||||
canvas.Clear(Color.White);
|
||||
wm.AddWindow(canvas);
|
||||
|
||||
toolBox = new ToolBox(this, 0, 0, 128, window.Height);
|
||||
toolBox.RelativeTo = window;
|
||||
colourPicker = new ColourPicker(this, window.Width - 128, 0, 128, window.Height);
|
||||
colourPicker.RelativeTo = window;
|
||||
|
||||
wm.Update(window);
|
||||
}
|
||||
|
||||
public override void Run()
|
||||
{
|
||||
if (down)
|
||||
{
|
||||
if (MouseManager.MouseState == MouseState.None)
|
||||
{
|
||||
down = false;
|
||||
}
|
||||
|
||||
toolBox.SelectedTool.Run(
|
||||
this,
|
||||
canvas,
|
||||
MouseManager.MouseState,
|
||||
(int)(MouseManager.X - canvas.ScreenX),
|
||||
(int)(MouseManager.Y - canvas.ScreenY)
|
||||
);
|
||||
|
||||
wm.Update(canvas);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
24
Gui/Apps/Paint/Tool.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using Cosmos.System;
|
||||
|
||||
namespace CMLeonOS.Gui.Apps.Paint
|
||||
{
|
||||
internal abstract class Tool
|
||||
{
|
||||
internal Tool(string name)
|
||||
{
|
||||
Name = name;
|
||||
}
|
||||
|
||||
internal abstract void Run(Paint paint, Window canvas, MouseState mouseState, int mouseX, int mouseY);
|
||||
|
||||
internal virtual void Selected()
|
||||
{
|
||||
}
|
||||
|
||||
internal virtual void Deselected()
|
||||
{
|
||||
}
|
||||
|
||||
internal string Name { get; init; }
|
||||
}
|
||||
}
|
||||
60
Gui/Apps/Paint/ToolBox.cs
Normal file
@@ -0,0 +1,60 @@
|
||||
using CMLeonOS.Gui.UILib;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
|
||||
namespace CMLeonOS.Gui.Apps.Paint
|
||||
{
|
||||
internal class ToolBox : Window
|
||||
{
|
||||
private Paint paintInstance;
|
||||
|
||||
private Table table;
|
||||
|
||||
internal Tool SelectedTool;
|
||||
|
||||
internal readonly List<Tool> Tools = new List<Tool>()
|
||||
{
|
||||
new Tools.Pencil(),
|
||||
new Tools.CircleBrush()
|
||||
};
|
||||
|
||||
private void TableClicked(int x, int y)
|
||||
{
|
||||
Tool tool = table.Cells[table.SelectedCellIndex].Tag as Tool;
|
||||
|
||||
if (tool != SelectedTool)
|
||||
{
|
||||
SelectedTool.Deselected();
|
||||
SelectedTool = tool;
|
||||
}
|
||||
}
|
||||
|
||||
internal ToolBox(Paint paint, int x, int y, int width, int height) : base(paint, x, y, width, height)
|
||||
{
|
||||
paintInstance = paint;
|
||||
|
||||
|
||||
Clear(Color.FromArgb(107, 107, 107));
|
||||
DrawString("Toolbox", Color.White, 8, 8);
|
||||
|
||||
table = new Table(this, 0, 32, Width, Height - 32);
|
||||
table.AllowDeselection = false;
|
||||
table.CellHeight = 24;
|
||||
table.TextAlignment = Alignment.Middle;
|
||||
table.OnClick = TableClicked;
|
||||
|
||||
foreach (Tool tool in Tools)
|
||||
{
|
||||
table.Cells.Add(new TableCell(tool.Name, tool));
|
||||
}
|
||||
|
||||
SelectedTool = Tools[0];
|
||||
table.SelectedCellIndex = 0;
|
||||
|
||||
table.Render();
|
||||
|
||||
WM.AddWindow(this);
|
||||
WM.AddWindow(table);
|
||||
}
|
||||
}
|
||||
}
|
||||
19
Gui/Apps/Paint/Tools/CircleBrush.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using Cosmos.System;
|
||||
|
||||
namespace CMLeonOS.Gui.Apps.Paint.Tools
|
||||
{
|
||||
internal class CircleBrush : Tool
|
||||
{
|
||||
public CircleBrush() : base("Circle brush")
|
||||
{
|
||||
}
|
||||
|
||||
internal override void Run(Paint paint, Window canvas, MouseState mouseState, int mouseX, int mouseY)
|
||||
{
|
||||
if (mouseState == MouseState.Left)
|
||||
{
|
||||
canvas.DrawCircle(mouseX, mouseY, 5, paint.SelectedColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
42
Gui/Apps/Paint/Tools/Pencil.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using Cosmos.System;
|
||||
|
||||
namespace CMLeonOS.Gui.Apps.Paint.Tools
|
||||
{
|
||||
internal class Pencil : Tool
|
||||
{
|
||||
public Pencil() : base("Pencil")
|
||||
{
|
||||
}
|
||||
|
||||
private bool joinLine;
|
||||
private int joinX;
|
||||
private int joinY;
|
||||
|
||||
internal override void Run(Paint paint, Window canvas, MouseState mouseState, int mouseX, int mouseY)
|
||||
{
|
||||
if (mouseState == MouseState.Left)
|
||||
{
|
||||
if (joinLine)
|
||||
{
|
||||
canvas.DrawLine(joinX, joinY, mouseX, mouseY, paint.SelectedColor);
|
||||
}
|
||||
else
|
||||
{
|
||||
canvas.DrawPoint(mouseX, mouseY, paint.SelectedColor);
|
||||
}
|
||||
joinLine = true;
|
||||
joinX = mouseX;
|
||||
joinY = mouseY;
|
||||
}
|
||||
else
|
||||
{
|
||||
joinLine = false;
|
||||
}
|
||||
}
|
||||
|
||||
internal override void Deselected()
|
||||
{
|
||||
joinLine = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
299
Gui/Apps/Settings.cs
Normal file
@@ -0,0 +1,299 @@
|
||||
using Cosmos.System.Graphics;
|
||||
using CMLeonOS;
|
||||
using CMLeonOS.Gui.UILib;
|
||||
using CMLeonOS.Settings;
|
||||
|
||||
using System.Drawing;
|
||||
|
||||
namespace CMLeonOS.Gui.Apps
|
||||
{
|
||||
internal class Settings : Process
|
||||
{
|
||||
internal Settings() : base("Settings", ProcessType.Application) { }
|
||||
|
||||
AppWindow window;
|
||||
|
||||
Window currentCategoryWindow;
|
||||
|
||||
WindowManager wm = ProcessManager.GetProcess<WindowManager>();
|
||||
|
||||
private static class Icons
|
||||
{
|
||||
[IL2CPU.API.Attribs.ManifestResourceStream(ResourceName = "CMLeonOS.Gui.Resources.Settings.User.bmp")]
|
||||
private static byte[] _iconBytes_User;
|
||||
internal static Bitmap Icon_User = new Bitmap(_iconBytes_User);
|
||||
|
||||
[IL2CPU.API.Attribs.ManifestResourceStream(ResourceName = "CMLeonOS.Gui.Resources.Settings.Admin.bmp")]
|
||||
private static byte[] _iconBytes_Admin;
|
||||
internal static Bitmap Icon_Admin = new Bitmap(_iconBytes_Admin);
|
||||
|
||||
[IL2CPU.API.Attribs.ManifestResourceStream(ResourceName = "CMLeonOS.Gui.Resources.Settings.Info.bmp")]
|
||||
private static byte[] _iconBytes_Info;
|
||||
internal static Bitmap Icon_Info = new Bitmap(_iconBytes_Info);
|
||||
}
|
||||
|
||||
private void CategorySelected(int index)
|
||||
{
|
||||
switch (index)
|
||||
{
|
||||
case 0:
|
||||
ShowAppearanceCategory();
|
||||
break;
|
||||
case 1:
|
||||
ShowDisplayCategory();
|
||||
break;
|
||||
case 2:
|
||||
ShowDateTimeCategory();
|
||||
break;
|
||||
case 3:
|
||||
ShowUsersCategory();
|
||||
break;
|
||||
case 4:
|
||||
ShowMouseCategory();
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private void LeftStartButtonChanged(bool @checked)
|
||||
{
|
||||
SettingsManager.GUI_LeftHandStartButton = @checked;
|
||||
}
|
||||
|
||||
private void TwelveHourClockChanged(bool @checked)
|
||||
{
|
||||
SettingsManager.GUI_TwelveHourClock = @checked;
|
||||
}
|
||||
|
||||
private void ShowFpsChanged(bool @checked)
|
||||
{
|
||||
SettingsManager.GUI_ShowFps = @checked;
|
||||
}
|
||||
|
||||
private void MouseSensitivityChanged(float value)
|
||||
{
|
||||
SettingsManager.GUI_MouseSensitivity = value;
|
||||
}
|
||||
|
||||
private void ShowAppearanceCategory()
|
||||
{
|
||||
if (currentCategoryWindow != null)
|
||||
{
|
||||
wm.RemoveWindow(currentCategoryWindow);
|
||||
}
|
||||
Window appearance = new Window(this, window, 128, 0, window.Width - 128, window.Height);
|
||||
currentCategoryWindow = appearance;
|
||||
appearance.DrawString("Appearance Settings", Color.DarkBlue, 12, 12);
|
||||
wm.AddWindow(appearance);
|
||||
|
||||
Switch leftStartButton = new Switch(appearance, 12, 40, 244, 16);
|
||||
leftStartButton.Text = "Left-hand start button";
|
||||
leftStartButton.Checked = SettingsManager.GUI_LeftHandStartButton;
|
||||
leftStartButton.CheckBoxChanged = LeftStartButtonChanged;
|
||||
wm.AddWindow(leftStartButton);
|
||||
|
||||
Switch showFps = new Switch(appearance, 12, 68, 244, 16);
|
||||
showFps.Text = "Show frames per second";
|
||||
showFps.Checked = SettingsManager.GUI_ShowFps;
|
||||
showFps.CheckBoxChanged = ShowFpsChanged;
|
||||
wm.AddWindow(showFps);
|
||||
|
||||
wm.Update(window);
|
||||
}
|
||||
|
||||
private void ShowDateTimeCategory()
|
||||
{
|
||||
if (currentCategoryWindow != null)
|
||||
{
|
||||
wm.RemoveWindow(currentCategoryWindow);
|
||||
}
|
||||
Window dateTime = new Window(this, window, 128, 0, window.Width - 128, window.Height);
|
||||
currentCategoryWindow = dateTime;
|
||||
dateTime.DrawString("Date & Time Settings", Color.DarkBlue, 12, 12);
|
||||
wm.AddWindow(dateTime);
|
||||
|
||||
Switch twelveHourClock = new Switch(dateTime, 12, 40, 244, 16);
|
||||
twelveHourClock.Text = "12-hour clock";
|
||||
twelveHourClock.Checked = SettingsManager.GUI_TwelveHourClock;
|
||||
twelveHourClock.CheckBoxChanged = TwelveHourClockChanged;
|
||||
wm.AddWindow(twelveHourClock);
|
||||
|
||||
AppMetadata calendarApp = AppManager.GetAppMetadata("Calendar");
|
||||
Button openCalendar = new Button(dateTime, 12, 68, 160, 20);
|
||||
openCalendar.Text = "Open Calendar";
|
||||
openCalendar.Image = calendarApp.Icon.Resize(20, 20);
|
||||
openCalendar.ImageLocation = Button.ButtonImageLocation.Left;
|
||||
openCalendar.OnClick = (int x, int y) =>
|
||||
{
|
||||
calendarApp.Start(wm);
|
||||
};
|
||||
wm.AddWindow(openCalendar);
|
||||
|
||||
wm.Update(window);
|
||||
}
|
||||
|
||||
private void ShowDisplayCategory()
|
||||
{
|
||||
|
||||
if (currentCategoryWindow != null)
|
||||
{
|
||||
wm.RemoveWindow(currentCategoryWindow);
|
||||
}
|
||||
Window display = new Window(this, window, 128, 0, window.Width - 128, window.Height);
|
||||
currentCategoryWindow = display;
|
||||
display.DrawString("Display Settings", Color.DarkBlue, 12, 12);
|
||||
wm.AddWindow(display);
|
||||
|
||||
Table resolutionsTable = new Table(display, 12, 40, display.Width - 24, display.Height - 12 - 16 - 12 - 12 - 16 - 12);
|
||||
resolutionsTable.AllowDeselection = false;
|
||||
for (int i = 0; i < wm.AvailableModes.Count; i++)
|
||||
{
|
||||
Mode mode = wm.AvailableModes[i];
|
||||
resolutionsTable.Cells.Add(new TableCell($"{mode.Width}x{mode.Height}"));
|
||||
if (mode.Width == SettingsManager.GUI_ScreenWidth && mode.Height == SettingsManager.GUI_ScreenHeight)
|
||||
{
|
||||
resolutionsTable.SelectedCellIndex = i;
|
||||
}
|
||||
}
|
||||
resolutionsTable.Render();
|
||||
resolutionsTable.TableCellSelected = (int index) =>
|
||||
{
|
||||
Mode mode = wm.AvailableModes[index];
|
||||
SettingsManager.GUI_ScreenWidth = (int)mode.Width;
|
||||
SettingsManager.GUI_ScreenHeight = (int)mode.Height;
|
||||
|
||||
MessageBox messageBox = new MessageBox(this, "Restart Required", "Restart your PC to apply changes.");
|
||||
messageBox.Show();
|
||||
};
|
||||
wm.AddWindow(resolutionsTable);
|
||||
|
||||
display.DrawImageAlpha(Icons.Icon_Info, 12, window.Height - 16 - 12);
|
||||
display.DrawString("Select a screen resolution.", Color.Gray, 36, window.Height - 16 - 12);
|
||||
|
||||
wm.AddWindow(display);
|
||||
|
||||
wm.Update(display);
|
||||
}
|
||||
|
||||
private void ShowUsersCategory()
|
||||
{
|
||||
if (currentCategoryWindow != null)
|
||||
{
|
||||
wm.RemoveWindow(currentCategoryWindow);
|
||||
}
|
||||
Window users = new Window(this, window, 128, 0, window.Width - 128, window.Height);
|
||||
currentCategoryWindow = users;
|
||||
users.DrawString("Users", Color.DarkBlue, 12, 12);
|
||||
users.DrawImageAlpha(Icons.Icon_Info, 12, window.Height - 16 - 12);
|
||||
users.DrawString("Double-click on a user for info.", Color.Gray, 36, window.Height - 16 - 12);
|
||||
wm.AddWindow(users);
|
||||
|
||||
Table usersTable = new Table(users, 12, 40, users.Width - 24, users.Height - 40 - 12 - 16 - 12);
|
||||
foreach (User user in UserSystem.GetUsers())
|
||||
{
|
||||
usersTable.Cells.Add(new TableCell(user.Admin ? Icons.Icon_Admin : Icons.Icon_User, user.Username, tag: user));
|
||||
}
|
||||
usersTable.OnDoubleClick = (int x, int y) =>
|
||||
{
|
||||
if (usersTable.SelectedCellIndex != -1)
|
||||
{
|
||||
User user = (User)usersTable.Cells[usersTable.SelectedCellIndex].Tag;
|
||||
|
||||
AppWindow userDetail = new AppWindow(this, 256, 256, 256, 192);
|
||||
userDetail.Title = user.Username;
|
||||
wm.AddWindow(userDetail);
|
||||
|
||||
userDetail.DrawFilledRectangle(0, 0, userDetail.Width, 40, Color.DarkBlue);
|
||||
userDetail.DrawImageAlpha(user.Admin ? Icons.Icon_Admin : Icons.Icon_User, 12, 12);
|
||||
userDetail.DrawString($"User: {user.Username}", Color.White, 36, 12);
|
||||
|
||||
userDetail.DrawString($"Role: {(user.Admin ? "Admin" : "User")}", Color.Black, 12, 48);
|
||||
userDetail.DrawString($"Unread messages: {user.Messages.Count}", Color.Black, 12, 76);
|
||||
|
||||
Button ok = new Button(userDetail, userDetail.Width - 80 - 12, userDetail.Height - 20 - 12, 80, 20);
|
||||
ok.Text = "OK";
|
||||
ok.OnClick = (int x, int y) =>
|
||||
{
|
||||
wm.RemoveWindow(userDetail);
|
||||
};
|
||||
wm.AddWindow(ok);
|
||||
|
||||
wm.Update(userDetail);
|
||||
}
|
||||
};
|
||||
usersTable.Render();
|
||||
wm.AddWindow(usersTable);
|
||||
|
||||
wm.Update(window);
|
||||
}
|
||||
|
||||
private void ShowMouseCategory()
|
||||
{
|
||||
if (currentCategoryWindow != null)
|
||||
{
|
||||
wm.RemoveWindow(currentCategoryWindow);
|
||||
}
|
||||
Window mouse = new Window(this, window, 128, 0, window.Width - 128, window.Height);
|
||||
currentCategoryWindow = mouse;
|
||||
mouse.DrawString("Mouse Settings", Color.DarkBlue, 12, 12);
|
||||
wm.AddWindow(mouse);
|
||||
|
||||
mouse.DrawString("Mouse sensitivity", Color.Gray, 12, 40);
|
||||
|
||||
RangeSlider mouseSensitivity = new RangeSlider(mouse, 12, 68, 244, 30, min: 0.25f, value: SettingsManager.GUI_MouseSensitivity, max: 2f);
|
||||
mouseSensitivity.Changed = MouseSensitivityChanged;
|
||||
wm.AddWindow(mouseSensitivity);
|
||||
|
||||
wm.Update(window);
|
||||
}
|
||||
|
||||
#region Process
|
||||
public override void Start()
|
||||
{
|
||||
base.Start();
|
||||
window = new AppWindow(this, 256, 256, 448, 272);
|
||||
window.Closing = () =>
|
||||
{
|
||||
SettingsManager.FlushSettings();
|
||||
TryStop();
|
||||
};
|
||||
window.Icon = AppManager.GetAppMetadata("Settings").Icon;
|
||||
wm.AddWindow(window);
|
||||
|
||||
window.Title = "Settings";
|
||||
|
||||
Table categoryTable = new Table(window, 0, 0, 128, window.Height);
|
||||
|
||||
categoryTable.TextAlignment = Alignment.Middle;
|
||||
|
||||
categoryTable.TableCellSelected = CategorySelected;
|
||||
categoryTable.SelectedCellIndex = 0;
|
||||
categoryTable.AllowDeselection = false;
|
||||
|
||||
categoryTable.CellHeight = 24;
|
||||
|
||||
/*categoryTable.Border = categoryTable.Background;
|
||||
categoryTable.SelectedBorder = categoryTable.SelectedBackground;*/
|
||||
|
||||
categoryTable.Cells.Add(new TableCell("Appearance"));
|
||||
categoryTable.Cells.Add(new TableCell("Display"));
|
||||
categoryTable.Cells.Add(new TableCell("Date & Time"));
|
||||
categoryTable.Cells.Add(new TableCell("Users"));
|
||||
categoryTable.Cells.Add(new TableCell("Mouse"));
|
||||
|
||||
categoryTable.Render();
|
||||
|
||||
wm.AddWindow(categoryTable);
|
||||
|
||||
ShowAppearanceCategory();
|
||||
|
||||
wm.Update(window);
|
||||
}
|
||||
|
||||
public override void Run()
|
||||
{
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
161
Gui/Apps/Stopwatch.cs
Normal file
@@ -0,0 +1,161 @@
|
||||
using CMLeonOS;
|
||||
using CMLeonOS.Gui.SmoothMono;
|
||||
using CMLeonOS.Gui.UILib;
|
||||
using System;
|
||||
using System.Drawing;
|
||||
|
||||
namespace CMLeonOS.Gui.Apps
|
||||
{
|
||||
internal class Stopwatch : Process
|
||||
{
|
||||
internal Stopwatch() : base("Stopwatch", ProcessType.Application) { }
|
||||
|
||||
AppWindow window;
|
||||
|
||||
Button startStopButton;
|
||||
|
||||
Button lapResetButton;
|
||||
|
||||
Table lapTable;
|
||||
|
||||
WindowManager wm = ProcessManager.GetProcess<WindowManager>();
|
||||
|
||||
private const string format = @"hh\:mm\:ss";
|
||||
|
||||
private readonly Color background = Color.FromArgb(56, 56, 71);
|
||||
|
||||
private bool stopwatchRunning = false;
|
||||
|
||||
DateTime startTime;
|
||||
DateTime lastLap;
|
||||
TimeSpan elapsed = TimeSpan.Zero;
|
||||
int lastSecond;
|
||||
|
||||
private void UpdateWindow()
|
||||
{
|
||||
window.Clear(background);
|
||||
|
||||
string text;
|
||||
text = elapsed.ToString(format);
|
||||
window.DrawString(text, System.Drawing.Color.White, (window.Width / 2) - ((text.Length * FontData.Width) / 2), 8);
|
||||
|
||||
wm.Update(window);
|
||||
}
|
||||
|
||||
private void StartStopwatch()
|
||||
{
|
||||
if (stopwatchRunning) return;
|
||||
|
||||
stopwatchRunning = true;
|
||||
startTime = DateTime.Now;
|
||||
lastLap = startTime;
|
||||
lastSecond = startTime.Second;
|
||||
|
||||
startStopButton.Text = "Stop";
|
||||
lapResetButton.Text = "Lap";
|
||||
}
|
||||
|
||||
private void StopStopwatch()
|
||||
{
|
||||
if (!stopwatchRunning) return;
|
||||
|
||||
stopwatchRunning = false;
|
||||
UpdateWindow();
|
||||
|
||||
startStopButton.Text = "Start";
|
||||
lapResetButton.Text = "Reset";
|
||||
}
|
||||
|
||||
private void Lap()
|
||||
{
|
||||
DateTime now = DateTime.Now;
|
||||
|
||||
TableCell cell = new TableCell((now - lastLap).ToString(format));
|
||||
lapTable.Cells.Add(cell);
|
||||
lapTable.ScrollToBottom();
|
||||
lapTable.Render();
|
||||
wm.Update(lapTable);
|
||||
|
||||
lastLap = DateTime.Now;
|
||||
}
|
||||
|
||||
private void Reset()
|
||||
{
|
||||
elapsed = TimeSpan.Zero;
|
||||
|
||||
lapTable.Cells.Clear();
|
||||
lapTable.Render();
|
||||
wm.Update(lapTable);
|
||||
|
||||
UpdateWindow();
|
||||
}
|
||||
|
||||
public override void Start()
|
||||
{
|
||||
base.Start();
|
||||
window = new AppWindow(this, 256, 256, 160, 160);
|
||||
wm.AddWindow(window);
|
||||
window.Title = "Stopwatch";
|
||||
window.Icon = AppManager.GetAppMetadata("Stopwatch").Icon;
|
||||
window.Closing = TryStop;
|
||||
|
||||
startStopButton = new Button(window, window.Width / 2, window.Height - 24, window.Width / 2, 24);
|
||||
startStopButton.Text = "Start";
|
||||
startStopButton.OnClick = (int x, int y) =>
|
||||
{
|
||||
if (stopwatchRunning)
|
||||
{
|
||||
StopStopwatch();
|
||||
}
|
||||
else
|
||||
{
|
||||
StartStopwatch();
|
||||
}
|
||||
};
|
||||
wm.AddWindow(startStopButton);
|
||||
|
||||
lapResetButton = new Button(window, 0, window.Height - 24, window.Width / 2, 24);
|
||||
lapResetButton.Text = "Reset";
|
||||
lapResetButton.OnClick = (int x, int y) =>
|
||||
{
|
||||
if (stopwatchRunning)
|
||||
{
|
||||
Lap();
|
||||
}
|
||||
else
|
||||
{
|
||||
Reset();
|
||||
}
|
||||
};
|
||||
wm.AddWindow(lapResetButton);
|
||||
|
||||
int lapTableY = 8 + FontData.Height + 8;
|
||||
lapTable = new Table(window, 0, lapTableY, window.Width, window.Height - lapTableY - 24);
|
||||
lapTable.Background = Color.FromArgb(80, 80, 102);
|
||||
lapTable.Border = background;
|
||||
lapTable.Foreground = Color.FromArgb(185, 185, 234);
|
||||
lapTable.TextAlignment = Alignment.Middle;
|
||||
lapTable.AllowSelection = false;
|
||||
lapTable.CellHeight = 20;
|
||||
lapTable.ScrollbarThickness = 15;
|
||||
lapTable.Render();
|
||||
wm.AddWindow(lapTable);
|
||||
|
||||
UpdateWindow();
|
||||
}
|
||||
|
||||
public override void Run()
|
||||
{
|
||||
int second = DateTime.Now.Second;
|
||||
if (lastSecond != second)
|
||||
{
|
||||
lastSecond = second;
|
||||
if (stopwatchRunning)
|
||||
{
|
||||
elapsed = DateTime.Now - startTime;
|
||||
}
|
||||
UpdateWindow();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
82
Gui/Apps/Tasks.cs
Normal file
@@ -0,0 +1,82 @@
|
||||
using CMLeonOS;
|
||||
using CMLeonOS.Gui.UILib;
|
||||
using System;
|
||||
using System.Drawing;
|
||||
|
||||
namespace CMLeonOS.Gui.Apps
|
||||
{
|
||||
internal class Tasks : Process
|
||||
{
|
||||
internal Tasks() : base("Tasks", ProcessType.Application) { }
|
||||
|
||||
AppWindow window;
|
||||
|
||||
Table table;
|
||||
|
||||
WindowManager wm = ProcessManager.GetProcess<WindowManager>();
|
||||
|
||||
int lastSecond = DateTime.Now.Second;
|
||||
|
||||
private void PopulateTable()
|
||||
{
|
||||
table.Cells.Clear();
|
||||
foreach (Process process in ProcessManager.Processes)
|
||||
{
|
||||
table.Cells.Add(new TableCell(process.Name));
|
||||
}
|
||||
table.Render();
|
||||
}
|
||||
|
||||
private void EndTaskClicked(int x, int y)
|
||||
{
|
||||
if (table.SelectedCellIndex != -1 && table.SelectedCellIndex < ProcessManager.Processes.Count)
|
||||
{
|
||||
if (UserSystem.CurrentLoggedInUser == null || !UserSystem.CurrentLoggedInUser.Admin)
|
||||
{
|
||||
MessageBox messageBox = new MessageBox(this, Name, "You must be an admin to end tasks.");
|
||||
messageBox.Show();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
ProcessManager.Processes[table.SelectedCellIndex].TryStop();
|
||||
ProcessManager.Sweep();
|
||||
table.SelectedCellIndex = -1;
|
||||
PopulateTable();
|
||||
}
|
||||
}
|
||||
|
||||
public override void Start()
|
||||
{
|
||||
base.Start();
|
||||
window = new AppWindow(this, 256, 256, 384, 256);
|
||||
wm.AddWindow(window);
|
||||
window.Title = "Tasks";
|
||||
window.Icon = AppManager.GetAppMetadata("Tasks").Icon;
|
||||
window.Closing = TryStop;
|
||||
|
||||
window.Clear(Color.Gray);
|
||||
|
||||
table = new Table(window, 12, 12, window.Width - 24, window.Height - 24 - 20 - 12);
|
||||
PopulateTable();
|
||||
wm.AddWindow(table);
|
||||
|
||||
Button endTask = new Button(window, window.Width - 100 - 12, window.Height - 20 - 12, 100, 20);
|
||||
endTask.Text = "End Task";
|
||||
endTask.OnClick = EndTaskClicked;
|
||||
wm.AddWindow(endTask);
|
||||
|
||||
wm.Update(window);
|
||||
}
|
||||
|
||||
public override void Run()
|
||||
{
|
||||
DateTime now = DateTime.Now;
|
||||
if (lastSecond != now.Second)
|
||||
{
|
||||
PopulateTable();
|
||||
lastSecond = now.Second;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
39
Gui/Asc16.cs
Normal file
49
Gui/BitmapExtensions.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using Cosmos.System.Graphics;
|
||||
using System;
|
||||
|
||||
namespace CMLeonOS.Gui
|
||||
{
|
||||
internal static class BitmapExtensions
|
||||
{
|
||||
internal static Bitmap Resize(this Bitmap bmp, uint width, uint height)
|
||||
{
|
||||
if (bmp.Width == width && bmp.Height == height)
|
||||
{
|
||||
return bmp;
|
||||
}
|
||||
|
||||
if (bmp.Depth != ColorDepth.ColorDepth32)
|
||||
{
|
||||
throw new Exception("Resize can only resize images with a colour depth of 32.");
|
||||
}
|
||||
|
||||
Bitmap res = new Bitmap(width, height, ColorDepth.ColorDepth32);
|
||||
|
||||
for (int y = 0; y < height; y++)
|
||||
{
|
||||
for (int x = 0; x < width; x++)
|
||||
{
|
||||
double xDouble = (double)x / (double)width;
|
||||
double yDouble = (double)y / (double)height;
|
||||
|
||||
uint origX = (uint)((double)bmp.Width * xDouble);
|
||||
uint origY = (uint)((double)bmp.Height * yDouble);
|
||||
|
||||
res.RawData[y * width + x] = bmp.RawData[(origY * bmp.Width) + origX];
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
internal static Bitmap ResizeWidthKeepRatio(this Bitmap bmp, uint width)
|
||||
{
|
||||
return Resize(bmp, width, (uint)((double)bmp.Height * ((double)width / (double)bmp.Width)));
|
||||
}
|
||||
|
||||
internal static Bitmap ResizeHeightKeepRatio(this Bitmap bmp, uint height)
|
||||
{
|
||||
return Resize(bmp, (uint)((double)bmp.Width * ((double)height / (double)bmp.Height)), height);
|
||||
}
|
||||
}
|
||||
}
|
||||
8
Gui/CursorType.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace CMLeonOS.Gui
|
||||
{
|
||||
internal enum CursorType
|
||||
{
|
||||
Cursor,
|
||||
WaitCursor
|
||||
}
|
||||
}
|
||||
77
Gui/Gui.cs
Normal file
@@ -0,0 +1,77 @@
|
||||
using CMLeonOS;
|
||||
using CMLeonOS.Logger;
|
||||
using System;
|
||||
using System.Threading;
|
||||
|
||||
namespace CMLeonOS.Gui
|
||||
{
|
||||
internal static class Gui
|
||||
{
|
||||
private static bool guiRunning = false;
|
||||
private static WindowManager windowManager;
|
||||
|
||||
internal static bool StartGui()
|
||||
{
|
||||
Console.Clear();
|
||||
Console.CursorVisible = false;
|
||||
|
||||
windowManager = new WindowManager();
|
||||
|
||||
Logger.Logger.Instance.Info("Gui", "GUI starting.");
|
||||
|
||||
if (Cosmos.Core.CPU.GetAmountOfRAM() < 1000)
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.Yellow;
|
||||
Console.WriteLine("Not enough system memory is available to run the GUI.");
|
||||
Console.WriteLine("At least 1 GB should be allocated.");
|
||||
Console.ResetColor();
|
||||
Console.Write("Continue anyway? [y/N]");
|
||||
|
||||
if (Console.ReadKey(true).Key != ConsoleKey.Y)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Console.WriteLine("Loading apps...");
|
||||
Thread.Sleep(1000);
|
||||
AppManager.LoadAllApps();
|
||||
|
||||
ProcessManager.AddProcess(windowManager);
|
||||
|
||||
ProcessManager.AddProcess(windowManager, new SettingsService()).Start();
|
||||
|
||||
windowManager.Start();
|
||||
|
||||
ProcessManager.AddProcess(windowManager, new Sound.SoundService()).Start();
|
||||
|
||||
Console.WriteLine("Starting lock screen...");
|
||||
ProcessManager.AddProcess(windowManager, new ShellComponents.Lock()).Start();
|
||||
|
||||
guiRunning = true;
|
||||
|
||||
// 进入 GUI 事件循环
|
||||
RunGuiLoop();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private static void RunGuiLoop()
|
||||
{
|
||||
while (guiRunning)
|
||||
{
|
||||
ProcessManager.Yield();
|
||||
System.Threading.Thread.Sleep(1);
|
||||
}
|
||||
}
|
||||
|
||||
internal static void StopGui()
|
||||
{
|
||||
guiRunning = false;
|
||||
if (windowManager != null)
|
||||
{
|
||||
windowManager.Stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
Gui/Resources/AppIcons/Calculator.bmp
Normal file
|
After Width: | Height: | Size: 9.1 KiB |
BIN
Gui/Resources/AppIcons/Calendar.bmp
Normal file
|
After Width: | Height: | Size: 9.1 KiB |
BIN
Gui/Resources/AppIcons/Clock.bmp
Normal file
|
After Width: | Height: | Size: 9.1 KiB |
BIN
Gui/Resources/AppIcons/CodeStudio.bmp
Normal file
|
After Width: | Height: | Size: 9.1 KiB |
BIN
Gui/Resources/AppIcons/Default.bmp
Normal file
|
After Width: | Height: | Size: 9.1 KiB |
BIN
Gui/Resources/AppIcons/DemoLauncher.bmp
Normal file
|
After Width: | Height: | Size: 9.1 KiB |
BIN
Gui/Resources/AppIcons/Demos/Mandelbrot.bmp
Normal file
|
After Width: | Height: | Size: 9.1 KiB |
BIN
Gui/Resources/AppIcons/Demos/Starfield.bmp
Normal file
|
After Width: | Height: | Size: 9.1 KiB |
BIN
Gui/Resources/AppIcons/Files.bmp
Normal file
|
After Width: | Height: | Size: 9.1 KiB |
BIN
Gui/Resources/AppIcons/Info.bmp
Normal file
|
After Width: | Height: | Size: 9.1 KiB |
BIN
Gui/Resources/AppIcons/Logs.bmp
Normal file
|
After Width: | Height: | Size: 9.1 KiB |
BIN
Gui/Resources/AppIcons/MemoryStatistics.bmp
Normal file
|
After Width: | Height: | Size: 9.1 KiB |
BIN
Gui/Resources/AppIcons/Notepad.bmp
Normal file
|
After Width: | Height: | Size: 9.1 KiB |
BIN
Gui/Resources/AppIcons/Paint.bmp
Normal file
|
After Width: | Height: | Size: 9.1 KiB |
BIN
Gui/Resources/AppIcons/Settings.bmp
Normal file
|
After Width: | Height: | Size: 9.1 KiB |
BIN
Gui/Resources/AppIcons/Stopwatch.bmp
Normal file
|
After Width: | Height: | Size: 9.1 KiB |
BIN
Gui/Resources/AppIcons/Tasks.bmp
Normal file
|
After Width: | Height: | Size: 9.1 KiB |
BIN
Gui/Resources/ButtonBackground.bmp
Normal file
|
After Width: | Height: | Size: 230 B |
BIN
Gui/Resources/Calculator/Display.bmp
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
Gui/Resources/Calculator/GridButton.bmp
Normal file
|
After Width: | Height: | Size: 6.4 KiB |
BIN
Gui/Resources/Check.bmp
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
Gui/Resources/Clock/ClockBackground.bmp
Normal file
|
After Width: | Height: | Size: 144 KiB |
BIN
Gui/Resources/Close.bmp
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
Gui/Resources/Close_aero.bmp
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
Gui/Resources/Close_flat.bmp
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
Gui/Resources/CodeStudio/Run.bmp
Normal file
|
After Width: | Height: | Size: 930 B |
BIN
Gui/Resources/CodeStudio/Splash.bmp
Normal file
|
After Width: | Height: | Size: 627 KiB |
BIN
Gui/Resources/Cursor.bmp
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
Gui/Resources/Cursor_noshadow.bmp
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
Gui/Resources/Dock/StartMenu.bmp
Normal file
|
After Width: | Height: | Size: 9.1 KiB |
BIN
Gui/Resources/Files/Directory.bmp
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
Gui/Resources/Files/Drive.bmp
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
Gui/Resources/Files/File.bmp
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
Gui/Resources/Files/File_Config.bmp
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
Gui/Resources/Files/File_Rs.bmp
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
Gui/Resources/Files/File_Text.bmp
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
Gui/Resources/Files/Home.bmp
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
Gui/Resources/Files/Up.bmp
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
Gui/Resources/Lock/Background.bmp
Normal file
|
After Width: | Height: | Size: 648 KiB |
BIN
Gui/Resources/Lock/Background_small.bmp
Normal file
|
After Width: | Height: | Size: 390 KiB |
BIN
Gui/Resources/Lock/Gradient.bmp
Normal file
|
After Width: | Height: | Size: 662 B |
BIN
Gui/Resources/Lock/Key.bmp
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
BIN
Gui/Resources/Lock/ShutDown.bmp
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
BIN
Gui/Resources/Lock/User.bmp
Normal file
|
After Width: | Height: | Size: 64 KiB |
BIN
Gui/Resources/Lock/UserArrow.bmp
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
Gui/Resources/Logs/Error.bmp
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
Gui/Resources/Logs/Info.bmp
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
Gui/Resources/Logs/Warning.bmp
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
Gui/Resources/Maximise.bmp
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
Gui/Resources/Maximise_aero.bmp
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
Gui/Resources/Maximise_flat.bmp
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
Gui/Resources/Minimise.bmp
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
Gui/Resources/Minimise_aero.bmp
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
Gui/Resources/Minimise_flat.bmp
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
Gui/Resources/Restore.bmp
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
Gui/Resources/Restore_aero.bmp
Normal file
|
After Width: | Height: | Size: 2.4 KiB |