haiku/src/servers/app/Desktop.h
Axel Dörfler ef8810f2ad Extracted the settings stuff from the Desktop class. If you now need to access
the desktop's settings, you have to do something like this:
	DesktopSettings settings(desktop);
	settings.SetMouseMode(mode);
The advantage of this is that this object is fully locked, and cannot lead to
corrupted settings anymore. Also, the settings will stay the same until you
delete the object again.
Updated all accesses to use this new API.
Removed no longer used FFM messages.
Implemented AS_{GET|SET}_MENU_INFO for future use.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13719 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-07-17 16:25:48 +00:00

102 lines
2.6 KiB
C++

/*
* Copyright 2001-2005, Haiku.
* Distributed under the terms of the MIT License.
*
* Authors:
* Adrian Oanca <adioanca@cotty.iren.ro>
* Stephan Aßmus <superstippi@gmx.de>
* Axel Dörfler, axeld@pinc-software.de
*/
#ifndef _DESKTOP_H_
#define _DESKTOP_H_
#include "ScreenManager.h"
#include "ServerScreen.h"
#include "VirtualScreen.h"
#include "DesktopSettings.h"
#include <InterfaceDefs.h>
#include <List.h>
#include <Locker.h>
#include <Menu.h>
#include <Autolock.h>
class BMessage;
class DisplayDriver;
class HWInterface;
class Layer;
class RootLayer;
class WinBorder;
namespace BPrivate {
class LinkSender;
};
class Desktop : public BLocker, public ScreenOwner {
public:
// startup methods
Desktop();
virtual ~Desktop();
void Init();
// Methods for multiple monitors.
inline Screen* ScreenAt(int32 index) const
{ return fActiveScreen; }
inline Screen* ActiveScreen() const
{ return fActiveScreen; }
inline RootLayer* ActiveRootLayer() const { return fRootLayer; }
virtual void ScreenRemoved(Screen* screen) {}
virtual void ScreenAdded(Screen* screen) {}
virtual bool ReleaseScreen(Screen* screen) { return false; }
const ::VirtualScreen& VirtualScreen() const { return fVirtualScreen; }
inline DisplayDriver* GetDisplayDriver() const
{ return fVirtualScreen.DisplayDriver(); }
inline HWInterface* GetHWInterface() const
{ return fVirtualScreen.HWInterface(); }
// Methods for layer(WinBorder) manipulation.
void AddWinBorder(WinBorder *winBorder);
void RemoveWinBorder(WinBorder *winBorder);
void SetWinBorderFeel(WinBorder *winBorder,
uint32 feel);
void AddWinBorderToSubset(WinBorder *winBorder,
WinBorder *toWinBorder);
void RemoveWinBorderFromSubset(WinBorder *winBorder,
WinBorder *fromWinBorder);
WinBorder* FindWinBorderByClientToken(int32 token, team_id teamID);
//WinBorder* FindWinBorderByServerToken(int32 token);
// get list of registed windows
const BList& WindowList() const
{
if (!IsLocked())
debugger("You must lock before getting registered windows list\n");
return fWinBorderList;
}
void WriteWindowList(team_id team, BPrivate::LinkSender& sender);
void WriteWindowInfo(int32 serverToken, BPrivate::LinkSender& sender);
private:
friend class DesktopSettings;
::VirtualScreen fVirtualScreen;
DesktopSettings::Private* fSettings;
BList fWinBorderList;
RootLayer* fRootLayer;
Screen* fActiveScreen;
};
extern Desktop *gDesktop;
#endif // _DESKTOP_H_