xref: /haiku/src/servers/app/AppServer.h (revision 4f00613311d0bd6b70fa82ce19931c41f071ea4e)
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 #ifndef	APP_SERVER_H
8 #define	APP_SERVER_H
9 
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 <ObjectList.h>
18 #include <TokenSpace.h>
19 
20 #include "ServerConfig.h"
21 #include "MessageLooper.h"
22 
23 class ServerApp;
24 class BitmapManager;
25 class ColorSet;
26 class Desktop;
27 
28 using BPrivate::BTokenSpace;
29 
30 namespace BPrivate {
31 	class PortLink;
32 };
33 
34 
35 class AppServer : public MessageLooper  {
36 	public:
37 		AppServer();
38 		virtual ~AppServer();
39 
40 		void			RunLooper();
41 		virtual port_id	MessagePort() const { return fMessagePort; }
42 
43 	private:
44 		virtual void	_DispatchMessage(int32 code, BPrivate::LinkReceiver& link);
45 
46 		Desktop*		_CreateDesktop(uid_t userID);
47 		Desktop*		_FindDesktop(uid_t userID);
48 
49 		void			_LaunchInputServer();
50 
51 	private:
52 		port_id			fMessagePort;
53 
54 		BObjectList<Desktop> fDesktops;
55 		BLocker			fDesktopLock;
56 };
57 
58 extern BitmapManager *gBitmapManager;
59 extern ColorSet gGUIColorSet;
60 extern port_id gAppServerPort;
61 
62 #endif	/* APP_SERVER_H */
63