MWsTextCursor Class Reference

class MWsTextCursor : public MWsObjectProvider

Wserv access to render stage Text Cursor implementation.

This interface allows delegation of Text Cursor drawing to the Render Stage. It must not to be confused with Custom Text Cursor drawing; RWsSession::SetCustomTextCursorHistorically, Text cursors have often been implemented using XOR drawing, because it is a cheap way to deliver a high-contrast cursor in certain system architectures where Operating System access to Graphics Device Memory is possible.

XOR drawing can be problematic for some Render Stages. This is because the XOR operation requires a read back followed by a write. This would stall a graphics accelerator hardware implementation.

In a render stage setting, the Text Cursor may not be the top-most window as a transition effect can slide a semi-transparent window over the top of the Text Cursor window. This means the cursor cannot be XOR drawn last after all other windows; the read-back cost cannot be hidden at the end of drawing each frame.

The Display Render Stage, responsible for interacting with hardware, can offer XOR drawing in some cases, for example Software Bit GDI, and not in others, for example OpenVG back-end hardware.

This interface allows a render stage to implement Text Cursors appropriately given the Display Render Stage which is present.

This interface uses the supplied Text Cursor Color as a hint only. TextCursor colors are better regarded as constrast level indicators where KRgbWhite means a high contrast text cursor, and KRgbBlack means an invisible text cursor.

Suggested strategies:
  1. XOR drawing is available. Just XOR draw the cursor each time in the supplied color. This corresponds to legacy non-Render Stage behaviour.

  2. No XOR drawing is available. Draw a black box (solid or hollow as appropriate). Ensure that the UI Toolkit which provides the platform's default text entry control has a compatible theme so that black is an appropriate high-contrast color.

Inherits from

Nested Classes and Structures