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

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

VT: Codepages changes for CreateCompatibleDC

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