xref: /haiku/src/servers/app/AppServer.h (revision 1e36cfc2721ef13a187c6f7354dc9cbc485e89d3)
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 Desktop;
26 
27 using BPrivate::BTokenSpace;
28 
29 namespace BPrivate {
30 	class PortLink;
31 };
32 
33 
34 class AppServer : public MessageLooper  {
35 	public:
36 		AppServer();
37 		virtual ~AppServer();
38 
39 		void			RunLooper();
40 		virtual port_id	MessagePort() const { return fMessagePort; }
41 
42 	private:
43 		virtual void	_DispatchMessage(int32 code, BPrivate::LinkReceiver& link);
44 
45 		Desktop*		_CreateDesktop(uid_t userID);
46 		Desktop*		_FindDesktop(uid_t userID);
47 
48 		void			_LaunchInputServer();
49 
50 	private:
51 		port_id			fMessagePort;
52 
53 		BObjectList<Desktop> fDesktops;
54 		BLocker			fDesktopLock;
55 };
56 
57 extern BitmapManager *gBitmapManager;
58 extern port_id gAppServerPort;
59 
60 #endif	/* APP_SERVER_H */
61