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

Last change on this file since 5813 was 5813, checked in by phaller, 24 years ago

Split GDI32 into ICM and GDI32

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