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.

181 lines
5.3 KiB

  1. #ifndef LSC_DEFINED
  2. #define LSC_DEFINED
  3. #include "lsidefs.h"
  4. #include "plsdnode.h"
  5. #include "plsline.h"
  6. #include "plssubl.h"
  7. #include "pqheap.h"
  8. #include "lsiocon.h"
  9. #include "lstbcon.h"
  10. #include "lscbk.h"
  11. #include "lsdocinf.h"
  12. #include "lschcon.h"
  13. #include "lsbrjust.h"
  14. typedef LSCHUNKCONTEXT LSCHUNKCONTEXTSTORAGE;
  15. #define tagLSC Tag('L','S','C',':')
  16. #define FIsLSC(p) FHasTag(p,tagLSC)
  17. enum LsState /* state and activity of Line Services */
  18. {
  19. LsStateNotReady, /* doc properties has not been set */
  20. LsStateFree, /* ready and are not involved in any activity */
  21. LsStateCreatingContext, /* LsCreatContext is working */
  22. LsStateDestroyingContext, /* LsDestroyContext is working */
  23. LsStateSettingDoc, /* LsSetDoc is working */
  24. LsStateFormatting, /* LsCreateLine (formating stage) is working */
  25. LsStateBreaking, /* LsCreateLine (breaking stage) is working */
  26. LsStateDestroyingLine, /* LsDestroyLine is working */
  27. LsStatePreparingForDisplay, /* PrepareLineForDisplayProc called from LsDisplay or queries is working */
  28. LsStateDisplaying, /* LsDisplayLine is working */
  29. LsStateQuerying, /* we are within one of queries */
  30. LsStateEnumerating /* LsEnumLine is working */
  31. };
  32. typedef enum LsState LSSTATE;
  33. typedef struct
  34. /* this contains information that is used during preparaning for display time */
  35. {
  36. BOOL fLineCompressed; /* default value is fFalse,
  37. is set to fTrue in breaking time if we apply compression to fit text into a line */
  38. BOOL fLineContainsAutoNumber;
  39. BOOL fUnderlineTrailSpacesRM; /* Underline trailing spaces until RM?*/
  40. BOOL fForgetLastTabAlignment; /* disregard dup of the last tab during center or right aligment
  41. if last tab is not left tab Word - bug compatibility */
  42. BOOL fNominalToIdealEncounted; /* nominal to ideal has been applied during formatting */
  43. BOOL fForeignObjectEncounted; /* object different from text happend during formatting */
  44. BOOL fTabEncounted; /* tab dnode was created during formatting */
  45. BOOL fNonLeftTabEncounted; /* tab dnode with non left tab stop was created */
  46. BOOL fSubmittedSublineEncounted; /* LsdnSubmitSublines was called during formatting */
  47. BOOL fAutodecimalTabPresent; /* there is autodecimal tab on this line */
  48. LSKJUST lskj; /* justification type */
  49. LSKALIGN lskalign; /* Alignment type */
  50. LSBREAKJUST lsbrj; /* break/justification behavior */
  51. long urLeftIndent; /* left indent */
  52. long urStartAutonumberingText; /* starting position of autonumbering text */
  53. long urStartMainText; /* starting position of text after autonumber */
  54. long urRightMarginJustify; /* right margin for justification */
  55. } LSADJUSTCONTEXT;
  56. typedef struct
  57. /* This structure contains information which is used for snap to grid allignment. Is not valid if snap to
  58. grid is off */
  59. {
  60. long urColumn; /* scaled to reference device value of uaColumn which has been passed to LsCreateLine */
  61. } LSGRIDTCONTEXT;
  62. typedef struct
  63. /* This structure contains current state of a formatting process. Good place for all information that is
  64. important only during formatting time */
  65. {
  66. PLSDNODE plsdnToFinish;
  67. PLSSUBL plssublCurrent;
  68. DWORD nDepthFormatLineCurrent;
  69. } LSLISTCONTEXT;
  70. struct lscontext
  71. {
  72. DWORD tag;
  73. POLS pols;
  74. LSCBK lscbk;
  75. BOOL fDontReleaseRuns;
  76. long cLinesActive;
  77. PLSLINE plslineCur;
  78. PLSLINE plslineDisplay; /* temporary */
  79. PQHEAP pqhLines;
  80. PQHEAP pqhAllDNodesRecycled;
  81. LSCHUNKCONTEXTSTORAGE lschunkcontextStorage; /* memory that is shared by all main sublines */
  82. LSSTATE lsstate;
  83. BOOL fIgnoreSplatBreak;
  84. BOOL fLimSplat; /* Splat to display at cpLimPara */
  85. BOOL fHyphenated; /* current line was ended by hyphen */
  86. BOOL fAdvanceBack; /* current line contains advance pen with negative move */
  87. DWORD grpfManager; /* Manager part of lsffi flags */
  88. long urRightMarginBreak;
  89. long lMarginIncreaseCoefficient; /* used for increasing right margin
  90. LONG_MIN means don't increase */
  91. long urHangingTab; /* used by autonumber */
  92. LSDOCINF lsdocinf;
  93. LSTABSCONTEXT lstabscontext;
  94. LSADJUSTCONTEXT lsadjustcontext;
  95. LSGRIDTCONTEXT lsgridcontext;
  96. LSLISTCONTEXT lslistcontext;
  97. LSIOBJCONTEXT lsiobjcontext; /* should be last*/
  98. };
  99. #define FDisplay(p) (Assert(FIsLSC(p)), (p)->lsdocinf.fDisplay)
  100. #define FIsLSCBusy(p) (Assert(FIsLSC(p)), \
  101. !(((p)->lsstate == LsStateNotReady) || ((p)->lsstate == LsStateFree)))
  102. #define FFormattingAllowed(p) (Assert(FIsLSC(p)), (p)->lsstate == LsStateFormatting)
  103. #define FBreakingAllowed(p) (Assert(FIsLSC(p)), (p)->lsstate == LsStateBreaking)
  104. #define FWorkWithCurrentLine(plsc) (Assert(FIsLSC(plsc)), \
  105. ((plsc)->lsstate == LsStateFormatting || \
  106. (plsc)->lsstate == LsStateBreaking || \
  107. (plsc)->lsstate == LsStatePreparingForDisplay))
  108. #define FBreakthroughLine(plsc) ((plsc)->plslineCur->lslinfo.fTabInMarginExLine)
  109. #define GetPqhAllDNodes(plsc) ((plsc)->plslineCur->pqhAllDNodes)
  110. #ifdef DEBUG
  111. /* this function verify that nobody spoiled context */
  112. BOOL FIsLsContextValid(PLSC plsc);
  113. #endif
  114. #endif /* LSC_DEFINED */