Back to index

unity  6.0.0
Classes | Defines | Functions
unity-quicklist-accessible.cpp File Reference
#include <glib/gi18n.h>
#include "unity-quicklist-accessible.h"
#include "unity-quicklist-menu-accessible.h"
#include "unitya11y.h"
#include "Launcher.h"
#include "QuicklistView.h"

Go to the source code of this file.

Classes

struct  _UnityQuicklistAccessiblePrivate

Defines

#define UNITY_QUICKLIST_ACCESSIBLE_GET_PRIVATE(obj)

Functions

static void unity_quicklist_accessible_class_init (UnityQuicklistAccessibleClass *klass)
 SECTION:unity-quicklist-accessible : UnityQuicklistAccessible : Implementation of the ATK interfaces for #QuicklistView : QuicklistView.
static void unity_quicklist_accessible_init (UnityQuicklistAccessible *self)
static void unity_quicklist_accessible_initialize (AtkObject *accessible, gpointer data)
static gint unity_quicklist_accessible_get_n_children (AtkObject *obj)
static AtkObject * unity_quicklist_accessible_ref_child (AtkObject *obj, gint i)
 G_DEFINE_TYPE (UnityQuicklistAccessible, unity_quicklist_accessible, NUX_TYPE_BASE_WINDOW_ACCESSIBLE)
AtkObject * unity_quicklist_accessible_new (nux::Object *object)

Class Documentation

struct _UnityQuicklistAccessiblePrivate

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

Class Members
AtkObject * menu_accessible

Define Documentation

Value:
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), UNITY_TYPE_QUICKLIST_ACCESSIBLE,  \
                                UnityQuicklistAccessiblePrivate))

Definition at line 72 of file unity-quicklist-accessible.cpp.


Function Documentation

G_DEFINE_TYPE ( UnityQuicklistAccessible  ,
unity_quicklist_accessible  ,
NUX_TYPE_BASE_WINDOW_ACCESSIBLE   
)
static void unity_quicklist_accessible_class_init ( UnityQuicklistAccessibleClass *  klass) [static]

SECTION:unity-quicklist-accessible : UnityQuicklistAccessible : Implementation of the ATK interfaces for #QuicklistView : QuicklistView.

UnityQuicklistAccessible implements the required ATK interfaces for

QuicklistView.

IMPLEMENTATION NOTES:

The desired accessible object hierarchy is the following one: Role:menu Role:menu-item Role:menu-item.

But this quicklist is also a base window, so we can't set a role menu, and then keeping it sending window messages.

So a new object, with role menu will be added to the hierarchy: QuicklistMenu. It also hide the intermediate container objects.

So we will have: Role:window (the quicklist itself) Role:menu (a dummy object having the role menu) Role:menuitem (From QuicklistView->GetChildren) Role:menuitem

Definition at line 84 of file unity-quicklist-accessible.cpp.

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

  /* AtkObject */
  atk_class->initialize = unity_quicklist_accessible_initialize;
  atk_class->get_n_children = unity_quicklist_accessible_get_n_children;
  atk_class->ref_child = unity_quicklist_accessible_ref_child;

  g_type_class_add_private(gobject_class, sizeof(UnityQuicklistAccessiblePrivate));
}

Here is the call graph for this function:

static gint unity_quicklist_accessible_get_n_children ( AtkObject *  obj) [static]

Definition at line 139 of file unity-quicklist-accessible.cpp.

{
  QuicklistView* quicklist = NULL;
  nux::Object* nux_object = NULL;

  g_return_val_if_fail(UNITY_IS_QUICKLIST_ACCESSIBLE(obj), 0);

  nux_object = nux_object_accessible_get_object(NUX_OBJECT_ACCESSIBLE(obj));
  quicklist = dynamic_cast<QuicklistView*>(nux_object);

  if (quicklist == NULL)
    return 0;
  else
    return 1;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void unity_quicklist_accessible_init ( UnityQuicklistAccessible *  self) [static]

Definition at line 98 of file unity-quicklist-accessible.cpp.

{
  UnityQuicklistAccessiblePrivate* priv =
    UNITY_QUICKLIST_ACCESSIBLE_GET_PRIVATE(self);

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

Definition at line 123 of file unity-quicklist-accessible.cpp.

{
  nux::Object* nux_object = NULL;
  QuicklistView* quicklist = NULL;

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

  nux_object = nux_object_accessible_get_object(NUX_OBJECT_ACCESSIBLE(accessible));
  quicklist = dynamic_cast<QuicklistView*>(nux_object);

  if (quicklist == NULL) /* status defunct */
    return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

AtkObject* unity_quicklist_accessible_new ( nux::Object *  object)

Definition at line 108 of file unity-quicklist-accessible.cpp.

{
  AtkObject* accessible = NULL;

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

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

  atk_object_initialize(accessible, object);

  return accessible;
}

Here is the caller graph for this function:

static AtkObject * unity_quicklist_accessible_ref_child ( AtkObject *  obj,
gint  i 
) [static]

Definition at line 156 of file unity-quicklist-accessible.cpp.

{
  UnityQuicklistAccessible* self = NULL;
  QuicklistView* quicklist = NULL;
  nux::Object* nux_object = NULL;

  g_return_val_if_fail(UNITY_IS_QUICKLIST_ACCESSIBLE(obj), NULL);
  self = UNITY_QUICKLIST_ACCESSIBLE(obj);

  nux_object = nux_object_accessible_get_object(NUX_OBJECT_ACCESSIBLE(obj));
  quicklist = dynamic_cast<QuicklistView*>(nux_object);
  if (quicklist == NULL)
    return NULL;

  if (self->priv->menu_accessible == NULL)
  {
    self->priv->menu_accessible = unity_quicklist_menu_accessible_new(quicklist);
    atk_object_set_parent(self->priv->menu_accessible, ATK_OBJECT(self));
  }

  g_object_ref(self->priv->menu_accessible);

  return self->priv->menu_accessible;
}

Here is the call graph for this function:

Here is the caller graph for this function: