Files
haiku-beta6/src/servers/app/WorkspacesLayer.h
T
Axel Dörfler 903936bcec Added the scrolling offset when a view is created.
This lightens the problem in bug #98 a bit, but doesn't completely fix it; you
still don't see any items in that list on the switch, but they now appear again
when you scroll around there.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16997 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-04-04 01:51:16 +00:00

62 lines
1.7 KiB
C++

/*
* Copyright 2005-2006, Haiku Inc.
* Distributed under the terms of the MIT License.
*
* Authors:
* Axel Dörfler, [email protected]
*/
#ifndef WORKSPACES_LAYER_H
#define WORKSPACES_LAYER_H
#include "ViewLayer.h"
class WindowLayer;
class WorkspacesLayer : public ViewLayer {
public:
WorkspacesLayer(BRect frame, BPoint scrollingOffset, const char* name,
int32 token, uint32 resize, uint32 flags);
virtual ~WorkspacesLayer();
virtual void Draw(DrawingEngine* drawingEngine,
BRegion* effectiveClipping,
BRegion* windowContentClipping,
bool deep = false);
virtual void MouseDown(BMessage* message, BPoint where);
virtual void MouseUp(BMessage* message, BPoint where);
virtual void MouseMoved(BMessage* message, BPoint where);
void WindowChanged(WindowLayer* window);
void WindowRemoved(WindowLayer* window);
private:
void _GetGrid(int32& columns, int32& rows);
BRect _ScreenFrame(int32 index);
BRect _WorkspaceAt(int32 index);
BRect _WorkspaceAt(BPoint where, int32& index);
BRect _WindowFrame(const BRect& workspaceFrame,
const BRect& screenFrame, const BRect& windowFrame,
BPoint windowPosition);
void _DrawWindow(DrawingEngine* drawingEngine, const BRect& workspaceFrame,
const BRect& screenFrame, WindowLayer* window,
BPoint windowPosition, BRegion& backgroundRegion,
bool active);
void _DrawWorkspace(DrawingEngine* drawingEngine, BRegion& redraw,
int32 index);
void _DarkenColor(RGBColor& color) const;
void _Invalidate() const;
private:
WindowLayer* fSelectedWindow;
int32 fSelectedWorkspace;
bool fHasMoved;
BPoint fLeftTopOffset;
};
#endif // WORKSPACES_LAYER_H