您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch |

自学教程:C++ AXObject类代码示例

51自学网 2021-06-03 12:04:43
  C++
这篇教程C++ AXObject类代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中AXObject的典型用法代码示例。如果您正苦于以下问题:C++ AXObject类的具体用法?C++ AXObject怎么用?C++ AXObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

在下文中一共展示了AXObject类的23个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: toAXListBoxOption

void AXListBox::setSelectedChildren(AccessibilityChildrenVector& children){    if (!canSetSelectedChildrenAttribute())        return;    Node* selectNode = m_renderer->node();    if (!selectNode)        return;    // disable any selected options    unsigned length = m_children.size();    for (unsigned i = 0; i < length; i++) {        AXListBoxOption* listBoxOption = toAXListBoxOption(m_children[i].get());        if (listBoxOption->isSelected())            listBoxOption->setSelected(false);    }    length = children.size();    for (unsigned i = 0; i < length; i++) {        AXObject* obj = children[i].get();        if (obj->roleValue() != ListBoxOptionRole)            continue;        toAXListBoxOption(obj)->setSelected(true);    }}
开发者ID:jeremyroman,项目名称:blink,代码行数:26,


示例2: toLocalFrame

void InspectorAccessibilityAgent::getAXNode(ErrorString* errorString, int nodeId, RefPtr<AXNode>& accessibilityNode){    Frame* mainFrame = m_page->mainFrame();    if (!mainFrame->isLocalFrame()) {        *errorString = "Can't inspect out of process frames yet";        return;    }    InspectorDOMAgent* domAgent = toLocalFrame(mainFrame)->instrumentingAgents()->inspectorDOMAgent();    if (!domAgent) {        *errorString = "DOM agent must be enabled";        return;    }    Node* node = domAgent->assertNode(errorString, nodeId);    if (!node)        return;    Document& document = node->document();    OwnPtr<ScopedAXObjectCache> cache = ScopedAXObjectCache::create(document);    AXObjectCacheImpl* cacheImpl = toAXObjectCacheImpl(cache->get());    AXObject* axObject = cacheImpl->getOrCreate(node);    if (!axObject || axObject->accessibilityIsIgnored()) {        accessibilityNode = buildObjectForIgnoredNode(node, axObject, cacheImpl);        return;    }    RefPtr<TypeBuilder::Array<AXProperty>> properties = TypeBuilder::Array<AXProperty>::create();    fillLiveRegionProperties(axObject, properties);    fillGlobalStates(axObject, properties);    fillWidgetProperties(axObject, properties);    fillWidgetStates(axObject, properties);    fillRelationships(axObject, properties);    accessibilityNode = buildObjectForNode(node, axObject, cacheImpl, properties);}
开发者ID:OctiumBrowser,项目名称:octium-main,代码行数:35,


示例3: getOrCreate

const AtomicString& AXObjectCacheImpl::computedRoleForNode(Node* node){    AXObject* obj = getOrCreate(node);    if (!obj)        return AXObject::roleName(UnknownRole);    return AXObject::roleName(obj->roleValue());}
开发者ID:astojilj,项目名称:chromium-crosswalk,代码行数:7,


示例4: get

void AXObjectCacheImpl::handleEditableTextContentChanged(Node* node){    AXObject* obj = get(node);    while (obj && !obj->isNativeTextControl() && !obj->isNonNativeTextControl())        obj = obj->parentObject();    postNotification(obj, AXObjectCache::AXValueChanged);}
开发者ID:astojilj,项目名称:chromium-crosswalk,代码行数:7,


示例5: parentObjectUnignored

bool AXTableCell::isTableCell() const {  AXObject* parent = parentObjectUnignored();  if (!parent || !parent->isTableRow())    return false;  return true;}
开发者ID:mirror,项目名称:chromium,代码行数:7,


示例6: elementRect

AXObject* AXListBox::elementAccessibilityHitTest(const IntPoint& point) const{    // the internal HTMLSelectElement methods for returning a listbox option at a point    // ignore optgroup elements.    if (!m_renderer)        return 0;    Node* node = m_renderer->node();    if (!node)        return 0;    LayoutRect parentRect = elementRect();    AXObject* listBoxOption = 0;    unsigned length = m_children.size();    for (unsigned i = 0; i < length; i++) {        LayoutRect rect = toRenderListBox(m_renderer)->itemBoundingBoxRect(parentRect.location(), i);        // The cast to HTMLElement below is safe because the only other possible listItem type        // would be a WMLElement, but WML builds don't use accessibility features at all.        if (rect.contains(point)) {            listBoxOption = m_children[i].get();            break;        }    }    if (listBoxOption && !listBoxOption->accessibilityIsIgnored())        return listBoxOption;    return axObjectCache()->getOrCreate(m_renderer);}
开发者ID:jeremyroman,项目名称:blink,代码行数:30,


示例7: focusedImageMapUIElement

AXObject* AXObjectCache::focusedImageMapUIElement(HTMLAreaElement* areaElement){    // Find the corresponding accessibility object for the HTMLAreaElement. This should be    // in the list of children for its corresponding image.    if (!areaElement)        return 0;    HTMLImageElement* imageElement = areaElement->imageElement();    if (!imageElement)        return 0;    AXObject* axRenderImage = areaElement->document().axObjectCache()->getOrCreate(imageElement);    if (!axRenderImage)        return 0;    AXObject::AccessibilityChildrenVector imageChildren = axRenderImage->children();    unsigned count = imageChildren.size();    for (unsigned k = 0; k < count; ++k) {        AXObject* child = imageChildren[k].get();        if (!child->isImageMapLink())            continue;        if (toAXImageMapLink(child)->areaElement() == areaElement)            return child;    }    return 0;}
开发者ID:kublaj,项目名称:blink,代码行数:28,


示例8: updateChildrenIfNecessary

AXTableCell* AXTable::cellForColumnAndRow(unsigned column, unsigned row){    updateChildrenIfNecessary();    if (column >= columnCount() || row >= rowCount())        return 0;    // Iterate backwards through the rows in case the desired cell has a rowspan and exists in a previous row.    for (unsigned rowIndexCounter = row + 1; rowIndexCounter > 0; --rowIndexCounter) {        unsigned rowIndex = rowIndexCounter - 1;        const auto& children = m_rows[rowIndex]->children();        // Since some cells may have colspans, we have to check the actual range of each        // cell to determine which is the right one.        for (unsigned colIndexCounter = std::min(static_cast<unsigned>(children.size()), column + 1); colIndexCounter > 0; --colIndexCounter) {            unsigned colIndex = colIndexCounter - 1;            AXObject* child = children[colIndex].get();            if (!child->isTableCell())                continue;            std::pair<unsigned, unsigned> columnRange;            std::pair<unsigned, unsigned> rowRange;            AXTableCell* tableCellChild = toAXTableCell(child);            tableCellChild->columnIndexRange(columnRange);            tableCellChild->rowIndexRange(rowRange);            if ((column >= columnRange.first && column < (columnRange.first + columnRange.second))                && (row >= rowRange.first && row < (rowRange.first + rowRange.second)))                return tableCellChild;        }    }    return 0;}
开发者ID:astojilj,项目名称:chromium-crosswalk,代码行数:33,


示例9: parentObject

Document* AXScrollbar::document() const{    AXObject* parent = parentObject();    if (!parent)        return 0;    return parent->document();}
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:7,


示例10: parentObjectUnignored

void AXARIAGridCell::rowIndexRange(pair<unsigned, unsigned>& rowRange){    AXObject* parent = parentObjectUnignored();    if (!parent)        return;    if (parent->isTableRow()) {        // We already got a table row, use its API.        rowRange.first = toAXTableRow(parent)->rowIndex();    } else if (parent->isAXTable()) {        // We reached the parent table, so we need to inspect its        // children to determine the row index for the cell in it.        unsigned columnCount = toAXTable(parent)->columnCount();        if (!columnCount)            return;        AccessibilityChildrenVector siblings = parent->children();        unsigned childrenSize = siblings.size();        for (unsigned k = 0; k < childrenSize; ++k) {            if (siblings[k].get() == this) {                rowRange.first = k / columnCount;                break;            }        }    }    // as far as I can tell, grid cells cannot span rows    rowRange.second = 1;}
开发者ID:kjthegod,项目名称:WebKit,代码行数:29,


示例11: toLocalFrame

AXObject* AXObjectCacheImpl::focusedUIElementForPage(const Page* page){    if (!page->settings().accessibilityEnabled())        return 0;    // Cross-process accessibility is not yet implemented.    if (!page->focusController().focusedOrMainFrame()->isLocalFrame())        return 0;    // get the focused node in the page    Document* focusedDocument = toLocalFrame(page->focusController().focusedOrMainFrame())->document();    Node* focusedNode = focusedDocument->focusedElement();    if (!focusedNode)        focusedNode = focusedDocument;    if (isHTMLAreaElement(*focusedNode))        return focusedImageMapUIElement(toHTMLAreaElement(focusedNode));    AXObject* obj = toAXObjectCacheImpl(focusedNode->document().axObjectCache())->getOrCreate(focusedNode);    if (!obj)        return 0;    if (obj->shouldFocusActiveDescendant()) {        if (AXObject* descendant = obj->activeDescendant())            obj = descendant;    }    // the HTML element, for example, is focusable but has an AX object that is ignored    if (obj->accessibilityIsIgnored())        obj = obj->parentObjectUnignored();    return obj;}
开发者ID:RobinWuDev,项目名称:Qt,代码行数:33,


示例12: scrollToGlobalPoint

void AXObject::scrollToGlobalPoint(const IntPoint& globalPoint) const{    // Search up the parent chain and create a vector of all scrollable parent objects    // and ending with this object itself.    Vector<const AXObject*> objects;    AXObject* parentObject;    for (parentObject = this->parentObject(); parentObject; parentObject = parentObject->parentObject()) {        if (parentObject->getScrollableAreaIfScrollable())            objects.prepend(parentObject);    }    objects.append(this);    // Start with the outermost scrollable (the main window) and try to scroll the    // next innermost object to the given point.    int offsetX = 0, offsetY = 0;    IntPoint point = globalPoint;    size_t levels = objects.size() - 1;    for (size_t i = 0; i < levels; i++) {        const AXObject* outer = objects[i];        const AXObject* inner = objects[i + 1];        ScrollableArea* scrollableArea = outer->getScrollableAreaIfScrollable();        LayoutRect innerRect = inner->isAXScrollView() ? inner->parentObject()->elementRect() : inner->elementRect();        LayoutRect objectRect = innerRect;        IntPoint scrollPosition = scrollableArea->scrollPosition();        // Convert the object rect into local coordinates.        objectRect.move(offsetX, offsetY);        if (!outer->isAXScrollView())            objectRect.move(scrollPosition.x(), scrollPosition.y());        int desiredX = computeBestScrollOffset(            0,            objectRect.x(), objectRect.maxX(),            objectRect.x(), objectRect.maxX(),            point.x(), point.x());        int desiredY = computeBestScrollOffset(            0,            objectRect.y(), objectRect.maxY(),            objectRect.y(), objectRect.maxY(),            point.y(), point.y());        outer->scrollTo(IntPoint(desiredX, desiredY));        if (outer->isAXScrollView() && !inner->isAXScrollView()) {            // If outer object we just scrolled is a scroll view (main window or iframe) but the            // inner object is not, keep track of the coordinate transformation to apply to            // future nested calculations.            scrollPosition = scrollableArea->scrollPosition();            offsetX -= (scrollPosition.x() + point.x());            offsetY -= (scrollPosition.y() + point.y());            point.move(scrollPosition.x() - innerRect.x(), scrollPosition.y() - innerRect.y());        } else if (inner->isAXScrollView()) {            // Otherwise, if the inner object is a scroll view, reset the coordinate transformation.            offsetX = 0;            offsetY = 0;        }    }}
开发者ID:Igalia,项目名称:blink,代码行数:59,


示例13: parentTable

bool AXARIAGridRow::isARIATreeGridRow() const{    AXObject* parent = parentTable();    if (!parent)        return false;    return parent->ariaRoleAttribute() == TreeGridRole;}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:8,


示例14: getOrCreate

void AXObjectCacheImpl::setCanvasObjectBounds(Element* element, const LayoutRect& rect){    AXObject* obj = getOrCreate(element);    if (!obj)        return;    obj->setElementRect(rect);}
开发者ID:RobinWuDev,项目名称:Qt,代码行数:8,


示例15: parentObjectUnignored

AXObject* AXTableRow::parentTable() const{    AXObject* parent = parentObjectUnignored();    if (!parent || !parent->isAXTable())        return 0;    return parent;}
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:8,


示例16: parentObjectUnignored

AXObject* AXObject::parentObjectUnignored() const{    AXObject* parent;    for (parent = parentObject(); parent && parent->accessibilityIsIgnored(); parent = parent->parentObject()) {    }    return parent;}
开发者ID:Igalia,项目名称:blink,代码行数:8,


示例17: parentTable

bool AXTableRow::isTableRow() const{    AXObject* table = parentTable();    if (!table || !table->isAXTable())        return false;    return true;}
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:8,


示例18: webAreaObject

bool AXScrollView::computeAccessibilityIsIgnored() const{    AXObject* webArea = webAreaObject();    if (!webArea)        return true;    return webArea->accessibilityIsIgnored();}
开发者ID:Igalia,项目名称:blink,代码行数:8,


示例19: tableLevel

int AXTable::tableLevel() const{    int level = 0;    for (AXObject* obj = static_cast<AXObject*>(const_cast<AXTable*>(this)); obj; obj = obj->parentObject()) {        if (obj->isAXTable())            ++level;    }    return level;}
开发者ID:Igalia,项目名称:blink,代码行数:10,


示例20: ASSERT

void AXScrollView::addChildren(){    ASSERT(!m_haveChildren);    m_haveChildren = true;    AXObject* webArea = webAreaObject();    if (webArea && !webArea->accessibilityIsIgnored())        m_children.append(webArea);    updateScrollbars();}
开发者ID:Igalia,项目名称:blink,代码行数:11,


示例21: children

AXObject* AXARIAGridRow::headerObject(){    AccessibilityChildrenVector rowChildren = children();    unsigned childrenCount = rowChildren.size();    for (unsigned i = 0; i < childrenCount; ++i) {        AXObject* cell = rowChildren[i].get();        if (cell->ariaRoleAttribute() == RowHeaderRole)            return cell;    }    return 0;}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:12,


示例22: ASSERT

AXMenuListOption* AXMenuListPopup::menuListOptionAXObject(HTMLElement* element) const{    ASSERT(element);    if (!isHTMLOptionElement(*element))        return 0;    AXObject* object = axObjectCache().getOrCreate(element);    if (!object || !object->isMenuListOption())        return 0;    return toAXMenuListOption(object);}
开发者ID:azureplus,项目名称:chromium,代码行数:12,


示例23: detachWrapper

AXObjectCache::~AXObjectCache(){    m_notificationPostTimer.stop();    HashMap<AXID, RefPtr<AXObject> >::iterator end = m_objects.end();    for (HashMap<AXID, RefPtr<AXObject> >::iterator it = m_objects.begin(); it != end; ++it) {        AXObject* obj = (*it).value.get();        detachWrapper(obj);        obj->detach();        removeAXID(obj);    }}
开发者ID:kublaj,项目名称:blink,代码行数:12,



注:本文中的AXObject类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ AXObjectCache类代码示例
C++ AWSError类代码示例
51自学网,即我要自学网,自学EXCEL、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。
京ICP备13026421号-1