1
// Workspace.hh for Fluxbox
2
// Copyright (c) 2002 - 2005 Henrik Kinnunen (fluxgen at fluxbox dot org)
4
// Workspace.hh for Blackbox - an X11 Window manager
5
// Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net)
7
// Permission is hereby granted, free of charge, to any person obtaining a
8
// copy of this software and associated documentation files (the "Software"),
9
// to deal in the Software without restriction, including without limitation
10
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
11
// and/or sell copies of the Software, and to permit persons to whom the
12
// Software is furnished to do so, subject to the following conditions:
14
// The above copyright notice and this permission notice shall be included in
15
// all copies or substantial portions of the Software.
17
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23
// DEALINGS IN THE SOFTWARE.
32
#include "FbTk/MultLayers.hh"
33
#include "FbTk/Observer.hh"
34
#include "FbTk/NotCopyable.hh"
45
Handles a single workspace
47
class Workspace:private FbTk::NotCopyable, private FbTk::Observer {
49
typedef std::vector<FluxboxWindow *> Windows;
51
Workspace(BScreen &screen, FbTk::MultLayers &layermanager, const std::string &name,
52
unsigned int workspaceid = 0);
55
void setLastFocusedWindow(FluxboxWindow *w);
57
/// Set workspace name
58
void setName(const std::string &name);
60
void hideAll(bool interrupt_moving);
64
void addWindow(FluxboxWindow &win, bool place = false);
65
int removeWindow(FluxboxWindow *win, bool still_alive);
66
void updateClientmenu();
68
BScreen &screen() { return m_screen; }
69
const BScreen &screen() const { return m_screen; }
71
FluxboxWindow *lastFocusedWindow() { return m_lastfocus; }
72
const FluxboxWindow *lastFocusedWindow() const { return m_lastfocus; }
74
inline FbTk::Menu &menu() { return m_clientmenu; }
75
inline const FbTk::Menu &menu() const { return m_clientmenu; }
76
/// name of this workspace
77
inline const std::string &name() const { return m_name; }
79
@return the number of this workspace, note: obsolete, should be in BScreen
81
inline unsigned int workspaceID() const { return m_id; }
83
const Windows &windowList() const { return m_windowlist; }
84
Windows &windowList() { return m_windowlist; }
86
int numberOfWindows() const;
87
bool checkGrouping(FluxboxWindow &win);
89
static bool loadGroups(const std::string &filename);
92
void update(FbTk::Subject *subj);
93
void placeWindow(FluxboxWindow &win);
96
FluxboxWindow *m_lastfocus;
99
typedef std::vector<std::string> Group;
100
typedef std::vector<Group> GroupList;
102
static GroupList m_groups; ///< handle auto groupings
104
FbTk::MultLayers &m_layermanager;
105
Windows m_windowlist;
107
std::string m_name; ///< name of this workspace
108
unsigned int m_id; ///< id, obsolete, this should be in BScreen
109
int *m_cascade_x; ///< need a cascade for each head (Xinerama)
110
int *m_cascade_y; ///< need a cascade for each head (Xinerama)
114
#endif // WORKSPACE_HH