Back to index

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

#include <SearchBar.h>

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

List of all members.

Public Types

typedef nux::ObjectPtr< SearchBarPtr
typedef std::list
< Introspectable * > 
IntrospectableList

Public Member Functions

 SearchBar (NUX_FILE_LINE_PROTO)
 SearchBar (bool show_filter_hint, NUX_FILE_LINE_PROTO)
void ForceSearchChanged ()
void SearchFinished ()
nux::TextEntry * text_entry () const
nux::View * show_filters () const
GVariant * Introspect ()
void AddChild (Introspectable *child)
void RemoveChild (Introspectable *child)
virtual IntrospectableList GetIntrospectableChildren ()
guint64 GetIntrospectionId () const

Public Attributes

nux::RWProperty< std::string > search_string
nux::Property< std::string > search_hint
nux::Property< bool > showing_filters
nux::Property< bool > can_refine_search
nux::ROProperty< bool > im_active
nux::ROProperty< bool > im_preedit
sigc::signal< void > activated
sigc::signal< void,
std::string const & > 
search_changed
sigc::signal< void,
std::string const & > 
live_search_reached

Protected Member Functions

virtual std::string GetChildsName () const
 Please don't override this unless you really need to. The only valid reason is if you have a property that simply must be called 'Children'.

Private Member Functions

 NUX_DECLARE_OBJECT_TYPE (SearchBar, nux::View)
void Init ()
void OnFontChanged (GtkSettings *settings, GParamSpec *pspec=NULL)
void OnSearchHintChanged ()
void Draw (nux::GraphicsEngine &GfxContext, bool force_draw)
void DrawContent (nux::GraphicsEngine &GfxContext, bool force_draw)
void OnMouseButtonDown (int x, int y, unsigned long button_flags, unsigned long key_flags)
void OnEndKeyFocus ()
void UpdateBackground (bool force)
void OnSearchChanged (nux::TextEntry *text_entry)
void OnClearClicked (int x, int y, unsigned long button_flags, unsigned long key_flags)
void OnEntryActivated ()
void OnShowingFiltersChanged (bool is_showing)
bool OnLiveSearchTimeout ()
bool OnSpinnerStartCb ()
std::string get_search_string () const
bool set_search_string (std::string const &string)
bool get_im_active () const
bool get_im_preedit () const
std::string GetName () const
void AddProperties (GVariantBuilder *builder)
bool AcceptKeyNavFocus ()
bool ShouldBeHighlighted ()

Private Attributes

bool show_filter_hint_
std::unique_ptr
< nux::AbstractPaintLayer > 
bg_layer_
std::unique_ptr
< nux::AbstractPaintLayer > 
highlight_layer_
nux::HLayout * layout_
nux::HLayout * entry_layout_
nux::LayeredLayout * layered_layout_
nux::StaticCairoTexthint_
nux::LinearLayout * expander_layout_
IMTextEntrypango_entry_
nux::View * expander_view_
nux::HLayout * filter_layout_
nux::StaticCairoTextshow_filters_
nux::VLayout * arrow_layout_
nux::SpaceLayout * arrow_top_space_
nux::SpaceLayout * arrow_bottom_space_
IconTextureexpand_icon_
int last_width_
int last_height_
glib::SignalManager sig_manager_
glib::Source::UniquePtr live_search_timeout_
glib::Source::UniquePtr start_spinner_timeout_
SearchBarSpinnerspinner_

Detailed Description

Definition at line 46 of file SearchBar.h.


Member Typedef Documentation

Definition at line 34 of file Introspectable.h.

typedef nux::ObjectPtr<SearchBar> unity::SearchBar::Ptr

Definition at line 50 of file SearchBar.h.


Constructor & Destructor Documentation

unity::SearchBar::SearchBar ( NUX_FILE_LINE_PROTO  )
unity::SearchBar::SearchBar ( bool  show_filter_hint,
NUX_FILE_LINE_PROTO   
)

Member Function Documentation

Definition at line 584 of file SearchBar.cpp.

{
  return false;
}

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::SearchBar::AddProperties ( GVariantBuilder *  builder) [private, virtual]

Implements unity::debug::Introspectable.

Definition at line 597 of file SearchBar.cpp.

{
  unity::variant::BuilderWrapper(builder)
  .add(GetAbsoluteGeometry())
  .add("has_focus", pango_entry_->HasKeyFocus())
  .add("search_string", pango_entry_->GetText())
  .add("expander-has-focus", expander_view_->HasKeyFocus())
  .add("showing-filters", showing_filters)
  .add("filter-label-x", show_filters_->GetAbsoluteX())
  .add("filter-label-y", show_filters_->GetAbsoluteY())
  .add("filter-label-width", show_filters_->GetAbsoluteWidth())
  .add("filter-label-height", show_filters_->GetAbsoluteHeight())
  .add("im_active", pango_entry_->im_active());
}

Here is the call graph for this function:

void unity::SearchBar::Draw ( nux::GraphicsEngine &  GfxContext,
bool  force_draw 
) [private]

Definition at line 360 of file SearchBar.cpp.

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

  UpdateBackground(false);

  GfxContext.PushClippingRectangle(base);
  nux::GetPainter().PaintBackground(GfxContext, base);

  bg_layer_->SetGeometry(nux::Geometry(base.x, base.y, last_width_, last_height_));
  nux::GetPainter().RenderSinglePaintLayer(GfxContext,
                                           bg_layer_->GetGeometry(),
                                           bg_layer_.get());

  if (ShouldBeHighlighted())
  {
    dash::Style& style = dash::Style::Instance();

    nux::Geometry geo(expander_view_->GetGeometry());

    geo.y -= (HIGHLIGHT_HEIGHT- geo.height) / 2;
    geo.height = HIGHLIGHT_HEIGHT;

    if (!highlight_layer_)
      highlight_layer_.reset(style.FocusOverlay(geo.width, geo.height));

    highlight_layer_->SetGeometry(geo);
    highlight_layer_->Renderlayer(GfxContext);
  }

  GfxContext.PopClippingRectangle();
}

Here is the call graph for this function:

void unity::SearchBar::DrawContent ( nux::GraphicsEngine &  GfxContext,
bool  force_draw 
) [private]

Definition at line 393 of file SearchBar.cpp.

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

  GfxContext.PushClippingRectangle(geo);

  if (highlight_layer_ && ShouldBeHighlighted() && !IsFullRedraw())
  {
    nux::GetPainter().PushLayer(GfxContext, highlight_layer_->GetGeometry(), highlight_layer_.get());
  }


  if (!IsFullRedraw())
  {
    gPainter.PushLayer(GfxContext, bg_layer_->GetGeometry(), bg_layer_.get());
  }
  else
  {
    nux::GetPainter().PushPaintLayerStack();
  }

  layout_->ProcessDraw(GfxContext, force_draw);

  if (!IsFullRedraw())
  {
    gPainter.PopBackground();
  }
  else
  {
    nux::GetPainter().PopPaintLayerStack();
  }

  GfxContext.PopClippingRectangle();
}

Definition at line 441 of file SearchBar.cpp.

{
  // this method will emit search_changed (and live_search_reached after
  // returning to mainloop) and starts animating the spinner
  live_search_timeout_.reset(new glib::Idle(glib::Source::Priority::DEFAULT));
  live_search_timeout_->Run(sigc::mem_fun(this, &SearchBar::OnLiveSearchTimeout));

  // Don't animate the spinner immediately, the searches are fast and
  // the spinner would just flicker
  start_spinner_timeout_.reset(new glib::Timeout(SPINNER_TIMEOUT * 2));
  start_spinner_timeout_->Run(sigc::mem_fun(this, &SearchBar::OnSpinnerStartCb));

  search_changed.emit(pango_entry_->GetText());
}

Here is the caller graph for this function:

bool unity::SearchBar::get_im_active ( ) const [private]

Definition at line 563 of file SearchBar.cpp.

{
  return pango_entry_->im_active();
}
bool unity::SearchBar::get_im_preedit ( ) const [private]

Definition at line 568 of file SearchBar.cpp.

{
  return pango_entry_->im_preedit();
}
std::string unity::SearchBar::get_search_string ( ) const [private]

Definition at line 547 of file SearchBar.cpp.

{
  return pango_entry_->GetText();
}
std::string unity::debug::Introspectable::GetChildsName ( ) const [protected, virtual, inherited]

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

Definition at line 92 of file Introspectable.cpp.

{
  return "Children";
}

Here is the caller graph for this function:

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

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

Definition at line 41 of file Introspectable.cpp.

{
  return _children;
}

Here is the caller graph for this function:

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

Definition at line 97 of file Introspectable.cpp.

{
  return _id;
}

Here is the caller graph for this function:

std::string unity::SearchBar::GetName ( ) const [private, virtual]

Implements unity::debug::Introspectable.

Definition at line 592 of file SearchBar.cpp.

{
  return "SearchBar";
}
void unity::SearchBar::Init ( ) [private]

Definition at line 138 of file SearchBar.cpp.

{
  dash::Style& style = dash::Style::Instance();
  nux::BaseTexture* icon = style.GetSearchMagnifyIcon();

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

  layout_ = new nux::HLayout(NUX_TRACKER_LOCATION);
  layout_->SetLeftAndRightPadding(LEFT_INTERNAL_PADDING, SEARCH_ENTRY_RIGHT_BORDER);
  layout_->SetSpaceBetweenChildren(SPACE_BETWEEN_ENTRY_AND_HIGHLIGHT);
  SetLayout(layout_);

  entry_layout_ = new nux::HLayout(NUX_TRACKER_LOCATION);
  entry_layout_->SetLeftAndRightPadding(0, 10);
  layout_->AddLayout(entry_layout_);

  spinner_ = new SearchBarSpinner();
  spinner_->SetMinMaxSize(icon->GetWidth(), icon->GetHeight());
  spinner_->mouse_click.connect(sigc::mem_fun(this, &SearchBar::OnClearClicked));
  entry_layout_->AddView(spinner_, 0, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FULL);
  entry_layout_->SetSpaceBetweenChildren(SPACE_BETWEEN_SPINNER_AND_TEXT);

  nux::HLayout* hint_layout = new nux::HLayout(NUX_TRACKER_LOCATION);

  hint_ = new nux::StaticCairoText(" ");
  hint_->SetTextColor(nux::Color(1.0f, 1.0f, 1.0f, 0.5f));
  hint_->SetFont(HINT_LABEL_DEFAULT_FONT.c_str());
  hint_layout->AddView(hint_,  0, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FULL);

  pango_entry_ = new IMTextEntry();
  pango_entry_->SetFontFamily(PANGO_ENTRY_DEFAULT_FONT_FAMILY.c_str());
  pango_entry_->SetFontSize(PANGO_ENTRY_FONT_SIZE);
  pango_entry_->text_changed.connect(sigc::mem_fun(this, &SearchBar::OnSearchChanged));
  pango_entry_->activated.connect([&]() { activated.emit(); });
  pango_entry_->cursor_moved.connect([&](int i) { QueueDraw(); });
  pango_entry_->mouse_down.connect(sigc::mem_fun(this, &SearchBar::OnMouseButtonDown));
  pango_entry_->end_key_focus.connect(sigc::mem_fun(this, &SearchBar::OnEndKeyFocus));

  layered_layout_ = new nux::LayeredLayout();
  layered_layout_->AddLayout(hint_layout);
  layered_layout_->AddLayer(pango_entry_);
  layered_layout_->SetPaintAll(true);
  layered_layout_->SetActiveLayerN(1);
  entry_layout_->AddView(layered_layout_, 1, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FIX);

  if (show_filter_hint_)
  {
    std::string filter_str(_("Filter results"));
    show_filters_ = new nux::StaticCairoText(filter_str);
    show_filters_->SetVisible(false);
    show_filters_->SetFont(SHOW_FILTERS_LABEL_DEFAULT_FONT.c_str());
    show_filters_->SetTextColor(nux::color::White);
    show_filters_->SetTextAlignment(nux::StaticCairoText::NUX_ALIGN_RIGHT);
    show_filters_->SetLines(1);

    nux::BaseTexture* arrow;
    arrow = style.GetGroupExpandIcon();
    expand_icon_ = new IconTexture(arrow,
                                   arrow->GetWidth(),
                                   arrow->GetHeight());
    expand_icon_->SetOpacity(kExpandDefaultIconOpacity);
    expand_icon_->SetMinimumSize(arrow->GetWidth(), arrow->GetHeight());
    expand_icon_->SetVisible(false);

    filter_layout_ = new nux::HLayout();
    filter_layout_->SetHorizontalInternalMargin(8);
    filter_layout_->SetLeftAndRightPadding(style.GetFilterResultsHighlightLeftPadding(), style.GetFilterResultsHighlightRightPadding());
    filter_layout_->SetContentDistribution(nux::MAJOR_POSITION_END);
    filter_layout_->AddView(show_filters_, 0, nux::MINOR_POSITION_CENTER);

    arrow_layout_  = new nux::VLayout();
    arrow_top_space_ = new nux::SpaceLayout(2, 2, 12, 12);
    arrow_bottom_space_ = new nux::SpaceLayout(2, 2, 8, 8);
    arrow_layout_->AddView(arrow_top_space_, 0, nux::MINOR_POSITION_CENTER);
    arrow_layout_->AddView(expand_icon_, 0, nux::MINOR_POSITION_CENTER);
    arrow_layout_->AddView(arrow_bottom_space_, 0, nux::MINOR_POSITION_CENTER);

    filter_layout_->AddView(arrow_layout_, 0, nux::MINOR_POSITION_CENTER);

    expander_view_ = new ExpanderView(NUX_TRACKER_LOCATION);
    expander_view_->SetVisible(false);
    expander_view_->SetLayout(filter_layout_);
    layout_->AddView(expander_view_, 0, nux::MINOR_POSITION_RIGHT, nux::MINOR_SIZE_FULL);

    int width = style.GetFilterBarWidth() +
                style.GetFilterResultsHighlightLeftPadding() +
                style.GetFilterResultsHighlightRightPadding();

    expander_view_->SetMaximumWidth(width);
    expander_view_->SetMinimumWidth(width);
    show_filters_->SetMaximumWidth(style.GetFilterBarWidth() - arrow_layout_->GetBaseWidth() - 8);

    // Lambda functions
    auto mouse_expand = [&](int, int, unsigned long, unsigned long)
    {
      showing_filters = !showing_filters;
    };

    auto key_redraw = [&](nux::Area*, bool, nux::KeyNavDirection)
    {
      QueueDraw();
    };

    auto key_expand = [&](nux::Area*)
    {
      showing_filters = !showing_filters;
    };

    // Signals
    expander_view_->mouse_click.connect(mouse_expand);
    expander_view_->key_nav_focus_change.connect(key_redraw);
    expander_view_->key_nav_focus_activate.connect(key_expand);
    show_filters_->mouse_click.connect(mouse_expand);
    expand_icon_->mouse_click.connect(mouse_expand);
  }

  sig_manager_.Add(new glib::Signal<void, GtkSettings*, GParamSpec*>
      (gtk_settings_get_default(),
       "notify::gtk-font-name",
       sigc::mem_fun(this, &SearchBar::OnFontChanged)));
  OnFontChanged(gtk_settings_get_default());

  search_hint.changed.connect([&](std::string const& s) { OnSearchHintChanged(); });
  search_string.SetGetterFunction(sigc::mem_fun(this, &SearchBar::get_search_string));
  search_string.SetSetterFunction(sigc::mem_fun(this, &SearchBar::set_search_string));
  im_active.SetGetterFunction(sigc::mem_fun(this, &SearchBar::get_im_active));
  im_preedit.SetGetterFunction(sigc::mem_fun(this, &SearchBar::get_im_preedit));
  showing_filters.changed.connect(sigc::mem_fun(this, &SearchBar::OnShowingFiltersChanged));
  can_refine_search.changed.connect([&] (bool can_refine)
  {
    if (show_filter_hint_)
    {
      expander_view_->SetVisible(can_refine);
      show_filters_->SetVisible(can_refine);
      expand_icon_->SetVisible(can_refine);
    }
  });
}

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:

unity::SearchBar::NUX_DECLARE_OBJECT_TYPE ( SearchBar  ,
nux::View   
) [private]
void unity::SearchBar::OnClearClicked ( int  x,
int  y,
unsigned long  button_flags,
unsigned long  key_flags 
) [private]

Definition at line 428 of file SearchBar.cpp.

{
  pango_entry_->SetText("");
  start_spinner_timeout_.reset();
  live_search_reached.emit("");
}
void unity::SearchBar::OnEndKeyFocus ( ) [private]

Definition at line 531 of file SearchBar.cpp.

{
  hint_->SetVisible(search_string().empty());
}

Definition at line 436 of file SearchBar.cpp.

{
  activated.emit();
}
void unity::SearchBar::OnFontChanged ( GtkSettings *  settings,
GParamSpec *  pspec = NULL 
) [private]

Definition at line 277 of file SearchBar.cpp.

{
  glib::String font_name;
  PangoFontDescription* desc;
  std::ostringstream font_desc;

  g_object_get(settings, "gtk-font-name", &font_name, NULL);

  desc = pango_font_description_from_string(font_name.Value());
  if (desc)
  {
    pango_entry_->SetFontFamily(pango_font_description_get_family(desc));
    pango_entry_->SetFontSize(PANGO_ENTRY_FONT_SIZE);
    pango_entry_->SetFontOptions(gdk_screen_get_font_options(gdk_screen_get_default()));

    font_desc << pango_font_description_get_family(desc) << " " << HINT_LABEL_FONT_STYLE << " " << HINT_LABEL_FONT_SIZE;
    hint_->SetFont(font_desc.str().c_str());

    font_desc.str("");
    font_desc.clear();
    font_desc << pango_font_description_get_family(desc) << " " << SHOW_FILTERS_LABEL_FONT_STYLE << " " << SHOW_FILTERS_LABEL_FONT_SIZE;
    show_filters_->SetFont(font_desc.str().c_str());

    pango_font_description_free(desc);
  }
}

Here is the call graph for this function:

Definition at line 336 of file SearchBar.cpp.

{
  live_search_reached.emit(pango_entry_->GetText());
  return false;
}
void unity::SearchBar::OnMouseButtonDown ( int  x,
int  y,
unsigned long  button_flags,
unsigned long  key_flags 
) [private]

Definition at line 526 of file SearchBar.cpp.

{
  hint_->SetVisible(false);
}
void unity::SearchBar::OnSearchChanged ( nux::TextEntry *  text_entry) [private]

Definition at line 313 of file SearchBar.cpp.

{
  // We don't want to set a new search string on every new character, so we add a sma
  // timeout to see if the user is typing a sentence. If more characters are added, we
  // keep restarting the timeout unti the user has actuay paused.
  live_search_timeout_.reset(new glib::Timeout(LIVE_SEARCH_TIMEOUT));
  live_search_timeout_->Run(sigc::mem_fun(this, &SearchBar::OnLiveSearchTimeout));

  // Don't animate the spinner immediately, the searches are fast and
  // the spinner would just flicker
  start_spinner_timeout_.reset(new glib::Timeout(SPINNER_TIMEOUT));
  start_spinner_timeout_->Run(sigc::mem_fun(this, &SearchBar::OnSpinnerStartCb));

  bool is_empty = pango_entry_->im_active() ? false : pango_entry_->GetText() == "";
  hint_->SetVisible(is_empty);

  pango_entry_->QueueDraw();
  hint_->QueueDraw();
  QueueDraw();

  search_changed.emit(pango_entry_->GetText());
}

Definition at line 304 of file SearchBar.cpp.

{
  gchar* tmp = g_markup_escape_text(search_hint().c_str(), -1);

  hint_->SetText(tmp);

  g_free(tmp);
}
void unity::SearchBar::OnShowingFiltersChanged ( bool  is_showing) [private]

Definition at line 348 of file SearchBar.cpp.

{
  if (show_filter_hint_)
  {
    dash::Style& style = dash::Style::Instance();
    if (is_showing)
      expand_icon_->SetTexture(style.GetGroupUnexpandIcon());
    else
      expand_icon_->SetTexture(style.GetGroupExpandIcon());
  }
}

Here is the call graph for this function:

Definition at line 342 of file SearchBar.cpp.

{
  spinner_->SetState(STATE_SEARCHING);
  return false;
}

Definition at line 85 of file Introspectable.cpp.

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

Here is the caller graph for this function:

Definition at line 457 of file SearchBar.cpp.

{
  start_spinner_timeout_.reset();

  bool is_empty = pango_entry_->im_active() ?
    false : pango_entry_->GetText() == "";
  spinner_->SetState(is_empty ? STATE_READY : STATE_CLEAR);
}

Here is the caller graph for this function:

bool unity::SearchBar::set_search_string ( std::string const &  string) [private]

Definition at line 552 of file SearchBar.cpp.

{
  pango_entry_->SetText(string.c_str());
  spinner_->SetState(string == "" ? STATE_READY : STATE_CLEAR);

  // we don't want the spinner animating in this case
  start_spinner_timeout_.reset();

  return true;
}

Definition at line 576 of file SearchBar.cpp.

{
  return ((expander_view_ && expander_view_->IsVisible() && expander_view_->HasKeyFocus()));
}
nux::View * unity::SearchBar::show_filters ( ) const

Definition at line 542 of file SearchBar.cpp.

{
  return expander_view_;
}

Here is the caller graph for this function:

nux::TextEntry * unity::SearchBar::text_entry ( ) const

Definition at line 537 of file SearchBar.cpp.

{
  return pango_entry_;
}

Here is the caller graph for this function:

void unity::SearchBar::UpdateBackground ( bool  force) [private]

Definition at line 466 of file SearchBar.cpp.

{
  int RADIUS = 5;
  nux::Geometry geo(GetGeometry());
  geo.width = layered_layout_->GetAbsoluteX() +
              layered_layout_->GetAbsoluteWidth() -
              GetAbsoluteX() +
              SEARCH_ENTRY_RIGHT_BORDER;

  LOG_DEBUG(logger) << "height: "
  << geo.height << " - "
  << layered_layout_->GetGeometry().height << " - "
  << pango_entry_->GetGeometry().height;

  if (geo.width == last_width_
      && geo.height == last_height_
      && force == false)
    return;

  last_width_ = geo.width;
  last_height_ = geo.height;

  nux::CairoGraphics cairo_graphics(CAIRO_FORMAT_ARGB32, last_width_, last_height_);
  cairo_t* cr = cairo_graphics.GetContext();

  cairo_graphics.DrawRoundedRectangle(cr,
                                      1.0f,
                                      0.5, 0.5,
                                      RADIUS,
                                      last_width_ - 1, last_height_ - 1,
                                      false);

  cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
  cairo_set_source_rgba(cr, 0.0f, 0.0f, 0.0f, 0.35f);
  cairo_fill_preserve(cr);
  cairo_set_line_width(cr, 1);
  cairo_set_source_rgba(cr, 1.0f, 1.0f, 1.0f, 0.7f);
  cairo_stroke(cr);

  cairo_destroy(cr);
  nux::BaseTexture* texture2D = texture_from_cairo_graphics(cairo_graphics);

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

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

  bg_layer_.reset(new nux::TextureLayer(texture2D->GetDeviceTexture(),
                                        texxform,
                                        nux::color::White,
                                        true,
                                        rop));

  texture2D->UnReference();
}

Here is the call graph for this function:


Member Data Documentation

sigc::signal<void> unity::SearchBar::activated

Definition at line 66 of file SearchBar.h.

nux::SpaceLayout* unity::SearchBar::arrow_bottom_space_ [private]

Definition at line 117 of file SearchBar.h.

nux::VLayout* unity::SearchBar::arrow_layout_ [private]

Definition at line 115 of file SearchBar.h.

nux::SpaceLayout* unity::SearchBar::arrow_top_space_ [private]

Definition at line 116 of file SearchBar.h.

std::unique_ptr<nux::AbstractPaintLayer> unity::SearchBar::bg_layer_ [private]

Definition at line 104 of file SearchBar.h.

Definition at line 62 of file SearchBar.h.

nux::HLayout* unity::SearchBar::entry_layout_ [private]

Definition at line 107 of file SearchBar.h.

Definition at line 118 of file SearchBar.h.

nux::LinearLayout* unity::SearchBar::expander_layout_ [private]

Definition at line 110 of file SearchBar.h.

nux::View* unity::SearchBar::expander_view_ [private]

Definition at line 112 of file SearchBar.h.

nux::HLayout* unity::SearchBar::filter_layout_ [private]

Definition at line 113 of file SearchBar.h.

std::unique_ptr<nux::AbstractPaintLayer> unity::SearchBar::highlight_layer_ [private]

Definition at line 105 of file SearchBar.h.

Definition at line 109 of file SearchBar.h.

nux::ROProperty<bool> unity::SearchBar::im_active

Definition at line 63 of file SearchBar.h.

nux::ROProperty<bool> unity::SearchBar::im_preedit

Definition at line 64 of file SearchBar.h.

Definition at line 121 of file SearchBar.h.

Definition at line 120 of file SearchBar.h.

nux::LayeredLayout* unity::SearchBar::layered_layout_ [private]

Definition at line 108 of file SearchBar.h.

nux::HLayout* unity::SearchBar::layout_ [private]

Definition at line 106 of file SearchBar.h.

sigc::signal<void, std::string const&> unity::SearchBar::live_search_reached

Definition at line 68 of file SearchBar.h.

Definition at line 124 of file SearchBar.h.

Definition at line 111 of file SearchBar.h.

sigc::signal<void, std::string const&> unity::SearchBar::search_changed

Definition at line 67 of file SearchBar.h.

nux::Property<std::string> unity::SearchBar::search_hint

Definition at line 60 of file SearchBar.h.

nux::RWProperty<std::string> unity::SearchBar::search_string

Definition at line 59 of file SearchBar.h.

Definition at line 95 of file SearchBar.h.

Definition at line 114 of file SearchBar.h.

nux::Property<bool> unity::SearchBar::showing_filters

Definition at line 61 of file SearchBar.h.

Definition at line 123 of file SearchBar.h.

Definition at line 127 of file SearchBar.h.

Definition at line 125 of file SearchBar.h.


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