gecko-dev/accessible/atk/AccessibleWrap.cpp
Birunthan Mohanathas 3ceb752585 Bug 1028563 - Part 1: Flatten accessible/src/ directory. rs=surkov
--HG--
rename : accessible/src/atk/ARIAGridAccessibleWrap.h => accessible/atk/ARIAGridAccessibleWrap.h
rename : accessible/src/atk/AccessibleWrap.cpp => accessible/atk/AccessibleWrap.cpp
rename : accessible/src/atk/AccessibleWrap.h => accessible/atk/AccessibleWrap.h
rename : accessible/src/atk/ApplicationAccessibleWrap.cpp => accessible/atk/ApplicationAccessibleWrap.cpp
rename : accessible/src/atk/ApplicationAccessibleWrap.h => accessible/atk/ApplicationAccessibleWrap.h
rename : accessible/src/atk/AtkSocketAccessible.cpp => accessible/atk/AtkSocketAccessible.cpp
rename : accessible/src/atk/AtkSocketAccessible.h => accessible/atk/AtkSocketAccessible.h
rename : accessible/src/atk/DocAccessibleWrap.cpp => accessible/atk/DocAccessibleWrap.cpp
rename : accessible/src/atk/DocAccessibleWrap.h => accessible/atk/DocAccessibleWrap.h
rename : accessible/src/atk/HTMLTableAccessibleWrap.h => accessible/atk/HTMLTableAccessibleWrap.h
rename : accessible/src/atk/HyperTextAccessibleWrap.h => accessible/atk/HyperTextAccessibleWrap.h
rename : accessible/src/atk/ImageAccessibleWrap.h => accessible/atk/ImageAccessibleWrap.h
rename : accessible/src/atk/InterfaceInitFuncs.h => accessible/atk/InterfaceInitFuncs.h
rename : accessible/src/atk/Makefile.in => accessible/atk/Makefile.in
rename : accessible/src/atk/Platform.cpp => accessible/atk/Platform.cpp
rename : accessible/src/atk/RootAccessibleWrap.cpp => accessible/atk/RootAccessibleWrap.cpp
rename : accessible/src/atk/RootAccessibleWrap.h => accessible/atk/RootAccessibleWrap.h
rename : accessible/src/atk/TextLeafAccessibleWrap.h => accessible/atk/TextLeafAccessibleWrap.h
rename : accessible/src/atk/UtilInterface.cpp => accessible/atk/UtilInterface.cpp
rename : accessible/src/atk/XULListboxAccessibleWrap.h => accessible/atk/XULListboxAccessibleWrap.h
rename : accessible/src/atk/XULMenuAccessibleWrap.h => accessible/atk/XULMenuAccessibleWrap.h
rename : accessible/src/atk/XULTreeGridAccessibleWrap.h => accessible/atk/XULTreeGridAccessibleWrap.h
rename : accessible/src/atk/moz.build => accessible/atk/moz.build
rename : accessible/src/atk/nsMai.h => accessible/atk/nsMai.h
rename : accessible/src/atk/nsMaiHyperlink.cpp => accessible/atk/nsMaiHyperlink.cpp
rename : accessible/src/atk/nsMaiHyperlink.h => accessible/atk/nsMaiHyperlink.h
rename : accessible/src/atk/nsMaiInterfaceAction.cpp => accessible/atk/nsMaiInterfaceAction.cpp
rename : accessible/src/atk/nsMaiInterfaceComponent.cpp => accessible/atk/nsMaiInterfaceComponent.cpp
rename : accessible/src/atk/nsMaiInterfaceDocument.cpp => accessible/atk/nsMaiInterfaceDocument.cpp
rename : accessible/src/atk/nsMaiInterfaceEditableText.cpp => accessible/atk/nsMaiInterfaceEditableText.cpp
rename : accessible/src/atk/nsMaiInterfaceHyperlinkImpl.cpp => accessible/atk/nsMaiInterfaceHyperlinkImpl.cpp
rename : accessible/src/atk/nsMaiInterfaceHypertext.cpp => accessible/atk/nsMaiInterfaceHypertext.cpp
rename : accessible/src/atk/nsMaiInterfaceImage.cpp => accessible/atk/nsMaiInterfaceImage.cpp
rename : accessible/src/atk/nsMaiInterfaceSelection.cpp => accessible/atk/nsMaiInterfaceSelection.cpp
rename : accessible/src/atk/nsMaiInterfaceTable.cpp => accessible/atk/nsMaiInterfaceTable.cpp
rename : accessible/src/atk/nsMaiInterfaceText.cpp => accessible/atk/nsMaiInterfaceText.cpp
rename : accessible/src/atk/nsMaiInterfaceValue.cpp => accessible/atk/nsMaiInterfaceValue.cpp
rename : accessible/src/atk/nsStateMap.h => accessible/atk/nsStateMap.h
rename : accessible/src/base/ARIAMap.cpp => accessible/base/ARIAMap.cpp
rename : accessible/src/base/ARIAMap.h => accessible/base/ARIAMap.h
rename : accessible/src/base/ARIAStateMap.cpp => accessible/base/ARIAStateMap.cpp
rename : accessible/src/base/ARIAStateMap.h => accessible/base/ARIAStateMap.h
rename : accessible/src/base/AccCollector.cpp => accessible/base/AccCollector.cpp
rename : accessible/src/base/AccCollector.h => accessible/base/AccCollector.h
rename : accessible/src/base/AccEvent.cpp => accessible/base/AccEvent.cpp
rename : accessible/src/base/AccEvent.h => accessible/base/AccEvent.h
rename : accessible/src/base/AccGroupInfo.cpp => accessible/base/AccGroupInfo.cpp
rename : accessible/src/base/AccGroupInfo.h => accessible/base/AccGroupInfo.h
rename : accessible/src/base/AccIterator.cpp => accessible/base/AccIterator.cpp
rename : accessible/src/base/AccIterator.h => accessible/base/AccIterator.h
rename : accessible/src/base/AccTypes.h => accessible/base/AccTypes.h
rename : accessible/src/base/Asserts.cpp => accessible/base/Asserts.cpp
rename : accessible/src/base/DocManager.cpp => accessible/base/DocManager.cpp
rename : accessible/src/base/DocManager.h => accessible/base/DocManager.h
rename : accessible/src/base/EventQueue.cpp => accessible/base/EventQueue.cpp
rename : accessible/src/base/EventQueue.h => accessible/base/EventQueue.h
rename : accessible/src/base/Filters.cpp => accessible/base/Filters.cpp
rename : accessible/src/base/Filters.h => accessible/base/Filters.h
rename : accessible/src/base/FocusManager.cpp => accessible/base/FocusManager.cpp
rename : accessible/src/base/FocusManager.h => accessible/base/FocusManager.h
rename : accessible/src/base/Logging.cpp => accessible/base/Logging.cpp
rename : accessible/src/base/Logging.h => accessible/base/Logging.h
rename : accessible/src/base/Makefile.in => accessible/base/Makefile.in
rename : accessible/src/base/NotificationController.cpp => accessible/base/NotificationController.cpp
rename : accessible/src/base/NotificationController.h => accessible/base/NotificationController.h
rename : accessible/src/base/Platform.h => accessible/base/Platform.h
rename : accessible/src/base/Relation.h => accessible/base/Relation.h
rename : accessible/src/base/RelationType.h => accessible/base/RelationType.h
rename : accessible/src/base/RelationTypeMap.h => accessible/base/RelationTypeMap.h
rename : accessible/src/base/Role.h => accessible/base/Role.h
rename : accessible/src/base/RoleMap.h => accessible/base/RoleMap.h
rename : accessible/src/base/SelectionManager.cpp => accessible/base/SelectionManager.cpp
rename : accessible/src/base/SelectionManager.h => accessible/base/SelectionManager.h
rename : accessible/src/base/States.h => accessible/base/States.h
rename : accessible/src/base/Statistics.h => accessible/base/Statistics.h
rename : accessible/src/base/StyleInfo.cpp => accessible/base/StyleInfo.cpp
rename : accessible/src/base/StyleInfo.h => accessible/base/StyleInfo.h
rename : accessible/src/base/TextAttrs.cpp => accessible/base/TextAttrs.cpp
rename : accessible/src/base/TextAttrs.h => accessible/base/TextAttrs.h
rename : accessible/src/base/TextRange.cpp => accessible/base/TextRange.cpp
rename : accessible/src/base/TextRange.h => accessible/base/TextRange.h
rename : accessible/src/base/TextUpdater.cpp => accessible/base/TextUpdater.cpp
rename : accessible/src/base/TextUpdater.h => accessible/base/TextUpdater.h
rename : accessible/src/base/TreeWalker.cpp => accessible/base/TreeWalker.cpp
rename : accessible/src/base/TreeWalker.h => accessible/base/TreeWalker.h
rename : accessible/src/base/moz.build => accessible/base/moz.build
rename : accessible/src/base/nsAccCache.h => accessible/base/nsAccCache.h
rename : accessible/src/base/nsAccUtils.cpp => accessible/base/nsAccUtils.cpp
rename : accessible/src/base/nsAccUtils.h => accessible/base/nsAccUtils.h
rename : accessible/src/base/nsAccessibilityService.cpp => accessible/base/nsAccessibilityService.cpp
rename : accessible/src/base/nsAccessibilityService.h => accessible/base/nsAccessibilityService.h
rename : accessible/src/base/nsAccessiblePivot.cpp => accessible/base/nsAccessiblePivot.cpp
rename : accessible/src/base/nsAccessiblePivot.h => accessible/base/nsAccessiblePivot.h
rename : accessible/src/base/nsCoreUtils.cpp => accessible/base/nsCoreUtils.cpp
rename : accessible/src/base/nsCoreUtils.h => accessible/base/nsCoreUtils.h
rename : accessible/src/base/nsEventShell.cpp => accessible/base/nsEventShell.cpp
rename : accessible/src/base/nsEventShell.h => accessible/base/nsEventShell.h
rename : accessible/src/base/nsTextEquivUtils.cpp => accessible/base/nsTextEquivUtils.cpp
rename : accessible/src/base/nsTextEquivUtils.h => accessible/base/nsTextEquivUtils.h
rename : accessible/src/generic/ARIAGridAccessible-inl.h => accessible/generic/ARIAGridAccessible-inl.h
rename : accessible/src/generic/ARIAGridAccessible.cpp => accessible/generic/ARIAGridAccessible.cpp
rename : accessible/src/generic/ARIAGridAccessible.h => accessible/generic/ARIAGridAccessible.h
rename : accessible/src/generic/Accessible-inl.h => accessible/generic/Accessible-inl.h
rename : accessible/src/generic/Accessible.cpp => accessible/generic/Accessible.cpp
rename : accessible/src/generic/Accessible.h => accessible/generic/Accessible.h
rename : accessible/src/generic/ApplicationAccessible.cpp => accessible/generic/ApplicationAccessible.cpp
rename : accessible/src/generic/ApplicationAccessible.h => accessible/generic/ApplicationAccessible.h
rename : accessible/src/generic/BaseAccessibles.cpp => accessible/generic/BaseAccessibles.cpp
rename : accessible/src/generic/BaseAccessibles.h => accessible/generic/BaseAccessibles.h
rename : accessible/src/generic/DocAccessible-inl.h => accessible/generic/DocAccessible-inl.h
rename : accessible/src/generic/DocAccessible.cpp => accessible/generic/DocAccessible.cpp
rename : accessible/src/generic/DocAccessible.h => accessible/generic/DocAccessible.h
rename : accessible/src/generic/FormControlAccessible.cpp => accessible/generic/FormControlAccessible.cpp
rename : accessible/src/generic/FormControlAccessible.h => accessible/generic/FormControlAccessible.h
rename : accessible/src/generic/HyperTextAccessible-inl.h => accessible/generic/HyperTextAccessible-inl.h
rename : accessible/src/generic/HyperTextAccessible.cpp => accessible/generic/HyperTextAccessible.cpp
rename : accessible/src/generic/HyperTextAccessible.h => accessible/generic/HyperTextAccessible.h
rename : accessible/src/generic/ImageAccessible.cpp => accessible/generic/ImageAccessible.cpp
rename : accessible/src/generic/ImageAccessible.h => accessible/generic/ImageAccessible.h
rename : accessible/src/generic/OuterDocAccessible.cpp => accessible/generic/OuterDocAccessible.cpp
rename : accessible/src/generic/OuterDocAccessible.h => accessible/generic/OuterDocAccessible.h
rename : accessible/src/generic/RootAccessible.cpp => accessible/generic/RootAccessible.cpp
rename : accessible/src/generic/RootAccessible.h => accessible/generic/RootAccessible.h
rename : accessible/src/generic/TableAccessible.h => accessible/generic/TableAccessible.h
rename : accessible/src/generic/TableCellAccessible.cpp => accessible/generic/TableCellAccessible.cpp
rename : accessible/src/generic/TableCellAccessible.h => accessible/generic/TableCellAccessible.h
rename : accessible/src/generic/TextLeafAccessible.cpp => accessible/generic/TextLeafAccessible.cpp
rename : accessible/src/generic/TextLeafAccessible.h => accessible/generic/TextLeafAccessible.h
rename : accessible/src/generic/moz.build => accessible/generic/moz.build
rename : accessible/src/html/HTMLCanvasAccessible.cpp => accessible/html/HTMLCanvasAccessible.cpp
rename : accessible/src/html/HTMLCanvasAccessible.h => accessible/html/HTMLCanvasAccessible.h
rename : accessible/src/html/HTMLElementAccessibles.cpp => accessible/html/HTMLElementAccessibles.cpp
rename : accessible/src/html/HTMLElementAccessibles.h => accessible/html/HTMLElementAccessibles.h
rename : accessible/src/html/HTMLFormControlAccessible.cpp => accessible/html/HTMLFormControlAccessible.cpp
rename : accessible/src/html/HTMLFormControlAccessible.h => accessible/html/HTMLFormControlAccessible.h
rename : accessible/src/html/HTMLImageMapAccessible.cpp => accessible/html/HTMLImageMapAccessible.cpp
rename : accessible/src/html/HTMLImageMapAccessible.h => accessible/html/HTMLImageMapAccessible.h
rename : accessible/src/html/HTMLLinkAccessible.cpp => accessible/html/HTMLLinkAccessible.cpp
rename : accessible/src/html/HTMLLinkAccessible.h => accessible/html/HTMLLinkAccessible.h
rename : accessible/src/html/HTMLListAccessible.cpp => accessible/html/HTMLListAccessible.cpp
rename : accessible/src/html/HTMLListAccessible.h => accessible/html/HTMLListAccessible.h
rename : accessible/src/html/HTMLSelectAccessible.cpp => accessible/html/HTMLSelectAccessible.cpp
rename : accessible/src/html/HTMLSelectAccessible.h => accessible/html/HTMLSelectAccessible.h
rename : accessible/src/html/HTMLTableAccessible.cpp => accessible/html/HTMLTableAccessible.cpp
rename : accessible/src/html/HTMLTableAccessible.h => accessible/html/HTMLTableAccessible.h
rename : accessible/src/html/moz.build => accessible/html/moz.build
rename : accessible/src/jsat/AccessFu.css => accessible/jsat/AccessFu.css
rename : accessible/src/jsat/AccessFu.jsm => accessible/jsat/AccessFu.jsm
rename : accessible/src/jsat/Constants.jsm => accessible/jsat/Constants.jsm
rename : accessible/src/jsat/ContentControl.jsm => accessible/jsat/ContentControl.jsm
rename : accessible/src/jsat/EventManager.jsm => accessible/jsat/EventManager.jsm
rename : accessible/src/jsat/Gestures.jsm => accessible/jsat/Gestures.jsm
rename : accessible/src/jsat/OutputGenerator.jsm => accessible/jsat/OutputGenerator.jsm
rename : accessible/src/jsat/PointerAdapter.jsm => accessible/jsat/PointerAdapter.jsm
rename : accessible/src/jsat/Presentation.jsm => accessible/jsat/Presentation.jsm
rename : accessible/src/jsat/TraversalRules.jsm => accessible/jsat/TraversalRules.jsm
rename : accessible/src/jsat/Utils.jsm => accessible/jsat/Utils.jsm
rename : accessible/src/jsat/content-script.js => accessible/jsat/content-script.js
rename : accessible/src/jsat/jar.mn => accessible/jsat/jar.mn
rename : accessible/src/jsat/moz.build => accessible/jsat/moz.build
rename : accessible/src/jsat/sounds/clicked.ogg => accessible/jsat/sounds/clicked.ogg
rename : accessible/src/jsat/sounds/virtual_cursor_key.ogg => accessible/jsat/sounds/virtual_cursor_key.ogg
rename : accessible/src/jsat/sounds/virtual_cursor_move.ogg => accessible/jsat/sounds/virtual_cursor_move.ogg
rename : accessible/src/mac/ARIAGridAccessibleWrap.h => accessible/mac/ARIAGridAccessibleWrap.h
rename : accessible/src/mac/AccessibleWrap.h => accessible/mac/AccessibleWrap.h
rename : accessible/src/mac/AccessibleWrap.mm => accessible/mac/AccessibleWrap.mm
rename : accessible/src/mac/ApplicationAccessibleWrap.h => accessible/mac/ApplicationAccessibleWrap.h
rename : accessible/src/mac/DocAccessibleWrap.h => accessible/mac/DocAccessibleWrap.h
rename : accessible/src/mac/DocAccessibleWrap.mm => accessible/mac/DocAccessibleWrap.mm
rename : accessible/src/mac/HTMLTableAccessibleWrap.h => accessible/mac/HTMLTableAccessibleWrap.h
rename : accessible/src/mac/HyperTextAccessibleWrap.h => accessible/mac/HyperTextAccessibleWrap.h
rename : accessible/src/mac/ImageAccessibleWrap.h => accessible/mac/ImageAccessibleWrap.h
rename : accessible/src/mac/MacUtils.h => accessible/mac/MacUtils.h
rename : accessible/src/mac/MacUtils.mm => accessible/mac/MacUtils.mm
rename : accessible/src/mac/Platform.mm => accessible/mac/Platform.mm
rename : accessible/src/mac/RootAccessibleWrap.h => accessible/mac/RootAccessibleWrap.h
rename : accessible/src/mac/RootAccessibleWrap.mm => accessible/mac/RootAccessibleWrap.mm
rename : accessible/src/mac/TextLeafAccessibleWrap.h => accessible/mac/TextLeafAccessibleWrap.h
rename : accessible/src/mac/XULListboxAccessibleWrap.h => accessible/mac/XULListboxAccessibleWrap.h
rename : accessible/src/mac/XULMenuAccessibleWrap.h => accessible/mac/XULMenuAccessibleWrap.h
rename : accessible/src/mac/XULTreeGridAccessibleWrap.h => accessible/mac/XULTreeGridAccessibleWrap.h
rename : accessible/src/mac/moz.build => accessible/mac/moz.build
rename : accessible/src/mac/mozAccessible.h => accessible/mac/mozAccessible.h
rename : accessible/src/mac/mozAccessible.mm => accessible/mac/mozAccessible.mm
rename : accessible/src/mac/mozAccessibleProtocol.h => accessible/mac/mozAccessibleProtocol.h
rename : accessible/src/mac/mozActionElements.h => accessible/mac/mozActionElements.h
rename : accessible/src/mac/mozActionElements.mm => accessible/mac/mozActionElements.mm
rename : accessible/src/mac/mozDocAccessible.h => accessible/mac/mozDocAccessible.h
rename : accessible/src/mac/mozDocAccessible.mm => accessible/mac/mozDocAccessible.mm
rename : accessible/src/mac/mozHTMLAccessible.h => accessible/mac/mozHTMLAccessible.h
rename : accessible/src/mac/mozHTMLAccessible.mm => accessible/mac/mozHTMLAccessible.mm
rename : accessible/src/mac/mozTextAccessible.h => accessible/mac/mozTextAccessible.h
rename : accessible/src/mac/mozTextAccessible.mm => accessible/mac/mozTextAccessible.mm
rename : accessible/src/other/ARIAGridAccessibleWrap.h => accessible/other/ARIAGridAccessibleWrap.h
rename : accessible/src/other/AccessibleWrap.cpp => accessible/other/AccessibleWrap.cpp
rename : accessible/src/other/AccessibleWrap.h => accessible/other/AccessibleWrap.h
rename : accessible/src/other/ApplicationAccessibleWrap.h => accessible/other/ApplicationAccessibleWrap.h
rename : accessible/src/other/DocAccessibleWrap.h => accessible/other/DocAccessibleWrap.h
rename : accessible/src/other/HTMLTableAccessibleWrap.h => accessible/other/HTMLTableAccessibleWrap.h
rename : accessible/src/other/HyperTextAccessibleWrap.h => accessible/other/HyperTextAccessibleWrap.h
rename : accessible/src/other/ImageAccessibleWrap.h => accessible/other/ImageAccessibleWrap.h
rename : accessible/src/other/Platform.cpp => accessible/other/Platform.cpp
rename : accessible/src/other/RootAccessibleWrap.h => accessible/other/RootAccessibleWrap.h
rename : accessible/src/other/TextLeafAccessibleWrap.h => accessible/other/TextLeafAccessibleWrap.h
rename : accessible/src/other/XULListboxAccessibleWrap.h => accessible/other/XULListboxAccessibleWrap.h
rename : accessible/src/other/XULMenuAccessibleWrap.h => accessible/other/XULMenuAccessibleWrap.h
rename : accessible/src/other/XULTreeGridAccessibleWrap.h => accessible/other/XULTreeGridAccessibleWrap.h
rename : accessible/src/other/moz.build => accessible/other/moz.build
rename : accessible/src/windows/ia2/Makefile.in => accessible/windows/ia2/Makefile.in
rename : accessible/src/windows/ia2/ia2Accessible.cpp => accessible/windows/ia2/ia2Accessible.cpp
rename : accessible/src/windows/ia2/ia2Accessible.h => accessible/windows/ia2/ia2Accessible.h
rename : accessible/src/windows/ia2/ia2AccessibleAction.cpp => accessible/windows/ia2/ia2AccessibleAction.cpp
rename : accessible/src/windows/ia2/ia2AccessibleAction.h => accessible/windows/ia2/ia2AccessibleAction.h
rename : accessible/src/windows/ia2/ia2AccessibleComponent.cpp => accessible/windows/ia2/ia2AccessibleComponent.cpp
rename : accessible/src/windows/ia2/ia2AccessibleComponent.h => accessible/windows/ia2/ia2AccessibleComponent.h
rename : accessible/src/windows/ia2/ia2AccessibleEditableText.cpp => accessible/windows/ia2/ia2AccessibleEditableText.cpp
rename : accessible/src/windows/ia2/ia2AccessibleEditableText.h => accessible/windows/ia2/ia2AccessibleEditableText.h
rename : accessible/src/windows/ia2/ia2AccessibleHyperlink.cpp => accessible/windows/ia2/ia2AccessibleHyperlink.cpp
rename : accessible/src/windows/ia2/ia2AccessibleHyperlink.h => accessible/windows/ia2/ia2AccessibleHyperlink.h
rename : accessible/src/windows/ia2/ia2AccessibleHypertext.cpp => accessible/windows/ia2/ia2AccessibleHypertext.cpp
rename : accessible/src/windows/ia2/ia2AccessibleHypertext.h => accessible/windows/ia2/ia2AccessibleHypertext.h
rename : accessible/src/windows/ia2/ia2AccessibleImage.cpp => accessible/windows/ia2/ia2AccessibleImage.cpp
rename : accessible/src/windows/ia2/ia2AccessibleImage.h => accessible/windows/ia2/ia2AccessibleImage.h
rename : accessible/src/windows/ia2/ia2AccessibleRelation.cpp => accessible/windows/ia2/ia2AccessibleRelation.cpp
rename : accessible/src/windows/ia2/ia2AccessibleRelation.h => accessible/windows/ia2/ia2AccessibleRelation.h
rename : accessible/src/windows/ia2/ia2AccessibleTable.cpp => accessible/windows/ia2/ia2AccessibleTable.cpp
rename : accessible/src/windows/ia2/ia2AccessibleTable.h => accessible/windows/ia2/ia2AccessibleTable.h
rename : accessible/src/windows/ia2/ia2AccessibleTableCell.cpp => accessible/windows/ia2/ia2AccessibleTableCell.cpp
rename : accessible/src/windows/ia2/ia2AccessibleTableCell.h => accessible/windows/ia2/ia2AccessibleTableCell.h
rename : accessible/src/windows/ia2/ia2AccessibleText.cpp => accessible/windows/ia2/ia2AccessibleText.cpp
rename : accessible/src/windows/ia2/ia2AccessibleText.h => accessible/windows/ia2/ia2AccessibleText.h
rename : accessible/src/windows/ia2/ia2AccessibleValue.cpp => accessible/windows/ia2/ia2AccessibleValue.cpp
rename : accessible/src/windows/ia2/ia2AccessibleValue.h => accessible/windows/ia2/ia2AccessibleValue.h
rename : accessible/src/windows/ia2/moz.build => accessible/windows/ia2/moz.build
rename : accessible/src/windows/moz.build => accessible/windows/moz.build
rename : accessible/src/windows/msaa/ARIAGridAccessibleWrap.cpp => accessible/windows/msaa/ARIAGridAccessibleWrap.cpp
rename : accessible/src/windows/msaa/ARIAGridAccessibleWrap.h => accessible/windows/msaa/ARIAGridAccessibleWrap.h
rename : accessible/src/windows/msaa/AccessibleWrap.cpp => accessible/windows/msaa/AccessibleWrap.cpp
rename : accessible/src/windows/msaa/AccessibleWrap.h => accessible/windows/msaa/AccessibleWrap.h
rename : accessible/src/windows/msaa/ApplicationAccessibleWrap.cpp => accessible/windows/msaa/ApplicationAccessibleWrap.cpp
rename : accessible/src/windows/msaa/ApplicationAccessibleWrap.h => accessible/windows/msaa/ApplicationAccessibleWrap.h
rename : accessible/src/windows/msaa/Compatibility.cpp => accessible/windows/msaa/Compatibility.cpp
rename : accessible/src/windows/msaa/Compatibility.h => accessible/windows/msaa/Compatibility.h
rename : accessible/src/windows/msaa/DocAccessibleWrap.cpp => accessible/windows/msaa/DocAccessibleWrap.cpp
rename : accessible/src/windows/msaa/DocAccessibleWrap.h => accessible/windows/msaa/DocAccessibleWrap.h
rename : accessible/src/windows/msaa/EnumVariant.cpp => accessible/windows/msaa/EnumVariant.cpp
rename : accessible/src/windows/msaa/EnumVariant.h => accessible/windows/msaa/EnumVariant.h
rename : accessible/src/windows/msaa/HTMLTableAccessibleWrap.cpp => accessible/windows/msaa/HTMLTableAccessibleWrap.cpp
rename : accessible/src/windows/msaa/HTMLTableAccessibleWrap.h => accessible/windows/msaa/HTMLTableAccessibleWrap.h
rename : accessible/src/windows/msaa/HTMLWin32ObjectAccessible.cpp => accessible/windows/msaa/HTMLWin32ObjectAccessible.cpp
rename : accessible/src/windows/msaa/HTMLWin32ObjectAccessible.h => accessible/windows/msaa/HTMLWin32ObjectAccessible.h
rename : accessible/src/windows/msaa/HyperTextAccessibleWrap.cpp => accessible/windows/msaa/HyperTextAccessibleWrap.cpp
rename : accessible/src/windows/msaa/HyperTextAccessibleWrap.h => accessible/windows/msaa/HyperTextAccessibleWrap.h
rename : accessible/src/windows/msaa/IUnknownImpl.cpp => accessible/windows/msaa/IUnknownImpl.cpp
rename : accessible/src/windows/msaa/IUnknownImpl.h => accessible/windows/msaa/IUnknownImpl.h
rename : accessible/src/windows/msaa/ImageAccessibleWrap.cpp => accessible/windows/msaa/ImageAccessibleWrap.cpp
rename : accessible/src/windows/msaa/ImageAccessibleWrap.h => accessible/windows/msaa/ImageAccessibleWrap.h
rename : accessible/src/windows/msaa/Platform.cpp => accessible/windows/msaa/Platform.cpp
rename : accessible/src/windows/msaa/RootAccessibleWrap.cpp => accessible/windows/msaa/RootAccessibleWrap.cpp
rename : accessible/src/windows/msaa/RootAccessibleWrap.h => accessible/windows/msaa/RootAccessibleWrap.h
rename : accessible/src/windows/msaa/ServiceProvider.cpp => accessible/windows/msaa/ServiceProvider.cpp
rename : accessible/src/windows/msaa/ServiceProvider.h => accessible/windows/msaa/ServiceProvider.h
rename : accessible/src/windows/msaa/TextLeafAccessibleWrap.cpp => accessible/windows/msaa/TextLeafAccessibleWrap.cpp
rename : accessible/src/windows/msaa/TextLeafAccessibleWrap.h => accessible/windows/msaa/TextLeafAccessibleWrap.h
rename : accessible/src/windows/msaa/XULListboxAccessibleWrap.cpp => accessible/windows/msaa/XULListboxAccessibleWrap.cpp
rename : accessible/src/windows/msaa/XULListboxAccessibleWrap.h => accessible/windows/msaa/XULListboxAccessibleWrap.h
rename : accessible/src/windows/msaa/XULMenuAccessibleWrap.cpp => accessible/windows/msaa/XULMenuAccessibleWrap.cpp
rename : accessible/src/windows/msaa/XULMenuAccessibleWrap.h => accessible/windows/msaa/XULMenuAccessibleWrap.h
rename : accessible/src/windows/msaa/XULTreeGridAccessibleWrap.cpp => accessible/windows/msaa/XULTreeGridAccessibleWrap.cpp
rename : accessible/src/windows/msaa/XULTreeGridAccessibleWrap.h => accessible/windows/msaa/XULTreeGridAccessibleWrap.h
rename : accessible/src/windows/msaa/moz.build => accessible/windows/msaa/moz.build
rename : accessible/src/windows/msaa/nsEventMap.h => accessible/windows/msaa/nsEventMap.h
rename : accessible/src/windows/msaa/nsWinUtils.cpp => accessible/windows/msaa/nsWinUtils.cpp
rename : accessible/src/windows/msaa/nsWinUtils.h => accessible/windows/msaa/nsWinUtils.h
rename : accessible/src/windows/sdn/moz.build => accessible/windows/sdn/moz.build
rename : accessible/src/windows/sdn/sdnAccessible-inl.h => accessible/windows/sdn/sdnAccessible-inl.h
rename : accessible/src/windows/sdn/sdnAccessible.cpp => accessible/windows/sdn/sdnAccessible.cpp
rename : accessible/src/windows/sdn/sdnAccessible.h => accessible/windows/sdn/sdnAccessible.h
rename : accessible/src/windows/sdn/sdnDocAccessible.cpp => accessible/windows/sdn/sdnDocAccessible.cpp
rename : accessible/src/windows/sdn/sdnDocAccessible.h => accessible/windows/sdn/sdnDocAccessible.h
rename : accessible/src/windows/sdn/sdnTextAccessible.cpp => accessible/windows/sdn/sdnTextAccessible.cpp
rename : accessible/src/windows/sdn/sdnTextAccessible.h => accessible/windows/sdn/sdnTextAccessible.h
rename : accessible/src/windows/uia/Makefile.in => accessible/windows/uia/Makefile.in
rename : accessible/src/windows/uia/moz.build => accessible/windows/uia/moz.build
rename : accessible/src/windows/uia/uiaRawElmProvider.cpp => accessible/windows/uia/uiaRawElmProvider.cpp
rename : accessible/src/windows/uia/uiaRawElmProvider.h => accessible/windows/uia/uiaRawElmProvider.h
rename : accessible/src/xpcom/AccEventGen.py => accessible/xpcom/AccEventGen.py
rename : accessible/src/xpcom/AccEvents.conf => accessible/xpcom/AccEvents.conf
rename : accessible/src/xpcom/Makefile.in => accessible/xpcom/Makefile.in
rename : accessible/src/xpcom/moz.build => accessible/xpcom/moz.build
rename : accessible/src/xpcom/nsAccessibleRelation.cpp => accessible/xpcom/nsAccessibleRelation.cpp
rename : accessible/src/xpcom/nsAccessibleRelation.h => accessible/xpcom/nsAccessibleRelation.h
rename : accessible/src/xpcom/xpcAccessibleHyperText.cpp => accessible/xpcom/xpcAccessibleHyperText.cpp
rename : accessible/src/xpcom/xpcAccessibleHyperText.h => accessible/xpcom/xpcAccessibleHyperText.h
rename : accessible/src/xpcom/xpcAccessibleSelectable.cpp => accessible/xpcom/xpcAccessibleSelectable.cpp
rename : accessible/src/xpcom/xpcAccessibleSelectable.h => accessible/xpcom/xpcAccessibleSelectable.h
rename : accessible/src/xpcom/xpcAccessibleTable.cpp => accessible/xpcom/xpcAccessibleTable.cpp
rename : accessible/src/xpcom/xpcAccessibleTable.h => accessible/xpcom/xpcAccessibleTable.h
rename : accessible/src/xpcom/xpcAccessibleTableCell.cpp => accessible/xpcom/xpcAccessibleTableCell.cpp
rename : accessible/src/xpcom/xpcAccessibleTableCell.h => accessible/xpcom/xpcAccessibleTableCell.h
rename : accessible/src/xpcom/xpcAccessibleTextRange.cpp => accessible/xpcom/xpcAccessibleTextRange.cpp
rename : accessible/src/xpcom/xpcAccessibleTextRange.h => accessible/xpcom/xpcAccessibleTextRange.h
rename : accessible/src/xpcom/xpcAccessibleValue.cpp => accessible/xpcom/xpcAccessibleValue.cpp
rename : accessible/src/xpcom/xpcAccessibleValue.h => accessible/xpcom/xpcAccessibleValue.h
rename : accessible/src/xul/XULAlertAccessible.cpp => accessible/xul/XULAlertAccessible.cpp
rename : accessible/src/xul/XULAlertAccessible.h => accessible/xul/XULAlertAccessible.h
rename : accessible/src/xul/XULColorPickerAccessible.cpp => accessible/xul/XULColorPickerAccessible.cpp
rename : accessible/src/xul/XULColorPickerAccessible.h => accessible/xul/XULColorPickerAccessible.h
rename : accessible/src/xul/XULComboboxAccessible.cpp => accessible/xul/XULComboboxAccessible.cpp
rename : accessible/src/xul/XULComboboxAccessible.h => accessible/xul/XULComboboxAccessible.h
rename : accessible/src/xul/XULElementAccessibles.cpp => accessible/xul/XULElementAccessibles.cpp
rename : accessible/src/xul/XULElementAccessibles.h => accessible/xul/XULElementAccessibles.h
rename : accessible/src/xul/XULFormControlAccessible.cpp => accessible/xul/XULFormControlAccessible.cpp
rename : accessible/src/xul/XULFormControlAccessible.h => accessible/xul/XULFormControlAccessible.h
rename : accessible/src/xul/XULListboxAccessible.cpp => accessible/xul/XULListboxAccessible.cpp
rename : accessible/src/xul/XULListboxAccessible.h => accessible/xul/XULListboxAccessible.h
rename : accessible/src/xul/XULMenuAccessible.cpp => accessible/xul/XULMenuAccessible.cpp
rename : accessible/src/xul/XULMenuAccessible.h => accessible/xul/XULMenuAccessible.h
rename : accessible/src/xul/XULSelectControlAccessible.cpp => accessible/xul/XULSelectControlAccessible.cpp
rename : accessible/src/xul/XULSelectControlAccessible.h => accessible/xul/XULSelectControlAccessible.h
rename : accessible/src/xul/XULSliderAccessible.cpp => accessible/xul/XULSliderAccessible.cpp
rename : accessible/src/xul/XULSliderAccessible.h => accessible/xul/XULSliderAccessible.h
rename : accessible/src/xul/XULTabAccessible.cpp => accessible/xul/XULTabAccessible.cpp
rename : accessible/src/xul/XULTabAccessible.h => accessible/xul/XULTabAccessible.h
rename : accessible/src/xul/XULTreeAccessible.cpp => accessible/xul/XULTreeAccessible.cpp
rename : accessible/src/xul/XULTreeAccessible.h => accessible/xul/XULTreeAccessible.h
rename : accessible/src/xul/XULTreeGridAccessible.cpp => accessible/xul/XULTreeGridAccessible.cpp
rename : accessible/src/xul/XULTreeGridAccessible.h => accessible/xul/XULTreeGridAccessible.h
rename : accessible/src/xul/moz.build => accessible/xul/moz.build
2014-06-22 10:15:19 -07:00

1305 lines
40 KiB
C++

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "AccessibleWrap.h"
#include "Accessible-inl.h"
#include "ApplicationAccessibleWrap.h"
#include "InterfaceInitFuncs.h"
#include "nsAccUtils.h"
#include "nsIAccessibleRelation.h"
#include "nsIAccessibleTable.h"
#include "RootAccessible.h"
#include "nsIAccessibleValue.h"
#include "nsMai.h"
#include "nsMaiHyperlink.h"
#include "nsString.h"
#include "nsAutoPtr.h"
#include "prprf.h"
#include "nsStateMap.h"
#include "Relation.h"
#include "RootAccessible.h"
#include "States.h"
#include "nsISimpleEnumerator.h"
#include "mozilla/ArrayUtils.h"
#include "nsXPCOMStrings.h"
#include "nsComponentManagerUtils.h"
#include "nsIPersistentProperties2.h"
using namespace mozilla;
using namespace mozilla::a11y;
AccessibleWrap::EAvailableAtkSignals AccessibleWrap::gAvailableAtkSignals =
eUnknown;
//defined in ApplicationAccessibleWrap.cpp
extern "C" GType g_atk_hyperlink_impl_type;
/* MaiAtkObject */
enum {
ACTIVATE,
CREATE,
DEACTIVATE,
DESTROY,
MAXIMIZE,
MINIMIZE,
RESIZE,
RESTORE,
LAST_SIGNAL
};
enum MaiInterfaceType {
MAI_INTERFACE_COMPONENT, /* 0 */
MAI_INTERFACE_ACTION,
MAI_INTERFACE_VALUE,
MAI_INTERFACE_EDITABLE_TEXT,
MAI_INTERFACE_HYPERTEXT,
MAI_INTERFACE_HYPERLINK_IMPL,
MAI_INTERFACE_SELECTION,
MAI_INTERFACE_TABLE,
MAI_INTERFACE_TEXT,
MAI_INTERFACE_DOCUMENT,
MAI_INTERFACE_IMAGE /* 10 */
};
static GType GetAtkTypeForMai(MaiInterfaceType type)
{
switch (type) {
case MAI_INTERFACE_COMPONENT:
return ATK_TYPE_COMPONENT;
case MAI_INTERFACE_ACTION:
return ATK_TYPE_ACTION;
case MAI_INTERFACE_VALUE:
return ATK_TYPE_VALUE;
case MAI_INTERFACE_EDITABLE_TEXT:
return ATK_TYPE_EDITABLE_TEXT;
case MAI_INTERFACE_HYPERTEXT:
return ATK_TYPE_HYPERTEXT;
case MAI_INTERFACE_HYPERLINK_IMPL:
return g_atk_hyperlink_impl_type;
case MAI_INTERFACE_SELECTION:
return ATK_TYPE_SELECTION;
case MAI_INTERFACE_TABLE:
return ATK_TYPE_TABLE;
case MAI_INTERFACE_TEXT:
return ATK_TYPE_TEXT;
case MAI_INTERFACE_DOCUMENT:
return ATK_TYPE_DOCUMENT;
case MAI_INTERFACE_IMAGE:
return ATK_TYPE_IMAGE;
}
return G_TYPE_INVALID;
}
static const char* kNonUserInputEvent = ":system";
static const GInterfaceInfo atk_if_infos[] = {
{(GInterfaceInitFunc)componentInterfaceInitCB,
(GInterfaceFinalizeFunc) nullptr, nullptr},
{(GInterfaceInitFunc)actionInterfaceInitCB,
(GInterfaceFinalizeFunc) nullptr, nullptr},
{(GInterfaceInitFunc)valueInterfaceInitCB,
(GInterfaceFinalizeFunc) nullptr, nullptr},
{(GInterfaceInitFunc)editableTextInterfaceInitCB,
(GInterfaceFinalizeFunc) nullptr, nullptr},
{(GInterfaceInitFunc)hypertextInterfaceInitCB,
(GInterfaceFinalizeFunc) nullptr, nullptr},
{(GInterfaceInitFunc)hyperlinkImplInterfaceInitCB,
(GInterfaceFinalizeFunc) nullptr, nullptr},
{(GInterfaceInitFunc)selectionInterfaceInitCB,
(GInterfaceFinalizeFunc) nullptr, nullptr},
{(GInterfaceInitFunc)tableInterfaceInitCB,
(GInterfaceFinalizeFunc) nullptr, nullptr},
{(GInterfaceInitFunc)textInterfaceInitCB,
(GInterfaceFinalizeFunc) nullptr, nullptr},
{(GInterfaceInitFunc)documentInterfaceInitCB,
(GInterfaceFinalizeFunc) nullptr, nullptr},
{(GInterfaceInitFunc)imageInterfaceInitCB,
(GInterfaceFinalizeFunc) nullptr, nullptr}
};
/**
* This MaiAtkObject is a thin wrapper, in the MAI namespace, for AtkObject
*/
struct MaiAtkObject
{
AtkObject parent;
/*
* The AccessibleWrap whose properties and features are exported
* via this object instance.
*/
AccessibleWrap* accWrap;
};
struct MaiAtkObjectClass
{
AtkObjectClass parent_class;
};
static guint mai_atk_object_signals [LAST_SIGNAL] = { 0, };
static void MaybeFireNameChange(AtkObject* aAtkObj, const nsString& aNewName);
G_BEGIN_DECLS
/* callbacks for MaiAtkObject */
static void classInitCB(AtkObjectClass *aClass);
static void initializeCB(AtkObject *aAtkObj, gpointer aData);
static void finalizeCB(GObject *aObj);
/* callbacks for AtkObject virtual functions */
static const gchar* getNameCB (AtkObject *aAtkObj);
/* getDescriptionCB is also used by image interface */
const gchar* getDescriptionCB (AtkObject *aAtkObj);
static AtkRole getRoleCB(AtkObject *aAtkObj);
static AtkAttributeSet* getAttributesCB(AtkObject *aAtkObj);
static const gchar* GetLocaleCB(AtkObject*);
static AtkObject* getParentCB(AtkObject *aAtkObj);
static gint getChildCountCB(AtkObject *aAtkObj);
static AtkObject* refChildCB(AtkObject *aAtkObj, gint aChildIndex);
static gint getIndexInParentCB(AtkObject *aAtkObj);
static AtkStateSet* refStateSetCB(AtkObject *aAtkObj);
static AtkRelationSet* refRelationSetCB(AtkObject *aAtkObj);
/* the missing atkobject virtual functions */
/*
static AtkLayer getLayerCB(AtkObject *aAtkObj);
static gint getMdiZorderCB(AtkObject *aAtkObj);
static void SetNameCB(AtkObject *aAtkObj,
const gchar *name);
static void SetDescriptionCB(AtkObject *aAtkObj,
const gchar *description);
static void SetParentCB(AtkObject *aAtkObj,
AtkObject *parent);
static void SetRoleCB(AtkObject *aAtkObj,
AtkRole role);
static guint ConnectPropertyChangeHandlerCB(
AtkObject *aObj,
AtkPropertyChangeHandler *handler);
static void RemovePropertyChangeHandlerCB(
AtkObject *aAtkObj,
guint handler_id);
static void InitializeCB(AtkObject *aAtkObj,
gpointer data);
static void ChildrenChangedCB(AtkObject *aAtkObj,
guint change_index,
gpointer changed_child);
static void FocusEventCB(AtkObject *aAtkObj,
gboolean focus_in);
static void PropertyChangeCB(AtkObject *aAtkObj,
AtkPropertyValues *values);
static void StateChangeCB(AtkObject *aAtkObj,
const gchar *name,
gboolean state_set);
static void VisibleDataChangedCB(AtkObject *aAtkObj);
*/
G_END_DECLS
static GType GetMaiAtkType(uint16_t interfacesBits);
static const char * GetUniqueMaiAtkTypeName(uint16_t interfacesBits);
static gpointer parent_class = nullptr;
static GQuark quark_mai_hyperlink = 0;
GType
mai_atk_object_get_type(void)
{
static GType type = 0;
if (!type) {
static const GTypeInfo tinfo = {
sizeof(MaiAtkObjectClass),
(GBaseInitFunc)nullptr,
(GBaseFinalizeFunc)nullptr,
(GClassInitFunc)classInitCB,
(GClassFinalizeFunc)nullptr,
nullptr, /* class data */
sizeof(MaiAtkObject), /* instance size */
0, /* nb preallocs */
(GInstanceInitFunc)nullptr,
nullptr /* value table */
};
type = g_type_register_static(ATK_TYPE_OBJECT,
"MaiAtkObject", &tinfo, GTypeFlags(0));
quark_mai_hyperlink = g_quark_from_static_string("MaiHyperlink");
}
return type;
}
AccessibleWrap::
AccessibleWrap(nsIContent* aContent, DocAccessible* aDoc) :
Accessible(aContent, aDoc), mAtkObject(nullptr)
{
}
AccessibleWrap::~AccessibleWrap()
{
NS_ASSERTION(!mAtkObject, "ShutdownAtkObject() is not called");
}
void
AccessibleWrap::ShutdownAtkObject()
{
if (mAtkObject) {
if (IS_MAI_OBJECT(mAtkObject)) {
MAI_ATK_OBJECT(mAtkObject)->accWrap = nullptr;
}
SetMaiHyperlink(nullptr);
g_object_unref(mAtkObject);
mAtkObject = nullptr;
}
}
void
AccessibleWrap::Shutdown()
{
ShutdownAtkObject();
Accessible::Shutdown();
}
MaiHyperlink*
AccessibleWrap::GetMaiHyperlink(bool aCreate /* = true */)
{
// make sure mAtkObject is created
GetAtkObject();
NS_ASSERTION(quark_mai_hyperlink, "quark_mai_hyperlink not initialized");
NS_ASSERTION(IS_MAI_OBJECT(mAtkObject), "Invalid AtkObject");
MaiHyperlink* maiHyperlink = nullptr;
if (quark_mai_hyperlink && IS_MAI_OBJECT(mAtkObject)) {
maiHyperlink = (MaiHyperlink*)g_object_get_qdata(G_OBJECT(mAtkObject),
quark_mai_hyperlink);
if (!maiHyperlink && aCreate) {
maiHyperlink = new MaiHyperlink(this);
SetMaiHyperlink(maiHyperlink);
}
}
return maiHyperlink;
}
void
AccessibleWrap::SetMaiHyperlink(MaiHyperlink* aMaiHyperlink)
{
NS_ASSERTION(quark_mai_hyperlink, "quark_mai_hyperlink not initialized");
NS_ASSERTION(IS_MAI_OBJECT(mAtkObject), "Invalid AtkObject");
if (quark_mai_hyperlink && IS_MAI_OBJECT(mAtkObject)) {
MaiHyperlink* maiHyperlink = GetMaiHyperlink(false);
if (!maiHyperlink && !aMaiHyperlink) {
return; // Never set and we're shutting down
}
delete maiHyperlink;
g_object_set_qdata(G_OBJECT(mAtkObject), quark_mai_hyperlink,
aMaiHyperlink);
}
}
NS_IMETHODIMP
AccessibleWrap::GetNativeInterface(void** aOutAccessible)
{
*aOutAccessible = nullptr;
if (!mAtkObject) {
if (IsDefunct() || !nsAccUtils::IsEmbeddedObject(this)) {
// We don't create ATK objects for node which has been shutdown, or
// nsIAccessible plain text leaves
return NS_ERROR_FAILURE;
}
GType type = GetMaiAtkType(CreateMaiInterfaces());
NS_ENSURE_TRUE(type, NS_ERROR_FAILURE);
mAtkObject =
reinterpret_cast<AtkObject *>
(g_object_new(type, nullptr));
NS_ENSURE_TRUE(mAtkObject, NS_ERROR_OUT_OF_MEMORY);
atk_object_initialize(mAtkObject, this);
mAtkObject->role = ATK_ROLE_INVALID;
mAtkObject->layer = ATK_LAYER_INVALID;
}
*aOutAccessible = mAtkObject;
return NS_OK;
}
AtkObject *
AccessibleWrap::GetAtkObject(void)
{
void *atkObj = nullptr;
GetNativeInterface(&atkObj);
return static_cast<AtkObject *>(atkObj);
}
// Get AtkObject from nsIAccessible interface
/* static */
AtkObject *
AccessibleWrap::GetAtkObject(nsIAccessible* acc)
{
void *atkObjPtr = nullptr;
acc->GetNativeInterface(&atkObjPtr);
return atkObjPtr ? ATK_OBJECT(atkObjPtr) : nullptr;
}
/* private */
uint16_t
AccessibleWrap::CreateMaiInterfaces(void)
{
uint16_t interfacesBits = 0;
// The Component interface is supported by all accessibles.
interfacesBits |= 1 << MAI_INTERFACE_COMPONENT;
// Add Action interface if the action count is more than zero.
if (ActionCount() > 0)
interfacesBits |= 1 << MAI_INTERFACE_ACTION;
// Text, Editabletext, and Hypertext interface.
HyperTextAccessible* hyperText = AsHyperText();
if (hyperText && hyperText->IsTextRole()) {
interfacesBits |= 1 << MAI_INTERFACE_TEXT;
interfacesBits |= 1 << MAI_INTERFACE_EDITABLE_TEXT;
if (!nsAccUtils::MustPrune(this))
interfacesBits |= 1 << MAI_INTERFACE_HYPERTEXT;
}
// Value interface.
nsCOMPtr<nsIAccessibleValue> accessInterfaceValue;
QueryInterface(NS_GET_IID(nsIAccessibleValue),
getter_AddRefs(accessInterfaceValue));
if (accessInterfaceValue) {
interfacesBits |= 1 << MAI_INTERFACE_VALUE;
}
// Document interface.
if (IsDoc())
interfacesBits |= 1 << MAI_INTERFACE_DOCUMENT;
if (IsImage())
interfacesBits |= 1 << MAI_INTERFACE_IMAGE;
// HyperLink interface.
if (IsLink())
interfacesBits |= 1 << MAI_INTERFACE_HYPERLINK_IMPL;
if (!nsAccUtils::MustPrune(this)) { // These interfaces require children
// Table interface.
if (AsTable())
interfacesBits |= 1 << MAI_INTERFACE_TABLE;
// Selection interface.
if (IsSelect()) {
interfacesBits |= 1 << MAI_INTERFACE_SELECTION;
}
}
return interfacesBits;
}
static GType
GetMaiAtkType(uint16_t interfacesBits)
{
GType type;
static const GTypeInfo tinfo = {
sizeof(MaiAtkObjectClass),
(GBaseInitFunc) nullptr,
(GBaseFinalizeFunc) nullptr,
(GClassInitFunc) nullptr,
(GClassFinalizeFunc) nullptr,
nullptr, /* class data */
sizeof(MaiAtkObject), /* instance size */
0, /* nb preallocs */
(GInstanceInitFunc) nullptr,
nullptr /* value table */
};
/*
* The members we use to register GTypes are GetAtkTypeForMai
* and atk_if_infos, which are constant values to each MaiInterface
* So we can reuse the registered GType when having
* the same MaiInterface types.
*/
const char *atkTypeName = GetUniqueMaiAtkTypeName(interfacesBits);
type = g_type_from_name(atkTypeName);
if (type) {
return type;
}
/*
* gobject limits the number of types that can directly derive from any
* given object type to 4095.
*/
static uint16_t typeRegCount = 0;
if (typeRegCount++ >= 4095) {
return G_TYPE_INVALID;
}
type = g_type_register_static(MAI_TYPE_ATK_OBJECT,
atkTypeName,
&tinfo, GTypeFlags(0));
for (uint32_t index = 0; index < ArrayLength(atk_if_infos); index++) {
if (interfacesBits & (1 << index)) {
g_type_add_interface_static(type,
GetAtkTypeForMai((MaiInterfaceType)index),
&atk_if_infos[index]);
}
}
return type;
}
static const char*
GetUniqueMaiAtkTypeName(uint16_t interfacesBits)
{
#define MAI_ATK_TYPE_NAME_LEN (30) /* 10+sizeof(uint16_t)*8/4+1 < 30 */
static gchar namePrefix[] = "MaiAtkType"; /* size = 10 */
static gchar name[MAI_ATK_TYPE_NAME_LEN + 1];
PR_snprintf(name, MAI_ATK_TYPE_NAME_LEN, "%s%x", namePrefix,
interfacesBits);
name[MAI_ATK_TYPE_NAME_LEN] = '\0';
return name;
}
bool
AccessibleWrap::IsValidObject()
{
// to ensure we are not shut down
return !IsDefunct();
}
/* static functions for ATK callbacks */
void
classInitCB(AtkObjectClass *aClass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS(aClass);
parent_class = g_type_class_peek_parent(aClass);
aClass->get_name = getNameCB;
aClass->get_description = getDescriptionCB;
aClass->get_parent = getParentCB;
aClass->get_n_children = getChildCountCB;
aClass->ref_child = refChildCB;
aClass->get_index_in_parent = getIndexInParentCB;
aClass->get_role = getRoleCB;
aClass->get_attributes = getAttributesCB;
aClass->get_object_locale = GetLocaleCB;
aClass->ref_state_set = refStateSetCB;
aClass->ref_relation_set = refRelationSetCB;
aClass->initialize = initializeCB;
gobject_class->finalize = finalizeCB;
mai_atk_object_signals [ACTIVATE] =
g_signal_new ("activate",
MAI_TYPE_ATK_OBJECT,
G_SIGNAL_RUN_LAST,
0, /* default signal handler */
nullptr, nullptr,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
mai_atk_object_signals [CREATE] =
g_signal_new ("create",
MAI_TYPE_ATK_OBJECT,
G_SIGNAL_RUN_LAST,
0, /* default signal handler */
nullptr, nullptr,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
mai_atk_object_signals [DEACTIVATE] =
g_signal_new ("deactivate",
MAI_TYPE_ATK_OBJECT,
G_SIGNAL_RUN_LAST,
0, /* default signal handler */
nullptr, nullptr,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
mai_atk_object_signals [DESTROY] =
g_signal_new ("destroy",
MAI_TYPE_ATK_OBJECT,
G_SIGNAL_RUN_LAST,
0, /* default signal handler */
nullptr, nullptr,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
mai_atk_object_signals [MAXIMIZE] =
g_signal_new ("maximize",
MAI_TYPE_ATK_OBJECT,
G_SIGNAL_RUN_LAST,
0, /* default signal handler */
nullptr, nullptr,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
mai_atk_object_signals [MINIMIZE] =
g_signal_new ("minimize",
MAI_TYPE_ATK_OBJECT,
G_SIGNAL_RUN_LAST,
0, /* default signal handler */
nullptr, nullptr,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
mai_atk_object_signals [RESIZE] =
g_signal_new ("resize",
MAI_TYPE_ATK_OBJECT,
G_SIGNAL_RUN_LAST,
0, /* default signal handler */
nullptr, nullptr,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
mai_atk_object_signals [RESTORE] =
g_signal_new ("restore",
MAI_TYPE_ATK_OBJECT,
G_SIGNAL_RUN_LAST,
0, /* default signal handler */
nullptr, nullptr,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
}
void
initializeCB(AtkObject *aAtkObj, gpointer aData)
{
NS_ASSERTION((IS_MAI_OBJECT(aAtkObj)), "Invalid AtkObject");
NS_ASSERTION(aData, "Invalid Data to init AtkObject");
if (!aAtkObj || !aData)
return;
/* call parent init function */
/* AtkObjectClass has not a "initialize" function now,
* maybe it has later
*/
if (ATK_OBJECT_CLASS(parent_class)->initialize)
ATK_OBJECT_CLASS(parent_class)->initialize(aAtkObj, aData);
/* initialize object */
MAI_ATK_OBJECT(aAtkObj)->accWrap =
static_cast<AccessibleWrap*>(aData);
}
void
finalizeCB(GObject *aObj)
{
if (!IS_MAI_OBJECT(aObj))
return;
NS_ASSERTION(MAI_ATK_OBJECT(aObj)->accWrap == nullptr, "AccWrap NOT null");
// call parent finalize function
// finalize of GObjectClass will unref the accessible parent if has
if (G_OBJECT_CLASS (parent_class)->finalize)
G_OBJECT_CLASS (parent_class)->finalize(aObj);
}
const gchar*
getNameCB(AtkObject* aAtkObj)
{
AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
if (!accWrap)
return nullptr;
nsAutoString name;
accWrap->Name(name);
// XXX Firing an event from here does not seem right
MaybeFireNameChange(aAtkObj, name);
return aAtkObj->name;
}
static void
MaybeFireNameChange(AtkObject* aAtkObj, const nsString& aNewName)
{
NS_ConvertUTF16toUTF8 newNameUTF8(aNewName);
if (aAtkObj->name && newNameUTF8.Equals(aAtkObj->name))
return;
// Below we duplicate the functionality of atk_object_set_name(),
// but without calling atk_object_get_name(). Instead of
// atk_object_get_name() we directly access aAtkObj->name. This is because
// atk_object_get_name() would call getNameCB() which would call
// MaybeFireNameChange() (or atk_object_set_name() before this problem was
// fixed) and we would get an infinite recursion.
// See http://bugzilla.mozilla.org/733712
// Do not notify for initial name setting.
// See bug http://bugzilla.gnome.org/665870
bool notify = !!aAtkObj->name;
free(aAtkObj->name);
aAtkObj->name = strdup(newNameUTF8.get());
if (notify)
g_object_notify(G_OBJECT(aAtkObj), "accessible-name");
}
const gchar *
getDescriptionCB(AtkObject *aAtkObj)
{
AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
if (!accWrap || accWrap->IsDefunct())
return nullptr;
/* nsIAccessible is responsible for the nonnull description */
nsAutoString uniDesc;
accWrap->Description(uniDesc);
NS_ConvertUTF8toUTF16 objDesc(aAtkObj->description);
if (!uniDesc.Equals(objDesc))
atk_object_set_description(aAtkObj,
NS_ConvertUTF16toUTF8(uniDesc).get());
return aAtkObj->description;
}
AtkRole
getRoleCB(AtkObject *aAtkObj)
{
AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
if (!accWrap)
return ATK_ROLE_INVALID;
#ifdef DEBUG
NS_ASSERTION(nsAccUtils::IsTextInterfaceSupportCorrect(accWrap),
"Does not support nsIAccessibleText when it should");
#endif
if (aAtkObj->role != ATK_ROLE_INVALID)
return aAtkObj->role;
#define ROLE(geckoRole, stringRole, atkRole, macRole, \
msaaRole, ia2Role, nameRule) \
case roles::geckoRole: \
aAtkObj->role = atkRole; \
break;
switch (accWrap->Role()) {
#include "RoleMap.h"
default:
MOZ_CRASH("Unknown role.");
};
#undef ROLE
if (aAtkObj->role == ATK_ROLE_LIST_BOX && !IsAtkVersionAtLeast(2, 1))
aAtkObj->role = ATK_ROLE_LIST;
else if (aAtkObj->role == ATK_ROLE_TABLE_ROW && !IsAtkVersionAtLeast(2, 1))
aAtkObj->role = ATK_ROLE_LIST_ITEM;
return aAtkObj->role;
}
static AtkAttributeSet*
ConvertToAtkAttributeSet(nsIPersistentProperties* aAttributes)
{
if (!aAttributes)
return nullptr;
AtkAttributeSet *objAttributeSet = nullptr;
nsCOMPtr<nsISimpleEnumerator> propEnum;
nsresult rv = aAttributes->Enumerate(getter_AddRefs(propEnum));
NS_ENSURE_SUCCESS(rv, nullptr);
bool hasMore;
while (NS_SUCCEEDED(propEnum->HasMoreElements(&hasMore)) && hasMore) {
nsCOMPtr<nsISupports> sup;
rv = propEnum->GetNext(getter_AddRefs(sup));
NS_ENSURE_SUCCESS(rv, objAttributeSet);
nsCOMPtr<nsIPropertyElement> propElem(do_QueryInterface(sup));
NS_ENSURE_TRUE(propElem, objAttributeSet);
nsAutoCString name;
rv = propElem->GetKey(name);
NS_ENSURE_SUCCESS(rv, objAttributeSet);
nsAutoString value;
rv = propElem->GetValue(value);
NS_ENSURE_SUCCESS(rv, objAttributeSet);
AtkAttribute *objAttr = (AtkAttribute *)g_malloc(sizeof(AtkAttribute));
objAttr->name = g_strdup(name.get());
objAttr->value = g_strdup(NS_ConvertUTF16toUTF8(value).get());
objAttributeSet = g_slist_prepend(objAttributeSet, objAttr);
}
//libspi will free it
return objAttributeSet;
}
AtkAttributeSet*
GetAttributeSet(Accessible* aAccessible)
{
nsCOMPtr<nsIPersistentProperties> attributes = aAccessible->Attributes();
if (attributes) {
// There is no ATK state for haspopup, must use object attribute to expose
// the same info.
if (aAccessible->State() & states::HASPOPUP) {
nsAutoString unused;
attributes->SetStringProperty(NS_LITERAL_CSTRING("haspopup"),
NS_LITERAL_STRING("true"), unused);
}
return ConvertToAtkAttributeSet(attributes);
}
return nullptr;
}
AtkAttributeSet *
getAttributesCB(AtkObject *aAtkObj)
{
AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
return accWrap ? GetAttributeSet(accWrap) : nullptr;
}
const gchar*
GetLocaleCB(AtkObject* aAtkObj)
{
AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
if (!accWrap)
return nullptr;
nsAutoString locale;
accWrap->Language(locale);
return AccessibleWrap::ReturnString(locale);
}
AtkObject *
getParentCB(AtkObject *aAtkObj)
{
if (!aAtkObj->accessible_parent) {
AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
if (!accWrap)
return nullptr;
Accessible* accParent = accWrap->Parent();
if (!accParent)
return nullptr;
AtkObject* parent = AccessibleWrap::GetAtkObject(accParent);
if (parent)
atk_object_set_parent(aAtkObj, parent);
}
return aAtkObj->accessible_parent;
}
gint
getChildCountCB(AtkObject *aAtkObj)
{
AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
if (!accWrap || nsAccUtils::MustPrune(accWrap)) {
return 0;
}
return static_cast<gint>(accWrap->EmbeddedChildCount());
}
AtkObject *
refChildCB(AtkObject *aAtkObj, gint aChildIndex)
{
// aChildIndex should not be less than zero
if (aChildIndex < 0) {
return nullptr;
}
AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
if (!accWrap || nsAccUtils::MustPrune(accWrap)) {
return nullptr;
}
Accessible* accChild = accWrap->GetEmbeddedChildAt(aChildIndex);
if (!accChild)
return nullptr;
AtkObject* childAtkObj = AccessibleWrap::GetAtkObject(accChild);
NS_ASSERTION(childAtkObj, "Fail to get AtkObj");
if (!childAtkObj)
return nullptr;
g_object_ref(childAtkObj);
if (aAtkObj != childAtkObj->accessible_parent)
atk_object_set_parent(childAtkObj, aAtkObj);
return childAtkObj;
}
gint
getIndexInParentCB(AtkObject *aAtkObj)
{
// We don't use nsIAccessible::GetIndexInParent() because
// for ATK we don't want to include text leaf nodes as children
AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
if (!accWrap) {
return -1;
}
Accessible* parent = accWrap->Parent();
if (!parent)
return -1; // No parent
return parent->GetIndexOfEmbeddedChild(accWrap);
}
static void
TranslateStates(uint64_t aState, AtkStateSet* aStateSet)
{
// atk doesn't have a read only state so read only things shouldn't be
// editable.
if (aState & states::READONLY)
aState &= ~states::EDITABLE;
// Convert every state to an entry in AtkStateMap
uint32_t stateIndex = 0;
uint64_t bitMask = 1;
while (gAtkStateMap[stateIndex].stateMapEntryType != kNoSuchState) {
if (gAtkStateMap[stateIndex].atkState) { // There's potentially an ATK state for this
bool isStateOn = (aState & bitMask) != 0;
if (gAtkStateMap[stateIndex].stateMapEntryType == kMapOpposite) {
isStateOn = !isStateOn;
}
if (isStateOn) {
atk_state_set_add_state(aStateSet, gAtkStateMap[stateIndex].atkState);
}
}
bitMask <<= 1;
++ stateIndex;
}
}
AtkStateSet *
refStateSetCB(AtkObject *aAtkObj)
{
AtkStateSet *state_set = nullptr;
state_set = ATK_OBJECT_CLASS(parent_class)->ref_state_set(aAtkObj);
AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
if (!accWrap) {
TranslateStates(states::DEFUNCT, state_set);
return state_set;
}
// Map states
TranslateStates(accWrap->State(), state_set);
return state_set;
}
static void
UpdateAtkRelation(RelationType aType, Accessible* aAcc,
AtkRelationType aAtkType, AtkRelationSet* aAtkSet)
{
if (aAtkType == ATK_RELATION_NULL)
return;
AtkRelation* atkRelation =
atk_relation_set_get_relation_by_type(aAtkSet, aAtkType);
if (atkRelation)
atk_relation_set_remove(aAtkSet, atkRelation);
Relation rel(aAcc->RelationByType(aType));
nsTArray<AtkObject*> targets;
Accessible* tempAcc = nullptr;
while ((tempAcc = rel.Next()))
targets.AppendElement(AccessibleWrap::GetAtkObject(tempAcc));
if (targets.Length()) {
atkRelation = atk_relation_new(targets.Elements(),
targets.Length(), aAtkType);
atk_relation_set_add(aAtkSet, atkRelation);
g_object_unref(atkRelation);
}
}
AtkRelationSet *
refRelationSetCB(AtkObject *aAtkObj)
{
AtkRelationSet* relation_set =
ATK_OBJECT_CLASS(parent_class)->ref_relation_set(aAtkObj);
AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
if (!accWrap)
return relation_set;
#define RELATIONTYPE(geckoType, geckoTypeName, atkType, msaaType, ia2Type) \
UpdateAtkRelation(RelationType::geckoType, accWrap, atkType, relation_set);
#include "RelationTypeMap.h"
#undef RELATIONTYPE
return relation_set;
}
// Check if aAtkObj is a valid MaiAtkObject, and return the AccessibleWrap
// for it.
AccessibleWrap*
GetAccessibleWrap(AtkObject* aAtkObj)
{
NS_ENSURE_TRUE(IS_MAI_OBJECT(aAtkObj), nullptr);
AccessibleWrap* accWrap = MAI_ATK_OBJECT(aAtkObj)->accWrap;
// Check if the accessible was deconstructed.
if (!accWrap)
return nullptr;
NS_ENSURE_TRUE(accWrap->GetAtkObject() == aAtkObj, nullptr);
AccessibleWrap* appAccWrap = ApplicationAcc();
if (appAccWrap != accWrap && !accWrap->IsValidObject())
return nullptr;
return accWrap;
}
nsresult
AccessibleWrap::HandleAccEvent(AccEvent* aEvent)
{
nsresult rv = Accessible::HandleAccEvent(aEvent);
NS_ENSURE_SUCCESS(rv, rv);
Accessible* accessible = aEvent->GetAccessible();
NS_ENSURE_TRUE(accessible, NS_ERROR_FAILURE);
// The accessible can become defunct if we have an xpcom event listener
// which decides it would be fun to change the DOM and flush layout.
if (accessible->IsDefunct())
return NS_OK;
uint32_t type = aEvent->GetEventType();
AtkObject* atkObj = AccessibleWrap::GetAtkObject(accessible);
// We don't create ATK objects for nsIAccessible plain text leaves,
// just return NS_OK in such case
if (!atkObj) {
NS_ASSERTION(type == nsIAccessibleEvent::EVENT_SHOW ||
type == nsIAccessibleEvent::EVENT_HIDE,
"Event other than SHOW and HIDE fired for plain text leaves");
return NS_OK;
}
AccessibleWrap* accWrap = GetAccessibleWrap(atkObj);
if (!accWrap) {
return NS_OK; // Node is shut down
}
switch (type) {
case nsIAccessibleEvent::EVENT_STATE_CHANGE:
return FireAtkStateChangeEvent(aEvent, atkObj);
case nsIAccessibleEvent::EVENT_TEXT_REMOVED:
case nsIAccessibleEvent::EVENT_TEXT_INSERTED:
return FireAtkTextChangedEvent(aEvent, atkObj);
case nsIAccessibleEvent::EVENT_FOCUS:
{
a11y::RootAccessible* rootAccWrap = accWrap->RootAccessible();
if (rootAccWrap && rootAccWrap->mActivated) {
atk_focus_tracker_notify(atkObj);
// Fire state change event for focus
atk_object_notify_state_change(atkObj, ATK_STATE_FOCUSED, true);
return NS_OK;
}
} break;
case nsIAccessibleEvent::EVENT_NAME_CHANGE:
{
nsAutoString newName;
accessible->Name(newName);
MaybeFireNameChange(atkObj, newName);
break;
}
case nsIAccessibleEvent::EVENT_VALUE_CHANGE:
{
nsCOMPtr<nsIAccessibleValue> value(do_QueryObject(accessible));
if (value) { // Make sure this is a numeric value
// Don't fire for MSAA string value changes (e.g. text editing)
// ATK values are always numeric
g_object_notify( (GObject*)atkObj, "accessible-value" );
}
} break;
case nsIAccessibleEvent::EVENT_SELECTION:
case nsIAccessibleEvent::EVENT_SELECTION_ADD:
case nsIAccessibleEvent::EVENT_SELECTION_REMOVE:
{
// XXX: dupe events may be fired
AccSelChangeEvent* selChangeEvent = downcast_accEvent(aEvent);
g_signal_emit_by_name(AccessibleWrap::GetAtkObject(selChangeEvent->Widget()),
"selection_changed");
break;
}
case nsIAccessibleEvent::EVENT_SELECTION_WITHIN:
{
g_signal_emit_by_name(atkObj, "selection_changed");
break;
}
case nsIAccessibleEvent::EVENT_TEXT_SELECTION_CHANGED:
g_signal_emit_by_name(atkObj, "text_selection_changed");
break;
case nsIAccessibleEvent::EVENT_TEXT_CARET_MOVED:
{
AccCaretMoveEvent* caretMoveEvent = downcast_accEvent(aEvent);
NS_ASSERTION(caretMoveEvent, "Event needs event data");
if (!caretMoveEvent)
break;
int32_t caretOffset = caretMoveEvent->GetCaretOffset();
g_signal_emit_by_name(atkObj, "text_caret_moved", caretOffset);
} break;
case nsIAccessibleEvent::EVENT_TEXT_ATTRIBUTE_CHANGED:
g_signal_emit_by_name(atkObj, "text-attributes-changed");
break;
case nsIAccessibleEvent::EVENT_TABLE_MODEL_CHANGED:
g_signal_emit_by_name(atkObj, "model_changed");
break;
case nsIAccessibleEvent::EVENT_TABLE_ROW_INSERT:
{
AccTableChangeEvent* tableEvent = downcast_accEvent(aEvent);
NS_ENSURE_TRUE(tableEvent, NS_ERROR_FAILURE);
int32_t rowIndex = tableEvent->GetIndex();
int32_t numRows = tableEvent->GetCount();
g_signal_emit_by_name(atkObj, "row_inserted", rowIndex, numRows);
} break;
case nsIAccessibleEvent::EVENT_TABLE_ROW_DELETE:
{
AccTableChangeEvent* tableEvent = downcast_accEvent(aEvent);
NS_ENSURE_TRUE(tableEvent, NS_ERROR_FAILURE);
int32_t rowIndex = tableEvent->GetIndex();
int32_t numRows = tableEvent->GetCount();
g_signal_emit_by_name(atkObj, "row_deleted", rowIndex, numRows);
} break;
case nsIAccessibleEvent::EVENT_TABLE_ROW_REORDER:
{
g_signal_emit_by_name(atkObj, "row_reordered");
break;
}
case nsIAccessibleEvent::EVENT_TABLE_COLUMN_INSERT:
{
AccTableChangeEvent* tableEvent = downcast_accEvent(aEvent);
NS_ENSURE_TRUE(tableEvent, NS_ERROR_FAILURE);
int32_t colIndex = tableEvent->GetIndex();
int32_t numCols = tableEvent->GetCount();
g_signal_emit_by_name(atkObj, "column_inserted", colIndex, numCols);
} break;
case nsIAccessibleEvent::EVENT_TABLE_COLUMN_DELETE:
{
AccTableChangeEvent* tableEvent = downcast_accEvent(aEvent);
NS_ENSURE_TRUE(tableEvent, NS_ERROR_FAILURE);
int32_t colIndex = tableEvent->GetIndex();
int32_t numCols = tableEvent->GetCount();
g_signal_emit_by_name(atkObj, "column_deleted", colIndex, numCols);
} break;
case nsIAccessibleEvent::EVENT_TABLE_COLUMN_REORDER:
g_signal_emit_by_name(atkObj, "column_reordered");
break;
case nsIAccessibleEvent::EVENT_SECTION_CHANGED:
g_signal_emit_by_name(atkObj, "visible_data_changed");
break;
case nsIAccessibleEvent::EVENT_SHOW:
return FireAtkShowHideEvent(aEvent, atkObj, true);
case nsIAccessibleEvent::EVENT_HIDE:
// XXX - Handle native dialog accessibles.
if (!accessible->IsRoot() && accessible->HasARIARole() &&
accessible->ARIARole() == roles::DIALOG) {
guint id = g_signal_lookup("deactivate", MAI_TYPE_ATK_OBJECT);
g_signal_emit(atkObj, id, 0);
}
return FireAtkShowHideEvent(aEvent, atkObj, false);
/*
* Because dealing with menu is very different between nsIAccessible
* and ATK, and the menu activity is important, specially transfer the
* following two event.
* Need more verification by AT test.
*/
case nsIAccessibleEvent::EVENT_MENU_START:
case nsIAccessibleEvent::EVENT_MENU_END:
break;
case nsIAccessibleEvent::EVENT_WINDOW_ACTIVATE:
{
accessible->AsRoot()->mActivated = true;
guint id = g_signal_lookup("activate", MAI_TYPE_ATK_OBJECT);
g_signal_emit(atkObj, id, 0);
// Always fire a current focus event after activation.
FocusMgr()->ForceFocusEvent();
} break;
case nsIAccessibleEvent::EVENT_WINDOW_DEACTIVATE:
{
accessible->AsRoot()->mActivated = false;
guint id = g_signal_lookup("deactivate", MAI_TYPE_ATK_OBJECT);
g_signal_emit(atkObj, id, 0);
} break;
case nsIAccessibleEvent::EVENT_WINDOW_MAXIMIZE:
{
guint id = g_signal_lookup("maximize", MAI_TYPE_ATK_OBJECT);
g_signal_emit(atkObj, id, 0);
} break;
case nsIAccessibleEvent::EVENT_WINDOW_MINIMIZE:
{
guint id = g_signal_lookup("minimize", MAI_TYPE_ATK_OBJECT);
g_signal_emit(atkObj, id, 0);
} break;
case nsIAccessibleEvent::EVENT_WINDOW_RESTORE:
{
guint id = g_signal_lookup("restore", MAI_TYPE_ATK_OBJECT);
g_signal_emit(atkObj, id, 0);
} break;
case nsIAccessibleEvent::EVENT_DOCUMENT_LOAD_COMPLETE:
g_signal_emit_by_name (atkObj, "load_complete");
// XXX - Handle native dialog accessibles.
if (!accessible->IsRoot() && accessible->HasARIARole() &&
accessible->ARIARole() == roles::DIALOG) {
guint id = g_signal_lookup("activate", MAI_TYPE_ATK_OBJECT);
g_signal_emit(atkObj, id, 0);
}
break;
case nsIAccessibleEvent::EVENT_DOCUMENT_RELOAD:
g_signal_emit_by_name (atkObj, "reload");
break;
case nsIAccessibleEvent::EVENT_DOCUMENT_LOAD_STOPPED:
g_signal_emit_by_name (atkObj, "load_stopped");
break;
case nsIAccessibleEvent::EVENT_MENUPOPUP_START:
atk_focus_tracker_notify(atkObj); // fire extra focus event
atk_object_notify_state_change(atkObj, ATK_STATE_VISIBLE, true);
atk_object_notify_state_change(atkObj, ATK_STATE_SHOWING, true);
break;
case nsIAccessibleEvent::EVENT_MENUPOPUP_END:
atk_object_notify_state_change(atkObj, ATK_STATE_VISIBLE, false);
atk_object_notify_state_change(atkObj, ATK_STATE_SHOWING, false);
break;
}
return NS_OK;
}
nsresult
AccessibleWrap::FireAtkStateChangeEvent(AccEvent* aEvent,
AtkObject* aObject)
{
AccStateChangeEvent* event = downcast_accEvent(aEvent);
NS_ENSURE_TRUE(event, NS_ERROR_FAILURE);
bool isEnabled = event->IsStateEnabled();
int32_t stateIndex = AtkStateMap::GetStateIndexFor(event->GetState());
if (stateIndex >= 0) {
NS_ASSERTION(gAtkStateMap[stateIndex].stateMapEntryType != kNoSuchState,
"No such state");
if (gAtkStateMap[stateIndex].atkState != kNone) {
NS_ASSERTION(gAtkStateMap[stateIndex].stateMapEntryType != kNoStateChange,
"State changes should not fired for this state");
if (gAtkStateMap[stateIndex].stateMapEntryType == kMapOpposite)
isEnabled = !isEnabled;
// Fire state change for first state if there is one to map
atk_object_notify_state_change(aObject,
gAtkStateMap[stateIndex].atkState,
isEnabled);
}
}
return NS_OK;
}
nsresult
AccessibleWrap::FireAtkTextChangedEvent(AccEvent* aEvent,
AtkObject* aObject)
{
AccTextChangeEvent* event = downcast_accEvent(aEvent);
NS_ENSURE_TRUE(event, NS_ERROR_FAILURE);
int32_t start = event->GetStartOffset();
uint32_t length = event->GetLength();
bool isInserted = event->IsTextInserted();
bool isFromUserInput = aEvent->IsFromUserInput();
char* signal_name = nullptr;
if (gAvailableAtkSignals == eUnknown)
gAvailableAtkSignals =
g_signal_lookup("text-insert", G_OBJECT_TYPE(aObject)) ?
eHaveNewAtkTextSignals : eNoNewAtkSignals;
if (gAvailableAtkSignals == eNoNewAtkSignals) {
// XXX remove this code and the gHaveNewTextSignals check when we can
// stop supporting old atk since it doesn't really work anyway
// see bug 619002
signal_name = g_strconcat(isInserted ? "text_changed::insert" :
"text_changed::delete",
isFromUserInput ? "" : kNonUserInputEvent, nullptr);
g_signal_emit_by_name(aObject, signal_name, start, length);
} else {
nsAutoString text;
event->GetModifiedText(text);
signal_name = g_strconcat(isInserted ? "text-insert" : "text-remove",
isFromUserInput ? "" : "::system", nullptr);
g_signal_emit_by_name(aObject, signal_name, start, length,
NS_ConvertUTF16toUTF8(text).get());
}
g_free(signal_name);
return NS_OK;
}
nsresult
AccessibleWrap::FireAtkShowHideEvent(AccEvent* aEvent,
AtkObject* aObject, bool aIsAdded)
{
int32_t indexInParent = getIndexInParentCB(aObject);
AtkObject *parentObject = getParentCB(aObject);
NS_ENSURE_STATE(parentObject);
bool isFromUserInput = aEvent->IsFromUserInput();
char *signal_name = g_strconcat(aIsAdded ? "children_changed::add" : "children_changed::remove",
isFromUserInput ? "" : kNonUserInputEvent, nullptr);
g_signal_emit_by_name(parentObject, signal_name, indexInParent, aObject, nullptr);
g_free(signal_name);
return NS_OK;
}