2004-01-11 22:12:55 +00:00
|
|
|
#ifndef _WORKSPACE_H_
|
|
|
|
#define _WORKSPACE_H_
|
|
|
|
|
|
|
|
#include <SupportDefs.h>
|
2004-01-13 01:03:29 +00:00
|
|
|
#include <Locker.h>
|
2004-01-11 22:12:55 +00:00
|
|
|
|
|
|
|
#include "RGBColor.h"
|
|
|
|
|
|
|
|
class WinBorder;
|
|
|
|
class RBGColor;
|
2004-01-13 01:03:29 +00:00
|
|
|
class RootLayer;
|
2004-01-11 22:12:55 +00:00
|
|
|
|
|
|
|
struct ListData{
|
|
|
|
WinBorder *layerPtr;
|
|
|
|
ListData *upperItem;
|
|
|
|
ListData *lowerItem;
|
|
|
|
};
|
|
|
|
|
|
|
|
class Workspace
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Workspace(const uint32 colorspace,
|
|
|
|
int32 ID,
|
2004-01-13 01:03:29 +00:00
|
|
|
const RGBColor& BGColor,
|
|
|
|
RootLayer* owner);
|
2004-01-11 22:12:55 +00:00
|
|
|
~Workspace();
|
|
|
|
|
|
|
|
bool AddLayerPtr(WinBorder* layer);
|
|
|
|
bool RemoveLayerPtr(WinBorder* layer);
|
2004-01-17 16:33:22 +00:00
|
|
|
bool HideSubsetWindows(WinBorder* layer);
|
2004-01-13 01:03:29 +00:00
|
|
|
WinBorder* SetFocusLayer(WinBorder* layer);
|
2004-01-11 22:12:55 +00:00
|
|
|
WinBorder* FocusLayer() const;
|
2004-01-13 01:03:29 +00:00
|
|
|
WinBorder* SetFrontLayer(WinBorder* layer);
|
2004-01-11 22:12:55 +00:00
|
|
|
WinBorder* FrontLayer() const;
|
|
|
|
|
|
|
|
void MoveToBack(WinBorder* newLast);
|
|
|
|
|
|
|
|
WinBorder* GoToBottomItem(); // the one that's visible.
|
|
|
|
WinBorder* GoToUpperItem();
|
|
|
|
WinBorder* GoToTopItem();
|
|
|
|
WinBorder* GoToLowerItem();
|
|
|
|
bool GoToItem(WinBorder* layer);
|
|
|
|
|
2004-01-13 01:03:29 +00:00
|
|
|
WinBorder* SearchLayerUnderPoint(BPoint pt);
|
2004-01-14 00:26:15 +00:00
|
|
|
void Invalidate();
|
2004-01-13 01:03:29 +00:00
|
|
|
|
2004-01-11 22:12:55 +00:00
|
|
|
void SetLocalSpace(const uint32 colorspace);
|
|
|
|
uint32 LocalSpace() const;
|
|
|
|
|
|
|
|
void SetBGColor(const RGBColor &c);
|
|
|
|
RGBColor BGColor(void) const;
|
|
|
|
|
|
|
|
int32 ID() const { return fID; }
|
|
|
|
|
|
|
|
// void SetFlags(const uint32 flags);
|
|
|
|
// uint32 Flags(void) const;
|
|
|
|
// debug methods
|
|
|
|
void PrintToStream() const;
|
2004-01-13 01:03:29 +00:00
|
|
|
void PrintItem(ListData *item) const;
|
2004-01-11 22:12:55 +00:00
|
|
|
|
2004-01-14 00:26:15 +00:00
|
|
|
// .... private :-) - do not use!
|
|
|
|
void SearchAndSetNewFront(WinBorder* preferred);
|
|
|
|
void SearchAndSetNewFocus(WinBorder* preferred);
|
2004-01-17 16:33:22 +00:00
|
|
|
void BringToFrontANormalWindow(WinBorder* layer);
|
2004-01-14 00:26:15 +00:00
|
|
|
|
2004-01-14 15:55:10 +00:00
|
|
|
ListData* HasItem(ListData* item);
|
|
|
|
ListData* HasItem(WinBorder* layer);
|
|
|
|
|
2004-01-11 22:12:55 +00:00
|
|
|
private:
|
|
|
|
|
|
|
|
void InsertItem(ListData* item, ListData* before);
|
|
|
|
void RemoveItem(ListData* item);
|
|
|
|
|
|
|
|
ListData* FindPlace(ListData* pref);
|
|
|
|
|
|
|
|
int32 fID;
|
|
|
|
uint32 fSpace;
|
|
|
|
// uint32 fFlags;
|
|
|
|
RGBColor fBGColor;
|
|
|
|
|
2004-01-13 01:03:29 +00:00
|
|
|
BLocker opLock;
|
|
|
|
|
|
|
|
RootLayer *fOwner;
|
|
|
|
|
2004-01-11 22:12:55 +00:00
|
|
|
ListData *fBottomItem, // first visible onscreen
|
|
|
|
*fTopItem, // the last visible(or covered by other Layers)
|
|
|
|
*fCurrentItem, // pointer to the currect element in the list
|
|
|
|
*fFocusItem, // the focus WinBorder - for keyboard events
|
|
|
|
*fFrontItem; // the one the mouse can bring in front as possible(in its set)
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|