Added FrontWinBorder(). Made FocusWinBorder() and a few other methods inline.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12075 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Adi Oanca 2005-03-27 12:58:27 +00:00
parent ab88eaf2ad
commit 2401f93d84
2 changed files with 95 additions and 100 deletions

View File

@ -804,11 +804,6 @@ WinBorder* RootLayer::WinBorderAt(const BPoint& pt) const{
return NULL; return NULL;
} }
WinBorder* RootLayer::FocusWinBorder() const
{
return ActiveWorkspace()->Focus();
}
void RootLayer::SetScreens(Screen *screen[], int32 rows, int32 columns) void RootLayer::SetScreens(Screen *screen[], int32 rows, int32 columns)
{ {
// NOTE: All screens *must* have the same resolution // NOTE: All screens *must* have the same resolution

View File

@ -35,9 +35,9 @@
#include "FMWList.h" #include "FMWList.h"
#include "CursorHandler.h" #include "CursorHandler.h"
#include "CursorManager.h" #include "CursorManager.h"
#include "Workspace.h"
class RGBColor; class RGBColor;
class Workspace;
class Screen; class Screen;
class WinBorder; class WinBorder;
class Desktop; class Desktop;
@ -55,127 +55,127 @@ class BPortLink;
class RootLayer : public Layer class RootLayer : public Layer
{ {
public: public:
RootLayer(const char *name, int32 workspaceCount, Desktop *desktop, RootLayer(const char *name, int32 workspaceCount,
DisplayDriver *driver); Desktop *desktop, DisplayDriver *driver);
virtual ~RootLayer(void); virtual ~RootLayer(void);
virtual void MoveBy(float x, float y); virtual void MoveBy(float x, float y);
virtual void ResizeBy(float x, float y); virtual void ResizeBy(float x, float y);
// For the active workspaces // For the active workspaces
virtual Layer *VirtualTopChild(void) const; virtual Layer* VirtualTopChild(void) const;
virtual Layer *VirtualLowerSibling(void) const; virtual Layer* VirtualLowerSibling(void) const;
virtual Layer *VirtualUpperSibling(void) const; virtual Layer* VirtualUpperSibling(void) const;
virtual Layer *VirtualBottomChild(void) const; virtual Layer* VirtualBottomChild(void) const;
void HideWinBorder(WinBorder* winBorder); void HideWinBorder(WinBorder* winBorder);
void ShowWinBorder(WinBorder* winBorder); void ShowWinBorder(WinBorder* winBorder);
void SetWinBorderWorskpaces(WinBorder *winBorder, uint32 newWksIndex); void SetWinBorderWorskpaces(WinBorder *winBorder, uint32 newWksIndex);
WinBorder* WinBorderAt(const BPoint& pt) const; WinBorder* WinBorderAt(const BPoint& pt) const;
WinBorder* FocusWinBorder() const; inline WinBorder* FocusWinBorder() const { return fWorkspace[fActiveWksIndex]->Focus(); }
inline WinBorder* FrontWinBorder() const { return fWorkspace[fActiveWksIndex]->Front(); }
void SetWorkspaceCount(int32 wksCount); inline void SetWorkspaceCount(int32 wksCount);
int32 WorkspaceCount() const { return fWsCount; } inline int32 WorkspaceCount() const { return fWsCount; }
Workspace* WorkspaceAt(int32 index) const { return fWorkspace[index]; } inline Workspace* WorkspaceAt(int32 index) const { return fWorkspace[index]; }
Workspace* ActiveWorkspace() const { return fWorkspace[fActiveWksIndex]; } inline Workspace* ActiveWorkspace() const { return fWorkspace[fActiveWksIndex]; }
int32 ActiveWorkspaceIndex() const { return fActiveWksIndex; } inline int32 ActiveWorkspaceIndex() const { return fActiveWksIndex; }
void SetActiveWorkspace(int32 index); void SetActiveWorkspace(int32 index);
void ReadWorkspaceData(const char *path); void ReadWorkspaceData(const char *path);
void SaveWorkspaceData(const char *path); void SaveWorkspaceData(const char *path);
void SetScreens(Screen *screen[], int32 rows, int32 columns); void SetScreens(Screen *screen[], int32 rows, int32 columns);
Screen **Screens(void); Screen** Screens(void);
bool SetScreenResolution(int32 width, int32 height, uint32 colorspace); bool SetScreenResolution(int32 width, int32 height, uint32 colorspace);
int32 ScreenRows(void) const { return fRows; } int32 ScreenRows(void) const { return fRows; }
int32 ScreenColumns(void) const { return fColumns; } int32 ScreenColumns(void) const { return fColumns; }
void SetBGColor(const RGBColor &col); void SetBGColor(const RGBColor &col);
RGBColor BGColor(void) const; RGBColor BGColor(void) const;
int32 Buttons(void) { return fButtons; } inline int32 Buttons(void) { return fButtons; }
virtual bool HasClient(void) { return false; } virtual bool HasClient(void) { return false; }
void AddWinBorderToWorkspaces(WinBorder *winBorder, uint32 wks); void SetDragMessage(BMessage *msg);
BMessage* DragMessage(void) const;
void SetDragMessage(BMessage *msg); static int32 WorkingThread(void *data);
BMessage *DragMessage(void) const;
static int32 WorkingThread(void *data); CursorManager& GetCursorManager() { return fCursorManager; }
CursorManager& GetCursorManager() { return fCursorManager; } // Other methods
bool Lock() { return fAllRegionsLock.Lock(); }
void Unlock() { fAllRegionsLock.Unlock(); }
bool IsLocked() { return fAllRegionsLock.IsLocked(); }
void RunThread();
status_t EnqueueMessage(BPortLink &message);
void GoInvalidate(const Layer *layer, const BRegion &region);
void GoRedraw(const Layer *layer, const BRegion &region);
// Other methods // Debug methods
bool Lock() { return fAllRegionsLock.Lock(); } void PrintToStream(void);
void Unlock() { fAllRegionsLock.Unlock(); }
bool IsLocked() { return fAllRegionsLock.IsLocked(); }
void RunThread();
status_t EnqueueMessage(BPortLink &message);
void GoInvalidate(const Layer *layer, const BRegion &region);
void GoRedraw(const Layer *layer, const BRegion &region);
// Debug methods
void PrintToStream(void);
BRegion fRedrawReg; BRegion fRedrawReg;
BList fCopyRegList; BList fCopyRegList;
BList fCopyList; BList fCopyList;
private: private:
friend class Desktop; friend class Desktop;
// these are meant for Desktop class only!
void AddWinBorder(WinBorder* winBorder);
void RemoveWinBorder(WinBorder* winBorder);
void AddSubsetWinBorder(WinBorder *winBorder, WinBorder *toWinBorder);
void RemoveSubsetWinBorder(WinBorder *winBorder, WinBorder *fromWinBorder);
void show_winBorder(WinBorder* winBorder); // these are meant for Desktop class only!
void hide_winBorder(WinBorder* winBorder); void AddWinBorder(WinBorder* winBorder);
void RemoveWinBorder(WinBorder* winBorder);
void AddSubsetWinBorder(WinBorder *winBorder, WinBorder *toWinBorder);
void RemoveSubsetWinBorder(WinBorder *winBorder, WinBorder *fromWinBorder);
bool get_workspace_windows(); void show_winBorder(WinBorder* winBorder);
void draw_window_tab(WinBorder *exFocus, WinBorder *focus); void hide_winBorder(WinBorder* winBorder);
void empty_visible_regions(Layer *layer);
void invalidate_layer(Layer *layer, const BRegion &region); bool get_workspace_windows();
void redraw_layer(Layer *layer, const BRegion &region); void draw_window_tab(WinBorder *exFocus, WinBorder *focus);
void empty_visible_regions(Layer *layer);
// Input related methods void invalidate_layer(Layer *layer, const BRegion &region);
void MouseEventHandler(int32 code, BPortLink& link); void redraw_layer(Layer *layer, const BRegion &region);
void KeyboardEventHandler(int32 code, BPortLink& link);
Desktop *fDesktop; // Input related methods
BMessage *fDragMessage; void MouseEventHandler(int32 code, BPortLink& link);
Layer *fLastMouseMoved; void KeyboardEventHandler(int32 code, BPortLink& link);
int32 fViewAction;
Layer *fEventMaskLayer;
CursorManager fCursorManager;
BLocker fAllRegionsLock;
thread_id fThreadID; Desktop *fDesktop;
port_id fListenPort; BMessage *fDragMessage;
Layer *fLastMouseMoved;
int32 fViewAction;
Layer *fEventMaskLayer;
CursorManager fCursorManager;
BLocker fAllRegionsLock;
BList fScreenPtrList; thread_id fThreadID;
int32 fRows; port_id fListenPort;
int32 fColumns;
int32 fScreenXResolution; BList fScreenPtrList;
int32 fScreenYResolution; int32 fRows;
uint32 fColorSpace; int32 fColumns;
int32 fButtons; int32 fScreenXResolution;
BPoint fLastMousePossition; int32 fScreenYResolution;
bool fMovingWindow; uint32 fColorSpace;
bool fResizingWindow; int32 fButtons;
BPoint fLastMousePossition;
bool fMovingWindow;
bool fResizingWindow;
int32 fActiveWksIndex; int32 fActiveWksIndex;
int32 fWsCount; int32 fWsCount;
Workspace* fWorkspace[32]; Workspace* fWorkspace[32];
WinBorder** fWinBorderList2; WinBorder** fWinBorderList2;
WinBorder** fWinBorderList; WinBorder** fWinBorderList;
int32 fWinBorderCount; int32 fWinBorderCount;
mutable int32 fWinBorderIndex; mutable int32 fWinBorderIndex;
int32 fWinBorderListLength; int32 fWinBorderListLength;
int32 fScreenShotIndex; int32 fScreenShotIndex;
bool fQuiting; bool fQuiting;
}; };
#endif #endif