зеркало из https://github.com/mozilla/pjs.git
added new caret api implementation from new nsicaret api. EraseCaret. erase the caret without messing with visibility. forces a refresh of state to mDrawn=0; r=hyatt, bug = 34896
This commit is contained in:
Родитель
debb599cd2
Коммит
92f73bb9d2
|
@ -327,14 +327,23 @@ NS_IMETHODIMP nsCaret::ClearFrameRefs(nsIFrame* aFrame)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsCaret::EraseCaret()
|
||||
{
|
||||
if (mDrawn)
|
||||
DrawCaret();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
#ifdef XP_MAC
|
||||
#pragma mark -
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
NS_IMETHODIMP nsCaret::NotifySelectionChanged(nsIDOMDocument *, nsIDOMSelection *aDomSel, short)
|
||||
NS_IMETHODIMP nsCaret::NotifySelectionChanged(nsIDOMDocument *, nsIDOMSelection *aDomSel, short aReason)
|
||||
{
|
||||
if (aReason & nsIDOMSelectionListener::MOUSEUP_REASON)//this wont do
|
||||
return NS_OK;
|
||||
if (mVisible)
|
||||
StopBlinking();
|
||||
nsCOMPtr<nsIDOMSelection> domSel(do_QueryReferent(mDomSelectionWeak));
|
||||
|
@ -665,6 +674,7 @@ void nsCaret::DrawCaretWithContext(nsIRenderingContext* inRendContext)
|
|||
localRC->SetColor(NS_RGB(255,255,255));
|
||||
localRC->InvertRect(mCaretRect);
|
||||
ToggleDrawnStatus();
|
||||
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
@ -59,6 +59,7 @@ class nsCaret : public nsICaret,
|
|||
NS_IMETHOD SetCaretReadOnly(PRBool inMakeReadonly);
|
||||
NS_IMETHOD GetWindowRelativeCoordinates(nsRect& outCoordinates, PRBool& outIsCollapsed, nsIDOMSelection *inDOMSel);
|
||||
NS_IMETHOD ClearFrameRefs(nsIFrame* aFrame);
|
||||
NS_IMETHOD EraseCaret();
|
||||
|
||||
//nsIDOMSelectionListener interface
|
||||
NS_IMETHOD NotifySelectionChanged(nsIDOMDocument *aDoc, nsIDOMSelection *aSel, short aReason);
|
||||
|
|
|
@ -327,14 +327,23 @@ NS_IMETHODIMP nsCaret::ClearFrameRefs(nsIFrame* aFrame)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsCaret::EraseCaret()
|
||||
{
|
||||
if (mDrawn)
|
||||
DrawCaret();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
#ifdef XP_MAC
|
||||
#pragma mark -
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
NS_IMETHODIMP nsCaret::NotifySelectionChanged(nsIDOMDocument *, nsIDOMSelection *aDomSel, short)
|
||||
NS_IMETHODIMP nsCaret::NotifySelectionChanged(nsIDOMDocument *, nsIDOMSelection *aDomSel, short aReason)
|
||||
{
|
||||
if (aReason & nsIDOMSelectionListener::MOUSEUP_REASON)//this wont do
|
||||
return NS_OK;
|
||||
if (mVisible)
|
||||
StopBlinking();
|
||||
nsCOMPtr<nsIDOMSelection> domSel(do_QueryReferent(mDomSelectionWeak));
|
||||
|
@ -665,6 +674,7 @@ void nsCaret::DrawCaretWithContext(nsIRenderingContext* inRendContext)
|
|||
localRC->SetColor(NS_RGB(255,255,255));
|
||||
localRC->InvertRect(mCaretRect);
|
||||
ToggleDrawnStatus();
|
||||
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
@ -59,6 +59,7 @@ class nsCaret : public nsICaret,
|
|||
NS_IMETHOD SetCaretReadOnly(PRBool inMakeReadonly);
|
||||
NS_IMETHOD GetWindowRelativeCoordinates(nsRect& outCoordinates, PRBool& outIsCollapsed, nsIDOMSelection *inDOMSel);
|
||||
NS_IMETHOD ClearFrameRefs(nsIFrame* aFrame);
|
||||
NS_IMETHOD EraseCaret();
|
||||
|
||||
//nsIDOMSelectionListener interface
|
||||
NS_IMETHOD NotifySelectionChanged(nsIDOMDocument *aDoc, nsIDOMSelection *aSel, short aReason);
|
||||
|
|
Загрузка…
Ссылка в новой задаче