1*2724858bSAxel Dörfler /* 2*2724858bSAxel Dörfler * Copyright (c) 2001-2005, Haiku, Inc. 3*2724858bSAxel Dörfler * Distributed under the terms of the MIT license. 4*2724858bSAxel Dörfler * 5*2724858bSAxel Dörfler * Author: DarkWyrm <bpmagic@columbus.rr.com> 6*2724858bSAxel Dörfler */ 7*2724858bSAxel Dörfler #ifndef _HAIKU_APP_SERVER_H_ 8*2724858bSAxel Dörfler #define _HAIKU_APP_SERVER_H_ 933bbe223SAxel Dörfler 1033bbe223SAxel Dörfler #include <OS.h> 1133bbe223SAxel Dörfler #include <Locker.h> 1233bbe223SAxel Dörfler #include <List.h> 1333bbe223SAxel Dörfler #include <Application.h> 1433bbe223SAxel Dörfler #include <Window.h> 1533bbe223SAxel Dörfler #include <String.h> 1633bbe223SAxel Dörfler #include "Decorator.h" 1733bbe223SAxel Dörfler #include "ServerConfig.h" 1833bbe223SAxel Dörfler 1933bbe223SAxel Dörfler class Layer; 2033bbe223SAxel Dörfler class BMessage; 2133bbe223SAxel Dörfler class ServerApp; 2233bbe223SAxel Dörfler class DisplayDriver; 2333bbe223SAxel Dörfler class BPortLink; 2433bbe223SAxel Dörfler class CursorManager; 2533bbe223SAxel Dörfler class BitmapManager; 2633bbe223SAxel Dörfler 2733bbe223SAxel Dörfler /*! 2833bbe223SAxel Dörfler \class AppServer AppServer.h 2933bbe223SAxel Dörfler \brief main manager object for the app_server 3033bbe223SAxel Dörfler 3133bbe223SAxel Dörfler File for the main app_server thread. This particular thread monitors for 3233bbe223SAxel Dörfler application start and quit messages. It also starts the housekeeping threads 3333bbe223SAxel Dörfler and initializes most of the server's globals. 3433bbe223SAxel Dörfler */ 35*2724858bSAxel Dörfler 369775bf33SMichael Lotz class AppServer 37*2724858bSAxel Dörfler #if TEST_MODE 38*2724858bSAxel Dörfler : public BApplication 3933bbe223SAxel Dörfler #endif 4033bbe223SAxel Dörfler { 4133bbe223SAxel Dörfler public: 4233bbe223SAxel Dörfler AppServer(void); 4333bbe223SAxel Dörfler ~AppServer(void); 4433bbe223SAxel Dörfler 4533bbe223SAxel Dörfler static int32 PollerThread(void *data); 4633bbe223SAxel Dörfler static int32 PicassoThread(void *data); 4733bbe223SAxel Dörfler thread_id Run(void); 4833bbe223SAxel Dörfler void MainLoop(void); 4933bbe223SAxel Dörfler 5033bbe223SAxel Dörfler bool LoadDecorator(const char *path); 5133bbe223SAxel Dörfler void InitDecorators(void); 5233bbe223SAxel Dörfler 5333bbe223SAxel Dörfler void DispatchMessage(int32 code, BPortLink &link); 5433bbe223SAxel Dörfler void Broadcast(int32 code); 5533bbe223SAxel Dörfler 5633bbe223SAxel Dörfler ServerApp* FindApp(const char *sig); 5733bbe223SAxel Dörfler 5833bbe223SAxel Dörfler private: 59b8d27287SJérôme Duval void LaunchCursorThread(); 60b8d27287SJérôme Duval void LaunchInputServer(); 61b8d27287SJérôme Duval static int32 CursorThread(void *data); 62b8d27287SJérôme Duval 6333bbe223SAxel Dörfler friend Decorator* new_decorator(BRect rect, const char *title, 6433bbe223SAxel Dörfler int32 wlook, int32 wfeel, int32 wflags, DisplayDriver *ddriver); 6533bbe223SAxel Dörfler 6633bbe223SAxel Dörfler // global function pointer 6733bbe223SAxel Dörfler create_decorator *make_decorator; 6833bbe223SAxel Dörfler 6933bbe223SAxel Dörfler port_id fMessagePort; 70597c548cSMichael Lotz port_id fServerInputPort; 7133bbe223SAxel Dörfler 7233bbe223SAxel Dörfler image_id fDecoratorID; 7333bbe223SAxel Dörfler 7433bbe223SAxel Dörfler BString fDecoratorName; 7533bbe223SAxel Dörfler 76151ebb14SStephan Aßmus volatile bool fQuittingServer; 7733bbe223SAxel Dörfler 7833bbe223SAxel Dörfler BList *fAppList; 7933bbe223SAxel Dörfler thread_id fPicassoThreadID; 8033bbe223SAxel Dörfler 81b8d27287SJérôme Duval thread_id fISThreadID; 82b8d27287SJérôme Duval thread_id fCursorThreadID; 83b8d27287SJérôme Duval sem_id fCursorSem; 84b8d27287SJérôme Duval area_id fCursorArea; 85b8d27287SJérôme Duval uint32 *fCursorAddr; 86b8d27287SJérôme Duval 87b8d27287SJérôme Duval port_id fISASPort; 88b8d27287SJérôme Duval port_id fISPort; 89b8d27287SJérôme Duval 9033bbe223SAxel Dörfler sem_id fActiveAppLock, 9133bbe223SAxel Dörfler fAppListLock, 9233bbe223SAxel Dörfler fDecoratorLock; 9333bbe223SAxel Dörfler 9433bbe223SAxel Dörfler DisplayDriver *fDriver; 9533bbe223SAxel Dörfler }; 9633bbe223SAxel Dörfler 9733bbe223SAxel Dörfler Decorator *new_decorator(BRect rect, const char *title, int32 wlook, int32 wfeel, 9833bbe223SAxel Dörfler int32 wflags, DisplayDriver *ddriver); 9933bbe223SAxel Dörfler 10033bbe223SAxel Dörfler extern BitmapManager *bitmapmanager; 10133bbe223SAxel Dörfler extern ColorSet gui_colorset; 10233bbe223SAxel Dörfler extern AppServer *app_server; 103*2724858bSAxel Dörfler extern port_id gAppServerPort; 10433bbe223SAxel Dörfler 105*2724858bSAxel Dörfler #endif /* _HAIKU_APP_SERVER_H_ */ 106