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

Last change on this file since 8706 was 8343, checked in by sandervl, 23 years ago

update

File size: 58.8 KB
Line 
1/* $Id: gdi32.cpp,v 1.81 2002-04-30 13:09:55 sandervl Exp $ */
2
3/*
4 * GDI32 apis
5 *
6 * Copyright 1998 Sander van Leeuwen (sandervl@xs4all.nl)
7 * Copyright 1998 Patrick Haller
8 *
9 * Project Odin Software License can be found in LICENSE.TXT
10 *
11 */
12#include <os2win.h>
13#include <stdlib.h>
14#include <stdarg.h>
15#include <string.h>
16#include <odinwrap.h>
17#include <misc.h>
18#include "callback.h"
19#include "unicode.h"
20#include "dibsect.h"
21#include <codepage.h>
22#include "oslibgpi.h"
23#include "oslibgdi.h"
24#include <dcdata.h>
25#include <winuser32.h>
26#include "font.h"
27#include <stats.h>
28
29#define DBG_LOCALLOG DBG_gdi32
30#include "dbglocal.h"
31
32ODINDEBUGCHANNEL(GDI32-GDI32)
33
34//******************************************************************************
35//******************************************************************************
36//******************************************************************************
37//******************************************************************************
38COLORREF WIN32API SetBkColor(HDC hdc, COLORREF crColor)
39{
40 dprintf(("GDI32: SetBkColor %x to %x", hdc, crColor));
41 return(O32_SetBkColor(hdc, crColor));
42}
43//******************************************************************************
44//******************************************************************************
45COLORREF WIN32API SetTextColor(HDC hdc, COLORREF crColor)
46{
47 COLORREF clr;
48
49 dprintf(("GDI32: SetTextColor %x to %x", hdc, crColor));
50 clr = O32_SetTextColor(hdc, crColor);
51 return(clr);
52}
53//******************************************************************************
54//******************************************************************************
55HGDIOBJ WIN32API GetStockObject(int arg1)
56{
57 HGDIOBJ obj;
58
59 switch(arg1)
60 {
61 case DEFAULT_GUI_FONT:
62 if(NULL==hFntDefaultGui)
63 hFntDefaultGui = CreateFontA( -9, 0, 0, 0, FW_MEDIUM, FALSE,
64 FALSE, FALSE, ANSI_CHARSET,
65 OUT_DEFAULT_PRECIS,
66 CLIP_DEFAULT_PRECIS,
67 DEFAULT_QUALITY,
68 FIXED_PITCH|FF_MODERN, "WarpSans");
69 obj = hFntDefaultGui;
70 break;
71 default:
72 obj = O32_GetStockObject(arg1);
73 break;
74 }
75 dprintf(("GDI32: GetStockObject %d returned %X\n", arg1, obj));
76 return(obj);
77}
78//******************************************************************************
79//******************************************************************************
80ODINFUNCTION3(HPEN, CreatePen, int, fnPenStyle, int, nWidth, COLORREF, crColor)
81{
82 HPEN hPen;
83
84 //CB: todo: PS_DOT is different in Win32 (. . . . and not - - - -)
85 // Open32 looks like LINETYPE_SHORTDASH instead of LINETYPE_DOT!!!
86 // -> difficult to fix without performance decrease!
87
88 hPen = O32_CreatePen(fnPenStyle,nWidth,crColor);
89 if(hPen) STATS_CreatePen(hPen, fnPenStyle,nWidth,crColor);
90 return hPen;
91}
92//******************************************************************************
93//******************************************************************************
94HPEN WIN32API CreatePenIndirect(const LOGPEN * lplgpn)
95{
96 HPEN hPen;
97
98 dprintf(("GDI32: CreatePenIndirect %x", lplgpn));
99 hPen = O32_CreatePenIndirect(lplgpn);
100 if(hPen) STATS_CreatePenIndirect(hPen, lplgpn);
101 return hPen;
102}
103//******************************************************************************
104//******************************************************************************
105HPEN WIN32API ExtCreatePen(DWORD dwPenStyle, DWORD dwWidth, const LOGBRUSH *lplb,
106 DWORD dwStyleCount, const DWORD *lpStyle)
107{
108 HPEN hPen;
109
110 hPen = O32_ExtCreatePen(dwPenStyle, dwWidth, lplb, dwStyleCount, lpStyle);
111 dprintf(("GDI32: ExtCreatePen %x %x %x %x %x returned %x", dwPenStyle, dwWidth, lplb, dwStyleCount, lpStyle, hPen));
112 if(hPen) STATS_ExtCreatePen(hPen, dwPenStyle, dwWidth, lplb, dwStyleCount, lpStyle);
113 return hPen;
114}
115//******************************************************************************
116//******************************************************************************
117HBRUSH WIN32API CreatePatternBrush(HBITMAP hBitmap)
118{
119 HBRUSH hBrush;
120
121 hBrush = O32_CreatePatternBrush(hBitmap);
122 if(hBrush) STATS_CreatePatternBrush(hBrush, hBitmap);
123
124 dprintf(("GDI32: CreatePatternBrush from bitmap %X returned %X\n", hBitmap, hBrush));
125 return(hBrush);
126}
127//******************************************************************************
128//******************************************************************************
129ODINFUNCTION1(HBRUSH, CreateSolidBrush, COLORREF, color)
130{
131 HBRUSH hBrush;
132
133 hBrush = O32_CreateSolidBrush(color);
134 if(hBrush) STATS_CreateSolidBrush(hBrush, color);
135 return(hBrush);
136}
137//******************************************************************************
138//******************************************************************************
139HBRUSH WIN32API CreateBrushIndirect( const LOGBRUSH *pLogBrush)
140{
141 HBRUSH hBrush;
142
143 hBrush = O32_CreateBrushIndirect((LPLOGBRUSH)pLogBrush);
144 dprintf(("GDI32: CreateBrushIndirect %x %x %x returned %x", pLogBrush->lbStyle, pLogBrush->lbColor, pLogBrush->lbHatch, hBrush));
145 if(hBrush) STATS_CreateBrushIndirect(hBrush, (LPLOGBRUSH)pLogBrush);
146 return hBrush;
147}
148//******************************************************************************
149//******************************************************************************
150HBRUSH WIN32API CreateHatchBrush(int fnStyle, COLORREF clrref)
151{
152 HBRUSH hBrush;
153
154 dprintf(("GDI32: CreateHatchBrush %x %x", fnStyle, clrref));
155 hBrush = O32_CreateHatchBrush(fnStyle, clrref);
156 if(hBrush) STATS_CreateHatchBrush(hBrush, fnStyle, clrref);
157 return hBrush;
158}
159//******************************************************************************
160//******************************************************************************
161HBRUSH WIN32API CreateDIBPatternBrushPt( const VOID * buffer, UINT usage)
162{
163 HBRUSH hBrush;
164
165 dprintf(("GDI32: CreateDIBPatternBrushPt %x %x", buffer, usage));
166 hBrush = O32_CreateDIBPatternBrushPt(buffer, usage);
167 if(hBrush) STATS_CreateDIBPatternBrushPt(hBrush, buffer, usage);
168 return hBrush;
169}
170/*****************************************************************************
171 * Name : HBRUSH CreateDIBPatternBrush
172 * Purpose : The CreateDIBPatternBrush function creates a logical brush that
173 * has the pattern specified by the specified device-independent
174 * bitmap (DIB). The brush can subsequently be selected into any
175 * device context that is associated with a device that supports
176 * raster operations.
177 *
178 * This function is provided only for compatibility with applications
179 * written for versions of Windows earlier than 3.0. For Win32-based
180 * applications, use the CreateDIBPatternBrushPt function.
181 * Parameters: HGLOBAL hglbDIBPacked Identifies a global memory object containing
182 * a packed DIB, which consists of a BITMAPINFO structure immediately
183 * followed by an array of bytes defining the pixels of the bitmap.
184 * UINT fuColorSpec color table data
185 * Variables :
186 * Result : TRUE / FALSE
187 * Remark :
188 * Status : ODIN32 COMPLETELY UNTESTED
189 *
190 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
191 * Markus Montkowski [Wen, 1999/01/12 20:00]
192 *****************************************************************************/
193
194HBRUSH WIN32API CreateDIBPatternBrush( HGLOBAL hglbDIBPacked,
195 UINT fuColorSpec)
196{
197 BITMAPINFO *lpMem;
198 HBRUSH ret = 0;
199
200 lpMem = (BITMAPINFO *)GlobalLock(hglbDIBPacked);
201 if(NULL!=lpMem)
202 {
203 dprintf(("GDI32: CreateDIBPatternBrush (%08xh, %08xh) %x (%d,%d) bpp %d",
204 hglbDIBPacked, fuColorSpec, lpMem, lpMem->bmiHeader.biWidth,
205 lpMem->bmiHeader.biHeight, lpMem->bmiHeader.biBitCount));
206
207 ret = CreateDIBPatternBrushPt( lpMem,
208 fuColorSpec);
209 GlobalUnlock(hglbDIBPacked);
210 }
211 else {
212 dprintf(("!ERROR!: CreateDIBPatternBrush (%08xh, %08xh) -> INVALID memory handle!!",
213 hglbDIBPacked, fuColorSpec));
214 }
215 return (ret);
216}
217//******************************************************************************
218//******************************************************************************
219HDC WIN32API CreateCompatibleDC( HDC hdc)
220{
221 HDC newHdc;
222
223 newHdc = O32_CreateCompatibleDC(hdc);
224 ULONG oldcp = OSLibGpiQueryCp(hdc);
225 if (!oldcp) /* If new DC is to be created */
226 oldcp = GetDisplayCodepage();
227
228 if(newHdc) STATS_CreateCompatibleDC(hdc, newHdc);
229 OSLibGpiSetCp(newHdc, oldcp);
230 dprintf(("CreateCompatibleDC %X returned %x", hdc, newHdc));
231 return newHdc;
232}
233//******************************************************************************
234//******************************************************************************
235ODINFUNCTION1(BOOL, DeleteDC, HDC, hdc)
236{
237 pDCData pHps = (pDCData)OSLibGpiQueryDCData((HPS)hdc);
238 if(!pHps)
239 {
240 dprintf(("WARNING: DeleteDC %x; invalid hdc!", hdc));
241 SetLastError(ERROR_INVALID_HANDLE);
242 return 0;
243 }
244 SetLastError(ERROR_SUCCESS);
245
246 DIBSection *dsect = DIBSection::findHDC(hdc);
247 if(dsect)
248 {
249 //remove previously selected dibsection
250 dprintf(("DeleteDC %x, unselect DIB section %x", hdc, dsect->GetBitmapHandle()));
251 dsect->UnSelectDIBObject();
252 }
253
254 //Must call ReleaseDC for window dcs
255 if(pHps->hdcType == TYPE_1) {
256 return ReleaseDC(OS2ToWin32Handle(pHps->hwnd), hdc);
257 }
258
259 STATS_DeleteDC(hdc);
260 return O32_DeleteDC(hdc);
261}
262//******************************************************************************
263//******************************************************************************
264BOOL WIN32API StrokeAndFillPath(HDC hdc)
265{
266 dprintf(("GDI32: StrokeAndFillPath %x", hdc));
267 return O32_StrokeAndFillPath(hdc);
268}
269//******************************************************************************
270//******************************************************************************
271BOOL WIN32API StrokePath(HDC hdc)
272{
273 dprintf(("GDI32: StrokePath %x", hdc));
274 return O32_StrokePath(hdc);
275}
276//******************************************************************************
277//******************************************************************************
278int WIN32API SetBkMode( HDC hdc, int mode)
279{
280 dprintf(("GDI32: SetBkMode %x %d (old %d)", hdc, mode, O32_GetBkMode(hdc)));
281 return O32_SetBkMode(hdc, mode);
282}
283//******************************************************************************
284//******************************************************************************
285COLORREF WIN32API GetPixel( HDC hdc, int x, int y)
286{
287 COLORREF color;
288
289 color = O32_GetPixel(hdc, x, y);
290 dprintf2(("GDI32: GetPixel %x (%d,%d) -> %x", hdc, x, y, color));
291 return color;
292}
293//******************************************************************************
294//******************************************************************************
295COLORREF WIN32API SetPixel( HDC hdc, int x, int y, COLORREF color)
296{
297 dprintf2(("GDI32: SetPixel %x (%d,%d) %x", hdc, x, y, color));
298 return O32_SetPixel(hdc, x, y, color);
299}
300//******************************************************************************
301//Faster version of SetPixel (since it doesn't need to return the original color)
302//Just use SetPixel for now
303//******************************************************************************
304BOOL WIN32API SetPixelV(HDC arg1, int arg2, int arg3, COLORREF arg4)
305{
306 COLORREF rc;
307
308//// dprintf(("GDI32: SetPixelV\n"));
309 rc = O32_SetPixel(arg1, arg2, arg3, arg4);
310 if(rc == GDI_ERROR) // || rc == COLOR_INVALID)
311 return(FALSE);
312 return(TRUE);
313}
314//******************************************************************************
315//******************************************************************************
316BOOL WIN32API GetDCOrgEx(HDC hdc, PPOINT lpPoint)
317{
318 if(lpPoint == NULL) {
319 dprintf(("WARNING: GDI32: GetDCOrgEx %x NULL", hdc));
320 return FALSE;
321 }
322 dprintf(("GDI32: GetDCOrgEx %x (%d,%d)", hdc, lpPoint));
323 return O32_GetDCOrgEx(hdc, lpPoint);
324}
325//******************************************************************************
326//******************************************************************************
327BOOL WIN32API AbortPath(HDC hdc)
328{
329 dprintf(("GDI32: AbortPath %x", hdc));
330 return O32_AbortPath(hdc);
331}
332//******************************************************************************
333//******************************************************************************
334BOOL WIN32API AngleArc( HDC arg1, int arg2, int arg3, DWORD arg4, float arg5, float arg6)
335{
336 dprintf(("GDI32: AngleArc"));
337 return O32_AngleArc(arg1, arg2, arg3, arg4, arg5, arg6);
338}
339//******************************************************************************
340//******************************************************************************
341BOOL WIN32API Arc( HDC arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8, int arg9)
342{
343 dprintf(("GDI32: Arc"));
344 return O32_Arc(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
345}
346//******************************************************************************
347//******************************************************************************
348BOOL WIN32API ArcTo( HDC arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8, int arg9)
349{
350 dprintf(("GDI32: ArcTo"));
351 return O32_ArcTo(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
352}
353//******************************************************************************
354//******************************************************************************
355BOOL WIN32API BeginPath(HDC hdc)
356{
357 dprintf(("GDI32: BeginPath $x", hdc));
358 return O32_BeginPath(hdc);
359}
360//******************************************************************************
361//******************************************************************************
362BOOL WIN32API Chord( HDC arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8, int arg9)
363{
364 dprintf(("GDI32: Chord"));
365 return O32_Chord(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
366}
367//******************************************************************************
368//******************************************************************************
369BOOL WIN32API CloseFigure(HDC hdc)
370{
371 dprintf(("GDI32: CloseFigure %x", hdc));
372 return O32_CloseFigure(hdc);
373}
374//******************************************************************************
375//******************************************************************************
376HDC WIN32API CreateDCA(LPCSTR lpszDriver, LPCSTR lpszDevice, LPCSTR lpszOutput, const DEVMODEA *lpInitData)
377{
378 HDC hdc;
379
380 // 2001-05-28 PH
381 // Ziff Davis Benchmarks come in here with "display".
382 // Obviously, Windows does accept case-insensitive driver names,
383 // whereas Open32 doesn't.
384 if (*lpszDriver == 'd') // quick check
385 {
386 // then do a double-check and use the uppercase constant
387 // instead
388 if (stricmp(lpszDriver, "DISPLAY") == 0)
389 lpszDriver = "DISPLAY";
390 }
391
392 hdc = O32_CreateDC(lpszDriver, lpszDevice, lpszOutput, lpInitData);
393 if(hdc) {
394 OSLibGpiSetCp(hdc, GetDisplayCodepage());
395 STATS_CreateDCA(hdc, lpszDriver, lpszDevice, lpszOutput, lpInitData);
396 }
397
398 dprintf(("GDI32: CreateDCA %s %s %s %x returned %x", lpszDriver, lpszDevice, lpszOutput, lpInitData, hdc));
399 return hdc;
400}
401//******************************************************************************
402//******************************************************************************
403HDC WIN32API CreateDCW( LPCWSTR arg1, LPCWSTR arg2, LPCWSTR arg3, const DEVMODEW * arg4)
404{
405 char *astring4, *astring5;
406
407 char *astring1 = UnicodeToAsciiString((LPWSTR)arg1);
408 char *astring2 = UnicodeToAsciiString((LPWSTR)arg2);
409 char *astring3 = UnicodeToAsciiString((LPWSTR)arg3);
410
411 if(arg4)
412 {
413 astring4 = UnicodeToAsciiString((LPWSTR)(arg4->dmDeviceName));
414 astring5 = UnicodeToAsciiString((LPWSTR)(arg4->dmFormName));
415 }
416
417 HDC rc;
418 DEVMODEA devmode;
419
420 dprintf(("GDI32: CreateDCW"));
421
422 if(arg4)
423 {
424 strcpy((char*)devmode.dmDeviceName, astring4);
425 strcpy((char*)devmode.dmFormName, astring5);
426
427 devmode.dmSpecVersion = arg4->dmSpecVersion;
428 devmode.dmDriverVersion = arg4->dmDriverVersion;
429 devmode.dmSize = arg4->dmSize;
430 devmode.dmDriverExtra = arg4->dmDriverExtra;
431 devmode.dmFields = arg4->dmFields;
432 devmode.dmOrientation = arg4->dmOrientation;
433 devmode.dmPaperSize = arg4->dmPaperSize;
434 devmode.dmPaperLength = arg4->dmPaperLength;
435 devmode.dmPaperWidth = arg4->dmPaperWidth;
436 devmode.dmScale = arg4->dmScale;
437 devmode.dmCopies = arg4->dmCopies;
438 devmode.dmDefaultSource = arg4->dmDefaultSource;
439 devmode.dmPrintQuality = arg4->dmPrintQuality;
440 devmode.dmColor = arg4->dmColor;
441 devmode.dmDuplex = arg4->dmDuplex;
442 devmode.dmYResolution = arg4->dmYResolution;
443 devmode.dmTTOption = arg4->dmTTOption;
444 devmode.dmCollate = arg4->dmCollate;
445 devmode.dmLogPixels = arg4->dmLogPixels;
446 devmode.dmBitsPerPel = arg4->dmBitsPerPel;
447 devmode.dmPelsWidth = arg4->dmPelsWidth;
448 devmode.dmPelsHeight = arg4->dmPelsHeight;
449 devmode.dmDisplayFlags = arg4->dmDisplayFlags;
450 devmode.dmDisplayFrequency = arg4->dmDisplayFrequency;
451 devmode.dmICMMethod = arg4->dmICMMethod;
452 devmode.dmICMIntent = arg4->dmICMIntent;
453 devmode.dmMediaType = arg4->dmMediaType;
454 devmode.dmDitherType = arg4->dmDitherType;
455 devmode.dmReserved1 = arg4->dmReserved1;
456 devmode.dmReserved2 = arg4->dmReserved2;
457 rc = CreateDCA(astring1,astring2,astring3,&devmode);
458 }
459 else
460 rc = CreateDCA(astring1,astring2,astring3, NULL);
461
462 FreeAsciiString(astring1);
463 FreeAsciiString(astring2);
464 FreeAsciiString(astring3);
465
466 if(arg4)
467 {
468 FreeAsciiString(astring4);
469 FreeAsciiString(astring5);
470 }
471
472 return rc;
473}
474//******************************************************************************
475//******************************************************************************
476HDC WIN32API CreateICA(LPCSTR lpszDriver, LPCSTR lpszDevice, LPCSTR lpszOutput,
477 const DEVMODEA *lpdvmInit)
478{
479 static char *szDisplay = "DISPLAY";
480 HDC hdc;
481
482 dprintf(("GDI32: CreateICA"));
483 //SvL: Open32 tests for "DISPLAY"
484 if(lpszDriver && !strcmp(lpszDriver, "display")) {
485 lpszDriver = szDisplay;
486 }
487 //SvL: Open32 tests lpszDriver for NULL even though it's ignored
488 if(lpszDriver == NULL) {
489 lpszDriver = lpszDevice;
490 }
491 hdc = O32_CreateIC(lpszDriver, lpszDevice, lpszOutput, lpdvmInit);
492 if(hdc) STATS_CreateICA(hdc, lpszDriver, lpszDevice, lpszOutput, lpdvmInit);
493 return hdc;
494}
495//******************************************************************************
496//******************************************************************************
497HDC WIN32API CreateICW( LPCWSTR arg1, LPCWSTR arg2, LPCWSTR arg3, const DEVMODEW * arg4)
498{
499 char *astring4, *astring5;
500
501 char *astring1 = UnicodeToAsciiString((LPWSTR)arg1);
502 char *astring2 = UnicodeToAsciiString((LPWSTR)arg2);
503 char *astring3 = UnicodeToAsciiString((LPWSTR)arg3);
504 if(arg4)
505 {
506 astring4 = UnicodeToAsciiString((LPWSTR)(arg4->dmDeviceName));
507 astring5 = UnicodeToAsciiString((LPWSTR)(arg4->dmFormName));
508 }
509
510 HDC rc;
511 DEVMODEA devmode;
512
513 dprintf(("GDI32: CreateICW"));
514
515 if(arg4)
516 {
517 strcpy((char*)devmode.dmDeviceName, astring4);
518 strcpy((char*)devmode.dmFormName, astring5);
519
520 devmode.dmSpecVersion = arg4->dmSpecVersion;
521 devmode.dmDriverVersion = arg4->dmDriverVersion;
522 devmode.dmSize = arg4->dmSize;
523 devmode.dmDriverExtra = arg4->dmDriverExtra;
524 devmode.dmFields = arg4->dmFields;
525 devmode.dmOrientation = arg4->dmOrientation;
526 devmode.dmPaperSize = arg4->dmPaperSize;
527 devmode.dmPaperLength = arg4->dmPaperLength;
528 devmode.dmPaperWidth = arg4->dmPaperWidth;
529 devmode.dmScale = arg4->dmScale;
530 devmode.dmCopies = arg4->dmCopies;
531 devmode.dmDefaultSource = arg4->dmDefaultSource;
532 devmode.dmPrintQuality = arg4->dmPrintQuality;
533 devmode.dmColor = arg4->dmColor;
534 devmode.dmDuplex = arg4->dmDuplex;
535 devmode.dmYResolution = arg4->dmYResolution;
536 devmode.dmTTOption = arg4->dmTTOption;
537 devmode.dmCollate = arg4->dmCollate;
538 devmode.dmLogPixels = arg4->dmLogPixels;
539 devmode.dmBitsPerPel = arg4->dmBitsPerPel;
540 devmode.dmPelsWidth = arg4->dmPelsWidth;
541 devmode.dmPelsHeight = arg4->dmPelsHeight;
542 devmode.dmDisplayFlags = arg4->dmDisplayFlags;
543 devmode.dmDisplayFrequency = arg4->dmDisplayFrequency;
544 devmode.dmICMMethod = arg4->dmICMMethod;
545 devmode.dmICMIntent = arg4->dmICMIntent;
546 devmode.dmMediaType = arg4->dmMediaType;
547 devmode.dmDitherType = arg4->dmDitherType;
548 devmode.dmReserved1 = arg4->dmReserved1;
549 devmode.dmReserved2 = arg4->dmReserved2;
550
551 rc = CreateICA(astring1,astring2,astring3,&devmode);
552 }
553 else
554 rc = CreateICA(astring1,astring2,astring3, NULL);
555
556 FreeAsciiString(astring1);
557 FreeAsciiString(astring2);
558 FreeAsciiString(astring3);
559 if(arg4)
560 {
561 FreeAsciiString(astring4);
562 FreeAsciiString(astring5);
563 }
564
565 return rc;
566}
567//******************************************************************************
568//******************************************************************************
569BOOL WIN32API Ellipse(HDC hdc, int nLeftRect, int nTopRect, int nRightRect,
570 int nBottomRect)
571{
572 dprintf(("GDI32: Ellipse %x (%d,%d)(%d,%d)", nLeftRect, nTopRect, nRightRect, nBottomRect));
573 return O32_Ellipse(hdc, nLeftRect, nTopRect, nRightRect, nBottomRect);
574}
575//******************************************************************************
576//******************************************************************************
577BOOL WIN32API EndPath( HDC hdc)
578{
579 dprintf(("GDI32: EndPath %x", hdc));
580 return O32_EndPath(hdc);
581}
582//******************************************************************************
583//******************************************************************************
584ODINFUNCTION5(BOOL, Rectangle, HDC, hdc, int, left, int, top, int, right, int, bottom)
585{
586 return O32_Rectangle(hdc, left, top, right, bottom);
587}
588//******************************************************************************
589//******************************************************************************
590VOID dumpROP2(INT rop2)
591{
592 CHAR *name;
593
594 switch (rop2)
595 {
596 case R2_BLACK:
597 name = "R2_BLACK";
598 break;
599
600 case R2_COPYPEN:
601 name = "R2_COPYPEN";
602 break;
603
604 case R2_MASKNOTPEN:
605 name = "R2_MASKNOTPEN";
606 break;
607
608 case R2_MASKPEN:
609 name = "R2_MASKPEN";
610 break;
611
612 case R2_MASKPENNOT:
613 name = "R2_MASKPENNOT";
614 break;
615
616 case R2_MERGENOTPEN:
617 name = "R2_MERGENOTPEN";
618 break;
619
620 case R2_MERGEPEN:
621 name = "R2_MERGEPEN";
622 break;
623
624 case R2_MERGEPENNOT:
625 name = "R2_MERGEPENNOT";
626 break;
627
628 case R2_NOP:
629 name = "R2_NOP";
630 break;
631
632 case R2_NOT:
633 name = "R2_NOT";
634 break;
635
636 case R2_NOTCOPYPEN:
637 name = "R2_NOTCOPYPEN";
638 break;
639
640 case R2_NOTMASKPEN:
641 name = "R2_NOTMASKPEN";
642 break;
643
644 case R2_NOTMERGEPEN:
645 name = "R2_NOTMERGEPEN";
646 break;
647
648 case R2_WHITE:
649 name = "R2_WHITE";
650 break;
651
652 case R2_XORPEN:
653 name = "R2_XORPEN";
654 break;
655
656 default:
657 name = "unknown mode!!!";
658 break;
659 }
660
661 dprintf((" ROP2 mode = %s",name));
662}
663//******************************************************************************
664//******************************************************************************
665int WIN32API SetROP2( HDC hdc, int rop2)
666{
667 dprintf(("GDI32: SetROP2 %x %x", hdc, rop2));
668 #ifdef DEBUG
669 dumpROP2(rop2);
670 #endif
671 return O32_SetROP2(hdc, rop2);
672}
673//******************************************************************************
674//******************************************************************************
675int WIN32API Escape( HDC hdc, int nEscape, int cbInput, LPCSTR lpvInData, PVOID lpvOutData)
676{
677 int rc;
678
679 rc = O32_Escape(hdc, nEscape, cbInput, lpvInData, lpvOutData);
680 if(rc == 0) {
681 dprintf(("GDI32: Escape %x %d %d %x %x returned %d (WARNING: might not be implemented!!) ", hdc, nEscape, cbInput, lpvInData, lpvOutData, rc));
682 }
683 else dprintf(("GDI32: Escape %x %d %d %x %x returned %d ", hdc, nEscape, cbInput, lpvInData, lpvOutData, rc));
684
685 return rc;
686}
687//******************************************************************************
688//******************************************************************************
689BOOL WIN32API ExtFloodFill( HDC arg1, int arg2, int arg3, COLORREF arg4, UINT arg5)
690{
691 dprintf(("GDI32: ExtFloodFill"));
692 return O32_ExtFloodFill(arg1, arg2, arg3, arg4, arg5);
693}
694//******************************************************************************
695//******************************************************************************
696BOOL WIN32API FillPath( HDC arg1)
697{
698 dprintf(("GDI32: FillPath"));
699 return O32_FillPath(arg1);
700}
701//******************************************************************************
702//******************************************************************************
703BOOL WIN32API FlattenPath( HDC arg1)
704{
705 dprintf(("GDI32: FlattenPath"));
706 return O32_FlattenPath(arg1);
707}
708//******************************************************************************
709//******************************************************************************
710BOOL WIN32API FloodFill(HDC arg1, int arg2, int arg3, COLORREF arg4)
711{
712 dprintf(("GDI32: FloodFill"));
713 return O32_FloodFill(arg1, arg2, arg3, arg4);
714}
715//******************************************************************************
716//******************************************************************************
717int WIN32API GetArcDirection( HDC arg1)
718{
719 dprintf(("GDI32: GetArcDirection"));
720 return O32_GetArcDirection(arg1);
721}
722//******************************************************************************
723//******************************************************************************
724BOOL WIN32API GetAspectRatioFilterEx( HDC arg1, PSIZE arg2)
725{
726 dprintf(("GDI32: GetAspectRatioFilterEx"));
727 return O32_GetAspectRatioFilterEx(arg1, arg2);
728}
729//******************************************************************************
730//******************************************************************************
731COLORREF WIN32API GetBkColor(HDC hdc)
732{
733 COLORREF color;
734
735 color = O32_GetBkColor(hdc);
736 dprintf(("GDI32: GetBkColor %x returned %x", hdc, color));
737 return color;
738}
739//******************************************************************************
740//******************************************************************************
741int WIN32API GetBkMode(HDC hdc)
742{
743 int bkmode;
744
745 bkmode = O32_GetBkMode(hdc);
746 dprintf(("GDI32: GetBkMode %x returned %d", hdc, bkmode));
747 return bkmode;
748}
749//******************************************************************************
750//******************************************************************************
751UINT WIN32API GetBoundsRect( HDC arg1, PRECT arg2, UINT arg3)
752{
753 dprintf(("GDI32: GetBoundsRect"));
754 return O32_GetBoundsRect(arg1, arg2, arg3);
755}
756//******************************************************************************
757//******************************************************************************
758BOOL WIN32API GetBrushOrgEx( HDC arg1, PPOINT arg2)
759{
760 dprintf(("GDI32: GetBrushOrgEx"));
761 return O32_GetBrushOrgEx(arg1, arg2);
762}
763//******************************************************************************
764//******************************************************************************
765BOOL WIN32API GetCharABCWidthsA( HDC arg1, UINT arg2, UINT arg3, LPABC arg4)
766{
767 dprintf(("GDI32: GetCharABCWidthsA"));
768 return O32_GetCharABCWidths(arg1, arg2, arg3, arg4);
769}
770//******************************************************************************
771//******************************************************************************
772BOOL WIN32API GetCharABCWidthsW( HDC arg1, UINT arg2, UINT arg3, LPABC arg4)
773{
774 dprintf(("GDI32: GetCharABCWidthsW not properly implemented."));
775 // NOTE: This will not work as is (needs UNICODE support)
776 return O32_GetCharABCWidths(arg1, arg2, arg3, arg4);
777}
778//******************************************************************************
779//******************************************************************************
780BOOL WIN32API GetCharWidth32A( HDC hdc, UINT iFirstChar, UINT iLastChar, PINT pWidthArray)
781{
782 BOOL ret;
783
784 dprintf(("GDI32: GetCharWidth32A %x %x %x %x", hdc, iFirstChar, iLastChar, pWidthArray));
785 ret = O32_GetCharWidth(hdc, iFirstChar, iLastChar, pWidthArray);
786 dprintf(("GDI32: GetCharWidth32A returned %d", ret));
787#ifdef DEBUG
788 if(ret) {
789 for(int i=iFirstChar;i<iLastChar;i++) {
790 if((i >= 'a' && i <= 'z') || (i >= 'A' && i <= 'Z')) {
791 dprintf2(("Char %c -> width %d", i, pWidthArray[i]));
792 }
793 else dprintf2(("Char %x -> width %d", i, pWidthArray[i]));
794 }
795 }
796#endif
797 return ret;
798}
799//******************************************************************************
800//TODO: Cut off Unicode chars?
801//******************************************************************************
802BOOL WIN32API GetCharWidth32W(HDC hdc, UINT iFirstChar, UINT iLastChar, PINT pWidthArray)
803{
804 dprintf(("GDI32: GetCharWidth32W might not work properly %x %x %x %x", hdc, iFirstChar, iLastChar, pWidthArray));
805 return O32_GetCharWidth(hdc, iFirstChar, iLastChar, pWidthArray);
806}
807//******************************************************************************
808//******************************************************************************
809BOOL WIN32API GetCurrentPositionEx( HDC hdc, PPOINT lpPoint)
810{
811 BOOL rc;
812
813 dprintf(("GDI32: GetCurrentPositionEx %x", hdc));
814 rc = O32_GetCurrentPositionEx(hdc, lpPoint);
815 dprintf(("GDI32: GetCurrentPositionEx returned %d (%d,%d)", rc, lpPoint->x, lpPoint->y));
816 return rc;
817}
818//******************************************************************************
819//******************************************************************************
820int WIN32API GetDeviceCaps(HDC hdc, int nIndex)
821{
822 int rc;
823
824 rc = O32_GetDeviceCaps(hdc, nIndex);
825 dprintf(("GDI32: GetDeviceCaps %X, %d returned %d\n", hdc, nIndex, rc));
826 //SvL: 13-9-'98: NT returns -1 when using 16 bits colors, NOT 65536!
827 if(nIndex == NUMCOLORS && rc > 256)
828 return -1;
829
830 return(rc);
831}
832//******************************************************************************
833//******************************************************************************
834DWORD WIN32API GetKerningPairsA( HDC arg1, DWORD arg2, LPKERNINGPAIR arg3)
835{
836 dprintf(("GDI32: GetKerningPairsA"));
837 return O32_GetKerningPairs(arg1, arg2, arg3);
838}
839//******************************************************************************
840//******************************************************************************
841DWORD WIN32API GetKerningPairsW( HDC arg1, DWORD arg2, LPKERNINGPAIR arg3)
842{
843 dprintf(("GDI32: GetKerningPairsW"));
844 // NOTE: This will not work as is (needs UNICODE support)
845 return O32_GetKerningPairs(arg1, arg2, arg3);
846}
847//******************************************************************************
848//******************************************************************************
849BOOL WIN32API GetMiterLimit( HDC arg1, float * arg2)
850{
851 dprintf(("GDI32: GetMiterLimit"));
852 return O32_GetMiterLimit(arg1, arg2);
853}
854//******************************************************************************
855//******************************************************************************
856COLORREF WIN32API GetNearestColor( HDC arg1, COLORREF arg2)
857{
858 dprintf(("GDI32: GetNearestColor\n"));
859 return O32_GetNearestColor(arg1, arg2);
860}
861//******************************************************************************
862//******************************************************************************
863INT WIN32API GetPath( HDC hdc, PPOINT arg2, PBYTE arg3, int arg4)
864{
865 dprintf(("GDI32: GetPath %x", hdc));
866 return O32_GetPath(hdc, arg2, arg3, arg4);
867}
868//******************************************************************************
869//******************************************************************************
870int WIN32API GetPolyFillMode( HDC hdc)
871{
872 dprintf(("GDI32: GetPolyFillMode", hdc));
873 return O32_GetPolyFillMode(hdc);
874}
875//******************************************************************************
876//******************************************************************************
877int WIN32API GetROP2( HDC hdc)
878{
879 dprintf(("GDI32: GetROP2 %x", hdc));
880 return O32_GetROP2(hdc);
881}
882//******************************************************************************
883//******************************************************************************
884BOOL WIN32API GetRasterizerCaps(LPRASTERIZER_STATUS arg1, UINT arg2)
885{
886 dprintf(("GDI32: GetRasterizerCaps"));
887 return O32_GetRasterizerCaps(arg1, arg2);
888}
889//******************************************************************************
890//******************************************************************************
891UINT WIN32API GetTextAlign( HDC hdc)
892{
893 dprintf(("GDI32: GetTextAlign %x", hdc));
894 return O32_GetTextAlign(hdc);
895}
896//******************************************************************************
897//******************************************************************************
898int WIN32API GetTextCharacterExtra( HDC hdc)
899{
900 dprintf(("GDI32: GetTextCharacterExtra", hdc));
901 return O32_GetTextCharacterExtra(hdc);
902}
903//******************************************************************************
904//******************************************************************************
905COLORREF WIN32API GetTextColor( HDC hdc)
906{
907 COLORREF color;
908
909 color = O32_GetTextColor(hdc);
910 dprintf(("GDI32: GetTextColor %x -> %x", hdc, color));
911 return color;
912}
913//******************************************************************************
914//******************************************************************************
915BOOL WIN32API Pie(HDC hdc, int nLeftRect, int nTopRect, int nRightRect,
916 int nBottomRect, int nXRadial1, int nYRadial1, int nXRadial2,
917 int nYRadial2)
918{
919 dprintf(("GDI32: Pie %x (%d,%d)(%d,%d) (%d,%d) (%d,%d)", hdc, nLeftRect, nTopRect, nRightRect,
920 nBottomRect, nXRadial1, nYRadial1, nXRadial2, nYRadial2));
921
922 //CB: bug in O32_Pie
923 if (nXRadial1 == nXRadial2 && nYRadial1 == nYRadial2)
924 return O32_Ellipse(hdc,nLeftRect,nTopRect,nRightRect,nBottomRect);
925 else
926 return O32_Pie(hdc,nLeftRect,nTopRect,nRightRect,nBottomRect,nXRadial1,nYRadial1,nXRadial2,nYRadial2);
927}
928//******************************************************************************
929//******************************************************************************
930BOOL WIN32API PolyBezier( HDC arg1, const POINT * arg2, DWORD arg3)
931{
932 dprintf(("GDI32: PolyBezier"));
933 return O32_PolyBezier(arg1, arg2, (int)arg3);
934}
935//******************************************************************************
936//******************************************************************************
937BOOL WIN32API PolyBezierTo( HDC arg1, const POINT * arg2, DWORD arg3)
938{
939 dprintf(("GDI32: PolyBezierTo"));
940 return O32_PolyBezierTo(arg1, arg2, arg3);
941}
942//******************************************************************************
943//******************************************************************************
944BOOL WIN32API PolyDraw( HDC arg1, const POINT * arg2, const BYTE * arg3, DWORD arg4)
945{
946 dprintf(("GDI32: PolyDraw"));
947 return O32_PolyDraw(arg1, arg2, arg3, arg4);
948}
949//******************************************************************************
950//******************************************************************************
951BOOL WIN32API PolyPolygon( HDC arg1, const POINT * arg2, const INT * arg3, UINT arg4)
952{
953 dprintf(("GDI32: PolyPolygon"));
954 return O32_PolyPolygon(arg1, arg2, arg3, arg4);
955}
956//******************************************************************************
957//******************************************************************************
958BOOL WIN32API PolyPolyline( HDC hdc, const POINT * lppt, const DWORD * lpdwPolyPoints, DWORD cCount)
959{
960 dprintf(("GDI32: PolyPolyline %x %x %x %d", hdc, lppt, lpdwPolyPoints, cCount));
961
962 return O32_PolyPolyline(hdc,lppt,lpdwPolyPoints,cCount);
963}
964//******************************************************************************
965//******************************************************************************
966BOOL WIN32API Polygon( HDC hdc, const POINT *lpPoints, int count)
967{
968 dprintf(("GDI32: Polygon %x %x %d", hdc, lpPoints, count));
969 return O32_Polygon(hdc, lpPoints, count);
970}
971//******************************************************************************
972//******************************************************************************
973BOOL WIN32API PtVisible( HDC hdc, int x, int y)
974{
975 dprintf(("GDI32: PtVisible %x (%d,%d)", hdc, x, y));
976 return O32_PtVisible(hdc, x, y);
977}
978//******************************************************************************
979//******************************************************************************
980BOOL WIN32API RectVisible( HDC hdc, const RECT *lpRect)
981{
982 if(lpRect == NULL) {
983 dprintf(("WARNING: GDI32: RectVisible %x lpRect == NULL!"));
984 return FALSE;
985 }
986 dprintf(("GDI32: RectVisible %x (%d,%d)(%d,%d)", hdc, lpRect->left, lpRect->top, lpRect->right, lpRect->bottom));
987 return O32_RectVisible(hdc, lpRect);
988}
989//******************************************************************************
990//******************************************************************************
991HDC WIN32API ResetDCA( HDC arg1, const DEVMODEA * arg2)
992{
993 dprintf(("GDI32: ResetDCA\n"));
994 return (HDC)O32_ResetDC(arg1, arg2);
995}
996//******************************************************************************
997//******************************************************************************
998HDC WIN32API ResetDCW( HDC arg1, const DEVMODEW * arg2)
999{
1000 dprintf(("GDI32: ResetDCW\n"));
1001 // NOTE: This will not work as is (needs UNICODE support)
1002 return (HDC)O32_ResetDC(arg1, (const DEVMODEA *)arg2);
1003}
1004//******************************************************************************
1005//******************************************************************************
1006BOOL WIN32API RestoreDC(HDC hdc, int id)
1007{
1008 BOOL ret;
1009
1010 dprintf(("GDI32: RestoreDC %x %d", hdc, id));
1011
1012 ret = O32_RestoreDC(hdc, id);
1013 if(ret == FALSE) {
1014 dprintf(("ERROR: GDI32: RestoreDC %x %d FAILED", hdc, id));
1015 }
1016 return ret;
1017}
1018//******************************************************************************
1019//******************************************************************************
1020BOOL WIN32API RoundRect( HDC arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7)
1021{
1022 dprintf(("GDI32: RoundRect"));
1023 return O32_RoundRect(arg1, arg2, arg3, arg4, arg5, arg6, arg7);
1024}
1025//******************************************************************************
1026//******************************************************************************
1027int WIN32API SaveDC( HDC hdc)
1028{
1029 int id;
1030
1031 dprintf(("GDI32: SaveDC %x", hdc));
1032 id = O32_SaveDC(hdc);
1033 if(id == 0) {
1034 dprintf(("ERROR: GDI32: SaveDC %x FAILED", hdc));
1035 }
1036 else dprintf(("GDI32: SaveDC %x returned %d", hdc, id));
1037 return id;
1038}
1039//******************************************************************************
1040//******************************************************************************
1041int WIN32API SetArcDirection( HDC arg1, int arg2)
1042{
1043 dprintf(("GDI32: SetArcDirection"));
1044 return O32_SetArcDirection(arg1, arg2);
1045}
1046//******************************************************************************
1047//******************************************************************************
1048UINT WIN32API SetBoundsRect( HDC arg1, const RECT * arg2, UINT arg3)
1049{
1050 dprintf(("GDI32: SetBoundsRect"));
1051 return O32_SetBoundsRect(arg1, arg2, arg3);
1052}
1053//******************************************************************************
1054//******************************************************************************
1055BOOL WIN32API SetBrushOrgEx( HDC arg1, int arg2, int arg3, PPOINT arg4)
1056{
1057 BOOL rc;
1058
1059 rc = O32_SetBrushOrgEx(arg1, arg2, arg3, arg4);
1060 dprintf(("GDI32: SetBrushOrgEx returned %d\n", rc));
1061 return(rc);
1062}
1063//******************************************************************************
1064//******************************************************************************
1065ODINFUNCTION2(DWORD, SetMapperFlags, HDC, hdc, DWORD, dwFlag)
1066{
1067 return O32_SetMapperFlags(hdc, dwFlag);
1068}
1069//******************************************************************************
1070//******************************************************************************
1071ODINFUNCTION3(BOOL, SetMiterLimit, HDC, hdc, float, eNewLimit, float* ,peOldLimit)
1072{
1073 return O32_SetMiterLimit(hdc, eNewLimit, peOldLimit);
1074}
1075//******************************************************************************
1076//******************************************************************************
1077ODINFUNCTION2(int, SetPolyFillMode, HDC, hdc, int, iPolyFillMode)
1078{
1079 return O32_SetPolyFillMode(hdc, iPolyFillMode);
1080}
1081//******************************************************************************
1082//******************************************************************************
1083ODINFUNCTION2(UINT, SetTextAlign, HDC, hdc, UINT, fMode)
1084{
1085 return O32_SetTextAlign(hdc, fMode);
1086}
1087//******************************************************************************
1088//******************************************************************************
1089ODINFUNCTION2(int, SetTextCharacterExtra, HDC, hdc, int, nCharExtra)
1090{
1091 return O32_SetTextCharacterExtra(hdc, nCharExtra);
1092}
1093//******************************************************************************
1094//******************************************************************************
1095ODINFUNCTION3(BOOL, SetTextJustification, HDC, hdc, int, nBreakExtra, int, nBreakCount)
1096{
1097 return O32_SetTextJustification(hdc, nBreakExtra, nBreakCount);
1098}
1099//******************************************************************************
1100//******************************************************************************
1101BOOL WIN32API WidenPath( HDC hdc)
1102{
1103 dprintf(("GDI32: WidenPath %x", hdc));
1104 return O32_WidenPath(hdc);
1105}
1106//******************************************************************************
1107//Selects the current path as a clipping region for a device context, combining
1108//any existing clipping region by using the specified mode
1109//TODO: Can be emulated with SelectClipRegion??
1110//******************************************************************************
1111BOOL WIN32API SelectClipPath(HDC hdc, int iMode)
1112{
1113 dprintf(("GDI32: SelectClipPath, not implemented!(TRUE)\n"));
1114 return(TRUE);
1115}
1116//******************************************************************************
1117//TODO: Sets the color adjustment values for a device context. (used to adjust
1118// the input color of the src bitmap for calls of StretchBlt & StretchDIBits
1119// functions when HALFTONE mode is set
1120//******************************************************************************
1121BOOL WIN32API SetColorAdjustment(HDC hdc, CONST COLORADJUSTMENT *lpca)
1122{
1123 dprintf(("GDI32: SetColorAdjustment, not implemented!(TRUE)\n"));
1124 return(TRUE);
1125}
1126//******************************************************************************
1127//Maps colors to system palette; faster way to update window (instead of redrawing)
1128//We just redraw
1129//******************************************************************************
1130BOOL WIN32API UpdateColors(HDC hdc)
1131{
1132 dprintf(("GDI32: UpdateColors\n"));
1133 return InvalidateRect(WindowFromDC(hdc), NULL, FALSE);
1134}
1135//******************************************************************************
1136//******************************************************************************
1137BOOL WIN32API GdiFlush()
1138{
1139 dprintf(("GDI32: GdiFlush, not implemented (TRUE)\n"));
1140 return(TRUE);
1141}
1142//******************************************************************************
1143//******************************************************************************
1144BOOL WIN32API GdiComment(HDC hdc, UINT cbSize, CONST BYTE *lpData)
1145{
1146 dprintf(("GDI32: GdiComment %x %d %x NOT IMPLEMENTED", hdc, cbSize, lpData));
1147// return O32_GdiComment(hdc, cbSize, lpData);
1148 return TRUE;
1149}
1150//******************************************************************************
1151//******************************************************************************
1152BOOL WIN32API GetCharWidthFloatA(HDC hdc, UINT iFirstChar, UINT iLastChar, PFLOAT pxBUffer)
1153{
1154 dprintf(("GDI32: GetCharWidthFloatA, not implemented\n"));
1155 return(FALSE);
1156}
1157//******************************************************************************
1158//******************************************************************************
1159BOOL WIN32API GetCharWidthFloatW(HDC hdc, UINT iFirstChar, UINT iLastChar, PFLOAT pxBUffer)
1160{
1161 dprintf(("GDI32: GetCharWidthFloatW, not implemented\n"));
1162 return(FALSE);
1163}
1164//******************************************************************************
1165//******************************************************************************
1166BOOL WIN32API GetCharABCWidthsFloatA(HDC hdc, UINT iFirstChar, UINT iLastChar, LPABCFLOAT pxBUffer)
1167{
1168 dprintf(("GDI32: GetCharABCWidthsFloatA, not implemented\n"));
1169 return(FALSE);
1170}
1171//******************************************************************************
1172//******************************************************************************
1173BOOL WIN32API GetCharABCWidthsFloatW(HDC hdc,
1174 UINT iFirstChar,
1175 UINT iLastChar,
1176 LPABCFLOAT pxBUffer)
1177{
1178 dprintf(("GDI32: GetCharABCWidthsFloatA, not implemented\n"));
1179 return(FALSE);
1180}
1181//******************************************************************************
1182//******************************************************************************
1183INT WIN32API ExtEscape(HDC hdc, INT nEscape, INT cbInput, LPCSTR lpszInData,
1184 INT cbOutput, LPSTR lpszOutData)
1185{
1186 dprintf(("GDI32: ExtEscape, %x %x %d %x %d %x not implemented", hdc, nEscape, cbInput, lpszInData, cbOutput, lpszOutData));
1187#ifdef DEBUG
1188 if(cbInput && lpszInData) {
1189 ULONG *tmp = (ULONG *)lpszInData;
1190 for(int i=0;i<cbInput/4;i++) {
1191 dprintf(("GDI32: ExtEscape par %d: %x", i, *tmp++));
1192 }
1193 }
1194#endif
1195 return(0);
1196}
1197//******************************************************************************
1198//******************************************************************************
1199int WIN32API DrawEscape(HDC hdc, int nEscape, int cbInput, LPCSTR lpszInData)
1200{
1201 dprintf(("GDI32: DrawEscape, not implemented\n"));
1202 return(0);
1203}
1204//******************************************************************************
1205//******************************************************************************
1206BOOL WIN32API GetColorAdjustment(HDC hdc, COLORADJUSTMENT *lpca)
1207{
1208 dprintf(("GDI32: GetColorAdjustment, not implemented\n"));
1209 return(FALSE);
1210}
1211//******************************************************************************
1212//******************************************************************************
1213DWORD WIN32API GetGlyphOutlineA(HDC hdc, UINT uChar, UINT uFormat, LPGLYPHMETRICS lpgm,
1214 DWORD cbBuffer, LPVOID lpvBuffer, CONST MAT2 *lpmat2)
1215{
1216 dprintf(("GDI32: GetGlyphOutLineA, not implemented (GDI_ERROR)\n"));
1217 return(GDI_ERROR);
1218}
1219//******************************************************************************
1220
1221//******************************************************************************
1222/*KSO Thu 21.05.1998*/
1223DWORD WIN32API GetGlyphOutlineW(HDC hdc, UINT uChar, UINT uFormat, LPGLYPHMETRICS lpgm,
1224 DWORD cbBuffer, LPVOID lpvBuffer, CONST MAT2 *lpmat2)
1225{
1226 dprintf(("GDI32: GetGlyphOutLineW, not implemented\n"));
1227 return(GDI_ERROR);
1228}
1229//******************************************************************************
1230
1231//******************************************************************************
1232
1233
1234/* Office 97 stubs - KSO Thu 21.05.1998*/
1235//******************************************************************************
1236BOOL WIN32API GetTextExtentExPointA(/*KSO Thu 21.05.1998*/
1237 HDC hdc,
1238 LPCSTR str,
1239 int count,
1240 int maxExt,
1241 LPINT lpnFit,
1242 LPINT alpDx,
1243 LPSIZE size)
1244{
1245 int index, nFit, extent;
1246 SIZE tSize;
1247
1248 dprintf(("GDI32: GetTextExtendExPointA\n"));
1249
1250 size->cx = size->cy = nFit = extent = 0;
1251 for(index = 0; index < count; index++)
1252 {
1253 if(!O32_GetTextExtentPoint( hdc, str, 1, &tSize )) return FALSE;
1254 if( extent+tSize.cx < maxExt )
1255 {
1256 extent+=tSize.cx;
1257 nFit++;
1258 str++;
1259 if( alpDx )
1260 alpDx[index] = extent;
1261 if( tSize.cy > size->cy ) size->cy = tSize.cy;
1262 }
1263 else break;
1264 }
1265 size->cx = extent;
1266
1267 if (lpnFit != NULL) // check if result is desired
1268 *lpnFit = nFit;
1269
1270 dprintf(("GDI32: GetTextExtendExPointA(%08x '%.*s' %d) returning %d %d %d\n",
1271 hdc,count,str,maxExt,nFit, size->cx,size->cy));
1272 return TRUE;
1273}
1274//******************************************************************************
1275//******************************************************************************
1276BOOL WIN32API GetTextExtentExPointW( /*KSO Thu 21.05.1998*/
1277 HDC arg1,
1278 LPCWSTR arg2,
1279 int arg3,
1280 int arg4,
1281 LPINT arg5,
1282 LPINT arg6,
1283 LPSIZE arg7
1284 )
1285{
1286 char *astring = UnicodeToAsciiString((LPWSTR)arg2);
1287 BOOL rc;
1288
1289 dprintf(("GDI32: GetTextExtendExPointW\n"));
1290 rc = GetTextExtentExPointA(arg1, astring, arg3, arg4, arg5, arg6, arg7);
1291 FreeAsciiString(astring);
1292 return rc;
1293}
1294//******************************************************************************
1295
1296
1297/*****************************************************************************
1298 * Name : BOOL CancelDC
1299 * Purpose : The CancelDC function cancels any pending operation on the
1300 * specified device context (DC).
1301 * Parameters: HDC hdc handle of device context
1302 * Variables :
1303 * Result : TRUE / FALSE
1304 * Remark :
1305 * Status : UNTESTED STUB
1306 *
1307 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
1308 *****************************************************************************/
1309
1310BOOL WIN32API CancelDC(HDC hdc)
1311{
1312 dprintf(("GDI32: CancelDC(%08xh) not implemented.\n",
1313 hdc));
1314
1315 return (FALSE);
1316}
1317
1318
1319/*****************************************************************************
1320 * Name : BOOL CombineTransform
1321 * Purpose : The CombineTransform function concatenates two world-space to
1322 * page-space transformations.
1323 * Parameters: LLPXFORM lLPXFORMResult address of combined transformation
1324 * XFORM *lLPXFORM1 address of 1st transformation
1325 * XFORM *lLPXFORM2 address of 2nd transformation
1326 * Variables :
1327 * Result : TRUE / FALSE
1328 * Remark :
1329 * Status : COMPLETELY UNTESTED
1330 *
1331 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
1332 * Markus Montkowski [Wen, 1999/01/12 20:18]
1333 *****************************************************************************/
1334
1335BOOL WIN32API CombineTransform(LPXFORM lLPXFORMResult,
1336 CONST XFORM *lLPXFORM1,
1337 CONST XFORM *lLPXFORM2)
1338{
1339 dprintf(("GDI32: CombineTransform(%08xh,%08xh,%08xh).\n",
1340 lLPXFORMResult,
1341 lLPXFORM1,
1342 lLPXFORM2));
1343
1344 XFORM xfrm;
1345 if( IsBadWritePtr( (void*)lLPXFORMResult, sizeof(XFORM)) ||
1346 IsBadReadPtr( (void*)lLPXFORM1, sizeof(XFORM)) ||
1347 IsBadWritePtr( (void*)lLPXFORM2, sizeof(XFORM)) )
1348 return (FALSE);
1349
1350 // Add the translations
1351 lLPXFORMResult->eDx = lLPXFORM1->eDx + lLPXFORM2->eDx;
1352 lLPXFORMResult->eDy = lLPXFORM1->eDy + lLPXFORM2->eDy;
1353
1354 // Multiply the matrixes
1355 xfrm.eM11 = lLPXFORM1->eM11 * lLPXFORM2->eM11 + lLPXFORM1->eM21 * lLPXFORM1->eM12;
1356 xfrm.eM12 = lLPXFORM1->eM11 * lLPXFORM2->eM12 + lLPXFORM1->eM12 * lLPXFORM1->eM22;
1357 xfrm.eM21 = lLPXFORM1->eM21 * lLPXFORM2->eM11 + lLPXFORM1->eM22 * lLPXFORM1->eM21;
1358 xfrm.eM22 = lLPXFORM1->eM21 * lLPXFORM2->eM12 + lLPXFORM1->eM22 * lLPXFORM1->eM22;
1359
1360 // Now copy to resulting XFROM as the pt must not be distinct
1361 lLPXFORMResult->eM11 = xfrm.eM11;
1362 lLPXFORMResult->eM12 = xfrm.eM12;
1363 lLPXFORMResult->eM21 = xfrm.eM21;
1364 lLPXFORMResult->eM22 = xfrm.eM22;
1365
1366 return (TRUE);
1367}
1368
1369
1370/*****************************************************************************
1371 * Name : BOOL FixBrushOrgEx
1372 * Purpose : The FixBrushOrgEx function is not implemented in the Win32 API.
1373 * It is provided for compatibility with Win32s. If called, the
1374 * function does nothing, and returns FALSE.
1375 * Parameters: HDC, int, int, LPPOINT
1376 * Variables :
1377 * Result : TRUE / FALSE
1378 * Remark : not implemented in Win32
1379 * Status : UNTESTED STUB
1380 *
1381 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
1382 *****************************************************************************/
1383
1384BOOL WIN32API FixBrushOrgEx(HDC hdc,
1385 int iDummy1,
1386 int iDummy2,
1387 LPPOINT lpPoint)
1388{
1389 dprintf(("GDI32: FixBrushOrgEx(%08xh,%08xh,%08xh,%08xh) not implemented.\n",
1390 hdc,
1391 iDummy1,
1392 iDummy2,
1393 lpPoint));
1394
1395 return (FALSE);
1396}
1397
1398
1399/*****************************************************************************
1400 * Name : DWORD GdiGetBatchLimit
1401 * Purpose : The GdiGetBatchLimit function returns the maximum number of
1402 * function calls that can be accumulated in the calling thread's
1403 * current batch. The system flushes the current batch whenever
1404 * this limit is exceeded.
1405 * Parameters:
1406 * Variables :
1407 * Result : 1
1408 * Remark :
1409 * Status : UNTESTED STUB
1410 *
1411 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
1412 *****************************************************************************/
1413
1414DWORD WIN32API GdiGetBatchLimit(VOID)
1415{
1416 dprintf(("GDI32: GdiGetBatchLimit() not implemented (1).\n"));
1417
1418 return (1);
1419}
1420
1421
1422/*****************************************************************************
1423 * Name : DWORD GdiSetBatchLimit
1424 * Purpose : The GdiSetBatchLimit function sets the maximum number of
1425 * functions that can be accumulated in the calling thread's current
1426 * batch. The system flushes the current batch whenever this limit
1427 * is exceeded.
1428 * Parameters: DWORD dwLimit
1429 * Variables :
1430 * Result :
1431 * Remark :
1432 * Status : UNTESTED STUB
1433 *
1434 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
1435 *****************************************************************************/
1436
1437DWORD WIN32API GdiSetBatchLimit(DWORD dwLimit)
1438{
1439 dprintf(("GDI32: GdiSetBatchLimit(%08xh) not implemented (1).\n",
1440 dwLimit));
1441
1442 return (1);
1443}
1444
1445
1446/*****************************************************************************
1447 * Name : DWORD GetCharacterPlacementA
1448 * Purpose : The GetCharacterPlacementA function retrieves information about
1449 * a character string, such as character widths, caret positioning,
1450 * ordering within the string, and glyph rendering. The type of
1451 * information returned depends on the dwFlags parameter and is
1452 * based on the currently selected font in the given display context.
1453 * The function copies the information to the specified GCP_RESULTSA
1454 * structure or to one or more arrays specified by the structure.
1455 * Parameters: HDC hdc handle to device context
1456 * LPCSTR lpString pointer to string
1457 * int nCount number of characters in string
1458 * int nMaxExtent maximum extent for displayed string
1459 * LPGCP_RESULTSA *lpResults pointer to buffer for placement result
1460 * DWORD dwFlags placement flags
1461 * Variables :
1462 * Result :
1463 * Remark :
1464 * Status : UNTESTED STUB
1465 *
1466 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
1467 *****************************************************************************/
1468
1469DWORD WIN32API GetCharacterPlacementA(HDC hdc,
1470 LPCSTR lpString,
1471 int nCount,
1472 int nMaxExtent,
1473 GCP_RESULTSA * lpResults,
1474 DWORD dwFlags)
1475{
1476 dprintf(("GDI32: GetCharacterPlacementA(%08xh,%s,%08xh,%08xh,%08xh,%08xh) not implemented.\n",
1477 hdc,
1478 lpString,
1479 nCount,
1480 nMaxExtent,
1481 lpResults,
1482 dwFlags));
1483
1484 return (0);
1485}
1486
1487
1488/*****************************************************************************
1489 * Name : DWORD GetCharacterPlacementW
1490 * Purpose : The GetCharacterPlacementW function retrieves information about
1491 * a character string, such as character widths, caret positioning,
1492 * ordering within the string, and glyph rendering. The type of
1493 * information returned depends on the dwFlags parameter and is
1494 * based on the currently selected font in the given display context.
1495 * The function copies the information to the specified GCP_RESULTSW
1496 * structure or to one or more arrays specified by the structure.
1497 * Parameters: HDC hdc handle to device context
1498 * LPCSTR lpString pointer to string
1499 * int nCount number of characters in string
1500 * int nMaxExtent maximum extent for displayed string
1501 * GCP_RESULTSW *lpResults pointer to buffer for placement result
1502 * DWORD dwFlags placement flags
1503 * Variables :
1504 * Result :
1505 * Remark :
1506 * Status : UNTESTED STUB
1507 *
1508 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
1509 *****************************************************************************/
1510
1511DWORD WIN32API GetCharacterPlacementW(HDC hdc,
1512 LPCWSTR lpString,
1513 int nCount,
1514 int nMaxExtent,
1515 GCP_RESULTSW *lpResults,
1516 DWORD dwFlags)
1517{
1518 dprintf(("GDI32: GetCharacterPlacementW(%08xh,%s,%08xh,%08xh,%08xh,%08xh) not implemented.\n",
1519 hdc,
1520 lpString,
1521 nCount,
1522 nMaxExtent,
1523 lpResults,
1524 dwFlags));
1525
1526 return (0);
1527}
Note: See TracBrowser for help on using the repository browser.