Leaked source code of windows server 2003
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.

617 lines
21 KiB

  1. //
  2. // Internal data structures for property sheet support.
  3. //
  4. //
  5. // Wiz97 underwent a redesign between IE4 and IE5
  6. // so we have to treat them as two unrelated wizard styles that happen to
  7. // have frighteningly similar names. So prsht.h contains both
  8. // PSH_WIZARD97IE4 and PSH_WIZARD97IE5, and defines PSH_WIZARD97 to be
  9. // the one appropriate to the version of the header file being included.
  10. //
  11. // We redefine PSH_WIZARD97 to mean "Any form of Wizard97",
  12. //
  13. #undef PSH_WIZARD97
  14. #define PSH_WIZARD97 (PSH_WIZARD97IE4 | PSH_WIZARD97IE5)
  15. //
  16. // The history of PROPSHEETHEADER
  17. //
  18. // PROPSHEETHEADERSIZE_BETA
  19. //
  20. // This is the property sheet header that shipped in an early
  21. // Win95 beta (sometime between Sep 1993 and Sep 1994, maybe M5).
  22. //
  23. // It is just like the shipping Win95 property sheet header,
  24. // except that it lacks the PFNPROPSHEETCALLBACK at the end.
  25. // We grudgingly accept it but don't publicize the fact.
  26. //
  27. // For some reason, we have always supported this wacky
  28. // ancient unreleased PROPSHEETHEADER, so there's no point
  29. // in dropping support for it now... If you think it's not
  30. // worth retaining support for this ancient structure,
  31. // feel free to nuke it. But you become responsible for the
  32. // potential app compat bugs from Norton Utilities for
  33. // Windows 95 v1.0.
  34. //
  35. // PROPSHEETHEADERSIZE_V1
  36. //
  37. // This is the property sheet header that shipped in Win95,
  38. // NT4, and IE3. It is documented and lots of people use it.
  39. //
  40. // PROPSHEETHEADERSIZE_V1a
  41. //
  42. // This is an interim property sheet header that never shipped.
  43. // Support for it has been broken for a long time, so I dropped
  44. // the support altogether for IE5.
  45. //
  46. // PROPSHEETHEADERSIZE_V2
  47. //
  48. // This is the property sheet header that shipped in IE4.
  49. //
  50. #define PROPSHEETHEADERSIZE_BETA CCSIZEOF_STRUCT(PROPSHEETHEADER, H_ppsp)
  51. #define PROPSHEETHEADERSIZE_V1 CCSIZEOF_STRUCT(PROPSHEETHEADER, pfnCallback)
  52. #define PROPSHEETHEADERSIZE_V2 CCSIZEOF_STRUCT(PROPSHEETHEADER, H_pszbmHeader)
  53. #define IsValidPROPSHEETHEADERSIZE(dwSize) \
  54. ((dwSize) == PROPSHEETHEADERSIZE_BETA || \
  55. (dwSize) == PROPSHEETHEADERSIZE_V1 || \
  56. (dwSize) == PROPSHEETHEADERSIZE_V2)
  57. // PropertySheetPage structure sizes:
  58. #define MINPROPSHEETPAGESIZEA PROPSHEETPAGEA_V1_SIZE
  59. #define MINPROPSHEETPAGESIZEW PROPSHEETPAGEW_V1_SIZE
  60. #define MINPROPSHEETPAGESIZE PROPSHEETPAGE_V1_SIZE
  61. // - COMPATIBILITY CONSTRAINT -
  62. //
  63. // Shell32 prior to IE5 knows the internal structure of the HPROPSHEETPAGE,
  64. // so we have to give it what it wants. (shell32\bitbuck.c, docfind2.c)
  65. //
  66. // Win95 Golden - Shell32 expects the HPROPSHEETPAGE to be equal to
  67. // the lParam that is passed to the dialog proc's WM_INITDIALOG.
  68. // No special flags are passed in the PROPSHEETPAGE to indicate
  69. // that this assumption is being made.
  70. //
  71. // Win95 IE4 Integrated - Same as Win95 Golden, except that
  72. // the shell sets the PSP_SHPAGE bit in the PROPSHEETPAGE.dwFlags
  73. // to indicate that it wants this wacky behavior.
  74. //
  75. // WinNT Golden - Shell32 expects the HPROPSHEETPAGE to be equal
  76. // to a pointer to the internal PSP structure used by WinNT golden.
  77. // The internal PSP structure looked like a PROPSHEETPAGE, except
  78. // that it had two fields stuck in front. (One DWORD and one pointer.)
  79. // The NT shell passes the PSP_SHPAGE flag.
  80. //
  81. // WinNT IE4 Integrated - Same as WinNT Golden.
  82. //
  83. // Furthermore, all versions of Shell32 prior to IE5 call the internal
  84. // CreatePage function (shell32\docfind2.c)
  85. //
  86. // - Summary -
  87. //
  88. // passes expected expects
  89. // PSP_SHPAGE PSP CLASSICPREFIX
  90. // --------- ------- -------------
  91. // 95 Gold ANSI
  92. // 95/IE4 * ANSI
  93. // NT Gold * UNI *
  94. // NT/IE4 * UNI *
  95. //
  96. // Note that Win95 Gold does not set the PSP_SHPAGE flag, so we have
  97. // to assume that any ANSI caller might be a Win95 Gold shell32.
  98. //
  99. // WinNT is easier. We return the WinNT Golden UNICODE version of
  100. // the PSP if (and only if) the PSP_SHPAGE flag is set.
  101. //
  102. // The PSP_SHPAGE flag has been removed from the header file so nobody
  103. // can pass it ever again.
  104. //
  105. // So our structures look like this. The bracketed section is the
  106. // the memory block passed by the app to CreatePropertySheetPage
  107. // and whose layout cannot be altered.
  108. //
  109. // ANSI Comctl32, ANSI application:
  110. //
  111. // +---------------+
  112. // | PAGEPREFIX |
  113. // hpage95->/+---------------+
  114. // / | PROPSHEETPAGE |
  115. // | | (ANSI) |
  116. // | | |
  117. // | +---------------+
  118. // | | |
  119. // | | app goo |
  120. // \ | |
  121. // \+---------------+
  122. //
  123. // UNICODE Comctl32, ANSI application.
  124. //
  125. //
  126. // The authoritative page The shadow page
  127. //
  128. // +---------------+ + - - - - - - - +
  129. // | PAGEPREFIX | | PAGEPREFIX |
  130. // +---------------+ +---------------+ <- hpageNT
  131. // | CLASSICPREFIX |<-\/-----| CLASSICPREFIX |
  132. // +---------------+<-/\---->+---------------+\<- hpage95
  133. // | PROPSHEETPAGE | | PROPSHEETPAGE | \
  134. // | (UNICODE) | | (ANSI) | |
  135. // | | | | |
  136. // +---------------+ +---------------+ |
  137. // | | |
  138. // | app goo | |
  139. // | | /
  140. // +---------------+/
  141. //
  142. // (The dotted line around PAGEPREFIX
  143. // means that it is allocated but unused.)
  144. //
  145. //
  146. // UNICODE Comctl32, UNICODE application.
  147. //
  148. // +---------------+
  149. // | PAGEPREFIX |
  150. // hpageNT-> +---------------+
  151. // | CLASSICPREFIX |
  152. // hpage95->/+---------------+
  153. // / | PROPSHEETPAGE |
  154. // | | (UNICODE) |
  155. // | | |
  156. // | +---------------+
  157. // | | |
  158. // | | app goo |
  159. // \ | |
  160. // \+---------------+
  161. //
  162. // Are we confused yet? Let's try to explain.
  163. //
  164. // REQUIREMENT
  165. //
  166. // The app goo must be kept in the structure
  167. // corresponding to the character set of the application.
  168. //
  169. // Notice that if the application is ANSI, then the app goo
  170. // is kept with the ANSI version of PROPSHEETPAGE. If the
  171. // application is UNICODE, then the app goo is kept with the
  172. // UNICODE version of the PROPSHEETPAGE.
  173. //
  174. // It doesn't hurt to "accidentally" put a copy of the app goo
  175. // on the version the app doesn't use; that just wastes memory.
  176. //
  177. // REQUIREMENT
  178. //
  179. // If a UNICODE app passed PSP_SHPAGE, then the hpage must
  180. // point to the CLASSICPREFIX structure.
  181. //
  182. // To simplify matters (like HPROPSHEETPAGE validation), we
  183. // apply this rule even if the app didn't pass PSP_SHPAGE.
  184. //
  185. // DESIGN
  186. //
  187. // If the app is ANSI and we support UNICODE, then we create
  188. // a UNICODE copy of the ANSI property sheet structure,
  189. // and the ANSI PROPSHEETPAGE becomes a "shadow".
  190. // The UNICODE copy does not need to carry the app goo
  191. // since it will never be seen by the app.
  192. //
  193. // REQUIREMENT
  194. //
  195. // If an ANSI app creates a property sheet page, then the hpage
  196. // must point to the ANSI version of the PROPSHEETPAGE.
  197. // (Because the app might be shell32.)
  198. //
  199. // >> CAUTION <<
  200. //
  201. // The requirements on hpages rule means that any time an hpage
  202. // comes in from the outside world, we need to sniff it and decide
  203. // if it's the UNICODE version or the ANSI version; if it's
  204. // the ANSI version, then we switch the pointer to point to
  205. // the UNICODE version instead.
  206. //
  207. // REMARK
  208. //
  209. // Internally, we use only the UNICODE version of the PROPSHEETPAGE.
  210. // (Unless we're building Win95 ANSI-only, duh.) The ANSI version
  211. // (the "shadow") is just for show to keep the app happy. It is
  212. // the UNICODE version that is authoritative.
  213. //
  214. // Only the authoritative PROPSHEETPAGE needs to have the PAGEPREFIX,
  215. // but we put one on both sides to simplify memory management,
  216. // because it means that all PROPSHEETPAGEs look the same (both
  217. // authoritative and shadow).
  218. #define PSP_SHPAGE 0x00000200 // Ewww; see above
  219. //
  220. // CLASSICPREFIX
  221. //
  222. // This structure is allocated ahead of the PROPSHEETPAGE when we
  223. // create an HPROPSHEETPAGE. See the diagrams above. Sometimes
  224. // the HPROPSHEETPAGE points to this structure, sometimes it doesn't.
  225. // See the diagrams above.
  226. //
  227. // This structure can never change, due to backwards compatibility
  228. // constraints described above. (Okay, you can change it once you
  229. // decide to drop support for versions of NT less than 5, like that'll
  230. // ever happen.)
  231. //
  232. // pispMain
  233. //
  234. // Points to the main copy of the HPROPSHEETPAGE.
  235. //
  236. // pispShadow
  237. //
  238. // Points to that shadow copy of the HPROPSHEETPAGE, or NULL if
  239. // there is no shadow copy.
  240. typedef struct CLASSICPREFIX {
  241. union ISP *pispMain;
  242. union ISP *pispShadow;
  243. } CLASSICPREFIX, *PCLASSICPREFIX;
  244. //
  245. // PAGEPREFIX
  246. //
  247. // Stuff that we track which isn't part of the CLASSICPREFIX.
  248. //
  249. // hpage is the HPROPSHEETPAGE that we give out to applications.
  250. //
  251. typedef struct PAGEPREFIX {
  252. HPROPSHEETPAGE hpage;
  253. DWORD dwInternalFlags;
  254. SIZE siz; // Page ideal size
  255. } PAGEPREFIX, *PPAGEPREFIX;
  256. //
  257. // Flag values for dwInternalFlags
  258. //
  259. #define PSPI_WX86 1
  260. #define PSPI_FETCHEDICON 2 // For debugging (GetPageInfoEx)
  261. #define PSPI_SIZEMASK 0xFFFF0000
  262. //
  263. // _PSP
  264. //
  265. // This is the structure than the compiler thinks an HPROPSHEETPAGE
  266. // points to. To make sure all our code goes through
  267. // InternalizeHPROPSHEETPAGE on the way in and
  268. // ExternalizeHPROPSHEETPAGE on the way out, we intentionally leave
  269. // it undefined.
  270. typedef struct _PSP PSP, *PPSP;
  271. //
  272. // ISP - Internal Sheet Page
  273. //
  274. // Our internal structure for tracking property sheet pages. This
  275. // is also what a native-character set HPROPSHEETPAGE points to.
  276. //
  277. // Note the "union with an array of one element that we index with
  278. // the value -1 in order to access it at negative offsets" trick.
  279. //
  280. // Note also that the CLASSICPREFIX goes above the HPROPSHEETPAGE
  281. // on Win95, but below it on WinNT. See discussion at the top of this
  282. // file.
  283. //
  284. // To save all the typing of union names and [-1]'s, access to fields
  285. // of an IPSP are encapsulated inside the _psp, _cpfx, and _pfx macros.
  286. typedef union ISP {
  287. struct {
  288. PAGEPREFIX pfx; // lives above the HPROPSHEETPAGE
  289. } above[1];
  290. struct {
  291. CLASSICPREFIX cpfx; // lives below the HPROPSHEETPAGE
  292. PROPSHEETPAGE psp; // lives below the HPROPSHEETPAGE
  293. } below;
  294. } ISP, *PISP;
  295. #define _pfx above[-1].pfx
  296. #define _psp below.psp
  297. #define _cpfx below.cpfx
  298. #define GETORIGINALSIZE(psp) (((psp)->_pfx.dwInternalFlags & PSPI_SIZEMASK) >> 16)
  299. #define SETORIGINALSIZE(psp, iSize) ((psp)->_pfx.dwInternalFlags |= (iSize << 16))
  300. #define PropSheetBase(pisp) ((LPBYTE)(pisp) - sizeof((PISP)pisp)->above)
  301. //
  302. // Converting an HPROPSHEETPAGE into a PSP means sniffing at the
  303. // _cpfx.dwFlags and seeing if it's an ANSI page or a UNICODE page.
  304. //
  305. __inline
  306. PISP
  307. InternalizeHPROPSHEETPAGE(HPROPSHEETPAGE hpage)
  308. {
  309. PISP pisp = (PISP)hpage;
  310. return pisp->_cpfx.pispMain;
  311. }
  312. #define ExternalizeHPROPSHEETPAGE(pisp) ((pisp)->_pfx.hpage)
  313. //
  314. // Used for GetPageInfo(), prpage.c
  315. //
  316. typedef struct {
  317. short PointSize;
  318. WCHAR szFace[LF_FACESIZE];
  319. BOOL bItalic;
  320. int iCharset;
  321. } PAGEFONTDATA, * PPAGEFONTDATA;
  322. //
  323. // PROPDATA
  324. //
  325. // The state of a property sheet.
  326. //
  327. typedef struct
  328. {
  329. HWND hDlg; // the dialog for this instance data
  330. PROPSHEETHEADER psh;
  331. HWND hwndCurPage; // current page hwnd
  332. HWND hwndTabs; // tab control window
  333. int nCurItem; // index of current item in tab control
  334. int idDefaultFallback; // the default id to set as DEFID if page doesn't have one
  335. int nReturn;
  336. UINT nRestart;
  337. int xSubDlg, ySubDlg; // dimensions of sub dialog
  338. int cxSubDlg, cySubDlg;
  339. BOOL fFlags;
  340. BOOL fFlipped; // Property sheet not mirrored but with flipped buttons
  341. // Wizard97 IE4 vs. IE5 discrepancy:
  342. //
  343. // Wizard 97 IE4 - "watermark" refers to the bitmap that is used to
  344. // paint the background of the dialog.
  345. // Wizard 97 IE5 - "watermark" refers to the bitmap that goes on
  346. // on the left-hand side of Welcome/Finish screens.
  347. //
  348. HBITMAP hbmWatermark;
  349. HBRUSH hbrWatermark;
  350. HPALETTE hplWatermark;
  351. int cyHeaderHeight;
  352. HFONT hFontBold;
  353. HBITMAP hbmHeader;
  354. HBRUSH hbrHeader;
  355. int ySubTitle; // The subtitle's starting Y position
  356. BOOL fAllowApply;
  357. // These fields are used by MLUI
  358. LANGID wFrameLang; // langid of propsheet frame
  359. int iFrameCharset; // charset of propsheet frame
  360. // These fields cache font metric information
  361. PAGEFONTDATA pfdCache; // Cached font descriptor
  362. SIZE sizCache; // Cached height and width go here
  363. SIZE sizMin; // Smallest we allow pages to get
  364. HPROPSHEETPAGE rghpage[MAXPROPPAGES];
  365. } PROPDATA, *LPPROPDATA;
  366. // defines for fFlags
  367. #define PD_NOERASE 0x0001
  368. #define PD_CANCELTOCLOSE 0x0002
  369. #define PD_DESTROY 0x0004
  370. #define PD_WX86 0x0008
  371. #define PD_FREETITLE 0x0010
  372. #define PD_SHELLFONT 0x0020 // Is the frame using SHELLFONT?
  373. #define PD_NEEDSHADOW 0x0040
  374. //
  375. // Helper macros
  376. //
  377. // H_blah means "the field in the PROPSHEETHEADER named blah".
  378. // P_blah means "the field in the PROPSHEETPAGE named blah".
  379. //
  380. //
  381. #define H_hIcon DUMMYUNION_MEMBER(hIcon)
  382. #define H_pszIcon DUMMYUNION_MEMBER(pszIcon)
  383. #define H_nStartPage DUMMYUNION2_MEMBER(nStartPage)
  384. #define H_pStartPage DUMMYUNION2_MEMBER(pStartPage)
  385. #define H_phpage DUMMYUNION3_MEMBER(phpage)
  386. #define H_ppsp DUMMYUNION3_MEMBER(ppsp)
  387. #define H_hbmWatermark DUMMYUNION4_MEMBER(hbmWatermark)
  388. #define H_pszbmWatermark DUMMYUNION4_MEMBER(pszbmWatermark)
  389. #define H_hbmHeader DUMMYUNION5_MEMBER(hbmHeader)
  390. #define H_pszbmHeader DUMMYUNION5_MEMBER(pszbmHeader)
  391. #define P_pszTemplate DUMMYUNION_MEMBER(pszTemplate)
  392. #define P_pResource DUMMYUNION_MEMBER(pResource)
  393. #define P_hIcon DUMMYUNION2_MEMBER(hIcon)
  394. #define P_pszIcon DUMMYUNION2_MEMBER(pszIcon)
  395. //
  396. // HASCALLBACK - We should call the callback for this page.
  397. //
  398. #define HASCALLBACK(pisp) \
  399. (((pisp)->_psp.dwFlags & PSP_USECALLBACK) && \
  400. (pisp)->_psp.pfnCallback)
  401. //
  402. // HASREFPARENT - We should adjust the pcRefParent for this page.
  403. //
  404. #define HASREFPARENT(pisp) \
  405. (((pisp)->_psp.dwFlags & PSP_USEREFPARENT) && \
  406. (pisp)->_psp.pcRefParent)
  407. //
  408. // HASHEADERTITLE - We should display a header title for this page.
  409. //
  410. #define HASHEADERTITLE(pisp) \
  411. (((pisp)->_psp.dwFlags & PSP_USEHEADERTITLE) && \
  412. (pisp)->_psp.pszHeaderTitle)
  413. //
  414. // HASHEADERSUBTITLE - We should display a header subtitle for this page.
  415. //
  416. #define HASHEADERSUBTITLE(pisp) \
  417. (((pisp)->_psp.dwFlags & PSP_USEHEADERSUBTITLE) && \
  418. (pisp)->_psp.pszHeaderSubTitle)
  419. //
  420. // GETPISP - Obtain the PISP for this page. Once they have been
  421. // placed into the H_phpage, all the HPROPSHEETPAGEs are
  422. // already internalized, so we can just cast them over.
  423. //
  424. #define GETPISP(ppd, i) ((PISP)(ppd)->psh.H_phpage[i])
  425. //
  426. // SETPISP - Change the PISP for this page.
  427. //
  428. #define SETPISP(ppd, i, v) ((ppd)->psh.H_phpage[i] = (HPROPSHEETPAGE)(v))
  429. //
  430. // GETHPAGE - Obtain the external HPROPSHEETPAGE for this page.
  431. //
  432. #define GETHPAGE(ppd, i) ExternalizeHPROPSHEETPAGE(GETPISP(ppd, i))
  433. //
  434. // GETPPSP - Obtain the PPSP for this page. We get the PISP
  435. // and then retrieve the PROPSHEETHEADER part.
  436. //
  437. #define GETPPSP(ppd, i) (&GETPISP(ppd, i)->_psp)
  438. //
  439. // HASANSISHADOW
  440. //
  441. // Does this authoritative property sheet page have an ANSI shadow?
  442. //
  443. // If we are built ANSI, then the canonical PSP is equal to the
  444. // ANSI version, so there is no shadow. (It's already the real thing.)
  445. //
  446. #define HASANSISHADOW(pisp) ((pisp)->_cpfx.pispShadow)
  447. //
  448. // HIDEWIZ97HEADER
  449. //
  450. // Nonzero if we are a WIZARD97 property sheet but we should
  451. // hide the header for this page.
  452. #define HIDEWIZ97HEADER(ppd, i) \
  453. (((ppd)->psh.dwFlags & PSH_WIZARD97) && \
  454. (GETPPSP(ppd, i)->dwFlags & PSP_HIDEHEADER))
  455. //
  456. // Stub macros so we don't have to put "#ifdef BIG_ENDIAN" everywhere.
  457. //
  458. #ifndef BIG_ENDIAN
  459. #define MwReadDWORD(lpByte) *(LPDWORD)(lpByte)
  460. #define MwWriteDWORD(lpByte, dwValue) *(LPDWORD)(lpByte) = dwValue
  461. #endif
  462. //
  463. // End of helper macros
  464. //
  465. //
  466. // Functions shared between prsht.c and prpage.c
  467. //
  468. PISP AllocPropertySheetPage(DWORD dwClientSize);
  469. HWND _CreatePage(LPPROPDATA ppd, PISP pisp, HWND hwndParent, LANGID langidMUI);
  470. HPROPSHEETPAGE WINAPI _CreatePropertySheetPage(LPCPROPSHEETPAGE psp, BOOL fNeedShadow, BOOL fWx86);
  471. HPROPSHEETPAGE WINAPI _Hijaak95Hack(LPPROPDATA ppd, HPROPSHEETPAGE hpage);
  472. typedef LPTSTR (STDMETHODCALLTYPE *STRDUPPROC)(LPCTSTR ptsz);
  473. BOOL CopyPropertyPageStrings(LPPROPSHEETPAGE ppsp, STRDUPPROC pfnStrDup);
  474. void FreePropertyPageStrings(LPCPROPSHEETPAGE ppsp);
  475. BOOL ThunkPropSheetHeaderAtoW (LPCPROPSHEETHEADERA ppshA,
  476. LPPROPSHEETHEADERW ppsh);
  477. void FreePropSheetHeaderW(LPPROPSHEETHEADERW ppsh);
  478. STDAPI_(LPTSTR) StrDup_AtoW(LPCTSTR ptsz);
  479. typedef struct
  480. {
  481. POINT pt; // Dialog box dimensions (DLU)
  482. HICON hIcon; // Page icon
  483. PAGEFONTDATA pfd; // Font info
  484. BOOL bRTL; // If tab caption should be right to left reading
  485. BOOL bMirrored; // if the page contains mirroring flags
  486. BOOL bDialogEx; // Is it a DIALOGEX?
  487. DWORD dwStyle; // Dialog style
  488. TCHAR szCaption[128 + 50]; // Caption as stored in template
  489. } PAGEINFOEX;
  490. //
  491. // These flags control which parts of the PAGEINFOEX get filled in.
  492. //
  493. #define GPI_PT 0x0000 // so cheap, we always fetch it
  494. #define GPI_ICON 0x0001
  495. #define GPI_FONT 0x0002 // PAGEFONTDATA
  496. #define GPI_BRTL 0x0000 // so cheap, we always fetch it
  497. #define GPI_BMIRROR 0x0000 // so cheap, we always fetch it
  498. #define GPI_DIALOGEX 0x0000 // so cheap, we always fetch it
  499. #define GPI_CAPTION 0x0004
  500. #define GPI_ALL 0x0007
  501. BOOL WINAPI GetPageInfoEx(LPPROPDATA ppd, PISP pisp, PAGEINFOEX *ppi, LANGID langidMUI, DWORD flags);
  502. // SHELLFONT means that you are a DIALOGEX and have the DS_SHELLFONT bits set
  503. // Although this is supported only on NT5, the flag is still meaningful on
  504. // Win9x to indicate an implicit PSH_USEPAGEFONT.
  505. #define IsPageInfoSHELLFONT(ppi) \
  506. ((ppi)->bDialogEx && DS_SHELLFONT == (DS_SHELLFONT & (ppi)->dwStyle))
  507. // Prsht_PrepareTemplate operating systems types
  508. // Used as array indices. Be careful !!
  509. typedef enum {
  510. PSPT_OS_WIN95_BIDI, // Win95 BiDi
  511. PSPT_OS_WIN98_BIDI, // Win98 BiDi (Or Higher)
  512. PSPT_OS_WINNT4_ENA, // WinNT4 BiDi Ena, No Winnt4 BiDi loc
  513. PSPT_OS_WINNT5, // WinNT5 (Or Higher)
  514. PSPT_OS_OTHER, // Anything else ....
  515. PSPT_OS_MAX
  516. } PSPT_OS;
  517. // Prsht_PrepareTemplate property sheet type
  518. // Used as array indices. Be careful !!
  519. typedef enum {
  520. PSPT_TYPE_MIRRORED, // Mirrored first page OR mirrored Process
  521. PSPT_TYPE_ENABLED, // First page Language is BiDi
  522. PSPT_TYPE_ENGLISH, // Anything else ....
  523. PSPT_TYPE_MAX
  524. } PSPT_TYPE;
  525. // Prsht_PrepareTemplate property sheet default behavior override
  526. // Used as array indices. Be careful !!
  527. typedef enum {
  528. PSPT_OVERRIDE_NOOVERRIDE,
  529. PSPT_OVERRIDE_USEPAGELANG, // Overridden by PSH_USEPAGELANG
  530. PSPT_OVERRIDE_MAX
  531. } PSPT_OVERRIDE;
  532. // Prsht_PrepareTemplate Preparation action
  533. typedef enum {
  534. PSPT_ACTION_NOACTION, // Don't touch whatever you've passed
  535. PSPT_ACTION_NOMIRRORING, // Turn off mirroring
  536. PSPT_ACTION_FLIP, // Turn off mirroring and flip
  537. PSPT_ACTION_LOADENGLISH, // load English template
  538. PSPT_ACTION_WIN9XCOMPAT // Tags the templae with DS_BIDI_RTL for Win9x compat
  539. } PSPT_ACTION;