Mercurial > games > semicongine
comparison semiconginev2/old/thirdparty/x11/xf86dga.nim @ 1218:56781cc0fc7c compiletime-tests
did: renamge main package
| author | sam <sam@basx.dev> |
|---|---|
| date | Wed, 17 Jul 2024 21:01:37 +0700 |
| parents | semicongine/old/thirdparty/x11/xf86dga.nim@239adab121a3 |
| children |
comparison
equal
deleted
inserted
replaced
| 1217:f819a874058f | 1218:56781cc0fc7c |
|---|---|
| 1 # | |
| 2 # Copyright (c) 1999 XFree86 Inc | |
| 3 # | |
| 4 # $XFree86: xc/include/extensions/xf86dga.h,v 3.20 1999/10/13 04:20:48 dawes Exp $ | |
| 5 | |
| 6 import | |
| 7 x, xlib | |
| 8 | |
| 9 const | |
| 10 libXxf86dga* = "libXxf86dga.so" | |
| 11 | |
| 12 #type | |
| 13 # cfloat* = float32 | |
| 14 | |
| 15 # $XFree86: xc/include/extensions/xf86dga1.h,v 1.2 1999/04/17 07:05:41 dawes Exp $ | |
| 16 # | |
| 17 # | |
| 18 #Copyright (c) 1995 Jon Tombs | |
| 19 #Copyright (c) 1995 XFree86 Inc | |
| 20 # | |
| 21 # | |
| 22 #************************************************************************ | |
| 23 # | |
| 24 # THIS IS THE OLD DGA API AND IS OBSOLETE. PLEASE DO NOT USE IT ANYMORE | |
| 25 # | |
| 26 #************************************************************************ | |
| 27 | |
| 28 type | |
| 29 PPcchar* = ptr ptr cstring | |
| 30 | |
| 31 const | |
| 32 X_XF86DGAQueryVersion* = 0 | |
| 33 X_XF86DGAGetVideoLL* = 1 | |
| 34 X_XF86DGADirectVideo* = 2 | |
| 35 X_XF86DGAGetViewPortSize* = 3 | |
| 36 X_XF86DGASetViewPort* = 4 | |
| 37 X_XF86DGAGetVidPage* = 5 | |
| 38 X_XF86DGASetVidPage* = 6 | |
| 39 X_XF86DGAInstallColormap* = 7 | |
| 40 X_XF86DGAQueryDirectVideo* = 8 | |
| 41 X_XF86DGAViewPortChanged* = 9 | |
| 42 XF86DGADirectPresent* = 0x00000001 | |
| 43 XF86DGADirectGraphics* = 0x00000002 | |
| 44 XF86DGADirectMouse* = 0x00000004 | |
| 45 XF86DGADirectKeyb* = 0x00000008 | |
| 46 XF86DGAHasColormap* = 0x00000100 | |
| 47 XF86DGADirectColormap* = 0x00000200 | |
| 48 | |
| 49 proc XF86DGAQueryVersion*(dpy: PDisplay, majorVersion: Pcint, | |
| 50 minorVersion: Pcint): XBool{.cdecl, | |
| 51 dynlib: libXxf86dga, importc.} | |
| 52 proc XF86DGAQueryExtension*(dpy: PDisplay, event_base: Pcint, error_base: Pcint): XBool{. | |
| 53 cdecl, dynlib: libXxf86dga, importc.} | |
| 54 proc XF86DGAGetVideoLL*(dpy: PDisplay, screen: cint, base_addr: Pcint, | |
| 55 width: Pcint, bank_size: Pcint, ram_size: Pcint): Status{. | |
| 56 cdecl, dynlib: libXxf86dga, importc.} | |
| 57 proc XF86DGAGetVideo*(dpy: PDisplay, screen: cint, base_addr: PPcchar, | |
| 58 width: Pcint, bank_size: Pcint, ram_size: Pcint): Status{. | |
| 59 cdecl, dynlib: libXxf86dga, importc.} | |
| 60 proc XF86DGADirectVideo*(dpy: PDisplay, screen: cint, enable: cint): Status{. | |
| 61 cdecl, dynlib: libXxf86dga, importc.} | |
| 62 proc XF86DGADirectVideoLL*(dpy: PDisplay, screen: cint, enable: cint): Status{. | |
| 63 cdecl, dynlib: libXxf86dga, importc.} | |
| 64 proc XF86DGAGetViewPortSize*(dpy: PDisplay, screen: cint, width: Pcint, | |
| 65 height: Pcint): Status{.cdecl, | |
| 66 dynlib: libXxf86dga, importc.} | |
| 67 proc XF86DGASetViewPort*(dpy: PDisplay, screen: cint, x: cint, y: cint): Status{. | |
| 68 cdecl, dynlib: libXxf86dga, importc.} | |
| 69 proc XF86DGAGetVidPage*(dpy: PDisplay, screen: cint, vid_page: Pcint): Status{. | |
| 70 cdecl, dynlib: libXxf86dga, importc.} | |
| 71 proc XF86DGASetVidPage*(dpy: PDisplay, screen: cint, vid_page: cint): Status{. | |
| 72 cdecl, dynlib: libXxf86dga, importc.} | |
| 73 proc XF86DGAInstallColormap*(dpy: PDisplay, screen: cint, Colormap: Colormap): Status{. | |
| 74 cdecl, dynlib: libXxf86dga, importc.} | |
| 75 proc XF86DGAForkApp*(screen: cint): cint{.cdecl, dynlib: libXxf86dga, importc.} | |
| 76 proc XF86DGAQueryDirectVideo*(dpy: PDisplay, screen: cint, flags: Pcint): Status{. | |
| 77 cdecl, dynlib: libXxf86dga, importc.} | |
| 78 proc XF86DGAViewPortChanged*(dpy: PDisplay, screen: cint, n: cint): XBool{. | |
| 79 cdecl, dynlib: libXxf86dga, importc.} | |
| 80 const | |
| 81 X_XDGAQueryVersion* = 0 # 1 through 9 are in xf86dga1.pp | |
| 82 # 10 and 11 are reserved to avoid conflicts with rogue DGA extensions | |
| 83 X_XDGAQueryModes* = 12 | |
| 84 X_XDGASetMode* = 13 | |
| 85 X_XDGASetViewport* = 14 | |
| 86 X_XDGAInstallColormap* = 15 | |
| 87 X_XDGASelectInput* = 16 | |
| 88 X_XDGAFillRectangle* = 17 | |
| 89 X_XDGACopyArea* = 18 | |
| 90 X_XDGACopyTransparentArea* = 19 | |
| 91 X_XDGAGetViewportStatus* = 20 | |
| 92 X_XDGASync* = 21 | |
| 93 X_XDGAOpenFramebuffer* = 22 | |
| 94 X_XDGACloseFramebuffer* = 23 | |
| 95 X_XDGASetClientVersion* = 24 | |
| 96 X_XDGAChangePixmapMode* = 25 | |
| 97 X_XDGACreateColormap* = 26 | |
| 98 XDGAConcurrentAccess* = 0x00000001 | |
| 99 XDGASolidFillRect* = 0x00000002 | |
| 100 XDGABlitRect* = 0x00000004 | |
| 101 XDGABlitTransRect* = 0x00000008 | |
| 102 XDGAPixmap* = 0x00000010 | |
| 103 XDGAInterlaced* = 0x00010000 | |
| 104 XDGADoublescan* = 0x00020000 | |
| 105 XDGAFlipImmediate* = 0x00000001 | |
| 106 XDGAFlipRetrace* = 0x00000002 | |
| 107 XDGANeedRoot* = 0x00000001 | |
| 108 XF86DGANumberEvents* = 7 | |
| 109 XDGAPixmapModeLarge* = 0 | |
| 110 XDGAPixmapModeSmall* = 1 | |
| 111 XF86DGAClientNotLocal* = 0 | |
| 112 XF86DGANoDirectVideoMode* = 1 | |
| 113 XF86DGAScreenNotActive* = 2 | |
| 114 XF86DGADirectNotActivated* = 3 | |
| 115 XF86DGAOperationNotSupported* = 4 | |
| 116 XF86DGANumberErrors* = (XF86DGAOperationNotSupported + 1) | |
| 117 | |
| 118 type | |
| 119 PXDGAMode* = ptr XDGAMode | |
| 120 XDGAMode*{.final.} = object | |
| 121 num*: cint # A unique identifier for the mode (num > 0) | |
| 122 name*: cstring # name of mode given in the XF86Config | |
| 123 verticalRefresh*: cfloat | |
| 124 flags*: cint # DGA_CONCURRENT_ACCESS, etc... | |
| 125 imageWidth*: cint # linear accessible portion (pixels) | |
| 126 imageHeight*: cint | |
| 127 pixmapWidth*: cint # Xlib accessible portion (pixels) | |
| 128 pixmapHeight*: cint # both fields ignored if no concurrent access | |
| 129 bytesPerScanline*: cint | |
| 130 byteOrder*: cint # MSBFirst, LSBFirst | |
| 131 depth*: cint | |
| 132 bitsPerPixel*: cint | |
| 133 redMask*: culong | |
| 134 greenMask*: culong | |
| 135 blueMask*: culong | |
| 136 visualClass*: cshort | |
| 137 viewportWidth*: cint | |
| 138 viewportHeight*: cint | |
| 139 xViewportStep*: cint # viewport position granularity | |
| 140 yViewportStep*: cint | |
| 141 maxViewportX*: cint # max viewport origin | |
| 142 maxViewportY*: cint | |
| 143 viewportFlags*: cint # types of page flipping possible | |
| 144 reserved1*: cint | |
| 145 reserved2*: cint | |
| 146 | |
| 147 PXDGADevice* = ptr XDGADevice | |
| 148 XDGADevice*{.final.} = object | |
| 149 mode*: XDGAMode | |
| 150 data*: Pcuchar | |
| 151 pixmap*: Pixmap | |
| 152 | |
| 153 PXDGAButtonEvent* = ptr XDGAButtonEvent | |
| 154 XDGAButtonEvent*{.final.} = object | |
| 155 theType*: cint | |
| 156 serial*: culong | |
| 157 display*: PDisplay | |
| 158 screen*: cint | |
| 159 time*: Time | |
| 160 state*: cuint | |
| 161 button*: cuint | |
| 162 | |
| 163 PXDGAKeyEvent* = ptr XDGAKeyEvent | |
| 164 XDGAKeyEvent*{.final.} = object | |
| 165 theType*: cint | |
| 166 serial*: culong | |
| 167 display*: PDisplay | |
| 168 screen*: cint | |
| 169 time*: Time | |
| 170 state*: cuint | |
| 171 keycode*: cuint | |
| 172 | |
| 173 PXDGAMotionEvent* = ptr XDGAMotionEvent | |
| 174 XDGAMotionEvent*{.final.} = object | |
| 175 theType*: cint | |
| 176 serial*: culong | |
| 177 display*: PDisplay | |
| 178 screen*: cint | |
| 179 time*: Time | |
| 180 state*: cuint | |
| 181 dx*: cint | |
| 182 dy*: cint | |
| 183 | |
| 184 PXDGAEvent* = ptr XDGAEvent | |
| 185 XDGAEvent*{.final.} = object | |
| 186 pad*: array[0..23, clong] # sorry you have to cast if you want access | |
| 187 # Case LongInt Of | |
| 188 # 0 : (_type : cint); | |
| 189 # 1 : (xbutton : XDGAButtonEvent); | |
| 190 # 2 : (xkey : XDGAKeyEvent); | |
| 191 # 3 : (xmotion : XDGAMotionEvent); | |
| 192 # 4 : (pad : Array[0..23] Of clong); | |
| 193 | |
| 194 proc XDGAQueryExtension*(dpy: PDisplay, eventBase: Pcint, erroBase: Pcint): XBool{. | |
| 195 cdecl, dynlib: libXxf86dga, importc.} | |
| 196 proc XDGAQueryVersion*(dpy: PDisplay, majorVersion: Pcint, minorVersion: Pcint): XBool{. | |
| 197 cdecl, dynlib: libXxf86dga, importc.} | |
| 198 proc XDGAQueryModes*(dpy: PDisplay, screen: cint, num: Pcint): PXDGAMode{.cdecl, | |
| 199 dynlib: libXxf86dga, importc.} | |
| 200 proc XDGASetMode*(dpy: PDisplay, screen: cint, mode: cint): PXDGADevice{.cdecl, | |
| 201 dynlib: libXxf86dga, importc.} | |
| 202 proc XDGAOpenFramebuffer*(dpy: PDisplay, screen: cint): XBool{.cdecl, | |
| 203 dynlib: libXxf86dga, importc.} | |
| 204 proc XDGACloseFramebuffer*(dpy: PDisplay, screen: cint){.cdecl, | |
| 205 dynlib: libXxf86dga, importc.} | |
| 206 proc XDGASetViewport*(dpy: PDisplay, screen: cint, x: cint, y: cint, flags: cint){. | |
| 207 cdecl, dynlib: libXxf86dga, importc.} | |
| 208 proc XDGAInstallColormap*(dpy: PDisplay, screen: cint, cmap: Colormap){.cdecl, | |
| 209 dynlib: libXxf86dga, importc.} | |
| 210 proc XDGACreateColormap*(dpy: PDisplay, screen: cint, device: PXDGADevice, | |
| 211 alloc: cint): Colormap{.cdecl, dynlib: libXxf86dga, | |
| 212 importc.} | |
| 213 proc XDGASelectInput*(dpy: PDisplay, screen: cint, event_mask: clong){.cdecl, | |
| 214 dynlib: libXxf86dga, importc.} | |
| 215 proc XDGAFillRectangle*(dpy: PDisplay, screen: cint, x: cint, y: cint, | |
| 216 width: cuint, height: cuint, color: culong){.cdecl, | |
| 217 dynlib: libXxf86dga, importc.} | |
| 218 proc XDGACopyArea*(dpy: PDisplay, screen: cint, srcx: cint, srcy: cint, | |
| 219 width: cuint, height: cuint, dstx: cint, dsty: cint){.cdecl, | |
| 220 dynlib: libXxf86dga, importc.} | |
| 221 proc XDGACopyTransparentArea*(dpy: PDisplay, screen: cint, srcx: cint, | |
| 222 srcy: cint, width: cuint, height: cuint, | |
| 223 dstx: cint, dsty: cint, key: culong){.cdecl, | |
| 224 dynlib: libXxf86dga, importc.} | |
| 225 proc XDGAGetViewportStatus*(dpy: PDisplay, screen: cint): cint{.cdecl, | |
| 226 dynlib: libXxf86dga, importc.} | |
| 227 proc XDGASync*(dpy: PDisplay, screen: cint){.cdecl, dynlib: libXxf86dga, importc.} | |
| 228 proc XDGASetClientVersion*(dpy: PDisplay): XBool{.cdecl, dynlib: libXxf86dga, | |
| 229 importc.} | |
| 230 proc XDGAChangePixmapMode*(dpy: PDisplay, screen: cint, x: Pcint, y: Pcint, | |
| 231 mode: cint){.cdecl, dynlib: libXxf86dga, importc.} | |
| 232 proc XDGAKeyEventToXKeyEvent*(dk: PXDGAKeyEvent, xk: PXKeyEvent){.cdecl, | |
| 233 dynlib: libXxf86dga, importc.} | |
| 234 # implementation |
