Alexandre Julliard | da0cfb3 | 1996-12-01 17:17:47 +0000 | [diff] [blame] | 1 | /* |
| 2 | * WingG support |
| 3 | * |
| 4 | * Started by Robert Pouliot <krynos@clic.net> |
| 5 | */ |
| 6 | |
| 7 | #include "gdi.h" |
Alexandre Julliard | 7e6ae4b | 1996-12-08 19:25:27 +0000 | [diff] [blame^] | 8 | #include "windows.h" |
Alexandre Julliard | da0cfb3 | 1996-12-01 17:17:47 +0000 | [diff] [blame] | 9 | #include "stddebug.h" |
| 10 | #include "debug.h" |
| 11 | |
Alexandre Julliard | da0cfb3 | 1996-12-01 17:17:47 +0000 | [diff] [blame] | 12 | /*********************************************************************** |
| 13 | * WingCreateDC16 (WING.1001) |
| 14 | */ |
| 15 | HDC16 WinGCreateDC16(void) |
| 16 | { |
| 17 | /* FIXME: Probably wrong... */ |
| 18 | return CreateDC("DISPLAY", NULL, NULL, NULL); |
| 19 | } |
| 20 | |
| 21 | |
| 22 | /*********************************************************************** |
| 23 | * WinGRecommendDIBFormat16 (WING.1002) |
| 24 | */ |
| 25 | BOOL16 WinGRecommendDIBFormat16(BITMAPINFO *fmt) |
| 26 | { |
Alexandre Julliard | 7e6ae4b | 1996-12-08 19:25:27 +0000 | [diff] [blame^] | 27 | HDC16 i=GetDC16(0); |
| 28 | |
| 29 | fmt->bmiHeader.biSize=sizeof(BITMAPINFOHEADER); |
| 30 | fmt->bmiHeader.biWidth=0; |
| 31 | fmt->bmiHeader.biHeight=1; /* The important part */ |
| 32 | fmt->bmiHeader.biPlanes=GetDeviceCaps(i, PLANES); |
| 33 | fmt->bmiHeader.biBitCount=GetDeviceCaps(i, BITSPIXEL); |
| 34 | fmt->bmiHeader.biCompression=BI_RGB; |
| 35 | fmt->bmiHeader.biSizeImage=0; |
| 36 | fmt->bmiHeader.biXPelsPerMeter=1000/25.4*GetDeviceCaps(i,LOGPIXELSX); |
| 37 | fmt->bmiHeader.biYPelsPerMeter=1000/25.4*GetDeviceCaps(i,LOGPIXELSY); |
| 38 | fmt->bmiHeader.biClrUsed=0; |
| 39 | fmt->bmiHeader.biClrImportant=0; |
| 40 | ReleaseDC16(0, i); |
| 41 | return 1; |
Alexandre Julliard | da0cfb3 | 1996-12-01 17:17:47 +0000 | [diff] [blame] | 42 | } |
| 43 | |
| 44 | /*********************************************************************** |
| 45 | * WinGCreateBitmap16 (WING.1003) |
| 46 | */ |
| 47 | HBITMAP16 WinGCreateBitmap16(HDC16 winDC, BITMAPINFO *header, void **bits) |
| 48 | { |
Alexandre Julliard | 7e6ae4b | 1996-12-08 19:25:27 +0000 | [diff] [blame^] | 49 | fprintf(stdnimp,"WinGCreateBitmap: almost empty stub! (expect failure)\n"); |
| 50 | /* Assume RGB color */ |
| 51 | if(bits==NULL) |
| 52 | return CreateDIBitmap(winDC, header, 0, bits, header, 0); |
| 53 | else |
| 54 | return CreateDIBitmap(winDC, header, 1, bits, header, 0); |
Alexandre Julliard | da0cfb3 | 1996-12-01 17:17:47 +0000 | [diff] [blame] | 55 | return 0; |
| 56 | } |
| 57 | |
| 58 | /*********************************************************************** |
Alexandre Julliard | 7e6ae4b | 1996-12-08 19:25:27 +0000 | [diff] [blame^] | 59 | * WinGGetDIBPointer16 (WING.1004) |
| 60 | */ |
| 61 | void* WinGGetDIBPointer16(HBITMAP16 bmap, BITMAPINFO *header) |
| 62 | { |
| 63 | fprintf(stdnimp,"WinGGetDIBPointer16: empty stub!\n"); |
| 64 | return NULL; |
| 65 | } |
| 66 | |
| 67 | /*********************************************************************** |
| 68 | * WinGGetDIBColorTable16 (WING.1005) |
| 69 | */ |
| 70 | UINT16 WinGGetDIBColorTable16(HDC16 winDC, UINT16 start, UINT16 numentry, |
| 71 | RGBQUAD* colors) |
| 72 | { |
| 73 | return GetPaletteEntries(winDC, start, numentry, colors); |
| 74 | } |
| 75 | |
| 76 | /*********************************************************************** |
| 77 | * WinGSetDIBColorTable16 (WING.1006) |
| 78 | */ |
| 79 | UINT16 WinGSetDIBColorTable16(HDC16 winDC, UINT16 start, UINT16 numentry, |
| 80 | RGBQUAD* colors) |
| 81 | { |
| 82 | return SetPaletteEntries(winDC, start, numentry, colors); |
| 83 | } |
| 84 | |
| 85 | |
| 86 | /*********************************************************************** |
Alexandre Julliard | da0cfb3 | 1996-12-01 17:17:47 +0000 | [diff] [blame] | 87 | * WinGCreateHalfTonePalette16 (WING.1007) |
| 88 | */ |
| 89 | HPALETTE16 WinGCreateHalfTonePalette16(void) |
| 90 | { |
Alexandre Julliard | 7e6ae4b | 1996-12-08 19:25:27 +0000 | [diff] [blame^] | 91 | fprintf(stdnimp,"WinGCreateHalfTonePalette16: empty stub!\n"); |
Alexandre Julliard | da0cfb3 | 1996-12-01 17:17:47 +0000 | [diff] [blame] | 92 | return 0; |
| 93 | } |
| 94 | |
| 95 | /*********************************************************************** |
| 96 | * WinGCreateHalfToneBrush16 (WING.1008) |
| 97 | */ |
Alexandre Julliard | 7e6ae4b | 1996-12-08 19:25:27 +0000 | [diff] [blame^] | 98 | HPALETTE16 WinGCreateHalfToneBrush16(HDC16 winDC, COLORREF col, INT16 dithertype) |
Alexandre Julliard | da0cfb3 | 1996-12-01 17:17:47 +0000 | [diff] [blame] | 99 | { |
Alexandre Julliard | 7e6ae4b | 1996-12-08 19:25:27 +0000 | [diff] [blame^] | 100 | fprintf(stdnimp,"WinGCreateHalfToneBrush16: empty stub!\n"); |
Alexandre Julliard | da0cfb3 | 1996-12-01 17:17:47 +0000 | [diff] [blame] | 101 | return 0; |
| 102 | } |
| 103 | |
Alexandre Julliard | 7e6ae4b | 1996-12-08 19:25:27 +0000 | [diff] [blame^] | 104 | /*********************************************************************** |
| 105 | * WinGStretchBlt16 (WING.1009) |
| 106 | */ |
| 107 | BOOL16 WinGStretchBlt16(HDC16 destDC, INT16 xDest, INT16 yDest, INT16 widDest, |
| 108 | INT16 heiDest, HDC16 srcDC, INT16 xSrc, INT16 ySrc, |
| 109 | INT16 widSrc, INT16 heiSrc) |
| 110 | { |
| 111 | |
| 112 | return StretchBlt16(destDC, xDest, yDest, widDest, heiDest, srcDC, xSrc, ySrc, widSrc, heiSrc, SRCCOPY); |
| 113 | /* fprintf(stdnimp,"WinGStretchBlt16: empty stub!\n");*/ |
| 114 | /* return 0; */ |
| 115 | } |
| 116 | |
| 117 | /*********************************************************************** |
| 118 | * WinGBitBlt16 (WING.1010) |
| 119 | */ |
| 120 | BOOL16 WinGBitBlt16(HDC16 destDC, INT16 xDest, INT16 yDest, INT16 widDest, |
| 121 | INT16 heiDest, HDC16 srcDC, INT16 xSrc, INT16 ySrc) |
| 122 | { |
| 123 | return BitBlt16(destDC, xDest, yDest, widDest, heiDest, srcDC, xSrc, ySrc, SRCCOPY); |
| 124 | /* fprintf(stdnimp,"WinGBitBlt16: empty stub!\n");*/ |
| 125 | /* return 0;*/ |
| 126 | } |
| 127 | |