Container< P, LT, LTI, T > Class Template Reference

#include <container.h>

Inherited by Frame, and Monitor.

Inheritance diagram for Container< P, LT, LTI, T >:

Inheritance graph
[legend]
Collaboration diagram for Container< P, LT, LTI, T >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Container (P *parent, T *child=0)
 ~Container ()
bool contains (T *child)
unsigned int size ()
LTI begin ()
LTI end ()
P * attached () const
void setAttached (P *parent)
T * focused () const
void focus (T *child)
void attach (T *child)
T * detach (T *child)
T * prev ()
T * next ()
LT * childs ()

Private Attributes

P * parent_
T * child_
LT childs_

Detailed Description

template<class P, class LT, class LTI, class T>
class Container< P, LT, LTI, T >

A Container object keeps a parent reference and may contain a list of child objects.

A Container is a class template that creates an object that contains a list of other objects and also keeps a reference to a parent object. A container can be configured with for stacked tabbing at compile time.

Parameters:
P the parent class
LT the child list class
LTI the iterator class for the child list
T the child class

Definition at line 26 of file container.h.


Constructor & Destructor Documentation

template<class P, class LT, class LTI, class T>
Container< P, LT, LTI, T >::Container ( P *  parent,
T *  child = 0 
) [inline]

Constructs a container with a parent and a focused child.

Parameters:
parent the original parent.
child the original focused child which is optional.

Definition at line 36 of file container.h.

template<class P, class LT, class LTI, class T>
Container< P, LT, LTI, T >::~Container (  )  [inline]

The destructor.

When the destructor is destoryed it will also destroys all of the children in the container.

Definition at line 47 of file container.h.


Member Function Documentation

template<class P, class LT, class LTI, class T>
bool Container< P, LT, LTI, T >::contains ( T *  child  )  [inline]

Checks if the child is contained in this container.

Parameters:
child the child to search for.

Definition at line 57 of file container.h.

Referenced by Container< Display, list< Workspace * >, LWorkspace::iterator, Workspace >::attach(), and Monitor::attachClient().

template<class P, class LT, class LTI, class T>
unsigned int Container< P, LT, LTI, T >::size (  )  [inline]

Get the number of children in this container.

Returns:
the the number of children

Definition at line 66 of file container.h.

Referenced by Monitor::attachAllClients(), Monitor::createNewWorkspace(), Workspace::destroyFrame(), Monitor::destroyWorkspace(), Frame::detach(), Monitor::detachAllClients(), Validators::existClients(), Validators::existClientsWithinFrame(), Validators::existDetachedClients(), Validators::existFrames(), Validators::existsDetachedClient(), Validators::existWorkspaces(), Frame::handleButtonPress(), Frame::illuminate(), ClientBar::invokeClickedThing(), Validators::isEmptyWorkspaceFocused(), Item::Item(), Workspace::joinFrame(), Workspace::newFrame(), Frame::resize(), Monitor::serialize(), Workspace::splitFrame(), Monitor::toggleAllClientStates(), ClientBar::updateClientPager(), Menu::updateItemTree(), ClientBar::updateModeButton(), Validators::validateDestroyFrame(), Validators::validateToggleMode(), and Frame::zoomClient().

template<class P, class LT, class LTI, class T>
LTI Container< P, LT, LTI, T >::begin (  )  [inline]

Get the list iterator to the first child.

Returns:
the list iterator to first child.

Definition at line 75 of file container.h.

Referenced by Monitor::attachAllClients(), Workspace::attachClient(), Monitor::attachClientByName(), Kernel::barWindow(), Kernel::boxWindow(), Kernel::cleanup(), Kernel::clientForWindow(), Workspace::destroyFrame(), Monitor::detachAllClients(), Workspace::focus(), Monitor::focusWorkspaceNum(), Workspace::frameForPoint(), Kernel::grabShortcutOnAllMonitors(), Frame::handleButtonPress(), Workspace::hide(), Workspace::illuminate(), Frame::illuminate(), Kernel::initKeys(), Kernel::initWindows(), ClientBar::invokeClickedThing(), Kernel::isRootWindow(), Kernel::menuWindow(), Binder::queryDetachedClientsForPattern(), Binder::queryFramesForPattern(), Binder::queryMonitorsForPattern(), Binder::queryWorkspacesForPattern(), Frame::resize(), Kernel::selectMonitor(), Monitor::serialize(), Kernel::serialize(), Workspace::show(), Workspace::thingWindow(), Monitor::thingWindow(), Kernel::thingWindow(), Workspace::toggleBars(), Workspace::toggleBorders(), Workspace::toggleMode(), Kernel::ungrabShortcutOnAllMonitors(), Kernel::updateBars(), ClientBar::updateClientPager(), Menu::updateItemTree(), Validators::validateSelectClient(), Monitor::workspaceForName(), and Frame::zoomClient().

template<class P, class LT, class LTI, class T>
LTI Container< P, LT, LTI, T >::end (  )  [inline]

Get the list iterator to end of child list.

Returns:
the list iterator to the last child.

Definition at line 84 of file container.h.

Referenced by Workspace::attachClient(), Monitor::attachClientByName(), Kernel::barWindow(), Kernel::boxWindow(), StatusBar::calculateWorkspaceWidth(), Kernel::cleanup(), Kernel::clientForWindow(), Workspace::detachClient(), Workspace::focus(), Monitor::focusWorkspaceNum(), Workspace::frameForPoint(), Kernel::grabShortcutOnAllMonitors(), Frame::handleButtonPress(), Workspace::hide(), Workspace::illuminate(), Frame::illuminate(), Kernel::initKeys(), Kernel::initWindows(), ClientBar::invokeClickedThing(), Kernel::isRootWindow(), Kernel::menuWindow(), Binder::queryDetachedClientsForPattern(), Binder::queryFramesForPattern(), Binder::queryMonitorsForPattern(), Binder::queryWorkspacesForPattern(), Frame::resize(), Kernel::selectMonitor(), Monitor::serialize(), Kernel::serialize(), Workspace::show(), Workspace::thingWindow(), Monitor::thingWindow(), Kernel::thingWindow(), Workspace::toggleBars(), Workspace::toggleBorders(), Workspace::toggleMode(), Kernel::ungrabShortcutOnAllMonitors(), Kernel::updateBars(), ClientBar::updateClientPager(), Menu::updateItemTree(), StatusBar::updateWorkspacePager(), Validators::validateSelectClient(), and Monitor::workspaceForName().

template<class P, class LT, class LTI, class T>
P* Container< P, LT, LTI, T >::attached (  )  const [inline]

Get the parent that the container is attached to.

Returns:
the parent.

Definition at line 93 of file container.h.

Referenced by Frame::cursorForXY(), Frame::handleButtonPress(), Frame::handleButtonRelease(), Monitor::initDisplayString(), Frame::isFocused(), Monitor::Monitor(), and Frame::zoomClient().

template<class P, class LT, class LTI, class T>
void Container< P, LT, LTI, T >::setAttached ( P *  parent  )  [inline]

Attach the container to a new parent.

Parameters:
parent the parent.

Definition at line 102 of file container.h.

template<class P, class LT, class LTI, class T>
T* Container< P, LT, LTI, T >::focused (  )  const [inline]

Get the currently focused child in the container.

Returns:
the focused child, if any.

Definition at line 111 of file container.h.

Referenced by Monitor::attachClient(), Monitor::attachLastClient(), StatusBar::calculateWorkspaceWidth(), Monitor::createNewWorkspace(), Actions::cycleClientNext(), Actions::cycleClientPrev(), Actions::destroyFrame(), Monitor::destroyWorkspace(), Actions::destroyWorkspace(), Monitor::detachAllClients(), Monitor::detachClient(), Binder::emulateKeyPress(), Validators::existClients(), Validators::existClientsWithinFrame(), Validators::existFrames(), Validators::existsFrameDown(), Validators::existsFrameLeft(), Validators::existsFrameRight(), Validators::existsFrameUp(), Actions::fitClient(), Monitor::focus(), Monitor::focusedClient(), Kernel::focusedClient(), Workspace::focusedFrame(), Kernel::focusedMonitor(), Actions::growDown(), Actions::growLeft(), Actions::growRight(), Actions::growUp(), Frame::handleButtonPress(), ClientBar::handleButtonPress(), Frame::handleButtonRelease(), ClientBar::handleButtonRelease(), Kernel::handleMotionNotify(), Actions::hideBars(), Actions::hideBorders(), Monitor::hookClient(), Frame::illuminate(), ClientBar::invokeClickedThing(), Validators::isClientFocused(), Validators::isClientFrameFocused(), Validators::isEmptyWorkspaceFocused(), Validators::isFloatingClientFocused(), Frame::isFocused(), Client::isFocused(), Validators::isFrameFocused(), Validators::isFrameOrClientFrameFocused(), Validators::isWorkspaceFocused(), Item::Item(), Workspace::joinFrame(), Actions::joinFrameDown(), Actions::joinFrameLeft(), Actions::joinFrameRight(), Actions::joinFrameUp(), Actions::lower(), Actions::moveClientDown(), Actions::moveClientLeft(), Actions::moveClientRight(), Actions::moveClientUp(), Actions::raise(), Monitor::removeClient(), Actions::renameWorkspace(), Workspace::selectFrame(), Actions::selectFrameDown(), Actions::selectFrameLeft(), Actions::selectFrameRight(), Actions::selectFrameUp(), Kernel::selectMonitor(), Workspace::sendClient(), Actions::sendClientDown(), Actions::sendClientLeft(), Actions::sendClientRight(), Actions::sendClientUp(), Monitor::serialize(), Actions::showBars(), Actions::showBorders(), Actions::shrinkDown(), Actions::shrinkLeft(), Actions::shrinkRight(), Actions::shrinkUp(), Workspace::splitFrame(), Actions::splitFrameDown(), Actions::splitFrameLeft(), Actions::splitFrameRight(), Actions::splitFrameUp(), Workspace::swapClient(), Actions::swapClientDown(), Actions::swapClientLeft(), Actions::swapClientRight(), Actions::swapClientUp(), Actions::swapFrameDown(), Actions::swapFrameLeft(), Actions::swapFrameRight(), Actions::swapFrameUp(), Monitor::toggleAllClientStates(), Actions::toggleBar(), Actions::toggleBorder(), Monitor::toggleClientBar(), Actions::toggleClientMode(), Actions::toggleClientSticky(), Workspace::toggleMode(), Actions::toggleMode(), Monitor::toggleStatusBar(), Monitor::toggleThingMaximization(), Actions::toggleTiled(), Monitor::unhookClient(), ClientBar::updateClientInfo(), ClientBar::updateClientPager(), ClientBar::updateModeButton(), StatusBar::updateWorkspacePager(), Validators::validateDestroyFrame(), Validators::validateHookClient(), Validators::validateToggleMode(), Validators::validateUnhookClient(), Frame::zoomClient(), and Actions::zoomClient().

template<class P, class LT, class LTI, class T>
void Container< P, LT, LTI, T >::focus ( T *  child  )  [inline]

Gives a child focus.

In normal mode the child simply receives focus. In stacked tabbing mode the currently focused child will be placed at the end of the list and the newly focused child will be placed at the front.

Parameters:
child the child to receive focus.

Definition at line 125 of file container.h.

Referenced by Container< Display, list< Workspace * >, LWorkspace::iterator, Workspace >::attach(), Kernel::barWindow(), Kernel::clientForWindow(), Container< Display, list< Workspace * >, LWorkspace::iterator, Workspace >::detach(), Workspace::focus(), Frame::focus(), Kernel::isRootWindow(), Kernel::menuWindow(), Kernel::selectMonitor(), and Kernel::thingWindow().

template<class P, class LT, class LTI, class T>
void Container< P, LT, LTI, T >::attach ( T *  child  )  [inline]

Attaches a child to the container.

This attaches a new child to the container. When a child is attached it receives focus. attach() will not add a duplicate child to the container.

Parameters:
child the child to attach.

Definition at line 149 of file container.h.

Referenced by Frame::attach(), Workspace::attachClient(), Monitor::attachClient(), Workspace::attachFrame(), Monitor::createNewWorkspace(), Monitor::detachClient(), Kernel::initMonitors(), Monitor::initWorkspaces(), and Workspace::show().

template<class P, class LT, class LTI, class T>
T* Container< P, LT, LTI, T >::detach ( T *  child  )  [inline]

Detach a child from the container.

Detaches the child from the container. If the child being detached currently has focus then the focus will switch to the previous child. If this was the last child left in the container than there will be no child with focus.

Parameters:
child the child to detach.
Returns:
the current child with focus.

Definition at line 167 of file container.h.

Referenced by Monitor::attachAllClients(), Monitor::attachClient(), Monitor::attachClientByName(), Monitor::attachDetachedClient(), Monitor::attachLastClient(), Workspace::destroyFrame(), Monitor::destroyWorkspace(), Frame::detach(), Workspace::detachClient(), Workspace::hide(), and Monitor::removeClient().

template<class P, class LT, class LTI, class T>
T* Container< P, LT, LTI, T >::prev (  )  [inline]

Get the previous child in the list.

In stacked tabbing mode this is the last child. In regular mode this is the child before the currently focused child.

Returns:
the previous child.

Definition at line 189 of file container.h.

Referenced by Workspace::cycleClientPrev(), Actions::cycleWorkspacePrev(), and Container< Display, list< Workspace * >, LWorkspace::iterator, Workspace >::detach().

template<class P, class LT, class LTI, class T>
T* Container< P, LT, LTI, T >::next (  )  [inline]

Get the next child in the list.

In stacked tabbing mode this is the second child in the list. In regular mode it is the child after the currently focused child.

Returns:
the next child.

Definition at line 228 of file container.h.

Referenced by Workspace::cycleClientNext(), Actions::cycleWorkspaceNext(), Frame::detach(), and Frame::zoomClient().

template<class P, class LT, class LTI, class T>
LT* Container< P, LT, LTI, T >::childs (  )  [inline]

Used for direct manipulation, use with care!

Definition at line 260 of file container.h.

Referenced by Frame::attach(), and Frame::zoomClient().


Member Data Documentation

template<class P, class LT, class LTI, class T>
P* Container< P, LT, LTI, T >::parent_ [private]

Definition at line 267 of file container.h.

Referenced by Container< Display, list< Workspace * >, LWorkspace::iterator, Workspace >::attached(), Container< Display, list< Workspace * >, LWorkspace::iterator, Workspace >::Container(), and Container< Display, list< Workspace * >, LWorkspace::iterator, Workspace >::setAttached().

template<class P, class LT, class LTI, class T>
T* Container< P, LT, LTI, T >::child_ [private]

Definition at line 268 of file container.h.

Referenced by Container< Display, list< Workspace * >, LWorkspace::iterator, Workspace >::Container(), Container< Display, list< Workspace * >, LWorkspace::iterator, Workspace >::detach(), Container< Display, list< Workspace * >, LWorkspace::iterator, Workspace >::focus(), Container< Display, list< Workspace * >, LWorkspace::iterator, Workspace >::focused(), Container< Display, list< Workspace * >, LWorkspace::iterator, Workspace >::next(), and Container< Display, list< Workspace * >, LWorkspace::iterator, Workspace >::prev().

template<class P, class LT, class LTI, class T>
LT Container< P, LT, LTI, T >::childs_ [private]

Definition at line 269 of file container.h.

Referenced by Container< Display, list< Workspace * >, LWorkspace::iterator, Workspace >::attach(), Container< Display, list< Workspace * >, LWorkspace::iterator, Workspace >::begin(), Container< Display, list< Workspace * >, LWorkspace::iterator, Workspace >::childs(), Container< Display, list< Workspace * >, LWorkspace::iterator, Workspace >::contains(), Container< Display, list< Workspace * >, LWorkspace::iterator, Workspace >::detach(), Container< Display, list< Workspace * >, LWorkspace::iterator, Workspace >::end(), Container< Display, list< Workspace * >, LWorkspace::iterator, Workspace >::focus(), Container< Display, list< Workspace * >, LWorkspace::iterator, Workspace >::next(), Container< Display, list< Workspace * >, LWorkspace::iterator, Workspace >::prev(), Container< Display, list< Workspace * >, LWorkspace::iterator, Workspace >::size(), and Container< Display, list< Workspace * >, LWorkspace::iterator, Workspace >::~Container().


The documentation for this class was generated from the following file:
Generated on Thu May 24 15:20:03 2007 for ncwm by  doxygen 1.5.1