AppServer.h revision 770c05d6
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
18#include "ServerConfig.h"
19
20class ServerApp;
21class BitmapManager;
22class ColorSet;
23
24namespace 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
37class AppServer
38#if TEST_MODE
39	: public BApplication
40#endif
41{
42public:
43						AppServer();
44						~AppServer();
45
46static	int32			PollerThread(void *data);
47static	int32			PicassoThread(void *data);
48		thread_id		Run(void);
49		void 			MainLoop(void);
50
51		void			PostMessage(int32 code);
52		void			DispatchMessage(int32 code, BPrivate::PortLink &link);
53
54private:
55		void			LaunchCursorThread();
56		void			LaunchInputServer();
57static	int32			CursorThread(void *data);
58
59		port_id			fMessagePort;
60		port_id			fServerInputPort;
61
62volatile bool			fQuitting;
63
64		thread_id		fPicassoThreadID;
65
66		thread_id		fISThreadID;
67		thread_id		fCursorThreadID;
68		sem_id			fCursorSem;
69		area_id			fCursorArea;
70		uint32			*fCursorAddr;
71
72		port_id			fISASPort;
73		port_id			fISPort;
74};
75
76extern BitmapManager *gBitmapManager;
77extern ColorSet gGUIColorSet;
78extern port_id gAppServerPort;
79
80#endif	/* _HAIKU_APP_SERVER_H_ */
81