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.

1524 lines
51 KiB

  1. /*
  2. * _w32sys.h
  3. *
  4. * Purpose:
  5. * Isolate various Win 32 system dependencies.
  6. *
  7. * Copyright (c) 1995-1997, Microsoft Corporation. All rights reserved.
  8. */
  9. #ifndef _W32SYS_H
  10. #define _W32SYS_H
  11. #if defined(PEGASUS)
  12. #if !defined(WINNT)
  13. #include "memory.h" // for memmove
  14. #endif
  15. struct IMESTYLE;
  16. struct IMECOLORSTY;
  17. struct CIMEShare;
  18. #define NOACCESSIBILITY // No Accessibility support on Win CE
  19. #define NOMAGELLAN // No Magellan on Win CE
  20. #define NODROPFILES // No drop files support on Win CE
  21. #define NOMETAFILES // No metafiles on Win CE
  22. #define NOPEDDUMP // No support for ped debug dump on CE
  23. #define NOFONTSUBINFO // Avoid reading fontsubinfo profile on CE
  24. #define CONVERT2BPP
  25. #define NODUMPFORMATRUNS
  26. #define NOMLKEYBOARD
  27. #define dxCaret 2 // caret width
  28. #define FONTCACHESIZE 8
  29. #define CCSHASHSEARCHSIZE 15
  30. #define DEFAULT_UNDO_SIZE 20
  31. #define NUMPASTECHARSWAITCURSOR 1024
  32. #else //!PEGASUS
  33. #define dxCaret 1 // caret width
  34. #define FONTCACHESIZE 24
  35. #define CCSHASHSEARCHSIZE 31
  36. #define DEFAULT_UNDO_SIZE 100
  37. #define NUMPASTECHARSWAITCURSOR (1024*32)
  38. #define OBSOLETE // need this to get old IMEShare defines
  39. #include "imeshare.h"
  40. #endif // defined(PEGASUS)
  41. #ifndef NOLINESERVICES
  42. #define LINESERVICES
  43. #endif
  44. #define RSHIFT 1
  45. #define LSHIFT 2
  46. #define RCTRL 0x10
  47. #define LCTRL 0x20
  48. #define RALT 0x40
  49. #define LALT 0x80
  50. #define SHIFT (RSHIFT + LSHIFT)
  51. #define ALT (RALT + LALT)
  52. #define CTRL (RCTRL + LCTRL)
  53. #define HOTEURO 0x1000
  54. #define ALT0 0x2000
  55. #define ALTNUMPAD 0x4000
  56. #define LETAFTERSHIFT 0x8000
  57. // special virtual keys copied from Japan MSVC ime.h
  58. #define VK_KANA 0x15
  59. #define VK_KANJI 0x19
  60. // Initialization flags that can be used in system.ini for testing purposes
  61. #define SYSINI_USELS 0x1
  62. #define SYSINI_BIDI 0x2
  63. #define SYSINI_USEAIMM 0x4
  64. #define SYSINI_DEBUGFONT 0x8
  65. #define SYSINI_DEBUGGCF125X 0x10
  66. /*
  67. * GetCaretDelta ()
  68. *
  69. * @func Get size of caret to add to current caret position to get the
  70. * maximum extent needed to display caret.
  71. *
  72. * @rdesc Size of caret over 1 pixel
  73. *
  74. * @devnote This exists solely to abstract this calculation
  75. * to handle a variable size caret.
  76. */
  77. inline int GetCaretDelta()
  78. {
  79. return dxCaret - 1;
  80. }
  81. // Used in rtfread.cpp to keep track of lossy rtf.
  82. #ifdef PWORD_CONVERTER_V2
  83. #define REPORT_LOSSAGE
  84. #endif
  85. // Defines for some Codepages
  86. #define CP_JAPAN 932
  87. #define CP_KOREAN 949
  88. #define CP_CHINESE_TRAD 950
  89. #define CP_CHINESE_SIM 936
  90. #define CP_HEBREW 1255
  91. #define CP_ARABIC 1256
  92. #define CP_THAI 874
  93. #define CP_VIETNAMESE 1258
  94. // Indic codepages from NT50
  95. #define CP_DEVANAGARI 57002
  96. #define CP_BENGALI 57003
  97. #define CP_TAMIL 57004
  98. #define CP_TELUGU 57005
  99. #define CP_ASSAMESE 57006
  100. #define CP_ORIYA 57007
  101. #define CP_KANNADA 57008
  102. #define CP_MALAYALAM 57009
  103. #define CP_GUJARATI 57010
  104. #define CP_PUNJABI 57011
  105. // Ad hoc codepages to keep rgCpgCharSet unique
  106. #define CP_GEORGIAN 58000
  107. #define CP_ARMENIAN 58001
  108. // Newly introduced Indic language ID
  109. #if(WINVER < 0x500)
  110. #define LANG_HINDI 0x39
  111. #define LANG_KONKANI 0x57
  112. #define LANG_NEPALI 0x61
  113. #define LANG_BENGALI 0x45
  114. #define LANG_PUNJABI 0x46
  115. #define LANG_GUJARATHI 0x47
  116. #define LANG_ORIYA 0x48
  117. #define LANG_TAMIL 0x49
  118. #define LANG_TELUGU 0x4a
  119. #define LANG_KANNADA 0x4b
  120. #define LANG_MALAYALAM 0x4c
  121. #define LANG_ASSAMESE 0x4d
  122. #define LANG_MARATHI 0x4e
  123. #define LANG_SANSKRIT 0x4f
  124. #endif
  125. // Index returned by CharSetIndexFromChar()
  126. #define FE_FLAG 0x10000
  127. #define MULTIPLE_FLAG 0x80000000 // Sign bit
  128. #define FE_INDEX FE_FLAG + MULTIPLE_FLAG
  129. #define ANSI_INDEX 0
  130. #define ARABIC_INDEX 7
  131. #define GREEK_INDEX 14
  132. #define HAN_INDEX FE_INDEX + 1
  133. #define HANGUL_INDEX FE_FLAG + 11
  134. #define HEBREW_INDEX 6
  135. #define RUSSIAN_INDEX 9
  136. #define SHIFTJIS_INDEX FE_FLAG + 8
  137. #define VIET_INDEX 17
  138. #define THAI_INDEX 18
  139. #define DEVANAGARI_INDEX 19
  140. #define TAMIL_INDEX 20
  141. #define GEORGIAN_INDEX 21
  142. #define ARMENIAN_INDEX 22
  143. #define INDIC_FIRSTINDEX DEVANAGARI_INDEX
  144. #define INDIC_LASTINDEX ARMENIAN_INDEX
  145. #define UNKNOWN_INDEX MULTIPLE_FLAG + 1
  146. #define PC437_CHARSET 254
  147. #define DEVANAGARI_CHARSET 127
  148. #define TAMIL_CHARSET 126
  149. #define GEORGIAN_CHARSET 125
  150. #define ARMENIAN_CHARSET 124
  151. #define ADHOC_CHARSET 120
  152. // controls the size of two charset tables.
  153. #define NCHARSETS 24
  154. #define IsSymbolOrOEM(x) (x == SYMBOL_CHARSET || x == OEM_CHARSET)
  155. enum CC
  156. {
  157. CC_ARABIC,
  158. CC_HEBREW,
  159. CC_RTL,
  160. CC_LTR,
  161. CC_EOP,
  162. CC_ASCIIDIGIT,
  163. CC_NEUTRAL
  164. };
  165. #define IsRTL(cc) (cc <= CC_RTL)
  166. const SHORT sLanguageEnglishUS = 0x0409;
  167. const SHORT sLanguageMask = 0x03ff;
  168. const SHORT sLanguageArabic = 0x0401;
  169. const SHORT sLanguageHebrew = 0x040d;
  170. // FUTURE: currently this const == sLanguageEnglishUS
  171. // for no reason except that it was this way
  172. // in RE1.0 BiDi. Consider changing, or sticking
  173. // the real language in, and changing the logic
  174. // of handling wLang a bit.
  175. const SHORT sLanguageNonBiDi = 0x0409;
  176. // Logical unit definition
  177. const int LX_PER_INCH = 1440;
  178. const int LY_PER_INCH = 1440;
  179. // HIMETRIC units per inch (used for conversion)
  180. const int HIMETRIC_PER_INCH = 2540;
  181. #ifdef DEBUG
  182. void* __cdecl operator new(size_t nSize, char *szFile, int nLine);
  183. #define NEW_DEBUG new(__FILE__, __LINE__)
  184. #define new NEW_DEBUG
  185. void UpdateMst(void);
  186. struct MST
  187. {
  188. char *szFile;
  189. int cbAlloc;
  190. }; //Memory Statistics;
  191. extern MST vrgmst[];
  192. #endif //DEBUG
  193. #ifdef CopyMemory
  194. #undef CopyMemory
  195. #endif
  196. #ifdef MoveMemory
  197. #undef MoveMemory
  198. #endif
  199. #ifdef FillMemory
  200. #undef FillMemory
  201. #endif
  202. #ifdef ZeroMemory
  203. #undef ZeroMemory
  204. #endif
  205. #ifdef CompareMemory
  206. #undef CompareMemory
  207. #endif
  208. #ifndef KF_ALTDOWN
  209. #define KF_ALTDOWN 0x2000
  210. #endif
  211. // Use for our version of ExtTextOut
  212. enum CONVERTMODE
  213. {
  214. CVT_NONE, // Use Unicode (W) CharWidth/TextOut APIs
  215. CVT_WCTMB, // Convert to MBCS using WCTMB and _wCodePage
  216. CVT_LOWBYTE // Use low byte of 16-bit chars (for SYMBOL_CHARSET
  217. }; // and when code page isn't installed)
  218. // Opaque Type
  219. class CTxtSelection;
  220. class CTxtEdit;
  221. class CCharFormat;
  222. class CCcs;
  223. enum UN_FLAGS
  224. {
  225. UN_NOOBJECTS = 1,
  226. UN_CONVERT_WCH_EMBEDDING = 2
  227. };
  228. #undef GetStringTypeEx
  229. #undef CharLower
  230. #undef CharLowerBuff
  231. #undef CharUpperBuff
  232. #undef CreateIC
  233. #undef CreateFile
  234. #undef CreateFontIndirect
  235. #undef CompareString
  236. #undef DefWindowProc
  237. #undef GetKeyboardLayout
  238. #undef GetProfileSection
  239. #undef GetTextMetrics
  240. #undef GetTextExtentPoint32
  241. #undef GetTextFace
  242. #undef GetWindowLong
  243. #undef GetWindowLongPtr
  244. #undef GetClassLong
  245. #undef LoadBitmap
  246. #undef LoadCursor
  247. #undef LoadLibrary
  248. #undef SendMessage
  249. #undef SetWindowLong
  250. #undef SetWindowLongPtr
  251. #undef PostMessage
  252. #undef lstrcmp
  253. #undef lstrcmpi
  254. #undef PeekMessage
  255. #undef GetModuleFileName
  256. #undef GetLayout
  257. #undef SetLayout
  258. // Bits used in _fFEFontInfo:
  259. #define JPN_FONT_AVAILABLE 0x0001 // True if Jpn font is available
  260. #define KOR_FONT_AVAILABLE 0x0002 // True if Kor font is available
  261. #define BIG5_FONT_AVAILABLE 0x0004 // True if Trad. Chinese font is available
  262. #define GB_FONT_AVAILABLE 0x0008 // True if Simplified Chinese font is available
  263. #define FEUSER_LCID 0x0010 // True if User LCID is FE LCID
  264. #define FEUSER_CODEPAGE 0x0060 // indicate which User FE codepage its
  265. #define FEUSER_CP_JPN 0x0000 // =00 for JPN
  266. #define FEUSER_CP_KOR 0x0020 // =20 for KOR
  267. #define FEUSER_CP_BIG5 0x0040 // =40 for BIG5
  268. #define FEUSER_CP_GB 0x0060 // =60 for GB
  269. #define FEDATA_NOT_INIT 0xFFFF // No data yet
  270. class CConvertStrW
  271. {
  272. public:
  273. operator WCHAR *();
  274. protected:
  275. CConvertStrW();
  276. ~CConvertStrW();
  277. void Free();
  278. LPWSTR _pwstr;
  279. WCHAR _awch[MAX_PATH * 2];
  280. };
  281. inline CConvertStrW::CConvertStrW()
  282. {
  283. _pwstr = NULL;
  284. }
  285. inline CConvertStrW::~CConvertStrW()
  286. {
  287. Free();
  288. }
  289. inline CConvertStrW::operator WCHAR *()
  290. {
  291. return _pwstr;
  292. }
  293. class CStrInW : public CConvertStrW
  294. {
  295. public:
  296. CStrInW(LPCSTR pstr);
  297. CStrInW(LPCSTR pstr, UINT uiCodePage);
  298. CStrInW(LPCSTR pstr, int cch, UINT uiCodePage);
  299. int strlen();
  300. protected:
  301. CStrInW();
  302. void Init(LPCSTR pstr, int cch, UINT uiCodePage);
  303. int _cwchLen;
  304. UINT _uiCodePage;
  305. };
  306. inline CStrInW::CStrInW()
  307. {
  308. }
  309. inline int CStrInW::strlen()
  310. {
  311. return _cwchLen;
  312. }
  313. typedef DWORD (WINAPI* PFN_GETLAYOUT)(HDC);
  314. typedef DWORD (WINAPI* PFN_SETLAYOUT)(HDC, DWORD);
  315. class CW32System
  316. {
  317. private :
  318. static DWORD _dwPlatformId; // platform GetVersionEx();
  319. static LCID _syslcid;
  320. public :
  321. static BOOL _fHaveIMMProcs;
  322. static CIMEShare *_pIMEShare;
  323. static BOOL _fHaveAIMM;
  324. static BOOL _fHaveIMMEShare;
  325. static UINT _fRegisteredXBox; // flag indicating if listbox and combobox were registered
  326. static DWORD _dwMajorVersion; // major version from GetVersionEx()
  327. static DWORD _dwMinorVersion; // minor version from GetVersionEx()
  328. static INT _icr3DDarkShadow; // value to use for COLOR_3DDKSHADOW
  329. static UINT _MSIMEMouseMsg; // private msg for support mouse operation
  330. static UINT _MSIMEReconvertMsg; // private msg for reconversion
  331. static UINT _MSIMEReconvertRequestMsg; // private msg for reconversion request
  332. static UINT _MSIMEDocFeedMsg; // private msg for document feed
  333. static UINT _MSIMEQueryPositionMsg; // private msg for query position
  334. static UINT _MSIMEServiceMsg; // private msg for checking MSIME98 or later
  335. static UINT _MSMouseRoller; // private msg for mouse scrolling
  336. // Misc flags used for more precise character classification
  337. static WORD _fFEFontInfo;
  338. static BOOL _fLRMorRLM;
  339. CW32System();
  340. ~CW32System();
  341. static DWORD AddRef();
  342. static DWORD Release();
  343. // Platform testing
  344. static bool OnWinNTFE()
  345. {
  346. return _dwPlatformId == VER_PLATFORM_WIN32_NT && IsFELCID(_syslcid );
  347. }
  348. static bool OnWinNTNonFE()
  349. {
  350. return _dwPlatformId == VER_PLATFORM_WIN32_NT && !IsFELCID(_syslcid );
  351. }
  352. static bool OnWinNT5()
  353. {
  354. return _dwPlatformId == VER_PLATFORM_WIN32_NT && 5 == _dwMajorVersion;
  355. }
  356. static bool OnWinNT4()
  357. {
  358. return _dwPlatformId == VER_PLATFORM_WIN32_NT && 4 == _dwMajorVersion;
  359. }
  360. static bool OnWin9xFE()
  361. {
  362. return _dwPlatformId == VER_PLATFORM_WIN32_WINDOWS && IsFELCID(_syslcid );
  363. }
  364. static bool OnWin9x()
  365. {
  366. return _dwPlatformId == VER_PLATFORM_WIN32_WINDOWS;
  367. }
  368. static bool OnWin95()
  369. {
  370. return OnWin9x() && (4 == _dwMajorVersion) && (0 == _dwMinorVersion);
  371. }
  372. static bool OnWin95FE()
  373. {
  374. return OnWin95() && IsFELCID(_syslcid );
  375. }
  376. static bool OnWin9xThai()
  377. {
  378. return _dwPlatformId == VER_PLATFORM_WIN32_WINDOWS && PRIMARYLANGID(_syslcid) == LANG_THAI;
  379. }
  380. static bool OnWin9xBiDi()
  381. {
  382. return _dwPlatformId == VER_PLATFORM_WIN32_WINDOWS && IsBiDiLcid(_syslcid);
  383. }
  384. static bool OnBiDiOS()
  385. {
  386. return IsBiDiLcid(_syslcid) != 0;
  387. }
  388. struct WM_CHAR_INFO
  389. {
  390. bool _fAccumulate;
  391. bool _fLeadByte;
  392. bool _fTrailByte;
  393. bool _fIMEChar;
  394. };
  395. static UINT GetACP() {return _ACP;}
  396. static LRESULT ANSIWndProc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, BOOL fIs10Mode );
  397. static void AnsiFilter( UINT &msg, WPARAM &wparam, LPARAM lparam, void *pvoid, BOOL fIs10Mode = FALSE );
  398. static HGLOBAL WINAPI GlobalAlloc( UINT uFlags, DWORD dwBytes );
  399. static HGLOBAL WINAPI GlobalFree( HGLOBAL hMem );
  400. static UINT WINAPI GlobalFlags( HGLOBAL hMem );
  401. static HGLOBAL WINAPI GlobalReAlloc( HGLOBAL hMem, DWORD dwBytes, UINT uFlags );
  402. static DWORD WINAPI GlobalSize( HGLOBAL hMem );
  403. static PVOID WINAPI GlobalLock( HGLOBAL hMem );
  404. static HGLOBAL WINAPI GlobalHandle( LPCVOID pMem );
  405. static BOOL WINAPI GlobalUnlock( HGLOBAL hMem );
  406. static void WINAPI REGetCharWidth(
  407. HDC hdc,
  408. TCHAR iChar,
  409. SHORT * pWidth,
  410. UINT uiCodePage,
  411. SHORT xOverhang, //@parm Equivalent to GetTextMetrics() tmOverhang.
  412. INT iDefWidth); //@parm Default width to use if font calc's zero
  413. //width. (Handles Win95 problem).
  414. static void WINAPI REExtTextOut(
  415. CONVERTMODE cm,
  416. UINT uiCodePage,
  417. HDC hdc,
  418. int x,
  419. int y,
  420. UINT fuOptions,
  421. CONST RECT *lprc,
  422. const WCHAR *lpString,
  423. UINT cch,
  424. CONST INT *lpDx,
  425. BOOL FEFontOnNonFEWin95);
  426. static CONVERTMODE WINAPI DetermineConvertMode( HDC hdc, BYTE tmCharSet );
  427. static void WINAPI CalcUnderlineInfo(HDC hdc, CCcs *pccs, TEXTMETRIC *ptm );
  428. static BOOL WINAPI EnableScrollBar( HWND hWnd, UINT wSBflags, UINT wArrows );
  429. static BOOL WINAPI ShowScrollBar( HWND hWnd, int wBar, BOOL bShow, LONG nMax );
  430. static BOOL WINAPI IsEnhancedMetafileDC( HDC hdc );
  431. static HPALETTE WINAPI ManagePalette(
  432. HDC hdc,
  433. CONST LOGPALETTE *plogpal,
  434. HPALETTE &hpalOld,
  435. HPALETTE &hpalNew
  436. );
  437. static void GetFacePriCharSet(HDC hdc, LOGFONT* plf);
  438. static int WINAPI GetMapMode(HDC hdc);
  439. static BOOL WINAPI WinLPtoDP(HDC hdc, LPPOINT lppoints, int nCount);
  440. static long WINAPI WvsprintfA(LONG cb, LPSTR szBuf, LPCSTR szFmt, va_list arglist);
  441. static int WINAPI MulDiv(int nNumber, int nNumerator, int nDenominator);
  442. // Convert Himetric along the X axis to X pixels
  443. static inline LONG HimetricXtoDX(LONG xHimetric, LONG xPerInch)
  444. {
  445. // This formula is rearranged to get rid of the need for floating point
  446. // arithmetic. The real way to understand the formula is to use
  447. // (xHimetric / HIMETRIC_PER_INCH) to get the inches and then multiply
  448. // the inches by the number of x pixels per inch to get the pixels.
  449. return (LONG) MulDiv(xHimetric, xPerInch, HIMETRIC_PER_INCH);
  450. }
  451. // Convert Himetric along the Y axis to Y pixels
  452. static inline LONG HimetricYtoDY(LONG yHimetric, LONG yPerInch)
  453. {
  454. // This formula is rearranged to get rid of the need for floating point
  455. // arithmetic. The real way to understand the formula is to use
  456. // (xHimetric / HIMETRIC_PER_INCH) to get the inches and then multiply
  457. // the inches by the number of y pixels per inch to get the pixels.
  458. return (LONG) MulDiv(yHimetric, yPerInch, HIMETRIC_PER_INCH);
  459. }
  460. // Convert Pixels on the X axis to Himetric
  461. static inline LONG DXtoHimetricX(LONG dx, LONG xPerInch)
  462. {
  463. // This formula is rearranged to get rid of the need for floating point
  464. // arithmetic. The real way to understand the formula is to use
  465. // (dx / x pixels per inch) to get the inches and then multiply
  466. // the inches by the number of himetric units per inch to get the
  467. // count of himetric units.
  468. return (LONG) MulDiv(dx, HIMETRIC_PER_INCH, xPerInch);
  469. }
  470. // Convert Pixels on the Y axis to Himetric
  471. static inline LONG DYtoHimetricY(LONG dy, LONG yPerInch)
  472. {
  473. // This formula is rearranged to get rid of the need for floating point
  474. // arithmetic. The real way to understand the formula is to use
  475. // (dy / y pixels per inch) to get the inches and then multiply
  476. // the inches by the number of himetric units per inch to get the
  477. // count of himetric units.
  478. return (LONG) MulDiv(dy, HIMETRIC_PER_INCH, yPerInch);
  479. }
  480. //
  481. // Case insensitive ASCII compare
  482. //
  483. static BOOL ASCIICompareI( const BYTE *pstr1, const BYTE *pstr2, int iCount )
  484. {
  485. int i;
  486. for (i = 0; i < iCount && !((pstr1[i] ^ pstr2[i]) & ~0x20); i++)
  487. ;
  488. return i == iCount;
  489. }
  490. //
  491. // Allocate and convert a MultiByte string to a wide character string
  492. // Allocated strings must be freed with delete
  493. //
  494. static WCHAR *ConvertToWideChar( const char *pstr )
  495. {
  496. int istrlen = 0;
  497. if(pstr)
  498. for (istrlen; pstr[istrlen]; istrlen++);
  499. WCHAR *pnew = new WCHAR[istrlen + 1];
  500. if(pnew && (!pstr || 0 != ::MultiByteToWideChar(
  501. CP_ACP, 0, pstr, -1, pnew, istrlen + 1)))
  502. {
  503. return pnew;
  504. }
  505. return NULL;
  506. }
  507. //
  508. // functions for memory and string management
  509. //
  510. #ifdef DEBUG
  511. static void PvSet(void *pv, char *szFile, int line);
  512. static PVOID PvAllocDebug(ULONG cbBuf, UINT uiMemFlags, char *szFile, int line);
  513. static PVOID PvReAllocDebug(PVOID pvBuf, DWORD cbBuf, char *szFile, int line);
  514. static void FreePvDebug(PVOID pvBuf);
  515. #endif
  516. static PVOID PvAlloc(ULONG cbBuf, UINT uiMemFlags);
  517. static PVOID PvReAlloc(PVOID pvBuf, DWORD cbBuf);
  518. static void FreePv(PVOID pvBuf);
  519. static inline void *MoveMemory(void *dst, const void *src, size_t cb)
  520. {
  521. Assert(cb >= 0);
  522. return memmove(dst, src, cb);
  523. }
  524. static inline void *CopyMemory(void *dst, const void *src, size_t cb)
  525. {
  526. // Will work for overlapping regions
  527. Assert(cb >= 0);
  528. return MoveMemory(dst, src, cb);
  529. }
  530. static inline void *FillMemory(void *dst, int fill, size_t cb)
  531. {
  532. return memset(dst, fill, cb);
  533. }
  534. static inline void *ZeroMemory(void *dst, size_t cb)
  535. {
  536. Assert(cb >= 0);
  537. return memset(dst, 0, cb);
  538. }
  539. static inline int CompareMemory(const void *s1, const void *s2, size_t cb)
  540. {
  541. return memcmp(s1, s2, cb);
  542. }
  543. static size_t wcslen(const wchar_t *wcs);
  544. static wchar_t * wcscpy(wchar_t * dst, const wchar_t * src);
  545. static int wcscmp(const wchar_t * src, const wchar_t * dst);
  546. static int wcsicmp(const wchar_t * src, const wchar_t * dst);
  547. static wchar_t * wcsncpy (wchar_t * dest, const wchar_t * source, size_t count);
  548. static int wcsnicmp(const wchar_t *first, const wchar_t *last, size_t count);
  549. static unsigned long strtoul(const char *);
  550. // ----------------------------------
  551. // IME Support
  552. // ----------------------------------
  553. static BOOL ImmInitialize( void );
  554. static void ImmTerminate( void );
  555. static LONG ImmGetCompositionStringA ( HIMC, DWORD, PVOID, DWORD, BOOL );
  556. static LONG ImmGetCompositionStringW ( HIMC, DWORD, PVOID, DWORD, BOOL );
  557. static HIMC ImmGetContext ( HWND );
  558. static BOOL ImmSetCompositionFontA ( HIMC, LPLOGFONTA, BOOL );
  559. static BOOL ImmSetCompositionWindow ( HIMC, LPCOMPOSITIONFORM, BOOL );
  560. static BOOL ImmReleaseContext ( HWND, HIMC );
  561. static DWORD ImmGetProperty ( HKL, DWORD, BOOL );
  562. static BOOL ImmGetCandidateWindow ( HIMC, DWORD, LPCANDIDATEFORM, BOOL );
  563. static BOOL ImmSetCandidateWindow ( HIMC, LPCANDIDATEFORM, BOOL );
  564. static BOOL ImmNotifyIME ( HIMC, DWORD, DWORD, DWORD, BOOL );
  565. static HIMC ImmAssociateContext ( HWND, HIMC, BOOL );
  566. static UINT ImmGetVirtualKey ( HWND, BOOL );
  567. static HIMC ImmEscape ( HKL, HIMC, UINT, PVOID, BOOL );
  568. static BOOL ImmGetOpenStatus ( HIMC, BOOL );
  569. static BOOL ImmSetOpenStatus ( HIMC, BOOL, BOOL );
  570. static BOOL ImmGetConversionStatus ( HIMC, LPDWORD, LPDWORD, BOOL );
  571. static BOOL ImmSetConversionStatus ( HIMC, DWORD, DWORD, BOOL );
  572. static HWND ImmGetDefaultIMEWnd ( HWND , BOOL);
  573. static BOOL ImmSetCompositionStringW (HIMC, DWORD, PVOID, DWORD, PVOID, DWORD);
  574. static BOOL FSupportSty ( UINT, UINT );
  575. static const IMESTYLE * PIMEStyleFromAttr ( const UINT );
  576. static const IMECOLORSTY * PColorStyleTextFromIMEStyle ( const IMESTYLE * );
  577. static const IMECOLORSTY * PColorStyleBackFromIMEStyle ( const IMESTYLE * );
  578. static BOOL FBoldIMEStyle ( const IMESTYLE * );
  579. static BOOL FItalicIMEStyle ( const IMESTYLE * );
  580. static BOOL FUlIMEStyle ( const IMESTYLE * );
  581. static UINT IdUlIMEStyle ( const IMESTYLE * );
  582. static COLORREF RGBFromIMEColorStyle ( const IMECOLORSTY * );
  583. // ----------------------------------
  584. // National Language Keyboard support
  585. // ----------------------------------
  586. static HKL CheckChangeKeyboardLayout (BYTE bCharSet);
  587. static HKL ActivateKeyboard (LONG index);
  588. static DWORD GetCharFlags125x(WCHAR ch);
  589. static BOOL GetKeyboardFlag (WORD dwKeyMask, WORD wKey);
  590. static WORD GetKeyboardFlags () {return _wKeyboardFlags;}
  591. static HKL GetKeyboardLayout (DWORD dwThreadID);
  592. static WORD GetKeyPadNumber () {return _wNumKeyPad;}
  593. static WORD GetDeadKey () {return _wDeadKey;}
  594. static void InitKeyboardFlags ();
  595. static void RefreshKeyboardLayout ();
  596. static void ResetKeyboardFlag (WORD wFlag) {_wKeyboardFlags &= ~wFlag;}
  597. static void SetDeadKey (WORD wDeadKey) {_wDeadKey = wDeadKey;}
  598. static void SetKeyboardFlag (WORD wFlag) {_wKeyboardFlags |= wFlag;}
  599. static void SetKeyPadNumber (WORD wNum) {_wNumKeyPad = wNum;}
  600. static bool UsingHebrewKeyboard ()
  601. {return PRIMARYLANGID(_hklCurrent) == LANG_HEBREW;}
  602. static void InitPreferredFontInfo();
  603. static bool SetPreferredFontInfo(
  604. int cpg,
  605. bool fUIFont,
  606. SHORT iFont,
  607. BYTE yHeight,
  608. BYTE bPitchAndFamily
  609. );
  610. static bool GetPreferredFontInfo(
  611. int cpg,
  612. bool fUIFont,
  613. SHORT& iFont,
  614. BYTE& yHeight,
  615. BYTE& bPitchAndFamily
  616. );
  617. static SHORT GetPreferredFontHeight(
  618. bool fUIFont,
  619. BYTE bOrgCharSet,
  620. BYTE bNewCharSet,
  621. SHORT yOrgHeight
  622. );
  623. static void CheckInstalledFEFonts();
  624. static void CheckInstalledKeyboards();
  625. static bool IsFontAvail( HDC hDC, int cpg, bool fUIFont = false, short *piFontIndex = NULL);
  626. static bool IsFEFontInSystem( int cpg );
  627. static UINT GetFEFontInfo( void );
  628. static int IsFESystem()
  629. {
  630. return IsFELCID( _syslcid );
  631. }
  632. #ifndef NOACCESSIBILITY
  633. // ----------------------------------
  634. // Accessability Support
  635. // ----------------------------------
  636. static HRESULT VariantCopy(VARIANTARG FAR* pvargDest, VARIANTARG FAR* pvargSrc);
  637. static LRESULT LResultFromObject(REFIID riid, WPARAM wParam, LPUNKNOWN punk);
  638. static HRESULT AccessibleObjectFromWindow(HWND hWnd, DWORD dwID, REFIID riidInterface, void ** ppvObject);
  639. static BOOL BlockInput(BOOL fBlock);
  640. static UINT SendInput(UINT nInputs, LPINPUT pInputs, int cbSize);
  641. static VOID NotifyWinEvent(DWORD dwEvent, HWND hWnd, LONG lObjectType, LONG lObjectId);
  642. #endif
  643. // ----------------------------------
  644. // OLE Support
  645. // ----------------------------------
  646. static HRESULT LoadRegTypeLib ( REFGUID, WORD, WORD, LCID, ITypeLib ** );
  647. static HRESULT LoadTypeLib ( const OLECHAR *, ITypeLib ** );
  648. static HRESULT LoadTypeLibEx( LPCOLESTR szFile, REGKIND regkind, ITypeLib ** pptlib );
  649. static BSTR SysAllocString ( const OLECHAR * );
  650. static BSTR SysAllocStringLen ( const OLECHAR *, UINT );
  651. static void SysFreeString ( BSTR );
  652. static UINT SysStringLen ( BSTR );
  653. static void VariantInit ( VARIANTARG * );
  654. static HRESULT OleCreateFromData ( LPDATAOBJECT, REFIID, DWORD, LPFORMATETC, LPOLECLIENTSITE, LPSTORAGE, void ** );
  655. static void CoTaskMemFree ( PVOID );
  656. static HRESULT CreateBindCtx ( DWORD, LPBC * );
  657. static HANDLE OleDuplicateData ( HANDLE, CLIPFORMAT, UINT );
  658. static HRESULT CoTreatAsClass ( REFCLSID, REFCLSID );
  659. static HRESULT ProgIDFromCLSID ( REFCLSID, LPOLESTR * );
  660. static HRESULT OleConvertIStorageToOLESTREAM ( LPSTORAGE, LPOLESTREAM );
  661. static HRESULT OleConvertIStorageToOLESTREAMEx ( LPSTORAGE, CLIPFORMAT, LONG, LONG, DWORD, LPSTGMEDIUM, LPOLESTREAM );
  662. static HRESULT OleSave ( LPPERSISTSTORAGE, LPSTORAGE, BOOL );
  663. static HRESULT StgCreateDocfileOnILockBytes ( ILockBytes *, DWORD, DWORD, IStorage ** );
  664. static HRESULT CreateILockBytesOnHGlobal ( HGLOBAL, BOOL, ILockBytes ** );
  665. static HRESULT OleCreateLinkToFile ( LPCOLESTR, REFIID, DWORD, LPFORMATETC, LPOLECLIENTSITE, LPSTORAGE, void ** );
  666. static PVOID CoTaskMemAlloc ( ULONG );
  667. static PVOID CoTaskMemRealloc ( PVOID, ULONG );
  668. static HRESULT OleInitialize ( PVOID );
  669. static void OleUninitialize ( );
  670. static HRESULT OleSetClipboard ( IDataObject * );
  671. static HRESULT OleFlushClipboard ( );
  672. static HRESULT OleIsCurrentClipboard ( IDataObject * );
  673. static HRESULT DoDragDrop ( IDataObject *, IDropSource *, DWORD, DWORD * );
  674. static HRESULT OleGetClipboard ( IDataObject ** );
  675. static HRESULT RegisterDragDrop ( HWND, IDropTarget * );
  676. static HRESULT OleCreateLinkFromData ( IDataObject *, REFIID, DWORD, LPFORMATETC, IOleClientSite *, IStorage *, void ** );
  677. static HRESULT OleCreateStaticFromData ( IDataObject *, REFIID, DWORD, LPFORMATETC, IOleClientSite *, IStorage *, void ** );
  678. static HRESULT OleDraw ( IUnknown *, DWORD, HDC, LPCRECT );
  679. static HRESULT OleSetContainedObject ( IUnknown *, BOOL );
  680. static HRESULT CoDisconnectObject ( IUnknown *, DWORD );
  681. static HRESULT WriteFmtUserTypeStg ( IStorage *, CLIPFORMAT, LPOLESTR );
  682. static HRESULT WriteClassStg ( IStorage *, REFCLSID );
  683. static HRESULT SetConvertStg ( IStorage *, BOOL );
  684. static HRESULT ReadFmtUserTypeStg ( IStorage *, CLIPFORMAT *, LPOLESTR * );
  685. static HRESULT ReadClassStg ( IStorage *pstg, CLSID * );
  686. static HRESULT OleRun ( IUnknown * );
  687. static HRESULT RevokeDragDrop ( HWND );
  688. static HRESULT CreateStreamOnHGlobal ( HGLOBAL, BOOL, IStream ** );
  689. static HRESULT GetHGlobalFromStream ( IStream *pstm, HGLOBAL * );
  690. static HRESULT OleCreateDefaultHandler ( REFCLSID, IUnknown *, REFIID, void ** );
  691. static HRESULT CLSIDFromProgID ( LPCOLESTR, LPCLSID );
  692. static HRESULT OleConvertOLESTREAMToIStorage ( LPOLESTREAM, IStorage *, const DVTARGETDEVICE * );
  693. static HRESULT OleLoad ( IStorage *, REFIID, IOleClientSite *, void ** );
  694. static HRESULT ReleaseStgMedium ( LPSTGMEDIUM );
  695. static HRESULT CoCreateInstance (REFCLSID rclsid, LPUNKNOWN pUnknown,
  696. DWORD dwClsContext, REFIID riid, PVOID *ppv);
  697. static void FreeOle();
  698. static void FreeIME();
  699. static BOOL HaveIMEShare();
  700. static BOOL getIMEShareObject(CIMEShare **ppIMEShare);
  701. static BOOL IsAIMMLoaded() { return _fHaveAIMM; }
  702. static BOOL GetAimmObject(IUnknown **ppAimm);
  703. static BOOL LoadAIMM();
  704. static HRESULT AIMMDefWndProc(HWND hWnd, UINT msg, WPARAM wparam, LPARAM lparam, LRESULT *plres);
  705. static HRESULT AIMMGetCodePage (HKL hKL, UINT *uCodePage);
  706. static HRESULT AIMMActivate (BOOL fRestoreLayout);
  707. static HRESULT AIMMDeactivate (void);
  708. static HRESULT AIMMFilterClientWindows(ATOM *aaClassList, UINT uSize);
  709. int __cdecl sprintf(char * buff, char *fmt, ...);
  710. // ----------------------------------
  711. // Useful ANSI<-->Unicode conversion
  712. // and language id routines
  713. // ----------------------------------
  714. static int MbcsFromUnicode(LPSTR pstr, int cch, LPCWSTR pwstr,
  715. int cwch = -1, UINT codepage = CP_ACP,
  716. UN_FLAGS flags = UN_CONVERT_WCH_EMBEDDING);
  717. static int UnicodeFromMbcs(LPWSTR pwstr, int cwch, LPCSTR pstr, int cch = -1,
  718. UINT uiCodePage = CP_ACP);
  719. static int MBTWC(INT CodePage, DWORD dwFlags, LPCSTR pstrMB, int cchMB,
  720. LPWSTR pstrWC, int cchWC, LPBOOL pfNoCodePage);
  721. static int WCTMB(INT CodePage, DWORD dwFlags, LPCWSTR pstrWC, int cchWC,
  722. LPSTR pstrMB, int cchMB, LPCSTR pchDefault, LPBOOL pfUsedDef,
  723. LPBOOL pfNoCodePage, BOOL fTestCodePage = FALSE);
  724. static int VerifyFEString(INT cpg, LPCWSTR pstrWC, int cchWC, BOOL fTestInputCpg);
  725. static HGLOBAL TextHGlobalAtoW( HGLOBAL hglobal );
  726. static HGLOBAL TextHGlobalWtoA( HGLOBAL hglobal );
  727. static UINT ConvertLanguageIDtoCodePage(WORD lid);
  728. static HKL FindDirectionalKeyboard(BOOL fRTL);
  729. static BYTE GetCharSet(INT cpg, int *pcharsetIndex = NULL);
  730. static BYTE MatchFECharSet(DWORD dwCharInfo, DWORD dwFontSig);
  731. static INT GetCodePage(BYTE bCharSet);
  732. static DWORD GetFontSig(WORD wCharSet);
  733. static DWORD GetFontSigFromScript(int iScript);
  734. static BYTE GetFirstAvailCharSet(DWORD dwFontSig);
  735. static UINT GetKeyboardCodePage(DWORD dwMakeAPICall = 0);
  736. static LCID GetKeyboardLCID(DWORD dwMakeAPICall = 0);
  737. static UINT GetLocaleCodePage();
  738. static LCID GetLocaleLCID();
  739. static HKL GetPreferredKbd(LONG iScript) {return _hkl[iScript];}
  740. static void SetPreferredKbd(LONG iScript, HKL hkl) {_hkl[iScript] = hkl;}
  741. static UINT GetSystemDefaultCodePage()
  742. {return ConvertLanguageIDtoCodePage(GetSystemDefaultLangID());}
  743. static int GetTrailBytesCount(BYTE ach, UINT cpg);
  744. static BYTE GetGdiCharSet(BYTE bCharSet);
  745. static INT In125x(WCHAR ch, BYTE bCharSet);
  746. static BOOL Is8BitCodePage(unsigned CodePage);
  747. static BOOL IsAlef(TCHAR ch);
  748. static BOOL IsBiDiCharSet(unsigned CharSet)
  749. {return IN_RANGE(HEBREW_CHARSET, CharSet, ARABIC_CHARSET);}
  750. static bool IsBiDiCodePage(int cpg)
  751. {return IN_RANGE(CP_HEBREW, cpg, CP_ARABIC);}
  752. static bool IsBiDiKbdInstalled()
  753. {return _hkl[HEBREW_INDEX] || _hkl[ARABIC_INDEX];}
  754. static bool IsThaiKbdInstalled()
  755. {return _hkl[THAI_INDEX] != 0;}
  756. static bool IsIndicKbdInstalled();
  757. static bool IsComplexKbdInstalled()
  758. {return IsBiDiKbdInstalled() || IsThaiKbdInstalled() || IsIndicKbdInstalled();}
  759. static BOOL IsPrivateCharSet(unsigned CharSet)
  760. {return IN_RANGE(ADHOC_CHARSET, CharSet, DEVANAGARI_CHARSET);}
  761. static bool IsVietnameseCodePage(int cpg)
  762. {return cpg == CP_VIETNAMESE;}
  763. static BOOL IsDiacritic(WCHAR ch);
  764. static BOOL IsBiDiDiacritic(TCHAR ch);
  765. static BOOL IsBiDiKashida(WCHAR ch)
  766. {return ch == 0x0640;}
  767. static BOOL IsBiDiLcid(LCID lcid);
  768. static BOOL IsIndicLcid(LCID lcid);
  769. static BOOL IsComplexScriptLcid(LCID lcid);
  770. static BOOL IsCharSetValid(BYTE bCharSet);
  771. static BOOL IsDiacriticOrKashida(WCHAR ch, WORD wC3Type);
  772. static bool IsFELCID(LCID lcid);
  773. static BOOL IsFECharSet (BYTE bCharSet);
  774. static bool IsFECodePage(int cpg)
  775. {return IN_RANGE(CP_JAPAN, cpg, CP_CHINESE_TRAD);}
  776. static BOOL IsFECodePageFont (DWORD dwFontSig);
  777. static BOOL IsRTLCharSet(BYTE bCharSet);
  778. BOOL IsStrongDirectional(CC cc) {return cc <= CC_LTR;}
  779. static BOOL IsVietCdmSequenceValid(WCHAR ch1, WCHAR ch2);
  780. static BOOL IsZWG(char ch, BYTE bCharSet); //@cmember Is char a 0-width glyph?
  781. static BOOL IsUTF8BOM(BYTE *pstr);
  782. static LONG ScriptIndexFromCharSet(BYTE bCharSet);
  783. static LONG ScriptIndexFromChar (WCHAR ch);
  784. static LONG ScriptIndexFromFontSig(DWORD dwFontSig);
  785. static WPARAM ValidateStreamWparam(WPARAM wparam);
  786. static CC MECharClass(TCHAR ch);
  787. static HDC GetScreenDC();
  788. // ----------------------------------
  789. // Unicode Wrapped Functions
  790. // ----------------------------------
  791. // We could use inline and a function pointer table to improve efficiency and code size.
  792. static ATOM WINAPI RegisterREClass(
  793. const WNDCLASSW *lpWndClass,
  794. const char *szAnsiClassName,
  795. WNDPROC AnsiWndProc
  796. );
  797. static BOOL GetVersion(
  798. DWORD *pdwPlatformId,
  799. DWORD *pdwMajorVersion,
  800. DWORD *pdwMinorVersion
  801. );
  802. static BOOL GetStringTypes(
  803. LCID lcid,
  804. LPCTSTR lpSrcStr,
  805. int cchSrc,
  806. LPWORD lpCharType1,
  807. LPWORD lpCharType3
  808. );
  809. static BOOL WINAPI GetStringTypeEx(
  810. LCID Locale,
  811. DWORD dwInfoType,
  812. LPCWSTR lpSrcStr,
  813. int cchSrc,
  814. LPWORD lpCharType
  815. );
  816. static LPWSTR WINAPI CharLower(LPWSTR pwstr);
  817. static DWORD WINAPI CharLowerBuff(LPWSTR pwstr, DWORD cchLength);
  818. static DWORD WINAPI CharUpperBuff(LPWSTR pwstr, DWORD cchLength);
  819. static HDC WINAPI CreateIC(
  820. LPCWSTR lpszDriver,
  821. LPCWSTR lpszDevice,
  822. LPCWSTR lpszOutput,
  823. CONST DEVMODEW * lpInitData
  824. );
  825. static HANDLE WINAPI CreateFile(
  826. LPCWSTR lpFileName,
  827. DWORD dwDesiredAccess,
  828. DWORD dwShareMode,
  829. LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  830. DWORD dwCreationDisposition,
  831. DWORD dwFlagsAndAttributes,
  832. HANDLE hTemplateFile
  833. );
  834. static HFONT WINAPI CreateFontIndirect(CONST LOGFONTW * plfw);
  835. static int WINAPI CompareString (
  836. LCID Locale, // locale identifier
  837. DWORD dwCmpFlags, // comparison-style options
  838. LPCWSTR lpString1, // pointer to first string
  839. int cch1, // size, in bytes or characters, of first string
  840. LPCWSTR lpString2, // pointer to second string
  841. int cch2 // size, in bytes or characters, of second string
  842. );
  843. static LRESULT WINAPI DefWindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
  844. static int WINAPI GetObject(HGDIOBJ hgdiObj, int cbBuffer, PVOID lpvObj);
  845. static DWORD APIENTRY GetProfileSection(
  846. LPCWSTR lpAppName,
  847. LPWSTR lpReturnedString,
  848. DWORD nSize
  849. );
  850. static BOOL APIENTRY GetTextExtentPoint32(
  851. HDC hdc,
  852. LPCWSTR pwsz,
  853. int cb,
  854. LPSIZE pSize
  855. );
  856. static int WINAPI GetTextFace(
  857. HDC hdc,
  858. int cch,
  859. LPWSTR lpFaceName
  860. );
  861. static BOOL WINAPI GetTextMetrics(HDC hdc, LPTEXTMETRICW lptm);
  862. static BOOL WINAPI GetTextMetrics(HDC hdc, LOGFONTW &lf, TEXTMETRICW &tm);
  863. static LONG WINAPI GetWindowLong(HWND hWnd, int nIndex);
  864. static LONG_PTR WINAPI GetWindowLongPtr(HWND hWnd, int nIndex);
  865. static DWORD WINAPI GetClassLong(HWND hWnd, int nIndex);
  866. static HBITMAP WINAPI LoadBitmap(HINSTANCE hInstance, LPCWSTR lpBitmapName);
  867. static HCURSOR WINAPI LoadCursor(HINSTANCE hInstance, LPCWSTR lpCursorName);
  868. static HINSTANCE WINAPI LoadLibrary(LPCWSTR lpLibFileName);
  869. static LRESULT WINAPI SendMessage(
  870. HWND hWnd,
  871. UINT Msg,
  872. WPARAM wParam,
  873. LPARAM lParam
  874. );
  875. static LONG WINAPI SetWindowLong(HWND hWnd, int nIndex, LONG dwNewLong);
  876. static LONG WINAPI SetWindowLongPtr(HWND hWnd, int nIndex, LONG_PTR dwNew);
  877. static BOOL WINAPI PostMessage(
  878. HWND hWnd,
  879. UINT Msg,
  880. WPARAM wParam,
  881. LPARAM lParam
  882. );
  883. static BOOL WINAPI UnregisterClass(LPCWSTR lpClassName, HINSTANCE hInstance);
  884. static int WINAPI lstrcmp(LPCWSTR lpString1, LPCWSTR lpString2);
  885. static int WINAPI lstrcmpi(LPCWSTR lpString1, LPCWSTR lpString2);
  886. static BOOL WINAPI PeekMessage(
  887. LPMSG lpMsg,
  888. HWND hWnd,
  889. UINT wMsgFilterMin,
  890. UINT wMsgFilterMax,
  891. UINT wRemoveMsg
  892. );
  893. static DWORD WINAPI GetModuleFileName(
  894. HMODULE hModule,
  895. LPWSTR lpFilename,
  896. DWORD nSize
  897. );
  898. static DWORD GetCurrentThreadId(void);
  899. private:
  900. // System Parameters
  901. static BOOL _fSysParamsOk; // System Parameters have been Initialized
  902. static INT _xWidthSys; // average char width of system font
  903. static INT _yHeightSys; // height of system font
  904. static INT _ySysFontLeading; // System font internal leading
  905. static BOOL _fUsePalette;
  906. static LONG _xPerInchScreenDC; // Pixels per inch used for conversions ...
  907. static LONG _yPerInchScreenDC; // ... and determining whether screen or ...
  908. static INT _cxBorder; // GetSystemMetricx(SM_CXBORDER)...
  909. static INT _cyBorder; // GetSystemMetricx(SM_CYBORDER)...
  910. static INT _cxVScroll; // Width/height of scrlbar arw bitmap
  911. static INT _cyHScroll; // Width of scrlbar arw bitmap
  912. static LONG _dxSelBar;
  913. static INT _sysiniflags; // Start using line services from the start
  914. static UINT _ACP; // Current Ansi code page identifier
  915. static HDC _hdcScreen;
  916. // Double click distances
  917. static INT _cxDoubleClk;
  918. static INT _cyDoubleClk;
  919. // Double Click Time in milliseconds
  920. static INT _DCT;
  921. //Width of hot zone (in pixels) for auto-scrolling
  922. static WORD _nScrollInset;
  923. //Delay (in ms) before scrolling
  924. static WORD _nScrollDelay;
  925. //Interval (in ms) at which we scroll
  926. static WORD _nScrollInterval;
  927. //Amount of horizontal scroll at each interval (pixels)
  928. static WORD _nScrollHAmount;
  929. //Amount of vertical scroll at each interval (pixels)
  930. static WORD _nScrollVAmount;
  931. //Amount of time to wait for determining start of drag operation
  932. static WORD _nDragDelay;
  933. //Minimun distance that must be traversed within drag delay time interval
  934. static WORD _nDragMinDist;
  935. //Keyboard deadkey
  936. static WORD _wDeadKey;
  937. //Keyboard shift/ctrl/alt/lock status
  938. static WORD _wKeyboardFlags;
  939. //North/South sizing cursor (double arrow)
  940. static HCURSOR _hcurSizeNS;
  941. //West/East sizing cursor (double arrow)
  942. static HCURSOR _hcurSizeWE;
  943. //Northwest/Southeast sizing cursor (double arrow)
  944. static HCURSOR _hcurSizeNWSE;
  945. //Northeast/Southwest sizing cursor (double arrow)
  946. static HCURSOR _hcurSizeNESW;
  947. //Number of Lines to scroll with a mouse roller wheel, -1 for pages
  948. static LONG _cLineScroll;
  949. //System Font Handle. This one need only be done once.
  950. static HFONT _hSystemFont;
  951. //System Keyboard Layout
  952. static HKL _hklCurrent;
  953. static HKL _hkl[NCHARSETS];
  954. // Ref Count
  955. static DWORD _cRefs;
  956. //AltNumericKeyboard number
  957. static WORD _wNumKeyPad;
  958. //Digit substitution mode (context, none, national)
  959. static BYTE _bDigitSubstMode;
  960. //SYSTEM_FONT charset
  961. static BYTE _bSysCharSet;
  962. public:
  963. static INT GetXWidthSys() {return _xWidthSys; }
  964. static INT GetYHeightSys() {return _yHeightSys; }
  965. static INT GetSysFontLeading() {return _ySysFontLeading; }
  966. static LONG GetXPerInchScreenDC(){return _xPerInchScreenDC; }
  967. static LONG GetYPerInchScreenDC(){return _yPerInchScreenDC; }
  968. static INT GetCxBorder() {return _cxBorder; }
  969. static INT GetCyBorder() {return _cyBorder; }
  970. static INT GetCyHScroll() {return _cyHScroll; }
  971. static INT GetCxVScroll() {return _cxVScroll; }
  972. static LONG GetDxSelBar() {return _dxSelBar; }
  973. static WORD GetScrollInset() {return _nScrollInset; }
  974. static WORD GetScrollDelay() {return _nScrollDelay; }
  975. static WORD GetScrollInterval() {return _nScrollInterval; }
  976. static WORD GetScrollHAmount() {return _nScrollHAmount; }
  977. static WORD GetScrollVAmount() {return _nScrollVAmount; }
  978. static INT GetCxDoubleClk() {return _cxDoubleClk; }
  979. static INT GetCyDoubleClk() {return _cyDoubleClk; }
  980. static INT GetDCT() {return _DCT; }
  981. static WORD GetDragDelay() {return _nDragDelay; }
  982. static WORD GetDragMinDist() {return _nDragMinDist; }
  983. static LONG GetRollerLineScrollCount();
  984. static HCURSOR GetSizeCursor(LPTSTR idcur);
  985. static HFONT GetSystemFont() {return _hSystemFont; }
  986. static BYTE ReadRegDigitSubstitutionMode();
  987. static BYTE GetDigitSubstitutionMode() {return _bDigitSubstMode;}
  988. static bool fUseAimm() {return (_sysiniflags & SYSINI_USEAIMM) != 0;}
  989. static bool fUseBiDi() {return (_sysiniflags & SYSINI_BIDI) != 0;}
  990. static bool fUseLs() {return (_sysiniflags & SYSINI_USELS) != 0;}
  991. static bool fDebugFont() {return (_sysiniflags & SYSINI_DEBUGFONT) != 0;}
  992. static int DebugDefaultCpg() {return HIWORD(_sysiniflags);}
  993. static BOOL FUsePalette() {return _fUsePalette; }
  994. static void InitSysParams(BOOL fUpdate = FALSE);
  995. static DWORD GetRefs() {return _cRefs;}
  996. static BYTE GetSysCharSet() {return _bSysCharSet;}
  997. // Should also be wrapped but aren't. Used for debugging.
  998. // MessageBox
  999. // OutputDebugString
  1000. // lstrcmpiA should also be wrapped for Win CE's sake but the code
  1001. // that uses it is ifdeffed out for WINCE.
  1002. // Mirroring API entry points
  1003. static PFN_GETLAYOUT _pfnGetLayout;
  1004. static PFN_SETLAYOUT _pfnSetLayout;
  1005. };
  1006. extern CW32System *W32;
  1007. HKL g_hkl[];
  1008. #if !defined(W32SYS_CPP)
  1009. #define OnWinNTFE W32->OnWinNTFE
  1010. #define OnWin95FE W32->OnWin95FE
  1011. #ifdef DEBUG
  1012. #define PvAlloc(cbBuf, uiMemFlags) W32->PvAllocDebug(cbBuf, uiMemFlags, __FILE__, __LINE__)
  1013. #define PvReAlloc(pv, cbBuf) W32->PvReAllocDebug(pv, cbBuf, __FILE__, __LINE__)
  1014. #define PvSet(pv) W32->PvSet(pv, __FILE__, __LINE__)
  1015. #define FreePv W32->FreePvDebug
  1016. #else
  1017. #define PvAlloc W32->PvAlloc
  1018. #define PvReAlloc W32->PvReAlloc
  1019. #define FreePv W32->FreePv
  1020. #endif
  1021. #define CopyMemory W32->CopyMemory
  1022. #define MoveMemory W32->MoveMemory
  1023. #define FillMemory W32->FillMemory
  1024. #define ZeroMemory W32->ZeroMemory
  1025. #define CompareMemory W32->CompareMemory
  1026. #define GlobalAlloc W32->GlobalAlloc
  1027. #define GlobalFree W32->GlobalFree
  1028. #define GlobalFlags W32->GlobalFlags
  1029. #define GlobalReAlloc W32->GlobalReAlloc
  1030. #define GlobalSize W32->GlobalSize
  1031. #define GlobalLock W32->GlobalLock
  1032. #define GlobalHandle W32->GlobalHandle
  1033. #define GlobalUnlock W32->GlobalUnlock
  1034. #define ImmInitialize W32->ImmInitialize
  1035. #define ImmTerminate W32->ImmTerminate
  1036. #define ImmGetCompositionStringA W32->ImmGetCompositionStringA
  1037. #define ImmGetCompositionStringW W32->ImmGetCompositionStringW
  1038. #define ImmGetContext W32->ImmGetContext
  1039. #define ImmSetCompositionFontA W32->ImmSetCompositionFontA
  1040. #define ImmSetCompositionWindow W32->ImmSetCompositionWindow
  1041. #define ImmReleaseContext W32->ImmReleaseContext
  1042. #define ImmGetProperty W32->ImmGetProperty
  1043. #define ImmGetCandidateWindow W32->ImmGetCandidateWindow
  1044. #define ImmSetCandidateWindow W32->ImmSetCandidateWindow
  1045. #define ImmNotifyIME W32->ImmNotifyIME
  1046. #define ImmAssociateContext W32->ImmAssociateContext
  1047. #define ImmGetVirtualKey W32->ImmGetVirtualKey
  1048. #define ImmEscape W32->ImmEscape
  1049. #define ImmGetOpenStatus W32->ImmGetOpenStatus
  1050. #define ImmSetOpenStatus W32->ImmSetOpenStatus
  1051. #define ImmGetConversionStatus W32->ImmGetConversionStatus
  1052. #define ImmSetConversionStatus W32->ImmSetConversionStatus
  1053. #define ImmGetDefaultIMEWnd W32->ImmGetDefaultIMEWnd
  1054. #define ImmSetCompositionStringW W32->ImmSetCompositionStringW
  1055. #define LoadRegTypeLib W32->LoadRegTypeLib
  1056. #define LoadTypeLib W32->LoadTypeLib
  1057. #define SysAllocString W32->SysAllocString
  1058. #define SysAllocStringLen W32->SysAllocStringLen
  1059. #define SysFreeString W32->SysFreeString
  1060. #define SysStringLen W32->SysStringLen
  1061. #define VariantInit W32->VariantInit
  1062. #define OleCreateFromData W32->OleCreateFromData
  1063. #define CoTaskMemFree W32->CoTaskMemFree
  1064. #define CreateBindCtx W32->CreateBindCtx
  1065. #define OleDuplicateData W32->OleDuplicateData
  1066. #define CoTreatAsClass W32->CoTreatAsClass
  1067. #define ProgIDFromCLSID W32->ProgIDFromCLSID
  1068. #define OleConvertIStorageToOLESTREAM W32->OleConvertIStorageToOLESTREAM
  1069. #define OleConvertIStorageToOLESTREAMEx W32->OleConvertIStorageToOLESTREAMEx
  1070. #define OleSave W32->OleSave
  1071. #define StgCreateDocfileOnILockBytes W32->StgCreateDocfileOnILockBytes
  1072. #define CreateILockBytesOnHGlobal W32->CreateILockBytesOnHGlobal
  1073. #define OleCreateLinkToFile W32->OleCreateLinkToFile
  1074. #define CoTaskMemAlloc W32->CoTaskMemAlloc
  1075. #define CoTaskMemRealloc W32->CoTaskMemRealloc
  1076. #define OleInitialize W32->OleInitialize
  1077. #define OleUninitialize W32->OleUninitialize
  1078. #define OleSetClipboard W32->OleSetClipboard
  1079. #define OleFlushClipboard W32->OleFlushClipboard
  1080. #define OleIsCurrentClipboard W32->OleIsCurrentClipboard
  1081. #define DoDragDrop W32->DoDragDrop
  1082. #define OleGetClipboard W32->OleGetClipboard
  1083. #define RegisterDragDrop W32->RegisterDragDrop
  1084. #define OleCreateLinkFromData W32->OleCreateLinkFromData
  1085. #define OleCreateStaticFromData W32->OleCreateStaticFromData
  1086. #define OleDraw W32->OleDraw
  1087. #define OleSetContainedObject W32->OleSetContainedObject
  1088. #define CoDisconnectObject W32->CoDisconnectObject
  1089. #define WriteFmtUserTypeStg W32->WriteFmtUserTypeStg
  1090. #define WriteClassStg W32->WriteClassStg
  1091. #define SetConvertStg W32->SetConvertStg
  1092. #define ReadFmtUserTypeStg W32->ReadFmtUserTypeStg
  1093. #define ReadClassStg W32->ReadClassStg
  1094. #define OleRun W32->OleRun
  1095. #define RevokeDragDrop W32->RevokeDragDrop
  1096. #define CreateStreamOnHGlobal W32->CreateStreamOnHGlobal
  1097. #define GetHGlobalFromStream W32->GetHGlobalFromStream
  1098. #define OleCreateDefaultHandler W32->OleCreateDefaultHandler
  1099. #define CLSIDFromProgID W32->CLSIDFromProgID
  1100. #define OleConvertOLESTREAMToIStorage W32->OleConvertOLESTREAMToIStorage
  1101. #define OleLoad W32->OleLoad
  1102. #define ReleaseStgMedium W32->ReleaseStgMedium
  1103. #define CoCreateInstance W32->CoCreateInstance
  1104. #define FSupportSty W32->FSupportSty
  1105. #define PIMEStyleFromAttr W32->PIMEStyleFromAttr
  1106. #define PColorStyleTextFromIMEStyle W32->PColorStyleTextFromIMEStyle
  1107. #define PColorStyleBackFromIMEStyle W32->PColorStyleBackFromIMEStyle
  1108. #define FBoldIMEStyle W32->FBoldIMEStyle
  1109. #define FItalicIMEStyle W32->FItalicIMEStyle
  1110. #define FUlIMEStyle W32->FUlIMEStyle
  1111. #define IdUlIMEStyle W32->IdUlIMEStyle
  1112. #define RGBFromIMEColorStyle W32->RGBFromIMEColorStyle
  1113. #define fHaveIMMProcs W32->_fHaveIMMProcs
  1114. #define fHaveAIMM W32->_fHaveAIMM
  1115. #define dwPlatformId W32->_dwPlatformId
  1116. #define dwMajorVersion W32->_dwMajorVersion
  1117. #define icr3DDarkShadow W32->_icr3DDarkShadow
  1118. #define MSIMEMouseMsg W32->_MSIMEMouseMsg
  1119. #define MSIMEReconvertMsg W32->_MSIMEReconvertMsg
  1120. #define MSIMEReconvertRequestMsg W32->_MSIMEReconvertRequestMsg
  1121. #define MSIMEDocFeedMsg W32->_MSIMEDocFeedMsg
  1122. #define MSIMEQueryPositionMsg W32->_MSIMEQueryPositionMsg
  1123. #define MSIMEServiceMsg W32->_MSIMEServiceMsg
  1124. #define ScriptIndexFromChar W32->ScriptIndexFromChar
  1125. #define ScriptIndexFromCharSet W32->ScriptIndexFromCharSet
  1126. #define MECharClass W32->MECharClass
  1127. #define MbcsFromUnicode W32->MbcsFromUnicode
  1128. #define UnicodeFromMbcs W32->UnicodeFromMbcs
  1129. #define TextHGlobalAtoW W32->TextHGlobalAtoW
  1130. #define TextHGlobalWtoA W32->TextHGlobalWtoA
  1131. #define ConvertLanguageIDtoCodePage W32->ConvertLanguageIDtoCodePage
  1132. #define In125x W32->In125x
  1133. #define Is8BitCodePage W32->Is8BitCodePage
  1134. #define IsAlef W32->IsAlef
  1135. #define IsAmbiguous W32->IsAmbiguous
  1136. #define IsBiDiCharSet W32->IsBiDiCharSet
  1137. #define IsBiDiDiacritic W32->IsBiDiDiacritic
  1138. #define IsBiDiKashida W32->IsBiDiKashida
  1139. #define IsBiDiKbdInstalled W32->IsBiDiKbdInstalled
  1140. #define IsDiacritic W32->IsDiacritic
  1141. #define IsCharSetValid W32->IsCharSetValid
  1142. #define IsDiacriticOrKashida W32->IsDiacriticOrKashida
  1143. #define IsFECharSet W32->IsFECharSet
  1144. #define IsFELCID W32->IsFELCID
  1145. #define IsPrivateCharSet W32->IsPrivateCharSet
  1146. #define IsRTLCharSet W32->IsRTLCharSet
  1147. #define IsStrongDirectional W32->IsStrongDirectional
  1148. #define IsThaiKbdInstalled W32->IsThaiKbdInstalled
  1149. #define IsIndicKbdInstalled W32->IsIndicKbdInstalled
  1150. #define IsComplexKbdInstalled W32->IsComplexKbdInstalled
  1151. #define IsTrailByte W32->IsTrailByte
  1152. #define IsVietCdmSequenceValid W32->IsVietCdmSequenceValid
  1153. #define GetCharSet W32->GetCharSet
  1154. #define GetGdiCharSet W32->GetGdiCharSet
  1155. #define GetCodePage W32->GetCodePage
  1156. #define GetFontSig W32->GetFontSig
  1157. #define GetFirstAvailCharSet W32->GetFirstAvailCharSet
  1158. #define MatchFECharSet W32->MatchFECharSet
  1159. #define GetKeyboardCodePage W32->GetKeyboardCodePage
  1160. #define GetKeyboardLCID W32->GetKeyboardLCID
  1161. #define GetLocaleCodePage W32->GetLocaleCodePage
  1162. #define GetLocaleLCID W32->GetLocaleLCID
  1163. #define GetSystemDefaultCodePage W32->GetSystemDefaultCodePage
  1164. #define GetTrailBytesCount W32->GetTrailBytesCount
  1165. #define MBTWC W32->MBTWC
  1166. #define WCTMB W32->WCTMB
  1167. #define VerifyFEString W32->VerifyFEString
  1168. #define CharLower W32->CharLower
  1169. #define CharLowerBuff W32->CharLowerBuff
  1170. #define CharUpperBuff W32->CharUpperBuff
  1171. #define CreateIC W32->CreateIC
  1172. #define CreateFile W32->CreateFile
  1173. #define CreateFontIndirect W32->CreateFontIndirect
  1174. #define CompareString W32->CompareString
  1175. #define DefWindowProc W32->DefWindowProc
  1176. #define GetDeadKey W32->GetDeadKey
  1177. #define GetKeyboardFlag W32->GetKeyboardFlag
  1178. #define GetKeyboardFlags W32->GetKeyboardFlags
  1179. #define GetKeyboardLayout W32->GetKeyboardLayout
  1180. #define GetKeyPadNumber W32->GetKeyPadNumber
  1181. #define GetProfileSection W32->GetProfileSection
  1182. #define GetTextExtentPoint32 W32->GetTextExtentPoint32
  1183. #define GetTextMetrics W32->GetTextMetrics
  1184. #define GetTextFace W32->GetTextFace
  1185. #define GetWindowLong W32->GetWindowLong
  1186. #define GetWindowLongPtr W32->GetWindowLongPtr
  1187. #define GetClassLong W32->GetClassLong
  1188. #define InitKeyboardFlags W32->InitKeyboardFlags
  1189. #define IsEnhancedMetafileDC W32->IsEnhancedMetafileDC
  1190. #define LoadBitmap W32->LoadBitmap
  1191. #define LoadCursor W32->LoadCursor
  1192. #define LoadLibrary W32->LoadLibrary
  1193. #define ResetKeyboardFlag W32->ResetKeyboardFlag
  1194. #define SendMessage W32->SendMessage
  1195. #define SetDeadKey W32->SetDeadKey
  1196. #define SetKeyboardFlag W32->SetKeyboardFlag
  1197. #define SetKeyPadNumber W32->SetKeyPadNumber
  1198. #define SetWindowLong W32->SetWindowLong
  1199. #define SetWindowLongPtr W32->SetWindowLongPtr
  1200. #define PostMessage W32->PostMessage
  1201. #define lstrcmp W32->lstrcmp
  1202. #define lstrcmpi W32->lstrcmpi
  1203. #define PeekMessage W32->PeekMessage
  1204. #define GetMapMode W32->GetMapMode
  1205. #define WinLPtoDP W32->WinLPtoDP
  1206. #define MulDiv W32->MulDiv
  1207. // AIMM wrapper
  1208. #define IsAIMMLoaded W32->IsAIMMLoaded
  1209. #define LoadAIMM W32->LoadAIMM
  1210. #define CallAIMMDefaultWndProc W32->AIMMDefWndProc
  1211. #define GetAIMMKeyboardCP W32->AIMMGetCodePage
  1212. #define ActivateAIMM W32->AIMMActivate
  1213. #define DeactivateAIMM W32->AIMMDeactivate
  1214. #define FilterClientWindowsAIMM W32->AIMMFilterClientWindows
  1215. #define sprintf W32->sprintf
  1216. #define wcslen W32->wcslen
  1217. #define wcscpy W32->wcscpy
  1218. #define wcscmp W32->wcscmp
  1219. #define wcsicmp W32->wcsicmp
  1220. #define wcsncpy W32->wcsncpy
  1221. #define GetLayout (*W32->_pfnGetLayout)
  1222. #define SetLayout (*W32->_pfnSetLayout)
  1223. #define GetACP W32->GetACP
  1224. #endif // !defined(W32SYS_CPP)
  1225. #define VER_PLATFORM_WIN32_MACINTOSH 0x8001
  1226. #if defined PEGASUS && !defined(WINNT)
  1227. // The follwing definitions do not exist in the Windows CE environment but we emulate them.
  1228. // The values have been copied from the appropriate win32 header files.
  1229. #pragma message(REVIEW "Using NT definitions not in Windows CE")
  1230. // Memory allocation flag. Win CE uses Local mem instead of Global mem
  1231. #define GMEM_ZEROINIT LMEM_ZEROINIT
  1232. #define GMEM_MOVEABLE LMEM_MOVEABLE
  1233. #define GMEM_FIXED LMEM_FIXED
  1234. // Scroll Bars
  1235. #define ESB_ENABLE_BOTH 0x0000
  1236. #define ESB_DISABLE_BOTH 0x0003
  1237. // Text alignment values
  1238. #define TA_TOP 0
  1239. #define TA_BOTTOM 8
  1240. #define TA_BASELINE 24
  1241. #define TA_CENTER 6
  1242. #define TA_LEFT 0
  1243. // Device Technology. This one is mostly used for exclusion
  1244. #define DT_METAFILE 5 // Metafile, VDM
  1245. // Resources for LoadCursor.
  1246. #define IDC_ARROW MAKEINTRESOURCE(32512)
  1247. #define IDC_IBEAM MAKEINTRESOURCE(32513)
  1248. // FInd/Replace options
  1249. #define FR_DOWN 0x00000001
  1250. #define FR_WHOLEWORD 0x00000002
  1251. #define FR_MATCHCASE 0x00000004
  1252. // Window messages
  1253. #define WM_NCMOUSEMOVE 0x00A0
  1254. #define WM_NCMBUTTONDBLCLK 0x00A9
  1255. #define WM_DROPFILES 0x0233
  1256. // Code Pages
  1257. #define CP_UTF8 65001 /* UTF-8 translation */
  1258. // Clipboard formats
  1259. #define CF_METAFILEPICT 3
  1260. // Special cursor shapes
  1261. #define IDC_SIZENWSE MAKEINTRESOURCE(32642)
  1262. #define IDC_SIZENESW MAKEINTRESOURCE(32643)
  1263. #define IDC_SIZENS MAKEINTRESOURCE(32645)
  1264. #define IDC_SIZEWE MAKEINTRESOURCE(32644)
  1265. /* Mapping Modes */
  1266. #define MM_TEXT 1
  1267. #define SetMapMode(hdc, mapmode)
  1268. #define SetWindowOrgEx(hdc, xOrg, yOrg, pt)
  1269. #define SetViewportExtEx(hdc, nX, nY, lpSize)
  1270. #define SetWindowExtEx(hdc, x, y, lpSize)
  1271. /* Pen Styles : Windows CE only supports PS_DASH */
  1272. #define PS_DOT PS_DASH
  1273. #define PS_DASHDOT PS_DASH
  1274. #define PS_DASHDOTDOT PS_DASH
  1275. /* Missing APIs */
  1276. #define GetMessageTime() 0
  1277. #define IsIconic(hwnd) 0
  1278. #pragma message (REVIEW "JMO. This is temporary to try to get the Pegasus Build untracked" )
  1279. #ifdef DEBUG
  1280. #define MoveToEx(a, b, c, d) 0
  1281. #else
  1282. #define MoveToEx(a, b, c, d)
  1283. #endif
  1284. #ifdef DEBUG
  1285. #define LineTo(a, b, c) 0
  1286. #else
  1287. #define LineTo(a, b, c)
  1288. #endif
  1289. #define GetProfileIntA(a, b, c) 0
  1290. class METARECORD
  1291. {
  1292. };
  1293. #define GetDesktopWindow() NULL
  1294. #define WS_EX_TRANSPARENT 0x00000020L
  1295. #define WM_MOUSEACTIVATE 0x0021
  1296. #define IsDBCSLeadByte(x) 0
  1297. #define WM_SYSCOLORCHANGE 0x0015
  1298. #define WM_STYLECHANGING 0x007C
  1299. #define WM_WINDOWPOSCHANGING 0x0046
  1300. #define WM_SETCURSOR 0x0020
  1301. #define WM_NCPAINT 0x0085
  1302. #define OEM_CHARSET 255
  1303. #define SHIFTJIS_CHARSET 128
  1304. #define THAI_CHARSET 222
  1305. #define WM_IME_CHAR 0x0286
  1306. #define IME_CMODE_NATIVE 0x0001
  1307. #define IME_CMODE_HANGEUL IME_CMODE_NATIVE
  1308. #define IME_ESC_HANJA_MODE 0x1008
  1309. #define SM_SWAPBUTTON 23
  1310. class CHARSETINFO
  1311. {
  1312. };
  1313. class HDROP
  1314. {
  1315. };
  1316. #define TCI_SRCCODEPAGE 2
  1317. #define TPM_RIGHTBUTTON 0x0002L
  1318. #define RegisterClipboardFormatA(s) RegisterClipboardFormatW(TEXT(s))
  1319. #define GetThreadLocale() 0
  1320. #define EASTEUROPE_CHARSET 238
  1321. #define HEBREW_CHARSET 177
  1322. #define RUSSIAN_CHARSET 204
  1323. #define GB2312_CHARSET 134
  1324. #define HANGEUL_CHARSET 129
  1325. #define JOHAB_CHARSET 130
  1326. #define CHINESEBIG5_CHARSET 136
  1327. #define GREEK_CHARSET 161
  1328. #define TURKISH_CHARSET 162
  1329. #define BALTIC_CHARSET 186
  1330. #define ARABIC_CHARSET 178
  1331. #define MAC_CHARSET 77
  1332. #define ENUMLOGFONTA ENUMLOGFONT
  1333. #define ENUMLOGFONTW ENUMLOGFONT
  1334. #define FONTENUMPROCA FONTENUMPROC
  1335. typedef int *LPOPENFILENAMEA;
  1336. typedef int *LPOPENFILENAMEW;
  1337. #endif
  1338. #ifndef WS_EX_LAYOUTRTL
  1339. #define WS_EX_LAYOUTRTL 0x00400000L // Right to left mirroring
  1340. #endif
  1341. #ifndef LAYOUT_RTL
  1342. #define LAYOUT_RTL 0x00000001
  1343. #endif
  1344. #endif