1/* $XFree86: xc/include/extensions/xf86vmode.h,v 3.30 2001/05/07 20:09:50 mvojkovi Exp $ */ 2/* 3 4Copyright 1995 Kaleb S. KEITHLEY 5 6Permission is hereby granted, free of charge, to any person obtaining 7a copy of this software and associated documentation files (the 8"Software"), to deal in the Software without restriction, including 9without limitation the rights to use, copy, modify, merge, publish, 10distribute, sublicense, and/or sell copies of the Software, and to 11permit persons to whom the Software is furnished to do so, subject to 12the following conditions: 13 14The above copyright notice and this permission notice shall be 15included in all copies or substantial portions of the Software. 16 17THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 20IN NO EVENT SHALL Kaleb S. KEITHLEY BE LIABLE FOR ANY CLAIM, DAMAGES 21OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 22ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23OTHER DEALINGS IN THE SOFTWARE. 24 25Except as contained in this notice, the name of Kaleb S. KEITHLEY 26shall not be used in advertising or otherwise to promote the sale, use 27or other dealings in this Software without prior written authorization 28from Kaleb S. KEITHLEY 29 30*/ 31/* $Xorg: xf86vmode.h,v 1.3 2000/08/18 04:05:46 coskrey Exp $ */ 32 33/* THIS IS NOT AN X CONSORTIUM STANDARD OR AN X PROJECT TEAM SPECIFICATION */ 34 35#ifndef _XF86VIDMODE_H_ 36#define _XF86VIDMODE_H_ 37 38#include <X11/Xfuncproto.h> 39#include <X11/Xmd.h> 40#include "SDL_name.h" 41 42#define X_XF86VidModeQueryVersion 0 43#define X_XF86VidModeGetModeLine 1 44#define X_XF86VidModeModModeLine 2 45#define X_XF86VidModeSwitchMode 3 46#define X_XF86VidModeGetMonitor 4 47#define X_XF86VidModeLockModeSwitch 5 48#define X_XF86VidModeGetAllModeLines 6 49#define X_XF86VidModeAddModeLine 7 50#define X_XF86VidModeDeleteModeLine 8 51#define X_XF86VidModeValidateModeLine 9 52#define X_XF86VidModeSwitchToMode 10 53#define X_XF86VidModeGetViewPort 11 54#define X_XF86VidModeSetViewPort 12 55/* new for version 2.x of this extension */ 56#define X_XF86VidModeGetDotClocks 13 57#define X_XF86VidModeSetClientVersion 14 58#define X_XF86VidModeSetGamma 15 59#define X_XF86VidModeGetGamma 16 60#define X_XF86VidModeGetGammaRamp 17 61#define X_XF86VidModeSetGammaRamp 18 62#define X_XF86VidModeGetGammaRampSize 19 63 64#define CLKFLAG_PROGRAMABLE 1 65 66#ifdef XF86VIDMODE_EVENTS 67#define XF86VidModeNotify 0 68#define XF86VidModeNumberEvents (XF86VidModeNotify + 1) 69 70#define XF86VidModeNotifyMask 0x00000001 71 72#define XF86VidModeNonEvent 0 73#define XF86VidModeModeChange 1 74#else 75#define XF86VidModeNumberEvents 0 76#endif 77 78#define XF86VidModeBadClock 0 79#define XF86VidModeBadHTimings 1 80#define XF86VidModeBadVTimings 2 81#define XF86VidModeModeUnsuitable 3 82#define XF86VidModeExtensionDisabled 4 83#define XF86VidModeClientNotLocal 5 84#define XF86VidModeZoomLocked 6 85#define XF86VidModeNumberErrors (XF86VidModeZoomLocked + 1) 86 87#ifndef _XF86VIDMODE_SERVER_ 88 89typedef struct { 90 unsigned short hdisplay; 91 unsigned short hsyncstart; 92 unsigned short hsyncend; 93 unsigned short htotal; 94 unsigned short hskew; 95 unsigned short vdisplay; 96 unsigned short vsyncstart; 97 unsigned short vsyncend; 98 unsigned short vtotal; 99 unsigned int flags; 100 int privsize; 101#if defined(__cplusplus) || defined(c_plusplus) 102 /* private is a C++ reserved word */ 103 INT32 *c_private; 104#else 105 INT32 *private; 106#endif 107} SDL_NAME(XF86VidModeModeLine); 108 109typedef struct { 110 unsigned int dotclock; 111 unsigned short hdisplay; 112 unsigned short hsyncstart; 113 unsigned short hsyncend; 114 unsigned short htotal; 115 unsigned short hskew; 116 unsigned short vdisplay; 117 unsigned short vsyncstart; 118 unsigned short vsyncend; 119 unsigned short vtotal; 120 unsigned int flags; 121 int privsize; 122#if defined(__cplusplus) || defined(c_plusplus) 123 /* private is a C++ reserved word */ 124 INT32 *c_private; 125#else 126 INT32 *private; 127#endif 128} SDL_NAME(XF86VidModeModeInfo); 129 130typedef struct { 131 float hi; 132 float lo; 133} SDL_NAME(XF86VidModeSyncRange); 134 135typedef struct { 136 char* vendor; 137 char* model; 138 float EMPTY; 139 unsigned char nhsync; 140 SDL_NAME(XF86VidModeSyncRange)* hsync; 141 unsigned char nvsync; 142 SDL_NAME(XF86VidModeSyncRange)* vsync; 143} SDL_NAME(XF86VidModeMonitor); 144 145typedef struct { 146 int type; /* of event */ 147 unsigned long serial; /* # of last request processed by server */ 148 Bool send_event; /* true if this came from a SendEvent req */ 149 Display *display; /* Display the event was read from */ 150 Window root; /* root window of event screen */ 151 int state; /* What happened */ 152 int kind; /* What happened */ 153 Bool forced; /* extents of new region */ 154 Time time; /* event timestamp */ 155} SDL_NAME(XF86VidModeNotifyEvent); 156 157typedef struct { 158 float red; /* Red Gamma value */ 159 float green; /* Green Gamma value */ 160 float blue; /* Blue Gamma value */ 161} SDL_NAME(XF86VidModeGamma); 162 163 164#define SDL_XF86VidModeSelectNextMode(disp, scr) \ 165 SDL_NAME(XF86VidModeSwitchMode)(disp, scr, 1) 166#define SDL_XF86VidModeSelectPrevMode(disp, scr) \ 167 SDL_NAME(XF86VidModeSwitchMode)(disp, scr, -1) 168 169_XFUNCPROTOBEGIN 170 171Bool SDL_NAME(XF86VidModeQueryVersion)( 172 Display* /* dpy */, 173 int* /* majorVersion */, 174 int* /* minorVersion */ 175); 176 177Bool SDL_NAME(XF86VidModeQueryExtension)( 178 Display* /* dpy */, 179 int* /* event_base */, 180 int* /* error_base */ 181); 182 183Bool SDL_NAME(XF86VidModeSetClientVersion)( 184 Display* /* dpy */ 185); 186 187Bool SDL_NAME(XF86VidModeGetModeLine)( 188 Display* /* dpy */, 189 int /* screen */, 190 int* /* dotclock */, 191 SDL_NAME(XF86VidModeModeLine)* /* modeline */ 192); 193 194Bool SDL_NAME(XF86VidModeGetAllModeLines)( 195 Display* /* dpy */, 196 int /* screen */, 197 int* /* modecount */, 198 SDL_NAME(XF86VidModeModeInfo)*** /* modelinesPtr */ 199); 200 201Bool SDL_NAME(XF86VidModeAddModeLine)( 202 Display* /* dpy */, 203 int /* screen */, 204 SDL_NAME(XF86VidModeModeInfo)* /* new modeline */, 205 SDL_NAME(XF86VidModeModeInfo)* /* after modeline */ 206); 207 208Bool SDL_NAME(XF86VidModeDeleteModeLine)( 209 Display* /* dpy */, 210 int /* screen */, 211 SDL_NAME(XF86VidModeModeInfo)* /* modeline */ 212); 213 214Bool SDL_NAME(XF86VidModeModModeLine)( 215 Display* /* dpy */, 216 int /* screen */, 217 SDL_NAME(XF86VidModeModeLine)* /* modeline */ 218); 219 220Status SDL_NAME(XF86VidModeValidateModeLine)( 221 Display* /* dpy */, 222 int /* screen */, 223 SDL_NAME(XF86VidModeModeInfo)* /* modeline */ 224); 225 226Bool SDL_NAME(XF86VidModeSwitchMode)( 227 Display* /* dpy */, 228 int /* screen */, 229 int /* zoom */ 230); 231 232Bool SDL_NAME(XF86VidModeSwitchToMode)( 233 Display* /* dpy */, 234 int /* screen */, 235 SDL_NAME(XF86VidModeModeInfo)* /* modeline */ 236); 237 238Bool SDL_NAME(XF86VidModeLockModeSwitch)( 239 Display* /* dpy */, 240 int /* screen */, 241 int /* lock */ 242); 243 244Bool SDL_NAME(XF86VidModeGetMonitor)( 245 Display* /* dpy */, 246 int /* screen */, 247 SDL_NAME(XF86VidModeMonitor)* /* monitor */ 248); 249 250Bool SDL_NAME(XF86VidModeGetViewPort)( 251 Display* /* dpy */, 252 int /* screen */, 253 int* /* x return */, 254 int* /* y return */ 255); 256 257Bool SDL_NAME(XF86VidModeSetViewPort)( 258 Display* /* dpy */, 259 int /* screen */, 260 int /* x */, 261 int /* y */ 262); 263 264Bool SDL_NAME(XF86VidModeGetDotClocks)( 265 Display* /* dpy */, 266 int /* screen */, 267 int* /* flags return */, 268 int* /* number of clocks return */, 269 int* /* max dot clock return */, 270 int** /* clocks return */ 271); 272 273Bool SDL_NAME(XF86VidModeGetGamma)( 274 Display* /* dpy */, 275 int /* screen */, 276 SDL_NAME(XF86VidModeGamma)* /* Gamma */ 277); 278 279Bool SDL_NAME(XF86VidModeSetGamma)( 280 Display* /* dpy */, 281 int /* screen */, 282 SDL_NAME(XF86VidModeGamma)* /* Gamma */ 283); 284 285Bool SDL_NAME(XF86VidModeSetGammaRamp)( 286 Display* /* dpy */, 287 int /* screen */, 288 int /* size */, 289 unsigned short* /* red array */, 290 unsigned short* /* green array */, 291 unsigned short* /* blue array */ 292); 293 294Bool SDL_NAME(XF86VidModeGetGammaRamp)( 295 Display* /* dpy */, 296 int /* screen */, 297 int /* size */, 298 unsigned short* /* red array */, 299 unsigned short* /* green array */, 300 unsigned short* /* blue array */ 301); 302 303Bool SDL_NAME(XF86VidModeGetGammaRampSize)( 304 Display* /* dpy */, 305 int /* screen */, 306 int* /* size */ 307); 308 309 310_XFUNCPROTOEND 311 312#endif 313 314#endif 315