Added new CLIENT_DebuggerRequest routine, implemented support for
[wine/wine-kai.git] / graphics / bitblt.c
bloba775bddee929eb26dcf697336f60562bf8747c9b
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 TRACE(bitblt, "%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 BOOL WINAPI PatBlt( HDC hdc, INT left, INT top,
30 INT width, INT height, DWORD rop)
32 DC * dc = DC_GetDCPtr( hdc );
33 if (!dc || !dc->funcs->pPatBlt) return FALSE;
35 TRACE(bitblt, "%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 TRACE(bitblt, "hdcSrc=%04x %d,%d %d bpp -> hdcDest=%04x %d,%d %dx%dx%d rop=%06lx\n",
55 hdcSrc, xSrc, ySrc, dcSrc ? dcSrc->w.bitsPerPixel : 0,
56 hdcDst, xDst, yDst, width, height, dcDst->w.bitsPerPixel, rop);
57 return dcDst->funcs->pBitBlt( dcDst, xDst, yDst, width, height,
58 dcSrc, xSrc, ySrc, rop );
62 /***********************************************************************
63 * BitBlt32 (GDI32.10)
65 BOOL WINAPI BitBlt( HDC hdcDst, INT xDst, INT yDst, INT width,
66 INT height, HDC hdcSrc, INT xSrc, INT ySrc,
67 DWORD rop )
69 DC *dcDst, *dcSrc;
71 if (!(dcDst = DC_GetDCPtr( hdcDst ))) return FALSE;
72 if (!dcDst->funcs->pBitBlt) return FALSE;
73 dcSrc = DC_GetDCPtr( hdcSrc );
75 TRACE(bitblt, "hdcSrc=%04x %d,%d %d bpp -> hdcDest=%04x %d,%d %dx%dx%d rop=%06lx\n",
76 hdcSrc, xSrc, ySrc, dcSrc ? dcSrc->w.bitsPerPixel : 0,
77 hdcDst, xDst, yDst, width, height, dcDst->w.bitsPerPixel, rop);
78 return dcDst->funcs->pBitBlt( dcDst, xDst, yDst, width, height,
79 dcSrc, xSrc, ySrc, rop );
83 /***********************************************************************
84 * StretchBlt16 (GDI.35)
86 BOOL16 WINAPI StretchBlt16( HDC16 hdcDst, INT16 xDst, INT16 yDst,
87 INT16 widthDst, INT16 heightDst,
88 HDC16 hdcSrc, INT16 xSrc, INT16 ySrc,
89 INT16 widthSrc, INT16 heightSrc, DWORD rop )
91 DC *dcDst, *dcSrc;
93 if (!(dcDst = DC_GetDCPtr( hdcDst ))) return FALSE;
94 if (!dcDst->funcs->pStretchBlt) return FALSE;
95 dcSrc = DC_GetDCPtr( hdcSrc );
97 TRACE(bitblt, "%04x %d,%d %dx%dx%d -> %04x %d,%d %dx%dx%d rop=%06lx\n",
98 hdcSrc, xSrc, ySrc, widthSrc, heightSrc,
99 dcSrc ? dcSrc->w.bitsPerPixel : 0, hdcDst, xDst, yDst,
100 widthDst, heightDst, dcDst->w.bitsPerPixel, rop );
101 return dcDst->funcs->pStretchBlt( dcDst, xDst, yDst, widthDst, heightDst,
102 dcSrc, xSrc, ySrc, widthSrc, heightSrc,
103 rop );
107 /***********************************************************************
108 * StretchBlt32 (GDI32.350)
110 BOOL WINAPI StretchBlt( HDC hdcDst, INT xDst, INT yDst,
111 INT widthDst, INT heightDst,
112 HDC hdcSrc, INT xSrc, INT ySrc,
113 INT widthSrc, INT heightSrc, DWORD rop )
115 DC *dcDst, *dcSrc;
117 if (!(dcDst = DC_GetDCPtr( hdcDst ))) return FALSE;
118 if (!dcDst->funcs->pStretchBlt) return FALSE;
119 dcSrc = DC_GetDCPtr( hdcSrc );
121 TRACE(bitblt, "%04x %d,%d %dx%dx%d -> %04x %d,%d %dx%dx%d rop=%06lx\n",
122 hdcSrc, xSrc, ySrc, widthSrc, heightSrc,
123 dcSrc ? dcSrc->w.bitsPerPixel : 0, hdcDst, xDst, yDst,
124 widthDst, heightDst, dcDst->w.bitsPerPixel, rop );
125 return dcDst->funcs->pStretchBlt( dcDst, xDst, yDst, widthDst, heightDst,
126 dcSrc, xSrc, ySrc, widthSrc, heightSrc,
127 rop );
131 /***********************************************************************
132 * FastWindowFrame (GDI.400)
134 BOOL16 WINAPI FastWindowFrame16( HDC16 hdc, const RECT16 *rect,
135 INT16 width, INT16 height, DWORD rop )
137 HBRUSH hbrush = SelectObject( hdc, GetStockObject( GRAY_BRUSH ) );
138 PatBlt( hdc, rect->left, rect->top,
139 rect->right - rect->left - width, height, rop );
140 PatBlt( hdc, rect->left, rect->top + height, width,
141 rect->bottom - rect->top - height, rop );
142 PatBlt( hdc, rect->left + width, rect->bottom,
143 rect->right - rect->left - width, -height, rop );
144 PatBlt( hdc, rect->right, rect->top, -width,
145 rect->bottom - rect->top - height, rop );
146 SelectObject( hdc, hbrush );
147 return TRUE;
149 /***********************************************************************
150 * MaskBlt32 [GDI32.252]
152 BOOL WINAPI MaskBlt(HDC hdcDest, INT nXDest, INT nYDest,
153 INT nWidth, INT nHeight, HDC hdcSource,
154 INT nXSrc, INT nYSrc, HBITMAP hbmMask,
155 INT xMask, INT yMask, DWORD dwRop)
157 FIXME(bitmap, "(%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%ld): stub\n",
158 hdcDest,nXDest,nYDest,nWidth,nHeight,hdcSource,nXSrc,nYSrc,
159 hbmMask,xMask,yMask,dwRop);
160 return 1;
163 /*********************************************************************
164 * PlgBlt [GDI.267]
167 BOOL WINAPI PlgBlt( HDC hdcDest, const POINT *lpPoint,
168 HDC hdcSrc, INT nXDest, INT nYDest, INT nWidth,
169 INT nHeight, HBITMAP hbmMask, INT xMask, INT yMask)
171 FIXME(gdi, "PlgBlt, stub\n");
172 return 1;