/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
class nsNativeThemeWin : public Theme { protected: virtual ~nsNativeThemeWin();
public: // Whether we draw a non-native widget. // // We always draw scrollbars as non-native so that all of Firefox has // consistent scrollbar styles both in chrome and content (plus, the // non-native scrollbars support scrollbar-width, auto-darkening...). // // We draw other widgets as non-native when their color-scheme is dark. In // that case (`BecauseColorMismatch`) we don't call into the non-native theme // for sizing information (GetWidgetPadding/Border and GetMinimumWidgetSize), // to avoid subtle sizing changes. The non-native theme can basically draw at // any size, so we prefer to have consistent sizing information. enumclass NonNative { No, Always, BecauseColorMismatch }; staticbool IsWidgetAlwaysNonNative(nsIFrame*, StyleAppearance);
NonNative IsWidgetNonNative(nsIFrame*, StyleAppearance);
// eUXNumClasses * THEME_PART_DISTINCT_VALUE_COUNT is about 800 at the time of // writing this, and nsIntMargin is 16 bytes wide, which makes this cache (1/8 // + 16) * 800 bytes, or about ~12KB. We could probably reduce this cache to // 3KB by caching on the aAppearance value instead, but there would be some // uncacheable values, since we derive some theme parts from other arguments.
uint8_t
mBorderCacheValid[(eUXNumClasses * THEME_PART_DISTINCT_VALUE_COUNT + 7) /
8];
LayoutDeviceIntMargin
mBorderCache[eUXNumClasses * THEME_PART_DISTINCT_VALUE_COUNT];
// See the above not for mBorderCache and friends. However // LayoutDeviceIntSize is half the size of nsIntMargin, making the // cache roughly half as large. In total the caches should come to about 18KB.
uint8_t mMinimumWidgetSizeCacheValid
[(eUXNumClasses * THEME_PART_DISTINCT_VALUE_COUNT + 7) / 8];
LayoutDeviceIntSize
mMinimumWidgetSizeCache[eUXNumClasses * THEME_PART_DISTINCT_VALUE_COUNT];
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.