summaryrefslogtreecommitdiff
path: root/packages/x11/src/xf86dga.pp
blob: 3510f31d12ad99af70d1da53d101687b0cad015a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
{
   Copyright (c) 1999  XFree86 Inc
}
{ $XFree86: xc/include/extensions/xf86dga.h,v 3.20 1999/10/13 04:20:48 dawes Exp $ }

Unit xf86dga;

{$PACKRECORDS C}

Interface

Uses
  ctypes, x, xlib;

Const
  libXxf86dga='Xxf86dga';

Type
  cfloat = Single;

{$linklib Xext}

{$INCLUDE xf86dga1.inc}

Const
  X_XDGAQueryVersion           = 0;

{ 1 through 9 are in xf86dga1.pp }

{ 10 and 11 are reserved to avoid conflicts with rogue DGA extensions }

  X_XDGAQueryModes            = 12;
  X_XDGASetMode               = 13;
  X_XDGASetViewport           = 14;
  X_XDGAInstallColormap       = 15;
  X_XDGASelectInput           = 16;
  X_XDGAFillRectangle         = 17;
  X_XDGACopyArea              = 18;
  X_XDGACopyTransparentArea   = 19;
  X_XDGAGetViewportStatus     = 20;
  X_XDGASync                  = 21;
  X_XDGAOpenFramebuffer       = 22;
  X_XDGACloseFramebuffer      = 23;
  X_XDGASetClientVersion      = 24;
  X_XDGAChangePixmapMode      = 25;
  X_XDGACreateColormap        = 26;


  XDGAConcurrentAccess = $00000001;
  XDGASolidFillRect    = $00000002;
  XDGABlitRect         = $00000004;
  XDGABlitTransRect    = $00000008;
  XDGAPixmap           = $00000010;

  XDGAInterlaced       = $00010000;
  XDGADoublescan       = $00020000;

  XDGAFlipImmediate    = $00000001;
  XDGAFlipRetrace      = $00000002;

  XDGANeedRoot         = $00000001;

  XF86DGANumberEvents          = 7;

  XDGAPixmapModeLarge          = 0;
  XDGAPixmapModeSmall          = 1;

  XF86DGAClientNotLocal        = 0;
  XF86DGANoDirectVideoMode     = 1;
  XF86DGAScreenNotActive       = 2;
  XF86DGADirectNotActivated    = 3;
  XF86DGAOperationNotSupported = 4;
  XF86DGANumberErrors          = (XF86DGAOperationNotSupported + 1);

Type
  PXDGAMode = ^TXDGAMode;
  TXDGAMode = Record
    num : cint;                 { A unique identifier for the mode (num > 0) }
    name : PChar;               { name of mode given in the XF86Config }
    verticalRefresh : cfloat;
    flags : cint;               { DGA_CONCURRENT_ACCESS, etc... }
    imageWidth : cint;          { linear accessible portion (pixels) }
    imageHeight : cint;
    pixmapWidth : cint;         { Xlib accessible portion (pixels) }
    pixmapHeight : cint;        { both fields ignored if no concurrent access }
    bytesPerScanline : cint;
    byteOrder : cint;           { MSBFirst, LSBFirst }
    depth : cint;
    bitsPerPixel : cint;
    redMask : culong;
    greenMask : culong;
    blueMask : culong;
    visualClass : cshort;
    viewportWidth : cint;
    viewportHeight : cint;
    xViewportStep : cint;       { viewport position granularity }
    yViewportStep : cint;
    maxViewportX : cint;        { max viewport origin }
    maxViewportY : cint;
    viewportFlags : cint;       { types of page flipping possible }
    reserved1 : cint;
    reserved2 : cint;
  End;

  PXDGADevice = ^TXDGADevice;
  TXDGADevice = Record
    mode : TXDGAMode;
    data : Pcuchar;
    pixmap : TPixmap;
  End;

  PXDGAButtonEvent = ^TXDGAButtonEvent;
  TXDGAButtonEvent = Record
    _type : cint;
    serial : culong;
    display : PDisplay;
    screen : cint;
    time : TTime;
    state : cuint;
    button : cuint;
  End;

  PXDGAKeyEvent = ^TXDGAKeyEvent;
  TXDGAKeyEvent = Record
    _type : cint;
    serial : culong;
    display : PDisplay;
    screen : cint;
    time : TTime;
    state : cuint;
    keycode : cuint;
  End;

  PXDGAMotionEvent = ^TXDGAMotionEvent;
  TXDGAMotionEvent = Record
    _type : cint;
    serial : culong;
    display : PDisplay;
    screen : cint;
    time : TTime;
    state : cuint;
    dx : cint;
    dy : cint;
  End;

  PXDGAEvent = ^TXDGAEvent;
  TXDGAEvent = Record
    Case LongInt Of
      0 : (_type : cint);
      1 : (xbutton : TXDGAButtonEvent);
      2 : (xkey : TXDGAKeyEvent);
      3 : (xmotion : TXDGAMotionEvent);
      4 : (pad : Array[0..23] Of clong);
  End;

Function XDGAQueryExtension(
    dpy : PDisplay;
    eventBase : Pcint;
    erroBase : Pcint
  ) : TBool; CDecl; External libXxf86dga;

Function XDGAQueryVersion(
    dpy : PDisplay;
    majorVersion : Pcint;
    minorVersion : Pcint
  ) : TBool; CDecl; External libXxf86dga;

Function XDGAQueryModes(
    dpy : PDisplay;
    screen : cint;
    num : Pcint
  ) : PXDGAMode; CDecl; External libXxf86dga;

Function XDGASetMode(
    dpy : PDisplay;
    screen : cint;
    mode : cint
  ) : PXDGADevice; CDecl; External libXxf86dga;

Function XDGAOpenFramebuffer(
    dpy : PDisplay;
    screen : cint
  ) : TBool; CDecl; External libXxf86dga;

Procedure XDGACloseFramebuffer(
    dpy : PDisplay;
    screen : cint
  ); CDecl; External libXxf86dga;

Procedure XDGASetViewport(
    dpy : PDisplay;
    screen : cint;
    x : cint;
    y : cint;
    flags : cint
  ); CDecl; External libXxf86dga;

Procedure XDGAInstallColormap(
    dpy : PDisplay;
    screen : cint;
    cmap : TColormap
  ); CDecl; External libXxf86dga;

Function XDGACreateColormap(
    dpy : PDisplay;
    screen : cint;
    device : PXDGADevice;
    alloc : cint
  ) : TColormap; CDecl; External libXxf86dga;

Procedure XDGASelectInput(
    dpy : PDisplay;
    screen : cint;
    event_mask : clong
  ); CDecl; External libXxf86dga;

Procedure XDGAFillRectangle(
    dpy : PDisplay;
    screen : cint;
    x : cint;
    y : cint;
    width : cuint;
    height : cuint;
    color : culong
  ); CDecl; External libXxf86dga;

Procedure XDGACopyArea(
    dpy : PDisplay;
    screen : cint;
    srcx : cint;
    srcy : cint;
    width : cuint;
    height : cuint;
    dstx : cint;
    dsty : cint
  ); CDecl; External libXxf86dga;

Procedure XDGACopyTransparentArea(
    dpy : PDisplay;
    screen : cint;
    srcx : cint;
    srcy : cint;
    width : cuint;
    height : cuint;
    dstx : cint;
    dsty : cint;
    key : culong
  ); CDecl; External libXxf86dga;

Function XDGAGetViewportStatus(
    dpy : PDisplay;
    screen : cint
  ) : cint; CDecl; External libXxf86dga;

Procedure XDGASync(
    dpy : PDisplay;
    screen : cint
  ); CDecl; External libXxf86dga;

Function XDGASetClientVersion(
    dpy : PDisplay
  ) : TBool; CDecl; External libXxf86dga;

Procedure XDGAChangePixmapMode(
    dpy : PDisplay;
    screen : cint;
    x : Pcint;
    y : Pcint;
    mode : cint
  ); CDecl; External libXxf86dga;

Procedure XDGAKeyEventToXKeyEvent(
    dk : PXDGAKeyEvent;
    xk : PXKeyEvent
  ); CDecl; External libXxf86dga;

Implementation

End.