xref: /haiku/src/servers/app/AppServer.h (revision 9775bf33cf929b0e4718b791c3ef11d3fe82ef1e)
133bbe223SAxel Dörfler #ifndef	_OPENBEOS_APP_SERVER_H_
233bbe223SAxel Dörfler #define	_OPENBEOS_APP_SERVER_H_
333bbe223SAxel Dörfler 
433bbe223SAxel Dörfler #include <OS.h>
533bbe223SAxel Dörfler #include <Locker.h>
633bbe223SAxel Dörfler #include <List.h>
733bbe223SAxel Dörfler #include <Application.h>
833bbe223SAxel Dörfler #include <Window.h>
933bbe223SAxel Dörfler #include <String.h>
1033bbe223SAxel Dörfler #include "Decorator.h"
1133bbe223SAxel Dörfler #include "ServerConfig.h"
1233bbe223SAxel Dörfler 
1333bbe223SAxel Dörfler class Layer;
1433bbe223SAxel Dörfler class BMessage;
1533bbe223SAxel Dörfler class ServerApp;
1633bbe223SAxel Dörfler class DisplayDriver;
1733bbe223SAxel Dörfler class BPortLink;
1833bbe223SAxel Dörfler class CursorManager;
1933bbe223SAxel Dörfler class BitmapManager;
2033bbe223SAxel Dörfler 
2133bbe223SAxel Dörfler /*!
2233bbe223SAxel Dörfler 	\class AppServer AppServer.h
2333bbe223SAxel Dörfler 	\brief main manager object for the app_server
2433bbe223SAxel Dörfler 
2533bbe223SAxel Dörfler 	File for the main app_server thread. This particular thread monitors for
2633bbe223SAxel Dörfler 	application start and quit messages. It also starts the housekeeping threads
2733bbe223SAxel Dörfler 	and initializes most of the server's globals.
2833bbe223SAxel Dörfler */
29*9775bf33SMichael Lotz #if TEST_MODE
3033bbe223SAxel Dörfler class AppServer : public BApplication
31*9775bf33SMichael Lotz #else
32*9775bf33SMichael Lotz class AppServer
3333bbe223SAxel Dörfler #endif
3433bbe223SAxel Dörfler {
3533bbe223SAxel Dörfler public:
3633bbe223SAxel Dörfler 	AppServer(void);
3733bbe223SAxel Dörfler 	~AppServer(void);
3833bbe223SAxel Dörfler 
3933bbe223SAxel Dörfler 	static	int32 PollerThread(void *data);
4033bbe223SAxel Dörfler 	static	int32 PicassoThread(void *data);
4133bbe223SAxel Dörfler 	thread_id Run(void);
4233bbe223SAxel Dörfler 	void MainLoop(void);
4333bbe223SAxel Dörfler 
4433bbe223SAxel Dörfler 	bool LoadDecorator(const char *path);
4533bbe223SAxel Dörfler 	void InitDecorators(void);
4633bbe223SAxel Dörfler 
4733bbe223SAxel Dörfler 	void DispatchMessage(int32 code, BPortLink &link);
4833bbe223SAxel Dörfler 	void Broadcast(int32 code);
4933bbe223SAxel Dörfler 
5033bbe223SAxel Dörfler 	ServerApp* FindApp(const char *sig);
5133bbe223SAxel Dörfler 
5233bbe223SAxel Dörfler private:
5333bbe223SAxel Dörfler 	friend	Decorator*	new_decorator(BRect rect, const char *title,
5433bbe223SAxel Dörfler 				int32 wlook, int32 wfeel, int32 wflags, DisplayDriver *ddriver);
5533bbe223SAxel Dörfler 
5633bbe223SAxel Dörfler 	// global function pointer
5733bbe223SAxel Dörfler 	create_decorator	*make_decorator;
5833bbe223SAxel Dörfler 
5933bbe223SAxel Dörfler 	port_id	fMessagePort;
6033bbe223SAxel Dörfler 
6133bbe223SAxel Dörfler 	image_id fDecoratorID;
6233bbe223SAxel Dörfler 
6333bbe223SAxel Dörfler 	BString fDecoratorName;
6433bbe223SAxel Dörfler 
6533bbe223SAxel Dörfler 	bool fQuittingServer;
6633bbe223SAxel Dörfler 
6733bbe223SAxel Dörfler 	BList *fAppList;
6833bbe223SAxel Dörfler 	thread_id fPicassoThreadID;
6933bbe223SAxel Dörfler 
7033bbe223SAxel Dörfler 	sem_id 	fActiveAppLock,
7133bbe223SAxel Dörfler 			fAppListLock,
7233bbe223SAxel Dörfler 			fDecoratorLock;
7333bbe223SAxel Dörfler 
7433bbe223SAxel Dörfler 	DisplayDriver *fDriver;
7533bbe223SAxel Dörfler };
7633bbe223SAxel Dörfler 
7733bbe223SAxel Dörfler Decorator *new_decorator(BRect rect, const char *title, int32 wlook, int32 wfeel,
7833bbe223SAxel Dörfler 	int32 wflags, DisplayDriver *ddriver);
7933bbe223SAxel Dörfler 
8033bbe223SAxel Dörfler extern BitmapManager *bitmapmanager;
8133bbe223SAxel Dörfler extern ColorSet gui_colorset;
8233bbe223SAxel Dörfler extern AppServer *app_server;
8333bbe223SAxel Dörfler 
8433bbe223SAxel Dörfler #endif
85