本文整理汇总了C++中GetAccessibleWrap函数的典型用法代码示例。如果您正苦于以下问题:C++ GetAccessibleWrap函数的具体用法?C++ GetAccessibleWrap怎么用?C++ GetAccessibleWrap使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetAccessibleWrap函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: refChildCB
AtkObject *
refChildCB(AtkObject *aAtkObj, gint aChildIndex)
{
// aChildIndex should not be less than zero
if (aChildIndex < 0) {
return nsnull;
}
nsAccessibleWrap *accWrap = GetAccessibleWrap(aAtkObj);
if (!accWrap || nsAccUtils::MustPrune(accWrap)) {
return nsnull;
}
nsAccessible* accChild = accWrap->GetEmbeddedChildAt(aChildIndex);
if (!accChild)
return nsnull;
AtkObject* childAtkObj = nsAccessibleWrap::GetAtkObject(accChild);
NS_ASSERTION(childAtkObj, "Fail to get AtkObj");
if (!childAtkObj)
return nsnull;
g_object_ref(childAtkObj);
//this will addref parent
atk_object_set_parent(childAtkObj, aAtkObj);
return childAtkObj;
}
开发者ID:jiaofeng,项目名称:Icefox,代码行数:28,代码来源:nsAccessibleWrap.cpp
示例2: getDocumentAttributesCB
AtkAttributeSet *
getDocumentAttributesCB(AtkDocument *aDocument)
{
nsAccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aDocument));
if (!accWrap || !accWrap->IsDoc())
return nsnull;
// according to atkobject.h, AtkAttributeSet is a GSList
GSList* attributes = nsnull;
nsDocAccessible* document = accWrap->AsDoc();
nsAutoString aURL;
nsresult rv = document->GetURL(aURL);
if (NS_SUCCEEDED(rv))
attributes = prependToList(attributes, kDocUrlName, aURL);
nsAutoString aW3CDocType;
rv = document->GetDocType(aW3CDocType);
if (NS_SUCCEEDED(rv))
attributes = prependToList(attributes, kDocTypeName, aW3CDocType);
nsAutoString aMimeType;
rv = document->GetMimeType(aMimeType);
if (NS_SUCCEEDED(rv))
attributes = prependToList(attributes, kMimeTypeName, aMimeType);
return attributes;
}
开发者ID:jbalogh,项目名称:mozilla-central,代码行数:27,代码来源:nsMaiInterfaceDocument.cpp
示例3: getRoleCB
AtkRole
getRoleCB(AtkObject *aAtkObj)
{
nsAccessibleWrap *accWrap = GetAccessibleWrap(aAtkObj);
if (!accWrap) {
return ATK_ROLE_INVALID;
}
#ifdef DEBUG_A11Y
NS_ASSERTION(nsAccUtils::IsTextInterfaceSupportCorrect(accWrap),
"Does not support nsIAccessibleText when it should");
#endif
if (aAtkObj->role == ATK_ROLE_INVALID) {
PRUint32 accRole, atkRole;
nsresult rv = accWrap->GetRole(&accRole);
NS_ENSURE_SUCCESS(rv, ATK_ROLE_INVALID);
atkRole = atkRoleMap[accRole]; // map to the actual value
NS_ASSERTION(atkRoleMap[nsIAccessibleRole::ROLE_LAST_ENTRY] ==
kROLE_ATK_LAST_ENTRY, "ATK role map skewed");
aAtkObj->role = static_cast<AtkRole>(atkRole);
}
return aAtkObj->role;
}
开发者ID:amyvmiwei,项目名称:firefox,代码行数:25,代码来源:nsAccessibleWrap.cpp
示例4: getCharacterAtOffsetCB
gunichar
getCharacterAtOffsetCB(AtkText *aText, gint aOffset)
{
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
if (!accWrap)
return 0;
nsCOMPtr<nsIAccessibleText> accText;
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText),
getter_AddRefs(accText));
NS_ENSURE_TRUE(accText, 0);
/* PRUnichar is unsigned short in Mozilla */
/* gnuichar is guint32 in glib */
PRUnichar uniChar;
nsresult rv =
accText->GetCharacterAtOffset(aOffset, &uniChar);
// convert char to "*" when it's "password text"
PRUint32 atkRole = atkRoleMap[accWrap->NativeRole()];
if (atkRole == ATK_ROLE_PASSWORD_TEXT)
uniChar = '*';
return (NS_FAILED(rv)) ? 0 : static_cast<gunichar>(uniChar);
}
开发者ID:AntonSilviu,项目名称:v8monkey,代码行数:25,代码来源:nsMaiInterfaceText.cpp
示例5: getSelectedRowsCB
static gint
getSelectedRowsCB(AtkTable *aTable, gint **aSelected)
{
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (!accWrap)
return 0;
nsCOMPtr<nsIAccessibleTable> accTable;
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable),
getter_AddRefs(accTable));
NS_ENSURE_TRUE(accTable, 0);
PRUint32 size = 0;
PRInt32 *rows = NULL;
nsresult rv = accTable->GetSelectedRowIndices(&size, &rows);
if (NS_FAILED(rv) || (size == 0) || !rows) {
*aSelected = nsnull;
return 0;
}
gint *atkRows = g_new(gint, size);
if (!atkRows) {
NS_WARNING("OUT OF MEMORY");
return nsnull;
}
//copy
for (PRUint32 index = 0; index < size; ++index)
atkRows[index] = static_cast<gint>(rows[index]);
nsMemory::Free(rows);
*aSelected = atkRows;
return size;
}
开发者ID:pupadam,项目名称:mozilla-central,代码行数:34,代码来源:nsMaiInterfaceTable.cpp
示例6: getAttributesCB
AtkAttributeSet *
getAttributesCB(AtkObject *aAtkObj)
{
nsAccessibleWrap *accWrap = GetAccessibleWrap(aAtkObj);
return accWrap ? GetAttributeSet(accWrap) : nsnull;
}
开发者ID:amyvmiwei,项目名称:firefox,代码行数:7,代码来源:nsAccessibleWrap.cpp
示例7: refAccessibleAtPointCB
static AtkObject*
refAccessibleAtPointCB(AtkComponent* aComponent, gint aAccX, gint aAccY,
AtkCoordType aCoordType)
{
return refAccessibleAtPointHelper(GetAccessibleWrap(ATK_OBJECT(aComponent)),
aAccX, aAccY, aCoordType);
}
开发者ID:PinZhang,项目名称:mozilla-central,代码行数:7,代码来源:nsMaiInterfaceComponent.cpp
示例8: insertTextCB
void
insertTextCB(AtkEditableText *aText,
const gchar *aString, gint aLength, gint *aPosition)
{
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
if (!accWrap)
return;
nsCOMPtr<nsIAccessibleEditableText> accText;
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleEditableText),
getter_AddRefs(accText));
if (!accText)
return;
NS_ConvertUTF8toUTF16 strContent(aString);
// interface changed in nsIAccessibleEditableText.idl ???
//
// PRInt32 pos = *aPosition;
// nsresult rv = accText->InsertText(strContent, aLength, &pos);
// *aPosition = pos;
accText->InsertText(strContent, *aPosition);
MAI_LOG_DEBUG(("EditableText: insert aString=%s, aLength=%d, aPosition=%d",
aString, aLength, *aPosition));
}
开发者ID:Akin-Net,项目名称:mozilla-central,代码行数:27,代码来源:nsMaiInterfaceEditableText.cpp
示例9: getExtentsCB
static void
getExtentsCB(AtkComponent* aComponent, gint* aX, gint* aY,
gint* aWidth, gint* aHeight, AtkCoordType aCoordType)
{
getExtentsHelper(GetAccessibleWrap(ATK_OBJECT(aComponent)),
aX, aY, aWidth, aHeight, aCoordType);
}
开发者ID:PinZhang,项目名称:mozilla-central,代码行数:7,代码来源:nsMaiInterfaceComponent.cpp
示例10: getDocumentAttributeValueCB
const gchar *
getDocumentAttributeValueCB(AtkDocument *aDocument,
const gchar *aAttrName)
{
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aDocument));
if (!accWrap)
return nsnull;
nsCOMPtr<nsIAccessibleDocument> accDocument;
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleDocument),
getter_AddRefs(accDocument));
NS_ENSURE_TRUE(accDocument, nsnull);
nsresult rv;
nsAutoString attrValue;
if (!g_ascii_strcasecmp(aAttrName, kDocTypeName)) {
rv = accDocument->GetDocType(attrValue);
NS_ENSURE_SUCCESS(rv, nsnull);
}
else if (!g_ascii_strcasecmp(aAttrName, kDocUrlName)) {
rv = accDocument->GetURL(attrValue);
NS_ENSURE_SUCCESS(rv, nsnull);
}
else if (!g_ascii_strcasecmp(aAttrName, kMimeTypeName)) {
rv = accDocument->GetMimeType(attrValue);
NS_ENSURE_SUCCESS(rv, nsnull);
}
else {
return nsnull;
}
return nsAccessibleWrap::ReturnString(attrValue);
}
开发者ID:Akin-Net,项目名称:mozilla-central,代码行数:32,代码来源:nsMaiInterfaceDocument.cpp
示例11: getDocumentAttributesCB
AtkAttributeSet *
getDocumentAttributesCB(AtkDocument *aDocument)
{
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aDocument));
if (!accWrap)
return nsnull;
nsCOMPtr<nsIAccessibleDocument> accDocument;
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleDocument),
getter_AddRefs(accDocument));
NS_ENSURE_TRUE(accDocument, nsnull);
// according to atkobject.h, AtkAttributeSet is a GSList
GSList *attributes = nsnull;
nsAutoString aURL;
nsresult rv = accDocument->GetURL(aURL);
if (NS_SUCCEEDED(rv)) {
attributes = prependToList(attributes, kDocUrlName, aURL);
}
nsAutoString aW3CDocType;
rv = accDocument->GetDocType(aW3CDocType);
if (NS_SUCCEEDED(rv)) {
attributes = prependToList(attributes, kDocTypeName, aW3CDocType);
}
nsAutoString aMimeType;
rv = accDocument->GetMimeType(aMimeType);
if (NS_SUCCEEDED(rv)) {
attributes = prependToList(attributes, kMimeTypeName, aMimeType);
}
return attributes;
}
开发者ID:Akin-Net,项目名称:mozilla-central,代码行数:33,代码来源:nsMaiInterfaceDocument.cpp
示例12: getRunAttributesCB
AtkAttributeSet *
getRunAttributesCB(AtkText *aText, gint aOffset,
gint *aStartOffset,
gint *aEndOffset)
{
*aStartOffset = -1;
*aEndOffset = -1;
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
if (!accWrap)
return nsnull;
nsCOMPtr<nsIAccessibleText> accText;
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText),
getter_AddRefs(accText));
NS_ENSURE_TRUE(accText, nsnull);
nsCOMPtr<nsIPersistentProperties> attributes;
PRInt32 startOffset = 0, endOffset = 0;
nsresult rv = accText->GetTextAttributes(false, aOffset,
&startOffset, &endOffset,
getter_AddRefs(attributes));
NS_ENSURE_SUCCESS(rv, nsnull);
*aStartOffset = startOffset;
*aEndOffset = endOffset;
return ConvertToAtkAttributeSet(attributes);
}
开发者ID:AntonSilviu,项目名称:v8monkey,代码行数:29,代码来源:nsMaiInterfaceText.cpp
示例13: getTextBeforeOffsetCB
gchar *
getTextBeforeOffsetCB(AtkText *aText, gint aOffset,
AtkTextBoundary aBoundaryType,
gint *aStartOffset, gint *aEndOffset)
{
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
if (!accWrap)
return nsnull;
nsCOMPtr<nsIAccessibleText> accText;
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText),
getter_AddRefs(accText));
NS_ENSURE_TRUE(accText, nsnull);
nsAutoString autoStr;
PRInt32 startOffset = 0, endOffset = 0;
nsresult rv =
accText->GetTextBeforeOffset(aOffset, aBoundaryType,
&startOffset, &endOffset, autoStr);
*aStartOffset = startOffset;
*aEndOffset = endOffset;
NS_ENSURE_SUCCESS(rv, nsnull);
ConvertTexttoAsterisks(accWrap, autoStr);
NS_ConvertUTF16toUTF8 cautoStr(autoStr);
return (cautoStr.get()) ? g_strdup(cautoStr.get()) : nsnull;
}
开发者ID:AntonSilviu,项目名称:v8monkey,代码行数:28,代码来源:nsMaiInterfaceText.cpp
示例14: refRelationSetCB
AtkRelationSet *
refRelationSetCB(AtkObject *aAtkObj)
{
AtkRelationSet *relation_set = nsnull;
relation_set = ATK_OBJECT_CLASS(parent_class)->ref_relation_set(aAtkObj);
nsAccessibleWrap *accWrap = GetAccessibleWrap(aAtkObj);
if (!accWrap) {
return relation_set;
}
AtkRelation* relation;
PRUint32 relationType[] = {nsIAccessibleRelation::RELATION_LABELLED_BY,
nsIAccessibleRelation::RELATION_LABEL_FOR,
nsIAccessibleRelation::RELATION_NODE_CHILD_OF,
nsIAccessibleRelation::RELATION_CONTROLLED_BY,
nsIAccessibleRelation::RELATION_CONTROLLER_FOR,
nsIAccessibleRelation::RELATION_EMBEDS,
nsIAccessibleRelation::RELATION_FLOWS_TO,
nsIAccessibleRelation::RELATION_FLOWS_FROM,
nsIAccessibleRelation::RELATION_DESCRIBED_BY,
nsIAccessibleRelation::RELATION_DESCRIPTION_FOR,
};
for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(relationType); i++) {
relation = atk_relation_set_get_relation_by_type(relation_set, static_cast<AtkRelationType>(relationType[i]));
if (relation) {
atk_relation_set_remove(relation_set, relation);
}
nsCOMPtr<nsIAccessibleRelation> geckoRelation;
nsresult rv = accWrap->GetRelationByType(relationType[i],
getter_AddRefs(geckoRelation));
if (NS_SUCCEEDED(rv) && geckoRelation) {
PRUint32 targetsCount = 0;
geckoRelation->GetTargetsCount(&targetsCount);
if (targetsCount) {
AtkObject** accessible_array = new AtkObject*[targetsCount];
for (PRUint32 index = 0; index < targetsCount; index++) {
nsCOMPtr<nsIAccessible> geckoTarget;
geckoRelation->GetTarget(index, getter_AddRefs(geckoTarget));
accessible_array[index] =
nsAccessibleWrap::GetAtkObject(geckoTarget);
}
relation = atk_relation_new(accessible_array, targetsCount,
static_cast<AtkRelationType>(relationType[i]));
atk_relation_set_add(relation_set, relation);
g_object_unref(relation);
delete [] accessible_array;
}
}
}
return relation_set;
}
开发者ID:amyvmiwei,项目名称:firefox,代码行数:58,代码来源:nsAccessibleWrap.cpp
示例15: addSelectionCB
static gboolean
addSelectionCB(AtkSelection *aSelection, gint i)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection));
if (!accWrap || !accWrap->IsSelect())
return FALSE;
return accWrap->AddItemToSelection(i);
}
开发者ID:AshishNamdev,项目名称:mozilla-central,代码行数:9,代码来源:nsMaiInterfaceSelection.cpp
示例16: removeSelectionCB
static gboolean
removeSelectionCB(AtkSelection *aSelection, gint i)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection));
if (!accWrap || !accWrap->IsSelect())
return FALSE;
return accWrap->RemoveItemFromSelection(i);
}
开发者ID:AshishNamdev,项目名称:mozilla-central,代码行数:9,代码来源:nsMaiInterfaceSelection.cpp
示例17: getSelectionCountCB
static gint
getSelectionCountCB(AtkSelection *aSelection)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection));
if (!accWrap || !accWrap->IsSelect())
return -1;
return accWrap->SelectedItemCount();
}
开发者ID:AshishNamdev,项目名称:mozilla-central,代码行数:9,代码来源:nsMaiInterfaceSelection.cpp
示例18: isChildSelectedCB
static gboolean
isChildSelectedCB(AtkSelection *aSelection, gint i)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection));
if (!accWrap || !accWrap->IsSelect())
return FALSE;
return accWrap->IsItemSelected(i);
}
开发者ID:AshishNamdev,项目名称:mozilla-central,代码行数:9,代码来源:nsMaiInterfaceSelection.cpp
示例19: selectAllSelectionCB
static gboolean
selectAllSelectionCB(AtkSelection *aSelection)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection));
if (!accWrap || !accWrap->IsSelect())
return FALSE;
return accWrap->SelectAll();
}
开发者ID:AshishNamdev,项目名称:mozilla-central,代码行数:9,代码来源:nsMaiInterfaceSelection.cpp
示例20: getImageSizeCB
static void
getImageSizeCB(AtkImage* aImage, gint* aAccWidth, gint* aAccHeight)
{
nsAccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aImage));
if (!accWrap || !accWrap->IsImage())
return;
accWrap->AsImage()->GetImageSize(aAccWidth, aAccHeight);
}
开发者ID:jason188,项目名称:mozilla-central,代码行数:9,代码来源:nsMaiInterfaceImage.cpp
注:本文中的GetAccessibleWrap函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论