Author: tkreuzer
Date: Sat Apr 7 02:50:19 2007
New Revision: 26272
URL:
http://svn.reactos.org/svn/reactos?rev=26272&view=rev
Log:
IntSetSysColors: update SysColorBrushes and Pens and broadcast WM_SYCOLORCHANGE message.
Now you can change colors with desk.cpl
Modified:
trunk/reactos/subsystems/win32/win32k/include/intgdi.h
trunk/reactos/subsystems/win32/win32k/objects/brush.c
trunk/reactos/subsystems/win32/win32k/objects/pen.c
trunk/reactos/subsystems/win32/win32k/objects/stockobj.c
Modified: trunk/reactos/subsystems/win32/win32k/include/intgdi.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/intgdi.h (original)
+++ trunk/reactos/subsystems/win32/win32k/include/intgdi.h Sat Apr 7 02:50:19 2007
@@ -44,10 +44,16 @@
DWORD ROP,
PGDIBRUSHOBJ BrushObj);
+VOID FASTCALL
+IntGdiSetSolidBrushColor(HBRUSH hBrush, COLORREF Color);
+
/* Pen functions */
HPEN FASTCALL
IntGdiCreatePenIndirect(PLOGPEN lgpn);
+
+VOID FASTCALL
+IntGdiSetSolidPenColor(HPEN hPen, COLORREF Color);
/* Line functions */
Modified: trunk/reactos/subsystems/win32/win32k/objects/brush.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/brush.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/brush.c Sat Apr 7 02:50:19 2007
@@ -847,4 +847,17 @@
return ret;
}
+VOID FASTCALL
+IntGdiSetSolidBrushColor(HBRUSH hBrush, COLORREF Color)
+{
+ PGDIBRUSHOBJ BrushObject;
+
+ BrushObject = BRUSHOBJ_LockBrush(hBrush);
+ if (BrushObject->flAttrs & GDIBRUSH_IS_SOLID)
+ {
+ BrushObject->BrushAttr.lbColor = Color & 0xFFFFFF;
+ }
+ BRUSHOBJ_UnlockBrush(BrushObject);
+}
+
/* EOF */
Modified: trunk/reactos/subsystems/win32/win32k/objects/pen.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/pen.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/pen.c Sat Apr 7 02:50:19 2007
@@ -186,4 +186,17 @@
return IntGdiCreatePenIndirect(&LogPen);
}
+VOID FASTCALL
+IntGdiSetSolidPenColor(HPEN hPen, COLORREF Color)
+{
+ PGDIBRUSHOBJ PenObject;
+
+ PenObject = PENOBJ_LockPen(hPen);
+ if (PenObject->flAttrs & GDIBRUSH_IS_SOLID)
+ {
+ PenObject->BrushAttr.lbColor = Color & 0xFFFFFF;
+ }
+ PENOBJ_UnlockPen(PenObject);
+}
+
/* EOF */
Modified: trunk/reactos/subsystems/win32/win32k/objects/stockobj.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/stockobj.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/stockobj.c Sat Apr 7 02:50:19 2007
@@ -177,14 +177,16 @@
for(i = 0; i < nColors; i++)
{
- if((*Elements) >= 0 && (*Elements) < NUM_SYSCOLORS)
+ if((UINT)(*Elements) < NUM_SYSCOLORS)
{
SysColors[*Elements] = *Colors;
- /* FIXME - update the syscolor pens and brushes */
+ IntGdiSetSolidBrushColor(SysColorBrushes[*Elements], *Colors);
+ IntGdiSetSolidPenColor(SysColorPens[*Elements], *Colors);
}
Elements++;
Colors++;
}
+ UserPostMessage(HWND_BROADCAST, WM_SYSCOLORCHANGE, 0, 0);
return nColors > 0;
}
@@ -263,7 +265,7 @@
DWORD FASTCALL
IntGetSysColor(INT nIndex)
{
- return ((nIndex < 0) || (NUM_SYSCOLORS <= nIndex)) ? 0 : SysColors[nIndex];
+ return (NUM_SYSCOLORS <= (UINT)nIndex) ? 0 : SysColors[nIndex];
}
VOID FASTCALL