flutter/BUILD.gn无用注释删除,等其它PR评论问题修改

Signed-off-by: 吴焕隆 <wuhl55@midea.com>
This commit is contained in:
吴焕隆
2022-04-18 10:41:26 +08:00
parent f4b478e12b
commit e94538efb5
3 changed files with 54 additions and 71 deletions
+3 -19
View File
@@ -437,8 +437,9 @@ template("flutter_engine_shell") {
"$flutter_root/engine/flutter/shell/platform/ohos/platform_task_runner_adapter.cc",
"$flutter_root/engine/flutter/shell/platform/ohos/platform_view_ohos.cc",
]
if ((!defined(config.disable_gpu) || !config.disable_gpu) && (!defined(
config.enable_rosen_backend) || !config.enable_rosen_backend)) {
if ((!defined(config.disable_gpu) || !config.disable_gpu) &&
(!defined(config.enable_rosen_backend) ||
!config.enable_rosen_backend)) {
sources += [
"$flutter_root/engine/flutter/shell/platform/ohos/ohos_surface_gl.cc",
]
@@ -497,8 +498,6 @@ template("flutter_engine_shell") {
_flutter_framework_headers = [
"$ios_prefix/framework/Headers/Flutter.h",
"$ios_prefix/framework/Headers/FlutterAppDelegate.h",
# "$ios_prefix/framework/Headers/FlutterCallbackCache.h",
"$ios_prefix/framework/Headers/FlutterDartProject.h",
"$ios_prefix/framework/Headers/FlutterEngine.h",
"$ios_prefix/framework/Headers/FlutterHeadlessDartRunner.h",
@@ -514,21 +513,14 @@ template("flutter_engine_shell") {
"$flutter_root/engine/flutter/shell/platform/darwin/common/command_line.mm",
"$flutter_root/engine/flutter/shell/common/switches.cc",
"$flutter_root/engine/flutter/shell/common/switches.h",
"$ios_prefix/framework/Source/FlutterAppDelegate.mm",
"$ios_prefix/framework/Source/FlutterAppDelegate_Internal.h",
"$ios_prefix/framework/Source/FlutterBinaryMessengerRelay.mm",
# "$ios_prefix/framework/Source/FlutterCallbackCache.mm",
# "$ios_prefix/framework/Source/FlutterCallbackCache_Internal.h",
"$ios_prefix/framework/Source/FlutterDartProject.mm",
"$ios_prefix/framework/Source/FlutterDartProject_Internal.h",
"$ios_prefix/framework/Source/FlutterEngine.mm",
"$ios_prefix/framework/Source/FlutterEngine_Internal.h",
"$ios_prefix/framework/Source/FlutterHeadlessDartRunner.mm",
# "$ios_prefix/framework/Source/FlutterObservatoryPublisher.h",
# "$ios_prefix/framework/Source/FlutterObservatoryPublisher.mm",
"$ios_prefix/framework/Source/FlutterOverlayView.h",
"$ios_prefix/framework/Source/FlutterOverlayView.mm",
"$ios_prefix/framework/Source/FlutterPlatformPlugin.h",
@@ -538,18 +530,10 @@ template("flutter_engine_shell") {
"$ios_prefix/framework/Source/FlutterPlatformViews_Internal.mm",
"$ios_prefix/framework/Source/FlutterPluginAppLifeCycleDelegate.mm",
"$ios_prefix/framework/Source/FlutterTextInputDelegate.h",
# "$ios_prefix/framework/Source/FlutterTextInputPlugin.h",
# "$ios_prefix/framework/Source/FlutterTextInputPlugin.mm",
"$ios_prefix/framework/Source/FlutterView.h",
"$ios_prefix/framework/Source/FlutterView.mm",
"$ios_prefix/framework/Source/FlutterViewController.mm",
"$ios_prefix/framework/Source/FlutterViewController_Internal.h",
# "$ios_prefix/framework/Source/accessibility_bridge.h",
# "$ios_prefix/framework/Source/accessibility_bridge.mm",
# "$ios_prefix/framework/Source/accessibility_text_entry.h",
# "$ios_prefix/framework/Source/accessibility_text_entry.mm",
"$ios_prefix/framework/Source/platform_message_response_darwin.h",
"$ios_prefix/framework/Source/platform_message_response_darwin.mm",
"$ios_prefix/framework/Source/platform_message_router.h",
+49 -48
View File
@@ -17,6 +17,7 @@
#define FOUNDATION_ACE_FRAMEWORKS_CORE_COMMON_IME_TEXT_COMPOSE_H
#include <cstdint>
#include "core/common/ime/constant.h"
namespace OHOS::Ace {
@@ -24,53 +25,53 @@ namespace OHOS::Ace {
* Stands for what text is selected and how the directional is.
* We use base/extent to indicate the start/end position because of uncertain direction.
*/
struct TextCompose {
TextCompose() = default;
TextCompose(int32_t base, int32_t extent) : baseOffset(base), extentOffset(extent) {}
void Update(int32_t base, int32_t extent)
{
baseOffset = base;
extentOffset = extent;
}
// Usually called when none is selected.
void Update(int32_t both)
{
baseOffset = both;
extentOffset = both;
}
bool operator==(const TextCompose& other) const
{
return baseOffset == other.baseOffset && extentOffset == other.extentOffset;
}
bool operator!=(const TextCompose& other) const
{
return !operator==(other);
}
/**
* @brief Get first selected character in the text.
*/
inline int32_t GetStart() const
{
return std::min(baseOffset, extentOffset);
}
/**
* @brief Get last selected character in the text.
*/
inline int32_t GetEnd() const
{
return std::max(baseOffset, extentOffset);
}
/**
* @brief Whether selection is valid.
*/
inline bool IsValid() const
{
return baseOffset > -1 && extentOffset > -1;
}
// May larger than, smaller than or equal to extentOffset.
int32_t baseOffset = -1;
// When paints caret, this is where the caret position is.
int32_t extentOffset = -1;
};
struct TextCompose {
TextCompose() = default;
TextCompose(int32_t base, int32_t extent) : baseOffset(base), extentOffset(extent) {}
void Update(int32_t base, int32_t extent)
{
baseOffset = base;
extentOffset = extent;
}
// Usually called when none is selected.
void Update(int32_t both)
{
baseOffset = both;
extentOffset = both;
}
bool operator==(const TextCompose& other) const
{
return baseOffset == other.baseOffset && extentOffset == other.extentOffset;
}
bool operator!=(const TextCompose& other) const
{
return !operator==(other);
}
/**
* @brief Get first selected character in the text.
*/
inline int32_t GetStart() const
{
return std::min(baseOffset, extentOffset);
}
/**
* @brief Get last selected character in the text.
*/
inline int32_t GetEnd() const
{
return std::max(baseOffset, extentOffset);
}
/**
* @brief Whether selection is valid.
*/
inline bool IsValid() const
{
return baseOffset > -1 && extentOffset > -1;
}
// May larger than, smaller than or equal to extentOffset.
int32_t baseOffset = -1;
// When paints caret, this is where the caret position is.
int32_t extentOffset = -1;
};
} // namespace OHOS::Ace
#endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMMON_IME_TEXT_COMPOSE_H
@@ -28,8 +28,6 @@ const char TEXT[] = "text";
const char HINT[] = "hint";
const char SELECTION_START[] = "selectionStart";
const char SELECTION_END[] = "selectionEnd";
const int NEXT_CHAR_INDEX_1 = 1;
const int NEXT_CHAR_INDEX_2 = 2;
} // namespace
@@ -92,8 +90,8 @@ void TextEditingValue::MoveRight()
int32_t nextCharIndex = selection.extentOffset;
selection.Update(StringUtils::NotInUtf16Bmp(utf16Text[nextCharIndex])
? std::min(static_cast<int32_t>(utf16Text.length()), nextCharIndex + NEXT_CHAR_INDEX_2)
: nextCharIndex + NEXT_CHAR_INDEX_1);
? std::min(static_cast<int32_t>(utf16Text.length()), nextCharIndex + 2)
: nextCharIndex + 1);
}
void TextEditingValue::MoveToPosition(int32_t position)