Kaydet (Commit) f58c3774 authored tarafından Caolán McNamara's avatar Caolán McNamara

add accessible-name and accessible-description support to VclBuilder

Change-Id: Ifa85b2e2bf562786cb9d69b904a24ab1b8e0413b
üst 492498b8
...@@ -283,6 +283,8 @@ private: ...@@ -283,6 +283,8 @@ private:
void handleSizeGroup(xmlreader::XmlReader &reader, const OString &rID); void handleSizeGroup(xmlreader::XmlReader &reader, const OString &rID);
void handleAtkObject(xmlreader::XmlReader &reader, const OString &rID, Window *pWindow);
PackingData get_window_packing_data(const Window *pWindow) const; PackingData get_window_packing_data(const Window *pWindow) const;
void set_window_packing_position(const Window *pWindow, sal_Int32 nPosition); void set_window_packing_position(const Window *pWindow, sal_Int32 nPosition);
......
...@@ -1510,6 +1510,55 @@ void VclBuilder::handleListStore(xmlreader::XmlReader &reader, const OString &rI ...@@ -1510,6 +1510,55 @@ void VclBuilder::handleListStore(xmlreader::XmlReader &reader, const OString &rI
} }
} }
void VclBuilder::handleAtkObject(xmlreader::XmlReader &reader, const OString &rID, Window *pWindow)
{
assert(pWindow);
int nLevel = 1;
stringmap aProperties;
while(1)
{
xmlreader::Span name;
int nsId;
xmlreader::XmlReader::Result res = reader.nextItem(
xmlreader::XmlReader::TEXT_NONE, &name, &nsId);
if (res == xmlreader::XmlReader::RESULT_DONE)
break;
if (res == xmlreader::XmlReader::RESULT_BEGIN)
{
++nLevel;
if (name.equals(RTL_CONSTASCII_STRINGPARAM("property")))
collectProperty(reader, rID, aProperties);
}
if (res == xmlreader::XmlReader::RESULT_END)
{
--nLevel;
}
if (!nLevel)
break;
}
for (stringmap::iterator aI = aProperties.begin(), aEnd = aProperties.end(); aI != aEnd; ++aI)
{
const OString &rKey = aI->first;
const OString &rValue = aI->second;
if (rKey.match("AtkObject::"))
pWindow->set_property(rKey.copy(RTL_CONSTASCII_LENGTH("AtkObject::")), rValue);
else
SAL_WARN("vcl.layout", "unhandled atk prop: " << rKey.getStr());
fprintf(stderr, "setting atk props on %p\n", pWindow);
}
}
std::vector<OString> VclBuilder::handleItems(xmlreader::XmlReader &reader, const OString &rID) std::vector<OString> VclBuilder::handleItems(xmlreader::XmlReader &reader, const OString &rID)
{ {
int nLevel = 1; int nLevel = 1;
...@@ -1902,6 +1951,11 @@ Window* VclBuilder::handleObject(Window *pParent, xmlreader::XmlReader &reader) ...@@ -1902,6 +1951,11 @@ Window* VclBuilder::handleObject(Window *pParent, xmlreader::XmlReader &reader)
handleSizeGroup(reader, sID); handleSizeGroup(reader, sID);
return NULL; return NULL;
} }
else if (sClass == "AtkObject")
{
handleAtkObject(reader, sID, pParent);
return NULL;
}
int nLevel = 1; int nLevel = 1;
......
...@@ -1968,6 +1968,14 @@ bool Window::set_property(const OString &rKey, const OString &rValue) ...@@ -1968,6 +1968,14 @@ bool Window::set_property(const OString &rKey, const OString &rValue)
nBits |= WB_AUTOVSCROLL; nBits |= WB_AUTOVSCROLL;
SetStyle(nBits); SetStyle(nBits);
} }
else if (rKey == "accessible-name")
{
SetAccessibleName(OStringToOUString(rValue, RTL_TEXTENCODING_UTF8));
}
else if (rKey == "accessible-description")
{
SetAccessibleDescription(OStringToOUString(rValue, RTL_TEXTENCODING_UTF8));
}
else if (rKey == "use-markup") else if (rKey == "use-markup")
{ {
//https://live.gnome.org/GnomeGoals/RemoveMarkupInMessages //https://live.gnome.org/GnomeGoals/RemoveMarkupInMessages
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment