1 /* 2 * Copyright 2004, Waldemar Kornewald <Waldemar.Kornewald@web.de> 3 * Distributed under the terms of the MIT License. 4 */ 5 6 #include "NetServer.h" 7 #include <Application.h> 8 #include <Alert.h> 9 10 11 static const char *kSignature = NET_SERVER_SIGNATURE; 12 13 14 class NetServerApplication : public BApplication { 15 public: 16 NetServerApplication(); 17 18 virtual void AboutRequested(); 19 virtual void ReadyToRun(); 20 // loads add-ons 21 virtual bool QuitRequested(); 22 // unloads add-ons 23 }; 24 25 26 int main() 27 { 28 new NetServerApplication(); 29 30 be_app->Run(); 31 32 delete be_app; 33 34 return 0; 35 } 36 37 38 NetServerApplication::NetServerApplication() 39 : BApplication(kSignature) 40 { 41 } 42 43 44 void 45 NetServerApplication::AboutRequested() 46 { 47 // the alert should not block because we might get _very_ important messages 48 (new BAlert("About...", 49 "OpenBeOS net_server\n\n" 50 "The net_server manages all userland tasks that " 51 "cannot be handled by the netstack.", 52 "Uhm...Cool?", NULL, NULL, B_WIDTH_AS_USUAL, 53 B_INFO_ALERT))->Go(NULL); 54 } 55 56 57 void 58 NetServerApplication::ReadyToRun() 59 { 60 // load integrated add-ons 61 62 63 // TODO: load add-on binaries 64 } 65 66 67 bool 68 NetServerApplication::QuitRequested() 69 { 70 // unload integrated add-ons 71 72 73 // TODO: unload add-on binaries 74 75 return true; 76 } 77