// ----------------------------------------------------------------- 
 // Arrange floater 
 //
 //      rcFloater - rectangle of the floater 
 //      rcHostPara - rectangle of the host text paragraph.
 //      fswdirParent- flow direction of parent
 //      pageContext - page context
 // ------------------------------------------------------------------ 
 internal virtual void ArrangeFloater(PTS.FSRECT rcFloater, PTS.FSRECT rcHostPara, uint fswdirParent, PageContext pageContext)
 { 
 } 
        // -----------------------------------------------------------------
        // Arrange floater 
        // 
        //      rcFloater - rectangle of the floater
        //      rcHostPara - rectangle of the host text paragraph. 
        // ------------------------------------------------------------------
        internal override void ArrangeFloater(PTS.FSRECT rcFloater, PTS.FSRECT rcHostPara, uint fswdirParent, PageContext pageContext)
        {
            // If alignment is set to Stretch and floater width is less than para width, center it 
            if (IsFloaterHorizontallyCentered(rcFloater, rcHostPara))
            { 
                rcFloater.u = rcHostPara.u + (rcHostPara.du - rcFloater.du) / 2; 
            }
 
            // Set paragraph rectangle (relative to the page)
            _rect = rcFloater;

            // Adjust rect to account for margins 
            // Add margin values to rect offsets and subtract them from rect widths
            MbpInfo mbp = MbpInfo.FromElement(Paragraph.Element); 
            _rect.v += mbp.MarginTop; 
            _rect.dv -= mbp.MarginTop + mbp.MarginBottom;
            _rect.u += mbp.MarginLeft; 
            _rect.du -= mbp.MarginLeft + mbp.MarginRight;

            _flowDirectionParent = PTS.FswdirToFlowDirection(fswdirParent);
            _flowDirection = (FlowDirection)Paragraph.Element.GetValue(FrameworkElement.FlowDirectionProperty); 
            _pageContext = pageContext;
 
            if(ThisFlowDirection != PageFlowDirection) 
            {
                mbp.MirrorBP(); 
            }

            _contentRect.u = _rect.u + mbp.BPLeft;
            _contentRect.du = Math.Max(TextDpi.ToTextDpi(TextDpi.MinWidth), _rect.du - mbp.BPRight - mbp.BPLeft); 
            _contentRect.v = _rect.v + mbp.BPTop;
            _contentRect.dv = Math.Max(TextDpi.ToTextDpi(TextDpi.MinWidth), _rect.dv - mbp.BPBottom - mbp.BPTop); 
 
            _paddingRect.u = _rect.u + mbp.BorderLeft;
            _paddingRect.du = Math.Max(TextDpi.ToTextDpi(TextDpi.MinWidth), _rect.du - mbp.BorderRight - mbp.BorderLeft); 
            _paddingRect.v = _rect.v + mbp.BorderTop;
            _paddingRect.dv = Math.Max(TextDpi.ToTextDpi(TextDpi.MinWidth), _rect.dv - mbp.BorderBottom - mbp.BorderTop);

            // Do paragraph specifc arrange 
            OnArrange();
        } 
Exemple #3
0
        // ------------------------------------------------------------------
        // Arrange figure
        //
        //      rcFigure - rectangle of the figure
        //      rcHostPara - rectangle of the host text paragraph.
        // ------------------------------------------------------------------
        internal void ArrangeFigure(PTS.FSRECT rcFigure, PTS.FSRECT rcHostPara, uint fswdirParent, PageContext pageContext)
        {
            // Set paragraph rectangle (relative to the page)
            _rect = rcFigure;

            // Adjust rect to account for margins
            // Add margin values to rect offsets and subtract them from rect widths
            MbpInfo mbp = MbpInfo.FromElement(Paragraph.Element);
            _rect.v += mbp.MarginTop;
            _rect.dv -= mbp.MarginTop + mbp.MarginBottom;
            _rect.u += mbp.MarginLeft;
            _rect.du -= mbp.MarginLeft + mbp.MarginRight;

            _pageContext = pageContext;

            // Cache flow directions
            _flowDirectionParent = PTS.FswdirToFlowDirection(fswdirParent);
            _flowDirection = (FlowDirection)Paragraph.Element.GetValue(FrameworkElement.FlowDirectionProperty);

            // Do paragraph specifc arrange
            OnArrange();
        }
        internal void Arrange(int du, int dv, PTS.FSRECT rcTable, FlowDirection tableFlowDirection, PageContext pageContext)
        {
            //
            // Determine cell width based on column widths.
            //
            CalculatedColumn[] calculatedColumns = _tableParaClient.CalculatedColumns;
            Debug.Assert(calculatedColumns != null
                        && (Cell.ColumnIndex + Cell.ColumnSpan) <= calculatedColumns.Length);

            double durCellSpacing = Table.InternalCellSpacing;
            double durCellWidth = -durCellSpacing;

            // find the width sum of all columns the cell spans
            int i = Cell.ColumnIndex + Cell.ColumnSpan - 1;

            do
            {
                durCellWidth += calculatedColumns[i].DurWidth + durCellSpacing;
            } while (--i >= ColumnIndex);

            if(tableFlowDirection != PageFlowDirection)
            {
                PTS.FSRECT pageRect = pageContext.PageRect;

                PTS.Validate(PTS.FsTransformRectangle(PTS.FlowDirectionToFswdir(PageFlowDirection), ref pageRect, ref rcTable, PTS.FlowDirectionToFswdir(tableFlowDirection), out rcTable));
            }

            _rect.u = du + rcTable.u;
            _rect.v = dv + rcTable.v;
            _rect.du = TextDpi.ToTextDpi(durCellWidth);
            _rect.dv = TextDpi.ToTextDpi(_arrangeHeight);

            if(tableFlowDirection != PageFlowDirection)
            {
                PTS.FSRECT pageRect = pageContext.PageRect;

                PTS.Validate(PTS.FsTransformRectangle(PTS.FlowDirectionToFswdir(tableFlowDirection), ref pageRect, ref _rect, PTS.FlowDirectionToFswdir(PageFlowDirection), out _rect));
            }

            _flowDirectionParent = tableFlowDirection;
            _flowDirection = (FlowDirection)Paragraph.Element.GetValue(FrameworkElement.FlowDirectionProperty);
            _pageContext = pageContext;

            OnArrange();

            if(_paraHandle.Value != IntPtr.Zero)
            {
                PTS.Validate(PTS.FsClearUpdateInfoInSubpage(PtsContext.Context, _paraHandle.Value), PtsContext);
            }
        }
Exemple #5
0
        internal void Arrange(int du, int dv, PTS.FSRECT rcTable, FlowDirection tableFlowDirection, PageContext pageContext)
        {
            //
            // Determine cell width based on column widths.
            //
            CalculatedColumn[] calculatedColumns = _tableParaClient.CalculatedColumns;
            Debug.Assert(calculatedColumns != null &&
                         (Cell.ColumnIndex + Cell.ColumnSpan) <= calculatedColumns.Length);

            double durCellSpacing = Table.InternalCellSpacing;
            double durCellWidth   = -durCellSpacing;

            // find the width sum of all columns the cell spans
            int i = Cell.ColumnIndex + Cell.ColumnSpan - 1;

            do
            {
                durCellWidth += calculatedColumns[i].DurWidth + durCellSpacing;
            } while (--i >= ColumnIndex);

            if (tableFlowDirection != PageFlowDirection)
            {
                PTS.FSRECT pageRect = pageContext.PageRect;

                PTS.Validate(PTS.FsTransformRectangle(PTS.FlowDirectionToFswdir(PageFlowDirection), ref pageRect, ref rcTable, PTS.FlowDirectionToFswdir(tableFlowDirection), out rcTable));
            }

            _rect.u  = du + rcTable.u;
            _rect.v  = dv + rcTable.v;
            _rect.du = TextDpi.ToTextDpi(durCellWidth);
            _rect.dv = TextDpi.ToTextDpi(_arrangeHeight);

            if (tableFlowDirection != PageFlowDirection)
            {
                PTS.FSRECT pageRect = pageContext.PageRect;

                PTS.Validate(PTS.FsTransformRectangle(PTS.FlowDirectionToFswdir(tableFlowDirection), ref pageRect, ref _rect, PTS.FlowDirectionToFswdir(PageFlowDirection), out _rect));
            }

            _flowDirectionParent = tableFlowDirection;
            _flowDirection       = (FlowDirection)Paragraph.Element.GetValue(FrameworkElement.FlowDirectionProperty);
            _pageContext         = pageContext;

            OnArrange();

            if (_paraHandle.Value != IntPtr.Zero)
            {
                PTS.Validate(PTS.FsClearUpdateInfoInSubpage(PtsContext.Context, _paraHandle.Value), PtsContext);
            }
        }
            /// <summary>
            /// PushNewPageData - Pushes new page data to the top of the stack. 
            /// </summary>
            /// <param name="pageContext">Page context we were formatted in</param>
            /// <param name="columnRect">Rect of current column</param>
            /// <param name="finitePage">Is the current page a Finite Page</param> 
            internal void PushNewPageData(PageContext pageContext, PTS.FSRECT columnRect, bool finitePage)
            { 
                _documentArrangeInfoStack.Push(_currentArrangeInfo); 

                _currentArrangeInfo.PageContext = pageContext; 
                _currentArrangeInfo.ColumnRect = columnRect;
                _currentArrangeInfo.FinitePage = finitePage;
            }
        // ------------------------------------------------------------------
        // Arrange figure
        //
        //      rcFigure - rectangle of the figure
        //      rcHostPara - rectangle of the host text paragraph.
        // ------------------------------------------------------------------
        internal void ArrangeFigure(PTS.FSRECT rcFigure, PTS.FSRECT rcHostPara, uint fswdirParent, PageContext pageContext)
        {
            // Set paragraph rectangle (relative to the page)
            _rect = rcFigure;

            // Adjust rect to account for margins
            // Add margin values to rect offsets and subtract them from rect widths
            MbpInfo mbp = MbpInfo.FromElement(Paragraph.Element, Paragraph.StructuralCache.TextFormatterHost.PixelsPerDip);

            _rect.v  += mbp.MarginTop;
            _rect.dv -= mbp.MarginTop + mbp.MarginBottom;
            _rect.u  += mbp.MarginLeft;
            _rect.du -= mbp.MarginLeft + mbp.MarginRight;

            _pageContext = pageContext;

            // Cache flow directions
            _flowDirectionParent = PTS.FswdirToFlowDirection(fswdirParent);
            _flowDirection       = (FlowDirection)Paragraph.Element.GetValue(FrameworkElement.FlowDirectionProperty);

            // Do paragraph specifc arrange
            OnArrange();
        }
 // ------------------------------------------------------------------
 // Arrange floater
 //
 //      rcFloater - rectangle of the floater
 //      rcHostPara - rectangle of the host text paragraph.
 //      fswdirParent- flow direction of parent
 //      pageContext - page context
 // ------------------------------------------------------------------
 internal virtual void ArrangeFloater(PTS.FSRECT rcFloater, PTS.FSRECT rcHostPara, uint fswdirParent, PageContext pageContext)
 {
 }
        // Token: 0x0600680B RID: 26635 RVA: 0x001D3C64 File Offset: 0x001D1E64
        internal override void ArrangeFloater(PTS.FSRECT rcFloater, PTS.FSRECT rcHostPara, uint fswdirParent, PageContext pageContext)
        {
            if (this.IsFloaterHorizontallyCentered(rcFloater, rcHostPara))
            {
                rcFloater.u = rcHostPara.u + (rcHostPara.du - rcFloater.du) / 2;
            }
            this._rect = rcFloater;
            MbpInfo mbpInfo = MbpInfo.FromElement(base.Paragraph.Element, base.Paragraph.StructuralCache.TextFormatterHost.PixelsPerDip);

            this._rect.v              = this._rect.v + mbpInfo.MarginTop;
            this._rect.dv             = this._rect.dv - (mbpInfo.MarginTop + mbpInfo.MarginBottom);
            this._rect.u              = this._rect.u + mbpInfo.MarginLeft;
            this._rect.du             = this._rect.du - (mbpInfo.MarginLeft + mbpInfo.MarginRight);
            this._flowDirectionParent = PTS.FswdirToFlowDirection(fswdirParent);
            this._flowDirection       = (FlowDirection)base.Paragraph.Element.GetValue(FrameworkElement.FlowDirectionProperty);
            this._pageContext         = pageContext;
            if (base.ThisFlowDirection != base.PageFlowDirection)
            {
                mbpInfo.MirrorBP();
            }
            this._contentRect.u  = this._rect.u + mbpInfo.BPLeft;
            this._contentRect.du = Math.Max(TextDpi.ToTextDpi(TextDpi.MinWidth), this._rect.du - mbpInfo.BPRight - mbpInfo.BPLeft);
            this._contentRect.v  = this._rect.v + mbpInfo.BPTop;
            this._contentRect.dv = Math.Max(TextDpi.ToTextDpi(TextDpi.MinWidth), this._rect.dv - mbpInfo.BPBottom - mbpInfo.BPTop);
            this._paddingRect.u  = this._rect.u + mbpInfo.BorderLeft;
            this._paddingRect.du = Math.Max(TextDpi.ToTextDpi(TextDpi.MinWidth), this._rect.du - mbpInfo.BorderRight - mbpInfo.BorderLeft);
            this._paddingRect.v  = this._rect.v + mbpInfo.BorderTop;
            this._paddingRect.dv = Math.Max(TextDpi.ToTextDpi(TextDpi.MinWidth), this._rect.dv - mbpInfo.BorderBottom - mbpInfo.BorderTop);
            this.OnArrange();
        }
        // ------------------------------------------------------------------
        // Arrange floater
        //
        //      rcFloater - rectangle of the floater
        //      rcHostPara - rectangle of the host text paragraph.
        // ------------------------------------------------------------------
        internal override void ArrangeFloater(PTS.FSRECT rcFloater, PTS.FSRECT rcHostPara, uint fswdirParent, PageContext pageContext)
        {
            // If alignment is set to Stretch and floater width is less than para width, center it
            if (IsFloaterHorizontallyCentered(rcFloater, rcHostPara))
            {
                rcFloater.u = rcHostPara.u + (rcHostPara.du - rcFloater.du) / 2;
            }

            // Set paragraph rectangle (relative to the page)
            _rect = rcFloater;

            // Adjust rect to account for margins
            // Add margin values to rect offsets and subtract them from rect widths
            MbpInfo mbp = MbpInfo.FromElement(Paragraph.Element);

            _rect.v  += mbp.MarginTop;
            _rect.dv -= mbp.MarginTop + mbp.MarginBottom;
            _rect.u  += mbp.MarginLeft;
            _rect.du -= mbp.MarginLeft + mbp.MarginRight;

            _flowDirectionParent = PTS.FswdirToFlowDirection(fswdirParent);
            _flowDirection       = (FlowDirection)Paragraph.Element.GetValue(FrameworkElement.FlowDirectionProperty);
            _pageContext         = pageContext;

            if (ThisFlowDirection != PageFlowDirection)
            {
                mbp.MirrorBP();
            }

            _contentRect.u  = _rect.u + mbp.BPLeft;
            _contentRect.du = Math.Max(TextDpi.ToTextDpi(TextDpi.MinWidth), _rect.du - mbp.BPRight - mbp.BPLeft);
            _contentRect.v  = _rect.v + mbp.BPTop;
            _contentRect.dv = Math.Max(TextDpi.ToTextDpi(TextDpi.MinWidth), _rect.dv - mbp.BPBottom - mbp.BPTop);

            _paddingRect.u  = _rect.u + mbp.BorderLeft;
            _paddingRect.du = Math.Max(TextDpi.ToTextDpi(TextDpi.MinWidth), _rect.du - mbp.BorderRight - mbp.BorderLeft);
            _paddingRect.v  = _rect.v + mbp.BorderTop;
            _paddingRect.dv = Math.Max(TextDpi.ToTextDpi(TextDpi.MinWidth), _rect.dv - mbp.BorderBottom - mbp.BorderTop);

            // Do paragraph specifc arrange
            OnArrange();
        }
Exemple #11
0
        // Token: 0x060067D8 RID: 26584 RVA: 0x001D20E0 File Offset: 0x001D02E0
        internal void ArrangeFigure(PTS.FSRECT rcFigure, PTS.FSRECT rcHostPara, uint fswdirParent, PageContext pageContext)
        {
            this._rect = rcFigure;
            MbpInfo mbpInfo = MbpInfo.FromElement(base.Paragraph.Element, base.Paragraph.StructuralCache.TextFormatterHost.PixelsPerDip);

            this._rect.v              = this._rect.v + mbpInfo.MarginTop;
            this._rect.dv             = this._rect.dv - (mbpInfo.MarginTop + mbpInfo.MarginBottom);
            this._rect.u              = this._rect.u + mbpInfo.MarginLeft;
            this._rect.du             = this._rect.du - (mbpInfo.MarginLeft + mbpInfo.MarginRight);
            this._pageContext         = pageContext;
            this._flowDirectionParent = PTS.FswdirToFlowDirection(fswdirParent);
            this._flowDirection       = (FlowDirection)base.Paragraph.Element.GetValue(FrameworkElement.FlowDirectionProperty);
            this.OnArrange();
        }