The Desktop class now inherits from MessageLooper as well, the AppServer
class runs it, too. No real message processing is done yet, though. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13816 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
c6a2527297
commit
5f2edc0ffc
@ -171,6 +171,7 @@ AppServer::AppServer() :
|
||||
// Set up the Desktop
|
||||
gDesktop = new Desktop();
|
||||
gDesktop->Init();
|
||||
gDesktop->Run();
|
||||
|
||||
// TODO: Maybe this is not the best place for this
|
||||
InitializeColorMap();
|
||||
|
@ -57,11 +57,18 @@
|
||||
|
||||
|
||||
Desktop::Desktop()
|
||||
:
|
||||
: MessageLooper("desktop"),
|
||||
fSettings(new DesktopSettings::Private()),
|
||||
fWinBorderList(64),
|
||||
fActiveScreen(NULL)
|
||||
{
|
||||
// TODO: use user name
|
||||
char name[B_OS_NAME_LENGTH];
|
||||
snprintf(name, sizeof(name), "d:%s", "baron");
|
||||
|
||||
fMessagePort = create_port(DEFAULT_MONITOR_PORT_SIZE, name);
|
||||
if (fMessagePort < B_OK)
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -72,6 +79,8 @@ Desktop::~Desktop()
|
||||
|
||||
delete fRootLayer;
|
||||
delete fSettings;
|
||||
|
||||
delete_port(fMessagePort);
|
||||
}
|
||||
|
||||
|
||||
@ -97,6 +106,13 @@ Desktop::Init()
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Desktop::_GetLooperName(char* name, size_t length)
|
||||
{
|
||||
snprintf(name, length, "d:%d:%s", /*id*/0, /*name*/"baron");
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Methods for layer(WinBorder) manipulation.
|
||||
//---------------------------------------------------------------------------
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include "ServerScreen.h"
|
||||
#include "VirtualScreen.h"
|
||||
#include "DesktopSettings.h"
|
||||
#include "MessageLooper.h"
|
||||
|
||||
#include <InterfaceDefs.h>
|
||||
#include <List.h>
|
||||
@ -36,7 +37,7 @@ namespace BPrivate {
|
||||
};
|
||||
|
||||
|
||||
class Desktop : public BLocker, public ScreenOwner {
|
||||
class Desktop : public MessageLooper, public ScreenOwner {
|
||||
public:
|
||||
// startup methods
|
||||
Desktop();
|
||||
@ -85,11 +86,16 @@ class Desktop : public BLocker, public ScreenOwner {
|
||||
void WriteWindowList(team_id team, BPrivate::LinkSender& sender);
|
||||
void WriteWindowInfo(int32 serverToken, BPrivate::LinkSender& sender);
|
||||
|
||||
private:
|
||||
virtual void _GetLooperName(char* name, size_t size);
|
||||
virtual port_id _MessagePort() const { return fMessagePort; }
|
||||
|
||||
private:
|
||||
friend class DesktopSettings;
|
||||
|
||||
::VirtualScreen fVirtualScreen;
|
||||
DesktopSettings::Private* fSettings;
|
||||
port_id fMessagePort;
|
||||
BList fWinBorderList;
|
||||
|
||||
RootLayer* fRootLayer;
|
||||
|
Loading…
Reference in New Issue
Block a user