r=ftang, sr=kin@netscape.com
Cursor is an ambigous term - use caret to refer to the text caret in Bidi functions


git-svn-id: svn://10.0.0.236/trunk@104268 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mkaply%us.ibm.com 2001-09-30 20:35:55 +00:00
parent 56a9af87d4
commit 5c53d0b96c
15 changed files with 63 additions and 63 deletions

View File

@ -1629,7 +1629,7 @@ nsSelection::MoveCaret(PRUint32 aKeycode, PRBool aContinue, nsSelectionAmount aA
// set the cursor Bidi level to the paragraph embedding level
theFrame->GetBidiProperty(context, nsLayoutAtoms::baseLevel, (void**)&level,
sizeof(level) );
shell->SetCursorBidiLevel(level);
shell->SetCaretBidiLevel(level);
break;
default:
@ -1640,7 +1640,7 @@ nsSelection::MoveCaret(PRUint32 aKeycode, PRBool aContinue, nsSelectionAmount aA
{
theFrame->GetBidiProperty(context, nsLayoutAtoms::embeddingLevel, (void**)&level,
sizeof(level) );
shell->SetCursorBidiLevel(level);
shell->SetCaretBidiLevel(level);
}
else
BidiLevelFromMove(context, shell, pos.mResultContent, pos.mContentOffset, aKeycode);
@ -2460,7 +2460,7 @@ void nsSelection::BidiLevelFromMove(nsIPresContext* aContext,
nsIFrame* firstFrame=nsnull;
nsIFrame* secondFrame=nsnull;
aPresShell->GetCursorBidiLevel(&currentLevel);
aPresShell->GetCaretBidiLevel(&currentLevel);
switch (aKeycode) {
@ -2469,9 +2469,9 @@ void nsSelection::BidiLevelFromMove(nsIPresContext* aContext,
case nsIDOMKeyEvent::DOM_VK_LEFT:
GetPrevNextBidiLevels(aContext, aNode, aContentOffset, &firstFrame, &secondFrame, &firstLevel, &secondLevel);
if (HINTLEFT==mHint)
aPresShell->SetCursorBidiLevel(firstLevel);
aPresShell->SetCaretBidiLevel(firstLevel);
else
aPresShell->SetCursorBidiLevel(secondLevel);
aPresShell->SetCaretBidiLevel(secondLevel);
break;
/*
@ -2479,12 +2479,12 @@ void nsSelection::BidiLevelFromMove(nsIPresContext* aContext,
case nsIDOMKeyEvent::DOM_VK_UP:
case nsIDOMKeyEvent::DOM_VK_DOWN:
GetPrevNextBidiLevels(aContext, aNode, aContentOffset, &firstFrame, &secondFrame, &firstLevel, &secondLevel);
aPresShell->SetCursorBidiLevel(PR_MIN(firstLevel, secondLevel));
aPresShell->SetCaretBidiLevel(PR_MIN(firstLevel, secondLevel));
break;
*/
default:
aPresShell->UndefineCursorBidiLevel();
aPresShell->UndefineCaretBidiLevel();
}
}
@ -2516,7 +2516,7 @@ void nsSelection::BidiLevelFromClick(nsIContent *aNode, PRUint32 aContentOffset)
clickInFrame->GetBidiProperty(context, nsLayoutAtoms::embeddingLevel,
(void**)&frameLevel, sizeof(frameLevel) );
shell->SetCursorBidiLevel(frameLevel);
shell->SetCaretBidiLevel(frameLevel);
}
#endif //IBMBIDI
@ -7596,17 +7596,17 @@ nsTypedSelection::SelectionLanguageChange(PRBool aLangRTL)
if ((level != levelBefore) && (level != levelAfter))
level = PR_MIN(levelBefore, levelAfter);
if ((level & 1) == aLangRTL)
shell->SetCursorBidiLevel(level);
shell->SetCaretBidiLevel(level);
else
shell->SetCursorBidiLevel(level + 1);
shell->SetCaretBidiLevel(level + 1);
}
else {
// if cursor is between characters with opposite orientations, changing the keyboard language must change
// the cursor level to that of the adjacent character with the orientation corresponding to the new language.
if ((levelBefore & 1) == aLangRTL)
shell->SetCursorBidiLevel(levelBefore);
shell->SetCaretBidiLevel(levelBefore);
else
shell->SetCursorBidiLevel(levelAfter);
shell->SetCaretBidiLevel(levelAfter);
}
#endif // IBMBIDI
return NS_OK;

View File

@ -342,7 +342,7 @@ nsHTMLEditRules::AfterEdit(PRInt32 action, nsIEditor::EDirection aDirection)
nsCOMPtr<nsIPresShell> shell;
mEditor->GetPresShell(getter_AddRefs(shell));
if (shell) {
shell->UndefineCursorBidiLevel();
shell->UndefineCaretBidiLevel();
}
}
#endif

View File

@ -233,7 +233,7 @@ nsTextEditRules::AfterEdit(PRInt32 action, nsIEditor::EDirection aDirection)
nsCOMPtr<nsIPresShell> shell;
mEditor->GetPresShell(getter_AddRefs(shell));
if (shell) {
shell->UndefineCursorBidiLevel();
shell->UndefineCaretBidiLevel();
}
}
#endif

View File

@ -139,7 +139,7 @@ nsTextEditRules::CheckBidiLevelForDeletion(nsIDOMNode *aSelNode,
{
levelAfter = levelBefore;
}
res = shell->GetCursorBidiLevel(&currentCursorLevel);
res = shell->GetCaretBidiLevel(&currentCursorLevel);
if (NS_FAILED(res))
return res;
levelOfDeletion = (nsIEditor::eNext==aAction) ? levelAfter : levelBefore;
@ -156,7 +156,7 @@ nsTextEditRules::CheckBidiLevelForDeletion(nsIDOMNode *aSelNode,
// Set the bidi level of the caret to that of the
// character that will be (or would have been) deleted
res = shell->SetCursorBidiLevel(levelOfDeletion);
res = shell->SetCaretBidiLevel(levelOfDeletion);
if (NS_FAILED(res))
return res;
}

View File

@ -342,7 +342,7 @@ nsHTMLEditRules::AfterEdit(PRInt32 action, nsIEditor::EDirection aDirection)
nsCOMPtr<nsIPresShell> shell;
mEditor->GetPresShell(getter_AddRefs(shell));
if (shell) {
shell->UndefineCursorBidiLevel();
shell->UndefineCaretBidiLevel();
}
}
#endif

View File

@ -233,7 +233,7 @@ nsTextEditRules::AfterEdit(PRInt32 action, nsIEditor::EDirection aDirection)
nsCOMPtr<nsIPresShell> shell;
mEditor->GetPresShell(getter_AddRefs(shell));
if (shell) {
shell->UndefineCursorBidiLevel();
shell->UndefineCaretBidiLevel();
}
}
#endif

View File

@ -139,7 +139,7 @@ nsTextEditRules::CheckBidiLevelForDeletion(nsIDOMNode *aSelNode,
{
levelAfter = levelBefore;
}
res = shell->GetCursorBidiLevel(&currentCursorLevel);
res = shell->GetCaretBidiLevel(&currentCursorLevel);
if (NS_FAILED(res))
return res;
levelOfDeletion = (nsIEditor::eNext==aAction) ? levelAfter : levelBefore;
@ -156,7 +156,7 @@ nsTextEditRules::CheckBidiLevelForDeletion(nsIDOMNode *aSelNode,
// Set the bidi level of the caret to that of the
// character that will be (or would have been) deleted
res = shell->SetCursorBidiLevel(levelOfDeletion);
res = shell->SetCaretBidiLevel(levelOfDeletion);
if (NS_FAILED(res))
return res;
}

View File

@ -556,7 +556,7 @@ PRBool nsCaret::SetupDrawingFrameAndOffset()
if (bidiEnabled)
{
presShell->GetCursorBidiLevel(&bidiLevel);
presShell->GetCaretBidiLevel(&bidiLevel);
if (bidiLevel & BIDI_LEVEL_UNDEFINED)
{
PRUint8 newBidiLevel;
@ -568,7 +568,7 @@ PRBool nsCaret::SetupDrawingFrameAndOffset()
{
theFrame->GetBidiProperty(presContext, nsLayoutAtoms::embeddingLevel,
(void**)&newBidiLevel, sizeof(newBidiLevel) );
presShell->SetCursorBidiLevel(newBidiLevel);
presShell->SetCaretBidiLevel(newBidiLevel);
bidiLevel = newBidiLevel;
}
}

View File

@ -95,7 +95,7 @@ class nsIDOMNode;
#define VERIFY_REFLOW_INCLUDE_SPACE_MANAGER 0x40
#define VERIFY_REFLOW_DURING_RESIZE_REFLOW 0x80
#ifdef IBMBIDI // Constant for Set/Get CursorBidiLevel
#ifdef IBMBIDI // Constant for Set/Get CaretBidiLevel
#define BIDI_LEVEL_UNDEFINED 0x80
#endif
@ -567,19 +567,19 @@ public:
#ifdef IBMBIDI
/**
* SetCursorBidiLevel will set the Bidi embedding level for the cursor. 0-63
* SetCaretBidiLevel will set the Bidi embedding level for the cursor. 0-63
*/
NS_IMETHOD SetCursorBidiLevel(PRUint8 aLevel) = 0;
NS_IMETHOD SetCaretBidiLevel(PRUint8 aLevel) = 0;
/**
* GetCursorBidiLevel will get the Bidi embedding level for the cursor. 0-63
* GetCaretBidiLevel will get the Bidi embedding level for the cursor. 0-63
*/
NS_IMETHOD GetCursorBidiLevel(PRUint8 *aOutLevel) = 0;
NS_IMETHOD GetCaretBidiLevel(PRUint8 *aOutLevel) = 0;
/**
* UndefineCursorBidiLevel will set the Bidi embedding level for the cursor to an out-of-range value
* UndefineCaretBidiLevel will set the Bidi embedding level for the cursor to an out-of-range value
*/
NS_IMETHOD UndefineCursorBidiLevel(void) = 0;
NS_IMETHOD UndefineCaretBidiLevel(void) = 0;
/**
* Reconstruct and reflow frame model

View File

@ -939,9 +939,9 @@ public:
NS_IMETHOD IsReflowLocked(PRBool* aIsLocked);
#ifdef IBMBIDI
NS_IMETHOD SetCursorBidiLevel(PRUint8 aLevel);
NS_IMETHOD GetCursorBidiLevel(PRUint8 *aOutLevel);
NS_IMETHOD UndefineCursorBidiLevel();
NS_IMETHOD SetCaretBidiLevel(PRUint8 aLevel);
NS_IMETHOD GetCaretBidiLevel(PRUint8 *aOutLevel);
NS_IMETHOD UndefineCaretBidiLevel();
NS_IMETHOD BidiStyleChangeReflow();
#endif
@ -5322,7 +5322,7 @@ PresShell::GetPlaceholderFrameFor(nsIFrame* aFrame,
}
#ifdef IBMBIDI
NS_IMETHODIMP
PresShell::SetCursorBidiLevel(PRUint8 aLevel)
PresShell::SetCaretBidiLevel(PRUint8 aLevel)
{
// If the current level is undefined, we have just inserted new text.
// In this case, we don't want to reset the keyboard language
@ -5337,7 +5337,7 @@ PresShell::SetCursorBidiLevel(PRUint8 aLevel)
}
NS_IMETHODIMP
PresShell::GetCursorBidiLevel(PRUint8 *aOutLevel)
PresShell::GetCaretBidiLevel(PRUint8 *aOutLevel)
{
if (!aOutLevel) { return NS_ERROR_INVALID_ARG; }
*aOutLevel = mBidiLevel;
@ -5345,7 +5345,7 @@ PresShell::GetCursorBidiLevel(PRUint8 *aOutLevel)
}
NS_IMETHODIMP
PresShell::UndefineCursorBidiLevel()
PresShell::UndefineCaretBidiLevel()
{
mBidiLevel |= BIDI_LEVEL_UNDEFINED;
return NS_OK;

View File

@ -95,7 +95,7 @@ class nsIDOMNode;
#define VERIFY_REFLOW_INCLUDE_SPACE_MANAGER 0x40
#define VERIFY_REFLOW_DURING_RESIZE_REFLOW 0x80
#ifdef IBMBIDI // Constant for Set/Get CursorBidiLevel
#ifdef IBMBIDI // Constant for Set/Get CaretBidiLevel
#define BIDI_LEVEL_UNDEFINED 0x80
#endif
@ -567,19 +567,19 @@ public:
#ifdef IBMBIDI
/**
* SetCursorBidiLevel will set the Bidi embedding level for the cursor. 0-63
* SetCaretBidiLevel will set the Bidi embedding level for the cursor. 0-63
*/
NS_IMETHOD SetCursorBidiLevel(PRUint8 aLevel) = 0;
NS_IMETHOD SetCaretBidiLevel(PRUint8 aLevel) = 0;
/**
* GetCursorBidiLevel will get the Bidi embedding level for the cursor. 0-63
* GetCaretBidiLevel will get the Bidi embedding level for the cursor. 0-63
*/
NS_IMETHOD GetCursorBidiLevel(PRUint8 *aOutLevel) = 0;
NS_IMETHOD GetCaretBidiLevel(PRUint8 *aOutLevel) = 0;
/**
* UndefineCursorBidiLevel will set the Bidi embedding level for the cursor to an out-of-range value
* UndefineCaretBidiLevel will set the Bidi embedding level for the cursor to an out-of-range value
*/
NS_IMETHOD UndefineCursorBidiLevel(void) = 0;
NS_IMETHOD UndefineCaretBidiLevel(void) = 0;
/**
* Reconstruct and reflow frame model

View File

@ -556,7 +556,7 @@ PRBool nsCaret::SetupDrawingFrameAndOffset()
if (bidiEnabled)
{
presShell->GetCursorBidiLevel(&bidiLevel);
presShell->GetCaretBidiLevel(&bidiLevel);
if (bidiLevel & BIDI_LEVEL_UNDEFINED)
{
PRUint8 newBidiLevel;
@ -568,7 +568,7 @@ PRBool nsCaret::SetupDrawingFrameAndOffset()
{
theFrame->GetBidiProperty(presContext, nsLayoutAtoms::embeddingLevel,
(void**)&newBidiLevel, sizeof(newBidiLevel) );
presShell->SetCursorBidiLevel(newBidiLevel);
presShell->SetCaretBidiLevel(newBidiLevel);
bidiLevel = newBidiLevel;
}
}

View File

@ -1629,7 +1629,7 @@ nsSelection::MoveCaret(PRUint32 aKeycode, PRBool aContinue, nsSelectionAmount aA
// set the cursor Bidi level to the paragraph embedding level
theFrame->GetBidiProperty(context, nsLayoutAtoms::baseLevel, (void**)&level,
sizeof(level) );
shell->SetCursorBidiLevel(level);
shell->SetCaretBidiLevel(level);
break;
default:
@ -1640,7 +1640,7 @@ nsSelection::MoveCaret(PRUint32 aKeycode, PRBool aContinue, nsSelectionAmount aA
{
theFrame->GetBidiProperty(context, nsLayoutAtoms::embeddingLevel, (void**)&level,
sizeof(level) );
shell->SetCursorBidiLevel(level);
shell->SetCaretBidiLevel(level);
}
else
BidiLevelFromMove(context, shell, pos.mResultContent, pos.mContentOffset, aKeycode);
@ -2460,7 +2460,7 @@ void nsSelection::BidiLevelFromMove(nsIPresContext* aContext,
nsIFrame* firstFrame=nsnull;
nsIFrame* secondFrame=nsnull;
aPresShell->GetCursorBidiLevel(&currentLevel);
aPresShell->GetCaretBidiLevel(&currentLevel);
switch (aKeycode) {
@ -2469,9 +2469,9 @@ void nsSelection::BidiLevelFromMove(nsIPresContext* aContext,
case nsIDOMKeyEvent::DOM_VK_LEFT:
GetPrevNextBidiLevels(aContext, aNode, aContentOffset, &firstFrame, &secondFrame, &firstLevel, &secondLevel);
if (HINTLEFT==mHint)
aPresShell->SetCursorBidiLevel(firstLevel);
aPresShell->SetCaretBidiLevel(firstLevel);
else
aPresShell->SetCursorBidiLevel(secondLevel);
aPresShell->SetCaretBidiLevel(secondLevel);
break;
/*
@ -2479,12 +2479,12 @@ void nsSelection::BidiLevelFromMove(nsIPresContext* aContext,
case nsIDOMKeyEvent::DOM_VK_UP:
case nsIDOMKeyEvent::DOM_VK_DOWN:
GetPrevNextBidiLevels(aContext, aNode, aContentOffset, &firstFrame, &secondFrame, &firstLevel, &secondLevel);
aPresShell->SetCursorBidiLevel(PR_MIN(firstLevel, secondLevel));
aPresShell->SetCaretBidiLevel(PR_MIN(firstLevel, secondLevel));
break;
*/
default:
aPresShell->UndefineCursorBidiLevel();
aPresShell->UndefineCaretBidiLevel();
}
}
@ -2516,7 +2516,7 @@ void nsSelection::BidiLevelFromClick(nsIContent *aNode, PRUint32 aContentOffset)
clickInFrame->GetBidiProperty(context, nsLayoutAtoms::embeddingLevel,
(void**)&frameLevel, sizeof(frameLevel) );
shell->SetCursorBidiLevel(frameLevel);
shell->SetCaretBidiLevel(frameLevel);
}
#endif //IBMBIDI
@ -7596,17 +7596,17 @@ nsTypedSelection::SelectionLanguageChange(PRBool aLangRTL)
if ((level != levelBefore) && (level != levelAfter))
level = PR_MIN(levelBefore, levelAfter);
if ((level & 1) == aLangRTL)
shell->SetCursorBidiLevel(level);
shell->SetCaretBidiLevel(level);
else
shell->SetCursorBidiLevel(level + 1);
shell->SetCaretBidiLevel(level + 1);
}
else {
// if cursor is between characters with opposite orientations, changing the keyboard language must change
// the cursor level to that of the adjacent character with the orientation corresponding to the new language.
if ((levelBefore & 1) == aLangRTL)
shell->SetCursorBidiLevel(levelBefore);
shell->SetCaretBidiLevel(levelBefore);
else
shell->SetCursorBidiLevel(levelAfter);
shell->SetCaretBidiLevel(levelAfter);
}
#endif // IBMBIDI
return NS_OK;

View File

@ -939,9 +939,9 @@ public:
NS_IMETHOD IsReflowLocked(PRBool* aIsLocked);
#ifdef IBMBIDI
NS_IMETHOD SetCursorBidiLevel(PRUint8 aLevel);
NS_IMETHOD GetCursorBidiLevel(PRUint8 *aOutLevel);
NS_IMETHOD UndefineCursorBidiLevel();
NS_IMETHOD SetCaretBidiLevel(PRUint8 aLevel);
NS_IMETHOD GetCaretBidiLevel(PRUint8 *aOutLevel);
NS_IMETHOD UndefineCaretBidiLevel();
NS_IMETHOD BidiStyleChangeReflow();
#endif
@ -5322,7 +5322,7 @@ PresShell::GetPlaceholderFrameFor(nsIFrame* aFrame,
}
#ifdef IBMBIDI
NS_IMETHODIMP
PresShell::SetCursorBidiLevel(PRUint8 aLevel)
PresShell::SetCaretBidiLevel(PRUint8 aLevel)
{
// If the current level is undefined, we have just inserted new text.
// In this case, we don't want to reset the keyboard language
@ -5337,7 +5337,7 @@ PresShell::SetCursorBidiLevel(PRUint8 aLevel)
}
NS_IMETHODIMP
PresShell::GetCursorBidiLevel(PRUint8 *aOutLevel)
PresShell::GetCaretBidiLevel(PRUint8 *aOutLevel)
{
if (!aOutLevel) { return NS_ERROR_INVALID_ARG; }
*aOutLevel = mBidiLevel;
@ -5345,7 +5345,7 @@ PresShell::GetCursorBidiLevel(PRUint8 *aOutLevel)
}
NS_IMETHODIMP
PresShell::UndefineCursorBidiLevel()
PresShell::UndefineCaretBidiLevel()
{
mBidiLevel |= BIDI_LEVEL_UNDEFINED;
return NS_OK;

View File

@ -9990,7 +9990,7 @@ DidInsertText__15nsTextEditRulesP12nsISelectionUi
DidInsert__15nsTextEditRulesP12nsISelectionUi
IsMozEditorBogusNode__8nsEditorP10nsIDOMNode
IsEditable__8nsEditorP10nsIDOMNode
UndefineCursorBidiLevel__9PresShell
UndefineCaretBidiLevel__9PresShell
EndUpdateViewBatch__8nsEditor
GetCaretVisible__7nsCaretPi
EndReflowBatching__9PresShelli