home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_01_03 / 1n03072a < prev    next >
Text File  |  1990-06-20  |  3KB  |  103 lines

  1. /*
  2.     Screen
  3.         2.50
  4.         19-Jun-1990
  5.         ANSI C for MS-DOS w/monochrome or color text display
  6.  
  7.         Provides a set of functions for manipulating a text display.
  8.         To drastically improve the speed of this module, NO RANGE
  9.         CHECKING is done! Invalid line/column values may cause
  10.         portions of non-video memory to be corrupted!
  11.  
  12.         Written by Scott Robert Ladd. Released into the public domain.
  13. */
  14.  
  15. #if !defined(__SCREEN_H)
  16. #define __SCREEN_H 1
  17.  
  18. #include "stddef.h"
  19.  
  20. typedef enum {BT_NONE, BT_SINGLE, BT_DOUBLE, BT_SOLID} BoxType;
  21.  
  22. typedef enum {SM_UNKNOWN = -1, SM_25x40 = 0, SM_25x80,
  23.               SM_30x80, SM_43x80, SM_50x80} ScrMode;
  24.  
  25. typedef enum {ST_UNKNOWN = -1, ST_MDA = 0, ST_CGA, ST_HGC,
  26.               ST_EGA, ST_MCGA, ST_VGA} ScrType;
  27.  
  28. typedef enum {SA_DIRECT, SA_BIOS} ScrAccess;
  29.  
  30. #define SCR_F_BLACK  0x00
  31. #define SCR_F_BLUE   0x01
  32. #define SCR_F_GREEN  0x02
  33. #define SCR_F_RED    0x04
  34. #define SCR_F_CYAN   (SCR_F_BLUE | SCR_F_GREEN)
  35. #define SCR_F_VIOLET (SCR_F_RED  | SCR_F_BLUE)
  36. #define SCR_F_YELLOW (SCR_F_RED  | SCR_F_GREEN)
  37. #define SCR_F_BROWN  (SCR_F_YELLOW)
  38. #define SCR_F_WHITE  (SCR_F_BLUE | SCR_F_GREEN | SCR_F_RED)
  39. #define SCR_F_BRIGHT 0x08
  40.  
  41. #define SCR_B_BLACK  0x00
  42. #define SCR_B_BLUE   0x10
  43. #define SCR_B_GREEN  0x20
  44. #define SCR_B_RED    0x40
  45. #define SCR_B_CYAN   (SCR_B_BLUE | SCR_B_GREEN)
  46. #define SCR_B_VIOLET (SCR_B_RED  | SCR_B_BLUE)
  47. #define SCR_B_YELLOW (SCR_B_RED  | SCR_B_GREEN)
  48. #define SCR_B_BROWN  (SCR_B_YELLOW)
  49. #define SCR_B_WHITE  (SCR_B_BLUE | SCR_B_GREEN | SCR_B_RED)
  50. #define SCR_B_BRIGHT 0x80
  51.  
  52. #define SCR_BLINK    0x80
  53. #define SCR_UNDER    0x08
  54.  
  55. ScrType ScrOpen(void);
  56.  
  57. void ScrClose(void);
  58.  
  59. int ScrSetMode(ScrMode mode);
  60.  
  61. ScrMode ScrGetMode(void);
  62.  
  63. void ScrSetAccess(ScrAccess access);
  64.  
  65. ScrAccess ScrGetAccess(void);
  66.  
  67. void ScrDimensions(unsigned int * wid, unsigned int * len);
  68.  
  69. void ScrCursorHide(void);
  70. void ScrCursorUnhide(void);
  71.  
  72. void ScrCursorSetPos(unsigned int line, unsigned int col);
  73. void ScrCursorGetPos(unsigned int * line, unsigned int * col);
  74.  
  75. void ScrPutChar(unsigned int line, unsigned int col,
  76.                 unsigned char attr, char ch);
  77.  
  78. void ScrGetChar(unsigned int line, unsigned int col,
  79.                 unsigned char * attr, char * ch);
  80.  
  81. void ScrPutStr(unsigned int line, unsigned int col,
  82.                unsigned char attr, char * str);
  83.  
  84. void ScrPrintf(unsigned int line, unsigned int col,
  85.                unsigned char attr, char * format, ...);
  86.  
  87. void ScrDrawBox(unsigned int topLine, unsigned int leftCol,
  88.                 unsigned int btmLine, unsigned int rightCol,
  89.                 unsigned char attr, BoxType typeBox);
  90.  
  91. void ScrScrollUp(unsigned int topLine, unsigned int leftCol,
  92.                  unsigned int btmLine, unsigned int rightCol,
  93.                  unsigned char attr, unsigned int noOfLines);
  94.  
  95. void ScrScrollDown(unsigned int topLine, unsigned int leftCol,
  96.                    unsigned int btmLine, unsigned int rightCol,
  97.                    unsigned char attr, unsigned int noOfLines);
  98.  
  99. void ScrClear(void);
  100. void ScrClearLine(unsigned int line, unsigned int col);
  101.  
  102. #endif
  103.