checkpoint. merging win32 code. server on X is currently broken

and client probably is.
This commit is contained in:
crs
2001-11-19 00:33:36 +00:00
parent 51505783aa
commit 3f6146b15f
66 changed files with 5222 additions and 424 deletions

View File

@@ -1,16 +1,12 @@
#include "CServer.h"
#include "CScreenMap.h"
#include "CThread.h"
#include <stdio.h>
#include "CNetwork.h"
int main(int argc, char** argv)
void realMain()
{
CThread::init();
if (argc != 1) {
fprintf(stderr, "usage: %s\n", argv[0]);
return 1;
}
CNetwork::init();
CScreenMap screenMap;
screenMap.addScreen("primary");
@@ -18,15 +14,66 @@ int main(int argc, char** argv)
screenMap.connect("primary", CScreenMap::kRight, "ingrid");
screenMap.connect("ingrid", CScreenMap::kLeft, "primary");
CServer* server = NULL;
try {
CServer* server = new CServer();
server = new CServer();
server->setScreenMap(screenMap);
server->run();
delete server;
CNetwork::cleanup();
}
catch (...) {
delete server;
CNetwork::cleanup();
throw;
}
}
#if defined(CONFIG_PLATFORM_WIN32)
#include "CMSWindowsScreen.h"
int WINAPI WinMain(HINSTANCE instance, HINSTANCE, LPSTR, int)
{
CMSWindowsScreen::init(instance);
if (__argc != 1) {
CString msg = "no arguments allowed. exiting.";
MessageBox(NULL, msg.c_str(), "error", MB_OK | MB_ICONERROR);
return 1;
}
try {
realMain();
return 0;
}
catch (XBase& e) {
CString msg = "failed: ";
msg += e.what();
MessageBox(NULL, msg.c_str(), "error", MB_OK | MB_ICONERROR);
return 1;
}
}
#else
#include <stdio.h>
int main(int argc, char** argv)
{
if (argc != 1) {
fprintf(stderr, "usage: %s\n", argv[0]);
return 1;
}
try {
realMain();
return 0;
}
catch (XBase& e) {
fprintf(stderr, "failed: %s\n", e.what());
return 1;
}
return 0;
}
#endif