src/video/Xext/extensions/xf86dga.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 /*
     2    Copyright (c) 1999  XFree86 Inc
     3 */
     4 /* $XFree86: xc/include/extensions/xf86dga.h,v 3.21 2001/08/01 00:44:36 tsi Exp $ */
     5 
     6 #ifndef _XF86DGA_H_
     7 #define _XF86DGA_H_
     8 
     9 #include <X11/Xfuncproto.h>
    10 #include "xf86dga1.h"
    11 #include "SDL_name.h"
    12 
    13 #define X_XDGAQueryVersion		0
    14 
    15 /* 1 through 9 are in xf86dga1.h */
    16 
    17 /* 10 and 11 are reserved to avoid conflicts with rogue DGA extensions */
    18 
    19 #define X_XDGAQueryModes		12
    20 #define X_XDGASetMode			13
    21 #define X_XDGASetViewport		14
    22 #define X_XDGAInstallColormap		15
    23 #define X_XDGASelectInput		16
    24 #define X_XDGAFillRectangle		17
    25 #define X_XDGACopyArea			18
    26 #define X_XDGACopyTransparentArea	19
    27 #define X_XDGAGetViewportStatus		20
    28 #define X_XDGASync			21
    29 #define X_XDGAOpenFramebuffer		22
    30 #define X_XDGACloseFramebuffer		23
    31 #define X_XDGASetClientVersion		24
    32 #define X_XDGAChangePixmapMode		25
    33 #define X_XDGACreateColormap		26
    34 
    35 
    36 #define XDGAConcurrentAccess	0x00000001
    37 #define XDGASolidFillRect	0x00000002
    38 #define XDGABlitRect		0x00000004
    39 #define XDGABlitTransRect	0x00000008
    40 #define XDGAPixmap    		0x00000010
    41 
    42 #define XDGAInterlaced          0x00010000
    43 #define XDGADoublescan          0x00020000
    44 
    45 #define XDGAFlipImmediate	0x00000001
    46 #define XDGAFlipRetrace		0x00000002
    47 
    48 #define XDGANeedRoot		0x00000001
    49 
    50 #define XF86DGANumberEvents		7
    51 
    52 #define XDGAPixmapModeLarge		0
    53 #define XDGAPixmapModeSmall		1
    54 
    55 #define XF86DGAClientNotLocal		0
    56 #define XF86DGANoDirectVideoMode	1
    57 #define XF86DGAScreenNotActive		2
    58 #define XF86DGADirectNotActivated	3
    59 #define XF86DGAOperationNotSupported	4
    60 #define XF86DGANumberErrors		(XF86DGAOperationNotSupported + 1)
    61 
    62 
    63 typedef struct
    64 {
    65     int num;                    /* A unique identifier for the mode (num > 0) */
    66     char *name;                 /* name of mode given in the XF86Config */
    67     float verticalRefresh;
    68     int flags;                  /* DGA_CONCURRENT_ACCESS, etc... */
    69     int imageWidth;             /* linear accessible portion (pixels) */
    70     int imageHeight;
    71     int pixmapWidth;            /* Xlib accessible portion (pixels) */
    72     int pixmapHeight;           /* both fields ignored if no concurrent access */
    73     int bytesPerScanline;
    74     int byteOrder;              /* MSBFirst, LSBFirst */
    75     int depth;
    76     int bitsPerPixel;
    77     unsigned long redMask;
    78     unsigned long greenMask;
    79     unsigned long blueMask;
    80     short visualClass;
    81     int viewportWidth;
    82     int viewportHeight;
    83     int xViewportStep;          /* viewport position granularity */
    84     int yViewportStep;
    85     int maxViewportX;           /* max viewport origin */
    86     int maxViewportY;
    87     int viewportFlags;          /* types of page flipping possible */
    88     int reserved1;
    89     int reserved2;
    90 } SDL_NAME(XDGAMode);
    91 
    92 
    93 typedef struct
    94 {
    95     SDL_NAME(XDGAMode) mode;
    96     unsigned char *data;
    97     Pixmap pixmap;
    98 } SDL_NAME(XDGADevice);
    99 
   100 
   101 #ifndef _XF86DGA_SERVER_
   102 _XFUNCPROTOBEGIN typedef struct
   103 {
   104     int type;
   105     unsigned long serial;
   106     Display *display;
   107     int screen;
   108     Time time;
   109     unsigned int state;
   110     unsigned int button;
   111 } SDL_NAME(XDGAButtonEvent);
   112 
   113 typedef struct
   114 {
   115     int type;
   116     unsigned long serial;
   117     Display *display;
   118     int screen;
   119     Time time;
   120     unsigned int state;
   121     unsigned int keycode;
   122 } SDL_NAME(XDGAKeyEvent);
   123 
   124 typedef struct
   125 {
   126     int type;
   127     unsigned long serial;
   128     Display *display;
   129     int screen;
   130     Time time;
   131     unsigned int state;
   132     int dx;
   133     int dy;
   134 } SDL_NAME(XDGAMotionEvent);
   135 
   136 typedef union
   137 {
   138     int type;
   139       SDL_NAME(XDGAButtonEvent) xbutton;
   140       SDL_NAME(XDGAKeyEvent) xkey;
   141       SDL_NAME(XDGAMotionEvent) xmotion;
   142     long pad[24];
   143 } SDL_NAME(XDGAEvent);
   144 
   145 Bool SDL_NAME(XDGAQueryExtension) (Display * dpy,
   146                                    int *eventBase, int *erroBase);
   147 
   148 Bool SDL_NAME(XDGAQueryVersion) (Display * dpy,
   149                                  int *majorVersion, int *minorVersion);
   150 
   151 SDL_NAME(XDGAMode) * SDL_NAME(XDGAQueryModes) (Display * dpy,
   152                                                int screen, int *num);
   153 
   154 SDL_NAME(XDGADevice) * SDL_NAME(XDGASetMode) (Display * dpy,
   155                                               int screen, int mode);
   156 
   157 Bool
   158 SDL_NAME(XDGAOpenFramebuffer) (Display * dpy, int screen);
   159 
   160      void SDL_NAME(XDGACloseFramebuffer) (Display * dpy, int screen);
   161 
   162      void SDL_NAME(XDGASetViewport) (Display * dpy,
   163                                      int screen, int x, int y, int flags);
   164 
   165      void SDL_NAME(XDGAInstallColormap) (Display * dpy,
   166                                          int screen, Colormap cmap);
   167 
   168 Colormap
   169 SDL_NAME(XDGACreateColormap) (Display * dpy,
   170                               int screen,
   171                               SDL_NAME(XDGADevice) * device, int alloc);
   172 
   173      void SDL_NAME(XDGASelectInput) (Display * dpy, int screen,
   174                                      long event_mask);
   175 
   176      void SDL_NAME(XDGAFillRectangle) (Display * dpy,
   177                                        int screen,
   178                                        int x,
   179                                        int y,
   180                                        unsigned int width,
   181                                        unsigned int height,
   182                                        unsigned long color);
   183 
   184 
   185      void SDL_NAME(XDGACopyArea) (Display * dpy,
   186                                   int screen,
   187                                   int srcx,
   188                                   int srcy,
   189                                   unsigned int width,
   190                                   unsigned int height, int dstx, int dsty);
   191 
   192 
   193      void SDL_NAME(XDGACopyTransparentArea) (Display * dpy,
   194                                              int screen,
   195                                              int srcx,
   196                                              int srcy,
   197                                              unsigned int width,
   198                                              unsigned int height,
   199                                              int dstx,
   200                                              int dsty, unsigned long key);
   201 
   202      int SDL_NAME(XDGAGetViewportStatus) (Display * dpy, int screen);
   203 
   204      void SDL_NAME(XDGASync) (Display * dpy, int screen);
   205 
   206 Bool
   207 SDL_NAME(XDGASetClientVersion) (Display * dpy);
   208 
   209      void SDL_NAME(XDGAChangePixmapMode) (Display * dpy,
   210                                           int screen, int *x, int *y,
   211                                           int mode);
   212 
   213 
   214      void SDL_NAME(XDGAKeyEventToXKeyEvent) (SDL_NAME(XDGAKeyEvent) * dk,
   215                                              XKeyEvent * xk);
   216 
   217 
   218 _XFUNCPROTOEND
   219 #endif /* _XF86DGA_SERVER_ */
   220 #endif /* _XF86DGA_H_ */
   221 /* vi: set ts=4 sw=4 expandtab: */