Source code of Windows XP (NT5)
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.

147 lines
4.2 KiB

  1. /**************************************************************************\
  2. * chtuconv.h -- header file for CHT uconvert program.
  3. *
  4. * Function prototypes, global variables, & preprocessor defines.
  5. *
  6. * Copyright (C) 1992-1999 Microsoft Inc.
  7. *
  8. \**************************************************************************/
  9. #if ! defined( _CHNUCONV_ )
  10. #define _CHNUCONV_
  11. #include <windows.h>
  12. #include <windowsx.h>
  13. #include <winuserp.h>
  14. #include <commctrl.h>
  15. #include <commdlg.h>
  16. #include <shellapi.h>
  17. #include <htmlhelp.h>
  18. /**************************************************************************\
  19. * Function prototypes, window procedures first.
  20. \**************************************************************************/
  21. INT_PTR SourceTabProc( HWND, UINT, WPARAM, LPARAM);
  22. INT_PTR TargetTabProc( HWND, UINT, WPARAM, LPARAM);
  23. INT_PTR OptionTabProc( HWND, UINT, WPARAM, LPARAM);
  24. INT_PTR ViewSourceProc(HWND, UINT, WPARAM, LPARAM);
  25. INT_PTR ViewTargetProc(HWND, UINT, WPARAM, LPARAM);
  26. DLGTEMPLATE * WINAPI DoLockDlgRes(LPWSTR);
  27. BOOL EnableControl( IN HWND hWnd, IN int ControlId, IN BOOL Enable );
  28. VOID GetSettings(VOID);
  29. VOID AdjustTargetTab(VOID);
  30. BOOL SwapSource(BOOL);
  31. BOOL SwapDest(BOOL);
  32. BOOL IsUnicode (PBYTE );
  33. BOOL IsBOM (PBYTE );
  34. BOOL IsRBOM (PBYTE );
  35. LPVOID ManageMemory (UINT, UINT, DWORD, LPVOID);
  36. /**************************************************************************\
  37. * Global variables (declared in chtuconv.c).
  38. \**************************************************************************/
  39. /*No convertion between Traditional Chinese and Simplified Chinese characters*/
  40. #define DONOTMAP 0
  41. #define NUMBER_OF_PAGES 3
  42. extern HANDLE _hWndMain;
  43. extern HANDLE _hModule;
  44. extern HANDLE hMainTabControl;
  45. extern HANDLE hWndDisplay;
  46. extern HANDLE hWndTab[];
  47. /* Information specifying which is unicode and what the other code page is. */
  48. extern int gTypeSource;
  49. extern int gTypeSourceID;
  50. extern UINT giSourceCodePage;
  51. extern int gTypeDest;
  52. extern int gTypeDestID;
  53. extern UINT giDestinationCodePage;
  54. /* pointers to global source & destination data, and byte count. */
  55. extern PBYTE pViewSourceData;
  56. extern PBYTE pTempData;
  57. extern PBYTE pTempData1;
  58. extern PBYTE pSourceData;
  59. extern PBYTE pDestinationData;
  60. extern int nBytesSource;
  61. extern int nBytesDestination;
  62. extern UINT uCodepage[];
  63. /* Conversion Options variables. */
  64. extern DWORD gMBFlags;
  65. extern DWORD gWCFlags;
  66. extern char glpDefaultChar[];
  67. extern BOOL gUsedDefaultChar;
  68. extern BOOL gSourceSwapped;
  69. extern BOOL gDestSwapped;
  70. extern HGLOBAL hglbSourceMem;
  71. extern HGLOBAL hglbDestMem;
  72. extern HGLOBAL hglbMem;
  73. extern PBYTE p;
  74. extern int NumCodePage;
  75. extern DWORD gTCSCMapStatus;
  76. extern DWORD gFWHWMapStatus;
  77. //used Dynamically initialize default codepage according to ACP -shanxu.
  78. extern int giRBInit;
  79. extern char szBOM[];
  80. extern char szRBOM[];
  81. extern UINT MBFlags;
  82. extern TCHAR MBTitle[];
  83. extern TCHAR MBMessage[];
  84. extern TCHAR szBlank[];
  85. extern TCHAR szNBytes[];
  86. extern TCHAR szFilter[];
  87. /**************************************************************************\
  88. * Defined constants.
  89. \**************************************************************************/
  90. #define SIZEOFBOM 2
  91. #define NUM_EXTENSION_STRINGS 50
  92. #define EXTENSION_LENGTH 200
  93. /* Messages that can be send to ManageMemory() as first param */
  94. #define MMALLOC 1
  95. #define MMFREE 2
  96. /* Messages that can be send to ManageMemory() as second param */
  97. #define MMSOURCE 3
  98. #define MMDESTINATION 4
  99. /* Allowed values for the global variable gTypeSource */
  100. #define TYPEUNKNOWN 0
  101. #define TYPEUNICODE 1
  102. #define TYPECODEPAGE 2
  103. #define NODATA 0
  104. #define DLGBORDER GetSystemMetrics (SM_CXFRAME)*2
  105. /* "user message." Used by main window. */
  106. #define WMU_SETCODEPAGEINFO WM_USER +100
  107. #define WMU_ADJUSTFORNEWSOURCE WM_USER +101
  108. /* Define a value for the LOGFONT.lfCharSet
  109. * This should be included in wingdi.h, but it
  110. * was removed because the font mapper is not
  111. * using it anyway in version 1.0. Currently
  112. * scheduled to be included in NT ver 1.1.
  113. */
  114. #define UNICODE_CHARSET 1
  115. #define MAXNUMOFCODEPAGE 9
  116. TCHAR gszExtensions[NUM_EXTENSION_STRINGS][EXTENSION_LENGTH];
  117. TCHAR gszCodePage[MAXNUMOFCODEPAGE][EXTENSION_LENGTH];
  118. #endif