]> icculus.org git repositories - icculus/iodoom3.git/blob - neo/sys/linux/libXNVCtrl/NVCtrlLib.h
hello world
[icculus/iodoom3.git] / neo / sys / linux / libXNVCtrl / NVCtrlLib.h
1 #ifndef __NVCTRLLIB_H
2 #define __NVCTRLLIB_H
3
4 #include "NVCtrl.h"
5
6 /*
7  *  XNVCTRLQueryExtension -
8  *
9  *  Returns True if the extension exists, returns False otherwise.
10  *  event_basep and error_basep are the extension event and error
11  *  bases.  Currently, no extension specific errors or events are
12  *  defined.
13  */
14
15 Bool XNVCTRLQueryExtension (
16     Display *dpy,
17     int *event_basep,
18     int *error_basep
19 );
20
21 /*
22  *  XNVCTRLQueryVersion -
23  *
24  *  Returns True if the extension exists, returns False otherwise.
25  *  major and minor are the extension's major and minor version
26  *  numbers.
27  */
28
29 Bool XNVCTRLQueryVersion (
30     Display *dpy,
31     int *major,
32     int *minor
33 );
34
35
36 /*
37  *  XNVCTRLIsNvScreen
38  *
39  *  Returns True is the specified screen is controlled by the NVIDIA
40  *  driver.  Returns False otherwise.
41  */
42
43 Bool XNVCTRLIsNvScreen (
44     Display *dpy,
45     int screen
46 );
47
48 /*
49  *  XNVCTRLSetAttribute -
50  *
51  *  Sets the attribute to the given value.  The attributes and their
52  *  possible values are listed in NVCtrl.h.
53  *
54  *  Not all attributes require the display_mask parameter; see
55  *  NVCtrl.h for details.
56  *
57  *  Possible errors:
58  *     BadValue - The screen or attribute doesn't exist.
59  *     BadMatch - The NVIDIA driver is not present on that screen.
60  */
61
62 void XNVCTRLSetAttribute (
63     Display *dpy,
64     int screen,
65     unsigned int display_mask,
66     unsigned int attribute,
67     int value
68 );
69
70 /*
71  *  XNVCTRLQueryAttribute -
72  *
73  *  Returns True if the attribute exists.  Returns False otherwise.
74  *  If XNVCTRLQueryAttribute returns True, value will contain the
75  *  value of the specified attribute.
76  *
77  *  Not all attributes require the display_mask parameter; see
78  *  NVCtrl.h for details.
79  *
80  *  Possible errors:
81  *     BadValue - The screen doesn't exist.
82  *     BadMatch - The NVIDIA driver is not present on that screen.
83  */
84
85
86 Bool XNVCTRLQueryAttribute (
87     Display *dpy,
88     int screen,
89     unsigned int display_mask,
90     unsigned int attribute,
91     int *value
92 );
93
94 /*
95  *  XNVCTRLQueryStringAttribute -
96  *
97  *  Returns True if the attribute exists.  Returns False otherwise.
98  *  If XNVCTRLQueryStringAttribute returns True, *ptr will point to an
99  *  allocated string containing the string attribute requested.  It is
100  *  the caller's responsibility to free the string when done.
101  *
102  *  Possible errors:
103  *     BadValue - The screen doesn't exist.
104  *     BadMatch - The NVIDIA driver is not present on that screen.
105  *     BadAlloc - Insufficient resources to fulfill the request.
106  */
107
108 Bool XNVCTRLQueryStringAttribute (
109     Display *dpy,
110     int screen,
111     unsigned int display_mask,
112     unsigned int attribute,
113     char **ptr
114 );
115
116 /*
117  * XNVCTRLQueryValidAttributeValues -
118  *
119  * Returns True if the attribute exists.  Returns False otherwise.  If
120  * XNVCTRLQueryValidAttributeValues returns True, values will indicate
121  * the valid values for the specified attribute; see the description
122  * of NVCTRLAttributeValidValues in NVCtrl.h.
123  */
124
125 Bool XNVCTRLQueryValidAttributeValues (
126     Display *dpy,
127     int screen,
128     unsigned int display_mask,
129     unsigned int attribute,                                 
130     NVCTRLAttributeValidValuesRec *values
131 );
132
133 /*
134  * XNVCtrlSelectNotify -
135  *
136  * This enables/disables receiving of NV-CONTROL events.  The type
137  * specifies the type of event to enable (currently, the only type is
138  * ATTRIBUTE_CHANGED_EVENT); onoff controls whether receiving this
139  * type of event should be enabled (True) or disabled (False).
140  *
141  * Returns True if successful, or False if the screen is not
142  * controlled by the NVIDIA driver.
143  */
144
145 Bool XNVCtrlSelectNotify (
146     Display *dpy,
147     int screen,
148     int type,
149     Bool onoff
150 );
151
152
153
154 /*
155  * XNVCtrlEvent structure
156  */
157
158 typedef struct {
159     int type;
160     unsigned long serial;
161     Bool send_event;  /* always FALSE, we don't allow send_events */
162     Display *display;
163     Time time;
164     int screen;
165     unsigned int display_mask;
166     unsigned int attribute;
167     int value;
168 } XNVCtrlAttributeChangedEvent;
169
170 typedef union {
171     int type;
172     XNVCtrlAttributeChangedEvent attribute_changed;
173     long pad[24];
174 } XNVCtrlEvent;
175
176
177 #endif /* __NVCTRLLIB_H */