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

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

removed flipping in dibsection

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