michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: /* michael@0: * Forward declarations to avoid including all of nsStyleStruct.h. michael@0: */ michael@0: michael@0: #ifndef nsStyleStructFwd_h_ michael@0: #define nsStyleStructFwd_h_ michael@0: michael@0: enum nsStyleStructID { michael@0: michael@0: /* michael@0: * Define the constants eStyleStruct_Font, etc. michael@0: * michael@0: * The C++ standard, section 7.2, guarantees that enums begin with 0 and michael@0: * increase by 1. michael@0: * michael@0: * We separate the IDs of Reset and Inherited structs so that we can use michael@0: * the IDs as indices (offset by nsStyleStructID_*_Start) into arrays of michael@0: * one type or the other. michael@0: */ michael@0: michael@0: nsStyleStructID_Inherited_Start = 0, michael@0: // a dummy value so the value after it is the same as ..._Inherited_Start michael@0: nsStyleStructID_DUMMY1 = nsStyleStructID_Inherited_Start - 1, michael@0: michael@0: #define STYLE_STRUCT_INHERITED(name, checkdata_cb) \ michael@0: eStyleStruct_##name, michael@0: #define STYLE_STRUCT_RESET(name, checkdata_cb) michael@0: #include "nsStyleStructList.h" michael@0: #undef STYLE_STRUCT_INHERITED michael@0: #undef STYLE_STRUCT_RESET michael@0: michael@0: nsStyleStructID_Reset_Start, michael@0: // a dummy value so the value after it is the same as ..._Reset_Start michael@0: nsStyleStructID_DUMMY2 = nsStyleStructID_Reset_Start - 1, michael@0: michael@0: #define STYLE_STRUCT_RESET(name, checkdata_cb) \ michael@0: eStyleStruct_##name, michael@0: #define STYLE_STRUCT_INHERITED(name, checkdata_cb) michael@0: #include "nsStyleStructList.h" michael@0: #undef STYLE_STRUCT_INHERITED michael@0: #undef STYLE_STRUCT_RESET michael@0: michael@0: // one past the end; length of 0-based list michael@0: nsStyleStructID_Length, michael@0: michael@0: nsStyleStructID_Inherited_Count = michael@0: nsStyleStructID_Reset_Start - nsStyleStructID_Inherited_Start, michael@0: nsStyleStructID_Reset_Count = michael@0: nsStyleStructID_Length - nsStyleStructID_Reset_Start, michael@0: michael@0: // An ID used for properties that are not in style structs. This is michael@0: // used only in some users of nsStyleStructID, such as michael@0: // nsCSSProps::kSIDTable, including some that store SIDs in a bitfield, michael@0: // such as nsCSSCompressedDataBlock::mStyleBits. michael@0: eStyleStruct_BackendOnly = nsStyleStructID_Length michael@0: michael@0: }; michael@0: michael@0: // A bit corresponding to each struct ID michael@0: #define NS_STYLE_INHERIT_BIT(sid_) (1 << uint64_t(eStyleStruct_##sid_)) michael@0: michael@0: #endif /* nsStyleStructFwd_h_ */