Back to index

unity  6.0.0
Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes
unity::panel::Controller::Impl Class Reference
Collaboration diagram for unity::panel::Controller::Impl:
Collaboration graph
[legend]

List of all members.

Public Member Functions

void FirstMenuShow ()
void QueueRedraw ()
std::vector< Window > GetTrayXids () const
std::vector< nux::View * > GetPanelViews () const
std::vector< nux::Geometry > GetGeometries () const
void SetOpacity (float opacity)
void SetOpacityMaximizedToggle (bool enabled)
float opacity () const
void SetMenuShowTimings (int fadein, int fadeout, int discovery, int discovery_fadein, int discovery_fadeout)
void OnScreenChanged (unsigned int primary_monitor, std::vector< nux::Geometry > &monitors, Introspectable *iobj)

Static Public Member Functions

 Impl ()

Private Types

typedef nux::ObjectPtr
< nux::BaseWindow > 
BaseWindowPtr

Private Member Functions

unity::PanelViewViewForWindow (BaseWindowPtr const &window) const

Static Private Member Functions

static void WindowConfigureCallback (int window_width, int window_height, nux::Geometry &geo, void *user_data)

Private Attributes

std::vector< BaseWindowPtrwindows_
float opacity_
bool opacity_maximized_toggle_
int menus_fadein_
int menus_fadeout_
int menus_discovery_
int menus_discovery_fadein_
int menus_discovery_fadeout_

Detailed Description

Definition at line 43 of file PanelController.cpp.


Member Typedef Documentation

typedef nux::ObjectPtr<nux::BaseWindow> unity::panel::Controller::Impl::BaseWindowPtr [private]

Definition at line 66 of file PanelController.cpp.


Constructor & Destructor Documentation


Member Function Documentation

Definition at line 131 of file PanelController.cpp.

{
  for (auto window: windows_)
  {
    if (ViewForWindow(window)->FirstMenuShow())
      break;
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

std::vector< nux::Geometry > unity::panel::Controller::Impl::GetGeometries ( ) const

Definition at line 119 of file PanelController.cpp.

{
  std::vector<nux::Geometry> geometries;

  for (auto window : windows_)
  {
    geometries.push_back(window->GetAbsoluteGeometry());
  }

  return geometries;
}

Here is the caller graph for this function:

std::vector< nux::View * > unity::panel::Controller::Impl::GetPanelViews ( ) const

Definition at line 110 of file PanelController.cpp.

{
  std::vector<nux::View*> views;
  views.reserve(windows_.size());
  for (auto window: windows_)
    views.push_back(ViewForWindow(window));
  return views;
}

Here is the caller graph for this function:

std::vector< Window > unity::panel::Controller::Impl::GetTrayXids ( ) const

Definition at line 98 of file PanelController.cpp.

{
  std::vector<Window> xids;

  for (auto window: windows_)
  {
    xids.push_back(ViewForWindow(window)->GetTrayXid());
  }

  return xids;
}

Here is the caller graph for this function:

void unity::panel::Controller::Impl::OnScreenChanged ( unsigned int  primary_monitor,
std::vector< nux::Geometry > &  monitors,
Introspectable iobj 
)

Definition at line 193 of file PanelController.cpp.

{
  std::vector<BaseWindowPtr>::iterator it;
  unsigned n_monitors = monitors.size();
  unsigned int i = 0;

  for (it = windows_.begin(); it != windows_.end(); ++it)
  {
    if (i < n_monitors)
    {
      PanelView* view;

      (*it)->EnableInputWindow(false);
      (*it)->InputWindowEnableStruts(false);

      nux::Geometry geo = monitors[i];
      geo.height = panel::Style::Instance().panel_height;
      (*it)->SetGeometry(geo);
      (*it)->SetMinMaxSize(geo.width, geo.height);

      view = ViewForWindow(*it);
      view->SetPrimary(i == primary_monitor);
      view->SetMonitor(i);

      (*it)->EnableInputWindow(true);
      (*it)->InputWindowEnableStruts(true);

      LOG_DEBUG(logger) << "Updated Panel for Monitor " << i;

      i++;
    }
    else
      break;
  }

  // Add new ones if needed
  if (i < n_monitors)
  {
    for (i = i; i < n_monitors; i++)
    {
      nux::HLayout* layout = new nux::HLayout(NUX_TRACKER_LOCATION);

      PanelView* view = new PanelView();
      view->SetMaximumHeight(panel::Style::Instance().panel_height);
      view->SetOpacity(opacity_);
      view->SetOpacityMaximizedToggle(opacity_maximized_toggle_);
      view->SetMenuShowTimings(menus_fadein_, menus_fadeout_, menus_discovery_,
                               menus_discovery_fadein_, menus_discovery_fadeout_);
      view->SetPrimary(i == primary_monitor);
      view->SetMonitor(i);

      layout->AddView(view, 1);
      layout->SetContentDistribution(nux::eStackLeft);
      layout->SetVerticalExternalMargin(0);
      layout->SetHorizontalExternalMargin(0);

      BaseWindowPtr window(new nux::BaseWindow());
      nux::Geometry geo = monitors[i];
      geo.height = panel::Style::Instance().panel_height;

      window->SetConfigureNotifyCallback(&Impl::WindowConfigureCallback, window.GetPointer());
      window->SetBackgroundColor(nux::Color(0.0f, 0.0f, 0.0f, 0.0f));
      window->ShowWindow(true);
      window->EnableInputWindow(true, panel::window_title, false, false);
      window->InputWindowEnableStruts(true);
      window->SetGeometry(geo);
      window->SetMinMaxSize(geo.width, geo.height);
      window->SetLayout(layout);

      windows_.push_back(window);

      // add to introspectable tree:
      iobj->AddChild(view);

      LOG_DEBUG(logger) << "Added Panel for Monitor " << i;
    }
  }

  if (windows_.size() > n_monitors)
  {
    LOG_DEBUG(logger) << "Removed extra Panels";
    windows_.erase(it, windows_.end());
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 289 of file PanelController.cpp.

{
  return opacity_;
}

Here is the caller graph for this function:

Definition at line 176 of file PanelController.cpp.

{
  for (auto window: windows_)
  {
    window->QueueDraw();
  }
}

Here is the caller graph for this function:

void unity::panel::Controller::Impl::SetMenuShowTimings ( int  fadein,
int  fadeout,
int  discovery,
int  discovery_fadein,
int  discovery_fadeout 
)

Definition at line 160 of file PanelController.cpp.

{
  menus_fadein_ = fadein;
  menus_fadeout_ = fadeout;
  menus_discovery_ = discovery;
  menus_discovery_fadein_ = discovery_fadein;
  menus_discovery_fadeout_ = discovery_fadeout;

  for (auto window: windows_)
  {
    ViewForWindow(window)->SetMenuShowTimings(fadein, fadeout, discovery,
                                              discovery_fadein, discovery_fadeout);
  }
}

Here is the caller graph for this function:

Definition at line 140 of file PanelController.cpp.

{
  opacity_ = opacity;

  for (auto window: windows_)
  {
    ViewForWindow(window)->SetOpacity(opacity_);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 150 of file PanelController.cpp.

Here is the caller graph for this function:

Definition at line 184 of file PanelController.cpp.

{
  nux::Layout* layout = window->GetLayout();
  auto it = layout->GetChildren().begin();

  return static_cast<PanelView*>(*it);
}
void unity::panel::Controller::Impl::WindowConfigureCallback ( int  window_width,
int  window_height,
nux::Geometry &  geo,
void *  user_data 
) [static, private]

Definition at line 280 of file PanelController.cpp.

{
  nux::BaseWindow* window = static_cast<nux::BaseWindow*>(user_data);
  geo = window->GetGeometry();
}

Here is the caller graph for this function:


Member Data Documentation

Definition at line 81 of file PanelController.cpp.

Definition at line 82 of file PanelController.cpp.

Definition at line 83 of file PanelController.cpp.

Definition at line 79 of file PanelController.cpp.

Definition at line 80 of file PanelController.cpp.

Definition at line 77 of file PanelController.cpp.

Definition at line 78 of file PanelController.cpp.

Definition at line 76 of file PanelController.cpp.


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