1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=99: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 using mozilla::LookAndFeel::IntID from "mozilla/widget/WidgetMessageUtils.h";
8 using mozilla::LookAndFeel::ColorID from "mozilla/widget/WidgetMessageUtils.h";
9 using nscolor from "nsColor.h";
14 struct LookAndFeelInt {
19 [Comparable] struct LookAndFeelFont {
27 struct LookAndFeelColor {
32 struct LookAndFeelCache {
33 LookAndFeelInt[] mInts;
34 LookAndFeelFont[] mFonts;
35 LookAndFeelColor[] mColors;
39 * The format allows for some compression compared with having fixed
40 * length arrays for each value type and some indication of whether
41 * a value is present. This is because not all values are present on
42 * a given platform, and because there is also substantial repetition
45 * Each of ints, floats, colors, and fonts is an array that stores the
46 * unique values that occur in the LookAndFeel. intMap, floatMap,
47 * colorMap, and fontMap map from value IDs (LookAndFeel::IntID, etc.)
48 * to indexes into the value arrays. The map arrays are of fixed
49 * length, determined by the maximum ID value. If a value for a
50 * particular ID is not present, the entry in the map is set to -1.
52 * (Note that fontMap is different from the others since it maps from a
53 * LookAndFeel::FontID value minus 1, as 1 is the minimum value of that
56 struct LookAndFeelTables {
60 LookAndFeelFont[] fonts;
67 uint16_t passwordChar;
71 struct LookAndFeelTheme {
79 * Stores the entirety of a LookAndFeel's data.
81 struct FullLookAndFeel {
82 LookAndFeelTables tables;
84 LookAndFeelTheme theme;
88 union LookAndFeelData {
94 } // namespace mozilla