Back to index

unity  6.0.0
Classes | Defines | Functions
unity-search-bar-accessible.cpp File Reference
#include <glib/gi18n.h>
#include "unity-search-bar-accessible.h"
#include "unitya11y.h"
#include "SearchBar.h"

Go to the source code of this file.

Classes

struct  _UnitySearchBarAccessiblePrivate

Defines

#define UNITY_SEARCH_BAR_ACCESSIBLE_GET_PRIVATE(obj)

Functions

static void unity_search_bar_accessible_class_init (UnitySearchBarAccessibleClass *klass)
static void unity_search_bar_accessible_init (UnitySearchBarAccessible *self)
static void unity_search_bar_accessible_finalize (GObject *object)
static void unity_search_bar_accessible_initialize (AtkObject *accessible, gpointer data)
AtkObject * unity_search_bar_accessible_new (nux::Object *object)
static void on_search_hint_change_cb (std::string const &s, UnitySearchBarAccessible *self)

Class Documentation

struct _UnitySearchBarAccessiblePrivate

Definition at line 55 of file unity-search-bar-accessible.cpp.


Define Documentation

Value:
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), UNITY_TYPE_SEARCH_BAR_ACCESSIBLE,  \
                                UnitySearchBarAccessiblePrivate))

Definition at line 51 of file unity-search-bar-accessible.cpp.


Function Documentation

static void on_search_hint_change_cb ( std::string const &  s,
UnitySearchBarAccessible *  self 
) [static]

Definition at line 106 of file unity-search-bar-accessible.cpp.

{
  SearchBar* search_bar = NULL;
  nux::TextEntry* text_entry = NULL;
  AtkObject* text_entry_accessible = NULL;
  nux::Object* nux_object = NULL;

  g_return_if_fail(UNITY_IS_SEARCH_BAR_ACCESSIBLE(self));

  nux_object = nux_object_accessible_get_object(NUX_OBJECT_ACCESSIBLE(self));
  search_bar = dynamic_cast<SearchBar*>(nux_object);

  if (search_bar == NULL) /* state defunct */
    return;

  text_entry = search_bar->text_entry();

  if (text_entry != NULL)
  {
    text_entry_accessible = unity_a11y_get_accessible(text_entry);
    atk_object_set_name(text_entry_accessible, s.c_str());
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void unity_search_bar_accessible_class_init ( UnitySearchBarAccessibleClass *  klass) [static]

Definition at line 62 of file unity-search-bar-accessible.cpp.

{
  GObjectClass* gobject_class = G_OBJECT_CLASS(klass);
  AtkObjectClass* atk_class = ATK_OBJECT_CLASS(klass);

  gobject_class->finalize = unity_search_bar_accessible_finalize;

  /* AtkObject */
  atk_class->initialize = unity_search_bar_accessible_initialize;

  g_type_class_add_private(gobject_class, sizeof(UnitySearchBarAccessiblePrivate));
}

Here is the call graph for this function:

static void unity_search_bar_accessible_finalize ( GObject *  object) [static]

Definition at line 85 of file unity-search-bar-accessible.cpp.

{
  G_OBJECT_CLASS(unity_search_bar_accessible_parent_class)->finalize(object);
}

Here is the caller graph for this function:

static void unity_search_bar_accessible_init ( UnitySearchBarAccessible *  self) [static]

Definition at line 76 of file unity-search-bar-accessible.cpp.

{
  UnitySearchBarAccessiblePrivate* priv =
    UNITY_SEARCH_BAR_ACCESSIBLE_GET_PRIVATE(self);

  self->priv = priv;
}
static void unity_search_bar_accessible_initialize ( AtkObject *  accessible,
gpointer  data 
) [static]

Definition at line 132 of file unity-search-bar-accessible.cpp.

{
  nux::Object* nux_object = NULL;
  SearchBar* search_bar = NULL;
  // nux::TextEntry* text_entry = NULL;

  ATK_OBJECT_CLASS(unity_search_bar_accessible_parent_class)->initialize(accessible, data);

  accessible->role = ATK_ROLE_PANEL;

  nux_object = nux_object_accessible_get_object(NUX_OBJECT_ACCESSIBLE(accessible));
  search_bar = dynamic_cast<SearchBar*>(nux_object);

  if (search_bar == NULL)
    return;

  search_bar->search_hint.changed.connect(sigc::bind(sigc::ptr_fun(on_search_hint_change_cb),
                                                     UNITY_SEARCH_BAR_ACCESSIBLE(accessible)));
}

Here is the call graph for this function:

Here is the caller graph for this function:

AtkObject* unity_search_bar_accessible_new ( nux::Object *  object)

Definition at line 91 of file unity-search-bar-accessible.cpp.

{
  AtkObject* accessible = NULL;

  g_return_val_if_fail(dynamic_cast<SearchBar*>(object), NULL);

  accessible = ATK_OBJECT(g_object_new(UNITY_TYPE_SEARCH_BAR_ACCESSIBLE, NULL));

  atk_object_initialize(accessible, object);

  return accessible;
}

Here is the caller graph for this function: