Ejemplo n.º 1
0
static AtkObject*
refSelectionCB(AtkSelection *aSelection, gint i)
{
  AtkObject* atkObj = nullptr;
  AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection));
  if (accWrap && accWrap->IsSelect()) {
    Accessible* selectedItem = accWrap->GetSelectedItem(i);
    if (!selectedItem) {
      return nullptr;
    }

    atkObj = AccessibleWrap::GetAtkObject(selectedItem);
  } else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aSelection))) {
    ProxyAccessible* selectedItem = proxy->GetSelectedItem(i);
    if (selectedItem) {
      atkObj = GetWrapperFor(selectedItem);
    }
  }

  if (atkObj) {
    g_object_ref(atkObj);
  }

  return atkObj;
}
static AtkObject*
refSelectionCB(AtkSelection *aSelection, gint i)
{
  AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection));
  if (!accWrap || !accWrap->IsSelect())
    return nullptr;

  Accessible* selectedItem = accWrap->GetSelectedItem(i);
  if (!selectedItem)
    return nullptr;

  AtkObject* atkObj = AccessibleWrap::GetAtkObject(selectedItem);
  if (atkObj)
    g_object_ref(atkObj);

  return atkObj;
}