Back to index

lightning-sunbird  0.9+nobinonly
nsStyleStructList.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
00002 // vim:cindent:ts=8:et:sw=4:
00003 /* ***** BEGIN LICENSE BLOCK *****
00004  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00005  *
00006  * The contents of this file are subject to the Mozilla Public License Version
00007  * 1.1 (the "License"); you may not use this file except in compliance with
00008  * the License. You may obtain a copy of the License at
00009  * http://www.mozilla.org/MPL/
00010  *
00011  * Software distributed under the License is distributed on an "AS IS" basis,
00012  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00013  * for the specific language governing rights and limitations under the
00014  * License.
00015  *
00016  * The Original Code is mozilla.org code.
00017  *
00018  * The Initial Developer of the Original Code is
00019  * Netscape Communications Corporation.
00020  * Portions created by the Initial Developer are Copyright (C) 2002
00021  * the Initial Developer. All Rights Reserved.
00022  *
00023  * Contributor(s):
00024  *   L. David Baron <dbaron@dbaron.org> (original author)
00025  *
00026  * Alternatively, the contents of this file may be used under the terms of
00027  * either the GNU General Public License Version 2 or later (the "GPL"), or
00028  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00029  * in which case the provisions of the GPL or the LGPL are applicable instead
00030  * of those above. If you wish to allow use of your version of this file only
00031  * under the terms of either the GPL or the LGPL, and not to allow others to
00032  * use your version of this file under the terms of the MPL, indicate your
00033  * decision by deleting the provisions above and replace them with the notice
00034  * and other provisions required by the GPL or the LGPL. If you do not delete
00035  * the provisions above, a recipient may use your version of this file under
00036  * the terms of any one of the MPL, the GPL or the LGPL.
00037  *
00038  * ***** END LICENSE BLOCK ***** */
00039 
00040 /*
00041  * This file is intended to be used by different parts of the code, with
00042  * the STYLE_STRUCT macro (or the STYLE_STRUCT_INHERITED and
00043  * STYLE_STRUCT_RESET pair of macros) defined in different ways.
00044  */
00045 
00046 #ifndef STYLE_STRUCT_INHERITED
00047 #define STYLE_STRUCT_INHERITED(name, checkdata_cb, ctor_args) \
00048   STYLE_STRUCT(name, checkdata_cb, ctor_args)
00049 #define UNDEF_STYLE_STRUCT_INHERITED
00050 #endif
00051 
00052 #ifndef STYLE_STRUCT_RESET
00053 #define STYLE_STRUCT_RESET(name, checkdata_cb, ctor_args) \
00054   STYLE_STRUCT(name, checkdata_cb, ctor_args)
00055 #define UNDEF_STYLE_STRUCT_RESET
00056 #endif
00057 
00058 #ifdef STYLE_STRUCT_TEST
00059 #define STYLE_STRUCT_TEST_CODE(c) c
00060 #else
00061 #define STYLE_STRUCT_TEST_CODE(c)
00062 #endif
00063 
00064   STYLE_STRUCT_TEST_CODE(if (STYLE_STRUCT_TEST < 8) {)
00065   STYLE_STRUCT_TEST_CODE(  if (STYLE_STRUCT_TEST < 4) {)
00066   STYLE_STRUCT_TEST_CODE(    if (STYLE_STRUCT_TEST < 2) {)
00067   STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 0) {)
00068 STYLE_STRUCT_INHERITED(Font, CheckFontCallback, (SSARG_PRESCONTEXT))
00069   STYLE_STRUCT_TEST_CODE(      } else {)
00070 STYLE_STRUCT_INHERITED(Color, nsnull, (SSARG_PRESCONTEXT))
00071   STYLE_STRUCT_TEST_CODE(      })
00072   STYLE_STRUCT_TEST_CODE(    } else {)
00073   STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 2) {)
00074 STYLE_STRUCT_RESET(Background, nsnull, (SSARG_PRESCONTEXT))
00075   STYLE_STRUCT_TEST_CODE(      } else {)
00076 STYLE_STRUCT_INHERITED(List, nsnull, ())
00077   STYLE_STRUCT_TEST_CODE(      })
00078   STYLE_STRUCT_TEST_CODE(    })
00079   STYLE_STRUCT_TEST_CODE(  } else {)
00080   STYLE_STRUCT_TEST_CODE(    if (STYLE_STRUCT_TEST < 6) {)
00081   STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 4) {)
00082 STYLE_STRUCT_RESET(Position, nsnull, ())
00083   STYLE_STRUCT_TEST_CODE(      } else {)
00084 STYLE_STRUCT_INHERITED(Text, nsnull, ())
00085   STYLE_STRUCT_TEST_CODE(      })
00086   STYLE_STRUCT_TEST_CODE(    } else {)
00087   STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 6) {)
00088 STYLE_STRUCT_RESET(TextReset, nsnull, ())
00089   STYLE_STRUCT_TEST_CODE(      } else {)
00090 STYLE_STRUCT_RESET(Display, nsnull, ())
00091   STYLE_STRUCT_TEST_CODE(      })
00092   STYLE_STRUCT_TEST_CODE(    })
00093   STYLE_STRUCT_TEST_CODE(  })
00094   STYLE_STRUCT_TEST_CODE(} else if (STYLE_STRUCT_TEST < 16) {)
00095   STYLE_STRUCT_TEST_CODE(  if (STYLE_STRUCT_TEST < 12) {)
00096   STYLE_STRUCT_TEST_CODE(    if (STYLE_STRUCT_TEST < 10) {)
00097   STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 8) {)
00098 STYLE_STRUCT_INHERITED(Visibility, nsnull, (SSARG_PRESCONTEXT))
00099   STYLE_STRUCT_TEST_CODE(      } else {)
00100 STYLE_STRUCT_RESET(Content, nsnull, ())
00101   STYLE_STRUCT_TEST_CODE(      })
00102   STYLE_STRUCT_TEST_CODE(    } else {)
00103   STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 10) {)
00104 STYLE_STRUCT_INHERITED(Quotes, nsnull, ())
00105   STYLE_STRUCT_TEST_CODE(      } else {)
00106 STYLE_STRUCT_INHERITED(UserInterface, nsnull, ())
00107   STYLE_STRUCT_TEST_CODE(      })
00108   STYLE_STRUCT_TEST_CODE(    })
00109   STYLE_STRUCT_TEST_CODE(  } else {)
00110   STYLE_STRUCT_TEST_CODE(    if (STYLE_STRUCT_TEST < 14) {)
00111   STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 12) {)
00112 STYLE_STRUCT_RESET(UIReset, nsnull, ())
00113   STYLE_STRUCT_TEST_CODE(      } else {)
00114 STYLE_STRUCT_RESET(Table, nsnull, ())
00115   STYLE_STRUCT_TEST_CODE(      })
00116   STYLE_STRUCT_TEST_CODE(    } else {)
00117   STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 14) {)
00118 STYLE_STRUCT_INHERITED(TableBorder, nsnull, (SSARG_PRESCONTEXT))
00119   STYLE_STRUCT_TEST_CODE(      } else {)
00120 STYLE_STRUCT_RESET(Margin, nsnull, ())
00121   STYLE_STRUCT_TEST_CODE(      })
00122   STYLE_STRUCT_TEST_CODE(    })
00123   STYLE_STRUCT_TEST_CODE(  })
00124   STYLE_STRUCT_TEST_CODE(} else if (STYLE_STRUCT_TEST < 20) {)
00125   STYLE_STRUCT_TEST_CODE(  if (STYLE_STRUCT_TEST < 18) {)
00126   STYLE_STRUCT_TEST_CODE(    if (STYLE_STRUCT_TEST == 16) {)
00127 STYLE_STRUCT_RESET(Padding, nsnull, ())
00128   STYLE_STRUCT_TEST_CODE(    } else {)
00129 STYLE_STRUCT_RESET(Border, nsnull, ())
00130   STYLE_STRUCT_TEST_CODE(    })
00131   STYLE_STRUCT_TEST_CODE(  } else {)
00132   STYLE_STRUCT_TEST_CODE(    if (STYLE_STRUCT_TEST == 18) {)
00133 STYLE_STRUCT_RESET(Outline, nsnull, (SSARG_PRESCONTEXT))
00134   STYLE_STRUCT_TEST_CODE(    } else {)
00135 STYLE_STRUCT_RESET(XUL, nsnull, ())
00136   STYLE_STRUCT_TEST_CODE(    })
00137   STYLE_STRUCT_TEST_CODE(  })
00138 #ifndef MOZ_SVG
00139   STYLE_STRUCT_TEST_CODE(} else {)
00140   STYLE_STRUCT_TEST_CODE(  NS_ASSERTION(STYLE_STRUCT_TEST == 20, "out of range");)
00141 #else
00142   STYLE_STRUCT_TEST_CODE(} else if (STYLE_STRUCT_TEST < 22) {)
00143   STYLE_STRUCT_TEST_CODE(  if (STYLE_STRUCT_TEST == 20) {)
00144 STYLE_STRUCT_INHERITED(SVG, nsnull, ())
00145   STYLE_STRUCT_TEST_CODE(  } else {)
00146 STYLE_STRUCT_RESET(SVGReset,nsnull, ())
00147   STYLE_STRUCT_TEST_CODE(  })
00148   STYLE_STRUCT_TEST_CODE(} else {)
00149   STYLE_STRUCT_TEST_CODE(  NS_ASSERTION(STYLE_STRUCT_TEST == 22, "out of range");)
00150 #endif
00151   STYLE_STRUCT_RESET(Column, nsnull, ())
00152 STYLE_STRUCT_TEST_CODE(})
00153       
00154 #ifdef UNDEF_STYLE_STRUCT_INHERITED
00155 #undef STYLE_STRUCT_INHERITED
00156 #undef UNDEF_STYLE_STRUCT_INHERITED
00157 #endif
00158 
00159 #ifdef UNDEF_STYLE_STRUCT_RESET
00160 #undef STYLE_STRUCT_RESET
00161 #undef UNDEF_STYLE_STRUCT_RESET
00162 #endif
00163 
00164 #undef STYLE_STRUCT_TEST_CODE