source: trunk/src/gdi32/gdi32.cpp@ 2581

Last change on this file since 2581 was 2581, checked in by sandervl, 26 years ago

init dibsection bmp data to 0 during creation

File size: 130.9 KB
Line 
1/* $Id: gdi32.cpp,v 1.36 2000-01-31 22:30:08 sandervl Exp $ */
2
3/*
4 * GDI32 apis
5 *
6 * Copyright 1998 Sander van Leeuwen (sandervl@xs4all.nl)
7 * Copyright 1998 Patrick Haller
8 *
9 * Project Odin Software License can be found in LICENSE.TXT
10 *
11 */
12#include <os2win.h>
13#include <stdlib.h>
14#include <stdarg.h>
15#include <string.h>
16#include "misc.h"
17#include "callback.h"
18#include "unicode.h"
19#include "dibsect.h"
20#include <codepage.h>
21#include "oslibgpi.h"
22#include "oslibgdi.h"
23
24static ULONG QueryPaletteSize(BITMAPINFOHEADER *pBHdr)
25{
26 ULONG cbPalette;
27
28 switch (pBHdr->biBitCount)
29 {
30 case 1:
31 case 4:
32 case 8:
33 cbPalette = (1 << pBHdr->biBitCount) * sizeof(RGBQUAD);
34 break;
35
36 case 16:
37 case 24:
38 case 32:
39 cbPalette = 0;
40 break;
41
42 default:
43 dprintf(("QueryPaletteSize: error pBHdr->biBitCount = %d", pBHdr->biBitCount));
44 cbPalette = -1;
45 }
46
47 return cbPalette;
48}
49
50static ULONG CalcBitmapSize(ULONG cBits, LONG cx, LONG cy)
51{
52 ULONG alignment;
53 ULONG factor;
54 BOOL flag = TRUE; //true: '*' false: '/'
55
56 cy = cy < 0 ? -cy : cy;
57
58 switch(cBits)
59 {
60 case 1:
61 factor = 8;
62 flag = FALSE;
63 break;
64
65 case 4:
66 factor = 2;
67 flag = FALSE;
68 break;
69
70 case 8:
71 factor = 1;
72 break;
73
74 case 16:
75 factor = 2;
76 break;
77
78 case 24:
79 factor = 3;
80 break;
81
82 case 32:
83 return cx*cy;
84
85 default:
86 return 0;
87 }
88
89 if (flag)
90 alignment = (cx = (cx*factor)) % 4;
91 else
92 alignment = (cx = ((cx+factor-1)/factor)) % 4;
93
94 if (alignment != 0)
95 cx += 4 - alignment;
96
97 return cx*cy;
98}
99
100//******************************************************************************
101//******************************************************************************
102BOOL WIN32API GetTextExtentPointA(HDC hdc, LPCSTR lpsz, int cbString, LPSIZE lpSize)
103{
104 BOOL rc;
105
106 lpSize->cx = lpSize->cy = 0;
107 rc = O32_GetTextExtentPoint(hdc, lpsz, cbString, lpSize);
108 dprintf(("GDI32: GetTextExtentPointA of %s returned %d\n", lpsz, rc));
109 return(rc);
110}
111//******************************************************************************
112//******************************************************************************
113COLORREF WIN32API SetBkColor(HDC hdc, COLORREF crColor)
114{
115 dprintf(("GDI32: SetBkColor to %X\n", crColor));
116 return(O32_SetBkColor(hdc, crColor));
117}
118//******************************************************************************
119//******************************************************************************
120COLORREF WIN32API SetTextColor(HDC hdc, COLORREF crColor)
121{
122 COLORREF clr;
123
124 clr = O32_SetTextColor(hdc, crColor);
125 dprintf(("GDI32: SetTextColor from %X to %X\n", clr, crColor));
126 return(clr);
127}
128//******************************************************************************
129//******************************************************************************
130
131static hFntDefaultGui = NULL;
132HGDIOBJ WIN32API GetStockObject(int arg1)
133{
134 HGDIOBJ obj;
135
136 switch(arg1)
137 {
138 case DEFAULT_GUI_FONT:
139 if(NULL==hFntDefaultGui)
140 hFntDefaultGui = CreateFontA( 9, 0, 0, 0, FW_MEDIUM, FALSE,
141 FALSE, FALSE, ANSI_CHARSET,
142 OUT_DEFAULT_PRECIS,
143 CLIP_DEFAULT_PRECIS,
144 DEFAULT_QUALITY,
145 FIXED_PITCH|FF_MODERN, "WarpSans");
146 obj = hFntDefaultGui;
147 break;
148 default:
149 obj = O32_GetStockObject(arg1);
150 break;
151 }
152 dprintf(("GDI32: GetStockObject %d returned %X\n", arg1, obj));
153 return(obj);
154}
155//******************************************************************************
156//******************************************************************************
157UINT WIN32API RealizePalette( HDC arg1)
158{
159 dprintf(("GDI32: RealizePalette(0x%08X)\n",arg1));
160 return O32_RealizePalette(arg1);
161}
162//******************************************************************************
163//******************************************************************************
164int WIN32API GetObjectA( HGDIOBJ hObject, int size, void *lpBuffer)
165{
166 int rc;
167
168 if(size == 0 || lpBuffer == NULL) {
169 SetLastError(ERROR_INVALID_PARAMETER);
170 return 0;
171 }
172
173 if(DIBSection::getSection() != NULL)
174 {
175 DIBSection *dsect = DIBSection::find(hObject);
176 if(dsect)
177 {
178 rc = dsect->GetDIBSection(size, lpBuffer);
179 if(rc == 0) {
180 SetLastError(ERROR_INVALID_PARAMETER);
181 return 0;
182 }
183 SetLastError(ERROR_SUCCESS);
184 return rc;
185 }
186 }
187
188 dprintf(("GDI32: GetObject %X %X %X\n", hObject, size, lpBuffer));
189 return O32_GetObject(hObject, size, lpBuffer);
190}
191//******************************************************************************
192//******************************************************************************
193int WIN32API GetObjectW( HGDIOBJ arg1, int arg2, void * arg3)
194{
195 dprintf(("GDI32: GetObjectW %X, %d %X not complete!", arg1, arg2, arg3));
196 return GetObjectA(arg1, arg2, arg3);
197}
198//******************************************************************************
199//******************************************************************************
200DWORD WIN32API GetObjectType( HGDIOBJ arg1)
201{
202 dprintf2(("GDI32: GetObjectType\n"));
203 return O32_GetObjectType(arg1);
204}
205//******************************************************************************
206//******************************************************************************
207BOOL WIN32API DeleteObject(HANDLE hObj)
208{
209 dprintf(("GDI32: DeleteObject %x", hObj));
210 DIBSection::deleteSection((DWORD)hObj);
211 return O32_DeleteObject(hObj);
212}
213//******************************************************************************
214//******************************************************************************
215BOOL WIN32API DeleteDC( HDC hdc)
216{
217 dprintf(("GDI32: DeleteDC %x", hdc));
218 return O32_DeleteDC(hdc);
219}
220//******************************************************************************
221//******************************************************************************
222HPALETTE WIN32API CreatePalette( const LOGPALETTE * arg1)
223{
224 HPALETTE rc;
225 dprintf(("GDI32: CreatePalette\n"));
226 for(int i=0; i<arg1->palNumEntries;i++)
227 {
228 dprintf2(("Index %d : 0x%08X\n",i, *((DWORD*)(&arg1->palPalEntry[i])) ));
229 }
230 rc = O32_CreatePalette(arg1);
231 dprintf((" returns 0x%08X\n",rc));
232
233 return rc;
234}
235//******************************************************************************
236//******************************************************************************
237HBRUSH WIN32API CreatePatternBrush(HBITMAP arg1)
238{
239 HBRUSH brush;
240
241 brush = O32_CreatePatternBrush(arg1);
242 dprintf(("GDI32: CreatePatternBrush from bitmap %X returned %X\n", arg1, brush));
243 return(brush);
244}
245//******************************************************************************
246//******************************************************************************
247HPEN WIN32API CreatePen( int arg1, int arg2, COLORREF arg3)
248{
249 dprintf(("GDI32: CreatePen\n"));
250 return O32_CreatePen(arg1, arg2, arg3);
251}
252//******************************************************************************
253//******************************************************************************
254HPEN WIN32API CreatePenIndirect( const LOGPEN * arg1)
255{
256 dprintf(("GDI32: CreatePenIndirect\n"));
257 return O32_CreatePenIndirect(arg1);
258}
259//******************************************************************************
260//******************************************************************************
261HRGN WIN32API CreatePolyPolygonRgn( const POINT * arg1, const INT * arg2, int arg3, int arg4)
262{
263 dprintf(("GDI32: CreatePolyPolygonRgn\n"));
264 return O32_CreatePolyPolygonRgn(arg1, arg2, arg3, arg4);
265}
266//******************************************************************************
267//******************************************************************************
268HRGN WIN32API CreatePolygonRgn(const POINT * arg1, int arg2, int arg3)
269{
270 dprintf(("GDI32: CreatePolygonRgn"));
271 return O32_CreatePolygonRgn(arg1, arg2, arg3);
272}
273//******************************************************************************
274//******************************************************************************
275HBRUSH WIN32API CreateDIBPatternBrushPt( const VOID * arg1, UINT arg2)
276{
277 dprintf(("GDI32: CreateDIBPatternBrushPt\n"));
278 return O32_CreateDIBPatternBrushPt(arg1, arg2);
279}
280//******************************************************************************
281//******************************************************************************
282HBITMAP WIN32API CreateDIBitmap(HDC arg1, const BITMAPINFOHEADER * arg2, DWORD arg3, const void * arg4, const BITMAPINFO * arg5, UINT arg6)
283{
284 int iHeight;
285 HBITMAP rc;
286 dprintf(("GDI32: CreateDIBitmap\n"));
287
288 //TEMPORARY HACK TO PREVENT CRASH IN OPEN32 (WSeB GA)
289
290 iHeight = arg2->biHeight;
291 if(arg2->biHeight < 0)
292 {
293 ((BITMAPINFOHEADER *)arg2)->biHeight = -arg2->biHeight;
294 }
295
296 rc = O32_CreateDIBitmap(arg1, arg2, arg3, arg4, arg5, arg6);
297
298 ((BITMAPINFOHEADER *)arg2)->biHeight = iHeight;
299
300 return rc;
301}
302//******************************************************************************
303//******************************************************************************
304HBITMAP WIN32API CreateCompatibleBitmap( HDC arg1, int arg2, int arg3)
305{
306 dprintf(("GDI32: CreateCompatibleBitmap\n"));
307 return O32_CreateCompatibleBitmap(arg1, arg2, arg3);
308}
309//******************************************************************************
310//******************************************************************************
311HDC WIN32API CreateCompatibleDC( HDC hdc)
312{
313 HDC newHdc;
314
315 newHdc = O32_CreateCompatibleDC(hdc);
316 ULONG oldcp = OSLibGpiQueryCp(hdc);
317 if (!oldcp) /* If new DC is to be created */
318 oldcp = GetDisplayCodepage();
319
320 OSLibGpiSetCp(newHdc, oldcp);
321 dprintf(("CreateCompatibleDC %X returned %x", hdc, newHdc));
322 return newHdc;
323}
324//******************************************************************************
325//******************************************************************************
326INT WIN32API StretchDIBits(HDC hdc, INT xDst, INT yDst, INT widthDst,
327 INT heightDst, INT xSrc, INT ySrc, INT widthSrc,
328 INT heightSrc, const void *bits,
329 const BITMAPINFO *info, UINT wUsage, DWORD dwRop )
330{
331#if 1
332 dprintf(("GDI32: StretchDIBits %x to (%d,%d) (%d,%d) from (%d,%d) (%d,%d), %x %x %x %x", hdc, xDst, yDst, widthDst, heightDst, xSrc, ySrc, widthSrc, heightSrc, bits, info, wUsage, dwRop));
333
334 if(wUsage == DIB_PAL_COLORS && info->bmiHeader.biSize == sizeof(BITMAPINFOHEADER))
335 {
336 // workaround for open32 bug.
337 // If syscolors > 256 and wUsage == DIB_PAL_COLORS.
338
339 int i;
340 USHORT *pColorIndex = (USHORT *)info->bmiColors;
341 RGBQUAD *pColors = (RGBQUAD *) alloca(info->bmiHeader.biClrUsed *
342 sizeof(RGBQUAD));
343 BITMAPINFO *infoLoc = (BITMAPINFO *) alloca(sizeof(BITMAPINFO) +
344 info->bmiHeader.biClrUsed * sizeof(RGBQUAD));
345
346 memcpy(infoLoc, info, sizeof(BITMAPINFO));
347
348 if(GetDIBColorTable(hdc, 0, info->bmiHeader.biClrUsed, pColors) == 0)
349 return FALSE;
350
351 for(i=0;i<info->bmiHeader.biClrUsed;i++, pColorIndex++)
352 {
353 infoLoc->bmiColors[i] = pColors[*pColorIndex];
354 }
355
356 return O32_StretchDIBits(hdc, xDst, yDst, widthDst, heightDst, xSrc, ySrc,
357 widthSrc, heightSrc, (void *)bits,
358 (PBITMAPINFO)infoLoc, DIB_RGB_COLORS, dwRop);
359 }
360
361 return O32_StretchDIBits(hdc, xDst, yDst, widthDst, heightDst, xSrc, ySrc,
362 widthSrc, heightSrc, (void *)bits,
363 (PBITMAPINFO)info, wUsage, dwRop);
364#else
365 dprintf(("GDI32: StretchDIBits\n"));
366 return O32_StretchDIBits(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, (void *)arg10, (PBITMAPINFO)arg11, arg12, arg13);
367#endif
368}
369//******************************************************************************
370//******************************************************************************
371BOOL WIN32API StretchBlt(HDC hdcDest, int nXOriginDest, int nYOriginDest,
372 int nWidthDest, int nHeightDest,
373 HDC hdcSrc, int nXOriginSrc, int nYOriginSrc,
374 int nWidthSrc, int nHeightSrc, DWORD dwRop)
375{
376 dprintf(("GDI32: StretchBlt Dest: (%d, %d) size (%d, %d)\n",
377 nXOriginDest, nYOriginDest, nWidthDest, nHeightDest));
378 dprintf(("GDI32: StretchBlt Src : (%d, %d) size (%d, %d)\n",
379 nXOriginSrc, nYOriginSrc, nWidthSrc, nHeightSrc));
380 if(DIBSection::getSection() != NULL)
381 {
382 DIBSection *dsect = DIBSection::findHDC(hdcSrc);
383 if(dsect)
384 {
385 dprintf((" Do stretched DIB Blt\n"));
386 return(dsect->BitBlt( hdcDest,
387 nXOriginDest, nYOriginDest, nWidthDest, nHeightDest,
388 nXOriginSrc, nYOriginSrc, nWidthSrc, nHeightSrc,
389 dwRop));
390 }
391 }
392 return O32_StretchBlt(hdcDest, nXOriginDest, nYOriginDest, nWidthDest, nHeightDest, hdcSrc, nXOriginSrc, nYOriginSrc, nWidthSrc, nHeightSrc, dwRop);
393}
394//******************************************************************************
395//******************************************************************************
396BOOL WIN32API StrokeAndFillPath( HDC arg1)
397{
398 dprintf(("GDI32: StrokeAndFillPath\n"));
399 return O32_StrokeAndFillPath(arg1);
400}
401//******************************************************************************
402//******************************************************************************
403BOOL WIN32API StrokePath( HDC arg1)
404{
405 dprintf(("GDI32: StrokePath\n"));
406 return O32_StrokePath(arg1);
407}
408//******************************************************************************
409//******************************************************************************
410int WIN32API SetStretchBltMode( HDC arg1, int arg2)
411{
412 dprintf(("GDI32: SetStretchBltMode 0x%08X, 0x%08X\n",arg1, arg2));
413
414 if(DIBSection::getSection() != NULL)
415 {
416 DIBSection *dsect = DIBSection::findHDC(arg1);
417 if(dsect)
418 {
419 dprintf((" - DC is DIBSection\n"));
420 }
421 }
422 return O32_SetStretchBltMode(arg1, arg2);
423}
424//******************************************************************************
425//******************************************************************************
426HGDIOBJ WIN32API SelectObject(HDC hdc, HGDIOBJ hObj)
427{
428 HGDIOBJ rc;
429
430//// dprintf(("GDI32: SelectObject\n"));
431
432 if(DIBSection::getSection() != NULL)
433 {
434 DIBSection *dsect;
435
436 dsect = DIBSection::find(hdc);
437 if(dsect)
438 {
439 //remove previously selected dibsection
440 dsect->UnSelectDIBObject();
441 }
442 dsect = DIBSection::find((DWORD)hObj);
443 if(dsect)
444 {
445 dsect->SelectDIBObject(hdc);
446 }
447 }
448 rc = O32_SelectObject(hdc, hObj);
449 if(rc != 0 && DIBSection::getSection != NULL)
450 {
451 DIBSection *dsect = DIBSection::find((DWORD)rc);
452 if(dsect)
453 {
454 dsect->UnSelectDIBObject();
455 }
456 }
457 return(rc);
458}
459//******************************************************************************
460//******************************************************************************
461HPALETTE WIN32API SelectPalette(HDC arg1, HPALETTE arg2, BOOL arg3)
462{
463 dprintf(("GDI32: SelectPalette (0x%08X, 0x%08X, 0x%08X)\n", arg1, arg2, arg3));
464 if(DIBSection::getSection() != NULL)
465 {
466 DIBSection *dsect = DIBSection::findHDC(arg1);
467 if(dsect)
468 {
469 PALETTEENTRY Pal[256];
470 char PalSize = dsect->GetBitCount();
471 dprintf((" - Set Palette Values in DIBSection\n"));
472 if(PalSize<=8)
473 {
474 GetPaletteEntries( arg2, 0, 1<<PalSize, (LPPALETTEENTRY)&Pal);
475 dsect->SetDIBColorTable(0, 1<< PalSize, (RGBQUAD*)&Pal);
476 }
477
478 }
479 }
480 return O32_SelectPalette(arg1, arg2, arg3);
481}
482//******************************************************************************
483//******************************************************************************
484int WIN32API SetBkMode( HDC arg1, int arg2)
485{
486 dprintf(("GDI32: SetBkMode\n"));
487 return O32_SetBkMode(arg1, arg2);
488}
489//******************************************************************************
490//******************************************************************************
491COLORREF WIN32API GetPixel( HDC arg1, int arg2, int arg3)
492{
493//// dprintf(("GDI32: GetPixel\n"));
494 return O32_GetPixel(arg1, arg2, arg3);
495}
496//******************************************************************************
497//******************************************************************************
498COLORREF WIN32API SetPixel( HDC arg1, int arg2, int arg3, COLORREF arg4)
499{
500//// dprintf(("GDI32: SetPixel\n"));
501 return O32_SetPixel(arg1, arg2, arg3, arg4);
502}
503//******************************************************************************
504//Faster version of SetPixel (since it doesn't need to return the original color)
505//Just use SetPixel for now
506//******************************************************************************
507BOOL WIN32API SetPixelV(HDC arg1, int arg2, int arg3, COLORREF arg4)
508{
509 COLORREF rc;
510
511//// dprintf(("GDI32: SetPixelV\n"));
512 rc = O32_SetPixel(arg1, arg2, arg3, arg4);
513 if(rc == GDI_ERROR) // || rc == COLOR_INVALID)
514 return(FALSE);
515 return(TRUE);
516}
517//******************************************************************************
518//******************************************************************************
519BOOL WIN32API GetDCOrgEx(HDC arg1, PPOINT arg2)
520{
521 dprintf(("GDI32: GetDCOrgEx\n"));
522 return O32_GetDCOrgEx(arg1, arg2);
523}
524//******************************************************************************
525//******************************************************************************
526BOOL WIN32API GetWindowExtEx(HDC arg1, PSIZE arg2)
527{
528 dprintf(("GDI32: GetWindowExtEx\n"));
529 return O32_GetWindowExtEx(arg1, arg2);
530}
531//******************************************************************************
532//******************************************************************************
533int WIN32API AbortDoc( HDC arg1)
534{
535 dprintf(("GDI32: AbortDoc"));
536 return O32_AbortDoc(arg1);
537}
538//******************************************************************************
539//******************************************************************************
540BOOL WIN32API AbortPath( HDC arg1)
541{
542 dprintf(("GDI32: AbortPath"));
543 return O32_AbortPath(arg1);
544}
545//******************************************************************************
546//******************************************************************************
547BOOL WIN32API AngleArc( HDC arg1, int arg2, int arg3, DWORD arg4, float arg5, float arg6)
548{
549 dprintf(("GDI32: AngleArc"));
550 return O32_AngleArc(arg1, arg2, arg3, arg4, arg5, arg6);
551}
552//******************************************************************************
553//******************************************************************************
554BOOL WIN32API AnimatePalette( HPALETTE arg1, UINT arg2, UINT arg3, const PALETTEENTRY * arg4)
555{
556 dprintf(("GDI32: AnimatePalette"));
557 return O32_AnimatePalette(arg1, arg2, arg3, arg4);
558}
559//******************************************************************************
560//******************************************************************************
561BOOL WIN32API Arc( HDC arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8, int arg9)
562{
563 dprintf(("GDI32: Arc"));
564 return O32_Arc(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
565}
566//******************************************************************************
567//******************************************************************************
568BOOL WIN32API ArcTo( HDC arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8, int arg9)
569{
570 dprintf(("GDI32: ArcTo"));
571 return O32_ArcTo(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
572}
573//******************************************************************************
574//******************************************************************************
575BOOL WIN32API BeginPath( HDC arg1)
576{
577 dprintf(("GDI32: BeginPath"));
578 return O32_BeginPath(arg1);
579}
580//******************************************************************************
581//******************************************************************************
582BOOL WIN32API BitBlt(HDC hdcDest, int arg2, int arg3, int arg4, int arg5, HDC hdcSrc, int arg7, int arg8, DWORD arg9)
583{
584 if(DIBSection::getSection() != NULL) {
585 DIBSection *dsect = DIBSection::findHDC(hdcSrc);
586 if(dsect) {
587 return(dsect->BitBlt(hdcDest, arg2, arg3, arg4, arg5, arg7, arg8, arg4, arg5, arg9));
588 }
589 }
590 dprintf(("GDI32: BitBlt to hdc %X from (%d,%d) to (%d,%d), (%d,%d) rop %X\n", hdcDest, arg7, arg8, arg2, arg3, arg4, arg5, arg9));
591 return O32_BitBlt(hdcDest, arg2, arg3, arg4, arg5, hdcSrc, arg7, arg8, arg9);
592}
593//******************************************************************************
594//******************************************************************************
595BOOL WIN32API Chord( HDC arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8, int arg9)
596{
597 dprintf(("GDI32: Chord"));
598 return O32_Chord(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
599}
600//******************************************************************************
601//******************************************************************************
602HENHMETAFILE WIN32API CloseEnhMetaFile( HDC arg1)
603{
604 dprintf(("GDI32: CloseEnhMetaFile"));
605 return O32_CloseEnhMetaFile(arg1);
606}
607//******************************************************************************
608//******************************************************************************
609BOOL WIN32API CloseFigure( HDC arg1)
610{
611 dprintf(("GDI32: CloseFigure"));
612 return O32_CloseFigure(arg1);
613}
614//******************************************************************************
615//******************************************************************************
616HMETAFILE WIN32API CloseMetaFile( HDC arg1)
617{
618 dprintf(("GDI32: CloseMetaFile"));
619 return O32_CloseMetaFile(arg1);
620}
621//******************************************************************************
622//******************************************************************************
623int WIN32API CombineRgn( HRGN arg1, HRGN arg2, HRGN arg3, int arg4)
624{
625 dprintf(("GDI32: CombineRgn"));
626 return O32_CombineRgn(arg1, arg2, arg3, arg4);
627}
628//******************************************************************************
629//******************************************************************************
630HENHMETAFILE WIN32API CopyEnhMetaFileA( HENHMETAFILE arg1, LPCSTR arg2)
631{
632 dprintf(("GDI32: CopyEnhMetaFileA"));
633 return O32_CopyEnhMetaFile(arg1, arg2);
634}
635//******************************************************************************
636//******************************************************************************
637HENHMETAFILE WIN32API CopyEnhMetaFileW( HENHMETAFILE arg1, LPCWSTR arg2)
638{
639 char *astring = UnicodeToAsciiString((LPWSTR)arg2);
640 HENHMETAFILE rc;
641
642 dprintf(("GDI32: CopyEnhMetaFileW"));
643 rc = O32_CopyEnhMetaFile(arg1, astring);
644 FreeAsciiString(astring);
645 return rc;
646}
647//******************************************************************************
648//******************************************************************************
649HMETAFILE WIN32API CopyMetaFileA( HMETAFILE arg1, LPCSTR arg2)
650{
651 dprintf(("GDI32: CopyMetaFileA"));
652 return O32_CopyMetaFile(arg1, arg2);
653}
654//******************************************************************************
655//******************************************************************************
656HMETAFILE WIN32API CopyMetaFileW( HMETAFILE arg1, LPCWSTR arg2)
657{
658 char *astring = UnicodeToAsciiString((LPWSTR)arg2);
659 HMETAFILE rc;
660
661 dprintf(("GDI32: CopyMetaFileW"));
662 rc = O32_CopyMetaFile(arg1, astring);
663 FreeAsciiString(astring);
664 return rc;
665}
666//******************************************************************************
667//******************************************************************************
668HBITMAP WIN32API CreateBitmap(int nWidth, int nHeight, UINT cPlanes,
669 UINT cBitsPerPel, const void *lpvBits)
670{
671 HBITMAP rc;
672
673 rc = O32_CreateBitmap(nWidth, nHeight, cPlanes, cBitsPerPel, lpvBits);
674 dprintf(("GDI32: CreateBitmap (%d,%d) bps %d returned %d\n", nWidth, nHeight, cBitsPerPel, rc));
675 return(rc);
676}
677//******************************************************************************
678//******************************************************************************
679HBITMAP WIN32API CreateBitmapIndirect( const BITMAP * arg1)
680{
681 dprintf(("GDI32: CreateBitmapIndirect"));
682 return O32_CreateBitmapIndirect(arg1);
683}
684//******************************************************************************
685//******************************************************************************
686HBRUSH WIN32API CreateBrushIndirect( const LOGBRUSH * arg1)
687{
688 dprintf(("GDI32: CreateBrushIndirect"));
689 return O32_CreateBrushIndirect((LPLOGBRUSH)arg1);
690}
691//******************************************************************************
692//******************************************************************************
693HDC WIN32API CreateDCA(LPCSTR lpszDriver, LPCSTR lpszDevice, LPCSTR lpszOutput, const DEVMODEA *lpInitData)
694{
695 HDC hdc;
696
697 hdc = O32_CreateDC(lpszDriver, lpszDevice, lpszOutput, lpInitData);
698 dprintf(("GDI32: CreateDCA %s %s %s %x returned %x", lpszDriver, lpszDevice, lpszOutput, lpInitData, hdc));
699 return hdc;
700}
701//******************************************************************************
702//******************************************************************************
703HDC WIN32API CreateDCW( LPCWSTR arg1, LPCWSTR arg2, LPCWSTR arg3, const DEVMODEW * arg4)
704{
705 char *astring4, *astring5;
706
707 char *astring1 = UnicodeToAsciiString((LPWSTR)arg1);
708 char *astring2 = UnicodeToAsciiString((LPWSTR)arg2);
709 char *astring3 = UnicodeToAsciiString((LPWSTR)arg3);
710
711 if(arg4)
712 {
713 astring4 = UnicodeToAsciiString((LPWSTR)(arg4->dmDeviceName));
714 astring5 = UnicodeToAsciiString((LPWSTR)(arg4->dmFormName));
715 }
716
717 HDC rc;
718 DEVMODEA devmode;
719
720 dprintf(("GDI32: CreateDCW"));
721
722 if(arg4)
723 {
724 strcpy((char*)devmode.dmDeviceName, astring4);
725 strcpy((char*)devmode.dmFormName, astring5);
726
727 devmode.dmSpecVersion = arg4->dmSpecVersion;
728 devmode.dmDriverVersion = arg4->dmDriverVersion;
729 devmode.dmSize = arg4->dmSize;
730 devmode.dmDriverExtra = arg4->dmDriverExtra;
731 devmode.dmFields = arg4->dmFields;
732 devmode.dmOrientation = arg4->dmOrientation;
733 devmode.dmPaperSize = arg4->dmPaperSize;
734 devmode.dmPaperLength = arg4->dmPaperLength;
735 devmode.dmPaperWidth = arg4->dmPaperWidth;
736 devmode.dmScale = arg4->dmScale;
737 devmode.dmCopies = arg4->dmCopies;
738 devmode.dmDefaultSource = arg4->dmDefaultSource;
739 devmode.dmPrintQuality = arg4->dmPrintQuality;
740 devmode.dmColor = arg4->dmColor;
741 devmode.dmDuplex = arg4->dmDuplex;
742 devmode.dmYResolution = arg4->dmYResolution;
743 devmode.dmTTOption = arg4->dmTTOption;
744 devmode.dmCollate = arg4->dmCollate;
745 devmode.dmLogPixels = arg4->dmLogPixels;
746 devmode.dmBitsPerPel = arg4->dmBitsPerPel;
747 devmode.dmPelsWidth = arg4->dmPelsWidth;
748 devmode.dmPelsHeight = arg4->dmPelsHeight;
749 devmode.dmDisplayFlags = arg4->dmDisplayFlags;
750 devmode.dmDisplayFrequency = arg4->dmDisplayFrequency;
751 devmode.dmICMMethod = arg4->dmICMMethod;
752 devmode.dmICMIntent = arg4->dmICMIntent;
753 devmode.dmMediaType = arg4->dmMediaType;
754 devmode.dmDitherType = arg4->dmDitherType;
755 devmode.dmReserved1 = arg4->dmReserved1;
756 devmode.dmReserved2 = arg4->dmReserved2;
757 rc = O32_CreateDC(astring1,astring2,astring3,&devmode);
758 }
759 else
760 rc = O32_CreateDC(astring1,astring2,astring3, NULL);
761
762 FreeAsciiString(astring1);
763 FreeAsciiString(astring2);
764 FreeAsciiString(astring3);
765
766 if(arg4)
767 {
768 FreeAsciiString(astring4);
769 FreeAsciiString(astring5);
770 }
771
772 return rc;
773}
774//******************************************************************************
775//******************************************************************************
776HRGN WIN32API CreateEllipticRgn( int arg1, int arg2, int arg3, int arg4)
777{
778 dprintf(("GDI32: CreateEllipticRgn"));
779 return O32_CreateEllipticRgn(arg1, arg2, arg3, arg4);
780}
781//******************************************************************************
782//******************************************************************************
783HRGN WIN32API CreateEllipticRgnIndirect( const RECT * arg1)
784{
785 dprintf(("GDI32: CreateEllipticRgnIndirect"));
786 return O32_CreateEllipticRgnIndirect(arg1);
787}
788//******************************************************************************
789//******************************************************************************
790HENHMETAFILE WIN32API CreateEnhMetaFileA( HDC arg1, LPCSTR arg2, const RECT * arg3, LPCSTR arg4)
791{
792 dprintf(("GDI32: CreateEnhMetaFileA"));
793 return O32_CreateEnhMetaFile(arg1, arg2, arg3, arg4);
794}
795//******************************************************************************
796//******************************************************************************
797HENHMETAFILE WIN32API CreateEnhMetaFileW( HDC arg1, LPCWSTR arg2, const RECT * arg3, LPCWSTR arg4)
798{
799 char *astring1 = UnicodeToAsciiString((LPWSTR)arg2);
800 char *astring2 = UnicodeToAsciiString((LPWSTR)arg4);
801 HENHMETAFILE rc;
802
803 dprintf(("GDI32: CreateMetaFileW"));
804 rc = O32_CreateEnhMetaFile(arg1,astring1,arg3,astring2);
805 FreeAsciiString(astring1);
806 FreeAsciiString(astring2);
807 return rc;
808}
809//******************************************************************************
810//******************************************************************************
811//******************************************************************************
812//******************************************************************************
813HBRUSH WIN32API CreateHatchBrush( int arg1, COLORREF arg2)
814{
815 dprintf(("GDI32: CreateHatchBrush"));
816 return O32_CreateHatchBrush(arg1, arg2);
817}
818//******************************************************************************
819//******************************************************************************
820HDC WIN32API CreateICA( LPCSTR arg1, LPCSTR arg2, LPCSTR arg3, const DEVMODEA * arg4)
821{
822 dprintf(("GDI32: CreateICA"));
823 return O32_CreateIC(arg1, arg2, arg3, arg4);
824}
825//******************************************************************************
826//******************************************************************************
827HDC WIN32API CreateICW( LPCWSTR arg1, LPCWSTR arg2, LPCWSTR arg3, const DEVMODEW * arg4)
828{
829 char *astring4, *astring5;
830
831 char *astring1 = UnicodeToAsciiString((LPWSTR)arg1);
832 char *astring2 = UnicodeToAsciiString((LPWSTR)arg2);
833 char *astring3 = UnicodeToAsciiString((LPWSTR)arg3);
834 if(arg4)
835 {
836 astring4 = UnicodeToAsciiString((LPWSTR)(arg4->dmDeviceName));
837 astring5 = UnicodeToAsciiString((LPWSTR)(arg4->dmFormName));
838 }
839
840 HDC rc;
841 DEVMODEA devmode;
842
843 dprintf(("GDI32: CreateICW"));
844
845 if(arg4)
846 {
847 strcpy((char*)devmode.dmDeviceName, astring4);
848 strcpy((char*)devmode.dmFormName, astring5);
849
850 devmode.dmSpecVersion = arg4->dmSpecVersion;
851 devmode.dmDriverVersion = arg4->dmDriverVersion;
852 devmode.dmSize = arg4->dmSize;
853 devmode.dmDriverExtra = arg4->dmDriverExtra;
854 devmode.dmFields = arg4->dmFields;
855 devmode.dmOrientation = arg4->dmOrientation;
856 devmode.dmPaperSize = arg4->dmPaperSize;
857 devmode.dmPaperLength = arg4->dmPaperLength;
858 devmode.dmPaperWidth = arg4->dmPaperWidth;
859 devmode.dmScale = arg4->dmScale;
860 devmode.dmCopies = arg4->dmCopies;
861 devmode.dmDefaultSource = arg4->dmDefaultSource;
862 devmode.dmPrintQuality = arg4->dmPrintQuality;
863 devmode.dmColor = arg4->dmColor;
864 devmode.dmDuplex = arg4->dmDuplex;
865 devmode.dmYResolution = arg4->dmYResolution;
866 devmode.dmTTOption = arg4->dmTTOption;
867 devmode.dmCollate = arg4->dmCollate;
868 devmode.dmLogPixels = arg4->dmLogPixels;
869 devmode.dmBitsPerPel = arg4->dmBitsPerPel;
870 devmode.dmPelsWidth = arg4->dmPelsWidth;
871 devmode.dmPelsHeight = arg4->dmPelsHeight;
872 devmode.dmDisplayFlags = arg4->dmDisplayFlags;
873 devmode.dmDisplayFrequency = arg4->dmDisplayFrequency;
874 devmode.dmICMMethod = arg4->dmICMMethod;
875 devmode.dmICMIntent = arg4->dmICMIntent;
876 devmode.dmMediaType = arg4->dmMediaType;
877 devmode.dmDitherType = arg4->dmDitherType;
878 devmode.dmReserved1 = arg4->dmReserved1;
879 devmode.dmReserved2 = arg4->dmReserved2;
880
881 rc = O32_CreateIC(astring1,astring2,astring3,&devmode);
882 }
883 else
884 rc = O32_CreateIC(astring1,astring2,astring3, NULL);
885
886 FreeAsciiString(astring1);
887 FreeAsciiString(astring2);
888 FreeAsciiString(astring3);
889 if(arg4)
890 {
891 FreeAsciiString(astring4);
892 FreeAsciiString(astring5);
893 }
894
895 return rc;
896}
897//******************************************************************************
898//******************************************************************************
899HDC WIN32API CreateMetaFileA( LPCSTR arg1)
900{
901 dprintf(("GDI32: CreateMetaFileA"));
902 return O32_CreateMetaFile(arg1);
903}
904//******************************************************************************
905//******************************************************************************
906HDC WIN32API CreateMetaFileW( LPCWSTR arg1)
907{
908 char *astring = UnicodeToAsciiString((LPWSTR)arg1);
909 HDC rc;
910
911 dprintf(("GDI32: CreateMetaFileW"));
912 rc = O32_CreateMetaFile(astring);
913 FreeAsciiString(astring);
914 return rc;
915}
916//******************************************************************************
917//******************************************************************************
918HRGN WIN32API CreateRectRgn( int nLeftRect, int nTopRect, int nRightRect, int nBottomRect)
919{
920 dprintf(("GDI32: CreateRectRgn (%d,%d)(%d,%d)", nLeftRect, nTopRect, nRightRect, nBottomRect));
921 return O32_CreateRectRgn(nLeftRect, nTopRect, nRightRect, nBottomRect);
922}
923//******************************************************************************
924//******************************************************************************
925HRGN WIN32API CreateRectRgnIndirect( const RECT * lpRect)
926{
927 if(lpRect == NULL) {
928 SetLastError(ERROR_INVALID_PARAMETER);
929 return 0;
930 }
931 dprintf(("GDI32: CreateRectRgnIndirect (%d,%d)(%d,%d)", lpRect->left, lpRect->top, lpRect->right, lpRect->bottom));
932 return O32_CreateRectRgnIndirect(lpRect);
933}
934//******************************************************************************
935//******************************************************************************
936HRGN WIN32API CreateRoundRectRgn(int nLeftRect, int nTopRect, int nRightRect, int nBottomRect,
937 int nWidthEllipse, int nHeightEllipse)
938{
939 dprintf(("GDI32: CreateRoundRectRgn (%d,%d)(%d,%d) (%d,%d)", nLeftRect, nTopRect, nRightRect, nBottomRect, nWidthEllipse, nHeightEllipse));
940 return O32_CreateRoundRectRgn(nLeftRect, nTopRect, nRightRect, nBottomRect, nWidthEllipse, nHeightEllipse);
941}
942//******************************************************************************
943//******************************************************************************
944HBRUSH WIN32API CreateSolidBrush( COLORREF arg1)
945{
946 dprintf(("GDI32: CreateSolidBrush\n"));
947 return O32_CreateSolidBrush(arg1);
948}
949//******************************************************************************
950//******************************************************************************
951BOOL WIN32API DPtoLP( HDC arg1, PPOINT arg2, int arg3)
952{
953 dprintf(("GDI32: DPtoLP\n"));
954 return O32_DPtoLP(arg1, arg2, arg3);
955}
956//******************************************************************************
957//******************************************************************************
958BOOL WIN32API DeleteEnhMetaFile( HENHMETAFILE arg1)
959{
960 dprintf(("GDI32: DeleteEnhMetaFile\n"));
961 return O32_DeleteEnhMetaFile(arg1);
962}
963//******************************************************************************
964//******************************************************************************
965BOOL WIN32API DeleteMetaFile( HMETAFILE arg1)
966{
967 dprintf(("GDI32: DeleteMetaFile"));
968 return O32_DeleteMetaFile(arg1);
969}
970//******************************************************************************
971//******************************************************************************
972BOOL WIN32API Ellipse( HDC arg1, int arg2, int arg3, int arg4, int arg5)
973{
974 dprintf(("GDI32: Ellipse"));
975 return O32_Ellipse(arg1, arg2, arg3, arg4, arg5);
976}
977//******************************************************************************
978//******************************************************************************
979int WIN32API EndDoc( HDC arg1)
980{
981 dprintf(("GDI32: EndDoc"));
982 return O32_EndDoc(arg1);
983}
984//******************************************************************************
985//******************************************************************************
986int WIN32API EndPage( HDC arg1)
987{
988 dprintf(("GDI32: EndPage"));
989 return O32_EndPage(arg1);
990}
991//******************************************************************************
992//******************************************************************************
993BOOL WIN32API EndPath( HDC arg1)
994{
995 dprintf(("GDI32: EndPath"));
996 return O32_EndPath(arg1);
997}
998//******************************************************************************
999//******************************************************************************
1000BOOL WIN32API EnumEnhMetaFile( HDC arg1, HENHMETAFILE arg2, ENHMFENUMPROC arg3, PVOID arg4, const RECT * arg5)
1001{
1002 dprintf(("GDI32: EnumEnhMetaFile DOESN'T WORK!"));
1003// return O32_EnumEnhMetaFile(arg1, arg2, arg3, arg4, arg5);
1004 return 0;
1005}
1006//******************************************************************************
1007//******************************************************************************
1008BOOL WIN32API PatBlt(HDC hdc,int nXLeft,int nYLeft,int nWidth,int nHeight,DWORD dwRop)
1009{
1010 BOOL rc;
1011
1012 //CB: Open32 bug: negative width/height not supported!
1013 if (nWidth < 0)
1014 {
1015 nXLeft += nWidth+1;
1016 nWidth = -nWidth;
1017 }
1018 if (nHeight < 0)
1019 {
1020 nYLeft += nHeight+1;
1021 nHeight = -nHeight;
1022 }
1023 rc = O32_PatBlt(hdc,nXLeft,nYLeft,nWidth,nHeight,dwRop);
1024 dprintf(("GDI32: PatBlt (%d,%d) (%d,%d) returned %d\n",nXLeft,nYLeft,nWidth,nHeight,rc));
1025 return(rc);
1026}
1027//******************************************************************************
1028//******************************************************************************
1029BOOL WIN32API Rectangle( HDC arg1, int arg2, int arg3, int arg4, int arg5)
1030{
1031 dprintf(("GDI32: Rectangle\n"));
1032 return O32_Rectangle(arg1, arg2, arg3, arg4, arg5);
1033}
1034//******************************************************************************
1035//******************************************************************************
1036int WIN32API SetROP2( HDC hdc, int rop2)
1037{
1038 dprintf(("GDI32: SetROP2 %x %x", hdc, rop2));
1039 return O32_SetROP2(hdc, rop2);
1040}
1041//******************************************************************************
1042//TODO: Callback
1043//******************************************************************************
1044BOOL WIN32API EnumMetaFile( HDC arg1, HMETAFILE arg2, MFENUMPROC arg3, LPARAM arg4)
1045{
1046 dprintf(("GDI32: EnumMetaFile STUB"));
1047 //calling convention differences
1048// return O32_EnumMetaFile(arg1, arg2, arg3, arg4);
1049 return 0;
1050}
1051//******************************************************************************
1052//******************************************************************************
1053int WIN32API EnumObjects( HDC arg1, int arg2, GOBJENUMPROC arg3, LPARAM arg4)
1054{
1055 dprintf(("GDI32: EnumObjects STUB"));
1056 //calling convention differences
1057// return O32_EnumObjects(arg1, arg2, arg3, arg4);
1058 return 0;
1059}
1060//******************************************************************************
1061//******************************************************************************
1062BOOL WIN32API EqualRgn( HRGN arg1, HRGN arg2)
1063{
1064 dprintf(("GDI32: EqualRgn"));
1065 return O32_EqualRgn(arg1, arg2);
1066}
1067//******************************************************************************
1068//******************************************************************************
1069int WIN32API Escape( HDC arg1, int arg2, int arg3, LPCSTR arg4, PVOID arg5)
1070{
1071 dprintf(("GDI32: Escape"));
1072 return O32_Escape(arg1, arg2, arg3, arg4, arg5);
1073}
1074//******************************************************************************
1075//******************************************************************************
1076int WIN32API ExcludeClipRect( HDC arg1, int arg2, int arg3, int arg4, int arg5)
1077{
1078 dprintf(("GDI32: ExcludeClipRect"));
1079 return O32_ExcludeClipRect(arg1, arg2, arg3, arg4, arg5);
1080}
1081//******************************************************************************
1082//******************************************************************************
1083HPEN WIN32API ExtCreatePen( DWORD arg1, DWORD arg2, const LOGBRUSH * arg3, DWORD arg4, const DWORD * arg5)
1084{
1085 dprintf(("GDI32: ExtCreatePen"));
1086 return O32_ExtCreatePen(arg1, arg2, arg3, arg4, arg5);
1087}
1088//******************************************************************************
1089//******************************************************************************
1090HRGN WIN32API ExtCreateRegion( const XFORM * arg1, DWORD arg2, const RGNDATA * arg3)
1091{
1092 dprintf(("GDI32: ExtCreateRegion"));
1093 return O32_ExtCreateRegion(arg1, arg2, arg3);
1094}
1095//******************************************************************************
1096//******************************************************************************
1097BOOL WIN32API ExtFloodFill( HDC arg1, int arg2, int arg3, COLORREF arg4, UINT arg5)
1098{
1099 dprintf(("GDI32: ExtFloodFill"));
1100 return O32_ExtFloodFill(arg1, arg2, arg3, arg4, arg5);
1101}
1102//******************************************************************************
1103//******************************************************************************
1104int WIN32API ExtSelectClipRgn( HDC arg1, HRGN arg2, int arg3)
1105{
1106 dprintf(("GDI32: ExtSelectClipRgn"));
1107 return O32_ExtSelectClipRgn(arg1, arg2, arg3);
1108}
1109//******************************************************************************
1110//******************************************************************************
1111BOOL WIN32API FillPath( HDC arg1)
1112{
1113 dprintf(("GDI32: FillPath"));
1114 return O32_FillPath(arg1);
1115}
1116//******************************************************************************
1117//******************************************************************************
1118BOOL WIN32API FillRgn( HDC arg1, HRGN arg2, HBRUSH arg3)
1119{
1120 dprintf(("GDI32: FillRgn"));
1121 return O32_FillRgn(arg1, arg2, arg3);
1122}
1123//******************************************************************************
1124//******************************************************************************
1125BOOL WIN32API FlattenPath( HDC arg1)
1126{
1127 dprintf(("GDI32: FlattenPath"));
1128 return O32_FlattenPath(arg1);
1129}
1130//******************************************************************************
1131//******************************************************************************
1132BOOL WIN32API FloodFill(HDC arg1, int arg2, int arg3, COLORREF arg4)
1133{
1134 dprintf(("GDI32: FloodFill"));
1135 return O32_FloodFill(arg1, arg2, arg3, arg4);
1136}
1137//******************************************************************************
1138//******************************************************************************
1139BOOL WIN32API FrameRgn( HDC arg1, HRGN arg2, HBRUSH arg3, int arg4, int arg5)
1140{
1141 dprintf(("GDI32: FrameRgn"));
1142 return O32_FrameRgn(arg1, arg2, arg3, arg4, arg5);
1143}
1144//******************************************************************************
1145//******************************************************************************
1146int WIN32API GetArcDirection( HDC arg1)
1147{
1148 dprintf(("GDI32: GetArcDirection"));
1149 return O32_GetArcDirection(arg1);
1150}
1151//******************************************************************************
1152//******************************************************************************
1153BOOL WIN32API GetAspectRatioFilterEx( HDC arg1, PSIZE arg2)
1154{
1155 dprintf(("GDI32: GetAspectRatioFilterEx"));
1156 return O32_GetAspectRatioFilterEx(arg1, arg2);
1157}
1158//******************************************************************************
1159//******************************************************************************
1160LONG WIN32API GetBitmapBits( HBITMAP arg1, LONG arg2, PVOID arg3)
1161{
1162 dprintf(("GDI32: GetBitmapBits"));
1163 return O32_GetBitmapBits(arg1, arg2, arg3);
1164}
1165//******************************************************************************
1166//******************************************************************************
1167BOOL WIN32API GetBitmapDimensionEx( HBITMAP arg1, PSIZE arg2)
1168{
1169 dprintf(("GDI32: GetBitmapDimensionEx"));
1170 return O32_GetBitmapDimensionEx(arg1, arg2);
1171}
1172//******************************************************************************
1173//******************************************************************************
1174COLORREF WIN32API GetBkColor( HDC arg1)
1175{
1176 dprintf(("GDI32: GetBkColor"));
1177 return O32_GetBkColor(arg1);
1178}
1179//******************************************************************************
1180//******************************************************************************
1181int WIN32API GetBkMode( HDC arg1)
1182{
1183 dprintf(("GDI32: GetBkMode"));
1184 return O32_GetBkMode(arg1);
1185}
1186//******************************************************************************
1187//******************************************************************************
1188UINT WIN32API GetBoundsRect( HDC arg1, PRECT arg2, UINT arg3)
1189{
1190 dprintf(("GDI32: GetBoundsRect"));
1191 return O32_GetBoundsRect(arg1, arg2, arg3);
1192}
1193//******************************************************************************
1194//******************************************************************************
1195BOOL WIN32API GetBrushOrgEx( HDC arg1, PPOINT arg2)
1196{
1197 dprintf(("GDI32: GetBrushOrgEx"));
1198 return O32_GetBrushOrgEx(arg1, arg2);
1199}
1200//******************************************************************************
1201//******************************************************************************
1202BOOL WIN32API GetCharABCWidthsA( HDC arg1, UINT arg2, UINT arg3, LPABC arg4)
1203{
1204 dprintf(("GDI32: GetCharABCWidthsA"));
1205 return O32_GetCharABCWidths(arg1, arg2, arg3, arg4);
1206}
1207//******************************************************************************
1208//******************************************************************************
1209BOOL WIN32API GetCharABCWidthsW( HDC arg1, UINT arg2, UINT arg3, LPABC arg4)
1210{
1211 dprintf(("GDI32: GetCharABCWidthsW not properly implemented."));
1212 // NOTE: This will not work as is (needs UNICODE support)
1213 return O32_GetCharABCWidths(arg1, arg2, arg3, arg4);
1214}
1215//******************************************************************************
1216//******************************************************************************
1217BOOL WIN32API GetCharWidthA( HDC arg1, UINT arg2, UINT arg3, PINT arg4)
1218{
1219 dprintf(("GDI32: GetCharWidthA"));
1220 return O32_GetCharWidth(arg1, arg2, arg3, arg4);
1221}
1222//******************************************************************************
1223//TODO: Cut off Unicode chars?
1224//******************************************************************************
1225BOOL WIN32API GetCharWidthW(HDC arg1, UINT iFirstChar, UINT iLastChar, PINT arg4)
1226{
1227 dprintf(("GDI32: GetCharWidthW, not properly implemented"));
1228 return O32_GetCharWidth(arg1, iFirstChar, iLastChar, arg4);
1229}
1230//******************************************************************************
1231//******************************************************************************
1232int WIN32API GetClipBox( HDC arg1, PRECT arg2)
1233{
1234 int rc;
1235
1236 rc = O32_GetClipBox(arg1, arg2);
1237 dprintf(("GDI32: GetClipBox of %X returned %d\n", arg1, rc));
1238 return(rc);
1239}
1240//******************************************************************************
1241//******************************************************************************
1242int WIN32API GetClipRgn( HDC arg1, HRGN arg2)
1243{
1244 dprintf(("GDI32: GetClipRgn"));
1245 return O32_GetClipRgn(arg1, arg2);
1246}
1247//******************************************************************************
1248//******************************************************************************
1249HANDLE WIN32API GetCurrentObject( HDC hdc, UINT arg2)
1250{
1251 dprintf(("GDI32: GetCurrentObject %x %x", hdc, arg2));
1252 return (HANDLE)O32_GetCurrentObject(hdc, arg2);
1253}
1254//******************************************************************************
1255//******************************************************************************
1256BOOL WIN32API GetCurrentPositionEx( HDC arg1, PPOINT arg2)
1257{
1258 dprintf(("GDI32: GetCurrentPositionEx"));
1259 return O32_GetCurrentPositionEx(arg1, arg2);
1260}
1261//******************************************************************************
1262//******************************************************************************
1263int WIN32API GetDIBits(HDC hdc, HBITMAP hBitmap, UINT uStartScan, UINT cScanLines,
1264 void *lpvBits, PBITMAPINFO lpbi, UINT uUsage)
1265{
1266#if 1
1267 dprintf(("GDI32: GetDIBits"));
1268 return O32_GetDIBits(hdc, hBitmap, uStartScan, cScanLines, lpvBits, lpbi, uUsage);
1269#else
1270 int rc;
1271
1272 rc = O32_GetDIBits(hdc, hBitmap, uStartScan, cScanLines, lpvBits, lpbi, uUsage);
1273 dprintf(("GDI32: GetDIBits %x %x %d %d %x %x %d returned %d", hdc, hBitmap, uStartScan, cScanLines, lpvBits, lpbi, uUsage, rc));
1274 //SvL: Wrong Open32 return value
1275 return (rc == TRUE) ? cScanLines : 0;
1276#endif
1277}
1278//******************************************************************************
1279//******************************************************************************
1280int WIN32API GetDeviceCaps(HDC hdc, int nIndex)
1281{
1282 int rc;
1283
1284 rc = O32_GetDeviceCaps(hdc, nIndex);
1285 dprintf(("GDI32: GetDeviceCaps %X, %d returned %d\n", hdc, nIndex, rc));
1286 //SvL: 13-9-'98: NT returns -1 when using 16 bits colors, NOT 65536!
1287 if(nIndex == NUMCOLORS && rc > 256)
1288 return -1;
1289 return(rc);
1290}
1291//******************************************************************************
1292//******************************************************************************
1293HENHMETAFILE WIN32API GetEnhMetaFileA( LPCSTR arg1)
1294{
1295 dprintf(("GDI32: GetEnhMetaFileA"));
1296 return O32_GetEnhMetaFile(arg1);
1297}
1298//******************************************************************************
1299//******************************************************************************
1300UINT WIN32API GetEnhMetaFileBits( HENHMETAFILE arg1, UINT arg2, PBYTE arg3)
1301{
1302 dprintf(("GDI32: GetEnhMetaFileBits"));
1303 return O32_GetEnhMetaFileBits(arg1, arg2, arg3);
1304}
1305//******************************************************************************
1306//******************************************************************************
1307UINT WIN32API GetEnhMetaFileHeader( HENHMETAFILE arg1, UINT arg2, LPENHMETAHEADER arg3)
1308{
1309 dprintf(("GDI32: GetEnhMetaFileHeader"));
1310 return O32_GetEnhMetaFileHeader(arg1, arg2, arg3);
1311}
1312//******************************************************************************
1313//******************************************************************************
1314UINT WIN32API GetEnhMetaFilePaletteEntries( HENHMETAFILE arg1, UINT arg2, PPALETTEENTRY arg3)
1315{
1316 dprintf(("GDI32: GetEnhMetaFilePaletteEntries"));
1317 return O32_GetEnhMetaFilePaletteEntries(arg1, arg2, arg3);
1318}
1319//******************************************************************************
1320//******************************************************************************
1321HENHMETAFILE WIN32API GetEnhMetaFileW( LPCWSTR arg1)
1322{
1323 char *astring = UnicodeToAsciiString((LPWSTR)arg1);
1324 HENHMETAFILE rc;
1325
1326 dprintf(("GDI32: GetEnhMetaFileW"));
1327 // NOTE: This will not work as is (needs UNICODE support)
1328 rc = O32_GetEnhMetaFile(astring);
1329 FreeAsciiString(astring);
1330 return rc;
1331}
1332//******************************************************************************
1333//******************************************************************************
1334int WIN32API GetGraphicsMode(HDC arg1)
1335{
1336 dprintf(("GDI32: GetGraphicsMode"));
1337 return O32_GetGraphicsMode(arg1);
1338}
1339//******************************************************************************
1340//******************************************************************************
1341DWORD WIN32API GetKerningPairsA( HDC arg1, DWORD arg2, LPKERNINGPAIR arg3)
1342{
1343 dprintf(("GDI32: GetKerningPairsA"));
1344 return O32_GetKerningPairs(arg1, arg2, arg3);
1345}
1346//******************************************************************************
1347//******************************************************************************
1348DWORD WIN32API GetKerningPairsW( HDC arg1, DWORD arg2, LPKERNINGPAIR arg3)
1349{
1350 dprintf(("GDI32: GetKerningPairsW"));
1351 // NOTE: This will not work as is (needs UNICODE support)
1352 return O32_GetKerningPairs(arg1, arg2, arg3);
1353}
1354//******************************************************************************
1355//******************************************************************************
1356int WIN32API GetMapMode( HDC arg1)
1357{
1358 dprintf(("GDI32: GetMapMode"));
1359 return O32_GetMapMode(arg1);
1360}
1361//******************************************************************************
1362//******************************************************************************
1363HMETAFILE WIN32API GetMetaFileA( LPCSTR arg1)
1364{
1365 dprintf(("GDI32: GetMetaFileA"));
1366 return O32_GetMetaFile(arg1);
1367}
1368//******************************************************************************
1369//******************************************************************************
1370UINT WIN32API GetMetaFileBitsEx( HMETAFILE arg1, UINT arg2, LPVOID arg3)
1371{
1372 dprintf(("GDI32: GetMetaFileBitsEx"));
1373 return O32_GetMetaFileBitsEx(arg1, arg2, arg3);
1374}
1375//******************************************************************************
1376//******************************************************************************
1377HMETAFILE WIN32API GetMetaFileW( LPCWSTR arg1)
1378{
1379 char *astring = UnicodeToAsciiString((LPWSTR)arg1);
1380 HENHMETAFILE rc;
1381
1382 dprintf(("GDI32: GetMetaFileW"));
1383 rc = O32_GetMetaFile(astring);
1384 FreeAsciiString(astring);
1385 return rc;
1386
1387}
1388//******************************************************************************
1389//******************************************************************************
1390BOOL WIN32API GetMiterLimit( HDC arg1, float * arg2)
1391{
1392 dprintf(("GDI32: GetMiterLimit"));
1393 return O32_GetMiterLimit(arg1, arg2);
1394}
1395//******************************************************************************
1396//******************************************************************************
1397COLORREF WIN32API GetNearestColor( HDC arg1, COLORREF arg2)
1398{
1399 dprintf(("GDI32: GetNearestColor\n"));
1400 return O32_GetNearestColor(arg1, arg2);
1401}
1402//******************************************************************************
1403//******************************************************************************
1404UINT WIN32API GetNearestPaletteIndex( HPALETTE arg1, COLORREF arg2)
1405{
1406 UINT rc;
1407 dprintf(("GDI32: GetNearestPaletteIndex (0x%08X ,0x%08X) ",arg1,arg2));
1408 rc = O32_GetNearestPaletteIndex(arg1, arg2);
1409 dprintf(("Returns %d\n",rc));
1410 return rc;
1411}
1412//******************************************************************************
1413//******************************************************************************
1414UINT WIN32API GetOutlineTextMetricsA( HDC arg1, UINT arg2, LPOUTLINETEXTMETRICA arg3)
1415{
1416 dprintf(("GDI32: GetOutlineTextMetricsA"));
1417 return O32_GetOutlineTextMetrics(arg1, arg2, arg3);
1418}
1419//******************************************************************************
1420//******************************************************************************
1421UINT WIN32API GetOutlineTextMetricsW( HDC arg1, UINT arg2, LPOUTLINETEXTMETRICW arg3)
1422{
1423 dprintf(("GDI32: GetOutlineTextMetricsW STUB"));
1424 // NOTE: This will not work as is (needs UNICODE support)
1425// return O32_GetOutlineTextMetrics(arg1, arg2, arg3);
1426 return 0;
1427}
1428//******************************************************************************
1429//******************************************************************************
1430UINT WIN32API GetPaletteEntries( HPALETTE arg1, UINT arg2, UINT arg3, PPALETTEENTRY arg4)
1431{
1432 dprintf(("GDI32: GetPaletteEntries"));
1433 return O32_GetPaletteEntries(arg1, arg2, arg3, arg4);
1434}
1435//******************************************************************************
1436//******************************************************************************
1437INT WIN32API GetPath( HDC arg1, PPOINT arg2, PBYTE arg3, int arg4)
1438{
1439 dprintf(("GDI32: GetPath"));
1440 return O32_GetPath(arg1, arg2, arg3, arg4);
1441}
1442//******************************************************************************
1443//******************************************************************************
1444int WIN32API GetPolyFillMode( HDC arg1)
1445{
1446 dprintf(("GDI32: GetPolyFillMode"));
1447 return O32_GetPolyFillMode(arg1);
1448}
1449//******************************************************************************
1450//******************************************************************************
1451int WIN32API GetROP2( HDC arg1)
1452{
1453 dprintf(("GDI32: GetROP2"));
1454 return O32_GetROP2(arg1);
1455}
1456//******************************************************************************
1457//******************************************************************************
1458BOOL WIN32API GetRasterizerCaps(LPRASTERIZER_STATUS arg1, UINT arg2)
1459{
1460 dprintf(("GDI32: GetRasterizerCaps"));
1461 return O32_GetRasterizerCaps(arg1, arg2);
1462}
1463//******************************************************************************
1464//******************************************************************************
1465DWORD WIN32API GetRegionData( HRGN arg1, DWORD arg2, PRGNDATA arg3)
1466{
1467 dprintf(("GDI32: GetRegionData"));
1468 return O32_GetRegionData(arg1, arg2, arg3);
1469}
1470//******************************************************************************
1471//******************************************************************************
1472int WIN32API GetRgnBox( HRGN arg1, PRECT arg2)
1473{
1474 dprintf(("GDI32: GetRgnBox"));
1475 return O32_GetRgnBox(arg1, arg2);
1476}
1477//******************************************************************************
1478//******************************************************************************
1479int WIN32API GetStretchBltMode( HDC arg1)
1480{
1481 dprintf(("GDI32: GetStretchBltMode"));
1482 return O32_GetStretchBltMode(arg1);
1483}
1484//******************************************************************************
1485//******************************************************************************
1486UINT WIN32API GetSystemPaletteEntries( HDC arg1, UINT arg2, UINT arg3, PPALETTEENTRY arg4)
1487{
1488 UINT rc;
1489
1490 dprintf(("GDI32: GetSystemPaletteEntries start %d nr %d pal ptr %X", arg2, arg3, arg4));
1491 rc = O32_GetSystemPaletteEntries(arg1, arg2, arg3, arg4);
1492 dprintf((" GetSystemPaletteEntries returned %d", rc));
1493 return(rc);
1494}
1495//******************************************************************************
1496//******************************************************************************
1497UINT WIN32API GetTextAlign( HDC arg1)
1498{
1499 dprintf(("GDI32: GetTextAlign"));
1500 return O32_GetTextAlign(arg1);
1501}
1502//******************************************************************************
1503//******************************************************************************
1504int WIN32API GetTextCharacterExtra( HDC arg1)
1505{
1506 dprintf(("GDI32: GetTextCharacterExtra"));
1507 return O32_GetTextCharacterExtra(arg1);
1508}
1509//******************************************************************************
1510//******************************************************************************
1511COLORREF WIN32API GetTextColor( HDC arg1)
1512{
1513 dprintf(("GDI32: GetTextColor"));
1514 return O32_GetTextColor(arg1);
1515}
1516//******************************************************************************
1517//******************************************************************************
1518BOOL WIN32API GetTextExtentPoint32A( HDC hdc, LPCSTR lpsz, int cbString, PSIZE lpSize)
1519{
1520 BOOL rc;
1521
1522 lpSize->cx = lpSize->cy = 0;
1523 rc = O32_GetTextExtentPoint32(hdc, lpsz, cbString, lpSize);
1524 dprintf(("GDI32: GetTextExtentPoint32A %x %s %d returned %d (%d,%d)", hdc, lpsz, cbString, rc, lpSize->cx, lpSize->cy));
1525 return rc;
1526}
1527//******************************************************************************
1528//******************************************************************************
1529BOOL WIN32API GetTextExtentPoint32W(HDC arg1, LPCWSTR arg2, int arg3, PSIZE lpSize)
1530{
1531 char *astring = UnicodeToAsciiString((LPWSTR)arg2);
1532 BOOL rc;
1533
1534 dprintf(("GDI32: GetTextExtentPoint32W %s\n", astring));
1535 lpSize->cx = lpSize->cy = 0;
1536 rc = O32_GetTextExtentPoint32(arg1, astring, arg3, lpSize);
1537 FreeAsciiString(astring);
1538 return(rc);
1539}
1540//******************************************************************************
1541//******************************************************************************
1542BOOL WIN32API GetTextExtentPointW(HDC hdc,
1543 LPCWSTR lpString,
1544 int cbString,
1545 PSIZE lpSize)
1546{
1547 char *astring = UnicodeToAsciiString((LPWSTR)lpString);
1548 BOOL rc;
1549
1550 lpSize->cx = lpSize->cy = 0;
1551 rc = O32_GetTextExtentPoint(hdc,
1552 astring,
1553 cbString,
1554 lpSize);
1555 dprintf(("GDI32: GetTextExtentPointW %X %s (size %08xh) returned %d\n", hdc, astring, cbString, rc));
1556 dprintf(("GDI32: GetTextExtentPointW (%d,%d)\n", lpSize->cx, lpSize->cy));
1557
1558 FreeAsciiString(astring);
1559 return(rc);
1560}
1561//******************************************************************************
1562//******************************************************************************
1563int WIN32API GetTextFaceA( HDC arg1, int arg2, LPSTR arg3)
1564{
1565 dprintf(("GDI32: GetTextFaceA"));
1566 return O32_GetTextFace(arg1, arg2, arg3);
1567}
1568//******************************************************************************
1569//******************************************************************************
1570int WIN32API GetTextFaceW( HDC arg1, int arg2, LPWSTR arg3)
1571{
1572 char *astring = (char *)malloc(arg2+1);
1573 int rc;
1574
1575 dprintf(("GDI32: GetTextFaceW"));
1576 rc = O32_GetTextFace(arg1, arg2, astring);
1577 AsciiToUnicode(astring, arg3);
1578 free(astring);
1579 return rc;
1580}
1581//******************************************************************************
1582//******************************************************************************
1583BOOL WIN32API GetTextMetricsA( HDC arg1, LPTEXTMETRICA arg2)
1584{
1585 BOOL rc;
1586
1587 rc = O32_GetTextMetrics(arg1, arg2);
1588 dprintf(("GDI32: GetTextMetricsA returned %d\n", rc));
1589 return(rc);
1590}
1591//******************************************************************************
1592//******************************************************************************
1593BOOL WIN32API GetTextMetricsW( HDC arg1, LPTEXTMETRICW pwtm)
1594{
1595 BOOL rc;
1596 TEXTMETRICA atm;
1597
1598 dprintf(("GDI32: GetTextMetricsW"));
1599
1600 rc = O32_GetTextMetrics(arg1, &atm);
1601 pwtm->tmHeight = atm.tmHeight;
1602 pwtm->tmAscent = atm.tmAscent;
1603 pwtm->tmDescent = atm.tmDescent;
1604 pwtm->tmInternalLeading = atm.tmInternalLeading;
1605 pwtm->tmExternalLeading = atm.tmExternalLeading;
1606 pwtm->tmAveCharWidth = atm.tmAveCharWidth;
1607 pwtm->tmMaxCharWidth = atm.tmMaxCharWidth;
1608 pwtm->tmWeight = atm.tmWeight;
1609 pwtm->tmOverhang = atm.tmOverhang;
1610 pwtm->tmDigitizedAspectX = atm.tmDigitizedAspectX;
1611 pwtm->tmDigitizedAspectY = atm.tmDigitizedAspectY;
1612 pwtm->tmFirstChar = atm.tmFirstChar;
1613 pwtm->tmLastChar = atm.tmLastChar;
1614 pwtm->tmDefaultChar = atm.tmDefaultChar;
1615 pwtm->tmBreakChar = atm.tmBreakChar;
1616 pwtm->tmItalic = atm.tmItalic;
1617 pwtm->tmUnderlined = atm.tmUnderlined;
1618 pwtm->tmStruckOut = atm.tmStruckOut;
1619 pwtm->tmPitchAndFamily = atm.tmPitchAndFamily;
1620 pwtm->tmCharSet = atm.tmCharSet;
1621 return(rc);
1622}
1623//******************************************************************************
1624//******************************************************************************
1625BOOL WIN32API GetViewportExtEx( HDC arg1, PSIZE arg2)
1626{
1627 dprintf(("GDI32: GetViewportExtEx"));
1628 return O32_GetViewportExtEx(arg1, arg2);
1629}
1630//******************************************************************************
1631//******************************************************************************
1632BOOL WIN32API GetViewportOrgEx( HDC arg1, PPOINT arg2)
1633{
1634 dprintf(("GDI32: GetViewportOrgEx"));
1635 return O32_GetViewportOrgEx(arg1, arg2);
1636}
1637//******************************************************************************
1638//******************************************************************************
1639UINT WIN32API GetWinMetaFileBits( HENHMETAFILE arg1, UINT arg2, PBYTE arg3, int arg4, HDC arg5)
1640{
1641 dprintf(("GDI32: GetWinMetaFileBits"));
1642 return O32_GetWinMetaFileBits(arg1, arg2, arg3, arg4, arg5);
1643}
1644//******************************************************************************
1645//******************************************************************************
1646BOOL WIN32API GetWindowOrgEx( HDC arg1, PPOINT arg2)
1647{
1648 dprintf(("GDI32: GetWindowOrgEx"));
1649 return O32_GetWindowOrgEx(arg1, arg2);
1650}
1651//******************************************************************************
1652//******************************************************************************
1653BOOL WIN32API GetWorldTransform( HDC arg1, LPXFORM arg2)
1654{
1655 dprintf(("GDI32: GetWorldTransform"));
1656 return O32_GetWorldTransform(arg1, arg2);
1657}
1658//******************************************************************************
1659//******************************************************************************
1660int WIN32API IntersectClipRect(HDC arg1, int arg2, int arg3, int arg4, int arg5)
1661{
1662 int rc;
1663
1664 rc = O32_IntersectClipRect(arg1, arg2, arg3, arg4, arg5);
1665 dprintf(("GDI32: IntersectClipRect returned %d\n", rc));
1666 return(rc);
1667}
1668//******************************************************************************
1669//******************************************************************************
1670BOOL WIN32API InvertRgn( HDC arg1, HRGN arg2)
1671{
1672 dprintf(("GDI32: InvertRgn"));
1673 return O32_InvertRgn(arg1, arg2);
1674}
1675//******************************************************************************
1676//******************************************************************************
1677BOOL WIN32API LPtoDP( HDC arg1, PPOINT arg2, int arg3)
1678{
1679 dprintf(("GDI32: LPtoDP"));
1680 return O32_LPtoDP(arg1, arg2, arg3);
1681}
1682//******************************************************************************
1683//******************************************************************************
1684BOOL WIN32API MaskBlt( HDC arg1, int arg2, int arg3, int arg4, int arg5, HDC arg6, int arg7, int arg8, HBITMAP arg9, int arg10, int arg11, DWORD arg12)
1685{
1686 dprintf(("GDI32: MaskBlt"));
1687 return O32_MaskBlt(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12);
1688}
1689//******************************************************************************
1690//******************************************************************************
1691BOOL WIN32API ModifyWorldTransform( HDC arg1, const XFORM *arg2, DWORD arg3)
1692{
1693 dprintf(("GDI32: ModifyWorldTransform"));
1694 return O32_ModifyWorldTransform(arg1, (LPXFORM)arg2, arg3);
1695}
1696//******************************************************************************
1697//******************************************************************************
1698int WIN32API OffsetClipRgn( HDC arg1, int arg2, int arg3)
1699{
1700 dprintf(("GDI32: OffsetClipRgn"));
1701 return O32_OffsetClipRgn(arg1, arg2, arg3);
1702}
1703//******************************************************************************
1704//******************************************************************************
1705int WIN32API OffsetRgn( HRGN arg1, int arg2, int arg3)
1706{
1707 dprintf(("GDI32: OffsetRgn"));
1708 return O32_OffsetRgn(arg1, arg2, arg3);
1709}
1710//******************************************************************************
1711//******************************************************************************
1712BOOL WIN32API OffsetViewportOrgEx( HDC arg1, int arg2, int arg3, PPOINT arg4)
1713{
1714 dprintf(("GDI32: OffsetViewportOrgEx"));
1715 return O32_OffsetViewportOrgEx(arg1, arg2, arg3, arg4);
1716}
1717//******************************************************************************
1718//******************************************************************************
1719BOOL WIN32API OffsetWindowOrgEx( HDC arg1, int arg2, int arg3, PPOINT arg4)
1720{
1721 dprintf(("GDI32: OffsetWindowOrgEx"));
1722 return O32_OffsetWindowOrgEx(arg1, arg2, arg3, arg4);
1723}
1724//******************************************************************************
1725//******************************************************************************
1726BOOL WIN32API PaintRgn( HDC arg1, HRGN arg2)
1727{
1728 dprintf(("GDI32: PaintRgn"));
1729 return O32_PaintRgn(arg1, arg2);
1730}
1731//******************************************************************************
1732//******************************************************************************
1733HRGN WIN32API PathToRegion( HDC arg1)
1734{
1735 dprintf(("GDI32: PathToRegion"));
1736 return O32_PathToRegion(arg1);
1737}
1738//******************************************************************************
1739//******************************************************************************
1740BOOL WIN32API Pie(HDC hdc, int nLeftRect, int nTopRect, int nRightRect,
1741 int nBottomRect, int nXRadial1, int nYRadial1, int nXRadial2,
1742 int nYRadial2)
1743{
1744 dprintf(("GDI32: Pie"));
1745 //CB: bug in O32_Pie
1746 if (nXRadial1 == nXRadial2 && nYRadial1 == nYRadial2)
1747 return O32_Ellipse(hdc,nLeftRect,nTopRect,nRightRect,nBottomRect);
1748 else
1749 return O32_Pie(hdc,nLeftRect,nTopRect,nRightRect,nBottomRect,nXRadial1,nYRadial1,nXRadial2,nYRadial2);
1750}
1751//******************************************************************************
1752//******************************************************************************
1753BOOL WIN32API PlayEnhMetaFile( HDC arg1, HENHMETAFILE arg2, const RECT * arg3)
1754{
1755 dprintf(("GDI32: PlayEnhMetaFile"));
1756 return O32_PlayEnhMetaFile(arg1, arg2, arg3);
1757}
1758//******************************************************************************
1759//******************************************************************************
1760BOOL WIN32API PlayMetaFile( HDC arg1, HMETAFILE arg2)
1761{
1762 dprintf(("GDI32: PlayMetaFile"));
1763 return O32_PlayMetaFile(arg1, arg2);
1764}
1765//******************************************************************************
1766//******************************************************************************
1767BOOL WIN32API PlayMetaFileRecord( HDC arg1, LPHANDLETABLE arg2, LPMETARECORD arg3, UINT arg4)
1768{
1769 dprintf(("GDI32: PlayMetaFileRecord"));
1770 return O32_PlayMetaFileRecord(arg1, arg2, arg3, (int)arg4);
1771}
1772//******************************************************************************
1773//******************************************************************************
1774BOOL WIN32API PolyBezier( HDC arg1, const POINT * arg2, DWORD arg3)
1775{
1776 dprintf(("GDI32: PolyBezier"));
1777 return O32_PolyBezier(arg1, arg2, (int)arg3);
1778}
1779//******************************************************************************
1780//******************************************************************************
1781BOOL WIN32API PolyBezierTo( HDC arg1, const POINT * arg2, DWORD arg3)
1782{
1783 dprintf(("GDI32: PolyBezierTo"));
1784 return O32_PolyBezierTo(arg1, arg2, arg3);
1785}
1786//******************************************************************************
1787//******************************************************************************
1788BOOL WIN32API PolyDraw( HDC arg1, const POINT * arg2, const BYTE * arg3, DWORD arg4)
1789{
1790 dprintf(("GDI32: PolyDraw"));
1791 return O32_PolyDraw(arg1, arg2, arg3, arg4);
1792}
1793//******************************************************************************
1794//******************************************************************************
1795BOOL WIN32API PolyPolygon( HDC arg1, const POINT * arg2, const INT * arg3, UINT arg4)
1796{
1797 dprintf(("GDI32: PolyPolygon"));
1798 return O32_PolyPolygon(arg1, arg2, arg3, arg4);
1799}
1800//******************************************************************************
1801//******************************************************************************
1802BOOL WIN32API PolyPolyline( HDC hdc, const POINT * lppt, const DWORD * lpdwPolyPoints, DWORD cCount)
1803{
1804 dprintf(("GDI32: PolyPolyline"));
1805
1806 return O32_PolyPolyline(hdc,lppt,lpdwPolyPoints,cCount);
1807}
1808//******************************************************************************
1809//******************************************************************************
1810BOOL WIN32API Polygon( HDC arg1, const POINT * arg2, int arg3)
1811{
1812 dprintf(("GDI32: Polygon"));
1813 return O32_Polygon(arg1, arg2, arg3);
1814}
1815//******************************************************************************
1816//******************************************************************************
1817BOOL WIN32API PtInRegion( HRGN arg1, int arg2, int arg3)
1818{
1819 dprintf(("GDI32: PtInRegion"));
1820 return O32_PtInRegion(arg1, arg2, arg3);
1821}
1822//******************************************************************************
1823//******************************************************************************
1824BOOL WIN32API PtVisible( HDC arg1, int arg2, int arg3)
1825{
1826 dprintf(("GDI32: PtVisible"));
1827 return O32_PtVisible(arg1, arg2, arg3);
1828}
1829//******************************************************************************
1830//******************************************************************************
1831BOOL WIN32API RectInRegion( HRGN arg1, const RECT * arg2)
1832{
1833 dprintf(("GDI32: RectInRegion"));
1834 return O32_RectInRegion(arg1, arg2);
1835}
1836//******************************************************************************
1837//******************************************************************************
1838BOOL WIN32API RectVisible( HDC arg1, const RECT * arg2)
1839{
1840 dprintf(("GDI32: RectVisible\n"));
1841 return O32_RectVisible(arg1, arg2);
1842}
1843//******************************************************************************
1844//******************************************************************************
1845HDC WIN32API ResetDCA( HDC arg1, const DEVMODEA * arg2)
1846{
1847 dprintf(("GDI32: ResetDCA\n"));
1848 return (HDC)O32_ResetDC(arg1, arg2);
1849}
1850//******************************************************************************
1851//******************************************************************************
1852HDC WIN32API ResetDCW( HDC arg1, const DEVMODEW * arg2)
1853{
1854 dprintf(("GDI32: ResetDCW\n"));
1855 // NOTE: This will not work as is (needs UNICODE support)
1856 return (HDC)O32_ResetDC(arg1, (const DEVMODEA *)arg2);
1857}
1858//******************************************************************************
1859//******************************************************************************
1860BOOL WIN32API ResizePalette( HPALETTE arg1, UINT arg2)
1861{
1862 dprintf(("GDI32: ResizePalette\n"));
1863 return O32_ResizePalette(arg1, arg2);
1864}
1865//******************************************************************************
1866//******************************************************************************
1867BOOL WIN32API RestoreDC( HDC arg1, int arg2)
1868{
1869 dprintf(("GDI32: RestoreDC\n"));
1870 return O32_RestoreDC(arg1, arg2);
1871}
1872//******************************************************************************
1873//******************************************************************************
1874BOOL WIN32API RoundRect( HDC arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7)
1875{
1876 dprintf(("GDI32: RoundRect"));
1877 return O32_RoundRect(arg1, arg2, arg3, arg4, arg5, arg6, arg7);
1878}
1879//******************************************************************************
1880//******************************************************************************
1881int WIN32API SaveDC( HDC arg1)
1882{
1883 dprintf(("GDI32: SaveDC"));
1884 return O32_SaveDC(arg1);
1885}
1886//******************************************************************************
1887//******************************************************************************
1888BOOL WIN32API ScaleViewportExtEx( HDC arg1, int arg2, int arg3, int arg4, int arg5, PSIZE arg6)
1889{
1890 dprintf(("GDI32: ScaleViewportExtEx"));
1891 return O32_ScaleViewportExtEx(arg1, arg2, arg3, arg4, arg5, arg6);
1892}
1893//******************************************************************************
1894//******************************************************************************
1895BOOL WIN32API ScaleWindowExtEx( HDC arg1, int arg2, int arg3, int arg4, int arg5, PSIZE arg6)
1896{
1897 dprintf(("GDI32: ScaleWindowExtEx"));
1898 return O32_ScaleWindowExtEx(arg1, arg2, arg3, arg4, arg5, arg6);
1899}
1900//******************************************************************************
1901//******************************************************************************
1902int WIN32API SelectClipRgn( HDC hdc, HRGN hRgn)
1903{
1904 dprintf(("GDI32: SelectClipRgn %x %x", hdc, hRgn));
1905 return O32_SelectClipRgn(hdc, hRgn);
1906}
1907//******************************************************************************
1908//******************************************************************************
1909int WIN32API SetArcDirection( HDC arg1, int arg2)
1910{
1911 dprintf(("GDI32: SetArcDirection"));
1912 return O32_SetArcDirection(arg1, arg2);
1913}
1914//******************************************************************************
1915//******************************************************************************
1916LONG WIN32API SetBitmapBits( HBITMAP arg1, LONG arg2, const VOID * arg3)
1917{
1918 dprintf(("GDI32: SetBitmapBits"));
1919 return O32_SetBitmapBits(arg1, (DWORD)arg2, arg3);
1920}
1921//******************************************************************************
1922//******************************************************************************
1923BOOL WIN32API SetBitmapDimensionEx( HBITMAP arg1, int arg2, int arg3, PSIZE arg4)
1924{
1925 dprintf(("GDI32: SetBitmapDimensionEx"));
1926 return O32_SetBitmapDimensionEx(arg1, arg2, arg3, arg4);
1927}
1928//******************************************************************************
1929//******************************************************************************
1930UINT WIN32API SetBoundsRect( HDC arg1, const RECT * arg2, UINT arg3)
1931{
1932 dprintf(("GDI32: SetBoundsRect"));
1933 return O32_SetBoundsRect(arg1, arg2, arg3);
1934}
1935//******************************************************************************
1936//******************************************************************************
1937BOOL WIN32API SetBrushOrgEx( HDC arg1, int arg2, int arg3, PPOINT arg4)
1938{
1939 BOOL rc;
1940
1941 rc = O32_SetBrushOrgEx(arg1, arg2, arg3, arg4);
1942 dprintf(("GDI32: SetBrushOrgEx returned %d\n", rc));
1943 return(rc);
1944}
1945//******************************************************************************
1946//******************************************************************************
1947int WIN32API SetDIBits( HDC arg1, HBITMAP arg2, UINT arg3, UINT arg4, const VOID * arg5, const BITMAPINFO * arg6, UINT arg7)
1948{
1949 dprintf(("GDI32: SetDIBits %x %x %x %x %x %x %x\n", arg1, arg2, arg3, arg4, arg5, arg6, arg7));
1950
1951 if(DIBSection::getSection() != NULL) {
1952 DIBSection *dsect;
1953
1954 dsect = DIBSection::find((DWORD)arg2);
1955 if(dsect) {
1956 return dsect->SetDIBits(arg1, arg2, arg3, arg4, arg5, (WINBITMAPINFOHEADER *)&arg6->bmiHeader, arg7);
1957 }
1958 }
1959 return O32_SetDIBits(arg1, arg2, arg3, arg4, arg5, arg6, arg7);
1960}
1961//******************************************************************************
1962//******************************************************************************
1963INT WIN32API SetDIBitsToDevice(HDC hdc, INT xDest, INT yDest, DWORD cx,
1964 DWORD cy, INT xSrc, INT ySrc,
1965 UINT startscan, UINT lines, LPCVOID bits,
1966 const BITMAPINFO *info, UINT coloruse)
1967{
1968 INT result, imgsize, palsize, height, width;
1969 char *ptr;
1970
1971 SetLastError(0);
1972 if(info == NULL) {
1973 goto invalid_parameter;
1974 }
1975 height = info->bmiHeader.biHeight;
1976 width = info->bmiHeader.biWidth;
1977
1978 if (height < 0) height = -height;
1979 if (!lines || (startscan >= height)) {
1980 goto invalid_parameter;
1981 }
1982 if (startscan + lines > height) lines = height - startscan;
1983
1984 if (ySrc < startscan) ySrc = startscan;
1985 else if (ySrc >= startscan + lines) goto invalid_parameter;
1986
1987 if (xSrc >= width) goto invalid_parameter;
1988
1989 if (ySrc + cy >= startscan + lines) cy = startscan + lines - ySrc;
1990
1991 if (xSrc + cx >= width) cx = width - xSrc;
1992
1993 if (!cx || !cy) goto invalid_parameter;
1994
1995 // EB: ->>> Crazy. Nobody seen this Open32 bug ?
1996 // Dont't like dirty pointers, but Open32 needs a bit help.
1997 // Only tested with winmine.
1998 palsize = QueryPaletteSize((BITMAPINFOHEADER*)&info->bmiHeader);
1999 imgsize = CalcBitmapSize(info->bmiHeader.biBitCount,
2000 info->bmiHeader.biWidth, info->bmiHeader.biHeight);
2001 ptr = ((char *)info) + palsize + sizeof(BITMAPINFOHEADER);
2002 if(bits >= ptr && bits < ptr + imgsize)
2003 {
2004 bits = (char *)bits - imgsize +
2005 CalcBitmapSize(info->bmiHeader.biBitCount,
2006 info->bmiHeader.biWidth, lines);
2007 }
2008 // EB: <<<-
2009
2010// if(xDest == 0 && yDest == 0 && xSrc == 0 && ySrc == 0 && cx == width && cy == height) {
2011// result = OSLibSetDIBitsToDevice(hdc, xDest, yDest, cx, cy, xSrc, ySrc, startscan, lines, (PVOID) bits, (WINBITMAPINFOHEADER*)info, coloruse);
2012// result = lines;
2013// }
2014// else {
2015 result = O32_SetDIBitsToDevice(hdc, xDest, yDest, cx, cy, xSrc, ySrc, startscan, lines, (PVOID) bits, (PBITMAPINFO)info, coloruse);
2016 //SvL: Wrong Open32 return value
2017 result = (result == TRUE) ? lines : 0;
2018// }
2019
2020 dprintf(("GDI32: SetDIBitsToDevice hdc:%X xDest:%d yDest:%d, cx:%d, cy:%d, xSrc:%d, ySrc:%d, startscan:%d, lines:%d, bits:%X, info%X, coloruse:%d returned %d",
2021 hdc, xDest, yDest, cx, cy, xSrc, ySrc, startscan, lines, (LPVOID) bits, (PBITMAPINFO)info, coloruse, result));
2022 return result;
2023
2024invalid_parameter:
2025 SetLastError(ERROR_INVALID_PARAMETER);
2026 return 0;
2027}
2028//******************************************************************************
2029//******************************************************************************
2030HENHMETAFILE WIN32API SetEnhMetaFileBits( UINT arg1, const BYTE * arg2)
2031{
2032 dprintf(("GDI32: SetEnhMetaFileBits"));
2033 return O32_SetEnhMetaFileBits(arg1, arg2);
2034}
2035//******************************************************************************
2036//******************************************************************************
2037int WIN32API SetGraphicsMode(HDC arg1, int arg2)
2038{
2039 dprintf(("GDI32: SetGraphicsMode"));
2040 return O32_SetGraphicsMode(arg1, arg2);
2041}
2042//******************************************************************************
2043//******************************************************************************
2044int WIN32API SetMapMode( HDC arg1, int arg2)
2045{
2046 dprintf(("GDI32: SetMapMode"));
2047 return O32_SetMapMode(arg1, arg2);
2048}
2049//******************************************************************************
2050//******************************************************************************
2051DWORD WIN32API SetMapperFlags( HDC arg1, DWORD arg2)
2052{
2053 dprintf(("GDI32: SetMapperFlags"));
2054 return O32_SetMapperFlags(arg1, arg2);
2055}
2056//******************************************************************************
2057//******************************************************************************
2058HMETAFILE WIN32API SetMetaFileBitsEx( UINT arg1, const BYTE * arg2)
2059{
2060 dprintf(("GDI32: SetMetaFileBitsEx"));
2061 return O32_SetMetaFileBitsEx(arg1, (PBYTE)arg2);
2062}
2063//******************************************************************************
2064//******************************************************************************
2065BOOL WIN32API SetMiterLimit( HDC arg1, float arg2, float * arg3)
2066{
2067 dprintf(("GDI32: SetMiterLimit"));
2068 return O32_SetMiterLimit(arg1, arg2, arg3);
2069}
2070//******************************************************************************
2071//******************************************************************************
2072UINT WIN32API SetPaletteEntries( HPALETTE arg1, UINT arg2, UINT arg3, PALETTEENTRY * arg4)
2073{
2074 dprintf(("GDI32: SetPaletteEntries"));
2075 return O32_SetPaletteEntries(arg1, arg2, arg3, (const PALETTEENTRY *)arg4);
2076}
2077//******************************************************************************
2078//******************************************************************************
2079int WIN32API SetPolyFillMode( HDC arg1, int arg2)
2080{
2081 dprintf(("GDI32: SetPolyFillMode"));
2082 return O32_SetPolyFillMode(arg1, arg2);
2083}
2084//******************************************************************************
2085//******************************************************************************
2086BOOL WIN32API SetRectRgn( HRGN arg1, int arg2, int arg3, int arg4, int arg5)
2087{
2088 dprintf(("GDI32: SetRectRgn"));
2089 return O32_SetRectRgn(arg1, arg2, arg3, arg4, arg5);
2090}
2091//******************************************************************************
2092//******************************************************************************
2093UINT WIN32API SetTextAlign( HDC arg1, UINT arg2)
2094{
2095 dprintf(("GDI32: SetTextAlign"));
2096 return O32_SetTextAlign(arg1, arg2);
2097}
2098//******************************************************************************
2099//******************************************************************************
2100int WIN32API SetTextCharacterExtra( HDC arg1, int arg2)
2101{
2102 dprintf(("GDI32: SetTextCharacterExtra"));
2103 return O32_SetTextCharacterExtra(arg1, arg2);
2104}
2105//******************************************************************************
2106//******************************************************************************
2107BOOL WIN32API SetTextJustification( HDC arg1, int arg2, int arg3)
2108{
2109 dprintf(("GDI32: SetTextJustification"));
2110 return O32_SetTextJustification(arg1, arg2, arg3);
2111}
2112//******************************************************************************
2113//******************************************************************************
2114BOOL WIN32API SetViewportExtEx( HDC arg1, int arg2, int arg3, PSIZE arg4)
2115{
2116 dprintf(("GDI32: SetViewportExtEx"));
2117 return O32_SetViewportExtEx(arg1, arg2, arg3, arg4);
2118}
2119//******************************************************************************
2120//******************************************************************************
2121BOOL WIN32API SetViewportOrgEx( HDC arg1, int arg2, int arg3, PPOINT arg4)
2122{
2123 dprintf(("GDI32: SetViewportOrgEx"));
2124 return O32_SetViewportOrgEx(arg1, arg2, arg3, arg4);
2125}
2126//******************************************************************************
2127//******************************************************************************
2128HENHMETAFILE WIN32API SetWinMetaFileBits( UINT arg1, const BYTE * arg2, HDC arg3, const METAFILEPICT * arg4)
2129{
2130 dprintf(("GDI32: SetWinMetaFileBits"));
2131 return O32_SetWinMetaFileBits(arg1, arg2, arg3, arg4);
2132}
2133//******************************************************************************
2134//******************************************************************************
2135BOOL WIN32API SetWindowExtEx( HDC arg1, int arg2, int arg3, PSIZE arg4)
2136{
2137 dprintf(("GDI32: SetWindowExtEx"));
2138 return O32_SetWindowExtEx(arg1, arg2, arg3, arg4);
2139}
2140//******************************************************************************
2141//******************************************************************************
2142BOOL WIN32API SetWindowOrgEx( HDC arg1, int arg2, int arg3, PPOINT arg4)
2143{
2144 dprintf(("GDI32: SetWindowOrgEx"));
2145 return O32_SetWindowOrgEx(arg1, arg2, arg3, arg4);
2146}
2147//******************************************************************************
2148//******************************************************************************
2149BOOL WIN32API SetWorldTransform( HDC arg1, const XFORM *arg2)
2150{
2151 dprintf(("GDI32: SetWorldTransform"));
2152 return O32_SetWorldTransform(arg1, (LPXFORM)arg2);
2153}
2154//******************************************************************************
2155//******************************************************************************
2156INT WIN32API StartDocA( HDC arg1, const DOCINFOA *arg2)
2157{
2158 dprintf(("GDI32: StartDocA"));
2159 return O32_StartDoc(arg1, (LPDOCINFOA)arg2);
2160}
2161//******************************************************************************
2162//******************************************************************************
2163INT WIN32API StartDocW( HDC arg1, const DOCINFOW *arg2)
2164{
2165 dprintf(("GDI32: StartDocW STUB"));
2166 // NOTE: This will not work as is (needs UNICODE support)
2167// return O32_StartDoc(arg1, arg2);
2168 return 0;
2169}
2170//******************************************************************************
2171//******************************************************************************
2172int WIN32API StartPage( HDC arg1)
2173{
2174 dprintf(("GDI32: StartPage"));
2175 return O32_StartPage(arg1);
2176}
2177//******************************************************************************
2178//******************************************************************************
2179BOOL WIN32API UnrealizeObject( HGDIOBJ arg1)
2180{
2181 dprintf(("GDI32: UnrealizeObject"));
2182 return O32_UnrealizeObject(arg1);
2183}
2184//******************************************************************************
2185//******************************************************************************
2186BOOL WIN32API WidenPath( HDC arg1)
2187{
2188 dprintf(("GDI32: WidenPath"));
2189 return O32_WidenPath(arg1);
2190}
2191//******************************************************************************
2192//CreateDisardableBitmap is obsolete and can be replaced by CreateCompatibleBitmap
2193//******************************************************************************
2194HBITMAP WIN32API CreateDiscardableBitmap(HDC hDC, int nWidth, int nHeight)
2195{
2196 dprintf(("GDI32: CreateDisardableBitmap\n"));
2197 return O32_CreateCompatibleBitmap(hDC, nWidth, nHeight);
2198}
2199//******************************************************************************
2200//TODO: Not implemented
2201//******************************************************************************
2202int WIN32API SetAbortProc(HDC hdc, ABORTPROC lpAbortProc)
2203{
2204 dprintf(("GDI32: SetAbortProc - stub (1)w\n"));
2205 return(1);
2206}
2207//******************************************************************************
2208//Selects the current path as a clipping region for a device context, combining
2209//any existing clipping region by using the specified mode
2210//TODO: Can be emulated with SelectClipRegion??
2211//******************************************************************************
2212BOOL WIN32API SelectClipPath(HDC hdc, int iMode)
2213{
2214 dprintf(("GDI32: SelectClipPath, not implemented!(TRUE)\n"));
2215 return(TRUE);
2216}
2217//******************************************************************************
2218//TODO: Sets the color adjustment values for a device context. (used to adjust
2219// the input color of the src bitmap for calls of StretchBlt & StretchDIBits
2220// functions when HALFTONE mode is set
2221//******************************************************************************
2222BOOL WIN32API SetColorAdjustment(HDC hdc, CONST COLORADJUSTMENT *lpca)
2223{
2224 dprintf(("GDI32: SetColorAdjustment, not implemented!(TRUE)\n"));
2225 return(TRUE);
2226}
2227//******************************************************************************
2228//WINE: OBJECTS\DIB.C
2229//*********************************************************************************
2230HBITMAP WIN32API CreateDIBSection( HDC hdc, BITMAPINFO *pbmi, UINT iUsage,
2231 VOID **ppvBits, HANDLE hSection, DWORD dwOffset)
2232{
2233 HBITMAP res = 0;
2234 BOOL fFlip = 0;
2235 int iHeight, iWidth;
2236
2237 dprintf(("GDI32: CreateDIBSection %x %x %x %d", hdc, iUsage, hSection, dwOffset));
2238 if(hSection)
2239 {
2240 dprintf(("GDI32: CreateDIBSection, hSection != NULL, not supported!\n"));
2241 return NULL;
2242 }
2243
2244 //SvL: 13-9-98: StarCraft uses bitmap with negative height
2245 iWidth = pbmi->bmiHeader.biWidth;
2246 if(pbmi->bmiHeader.biWidth < 0)
2247 {
2248 dprintf(("CreateDIBSection: width %d", pbmi->bmiHeader.biWidth));
2249 pbmi->bmiHeader.biWidth = -pbmi->bmiHeader.biWidth;
2250 fFlip = FLIP_HOR;
2251 }
2252 iHeight = pbmi->bmiHeader.biHeight;
2253 if(pbmi->bmiHeader.biHeight < 0)
2254 {
2255 dprintf(("CreateDIBSection: height %d", pbmi->bmiHeader.biHeight));
2256 pbmi->bmiHeader.biHeight = -pbmi->bmiHeader.biHeight;
2257 fFlip |= FLIP_VERT;
2258 }
2259
2260 res = O32_CreateDIBitmap(hdc, &pbmi->bmiHeader, 0, NULL, pbmi, 0);
2261 if (res)
2262 {
2263 ULONG Pal[256];
2264 char PalSize;
2265 LOGPALETTE tmpPal = { 0x300,1,{0,0,0,0}};
2266 HPALETTE hpalCur, hpalTmp;
2267 DIBSection *dsect = new DIBSection((WINBITMAPINFOHEADER *)&pbmi->bmiHeader, (DWORD)res, fFlip);
2268
2269 if(NULL!=dsect)
2270 {
2271 PalSize = dsect->GetBitCount();
2272 if(PalSize<=8)
2273 {
2274 // Now get the current Palette from the DC
2275 hpalTmp = CreatePalette(&tmpPal);
2276 hpalCur = SelectPalette(hdc, hpalTmp, FALSE);
2277
2278 // and use it to set the DIBColorTable
2279 GetPaletteEntries( hpalCur, 0, 1<<PalSize, (LPPALETTEENTRY)&Pal);
2280 dsect->SetDIBColorTable(0, 1<< PalSize, (RGBQUAD*)&Pal);
2281
2282 // Restore the DC Palette
2283 SelectPalette(hdc,hpalCur,FALSE);
2284 DeleteObject(hpalTmp);
2285 }
2286 // Set the hdc in the DIBSection so we can update the palete if a new
2287 // Paletet etc. gets selected into the DC.
2288
2289 dsect->SelectDIBObject(hdc);
2290
2291 if(ppvBits!=NULL)
2292 *ppvBits = dsect->GetDIBObject();
2293
2294 pbmi->bmiHeader.biWidth = iWidth;
2295 pbmi->bmiHeader.biHeight = iHeight;
2296
2297 return(res);
2298 }
2299 }
2300
2301 /* Error. */
2302 if (res)
2303 DeleteObject(res);
2304 *ppvBits = NULL;
2305#ifdef DEBUG
2306 dprintf(("GDI32: CreateDIBSection, error!\n"));
2307 dprintf(("pbmi->biWidth %d", pbmi->bmiHeader.biWidth));
2308 dprintf(("pbmi->biHeight %d", pbmi->bmiHeader.biHeight));
2309 dprintf(("pbmi->biBitCount %d", pbmi->bmiHeader.biBitCount));
2310#endif
2311
2312 return 0;
2313}
2314//******************************************************************************
2315//******************************************************************************
2316UINT WIN32API GetDIBColorTable( HDC hdc, UINT uStartIndex, UINT cEntries,
2317 RGBQUAD *pColors)
2318{
2319 HPALETTE hpal = O32_GetCurrentObject(hdc, OBJ_PAL);
2320 UINT rc;
2321 int i;
2322
2323 rc = O32_GetPaletteEntries(hpal,
2324 uStartIndex,
2325 cEntries,
2326 (PALETTEENTRY *)pColors);
2327 for(i=0;
2328 i<cEntries;
2329 i++)
2330 {
2331 BYTE tmp;
2332 tmp = pColors[i].rgbBlue;
2333 pColors[i].rgbBlue = pColors[i].rgbRed;
2334 pColors[i].rgbRed = tmp;
2335 pColors[i].rgbReserved = 0;
2336 }
2337 dprintf(("GDI32: GetDIBColorTable returns %d\n", rc));
2338 return(rc);
2339}
2340//******************************************************************************
2341//******************************************************************************
2342UINT WIN32API SetDIBColorTable(HDC hdc, UINT uStartIndex, UINT cEntries,
2343 RGBQUAD *pColors)
2344{
2345 DIBSection *dsect = DIBSection::findHDC(hdc);
2346
2347 dprintf(("GDI32: SetDIBColorTable\n"));
2348 if(dsect)
2349 {
2350 return(dsect->SetDIBColorTable(uStartIndex, cEntries, pColors));
2351 }
2352 else
2353 return(0);
2354}
2355//******************************************************************************
2356//******************************************************************************
2357HPALETTE WIN32API CreateHalftonePalette(HDC hdc)
2358{
2359 dprintf(("GDI32: CreateHalftonePalette, not implemented\n"));
2360 return(NULL);
2361}
2362//******************************************************************************
2363//Maps colors to system palette; faster way to update window (instead of redrawing)
2364//We just redraw
2365//******************************************************************************
2366BOOL WIN32API UpdateColors(HDC hdc)
2367{
2368 dprintf(("GDI32: UpdateColors\n"));
2369 return O32_InvalidateRect(O32_WindowFromDC(hdc), NULL, FALSE);
2370}
2371//******************************************************************************
2372//******************************************************************************
2373BOOL WIN32API GdiFlush()
2374{
2375 dprintf(("GDI32: GdiFlush, not implemented (TRUE)\n"));
2376 return(TRUE);
2377}
2378//******************************************************************************
2379//******************************************************************************
2380BOOL WIN32API GdiComment(HDC hdc, UINT cbSize, CONST BYTE *lpData)
2381{
2382 dprintf(("GDI32: GdiComment, not implemented (TRUE)\n"));
2383 return(TRUE);
2384}
2385//******************************************************************************
2386//******************************************************************************
2387BOOL WIN32API GetCharWidthFloatA(HDC hdc, UINT iFirstChar, UINT iLastChar, PFLOAT pxBUffer)
2388{
2389 dprintf(("GDI32: GetCharWidthFloatA, not implemented\n"));
2390 return(FALSE);
2391}
2392//******************************************************************************
2393//******************************************************************************
2394BOOL WIN32API GetCharWidthFloatW(HDC hdc, UINT iFirstChar, UINT iLastChar, PFLOAT pxBUffer)
2395{
2396 dprintf(("GDI32: GetCharWidthFloatW, not implemented\n"));
2397 return(FALSE);
2398}
2399//******************************************************************************
2400//******************************************************************************
2401BOOL WIN32API GetCharABCWidthsFloatA(HDC hdc, UINT iFirstChar, UINT iLastChar, LPABCFLOAT pxBUffer)
2402{
2403 dprintf(("GDI32: GetCharABCWidthsFloatA, not implemented\n"));
2404 return(FALSE);
2405}
2406//******************************************************************************
2407//******************************************************************************
2408BOOL WIN32API GetCharABCWidthsFloatW(HDC hdc,
2409 UINT iFirstChar,
2410 UINT iLastChar,
2411 LPABCFLOAT pxBUffer)
2412{
2413 dprintf(("GDI32: GetCharABCWidthsFloatA, not implemented\n"));
2414 return(FALSE);
2415}
2416//******************************************************************************
2417//******************************************************************************
2418INT WIN32API ExtEscape(HDC hdc, INT nEscape, INT cbInput, LPCSTR lpszInData,
2419 INT cbOutput, LPSTR lpszOutData)
2420{
2421 dprintf(("GDI32: ExtEscape, not implemented\n"));
2422 return(0);
2423}
2424//******************************************************************************
2425//******************************************************************************
2426int WIN32API DrawEscape(HDC hdc, int nEscape, int cbInput, LPCSTR lpszInData)
2427{
2428 dprintf(("GDI32: DrawEscape, not implemented\n"));
2429 return(0);
2430}
2431//******************************************************************************
2432//******************************************************************************
2433BOOL WIN32API GetColorAdjustment(HDC hdc, COLORADJUSTMENT *lpca)
2434{
2435 dprintf(("GDI32: GetColorAdjustment, not implemented\n"));
2436 return(FALSE);
2437}
2438//******************************************************************************
2439//******************************************************************************
2440BOOL WIN32API PlgBlt(HDC hdcDest, CONST POINT *lpPoint, HDC hdcSrc, int nXSrc,
2441 int nYSrc, int nWidth, int nHeight, HBITMAP hbmMask,
2442 int xMast, int yMask)
2443{
2444 dprintf(("GDI32: PlgBlt, not implemented\n"));
2445 return(FALSE);
2446}
2447//******************************************************************************
2448//******************************************************************************
2449DWORD WIN32API GetGlyphOutlineA(HDC hdc, UINT uChar, UINT uFormat, LPGLYPHMETRICS lpgm,
2450 DWORD cbBuffer, LPVOID lpvBuffer, CONST MAT2 *lpmat2)
2451{
2452 dprintf(("GDI32: GetGlyphOutLineA, not implemented (GDI_ERROR)\n"));
2453 return(GDI_ERROR);
2454}
2455//******************************************************************************
2456
2457//******************************************************************************
2458/*KSO Thu 21.05.1998*/
2459DWORD WIN32API GetGlyphOutlineW(HDC hdc, UINT uChar, UINT uFormat, LPGLYPHMETRICS lpgm,
2460 DWORD cbBuffer, LPVOID lpvBuffer, CONST MAT2 *lpmat2)
2461{
2462 dprintf(("GDI32: GetGlyphOutLineW, not implemented\n"));
2463 return(GDI_ERROR);
2464}
2465//******************************************************************************
2466
2467//******************************************************************************
2468BOOL WIN32API SetObjectOwner( HGDIOBJ arg1, int arg2 )
2469{
2470 // Here is a guess for a undocumented entry
2471 dprintf(("GDI32: SetObjectOwner - stub (TRUE)\n"));
2472 return TRUE;
2473}
2474//******************************************************************************
2475
2476
2477/* Office 97 stubs - KSO Thu 21.05.1998*/
2478//******************************************************************************
2479BOOL WIN32API GetTextExtentExPointA(/*KSO Thu 21.05.1998*/
2480 HDC hdc,
2481 LPCSTR str,
2482 int count,
2483 int maxExt,
2484 LPINT lpnFit,
2485 LPINT alpDx,
2486 LPSIZE size)
2487{
2488 int index, nFit, extent;
2489 SIZE tSize;
2490
2491 dprintf(("GDI32: GetTextExtendExPointA\n"));
2492
2493 size->cx = size->cy = nFit = extent = 0;
2494 for(index = 0; index < count; index++)
2495 {
2496 if(!O32_GetTextExtentPoint( hdc, str, 1, &tSize )) return FALSE;
2497 if( extent+tSize.cx < maxExt )
2498 {
2499 extent+=tSize.cx;
2500 nFit++;
2501 str++;
2502 if( alpDx )
2503 alpDx[index] = extent;
2504 if( tSize.cy > size->cy ) size->cy = tSize.cy;
2505 }
2506 else break;
2507 }
2508 size->cx = extent;
2509
2510 if (lpnFit != NULL) // check if result is desired
2511 *lpnFit = nFit;
2512
2513 dprintf(("GDI32: GetTextExtendExPointA(%08x '%.*s' %d) returning %d %d %d\n",
2514 hdc,count,str,maxExt,nFit, size->cx,size->cy));
2515 return TRUE;
2516}
2517//******************************************************************************
2518//******************************************************************************
2519BOOL WIN32API GetTextExtentExPointW( /*KSO Thu 21.05.1998*/
2520 HDC arg1,
2521 LPCWSTR arg2,
2522 int arg3,
2523 int arg4,
2524 LPINT arg5,
2525 LPINT arg6,
2526 LPSIZE arg7
2527 )
2528{
2529 char *astring = UnicodeToAsciiString((LPWSTR)arg2);
2530 BOOL rc;
2531
2532 dprintf(("GDI32: GetTextExtendExPointW\n"));
2533 rc = GetTextExtentExPointA(arg1, astring, arg3, arg4, arg5, arg6, arg7);
2534 FreeAsciiString(astring);
2535 return rc;
2536}
2537//******************************************************************************
2538//******************************************************************************
2539BOOL WIN32API PlayEnhMetaFileRecord( /*KSO Thu 21.05.1998*/
2540 HDC arg1,
2541 LPHANDLETABLE arg2,
2542 CONST ENHMETARECORD *arg3,
2543 UINT arg4
2544 )
2545{
2546 dprintf(("GDI32: PlayEnhMetaFileRecord - stub\n"));
2547 return FALSE;
2548}
2549//******************************************************************************
2550UINT WIN32API GetEnhMetaFileDescriptionA( /*KSO Thu 21.05.1998*/
2551 HENHMETAFILE arg1,
2552 UINT arg2,
2553 LPSTR arg3
2554 )
2555{
2556 dprintf(("GDI32: GetEnhMetaFileDescriptionA - stub\n"));
2557 return FALSE;
2558}
2559//******************************************************************************
2560//******************************************************************************
2561UINT WIN32API GetEnhMetaFileDescriptionW( /*KSO Thu 21.05.1998*/
2562 HENHMETAFILE arg1,
2563 UINT arg2,
2564 LPWSTR arg3
2565 )
2566{
2567 dprintf(("GDI32: GetEnhMetaFileDescriptionW - stub\n"));
2568 return FALSE;
2569}
2570//******************************************************************************
2571//******************************************************************************
2572UINT WIN32API DeleteColorSpace( /*KSO Thu 21.05.1998*/
2573 HCOLORSPACE hColorSpace
2574 )
2575{
2576 dprintf(("GDI32: DeleteColorSpace - stub\n"));
2577 return FALSE;
2578}
2579//******************************************************************************
2580//******************************************************************************
2581BOOL WIN32API SetColorSpace( /*KSO Thu 21.05.1998*/
2582 HDC hdc,
2583 HCOLORSPACE hColorSpace
2584 )
2585{
2586 dprintf(("GDI32: SetColorSpace - stub\n"));
2587 return FALSE;
2588}
2589//******************************************************************************
2590//******************************************************************************
2591 HCOLORSPACE WIN32API CreateColorSpaceA( /*KSO Thu 21.05.1998*/
2592 LPLOGCOLORSPACEA lpLogColorSpace
2593 )
2594{
2595 dprintf(("GDI32: CreateColorSpaceA - stub\n"));
2596 return 0;
2597}
2598//******************************************************************************
2599//******************************************************************************
2600HCOLORSPACE WIN32API CreateColorSpaceW( /*KSO Thu 21.05.1998*/
2601 LPLOGCOLORSPACEW lpwLogColorSpace
2602 )
2603{
2604 dprintf(("GDI32: CreateColorSpaceW - stub\n"));
2605 return 0;
2606}
2607//******************************************************************************
2608//******************************************************************************
2609HANDLE WIN32API GetColorSpace( /*KSO Thu 21.05.1998*/
2610 HDC hdc
2611 )
2612{
2613 dprintf(("GDI32: GetColorSpace - stub\n"));
2614 return 0;
2615}
2616//******************************************************************************
2617//******************************************************************************
2618int WIN32API SetICMMode( /*KSO Thu 21.05.1998*/
2619 HDC hdc,
2620 int mode
2621 )
2622{
2623 dprintf(("GDI32: SetICMMode - stub\n"));
2624 return 0;
2625}
2626//******************************************************************************
2627
2628
2629
2630
2631/*****************************************************************************
2632 * Name : BOOL CancelDC
2633 * Purpose : The CancelDC function cancels any pending operation on the
2634 * specified device context (DC).
2635 * Parameters: HDC hdc handle of device context
2636 * Variables :
2637 * Result : TRUE / FALSE
2638 * Remark :
2639 * Status : UNTESTED STUB
2640 *
2641 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
2642 *****************************************************************************/
2643
2644BOOL WIN32API CancelDC(HDC hdc)
2645{
2646 dprintf(("GDI32: CancelDC(%08xh) not implemented.\n",
2647 hdc));
2648
2649 return (FALSE);
2650}
2651
2652
2653/*****************************************************************************
2654 * Name : BOOL CheckColorsInGamut
2655 * Purpose : The CheckColorsInGamut function indicates whether the specified
2656 * color values are within the gamut of the specified device.
2657 * Parameters: HDC hdc handle of device context
2658 * LPVOID lpaRGBQuad
2659 * LPVOID lpResult
2660 * DWORD dwResult
2661 * Variables :
2662 * Result : TRUE / FALSE
2663 * Remark :
2664 * Status : UNTESTED STUB
2665 *
2666 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
2667 *****************************************************************************/
2668
2669BOOL WIN32API CheckColorsInGamut(HDC hdc,
2670 LPVOID lpaRGBQuad,
2671 LPVOID lpResult,
2672 DWORD dwResult)
2673{
2674 dprintf(("GDI32: CheckColorsInGamut(%08xh,%08xh,%08xh,%08xh) not implemented.\n",
2675 hdc,
2676 lpaRGBQuad,
2677 lpResult,
2678 dwResult));
2679
2680 return (FALSE);
2681}
2682
2683
2684/*****************************************************************************
2685 * Name : BOOL ColorMatchToTarget
2686 * Purpose : The ColorMatchToTarget function enables or disables preview for
2687 * the specified device context. When preview is enabled, colors
2688 * in subsequent output to the specified device context are
2689 * displayed as they would appear on the target device. This is
2690 * useful for checking how well the target maps the specified
2691 * colors in an image. To enable preview, image color matching
2692 * must be enabled for both the target and the preview device context.
2693 * Parameters: HDC hdc handle of device context
2694 * HDC hdcTarget handle of target device context
2695 * DWORD uiAction
2696 * Variables :
2697 * Result : TRUE / FALSE
2698 * Remark :
2699 * Status : UNTESTED STUB
2700 *
2701 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
2702 *****************************************************************************/
2703
2704BOOL WIN32API ColorMatchToTarget(HDC hdc,
2705 HDC hdcTarget,
2706 DWORD uiAction)
2707{
2708 dprintf(("GDI32: ColorMatchToTarget(%08xh,%08xh,%08xh) not implemented.\n",
2709 hdc,
2710 hdcTarget,
2711 uiAction));
2712
2713 return (FALSE);
2714}
2715
2716
2717/*****************************************************************************
2718 * Name : BOOL CombineTransform
2719 * Purpose : The CombineTransform function concatenates two world-space to
2720 * page-space transformations.
2721 * Parameters: LLPXFORM lLPXFORMResult address of combined transformation
2722 * XFORM *lLPXFORM1 address of 1st transformation
2723 * XFORM *lLPXFORM2 address of 2nd transformation
2724 * Variables :
2725 * Result : TRUE / FALSE
2726 * Remark :
2727 * Status : UNTESTED
2728 *
2729 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
2730 * Markus Montkowski [Wen, 1999/01/12 20:18]
2731 *****************************************************************************/
2732
2733BOOL WIN32API CombineTransform(LPXFORM lLPXFORMResult,
2734 CONST XFORM *lLPXFORM1,
2735 CONST XFORM *lLPXFORM2)
2736{
2737 dprintf(("GDI32: CombineTransform(%08xh,%08xh,%08xh).\n",
2738 lLPXFORMResult,
2739 lLPXFORM1,
2740 lLPXFORM2));
2741
2742 XFORM xfrm;
2743 if( O32_IsBadWritePtr( (void*)lLPXFORMResult, sizeof(XFORM)) ||
2744 O32_IsBadReadPtr( (void*)lLPXFORM1, sizeof(XFORM)) ||
2745 O32_IsBadWritePtr( (void*)lLPXFORM2, sizeof(XFORM)) )
2746 return (FALSE);
2747
2748 // Add the translations
2749 lLPXFORMResult->eDx = lLPXFORM1->eDx + lLPXFORM2->eDx;
2750 lLPXFORMResult->eDy = lLPXFORM1->eDy + lLPXFORM2->eDy;
2751
2752 // Multiply the matrixes
2753 xfrm.eM11 = lLPXFORM1->eM11 * lLPXFORM2->eM11 + lLPXFORM1->eM21 * lLPXFORM1->eM12;
2754 xfrm.eM12 = lLPXFORM1->eM11 * lLPXFORM2->eM12 + lLPXFORM1->eM12 * lLPXFORM1->eM22;
2755 xfrm.eM21 = lLPXFORM1->eM21 * lLPXFORM2->eM11 + lLPXFORM1->eM22 * lLPXFORM1->eM21;
2756 xfrm.eM22 = lLPXFORM1->eM21 * lLPXFORM2->eM12 + lLPXFORM1->eM22 * lLPXFORM1->eM22;
2757
2758 // Now copy to resulting XFROM as the pt must not be distinct
2759 lLPXFORMResult->eM11 = xfrm.eM11;
2760 lLPXFORMResult->eM12 = xfrm.eM12;
2761 lLPXFORMResult->eM21 = xfrm.eM21;
2762 lLPXFORMResult->eM22 = xfrm.eM22;
2763
2764 return (TRUE);
2765}
2766
2767
2768
2769/*****************************************************************************
2770 * Name : HBRUSH CreateDIBPatternBrush
2771 * Purpose : The CreateDIBPatternBrush function creates a logical brush that
2772 * has the pattern specified by the specified device-independent
2773 * bitmap (DIB). The brush can subsequently be selected into any
2774 * device context that is associated with a device that supports
2775 * raster operations.
2776 * This function is provided only for compatibility with applications
2777 * written for versions of Windows earlier than 3.0. For Win32-based
2778 * applications, use the CreateDIBPatternBrushPt function.
2779 * Parameters: HGLOBAL hglbDIBPacked Identifies a global memory object containing
2780 * a packed DIB, which consists of a BITMAPINFO structure immediately
2781 * followed by an array of bytes defining the pixels of the bitmap.
2782 * UINT fuColorSpec color table data
2783 * Variables :
2784 * Result : TRUE / FALSE
2785 * Remark :
2786 * Status : UNTESTED
2787 *
2788 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
2789 * Markus Montkowski [Wen, 1999/01/12 20:00]
2790 *****************************************************************************/
2791
2792HBRUSH WIN32API CreateDIBPatternBrush( HGLOBAL hglbDIBPacked,
2793 UINT fuColorSpec)
2794{
2795 LPVOID lpMem;
2796 HBRUSH ret = 0;
2797 dprintf(("GDI32: CreateDIBPatternBrush(%08xh, %08xh) \n",
2798 hglbDIBPacked,
2799 fuColorSpec));
2800
2801 lpMem = GlobalLock(hglbDIBPacked);
2802 if(NULL!=lpMem)
2803 {
2804
2805 ret = CreateDIBPatternBrushPt( lpMem,
2806 fuColorSpec);
2807 GlobalUnlock(hglbDIBPacked);
2808 }
2809
2810 return (ret);
2811}
2812
2813
2814
2815
2816/*****************************************************************************
2817 * Name : int EnumICMProfilesA
2818 * Purpose : The EnumICMProfilesA function enumerates the different color
2819 * profiles that the system supports for the specified device context.
2820 * Parameters: HDC hdc
2821 * ICMENUMPROC lpICMEnumFunc
2822 * LPARAM lParam
2823 * Variables :
2824 * Result : TRUE / FALSE
2825 * Remark :
2826 * Status : UNTESTED STUB
2827 *
2828 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
2829 *****************************************************************************/
2830
2831int WIN32API EnumICMProfilesA(HDC hdc,
2832 ICMENUMPROCA lpICMEnumProc,
2833 LPARAM lParam)
2834{
2835 dprintf(("GDI32: EnumICMProfilesA(%08xh, %08xh, %08xh) not implemented(-1).\n",
2836 hdc,
2837 lpICMEnumProc,
2838 lParam));
2839
2840 return (-1);
2841}
2842
2843
2844/*****************************************************************************
2845 * Name : int EnumICMProfilesW
2846 * Purpose : The EnumICMProfilesW function enumerates the different color
2847 * profiles that the system supports for the specified device context.
2848 * Parameters: HDC hdc
2849 * ICMENUMPROC lpICMEnumFunc
2850 * LPARAM lParam
2851 * Variables :
2852 * Result : TRUE / FALSE
2853 * Remark :
2854 * Status : UNTESTED STUB
2855 *
2856 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
2857 *****************************************************************************/
2858
2859int WIN32API EnumICMProfilesW(HDC hdc,
2860 ICMENUMPROCW lpICMEnumProc,
2861 LPARAM lParam)
2862{
2863 dprintf(("GDI32: EnumICMProfilesW(%08xh, %08xh, %08xh) not implemented (-1).\n",
2864 hdc,
2865 lpICMEnumProc,
2866 lParam));
2867
2868 return (-1);
2869}
2870
2871
2872/*****************************************************************************
2873 * Name : BOOL FixBrushOrgEx
2874 * Purpose : The FixBrushOrgEx function is not implemented in the Win32 API.
2875 * It is provided for compatibility with Win32s. If called, the
2876 * function does nothing, and returns FALSE.
2877 * Parameters: HDC, int, int, LPPOINT
2878 * Variables :
2879 * Result : TRUE / FALSE
2880 * Remark : not implemented in Win32
2881 * Status : UNTESTED STUB
2882 *
2883 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
2884 *****************************************************************************/
2885
2886BOOL WIN32API FixBrushOrgEx(HDC hdc,
2887 int iDummy1,
2888 int iDummy2,
2889 LPPOINT lpPoint)
2890{
2891 dprintf(("GDI32: FixBrushOrgEx(%08xh,%08xh,%08xh,%08xh) not implemented.\n",
2892 hdc,
2893 iDummy1,
2894 iDummy2,
2895 lpPoint));
2896
2897 return (FALSE);
2898}
2899
2900
2901/*****************************************************************************
2902 * Name : DWORD GdiGetBatchLimit
2903 * Purpose : The GdiGetBatchLimit function returns the maximum number of
2904 * function calls that can be accumulated in the calling thread's
2905 * current batch. The system flushes the current batch whenever
2906 * this limit is exceeded.
2907 * Parameters:
2908 * Variables :
2909 * Result : 1
2910 * Remark :
2911 * Status : UNTESTED STUB
2912 *
2913 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
2914 *****************************************************************************/
2915
2916DWORD WIN32API GdiGetBatchLimit(VOID)
2917{
2918 dprintf(("GDI32: GdiGetBatchLimit() not implemented (1).\n"));
2919
2920 return (1);
2921}
2922
2923
2924/*****************************************************************************
2925 * Name : DWORD GdiSetBatchLimit
2926 * Purpose : The GdiSetBatchLimit function sets the maximum number of
2927 * functions that can be accumulated in the calling thread's current
2928 * batch. The system flushes the current batch whenever this limit
2929 * is exceeded.
2930 * Parameters: DWORD dwLimit
2931 * Variables :
2932 * Result :
2933 * Remark :
2934 * Status : UNTESTED STUB
2935 *
2936 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
2937 *****************************************************************************/
2938
2939DWORD WIN32API GdiSetBatchLimit(DWORD dwLimit)
2940{
2941 dprintf(("GDI32: GdiSetBatchLimit(%08xh) not implemented (1).\n",
2942 dwLimit));
2943
2944 return (1);
2945}
2946
2947
2948/*****************************************************************************
2949 * Name : DWORD GetCharacterPlacementA
2950 * Purpose : The GetCharacterPlacementA function retrieves information about
2951 * a character string, such as character widths, caret positioning,
2952 * ordering within the string, and glyph rendering. The type of
2953 * information returned depends on the dwFlags parameter and is
2954 * based on the currently selected font in the given display context.
2955 * The function copies the information to the specified GCP_RESULTSA
2956 * structure or to one or more arrays specified by the structure.
2957 * Parameters: HDC hdc handle to device context
2958 * LPCSTR lpString pointer to string
2959 * int nCount number of characters in string
2960 * int nMaxExtent maximum extent for displayed string
2961 * LPGCP_RESULTSA *lpResults pointer to buffer for placement result
2962 * DWORD dwFlags placement flags
2963 * Variables :
2964 * Result :
2965 * Remark :
2966 * Status : UNTESTED STUB
2967 *
2968 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
2969 *****************************************************************************/
2970
2971DWORD WIN32API GetCharacterPlacementA(HDC hdc,
2972 LPCSTR lpString,
2973 int nCount,
2974 int nMaxExtent,
2975 GCP_RESULTSA * lpResults,
2976 DWORD dwFlags)
2977{
2978 dprintf(("GDI32: GetCharacterPlacementA(%08xh,%s,%08xh,%08xh,%08xh,%08xh) not implemented.\n",
2979 hdc,
2980 lpString,
2981 nCount,
2982 nMaxExtent,
2983 lpResults,
2984 dwFlags));
2985
2986 return (0);
2987}
2988
2989
2990/*****************************************************************************
2991 * Name : DWORD GetCharacterPlacementW
2992 * Purpose : The GetCharacterPlacementW function retrieves information about
2993 * a character string, such as character widths, caret positioning,
2994 * ordering within the string, and glyph rendering. The type of
2995 * information returned depends on the dwFlags parameter and is
2996 * based on the currently selected font in the given display context.
2997 * The function copies the information to the specified GCP_RESULTSW
2998 * structure or to one or more arrays specified by the structure.
2999 * Parameters: HDC hdc handle to device context
3000 * LPCSTR lpString pointer to string
3001 * int nCount number of characters in string
3002 * int nMaxExtent maximum extent for displayed string
3003 * GCP_RESULTSW *lpResults pointer to buffer for placement result
3004 * DWORD dwFlags placement flags
3005 * Variables :
3006 * Result :
3007 * Remark :
3008 * Status : UNTESTED STUB
3009 *
3010 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
3011 *****************************************************************************/
3012
3013DWORD WIN32API GetCharacterPlacementW(HDC hdc,
3014 LPCWSTR lpString,
3015 int nCount,
3016 int nMaxExtent,
3017 GCP_RESULTSW *lpResults,
3018 DWORD dwFlags)
3019{
3020 dprintf(("GDI32: GetCharacterPlacementW(%08xh,%s,%08xh,%08xh,%08xh,%08xh) not implemented.\n",
3021 hdc,
3022 lpString,
3023 nCount,
3024 nMaxExtent,
3025 lpResults,
3026 dwFlags));
3027
3028 return (0);
3029}
3030
3031
3032/*****************************************************************************
3033 * Name : DWORD GetDeviceGammaRamp
3034 * Purpose : The GetDeviceGammaRamp function retrieves the gamma ramp on
3035 * direct color display boards.
3036 * Parameters: HDC hdc handle to device context
3037 * LPVOID lpRamp Gamma ramp array
3038 * Variables :
3039 * Result :
3040 * Remark :
3041 * Status : UNTESTED STUB
3042 *
3043 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
3044 *****************************************************************************/
3045
3046DWORD WIN32API GetDeviceGammaRamp(HDC hdc,
3047 LPVOID lpRamp)
3048{
3049 dprintf(("GDI32: GetDeviceGammaRamp(%08xh, %08xh) not implemented.\n",
3050 hdc,
3051 lpRamp));
3052
3053 return (FALSE);
3054}
3055
3056
3057
3058
3059/*****************************************************************************
3060 * Name : BOOL GetICMProfileA
3061 * Purpose : The GetICMProfileA function retrieves the name of the color
3062 * profile file for the device associated with the specified device
3063 * context.
3064 * Parameters: HDC hdc handle to device context
3065 * DWORD cbName
3066 * LPTSTR lpszFilename
3067 * Variables :
3068 * Result : TRUE / FALSE
3069 * Remark :
3070 * Status : UNTESTED STUB
3071 *
3072 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
3073 *****************************************************************************/
3074
3075BOOL WIN32API GetICMProfileA(HDC hdc,
3076 DWORD cbName,
3077 LPTSTR lpszFilename)
3078{
3079 dprintf(("GDI32: GetICMProfileA(%08xh, %08xh, %08xh) not implemented.\n",
3080 hdc,
3081 cbName,
3082 lpszFilename));
3083
3084 return (FALSE);
3085}
3086
3087
3088/*****************************************************************************
3089 * Name : BOOL GetICMProfileW
3090 * Purpose : The GetICMProfileW function retrieves the name of the color
3091 * profile file for the device associated with the specified device
3092 * context.
3093 * Parameters: HDC hdc handle to device context
3094 * DWORD cbName
3095 * LPWSTR lpszFilename
3096 * Variables :
3097 * Result : TRUE / FALSE
3098 * Remark :
3099 * Status : UNTESTED STUB
3100 *
3101 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
3102 *****************************************************************************/
3103
3104BOOL WIN32API GetICMProfileW(HDC hdc,
3105 DWORD cbName,
3106 LPTSTR lpszFilename)
3107{
3108 dprintf(("GDI32: GetICMProfileW(%08xh, %08xh, %08xh) not implemented.\n",
3109 hdc,
3110 cbName,
3111 lpszFilename));
3112
3113 return (FALSE);
3114}
3115
3116
3117/*****************************************************************************
3118 * Name : BOOL GetLogColorSpaceA
3119 * Purpose : The GetLogColorSpace function retrieves information about the
3120 * logical color space identified by the specified handle.
3121 * Parameters: HCOLORSPACE hColorSpace
3122 * LPLOGCOLORSPACE lpbuffer
3123 * DWORD nSize
3124 * Variables :
3125 * Result : TRUE / FALSE
3126 * Remark :
3127 * Status : UNTESTED STUB
3128 *
3129 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
3130 *****************************************************************************/
3131
3132#define LPLOGCOLORSPACE LPVOID
3133BOOL WIN32API GetLogColorSpaceA(HCOLORSPACE hColorSpace,
3134 LPLOGCOLORSPACE lpBuffer,
3135 DWORD nSize)
3136{
3137 dprintf(("GDI32: GetLogColorSpaceA(%08xh, %08xh, %08xh) not implemented.\n",
3138 hColorSpace,
3139 lpBuffer,
3140 nSize));
3141
3142 return (FALSE);
3143}
3144
3145
3146/*****************************************************************************
3147 * Name : BOOL GetLogColorSpaceW
3148 * Purpose : The GetLogColorSpace function retrieves information about the
3149 * logical color space identified by the specified handle.
3150 * Parameters: HCOLORSPACE hColorSpace
3151 * LPLOGCOLORSPACE lpbuffer
3152 * DWORD nSize
3153 * Variables :
3154 * Result : TRUE / FALSE
3155 * Remark :
3156 * Status : UNTESTED STUB
3157 *
3158 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
3159 *****************************************************************************/
3160
3161BOOL WIN32API GetLogColorSpaceW(HCOLORSPACE hColorSpace,
3162 LPLOGCOLORSPACE lpBuffer,
3163 DWORD nSize)
3164{
3165 dprintf(("GDI32: GetLogColorSpaceW(%08xh, %08xh, %08xh) not implemented.\n",
3166 hColorSpace,
3167 lpBuffer,
3168 nSize));
3169
3170 return (FALSE);
3171}
3172
3173
3174/*****************************************************************************
3175 * Name : int GetMetaRgn
3176 * Purpose : The GetMetaRgn function retrieves the current metaregion for
3177 * the specified device context.
3178 * Parameters: HDC hdc handle of device context
3179 * HRGN hrgn handle of region
3180 * Variables :
3181 * Result : 0 / 1
3182 * Remark :
3183 * Status : UNTESTED STUB
3184 *
3185 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
3186 *****************************************************************************/
3187
3188int WIN32API GetMetaRgn(HDC hdc,
3189 HRGN hrgn)
3190{
3191 dprintf(("GDI32: GetMetaRgn(%08xh, %08xh) not implemented.\n",
3192 hdc,
3193 hrgn));
3194
3195 return (0);
3196}
3197
3198/*****************************************************************************
3199 * Name : BOOL SetDeviceGammaRamp
3200 * Purpose : The SetDeviceGammaRamp function sets the gamma ramp on direct
3201 * color display boards.
3202 * Parameters: HDC hdc handle of device context
3203 * LPVOID lpRamp
3204 * Variables :
3205 * Result : TRUE / FALSE
3206 * Remark :
3207 * Status : UNTESTED STUB
3208 *
3209 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
3210 *****************************************************************************/
3211
3212BOOL WIN32API SetDeviceGammaRamp(HDC hdc,
3213 LPVOID lpRamp)
3214{
3215 dprintf(("GDI32: SetDeviceGammaRamp(%08xh, %08xh) not implemented.\n",
3216 hdc,
3217 lpRamp));
3218
3219 return (FALSE);
3220}
3221
3222
3223/*****************************************************************************
3224 * Name : BOOL SetICMProfileA
3225 * Purpose : The SetICMProfileA function sets the color profile for the
3226 * specified device context.
3227 * Parameters: HDC hdc handle of device context
3228 * LPTSTR lpFileName
3229 * Variables :
3230 * Result : TRUE / FALSE
3231 * Remark :
3232 * Status : UNTESTED STUB
3233 *
3234 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
3235 *****************************************************************************/
3236
3237BOOL WIN32API SetICMProfileA(HDC hdc,
3238 LPTSTR lpFileName)
3239{
3240 dprintf(("GDI32: SetICMProfileA(%08xh, %s) not implemented.\n",
3241 hdc,
3242 lpFileName));
3243
3244 return (FALSE);
3245}
3246
3247
3248/*****************************************************************************
3249 * Name : BOOL SetICMProfileW
3250 * Purpose : The SetICMProfileW function sets the color profile for the
3251 * specified device context.
3252 * Parameters: HDC hdc handle of device context
3253 * LPTSTR lpFileName
3254 * Variables :
3255 * Result : TRUE / FALSE
3256 * Remark :
3257 * Status : UNTESTED STUB
3258 *
3259 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
3260 *****************************************************************************/
3261
3262BOOL WIN32API SetICMProfileW(HDC hdc,
3263 LPWSTR lpFileName)
3264{
3265 dprintf(("GDI32: SetICMProfileW(%08xh, %s) not implemented.\n",
3266 hdc,
3267 lpFileName));
3268
3269 return (FALSE);
3270}
3271
3272
3273/*****************************************************************************
3274 * Name : int SetMetaRgn
3275 * Purpose : The SetMetaRgn function intersects the current clipping region
3276 * for the specified device context with the current metaregion
3277 * and saves the combined region as the new metaregion for the
3278 * specified device context. The clipping region is reset to a null region.
3279 * Parameters: HDC hdc handle of device context
3280 * Variables :
3281 * Result : TRUE / FALSE
3282 * Remark :
3283 * Status : UNTESTED STUB
3284 *
3285 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
3286 *****************************************************************************/
3287
3288BOOL WIN32API SetMetaRgn(HDC hdc)
3289{
3290 dprintf(("GDI32: SetMetaRgn(%08xh) not implemented.\n",
3291 hdc));
3292
3293 return (NULLREGION);
3294}
3295
3296
3297/*****************************************************************************
3298 * Name : BOOL UpdateICMRegKeyA
3299 * Purpose : The UpdateICMRegKeyA function installs, removes, or queries
3300 * registry entries that identify ICC color profiles or color-matching
3301 * DLLs. The function carries out the action specified by the nCommand
3302 * parameter.
3303 * Parameters: DWORD dwReserved
3304 * DWORD CMID
3305 * LPTSTR lpszFileName
3306 * UINT nCommand
3307 * Variables :
3308 * Result : TRUE / FALSE
3309 * Remark :
3310 * Status : UNTESTED STUB
3311 *
3312 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
3313 *****************************************************************************/
3314
3315BOOL WIN32API UpdateICMRegKeyA(DWORD dwReserved,
3316 DWORD CMID,
3317 LPTSTR lpszFileName,
3318 UINT nCommand)
3319{
3320 dprintf(("GDI32: UpdateICMRegKeyA(%08xh, %08xh, %08xh, %08xh) not implemented.\n",
3321 dwReserved,
3322 CMID,
3323 lpszFileName,
3324 nCommand));
3325
3326 return (FALSE);
3327}
3328
3329
3330/*****************************************************************************
3331 * Name : BOOL UpdateICMRegKeyW
3332 * Purpose : The UpdateICMRegKeyW function installs, removes, or queries
3333 * registry entries that identify ICC color profiles or color-matching
3334 * DLLs. The function carries out the action specified by the nCommand
3335 * parameter.
3336 * Parameters: DWORD dwReserved
3337 * DWORD CMID
3338 * LPWSTR lpszFileName
3339 * UINT nCommand
3340 * Variables :
3341 * Result : TRUE / FALSE
3342 * Remark :
3343 * Status : UNTESTED STUB
3344 *
3345 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
3346 *****************************************************************************/
3347
3348BOOL WIN32API UpdateICMRegKeyW(DWORD dwReserved,
3349 DWORD CMID,
3350 LPWSTR lpszFileName,
3351 UINT nCommand)
3352{
3353 dprintf(("GDI32: UpdateICMRegKeyW(%08xh, %08xh, %08xh, %08xh) not implemented.\n",
3354 dwReserved,
3355 CMID,
3356 lpszFileName,
3357 nCommand));
3358
3359 return (FALSE);
3360}
3361
3362
3363
Note: See TracBrowser for help on using the repository browser.