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

Last change on this file since 6384 was 6331, checked in by sandervl, 24 years ago

implemented StartDocW

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