115 lines
3.9 KiB
C++
115 lines
3.9 KiB
C++
//------------------------------------------------------------------------------
|
|||
|
|
// Copyright (c) 2001-2003, OpenBeOS
|
||
|
|
//
|
||
|
|
// 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: RootLayer.h
|
||
|
|
// Author: Gabe Yoder <[email protected]>
|
||
// DarkWyrm <[email protected]>
|
|||
|
|
// Description: Class used for the top layer of each workspace's Layer tree
|
||
//
|
|||
|
|
//------------------------------------------------------------------------------
|
||
#ifndef _ROOTLAYER_H_
|
|||
|
|
#define _ROOTLAYER_H_
|
||
|
|
|
||
#include <List.h>
|
|||
#include <Locker.h>
|
|||
|
|||
|
|
#include "Layer.h"
|
||
|
|
#include "FMWList.h"
|
||
|
|
|
||
class RGBColor;
|
|||
class Workspace;
|
|||
|
|
class Screen;
|
||
|
|
class WinBorder;
|
||
|
|
class Desktop;
|
||
class DisplayDriver;
|
|||
|
|||
/*!
|
|||
|
|
\class RootLayer RootLayer.h
|
||
|
|
\brief Class used for the top layer of each workspace's Layer tree
|
||
|
|
|
||
|
|
RootLayers are used to head up the top of each Layer tree and reimplement certain
|
||
|
|
Layer functions to act accordingly. There is only one for each workspace class.
|
||
|
|
|
||
|
|
*/
|
||
class RootLayer : public Layer
|
|||
|
|
{
|
||
|
|
public:
|
||
RootLayer(const char *name,
|
|||
|
|
int32 workspaceCount, Desktop *desktop, DisplayDriver *driver);
|
||
virtual ~RootLayer();
|
|||
|
|
|
||
|
|
virtual void Draw(const BRect &r);
|
||
|
|
virtual void MoveBy(float x, float y);
|
||
|
|
virtual void ResizeBy(float x, float y);
|
||
|
|||
virtual Layer* VirtualTopChild() const; //
|
|||
|
|
virtual Layer* VirtualLowerSibling() const; // ... for the active workspace
|
||
|
|
virtual Layer* VirtualUpperSibling() const; //
|
||
|
|
virtual Layer* VirtualBottomChild() const; //
|
||
|
|||
void AddWinBorder(WinBorder* winBorder);
|
|||
|
|
void RemoveWinBorder(WinBorder* winBorder);
|
||
|
|
void ChangeWorkspacesFor(WinBorder* winBorder, uint32 newWorkspaces);
|
||
|
|
bool SetFrontWinBorder(WinBorder* winBorder);
|
||
|
|
|
||
|
|
void SetScreens(Screen *screen[], int32 rows, int32 columns);
|
||
|
|
Screen** Screens();
|
||
|
|
bool SetScreenResolution(int32 width, int32 height, uint32 colorspace);
|
||
|
|
int32 ScreenRows() const { return fRows; }
|
||
|
|
int32 ScreenColumns() const { return fColumns; }
|
||
|
|
|
||
|
|
void SetWorkspaceCount(const int32 count);
|
||
|
|
int32 WorkspaceCount(void) const;
|
||
|
|
Workspace* WorkspaceAt(const int32 index) const;
|
||
|
|
void SetActiveWorkspaceByIndex(const int32 index);
|
||
|
|
void SetActiveWorkspace(Workspace *ws);
|
||
|
|
int32 ActiveWorkspaceIndex(void) const;
|
||
|
|
Workspace* ActiveWorkspace(void) const;
|
||
|
|||
void SetBGColor(const RGBColor &col);
|
|||
|
|
RGBColor BGColor(void) const;
|
||
|
|
|
||
|
|
void AddWinBorderToWorkspaces(WinBorder* winBorder,
|
||
|
|
uint32 wks);
|
||
|
|
|
||
|
|
// ------- debugging methods -------
|
||
|
|
void PrintToStream();
|
||
|
|
// "Private" to app_server :-) - they should not be used
|
||
|
|
void RemoveAppWindow(WinBorder *wb);
|
||
|
|
|
||
|
|
FMWList fMainFMWList;
|
||
|
|
BLocker fMainLock;
|
||
private:
|
|||
Desktop *fDesktop;
|
|||
|
|
|
||
|
|
BList fScreenPtrList;
|
||
|
|
int32 fRows;
|
||
|
|
int32 fColumns;
|
||
|
|
int32 fScreenXResolution;
|
||
|
|
int32 fScreenYResolution;
|
||
|
|
uint32 fColorSpace;
|
||
|
|
|
||
|
|
BList fWSPtrList;
|
||
|
|
Workspace *fActiveWorkspace;
|
||
};
|
|||
|
|
|
||
|
|
#endif
|