wc.hInstance = hInstance;
wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
- wc.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
+ wc.hbrBackground = (HBRUSH)GetStockObject(GRAY_BRUSH);
wc.lpszMenuName = NULL;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
/*
* entry.c
*
- * $Revision: 1.19 $
- * $Author: jfilby $
- * $Date: 2002/08/19 22:01:11 $
+ * $Revision: 1.20 $
+ * $Author: dwelch $
+ * $Date: 2002/09/01 20:39:53 $
*
*/
#define DBG_PREFIX "VGADDI: "
+static BOOL VGAInitialized = FALSE;
DRVFN FuncList[] =
{
return FALSE;
}
- if (!InitVGA(ppdev, FALSE))
- {
- // Failed to initialize the VGA
- return FALSE;
- }
-
+ if (!VGAInitialized)
+ {
+ if (!InitVGA(ppdev, FALSE))
+ {
+ // Failed to initialize the VGA
+ return FALSE;
+ }
+ VGAInitialized = TRUE;
+ }
} else {
// Go back to last known mode
DPRINT( "ppdev: %x, KMDriver: %x", ppdev, ppdev->KMDriver );
// Failed to go back to mode
return FALSE;
}
-
+ VGAInitialized = FALSE;
}
}
DPRINT1("DrvEnableSurface() called\n");
// Initialize the VGA
- if (!InitVGA(ppdev, TRUE))
- {
- goto error_done;
- }
+ if (!VGAInitialized)
+ {
+ if (!InitVGA(ppdev, TRUE))
+ {
+ goto error_done;
+ }
+ VGAInitialized = TRUE;
+ }
CHECKPOINT1;
// dhsurf is of type DEVSURF, which is the drivers specialized surface type
}
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);
} else {
NtUserGetCaretBlinkTime 0
NtUserGetCaretPos 1
NtUserGetClassInfo 5
+NtUserGetClassLong 2
NtUserGetClassName 3
NtUserGetClipboardData 2
NtUserGetClipboardFormatName 3
#define DCX_EXCLUDEUPDATE (0x00000100L)
#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 */
#define DRIVERVERSION (0)
#define TECHNOLOGY (2)
NtUserGetCursorInfo(
DWORD Unknown0);
-DWORD
-STDCALL
+HDC STDCALL
NtUserGetDC(HWND hWnd);
HDC STDCALL NtUserGetDCEx(HWND hWnd, HANDLE hRegion, ULONG Flags);
HRGN REGION_CropRgn(HRGN hDst, HRGN hSrc, const PRECT lpRect, PPOINT lpPt);
HRGN STDCALL
UnsafeW32kCreateRectRgnIndirect(CONST PRECT rc);
+INT STDCALL
+UnsafeW32kGetRgnBox(HRGN hRgn,
+ LPRECT pRect);
#endif
-/* $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
*
-HGDIOBJ
-STDCALL
-GetStockObject(
- int a0
- )
-{
- SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
- return 0;
-}
}
-BOOL
-STDCALL
-PatBlt(
- HDC a0,
- int a1,
- int a2,
- int a3,
- int a4,
- DWORD a5
- )
-{
- SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
- return FALSE;
-}
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));
+}
#include <ddk/ntddk.h>
#include <win32k/kapi.h>
+HGDIOBJ STDCALL
+GetStockObject(int Index)
+{
+ return(W32kGetStockObject(Index));
+}
+
+
int STDCALL
GetClipBox(HDC hDc, LPRECT Rect)
{
-/* $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
* PROJECT: ReactOS user32.dll
return 0;
}
-HBRUSH
-STDCALL
-GetSysColorBrush(
- int nIndex)
-{
- return (HBRUSH)0;
-}
-
HMENU
STDCALL
GetSystemMenu(
-/* $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
* PROJECT: ReactOS user32.dll
return FALSE;
}
-DWORD
-STDCALL
-GetClassLongA(
- HWND hWnd,
- int nIndex)
+DWORD STDCALL
+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
-STDCALL
-GetClassLongW(
- HWND hWnd,
- int nIndex)
+DWORD STDCALL
+GetClassLongW(HWND hWnd, int nIndex)
{
- return 0;
+ return(NtUserGetClassLong(hWnd, nIndex));
}
int
-/* $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
* PROJECT: ReactOS user32.dll
return(CreatePen(PS_SOLID, 1, SysColours[nIndex]));
}
+HBRUSH STDCALL
+GetSysColorBrush(int nIndex)
+{
+ return(CreateSolidBrush(SysColours[nIndex]));
+}
+
LRESULT STDCALL
DefFrameProcA(HWND hWnd,
* along with this program; if not, write to the Free Software
* 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
* FILE: lib/user32/windows/input.c
#include <user32.h>
#include <debug.h>
+/* GLOBALS *******************************************************************/
+
+#define COLOR_MAX (28)
+
/* FUNCTIONS *****************************************************************/
WINBOOL
{
return FALSE;
}
-int
-STDCALL
-FillRect(
- HDC hDC,
- CONST RECT *lprc,
- HBRUSH hbr)
+
+int STDCALL
+FillRect(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
STDCALL
DrawAnimatedRects(
* along with this program; if not, write to the Free Software
* 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
* FILE: lib/user32/windows/input.c
/* FUNCTIONS *****************************************************************/
-WINBOOL
-STDCALL
-CopyRect(
- LPRECT lprcDst,
- CONST RECT *lprcSrc)
+WINBOOL STDCALL
+CopyRect(LPRECT lprcDst, CONST RECT *lprcSrc)
{
- return FALSE;
+ *lprcDst = *lprcSrc;
+ return(TRUE);
}
+
WINBOOL
STDCALL
EqualRect(
CONST RECT *lprc1,
CONST RECT *lprc2)
{
+ UNIMPLEMENTED;
return FALSE;
}
-WINBOOL
-STDCALL
-InflateRect(
- LPRECT lprc,
- int dx,
- int dy)
+
+WINBOOL STDCALL
+InflateRect(LPRECT rect, int dx, int dy)
{
- return FALSE;
+ rect->left -= dx;
+ rect->top -= dy;
+ rect->right -= dx;
+ rect->bottom -= dy;
+ return(TRUE);
}
WINBOOL
CONST RECT *lprcSrc1,
CONST RECT *lprcSrc2)
{
+ UNIMPLEMENTED;
return FALSE;
}
-WINBOOL
-STDCALL
-IsRectEmpty(
- CONST RECT *lprc)
+
+WINBOOL STDCALL
+IsRectEmpty(CONST RECT *lprc)
{
- return FALSE;
+ return((lprc->left >= lprc->right) || (lprc->top >= lprc->bottom));
}
-WINBOOL
-STDCALL
-OffsetRect(
- LPRECT lprc,
- int dx,
- int dy)
+
+WINBOOL STDCALL
+OffsetRect(LPRECT rect, int dx, int dy)
{
- return FALSE;
+ rect->left += dx;
+ rect->top += dy;
+ rect->right += dx;
+ rect->bottom += dy;
+ return(TRUE);
}
-WINBOOL
-STDCALL
-PtInRect(
- CONST RECT *lprc,
- POINT pt)
+
+WINBOOL STDCALL
+PtInRect(CONST RECT *lprc, POINT pt)
{
- return FALSE;
+ 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)
+
+WINBOOL STDCALL
+SetRect(LPRECT lprc, int xLeft, int yTop, int xRight, int yBottom)
{
- return FALSE;
+ lprc->left = xLeft;
+ lprc->top = yTop;
+ lprc->right = xRight;
+ lprc->bottom = yBottom;
+ return(TRUE);
}
-WINBOOL
-STDCALL
-SetRectEmpty(
- LPRECT lprc)
+BOOL STDCALL
+SetRectEmpty(LPRECT lprc)
{
- return FALSE;
+ lprc->left = lprc->right = lprc->top = lprc->bottom = 0;
+ return(TRUE);
}
-WINBOOL
-STDCALL
-SubtractRect(
- LPRECT lprcDst,
- CONST RECT *lprcSrc1,
- CONST RECT *lprcSrc2)
+
+WINBOOL STDCALL
+SubtractRect(LPRECT lprcDst, CONST RECT *lprcSrc1, CONST RECT *lprcSrc2)
{
+ UNIMPLEMENTED;
return FALSE;
}
-WINBOOL
-STDCALL
-UnionRect(
- LPRECT lprcDst,
- CONST RECT *lprcSrc1,
- CONST RECT *lprcSrc2)
+
+WINBOOL STDCALL
+UnionRect(LPRECT lprcDst, CONST RECT *lprcSrc1, CONST RECT *lprcSrc2)
{
- return FALSE;
+ if (IsRectEmpty(lprcSrc1))
+ {
+ 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);
}
if(Source != NULL) SourceGDI = (PSURFGDI)AccessInternalObjectFromUserObject(Source);
if(Dest != NULL) DestGDI = (PSURFGDI)AccessInternalObjectFromUserObject(Dest);
- MouseSafetyOnDrawStart(Source, SourceGDI, SourcePoint->x, SourcePoint->y,
- (SourcePoint->x + abs(DestRect->right - DestRect->left)),
- (SourcePoint->y + abs(DestRect->bottom - DestRect->top)));
+ if (Source != NULL)
+ {
+ MouseSafetyOnDrawStart(Source, SourceGDI, SourcePoint->x, SourcePoint->y,
+ (SourcePoint->x + abs(DestRect->right - DestRect->left)),
+ (SourcePoint->y + abs(DestRect->bottom - DestRect->top)));
+ }
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
HWND hwndDC;
HRGN hClipRgn;
DCE_TYPE type;
- DWORD DCXflags;
+ DWORD DCXFlags;
} DCE, *PDCE;
/* Pointer to the parent window. */
struct _WINDOW_OBJECT* Parent;
/* DC Entries (DCE) */
- PDCE dce;
+ PDCE Dce;
} WINDOW_OBJECT, *PWINDOW_OBJECT;
/* Window flags. */
-/* $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
* PROJECT: ReactOS kernel
#include <include/winsta.h>
#include <include/object.h>
#include <include/guicheck.h>
+#include <include/window.h>
//#define NDEBUG
#include <debug.h>
DWORD STDCALL
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
-/* $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
* PROJECT: ReactOS kernel
return(17);
case SM_CYHSCROLL:
return(17);
+ case SM_CYCAPTION:
+ return(20);
default:
return(0xFFFFFFFF);
}
-/* $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
* PROJECT: ReactOS kernel
#define NDEBUG
#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 *****************************************************************/
-VOID DCE_FreeWindowDCE(HWND);
-INT DCE_ExcludeRgn(HDC, HWND, HRGN);
-BOOL DCE_InvalidateDCE(HWND, const PRECTL);
+VOID STATIC
+DceOffsetVisRgn(HDC hDC, HRGN hVisRgn)
+{
+ DC *dc = DC_HandleToPtr(hDC);
+ if (dc == NULL)
+ {
+ return;
+ }
+ W32kOffsetRgn(hVisRgn, dc->w.DCOrgX, dc->w.DCOrgY);
+ DC_ReleasePtr(hDC);
+}
BOOL STATIC
DceGetVisRect(PWINDOW_OBJECT Window, BOOL ClientArea, RECT* 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);
INT XOffset, YOffset;
}
-DWORD
-STDCALL
+HDC STDCALL
NtUserGetDC(HWND hWnd)
{
if (!hWnd)
return NtUserGetDCEx(hWnd, 0, DCX_USESTYLE);
}
-HDC STDCALL
-NtUserGetDCEx(HWND hWnd, HANDLE hRegion, ULONG Flags)
+DCE* DceAllocDCE(HWND hWnd, DCE_TYPE Type)
{
- HDC hdc = 0;
- HDCE hdce;
- PDCE dce;
- DWORD dcxFlags = 0;
- BOOL bUpdateVisRgn = TRUE;
- BOOL bUpdateClipOrigin = FALSE;
- HWND parent, full;
- PWINDOW_OBJECT Window;
+ 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;
- DPRINT("hWnd %04x, hRegion %04x, Flags %08x\n", hWnd, hRegion, (unsigned)Flags);
+ 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;
+ }
- if (!hWnd) hWnd = W32kGetDesktopWindow();
- if (!(Window = W32kGetWindowObject(hWnd))) return 0;
+ return(Dce);
+}
- // fixup flags
+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
+NtUserGetDCEx(HWND hWnd, HANDLE hRegion, ULONG Flags)
+{
+ PWINDOW_OBJECT Window;
+ ULONG DcxFlags;
+ DCE* Dce;
+ BOOL UpdateVisRgn = TRUE;
+ BOOL UpdateClipOrigin = FALSE;
+ HANDLE hRgnVisible = NULL;
- if (Flags & (DCX_WINDOW | DCX_PARENTCLIP)) Flags |= DCX_CACHE;
+ if ((Window = W32kGetWindowObject(hWnd)) == NULL)
+ {
+ return(0);
+ }
- if (Flags & DCX_USESTYLE)
+ if (Window->Dce == NULL)
{
- Flags &= ~(DCX_CLIPCHILDREN | DCX_CLIPSIBLINGS | DCX_PARENTCLIP);
+ Flags |= DCX_CACHE;
+ }
- if(Window->Style & WS_CLIPSIBLINGS)
- Flags |= DCX_CLIPSIBLINGS;
+ if (Flags & DCX_USESTYLE)
+ {
+ Flags &= ~(DCX_CLIPCHILDREN | DCX_CLIPSIBLINGS | DCX_PARENTCLIP);
- if (!(Flags & DCX_WINDOW))
+ if (Window->Style & WS_CLIPSIBLINGS)
{
- if (Window->ExStyle & CS_PARENTDC) Flags |= DCX_PARENTCLIP;
-
- if (Window->Style & WS_CLIPCHILDREN &&
- !(Window->Style & WS_MINIMIZE)) Flags |= DCX_CLIPCHILDREN;
- if (!Window->dce) Flags |= DCX_CACHE;
+ Flags |= DCX_CLIPSIBLINGS;
}
- }
-
- if (Flags & DCX_WINDOW) Flags &= ~DCX_CLIPCHILDREN;
- parent = W32kGetParentWindow(hWnd);
- if (!parent || (parent == W32kGetDesktopWindow()))
- Flags = (Flags & ~DCX_PARENTCLIP) | DCX_CLIPSIBLINGS;
+ if (!(Flags & DCX_WINDOW))
+ {
+ if (Window->Class->Class.style & CS_PARENTDC)
+ {
+ Flags |= DCX_PARENTCLIP;
+ }
- // it seems parent clip is ignored when clipping siblings or children
- if (Flags & (DCX_CLIPSIBLINGS | DCX_CLIPCHILDREN)) Flags &= ~DCX_PARENTCLIP;
+ if (Window->Style & WS_CLIPCHILDREN &&
+ !(Window->Style & WS_MINIMIZE))
+ {
+ Flags |= DCX_CLIPCHILDREN;
+ }
+ }
+ else
+ {
+ Flags |= DCX_CACHE;
+ }
+ }
- if(Flags & DCX_PARENTCLIP)
+ if (Flags & DCX_NOCLIPCHILDREN)
{
- LONG parent_style = NtUserGetWindowLong(parent, GWL_STYLE);
- if((Window->Style & WS_VISIBLE) && (parent_style & WS_VISIBLE))
- {
- Flags &= ~DCX_CLIPCHILDREN;
- if (parent_style & WS_CLIPSIBLINGS) Flags |= DCX_CLIPSIBLINGS;
- }
+ Flags |= DCX_CACHE;
+ Flags |= ~(DCX_PARENTCLIP | DCX_CLIPCHILDREN);
}
- // find a suitable DCE
-
- dcxFlags = Flags & (DCX_PARENTCLIP | DCX_CLIPSIBLINGS | DCX_CLIPCHILDREN |
- DCX_CACHE | DCX_WINDOW);
+ if (Flags & DCX_WINDOW)
+ {
+ Flags = (Flags & ~DCX_CLIPCHILDREN) | DCX_CACHE;
+ }
- if (Flags & DCX_CACHE)
+ if (!(Window->Style & WS_CHILD) || Window->Parent == NULL)
+ {
+ Flags &= ~DCX_PARENTCLIP;
+ }
+ else if (Flags & DCX_PARENTCLIP)
{
- PDCE dceEmpty;
- PDCE dceUnused;
+ Flags |= DCX_CACHE;
+ if (!(Flags & (DCX_CLIPCHILDREN | DCX_CLIPSIBLINGS)))
+ {
+ if ((Window->Style & WS_VISIBLE) &&
+ (Window->Parent->Style & WS_VISIBLE))
+ {
+ Flags &= ~DCX_CLIPCHILDREN;
+ if (Window->Parent->Style & WS_CLIPSIBLINGS)
+ {
+ Flags |= DCX_CLIPSIBLINGS;
+ }
+ }
+ }
+ }
- dceEmpty = dceUnused = NULL;
+ DcxFlags = Flags & DCX_CACHECOMPAREMASK;
- /* 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.
- */
+ if (Flags & DCX_CACHE)
+ {
+ DCE* DceEmpty = NULL;
+ DCE* DceUnused = NULL;
- for (dce = firstDCE; (dce); dce = dce->next)
+ for (Dce = FirstDce; Dce != NULL; Dce = Dce->next)
{
- if ((dce->DCXflags & (DCX_CACHE | DCX_DCEBUSY)) == DCX_CACHE)
+ if ((Dce->DCXFlags & (DCX_CACHE | DCX_DCEBUSY)) == DCX_CACHE)
{
- dceUnused = dce;
-
- 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))
+ DceUnused = Dce;
+ if (Dce->DCXFlags & DCX_DCEEMPTY)
{
- DPRINT("Found valid %08x dce [%04x], flags %08x\n",
- (unsigned)dce, hWnd, (unsigned)dcxFlags);
- bUpdateVisRgn = FALSE;
- bUpdateClipOrigin = TRUE;
- break;
+ DceEmpty = Dce;
+ }
+ else if (Dce->hwndCurrent == hWnd &&
+ ((Dce->DCXFlags & DCX_CACHECOMPAREMASK) == DcxFlags))
+ {
+ UpdateVisRgn = FALSE;
+ UpdateClipOrigin = TRUE;
+ break;
}
}
}
- if (!dce) dce = (dceEmpty) ? dceEmpty : dceUnused;
-
- // if there's no dce empty or unused, allocate a new one
- if (!dce)
- {
- hdce = DCEOBJ_AllocDCE();
- if (hdce == NULL)
- {
- return 0;
- }
- dce = DCEOBJ_LockDCE(hdce);
- dce->type = DCE_CACHE_DC;
- dce->hDC = W32kCreateDC(L"DISPLAY", NULL, NULL, NULL);
- }
- }
- else
- {
- dce = Window->dce;
- if (dce && dce->hwndCurrent == hWnd)
+ if (Dce == NULL)
+ {
+ Dce = (DceEmpty == NULL) ? DceEmpty : DceUnused;
+ }
+
+ if (Dce == NULL)
{
- DPRINT("skipping hVisRgn update\n");
- bUpdateVisRgn = FALSE; // updated automatically, via DCHook()
+ Dce = DceAllocDCE(NULL, DCE_CACHE_DC);
}
}
- if (!dce)
+ else
{
- hdc = 0;
- goto END;
+ Dce = Window->Dce;
+ /* FIXME: Implement this. */
+ DbgBreakPoint();
}
- if (!(Flags & (DCX_INTERSECTRGN | DCX_EXCLUDERGN))) hRegion = 0;
-
- if (((Flags ^ dce->DCXflags) & (DCX_INTERSECTRGN | DCX_EXCLUDERGN)) &&
- (dce->hClipRgn != hRegion))
+ if (Dce == NULL)
{
- // if the extra clip region has changed, get rid of the old one
-/* DCE_DeleteClipRgn(dce); */
+ W32kReleaseWindowObject(Window);
+ return(NULL);
}
- dce->hwndCurrent = hWnd;
- dce->hClipRgn = hRegion;
- 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;
+ Dce->hwndCurrent = hWnd;
+ Dce->hClipRgn = NULL;
+ Dce->DCXFlags = DcxFlags | (Flags & DCX_WINDOWPAINT) | DCX_DCEBUSY;
-/* if (bUpdateVisRgn) SetHookFlags(hdc, DCHF_INVALIDATEVISRGN); // force update */
+ DceSetDrawable(Window, Dce->hDC, Flags, UpdateClipOrigin);
-/* if (!USER_Driver.pGetDC(hWnd, hdc, hRegion, Flags)) hdc = 0; */
+ if (UpdateVisRgn)
+ {
+ if (Flags & DCX_PARENTCLIP)
+ {
+ PWINDOW_OBJECT Parent;
- DPRINT("(%04x,%04x,0x%lx): returning %04x\n", hWnd, hRegion, Flags, hdc);
+ Parent = Window->Parent;
-END:
-/* WIN_ReleasePtr(Window); */
- return hdc;
+ 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->DCXFlags &= ~DCX_DCEDIRTY;
+ W32kSelectVisRgn(Dce->hDC, hRgnVisible);
+ }
+ }
+
+ if (Flags & (DCX_EXCLUDERGN | DCX_INTERSECTRGN))
+ {
+ DPRINT1("FIXME.\n");
+ }
+
+ if (hRgnVisible != NULL)
+ {
+ W32kDeleteObject(hRgnVisible);
+ }
+ W32kReleaseWindowObject(Window);
+ return(Dce->hDC);
}
/* EOF */
-/* $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
* PROJECT: ReactOS kernel
VOID
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->top = WindowObject->ClientRect.bottom - WindowObject->ClientRect.top;
+ Rect->bottom =
+ WindowObject->ClientRect.bottom - WindowObject->ClientRect.top;
}
BOOL STDCALL
-/* $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 $
*/
#include <win32k/bitmaps.h>
#include <win32k/brush.h>
//#include <win32k/debug.h>
+#include <include/object.h>
#define NDEBUG
#include <win32k/debug1.h>
}
BOOL STDCALL W32kPatBlt(HDC hDC,
- INT XLeft,
- INT YLeft,
- INT Width,
- INT Height,
- DWORD ROP)
+ INT XLeft,
+ INT YLeft,
+ INT Width,
+ INT Height,
+ 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,
// #define NDEBUG
#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 copy;
return copy;
}
-INT WINAPI SelectVisRgn(HDC hdc, HRGN hrgn)
+INT WINAPI
+W32kSelectVisRgn(HDC hdc, HRGN hrgn)
{
int retval;
DC *dc;
dc->w.flags &= ~DC_DIRTY;
retval = W32kCombineRgn(dc->w.hVisRgn, hrgn, 0, RGN_COPY);
- //ei CLIPPING_UpdateGCRegion(dc);
+ CLIPPING_UpdateGCRegion(dc);
return retval;
}
DC *dc;
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->right -= dc->w.DCOrgX;
rc->top -= dc->w.DCOrgY;
-/* $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
*
/* Initialize the DC state */
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);
DC_ReleasePtr( hNewDC );
return hNewDC;
if( PalGDI ){
XlateObj = (PXLATEOBJ)EngCreateXlate(PalGDI->Mode, PAL_RGB, dc->w.hPalette, NULL);
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);
}
break;
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 );
return hDC;
}
#include <win32k/fillshap.h>
#include <win32k/dc.h>
#include <win32k/pen.h>
+#include <include/object.h>
// #define NDEBUG
#include <win32k/debug1.h>
int BottomRect)
{
DC *dc = DC_HandleToPtr(hDC);
- SURFOBJ *SurfObj = (SURFOBJ*)AccessUserObject(dc->Surface);
+ SURFOBJ *SurfObj = (SURFOBJ*)AccessUserObject((ULONG)dc->Surface);
PBRUSHOBJ BrushObj;
BOOL ret;
PRECTL RectBounds;
PENOBJ * pen;
+ RECTL DestRect;
if(!dc)
return FALSE;
ret = PATH_Rectangle(hDC, LeftRect, TopRect, RightRect, BottomRect);
} else {
// Draw the rectangle with the current pen
- pen = (PENOBJ*) GDIOBJ_LockObj(dc->w.hPen, GO_PEN_MAGIC);
- ASSERT(pen);
- BrushObj = (PBRUSHOBJ)PenToBrushObj(dc, pen);
- GDIOBJ_UnlockObj( dc->w.hPen, GO_PEN_MAGIC );
+ pen = (PENOBJ*) GDIOBJ_LockObj(dc->w.hPen, GO_PEN_MAGIC);
+ ASSERT(pen);
+ BrushObj = (PBRUSHOBJ)PenToBrushObj(dc, pen);
+ 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,
NULL, // ClipObj,
RectBounds, // Bounding rectangle
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?
/*
* 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 $
*
*/
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 )
- || handleEntry->hProcessId != PsGetCurrentProcessId () )
+ || (handleEntry->hProcessId != (HANDLE)0xFFFFFFFF &&
+ handleEntry->hProcessId != PsGetCurrentProcessId ()))
return NULL;
objectHeader = (PGDIOBJHDR) handleEntry->pObject;
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 )
- || handleEntry->hProcessId != PsGetCurrentProcessId ())
+ || (handleEntry->hProcessId != (HANDLE)0xFFFFFFFF &&
+ handleEntry->hProcessId != PsGetCurrentProcessId ()))
return FALSE;
objectHeader = (PGDIOBJHDR) handleEntry->pObject;
}
*/
+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)
{
PGDI_HANDLE_ENTRY handleEntry;
handleEntry = GDIOBJ_iGetHandleEntryForIndex ((WORD)ObjectHandle & 0xffff);
if (handleEntry == 0 ||
- handleEntry->hProcessId != PsGetCurrentProcessId ())
+ (handleEntry->hProcessId != (HANDLE)0xFFFFFFFF &&
+ handleEntry->hProcessId != PsGetCurrentProcessId ()))
return 0;
return handleEntry->wMagic;
// Create GDI Stock Objects from the logical structures we've defined
StockObjects[WHITE_BRUSH] = W32kCreateBrushIndirect(&WhiteBrush);
+ GDIOBJ_MarkObjectGlobal(StockObjects[WHITE_BRUSH]);
StockObjects[LTGRAY_BRUSH] = W32kCreateBrushIndirect(&LtGrayBrush);
+ GDIOBJ_MarkObjectGlobal(StockObjects[LTGRAY_BRUSH]);
StockObjects[GRAY_BRUSH] = W32kCreateBrushIndirect(&GrayBrush);
+ GDIOBJ_MarkObjectGlobal(StockObjects[GRAY_BRUSH]);
StockObjects[DKGRAY_BRUSH] = W32kCreateBrushIndirect(&DkGrayBrush);
+ GDIOBJ_MarkObjectGlobal(StockObjects[DKGRAY_BRUSH]);
StockObjects[BLACK_BRUSH] = W32kCreateBrushIndirect(&BlackBrush);
+ GDIOBJ_MarkObjectGlobal(StockObjects[BLACK_BRUSH]);
StockObjects[NULL_BRUSH] = W32kCreateBrushIndirect(&NullBrush);
+ GDIOBJ_MarkObjectGlobal(StockObjects[NULL_BRUSH]);
StockObjects[WHITE_PEN] = W32kCreatePenIndirect(&WhitePen);
+ GDIOBJ_MarkObjectGlobal(StockObjects[WHITE_PEN]);
StockObjects[BLACK_PEN] = W32kCreatePenIndirect(&BlackPen);
+ GDIOBJ_MarkObjectGlobal(StockObjects[BLACK_PEN]);
StockObjects[NULL_PEN] = W32kCreatePenIndirect(&NullPen);
+ GDIOBJ_MarkObjectGlobal(StockObjects[NULL_PEN]);
StockObjects[OEM_FIXED_FONT] = W32kCreateFontIndirect(&OEMFixedFont);
+ GDIOBJ_MarkObjectGlobal(StockObjects[OEM_FIXED_FONT]);
StockObjects[ANSI_FIXED_FONT] = W32kCreateFontIndirect(&AnsiFixedFont);
+ GDIOBJ_MarkObjectGlobal(StockObjects[ANSI_FIXED_FONT]);
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);
+ GDIOBJ_MarkObjectGlobal(StockObjects[SYSTEM_FIXED_FONT]);
StockObjects[DEFAULT_GUI_FONT] = W32kCreateFontIndirect(&DefaultGuiFont);
+ GDIOBJ_MarkObjectGlobal(StockObjects[DEFAULT_GUI_FONT]);
StockObjects[DEFAULT_PALETTE] = (HGDIOBJ*)PALETTE_Init();
}
Dest->left = max(Src1->left, Src2->left);
Dest->right = min(Src1->right, Src2->right);
Dest->top = max(Src1->top, Src2->top);
- Dest->bottom = min(Src1->right, Src2->right);
+ Dest->bottom = min(Src1->bottom, Src2->bottom);
return(TRUE);
}
UNIMPLEMENTED;
}
-
-INT
-STDCALL
-W32kGetRgnBox(HRGN hRgn,
- LPRECT pRect)
+INT STDCALL
+UnsafeW32kGetRgnBox(HRGN hRgn,
+ LPRECT pRect)
{
PROSRGNDATA rgn = RGNDATA_LockRgn(hRgn);
DWORD ret;
- if( rgn ){
- RECT SafeRect;
- SafeRect.left = rgn->rdh.rcBound.left;
- SafeRect.top = rgn->rdh.rcBound.top;
- SafeRect.right = rgn->rdh.rcBound.right;
- SafeRect.bottom = rgn->rdh.rcBound.bottom;
- ret = rgn->rdh.iType;
- RGNDATA_UnlockRgn( hRgn );
+ if (rgn)
+ {
+ *pRect = rgn->rdh.rcBound;
+ ret = rgn->rdh.iType;
+ RGNDATA_UnlockRgn( hRgn );
+
+ return ret;
+ }
+ return 0; //if invalid region return zero
+}
- if(!NT_SUCCESS(MmCopyToCaller(pRect, &SafeRect, sizeof(RECT))))
- return 0;
- return ret;
- }
+INT STDCALL
+W32kGetRgnBox(HRGN hRgn,
+ LPRECT pRect)
+{
+ PROSRGNDATA rgn = RGNDATA_LockRgn(hRgn);
+ DWORD ret;
+
+ if (rgn)
+ {
+ RECT SafeRect;
+ SafeRect.left = rgn->rdh.rcBound.left;
+ SafeRect.top = rgn->rdh.rcBound.top;
+ SafeRect.right = rgn->rdh.rcBound.right;
+ SafeRect.bottom = rgn->rdh.rcBound.bottom;
+ ret = rgn->rdh.iType;
+ RGNDATA_UnlockRgn( hRgn );
+
+ if(!NT_SUCCESS(MmCopyToCaller(pRect, &SafeRect, sizeof(RECT))))
+ return 0;
+
+ return ret;
+ }
return 0; //if invalid region return zero
}
int error, glyph_index, n, load_flags = FT_LOAD_RENDER, i, j, sx, sy, scc;
FT_Face face;
FT_GlyphSlot glyph;
- ULONG TextLeft = XStart, TextTop = YStart, SpaceBetweenChars = 2, pitch, previous;
+ ULONG TextLeft, TextTop, SpaceBetweenChars = 2, pitch, previous;
FT_Bool use_kerning;
RECTL DestRect, MaskRect;
POINTL SourcePoint, BrushOrigin;
if( !dc )
return FALSE;
+ XStart += dc->w.DCOrgX;
+ YStart += dc->w.DCOrgY;
+ TextLeft = XStart;
+ TextTop = YStart;
+
TextObj = TEXTOBJ_LockText(dc->w.hFont);
for(i=0; i<FontsLoaded; i++)