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.

236 lines
9.6 KiB

  1. /**************************************************************************\
  2. * Module Name: softkbd.h
  3. *
  4. * Copyright (c) 1985 - 1999, Microsoft Corporation
  5. *
  6. * Declarations of soft keyboard related data structures and constants
  7. *
  8. * History:
  9. * 02-Dec-1995 wkwok Ported from Win95
  10. \**************************************************************************/
  11. #ifndef _SOFTKBD_
  12. #define _SOFTKBD_
  13. #define UI_MARGIN 4
  14. // T1 part
  15. #define SKT1_XIN 3
  16. #define SKT1_YIN 3
  17. #define SKT1_XOUT 1
  18. #define SKT1_YOUT 1
  19. #define SKT1_TOTAL_ROW_NUM 5
  20. #define SKT1_TOTAL_COLUMN_NUM 15
  21. #define SKT1_ENTER_ROW_NUM 2
  22. #define SKT1_XOVERLAP 2
  23. #define SKT1_CONTEXT 0
  24. enum SKT1_BUTTON_TYPE {
  25. SKT1_LETTER_TYPE,
  26. SKT1_BACKSPACE_TYPE,
  27. SKT1_TAB_TYPE,
  28. SKT1_CAPS_TYPE,
  29. SKT1_ENTER_TYPE,
  30. SKT1_SHIFT_TYPE,
  31. SKT1_CTRL_TYPE,
  32. SKT1_ALT_TYPE,
  33. SKT1_ESC_TYPE,
  34. SKT1_SPACE_TYPE,
  35. };
  36. #define SKT1_TOTAL_TYPE (SKT1_SPACE_TYPE + 1)
  37. #define SKT1_LETTER_WIDTH_TIMES 2
  38. #define SKT1_BACKSPACE_WIDTH_TIMES 2
  39. #define SKT1_TAB_WIDTH_TIMES 3
  40. #define SKT1_CAPS_WIDTH_TIMES 4
  41. #define SKT1_ENTER_WIDTH_TIMES 3
  42. #define SKT1_SHIFT_WIDTH_TIMES 5
  43. #define SKT1_CTRL_WIDTH_TIMES 3
  44. #define SKT1_ALT_WIDTH_TIMES 3
  45. #define SKT1_ESC_WIDTH_TIMES 3
  46. #define SKT1_SPACE_WIDTH_TIMES 12
  47. #define SKT1_LETTER_KEY_NUM 47
  48. #define SKT1_BACKSPACE_INDEX (SKT1_LETTER_KEY_NUM)
  49. #define SKT1_BACKSPACE_KEY_NUM 1
  50. #define SKT1_TAB_INDEX (SKT1_BACKSPACE_INDEX + SKT1_BACKSPACE_KEY_NUM)
  51. #define SKT1_TAB_KEY_NUM 1
  52. #define SKT1_CAPS_INDEX (SKT1_TAB_INDEX + SKT1_TAB_KEY_NUM)
  53. #define SKT1_CAPS_KEY_NUM 1
  54. #define SKT1_ENTER_INDEX (SKT1_CAPS_INDEX + SKT1_CAPS_KEY_NUM)
  55. #define SKT1_ENTER_KEY_NUM 1
  56. #define SKT1_SHIFT_INDEX (SKT1_ENTER_INDEX + SKT1_ENTER_KEY_NUM)
  57. #define SKT1_SHIFT_KEY_NUM 2
  58. #define SKT1_CTRL_INDEX (SKT1_SHIFT_INDEX + SKT1_SHIFT_KEY_NUM)
  59. #define SKT1_CTRL_KEY_NUM 2
  60. #define SKT1_ALT_INDEX (SKT1_CTRL_INDEX + SKT1_CTRL_KEY_NUM)
  61. #define SKT1_ALT_KEY_NUM 2
  62. #define SKT1_ESC_INDEX (SKT1_ALT_INDEX + SKT1_ALT_KEY_NUM)
  63. #define SKT1_ESC_KEY_NUM 1
  64. #define SKT1_SPACE_INDEX (SKT1_ESC_INDEX + SKT1_ESC_KEY_NUM)
  65. #define SKT1_SPACE_KEY_NUM 1
  66. #define SKT1_TOTAL_INDEX (SKT1_SPACE_INDEX + SKT1_SPACE_KEY_NUM)
  67. #define SKT1_TOTAL_KEY_NUM (SKT1_TOTAL_INDEX + 1)
  68. #define SKT1_ROW1_LETTER_NUM 14
  69. #define SKT1_ROW2_LETTER_NUM 12
  70. #define SKT1_ROW3_LETTER_NUM 11
  71. #define SKT1_ROW4_LETTER_NUM 10
  72. #define SKT1_LABEL_BMP_X 8
  73. #define SKT1_LABEL_BMP_Y 8
  74. #define SKT1_BACKSPACE_BMP_X 16
  75. #define SKT1_BACKSPACE_BMP_Y 9
  76. #define SKT1_TAB_BMP_X 16
  77. #define SKT1_TAB_BMP_Y 9
  78. #define SKT1_CAPS_BMP_X 22
  79. #define SKT1_CAPS_BMP_Y 9
  80. #define SKT1_ENTER_BMP_X 26
  81. #define SKT1_ENTER_BMP_Y 9
  82. #define SKT1_SHIFT_BMP_X 23
  83. #define SKT1_SHIFT_BMP_Y 9
  84. #define SKT1_CTRL_BMP_X 16
  85. #define SKT1_CTRL_BMP_Y 9
  86. #define SKT1_ESC_BMP_X 18
  87. #define SKT1_ESC_BMP_Y 9
  88. #define SKT1_ALT_BMP_X 16
  89. #define SKT1_ALT_BMP_Y 9
  90. #if 0
  91. #define VK_OEM_SEMICLN 0xba // ; :
  92. #define VK_OEM_EQUAL 0xbb // = +
  93. #define VK_OEM_COMMA 0xbc // , <
  94. #define VK_OEM_MINUS 0xbd // - _
  95. #define VK_OEM_PERIOD 0xbe // . >
  96. #define VK_OEM_SLASH 0xbf // / ?
  97. #define VK_OEM_3 0xc0 // ` ~
  98. #define VK_OEM_LBRACKET 0xdb // [ {
  99. #define VK_OEM_BSLASH 0xdc // \ |
  100. #define VK_OEM_RBRACKET 0xdd // ] }
  101. #define VK_OEM_QUOTE 0xde // ' "
  102. #endif
  103. #define SKT1_NOT_DRAG 0xFFFFFFFF
  104. typedef struct _tagSKT1CTXT {
  105. int nButtonWidth[SKT1_TOTAL_TYPE];
  106. int nButtonHeight[2];
  107. POINT ptButtonPos[SKT1_TOTAL_KEY_NUM];
  108. WORD wCodeTable[SKT1_LETTER_KEY_NUM];
  109. HBITMAP hSKBitmap;
  110. UINT lfCharSet;
  111. UINT uKeyIndex;
  112. POINT ptSkCursor;
  113. POINT ptSkOffset;
  114. UINT uSubType;
  115. } SKT1CTXT, *PSKT1CTXT, FAR *LPSKT1CTXT, NEAR *NPSKT1CTXT;
  116. void GetSKT1TextMetric(LPTEXTMETRIC);
  117. LRESULT SKWndProcT1(HWND, UINT, WPARAM, LPARAM);
  118. // T2 part
  119. // C1 part
  120. // button constants
  121. #define ROW_LETTER_C1 4 // number of rows of letter button
  122. #define COL_LETTER_C1 13 // number of column of letter button in first row
  123. #define COL2_LETTER_C1 COL_LETTER_C1 // number of column of letter button in second row
  124. #define COL3_LETTER_C1 (COL2_LETTER_C1 - 2) // number of column of letter button in third row
  125. #define COL4_LETTER_C1 (COL3_LETTER_C1 - 1) // number of column of letter button in forth row
  126. #define W_LETTER_C1 20 // width of letter button face
  127. #define H_LETTER_C1 24 // height of letter button face
  128. #define BORDER_C1 2 // the width/height of button border
  129. #define W_LETTER_BTN_C1 (W_LETTER_C1 + 2 * BORDER_C1)
  130. #define H_LETTER_BTN_C1 (H_LETTER_C1 + 2 * BORDER_C1)
  131. #define H_BOTTOM_C1 20 // the height of bottom button face
  132. #define H_BOTTOM_BTN_C1 (H_BOTTOM_C1 + 2 * BORDER_C1)
  133. // bitmap have the same size
  134. #define W_BACKSP_C1 32 // width of Backspace button face
  135. #define H_BACKSP_C1 H_LETTER_C1 // height of Backspace button face
  136. #define W_TAB_C1 32 // width of Tab button face
  137. #define H_TAB_C1 H_LETTER_C1 // height of Tab button face
  138. #define W_CAPS_C1 38 // width of Caps button face
  139. #define H_CAPS_C1 H_LETTER_C1 // height of Caps button face
  140. #define W_ENTER_C1 38 // width of Enter button face
  141. #define H_ENTER_C1 H_LETTER_C1 // height of Enter button face
  142. #define W_SHIFT_C1 56 // width of Shift button face
  143. #define H_SHIFT_C1 H_LETTER_C1 // height of Shift button face
  144. #define W_INS_C1 34 // width of Ins button face
  145. #define H_INS_C1 H_BOTTOM_C1 // height of Ins button face
  146. #define W_DEL_C1 34 // width of Del button face
  147. #define H_DEL_C1 H_BOTTOM_C1 // height of Del button face
  148. #define W_SPACE_C1 168 // width of Space button face
  149. #define H_SPACE_C1 H_BOTTOM_C1 // height of Space button face
  150. #define W_ESC_C1 34 // width of Esc button face
  151. #define H_ESC_C1 H_BOTTOM_C1 // height of Esc button face
  152. #define X_ROW_LETTER_C1 0
  153. #define X_ROW2_LETTER_C1 (W_TAB_C1 + 2 * BORDER_C1)
  154. #define X_ROW3_LETTER_C1 (W_CAPS_C1 + 2 * BORDER_C1)
  155. #define X_ROW4_LETTER_C1 (W_SHIFT_C1 + 2 * BORDER_C1)
  156. #define X_DEL_C1 58
  157. #define X_ESC_C1 310
  158. #define LETTER_NUM_C1 47 // number of letter buttons
  159. #define OTHER_NUM_C1 9 // number of other buttons
  160. #define BUTTON_NUM_C1 (LETTER_NUM_C1 + OTHER_NUM_C1) // number of buttons
  161. #define WIDTH_SOFTKBD_C1 (COL_LETTER_C1 * W_LETTER_BTN_C1 \
  162. + W_BACKSP_C1 + 2 * BORDER_C1)
  163. #define HEIGHT_SOFTKBD_C1 (ROW_LETTER_C1 * H_LETTER_BTN_C1 + H_BOTTOM_BTN_C1)
  164. #define BACKSP_TYPE_C1 LETTER_NUM_C1
  165. #define TAB_TYPE_C1 (BACKSP_TYPE_C1 + 1)
  166. #define CAPS_TYPE_C1 (BACKSP_TYPE_C1 + 2)
  167. #define ENTER_TYPE_C1 (BACKSP_TYPE_C1 + 3)
  168. #define SHIFT_TYPE_C1 (BACKSP_TYPE_C1 + 4)
  169. #define INS_TYPE_C1 (BACKSP_TYPE_C1 + 5)
  170. #define DEL_TYPE_C1 (BACKSP_TYPE_C1 + 6)
  171. #define SPACE_TYPE_C1 (BACKSP_TYPE_C1 + 7)
  172. #define ESC_TYPE_C1 (BACKSP_TYPE_C1 + 8)
  173. // font constants
  174. #define SIZEFONT_C1 12 // 12 x 12 pixels font
  175. #define SIZELABEL_C1 8 // 8 x 8 button label
  176. #define X_LABEL_C1 2 // from the button org
  177. #define Y_LABEL_C1 2
  178. #define X_SHIFT_CHAR_C1 10
  179. #define Y_SHIFT_CHAR_C1 2
  180. #define X_NONSHIFT_CHAR_C1 2
  181. #define Y_NONSHIFT_CHAR_C1 14
  182. // SoftKbd context
  183. #define SKC1_CONTEXT 0
  184. #define FLAG_SHIFT_C1 0x01
  185. #define FLAG_DRAG_C1 0x02
  186. #define FLAG_FOCUS_C1 0x04
  187. typedef struct _tagSKC1CTXT {
  188. WORD wShiftCode[LETTER_NUM_C1];
  189. WORD wNonShiftCode[LETTER_NUM_C1];
  190. UINT uState;
  191. HBITMAP hSoftkbd;
  192. UINT uSubtype;
  193. int uKeyIndex;
  194. POINT ptSkCursor;
  195. POINT ptSkOffset;
  196. UINT lfCharSet;
  197. } SKC1CTXT, *PSKC1CTXT, FAR *LPSKC1CTXT, NEAR *NPSKC1CTXT;
  198. LRESULT SKWndProcC1(HWND, UINT, WPARAM, LPARAM);
  199. VOID SKC1DrawDragBorder(HWND, LPPOINT, LPPOINT);
  200. #endif // _SOFTKBD_