2020-11-12 02:26:51 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=99: */
|
|
|
|
/* 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/. */
|
|
|
|
|
|
|
|
using nscolor from "nsColor.h";
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace widget {
|
|
|
|
|
2021-02-09 19:50:23 +03:00
|
|
|
[Comparable] struct LookAndFeelFont {
|
2020-11-12 02:26:51 +03:00
|
|
|
bool haveFont;
|
|
|
|
nsString name;
|
|
|
|
float size;
|
|
|
|
float weight;
|
|
|
|
bool italic;
|
|
|
|
};
|
|
|
|
|
2020-12-16 07:17:36 +03:00
|
|
|
/**
|
|
|
|
* The format allows for some compression compared with having fixed
|
|
|
|
* length arrays for each value type and some indication of whether
|
|
|
|
* a value is present. This is because not all values are present on
|
|
|
|
* a given platform, and because there is also substantial repetition
|
|
|
|
* of specific values.
|
|
|
|
*
|
|
|
|
* Each of ints, floats, colors, and fonts is an array that stores the
|
|
|
|
* unique values that occur in the LookAndFeel. intMap, floatMap,
|
|
|
|
* colorMap, and fontMap map from value IDs (LookAndFeel::IntID, etc.)
|
|
|
|
* to indexes into the value arrays. The map arrays are of fixed
|
|
|
|
* length, determined by the maximum ID value. If a value for a
|
|
|
|
* particular ID is not present, the entry in the map is set to -1.
|
|
|
|
*/
|
2020-12-22 22:26:41 +03:00
|
|
|
struct LookAndFeelTables {
|
2020-12-16 07:17:36 +03:00
|
|
|
int32_t[] ints;
|
|
|
|
float[] floats;
|
|
|
|
LookAndFeelFont[] fonts;
|
2021-04-03 01:17:55 +03:00
|
|
|
nscolor[] lightColors;
|
|
|
|
nscolor[] darkColors;
|
2020-12-16 07:17:36 +03:00
|
|
|
|
|
|
|
uint8_t[] intMap;
|
|
|
|
uint8_t[] floatMap;
|
|
|
|
uint8_t[] fontMap;
|
2021-04-03 01:17:55 +03:00
|
|
|
uint8_t[] lightColorMap;
|
|
|
|
uint8_t[] darkColorMap;
|
2020-12-16 07:17:36 +03:00
|
|
|
|
|
|
|
uint16_t passwordChar;
|
|
|
|
bool passwordEcho;
|
|
|
|
};
|
|
|
|
|
2020-12-22 22:26:41 +03:00
|
|
|
/**
|
|
|
|
* Stores the entirety of a LookAndFeel's data.
|
|
|
|
*/
|
|
|
|
struct FullLookAndFeel {
|
|
|
|
LookAndFeelTables tables;
|
|
|
|
};
|
|
|
|
|
2020-11-12 02:26:51 +03:00
|
|
|
} // namespace widget
|
|
|
|
} // namespace mozilla
|