diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
commit | 43a97878ce14b72f0981164f87f2e35e14151312 (patch) | |
tree | 620249daf56c0258faa40cbdcf9cfba06de2a846 /accessible/ipc/extension | |
parent | Initial commit. (diff) | |
download | firefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz firefox-43a97878ce14b72f0981164f87f2e35e14151312.zip |
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'accessible/ipc/extension')
16 files changed, 827 insertions, 0 deletions
diff --git a/accessible/ipc/extension/android/DocAccessiblePlatformExtChild.cpp b/accessible/ipc/extension/android/DocAccessiblePlatformExtChild.cpp new file mode 100644 index 0000000000..ad29ae900c --- /dev/null +++ b/accessible/ipc/extension/android/DocAccessiblePlatformExtChild.cpp @@ -0,0 +1,75 @@ +/* -*- 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 "DocAccessiblePlatformExtChild.h" + +#include "DocAccessibleChild.h" +#include "AccessibleWrap.h" + +namespace mozilla { +namespace a11y { + +mozilla::ipc::IPCResult DocAccessiblePlatformExtChild::RecvPivotTo( + uint64_t aID, int32_t aGranularity, bool aForward, bool aInclusive) { + if (auto acc = IdToAccessibleWrap(aID)) { + acc->PivotTo(aGranularity, aForward, aInclusive); + } + + return IPC_OK(); +} + +mozilla::ipc::IPCResult DocAccessiblePlatformExtChild::RecvNavigateText( + uint64_t aID, int32_t aGranularity, int32_t aStartOffset, + int32_t aEndOffset, bool aForward, bool aSelect) { + if (auto acc = IdToAccessibleWrap(aID)) { + acc->NavigateText(aGranularity, aStartOffset, aEndOffset, aForward, + aSelect); + } + + return IPC_OK(); +} + +mozilla::ipc::IPCResult DocAccessiblePlatformExtChild::RecvSetSelection( + uint64_t aID, int32_t aStart, int32_t aEnd) { + if (auto acc = IdToAccessibleWrap(aID)) { + acc->SetSelection(aStart, aEnd); + } + + return IPC_OK(); +} + +mozilla::ipc::IPCResult DocAccessiblePlatformExtChild::RecvCut(uint64_t aID) { + if (auto acc = IdToAccessibleWrap(aID)) { + acc->Cut(); + } + + return IPC_OK(); +} + +mozilla::ipc::IPCResult DocAccessiblePlatformExtChild::RecvCopy(uint64_t aID) { + if (auto acc = IdToAccessibleWrap(aID)) { + acc->Copy(); + } + + return IPC_OK(); +} + +mozilla::ipc::IPCResult DocAccessiblePlatformExtChild::RecvPaste(uint64_t aID) { + if (auto acc = IdToAccessibleWrap(aID)) { + acc->Paste(); + } + + return IPC_OK(); +} + +AccessibleWrap* DocAccessiblePlatformExtChild::IdToAccessibleWrap( + const uint64_t& aID) const { + return static_cast<AccessibleWrap*>( + static_cast<DocAccessibleChild*>(Manager())->IdToAccessible(aID)); +} + +} // namespace a11y +} // namespace mozilla diff --git a/accessible/ipc/extension/android/DocAccessiblePlatformExtChild.h b/accessible/ipc/extension/android/DocAccessiblePlatformExtChild.h new file mode 100644 index 0000000000..60108213e1 --- /dev/null +++ b/accessible/ipc/extension/android/DocAccessiblePlatformExtChild.h @@ -0,0 +1,44 @@ +/* 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/. */ + +#ifndef mozilla_a11y_DocAccessiblePlatformExtChild_h +#define mozilla_a11y_DocAccessiblePlatformExtChild_h + +#include "mozilla/a11y/PDocAccessiblePlatformExtChild.h" + +namespace mozilla { +namespace a11y { + +class AccessibleWrap; +class DocAccessibleChild; + +class DocAccessiblePlatformExtChild : public PDocAccessiblePlatformExtChild { + public: + mozilla::ipc::IPCResult RecvPivotTo(uint64_t aID, int32_t aGranularity, + bool aForward, bool aInclusive); + + mozilla::ipc::IPCResult RecvNavigateText(uint64_t aID, int32_t aGranularity, + int32_t aStartOffset, + int32_t aEndOffset, bool aForward, + bool aSelect); + + mozilla::ipc::IPCResult RecvSetSelection(uint64_t aID, int32_t aStart, + int32_t aEnd); + + mozilla::ipc::IPCResult RecvCut(uint64_t aID); + + mozilla::ipc::IPCResult RecvCopy(uint64_t aID); + + mozilla::ipc::IPCResult RecvPaste(uint64_t aID); + + mozilla::ipc::IPCResult RecvExploreByTouch(uint64_t aID, float aX, float aY); + + private: + AccessibleWrap* IdToAccessibleWrap(const uint64_t& aID) const; +}; +} // namespace a11y +} // namespace mozilla + +#endif diff --git a/accessible/ipc/extension/android/DocAccessiblePlatformExtParent.cpp b/accessible/ipc/extension/android/DocAccessiblePlatformExtParent.cpp new file mode 100644 index 0000000000..dbc16b7401 --- /dev/null +++ b/accessible/ipc/extension/android/DocAccessiblePlatformExtParent.cpp @@ -0,0 +1,45 @@ +/* -*- 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 "DocAccessiblePlatformExtParent.h" + +#include "AccessibleWrap.h" +#include "SessionAccessibility.h" + +#include "mozilla/a11y/DocAccessibleParent.h" + +namespace mozilla { +namespace a11y { + +mozilla::ipc::IPCResult DocAccessiblePlatformExtParent::RecvSetPivotBoundaries( + PDocAccessibleParent* aFirstDoc, uint64_t aFirst, + PDocAccessibleParent* aLastDoc, uint64_t aLast) { + MOZ_ASSERT(aFirstDoc); + MOZ_ASSERT(aLastDoc); + + RefPtr<SessionAccessibility> sessionAcc = + SessionAccessibility::GetInstanceFor( + static_cast<DocAccessibleParent*>(Manager())); + if (!sessionAcc) { + return IPC_OK(); + } + + RemoteAccessible* first = + static_cast<DocAccessibleParent*>(aFirstDoc)->GetAccessible(aFirst); + RemoteAccessible* last = + static_cast<DocAccessibleParent*>(aLastDoc)->GetAccessible(aLast); + + // We may not have proxy accessibles available yet for those accessibles + // in the parent process. + if (first && last) { + sessionAcc->UpdateAccessibleFocusBoundaries(first, last); + } + + return IPC_OK(); +} + +} // namespace a11y +} // namespace mozilla diff --git a/accessible/ipc/extension/android/DocAccessiblePlatformExtParent.h b/accessible/ipc/extension/android/DocAccessiblePlatformExtParent.h new file mode 100644 index 0000000000..b9278599bb --- /dev/null +++ b/accessible/ipc/extension/android/DocAccessiblePlatformExtParent.h @@ -0,0 +1,22 @@ +/* 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/. */ + +#ifndef mozilla_a11y_DocAccessiblePlatformExtParent_h +#define mozilla_a11y_DocAccessiblePlatformExtParent_h + +#include "mozilla/a11y/PDocAccessiblePlatformExtParent.h" + +namespace mozilla { +namespace a11y { +class DocAccessiblePlatformExtParent : public PDocAccessiblePlatformExtParent { + public: + mozilla::ipc::IPCResult RecvSetPivotBoundaries( + PDocAccessibleParent* aFirstDoc, uint64_t aFirst, + PDocAccessibleParent* aLastDoc, uint64_t aLast); +}; +} // namespace a11y +} // namespace mozilla + +#endif diff --git a/accessible/ipc/extension/android/PDocAccessiblePlatformExt.ipdl b/accessible/ipc/extension/android/PDocAccessiblePlatformExt.ipdl new file mode 100644 index 0000000000..92b3d5f259 --- /dev/null +++ b/accessible/ipc/extension/android/PDocAccessiblePlatformExt.ipdl @@ -0,0 +1,35 @@ +/* -*- 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 protocol PDocAccessible; + +namespace mozilla { +namespace a11y { + +[ManualDealloc] +protocol PDocAccessiblePlatformExt { + manager PDocAccessible; + +child: + async __delete__(); + + async PivotTo(uint64_t aID, int32_t aGranularity, bool aForward, bool aInclusive); + + async NavigateText(uint64_t aID, int32_t aGranularity, int32_t aStartOffset, int32_t aEndOffset, bool aForward, bool aSelect); + + async SetSelection(uint64_t aID, int32_t aStart, int32_t aEnd); + + async Cut(uint64_t aID); + + async Copy(uint64_t aID); + + async Paste(uint64_t aID); + +parent: + async SetPivotBoundaries(PDocAccessible aFirstDoc, uint64_t aFirst, PDocAccessible aLastDoc, uint64_t aLast); + }; +} +} diff --git a/accessible/ipc/extension/android/moz.build b/accessible/ipc/extension/android/moz.build new file mode 100644 index 0000000000..50871e326b --- /dev/null +++ b/accessible/ipc/extension/android/moz.build @@ -0,0 +1,29 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# 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/. + +if CONFIG["ACCESSIBILITY"]: + IPDL_SOURCES += ["PDocAccessiblePlatformExt.ipdl"] + + EXPORTS.mozilla.a11y += [ + "DocAccessiblePlatformExtChild.h", + "DocAccessiblePlatformExtParent.h", + ] + + SOURCES += [ + "DocAccessiblePlatformExtChild.cpp", + "DocAccessiblePlatformExtParent.cpp", + ] + + LOCAL_INCLUDES += [ + "/accessible/android", + "/accessible/generic", + "/accessible/ipc/other", + "/widget/android", + ] + +include("/ipc/chromium/chromium-config.mozbuild") + +FINAL_LIBRARY = "xul" diff --git a/accessible/ipc/extension/mac/DocAccessiblePlatformExtChild.cpp b/accessible/ipc/extension/mac/DocAccessiblePlatformExtChild.cpp new file mode 100644 index 0000000000..c435758240 --- /dev/null +++ b/accessible/ipc/extension/mac/DocAccessiblePlatformExtChild.cpp @@ -0,0 +1,281 @@ +/* -*- 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 "DocAccessiblePlatformExtChild.h" + +#include "AccAttributes.h" +#include "DocAccessibleChild.h" +#include "HyperTextAccessibleWrap.h" +#include "nsAccUtils.h" + +#define UNIQUE_ID(acc) \ + !acc || acc->Document() == acc ? 0 \ + : reinterpret_cast<uint64_t>(acc->UniqueID()) + +namespace mozilla { +namespace a11y { + +mozilla::ipc::IPCResult DocAccessiblePlatformExtChild::RecvRangeAt( + const uint64_t& aID, const int32_t& aOffset, const EWhichRange& aRangeType, + uint64_t* aStartContainer, int32_t* aStartOffset, uint64_t* aEndContainer, + int32_t* aEndOffset) { + *aStartContainer = 0; + *aStartOffset = 0; + *aEndContainer = 0; + *aEndOffset = 0; + + HyperTextAccessibleWrap* acc = IdToHyperTextAccessibleWrap(aID); + if (!acc) { + return IPC_OK(); + } + + HyperTextAccessible* startContainer = nullptr; + HyperTextAccessible* endContainer = nullptr; + + acc->RangeAt(aOffset, aRangeType, &startContainer, aStartOffset, + &endContainer, aEndOffset); + + MOZ_ASSERT(!startContainer || startContainer->Document() == acc->Document()); + MOZ_ASSERT(!endContainer || endContainer->Document() == acc->Document()); + + *aStartContainer = UNIQUE_ID(startContainer); + *aEndContainer = UNIQUE_ID(endContainer); + + return IPC_OK(); +} + +mozilla::ipc::IPCResult DocAccessiblePlatformExtChild::RecvNextClusterAt( + const uint64_t& aID, const int32_t& aOffset, uint64_t* aNextContainer, + int32_t* aNextOffset) { + *aNextContainer = 0; + *aNextOffset = 0; + + HyperTextAccessibleWrap* acc = IdToHyperTextAccessibleWrap(aID); + if (!acc) { + return IPC_OK(); + } + + HyperTextAccessible* nextContainer = nullptr; + + acc->NextClusterAt(aOffset, &nextContainer, aNextOffset); + + MOZ_ASSERT(!nextContainer || nextContainer->Document() == acc->Document()); + + *aNextContainer = UNIQUE_ID(nextContainer); + + return IPC_OK(); +} + +mozilla::ipc::IPCResult DocAccessiblePlatformExtChild::RecvPreviousClusterAt( + const uint64_t& aID, const int32_t& aOffset, uint64_t* aPrevContainer, + int32_t* aPrevOffset) { + *aPrevContainer = 0; + *aPrevOffset = 0; + + HyperTextAccessibleWrap* acc = IdToHyperTextAccessibleWrap(aID); + if (!acc) { + return IPC_OK(); + } + + HyperTextAccessible* prevContainer = nullptr; + + acc->PreviousClusterAt(aOffset, &prevContainer, aPrevOffset); + + MOZ_ASSERT(!prevContainer || prevContainer->Document() == acc->Document()); + + *aPrevContainer = UNIQUE_ID(prevContainer); + + return IPC_OK(); +} + +mozilla::ipc::IPCResult DocAccessiblePlatformExtChild::RecvTextForRange( + const uint64_t& aID, const int32_t& aStartOffset, + const uint64_t& aEndContainer, const int32_t& aEndOffset, nsString* aText) { + HyperTextAccessibleWrap* acc = IdToHyperTextAccessibleWrap(aID); + HyperTextAccessibleWrap* endContainer = + IdToHyperTextAccessibleWrap(aEndContainer); + if (!acc || !endContainer) { + return IPC_OK(); + } + + acc->TextForRange(*aText, aStartOffset, endContainer, aEndOffset); + + return IPC_OK(); +} + +mozilla::ipc::IPCResult DocAccessiblePlatformExtChild::RecvBoundsForRange( + const uint64_t& aID, const int32_t& aStartOffset, + const uint64_t& aEndContainer, const int32_t& aEndOffset, + LayoutDeviceIntRect* aBounds) { + HyperTextAccessibleWrap* acc = IdToHyperTextAccessibleWrap(aID); + HyperTextAccessibleWrap* endContainer = + IdToHyperTextAccessibleWrap(aEndContainer); + if (!acc || !endContainer) { + *aBounds = LayoutDeviceIntRect(); + return IPC_OK(); + } + + *aBounds = acc->BoundsForRange(aStartOffset, endContainer, aEndOffset); + + return IPC_OK(); +} + +mozilla::ipc::IPCResult DocAccessiblePlatformExtChild::RecvLengthForRange( + const uint64_t& aID, const int32_t& aStartOffset, + const uint64_t& aEndContainer, const int32_t& aEndOffset, + int32_t* aLength) { + *aLength = 0; + + HyperTextAccessibleWrap* acc = IdToHyperTextAccessibleWrap(aID); + HyperTextAccessibleWrap* endContainer = + IdToHyperTextAccessibleWrap(aEndContainer); + if (!acc || !endContainer) { + return IPC_OK(); + } + + *aLength = acc->LengthForRange(aStartOffset, endContainer, aEndOffset); + + return IPC_OK(); +} + +mozilla::ipc::IPCResult DocAccessiblePlatformExtChild::RecvOffsetAtIndex( + const uint64_t& aID, const int32_t& aIndex, uint64_t* aContainer, + int32_t* aOffset) { + *aContainer = 0; + *aOffset = 0; + + HyperTextAccessibleWrap* acc = IdToHyperTextAccessibleWrap(aID); + if (!acc) { + return IPC_OK(); + } + + HyperTextAccessible* container = nullptr; + + acc->OffsetAtIndex(aIndex, &container, aOffset); + + MOZ_ASSERT(!container || container->Document() == acc->Document()); + + *aContainer = UNIQUE_ID(container); + + return IPC_OK(); +} + +mozilla::ipc::IPCResult DocAccessiblePlatformExtChild::RecvRangeOfChild( + const uint64_t& aID, const uint64_t& aChild, int32_t* aStartOffset, + int32_t* aEndOffset) { + *aStartOffset = 0; + *aEndOffset = 0; + + HyperTextAccessibleWrap* acc = IdToHyperTextAccessibleWrap(aID); + LocalAccessible* child = + static_cast<DocAccessibleChild*>(Manager())->IdToAccessible(aChild); + if (!acc || !child) { + return IPC_OK(); + } + + acc->RangeOfChild(child, aStartOffset, aEndOffset); + return IPC_OK(); +} + +mozilla::ipc::IPCResult DocAccessiblePlatformExtChild::RecvLeafAtOffset( + const uint64_t& aID, const int32_t& aOffset, uint64_t* aLeaf) { + *aLeaf = 0; + + HyperTextAccessibleWrap* acc = IdToHyperTextAccessibleWrap(aID); + if (!acc) { + return IPC_OK(); + } + + LocalAccessible* leaf = acc->LeafAtOffset(aOffset); + + MOZ_ASSERT(!leaf || leaf->Document() == acc->Document()); + + *aLeaf = UNIQUE_ID(leaf); + + return IPC_OK(); +} + +mozilla::ipc::IPCResult +DocAccessiblePlatformExtChild::RecvAttributedTextForRange( + const uint64_t& aID, const int32_t& aStartOffset, + const uint64_t& aEndContainer, const int32_t& aEndOffset, + nsTArray<TextAttributesRun>* aAttributes) { + HyperTextAccessibleWrap* acc = IdToHyperTextAccessibleWrap(aID); + HyperTextAccessibleWrap* endContainer = + IdToHyperTextAccessibleWrap(aEndContainer); + if (!acc || !endContainer) { + return IPC_OK(); + } + + nsTArray<nsString> texts; + nsTArray<LocalAccessible*> containers; + nsTArray<RefPtr<AccAttributes>> props; + + acc->AttributedTextForRange(texts, props, containers, aStartOffset, + endContainer, aEndOffset); + + MOZ_ASSERT(texts.Length() == props.Length() && + texts.Length() == containers.Length()); + + for (size_t i = 0; i < texts.Length(); i++) { + aAttributes->AppendElement(TextAttributesRun( + texts.ElementAt(i), UNIQUE_ID(containers.ElementAt(i)), + props.ElementAt(i))); + } + + return IPC_OK(); +} + +mozilla::ipc::IPCResult DocAccessiblePlatformExtChild::RecvSelectRange( + const uint64_t& aID, const int32_t& aStartOffset, + const uint64_t& aEndContainer, const int32_t& aEndOffset) { + RefPtr<HyperTextAccessibleWrap> acc = IdToHyperTextAccessibleWrap(aID); + RefPtr<HyperTextAccessibleWrap> endContainer = + IdToHyperTextAccessibleWrap(aEndContainer); + if (!acc || !endContainer) { + return IPC_OK(); + } + + acc->SelectRange(aStartOffset, endContainer, aEndOffset); + + return IPC_OK(); +} + +mozilla::ipc::IPCResult +DocAccessiblePlatformExtChild::RecvApplyPostSearchFilter( + const nsTArray<uint64_t>& aAccessibles, const int32_t& aLimit, + const EWhichPostFilter& aSearchKey, const nsString& aSearchText, + nsTArray<uint64_t>* aMatches) { + if (aSearchKey != EWhichPostFilter::eContainsText) { + return IPC_OK(); + } + + DocAccessibleChild* ipcDoc = static_cast<DocAccessibleChild*>(Manager()); + for (size_t i = 0; i < aAccessibles.Length(); i++) { + AccessibleWrap* acc = static_cast<AccessibleWrap*>( + ipcDoc->IdToAccessible(aAccessibles.ElementAt(i))); + if (!acc) { + continue; + } + + if (acc->ApplyPostFilter(aSearchKey, aSearchText)) { + aMatches->AppendElement(UNIQUE_ID(acc)); + } + } + + return IPC_OK(); +} + +HyperTextAccessibleWrap* +DocAccessiblePlatformExtChild::IdToHyperTextAccessibleWrap( + const uint64_t& aID) const { + return static_cast<HyperTextAccessibleWrap*>( + static_cast<DocAccessibleChild*>(Manager())->IdToHyperTextAccessible( + aID)); +} + +} // namespace a11y +} // namespace mozilla diff --git a/accessible/ipc/extension/mac/DocAccessiblePlatformExtChild.h b/accessible/ipc/extension/mac/DocAccessiblePlatformExtChild.h new file mode 100644 index 0000000000..c6f2580ccc --- /dev/null +++ b/accessible/ipc/extension/mac/DocAccessiblePlatformExtChild.h @@ -0,0 +1,87 @@ +/* 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/. */ + +#ifndef mozilla_a11y_DocAccessiblePlatformExtChild_h +#define mozilla_a11y_DocAccessiblePlatformExtChild_h + +#include "mozilla/a11y/PDocAccessiblePlatformExtChild.h" + +namespace mozilla { +namespace a11y { + +class HyperTextAccessibleWrap; +class DocAccessibleChild; + +class DocAccessiblePlatformExtChild : public PDocAccessiblePlatformExtChild { + public: + mozilla::ipc::IPCResult RecvRangeAt( + const uint64_t& aID, const int32_t& aOffset, + const EWhichRange& aRangeType, uint64_t* aStartContainer, + int32_t* aStartOffset, uint64_t* aEndContainer, int32_t* aEndOffset); + + mozilla::ipc::IPCResult RecvNextClusterAt(const uint64_t& aID, + const int32_t& aOffset, + uint64_t* aNextContainer, + int32_t* aNextOffset); + + mozilla::ipc::IPCResult RecvPreviousClusterAt(const uint64_t& aID, + const int32_t& aOffset, + uint64_t* aPrevContainer, + int32_t* aPrevOffset); + + mozilla::ipc::IPCResult RecvTextForRange(const uint64_t& aID, + const int32_t& aStartOffset, + const uint64_t& aEndContainer, + const int32_t& aEndOffset, + nsString* aText); + + mozilla::ipc::IPCResult RecvBoundsForRange(const uint64_t& aID, + const int32_t& aStartOffset, + const uint64_t& aEndContainer, + const int32_t& aEndOffset, + LayoutDeviceIntRect* aBounds); + + mozilla::ipc::IPCResult RecvLengthForRange(const uint64_t& aID, + const int32_t& aStartOffset, + const uint64_t& aEndContainer, + const int32_t& aEndOffset, + int32_t* aLength); + + mozilla::ipc::IPCResult RecvOffsetAtIndex(const uint64_t& aID, + const int32_t& aIndex, + uint64_t* aContainer, + int32_t* aOffset); + + mozilla::ipc::IPCResult RecvRangeOfChild(const uint64_t& aID, + const uint64_t& aChild, + int32_t* aStartOffset, + int32_t* aEndOffset); + + mozilla::ipc::IPCResult RecvLeafAtOffset(const uint64_t& aID, + const int32_t& aOffset, + uint64_t* aLeaf); + + mozilla::ipc::IPCResult RecvAttributedTextForRange( + const uint64_t& aID, const int32_t& aStartOffset, + const uint64_t& aEndContainer, const int32_t& aEndOffset, + nsTArray<TextAttributesRun>* aAttributes); + + MOZ_CAN_RUN_SCRIPT_BOUNDARY mozilla::ipc::IPCResult RecvSelectRange( + const uint64_t& aID, const int32_t& aStartOffset, + const uint64_t& aEndContainer, const int32_t& aEndOffset); + + mozilla::ipc::IPCResult RecvApplyPostSearchFilter( + const nsTArray<uint64_t>& aAccessibles, const int32_t& aLimit, + const EWhichPostFilter& aSearchKey, const nsString& aSearchText, + nsTArray<uint64_t>* aMatches); + + private: + HyperTextAccessibleWrap* IdToHyperTextAccessibleWrap( + const uint64_t& aID) const; +}; +} // namespace a11y +} // namespace mozilla + +#endif diff --git a/accessible/ipc/extension/mac/DocAccessiblePlatformExtParent.h b/accessible/ipc/extension/mac/DocAccessiblePlatformExtParent.h new file mode 100644 index 0000000000..07e65c6e2d --- /dev/null +++ b/accessible/ipc/extension/mac/DocAccessiblePlatformExtParent.h @@ -0,0 +1,19 @@ +/* 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/. */ + +#ifndef mozilla_a11y_DocAccessiblePlatformExtParent_h +#define mozilla_a11y_DocAccessiblePlatformExtParent_h + +#include "mozilla/a11y/PDocAccessiblePlatformExtParent.h" + +namespace mozilla { +namespace a11y { +class DocAccessiblePlatformExtParent : public PDocAccessiblePlatformExtParent { + +}; +} // namespace a11y +} // namespace mozilla + +#endif diff --git a/accessible/ipc/extension/mac/PDocAccessiblePlatformExt.ipdl b/accessible/ipc/extension/mac/PDocAccessiblePlatformExt.ipdl new file mode 100644 index 0000000000..82f9d18b47 --- /dev/null +++ b/accessible/ipc/extension/mac/PDocAccessiblePlatformExt.ipdl @@ -0,0 +1,73 @@ +/* -*- 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 protocol PDocAccessible; + +include "mozilla/GfxMessageUtils.h"; + +using mozilla::a11y::EWhichRange from "mozilla/a11y/IPCTypes.h"; +using mozilla::a11y::EWhichPostFilter from "mozilla/a11y/IPCTypes.h"; +[RefCounted] using mozilla::a11y::AccAttributes from "mozilla/a11y/IPCTypes.h"; +using mozilla::LayoutDeviceIntRect from "Units.h"; + +namespace mozilla { +namespace a11y { + +struct TextAttributesRun { + nsString Text; + uint64_t ContainerID; + AccAttributes TextAttributes; +}; + + +[ManualDealloc, NestedUpTo=inside_sync] sync protocol PDocAccessiblePlatformExt { + manager PDocAccessible; + +child: + async __delete__(); + + [Nested=inside_sync] sync RangeAt(uint64_t aID, int32_t aOffset, EWhichRange aRangeType) + returns(uint64_t aStartContainer, int32_t aStartOffset, + uint64_t aEndContainer, int32_t aEndOffset); + + [Nested=inside_sync] sync NextClusterAt(uint64_t aID, int32_t aOffset) + returns(uint64_t aNextContainer, int32_t aNextOffset); + + [Nested=inside_sync] sync PreviousClusterAt(uint64_t aID, int32_t aOffset) + returns(uint64_t aNextContainer, int32_t aNextOffset); + + [Nested=inside_sync] sync TextForRange(uint64_t aID, int32_t aStartOffset, uint64_t aEndContainer, int32_t aEndOffset) + returns(nsString aText); + + [Nested=inside_sync] sync BoundsForRange(uint64_t aID, int32_t aStartOffset, uint64_t aEndContainer, int32_t aEndOffset) + returns(LayoutDeviceIntRect aRetVal); + + [Nested=inside_sync] sync LengthForRange(uint64_t aID, int32_t aStartOffset, uint64_t aEndContainer, int32_t aEndOffset) + returns(int32_t aLength); + + [Nested=inside_sync] sync OffsetAtIndex(uint64_t aID, int32_t aIndex) + returns(uint64_t aContainer, int32_t aOffset); + + [Nested=inside_sync] sync RangeOfChild(uint64_t aID, uint64_t aChild) + returns(int32_t aStartOffset, int32_t aEndOffset); + + [Nested=inside_sync] sync LeafAtOffset(uint64_t aID, int32_t aOffset) + returns(uint64_t aLeaf); + + [Nested=inside_sync] sync AttributedTextForRange(uint64_t aID, int32_t aStartOffset, uint64_t aEndContainer, int32_t aEndOffset) + returns(TextAttributesRun[] aAttributedText); + + async SelectRange(uint64_t aID, int32_t aStartOffset, uint64_t aEndContainer, int32_t aEndOffset); + + // A filter that can be applied to search predicate results. + [Nested=inside_sync] sync ApplyPostSearchFilter(uint64_t[] aAccessibles, int32_t aLimit, + EWhichPostFilter aSearchKey, nsString aSearchText) + returns(uint64_t[] aMatches); + +}; + +} // namespace a11y +} // namespace mozilla diff --git a/accessible/ipc/extension/mac/moz.build b/accessible/ipc/extension/mac/moz.build new file mode 100644 index 0000000000..e7a7bf3bf8 --- /dev/null +++ b/accessible/ipc/extension/mac/moz.build @@ -0,0 +1,28 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# 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/. + +if CONFIG["ACCESSIBILITY"]: + IPDL_SOURCES += ["PDocAccessiblePlatformExt.ipdl"] + + EXPORTS.mozilla.a11y += [ + "DocAccessiblePlatformExtChild.h", + "DocAccessiblePlatformExtParent.h", + ] + + SOURCES += [ + "DocAccessiblePlatformExtChild.cpp", + ] + + LOCAL_INCLUDES += [ + "/accessible/base", + "/accessible/generic", + "/accessible/ipc/other", + "/accessible/mac", + ] + +include("/ipc/chromium/chromium-config.mozbuild") + +FINAL_LIBRARY = "xul" diff --git a/accessible/ipc/extension/moz.build b/accessible/ipc/extension/moz.build new file mode 100644 index 0000000000..3c82fd90b4 --- /dev/null +++ b/accessible/ipc/extension/moz.build @@ -0,0 +1,14 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# 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/. + +toolkit = CONFIG["MOZ_WIDGET_TOOLKIT"] + +if toolkit == "android": + DIRS += ["android"] +elif toolkit == "cocoa": + DIRS += ["mac"] +else: + DIRS += ["other"] diff --git a/accessible/ipc/extension/other/DocAccessiblePlatformExtChild.h b/accessible/ipc/extension/other/DocAccessiblePlatformExtChild.h new file mode 100644 index 0000000000..6a6542bf71 --- /dev/null +++ b/accessible/ipc/extension/other/DocAccessiblePlatformExtChild.h @@ -0,0 +1,20 @@ +/* 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/. */ + +#ifndef mozilla_a11y_DocAccessiblePlatformExtChild_h +#define mozilla_a11y_DocAccessiblePlatformExtChild_h + +#include "mozilla/a11y/PDocAccessiblePlatformExtChild.h" + +namespace mozilla { +namespace a11y { + +class DocAccessibleChild; + +class DocAccessiblePlatformExtChild : public PDocAccessiblePlatformExtChild {}; +} // namespace a11y +} // namespace mozilla + +#endif diff --git a/accessible/ipc/extension/other/DocAccessiblePlatformExtParent.h b/accessible/ipc/extension/other/DocAccessiblePlatformExtParent.h new file mode 100644 index 0000000000..e2e1cd907f --- /dev/null +++ b/accessible/ipc/extension/other/DocAccessiblePlatformExtParent.h @@ -0,0 +1,18 @@ +/* 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/. */ + +#ifndef mozilla_a11y_DocAccessiblePlatformExtParent_h +#define mozilla_a11y_DocAccessiblePlatformExtParent_h + +#include "mozilla/a11y/PDocAccessiblePlatformExtParent.h" + +namespace mozilla { +namespace a11y { +class DocAccessiblePlatformExtParent : public PDocAccessiblePlatformExtParent { +}; +} // namespace a11y +} // namespace mozilla + +#endif diff --git a/accessible/ipc/extension/other/PDocAccessiblePlatformExt.ipdl b/accessible/ipc/extension/other/PDocAccessiblePlatformExt.ipdl new file mode 100644 index 0000000000..738505a743 --- /dev/null +++ b/accessible/ipc/extension/other/PDocAccessiblePlatformExt.ipdl @@ -0,0 +1,20 @@ +/* -*- 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 protocol PDocAccessible; + +namespace mozilla { +namespace a11y { + +[ManualDealloc] +protocol PDocAccessiblePlatformExt { + manager PDocAccessible; + +child: + async __delete__(); +}; + +}}
\ No newline at end of file diff --git a/accessible/ipc/extension/other/moz.build b/accessible/ipc/extension/other/moz.build new file mode 100644 index 0000000000..dbbc98702c --- /dev/null +++ b/accessible/ipc/extension/other/moz.build @@ -0,0 +1,17 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# 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/. + +if CONFIG["ACCESSIBILITY"]: + IPDL_SOURCES += ["PDocAccessiblePlatformExt.ipdl"] + + EXPORTS.mozilla.a11y += [ + "DocAccessiblePlatformExtChild.h", + "DocAccessiblePlatformExtParent.h", + ] + +include("/ipc/chromium/chromium-config.mozbuild") + +FINAL_LIBRARY = "xul" |