source: trunk/src/gdi32/gdi32.cpp

Last change on this file was 21916, checked in by dmik, 14 years ago

Merge branch gcc-kmk to trunk.

File size: 38.1 KB
RevLine 
[10594]1/* $Id: gdi32.cpp,v 1.94 2004-04-30 13:27:18 sandervl Exp $ */
[4]2
3/*
[1388]4 * GDI32 apis
[4]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>
[3648]16#include <odinwrap.h>
[4848]17#include <misc.h>
[4]18#include "callback.h"
19#include "unicode.h"
20#include "dibsect.h"
[2484]21#include <codepage.h>
22#include "oslibgpi.h"
[2551]23#include "oslibgdi.h"
[4574]24#include <dcdata.h>
[4848]25#include <winuser32.h>
[7330]26#include "font.h"
[7635]27#include <stats.h>
[8871]28#include <objhandle.h>
[10374]29#include <winspool.h>
[4]30
[3255]31#define DBG_LOCALLOG DBG_gdi32
[2802]32#include "dbglocal.h"
33
[3648]34ODINDEBUGCHANNEL(GDI32-GDI32)
35
[4]36//******************************************************************************
37//******************************************************************************
[10374]38BOOL WIN32API GdiFlush()
39{
40 //NOP: DIB synchronization is done using exceptions
41 return TRUE;
42}
43//******************************************************************************
44//******************************************************************************
[10316]45int WIN32API FillRect(HDC hDC, const RECT * lprc, HBRUSH hbr)
46{
47 int ret;
48
49 //SvL: brush 0 means current selected brush (verified in NT4)
50 if(hbr == 0) {
51 hbr = GetCurrentObject(hDC, OBJ_BRUSH);
52 }
53 else
54 if (hbr <= (HBRUSH) (COLOR_MAX + 1)) {
55 hbr = GetSysColorBrush( (INT) hbr - 1 );
56 }
57 dprintf(("USER32: FillRect %x (%d,%d)(%d,%d) brush %X", hDC, lprc->left, lprc->top, lprc->right, lprc->bottom, hbr));
[10322]58 DIBSECTION_CHECK_IF_DIRTY(hDC);
[10316]59 ret = O32_FillRect(hDC,lprc,hbr);
[10322]60 DIBSECTION_MARK_INVALID(hDC);
[10316]61 return ret;
62}
[4]63//******************************************************************************
64//******************************************************************************
[10316]65int WIN32API FrameRect( HDC hDC, const RECT * lprc, HBRUSH hbr)
66{
67 int ret;
68
69 dprintf(("USER32: FrameRect %x (%d,%d)(%d,%d) brush %x", hDC, lprc->top, lprc->left, lprc->bottom, lprc->right, hbr));
[10322]70 DIBSECTION_CHECK_IF_DIRTY(hDC);
[10316]71 ret = O32_FrameRect(hDC,lprc,hbr);
[10322]72 DIBSECTION_MARK_INVALID(hDC);
[10316]73 return ret;
74}
75//******************************************************************************
76//******************************************************************************
77BOOL WIN32API InvertRect( HDC hDC, const RECT * lprc)
78{
79 int ret;
80
81 if(lprc) {
82 dprintf(("USER32: InvertRect %x (%d,%d)(%d,%d)", hDC, lprc->left, lprc->top, lprc->right, lprc->bottom));
83 }
84 else dprintf(("USER32: InvertRect %x NULL", hDC));
[10322]85 DIBSECTION_CHECK_IF_DIRTY(hDC);
[10316]86 ret = O32_InvertRect(hDC,lprc);
[10322]87 DIBSECTION_MARK_INVALID(hDC);
[10316]88 return ret;
89}
90//******************************************************************************
91//******************************************************************************
[10374]92BOOL WIN32API StrokeAndFillPath(HDC hdc)
93{
94 DIBSECTION_CHECK_IF_DIRTY(hdc);
95 BOOL ret = O32_StrokeAndFillPath(hdc);
96 DIBSECTION_MARK_INVALID(hdc);
97 return ret;
98}
99//******************************************************************************
100//******************************************************************************
101BOOL WIN32API StrokePath(HDC hdc)
102{
103 DIBSECTION_CHECK_IF_DIRTY(hdc);
104 BOOL ret = O32_StrokePath(hdc);
105 DIBSECTION_MARK_INVALID(hdc);
106 return ret;
107}
108//******************************************************************************
109//******************************************************************************
[4]110COLORREF WIN32API SetBkColor(HDC hdc, COLORREF crColor)
111{
112 return(O32_SetBkColor(hdc, crColor));
113}
114//******************************************************************************
115//******************************************************************************
116COLORREF WIN32API SetTextColor(HDC hdc, COLORREF crColor)
117{
[9429]118 return O32_SetTextColor(hdc, crColor);
[4]119}
120//******************************************************************************
121//******************************************************************************
122HGDIOBJ WIN32API GetStockObject(int arg1)
123{
124 HGDIOBJ obj;
125
[1966]126 switch(arg1)
127 {
[4]128 case DEFAULT_GUI_FONT:
[8871]129 if(NULL==hFntDefaultGui) {
130 hFntDefaultGui = CreateFontA( -9, 0, 0, 0, FW_MEDIUM, FALSE,
131 FALSE, FALSE, ANSI_CHARSET,
132 OUT_DEFAULT_PRECIS,
133 CLIP_DEFAULT_PRECIS,
134 DEFAULT_QUALITY,
135 FIXED_PITCH|FF_MODERN, "WarpSans");
136 //This object can't be deleted by applications
137 ObjSetHandleFlag(hFntDefaultGui, OBJHANDLE_FLAG_NODELETE, TRUE);
138 }
[1966]139 obj = hFntDefaultGui;
[4]140 break;
141 default:
142 obj = O32_GetStockObject(arg1);
143 break;
144 }
145 return(obj);
146}
147//******************************************************************************
148//******************************************************************************
[9429]149HPEN WIN32API CreatePen(int fnPenStyle, int nWidth, COLORREF crColor)
[4]150{
[7635]151 HPEN hPen;
[4]152
[2738]153 //CB: todo: PS_DOT is different in Win32 (. . . . and not - - - -)
154 // Open32 looks like LINETYPE_SHORTDASH instead of LINETYPE_DOT!!!
[2779]155 // -> difficult to fix without performance decrease!
[2738]156
[7635]157 hPen = O32_CreatePen(fnPenStyle,nWidth,crColor);
158 if(hPen) STATS_CreatePen(hPen, fnPenStyle,nWidth,crColor);
159 return hPen;
[4]160}
161//******************************************************************************
162//******************************************************************************
[4034]163HPEN WIN32API CreatePenIndirect(const LOGPEN * lplgpn)
[4]164{
[7635]165 HPEN hPen;
166
167 hPen = O32_CreatePenIndirect(lplgpn);
168 if(hPen) STATS_CreatePenIndirect(hPen, lplgpn);
169 return hPen;
[4]170}
171//******************************************************************************
172//******************************************************************************
[10434]173HPEN WIN32API ExtCreatePen(DWORD dwPenStyle, DWORD dwWidth, const LOGBRUSH *lplb,
[7635]174 DWORD dwStyleCount, const DWORD *lpStyle)
175{
176 HPEN hPen;
177
[10594]178 if(lplb) {
179 dprintf(("lbStyle %x", lplb->lbStyle));
180 dprintf(("lbColor %x", lplb->lbColor));
181 dprintf(("lbHatch %x", lplb->lbHatch));
182 }
[7635]183 hPen = O32_ExtCreatePen(dwPenStyle, dwWidth, lplb, dwStyleCount, lpStyle);
184 if(hPen) STATS_ExtCreatePen(hPen, dwPenStyle, dwWidth, lplb, dwStyleCount, lpStyle);
185 return hPen;
186}
187//******************************************************************************
188//******************************************************************************
189HBRUSH WIN32API CreatePatternBrush(HBITMAP hBitmap)
190{
191 HBRUSH hBrush;
192
193 hBrush = O32_CreatePatternBrush(hBitmap);
194 if(hBrush) STATS_CreatePatternBrush(hBrush, hBitmap);
195 return(hBrush);
196}
197//******************************************************************************
198//******************************************************************************
[9429]199HBRUSH WIN32API CreateSolidBrush(COLORREF color)
[7635]200{
201 HBRUSH hBrush;
202
203 hBrush = O32_CreateSolidBrush(color);
204 if(hBrush) STATS_CreateSolidBrush(hBrush, color);
205 return(hBrush);
206}
207//******************************************************************************
208//******************************************************************************
209HBRUSH WIN32API CreateBrushIndirect( const LOGBRUSH *pLogBrush)
210{
[9429]211 HBRUSH hBrush;
[7635]212
213 hBrush = O32_CreateBrushIndirect((LPLOGBRUSH)pLogBrush);
214 dprintf(("GDI32: CreateBrushIndirect %x %x %x returned %x", pLogBrush->lbStyle, pLogBrush->lbColor, pLogBrush->lbHatch, hBrush));
215 if(hBrush) STATS_CreateBrushIndirect(hBrush, (LPLOGBRUSH)pLogBrush);
216 return hBrush;
217}
218//******************************************************************************
219//******************************************************************************
220HBRUSH WIN32API CreateHatchBrush(int fnStyle, COLORREF clrref)
221{
222 HBRUSH hBrush;
[10434]223
[7635]224 hBrush = O32_CreateHatchBrush(fnStyle, clrref);
225 if(hBrush) STATS_CreateHatchBrush(hBrush, fnStyle, clrref);
226 return hBrush;
227}
228//******************************************************************************
229//******************************************************************************
[4590]230HBRUSH WIN32API CreateDIBPatternBrushPt( const VOID * buffer, UINT usage)
[4]231{
[7635]232 HBRUSH hBrush;
233
234 hBrush = O32_CreateDIBPatternBrushPt(buffer, usage);
235 if(hBrush) STATS_CreateDIBPatternBrushPt(hBrush, buffer, usage);
236 return hBrush;
[4]237}
[4598]238/*****************************************************************************
239 * Name : HBRUSH CreateDIBPatternBrush
240 * Purpose : The CreateDIBPatternBrush function creates a logical brush that
241 * has the pattern specified by the specified device-independent
242 * bitmap (DIB). The brush can subsequently be selected into any
243 * device context that is associated with a device that supports
244 * raster operations.
245 *
246 * This function is provided only for compatibility with applications
247 * written for versions of Windows earlier than 3.0. For Win32-based
248 * applications, use the CreateDIBPatternBrushPt function.
249 * Parameters: HGLOBAL hglbDIBPacked Identifies a global memory object containing
250 * a packed DIB, which consists of a BITMAPINFO structure immediately
251 * followed by an array of bytes defining the pixels of the bitmap.
252 * UINT fuColorSpec color table data
253 * Variables :
254 * Result : TRUE / FALSE
255 * Remark :
256 * Status : ODIN32 COMPLETELY UNTESTED
257 *
258 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
259 * Markus Montkowski [Wen, 1999/01/12 20:00]
260 *****************************************************************************/
261
262HBRUSH WIN32API CreateDIBPatternBrush( HGLOBAL hglbDIBPacked,
263 UINT fuColorSpec)
264{
265 BITMAPINFO *lpMem;
266 HBRUSH ret = 0;
267
268 lpMem = (BITMAPINFO *)GlobalLock(hglbDIBPacked);
269 if(NULL!=lpMem)
270 {
271 dprintf(("GDI32: CreateDIBPatternBrush (%08xh, %08xh) %x (%d,%d) bpp %d",
[10434]272 hglbDIBPacked, fuColorSpec, lpMem, lpMem->bmiHeader.biWidth,
[4598]273 lpMem->bmiHeader.biHeight, lpMem->bmiHeader.biBitCount));
274
275 ret = CreateDIBPatternBrushPt( lpMem,
276 fuColorSpec);
277 GlobalUnlock(hglbDIBPacked);
278 }
279 else {
[7635]280 dprintf(("!ERROR!: CreateDIBPatternBrush (%08xh, %08xh) -> INVALID memory handle!!",
[4598]281 hglbDIBPacked, fuColorSpec));
282 }
283 return (ret);
284}
[4]285//******************************************************************************
286//******************************************************************************
[3641]287int WIN32API SetBkMode( HDC hdc, int mode)
[4]288{
[3641]289 return O32_SetBkMode(hdc, mode);
[4]290}
291//******************************************************************************
292//******************************************************************************
[5607]293COLORREF WIN32API GetPixel( HDC hdc, int x, int y)
[4]294{
[9429]295 return O32_GetPixel(hdc, x, y);
[4]296}
297//******************************************************************************
298//******************************************************************************
[5607]299COLORREF WIN32API SetPixel( HDC hdc, int x, int y, COLORREF color)
[4]300{
[5607]301 return O32_SetPixel(hdc, x, y, color);
[4]302}
303//******************************************************************************
304//Faster version of SetPixel (since it doesn't need to return the original color)
305//Just use SetPixel for now
306//******************************************************************************
307BOOL WIN32API SetPixelV(HDC arg1, int arg2, int arg3, COLORREF arg4)
308{
309 COLORREF rc;
310
311 rc = O32_SetPixel(arg1, arg2, arg3, arg4);
312 if(rc == GDI_ERROR) // || rc == COLOR_INVALID)
313 return(FALSE);
314 return(TRUE);
315}
316//******************************************************************************
317//******************************************************************************
[4963]318BOOL WIN32API GetDCOrgEx(HDC hdc, PPOINT lpPoint)
[4]319{
[4963]320 if(lpPoint == NULL) {
321 dprintf(("WARNING: GDI32: GetDCOrgEx %x NULL", hdc));
322 return FALSE;
323 }
324 return O32_GetDCOrgEx(hdc, lpPoint);
[4]325}
326//******************************************************************************
327//******************************************************************************
[4963]328BOOL WIN32API AbortPath(HDC hdc)
[4]329{
[4963]330 return O32_AbortPath(hdc);
[4]331}
332//******************************************************************************
333//******************************************************************************
334BOOL WIN32API AngleArc( HDC arg1, int arg2, int arg3, DWORD arg4, float arg5, float arg6)
335{
336 return O32_AngleArc(arg1, arg2, arg3, arg4, arg5, arg6);
337}
338//******************************************************************************
339//******************************************************************************
340BOOL WIN32API Arc( HDC arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8, int arg9)
341{
342 return O32_Arc(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
343}
344//******************************************************************************
345//******************************************************************************
346BOOL WIN32API ArcTo( HDC arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8, int arg9)
347{
348 return O32_ArcTo(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
349}
350//******************************************************************************
351//******************************************************************************
[4963]352BOOL WIN32API BeginPath(HDC hdc)
[4]353{
[4963]354 return O32_BeginPath(hdc);
[4]355}
356//******************************************************************************
357//******************************************************************************
358BOOL WIN32API Chord( HDC arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8, int arg9)
359{
360 return O32_Chord(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
361}
362//******************************************************************************
363//******************************************************************************
[4963]364BOOL WIN32API CloseFigure(HDC hdc)
[4]365{
[4963]366 return O32_CloseFigure(hdc);
[4]367}
368//******************************************************************************
369//******************************************************************************
[4963]370BOOL WIN32API Ellipse(HDC hdc, int nLeftRect, int nTopRect, int nRightRect,
371 int nBottomRect)
[4]372{
[4963]373 dprintf(("GDI32: Ellipse %x (%d,%d)(%d,%d)", nLeftRect, nTopRect, nRightRect, nBottomRect));
374 return O32_Ellipse(hdc, nLeftRect, nTopRect, nRightRect, nBottomRect);
[4]375}
376//******************************************************************************
377//******************************************************************************
[4963]378BOOL WIN32API EndPath( HDC hdc)
[4]379{
[4963]380 return O32_EndPath(hdc);
[4]381}
382//******************************************************************************
383//******************************************************************************
[9429]384BOOL WIN32API Rectangle(HDC hdc, int left, int top, int right, int bottom)
[4]385{
[4034]386 return O32_Rectangle(hdc, left, top, right, bottom);
[4]387}
388//******************************************************************************
389//******************************************************************************
[9429]390#ifdef DEBUG
[3255]391VOID dumpROP2(INT rop2)
392{
[21916]393 const char *name;
[3255]394
395 switch (rop2)
396 {
397 case R2_BLACK:
398 name = "R2_BLACK";
399 break;
400
401 case R2_COPYPEN:
402 name = "R2_COPYPEN";
403 break;
404
405 case R2_MASKNOTPEN:
406 name = "R2_MASKNOTPEN";
407 break;
408
409 case R2_MASKPEN:
410 name = "R2_MASKPEN";
411 break;
412
413 case R2_MASKPENNOT:
414 name = "R2_MASKPENNOT";
415 break;
416
417 case R2_MERGENOTPEN:
418 name = "R2_MERGENOTPEN";
419 break;
420
421 case R2_MERGEPEN:
422 name = "R2_MERGEPEN";
423 break;
424
425 case R2_MERGEPENNOT:
426 name = "R2_MERGEPENNOT";
427 break;
428
429 case R2_NOP:
430 name = "R2_NOP";
431 break;
432
433 case R2_NOT:
434 name = "R2_NOT";
435 break;
436
437 case R2_NOTCOPYPEN:
438 name = "R2_NOTCOPYPEN";
439 break;
440
441 case R2_NOTMASKPEN:
442 name = "R2_NOTMASKPEN";
443 break;
444
445 case R2_NOTMERGEPEN:
446 name = "R2_NOTMERGEPEN";
447 break;
448
449 case R2_WHITE:
450 name = "R2_WHITE";
451 break;
452
453 case R2_XORPEN:
454 name = "R2_XORPEN";
455 break;
456
[9429]457 case R2_NOTXORPEN:
458 name = "R2_NOTXORPEN";
459 break;
460
[3255]461 default:
462 name = "unknown mode!!!";
463 break;
464 }
465
466 dprintf((" ROP2 mode = %s",name));
467}
[9429]468#endif
[3255]469//******************************************************************************
470//******************************************************************************
[2551]471int WIN32API SetROP2( HDC hdc, int rop2)
[4]472{
[3255]473 #ifdef DEBUG
474 dumpROP2(rop2);
475 #endif
[2551]476 return O32_SetROP2(hdc, rop2);
[4]477}
478//******************************************************************************
479//******************************************************************************
480BOOL WIN32API ExtFloodFill( HDC arg1, int arg2, int arg3, COLORREF arg4, UINT arg5)
481{
482 return O32_ExtFloodFill(arg1, arg2, arg3, arg4, arg5);
483}
484//******************************************************************************
485//******************************************************************************
486BOOL WIN32API FillPath( HDC arg1)
487{
488 return O32_FillPath(arg1);
489}
490//******************************************************************************
491//******************************************************************************
492BOOL WIN32API FlattenPath( HDC arg1)
493{
494 return O32_FlattenPath(arg1);
495}
496//******************************************************************************
497//******************************************************************************
498BOOL WIN32API FloodFill(HDC arg1, int arg2, int arg3, COLORREF arg4)
499{
500 return O32_FloodFill(arg1, arg2, arg3, arg4);
501}
502//******************************************************************************
503//******************************************************************************
504int WIN32API GetArcDirection( HDC arg1)
505{
506 return O32_GetArcDirection(arg1);
507}
508//******************************************************************************
509//******************************************************************************
510BOOL WIN32API GetAspectRatioFilterEx( HDC arg1, PSIZE arg2)
511{
512 return O32_GetAspectRatioFilterEx(arg1, arg2);
513}
514//******************************************************************************
515//******************************************************************************
[4963]516COLORREF WIN32API GetBkColor(HDC hdc)
[4]517{
[9429]518 return O32_GetBkColor(hdc);
[4]519}
520//******************************************************************************
521//******************************************************************************
[4963]522int WIN32API GetBkMode(HDC hdc)
[4]523{
[9429]524 return O32_GetBkMode(hdc);
[4]525}
526//******************************************************************************
527//******************************************************************************
528UINT WIN32API GetBoundsRect( HDC arg1, PRECT arg2, UINT arg3)
529{
530 return O32_GetBoundsRect(arg1, arg2, arg3);
531}
532//******************************************************************************
533//******************************************************************************
534BOOL WIN32API GetBrushOrgEx( HDC arg1, PPOINT arg2)
535{
536 return O32_GetBrushOrgEx(arg1, arg2);
537}
538//******************************************************************************
539//******************************************************************************
[4963]540BOOL WIN32API GetCurrentPositionEx( HDC hdc, PPOINT lpPoint)
[4]541{
[4963]542 BOOL rc;
543
544 rc = O32_GetCurrentPositionEx(hdc, lpPoint);
545 dprintf(("GDI32: GetCurrentPositionEx returned %d (%d,%d)", rc, lpPoint->x, lpPoint->y));
546 return rc;
[4]547}
[10434]548#ifdef DEBUG_LOGGING
[4]549//******************************************************************************
550//******************************************************************************
[21916]551const char *GetDeviceCapsString(int nIndex)
[10374]552{
553 switch(nIndex) {
554 case DRIVERVERSION:
555 return "DRIVERVERSION";
556 case TECHNOLOGY:
557 return "TECHNOLOGY";
558 case HORZSIZE:
559 return "HORZSIZE";
560 case VERTSIZE:
561 return "VERTSIZE";
562 case HORZRES:
563 return "HORZRES";
564 case VERTRES:
565 return "VERTRES";
566 case BITSPIXEL:
567 return "BITSPIXEL";
568 case PLANES:
569 return "PLANES";
570 case NUMBRUSHES:
571 return "NUMBRUSHES";
572 case NUMPENS:
573 return "NUMPENS";
574 case NUMMARKERS:
575 return "NUMMARKERS";
576 case NUMFONTS:
577 return "NUMFONTS";
578 case NUMCOLORS:
579 return "NUMCOLORS";
580 case PDEVICESIZE:
581 return "PDEVICESIZE";
582 case CURVECAPS:
583 return "CURVECAPS";
584 case LINECAPS:
585 return "LINECAPS";
586 case POLYGONALCAPS:
587 return "POLYGONALCAPS";
588 case TEXTCAPS:
589 return "TEXTCAPS";
590 case CLIPCAPS:
591 return "CLIPCAPS";
592 case RASTERCAPS:
593 return "RASTERCAPS";
594 case ASPECTX:
595 return "ASPECTX";
596 case ASPECTY:
597 return "ASPECTY";
598 case ASPECTXY:
599 return "ASPECTXY";
600 case LOGPIXELSX:
601 return "LOGPIXELSX";
602 case LOGPIXELSY:
603 return "LOGPIXELSY";
604 case SIZEPALETTE:
605 return "SIZEPALETTE";
606 case NUMRESERVED:
607 return "NUMRESERVED";
608 case COLORRES:
609 return "COLORRES";
610 case PHYSICALWIDTH:
611 return "PHYSICALWIDTH";
612 case PHYSICALHEIGHT:
613 return "PHYSICALHEIGHT";
614 case PHYSICALOFFSETX:
615 return "PHYSICALOFFSETX";
616 case PHYSICALOFFSETY:
617 return "PHYSICALOFFSETY";
618 case SCALINGFACTORX:
619 return "SCALINGFACTORX";
620 case SCALINGFACTORY:
621 return "SCALINGFACTORY";
622 }
623 return "unknown";
624}
625#endif
626//******************************************************************************
627//******************************************************************************
[4]628int WIN32API GetDeviceCaps(HDC hdc, int nIndex)
629{
630 int rc;
631
632 rc = O32_GetDeviceCaps(hdc, nIndex);
[10374]633 dprintf(("GDI32: GetDeviceCaps %x %s returned %d\n", hdc, GetDeviceCapsString(nIndex), rc));
[4]634 //SvL: 13-9-'98: NT returns -1 when using 16 bits colors, NOT 65536!
635 if(nIndex == NUMCOLORS && rc > 256)
636 return -1;
[2600]637
[4]638 return(rc);
639}
640//******************************************************************************
641//******************************************************************************
642BOOL WIN32API GetMiterLimit( HDC arg1, float * arg2)
643{
644 return O32_GetMiterLimit(arg1, arg2);
645}
646//******************************************************************************
647//******************************************************************************
648COLORREF WIN32API GetNearestColor( HDC arg1, COLORREF arg2)
649{
650 return O32_GetNearestColor(arg1, arg2);
651}
652//******************************************************************************
653//******************************************************************************
[4598]654INT WIN32API GetPath( HDC hdc, PPOINT arg2, PBYTE arg3, int arg4)
[4]655{
[4598]656 return O32_GetPath(hdc, arg2, arg3, arg4);
[4]657}
658//******************************************************************************
659//******************************************************************************
[4598]660int WIN32API GetPolyFillMode( HDC hdc)
[4]661{
[4598]662 return O32_GetPolyFillMode(hdc);
[4]663}
664//******************************************************************************
665//******************************************************************************
[4598]666int WIN32API GetROP2( HDC hdc)
[4]667{
[4598]668 return O32_GetROP2(hdc);
[4]669}
670//******************************************************************************
671//******************************************************************************
672BOOL WIN32API GetRasterizerCaps(LPRASTERIZER_STATUS arg1, UINT arg2)
673{
674 return O32_GetRasterizerCaps(arg1, arg2);
675}
676//******************************************************************************
677//******************************************************************************
[4598]678UINT WIN32API GetTextAlign( HDC hdc)
[4]679{
[4598]680 return O32_GetTextAlign(hdc);
[4]681}
682//******************************************************************************
683//******************************************************************************
[4598]684int WIN32API GetTextCharacterExtra( HDC hdc)
[4]685{
[4598]686 return O32_GetTextCharacterExtra(hdc);
[4]687}
688//******************************************************************************
689//******************************************************************************
[4598]690COLORREF WIN32API GetTextColor( HDC hdc)
[4]691{
[9429]692 return O32_GetTextColor(hdc);
[4]693}
694//******************************************************************************
695//******************************************************************************
[1246]696BOOL WIN32API Pie(HDC hdc, int nLeftRect, int nTopRect, int nRightRect,
[1533]697 int nBottomRect, int nXRadial1, int nYRadial1, int nXRadial2,
[1246]698 int nYRadial2)
[4]699{
[4963]700 dprintf(("GDI32: Pie %x (%d,%d)(%d,%d) (%d,%d) (%d,%d)", hdc, nLeftRect, nTopRect, nRightRect,
701 nBottomRect, nXRadial1, nYRadial1, nXRadial2, nYRadial2));
702
[1246]703 //CB: bug in O32_Pie
704 if (nXRadial1 == nXRadial2 && nYRadial1 == nYRadial2)
705 return O32_Ellipse(hdc,nLeftRect,nTopRect,nRightRect,nBottomRect);
706 else
707 return O32_Pie(hdc,nLeftRect,nTopRect,nRightRect,nBottomRect,nXRadial1,nYRadial1,nXRadial2,nYRadial2);
[4]708}
709//******************************************************************************
710//******************************************************************************
711BOOL WIN32API PolyBezier( HDC arg1, const POINT * arg2, DWORD arg3)
712{
713 return O32_PolyBezier(arg1, arg2, (int)arg3);
714}
715//******************************************************************************
716//******************************************************************************
717BOOL WIN32API PolyBezierTo( HDC arg1, const POINT * arg2, DWORD arg3)
718{
719 return O32_PolyBezierTo(arg1, arg2, arg3);
720}
721//******************************************************************************
722//******************************************************************************
[10374]723BOOL WIN32API PolyDraw( HDC hdc, const POINT * arg2, const BYTE * arg3, DWORD arg4)
[4]724{
[10374]725 return O32_PolyDraw(hdc, arg2, arg3, arg4);
[4]726}
727//******************************************************************************
728//******************************************************************************
[10594]729BOOL WIN32API PolyPolygon( HDC hdc, const POINT *lpPoints, const INT *lpPolyCounts, UINT nCount)
[4]730{
[10594]731#ifdef DEBUG
732 int count = 0;
733 for(int i=0;i<nCount;i++)
734 {
735 for(int j=0;j<lpPolyCounts[i];j++)
736 {
737 dprintf(("Vertex %d point (%d,%d)", i, lpPoints[count].x, lpPoints[count].y));
738 count++;
739 }
740 }
741#endif
742 return O32_PolyPolygon(hdc, lpPoints, lpPolyCounts, nCount);
[4]743}
744//******************************************************************************
745//******************************************************************************
[1666]746BOOL WIN32API PolyPolyline( HDC hdc, const POINT * lppt, const DWORD * lpdwPolyPoints, DWORD cCount)
[4]747{
[1666]748 return O32_PolyPolyline(hdc,lppt,lpdwPolyPoints,cCount);
[4]749}
750//******************************************************************************
751//******************************************************************************
[4492]752BOOL WIN32API Polygon( HDC hdc, const POINT *lpPoints, int count)
[4]753{
[10374]754 BOOL ret = FALSE;
755#ifdef DEBUG
756 if(lpPoints && count) {
757 for(int i=0;i<count;i++) {
758 dprintf(("Point (%d,%d)", lpPoints[i].x, lpPoints[i].y));
759 }
760 }
761#endif
[4492]762 return O32_Polygon(hdc, lpPoints, count);
[4]763}
764//******************************************************************************
765//******************************************************************************
[4963]766BOOL WIN32API PtVisible( HDC hdc, int x, int y)
[4]767{
[4963]768 dprintf(("GDI32: PtVisible %x (%d,%d)", hdc, x, y));
769 return O32_PtVisible(hdc, x, y);
[4]770}
771//******************************************************************************
772//******************************************************************************
[4963]773BOOL WIN32API RectVisible( HDC hdc, const RECT *lpRect)
[4]774{
[4963]775 if(lpRect == NULL) {
776 dprintf(("WARNING: GDI32: RectVisible %x lpRect == NULL!"));
777 return FALSE;
[10434]778 }
[4963]779 dprintf(("GDI32: RectVisible %x (%d,%d)(%d,%d)", hdc, lpRect->left, lpRect->top, lpRect->right, lpRect->bottom));
780 return O32_RectVisible(hdc, lpRect);
[4]781}
782//******************************************************************************
783//******************************************************************************
784BOOL WIN32API RoundRect( HDC arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7)
785{
786 return O32_RoundRect(arg1, arg2, arg3, arg4, arg5, arg6, arg7);
787}
788//******************************************************************************
789//******************************************************************************
790int WIN32API SetArcDirection( HDC arg1, int arg2)
791{
792 return O32_SetArcDirection(arg1, arg2);
793}
794//******************************************************************************
795//******************************************************************************
796UINT WIN32API SetBoundsRect( HDC arg1, const RECT * arg2, UINT arg3)
797{
798 return O32_SetBoundsRect(arg1, arg2, arg3);
799}
800//******************************************************************************
801//******************************************************************************
802BOOL WIN32API SetBrushOrgEx( HDC arg1, int arg2, int arg3, PPOINT arg4)
803{
[9429]804 return O32_SetBrushOrgEx(arg1, arg2, arg3, arg4);
[4]805}
806//******************************************************************************
807//******************************************************************************
[9429]808DWORD WIN32API SetMapperFlags(HDC hdc, DWORD dwFlag)
[4]809{
[3648]810 return O32_SetMapperFlags(hdc, dwFlag);
[4]811}
812//******************************************************************************
813//******************************************************************************
[9429]814BOOL WIN32API SetMiterLimit(HDC hdc, float eNewLimit, float* peOldLimit)
[4]815{
[3648]816 return O32_SetMiterLimit(hdc, eNewLimit, peOldLimit);
[4]817}
818//******************************************************************************
819//******************************************************************************
[9429]820int WIN32API SetPolyFillMode(HDC hdc, int iPolyFillMode)
[4]821{
[3648]822 return O32_SetPolyFillMode(hdc, iPolyFillMode);
[4]823}
824//******************************************************************************
825//******************************************************************************
[9429]826UINT WIN32API SetTextAlign(HDC hdc, UINT fMode)
[4]827{
[3648]828 return O32_SetTextAlign(hdc, fMode);
[4]829}
830//******************************************************************************
831//******************************************************************************
[9429]832int WIN32API SetTextCharacterExtra(HDC hdc, int nCharExtra)
[4]833{
[3648]834 return O32_SetTextCharacterExtra(hdc, nCharExtra);
[4]835}
836//******************************************************************************
837//******************************************************************************
[9429]838BOOL WIN32API SetTextJustification(HDC hdc, int nBreakExtra, int nBreakCount)
[4]839{
[3648]840 return O32_SetTextJustification(hdc, nBreakExtra, nBreakCount);
[4]841}
842//******************************************************************************
843//******************************************************************************
[3648]844BOOL WIN32API WidenPath( HDC hdc)
[4]845{
[3648]846 return O32_WidenPath(hdc);
[4]847}
848//******************************************************************************
849//TODO: Sets the color adjustment values for a device context. (used to adjust
850// the input color of the src bitmap for calls of StretchBlt & StretchDIBits
851// functions when HALFTONE mode is set
852//******************************************************************************
853BOOL WIN32API SetColorAdjustment(HDC hdc, CONST COLORADJUSTMENT *lpca)
854{
[1703]855 dprintf(("GDI32: SetColorAdjustment, not implemented!(TRUE)\n"));
[4]856 return(TRUE);
857}
858//******************************************************************************
859//Maps colors to system palette; faster way to update window (instead of redrawing)
860//We just redraw
861//******************************************************************************
862BOOL WIN32API UpdateColors(HDC hdc)
863{
[4552]864 return InvalidateRect(WindowFromDC(hdc), NULL, FALSE);
[4]865}
866//******************************************************************************
867//******************************************************************************
868BOOL WIN32API GdiComment(HDC hdc, UINT cbSize, CONST BYTE *lpData)
869{
[5390]870 dprintf(("GDI32: GdiComment %x %d %x NOT IMPLEMENTED", hdc, cbSize, lpData));
871// return O32_GdiComment(hdc, cbSize, lpData);
872 return TRUE;
[4]873}
874//******************************************************************************
875//******************************************************************************
876int WIN32API DrawEscape(HDC hdc, int nEscape, int cbInput, LPCSTR lpszInData)
877{
878 dprintf(("GDI32: DrawEscape, not implemented\n"));
879 return(0);
880}
881//******************************************************************************
882//******************************************************************************
883BOOL WIN32API GetColorAdjustment(HDC hdc, COLORADJUSTMENT *lpca)
884{
885 dprintf(("GDI32: GetColorAdjustment, not implemented\n"));
886 return(FALSE);
887}
888//******************************************************************************
889//******************************************************************************
890
[2527]891
[4]892/*****************************************************************************
893 * Name : BOOL CancelDC
894 * Purpose : The CancelDC function cancels any pending operation on the
895 * specified device context (DC).
896 * Parameters: HDC hdc handle of device context
897 * Variables :
898 * Result : TRUE / FALSE
899 * Remark :
900 * Status : UNTESTED STUB
901 *
902 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
903 *****************************************************************************/
904
905BOOL WIN32API CancelDC(HDC hdc)
906{
907 dprintf(("GDI32: CancelDC(%08xh) not implemented.\n",
908 hdc));
909
910 return (FALSE);
911}
912
913/*****************************************************************************
914 * Name : BOOL CombineTransform
915 * Purpose : The CombineTransform function concatenates two world-space to
916 * page-space transformations.
917 * Parameters: LLPXFORM lLPXFORMResult address of combined transformation
918 * XFORM *lLPXFORM1 address of 1st transformation
919 * XFORM *lLPXFORM2 address of 2nd transformation
920 * Variables :
921 * Result : TRUE / FALSE
922 * Remark :
[3929]923 * Status : COMPLETELY UNTESTED
[4]924 *
925 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
[1966]926 * Markus Montkowski [Wen, 1999/01/12 20:18]
[4]927 *****************************************************************************/
928
929BOOL WIN32API CombineTransform(LPXFORM lLPXFORMResult,
[4557]930 CONST XFORM *lLPXFORM1,
931 CONST XFORM *lLPXFORM2)
[4]932{
[1966]933 dprintf(("GDI32: CombineTransform(%08xh,%08xh,%08xh).\n",
[4]934 lLPXFORMResult,
935 lLPXFORM1,
936 lLPXFORM2));
937
[1966]938 XFORM xfrm;
[6207]939 if( IsBadWritePtr( (void*)lLPXFORMResult, sizeof(XFORM)) ||
940 IsBadReadPtr( (void*)lLPXFORM1, sizeof(XFORM)) ||
941 IsBadWritePtr( (void*)lLPXFORM2, sizeof(XFORM)) )
[4]942 return (FALSE);
[1966]943
944 // Add the translations
945 lLPXFORMResult->eDx = lLPXFORM1->eDx + lLPXFORM2->eDx;
946 lLPXFORMResult->eDy = lLPXFORM1->eDy + lLPXFORM2->eDy;
947
948 // Multiply the matrixes
949 xfrm.eM11 = lLPXFORM1->eM11 * lLPXFORM2->eM11 + lLPXFORM1->eM21 * lLPXFORM1->eM12;
950 xfrm.eM12 = lLPXFORM1->eM11 * lLPXFORM2->eM12 + lLPXFORM1->eM12 * lLPXFORM1->eM22;
951 xfrm.eM21 = lLPXFORM1->eM21 * lLPXFORM2->eM11 + lLPXFORM1->eM22 * lLPXFORM1->eM21;
952 xfrm.eM22 = lLPXFORM1->eM21 * lLPXFORM2->eM12 + lLPXFORM1->eM22 * lLPXFORM1->eM22;
953
954 // Now copy to resulting XFROM as the pt must not be distinct
955 lLPXFORMResult->eM11 = xfrm.eM11;
956 lLPXFORMResult->eM12 = xfrm.eM12;
957 lLPXFORMResult->eM21 = xfrm.eM21;
958 lLPXFORMResult->eM22 = xfrm.eM22;
959
960 return (TRUE);
[4]961}
962
963
964/*****************************************************************************
965 * Name : BOOL FixBrushOrgEx
966 * Purpose : The FixBrushOrgEx function is not implemented in the Win32 API.
967 * It is provided for compatibility with Win32s. If called, the
968 * function does nothing, and returns FALSE.
969 * Parameters: HDC, int, int, LPPOINT
970 * Variables :
971 * Result : TRUE / FALSE
972 * Remark : not implemented in Win32
973 * Status : UNTESTED STUB
974 *
975 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
976 *****************************************************************************/
977
978BOOL WIN32API FixBrushOrgEx(HDC hdc,
979 int iDummy1,
980 int iDummy2,
981 LPPOINT lpPoint)
982{
983 dprintf(("GDI32: FixBrushOrgEx(%08xh,%08xh,%08xh,%08xh) not implemented.\n",
984 hdc,
985 iDummy1,
986 iDummy2,
987 lpPoint));
988
989 return (FALSE);
990}
991
992
993/*****************************************************************************
994 * Name : DWORD GdiGetBatchLimit
995 * Purpose : The GdiGetBatchLimit function returns the maximum number of
996 * function calls that can be accumulated in the calling thread's
997 * current batch. The system flushes the current batch whenever
998 * this limit is exceeded.
999 * Parameters:
1000 * Variables :
1001 * Result : 1
1002 * Remark :
1003 * Status : UNTESTED STUB
1004 *
1005 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
1006 *****************************************************************************/
1007
1008DWORD WIN32API GdiGetBatchLimit(VOID)
1009{
1010 dprintf(("GDI32: GdiGetBatchLimit() not implemented (1).\n"));
1011
1012 return (1);
1013}
1014
1015
1016/*****************************************************************************
1017 * Name : DWORD GdiSetBatchLimit
1018 * Purpose : The GdiSetBatchLimit function sets the maximum number of
1019 * functions that can be accumulated in the calling thread's current
1020 * batch. The system flushes the current batch whenever this limit
1021 * is exceeded.
1022 * Parameters: DWORD dwLimit
1023 * Variables :
1024 * Result :
1025 * Remark :
1026 * Status : UNTESTED STUB
1027 *
1028 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
1029 *****************************************************************************/
1030
1031DWORD WIN32API GdiSetBatchLimit(DWORD dwLimit)
1032{
1033 dprintf(("GDI32: GdiSetBatchLimit(%08xh) not implemented (1).\n",
1034 dwLimit));
1035
1036 return (1);
1037}
1038
1039
Note: See TracBrowser for help on using the repository browser.