src/video/Xext/extensions/xf86vmode.h
author Sam Lantinga <slouken@libsdl.org>
Mon, 29 May 2006 04:04:35 +0000
branchSDL-1.3
changeset 1668 4da1ee79c9af
parent 1662 782fd950bd46
permissions -rw-r--r--
more tweaking indent options
     1 /* $XFree86: xc/include/extensions/xf86vmode.h,v 3.30 2001/05/07 20:09:50 mvojkovi Exp $ */
     2 /*
     3 
     4 Copyright 1995  Kaleb S. KEITHLEY
     5 
     6 Permission is hereby granted, free of charge, to any person obtaining
     7 a copy of this software and associated documentation files (the
     8 "Software"), to deal in the Software without restriction, including
     9 without limitation the rights to use, copy, modify, merge, publish,
    10 distribute, sublicense, and/or sell copies of the Software, and to
    11 permit persons to whom the Software is furnished to do so, subject to
    12 the following conditions:
    13 
    14 The above copyright notice and this permission notice shall be
    15 included in all copies or substantial portions of the Software.
    16 
    17 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
    18 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
    19 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
    20 IN NO EVENT SHALL Kaleb S. KEITHLEY BE LIABLE FOR ANY CLAIM, DAMAGES 
    21 OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
    22 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
    23 OTHER DEALINGS IN THE SOFTWARE.
    24 
    25 Except as contained in this notice, the name of Kaleb S. KEITHLEY 
    26 shall not be used in advertising or otherwise to promote the sale, use 
    27 or other dealings in this Software without prior written authorization
    28 from 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 
    89 typedef struct
    90 {
    91     unsigned short hdisplay;
    92     unsigned short hsyncstart;
    93     unsigned short hsyncend;
    94     unsigned short htotal;
    95     unsigned short hskew;
    96     unsigned short vdisplay;
    97     unsigned short vsyncstart;
    98     unsigned short vsyncend;
    99     unsigned short vtotal;
   100     unsigned int flags;
   101     int privsize;
   102 #if defined(__cplusplus) || defined(c_plusplus)
   103     /* private is a C++ reserved word */
   104     INT32 *c_private;
   105 #else
   106     INT32 *private;
   107 #endif
   108 } SDL_NAME(XF86VidModeModeLine);
   109 
   110 typedef struct
   111 {
   112     unsigned int dotclock;
   113     unsigned short hdisplay;
   114     unsigned short hsyncstart;
   115     unsigned short hsyncend;
   116     unsigned short htotal;
   117     unsigned short hskew;
   118     unsigned short vdisplay;
   119     unsigned short vsyncstart;
   120     unsigned short vsyncend;
   121     unsigned short vtotal;
   122     unsigned int flags;
   123     int privsize;
   124 #if defined(__cplusplus) || defined(c_plusplus)
   125     /* private is a C++ reserved word */
   126     INT32 *c_private;
   127 #else
   128     INT32 *private;
   129 #endif
   130 } SDL_NAME(XF86VidModeModeInfo);
   131 
   132 typedef struct
   133 {
   134     float hi;
   135     float lo;
   136 } SDL_NAME(XF86VidModeSyncRange);
   137 
   138 typedef struct
   139 {
   140     char *vendor;
   141     char *model;
   142     float EMPTY;
   143     unsigned char nhsync;
   144       SDL_NAME(XF86VidModeSyncRange) * hsync;
   145     unsigned char nvsync;
   146       SDL_NAME(XF86VidModeSyncRange) * vsync;
   147 } SDL_NAME(XF86VidModeMonitor);
   148 
   149 typedef struct
   150 {
   151     int type;                   /* of event */
   152     unsigned long serial;       /* # of last request processed by server */
   153     Bool send_event;            /* true if this came from a SendEvent req */
   154     Display *display;           /* Display the event was read from */
   155     Window root;                /* root window of event screen */
   156     int state;                  /* What happened */
   157     int kind;                   /* What happened */
   158     Bool forced;                /* extents of new region */
   159     Time time;                  /* event timestamp */
   160 } SDL_NAME(XF86VidModeNotifyEvent);
   161 
   162 typedef struct
   163 {
   164     float red;                  /* Red Gamma value */
   165     float green;                /* Green Gamma value */
   166     float blue;                 /* Blue Gamma value */
   167 } SDL_NAME(XF86VidModeGamma);
   168 
   169 
   170 #define SDL_XF86VidModeSelectNextMode(disp, scr) \
   171 	SDL_NAME(XF86VidModeSwitchMode)(disp, scr, 1)
   172 #define SDL_XF86VidModeSelectPrevMode(disp, scr) \
   173 	SDL_NAME(XF86VidModeSwitchMode)(disp, scr, -1)
   174 
   175 _XFUNCPROTOBEGIN Bool SDL_NAME(XF86VidModeQueryVersion) (Display * /* dpy */ ,
   176                                                          int *
   177                                                          /* majorVersion */ ,
   178                                                          int *  /* minorVersion */
   179     );
   180 
   181 Bool SDL_NAME(XF86VidModeQueryExtension) (Display * /* dpy */ ,
   182                                           int * /* event_base */ ,
   183                                           int * /* error_base */
   184     );
   185 
   186 Bool SDL_NAME(XF86VidModeSetClientVersion) (Display *   /* dpy */
   187     );
   188 
   189 Bool SDL_NAME(XF86VidModeGetModeLine) (Display * /* dpy */ ,
   190                                        int /* screen */ ,
   191                                        int * /* dotclock */ ,
   192                                        SDL_NAME(XF86VidModeModeLine) *  /* modeline */
   193     );
   194 
   195 Bool SDL_NAME(XF86VidModeGetAllModeLines) (Display * /* dpy */ ,
   196                                            int /* screen */ ,
   197                                            int * /* modecount */ ,
   198                                            SDL_NAME(XF86VidModeModeInfo) ***    /* modelinesPtr */
   199     );
   200 
   201 Bool SDL_NAME(XF86VidModeAddModeLine) (Display * /* dpy */ ,
   202                                        int /* screen */ ,
   203                                        SDL_NAME(XF86VidModeModeInfo) *
   204                                        /* new modeline */ ,
   205                                        SDL_NAME(XF86VidModeModeInfo) *  /* after modeline */
   206     );
   207 
   208 Bool SDL_NAME(XF86VidModeDeleteModeLine) (Display * /* dpy */ ,
   209                                           int /* screen */ ,
   210                                           SDL_NAME(XF86VidModeModeInfo) *       /* modeline */
   211     );
   212 
   213 Bool SDL_NAME(XF86VidModeModModeLine) (Display * /* dpy */ ,
   214                                        int /* screen */ ,
   215                                        SDL_NAME(XF86VidModeModeLine) *  /* modeline */
   216     );
   217 
   218 Status SDL_NAME(XF86VidModeValidateModeLine) (Display * /* dpy */ ,
   219                                               int /* screen */ ,
   220                                               SDL_NAME(XF86VidModeModeInfo) *   /* modeline */
   221     );
   222 
   223 Bool SDL_NAME(XF86VidModeSwitchMode) (Display * /* dpy */ ,
   224                                       int /* screen */ ,
   225                                       int       /* zoom */
   226     );
   227 
   228 Bool SDL_NAME(XF86VidModeSwitchToMode) (Display * /* dpy */ ,
   229                                         int /* screen */ ,
   230                                         SDL_NAME(XF86VidModeModeInfo) * /* modeline */
   231     );
   232 
   233 Bool SDL_NAME(XF86VidModeLockModeSwitch) (Display * /* dpy */ ,
   234                                           int /* screen */ ,
   235                                           int   /* lock */
   236     );
   237 
   238 Bool SDL_NAME(XF86VidModeGetMonitor) (Display * /* dpy */ ,
   239                                       int /* screen */ ,
   240                                       SDL_NAME(XF86VidModeMonitor) *    /* monitor */
   241     );
   242 
   243 Bool SDL_NAME(XF86VidModeGetViewPort) (Display * /* dpy */ ,
   244                                        int /* screen */ ,
   245                                        int * /* x return */ ,
   246                                        int *    /* y return */
   247     );
   248 
   249 Bool SDL_NAME(XF86VidModeSetViewPort) (Display * /* dpy */ ,
   250                                        int /* screen */ ,
   251                                        int /* x */ ,
   252                                        int      /* y */
   253     );
   254 
   255 Bool SDL_NAME(XF86VidModeGetDotClocks) (Display * /* dpy */ ,
   256                                         int /* screen */ ,
   257                                         int * /* flags return */ ,
   258                                         int * /* number of clocks return */ ,
   259                                         int * /* max dot clock return */ ,
   260                                         int **  /* clocks return */
   261     );
   262 
   263 Bool SDL_NAME(XF86VidModeGetGamma) (Display * /* dpy */ ,
   264                                     int /* screen */ ,
   265                                     SDL_NAME(XF86VidModeGamma) *        /* Gamma */
   266     );
   267 
   268 Bool SDL_NAME(XF86VidModeSetGamma) (Display * /* dpy */ ,
   269                                     int /* screen */ ,
   270                                     SDL_NAME(XF86VidModeGamma) *        /* Gamma */
   271     );
   272 
   273 Bool SDL_NAME(XF86VidModeSetGammaRamp) (Display * /* dpy */ ,
   274                                         int /* screen */ ,
   275                                         int /* size */ ,
   276                                         unsigned short * /* red array */ ,
   277                                         unsigned short * /* green array */ ,
   278                                         unsigned short *        /* blue array */
   279     );
   280 
   281 Bool SDL_NAME(XF86VidModeGetGammaRamp) (Display * /* dpy */ ,
   282                                         int /* screen */ ,
   283                                         int /* size */ ,
   284                                         unsigned short * /* red array */ ,
   285                                         unsigned short * /* green array */ ,
   286                                         unsigned short *        /* blue array */
   287     );
   288 
   289 Bool SDL_NAME(XF86VidModeGetGammaRampSize) (Display * /* dpy */ ,
   290                                             int /* screen */ ,
   291                                             int *       /* size */
   292     );
   293 
   294 
   295 _XFUNCPROTOEND
   296 #endif
   297 #endif
   298 /* vi: set ts=4 sw=4 expandtab: */