本文整理汇总了C++中AXObjectCache::postNotification方法的典型用法代码示例。如果您正苦于以下问题:C++ AXObjectCache::postNotification方法的具体用法?C++ AXObjectCache::postNotification怎么用?C++ AXObjectCache::postNotification使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AXObjectCache
的用法示例。
在下文中一共展示了AXObjectCache::postNotification方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: didUpdateActiveOption
void AccessibilityMenuListPopup::didUpdateActiveOption(int optionIndex)
{
ASSERT_ARG(optionIndex, optionIndex >= 0);
ASSERT_ARG(optionIndex, optionIndex < static_cast<int>(m_children.size()));
AXObjectCache* cache = axObjectCache();
RefPtr<AccessibilityObject> child = m_children[optionIndex].get();
cache->postNotification(child.get(), document(), AXObjectCache::AXFocusedUIElementChanged, TargetElement, PostSynchronously);
cache->postNotification(child.get(), document(), AXObjectCache::AXMenuListItemSelected, TargetElement, PostSynchronously);
}
示例2: didUpdateActiveOption
void AccessibilityMenuList::didUpdateActiveOption(int optionIndex)
{
Ref<Document> document(m_renderer->document());
AXObjectCache* cache = document->axObjectCache();
const auto& childObjects = children();
if (!childObjects.isEmpty()) {
ASSERT(childObjects.size() == 1);
ASSERT(childObjects[0]->isMenuListPopup());
// We might be calling this method in situations where the renderers for list items
// associated to the menu list have not been created (e.g. they might be rendered
// in the UI process, as it's the case in the GTK+ port, which uses GtkMenuItem).
// So, we need to make sure that the accessibility popup object has some children
// before asking it to update its active option, or it will read invalid memory.
// You can reproduce the issue in the GTK+ port by removing this check and running
// accessibility/insert-selected-option-into-select-causes-crash.html (will crash).
int popupChildrenSize = static_cast<int>(childObjects[0]->children().size());
if (childObjects[0]->isMenuListPopup() && optionIndex >= 0 && optionIndex < popupChildrenSize) {
if (AccessibilityMenuListPopup* popup = toAccessibilityMenuListPopup(childObjects[0].get()))
popup->didUpdateActiveOption(optionIndex);
}
}
cache->postNotification(this, &document.get(), AXObjectCache::AXMenuListValueChanged, TargetElement, PostSynchronously);
}
示例3: scroll
bool Scrollbar::scroll(ScrollDirection direction, ScrollGranularity granularity, float multiplier)
{
#if HAVE(ACCESSIBILITY)
if (AXObjectCache::accessibilityEnabled()) {
if (parent() && parent()->isFrameView()) {
Document* document = static_cast<FrameView*>(parent())->frame()->document();
AXObjectCache* cache = document->axObjectCache();
AccessibilityScrollbar* axObject = static_cast<AccessibilityScrollbar*>(cache->getOrCreate(ScrollBarRole));
axObject->setScrollbar(this);
cache->postNotification(axObject, document, AXObjectCache::AXValueChanged, true);
}
}
#endif
// Ignore perpendicular scrolls.
if ((m_orientation == HorizontalScrollbar) ? (direction == ScrollUp || direction == ScrollDown) : (direction == ScrollLeft || direction == ScrollRight))
return false;
float step = 0;
switch (granularity) {
case ScrollByLine: step = m_lineStep; break;
case ScrollByPage: step = m_pageStep; break;
case ScrollByDocument: step = m_totalSize; break;
case ScrollByPixel: step = m_pixelStep; break;
}
if (direction == ScrollUp || direction == ScrollLeft)
multiplier = -multiplier;
if (client())
return client()->scroll(m_orientation, granularity, step, multiplier);
return setCurrentPos(max(min(m_currentPos + (step * multiplier), static_cast<float>(m_totalSize - m_visibleSize)), 0.0f), NotFromScrollAnimator);
}
示例4: didUpdateActiveOption
void AccessibilityMenuList::didUpdateActiveOption(int optionIndex)
{
const AccessibilityChildrenVector& childObjects = children();
if (childObjects.isEmpty())
return;
ASSERT(childObjects.size() == 1);
ASSERT(childObjects[0]->isMenuListPopup());
RefPtr<Document> document = m_renderer->document();
AXObjectCache* cache = document->axObjectCache();
if (AccessibilityMenuListPopup* popup = static_cast<AccessibilityMenuListPopup*>(childObjects[0].get()))
popup->didUpdateActiveOption(optionIndex);
cache->postNotification(this, document.get(), AXObjectCache::AXMenuListValueChanged, true, PostSynchronously);
}
示例5: didUpdateActiveOption
void AccessibilityMenuList::didUpdateActiveOption(int optionIndex)
{
Ref<Document> document(m_renderer->document());
AXObjectCache* cache = document->axObjectCache();
const AccessibilityChildrenVector& childObjects = children();
if (!childObjects.isEmpty()) {
ASSERT(childObjects.size() == 1);
ASSERT(childObjects[0]->isMenuListPopup());
if (childObjects[0]->isMenuListPopup()) {
if (AccessibilityMenuListPopup* popup = toAccessibilityMenuListPopup(childObjects[0].get()))
popup->didUpdateActiveOption(optionIndex);
}
}
cache->postNotification(this, &document.get(), AXObjectCache::AXMenuListValueChanged, TargetElement, PostSynchronously);
}