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.

216 lines
7.3 KiB

  1. /************************************************************/
  2. /* Windows Write, Copyright 1985-1992 Microsoft Corporation */
  3. /************************************************************/
  4. /* This file defines the characters used by Windows Word. */
  5. /* You must include windows.h to get virtual key definitions */
  6. #define chNil (-1)
  7. /* Characters in files */
  8. #define chDelPrev 0x08
  9. #define chTab 0x09
  10. #define chEol 0x0A
  11. #define chNewLine 0x0B
  12. #define chSect 0x0C
  13. #define chReturn 0x0D
  14. #define chNRHFile 0x1F /* Non-required hyphen */
  15. #ifndef NOKCCODES
  16. /* Keyboard Characters */
  17. /* A high bit of 1 means that this is a command character */
  18. /* For Windows, a command character it one that is processed through */
  19. /* the virtual key mechanism (WM_KEYBOARD) instead of translated (WM_CHAR) */
  20. #define wKcCommandMask 0x8000 /* mask that tells if command */
  21. #define FIsCommandKc(kc) ((int)(kc) < 0) /* or, test it this way */
  22. #define kcDelPrev (wKcCommandMask | VK_BACK)
  23. #define kcDelNext (wKcCommandMask | VK_DELETE)
  24. #define kcInsert (wKcCommandMask | VK_INSERT)
  25. #define kcTab (wKcCommandMask | VK_TAB )
  26. #define kcReturn (wKcCommandMask | VK_RETURN)
  27. #define kcLeft (wKcCommandMask | VK_LEFT)
  28. #define kcUp (wKcCommandMask | VK_UP)
  29. #define kcRight (wKcCommandMask | VK_RIGHT)
  30. #define kcDown (wKcCommandMask | VK_DOWN)
  31. #define kcPageUp (wKcCommandMask | VK_PRIOR)
  32. #define kcPageDown (wKcCommandMask | VK_NEXT)
  33. #define kcBeginLine (wKcCommandMask | VK_HOME)
  34. #define kcEndLine (wKcCommandMask | VK_END)
  35. #define kcGoto (wKcCommandMask | VK_CLEAR)
  36. /* Special for windows: we must handle these key codes & update shift state */
  37. #define kcShift (wKcCommandMask | VK_SHIFT)
  38. #define kcControl (wKcCommandMask | VK_CONTROL)
  39. #define kcAlt (wKcCommandMask | VK_MENU)
  40. #define kcCapsLock (wKcCommandMask | VK_CAPITAL)
  41. /* Phony Keyboard Characters, used to force actions */
  42. #define kcNextPara 0xFFFE /* Generated from GOTO-DOWN */
  43. #define kcPrevPara 0xFFFD /* Generated from GOTO-UP */
  44. /* #define kcAlphaVirtual 0xFFFC Defined below, outside ifdef */
  45. /* Keys that affect the look of the current selection (char or para) */
  46. #define kcLookMin 0x8001 /* As of now, no look keys */
  47. #define kcLookMax 0x8000
  48. /* These control keys are processed as WM_CHAR ASCII codes */
  49. #define kcLFld (wKcCommandMask | ('[' & 0x1F)) /* Print-Merge <<>> */
  50. #define kcRFld (wKcCommandMask | (']' & 0x1F)) /* CTRL-[ and CTRL-] */
  51. /* Keyboard Kontrol (CTRL) codes -- a key message word is interpreted
  52. as a kk instead of a kc, if the CTRL key is down */
  53. #define kkUpScrollLock (kcUp)
  54. #define kkDownScrollLock (kcDown)
  55. #define kkTopDoc (wKcCommandMask | VK_HOME)
  56. #define kkEndDoc (wKcCommandMask | VK_END)
  57. #define kkTopScreen (wKcCommandMask | VK_PRIOR)
  58. #define kkEndScreen (wKcCommandMask | VK_NEXT)
  59. #define kkWordLeft (wKcCommandMask | VK_LEFT)
  60. #define kkWordRight (wKcCommandMask | VK_RIGHT)
  61. #define kkCopy (wKcCommandMask | VK_INSERT)
  62. #define kkDelPrev (wKcCommandMask | VK_BACK)
  63. #if WINVER < 0x300
  64. #define kkNonReqHyphen (wKcCommandMask | VK_MINUS)
  65. #else
  66. /* I don't know how the above EVER worked so I'm changing
  67. it to use the return value from VkKeyScan(). See routines
  68. KcAlphaKeyMessage() and FNonAlphaKeyMessage() ..pault */
  69. #define kkNonReqHyphen (wKcCommandMask | vkMinus)
  70. #endif
  71. #ifdef CASHMERE /* These keys not supported by MEMO */
  72. #define kkNonBrkSpace (wKcCommandMask | (unsigned) ' ')
  73. #define kkNLEnter (wKcCommandMask | VK_RETURN) /* EOL w/o end Para */
  74. #endif
  75. /* CTRL-shifted keys */
  76. #define kksPageBreak (wKcCommandMask | VK_RETURN)
  77. #ifdef DEBUG
  78. #define kksEatWinMemory (wKcCommandMask | 'H') /* Hog Windows Heap */
  79. #define kksFreeWinMemory (wKcCommandMask | 'R') /* Release Windows heap */
  80. #define kksEatMemory (wKcCommandMask | 'E') /* Eat WRITE Heap Space */
  81. #define kksFreeMemory (wKcCommandMask | 'F') /* Free WRITE Heap Space */
  82. #define kksTest (wKcCommandMask | VK_ESCAPE)
  83. #endif
  84. /* Transformation from kk && kks codes to a unique kc code */
  85. #define KcFromKk(kk) ( (kk) + 0x100 )
  86. #define KcFromKks(kks) ( (kks) + 0x200 )
  87. /* new style ctrl-key accelerators (7.22.91) v-dougk */
  88. #define kkNewCopy (wKcCommandMask | 'C')
  89. #define kkNewUndo (wKcCommandMask | 'Z')
  90. #define kkNewPaste (wKcCommandMask | 'V')
  91. #define kkNewCut (wKcCommandMask | 'X')
  92. /* Kc codes for CTRL-keys that are processed at the virtual key level */
  93. #define kcNewCopy KcFromKk( kkNewCopy )
  94. #define kcNewUndo KcFromKk( kkNewUndo )
  95. #define kcNewPaste KcFromKk( kkNewPaste )
  96. #define kcNewCut KcFromKk( kkNewCut )
  97. #define kcTopDoc KcFromKk( kkTopDoc )
  98. #define kcEndDoc KcFromKk( kkEndDoc )
  99. #define kcTopScreen KcFromKk( kkTopScreen )
  100. #define kcEndScreen KcFromKk( kkEndScreen )
  101. #define kcWordLeft KcFromKk( kkWordLeft )
  102. #define kcWordRight KcFromKk( kkWordRight )
  103. #define kcCut KcFromKk( kkCut )
  104. #define kcPaste KcFromKk( kkPaste )
  105. #define kcCopy KcFromKk( kkCopy )
  106. #define kcClear KcFromKk( kkClear )
  107. #define kcUndo KcFromKk( kkUndo )
  108. #define kcUpScrollLock KcFromKk( kkUpScrollLock )
  109. #define kcDownScrollLock KcFromKk( kkDownScrollLock )
  110. #ifdef DEBUG /* kc codes for Debugging control keys */
  111. #define kcEatWinMemory KcFromKks(kksEatWinMemory)
  112. #define kcFreeWinMemory KcFromKks(kksFreeWinMemory)
  113. #define kcEatMemory KcFromKks(kksEatMemory)
  114. #define kcFreeMemory KcFromKks(kksFreeMemory)
  115. #define kcTest (KcFromKks(kksTest))
  116. #endif /* DEBUG */
  117. /* A special case: kcPageBreak is a CTRL-SHIFT key that is processed in
  118. AlphaMode */
  119. #define kcPageBreak KcFromKks( kksPageBreak )
  120. #define kcNonReqHyphen KcFromKk( kkNonReqHyphen )
  121. #ifdef CASHMERE /* These keys not supported by MEMO */
  122. #define kcNonBrkSpace KcFromKk( kkNonBrkSpace )
  123. #define kcNLEnter KcFromKk( kkNLEnter )
  124. #endif
  125. #endif /* #ifndef NOKCCODES */
  126. /* Outside #ifdef because these are return codes from Kc funcs */
  127. /* Also defined in mmw.c because of compiler stack overflow problems */
  128. #define kcNil 0xFFFF
  129. #define kcAlphaVirtual 0xFFFC /* Means "Virtual Key, must translate it" */
  130. /* Display & text-processing characters. These are real characters in the ANSI
  131. character set as opposed to characters that appear in the file. */
  132. #define chSpace ' '
  133. #define chHyphen '-'
  134. #ifndef DBCS
  135. /* we defined them in kanji.h */
  136. #define chStatPage (CHAR)'\273'
  137. #define chStatRH '>'
  138. #define chEMark (CHAR)'\244'
  139. #endif
  140. #define chSplat '.'
  141. #define chSectSplat ':'
  142. #define chDot '.'
  143. #define chDecimal '.'
  144. #define chBang '!'
  145. #define chQMark '?'
  146. #define chQuote '"'
  147. #define chFldSep ','
  148. #define chLParen '('
  149. #define chRParen ')'
  150. #define chStar '*'
  151. #define chLFldFile (CHAR)'\253'
  152. #define chRFldFile (CHAR)'\273'
  153. #define chNBH (CHAR)'\255' /* Non-breaking hyphen */
  154. #define chNBSFile (CHAR)'\240' /* Non-breaking space */
  155. /* The following are "special" characters that are essentially macros for longer
  156. strings. */
  157. #define schPage (CHAR)'\001'
  158. #define schFootnote (CHAR)'\005'
  159. #define schInclude (CHAR)'\006'
  160. /* Characters in Search patterns */
  161. #define chPrefixMatch '^'
  162. #define chMatchAny '?'
  163. #define chMatchWhite 'w'
  164. #define chMatchTab 't'
  165. #define chMatchEol 'p'
  166. #define chMatchNewLine 'n'
  167. #define chMatchSect 'd'
  168. #define chMatchNBSFile 's'
  169. #define chMatchNRHFile '-'
  170. /* ANSI block character, see FWriteExtTextScrap! ..pault */
  171. #define chBlock 0x7f
  172.