2005-11-29 02:36:59 +03:00
|
|
|
/*
|
|
|
|
* Copyright 2005, Haiku.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*
|
|
|
|
* Authors:
|
|
|
|
* Axel Dörfler, axeld@pinc-software.de
|
|
|
|
*/
|
|
|
|
#ifndef WORKSPACE_H
|
|
|
|
#define WORKSPACE_H
|
|
|
|
|
2004-01-12 01:12:55 +03:00
|
|
|
|
|
|
|
#include "RGBColor.h"
|
|
|
|
|
2005-11-29 02:36:59 +03:00
|
|
|
#include <ObjectList.h>
|
|
|
|
#include <String.h>
|
|
|
|
|
|
|
|
|
|
|
|
class RootLayer;
|
2005-11-24 20:45:26 +03:00
|
|
|
class WindowLayer;
|
2004-01-12 01:12:55 +03:00
|
|
|
|
2005-11-29 02:36:59 +03:00
|
|
|
|
|
|
|
struct display_info {
|
|
|
|
BString identifier;
|
|
|
|
BPoint origin;
|
|
|
|
display_mode mode;
|
2004-01-12 01:12:55 +03:00
|
|
|
};
|
|
|
|
|
2005-11-30 14:19:20 +03:00
|
|
|
struct window_layer_info {
|
|
|
|
BPoint position;
|
|
|
|
WindowLayer* window;
|
|
|
|
};
|
|
|
|
|
2005-07-07 00:19:22 +04:00
|
|
|
class Workspace {
|
|
|
|
public:
|
2005-11-29 02:36:59 +03:00
|
|
|
Workspace();
|
|
|
|
~Workspace();
|
|
|
|
|
2005-11-30 18:47:01 +03:00
|
|
|
bool AddWindow(WindowLayer* window, BPoint* point = NULL);
|
2005-11-29 02:36:59 +03:00
|
|
|
void RemoveWindow(WindowLayer* window);
|
2005-11-30 18:47:01 +03:00
|
|
|
void RemoveWindowAt(int32 index);
|
2005-02-28 23:23:51 +03:00
|
|
|
|
2005-11-29 02:36:59 +03:00
|
|
|
int32 CountWindows() const { return fWindows.CountItems(); }
|
2005-11-30 14:19:20 +03:00
|
|
|
window_layer_info* WindowAt(int32 index) const { return fWindows.ItemAt(index); }
|
2005-02-28 23:23:51 +03:00
|
|
|
|
2005-11-29 02:36:59 +03:00
|
|
|
// displays
|
2005-07-07 00:19:22 +04:00
|
|
|
|
2005-11-29 02:36:59 +03:00
|
|
|
void SetDisplaysFromDesktop(Desktop* desktop);
|
|
|
|
|
|
|
|
int32 CountDisplays() const { return fDisplays.CountItems(); }
|
|
|
|
const display_info* DisplayAt(int32 index) const { return fDisplays.ItemAt(index); }
|
|
|
|
|
|
|
|
// configuration
|
|
|
|
|
|
|
|
const RGBColor& Color() const { return fColor; }
|
|
|
|
void SetColor(const RGBColor& color);
|
|
|
|
|
|
|
|
void SetSettings(BMessage& settings);
|
|
|
|
void GetSettings(BMessage& settings);
|
|
|
|
|
|
|
|
private:
|
|
|
|
void _SetDefaults();
|
2005-07-07 00:19:22 +04:00
|
|
|
|
2005-11-30 14:19:20 +03:00
|
|
|
BObjectList<window_layer_info> fWindows;
|
2005-11-29 02:36:59 +03:00
|
|
|
WindowLayer* fFront;
|
|
|
|
WindowLayer* fFocus;
|
2005-07-07 00:19:22 +04:00
|
|
|
|
2005-11-29 02:36:59 +03:00
|
|
|
BObjectList<display_info> fDisplays;
|
2005-07-07 00:19:22 +04:00
|
|
|
|
2005-11-29 02:36:59 +03:00
|
|
|
RGBColor fColor;
|
2004-01-12 01:12:55 +03:00
|
|
|
};
|
|
|
|
|
2005-11-30 14:19:20 +03:00
|
|
|
extern const BPoint kInvalidWindowPosition;
|
|
|
|
|
2005-11-29 02:36:59 +03:00
|
|
|
#endif /* WORKSPACE_H */
|