Skip to content

Commit

Permalink
[PATCH 1/2] bug 938164 - implement AtkObject::get_object_locale
Browse files Browse the repository at this point in the history
From f250d29cf45f7f72bc6e0cfbedfcd9f1bcea8dc2 Mon Sep 17 00:00:00 2001
---
 accessible/src/atk/AccessibleWrap.cpp  | 14 ++++++++++++++
 other-licenses/atk-1.0/atk/atkobject.h |  4 +++-
 2 files changed, 17 insertions(+), 1 deletion(-)
  • Loading branch information
Trevor Saunders committed Nov 14, 2013
1 parent fa57d90 commit 99b3066
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
14 changes: 14 additions & 0 deletions accessible/src/atk/AccessibleWrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ static const gchar* getNameCB (AtkObject *aAtkObj);
const gchar* getDescriptionCB (AtkObject *aAtkObj);
static AtkRole getRoleCB(AtkObject *aAtkObj);
static AtkAttributeSet* getAttributesCB(AtkObject *aAtkObj);
static const gchar* GetLocaleCB(AtkObject*);
static AtkObject* getParentCB(AtkObject *aAtkObj);
static gint getChildCountCB(AtkObject *aAtkObj);
static AtkObject* refChildCB(AtkObject *aAtkObj, gint aChildIndex);
Expand Down Expand Up @@ -489,6 +490,7 @@ classInitCB(AtkObjectClass *aClass)
aClass->get_index_in_parent = getIndexInParentCB;
aClass->get_role = getRoleCB;
aClass->get_attributes = getAttributesCB;
aClass->get_object_locale = GetLocaleCB;
aClass->ref_state_set = refStateSetCB;
aClass->ref_relation_set = refRelationSetCB;

Expand Down Expand Up @@ -754,6 +756,18 @@ getAttributesCB(AtkObject *aAtkObj)
return accWrap ? GetAttributeSet(accWrap) : nullptr;
}

const gchar*
GetLocaleCB(AtkObject* aAtkObj)
{
AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
if (!accWrap)
return nullptr;

nsAutoString locale;
accWrap->Language(locale);
return AccessibleWrap::ReturnString(locale);
}

AtkObject *
getParentCB(AtkObject *aAtkObj)
{
Expand Down
4 changes: 3 additions & 1 deletion other-licenses/atk-1.0/atk/atkobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -501,8 +501,10 @@ void (* initialize) (AtkObject
* Since ATK 1.12
*/
AtkAttributeSet* (*get_attributes) (AtkObject *accessible);

const gchar* (*get_object_locale) (AtkObject *accessible);

AtkFunction pad1;
AtkFunction pad2;
};

GType atk_object_get_type (void);
Expand Down

0 comments on commit 99b3066

Please sign in to comment.