2005-05-27 17:36:05 +04:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2001-2005, Haiku, Inc.
|
|
|
|
* Distributed under the terms of the MIT license.
|
|
|
|
*
|
|
|
|
* Author: DarkWyrm <bpmagic@columbus.rr.com>
|
|
|
|
*/
|
|
|
|
#ifndef _HAIKU_APP_SERVER_H_
|
|
|
|
#define _HAIKU_APP_SERVER_H_
|
2003-01-20 23:38:49 +03:00
|
|
|
|
|
|
|
#include <OS.h>
|
|
|
|
#include <Locker.h>
|
|
|
|
#include <List.h>
|
2003-02-15 18:28:22 +03:00
|
|
|
#include <Application.h>
|
2003-01-20 23:38:49 +03:00
|
|
|
#include <Window.h>
|
2003-10-09 03:18:30 +04:00
|
|
|
#include <String.h>
|
2005-06-17 23:10:15 +04:00
|
|
|
|
2003-02-15 18:28:22 +03:00
|
|
|
#include "ServerConfig.h"
|
2003-01-20 23:38:49 +03:00
|
|
|
|
|
|
|
class Layer;
|
|
|
|
class BMessage;
|
|
|
|
class ServerApp;
|
|
|
|
class DisplayDriver;
|
2003-02-20 23:14:57 +03:00
|
|
|
class CursorManager;
|
|
|
|
class BitmapManager;
|
2005-06-17 23:10:15 +04:00
|
|
|
class DecorManager;
|
|
|
|
class ColorSet;
|
2003-01-20 23:38:49 +03:00
|
|
|
|
2005-06-15 01:28:56 +04:00
|
|
|
namespace BPrivate {
|
|
|
|
class PortLink;
|
|
|
|
};
|
|
|
|
|
2003-01-20 23:38:49 +03:00
|
|
|
/*!
|
|
|
|
\class AppServer AppServer.h
|
|
|
|
\brief main manager object for the app_server
|
|
|
|
|
|
|
|
File for the main app_server thread. This particular thread monitors for
|
|
|
|
application start and quit messages. It also starts the housekeeping threads
|
|
|
|
and initializes most of the server's globals.
|
|
|
|
*/
|
2005-05-27 17:36:05 +04:00
|
|
|
|
2005-03-29 23:49:55 +04:00
|
|
|
class AppServer
|
2005-05-27 17:36:05 +04:00
|
|
|
#if TEST_MODE
|
|
|
|
: public BApplication
|
2003-02-15 18:28:22 +03:00
|
|
|
#endif
|
2003-01-20 23:38:49 +03:00
|
|
|
{
|
|
|
|
public:
|
2005-06-17 23:10:15 +04:00
|
|
|
AppServer(void);
|
|
|
|
~AppServer(void);
|
2004-01-13 03:56:36 +03:00
|
|
|
|
2005-06-17 23:10:15 +04:00
|
|
|
static int32 PollerThread(void *data);
|
|
|
|
static int32 PicassoThread(void *data);
|
|
|
|
thread_id Run(void);
|
|
|
|
void MainLoop(void);
|
2005-06-23 21:40:35 +04:00
|
|
|
|
|
|
|
void PostMessage(int32 code);
|
2005-06-17 23:10:15 +04:00
|
|
|
void DispatchMessage(int32 code, BPrivate::PortLink &link);
|
|
|
|
ServerApp* FindApp(const char *sig);
|
2004-01-13 03:56:36 +03:00
|
|
|
|
2003-01-20 23:38:49 +03:00
|
|
|
private:
|
2005-06-17 23:10:15 +04:00
|
|
|
friend void BroadcastToAllApps(const int32 &code);
|
2004-01-14 03:54:45 +03:00
|
|
|
|
2005-06-17 23:10:15 +04:00
|
|
|
void LaunchCursorThread();
|
|
|
|
void LaunchInputServer();
|
|
|
|
static int32 CursorThread(void *data);
|
|
|
|
|
|
|
|
port_id fMessagePort;
|
|
|
|
port_id fServerInputPort;
|
2005-06-23 21:40:35 +04:00
|
|
|
|
|
|
|
volatile bool fQuitting;
|
|
|
|
|
2005-07-01 14:09:11 +04:00
|
|
|
BLocker fAppListLock;
|
2005-06-23 21:40:35 +04:00
|
|
|
BList fAppList;
|
2005-07-01 14:09:11 +04:00
|
|
|
|
2005-06-17 23:10:15 +04:00
|
|
|
thread_id fPicassoThreadID;
|
2005-04-20 00:44:09 +04:00
|
|
|
|
2005-06-17 23:10:15 +04:00
|
|
|
thread_id fISThreadID;
|
|
|
|
thread_id fCursorThreadID;
|
|
|
|
sem_id fCursorSem;
|
|
|
|
area_id fCursorArea;
|
|
|
|
uint32 *fCursorAddr;
|
2005-04-20 00:44:09 +04:00
|
|
|
|
2005-06-17 23:10:15 +04:00
|
|
|
port_id fISASPort;
|
|
|
|
port_id fISPort;
|
2005-07-01 14:09:11 +04:00
|
|
|
|
|
|
|
sem_id fShutdownSemaphore;
|
|
|
|
int32 fShutdownCount;
|
|
|
|
|
2005-06-17 23:10:15 +04:00
|
|
|
DisplayDriver *fDriver;
|
2003-01-20 23:38:49 +03:00
|
|
|
};
|
|
|
|
|
2005-06-24 07:31:41 +04:00
|
|
|
extern BitmapManager *gBitmapManager;
|
|
|
|
extern ColorSet gGUIColorSet;
|
2005-05-27 17:36:05 +04:00
|
|
|
extern port_id gAppServerPort;
|
2003-02-20 23:14:57 +03:00
|
|
|
|
2005-05-27 17:36:05 +04:00
|
|
|
#endif /* _HAIKU_APP_SERVER_H_ */
|