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

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

last of Markus changes to CreateDCW

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