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 librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
24 #ifdef VERBOSE_REV_INFO
25 static char rcs_id[] = "$TOG: TermBuffer.c /main/2 1997/04/17 18:04:41 samborn $";
26 #endif /* VERBOSE_REV_INFO */
30 * (c) Copyright 1993, 1994, 1996 Hewlett-Packard Company *
31 * (c) Copyright 1993, 1994, 1996 International Business Machines Corp. *
32 * (c) Copyright 1993, 1994, 1996 Sun Microsystems, Inc. *
33 * (c) Copyright 1993, 1994, 1996 Novell, Inc. *
34 * (c) Copyright 1996 Digital Equipment Corporation. *
35 * (c) Copyright 1996 FUJITSU LIMITED. *
36 * (c) Copyright 1996 Hitachi. *
39 #define USE_MEMCPY /* use memcpy for line movement... */
42 #include "TermHeader.h" /* for MIN/MAX */
43 #include "TermBufferP.h"
44 #include "TermEnhance.h"
47 ** clear "count" enhancements starting at startCol
76 _DtTermClearEnhancements
100 enhValue **enhancements,
102 const countSpec countWhich
106 _DtTermGetCharacterPointer
114 _DtTermInsertEnhancements
120 const Boolean insertFlag
124 _DtTermBufferCreateEnhancement
140 _DtTermDeleteEnhancement
156 Boolean insertFlag, /* if TRUE, insert, else overwrite */
157 termChar **returnChars, /* pointer to overflow buffer */
158 short *returnCount /* count of characters in overflow buffer */
184 #if (defined(TEST) || defined(__CODECENTER__) || defined(VALIDATE_ENH))
191 # define VALIDATE_ENHANCEMENTS(tb, row) validateEnhancements((tb), (row))
193 # define VALIDATE_ENHANCEMENTS(tb, row)
194 #endif /* TEST || __CODECENTER__ || VALIDATE_ENH */
197 ** A blank enhancement structure, it will come in handy.
199 static DtTermEnhPart blankEnh = {0, 0, 0, 0, 0};
202 ** Create and initialize the Dt-specific parts of the term buffer.
205 _DtTermBufferCreateBuffer
210 const short sizeOfBuffer,
211 const short sizeOfLine,
212 const short sizeOfEnh
219 newTB = _DtTermPrimBufferCreateBuffer(w, rows, cols,
220 sizeOfBuffer, sizeOfLine, sizeOfEnh);
225 VALUE_LIST(newTB) = (enhValues) malloc(NUM_ENHANCEMENT_FIELDS *
228 if (!VALUE_LIST(newTB))
230 _DtTermPrimBufferFreeBuffer(newTB);
231 return((TermBuffer) NULL);
234 NUM_ENH_FIELDS(newTB) = NUM_ENHANCEMENT_FIELDS;
235 for (lines = DT_LINES(newTB);
236 lines < DT_LINES(newTB) + ROWS(newTB);
239 DT_ENH(*lines) = (DtEnh) NULL;
241 DT_ENH_STATE(newTB) = blankEnh;
242 DT_ENH_DIRTY(newTB) = 0;
243 ENH_PROC(newTB) = _DtTermEnhProc;
244 BUFFER_CREATE(newTB) = _DtTermBufferCreateBuffer;
245 BUFFER_FREE(newTB) = _DtTermBufferFreeBuffer;
246 BUFFER_RESIZE(newTB) = _DtTermBufferResize;
247 CLEAR_ENH(newTB) = _DtTermClearEnhancements;
248 INSERT_ENH(newTB) = _DtTermInsertEnhancements;
249 DELETE_ENH(newTB) = _DtTermDeleteEnhancement;
250 SET_ENH(newTB) = _DtTermSetEnhancement;
251 GET_ENH(newTB) = _DtTermGetEnhancement;
252 SET_LINE_LENGTH(newTB) = _DtTermSetLineLength;
253 CLEAR_LINE(newTB) = _DtTermClearLine;
259 ** Resize buffer, this is a helper function, if malloc fails, then the
260 ** appropriate dimensions are forced to the current maximums
275 ** make any necessary width adjustments first...
278 ** We do not take any action if the new column width is less
279 ** than the current column width. It is the responsibility of
280 ** the rendering code to make sure that two column characters
281 ** are handled properly if the second column falls past the last
282 ** column in the window.
284 if (*newCols > MAX_COLS(tb))
286 termChar *newLineBuffer;
289 ** now extend the line buffers and enhancements for all lines,
290 ** (even lines that are not being used at the moment
291 ** (ROWS < MAX_ROWS))...
293 lines = DT_LINES(tb);
294 for (i = 0; i < MAX_ROWS(tb); i++)
297 ** only copy the enhancement information when it exists
299 if (DT_ENH(lines[i]))
301 enh = (DtEnh) malloc(*newCols * sizeof(DtTermEnhPart));
306 ** copy the enhancment info for all characters on
307 ** the line, zero out the rest
309 (void) memcpy(enh, DT_ENH(lines[i]),
310 WIDTH(lines[i]) * sizeof(DtTermEnhPart));
311 (void) memset(&enh[WIDTH(lines[i])], 0,
312 (*newCols - WIDTH(lines[i])) *
313 sizeof(DtTermEnhPart));
314 free(DT_ENH(lines[i]));
315 DT_ENH(lines[i]) = enh;
320 ** the malloc failed, revert back to MAX_COLS
322 *newCols = MAX_COLS(tb);
323 *newRows = MIN(*newRows, MAX_ROWS(tb));
327 newLineBuffer = (termChar *) malloc((unsigned)
328 *newCols * BYTES_PER_CHAR(tb));
330 if (newLineBuffer == NULL)
333 ** line buffer malloc failed, we can only increase the
334 ** width to the current maximum...
336 *newCols = MAX_COLS(tb);
337 *newRows = MIN(*newRows, MAX_ROWS(tb));
340 memcpy(newLineBuffer, BUFFER(lines[i]), LENGTH(lines[i]) *
342 free(BUFFER(lines[i]));
343 BUFFER(lines[i]) = newLineBuffer;
344 WRAPPED(lines[i]) = False;
346 MAX_COLS(tb) = *newCols;
351 ** now adjust the length of the buffer as necessary...
353 if (*newRows > MAX_ROWS(tb))
356 ** the number of rows is increasing
358 lines = (DtLine *) malloc((unsigned) *newRows * sizeof(DtLine));
362 ** the malloc succeeded, copy the old information, and then
365 memcpy(lines, DT_LINES(tb), sizeof(DtLine) * MAX_ROWS(tb));
367 LINES(tb) = (TermLine *)lines;
370 ** now initialize the new lines...
373 ** If we are unable to malloc any part of a line, adjust
374 ** "newRows" and break.
376 for (i = MAX_ROWS(tb); i < *newRows; i++)
378 lines[i] = (DtLine) malloc(SIZE_OF_LINE(tb));
381 DT_ENH(lines[i]) = NULL;
382 BUFFER(lines[i]) = (termChar *) malloc((unsigned) COLS(tb) *
384 if (BUFFER(lines[i]))
386 LENGTH(lines[i]) = 0;
388 WRAPPED(lines[i]) = False;
393 ** the line buffer malloc failed...
402 ** we couldn't malloc this line...
408 MAX_ROWS(tb) = *newRows;
413 ** the malloc for the row buffer failed, revert back to MAX_ROWS
415 *newRows = MAX_ROWS(tb);
424 ** NOTE: This is a helper function, and should only be called by
425 ** TermPrimBufferFreeBuffer.
428 _DtTermBufferFreeBuffer
436 ** Free the Dt-specific buffer info...
438 for (lines = DT_LINES(tb); lines < DT_LINES(tb) + ROWS(tb); lines++)
442 (void) free(DT_ENH(*lines));
447 (void) free(VALUE_LIST(tb));
452 ** clear all the enhancements from startCol through stopCol
467 enh = DT_ENH(DT_LINE_OF_TBUF(tb, row));
472 for(i = 0; i < count; i++)
475 ** Clear all of the enhancement information.
484 ** Clear "count" enhancement blocks, starting at the specified row and column.
487 _DtTermClearEnhancements
495 clearEnhancements(tb, row, col, count);
499 ** Insert the desired number of enhancements at the specified
503 ** We depend on the calling function to insure that insertCount
504 ** has been properly clipped to insure that we don't go out of
506 ** Results are undefined if this function is called when the specified
507 ** column is at the end of the line.
510 _DtTermInsertEnhancements
516 const Boolean insertFlag
520 DtTermEnhPart fillEnh;
526 line = DT_LINE_OF_TBUF(tb, row);
530 ** There's nothing to do if we're past the end of the line or
531 ** the dirty bit is clear and there are no ehancements on
534 if ((col < WIDTH(line)) && ((DT_ENH_DIRTY(tb)) || (enh != NULL)))
539 ** there are currently no enhancements on this line,
540 ** allocate an enhancement buffer, and reset 'enh'...
542 _DtTermBufferCreateEnhancement(tb, row, col);
547 ** get a copy of the current enhancement (we'll insert 'copyCount'
548 ** copies of it into the enhancement buffer)
550 fillEnh = DT_ENH_STATE(tb);
555 ** we're in insert mode, move any existing enhancements...
557 copyCount = MIN((WIDTH(line) - col),
558 (COLS(tb) - col - insertCount));
559 copyCount = MAX(0, copyCount);
560 memmove(enh + col + insertCount, enh + col,
561 copyCount * sizeof(DtTermEnhPart));
566 ** insert insertCount copies of fillEnh into the enhancement buffer
567 ** starting at line->enh[col + 1]...
570 for (i = 0; i < insertCount; i++)
577 ** insert insertCount copies of fillEnh into the enhancement buffer
578 ** starting at line->enh[col + 1]...
581 for (i = 0; i < insertCount; i++)
597 short *count /* number of columns to delete */
600 _DtTermPrimBufferDelete(tb, row, col, count, NULL, NULL);
604 ** delete the desired enhancements starting the specified position...
607 _DtTermDeleteEnhancement
616 DtTermEnhPart fillEnh;
620 line = DT_LINE_OF_TBUF(tb, row);
623 if ((enh == NULL) || (WIDTH(line) <= col))
626 ** no enhancements, or at (or past) the end of the line, return
632 ** get a copy of the current enhancement
637 ** move all of the enhancement blocks between col + width and and the
638 ** end of the line to col
640 copyCount = WIDTH(line) - (col + width);
641 memcpy(enh + col , enh + col + width,
642 copyCount * sizeof(DtTermEnhPart));
648 ** Create an enhancement block at the specified row and column.
650 ** NOTE: For the time being, we simply allocate an entire row's worth
651 ** of enhancement blocks if it doesn't exist already. We may
652 ** get smarter later on.
656 _DtTermBufferCreateEnhancement
666 if (!VALID_ROW(tb, row) || !VALID_COL(tb, col))
671 line = DT_LINE_OF_TBUF(tb, row);
672 enh = &(DT_ENH(line));
675 ** If this row already has enhancement blocks allocated, return.
680 ** Otherwise, allocate and initialize a row of enhancement blocks.
682 *enh = (DtEnh) malloc(MAX_COLS(tb) * sizeof(DtTermEnhPart));
689 ** Clear all the enhancements...
691 (void) memset(*enh, 0, MAX_COLS(tb) * sizeof(DtTermEnhPart));
697 ** Free the enhancement block at the specified row and column.
699 ** NOTE: We may get smarter later on.
702 _DtTermBufferFreeEnhancement
713 ** Set the desired enhancement.
715 ** This function does the right thing (as far as I can tell regarding
716 ** propagating enhancements).
719 ** -1 : the enhancement was not set
720 ** >= 0 : the number of characters (as opposed to character positions)
721 ** that the enhancement affects
724 _DtTermSetEnhancement
736 enhState = (DtEnh) &(DT_ENH_STATE(tb));
744 enhState->video = (value &= VIDEO_MASK);
747 enhState->field = (value &= FIELD_MASK);
750 enhState->fgColor = (value &= COLOR_MASK);
753 enhState->bgColor = (value &= COLOR_MASK);
756 enhState->font = (value &= FONT_MASK);
763 ** We've set the value, now decide if this anything but the blank
766 DT_ENH_DIRTY(tb) = ((enhState->video != blankEnh.video ) ||
767 (enhState->field != blankEnh.field ) ||
768 (enhState->fgColor != blankEnh.fgColor) ||
769 (enhState->bgColor != blankEnh.bgColor) ||
770 (enhState->font != blankEnh.font ));
772 ** return the correct count (which in this case will always be 0)
778 ** Get the enhancements for the desired row and column.
781 ** a pointer to an array of the current enhancement values
784 ** the number of columns for which the enhancements are
785 ** valid, or the number of columns until the enhancements
786 ** were modified by an escape sequence (see 'countWhich' below)
789 ** if 'countWhich' is countAll then count until any enhancement value
791 ** if 'countAll' is countNew then count until a new enhancement value
792 ** starts (regardless of whether it is the same or not).
795 ** True if row and col are valid
798 _DtTermGetEnhancement
805 const countSpec countWhich
809 ** store the current enhancement values here
816 ** First we do some simple bounds checking
818 VALIDATE_ENHANCEMENTS(tb, row);
819 if (!VALID_ROW(tb, row) || !VALID_COL(tb, col))
823 line = DT_LINE_OF_TBUF(tb, row);
826 ** point to the correct enhancement chunk.
828 if (DT_ENH(line) == NULL || (WIDTH(line) <= col))
831 ** There are either no enhancements allocated for this line,
832 ** or we're past the end of the line, in either case return
833 ** a blank enhancement.
840 ** We're in the line get the current enhancement values
842 enh = &(DT_ENH(line)[col]);
846 ** Shove the enhancement values into their correct locations...
848 *values = (VALUE_LIST(tb));
849 (*values)[(int)enhVideo ] = (enh->video & VIDEO_MASK);
850 (*values)[(int)enhField ] = (enh->field & FIELD_MASK);
851 (*values)[(int)enhFgColor] = (enh->fgColor & COLOR_MASK);
852 (*values)[(int)enhBgColor] = (enh->bgColor & COLOR_MASK);
853 (*values)[(int)enhFont ] = (enh->font & FONT_MASK );
856 ** Now count how many characters are affected by the enhancements.
858 if (DT_ENH(line) == NULL)
861 ** There no enhancements allocated for this line, the default
862 ** enhancement is active for the remainder of the line.
863 ** NOTE: Make sure count >= 0.
865 *count = MAX(0, WIDTH(line) - col);
867 else if (WIDTH(line) <= col)
870 ** We're past the end of the line, count will always == 0;
877 ** We're in the line, determine the number of characters that
878 ** these enhancements apply to.
884 ** For Vt220 emulation, countNew is the same as countAll...
889 ** count until an enhancement value changes
891 for (i = 0; i < (WIDTH(line) - col); i++)
893 if (((*values)[(int)enhVideo ] != (enh->video & VIDEO_MASK))||
894 ((*values)[(int)enhField ] != (enh->field & FIELD_MASK))||
895 ((*values)[(int)enhFgColor] != (enh->fgColor & COLOR_MASK))||
896 ((*values)[(int)enhBgColor] != (enh->bgColor & COLOR_MASK))||
897 ((*values)[(int)enhFont ] != (enh->font & FONT_MASK )) )
900 ** the enhancements differ; break out
908 VALIDATE_ENHANCEMENTS(tb, row);
913 VALIDATE_ENHANCEMENTS(tb, row);
918 ** This is a vt-specific helper function for setting the line length.
919 ** By the time the function is called, termBufferSetLineLength()
920 ** as already validated the newLength, the row, and insured that the
921 ** new length is > the current length
923 ** This function propagates the correct enhancement to the new end of line.
937 ** _DtTermPrimBufferClearLine will reset the line width, this is
938 ** our chance to clear any enhancements that may exist on this line...
951 line = DT_LINE_OF_TBUF(tb, row);
957 ** We have enhancements, clear all those between the current
958 ** and the new length...
961 (void) memset(&enh[newWidth], 0,
962 (WIDTH(line) - newWidth) * sizeof(DtTermEnhPart));
968 ** Erase characters on the specified row (and clear the enhancements) with
969 ** the appropriate semantics. For VT class emulators, there are several
970 ** ways to erase characters:
971 ** - from the active position to the end of line
972 ** - erase the specified number of characters starting at the current
974 ** - from the start of the line to the active position
975 ** - erase the entire line
976 ** - from the active position to the end of the buffer
977 ** - erase the specified number of lines starting at the current
979 ** - from the start of the buffer to the active position
980 ** - erase the entire buffer
989 DtEraseMode eraseSwitch
999 ** erase from col 0 to the current cursor position
1002 lastCol = MIN(col, WIDTH(DT_LINE_OF_TBUF(tb, row)) - 1);
1005 case eraseCharCount:
1007 ** erase "count" characters from the current cursor position
1010 lastCol = MIN(col + count - 1, WIDTH(DT_LINE_OF_TBUF(tb, row)) - 1);
1013 case eraseLineCount:
1017 case eraseFromRow0Col0:
1020 ** These cases should have been handled by _DtTermFuncErase()
1025 _DtTermPrimBufferErase(tb, row, startCol, lastCol);
1027 ** now clear the corresponding enhancements...
1029 clearEnhancements(tb, row, startCol, lastCol - startCol + 1);
1032 #if (defined(TEST) || defined(__CODECENTER__) || defined(VALIDATE_ENH))
1034 _DtTermValidateEnhancements
1040 DtTermEnhPart refEnh;
1044 Boolean validatePassed;
1046 validatePassed = True;
1048 thisLine = DT_LINE_OF_TBUF(tb, row);
1049 if (DT_ENH(thisLine))
1052 ** Initialize the reference enhancement
1055 refEnh.videoStart = 0;
1056 refEnh.fieldStart = 0;
1057 refEnh.colorStart = 0;
1058 refEnh.fontStart = 0;
1060 for(col = 0, thisEnh = DT_ENH(thisLine);
1061 col < WIDTH(thisLine) +
1062 (DANGLE(thisLine) >= 0 ? 1 : 0);
1065 if (thisEnh->videoStart)
1067 refEnh.video = thisEnh->video;
1069 else if (refEnh.video != thisEnh->video)
1071 fprintf(stderr, "Video enhancements don't match:");
1072 fprintf(stderr, " row : %3.3d, col : %3.3d\n", row, col);
1073 fprintf(stderr, " refEnh.video : %d\n", (int)(refEnh.video & VIDEO_MASK));
1074 fprintf(stderr, " thisEnh->video: %d\n", (int)(thisEnh->video & VIDEO_MASK));
1075 validatePassed = False;
1078 if (thisEnh->fieldStart)
1080 refEnh.field = thisEnh->field;
1082 else if (refEnh.field != thisEnh->field)
1084 fprintf(stderr, "Field enhancements don't match:");
1085 fprintf(stderr, " row : %3.3d, col : %3.3d\n", row, col);
1086 fprintf(stderr, " refEnh.field : %d\n", (int)(refEnh.field & FIELD_MASK));
1087 fprintf(stderr, " thisEnh->field: %d\n", (int)(thisEnh->field & FIELD_MASK));
1088 validatePassed = False;
1090 if (thisEnh->colorStart)
1092 refEnh.color = thisEnh->color;
1094 else if (refEnh.color != thisEnh->color)
1096 fprintf(stderr, "Color enhancements don't match:");
1097 fprintf(stderr, " row : %3.3d, col : %3.3d\n", row, col);
1098 fprintf(stderr, " refEnh.color : %d\n", (int)(refEnh.color & COLOR_MASK));
1099 fprintf(stderr, " thisEnh->color: %d\n", (int)(thisEnh->color & COLOR_MASK));
1100 validatePassed = False;
1102 if (thisEnh->font <= 2)
1104 if (thisEnh->fontStart)
1106 refEnh.font = thisEnh->font;
1108 else if (refEnh.font != thisEnh->font)
1110 fprintf(stderr, "Font enhancements don't match:");
1111 fprintf(stderr, " row : %3.3d, col : %3.3d\n", row, col);
1112 fprintf(stderr, " refEnh.font : %d\n", (int)(refEnh.font & FONT_MASK));
1113 fprintf(stderr, " thisEnh->font: %d\n", (int)(thisEnh->font & FONT_MASK));
1114 validatePassed = False;
1119 fprintf(stderr, "Font enhancement out of range:");
1120 fprintf(stderr, " row : %3.3d, col : %3.3d\n", row, col);
1121 fprintf(stderr, " thisEnh->font: %d\n", (int)(thisEnh->font & FONT_MASK));
1122 validatePassed = False;
1126 if (validatePassed == False)
1128 fprintf(stderr, "validateEnhancement failed\n");
1131 #endif /* TEST || __CODECENTER__ || DEBUG || VALIDATE_ENH */
1133 #if (defined(TEST) || defined(__CODECENTER__) || defined(DEBUG))
1146 printf("Line: %d\n", row);
1148 line = tb->lines[row];
1149 printf(" length: %3d\n", line->length);
1150 if (line->length > 0)
1152 printf(" buffer: <");
1153 pChar = line->buffer;
1154 for (j = 0; j < line->length; j++)
1156 printf("%X", *pChar++);
1163 _DtTermPrintEnhancement
1170 enhValue enhancements[NUM_ENHANCEMENT_FIELDS];
1174 _DtTermPrimBufferGetEnhancement(tb, row, col, enhancements, &enhCount, countNew);
1175 printf(" col : %d\n", col);
1176 printf(" Count: %d\n", enhCount);
1177 printf(" Video: '_");
1178 printf("%s", IS_BOLD(enhancements[enhVideo]) != 0 ? "B":"b");
1180 printf("%s", IS_SECURE(enhancements[enhVideo]) != 0 ? "S":"s");
1182 printf("%s", IS_HALF_BRIGHT(enhancements[enhVideo]) != 0 ? "H":"h");
1184 printf("%s", IS_UNDERLINE(enhancements[enhVideo]) != 0 ? "U":"u");
1186 printf("%s", IS_INVERSE(enhancements[enhVideo]) != 0 ? "I":"i");
1188 printf("%s", IS_BLINK(enhancements[enhVideo]) != 0 ? "B":"b");
1195 switch (enhancements[enhField])
1200 case FIELD_UNPROTECT:
1201 printf("UNPROTECT");
1203 case FIELD_TRANSMIT:
1215 printf(" Color: %1d\n", enhancements[enhFont]);
1221 switch (enhancements[enhFont])
1241 printf(" video : %d\n", enh->video);
1242 printf(" field : %d\n", enh->field);
1243 printf(" fgColor: %d\n", enh->fgColor);
1244 printf(" bgColor: %d\n", enh->bgColor);
1245 printf(" font : %d\n", enh->font);
1249 ** Print the contents of the TermBuffer.
1262 printf("TermBuffer has been freed.\n");
1266 printf("TermBuffer dimensions:\n");
1267 printf(" rows: %d\n", ROWS(tb));
1268 printf(" cols: %d\n", COLS(tb));
1269 printf(" enhDirty: %d\n", DT_ENH_DIRTY(tb));
1270 printf(" enhState:\n");
1271 printEnh(&(DT_ENH_STATE(tb)));
1273 for (i = 0; i < ROWS(tb); i++)
1279 k = _termBufferPrintEnhancement(tb, i, j);
1285 } while (j < COLS(tb));
1289 #endif /* (defined(TEST) || defined(__CODECENTER__)) */
1293 ** Some simple tests of the termBuffer.
1295 /* the following is to allow for a single main function in the code... */
1296 #define termBufMain main
1301 printf("Sizeof DtTermEnhPart : %d\n", sizeof(struct _DtTermEnhPart));
1302 printf("Sizeof termBufferRec : %d\n", sizeof(struct _TermBufferRec));
1304 myTB = _DtTermPrimBufferCreateBuffer(12, 80);
1305 _termBufferPrintBuffer(myTB);
1307 printf("[0,0] %d\n", _DtTermPrimBufferSetEnhancement(myTB, 0, 0, enhVideo, BLINK));
1308 _termBufferPrintEnhancement(myTB, 0, 0);
1309 printf("[0,1] %d\n", _DtTermPrimBufferSetEnhancement(myTB, 0, 1, enhVideo, INVERSE));
1310 _termBufferPrintEnhancement(myTB, 0, 0);
1311 _termBufferPrintEnhancement(myTB, 0, 1);
1312 printf("[0,9] %d\n", _DtTermPrimBufferSetEnhancement(myTB, 0, 9, enhVideo, UNDERLINE));
1313 _termBufferPrintEnhancement(myTB, 0, 0);
1314 _termBufferPrintEnhancement(myTB, 0, 1);
1315 _termBufferPrintEnhancement(myTB, 0, 9);
1316 printf("[0,6] %d\n", _DtTermPrimBufferSetEnhancement(myTB, 0, 6, enhVideo, HALF_BRIGHT));
1317 _termBufferPrintEnhancement(myTB, 0, 0);
1318 _termBufferPrintEnhancement(myTB, 0, 1);
1319 _termBufferPrintEnhancement(myTB, 0, 6);
1320 _termBufferPrintEnhancement(myTB, 0, 9);
1321 _termBufferPrintBuffer(myTB);
1323 _DtTermPrimBufferSetEnhancement(myTB, 10, 10, enhVideo, BLINK);
1324 _DtTermPrimBufferSetEnhancement(myTB, 10, 20, enhColor, 3);
1325 _termBufferPrintBuffer(myTB);
1327 _DtTermPrimBufferResizeBuffer(&myTB, 6, 40);
1328 _termBufferPrintBuffer(myTB);
1330 _DtTermPrimBufferSetEnhancement(myTB, 10, 10, enhVideo, BLINK);
1331 _DtTermPrimBufferResizeBuffer(&myTB, 12, 80);
1332 _termBufferPrintBuffer(myTB);
1334 _DtTermPrimBufferFreeBuffer(myTB);