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:
@@ -171,6 +171,7 @@ AppServer::AppServer() :
|
|||||||
// Set up the Desktop
|
// Set up the Desktop
|
||||||
gDesktop = new Desktop();
|
gDesktop = new Desktop();
|
||||||
gDesktop->Init();
|
gDesktop->Init();
|
||||||
|
gDesktop->Run();
|
||||||
|
|
||||||
// TODO: Maybe this is not the best place for this
|
// TODO: Maybe this is not the best place for this
|
||||||
InitializeColorMap();
|
InitializeColorMap();
|
||||||
|
|||||||
@@ -57,11 +57,18 @@
|
|||||||
|
|
||||||
|
|
||||||
Desktop::Desktop()
|
Desktop::Desktop()
|
||||||
:
|
: MessageLooper("desktop"),
|
||||||
fSettings(new DesktopSettings::Private()),
|
fSettings(new DesktopSettings::Private()),
|
||||||
fWinBorderList(64),
|
fWinBorderList(64),
|
||||||
fActiveScreen(NULL)
|
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 fRootLayer;
|
||||||
delete fSettings;
|
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.
|
// Methods for layer(WinBorder) manipulation.
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
#include "ServerScreen.h"
|
#include "ServerScreen.h"
|
||||||
#include "VirtualScreen.h"
|
#include "VirtualScreen.h"
|
||||||
#include "DesktopSettings.h"
|
#include "DesktopSettings.h"
|
||||||
|
#include "MessageLooper.h"
|
||||||
|
|
||||||
#include <InterfaceDefs.h>
|
#include <InterfaceDefs.h>
|
||||||
#include <List.h>
|
#include <List.h>
|
||||||
@@ -36,7 +37,7 @@ namespace BPrivate {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class Desktop : public BLocker, public ScreenOwner {
|
class Desktop : public MessageLooper, public ScreenOwner {
|
||||||
public:
|
public:
|
||||||
// startup methods
|
// startup methods
|
||||||
Desktop();
|
Desktop();
|
||||||
@@ -85,11 +86,16 @@ class Desktop : public BLocker, public ScreenOwner {
|
|||||||
void WriteWindowList(team_id team, BPrivate::LinkSender& sender);
|
void WriteWindowList(team_id team, BPrivate::LinkSender& sender);
|
||||||
void WriteWindowInfo(int32 serverToken, 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:
|
private:
|
||||||
friend class DesktopSettings;
|
friend class DesktopSettings;
|
||||||
|
|
||||||
::VirtualScreen fVirtualScreen;
|
::VirtualScreen fVirtualScreen;
|
||||||
DesktopSettings::Private* fSettings;
|
DesktopSettings::Private* fSettings;
|
||||||
|
port_id fMessagePort;
|
||||||
BList fWinBorderList;
|
BList fWinBorderList;
|
||||||
|
|
||||||
RootLayer* fRootLayer;
|
RootLayer* fRootLayer;
|
||||||
|
|||||||
Reference in New Issue
Block a user