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.

160 lines
3.6 KiB

  1. /*************************************************
  2. * lctool.h *
  3. * *
  4. * Copyright (C) 1995-1999 Microsoft Inc. *
  5. * *
  6. *************************************************/
  7. #define MAX_CHAR_NUM 1000
  8. #define MAX_PHRASE_LEN 128
  9. #define SEGMENT_SIZE 60
  10. #define NULL_SEG 0xffff
  11. #define MAX_LINE 19
  12. #define CTRL_STATE 0x8000
  13. #include <TCHAR.H>
  14. #ifdef UNICODE
  15. typedef DWORD UNALIGNED FAR *LPUNADWORD;
  16. typedef WORD UNALIGNED FAR *LPUNAWORD;
  17. typedef TCHAR UNALIGNED FAR *LPUNATCHAR;
  18. #else
  19. typedef DWORD FAR *LPUNADWORD;
  20. typedef WORD FAR *LPUNAWORD;
  21. typedef TCHAR FAR *LPUNATCHAR;
  22. #define TCHAR UCHAR
  23. #endif
  24. #define FILE_BIG5 0
  25. #define FILE_UNICODE 1
  26. // Global function prototypes.
  27. // LCTOOL.C
  28. LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
  29. LRESULT CALLBACK WndSubProc(HWND, UINT, WPARAM, LPARAM);
  30. BOOL lcAllocWord();
  31. BOOL lcAllocPhrase();
  32. UINT lcGetSeg();
  33. void lcFreeSeg(UINT);
  34. // LCFILE.C
  35. BOOL lcAppend(HWND);
  36. BOOL lcFOpen(HWND);
  37. #ifdef UNICODE
  38. BOOL lcFSave(HWND, BOOL);
  39. #else
  40. BOOL lcFSave(HWND);
  41. #endif
  42. BOOL lcImport(HWND);
  43. #ifdef UNICODE
  44. BOOL lcExport(HWND,int);
  45. #else
  46. BOOL lcExport(HWND);
  47. #endif
  48. void lcQueryModify(HWND);
  49. BOOL lcQuerySave(HWND);
  50. void lcErrIOMsg(UINT, UCHAR *);
  51. // LCFUNC.C
  52. BOOL lcKey(HWND, WPARAM, USHORT);
  53. BOOL lcTab_key(HWND);
  54. void lcUp_key(HWND);
  55. void lcDown_key(HWND);
  56. void lcPgUp_key(HWND);
  57. void lcPgDown_key(HWND);
  58. void lcGoto(HWND);
  59. void lcErrMsg(UINT);
  60. BOOL lcSaveEditText(UINT, UINT);
  61. BOOL lcSetEditText(UINT, BOOL);
  62. void lcDelLine(HWND);
  63. void lcInsLine(HWND);
  64. BOOL lcSort(HWND);
  65. UINT lcGetEditFocus(HWND, BOOL *);
  66. BOOL is_DBCS(WORD, BOOL);
  67. BOOL is_DBCS2(WORD, BOOL);
  68. void lcEditFocusOn(WORD);
  69. BOOL lcDisp2Mem(UINT, TCHAR *);
  70. UINT lcMem2Disp(UINT, TCHAR *);
  71. void lcChangeSequence(HWND hwnd);
  72. void lcSearch(HWND hwnd, BOOL);
  73. // LCPRINT.C
  74. BOOL WINAPI GetPrinterConfig(HWND);
  75. int WINAPI lcPrint(HWND);
  76. BOOL is_DBCS_1st(TCHAR *, int);
  77. //-------------------------------------------------------------------------
  78. // Global variable declarations.
  79. HINSTANCE hInst; // The current instance handle
  80. HANDLE hwndMain;
  81. HANDLE hMenu;
  82. HCURSOR hCursorWait;
  83. HCURSOR hCursorArrow;
  84. HWND hwndWord[MAX_LINE];
  85. HWND hwndPhrase[MAX_LINE];
  86. HWND hwndFocus;
  87. WORD wOldID;
  88. UINT iPage_line; // Line number per page
  89. UINT iDisp_Top;
  90. BOOL bSaveFile;
  91. WORD wSameCode;
  92. int xPos, yPos;
  93. TCHAR szFilterSpec[MAX_PATH];
  94. TCHAR szExt[10];
  95. //-------------------------------------------------------------------------
  96. // Memory blobal variable declarations.
  97. //
  98. // Warning : iFirst_Seg & iNext_Seg store only SEGMENT number but address
  99. // for address can not mainten after GlobalRealloc
  100. //
  101. #ifdef UNICODE
  102. typedef struct{
  103. DWORD lFirst_Seg;
  104. TCHAR wWord;
  105. } WORDBUF, FAR *LPWORDBUF;
  106. typedef struct STRUCT_PHRASE{
  107. DWORD lNext_Seg;
  108. TCHAR szPhrase[SEGMENT_SIZE];
  109. } PHRASEBUF, FAR *LPPHRASEBUF;
  110. #else
  111. typedef struct{
  112. UINT iFirst_Seg;
  113. WORD wWord;
  114. } WORDBUF, FAR *LPWORDBUF;
  115. typedef struct STRUCT_PHRASE{
  116. UINT iNext_Seg;
  117. UCHAR szPhrase[SEGMENT_SIZE];
  118. } PHRASEBUF, FAR *LPPHRASEBUF;
  119. #endif
  120. HANDLE hWord;
  121. #ifdef UNICODE
  122. DWORD nWordBuffsize;
  123. DWORD lWordBuff;
  124. #else
  125. UINT nWordBuffsize;
  126. UINT iWordBuff;
  127. #endif
  128. LPWORDBUF lpWord;
  129. HANDLE hPhrase;
  130. #ifdef UNICODE
  131. DWORD nPhraseBuffsize;
  132. DWORD lPhraseBuff;
  133. #else
  134. UINT nPhraseBuffsize;
  135. UINT iPhraseBuff;
  136. #endif
  137. LPPHRASEBUF lpPhrase;
  138. UINT iFirstFree;
  139. //