Index

C/C++ Functions

txTextPasteViaBuffer

DT_SLONG txTextPasteViaBuffer(DT_TXDOC text_doc, DT_ID_UBYTE paste_command, DT_SLONG nr_of_chars, const DT_UBYTE* buffer, DT_ID_SWORD buffer_format, DT_SWORD unicode_flags, const DT_STREAM_DESC* fontmap_sd)

Short Description: Paste text into current text selection - via buffer

This function pastes text (i.e. a sequence of Unicode characters) into the active selection of the text document specified by text_doc, replacing any currently selected text.

Parameters

ParameterDescription

text_doc

Handle of the associated text document instance.

paste_command

See txTextPasteViaStream

nr_of_chars

The length of the text, i.e. the number of characters (not bytes) in the memory buffer. If 0, no new characters will be inserted into the active selection of the text document, however any currently selected text will be erased.

buffer

A pointer to a memory buffer that holds the text to be pasted. If DV_NULL, no new characters will be inserted into the active selection of the text document, however any currently selected text will be erased.

buffer_format

Format of the text in the memory buffer. Can be one of the following:

TX_BUFFER_FORMAT_1  1   /* 1 byte per character — for ANSI */ 
TX_BUFFER_FORMAT_2  2   /* 2 bytes per character — for UCS2 */ 
TX_BUFFER_FORMAT_3  3   /* 3 bytes per character */ 
TX_BUFFER_FORMAT_4  4   /* 4 bytes per character — for UCS4 */ 

These values have the following meaning:

  • TX_BUFFER_FORMAT_1 indicates that the size of each character in the buffer is 1 byte. All characters have codepoints in the 0 - 255 range.

  • TX_BUFFER_FORMAT_2 indicates that the size of each character in the buffer is 2 bytes (little endian byte ordering). All characters have codepoints in the 0 - 65,535 range.

  • TX_BUFFER_FORMAT_3 indicates that the size of each character in the buffer is 3 bytes (little endian byte ordering). All characters have codepoints in the 0 - 16,777,215 range.

  • TX_BUFFER_FORMAT_4 indicates that the size of each character in the buffer is 4 bytes (little endian byte ordering). All characters have codepoints in the 0 - 4,294,967,295 range.

unicode_flags

See txTextPasteViaStream

fontmap_sd

See txTextPasteViaStream

Return Value

If the function was successful, the return value will be the number of pasted characters. Otherwise, the function returns -1. The function will also return -1 if there are multiple (non-contiguous) or block (rectangular) active selections in the text document.

Comments

See txTextPasteViaStream

 

Index