зеркало из https://github.com/mozilla/gecko-dev.git
bug 1164976 - fire useful state change and caret move events for proxies r=davidb
This commit is contained in:
Родитель
04a2598121
Коммит
f55ad57842
|
@ -1385,6 +1385,21 @@ a11y::ProxyEvent(ProxyAccessible* aTarget, uint32_t aEventType)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
a11y::ProxyStateChangeEvent(ProxyAccessible* aTarget, uint64_t aState,
|
||||
bool aEnabled)
|
||||
{
|
||||
MaiAtkObject* atkObj = MAI_ATK_OBJECT(GetWrapperFor(aTarget));
|
||||
atkObj->FireStateChangeEvent(aState, aEnabled);
|
||||
}
|
||||
|
||||
void
|
||||
a11y::ProxyCaretMoveEvent(ProxyAccessible* aTarget, int32_t aOffset)
|
||||
{
|
||||
AtkObject* wrapper = GetWrapperFor(aTarget);
|
||||
g_signal_emit_by_name(wrapper, "text_caret_moved", aOffset);
|
||||
}
|
||||
|
||||
void
|
||||
MaiAtkObject::FireStateChangeEvent(uint64_t aState, bool aEnabled)
|
||||
{
|
||||
|
|
|
@ -502,6 +502,17 @@ EventQueue::SendIPCEvent(AccEvent* aEvent) const
|
|||
if (!aEvent->GetAccessible()->IsApplication())
|
||||
ipcDoc->SendEvent(id, aEvent->GetEventType());
|
||||
break;
|
||||
case nsIAccessibleEvent::EVENT_STATE_CHANGE: {
|
||||
AccStateChangeEvent* event = downcast_accEvent(aEvent);
|
||||
ipcDoc->SendStateChangeEvent(id, event->GetState(),
|
||||
event->IsStateEnabled());
|
||||
break;
|
||||
}
|
||||
case nsIAccessibleEvent::EVENT_TEXT_CARET_MOVED: {
|
||||
AccCaretMoveEvent* event = downcast_accEvent(aEvent);
|
||||
ipcDoc->SendEvent(id, event->GetCaretOffset());
|
||||
break;
|
||||
}
|
||||
default:
|
||||
ipcDoc->SendEvent(id, aEvent->GetEventType());
|
||||
}
|
||||
|
|
|
@ -67,6 +67,9 @@ void ProxyDestroyed(ProxyAccessible*);
|
|||
* Callied when an event is fired on a proxied accessible.
|
||||
*/
|
||||
void ProxyEvent(ProxyAccessible* aTarget, uint32_t aEventType);
|
||||
void ProxyStateChangeEvent(ProxyAccessible* aTarget, uint64_t aState,
|
||||
bool aEnabled);
|
||||
void ProxyCaretMoveEvent(ProxyAccessible* aTarget, int32_t aOffset);
|
||||
} // namespace a11y
|
||||
} // namespace mozilla
|
||||
|
||||
|
|
|
@ -126,6 +126,30 @@ DocAccessibleParent::RecvEvent(const uint64_t& aID, const uint32_t& aEventType)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
DocAccessibleParent::RecvStateChangeEvent(const uint64_t& aID,
|
||||
const uint64_t& aState,
|
||||
const bool& aEnabled)
|
||||
{
|
||||
ProxyAccessible* target = GetAccessible(aID);
|
||||
if (!target)
|
||||
return false;
|
||||
|
||||
ProxyStateChangeEvent(target, aState, aEnabled);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
DocAccessibleParent::RecvCaretMoveEvent(const uint64_t& aID, const int32_t& aOffset)
|
||||
{
|
||||
ProxyAccessible* proxy = GetAccessible(aID);
|
||||
if (!proxy)
|
||||
return false;
|
||||
|
||||
ProxyCaretMoveEvent(proxy, aOffset);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
DocAccessibleParent::RecvBindChildDoc(PDocAccessibleParent* aChildDoc, const uint64_t& aID)
|
||||
{
|
||||
|
|
|
@ -44,6 +44,12 @@ public:
|
|||
|
||||
virtual bool RecvShowEvent(const ShowEventData& aData) override;
|
||||
virtual bool RecvHideEvent(const uint64_t& aRootID) override;
|
||||
virtual bool RecvStateChangeEvent(const uint64_t& aID,
|
||||
const uint64_t& aState,
|
||||
const bool& aEnabled) override final;
|
||||
|
||||
virtual bool RecvCaretMoveEvent(const uint64_t& aID, const int32_t& aOffset)
|
||||
override final;
|
||||
|
||||
virtual bool RecvBindChildDoc(PDocAccessibleParent* aChildDoc, const uint64_t& aID) override;
|
||||
void Unbind()
|
||||
|
|
|
@ -56,6 +56,8 @@ parent:
|
|||
Event(uint64_t aID, uint32_t type);
|
||||
ShowEvent(ShowEventData data);
|
||||
HideEvent(uint64_t aRootID);
|
||||
StateChangeEvent(uint64_t aID, uint64_t aState, bool aEnabled);
|
||||
CaretMoveEvent(uint64_t aID, int32_t aOffset);
|
||||
|
||||
/*
|
||||
* Tell the parent document to bind the existing document as a new child
|
||||
|
|
|
@ -47,6 +47,16 @@ void
|
|||
ProxyEvent(ProxyAccessible*, uint32_t)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
ProxyStateChangeEvent(ProxyAccessible*, uint64_t, bool)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
ProxyCaretMoveEvent(ProxyAccessible* aTarget, int32_t aOffset)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -33,3 +33,13 @@ void
|
|||
a11y::ProxyEvent(ProxyAccessible*, uint32_t)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
a11y::ProxyStateChangeEvent(ProxyAccessible*, uint64_t, bool)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
a11y::ProxyCaretMoveEvent(ProxyAccessible* aTarget, int32_t aOffset)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -58,3 +58,13 @@ void
|
|||
a11y::ProxyEvent(ProxyAccessible*, uint32_t)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
a11y::ProxyStateChangeEvent(ProxyAccessible*, uint64_t, bool)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
a11y::ProxyCaretMoveEvent(ProxyAccessible* aTarget, int32_t aOffset)
|
||||
{
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче