When enabled with SetListenPostRender, the window Accessible emits countless
PostRender events on D-Bus. The CoalescableMessages mechanism can be used here
just like for BoundsChanged and SetOffset. This way, with this patch, the
PostRender events come at a steady rate. With CoalescableMessages at least one
event will still be emitted if requested, which is important for clients who
may depend on there being a PostRender event on the AT-SPI bus after a
particular operation -- there still is, but without the flooding.
Change-Id: Iab9451d3bff7bf57007388ed641ba543d40b52c1
virtual void EmitBoundsChanged(Accessible* obj, Rect<> rect) = 0;
/**
virtual void EmitBoundsChanged(Accessible* obj, Rect<> rect) = 0;
/**
+ * @brief Emits org.a11y.atspi.Event.Window.PostRender on the AT-SPI bus.
+ *
+ * @param[in] obj The Accessible sender object
+ *
+ * The sender of this event is expected to be an Accessible object that
+ * represents a top-level window.
+ *
+ * The actual number of events emitted during a given time interval may be smaller
+ * than the number of calls to this method, but at least one is guaranteed.
+ */
+ virtual void EmitPostRender(Accessible *obj) = 0;
+
+ /**
* @brief Emits key event on at-spi bus.
*
* Screen-reader might receive this event and reply, that given keycode is consumed. In that case
* @brief Emits key event on at-spi bus.
*
* Screen-reader might receive this event and reply, that given keycode is consumed. In that case
- Accessibility::Bridge::GetCurrentBridge()->Emit(Accessibility::Accessible::Get(Self()), Accessibility::WindowEvent::POST_RENDER);
+ Accessibility::Bridge::GetCurrentBridge()->EmitPostRender(this);
}; // AdaptorAccessible
using AdaptorAccessiblesType = std::unordered_map<const Dali::RefObject*, std::unique_ptr<AdaptorAccessible> >;
}; // AdaptorAccessible
using AdaptorAccessiblesType = std::unordered_map<const Dali::RefObject*, std::unique_ptr<AdaptorAccessible> >;
{
BOUNDS_CHANGED, ///< Bounds changed
SET_OFFSET, ///< Set offset
{
BOUNDS_CHANGED, ///< Bounds changed
SET_OFFSET, ///< Set offset
+ POST_RENDER, ///< Post render
};
// Custom specialization of std::hash
};
// Custom specialization of std::hash
+void BridgeObject::EmitPostRender(Accessible *obj)
+{
+ AddCoalescableMessage(CoalescableMessages::POST_RENDER, obj, 0.5f, [=]() {
+ Emit(obj, WindowEvent::POST_RENDER);
+ });
+}
+
void BridgeObject::EmitCursorMoved(Accessible* obj, unsigned int cursorPosition)
{
if(!IsUp() || obj->IsHidden() || obj->GetSuppressedEvents()[AtspiEvent::TEXT_CARET_MOVED])
void BridgeObject::EmitCursorMoved(Accessible* obj, unsigned int cursorPosition)
{
if(!IsUp() || obj->IsHidden() || obj->GetSuppressedEvents()[AtspiEvent::TEXT_CARET_MOVED])
Accessible::GetInterfaceName(AtspiInterface::EVENT_OBJECT),
"ScrollFinished",
{"", "root"});
Accessible::GetInterfaceName(AtspiInterface::EVENT_OBJECT),
"ScrollFinished",
{"", "root"});
-}
\ No newline at end of file
void EmitBoundsChanged(Dali::Accessibility::Accessible* obj, Dali::Rect<> rect) override;
/**
void EmitBoundsChanged(Dali::Accessibility::Accessible* obj, Dali::Rect<> rect) override;
/**
+ * @copydoc Dali::Accessibility::Bridge::EmitPostRender()
+ */
+ void EmitPostRender(Dali::Accessibility::Accessible* obj) override;
+
+ /**
* @copydoc Dali::Accessibility::Bridge::EmitMovedOutOfScreen()
*/
void EmitMovedOutOfScreen(Dali::Accessibility::Accessible* obj, Dali::Accessibility::ScreenRelativeMoveType type) override;
* @copydoc Dali::Accessibility::Bridge::EmitMovedOutOfScreen()
*/
void EmitMovedOutOfScreen(Dali::Accessibility::Accessible* obj, Dali::Accessibility::ScreenRelativeMoveType type) override;
+ void EmitPostRender(Accessibility::Accessible *obj) override
+ {
+ }
+
Accessibility::Consumed Emit(Accessibility::KeyEventType type, unsigned int keyCode, const std::string& keyName, unsigned int timeStamp, bool isText) override
{
return Accessibility::Consumed::YES;
Accessibility::Consumed Emit(Accessibility::KeyEventType type, unsigned int keyCode, const std::string& keyName, unsigned int timeStamp, bool isText) override
{
return Accessibility::Consumed::YES;