Back to index

unity  6.0.0
Public Types | Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes
unity::PanelView Class Reference

#include <PanelView.h>

Inheritance diagram for unity::PanelView:
Inheritance graph
[legend]
Collaboration diagram for unity::PanelView:
Collaboration graph
[legend]

List of all members.

Public Types

typedef std::list
< Introspectable * > 
IntrospectableList

Public Member Functions

 PanelView (NUX_FILE_LINE_PROTO)
 ~PanelView ()
void SetPrimary (bool primary)
bool GetPrimary () const
void SetMonitor (int monitor)
int GetMonitor () const
bool IsActive () const
bool FirstMenuShow () const
void SetOpacity (float opacity)
void SetOpacityMaximizedToggle (bool enabled)
void SetMenuShowTimings (int fadein, int fadeout, int discovery, int discovery_fadein, int discovery_fadeout)
Window GetTrayXid () const
GVariant * Introspect ()
void AddChild (Introspectable *child)
void RemoveChild (Introspectable *child)
virtual IntrospectableList GetIntrospectableChildren ()
guint64 GetIntrospectionId () const

Protected Member Functions

void Draw (nux::GraphicsEngine &GfxContext, bool force_draw)
void DrawContent (nux::GraphicsEngine &GfxContext, bool force_draw)
std::string GetName () const
void AddProperties (GVariantBuilder *builder)
void OnObjectAdded (indicator::Indicator::Ptr const &proxy)
void OnObjectRemoved (indicator::Indicator::Ptr const &proxy)
void OnIndicatorViewUpdated (PanelIndicatorEntryView *view)
void OnMenuPointerMoved (int x, int y)
void OnEntryActivateRequest (std::string const &entry_id)
void OnEntryActivated (std::string const &entry_id, nux::Rect const &geo)
void OnEntryShowMenu (std::string const &entry_id, unsigned int xid, int x, int y, unsigned int button, unsigned int timestamp)
virtual std::string GetChildsName () const
 Please don't override this unless you really need to. The only valid reason is if you have a property that simply must be called 'Children'.

Private Types

typedef std::unique_ptr
< nux::AbstractPaintLayer > 
PaintLayerPtr

Private Member Functions

 NUX_DECLARE_OBJECT_TYPE (PanelView, nux::View)
void OnBackgroundUpdate (GVariant *data)
void OnOverlayShown (GVariant *data)
void OnOverlayHidden (GVariant *data)
void UpdateBackground ()
void ForceUpdateBackground ()
bool TrackMenuPointer ()
void SyncGeometries ()
void AddPanelView (PanelIndicatorsView *child, unsigned int stretchFactor)

Private Attributes

indicator::DBusIndicators::Ptr _remote
PanelMenuView_menu_view
PanelTray_tray
PanelIndicatorsView_indicators
PaintLayerPtr _bg_layer
PaintLayerPtr _bg_darken_layer
nux::ObjectPtr< nux::BaseTexture > _panel_sheen
nux::HLayout * _layout
nux::Geometry _last_geo
nux::Color _bg_color
bool _is_dirty
bool _opacity_maximized_toggle
bool _needs_geo_sync
bool _is_primary
bool _overlay_is_open
float _opacity
int _monitor
std::string _active_overlay
nux::Point _tracked_pointer_pos
std::vector< sigc::connection > _on_indicator_updated_connections
std::vector< sigc::connection > _maximized_opacity_toggle_connections
BackgroundEffectHelper _bg_effect_helper
nux::ObjectPtr
< nux::IOpenGLBaseTexture > 
_bg_blur_texture
UBusManager _ubus_manager
glib::Source::UniquePtr _track_menu_pointer_timeout

Detailed Description

Definition at line 44 of file PanelView.h.


Member Typedef Documentation

Definition at line 34 of file Introspectable.h.

typedef std::unique_ptr<nux::AbstractPaintLayer> unity::PanelView::PaintLayerPtr [private]

Definition at line 102 of file PanelView.h.


Constructor & Destructor Documentation

unity::PanelView::PanelView ( NUX_FILE_LINE_PROTO  )

Definition at line 55 of file PanelView.cpp.

  : View(NUX_FILE_LINE_PARAM)
  , _is_dirty(true)
  , _opacity_maximized_toggle(false)
  , _needs_geo_sync(false)
  , _is_primary(false)
  , _overlay_is_open(false)
  , _opacity(1.0f)
  , _monitor(0)
{
  panel::Style::Instance().changed.connect(sigc::mem_fun(this, &PanelView::ForceUpdateBackground));

  _bg_layer.reset(new nux::ColorLayer(nux::Color(0xff595853), true));

  nux::ROPConfig rop;
  rop.Blend = true;
  rop.SrcBlend = GL_ZERO;
  rop.DstBlend = GL_SRC_COLOR;

  _bg_darken_layer.reset(new nux::ColorLayer(nux::Color(0.9f, 0.9f, 0.9f, 1.0f), false, rop));

  _layout = new nux::HLayout("", NUX_TRACKER_LOCATION);
  _layout->SetContentDistribution(nux::eStackLeft);

  _menu_view = new PanelMenuView();
  AddPanelView(_menu_view, 1);

  SetCompositionLayout(_layout);

  _tray = new PanelTray();
  _layout->AddView(_tray, 0, nux::eCenter, nux::eFull);
  AddChild(_tray);

  _indicators = new PanelIndicatorsView();
  AddPanelView(_indicators, 0);

  _remote = indicator::DBusIndicators::Ptr(new indicator::DBusIndicators());
  _remote->on_object_added.connect(sigc::mem_fun(this, &PanelView::OnObjectAdded));
  _remote->on_object_removed.connect(sigc::mem_fun(this, &PanelView::OnObjectRemoved));
  _remote->on_entry_activate_request.connect(sigc::mem_fun(this, &PanelView::OnEntryActivateRequest));
  _remote->on_entry_activated.connect(sigc::mem_fun(this, &PanelView::OnEntryActivated));
  _remote->on_entry_show_menu.connect(sigc::mem_fun(this, &PanelView::OnEntryShowMenu));

  _ubus_manager.RegisterInterest(UBUS_BACKGROUND_COLOR_CHANGED, sigc::mem_fun(this, &PanelView::OnBackgroundUpdate));
  _ubus_manager.RegisterInterest(UBUS_OVERLAY_HIDDEN, sigc::mem_fun(this, &PanelView::OnOverlayHidden));
  _ubus_manager.RegisterInterest(UBUS_OVERLAY_SHOWN, sigc::mem_fun(this, &PanelView::OnOverlayShown));

  // request the latest colour from bghash
  _ubus_manager.SendMessage(UBUS_BACKGROUND_REQUEST_COLOUR_EMIT);

  _bg_effect_helper.owner = this;

  //FIXME (gord)- replace with async loading
  glib::Object<GdkPixbuf> pixbuf;
  glib::Error error;
  pixbuf = gdk_pixbuf_new_from_file(PKGDATADIR "/dash_sheen.png", &error);
  if (error)
  {
    LOG_WARN(logger) << "Unable to texture " << PKGDATADIR << "/dash_sheen.png" << ": " << error;
  }
  else
  {
    _panel_sheen.Adopt(nux::CreateTexture2DFromPixbuf(pixbuf, true));
  }
}

Here is the call graph for this function:

Definition at line 121 of file PanelView.cpp.

{
  for (auto conn : _on_indicator_updated_connections)
    conn.disconnect();

  for (auto conn : _maximized_opacity_toggle_connections)
    conn.disconnect();

  indicator::EntryLocationMap locations;
  _remote->SyncGeometries(GetName() + boost::lexical_cast<std::string>(_monitor), locations);
}

Here is the call graph for this function:


Member Function Documentation

Definition at line 78 of file Introspectable.cpp.

{
  _children.push_back(child);
  child->_parents.push_back(this);
}

Here is the caller graph for this function:

void unity::PanelView::AddPanelView ( PanelIndicatorsView child,
unsigned int  stretchFactor 
) [private]

Definition at line 196 of file PanelView.cpp.

{
  _layout->AddView(child, stretchFactor, nux::eCenter, nux::eFull);
  auto conn = child->on_indicator_updated.connect(sigc::mem_fun(this, &PanelView::OnIndicatorViewUpdated));
  _on_indicator_updated_connections.push_back(conn);
  AddChild(child);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void unity::PanelView::AddProperties ( GVariantBuilder *  builder) [protected, virtual]

Implements unity::debug::Introspectable.

Definition at line 210 of file PanelView.cpp.

{
  variant::BuilderWrapper(builder)
  .add("backend", "remote")
  .add("monitor", _monitor)
  .add("active", IsActive())
  .add(GetAbsoluteGeometry());
}

Here is the call graph for this function:

void unity::PanelView::Draw ( nux::GraphicsEngine &  GfxContext,
bool  force_draw 
) [protected]

Definition at line 220 of file PanelView.cpp.

{
  nux::Geometry geo = GetGeometry();
  nux::Geometry geo_absolute = GetAbsoluteGeometry();
  UpdateBackground();

  GfxContext.PushClippingRectangle(GetGeometry());

  if ((_overlay_is_open || (_opacity != 1.0f && _opacity != 0.0f)))
  {
    nux::Geometry blur_geo(geo_absolute.x, geo_absolute.y, geo.width, geo.height);

    if (BackgroundEffectHelper::blur_type != BLUR_NONE)
    {
      _bg_blur_texture = _bg_effect_helper.GetBlurRegion(blur_geo);
    }
    else
    {
      _bg_blur_texture = _bg_effect_helper.GetRegion(blur_geo);
    }

    if (_bg_blur_texture.IsValid() && (_overlay_is_open || _opacity != 1.0f))
    {
      nux::TexCoordXForm texxform_blur_bg;
      texxform_blur_bg.flip_v_coord = true;
      texxform_blur_bg.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD);
      texxform_blur_bg.uoffset = geo.x / static_cast<float>(geo_absolute.width);
      texxform_blur_bg.voffset = geo.y / static_cast<float>(geo_absolute.height);

      nux::ROPConfig rop;
      rop.Blend = false;
      rop.SrcBlend = GL_ONE;
      rop.DstBlend = GL_ONE_MINUS_SRC_ALPHA;

      nux::Geometry bg_clip = geo;
      GfxContext.PushClippingRectangle(bg_clip);

#ifndef NUX_OPENGLES_20
      if (GfxContext.UsingGLSLCodePath())
        gPainter.PushDrawCompositionLayer(GfxContext, geo,
                                          _bg_blur_texture,
                                          texxform_blur_bg,
                                          nux::color::White,
                                          _bg_color,
                                          nux::LAYER_BLEND_MODE_OVERLAY,
                                          true, rop);
      else
        gPainter.PushDrawTextureLayer(GfxContext, geo,
                                      _bg_blur_texture,
                                      texxform_blur_bg,
                                      nux::color::White,
                                      true,
                                      rop);
#else
        gPainter.PushDrawCompositionLayer(GfxContext, geo,
                                          _bg_blur_texture,
                                          texxform_blur_bg,
                                          nux::color::White,
                                          _bg_color,
                                          nux::LAYER_BLEND_MODE_OVERLAY,
                                          true, rop);
#endif

      GfxContext.PopClippingRectangle();
    }

    if (_overlay_is_open)
    {
      nux::GetPainter().RenderSinglePaintLayer(GfxContext, GetGeometry(), _bg_darken_layer.get());
    }
  }

  if (!_overlay_is_open || GfxContext.UsingGLSLCodePath() == false)
    nux::GetPainter().RenderSinglePaintLayer(GfxContext, GetGeometry(), _bg_layer.get());

  GfxContext.PopClippingRectangle();

  if (_needs_geo_sync)
  {
    SyncGeometries();
    _needs_geo_sync = false;
  }
}

Here is the call graph for this function:

void unity::PanelView::DrawContent ( nux::GraphicsEngine &  GfxContext,
bool  force_draw 
) [protected]

Definition at line 305 of file PanelView.cpp.

{
  nux::Geometry const& geo = GetGeometry();
  int bgs = 1;

  GfxContext.PushClippingRectangle(GetGeometry());

  GfxContext.GetRenderStates().SetBlend(true);
  GfxContext.GetRenderStates().SetPremultipliedBlend(nux::SRC_OVER);

  if (_bg_blur_texture.IsValid() &&
      (_overlay_is_open || (_opacity != 1.0f && _opacity != 0.0f)))
  {
    nux::Geometry geo_absolute = GetAbsoluteGeometry ();
    nux::TexCoordXForm texxform_blur_bg;
    texxform_blur_bg.flip_v_coord = true;
    texxform_blur_bg.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD);
    texxform_blur_bg.uoffset = geo.x / static_cast<float>(geo_absolute.width);
    texxform_blur_bg.voffset = geo.y / static_cast<float>(geo_absolute.height);

    nux::ROPConfig rop;
    rop.Blend = false;
    rop.SrcBlend = GL_ONE;
    rop.DstBlend = GL_ONE_MINUS_SRC_ALPHA;

#ifndef NUX_OPENGLES_20
    if (GfxContext.UsingGLSLCodePath())
      gPainter.PushCompositionLayer(GfxContext, geo,
                                    _bg_blur_texture,
                                    texxform_blur_bg,
                                    nux::color::White,
                                    _bg_color,
                                    nux::LAYER_BLEND_MODE_OVERLAY,
                                    true,
                                    rop);
    else
      gPainter.PushTextureLayer(GfxContext, geo,
                                _bg_blur_texture,
                                texxform_blur_bg,
                                nux::color::White,
                                true,
                                rop);

#else
      gPainter.PushCompositionLayer(GfxContext, geo,
                                    _bg_blur_texture,
                                    texxform_blur_bg,
                                    nux::color::White,
                                    _bg_color,
                                    nux::LAYER_BLEND_MODE_OVERLAY,
                                    true,
                                    rop);
#endif
    bgs++;

    if (_overlay_is_open)
    {
      nux::GetPainter().PushLayer(GfxContext, GetGeometry(), _bg_darken_layer.get());
      bgs++;
    }
  }

  if (!_overlay_is_open || GfxContext.UsingGLSLCodePath() == false)
    gPainter.PushLayer(GfxContext, GetGeometry(), _bg_layer.get());

  if (_overlay_is_open)
  {
    // apply the shine
    nux::TexCoordXForm texxform;
    texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD);
    texxform.SetWrap(nux::TEXWRAP_CLAMP, nux::TEXWRAP_CLAMP);

    nux::ROPConfig rop;
    rop.Blend = true;
    rop.SrcBlend = GL_DST_COLOR;
    rop.DstBlend = GL_ONE;
    nux::GetPainter().PushTextureLayer(GfxContext, GetGeometry(),
                                       _panel_sheen->GetDeviceTexture(),
                                       texxform,
                                       nux::color::White,
                                       false,
                                       rop);
  }
  _layout->ProcessDraw(GfxContext, force_draw);

  gPainter.PopBackground(bgs);

  GfxContext.GetRenderStates().SetBlend(false);
  GfxContext.PopClippingRectangle();
}

Definition at line 615 of file PanelView.cpp.

{
  bool ret = false;

  if (!IsActive())
    return ret;

  ret = _menu_view->ActivateIfSensitive();
  if (!ret) _indicators->ActivateIfSensitive();

  return ret;
}

Here is the call graph for this function:

Definition at line 455 of file PanelView.cpp.

{
  _is_dirty = true;
  UpdateBackground();

  _indicators->QueueDraw();
  _menu_view->QueueDraw();
  _tray->QueueDraw();
  QueueDraw();
}

Here is the call graph for this function:

Here is the caller graph for this function:

std::string unity::debug::Introspectable::GetChildsName ( ) const [protected, virtual, inherited]

Please don't override this unless you really need to. The only valid reason is if you have a property that simply must be called 'Children'.

Definition at line 92 of file Introspectable.cpp.

{
  return "Children";
}

Here is the caller graph for this function:

Introspectable::IntrospectableList unity::debug::Introspectable::GetIntrospectableChildren ( ) [virtual, inherited]

Reimplemented in unity::hud::View, unity::launcher::LauncherModel, unity::QuicklistView, and unity::dash::ResultView.

Definition at line 41 of file Introspectable.cpp.

{
  return _children;
}

Here is the caller graph for this function:

guint64 unity::debug::Introspectable::GetIntrospectionId ( ) const [inherited]

Definition at line 97 of file Introspectable.cpp.

{
  return _id;
}

Here is the caller graph for this function:

Definition at line 709 of file PanelView.cpp.

{
  return _monitor;
}
std::string unity::PanelView::GetName ( ) const [protected, virtual]

Implements unity::debug::Introspectable.

Definition at line 205 of file PanelView.cpp.

{
  return "UnityPanel";
}

Here is the caller graph for this function:

Definition at line 681 of file PanelView.cpp.

{
  return _is_primary;
}
Window unity::PanelView::GetTrayXid ( ) const

Definition at line 133 of file PanelView.cpp.

{
  if (!_tray)
    return 0;

  return _tray->xid();
}

Here is the call graph for this function:

GVariant * unity::debug::Introspectable::Introspect ( ) [inherited]

Definition at line 47 of file Introspectable.cpp.

{
  GVariantBuilder  builder;
  GVariantBuilder  child_builder;
  gint             n_children = 0;

  g_variant_builder_init(&builder, G_VARIANT_TYPE("a{sv}"));
  g_variant_builder_add(&builder, "{sv}", "id", g_variant_new_uint64(_id));

  AddProperties(&builder);

  g_variant_builder_init(&child_builder, G_VARIANT_TYPE("as"));

  auto children = GetIntrospectableChildren();
  for (auto it = children.begin(); it != children.end(); it++)
  {
    if ((*it)->GetName() != "")
    {
      g_variant_builder_add(&child_builder, "s", (*it)->GetName().c_str());
      n_children++;
    }
  }

  GVariant* child_results = g_variant_builder_end(&child_builder);

  if (n_children > 0)
    g_variant_builder_add(&builder, "{sv}", GetChildsName().c_str(), child_results);
  return g_variant_builder_end(&builder);
}

Here is the call graph for this function:

Definition at line 714 of file PanelView.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

unity::PanelView::NUX_DECLARE_OBJECT_TYPE ( PanelView  ,
nux::View   
) [private]
void unity::PanelView::OnBackgroundUpdate ( GVariant *  data) [private]

Definition at line 141 of file PanelView.cpp.

{
  gdouble red, green, blue, alpha;
  g_variant_get(data, "(dddd)", &red, &green, &blue, &alpha);

  _bg_color.red = red;
  _bg_color.green = green;
  _bg_color.blue = blue;
  _bg_color.alpha = alpha;

  ForceUpdateBackground();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void unity::PanelView::OnEntryActivated ( std::string const &  entry_id,
nux::Rect const &  geo 
) [protected]

Definition at line 551 of file PanelView.cpp.

{
  bool active = (entry_id.size() > 0);
  if (active && !_track_menu_pointer_timeout)
  {
    //
    // Track menus being scrubbed at 60Hz (about every 16 millisec)
    // It might sound ugly, but it's far nicer (and more responsive) than the
    // code it replaces which used to capture motion events in another process
    // (unity-panel-service) and send them to us over dbus.
    // NOTE: The reason why we have to use a timer instead of tracking motion
    // events is because the motion events will never be delivered to this
    // process. All the motion events will go to unity-panel-service while
    // scrubbing because the active panel menu has (needs) the pointer grab.
    //
    _track_menu_pointer_timeout.reset(new glib::Timeout(16));
    _track_menu_pointer_timeout->Run(sigc::mem_fun(this, &PanelView::TrackMenuPointer));
  }
  else if (!active)
  {
    _track_menu_pointer_timeout.reset();
    _menu_view->NotifyAllMenusClosed();
    _tracked_pointer_pos = {-1, -1};
  }

  _ubus_manager.SendMessage(UBUS_PLACE_VIEW_CLOSE_REQUEST);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void unity::PanelView::OnEntryActivateRequest ( std::string const &  entry_id) [protected]

Definition at line 528 of file PanelView.cpp.

{
  if (!IsActive())
    return;

  bool ret;

  ret = _menu_view->ActivateEntry(entry_id, 0);
  if (!ret) _indicators->ActivateEntry(entry_id, 0);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void unity::PanelView::OnEntryShowMenu ( std::string const &  entry_id,
unsigned int  xid,
int  x,
int  y,
unsigned int  button,
unsigned int  timestamp 
) [protected]

Definition at line 579 of file PanelView.cpp.

{
  Display* d = nux::GetGraphicsDisplay()->GetX11Display();
  XUngrabPointer(d, CurrentTime);
  XFlush(d);

  // --------------------------------------------------------------------------
  // FIXME: This is a workaround until the non-paired events issue is fixed in
  // nux
  XButtonEvent ev =
  {
    ButtonRelease,
    0,
    False,
    d,
    0,
    0,
    0,
    CurrentTime,
    x, y,
    x, y,
    0,
    Button1,
    True
  };
  XEvent* e = (XEvent*)&ev;
  nux::GetWindowThread()->ProcessForeignEvent(e, NULL);
  // --------------------------------------------------------------------------
}

Here is the caller graph for this function:

Definition at line 501 of file PanelView.cpp.

{
  _needs_geo_sync = true;
  ComputeContentSize();
}

Here is the caller graph for this function:

void unity::PanelView::OnMenuPointerMoved ( int  x,
int  y 
) [protected]

Definition at line 507 of file PanelView.cpp.

{
  nux::Geometry const& geo = GetAbsoluteGeometry();

  if (geo.IsPointInside(x, y))
  {
    PanelIndicatorEntryView* view = nullptr;

    if (_menu_view->GetControlsActive())
      view = _menu_view->ActivateEntryAt(x, y);

    if (!view) _indicators->ActivateEntryAt(x, y);

    _menu_view->SetMousePosition(x, y);
  }
  else
  {
    _menu_view->SetMousePosition(-1, -1);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void unity::PanelView::OnObjectAdded ( indicator::Indicator::Ptr const &  proxy) [protected]

Definition at line 469 of file PanelView.cpp.

{
  // Appmenu is treated differently as it needs to expand
  // We could do this in a more special way, but who has the time for special?
  if (proxy->IsAppmenu())
  {
    _menu_view->AddIndicator(proxy);
  }
  else
  {
    _indicators->AddIndicator(proxy);
  }

  ComputeContentSize();
  NeedRedraw();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void unity::PanelView::OnObjectRemoved ( indicator::Indicator::Ptr const &  proxy) [protected]

Definition at line 486 of file PanelView.cpp.

{
  if (proxy->IsAppmenu())
  {
    _menu_view->RemoveIndicator(proxy);
  }
  else
  {
    _indicators->RemoveIndicator(proxy);
  }

  ComputeContentSize();
  NeedRedraw();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void unity::PanelView::OnOverlayHidden ( GVariant *  data) [private]

Definition at line 154 of file PanelView.cpp.

{
  unity::glib::String overlay_identity;
  gboolean can_maximise = FALSE;
  gint32 overlay_monitor = 0;
  g_variant_get(data, UBUS_OVERLAY_FORMAT_STRING,
                &overlay_identity, &can_maximise, &overlay_monitor);

  if (_monitor == overlay_monitor && overlay_identity.Str() == _active_overlay)
  {
    if (_opacity >= 1.0f)
      _bg_effect_helper.enabled = false;

    _overlay_is_open = false;
    _active_overlay = "";
    _menu_view->OverlayHidden();
    _indicators->OverlayHidden();
    SetAcceptKeyNavFocusOnMouseDown(true);
    ForceUpdateBackground();
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void unity::PanelView::OnOverlayShown ( GVariant *  data) [private]

Definition at line 176 of file PanelView.cpp.

{
  unity::glib::String overlay_identity;
  gboolean can_maximise = FALSE;
  gint32 overlay_monitor = 0;
  g_variant_get(data, UBUS_OVERLAY_FORMAT_STRING,
                &overlay_identity, &can_maximise, &overlay_monitor);

  if (_monitor == overlay_monitor)
  {
    _bg_effect_helper.enabled = true;
    _active_overlay = overlay_identity.Str();
    _overlay_is_open = true;
    _indicators->OverlayShown();
    _menu_view->OverlayShown();
    SetAcceptKeyNavFocusOnMouseDown(false);
    ForceUpdateBackground();
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 85 of file Introspectable.cpp.

{
  _children.remove(child);
  child->_parents.remove(this);
}

Here is the caller graph for this function:

void unity::PanelView::SetMenuShowTimings ( int  fadein,
int  fadeout,
int  discovery,
int  discovery_fadein,
int  discovery_fadeout 
)

Definition at line 639 of file PanelView.cpp.

{
  _menu_view->SetMenuShowTimings(fadein, fadeout, discovery, discovery_fadein, discovery_fadeout);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void unity::PanelView::SetMonitor ( int  monitor)

Definition at line 703 of file PanelView.cpp.

{
  _monitor = monitor;
  _menu_view->SetMonitor(monitor);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void unity::PanelView::SetOpacity ( float  opacity)

Definition at line 628 of file PanelView.cpp.

{
  if (_opacity == opacity)
    return;

  _opacity = opacity;
  _bg_effect_helper.enabled = (_opacity < 1.0f || _overlay_is_open);

  ForceUpdateBackground();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 645 of file PanelView.cpp.

{
  if (_opacity_maximized_toggle != enabled)
  {
    if (enabled)
    {
      auto win_manager = WindowManager::Default();
      auto update_bg_lambda = [&](guint32) { ForceUpdateBackground(); };
      auto conn = &_maximized_opacity_toggle_connections;

      conn->push_back(win_manager->window_minimized.connect(update_bg_lambda));
      conn->push_back(win_manager->window_unminimized.connect(update_bg_lambda));
      conn->push_back(win_manager->window_maximized.connect(update_bg_lambda));
      conn->push_back(win_manager->window_restored.connect(update_bg_lambda));
      conn->push_back(win_manager->window_mapped.connect(update_bg_lambda));
      conn->push_back(win_manager->window_unmapped.connect(update_bg_lambda));
      conn->push_back(win_manager->initiate_expo.connect(
        sigc::mem_fun(this, &PanelView::ForceUpdateBackground)));
      conn->push_back(win_manager->terminate_expo.connect(
        sigc::mem_fun(this, &PanelView::ForceUpdateBackground)));
      conn->push_back(win_manager->compiz_screen_viewport_switch_ended.connect(
        sigc::mem_fun(this, &PanelView::ForceUpdateBackground)));
    }
    else
    {
      for (auto conn : _maximized_opacity_toggle_connections)
        conn.disconnect();

      _maximized_opacity_toggle_connections.clear();
    }

    _opacity_maximized_toggle = enabled;
    ForceUpdateBackground();
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void unity::PanelView::SetPrimary ( bool  primary)

Definition at line 686 of file PanelView.cpp.

{
  _is_primary = primary;
}

Here is the caller graph for this function:

Definition at line 691 of file PanelView.cpp.

{
  indicator::EntryLocationMap locations;
  std::string panel_id = GetName() + boost::lexical_cast<std::string>(_monitor);

  if (_menu_view->GetControlsActive())
    _menu_view->GetGeometryForSync(locations);

  _indicators->GetGeometryForSync(locations);
  _remote->SyncGeometries(panel_id, locations);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 539 of file PanelView.cpp.

{
  auto mouse = nux::GetGraphicsDisplay()->GetMouseScreenCoord();
  if (_tracked_pointer_pos != mouse)
  {
    OnMenuPointerMoved(mouse.x, mouse.y);
    _tracked_pointer_pos = mouse;
  }

  return true;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 397 of file PanelView.cpp.

{
  nux::Geometry const& geo = GetGeometry();

  if (!_is_dirty && geo == _last_geo)
    return;

  _last_geo = geo;
  _is_dirty = false;

  guint32 maximized_win = _menu_view->GetMaximizedWindow();

  if (_overlay_is_open)
  {
    nux::ROPConfig rop;
    rop.Blend = true;
    rop.SrcBlend = GL_ONE;
    rop.DstBlend = GL_ONE_MINUS_SRC_ALPHA;
    _bg_layer.reset(new nux::ColorLayer (_bg_color, true, rop));
  }
  else
  {
    WindowManager* wm = WindowManager::Default();
    double opacity = _opacity;

    if (_opacity_maximized_toggle && (wm->IsExpoActive() ||
        (maximized_win != 0 && !wm->IsWindowObscured(maximized_win))))
    {
      opacity = 1.0f;
    }

    nux::NBitmapData* bitmap = panel::Style::Instance().GetBackground(geo.width, geo.height, opacity);
    nux::BaseTexture* texture2D = nux::GetGraphicsDisplay()->GetGpuDevice()->CreateSystemCapableTexture();

    texture2D->Update(bitmap);
    delete bitmap;

    nux::TexCoordXForm texxform;
    texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD);
    texxform.SetWrap(nux::TEXWRAP_REPEAT, nux::TEXWRAP_REPEAT);

    nux::ROPConfig rop;
    rop.Blend = true;
    rop.SrcBlend = GL_ONE;
    rop.DstBlend = GL_ONE_MINUS_SRC_ALPHA;
    nux::Color col = nux::color::White;

    _bg_layer.reset(new nux::TextureLayer(texture2D->GetDeviceTexture(),
                                      texxform,
                                      col,
                                      true,
                                      rop));
    texture2D->UnReference();
  }

  NeedRedraw();
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

std::string unity::PanelView::_active_overlay [private]

Definition at line 119 of file PanelView.h.

nux::ObjectPtr<nux::IOpenGLBaseTexture> unity::PanelView::_bg_blur_texture [private]

Definition at line 126 of file PanelView.h.

nux::Color unity::PanelView::_bg_color [private]

Definition at line 110 of file PanelView.h.

Definition at line 104 of file PanelView.h.

Definition at line 125 of file PanelView.h.

Definition at line 103 of file PanelView.h.

Definition at line 100 of file PanelView.h.

Definition at line 111 of file PanelView.h.

Definition at line 114 of file PanelView.h.

nux::Geometry unity::PanelView::_last_geo [private]

Definition at line 108 of file PanelView.h.

nux::HLayout* unity::PanelView::_layout [private]

Definition at line 106 of file PanelView.h.

std::vector<sigc::connection> unity::PanelView::_maximized_opacity_toggle_connections [private]

Definition at line 124 of file PanelView.h.

Definition at line 98 of file PanelView.h.

Definition at line 117 of file PanelView.h.

Definition at line 113 of file PanelView.h.

std::vector<sigc::connection> unity::PanelView::_on_indicator_updated_connections [private]

Definition at line 123 of file PanelView.h.

float unity::PanelView::_opacity [private]

Definition at line 116 of file PanelView.h.

Definition at line 112 of file PanelView.h.

Definition at line 115 of file PanelView.h.

nux::ObjectPtr<nux::BaseTexture> unity::PanelView::_panel_sheen [private]

Definition at line 105 of file PanelView.h.

Definition at line 95 of file PanelView.h.

Definition at line 128 of file PanelView.h.

Definition at line 121 of file PanelView.h.

Definition at line 99 of file PanelView.h.

Definition at line 127 of file PanelView.h.


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