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-03-30 04:17:50 +04:00
|
|
|
#include <PortQueue.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;
|
2003-02-20 23:14:57 +03:00
|
|
|
class CursorManager;
|
|
|
|
class BitmapManager;
|
2003-10-04 04:56:43 +04:00
|
|
|
class PortMessage;
|
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.
|
|
|
|
*/
|
2003-02-15 18:28:22 +03:00
|
|
|
#if DISPLAYDRIVER == HWDRIVER
|
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);
|
|
|
|
thread_id Run(void);
|
|
|
|
void MainLoop(void);
|
|
|
|
|
|
|
|
bool LoadDecorator(const char *path);
|
|
|
|
void InitDecorators(void);
|
|
|
|
|
|
|
|
void DispatchMessage(PortMessage *msg);
|
|
|
|
void Broadcast(int32 code);
|
2004-01-13 03:56:36 +03:00
|
|
|
|
|
|
|
// TODO: remove shortly!
|
2004-01-14 03:54:45 +03:00
|
|
|
void HandleKeyMessage(int32 code, int8 *buffer);
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
2004-01-20 01:18:37 +03:00
|
|
|
port_id _fMessagePort,
|
|
|
|
fMousePort;
|
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
|
|
|
|
2004-01-20 01:18:37 +03:00
|
|
|
bool fQuittingServer,
|
|
|
|
fExitPoller;
|
2004-01-14 03:54:45 +03:00
|
|
|
|
2004-01-20 01:18:37 +03:00
|
|
|
BList *fAppList;
|
|
|
|
thread_id fPollerThreadID,
|
|
|
|
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;
|
2004-01-14 03:54:45 +03:00
|
|
|
|
2004-01-20 01:18:37 +03:00
|
|
|
int32 fScreenShotIndex;
|
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 CursorManager *cursormanager;
|
|
|
|
extern BitmapManager *bitmapmanager;
|
2003-10-19 04:03:06 +04:00
|
|
|
extern ColorSet gui_colorset;
|
2003-02-20 23:14:57 +03:00
|
|
|
|
2003-02-07 20:30:17 +03:00
|
|
|
#endif
|