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.

230 lines
5.2 KiB

  1. /*++
  2. Copyright (c) 1992 Microsoft Corporation
  3. Module Name:
  4. console.h
  5. Abstract:
  6. This module contains the definitions for the console applet
  7. Author:
  8. Jerry Shea (jerrysh) Feb-3-1992
  9. Revision History:
  10. --*/
  11. #include "font.h"
  12. #include "doshelp.h"
  13. //
  14. // Icon ID
  15. //
  16. #define IDI_CONSOLE 1
  17. //
  18. // String table constants
  19. //
  20. #define IDS_NAME 1
  21. #define IDS_INFO 2
  22. #define IDS_TITLE 3
  23. #define IDS_RASTERFONT 4
  24. #define IDS_FONTSIZE 5
  25. #define IDS_SELECTEDFONT 6
  26. #define IDS_SAVE 7
  27. #define IDS_LINKERRCAP 8
  28. #define IDS_LINKERROR 9
  29. #define IDS_WARNING 10
  30. //
  31. // Global Variables
  32. //
  33. extern HINSTANCE ghInstance;
  34. extern PCONSOLE_STATE_INFO gpStateInfo;
  35. extern PFONT_INFO FontInfo;
  36. extern ULONG NumberOfFonts;
  37. extern ULONG CurrentFontIndex;
  38. extern ULONG DefaultFontIndex;
  39. extern TCHAR DefaultFaceName[];
  40. extern COORD DefaultFontSize;
  41. extern BYTE DefaultFontFamily;
  42. extern TCHAR szPreviewText[];
  43. extern PFACENODE gpFaceNames;
  44. extern BOOL gbEnumerateFaces;
  45. extern LONG gcxScreen;
  46. extern LONG gcyScreen;
  47. #if defined(FE_SB)
  48. extern UINT OEMCP;
  49. extern BOOL gfFESystem;
  50. extern BOOL fChangeCodePage;
  51. NTSTATUS
  52. MakeAltRasterFont(
  53. UINT CodePage,
  54. COORD *AltFontSize,
  55. BYTE *AltFontFamily,
  56. ULONG *AltFontIndex,
  57. LPTSTR AltFaceName
  58. );
  59. NTSTATUS
  60. InitializeDbcsMisc(
  61. VOID
  62. );
  63. BYTE
  64. CodePageToCharSet(
  65. UINT CodePage
  66. );
  67. LPTTFONTLIST
  68. SearchTTFont(
  69. LPTSTR ptszFace,
  70. BOOL fCodePage,
  71. UINT CodePage
  72. );
  73. BOOL
  74. IsAvailableTTFont(
  75. LPTSTR ptszFace
  76. );
  77. BOOL
  78. IsAvailableTTFontCP(
  79. LPWSTR pwszFace,
  80. UINT CodePage
  81. );
  82. BOOL
  83. IsDisableBoldTTFont(
  84. LPTSTR ptszFace
  85. );
  86. LPTSTR
  87. GetAltFaceName(
  88. LPTSTR ptszFace
  89. );
  90. NTSTATUS
  91. DestroyDbcsMisc(
  92. VOID
  93. );
  94. int
  95. LanguageListCreate(
  96. HWND hDlg,
  97. UINT CodePage
  98. );
  99. int
  100. LanguageDisplay(
  101. HWND hDlg,
  102. UINT CodePage
  103. ) ;
  104. //
  105. // registry.c
  106. //
  107. NTSTATUS
  108. MyRegOpenKey(
  109. IN HANDLE hKey,
  110. IN LPWSTR lpSubKey,
  111. OUT PHANDLE phResult
  112. );
  113. NTSTATUS
  114. MyRegEnumValue(
  115. IN HANDLE hKey,
  116. IN DWORD dwIndex,
  117. OUT DWORD dwValueLength,
  118. OUT LPWSTR lpValueName,
  119. OUT DWORD dwDataLength,
  120. OUT LPBYTE lpData
  121. );
  122. #endif
  123. //
  124. // Function prototypes
  125. //
  126. INT_PTR ConsolePropertySheet(HWND hWnd);
  127. BOOL RegisterClasses(HANDLE hModule);
  128. void UnregisterClasses(HANDLE hModule);
  129. INT_PTR FontDlgProc(HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM lParam);
  130. PCONSOLE_STATE_INFO InitRegistryValues(VOID);
  131. DWORD GetRegistryValues(PCONSOLE_STATE_INFO StateInfo);
  132. VOID SetRegistryValues(PCONSOLE_STATE_INFO StateInfo, DWORD dwPage);
  133. PCONSOLE_STATE_INFO InitStateValues(HANDLE hMap);
  134. PCONSOLE_STATE_INFO ReadStateValues(HANDLE hMap);
  135. BOOL WriteStateValues(PCONSOLE_STATE_INFO pStateInfo);
  136. LRESULT ColorControlProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam);
  137. LRESULT FontPreviewWndProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam);
  138. LRESULT PreviewWndProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam);
  139. INT_PTR CommonDlgProc(HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM lParam);
  140. VOID EndDlgPage(HWND hDlg);
  141. BOOL UpdateStateInfo(HWND hDlg, UINT Item, int Value);
  142. BOOL WereWeStartedFromALnk();
  143. BOOL SetLinkValues( PCONSOLE_STATE_INFO StateInfo );
  144. //
  145. // Macros
  146. //
  147. #define NELEM(array) (sizeof(array)/sizeof(array[0]))
  148. #define AttrToRGB(Attr) (gpStateInfo->ColorTable[(Attr) & 0x0F])
  149. #define ScreenTextColor(pStateInfo) \
  150. (AttrToRGB(LOBYTE(pStateInfo->ScreenAttributes) & 0x0F))
  151. #define ScreenBkColor(pStateInfo) \
  152. (AttrToRGB(LOBYTE(pStateInfo->ScreenAttributes >> 4)))
  153. #define PopupTextColor(pStateInfo) \
  154. (AttrToRGB(LOBYTE(pStateInfo->PopupAttributes) & 0x0F))
  155. #define PopupBkColor(pStateInfo) \
  156. (AttrToRGB(LOBYTE(pStateInfo->PopupAttributes >> 4)))
  157. #ifdef DEBUG_PRINT
  158. #define _DBGFONTS 0x00000001
  159. #define _DBGFONTS2 0x00000002
  160. #define _DBGCHARS 0x00000004
  161. #define _DBGOUTPUT 0x00000008
  162. #define _DBGALL 0xFFFFFFFF
  163. extern ULONG gDebugFlag;
  164. #define DBGFONTS(_params_) {if (gDebugFlag & _DBGFONTS) DbgPrint _params_ ; }
  165. #define DBGFONTS2(_params_) {if (gDebugFlag & _DBGFONTS2)DbgPrint _params_ ; }
  166. #define DBGCHARS(_params_) {if (gDebugFlag & _DBGCHARS) DbgPrint _params_ ; }
  167. #define DBGOUTPUT(_params_) {if (gDebugFlag & _DBGOUTPUT)DbgPrint _params_ ; }
  168. #define DBGPRINT(_params_) DbgPrint _params_
  169. #else
  170. #define DBGFONTS(_params_)
  171. #define DBGFONTS2(_params_)
  172. #define DBGCHARS(_params_)
  173. #define DBGOUTPUT(_params_)
  174. #define DBGPRINT(_params_)
  175. #endif
  176. #ifdef FE_SB
  177. // Macro definitions that handle codepages
  178. //
  179. #define CP_US (UINT)437
  180. #define CP_JPN (UINT)932
  181. #define CP_WANSUNG (UINT)949
  182. #define CP_TC (UINT)950
  183. #define CP_SC (UINT)936
  184. #define IsBilingualCP(cp) ((cp)==CP_JPN || (cp)==CP_WANSUNG)
  185. #define IsFarEastCP(cp) ((cp)==CP_JPN || (cp)==CP_WANSUNG || (cp)==CP_TC || (cp)==CP_SC)
  186. #endif