Author: gadamopoulos
Date: Wed Jun 7 08:28:14 2017
New Revision: 74934
URL:
http://svn.reactos.org/svn/reactos?rev=74934&view=rev
Log:
[UXTHEME] -Rename ActiveThemeFile to g_ActiveThemeFile, user32ApiHook to g_user32ApiHook
and gbThemeHooksActive to g_bThemeHooksActive.
Modified:
trunk/reactos/dll/win32/uxtheme/msstyles.c
trunk/reactos/dll/win32/uxtheme/system.c
trunk/reactos/dll/win32/uxtheme/themehooks.c
trunk/reactos/dll/win32/uxtheme/uxthemep.h
Modified: trunk/reactos/dll/win32/uxtheme/msstyles.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/uxtheme/msstyles…
==============================================================================
--- trunk/reactos/dll/win32/uxtheme/msstyles.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/uxtheme/msstyles.c [iso-8859-1] Wed Jun 7 08:28:14 2017
@@ -25,10 +25,6 @@
/***********************************************************************
* Defines and global variables
*/
-
-static BOOL MSSTYLES_GetNextInteger(LPCWSTR lpStringStart, LPCWSTR lpStringEnd, LPCWSTR
*lpValEnd, int *value);
-static BOOL MSSTYLES_GetNextToken(LPCWSTR lpStringStart, LPCWSTR lpStringEnd, LPCWSTR
*lpValEnd, LPWSTR lpBuff, DWORD buffSize);
-static HRESULT MSSTYLES_GetFont (LPCWSTR lpStringStart, LPCWSTR lpStringEnd, LPCWSTR
*lpValEnd, LOGFONTW* logfont);
extern int alphaBlendMode;
Modified: trunk/reactos/dll/win32/uxtheme/system.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/uxtheme/system.c…
==============================================================================
--- trunk/reactos/dll/win32/uxtheme/system.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/uxtheme/system.c [iso-8859-1] Wed Jun 7 08:28:14 2017
@@ -51,7 +51,7 @@
static ATOM atSubIdList;
ATOM atWndContext;
-PTHEME_FILE ActiveThemeFile;
+PTHEME_FILE g_ActiveThemeFile;
RTL_HANDLE_TABLE g_UxThemeHandleTable;
int g_cHandles;
@@ -131,44 +131,44 @@
static HRESULT UXTHEME_SetActiveTheme(PTHEME_FILE tf)
{
- if(ActiveThemeFile)
- MSSTYLES_CloseThemeFile(ActiveThemeFile);
- ActiveThemeFile = tf;
- if (ActiveThemeFile)
- {
- MSSTYLES_ReferenceTheme(ActiveThemeFile);
- MSSTYLES_ParseThemeIni(ActiveThemeFile);
+ if(g_ActiveThemeFile)
+ MSSTYLES_CloseThemeFile(g_ActiveThemeFile);
+ g_ActiveThemeFile = tf;
+ if (g_ActiveThemeFile)
+ {
+ MSSTYLES_ReferenceTheme(g_ActiveThemeFile);
+ MSSTYLES_ParseThemeIni(g_ActiveThemeFile);
}
return S_OK;
}
static BOOL bIsThemeActive(LPCWSTR pszTheme, LPCWSTR pszColor, LPCWSTR pszSize)
{
- if (ActiveThemeFile == NULL)
+ if (g_ActiveThemeFile == NULL)
return FALSE;
- if (wcscmp(pszTheme, ActiveThemeFile->szThemeFile) != 0)
+ if (wcscmp(pszTheme, g_ActiveThemeFile->szThemeFile) != 0)
return FALSE;
if (!pszColor[0])
{
- if (ActiveThemeFile->pszAvailColors != ActiveThemeFile->pszSelectedColor)
+ if (g_ActiveThemeFile->pszAvailColors !=
g_ActiveThemeFile->pszSelectedColor)
return FALSE;
}
else
{
- if (wcscmp(pszColor, ActiveThemeFile->pszSelectedColor) != 0)
+ if (wcscmp(pszColor, g_ActiveThemeFile->pszSelectedColor) != 0)
return FALSE;
}
if (!pszSize[0])
{
- if (ActiveThemeFile->pszAvailSizes != ActiveThemeFile->pszSelectedSize)
+ if (g_ActiveThemeFile->pszAvailSizes !=
g_ActiveThemeFile->pszSelectedSize)
return FALSE;
}
else
{
- if (wcscmp(pszSize, ActiveThemeFile->pszSelectedSize) != 0)
+ if (wcscmp(pszSize, g_ActiveThemeFile->pszSelectedSize) != 0)
return FALSE;
}
@@ -192,7 +192,7 @@
WCHAR szCurrentSize[64];
BOOL bThemeActive = FALSE;
- if(bLoad == TRUE && gbThemeHooksActive)
+ if(bLoad == TRUE && g_bThemeHooksActive)
{
/* Get current theme configuration */
if(!RegOpenKeyW(HKEY_CURRENT_USER, szThemeManager, &hKey)) {
@@ -517,7 +517,7 @@
TRACE("UXTHEME_ApplyTheme\n");
- if (tf && !ActiveThemeFile)
+ if (tf && !g_ActiveThemeFile)
{
UXTHEME_BackupSystemMetrics();
}
@@ -533,10 +533,10 @@
TRACE("Writing theme config to registry\n");
if(!RegCreateKeyW(HKEY_CURRENT_USER, szThemeManager, &hKey)) {
- tmp[0] = ActiveThemeFile?'1':'0';
+ tmp[0] = g_ActiveThemeFile ? '1' : '0';
tmp[1] = '\0';
RegSetValueExW(hKey, szThemeActive, 0, REG_SZ, (const BYTE*)tmp,
sizeof(WCHAR)*2);
- if (ActiveThemeFile) {
+ if (g_ActiveThemeFile) {
RegSetValueExW(hKey, szColorName, 0, REG_SZ, (const
BYTE*)tf->pszSelectedColor,
(lstrlenW(tf->pszSelectedColor)+1)*sizeof(WCHAR));
RegSetValueExW(hKey, szSizeName, 0, REG_SZ, (const
BYTE*)tf->pszSelectedSize,
@@ -597,7 +597,7 @@
{
TRACE("\n");
SetLastError(ERROR_SUCCESS);
- return (ActiveThemeFile != NULL);
+ return (g_ActiveThemeFile != NULL);
}
/***********************************************************************
@@ -614,10 +614,10 @@
TRACE("IsThemeActive\n");
SetLastError(ERROR_SUCCESS);
- if (ActiveThemeFile)
+ if (g_ActiveThemeFile)
return TRUE;
- if (gbThemeHooksActive)
+ if (g_bThemeHooksActive)
return FALSE;
bActive = FALSE;
@@ -646,7 +646,7 @@
TRACE("(%d)\n", fEnable);
- if (fEnable != (ActiveThemeFile != NULL)) {
+ if (fEnable != (g_ActiveThemeFile != NULL)) {
if(fEnable)
UXTHEME_BackupSystemMetrics();
else
@@ -718,7 +718,7 @@
{
PUXTHEME_HANDLE pHandle;
- if (!gbThemeHooksActive || !hTheme || hTheme == INVALID_HANDLE_VALUE)
+ if (!g_bThemeHooksActive || !hTheme || hTheme == INVALID_HANDLE_VALUE)
return NULL;
if (!RtlIsValidHandle(&g_UxThemeHandleTable, (PRTL_HANDLE_TABLE_ENTRY)hTheme))
@@ -806,7 +806,7 @@
*/
HTHEME WINAPI OpenThemeDataEx(HWND hwnd, LPCWSTR pszClassList, DWORD flags)
{
- return OpenThemeDataInternal(ActiveThemeFile, hwnd, pszClassList, flags);
+ return OpenThemeDataInternal(g_ActiveThemeFile, hwnd, pszClassList, flags);
}
/***********************************************************************
@@ -822,7 +822,7 @@
*/
HTHEME WINAPI OpenThemeData(HWND hwnd, LPCWSTR classlist)
{
- return OpenThemeDataInternal(ActiveThemeFile, hwnd, classlist, 0);
+ return OpenThemeDataInternal(g_ActiveThemeFile, hwnd, classlist, 0);
}
/***********************************************************************
@@ -885,31 +885,31 @@
{
int cchar;
- if(ActiveThemeFile == NULL)
+ if(g_ActiveThemeFile == NULL)
return E_PROP_ID_UNSUPPORTED;
if (pszThemeFileName && dwMaxNameChars)
{
- cchar = lstrlenW(ActiveThemeFile->szThemeFile) + 1;
+ cchar = lstrlenW(g_ActiveThemeFile->szThemeFile) + 1;
if(cchar > dwMaxNameChars)
return HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER);
- lstrcpynW(pszThemeFileName, ActiveThemeFile->szThemeFile, cchar);
+ lstrcpynW(pszThemeFileName, g_ActiveThemeFile->szThemeFile, cchar);
}
if (pszColorBuff && cchMaxColorChars)
{
- cchar = lstrlenW(ActiveThemeFile->pszSelectedColor) + 1;
+ cchar = lstrlenW(g_ActiveThemeFile->pszSelectedColor) + 1;
if(cchar > cchMaxColorChars)
return HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER);
- lstrcpynW(pszColorBuff, ActiveThemeFile->pszSelectedColor, cchar);
+ lstrcpynW(pszColorBuff, g_ActiveThemeFile->pszSelectedColor, cchar);
}
if (pszSizeBuff && cchMaxSizeChars)
{
- cchar = lstrlenW(ActiveThemeFile->pszSelectedSize) + 1;
+ cchar = lstrlenW(g_ActiveThemeFile->pszSelectedSize) + 1;
if(cchar > cchMaxSizeChars)
return HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER);
- lstrcpynW(pszSizeBuff, ActiveThemeFile->pszSelectedSize, cchar);
+ lstrcpynW(pszSizeBuff, g_ActiveThemeFile->pszSelectedSize, cchar);
}
return S_OK;
@@ -1018,7 +1018,7 @@
TRACE("(%s,%s,%p,%d)\n", debugstr_w(pszThemeName),
debugstr_w(pszPropertyName),
pszValueBuff, cchMaxValChars);
- if (!gbThemeHooksActive)
+ if (!g_bThemeHooksActive)
return E_FAIL;
hr = MSSTYLES_OpenThemeFile(pszThemeName, NULL, NULL, &pt);
@@ -1094,7 +1094,7 @@
debugstr_w(pszColorName), debugstr_w(pszSizeName),
hThemeFile, unknown);
- if (!gbThemeHooksActive)
+ if (!g_bThemeHooksActive)
return E_FAIL;
return MSSTYLES_OpenThemeFile(pszThemeFileName, pszColorName, pszSizeName,
(PTHEME_FILE*)hThemeFile);
@@ -1178,7 +1178,7 @@
pszColorName, dwColorNameLen,
pszSizeName, dwSizeNameLen);
- if (!gbThemeHooksActive)
+ if (!g_bThemeHooksActive)
return E_FAIL;
hr = MSSTYLES_OpenThemeFile(pszThemeFileName, NULL, NULL, &pt);
@@ -1299,7 +1299,7 @@
TRACE("(%s,%s,%d)\n", debugstr_w(pszThemeFileName),
debugstr_w(pszSizeName), dwColorNum);
- if (!gbThemeHooksActive)
+ if (!g_bThemeHooksActive)
return E_FAIL;
hr = MSSTYLES_OpenThemeFile(pszThemeFileName, NULL, pszSizeName, &pt);
@@ -1362,7 +1362,7 @@
TRACE("(%s,%s,%d)\n", debugstr_w(pszThemeFileName),
debugstr_w(pszColorName), dwSizeNum);
- if (!gbThemeHooksActive)
+ if (!g_bThemeHooksActive)
return E_FAIL;
hr = MSSTYLES_OpenThemeFile(pszThemeFileName, pszColorName, NULL, &pt);
@@ -1434,7 +1434,7 @@
HRESULT hr;
TRACE("(%s)\n", debugstr_w(pszThemeFileName));
- if (!gbThemeHooksActive)
+ if (!g_bThemeHooksActive)
return E_FAIL;
hr = MSSTYLES_OpenThemeFile(pszThemeFileName, NULL, NULL, &pt);
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] Wed Jun 7 08:28:14 2017
@@ -8,11 +8,11 @@
#include "uxthemep.h"
-USERAPIHOOK user32ApiHook;
+USERAPIHOOK g_user32ApiHook;
BYTE gabDWPmessages[UAHOWP_MAX_SIZE];
BYTE gabMSGPmessages[UAHOWP_MAX_SIZE];
BYTE gabDLGPmessages[UAHOWP_MAX_SIZE];
-BOOL gbThemeHooksActive = FALSE;
+BOOL g_bThemeHooksActive = FALSE;
PWND_DATA ThemeGetWndData(HWND hWnd)
{
@@ -55,7 +55,7 @@
if(pwndData->HasThemeRgn)
{
- user32ApiHook.SetWindowRgn(hWnd, 0, TRUE);
+ g_user32ApiHook.SetWindowRgn(hWnd, 0, TRUE);
}
if (pwndData->hTabBackgroundBrush != NULL)
@@ -192,7 +192,7 @@
DeleteObject(hrgn1);
- user32ApiHook.SetWindowRgn(hWnd, hrgn, TRUE);
+ g_user32ApiHook.SetWindowRgn(hWnd, hrgn, TRUE);
}
int OnPostWinPosChanged(HWND hWnd, WINDOWPOS* pWinPos)
@@ -227,7 +227,7 @@
if(pwndData->HasThemeRgn)
{
pwndData->HasThemeRgn = FALSE;
- user32ApiHook.SetWindowRgn(hWnd, 0, TRUE);
+ g_user32ApiHook.SetWindowRgn(hWnd, 0, TRUE);
}
return 0;
}
@@ -250,7 +250,7 @@
{
if(!IsAppThemed())
{
- return user32ApiHook.DefWindowProcW(hWnd,
+ return g_user32ApiHook.DefWindowProcW(hWnd,
Msg,
wParam,
lParam);
@@ -260,7 +260,7 @@
Msg,
wParam,
lParam,
- user32ApiHook.DefWindowProcW);
+ g_user32ApiHook.DefWindowProcW);
}
static LRESULT CALLBACK
@@ -268,7 +268,7 @@
{
if(!IsAppThemed())
{
- return user32ApiHook.DefWindowProcA(hWnd,
+ return g_user32ApiHook.DefWindowProcA(hWnd,
Msg,
wParam,
lParam);
@@ -278,7 +278,7 @@
Msg,
wParam,
lParam,
- user32ApiHook.DefWindowProcA);
+ g_user32ApiHook.DefWindowProcA);
}
static LRESULT CALLBACK
@@ -487,7 +487,7 @@
pwndData->HasThemeRgn = FALSE;
}
- return user32ApiHook.SetWindowRgn(hWnd, hRgn, bRedraw);
+ return g_user32ApiHook.SetWindowRgn(hWnd, hRgn, bRedraw);
}
BOOL WINAPI ThemeGetScrollInfo(HWND hwnd, int fnBar, LPSCROLLINFO lpsi)
@@ -514,7 +514,7 @@
* with GetScrollInfo, it will get wrong data. So uxtheme needs to
* hook it and set the correct tracking position itself
*/
- ret = user32ApiHook.GetScrollInfo(hwnd, fnBar, lpsi);
+ ret = g_user32ApiHook.GetScrollInfo(hwnd, fnBar, lpsi);
if ( lpsi &&
(lpsi->fMask & SIF_TRACKPOS) &&
pwndData->SCROLL_TrackingWin == hwnd &&
@@ -525,7 +525,7 @@
return ret;
dodefault:
- return user32ApiHook.GetScrollInfo(hwnd, fnBar, lpsi);
+ return g_user32ApiHook.GetScrollInfo(hwnd, fnBar, lpsi);
}
/**********************************************************************
@@ -539,14 +539,14 @@
{
UXTHEME_LoadTheme(FALSE);
ThemeCleanupWndContext(NULL, 0);
- gbThemeHooksActive = FALSE;
+ g_bThemeHooksActive = FALSE;
return TRUE;
}
- gbThemeHooksActive = TRUE;
+ g_bThemeHooksActive = TRUE;
/* Store the original functions from user32 */
- user32ApiHook = *puah;
+ g_user32ApiHook = *puah;
puah->DefWindowProcA = ThemeDefWindowProcA;
puah->DefWindowProcW = ThemeDefWindowProcW;
@@ -673,9 +673,9 @@
INT WINAPI ClassicSystemParametersInfoW(UINT uiAction, UINT uiParam, PVOID pvParam, UINT
fWinIni)
{
- if (gbThemeHooksActive)
- {
- return user32ApiHook.SystemParametersInfoW(uiAction, uiParam, pvParam, fWinIni);
+ if (g_bThemeHooksActive)
+ {
+ return g_user32ApiHook.SystemParametersInfoW(uiAction, uiParam, pvParam,
fWinIni);
}
return SystemParametersInfoW(uiAction, uiParam, pvParam, fWinIni);
@@ -683,9 +683,9 @@
INT WINAPI ClassicSystemParametersInfoA(UINT uiAction, UINT uiParam, PVOID pvParam, UINT
fWinIni)
{
- if (gbThemeHooksActive)
- {
- return user32ApiHook.SystemParametersInfoA(uiAction, uiParam, pvParam, fWinIni);
+ if (g_bThemeHooksActive)
+ {
+ return g_user32ApiHook.SystemParametersInfoA(uiAction, uiParam, pvParam,
fWinIni);
}
return SystemParametersInfoA(uiAction, uiParam, pvParam, fWinIni);
@@ -693,9 +693,9 @@
INT WINAPI ClassicGetSystemMetrics(int nIndex)
{
- if (gbThemeHooksActive)
- {
- return user32ApiHook.GetSystemMetrics(nIndex);
+ if (g_bThemeHooksActive)
+ {
+ return g_user32ApiHook.GetSystemMetrics(nIndex);
}
return GetSystemMetrics(nIndex);
@@ -703,9 +703,9 @@
BOOL WINAPI ClassicAdjustWindowRectEx(LPRECT lpRect, DWORD dwStyle, BOOL bMenu, DWORD
dwExStyle)
{
- if (gbThemeHooksActive)
- {
- return user32ApiHook.AdjustWindowRectEx(lpRect, dwStyle, bMenu, dwExStyle);
+ if (g_bThemeHooksActive)
+ {
+ return g_user32ApiHook.AdjustWindowRectEx(lpRect, dwStyle, bMenu, dwExStyle);
}
return AdjustWindowRectEx(lpRect, dwStyle, bMenu, dwExStyle);
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] Wed Jun 7 08:28:14 2017
@@ -250,8 +250,7 @@
extern HINSTANCE hDllInst;
extern ATOM atWindowTheme;
extern ATOM atWndContext;
-extern BOOL gbThemeHooksActive;
-extern PTHEME_FILE ActiveThemeFile;
+extern BOOL g_bThemeHooksActive;
void UXTHEME_InitSystem(HINSTANCE hInst);
void UXTHEME_LoadTheme(BOOL bLoad);