1 #include "BridgeObject.hpp"
5 using namespace Dali::Accessibility;
7 BridgeObject::BridgeObject()
11 void BridgeObject::RegisterInterfaces()
13 // DBus::DBusInterfaceDescription desc{ ATSPI_DBUS_INTERFACE_EVENT_OBJECT };
14 // stateChanged = addSignal<std::string, int, int, DBus::EldbusVariant<int>, Accessible*>(desc, "StateChanged");
15 // dbusServer.addInterface("/", desc, true);
18 void BridgeObject::Emit( Accessible* obj, WindowEvent we, unsigned int detail1 )
20 const char* name = nullptr;
23 case WindowEvent::PropertyChange:
25 name = "PropertyChange";
28 case WindowEvent::Minimize:
33 case WindowEvent::Maximize:
38 case WindowEvent::Restore:
43 case WindowEvent::Close:
48 case WindowEvent::Create:
53 case WindowEvent::Reparent:
58 case WindowEvent::DesktopCreate:
60 name = "DesktopCreate";
63 case WindowEvent::DesktopDestroy:
65 name = "DesktopDestroy";
68 case WindowEvent::Destroy:
73 case WindowEvent::Activate:
78 case WindowEvent::Deactivate:
83 case WindowEvent::Raise:
88 case WindowEvent::Lower:
93 case WindowEvent::Move:
98 case WindowEvent::Resize:
103 case WindowEvent::Shade:
108 case WindowEvent::UuShade:
113 case WindowEvent::Restyle:
121 auto addr = obj->GetAddress();
122 const auto prefixPath = "/org/a11y/atspi/accessible/";
123 const auto nullPath = "/org/a11y/atspi/null";
126 p = prefixPath + addr.GetPath();
129 dbusServer.emit2< std::string, int, int, DBus::EldbusVariant< int >, Address >(
131 ATSPI_DBUS_INTERFACE_EVENT_WINDOW,
137 {GetBusName(), "root"} );
141 void BridgeObject::EmitStateChanged( Accessible* obj, State state, int newValue1, int newValue2 )
143 const char* stateName = nullptr;
148 stateName = "invalid";
153 stateName = "active";
168 stateName = "checked";
171 case State::Collapsed:
173 stateName = "collapsed";
178 stateName = "defunct";
181 case State::Editable:
183 stateName = "editable";
188 stateName = "enabled";
191 case State::Expandable:
193 stateName = "expandable";
196 case State::Expanded:
198 stateName = "expanded";
201 case State::Focusable:
203 stateName = "focusable";
208 stateName = "focused";
211 case State::HasTooltip:
213 stateName = "has-tooltip";
216 case State::Horizontal:
218 stateName = "horizontal";
221 case State::Iconified:
223 stateName = "iconified";
231 case State::MultiLine:
233 stateName = "multi-line";
236 case State::MultiSelectable:
238 stateName = "multiselectable";
243 stateName = "opaque";
248 stateName = "pressed";
251 case State::Resizeable:
253 stateName = "resizable";
256 case State::Selectable:
258 stateName = "selectable";
261 case State::Selected:
263 stateName = "selected";
266 case State::Sensitive:
268 stateName = "sensitive";
273 stateName = "showing";
276 case State::SingleLine:
278 stateName = "single-line";
286 case State::Transient:
288 stateName = "transient";
291 case State::Vertical:
293 stateName = "vertical";
298 stateName = "visible";
301 case State::ManagesDescendants:
303 stateName = "manages-descendants";
306 case State::Indeterminate:
308 stateName = "indeterminate";
311 case State::Required:
313 stateName = "required";
316 case State::Truncated:
318 stateName = "truncated";
321 case State::Animated:
323 stateName = "animated";
326 case State::InvalidEntry:
328 stateName = "invalid-entry";
331 case State::SupportsAutocompletion:
333 stateName = "supports-autocompletion";
336 case State::SelectableText:
338 stateName = "selectable-text";
341 case State::IsDefault:
343 stateName = "is-default";
348 stateName = "visited";
351 case State::Checkable:
353 stateName = "checkable";
356 case State::HasPopup:
358 stateName = "has-popup";
361 case State::ReadOnly:
363 stateName = "read-only";
366 case State::Highlighted:
368 stateName = "highlighted";
371 case State::Highlightable:
373 stateName = "highlightable";
383 auto addr = obj->GetAddress();
384 const auto prefixPath = "/org/a11y/atspi/accessible/";
385 const auto nullPath = "/org/a11y/atspi/null";
388 p = prefixPath + addr.GetPath();
391 dbusServer.emit2< std::string, int, int, DBus::EldbusVariant< int >, Address >(
393 ATSPI_DBUS_INTERFACE_EVENT_OBJECT,
399 {GetBusName(), "root"} );