mirror of
https://github.com/reactos/reactos.git
synced 2024-10-04 08:25:53 +00:00
- Removed NtGdiGetSysColorBrush and modified functions that used it.
- Modified desktop drawing to use PaintDesktop. svn path=/trunk/; revision=7178
This commit is contained in:
parent
13347b6918
commit
0ebaadbbae
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: class.c,v 1.41 2003/12/07 22:25:34 weiden Exp $
|
/* $Id: class.c,v 1.42 2003/12/22 15:30:21 navaraf 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
|
||||||
|
@ -267,24 +267,31 @@ GetClassInfoW(
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
DWORD STDCALL
|
DWORD STDCALL
|
||||||
GetClassLongA ( HWND hWnd, int nIndex )
|
GetClassLongA(HWND hWnd, int nIndex)
|
||||||
{
|
{
|
||||||
PUNICODE_STRING str;
|
switch (nIndex)
|
||||||
|
{
|
||||||
|
case GCL_HBRBACKGROUND:
|
||||||
|
{
|
||||||
|
DWORD hBrush = NtUserGetClassLong(hWnd, GCL_HBRBACKGROUND, TRUE);
|
||||||
|
if (hBrush != 0 && hBrush < 0x4000)
|
||||||
|
hBrush = (DWORD)GetSysColorBrush((ULONG)hBrush - 1);
|
||||||
|
return hBrush;
|
||||||
|
}
|
||||||
|
|
||||||
if ( nIndex != GCL_MENUNAME )
|
case GCL_MENUNAME:
|
||||||
{
|
{
|
||||||
return NtUserGetClassLong ( hWnd, nIndex, TRUE );
|
PUNICODE_STRING Name;
|
||||||
}
|
Name = (PUNICODE_STRING)NtUserGetClassLong(hWnd, nIndex, TRUE);
|
||||||
|
if (IS_INTRESOURCE(Name))
|
||||||
|
return (DWORD)Name;
|
||||||
|
else
|
||||||
|
return (DWORD)heap_string_poolA(Name->Buffer, Name->Length);
|
||||||
|
}
|
||||||
|
|
||||||
str = (PUNICODE_STRING)NtUserGetClassLong ( hWnd, nIndex, TRUE );
|
default:
|
||||||
if ( IS_INTRESOURCE(str) )
|
return NtUserGetClassLong(hWnd, nIndex, TRUE);
|
||||||
{
|
}
|
||||||
return (DWORD)str;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return (DWORD)heap_string_poolA ( str->Buffer, str->Length );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -293,22 +300,29 @@ GetClassLongA ( HWND hWnd, int nIndex )
|
||||||
DWORD STDCALL
|
DWORD STDCALL
|
||||||
GetClassLongW ( HWND hWnd, int nIndex )
|
GetClassLongW ( HWND hWnd, int nIndex )
|
||||||
{
|
{
|
||||||
PUNICODE_STRING str;
|
switch (nIndex)
|
||||||
|
{
|
||||||
|
case GCL_HBRBACKGROUND:
|
||||||
|
{
|
||||||
|
DWORD hBrush = NtUserGetClassLong(hWnd, GCL_HBRBACKGROUND, TRUE);
|
||||||
|
if (hBrush != 0 && hBrush < 0x4000)
|
||||||
|
hBrush = (DWORD)GetSysColorBrush((ULONG)hBrush - 1);
|
||||||
|
return hBrush;
|
||||||
|
}
|
||||||
|
|
||||||
if ( nIndex != GCL_MENUNAME )
|
case GCL_MENUNAME:
|
||||||
{
|
{
|
||||||
return NtUserGetClassLong ( hWnd, nIndex, FALSE );
|
PUNICODE_STRING Name;
|
||||||
}
|
Name = (PUNICODE_STRING)NtUserGetClassLong(hWnd, nIndex, FALSE);
|
||||||
|
if (IS_INTRESOURCE(Name))
|
||||||
|
return (DWORD)Name;
|
||||||
|
else
|
||||||
|
return (DWORD)heap_string_poolW(Name->Buffer, Name->Length);
|
||||||
|
}
|
||||||
|
|
||||||
str = (PUNICODE_STRING)NtUserGetClassLong(hWnd, nIndex, TRUE);
|
default:
|
||||||
if ( IS_INTRESOURCE(str) )
|
return NtUserGetClassLong(hWnd, nIndex, FALSE);
|
||||||
{
|
}
|
||||||
return (DWORD)str;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return (DWORD)heap_string_poolW ( str->Buffer, str->Length );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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.32 2003/12/21 16:49:41 navaraf Exp $
|
/* $Id: draw.c,v 1.33 2003/12/22 15:30:21 navaraf Exp $
|
||||||
*
|
*
|
||||||
* PROJECT: ReactOS user32.dll
|
* PROJECT: ReactOS user32.dll
|
||||||
* FILE: lib/user32/windows/input.c
|
* FILE: lib/user32/windows/input.c
|
||||||
|
@ -47,13 +47,22 @@
|
||||||
|
|
||||||
/* INCLUDES ******************************************************************/
|
/* INCLUDES ******************************************************************/
|
||||||
|
|
||||||
|
#ifndef __USE_W32API
|
||||||
|
#define __USE_W32API
|
||||||
|
#define _WIN32_WINNT 0x0500
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
#ifndef __USE_W32API
|
||||||
#include <user32.h>
|
#include <user32.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
// Needed for DrawState
|
// Needed for DrawState
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#ifndef __USE_W32API
|
||||||
#include <unicode.h>
|
#include <unicode.h>
|
||||||
#include <draw.h>
|
#include <draw.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
@ -497,7 +506,7 @@ static BOOL UITOOLS95_DrawRectEdge(HDC hdc, LPRECT rc,
|
||||||
* otherwise.
|
* otherwise.
|
||||||
* Dennis Björklund, 10 June, 99
|
* Dennis Björklund, 10 June, 99
|
||||||
*/
|
*/
|
||||||
/* if( TWEAK_WineLook == WIN98_LOOK && LTInnerI != -1 ) */
|
if( LTInnerI != -1 )
|
||||||
LTInnerI = RBInnerI = COLOR_BTNFACE;
|
LTInnerI = RBInnerI = COLOR_BTNFACE;
|
||||||
}
|
}
|
||||||
else if(uFlags & BF_SOFT)
|
else if(uFlags & BF_SOFT)
|
||||||
|
@ -885,8 +894,10 @@ static BOOL UITOOLS95_DrawFrameButton(HDC hdc, LPRECT rc, UINT uState)
|
||||||
case DFCS_BUTTONRADIO:
|
case DFCS_BUTTONRADIO:
|
||||||
return UITOOLS95_DFC_ButtonRadio(hdc, rc, uState);
|
return UITOOLS95_DFC_ButtonRadio(hdc, rc, uState);
|
||||||
|
|
||||||
|
/*
|
||||||
default:
|
default:
|
||||||
DbgPrint("Invalid button state=0x%04x\n", uState);
|
DbgPrint("Invalid button state=0x%04x\n", uState);
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -1348,7 +1359,9 @@ static BOOL UITOOLS95_DrawFrameMenu(HDC dc, LPRECT r, UINT uFlags)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
/*
|
||||||
DbgPrint("Invalid menu; flags=0x%04x\n", uFlags);
|
DbgPrint("Invalid menu; flags=0x%04x\n", uFlags);
|
||||||
|
*/
|
||||||
retval = FALSE;
|
retval = FALSE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1380,8 +1393,10 @@ BOOL WINAPI DrawFrameControl( HDC hdc, LPRECT rc, UINT uType,
|
||||||
*/
|
*/
|
||||||
case DFC_SCROLL:
|
case DFC_SCROLL:
|
||||||
return UITOOLS95_DrawFrameScroll(hdc, rc, uState);
|
return UITOOLS95_DrawFrameScroll(hdc, rc, uState);
|
||||||
|
/*
|
||||||
default:
|
default:
|
||||||
DbgPrint("(%p,%p,%d,%x), bad type!\n", hdc,rc,uType,uState );
|
DbgPrint("(%p,%p,%d,%x), bad type!\n", hdc,rc,uType,uState );
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -1736,7 +1751,9 @@ WINBOOL INTERNAL_DrawStateDraw(HDC hdc, UINT type, DRAWSTATEPROC lpOutputFunc,
|
||||||
case DST_TEXT :
|
case DST_TEXT :
|
||||||
case DST_PREFIXTEXT :
|
case DST_PREFIXTEXT :
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
DbgPrint("Drawing DST_TEXT\n");
|
DbgPrint("Drawing DST_TEXT\n");
|
||||||
|
*/
|
||||||
if (unicode)
|
if (unicode)
|
||||||
return DrawTextW(hdc, (LPWSTR)lData, (INT)wData, rc, dtflags);
|
return DrawTextW(hdc, (LPWSTR)lData, (INT)wData, rc, dtflags);
|
||||||
else
|
else
|
||||||
|
@ -1746,26 +1763,34 @@ WINBOOL INTERNAL_DrawStateDraw(HDC hdc, UINT type, DRAWSTATEPROC lpOutputFunc,
|
||||||
case DST_ICON :
|
case DST_ICON :
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
|
/*
|
||||||
DbgPrint("Drawing DST_ICON\n");
|
DbgPrint("Drawing DST_ICON\n");
|
||||||
|
*/
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
case DST_BITMAP :
|
case DST_BITMAP :
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
|
/*
|
||||||
DbgPrint("Drawing DST_BITMAP\n");
|
DbgPrint("Drawing DST_BITMAP\n");
|
||||||
|
*/
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
case DST_COMPLEX :
|
case DST_COMPLEX :
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
DbgPrint("Drawing DST_COMPLEX\n");
|
DbgPrint("Drawing DST_COMPLEX\n");
|
||||||
|
*/
|
||||||
// Call lpOutputFunc, if necessary
|
// Call lpOutputFunc, if necessary
|
||||||
if (lpOutputFunc)
|
if (lpOutputFunc)
|
||||||
{
|
{
|
||||||
// Something seems to be wrong with OffsetViewportOrgEx:
|
// Something seems to be wrong with OffsetViewportOrgEx:
|
||||||
OffsetViewportOrgEx(hdc, rc->left, rc->top, NULL);
|
OffsetViewportOrgEx(hdc, rc->left, rc->top, NULL);
|
||||||
|
/*
|
||||||
DbgPrint("Calling lpOutputFunc(0x%x, 0x%x, 0x%x, %d, %d)\n", hdc, lData, wData, cx, cy);
|
DbgPrint("Calling lpOutputFunc(0x%x, 0x%x, 0x%x, %d, %d)\n", hdc, lData, wData, cx, cy);
|
||||||
|
*/
|
||||||
retval = lpOutputFunc(hdc, lData, wData, cx, cy);
|
retval = lpOutputFunc(hdc, lData, wData, cx, cy);
|
||||||
OffsetViewportOrgEx(hdc, -rc->left, -rc->top, NULL);
|
OffsetViewportOrgEx(hdc, -rc->left, -rc->top, NULL);
|
||||||
return retval;
|
return retval;
|
||||||
|
@ -1820,7 +1845,9 @@ WINBOOL INTERNAL_DrawState(
|
||||||
state = fuFlags & 0x7ff0; // DSS_xxx
|
state = fuFlags & 0x7ff0; // DSS_xxx
|
||||||
len = wData; // Data length
|
len = wData; // Data length
|
||||||
|
|
||||||
|
/*
|
||||||
DbgPrint("Entered DrawState, fuFlags %d, type %d, state %d\n", fuFlags, type, state);
|
DbgPrint("Entered DrawState, fuFlags %d, type %d, state %d\n", fuFlags, type, state);
|
||||||
|
*/
|
||||||
|
|
||||||
if ((type == DST_TEXT || type == DST_PREFIXTEXT) && ! len)
|
if ((type == DST_TEXT || type == DST_PREFIXTEXT) && ! len)
|
||||||
{
|
{
|
||||||
|
@ -1845,7 +1872,9 @@ WINBOOL INTERNAL_DrawState(
|
||||||
{
|
{
|
||||||
BOOL success;
|
BOOL success;
|
||||||
|
|
||||||
|
/*
|
||||||
DbgPrint("Calculating rect of DST_TEXT / DST_PREFIXTEXT\n");
|
DbgPrint("Calculating rect of DST_TEXT / DST_PREFIXTEXT\n");
|
||||||
|
*/
|
||||||
|
|
||||||
if (unicode)
|
if (unicode)
|
||||||
success = GetTextExtentPoint32W(hdc, (LPWSTR) lData, len, &s);
|
success = GetTextExtentPoint32W(hdc, (LPWSTR) lData, len, &s);
|
||||||
|
@ -1858,14 +1887,18 @@ WINBOOL INTERNAL_DrawState(
|
||||||
|
|
||||||
case DST_ICON :
|
case DST_ICON :
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
DbgPrint("Calculating rect of DST_ICON\n");
|
DbgPrint("Calculating rect of DST_ICON\n");
|
||||||
|
*/
|
||||||
// TODO
|
// TODO
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case DST_BITMAP :
|
case DST_BITMAP :
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
DbgPrint("Calculating rect of DST_BITMAP\n");
|
DbgPrint("Calculating rect of DST_BITMAP\n");
|
||||||
|
*/
|
||||||
|
|
||||||
if (!GetObjectA((HBITMAP) lData, sizeof(bm), &bm))
|
if (!GetObjectA((HBITMAP) lData, sizeof(bm), &bm))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -1876,7 +1909,9 @@ WINBOOL INTERNAL_DrawState(
|
||||||
}
|
}
|
||||||
|
|
||||||
case DST_COMPLEX : // cx and cy must be set in this mode
|
case DST_COMPLEX : // cx and cy must be set in this mode
|
||||||
|
/*
|
||||||
DbgPrint("Calculating rect of DST_COMPLEX - Not allowed!\n");
|
DbgPrint("Calculating rect of DST_COMPLEX - Not allowed!\n");
|
||||||
|
*/
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1893,7 +1928,9 @@ WINBOOL INTERNAL_DrawState(
|
||||||
// No additional processing needed for DSS_NORMAL
|
// No additional processing needed for DSS_NORMAL
|
||||||
if (state == DSS_NORMAL)
|
if (state == DSS_NORMAL)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
DbgPrint("DSS_NORMAL (no additional processing necessary)\n");
|
DbgPrint("DSS_NORMAL (no additional processing necessary)\n");
|
||||||
|
*/
|
||||||
SetRect(&rect, x, y, x + cx, y + cy);
|
SetRect(&rect, x, y, x + cx, y + cy);
|
||||||
return INTERNAL_DrawStateDraw(hdc, type, lpOutputFunc, lData, wData, &rect, dtflags, unicode);
|
return INTERNAL_DrawStateDraw(hdc, type, lpOutputFunc, lData, wData, &rect, dtflags, unicode);
|
||||||
}
|
}
|
||||||
|
@ -1915,7 +1952,9 @@ WINBOOL INTERNAL_DrawState(
|
||||||
OldBMP = (HBITMAP) SelectObject(MemDC, MemBMP);
|
OldBMP = (HBITMAP) SelectObject(MemDC, MemBMP);
|
||||||
if (! OldBMP) goto cleanup;
|
if (! OldBMP) goto cleanup;
|
||||||
|
|
||||||
|
/*
|
||||||
DbgPrint("Created and inited MemDC\n");
|
DbgPrint("Created and inited MemDC\n");
|
||||||
|
*/
|
||||||
|
|
||||||
// Set up the default colors and font
|
// Set up the default colors and font
|
||||||
if (! FillRect(MemDC, &rect, (HBRUSH)GetStockObject(WHITE_BRUSH))) goto cleanup;
|
if (! FillRect(MemDC, &rect, (HBRUSH)GetStockObject(WHITE_BRUSH))) goto cleanup;
|
||||||
|
@ -1923,7 +1962,9 @@ WINBOOL INTERNAL_DrawState(
|
||||||
SetTextColor(MemDC, RGB(0, 0, 0));
|
SetTextColor(MemDC, RGB(0, 0, 0));
|
||||||
Font = (HFONT)SelectObject(MemDC, GetCurrentObject(hdc, OBJ_FONT));
|
Font = (HFONT)SelectObject(MemDC, GetCurrentObject(hdc, OBJ_FONT));
|
||||||
|
|
||||||
|
/*
|
||||||
DbgPrint("Selected font and set colors\n");
|
DbgPrint("Selected font and set colors\n");
|
||||||
|
*/
|
||||||
|
|
||||||
// Enable this line to use the current DC image to begin with (wrong?)
|
// Enable this line to use the current DC image to begin with (wrong?)
|
||||||
// if (! BitBlt(MemDC, 0, 0, cx, cy, hdc, x, y, SRCCOPY)) goto cleanup;
|
// if (! BitBlt(MemDC, 0, 0, cx, cy, hdc, x, y, SRCCOPY)) goto cleanup;
|
||||||
|
@ -1938,12 +1979,16 @@ WINBOOL INTERNAL_DrawState(
|
||||||
if (! TempResult) goto cleanup;
|
if (! TempResult) goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
DbgPrint("Done drawing\n");
|
DbgPrint("Done drawing\n");
|
||||||
|
*/
|
||||||
|
|
||||||
// Apply state(s?)
|
// Apply state(s?)
|
||||||
if (state & DSS_UNION)
|
if (state & DSS_UNION)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
DbgPrint("DSS_UNION\n");
|
DbgPrint("DSS_UNION\n");
|
||||||
|
*/
|
||||||
// Dither the image (not implemented in ReactOS yet?)
|
// Dither the image (not implemented in ReactOS yet?)
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
@ -1957,7 +2002,9 @@ WINBOOL INTERNAL_DrawState(
|
||||||
// Draw shadow
|
// Draw shadow
|
||||||
if (state & (DSS_DISABLED /*|DSS_DEFAULT*/))
|
if (state & (DSS_DISABLED /*|DSS_DEFAULT*/))
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
DbgPrint("DSS_DISABLED - Drawing shadow\n");
|
DbgPrint("DSS_DISABLED - Drawing shadow\n");
|
||||||
|
*/
|
||||||
if (! TempBrush) goto cleanup;
|
if (! TempBrush) goto cleanup;
|
||||||
OldBrush = (HBRUSH)SelectObject(hdc, TempBrush);
|
OldBrush = (HBRUSH)SelectObject(hdc, TempBrush);
|
||||||
if (! OldBrush) goto cleanup;
|
if (! OldBrush) goto cleanup;
|
||||||
|
@ -1969,29 +2016,39 @@ WINBOOL INTERNAL_DrawState(
|
||||||
|
|
||||||
if (state & DSS_DISABLED)
|
if (state & DSS_DISABLED)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
DbgPrint("DSS_DISABLED - Creating shadow brush 2\n");
|
DbgPrint("DSS_DISABLED - Creating shadow brush 2\n");
|
||||||
|
*/
|
||||||
hbr = TempBrush = CreateSolidBrush(GetSysColor(COLOR_3DSHADOW));
|
hbr = TempBrush = CreateSolidBrush(GetSysColor(COLOR_3DSHADOW));
|
||||||
if (! TempBrush) goto cleanup;
|
if (! TempBrush) goto cleanup;
|
||||||
}
|
}
|
||||||
else if (! hbr)
|
else if (! hbr)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
DbgPrint("Creating a brush\n");
|
DbgPrint("Creating a brush\n");
|
||||||
|
*/
|
||||||
hbr = (HBRUSH) GetStockObject(BLACK_BRUSH);
|
hbr = (HBRUSH) GetStockObject(BLACK_BRUSH);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
DbgPrint("Selecting new brush\n");
|
DbgPrint("Selecting new brush\n");
|
||||||
|
*/
|
||||||
OldBrush = (HBRUSH) SelectObject(hdc, hbr);
|
OldBrush = (HBRUSH) SelectObject(hdc, hbr);
|
||||||
|
|
||||||
// Copy to hdc from MemDC
|
// Copy to hdc from MemDC
|
||||||
|
/*
|
||||||
DbgPrint("Blitting\n");
|
DbgPrint("Blitting\n");
|
||||||
|
*/
|
||||||
if (! BitBlt(hdc, x, y, cx, cy, MemDC, 0, 0, 0x00B8074A)) goto cleanup;
|
if (! BitBlt(hdc, x, y, cx, cy, MemDC, 0, 0, 0x00B8074A)) goto cleanup;
|
||||||
|
|
||||||
retval = TRUE;
|
retval = TRUE;
|
||||||
|
|
||||||
|
|
||||||
cleanup :
|
cleanup :
|
||||||
|
/*
|
||||||
DbgPrint("In cleanup : Font %x OldBrush %x OldBMP %x Tempbrush %x MemBMP %x MemDC %x\n",
|
DbgPrint("In cleanup : Font %x OldBrush %x OldBMP %x Tempbrush %x MemBMP %x MemDC %x\n",
|
||||||
Font, OldBrush, OldBMP, TempBrush, MemBMP, MemDC);
|
Font, OldBrush, OldBMP, TempBrush, MemBMP, MemDC);
|
||||||
|
*/
|
||||||
SetTextColor(hdc, ForeColor);
|
SetTextColor(hdc, ForeColor);
|
||||||
SetBkColor(hdc, BackColor);
|
SetBkColor(hdc, BackColor);
|
||||||
if (OldBrush) SelectObject(MemDC, OldBrush);
|
if (OldBrush) SelectObject(MemDC, OldBrush);
|
||||||
|
@ -2000,7 +2057,9 @@ WINBOOL INTERNAL_DrawState(
|
||||||
if (MemBMP) DeleteObject(MemBMP);
|
if (MemBMP) DeleteObject(MemBMP);
|
||||||
if (MemDC) DeleteDC(MemDC);
|
if (MemDC) DeleteDC(MemDC);
|
||||||
|
|
||||||
|
/*
|
||||||
DbgPrint("Leaving DrawState() with retval %d\n", retval);
|
DbgPrint("Leaving DrawState() with retval %d\n", retval);
|
||||||
|
*/
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: desktopbg.c,v 1.2 2003/12/13 16:04:36 navaraf Exp $
|
/* $Id: desktopbg.c,v 1.3 2003/12/22 15:30:21 navaraf Exp $
|
||||||
*
|
*
|
||||||
* reactos/subsys/csrss/win32csr/desktopbg.c
|
* reactos/subsys/csrss/win32csr/desktopbg.c
|
||||||
*
|
*
|
||||||
|
@ -33,16 +33,6 @@ typedef struct tagDTBG_THREAD_DATA
|
||||||
|
|
||||||
static BOOL Initialized = FALSE;
|
static BOOL Initialized = FALSE;
|
||||||
|
|
||||||
static void FASTCALL
|
|
||||||
DtbgPaint(HDC hDC, LPRECT lpRect)
|
|
||||||
{
|
|
||||||
HBRUSH DesktopBrush;
|
|
||||||
|
|
||||||
DesktopBrush = CreateSolidBrush(RGB(58, 110, 165));
|
|
||||||
FillRect(hDC, lpRect, DesktopBrush);
|
|
||||||
DeleteObject(DesktopBrush);
|
|
||||||
}
|
|
||||||
|
|
||||||
static LRESULT CALLBACK
|
static LRESULT CALLBACK
|
||||||
DtbgWindowProc(HWND Wnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
DtbgWindowProc(HWND Wnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
|
@ -59,18 +49,15 @@ DtbgWindowProc(HWND Wnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
||||||
case WM_PAINT:
|
case WM_PAINT:
|
||||||
{
|
{
|
||||||
PAINTSTRUCT PS;
|
PAINTSTRUCT PS;
|
||||||
|
|
||||||
BeginPaint(Wnd, &PS);
|
BeginPaint(Wnd, &PS);
|
||||||
DtbgPaint(PS.hdc, &(PS.rcPaint));
|
PaintDesktop((HDC)PS.hdc);
|
||||||
EndPaint(Wnd, &PS);
|
EndPaint(Wnd, &PS);
|
||||||
Result = 0;
|
Result = 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case WM_ERASEBKGND:
|
case WM_ERASEBKGND:
|
||||||
{
|
{
|
||||||
RECT ClientRect;
|
PaintDesktop((HDC)wParam);
|
||||||
GetClientRect(Wnd, &ClientRect);
|
|
||||||
DtbgPaint((HDC)wParam, &ClientRect);
|
|
||||||
Result = 1;
|
Result = 1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -128,7 +115,7 @@ DtbgInit()
|
||||||
Class.hInstance = (HINSTANCE) GetModuleHandleW(NULL);
|
Class.hInstance = (HINSTANCE) GetModuleHandleW(NULL);
|
||||||
Class.hIcon = NULL;
|
Class.hIcon = NULL;
|
||||||
Class.hCursor = NULL;
|
Class.hCursor = NULL;
|
||||||
Class.hbrBackground = NULL;
|
Class.hbrBackground = GetSysColorBrush(COLOR_BACKGROUND);
|
||||||
Class.lpszMenuName = NULL;
|
Class.lpszMenuName = NULL;
|
||||||
Class.lpszClassName = (LPCWSTR) DESKTOP_WINDOW_ATOM;
|
Class.lpszClassName = (LPCWSTR) DESKTOP_WINDOW_ATOM;
|
||||||
ClassAtom = RegisterClassExW(&Class);
|
ClassAtom = RegisterClassExW(&Class);
|
||||||
|
|
|
@ -5,6 +5,5 @@ const PALETTEENTRY* FASTCALL COLOR_GetSystemPaletteTemplate (VOID);
|
||||||
COLORREF STDCALL COLOR_LookupNearestColor (PALETTEENTRY* palPalEntry, INT size, COLORREF color);
|
COLORREF STDCALL COLOR_LookupNearestColor (PALETTEENTRY* palPalEntry, INT size, COLORREF color);
|
||||||
INT STDCALL COLOR_PaletteLookupExactIndex (PALETTEENTRY* palPalEntry, INT size, COLORREF col);
|
INT STDCALL COLOR_PaletteLookupExactIndex (PALETTEENTRY* palPalEntry, INT size, COLORREF col);
|
||||||
INT STDCALL COLOR_PaletteLookupPixel(PALETTEENTRY *palPalEntry, INT size, PXLATEOBJ XlateObj, COLORREF col, BOOL skipReserved);
|
INT STDCALL COLOR_PaletteLookupPixel(PALETTEENTRY *palPalEntry, INT size, PXLATEOBJ XlateObj, COLORREF col, BOOL skipReserved);
|
||||||
HBRUSH STDCALL NtGdiGetSysColorBrush(int nIndex);
|
|
||||||
|
|
||||||
#endif /* _WIN32K_COLOR_H */
|
#endif /* _WIN32K_COLOR_H */
|
||||||
|
|
|
@ -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: class.c,v 1.44 2003/12/07 23:01:01 weiden Exp $
|
/* $Id: class.c,v 1.45 2003/12/22 15:30:21 navaraf Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -451,10 +451,6 @@ IntGetClassLong(struct _WINDOW_OBJECT *WindowObject, ULONG Offset, BOOL Ansi)
|
||||||
break;
|
break;
|
||||||
case GCL_HBRBACKGROUND:
|
case GCL_HBRBACKGROUND:
|
||||||
Ret = (ULONG)WindowObject->Class->hbrBackground;
|
Ret = (ULONG)WindowObject->Class->hbrBackground;
|
||||||
if (Ret != 0 && Ret < 0x4000)
|
|
||||||
{
|
|
||||||
Ret = (ULONG)NtGdiGetSysColorBrush(Ret - 1);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case GCL_HCURSOR:
|
case GCL_HCURSOR:
|
||||||
Ret = (ULONG)WindowObject->Class->hCursor;
|
Ret = (ULONG)WindowObject->Class->hCursor;
|
||||||
|
|
|
@ -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: desktop.c,v 1.5 2003/12/13 18:40:34 gvg Exp $
|
* $Id: desktop.c,v 1.6 2003/12/22 15:30:21 navaraf Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -644,15 +644,19 @@ BOOL STDCALL
|
||||||
NtUserPaintDesktop(HDC hDC)
|
NtUserPaintDesktop(HDC hDC)
|
||||||
{
|
{
|
||||||
RECT Rect;
|
RECT Rect;
|
||||||
HBRUSH PreviousBrush;
|
HBRUSH DesktopBrush, PreviousBrush;
|
||||||
|
HWND hWndDesktop;
|
||||||
|
|
||||||
IntGdiGetClipBox(hDC, &Rect);
|
IntGdiGetClipBox(hDC, &Rect);
|
||||||
|
|
||||||
|
hWndDesktop = IntGetDesktopWindow();
|
||||||
|
DesktopBrush = (HBRUSH)NtUserGetClassLong(hWndDesktop, GCL_HBRBACKGROUND, FALSE);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Paint desktop background
|
* Paint desktop background
|
||||||
*/
|
*/
|
||||||
|
|
||||||
PreviousBrush = NtGdiSelectObject(hDC, NtGdiGetSysColorBrush(COLOR_BACKGROUND));
|
PreviousBrush = NtGdiSelectObject(hDC, DesktopBrush);
|
||||||
NtGdiPatBlt(hDC, Rect.left, Rect.top, Rect.right, Rect.bottom, PATCOPY);
|
NtGdiPatBlt(hDC, Rect.left, Rect.top, Rect.right, Rect.bottom, PATCOPY);
|
||||||
NtGdiSelectObject(hDC, PreviousBrush);
|
NtGdiSelectObject(hDC, PreviousBrush);
|
||||||
|
|
||||||
|
|
|
@ -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: menu.c,v 1.35 2003/12/21 22:09:07 weiden Exp $
|
/* $Id: menu.c,v 1.36 2003/12/22 15:30:21 navaraf Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -271,7 +271,8 @@ IntCreateMenu(PHANDLE Handle)
|
||||||
MenuObject->MenuInfo.fMask = 0; /* not used */
|
MenuObject->MenuInfo.fMask = 0; /* not used */
|
||||||
MenuObject->MenuInfo.dwStyle = 0; /* FIXME */
|
MenuObject->MenuInfo.dwStyle = 0; /* FIXME */
|
||||||
MenuObject->MenuInfo.cyMax = 0; /* default */
|
MenuObject->MenuInfo.cyMax = 0; /* default */
|
||||||
MenuObject->MenuInfo.hbrBack = NtGdiGetSysColorBrush(COLOR_MENU); /*default background color */
|
MenuObject->MenuInfo.hbrBack =
|
||||||
|
NtGdiCreateSolidBrush(RGB(192, 192, 192)); /* FIXME: default background color */
|
||||||
MenuObject->MenuInfo.dwContextHelpID = 0; /* default */
|
MenuObject->MenuInfo.dwContextHelpID = 0; /* default */
|
||||||
MenuObject->MenuInfo.dwMenuData = 0; /* default */
|
MenuObject->MenuInfo.dwMenuData = 0; /* default */
|
||||||
|
|
||||||
|
|
|
@ -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: winpos.c,v 1.60 2003/12/22 11:37:32 navaraf Exp $
|
/* $Id: winpos.c,v 1.61 2003/12/22 15:30:21 navaraf Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -577,7 +577,6 @@ WinPosDoOwnedPopups(HWND hWnd, HWND hWndInsertAfter)
|
||||||
{
|
{
|
||||||
for (i = 0; List[i]; i++)
|
for (i = 0; List[i]; i++)
|
||||||
{
|
{
|
||||||
DPRINT1("%x\n", List[i]);
|
|
||||||
if (List[i] == hWnd)
|
if (List[i] == hWnd)
|
||||||
break;
|
break;
|
||||||
if ((NtUserGetWindowLong(List[i], GWL_STYLE, FALSE) & WS_POPUP) &&
|
if ((NtUserGetWindowLong(List[i], GWL_STYLE, FALSE) & WS_POPUP) &&
|
||||||
|
|
|
@ -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: color.c,v 1.31 2003/12/20 10:31:32 navaraf Exp $ */
|
/* $Id: color.c,v 1.32 2003/12/22 15:30:21 navaraf Exp $ */
|
||||||
|
|
||||||
// FIXME: Use PXLATEOBJ logicalToSystem instead of int *mapping
|
// FIXME: Use PXLATEOBJ logicalToSystem instead of int *mapping
|
||||||
|
|
||||||
|
@ -78,62 +78,6 @@ const PALETTEENTRY COLOR_sysPalTemplate[NB_RESERVED_COLORS] =
|
||||||
{ 0xff, 0xff, 0xff, PC_SYS_USED } // last 10
|
{ 0xff, 0xff, 0xff, PC_SYS_USED } // last 10
|
||||||
};
|
};
|
||||||
|
|
||||||
const COLORREF SysColours[] =
|
|
||||||
{
|
|
||||||
RGB(224, 224, 224) /* COLOR_SCROLLBAR */,
|
|
||||||
RGB(58, 110, 165) /* COLOR_BACKGROUND */,
|
|
||||||
RGB(0, 0, 128) /* COLOR_ACTIVECAPTION */,
|
|
||||||
RGB(128, 128, 128) /* COLOR_INACTIVECAPTION */,
|
|
||||||
RGB(192, 192, 192) /* COLOR_MENU */,
|
|
||||||
RGB(255, 255, 255) /* COLOR_WINDOW */,
|
|
||||||
RGB(0, 0, 0) /* COLOR_WINDOWFRAME */,
|
|
||||||
RGB(0, 0, 0) /* COLOR_MENUTEXT */,
|
|
||||||
RGB(0, 0, 0) /* COLOR_WINDOWTEXT */,
|
|
||||||
RGB(255, 255, 255) /* COLOR_CAPTIONTEXT */,
|
|
||||||
RGB(128, 128, 128) /* COLOR_ACTIVEBORDER */,
|
|
||||||
RGB(255, 255, 255) /* COLOR_INACTIVEBORDER */,
|
|
||||||
RGB(255, 255, 232) /* COLOR_APPWORKSPACE */,
|
|
||||||
RGB(224, 224, 224) /* COLOR_HILIGHT */,
|
|
||||||
RGB(0, 0, 128) /* COLOR_HILIGHTTEXT */,
|
|
||||||
RGB(192, 192, 192) /* COLOR_BTNFACE */,
|
|
||||||
RGB(128, 128, 128) /* COLOR_BTNSHADOW */,
|
|
||||||
RGB(192, 192, 192) /* COLOR_GRAYTEXT */,
|
|
||||||
RGB(0, 0, 0) /* COLOR_BTNTEXT */,
|
|
||||||
RGB(192, 192, 192) /* COLOR_INACTIVECAPTIONTEXT */,
|
|
||||||
RGB(255, 255, 255) /* COLOR_BTNHILIGHT */,
|
|
||||||
RGB(32, 32, 32) /* COLOR_3DDKSHADOW */,
|
|
||||||
RGB(192, 192, 192) /* COLOR_3DLIGHT */,
|
|
||||||
RGB(0, 0, 0) /* COLOR_INFOTEXT */,
|
|
||||||
RGB(255, 255, 192) /* COLOR_INFOBK */,
|
|
||||||
RGB(184, 180, 184) /* COLOR_ALTERNATEBTNFACE */,
|
|
||||||
RGB(0, 0, 255) /* COLOR_HOTLIGHT */,
|
|
||||||
RGB(16, 132, 208) /* COLOR_GRADIENTACTIVECAPTION */,
|
|
||||||
RGB(181, 181, 181) /* COLOR_GRADIENTINACTIVECAPTION */,
|
|
||||||
};
|
|
||||||
|
|
||||||
HBRUSH STDCALL NtGdiGetSysColorBrush(int nIndex)
|
|
||||||
{
|
|
||||||
static HBRUSH SysBrushes[sizeof(SysColours) / sizeof(SysColours[0])];
|
|
||||||
|
|
||||||
if (nIndex < 0 || sizeof(SysColours) / sizeof(SysColours[0]) < nIndex)
|
|
||||||
{
|
|
||||||
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* FIXME Should be changed when a new user logs in? */
|
|
||||||
if (NULL == SysBrushes[nIndex])
|
|
||||||
{
|
|
||||||
SysBrushes[nIndex] = (HBRUSH) ((DWORD)NtGdiCreateSolidBrush(SysColours[nIndex]));
|
|
||||||
if (NULL != SysBrushes[nIndex])
|
|
||||||
{
|
|
||||||
GDIOBJ_SetOwnership(SysBrushes[nIndex], NULL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return SysBrushes[nIndex];
|
|
||||||
}
|
|
||||||
|
|
||||||
const PALETTEENTRY* FASTCALL COLOR_GetSystemPaletteTemplate(void)
|
const PALETTEENTRY* FASTCALL COLOR_GetSystemPaletteTemplate(void)
|
||||||
{
|
{
|
||||||
return (const PALETTEENTRY*)&COLOR_sysPalTemplate;
|
return (const PALETTEENTRY*)&COLOR_sysPalTemplate;
|
||||||
|
|
Loading…
Reference in a new issue