home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c185 / 2.ddi / OWLSRC.EXE / CSCAPE / SOURCE / VIDDECL.H < prev    next >
Encoding:
C/C++ Source or Header  |  1989-09-06  |  3.5 KB  |  95 lines

  1. /*
  2.     viddecl.h
  3.  
  4.     % Video Functions
  5.  
  6.     Everything that needs to be included on top of "disp.h" to use vid_ calls.
  7.     For compatibility with C-Scape 2.x
  8.  
  9.     OWL 1.1
  10.     Copyright (c) 1988, by Oakland Group, Inc.
  11.     ALL RIGHTS RESERVED.
  12.  
  13.     Revision History:
  14.     -----------------
  15.     12/22/88 jmd    12:22 swapped args to vid_SetMap macro
  16. */
  17.  
  18. #    include "cmwinobj.h"
  19.  
  20. /* Global window used by vid_ functions */
  21. OEXTERN win_type vid_win;
  22.  
  23. #define vid_GetWin(win)                (vid_win)
  24.  
  25. #define vid_SetWin(win)                                \
  26.     (win_GetID(win) == ID_CMWIN) ? (win_MakeCurrent(win), vid_win = win) : \
  27.                                     NULL)
  28.  
  29. /* -------------------------------------------------------------------------- */
  30. #define vid_SetDriver(driver)        disp_SetCurrent(driver)
  31. #define vid_GetDriver()                disp_GetCurrent()
  32. #define vid_Close()                    disp_Close()
  33.  
  34. #define vid_GetMode()                disp_GetMode()
  35.  
  36. #define vid_Cache()                    disp_Cache()
  37. #define vid_Flush()                    disp_Flush()
  38.  
  39. #define vid_SetMap(attr, colors)                    \
  40.     disp_SetAttrColors(attr, (opixval)(colors >> 4), (opixval)(colors & 0x0F))
  41. /*
  42.     The functions vid_GetWidth() and vid_GetHeight are inconsistent with the
  43.     other vid_ functions here in that they do not refer to vid_win. This is
  44.     so that old code which does not use a vid_win can still find out the
  45.     display size. If your code needs to know the dimensions of the vid_win,
  46.     change it to use vid_GetWinWidth() and vid_GetWinHeight.
  47.     Likewise, the function cls() clears the whole display whether or not any
  48.     background window or vid_win is present. To clear the vid_win, call
  49.     win_Clear(vid_win, win_bgcolor(vid_win)).
  50. */
  51.  
  52. #define vid_GetWidth()                disp_GetWidth()
  53. #define vid_GetHeight()                disp_GetHeight()
  54.  
  55. #define vid_GetWinWidth()            win_GetWidth(vid_win)
  56. #define vid_GetWinHeight()            win_GetHeight(vid_win)
  57.  
  58. /* -------------------------------------------------------------------------- */
  59. #define vid_GetCursorType()            win_GetCursorType(vid_win)
  60. #define vid_SetCursorType(type)        win_SetCursorType(vid_win, type)
  61. #define vid_GetCursorPos(rowp, colp) win_GetCursorPos(vid_win, rowp, colp)
  62. #define vid_SetCursorPos(row, col)    win_SetCursorPos(vid_win, row, col)
  63.  
  64. /* -------------------------------------------------------------------------- */
  65. #define vidwin_Class                cmwin_Class
  66.  
  67. #define vid_PutStringAttr(row, col, string, attrbuf, slen) \
  68.     cmwin_DrawStringAttr(vid_win, row, col, string, attrbuf, slen)
  69.  
  70. #define vid_PutString(row, col, string, attr, slen) \
  71.     cmwin_DrawString(vid_win, row, col, string, attr, slen)
  72.  
  73. #define vid_PutChar(row, col, c, attr)                \
  74.     cmwin_DrawChar(vid_win, row, col, c, attr)
  75.  
  76. #define vid_Clear(attr)                cmwin_Clear(vid_win, attr)
  77.  
  78. /* These macros do nothing */
  79. #define vid_Push()
  80. #define vid_Pop()
  81. #define vid_PushWindow(y1, x1, y2, x2)
  82. #define vid_PopWindow(y1, x1, y2, x2)
  83. /* -------------------------------------------------------------------------- */
  84.  
  85. extern byte        vid_GetMap(_arg1(byte attr));
  86. extern char        vid_GetChar(_arg2(int row, int col));
  87. extern void        vid_ScrollWindow(_arg6(int row1, int col1, int row2, int col2, int lines, byte attr));
  88. extern void        vid_ClearWindow(_arg5(int row1, int col1, int row2, int col2, byte attr));
  89. extern void        vid_DrawLine(_arg6(char *linecp, int row1, int col1, int row2, int col2, byte attr));
  90. extern int         vid_PutAttr(_arg4(int row, int col, byte *attrbuf, int slen));
  91. extern char       *vid_GetAttr(_arg3(int row, int col, int slen));
  92. extern void        vid_DrawBox(_arg6(char *boxcp, int row1, int col1, int row2, int col2, byte attr));
  93. /* -------------------------------------------------------------------------- */
  94.  
  95.