diff --git a/reactos/lib/gdi32/makefile b/reactos/lib/gdi32/makefile index 8b3784a990c..0bde954baba 100644 --- a/reactos/lib/gdi32/makefile +++ b/reactos/lib/gdi32/makefile @@ -1,4 +1,4 @@ -# $Id: makefile,v 1.27 2003/04/14 12:14:50 hyperion Exp $ +# $Id: makefile,v 1.28 2003/06/26 21:52:40 gvg Exp $ PATH_TO_TOP = ../.. @@ -23,14 +23,15 @@ MAIN_OBJECTS = main/dllmain.o MISC_OBJECTS = misc/stubs.o misc/stubsa.o misc/stubsw.o misc/win32k.o OBJECTS_OBJECTS = \ + objects/bitblt.o \ + objects/brush.o \ + objects/clip.o \ objects/dc.o \ + objects/fillshap.o \ objects/line.o \ objects/pen.o \ - objects/bitblt.o \ - objects/text.o \ objects/region.o \ - objects/brush.o \ - objects/fillshap.o + objects/text.o TARGET_OBJECTS = $(MAIN_OBJECTS) $(MISC_OBJECTS) $(OBJECTS_OBJECTS) diff --git a/reactos/lib/gdi32/misc/stubs.c b/reactos/lib/gdi32/misc/stubs.c index 559ab21b48b..a6e92f40dc6 100644 --- a/reactos/lib/gdi32/misc/stubs.c +++ b/reactos/lib/gdi32/misc/stubs.c @@ -1,4 +1,4 @@ -/* $Id: stubs.c,v 1.19 2003/06/03 22:24:51 ekohl Exp $ +/* $Id: stubs.c,v 1.20 2003/06/26 21:52:40 gvg Exp $ * * reactos/lib/gdi32/misc/stubs.c * @@ -1069,19 +1069,6 @@ SaveDC( -int -STDCALL -SelectClipRgn( - HDC a0, - HRGN a1 - ) -{ - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; -} - - - int STDCALL ExtSelectClipRgn( diff --git a/reactos/lib/gdi32/objects/clip.c b/reactos/lib/gdi32/objects/clip.c new file mode 100644 index 00000000000..85e26ad8740 --- /dev/null +++ b/reactos/lib/gdi32/objects/clip.c @@ -0,0 +1,37 @@ +/* + * ReactOS GDI lib + * Copyright (C) 2003 ReactOS Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +/* $Id: clip.c,v 1.1 2003/06/26 21:52:40 gvg Exp $ + * + * PROJECT: ReactOS gdi32.dll + * FILE: lib/gdi32/objects/clip.c + * PURPOSE: Clipping functions + * PROGRAMMER: Ge van Geldorp (ge@gse.nl) + * UPDATE HISTORY: + * 2003/06/26 GvG Created + */ + +#include +#include + +int +STDCALL +SelectClipRgn(HDC DC, HRGN Rgn) +{ + return W32kSelectClipRgn(DC, Rgn); +} diff --git a/reactos/subsys/win32k/objects/cliprgn.c b/reactos/subsys/win32k/objects/cliprgn.c index 1f998a6d82a..7720e5c2e3d 100644 --- a/reactos/subsys/win32k/objects/cliprgn.c +++ b/reactos/subsys/win32k/objects/cliprgn.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: cliprgn.c,v 1.15 2003/05/18 17:16:17 ea Exp $ */ +/* $Id: cliprgn.c,v 1.16 2003/06/26 21:52:40 gvg Exp $ */ #undef WIN32_LEAN_AND_MEAN #include @@ -25,6 +25,7 @@ #include #include #include +#include #define NDEBUG #include @@ -169,9 +170,47 @@ BOOL STDCALL W32kSelectClipPath(HDC hDC, } int STDCALL W32kSelectClipRgn(HDC hDC, - HRGN hrgn) + HRGN hRgn) { - UNIMPLEMENTED; + int Type; + PDC dc; + HRGN Copy; + + dc = DC_HandleToPtr(hDC); + if (NULL == dc) + { + SetLastWin32Error(ERROR_INVALID_HANDLE); + return ERROR; + } + + if (NULL != hRgn) + { + Copy = W32kCreateRectRgn(0, 0, 0, 0); + if (NULL == Copy) + { + return ERROR; + } + Type = W32kCombineRgn(Copy, hRgn, 0, RGN_COPY); + if (ERROR == Type) + { + W32kDeleteObject(Copy); + return ERROR; + } + W32kOffsetRgn(Copy, dc->w.DCOrgX, dc->w.DCOrgX); + } + else + { + Copy = NULL; + } + + if (NULL != dc->w.hClipRgn) + { + W32kDeleteObject(dc->w.hClipRgn); + } + dc->w.hClipRgn = Copy; + CLIPPING_UpdateGCRegion(dc); + + return ERROR; } int STDCALL W32kSetMetaRgn(HDC hDC)