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.

516 lines
20 KiB

  1. /*
  2. * @doc
  3. *
  4. * @module _RANGE.H -- CTxtRange Class |
  5. *
  6. * This class implements the internal text range and the TOM ITextRange
  7. *
  8. * Authors: <nl>
  9. * Original RichEdit code: David R. Fulmer
  10. * Christian Fortini
  11. * Murray Sargent
  12. * Alex Gounares (floating ranges, etc.)
  13. *
  14. * Copyright (c) 1995-2000, Microsoft Corporation. All rights reserved.
  15. */
  16. #ifndef _RANGE_H
  17. #define _RANGE_H
  18. #include "_text.h"
  19. #include "_m_undo.h"
  20. #include "_rtext.h"
  21. #include "_edit.h"
  22. #include "_uspi.h"
  23. long FPPTS_TO_TWIPS(float x);
  24. #define TWIPS_TO_FPPTS(x) (((float)(x)) * (float)0.05)
  25. class CTxtEdit;
  26. class CTxtFont;
  27. /*
  28. * SELRR
  29. *
  30. * @enum flags used to control how ReplaceRange (RR) should generate
  31. * selection anti-events
  32. */
  33. enum SELRR
  34. {
  35. SELRR_IGNORE = 0,
  36. SELRR_REMEMBERRANGE = 1,
  37. SELRR_REMEMBERCPMIN = 2,
  38. SELRR_REMEMBERENDIP = 3
  39. };
  40. /*
  41. * FINDWORD_TYPE
  42. *
  43. * @enum defines the different cases for finding a word
  44. */
  45. enum FINDWORD_TYPE {
  46. FW_EXACT = 1, //@emem Finds the word exactly (no extra chars)
  47. FW_INCLUDE_TRAILING_WHITESPACE = 2, //@emem find the word plus the
  48. // following whitespace (ala double-clicking)
  49. };
  50. enum MOVES
  51. {
  52. MOVE_START = -1,
  53. MOVE_IP = 0,
  54. MOVE_END = 1,
  55. };
  56. enum MATCHES
  57. {
  58. MATCH_UNTIL = 0,
  59. MATCH_WHILE = 1
  60. };
  61. enum EOPADJUST
  62. {
  63. NONEWCHARS = 0,
  64. NEWCHARS = 1
  65. };
  66. enum PROTECT
  67. {
  68. PROTECTED_YES,
  69. PROTECTED_NO,
  70. PROTECTED_ASK
  71. };
  72. enum CHECKPROTECT
  73. {
  74. CHKPROT_BACKWARD = -1,
  75. CHKPROT_EITHER,
  76. CHKPROT_FORWARD,
  77. CHKPROT_TOM
  78. };
  79. // Substring's input flags
  80. #define SUBSTR_INSPANCHARSET 1
  81. #define SUBSTR_INSPANBLOCK 2
  82. // Substring's output charflags
  83. #define SUBSTR_OUTCCLTR 1
  84. #define SUBSTR_OUTCCRTL 2
  85. enum CSCONTROL
  86. {
  87. CSC_NORMAL,
  88. CSC_SNAPTOCLUSTER,
  89. CSC_NOMULTICHARBACKUP
  90. };
  91. class CCharFlags
  92. {
  93. public:
  94. BYTE _bFirstStrong; // flag for first strong character
  95. BYTE _bContaining; // flags for all presented characters
  96. };
  97. #define SCF_IGNORESELAE 0x80000000
  98. #define SCF_IGNORENOTIFY 0x40000000 // use it with real caution! Caller must do it itself.
  99. /*
  100. * CTxtRange
  101. *
  102. * @class
  103. * The CTxtRange class implements RichEdit's text range, which is the
  104. * main conduit through which changes are made to the document.
  105. * The range inherits from the rich-text ptr, adding a signed length
  106. * insertion-point char-format index, and a ref count for use when
  107. * instantiated as a TOM ITextRange. The range object also contains
  108. * a flag that reveals whether the range is a selection (with associated
  109. * screen behavior) or just a simple range. This distinction is used
  110. * to simplify some of the code.
  111. *
  112. * Some methods are virtual to allow CTxtSelection objects to facilitate
  113. * UI features and selection updating.
  114. *
  115. * See tom.doc for lots of discussion on range and selection objects and
  116. * on all methods in ITextRange, ITextSelection, ITextFont, and ITextPara.
  117. */
  118. class CTxtRange : public ITextSelection, public CRchTxtPtr
  119. {
  120. friend CTxtFont;
  121. //@access Protected Data
  122. protected:
  123. LONG _cch; //@cmember # chars in range. _cch > 0 for active
  124. // end at range end (cpMost)
  125. LONG _cRefs; //@cmember ITextRange/ITextSelection ref count
  126. short _iFormat; //@cmember Character format for degenerate range
  127. union
  128. {
  129. WORD _wFlags; // All together now
  130. struct
  131. {
  132. WORD _nSelExpandLevel:4;//@cmember Table level to expand to
  133. WORD _fSel :1; //@cmember True iff this is a CTxtSelection
  134. WORD _fDragProtection :1; //@cmember True is this range should think
  135. // it's protected. Set by drag/drop code
  136. WORD _fDontUpdateFmt:1;//@cmember Don't update _iFormat
  137. WORD _fDualFontMode:1; //@cmember Set during dual font mode
  138. WORD _fUseiFormat:1; //@cmember Use iFormat when replacing
  139. // a non-degenerate range
  140. WORD _fMoveBack:1; //@cmember TRUE if last change moved backward
  141. WORD _fSelHasEOP:1; //@cmember TRUE if Sel has EOP
  142. WORD _fSelExpandCell:1;//@cmember TRUE if Sel has CELL but no TRDs at level
  143. WORD _fUseBackwardPFFmt:1; //@cmember Use backward PF format
  144. };
  145. };
  146. //@access Public methods
  147. public:
  148. #ifdef DEBUG
  149. BOOL Invariant( void ) const;
  150. BOOL IsOneEndUnHidden() const;
  151. #endif // DEBUG
  152. CTxtRange(const CTxtRange &rg);
  153. CTxtRange(CTxtEdit *ped, LONG cp = 0, LONG cch = 0);
  154. CTxtRange(CRchTxtPtr &rtp, LONG cch = 0);
  155. virtual ~CTxtRange();
  156. virtual CRchTxtPtr& operator =(const CRchTxtPtr &rtp);
  157. virtual CTxtRange& operator =(const CTxtRange &rg);
  158. // ITxNotify methods
  159. //@cmember Handles notifications
  160. virtual void OnPreReplaceRange( // prior to ReplaceRange calls
  161. LONG cp, LONG cchDel, LONG cchNew,
  162. LONG cpFormatMin, LONG cpFormatMax, NOTIFY_DATA *pNotifyData);
  163. //@cmember Handles notifications for
  164. virtual void OnPostReplaceRange( // floating range and display updates
  165. LONG cp, LONG cchDel, LONG cchNew,
  166. LONG cpFormatMin, LONG cpFormatMax, NOTIFY_DATA *pNotifyData);
  167. virtual void Zombie(); //@cmember Convert range into zombie
  168. void SetIgnoreFormatUpdate(BOOL fUpdate) { _fDontUpdateFmt = fUpdate; }
  169. void SetDualFontMode(BOOL fDualFontMode) {_fDualFontMode = fDualFontMode; }
  170. // Internal cp/cch methods
  171. LONG GetCch (void) const //@cmember Get signed character count
  172. {return _cch;}
  173. BOOL IsSel() {return _fSel;}
  174. BOOL fExpandCell() const {return _fSelExpandCell;}
  175. BOOL fHasEOP() const {return _fSelHasEOP;}
  176. BOOL CpInRange (LONG cp) const; //@cmember Says if cp is in this range
  177. //@cmember Says if cch chars can fit
  178. BOOL CheckTextLength (LONG cch, LONG *pcch = NULL);
  179. //@cmember Used after _cp change to set
  180. LONG CheckChange(LONG cpSave, BOOL fExtend);// selection-changed flag, choose _cch
  181. //@cmember In outline mode, maintain _fSelHasEOP
  182. BOOL CheckIfSelHasEOP(LONG cpSave, LONG cchSave, BOOL fDoRange = FALSE);
  183. void CalcTableExpandParms(); //@cmember Calculate table Expand members
  184. //@cmember Insert table row
  185. LONG InsertTableRow(const CParaFormat *pPF, IUndoBuilder *publdr);
  186. //@cmember TRUE for valid sequence
  187. BOOL IsInputSequenceValid(WCHAR* pwch, LONG cch, BOOL fOver, BOOL* pfBaseChar = NULL);
  188. // GetRange() is faster than calling GetCpMin() and GetCpMost();
  189. LONG GetCpMin () const; //@cmember Get cp of first char in range
  190. LONG GetCpMost () const; //@cmember Get cp just beyond last char in range
  191. //@cmember Get range ends and count
  192. LONG GetRange (LONG& cpMin, LONG& cpMost) const;
  193. BOOL Set(LONG cp, LONG cch);
  194. LONG SetCp(LONG cp, BOOL fExtend);
  195. LONG GetAdjustedTextLength() const
  196. {return GetPed()->GetAdjustedTextLength();}
  197. // Range specific methods
  198. LONG Move(LONG cch, BOOL fExtend);
  199. void Collapser(long fStart);
  200. void FlipRange();
  201. LONG CleanseAndReplaceRange (LONG cchS, WCHAR const *pchS, BOOL fTestLimit,
  202. IUndoBuilder *publdr, WCHAR *pchD = NULL, LONG* pcchMove = NULL, DWORD dwFlags = 0);
  203. LONG CheckLimitReplaceRange (LONG cch, WCHAR const *pch,
  204. BOOL fTestLimit, IUndoBuilder *publdr, QWORD qwCharFlags,
  205. LONG *pcchMove, LONG cpFirst, int iMatchCurrent, DWORD &dwFlags);
  206. HRESULT HexToUnicode (IUndoBuilder *publdr);
  207. HRESULT UnicodeToHex (IUndoBuilder *publdr);
  208. void Delete(IUndoBuilder *publdr, SELRR selaemode);
  209. void DeleteTerminatingEOP(IUndoBuilder *publdr);
  210. BOOL BypassHiddenText(LONG iDir, BOOL fExtend);
  211. void CheckMergedCells(IUndoBuilder *publdr);
  212. void CheckTopCells(IUndoBuilder *publdr);
  213. static BOOL CheckCells(CELLPARMS *prgCellParms, const CParaFormat * pPF1,
  214. const CParaFormat *pPF0, DWORD dwMaskCell, DWORD dwMaskCellAssoc);
  215. BOOL AdjustEndEOP (EOPADJUST NewChars);
  216. // Outline management
  217. void CheckOutlineLevel(IUndoBuilder *publdr);
  218. HRESULT ExpandOutline (LONG Level, BOOL fWholeDocument);
  219. HRESULT OutlineExpander(LONG Level, BOOL fWholeDocument);
  220. HRESULT Promote (LPARAM lparam, IUndoBuilder *publdr);
  221. // ReplaceRange must be virtual since the callers of
  222. // CLightDTEngine::CutRangeToClipboard() cast CTxtSelection* to CTxtRange*
  223. virtual LONG DeleteWithTRDCheck(IUndoBuilder *publdr, SELRR selaemode,
  224. LONG *pcchMove, DWORD dwFlags);
  225. virtual LONG ReplaceRange(LONG cchNew, TCHAR const *pch, IUndoBuilder *publdr,
  226. SELRR selaemode, LONG *pcchMove = NULL, DWORD dwFlags = 0);
  227. virtual BOOL Update(BOOL fScrollIntoView);
  228. // Rich-text methods
  229. // Get/Set Char/Para Format methods
  230. void Update_iFormat(LONG iFmtDefault);
  231. QWORD GetCharRepMask(BOOL fUseDocFormat = FALSE); //@cmember Get range charset mask
  232. LONG Get_iCF(); //@cmember Get range CF index
  233. LONG Get_iFormat() {return _iFormat;}//@cmember Get _iFormat for quick peek
  234. LONG GetiFormat() const;
  235. BOOL Set_iCF(LONG iFormat); //@cmember Set range CF index
  236. PROTECT IsProtected(CHECKPROTECT chkprot); //@cmember Is range protected?
  237. BOOL IsZombie() {return !GetPed();} //@cmember Is range zombied?
  238. BOOL IsHidden();
  239. BOOL WriteAccessDenied ();
  240. DWORD GetCharFormat(CCharFormat *pCF, DWORD flags = 0) const;
  241. DWORD GetParaFormat(CParaFormat *pPF, DWORD dwMask2) const;
  242. void SetDragProtection(BOOL fSet) // Convinces range it's protected
  243. {_fDragProtection = fSet;} // w/o modifying backing store
  244. HRESULT CharFormatSetter (const CCharFormat *pCF, DWORD dwMask, DWORD dwMask2 = 0);
  245. HRESULT ParaFormatSetter (const CParaFormat *pPF, DWORD dwMask);
  246. HRESULT SetCharFormat(const CCharFormat *pCF, DWORD flags,
  247. IUndoBuilder *publdr, DWORD dwMask, DWORD dwMask2);
  248. HRESULT SetParaFormat(const CParaFormat *pPF,
  249. IUndoBuilder *publdr, DWORD dwMask, DWORD dwMask2);
  250. HRESULT SetParaStyle (const CParaFormat *pPF,
  251. IUndoBuilder *publdr, DWORD dwMask);
  252. void SetCellParms(CELLPARMS *prgCellParms, LONG cCell, BOOL fConvertLowCells, IUndoBuilder *publdr);
  253. //@cmember Format range CharSets
  254. // Complex script feature :- Itemization
  255. BOOL ItemizeRuns(IUndoBuilder *publdr, BOOL fUnicodeBiDi = FALSE, BOOL fUseCtxLevel = FALSE);
  256. #ifndef NOCOMPLEXSCRIPTS
  257. HRESULT BiDiLevelFromFSM (const CBiDiFSM* pfsm);
  258. #endif
  259. LONG GetRunsPF (CRchTxtPtr* prtp, CFormatRunPtr* prpPF, LONG& cchLeft);
  260. #if defined(DEBUG) && !defined(NOFULLDEBUG)
  261. void DebugFont (void);
  262. #endif
  263. // Find enclosing unit methods
  264. HRESULT Expander (long Unit, BOOL fExtend, LONG *pDelta,
  265. LONG *pcpMin, LONG *pcpMost);
  266. void FindAttributes (LONG *pcpMin, LONG *pcpMost, LONG Unit) const;
  267. void FindCell (LONG *pcpMin, LONG *pcpMost) const;
  268. BOOL FindObject (LONG *pcpMin, LONG *pcpMost) const;
  269. void FindParagraph (LONG *pcpMin, LONG *pcpMost) const;
  270. void FindRow (LONG *pcpMin, LONG *pcpMost, LONG Level = -1) const;
  271. void FindSentence (LONG *pcpMin, LONG *pcpMost) const;
  272. BOOL FindVisibleRange(LONG *pcpMin, LONG *pcpMost) const;
  273. void FindWord (LONG *pcpMin, LONG *pcpMost,
  274. FINDWORD_TYPE type)const;
  275. LONG CountCells (LONG &cCell, LONG cchMax);
  276. LONG AdvanceCRLF(CSCONTROL csc, BOOL fExtend);
  277. LONG BackupCRLF (CSCONTROL csc, BOOL fExtend);
  278. BOOL AdjustCRLF (LONG iDir);
  279. LONG FindWordBreak(INT action, BOOL fExtend);
  280. BOOL CheckTableSelection(BOOL fUpdate, BOOL fEnableExpandCell,
  281. BOOL *pfTRDsInvolved, DWORD dwFlags);
  282. BOOL CheckLinkProtection(DWORD &dwFlags, LONG &iFormat);
  283. void SetUseiFormat(BOOL fUseiFormat) {_fUseiFormat = fUseiFormat;}
  284. // IUnknown methods
  285. STDMETHODIMP QueryInterface(REFIID riid, LPVOID * ppvObj);
  286. STDMETHOD_(ULONG, AddRef)();
  287. STDMETHOD_(ULONG, Release)();
  288. // IDispatch methods
  289. STDMETHODIMP GetTypeInfoCount(UINT * pctinfo);
  290. STDMETHODIMP GetTypeInfo(UINT itinfo, LCID lcid, ITypeInfo ** pptinfo);
  291. STDMETHODIMP GetIDsOfNames(REFIID riid, OLECHAR ** rgszNames, UINT cNames,
  292. LCID lcid, DISPID * rgdispid) ;
  293. STDMETHODIMP Invoke(DISPID dispidMember, REFIID riid, LCID lcid, WORD wFlags,
  294. DISPPARAMS * pdispparams, VARIANT * pvarResult,
  295. EXCEPINFO * pexcepinfo, UINT * puArgErr) ;
  296. // ITextRange methods
  297. STDMETHODIMP GetText (BSTR *pbstr);
  298. STDMETHODIMP SetText (BSTR bstr);
  299. STDMETHODIMP GetChar (long *pch);
  300. STDMETHODIMP SetChar (long ch);
  301. STDMETHODIMP GetDuplicate (ITextRange **ppRange);
  302. STDMETHODIMP GetFormattedText (ITextRange **ppRange);
  303. STDMETHODIMP SetFormattedText (ITextRange *pRange);
  304. STDMETHODIMP GetStart (long *pcpFirst);
  305. STDMETHODIMP SetStart (long cpFirst);
  306. STDMETHODIMP GetEnd (long *pcpLim);
  307. STDMETHODIMP SetEnd (long cpLim);
  308. STDMETHODIMP GetFont (ITextFont **pFont);
  309. STDMETHODIMP SetFont (ITextFont *pFont);
  310. STDMETHODIMP GetPara (ITextPara **pPara);
  311. STDMETHODIMP SetPara (ITextPara *pPara);
  312. STDMETHODIMP GetStoryLength (long *pcch);
  313. STDMETHODIMP GetStoryType (long *pValue);
  314. STDMETHODIMP Collapse (long bStart);
  315. STDMETHODIMP Expand (long Unit, long *pDelta);
  316. STDMETHODIMP GetIndex (long Unit, long *pIndex);
  317. STDMETHODIMP SetIndex (long Unit, long Index, long Extend);
  318. STDMETHODIMP SetRange (long cpActive, long cpOther);
  319. STDMETHODIMP InRange (ITextRange * pRange, long *pb);
  320. STDMETHODIMP InStory (ITextRange * pRange, long *pb);
  321. STDMETHODIMP IsEqual (ITextRange * pRange, long *pb);
  322. STDMETHODIMP Select ();
  323. STDMETHODIMP StartOf (long Unit, long Extend, long * pDelta);
  324. STDMETHODIMP EndOf (long Unit, long Extend, long * pDelta);
  325. STDMETHODIMP Move (long Unit, long Count, long * pDelta);
  326. STDMETHODIMP MoveStart (long Unit, long Count, long * pDelta);
  327. STDMETHODIMP MoveEnd (long Unit, long Count, long * pDelta);
  328. STDMETHODIMP MoveWhile (VARIANT * Cset, long Count, long * pDelta);
  329. STDMETHODIMP MoveStartWhile (VARIANT * Cset, long Count, long * pDelta);
  330. STDMETHODIMP MoveEndWhile (VARIANT * Cset, long Count, long * pDelta);
  331. STDMETHODIMP MoveUntil (VARIANT FAR* Cset, long Count, long * pDelta);
  332. STDMETHODIMP MoveStartUntil (VARIANT * Cset, long Count, long * pDelta);
  333. STDMETHODIMP MoveEndUntil (VARIANT * Cset, long Count, long * pDelta);
  334. STDMETHODIMP FindText (BSTR bstr, long cch, long Flags, long * pLength);
  335. STDMETHODIMP FindTextStart (BSTR bstr, long cch, long Flags, long * pLength);
  336. STDMETHODIMP FindTextEnd (BSTR bstr, long cch, long Flags, long * pLength);
  337. STDMETHODIMP Delete (long Unit, long Count, long * pDelta);
  338. STDMETHODIMP Cut (VARIANT * ppIDataObject);
  339. STDMETHODIMP Copy (VARIANT * ppIDataObject);
  340. STDMETHODIMP Paste (VARIANT * pIDataObject, long Format);
  341. STDMETHODIMP CanPaste (VARIANT * pIDataObject, long Format, long * pb);
  342. STDMETHODIMP CanEdit (long * pbCanEdit);
  343. STDMETHODIMP ChangeCase (long Type);
  344. STDMETHODIMP GetPoint (long Type, long * px, long * py);
  345. STDMETHODIMP SetPoint (long x, long y, long Type, long Extend);
  346. STDMETHODIMP ScrollIntoView (long Value);
  347. STDMETHODIMP GetEmbeddedObject (IUnknown ** ppv);
  348. // ITextSelection methods
  349. STDMETHODIMP GetFlags (long * pFlags) ;
  350. STDMETHODIMP SetFlags (long Flags) ;
  351. STDMETHODIMP GetType (long * pType) ;
  352. STDMETHODIMP MoveLeft (long Unit, long Count, long Extend,
  353. long *pDelta) ;
  354. STDMETHODIMP MoveRight(long pUnit, long Count, long Extend,
  355. long *pDelta) ;
  356. STDMETHODIMP MoveUp (long pUnit, long Count, long Extend,
  357. long *pDelta) ;
  358. STDMETHODIMP MoveDown (long pUnit, long Count, long Extend,
  359. long *pDelta) ;
  360. STDMETHODIMP HomeKey (long pUnit, long Extend, long *pDelta) ;
  361. STDMETHODIMP EndKey (long pUnit, long Extend, long *pDelta) ;
  362. STDMETHODIMP TypeText (BSTR bstr) ;
  363. //@access Private ITextRange helper methods
  364. private:
  365. void RangeValidateCp (LONG cp, LONG cch);
  366. LONG Comparer (ITextRange * pv);
  367. LONG SpanSubstring (CUniscribe* pusp, CFormatRunPtr* pcrp, WCHAR* pwchString,
  368. LONG cchString, WORD& uSubStrLevel, DWORD dwInFlags, CCharFlags* pCharflags,
  369. WORD& wBiDiLangId);
  370. HRESULT EndSetter(LONG cp, BOOL fOther);
  371. HRESULT Finder (BSTR bstr, long Count, long Flags, LONG *pDelta,
  372. MOVES Mode);
  373. HRESULT GetLong (LONG lValue, long *pLong);
  374. HRESULT IsTrue (BOOL f, long *pB);
  375. HRESULT Matcher (VARIANT *Cset, long Count, LONG *pDelta, MOVES Mode,
  376. MATCHES Match);
  377. HRESULT Mover (long Unit, long Count, LONG *pDelta, MOVES Mode);
  378. HRESULT Replacer (LONG cchNew, TCHAR const *pch, DWORD dwFlags = 0);
  379. LONG CalcTextLenNotInRange();
  380. };
  381. // Useful Unicode range definitions for use with MoveWhile/Until methods
  382. #define CodeRange(n, m) 0x8000000 | ((m) - (n)) << 16 | n
  383. #define CR_ASCII CodeRange(0x0, 0x7f)
  384. #define CR_ANSI CodeRange(0x0, 0xff)
  385. #define CR_ASCIIPrint CodeRange(0x20, 0x7e)
  386. #define CR_Latin1 CodeRange(0x20, 0xff)
  387. #define CR_Latin1Supp CodeRange(0xa0, 0xff)
  388. #define CR_LatinXA CodeRange(0x100, 0x17f)
  389. #define CR_LatinXB CodeRange(0x180, 0x24f)
  390. #define CR_IPAX CodeRange(0x250, 0x2af)
  391. #define CR_SpaceMod CodeRange(0x2b0, 0x2ff)
  392. #define CR_Combining CodeRange(0x300, 0x36f)
  393. #define CR_Greek CodeRange(0x370, 0x3ff)
  394. #define CR_BasicGreek CodeRange(0x370, 0x3cf)
  395. #define CR_GreekSymbols CodeRange(0x3d0, 0x3ff)
  396. #define CR_Cyrillic CodeRange(0x400, 0x4ff)
  397. #define CR_Armenian CodeRange(0x530, 0x58f)
  398. #define CR_Hebrew CodeRange(0x590, 0x5ff)
  399. #define CR_BasicHebrew CodeRange(0x5d0, 0x5ea)
  400. #define CR_HebrewXA CodeRange(0x590, 0x5cf)
  401. #define CR_HebrewXB CodeRange(0x5eb, 0x5ff)
  402. #define CR_Arabic CodeRange(0x600, 0x6ff)
  403. #define CR_BasicArabic CodeRange(0x600, 0x652)
  404. #define CR_ArabicX CodeRange(0x653, 0x6ff)
  405. #define CR_Devengari CodeRange(0x900, 0x97f)
  406. #define CR_Bengali CodeRange(0x980, 0x9ff)
  407. #define CR_Gurmukhi CodeRange(0xa00, 0xa7f)
  408. #define CR_Gujarati CodeRange(0xa80, 0xaff)
  409. #define CR_Oriya CodeRange(0xb00, 0xb7f)
  410. #define CR_Tamil CodeRange(0xb80, 0xbff)
  411. #define CR_Teluga CodeRange(0xc00, 0xc7f)
  412. #define CR_Kannada CodeRange(0xc80, 0xcff)
  413. #define CR_Malayalam CodeRange(0xd00, 0xd7f)
  414. #define CR_Thai CodeRange(0xe00, 0xe7f)
  415. #define CR_Lao CodeRange(0xe80, 0xeff)
  416. #define CR_GeorgianX CodeRange(0x10a0, 0xa0cf)
  417. #define CR_BascGeorgian CodeRange(0x10d0, 0x10ff)
  418. #define CR_Hanguljamo CodeRange(0x1100, 0x11ff)
  419. #define CR_LatinXAdd CodeRange(0x1e00, 0x1eff)
  420. #define CR_GreekX CodeRange(0x1f00, 0x1fff)
  421. #define CR_GenPunct CodeRange(0x2000, 0x206f)
  422. #define CR_SuperScript CodeRange(0x2070, 0x207f)
  423. #define CR_SubScript CodeRange(0x2080, 0x208f)
  424. #define CR_SubSuperScrp CodeRange(0x2070, 0x209f)
  425. #define CR_Currency CodeRange(0x20a0, 0x20cf)
  426. #define CR_CombMarkSym CodeRange(0x20d0, 0x20ff)
  427. #define CR_LetterLike CodeRange(0x2100, 0x214f)
  428. #define CR_NumberForms CodeRange(0x2150, 0x218f)
  429. #define CR_Arrows CodeRange(0x2190, 0x21ff)
  430. #define CR_MathOps CodeRange(0x2200, 0x22ff)
  431. #define CR_MiscTech CodeRange(0x2300, 0x23ff)
  432. #define CR_CtrlPictures CodeRange(0x2400, 0x243f)
  433. #define CR_OptCharRecog CodeRange(0x2440, 0x245f)
  434. #define CR_EnclAlphaNum CodeRange(0x2460, 0x24ff)
  435. #define CR_BoxDrawing CodeRange(0x2500, 0x257f)
  436. #define CR_BlockElement CodeRange(0x2580, 0x259f)
  437. #define CR_GeometShapes CodeRange(0x25a0, 0x25ff)
  438. #define CR_MiscSymbols CodeRange(0x2600, 0x26ff)
  439. #define CR_Dingbats CodeRange(0x2700, 0x27bf)
  440. #define CR_CJKSymPunct CodeRange(0x3000, 0x303f)
  441. #define CR_Hiragana CodeRange(0x3040, 0x309f)
  442. #define CR_Katakana CodeRange(0x30a0, 0x30ff)
  443. #define CR_Bopomofo CodeRange(0x3100, 0x312f)
  444. #define CR_HangulJamo CodeRange(0x3130, 0x318f)
  445. #define CR_CJLMisc CodeRange(0x3190, 0x319f)
  446. #define CR_EnclCJK CodeRange(0x3200, 0x32ff)
  447. #define CR_CJKCompatibl CodeRange(0x3300, 0x33ff)
  448. #define CR_Hangul CodeRange(0x3400, 0x3d2d)
  449. #define CR_HangulA CodeRange(0x3d2e, 0x44b7)
  450. #define CR_HangulB CodeRange(0x44b8, 0x4dff)
  451. #define CR_CJKIdeograph CodeRange(0x4e00, 0x9fff)
  452. #define CR_PrivateUse CodeRange(0xe000, 0xf800)
  453. #define CR_CJKCompIdeog CodeRange(0xf900, 0xfaff)
  454. #define CR_AlphaPres CodeRange(0xfb00, 0xfb4f)
  455. #define CR_ArabicPresA CodeRange(0xfb50, 0xfdff)
  456. #define CR_CombHalfMark CodeRange(0xfe20, 0xfe2f)
  457. #define CR_CJKCompForm CodeRange(0xfe30, 0xfe4f)
  458. #define CR_SmallFormVar CodeRange(0xfe50, 0xfe6f)
  459. #define CR_ArabicPresB CodeRange(0xfe70, 0xfefe)
  460. #define CR_HalfFullForm CodeRange(0xff00, 0xffef)
  461. #define CR_Specials CodeRange(0xfff0, 0xfffd)
  462. #endif