mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
Don't reinitialize the VGA on an enable surface if it is already initialized
Implemented patblt and rectangle fill Offset drawing by the origin of the DC Other GUI fixes svn path=/trunk/; revision=3450
This commit is contained in:
parent
a8c82f2bfb
commit
b163519757
30 changed files with 702 additions and 328 deletions
|
@ -19,7 +19,7 @@ WinMain(HINSTANCE hInstance,
|
||||||
wc.hInstance = hInstance;
|
wc.hInstance = hInstance;
|
||||||
wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
|
wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
|
||||||
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
|
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
|
||||||
wc.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
|
wc.hbrBackground = (HBRUSH)GetStockObject(GRAY_BRUSH);
|
||||||
wc.lpszMenuName = NULL;
|
wc.lpszMenuName = NULL;
|
||||||
wc.cbClsExtra = 0;
|
wc.cbClsExtra = 0;
|
||||||
wc.cbWndExtra = 0;
|
wc.cbWndExtra = 0;
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
/*
|
/*
|
||||||
* entry.c
|
* entry.c
|
||||||
*
|
*
|
||||||
* $Revision: 1.19 $
|
* $Revision: 1.20 $
|
||||||
* $Author: jfilby $
|
* $Author: dwelch $
|
||||||
* $Date: 2002/08/19 22:01:11 $
|
* $Date: 2002/09/01 20:39:53 $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -13,6 +13,7 @@
|
||||||
|
|
||||||
#define DBG_PREFIX "VGADDI: "
|
#define DBG_PREFIX "VGADDI: "
|
||||||
|
|
||||||
|
static BOOL VGAInitialized = FALSE;
|
||||||
|
|
||||||
DRVFN FuncList[] =
|
DRVFN FuncList[] =
|
||||||
{
|
{
|
||||||
|
@ -186,12 +187,15 @@ DrvAssertMode(IN DHPDEV DPev,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!VGAInitialized)
|
||||||
|
{
|
||||||
if (!InitVGA(ppdev, FALSE))
|
if (!InitVGA(ppdev, FALSE))
|
||||||
{
|
{
|
||||||
// Failed to initialize the VGA
|
// Failed to initialize the VGA
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
VGAInitialized = TRUE;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// Go back to last known mode
|
// Go back to last known mode
|
||||||
DPRINT( "ppdev: %x, KMDriver: %x", ppdev, ppdev->KMDriver );
|
DPRINT( "ppdev: %x, KMDriver: %x", ppdev, ppdev->KMDriver );
|
||||||
|
@ -200,7 +204,7 @@ DrvAssertMode(IN DHPDEV DPev,
|
||||||
// Failed to go back to mode
|
// Failed to go back to mode
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
VGAInitialized = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -323,10 +327,14 @@ DrvEnableSurface(IN DHPDEV PDev)
|
||||||
DPRINT1("DrvEnableSurface() called\n");
|
DPRINT1("DrvEnableSurface() called\n");
|
||||||
|
|
||||||
// Initialize the VGA
|
// Initialize the VGA
|
||||||
|
if (!VGAInitialized)
|
||||||
|
{
|
||||||
if (!InitVGA(ppdev, TRUE))
|
if (!InitVGA(ppdev, TRUE))
|
||||||
{
|
{
|
||||||
goto error_done;
|
goto error_done;
|
||||||
}
|
}
|
||||||
|
VGAInitialized = TRUE;
|
||||||
|
}
|
||||||
CHECKPOINT1;
|
CHECKPOINT1;
|
||||||
|
|
||||||
// dhsurf is of type DEVSURF, which is the drivers specialized surface type
|
// dhsurf is of type DEVSURF, which is the drivers specialized surface type
|
||||||
|
|
|
@ -57,9 +57,19 @@ BOOL DIBtoVGA(
|
||||||
}
|
}
|
||||||
tMask += Mask->lDelta;
|
tMask += Mask->lDelta;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
} else
|
} else if (rop4 == PATCOPY)
|
||||||
|
{
|
||||||
|
for (j=0;j<dy;j++)
|
||||||
|
{
|
||||||
|
for (i=0;i<dx;i++)
|
||||||
|
{
|
||||||
|
vgaPutPixel(DestRect->left+i, DestRect->top+j,
|
||||||
|
Brush->iSolidColor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
DIB_BltToVGA(DestRect->left, DestRect->top, dx, dy, Source->pvBits, Source->lDelta);
|
DIB_BltToVGA(DestRect->left, DestRect->top, dx, dy, Source->pvBits, Source->lDelta);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -355,6 +355,7 @@ NtUserGetAsyncKeyState 1
|
||||||
NtUserGetCaretBlinkTime 0
|
NtUserGetCaretBlinkTime 0
|
||||||
NtUserGetCaretPos 1
|
NtUserGetCaretPos 1
|
||||||
NtUserGetClassInfo 5
|
NtUserGetClassInfo 5
|
||||||
|
NtUserGetClassLong 2
|
||||||
NtUserGetClassName 3
|
NtUserGetClassName 3
|
||||||
NtUserGetClipboardData 2
|
NtUserGetClipboardData 2
|
||||||
NtUserGetClipboardFormatName 3
|
NtUserGetClipboardFormatName 3
|
||||||
|
|
|
@ -1302,14 +1302,6 @@ extern "C" {
|
||||||
#define DCX_EXCLUDEUPDATE (0x00000100L)
|
#define DCX_EXCLUDEUPDATE (0x00000100L)
|
||||||
#define DCX_INTERSECTUPDATE (0x00000200L)
|
#define DCX_INTERSECTUPDATE (0x00000200L)
|
||||||
|
|
||||||
/* Internal DCX flags */
|
|
||||||
#define DCX_DCEEMPTY (0x00000800L)
|
|
||||||
#define DCX_DCEBUSY (0x00001000L)
|
|
||||||
#define DCX_DCEDIRTY (0x00002000L)
|
|
||||||
#define DCX_WINDOWPAINT (0x00020000L)
|
|
||||||
#define DCX_KEEPCLIPRGN (0x00040000L)
|
|
||||||
#define DCX_NOCLIPCHILDREN (0x00080000L)
|
|
||||||
|
|
||||||
/* GetDeviceCaps */
|
/* GetDeviceCaps */
|
||||||
#define DRIVERVERSION (0)
|
#define DRIVERVERSION (0)
|
||||||
#define TECHNOLOGY (2)
|
#define TECHNOLOGY (2)
|
||||||
|
|
|
@ -614,8 +614,7 @@ STDCALL
|
||||||
NtUserGetCursorInfo(
|
NtUserGetCursorInfo(
|
||||||
DWORD Unknown0);
|
DWORD Unknown0);
|
||||||
|
|
||||||
DWORD
|
HDC STDCALL
|
||||||
STDCALL
|
|
||||||
NtUserGetDC(HWND hWnd);
|
NtUserGetDC(HWND hWnd);
|
||||||
|
|
||||||
HDC STDCALL NtUserGetDCEx(HWND hWnd, HANDLE hRegion, ULONG Flags);
|
HDC STDCALL NtUserGetDCEx(HWND hWnd, HANDLE hRegion, ULONG Flags);
|
||||||
|
|
|
@ -146,5 +146,8 @@ W32kGetRegionData(HRGN hrgn,
|
||||||
HRGN REGION_CropRgn(HRGN hDst, HRGN hSrc, const PRECT lpRect, PPOINT lpPt);
|
HRGN REGION_CropRgn(HRGN hDst, HRGN hSrc, const PRECT lpRect, PPOINT lpPt);
|
||||||
HRGN STDCALL
|
HRGN STDCALL
|
||||||
UnsafeW32kCreateRectRgnIndirect(CONST PRECT rc);
|
UnsafeW32kCreateRectRgnIndirect(CONST PRECT rc);
|
||||||
|
INT STDCALL
|
||||||
|
UnsafeW32kGetRgnBox(HRGN hRgn,
|
||||||
|
LPRECT pRect);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: stubs.c,v 1.9 2002/08/31 23:18:45 dwelch Exp $
|
/* $Id: stubs.c,v 1.10 2002/09/01 20:39:54 dwelch Exp $
|
||||||
*
|
*
|
||||||
* reactos/lib/gdi32/misc/stubs.c
|
* reactos/lib/gdi32/misc/stubs.c
|
||||||
*
|
*
|
||||||
|
@ -690,15 +690,6 @@ GetRasterizerCaps(
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
HGDIOBJ
|
|
||||||
STDCALL
|
|
||||||
GetStockObject(
|
|
||||||
int a0
|
|
||||||
)
|
|
||||||
{
|
|
||||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -939,20 +930,6 @@ OffsetClipRgn(
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BOOL
|
|
||||||
STDCALL
|
|
||||||
PatBlt(
|
|
||||||
HDC a0,
|
|
||||||
int a1,
|
|
||||||
int a2,
|
|
||||||
int a3,
|
|
||||||
int a4,
|
|
||||||
DWORD a5
|
|
||||||
)
|
|
||||||
{
|
|
||||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -217,6 +217,11 @@ SetPixel(HDC hDC,
|
||||||
return W32kSetPixel(hDC, X, Y, Color);
|
return W32kSetPixel(hDC, X, Y, Color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOL STDCALL
|
||||||
|
PatBlt(HDC hDC, INT Top, INT Left, INT Width, INT Height, ULONG Rop)
|
||||||
|
{
|
||||||
|
return(W32kPatBlt(hDC, Top, Left, Width, Height, Rop));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,13 @@
|
||||||
#include <ddk/ntddk.h>
|
#include <ddk/ntddk.h>
|
||||||
#include <win32k/kapi.h>
|
#include <win32k/kapi.h>
|
||||||
|
|
||||||
|
HGDIOBJ STDCALL
|
||||||
|
GetStockObject(int Index)
|
||||||
|
{
|
||||||
|
return(W32kGetStockObject(Index));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int STDCALL
|
int STDCALL
|
||||||
GetClipBox(HDC hDc, LPRECT Rect)
|
GetClipBox(HDC hDc, LPRECT Rect)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: stubs.c,v 1.10 2002/08/31 23:18:46 dwelch Exp $
|
/* $Id: stubs.c,v 1.11 2002/09/01 20:39:55 dwelch Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS user32.dll
|
* PROJECT: ReactOS user32.dll
|
||||||
|
@ -223,14 +223,6 @@ GetSysColor(
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
HBRUSH
|
|
||||||
STDCALL
|
|
||||||
GetSysColorBrush(
|
|
||||||
int nIndex)
|
|
||||||
{
|
|
||||||
return (HBRUSH)0;
|
|
||||||
}
|
|
||||||
|
|
||||||
HMENU
|
HMENU
|
||||||
STDCALL
|
STDCALL
|
||||||
GetSystemMenu(
|
GetSystemMenu(
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: class.c,v 1.13 2002/06/18 21:51:09 dwelch Exp $
|
/* $Id: class.c,v 1.14 2002/09/01 20:39:55 dwelch Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS user32.dll
|
* PROJECT: ReactOS user32.dll
|
||||||
|
@ -53,22 +53,26 @@ GetClassInfoW(
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD
|
DWORD STDCALL
|
||||||
STDCALL
|
GetClassLongA(HWND hWnd, int nIndex)
|
||||||
GetClassLongA(
|
|
||||||
HWND hWnd,
|
|
||||||
int nIndex)
|
|
||||||
{
|
{
|
||||||
return 0;
|
switch (nIndex)
|
||||||
|
{
|
||||||
|
case GCL_WNDPROC:
|
||||||
|
UNIMPLEMENTED;
|
||||||
|
return(0);
|
||||||
|
case GCL_MENUNAME:
|
||||||
|
UNIMPLEMENTED;
|
||||||
|
return(0);
|
||||||
|
default:
|
||||||
|
return(GetClassLongW(hWnd, nIndex));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD
|
DWORD STDCALL
|
||||||
STDCALL
|
GetClassLongW(HWND hWnd, int nIndex)
|
||||||
GetClassLongW(
|
|
||||||
HWND hWnd,
|
|
||||||
int nIndex)
|
|
||||||
{
|
{
|
||||||
return 0;
|
return(NtUserGetClassLong(hWnd, nIndex));
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: defwnd.c,v 1.5 2002/08/31 23:18:46 dwelch Exp $
|
/* $Id: defwnd.c,v 1.6 2002/09/01 20:39:55 dwelch Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS user32.dll
|
* PROJECT: ReactOS user32.dll
|
||||||
|
@ -69,6 +69,12 @@ GetSysColorPen(int nIndex)
|
||||||
return(CreatePen(PS_SOLID, 1, SysColours[nIndex]));
|
return(CreatePen(PS_SOLID, 1, SysColours[nIndex]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HBRUSH STDCALL
|
||||||
|
GetSysColorBrush(int nIndex)
|
||||||
|
{
|
||||||
|
return(CreateSolidBrush(SysColours[nIndex]));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
LRESULT STDCALL
|
LRESULT STDCALL
|
||||||
DefFrameProcA(HWND hWnd,
|
DefFrameProcA(HWND hWnd,
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: draw.c,v 1.1 2002/06/13 20:36:40 dwelch Exp $
|
/* $Id: draw.c,v 1.2 2002/09/01 20:39:55 dwelch Exp $
|
||||||
*
|
*
|
||||||
* PROJECT: ReactOS user32.dll
|
* PROJECT: ReactOS user32.dll
|
||||||
* FILE: lib/user32/windows/input.c
|
* FILE: lib/user32/windows/input.c
|
||||||
|
@ -32,6 +32,10 @@
|
||||||
#include <user32.h>
|
#include <user32.h>
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
|
/* GLOBALS *******************************************************************/
|
||||||
|
|
||||||
|
#define COLOR_MAX (28)
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
||||||
WINBOOL
|
WINBOOL
|
||||||
|
@ -127,15 +131,25 @@ FlashWindowEx(
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
int
|
|
||||||
STDCALL
|
int STDCALL
|
||||||
FillRect(
|
FillRect(HDC hDC, CONST RECT *lprc, HBRUSH hbr)
|
||||||
HDC hDC,
|
|
||||||
CONST RECT *lprc,
|
|
||||||
HBRUSH hbr)
|
|
||||||
{
|
{
|
||||||
return 0;
|
HBRUSH prevhbr;
|
||||||
|
/*if (hbr <= (HBRUSH)(COLOR_MAX + 1))
|
||||||
|
{
|
||||||
|
hbr = GetSysColorBrush((INT)hbr - 1);
|
||||||
|
}*/
|
||||||
|
if ((prevhbr = SelectObject(hDC, hbr)) == NULL)
|
||||||
|
{
|
||||||
|
return(FALSE);
|
||||||
}
|
}
|
||||||
|
PatBlt(hDC, lprc->left, lprc->top, lprc->right - lprc->left,
|
||||||
|
lprc->bottom - lprc->top, PATCOPY);
|
||||||
|
SelectObject(hDC, prevhbr);
|
||||||
|
return(TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
WINBOOL
|
WINBOOL
|
||||||
STDCALL
|
STDCALL
|
||||||
DrawAnimatedRects(
|
DrawAnimatedRects(
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: rect.c,v 1.5 2002/06/13 20:36:40 dwelch Exp $
|
/* $Id: rect.c,v 1.6 2002/09/01 20:39:55 dwelch Exp $
|
||||||
*
|
*
|
||||||
* PROJECT: ReactOS user32.dll
|
* PROJECT: ReactOS user32.dll
|
||||||
* FILE: lib/user32/windows/input.c
|
* FILE: lib/user32/windows/input.c
|
||||||
|
@ -34,30 +34,31 @@
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
||||||
WINBOOL
|
WINBOOL STDCALL
|
||||||
STDCALL
|
CopyRect(LPRECT lprcDst, CONST RECT *lprcSrc)
|
||||||
CopyRect(
|
|
||||||
LPRECT lprcDst,
|
|
||||||
CONST RECT *lprcSrc)
|
|
||||||
{
|
{
|
||||||
return FALSE;
|
*lprcDst = *lprcSrc;
|
||||||
|
return(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
WINBOOL
|
WINBOOL
|
||||||
STDCALL
|
STDCALL
|
||||||
EqualRect(
|
EqualRect(
|
||||||
CONST RECT *lprc1,
|
CONST RECT *lprc1,
|
||||||
CONST RECT *lprc2)
|
CONST RECT *lprc2)
|
||||||
{
|
{
|
||||||
|
UNIMPLEMENTED;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
WINBOOL
|
|
||||||
STDCALL
|
WINBOOL STDCALL
|
||||||
InflateRect(
|
InflateRect(LPRECT rect, int dx, int dy)
|
||||||
LPRECT lprc,
|
|
||||||
int dx,
|
|
||||||
int dy)
|
|
||||||
{
|
{
|
||||||
return FALSE;
|
rect->left -= dx;
|
||||||
|
rect->top -= dy;
|
||||||
|
rect->right -= dx;
|
||||||
|
rect->bottom -= dy;
|
||||||
|
return(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
WINBOOL
|
WINBOOL
|
||||||
|
@ -67,66 +68,85 @@ IntersectRect(
|
||||||
CONST RECT *lprcSrc1,
|
CONST RECT *lprcSrc1,
|
||||||
CONST RECT *lprcSrc2)
|
CONST RECT *lprcSrc2)
|
||||||
{
|
{
|
||||||
return FALSE;
|
UNIMPLEMENTED;
|
||||||
}
|
|
||||||
WINBOOL
|
|
||||||
STDCALL
|
|
||||||
IsRectEmpty(
|
|
||||||
CONST RECT *lprc)
|
|
||||||
{
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
WINBOOL
|
|
||||||
STDCALL
|
|
||||||
OffsetRect(
|
|
||||||
LPRECT lprc,
|
|
||||||
int dx,
|
|
||||||
int dy)
|
|
||||||
{
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
WINBOOL
|
|
||||||
STDCALL
|
|
||||||
PtInRect(
|
|
||||||
CONST RECT *lprc,
|
|
||||||
POINT pt)
|
|
||||||
{
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
WINBOOL
|
|
||||||
STDCALL
|
|
||||||
SetRect(
|
|
||||||
LPRECT lprc,
|
|
||||||
int xLeft,
|
|
||||||
int yTop,
|
|
||||||
int xRight,
|
|
||||||
int yBottom)
|
|
||||||
{
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
WINBOOL
|
WINBOOL STDCALL
|
||||||
STDCALL
|
IsRectEmpty(CONST RECT *lprc)
|
||||||
SetRectEmpty(
|
|
||||||
LPRECT lprc)
|
|
||||||
{
|
{
|
||||||
|
return((lprc->left >= lprc->right) || (lprc->top >= lprc->bottom));
|
||||||
|
}
|
||||||
|
|
||||||
|
WINBOOL STDCALL
|
||||||
|
OffsetRect(LPRECT rect, int dx, int dy)
|
||||||
|
{
|
||||||
|
rect->left += dx;
|
||||||
|
rect->top += dy;
|
||||||
|
rect->right += dx;
|
||||||
|
rect->bottom += dy;
|
||||||
|
return(TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
WINBOOL STDCALL
|
||||||
|
PtInRect(CONST RECT *lprc, POINT pt)
|
||||||
|
{
|
||||||
|
return((pt.x >= lprc->left) && (pt.x < lprc->right) &&
|
||||||
|
(pt.y >= lprc->top) && (pt.y < lprc->bottom));
|
||||||
|
}
|
||||||
|
|
||||||
|
WINBOOL STDCALL
|
||||||
|
SetRect(LPRECT lprc, int xLeft, int yTop, int xRight, int yBottom)
|
||||||
|
{
|
||||||
|
lprc->left = xLeft;
|
||||||
|
lprc->top = yTop;
|
||||||
|
lprc->right = xRight;
|
||||||
|
lprc->bottom = yBottom;
|
||||||
|
return(TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL STDCALL
|
||||||
|
SetRectEmpty(LPRECT lprc)
|
||||||
|
{
|
||||||
|
lprc->left = lprc->right = lprc->top = lprc->bottom = 0;
|
||||||
|
return(TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
WINBOOL STDCALL
|
||||||
|
SubtractRect(LPRECT lprcDst, CONST RECT *lprcSrc1, CONST RECT *lprcSrc2)
|
||||||
|
{
|
||||||
|
UNIMPLEMENTED;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
WINBOOL
|
|
||||||
STDCALL
|
WINBOOL STDCALL
|
||||||
SubtractRect(
|
UnionRect(LPRECT lprcDst, CONST RECT *lprcSrc1, CONST RECT *lprcSrc2)
|
||||||
LPRECT lprcDst,
|
|
||||||
CONST RECT *lprcSrc1,
|
|
||||||
CONST RECT *lprcSrc2)
|
|
||||||
{
|
{
|
||||||
return FALSE;
|
if (IsRectEmpty(lprcSrc1))
|
||||||
}
|
|
||||||
WINBOOL
|
|
||||||
STDCALL
|
|
||||||
UnionRect(
|
|
||||||
LPRECT lprcDst,
|
|
||||||
CONST RECT *lprcSrc1,
|
|
||||||
CONST RECT *lprcSrc2)
|
|
||||||
{
|
{
|
||||||
return FALSE;
|
if (IsRectEmpty(lprcSrc2))
|
||||||
|
{
|
||||||
|
SetRectEmpty(lprcDst);
|
||||||
|
return(FALSE);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
*lprcDst = *lprcSrc2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (IsRectEmpty(lprcSrc2))
|
||||||
|
{
|
||||||
|
*lprcDst = *lprcSrc1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lprcDst->left = min(lprcSrc1->left, lprcSrc2->left);
|
||||||
|
lprcDst->top = min(lprcSrc1->top, lprcSrc2->top);
|
||||||
|
lprcDst->right = max(lprcSrc1->right, lprcSrc2->right);
|
||||||
|
lprcDst->bottom = max(lprcSrc1->bottom, lprcSrc2->bottom);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return(TRUE);
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,9 +72,12 @@ EngBitBlt(SURFOBJ *Dest,
|
||||||
if(Source != NULL) SourceGDI = (PSURFGDI)AccessInternalObjectFromUserObject(Source);
|
if(Source != NULL) SourceGDI = (PSURFGDI)AccessInternalObjectFromUserObject(Source);
|
||||||
if(Dest != NULL) DestGDI = (PSURFGDI)AccessInternalObjectFromUserObject(Dest);
|
if(Dest != NULL) DestGDI = (PSURFGDI)AccessInternalObjectFromUserObject(Dest);
|
||||||
|
|
||||||
|
if (Source != NULL)
|
||||||
|
{
|
||||||
MouseSafetyOnDrawStart(Source, SourceGDI, SourcePoint->x, SourcePoint->y,
|
MouseSafetyOnDrawStart(Source, SourceGDI, SourcePoint->x, SourcePoint->y,
|
||||||
(SourcePoint->x + abs(DestRect->right - DestRect->left)),
|
(SourcePoint->x + abs(DestRect->right - DestRect->left)),
|
||||||
(SourcePoint->y + abs(DestRect->bottom - DestRect->top)));
|
(SourcePoint->y + abs(DestRect->bottom - DestRect->top)));
|
||||||
|
}
|
||||||
MouseSafetyOnDrawStart(Dest, DestGDI, DestRect->left, DestRect->top, DestRect->right, DestRect->bottom);
|
MouseSafetyOnDrawStart(Dest, DestGDI, DestRect->left, DestRect->top, DestRect->right, DestRect->bottom);
|
||||||
|
|
||||||
// If we don't have to do anything special, we can punt to DrvCopyBits
|
// If we don't have to do anything special, we can punt to DrvCopyBits
|
||||||
|
|
|
@ -29,7 +29,7 @@ typedef struct tagDCE
|
||||||
HWND hwndDC;
|
HWND hwndDC;
|
||||||
HRGN hClipRgn;
|
HRGN hClipRgn;
|
||||||
DCE_TYPE type;
|
DCE_TYPE type;
|
||||||
DWORD DCXflags;
|
DWORD DCXFlags;
|
||||||
} DCE, *PDCE;
|
} DCE, *PDCE;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -74,7 +74,7 @@ typedef struct _WINDOW_OBJECT
|
||||||
/* Pointer to the parent window. */
|
/* Pointer to the parent window. */
|
||||||
struct _WINDOW_OBJECT* Parent;
|
struct _WINDOW_OBJECT* Parent;
|
||||||
/* DC Entries (DCE) */
|
/* DC Entries (DCE) */
|
||||||
PDCE dce;
|
PDCE Dce;
|
||||||
} WINDOW_OBJECT, *PWINDOW_OBJECT;
|
} WINDOW_OBJECT, *PWINDOW_OBJECT;
|
||||||
|
|
||||||
/* Window flags. */
|
/* Window flags. */
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: class.c,v 1.10 2002/08/16 01:39:17 dwelch Exp $
|
/* $Id: class.c,v 1.11 2002/09/01 20:39:56 dwelch Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -18,6 +18,7 @@
|
||||||
#include <include/winsta.h>
|
#include <include/winsta.h>
|
||||||
#include <include/object.h>
|
#include <include/object.h>
|
||||||
#include <include/guicheck.h>
|
#include <include/guicheck.h>
|
||||||
|
#include <include/window.h>
|
||||||
|
|
||||||
//#define NDEBUG
|
//#define NDEBUG
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
@ -267,6 +268,37 @@ NtUserRegisterClassExWOW(LPWNDCLASSEX lpwcx,
|
||||||
DWORD STDCALL
|
DWORD STDCALL
|
||||||
NtUserGetClassLong(HWND hWnd, DWORD Offset)
|
NtUserGetClassLong(HWND hWnd, DWORD Offset)
|
||||||
{
|
{
|
||||||
|
PWINDOW_OBJECT WindowObject;
|
||||||
|
LONG Ret;
|
||||||
|
|
||||||
|
WindowObject = W32kGetWindowObject(hWnd);
|
||||||
|
if (WindowObject == NULL)
|
||||||
|
{
|
||||||
|
return(0);
|
||||||
|
}
|
||||||
|
switch (Offset)
|
||||||
|
{
|
||||||
|
case GCL_STYLE:
|
||||||
|
Ret = WindowObject->Class->Class.style;
|
||||||
|
break;
|
||||||
|
case GCL_CBWNDEXTRA:
|
||||||
|
Ret = WindowObject->Class->Class.cbWndExtra;
|
||||||
|
break;
|
||||||
|
case GCL_CBCLSEXTRA:
|
||||||
|
Ret = WindowObject->Class->Class.cbClsExtra;
|
||||||
|
break;
|
||||||
|
case GCL_HMODULE:
|
||||||
|
Ret = WindowObject->Class->Class.hInstance;
|
||||||
|
break;
|
||||||
|
case GCL_HBRBACKGROUND:
|
||||||
|
Ret = WindowObject->Class->Class.hbrBackground;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
Ret = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
W32kReleaseWindowObject(WindowObject);
|
||||||
|
return(Ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD STDCALL
|
DWORD STDCALL
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: metric.c,v 1.2 2002/08/31 23:18:47 dwelch Exp $
|
/* $Id: metric.c,v 1.3 2002/09/01 20:39:56 dwelch Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -53,6 +53,8 @@ NtUserGetSystemMetrics(ULONG Index)
|
||||||
return(17);
|
return(17);
|
||||||
case SM_CYHSCROLL:
|
case SM_CYHSCROLL:
|
||||||
return(17);
|
return(17);
|
||||||
|
case SM_CYCAPTION:
|
||||||
|
return(20);
|
||||||
default:
|
default:
|
||||||
return(0xFFFFFFFF);
|
return(0xFFFFFFFF);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: windc.c,v 1.5 2002/08/27 23:29:40 dwelch Exp $
|
/* $Id: windc.c,v 1.6 2002/09/01 20:39:56 dwelch Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -25,13 +25,26 @@
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
static PDCE firstDCE;
|
/* GLOBALS *******************************************************************/
|
||||||
|
|
||||||
|
static PDCE FirstDce = NULL;
|
||||||
|
|
||||||
|
#define DCX_CACHECOMPAREMASK (DCX_CLIPSIBLINGS | DCX_CLIPCHILDREN | \
|
||||||
|
DCX_CACHE | DCX_WINDOW | DCX_PARENTCLIP)
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
||||||
VOID DCE_FreeWindowDCE(HWND);
|
VOID STATIC
|
||||||
INT DCE_ExcludeRgn(HDC, HWND, HRGN);
|
DceOffsetVisRgn(HDC hDC, HRGN hVisRgn)
|
||||||
BOOL DCE_InvalidateDCE(HWND, const PRECTL);
|
{
|
||||||
|
DC *dc = DC_HandleToPtr(hDC);
|
||||||
|
if (dc == NULL)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
W32kOffsetRgn(hVisRgn, dc->w.DCOrgX, dc->w.DCOrgY);
|
||||||
|
DC_ReleasePtr(hDC);
|
||||||
|
}
|
||||||
|
|
||||||
BOOL STATIC
|
BOOL STATIC
|
||||||
DceGetVisRect(PWINDOW_OBJECT Window, BOOL ClientArea, RECT* Rect)
|
DceGetVisRect(PWINDOW_OBJECT Window, BOOL ClientArea, RECT* Rect)
|
||||||
|
@ -130,7 +143,7 @@ DceGetVisRgn(HWND hWnd, ULONG Flags, HWND hWndChild, ULONG CFlags)
|
||||||
|
|
||||||
if (Window != NULL && DceGetVisRect(Window, !(Flags & DCX_WINDOW), &Rect))
|
if (Window != NULL && DceGetVisRect(Window, !(Flags & DCX_WINDOW), &Rect))
|
||||||
{
|
{
|
||||||
if ((VisRgn = W32kCreateRectRgnIndirect(&Rect)) != NULL)
|
if ((VisRgn = UnsafeW32kCreateRectRgnIndirect(&Rect)) != NULL)
|
||||||
{
|
{
|
||||||
HRGN ClipRgn = W32kCreateRectRgn(0, 0, 0, 0);
|
HRGN ClipRgn = W32kCreateRectRgn(0, 0, 0, 0);
|
||||||
INT XOffset, YOffset;
|
INT XOffset, YOffset;
|
||||||
|
@ -232,8 +245,7 @@ NtUserReleaseDC(HWND hWnd, HDC hDc)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD
|
HDC STDCALL
|
||||||
STDCALL
|
|
||||||
NtUserGetDC(HWND hWnd)
|
NtUserGetDC(HWND hWnd)
|
||||||
{
|
{
|
||||||
if (!hWnd)
|
if (!hWnd)
|
||||||
|
@ -241,159 +253,279 @@ NtUserGetDC(HWND hWnd)
|
||||||
return NtUserGetDCEx(hWnd, 0, DCX_USESTYLE);
|
return NtUserGetDCEx(hWnd, 0, DCX_USESTYLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DCE* DceAllocDCE(HWND hWnd, DCE_TYPE Type)
|
||||||
|
{
|
||||||
|
HDCE DceHandle;
|
||||||
|
DCE* Dce;
|
||||||
|
|
||||||
|
DceHandle = DCEOBJ_AllocDCE();
|
||||||
|
Dce = DCEOBJ_LockDCE(DceHandle);
|
||||||
|
Dce->hDC = W32kCreateDC(L"DISPLAY", NULL, NULL, NULL);
|
||||||
|
Dce->hwndCurrent = hWnd;
|
||||||
|
Dce->hClipRgn = NULL;
|
||||||
|
Dce->next = FirstDce;
|
||||||
|
FirstDce = Dce;
|
||||||
|
|
||||||
|
if (Type != DCE_CACHE_DC)
|
||||||
|
{
|
||||||
|
Dce->DCXFlags = DCX_DCEBUSY;
|
||||||
|
if (hWnd != NULL)
|
||||||
|
{
|
||||||
|
PWINDOW_OBJECT WindowObject;
|
||||||
|
|
||||||
|
WindowObject = W32kGetWindowObject(hWnd);
|
||||||
|
if (WindowObject->Style & WS_CLIPCHILDREN)
|
||||||
|
{
|
||||||
|
Dce->DCXFlags |= DCX_CLIPCHILDREN;
|
||||||
|
}
|
||||||
|
if (WindowObject->Style & WS_CLIPSIBLINGS)
|
||||||
|
{
|
||||||
|
Dce->DCXFlags |= DCX_CLIPSIBLINGS;
|
||||||
|
}
|
||||||
|
W32kReleaseWindowObject(WindowObject);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Dce->DCXFlags = DCX_CACHE | DCX_DCEEMPTY;
|
||||||
|
}
|
||||||
|
|
||||||
|
return(Dce);
|
||||||
|
}
|
||||||
|
|
||||||
|
VOID STATIC
|
||||||
|
DceSetDrawable(PWINDOW_OBJECT WindowObject, HDC hDC, ULONG Flags,
|
||||||
|
BOOL SetClipOrigin)
|
||||||
|
{
|
||||||
|
DC *dc = DC_HandleToPtr(hDC);
|
||||||
|
if (WindowObject == NULL)
|
||||||
|
{
|
||||||
|
dc->w.DCOrgX = 0;
|
||||||
|
dc->w.DCOrgY = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (Flags & DCX_WINDOW)
|
||||||
|
{
|
||||||
|
dc->w.DCOrgX = WindowObject->WindowRect.left;
|
||||||
|
dc->w.DCOrgY = WindowObject->WindowRect.top;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dc->w.DCOrgX = WindowObject->ClientRect.left;
|
||||||
|
dc->w.DCOrgY = WindowObject->ClientRect.top;
|
||||||
|
}
|
||||||
|
/* FIXME: Offset by parent's client rectangle. */
|
||||||
|
}
|
||||||
|
DC_ReleasePtr(hDC);
|
||||||
|
}
|
||||||
|
|
||||||
HDC STDCALL
|
HDC STDCALL
|
||||||
NtUserGetDCEx(HWND hWnd, HANDLE hRegion, ULONG Flags)
|
NtUserGetDCEx(HWND hWnd, HANDLE hRegion, ULONG Flags)
|
||||||
{
|
{
|
||||||
HDC hdc = 0;
|
|
||||||
HDCE hdce;
|
|
||||||
PDCE dce;
|
|
||||||
DWORD dcxFlags = 0;
|
|
||||||
BOOL bUpdateVisRgn = TRUE;
|
|
||||||
BOOL bUpdateClipOrigin = FALSE;
|
|
||||||
HWND parent, full;
|
|
||||||
PWINDOW_OBJECT Window;
|
PWINDOW_OBJECT Window;
|
||||||
|
ULONG DcxFlags;
|
||||||
|
DCE* Dce;
|
||||||
|
BOOL UpdateVisRgn = TRUE;
|
||||||
|
BOOL UpdateClipOrigin = FALSE;
|
||||||
|
HANDLE hRgnVisible = NULL;
|
||||||
|
|
||||||
DPRINT("hWnd %04x, hRegion %04x, Flags %08x\n", hWnd, hRegion, (unsigned)Flags);
|
if ((Window = W32kGetWindowObject(hWnd)) == NULL)
|
||||||
|
{
|
||||||
|
return(0);
|
||||||
|
}
|
||||||
|
|
||||||
if (!hWnd) hWnd = W32kGetDesktopWindow();
|
if (Window->Dce == NULL)
|
||||||
if (!(Window = W32kGetWindowObject(hWnd))) return 0;
|
{
|
||||||
|
Flags |= DCX_CACHE;
|
||||||
// fixup flags
|
}
|
||||||
|
|
||||||
if (Flags & (DCX_WINDOW | DCX_PARENTCLIP)) Flags |= DCX_CACHE;
|
|
||||||
|
|
||||||
if (Flags & DCX_USESTYLE)
|
if (Flags & DCX_USESTYLE)
|
||||||
{
|
{
|
||||||
Flags &= ~(DCX_CLIPCHILDREN | DCX_CLIPSIBLINGS | DCX_PARENTCLIP);
|
Flags &= ~(DCX_CLIPCHILDREN | DCX_CLIPSIBLINGS | DCX_PARENTCLIP);
|
||||||
|
|
||||||
if (Window->Style & WS_CLIPSIBLINGS)
|
if (Window->Style & WS_CLIPSIBLINGS)
|
||||||
|
{
|
||||||
Flags |= DCX_CLIPSIBLINGS;
|
Flags |= DCX_CLIPSIBLINGS;
|
||||||
|
}
|
||||||
|
|
||||||
if (!(Flags & DCX_WINDOW))
|
if (!(Flags & DCX_WINDOW))
|
||||||
{
|
{
|
||||||
if (Window->ExStyle & CS_PARENTDC) Flags |= DCX_PARENTCLIP;
|
if (Window->Class->Class.style & CS_PARENTDC)
|
||||||
|
{
|
||||||
|
Flags |= DCX_PARENTCLIP;
|
||||||
|
}
|
||||||
|
|
||||||
if (Window->Style & WS_CLIPCHILDREN &&
|
if (Window->Style & WS_CLIPCHILDREN &&
|
||||||
!(Window->Style & WS_MINIMIZE)) Flags |= DCX_CLIPCHILDREN;
|
!(Window->Style & WS_MINIMIZE))
|
||||||
if (!Window->dce) Flags |= DCX_CACHE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Flags & DCX_WINDOW) Flags &= ~DCX_CLIPCHILDREN;
|
|
||||||
|
|
||||||
parent = W32kGetParentWindow(hWnd);
|
|
||||||
if (!parent || (parent == W32kGetDesktopWindow()))
|
|
||||||
Flags = (Flags & ~DCX_PARENTCLIP) | DCX_CLIPSIBLINGS;
|
|
||||||
|
|
||||||
// it seems parent clip is ignored when clipping siblings or children
|
|
||||||
if (Flags & (DCX_CLIPSIBLINGS | DCX_CLIPCHILDREN)) Flags &= ~DCX_PARENTCLIP;
|
|
||||||
|
|
||||||
if(Flags & DCX_PARENTCLIP)
|
|
||||||
{
|
{
|
||||||
LONG parent_style = NtUserGetWindowLong(parent, GWL_STYLE);
|
Flags |= DCX_CLIPCHILDREN;
|
||||||
if((Window->Style & WS_VISIBLE) && (parent_style & WS_VISIBLE))
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Flags |= DCX_CACHE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Flags & DCX_NOCLIPCHILDREN)
|
||||||
|
{
|
||||||
|
Flags |= DCX_CACHE;
|
||||||
|
Flags |= ~(DCX_PARENTCLIP | DCX_CLIPCHILDREN);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Flags & DCX_WINDOW)
|
||||||
|
{
|
||||||
|
Flags = (Flags & ~DCX_CLIPCHILDREN) | DCX_CACHE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(Window->Style & WS_CHILD) || Window->Parent == NULL)
|
||||||
|
{
|
||||||
|
Flags &= ~DCX_PARENTCLIP;
|
||||||
|
}
|
||||||
|
else if (Flags & DCX_PARENTCLIP)
|
||||||
|
{
|
||||||
|
Flags |= DCX_CACHE;
|
||||||
|
if (!(Flags & (DCX_CLIPCHILDREN | DCX_CLIPSIBLINGS)))
|
||||||
|
{
|
||||||
|
if ((Window->Style & WS_VISIBLE) &&
|
||||||
|
(Window->Parent->Style & WS_VISIBLE))
|
||||||
{
|
{
|
||||||
Flags &= ~DCX_CLIPCHILDREN;
|
Flags &= ~DCX_CLIPCHILDREN;
|
||||||
if (parent_style & WS_CLIPSIBLINGS) Flags |= DCX_CLIPSIBLINGS;
|
if (Window->Parent->Style & WS_CLIPSIBLINGS)
|
||||||
|
{
|
||||||
|
Flags |= DCX_CLIPSIBLINGS;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// find a suitable DCE
|
DcxFlags = Flags & DCX_CACHECOMPAREMASK;
|
||||||
|
|
||||||
dcxFlags = Flags & (DCX_PARENTCLIP | DCX_CLIPSIBLINGS | DCX_CLIPCHILDREN |
|
|
||||||
DCX_CACHE | DCX_WINDOW);
|
|
||||||
|
|
||||||
if (Flags & DCX_CACHE)
|
if (Flags & DCX_CACHE)
|
||||||
{
|
{
|
||||||
PDCE dceEmpty;
|
DCE* DceEmpty = NULL;
|
||||||
PDCE dceUnused;
|
DCE* DceUnused = NULL;
|
||||||
|
|
||||||
dceEmpty = dceUnused = NULL;
|
for (Dce = FirstDce; Dce != NULL; Dce = Dce->next)
|
||||||
|
|
||||||
/* Strategy: First, we attempt to find a non-empty but unused DCE with
|
|
||||||
* compatible flags. Next, we look for an empty entry. If the cache is
|
|
||||||
* full we have to purge one of the unused entries.
|
|
||||||
*/
|
|
||||||
|
|
||||||
for (dce = firstDCE; (dce); dce = dce->next)
|
|
||||||
{
|
{
|
||||||
if ((dce->DCXflags & (DCX_CACHE | DCX_DCEBUSY)) == DCX_CACHE)
|
if ((Dce->DCXFlags & (DCX_CACHE | DCX_DCEBUSY)) == DCX_CACHE)
|
||||||
{
|
{
|
||||||
dceUnused = dce;
|
DceUnused = Dce;
|
||||||
|
if (Dce->DCXFlags & DCX_DCEEMPTY)
|
||||||
if (dce->DCXflags & DCX_DCEEMPTY)
|
|
||||||
dceEmpty = dce;
|
|
||||||
else
|
|
||||||
if ((dce->hwndCurrent == hWnd) &&
|
|
||||||
((dce->DCXflags & (DCX_CLIPSIBLINGS | DCX_CLIPCHILDREN |
|
|
||||||
DCX_CACHE | DCX_WINDOW | DCX_PARENTCLIP)) == dcxFlags))
|
|
||||||
{
|
{
|
||||||
DPRINT("Found valid %08x dce [%04x], flags %08x\n",
|
DceEmpty = Dce;
|
||||||
(unsigned)dce, hWnd, (unsigned)dcxFlags);
|
}
|
||||||
bUpdateVisRgn = FALSE;
|
else if (Dce->hwndCurrent == hWnd &&
|
||||||
bUpdateClipOrigin = TRUE;
|
((Dce->DCXFlags & DCX_CACHECOMPAREMASK) == DcxFlags))
|
||||||
|
{
|
||||||
|
UpdateVisRgn = FALSE;
|
||||||
|
UpdateClipOrigin = TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!dce) dce = (dceEmpty) ? dceEmpty : dceUnused;
|
if (Dce == NULL)
|
||||||
|
|
||||||
// if there's no dce empty or unused, allocate a new one
|
|
||||||
if (!dce)
|
|
||||||
{
|
{
|
||||||
hdce = DCEOBJ_AllocDCE();
|
Dce = (DceEmpty == NULL) ? DceEmpty : DceUnused;
|
||||||
if (hdce == NULL)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
dce = DCEOBJ_LockDCE(hdce);
|
|
||||||
dce->type = DCE_CACHE_DC;
|
if (Dce == NULL)
|
||||||
dce->hDC = W32kCreateDC(L"DISPLAY", NULL, NULL, NULL);
|
{
|
||||||
|
Dce = DceAllocDCE(NULL, DCE_CACHE_DC);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dce = Window->dce;
|
Dce = Window->Dce;
|
||||||
if (dce && dce->hwndCurrent == hWnd)
|
/* FIXME: Implement this. */
|
||||||
|
DbgBreakPoint();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Dce == NULL)
|
||||||
{
|
{
|
||||||
DPRINT("skipping hVisRgn update\n");
|
W32kReleaseWindowObject(Window);
|
||||||
bUpdateVisRgn = FALSE; // updated automatically, via DCHook()
|
return(NULL);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (!dce)
|
Dce->hwndCurrent = hWnd;
|
||||||
|
Dce->hClipRgn = NULL;
|
||||||
|
Dce->DCXFlags = DcxFlags | (Flags & DCX_WINDOWPAINT) | DCX_DCEBUSY;
|
||||||
|
|
||||||
|
DceSetDrawable(Window, Dce->hDC, Flags, UpdateClipOrigin);
|
||||||
|
|
||||||
|
if (UpdateVisRgn)
|
||||||
{
|
{
|
||||||
hdc = 0;
|
if (Flags & DCX_PARENTCLIP)
|
||||||
goto END;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(Flags & (DCX_INTERSECTRGN | DCX_EXCLUDERGN))) hRegion = 0;
|
|
||||||
|
|
||||||
if (((Flags ^ dce->DCXflags) & (DCX_INTERSECTRGN | DCX_EXCLUDERGN)) &&
|
|
||||||
(dce->hClipRgn != hRegion))
|
|
||||||
{
|
{
|
||||||
// if the extra clip region has changed, get rid of the old one
|
PWINDOW_OBJECT Parent;
|
||||||
/* DCE_DeleteClipRgn(dce); */
|
|
||||||
|
Parent = Window->Parent;
|
||||||
|
|
||||||
|
if (Window->Style & WS_VISIBLE &&
|
||||||
|
!(Parent->Style & WS_MINIMIZE))
|
||||||
|
{
|
||||||
|
if (Parent->Style & WS_CLIPSIBLINGS)
|
||||||
|
{
|
||||||
|
DcxFlags = DCX_CLIPSIBLINGS |
|
||||||
|
(Flags & ~(DCX_CLIPCHILDREN | DCX_WINDOW));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DcxFlags = Flags &
|
||||||
|
~(DCX_CLIPSIBLINGS | DCX_CLIPCHILDREN | DCX_WINDOW);
|
||||||
|
}
|
||||||
|
hRgnVisible = DceGetVisRgn(Parent->Self, DcxFlags,
|
||||||
|
Window->Self, Flags);
|
||||||
|
if (Flags & DCX_WINDOW)
|
||||||
|
{
|
||||||
|
W32kOffsetRgn(hRgnVisible, -Window->WindowRect.left,
|
||||||
|
-Window->WindowRect.top);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
W32kOffsetRgn(hRgnVisible, -Window->ClientRect.left,
|
||||||
|
-Window->ClientRect.top);
|
||||||
|
}
|
||||||
|
DceOffsetVisRgn(Dce->hDC, hRgnVisible);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
hRgnVisible = W32kCreateRectRgn(0, 0, 0, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (hWnd == W32kGetDesktopWindow())
|
||||||
|
{
|
||||||
|
hRgnVisible =
|
||||||
|
W32kCreateRectRgn(0, 0,
|
||||||
|
NtUserGetSystemMetrics(SM_CXSCREEN),
|
||||||
|
NtUserGetSystemMetrics(SM_CYSCREEN));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
hRgnVisible = DceGetVisRgn(hWnd, Flags, 0, 0);
|
||||||
|
DceOffsetVisRgn(Dce->hDC, hRgnVisible);
|
||||||
}
|
}
|
||||||
|
|
||||||
dce->hwndCurrent = hWnd;
|
Dce->DCXFlags &= ~DCX_DCEDIRTY;
|
||||||
dce->hClipRgn = hRegion;
|
W32kSelectVisRgn(Dce->hDC, hRgnVisible);
|
||||||
dce->DCXflags = Flags & (DCX_PARENTCLIP | DCX_CLIPSIBLINGS | DCX_CLIPCHILDREN |
|
}
|
||||||
DCX_CACHE | DCX_WINDOW | DCX_WINDOWPAINT |
|
}
|
||||||
DCX_KEEPCLIPRGN | DCX_INTERSECTRGN | DCX_EXCLUDERGN);
|
|
||||||
dce->DCXflags |= DCX_DCEBUSY;
|
|
||||||
dce->DCXflags &= ~DCX_DCEDIRTY;
|
|
||||||
hdc = dce->hDC;
|
|
||||||
|
|
||||||
/* if (bUpdateVisRgn) SetHookFlags(hdc, DCHF_INVALIDATEVISRGN); // force update */
|
if (Flags & (DCX_EXCLUDERGN | DCX_INTERSECTRGN))
|
||||||
|
{
|
||||||
|
DPRINT1("FIXME.\n");
|
||||||
|
}
|
||||||
|
|
||||||
/* if (!USER_Driver.pGetDC(hWnd, hdc, hRegion, Flags)) hdc = 0; */
|
if (hRgnVisible != NULL)
|
||||||
|
{
|
||||||
DPRINT("(%04x,%04x,0x%lx): returning %04x\n", hWnd, hRegion, Flags, hdc);
|
W32kDeleteObject(hRgnVisible);
|
||||||
|
}
|
||||||
END:
|
W32kReleaseWindowObject(Window);
|
||||||
/* WIN_ReleasePtr(Window); */
|
return(Dce->hDC);
|
||||||
return hdc;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: window.c,v 1.13 2002/08/31 23:18:47 dwelch Exp $
|
/* $Id: window.c,v 1.14 2002/09/01 20:39:56 dwelch Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -158,9 +158,10 @@ W32kReleaseWindowObject(PWINDOW_OBJECT Window)
|
||||||
VOID
|
VOID
|
||||||
W32kGetClientRect(PWINDOW_OBJECT WindowObject, PRECT Rect)
|
W32kGetClientRect(PWINDOW_OBJECT WindowObject, PRECT Rect)
|
||||||
{
|
{
|
||||||
Rect->left = Rect->bottom = 0;
|
Rect->left = Rect->top = 0;
|
||||||
Rect->right = WindowObject->ClientRect.right - WindowObject->ClientRect.left;
|
Rect->right = WindowObject->ClientRect.right - WindowObject->ClientRect.left;
|
||||||
Rect->top = WindowObject->ClientRect.bottom - WindowObject->ClientRect.top;
|
Rect->bottom =
|
||||||
|
WindowObject->ClientRect.bottom - WindowObject->ClientRect.top;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL STDCALL
|
BOOL STDCALL
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: brush.c,v 1.14 2002/07/13 21:37:26 ei Exp $
|
/* $Id: brush.c,v 1.15 2002/09/01 20:39:56 dwelch Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@
|
||||||
#include <win32k/bitmaps.h>
|
#include <win32k/bitmaps.h>
|
||||||
#include <win32k/brush.h>
|
#include <win32k/brush.h>
|
||||||
//#include <win32k/debug.h>
|
//#include <win32k/debug.h>
|
||||||
|
#include <include/object.h>
|
||||||
|
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include <win32k/debug1.h>
|
#include <win32k/debug1.h>
|
||||||
|
@ -183,7 +184,57 @@ BOOL STDCALL W32kPatBlt(HDC hDC,
|
||||||
INT Height,
|
INT Height,
|
||||||
DWORD ROP)
|
DWORD ROP)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED;
|
RECT DestRect;
|
||||||
|
PBRUSHOBJ BrushObj;
|
||||||
|
PSURFOBJ SurfObj;
|
||||||
|
DC *dc = DC_HandleToPtr(hDC);
|
||||||
|
BOOL ret;
|
||||||
|
|
||||||
|
if (dc == NULL)
|
||||||
|
{
|
||||||
|
return(FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
SurfObj = (SURFOBJ*)AccessUserObject((ULONG)dc->Surface);
|
||||||
|
|
||||||
|
BrushObj = (BRUSHOBJ*) GDIOBJ_LockObj(dc->w.hBrush, GO_BRUSH_MAGIC);
|
||||||
|
assert(BrushObj);
|
||||||
|
if (BrushObj->logbrush.lbStyle != BS_NULL)
|
||||||
|
{
|
||||||
|
if (Width > 0)
|
||||||
|
{
|
||||||
|
DestRect.left = XLeft + dc->w.DCOrgX;
|
||||||
|
DestRect.right = XLeft + Width + dc->w.DCOrgX;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DestRect.left = XLeft + Width + dc->w.DCOrgX;
|
||||||
|
DestRect.right = XLeft + dc->w.DCOrgX;
|
||||||
|
}
|
||||||
|
if (Height > 0)
|
||||||
|
{
|
||||||
|
DestRect.top = YLeft + dc->w.DCOrgY;
|
||||||
|
DestRect.bottom = YLeft + Height + dc->w.DCOrgY;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DestRect.top = YLeft + Height + dc->w.DCOrgY;
|
||||||
|
DestRect.bottom = YLeft + dc->w.DCOrgY;
|
||||||
|
}
|
||||||
|
ret = EngBitBlt(SurfObj,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
&DestRect,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
BrushObj,
|
||||||
|
NULL,
|
||||||
|
PATCOPY);
|
||||||
|
}
|
||||||
|
GDIOBJ_UnlockObj( dc->w.hBrush, GO_PEN_MAGIC );
|
||||||
|
return(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL STDCALL W32kSetBrushOrgEx(HDC hDC,
|
BOOL STDCALL W32kSetBrushOrgEx(HDC hDC,
|
||||||
|
|
|
@ -11,6 +11,25 @@
|
||||||
// #define NDEBUG
|
// #define NDEBUG
|
||||||
#include <win32k/debug1.h>
|
#include <win32k/debug1.h>
|
||||||
|
|
||||||
|
VOID
|
||||||
|
CLIPPING_UpdateGCRegion(DC* Dc)
|
||||||
|
{
|
||||||
|
if (Dc->w.hGCClipRgn == NULL)
|
||||||
|
{
|
||||||
|
Dc->w.hGCClipRgn = W32kCreateRectRgn(0, 0, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Dc->w.hClipRgn == NULL)
|
||||||
|
{
|
||||||
|
W32kCombineRgn(Dc->w.hGCClipRgn, Dc->w.hVisRgn, 0, RGN_COPY);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
W32kCombineRgn(Dc->w.hGCClipRgn, Dc->w.hClipRgn, Dc->w.hVisRgn,
|
||||||
|
RGN_AND);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
HRGN WINAPI SaveVisRgn(HDC hdc)
|
HRGN WINAPI SaveVisRgn(HDC hdc)
|
||||||
{
|
{
|
||||||
HRGN copy;
|
HRGN copy;
|
||||||
|
@ -35,7 +54,8 @@ HRGN WINAPI SaveVisRgn(HDC hdc)
|
||||||
return copy;
|
return copy;
|
||||||
}
|
}
|
||||||
|
|
||||||
INT WINAPI SelectVisRgn(HDC hdc, HRGN hrgn)
|
INT WINAPI
|
||||||
|
W32kSelectVisRgn(HDC hdc, HRGN hrgn)
|
||||||
{
|
{
|
||||||
int retval;
|
int retval;
|
||||||
DC *dc;
|
DC *dc;
|
||||||
|
@ -46,7 +66,7 @@ INT WINAPI SelectVisRgn(HDC hdc, HRGN hrgn)
|
||||||
dc->w.flags &= ~DC_DIRTY;
|
dc->w.flags &= ~DC_DIRTY;
|
||||||
|
|
||||||
retval = W32kCombineRgn(dc->w.hVisRgn, hrgn, 0, RGN_COPY);
|
retval = W32kCombineRgn(dc->w.hVisRgn, hrgn, 0, RGN_COPY);
|
||||||
//ei CLIPPING_UpdateGCRegion(dc);
|
CLIPPING_UpdateGCRegion(dc);
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
@ -74,7 +94,7 @@ int STDCALL W32kGetClipBox(HDC hDC,
|
||||||
DC *dc;
|
DC *dc;
|
||||||
|
|
||||||
if (!(dc = DC_HandleToPtr(hDC))) return ERROR;
|
if (!(dc = DC_HandleToPtr(hDC))) return ERROR;
|
||||||
retval = W32kGetRgnBox(dc->w.hGCClipRgn, rc);
|
retval = UnsafeW32kGetRgnBox(dc->w.hGCClipRgn, rc);
|
||||||
rc->left -= dc->w.DCOrgX;
|
rc->left -= dc->w.DCOrgX;
|
||||||
rc->right -= dc->w.DCOrgX;
|
rc->right -= dc->w.DCOrgX;
|
||||||
rc->top -= dc->w.DCOrgY;
|
rc->top -= dc->w.DCOrgY;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: dc.c,v 1.35 2002/08/19 21:49:45 ei Exp $
|
/* $Id: dc.c,v 1.36 2002/09/01 20:39:56 dwelch Exp $
|
||||||
*
|
*
|
||||||
* DC.C - Device context functions
|
* DC.C - Device context functions
|
||||||
*
|
*
|
||||||
|
@ -307,7 +307,8 @@ HDC STDCALL W32kCreateDC(LPCWSTR Driver,
|
||||||
/* Initialize the DC state */
|
/* Initialize the DC state */
|
||||||
DC_InitDC(hNewDC);
|
DC_InitDC(hNewDC);
|
||||||
|
|
||||||
W32kSetTextColor(hNewDC, RGB(0xff, 0xff, 0xff));
|
NewDC->w.hVisRgn = W32kCreateRectRgn(0, 0, 640, 480);
|
||||||
|
W32kSetTextColor(hNewDC, RGB(0, 0, 0));
|
||||||
W32kSetTextAlign(hNewDC, TA_BASELINE);
|
W32kSetTextAlign(hNewDC, TA_BASELINE);
|
||||||
DC_ReleasePtr( hNewDC );
|
DC_ReleasePtr( hNewDC );
|
||||||
return hNewDC;
|
return hNewDC;
|
||||||
|
@ -940,7 +941,8 @@ HGDIOBJ STDCALL W32kSelectObject(HDC hDC, HGDIOBJ hGDIObj)
|
||||||
if( PalGDI ){
|
if( PalGDI ){
|
||||||
XlateObj = (PXLATEOBJ)EngCreateXlate(PalGDI->Mode, PAL_RGB, dc->w.hPalette, NULL);
|
XlateObj = (PXLATEOBJ)EngCreateXlate(PalGDI->Mode, PAL_RGB, dc->w.hPalette, NULL);
|
||||||
brush = GDIOBJ_LockObj(dc->w.hBrush, GO_BRUSH_MAGIC);
|
brush = GDIOBJ_LockObj(dc->w.hBrush, GO_BRUSH_MAGIC);
|
||||||
brush->iSolidColor = XLATEOBJ_iXlate(XlateObj, brush->iSolidColor);
|
brush->iSolidColor = XLATEOBJ_iXlate(XlateObj,
|
||||||
|
brush->logbrush.lbColor);
|
||||||
GDIOBJ_UnlockObj( dc->w.hBrush, GO_BRUSH_MAGIC);
|
GDIOBJ_UnlockObj( dc->w.hBrush, GO_BRUSH_MAGIC);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -1150,6 +1152,16 @@ HDC DC_AllocDC(LPCWSTR Driver)
|
||||||
wcscpy(NewDC->DriverName, Driver);
|
wcscpy(NewDC->DriverName, Driver);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NewDC->w.xformWorld2Wnd.eM11 = 1.0f;
|
||||||
|
NewDC->w.xformWorld2Wnd.eM12 = 0.0f;
|
||||||
|
NewDC->w.xformWorld2Wnd.eM21 = 0.0f;
|
||||||
|
NewDC->w.xformWorld2Wnd.eM22 = 1.0f;
|
||||||
|
NewDC->w.xformWorld2Wnd.eDx = 0.0f;
|
||||||
|
NewDC->w.xformWorld2Wnd.eDy = 0.0f;
|
||||||
|
NewDC->w.xformWorld2Vport = NewDC->w.xformWorld2Wnd;
|
||||||
|
NewDC->w.xformVport2World = NewDC->w.xformWorld2Wnd;
|
||||||
|
NewDC->w.vport2WorldValid = TRUE;
|
||||||
|
|
||||||
GDIOBJ_UnlockObj( hDC, GO_DC_MAGIC );
|
GDIOBJ_UnlockObj( hDC, GO_DC_MAGIC );
|
||||||
return hDC;
|
return hDC;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
#include <win32k/fillshap.h>
|
#include <win32k/fillshap.h>
|
||||||
#include <win32k/dc.h>
|
#include <win32k/dc.h>
|
||||||
#include <win32k/pen.h>
|
#include <win32k/pen.h>
|
||||||
|
#include <include/object.h>
|
||||||
|
|
||||||
// #define NDEBUG
|
// #define NDEBUG
|
||||||
#include <win32k/debug1.h>
|
#include <win32k/debug1.h>
|
||||||
|
@ -78,11 +79,12 @@ W32kRectangle(HDC hDC,
|
||||||
int BottomRect)
|
int BottomRect)
|
||||||
{
|
{
|
||||||
DC *dc = DC_HandleToPtr(hDC);
|
DC *dc = DC_HandleToPtr(hDC);
|
||||||
SURFOBJ *SurfObj = (SURFOBJ*)AccessUserObject(dc->Surface);
|
SURFOBJ *SurfObj = (SURFOBJ*)AccessUserObject((ULONG)dc->Surface);
|
||||||
PBRUSHOBJ BrushObj;
|
PBRUSHOBJ BrushObj;
|
||||||
BOOL ret;
|
BOOL ret;
|
||||||
PRECTL RectBounds;
|
PRECTL RectBounds;
|
||||||
PENOBJ * pen;
|
PENOBJ * pen;
|
||||||
|
RECTL DestRect;
|
||||||
|
|
||||||
if(!dc)
|
if(!dc)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -99,6 +101,11 @@ W32kRectangle(HDC hDC,
|
||||||
BrushObj = (PBRUSHOBJ)PenToBrushObj(dc, pen);
|
BrushObj = (PBRUSHOBJ)PenToBrushObj(dc, pen);
|
||||||
GDIOBJ_UnlockObj( dc->w.hPen, GO_PEN_MAGIC );
|
GDIOBJ_UnlockObj( dc->w.hPen, GO_PEN_MAGIC );
|
||||||
|
|
||||||
|
LeftRect += dc->w.DCOrgX;
|
||||||
|
RightRect += dc->w.DCOrgX;
|
||||||
|
TopRect += dc->w.DCOrgY;
|
||||||
|
BottomRect += dc->w.DCOrgY;
|
||||||
|
|
||||||
ret = EngLineTo(SurfObj,
|
ret = EngLineTo(SurfObj,
|
||||||
NULL, // ClipObj,
|
NULL, // ClipObj,
|
||||||
BrushObj,
|
BrushObj,
|
||||||
|
@ -127,7 +134,27 @@ W32kRectangle(HDC hDC,
|
||||||
RectBounds, // Bounding rectangle
|
RectBounds, // Bounding rectangle
|
||||||
dc->w.ROPmode); // MIX */
|
dc->w.ROPmode); // MIX */
|
||||||
|
|
||||||
ExFreePool(BrushObj);
|
BrushObj = (BRUSHOBJ*) GDIOBJ_LockObj(dc->w.hBrush, GO_BRUSH_MAGIC);
|
||||||
|
assert(BrushObj);
|
||||||
|
if (BrushObj->logbrush.lbStyle != BS_NULL)
|
||||||
|
{
|
||||||
|
DestRect.left = LeftRect + 1;
|
||||||
|
DestRect.right = RightRect - 1;
|
||||||
|
DestRect.top = TopRect + 1;
|
||||||
|
DestRect.bottom = BottomRect - 1;
|
||||||
|
ret = EngBitBlt(SurfObj,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
&DestRect,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
BrushObj,
|
||||||
|
NULL,
|
||||||
|
PATCOPY);
|
||||||
|
}
|
||||||
|
GDIOBJ_UnlockObj( dc->w.hBrush, GO_PEN_MAGIC );
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: Move current position in DC?
|
// FIXME: Move current position in DC?
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* GDIOBJ.C - GDI object manipulation routines
|
* GDIOBJ.C - GDI object manipulation routines
|
||||||
*
|
*
|
||||||
* $Id: gdiobj.c,v 1.15 2002/08/04 18:21:59 ei Exp $
|
* $Id: gdiobj.c,v 1.16 2002/09/01 20:39:56 dwelch Exp $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -252,7 +252,8 @@ PGDIOBJ GDIOBJ_LockObj( HGDIOBJ hObj, WORD Magic )
|
||||||
|
|
||||||
DPRINT("GDIOBJ_LockObj: hObj: %d, magic: %x, \n handleEntry: %x, mag %x\n", hObj, Magic, handleEntry, handleEntry->wMagic);
|
DPRINT("GDIOBJ_LockObj: hObj: %d, magic: %x, \n handleEntry: %x, mag %x\n", hObj, Magic, handleEntry, handleEntry->wMagic);
|
||||||
if (handleEntry == 0 || (handleEntry->wMagic != Magic && handleEntry->wMagic != GO_MAGIC_DONTCARE )
|
if (handleEntry == 0 || (handleEntry->wMagic != Magic && handleEntry->wMagic != GO_MAGIC_DONTCARE )
|
||||||
|| handleEntry->hProcessId != PsGetCurrentProcessId () )
|
|| (handleEntry->hProcessId != (HANDLE)0xFFFFFFFF &&
|
||||||
|
handleEntry->hProcessId != PsGetCurrentProcessId ()))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
objectHeader = (PGDIOBJHDR) handleEntry->pObject;
|
objectHeader = (PGDIOBJHDR) handleEntry->pObject;
|
||||||
|
@ -273,7 +274,8 @@ BOOL GDIOBJ_UnlockObj( HGDIOBJ hObj, WORD Magic )
|
||||||
|
|
||||||
DPRINT("GDIOBJ_UnlockObj: hObj: %d, magic: %x, \n handleEntry: %x\n", hObj, Magic, handleEntry);
|
DPRINT("GDIOBJ_UnlockObj: hObj: %d, magic: %x, \n handleEntry: %x\n", hObj, Magic, handleEntry);
|
||||||
if (handleEntry == 0 || (handleEntry->wMagic != Magic && handleEntry->wMagic != GO_MAGIC_DONTCARE )
|
if (handleEntry == 0 || (handleEntry->wMagic != Magic && handleEntry->wMagic != GO_MAGIC_DONTCARE )
|
||||||
|| handleEntry->hProcessId != PsGetCurrentProcessId ())
|
|| (handleEntry->hProcessId != (HANDLE)0xFFFFFFFF &&
|
||||||
|
handleEntry->hProcessId != PsGetCurrentProcessId ()))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
objectHeader = (PGDIOBJHDR) handleEntry->pObject;
|
objectHeader = (PGDIOBJHDR) handleEntry->pObject;
|
||||||
|
@ -375,6 +377,20 @@ PGDIOBJ GDIOBJ_HandleToPtr (HGDIOBJ ObjectHandle, WORD Magic)
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
VOID GDIOBJ_MarkObjectGlobal(HGDIOBJ ObjectHandle)
|
||||||
|
{
|
||||||
|
PGDI_HANDLE_ENTRY handleEntry;
|
||||||
|
|
||||||
|
if (ObjectHandle == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
handleEntry = GDIOBJ_iGetHandleEntryForIndex ((WORD)ObjectHandle & 0xffff);
|
||||||
|
if (handleEntry == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
handleEntry->hProcessId = (HANDLE)0xFFFFFFFF;
|
||||||
|
}
|
||||||
|
|
||||||
WORD GDIOBJ_GetHandleMagic (HGDIOBJ ObjectHandle)
|
WORD GDIOBJ_GetHandleMagic (HGDIOBJ ObjectHandle)
|
||||||
{
|
{
|
||||||
PGDI_HANDLE_ENTRY handleEntry;
|
PGDI_HANDLE_ENTRY handleEntry;
|
||||||
|
@ -384,7 +400,8 @@ WORD GDIOBJ_GetHandleMagic (HGDIOBJ ObjectHandle)
|
||||||
|
|
||||||
handleEntry = GDIOBJ_iGetHandleEntryForIndex ((WORD)ObjectHandle & 0xffff);
|
handleEntry = GDIOBJ_iGetHandleEntryForIndex ((WORD)ObjectHandle & 0xffff);
|
||||||
if (handleEntry == 0 ||
|
if (handleEntry == 0 ||
|
||||||
handleEntry->hProcessId != PsGetCurrentProcessId ())
|
(handleEntry->hProcessId != (HANDLE)0xFFFFFFFF &&
|
||||||
|
handleEntry->hProcessId != PsGetCurrentProcessId ()))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return handleEntry->wMagic;
|
return handleEntry->wMagic;
|
||||||
|
@ -409,22 +426,38 @@ VOID CreateStockObjects(void)
|
||||||
// Create GDI Stock Objects from the logical structures we've defined
|
// Create GDI Stock Objects from the logical structures we've defined
|
||||||
|
|
||||||
StockObjects[WHITE_BRUSH] = W32kCreateBrushIndirect(&WhiteBrush);
|
StockObjects[WHITE_BRUSH] = W32kCreateBrushIndirect(&WhiteBrush);
|
||||||
|
GDIOBJ_MarkObjectGlobal(StockObjects[WHITE_BRUSH]);
|
||||||
StockObjects[LTGRAY_BRUSH] = W32kCreateBrushIndirect(&LtGrayBrush);
|
StockObjects[LTGRAY_BRUSH] = W32kCreateBrushIndirect(&LtGrayBrush);
|
||||||
|
GDIOBJ_MarkObjectGlobal(StockObjects[LTGRAY_BRUSH]);
|
||||||
StockObjects[GRAY_BRUSH] = W32kCreateBrushIndirect(&GrayBrush);
|
StockObjects[GRAY_BRUSH] = W32kCreateBrushIndirect(&GrayBrush);
|
||||||
|
GDIOBJ_MarkObjectGlobal(StockObjects[GRAY_BRUSH]);
|
||||||
StockObjects[DKGRAY_BRUSH] = W32kCreateBrushIndirect(&DkGrayBrush);
|
StockObjects[DKGRAY_BRUSH] = W32kCreateBrushIndirect(&DkGrayBrush);
|
||||||
|
GDIOBJ_MarkObjectGlobal(StockObjects[DKGRAY_BRUSH]);
|
||||||
StockObjects[BLACK_BRUSH] = W32kCreateBrushIndirect(&BlackBrush);
|
StockObjects[BLACK_BRUSH] = W32kCreateBrushIndirect(&BlackBrush);
|
||||||
|
GDIOBJ_MarkObjectGlobal(StockObjects[BLACK_BRUSH]);
|
||||||
StockObjects[NULL_BRUSH] = W32kCreateBrushIndirect(&NullBrush);
|
StockObjects[NULL_BRUSH] = W32kCreateBrushIndirect(&NullBrush);
|
||||||
|
GDIOBJ_MarkObjectGlobal(StockObjects[NULL_BRUSH]);
|
||||||
|
|
||||||
StockObjects[WHITE_PEN] = W32kCreatePenIndirect(&WhitePen);
|
StockObjects[WHITE_PEN] = W32kCreatePenIndirect(&WhitePen);
|
||||||
|
GDIOBJ_MarkObjectGlobal(StockObjects[WHITE_PEN]);
|
||||||
StockObjects[BLACK_PEN] = W32kCreatePenIndirect(&BlackPen);
|
StockObjects[BLACK_PEN] = W32kCreatePenIndirect(&BlackPen);
|
||||||
|
GDIOBJ_MarkObjectGlobal(StockObjects[BLACK_PEN]);
|
||||||
StockObjects[NULL_PEN] = W32kCreatePenIndirect(&NullPen);
|
StockObjects[NULL_PEN] = W32kCreatePenIndirect(&NullPen);
|
||||||
|
GDIOBJ_MarkObjectGlobal(StockObjects[NULL_PEN]);
|
||||||
|
|
||||||
StockObjects[OEM_FIXED_FONT] = W32kCreateFontIndirect(&OEMFixedFont);
|
StockObjects[OEM_FIXED_FONT] = W32kCreateFontIndirect(&OEMFixedFont);
|
||||||
|
GDIOBJ_MarkObjectGlobal(StockObjects[OEM_FIXED_FONT]);
|
||||||
StockObjects[ANSI_FIXED_FONT] = W32kCreateFontIndirect(&AnsiFixedFont);
|
StockObjects[ANSI_FIXED_FONT] = W32kCreateFontIndirect(&AnsiFixedFont);
|
||||||
|
GDIOBJ_MarkObjectGlobal(StockObjects[ANSI_FIXED_FONT]);
|
||||||
StockObjects[SYSTEM_FONT] = W32kCreateFontIndirect(&SystemFont);
|
StockObjects[SYSTEM_FONT] = W32kCreateFontIndirect(&SystemFont);
|
||||||
StockObjects[DEVICE_DEFAULT_FONT] = W32kCreateFontIndirect(&DeviceDefaultFont);
|
GDIOBJ_MarkObjectGlobal(StockObjects[SYSTEM_FONT]);
|
||||||
|
StockObjects[DEVICE_DEFAULT_FONT] =
|
||||||
|
W32kCreateFontIndirect(&DeviceDefaultFont);
|
||||||
|
GDIOBJ_MarkObjectGlobal(StockObjects[DEVICE_DEFAULT_FONT]);
|
||||||
StockObjects[SYSTEM_FIXED_FONT] = W32kCreateFontIndirect(&SystemFixedFont);
|
StockObjects[SYSTEM_FIXED_FONT] = W32kCreateFontIndirect(&SystemFixedFont);
|
||||||
|
GDIOBJ_MarkObjectGlobal(StockObjects[SYSTEM_FIXED_FONT]);
|
||||||
StockObjects[DEFAULT_GUI_FONT] = W32kCreateFontIndirect(&DefaultGuiFont);
|
StockObjects[DEFAULT_GUI_FONT] = W32kCreateFontIndirect(&DefaultGuiFont);
|
||||||
|
GDIOBJ_MarkObjectGlobal(StockObjects[DEFAULT_GUI_FONT]);
|
||||||
|
|
||||||
StockObjects[DEFAULT_PALETTE] = (HGDIOBJ*)PALETTE_Init();
|
StockObjects[DEFAULT_PALETTE] = (HGDIOBJ*)PALETTE_Init();
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,6 +88,6 @@ W32kIntersectRect(PRECT Dest, const RECT* Src1, const RECT* Src2)
|
||||||
Dest->left = max(Src1->left, Src2->left);
|
Dest->left = max(Src1->left, Src2->left);
|
||||||
Dest->right = min(Src1->right, Src2->right);
|
Dest->right = min(Src1->right, Src2->right);
|
||||||
Dest->top = max(Src1->top, Src2->top);
|
Dest->top = max(Src1->top, Src2->top);
|
||||||
Dest->bottom = min(Src1->right, Src2->right);
|
Dest->bottom = min(Src1->bottom, Src2->bottom);
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1682,16 +1682,34 @@ W32kFrameRgn(HDC hDC,
|
||||||
UNIMPLEMENTED;
|
UNIMPLEMENTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
INT STDCALL
|
||||||
|
UnsafeW32kGetRgnBox(HRGN hRgn,
|
||||||
|
LPRECT pRect)
|
||||||
|
{
|
||||||
|
PROSRGNDATA rgn = RGNDATA_LockRgn(hRgn);
|
||||||
|
DWORD ret;
|
||||||
|
|
||||||
INT
|
if (rgn)
|
||||||
STDCALL
|
{
|
||||||
|
*pRect = rgn->rdh.rcBound;
|
||||||
|
ret = rgn->rdh.iType;
|
||||||
|
RGNDATA_UnlockRgn( hRgn );
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
return 0; //if invalid region return zero
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
INT STDCALL
|
||||||
W32kGetRgnBox(HRGN hRgn,
|
W32kGetRgnBox(HRGN hRgn,
|
||||||
LPRECT pRect)
|
LPRECT pRect)
|
||||||
{
|
{
|
||||||
PROSRGNDATA rgn = RGNDATA_LockRgn(hRgn);
|
PROSRGNDATA rgn = RGNDATA_LockRgn(hRgn);
|
||||||
DWORD ret;
|
DWORD ret;
|
||||||
|
|
||||||
if( rgn ){
|
if (rgn)
|
||||||
|
{
|
||||||
RECT SafeRect;
|
RECT SafeRect;
|
||||||
SafeRect.left = rgn->rdh.rcBound.left;
|
SafeRect.left = rgn->rdh.rcBound.left;
|
||||||
SafeRect.top = rgn->rdh.rcBound.top;
|
SafeRect.top = rgn->rdh.rcBound.top;
|
||||||
|
|
|
@ -580,7 +580,7 @@ W32kTextOut(HDC hDC,
|
||||||
int error, glyph_index, n, load_flags = FT_LOAD_RENDER, i, j, sx, sy, scc;
|
int error, glyph_index, n, load_flags = FT_LOAD_RENDER, i, j, sx, sy, scc;
|
||||||
FT_Face face;
|
FT_Face face;
|
||||||
FT_GlyphSlot glyph;
|
FT_GlyphSlot glyph;
|
||||||
ULONG TextLeft = XStart, TextTop = YStart, SpaceBetweenChars = 2, pitch, previous;
|
ULONG TextLeft, TextTop, SpaceBetweenChars = 2, pitch, previous;
|
||||||
FT_Bool use_kerning;
|
FT_Bool use_kerning;
|
||||||
RECTL DestRect, MaskRect;
|
RECTL DestRect, MaskRect;
|
||||||
POINTL SourcePoint, BrushOrigin;
|
POINTL SourcePoint, BrushOrigin;
|
||||||
|
@ -601,6 +601,11 @@ W32kTextOut(HDC hDC,
|
||||||
if( !dc )
|
if( !dc )
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
XStart += dc->w.DCOrgX;
|
||||||
|
YStart += dc->w.DCOrgY;
|
||||||
|
TextLeft = XStart;
|
||||||
|
TextTop = YStart;
|
||||||
|
|
||||||
TextObj = TEXTOBJ_LockText(dc->w.hFont);
|
TextObj = TEXTOBJ_LockText(dc->w.hFont);
|
||||||
|
|
||||||
for(i=0; i<FontsLoaded; i++)
|
for(i=0; i<FontsLoaded; i++)
|
||||||
|
|
Loading…
Reference in a new issue