MONO.H 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /*
  2. ** Command & Conquer Generals Zero Hour(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /***********************************************************************************************
  19. *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
  20. ***********************************************************************************************
  21. * *
  22. * Project Name : Command & Conquer *
  23. * *
  24. * $Archive:: /Commando/Code/wwlib/mono.h $*
  25. * *
  26. * $Author:: Jani_p $*
  27. * *
  28. * $Modtime:: 5/04/01 7:36p $*
  29. * *
  30. * $Revision:: 5 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. #if _MSC_VER >= 1000
  36. #pragma once
  37. #endif // _MSC_VER >= 1000
  38. #ifndef MONO_H
  39. #define MONO_H
  40. #include "win.h"
  41. class MonoClass {
  42. public:
  43. typedef enum MonoAttribute {
  44. INVISIBLE=0x00, // Black on black.
  45. UNDERLINE=0x01, // Underline.
  46. BLINKING=0x90, // Blinking white on black.
  47. NORMAL=0x02, // White on black.
  48. INVERSE=0x70 // Black on white.
  49. } MonoAttribute;
  50. MonoClass(void);
  51. ~MonoClass(void);
  52. static void Enable(void) {Enabled = true;};
  53. static void Disable(void) {Enabled = false;};
  54. static bool Is_Enabled(void) {return Enabled;};
  55. void Sub_Window(int x=0, int y=0, int w=80, int h=25);
  56. void Fill_Attrib(int x, int y, int w, int h, MonoAttribute attrib);
  57. void Clear(void);
  58. void Set_Cursor(int x, int y);
  59. void Print(char const *text);
  60. void Print(int text);
  61. void Printf(char const *text, ...);
  62. void Printf(int text, ...);
  63. void Text_Print(char const *text, int x, int y, MonoAttribute attrib=NORMAL);
  64. void Text_Print(int text, int x, int y, MonoAttribute attrib=NORMAL);
  65. void View(void);
  66. void Scroll(int lines=1);
  67. void Pan(int cols=1);
  68. void Set_Default_Attribute(MonoAttribute attrib);
  69. /*
  70. ** This merely makes a duplicate of the mono object into a newly created mono
  71. ** object.
  72. */
  73. MonoClass (MonoClass const &);
  74. static MonoClass * Current;
  75. private:
  76. /*
  77. ** Handle of the mono page.
  78. */
  79. HANDLE Handle;
  80. /*
  81. ** If this is true, then monochrome output is allowed. It defaults to false
  82. ** so that monochrome output must be explicitly enabled.
  83. */
  84. static bool Enabled;
  85. MonoClass & operator = (MonoClass const & );
  86. };
  87. #endif