/*****************************************************************************
* window_manager.hpp
*****************************************************************************
- * Copyright (C) 2003 VideoLAN
+ * Copyright (C) 2003 the VideoLAN team
* $Id$
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
class GenericLayout;
class Anchor;
class Tooltip;
+class Popup;
/// Window manager for skin windows
/// If a new anchoring is detected, the windows will move accordingly.
void move( TopWindow &rWindow, int left, int top ) const;
- /// Raise all the windows, rWindow being above the others
- void raiseAll( TopWindow &rWindow ) const;
+ /// Raise all the registered windows
+ void raiseAll() const;
/// Show all the registered windows
- void showAll() const;
+ void showAll(bool firstTime = false) const;
/// Hide all the registered windows
void hideAll() const;
+ /// Synchronize the windows with their visibility variable
+ void synchVisibility() const;
+
+ /// Raise the given window
+ void raise( TopWindow &rWindow ) const { rWindow.raise(); }
+
/// Show the given window
- void show( TopWindow &rWindow ) { rWindow.show(); }
+ void show( TopWindow &rWindow ) const { rWindow.show(); }
/// Hide the given window
- void hide( TopWindow &rWindow ) { rWindow.hide(); }
+ void hide( TopWindow &rWindow ) const { rWindow.hide(); }
/// Toggle all the windows on top
void toggleOnTop();
/// Change the active layout of the given window
void setActiveLayout( TopWindow &rWindow, GenericLayout &rLayout );
+ /// Mark the given popup as active
+ void setActivePopup( Popup &rPopup ) { m_pPopup = &rPopup; }
+
+ /// Return the active popup, or NULL if none is active
+ Popup * getActivePopup() const { return m_pPopup; }
+
private:
/// Some useful typedefs for lazy people like me
typedef set<TopWindow*> WinSet_t;
typedef list<Anchor*> AncList_t;
- /// This map represents the graph of anchored windows: it associates
- /// to a given window all the windows that are directly anchored by it.
- /// This is not transitive, i.e. if a is in m_dep[b] and if b is in
- /// m_dep[c], it doesn't mean that a is in m_dep[c] (in fact, it
- /// would be extremely rare...)
+ /// Dependencies map
+ /**
+ * This map represents the graph of anchored windows: it associates
+ * to a given window all the windows that are directly anchored by it.
+ * This is not transitive, i.e. if a is in m_dep[b] and if b is in
+ * m_dep[c], it doesn't mean that a is in m_dep[c] (in fact, it
+ * would be extremely rare...)
+ */
map<TopWindow*, WinSet_t> m_dependencies;
/// Store all the windows
WinSet_t m_allWindows;
/// move.
WinSet_t m_movingWindows;
/// Indicate whether the windows are currently on top
- bool m_isOnTop;
+ VariablePtr m_cVarOnTop;
/// Magnetism of the screen edges (= scope of action)
int m_magnet;
/// Alpha value of the static windows
int m_moveAlpha;
/// Tooltip
Tooltip *m_pTooltip;
+ /// Active popup, if any
+ Popup *m_pPopup;
/// Recursively build a set of windows anchored to the one given.
void buildDependSet( WinSet_t &rWinSet, TopWindow *pWindow );
- /// Check anchoring: this function updates xOffset and yOffset,
- /// to take care of a new anchoring (if any)
+ /// Check anchoring
+ /**
+ * This function updates xOffset and yOffset, to take care of a new
+ * anchoring (if any)
+ */
void checkAnchors( TopWindow *pWindow,
int &xOffset, int &yOffset ) const;
};