AppServer.h revision 6c17d025516c9c1a271394f8ef618d842e68c716
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
23class ServerApp;
24class BitmapManager;
25class ColorSet;
26class Desktop;
27
28using BPrivate::BTokenSpace;
29
30namespace BPrivate {
31	class PortLink;
32};
33
34
35class 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
58extern BitmapManager *gBitmapManager;
59extern ColorSet gGUIColorSet;
60extern port_id gAppServerPort;
61
62#endif	/* APP_SERVER_H */
63