Back to index

unity  6.0.0
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Types | Private Member Functions | Private Attributes
unity::launcher::BamfLauncherIcon Class Reference

#include <BamfLauncherIcon.h>

Inheritance diagram for unity::launcher::BamfLauncherIcon:
Inheritance graph
[legend]
Collaboration diagram for unity::launcher::BamfLauncherIcon:
Collaboration graph
[legend]

List of all members.

Public Types

typedef nux::ObjectPtr
< nux::BaseTexture > 
BaseTexturePtr
enum  IconType {
  TYPE_NONE, TYPE_BEGIN, TYPE_HOME, TYPE_HUD,
  TYPE_FAVORITE, TYPE_APPLICATION, TYPE_EXPO, TYPE_DESKTOP,
  TYPE_PLACE, TYPE_DEVICE, TYPE_TRASH, TYPE_END
}
enum  Quirk {
  QUIRK_VISIBLE, QUIRK_ACTIVE, QUIRK_RUNNING, QUIRK_URGENT,
  QUIRK_PRESENTED, QUIRK_STARTING, QUIRK_SHIMMER, QUIRK_CENTER_SAVED,
  QUIRK_PROGRESS, QUIRK_DROP_PRELIGHT, QUIRK_DROP_DIM, QUIRK_DESAT,
  QUIRK_PULSE_ONCE, QUIRK_LAST_ACTION, QUIRK_LAST
}
typedef nux::ObjectPtr
< AbstractLauncherIcon
Ptr
typedef std::vector< nux::Vector4 > TransformVector
enum  TransformIndex {
  TRANSFORM_TILE, TRANSFORM_IMAGE, TRANSFORM_HIT_AREA, TRANSFORM_GLOW,
  TRANSFORM_EMBLEM
}
typedef std::list
< Introspectable * > 
IntrospectableList

Public Member Functions

 BamfLauncherIcon (BamfApplication *app)
virtual ~BamfLauncherIcon ()
virtual void ActivateLauncherIcon (ActionArg arg)
std::string DesktopFile ()
bool IsSticky () const
bool IsVisible () const
bool IsActive () const
bool IsRunning () const
bool IsUrgent () const
void Quit ()
void Stick (bool save=true)
void UnStick ()
virtual bool ShowInSwitcher (bool current)
virtual unsigned long long SwitcherPriority ()
virtual nux::Color BackgroundColor () const
std::vector< Window > Windows ()
std::vector< Window > WindowsOnViewport ()
std::vector< Window > WindowsForMonitor (int monitor)
std::string NameForWindow (Window window)
nux::BaseTexture * GetTextureForSize (int size)
bool SetTooltipText (std::string &target, std::string const &value)
void SetShortcut (guint64 shortcut)
guint64 GetShortcut ()
void SetSortPriority (int priority)
void RecvMouseEnter (int monitor)
void RecvMouseLeave (int monitor)
void RecvMouseDown (int button, int monitor, unsigned long key_flags=0)
void RecvMouseUp (int button, int monitor, unsigned long key_flags=0)
void RecvMouseClick (int button, int monitor, unsigned long key_flags=0)
void HideTooltip ()
void ShowTooltip ()
bool OpenQuicklist (bool select_first_item=false, int monitor=-1)
void SetCenter (nux::Point3 center, int parent_monitor, nux::Geometry parent_geo)
nux::Point3 GetCenter (int monitor)
virtual void Activate (ActionArg arg)
void OpenInstance (ActionArg arg)
void SaveCenter ()
nux::Point3 GetSavedCenter (int monitor)
int SortPriority ()
const bool WindowVisibleOnMonitor (int monitor)
const bool WindowVisibleOnViewport ()
virtual bool IsSpacer ()
float PresentUrgency ()
float GetProgress ()
void SetEmblemIconName (std::string const &name)
void SetEmblemText (std::string const &text)
void DeleteEmblem ()
bool GetQuirk (Quirk quirk) const
void SetQuirk (Quirk quirk, bool value)
struct timespec GetQuirkTime (Quirk quirk)
IconType GetIconType ()
virtual nux::Color GlowColor ()
std::string RemoteUri ()
nux::BaseTexture * TextureForSize (int size)
nux::BaseTexture * Emblem ()
std::list< DbusmenuMenuitem * > Menus ()
void InsertEntryRemote (LauncherEntryRemote::Ptr const &remote)
void RemoveEntryRemote (LauncherEntryRemote::Ptr const &remote)
nux::DndAction QueryAcceptDrop (DndData const &dnd_data)
bool ShouldHighlightOnDrag (DndData const &dnd_data)
void AcceptDrop (DndData const &dnd_data)
void SendDndEnter ()
void SendDndLeave ()
void SetIconType (IconType type)
virtual bool IsVisibleOnMonitor (int monitor) const
virtual void SetVisibleOnMonitor (int monitor, bool visible)
virtual void AboutToRemove ()
std::vector< nux::Vector4 > & GetTransform (TransformIndex index, int monitor)
GVariant * Introspect ()
void AddChild (Introspectable *child)
void RemoveChild (Introspectable *child)
virtual IntrospectableList GetIntrospectableChildren ()
guint64 GetIntrospectionId () const

Public Attributes

nux::Property< std::string > icon_name
sigc::signal< void > activate
nux::Property< std::string > tooltip_text
nux::Property< bool > tooltip_enabled
sigc::signal< void, int, int,
unsigned long > 
mouse_down
sigc::signal< void, int, int,
unsigned long > 
mouse_up
sigc::signal< void, int, int,
unsigned long > 
mouse_click
sigc::signal< void, int > mouse_enter
sigc::signal< void, int > mouse_leave
sigc::signal< void,
AbstractLauncherIcon::Ptr
needs_redraw
sigc::signal< void,
AbstractLauncherIcon::Ptr
remove
sigc::signal< void,
nux::ObjectPtr< nux::View > > 
tooltip_visible
sigc::signal< void > visibility_changed
sigc::connection needs_redraw_connection
sigc::connection on_icon_added_connection
sigc::connection on_icon_removed_connection
sigc::connection on_order_changed_connection
sigc::connection on_expo_terminated_connection

Protected Member Functions

void Remove ()
void UpdateIconGeometries (std::vector< nux::Point3 > center)
void OnCenterStabilized (std::vector< nux::Point3 > center)
void AddProperties (GVariantBuilder *builder)
void OnAcceptDrop (DndData const &dnd_data)
void OnDndEnter ()
void OnDndHovered ()
void OnDndLeave ()
void OpenInstanceLauncherIcon (ActionArg arg)
void ToggleSticky ()
bool OnShouldHighlightOnDrag (DndData const &dnd_data)
nux::DndAction OnQueryAcceptDrop (DndData const &dnd_data)
std::list< DbusmenuMenuitem * > GetMenus ()
std::set< std::string > ValidateUrisForLaunch (DndData const &dnd_data)
std::string GetRemoteUri ()
std::string BamfName () const
bool HandlesSpread ()
std::string GetName () const
virtual void OnMouseDown (int button, int monitor, unsigned long key_flags=0)
virtual void OnMouseUp (int button, int monitor, unsigned long key_flags=0)
virtual void OnMouseClick (int button, int monitor, unsigned long key_flags=0)
virtual void OnMouseEnter (int monitor)
virtual void OnMouseLeave (int monitor)
std::vector< nux::Point3 > GetCenters ()
void UpdateQuirkTimeDelayed (guint ms, Quirk quirk)
void UpdateQuirkTime (Quirk quirk)
void ResetQuirkTime (Quirk quirk)
void SetProgress (float progress)
void SetWindowVisibleOnMonitor (bool val, int monitor)
void Present (float urgency, int length)
void Unpresent ()
void SetEmblem (BaseTexturePtr const &emblem)
nux::BaseTexture * TextureFromGtkTheme (std::string name, int size, bool update_glow_colors=true)
nux::BaseTexture * TextureFromSpecificGtkTheme (GtkIconTheme *theme, std::string const &name, int size, bool update_glow_colors=true, bool is_default_theme=false)
nux::BaseTexture * TextureFromPath (std::string const &name, int size, bool update_glow_colors=true)
GtkIconTheme * GetUnityTheme ()
void OnRemoteEmblemChanged (LauncherEntryRemote *remote)
void OnRemoteCountChanged (LauncherEntryRemote *remote)
void OnRemoteProgressChanged (LauncherEntryRemote *remote)
void OnRemoteQuicklistChanged (LauncherEntryRemote *remote)
void OnRemoteUrgentChanged (LauncherEntryRemote *remote)
void OnRemoteEmblemVisibleChanged (LauncherEntryRemote *remote)
void OnRemoteCountVisibleChanged (LauncherEntryRemote *remote)
void OnRemoteProgressVisibleChanged (LauncherEntryRemote *remote)
void EmitNeedsRedraw ()
void EmitRemove ()
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'.

Static Protected Member Functions

static bool IsMonoDefaultTheme ()

Protected Attributes

glib::Object< DbusmenuClient > _menuclient_dynamic_quicklist
glib::SourceManager _source_manager

Static Protected Attributes

static int _current_theme_is_mono = -1

Private Types

enum  WindowFilter { MAPPED = (1 << 0), USER_VISIBLE = (1 << 1), ON_CURRENT_DESKTOP = (1 << 2), ON_ALL_MONITORS = (1 << 3) }
typedef unsigned long int WindowFilterMask

Private Member Functions

 NUX_DECLARE_OBJECT_TYPE (BamfLauncherIcon, SimpleLauncherIcon)
void EnsureWindowState ()
void EnsureMenuItemsReady ()
void UpdateBackgroundColor ()
void UpdateDesktopFile ()
void UpdateMenus ()
void UpdateDesktopQuickList ()
void FillSupportedTypes ()
void OpenInstanceWithUris (std::set< std::string > uris)
void Focus (ActionArg arg)
bool Spread (bool current_desktop, int state, bool force)
void OnWindowMinimized (guint32 xid)
void OnWindowMoved (guint32 xid)
bool OwnsWindow (Window w) const
std::vector< Window > GetWindows (WindowFilterMask filter=0, int monitor=-1)
const std::set< std::string > & GetSupportedTypes ()
std::string GetDesktopID ()

Private Attributes

glib::Object< BamfApplication > _bamf_app
bool _supported_types_filled
std::string _remote_uri
std::string _desktop_file
std::set< std::string > _supported_types
std::map< std::string,
glib::Object< DbusmenuClient > > 
_menu_clients
std::map< std::string,
glib::Object< DbusmenuMenuitem > > 
_menu_items
std::map< std::string,
glib::Object< DbusmenuMenuitem > > 
_menu_items_extra
glib::Object
< IndicatorDesktopShortcuts > 
_desktop_shortcuts
glib::Object< DbusmenuMenuitem > _menu_desktop_shortcuts
glib::Object< GFileMonitor > _desktop_file_monitor
glib::SignalManager _gsignals
bool use_custom_bg_color_
nux::Color bg_color_

Detailed Description

Definition at line 41 of file BamfLauncherIcon.h.


Member Typedef Documentation

typedef nux::ObjectPtr<nux::BaseTexture> unity::launcher::LauncherIcon::BaseTexturePtr [inherited]

Definition at line 55 of file LauncherIcon.h.

Definition at line 34 of file Introspectable.h.

Reimplemented from unity::ui::IconTextureSource.

Reimplemented in unity::launcher::SoftwareCenterLauncherIcon.

Definition at line 80 of file AbstractLauncherIcon.h.

typedef std::vector<nux::Vector4> unity::launcher::AbstractLauncherIcon::TransformVector [inherited]

Definition at line 81 of file AbstractLauncherIcon.h.

typedef unsigned long int unity::launcher::BamfLauncherIcon::WindowFilterMask [private]

Definition at line 97 of file BamfLauncherIcon.h.


Member Enumeration Documentation

Enumerator:
TYPE_NONE 
TYPE_BEGIN 
TYPE_HOME 
TYPE_HUD 
TYPE_FAVORITE 
TYPE_APPLICATION 
TYPE_EXPO 
TYPE_DESKTOP 
TYPE_PLACE 
TYPE_DEVICE 
TYPE_TRASH 
TYPE_END 

Definition at line 83 of file AbstractLauncherIcon.h.

Enumerator:
QUIRK_VISIBLE 
QUIRK_ACTIVE 
QUIRK_RUNNING 
QUIRK_URGENT 
QUIRK_PRESENTED 
QUIRK_STARTING 
QUIRK_SHIMMER 
QUIRK_CENTER_SAVED 
QUIRK_PROGRESS 
QUIRK_DROP_PRELIGHT 
QUIRK_DROP_DIM 
QUIRK_DESAT 
QUIRK_PULSE_ONCE 
QUIRK_LAST_ACTION 
QUIRK_LAST 

Definition at line 99 of file AbstractLauncherIcon.h.

Enumerator:
TRANSFORM_TILE 
TRANSFORM_IMAGE 
TRANSFORM_HIT_AREA 
TRANSFORM_GLOW 
TRANSFORM_EMBLEM 

Definition at line 39 of file IconTextureSource.h.

Enumerator:
MAPPED 
USER_VISIBLE 
ON_CURRENT_DESKTOP 
ON_ALL_MONITORS 

Definition at line 98 of file BamfLauncherIcon.h.

  {
    MAPPED = (1 << 0),
    USER_VISIBLE = (1 << 1),
    ON_CURRENT_DESKTOP = (1 << 2),
    ON_ALL_MONITORS = (1 << 3),
  };

Constructor & Destructor Documentation

Definition at line 55 of file BamfLauncherIcon.cpp.

  : SimpleLauncherIcon()
  , _bamf_app(app, glib::AddRef())
  , _supported_types_filled(false)
  , use_custom_bg_color_(false)
  , bg_color_(nux::color::White)
{
  g_object_set_qdata(G_OBJECT(app), g_quark_from_static_string("unity-seen"),
                     GUINT_TO_POINTER(1));
  auto bamf_view = glib::object_cast<BamfView>(_bamf_app);

  glib::String icon(bamf_view_get_icon(bamf_view));

  tooltip_text = BamfName();
  icon_name = icon.Str();
  SetIconType(TYPE_APPLICATION);

  if (IsSticky())
    SetQuirk(QUIRK_VISIBLE, true);
  else
    SetQuirk(QUIRK_VISIBLE, bamf_view_user_visible(bamf_view));

  SetQuirk(QUIRK_ACTIVE, bamf_view_is_active(bamf_view));
  SetQuirk(QUIRK_RUNNING, bamf_view_is_running(bamf_view));

  glib::SignalBase* sig;

  sig = new glib::Signal<void, BamfView*, BamfView*>(bamf_view, "child-added",
                          [&] (BamfView*, BamfView*) {
                            EnsureWindowState();
                            UpdateMenus();
                            UpdateIconGeometries(GetCenters());
                          });
  _gsignals.Add(sig);

  sig = new glib::Signal<void, BamfView*, BamfView*>(bamf_view, "child-removed",
                          [&] (BamfView*, BamfView*) { EnsureWindowState(); });
  _gsignals.Add(sig);

  sig = new glib::Signal<void, BamfView*, gboolean>(bamf_view, "urgent-changed",
                          [&] (BamfView*, gboolean urgent) {
                            SetQuirk(QUIRK_URGENT, urgent);
                          });
  _gsignals.Add(sig);

  sig = new glib::Signal<void, BamfView*, gboolean>(bamf_view, "active-changed",
                          [&] (BamfView*, gboolean active) {
                            SetQuirk(QUIRK_ACTIVE, active);
                          });
  _gsignals.Add(sig);

  sig = new glib::Signal<void, BamfView*, gboolean>(bamf_view, "running-changed",
                          [&] (BamfView*, gboolean running) {
                            SetQuirk(QUIRK_RUNNING, running);

                            if (running)
                            {
                              EnsureWindowState();
                              UpdateIconGeometries(GetCenters());
                              _source_manager.Remove(ICON_REMOVE_TIMEOUT);
                            }
                          });
  _gsignals.Add(sig);

  sig = new glib::Signal<void, BamfView*, gboolean>(bamf_view, "user-visible-changed",
                          [&] (BamfView*, gboolean visible) {
                            if (!IsSticky())
                              SetQuirk(QUIRK_VISIBLE, visible);
                          });
  _gsignals.Add(sig);

  sig = new glib::Signal<void, BamfView*>(bamf_view, "closed",
                          [&] (BamfView*) {
                            if (!IsSticky())
                            {
                              SetQuirk(QUIRK_VISIBLE, false);

                              /* Use a timeout to remove the icon, this avoids
                               * that we remove an application that is going
                               * to be reopened soon. So applications that
                               * have a splash screen won't be removed from
                               * the launcher while the splash is closed and
                               * a new window is opened. */
                              auto timeout = std::make_shared<glib::TimeoutSeconds>(1);
                              _source_manager.Add(timeout, ICON_REMOVE_TIMEOUT);
                              timeout->Run([&] { Remove(); return false; });
                            }
                          });
  _gsignals.Add(sig);

  WindowManager::Default()->window_minimized.connect(sigc::mem_fun(this, &BamfLauncherIcon::OnWindowMinimized));
  WindowManager::Default()->window_moved.connect(sigc::mem_fun(this, &BamfLauncherIcon::OnWindowMoved));
  WindowManager::Default()->compiz_screen_viewport_switch_ended.connect(sigc::mem_fun(this, &BamfLauncherIcon::EnsureWindowState));
  WindowManager::Default()->terminate_expo.connect(sigc::mem_fun(this, &BamfLauncherIcon::EnsureWindowState));

  EnsureWindowState();
  UpdateMenus();
  UpdateDesktopFile();
  UpdateBackgroundColor();

  // hack
  SetProgress(0.0f);

  // Calls when there are no higher priority events pending to the default main loop.
  auto idle = std::make_shared<glib::Idle>([&] { FillSupportedTypes(); return false; });
  _source_manager.Add(idle);
}

Here is the call graph for this function:

Definition at line 163 of file BamfLauncherIcon.cpp.

{
  if (_bamf_app)
    g_object_set_qdata(G_OBJECT(_bamf_app.RawPtr()),
                       g_quark_from_static_string("unity-seen"), nullptr);
}

Here is the call graph for this function:


Member Function Documentation

virtual void unity::launcher::LauncherIcon::AboutToRemove ( ) [inline, virtual, inherited]

Implements unity::launcher::AbstractLauncherIcon.

Definition at line 201 of file LauncherIcon.h.

{}
void unity::launcher::LauncherIcon::AcceptDrop ( DndData const &  dnd_data) [inline, virtual, inherited]

Implements unity::launcher::AbstractLauncherIcon.

Definition at line 174 of file LauncherIcon.h.

  {
    return OnAcceptDrop(dnd_data);
  }

Here is the call graph for this function:

void unity::launcher::LauncherIcon::Activate ( ActionArg  arg) [virtual, inherited]

Implements unity::launcher::AbstractLauncherIcon.

Definition at line 209 of file LauncherIcon.cpp.

{
  /* Launcher Icons that handle spread will adjust the spread state
   * accordingly, for all other icons we should terminate spread */
  if (WindowManager::Default()->IsScaleActive() && !HandlesSpread ())
    WindowManager::Default()->TerminateScale();

  ActivateLauncherIcon(arg);

  UpdateQuirkTime(QUIRK_LAST_ACTION);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Reimplemented from unity::launcher::SimpleLauncherIcon.

Reimplemented in unity::launcher::SoftwareCenterLauncherIcon.

Definition at line 210 of file BamfLauncherIcon.cpp.

{
  SimpleLauncherIcon::ActivateLauncherIcon(arg);
  WindowManager* wm = WindowManager::Default();
  bool scaleWasActive = wm->IsScaleActive();

  bool active = IsActive();
  bool user_visible = IsRunning();

  if (arg.target && OwnsWindow(arg.target))
  {
    wm->Activate(arg.target);
    return;
  }

  /* We should check each child to see if there is
   * an unmapped (!= minimized) window around and
   * if so force "Focus" behaviour */

  if (arg.source != ActionArg::SWITCHER)
  {
    auto bamf_view = glib::object_cast<BamfView>(_bamf_app);
    user_visible = bamf_view_user_visible(bamf_view);

    if (active)
    {
      bool any_visible = false;
      bool any_mapped = false;
      bool any_on_top = false;
      bool any_on_monitor = (arg.monitor < 0);
      int active_monitor = arg.monitor;
      GList* children = bamf_view_get_children(bamf_view);

      for (GList* l = children; l; l = l->next)
      {
        if (!BAMF_IS_WINDOW(l->data))
          continue;

        auto view = static_cast<BamfView*>(l->data);
        auto win = static_cast<BamfWindow*>(l->data);
        Window xid = bamf_window_get_xid(win);

        if (!any_visible && wm->IsWindowOnCurrentDesktop(xid))
        {
          any_visible = true;
        }

        if (!any_mapped && wm->IsWindowMapped(xid))
        {
          any_mapped = true;
        }

        if (!any_on_top && wm->IsWindowOnTop(xid))
        {
          any_on_top = true;
        }

        if (!any_on_monitor && bamf_window_get_monitor(win) == arg.monitor &&
            wm->IsWindowMapped(xid) && wm->IsWindowVisible(xid))
        {
          any_on_monitor = true;
        }

        if (bamf_view_is_active(view))
        {
          active_monitor = bamf_window_get_monitor(win);
        }
      }

      g_list_free(children);

      if (!any_visible || !any_mapped || !any_on_top)
        active = false;

      if (any_on_monitor && arg.monitor >= 0 && active_monitor != arg.monitor)
        active = false;
    }
  }

  /* Behaviour:
   * 1) Nothing running, or nothing visible -> launch application
   * 2) Running and active -> spread application
   * 3) Running and not active -> focus application
   * 4) Spread is active and different icon pressed -> change spread
   * 5) Spread is active -> Spread de-activated, and fall through
   */

  if (!IsRunning() || (IsRunning() && !user_visible)) // #1 above
  {
    if (GetQuirk(QUIRK_STARTING))
      return;

    if (scaleWasActive)
    {
      wm->TerminateScale();
    }

    SetQuirk(QUIRK_STARTING, true);
    OpenInstanceLauncherIcon(ActionArg());
  }
  else // app is running
  {
    if (active)
    {
      if (scaleWasActive) // #5 above
      {
        wm->TerminateScale();
        Focus(arg);
      }
      else // #2 above
      {
        if (arg.source != ActionArg::SWITCHER)
        {
          Spread(true, 0, false);
        }
      }
    }
    else
    {
      if (scaleWasActive) // #4 above
      {
        wm->TerminateScale();
        Focus(arg);
        if (arg.source != ActionArg::SWITCHER)
          Spread(true, 0, false);
      }
      else // #3 above
      {
        Focus(arg);
      }
    }
  }

  if (arg.source != ActionArg::SWITCHER)
    ubus_server_send_message(ubus_server_get_default(), UBUS_LAUNCHER_ACTION_DONE, nullptr);
}

Here is the call graph for this function:

Here is the caller graph for this function:

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::launcher::BamfLauncherIcon::AddProperties ( GVariantBuilder *  builder) [protected, virtual]

Reimplemented from unity::launcher::SimpleLauncherIcon.

Definition at line 512 of file BamfLauncherIcon.cpp.

{
  SimpleLauncherIcon::AddProperties(builder);

  GVariantBuilder xids_builder;
  g_variant_builder_init(&xids_builder, G_VARIANT_TYPE ("au"));

  for (auto xid : GetWindows())
    g_variant_builder_add(&xids_builder, "u", xid);

  variant::BuilderWrapper(builder)
    .add("desktop_file", DesktopFile())
    .add("desktop_id", GetDesktopID())
    .add("application_id", GPOINTER_TO_UINT(_bamf_app.RawPtr()))
    .add("xids", g_variant_builder_end(&xids_builder))
    .add("sticky", IsSticky());
}

Here is the call graph for this function:

Reimplemented from unity::launcher::LauncherIcon.

Definition at line 1280 of file BamfLauncherIcon.cpp.

std::string unity::launcher::BamfLauncherIcon::BamfName ( ) const [protected]

Definition at line 506 of file BamfLauncherIcon.cpp.

{
  glib::String name(bamf_view_get_name(BAMF_VIEW(_bamf_app.RawPtr())));
  return name.Str();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1028 of file LauncherIcon.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Reimplemented from unity::launcher::LauncherIcon.

Definition at line 500 of file BamfLauncherIcon.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nux::BaseTexture * unity::launcher::LauncherIcon::Emblem ( ) [virtual, inherited]

Implements unity::ui::IconTextureSource.

Definition at line 923 of file LauncherIcon.cpp.

{
  return _emblem.GetPointer();
}
void unity::launcher::LauncherIcon::EmitNeedsRedraw ( ) [protected, inherited]

Definition at line 1164 of file LauncherIcon.cpp.

{
  if (OwnsTheReference() && GetReferenceCount() > 0)
    needs_redraw.emit(AbstractLauncherIcon::Ptr(this));
}

Here is the caller graph for this function:

void unity::launcher::LauncherIcon::EmitRemove ( ) [protected, inherited]

Definition at line 1170 of file LauncherIcon.cpp.

{
  if (OwnsTheReference() && GetReferenceCount() > 0)
    remove.emit(AbstractLauncherIcon::Ptr(this));
}

Here is the caller graph for this function:

Definition at line 913 of file BamfLauncherIcon.cpp.

{
  DbusmenuMenuitem* menu_item;

  /* Pin */
  if (_menu_items.find("Pin") == _menu_items.end())
  {
    menu_item = dbusmenu_menuitem_new();
    dbusmenu_menuitem_property_set_bool(menu_item, DBUSMENU_MENUITEM_PROP_ENABLED, true);
    dbusmenu_menuitem_property_set_bool(menu_item, DBUSMENU_MENUITEM_PROP_VISIBLE, true);

    _gsignals.Add(new glib::Signal<void, DbusmenuMenuitem*, int>(menu_item, DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED,
                                    [&] (DbusmenuMenuitem*, int) {
                                      ToggleSticky();
                                    }));

    _menu_items["Pin"] = glib::Object<DbusmenuMenuitem>(menu_item);
  }

  const char* label = !IsSticky() ? _("Lock to Launcher") : _("Unlock from Launcher");

  dbusmenu_menuitem_property_set(_menu_items["Pin"], DBUSMENU_MENUITEM_PROP_LABEL, label);


  /* Quit */
  if (_menu_items.find("Quit") == _menu_items.end())
  {
    menu_item = dbusmenu_menuitem_new();
    dbusmenu_menuitem_property_set(menu_item, DBUSMENU_MENUITEM_PROP_LABEL, _("Quit"));
    dbusmenu_menuitem_property_set_bool(menu_item, DBUSMENU_MENUITEM_PROP_ENABLED, true);
    dbusmenu_menuitem_property_set_bool(menu_item, DBUSMENU_MENUITEM_PROP_VISIBLE, true);

    _gsignals.Add(new glib::Signal<void, DbusmenuMenuitem*, int>(menu_item, DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED,
                                    [&] (DbusmenuMenuitem*, int) {
                                      Quit();
                                    }));

    _menu_items["Quit"] = glib::Object<DbusmenuMenuitem>(menu_item);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 680 of file BamfLauncherIcon.cpp.

{
  GList* children, *l;
  std::vector<bool> monitors;
  monitors.resize(max_num_monitors);

  children = bamf_view_get_children(BAMF_VIEW(_bamf_app.RawPtr()));
  for (l = children; l; l = l->next)
  {
    if (!BAMF_IS_WINDOW(l->data))
      continue;

    auto window = static_cast<BamfWindow*>(l->data);
    Window xid = bamf_window_get_xid(window);
    int monitor = bamf_window_get_monitor(window);

    if (monitor >= 0 && WindowManager::Default()->IsWindowOnCurrentDesktop(xid))
      monitors[monitor] = true;
  }

  for (int i = 0; i < max_num_monitors; i++)
    SetWindowVisibleOnMonitor(monitors[i], i);

  EmitNeedsRedraw();

  g_list_free(children);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1296 of file BamfLauncherIcon.cpp.

{
  if (!_supported_types_filled)
  {
    _supported_types_filled = true;
    _supported_types.clear();

    std::string const& desktop_file = DesktopFile();

    if (desktop_file.empty())
      return;

    GKeyFile* key_file = g_key_file_new();
    glib::Error error;

    g_key_file_load_from_file(key_file, desktop_file.c_str(), (GKeyFileFlags) 0, &error);

    if (error)
    {
      g_key_file_free(key_file);
      return;
    }

    char** mimes = g_key_file_get_string_list(key_file, "Desktop Entry", "MimeType", nullptr, nullptr);
    if (!mimes)
    {
      g_key_file_free(key_file);
      return;
    }

    for (int i = 0; mimes[i]; i++)
    {
      unity::glib::String super_type(g_content_type_from_mime_type(mimes[i]));
      _supported_types.insert(super_type.Str());
    }

    g_key_file_free(key_file);
    g_strfreev(mimes);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 603 of file BamfLauncherIcon.cpp.

{
  bool any_urgent = false;
  bool any_visible = false;
  bool any_user_visible = false;
  WindowManager* wm = WindowManager::Default();

  std::vector<Window> windows;
  GList* children = bamf_view_get_children(BAMF_VIEW(_bamf_app.RawPtr()));

  /* get the list of windows */
  for (GList* l = children; l; l = l->next)
  {
    if (!BAMF_IS_WINDOW(l->data))
      continue;

    auto view = static_cast<BamfView*>(l->data);

    Window xid = bamf_window_get_xid(static_cast<BamfWindow*>(l->data));
    bool urgent = bamf_view_is_urgent(view);
    bool user_visible = bamf_view_user_visible(view);

    if (any_urgent)
    {
      if (urgent)
        windows.push_back(xid);
    }
    else if (any_user_visible && !urgent)
    {
      if (user_visible)
        windows.push_back(xid);
    }
    else
    {
      if (urgent || user_visible)
      {
        windows.clear();
        any_visible = false;
        any_urgent = (any_urgent || urgent);
        any_user_visible = (any_user_visible || user_visible);
      }

      windows.push_back(xid);
    }

    if (wm->IsWindowOnCurrentDesktop(xid) && wm->IsWindowVisible(xid))
    {
      any_visible = true;
    }
  }

  g_list_free(children);

  auto visibility = WindowManager::FocusVisibility::OnlyVisible;

  if (arg.source != ActionArg::SWITCHER)
  {
    if (any_visible)
    {
      visibility = WindowManager::FocusVisibility::ForceUnminimizeInvisible;
    }
    else
    {
      visibility = WindowManager::FocusVisibility::ForceUnminimizeOnCurrentDesktop;
    }
  }

  bool only_top_win = !any_urgent;
  wm->FocusWindowGroup(windows, visibility, arg.monitor, only_top_win);
}

Here is the call graph for this function:

Here is the caller graph for this function:

nux::Point3 unity::launcher::LauncherIcon::GetCenter ( int  monitor) [virtual, inherited]

Implements unity::launcher::AbstractLauncherIcon.

Definition at line 699 of file LauncherIcon.cpp.

{
  return _center[monitor];
}

Here is the caller graph for this function:

std::vector< nux::Point3 > unity::launcher::LauncherIcon::GetCenters ( ) [protected, inherited]

Definition at line 710 of file LauncherIcon.cpp.

{
  return _center;
}

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:

Definition at line 1141 of file BamfLauncherIcon.cpp.

{
  std::string const& desktop_file = DesktopFile();

  return DesktopUtilities::GetDesktopID(desktop_file);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Implements unity::launcher::AbstractLauncherIcon.

Definition at line 820 of file LauncherIcon.cpp.

{
  return _icon_type;
}
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:

std::list< DbusmenuMenuitem * > unity::launcher::BamfLauncherIcon::GetMenus ( ) [protected, virtual]

Reimplemented from unity::launcher::LauncherIcon.

Definition at line 954 of file BamfLauncherIcon.cpp.

{
  std::list<DbusmenuMenuitem*> result;
  bool first_separator_needed = false;
  DbusmenuMenuitem* item = nullptr;

  // FIXME for O: hack around the wrong abstraction
  UpdateMenus();

  for (auto it = _menu_clients.begin(); it != _menu_clients.end(); ++it)
  {
    GList* child = nullptr;
    DbusmenuClient* client = it->second;
    if (!client)
      continue;
    DbusmenuMenuitem* root = dbusmenu_client_get_root(client);

    if (!root || !dbusmenu_menuitem_property_get_bool(root, DBUSMENU_MENUITEM_PROP_VISIBLE))
      continue;

    for (child = dbusmenu_menuitem_get_children(root); child; child = child->next)
    {
      DbusmenuMenuitem* item = (DbusmenuMenuitem*) child->data;

      if (!item || !DBUSMENU_IS_MENUITEM(item))
        continue;

      if (dbusmenu_menuitem_property_get_bool(item, DBUSMENU_MENUITEM_PROP_VISIBLE))
      {
        first_separator_needed = true;
        dbusmenu_menuitem_property_set_bool(item, "unity-use-markup", FALSE);

        result.push_back(item);
      }
    }
  }

  // FIXME: this should totally be added as a _menu_client
  if (DBUSMENU_IS_MENUITEM(_menu_desktop_shortcuts.RawPtr()))
  {
    GList* child = nullptr;

    for (child = dbusmenu_menuitem_get_children(_menu_desktop_shortcuts); child; child = child->next)
    {
      DbusmenuMenuitem* item = (DbusmenuMenuitem*) child->data;

      if (!item)
        continue;

      first_separator_needed = true;

      result.push_back(item);
    }
  }

  if (first_separator_needed)
  {
    auto first_sep = _menu_items_extra.find("FirstSeparator");
    if (first_sep != _menu_items_extra.end())
    {
      item = first_sep->second;
    }
    else
    {
      item = dbusmenu_menuitem_new();
      dbusmenu_menuitem_property_set(item,
                                     DBUSMENU_MENUITEM_PROP_TYPE,
                                     DBUSMENU_CLIENT_TYPES_SEPARATOR);
      _menu_items_extra["FirstSeparator"] = glib::Object<DbusmenuMenuitem>(item);
    }
    result.push_back(item);
  }

  auto app_name_item = _menu_items_extra.find("AppName");
  if (app_name_item != _menu_items_extra.end())
  {
    item = app_name_item->second;
  }
  else
  {
    glib::String app_name(g_markup_escape_text(BamfName().c_str(), -1));
    std::ostringstream bold_app_name;
    bold_app_name << "<b>" << app_name << "</b>";

    item = dbusmenu_menuitem_new();
    dbusmenu_menuitem_property_set(item,
                                   DBUSMENU_MENUITEM_PROP_LABEL,
                                   bold_app_name.str().c_str());
    dbusmenu_menuitem_property_set_bool(item,
                                        DBUSMENU_MENUITEM_PROP_ENABLED,
                                        true);
    dbusmenu_menuitem_property_set_bool(item,
                                        "unity-use-markup",
                                        true);

    _gsignals.Add(new glib::Signal<void, DbusmenuMenuitem*, int>(item, DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED,
                                    [&] (DbusmenuMenuitem*, int) {
                                      auto idle = std::make_shared<glib::Idle>();
                                      _source_manager.Add(idle);
                                      idle->Run([&] {
                                        ActivateLauncherIcon(ActionArg());
                                        return false;
                                      });
                                    }));

    _menu_items_extra["AppName"] = glib::Object<DbusmenuMenuitem>(item);
  }
  result.push_back(item);

  auto second_sep = _menu_items_extra.find("SecondSeparator");
  if (second_sep != _menu_items_extra.end())
  {
    item = second_sep->second;
  }
  else
  {
    item = dbusmenu_menuitem_new();
    dbusmenu_menuitem_property_set(item,
                                   DBUSMENU_MENUITEM_PROP_TYPE,
                                   DBUSMENU_CLIENT_TYPES_SEPARATOR);
    _menu_items_extra["SecondSeparator"] = glib::Object<DbusmenuMenuitem>(item);
  }
  result.push_back(item);

  EnsureMenuItemsReady();

  for (auto it_m = _menu_items.begin(); it_m != _menu_items.end(); ++it_m)
  {
    if (!IsRunning() && it_m->first == "Quit")
      continue;

    bool exists = false;
    std::string label_default(dbusmenu_menuitem_property_get(it_m->second, DBUSMENU_MENUITEM_PROP_LABEL));

    for (auto menu_item : result)
    {
      const gchar* type = dbusmenu_menuitem_property_get(menu_item, DBUSMENU_MENUITEM_PROP_TYPE);
      if (type == nullptr)//(g_strcmp0 (type, DBUSMENU_MENUITEM_PROP_LABEL) == 0)
      {
        std::string label_menu(dbusmenu_menuitem_property_get(menu_item, DBUSMENU_MENUITEM_PROP_LABEL));
        if (label_menu == label_default)
        {
          exists = true;
          break;
        }
      }
    }

    if (!exists)
      result.push_back(it_m->second);
  }

  return result;
}

Here is the call graph for this function:

std::string unity::launcher::BamfLauncherIcon::GetName ( ) const [protected, virtual]

Reimplemented from unity::launcher::SimpleLauncherIcon.

Reimplemented in unity::launcher::SoftwareCenterLauncherIcon.

Definition at line 1337 of file BamfLauncherIcon.cpp.

{
  return "BamfLauncherIcon";
}
float unity::launcher::LauncherIcon::GetProgress ( ) [virtual, inherited]

Implements unity::launcher::AbstractLauncherIcon.

Definition at line 906 of file LauncherIcon.cpp.

{
  return _progress;
}
bool unity::launcher::LauncherIcon::GetQuirk ( LauncherIcon::Quirk  quirk) const [virtual, inherited]

Implements unity::launcher::AbstractLauncherIcon.

Definition at line 826 of file LauncherIcon.cpp.

{
  return _quirks[quirk];
}

Here is the caller graph for this function:

struct timespec unity::launcher::LauncherIcon::GetQuirkTime ( LauncherIcon::Quirk  quirk) [read, virtual, inherited]

Implements unity::launcher::AbstractLauncherIcon.

Definition at line 890 of file LauncherIcon.cpp.

{
  return _quirk_times[quirk];
}
std::string unity::launcher::BamfLauncherIcon::GetRemoteUri ( ) [protected, virtual]

Reimplemented from unity::launcher::LauncherIcon.

Definition at line 1148 of file BamfLauncherIcon.cpp.

{
  if (_remote_uri.empty())
  {
    const std::string prefix = "application://";
    std::string const& desktop_id = GetDesktopID();

    if (!desktop_id.empty())
    {
      _remote_uri = prefix + desktop_id;
    }
  }

  return _remote_uri;
}

Here is the call graph for this function:

nux::Point3 unity::launcher::LauncherIcon::GetSavedCenter ( int  monitor) [virtual, inherited]

Implements unity::launcher::AbstractLauncherIcon.

Definition at line 705 of file LauncherIcon.cpp.

{
  return _saved_center[monitor];
}
guint64 unity::launcher::LauncherIcon::GetShortcut ( ) [virtual, inherited]

Implements unity::launcher::AbstractLauncherIcon.

Definition at line 492 of file LauncherIcon.cpp.

{
  return _shortcut;
}
const std::set< std::string > & unity::launcher::BamfLauncherIcon::GetSupportedTypes ( ) [private]

Definition at line 1288 of file BamfLauncherIcon.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nux::BaseTexture * unity::launcher::SimpleLauncherIcon::GetTextureForSize ( int  size) [virtual, inherited]

Implements unity::launcher::LauncherIcon.

Definition at line 100 of file SimpleLauncherIcon.cpp.

{
  if (texture_map[size] != 0)
    return texture_map[size];

  std::string icon_string(icon_name());

  if (icon_string.empty())
    return 0;

  if (icon_string[0] == '/')
    texture_map[size] = TextureFromPath(icon_string.c_str(), size);
  else
    texture_map[size] = TextureFromGtkTheme(icon_string.c_str(), size);
  return texture_map[size];
}

Here is the call graph for this function:

std::vector< nux::Vector4 > & unity::ui::IconTextureSource::GetTransform ( TransformIndex  index,
int  monitor 
) [inherited]

Definition at line 34 of file IconTextureSource.cpp.

{
  auto iter = transform_map[monitor].find(index);
  if (iter == transform_map[monitor].end())
  {
    auto iter2 = transform_map[monitor].insert(std::map<TransformIndex, std::vector<nux::Vector4> >::value_type(index, std::vector<nux::Vector4>(4)));
    return iter2.first->second;
  }

  return iter->second;
}

Here is the caller graph for this function:

GtkIconTheme * unity::launcher::LauncherIcon::GetUnityTheme ( ) [protected, inherited]

Definition at line 328 of file LauncherIcon.cpp.

{
  // The theme object is invalid as soon as you add a new icon to change the theme.
  // invalidate the cache then and rebuild the theme the first time after a icon theme update.
  if (!GTK_IS_ICON_THEME(_unity_theme.RawPtr()))
  {
    _unity_theme =  gtk_icon_theme_new();
    gtk_icon_theme_set_custom_theme(_unity_theme, UNITY_THEME_NAME.c_str());
  }
  return _unity_theme;
}

Here is the call graph for this function:

Here is the caller graph for this function:

std::vector< Window > unity::launcher::BamfLauncherIcon::GetWindows ( WindowFilterMask  filter = 0,
int  monitor = -1 
) [private]

Definition at line 347 of file BamfLauncherIcon.cpp.

{
  WindowManager* wm = WindowManager::Default();
  std::vector<Window> results;
  GList* children, *l;

  monitor = (filter & WindowFilter::ON_ALL_MONITORS) ? -1 : monitor;
  bool mapped = (filter & WindowFilter::MAPPED);
  bool user_visible = (filter & WindowFilter::USER_VISIBLE);
  bool current_desktop = (filter & WindowFilter::ON_CURRENT_DESKTOP);

  children = bamf_view_get_children(BAMF_VIEW(_bamf_app.RawPtr()));
  for (l = children; l; l = l->next)
  {
    if (!BAMF_IS_WINDOW(l->data))
      continue;

    auto window = static_cast<BamfWindow*>(l->data);
    auto view = static_cast<BamfView*>(l->data);

    if ((monitor >= 0 && bamf_window_get_monitor(window) == monitor) || monitor < 0)
    {
      if ((user_visible && bamf_view_user_visible(view)) || !user_visible)
      {
        guint32 xid = bamf_window_get_xid(window);

        if ((mapped && wm->IsWindowMapped(xid)) || !mapped)
        {
          if ((current_desktop && wm->IsWindowOnCurrentDesktop(xid)) || !current_desktop)
          {
            results.push_back(xid);
          }
        }
      }
    }
  }

  g_list_free(children);
  return results;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nux::Color unity::launcher::LauncherIcon::GlowColor ( ) [virtual, inherited]

Implements unity::ui::IconTextureSource.

Reimplemented in unity::launcher::BFBLauncherIcon, and unity::launcher::HudLauncherIcon.

Definition at line 237 of file LauncherIcon.cpp.

{
  return _glow_color;
}
bool unity::launcher::BamfLauncherIcon::HandlesSpread ( ) [inline, protected, virtual]

Reimplemented from unity::launcher::LauncherIcon.

Definition at line 93 of file BamfLauncherIcon.h.

{ return true; }
void unity::launcher::LauncherIcon::HideTooltip ( ) [virtual, inherited]

Implements unity::launcher::AbstractLauncherIcon.

Definition at line 654 of file LauncherIcon.cpp.

{
  if (_tooltip)
    _tooltip->ShowWindow(false);
  tooltip_visible.emit(nux::ObjectPtr<nux::View>(nullptr));
}

Here is the caller graph for this function:

void unity::launcher::LauncherIcon::InsertEntryRemote ( LauncherEntryRemote::Ptr const &  remote) [virtual, inherited]

Implements unity::launcher::AbstractLauncherIcon.

Definition at line 1034 of file LauncherIcon.cpp.

{
  if (std::find(_entry_list.begin(), _entry_list.end(), remote) != _entry_list.end())
    return;

  _entry_list.push_front(remote);
  AddChild(remote.get());

  remote->emblem_changed.connect(sigc::mem_fun(this, &LauncherIcon::OnRemoteEmblemChanged));
  remote->count_changed.connect(sigc::mem_fun(this, &LauncherIcon::OnRemoteCountChanged));
  remote->progress_changed.connect(sigc::mem_fun(this, &LauncherIcon::OnRemoteProgressChanged));
  remote->quicklist_changed.connect(sigc::mem_fun(this, &LauncherIcon::OnRemoteQuicklistChanged));

  remote->emblem_visible_changed.connect(sigc::mem_fun(this, &LauncherIcon::OnRemoteEmblemVisibleChanged));
  remote->count_visible_changed.connect(sigc::mem_fun(this, &LauncherIcon::OnRemoteCountVisibleChanged));
  remote->progress_visible_changed.connect(sigc::mem_fun(this, &LauncherIcon::OnRemoteProgressVisibleChanged));

  remote->urgent_changed.connect(sigc::mem_fun(this, &LauncherIcon::OnRemoteUrgentChanged));


  if (remote->EmblemVisible())
    OnRemoteEmblemVisibleChanged(remote.get());

  if (remote->CountVisible())
    OnRemoteCountVisibleChanged(remote.get());

  if (remote->ProgressVisible())
    OnRemoteProgressVisibleChanged(remote.get());

  if (remote->Urgent())
    OnRemoteUrgentChanged(remote.get());

  OnRemoteQuicklistChanged(remote.get());
}

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 195 of file BamfLauncherIcon.cpp.

{
  return GetQuirk(QUIRK_ACTIVE);
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool unity::launcher::LauncherIcon::IsMonoDefaultTheme ( ) [static, protected, inherited]

Definition at line 301 of file LauncherIcon.cpp.

{

  if (_current_theme_is_mono != -1)
    return (bool)_current_theme_is_mono;

  GtkIconTheme* default_theme;
  GtkIconInfo* info;
  int size = 48;

  default_theme = gtk_icon_theme_get_default();

  _current_theme_is_mono = (int)false;
  info = gtk_icon_theme_lookup_icon(default_theme, MONO_TEST_ICON.c_str(), size, (GtkIconLookupFlags)0);

  if (!info)
    return (bool)_current_theme_is_mono;

  // yeah, it's evil, but it's blessed upstream
  if (g_strrstr(gtk_icon_info_get_filename(info), "ubuntu-mono") != NULL)
    _current_theme_is_mono = (int)true;

  gtk_icon_info_free(info);
  return (bool)_current_theme_is_mono;

}

Here is the caller graph for this function:

Definition at line 200 of file BamfLauncherIcon.cpp.

{
  return GetQuirk(QUIRK_RUNNING);
}

Here is the call graph for this function:

Here is the caller graph for this function:

virtual bool unity::launcher::LauncherIcon::IsSpacer ( ) [inline, virtual, inherited]

Implements unity::launcher::AbstractLauncherIcon.

Reimplemented in unity::launcher::SpacerLauncherIcon.

Definition at line 111 of file LauncherIcon.h.

  {
    return false;
  };

Reimplemented from unity::launcher::LauncherIcon.

Definition at line 185 of file BamfLauncherIcon.cpp.

{
  return bamf_view_is_sticky(BAMF_VIEW(_bamf_app.RawPtr()));
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 205 of file BamfLauncherIcon.cpp.

{
  return GetQuirk(QUIRK_URGENT);
}

Here is the call graph for this function:

Reimplemented from unity::launcher::LauncherIcon.

Definition at line 190 of file BamfLauncherIcon.cpp.

{
  return GetQuirk(QUIRK_VISIBLE);
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool unity::launcher::LauncherIcon::IsVisibleOnMonitor ( int  monitor) const [virtual, inherited]

Implements unity::launcher::AbstractLauncherIcon.

Definition at line 743 of file LauncherIcon.cpp.

{
  return _is_visible_on_monitor[monitor];
}

Here is the caller graph for this function:

std::list< DbusmenuMenuitem * > unity::launcher::LauncherIcon::Menus ( ) [virtual, inherited]

Implements unity::launcher::AbstractLauncherIcon.

Definition at line 911 of file LauncherIcon.cpp.

{
  return GetMenus();
}

Here is the call graph for this function:

Here is the caller graph for this function:

std::string unity::launcher::BamfLauncherIcon::NameForWindow ( Window  window) [virtual]

Reimplemented from unity::launcher::LauncherIcon.

Definition at line 414 of file BamfLauncherIcon.cpp.

{
  std::string result;
  GList* children, *l;

  children = bamf_view_get_children(BAMF_VIEW(_bamf_app.RawPtr()));
  for (l = children; l; l = l->next)
  {
    if (!BAMF_IS_WINDOW(l->data))
      continue;

    if (bamf_window_get_xid(static_cast<BamfWindow*>(l->data)) == window)
    {
      auto view = static_cast<BamfView*>(l->data);
      result = glib::String(bamf_view_get_name(view)).Str();
      break;
    }
  }

  g_list_free(children);
  return result;
}

Here is the call graph for this function:

void unity::launcher::BamfLauncherIcon::OnAcceptDrop ( DndData const &  dnd_data) [protected, virtual]

Reimplemented from unity::launcher::LauncherIcon.

Definition at line 1227 of file BamfLauncherIcon.cpp.

Here is the call graph for this function:

void unity::launcher::BamfLauncherIcon::OnCenterStabilized ( std::vector< nux::Point3 >  center) [protected, virtual]

Reimplemented from unity::launcher::LauncherIcon.

Definition at line 1136 of file BamfLauncherIcon.cpp.

{
  UpdateIconGeometries(center);
}

Here is the call graph for this function:

void unity::launcher::BamfLauncherIcon::OnDndEnter ( ) [protected, virtual]

Reimplemented from unity::launcher::LauncherIcon.

Definition at line 1181 of file BamfLauncherIcon.cpp.

{
  /* Disabled, since the DND code is currently disabled as well.
  auto timeout = std::make_shared<glib::Timeout>(1000);
  _source_manager.Add(timeout, ICON_DND_OVER_TIMEOUT);
  timeout->Run([&] { OnDndHovered(); return false; });
  */
}

Definition at line 1174 of file BamfLauncherIcon.cpp.

{
  // for now, let's not do this, it turns out to be quite buggy
  //if (IsRunning())
  //  Spread(CompAction::StateInitEdgeDnd, true);
}
void unity::launcher::BamfLauncherIcon::OnDndLeave ( ) [protected, virtual]

Reimplemented from unity::launcher::LauncherIcon.

Definition at line 1190 of file BamfLauncherIcon.cpp.

{
  /* Disabled, since the DND code is currently disabled as well.
  _source_manager.Remove(ICON_DND_OVER_TIMEOUT);
  */
}
void unity::launcher::SimpleLauncherIcon::OnMouseClick ( int  button,
int  monitor,
unsigned long  key_flags = 0 
) [protected, virtual, inherited]

Definition at line 80 of file SimpleLauncherIcon.cpp.

{
}

Here is the caller graph for this function:

void unity::launcher::SimpleLauncherIcon::OnMouseDown ( int  button,
int  monitor,
unsigned long  key_flags = 0 
) [protected, virtual, inherited]

Definition at line 72 of file SimpleLauncherIcon.cpp.

{
}

Here is the caller graph for this function:

void unity::launcher::SimpleLauncherIcon::OnMouseEnter ( int  monitor) [protected, virtual, inherited]

Definition at line 84 of file SimpleLauncherIcon.cpp.

{
}

Here is the caller graph for this function:

void unity::launcher::SimpleLauncherIcon::OnMouseLeave ( int  monitor) [protected, virtual, inherited]

Definition at line 88 of file SimpleLauncherIcon.cpp.

{
}

Here is the caller graph for this function:

void unity::launcher::SimpleLauncherIcon::OnMouseUp ( int  button,
int  monitor,
unsigned long  key_flags = 0 
) [protected, virtual, inherited]

Definition at line 76 of file SimpleLauncherIcon.cpp.

{
}

Here is the caller graph for this function:

nux::DndAction unity::launcher::BamfLauncherIcon::OnQueryAcceptDrop ( DndData const &  dnd_data) [protected, virtual]

Reimplemented from unity::launcher::LauncherIcon.

Definition at line 1222 of file BamfLauncherIcon.cpp.

{
  return ValidateUrisForLaunch(dnd_data).empty() ? nux::DNDACTION_NONE : nux::DNDACTION_COPY;
}

Here is the call graph for this function:

Definition at line 1104 of file LauncherIcon.cpp.

{
  if (!remote->CountVisible())
    return;

  std::string text;
  if (remote->Count() > 9999)
    text = "****";
  else
    text = std::to_string(remote->Count());

  SetEmblemText(text);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1143 of file LauncherIcon.cpp.

{
  if (remote->CountVisible())
  {
    SetEmblemText(std::to_string(remote->Count()));
  }
  else
  {
    DeleteEmblem();
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1095 of file LauncherIcon.cpp.

{
  if (!remote->EmblemVisible())
    return;

  SetEmblemIconName(remote->Emblem());
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1134 of file LauncherIcon.cpp.

{
  if (remote->EmblemVisible())
    SetEmblemIconName(remote->Emblem());
  else
    DeleteEmblem();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1119 of file LauncherIcon.cpp.

{
  if (!remote->ProgressVisible())
    return;

  SetProgress(remote->Progress());
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1156 of file LauncherIcon.cpp.

{
  SetQuirk(QUIRK_PROGRESS, remote->ProgressVisible());

  if (remote->ProgressVisible())
    SetProgress(remote->Progress());
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1128 of file LauncherIcon.cpp.

{
  _menuclient_dynamic_quicklist = remote->Quicklist();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1088 of file LauncherIcon.cpp.

{
  _remote_urgent = remote->Urgent();
  SetQuirk(QUIRK_URGENT, remote->Urgent());
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool unity::launcher::BamfLauncherIcon::OnShouldHighlightOnDrag ( DndData const &  dnd_data) [protected, virtual]

Reimplemented from unity::launcher::LauncherIcon.

Definition at line 1197 of file BamfLauncherIcon.cpp.

{
  bool is_home_launcher = boost::algorithm::ends_with(DesktopFile(), "nautilus-home.desktop") ||
                          boost::algorithm::ends_with(DesktopFile(), "nautilus.desktop");

  if (is_home_launcher)
  {
    return true;
  }

  for (auto type : dnd_data.Types())
  {
    for (auto supported_type : GetSupportedTypes())
    {
      if (g_content_type_is_a(type.c_str(), supported_type.c_str()))
      {
        if (!dnd_data.UrisByType(type).empty())
          return true;
      }
    }
  }

  return false;
}

Here is the call graph for this function:

Definition at line 437 of file BamfLauncherIcon.cpp.

{
  if (!OwnsWindow(xid))
    return;

  Present(0.5f, 600);
  UpdateQuirkTimeDelayed(300, QUIRK_SHIMMER);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void unity::launcher::BamfLauncherIcon::OnWindowMoved ( guint32  xid) [private]

Definition at line 446 of file BamfLauncherIcon.cpp.

{
  if (!OwnsWindow(moved_win))
    return;

  auto timeout = std::make_shared<glib::Timeout>(250);
  _source_manager.Add(timeout, WINDOW_MOVE_TIMEOUT);

  timeout->Run([&] {
    EnsureWindowState();
    UpdateIconGeometries(GetCenters());

    return false;
  });
}

Here is the call graph for this function:

Here is the caller graph for this function:

void unity::launcher::LauncherIcon::OpenInstance ( ActionArg  arg) [virtual, inherited]

Implements unity::launcher::AbstractLauncherIcon.

Definition at line 222 of file LauncherIcon.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Reimplemented from unity::launcher::LauncherIcon.

Definition at line 596 of file BamfLauncherIcon.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void unity::launcher::BamfLauncherIcon::OpenInstanceWithUris ( std::set< std::string >  uris) [private]

Definition at line 556 of file BamfLauncherIcon.cpp.

{
  glib::Error error;
  glib::Object<GDesktopAppInfo> desktopInfo(g_desktop_app_info_new_from_filename(DesktopFile().c_str()));
  auto appInfo = glib::object_cast<GAppInfo>(desktopInfo);

  if (g_app_info_supports_uris(appInfo))
  {
    GList* list = nullptr;

    for (auto  it : uris)
      list = g_list_prepend(list, g_strdup(it.c_str()));

    g_app_info_launch_uris(appInfo, list, nullptr, &error);
    g_list_free_full(list, g_free);
  }
  else if (g_app_info_supports_files(appInfo))
  {
    GList* list = nullptr;

    for (auto it : uris)
    {
      GFile* file = g_file_new_for_uri(it.c_str());
      list = g_list_prepend(list, file);
    }

    g_app_info_launch(appInfo, list, nullptr, &error);
    g_list_free_full(list, g_object_unref);
  }
  else
  {
    g_app_info_launch(appInfo, nullptr, nullptr, &error);
  }

  if (error)
    g_warning("%s\n", error.Message().c_str());

  UpdateQuirkTime(QUIRK_STARTING);
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool unity::launcher::LauncherIcon::OpenQuicklist ( bool  select_first_item = false,
int  monitor = -1 
) [virtual, inherited]

Implements unity::launcher::AbstractLauncherIcon.

Definition at line 541 of file LauncherIcon.cpp.

{
  std::list<DbusmenuMenuitem*> menus = Menus();

  if (!_quicklist)
    LoadQuicklist();

  if (menus.empty())
    return false;

  if (_tooltip)
    _tooltip->ShowWindow(false);
  _quicklist->RemoveAllMenuItem();

  for (auto menu_item : menus)
  {
    QuicklistMenuItem* ql_item;

    const gchar* type = dbusmenu_menuitem_property_get(menu_item, DBUSMENU_MENUITEM_PROP_TYPE);
    const gchar* toggle_type = dbusmenu_menuitem_property_get(menu_item, DBUSMENU_MENUITEM_PROP_TOGGLE_TYPE);
    gboolean prop_visible = dbusmenu_menuitem_property_get_bool(menu_item, DBUSMENU_MENUITEM_PROP_VISIBLE);

    // Skip this item, it is invisible right now.
    if (!prop_visible)
      continue;

    if (g_strcmp0(type, DBUSMENU_CLIENT_TYPES_SEPARATOR) == 0)
    {
      ql_item = new QuicklistMenuItemSeparator(menu_item, NUX_TRACKER_LOCATION);
    }
    else if (g_strcmp0(toggle_type, DBUSMENU_MENUITEM_TOGGLE_CHECK) == 0)
    {
      ql_item = new QuicklistMenuItemCheckmark(menu_item, NUX_TRACKER_LOCATION);
    }
    else if (g_strcmp0(toggle_type, DBUSMENU_MENUITEM_TOGGLE_RADIO) == 0)
    {
      ql_item = new QuicklistMenuItemRadio(menu_item, NUX_TRACKER_LOCATION);
    }
    else //(g_strcmp0 (type, DBUSMENU_MENUITEM_PROP_LABEL) == 0)
    {
      ql_item = new QuicklistMenuItemLabel(menu_item, NUX_TRACKER_LOCATION);
    }

    _quicklist->AddMenuItem(ql_item);
  }

  if (select_first_item)
    _quicklist->SelectFirstItem();

  if (monitor < 0)
  {
    if (_last_monitor >= 0)
      monitor = _last_monitor;
    else
      monitor = 0;
  }

  nux::Geometry geo = _parent_geo[monitor];
  int tip_x = geo.x + geo.width - 4 * geo.width / 48;
  int tip_y = _center[monitor].y;

  auto win_manager = WindowManager::Default();

  if (win_manager->IsScaleActive())
    win_manager->TerminateScale();

  /* If the expo plugin is active, we need to wait it to be termated, before
   * shwing the icon quicklist. */
  if (win_manager->IsExpoActive())
  {
    on_expo_terminated_connection = win_manager->terminate_expo.connect([&, tip_x, tip_y]() {
        QuicklistManager::Default()->ShowQuicklist(_quicklist.GetPointer(), tip_x, tip_y);
        on_expo_terminated_connection.disconnect();
    });
  }
  else
  {
    QuicklistManager::Default()->ShowQuicklist(_quicklist.GetPointer(), tip_x, tip_y);
  }

  return true;
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool unity::launcher::BamfLauncherIcon::OwnsWindow ( Window  w) const [private]

Definition at line 530 of file BamfLauncherIcon.cpp.

{
  GList* children, *l;
  bool owns = false;

  if (!xid || !_bamf_app)
    return owns;

  children = bamf_view_get_children(BAMF_VIEW(_bamf_app.RawPtr()));

  for (l = children; l; l = l->next)
  {
    if (!BAMF_IS_WINDOW(l->data))
      continue;

    if (bamf_window_get_xid(static_cast<BamfWindow*>(l->data)) == xid)
    {
      owns = true;
      break;
    }
  }

  g_list_free(children);
  return owns;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void unity::launcher::LauncherIcon::Present ( float  urgency,
int  length 
) [protected, inherited]

Definition at line 765 of file LauncherIcon.cpp.

{
  if (GetQuirk(QUIRK_PRESENTED))
    return;

  if (length >= 0)
  {
    auto timeout = std::make_shared<glib::Timeout>(length);
    _source_manager.Add(timeout, PRESENT_TIMEOUT);
    timeout->Run(sigc::mem_fun(this, &LauncherIcon::OnPresentTimeout));
  }

  _present_urgency = CLAMP(present_urgency, 0.0f, 1.0f);
  SetQuirk(QUIRK_PRESENTED, true);
}

Here is the call graph for this function:

Here is the caller graph for this function:

float unity::launcher::LauncherIcon::PresentUrgency ( ) [virtual, inherited]

Implements unity::launcher::AbstractLauncherIcon.

Definition at line 759 of file LauncherIcon.cpp.

{
  return _present_urgency;
}
nux::DndAction unity::launcher::LauncherIcon::QueryAcceptDrop ( DndData const &  dnd_data) [inline, virtual, inherited]

Implements unity::launcher::AbstractLauncherIcon.

Definition at line 163 of file LauncherIcon.h.

  {
    return OnQueryAcceptDrop(dnd_data);
  }

Here is the call graph for this function:

Definition at line 855 of file BamfLauncherIcon.cpp.

{
  GList* children, *l;

  children = bamf_view_get_children(BAMF_VIEW(_bamf_app.RawPtr()));

  for (l = children; l; l = l->next)
  {
    if (!BAMF_IS_WINDOW(l->data))
      continue;

    Window xid = bamf_window_get_xid(static_cast<BamfWindow*>(l->data));
    WindowManager::Default()->Close(xid);
  }

  g_list_free(children);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void unity::launcher::LauncherIcon::RecvMouseClick ( int  button,
int  monitor,
unsigned long  key_flags = 0 
) [inherited]

Definition at line 639 of file LauncherIcon.cpp.

{
  ActionArg arg(ActionArg::LAUNCHER, button);
  arg.monitor = monitor;

  bool shift_pressed = nux::GetKeyModifierState(key_flags, nux::NUX_STATE_SHIFT);

  // Click without shift
  if (button == 1 && !shift_pressed)
    Activate(arg);
  // Middle click or click with shift
  else if ((button == 2) || (button == 1 && shift_pressed))
    OpenInstance(arg);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void unity::launcher::LauncherIcon::RecvMouseDown ( int  button,
int  monitor,
unsigned long  key_flags = 0 
) [inherited]

Definition at line 624 of file LauncherIcon.cpp.

{
  if (button == 3)
    OpenQuicklist();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void unity::launcher::LauncherIcon::RecvMouseEnter ( int  monitor) [inherited]

Definition at line 520 of file LauncherIcon.cpp.

{
  _last_monitor = monitor;
  if (QuicklistManager::Default()->Current())
  {
    // A quicklist is active
    return;
  }

  ShowTooltip();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void unity::launcher::LauncherIcon::RecvMouseLeave ( int  monitor) [inherited]

Definition at line 532 of file LauncherIcon.cpp.

{
  _last_monitor = -1;

  if (_tooltip)
    _tooltip->ShowWindow(false);
  tooltip_visible.emit(nux::ObjectPtr<nux::View>(nullptr));
}

Here is the caller graph for this function:

void unity::launcher::LauncherIcon::RecvMouseUp ( int  button,
int  monitor,
unsigned long  key_flags = 0 
) [inherited]

Definition at line 630 of file LauncherIcon.cpp.

{
  if (button == 3)
  {
    if (_quicklist && _quicklist->IsVisible())
      _quicklist->CaptureMouseDownAnyWhereElse(true);
  }
}

Here is the caller graph for this function:

std::string unity::launcher::LauncherIcon::RemoteUri ( ) [inline, virtual, inherited]

Implements unity::launcher::AbstractLauncherIcon.

Definition at line 148 of file LauncherIcon.h.

  {
    return GetRemoteUri();
  }

Here is the call graph for this function:

Reimplemented from unity::launcher::LauncherIcon.

Definition at line 170 of file BamfLauncherIcon.cpp.

{
  /* Removing the unity-seen flag to the wrapped bamf application, on remove
   * request we make sure that if the bamf application is re-opened while
   * the removal process is still ongoing, the application will be shown
   * on the launcher. Disconnecting from signals and nullifying the _bamf_app
   * we make sure that this icon won't be reused (no duplicated icon). */
  _gsignals.Disconnect(_bamf_app);
  g_object_set_qdata(G_OBJECT(_bamf_app.RawPtr()),
                     g_quark_from_static_string("unity-seen"), nullptr);
  _bamf_app = nullptr;

  SimpleLauncherIcon::Remove();
}

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::launcher::LauncherIcon::RemoveEntryRemote ( LauncherEntryRemote::Ptr const &  remote) [virtual, inherited]

Implements unity::launcher::AbstractLauncherIcon.

Definition at line 1070 of file LauncherIcon.cpp.

{
  if (std::find(_entry_list.begin(), _entry_list.end(), remote) == _entry_list.end())
    return;

  _entry_list.remove(remote);
  RemoveChild(remote.get());

  DeleteEmblem();
  SetQuirk(QUIRK_PROGRESS, false);

  if (_remote_urgent)
    SetQuirk(QUIRK_URGENT, false);

  _menuclient_dynamic_quicklist = nullptr;
}

Here is the call graph for this function:

void unity::launcher::LauncherIcon::ResetQuirkTime ( LauncherIcon::Quirk  quirk) [protected, virtual, inherited]

Implements unity::launcher::AbstractLauncherIcon.

Definition at line 883 of file LauncherIcon.cpp.

{
  _quirk_times[quirk].tv_sec = 0;
  _quirk_times[quirk].tv_nsec = 0;
}
void unity::launcher::LauncherIcon::SaveCenter ( ) [virtual, inherited]

Implements unity::launcher::AbstractLauncherIcon.

Definition at line 716 of file LauncherIcon.cpp.

Here is the call graph for this function:

void unity::launcher::LauncherIcon::SendDndEnter ( ) [inline, virtual, inherited]

Implements unity::launcher::AbstractLauncherIcon.

Definition at line 179 of file LauncherIcon.h.

  {
    OnDndEnter();
  }

Here is the call graph for this function:

void unity::launcher::LauncherIcon::SendDndLeave ( ) [inline, virtual, inherited]

Implements unity::launcher::AbstractLauncherIcon.

Definition at line 184 of file LauncherIcon.h.

  {
    OnDndLeave();
  }

Here is the call graph for this function:

void unity::launcher::LauncherIcon::SetCenter ( nux::Point3  center,
int  parent_monitor,
nux::Geometry  parent_geo 
) [virtual, inherited]

Implements unity::launcher::AbstractLauncherIcon.

Definition at line 674 of file LauncherIcon.cpp.

{
  center.x += geo.x;
  center.y += geo.y;
  _center[monitor] = center;
  _parent_geo[monitor] = geo;

  if (monitor == _last_monitor)
  {
    int tip_x, tip_y;
    tip_x = geo.x + geo.width - 4 * geo.width / 48;
    tip_y = _center[monitor].y;

    if (_quicklist && _quicklist->IsVisible())
      QuicklistManager::Default()->ShowQuicklist(_quicklist.GetPointer(), tip_x, tip_y);
    else if (_tooltip && _tooltip->IsVisible())
      _tooltip->ShowTooltipWithTipAt(tip_x, tip_y);
  }

  auto timeout = std::make_shared<glib::Timeout>(500);
  _source_manager.Add(timeout, CENTER_STABILIZE_TIMEOUT);
  timeout->Run(sigc::mem_fun(this, &LauncherIcon::OnCenterStabilizeTimeout));
}

Here is the call graph for this function:

void unity::launcher::LauncherIcon::SetEmblem ( LauncherIcon::BaseTexturePtr const &  emblem) [protected, inherited]

Definition at line 929 of file LauncherIcon.cpp.

{
  _emblem = emblem;
  EmitNeedsRedraw();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void unity::launcher::LauncherIcon::SetEmblemIconName ( std::string const &  name) [inherited]

Definition at line 936 of file LauncherIcon.cpp.

{
  BaseTexturePtr emblem;

  if (name.at(0) == '/')
    emblem = TextureFromPath(name, 22, false);
  else
    emblem = TextureFromGtkTheme(name, 22, false);

  SetEmblem(emblem);
  // Ownership isn't taken, but shared, so we need to unref here.
  emblem->UnReference();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void unity::launcher::LauncherIcon::SetEmblemText ( std::string const &  text) [inherited]

Definition at line 951 of file LauncherIcon.cpp.

{
  PangoLayout*          layout     = NULL;

  PangoContext*         pangoCtx   = NULL;
  PangoFontDescription* desc       = NULL;
  GdkScreen*            screen     = gdk_screen_get_default();    // not ref'ed
  GtkSettings*          settings   = gtk_settings_get_default();  // not ref'ed
  gchar*                fontName   = NULL;

  int width = 32;
  int height = 8 * 2;
  int font_height = height - 5;


  nux::CairoGraphics cg(CAIRO_FORMAT_ARGB32, width, height);
  cairo_t* cr = cg.GetInternalContext();

  cairo_set_operator(cr, CAIRO_OPERATOR_CLEAR);
  cairo_paint(cr);

  cairo_set_operator(cr, CAIRO_OPERATOR_OVER);


  layout = pango_cairo_create_layout(cr);

  g_object_get(settings, "gtk-font-name", &fontName, NULL);
  desc = pango_font_description_from_string(fontName);
  pango_font_description_set_absolute_size(desc, pango_units_from_double(font_height));

  pango_layout_set_font_description(layout, desc);
  pango_font_description_free(desc);

  pango_layout_set_width(layout, pango_units_from_double(width - 4.0f));
  pango_layout_set_wrap(layout, PANGO_WRAP_WORD_CHAR);
  pango_layout_set_ellipsize(layout, PANGO_ELLIPSIZE_NONE);
  pango_layout_set_markup_with_accel(layout, text.c_str(), -1, '_', NULL);

  pangoCtx = pango_layout_get_context(layout);  // is not ref'ed
  pango_cairo_context_set_font_options(pangoCtx,
                                       gdk_screen_get_font_options(screen));

  PangoRectangle logical_rect, ink_rect;
  pango_layout_get_extents(layout, &logical_rect, &ink_rect);

  /* DRAW OUTLINE */
  float radius = height / 2.0f - 1.0f;
  float inset = radius + 1.0f;

  cairo_move_to(cr, inset, height - 1.0f);
  cairo_arc(cr, inset, inset, radius, 0.5 * M_PI, 1.5 * M_PI);
  cairo_arc(cr, width - inset, inset, radius, 1.5 * M_PI, 0.5 * M_PI);
  cairo_line_to(cr, inset, height - 1.0f);

  cairo_set_source_rgba(cr, 0.35f, 0.35f, 0.35f, 1.0f);
  cairo_fill_preserve(cr);

  cairo_set_source_rgba(cr, 1.0f, 1.0f, 1.0f, 1.0f);
  cairo_set_line_width(cr, 2.0f);
  cairo_stroke(cr);

  cairo_set_line_width(cr, 1.0f);

  /* DRAW TEXT */
  cairo_move_to(cr,
                (int)((width - pango_units_to_double(logical_rect.width)) / 2.0f),
                (int)((height - pango_units_to_double(logical_rect.height)) / 2.0f - pango_units_to_double(logical_rect.y)));
  pango_cairo_show_layout(cr, layout);

  SetEmblem(texture_ptr_from_cairo_graphics(cg));

  // clean up
  g_object_unref(layout);
  g_free(fontName);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 802 of file LauncherIcon.cpp.

{
  _icon_type = type;
}

Here is the caller graph for this function:

void unity::launcher::LauncherIcon::SetProgress ( float  progress) [protected, inherited]

Definition at line 896 of file LauncherIcon.cpp.

{
  if (progress == _progress)
    return;

  _progress = progress;
  EmitNeedsRedraw();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void unity::launcher::LauncherIcon::SetQuirk ( LauncherIcon::Quirk  quirk,
bool  value 
) [virtual, inherited]

Implements unity::launcher::AbstractLauncherIcon.

Definition at line 832 of file LauncherIcon.cpp.

{
  if (_quirks[quirk] == value)
    return;

  _quirks[quirk] = value;
  if (quirk == QUIRK_VISIBLE)
    TimeUtil::SetTimeStruct(&(_quirk_times[quirk]), &(_quirk_times[quirk]), Launcher::ANIM_DURATION_SHORT);
  else
    clock_gettime(CLOCK_MONOTONIC, &(_quirk_times[quirk]));
  EmitNeedsRedraw();

  // Present on urgent as a general policy
  if (quirk == QUIRK_VISIBLE && value)
    Present(0.5f, 1500);
  if (quirk == QUIRK_URGENT)
  {
    if (value)
    {
      Present(0.5f, 1500);
    }

    UBusServer* ubus = ubus_server_get_default();
    ubus_server_send_message(ubus, UBUS_LAUNCHER_ICON_URGENT_CHANGED, g_variant_new_boolean(value));
  }

  if (quirk == QUIRK_VISIBLE)
  {
     visibility_changed.emit();
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void unity::launcher::LauncherIcon::SetShortcut ( guint64  shortcut) [virtual, inherited]

Implements unity::launcher::AbstractLauncherIcon.

Definition at line 483 of file LauncherIcon.cpp.

{
  // only relocate a digit with a digit (don't overwrite other shortcuts)
  if ((!_shortcut || (g_ascii_isdigit((gchar)_shortcut)))
      || !(g_ascii_isdigit((gchar) shortcut)))
    _shortcut = shortcut;
}

Here is the caller graph for this function:

void unity::launcher::LauncherIcon::SetSortPriority ( int  priority) [virtual, inherited]

Implements unity::launcher::AbstractLauncherIcon.

Definition at line 808 of file LauncherIcon.cpp.

{
  _sort_priority = priority;
}

Here is the caller graph for this function:

bool unity::launcher::LauncherIcon::SetTooltipText ( std::string &  target,
std::string const &  value 
) [inherited]

Definition at line 457 of file LauncherIcon.cpp.

{
  bool result = false;

  gchar* esc = g_markup_escape_text(value.c_str(), -1);
  std::string escaped = esc;
  g_free(esc);

  if (escaped != target)
  {
    target = escaped;
    if (_tooltip)
      _tooltip->SetText(target);
    result = true;
  }

  return result;
}

Here is the caller graph for this function:

void unity::launcher::LauncherIcon::SetVisibleOnMonitor ( int  monitor,
bool  visible 
) [virtual, inherited]

Implements unity::launcher::AbstractLauncherIcon.

Definition at line 733 of file LauncherIcon.cpp.

{
  if (_is_visible_on_monitor[monitor] == visible)
    return;

  _is_visible_on_monitor[monitor] = visible;
  EmitNeedsRedraw();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void unity::launcher::LauncherIcon::SetWindowVisibleOnMonitor ( bool  val,
int  monitor 
) [protected, inherited]

Definition at line 723 of file LauncherIcon.cpp.

{
  if (_has_visible_window[monitor] == val)
    return;

  _has_visible_window[monitor] = val;
  EmitNeedsRedraw();
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool unity::launcher::LauncherIcon::ShouldHighlightOnDrag ( DndData const &  dnd_data) [inline, virtual, inherited]

Implements unity::launcher::AbstractLauncherIcon.

Definition at line 169 of file LauncherIcon.h.

  {
    return OnShouldHighlightOnDrag(dnd_data);
  }

Here is the call graph for this function:

bool unity::launcher::BamfLauncherIcon::ShowInSwitcher ( bool  current) [virtual]

Reimplemented from unity::launcher::LauncherIcon.

Definition at line 1232 of file BamfLauncherIcon.cpp.

{
  bool result = false;

  if (IsRunning() && IsVisible())
  {
    // If current is true, we only want to show the current workspace.
    if (!current)
    {
      result = true;
    }
    else
    {
      for (int i = 0; i < max_num_monitors; i++)
      {
        if (WindowVisibleOnMonitor(i))
        {
          result = true;
          break;
        }
      }
    }
  }

  return result;
}

Here is the call graph for this function:

Definition at line 498 of file LauncherIcon.cpp.

{
  if (!tooltip_enabled || (_quicklist && _quicklist->IsVisible()))
    return;

  int tip_x = 100;
  int tip_y = 100;
  if (_last_monitor >= 0)
  {
    nux::Geometry geo = _parent_geo[_last_monitor];
    tip_x = geo.x + geo.width - 4 * geo.width / 48;
    tip_y = _center[_last_monitor].y;
  }

  if (!_tooltip)
    LoadTooltip();
  _tooltip->ShowTooltipWithTipAt(tip_x, tip_y);
  _tooltip->ShowWindow(!tooltip_text().empty());
  tooltip_visible.emit(_tooltip);
}

Here is the call graph for this function:

Here is the caller graph for this function:

int unity::launcher::LauncherIcon::SortPriority ( ) [virtual, inherited]

Implements unity::launcher::AbstractLauncherIcon.

Definition at line 814 of file LauncherIcon.cpp.

{
  return _sort_priority;
}
bool unity::launcher::BamfLauncherIcon::Spread ( bool  current_desktop,
int  state,
bool  force 
) [private]

Definition at line 674 of file BamfLauncherIcon.cpp.

{
  auto windows = GetWindows(current_desktop ? WindowFilter::ON_CURRENT_DESKTOP : 0);
  return WindowManager::Default()->ScaleWindowGroup(windows, state, force);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void unity::launcher::BamfLauncherIcon::Stick ( bool  save = true) [virtual]

Reimplemented from unity::launcher::LauncherIcon.

Definition at line 873 of file BamfLauncherIcon.cpp.

{
  if (IsSticky())
    return;

  std::string const& desktop_file = DesktopFile();
  bamf_view_set_sticky(BAMF_VIEW(_bamf_app.RawPtr()), true);

  if (save && !desktop_file.empty())
    FavoriteStore::Instance().AddFavorite(desktop_file, -1);
}

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned long long unity::launcher::BamfLauncherIcon::SwitcherPriority ( ) [virtual]

Reimplemented from unity::launcher::LauncherIcon.

Definition at line 1259 of file BamfLauncherIcon.cpp.

{
  GList* children, *l;
  unsigned long long result = 0;

  children = bamf_view_get_children(BAMF_VIEW(_bamf_app.RawPtr()));

  /* get the list of windows */
  for (l = children; l; l = l->next)
  {
    if (!BAMF_IS_WINDOW(l->data))
      continue;

    Window xid = bamf_window_get_xid(static_cast<BamfWindow*>(l->data));
    result = std::max(result, WindowManager::Default()->GetWindowActiveNumber(xid));
  }

  g_list_free(children);
  return result;
}

Here is the call graph for this function:

nux::BaseTexture * unity::launcher::LauncherIcon::TextureForSize ( int  size) [virtual, inherited]

Implements unity::ui::IconTextureSource.

Definition at line 242 of file LauncherIcon.cpp.

{
  nux::BaseTexture* result = GetTextureForSize(size);
  return result;
}

Here is the call graph for this function:

nux::BaseTexture * unity::launcher::LauncherIcon::TextureFromGtkTheme ( std::string  name,
int  size,
bool  update_glow_colors = true 
) [protected, inherited]

Definition at line 340 of file LauncherIcon.cpp.

{
  GtkIconTheme* default_theme;
  nux::BaseTexture* result = NULL;

  if (icon_name.empty())
  {
    icon_name = DEFAULT_ICON;
  }

  default_theme = gtk_icon_theme_get_default();

  // FIXME: we need to create some kind of -unity postfix to see if we are looking to the unity-icon-theme
  // for dedicated unity icons, then remove the postfix and degrade to other icon themes if not found
  if (icon_name == "workspace-switcher" && IsMonoDefaultTheme())
    result = TextureFromSpecificGtkTheme(GetUnityTheme(), icon_name, size, update_glow_colors);

  if (!result)
    result = TextureFromSpecificGtkTheme(default_theme, icon_name, size, update_glow_colors, true);

  if (!result)
  {
    if (icon_name == "folder")
      result = NULL;
    else
      result = TextureFromSpecificGtkTheme(default_theme, "folder", size, update_glow_colors);
  }

  return result;

}

Here is the call graph for this function:

Here is the caller graph for this function:

nux::BaseTexture * unity::launcher::LauncherIcon::TextureFromPath ( std::string const &  name,
int  size,
bool  update_glow_colors = true 
) [protected, inherited]

Definition at line 429 of file LauncherIcon.cpp.

{
  nux::BaseTexture* result;

  if (icon_name.empty())
    return TextureFromGtkTheme(DEFAULT_ICON, size, update_glow_colors);

  glib::Error error;
  glib::Object<GdkPixbuf> pbuf(gdk_pixbuf_new_from_file_at_size(icon_name.c_str(), size, size, &error));

  if (GDK_IS_PIXBUF(pbuf.RawPtr()))
  {
    result = nux::CreateTexture2DFromPixbuf(pbuf, true);

    if (update_glow_colors)
      ColorForIcon(pbuf, _background_color, _glow_color);
  }
  else
  {
    LOG_WARN(logger) << "Unable to load '" << icon_name
                     <<  "' icon: " << error;

    result = TextureFromGtkTheme(DEFAULT_ICON, size, update_glow_colors);
  }

  return result;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nux::BaseTexture * unity::launcher::LauncherIcon::TextureFromSpecificGtkTheme ( GtkIconTheme *  theme,
std::string const &  name,
int  size,
bool  update_glow_colors = true,
bool  is_default_theme = false 
) [protected, inherited]

Definition at line 372 of file LauncherIcon.cpp.

{
  GtkIconInfo* info;
  nux::BaseTexture* result = NULL;
  GIcon* icon;
  GtkIconLookupFlags flags = (GtkIconLookupFlags) 0;

  icon = g_icon_new_for_string(icon_name.c_str(), NULL);

  if (G_IS_ICON(icon))
  {
    info = gtk_icon_theme_lookup_by_gicon(theme, icon, size, flags);
    g_object_unref(icon);
  }
  else
  {
    info = gtk_icon_theme_lookup_icon(theme, icon_name.c_str(), size, flags);
  }

  if (!info && !is_default_theme)
    return NULL;

  if (!info)
  {
    info = gtk_icon_theme_lookup_icon(theme, DEFAULT_ICON.c_str(), size, flags);
  }

  if (gtk_icon_info_get_filename(info) == NULL)
  {
    gtk_icon_info_free(info);
    info = gtk_icon_theme_lookup_icon(theme, DEFAULT_ICON.c_str(), size, flags);
  }

  glib::Error error;
  glib::Object<GdkPixbuf> pbuf(gtk_icon_info_load_icon(info, &error));
  gtk_icon_info_free(info);

  if (GDK_IS_PIXBUF(pbuf.RawPtr()))
  {
    result = nux::CreateTexture2DFromPixbuf(pbuf, true);

    if (update_glow_colors)
      ColorForIcon(pbuf, _background_color, _glow_color);
  }
  else
  {
    LOG_WARN(logger) << "Unable to load '" << icon_name
                     <<  "' from icon theme: " << error;
  }

  return result;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 901 of file BamfLauncherIcon.cpp.

{
  if (IsSticky())
  {
    UnStick();
  }
  else
  {
    Stick();
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void unity::launcher::LauncherIcon::Unpresent ( ) [protected, inherited]

Definition at line 782 of file LauncherIcon.cpp.

{
  if (!GetQuirk(QUIRK_PRESENTED))
    return;

  _source_manager.Remove(PRESENT_TIMEOUT);
  SetQuirk(QUIRK_PRESENTED, false);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Reimplemented from unity::launcher::LauncherIcon.

Definition at line 885 of file BamfLauncherIcon.cpp.

{
  if (!IsSticky())
    return;

  std::string const& desktop_file = DesktopFile();
  BamfView* view = BAMF_VIEW(_bamf_app.RawPtr());
  bamf_view_set_sticky(view, false);

  if (bamf_view_is_closed(view) || !bamf_view_user_visible(view))
    Remove();

  if (!desktop_file.empty())
    FavoriteStore::Instance().RemoveFavorite(desktop_file);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 793 of file BamfLauncherIcon.cpp.

{
  bool last_use_custom_bg_color = use_custom_bg_color_;
  nux::Color last_bg_color(bg_color_);

  std::string const& color = DesktopUtilities::GetBackgroundColor(DesktopFile());

  use_custom_bg_color_ = !color.empty();

  if (use_custom_bg_color_)
    bg_color_ = nux::Color(ColorStrToARGB(color.c_str()));

  if (last_use_custom_bg_color != use_custom_bg_color_ ||
      last_bg_color != bg_color_)
    EmitNeedsRedraw();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 462 of file BamfLauncherIcon.cpp.

{
  const char* filename = bamf_application_get_desktop_file(_bamf_app);

  if (filename != nullptr && filename[0] != '\0' && _desktop_file != filename)
  {
    _desktop_file = filename;

    // add a file watch to the desktop file so that if/when the app is removed
    // we can remove ourself from the launcher and when it's changed
    // we can update the quicklist.
    if (_desktop_file_monitor)
      _gsignals.Disconnect(_desktop_file_monitor, "changed");

    glib::Object<GFile> desktop_file(g_file_new_for_path(_desktop_file.c_str()));
    _desktop_file_monitor = g_file_monitor_file(desktop_file, G_FILE_MONITOR_NONE,
                                                nullptr, nullptr);
    g_file_monitor_set_rate_limit(_desktop_file_monitor, 1000);

    auto sig = new glib::Signal<void, GFileMonitor*, GFile*, GFile*, GFileMonitorEvent>(_desktop_file_monitor, "changed",
                                [&] (GFileMonitor*, GFile*, GFile*, GFileMonitorEvent event_type) {
                                  switch (event_type)
                                  {
                                    case G_FILE_MONITOR_EVENT_DELETED:
                                      UnStick();
                                      break;
                                    case G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT:
                                      UpdateDesktopQuickList();
                                      UpdateBackgroundColor();
                                      break;
                                    default:
                                      break;
                                  }
                                });
    _gsignals.Add(sig);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 708 of file BamfLauncherIcon.cpp.

{
  std::string const& desktop_file = DesktopFile();

  if (desktop_file.empty())
    return;

  if (_menu_desktop_shortcuts)
  {
    for (GList *l = dbusmenu_menuitem_get_children(_menu_desktop_shortcuts); l; l = l->next)
    {
      _gsignals.Disconnect(l->data, "item-activated");
    }
  }

  _menu_desktop_shortcuts = dbusmenu_menuitem_new();
  dbusmenu_menuitem_set_root(_menu_desktop_shortcuts, TRUE);

  // Build a desktop shortcuts object and tell it that our
  // environment is Unity to handle the filtering
  _desktop_shortcuts = indicator_desktop_shortcuts_new(desktop_file.c_str(), "Unity");
  // This will get us a list of the nicks available, it should
  // always be at least one entry of NULL if there either aren't
  // any or they're filtered for the environment we're in
  const gchar** nicks = indicator_desktop_shortcuts_get_nicks(_desktop_shortcuts);

  int index = 0;
  while (nicks[index])
  {
    // Build a dbusmenu item for each nick that is the desktop
    // file that is built from it's name and includes a callback
    // to the desktop shortcuts object to execute the nick
    glib::String name(indicator_desktop_shortcuts_nick_get_name(_desktop_shortcuts,
                                                                nicks[index]));
    glib::Object<DbusmenuMenuitem> item(dbusmenu_menuitem_new());
    dbusmenu_menuitem_property_set(item, DBUSMENU_MENUITEM_PROP_LABEL, name);
    dbusmenu_menuitem_property_set_bool(item, DBUSMENU_MENUITEM_PROP_ENABLED, TRUE);
    dbusmenu_menuitem_property_set_bool(item, DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE);
    dbusmenu_menuitem_property_set(item, "shortcut-nick", nicks[index]);

    auto sig = new glib::Signal<void, DbusmenuMenuitem*, gint>(item, "item-activated",
                                [&] (DbusmenuMenuitem* item, gint) {
                                  const gchar *nick;
                                  nick = dbusmenu_menuitem_property_get(item, "shortcut-nick");
                                  indicator_desktop_shortcuts_nick_exec(_desktop_shortcuts, nick);
                                });
    _gsignals.Add(sig);

    dbusmenu_menuitem_child_append(_menu_desktop_shortcuts, item);
    index++;
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void unity::launcher::BamfLauncherIcon::UpdateIconGeometries ( std::vector< nux::Point3 >  center) [protected]

Definition at line 1109 of file BamfLauncherIcon.cpp.

{
  GList* children, *l;
  nux::Geometry geo;

  geo.width = 48;
  geo.height = 48;

  children = bamf_view_get_children(BAMF_VIEW(_bamf_app.RawPtr()));

  for (l = children; l; l = l->next)
  {
    if (!BAMF_IS_WINDOW(l->data))
      continue;

    Window xid = bamf_window_get_xid(static_cast<BamfWindow*>(l->data));
    int monitor = bamf_window_get_monitor(static_cast<BamfWindow*>(l->data));
    monitor = std::max<int>(0, std::min<int>(center.size() - 1, monitor));

    geo.x = center[monitor].x - 24;
    geo.y = center[monitor].y - 24;
    WindowManager::Default()->SetWindowIconGeometry(xid, geo);
  }

  g_list_free(children);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 810 of file BamfLauncherIcon.cpp.

{
  GList* children, *l;

  children = bamf_view_get_children(BAMF_VIEW(_bamf_app.RawPtr()));
  for (l = children; l; l = l->next)
  {
    if (!BAMF_IS_INDICATOR(l->data))
      continue;

    auto indicator = static_cast<BamfIndicator*>(l->data);
    std::string path = bamf_indicator_get_dbus_menu_path(indicator);

    // we already have this
    if (_menu_clients.find(path) != _menu_clients.end())
      continue;

    std::string address = bamf_indicator_get_remote_address(indicator);
    DbusmenuClient* client = dbusmenu_client_new(address.c_str(), path.c_str());
    _menu_clients[path] = glib::Object<DbusmenuClient>(client);
  }

  g_list_free(children);

  // add dynamic quicklist
  if (_menuclient_dynamic_quicklist && DBUSMENU_IS_CLIENT(_menuclient_dynamic_quicklist.RawPtr()))
  {
    if (_menu_clients["dynamicquicklist"] != _menuclient_dynamic_quicklist)
    {
      _menu_clients["dynamicquicklist"] = _menuclient_dynamic_quicklist;
    }
  }
  else if (_menu_clients["dynamicquicklist"])
  {
    _menu_clients.erase("dynamicquicklist");
    _menuclient_dynamic_quicklist = nullptr;
  }

  // make a client for desktop file actions
  if (!DBUSMENU_IS_MENUITEM(_menu_desktop_shortcuts.RawPtr()))
  {
    UpdateDesktopQuickList();
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 876 of file LauncherIcon.cpp.

{
  clock_gettime(CLOCK_MONOTONIC, &(_quirk_times[quirk]));
  EmitNeedsRedraw();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void unity::launcher::LauncherIcon::UpdateQuirkTimeDelayed ( guint  ms,
LauncherIcon::Quirk  quirk 
) [protected, inherited]

Definition at line 865 of file LauncherIcon.cpp.

{
  auto timeout = std::make_shared<glib::Timeout>(ms);
  _source_manager.Add(timeout, QUIRK_DELAY_TIMEOUT);
  timeout->Run([&, quirk] {
    UpdateQuirkTime(quirk);
    return false;
  });
}

Here is the call graph for this function:

Here is the caller graph for this function:

std::set< std::string > unity::launcher::BamfLauncherIcon::ValidateUrisForLaunch ( DndData const &  dnd_data) [protected]

Definition at line 1164 of file BamfLauncherIcon.cpp.

{
  std::set<std::string> result;

  for (auto uri : uris.Uris())
    result.insert(uri);

  return result;
}

Here is the call graph for this function:

Here is the caller graph for this function:

std::vector< Window > unity::launcher::BamfLauncherIcon::Windows ( ) [virtual]

Reimplemented from unity::launcher::LauncherIcon.

Definition at line 388 of file BamfLauncherIcon.cpp.

{
  return GetWindows(WindowFilter::MAPPED|WindowFilter::ON_ALL_MONITORS);
}

Here is the call graph for this function:

std::vector< Window > unity::launcher::BamfLauncherIcon::WindowsForMonitor ( int  monitor) [virtual]

Reimplemented from unity::launcher::LauncherIcon.

Definition at line 404 of file BamfLauncherIcon.cpp.

{
  WindowFilterMask filter = 0;
  filter |= WindowFilter::MAPPED;
  filter |= WindowFilter::USER_VISIBLE;
  filter |= WindowFilter::ON_CURRENT_DESKTOP;

  return GetWindows(filter, monitor);
}

Here is the call graph for this function:

std::vector< Window > unity::launcher::BamfLauncherIcon::WindowsOnViewport ( ) [virtual]

Reimplemented from unity::launcher::LauncherIcon.

Definition at line 393 of file BamfLauncherIcon.cpp.

Here is the call graph for this function:

const bool unity::launcher::LauncherIcon::WindowVisibleOnMonitor ( int  monitor) [virtual, inherited]

Implements unity::launcher::AbstractLauncherIcon.

Definition at line 160 of file LauncherIcon.cpp.

{
  return _has_visible_window[monitor];
}

Here is the caller graph for this function:

const bool unity::launcher::LauncherIcon::WindowVisibleOnViewport ( ) [virtual, inherited]

Implements unity::launcher::AbstractLauncherIcon.

Definition at line 165 of file LauncherIcon.cpp.

{
  for (int i = 0; i < max_num_monitors; ++i)
    if (_has_visible_window[i])
      return true;

  return false;
}

Member Data Documentation

Definition at line 127 of file BamfLauncherIcon.h.

int unity::launcher::LauncherIcon::_current_theme_is_mono = -1 [static, protected, inherited]

Definition at line 296 of file LauncherIcon.h.

Definition at line 131 of file BamfLauncherIcon.h.

Definition at line 138 of file BamfLauncherIcon.h.

Definition at line 136 of file BamfLauncherIcon.h.

Definition at line 139 of file BamfLauncherIcon.h.

std::map<std::string, glib::Object<DbusmenuClient> > unity::launcher::BamfLauncherIcon::_menu_clients [private]

Definition at line 133 of file BamfLauncherIcon.h.

Definition at line 137 of file BamfLauncherIcon.h.

std::map<std::string, glib::Object<DbusmenuMenuitem> > unity::launcher::BamfLauncherIcon::_menu_items [private]

Definition at line 134 of file BamfLauncherIcon.h.

std::map<std::string, glib::Object<DbusmenuMenuitem> > unity::launcher::BamfLauncherIcon::_menu_items_extra [private]

Definition at line 135 of file BamfLauncherIcon.h.

Definition at line 298 of file LauncherIcon.h.

Definition at line 130 of file BamfLauncherIcon.h.

Definition at line 345 of file LauncherIcon.h.

std::set<std::string> unity::launcher::BamfLauncherIcon::_supported_types [private]

Definition at line 132 of file BamfLauncherIcon.h.

Definition at line 128 of file BamfLauncherIcon.h.

sigc::signal<void> unity::launcher::SimpleLauncherIcon::activate [inherited]

Definition at line 46 of file SimpleLauncherIcon.h.

Definition at line 142 of file BamfLauncherIcon.h.

nux::Property<std::string> unity::launcher::SimpleLauncherIcon::icon_name [inherited]

Definition at line 43 of file SimpleLauncherIcon.h.

sigc::signal<void, int, int, unsigned long> unity::launcher::AbstractLauncherIcon::mouse_click [inherited]

Definition at line 215 of file AbstractLauncherIcon.h.

sigc::signal<void, int, int, unsigned long> unity::launcher::AbstractLauncherIcon::mouse_down [inherited]

Definition at line 213 of file AbstractLauncherIcon.h.

sigc::signal<void, int> unity::launcher::AbstractLauncherIcon::mouse_enter [inherited]

Definition at line 216 of file AbstractLauncherIcon.h.

sigc::signal<void, int> unity::launcher::AbstractLauncherIcon::mouse_leave [inherited]

Definition at line 217 of file AbstractLauncherIcon.h.

sigc::signal<void, int, int, unsigned long> unity::launcher::AbstractLauncherIcon::mouse_up [inherited]

Definition at line 214 of file AbstractLauncherIcon.h.

Definition at line 219 of file AbstractLauncherIcon.h.

Definition at line 224 of file AbstractLauncherIcon.h.

Definition at line 228 of file AbstractLauncherIcon.h.

Definition at line 225 of file AbstractLauncherIcon.h.

Definition at line 226 of file AbstractLauncherIcon.h.

Definition at line 227 of file AbstractLauncherIcon.h.

Definition at line 220 of file AbstractLauncherIcon.h.

Definition at line 122 of file AbstractLauncherIcon.h.

nux::Property<std::string> unity::launcher::AbstractLauncherIcon::tooltip_text [inherited]

Definition at line 121 of file AbstractLauncherIcon.h.

sigc::signal<void, nux::ObjectPtr<nux::View> > unity::launcher::AbstractLauncherIcon::tooltip_visible [inherited]

Definition at line 221 of file AbstractLauncherIcon.h.

Definition at line 141 of file BamfLauncherIcon.h.

Definition at line 222 of file AbstractLauncherIcon.h.


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