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 SEPERATOR       2
  10. #define MAX_CHAR_HEIGHT 40
  11. int  GetCharType(char ch);
  12. int  FindAWord(LPCSTR lpString, int nFromPlace, int nLength);
  13. int  FindDWord(LPCSTR lpString, int nFromPlace, int nLength);
  14. int  FindTWWord(LPCSTR lpString, int nFromPlace, int nLength);
  15. BOOL IsASCIIWord(LPCSTR lpString, int nFromPlace, int nLength, int nCurCharNum);
  16. int  FindHZWord(LPCSTR lpString, int nFromPlace, int nLength);
  17. int  FindNextWordBegin(LPCSTR lpString, int nFromPlace, int nLength);
  18. int  GetCurWordEnd(LPCSTR lpString, int nFromPlace, int nLength, int nCharType);
  19. void CopyWord(LPSTR lpWord, LPCSTR lpString, int nBegin, int nEnd);
  20. void GetStringTopBottom(HDC hDC, int y, RECT* lpStringRect);
  21. void GetStringLeftRight(HDC hDC, LPSTR szBuff, int cbLen, int x, RECT* lpStringRect, int FAR* lpDx);
  22. void GetStringRect(HDC hDC, LPSTR szBuff, int cbLen, int x, int y, RECT* lpStringRect, int FAR* lpDx);
  23. DWORD GetCurMousePosWord(HDC   hDC, 
  24.  LPSTR szBuff, 
  25.  int   cbLen, 
  26.  int   x, 
  27.  int   y, 
  28.  int   FAR* lpDx);
  29. DWORD CheckMouseInCurWord(HDC   hDC, 
  30.  LPSTR szBuff, 
  31.  int   cbLen, 
  32.  int   x, 
  33.  int   y, 
  34.  int   FAR* lpDx,
  35.  int*  lpLeft,
  36.  int   nBegin,    // = nPrevWord + 1
  37.  int   nEnd,
  38.  int   nCharType);
  39. DWORD CalculateCaretPlace(HDC   hDC, 
  40.    LPSTR szBuff, 
  41.    int   cbLen, 
  42.    int   x, 
  43.    int   y, 
  44.    int   FAR* lpDx,
  45.    int   nBegin,    // = nPrevWord + 1
  46.    int   nEnd,
  47.    int   nCharType);
  48. DWORD GetEngLishCaretPlace(HDC   hDC, 
  49.    LPSTR szBuff,
  50. int   x,
  51. int   y,
  52. int   FAR* lpDx,
  53. int   nBegin,    // = nPrevWord + 1
  54. int   nEnd,
  55. int   TempPlace,
  56. int   turnto);
  57. int GetHZBeginPlace(LPSTR lpszHzBuff, int nBegin, int nEnd, LPRECT StringRect);
  58. void AddToTotalWord(LPSTR szBuff, 
  59. int   cbLen, 
  60. int   nBegin,
  61. int   nEnd,
  62. int   nCharType,
  63. RECT  StringRect,
  64. BOOL  bInCurWord);
  65. BOOL CalcCaretInThisPlace(int CaretX, int nPlace);
  66. // deal with memdc string.
  67. #define MEMDC_TOTALWORD -1
  68. void AddToTextOutBuffer(HDC hMemDC, LPSTR szBuff, int cbLen, int x, int y, int FAR* lpDx);
  69. void GetMemWordStringRect(int nWordCode, int nOffset, LPRECT lpStringRect);
  70. void CheckMemDCWordBuffer(HDC hdcSrc);
  71. DWORD CheckMouseInMemDCWord(int nWordCode);
  72. DWORD CalculateCaretPlaceInMemDCWord(int nWordCode);
  73. #endif