Beispiel #1
0
        internal static IInputElement InputHitTestTrack(
            PtsContext ptsContext,
            PTS.FSPOINT pt,
            ref PTS.FSTRACKDESCRIPTION trackDesc)
        {
            // There is possibility to get empty track. (example: large figures)
            if (trackDesc.pfstrack == IntPtr.Zero)
            {
                return(null);
            }

            IInputElement ie = null;

            // Get track details
            PTS.FSTRACKDETAILS trackDetails;
            PTS.Validate(PTS.FsQueryTrackDetails(ptsContext.Context, trackDesc.pfstrack, out trackDetails));

            // There might be possibility to get empty track, skip the track
            // in such case.
            if (trackDetails.cParas != 0)
            {
                // Get list of paragraphs
                PTS.FSPARADESCRIPTION[] arrayParaDesc;
                ParaListFromTrack(ptsContext, trackDesc.pfstrack, ref trackDetails, out arrayParaDesc);

                // Hittest list of paragraphs
                ie = InputHitTestParaList(ptsContext, pt, ref trackDesc.fsrc, arrayParaDesc);
            }

            return(ie);
        }
Beispiel #2
0
 // ------------------------------------------------------------------
 // Convert point from logical measurement unit to text measurement unit.
 // ------------------------------------------------------------------
 internal static PTS.FSPOINT ToTextPoint(Point point)
 {
     PTS.FSPOINT fspoint = new PTS.FSPOINT();
     fspoint.u = ToTextDpi(point.X);
     fspoint.v = ToTextDpi(point.Y);
     return(fspoint);
 }
        private IInputElement InputHitTestSection(PTS.FSPOINT pt, ref PTS.FSSECTIONDESCRIPTION sectionDesc)
        {
            IInputElement result = null;

            PTS.FSSECTIONDETAILS fssectiondetails;
            PTS.Validate(PTS.FsQuerySectionDetails(this.PtsContext.Context, sectionDesc.pfssection, out fssectiondetails));
            if (PTS.ToBoolean(fssectiondetails.fFootnotesAsPagenotes))
            {
                ErrorHandler.Assert(fssectiondetails.u.withpagenotes.cEndnoteColumns == 0, ErrorHandler.NotSupportedFootnotes);
                if (fssectiondetails.u.withpagenotes.cBasicColumns != 0)
                {
                    PTS.FSTRACKDESCRIPTION[] array;
                    PtsHelper.TrackListFromSection(this.PtsContext, sectionDesc.pfssection, ref fssectiondetails, out array);
                    for (int i = 0; i < array.Length; i++)
                    {
                        if (array[i].fsrc.Contains(pt))
                        {
                            result = PtsHelper.InputHitTestTrack(this.PtsContext, pt, ref array[i]);
                            break;
                        }
                    }
                }
            }
            else
            {
                ErrorHandler.Assert(false, ErrorHandler.NotSupportedCompositeColumns);
            }
            return(result);
        }
        internal override IInputElement InputHitTest(PTS.FSPOINT pt)
        {
            IInputElement ie = null;

            // Query paragraph details
            PTS.FSSUBTRACKDETAILS subtrackDetails;
            PTS.Validate(PTS.FsQuerySubtrackDetails(PtsContext.Context, _paraHandle.Value, out subtrackDetails));

            // Hittest subtrack content.

            // There might be possibility to get empty sub-track, skip the sub-track
            // in such case.
            if (subtrackDetails.cParas != 0)
            {
                // Get list of paragraphs
                PTS.FSPARADESCRIPTION [] arrayParaDesc;
                PtsHelper.ParaListFromSubtrack(PtsContext, _paraHandle.Value, ref subtrackDetails, out arrayParaDesc);

                // Render list of paragraphs
                ie = PtsHelper.InputHitTestParaList(PtsContext, pt, ref subtrackDetails.fsrc, arrayParaDesc);
            }

            // If nothing is hit, return the owner of the paragraph.
            if (ie == null && _rect.Contains(pt))
            {
                ie = Paragraph.Element as IInputElement;
            }

            return(ie);
        }
Beispiel #5
0
 /// <summary>
 /// Hit tests to the correct IInputElement within the paragraph that
 /// the mouse is over.
 /// </summary>
 internal override IInputElement InputHitTest(PTS.FSPOINT pt)
 {
     if (_rect.Contains(pt))
     {
         return(Paragraph.Element as IInputElement);
     }
     return(null);
 }
        // Token: 0x060069EE RID: 27118 RVA: 0x001E2040 File Offset: 0x001E0240
        internal IInputElement InputHitTest(Point p)
        {
            IInputElement result = null;

            if (!this.IsEmpty)
            {
                PTS.FSPOINT pt = TextDpi.ToTextPoint(p);
                result = this.InputHitTestPage(pt);
            }
            return(result);
        }
        internal override IInputElement InputHitTest(PTS.FSPOINT pt)
        {
            IInputElement inputElement = null;

            if (this._pageContextOfThisPage.FloatingElementList != null)
            {
                int num = 0;
                while (num < this._pageContextOfThisPage.FloatingElementList.Count && inputElement == null)
                {
                    BaseParaClient baseParaClient = this._pageContextOfThisPage.FloatingElementList[num];
                    inputElement = baseParaClient.InputHitTest(pt);
                    num++;
                }
            }
            if (inputElement == null)
            {
                PTS.FSSUBPAGEDETAILS fssubpagedetails;
                PTS.Validate(PTS.FsQuerySubpageDetails(base.PtsContext.Context, this._paraHandle.Value, out fssubpagedetails));
                if (base.Rect.Contains(pt))
                {
                    if (this.ContentRect.Contains(pt))
                    {
                        pt = new PTS.FSPOINT(pt.u - this.ContentRect.u, pt.v - this.ContentRect.v);
                        if (PTS.ToBoolean(fssubpagedetails.fSimple))
                        {
                            inputElement = PtsHelper.InputHitTestTrack(base.PtsContext, pt, ref fssubpagedetails.u.simple.trackdescr);
                        }
                        else if (fssubpagedetails.u.complex.cBasicColumns != 0)
                        {
                            PTS.FSTRACKDESCRIPTION[] array;
                            PtsHelper.TrackListFromSubpage(base.PtsContext, this._paraHandle.Value, ref fssubpagedetails, out array);
                            int num2 = 0;
                            while (num2 < array.Length && inputElement == null)
                            {
                                inputElement = PtsHelper.InputHitTestTrack(base.PtsContext, pt, ref array[num2]);
                                num2++;
                            }
                        }
                    }
                    if (inputElement == null)
                    {
                        inputElement = (base.Paragraph.Element as IInputElement);
                    }
                }
            }
            return(inputElement);
        }
Beispiel #8
0
        // Token: 0x06006934 RID: 26932 RVA: 0x001DC7DC File Offset: 0x001DA9DC
        internal static IInputElement InputHitTestParaList(PtsContext ptsContext, PTS.FSPOINT pt, ref PTS.FSRECT rcTrack, PTS.FSPARADESCRIPTION[] arrayParaDesc)
        {
            IInputElement inputElement = null;
            int           num          = 0;

            while (num < arrayParaDesc.Length && inputElement == null)
            {
                BaseParaClient baseParaClient = ptsContext.HandleToObject(arrayParaDesc[num].pfsparaclient) as BaseParaClient;
                PTS.ValidateHandle(baseParaClient);
                if (baseParaClient.Rect.Contains(pt))
                {
                    inputElement = baseParaClient.InputHitTest(pt);
                }
                num++;
            }
            return(inputElement);
        }
        private IInputElement InputHitTestPage(PTS.FSPOINT pt)
        {
            IInputElement inputElement = null;

            if (this._pageContextOfThisPage.FloatingElementList != null)
            {
                int num = 0;
                while (num < this._pageContextOfThisPage.FloatingElementList.Count && inputElement == null)
                {
                    BaseParaClient baseParaClient = this._pageContextOfThisPage.FloatingElementList[num];
                    inputElement = baseParaClient.InputHitTest(pt);
                    num++;
                }
            }
            if (inputElement == null)
            {
                PTS.FSPAGEDETAILS fspagedetails;
                PTS.Validate(PTS.FsQueryPageDetails(this.PtsContext.Context, this._ptsPage.Value, out fspagedetails));
                if (PTS.ToBoolean(fspagedetails.fSimple))
                {
                    if (fspagedetails.u.simple.trackdescr.fsrc.Contains(pt))
                    {
                        inputElement = PtsHelper.InputHitTestTrack(this.PtsContext, pt, ref fspagedetails.u.simple.trackdescr);
                    }
                }
                else
                {
                    ErrorHandler.Assert(fspagedetails.u.complex.cFootnoteColumns == 0, ErrorHandler.NotSupportedFootnotes);
                    if (fspagedetails.u.complex.cSections != 0)
                    {
                        PTS.FSSECTIONDESCRIPTION[] array;
                        PtsHelper.SectionListFromPage(this.PtsContext, this._ptsPage.Value, ref fspagedetails, out array);
                        int num2 = 0;
                        while (num2 < array.Length && inputElement == null)
                        {
                            if (array[num2].fsrc.Contains(pt))
                            {
                                inputElement = this.InputHitTestSection(pt, ref array[num2]);
                            }
                            num2++;
                        }
                    }
                }
            }
            return(inputElement);
        }
Beispiel #10
0
        internal static IInputElement InputHitTestTrack(PtsContext ptsContext, PTS.FSPOINT pt, ref PTS.FSTRACKDESCRIPTION trackDesc)
        {
            if (trackDesc.pfstrack == IntPtr.Zero)
            {
                return(null);
            }
            IInputElement result = null;

            PTS.FSTRACKDETAILS fstrackdetails;
            PTS.Validate(PTS.FsQueryTrackDetails(ptsContext.Context, trackDesc.pfstrack, out fstrackdetails));
            if (fstrackdetails.cParas != 0)
            {
                PTS.FSPARADESCRIPTION[] arrayParaDesc;
                PtsHelper.ParaListFromTrack(ptsContext, trackDesc.pfstrack, ref fstrackdetails, out arrayParaDesc);
                result = PtsHelper.InputHitTestParaList(ptsContext, pt, ref trackDesc.fsrc, arrayParaDesc);
            }
            return(result);
        }
Beispiel #11
0
        internal override IInputElement InputHitTest(PTS.FSPOINT pt)
        {
            IInputElement inputElement = null;

            PTS.FSSUBTRACKDETAILS fssubtrackdetails;
            PTS.Validate(PTS.FsQuerySubtrackDetails(base.PtsContext.Context, this._paraHandle.Value, out fssubtrackdetails));
            if (fssubtrackdetails.cParas != 0)
            {
                PTS.FSPARADESCRIPTION[] arrayParaDesc;
                PtsHelper.ParaListFromSubtrack(base.PtsContext, this._paraHandle.Value, ref fssubtrackdetails, out arrayParaDesc);
                inputElement = PtsHelper.InputHitTestParaList(base.PtsContext, pt, ref fssubtrackdetails.fsrc, arrayParaDesc);
            }
            if (inputElement == null && this._rect.Contains(pt))
            {
                inputElement = (base.Paragraph.Element as IInputElement);
            }
            return(inputElement);
        }
Beispiel #12
0
        // ------------------------------------------------------------------
        // Hit tests to the correct IInputElement within the list of
        // paragraphs that the mouse is over.
        // ------------------------------------------------------------------
        internal static IInputElement InputHitTestParaList(
            PtsContext ptsContext,
            PTS.FSPOINT pt,
            ref PTS.FSRECT rcTrack,                     // track's rectangle
            PTS.FSPARADESCRIPTION [] arrayParaDesc)
        {
            IInputElement ie = null;

            for (int index = 0; index < arrayParaDesc.Length && ie == null; index++)
            {
                BaseParaClient paraClient = ptsContext.HandleToObject(arrayParaDesc[index].pfsparaclient) as BaseParaClient;
                PTS.ValidateHandle(paraClient);

                if (paraClient.Rect.Contains(pt))
                {
                    ie = paraClient.InputHitTest(pt);
                }
            }
            return(ie);
        }
Beispiel #13
0
        internal override IInputElement InputHitTest(PTS.FSPOINT pt)
        {
            IInputElement ie = null;


            if (_pageContextOfThisPage.FloatingElementList != null)
            {
                for (int index = 0; index < _pageContextOfThisPage.FloatingElementList.Count && ie == null; index++)
                {
                    BaseParaClient floatingElement = _pageContextOfThisPage.FloatingElementList[index];

                    ie = floatingElement.InputHitTest(pt);
                }
            }

            if (ie == null)
            {
                // Query subpage details
                PTS.FSSUBPAGEDETAILS subpageDetails;
                PTS.Validate(PTS.FsQuerySubpageDetails(PtsContext.Context, _paraHandle.Value, out subpageDetails));

                if (Rect.Contains(pt))
                {
                    if (ContentRect.Contains(pt))
                    {
                        pt = new PTS.FSPOINT(pt.u - ContentRect.u, pt.v - ContentRect.v);

                        // Hittest subpage content. Subpage content may be simple or complex -
                        // depending of set of features used in the content of the page.
                        // (1) simple subpage (contains only one track)
                        // (2) complex subpage (contains columns)
                        if (PTS.ToBoolean(subpageDetails.fSimple))
                        {
                            ie = PtsHelper.InputHitTestTrack(PtsContext, pt, ref subpageDetails.u.simple.trackdescr);
                        }
                        else
                        {
                            // (2) complex page (contains columns)
                            // cBasicColumns == 0, means that subpage content is empty
                            if (subpageDetails.u.complex.cBasicColumns != 0)
                            {
                                // Retrieve description for each column.
                                PTS.FSTRACKDESCRIPTION[] arrayColumnDesc;
                                PtsHelper.TrackListFromSubpage(PtsContext, _paraHandle.Value, ref subpageDetails, out arrayColumnDesc);

                                // Arrange each track
                                for (int index = 0; index < arrayColumnDesc.Length && ie == null; index++)
                                {
                                    ie = PtsHelper.InputHitTestTrack(PtsContext, pt, ref arrayColumnDesc[index]);
                                }
                            }
                        }
                    }

                    if (ie == null)
                    {
                        ie = Paragraph.Element as IInputElement;
                    }
                }
            }

            return(ie);
        }
Beispiel #14
0
 // Token: 0x06006732 RID: 26418 RVA: 0x0000C238 File Offset: 0x0000A438
 internal virtual IInputElement InputHitTest(PTS.FSPOINT pt)
 {
     return(null);
 }