Author: gadamopoulos
Date: Fri May 19 08:45:49 2017
New Revision: 74587
URL:
http://svn.reactos.org/svn/reactos?rev=74587&view=rev
Log:
[UXTHEME] -Rename WND_CONTEXT to WND_DATA to avoid confusion with the DRAW_CONTEXT. The
WND_DATA is information valid throughout the life of a window and DRAW_CONTEXT is
information throughout a draw operation in the non client area of the window.
Modified:
trunk/reactos/dll/win32/uxtheme/ncscrollbar.c
trunk/reactos/dll/win32/uxtheme/nonclient.c
trunk/reactos/dll/win32/uxtheme/themehooks.c
trunk/reactos/dll/win32/uxtheme/uxthemep.h
Modified: trunk/reactos/dll/win32/uxtheme/ncscrollbar.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/uxtheme/ncscroll…
==============================================================================
--- trunk/reactos/dll/win32/uxtheme/ncscrollbar.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/uxtheme/ncscrollbar.c [iso-8859-1] Fri May 19 08:45:49 2017
@@ -239,9 +239,9 @@
}
}
-static void SCROLL_DrawMovingThumb(PWND_CONTEXT pwndContext, PDRAW_CONTEXT pcontext,
SCROLLBARINFO* psbi, BOOL vertical)
-{
- INT pos = pwndContext->SCROLL_TrackingPos;
+static void SCROLL_DrawMovingThumb(PWND_DATA pwndData, PDRAW_CONTEXT pcontext,
SCROLLBARINFO* psbi, BOOL vertical)
+{
+ INT pos = pwndData->SCROLL_TrackingPos;
INT max_size;
if( vertical )
@@ -258,7 +258,7 @@
SCROLL_DrawInterior(pcontext, psbi, pos, vertical, SCROLL_THUMB, 0);
- pwndContext->SCROLL_MovingThumb = !pwndContext->SCROLL_MovingThumb;
+ pwndData->SCROLL_MovingThumb = !pwndData->SCROLL_MovingThumb;
}
@@ -269,15 +269,15 @@
SCROLLBARINFO sbi;
BOOL vertical;
enum SCROLL_HITTEST htHot = SCROLL_NOWHERE;
- PWND_CONTEXT pwndContext;
+ PWND_DATA pwndData;
if (((nBar == SB_VERT) && !(pcontext->wi.dwStyle & WS_VSCROLL)) ||
((nBar == SB_HORZ) && !(pcontext->wi.dwStyle & WS_HSCROLL)))
return;
- if (!(pwndContext = ThemeGetWndContext(pcontext->hWnd)))
+ if (!(pwndData = ThemeGetWndData(pcontext->hWnd)))
return;
- if (pwndContext->SCROLL_TrackingWin)
+ if (pwndData->SCROLL_TrackingWin)
return;
/* Retrieve scrollbar info */
@@ -371,7 +371,7 @@
}
static void
-SCROLL_HandleScrollEvent(PWND_CONTEXT pwndContext, HWND hwnd, INT nBar, UINT msg, POINT
pt)
+SCROLL_HandleScrollEvent(PWND_DATA pwndData, HWND hwnd, INT nBar, UINT msg, POINT pt)
{
/* Previous mouse position for timer events */
static POINT prevPt;
@@ -401,7 +401,7 @@
return;
}
- if ((pwndContext->SCROLL_trackHitTest == SCROLL_NOWHERE) && (msg !=
WM_LBUTTONDOWN))
+ if ((pwndData->SCROLL_trackHitTest == SCROLL_NOWHERE) && (msg !=
WM_LBUTTONDOWN))
return;
ThemeInitDrawContext(&context, hwnd, 0);
@@ -416,8 +416,8 @@
{
case WM_LBUTTONDOWN: /* Initialise mouse tracking */
HideCaret(hwnd); /* hide caret while holding down LBUTTON */
- pwndContext->SCROLL_trackVertical = vertical;
- pwndContext->SCROLL_trackHitTest = hittest = SCROLL_HitTest( hwnd,
&sbi, vertical, pt, FALSE );
+ pwndData->SCROLL_trackVertical = vertical;
+ pwndData->SCROLL_trackHitTest = hittest = SCROLL_HitTest( hwnd, &sbi,
vertical, pt, FALSE );
lastClickPos = vertical ? (pt.y - sbi.rcScrollBar.top) : (pt.x -
sbi.rcScrollBar.left);
lastMousePos = lastClickPos;
trackThumbPos = sbi.xyThumbTop;
@@ -450,15 +450,15 @@
//TRACE("Event: hwnd=%p bar=%d msg=%s pt=%d,%d hit=%d\n",
// hwnd, nBar, SPY_GetMsgName(msg,hwnd), pt.x, pt.y, hittest );
- switch(pwndContext->SCROLL_trackHitTest)
+ switch(pwndData->SCROLL_trackHitTest)
{
case SCROLL_NOWHERE: /* No tracking in progress */
break;
case SCROLL_TOP_ARROW:
- if (hittest == pwndContext->SCROLL_trackHitTest)
- {
- SCROLL_DrawArrows( &context, &sbi, vertical,
pwndContext->SCROLL_trackHitTest, 0 );
+ if (hittest == pwndData->SCROLL_trackHitTest)
+ {
+ SCROLL_DrawArrows( &context, &sbi, vertical,
pwndData->SCROLL_trackHitTest, 0 );
if ((msg == WM_LBUTTONDOWN) || (msg == WM_SYSTIMER))
{
SendMessageW( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
@@ -477,8 +477,8 @@
break;
case SCROLL_TOP_RECT:
- SCROLL_DrawInterior( &context, &sbi, sbi.xyThumbTop, vertical,
pwndContext->SCROLL_trackHitTest, 0);
- if (hittest == pwndContext->SCROLL_trackHitTest)
+ SCROLL_DrawInterior( &context, &sbi, sbi.xyThumbTop, vertical,
pwndData->SCROLL_trackHitTest, 0);
+ if (hittest == pwndData->SCROLL_trackHitTest)
{
if ((msg == WM_LBUTTONDOWN) || (msg == WM_SYSTIMER))
{
@@ -494,20 +494,20 @@
case SCROLL_THUMB:
if (msg == WM_LBUTTONDOWN)
{
- pwndContext->SCROLL_TrackingWin = hwnd;
- pwndContext->SCROLL_TrackingBar = nBar;
- pwndContext->SCROLL_TrackingPos = trackThumbPos + lastMousePos -
lastClickPos;
- pwndContext->SCROLL_TrackingVal = SCROLL_GetThumbVal( &si,
&sbi.rcScrollBar,
- vertical,
pwndContext->SCROLL_TrackingPos );
- if (!pwndContext->SCROLL_MovingThumb)
- SCROLL_DrawMovingThumb(pwndContext, &context, &sbi, vertical);
+ pwndData->SCROLL_TrackingWin = hwnd;
+ pwndData->SCROLL_TrackingBar = nBar;
+ pwndData->SCROLL_TrackingPos = trackThumbPos + lastMousePos -
lastClickPos;
+ pwndData->SCROLL_TrackingVal = SCROLL_GetThumbVal( &si,
&sbi.rcScrollBar,
+ vertical,
pwndData->SCROLL_TrackingPos );
+ if (!pwndData->SCROLL_MovingThumb)
+ SCROLL_DrawMovingThumb(pwndData, &context, &sbi, vertical);
}
else if (msg == WM_LBUTTONUP)
{
- if (pwndContext->SCROLL_MovingThumb)
- SCROLL_DrawMovingThumb(pwndContext, &context, &sbi, vertical);
-
- SCROLL_DrawInterior( &context, &sbi, sbi.xyThumbTop, vertical, 0,
pwndContext->SCROLL_trackHitTest );
+ if (pwndData->SCROLL_MovingThumb)
+ SCROLL_DrawMovingThumb(pwndData, &context, &sbi, vertical);
+
+ SCROLL_DrawInterior( &context, &sbi, sbi.xyThumbTop, vertical, 0,
pwndData->SCROLL_trackHitTest );
}
else /* WM_MOUSEMOVE */
{
@@ -520,28 +520,28 @@
pt = SCROLL_ClipPos( &sbi.rcScrollBar, pt );
pos = vertical ? (pt.y - sbi.rcScrollBar.top) : (pt.x -
sbi.rcScrollBar.left);
}
- if ( (pos != lastMousePos) || (!pwndContext->SCROLL_MovingThumb) )
+ if ( (pos != lastMousePos) || (!pwndData->SCROLL_MovingThumb) )
{
- if (pwndContext->SCROLL_MovingThumb)
- SCROLL_DrawMovingThumb(pwndContext, &context, &sbi,
vertical);
+ if (pwndData->SCROLL_MovingThumb)
+ SCROLL_DrawMovingThumb(pwndData, &context, &sbi, vertical);
lastMousePos = pos;
- pwndContext->SCROLL_TrackingPos = trackThumbPos + pos - lastClickPos;
- pwndContext->SCROLL_TrackingVal = SCROLL_GetThumbVal( &si,
&sbi.rcScrollBar,
+ pwndData->SCROLL_TrackingPos = trackThumbPos + pos - lastClickPos;
+ pwndData->SCROLL_TrackingVal = SCROLL_GetThumbVal( &si,
&sbi.rcScrollBar,
vertical,
-
pwndContext->SCROLL_TrackingPos );
+ pwndData->SCROLL_TrackingPos
);
SendMessageW( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
- MAKEWPARAM( SB_THUMBTRACK,
pwndContext->SCROLL_TrackingVal),
+ MAKEWPARAM( SB_THUMBTRACK,
pwndData->SCROLL_TrackingVal),
(LPARAM)hwndCtl );
- if (!pwndContext->SCROLL_MovingThumb)
- SCROLL_DrawMovingThumb(pwndContext, &context, &sbi,
vertical);
+ if (!pwndData->SCROLL_MovingThumb)
+ SCROLL_DrawMovingThumb(pwndData, &context, &sbi, vertical);
}
}
break;
case SCROLL_BOTTOM_RECT:
- if (hittest == pwndContext->SCROLL_trackHitTest)
- {
- SCROLL_DrawInterior( &context, &sbi, sbi.xyThumbTop, vertical,
pwndContext->SCROLL_trackHitTest, 0 );
+ if (hittest == pwndData->SCROLL_trackHitTest)
+ {
+ SCROLL_DrawInterior( &context, &sbi, sbi.xyThumbTop, vertical,
pwndData->SCROLL_trackHitTest, 0 );
if ((msg == WM_LBUTTONDOWN) || (msg == WM_SYSTIMER))
{
SendMessageW( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
@@ -558,9 +558,9 @@
break;
case SCROLL_BOTTOM_ARROW:
- if (hittest == pwndContext->SCROLL_trackHitTest)
- {
- SCROLL_DrawArrows( &context, &sbi, vertical,
pwndContext->SCROLL_trackHitTest, 0 );
+ if (hittest == pwndData->SCROLL_trackHitTest)
+ {
+ SCROLL_DrawArrows( &context, &sbi, vertical,
pwndData->SCROLL_trackHitTest, 0 );
if ((msg == WM_LBUTTONDOWN) || (msg == WM_SYSTIMER))
{
SendMessageW( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
@@ -592,8 +592,8 @@
if (msg == WM_LBUTTONUP)
{
- hittest = pwndContext->SCROLL_trackHitTest;
- pwndContext->SCROLL_trackHitTest = SCROLL_NOWHERE; /* Terminate tracking */
+ hittest = pwndData->SCROLL_trackHitTest;
+ pwndData->SCROLL_trackHitTest = SCROLL_NOWHERE; /* Terminate tracking */
if (hittest == SCROLL_THUMB)
{
@@ -607,7 +607,7 @@
SB_ENDSCROLL, (LPARAM)hwndCtl );
/* Terminate tracking */
- pwndContext->SCROLL_TrackingWin = 0;
+ pwndData->SCROLL_TrackingWin = 0;
}
ThemeCleanupDrawContext(&context);
@@ -617,13 +617,13 @@
SCROLL_TrackScrollBar( HWND hwnd, INT scrollbar, POINT pt )
{
MSG msg;
- PWND_CONTEXT pwndContext = ThemeGetWndContext(hwnd);
- if(!pwndContext)
+ PWND_DATA pwndData = ThemeGetWndData(hwnd);
+ if(!pwndData)
return;
ScreenToWindow(hwnd, &pt);
- SCROLL_HandleScrollEvent(pwndContext, hwnd, scrollbar, WM_LBUTTONDOWN, pt );
+ SCROLL_HandleScrollEvent(pwndData, hwnd, scrollbar, WM_LBUTTONDOWN, pt );
do
{
@@ -637,7 +637,7 @@
pt.y = GET_Y_LPARAM(msg.lParam);
ClientToScreen(hwnd, &pt);
ScreenToWindow(hwnd, &pt);
- SCROLL_HandleScrollEvent(pwndContext, hwnd, scrollbar, msg.message, pt );
+ SCROLL_HandleScrollEvent(pwndData, hwnd, scrollbar, msg.message, pt );
}
else
{
Modified: trunk/reactos/dll/win32/uxtheme/nonclient.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/uxtheme/nonclien…
==============================================================================
--- trunk/reactos/dll/win32/uxtheme/nonclient.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/uxtheme/nonclient.c [iso-8859-1] Fri May 19 08:45:49 2017
@@ -596,7 +596,7 @@
DRAW_CONTEXT context;
TRACKMOUSEEVENT tme;
DWORD style;
- PWND_CONTEXT pcontext;
+ PWND_DATA pwndData;
/* First of all check if we have something to do here */
style = GetWindowLongW(hWnd, GWL_STYLE);
@@ -604,8 +604,8 @@
return 0;
/* Get theme data for this window */
- pcontext = ThemeGetWndContext(hWnd);
- if (pcontext == NULL)
+ pwndData = ThemeGetWndData(hWnd);
+ if (pwndData == NULL)
return 0;
/* Begin tracking in the non client area if we are not tracking yet */
@@ -623,24 +623,24 @@
ThemeInitDrawContext(&context, hWnd, 0);
if (context.wi.dwStyle & WS_SYSMENU)
{
- if (HT_ISBUTTON(ht) || HT_ISBUTTON(pcontext->lastHitTest))
+ if (HT_ISBUTTON(ht) || HT_ISBUTTON(pwndData->lastHitTest))
ThemeDrawCaptionButtons(&context, ht, 0);
}
if (context.wi.dwStyle & WS_HSCROLL)
{
- if (ht == HTHSCROLL || pcontext->lastHitTest == HTHSCROLL)
+ if (ht == HTHSCROLL || pwndData->lastHitTest == HTHSCROLL)
ThemeDrawScrollBar(&context, SB_HORZ , ht == HTHSCROLL ? pt : NULL);
}
if (context.wi.dwStyle & WS_VSCROLL)
{
- if (ht == HTVSCROLL || pcontext->lastHitTest == HTVSCROLL)
+ if (ht == HTVSCROLL || pwndData->lastHitTest == HTVSCROLL)
ThemeDrawScrollBar(&context, SB_VERT, ht == HTVSCROLL ? pt : NULL);
}
ThemeCleanupDrawContext(&context);
- pcontext->lastHitTest = ht;
+ pwndData->lastHitTest = ht;
return 0;
}
@@ -650,7 +650,7 @@
{
DRAW_CONTEXT context;
DWORD style;
- PWND_CONTEXT pWndContext;
+ PWND_DATA pwndData;
/* First of all check if we have something to do here */
style = GetWindowLongW(hWnd, GWL_STYLE);
@@ -658,23 +658,23 @@
return 0;
/* Get theme data for this window */
- pWndContext = ThemeGetWndContext(hWnd);
- if (pWndContext == NULL)
+ pwndData = ThemeGetWndData(hWnd);
+ if (pwndData == NULL)
return 0;
ThemeInitDrawContext(&context, hWnd, 0);
- if (context.wi.dwStyle & WS_SYSMENU &&
HT_ISBUTTON(pWndContext->lastHitTest))
+ if (context.wi.dwStyle & WS_SYSMENU &&
HT_ISBUTTON(pwndData->lastHitTest))
ThemeDrawCaptionButtons(&context, 0, 0);
- if (context.wi.dwStyle & WS_HSCROLL && pWndContext->lastHitTest ==
HTHSCROLL)
+ if (context.wi.dwStyle & WS_HSCROLL && pwndData->lastHitTest ==
HTHSCROLL)
ThemeDrawScrollBar(&context, SB_HORZ, NULL);
- if (context.wi.dwStyle & WS_VSCROLL && pWndContext->lastHitTest ==
HTVSCROLL)
+ if (context.wi.dwStyle & WS_VSCROLL && pwndData->lastHitTest ==
HTVSCROLL)
ThemeDrawScrollBar(&context, SB_VERT, NULL);
ThemeCleanupDrawContext(&context);
- pWndContext->lastHitTest = HTNOWHERE;
+ pwndData->lastHitTest = HTNOWHERE;
return 0;
}
@@ -687,7 +687,7 @@
WPARAM SCMsg, ht;
ULONG Style;
DRAW_CONTEXT context;
- PWND_CONTEXT pWndContext;
+ PWND_DATA pwndData;
Style = GetWindowLongW(hWnd, GWL_STYLE);
if (!((Style & WS_CAPTION) && (Style & WS_SYSMENU)))
@@ -713,13 +713,13 @@
}
/* Get theme data for this window */
- pWndContext = ThemeGetWndContext(hWnd);
- if (pWndContext == NULL)
+ pwndData = ThemeGetWndData(hWnd);
+ if (pwndData == NULL)
return;
ThemeInitDrawContext(&context, hWnd, 0);
ThemeDrawCaptionButtons(&context, 0, wParam);
- pWndContext->lastHitTest = wParam;
+ pwndData->lastHitTest = wParam;
SetCapture(hWnd);
@@ -740,11 +740,11 @@
Pressed = (ht == wParam);
/* Only draw the buttons if the hit test changed */
- if (ht != pWndContext->lastHitTest &&
- (HT_ISBUTTON(ht) || HT_ISBUTTON(pWndContext->lastHitTest)))
+ if (ht != pwndData->lastHitTest &&
+ (HT_ISBUTTON(ht) || HT_ISBUTTON(pwndData->lastHitTest)))
{
ThemeDrawCaptionButtons(&context, 0, Pressed ? wParam: 0);
- pWndContext->lastHitTest = ht;
+ pwndData->lastHitTest = ht;
}
}
Modified: trunk/reactos/dll/win32/uxtheme/themehooks.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/uxtheme/themehoo…
==============================================================================
--- trunk/reactos/dll/win32/uxtheme/themehooks.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/uxtheme/themehooks.c [iso-8859-1] Fri May 19 08:45:49 2017
@@ -14,72 +14,72 @@
BYTE gabDLGPmessages[UAHOWP_MAX_SIZE];
BOOL gbThemeHooksActive = FALSE;
-PWND_CONTEXT ThemeGetWndContext(HWND hWnd)
-{
- PWND_CONTEXT pcontext;
-
- pcontext = (PWND_CONTEXT)GetPropW(hWnd, (LPCWSTR)MAKEINTATOM(atWndContext));
- if(pcontext == NULL)
- {
- pcontext = HeapAlloc(GetProcessHeap(),
+PWND_DATA ThemeGetWndData(HWND hWnd)
+{
+ PWND_DATA pwndData;
+
+ pwndData = (PWND_DATA)GetPropW(hWnd, (LPCWSTR)MAKEINTATOM(atWndContext));
+ if(pwndData == NULL)
+ {
+ pwndData = HeapAlloc(GetProcessHeap(),
HEAP_ZERO_MEMORY,
- sizeof(WND_CONTEXT));
- if(pcontext == NULL)
+ sizeof(WND_DATA));
+ if(pwndData == NULL)
{
return NULL;
}
- SetPropW( hWnd, (LPCWSTR)MAKEINTATOM(atWndContext), pcontext);
- }
-
- return pcontext;
-}
-
-void ThemeDestroyWndContext(HWND hWnd)
-{
- PWND_CONTEXT pContext;
+ SetPropW( hWnd, (LPCWSTR)MAKEINTATOM(atWndContext), pwndData);
+ }
+
+ return pwndData;
+}
+
+void ThemeDestroyWndData(HWND hWnd)
+{
+ PWND_DATA pwndData;
DWORD ProcessId;
- /*Do not destroy WND_CONTEXT of a window that belong to another process */
+ /*Do not destroy WND_DATA of a window that belong to another process */
GetWindowThreadProcessId(hWnd, &ProcessId);
if(ProcessId != GetCurrentProcessId())
{
return;
}
- pContext = (PWND_CONTEXT)GetPropW(hWnd, (LPCWSTR)MAKEINTATOM(atWndContext));
- if(pContext == NULL)
+ pwndData = (PWND_DATA)GetPropW(hWnd, (LPCWSTR)MAKEINTATOM(atWndContext));
+ if(pwndData == NULL)
{
return;
}
- if(pContext->HasThemeRgn)
+ if(pwndData->HasThemeRgn)
{
user32ApiHook.SetWindowRgn(hWnd, 0, TRUE);
}
- if (pContext->hTabBackgroundBrush != NULL)
+ if (pwndData->hTabBackgroundBrush != NULL)
{
CloseThemeData(GetWindowTheme(hWnd));
- DeleteObject(pContext->hTabBackgroundBrush);
- pContext->hTabBackgroundBrush = NULL;
- }
-
- if (pContext->hTabBackgroundBmp != NULL)
- {
- DeleteObject(pContext->hTabBackgroundBmp);
- pContext->hTabBackgroundBmp = NULL;
- }
-
- HeapFree(GetProcessHeap(), 0, pContext);
+ DeleteObject(pwndData->hTabBackgroundBrush);
+ pwndData->hTabBackgroundBrush = NULL;
+ }
+
+ if (pwndData->hTabBackgroundBmp != NULL)
+ {
+ DeleteObject(pwndData->hTabBackgroundBmp);
+ pwndData->hTabBackgroundBmp = NULL;
+ }
+
+ HeapFree(GetProcessHeap(), 0, pwndData);
SetPropW( hWnd, (LPCWSTR)MAKEINTATOM(atWndContext), NULL);
}
static BOOL CALLBACK ThemeCleanupChildWndContext (HWND hWnd, LPARAM msg)
{
- ThemeDestroyWndContext(hWnd);
+ ThemeDestroyWndData(hWnd);
return TRUE;
}
@@ -91,7 +91,7 @@
}
else
{
- ThemeDestroyWndContext(hWnd);
+ ThemeDestroyWndData(hWnd);
EnumChildWindows (hWnd, ThemeCleanupChildWndContext, 0);
}
@@ -150,7 +150,7 @@
int OnPostWinPosChanged(HWND hWnd, WINDOWPOS* pWinPos)
{
- PWND_CONTEXT pcontext;
+ PWND_DATA pwndData;
DWORD style;
/* We only proceed to change the window shape if it has a caption */
@@ -159,37 +159,37 @@
return 0;
/* Get theme data for this window */
- pcontext = ThemeGetWndContext(hWnd);
- if (pcontext == NULL)
+ pwndData = ThemeGetWndData(hWnd);
+ if (pwndData == NULL)
return 0;
/* Do not change the region of the window if its size wasn't changed */
- if ((pWinPos->flags & SWP_NOSIZE) != 0 &&
pcontext->DirtyThemeRegion == FALSE)
+ if ((pWinPos->flags & SWP_NOSIZE) != 0 &&
pwndData->DirtyThemeRegion == FALSE)
return 0;
/* We don't touch the shape of the window if the application sets it on its own
*/
- if (pcontext->HasAppDefinedRgn == TRUE)
+ if (pwndData->HasAppDefinedRgn == TRUE)
return 0;
/* Calling SetWindowRgn will call SetWindowPos again so we need to avoid this
recursion */
- if (pcontext->UpdatingRgn == TRUE)
+ if (pwndData->UpdatingRgn == TRUE)
return 0;
if(!IsAppThemed())
{
- if(pcontext->HasThemeRgn)
- {
- pcontext->HasThemeRgn = FALSE;
+ if(pwndData->HasThemeRgn)
+ {
+ pwndData->HasThemeRgn = FALSE;
user32ApiHook.SetWindowRgn(hWnd, 0, TRUE);
}
return 0;
}
- pcontext->DirtyThemeRegion = FALSE;
- pcontext->HasThemeRgn = TRUE;
- pcontext->UpdatingRgn = TRUE;
+ pwndData->DirtyThemeRegion = FALSE;
+ pwndData->HasThemeRgn = TRUE;
+ pwndData->UpdatingRgn = TRUE;
SetThemeRegion(hWnd);
- pcontext->UpdatingRgn = FALSE;
+ pwndData->UpdatingRgn = FALSE;
return 0;
}
@@ -241,32 +241,32 @@
{
case WM_THEMECHANGED:
{
- PWND_CONTEXT pcontext = ThemeGetWndContext(hWnd);
+ PWND_DATA pwndData = ThemeGetWndData(hWnd);
if (GetAncestor(hWnd, GA_PARENT) == GetDesktopWindow())
UXTHEME_LoadTheme(TRUE);
- if (pcontext == NULL)
+ if (pwndData == NULL)
return 0;
- if (pcontext->hTabBackgroundBrush != NULL)
+ if (pwndData->hTabBackgroundBrush != NULL)
{
- DeleteObject(pcontext->hTabBackgroundBrush);
- pcontext->hTabBackgroundBrush = NULL;
+ DeleteObject(pwndData->hTabBackgroundBrush);
+ pwndData->hTabBackgroundBrush = NULL;
}
- if (pcontext->hTabBackgroundBmp != NULL)
+ if (pwndData->hTabBackgroundBmp != NULL)
{
- DeleteObject(pcontext->hTabBackgroundBmp);
- pcontext->hTabBackgroundBmp = NULL;
+ DeleteObject(pwndData->hTabBackgroundBmp);
+ pwndData->hTabBackgroundBmp = NULL;
}
}
case WM_NCCREATE:
{
- PWND_CONTEXT pcontext = ThemeGetWndContext(hWnd);
- if (pcontext == NULL)
+ PWND_DATA pwndData = ThemeGetWndData(hWnd);
+ if (pwndData == NULL)
return 0;
- pcontext->DirtyThemeRegion = TRUE;
+ pwndData->DirtyThemeRegion = TRUE;
}
}
@@ -285,7 +285,7 @@
}
case WM_NCDESTROY:
{
- ThemeDestroyWndContext(hWnd);
+ ThemeDestroyWndData(hWnd);
return 0;
}
}
@@ -295,13 +295,13 @@
HRESULT GetDiaogTextureBrush(HTHEME theme, HWND hwnd, HDC hdc, HBRUSH* result, BOOL
changeOrigin)
{
- PWND_CONTEXT pcontext;
-
- pcontext = ThemeGetWndContext(hwnd);
- if (pcontext == NULL)
+ PWND_DATA pwndData;
+
+ pwndData = ThemeGetWndData(hwnd);
+ if (pwndData == NULL)
return E_FAIL;
- if (pcontext->hTabBackgroundBrush == NULL)
+ if (pwndData->hTabBackgroundBrush == NULL)
{
HBITMAP hbmp;
RECT dummy, bmpRect;
@@ -337,18 +337,18 @@
DeleteDC(hdcHackPattern);
/* Keep the handle of the bitmap we created so that it can be used later */
- pcontext->hTabBackgroundBmp = hbmpHack;
+ pwndData->hTabBackgroundBmp = hbmpHack;
hbmp = hbmpHack;
}
/* hbmp is cached so there is no need to free it */
- pcontext->hTabBackgroundBrush = CreatePatternBrush(hbmp);
- }
-
- if (!pcontext->hTabBackgroundBrush)
+ pwndData->hTabBackgroundBrush = CreatePatternBrush(hbmp);
+ }
+
+ if (!pwndData->hTabBackgroundBrush)
return E_FAIL;
- *result = pcontext->hTabBackgroundBrush;
+ *result = pwndData->hTabBackgroundBrush;
return S_OK;
}
@@ -417,11 +417,11 @@
int WINAPI ThemeSetWindowRgn(HWND hWnd, HRGN hRgn, BOOL bRedraw)
{
- PWND_CONTEXT pcontext = ThemeGetWndContext(hWnd);
- if(pcontext)
- {
- pcontext->HasAppDefinedRgn = TRUE;
- pcontext->HasThemeRgn = FALSE;
+ PWND_DATA pwndData = ThemeGetWndData(hWnd);
+ if(pwndData)
+ {
+ pwndData->HasAppDefinedRgn = TRUE;
+ pwndData->HasThemeRgn = FALSE;
}
return user32ApiHook.SetWindowRgn(hWnd, hRgn, bRedraw);
@@ -429,7 +429,7 @@
BOOL WINAPI ThemeGetScrollInfo(HWND hwnd, int fnBar, LPSCROLLINFO lpsi)
{
- PWND_CONTEXT pwndContext;
+ PWND_DATA pwndData;
DWORD style;
BOOL ret;
@@ -441,8 +441,8 @@
if((style & (WS_HSCROLL|WS_VSCROLL))==0)
goto dodefault;
- pwndContext = ThemeGetWndContext(hwnd);
- if (pwndContext == NULL)
+ pwndData = ThemeGetWndData(hwnd);
+ if (pwndData == NULL)
goto dodefault;
/*
@@ -454,10 +454,10 @@
ret = user32ApiHook.GetScrollInfo(hwnd, fnBar, lpsi);
if ( lpsi &&
(lpsi->fMask & SIF_TRACKPOS) &&
- pwndContext->SCROLL_TrackingWin == hwnd &&
- pwndContext->SCROLL_TrackingBar == fnBar)
- {
- lpsi->nTrackPos = pwndContext->SCROLL_TrackingVal;
+ pwndData->SCROLL_TrackingWin == hwnd &&
+ pwndData->SCROLL_TrackingBar == fnBar)
+ {
+ lpsi->nTrackPos = pwndData->SCROLL_TrackingVal;
}
return ret;
Modified: trunk/reactos/dll/win32/uxtheme/uxthemep.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/uxtheme/uxthemep…
==============================================================================
--- trunk/reactos/dll/win32/uxtheme/uxthemep.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/uxtheme/uxthemep.h [iso-8859-1] Fri May 19 08:45:49 2017
@@ -134,7 +134,7 @@
};
/* The window context stores data for the window needed through the life of the window
*/
-typedef struct _WND_CONTEXT
+typedef struct _WND_DATA
{
UINT lastHitTest;
BOOL HasAppDefinedRgn;
@@ -151,7 +151,7 @@
INT SCROLL_TrackingBar;
INT SCROLL_TrackingPos;
INT SCROLL_TrackingVal;
-} WND_CONTEXT, *PWND_CONTEXT;
+} WND_DATA, *PWND_DATA;
/* The draw context stores data that are needed by the drawing operations in the non
client area of the window */
typedef struct _DRAW_CONTEXT
@@ -228,7 +228,7 @@
VOID NC_TrackScrollBar(HWND Wnd, WPARAM wParam, POINT Pt);
void ThemeInitDrawContext(PDRAW_CONTEXT pcontext, HWND hWnd, HRGN hRgn);
void ThemeCleanupDrawContext(PDRAW_CONTEXT pcontext);
-PWND_CONTEXT ThemeGetWndContext(HWND hWnd);
+PWND_DATA ThemeGetWndData(HWND hWnd);
extern HINSTANCE hDllInst;
extern ATOM atWindowTheme;