Back to index

unity  6.0.0
Classes | Defines | Functions
unity-places-group-accessible.cpp File Reference
#include <glib/gi18n.h>
#include "unity-places-group-accessible.h"
#include "unitya11y.h"
#include "PlacesGroup.h"

Go to the source code of this file.

Classes

struct  _UnityPlacesGroupAccessiblePrivate

Defines

#define UNITY_PLACES_GROUP_ACCESSIBLE_GET_PRIVATE(obj)

Functions

static void unity_places_group_accessible_class_init (UnityPlacesGroupAccessibleClass *klass)
 SECTION:unity-places_group-accessible : UnityPlacesGroupAccessible : Implementation of the ATK interfaces for #PlacesGroup : PlacesGroup.
static void unity_places_group_accessible_init (UnityPlacesGroupAccessible *self)
static void unity_places_group_accessible_initialize (AtkObject *accessible, gpointer data)
 G_DEFINE_TYPE (UnityPlacesGroupAccessible, unity_places_group_accessible, NUX_TYPE_VIEW_ACCESSIBLE)
AtkObject * unity_places_group_accessible_new (nux::Object *object)
static void ensure_proper_name (UnityPlacesGroupAccessible *self)
static void on_label_text_change_cb (nux::StaticCairoText *label, UnityPlacesGroupAccessible *self)

Class Documentation

struct _UnityPlacesGroupAccessiblePrivate

Definition at line 53 of file unity-places-group-accessible.cpp.

Class Members
gchar * stripped_name

Define Documentation

Value:
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), UNITY_TYPE_PLACES_GROUP_ACCESSIBLE, \
                                UnityPlacesGroupAccessiblePrivate))

Definition at line 49 of file unity-places-group-accessible.cpp.


Function Documentation

static void ensure_proper_name ( UnityPlacesGroupAccessible *  self) [static]

Definition at line 103 of file unity-places-group-accessible.cpp.

{
  unity::PlacesGroup* group = NULL;
  nux::Object* nux_object = NULL;
  nux::StaticCairoText* label = NULL;
  nux::StaticCairoText* expand_label = NULL;
  AtkObject* label_accessible = NULL;
  AtkObject* expand_label_accessible = NULL;

  nux_object = nux_object_accessible_get_object(NUX_OBJECT_ACCESSIBLE(self));
  group = dynamic_cast<unity::PlacesGroup*>(nux_object);

  if (group == NULL)
    return;

  label = group->GetLabel();
  expand_label = group->GetExpandLabel();


  label_accessible = unity_a11y_get_accessible(label);
  expand_label_accessible = unity_a11y_get_accessible(expand_label);

  if ((label_accessible == NULL) || (expand_label_accessible == NULL))
    return;

  atk_object_set_name(ATK_OBJECT(self), atk_object_get_name(label_accessible));

  if (expand_label->GetText() == "")
    atk_object_set_name(expand_label_accessible, atk_object_get_name(label_accessible));
}

Here is the call graph for this function:

Here is the caller graph for this function:

G_DEFINE_TYPE ( UnityPlacesGroupAccessible  ,
unity_places_group_accessible  ,
NUX_TYPE_VIEW_ACCESSIBLE   
)
static void on_label_text_change_cb ( nux::StaticCairoText label,
UnityPlacesGroupAccessible *  self 
) [static]

Definition at line 136 of file unity-places-group-accessible.cpp.

{
  ensure_proper_name(self);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void unity_places_group_accessible_class_init ( UnityPlacesGroupAccessibleClass *  klass) [static]

SECTION:unity-places_group-accessible : UnityPlacesGroupAccessible : Implementation of the ATK interfaces for #PlacesGroup : PlacesGroup.

UnityPlacesGroupAccessible implements the required ATK interfaces for

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

object is mainly used as a label

Definition at line 60 of file unity-places-group-accessible.cpp.

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

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

  g_type_class_add_private(gobject_class, sizeof(UnityPlacesGroupAccessiblePrivate));
}

Here is the call graph for this function:

static void unity_places_group_accessible_init ( UnityPlacesGroupAccessible *  self) [static]

Definition at line 72 of file unity-places-group-accessible.cpp.

{
  UnityPlacesGroupAccessiblePrivate* priv =
    UNITY_PLACES_GROUP_ACCESSIBLE_GET_PRIVATE(self);

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

Definition at line 142 of file unity-places-group-accessible.cpp.

{
  unity::PlacesGroup* group = NULL;
  nux::Object* nux_object = NULL;
  nux::StaticCairoText* label = NULL;

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

  atk_object_set_role(accessible, ATK_ROLE_PANEL);

  nux_object = nux_object_accessible_get_object(NUX_OBJECT_ACCESSIBLE(accessible));
  group = dynamic_cast<unity::PlacesGroup*>(nux_object);

  if (group == NULL)
    return;

  label = group->GetLabel();

  if (label == NULL)
    return;

  ensure_proper_name(UNITY_PLACES_GROUP_ACCESSIBLE(accessible));
  label->sigTextChanged.connect(sigc::bind(sigc::ptr_fun(on_label_text_change_cb),
                                           UNITY_PLACES_GROUP_ACCESSIBLE(accessible)));
}

Here is the call graph for this function:

Here is the caller graph for this function:

AtkObject* unity_places_group_accessible_new ( nux::Object *  object)

Definition at line 82 of file unity-places-group-accessible.cpp.

{
  AtkObject* accessible = NULL;

  g_return_val_if_fail(dynamic_cast<unity::PlacesGroup*>(object), NULL);

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

  atk_object_initialize(accessible, object);

  return accessible;
}

Here is the caller graph for this function: