Back to index

unity  6.0.0
Public Member Functions | Private Attributes
MultiActionList Class Reference

#include <PluginAdapter.h>

Collaboration diagram for MultiActionList:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 MultiActionList (int n)
void InitiateAll (CompOption::Vector &extraArgs, int state)
void TerminateAll (CompOption::Vector &extraArgs)
void AddNewAction (CompAction *, bool primary)
void RemoveAction (CompAction *)

Private Attributes

std::list< CompAction * > m_ActionList
CompAction * _primary_action

Detailed Description

Definition at line 40 of file PluginAdapter.h.


Constructor & Destructor Documentation

MultiActionList::MultiActionList ( int  n) [inline]

Definition at line 44 of file PluginAdapter.h.

                         :
    m_ActionList(n),
    _primary_action(NULL) {};

Member Function Documentation

void MultiActionList::AddNewAction ( CompAction *  a,
bool  primary 
)

Definition at line 226 of file PluginAdapterCompiz.cpp.

{
  if (std::find(m_ActionList.begin(), m_ActionList.end(), a)  == m_ActionList.end())
    m_ActionList.push_back(a);

  if (primary)
    _primary_action = a;
}

Here is the caller graph for this function:

void MultiActionList::InitiateAll ( CompOption::Vector &  extraArgs,
int  state 
)

Definition at line 242 of file PluginAdapterCompiz.cpp.

{
  CompOption::Vector argument;
  if (!m_ActionList.size())
    return;

  argument.resize(1);
  argument[0].setName("root", CompOption::TypeInt);
  argument[0].value().set((int) screen->root());
  foreach(CompOption & arg, extraArgs)
  {
    argument.push_back(arg);
  }

  CompAction* a;

  if (_primary_action)
    a = _primary_action;
  else
    a = m_ActionList.front();

  /* Initiate the first available action with the arguments */
  a->initiate()(a, state, argument);
}

Here is the caller graph for this function:

void MultiActionList::RemoveAction ( CompAction *  a)

Definition at line 236 of file PluginAdapterCompiz.cpp.

{
  m_ActionList.remove(a);
}
void MultiActionList::TerminateAll ( CompOption::Vector &  extraArgs)

Definition at line 268 of file PluginAdapterCompiz.cpp.

{
  CompOption::Vector argument;
  CompOption::Value  value;
  if (!m_ActionList.size())
    return;

  argument.resize(1);
  argument[0].setName("root", CompOption::TypeInt);
  argument[0].value().set((int) screen->root());

  foreach(CompOption & a, extraArgs)
  argument.push_back(a);

  if (_primary_action)
  {
    _primary_action->terminate()(_primary_action, 0, argument);
    return;
  }

  foreach(CompAction * action, m_ActionList)
  {
    if (action->state() & (CompAction::StateTermKey |
                           CompAction::StateTermButton |
                           CompAction::StateTermEdge |
                           CompAction::StateTermEdgeDnd))
    {
      action->terminate()(action, 0, argument);
    }
  }
}

Here is the caller graph for this function:


Member Data Documentation

CompAction* MultiActionList::_primary_action [private]

Definition at line 56 of file PluginAdapter.h.

std::list<CompAction*> MultiActionList::m_ActionList [private]

Definition at line 55 of file PluginAdapter.h.


The documentation for this class was generated from the following files: