AuroraRuntime/Source/Console/Console.cpp
Reece 99c5e1fa65 A pretty large patch not worth breaking up into separate commits
[*] Split up Aurora Async
[*] Split Async app into seperate ThreadPool concept
[*] Fix various OSThread bugs and tls transfer issues
[*] Set default affinity to 0xFFFFFFFF
[*] Update Build script
[+] Add AuTuplePopFront
[+] New Network Interface (unimplemented)
[*] Stub out the interfaces required for a better logger
[*] Fix Win32 ShellExecute bug; windows 11 struggles without explicit com init per the docs - now deferring to thread pool
[*] Update gitignore
[*] Follow XDG home standard
[*] Refactor some namespaces to use the shorthand aliases
[*] Various stability fixes
2021-11-05 17:34:23 +00:00

84 lines
1.7 KiB
C++

/***
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: Console.cpp
Date: 2021-6-8
Author: Reece
***/
#include <Source/RuntimeInternal.hpp>
#include "Console.hpp"
#include "Commands/Commands.hpp"
#include "Hooks/Hooks.hpp"
#include "ConsoleStd/ConsoleStd.hpp"
#include "ConsoleWxWidgets/ConsoleWxWidgets.hpp"
#include "ConsoleFIO/ConsoleFIO.hpp"
#include "Flusher.hpp"
namespace Aurora::Console
{
AUKN_SYM void WriteLine(const ConsoleMessage &msg)
{
Hooks::WriteLine(msg);
}
AUKN_SYM AuUInt32 ReadStdIn(void *buffer, AuUInt32 length)
{
return ConsoleStd::ReadStdIn(buffer, length);
}
AUKN_SYM AuUInt32 WriteStdOut(const void *buffer, AuUInt32 length)
{
return ConsoleStd::WriteStdOut(buffer, length);
}
AUKN_SYM bool DispatchRawLine(const AuString &string)
{
if (Hooks::gExternalLineProcessor)
{
Hooks::gExternalLineProcessor->OnProcessedLineUTF8(string);
return true;
}
return Commands::DispatchCommand(string);
}
void Init()
{
Hooks::Init();
ConsoleStd::Init();
ConsoleWxWidgets::Init();
}
void Init2()
{
ConsoleFIO::Init();
InitFlusher();
}
void Pump()
{
Commands::PumpCommands();
ConsoleStd::Pump();
ConsoleWxWidgets::Pump();
ConsoleFIO::Pump();
}
void Exit()
{
DeinitFlusher();
ConsoleStd::Exit();
ConsoleWxWidgets::Exit();
ConsoleFIO::Exit();
Hooks::Deinit();
}
AUKN_SYM void OpenLateStd()
{
ConsoleStd::Start();
}
AUKN_SYM void OpenLateGUI()
{
ConsoleWxWidgets::Start();
}
}