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

Last change on this file since 1938 was 1938, checked in by achimha, 26 years ago

changes from Markus

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