1 /* 2 * Copyright (c) 2001-2005, Haiku, Inc. 3 * Distributed under the terms of the MIT license. 4 * 5 * Author: DarkWyrm <bpmagic@columbus.rr.com> 6 */ 7 8 #ifndef _HAIKU_APP_SERVER_H_ 9 #define _HAIKU_APP_SERVER_H_ 10 11 #include <OS.h> 12 #include <Locker.h> 13 #include <List.h> 14 #include <Application.h> 15 #include <Window.h> 16 #include <String.h> 17 #include "ServerConfig.h" 18 #include "MessageLooper.h" 19 20 class ServerApp; 21 class BitmapManager; 22 class ColorSet; 23 24 namespace BPrivate { 25 class PortLink; 26 }; 27 28 /*! 29 \class AppServer AppServer.h 30 \brief main manager object for the app_server 31 32 File for the main app_server thread. This particular thread monitors for 33 application start and quit messages. It also starts the housekeeping threads 34 and initializes most of the server's globals. 35 */ 36 37 class AppServer : public MessageLooper { 38 public: 39 AppServer(); 40 virtual ~AppServer(); 41 42 void RunLooper(); 43 virtual port_id MessagePort() const { return fMessagePort; } 44 45 private: 46 virtual void _DispatchMessage(int32 code, BPrivate::LinkReceiver& link); 47 void LaunchCursorThread(); 48 void LaunchInputServer(); 49 50 // static int32 PollerThread(void *data); 51 static int32 CursorThread(void *data); 52 53 private: 54 port_id fMessagePort; 55 port_id fServerInputPort; 56 57 thread_id fISThreadID; 58 thread_id fCursorThreadID; 59 sem_id fCursorSem; 60 area_id fCursorArea; 61 uint32 *fCursorAddr; 62 63 port_id fISASPort; 64 port_id fISPort; 65 }; 66 67 extern BitmapManager *gBitmapManager; 68 extern ColorSet gGUIColorSet; 69 extern port_id gAppServerPort; 70 71 #endif /* _HAIKU_APP_SERVER_H_ */ 72