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.

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