Bug 1690340 - Part 5: Remove the menu separators from the developer tools menu. r...
[gecko.git] / widget / LookAndFeelTypes.ipdlh
blob3539d3aacb749959fdfcb502456ccab4a3034d14
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";
11 namespace mozilla {
12 namespace widget {
14 struct LookAndFeelInt {
15     IntID id;
16     int32_t value;
19 [Comparable] struct LookAndFeelFont {
20     bool haveFont;
21     nsString name;
22     float size;
23     float weight;
24     bool italic;
27 struct LookAndFeelColor {
28     ColorID id;
29     nscolor color;
32 struct LookAndFeelCache {
33     LookAndFeelInt[] mInts;
34     LookAndFeelFont[] mFonts;
35     LookAndFeelColor[] mColors;
38 /**
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
43  * of specific values.
44  *
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.
51  *
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
54  * enum.)
55  */
56 struct LookAndFeelTables {
57     int32_t[] ints;
58     float[] floats;
59     nscolor[] colors;
60     LookAndFeelFont[] fonts;
62     uint8_t[] intMap;
63     uint8_t[] floatMap;
64     uint8_t[] colorMap;
65     uint8_t[] fontMap;
67     uint16_t passwordChar;
68     bool passwordEcho;
71 struct LookAndFeelTheme {
72 #ifdef MOZ_WIDGET_GTK
73     nsCString themeName;
74     bool preferDarkTheme;
75 #endif
78 /**
79  * Stores the entirety of a LookAndFeel's data.
80  */
81 struct FullLookAndFeel {
82     LookAndFeelTables tables;
83 #ifdef MOZ_WIDGET_GTK
84     LookAndFeelTheme theme;
85 #endif
88 union LookAndFeelData {
89     LookAndFeelCache;
90     FullLookAndFeel;
93 } // namespace widget
94 } // namespace mozilla