X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FApplications%2Faxwin4_src%2FServer%2Fmain.cpp;h=acea9275bead1a4590467f11b05f03b80e4cacc2;hb=47296e890b2b09cbc46db30d7fe2aeeae11a6d4a;hp=362661ab903bca9d770b5f48913d8e9c81517422;hpb=4e407e69bd660e9a32644281733192193ee6e8c8;p=tpg%2Facess2.git diff --git a/Usermode/Applications/axwin4_src/Server/main.cpp b/Usermode/Applications/axwin4_src/Server/main.cpp index 362661ab..acea9275 100644 --- a/Usermode/Applications/axwin4_src/Server/main.cpp +++ b/Usermode/Applications/axwin4_src/Server/main.cpp @@ -1,10 +1,24 @@ /* + * Acess2 GUI v4 (AxWin4) + * - By John Hodge (thePowesGang) + * + * main.cpp + * - Program main */ #include #include #include #include +#include #include +#include +#include +#include + +extern "C" { +#include +#include +}; using namespace AxWin; @@ -21,37 +35,47 @@ int main(int argc, char *argv[]) return 1; } // - Open graphics - Graphics::Initialise(config.m_video); + CVideo* vid = new CVideo(config.m_video); + // - Initialise compositor structures + CCompositor* compositor = new CCompositor(/*config.m_compositor,*/ *vid); // - Open input - Input::Initialise(config.m_input); + CInput* input = new CInput(config.m_input, *compositor); // > Handles hotkeys? - // - Initialise compositor structures - Compositor::Initialise(config.m_compositor); // - Bind IPC channels - IPC::Initialise(config.m_ipc); + IPC::Initialise(config.m_ipc, *compositor); // - Start root child process (from config) // TODO: Spin up child process - + // - Event loop for( ;; ) { int nfd = 0; fd_set rfds; - Input::FillSelect(&nfd, &rfds); - IPC::FillSelect(&nfd, &rfds); + nfd = ::std::max(nfd, input->FillSelect(rfds)); + nfd = ::std::max(nfd, IPC::FillSelect(rfds)); - // TODO: Timer events + // TODO: Support _SysSendMessage IPC? int64_t timeout = Timing::GetTimeToNextEvent(); - int rv = ::_SysSelect(nfd, &rfds, NULL, &rfds, NULL, 0); + int rv = ::_SysSelect(nfd, &rfds, NULL, &rfds, &timeout, 0); Timing::CheckEvents(); - Input::HandleSelect(&rfds); - IPC::HandleSelect(&rfds); + input->HandleSelect(rfds); + IPC::HandleSelect(rfds); - Compositor::Redraw(); + compositor->Redraw(); } return 0; } +namespace AxWin { + +const char* InitFailure::what() const throw() +{ + return m_what; +} + + +} +