Findword.h
上传用户:chzmdj
上传日期:2007-01-22
资源大小:135k
文件大小:3k
源码类别:

源码/资料

开发平台:

C/C++

  1. #ifndef __YAN_H__
  2. #define __YAN_H__
  3. #define HAS_CURMOUSEWORD  1
  4. #define NO_CURMOUSEWORD   0
  5. #define CHAR_TYPE_ASCII 0           // the current character is a...z or A...Z
  6. #define CHAR_TYPE_HZ    1           // the currnet character is chinese.
  7. #define CHAR_TYPE_OTHER 2           // other character.
  8. #define CHAR_LINK       '-'
  9. #define CHAR_WILDCHAR1 '*'
  10. #define CHAR_WILDCHAR2 '?'
  11. //#define SEPERATOR       2
  12. #define SEPERATOR       4
  13. #define MAX_CHAR_HEIGHT 40
  14. int  GetCharType(char ch);
  15. int  FindAWord(LPCSTR lpString, int nFromPlace, int nLength);
  16. int  FindDWord(LPCSTR lpString, int nFromPlace, int nLength);
  17. int  FindTWWord(LPCSTR lpString, int nFromPlace, int nLength);
  18. BOOL IsASCIIWord(LPCSTR lpString, int nFromPlace, int nLength, int nCurCharNum);
  19. int  FindHZWord(LPCSTR lpString, int nFromPlace, int nLength);
  20. int  FindNextWordBegin(LPCSTR lpString, int nFromPlace, int nLength);
  21. int  GetCurWordEnd(LPCSTR lpString, int nFromPlace, int nLength, int nCharType);
  22. void CopyWord(LPSTR lpWord, LPCSTR lpString, int nBegin, int nEnd);
  23. void GetStringTopBottom(HDC hDC, int y, RECT* lpStringRect);
  24. void GetStringLeftRight(HDC hDC, LPSTR szBuff, int cbLen, int x, RECT* lpStringRect, int FAR* lpDx);
  25. void GetStringRect(HDC hDC, LPSTR szBuff, int cbLen, int x, int y, RECT* lpStringRect, int FAR* lpDx);
  26. DWORD GetCurMousePosWord(HDC   hDC, 
  27.  LPSTR szBuff, 
  28.  int   cbLen, 
  29.  int   x, 
  30.  int   y, 
  31.  int   FAR* lpDx);
  32. DWORD CheckMouseInCurWord(HDC   hDC, 
  33.  LPSTR szBuff, 
  34.  int   cbLen, 
  35.  int   x, 
  36.  int   y, 
  37.  int   FAR* lpDx,
  38.  int*  lpLeft,
  39.  int   nBegin,    // = nPrevWord + 1
  40.  int   nEnd,
  41.  int   nCharType);
  42. DWORD CalculateCaretPlace(HDC   hDC, 
  43.    LPSTR szBuff, 
  44.    int   cbLen, 
  45.    int   x, 
  46.    int   y, 
  47.    int   FAR* lpDx,
  48.    int   nBegin,    // = nPrevWord + 1
  49.    int   nEnd,
  50.    int   nCharType);
  51. DWORD GetEngLishCaretPlace(HDC   hDC, 
  52.    LPSTR szBuff,
  53. int   x,
  54. int   y,
  55. int   FAR* lpDx,
  56. int   nBegin,    // = nPrevWord + 1
  57. int   nEnd,
  58. int   TempPlace,
  59. int   turnto);
  60. int GetHZBeginPlace(LPSTR lpszHzBuff, int nBegin, int nEnd, LPRECT StringRect);
  61. void AddToTotalWord(LPSTR szBuff, 
  62. int   cbLen, 
  63. int   nBegin,
  64. int   nEnd,
  65. int   nCharType,
  66. RECT  StringRect,
  67. BOOL  bInCurWord);
  68. //BOOL CalcCaretInThisPlace(int CaretX, int nPlace);
  69. BOOL CalcCaretInThisPlace(int CaretX, double nPlace);
  70. // deal with memdc string.
  71. #define MEMDC_TOTALWORD -1
  72. void AddToTextOutBuffer(HDC hMemDC, LPSTR szBuff, int cbLen, int x, int y, int FAR* lpDx);
  73. void GetMemWordStringRect(int nWordCode, int nOffset, LPRECT lpStringRect);
  74. void CheckMemDCWordBuffer(HDC hdcDest, HDC hdcSrc);
  75. DWORD CheckMouseInMemDCWord(int nWordCode);
  76. DWORD CalculateCaretPlaceInMemDCWord(int nWordCode);
  77. #ifdef _DICTING_
  78. BOOL CheckDCWndClassName(HDC hDC);
  79. #endif
  80. #endif