ODScrn.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. /* OpenDoors Online Software Programming Toolkit
  2. * (C) Copyright 1991 - 1999 by Brian Pirie.
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2 of the License, or (at your option) any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public
  15. * License along with this library; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  17. *
  18. *
  19. * File: ODScrn.h
  20. *
  21. * Description: Functions used to access the local display screen buffer, which
  22. * keeps a copy of the text that is displayed on the remote
  23. * terminal. The local display screen buffer also displays the
  24. * OpenDoors status lines on some platforms. In addition to
  25. * maintaining the current screen buffer, the odscrn.c module
  26. * also contains the code to display this buffer on the screen.
  27. *
  28. * Revisions: Date Ver Who Change
  29. * ---------------------------------------------------------------
  30. * Nov 14, 1995 6.00 BP Created.
  31. * Jan 21, 1996 6.00 BP Added ODScrnShowMessage() and related.
  32. * Jan 27, 1996 6.00 BP Made text-mode window f'ns static.
  33. * Jan 31, 1996 6.00 BP Made them non-static again.
  34. * Jan 31, 1996 6.00 BP Added ODScrnLocalInput().
  35. * Feb 19, 1996 6.00 BP Changed version number to 6.00.
  36. * Mar 03, 1996 6.10 BP Begin version 6.10.
  37. * Mar 19, 1996 6.10 BP MSVC15 source-level compatibility.
  38. */
  39. #ifndef _INC_ODSCRN
  40. #define _INC_ODSCRN
  41. #include "ODTypes.h"
  42. #include "ODPlat.h"
  43. /* Text information structure. */
  44. typedef struct
  45. {
  46. unsigned char winleft;
  47. unsigned char wintop;
  48. unsigned char winright;
  49. unsigned char winbottom;
  50. unsigned char attribute;
  51. unsigned char curx;
  52. unsigned char cury;
  53. } tODScrnTextInfo;
  54. /* Screen buffer initialization and shutdown functions. */
  55. tODResult ODScrnInitialize(void);
  56. void ODScrnShutdown(void);
  57. /* Basic text output functions. */
  58. void ODScrnDisplayChar(unsigned char chToOutput);
  59. void ODScrnDisplayBuffer(const char *pBuffer, INT nCharsToDisplay);
  60. void ODScrnDisplayString(const char *pszString);
  61. INT ODScrnPrintf(char *pszFormat, ...);
  62. /* Functions for manipulating rectangular areas of the screen buffer. */
  63. BOOL ODScrnGetText(BYTE btLeft, BYTE btTop, BYTE btRight, BYTE btBottom,
  64. void *pbtBuffer);
  65. BOOL ODScrnPutText(BYTE btLeft, BYTE btTop, BYTE btRight, BYTE btBottom,
  66. void *pbtBuffer);
  67. BOOL ODScrnCopyText(BYTE btLeft, BYTE btTop, BYTE btRight, BYTE btBottom,
  68. BYTE btDestColumn, BYTE btDestRow);
  69. /* Functions for clearing portions of the screen buffer. */
  70. void ODScrnClear(void);
  71. void ODScrnClearToEndOfLine(void);
  72. /* Functions for setting or obtaining current display settings. */
  73. void ODScrnSetBoundary(BYTE btLeft, BYTE btTop, BYTE btRight, BYTE btBottom);
  74. void ODScrnSetCursorPos(BYTE btColumn, BYTE btRow);
  75. void ODScrnSetAttribute(BYTE btAttribute);
  76. void ODScrnEnableScrolling(BOOL bEnable);
  77. void ODScrnEnableCaret(BOOL bEnable);
  78. void ODScrnGetTextInfo(tODScrnTextInfo *pTextInfo);
  79. /* Functions for displaying OpenDoors message window. */
  80. void *ODScrnShowMessage(char *pszText, int nFlags);
  81. void ODScrnRemoveMessage(void *pMessageInfo);
  82. /* Additional local output functions for text mode based versions. */
  83. #ifdef OD_TEXTMODE
  84. void *ODScrnCreateWindow(BYTE btLeft, BYTE btTop, BYTE btRight,
  85. BYTE btBottom, BYTE btAttribute, char *pszTitle, BYTE btTitleAttribute);
  86. void ODScrnDestroyWindow(void *pWindow);
  87. void ODScrnLocalInput(BYTE btLeft, BYTE btRow, char *pszString,
  88. BYTE btMaxChars);
  89. #endif /* OD_TEXTMODE */
  90. /* Functions for local screen window under Win32 version. */
  91. #ifdef ODPLAT_WIN32
  92. tODResult ODScrnStartWindow(HANDLE hInstance, tODThreadHandle *phScreenThread,
  93. HWND hwndFrame);
  94. void ODScrnSetFocusToWindow(void);
  95. void ODScrnAdjustWindows(void);
  96. #endif /* ODPLAT_WIN32 */
  97. #endif /* _INC_ODSCRN */