コード例 #1
0
static void
getMaximumValueCB(AtkValue *obj, GValue *value)
{
  ProxyAccessible* proxy = nullptr;
  AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(obj));
  if (!accWrap) {
    proxy = GetProxy(ATK_OBJECT(obj));
    if (!proxy) {
      return;
    }
  }

  memset(value,  0, sizeof (GValue));
  double accValue = accWrap ? accWrap->MaxValue() : proxy->MaxValue();
  if (IsNaN(accValue))
    return;

  g_value_init(value, G_TYPE_DOUBLE);
  g_value_set_double(value, accValue);
}
コード例 #2
0
STDMETHODIMP
ia2AccessibleValue::get_maximumValue(VARIANT* aMaximumValue) {
  if (!aMaximumValue) return E_INVALIDARG;

  VariantInit(aMaximumValue);

  AccessibleWrap* valueAcc = static_cast<AccessibleWrap*>(this);
  double maximumValue;
  MOZ_ASSERT(!valueAcc->IsProxy());
  if (valueAcc->IsDefunct()) {
    return CO_E_OBJNOTCONNECTED;
  }

  maximumValue = valueAcc->MaxValue();

  if (IsNaN(maximumValue)) return S_FALSE;

  aMaximumValue->vt = VT_R8;
  aMaximumValue->dblVal = maximumValue;
  return S_OK;
}
コード例 #3
0
ファイル: DocAccessibleWrap.cpp プロジェクト: djg/gecko-dev
void DocAccessibleWrap::CacheFocusPath(AccessibleWrap* aAccessible) {
  mFocusPath.Clear();
  if (IPCAccessibilityActive()) {
    DocAccessibleChild* ipcDoc = IPCDoc();
    nsTArray<BatchData> cacheData;
    for (AccessibleWrap* acc = aAccessible; acc && acc != this->Parent();
         acc = static_cast<AccessibleWrap*>(acc->Parent())) {
      auto uid = acc->IsDoc() && acc->AsDoc()->IPCDoc()
                     ? 0
                     : reinterpret_cast<uint64_t>(acc->UniqueID());
      nsAutoString name;
      acc->Name(name);
      nsAutoString textValue;
      acc->Value(textValue);
      nsAutoString nodeID;
      acc->WrapperDOMNodeID(nodeID);
      nsCOMPtr<nsIPersistentProperties> props = acc->Attributes();
      nsTArray<Attribute> attributes;
      nsAccUtils::PersistentPropertiesToArray(props, &attributes);
      cacheData.AppendElement(BatchData(
          acc->Document()->IPCDoc(), uid, acc->State(), acc->Bounds(),
          acc->ActionCount(), name, textValue, nodeID, acc->CurValue(),
          acc->MinValue(), acc->MaxValue(), acc->Step(), attributes));
      mFocusPath.Put(acc->UniqueID(), acc);
    }

    ipcDoc->SendBatch(eBatch_FocusPath, cacheData);
  } else if (SessionAccessibility* sessionAcc =
                 SessionAccessibility::GetInstanceFor(this)) {
    nsTArray<AccessibleWrap*> accessibles;
    for (AccessibleWrap* acc = aAccessible; acc && acc != this->Parent();
         acc = static_cast<AccessibleWrap*>(acc->Parent())) {
      accessibles.AppendElement(acc);
    }

    sessionAcc->ReplaceFocusPathCache(accessibles);
  }
}