1 /* 2 * ReactOS Generic Framebuffer display driver 3 * 4 * Copyright (C) 2004 Filip Navara 5 * 6 * This program is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public License 8 * as published by the Free Software Foundation; either version 2 9 * of the License, or (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License along 17 * with this program; if not, write to the Free Software Foundation, Inc., 18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 19 */ 20 21 #ifndef _FRAMEBUF_PCH_ 22 #define _FRAMEBUF_PCH_ 23 24 #include <stdarg.h> 25 #include <windef.h> 26 #include <wingdi.h> 27 #include <winddi.h> 28 #include <winioctl.h> 29 #include <ntddvdeo.h> 30 31 //#define EXPERIMENTAL_MOUSE_CURSOR_SUPPORT 32 33 typedef struct _PDEV 34 { 35 HANDLE hDriver; 36 HDEV hDevEng; 37 HSURF hSurfEng; 38 ULONG ModeIndex; 39 ULONG ScreenWidth; 40 ULONG ScreenHeight; 41 ULONG ScreenDelta; 42 BYTE BitsPerPixel; 43 ULONG RedMask; 44 ULONG GreenMask; 45 ULONG BlueMask; 46 BYTE PaletteShift; 47 PVOID ScreenPtr; 48 HPALETTE DefaultPalette; 49 PALETTEENTRY *PaletteEntries; 50 51 #ifdef EXPERIMENTAL_MOUSE_CURSOR_SUPPORT 52 VIDEO_POINTER_ATTRIBUTES PointerAttributes; 53 XLATEOBJ *PointerXlateObject; 54 HSURF PointerColorSurface; 55 HSURF PointerMaskSurface; 56 HSURF PointerSaveSurface; 57 POINTL PointerHotSpot; 58 #endif 59 60 /* DirectX Support */ 61 DWORD iDitherFormat; 62 ULONG MemHeight; 63 ULONG MemWidth; 64 DWORD dwHeap; 65 VIDEOMEMORY* pvmList; 66 BOOL bDDInitialized; 67 DDPIXELFORMAT ddpfDisplay; 68 } PDEV, *PPDEV; 69 70 #define DEVICE_NAME L"framebuf" 71 #define ALLOC_TAG 'FUBF' 72 73 74 BOOL APIENTRY 75 DrvEnableDirectDraw( 76 DHPDEV dhpdev, 77 DD_CALLBACKS *pCallbacks, 78 DD_SURFACECALLBACKS *pSurfaceCallbacks, 79 DD_PALETTECALLBACKS *pPaletteCallbacks); 80 81 VOID APIENTRY 82 DrvDisableDirectDraw( 83 DHPDEV dhpdev); 84 85 DHPDEV APIENTRY 86 DrvEnablePDEV( 87 IN DEVMODEW *pdm, 88 IN LPWSTR pwszLogAddress, 89 IN ULONG cPat, 90 OUT HSURF *phsurfPatterns, 91 IN ULONG cjCaps, 92 OUT ULONG *pdevcaps, 93 IN ULONG cjDevInfo, 94 OUT DEVINFO *pdi, 95 IN HDEV hdev, 96 IN LPWSTR pwszDeviceName, 97 IN HANDLE hDriver); 98 99 VOID APIENTRY 100 DrvCompletePDEV( 101 IN DHPDEV dhpdev, 102 IN HDEV hdev); 103 104 VOID APIENTRY 105 DrvDisablePDEV( 106 IN DHPDEV dhpdev); 107 108 HSURF APIENTRY 109 DrvEnableSurface( 110 IN DHPDEV dhpdev); 111 112 VOID APIENTRY 113 DrvDisableSurface( 114 IN DHPDEV dhpdev); 115 116 BOOL APIENTRY 117 DrvAssertMode( 118 IN DHPDEV dhpdev, 119 IN BOOL bEnable); 120 121 ULONG APIENTRY 122 DrvGetModes( 123 IN HANDLE hDriver, 124 IN ULONG cjSize, 125 OUT DEVMODEW *pdm); 126 127 BOOL APIENTRY 128 DrvSetPalette( 129 IN DHPDEV dhpdev, 130 IN PALOBJ *ppalo, 131 IN FLONG fl, 132 IN ULONG iStart, 133 IN ULONG cColors); 134 135 ULONG APIENTRY 136 DrvSetPointerShape( 137 IN SURFOBJ *pso, 138 IN SURFOBJ *psoMask, 139 IN SURFOBJ *psoColor, 140 IN XLATEOBJ *pxlo, 141 IN LONG xHot, 142 IN LONG yHot, 143 IN LONG x, 144 IN LONG y, 145 IN RECTL *prcl, 146 IN FLONG fl); 147 148 VOID APIENTRY 149 DrvMovePointer( 150 IN SURFOBJ *pso, 151 IN LONG x, 152 IN LONG y, 153 IN RECTL *prcl); 154 155 BOOL 156 IntInitScreenInfo( 157 PPDEV ppdev, 158 LPDEVMODEW pDevMode, 159 PGDIINFO pGdiInfo, 160 PDEVINFO pDevInfo); 161 162 BOOL 163 IntInitDefaultPalette( 164 PPDEV ppdev, 165 PDEVINFO pDevInfo); 166 167 BOOL APIENTRY 168 IntSetPalette( 169 IN DHPDEV dhpdev, 170 IN PPALETTEENTRY ppalent, 171 IN ULONG iStart, 172 IN ULONG cColors); 173 174 #endif /* _FRAMEBUF_PCH_ */ 175