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.

189 lines
6.1 KiB

  1. /**************************************************/
  2. /* */
  3. /* */
  4. /* EUDC EDITOR (MAIN HEADER) */
  5. /* */
  6. /* */
  7. /* Copyright (c) 1997-1999 Microsoft Corporation. */
  8. /**************************************************/
  9. #include "resource.h"
  10. #ifndef __AFXWIN_H__
  11. #error include 'stdafx.h' before including this file for PCH
  12. #endif
  13. #include <htmlhelp.h>
  14. /* EUDC editor defined windows message */
  15. #define WM_IMPORTGAGE (WM_USER) // start import
  16. #define WM_IMPORTSTOP (WM_USER + 1) // stop import
  17. #define WM_DUPLICATE (WM_USER + 2) // duplicate bitmap
  18. #define WM_VIEWUPDATE (WM_USER + 3) // view update
  19. /* Country ID */
  20. #define EUDC_JPN 0x411 // Japanese
  21. #define EUDC_CHT 0x404 // Chinese (Taipei)
  22. #define EUDC_CHS 0x804 // Chinese (General)
  23. #define EUDC_HKG 0xc04 // Chinese (Hong Kong)
  24. #define EUDC_SIN 0x1004 // Chinese (Singapore)
  25. #define EUDC_KRW 0x412 // Korea (Wansung)
  26. #define EUDC_HEBREW 0x40d
  27. #define EUDC_HINDI 0x439
  28. #define EUDC_TAMIL 0x449
  29. /*
  30. #ifdef BUILD_ON_WINNT
  31. #define EUDC_UNICODE 0xFFFF // Unicode
  32. #endif
  33. */
  34. /* Smoothing level */
  35. #define SMOOTHLVL 1 // show outline
  36. // regist truetype
  37. /* Code string size */
  38. #define MAX_CODE 5 // size of code string
  39. /* Tool */
  40. #define NOTSELECT 0 // "Not Selected"
  41. #define PEN 1 // "Pen"
  42. #define SLOPE 2 // "Straight Line"
  43. #define RECTBAND 3 // "Hollow Ractangle"
  44. #define RECTFILL 4 // "Filled Rectangle"
  45. #define CIRCLE 5 // "Hollow Circle"
  46. #define CIRCLEFILL 6 // "Filled Circle"
  47. #define RECTCLIP 7 // "Rectangular Selection"
  48. #define BRUSH 8 // "Brush"
  49. #define FREEFORM 9 // "Freeform Selection"
  50. #define ERASER 10 // "Eraser"
  51. /* Cursor */
  52. #define VERTICAL 0 // vertical arrow for resize
  53. #define RIGHTSLOPE 1 // right arrow for resize
  54. #define LEFTSLOPE 2 // left arrow for resize
  55. #define HORIZONTAL 3 // horizontal arrow for resize
  56. #define ALLDIRECT 4 // all direct arrow for resize
  57. #define NUMRESIZE 5 // the number of resize cursor
  58. #define NUMTOOL 11 // the number of tool cursor
  59. /* Color */
  60. #define COLOR_WHITE RGB(255,255,255) // white
  61. #define COLOR_BLACK RGB( 0, 0, 0) // black
  62. #define COLOR_LGRAY RGB(192,192,192) // light Gray
  63. #define COLOR_DGRAY RGB(128,128,128) // dark Gray
  64. #define COLOR_YELLO RGB(255,255, 0) // yellow
  65. #define COLOR_BLUE RGB( 0, 0,255) // blue
  66. #define COLOR_RED RGB(255, 0, 0) // red
  67. /* Bitmap size */
  68. #define MAX_BITMAPSIZE 256 // maximun of bitmap size
  69. #define MIN_BITMAPSIZE 16 // minimun of bitmap size
  70. #define DEF_BITMAPSIZE 64 // default of bitmap size
  71. /* Selected font, file and code structure */
  72. typedef struct _tagSELECTEUDC{
  73. TCHAR m_Font[LF_FACESIZE]; // selected EUDC typeFace
  74. TCHAR m_File[MAX_PATH]; // selected EUDC fileName
  75. TCHAR m_FileTitle[MAX_PATH]; // selected EUDC fileTitle
  76. TCHAR m_Code[MAX_CODE]; // selected EUDC code
  77. BOOL m_FontTypeFlg; // flag whether TTF or not
  78. }SELECTEUDC;
  79. /* EUDC coderange and languageID structure */
  80. typedef struct _tagCOUNTRYINFO{
  81. INT nRange; // the number of code range
  82. USHORT sRange[MAX_LEADBYTES]; // start of code range
  83. USHORT eRange[MAX_LEADBYTES]; // end of code range
  84. INT nLeadByte; // the number of lead byte
  85. UCHAR sLeadByte[MAX_LEADBYTES]; // start of lead byte
  86. UCHAR eLeadByte[MAX_LEADBYTES]; // end of lead byte
  87. INT nTralByte; // the number of trail byte
  88. UCHAR sTralByte[MAX_LEADBYTES]; // start of trail byte
  89. UCHAR eTralByte[MAX_LEADBYTES]; // end of trail byte
  90. TCHAR szForceFont[LF_FACESIZE]; // default font facename;
  91. #ifdef BUILD_ON_WINNT
  92. BOOL bUnicodeMode; // user select unicode mode
  93. BOOL bOnlyUnicode; // We only have unicode
  94. /* For CHS to keep the original trail byte range in order to dynamically
  95. * calculate trailbyte range with EUDC selection range.
  96. */
  97. INT nOrigTralByte;
  98. UCHAR sOrigTralByte[MAX_LEADBYTES]; // start of trail byte
  99. UCHAR eOrigTralByte[MAX_LEADBYTES]; // end of trail byte
  100. #endif // BUILD_ON_WINNT
  101. INT LangID; // language ID
  102. INT CharacterSet; // Character Set
  103. INT CurrentRange; // selected currently range
  104. }COUNTRYINFO;
  105. /* DBCS coderange except EUDC */
  106. /*typedef struct _tagDBCSINFO{
  107. INT nLeadByte; // the number of lead byte
  108. UCHAR sLeadByte[MAX_LEADBYTES]; // start of lead byte
  109. UCHAR eLeadByte[MAX_LEADBYTES]; // end of lead byte
  110. INT nTralByte; // the number of trail byte
  111. UCHAR sTralByte[MAX_LEADBYTES]; // start of trail byte
  112. UCHAR eTralByte[MAX_LEADBYTES]; // end of trail byte
  113. }DBCSINFO;
  114. */
  115. /* Global parameter */
  116. extern HCURSOR ToolCursor[NUMTOOL]; // tool cursor
  117. extern HCURSOR ArrowCursor[NUMRESIZE]; // resize cursor
  118. extern INT CAPTION_HEIGHT; // height of caption
  119. extern INT BITMAP_HEIGHT; // height of bitmap
  120. extern INT BITMAP_WIDTH; // width of bitmap
  121. extern DWORD COLOR_GRID; // grid color
  122. extern DWORD COLOR_CURVE; // outline color
  123. extern DWORD COLOR_FITTING; // bitmap color in show outline
  124. extern DWORD COLOR_FACE; // Win95 3D Face System Color
  125. extern DWORD COLOR_SHADOW; // Win95 3D Shadow Color
  126. extern DWORD COLOR_HLIGHT; // Win95 3D HighLight
  127. extern DWORD COLOR_WIN; // Win95 Window Color
  128. extern TCHAR HelpPath[MAX_PATH]; // Help file path
  129. extern TCHAR ChmHelpPath[MAX_PATH]; // Help file path
  130. extern TCHAR FontPath[MAX_PATH]; // Font file path
  131. extern CString NotMemTtl;
  132. extern CString NotMemMsg;
  133. extern SELECTEUDC SelectEUDC;
  134. extern COUNTRYINFO CountryInfo;
  135. class CEudcApp : public CWinApp
  136. {
  137. public:
  138. CEudcApp();
  139. virtual BOOL InitInstance();
  140. virtual BOOL ExitInstance();
  141. virtual BOOL OnIdle(LONG lCount);
  142. private:
  143. BOOL CheckPrevInstance();
  144. void DisableCUAS();
  145. BOOL GetProfileText( LPRECT MainWndRect, UINT *MaxWndFlag);
  146. BOOL GetCountryInfo();
  147. BOOL GetCursorRes();
  148. BOOL GetFilePath();
  149. public:
  150. //{{AFX_MSG(CEudcApp)
  151. afx_msg void OnAppAbout();
  152. //}}AFX_MSG
  153. DECLARE_MESSAGE_MAP()
  154. };
  155. #ifdef BUILD_ON_WINNT
  156. //
  157. // Hard codeded font face name
  158. //
  159. //
  160. // Public API prototype definition.
  161. // (should be in wingdi.h)
  162. //
  163. extern "C" BOOL APIENTRY EnableEUDC(BOOL bEnable);
  164. #endif // BUILD_ON_WINNT