66bf2cfb93
Editor: - Editor::Shape(): Place end-of-line cursor correctly. - Editor::insert(): Allow insertion of '\n' character. - Don't try to reshape empty string each time. - Editor::insert(), Editor::setText(): Validate utf8 input - Editor::remove(): Delete across newlines. - Editor::copy(): implement. - Editor::text() Iterator. App: - Implement Ctrl-c, Ctrl-x, Ctr-v - Implement Ctrl-s - Handle "Enter" key as "insert '\n'" StringSlice: - Cleanup, copy ctor. Change-Id: I724edb82c93b30f4d5279f5a99036459a21ca2cd Reviewed-on: https://skia-review.googlesource.com/c/skia/+/222508 Auto-Submit: Hal Canary <halcanary@google.com> Commit-Queue: Ben Wagner <bungeman@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
1.0 KiB
1.0 KiB
#Editor#
This is an experimental Editor layer that abstracts out SkShaper text layeout for easy embedding into an application. The Editor layer is agnostic about the operating system.
+--------------------------------+
|Application |
+-+----+-------------------------+
| |
| |
| +-v-------------------------+
| |Editor |
| +-+----+--------------------+
| | |
| | |
| | +-v--------------------+
| | |SkShaper |
| | +-+--------+-----------+
| | | |
| | | |
+-v----v----v--+ +-v-----------+
|Skia | |HarfBuzz, ICU|
+--------------+ +-------------+
The Application layer must interact with the:
- Windowing system
- File system
- Clipboard
- Keyboard/mouse input.
Try it out:
tools/git-sync-deps
bin/gn gen out/default
ninja -C out/default editor
out/default/editor whitespace.txt