Extract XCUI text editing core and window seam headers
This commit is contained in:
29
engine/include/XCEngine/UI/Text/UITextEditing.h
Normal file
29
engine/include/XCEngine/UI/Text/UITextEditing.h
Normal file
@@ -0,0 +1,29 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace XCEngine {
|
||||
namespace UI {
|
||||
namespace Text {
|
||||
|
||||
std::size_t CountUtf8Codepoints(const std::string& text);
|
||||
std::size_t AdvanceUtf8Offset(const std::string& text, std::size_t offset);
|
||||
std::size_t RetreatUtf8Offset(const std::string& text, std::size_t offset);
|
||||
void AppendUtf8Codepoint(std::string& text, std::uint32_t codepoint);
|
||||
|
||||
std::vector<std::string> SplitLines(const std::string& text);
|
||||
std::size_t CountTextLines(const std::string& text);
|
||||
std::size_t CountUtf8CodepointsInRange(
|
||||
const std::string& text,
|
||||
std::size_t beginOffset,
|
||||
std::size_t endOffset);
|
||||
std::size_t FindLineStartOffset(const std::string& text, std::size_t caret);
|
||||
std::size_t FindLineEndOffset(const std::string& text, std::size_t caret);
|
||||
std::size_t MoveCaretVertically(const std::string& text, std::size_t caret, int lineDelta);
|
||||
|
||||
} // namespace Text
|
||||
} // namespace UI
|
||||
} // namespace XCEngine
|
||||
Reference in New Issue
Block a user