char * zvt_term_get_buffer
(ZvtTerm * term, int * len, int type, int sx, int sy, int ex, int ey);Valid ZvtTerm widget.
Placeholder to store the length of text selected. May be NULL in which case the value is not returned.
Type of selection. VT_SELTYPE_LINE, select by line, VT_SELTYPE_WORD, select by word, or VT_SELTYPE_CHAR, select by character.
Start of selection, horizontal.
Start of selection, vertical. 0 is the top of the visible screen, <0 is scrollback lines, >0 is visible lines (upto the height of the window).
End of selection, horizontal.
End of selection, vertical, as above.
Convert the buffer memory into a contiguous array which may be saved or processed. Note that this is not gauranteed to match the order of characters processed by the terminal, only the order in which they were displayed. Tabs will normally be preserved in the output.
All inputs are range-checked first, so it is possible to fudge a full buffer grab.
Example 1.
data = zvt_term_get_buffer(term, NULL, VT_SELTYPE_LINE, -term->vx->vt.scrollbackmax, 0, term->vx->vt.height, 0); or, as a rule - data = zvt_term_get_buffer(term, NULL, VT_SELTYPE_LINE, -10000, 0, 10000, 0);
Will return the contents of the entire scrollback and on-screen buffers, remembering that all inputs are range-checked first.
data = zvt_term_get_buffer(term, NULL, VT_SELTYPE_CHAR, 0, 0, 5, 10);
Will return the first 5 lines of the visible screen, and the 6th line upto column 10.