Full implementation of OpenThemeData, CloseThemeData, and
IsThemePartDefined Export undocumented functions by ordinal only (to match Microsoft's uxtheme).
This commit is contained in:
parent
5e86e9d5bc
commit
5e8a34f163
|
@ -25,6 +25,9 @@
|
|||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winuser.h"
|
||||
#define NO_SHLWAPI_REG
|
||||
#include "shlwapi.h"
|
||||
#include "winnls.h"
|
||||
#include "wingdi.h"
|
||||
#include "uxtheme.h"
|
||||
|
||||
|
@ -184,6 +187,18 @@ void MSSTYLES_CloseThemeFile(PTHEME_FILE tf)
|
|||
tf->dwRefCount--;
|
||||
if(!tf->dwRefCount) {
|
||||
if(tf->hTheme) FreeLibrary(tf->hTheme);
|
||||
if(tf->classes) {
|
||||
while(tf->classes) {
|
||||
PTHEME_CLASS pcls = tf->classes;
|
||||
tf->classes = pcls->next;
|
||||
while(pcls->partstate) {
|
||||
PTHEME_PARTSTATE ps = pcls->partstate;
|
||||
pcls->partstate = ps->next;
|
||||
HeapFree(GetProcessHeap(), 0, ps);
|
||||
}
|
||||
HeapFree(GetProcessHeap(), 0, pcls);
|
||||
}
|
||||
}
|
||||
HeapFree(GetProcessHeap(), 0, tf);
|
||||
}
|
||||
}
|
||||
|
@ -215,22 +230,351 @@ PUXINI_FILE MSSTYLES_GetThemeIni(PTHEME_FILE tf)
|
|||
}
|
||||
|
||||
/***********************************************************************
|
||||
* MSSTYLES_OpenThemeClass
|
||||
* MSSTYLES_GetActiveThemeIni
|
||||
*
|
||||
* Open a theme class
|
||||
* Retrieve the ini file for the selected color/style
|
||||
*/
|
||||
PUXINI_FILE MSSTYLES_GetActiveThemeIni(PTHEME_FILE tf)
|
||||
{
|
||||
WCHAR szFileResNamesResource[] = {
|
||||
'F','I','L','E','R','E','S','N','A','M','E','S','\0'
|
||||
};
|
||||
DWORD dwColorCount = 0;
|
||||
DWORD dwSizeCount = 0;
|
||||
DWORD dwColorNum = 0;
|
||||
DWORD dwSizeNum = 0;
|
||||
DWORD i;
|
||||
DWORD dwResourceIndex;
|
||||
LPWSTR tmp;
|
||||
HRSRC hrsc;
|
||||
|
||||
/* Count the number of available colors & styles, and determine the index number
|
||||
of the color/style we are interested in
|
||||
*/
|
||||
tmp = tf->pszAvailColors;
|
||||
while(*tmp) {
|
||||
if(!lstrcmpiW(tf->pszSelectedColor, tmp))
|
||||
dwColorNum = dwColorCount;
|
||||
tmp += lstrlenW(tmp)+1;
|
||||
dwColorCount++;
|
||||
}
|
||||
tmp = tf->pszAvailSizes;
|
||||
while(*tmp) {
|
||||
if(!lstrcmpiW(tf->pszSelectedSize, tmp))
|
||||
dwSizeNum = dwSizeCount;
|
||||
tmp += lstrlenW(tmp)+1;
|
||||
dwSizeCount++;
|
||||
}
|
||||
|
||||
if(!(hrsc = FindResourceW(tf->hTheme, MAKEINTRESOURCEW(1), szFileResNamesResource))) {
|
||||
TRACE("FILERESNAMES map not found\n");
|
||||
return NULL;
|
||||
}
|
||||
tmp = (LPWSTR)LoadResource(tf->hTheme, hrsc);
|
||||
dwResourceIndex = (dwSizeCount * dwColorNum) + dwSizeNum;
|
||||
for(i=0; i < dwResourceIndex; i++) {
|
||||
tmp += lstrlenW(tmp)+1;
|
||||
}
|
||||
return UXINI_LoadINI(tf, tmp);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* MSSTYLES_ParseIniSectionName
|
||||
*
|
||||
* Parse an ini section name into its component parts
|
||||
* Valid formats are:
|
||||
* [classname]
|
||||
* [classname(state)]
|
||||
* [classname.part]
|
||||
* [classname.part(state)]
|
||||
* [application::classname]
|
||||
* [application::classname(state)]
|
||||
* [application::classname.part]
|
||||
* [application::classname.part(state)]
|
||||
*
|
||||
* PARAMS
|
||||
* tf Previously opened theme file
|
||||
* pszClassList List of requested classes, semicolon delimited
|
||||
* lpSection Section name
|
||||
* dwLen Length of section name
|
||||
* szAppName Location to store application name
|
||||
* szClassName Location to store class name
|
||||
* iPartId Location to store part id
|
||||
* iStateId Location to store state id
|
||||
*/
|
||||
PTHEME_CLASS MSSTYLES_OpenThemeClass(LPCWSTR pszClassList)
|
||||
BOOL MSSTYLES_ParseIniSectionName(LPCWSTR lpSection, DWORD dwLen, LPWSTR szAppName, LPWSTR szClassName, int *iPartId, int *iStateId)
|
||||
{
|
||||
FIXME("%s\n", debugstr_w(pszClassList));
|
||||
WCHAR sec[255];
|
||||
WCHAR part[60] = {'\0'};
|
||||
WCHAR state[60] = {'\0'};
|
||||
LPWSTR tmp;
|
||||
LPWSTR comp;
|
||||
lstrcpynW(sec, lpSection, min(dwLen+1, sizeof(sec)/sizeof(sec[0])));
|
||||
|
||||
*szAppName = 0;
|
||||
*szClassName = 0;
|
||||
*iPartId = 0;
|
||||
*iStateId = 0;
|
||||
comp = sec;
|
||||
/* Get the application name */
|
||||
tmp = StrChrW(comp, ':');
|
||||
if(tmp) {
|
||||
*tmp++ = 0;
|
||||
tmp++;
|
||||
lstrcpynW(szAppName, comp, MAX_THEME_APP_NAME);
|
||||
comp = tmp;
|
||||
}
|
||||
|
||||
tmp = StrChrW(comp, '.');
|
||||
if(tmp) {
|
||||
*tmp++ = 0;
|
||||
lstrcpynW(szClassName, comp, MAX_THEME_CLASS_NAME);
|
||||
comp = tmp;
|
||||
/* now get the part & state */
|
||||
tmp = StrChrW(comp, '(');
|
||||
if(tmp) {
|
||||
*tmp++ = 0;
|
||||
lstrcpynW(part, comp, sizeof(part)/sizeof(part[0]));
|
||||
comp = tmp;
|
||||
/* now get the state */
|
||||
*StrChrW(comp, ')') = 0;
|
||||
lstrcpynW(state, comp, sizeof(state)/sizeof(state[0]));
|
||||
}
|
||||
else {
|
||||
lstrcpynW(part, comp, sizeof(part)/sizeof(part[0]));
|
||||
}
|
||||
}
|
||||
else {
|
||||
tmp = StrChrW(comp, '(');
|
||||
if(tmp) {
|
||||
*tmp++ = 0;
|
||||
lstrcpynW(szClassName, comp, MAX_THEME_CLASS_NAME);
|
||||
comp = tmp;
|
||||
/* now get the state */
|
||||
*StrChrW(comp, ')') = 0;
|
||||
lstrcpynW(state, comp, sizeof(state)/sizeof(state[0]));
|
||||
}
|
||||
else {
|
||||
lstrcpynW(szClassName, comp, MAX_THEME_CLASS_NAME);
|
||||
}
|
||||
}
|
||||
if(!*szClassName) return FALSE;
|
||||
return MSSTYLES_LookupPartState(szClassName, part[0]?part:NULL, state[0]?state:NULL, iPartId, iStateId);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* MSSTYLES_FindClass
|
||||
*
|
||||
* Find a class
|
||||
*
|
||||
* PARAMS
|
||||
* tf Theme file
|
||||
* pszAppName App name to find
|
||||
* pszClassName Class name to find
|
||||
*
|
||||
* RETURNS
|
||||
* The class found, or NULL
|
||||
*/
|
||||
PTHEME_CLASS MSSTYLES_FindClass(PTHEME_FILE tf, LPCWSTR pszAppName, LPCWSTR pszClassName)
|
||||
{
|
||||
PTHEME_CLASS cur = tf->classes;
|
||||
while(cur) {
|
||||
if(!lstrcmpiW(pszAppName, cur->szAppName) && !lstrcmpiW(pszClassName, cur->szClassName))
|
||||
return cur;
|
||||
cur = cur->next;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* MSSTYLES_AddClass
|
||||
*
|
||||
* Add a class to a theme file
|
||||
*
|
||||
* PARAMS
|
||||
* tf Theme file
|
||||
* pszAppName App name to add
|
||||
* pszClassName Class name to add
|
||||
*
|
||||
* RETURNS
|
||||
* The class added, or a class previously added with the same name
|
||||
*/
|
||||
PTHEME_CLASS MSSTYLES_AddClass(PTHEME_FILE tf, LPCWSTR pszAppName, LPCWSTR pszClassName)
|
||||
{
|
||||
PTHEME_CLASS cur = MSSTYLES_FindClass(tf, pszAppName, pszClassName);
|
||||
if(cur) return cur;
|
||||
|
||||
cur = HeapAlloc(GetProcessHeap(), 0, sizeof(THEME_CLASS));
|
||||
lstrcpyW(cur->szAppName, pszAppName);
|
||||
lstrcpyW(cur->szClassName, pszClassName);
|
||||
cur->next = tf->classes;
|
||||
cur->partstate = NULL;
|
||||
cur->overrides = NULL;
|
||||
tf->classes = cur;
|
||||
return cur;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* MSSTYLES_FindPartState
|
||||
*
|
||||
* Find a part/state
|
||||
*
|
||||
* PARAMS
|
||||
* tc Class to search
|
||||
* iPartId Part ID to find
|
||||
* iStateId State ID to find
|
||||
*
|
||||
* RETURNS
|
||||
* The part/state found, or NULL
|
||||
*/
|
||||
PTHEME_PARTSTATE MSSTYLES_FindPartState(PTHEME_CLASS tc, int iPartId, int iStateId)
|
||||
{
|
||||
PTHEME_PARTSTATE cur = tc->partstate;
|
||||
while(cur) {
|
||||
if(cur->iPartId == iPartId && cur->iStateId == iStateId)
|
||||
return cur;
|
||||
cur = cur->next;
|
||||
}
|
||||
if(tc->overrides) return MSSTYLES_FindPartState(tc->overrides, iPartId, iStateId);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* MSSTYLES_AddPartState
|
||||
*
|
||||
* Add a part/state to a class
|
||||
*
|
||||
* PARAMS
|
||||
* tc Theme class
|
||||
* iPartId Part ID to add
|
||||
* iStateId State ID to add
|
||||
*
|
||||
* RETURNS
|
||||
* The part/state added, or a part/state previously added with the same IDs
|
||||
*/
|
||||
PTHEME_PARTSTATE MSSTYLES_AddPartState(PTHEME_CLASS tc, int iPartId, int iStateId)
|
||||
{
|
||||
PTHEME_PARTSTATE cur = MSSTYLES_FindPartState(tc, iPartId, iStateId);
|
||||
if(cur) return cur;
|
||||
|
||||
cur = HeapAlloc(GetProcessHeap(), 0, sizeof(THEME_PARTSTATE));
|
||||
cur->iPartId = iPartId;
|
||||
cur->iStateId = iStateId;
|
||||
cur->next = tc->partstate;
|
||||
tc->partstate = cur;
|
||||
return cur;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* MSSTYLES_ParseThemeIni
|
||||
*
|
||||
* Parse the theme ini for the selected color/style
|
||||
*
|
||||
* PARAMS
|
||||
* tf Theme to parse
|
||||
*/
|
||||
void MSSTYLES_ParseThemeIni(PTHEME_FILE tf)
|
||||
{
|
||||
WCHAR szSysMetrics[] = {'S','y','s','M','e','t','r','i','c','s','\0'};
|
||||
PTHEME_CLASS cls;
|
||||
PTHEME_PARTSTATE ps;
|
||||
PUXINI_FILE ini;
|
||||
WCHAR szAppName[MAX_THEME_APP_NAME];
|
||||
WCHAR szClassName[MAX_THEME_CLASS_NAME];
|
||||
int iPartId;
|
||||
int iStateId;
|
||||
DWORD dwLen;
|
||||
LPCWSTR lpName;
|
||||
|
||||
ini = MSSTYLES_GetActiveThemeIni(tf);
|
||||
|
||||
while((lpName=UXINI_GetNextSection(ini, &dwLen))) {
|
||||
if(CompareStringW(LOCALE_SYSTEM_DEFAULT, NORM_IGNORECASE, lpName, dwLen, szSysMetrics, -1) == CSTR_EQUAL) {
|
||||
FIXME("Process system metrics\n");
|
||||
continue;
|
||||
}
|
||||
if(MSSTYLES_ParseIniSectionName(lpName, dwLen, szAppName, szClassName, &iPartId, &iStateId)) {
|
||||
cls = MSSTYLES_AddClass(tf, szAppName, szClassName);
|
||||
ps = MSSTYLES_AddPartState(cls, iPartId, iStateId);
|
||||
FIXME("Parse properties\n");
|
||||
}
|
||||
}
|
||||
|
||||
/* App/Class combos override values defined by the base class, map these overrides */
|
||||
cls = tf->classes;
|
||||
while(cls) {
|
||||
if(*cls->szAppName) {
|
||||
cls->overrides = MSSTYLES_FindClass(tf, NULL, cls->szClassName);
|
||||
if(!cls->overrides) {
|
||||
TRACE("No overrides found for app %s class %s\n", debugstr_w(cls->szAppName), debugstr_w(cls->szClassName));
|
||||
}
|
||||
}
|
||||
cls = cls->next;
|
||||
}
|
||||
UXINI_CloseINI(ini);
|
||||
|
||||
if(!tf->classes) {
|
||||
ERR("Failed to parse theme ini\n");
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* MSSTYLES_OpenThemeClass
|
||||
*
|
||||
* Open a theme class, uses the current active theme
|
||||
*
|
||||
* PARAMS
|
||||
* pszAppName Application name, for theme styles specific
|
||||
* to a particular application
|
||||
* pszClassList List of requested classes, semicolon delimited
|
||||
*/
|
||||
PTHEME_CLASS MSSTYLES_OpenThemeClass(LPCWSTR pszAppName, LPCWSTR pszClassList)
|
||||
{
|
||||
PTHEME_CLASS cls = NULL;
|
||||
WCHAR szClassName[MAX_THEME_CLASS_NAME];
|
||||
LPCWSTR start;
|
||||
LPCWSTR end;
|
||||
DWORD len;
|
||||
if(!tfActiveTheme) {
|
||||
TRACE("there is no active theme\n");
|
||||
return NULL;
|
||||
}
|
||||
if(!tfActiveTheme->classes) {
|
||||
MSSTYLES_ParseThemeIni(tfActiveTheme);
|
||||
if(!tfActiveTheme->classes)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
start = pszClassList;
|
||||
while((end = StrChrW(start, ';'))) {
|
||||
len = end-start;
|
||||
lstrcpynW(szClassName, start, min(len+1, sizeof(szClassName)/sizeof(szClassName[0])));
|
||||
start = end+1;
|
||||
cls = MSSTYLES_FindClass(tfActiveTheme, pszAppName, szClassName);
|
||||
if(cls) break;
|
||||
}
|
||||
if(!cls && *start) {
|
||||
lstrcpynW(szClassName, start, sizeof(szClassName)/sizeof(szClassName[0]));
|
||||
cls = MSSTYLES_FindClass(tfActiveTheme, pszAppName, szClassName);
|
||||
}
|
||||
if(cls) {
|
||||
TRACE("Opened class %s from list %s\n", debugstr_w(cls->szClassName), debugstr_w(pszClassList));
|
||||
}
|
||||
return cls;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* MSSTYLES_CloseThemeClass
|
||||
*
|
||||
* Close a theme class
|
||||
*
|
||||
* PARAMS
|
||||
* tc Theme class to close
|
||||
*
|
||||
* NOTES
|
||||
* There is currently no need clean anything up for theme classes,
|
||||
* so do nothing for now
|
||||
*/
|
||||
HRESULT MSSTYLES_CloseThemeClass(PTHEME_CLASS tc)
|
||||
{
|
||||
FIXME("%p\n", tc);
|
||||
return S_OK;
|
||||
}
|
||||
|
|
|
@ -23,6 +23,26 @@
|
|||
|
||||
#define TMT_ENUM 200
|
||||
|
||||
#define MAX_THEME_APP_NAME 60
|
||||
#define MAX_THEME_CLASS_NAME 60
|
||||
|
||||
typedef struct _THEME_PARTSTATE {
|
||||
int iPartId;
|
||||
int iStateId;
|
||||
/* TODO: define part/state properties */
|
||||
|
||||
struct _THEME_PARTSTATE *next;
|
||||
} THEME_PARTSTATE, *PTHEME_PARTSTATE;
|
||||
|
||||
typedef struct _THEME_CLASS {
|
||||
WCHAR szAppName[MAX_THEME_APP_NAME];
|
||||
WCHAR szClassName[MAX_THEME_CLASS_NAME];
|
||||
PTHEME_PARTSTATE partstate;
|
||||
struct _THEME_CLASS *overrides;
|
||||
|
||||
struct _THEME_CLASS *next;
|
||||
} THEME_CLASS, *PTHEME_CLASS;
|
||||
|
||||
typedef struct _THEME_FILE {
|
||||
DWORD dwRefCount;
|
||||
HMODULE hTheme;
|
||||
|
@ -31,11 +51,9 @@ typedef struct _THEME_FILE {
|
|||
|
||||
LPWSTR pszSelectedColor;
|
||||
LPWSTR pszSelectedSize;
|
||||
} THEME_FILE, *PTHEME_FILE;
|
||||
|
||||
typedef struct _THEME_CLASS {
|
||||
/* TODO */
|
||||
} THEME_CLASS, *PTHEME_CLASS;
|
||||
PTHEME_CLASS classes;
|
||||
} THEME_FILE, *PTHEME_FILE;
|
||||
|
||||
typedef struct _UXINI_FILE {
|
||||
LPCWSTR lpIni;
|
||||
|
@ -46,10 +64,14 @@ typedef struct _UXINI_FILE {
|
|||
HRESULT MSSTYLES_OpenThemeFile(LPCWSTR lpThemeFile, LPCWSTR pszColorName, LPCWSTR pszSizeName, PTHEME_FILE *tf);
|
||||
void MSSTYLES_CloseThemeFile(PTHEME_FILE tf);
|
||||
HRESULT MSSTYLES_SetActiveTheme(PTHEME_FILE tf);
|
||||
PTHEME_CLASS MSSTYLES_OpenThemeClass(LPCWSTR pszClassList);
|
||||
PTHEME_CLASS MSSTYLES_OpenThemeClass(LPCWSTR pszAppName, LPCWSTR pszClassList);
|
||||
HRESULT MSSTYLES_CloseThemeClass(PTHEME_CLASS tc);
|
||||
BOOL MSSTYLES_LookupProperty(LPCWSTR pszPropertyName, DWORD *dwPrimitive, DWORD *dwId);
|
||||
BOOL MSSTYLES_LookupEnum(LPCWSTR pszValueName, DWORD dwEnum, DWORD *dwValue);
|
||||
BOOL MSSTYLES_LookupPartState(LPCWSTR pszClass, LPCWSTR pszPart, LPCWSTR pszState, int *iPartId, int *iStateId);
|
||||
PUXINI_FILE MSSTYLES_GetThemeIni(PTHEME_FILE tf);
|
||||
PTHEME_PARTSTATE MSSTYLES_FindPartState(PTHEME_CLASS tc, int iPartId, int iStateId);
|
||||
PTHEME_CLASS MSSTYLES_FindClass(PTHEME_FILE tf, LPCWSTR pszAppName, LPCWSTR pszClassName);
|
||||
|
||||
PUXINI_FILE UXINI_LoadINI(PTHEME_FILE tf, LPCWSTR lpName);
|
||||
void UXINI_CloseINI(PUXINI_FILE uf);
|
||||
|
|
|
@ -29,6 +29,10 @@
|
|||
|
||||
#include "msstyles.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(uxtheme);
|
||||
|
||||
typedef struct _MSSTYLES_PROPERTY_MAP {
|
||||
WORD dwPrimitiveType;
|
||||
WORD dwPropertyID;
|
||||
|
@ -1045,6 +1049,54 @@ static const MSSTYLES_CLASS_NAME mapClass[] = {
|
|||
{classWindow, {'W','I','N','D','O','W','\0'}}
|
||||
};
|
||||
|
||||
BOOL MSSTYLES_LookupPartState(LPCWSTR pszClass, LPCWSTR pszPart, LPCWSTR pszState, int *iPartId, int *iStateId)
|
||||
{
|
||||
int i;
|
||||
const MSSTYLES_CLASS_MAP *map;
|
||||
|
||||
*iPartId = 0;
|
||||
*iStateId = 0;
|
||||
for(i=0; i<sizeof(mapClass)/sizeof(mapClass[0]); i++) {
|
||||
if(!lstrcmpiW(mapClass[i].pszClass, pszClass)) {
|
||||
map = mapClass[i].lpMap;
|
||||
if(pszPart) {
|
||||
do {
|
||||
if(map->dwStateID == 0 && !lstrcmpiW(map->szName, pszPart)) {
|
||||
*iPartId = map->dwPartID;
|
||||
break;
|
||||
}
|
||||
} while(*((++map)->szName));
|
||||
}
|
||||
if(pszState) {
|
||||
if(pszPart && *iPartId == 0) {
|
||||
break;
|
||||
}
|
||||
do {
|
||||
if(pszPart) {
|
||||
if(map->dwPartID == *iPartId && !lstrcmpiW(map->szName, pszState)) {
|
||||
*iStateId = map->dwStateID;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(!lstrcmpiW(map->szName, pszState)) {
|
||||
*iStateId = map->dwStateID;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} while(*((++map)->szName));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(pszPart && *iPartId == 0) {
|
||||
return FALSE;
|
||||
}
|
||||
if(pszState && *iStateId == 0) {
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
* MSSTYLES_LookupProperty
|
||||
|
|
|
@ -245,32 +245,6 @@ HRESULT WINAPI EnableTheming(BOOL fEnable)
|
|||
return S_OK;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* OpenThemeData (UXTHEME.@)
|
||||
*/
|
||||
HTHEME WINAPI OpenThemeData(HWND hwnd, LPCWSTR pszClassList)
|
||||
{
|
||||
HTHEME hTheme;
|
||||
TRACE("(%p,%s)\n", hwnd, debugstr_w(pszClassList));
|
||||
if(!bThemeActive)
|
||||
return NULL;
|
||||
hTheme = MSSTYLES_OpenThemeClass(pszClassList);
|
||||
if(IsWindow(hwnd))
|
||||
SetPropW(hwnd, MAKEINTATOMW(atWindowTheme), hTheme);
|
||||
return hTheme;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* GetWindowTheme (UXTHEME.@)
|
||||
*
|
||||
* Retrieve the last theme opened for a window
|
||||
*/
|
||||
HTHEME WINAPI GetWindowTheme(HWND hwnd)
|
||||
{
|
||||
TRACE("(%p)\n", hwnd);
|
||||
return GetPropW(hwnd, MAKEINTATOMW(atWindowTheme));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* UXTHEME_SetWindowProperty
|
||||
*
|
||||
|
@ -294,6 +268,54 @@ HRESULT UXTHEME_SetWindowProperty(HWND hwnd, ATOM aProp, LPCWSTR pszValue)
|
|||
return S_OK;
|
||||
}
|
||||
|
||||
LPWSTR UXTHEME_GetWindowProperty(HWND hwnd, ATOM aProp, LPWSTR pszBuffer, int dwLen)
|
||||
{
|
||||
ATOM atValue = (ATOM)(size_t)GetPropW(hwnd, MAKEINTATOMW(aProp));
|
||||
if(atValue) {
|
||||
if(GetAtomNameW(atValue, pszBuffer, dwLen))
|
||||
return pszBuffer;
|
||||
TRACE("property defined, but unable to get value\n");
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* OpenThemeData (UXTHEME.@)
|
||||
*/
|
||||
HTHEME WINAPI OpenThemeData(HWND hwnd, LPCWSTR pszClassList)
|
||||
{
|
||||
WCHAR szAppBuff[256];
|
||||
WCHAR szClassBuff[256];
|
||||
LPCWSTR pszAppName;
|
||||
LPCWSTR pszUseClassList;
|
||||
HTHEME hTheme;
|
||||
TRACE("(%p,%s)\n", hwnd, debugstr_w(pszClassList));
|
||||
if(!bThemeActive)
|
||||
return NULL;
|
||||
|
||||
pszAppName = UXTHEME_GetWindowProperty(hwnd, atSubAppName, szAppBuff, sizeof(szAppBuff)/sizeof(szAppBuff[0]));
|
||||
/* If SetWindowTheme was used on the window, that overrides the class list passed to this function */
|
||||
pszUseClassList = UXTHEME_GetWindowProperty(hwnd, atSubIdList, szClassBuff, sizeof(szClassBuff)/sizeof(szClassBuff[0]));
|
||||
if(!pszUseClassList)
|
||||
pszUseClassList = pszClassList;
|
||||
|
||||
hTheme = MSSTYLES_OpenThemeClass(pszAppName, pszUseClassList);
|
||||
if(IsWindow(hwnd))
|
||||
SetPropW(hwnd, MAKEINTATOMW(atWindowTheme), hTheme);
|
||||
return hTheme;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* GetWindowTheme (UXTHEME.@)
|
||||
*
|
||||
* Retrieve the last theme opened for a window
|
||||
*/
|
||||
HTHEME WINAPI GetWindowTheme(HWND hwnd)
|
||||
{
|
||||
TRACE("(%p)\n", hwnd);
|
||||
return GetPropW(hwnd, MAKEINTATOMW(atWindowTheme));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* SetWindowTheme (UXTHEME.@)
|
||||
*
|
||||
|
@ -375,7 +397,9 @@ HRESULT WINAPI HitTestThemeBackground(HTHEME hTheme, HDC hdc, int iPartId,
|
|||
*/
|
||||
BOOL WINAPI IsThemePartDefined(HTHEME hTheme, int iPartId, int iStateId)
|
||||
{
|
||||
FIXME("%d %d: stub\n", iPartId, iStateId);
|
||||
TRACE("(%p,%d,%d)\n", hTheme, iPartId, iStateId);
|
||||
if(MSSTYLES_FindPartState(hTheme, iPartId, iStateId))
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
|
@ -61,6 +61,8 @@ PUXINI_FILE UXINI_LoadINI(PTHEME_FILE tf, LPCWSTR lpName) {
|
|||
PUXINI_FILE uf;
|
||||
DWORD dwIniSize;
|
||||
|
||||
TRACE("Loading resource INI %s\n", debugstr_w(lpName));
|
||||
|
||||
if((hrsc = FindResourceW(tf->hTheme, lpName, szTextFileResource))) {
|
||||
if(!(lpThemesIni = (LPCWSTR)LoadResource(tf->hTheme, hrsc))) {
|
||||
TRACE("%s resource not found\n", debugstr_w(lpName));
|
||||
|
@ -155,11 +157,12 @@ LPCWSTR UXINI_GetNextLine(PUXINI_FILE uf, DWORD *dwLen)
|
|||
lpLineStart = uf->lpCurLoc;
|
||||
lpLineEnd = uf->lpCurLoc;
|
||||
while(!UXINI_eof(uf) && *uf->lpCurLoc != '\n' && *uf->lpCurLoc != ';') lpLineEnd = uf->lpCurLoc++;
|
||||
if(*uf->lpCurLoc == ';') lpLineEnd = uf->lpCurLoc++;
|
||||
/* If comment was found, skip the rest of the line */
|
||||
if(*uf->lpCurLoc == ';')
|
||||
while(!UXINI_eof(uf) && *uf->lpCurLoc != '\n') uf->lpCurLoc++;
|
||||
len = (lpLineEnd - lpLineStart);
|
||||
if(len == 0)
|
||||
if(*lpLineStart != ';' && len == 0)
|
||||
return NULL;
|
||||
} while(*lpLineStart == ';');
|
||||
/* Remove whitespace from end of line */
|
||||
|
@ -169,7 +172,7 @@ LPCWSTR UXINI_GetNextLine(PUXINI_FILE uf, DWORD *dwLen)
|
|||
return lpLineStart;
|
||||
}
|
||||
|
||||
void UXINI_UnGetToLine(PUXINI_FILE uf, LPCWSTR lpLine)
|
||||
static inline void UXINI_UnGetToLine(PUXINI_FILE uf, LPCWSTR lpLine)
|
||||
{
|
||||
uf->lpCurLoc = lpLine;
|
||||
}
|
||||
|
|
|
@ -1,46 +1,46 @@
|
|||
# Undocumented functions - Names derived from debug symbols
|
||||
1 stdcall QueryThemeServices()
|
||||
2 stdcall OpenThemeFile(wstr wstr wstr ptr long)
|
||||
3 stdcall CloseThemeFile(ptr)
|
||||
4 stdcall ApplyTheme(ptr ptr ptr)
|
||||
7 stdcall GetThemeDefaults(wstr wstr long wstr long)
|
||||
8 stdcall EnumThemes(wstr ptr ptr)
|
||||
9 stdcall EnumThemeColors(wstr wstr long wstr)
|
||||
10 stdcall EnumThemeSizes(wstr wstr long wstr)
|
||||
11 stdcall ParseThemeIniFile(wstr wstr ptr ptr)
|
||||
13 stub DrawNCPreview
|
||||
14 stub RegisterDefaultTheme
|
||||
15 stub DumpLoadedThemeToTextFile
|
||||
16 stub OpenThemeDataFromFile
|
||||
17 stub OpenThemeFileFromData
|
||||
18 stub GetThemeSysSize96
|
||||
19 stub GetThemeSysFont96
|
||||
20 stub SessionAllocate
|
||||
21 stub SessionFree
|
||||
22 stub ThemeHooksOn
|
||||
23 stub ThemeHooksOff
|
||||
24 stub AreThemeHooksActive
|
||||
25 stub GetCurrentChangeNumber
|
||||
26 stub GetNewChangeNumber
|
||||
27 stub SetGlobalTheme
|
||||
28 stub GetGlobalTheme
|
||||
29 stub CheckThemeSignature
|
||||
30 stub LoadTheme
|
||||
31 stub InitUserTheme
|
||||
32 stub InitUserRegistry
|
||||
33 stub ReestablishServerConnection
|
||||
34 stub ThemeHooksInstall
|
||||
35 stub ThemeHooksRemove
|
||||
36 stub RefreshThemeForTS
|
||||
43 stub ClassicGetSystemMetrics
|
||||
44 stub ClassicSystemParametersInfoA
|
||||
45 stub ClassicSystemParametersInfoW
|
||||
46 stub ClassicAdjustWindowRectEx
|
||||
48 stub GetThemeParseErrorInfo
|
||||
60 stub CreateThemeDataFromObjects
|
||||
61 stub OpenThemeDataEx
|
||||
62 stub ServerClearStockObjects
|
||||
63 stub MarkSelection
|
||||
1 stdcall -noname QueryThemeServices()
|
||||
2 stdcall -noname OpenThemeFile(wstr wstr wstr ptr long)
|
||||
3 stdcall -noname CloseThemeFile(ptr)
|
||||
4 stdcall -noname ApplyTheme(ptr ptr ptr)
|
||||
7 stdcall -noname GetThemeDefaults(wstr wstr long wstr long)
|
||||
8 stdcall -noname EnumThemes(wstr ptr ptr)
|
||||
9 stdcall -noname EnumThemeColors(wstr wstr long wstr)
|
||||
10 stdcall -noname EnumThemeSizes(wstr wstr long wstr)
|
||||
11 stdcall -noname ParseThemeIniFile(wstr wstr ptr ptr)
|
||||
13 stub -noname DrawNCPreview
|
||||
14 stub -noname RegisterDefaultTheme
|
||||
15 stub -noname DumpLoadedThemeToTextFile
|
||||
16 stub -noname OpenThemeDataFromFile
|
||||
17 stub -noname OpenThemeFileFromData
|
||||
18 stub -noname GetThemeSysSize96
|
||||
19 stub -noname GetThemeSysFont96
|
||||
20 stub -noname SessionAllocate
|
||||
21 stub -noname SessionFree
|
||||
22 stub -noname ThemeHooksOn
|
||||
23 stub -noname ThemeHooksOff
|
||||
24 stub -noname AreThemeHooksActive
|
||||
25 stub -noname GetCurrentChangeNumber
|
||||
26 stub -noname GetNewChangeNumber
|
||||
27 stub -noname SetGlobalTheme
|
||||
28 stub -noname GetGlobalTheme
|
||||
29 stub -noname CheckThemeSignature
|
||||
30 stub -noname LoadTheme
|
||||
31 stub -noname InitUserTheme
|
||||
32 stub -noname InitUserRegistry
|
||||
33 stub -noname ReestablishServerConnection
|
||||
34 stub -noname ThemeHooksInstall
|
||||
35 stub -noname ThemeHooksRemove
|
||||
36 stub -noname RefreshThemeForTS
|
||||
43 stub -noname ClassicGetSystemMetrics
|
||||
44 stub -noname ClassicSystemParametersInfoA
|
||||
45 stub -noname ClassicSystemParametersInfoW
|
||||
46 stub -noname ClassicAdjustWindowRectEx
|
||||
48 stub -noname GetThemeParseErrorInfo
|
||||
60 stub -noname CreateThemeDataFromObjects
|
||||
61 stub -noname OpenThemeDataEx
|
||||
62 stub -noname ServerClearStockObjects
|
||||
63 stub -noname MarkSelection
|
||||
|
||||
# Standard functions
|
||||
@ stdcall CloseThemeData(ptr)
|
||||
|
|
Loading…
Reference in New Issue