2 * Copyright 2005-2008, Haiku Inc.
3 * Distributed under the terms of the MIT License.
6 * Axel Dörfler, axeld@pinc-software.de
8 #ifndef WORKSPACES_VIEW_H
9 #define WORKSPACES_VIEW_H
15 class WorkspacesView
: public View
{
17 WorkspacesView(BRect frame
, BPoint scrollingOffset
,
18 const char* name
, int32 token
, uint32 resize
,
20 virtual ~WorkspacesView();
22 virtual void AttachedToWindow(::Window
* window
);
23 virtual void DetachedFromWindow();
25 virtual void Draw(DrawingEngine
* drawingEngine
,
26 BRegion
* effectiveClipping
,
27 BRegion
* windowContentClipping
, bool deep
= false);
29 virtual void MouseDown(BMessage
* message
, BPoint where
);
30 virtual void MouseUp(BMessage
* message
, BPoint where
);
31 virtual void MouseMoved(BMessage
* message
, BPoint where
);
33 void WindowChanged(::Window
* window
);
34 void WindowRemoved(::Window
* window
);
37 void _GetGrid(int32
& columns
, int32
& rows
);
38 BRect
_ScreenFrame(int32 index
);
39 BRect
_WorkspaceAt(int32 index
);
40 BRect
_WorkspaceAt(BPoint where
, int32
& index
);
41 BRect
_WindowFrame(const BRect
& workspaceFrame
,
42 const BRect
& screenFrame
, const BRect
& windowFrame
,
43 BPoint windowPosition
);
45 void _DrawWindow(DrawingEngine
* drawingEngine
,
46 const BRect
& workspaceFrame
, const BRect
& screenFrame
,
47 ::Window
* window
, BPoint windowPosition
,
48 BRegion
& backgroundRegion
, bool workspaceActive
);
49 void _DrawWorkspace(DrawingEngine
* drawingEngine
,
50 BRegion
& redraw
, int32 index
);
52 void _DarkenColor(rgb_color
& color
) const;
53 void _Invalidate() const;
56 ::Window
* fSelectedWindow
;
57 int32 fSelectedWorkspace
;
60 BPoint fLeftTopOffset
;
63 #endif // WORKSPACES_VIEW_H