28 #ifndef INC_YReader_DSReader_h_
29 #define INC_YReader_DSReader_h_ 1
32 #include YFM_YSLib_UI_TextArea
33 #include YFM_YSLib_Service_TextFile
34 #include YFM_YSLib_Service_TextManager
36 #include YFM_Helper_Initialization
48 using Drawing::PixelType;
86 unique_ptr<Text::TextFileBuffer>
p_text;
147 SDst h_up = MainScreenHeight,
SDst h_down = MainScreenHeight,
172 ?
p_text->GetEncoding() : Text::CharSet::
Null)
178 DefGetter(const ynothrow,
size_t, TextSize,
188 DefGetter(const ynothrow,
size_t, TopPosition,
190 DefGetter(const ynothrow,
size_t, BottomPosition,
204 throw LoggedEvent(
"Null text buffer pointer found.");
215 SetFont(const Drawing::
Font&);
void AdjustForFirstNewline()
void AdjustForPrevNewline()
Drawing::FontSize ScrollByPixel(Drawing::FontSize)
向下滚屏指定像素行。
Drawing::FontSize AdjustScrollOffset()
调整滚屏像素偏移量:立即继续滚动至下一整文本行。
Drawing::FontSize scroll_offset
滚屏像素偏移量。
Text::TextFileBuffer::iterator i_top
文本区域输入迭代器。
void SetVisible(bool=true)
设置文本区域可见性。
std::uint16_t SDst
屏幕坐标距离。
#define DefBitmaskEnum(_tEnum)
#define DefGetter(_q, _t, _n,...)
YSLib::UI::BufferedTextArea area_up
上下屏幕对应文本区域。
DualScreenReader(SDst w=MainScreenWidth, SDst h_up=MainScreenHeight, SDst h_down=MainScreenHeight, Drawing::FontCache &fc_=FetchDefaultFontCache())
构造。
void Attach(YSLib::UI::Window &, YSLib::UI::Window &)
附加到窗口。
DefPred(const ynothrow, BufferReady, bool(p_text))
#define ynothrow
YSLib 无异常抛出保证:若支持 noexcept 关键字, 指定特定的 noexcept 异常规范。
Drawing::FontCache & fc
字体缓存。
YF_API Drawing::FontCache & FetchDefaultFontCache()
取默认字体缓存。
#define ythrow(...)
YSLib 动态异常规范:根据是否使用异常规范宏指定或忽略动态异常规范。
Text::TextFileBuffer::iterator PutLastLine()
YSLib::UI::BufferedTextArea area_dn
Drawing::Padding Margin
公用边距。
void MoveUpForLastLine(ptrdiff_t, size_t)
bool Execute(Command)
执行阅读器命令。
unique_ptr< Text::TextFileBuffer > p_text
文本资源。
void SetLineGap(u8=0)
设置行距。
void Invalidate()
无效化文本区域,并调用 ViewChanged (仅当非空)。
std::function< void()> ViewChanged
视图变更回调函数。
void AdjustMargins()
调整边距:使用公用边距更新各文本显示区域的边距。
Text::TextFileBuffer::iterator i_btm
void SetFontSize(Drawing::FontSize=Drawing::Font::DefaultSize)
设置文本区域的字体大小。
u16 overread_line_n
读入文件结束后的空行数。
void Stretch(SDst)
伸缩:从最大值起向上调整(减少)下文字区域的高后更新视图。
void LoadText(TextFile &)
载入文本。