Home | History | Annotate | Download | only in common
      1 /*
      2  * XML DRI client-side driver configuration
      3  * Copyright (C) 2003 Felix Kuehling
      4  *
      5  * Permission is hereby granted, free of charge, to any person obtaining a
      6  * copy of this software and associated documentation files (the "Software"),
      7  * to deal in the Software without restriction, including without limitation
      8  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
      9  * and/or sell copies of the Software, and to permit persons to whom the
     10  * Software is furnished to do so, subject to the following conditions:
     11  *
     12  * The above copyright notice and this permission notice shall be included
     13  * in all copies or substantial portions of the Software.
     14  *
     15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
     16  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
     17  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
     18  * FELIX KUEHLING, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM,
     19  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
     20  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
     21  * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
     22  *
     23  */
     24 /**
     25  * \file xmlpool.h
     26  * \brief Pool of common options
     27  * \author Felix Kuehling
     28  *
     29  * This file defines macros that can be used to construct
     30  * driConfigOptions in the drivers. Common options are defined in
     31  * xmlpool/t_options.h from which xmlpool/options.h is generated with
     32  * translations. This file defines generic helper macros and includes
     33  * xmlpool/options.h.
     34  */
     35 
     36 #ifndef __XMLPOOL_H
     37 #define __XMLPOOL_H
     38 
     39 /*
     40  * generic macros
     41  */
     42 
     43 /** \brief Begin __driConfigOptions */
     44 #define DRI_CONF_BEGIN \
     45 "<driinfo>\n"
     46 
     47 /** \brief End __driConfigOptions */
     48 #define DRI_CONF_END \
     49 "</driinfo>\n"
     50 
     51 /** \brief Begin a section of related options */
     52 #define DRI_CONF_SECTION_BEGIN \
     53 "<section>\n"
     54 
     55 /** \brief End a section of related options */
     56 #define DRI_CONF_SECTION_END \
     57 "</section>\n"
     58 
     59 /** \brief Begin an option definition */
     60 #define DRI_CONF_OPT_BEGIN(name,type,def) \
     61 "<option name=\""#name"\" type=\""#type"\" default=\""#def"\">\n"
     62 
     63 /** \brief Begin an option definition with quoted default value */
     64 #define DRI_CONF_OPT_BEGIN_Q(name,type,def) \
     65 "<option name=\""#name"\" type=\""#type"\" default="#def">\n"
     66 
     67 /** \brief Begin an option definition with restrictions on valid values */
     68 #define DRI_CONF_OPT_BEGIN_V(name,type,def,valid) \
     69 "<option name=\""#name"\" type=\""#type"\" default=\""#def"\" valid=\""valid"\">\n"
     70 
     71 /** \brief End an option description */
     72 #define DRI_CONF_OPT_END \
     73 "</option>\n"
     74 
     75 /** \brief A verbal description in a specified language (empty version) */
     76 #define DRI_CONF_DESC(lang,text) \
     77 "<description lang=\""#lang"\" text=\""text"\"/>\n"
     78 
     79 /** \brief A verbal description in a specified language */
     80 #define DRI_CONF_DESC_BEGIN(lang,text) \
     81 "<description lang=\""#lang"\" text=\""text"\">\n"
     82 
     83 /** \brief End a description */
     84 #define DRI_CONF_DESC_END \
     85 "</description>\n"
     86 
     87 /** \brief A verbal description of an enum value */
     88 #define DRI_CONF_ENUM(value,text) \
     89 "<enum value=\""#value"\" text=\""text"\"/>\n"
     90 
     91 
     92 /*
     93  * Predefined option sections and options with multi-lingual descriptions
     94  * are now automatically generated.
     95  */
     96 #include "xmlpool/options.h"
     97 
     98 #endif
     99