Bug 1851273 - P1: Add accessible/ios directory. r=Jamie,morgan,nlapre

Differential Revision: https://phabricator.services.mozilla.com/D187328
This commit is contained in:
Eitan Isaacson 2024-03-04 21:11:49 +00:00
parent 1c8ceee0d4
commit 25b310a6c2
17 changed files with 227 additions and 2 deletions

View File

@ -34,6 +34,10 @@ elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "android":
LOCAL_INCLUDES += [
"/accessible/android",
]
elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "uikit":
LOCAL_INCLUDES += [
"/accessible/ios",
]
else:
LOCAL_INCLUDES += [
"/accessible/other",

View File

@ -47,10 +47,10 @@ EPlatformDisabledState PlatformDisabledState();
void PreInit();
#endif
#if defined(MOZ_ACCESSIBILITY_ATK) || defined(XP_MACOSX)
#if defined(MOZ_ACCESSIBILITY_ATK) || defined(XP_DARWIN)
/**
* Is platform accessibility enabled.
* Only used on linux with atk and MacOS for now.
* Only used on Linux, MacOS and iOS for now.
*/
bool ShouldA11yBeEnabled();
#endif

View File

@ -112,6 +112,10 @@ elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "android":
LOCAL_INCLUDES += [
"/accessible/android",
]
elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "uikit":
LOCAL_INCLUDES += [
"/accessible/ios",
]
else:
LOCAL_INCLUDES += [
"/accessible/other",

View File

@ -53,6 +53,10 @@ elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "android":
LOCAL_INCLUDES += [
"/accessible/android",
]
elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "uikit":
LOCAL_INCLUDES += [
"/accessible/ios",
]
else:
LOCAL_INCLUDES += [
"/accessible/other",

View File

@ -42,6 +42,10 @@ elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "android":
LOCAL_INCLUDES += [
"/accessible/android",
]
elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "uikit":
LOCAL_INCLUDES += [
"/accessible/ios",
]
else:
LOCAL_INCLUDES += [
"/accessible/other",

View File

@ -0,0 +1,11 @@
---
# Objective C formatting rules.
# Since this doesn't derive from the Cpp section, we need to redifine the root rules here.
Language: ObjC
BasedOnStyle: Google
DerivePointerAlignment: false
PointerAlignment: Left
SortIncludes: false
ColumnLimit: 80
IndentPPDirectives: AfterHash

View File

@ -0,0 +1,30 @@
/* clang-format off */
/* -*- Mode: Objective-C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* clang-format on */
/* 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/. */
/* For documentation of the accessibility architecture,
* see https://firefox-source-docs.mozilla.org/accessible/index.html
*/
#ifndef mozilla_a11y_AccessibleWrap_h_
#define mozilla_a11y_AccessibleWrap_h_
#include "nsCOMPtr.h"
#include "LocalAccessible.h"
namespace mozilla {
namespace a11y {
class AccessibleWrap : public LocalAccessible {
public: // construction, destruction
AccessibleWrap(nsIContent* aContent, DocAccessible* aDoc);
virtual ~AccessibleWrap() = default;
};
} // namespace a11y
} // namespace mozilla
#endif

View File

@ -0,0 +1,15 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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"
using namespace mozilla::a11y;
//-----------------------------------------------------
// construction
//-----------------------------------------------------
AccessibleWrap::AccessibleWrap(nsIContent* aContent, DocAccessible* aDoc)
: LocalAccessible(aContent, aDoc) {}

View File

@ -0,0 +1,20 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:expandtab:shiftwidth=4:tabstop=4:
*/
/* 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_ApplicationAccessibleWrap_h__
#define mozilla_a11y_ApplicationAccessibleWrap_h__
#include "ApplicationAccessible.h"
namespace mozilla {
namespace a11y {
using ApplicationAccessibleWrap = ApplicationAccessible;
} // namespace a11y
} // namespace mozilla
#endif

View File

@ -0,0 +1,23 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/. */
/* For documentation of the accessibility architecture,
* see https://firefox-source-docs.mozilla.org/accessible/index.html
*/
#ifndef mozilla_a11y_DocAccessibleWrap_h__
#define mozilla_a11y_DocAccessibleWrap_h__
#include "DocAccessible.h"
namespace mozilla {
namespace a11y {
typedef DocAccessible DocAccessibleWrap;
} // namespace a11y
} // namespace mozilla
#endif

View File

@ -0,0 +1,47 @@
/* -*- 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 "Platform.h"
#include "RemoteAccessible.h"
#include "DocAccessibleParent.h"
namespace mozilla {
namespace a11y {
bool ShouldA11yBeEnabled() {
// XXX: Figure out proper a11y activation strategies in iOS.
return true;
}
void PlatformInit() {}
void PlatformShutdown() {}
void ProxyCreated(RemoteAccessible* aProxy) {}
void ProxyDestroyed(RemoteAccessible* aProxy) {}
void PlatformEvent(Accessible*, uint32_t) {}
void PlatformStateChangeEvent(Accessible*, uint64_t, bool) {}
void PlatformFocusEvent(Accessible* aTarget,
const LayoutDeviceIntRect& aCaretRect) {}
void PlatformCaretMoveEvent(Accessible* aTarget, int32_t aOffset,
bool aIsSelectionCollapsed, int32_t aGranularity,
const LayoutDeviceIntRect& aCaretRect,
bool aFromUser) {}
void PlatformTextChangeEvent(Accessible*, const nsAString&, int32_t, uint32_t,
bool, bool) {}
void PlatformShowHideEvent(Accessible*, Accessible*, bool, bool) {}
void PlatformSelectionEvent(Accessible*, Accessible*, uint32_t) {}
} // namespace a11y
} // namespace mozilla

View File

@ -0,0 +1,23 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/. */
/* For documentation of the accessibility architecture,
* see https://firefox-source-docs.mozilla.org/accessible/index.html
*/
#ifndef mozilla_a11y_RootAccessibleWrap_h__
#define mozilla_a11y_RootAccessibleWrap_h__
#include "RootAccessible.h"
namespace mozilla {
namespace a11y {
typedef RootAccessible RootAccessibleWrap;
} // namespace a11y
} // namespace mozilla
#endif

26
accessible/ios/moz.build Normal file
View File

@ -0,0 +1,26 @@
# -*- 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/.
EXPORTS.mozilla.a11y += [
"AccessibleWrap.h",
]
SOURCES += [
"AccessibleWrap.mm",
"Platform.mm",
]
LOCAL_INCLUDES += [
"/accessible/base",
"/accessible/generic",
"/accessible/html",
"/accessible/ipc",
"/accessible/xul",
]
FINAL_LIBRARY = "xul"
include("/ipc/chromium/chromium-config.mozbuild")

View File

@ -18,6 +18,10 @@ else:
LOCAL_INCLUDES += [
"/accessible/mac",
]
elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "uikit":
LOCAL_INCLUDES += [
"/accessible/ios",
]
else:
LOCAL_INCLUDES += [
"/accessible/other",

View File

@ -14,6 +14,8 @@ elif toolkit == "cocoa":
DIRS += ["mac"]
elif toolkit == "android":
DIRS += ["android"]
elif toolkit == "uikit":
DIRS += ["ios"]
else:
DIRS += ["other"]

View File

@ -59,6 +59,10 @@ elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "android":
LOCAL_INCLUDES += [
"/accessible/android",
]
elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "uikit":
LOCAL_INCLUDES += [
"/accessible/ios",
]
else:
LOCAL_INCLUDES += [
"/accessible/other",

View File

@ -46,6 +46,10 @@ elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "android":
LOCAL_INCLUDES += [
"/accessible/android",
]
elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "uikit":
LOCAL_INCLUDES += [
"/accessible/ios",
]
else:
LOCAL_INCLUDES += [
"/accessible/other",