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.

212 lines
5.9 KiB

  1. /************************************************************/
  2. /* Windows Write, Copyright 1985-1992 Microsoft Corporation */
  3. /************************************************************/
  4. /* MW.H -- Main header file for Windows Write */
  5. /* some defines that used to be done in the makefile...
  6. (started exceeding command line length!) */
  7. #define OLE /* Object Linking and Embedding 01/23/91 -- dougk
  8. Also defined in write.rc. */
  9. #define PENWIN /* pen windows: also defined in write.rc (6.21.91) v-dougk */
  10. #define WIN30
  11. /* #define WINVER 310 */ /* First convention was to use WIN30 defined above,
  12. but later switched to use of WINVER so it will be
  13. easier next time we change either the Windows or
  14. Write products 12/3/89..pault */
  15. #define INTL /* This MUST be turned on (even for the Z version now) */
  16. #define CRLF /* MS-DOS defines the carriage-return/line-feed sequence */
  17. /* Major intermodule defines */
  18. #define SMFONT /* SmartFont? */
  19. #define NOMORESIZEBOX /* The CUA spec has changed for Win30 and
  20. we no longer have a special size box in
  21. the lower-right corner of the Write window */
  22. #define NEWFONTENUM /* So many problems have come up that I'm
  23. revamping a large part of the font enumeration
  24. code and it'll be marked by this. Among others:
  25. -- removed font filtering based on aspect ratio,
  26. -- don't disallow fonts not in ANSI_CHARSET, etc.
  27. ..pault */
  28. #define SYSENDMARK /* This enables code for putting the end mark
  29. in the system font -- previously Kanji only */
  30. #ifndef NEWFONTENUM
  31. #define INEFFLOCKDOWN
  32. #endif
  33. #undef MSDOS
  34. #undef M_I86MM
  35. #undef M_I86
  36. #ifndef SAND
  37. #define REG1 register
  38. #define REG2 register
  39. #endif /* not SAND */
  40. #define true 1
  41. #define false 0
  42. #define fTrue true
  43. #define fFalse false
  44. #ifdef SAND
  45. /* already defined in windows.h */
  46. #define NULL 0
  47. #endif /* SAND */
  48. #define LNULL 0L
  49. #define bNil (-1)
  50. #define iNil (-1)
  51. #define valNil (-1)
  52. #define cchINT (sizeof (int))
  53. #define BStructMember( s, field ) ((unsigned)&(((struct s *)(0))->field))
  54. #define hOverflow (-1)
  55. #define ivalMax 24
  56. #define mrgNil (-32766)
  57. #define cchMaxSz 350
  58. typedef long typeCP;
  59. typedef long typeFC;
  60. typedef unsigned typePN;
  61. typedef unsigned typeTS; /* TS = time stamp */
  62. #ifdef CRLF
  63. #define ccpEol 2
  64. #else /* not CRLF */
  65. #define ccpEol 1
  66. #endif /* not CRLF */
  67. #ifdef SAND
  68. typedef char CHAR;
  69. #else /* not SAND */
  70. typedef unsigned char CHAR;
  71. #endif /* not SAND */
  72. typedef CHAR *PCH;
  73. typedef CHAR far *LPCH;
  74. #if WINVER >= 0x300
  75. typedef CHAR huge *HPCH; /* this is a far but C generates extra code
  76. to make sure segment arithmetic is done
  77. correctly, esp. important in protect mode.
  78. added for handling >64k clipboard text.
  79. apologies re apparently odd hungarian ..pault */
  80. #endif
  81. #ifdef SAND
  82. /* ifdef out because typedef unsigned char BYTE in windows.h */
  83. #define BYTE unsigned char
  84. #endif /* SAND */
  85. #define VAL int
  86. #define MD int
  87. #define BOOL int
  88. #define IDFLD int
  89. #define IDSTR int
  90. #define IDPMT int
  91. #define CC int
  92. #ifdef WIN30
  93. /* DialogBox has been fixed so it automatically brings up the hourglass! */
  94. #ifdef DBCS /* was in KKBUGFIX */
  95. // [yutakan:05/17/91] 'c' can be null at initialize.
  96. #define OurDialogBox(a,b,c,d) DialogBox(a,b,((c==(HWND)NULL)?hParentWw:c),d)
  97. #else
  98. #define OurDialogBox(a,b,c,d) DialogBox(a,b,c,d)
  99. #endif /* DBCS */
  100. #endif
  101. /* bltsz: copy only up to terminator, inclusive
  102. 4/20/89 NOTE: using CchCopySz kills previously returned value of a psz! */
  103. #define bltsz(pFrom, pTo) CchCopySz((pFrom), (pTo))
  104. /* bltszx: far version of above */
  105. #define bltszx(lpFrom, lpTo) \
  106. bltbx((LPCH) (lpFrom), (LPCH) (lpTo), IchIndexLp((LPCH) (lpFrom), '\0')+1)
  107. /* bltszLimit: added 4/20/89 to assure safe copying of strings which just
  108. might not have fit the terminating zero within their buffer space ..pt */
  109. #define bltszLimit(pFrom, pTo, cchMax) \
  110. bltbyte((pFrom), (pTo), min(cchMax, CchSz(pFrom)))
  111. /* Extra-verbose diagnostic debugging output... */
  112. #ifdef DIAG
  113. #define Diag(s) s
  114. #else
  115. #define Diag(s)
  116. #endif
  117. #define cwVal (1)
  118. #define CwFromCch(cch) (((cch) + sizeof (int) - 1) / sizeof (int))
  119. #define FNoHeap(h) ((int)(h) == hOverflow)
  120. #define iabs(w) ((w) < 0 ? (-(w)) : (w))
  121. #define low(ch) ((ch) & 0377)
  122. #define walign(pb) {if ((unsigned)(pb) & 1) \
  123. (*((unsigned *)&(pb)))++;}
  124. #define FtcFromPchp(pchp) (((pchp)->ftcXtra << 6) | (pchp)->ftc)
  125. #define WFromCh(ch) ((ch) - '0')
  126. #ifndef OURHEAP
  127. #define FreezeHp() LocalFreeze(0)
  128. #define MeltHp() LocalMelt(0)
  129. #else
  130. #ifdef DEBUG
  131. #define FreezeHp() { extern int cHpFreeze; ++cHpFreeze; }
  132. #define MeltHp() { extern int cHpFreeze; --cHpFreeze; }
  133. #else /* not DEBUG */
  134. #define FreezeHp()
  135. #define MeltHp()
  136. #endif /* not DEBUG */
  137. #endif
  138. #define HideSel()
  139. typeCP CpMacText(), CpFirstFtn(), CpRefFromFtn(), CpFromDlTc(),
  140. CpBeginLine(), CpInsertFtn(), CpRSearchSz(),
  141. CpLimSty(), CpFirstSty(), CpGetCache(), CpHintCache(),
  142. CpEdge(), CpMax(), CpMin();
  143. typeFC FcParaFirst(), FcParaLim(), FcWScratch(), FcNewSect();
  144. typeFC (**HgfcCollect())[];
  145. CHAR (**HszCreate())[];
  146. #ifndef OURHEAP
  147. #define FreeH(h) ((FNoHeap(h) || ((int)h == 0)) ? NULL : LocalFree((HANDLE)h))
  148. #endif
  149. #ifdef DEBUG
  150. #define Assert(f) _Assert(__FILE__, __LINE__, f)
  151. #define panic() Assert(false)
  152. extern _Assert(PCH pch, int line, BOOL f);
  153. #else /* not DEBUG */
  154. #define Assert(f)
  155. #endif /* DEBUG */
  156. #define cbReserve (1024) /* reserved in our local heap */
  157. /* for windows to create dialog boxes */
  158. /* The flag KINTL is used to share some code between the international
  159. and the kanji Write. */
  160. #ifdef INTL
  161. #define KINTL
  162. #endif
  163. extern void Error(IDPMT idpmt);
  164.