Back to index

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

#include <LauncherHoverMachine.h>

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

List of all members.

Public Types

enum  HoverQuirk {
  DEFAULT = 0, LAUNCHER_HIDDEN = 1 << 0, MOUSE_OVER_LAUNCHER = 1 << 1, MOUSE_OVER_BFB = 1 << 2,
  SHORTCUT_KEYS_VISIBLE = 1 << 3, QUICKLIST_OPEN = 1 << 4, KEY_NAV_ACTIVE = 1 << 5, LAUNCHER_IN_ACTION = 1 << 6,
  PLACES_VISIBLE = 1 << 7
}

Public Member Functions

 LauncherHoverMachine ()
void SetQuirk (HoverQuirk quirk, bool active)
bool GetQuirk (HoverQuirk quirk, bool allow_partial=true)
std::string DebugHoverQuirks ()

Public Attributes

sigc::signal< void, bool > should_hover_changed

Private Member Functions

void EnsureHoverState ()
void SetShouldHover (bool value)
bool EmitShouldHoverChanged ()

Private Attributes

bool _should_hover
bool _latest_emit_should_hover
HoverQuirk _quirks
glib::Source::UniquePtr _hover_changed_emit_idle

Detailed Description

Definition at line 28 of file LauncherHoverMachine.h.


Member Enumeration Documentation

Enumerator:
DEFAULT 
LAUNCHER_HIDDEN 
MOUSE_OVER_LAUNCHER 
MOUSE_OVER_BFB 
SHORTCUT_KEYS_VISIBLE 
QUICKLIST_OPEN 
KEY_NAV_ACTIVE 
LAUNCHER_IN_ACTION 
PLACES_VISIBLE 

Definition at line 32 of file LauncherHoverMachine.h.

  {
    DEFAULT                = 0,
    LAUNCHER_HIDDEN        = 1 << 0,
    MOUSE_OVER_LAUNCHER    = 1 << 1,
    MOUSE_OVER_BFB         = 1 << 2,
    SHORTCUT_KEYS_VISIBLE  = 1 << 3,
    QUICKLIST_OPEN         = 1 << 4,
    KEY_NAV_ACTIVE         = 1 << 5,
    LAUNCHER_IN_ACTION     = 1 << 6,
    PLACES_VISIBLE         = 1 << 7,
  } HoverQuirk;

Constructor & Destructor Documentation

Definition at line 26 of file LauncherHoverMachine.cpp.


Member Function Documentation

Definition at line 109 of file LauncherHoverMachine.cpp.

{
  // Although I do wonder why we are returning a string representation
  // of the enum value as an integer anyway.
  return boost::lexical_cast<std::string>(_quirks);
}

Here is the caller graph for this function:

Definition at line 75 of file LauncherHoverMachine.cpp.

Here is the caller graph for this function:

Definition at line 45 of file LauncherHoverMachine.cpp.

{
  bool should_hover;

  if (GetQuirk(LAUNCHER_HIDDEN))
  {
    SetShouldHover(false);
    return;
  }

  if (GetQuirk((HoverQuirk)(MOUSE_OVER_LAUNCHER | MOUSE_OVER_BFB |
                            SHORTCUT_KEYS_VISIBLE | KEY_NAV_ACTIVE |
                            QUICKLIST_OPEN | LAUNCHER_IN_ACTION)))
    should_hover = true;
  else
    should_hover = false;

  SetShouldHover(should_hover);
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool unity::LauncherHoverMachine::GetQuirk ( LauncherHoverMachine::HoverQuirk  quirk,
bool  allow_partial = true 
)

Definition at line 101 of file LauncherHoverMachine.cpp.

{
  if (allow_partial)
    return _quirks & quirk;
  return (_quirks & quirk) == quirk;
}

Here is the caller graph for this function:

Definition at line 87 of file LauncherHoverMachine.cpp.

{
  if (GetQuirk(quirk) == active)
    return;

  if (active)
    _quirks = (HoverQuirk)(_quirks | quirk);
  else
    _quirks = (HoverQuirk)(_quirks & ~quirk);

  EnsureHoverState();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void unity::LauncherHoverMachine::SetShouldHover ( bool  value) [private]

Definition at line 66 of file LauncherHoverMachine.cpp.

{
  _should_hover = value;

  _hover_changed_emit_idle.reset(new glib::Idle(glib::Source::Priority::DEFAULT));
  _hover_changed_emit_idle->Run(sigc::mem_fun(this, &LauncherHoverMachine::EmitShouldHoverChanged));
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 63 of file LauncherHoverMachine.h.

Definition at line 60 of file LauncherHoverMachine.h.

Definition at line 61 of file LauncherHoverMachine.h.

Definition at line 59 of file LauncherHoverMachine.h.

Definition at line 50 of file LauncherHoverMachine.h.


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