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

Last change on this file since 1666 was 1666, checked in by cbratschi, 26 years ago

don't draw line end

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