/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
if(eventName != eventMap.end())
{
- mDbusServer.emit2<std::string, int, int, DBus::EldbusVariant<int>, Address>(
- GetAccessiblePath(obj),
- Accessible::GetInterfaceName(AtspiInterface::EVENT_OBJECT),
- "PropertyChange",
- std::string{eventName->second},
- 0,
- 0,
- {0},
- {"", "root"});
+ AddCoalescableMessage(static_cast<CoalescableMessages>(static_cast<int>(CoalescableMessages::PROPERTY_CHANGED_BEGIN) + static_cast<int>(event)), obj, 1.0f, [=]() {
+ mDbusServer.emit2<std::string, int, int, DBus::EldbusVariant<int>, Address>(
+ GetAccessiblePath(obj),
+ Accessible::GetInterfaceName(AtspiInterface::EVENT_OBJECT),
+ "PropertyChange",
+ std::string{eventName->second},
+ 0,
+ 0,
+ {0},
+ {"", "root"});
+ });
}
}
{WindowEvent::SHADE, "Shade"},
{WindowEvent::UU_SHADE, "uUshade"},
{WindowEvent::RESTYLE, "Restyle"},
+ {WindowEvent::POST_RENDER, "PostRender"},
};
if(!IsUp() || obj->IsHidden() || obj->GetSuppressedEvents()[AtspiEvent::WINDOW_CHANGED])
if(stateName != stateMap.end())
{
- mDbusServer.emit2<std::string, int, int, DBus::EldbusVariant<int>, Address>(
- GetAccessiblePath(obj),
- Accessible::GetInterfaceName(AtspiInterface::EVENT_OBJECT),
- "StateChanged",
- std::string{stateName->second},
- newValue,
- reserved,
- {0},
- {"", "root"});
+ AddCoalescableMessage(static_cast<CoalescableMessages>(static_cast<int>(CoalescableMessages::STATE_CHANGED_BEGIN) + static_cast<int>(state)), obj, 1.0f, [=]() {
+ mDbusServer.emit2<std::string, int, int, DBus::EldbusVariant<int>, Address>(
+ GetAccessiblePath(obj),
+ Accessible::GetInterfaceName(AtspiInterface::EVENT_OBJECT),
+ "StateChanged",
+ std::string{stateName->second},
+ newValue,
+ reserved,
+ {0},
+ {"", "root"});
+ });
}
}
});
}
+void BridgeObject::EmitPostRender(Accessible *obj)
+{
+ if(!IsUp() || obj->IsHidden())
+ {
+ return;
+ }
+
+ 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])
obj->GetAddress(),
{"", "root"});
}
+
+void BridgeObject::EmitScrollStarted(Accessible* obj)
+{
+ if(!IsUp() || obj->IsHidden() || obj->GetSuppressedEvents()[AtspiEvent::SCROLL_STARTED])
+ {
+ return;
+ }
+
+ mDbusServer.emit2<std::string, int, int, DBus::EldbusVariant<int>, Address>(
+ GetAccessiblePath(obj),
+ Accessible::GetInterfaceName(AtspiInterface::EVENT_OBJECT),
+ "ScrollStarted",
+ "",
+ 0,
+ 0,
+ {0},
+ {"", "root"});
+}
+
+void BridgeObject::EmitScrollFinished(Accessible* obj)
+{
+ if(!IsUp() || obj->IsHidden() || obj->GetSuppressedEvents()[AtspiEvent::SCROLL_FINISHED])
+ {
+ return;
+ }
+
+ mDbusServer.emit2<std::string, int, int, DBus::EldbusVariant<int>, Address>(
+ GetAccessiblePath(obj),
+ Accessible::GetInterfaceName(AtspiInterface::EVENT_OBJECT),
+ "ScrollFinished",
+ "",
+ 0,
+ 0,
+ {0},
+ {"", "root"});
+}