Add two new methods needed for caret support (and other things): GetPointFromOffset, to get frame-relative coordinates of a given content offset, and GetChildFrameContainingOffset, to find the child frame that really contains the given content offset

This commit is contained in:
sfraser@netscape.com
1999-02-12 00:02:31 +00:00
parent 789471a279
commit 231eebc995
8 changed files with 308 additions and 40 deletions

View File

@@ -1863,6 +1863,23 @@ nsFrame::GetSelected(PRBool *aSelected, PRInt32 *aBeginOffset, PRInt32 *aEndOffs
return NS_OK;
}
NS_IMETHODIMP
nsFrame::GetPointFromOffset(nsIPresContext* inPresContext, nsIRenderingContext* inRendContext, PRInt32 inOffset, nsPoint* outPoint)
{
NS_PRECONDITION(outPoint != nsnull, "Null parameter");
nsPoint bottomLeft(0, 0);
*outPoint = bottomLeft;
return NS_OK;
}
NS_IMETHODIMP
nsFrame::GetChildFrameContainingOffset(PRInt32 inContentOffset, PRInt32* outFrameContentOffset, nsIFrame **outChildFrame)
{
NS_PRECONDITION(outChildFrame && outFrameContentOffset, "Null parameter");
*outFrameContentOffset = 0;
*outChildFrame = this;
return NS_OK;
}
NS_IMETHODIMP
nsFrame::PeekOffset(nsSelectionAmount aAmount, nsDirection aDirection, PRInt32 aStartOffset,