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-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-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:
|
|
|
|
AppServer(void);
|
|
|
|
~AppServer(void);
|
|
|
|
static int32 PollerThread(void *data);
|
|
|
|
static int32 PicassoThread(void *data);
|
2003-02-15 18:28:22 +03:00
|
|
|
thread_id Run(void);
|
2003-01-20 23:38:49 +03:00
|
|
|
void MainLoop(void);
|
|
|
|
bool LoadDecorator(const char *path);
|
|
|
|
void DispatchMessage(int32 code, int8 *buffer);
|
|
|
|
void Broadcast(int32 code);
|
|
|
|
void HandleKeyMessage(int32 code, int8 *buffer);
|
2003-02-04 03:20:15 +03:00
|
|
|
ServerApp *FindApp(const char *sig);
|
2003-01-20 23:38:49 +03:00
|
|
|
private:
|
2003-02-12 04:11:55 +03:00
|
|
|
friend Decorator *new_decorator(BRect rect, const char *title, int32 wlook, int32 wfeel,
|
|
|
|
int32 wflags, DisplayDriver *ddriver);
|
|
|
|
|
|
|
|
create_decorator *make_decorator; // global function pointer
|
2003-01-20 23:38:49 +03:00
|
|
|
|
2003-01-27 22:43:15 +03:00
|
|
|
port_id _messageport,_mouseport;
|
|
|
|
image_id _decorator_id;
|
|
|
|
bool _quitting_server;
|
|
|
|
BList *_applist;
|
|
|
|
int32 _active_app;
|
|
|
|
ServerApp *_p_active_app;
|
|
|
|
thread_id _poller_id, _picasso_id;
|
2003-01-20 23:38:49 +03:00
|
|
|
|
2003-01-27 22:43:15 +03:00
|
|
|
sem_id _active_lock, _applist_lock, _decor_lock;
|
|
|
|
bool _exit_poller;
|
|
|
|
DisplayDriver *_driver;
|
2003-03-30 04:17:50 +04:00
|
|
|
int32 _ssindex;
|
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-02-07 20:30:17 +03:00
|
|
|
#endif
|