1 : /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : // vim:cindent:ts=8:et:sw=4:
3 : /* ***** BEGIN LICENSE BLOCK *****
4 : * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 : *
6 : * The contents of this file are subject to the Mozilla Public License Version
7 : * 1.1 (the "License"); you may not use this file except in compliance with
8 : * the License. You may obtain a copy of the License at
9 : * http://www.mozilla.org/MPL/
10 : *
11 : * Software distributed under the License is distributed on an "AS IS" basis,
12 : * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 : * for the specific language governing rights and limitations under the
14 : * License.
15 : *
16 : * The Original Code is mozilla.org code.
17 : *
18 : * The Initial Developer of the Original Code is
19 : * Netscape Communications Corporation.
20 : * Portions created by the Initial Developer are Copyright (C) 2002
21 : * the Initial Developer. All Rights Reserved.
22 : *
23 : * Contributor(s):
24 : * L. David Baron <dbaron@dbaron.org> (original author)
25 : *
26 : * Alternatively, the contents of this file may be used under the terms of
27 : * either the GNU General Public License Version 2 or later (the "GPL"), or
28 : * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
29 : * in which case the provisions of the GPL or the LGPL are applicable instead
30 : * of those above. If you wish to allow use of your version of this file only
31 : * under the terms of either the GPL or the LGPL, and not to allow others to
32 : * use your version of this file under the terms of the MPL, indicate your
33 : * decision by deleting the provisions above and replace them with the notice
34 : * and other provisions required by the GPL or the LGPL. If you do not delete
35 : * the provisions above, a recipient may use your version of this file under
36 : * the terms of any one of the MPL, the GPL or the LGPL.
37 : *
38 : * ***** END LICENSE BLOCK ***** */
39 :
40 : /*
41 : * list of structs that contain the data provided by nsStyleContext, the
42 : * internal API for computed style data for an element
43 : */
44 :
45 : /*
46 : * This file is intended to be used by different parts of the code, with
47 : * the STYLE_STRUCT macro (or the STYLE_STRUCT_INHERITED and
48 : * STYLE_STRUCT_RESET pair of macros) defined in different ways.
49 : */
50 :
51 : #ifndef STYLE_STRUCT_INHERITED
52 : #define STYLE_STRUCT_INHERITED(name, checkdata_cb, ctor_args) \
53 : STYLE_STRUCT(name, checkdata_cb, ctor_args)
54 : #define UNDEF_STYLE_STRUCT_INHERITED
55 : #endif
56 :
57 : #ifndef STYLE_STRUCT_RESET
58 : #define STYLE_STRUCT_RESET(name, checkdata_cb, ctor_args) \
59 : STYLE_STRUCT(name, checkdata_cb, ctor_args)
60 : #define UNDEF_STYLE_STRUCT_RESET
61 : #endif
62 :
63 : #ifdef STYLE_STRUCT_TEST
64 : #define STYLE_STRUCT_TEST_CODE(c) c
65 : #else
66 : #define STYLE_STRUCT_TEST_CODE(c)
67 : #endif
68 :
69 : // The inherited structs must be listed before the Reset structs.
70 : // nsStyleStructID assumes this is the case, and callers other than
71 : // nsStyleStructFwd.h that want the structs in id-order just define
72 : // STYLE_STRUCT rather than including the file twice.
73 :
74 0 : STYLE_STRUCT_TEST_CODE(if (STYLE_STRUCT_TEST < 8) {)
75 0 : STYLE_STRUCT_TEST_CODE( if (STYLE_STRUCT_TEST < 4) {)
76 0 : STYLE_STRUCT_TEST_CODE( if (STYLE_STRUCT_TEST < 2) {)
77 0 : STYLE_STRUCT_TEST_CODE( if (STYLE_STRUCT_TEST == 0) {)
78 0 : STYLE_STRUCT_INHERITED(Font, CheckFontCallback, (SSARG_PRESCONTEXT))
79 : STYLE_STRUCT_TEST_CODE( } else {)
80 0 : STYLE_STRUCT_INHERITED(Color, CheckColorCallback, (SSARG_PRESCONTEXT))
81 : STYLE_STRUCT_TEST_CODE( })
82 : STYLE_STRUCT_TEST_CODE( } else {)
83 0 : STYLE_STRUCT_TEST_CODE( if (STYLE_STRUCT_TEST == 2) {)
84 0 : STYLE_STRUCT_INHERITED(List, nsnull, ())
85 : STYLE_STRUCT_TEST_CODE( } else {)
86 0 : STYLE_STRUCT_INHERITED(Text, CheckTextCallback, ())
87 : STYLE_STRUCT_TEST_CODE( })
88 : STYLE_STRUCT_TEST_CODE( })
89 : STYLE_STRUCT_TEST_CODE( } else {)
90 0 : STYLE_STRUCT_TEST_CODE( if (STYLE_STRUCT_TEST < 6) {)
91 0 : STYLE_STRUCT_TEST_CODE( if (STYLE_STRUCT_TEST == 4) {)
92 0 : STYLE_STRUCT_INHERITED(Visibility, nsnull, (SSARG_PRESCONTEXT))
93 : STYLE_STRUCT_TEST_CODE( } else {)
94 0 : STYLE_STRUCT_INHERITED(Quotes, nsnull, ())
95 : STYLE_STRUCT_TEST_CODE( })
96 : STYLE_STRUCT_TEST_CODE( } else {)
97 0 : STYLE_STRUCT_TEST_CODE( if (STYLE_STRUCT_TEST == 6) {)
98 0 : STYLE_STRUCT_INHERITED(UserInterface, nsnull, ())
99 : STYLE_STRUCT_TEST_CODE( } else {)
100 0 : STYLE_STRUCT_INHERITED(TableBorder, nsnull, (SSARG_PRESCONTEXT))
101 : STYLE_STRUCT_TEST_CODE( })
102 : STYLE_STRUCT_TEST_CODE( })
103 : STYLE_STRUCT_TEST_CODE( })
104 0 : STYLE_STRUCT_TEST_CODE(} else if (STYLE_STRUCT_TEST < 16) {)
105 0 : STYLE_STRUCT_TEST_CODE( if (STYLE_STRUCT_TEST < 12) {)
106 0 : STYLE_STRUCT_TEST_CODE( if (STYLE_STRUCT_TEST < 10) {)
107 0 : STYLE_STRUCT_TEST_CODE( if (STYLE_STRUCT_TEST == 8) {)
108 0 : STYLE_STRUCT_INHERITED(SVG, nsnull, ())
109 : STYLE_STRUCT_TEST_CODE( } else {)
110 0 : STYLE_STRUCT_RESET(Background, nsnull, ())
111 : STYLE_STRUCT_TEST_CODE( })
112 : STYLE_STRUCT_TEST_CODE( } else {)
113 0 : STYLE_STRUCT_TEST_CODE( if (STYLE_STRUCT_TEST == 10) {)
114 0 : STYLE_STRUCT_RESET(Position, nsnull, ())
115 : STYLE_STRUCT_TEST_CODE( } else {)
116 0 : STYLE_STRUCT_RESET(TextReset, nsnull, ())
117 : STYLE_STRUCT_TEST_CODE( })
118 : STYLE_STRUCT_TEST_CODE( })
119 : STYLE_STRUCT_TEST_CODE( } else {)
120 0 : STYLE_STRUCT_TEST_CODE( if (STYLE_STRUCT_TEST < 14) {)
121 0 : STYLE_STRUCT_TEST_CODE( if (STYLE_STRUCT_TEST == 12) {)
122 0 : STYLE_STRUCT_RESET(Display, nsnull, ())
123 : STYLE_STRUCT_TEST_CODE( } else {)
124 0 : STYLE_STRUCT_RESET(Content, nsnull, ())
125 : STYLE_STRUCT_TEST_CODE( })
126 : STYLE_STRUCT_TEST_CODE( } else {)
127 0 : STYLE_STRUCT_TEST_CODE( if (STYLE_STRUCT_TEST == 14) {)
128 0 : STYLE_STRUCT_RESET(UIReset, nsnull, ())
129 : STYLE_STRUCT_TEST_CODE( } else {)
130 0 : STYLE_STRUCT_RESET(Table, nsnull, ())
131 : STYLE_STRUCT_TEST_CODE( })
132 : STYLE_STRUCT_TEST_CODE( })
133 : STYLE_STRUCT_TEST_CODE( })
134 0 : STYLE_STRUCT_TEST_CODE(} else if (STYLE_STRUCT_TEST < 20) {)
135 0 : STYLE_STRUCT_TEST_CODE( if (STYLE_STRUCT_TEST < 18) {)
136 0 : STYLE_STRUCT_TEST_CODE( if (STYLE_STRUCT_TEST == 16) {)
137 0 : STYLE_STRUCT_RESET(Margin, nsnull, ())
138 : STYLE_STRUCT_TEST_CODE( } else {)
139 0 : STYLE_STRUCT_RESET(Padding, nsnull, ())
140 : STYLE_STRUCT_TEST_CODE( })
141 : STYLE_STRUCT_TEST_CODE( } else {)
142 0 : STYLE_STRUCT_TEST_CODE( if (STYLE_STRUCT_TEST == 18) {)
143 0 : STYLE_STRUCT_RESET(Border, nsnull, (SSARG_PRESCONTEXT))
144 : STYLE_STRUCT_TEST_CODE( } else {)
145 0 : STYLE_STRUCT_RESET(Outline, nsnull, (SSARG_PRESCONTEXT))
146 : STYLE_STRUCT_TEST_CODE( })
147 : STYLE_STRUCT_TEST_CODE( })
148 0 : STYLE_STRUCT_TEST_CODE(} else if (STYLE_STRUCT_TEST < 22) {)
149 0 : STYLE_STRUCT_TEST_CODE( if (STYLE_STRUCT_TEST == 20) {)
150 0 : STYLE_STRUCT_RESET(XUL, nsnull, ())
151 : STYLE_STRUCT_TEST_CODE( } else {)
152 0 : STYLE_STRUCT_RESET(SVGReset,nsnull, ())
153 : STYLE_STRUCT_TEST_CODE( })
154 : STYLE_STRUCT_TEST_CODE(} else {)
155 0 : STYLE_STRUCT_TEST_CODE( NS_ASSERTION(STYLE_STRUCT_TEST == 22, "out of range");)
156 0 : STYLE_STRUCT_RESET(Column, nsnull, (SSARG_PRESCONTEXT))
157 : STYLE_STRUCT_TEST_CODE(})
158 :
159 : #ifdef UNDEF_STYLE_STRUCT_INHERITED
160 : #undef STYLE_STRUCT_INHERITED
161 : #undef UNDEF_STYLE_STRUCT_INHERITED
162 : #endif
163 :
164 : #ifdef UNDEF_STYLE_STRUCT_RESET
165 : #undef STYLE_STRUCT_RESET
166 : #undef UNDEF_STYLE_STRUCT_RESET
167 : #endif
168 :
169 : #undef STYLE_STRUCT_TEST_CODE
|