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

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

cp fix

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