home *** CD-ROM | disk | FTP | other *** search
/ World of Shareware - Software Farm 2 / wosw_2.zip / wosw_2 / CPROG / GCONIO.ZIP / GCONIO.HPP < prev   
C/C++ Source or Header  |  1991-03-30  |  2KB  |  71 lines

  1. /*
  2.  
  3.     gconio.hpp
  4.     3-30-91
  5.     graphics console class for Borland C++
  6.  
  7.     Copyright 1991
  8.     John W. Small
  9.     All rights reserved
  10.     Use freely but acknowledge authorship and copyright.
  11.     CIS: 73757,2233
  12.  
  13.     PSW / Power SoftWare
  14.     P.O. Box 10072
  15.     McLean, Virginia 22102 8072
  16.     (703) 759-3838
  17.  
  18. */
  19.  
  20.  
  21. #ifndef GCONIO_CPP
  22. #define GCONIO_CPP
  23.  
  24. #include <conio.h>
  25. #include <graphics.h>
  26.  
  27. // 4 <= GC_BUF_SIZE <= 129
  28. #define GC_BUF_SIZE    129
  29.  
  30. class GraphicsConsole  {
  31. public:
  32.     int ColumnLeft;        // CR to current column
  33.     int InputWriteMode;        // cgets(), etc. write mode
  34.     int InputRewrite;           // Upon CR rewrite COPY_PUT
  35.     int InputDone;              // cgets(), etc. break
  36.     int OutputWriteMode;        // cputs(), etc. write mode
  37.     int ClearTextBk;            // clr bgrd before writing
  38.     int TextBkPattern;          // for COPY_PUT
  39.     int TextBkColor;            // 0 for current color
  40.     char CursorChar[2];
  41.     unsigned CursorOnMsec;
  42.     unsigned CursorOffMsec;
  43.  
  44.     GraphicsConsole();
  45.  
  46.     void ProportionalBackSpace(int& lastchX,
  47.     int& lastchY, int chX, int chY,
  48.     char lastch, char ch,
  49.     struct textsettingstype& TS);
  50.     void ProportionalSpace(int chX, int chY,
  51.     int& nextchX, int& nextchY, char ch,
  52.     char nextch, struct textsettingstype& TS);
  53.     void TextBox(int x, int y, char *s,
  54.     struct textsettingstype& TS,
  55.     int& x1, int& y1, int& x2, int& y2);
  56.  
  57.     int cprintf(const char *format,...);
  58.     int cputs(const char *str);
  59.     int putch(int c);
  60.     void rubout(int ch);
  61.     int cscanf(const char *format,...);
  62.     char * cgets(char *str);
  63.     int getch()  { return ::getch(); }
  64.     int getche()  { return putch(getch()); }
  65.     int ungetch(int ch)  { return ::ungetch(ch);  }
  66.  
  67.     ~GraphicsConsole() {}
  68. };
  69.  
  70. #endif
  71.