Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_43355755
engine
提交
f1b740c8
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,发现更多精彩内容 >>
提交
f1b740c8
编写于
10月 19, 2016
作者:
A
Adam Barth
提交者:
GitHub
10月 19, 2016
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove editing.mojom (#3152)
Clients have been migrated to the TextInputPlugin.
上级
6aab8f2c
变更
19
隐藏空白更改
内联
并排
Showing
19 changed file
with
1 addition
and
668 deletion
+1
-668
services/editing/BUILD.gn
services/editing/BUILD.gn
+0
-56
services/editing/editing.mojom
services/editing/editing.mojom
+0
-61
services/editing/ios/keyboard_impl.h
services/editing/ios/keyboard_impl.h
+0
-44
services/editing/ios/keyboard_impl.mm
services/editing/ios/keyboard_impl.mm
+0
-166
services/editing/src/org/domokit/editing/InputConnectionAdaptor.java
...iting/src/org/domokit/editing/InputConnectionAdaptor.java
+0
-104
services/editing/src/org/domokit/editing/KeyboardImpl.java
services/editing/src/org/domokit/editing/KeyboardImpl.java
+0
-64
services/editing/src/org/domokit/editing/KeyboardViewState.java
...es/editing/src/org/domokit/editing/KeyboardViewState.java
+0
-97
services/engine/BUILD.gn
services/engine/BUILD.gn
+0
-1
services/engine/input_event.mojom
services/engine/input_event.mojom
+0
-28
services/engine/sky_engine.mojom
services/engine/sky_engine.mojom
+0
-1
shell/platform/android/BUILD.gn
shell/platform/android/BUILD.gn
+0
-2
shell/platform/android/io/flutter/view/FlutterView.java
shell/platform/android/io/flutter/view/FlutterView.java
+1
-18
shell/platform/darwin/common/BUILD.gn
shell/platform/darwin/common/BUILD.gn
+0
-1
shell/platform/darwin/common/view_service_provider.cc
shell/platform/darwin/common/view_service_provider.cc
+0
-7
shell/platform/darwin/common/view_service_provider.h
shell/platform/darwin/common/view_service_provider.h
+0
-4
shell/platform/darwin/ios/BUILD.gn
shell/platform/darwin/ios/BUILD.gn
+0
-1
sky/packages/flutter_services/lib/editing.dart
sky/packages/flutter_services/lib/editing.dart
+0
-6
sky/packages/flutter_services/lib/input_event.dart
sky/packages/flutter_services/lib/input_event.dart
+0
-6
sky/packages/sky_services/BUILD.gn
sky/packages/sky_services/BUILD.gn
+0
-1
未找到文件。
services/editing/BUILD.gn
已删除
100644 → 0
浏览文件 @
6aab8f2c
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//mojo/public/tools/bindings/mojom.gni")
group("editing") {
public_deps = [
":interfaces",
]
if (is_android || is_ios) {
public_deps += [ ":editing_lib" ]
}
}
mojom("interfaces") {
sources = [
"editing.mojom",
]
}
if (is_android) {
import("//build/config/android/config.gni")
import("//build/config/android/rules.gni")
android_library("editing_lib") {
java_files = [
"src/org/domokit/editing/KeyboardImpl.java",
"src/org/domokit/editing/KeyboardViewState.java",
"src/org/domokit/editing/InputConnectionAdaptor.java",
]
deps = [
"//base:base_java",
"//mojo/public/java:bindings",
"//mojo/public/java:system",
":interfaces_java",
]
}
}
if (is_ios) {
source_set("editing_lib") {
sources = [
"ios/keyboard_impl.h",
"ios/keyboard_impl.mm",
]
deps = [
"//base:base",
"//mojo/public/cpp/bindings:utility",
"//mojo/public/cpp/application",
":interfaces",
]
}
}
services/editing/editing.mojom
已删除
100644 → 0
浏览文件 @
6aab8f2c
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
[DartPackage="sky_services"]
module editing;
enum TextAffinity {
UPSTREAM,
DOWNSTREAM,
};
enum SubmitAction {
DONE,
};
enum KeyboardType {
TEXT,
NUMBER,
PHONE,
DATETIME,
};
struct KeyboardConfiguration {
KeyboardType type = KeyboardType.TEXT;
string? action_label;
};
struct EditingState {
string text;
int32 selection_base;
int32 selection_extent;
TextAffinity selection_affinity = TextAffinity.DOWNSTREAM;
bool selection_is_directional;
int32 composing_base;
int32 composing_extent;
};
interface KeyboardClient {
UpdateEditingState(EditingState state);
Submit(SubmitAction action);
};
[ServiceName="editing::Keyboard"]
interface Keyboard {
SetClient(KeyboardClient client, KeyboardConfiguration configuration);
ClearClient();
SetEditingState(EditingState state);
Show();
Hide();
};
struct ClipboardData {
string text;
};
[ServiceName="editing::Clipboard"]
interface Clipboard {
SetClipboardData(ClipboardData clip);
GetClipboardData(string format) => (ClipboardData? clip);
};
services/editing/ios/keyboard_impl.h
已删除
100644 → 0
浏览文件 @
6aab8f2c
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_SERVICES_KEYBOARD_IOS_KEYBOARD_SERVICE_IMPL_H_
#define FLUTTER_SERVICES_KEYBOARD_IOS_KEYBOARD_SERVICE_IMPL_H_
#include "base/macros.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
#include "flutter/services/editing/editing.mojom.h"
#if __OBJC__
@
class
KeyboardClient
;
#else // __OBJC__
class
KeyboardClient
;
#endif // __OBJC__
namespace
sky
{
namespace
services
{
namespace
editing
{
class
KeyboardImpl
:
public
::
editing
::
Keyboard
{
public:
explicit
KeyboardImpl
(
mojo
::
InterfaceRequest
<::
editing
::
Keyboard
>
request
);
~
KeyboardImpl
()
override
;
void
SetClient
(
mojo
::
InterfaceHandle
<::
editing
::
KeyboardClient
>
client
,
::
editing
::
KeyboardConfigurationPtr
configuration
)
override
;
void
ClearClient
()
override
;
void
SetEditingState
(
::
editing
::
EditingStatePtr
state
)
override
;
void
Show
()
override
;
void
Hide
()
override
;
private:
mojo
::
StrongBinding
<::
editing
::
Keyboard
>
binding_
;
KeyboardClient
*
client_
;
DISALLOW_COPY_AND_ASSIGN
(
KeyboardImpl
);
};
}
// namespace editing
}
// namespace services
}
// namespace sky
#endif
/* defined(FLUTTER_SERVICES_KEYBOARD_IOS_KEYBOARD_SERVICE_IMPL_H__) */
services/editing/ios/keyboard_impl.mm
已删除
100644 → 0
浏览文件 @
6aab8f2c
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "flutter/services/editing/ios/keyboard_impl.h"
#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include <UIKit/UIKit.h>
#include <unicode/utf16.h>
static
inline
UIKeyboardType
ToUIKeyboardType
(
::
editing
::
KeyboardType
type
)
{
using
Type
=
::
editing
::
KeyboardType
;
switch
(
type
)
{
case
Type
::
TEXT
:
return
UIKeyboardTypeDefault
;
case
Type
::
NUMBER
:
return
UIKeyboardTypeDecimalPad
;
case
Type
::
PHONE
:
return
UIKeyboardTypePhonePad
;
default:
break
;
}
return
UIKeyboardTypeDefault
;
}
@interface
KeyboardClient
:
UIView
<
UIKeyInput
>
-
(
void
)
setClient
:(
::
editing
::
KeyboardClientPtr
)
client
;
-
(
void
)
setEditingState
:(
::
editing
::
EditingStatePtr
)
state
;
-
(
void
)
show
;
-
(
void
)
hide
;
@end
@implementation
KeyboardClient
{
::
editing
::
KeyboardClientPtr
_client
;
::
editing
::
EditingStatePtr
_state
;
base
::
string16
_text
;
}
@synthesize
keyboardType
=
_keyboardType
;
-
(
UITextAutocorrectionType
)
autocorrectionType
{
return
UITextAutocorrectionTypeNo
;
}
-
(
void
)
setClient
:(
::
editing
::
KeyboardClientPtr
)
client
{
_client
=
client
.
Pass
();
}
-
(
void
)
setEditingState
:(
::
editing
::
EditingStatePtr
)
state
{
_state
=
state
.
Pass
();
_text
=
base
::
UTF8ToUTF16
(
_state
->
text
.
To
<
std
::
string
>
());
}
-
(
void
)
show
{
NSAssert
([
UIApplication
sharedApplication
].
keyWindow
!=
nullptr
,
@"The application must have a key window since the keyboard client "
@"must be part of the responder chain to function"
);
[[
UIApplication
sharedApplication
].
keyWindow
addSubview
:
self
];
[
self
becomeFirstResponder
];
}
-
(
void
)
hide
{
[
self
resignFirstResponder
];
[
self
removeFromSuperview
];
}
#pragma mark - UIResponder Overrides
-
(
BOOL
)
canBecomeFirstResponder
{
return
YES
;
}
#pragma mark - UIKeyInput Overrides
// TODO(abarth): We should implement UITextInput for more features.
-
(
BOOL
)
hasText
{
return
YES
;
}
-
(
void
)
insertText
:(
NSString
*
)
text
{
int
start
=
std
::
max
(
0
,
std
::
min
(
_state
->
selection_base
,
_state
->
selection_extent
));
int
end
=
std
::
max
(
0
,
std
::
max
(
_state
->
selection_base
,
_state
->
selection_extent
));
int
len
=
end
-
start
;
_text
.
replace
(
start
,
len
,
base
::
SysNSStringToUTF16
(
text
));
int
caret
=
start
+
text
.
length
;
_state
->
selection_base
=
caret
;
_state
->
selection_extent
=
caret
;
_state
->
selection_affinity
=
::
editing
::
TextAffinity
::
UPSTREAM
;
_state
->
selection_is_directional
=
false
;
_state
->
composing_base
=
0
;
_state
->
composing_extent
=
0
;
_state
->
text
=
base
::
UTF16ToUTF8
(
_text
);
_client
->
UpdateEditingState
(
_state
.
Clone
());
}
-
(
void
)
deleteBackward
{
int
start
=
std
::
max
(
0
,
std
::
min
(
_state
->
selection_base
,
_state
->
selection_extent
));
int
end
=
std
::
max
(
0
,
std
::
max
(
_state
->
selection_base
,
_state
->
selection_extent
));
int
len
=
end
-
start
;
if
(
len
>
0
)
{
_text
.
erase
(
start
,
len
);
}
else
if
(
start
>
0
)
{
start
-=
1
;
len
=
1
;
if
(
start
>
0
&&
UTF16_IS_LEAD
(
_text
[
start
-
1
])
&&
UTF16_IS_TRAIL
(
_text
[
start
]))
{
start
-=
1
;
len
+=
1
;
}
_text
.
erase
(
start
,
len
);
}
_state
->
selection_base
=
start
;
_state
->
selection_extent
=
start
;
_state
->
selection_affinity
=
::
editing
::
TextAffinity
::
DOWNSTREAM
;
_state
->
selection_is_directional
=
false
;
_state
->
composing_base
=
0
;
_state
->
composing_extent
=
0
;
_state
->
text
=
base
::
UTF16ToUTF8
(
_text
);
_client
->
UpdateEditingState
(
_state
.
Clone
());
}
@end
namespace
sky
{
namespace
services
{
namespace
editing
{
KeyboardImpl
::
KeyboardImpl
(
mojo
::
InterfaceRequest
<::
editing
::
Keyboard
>
request
)
:
binding_
(
this
,
request
.
Pass
()),
client_
([[
KeyboardClient
alloc
]
init
])
{}
KeyboardImpl
::~
KeyboardImpl
()
{
[
client_
hide
];
[
client_
release
];
}
void
KeyboardImpl
::
SetClient
(
mojo
::
InterfaceHandle
<::
editing
::
KeyboardClient
>
client
,
::
editing
::
KeyboardConfigurationPtr
config
)
{
client_
.
keyboardType
=
ToUIKeyboardType
(
config
->
type
);
[
client_
setClient
:
::
editing
:
:
KeyboardClientPtr
::
Create
(
client
.
Pass
())];
}
void
KeyboardImpl
::
ClearClient
()
{
// TODO: implement this
}
void
KeyboardImpl
::
SetEditingState
(
::
editing
::
EditingStatePtr
state
)
{
[
client_
setEditingState
:
state
.
Pass
()];
}
void
KeyboardImpl
::
Show
()
{
[
client_
show
];
}
void
KeyboardImpl
::
Hide
()
{
[
client_
hide
];
}
}
// namespace editing
}
// namespace services
}
// namespace sky
services/editing/src/org/domokit/editing/InputConnectionAdaptor.java
已删除
100644 → 0
浏览文件 @
6aab8f2c
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package
org.domokit.editing
;
import
android.text.Editable
;
import
android.text.Selection
;
import
android.view.inputmethod.BaseInputConnection
;
import
android.view.inputmethod.CompletionInfo
;
import
android.view.inputmethod.CorrectionInfo
;
import
android.view.inputmethod.EditorInfo
;
import
android.view.KeyEvent
;
import
android.view.View
;
import
org.chromium.mojom.editing.EditingState
;
import
org.chromium.mojom.editing.KeyboardClient
;
import
org.chromium.mojom.editing.SubmitAction
;
/**
* An adaptor between InputConnection and KeyboardClient.
*/
public
class
InputConnectionAdaptor
extends
BaseInputConnection
{
private
KeyboardClient
mClient
;
private
EditingState
mOutgoingState
;
public
InputConnectionAdaptor
(
View
view
,
KeyboardClient
client
)
{
super
(
view
,
true
);
assert
client
!=
null
;
mClient
=
client
;
mOutgoingState
=
new
EditingState
();
}
private
void
updateEditingState
()
{
Editable
content
=
getEditable
();
mOutgoingState
.
text
=
content
.
toString
();
mOutgoingState
.
selectionBase
=
Selection
.
getSelectionStart
(
content
);
mOutgoingState
.
selectionExtent
=
Selection
.
getSelectionEnd
(
content
);
mOutgoingState
.
composingBase
=
BaseInputConnection
.
getComposingSpanStart
(
content
);
mOutgoingState
.
composingExtent
=
BaseInputConnection
.
getComposingSpanEnd
(
content
);
mClient
.
updateEditingState
(
mOutgoingState
);
}
@Override
public
boolean
commitText
(
CharSequence
text
,
int
newCursorPosition
)
{
boolean
result
=
super
.
commitText
(
text
,
newCursorPosition
);
updateEditingState
();
return
result
;
}
@Override
public
boolean
deleteSurroundingText
(
int
beforeLength
,
int
afterLength
)
{
boolean
result
=
super
.
deleteSurroundingText
(
beforeLength
,
afterLength
);
updateEditingState
();
return
result
;
}
@Override
public
boolean
setComposingRegion
(
int
start
,
int
end
)
{
boolean
result
=
super
.
setComposingRegion
(
start
,
end
);
updateEditingState
();
return
result
;
}
@Override
public
boolean
setComposingText
(
CharSequence
text
,
int
newCursorPosition
)
{
boolean
result
=
super
.
setComposingText
(
text
,
newCursorPosition
);
updateEditingState
();
return
result
;
}
@Override
public
boolean
setSelection
(
int
start
,
int
end
)
{
boolean
result
=
super
.
setSelection
(
start
,
end
);
updateEditingState
();
return
result
;
}
@Override
public
boolean
sendKeyEvent
(
KeyEvent
event
)
{
boolean
result
=
super
.
sendKeyEvent
(
event
);
if
(
event
.
getAction
()
==
KeyEvent
.
ACTION_UP
)
{
// Weird special case. This method is (sometimes) called for the backspace key in 2
// situations:
// 1. There is no selection. In that case, we want to delete the previous character.
// 2. There is a selection. In that case, we want to delete the selection.
// event.getNumber() is 0, and commitText("", 1) will do what we want.
if
(
event
.
getKeyCode
()
==
KeyEvent
.
KEYCODE_DEL
&&
mOutgoingState
.
selectionBase
==
mOutgoingState
.
selectionExtent
)
{
deleteSurroundingText
(
1
,
0
);
}
else
{
String
text
=
event
.
getNumber
()
==
0
?
""
:
String
.
valueOf
(
event
.
getNumber
());
commitText
(
text
,
1
);
}
}
return
result
;
}
@Override
public
boolean
performEditorAction
(
int
actionCode
)
{
mClient
.
submit
(
SubmitAction
.
DONE
);
return
true
;
}
}
services/editing/src/org/domokit/editing/KeyboardImpl.java
已删除
100644 → 0
浏览文件 @
6aab8f2c
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package
org.domokit.editing
;
import
android.content.Context
;
import
android.view.inputmethod.InputMethodManager
;
import
org.chromium.mojo.system.MojoException
;
import
org.chromium.mojom.editing.EditingState
;
import
org.chromium.mojom.editing.Keyboard
;
import
org.chromium.mojom.editing.KeyboardClient
;
import
org.chromium.mojom.editing.KeyboardConfiguration
;
/**
* Android implementation of Keyboard.
*/
public
class
KeyboardImpl
implements
Keyboard
{
private
KeyboardViewState
mViewState
;
private
Context
mContext
;
public
KeyboardImpl
(
Context
context
,
KeyboardViewState
state
)
{
mContext
=
context
;
mViewState
=
state
;
}
@Override
public
void
close
()
{
mViewState
.
close
();
}
@Override
public
void
onConnectionError
(
MojoException
e
)
{}
@Override
public
void
setClient
(
KeyboardClient
client
,
KeyboardConfiguration
configuration
)
{
mViewState
.
setClient
(
client
,
configuration
);
}
@Override
public
void
clearClient
()
{
mViewState
.
close
();
}
@Override
public
void
setEditingState
(
EditingState
state
)
{
mViewState
.
setEditingState
(
state
);
}
@Override
public
void
show
()
{
InputMethodManager
imm
=
(
InputMethodManager
)
mContext
.
getSystemService
(
Context
.
INPUT_METHOD_SERVICE
);
imm
.
showSoftInput
(
mViewState
.
getView
(),
0
);
}
@Override
public
void
hide
()
{
InputMethodManager
imm
=
(
InputMethodManager
)
mContext
.
getSystemService
(
Context
.
INPUT_METHOD_SERVICE
);
imm
.
hideSoftInputFromWindow
(
mViewState
.
getView
().
getApplicationWindowToken
(),
0
);
}
}
services/editing/src/org/domokit/editing/KeyboardViewState.java
已删除
100644 → 0
浏览文件 @
6aab8f2c
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package
org.domokit.editing
;
import
android.content.Context
;
import
android.text.Editable
;
import
android.text.InputType
;
import
android.text.Selection
;
import
android.text.SpannableStringBuilder
;
import
android.util.Log
;
import
android.view.inputmethod.EditorInfo
;
import
android.view.inputmethod.InputConnection
;
import
android.view.inputmethod.InputMethodManager
;
import
android.view.View
;
import
org.chromium.mojom.editing.EditingState
;
import
org.chromium.mojom.editing.KeyboardClient
;
import
org.chromium.mojom.editing.KeyboardConfiguration
;
import
org.chromium.mojom.editing.KeyboardType
;
/**
* Per-View keyboard state.
*/
public
class
KeyboardViewState
{
private
View
mView
;
private
KeyboardClient
mClient
;
private
KeyboardConfiguration
mConfiguration
;
private
EditingState
mIncomingState
;
public
KeyboardViewState
(
View
view
)
{
mView
=
view
;
mClient
=
null
;
}
public
void
setClient
(
KeyboardClient
client
,
KeyboardConfiguration
configuration
)
{
if
(
mClient
!=
null
)
mClient
.
close
();
mIncomingState
=
null
;
mClient
=
client
;
mConfiguration
=
configuration
;
InputMethodManager
imm
=
(
InputMethodManager
)
mView
.
getContext
().
getSystemService
(
Context
.
INPUT_METHOD_SERVICE
);
imm
.
restartInput
(
mView
);
}
public
void
setEditingState
(
EditingState
state
)
{
mIncomingState
=
state
;
InputMethodManager
imm
=
(
InputMethodManager
)
mView
.
getContext
().
getSystemService
(
Context
.
INPUT_METHOD_SERVICE
);
imm
.
restartInput
(
mView
);
}
private
static
int
inputTypeFromKeyboardType
(
int
keyboardType
)
{
if
(
keyboardType
==
KeyboardType
.
DATETIME
)
return
InputType
.
TYPE_CLASS_DATETIME
;
if
(
keyboardType
==
KeyboardType
.
NUMBER
)
return
InputType
.
TYPE_CLASS_NUMBER
;
if
(
keyboardType
==
KeyboardType
.
PHONE
)
return
InputType
.
TYPE_CLASS_PHONE
;
return
InputType
.
TYPE_CLASS_TEXT
;
}
public
InputConnection
createInputConnection
(
EditorInfo
outAttrs
)
{
if
(
mClient
==
null
)
return
null
;
outAttrs
.
inputType
=
inputTypeFromKeyboardType
(
mConfiguration
.
type
);
outAttrs
.
actionLabel
=
mConfiguration
.
actionLabel
;
outAttrs
.
imeOptions
=
EditorInfo
.
IME_ACTION_DONE
|
EditorInfo
.
IME_FLAG_NO_FULLSCREEN
;
InputConnectionAdaptor
connection
=
new
InputConnectionAdaptor
(
mView
,
mClient
);
if
(
mIncomingState
!=
null
)
{
outAttrs
.
initialSelStart
=
mIncomingState
.
selectionBase
;
outAttrs
.
initialSelEnd
=
mIncomingState
.
selectionExtent
;
connection
.
getEditable
().
append
(
mIncomingState
.
text
);
connection
.
setSelection
(
mIncomingState
.
selectionBase
,
mIncomingState
.
selectionExtent
);
connection
.
setComposingRegion
(
mIncomingState
.
composingBase
,
mIncomingState
.
composingExtent
);
}
else
{
outAttrs
.
initialSelStart
=
0
;
outAttrs
.
initialSelEnd
=
0
;
}
return
connection
;
}
public
View
getView
()
{
return
mView
;
}
public
void
close
()
{
if
(
mClient
==
null
)
return
;
mClient
.
close
();
mClient
=
null
;
}
}
services/engine/BUILD.gn
浏览文件 @
f1b740c8
...
...
@@ -6,7 +6,6 @@ import("//mojo/public/tools/bindings/mojom.gni")
mojom("interfaces") {
sources = [
"input_event.mojom",
"sky_engine.mojom",
]
...
...
services/engine/input_event.mojom
已删除
100644 → 0
浏览文件 @
6aab8f2c
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
[DartPackage="sky_services"]
module sky;
enum EventType {
UNKNOWN,
BACK,
KEY_PRESSED,
KEY_RELEASED,
};
struct KeyData {
int32 key_code;
int32 flags;
int32 scan_code;
int32 meta_state;
};
// TODO(abarth): Should we have a malloc-free way of creating an input event
// message? What we have now could stress out the Android Java GC.
struct InputEvent {
EventType type;
int64 time_stamp;
KeyData? key_data;
};
services/engine/sky_engine.mojom
浏览文件 @
f1b740c8
...
...
@@ -4,7 +4,6 @@
module sky;
import "flutter/services/engine/input_event.mojom";
import "mojo/public/interfaces/application/service_provider.mojom";
import "mojo/public/interfaces/application/shell.mojom";
import "mojo/services/asset_bundle/interfaces/asset_bundle.mojom";
...
...
shell/platform/android/BUILD.gn
浏览文件 @
f1b740c8
...
...
@@ -84,8 +84,6 @@ android_library("java") {
deps = [
"//base:base_java",
"//flutter/services/editing:editing_lib",
"//flutter/services/editing:interfaces_java",
"//flutter/services/engine:interfaces_java",
"//flutter/services/platform:interfaces_java",
"//flutter/services/vsync:vsync_lib",
...
...
shell/platform/android/io/flutter/view/FlutterView.java
浏览文件 @
f1b740c8
...
...
@@ -42,7 +42,6 @@ import org.chromium.mojo.system.MessagePipeHandle;
import
org.chromium.mojo.system.MojoException
;
import
org.chromium.mojo.system.Pair
;
import
org.chromium.mojo.system.impl.CoreImpl
;
import
org.chromium.mojom.editing.Keyboard
;
import
org.chromium.mojom.flutter.platform.ApplicationMessages
;
import
org.chromium.mojom.mojo.ServiceProvider
;
import
org.chromium.mojom.sky.AppLifecycleState
;
...
...
@@ -63,9 +62,6 @@ import io.flutter.plugin.common.ActivityLifecycleListener;
import
io.flutter.plugin.editing.TextInputPlugin
;
import
io.flutter.plugin.platform.PlatformPlugin
;
import
org.domokit.editing.KeyboardImpl
;
import
org.domokit.editing.KeyboardViewState
;
/**
* An Android view containing a Flutter app.
*/
...
...
@@ -90,7 +86,6 @@ public class FlutterView extends SurfaceView
private
HashMap
<
String
,
OnMessageListenerAsync
>
mAsyncOnMessageListeners
;
private
final
SurfaceHolder
.
Callback
mSurfaceCallback
;
private
final
ViewportMetrics
mMetrics
;
private
final
KeyboardViewState
mKeyboardState
;
private
final
AccessibilityManager
mAccessibilityManager
;
private
BroadcastReceiver
discoveryReceiver
;
private
List
<
ActivityLifecycleListener
>
mActivityLifecycleListeners
;
...
...
@@ -139,8 +134,6 @@ public class FlutterView extends SurfaceView
};
getHolder
().
addCallback
(
mSurfaceCallback
);
mKeyboardState
=
new
KeyboardViewState
(
this
);
Core
core
=
CoreImpl
.
getInstance
();
mPlatformServiceProvider
=
new
ServiceProviderImpl
(
core
,
this
,
ServiceRegistry
.
SHARED
);
...
...
@@ -273,10 +266,7 @@ public class FlutterView extends SurfaceView
@Override
public
InputConnection
onCreateInputConnection
(
EditorInfo
outAttrs
)
{
InputConnection
connection
=
mKeyboardState
.
createInputConnection
(
outAttrs
);
if
(
connection
==
null
)
connection
=
mTextInputPlugin
.
createInputConnection
(
this
,
outAttrs
);
return
connection
;
return
mTextInputPlugin
.
createInputConnection
(
this
,
outAttrs
);
}
// Must match the PointerChange enum in pointer.dart.
...
...
@@ -463,13 +453,6 @@ public class FlutterView extends SurfaceView
}
private
void
configureLocalServices
(
ServiceRegistry
registry
)
{
registry
.
register
(
Keyboard
.
MANAGER
.
getName
(),
new
ServiceFactory
()
{
@Override
public
Binding
connectToService
(
FlutterView
view
,
Core
core
,
MessagePipeHandle
pipe
)
{
return
Keyboard
.
MANAGER
.
bind
(
new
KeyboardImpl
(
view
.
getContext
(),
mKeyboardState
),
pipe
);
}
});
registry
.
register
(
ApplicationMessages
.
MANAGER
.
getName
(),
new
ServiceFactory
()
{
@Override
public
Binding
connectToService
(
FlutterView
view
,
Core
core
,
MessagePipeHandle
pipe
)
{
...
...
shell/platform/darwin/common/BUILD.gn
浏览文件 @
f1b740c8
...
...
@@ -21,7 +21,6 @@ source_set("common") {
"//base:i18n",
"//dart/runtime:libdart",
"//flutter/runtime",
"//flutter/services/editing",
"//flutter/services/engine:interfaces",
"//flutter/services/platform",
"//flutter/services/vsync",
...
...
shell/platform/darwin/common/view_service_provider.cc
浏览文件 @
f1b740c8
...
...
@@ -25,13 +25,6 @@ void ViewServiceProvider::ConnectToService(
std
::
move
(
client_handle
)));
return
;
}
#if TARGET_OS_IPHONE
if
(
service_name
==
::
editing
::
Keyboard
::
Name_
)
{
new
sky
::
services
::
editing
::
KeyboardImpl
(
mojo
::
InterfaceRequest
<::
editing
::
Keyboard
>
(
std
::
move
(
client_handle
)));
return
;
}
#endif
}
}
// namespace shell
shell/platform/darwin/common/view_service_provider.h
浏览文件 @
f1b740c8
...
...
@@ -13,10 +13,6 @@
#include "mojo/public/cpp/bindings/strong_binding.h"
#include "mojo/public/interfaces/application/service_provider.mojom.h"
#if TARGET_OS_IPHONE
#include "flutter/services/editing/ios/keyboard_impl.h"
#endif
namespace
shell
{
typedef
std
::
function
<
void
(
...
...
shell/platform/darwin/ios/BUILD.gn
浏览文件 @
f1b740c8
...
...
@@ -52,7 +52,6 @@ shared_library("flutter_framework_dylib") {
"//base:base",
"//dart/runtime:libdart",
"//flutter/lib/ui",
"//flutter/services/editing",
"//flutter/services/engine:interfaces",
"//flutter/services/platform",
"//flutter/services/vsync",
...
...
sky/packages/flutter_services/lib/editing.dart
已删除
100644 → 0
浏览文件 @
6aab8f2c
/// Copyright 2016 The Chromium Authors. All rights reserved.
/// Use of this source code is governed by a BSD-style license that can be
/// found in the LICENSE file.
import
'package:sky_services/editing/editing.mojom.dart'
;
export
'package:sky_services/editing/editing.mojom.dart'
;
sky/packages/flutter_services/lib/input_event.dart
已删除
100644 → 0
浏览文件 @
6aab8f2c
/// Copyright 2016 The Chromium Authors. All rights reserved.
/// Use of this source code is governed by a BSD-style license that can be
/// found in the LICENSE file.
import
'package:sky_services/sky/input_event.mojom.dart'
;
export
'package:sky_services/sky/input_event.mojom.dart'
;
sky/packages/sky_services/BUILD.gn
浏览文件 @
f1b740c8
...
...
@@ -23,7 +23,6 @@ dart_pkg("sky_services") {
deps = [
":copy_sky_services_license",
"//flutter/services/editing:interfaces",
"//flutter/services/platform:interfaces",
]
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录