Usermode/AxWin4 - Planning mostly
[tpg/acess2.git] / Usermode / Applications / axwin4_src / Server / main.cpp
1 /*
2  */
3 #include <ipc.hpp>
4 #include <input.hpp>
5 #include <timing.hpp>
6
7 using namespace AxWin;
8
9 // === CODE ===
10 int main(int argc, char *argv[])
11 {
12         // - Load configuration (from file and argv)
13         // - Open graphics
14         Graphics::Open(/*config.m_displayDevice*/);
15         // - Open input
16         // - Initialise compositor structures
17         // - Prepare global hotkeys
18         // - Bind IPC channels
19         // - Start root child process (from config)
20         
21         // - Event loop
22         for( ;; )
23         {
24                  int    nfd = 0;
25                 fd_set  rfds;
26                 
27                 Input::FillSelect(&nfd, &rfds);
28                 IPC::FillSelect(&nfd, &rfds);
29                 
30                 // TODO: Timer events
31                 int64_t timeout = Timing::GetTimeToNextEvent();
32                 int rv = ::_SysSelect(nfd, &rfds, NULL, &rfds, NULL, 0);
33                 
34                 Timing::CheckEvents();
35                 
36                 Input::HandleSelect(&rfds);
37                 IPC::HandleSelect(&rfds);
38         }
39         return 0;
40 }
41

UCC git Repository :: git.ucc.asn.au