2003-01-20 23:38:49 +03:00
|
|
|
#ifndef _OPENBEOS_APP_SERVER_H_
|
|
|
|
#define _OPENBEOS_APP_SERVER_H_
|
|
|
|
|
|
|
|
#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>
|
2003-01-20 23:38:49 +03:00
|
|
|
#include "Decorator.h"
|
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;
|
2004-07-30 19:38:38 +04:00
|
|
|
class BPortLink;
|
2003-02-20 23:14:57 +03:00
|
|
|
class CursorManager;
|
|
|
|
class BitmapManager;
|
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-03-25 23:39:43 +03:00
|
|
|
#ifndef TEST_MODE
|
2003-01-20 23:38:49 +03:00
|
|
|
class AppServer
|
2003-02-15 18:28:22 +03:00
|
|
|
#else
|
|
|
|
class AppServer : public BApplication
|
|
|
|
#endif
|
2003-01-20 23:38:49 +03:00
|
|
|
{
|
|
|
|
public:
|
2004-01-14 03:54:45 +03:00
|
|
|
AppServer(void);
|
|
|
|
~AppServer(void);
|
2004-01-13 03:56:36 +03:00
|
|
|
|
2004-01-14 03:54:45 +03:00
|
|
|
static int32 PollerThread(void *data);
|
|
|
|
static int32 PicassoThread(void *data);
|
2004-01-22 03:32:07 +03:00
|
|
|
thread_id Run(void);
|
|
|
|
void MainLoop(void);
|
2004-01-14 03:54:45 +03:00
|
|
|
|
2004-01-22 03:32:07 +03:00
|
|
|
bool LoadDecorator(const char *path);
|
|
|
|
void InitDecorators(void);
|
2004-01-14 03:54:45 +03:00
|
|
|
|
2004-07-30 19:16:59 +04:00
|
|
|
void DispatchMessage(int32 code, BPortLink &link);
|
2004-01-22 03:32:07 +03:00
|
|
|
void Broadcast(int32 code);
|
2004-01-13 03:56:36 +03:00
|
|
|
|
2004-01-22 03:32:07 +03:00
|
|
|
ServerApp* FindApp(const char *sig);
|
2004-01-13 03:56:36 +03:00
|
|
|
|
2003-01-20 23:38:49 +03:00
|
|
|
private:
|
2004-01-14 03:54:45 +03:00
|
|
|
friend Decorator* new_decorator(BRect rect, const char *title,
|
|
|
|
int32 wlook, int32 wfeel, int32 wflags, DisplayDriver *ddriver);
|
2004-01-13 03:56:36 +03:00
|
|
|
|
2004-01-14 03:54:45 +03:00
|
|
|
// global function pointer
|
|
|
|
create_decorator *make_decorator;
|
|
|
|
|
2005-01-17 00:35:02 +03:00
|
|
|
port_id fMessagePort;
|
2004-01-14 03:54:45 +03:00
|
|
|
|
2004-01-20 01:18:37 +03:00
|
|
|
image_id fDecoratorID;
|
2004-01-14 03:54:45 +03:00
|
|
|
|
2004-01-20 01:18:37 +03:00
|
|
|
BString fDecoratorName;
|
2004-01-14 03:54:45 +03:00
|
|
|
|
2005-01-17 00:35:02 +03:00
|
|
|
bool fQuittingServer;
|
2004-01-14 03:54:45 +03:00
|
|
|
|
2004-01-20 01:18:37 +03:00
|
|
|
BList *fAppList;
|
2005-01-17 00:35:02 +03:00
|
|
|
thread_id fPicassoThreadID;
|
2004-01-14 03:54:45 +03:00
|
|
|
|
2004-01-20 01:18:37 +03:00
|
|
|
sem_id fActiveAppLock,
|
|
|
|
fAppListLock,
|
|
|
|
fDecoratorLock;
|
2004-01-14 03:54:45 +03:00
|
|
|
|
2004-01-20 01:18:37 +03:00
|
|
|
DisplayDriver *fDriver;
|
2003-01-20 23:38:49 +03:00
|
|
|
};
|
|
|
|
|
2003-02-12 04:11:55 +03:00
|
|
|
Decorator *new_decorator(BRect rect, const char *title, int32 wlook, int32 wfeel,
|
2003-01-20 23:38:49 +03:00
|
|
|
int32 wflags, DisplayDriver *ddriver);
|
2003-02-20 23:14:57 +03:00
|
|
|
|
|
|
|
extern BitmapManager *bitmapmanager;
|
2003-10-19 04:03:06 +04:00
|
|
|
extern ColorSet gui_colorset;
|
2004-01-22 03:32:07 +03:00
|
|
|
extern AppServer *app_server;
|
2003-02-20 23:14:57 +03:00
|
|
|
|
2003-02-07 20:30:17 +03:00
|
|
|
#endif
|