Back to index

unity  6.0.0
Classes | Defines | Functions
unity-sctext-accessible.cpp File Reference
#include <glib/gi18n.h>
#include <pango/pango.h>
#include <pango/pangocairo.h>
#include "unity-sctext-accessible.h"
#include "unitya11y.h"
#include "StaticCairoText.h"

Go to the source code of this file.


struct  _UnitySctextAccessiblePrivate




static void unity_sctext_accessible_class_init (UnitySctextAccessibleClass *klass)
 SECTION:unity-sctext-accessible : UnitySctextAccessible : Implementation of the ATK interfaces for #StaticCairoText : StaticCairoText.
static void unity_sctext_accessible_init (UnitySctextAccessible *self)
static void unity_sctext_accessible_initialize (AtkObject *accessible, gpointer data)
static const gchar * unity_sctext_accessible_get_name (AtkObject *obj)
 G_DEFINE_TYPE (UnitySctextAccessible, unity_sctext_accessible, NUX_TYPE_VIEW_ACCESSIBLE)
AtkObject * unity_sctext_accessible_new (nux::Object *object)
static void on_label_text_change_cb (nux::StaticCairoText *label, UnitySctextAccessible *self)

Class Documentation

struct _UnitySctextAccessiblePrivate

Definition at line 56 of file unity-sctext-accessible.cpp.

Class Members
gchar * stripped_name

Define Documentation


Definition at line 52 of file unity-sctext-accessible.cpp.

Function Documentation

G_DEFINE_TYPE ( UnitySctextAccessible  ,
unity_sctext_accessible  ,
static void on_label_text_change_cb ( nux::StaticCairoText label,
UnitySctextAccessible *  self 
) [static]

Definition at line 101 of file unity-sctext-accessible.cpp.

  g_object_notify(G_OBJECT(self), "accessible-name");

Here is the caller graph for this function:

static void unity_sctext_accessible_class_init ( UnitySctextAccessibleClass *  klass) [static]

SECTION:unity-sctext-accessible : UnitySctextAccessible : Implementation of the ATK interfaces for #StaticCairoText : StaticCairoText.

UnitySctextAccessible implements the required ATK interfaces for

StaticCairoText, mainly exposing the text as his name, as this

object is mainly used as a label

Definition at line 63 of file unity-sctext-accessible.cpp.

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

  /* AtkObject */
  atk_class->get_name = unity_sctext_accessible_get_name;
  atk_class->initialize = unity_sctext_accessible_initialize;

  g_type_class_add_private(gobject_class, sizeof(UnitySctextAccessiblePrivate));

Here is the call graph for this function:

static const gchar * unity_sctext_accessible_get_name ( AtkObject *  obj) [static]

Definition at line 128 of file unity-sctext-accessible.cpp.

  const gchar* name = NULL;
  UnitySctextAccessible* self = NULL;

  g_return_val_if_fail(UNITY_IS_SCTEXT_ACCESSIBLE(obj), NULL);

  name = ATK_OBJECT_CLASS(unity_sctext_accessible_parent_class)->get_name(obj);
  if (name == NULL)
    nux::StaticCairoText* text = NULL;

    if (self->priv->stripped_name != NULL)
      self->priv->stripped_name = NULL;

    text = dynamic_cast<nux::StaticCairoText*>(nux_object_accessible_get_object(NUX_OBJECT_ACCESSIBLE(obj)));
    if (text != NULL)
      name = text->GetText().c_str();
      pango_parse_markup(name, -1, 0, NULL,
                         NULL, NULL);
      name = self->priv->stripped_name;

  return name;

Here is the call graph for this function:

Here is the caller graph for this function:

static void unity_sctext_accessible_init ( UnitySctextAccessible *  self) [static]

Definition at line 76 of file unity-sctext-accessible.cpp.

  UnitySctextAccessiblePrivate* priv =

  self->priv = priv;
  priv->stripped_name = NULL;
static void unity_sctext_accessible_initialize ( AtkObject *  accessible,
gpointer  data 
) [static]

Definition at line 107 of file unity-sctext-accessible.cpp.

  nux::Object* nux_object = NULL;
  nux::StaticCairoText* label = NULL;

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

  atk_object_set_role(accessible, ATK_ROLE_LABEL);

  nux_object = nux_object_accessible_get_object(NUX_OBJECT_ACCESSIBLE(accessible));
  label = dynamic_cast<nux::StaticCairoText*>(nux_object);

  if (label == NULL) /* status defunct */


Here is the call graph for this function:

Here is the caller graph for this function:

AtkObject* unity_sctext_accessible_new ( nux::Object *  object)

Definition at line 86 of file unity-sctext-accessible.cpp.

  AtkObject* accessible = NULL;

  g_return_val_if_fail(dynamic_cast<nux::StaticCairoText*>(object), NULL);

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

  atk_object_initialize(accessible, object);

  return accessible;

Here is the caller graph for this function: