2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these libraries and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
24 * (c) Copyright 1993, 1994, 1996 Hewlett-Packard Company *
25 * (c) Copyright 1993, 1994, 1996 International Business Machines Corp. *
26 * (c) Copyright 1993, 1994, 1996 Sun Microsystems, Inc. *
27 * (c) Copyright 1993, 1994, 1996 Novell, Inc. *
28 * (c) Copyright 1996 Digital Equipment Corporation. *
29 * (c) Copyright 1996 FUJITSU LIMITED. *
30 * (c) Copyright 1996 Hitachi. *
33 #define USE_MEMCPY /* use memcpy for line movement... */
37 #include "TermHeader.h" /* for MIN/MAX */
38 #include "TermBufferP.h"
39 #include "TermEnhance.h"
42 ** clear "count" enhancements starting at startCol
71 _DtTermClearEnhancements
95 enhValue **enhancements,
97 const countSpec countWhich
101 _DtTermGetCharacterPointer
109 _DtTermInsertEnhancements
115 const Boolean insertFlag
119 _DtTermBufferCreateEnhancement
135 _DtTermDeleteEnhancement
151 Boolean insertFlag, /* if TRUE, insert, else overwrite */
152 termChar **returnChars, /* pointer to overflow buffer */
153 short *returnCount /* count of characters in overflow buffer */
179 #if (defined(TEST) || defined(__CODECENTER__) || defined(VALIDATE_ENH))
186 # define VALIDATE_ENHANCEMENTS(tb, row) validateEnhancements((tb), (row))
188 # define VALIDATE_ENHANCEMENTS(tb, row)
189 #endif /* TEST || __CODECENTER__ || VALIDATE_ENH */
192 ** A blank enhancement structure, it will come in handy.
194 static DtTermEnhPart blankEnh = {0, 0, 0, 0, 0};
197 ** Create and initialize the Dt-specific parts of the term buffer.
200 _DtTermBufferCreateBuffer
205 const short sizeOfBuffer,
206 const short sizeOfLine,
207 const short sizeOfEnh
214 newTB = _DtTermPrimBufferCreateBuffer(w, rows, cols,
215 sizeOfBuffer, sizeOfLine, sizeOfEnh);
220 VALUE_LIST(newTB) = (enhValues) malloc(NUM_ENHANCEMENT_FIELDS *
223 if (!VALUE_LIST(newTB))
225 _DtTermPrimBufferFreeBuffer(newTB);
226 return((TermBuffer) NULL);
229 NUM_ENH_FIELDS(newTB) = NUM_ENHANCEMENT_FIELDS;
230 for (lines = DT_LINES(newTB);
231 lines < DT_LINES(newTB) + ROWS(newTB);
234 DT_ENH(*lines) = (DtEnh) NULL;
236 DT_ENH_STATE(newTB) = blankEnh;
237 DT_ENH_DIRTY(newTB) = 0;
238 ENH_PROC(newTB) = _DtTermEnhProc;
239 BUFFER_CREATE(newTB) = _DtTermBufferCreateBuffer;
240 BUFFER_FREE(newTB) = _DtTermBufferFreeBuffer;
241 BUFFER_RESIZE(newTB) = _DtTermBufferResize;
242 CLEAR_ENH(newTB) = _DtTermClearEnhancements;
243 INSERT_ENH(newTB) = _DtTermInsertEnhancements;
244 DELETE_ENH(newTB) = _DtTermDeleteEnhancement;
245 SET_ENH(newTB) = _DtTermSetEnhancement;
246 GET_ENH(newTB) = _DtTermGetEnhancement;
247 SET_LINE_LENGTH(newTB) = _DtTermSetLineLength;
248 CLEAR_LINE(newTB) = _DtTermClearLine;
254 ** Resize buffer, this is a helper function, if malloc fails, then the
255 ** appropriate dimensions are forced to the current maximums
270 ** make any necessary width adjustments first...
273 ** We do not take any action if the new column width is less
274 ** than the current column width. It is the responsibility of
275 ** the rendering code to make sure that two column characters
276 ** are handled properly if the second column falls past the last
277 ** column in the window.
279 if (*newCols > MAX_COLS(tb))
281 termChar *newLineBuffer;
284 ** now extend the line buffers and enhancements for all lines,
285 ** (even lines that are not being used at the moment
286 ** (ROWS < MAX_ROWS))...
288 lines = DT_LINES(tb);
289 for (i = 0; i < MAX_ROWS(tb); i++)
292 ** only copy the enhancement information when it exists
294 if (DT_ENH(lines[i]))
296 enh = (DtEnh) malloc(*newCols * sizeof(DtTermEnhPart));
301 ** copy the enhancment info for all characters on
302 ** the line, zero out the rest
304 (void) memcpy(enh, DT_ENH(lines[i]),
305 WIDTH(lines[i]) * sizeof(DtTermEnhPart));
306 (void) memset(&enh[WIDTH(lines[i])], 0,
307 (*newCols - WIDTH(lines[i])) *
308 sizeof(DtTermEnhPart));
309 free(DT_ENH(lines[i]));
310 DT_ENH(lines[i]) = enh;
315 ** the malloc failed, revert back to MAX_COLS
317 *newCols = MAX_COLS(tb);
318 *newRows = MIN(*newRows, MAX_ROWS(tb));
322 newLineBuffer = (termChar *) malloc((unsigned)
323 *newCols * BYTES_PER_CHAR(tb));
325 if (newLineBuffer == NULL)
328 ** line buffer malloc failed, we can only increase the
329 ** width to the current maximum...
331 *newCols = MAX_COLS(tb);
332 *newRows = MIN(*newRows, MAX_ROWS(tb));
335 memcpy(newLineBuffer, BUFFER(lines[i]), LENGTH(lines[i]) *
337 free(BUFFER(lines[i]));
338 BUFFER(lines[i]) = newLineBuffer;
339 WRAPPED(lines[i]) = False;
341 MAX_COLS(tb) = *newCols;
346 ** now adjust the length of the buffer as necessary...
348 if (*newRows > MAX_ROWS(tb))
351 ** the number of rows is increasing
353 lines = (DtLine *) malloc((unsigned) *newRows * sizeof(DtLine));
357 ** the malloc succeeded, copy the old information, and then
360 memcpy(lines, DT_LINES(tb), sizeof(DtLine) * MAX_ROWS(tb));
362 LINES(tb) = (TermLine *)lines;
365 ** now initialize the new lines...
368 ** If we are unable to malloc any part of a line, adjust
369 ** "newRows" and break.
371 for (i = MAX_ROWS(tb); i < *newRows; i++)
373 lines[i] = (DtLine) malloc(SIZE_OF_LINE(tb));
376 DT_ENH(lines[i]) = NULL;
377 BUFFER(lines[i]) = (termChar *) malloc((unsigned) COLS(tb) *
379 if (BUFFER(lines[i]))
381 LENGTH(lines[i]) = 0;
383 WRAPPED(lines[i]) = False;
388 ** the line buffer malloc failed...
397 ** we couldn't malloc this line...
403 MAX_ROWS(tb) = *newRows;
408 ** the malloc for the row buffer failed, revert back to MAX_ROWS
410 *newRows = MAX_ROWS(tb);
419 ** NOTE: This is a helper function, and should only be called by
420 ** TermPrimBufferFreeBuffer.
423 _DtTermBufferFreeBuffer
431 ** Free the Dt-specific buffer info...
433 for (lines = DT_LINES(tb); lines < DT_LINES(tb) + ROWS(tb); lines++)
437 (void) free(DT_ENH(*lines));
442 (void) free(VALUE_LIST(tb));
447 ** clear all the enhancements from startCol through stopCol
462 enh = DT_ENH(DT_LINE_OF_TBUF(tb, row));
467 for(i = 0; i < count; i++)
470 ** Clear all of the enhancement information.
479 ** Clear "count" enhancement blocks, starting at the specified row and column.
482 _DtTermClearEnhancements
490 clearEnhancements(tb, row, col, count);
494 ** Insert the desired number of enhancements at the specified
498 ** We depend on the calling function to insure that insertCount
499 ** has been properly clipped to insure that we don't go out of
501 ** Results are undefined if this function is called when the specified
502 ** column is at the end of the line.
505 _DtTermInsertEnhancements
511 const Boolean insertFlag
515 DtTermEnhPart fillEnh;
521 line = DT_LINE_OF_TBUF(tb, row);
525 ** There's nothing to do if we're past the end of the line or
526 ** the dirty bit is clear and there are no ehancements on
529 if ((col < WIDTH(line)) && ((DT_ENH_DIRTY(tb)) || (enh != NULL)))
534 ** there are currently no enhancements on this line,
535 ** allocate an enhancement buffer, and reset 'enh'...
537 _DtTermBufferCreateEnhancement(tb, row, col);
542 ** get a copy of the current enhancement (we'll insert 'copyCount'
543 ** copies of it into the enhancement buffer)
545 fillEnh = DT_ENH_STATE(tb);
550 ** we're in insert mode, move any existing enhancements...
552 copyCount = MIN((WIDTH(line) - col),
553 (COLS(tb) - col - insertCount));
554 copyCount = MAX(0, copyCount);
555 memmove(enh + col + insertCount, enh + col,
556 copyCount * sizeof(DtTermEnhPart));
561 ** insert insertCount copies of fillEnh into the enhancement buffer
562 ** starting at line->enh[col + 1]...
565 for (i = 0; i < insertCount; i++)
572 ** insert insertCount copies of fillEnh into the enhancement buffer
573 ** starting at line->enh[col + 1]...
576 for (i = 0; i < insertCount; i++)
592 short *count /* number of columns to delete */
595 _DtTermPrimBufferDelete(tb, row, col, count, NULL, NULL);
599 ** delete the desired enhancements starting the specified position...
602 _DtTermDeleteEnhancement
611 DtTermEnhPart fillEnh;
615 line = DT_LINE_OF_TBUF(tb, row);
618 if ((enh == NULL) || (WIDTH(line) <= col))
621 ** no enhancements, or at (or past) the end of the line, return
627 ** get a copy of the current enhancement
632 ** move all of the enhancement blocks between col + width and and the
633 ** end of the line to col
635 copyCount = WIDTH(line) - (col + width);
636 memmove(enh + col , enh + col + width,
637 copyCount * sizeof(DtTermEnhPart));
643 ** Create an enhancement block at the specified row and column.
645 ** NOTE: For the time being, we simply allocate an entire row's worth
646 ** of enhancement blocks if it doesn't exist already. We may
647 ** get smarter later on.
651 _DtTermBufferCreateEnhancement
661 if (!VALID_ROW(tb, row) || !VALID_COL(tb, col))
666 line = DT_LINE_OF_TBUF(tb, row);
667 enh = &(DT_ENH(line));
670 ** If this row already has enhancement blocks allocated, return.
675 ** Otherwise, allocate and initialize a row of enhancement blocks.
677 *enh = (DtEnh) malloc(MAX_COLS(tb) * sizeof(DtTermEnhPart));
684 ** Clear all the enhancements...
686 (void) memset(*enh, 0, MAX_COLS(tb) * sizeof(DtTermEnhPart));
692 ** Free the enhancement block at the specified row and column.
694 ** NOTE: We may get smarter later on.
697 _DtTermBufferFreeEnhancement
708 ** Set the desired enhancement.
710 ** This function does the right thing (as far as I can tell regarding
711 ** propagating enhancements).
714 ** -1 : the enhancement was not set
715 ** >= 0 : the number of characters (as opposed to character positions)
716 ** that the enhancement affects
719 _DtTermSetEnhancement
731 enhState = (DtEnh) &(DT_ENH_STATE(tb));
739 enhState->video = (value &= VIDEO_MASK);
742 enhState->field = (value &= FIELD_MASK);
745 enhState->fgColor = (value &= COLOR_MASK);
748 enhState->bgColor = (value &= COLOR_MASK);
751 enhState->font = (value &= FONT_MASK);
758 ** We've set the value, now decide if this anything but the blank
761 DT_ENH_DIRTY(tb) = ((enhState->video != blankEnh.video ) ||
762 (enhState->field != blankEnh.field ) ||
763 (enhState->fgColor != blankEnh.fgColor) ||
764 (enhState->bgColor != blankEnh.bgColor) ||
765 (enhState->font != blankEnh.font ));
767 ** return the correct count (which in this case will always be 0)
773 ** Get the enhancements for the desired row and column.
776 ** a pointer to an array of the current enhancement values
779 ** the number of columns for which the enhancements are
780 ** valid, or the number of columns until the enhancements
781 ** were modified by an escape sequence (see 'countWhich' below)
784 ** if 'countWhich' is countAll then count until any enhancement value
786 ** if 'countAll' is countNew then count until a new enhancement value
787 ** starts (regardless of whether it is the same or not).
790 ** True if row and col are valid
793 _DtTermGetEnhancement
800 const countSpec countWhich
804 ** store the current enhancement values here
811 ** First we do some simple bounds checking
813 VALIDATE_ENHANCEMENTS(tb, row);
814 if (!VALID_ROW(tb, row) || !VALID_COL(tb, col))
818 line = DT_LINE_OF_TBUF(tb, row);
821 ** point to the correct enhancement chunk.
823 if (DT_ENH(line) == NULL || (WIDTH(line) <= col))
826 ** There are either no enhancements allocated for this line,
827 ** or we're past the end of the line, in either case return
828 ** a blank enhancement.
835 ** We're in the line get the current enhancement values
837 enh = &(DT_ENH(line)[col]);
841 ** Shove the enhancement values into their correct locations...
843 *values = (VALUE_LIST(tb));
844 (*values)[(int)enhVideo ] = (enh->video & VIDEO_MASK);
845 (*values)[(int)enhField ] = (enh->field & FIELD_MASK);
846 (*values)[(int)enhFgColor] = (enh->fgColor & COLOR_MASK);
847 (*values)[(int)enhBgColor] = (enh->bgColor & COLOR_MASK);
848 (*values)[(int)enhFont ] = (enh->font & FONT_MASK );
851 ** Now count how many characters are affected by the enhancements.
853 if (DT_ENH(line) == NULL)
856 ** There no enhancements allocated for this line, the default
857 ** enhancement is active for the remainder of the line.
858 ** NOTE: Make sure count >= 0.
860 *count = MAX(0, WIDTH(line) - col);
862 else if (WIDTH(line) <= col)
865 ** We're past the end of the line, count will always == 0;
872 ** We're in the line, determine the number of characters that
873 ** these enhancements apply to.
879 ** For Vt220 emulation, countNew is the same as countAll...
884 ** count until an enhancement value changes
886 for (i = 0; i < (WIDTH(line) - col); i++)
888 if (((*values)[(int)enhVideo ] != (enh->video & VIDEO_MASK))||
889 ((*values)[(int)enhField ] != (enh->field & FIELD_MASK))||
890 ((*values)[(int)enhFgColor] != (enh->fgColor & COLOR_MASK))||
891 ((*values)[(int)enhBgColor] != (enh->bgColor & COLOR_MASK))||
892 ((*values)[(int)enhFont ] != (enh->font & FONT_MASK )) )
895 ** the enhancements differ; break out
903 VALIDATE_ENHANCEMENTS(tb, row);
908 VALIDATE_ENHANCEMENTS(tb, row);
913 ** This is a vt-specific helper function for setting the line length.
914 ** By the time the function is called, termBufferSetLineLength()
915 ** as already validated the newLength, the row, and insured that the
916 ** new length is > the current length
918 ** This function propagates the correct enhancement to the new end of line.
932 ** _DtTermPrimBufferClearLine will reset the line width, this is
933 ** our chance to clear any enhancements that may exist on this line...
946 line = DT_LINE_OF_TBUF(tb, row);
952 ** We have enhancements, clear all those between the current
953 ** and the new length...
956 (void) memset(&enh[newWidth], 0,
957 (WIDTH(line) - newWidth) * sizeof(DtTermEnhPart));
963 ** Erase characters on the specified row (and clear the enhancements) with
964 ** the appropriate semantics. For VT class emulators, there are several
965 ** ways to erase characters:
966 ** - from the active position to the end of line
967 ** - erase the specified number of characters starting at the current
969 ** - from the start of the line to the active position
970 ** - erase the entire line
971 ** - from the active position to the end of the buffer
972 ** - erase the specified number of lines starting at the current
974 ** - from the start of the buffer to the active position
975 ** - erase the entire buffer
984 DtEraseMode eraseSwitch
994 ** erase from col 0 to the current cursor position
997 lastCol = MIN(col, WIDTH(DT_LINE_OF_TBUF(tb, row)) - 1);
1000 case eraseCharCount:
1002 ** erase "count" characters from the current cursor position
1005 lastCol = MIN(col + count - 1, WIDTH(DT_LINE_OF_TBUF(tb, row)) - 1);
1008 case eraseLineCount:
1012 case eraseFromRow0Col0:
1015 ** These cases should have been handled by _DtTermFuncErase()
1020 _DtTermPrimBufferErase(tb, row, startCol, lastCol);
1022 ** now clear the corresponding enhancements...
1024 clearEnhancements(tb, row, startCol, lastCol - startCol + 1);
1027 #if (defined(TEST) || defined(__CODECENTER__) || defined(VALIDATE_ENH))
1029 _DtTermValidateEnhancements
1035 DtTermEnhPart refEnh;
1039 Boolean validatePassed;
1041 validatePassed = True;
1043 thisLine = DT_LINE_OF_TBUF(tb, row);
1044 if (DT_ENH(thisLine))
1047 ** Initialize the reference enhancement
1050 refEnh.videoStart = 0;
1051 refEnh.fieldStart = 0;
1052 refEnh.colorStart = 0;
1053 refEnh.fontStart = 0;
1055 for(col = 0, thisEnh = DT_ENH(thisLine);
1056 col < WIDTH(thisLine) +
1057 (DANGLE(thisLine) >= 0 ? 1 : 0);
1060 if (thisEnh->videoStart)
1062 refEnh.video = thisEnh->video;
1064 else if (refEnh.video != thisEnh->video)
1066 fprintf(stderr, "Video enhancements don't match:");
1067 fprintf(stderr, " row : %3.3d, col : %3.3d\n", row, col);
1068 fprintf(stderr, " refEnh.video : %d\n", (int)(refEnh.video & VIDEO_MASK));
1069 fprintf(stderr, " thisEnh->video: %d\n", (int)(thisEnh->video & VIDEO_MASK));
1070 validatePassed = False;
1073 if (thisEnh->fieldStart)
1075 refEnh.field = thisEnh->field;
1077 else if (refEnh.field != thisEnh->field)
1079 fprintf(stderr, "Field enhancements don't match:");
1080 fprintf(stderr, " row : %3.3d, col : %3.3d\n", row, col);
1081 fprintf(stderr, " refEnh.field : %d\n", (int)(refEnh.field & FIELD_MASK));
1082 fprintf(stderr, " thisEnh->field: %d\n", (int)(thisEnh->field & FIELD_MASK));
1083 validatePassed = False;
1085 if (thisEnh->colorStart)
1087 refEnh.color = thisEnh->color;
1089 else if (refEnh.color != thisEnh->color)
1091 fprintf(stderr, "Color enhancements don't match:");
1092 fprintf(stderr, " row : %3.3d, col : %3.3d\n", row, col);
1093 fprintf(stderr, " refEnh.color : %d\n", (int)(refEnh.color & COLOR_MASK));
1094 fprintf(stderr, " thisEnh->color: %d\n", (int)(thisEnh->color & COLOR_MASK));
1095 validatePassed = False;
1097 if (thisEnh->font <= 2)
1099 if (thisEnh->fontStart)
1101 refEnh.font = thisEnh->font;
1103 else if (refEnh.font != thisEnh->font)
1105 fprintf(stderr, "Font enhancements don't match:");
1106 fprintf(stderr, " row : %3.3d, col : %3.3d\n", row, col);
1107 fprintf(stderr, " refEnh.font : %d\n", (int)(refEnh.font & FONT_MASK));
1108 fprintf(stderr, " thisEnh->font: %d\n", (int)(thisEnh->font & FONT_MASK));
1109 validatePassed = False;
1114 fprintf(stderr, "Font enhancement out of range:");
1115 fprintf(stderr, " row : %3.3d, col : %3.3d\n", row, col);
1116 fprintf(stderr, " thisEnh->font: %d\n", (int)(thisEnh->font & FONT_MASK));
1117 validatePassed = False;
1121 if (validatePassed == False)
1123 fprintf(stderr, "validateEnhancement failed\n");
1126 #endif /* TEST || __CODECENTER__ || DEBUG || VALIDATE_ENH */
1128 #if (defined(TEST) || defined(__CODECENTER__) || defined(DEBUG))
1141 printf("Line: %d\n", row);
1143 line = tb->lines[row];
1144 printf(" length: %3d\n", line->length);
1145 if (line->length > 0)
1147 printf(" buffer: <");
1148 pChar = line->buffer;
1149 for (j = 0; j < line->length; j++)
1151 printf("%X", *pChar++);
1158 _DtTermPrintEnhancement
1165 enhValue enhancements[NUM_ENHANCEMENT_FIELDS];
1169 _DtTermPrimBufferGetEnhancement(tb, row, col, enhancements, &enhCount, countNew);
1170 printf(" col : %d\n", col);
1171 printf(" Count: %d\n", enhCount);
1172 printf(" Video: '_");
1173 printf("%s", IS_BOLD(enhancements[enhVideo]) != 0 ? "B":"b");
1175 printf("%s", IS_SECURE(enhancements[enhVideo]) != 0 ? "S":"s");
1177 printf("%s", IS_HALF_BRIGHT(enhancements[enhVideo]) != 0 ? "H":"h");
1179 printf("%s", IS_UNDERLINE(enhancements[enhVideo]) != 0 ? "U":"u");
1181 printf("%s", IS_INVERSE(enhancements[enhVideo]) != 0 ? "I":"i");
1183 printf("%s", IS_BLINK(enhancements[enhVideo]) != 0 ? "B":"b");
1190 switch (enhancements[enhField])
1195 case FIELD_UNPROTECT:
1196 printf("UNPROTECT");
1198 case FIELD_TRANSMIT:
1210 printf(" Color: %1d\n", enhancements[enhFont]);
1216 switch (enhancements[enhFont])
1236 printf(" video : %d\n", enh->video);
1237 printf(" field : %d\n", enh->field);
1238 printf(" fgColor: %d\n", enh->fgColor);
1239 printf(" bgColor: %d\n", enh->bgColor);
1240 printf(" font : %d\n", enh->font);
1244 ** Print the contents of the TermBuffer.
1257 printf("TermBuffer has been freed.\n");
1261 printf("TermBuffer dimensions:\n");
1262 printf(" rows: %d\n", ROWS(tb));
1263 printf(" cols: %d\n", COLS(tb));
1264 printf(" enhDirty: %d\n", DT_ENH_DIRTY(tb));
1265 printf(" enhState:\n");
1266 printEnh(&(DT_ENH_STATE(tb)));
1268 for (i = 0; i < ROWS(tb); i++)
1274 k = _termBufferPrintEnhancement(tb, i, j);
1280 } while (j < COLS(tb));
1284 #endif /* (defined(TEST) || defined(__CODECENTER__)) */
1288 ** Some simple tests of the termBuffer.
1290 /* the following is to allow for a single main function in the code... */
1291 #define termBufMain main
1296 printf("Sizeof DtTermEnhPart : %d\n", sizeof(struct _DtTermEnhPart));
1297 printf("Sizeof termBufferRec : %d\n", sizeof(struct _TermBufferRec));
1299 myTB = _DtTermPrimBufferCreateBuffer(12, 80);
1300 _termBufferPrintBuffer(myTB);
1302 printf("[0,0] %d\n", _DtTermPrimBufferSetEnhancement(myTB, 0, 0, enhVideo, BLINK));
1303 _termBufferPrintEnhancement(myTB, 0, 0);
1304 printf("[0,1] %d\n", _DtTermPrimBufferSetEnhancement(myTB, 0, 1, enhVideo, INVERSE));
1305 _termBufferPrintEnhancement(myTB, 0, 0);
1306 _termBufferPrintEnhancement(myTB, 0, 1);
1307 printf("[0,9] %d\n", _DtTermPrimBufferSetEnhancement(myTB, 0, 9, enhVideo, UNDERLINE));
1308 _termBufferPrintEnhancement(myTB, 0, 0);
1309 _termBufferPrintEnhancement(myTB, 0, 1);
1310 _termBufferPrintEnhancement(myTB, 0, 9);
1311 printf("[0,6] %d\n", _DtTermPrimBufferSetEnhancement(myTB, 0, 6, enhVideo, HALF_BRIGHT));
1312 _termBufferPrintEnhancement(myTB, 0, 0);
1313 _termBufferPrintEnhancement(myTB, 0, 1);
1314 _termBufferPrintEnhancement(myTB, 0, 6);
1315 _termBufferPrintEnhancement(myTB, 0, 9);
1316 _termBufferPrintBuffer(myTB);
1318 _DtTermPrimBufferSetEnhancement(myTB, 10, 10, enhVideo, BLINK);
1319 _DtTermPrimBufferSetEnhancement(myTB, 10, 20, enhColor, 3);
1320 _termBufferPrintBuffer(myTB);
1322 _DtTermPrimBufferResizeBuffer(&myTB, 6, 40);
1323 _termBufferPrintBuffer(myTB);
1325 _DtTermPrimBufferSetEnhancement(myTB, 10, 10, enhVideo, BLINK);
1326 _DtTermPrimBufferResizeBuffer(&myTB, 12, 80);
1327 _termBufferPrintBuffer(myTB);
1329 _DtTermPrimBufferFreeBuffer(myTB);