diff --git a/mozilla/content/base/public/nsISelectionController.idl b/mozilla/content/base/public/nsISelectionController.idl index 5136ce61daf..65b20d0b90d 100644 --- a/mozilla/content/base/public/nsISelectionController.idl +++ b/mozilla/content/base/public/nsISelectionController.idl @@ -51,7 +51,7 @@ interface nsIDOMNode; interface nsISelection; interface nsISelectionDisplay; -[scriptable, uuid(D2D1D179-85A7-11d3-9932-00108301233C)] +[scriptable, uuid(93AAA4A9-B78E-42eb-9D67-5DE77EE2F54B)] interface nsISelectionController : nsISelectionDisplay { const short SELECTION_NONE=0; @@ -120,13 +120,6 @@ interface nsISelectionController : nsISelectionDisplay */ void setCaretEnabled(in boolean enabled); - /** - * Set the carets width - * Can be called any time. - * @param pixels, the width of the caret in pixels - * @return always NS_OK if successful, NS_ERROR_FAILURE if not. - */ - void setCaretWidth(in short pixels); /** * Set the caret readonly or not. An readonly caret will diff --git a/mozilla/content/events/src/nsEventStateManager.cpp b/mozilla/content/events/src/nsEventStateManager.cpp index f63175c19ad..3af2b781151 100644 --- a/mozilla/content/events/src/nsEventStateManager.cpp +++ b/mozilla/content/events/src/nsEventStateManager.cpp @@ -4793,14 +4793,6 @@ nsEventStateManager::SetCaretEnabled(nsIPresShell *aPresShell, PRBool aEnabled) selCon->SetCaretEnabled(aEnabled); caret->SetCaretVisible(aEnabled); - if (aEnabled) { - PRInt32 pixelWidth = 1; - nsCOMPtr lookNFeel(do_GetService(kLookAndFeelCID)); - if (lookNFeel) - lookNFeel->GetMetric(nsILookAndFeel::eMetric_MultiLineCaretWidth, pixelWidth); - caret->SetCaretWidth(pixelWidth); - } - return NS_OK; } diff --git a/mozilla/editor/libeditor/text/nsEditorEventListeners.cpp b/mozilla/editor/libeditor/text/nsEditorEventListeners.cpp index 3a081be4864..5bc14be054d 100644 --- a/mozilla/editor/libeditor/text/nsEditorEventListeners.cpp +++ b/mozilla/editor/libeditor/text/nsEditorEventListeners.cpp @@ -1021,23 +1021,7 @@ nsTextEditorFocusListener::Focus(nsIDOMEvent* aEvent) editor->GetSelectionController(getter_AddRefs(selCon)); if (selCon) { - if (! (flags & nsIPlaintextEditor::eEditorReadonlyMask)) - { // only enable caret if the editor is not readonly - nsresult result; - - nsCOMPtr look = - do_GetService("@mozilla.org/widget/lookandfeel;1", &result); - if (NS_SUCCEEDED(result) && look) - { - PRInt32 pixelWidth; - - if(flags & nsIPlaintextEditor::eEditorSingleLineMask) - look->GetMetric(nsILookAndFeel::eMetric_SingleLineCaretWidth, pixelWidth); - else - look->GetMetric(nsILookAndFeel::eMetric_MultiLineCaretWidth, pixelWidth); - selCon->SetCaretWidth(pixelWidth); - } - + if (! (flags & nsIPlaintextEditor::eEditorReadonlyMask)) { selCon->SetCaretEnabled(PR_TRUE); } diff --git a/mozilla/extensions/typeaheadfind/src/nsTypeAheadFind.cpp b/mozilla/extensions/typeaheadfind/src/nsTypeAheadFind.cpp index 3055f479539..1a89c4b125f 100644 --- a/mozilla/extensions/typeaheadfind/src/nsTypeAheadFind.cpp +++ b/mozilla/extensions/typeaheadfind/src/nsTypeAheadFind.cpp @@ -2189,10 +2189,6 @@ nsTypeAheadFind::SetSelectionLook(nsIPresShell *aPresShell, caret->SetVisibilityDuringSelection(PR_TRUE); caret->SetCaretVisible(PR_TRUE); mFocusedDocSelCon->SetCaretEnabled(PR_TRUE); - PRInt32 pixelWidth = 1; - lookNFeel->GetMetric(nsILookAndFeel::eMetric_MultiLineCaretWidth, - pixelWidth); - caret->SetCaretWidth(pixelWidth); } else { PRInt32 isCaretVisibleDuringSelection = 0; diff --git a/mozilla/extensions/xmlterm/base/mozXMLTerminal.cpp b/mozilla/extensions/xmlterm/base/mozXMLTerminal.cpp index db6aa76b21a..f09e75ab487 100644 --- a/mozilla/extensions/xmlterm/base/mozXMLTerminal.cpp +++ b/mozilla/extensions/xmlterm/base/mozXMLTerminal.cpp @@ -713,17 +713,6 @@ NS_IMETHODIMP mozXMLTerminal::ShowCaret(void) return NS_ERROR_FAILURE; } - PRInt32 pixelWidth; - nsresult result; - - nsCOMPtr look(do_GetService(kLookAndFeelCID, &result)); - - if (NS_SUCCEEDED(result) && look) { - look->GetMetric(nsILookAndFeel::eMetric_SingleLineCaretWidth, pixelWidth); - - selCon->SetCaretWidth(pixelWidth); - } - selCon->SetCaretEnabled(PR_TRUE); selCon->SetCaretReadOnly(PR_FALSE); diff --git a/mozilla/layout/base/nsCaret.cpp b/mozilla/layout/base/nsCaret.cpp index 6a540eaa577..7e74e9fe00e 100644 --- a/mozilla/layout/base/nsCaret.cpp +++ b/mozilla/layout/base/nsCaret.cpp @@ -85,8 +85,6 @@ nsCaret::nsCaret() : mPresShell(nsnull) , mBlinkRate(500) -, mCaretTwipsWidth(-1) -, mCaretPixelsWidth(1) , mVisible(PR_FALSE) , mDrawn(PR_FALSE) , mReadOnly(PR_FALSE) @@ -119,16 +117,25 @@ NS_IMETHODIMP nsCaret::Init(nsIPresShell *inPresShell) nsILookAndFeel *lookAndFeel = nsnull; nsPresContext *presContext = inPresShell->GetPresContext(); + PRInt32 caretPixelsWidth = 1; if (presContext && (lookAndFeel = presContext->LookAndFeel())) { PRInt32 tempInt; - if (NS_SUCCEEDED(lookAndFeel->GetMetric(nsILookAndFeel::eMetric_SingleLineCaretWidth, tempInt))) - mCaretPixelsWidth = (nscoord)tempInt; + if (NS_SUCCEEDED(lookAndFeel->GetMetric(nsILookAndFeel::eMetric_CaretWidth, tempInt))) + caretPixelsWidth = (nscoord)tempInt; if (NS_SUCCEEDED(lookAndFeel->GetMetric(nsILookAndFeel::eMetric_CaretBlinkTime, tempInt))) mBlinkRate = (PRUint32)tempInt; if (NS_SUCCEEDED(lookAndFeel->GetMetric(nsILookAndFeel::eMetric_ShowCaretDuringSelection, tempInt))) mShowDuringSelection = tempInt ? PR_TRUE : PR_FALSE; } + float tDevUnitsToTwips; + tDevUnitsToTwips = presContext->DeviceContext()->DevUnitsToTwips(); + mCaretTwipsWidth = (nscoord)(tDevUnitsToTwips * (float)caretPixelsWidth); + mBidiIndicatorTwipsSize = (nscoord)(tDevUnitsToTwips * (float)kMinBidiIndicatorPixels); + if (mBidiIndicatorTwipsSize < mCaretTwipsWidth) { + mBidiIndicatorTwipsSize = mCaretTwipsWidth; + } + // get the selection from the pres shell, and set ourselves up as a selection // listener @@ -387,19 +394,6 @@ NS_IMETHODIMP nsCaret::EraseCaret() return NS_OK; } -NS_IMETHODIMP nsCaret::SetCaretWidth(nscoord aPixels) -{ - if (aPixels <= 0) - return NS_ERROR_FAILURE; - - // no need to optimize this, but if it gets too slow, we can check for - // case aPixels==mCaretPixelsWidth - mCaretPixelsWidth = aPixels; - mCaretTwipsWidth = -1; - - return NS_OK; -} - NS_IMETHODIMP nsCaret::SetVisibilityDuringSelection(PRBool aVisibility) { mShowDuringSelection = aVisibility; @@ -987,12 +981,6 @@ void nsCaret::GetCaretRectAndInvert() caretRect += framePos; - if (mCaretTwipsWidth < 0) // need to re-compute the pixel width - { - float tDevUnitsToTwips; - tDevUnitsToTwips = presContext->DeviceContext()->DevUnitsToTwips(); - mCaretTwipsWidth = (nscoord)(tDevUnitsToTwips * (float)mCaretPixelsWidth); - } caretRect.width = mCaretTwipsWidth; // Avoid view redraw problems by making sure the @@ -1074,9 +1062,8 @@ void nsCaret::GetCaretRectAndInvert() } // If keyboard language is RTL, draw the hook on the left; if LTR, to the right hookRect.SetRect(caretRect.x + caretRect.width * ((bidiLevel) ? -1 : 1), - caretRect.y + caretRect.width, - caretRect.width, - caretRect.width); + caretRect.y + mBidiIndicatorTwipsSize, + mBidiIndicatorTwipsSize, mBidiIndicatorTwipsSize); mHookRect.IntersectRect(clipRect, hookRect); } #endif //IBMBIDI diff --git a/mozilla/layout/base/nsCaret.h b/mozilla/layout/base/nsCaret.h index 45b1f775471..d00c9ef98d8 100644 --- a/mozilla/layout/base/nsCaret.h +++ b/mozilla/layout/base/nsCaret.h @@ -77,7 +77,6 @@ class nsCaret : public nsICaret, NS_IMETHOD ClearFrameRefs(nsIFrame* aFrame); NS_IMETHOD EraseCaret(); - NS_IMETHOD SetCaretWidth(nscoord aPixels); NS_IMETHOD SetVisibilityDuringSelection(PRBool aVisibility); NS_IMETHOD DrawAtPosition(nsIDOMNode* aNode, PRInt32 aOffset); @@ -112,8 +111,9 @@ protected: PRUint32 mBlinkRate; // time for one cyle (off then on), in milliseconds nscoord mCaretTwipsWidth; // caret width in twips. this gets calculated laziiy - nscoord mCaretPixelsWidth; // caret width in pixels - + nscoord mBidiIndicatorTwipsSize; // width and height of bidi indicator + static const kMinBidiIndicatorPixels = 2; + PRPackedBool mVisible; // is the caret blinking PRPackedBool mDrawn; // this should be mutable PRPackedBool mReadOnly; // it the caret in readonly state (draws differently) diff --git a/mozilla/layout/base/nsICaret.h b/mozilla/layout/base/nsICaret.h index 73f751af386..1fd3f8976b2 100644 --- a/mozilla/layout/base/nsICaret.h +++ b/mozilla/layout/base/nsICaret.h @@ -54,7 +54,7 @@ class nsIDOMNode; // IID for the nsICaret interface #define NS_ICARET_IID \ -{ 0xa6cf90e1, 0x15b3, 0x11d2, {0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32} } +{ 0x43d789e0, 0x21b7, 0x4fb4, { 0xb6, 0xfc, 0x4a, 0x41, 0x49, 0x3e, 0x40, 0xf0 } } class nsICaret: public nsISupports { @@ -109,11 +109,6 @@ public: */ NS_IMETHOD EraseCaret() = 0; - /** Set Caret Width - * this will set the caret width to the passed in value. - */ - NS_IMETHOD SetCaretWidth(nscoord aPixels) = 0; - NS_IMETHOD SetVisibilityDuringSelection(PRBool aVisibilityDuringSelection) = 0; /** DrawAtPosition diff --git a/mozilla/layout/base/nsPresShell.cpp b/mozilla/layout/base/nsPresShell.cpp index 992b60e1927..63a74b63c10 100644 --- a/mozilla/layout/base/nsPresShell.cpp +++ b/mozilla/layout/base/nsPresShell.cpp @@ -1225,7 +1225,6 @@ public: // caret handling NS_IMETHOD GetCaret(nsICaret **aOutCaret); NS_IMETHOD SetCaretEnabled(PRBool aInEnable); - NS_IMETHOD SetCaretWidth(PRInt16 aPixels); NS_IMETHOD SetCaretReadOnly(PRBool aReadOnly); NS_IMETHOD GetCaretEnabled(PRBool *aOutEnabled); NS_IMETHOD SetCaretVisibilityDuringSelection(PRBool aVisibility); @@ -3051,13 +3050,6 @@ NS_IMETHODIMP PresShell::SetCaretEnabled(PRBool aInEnable) return result; } -NS_IMETHODIMP PresShell::SetCaretWidth(PRInt16 pixels) -{ - if (mCaret) - mCaret->SetCaretWidth(pixels); - return NS_OK; -} - NS_IMETHODIMP PresShell::SetCaretReadOnly(PRBool aReadOnly) { if (mCaret) diff --git a/mozilla/layout/base/public/nsICaret.h b/mozilla/layout/base/public/nsICaret.h index 73f751af386..1fd3f8976b2 100644 --- a/mozilla/layout/base/public/nsICaret.h +++ b/mozilla/layout/base/public/nsICaret.h @@ -54,7 +54,7 @@ class nsIDOMNode; // IID for the nsICaret interface #define NS_ICARET_IID \ -{ 0xa6cf90e1, 0x15b3, 0x11d2, {0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32} } +{ 0x43d789e0, 0x21b7, 0x4fb4, { 0xb6, 0xfc, 0x4a, 0x41, 0x49, 0x3e, 0x40, 0xf0 } } class nsICaret: public nsISupports { @@ -109,11 +109,6 @@ public: */ NS_IMETHOD EraseCaret() = 0; - /** Set Caret Width - * this will set the caret width to the passed in value. - */ - NS_IMETHOD SetCaretWidth(nscoord aPixels) = 0; - NS_IMETHOD SetVisibilityDuringSelection(PRBool aVisibilityDuringSelection) = 0; /** DrawAtPosition diff --git a/mozilla/layout/base/src/nsCaret.cpp b/mozilla/layout/base/src/nsCaret.cpp index 6a540eaa577..7e74e9fe00e 100644 --- a/mozilla/layout/base/src/nsCaret.cpp +++ b/mozilla/layout/base/src/nsCaret.cpp @@ -85,8 +85,6 @@ nsCaret::nsCaret() : mPresShell(nsnull) , mBlinkRate(500) -, mCaretTwipsWidth(-1) -, mCaretPixelsWidth(1) , mVisible(PR_FALSE) , mDrawn(PR_FALSE) , mReadOnly(PR_FALSE) @@ -119,16 +117,25 @@ NS_IMETHODIMP nsCaret::Init(nsIPresShell *inPresShell) nsILookAndFeel *lookAndFeel = nsnull; nsPresContext *presContext = inPresShell->GetPresContext(); + PRInt32 caretPixelsWidth = 1; if (presContext && (lookAndFeel = presContext->LookAndFeel())) { PRInt32 tempInt; - if (NS_SUCCEEDED(lookAndFeel->GetMetric(nsILookAndFeel::eMetric_SingleLineCaretWidth, tempInt))) - mCaretPixelsWidth = (nscoord)tempInt; + if (NS_SUCCEEDED(lookAndFeel->GetMetric(nsILookAndFeel::eMetric_CaretWidth, tempInt))) + caretPixelsWidth = (nscoord)tempInt; if (NS_SUCCEEDED(lookAndFeel->GetMetric(nsILookAndFeel::eMetric_CaretBlinkTime, tempInt))) mBlinkRate = (PRUint32)tempInt; if (NS_SUCCEEDED(lookAndFeel->GetMetric(nsILookAndFeel::eMetric_ShowCaretDuringSelection, tempInt))) mShowDuringSelection = tempInt ? PR_TRUE : PR_FALSE; } + float tDevUnitsToTwips; + tDevUnitsToTwips = presContext->DeviceContext()->DevUnitsToTwips(); + mCaretTwipsWidth = (nscoord)(tDevUnitsToTwips * (float)caretPixelsWidth); + mBidiIndicatorTwipsSize = (nscoord)(tDevUnitsToTwips * (float)kMinBidiIndicatorPixels); + if (mBidiIndicatorTwipsSize < mCaretTwipsWidth) { + mBidiIndicatorTwipsSize = mCaretTwipsWidth; + } + // get the selection from the pres shell, and set ourselves up as a selection // listener @@ -387,19 +394,6 @@ NS_IMETHODIMP nsCaret::EraseCaret() return NS_OK; } -NS_IMETHODIMP nsCaret::SetCaretWidth(nscoord aPixels) -{ - if (aPixels <= 0) - return NS_ERROR_FAILURE; - - // no need to optimize this, but if it gets too slow, we can check for - // case aPixels==mCaretPixelsWidth - mCaretPixelsWidth = aPixels; - mCaretTwipsWidth = -1; - - return NS_OK; -} - NS_IMETHODIMP nsCaret::SetVisibilityDuringSelection(PRBool aVisibility) { mShowDuringSelection = aVisibility; @@ -987,12 +981,6 @@ void nsCaret::GetCaretRectAndInvert() caretRect += framePos; - if (mCaretTwipsWidth < 0) // need to re-compute the pixel width - { - float tDevUnitsToTwips; - tDevUnitsToTwips = presContext->DeviceContext()->DevUnitsToTwips(); - mCaretTwipsWidth = (nscoord)(tDevUnitsToTwips * (float)mCaretPixelsWidth); - } caretRect.width = mCaretTwipsWidth; // Avoid view redraw problems by making sure the @@ -1074,9 +1062,8 @@ void nsCaret::GetCaretRectAndInvert() } // If keyboard language is RTL, draw the hook on the left; if LTR, to the right hookRect.SetRect(caretRect.x + caretRect.width * ((bidiLevel) ? -1 : 1), - caretRect.y + caretRect.width, - caretRect.width, - caretRect.width); + caretRect.y + mBidiIndicatorTwipsSize, + mBidiIndicatorTwipsSize, mBidiIndicatorTwipsSize); mHookRect.IntersectRect(clipRect, hookRect); } #endif //IBMBIDI diff --git a/mozilla/layout/base/src/nsCaret.h b/mozilla/layout/base/src/nsCaret.h index 45b1f775471..d00c9ef98d8 100644 --- a/mozilla/layout/base/src/nsCaret.h +++ b/mozilla/layout/base/src/nsCaret.h @@ -77,7 +77,6 @@ class nsCaret : public nsICaret, NS_IMETHOD ClearFrameRefs(nsIFrame* aFrame); NS_IMETHOD EraseCaret(); - NS_IMETHOD SetCaretWidth(nscoord aPixels); NS_IMETHOD SetVisibilityDuringSelection(PRBool aVisibility); NS_IMETHOD DrawAtPosition(nsIDOMNode* aNode, PRInt32 aOffset); @@ -112,8 +111,9 @@ protected: PRUint32 mBlinkRate; // time for one cyle (off then on), in milliseconds nscoord mCaretTwipsWidth; // caret width in twips. this gets calculated laziiy - nscoord mCaretPixelsWidth; // caret width in pixels - + nscoord mBidiIndicatorTwipsSize; // width and height of bidi indicator + static const kMinBidiIndicatorPixels = 2; + PRPackedBool mVisible; // is the caret blinking PRPackedBool mDrawn; // this should be mutable PRPackedBool mReadOnly; // it the caret in readonly state (draws differently) diff --git a/mozilla/layout/forms/nsTextControlFrame.cpp b/mozilla/layout/forms/nsTextControlFrame.cpp index 2fcd0c9956c..b3034104e39 100644 --- a/mozilla/layout/forms/nsTextControlFrame.cpp +++ b/mozilla/layout/forms/nsTextControlFrame.cpp @@ -555,7 +555,6 @@ public: NS_IMETHOD RepaintSelection(PRInt16 type); NS_IMETHOD RepaintSelection(nsPresContext* aPresContext, SelectionType aSelectionType); NS_IMETHOD SetCaretEnabled(PRBool enabled); - NS_IMETHOD SetCaretWidth(PRInt16 twips); NS_IMETHOD SetCaretReadOnly(PRBool aReadOnly); NS_IMETHOD GetCaretEnabled(PRBool *_retval); NS_IMETHOD SetCaretVisibilityDuringSelection(PRBool aVisibility); @@ -736,23 +735,6 @@ nsTextInputSelectionImpl::SetCaretEnabled(PRBool enabled) return NS_OK; } -NS_IMETHODIMP -nsTextInputSelectionImpl::SetCaretWidth(PRInt16 pixels) -{ - if (!mPresShellWeak) return NS_ERROR_NOT_INITIALIZED; - nsresult result; - nsCOMPtr shell = do_QueryReferent(mPresShellWeak, &result); - if (shell) - { - nsCOMPtr caret; - if (NS_SUCCEEDED(result = shell->GetCaret(getter_AddRefs(caret)))) - { - return caret->SetCaretWidth(pixels); - } - } - return NS_ERROR_FAILURE; -} - NS_IMETHODIMP nsTextInputSelectionImpl::SetCaretReadOnly(PRBool aReadOnly) { diff --git a/mozilla/layout/html/base/src/nsPresShell.cpp b/mozilla/layout/html/base/src/nsPresShell.cpp index 992b60e1927..63a74b63c10 100644 --- a/mozilla/layout/html/base/src/nsPresShell.cpp +++ b/mozilla/layout/html/base/src/nsPresShell.cpp @@ -1225,7 +1225,6 @@ public: // caret handling NS_IMETHOD GetCaret(nsICaret **aOutCaret); NS_IMETHOD SetCaretEnabled(PRBool aInEnable); - NS_IMETHOD SetCaretWidth(PRInt16 aPixels); NS_IMETHOD SetCaretReadOnly(PRBool aReadOnly); NS_IMETHOD GetCaretEnabled(PRBool *aOutEnabled); NS_IMETHOD SetCaretVisibilityDuringSelection(PRBool aVisibility); @@ -3051,13 +3050,6 @@ NS_IMETHODIMP PresShell::SetCaretEnabled(PRBool aInEnable) return result; } -NS_IMETHODIMP PresShell::SetCaretWidth(PRInt16 pixels) -{ - if (mCaret) - mCaret->SetCaretWidth(pixels); - return NS_OK; -} - NS_IMETHODIMP PresShell::SetCaretReadOnly(PRBool aReadOnly) { if (mCaret) diff --git a/mozilla/layout/html/forms/src/nsTextControlFrame.cpp b/mozilla/layout/html/forms/src/nsTextControlFrame.cpp index 2fcd0c9956c..b3034104e39 100644 --- a/mozilla/layout/html/forms/src/nsTextControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsTextControlFrame.cpp @@ -555,7 +555,6 @@ public: NS_IMETHOD RepaintSelection(PRInt16 type); NS_IMETHOD RepaintSelection(nsPresContext* aPresContext, SelectionType aSelectionType); NS_IMETHOD SetCaretEnabled(PRBool enabled); - NS_IMETHOD SetCaretWidth(PRInt16 twips); NS_IMETHOD SetCaretReadOnly(PRBool aReadOnly); NS_IMETHOD GetCaretEnabled(PRBool *_retval); NS_IMETHOD SetCaretVisibilityDuringSelection(PRBool aVisibility); @@ -736,23 +735,6 @@ nsTextInputSelectionImpl::SetCaretEnabled(PRBool enabled) return NS_OK; } -NS_IMETHODIMP -nsTextInputSelectionImpl::SetCaretWidth(PRInt16 pixels) -{ - if (!mPresShellWeak) return NS_ERROR_NOT_INITIALIZED; - nsresult result; - nsCOMPtr shell = do_QueryReferent(mPresShellWeak, &result); - if (shell) - { - nsCOMPtr caret; - if (NS_SUCCEEDED(result = shell->GetCaret(getter_AddRefs(caret)))) - { - return caret->SetCaretWidth(pixels); - } - } - return NS_ERROR_FAILURE; -} - NS_IMETHODIMP nsTextInputSelectionImpl::SetCaretReadOnly(PRBool aReadOnly) { diff --git a/mozilla/widget/public/nsILookAndFeel.h b/mozilla/widget/public/nsILookAndFeel.h index 755814474a7..0ac0b590f49 100644 --- a/mozilla/widget/public/nsILookAndFeel.h +++ b/mozilla/widget/public/nsILookAndFeel.h @@ -45,10 +45,10 @@ struct nsSize; -// {21B51DE1-21A3-11d2-B6E0-00805F8A2676} +// {ED0B4802-9F50-4f69-9509-6949C69999E4} #define NS_ILOOKANDFEEL_IID \ -{ 0x21b51de1, 0x21a3, 0x11d2, \ - { 0xb6, 0xe0, 0x0, 0x80, 0x5f, 0x8a, 0x26, 0x76 } } +{ 0xed0b4802, 0x9f50, 0x4f69, \ + { 0x95, 0x9, 0x69, 0x49, 0xc6, 0x99, 0x99, 0xe4 } } class nsILookAndFeel: public nsISupports { public: @@ -161,8 +161,7 @@ public: eMetric_ListVerticalInsidePadding, // needed only because of GTK eMetric_CaretBlinkTime, // default, may be overriden by OS - eMetric_SingleLineCaretWidth, // pixel width of caret in a single line field - eMetric_MultiLineCaretWidth, // pixel width of caret in a multi-line field + eMetric_CaretWidth, // pixel width of caret eMetric_ShowCaretDuringSelection, // show the caret when text is selected? eMetric_SelectTextfieldsOnKeyFocus, // select textfields when focused via tab/accesskey? eMetric_SubmenuDelay, // delay before submenus open diff --git a/mozilla/widget/public/nsWidgetsCID.h b/mozilla/widget/public/nsWidgetsCID.h index 304e1567899..59821be5dd3 100644 --- a/mozilla/widget/public/nsWidgetsCID.h +++ b/mozilla/widget/public/nsWidgetsCID.h @@ -100,10 +100,10 @@ /* XXX the following CID's are not in order. This needs to be fixed. */ -/* 21B51DE0-21A3-11d2-B6E0-00805F8A2676 */ +/* A61E6398-2057-40fd-9C81-873B908D24E7 */ #define NS_LOOKANDFEEL_CID \ -{ 0x21b51de0, 0x21a3, 0x11d2, \ - { 0xb6, 0xe0, 0x0, 0x80, 0x5f, 0x8a, 0x26, 0x76 } } +{ 0xa61e6398, 0x2057, 0x40fd, \ + { 0x9c, 0x81, 0x87, 0x3b, 0x90, 0x8d, 0x24, 0xe7 } } /* 4A781D61-3D28-11d2-8DB8-00609703C14E */ #define NS_DIALOG_CID \ diff --git a/mozilla/widget/src/beos/nsLookAndFeel.cpp b/mozilla/widget/src/beos/nsLookAndFeel.cpp index 2cd2e23ed2e..daa8526848c 100644 --- a/mozilla/widget/src/beos/nsLookAndFeel.cpp +++ b/mozilla/widget/src/beos/nsLookAndFeel.cpp @@ -335,12 +335,9 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricID aID, PRInt32 & aMetric) case eMetric_CaretBlinkTime: aMetric = 500; break; - case eMetric_SingleLineCaretWidth: + case eMetric_CaretWidth: aMetric = 1; break; - case eMetric_MultiLineCaretWidth: - aMetric = 2; - break; case eMetric_ShowCaretDuringSelection: aMetric = 1; break; diff --git a/mozilla/widget/src/gtk/nsLookAndFeel.cpp b/mozilla/widget/src/gtk/nsLookAndFeel.cpp index d14590e32ba..780264a1dce 100644 --- a/mozilla/widget/src/gtk/nsLookAndFeel.cpp +++ b/mozilla/widget/src/gtk/nsLookAndFeel.cpp @@ -343,8 +343,7 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricID aID, PRInt32 & aMetric) case eMetric_CaretBlinkTime: aMetric = 500; break; - case eMetric_SingleLineCaretWidth: - case eMetric_MultiLineCaretWidth: + case eMetric_CaretWidth: aMetric = 1; break; case eMetric_ShowCaretDuringSelection: diff --git a/mozilla/widget/src/gtk2/nsLookAndFeel.cpp b/mozilla/widget/src/gtk2/nsLookAndFeel.cpp index 8ff6f778b19..3b4720cda31 100644 --- a/mozilla/widget/src/gtk2/nsLookAndFeel.cpp +++ b/mozilla/widget/src/gtk2/nsLookAndFeel.cpp @@ -348,8 +348,7 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricID aID, PRInt32 & aMetric) case eMetric_CaretBlinkTime: aMetric = 500; break; - case eMetric_SingleLineCaretWidth: - case eMetric_MultiLineCaretWidth: + case eMetric_CaretWidth: aMetric = 1; break; case eMetric_ShowCaretDuringSelection: diff --git a/mozilla/widget/src/mac/nsLookAndFeel.cpp b/mozilla/widget/src/mac/nsLookAndFeel.cpp index bcb8b7b130c..6ccf373acbf 100644 --- a/mozilla/widget/src/mac/nsLookAndFeel.cpp +++ b/mozilla/widget/src/mac/nsLookAndFeel.cpp @@ -478,8 +478,7 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricID aID, PRInt32 & aMetric) case eMetric_CaretBlinkTime: aMetric = ::GetCaretTime() * 1000 / 60; break; - case eMetric_SingleLineCaretWidth: - case eMetric_MultiLineCaretWidth: + case eMetric_CaretWidth: aMetric = 1; break; case eMetric_ShowCaretDuringSelection: diff --git a/mozilla/widget/src/os2/nsLookAndFeel.cpp b/mozilla/widget/src/os2/nsLookAndFeel.cpp index 4e9661a46a2..78a1af1f6da 100644 --- a/mozilla/widget/src/os2/nsLookAndFeel.cpp +++ b/mozilla/widget/src/os2/nsLookAndFeel.cpp @@ -276,12 +276,9 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricID aID, PRInt32 & aMetric) case eMetric_CaretBlinkTime: aMetric = WinQuerySysValue( HWND_DESKTOP, SV_CURSORRATE); break; - case eMetric_SingleLineCaretWidth: + case eMetric_CaretWidth: aMetric = 1; break; - case eMetric_MultiLineCaretWidth: - aMetric = 2; - break; case eMetric_ShowCaretDuringSelection: aMetric = 0; break; diff --git a/mozilla/widget/src/photon/nsLookAndFeel.cpp b/mozilla/widget/src/photon/nsLookAndFeel.cpp index 55c0ce3c57f..78739cff4e4 100644 --- a/mozilla/widget/src/photon/nsLookAndFeel.cpp +++ b/mozilla/widget/src/photon/nsLookAndFeel.cpp @@ -300,9 +300,8 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricID aID, PRInt32 & aMetric) case eMetric_CaretBlinkTime: aMetric = 500; break; - case eMetric_SingleLineCaretWidth: - case eMetric_MultiLineCaretWidth: - aMetric = 2; + case eMetric_CaretWidth: + aMetric = 1; break; case eMetric_ShowCaretDuringSelection: aMetric = 0; diff --git a/mozilla/widget/src/windows/nsLookAndFeel.cpp b/mozilla/widget/src/windows/nsLookAndFeel.cpp index 43ae48a8bbd..9193ffd5d86 100644 --- a/mozilla/widget/src/windows/nsLookAndFeel.cpp +++ b/mozilla/widget/src/windows/nsLookAndFeel.cpp @@ -271,12 +271,9 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricID aID, PRInt32 & aMetric) case eMetric_CaretBlinkTime: aMetric = (PRInt32)::GetCaretBlinkTime(); break; - case eMetric_SingleLineCaretWidth: + case eMetric_CaretWidth: aMetric = 1; break; - case eMetric_MultiLineCaretWidth: - aMetric = 2; - break; case eMetric_ShowCaretDuringSelection: aMetric = 0; break; diff --git a/mozilla/widget/src/xlib/nsLookAndFeel.cpp b/mozilla/widget/src/xlib/nsLookAndFeel.cpp index db2ffdafcbc..a969f9aed32 100644 --- a/mozilla/widget/src/xlib/nsLookAndFeel.cpp +++ b/mozilla/widget/src/xlib/nsLookAndFeel.cpp @@ -275,8 +275,7 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricID aID, PRInt32 & aMetric) case eMetric_CaretBlinkTime: aMetric = 500; break; - case eMetric_SingleLineCaretWidth: - case eMetric_MultiLineCaretWidth: + case eMetric_CaretWidth: aMetric = 1; break; case eMetric_ShowCaretDuringSelection: diff --git a/mozilla/widget/src/xpwidgets/nsXPLookAndFeel.cpp b/mozilla/widget/src/xpwidgets/nsXPLookAndFeel.cpp index 6a4e64569e5..7dda088d036 100644 --- a/mozilla/widget/src/xpwidgets/nsXPLookAndFeel.cpp +++ b/mozilla/widget/src/xpwidgets/nsXPLookAndFeel.cpp @@ -83,7 +83,7 @@ nsLookAndFeelIntPref nsXPLookAndFeel::sIntPrefs[] = { "ui.listVerticalInsidePadding", eMetric_ListVerticalInsidePadding, PR_FALSE, nsLookAndFeelTypeInt, 0 }, { "ui.caretBlinkTime", eMetric_CaretBlinkTime, PR_FALSE, nsLookAndFeelTypeInt, 0 }, - { "ui.caretWidthTwips", eMetric_SingleLineCaretWidth, PR_FALSE, nsLookAndFeelTypeInt, 0 }, + { "ui.caretWidth", eMetric_CaretWidth, PR_FALSE, nsLookAndFeelTypeInt, 0 }, { "ui.caretVisibleWithSelection", eMetric_ShowCaretDuringSelection, PR_FALSE, nsLookAndFeelTypeInt, 0 }, { "ui.submenuDelay", eMetric_SubmenuDelay, PR_FALSE, nsLookAndFeelTypeInt, 0 }, { "ui.dragFullWindow", eMetric_DragFullWindow, PR_FALSE, nsLookAndFeelTypeInt, 0 },