Пример #1
0
        //-------------------------------------------------------------------
        //
        //  Constructors
        //
        //-------------------------------------------------------------------

        #region Constructors

        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="host">
        /// TextFormatter host
        /// </param>
        /// <param name="cpPara">
        /// Character position of paragraph
        /// </param>
        /// <param name="durTrack">
        /// Track width
        /// </param>
        /// <param name="paraClient">
        /// Owner of the line
        /// </param>
        /// <param name="runCache">
        /// Text run cache
        /// </param>
        internal OptimalTextSource(TextFormatterHost host, int cpPara, int durTrack, TextParaClient paraClient, TextRunCache runCache) : base(paraClient)
        {
            _host     = host;
            _durTrack = durTrack;
            _runCache = runCache;
            _cpPara   = cpPara;
        }
 // ------------------------------------------------------------------
 // Constructor.
 //
 //      PtsContext - Context
 //      TextParagraphCache - Contained line break
 // ------------------------------------------------------------------
 internal OptimalBreakSession(TextParagraph textParagraph, TextParaClient textParaClient, TextParagraphCache TextParagraphCache, OptimalTextSource optimalTextSource) : base(textParagraph.PtsContext)
 {
     _textParagraph      = textParagraph;
     _textParaClient     = textParaClient;
     _textParagraphCache = TextParagraphCache;
     _optimalTextSource  = optimalTextSource;
 }
Пример #3
0
 // Token: 0x0600685F RID: 26719 RVA: 0x001D6A34 File Offset: 0x001D4C34
 internal Line(TextFormatterHost host, TextParaClient paraClient, int cpPara) : base(paraClient)
 {
     this._host          = host;
     this._cpPara        = cpPara;
     this._textAlignment = (TextAlignment)this.TextParagraph.Element.GetValue(Block.TextAlignmentProperty);
     this._indent        = 0.0;
 }
Пример #4
0
        // Token: 0x06006B27 RID: 27431 RVA: 0x001EEE9C File Offset: 0x001ED09C
        internal IList <TextBreakpoint> FormatLineVariants(TextParaClient textParaClient, TextParagraphCache textParagraphCache, OptimalTextSource optimalTextSource, int dcp, TextLineBreak textLineBreak, uint fswdir, int urStartLine, int durLine, bool allowHyphenation, bool clearOnLeft, bool clearOnRight, bool treatAsFirstInPara, bool treatAsLastInPara, bool suppressTopSpace, IntPtr lineVariantRestriction, out int iLineBestVariant)
        {
            base.StructuralCache.TextFormatterHost.Context = optimalTextSource;
            IList <TextBreakpoint> result = textParagraphCache.FormatBreakpoints(dcp, textLineBreak, lineVariantRestriction, TextDpi.FromTextDpi(durLine), out iLineBestVariant);

            base.StructuralCache.TextFormatterHost.Context = null;
            return(result);
        }
Пример #5
0
        //-------------------------------------------------------------------
        //
        //  Constructors
        //
        //-------------------------------------------------------------------

        #region Constructors

        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="owner">Owner of the line.</param>
        /// <param name="dcp">Index of the first character in the line.</param>
        /// <param name="cch">Number of all characters in the line.</param>
        /// <param name="layoutBox">Rectangle of the line within a text paragraph.</param>
        /// <param name="baseline">Distance from the top of the line to the baseline.</param>
        internal TextParaLineResult(TextParaClient owner, int dcp, int cch, Rect layoutBox, double baseline)
        {
            _owner      = owner;
            _dcp        = dcp;
            _cch        = cch;
            _layoutBox  = layoutBox;
            _baseline   = baseline;
            _cchContent = _cchEllipses = -1;
        }
Пример #6
0
 // Token: 0x06006B56 RID: 27478 RVA: 0x001EFF8C File Offset: 0x001EE18C
 internal TextParaLineResult(TextParaClient owner, int dcp, int cch, Rect layoutBox, double baseline)
 {
     this._owner      = owner;
     this._dcp        = dcp;
     this._cch        = cch;
     this._layoutBox  = layoutBox;
     this._baseline   = baseline;
     this._cchContent = (this._cchEllipses = -1);
 }
Пример #7
0
        // Token: 0x06006B23 RID: 27427 RVA: 0x001EED14 File Offset: 0x001ECF14
        internal void CreateOptimalBreakSession(TextParaClient textParaClient, int dcpStart, int durTrack, LineBreakRecord lineBreakRecord, out OptimalBreakSession optimalBreakSession, out bool isParagraphJustified)
        {
            this._textRunCache = new TextRunCache();
            TextFormatter     textFormatter     = base.StructuralCache.TextFormatterHost.TextFormatter;
            TextLineBreak     previousLineBreak = (lineBreakRecord != null) ? lineBreakRecord.TextLineBreak : null;
            OptimalTextSource optimalTextSource = new OptimalTextSource(base.StructuralCache.TextFormatterHost, base.ParagraphStartCharacterPosition, durTrack, textParaClient, this._textRunCache);

            base.StructuralCache.TextFormatterHost.Context = optimalTextSource;
            TextParagraphCache textParagraphCache = textFormatter.CreateParagraphCache(base.StructuralCache.TextFormatterHost, dcpStart, TextDpi.FromTextDpi(durTrack), this.GetLineProperties(true, dcpStart), previousLineBreak, this._textRunCache);

            base.StructuralCache.TextFormatterHost.Context = null;
            optimalBreakSession  = new OptimalBreakSession(this, textParaClient, textParagraphCache, optimalTextSource);
            isParagraphJustified = ((TextAlignment)base.Element.GetValue(Block.TextAlignmentProperty) == TextAlignment.Justify);
        }
Пример #8
0
        // Token: 0x06006B28 RID: 27432 RVA: 0x001EEEE4 File Offset: 0x001ED0E4
        internal void ReconstructLineVariant(TextParaClient paraClient, int iArea, int dcp, IntPtr pbrlineIn, int dcpLineIn, uint fswdir, int urStartLine, int durLine, int urStartTrack, int durTrack, int urPageLeftMargin, bool fAllowHyphenation, bool fClearOnLeft, bool fClearOnRight, bool fTreatAsFirstInPara, bool fTreatAsLastInPara, bool fSuppressTopSpace, out IntPtr lineHandle, out int dcpLine, out IntPtr ppbrlineOut, out int fForcedBroken, out PTS.FSFLRES fsflres, out int dvrAscent, out int dvrDescent, out int urBBox, out int durBBox, out int dcpDepend, out int fReformatNeighborsAsLastLine)
        {
            Invariant.Assert(iArea == 0);
            base.StructuralCache.CurrentFormatContext.OnFormatLine();
            Line line = new Line(base.StructuralCache.TextFormatterHost, paraClient, base.ParagraphStartCharacterPosition);

            this.FormatLineCore(line, pbrlineIn, new Line.FormattingContext(true, fClearOnLeft, fClearOnRight, this._textRunCache)
            {
                LineFormatLengthTarget = dcpLineIn
            }, dcp, durLine, durTrack, fTreatAsFirstInPara, dcp);
            lineHandle = line.Handle;
            dcpLine    = line.SafeLength;
            TextLineBreak textLineBreak = line.GetTextLineBreak();

            if (textLineBreak != null)
            {
                LineBreakRecord lineBreakRecord = new LineBreakRecord(base.PtsContext, textLineBreak);
                ppbrlineOut = lineBreakRecord.Handle;
            }
            else
            {
                ppbrlineOut = IntPtr.Zero;
            }
            fForcedBroken = PTS.FromBoolean(line.IsTruncated);
            fsflres       = line.FormattingResult;
            dvrAscent     = line.Baseline;
            dvrDescent    = line.Height - line.Baseline;
            urBBox        = urStartLine + line.Start;
            durBBox       = line.Width;
            dcpDepend     = line.DependantLength;
            fReformatNeighborsAsLastLine = 0;
            this.CalcLineAscentDescent(dcp, ref dvrAscent, ref dvrDescent);
            int num         = base.ParagraphStartCharacterPosition + dcp + line.ActualLength + dcpDepend;
            int symbolCount = base.StructuralCache.TextContainer.SymbolCount;

            if (num > symbolCount)
            {
                num = symbolCount;
            }
            base.StructuralCache.CurrentFormatContext.DependentMax = base.StructuralCache.TextContainer.CreatePointerAtOffset(num, LogicalDirection.Backward);
        }
Пример #9
0
        //-------------------------------------------------------------------
        //
        //  Constructors
        //
        //-------------------------------------------------------------------

        #region Constructors

        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="paraClient">Object representing a paragraph.</param>
        internal TextParagraphResult(TextParaClient paraClient)
            : base(paraClient)
        {
        }
Пример #10
0
        // Token: 0x06006B21 RID: 27425 RVA: 0x001EEC54 File Offset: 0x001ECE54
        internal override void CreateParaclient(out IntPtr paraClientHandle)
        {
            TextParaClient textParaClient = new TextParaClient(this);

            paraClientHandle = textParaClient.Handle;
        }