зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1678540 - Refactor nsXPLookAndFeel::GetIntImpl etc. r=spohl
This will allow calling into NativeGetInt etc. to get native LookAndFeel values without looking at the prefs. Differential Revision: https://phabricator.services.mozilla.com/D97725
This commit is contained in:
Родитель
104a5a7dde
Коммит
0f3cfafb48
|
@ -304,11 +304,8 @@ nsresult nsLookAndFeel::NativeGetColor(ColorID aID, nscolor& aColor) {
|
|||
return rv;
|
||||
}
|
||||
|
||||
nsresult nsLookAndFeel::GetIntImpl(IntID aID, int32_t& aResult) {
|
||||
nsresult rv = nsXPLookAndFeel::GetIntImpl(aID, aResult);
|
||||
if (NS_SUCCEEDED(rv)) return rv;
|
||||
|
||||
rv = NS_OK;
|
||||
nsresult nsLookAndFeel::NativeGetInt(IntID aID, int32_t& aResult) {
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
switch (aID) {
|
||||
case IntID::ScrollButtonLeftMouseButtonAction:
|
||||
|
@ -432,10 +429,8 @@ nsresult nsLookAndFeel::GetIntImpl(IntID aID, int32_t& aResult) {
|
|||
return rv;
|
||||
}
|
||||
|
||||
nsresult nsLookAndFeel::GetFloatImpl(FloatID aID, float& aResult) {
|
||||
nsresult rv = nsXPLookAndFeel::GetFloatImpl(aID, aResult);
|
||||
if (NS_SUCCEEDED(rv)) return rv;
|
||||
rv = NS_OK;
|
||||
nsresult nsLookAndFeel::NativeGetFloat(FloatID aID, float& aResult) {
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
switch (aID) {
|
||||
case FloatID::IMEUnderlineRelativeSize:
|
||||
|
@ -455,8 +450,8 @@ nsresult nsLookAndFeel::GetFloatImpl(FloatID aID, float& aResult) {
|
|||
}
|
||||
|
||||
/*virtual*/
|
||||
bool nsLookAndFeel::GetFontImpl(FontID aID, nsString& aFontName,
|
||||
gfxFontStyle& aFontStyle) {
|
||||
bool nsLookAndFeel::NativeGetFont(FontID aID, nsString& aFontName,
|
||||
gfxFontStyle& aFontStyle) {
|
||||
aFontName.AssignLiteral("\"Roboto\"");
|
||||
aFontStyle.style = FontSlantStyle::Normal();
|
||||
aFontStyle.weight = FontWeight::Normal();
|
||||
|
|
|
@ -15,11 +15,11 @@ class nsLookAndFeel final : public nsXPLookAndFeel {
|
|||
|
||||
void NativeInit() final;
|
||||
virtual void RefreshImpl() override;
|
||||
virtual nsresult NativeGetColor(ColorID aID, nscolor& aResult) override;
|
||||
virtual nsresult GetIntImpl(IntID aID, int32_t& aResult) override;
|
||||
virtual nsresult GetFloatImpl(FloatID aID, float& aResult) override;
|
||||
virtual bool GetFontImpl(FontID aID, nsString& aName,
|
||||
gfxFontStyle& aStyle) override;
|
||||
nsresult NativeGetInt(IntID aID, int32_t& aResult) override;
|
||||
nsresult NativeGetFloat(FloatID aID, float& aResult) override;
|
||||
nsresult NativeGetColor(ColorID aID, nscolor& aResult) override;
|
||||
bool NativeGetFont(FontID aID, nsString& aName,
|
||||
gfxFontStyle& aStyle) override;
|
||||
virtual bool GetEchoPasswordImpl() override;
|
||||
virtual uint32_t GetPasswordMaskDelayImpl() override;
|
||||
virtual char16_t GetPasswordCharacterImpl() override;
|
||||
|
|
|
@ -14,11 +14,11 @@ class nsLookAndFeel final : public nsXPLookAndFeel {
|
|||
|
||||
void NativeInit() final;
|
||||
virtual void RefreshImpl() override;
|
||||
virtual nsresult NativeGetColor(ColorID aID, nscolor& aResult) override;
|
||||
virtual nsresult GetIntImpl(IntID aID, int32_t& aResult) override;
|
||||
virtual nsresult GetFloatImpl(FloatID aID, float& aResult) override;
|
||||
virtual bool GetFontImpl(FontID aID, nsString& aFontName,
|
||||
gfxFontStyle& aFontStyle) override;
|
||||
nsresult NativeGetColor(ColorID aID, nscolor& aResult) override;
|
||||
nsresult NativeGetInt(IntID aID, int32_t& aResult) override;
|
||||
nsresult NativeGetFloat(FloatID aID, float& aResult) override;
|
||||
bool NativeGetFont(FontID aID, nsString& aFontName,
|
||||
gfxFontStyle& aFontStyle) override;
|
||||
|
||||
virtual char16_t GetPasswordCharacterImpl() override {
|
||||
// unicode value for the bullet character, used for password textfields.
|
||||
|
|
|
@ -419,12 +419,10 @@ nsresult nsLookAndFeel::NativeGetColor(ColorID aID, nscolor& aColor) {
|
|||
return res;
|
||||
}
|
||||
|
||||
nsresult nsLookAndFeel::GetIntImpl(IntID aID, int32_t& aResult) {
|
||||
nsresult nsLookAndFeel::NativeGetInt(IntID aID, int32_t& aResult) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
|
||||
nsresult res = nsXPLookAndFeel::GetIntImpl(aID, aResult);
|
||||
if (NS_SUCCEEDED(res)) return res;
|
||||
res = NS_OK;
|
||||
nsresult res = NS_OK;
|
||||
|
||||
switch (aID) {
|
||||
case IntID::ScrollButtonLeftMouseButtonAction:
|
||||
|
@ -592,10 +590,8 @@ nsresult nsLookAndFeel::GetIntImpl(IntID aID, int32_t& aResult) {
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
nsresult nsLookAndFeel::GetFloatImpl(FloatID aID, float& aResult) {
|
||||
nsresult res = nsXPLookAndFeel::GetFloatImpl(aID, aResult);
|
||||
if (NS_SUCCEEDED(res)) return res;
|
||||
res = NS_OK;
|
||||
nsresult nsLookAndFeel::NativeGetFloat(FloatID aID, float& aResult) {
|
||||
nsresult res = NS_OK;
|
||||
|
||||
switch (aID) {
|
||||
case FloatID::IMEUnderlineRelativeSize:
|
||||
|
@ -625,7 +621,7 @@ bool nsLookAndFeel::SystemWantsDarkTheme() {
|
|||
return !![[NSUserDefaults standardUserDefaults] stringForKey:@"AppleInterfaceStyle"];
|
||||
}
|
||||
|
||||
bool nsLookAndFeel::GetFontImpl(FontID aID, nsString& aFontName, gfxFontStyle& aFontStyle) {
|
||||
bool nsLookAndFeel::NativeGetFont(FontID aID, nsString& aFontName, gfxFontStyle& aFontStyle) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN;
|
||||
|
||||
// hack for now
|
||||
|
|
|
@ -586,13 +586,9 @@ static int32_t ConvertGTKStepperStyleToMozillaScrollArrowStyle(
|
|||
mozilla::LookAndFeel::eScrollArrow_StartForward);
|
||||
}
|
||||
|
||||
nsresult nsLookAndFeel::GetIntImpl(IntID aID, int32_t& aResult) {
|
||||
nsresult nsLookAndFeel::NativeGetInt(IntID aID, int32_t& aResult) {
|
||||
nsresult res = NS_OK;
|
||||
|
||||
res = nsXPLookAndFeel::GetIntImpl(aID, aResult);
|
||||
if (NS_SUCCEEDED(res)) return res;
|
||||
res = NS_OK;
|
||||
|
||||
// We use delayed initialization by EnsureInit() here
|
||||
// to make sure mozilla::Preferences is available (Bug 115807).
|
||||
// IntID::UseAccessibilityTheme is requested before user preferences
|
||||
|
@ -813,12 +809,8 @@ nsresult nsLookAndFeel::GetIntImpl(IntID aID, int32_t& aResult) {
|
|||
return res;
|
||||
}
|
||||
|
||||
nsresult nsLookAndFeel::GetFloatImpl(FloatID aID, float& aResult) {
|
||||
nsresult res = NS_OK;
|
||||
res = nsXPLookAndFeel::GetFloatImpl(aID, aResult);
|
||||
if (NS_SUCCEEDED(res)) return res;
|
||||
res = NS_OK;
|
||||
|
||||
nsresult nsLookAndFeel::NativeGetFloat(FloatID aID, float& aResult) {
|
||||
nsresult rv = NS_OK;
|
||||
switch (aID) {
|
||||
case FloatID::IMEUnderlineRelativeSize:
|
||||
aResult = 1.0f;
|
||||
|
@ -832,9 +824,9 @@ nsresult nsLookAndFeel::GetFloatImpl(FloatID aID, float& aResult) {
|
|||
break;
|
||||
default:
|
||||
aResult = -1.0;
|
||||
res = NS_ERROR_FAILURE;
|
||||
rv = NS_ERROR_FAILURE;
|
||||
}
|
||||
return res;
|
||||
return rv;
|
||||
}
|
||||
|
||||
static void GetSystemFontInfo(GtkStyleContext* aStyle, nsString* aFontName,
|
||||
|
@ -873,8 +865,8 @@ static void GetSystemFontInfo(GtkStyleContext* aStyle, nsString* aFontName,
|
|||
pango_font_description_free(desc);
|
||||
}
|
||||
|
||||
bool nsLookAndFeel::GetFontImpl(FontID aID, nsString& aFontName,
|
||||
gfxFontStyle& aFontStyle) {
|
||||
bool nsLookAndFeel::NativeGetFont(FontID aID, nsString& aFontName,
|
||||
gfxFontStyle& aFontStyle) {
|
||||
switch (aID) {
|
||||
case FontID::Menu: // css2
|
||||
case FontID::PullDownMenu: // css3
|
||||
|
|
|
@ -23,11 +23,11 @@ class nsLookAndFeel final : public nsXPLookAndFeel {
|
|||
|
||||
void NativeInit() final;
|
||||
void RefreshImpl() override;
|
||||
nsresult NativeGetInt(IntID aID, int32_t& aResult) override;
|
||||
nsresult NativeGetFloat(FloatID aID, float& aResult) override;
|
||||
nsresult NativeGetColor(ColorID aID, nscolor& aResult) override;
|
||||
nsresult GetIntImpl(IntID aID, int32_t& aResult) override;
|
||||
nsresult GetFloatImpl(FloatID aID, float& aResult) override;
|
||||
bool GetFontImpl(FontID aID, nsString& aFontName,
|
||||
gfxFontStyle& aFontStyle) override;
|
||||
bool NativeGetFont(FontID aID, nsString& aFontName,
|
||||
gfxFontStyle& aFontStyle) override;
|
||||
|
||||
char16_t GetPasswordCharacterImpl() override;
|
||||
bool GetEchoPasswordImpl() override;
|
||||
|
|
|
@ -23,12 +23,12 @@ class HeadlessLookAndFeel : public nsXPLookAndFeel {
|
|||
HeadlessLookAndFeel();
|
||||
virtual ~HeadlessLookAndFeel();
|
||||
|
||||
virtual nsresult NativeGetColor(ColorID aID, nscolor& aResult) override;
|
||||
void NativeInit() final{};
|
||||
virtual nsresult GetIntImpl(IntID aID, int32_t& aResult) override;
|
||||
virtual nsresult GetFloatImpl(FloatID aID, float& aResult) override;
|
||||
virtual bool GetFontImpl(FontID aID, nsString& aFontName,
|
||||
gfxFontStyle& aFontStyle) override;
|
||||
virtual nsresult NativeGetInt(IntID aID, int32_t& aResult) override;
|
||||
virtual nsresult NativeGetFloat(FloatID aID, float& aResult) override;
|
||||
virtual nsresult NativeGetColor(ColorID aID, nscolor& aResult) override;
|
||||
virtual bool NativeGetFont(FontID aID, nsString& aFontName,
|
||||
gfxFontStyle& aFontStyle) override;
|
||||
|
||||
virtual void RefreshImpl() override;
|
||||
virtual char16_t GetPasswordCharacterImpl() override;
|
||||
|
|
|
@ -126,11 +126,8 @@ nsresult HeadlessLookAndFeel::NativeGetColor(ColorID aID, nscolor& aColor) {
|
|||
return res;
|
||||
}
|
||||
|
||||
nsresult HeadlessLookAndFeel::GetIntImpl(IntID aID, int32_t& aResult) {
|
||||
nsresult res = nsXPLookAndFeel::GetIntImpl(aID, aResult);
|
||||
if (NS_SUCCEEDED(res)) return res;
|
||||
res = NS_OK;
|
||||
|
||||
nsresult HeadlessLookAndFeel::NativeGetInt(IntID aID, int32_t& aResult) {
|
||||
nsresult res = NS_OK;
|
||||
// These values should be sane defaults for headless mode under GTK.
|
||||
switch (aID) {
|
||||
case IntID::CaretBlinkTime:
|
||||
|
@ -301,7 +298,7 @@ nsresult HeadlessLookAndFeel::GetIntImpl(IntID aID, int32_t& aResult) {
|
|||
break;
|
||||
default:
|
||||
NS_WARNING(
|
||||
"HeadlessLookAndFeel::GetIntImpl called with an unrecognized aID");
|
||||
"HeadlessLookAndFeel::NativeGetInt called with an unrecognized aID");
|
||||
aResult = 0;
|
||||
res = NS_ERROR_FAILURE;
|
||||
break;
|
||||
|
@ -309,10 +306,8 @@ nsresult HeadlessLookAndFeel::GetIntImpl(IntID aID, int32_t& aResult) {
|
|||
return res;
|
||||
}
|
||||
|
||||
nsresult HeadlessLookAndFeel::GetFloatImpl(FloatID aID, float& aResult) {
|
||||
nsresult res = nsXPLookAndFeel::GetFloatImpl(aID, aResult);
|
||||
if (NS_SUCCEEDED(res)) return res;
|
||||
res = NS_OK;
|
||||
nsresult HeadlessLookAndFeel::NativeGetFloat(FloatID aID, float& aResult) {
|
||||
nsresult res = NS_OK;
|
||||
|
||||
// Hardcoded values for GTK.
|
||||
switch (aID) {
|
||||
|
@ -329,7 +324,8 @@ nsresult HeadlessLookAndFeel::GetFloatImpl(FloatID aID, float& aResult) {
|
|||
break;
|
||||
default:
|
||||
NS_WARNING(
|
||||
"HeadlessLookAndFeel::GetFloatImpl called with an unrecognized aID");
|
||||
"HeadlessLookAndFeel::NativeGetFloat called with an unrecognized "
|
||||
"aID");
|
||||
aResult = -1.0;
|
||||
res = NS_ERROR_FAILURE;
|
||||
break;
|
||||
|
@ -338,8 +334,8 @@ nsresult HeadlessLookAndFeel::GetFloatImpl(FloatID aID, float& aResult) {
|
|||
return res;
|
||||
}
|
||||
|
||||
bool HeadlessLookAndFeel::GetFontImpl(FontID aID, nsString& aFontName,
|
||||
gfxFontStyle& aFontStyle) {
|
||||
bool HeadlessLookAndFeel::NativeGetFont(FontID aID, nsString& aFontName,
|
||||
gfxFontStyle& aFontStyle) {
|
||||
// Default to san-serif for everything.
|
||||
aFontStyle.style = FontSlantStyle::Normal();
|
||||
aFontStyle.weight = FontWeight::Normal();
|
||||
|
|
|
@ -784,9 +784,9 @@ nscolor nsXPLookAndFeel::GetStandinForNativeColor(ColorID aID) {
|
|||
// otherwise we'll return NS_ERROR_NOT_AVAILABLE, in which case, the
|
||||
// platform-specific nsLookAndFeel should use its own values instead.
|
||||
//
|
||||
nsresult nsXPLookAndFeel::GetColorImpl(ColorID aID,
|
||||
bool aUseStandinsForNativeColors,
|
||||
nscolor& aResult) {
|
||||
nsresult nsXPLookAndFeel::GetColorValue(ColorID aID,
|
||||
bool aUseStandinsForNativeColors,
|
||||
nscolor& aResult) {
|
||||
if (!sInitialized) Init();
|
||||
|
||||
// define DEBUG_SYSTEM_COLOR_USE if you want to debug system color
|
||||
|
@ -947,7 +947,7 @@ nsresult nsXPLookAndFeel::GetColorImpl(ColorID aID,
|
|||
return NS_ERROR_NOT_AVAILABLE;
|
||||
}
|
||||
|
||||
nsresult nsXPLookAndFeel::GetIntImpl(IntID aID, int32_t& aResult) {
|
||||
nsresult nsXPLookAndFeel::GetIntValue(IntID aID, int32_t& aResult) {
|
||||
if (!sInitialized) Init();
|
||||
|
||||
for (unsigned int i = 0; i < ArrayLength(sIntPrefs); ++i) {
|
||||
|
@ -957,10 +957,10 @@ nsresult nsXPLookAndFeel::GetIntImpl(IntID aID, int32_t& aResult) {
|
|||
}
|
||||
}
|
||||
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
return NativeGetInt(aID, aResult);
|
||||
}
|
||||
|
||||
nsresult nsXPLookAndFeel::GetFloatImpl(FloatID aID, float& aResult) {
|
||||
nsresult nsXPLookAndFeel::GetFloatValue(FloatID aID, float& aResult) {
|
||||
if (!sInitialized) Init();
|
||||
|
||||
for (unsigned int i = 0; i < ArrayLength(sFloatPrefs); ++i) {
|
||||
|
@ -970,7 +970,7 @@ nsresult nsXPLookAndFeel::GetFloatImpl(FloatID aID, float& aResult) {
|
|||
}
|
||||
}
|
||||
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
return NativeGetFloat(aID, aResult);
|
||||
}
|
||||
|
||||
void nsXPLookAndFeel::RefreshImpl() {
|
||||
|
@ -1009,7 +1009,7 @@ void nsXPLookAndFeel::RecordTelemetry() {
|
|||
int32_t i;
|
||||
Telemetry::ScalarSet(
|
||||
Telemetry::ScalarID::WIDGET_DARK_MODE,
|
||||
NS_SUCCEEDED(GetIntImpl(IntID::SystemUsesDarkTheme, i)) && i != 0);
|
||||
NS_SUCCEEDED(GetIntValue(IntID::SystemUsesDarkTheme, i)) && i != 0);
|
||||
|
||||
RecordLookAndFeelSpecificTelemetry();
|
||||
}
|
||||
|
@ -1026,28 +1026,28 @@ void LookAndFeel::NotifyChangedAllWindows(widget::ThemeChangeKind aKind) {
|
|||
|
||||
// static
|
||||
nsresult LookAndFeel::GetColor(ColorID aID, nscolor* aResult) {
|
||||
return nsLookAndFeel::GetInstance()->GetColorImpl(aID, false, *aResult);
|
||||
return nsLookAndFeel::GetInstance()->GetColorValue(aID, false, *aResult);
|
||||
}
|
||||
|
||||
nsresult LookAndFeel::GetColor(ColorID aID, bool aUseStandinsForNativeColors,
|
||||
nscolor* aResult) {
|
||||
return nsLookAndFeel::GetInstance()->GetColorImpl(
|
||||
return nsLookAndFeel::GetInstance()->GetColorValue(
|
||||
aID, aUseStandinsForNativeColors, *aResult);
|
||||
}
|
||||
|
||||
// static
|
||||
nsresult LookAndFeel::GetInt(IntID aID, int32_t* aResult) {
|
||||
return nsLookAndFeel::GetInstance()->GetIntImpl(aID, *aResult);
|
||||
return nsLookAndFeel::GetInstance()->GetIntValue(aID, *aResult);
|
||||
}
|
||||
|
||||
// static
|
||||
nsresult LookAndFeel::GetFloat(FloatID aID, float* aResult) {
|
||||
return nsLookAndFeel::GetInstance()->GetFloatImpl(aID, *aResult);
|
||||
return nsLookAndFeel::GetInstance()->GetFloatValue(aID, *aResult);
|
||||
}
|
||||
|
||||
// static
|
||||
bool LookAndFeel::GetFont(FontID aID, nsString& aName, gfxFontStyle& aStyle) {
|
||||
return nsLookAndFeel::GetInstance()->GetFontImpl(aID, aName, aStyle);
|
||||
return nsLookAndFeel::GetInstance()->GetFontValue(aID, aName, aStyle);
|
||||
}
|
||||
|
||||
// static
|
||||
|
|
|
@ -49,21 +49,27 @@ class nsXPLookAndFeel : public mozilla::LookAndFeel {
|
|||
|
||||
void Init();
|
||||
|
||||
// These functions will return a value specified by an override pref, if it
|
||||
// exists, and otherwise will call into the NativeGetXxx function to get the
|
||||
// platform-specific value.
|
||||
//
|
||||
// All these routines will return NS_OK if they have a value,
|
||||
// in which case the nsLookAndFeel should use that value;
|
||||
// otherwise we'll return NS_ERROR_NOT_AVAILABLE, in which case, the
|
||||
// platform-specific nsLookAndFeel should use its own values instead.
|
||||
//
|
||||
nsresult GetColorImpl(ColorID aID, bool aUseStandinsForNativeColors,
|
||||
nscolor& aResult);
|
||||
virtual nsresult GetIntImpl(IntID aID, int32_t& aResult);
|
||||
virtual nsresult GetFloatImpl(FloatID aID, float& aResult);
|
||||
// NS_ERROR_NOT_AVAILABLE is returned if there is neither an override pref or
|
||||
// a platform-specific value.
|
||||
nsresult GetColorValue(ColorID aID, bool aUseStandinsForNativeColors,
|
||||
nscolor& aResult);
|
||||
nsresult GetIntValue(IntID aID, int32_t& aResult);
|
||||
nsresult GetFloatValue(FloatID aID, float& aResult);
|
||||
// Same, but returns false if there is no platform-specific value.
|
||||
// (There are no override prefs for font values.)
|
||||
bool GetFontValue(FontID aID, nsString& aName, gfxFontStyle& aStyle) {
|
||||
return NativeGetFont(aID, aName, aStyle);
|
||||
}
|
||||
|
||||
// This one is different: there are no override prefs (fixme?), so
|
||||
// there is no XP implementation, only per-system impls.
|
||||
virtual bool GetFontImpl(FontID aID, nsString& aName,
|
||||
gfxFontStyle& aStyle) = 0;
|
||||
virtual nsresult NativeGetInt(IntID aID, int32_t& aResult) = 0;
|
||||
virtual nsresult NativeGetFloat(FloatID aID, float& aResult) = 0;
|
||||
virtual nsresult NativeGetColor(ColorID aID, nscolor& aResult) = 0;
|
||||
virtual bool NativeGetFont(FontID aID, nsString& aName,
|
||||
gfxFontStyle& aStyle) = 0;
|
||||
|
||||
virtual void RefreshImpl();
|
||||
|
||||
|
@ -92,7 +98,6 @@ class nsXPLookAndFeel : public mozilla::LookAndFeel {
|
|||
void InitFromPref(nsLookAndFeelIntPref* aPref);
|
||||
void InitFromPref(nsLookAndFeelFloatPref* aPref);
|
||||
void InitColorFromPref(int32_t aIndex);
|
||||
virtual nsresult NativeGetColor(ColorID aID, nscolor& aResult) = 0;
|
||||
bool IsSpecialColor(ColorID aID, nscolor& aColor);
|
||||
bool ColorIsNotCSSAccessible(ColorID aID);
|
||||
nscolor GetStandinForNativeColor(ColorID aID);
|
||||
|
|
|
@ -15,11 +15,11 @@ class nsLookAndFeel final : public nsXPLookAndFeel {
|
|||
|
||||
void NativeInit() final;
|
||||
virtual void RefreshImpl();
|
||||
virtual nsresult NativeGetColor(const ColorID aID, nscolor& aResult);
|
||||
virtual nsresult GetIntImpl(IntID aID, int32_t& aResult);
|
||||
virtual nsresult GetFloatImpl(FloatID aID, float& aResult);
|
||||
bool GetFontImpl(FontID aID, nsString& aFontName,
|
||||
gfxFontStyle& aFontStyle) override;
|
||||
nsresult NativeGetImpl(IntID aID, int32_t& aResult) override;
|
||||
nsresult NativeGetFloat(FloatID aID, float& aResult) override;
|
||||
nsresult NativeGetColor(const ColorID aID, nscolor& aResult) override;
|
||||
bool NativeGetFont(FontID aID, nsString& aFontName,
|
||||
gfxFontStyle& aFontStyle) override;
|
||||
virtual char16_t GetPasswordCharacterImpl() {
|
||||
// unicode value for the bullet character, used for password textfields.
|
||||
return 0x2022;
|
||||
|
|
|
@ -259,10 +259,8 @@ nsresult nsLookAndFeel::NativeGetColor(const ColorID aID, nscolor& aResult) {
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsLookAndFeel::GetIntImpl(IntID aID, int32_t& aResult) {
|
||||
nsresult res = nsXPLookAndFeel::GetIntImpl(aID, aResult);
|
||||
if (NS_SUCCEEDED(res)) return res;
|
||||
res = NS_OK;
|
||||
nsLookAndFeel::NativeGetInt(IntID aID, int32_t& aResult) {
|
||||
nsresult res = NS_OK;
|
||||
|
||||
switch (aID) {
|
||||
case IntID::ScrollButtonLeftMouseButtonAction:
|
||||
|
@ -361,10 +359,8 @@ nsLookAndFeel::GetIntImpl(IntID aID, int32_t& aResult) {
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsLookAndFeel::GetFloatImpl(FloatID aID, float& aResult) {
|
||||
nsresult res = nsXPLookAndFeel::GetFloatImpl(aID, aResult);
|
||||
if (NS_SUCCEEDED(res)) return res;
|
||||
res = NS_OK;
|
||||
nsLookAndFeel::NativeGetFloat(FloatID aID, float& aResult) {
|
||||
nsresult res = NS_OK;
|
||||
|
||||
switch (aID) {
|
||||
case FloatID::IMEUnderlineRelativeSize:
|
||||
|
@ -381,7 +377,7 @@ nsLookAndFeel::GetFloatImpl(FloatID aID, float& aResult) {
|
|||
return res;
|
||||
}
|
||||
|
||||
bool nsLookAndFeel::GetFontImpl(FontID aID, nsString& aFontName, gfxFontStyle& aFontStyle) {
|
||||
bool nsLookAndFeel::NativeGetFont(FontID aID, nsString& aFontName, gfxFontStyle& aFontStyle) {
|
||||
// hack for now
|
||||
if (aID == FontID::Window || aID == FontID::Document) {
|
||||
aFontStyle.style = FontSlantStyle::Normal();
|
||||
|
|
|
@ -365,10 +365,8 @@ nsresult nsLookAndFeel::NativeGetColor(ColorID aID, nscolor& aColor) {
|
|||
return res;
|
||||
}
|
||||
|
||||
nsresult nsLookAndFeel::GetIntImpl(IntID aID, int32_t& aResult) {
|
||||
nsresult res = nsXPLookAndFeel::GetIntImpl(aID, aResult);
|
||||
if (NS_SUCCEEDED(res)) return res;
|
||||
res = NS_OK;
|
||||
nsresult nsLookAndFeel::NativeGetInt(IntID aID, int32_t& aResult) {
|
||||
nsresult res = NS_OK;
|
||||
|
||||
switch (aID) {
|
||||
case IntID::ScrollButtonLeftMouseButtonAction:
|
||||
|
@ -618,10 +616,8 @@ nsresult nsLookAndFeel::GetIntImpl(IntID aID, int32_t& aResult) {
|
|||
return res;
|
||||
}
|
||||
|
||||
nsresult nsLookAndFeel::GetFloatImpl(FloatID aID, float& aResult) {
|
||||
nsresult res = nsXPLookAndFeel::GetFloatImpl(aID, aResult);
|
||||
if (NS_SUCCEEDED(res)) return res;
|
||||
res = NS_OK;
|
||||
nsresult nsLookAndFeel::NativeGetFloat(FloatID aID, float& aResult) {
|
||||
nsresult res = NS_OK;
|
||||
|
||||
switch (aID) {
|
||||
case FloatID::IMEUnderlineRelativeSize:
|
||||
|
@ -786,8 +782,8 @@ bool nsLookAndFeel::GetSysFont(LookAndFeel::FontID anID, nsString& aFontName,
|
|||
return true;
|
||||
}
|
||||
|
||||
bool nsLookAndFeel::GetFontImpl(FontID anID, nsString& aFontName,
|
||||
gfxFontStyle& aFontStyle) {
|
||||
bool nsLookAndFeel::NativeGetFont(FontID anID, nsString& aFontName,
|
||||
gfxFontStyle& aFontStyle) {
|
||||
CachedSystemFont& cacheSlot = mSystemFontCache[size_t(anID)];
|
||||
|
||||
bool status;
|
||||
|
|
|
@ -51,11 +51,11 @@ class nsLookAndFeel final : public nsXPLookAndFeel {
|
|||
|
||||
void NativeInit() final;
|
||||
void RefreshImpl() override;
|
||||
nsresult NativeGetInt(IntID aID, int32_t& aResult) override;
|
||||
nsresult NativeGetFloat(FloatID aID, float& aResult) override;
|
||||
nsresult NativeGetColor(ColorID aID, nscolor& aResult) override;
|
||||
nsresult GetIntImpl(IntID aID, int32_t& aResult) override;
|
||||
nsresult GetFloatImpl(FloatID aID, float& aResult) override;
|
||||
bool GetFontImpl(FontID aID, nsString& aFontName,
|
||||
gfxFontStyle& aFontStyle) override;
|
||||
bool NativeGetFont(FontID aID, nsString& aFontName,
|
||||
gfxFontStyle& aFontStyle) override;
|
||||
char16_t GetPasswordCharacterImpl() override;
|
||||
|
||||
LookAndFeelCache GetCacheImpl() override;
|
||||
|
|
Загрузка…
Ссылка в новой задаче