2
0

TermBufferP.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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: TermBufferP.h /main/1 1996/04/21 19:15:29 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_TermBufferP_h
  33. #define _Dt_TermBufferP_h
  34. #include "TermBuffer.h"
  35. #include "TermPrimBufferP.h"
  36. #ifdef __cplusplus
  37. extern "C" {
  38. #endif /* __cplusplus */
  39. /*
  40. ** This is the enhancement structure, one per character.
  41. */
  42. typedef struct _DtEnh
  43. {
  44. /* ANSI C requires bit fields to be int, signed int or unsigned int type */
  45. /*
  46. ** The video enhancements.
  47. */
  48. unsigned int video :6;
  49. /*
  50. ** FIELD_UNPROTECT 0
  51. ** FIELD_PROTECT 1
  52. ** FIELD_TRANSMIT 2
  53. ** FIELD_END 3
  54. */
  55. unsigned int field :2;
  56. /*
  57. ** index into color[0..15], on for foreground, on for background
  58. */
  59. unsigned int fgColor :4;
  60. unsigned int bgColor :4;
  61. /*
  62. ** FONT_NORMAL 0
  63. ** FONT_LINEDRAW 1
  64. */
  65. unsigned int font :1;
  66. } DtTermEnhPart, *DtEnh;
  67. /*
  68. ** This a line, the character buffer, and the enhancements.
  69. */
  70. typedef struct _DtLinePart
  71. {
  72. DtEnh enh;
  73. } DtLinePart;
  74. typedef struct _DtTermLineRec
  75. {
  76. TermLinePart term_line;
  77. DtLinePart dt_line;
  78. } DtTermLineRec, *DtLine;
  79. typedef struct _DtTermBufferPart
  80. {
  81. DtTermEnhPart enhState;
  82. Boolean enhDirty; /* true if the enhState is non default */
  83. } DtTermBufferPart;
  84. typedef struct _DtTermBufferRec
  85. {
  86. TermBufferPart term_buffer;
  87. DtTermBufferPart dt_buffer;
  88. } DtTermBufferRec, *DtTermBuffer;
  89. /*
  90. ** Define some useful DT counter parts for the TermPrimBufferP.h macros
  91. */
  92. #define DT_LINE_OF_TBUF(tb, row) ((DtLine)(LINE_OF_TBUF(tb, row)))
  93. #define DT_LINES(tb) ((DtLine*)(LINES(tb)))
  94. #define DT_ENH_STATE(tb) (((DtTermBuffer)(tb))->dt_buffer.enhState)
  95. #define DT_ENH_DIRTY(tb) (((DtTermBuffer)(tb))->dt_buffer.enhDirty)
  96. #define DT_ENH(line) ((line)->dt_line.enh)
  97. #ifdef __cplusplus
  98. } /* close scope of 'extern "C"'... */
  99. #endif /* __cplusplus */
  100. #endif /* _Dt_TermBufferP_h */
  101. /* DON'T ADD ANYTHING AFTER THIS #endif... */