allow OutputDevice::DrawText to "decompose" the MetaTextRectAction. That is, if the given ITextLayout
says that "decomposition" should be used, then do not add a MetaTextRectAction, but delegate creation/adding
of MetaActions to ImplDrawText.
Effectively, this means that if a Control is painted to a virtual device with output disabled, the proper
meta actions - those for the DrawTextArray - are generated, instead of just one big MetaTextRectAction,
which doesn't know anything about the reference device.
- introduced (static) ImplGetEllipsesString, taking an OutputDevice and an ITextLayout
- introduced ITextLayout::GetTextBreak
=> with this change, all text-related operations in OutputDevice::ImplDrawText and
OutputDevice::ImplGetTextLines should be routed through the ITextLayout interface
- made ImplDrawText and ImplGetTextLines static
This way, we find all places where both methods access the target device (which is now explicit
instead of implicit), and can make sure that everything is routed through the ITextLayout interface,
if necessary.
- also, made both methods take ITextLayout& instead of a ITextLayout*
- added a default implementation for ITextLayout, which simply delegates all calls to a target device,
without any magic
- added GetCaretPositions to the ITextLayout interface, since this clearly is controlled by the text
layout. Implement the new method for both DefaultTextLayout and ReferenceDeviceTextLayout
- let the ReferenceDeviceTextLayout calculate more precise, when zooming/unzooming geometry
data
- let the ReferenceDeviceTextLayout do less actions on the reference device - pushing and popping the
Font is necessary only once, not for every DrawText(Point) action
refactor the Control's "draw with reference device" functionality
In particular, use the existing DrawText/ImplGetTextLines methods, but provide
them with an optional ITextLayout interface, which replaces the usage of GetTextWidth and DrawText( Point, ... )
This way, the ref-device-rendering benefits from the existing implementations in DrawText( Rectangle, ... ),
in particular, it now respects all kind of TEXT_DRAW_ flags, i.e. alignment, word breaks, multi line text,
disabled drawing, etc.