• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 /**
64  * \brief Begin a boolean option definition, with the default value passed in
65  * as a string
66  */
67 #define DRI_CONF_OPT_BEGIN_B(name,def) \
68 "<option name=\""#name"\" type=\"bool\" default="#def">\n"
69 
70 /** \brief Begin an option definition with quoted default value */
71 #define DRI_CONF_OPT_BEGIN_Q(name,type,def) \
72 "<option name=\""#name"\" type=\""#type"\" default="#def">\n"
73 
74 /** \brief Begin an option definition with restrictions on valid values */
75 #define DRI_CONF_OPT_BEGIN_V(name,type,def,valid) \
76 "<option name=\""#name"\" type=\""#type"\" default=\""#def"\" valid=\""valid"\">\n"
77 
78 /** \brief End an option description */
79 #define DRI_CONF_OPT_END \
80 "</option>\n"
81 
82 /** \brief A verbal description in a specified language (empty version) */
83 #define DRI_CONF_DESC(lang,text) \
84 "<description lang=\""#lang"\" text=\""text"\"/>\n"
85 
86 /** \brief A verbal description in a specified language */
87 #define DRI_CONF_DESC_BEGIN(lang,text) \
88 "<description lang=\""#lang"\" text=\""text"\">\n"
89 
90 /** \brief End a description */
91 #define DRI_CONF_DESC_END \
92 "</description>\n"
93 
94 /** \brief A verbal description of an enum value */
95 #define DRI_CONF_ENUM(value,text) \
96 "<enum value=\""#value"\" text=\""text"\"/>\n"
97 
98 
99 /*
100  * Predefined option sections and options with multi-lingual descriptions
101  * are now automatically generated.
102  */
103 #include "xmlpool/options.h"
104 
105 #endif
106