TermData.h 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. /*
  2. * CDE - Common Desktop Environment
  3. *
  4. * Copyright (c) 1993-2012, The Open Group. All rights reserved.
  5. *
  6. * These libraries and programs are free software; you can
  7. * redistribute them and/or modify them under the terms of the GNU
  8. * Lesser General Public License as published by the Free Software
  9. * Foundation; either version 2 of the License, or (at your option)
  10. * any later version.
  11. *
  12. * These libraries and programs are distributed in the hope that
  13. * they will be useful, but WITHOUT ANY WARRANTY; without even the
  14. * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  15. * PURPOSE. See the GNU Lesser General Public License for more
  16. * details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with these libraries and programs; if not, write
  20. * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
  21. * Floor, Boston, MA 02110-1301 USA
  22. */
  23. /*
  24. * $XConsortium: TermData.h /main/1 1996/04/21 19:15:38 drk $";
  25. */
  26. /* *
  27. * (c) Copyright 1993, 1994 Hewlett-Packard Company *
  28. * (c) Copyright 1993, 1994 International Business Machines Corp. *
  29. * (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
  30. * (c) Copyright 1993, 1994 Novell, Inc. *
  31. */
  32. #ifndef _Dt_TermData_h
  33. #define _Dt_TermData_h
  34. #include "TermPrimData.h"
  35. #include "TermPrimRender.h"
  36. #include "TermFunctionKey.h"
  37. #define NUM_RENDER_FONTS 3
  38. #define RENDER_FONT_NORMAL 0
  39. #define RENDER_FONT_LINEDRAW 1
  40. #define RENDER_FONT_BOLD 2
  41. #define NO_USER_KEY_STRINGS 15
  42. typedef struct _VtFontInfoRec {
  43. TermFont termFont;
  44. short id;
  45. } VtFontRec, *VtFont;
  46. typedef struct _VtColorPairRec {
  47. XColor fg;
  48. XColor bg;
  49. XColor hb;
  50. Boolean fgCommon;
  51. Boolean hbValid;
  52. Boolean bgCommon;
  53. Boolean initialized;
  54. } VtColorPairRec, *VtColorPair;
  55. typedef struct _VtsaveCursor {
  56. /* The following "save" symbols are for "Save cursor state" (ESC7 & ESC8) */
  57. short cursorRow; /* to save current row */
  58. short cursorColumn; /* to save current column */
  59. char enhFieldState; /* to save current Char Erase state */
  60. char enhVideoState; /* to save current video enhancements */
  61. char enhFgColorState; /* index into color pair for fg text color*/
  62. char enhBgColorState; /* index into color pair for bg text color */
  63. Boolean originMode; /* to save current origin mode */
  64. Boolean wrapMode; /* to save current Wrap mode */
  65. int *GL; /* left graphics character set */
  66. int *GR; /* right graphics character set */
  67. int G0; /* graphics 0 character set */
  68. int G1; /* graphics 1 character set */
  69. int G2; /* graphics 2 character set */
  70. int G3; /* graphics 3 character set */
  71. int singleShiftFont; /* single shift character set */
  72. Boolean singleShiftPending; /* single shift ready to go */
  73. /* short charSets; don't need these yet */
  74. /* short charShift; ** to save char shift states for G0, etc */
  75. } VtSaveCursorRec, *VtSaveCursor ;
  76. typedef struct _VtSaveDECMode {
  77. Boolean allow80_132ColMode; /* true if we allow changing (xterm spec)*/
  78. Boolean col132Mode ; /* True if 132 column mode */
  79. Boolean applicationMode; /* true if app mode, false if normal mode */
  80. Boolean applicationKPMode; /* true if app keypad mode */
  81. Boolean originMode; /* true when origin mode is active */
  82. Boolean wrapMode; /* true when wrapRightMode is true */
  83. Boolean jumpScrollMode;
  84. Boolean inverseVideoMode;
  85. Boolean fixCursesMode;
  86. Boolean reverseWrapMode;
  87. Boolean marginBellMode;
  88. Boolean cursorVisible;
  89. Boolean logging;
  90. } VtSaveDECModeRec, *VtSaveDECMode ;
  91. typedef struct _DtTermDataRec {
  92. /*********************************************************************
  93. * Provide the term data structure so we can use a single pointer
  94. */
  95. DtTermPrimData tpd;
  96. /*********************************************************************
  97. * Font
  98. */
  99. VtFontRec renderFonts[NUM_RENDER_FONTS];
  100. /* fonts to use for the terinal */
  101. int G0; /* Graphics sets 0-4 */
  102. int G1;
  103. int G2;
  104. int G3;
  105. int *GL; /* Graphics Left and Right */
  106. int *GR;
  107. int singleShiftFont; /* single shift character set */
  108. Boolean singleShiftPending; /* single shift ready to go */
  109. unsigned char baseFontIndex; /* number of base font */
  110. unsigned char altFontIndex; /* number of alternate font */
  111. /*********************************************************************
  112. * Colors
  113. */
  114. VtColorPairRec colorPairs[9]; /* color pair pixels */
  115. /*********************************************************************
  116. * User (and other) Function keys
  117. */
  118. unsigned char *userKeyString[NO_USER_KEY_STRINGS+1] ;
  119. Boolean applicationMode; /* true if app mode, false if normal mode */
  120. Boolean applicationKPMode; /* true if app keypad mode */
  121. Boolean originMode; /* true when origin mode is active */
  122. Boolean S8C1TMode; /* true when xmitting 8 bit c1 codes */
  123. Boolean col132Mode ; /* True if 132 column mode */
  124. Boolean reverseWrapMode; /* true if we're doing Reverse auto wrap*/
  125. Boolean fixCursesMode; /* true if we're handling the tab problem */
  126. Boolean userKeysLocked; /* true if user defined keys are locked */
  127. Boolean needToLockUserKeys; /* true if need to lock keys (this is a parser
  128. state and will mostly be false) */
  129. int compatLevel; /* 1=vt100, 2=vt200 */
  130. int terminalId; /* 220, 100, 101, 102 */
  131. char enhVideoState; /* current video enhancement state */
  132. char enhFieldState; /* current field enhancement state */
  133. char enhFgColorState; /* current fg color enhancement state */
  134. char enhBgColorState; /* current bg color enhancement state */
  135. char enhFontState; /* current font enhancement state */
  136. VtSaveCursorRec saveCursor ;
  137. VtSaveDECModeRec saveDECMode ;
  138. } DtTermDataRec, *DtTermData;
  139. #endif /* _Dt_TermData_h */