1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
13 #include "otk/property.hh"
21 typedef std::list<BlackboxWindow*> BlackboxWindowList;
22 typedef std::vector<Window> StackVector;
27 BlackboxWindow *lastfocus;
28 otk::OBProperty *xatom;
30 BlackboxWindowList stackingList, windowList;
34 unsigned int cascade_x, cascade_y;
36 unsigned int cascade_region;
39 Workspace(const Workspace&);
40 Workspace& operator=(const Workspace&);
42 void raiseTransients(const BlackboxWindow * const win,
43 StackVector::iterator &stack);
44 void lowerTransients(const BlackboxWindow * const win,
45 StackVector::iterator &stack);
47 typedef std::vector<otk::Rect> rectList;
48 rectList calcSpace(const otk::Rect &win, const rectList &spaces) const;
50 void placeWindow(BlackboxWindow *win);
51 bool cascadePlacement(otk::Rect& win, const int offset);
52 bool smartPlacement(otk::Rect& win);
53 bool underMousePlacement(otk::Rect& win);
56 Workspace(BScreen *scrn, unsigned int i = 0);
58 inline BScreen *getScreen(void) { return screen; }
60 inline BlackboxWindow *getLastFocusedWindow(void) { return lastfocus; }
62 inline const std::string& getName(void) const { return name; }
64 inline unsigned int getID(void) const { return id; }
66 inline void setLastFocusedWindow(BlackboxWindow *w) { lastfocus = w; }
68 inline const BlackboxWindowList& getStackingList() const
69 { return stackingList; }
71 BlackboxWindow* getWindow(unsigned int index);
72 BlackboxWindow* getNextWindowInList(BlackboxWindow *w);
73 BlackboxWindow* getPrevWindowInList(BlackboxWindow *w);
74 BlackboxWindow* getTopWindowOnStack(void) const;
75 void focusFallback(const BlackboxWindow *old_window);
77 bool isCurrent(void) const;
78 bool isLastWindow(const BlackboxWindow* w) const;
80 void addWindow(BlackboxWindow *w, bool place = False, bool sticky = False);
81 void removeWindow(BlackboxWindow *w, bool sticky = False);
82 unsigned int getCount(void) const;
83 void appendStackOrder(BlackboxWindowList &stack_order) const;
88 void raiseWindow(BlackboxWindow *w);
89 void lowerWindow(BlackboxWindow *w);
90 void reconfigure(void);
91 void setCurrent(void);
93 void setName(const std::string& new_name);
98 #endif // __Workspace_hh