--- os2sdk/demos/apps/ds/display.c 2018/08/09 12:25:13 1.1 +++ os2sdk/demos/apps/ds/display.c 2018/08/09 12:26:01 1.1.1.2 @@ -1,4 +1,6 @@ -/* display.c - screen display stuff for tree */ +/* display.c - screen display stuff for tree */ +/* Created by Microsoft Corp. 1986 */ + #include #include @@ -23,10 +25,10 @@ static char helpMsg[] = "Press F1 for He * * */ -unsigned int getKey () +UINT getKey () { char c; - unsigned int key; + UINT key; if (c = getch()) /* Get character */ key = c << 8; /* Make scan code zero */ @@ -41,9 +43,9 @@ unsigned int getKey () */ screenInit () { - struct ModeData TheModeData; /* Mode return data from VIOGETMODE */ + VIOMODEINFO TheModeData; /* Mode return data from VIOGETMODE */ - VIOGETMODE ((struct ModeData far *) &TheModeData, VioHandle); + VioGetMode (&TheModeData, VioHandle); N_of_Cols = TheModeData.col; N_of_Rows = TheModeData.row; WINDOW_RIGHT = N_of_Cols - 1; @@ -60,13 +62,13 @@ handleDisplay (root) Directory *root; { int topRow; - unsigned int key; + UINT key; char tmp[MAX_PATH_LEN]; char path[MAX_PATH_LEN]; int imageRow; Directory *curDir,*lastDir,*p; int rc; - char *commandPath; + NPCH commandPath; LastTopRow = LastRow-WINDOW_SIZE+1; /* Top row when last row displayed */ /* at the bottom of the window */ @@ -156,7 +158,7 @@ clearScreen () c.ch = ' '; c.at = color[blankC]; - VIOWRTNCELL(cefs(&c), N_of_Rows*N_of_Cols, 0, 0, VioHandle); + VioWrtNCell(cefs(&c), N_of_Rows*N_of_Cols, 0, 0, VioHandle); } /* clearScreen */ @@ -171,7 +173,7 @@ clearBottomLine () c.ch = ' '; c.at = color[blankC]; - VIOWRTNCELL(cefs(&c), N_of_Cols, N_of_Rows-1,0, VioHandle); + VioWrtNCell(cefs(&c), N_of_Cols, N_of_Rows-1,0, VioHandle); } /* clearBottomLine */ @@ -192,26 +194,26 @@ Directory *curDir; c.ch = '['; c.at = color[statusC]; - VIOWRTNCELL(cefs(&c), 1, 0,0, VioHandle); + VioWrtNCell(cefs(&c), 1, 0,0, VioHandle); lStr = strlen(RootPath); a = color[nameC]; - VIOWRTCHARSTRATT (chfs(RootPath), lStr, 0,1, afs(&a), VioHandle); + VioWrtCharStrAtt (chfs(RootPath), lStr, 0,1, afs(&a), VioHandle); c.ch = ']'; c.at = color[statusC]; - VIOWRTNCELL(cefs(&c), 1, 0,lStr+1, VioHandle); + VioWrtNCell(cefs(&c), 1, 0,lStr+1, VioHandle); lStr = strlen(helpMsg); col = N_of_Cols - lStr; a = color[statusC]; - VIOWRTCHARSTRATT (chfs(helpMsg), lStr, 0,col, afs(&a), VioHandle); + VioWrtCharStrAtt (chfs(helpMsg), lStr, 0,col, afs(&a), VioHandle); if (topRow >= 0) { displayWindow (WINDOW_TOP,topRow,WINDOW_SIZE); highlightDir (topRow, curDir, color[cursorC]); } - VIOSETCURPOS (N_of_Rows-1, N_of_Cols-1, VioHandle); /* Hide cursor */ + VioSetCurPos (N_of_Rows-1, N_of_Cols-1, VioHandle); /* Hide cursor */ } @@ -261,7 +263,7 @@ int topRow; Directory *p; int color; { - int dLen,cCol,cRow; + USHORT dLen,cCol,cRow; Attr a; cRow = WINDOW_TOP + p->d_row - topRow; @@ -269,23 +271,23 @@ int color; dLen = strlen(p->d_name); a = color; - VIOWRTNATTR (afs(&a), dLen, cRow, cCol, VioHandle); + VioWrtNAttr (afs(&a), dLen, cRow, cCol, VioHandle); } /* highlightDir */ -/*** displayWindow - Displaya a portion of the tree in the tree window +/*** displayWindow - Display a portion of the tree in the tree window * * */ displayWindow (screenRow,imageRow,count) -int screenRow,imageRow,count; +USHORT screenRow,imageRow,count; { int row; Cell c; while (count-- && (imageRow <= LastRow)) { - VIOWRTCELLSTR (cefs(DisplayRow[imageRow]), N_of_Cols*sizeof(Cell), + VioWrtCellStr (cefs(DisplayRow[imageRow]), N_of_Cols*sizeof(Cell), screenRow,0, VioHandle); screenRow++; imageRow++; @@ -293,5 +295,5 @@ int screenRow,imageRow,count; c.ch = ' '; c.at = color[blankC]; for (row=screenRow; row