Release 980301
[wine/hacks.git] / graphics / bitblt.c
blobf779dfdf6d5bc60c677d4ad7b1c7deaf33e0ca60
1 /*
2 * GDI bit-blit operations
4 * Copyright 1993, 1994 Alexandre Julliard
5 */
7 #include "dc.h"
8 #include "debug.h"
11 /***********************************************************************
12 * PatBlt16 (GDI.29)
14 BOOL16 WINAPI PatBlt16( HDC16 hdc, INT16 left, INT16 top,
15 INT16 width, INT16 height, DWORD rop)
17 DC * dc = DC_GetDCPtr( hdc );
18 if (!dc || !dc->funcs->pPatBlt) return FALSE;
20 dprintf_info(bitblt, "PatBlt16: %04x %d,%d %dx%d %06lx\n",
21 hdc, left, top, width, height, rop );
22 return dc->funcs->pPatBlt( dc, left, top, width, height, rop );
26 /***********************************************************************
27 * PatBlt32 (GDI32.260)
29 BOOL32 WINAPI PatBlt32( HDC32 hdc, INT32 left, INT32 top,
30 INT32 width, INT32 height, DWORD rop)
32 DC * dc = DC_GetDCPtr( hdc );
33 if (!dc || !dc->funcs->pPatBlt) return FALSE;
35 dprintf_info(bitblt, "PatBlt32: %04x %d,%d %dx%d %06lx\n",
36 hdc, left, top, width, height, rop );
37 return dc->funcs->pPatBlt( dc, left, top, width, height, rop );
41 /***********************************************************************
42 * BitBlt16 (GDI.34)
44 BOOL16 WINAPI BitBlt16( HDC16 hdcDst, INT16 xDst, INT16 yDst, INT16 width,
45 INT16 height, HDC16 hdcSrc, INT16 xSrc, INT16 ySrc,
46 DWORD rop )
48 DC *dcDst, *dcSrc;
50 if (!(dcDst = DC_GetDCPtr( hdcDst ))) return FALSE;
51 if (!dcDst->funcs->pBitBlt) return FALSE;
52 dcSrc = DC_GetDCPtr( hdcSrc );
54 dprintf_info(bitblt,
55 "BitBlt16: hdcSrc=%04x %d,%d %d bpp -> hdcDest=%04x %d,%d %dx%dx%d rop=%06lx\n",
56 hdcSrc, xSrc, ySrc, dcSrc ? dcSrc->w.bitsPerPixel : 0,
57 hdcDst, xDst, yDst, width, height, dcDst->w.bitsPerPixel, rop);
58 return dcDst->funcs->pBitBlt( dcDst, xDst, yDst, width, height,
59 dcSrc, xSrc, ySrc, rop );
63 /***********************************************************************
64 * BitBlt32 (GDI32.10)
66 BOOL32 WINAPI BitBlt32( HDC32 hdcDst, INT32 xDst, INT32 yDst, INT32 width,
67 INT32 height, HDC32 hdcSrc, INT32 xSrc, INT32 ySrc,
68 DWORD rop )
70 DC *dcDst, *dcSrc;
72 if (!(dcDst = DC_GetDCPtr( hdcDst ))) return FALSE;
73 if (!dcDst->funcs->pBitBlt) return FALSE;
74 dcSrc = DC_GetDCPtr( hdcSrc );
76 dprintf_info(bitblt,
77 "BitBlt32: hdcSrc=%04x %d,%d %d bpp -> hdcDest=%04x %d,%d %dx%dx%d rop=%06lx\n",
78 hdcSrc, xSrc, ySrc, dcSrc ? dcSrc->w.bitsPerPixel : 0,
79 hdcDst, xDst, yDst, width, height, dcDst->w.bitsPerPixel, rop);
80 return dcDst->funcs->pBitBlt( dcDst, xDst, yDst, width, height,
81 dcSrc, xSrc, ySrc, rop );
85 /***********************************************************************
86 * StretchBlt16 (GDI.35)
88 BOOL16 WINAPI StretchBlt16( HDC16 hdcDst, INT16 xDst, INT16 yDst,
89 INT16 widthDst, INT16 heightDst,
90 HDC16 hdcSrc, INT16 xSrc, INT16 ySrc,
91 INT16 widthSrc, INT16 heightSrc, DWORD rop )
93 DC *dcDst, *dcSrc;
95 if (!(dcDst = DC_GetDCPtr( hdcDst ))) return FALSE;
96 if (!dcDst->funcs->pStretchBlt) return FALSE;
97 dcSrc = DC_GetDCPtr( hdcSrc );
99 dprintf_info(bitblt,
100 "StretchBlt16: %04x %d,%d %dx%dx%d -> %04x %d,%d %dx%dx%d rop=%06lx\n",
101 hdcSrc, xSrc, ySrc, widthSrc, heightSrc,
102 dcSrc ? dcSrc->w.bitsPerPixel : 0, hdcDst, xDst, yDst,
103 widthDst, heightDst, dcDst->w.bitsPerPixel, rop );
104 return dcDst->funcs->pStretchBlt( dcDst, xDst, yDst, widthDst, heightDst,
105 dcSrc, xSrc, ySrc, widthSrc, heightSrc,
106 rop );
110 /***********************************************************************
111 * StretchBlt32 (GDI32.350)
113 BOOL32 WINAPI StretchBlt32( HDC32 hdcDst, INT32 xDst, INT32 yDst,
114 INT32 widthDst, INT32 heightDst,
115 HDC32 hdcSrc, INT32 xSrc, INT32 ySrc,
116 INT32 widthSrc, INT32 heightSrc, DWORD rop )
118 DC *dcDst, *dcSrc;
120 if (!(dcDst = DC_GetDCPtr( hdcDst ))) return FALSE;
121 if (!dcDst->funcs->pStretchBlt) return FALSE;
122 dcSrc = DC_GetDCPtr( hdcSrc );
124 dprintf_info(bitblt,
125 "StretchBlt32: %04x %d,%d %dx%dx%d -> %04x %d,%d %dx%dx%d rop=%06lx\n",
126 hdcSrc, xSrc, ySrc, widthSrc, heightSrc,
127 dcSrc ? dcSrc->w.bitsPerPixel : 0, hdcDst, xDst, yDst,
128 widthDst, heightDst, dcDst->w.bitsPerPixel, rop );
129 return dcDst->funcs->pStretchBlt( dcDst, xDst, yDst, widthDst, heightDst,
130 dcSrc, xSrc, ySrc, widthSrc, heightSrc,
131 rop );
135 /***********************************************************************
136 * FastWindowFrame (GDI.400)
138 BOOL16 WINAPI FastWindowFrame( HDC16 hdc, const RECT16 *rect,
139 INT16 width, INT16 height, DWORD rop )
141 HBRUSH32 hbrush = SelectObject32( hdc, GetStockObject32( GRAY_BRUSH ) );
142 PatBlt32( hdc, rect->left, rect->top,
143 rect->right - rect->left - width, height, rop );
144 PatBlt32( hdc, rect->left, rect->top + height, width,
145 rect->bottom - rect->top - height, rop );
146 PatBlt32( hdc, rect->left + width, rect->bottom,
147 rect->right - rect->left - width, -height, rop );
148 PatBlt32( hdc, rect->right, rect->top, -width,
149 rect->bottom - rect->top - height, rop );
150 SelectObject32( hdc, hbrush );
151 return TRUE;