VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/xorg-server-1.12.0/xf86Opt.h@ 68753

最後變更 在這個檔案從68753是 40349,由 vboxsync 提交於 13 年 前

Additions/xorg: support X.Org Server 1.12.

  • 屬性 svn:eol-style 設為 native
檔案大小: 6.2 KB
 
1
2/*
3 * Copyright (c) 1998-2003 by The XFree86 Project, Inc.
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 in
13 * all copies or substantial portions of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
19 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
21 * OTHER DEALINGS IN THE SOFTWARE.
22 *
23 * Except as contained in this notice, the name of the copyright holder(s)
24 * and author(s) shall not be used in advertising or otherwise to promote
25 * the sale, use or other dealings in this Software without prior written
26 * authorization from the copyright holder(s) and author(s).
27 */
28
29/* Option handling things that ModuleSetup procs can use */
30
31#ifndef _XF86_OPT_H_
32#define _XF86_OPT_H_
33#include "xf86Optionstr.h"
34
35typedef struct {
36 double freq;
37 int units;
38} OptFrequency;
39
40typedef union {
41 unsigned long num;
42 char * str;
43 double realnum;
44 Bool bool;
45 OptFrequency freq;
46} ValueUnion;
47
48typedef enum {
49 OPTV_NONE = 0,
50 OPTV_INTEGER,
51 OPTV_STRING, /* a non-empty string */
52 OPTV_ANYSTR, /* Any string, including an empty one */
53 OPTV_REAL,
54 OPTV_BOOLEAN,
55 OPTV_PERCENT,
56 OPTV_FREQ
57} OptionValueType;
58
59typedef enum {
60 OPTUNITS_HZ = 1,
61 OPTUNITS_KHZ,
62 OPTUNITS_MHZ
63} OptFreqUnits;
64
65typedef struct {
66 int token;
67 const char* name;
68 OptionValueType type;
69 ValueUnion value;
70 Bool found;
71} OptionInfoRec, *OptionInfoPtr;
72
73extern _X_EXPORT int xf86SetIntOption(XF86OptionPtr optlist, const char *name, int deflt);
74extern _X_EXPORT double xf86SetRealOption(XF86OptionPtr optlist, const char *name, double deflt);
75extern _X_EXPORT char *xf86SetStrOption(XF86OptionPtr optlist, const char *name, const char *deflt);
76extern _X_EXPORT int xf86SetBoolOption(XF86OptionPtr list, const char *name, int deflt );
77extern _X_EXPORT double xf86SetPercentOption(XF86OptionPtr list, const char *name, double deflt );
78extern _X_EXPORT int xf86CheckIntOption(XF86OptionPtr optlist, const char *name, int deflt);
79extern _X_EXPORT double xf86CheckRealOption(XF86OptionPtr optlist, const char *name, double deflt);
80extern _X_EXPORT char *xf86CheckStrOption(XF86OptionPtr optlist, const char *name, char *deflt);
81extern _X_EXPORT int xf86CheckBoolOption(XF86OptionPtr list, const char *name, int deflt );
82extern _X_EXPORT double xf86CheckPercentOption(XF86OptionPtr list, const char *name, double deflt );
83extern _X_EXPORT XF86OptionPtr xf86AddNewOption(XF86OptionPtr head, const char *name, const char *val );
84extern _X_EXPORT XF86OptionPtr xf86NewOption(char *name, char *value );
85extern _X_EXPORT XF86OptionPtr xf86NextOption(XF86OptionPtr list );
86extern _X_EXPORT XF86OptionPtr xf86OptionListCreate(const char **options, int count, int used);
87extern _X_EXPORT XF86OptionPtr xf86OptionListMerge(XF86OptionPtr head, XF86OptionPtr tail);
88extern _X_EXPORT XF86OptionPtr xf86OptionListDuplicate(XF86OptionPtr list);
89extern _X_EXPORT void xf86OptionListFree(XF86OptionPtr opt);
90extern _X_EXPORT char *xf86OptionName(XF86OptionPtr opt);
91extern _X_EXPORT char *xf86OptionValue(XF86OptionPtr opt);
92extern _X_EXPORT void xf86OptionListReport(XF86OptionPtr parm);
93extern _X_EXPORT XF86OptionPtr xf86FindOption(XF86OptionPtr options, const char *name);
94extern _X_EXPORT const char *xf86FindOptionValue(XF86OptionPtr options, const char *name);
95extern _X_EXPORT void xf86MarkOptionUsed(XF86OptionPtr option);
96extern _X_EXPORT void xf86MarkOptionUsedByName(XF86OptionPtr options, const char *name);
97extern _X_EXPORT Bool xf86CheckIfOptionUsed(XF86OptionPtr option);
98extern _X_EXPORT Bool xf86CheckIfOptionUsedByName(XF86OptionPtr options, const char *name);
99extern _X_EXPORT void xf86ShowUnusedOptions(int scrnIndex, XF86OptionPtr options);
100extern _X_EXPORT void xf86ProcessOptions(int scrnIndex, XF86OptionPtr options, OptionInfoPtr optinfo);
101extern _X_EXPORT OptionInfoPtr xf86TokenToOptinfo(const OptionInfoRec *table, int token);
102extern _X_EXPORT const char *xf86TokenToOptName(const OptionInfoRec *table, int token);
103extern _X_EXPORT Bool xf86IsOptionSet(const OptionInfoRec *table, int token);
104extern _X_EXPORT char *xf86GetOptValString(const OptionInfoRec *table, int token);
105extern _X_EXPORT Bool xf86GetOptValInteger(const OptionInfoRec *table, int token, int *value);
106extern _X_EXPORT Bool xf86GetOptValULong(const OptionInfoRec *table, int token, unsigned long *value);
107extern _X_EXPORT Bool xf86GetOptValReal(const OptionInfoRec *table, int token, double *value);
108extern _X_EXPORT Bool xf86GetOptValFreq(const OptionInfoRec *table, int token,
109 OptFreqUnits expectedUnits, double *value);
110extern _X_EXPORT Bool xf86GetOptValBool(const OptionInfoRec *table, int token, Bool *value);
111extern _X_EXPORT Bool xf86ReturnOptValBool(const OptionInfoRec *table, int token, Bool def);
112extern _X_EXPORT int xf86NameCmp(const char *s1, const char *s2);
113extern _X_EXPORT char *xf86NormalizeName(const char *s);
114extern _X_EXPORT XF86OptionPtr xf86ReplaceIntOption(XF86OptionPtr optlist, const char *name, const int val);
115extern _X_EXPORT XF86OptionPtr xf86ReplaceRealOption(XF86OptionPtr optlist, const char *name, const double val);
116extern _X_EXPORT XF86OptionPtr xf86ReplaceBoolOption(XF86OptionPtr optlist, const char *name, const Bool val);
117extern _X_EXPORT XF86OptionPtr xf86ReplacePercentOption(XF86OptionPtr optlist, const char *name, const double val);
118extern _X_EXPORT XF86OptionPtr xf86ReplaceStrOption(XF86OptionPtr optlist, const char *name, const char* val);
119#endif
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette