本文整理汇总了C++中accessibilityobject::AccessibilityChildrenVector类的典型用法代码示例。如果您正苦于以下问题:C++ AccessibilityChildrenVector类的具体用法?C++ AccessibilityChildrenVector怎么用?C++ AccessibilityChildrenVector使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AccessibilityChildrenVector类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: listObjectForSelection
static AccessibilityObject* listObjectForSelection(AtkSelection* selection)
{
AccessibilityObject* coreSelection = core(selection);
// Only list boxes and menu lists supported so far.
if (!coreSelection->isListBox() && !coreSelection->isMenuList())
return 0;
// For list boxes the list object is just itself.
if (coreSelection->isListBox())
return coreSelection;
// For menu lists we need to return the first accessible child,
// with role MenuListPopupRole, since that's the one holding the list
// of items with role MenuListOptionRole.
AccessibilityObject::AccessibilityChildrenVector children = coreSelection->children();
if (!children.size())
return 0;
AccessibilityObject* listObject = children.at(0).get();
if (!listObject->isMenuListPopup())
return 0;
return listObject;
}
开发者ID:3163504123,项目名称:phantomjs,代码行数:25,代码来源:WebKitAccessibleInterfaceSelection.cpp
示例2: webkitAccessibleSelectionGetSelectionCount
static gint webkitAccessibleSelectionGetSelectionCount(AtkSelection* selection)
{
g_return_val_if_fail(ATK_SELECTION(selection), 0);
returnValIfWebKitAccessibleIsInvalid(WEBKIT_ACCESSIBLE(selection), 0);
AccessibilityObject* coreSelection = core(selection);
if (!coreSelection || !coreSelection->isAccessibilityRenderObject())
return 0;
if (coreSelection->isListBox()) {
AccessibilityObject::AccessibilityChildrenVector selectedItems;
coreSelection->selectedChildren(selectedItems);
return static_cast<gint>(selectedItems.size());
}
if (coreSelection->isMenuList()) {
RenderObject* renderer = coreSelection->renderer();
if (!renderer)
return 0;
int selectedIndex = downcast<HTMLSelectElement>(renderer->node())->selectedIndex();
return selectedIndex >= 0 && selectedIndex < static_cast<int>(downcast<HTMLSelectElement>(renderer->node())->listItems().size());
}
return 0;
}
开发者ID:ddxxyy,项目名称:webkit,代码行数:26,代码来源:WebKitAccessibleInterfaceSelection.cpp
示例3: webkitAccessibleGetIndexInParent
static gint webkitAccessibleGetIndexInParent(AtkObject* object)
{
AccessibilityObject* coreObject = core(object);
AccessibilityObject* parent = coreObject->parentObjectUnignored();
if (!parent && isRootObject(coreObject)) {
AtkObject* atkParent = atkParentOfRootObject(object);
if (!atkParent)
return -1;
unsigned count = atk_object_get_n_accessible_children(atkParent);
for (unsigned i = 0; i < count; ++i) {
AtkObject* child = atk_object_ref_accessible_child(atkParent, i);
bool childIsObject = child == object;
g_object_unref(child);
if (childIsObject)
return i;
}
}
// Need to calculate the index of the cell in the table, as
// rows won't be exposed to assistive technologies in GTK.
if (parent && parent->isTableRow() && coreObject->isTableCell())
return getIndexInParentForCellInRow(coreObject);
AccessibilityObject::AccessibilityChildrenVector children = parent->children();
unsigned count = children.size();
for (unsigned i = 0; i < count; ++i) {
if (children[i] == coreObject)
return i;
}
return -1;
}
开发者ID:paul99,项目名称:third_party,代码行数:34,代码来源:WebKitAccessibleWrapperAtk.cpp
示例4: optionFromSelection
static AccessibilityObject* optionFromSelection(AtkSelection* selection, gint index)
{
// i is the ith selection as opposed to the ith child.
AccessibilityObject* coreSelection = core(selection);
if (!coreSelection || !coreSelection->isAccessibilityRenderObject() || index < 0)
return 0;
AccessibilityObject::AccessibilityChildrenVector selectedItems;
if (coreSelection->isListBox())
coreSelection->selectedChildren(selectedItems);
else if (coreSelection->isMenuList()) {
RenderObject* renderer = coreSelection->renderer();
if (!renderer)
return 0;
HTMLSelectElement* selectNode = toHTMLSelectElement(renderer->node());
int selectedIndex = selectNode->selectedIndex();
const Vector<HTMLElement*> listItems = selectNode->listItems();
if (selectedIndex < 0 || selectedIndex >= static_cast<int>(listItems.size()))
return 0;
return optionFromList(selection, selectedIndex);
}
if (index < static_cast<gint>(selectedItems.size()))
return selectedItems.at(index).get();
return 0;
}
开发者ID:3163504123,项目名称:phantomjs,代码行数:31,代码来源:WebKitAccessibleInterfaceSelection.cpp
示例5: cellIndex
static gint cellIndex(AccessibilityTableCell* axCell, AccessibilityTable* axTable)
{
// Calculate the cell's index as if we had a traditional Gtk+ table in
// which cells are all direct children of the table, arranged row-first.
AccessibilityObject::AccessibilityChildrenVector allCells;
axTable->cells(allCells);
AccessibilityObject::AccessibilityChildrenVector::iterator position;
position = std::find(allCells.begin(), allCells.end(), axCell);
if (position == allCells.end())
return -1;
return position - allCells.begin();
}
开发者ID:ZeusbaseWeb,项目名称:webkit,代码行数:12,代码来源:WebKitAccessibleInterfaceTable.cpp
示例6: cellAtIndex
static AccessibilityTableCell* cellAtIndex(AtkTable* table, gint index)
{
AccessibilityObject* accTable = core(table);
if (accTable->isAccessibilityRenderObject()) {
AccessibilityObject::AccessibilityChildrenVector allCells;
toAccessibilityTable(accTable)->cells(allCells);
if (0 <= index && static_cast<unsigned>(index) < allCells.size()) {
AccessibilityObject* accCell = allCells.at(index).get();
return toAccessibilityTableCell(accCell);
}
}
return 0;
}
开发者ID:ZeusbaseWeb,项目名称:webkit,代码行数:13,代码来源:WebKitAccessibleInterfaceTable.cpp
示例7: webkit_accessible_get_index_in_parent
static gint webkit_accessible_get_index_in_parent(AtkObject* object)
{
AccessibilityObject* coreObject = core(object);
AccessibilityObject* parent = coreObject->parentObjectUnignored();
g_return_val_if_fail(parent, 0);
AccessibilityObject::AccessibilityChildrenVector children = parent->children();
unsigned count = children.size();
for (unsigned i = 0; i < count; ++i) {
if (children[i] == coreObject)
return i;
}
return 0;
}
开发者ID:Androtos,项目名称:toolchain_benchmark,代码行数:16,代码来源:AccessibilityObjectWrapperAtk.cpp
示例8: webkitAccessibleSelectionClearSelection
static gboolean webkitAccessibleSelectionClearSelection(AtkSelection* selection)
{
AccessibilityObject* coreSelection = core(selection);
if (!coreSelection)
return FALSE;
AccessibilityObject::AccessibilityChildrenVector selectedItems;
if (coreSelection->isListBox() || coreSelection->isMenuList()) {
// Set the list of selected items to an empty list; then verify that it worked.
AccessibilityListBox* listBox = static_cast<AccessibilityListBox*>(coreSelection);
listBox->setSelectedChildren(selectedItems);
listBox->selectedChildren(selectedItems);
return !selectedItems.size();
}
return FALSE;
}
开发者ID:3163504123,项目名称:phantomjs,代码行数:16,代码来源:WebKitAccessibleInterfaceSelection.cpp
示例9: webkit_accessible_table_get_row_header
static AtkObject* webkit_accessible_table_get_row_header(AtkTable* table, gint row)
{
AccessibilityObject* accTable = core(table);
if (accTable->isAccessibilityRenderObject()) {
AccessibilityObject::AccessibilityChildrenVector allRowHeaders;
static_cast<AccessibilityTable*>(accTable)->rowHeaders(allRowHeaders);
unsigned rowCount = allRowHeaders.size();
for (unsigned k = 0; k < rowCount; ++k) {
AccessibilityObject* rowObject = allRowHeaders[k]->parentObject();
if (static_cast<AccessibilityTableRow*>(rowObject)->rowIndex() == row)
return allRowHeaders[k]->wrapper();
}
}
return 0;
}
开发者ID:Androtos,项目名称:toolchain_benchmark,代码行数:16,代码来源:AccessibilityObjectWrapperAtk.cpp
示例10: webkitAccessibleSelectionSelectAllSelection
static gboolean webkitAccessibleSelectionSelectAllSelection(AtkSelection* selection)
{
AccessibilityObject* coreSelection = core(selection);
if (!coreSelection || !coreSelection->isMultiSelectable())
return FALSE;
AccessibilityObject::AccessibilityChildrenVector children = coreSelection->children();
if (coreSelection->isListBox()) {
AccessibilityListBox* listBox = static_cast<AccessibilityListBox*>(coreSelection);
listBox->setSelectedChildren(children);
AccessibilityObject::AccessibilityChildrenVector selectedItems;
listBox->selectedChildren(selectedItems);
return selectedItems.size() == children.size();
}
return FALSE;
}
开发者ID:3163504123,项目名称:phantomjs,代码行数:17,代码来源:WebKitAccessibleInterfaceSelection.cpp
示例11: webkitAccessibleTableGetRowHeader
static AtkObject* webkitAccessibleTableGetRowHeader(AtkTable* table, gint row)
{
AccessibilityObject* accTable = core(table);
if (accTable->isAccessibilityRenderObject()) {
AccessibilityObject::AccessibilityChildrenVector allRowHeaders;
static_cast<AccessibilityTable*>(accTable)->rowHeaders(allRowHeaders);
unsigned rowCount = allRowHeaders.size();
for (unsigned k = 0; k < rowCount; ++k) {
pair<unsigned, unsigned> rowRange;
AccessibilityTableCell* cell = static_cast<AccessibilityTableCell*>(allRowHeaders.at(k).get());
cell->rowIndexRange(rowRange);
if (rowRange.first <= static_cast<unsigned>(row) && static_cast<unsigned>(row) < rowRange.first + rowRange.second)
return allRowHeaders[k]->wrapper();
}
}
return 0;
}
开发者ID:3163504123,项目名称:phantomjs,代码行数:17,代码来源:WebKitAccessibleInterfaceTable.cpp
示例12: optionFromList
static AccessibilityObject* optionFromList(AtkSelection* selection, gint index)
{
AccessibilityObject* coreSelection = core(selection);
if (!coreSelection || index < 0)
return 0;
// Need to select the proper list object depending on the type.
AccessibilityObject* listObject = listObjectForSelection(selection);
if (!listObject)
return 0;
AccessibilityObject::AccessibilityChildrenVector options = listObject->children();
if (index < static_cast<gint>(options.size()))
return options.at(index).get();
return 0;
}
开发者ID:3163504123,项目名称:phantomjs,代码行数:17,代码来源:WebKitAccessibleInterfaceSelection.cpp
示例13: cells
void AccessibilityTable::cells(AccessibilityObject::AccessibilityChildrenVector& cells)
{
if (!m_renderer)
return;
updateChildrenIfNecessary();
for (const auto& row : m_rows)
cells.appendVector(row->children());
}
开发者ID:CannedFish,项目名称:webkitgtk,代码行数:10,代码来源:AccessibilityTable.cpp
示例14: webkitAccessibleSelectionClearSelection
static gboolean webkitAccessibleSelectionClearSelection(AtkSelection* selection)
{
g_return_val_if_fail(ATK_SELECTION(selection), FALSE);
returnValIfWebKitAccessibleIsInvalid(WEBKIT_ACCESSIBLE(selection), FALSE);
AccessibilityObject* coreSelection = core(selection);
if (!coreSelection)
return FALSE;
AccessibilityObject::AccessibilityChildrenVector selectedItems;
if (coreSelection->isListBox() || coreSelection->isMenuList()) {
// Set the list of selected items to an empty list; then verify that it worked.
AccessibilityListBox* listBox = toAccessibilityListBox(coreSelection);
listBox->setSelectedChildren(selectedItems);
listBox->selectedChildren(selectedItems);
return !selectedItems.size();
}
return FALSE;
}
开发者ID:ddxxyy,项目名称:webkit,代码行数:19,代码来源:WebKitAccessibleInterfaceSelection.cpp
示例15: cells
void AccessibilityTable::cells(AccessibilityObject::AccessibilityChildrenVector& cells)
{
if (!m_renderer)
return;
updateChildrenIfNecessary();
for (size_t row = 0; row < m_rows.size(); ++row)
cells.appendVector(m_rows[row]->children());
}
开发者ID:EliBing,项目名称:webkit,代码行数:10,代码来源:AccessibilityTable.cpp
示例16: webkitAccessibleSelectionSelectAllSelection
static gboolean webkitAccessibleSelectionSelectAllSelection(AtkSelection* selection)
{
g_return_val_if_fail(ATK_SELECTION(selection), FALSE);
returnValIfWebKitAccessibleIsInvalid(WEBKIT_ACCESSIBLE(selection), FALSE);
AccessibilityObject* coreSelection = core(selection);
if (!coreSelection || !coreSelection->isMultiSelectable())
return FALSE;
if (coreSelection->isListBox()) {
const AccessibilityObject::AccessibilityChildrenVector& children = coreSelection->children();
AccessibilityListBox* listBox = toAccessibilityListBox(coreSelection);
listBox->setSelectedChildren(children);
AccessibilityObject::AccessibilityChildrenVector selectedItems;
listBox->selectedChildren(selectedItems);
return selectedItems.size() == children.size();
}
return FALSE;
}
开发者ID:ddxxyy,项目名称:webkit,代码行数:20,代码来源:WebKitAccessibleInterfaceSelection.cpp
示例17: webkitAccessibleTableGetRowHeader
static AtkObject* webkitAccessibleTableGetRowHeader(AtkTable* table, gint row)
{
g_return_val_if_fail(ATK_TABLE(table), 0);
returnValIfWebKitAccessibleIsInvalid(WEBKIT_ACCESSIBLE(table), 0);
AccessibilityObject* accTable = core(table);
if (accTable->isAccessibilityRenderObject()) {
AccessibilityObject::AccessibilityChildrenVector allRowHeaders;
toAccessibilityTable(accTable)->rowHeaders(allRowHeaders);
unsigned rowCount = allRowHeaders.size();
for (unsigned k = 0; k < rowCount; ++k) {
pair<unsigned, unsigned> rowRange;
AccessibilityTableCell* cell = toAccessibilityTableCell(allRowHeaders.at(k).get());
cell->rowIndexRange(rowRange);
if (rowRange.first <= static_cast<unsigned>(row) && static_cast<unsigned>(row) < rowRange.first + rowRange.second)
return allRowHeaders[k]->wrapper();
}
}
return 0;
}
开发者ID:ZeusbaseWeb,项目名称:webkit,代码行数:20,代码来源:WebKitAccessibleInterfaceTable.cpp
示例18: cells
void AccessibilityTable::cells(AccessibilityObject::AccessibilityChildrenVector& cells)
{
if (!m_renderer)
return;
updateChildrenIfNecessary();
int numRows = m_rows.size();
for (int row = 0; row < numRows; ++row) {
AccessibilityChildrenVector rowChildren = m_rows[row]->children();
cells.append(rowChildren);
}
}
开发者ID:Moondee,项目名称:Artemis,代码行数:13,代码来源:AccessibilityTable.cpp
示例19: webkitAccessibleSelectionGetSelectionCount
static gint webkitAccessibleSelectionGetSelectionCount(AtkSelection* selection)
{
AccessibilityObject* coreSelection = core(selection);
if (!coreSelection || !coreSelection->isAccessibilityRenderObject())
return 0;
if (coreSelection->isListBox()) {
AccessibilityObject::AccessibilityChildrenVector selectedItems;
coreSelection->selectedChildren(selectedItems);
return static_cast<gint>(selectedItems.size());
}
if (coreSelection->isMenuList()) {
RenderObject* renderer = coreSelection->renderer();
if (!renderer)
return 0;
int selectedIndex = toHTMLSelectElement(renderer->node())->selectedIndex();
return selectedIndex >= 0 && selectedIndex < static_cast<int>(toHTMLSelectElement(renderer->node())->listItems().size());
}
return 0;
}
开发者ID:3163504123,项目名称:phantomjs,代码行数:23,代码来源:WebKitAccessibleInterfaceSelection.cpp
示例20: childrenContainOnlyStaticText
static bool childrenContainOnlyStaticText(const AccessibilityObject::AccessibilityChildrenVector& children)
{
if (!children.size())
return false;
for (const auto& child : children) {
if (child->roleValue() == AccessibilityRole::StaticText)
continue;
if (child->roleValue() == AccessibilityRole::Group) {
if (!childrenContainOnlyStaticText(child->children()))
return false;
} else
return false;
}
return true;
}
开发者ID:wolfviking0,项目名称:webcl-webkit,代码行数:15,代码来源:AccessibilityLabel.cpp
注:本文中的accessibilityobject::AccessibilityChildrenVector类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论