Virtual Text Views
PBVirtualTextView
Opaque object handle: (not documented yet)
This is a subclass of PBElement. You can safely cast from PBVirtualTextView to PBElement. To cast from PBElement to PBVirtualTextView, call PBVirtualTextViewCast; this performs a runtime assertion to check the cast is possible. This function is thread-safe.
This object maintains an internal reference count. When the reference count reaches zero, the object will be automatically deallocated. To increment the reference count, call PBElementRetain; to decrement the reference count, call PBElementRelease. These functions are thread-safe.
PBMessageVirtualTextGetLineInfo
Structure: (not documented yet)
Fields
[in] lineIndex (uint64_t
): (not documented yet)
stringLength (uint32_t
): (not documented yet)
drawOffsetX (int16_t
): (not documented yet)
[in] regionIndex (uint8_t
): (not documented yet)
PBVirtualTextGetStringRequest
Structure: (not documented yet)
Fields
[in] lineIndex (uint64_t
): (not documented yet)
[in] offsetIntoString (uint32_t
): (not documented yet)
[in] regionIndex (uint8_t
): (not documented yet)
PBMessageVirtualTextGetString
Structure: (not documented yet)
Fields
[in] [indirect] request (PBVirtualTextGetStringRequest): (not documented yet)
buffer (string buffer): (not documented yet)
PBVirtualTextGetPlanRequest
Structure: (not documented yet)
Fields
[in] lineIndex (uint64_t
): (not documented yet)
[in] regionIndex (uint8_t
): (not documented yet)
[in] textStyle (referenced PBTextStyle): (not documented yet)
caretColor (PBColor): (not documented yet)
PBMessageVirtualTextGetPlan
Structure: (not documented yet)
Fields
[in] [indirect] request (PBVirtualTextGetPlanRequest): (not documented yet)
textPlan (nullable owned PBTextPlan): (not documented yet)
PBMessageVirtualTextAdjustMenu
Structure: (not documented yet)
Fields
[in] lineIndex (uint64_t
): (not documented yet)
[in] commandList (referenced PBCommandList): (not documented yet)
PBMessageVirtualTextDrawLine
Structure: (not documented yet)
Fields
[in] lineIndex (uint64_t
): (not documented yet)
[in] painter (referenced PBPainter): (not documented yet)
[in] [indirect] lineBounds (PBRectangle): (not documented yet)
PBVirtualTextDrawRegionRequest
Structure: (not documented yet)
Fields
[in] lineIndex (uint64_t
): (not documented yet)
[in] painter (referenced PBPainter): (not documented yet)
[in] regionIndex (uint8_t
): (not documented yet)
[in] regionBounds (PBRectangle): (not documented yet)
[in] selFrom (int32_t
): (not documented yet)
[in] selTo (int32_t
): (not documented yet)
PBMessageVirtualTextDrawRegion
Structure: (not documented yet)
Fields
[in] [indirect] request (PBVirtualTextDrawRegionRequest): (not documented yet)
PBMessageVirtualTextSelectionChanged
Structure: (not documented yet)
Fields
[in] fromRegionSwitch (bool
): (not documented yet)
PBVirtualTextViewFlags
Enumeration/bitset of type uint32_t: (not documented yet)
Constants
PBVirtualTextView_ALLOW_SELECTION
PBVirtualTextView_ALLOW_SELECTION = 1<<7
Allow the user to select and copy the text in the view.
PBVirtualTextView_USE_CARET
PBVirtualTextView_USE_CARET = 1<<0
Show a caret and allow it to be moved without creating a selection.
PBVirtualTextView_SCROLL_ACCESSORIES
PBVirtualTextView_SCROLL_ACCESSORIES = 1<<1
Horizontally scroll the accessory elements along with the main content.
Or any of the values from PBElementFlags.
PBVirtualTextViewAccessory
Enumeration/bitset of type int32_t: (not documented yet)
Constants
PBVirtualTextViewAccessory_HEADER
PBVirtualTextViewAccessory_HEADER = 1
Shown at the top of the view, regardless of scroll position.
PBVirtualTextViewAccessory_FOOTER
PBVirtualTextViewAccessory_FOOTER = 2
Shown at the bottom of the view, regardless of scroll position.
PBVirtualTextViewAccessory_PREAMBLE
PBVirtualTextViewAccessory_PREAMBLE = 3
Shown before the start of the main text content.
PBVirtualTextViewAccessory_POSTAMBLE
PBVirtualTextViewAccessory_POSTAMBLE = 4
Shown after the end of the main text content.
PBVirtualTextViewRegionFlags
Enumeration/bitset of type uint32_t: (not documented yet)
Constants
PBVirtualTextViewRegion_AUTO_GROW
PBVirtualTextViewRegion_AUTO_GROW = 1<<0
(not documented yet)
PBVirtualTextViewRegion_RIGHT_ALIGN_CELLS
PBVirtualTextViewRegion_RIGHT_ALIGN_CELLS = 1<<1
(not documented yet)
PBVirtualTextViewRegion_EXTEND_HIT_BOX
PBVirtualTextViewRegion_EXTEND_HIT_BOX = 1<<2
Extend the hit box of this region to the right side of the view. This flag is only valid on the last region in the view, and is ignored if the horizontal scroll bar is enabled.
PBVirtualTextViewRegion_FIXED
PBVirtualTextViewRegion_FIXED = 1<<3
Do not scroll this region horizontally. This flag can only be set on the first and last region. In the former case, the region is fixed on the left side of the view. In the latter case, it is fixed on the right side.
PBVirtualTextViewRegion_ALLOW_SELECTION
PBVirtualTextViewRegion_ALLOW_SELECTION = 1<<7
(not documented yet)
PBVirtualTextViewRegion
Structure: (not documented yet)
Fields
flags (PBVirtualTextViewRegionFlags): (not documented yet)
leftMarginDp (int32_t
): (not documented yet)
leftMarginInMonospacedGlyphs (int32_t
): (not documented yet)
rightMarginDp (int32_t
): (not documented yet)
rightMarginInMonospacedGlyphs (int32_t
): (not documented yet)
widthDp (int32_t
): (not documented yet)
widthInMonospacedGlyphs (int32_t
): (not documented yet)
PBVirtualTextViewCreate
Function: (not documented yet)
Syntax (C/C++)
PBVirtualTextViewPtr _Nullable PBVirtualTextViewCreate(PBScrollViewRef parent,
PBVirtualTextViewFlags flags);
Syntax (Python)
VirtualTextViewCreate(parent, flags) -> (textView)
Parameters and Return Values
[in] parent (referenced PBScrollView): (not documented yet)
[in] flags (PBVirtualTextViewFlags): (not documented yet)
[out] textView (nullable owned PBVirtualTextView): (not documented yet)
PBVirtualTextViewInsert
Function: (not documented yet)
Syntax (C/C++)
void PBVirtualTextViewInsert(PBVirtualTextViewRef textView, uint64_t firstIndex,
uint64_t count);
Syntax (Python)
VirtualTextViewInsert(textView, firstIndex, count)
Parameters and Return Values
[in] textView (referenced PBVirtualTextView): (not documented yet)
[in] firstIndex (uint64_t
): (not documented yet)
[in] count (uint64_t
): (not documented yet)
PBVirtualTextViewRemove
Function: (not documented yet)
Syntax (C/C++)
void PBVirtualTextViewRemove(PBVirtualTextViewRef textView, uint64_t firstIndex,
uint64_t count);
Syntax (Python)
VirtualTextViewRemove(textView, firstIndex, count)
Parameters and Return Values
[in] textView (referenced PBVirtualTextView): (not documented yet)
[in] firstIndex (uint64_t
): (not documented yet)
[in] count (uint64_t
): (not documented yet)
PBVirtualTextViewRemoveAll
Function: (not documented yet)
Syntax (C/C++)
void PBVirtualTextViewRemoveAll(PBVirtualTextViewRef textView);
Syntax (Python)
VirtualTextViewRemoveAll(textView)
Parameters and Return Values
[in] textView (referenced PBVirtualTextView): (not documented yet)
PBVirtualTextViewInvalidate
Function: (not documented yet)
Syntax (C/C++)
void PBVirtualTextViewInvalidate(PBVirtualTextViewRef textView,
uint64_t firstIndex, uint64_t count);
Syntax (Python)
VirtualTextViewInvalidate(textView, firstIndex, count)
Parameters and Return Values
[in] textView (referenced PBVirtualTextView): (not documented yet)
[in] firstIndex (uint64_t
): (not documented yet)
[in] count (uint64_t
): (not documented yet)
PBVirtualTextViewInvalidateAll
Function: (not documented yet)
Syntax (C/C++)
void PBVirtualTextViewInvalidateAll(PBVirtualTextViewRef textView);
Syntax (Python)
VirtualTextViewInvalidateAll(textView)
Parameters and Return Values
[in] textView (referenced PBVirtualTextView): (not documented yet)
PBVirtualTextViewSetTextStyle
Function: (not documented yet)
Syntax (C/C++)
void PBVirtualTextViewSetTextStyle(PBVirtualTextViewRef view,
PBTextStyleRef textStyle);
Syntax (Python)
VirtualTextViewSetTextStyle(view, textStyle)
Parameters and Return Values
[in] view (referenced PBVirtualTextView): (not documented yet)
[in] textStyle (referenced PBTextStyle): (not documented yet)
PBVirtualTextViewGetLineHeight
Function: (not documented yet)
Syntax (C/C++)
int64_t PBVirtualTextViewGetLineHeight(PBVirtualTextViewRef view);
Syntax (Python)
VirtualTextViewGetLineHeight(view) -> (lineHeight)
Parameters and Return Values
[in] view (referenced PBVirtualTextView): (not documented yet)
[out] lineHeight (int64_t
): (not documented yet)
PBVirtualTextViewSetLongestLine
Function: (not documented yet)
Syntax (C/C++)
void PBVirtualTextViewSetLongestLine(PBVirtualTextViewRef view,
int32_t longestLineSizePx);
Syntax (Python)
VirtualTextViewSetLongestLine(view, longestLineSizePx)
Parameters and Return Values
[in] view (referenced PBVirtualTextView): (not documented yet)
[in] longestLineSizePx (int32_t
): (not documented yet)
PBVirtualTextViewSetAccessory
Function: (not documented yet)
Syntax (C/C++)
void PBVirtualTextViewSetAccessory(PBVirtualTextViewRef view,
PBElementRef childElement, PBVirtualTextViewAccessory accessory);
Syntax (Python)
VirtualTextViewSetAccessory(view, childElement, accessory)
Parameters and Return Values
[in] view (referenced PBVirtualTextView): (not documented yet)
[in] childElement (referenced PBElement): (not documented yet)
[in] accessory (PBVirtualTextViewAccessory): (not documented yet)
PBVirtualTextViewSetRegions
Function: (not documented yet)
Syntax (C/C++)
void PBVirtualTextViewSetRegions(PBVirtualTextViewRef view,
const PBVirtualTextViewRegion *_Nullable regions, size_t regionsCount);
Syntax (Python)
VirtualTextViewSetRegions(view, regions)
Parameters and Return Values
[in] view (referenced PBVirtualTextView): (not documented yet)
[in] regions (referenced array of PBVirtualTextViewRegion): (not documented yet)
PBVirtualTextViewGetSelection
Function: (not documented yet)
Syntax (C/C++)
uint8_t PBVirtualTextViewGetSelection(PBVirtualTextViewRef view,
/* output */ uint64_t * _Nullable __restrict anchorLine,
/* output */ uint32_t * _Nullable __restrict anchorByte,
/* output */ uint64_t * _Nullable __restrict caretLine,
/* output */ uint32_t * _Nullable __restrict caretByte);
Syntax (Python)
VirtualTextViewGetSelection(view) -> (regionIndex, anchorLine, anchorByte, caretLine, caretByte)
Parameters and Return Values
[in] view (referenced PBVirtualTextView): (not documented yet)
[out] regionIndex (uint8_t
): (not documented yet)
[optional-out] anchorLine (uint64_t
): (not documented yet)
[optional-out] anchorByte (uint32_t
): (not documented yet)
[optional-out] caretLine (uint64_t
): (not documented yet)
[optional-out] caretByte (uint32_t
): (not documented yet)
PBVirtualTextViewSetSelection
Function: (not documented yet)
Syntax (C/C++)
void PBVirtualTextViewSetSelection(PBVirtualTextViewRef view,
uint8_t regionIndex, uint64_t anchorLine, uint32_t anchorByte,
uint64_t caretLine, uint32_t caretByte, bool sendSelectionChangedMessage,
PBEnsureVisibleMode ensureCaretVisible);
Syntax (Python)
VirtualTextViewSetSelection(view, regionIndex, anchorLine, anchorByte, caretLine, caretByte, sendSelectionChangedMessage, ensureCaretVisible)
Parameters and Return Values
[in] view (referenced PBVirtualTextView): (not documented yet)
[in] regionIndex (uint8_t
): (not documented yet)
[in] anchorLine (uint64_t
): (not documented yet)
[in] anchorByte (uint32_t
): (not documented yet)
[in] caretLine (uint64_t
): (not documented yet)
[in] caretByte (uint32_t
): (not documented yet)
[in] sendSelectionChangedMessage (bool
): (not documented yet)
[in] ensureCaretVisible (PBEnsureVisibleMode): (not documented yet)
PBVirtualTextViewHitTest
Function: (not documented yet)
Syntax (C/C++)
int64_t PBVirtualTextViewHitTest(PBVirtualTextViewRef view, int32_t x, int32_t y,
/* output */ uint8_t * _Nullable __restrict region);
Syntax (Python)
VirtualTextViewHitTest(view, x, y) -> (line, region)
Parameters and Return Values
[in] view (referenced PBVirtualTextView): (not documented yet)
[in] x (int32_t
): (not documented yet)
[in] y (int32_t
): (not documented yet)
[out] line (int64_t
): (not documented yet)
[optional-out] region (uint8_t
): (not documented yet)
PBTextSelectionAdjustment
Enumeration/bitset of type uint32_t: Modes for adjusting a selection.
Constants
PBTextSelectionAdjustment_WORD_GRANULARITY
PBTextSelectionAdjustment_WORD_GRANULARITY = 1<<0
Move by words at a time instead of characters.
PBTextSelectionAdjustment_LINE_GRANULARITY
PBTextSelectionAdjustment_LINE_GRANULARITY = 1<<1
Move by lines at a time instead of characters.
PBTextSelectionAdjustment_ALL_GRANULARITY
PBTextSelectionAdjustment_ALL_GRANULARITY = 1<<2
Move to the very start and end of the document.
PBTextSelectionAdjustment_BACKWARDS
PBTextSelectionAdjustment_BACKWARDS = 1<<3
If set, move backwards. If clear, move forwards.
PBTextSelectionAdjustment_MAKE_SELECTION
PBTextSelectionAdjustment_MAKE_SELECTION = 1<<4
If set, the caret is moved and the anchor stays fixed. If not set, the anchor is afterwards moved to the same position as the caret.
PBTextSelectionAdjustment_IN_LINE_GRANULARITY
PBTextSelectionAdjustment_IN_LINE_GRANULARITY = 1<<5
Move to the start of end of the line.
PBTextSelectionAdjustment_LINE_ENDS_GRANULARITY
PBTextSelectionAdjustment_LINE_ENDS_GRANULARITY = 1<<7
Move between the far ends of each line.
PBVirtualTextViewAdjustSelection
Function: Adjust the selection in a virtual text view.
Syntax (C/C++)
void PBVirtualTextViewAdjustSelection(PBVirtualTextViewRef view,
PBTextSelectionAdjustment mode, bool sendSelectionChangedMessage,
PBEnsureVisibleMode ensureCaretVisible);
Syntax (Python)
VirtualTextViewAdjustSelection(view, mode, sendSelectionChangedMessage, ensureCaretVisible)
Parameters and Return Values
[in] view (referenced PBVirtualTextView): (not documented yet)
[in] mode (PBTextSelectionAdjustment): (not documented yet)
[in] sendSelectionChangedMessage (bool
): (not documented yet)
[in] ensureCaretVisible (PBEnsureVisibleMode): (not documented yet)
Discussion
The caret and anchor are moved as specified by the mode flags.