home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / PROG_GEN / FACETV.ZIP / TVSCREEN.H < prev    next >
C/C++ Source or Header  |  1993-12-09  |  3KB  |  117 lines

  1. /************************************************************************
  2. **
  3. ** @(#)tvscreen.h    08/13/93    Chris Ahlstrom
  4. **
  5. **    C++
  6. **
  7. *************************************************************************/
  8.  
  9. #if !defined(TVSCREEN_h)                /* { TVSCREEN_h    */
  10. #define TVSCREEN_h
  11.  
  12.  
  13. #if !defined(USE_TURBO_VISION)
  14. #define USE_TURBO_VISION
  15. #endif
  16.  
  17. #define screenmsg(a, b, c)    tvScreenmsg((a), (b), (c))
  18.  
  19.  
  20. extern
  21.  
  22. #ifdef __cplusplus                /* { __cplusplus    */
  23. "C"
  24. #endif                        /* } __cplusplus    */
  25.  
  26. int tvScreenmsg
  27. (
  28.     int use_io,            // whether to ignore output
  29.     void *handle,        // bogus for now
  30.     char *string        // string to display
  31. );
  32.  
  33. #if defined(__cplusplus)                // { __cplusplus
  34.  
  35. #define Uses_TWindow
  36. #define Uses_TApplication
  37. #define Uses_TRect
  38. #define Uses_TTerminal
  39. #define Uses_MsgBox
  40. #define Uses_otstream
  41. #define Uses_TDeskTop
  42. #include <tv.h>
  43.  
  44.  
  45. /************************************************************************
  46. ** TWindowScreen class
  47. **
  48. **    Largely based on the handy TTerminal class provided by Borland.
  49. ** Long live Philippe Kahn!  (I'd like to see a mud-wrestling contest
  50. ** between him and Bill Gates.)
  51. **
  52. *************************************************************************/
  53.  
  54. class TWindowScreen : public TWindow
  55. {
  56.  
  57. public:
  58.  
  59.     TWindowScreen
  60.     (
  61.     const TRect& bounds,    // initial size rectangle for window
  62.     const char *atitle,    // title for the top of the frame
  63.     short anumber,        // bogus number for the window (wmNoNumber)
  64.     ushort bufsize        // buffer size for window
  65.     );
  66.     ~TWindowScreen();
  67.  
  68.     TTerminal *makeInterior
  69.     (
  70.     TRect bounds, ushort abufsize
  71.     );
  72.  
  73.     friend TWindowScreen *startWindowScreen
  74.     (
  75.     TDeskTop *desktop,
  76.     unsigned buffsize
  77.     );
  78.     friend void doScreenMessage
  79.     (
  80.     TWindowScreen *handle,
  81.     char *message
  82.     );
  83.  
  84. private:
  85.  
  86.     TTerminal *screenInterior;        // points to window interior
  87.  
  88.     /********************************************************************
  89.     ** For some reason, cannot pass the pointer "screenOStream" without
  90.     ** causing weird problems (see the unuseable code in the USEABLE_CODE
  91.     ** #if in tvscreen.cpp).
  92.     **
  93.     ** otstream *screenOStream;        // one output text stream per interior
  94.     **
  95.     *********************************************************************/
  96. };
  97.  
  98.  
  99. /************************************************************************
  100. ** Friend functions of the TWindowScreen class
  101. *************************************************************************/
  102.  
  103. extern void doScreenMessage        /* helper function        */
  104. (
  105.     TWindowScreen *handle,
  106.     char *message
  107. );
  108. extern TWindowScreen *startWindowScreen    /* helper for creating screens    */
  109. (
  110.     TDeskTop *desktop,
  111.     unsigned buffsize = 64000U
  112. );
  113.  
  114. #endif                            // } __cplusplus
  115.  
  116. #endif                            /* } TVSCREEN_h    */
  117.