2004-01-17 21:37:57 +03:00
|
|
|
//------------------------------------------------------------------------------
|
2004-09-21 02:50:02 +04:00
|
|
|
// Copyright (c) 2001-2002, Haiku, Inc.
|
2004-01-17 21:37:57 +03:00
|
|
|
//
|
|
|
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
// copy of this software and associated documentation files (the "Software"),
|
|
|
|
// to deal in the Software without restriction, including without limitation
|
|
|
|
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
|
|
// and/or sell copies of the Software, and to permit persons to whom the
|
|
|
|
// Software is furnished to do so, subject to the following conditions:
|
|
|
|
//
|
|
|
|
// The above copyright notice and this permission notice shall be included in
|
|
|
|
// all copies or substantial portions of the Software.
|
|
|
|
//
|
|
|
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
|
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
|
|
// DEALINGS IN THE SOFTWARE.
|
|
|
|
//
|
|
|
|
// File Name: Desktop.cpp
|
2005-01-17 00:35:02 +03:00
|
|
|
// Author: Adi Oanca <adioanca@cotty.iren.ro>
|
2004-01-17 21:37:57 +03:00
|
|
|
// Description: Class used to encapsulate desktop management
|
|
|
|
//
|
|
|
|
//------------------------------------------------------------------------------
|
2004-01-12 01:12:55 +03:00
|
|
|
#ifndef _DESKTOP_H_
|
|
|
|
#define _DESKTOP_H_
|
2003-01-24 18:19:27 +03:00
|
|
|
|
2004-01-12 01:12:55 +03:00
|
|
|
#include <Locker.h>
|
|
|
|
#include <List.h>
|
2003-07-06 23:48:17 +04:00
|
|
|
#include <Menu.h>
|
2003-07-10 21:48:04 +04:00
|
|
|
#include <InterfaceDefs.h>
|
2003-01-24 18:19:27 +03:00
|
|
|
|
2004-01-12 01:12:55 +03:00
|
|
|
class RootLayer;
|
|
|
|
class Screen;
|
2003-01-24 18:19:27 +03:00
|
|
|
class Layer;
|
2004-01-12 01:12:55 +03:00
|
|
|
class BMessage;
|
2003-08-31 21:38:34 +04:00
|
|
|
class WinBorder;
|
2004-01-13 03:56:36 +03:00
|
|
|
class DisplayDriver;
|
2004-07-30 19:16:59 +04:00
|
|
|
class BPortLink;
|
2003-01-24 18:19:27 +03:00
|
|
|
|
2004-01-12 01:12:55 +03:00
|
|
|
class Desktop
|
|
|
|
{
|
|
|
|
public:
|
2004-01-22 03:32:07 +03:00
|
|
|
// startup methods
|
|
|
|
Desktop(void);
|
2005-02-28 23:23:51 +03:00
|
|
|
virtual ~Desktop(void);
|
2004-01-22 03:32:07 +03:00
|
|
|
void Init(void);
|
|
|
|
|
|
|
|
// 1-BigScreen or n-SmallScreens
|
|
|
|
void InitMode(void);
|
|
|
|
|
|
|
|
// Methods for multiple monitors.
|
|
|
|
Screen *ScreenAt(int32 index) const;
|
|
|
|
int32 ScreenCount(void) const;
|
2004-06-26 06:15:48 +04:00
|
|
|
Screen *ActiveScreen(void) const;
|
2004-01-22 03:32:07 +03:00
|
|
|
|
|
|
|
void SetActiveRootLayerByIndex(int32 listIndex);
|
2004-06-26 06:15:48 +04:00
|
|
|
void SetActiveRootLayer(RootLayer *rl);
|
|
|
|
RootLayer *RootLayerAt(int32 index);
|
|
|
|
RootLayer *ActiveRootLayer(void) const;
|
2004-01-22 03:32:07 +03:00
|
|
|
int32 ActiveRootLayerIndex(void) const;
|
|
|
|
int32 CountRootLayers(void) const;
|
2004-06-26 06:15:48 +04:00
|
|
|
DisplayDriver *GetDisplayDriver(void) const;
|
2004-01-22 03:32:07 +03:00
|
|
|
|
|
|
|
// Methods for layer(WinBorder) manipulation.
|
2004-06-26 06:15:48 +04:00
|
|
|
void AddWinBorder(WinBorder *winBorder);
|
|
|
|
void RemoveWinBorder(WinBorder *winBorder);
|
2005-02-28 23:23:51 +03:00
|
|
|
void AddWinBorderToSubset(WinBorder *winBorder, WinBorder *toWinBorder);
|
|
|
|
void RemoveWinBorderFromSubset(WinBorder *winBorder, WinBorder *fromWinBorder);
|
2004-07-07 00:51:16 +04:00
|
|
|
|
2005-02-28 23:23:51 +03:00
|
|
|
WinBorder* FindWinBorderByServerWindowTokenAndTeamID(int32 token, team_id teamID);
|
|
|
|
// get list of registed windows
|
|
|
|
const BList& WindowList() const
|
|
|
|
{
|
|
|
|
if (!IsLocked())
|
|
|
|
debugger("You must lock before getting registered windows list\n");
|
|
|
|
return fWinBorderList;
|
|
|
|
}
|
|
|
|
|
|
|
|
// locking with regards to registered windows list
|
|
|
|
bool Lock() { return fWinLock.Lock(); }
|
|
|
|
void Unlock() { return fWinLock.Unlock(); }
|
|
|
|
bool IsLocked() const { return fWinLock.IsLocked(); }
|
|
|
|
|
2004-01-22 03:32:07 +03:00
|
|
|
// Methods for various desktop stuff handled by the server
|
|
|
|
void SetScrollBarInfo(const scroll_bar_info &info);
|
|
|
|
scroll_bar_info ScrollBarInfo(void) const;
|
|
|
|
|
|
|
|
void SetMenuInfo(const menu_info &info);
|
|
|
|
menu_info MenuInfo(void) const;
|
|
|
|
|
|
|
|
void UseFFMouse(const bool &useffm);
|
|
|
|
bool FFMouseInUse(void) const;
|
|
|
|
void SetFFMouseMode(const mode_mouse &value);
|
|
|
|
mode_mouse FFMouseMode(void) const;
|
|
|
|
|
|
|
|
// Debugging methods
|
|
|
|
void PrintToStream(void);
|
|
|
|
void PrintVisibleInRootLayerNo(int32 no);
|
|
|
|
|
2004-01-12 01:12:55 +03:00
|
|
|
private:
|
2005-02-28 23:23:51 +03:00
|
|
|
void AddDriver(DisplayDriver *driver);
|
|
|
|
|
|
|
|
BList fWinBorderList;
|
|
|
|
BLocker fWinLock;
|
|
|
|
|
|
|
|
BList fRootLayerList;
|
|
|
|
RootLayer *fActiveRootLayer;
|
2004-07-07 00:51:16 +04:00
|
|
|
|
2005-02-28 23:23:51 +03:00
|
|
|
BList fScreenList;
|
|
|
|
Screen *fActiveScreen;
|
2004-01-22 03:32:07 +03:00
|
|
|
|
|
|
|
scroll_bar_info fScrollBarInfo;
|
2005-02-28 23:23:51 +03:00
|
|
|
menu_info fMenuInfo;
|
|
|
|
mode_mouse fMouseMode;
|
|
|
|
bool fFFMouseMode;
|
2004-01-12 01:12:55 +03:00
|
|
|
};
|
2003-07-06 23:48:17 +04:00
|
|
|
|
2004-06-26 06:15:48 +04:00
|
|
|
extern Desktop *desktop;
|
2003-02-14 04:53:53 +03:00
|
|
|
|
2004-05-26 20:38:58 +04:00
|
|
|
#endif // _DESKTOP_H_
|