2005-07-05 22:14:24 +04:00
|
|
|
/*
|
|
|
|
* 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
|
|
|
|
*/
|
2004-01-12 01:12:55 +03:00
|
|
|
#ifndef _DESKTOP_H_
|
|
|
|
#define _DESKTOP_H_
|
2003-01-24 18:19:27 +03:00
|
|
|
|
2005-07-05 22:14:24 +04:00
|
|
|
|
2005-07-15 16:45:23 +04:00
|
|
|
#include "ScreenManager.h"
|
|
|
|
#include "ServerScreen.h"
|
|
|
|
#include "VirtualScreen.h"
|
|
|
|
|
2005-06-24 03:46:17 +04:00
|
|
|
#include <InterfaceDefs.h>
|
2004-01-12 01:12:55 +03:00
|
|
|
#include <List.h>
|
2005-06-24 03:46:17 +04:00
|
|
|
#include <Locker.h>
|
2003-07-06 23:48:17 +04:00
|
|
|
#include <Menu.h>
|
2005-07-05 22:14:24 +04:00
|
|
|
#include <Autolock.h>
|
|
|
|
|
2003-01-24 18:19:27 +03:00
|
|
|
|
2005-06-24 03:46:17 +04:00
|
|
|
class BMessage;
|
2005-07-05 22:14:24 +04:00
|
|
|
|
2005-06-24 03:46:17 +04:00
|
|
|
class DisplayDriver;
|
|
|
|
class HWInterface;
|
|
|
|
class Layer;
|
2004-01-12 01:12:55 +03:00
|
|
|
class RootLayer;
|
2003-08-31 21:38:34 +04:00
|
|
|
class WinBorder;
|
2003-01-24 18:19:27 +03:00
|
|
|
|
2005-07-05 22:14:24 +04:00
|
|
|
namespace BPrivate {
|
|
|
|
class LinkSender;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2005-07-15 16:45:23 +04:00
|
|
|
class Desktop : public BLocker, public ScreenOwner {
|
2005-06-24 03:46:17 +04:00
|
|
|
public:
|
2004-01-22 03:32:07 +03:00
|
|
|
// startup methods
|
2005-06-24 03:46:17 +04:00
|
|
|
Desktop();
|
|
|
|
virtual ~Desktop();
|
|
|
|
|
|
|
|
void Init();
|
2004-01-22 03:32:07 +03:00
|
|
|
|
|
|
|
// Methods for multiple monitors.
|
2005-06-25 12:45:00 +04:00
|
|
|
inline Screen* ScreenAt(int32 index) const
|
2005-07-15 16:45:23 +04:00
|
|
|
{ return fActiveScreen; }
|
2005-06-25 12:45:00 +04:00
|
|
|
inline Screen* ActiveScreen() const
|
|
|
|
{ return fActiveScreen; }
|
2005-07-15 16:45:23 +04:00
|
|
|
inline RootLayer* ActiveRootLayer() const { return fRootLayer; }
|
2005-06-25 12:45:00 +04:00
|
|
|
|
2005-07-15 16:45:23 +04:00
|
|
|
virtual void ScreenRemoved(Screen* screen) {}
|
|
|
|
virtual void ScreenAdded(Screen* screen) {}
|
|
|
|
virtual bool ReleaseScreen(Screen* screen) { return false; }
|
2005-06-25 12:45:00 +04:00
|
|
|
|
2005-07-15 16:45:23 +04:00
|
|
|
const ::VirtualScreen& VirtualScreen() const { return fVirtualScreen; }
|
2005-06-25 12:45:00 +04:00
|
|
|
inline DisplayDriver* GetDisplayDriver() const
|
2005-07-15 16:45:23 +04:00
|
|
|
{ return fVirtualScreen.DisplayDriver(); }
|
2005-06-25 12:45:00 +04:00
|
|
|
inline HWInterface* GetHWInterface() const
|
2005-07-15 16:45:23 +04:00
|
|
|
{ return fVirtualScreen.HWInterface(); }
|
2005-06-24 03:46:17 +04:00
|
|
|
|
2004-01-22 03:32:07 +03:00
|
|
|
// Methods for layer(WinBorder) manipulation.
|
2005-06-24 03:46:17 +04:00
|
|
|
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);
|
2004-07-07 00:51:16 +04:00
|
|
|
|
2005-07-05 22:14:24 +04:00
|
|
|
WinBorder* FindWinBorderByClientToken(int32 token, team_id teamID);
|
|
|
|
//WinBorder* FindWinBorderByServerToken(int32 token);
|
|
|
|
|
2005-02-28 23:23:51 +03:00
|
|
|
// get list of registed windows
|
2005-06-24 03:46:17 +04:00
|
|
|
const BList& WindowList() const
|
|
|
|
{
|
|
|
|
if (!IsLocked())
|
|
|
|
debugger("You must lock before getting registered windows list\n");
|
|
|
|
return fWinBorderList;
|
|
|
|
}
|
2005-02-28 23:23:51 +03:00
|
|
|
|
2005-07-05 22:14:24 +04:00
|
|
|
void WriteWindowList(team_id team, BPrivate::LinkSender& sender);
|
|
|
|
void WriteWindowInfo(int32 serverToken, BPrivate::LinkSender& sender);
|
2005-02-28 23:23:51 +03:00
|
|
|
|
2004-01-22 03:32:07 +03:00
|
|
|
// Methods for various desktop stuff handled by the server
|
2005-06-24 03:46:17 +04:00
|
|
|
void SetScrollBarInfo(const scroll_bar_info &info);
|
|
|
|
scroll_bar_info ScrollBarInfo() const;
|
2004-01-22 03:32:07 +03:00
|
|
|
|
2005-06-24 03:46:17 +04:00
|
|
|
void SetMenuInfo(const menu_info &info);
|
|
|
|
menu_info MenuInfo() const;
|
2004-01-22 03:32:07 +03:00
|
|
|
|
2005-06-24 03:46:17 +04:00
|
|
|
void UseFFMouse(const bool &useffm);
|
|
|
|
bool FFMouseInUse() const;
|
|
|
|
void SetFFMouseMode(const mode_mouse &value);
|
|
|
|
mode_mouse FFMouseMode() const;
|
2004-01-22 03:32:07 +03:00
|
|
|
|
2005-06-24 03:46:17 +04:00
|
|
|
private:
|
2005-07-15 16:45:23 +04:00
|
|
|
::VirtualScreen fVirtualScreen;
|
2005-06-24 03:46:17 +04:00
|
|
|
BList fWinBorderList;
|
2005-07-15 16:45:23 +04:00
|
|
|
|
|
|
|
RootLayer* fRootLayer;
|
2005-06-24 03:46:17 +04:00
|
|
|
Screen* fActiveScreen;
|
2005-07-15 16:45:23 +04:00
|
|
|
|
2005-06-24 03:46:17 +04:00
|
|
|
scroll_bar_info fScrollBarInfo;
|
|
|
|
menu_info fMenuInfo;
|
|
|
|
mode_mouse fMouseMode;
|
|
|
|
bool fFFMouseMode;
|
2004-01-12 01:12:55 +03:00
|
|
|
};
|
2003-07-06 23:48:17 +04:00
|
|
|
|
2005-05-28 17:43:13 +04:00
|
|
|
extern Desktop *gDesktop;
|
2003-02-14 04:53:53 +03:00
|
|
|
|
2005-07-05 22:14:24 +04:00
|
|
|
#endif // _DESKTOP_H_
|