Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_43355755
engine
提交
056fd459
E
engine
项目概览
weixin_43355755
/
engine
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
engine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
056fd459
编写于
12月 12, 2017
作者:
M
Michael Goderbauer
提交者:
GitHub
12月 12, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert " Add parameters to SemanticActions; implement extend selection for a11y (#4444)" (#4448)
This reverts commit
59c3a37e
.
上级
59c3a37e
变更
15
显示空白变更内容
内联
并排
Showing
15 changed file
with
31 addition
and
83 deletion
+31
-83
lib/ui/hooks.dart
lib/ui/hooks.dart
+2
-3
lib/ui/window.dart
lib/ui/window.dart
+2
-2
lib/ui/window/window.cc
lib/ui/window/window.cc
+3
-11
lib/ui/window/window.h
lib/ui/window/window.h
+1
-3
runtime/runtime_controller.cc
runtime/runtime_controller.cc
+2
-3
runtime/runtime_controller.h
runtime/runtime_controller.h
+1
-3
shell/common/engine.cc
shell/common/engine.cc
+2
-4
shell/common/engine.h
shell/common/engine.h
+1
-3
shell/common/platform_view.cc
shell/common/platform_view.cc
+3
-4
shell/common/platform_view.h
shell/common/platform_view.h
+1
-3
shell/platform/android/io/flutter/view/AccessibilityBridge.java
...platform/android/io/flutter/view/AccessibilityBridge.java
+5
-4
shell/platform/android/io/flutter/view/FlutterView.java
shell/platform/android/io/flutter/view/FlutterView.java
+2
-12
shell/platform/android/platform_view_android.cc
shell/platform/android/platform_view_android.cc
+2
-17
shell/platform/android/platform_view_android.h
shell/platform/android/platform_view_android.h
+1
-5
shell/platform/android/platform_view_android_jni.cc
shell/platform/android/platform_view_android_jni.cc
+3
-6
未找到文件。
lib/ui/hooks.dart
浏览文件 @
056fd459
...
...
@@ -85,13 +85,12 @@ void _dispatchPointerDataPacket(ByteData packet) {
_invoke1
<
PointerDataPacket
>(
window
.
onPointerDataPacket
,
window
.
_onPointerDataPacketZone
,
_unpackPointerDataPacket
(
packet
));
}
void
_dispatchSemanticsAction
(
int
id
,
int
action
,
ByteData
args
)
{
_invoke
3
<
int
,
SemanticsAction
,
ByteData
>(
void
_dispatchSemanticsAction
(
int
id
,
int
action
)
{
_invoke
2
<
int
,
SemanticsAction
>(
window
.
onSemanticsAction
,
window
.
_onSemanticsActionZone
,
id
,
SemanticsAction
.
values
[
action
],
args
,
);
}
...
...
lib/ui/window.dart
浏览文件 @
056fd459
...
...
@@ -14,7 +14,7 @@ typedef void FrameCallback(Duration duration);
typedef
void
PointerDataPacketCallback
(
PointerDataPacket
packet
);
/// Signature for [Window.onSemanticsAction].
typedef
void
SemanticsActionCallback
(
int
id
,
SemanticsAction
action
,
ByteData
args
);
typedef
void
SemanticsActionCallback
(
int
id
,
SemanticsAction
action
);
/// Signature for responses to platform messages.
///
...
...
lib/ui/window/window.cc
浏览文件 @
056fd459
...
...
@@ -223,22 +223,14 @@ void Window::DispatchPointerDataPacket(const PointerDataPacket& packet) {
{
data_handle
});
}
void
Window
::
DispatchSemanticsAction
(
int32_t
id
,
SemanticsAction
action
,
std
::
vector
<
uint8_t
>
args
)
{
void
Window
::
DispatchSemanticsAction
(
int32_t
id
,
SemanticsAction
action
)
{
tonic
::
DartState
*
dart_state
=
library_
.
dart_state
().
get
();
if
(
!
dart_state
)
return
;
tonic
::
DartState
::
Scope
scope
(
dart_state
);
Dart_Handle
args_handle
=
(
args
.
empty
())
?
Dart_Null
()
:
ToByteData
(
args
);
if
(
Dart_IsError
(
args_handle
))
return
;
DartInvokeField
(
library_
.
value
(),
"_dispatchSemanticsAction"
,
{
ToDart
(
id
),
ToDart
(
static_cast
<
int32_t
>
(
action
)),
args_handle
});
DartInvokeField
(
library_
.
value
(),
"_dispatchSemanticsAction"
,
{
ToDart
(
id
),
ToDart
(
static_cast
<
int32_t
>
(
action
))});
}
void
Window
::
BeginFrame
(
fxl
::
TimePoint
frameTime
)
{
...
...
lib/ui/window/window.h
浏览文件 @
056fd459
...
...
@@ -49,9 +49,7 @@ class Window {
void
UpdateSemanticsEnabled
(
bool
enabled
);
void
DispatchPlatformMessage
(
fxl
::
RefPtr
<
PlatformMessage
>
message
);
void
DispatchPointerDataPacket
(
const
PointerDataPacket
&
packet
);
void
DispatchSemanticsAction
(
int32_t
id
,
SemanticsAction
action
,
std
::
vector
<
uint8_t
>
args
);
void
DispatchSemanticsAction
(
int32_t
id
,
SemanticsAction
action
);
void
BeginFrame
(
fxl
::
TimePoint
frameTime
);
void
CompletePlatformMessageResponse
(
int
response_id
,
...
...
runtime/runtime_controller.cc
浏览文件 @
056fd459
...
...
@@ -106,11 +106,10 @@ void RuntimeController::DispatchPointerDataPacket(
}
void
RuntimeController
::
DispatchSemanticsAction
(
int32_t
id
,
SemanticsAction
action
,
std
::
vector
<
uint8_t
>
args
)
{
SemanticsAction
action
)
{
TRACE_EVENT1
(
"flutter"
,
"RuntimeController::DispatchSemanticsAction"
,
"mode"
,
"basic"
);
GetWindow
()
->
DispatchSemanticsAction
(
id
,
action
,
std
::
move
(
args
)
);
GetWindow
()
->
DispatchSemanticsAction
(
id
,
action
);
}
Window
*
RuntimeController
::
GetWindow
()
{
...
...
runtime/runtime_controller.h
浏览文件 @
056fd459
...
...
@@ -42,9 +42,7 @@ class RuntimeController : public WindowClient, public IsolateClient {
void
DispatchPlatformMessage
(
fxl
::
RefPtr
<
PlatformMessage
>
message
);
void
DispatchPointerDataPacket
(
const
PointerDataPacket
&
packet
);
void
DispatchSemanticsAction
(
int32_t
id
,
SemanticsAction
action
,
std
::
vector
<
uint8_t
>
args
);
void
DispatchSemanticsAction
(
int32_t
id
,
SemanticsAction
action
);
Dart_Port
GetMainPort
();
std
::
string
GetIsolateName
();
...
...
shell/common/engine.cc
浏览文件 @
056fd459
...
...
@@ -554,11 +554,9 @@ void Engine::DispatchPointerDataPacket(const PointerDataPacket& packet) {
runtime_
->
DispatchPointerDataPacket
(
packet
);
}
void
Engine
::
DispatchSemanticsAction
(
int
id
,
blink
::
SemanticsAction
action
,
std
::
vector
<
uint8_t
>
args
)
{
void
Engine
::
DispatchSemanticsAction
(
int
id
,
blink
::
SemanticsAction
action
)
{
if
(
runtime_
)
runtime_
->
DispatchSemanticsAction
(
id
,
action
,
std
::
move
(
args
)
);
runtime_
->
DispatchSemanticsAction
(
id
,
action
);
}
void
Engine
::
SetSemanticsEnabled
(
bool
enabled
)
{
...
...
shell/common/engine.h
浏览文件 @
056fd459
...
...
@@ -72,9 +72,7 @@ class Engine : public blink::RuntimeDelegate {
void
SetViewportMetrics
(
const
blink
::
ViewportMetrics
&
metrics
);
void
DispatchPlatformMessage
(
fxl
::
RefPtr
<
blink
::
PlatformMessage
>
message
);
void
DispatchPointerDataPacket
(
const
PointerDataPacket
&
packet
);
void
DispatchSemanticsAction
(
int
id
,
blink
::
SemanticsAction
action
,
std
::
vector
<
uint8_t
>
args
);
void
DispatchSemanticsAction
(
int
id
,
blink
::
SemanticsAction
action
);
void
SetSemanticsEnabled
(
bool
enabled
);
void
ScheduleFrame
(
bool
regenerate_layer_tree
=
true
)
override
;
...
...
shell/common/platform_view.cc
浏览文件 @
056fd459
...
...
@@ -55,13 +55,12 @@ void PlatformView::DispatchPlatformMessage(
}
void
PlatformView
::
DispatchSemanticsAction
(
int32_t
id
,
blink
::
SemanticsAction
action
,
std
::
vector
<
uint8_t
>
args
)
{
blink
::
SemanticsAction
action
)
{
blink
::
Threads
::
UI
()
->
PostTask
(
[
engine
=
engine_
->
GetWeakPtr
(),
id
,
action
,
args
=
std
::
move
(
args
)
]
{
[
engine
=
engine_
->
GetWeakPtr
(),
id
,
action
]
{
if
(
engine
)
{
engine
->
DispatchSemanticsAction
(
id
,
static_cast
<
blink
::
SemanticsAction
>
(
action
)
,
std
::
move
(
args
)
);
id
,
static_cast
<
blink
::
SemanticsAction
>
(
action
));
}
});
}
...
...
shell/common/platform_view.h
浏览文件 @
056fd459
...
...
@@ -41,9 +41,7 @@ class PlatformView : public std::enable_shared_from_this<PlatformView> {
virtual
void
Attach
()
=
0
;
void
DispatchPlatformMessage
(
fxl
::
RefPtr
<
blink
::
PlatformMessage
>
message
);
void
DispatchSemanticsAction
(
int32_t
id
,
blink
::
SemanticsAction
action
,
std
::
vector
<
uint8_t
>
args
);
void
DispatchSemanticsAction
(
int32_t
id
,
blink
::
SemanticsAction
action
);
void
SetSemanticsEnabled
(
bool
enabled
);
void
NotifyCreated
(
std
::
unique_ptr
<
Surface
>
surface
);
...
...
shell/platform/android/io/flutter/view/AccessibilityBridge.java
浏览文件 @
056fd459
...
...
@@ -312,16 +312,17 @@ class AccessibilityBridge extends AccessibilityNodeProvider implements BasicMess
boolean
performCursorMoveAction
(
SemanticsObject
object
,
int
virtualViewId
,
Bundle
arguments
,
boolean
forward
)
{
final
int
granularity
=
arguments
.
getInt
(
AccessibilityNodeInfo
.
ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT
);
final
boolean
extendSelection
=
arguments
.
getBoolean
(
AccessibilityNodeInfo
.
ACTION_ARGUMENT_EXTEND_SELECTION_BOOLEAN
);
// TODO(goderbauer): support extending selections.
// final boolean extendSelection = arguments.getBoolean(
// AccessibilityNodeInfo.ACTION_ARGUMENT_EXTEND_SELECTION_BOOLEAN);
switch
(
granularity
)
{
case
AccessibilityNodeInfo
.
MOVEMENT_GRANULARITY_CHARACTER
:
{
if
(
forward
&&
object
.
hasAction
(
Action
.
MOVE_CURSOR_FORWARD_BY_CHARACTER
))
{
mOwner
.
dispatchSemanticsAction
(
virtualViewId
,
Action
.
MOVE_CURSOR_FORWARD_BY_CHARACTER
,
extendSelection
);
mOwner
.
dispatchSemanticsAction
(
virtualViewId
,
Action
.
MOVE_CURSOR_FORWARD_BY_CHARACTER
);
return
true
;
}
if
(!
forward
&&
object
.
hasAction
(
Action
.
MOVE_CURSOR_BACKWARD_BY_CHARACTER
))
{
mOwner
.
dispatchSemanticsAction
(
virtualViewId
,
Action
.
MOVE_CURSOR_BACKWARD_BY_CHARACTER
,
extendSelection
);
mOwner
.
dispatchSemanticsAction
(
virtualViewId
,
Action
.
MOVE_CURSOR_BACKWARD_BY_CHARACTER
);
return
true
;
}
}
...
...
shell/platform/android/io/flutter/view/FlutterView.java
浏览文件 @
056fd459
...
...
@@ -682,7 +682,7 @@ public class FlutterView extends SurfaceView
ByteBuffer
buffer
,
int
position
);
private
static
native
void
nativeDispatchSemanticsAction
(
long
nativePlatformViewAndroid
,
int
id
,
int
action
,
ByteBuffer
args
,
int
argsPosition
);
int
action
);
private
static
native
void
nativeSetSemanticsEnabled
(
long
nativePlatformViewAndroid
,
boolean
enabled
);
...
...
@@ -743,19 +743,9 @@ public class FlutterView extends SurfaceView
private
TouchExplorationListener
mTouchExplorationListener
;
protected
void
dispatchSemanticsAction
(
int
id
,
AccessibilityBridge
.
Action
action
)
{
dispatchSemanticsAction
(
id
,
action
,
null
);
}
protected
void
dispatchSemanticsAction
(
int
id
,
AccessibilityBridge
.
Action
action
,
Object
args
)
{
if
(!
isAttached
())
return
;
ByteBuffer
encodedArgs
=
null
;
int
position
=
0
;
if
(
args
!=
null
)
{
encodedArgs
=
StandardMessageCodec
.
INSTANCE
.
encodeMessage
(
args
);
position
=
encodedArgs
.
position
();
}
nativeDispatchSemanticsAction
(
mNativeView
.
get
(),
id
,
action
.
value
,
encodedArgs
,
position
);
nativeDispatchSemanticsAction
(
mNativeView
.
get
(),
id
,
action
.
value
);
}
@Override
...
...
shell/platform/android/platform_view_android.cc
浏览文件 @
056fd459
...
...
@@ -410,24 +410,9 @@ void PlatformViewAndroid::HandlePlatformMessageEmptyResponse(int response_id) {
nullptr
);
}
void
PlatformViewAndroid
::
DispatchSemanticsAction
(
JNIEnv
*
env
,
jint
id
,
jint
action
,
jobject
args
,
jint
args_position
)
{
if
(
env
->
IsSameObject
(
args
,
NULL
))
{
std
::
vector
<
uint8_t
>
args_vector
;
void
PlatformViewAndroid
::
DispatchSemanticsAction
(
jint
id
,
jint
action
)
{
PlatformView
::
DispatchSemanticsAction
(
id
,
static_cast
<
blink
::
SemanticsAction
>
(
action
),
args_vector
);
return
;
}
uint8_t
*
args_data
=
static_cast
<
uint8_t
*>
(
env
->
GetDirectBufferAddress
(
args
));
std
::
vector
<
uint8_t
>
args_vector
=
std
::
vector
<
uint8_t
>
(
args_data
,
args_data
+
args_position
);
PlatformView
::
DispatchSemanticsAction
(
id
,
static_cast
<
blink
::
SemanticsAction
>
(
action
),
std
::
move
(
args_vector
));
id
,
static_cast
<
blink
::
SemanticsAction
>
(
action
));
}
void
PlatformViewAndroid
::
SetSemanticsEnabled
(
jboolean
enabled
)
{
...
...
shell/platform/android/platform_view_android.h
浏览文件 @
056fd459
...
...
@@ -79,11 +79,7 @@ class PlatformViewAndroid : public PlatformView {
void
InvokePlatformMessageEmptyResponseCallback
(
JNIEnv
*
env
,
jint
response_id
);
void
DispatchSemanticsAction
(
JNIEnv
*
env
,
jint
id
,
jint
action
,
jobject
args
,
jint
args_position
);
void
DispatchSemanticsAction
(
jint
id
,
jint
action
);
void
SetSemanticsEnabled
(
jboolean
enabled
);
...
...
shell/platform/android/platform_view_android_jni.cc
浏览文件 @
056fd459
...
...
@@ -236,11 +236,8 @@ static void DispatchSemanticsAction(JNIEnv* env,
jobject
jcaller
,
jlong
platform_view
,
jint
id
,
jint
action
,
jobject
args
,
jint
args_position
)
{
return
PLATFORM_VIEW
->
DispatchSemanticsAction
(
env
,
id
,
action
,
args
,
args_position
);
jint
action
)
{
return
PLATFORM_VIEW
->
DispatchSemanticsAction
(
id
,
action
);
}
static
void
SetSemanticsEnabled
(
JNIEnv
*
env
,
...
...
@@ -416,7 +413,7 @@ bool PlatformViewAndroid::Register(JNIEnv* env) {
},
{
.
name
=
"nativeDispatchSemanticsAction"
,
.
signature
=
"(JII
Ljava/nio/ByteBuffer;I
)V"
,
.
signature
=
"(JII)V"
,
.
fnPtr
=
reinterpret_cast
<
void
*>
(
&
shell
::
DispatchSemanticsAction
),
},
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录