- Sync uxtheme with Wine head

svn path=/trunk/; revision=38708
This commit is contained in:
Dmitry Chapyshev 2009-01-11 19:04:51 +00:00
parent cbc7d519d3
commit 079741c940
3 changed files with 25 additions and 16 deletions

View file

@ -100,7 +100,7 @@ HRESULT WINAPI DrawThemeParentBackground(HWND hwnd, HDC hdc, RECT *prc)
hParent = hwnd; hParent = hwnd;
if(prc) { if(prc) {
CopyRect(&rt, prc); CopyRect(&rt, prc);
MapWindowPoints(hwnd, NULL, (LPPOINT)&rt, 2); MapWindowPoints(hwnd, hParent, (LPPOINT)&rt, 2);
clip = CreateRectRgn(0,0,1,1); clip = CreateRectRgn(0,0,1,1);
hasClip = GetClipRgn(hdc, clip); hasClip = GetClipRgn(hdc, clip);
@ -110,8 +110,8 @@ HRESULT WINAPI DrawThemeParentBackground(HWND hwnd, HDC hdc, RECT *prc)
IntersectClipRect(hdc, prc->left, prc->top, prc->right, prc->bottom); IntersectClipRect(hdc, prc->left, prc->top, prc->right, prc->bottom);
} }
else { else {
GetClientRect(hParent, &rt); GetClientRect(hwnd, &rt);
MapWindowPoints(hParent, NULL, (LPPOINT)&rt, 2); MapWindowPoints(hwnd, hParent, (LPPOINT)&rt, 2);
} }
OffsetViewportOrgEx(hdc, -rt.left, -rt.top, &org); OffsetViewportOrgEx(hdc, -rt.left, -rt.top, &org);

View file

@ -43,9 +43,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(uxtheme);
* Defines and global variables * Defines and global variables
*/ */
BOOL MSSTYLES_GetNextInteger(LPCWSTR lpStringStart, LPCWSTR lpStringEnd, LPCWSTR *lpValEnd, int *value); static BOOL MSSTYLES_GetNextInteger(LPCWSTR lpStringStart, LPCWSTR lpStringEnd, LPCWSTR *lpValEnd, int *value);
BOOL MSSTYLES_GetNextToken(LPCWSTR lpStringStart, LPCWSTR lpStringEnd, LPCWSTR *lpValEnd, LPWSTR lpBuff, DWORD buffSize); static BOOL MSSTYLES_GetNextToken(LPCWSTR lpStringStart, LPCWSTR lpStringEnd, LPCWSTR *lpValEnd, LPWSTR lpBuff, DWORD buffSize);
void MSSTYLES_ParseThemeIni(PTHEME_FILE tf, BOOL setMetrics); static void MSSTYLES_ParseThemeIni(PTHEME_FILE tf, BOOL setMetrics);
static HRESULT MSSTYLES_GetFont (LPCWSTR lpStringStart, LPCWSTR lpStringEnd, LPCWSTR *lpValEnd, LOGFONTW* logfont); static HRESULT MSSTYLES_GetFont (LPCWSTR lpStringStart, LPCWSTR lpStringEnd, LPCWSTR *lpValEnd, LOGFONTW* logfont);
extern HINSTANCE hDllInst; extern HINSTANCE hDllInst;
@ -685,9 +685,9 @@ static BOOL parse_handle_color_property (struct PARSECOLORSTATE* state,
{ {
int r,g,b; int r,g,b;
LPCWSTR lpValueEnd = lpValue + dwValueLen; LPCWSTR lpValueEnd = lpValue + dwValueLen;
MSSTYLES_GetNextInteger(lpValue, lpValueEnd, &lpValue, &r); if(MSSTYLES_GetNextInteger(lpValue, lpValueEnd, &lpValue, &r) &&
MSSTYLES_GetNextInteger(lpValue, lpValueEnd, &lpValue, &g); MSSTYLES_GetNextInteger(lpValue, lpValueEnd, &lpValue, &g) &&
if(MSSTYLES_GetNextInteger(lpValue, lpValueEnd, &lpValue, &b)) { MSSTYLES_GetNextInteger(lpValue, lpValueEnd, &lpValue, &b)) {
state->colorElements[state->colorCount] = iPropertyId - TMT_FIRSTCOLOR; state->colorElements[state->colorCount] = iPropertyId - TMT_FIRSTCOLOR;
state->colorRgb[state->colorCount++] = RGB(r,g,b); state->colorRgb[state->colorCount++] = RGB(r,g,b);
switch (iPropertyId) switch (iPropertyId)
@ -852,7 +852,7 @@ static void parse_apply_nonclient (struct PARSENONCLIENTSTATE* state)
* PARAMS * PARAMS
* tf Theme to parse * tf Theme to parse
*/ */
void MSSTYLES_ParseThemeIni(PTHEME_FILE tf, BOOL setMetrics) static void MSSTYLES_ParseThemeIni(PTHEME_FILE tf, BOOL setMetrics)
{ {
static const WCHAR szSysMetrics[] = {'S','y','s','M','e','t','r','i','c','s','\0'}; static const WCHAR szSysMetrics[] = {'S','y','s','M','e','t','r','i','c','s','\0'};
static const WCHAR szGlobals[] = {'g','l','o','b','a','l','s','\0'}; static const WCHAR szGlobals[] = {'g','l','o','b','a','l','s','\0'};
@ -1139,7 +1139,7 @@ HBITMAP MSSTYLES_LoadBitmap (PTHEME_CLASS tc, LPCWSTR lpFilename, BOOL* hasAlpha
return img->image; return img->image;
} }
BOOL MSSTYLES_GetNextInteger(LPCWSTR lpStringStart, LPCWSTR lpStringEnd, LPCWSTR *lpValEnd, int *value) static BOOL MSSTYLES_GetNextInteger(LPCWSTR lpStringStart, LPCWSTR lpStringEnd, LPCWSTR *lpValEnd, int *value)
{ {
LPCWSTR cur = lpStringStart; LPCWSTR cur = lpStringStart;
int total = 0; int total = 0;
@ -1163,7 +1163,7 @@ BOOL MSSTYLES_GetNextInteger(LPCWSTR lpStringStart, LPCWSTR lpStringEnd, LPCWSTR
return TRUE; return TRUE;
} }
BOOL MSSTYLES_GetNextToken(LPCWSTR lpStringStart, LPCWSTR lpStringEnd, LPCWSTR *lpValEnd, LPWSTR lpBuff, DWORD buffSize) { static BOOL MSSTYLES_GetNextToken(LPCWSTR lpStringStart, LPCWSTR lpStringEnd, LPCWSTR *lpValEnd, LPWSTR lpBuff, DWORD buffSize) {
LPCWSTR cur = lpStringStart; LPCWSTR cur = lpStringStart;
LPCWSTR start; LPCWSTR start;
LPCWSTR end; LPCWSTR end;
@ -1210,8 +1210,14 @@ HRESULT MSSTYLES_GetPropertyColor(PTHEME_PROPERTY tp, COLORREF *pColor)
lpCur = tp->lpValue; lpCur = tp->lpValue;
lpEnd = tp->lpValue + tp->dwValueLen; lpEnd = tp->lpValue + tp->dwValueLen;
MSSTYLES_GetNextInteger(lpCur, lpEnd, &lpCur, &red); if(!MSSTYLES_GetNextInteger(lpCur, lpEnd, &lpCur, &red)) {
MSSTYLES_GetNextInteger(lpCur, lpEnd, &lpCur, &green); TRACE("Could not parse color property\n");
return E_PROP_ID_UNSUPPORTED;
}
if(!MSSTYLES_GetNextInteger(lpCur, lpEnd, &lpCur, &green)) {
TRACE("Could not parse color property\n");
return E_PROP_ID_UNSUPPORTED;
}
if(!MSSTYLES_GetNextInteger(lpCur, lpEnd, &lpCur, &blue)) { if(!MSSTYLES_GetNextInteger(lpCur, lpEnd, &lpCur, &blue)) {
TRACE("Could not parse color property\n"); TRACE("Could not parse color property\n");
return E_PROP_ID_UNSUPPORTED; return E_PROP_ID_UNSUPPORTED;
@ -1316,7 +1322,10 @@ HRESULT MSSTYLES_GetPropertyPosition(PTHEME_PROPERTY tp, POINT *pPoint)
LPCWSTR lpCur = tp->lpValue; LPCWSTR lpCur = tp->lpValue;
LPCWSTR lpEnd = tp->lpValue + tp->dwValueLen; LPCWSTR lpEnd = tp->lpValue + tp->dwValueLen;
MSSTYLES_GetNextInteger(lpCur, lpEnd, &lpCur, &x); if(!MSSTYLES_GetNextInteger(lpCur, lpEnd, &lpCur, &x)) {
TRACE("Could not parse position property\n");
return E_PROP_ID_UNSUPPORTED;
}
if(!MSSTYLES_GetNextInteger(lpCur, lpEnd, &lpCur, &y)) { if(!MSSTYLES_GetNextInteger(lpCur, lpEnd, &lpCur, &y)) {
TRACE("Could not parse position property\n"); TRACE("Could not parse position property\n");
return E_PROP_ID_UNSUPPORTED; return E_PROP_ID_UNSUPPORTED;

View file

@ -916,7 +916,7 @@ HRESULT WINAPI CloseThemeFile(HTHEMEFILE hThemeFile)
* char b[] = "\0"; where \0 can be one or more of any character, makes no difference * char b[] = "\0"; where \0 can be one or more of any character, makes no difference
* the theme is applied smoothly (screen does not flicker) * the theme is applied smoothly (screen does not flicker)
* char *b = "\0" or NULL; where \0 can be zero or more of any character, makes no difference * char *b = "\0" or NULL; where \0 can be zero or more of any character, makes no difference
* the function fails returning invalid parameter...very strange * the function fails returning invalid parameter... very strange
*/ */
HRESULT WINAPI ApplyTheme(HTHEMEFILE hThemeFile, char *unknown, HWND hWnd) HRESULT WINAPI ApplyTheme(HTHEMEFILE hThemeFile, char *unknown, HWND hWnd)
{ {