Back to index

unity  6.0.0
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends
unity::QuicklistMenuItemLabel Class Reference

#include <QuicklistMenuItemLabel.h>

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

List of all members.

Public Types

typedef std::list
< Introspectable * > 
IntrospectableList

Public Member Functions

 QuicklistMenuItemLabel (DbusmenuMenuitem *item, NUX_FILE_LINE_PROTO)
 QuicklistMenuItemLabel (DbusmenuMenuitem *item, bool debug, NUX_FILE_LINE_PROTO)
 ~QuicklistMenuItemLabel ()
QuicklistMenuItemType GetItemType ()
void ItemActivated ()
void EnableLabelMarkup (bool enabled)
bool IsMarkupEnabled ()
virtual const gchar * GetLabel ()
virtual bool GetEnabled ()
virtual bool GetActive ()
virtual bool GetVisible ()
virtual bool GetSelectable ()
GVariant * Introspect ()
void AddChild (Introspectable *child)
void RemoveChild (Introspectable *child)
virtual IntrospectableList GetIntrospectableChildren ()
guint64 GetIntrospectionId () const

Public Attributes

sigc::signal< void,
QuicklistMenuItem & > 
sigChanged
sigc::signal< void,
QuicklistMenuItem * > 
sigTextChanged
sigc::signal< void,
QuicklistMenuItem * > 
sigColorChanged

Protected Member Functions

void PreLayoutManagement ()
long PostLayoutManagement (long layoutResult)
void Draw (nux::GraphicsEngine &gfxContext, bool forceDraw)
void DrawContent (nux::GraphicsEngine &gfxContext, bool forceDraw)
void PostDraw (nux::GraphicsEngine &gfxContext, bool forceDraw)
virtual const gchar * GetDefaultText ()
virtual void UpdateTexture ()
virtual int CairoSurfaceWidth ()
std::string GetName () const
void AddProperties (GVariantBuilder *builder)
void Initialize (DbusmenuMenuitem *item, bool debug)
void InitializeText ()
gchar * GetText ()
void GetTextExtents (int &width, int &height)
 Return the size of the text + size of associated radio button or check box.
void GetTextExtents (const gchar *font, int &width, int &height)
void RecvMouseEnter (int x, int y, unsigned long button_flags, unsigned long key_flags)
void RecvMouseLeave (int x, int y, unsigned long button_flags, unsigned long key_flags)
void RecvMouseUp (int x, int y, unsigned long button_flags, unsigned long key_flags)
void RecvMouseClick (int x, int y, unsigned long button_flags, unsigned long key_flags)
void RecvMouseDrag (int x, int y, int dx, int dy, unsigned long button_flags, unsigned long key_flags)
void DrawText (nux::CairoGraphics *cairo, int width, int height, nux::Color const &color)
void DrawPrelight (nux::CairoGraphics *cairo, int width, int height, nux::Color const &color)
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'.

Protected Attributes

std::string _text
nux::Color _textColor
int _pre_layout_width
int _pre_layout_height
nux::CairoGraphics * _cairoGraphics
nux::BaseTexture * _normalTexture [2]
nux::BaseTexture * _prelightTexture [2]
sigc::signal< void,
QuicklistMenuItem * > 
sigMouseEnter
sigc::signal< void,
QuicklistMenuItem * > 
sigMouseLeave
sigc::signal< void,
QuicklistMenuItem *, int, int > 
sigMouseReleased
sigc::signal< void,
QuicklistMenuItem *, int, int > 
sigMouseClick
sigc::signal< void,
QuicklistMenuItem *, int, int > 
sigMouseDrag
DbusmenuMenuitem * _menuItem
QuicklistMenuItemType _item_type
nux::Color _color
 Item rendering color factor.
bool _debug
bool _prelight
 True when the mouse is over the item.
std::string _name

Static Protected Attributes

static const int ITEM_INDENT_ABS = 16
static const int ITEM_CORNER_RADIUS_ABS = 3
static const int ITEM_MARGIN = 4

Friends

class QuicklistView

Detailed Description

Definition at line 35 of file QuicklistMenuItemLabel.h.


Member Typedef Documentation

Definition at line 34 of file Introspectable.h.


Constructor & Destructor Documentation

unity::QuicklistMenuItemLabel::QuicklistMenuItemLabel ( DbusmenuMenuitem *  item,
NUX_FILE_LINE_PROTO   
)
unity::QuicklistMenuItemLabel::QuicklistMenuItemLabel ( DbusmenuMenuitem *  item,
bool  debug,
NUX_FILE_LINE_PROTO   
)

Definition at line 54 of file QuicklistMenuItemLabel.cpp.

{}

Member Function Documentation

Definition at line 78 of file Introspectable.cpp.

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

Here is the caller graph for this function:

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

Implements unity::debug::Introspectable.

Definition at line 469 of file QuicklistMenuItem.cpp.

{
  unity::variant::BuilderWrapper(builder)
  .add(GetAbsoluteGeometry())
  .add("text", _text)
  .add("enabled", GetEnabled())
  .add("active", GetActive())
  .add("visible", GetVisible())
  .add("selectable", GetSelectable())
  .add("selected", _prelight);
}

Here is the call graph for this function:

Implements unity::QuicklistMenuItem.

Definition at line 203 of file QuicklistMenuItemLabel.cpp.

{
  if (_normalTexture[0])
    return _normalTexture[0]->GetWidth();

  return 0;
}
void unity::QuicklistMenuItemLabel::Draw ( nux::GraphicsEngine &  gfxContext,
bool  forceDraw 
) [protected]

Reimplemented from unity::QuicklistMenuItem.

Definition at line 103 of file QuicklistMenuItemLabel.cpp.

{
  // Check if the texture have been computed. If they haven't, exit the function.
  if (_normalTexture[0] == NULL)
    return;

  nux::ObjectPtr<nux::IOpenGLBaseTexture> texture;

  nux::Geometry base = GetGeometry();

  gfxContext.PushClippingRectangle(base);

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

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

  if (GetEnabled())
  {
    if (_prelight)
    {
      texture = _prelightTexture[0]->GetDeviceTexture();
    }
    else
    {
      texture = _normalTexture[0]->GetDeviceTexture();
    }
    _color = nux::color::White;
  }
  else
  {
    texture = _normalTexture[0]->GetDeviceTexture();
    _color = nux::color::White * 0.35;
  }

  gfxContext.QRP_1Tex(base.x,
                      base.y,
                      base.width,
                      base.height,
                      texture,
                      texxform,
                      _color);

  gfxContext.GetRenderStates().SetBlend(false);

  gfxContext.PopClippingRectangle();
}

Here is the call graph for this function:

void unity::QuicklistMenuItemLabel::DrawContent ( nux::GraphicsEngine &  gfxContext,
bool  forceDraw 
) [protected]

Reimplemented from unity::QuicklistMenuItem.

Definition at line 155 of file QuicklistMenuItemLabel.cpp.

{
}
void unity::QuicklistMenuItem::DrawPrelight ( nux::CairoGraphics *  cairo,
int  width,
int  height,
nux::Color const &  color 
) [protected, inherited]

Definition at line 423 of file QuicklistMenuItem.cpp.

{
  if (!cairo)
    return;

  cairo_t* cr = cairo->GetContext();

  cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
  cairo_set_source_rgba(cr, color.red, color.blue, color.green, color.alpha);
  cairo->DrawRoundedRectangle(cr, 1.0f, 0.0f, 0.0f, ITEM_CORNER_RADIUS_ABS,
                              width, height);
  cairo_fill(cr);
  cairo_destroy(cr);
}

Here is the caller graph for this function:

void unity::QuicklistMenuItem::DrawText ( nux::CairoGraphics *  cairo,
int  width,
int  height,
nux::Color const &  color 
) [protected, inherited]

Definition at line 366 of file QuicklistMenuItem.cpp.

{
  if (_text == "" || cairo == nullptr)
    return;

  cairo_t*              cr         = cairo->GetContext();
  int                   textWidth  = 0;
  int                   textHeight = 0;
  PangoLayout*          layout     = NULL;
  PangoFontDescription* desc       = NULL;
  PangoContext*         pangoCtx   = NULL;
  int                   dpi        = 0;
  GdkScreen*            screen     = gdk_screen_get_default();    // not ref'ed
  GtkSettings*          settings   = gtk_settings_get_default();  // not ref'ed
  gchar*                fontName   = NULL;

  g_object_get(settings, "gtk-font-name", &fontName, NULL);
  GetTextExtents(fontName, textWidth, textHeight);

  cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
  cairo_set_source_rgba(cr, color.red, color.blue, color.green, color.alpha);
  cairo_set_font_options(cr, gdk_screen_get_font_options(screen));
  layout = pango_cairo_create_layout(cr);
  desc = pango_font_description_from_string(fontName);
  pango_layout_set_font_description(layout, desc);
  pango_layout_set_wrap(layout, PANGO_WRAP_WORD_CHAR);
  pango_layout_set_ellipsize(layout, PANGO_ELLIPSIZE_END);
  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));
  g_object_get(settings, "gtk-xft-dpi", &dpi, NULL);
  if (dpi == -1)
  {
    // use some default DPI-value
    pango_cairo_context_set_resolution(pangoCtx, 96.0f);
  }
  else
  {
    pango_cairo_context_set_resolution(pangoCtx,
                                       (float) dpi / (float) PANGO_SCALE);
  }

  pango_layout_context_changed(layout);

  cairo_move_to(cr,
                2 * ITEM_MARGIN + ITEM_INDENT_ABS,
                (float)(height - textHeight) / 2.0f);
  pango_cairo_show_layout(cr, layout);

  // clean up
  pango_font_description_free(desc);
  g_free(fontName);
  g_object_unref(layout);
  cairo_destroy(cr);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void unity::QuicklistMenuItem::EnableLabelMarkup ( bool  enabled) [inherited]

Definition at line 439 of file QuicklistMenuItem.cpp.

{
  if (IsMarkupEnabled() != enabled)
  {
    dbusmenu_menuitem_property_set_bool(_menuItem, "unity-use-markup", enabled);

    _text = "";
    InitializeText();
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool unity::QuicklistMenuItem::GetActive ( ) [virtual, inherited]

Definition at line 196 of file QuicklistMenuItem.cpp.

{
  if (_menuItem == 0)
    return false;
  return dbusmenu_menuitem_property_get_int(_menuItem,
                                            DBUSMENU_MENUITEM_PROP_TOGGLE_STATE) == DBUSMENU_MENUITEM_TOGGLE_STATE_CHECKED;
}

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:

const gchar * unity::QuicklistMenuItemLabel::GetDefaultText ( ) [protected, virtual]

Reimplemented from unity::QuicklistMenuItem.

Definition at line 58 of file QuicklistMenuItemLabel.cpp.

{
  return "Label";
}
bool unity::QuicklistMenuItem::GetEnabled ( ) [virtual, inherited]

Definition at line 187 of file QuicklistMenuItem.cpp.

{
  if (_menuItem == 0)
    return false;
  return dbusmenu_menuitem_property_get_bool(_menuItem,
                                             DBUSMENU_MENUITEM_PROP_ENABLED);
}

Here is the caller graph for this function:

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

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

Definition at line 41 of file Introspectable.cpp.

{
  return _children;
}

Here is the caller graph for this function:

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

Definition at line 97 of file Introspectable.cpp.

{
  return _id;
}

Here is the caller graph for this function:

Definition at line 140 of file QuicklistMenuItem.cpp.

{
  return _item_type;
}

Here is the caller graph for this function:

const gchar * unity::QuicklistMenuItem::GetLabel ( ) [virtual, inherited]

Definition at line 178 of file QuicklistMenuItem.cpp.

{
  if (_menuItem == 0)
    return 0;
  return dbusmenu_menuitem_property_get(_menuItem,
                                        DBUSMENU_MENUITEM_PROP_LABEL);
}

Here is the caller graph for this function:

std::string unity::QuicklistMenuItem::GetName ( ) const [protected, virtual, inherited]

Implements unity::debug::Introspectable.

Definition at line 464 of file QuicklistMenuItem.cpp.

{
  return _name;
}
bool unity::QuicklistMenuItem::GetSelectable ( ) [virtual, inherited]

Reimplemented in unity::QuicklistMenuItemSeparator.

Definition at line 214 of file QuicklistMenuItem.cpp.

{
  return GetVisible() && GetEnabled();
}

Here is the call graph for this function:

Here is the caller graph for this function:

gchar * unity::QuicklistMenuItem::GetText ( ) [protected, inherited]

Definition at line 227 of file QuicklistMenuItem.cpp.

{
  const gchar *label;
  gchar *text;

  if (!_menuItem)
    return NULL;

  label = GetLabel();

  if (!label)
    return NULL;

  if (!IsMarkupEnabled())
  {
    text = g_markup_escape_text(label, -1);
  }
  else
  {
    text = g_strdup(label);
  }

  return text;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void unity::QuicklistMenuItem::GetTextExtents ( int &  width,
int &  height 
) [protected, inherited]

Return the size of the text + size of associated radio button or check box.

Definition at line 252 of file QuicklistMenuItem.cpp.

{
  GtkSettings* settings = gtk_settings_get_default();  // not ref'ed
  gchar*       fontName = NULL;

  g_object_get(settings, "gtk-font-name", &fontName, NULL);
  GetTextExtents(fontName, width, height);
  g_free(fontName);
}

Here is the caller graph for this function:

void unity::QuicklistMenuItem::GetTextExtents ( const gchar *  font,
int &  width,
int &  height 
) [protected, inherited]

Definition at line 262 of file QuicklistMenuItem.cpp.

{
  cairo_surface_t*      surface  = NULL;
  cairo_t*              cr       = NULL;
  PangoLayout*          layout   = NULL;
  PangoFontDescription* desc     = NULL;
  PangoContext*         pangoCtx = NULL;
  PangoRectangle        logRect  = {0, 0, 0, 0};
  int                   dpi      = 0;
  GdkScreen*            screen   = gdk_screen_get_default();    // is not ref'ed
  GtkSettings*          settings = gtk_settings_get_default();  // is not ref'ed

  // sanity check
  if (!font)
    return;

  if (_text == "")
    return;

  surface = cairo_image_surface_create(CAIRO_FORMAT_A1, 1, 1);
  cr = cairo_create(surface);
  cairo_set_font_options(cr, gdk_screen_get_font_options(screen));
  layout = pango_cairo_create_layout(cr);
  desc = pango_font_description_from_string(font);
  pango_font_description_set_weight(desc, PANGO_WEIGHT_NORMAL);
  pango_layout_set_font_description(layout, desc);
  pango_layout_set_wrap(layout, PANGO_WRAP_WORD_CHAR);
  pango_layout_set_ellipsize(layout, PANGO_ELLIPSIZE_END);
  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));
  g_object_get(settings, "gtk-xft-dpi", &dpi, NULL);
  if (dpi == -1)
  {
    // use some default DPI-value
    pango_cairo_context_set_resolution(pangoCtx, 96.0f);
  }
  else
  {
    pango_cairo_context_set_resolution(pangoCtx,
                                       (float) dpi / (float) PANGO_SCALE);
  }
  pango_layout_context_changed(layout);
  pango_layout_get_extents(layout, NULL, &logRect);

  width  = logRect.width / PANGO_SCALE;
  height = logRect.height / PANGO_SCALE;

  // clean up
  pango_font_description_free(desc);
  g_object_unref(layout);
  cairo_destroy(cr);
  cairo_surface_destroy(surface);
}
bool unity::QuicklistMenuItem::GetVisible ( ) [virtual, inherited]

Definition at line 205 of file QuicklistMenuItem.cpp.

{
  if (_menuItem == 0)
    return false;
  return dbusmenu_menuitem_property_get_bool(_menuItem,
                                             DBUSMENU_MENUITEM_PROP_VISIBLE);
}

Here is the caller graph for this function:

void unity::QuicklistMenuItem::Initialize ( DbusmenuMenuitem *  item,
bool  debug 
) [protected, inherited]

Definition at line 67 of file QuicklistMenuItem.cpp.

{
  _text        = "";
  _color       = nux::Color(1.0f, 1.0f, 1.0f, 1.0f);
  _menuItem    = DBUSMENU_MENUITEM(g_object_ref(item));
  _debug       = debug;
  _item_type   = MENUITEM_TYPE_UNKNOWN;

  _normalTexture[0]   = NULL;
  _normalTexture[1]   = NULL;
  _prelightTexture[0] = NULL;
  _prelightTexture[1] = NULL;

  if (_menuItem)
  {
    g_signal_connect(_menuItem,
                     "property-changed",
                     G_CALLBACK(OnPropertyChanged),
                     this);
    g_signal_connect(_menuItem,
                     "item-activated",
                     G_CALLBACK(OnItemActivated),
                     this);
  }

  mouse_up.connect(sigc::mem_fun(this, &QuicklistMenuItem::RecvMouseUp));
  mouse_click.connect(sigc::mem_fun(this, &QuicklistMenuItem::RecvMouseClick));
  mouse_drag.connect(sigc::mem_fun(this, &QuicklistMenuItem::RecvMouseDrag));
  mouse_enter.connect(sigc::mem_fun(this, &QuicklistMenuItem::RecvMouseEnter));
  mouse_leave.connect(sigc::mem_fun(this, &QuicklistMenuItem::RecvMouseLeave));

  _prelight = false;
}

Here is the call graph for this function:

void unity::QuicklistMenuItem::InitializeText ( ) [protected, inherited]

Definition at line 126 of file QuicklistMenuItem.cpp.

{
  if (_menuItem)
    _text = GetText();
  else
    _text = GetDefaultText();

  int textWidth = 1;
  int textHeight = 1;
  GetTextExtents(textWidth, textHeight);
  SetMinimumSize(textWidth + ITEM_INDENT_ABS + 3 * ITEM_MARGIN,
                 textHeight + 2 * ITEM_MARGIN);
}

Here is the call graph for this function:

Here is the caller 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 451 of file QuicklistMenuItem.cpp.

{
  gboolean markup;

  if (!_menuItem)
    return false;

  markup = dbusmenu_menuitem_property_get_bool(_menuItem, "unity-use-markup");
  return (markup != FALSE);
}

Here is the caller graph for this function:

Definition at line 219 of file QuicklistMenuItem.cpp.

{
  if (_debug)
    sigChanged.emit(*this);

  std::cout << "ItemActivated() called" << std::endl;
}
void unity::QuicklistMenuItemLabel::PostDraw ( nux::GraphicsEngine &  gfxContext,
bool  forceDraw 
) [protected]

Reimplemented from unity::QuicklistMenuItem.

Definition at line 161 of file QuicklistMenuItemLabel.cpp.

{
}
long unity::QuicklistMenuItemLabel::PostLayoutManagement ( long  layoutResult) [protected]

Reimplemented from unity::QuicklistMenuItem.

Definition at line 78 of file QuicklistMenuItemLabel.cpp.

{
  int w = GetBaseWidth();
  int h = GetBaseHeight();

  long result = 0;

  if (_pre_layout_width < w)
    result |= nux::eLargerWidth;
  else if (_pre_layout_width > w)
    result |= nux::eSmallerWidth;
  else
    result |= nux::eCompliantWidth;

  if (_pre_layout_height < h)
    result |= nux::eLargerHeight;
  else if (_pre_layout_height > h)
    result |= nux::eSmallerHeight;
  else
    result |= nux::eCompliantHeight;

  return result;
}

Reimplemented from unity::QuicklistMenuItem.

Definition at line 64 of file QuicklistMenuItemLabel.cpp.

{
  _pre_layout_width = GetBaseWidth();
  _pre_layout_height = GetBaseHeight();

  if (_normalTexture[0] == 0)
  {
    UpdateTexture();
  }

  QuicklistMenuItem::PreLayoutManagement();
}

Here is the call graph for this function:

void unity::QuicklistMenuItem::RecvMouseClick ( int  x,
int  y,
unsigned long  button_flags,
unsigned long  key_flags 
) [protected, inherited]

Definition at line 342 of file QuicklistMenuItem.cpp.

{
  if (!GetEnabled())
  {
    return;
  }
  sigMouseClick.emit(this, x, y);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void unity::QuicklistMenuItem::RecvMouseDrag ( int  x,
int  y,
int  dx,
int  dy,
unsigned long  button_flags,
unsigned long  key_flags 
) [protected, inherited]

Definition at line 351 of file QuicklistMenuItem.cpp.

{
  sigMouseDrag.emit(this, x, y);
}

Here is the caller graph for this function:

void unity::QuicklistMenuItem::RecvMouseEnter ( int  x,
int  y,
unsigned long  button_flags,
unsigned long  key_flags 
) [protected, inherited]

Definition at line 356 of file QuicklistMenuItem.cpp.

{
  sigMouseEnter.emit(this);
}

Here is the caller graph for this function:

void unity::QuicklistMenuItem::RecvMouseLeave ( int  x,
int  y,
unsigned long  button_flags,
unsigned long  key_flags 
) [protected, inherited]

Definition at line 361 of file QuicklistMenuItem.cpp.

{
  sigMouseLeave.emit(this);
}

Here is the caller graph for this function:

void unity::QuicklistMenuItem::RecvMouseUp ( int  x,
int  y,
unsigned long  button_flags,
unsigned long  key_flags 
) [protected, inherited]

Definition at line 337 of file QuicklistMenuItem.cpp.

{
  sigMouseReleased.emit(this, x, y);
}

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::QuicklistMenuItemLabel::UpdateTexture ( ) [protected, virtual]

Implements unity::QuicklistMenuItem.

Definition at line 167 of file QuicklistMenuItemLabel.cpp.

{
  int        width       = GetBaseWidth();
  int        height      = GetBaseHeight();

  _cairoGraphics = new nux::CairoGraphics(CAIRO_FORMAT_ARGB32, width, height);
  cairo_t* cr = _cairoGraphics->GetContext();

  // draw normal, unchecked version
  cairo_set_operator(cr, CAIRO_OPERATOR_CLEAR);
  cairo_paint(cr);

  DrawText(_cairoGraphics, width, height, nux::color::White);

  if (_normalTexture[0])
    _normalTexture[0]->UnReference();

  _normalTexture[0] = texture_from_cairo_graphics(*_cairoGraphics);

  // draw active/prelight, unchecked version
  cairo_set_operator(cr, CAIRO_OPERATOR_CLEAR);
  cairo_paint(cr);

  DrawPrelight(_cairoGraphics, width, height, nux::color::White);
  DrawText(_cairoGraphics, width, height, nux::color::White * 0.0f);

  if (_prelightTexture[0])
    _prelightTexture[0]->UnReference();

  _prelightTexture[0] = texture_from_cairo_graphics(*_cairoGraphics);

  // finally clean up
  cairo_destroy(cr);
  delete _cairoGraphics;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Friends And Related Function Documentation

friend class QuicklistView [friend, inherited]

Reimplemented in unity::QuicklistMenuItemSeparator.

Definition at line 145 of file QuicklistMenuItem.h.


Member Data Documentation

nux::CairoGraphics* unity::QuicklistMenuItem::_cairoGraphics [protected, inherited]

Definition at line 103 of file QuicklistMenuItem.h.

nux::Color unity::QuicklistMenuItem::_color [protected, inherited]

Item rendering color factor.

Definition at line 134 of file QuicklistMenuItem.h.

bool unity::QuicklistMenuItem::_debug [protected, inherited]

Definition at line 135 of file QuicklistMenuItem.h.

Definition at line 132 of file QuicklistMenuItem.h.

DbusmenuMenuitem* unity::QuicklistMenuItem::_menuItem [protected, inherited]

Definition at line 131 of file QuicklistMenuItem.h.

std::string unity::QuicklistMenuItem::_name [protected, inherited]

Definition at line 143 of file QuicklistMenuItem.h.

nux::BaseTexture* unity::QuicklistMenuItem::_normalTexture[2] [protected, inherited]

Definition at line 105 of file QuicklistMenuItem.h.

Definition at line 102 of file QuicklistMenuItem.h.

int unity::QuicklistMenuItem::_pre_layout_width [protected, inherited]

Definition at line 101 of file QuicklistMenuItem.h.

bool unity::QuicklistMenuItem::_prelight [protected, inherited]

True when the mouse is over the item.

Definition at line 137 of file QuicklistMenuItem.h.

nux::BaseTexture* unity::QuicklistMenuItem::_prelightTexture[2] [protected, inherited]

Definition at line 106 of file QuicklistMenuItem.h.

std::string unity::QuicklistMenuItem::_text [protected, inherited]

Definition at line 99 of file QuicklistMenuItem.h.

nux::Color unity::QuicklistMenuItem::_textColor [protected, inherited]

Definition at line 100 of file QuicklistMenuItem.h.

const int unity::QuicklistMenuItem::ITEM_CORNER_RADIUS_ABS = 3 [static, protected, inherited]

Definition at line 96 of file QuicklistMenuItem.h.

const int unity::QuicklistMenuItem::ITEM_INDENT_ABS = 16 [static, protected, inherited]

Definition at line 95 of file QuicklistMenuItem.h.

const int unity::QuicklistMenuItem::ITEM_MARGIN = 4 [static, protected, inherited]

Definition at line 97 of file QuicklistMenuItem.h.

sigc::signal<void, QuicklistMenuItem&> unity::QuicklistMenuItem::sigChanged [inherited]

Definition at line 80 of file QuicklistMenuItem.h.

Definition at line 82 of file QuicklistMenuItem.h.

sigc::signal<void, QuicklistMenuItem*, int, int> unity::QuicklistMenuItem::sigMouseClick [protected, inherited]

Definition at line 128 of file QuicklistMenuItem.h.

sigc::signal<void, QuicklistMenuItem*, int, int> unity::QuicklistMenuItem::sigMouseDrag [protected, inherited]

Definition at line 129 of file QuicklistMenuItem.h.

sigc::signal<void, QuicklistMenuItem*> unity::QuicklistMenuItem::sigMouseEnter [protected, inherited]

Definition at line 125 of file QuicklistMenuItem.h.

sigc::signal<void, QuicklistMenuItem*> unity::QuicklistMenuItem::sigMouseLeave [protected, inherited]

Definition at line 126 of file QuicklistMenuItem.h.

sigc::signal<void, QuicklistMenuItem*, int, int> unity::QuicklistMenuItem::sigMouseReleased [protected, inherited]

Definition at line 127 of file QuicklistMenuItem.h.

Definition at line 81 of file QuicklistMenuItem.h.


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