usb_ecm: Use the current configuration instead of a fixed one.
[haiku.git] / src / servers / app / WorkspacesView.h
blob179e6cb67304fdf61f0dbed3f50b099e5fb81dab
1 /*
2 * Copyright 2005-2008, Haiku Inc.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Axel Dörfler, axeld@pinc-software.de
7 */
8 #ifndef WORKSPACES_VIEW_H
9 #define WORKSPACES_VIEW_H
12 #include "View.h"
15 class WorkspacesView : public View {
16 public:
17 WorkspacesView(BRect frame, BPoint scrollingOffset,
18 const char* name, int32 token, uint32 resize,
19 uint32 flags);
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);
36 private:
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;
55 private:
56 ::Window* fSelectedWindow;
57 int32 fSelectedWorkspace;
58 bool fHasMoved;
59 BPoint fClickPoint;
60 BPoint fLeftTopOffset;
63 #endif // WORKSPACES_VIEW_H