mirror of
https://github.com/reactos/reactos.git
synced 2025-01-03 21:09:19 +00:00
[win32k]
- move wallpaper info from WINSTATION_OBJECT to SPIVALUES. Also remove some unused fields from WINSTATION_OBJECT svn path=/trunk/; revision=55862
This commit is contained in:
parent
f1838c9108
commit
23c1c259f0
4 changed files with 39 additions and 46 deletions
|
@ -34,6 +34,13 @@ typedef enum _USERPREFMASKS
|
|||
UPM_DEFAULT = 0x80003E9E
|
||||
} USERPREFMASKS;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
wmCenter = 0,
|
||||
wmTile,
|
||||
wmStretch
|
||||
} WALLPAPER_MODE;
|
||||
|
||||
typedef struct _SPIVALUES
|
||||
{
|
||||
/* Metrics */
|
||||
|
@ -129,11 +136,16 @@ typedef struct _SPIVALUES
|
|||
TEXTMETRICW tmMenuFont;
|
||||
TEXTMETRICW tmCaptionFont;
|
||||
|
||||
/* Wallpaper */
|
||||
HANDLE hbmWallpaper;
|
||||
ULONG cxWallpaper, cyWallpaper;
|
||||
WALLPAPER_MODE WallpaperMode;
|
||||
UNICODE_STRING ustrWallpaper;
|
||||
WCHAR awcWallpaper[MAX_PATH];
|
||||
|
||||
BOOL bHandHeld;
|
||||
BOOL bFastTaskSwitch;
|
||||
UINT uiGridGranularity;
|
||||
UNICODE_STRING ustrWallpaper;
|
||||
WCHAR awcWallpaper[MAX_PATH];
|
||||
|
||||
ANIMATIONINFO animationinfo;
|
||||
BOOL bSnapToDefBtn;
|
||||
|
|
|
@ -7,19 +7,8 @@
|
|||
#define WSS_LOCKED (1)
|
||||
#define WSS_NOINTERACTIVE (2)
|
||||
|
||||
typedef enum
|
||||
{
|
||||
wmCenter = 0,
|
||||
wmTile,
|
||||
wmStretch
|
||||
} WALLPAPER_MODE;
|
||||
|
||||
typedef struct _WINSTATION_OBJECT
|
||||
{
|
||||
PVOID SharedHeap; /* Points to kmode memory! */
|
||||
|
||||
CSHORT Type;
|
||||
CSHORT Size;
|
||||
KSPIN_LOCK Lock;
|
||||
UNICODE_STRING Name;
|
||||
LIST_ENTRY DesktopListHead;
|
||||
|
@ -28,11 +17,6 @@ typedef struct _WINSTATION_OBJECT
|
|||
HANDLE ShellWindow;
|
||||
HANDLE ShellListView;
|
||||
|
||||
/* Wallpaper */
|
||||
HANDLE hbmWallpaper;
|
||||
ULONG cxWallpaper, cyWallpaper;
|
||||
WALLPAPER_MODE WallpaperMode;
|
||||
|
||||
ULONG Flags;
|
||||
struct _DESKTOP* ActiveDesktop;
|
||||
|
||||
|
|
|
@ -1238,8 +1238,6 @@ NtUserPaintDesktop(HDC hDC)
|
|||
COLORREF color_old;
|
||||
UINT align_old;
|
||||
int mode_old;
|
||||
PTHREADINFO pti = PsGetCurrentThreadWin32Thread();
|
||||
PWINSTATION_OBJECT WinSta = pti->rpdesk->rpwinstaParent;
|
||||
DECLARE_RETURN(BOOL);
|
||||
|
||||
UserEnterExclusive();
|
||||
|
@ -1262,7 +1260,7 @@ NtUserPaintDesktop(HDC hDC)
|
|||
/*
|
||||
* Paint desktop background
|
||||
*/
|
||||
if (WinSta->hbmWallpaper != NULL)
|
||||
if (gspv.hbmWallpaper != NULL)
|
||||
{
|
||||
SIZE sz;
|
||||
int x, y;
|
||||
|
@ -1271,8 +1269,8 @@ NtUserPaintDesktop(HDC hDC)
|
|||
sz.cx = WndDesktop->rcWindow.right - WndDesktop->rcWindow.left;
|
||||
sz.cy = WndDesktop->rcWindow.bottom - WndDesktop->rcWindow.top;
|
||||
|
||||
if (WinSta->WallpaperMode == wmStretch ||
|
||||
WinSta->WallpaperMode == wmTile)
|
||||
if (gspv.WallpaperMode == wmStretch ||
|
||||
gspv.WallpaperMode == wmTile)
|
||||
{
|
||||
x = 0;
|
||||
y = 0;
|
||||
|
@ -1280,8 +1278,8 @@ NtUserPaintDesktop(HDC hDC)
|
|||
else
|
||||
{
|
||||
/* Find the upper left corner, can be negtive if the bitmap is bigger then the screen */
|
||||
x = (sz.cx / 2) - (WinSta->cxWallpaper / 2);
|
||||
y = (sz.cy / 2) - (WinSta->cyWallpaper / 2);
|
||||
x = (sz.cx / 2) - (gspv.cxWallpaper / 2);
|
||||
y = (sz.cy / 2) - (gspv.cyWallpaper / 2);
|
||||
}
|
||||
|
||||
hWallpaperDC = NtGdiCreateCompatibleDC(hDC);
|
||||
|
@ -1303,9 +1301,9 @@ NtUserPaintDesktop(HDC hDC)
|
|||
/*Do not fill the background after it is painted no matter the size of the picture */
|
||||
doPatBlt = FALSE;
|
||||
|
||||
hOldBitmap = NtGdiSelectBitmap(hWallpaperDC, WinSta->hbmWallpaper);
|
||||
hOldBitmap = NtGdiSelectBitmap(hWallpaperDC, gspv.hbmWallpaper);
|
||||
|
||||
if (WinSta->WallpaperMode == wmStretch)
|
||||
if (gspv.WallpaperMode == wmStretch)
|
||||
{
|
||||
if(Rect.right && Rect.bottom)
|
||||
NtGdiStretchBlt(hDC,
|
||||
|
@ -1316,24 +1314,24 @@ NtUserPaintDesktop(HDC hDC)
|
|||
hWallpaperDC,
|
||||
0,
|
||||
0,
|
||||
WinSta->cxWallpaper,
|
||||
WinSta->cyWallpaper,
|
||||
gspv.cxWallpaper,
|
||||
gspv.cyWallpaper,
|
||||
SRCCOPY,
|
||||
0);
|
||||
|
||||
}
|
||||
else if (WinSta->WallpaperMode == wmTile)
|
||||
else if (gspv.WallpaperMode == wmTile)
|
||||
{
|
||||
/* Paint the bitmap across the screen then down */
|
||||
for(y = 0; y < Rect.bottom; y += WinSta->cyWallpaper)
|
||||
for(y = 0; y < Rect.bottom; y += gspv.cyWallpaper)
|
||||
{
|
||||
for(x = 0; x < Rect.right; x += WinSta->cxWallpaper)
|
||||
for(x = 0; x < Rect.right; x += gspv.cxWallpaper)
|
||||
{
|
||||
NtGdiBitBlt(hDC,
|
||||
x,
|
||||
y,
|
||||
WinSta->cxWallpaper,
|
||||
WinSta->cyWallpaper,
|
||||
gspv.cxWallpaper,
|
||||
gspv.cyWallpaper,
|
||||
hWallpaperDC,
|
||||
0,
|
||||
0,
|
||||
|
@ -1348,8 +1346,8 @@ NtUserPaintDesktop(HDC hDC)
|
|||
NtGdiBitBlt(hDC,
|
||||
x,
|
||||
y,
|
||||
WinSta->cxWallpaper,
|
||||
WinSta->cyWallpaper,
|
||||
gspv.cxWallpaper,
|
||||
gspv.cyWallpaper,
|
||||
hWallpaperDC,
|
||||
0,
|
||||
0,
|
||||
|
|
|
@ -592,7 +592,6 @@ SpiSetWallpaper(PVOID pvParam, FLONG fl)
|
|||
HBITMAP hbmp, hOldBitmap;
|
||||
SURFACE *psurfBmp;
|
||||
ULONG ulTile, ulStyle;
|
||||
PWINSTATION_OBJECT gpwinstaCurrent = GetW32ProcessInfo()->prpwinsta;
|
||||
|
||||
REQ_INTERACTIVE_WINSTA(ERROR_REQUIRES_INTERACTIVE_WINDOWSTATION);
|
||||
|
||||
|
@ -654,9 +653,9 @@ SpiSetWallpaper(PVOID pvParam, FLONG fl)
|
|||
return 0;
|
||||
}
|
||||
|
||||
gpwinstaCurrent->cxWallpaper = psurfBmp->SurfObj.sizlBitmap.cx;
|
||||
gpwinstaCurrent->cyWallpaper = psurfBmp->SurfObj.sizlBitmap.cy;
|
||||
gpwinstaCurrent->WallpaperMode = wmCenter;
|
||||
gspv.cxWallpaper = psurfBmp->SurfObj.sizlBitmap.cx;
|
||||
gspv.cyWallpaper = psurfBmp->SurfObj.sizlBitmap.cy;
|
||||
gspv.WallpaperMode = wmCenter;
|
||||
|
||||
SURFACE_ShareUnlockSurface(psurfBmp);
|
||||
|
||||
|
@ -671,23 +670,23 @@ SpiSetWallpaper(PVOID pvParam, FLONG fl)
|
|||
/* Check the values we found in the registry */
|
||||
if(ulTile && !ulStyle)
|
||||
{
|
||||
gpwinstaCurrent->WallpaperMode = wmTile;
|
||||
gspv.WallpaperMode = wmTile;
|
||||
}
|
||||
else if(!ulTile && ulStyle == 2)
|
||||
{
|
||||
gpwinstaCurrent->WallpaperMode = wmStretch;
|
||||
gspv.WallpaperMode = wmStretch;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Remove wallpaper */
|
||||
gpwinstaCurrent->cxWallpaper = 0;
|
||||
gpwinstaCurrent->cyWallpaper = 0;
|
||||
gspv.cxWallpaper = 0;
|
||||
gspv.cyWallpaper = 0;
|
||||
hbmp = 0;
|
||||
}
|
||||
|
||||
/* Take care of the old wallpaper, if any */
|
||||
hOldBitmap = gpwinstaCurrent->hbmWallpaper;
|
||||
hOldBitmap = gspv.hbmWallpaper;
|
||||
if(hOldBitmap != NULL)
|
||||
{
|
||||
/* Delete the old wallpaper */
|
||||
|
@ -696,7 +695,7 @@ SpiSetWallpaper(PVOID pvParam, FLONG fl)
|
|||
}
|
||||
|
||||
/* Set the new wallpaper */
|
||||
gpwinstaCurrent->hbmWallpaper = hbmp;
|
||||
gspv.hbmWallpaper = hbmp;
|
||||
|
||||
NtUserRedrawWindow(UserGetShellWindow(), NULL, NULL, RDW_INVALIDATE | RDW_ERASE);
|
||||
|
||||
|
|
Loading…
Reference in a new issue