Added German 105 keys keyboard.
[wine/gsoc_dplay.git] / graphics / bitblt.c
bloba6ac8f092db9839e564b3392a0af5d12a4173b52
1 /*
2 * GDI bit-blit operations
4 * Copyright 1993, 1994 Alexandre Julliard
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library 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 GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #include "gdi.h"
22 #include "wine/debug.h"
24 WINE_DEFAULT_DEBUG_CHANNEL(bitblt);
27 /***********************************************************************
28 * PatBlt (GDI.29)
30 BOOL16 WINAPI PatBlt16( HDC16 hdc, INT16 left, INT16 top,
31 INT16 width, INT16 height, DWORD rop)
33 return PatBlt( hdc, left, top, width, height, rop );
37 /***********************************************************************
38 * PatBlt (GDI32.@)
40 BOOL WINAPI PatBlt( HDC hdc, INT left, INT top,
41 INT width, INT height, DWORD rop)
43 DC * dc = DC_GetDCUpdate( hdc );
44 BOOL bRet = FALSE;
46 if (!dc) return FALSE;
48 if (dc->funcs->pPatBlt)
50 TRACE("%04x %d,%d %dx%d %06lx\n", hdc, left, top, width, height, rop );
51 bRet = dc->funcs->pPatBlt( dc, left, top, width, height, rop );
53 GDI_ReleaseObj( hdc );
54 return bRet;
58 /***********************************************************************
59 * BitBlt (GDI.34)
61 BOOL16 WINAPI BitBlt16( HDC16 hdcDst, INT16 xDst, INT16 yDst, INT16 width,
62 INT16 height, HDC16 hdcSrc, INT16 xSrc, INT16 ySrc,
63 DWORD rop )
65 return BitBlt( hdcDst, xDst, yDst, width, height, hdcSrc, xSrc, ySrc, rop );
69 /***********************************************************************
70 * BitBlt (GDI32.@)
72 BOOL WINAPI BitBlt( HDC hdcDst, INT xDst, INT yDst, INT width,
73 INT height, HDC hdcSrc, INT xSrc, INT ySrc, DWORD rop )
75 BOOL ret = FALSE;
76 DC *dcDst, *dcSrc;
78 if ((dcSrc = DC_GetDCUpdate( hdcSrc ))) GDI_ReleaseObj( hdcSrc );
79 /* FIXME: there is a race condition here */
80 if ((dcDst = DC_GetDCUpdate( hdcDst )))
82 dcSrc = DC_GetDCPtr( hdcSrc );
83 TRACE("hdcSrc=%04x %d,%d %d bpp->hdcDest=%04x %d,%d %dx%dx%d rop=%06lx\n",
84 hdcSrc, xSrc, ySrc, dcSrc ? dcSrc->bitsPerPixel : 0,
85 hdcDst, xDst, yDst, width, height, dcDst->bitsPerPixel, rop);
86 if (dcDst->funcs->pBitBlt)
87 ret = dcDst->funcs->pBitBlt( dcDst, xDst, yDst, width, height,
88 dcSrc, xSrc, ySrc, rop );
89 if (dcSrc) GDI_ReleaseObj( hdcSrc );
90 GDI_ReleaseObj( hdcDst );
92 return ret;
96 /***********************************************************************
97 * StretchBlt (GDI.35)
99 BOOL16 WINAPI StretchBlt16( HDC16 hdcDst, INT16 xDst, INT16 yDst,
100 INT16 widthDst, INT16 heightDst,
101 HDC16 hdcSrc, INT16 xSrc, INT16 ySrc,
102 INT16 widthSrc, INT16 heightSrc, DWORD rop )
104 return StretchBlt( hdcDst, xDst, yDst, widthDst, heightDst,
105 hdcSrc, xSrc, ySrc, widthSrc, heightSrc, rop );
109 /***********************************************************************
110 * StretchBlt (GDI32.@)
112 BOOL WINAPI StretchBlt( HDC hdcDst, INT xDst, INT yDst,
113 INT widthDst, INT heightDst,
114 HDC hdcSrc, INT xSrc, INT ySrc,
115 INT widthSrc, INT heightSrc,
116 DWORD rop )
118 BOOL ret = FALSE;
119 DC *dcDst, *dcSrc;
121 if ((dcSrc = DC_GetDCUpdate( hdcSrc ))) GDI_ReleaseObj( hdcSrc );
122 /* FIXME: there is a race condition here */
123 if ((dcDst = DC_GetDCUpdate( hdcDst )))
125 dcSrc = DC_GetDCPtr( hdcSrc );
127 TRACE("%04x %d,%d %dx%dx%d -> %04x %d,%d %dx%dx%d rop=%06lx\n",
128 hdcSrc, xSrc, ySrc, widthSrc, heightSrc,
129 dcSrc ? dcSrc->bitsPerPixel : 0, hdcDst, xDst, yDst,
130 widthDst, heightDst, dcDst->bitsPerPixel, rop );
132 if (dcSrc) {
133 if (dcDst->funcs->pStretchBlt)
134 ret = dcDst->funcs->pStretchBlt( dcDst, xDst, yDst, widthDst, heightDst,
135 dcSrc, xSrc, ySrc, widthSrc, heightSrc, rop );
136 GDI_ReleaseObj( hdcSrc );
138 GDI_ReleaseObj( hdcDst );
140 return ret;
144 /***********************************************************************
145 * FastWindowFrame (GDI.400)
147 BOOL16 WINAPI FastWindowFrame16( HDC16 hdc, const RECT16 *rect,
148 INT16 width, INT16 height, DWORD rop )
150 HBRUSH hbrush = SelectObject( hdc, GetStockObject( GRAY_BRUSH ) );
151 PatBlt( hdc, rect->left, rect->top,
152 rect->right - rect->left - width, height, rop );
153 PatBlt( hdc, rect->left, rect->top + height, width,
154 rect->bottom - rect->top - height, rop );
155 PatBlt( hdc, rect->left + width, rect->bottom - 1,
156 rect->right - rect->left - width, -height, rop );
157 PatBlt( hdc, rect->right - 1, rect->top, -width,
158 rect->bottom - rect->top - height, rop );
159 SelectObject( hdc, hbrush );
160 return TRUE;
165 /***********************************************************************
166 * MaskBlt [GDI32.@]
168 BOOL WINAPI MaskBlt(HDC hdcDest, INT nXDest, INT nYDest,
169 INT nWidth, INT nHeight, HDC hdcSource,
170 INT nXSrc, INT nYSrc, HBITMAP hbmMask,
171 INT xMask, INT yMask, DWORD dwRop)
173 FIXME("(%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%ld): stub\n",
174 hdcDest,nXDest,nYDest,nWidth,nHeight,hdcSource,nXSrc,nYSrc,
175 hbmMask,xMask,yMask,dwRop);
176 return 1;
179 /*********************************************************************
180 * PlgBlt [GDI32.@]
183 BOOL WINAPI PlgBlt( HDC hdcDest, const POINT *lpPoint,
184 HDC hdcSrc, INT nXDest, INT nYDest, INT nWidth,
185 INT nHeight, HBITMAP hbmMask, INT xMask, INT yMask)
187 FIXME("PlgBlt, stub\n");
188 return 1;