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

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

EB's Fixes for CreateDCW & CreateICW

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