Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

134 lines
4.6 KiB

  1. #ifndef PORT_DEFINED
  2. #define PORT_DEFINED
  3. #include "lsdefs.h"
  4. #ifndef BIG_ENDIAN
  5. #define fPortTntiKern 0x0001
  6. #define fPortTntiModWidthOnRun 0x0002
  7. #define fPortTntiModWidthSpace 0x0004
  8. #define fPortTntiModWidthPairs 0x0008
  9. #define fPortTntiCompressOnRun 0x0010
  10. #define fPortTntiCompressSpace 0x0020
  11. #define fPortTntiCompressTable 0x0040
  12. #define fPortTntiExpandOnRun 0x0080
  13. #define fPortTntiExpandSpace 0x0100
  14. #define fPortTntiExpandTable 0x0200
  15. #define fPortTntiGlyphBased 0x0400
  16. #else
  17. #define fPortTntiKern 0x8000
  18. #define fPortTntiModWidthOnRun 0x4000
  19. #define fPortTntiModWidthSpace 0x2000
  20. #define fPortTntiModWidthPairs 0x1000
  21. #define fPortTntiCompressOnRun 0x0800
  22. #define fPortTntiCompressSpace 0x0400
  23. #define fPortTntiCompressTable 0x0200
  24. #define fPortTntiExpandOnRun 0x0100
  25. #define fPortTntiExpandSpace 0x0080
  26. #define fPortTntiExpandTable 0x0040
  27. #define fPortTntiGlyphBased 0x0020
  28. #endif
  29. #ifndef BIG_ENDIAN
  30. #define fPortDisplayInvisible 0x0001
  31. #define fPortDisplayUnderline 0x0002
  32. #define fPortDisplayStrike 0x0004
  33. #define fPortDisplayShade 0x0008
  34. #define fPortDisplayBorder 0x0010
  35. #define fPortDisplayHyphen 0x0020
  36. #define fPortDisplayCheckForReplaceChar 0x0040
  37. #else
  38. #define fPortDisplayInvisible 0x8000
  39. #define fPortDisplayUnderline 0x4000
  40. #define fPortDisplayStrike 0x2000
  41. #define fPortDisplayShade 0x1000
  42. #define fPortDisplayBorder 0x0800
  43. #define fPortDisplayHyphen 0x0400
  44. #define fPortDisplayCheckForReplaceChar 0x0200
  45. #endif
  46. struct lschpint /* Character properties */
  47. {
  48. WORD idObj; /* Object type */
  49. BYTE dcpMaxContext;
  50. BYTE EffectsFlags;
  51. /* Property flags */
  52. struct
  53. {
  54. WORD Flags1;
  55. WORD Flags2;
  56. } cast;
  57. long dvpPos; /* for dvpPos values, */
  58. /* pos => raised, neg => lowered, */
  59. };
  60. typedef struct lschpint LSCHPINT;
  61. #define FIsTntiFlagsCastWorks(plschp) \
  62. ((UINT)(((((LSCHPINT*) (plschp))->cast.Flags1) & fPortTntiKern) != 0) \
  63. == (plschp)->fApplyKern && \
  64. (UINT)(((((LSCHPINT*) (plschp))->cast.Flags1) & fPortTntiModWidthOnRun) != 0) \
  65. == (plschp)->fModWidthOnRun && \
  66. (UINT)(((((LSCHPINT*) (plschp))->cast.Flags1) & fPortTntiModWidthSpace) != 0) \
  67. == (plschp)->fModWidthSpace && \
  68. (UINT)(((((LSCHPINT*) (plschp))->cast.Flags1) & fPortTntiModWidthPairs) != 0) \
  69. == (plschp)->fModWidthPairs && \
  70. (UINT)(((((LSCHPINT*) (plschp))->cast.Flags1) & fPortTntiCompressOnRun) != 0) \
  71. == (plschp)->fCompressOnRun && \
  72. (UINT)(((((LSCHPINT*) (plschp))->cast.Flags1) & fPortTntiCompressSpace) != 0) \
  73. == (plschp)->fCompressSpace && \
  74. (UINT)(((((LSCHPINT*) (plschp))->cast.Flags1) & fPortTntiCompressTable) != 0) \
  75. == (plschp)->fCompressTable && \
  76. (UINT)(((((LSCHPINT*) (plschp))->cast.Flags1) & fPortTntiExpandOnRun) != 0) \
  77. == (plschp)->fExpandOnRun && \
  78. (UINT)(((((LSCHPINT*) (plschp))->cast.Flags1) & fPortTntiExpandSpace) != 0) \
  79. == (plschp)->fExpandSpace && \
  80. (UINT)(((((LSCHPINT*) (plschp))->cast.Flags1) & fPortTntiExpandTable) != 0) \
  81. == (plschp)->fExpandTable && \
  82. (UINT)(((((LSCHPINT*) (plschp))->cast.Flags1) & fPortTntiGlyphBased) != 0) \
  83. == (plschp)->fGlyphBased \
  84. )
  85. #define AddNominalToIdealFlags(storage, plschp) \
  86. Assert(FIsTntiFlagsCastWorks(plschp)); \
  87. (storage) |= \
  88. ((LSCHPINT*) (plschp))->cast.Flags1 ;
  89. #define GetNominalToIdealFlagsFromLschp(plschp) \
  90. ( Assert(FIsTntiFlagsCastWorks(plschp)), \
  91. (((LSCHPINT*) (plschp))->cast.Flags1) \
  92. )
  93. #define FIsDisplayFlagsCastWorks(plschp) \
  94. ((UINT)(((((LSCHPINT*) (plschp))->cast.Flags2) & fPortDisplayInvisible) != 0) \
  95. == (plschp)->fInvisible && \
  96. (UINT)(((((LSCHPINT*) (plschp))->cast.Flags2) & fPortDisplayUnderline) != 0) \
  97. == (plschp)->fUnderline && \
  98. (UINT)(((((LSCHPINT*) (plschp))->cast.Flags2) & fPortDisplayStrike) != 0) \
  99. == (plschp)->fStrike && \
  100. (UINT)(((((LSCHPINT*) (plschp))->cast.Flags2) & fPortDisplayShade) != 0) \
  101. == (plschp)->fShade && \
  102. (UINT)(((((LSCHPINT*) (plschp))->cast.Flags2) & fPortDisplayBorder) != 0) \
  103. == (plschp)->fBorder && \
  104. (UINT)(((((LSCHPINT*) (plschp))->cast.Flags2) & fPortDisplayHyphen) != 0) \
  105. == (plschp)->fHyphen && \
  106. (UINT)(((((LSCHPINT*) (plschp))->cast.Flags2) & fPortDisplayCheckForReplaceChar) != 0) \
  107. == (plschp)->fCheckForReplaceChar \
  108. )
  109. #define AddDisplayFlags(storage, plschp) \
  110. Assert(FIsDisplayFlagsCastWorks((plschp))); \
  111. (storage) |= \
  112. ((LSCHPINT*) (plschp))->cast.Flags2 ;
  113. #endif /* CHNUTILS_DEFINED */