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) {
...
@@ -85,13 +85,12 @@ void _dispatchPointerDataPacket(ByteData packet) {
_invoke1
<
PointerDataPacket
>(
window
.
onPointerDataPacket
,
window
.
_onPointerDataPacketZone
,
_unpackPointerDataPacket
(
packet
));
_invoke1
<
PointerDataPacket
>(
window
.
onPointerDataPacket
,
window
.
_onPointerDataPacketZone
,
_unpackPointerDataPacket
(
packet
));
}
}
void
_dispatchSemanticsAction
(
int
id
,
int
action
,
ByteData
args
)
{
void
_dispatchSemanticsAction
(
int
id
,
int
action
)
{
_invoke
3
<
int
,
SemanticsAction
,
ByteData
>(
_invoke
2
<
int
,
SemanticsAction
>(
window
.
onSemanticsAction
,
window
.
onSemanticsAction
,
window
.
_onSemanticsActionZone
,
window
.
_onSemanticsActionZone
,
id
,
id
,
SemanticsAction
.
values
[
action
],
SemanticsAction
.
values
[
action
],
args
,
);
);
}
}
...
...
lib/ui/window.dart
浏览文件 @
056fd459
...
@@ -14,7 +14,7 @@ typedef void FrameCallback(Duration duration);
...
@@ -14,7 +14,7 @@ typedef void FrameCallback(Duration duration);
typedef
void
PointerDataPacketCallback
(
PointerDataPacket
packet
);
typedef
void
PointerDataPacketCallback
(
PointerDataPacket
packet
);
/// Signature for [Window.onSemanticsAction].
/// 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.
/// Signature for responses to platform messages.
///
///
...
...
lib/ui/window/window.cc
浏览文件 @
056fd459
...
@@ -223,22 +223,14 @@ void Window::DispatchPointerDataPacket(const PointerDataPacket& packet) {
...
@@ -223,22 +223,14 @@ void Window::DispatchPointerDataPacket(const PointerDataPacket& packet) {
{
data_handle
});
{
data_handle
});
}
}
void
Window
::
DispatchSemanticsAction
(
int32_t
id
,
void
Window
::
DispatchSemanticsAction
(
int32_t
id
,
SemanticsAction
action
)
{
SemanticsAction
action
,
std
::
vector
<
uint8_t
>
args
)
{
tonic
::
DartState
*
dart_state
=
library_
.
dart_state
().
get
();
tonic
::
DartState
*
dart_state
=
library_
.
dart_state
().
get
();
if
(
!
dart_state
)
if
(
!
dart_state
)
return
;
return
;
tonic
::
DartState
::
Scope
scope
(
dart_state
);
tonic
::
DartState
::
Scope
scope
(
dart_state
);
Dart_Handle
args_handle
=
(
args
.
empty
())
?
Dart_Null
()
:
ToByteData
(
args
);
DartInvokeField
(
library_
.
value
(),
"_dispatchSemanticsAction"
,
{
ToDart
(
id
),
ToDart
(
static_cast
<
int32_t
>
(
action
))});
if
(
Dart_IsError
(
args_handle
))
return
;
DartInvokeField
(
library_
.
value
(),
"_dispatchSemanticsAction"
,
{
ToDart
(
id
),
ToDart
(
static_cast
<
int32_t
>
(
action
)),
args_handle
});
}
}
void
Window
::
BeginFrame
(
fxl
::
TimePoint
frameTime
)
{
void
Window
::
BeginFrame
(
fxl
::
TimePoint
frameTime
)
{
...
...
lib/ui/window/window.h
浏览文件 @
056fd459
...
@@ -49,9 +49,7 @@ class Window {
...
@@ -49,9 +49,7 @@ class Window {
void
UpdateSemanticsEnabled
(
bool
enabled
);
void
UpdateSemanticsEnabled
(
bool
enabled
);
void
DispatchPlatformMessage
(
fxl
::
RefPtr
<
PlatformMessage
>
message
);
void
DispatchPlatformMessage
(
fxl
::
RefPtr
<
PlatformMessage
>
message
);
void
DispatchPointerDataPacket
(
const
PointerDataPacket
&
packet
);
void
DispatchPointerDataPacket
(
const
PointerDataPacket
&
packet
);
void
DispatchSemanticsAction
(
int32_t
id
,
void
DispatchSemanticsAction
(
int32_t
id
,
SemanticsAction
action
);
SemanticsAction
action
,
std
::
vector
<
uint8_t
>
args
);
void
BeginFrame
(
fxl
::
TimePoint
frameTime
);
void
BeginFrame
(
fxl
::
TimePoint
frameTime
);
void
CompletePlatformMessageResponse
(
int
response_id
,
void
CompletePlatformMessageResponse
(
int
response_id
,
...
...
runtime/runtime_controller.cc
浏览文件 @
056fd459
...
@@ -106,11 +106,10 @@ void RuntimeController::DispatchPointerDataPacket(
...
@@ -106,11 +106,10 @@ void RuntimeController::DispatchPointerDataPacket(
}
}
void
RuntimeController
::
DispatchSemanticsAction
(
int32_t
id
,
void
RuntimeController
::
DispatchSemanticsAction
(
int32_t
id
,
SemanticsAction
action
,
SemanticsAction
action
)
{
std
::
vector
<
uint8_t
>
args
)
{
TRACE_EVENT1
(
"flutter"
,
"RuntimeController::DispatchSemanticsAction"
,
"mode"
,
TRACE_EVENT1
(
"flutter"
,
"RuntimeController::DispatchSemanticsAction"
,
"mode"
,
"basic"
);
"basic"
);
GetWindow
()
->
DispatchSemanticsAction
(
id
,
action
,
std
::
move
(
args
)
);
GetWindow
()
->
DispatchSemanticsAction
(
id
,
action
);
}
}
Window
*
RuntimeController
::
GetWindow
()
{
Window
*
RuntimeController
::
GetWindow
()
{
...
...
runtime/runtime_controller.h
浏览文件 @
056fd459
...
@@ -42,9 +42,7 @@ class RuntimeController : public WindowClient, public IsolateClient {
...
@@ -42,9 +42,7 @@ class RuntimeController : public WindowClient, public IsolateClient {
void
DispatchPlatformMessage
(
fxl
::
RefPtr
<
PlatformMessage
>
message
);
void
DispatchPlatformMessage
(
fxl
::
RefPtr
<
PlatformMessage
>
message
);
void
DispatchPointerDataPacket
(
const
PointerDataPacket
&
packet
);
void
DispatchPointerDataPacket
(
const
PointerDataPacket
&
packet
);
void
DispatchSemanticsAction
(
int32_t
id
,
void
DispatchSemanticsAction
(
int32_t
id
,
SemanticsAction
action
);
SemanticsAction
action
,
std
::
vector
<
uint8_t
>
args
);
Dart_Port
GetMainPort
();
Dart_Port
GetMainPort
();
std
::
string
GetIsolateName
();
std
::
string
GetIsolateName
();
...
...
shell/common/engine.cc
浏览文件 @
056fd459
...
@@ -554,11 +554,9 @@ void Engine::DispatchPointerDataPacket(const PointerDataPacket& packet) {
...
@@ -554,11 +554,9 @@ void Engine::DispatchPointerDataPacket(const PointerDataPacket& packet) {
runtime_
->
DispatchPointerDataPacket
(
packet
);
runtime_
->
DispatchPointerDataPacket
(
packet
);
}
}
void
Engine
::
DispatchSemanticsAction
(
int
id
,
void
Engine
::
DispatchSemanticsAction
(
int
id
,
blink
::
SemanticsAction
action
)
{
blink
::
SemanticsAction
action
,
std
::
vector
<
uint8_t
>
args
)
{
if
(
runtime_
)
if
(
runtime_
)
runtime_
->
DispatchSemanticsAction
(
id
,
action
,
std
::
move
(
args
)
);
runtime_
->
DispatchSemanticsAction
(
id
,
action
);
}
}
void
Engine
::
SetSemanticsEnabled
(
bool
enabled
)
{
void
Engine
::
SetSemanticsEnabled
(
bool
enabled
)
{
...
...
shell/common/engine.h
浏览文件 @
056fd459
...
@@ -72,9 +72,7 @@ class Engine : public blink::RuntimeDelegate {
...
@@ -72,9 +72,7 @@ class Engine : public blink::RuntimeDelegate {
void
SetViewportMetrics
(
const
blink
::
ViewportMetrics
&
metrics
);
void
SetViewportMetrics
(
const
blink
::
ViewportMetrics
&
metrics
);
void
DispatchPlatformMessage
(
fxl
::
RefPtr
<
blink
::
PlatformMessage
>
message
);
void
DispatchPlatformMessage
(
fxl
::
RefPtr
<
blink
::
PlatformMessage
>
message
);
void
DispatchPointerDataPacket
(
const
PointerDataPacket
&
packet
);
void
DispatchPointerDataPacket
(
const
PointerDataPacket
&
packet
);
void
DispatchSemanticsAction
(
int
id
,
void
DispatchSemanticsAction
(
int
id
,
blink
::
SemanticsAction
action
);
blink
::
SemanticsAction
action
,
std
::
vector
<
uint8_t
>
args
);
void
SetSemanticsEnabled
(
bool
enabled
);
void
SetSemanticsEnabled
(
bool
enabled
);
void
ScheduleFrame
(
bool
regenerate_layer_tree
=
true
)
override
;
void
ScheduleFrame
(
bool
regenerate_layer_tree
=
true
)
override
;
...
...
shell/common/platform_view.cc
浏览文件 @
056fd459
...
@@ -55,13 +55,12 @@ void PlatformView::DispatchPlatformMessage(
...
@@ -55,13 +55,12 @@ void PlatformView::DispatchPlatformMessage(
}
}
void
PlatformView
::
DispatchSemanticsAction
(
int32_t
id
,
void
PlatformView
::
DispatchSemanticsAction
(
int32_t
id
,
blink
::
SemanticsAction
action
,
blink
::
SemanticsAction
action
)
{
std
::
vector
<
uint8_t
>
args
)
{
blink
::
Threads
::
UI
()
->
PostTask
(
blink
::
Threads
::
UI
()
->
PostTask
(
[
engine
=
engine_
->
GetWeakPtr
(),
id
,
action
,
args
=
std
::
move
(
args
)
]
{
[
engine
=
engine_
->
GetWeakPtr
(),
id
,
action
]
{
if
(
engine
)
{
if
(
engine
)
{
engine
->
DispatchSemanticsAction
(
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> {
...
@@ -41,9 +41,7 @@ class PlatformView : public std::enable_shared_from_this<PlatformView> {
virtual
void
Attach
()
=
0
;
virtual
void
Attach
()
=
0
;
void
DispatchPlatformMessage
(
fxl
::
RefPtr
<
blink
::
PlatformMessage
>
message
);
void
DispatchPlatformMessage
(
fxl
::
RefPtr
<
blink
::
PlatformMessage
>
message
);
void
DispatchSemanticsAction
(
int32_t
id
,
void
DispatchSemanticsAction
(
int32_t
id
,
blink
::
SemanticsAction
action
);
blink
::
SemanticsAction
action
,
std
::
vector
<
uint8_t
>
args
);
void
SetSemanticsEnabled
(
bool
enabled
);
void
SetSemanticsEnabled
(
bool
enabled
);
void
NotifyCreated
(
std
::
unique_ptr
<
Surface
>
surface
);
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
...
@@ -312,16 +312,17 @@ class AccessibilityBridge extends AccessibilityNodeProvider implements BasicMess
boolean
performCursorMoveAction
(
SemanticsObject
object
,
int
virtualViewId
,
Bundle
arguments
,
boolean
forward
)
{
boolean
performCursorMoveAction
(
SemanticsObject
object
,
int
virtualViewId
,
Bundle
arguments
,
boolean
forward
)
{
final
int
granularity
=
arguments
.
getInt
(
final
int
granularity
=
arguments
.
getInt
(
AccessibilityNodeInfo
.
ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT
);
AccessibilityNodeInfo
.
ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT
);
final
boolean
extendSelection
=
arguments
.
getBoolean
(
// TODO(goderbauer): support extending selections.
AccessibilityNodeInfo
.
ACTION_ARGUMENT_EXTEND_SELECTION_BOOLEAN
);
// final boolean extendSelection = arguments.getBoolean(
// AccessibilityNodeInfo.ACTION_ARGUMENT_EXTEND_SELECTION_BOOLEAN);
switch
(
granularity
)
{
switch
(
granularity
)
{
case
AccessibilityNodeInfo
.
MOVEMENT_GRANULARITY_CHARACTER
:
{
case
AccessibilityNodeInfo
.
MOVEMENT_GRANULARITY_CHARACTER
:
{
if
(
forward
&&
object
.
hasAction
(
Action
.
MOVE_CURSOR_FORWARD_BY_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
;
return
true
;
}
}
if
(!
forward
&&
object
.
hasAction
(
Action
.
MOVE_CURSOR_BACKWARD_BY_CHARACTER
))
{
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
;
return
true
;
}
}
}
}
...
...
shell/platform/android/io/flutter/view/FlutterView.java
浏览文件 @
056fd459
...
@@ -682,7 +682,7 @@ public class FlutterView extends SurfaceView
...
@@ -682,7 +682,7 @@ public class FlutterView extends SurfaceView
ByteBuffer
buffer
,
int
position
);
ByteBuffer
buffer
,
int
position
);
private
static
native
void
nativeDispatchSemanticsAction
(
long
nativePlatformViewAndroid
,
int
id
,
private
static
native
void
nativeDispatchSemanticsAction
(
long
nativePlatformViewAndroid
,
int
id
,
int
action
,
ByteBuffer
args
,
int
argsPosition
);
int
action
);
private
static
native
void
nativeSetSemanticsEnabled
(
long
nativePlatformViewAndroid
,
private
static
native
void
nativeSetSemanticsEnabled
(
long
nativePlatformViewAndroid
,
boolean
enabled
);
boolean
enabled
);
...
@@ -743,19 +743,9 @@ public class FlutterView extends SurfaceView
...
@@ -743,19 +743,9 @@ public class FlutterView extends SurfaceView
private
TouchExplorationListener
mTouchExplorationListener
;
private
TouchExplorationListener
mTouchExplorationListener
;
protected
void
dispatchSemanticsAction
(
int
id
,
AccessibilityBridge
.
Action
action
)
{
protected
void
dispatchSemanticsAction
(
int
id
,
AccessibilityBridge
.
Action
action
)
{
dispatchSemanticsAction
(
id
,
action
,
null
);
}
protected
void
dispatchSemanticsAction
(
int
id
,
AccessibilityBridge
.
Action
action
,
Object
args
)
{
if
(!
isAttached
())
if
(!
isAttached
())
return
;
return
;
ByteBuffer
encodedArgs
=
null
;
nativeDispatchSemanticsAction
(
mNativeView
.
get
(),
id
,
action
.
value
);
int
position
=
0
;
if
(
args
!=
null
)
{
encodedArgs
=
StandardMessageCodec
.
INSTANCE
.
encodeMessage
(
args
);
position
=
encodedArgs
.
position
();
}
nativeDispatchSemanticsAction
(
mNativeView
.
get
(),
id
,
action
.
value
,
encodedArgs
,
position
);
}
}
@Override
@Override
...
...
shell/platform/android/platform_view_android.cc
浏览文件 @
056fd459
...
@@ -410,24 +410,9 @@ void PlatformViewAndroid::HandlePlatformMessageEmptyResponse(int response_id) {
...
@@ -410,24 +410,9 @@ void PlatformViewAndroid::HandlePlatformMessageEmptyResponse(int response_id) {
nullptr
);
nullptr
);
}
}
void
PlatformViewAndroid
::
DispatchSemanticsAction
(
JNIEnv
*
env
,
void
PlatformViewAndroid
::
DispatchSemanticsAction
(
jint
id
,
jint
action
)
{
jint
id
,
jint
action
,
jobject
args
,
jint
args_position
)
{
if
(
env
->
IsSameObject
(
args
,
NULL
))
{
std
::
vector
<
uint8_t
>
args_vector
;
PlatformView
::
DispatchSemanticsAction
(
PlatformView
::
DispatchSemanticsAction
(
id
,
static_cast
<
blink
::
SemanticsAction
>
(
action
),
args_vector
);
id
,
static_cast
<
blink
::
SemanticsAction
>
(
action
));
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
));
}
}
void
PlatformViewAndroid
::
SetSemanticsEnabled
(
jboolean
enabled
)
{
void
PlatformViewAndroid
::
SetSemanticsEnabled
(
jboolean
enabled
)
{
...
...
shell/platform/android/platform_view_android.h
浏览文件 @
056fd459
...
@@ -79,11 +79,7 @@ class PlatformViewAndroid : public PlatformView {
...
@@ -79,11 +79,7 @@ class PlatformViewAndroid : public PlatformView {
void
InvokePlatformMessageEmptyResponseCallback
(
JNIEnv
*
env
,
void
InvokePlatformMessageEmptyResponseCallback
(
JNIEnv
*
env
,
jint
response_id
);
jint
response_id
);
void
DispatchSemanticsAction
(
JNIEnv
*
env
,
void
DispatchSemanticsAction
(
jint
id
,
jint
action
);
jint
id
,
jint
action
,
jobject
args
,
jint
args_position
);
void
SetSemanticsEnabled
(
jboolean
enabled
);
void
SetSemanticsEnabled
(
jboolean
enabled
);
...
...
shell/platform/android/platform_view_android_jni.cc
浏览文件 @
056fd459
...
@@ -236,11 +236,8 @@ static void DispatchSemanticsAction(JNIEnv* env,
...
@@ -236,11 +236,8 @@ static void DispatchSemanticsAction(JNIEnv* env,
jobject
jcaller
,
jobject
jcaller
,
jlong
platform_view
,
jlong
platform_view
,
jint
id
,
jint
id
,
jint
action
,
jint
action
)
{
jobject
args
,
return
PLATFORM_VIEW
->
DispatchSemanticsAction
(
id
,
action
);
jint
args_position
)
{
return
PLATFORM_VIEW
->
DispatchSemanticsAction
(
env
,
id
,
action
,
args
,
args_position
);
}
}
static
void
SetSemanticsEnabled
(
JNIEnv
*
env
,
static
void
SetSemanticsEnabled
(
JNIEnv
*
env
,
...
@@ -416,7 +413,7 @@ bool PlatformViewAndroid::Register(JNIEnv* env) {
...
@@ -416,7 +413,7 @@ bool PlatformViewAndroid::Register(JNIEnv* env) {
},
},
{
{
.
name
=
"nativeDispatchSemanticsAction"
,
.
name
=
"nativeDispatchSemanticsAction"
,
.
signature
=
"(JII
Ljava/nio/ByteBuffer;I
)V"
,
.
signature
=
"(JII)V"
,
.
fnPtr
=
reinterpret_cast
<
void
*>
(
&
shell
::
DispatchSemanticsAction
),
.
fnPtr
=
reinterpret_cast
<
void
*>
(
&
shell
::
DispatchSemanticsAction
),
},
},
{
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录