uxtheme: framework for multiple theme backends & some tests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Framework to support multiple theme backends demand loaded and a few 
conformance tests
This should also fix many issues with theme aware applications as this 
contains a basic implementation of all documented theme functions
Index: configure.ac
===================================================================
RCS file: /home/wine/wine/configure.ac,v
retrieving revision 1.208
diff -u -r1.208 configure.ac
--- configure.ac	19 Nov 2003 02:18:13 -0000	1.208
+++ configure.ac	20 Nov 2003 01:06:07 -0000
@@ -1561,6 +1561,7 @@
 dlls/user/Makefile
 dlls/user/tests/Makefile
 dlls/uxtheme/Makefile
+dlls/uxtheme/tests/Makefile
 dlls/version/Makefile
 dlls/win32s/Makefile
 dlls/winaspi/Makefile
Index: dlls/uxtheme/Makefile.in
===================================================================
RCS file: /home/wine/wine/dlls/uxtheme/Makefile.in,v
retrieving revision 1.2
diff -u -r1.2 Makefile.in
--- dlls/uxtheme/Makefile.in	11 Oct 2003 01:09:17 -0000	1.2
+++ dlls/uxtheme/Makefile.in	20 Nov 2003 01:06:07 -0000
@@ -7,7 +7,12 @@
 EXTRALIBS = $(LIBUNICODE)

 C_SRCS = \
-	main.c
+	main.c \
+	msstyles.c
+
+#RC_SRCS = uxtheme_res.rc
+
+SUBDIRS = tests

 @MAKE_DLL_RULES@

Index: dlls/uxtheme/main.c
===================================================================
RCS file: /home/wine/wine/dlls/uxtheme/main.c,v
retrieving revision 1.1
diff -u -r1.1 main.c
--- dlls/uxtheme/main.c	4 Oct 2003 03:48:11 -0000	1.1
+++ dlls/uxtheme/main.c	20 Nov 2003 01:06:07 -0000
@@ -21,6 +21,7 @@
 #include "config.h"

 #include <stdarg.h>
+#include <assert.h>

 #include "windef.h"
 #include "winbase.h"
@@ -28,53 +29,451 @@
 #include "wingdi.h"
 #include "uxtheme.h"

+#include "uxthemedll.h"
+
+#include "msstyles.h"
+
 #include "wine/debug.h"

 WINE_DEFAULT_DEBUG_CHANNEL(uxtheme);

-/* For the moment, do nothing here. */
+/***********************************************************************
+* Defines and global variables
+*/
+
+BOOL bInitialized = FALSE;
+PUXTHEME_ENGINE puxEngine = NULL;
+
+/***********************************************************************/
+
 BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
 {
+    TRACE("%p 0x%lx %p\n", hInstDLL, fdwReason, lpv);
     switch(fdwReason) {
         case DLL_PROCESS_ATTACH:
             DisableThreadLibraryCalls(hInstDLL);
-	    break;
-	case DLL_PROCESS_DETACH:
-	    break;
+            break;
+        case DLL_PROCESS_DETACH:
+            break;
     }
     return TRUE;
 }

+/*
+ * Global initialization, and choosing theme engine.
+ * For now just use msstyles
+ */
+void UXTHEME_Initialize()
+{
+    PUXTHEME_ENGINE MSSTYLES_Initialize();
+    bInitialized = TRUE;
+    puxEngine = MSSTYLES_Initialize();
+}
+
 BOOL WINAPI IsAppThemed(void)
 {
-    FIXME("\n");
-    return FALSE;
+    if(!bInitialized) UXTHEME_Initialize();
+    return puxEngine->p_IsAppThemed();
 }

 BOOL WINAPI IsThemeActive(void)
 {
-    FIXME("\n");
-    return FALSE;
+    if(!bInitialized) UXTHEME_Initialize();
+    return puxEngine->p_IsThemeActive();
+}
+
+HRESULT WINAPI EnableThemeDialogTexture(HWND hwnd, DWORD dwFlags)
+{
+    if(!bInitialized) UXTHEME_Initialize();
+    return puxEngine->p_EnableThemeDialogTexture(hwnd, dwFlags);
 }

-HRESULT WINAPI EnableThemeDialogTexture(HWND hwnd, DWORD dwFlags) {
-    FIXME("%p 0x%08lx\n", hwnd, dwFlags);
-    return ERROR_CALL_NOT_IMPLEMENTED;
+HRESULT WINAPI EnableTheming(BOOL fEnable)
+{
+    if(!bInitialized) UXTHEME_Initialize();
+    return puxEngine->p_EnableTheming(fEnable);
 }

-HRESULT WINAPI EnableTheming(BOOL fEnable) {
-    FIXME("%d\n", fEnable);
-    return ERROR_CALL_NOT_IMPLEMENTED;
+HTHEME WINAPI OpenThemeData(HWND hwnd, LPCWSTR pszClassList)
+{
+    if(!bInitialized) UXTHEME_Initialize();
+    return (HTHEME)puxEngine->p_OpenThemeData(hwnd, pszClassList);
 }

-HTHEME WINAPI OpenThemeData(HWND hwnd, LPCWSTR pszClassList) {
-    FIXME("%p %s\n", hwnd, debugstr_w(pszClassList));
-    return NULL;
+HTHEME WINAPI GetWindowTheme(HWND hwnd)
+{
+    if(!bInitialized) UXTHEME_Initialize();
+    return (HTHEME)puxEngine->p_GetWindowTheme(hwnd);
 }

 HRESULT WINAPI SetWindowTheme(HWND hwnd, LPCWSTR pszSubAppName,
-                              LPCWSTR pszSubIdList) {
-    FIXME("%p %s %s\n", hwnd, debugstr_w(pszSubAppName),
-          debugstr_w(pszSubIdList));
-    return ERROR_CALL_NOT_IMPLEMENTED;
+                              LPCWSTR pszSubIdList)
+{
+    if(!bInitialized) UXTHEME_Initialize();
+    return puxEngine->p_SetWindowTheme(hwnd, pszSubAppName, pszSubIdList);
+}
+
+HRESULT WINAPI GetCurrentThemeName(LPWSTR pszThemeFileName, int dwMaxNameChars,
+                                   LPWSTR pszColorBuff, int cchMaxColorChars,
+                                   LPWSTR pszSizeBuff, int cchMaxSizeChars)
+{
+    if(!bInitialized) UXTHEME_Initialize();
+    return puxEngine->p_GetCurrentThemeName(pszThemeFileName, dwMaxNameChars,
+                                            pszColorBuff, cchMaxColorChars,
+                                            pszSizeBuff, cchMaxSizeChars);
+}
+
+DWORD WINAPI GetThemeAppProperties(void)
+{
+    if(!bInitialized) UXTHEME_Initialize();
+    return puxEngine->p_GetThemeAppProperties();
+}
+
+void WINAPI SetThemeAppProperties(DWORD dwFlags)
+{
+    if(!bInitialized) UXTHEME_Initialize();
+    puxEngine->p_SetThemeAppProperties(dwFlags);
+}
+
+HRESULT WINAPI DrawThemeParentBackground(HWND hwnd, HDC hdc, RECT *prc)
+{
+    if(!bInitialized) UXTHEME_Initialize();
+    return puxEngine->p_DrawThemeParentBackground(hwnd, hdc, prc);
+}
+
+HRESULT WINAPI GetThemeDocumentationProperty(LPCWSTR pszThemeName,
+                                             LPCWSTR pszPropertyName,
+                                              LPWSTR pszValueBuff,
+                                              int cchMaxValChars)
+{
+    if(!bInitialized) UXTHEME_Initialize();
+    return puxEngine->p_GetThemeDocumentationProperty(
+        pszThemeName, pszPropertyName, pszValueBuff, cchMaxValChars);
+}
+
+BOOL WINAPI IsThemeDialogTextureEnabled(void)
+{
+    if(!bInitialized) UXTHEME_Initialize();
+    return puxEngine->p_IsThemeDialogTextureEnabled();
+}
+
+
+HRESULT WINAPI CloseThemeData(HTHEME hTheme)
+{
+    if(!hTheme)
+        return E_HANDLE;
+    return ((PUXTHEME_HANDLE)hTheme)->vtbl->p_CloseThemeData(hTheme);
+}
+
+HRESULT WINAPI DrawThemeBackground(HTHEME hTheme, HDC hdc, int iPartId,
+                                   int iStateId, const RECT *pRect,
+                                   const RECT *pClipRect)
+{
+    if(!hTheme)
+        return E_HANDLE;
+    return ((PUXTHEME_HANDLE)hTheme)->vtbl->p_DrawThemeBackground(
+        hTheme, hdc, iPartId, iStateId, pRect, pClipRect);
+}
+
+HRESULT WINAPI DrawThemeBackgroundEx(HTHEME hTheme, HDC hdc, int iPartId,
+                                     int iStateId, const RECT *pRect,
+                                     const DTBGOPTS *pOptions)
+{
+    if(!hTheme)
+        return E_HANDLE;
+    return ((PUXTHEME_HANDLE)hTheme)->vtbl->p_DrawThemeBackgroundEx(
+        hTheme, hdc, iPartId, iStateId, pRect, pOptions);
+}
+
+HRESULT WINAPI DrawThemeEdge(HTHEME hTheme, HDC hdc, int iPartId,
+                             int iStateId, const RECT *pDestRect, UINT uEdge,
+                             UINT uFlags, RECT *pContentRect)
+{
+    if(!hTheme)
+        return E_HANDLE;
+    return ((PUXTHEME_HANDLE)hTheme)->vtbl->p_DrawThemeEdge(
+        hTheme, hdc, iPartId, iStateId, pDestRect, uEdge, uFlags, pContentRect);
+}
+
+HRESULT WINAPI DrawThemeIcon(HTHEME hTheme, HDC hdc, int iPartId, int iStateId,
+                             const RECT *pRect, HIMAGELIST himl, int iImageIndex)
+{
+    if(!hTheme)
+        return E_HANDLE;
+    return ((PUXTHEME_HANDLE)hTheme)->vtbl->p_DrawThemeIcon(
+        hTheme, hdc, iPartId, iStateId, pRect, himl, iImageIndex);
+}
+
+HRESULT WINAPI DrawThemeText(HTHEME hTheme, HDC hdc, int iPartId, int iStateId,
+                             LPCWSTR pszText, int iCharCount, DWORD dwTextFlags,
+                             DWORD dwTextFlags2, const RECT *pRect)
+{
+    if(!hTheme)
+        return E_HANDLE;
+    return ((PUXTHEME_HANDLE)hTheme)->vtbl->p_DrawThemeText(
+        hTheme, hdc, iPartId, iStateId, pszText, iCharCount, dwTextFlags,
+        dwTextFlags2, pRect);
+}
+
+HRESULT WINAPI GetThemeBackgroundContentRect(HTHEME hTheme, HDC hdc, int iPartId,
+                                             int iStateId,
+                                             const RECT *pBoundingRect,
+                                             RECT *pContentRect)
+{
+    if(!hTheme)
+        return E_HANDLE;
+    return ((PUXTHEME_HANDLE)hTheme)->vtbl->p_GetThemeBackgroundContentRect(
+        hTheme, hdc, iPartId, iStateId, pBoundingRect, pContentRect);
+}
+
+HRESULT WINAPI GetThemeBackgroundExtent(HTHEME hTheme, HDC hdc, int iPartId,
+                                        int iStateId, const RECT *pContentRect,
+                                        RECT *pExtentRect)
+{
+    if(!hTheme)
+        return E_HANDLE;
+    return ((PUXTHEME_HANDLE)hTheme)->vtbl->p_GetThemeBackgroundExtent(
+        hTheme, hdc, iPartId, iStateId, pContentRect, pExtentRect);
+}
+
+HRESULT WINAPI GetThemeBackgroundRegion(HTHEME hTheme, HDC hdc, int iPartId,
+                                        int iStateId, const RECT *pRect,
+                                        HRGN *pRegion)
+{
+    if(!hTheme)
+        return E_HANDLE;
+    return ((PUXTHEME_HANDLE)hTheme)->vtbl->p_GetThemeBackgroundRegion(
+        hTheme, hdc, iPartId, iStateId, pRect, pRegion);
+}
+
+HRESULT WINAPI GetThemeBool(HTHEME hTheme, int iPartId, int iStateId,
+                            int iPropId, BOOL *pfVal)
+{
+    if(!hTheme)
+        return E_HANDLE;
+    return ((PUXTHEME_HANDLE)hTheme)->vtbl->p_GetThemeBool(
+        hTheme, iPartId, iStateId, iPropId, pfVal);
+}
+
+HRESULT WINAPI GetThemeColor(HTHEME hTheme, int iPartId, int iStateId,
+                             int iPropId, COLORREF *pColor)
+{
+    if(!hTheme)
+        return E_HANDLE;
+    return ((PUXTHEME_HANDLE)hTheme)->vtbl->p_GetThemeColor(
+        hTheme, iPartId, iStateId, iPropId, pColor);
+}
+
+HRESULT WINAPI GetThemeEnumValue(HTHEME hTheme, int iPartId, int iStateId,
+                                 int iPropId, int *piVal)
+{
+    if(!hTheme)
+        return E_HANDLE;
+    return ((PUXTHEME_HANDLE)hTheme)->vtbl->p_GetThemeEnumValue(
+        hTheme, iPartId, iStateId, iPropId, piVal);
+}
+
+HRESULT WINAPI GetThemeFilename(HTHEME hTheme, int iPartId, int iStateId,
+                                int iPropId, LPWSTR pszThemeFilename,
+                                int cchMaxBuffChars)
+{
+    if(!hTheme)
+        return E_HANDLE;
+    return ((PUXTHEME_HANDLE)hTheme)->vtbl->p_GetThemeFilename(
+        hTheme, iPartId, iStateId, iPropId, pszThemeFilename, cchMaxBuffChars);
+}
+
+HRESULT WINAPI GetThemeFont(HTHEME hTheme, HDC hdc, int iPartId,
+                            int iStateId, int iPropId, LOGFONTW *pFont)
+{
+    if(!hTheme)
+        return E_HANDLE;
+    return ((PUXTHEME_HANDLE)hTheme)->vtbl->p_GetThemeFont(
+        hTheme, hdc, iPartId, iStateId, iPropId, pFont);
+}
+
+HRESULT WINAPI GetThemeInt(HTHEME hTheme, int iPartId, int iStateId,
+                           int iPropId, int *piVal)
+{
+    if(!hTheme)
+        return E_HANDLE;
+    return ((PUXTHEME_HANDLE)hTheme)->vtbl->p_GetThemeInt(
+        hTheme, iPartId, iStateId, iPropId, piVal);
+}
+
+HRESULT WINAPI GetThemeIntList(HTHEME hTheme, int iPartId, int iStateId,
+                               int iPropId, INTLIST *pIntList)
+{
+    if(!hTheme)
+        return E_HANDLE;
+    return ((PUXTHEME_HANDLE)hTheme)->vtbl->p_GetThemeIntList(
+        hTheme, iPartId, iStateId, iPropId, pIntList);
+}
+
+HRESULT WINAPI GetThemeMargins(HTHEME hTheme, HDC hdc, int iPartId,
+                               int iStateId, int iPropId, RECT *prc,
+                               MARGINS *pMargins)
+{
+    if(!hTheme)
+        return E_HANDLE;
+    return ((PUXTHEME_HANDLE)hTheme)->vtbl->p_GetThemeMargins(
+        hTheme, hdc, iPartId, iStateId, iPropId, prc, pMargins);
+}
+
+HRESULT WINAPI GetThemeMetric(HTHEME hTheme, HDC hdc, int iPartId,
+                              int iStateId, int iPropId, int *piVal)
+{
+    if(!hTheme)
+        return E_HANDLE;
+    return ((PUXTHEME_HANDLE)hTheme)->vtbl->p_GetThemeMetric(
+        hTheme, hdc, iPartId, iStateId, iPropId, piVal);
+}
+
+HRESULT WINAPI GetThemePartSize(HTHEME hTheme, HDC hdc, int iPartId,
+                                int iStateId, RECT *prc, THEMESIZE eSize,
+                                SIZE *psz)
+{
+    if(!hTheme)
+        return E_HANDLE;
+    return ((PUXTHEME_HANDLE)hTheme)->vtbl->p_GetThemePartSize(
+        hTheme, hdc, iPartId, iStateId, prc, eSize, psz);
+}
+
+HRESULT WINAPI GetThemePosition(HTHEME hTheme, int iPartId, int iStateId,
+                                int iPropId, POINT *pPoint)
+{
+    if(!hTheme)
+        return E_HANDLE;
+    return ((PUXTHEME_HANDLE)hTheme)->vtbl->p_GetThemePosition(
+        hTheme, iPartId, iStateId, iPropId, pPoint);
+}
+
+HRESULT WINAPI GetThemePropertyOrigin(HTHEME hTheme, int iPartId, int iStateId,
+                                      int iPropId, PROPERTYORIGIN *pOrigin)
+{
+    if(!hTheme)
+        return E_HANDLE;
+    return ((PUXTHEME_HANDLE)hTheme)->vtbl->p_GetThemePropertyOrigin(
+        hTheme, iPartId, iStateId, iPropId, pOrigin);
+}
+
+HRESULT WINAPI GetThemeRect(HTHEME hTheme, int iPartId, int iStateId,
+                            int iPropId, RECT *pRect)
+{
+    if(!hTheme)
+        return E_HANDLE;
+    return ((PUXTHEME_HANDLE)hTheme)->vtbl->p_GetThemeRect(
+        hTheme, iPartId, iStateId, iPropId, pRect);
+}
+
+HRESULT WINAPI GetThemeString(HTHEME hTheme, int iPartId, int iStateId,
+                              int iPropId, LPWSTR pszBuff, int cchMaxBuffChars)
+{
+    if(!hTheme)
+        return E_HANDLE;
+    return ((PUXTHEME_HANDLE)hTheme)->vtbl->p_GetThemeString(
+        hTheme, iPartId, iStateId, iPropId, pszBuff, cchMaxBuffChars);
+}
+
+BOOL WINAPI GetThemeSysBool(HTHEME hTheme, int iBoolID)
+{
+    if(!hTheme)
+        return FALSE;
+    return ((PUXTHEME_HANDLE)hTheme)->vtbl->p_GetThemeSysBool(hTheme, iBoolID);
+}
+
+COLORREF WINAPI GetThemeSysColor(HTHEME hTheme, int iColorID)
+{
+    if(!hTheme)
+        return 0;
+    return ((PUXTHEME_HANDLE)hTheme)->vtbl->p_GetThemeSysBool(hTheme, iColorID);
+}
+
+HBRUSH WINAPI GetThemeSysColorBrush(HTHEME hTheme, int iColorID)
+{
+    if(!hTheme)
+        return NULL;
+    return ((PUXTHEME_HANDLE)hTheme)->vtbl->p_GetThemeSysColorBrush(hTheme, iColorID);
+}
+
+HRESULT WINAPI GetThemeSysFont(HTHEME hTheme, int iFontID, LOGFONTW *plf)
+{
+    if(!hTheme)
+        return E_HANDLE;
+    return ((PUXTHEME_HANDLE)hTheme)->vtbl->p_GetThemeSysFont(
+        hTheme, iFontID, plf);
+}
+
+HRESULT WINAPI GetThemeSysInt(HTHEME hTheme, int iIntID, int *piValue)
+{
+    if(!hTheme)
+        return E_HANDLE;
+    return ((PUXTHEME_HANDLE)hTheme)->vtbl->p_GetThemeSysInt(
+        hTheme, iIntID, piValue);
+}
+
+int WINAPI GetThemeSysSize(HTHEME hTheme, int iSizeID)
+{
+    if(!hTheme)
+        return 0;
+    return ((PUXTHEME_HANDLE)hTheme)->vtbl->p_GetThemeSysSize(hTheme, iSizeID);
+}
+
+HRESULT WINAPI GetThemeSysString(HTHEME hTheme, int iStringID,
+                                 LPWSTR pszStringBuff, int cchMaxStringChars)
+{
+    if(!hTheme)
+        return E_HANDLE;
+    return ((PUXTHEME_HANDLE)hTheme)->vtbl->p_GetThemeSysString(
+        hTheme, iStringID, pszStringBuff, cchMaxStringChars);
+}
+
+HRESULT WINAPI GetThemeTextExtent(HTHEME hTheme, HDC hdc, int iPartId,
+                                  int iStateId, LPCWSTR pszText, int iCharCount,
+                                  DWORD dwTextFlags, const RECT *pBoundingRect,
+                                  RECT *pExtentRect)
+{
+    if(!hTheme)
+        return E_HANDLE;
+    return ((PUXTHEME_HANDLE)hTheme)->vtbl->p_GetThemeTextExtent(
+        hTheme, hdc, iPartId, iStateId, pszText, iCharCount, dwTextFlags,
+        pBoundingRect, pExtentRect);
+}
+
+HRESULT WINAPI GetThemeTextMetrics(HTHEME hTheme, HDC hdc, int iPartId,
+                                   int iStateId, TEXTMETRICW *ptm)
+{
+    if(!hTheme)
+        return E_HANDLE;
+    return ((PUXTHEME_HANDLE)hTheme)->vtbl->p_GetThemeTextMetrics(
+        hTheme, hdc, iPartId, iStateId, ptm);
+}
+
+HRESULT WINAPI HitTestThemeBackground(HTHEME hTheme, HDC hdc, int iPartId,
+                                     int iStateId, DWORD dwOptions,
+                                     const RECT *pRect, HRGN hrgn,
+                                     POINT ptTest, WORD *pwHitTestCode)
+{
+    if(!hTheme)
+        return E_HANDLE;
+    return ((PUXTHEME_HANDLE)hTheme)->vtbl->p_HitTestThemeBackground(
+        hTheme, hdc, iPartId, iStateId, dwOptions, pRect, hrgn, ptTest,
+        pwHitTestCode);
+}
+
+BOOL WINAPI IsThemeBackgroundPartiallyTransparent(HTHEME hTheme, int iPartId,
+                                                  int iStateId)
+{
+    if(!hTheme)
+        return FALSE;
+    return ((PUXTHEME_HANDLE)hTheme)->vtbl->p_IsThemeBackgroundPartiallyTransparent(
+        hTheme, iPartId, iStateId);
+}
+
+BOOL WINAPI IsThemePartDefined(HTHEME hTheme, int iPartId, int iStateId)
+{
+    if(!hTheme)
+        return FALSE;
+    return ((PUXTHEME_HANDLE)hTheme)->vtbl->p_IsThemePartDefined(
+        hTheme, iPartId, iStateId);
 }
Index: dlls/uxtheme/uxtheme.spec
===================================================================
RCS file: /home/wine/wine/dlls/uxtheme/uxtheme.spec,v
retrieving revision 1.1
diff -u -r1.1 uxtheme.spec
--- dlls/uxtheme/uxtheme.spec	4 Oct 2003 03:48:11 -0000	1.1
+++ dlls/uxtheme/uxtheme.spec	20 Nov 2003 01:06:07 -0000
@@ -1,48 +1,48 @@
-@ stub CloseThemeData
-@ stub DrawThemeBackground
-@ stub DrawThemeBackgroundEx
-@ stub DrawThemeEdge
-@ stub DrawThemeIcon
-@ stub DrawThemeParentBackground
-@ stub DrawThemeText
-@ stdcall EnableThemeDialogTexture(ptr long)
-@ stdcall EnableTheming(long)
-@ stub GetCurrentThemeName
-@ stub GetThemeAppProperties
-@ stub GetThemeBackgroundContentRect
-@ stub GetThemeBackgroundExtent
-@ stub GetThemeBackgroundRegion
-@ stub GetThemeBool
-@ stub GetThemeColor
-@ stub GetThemeDocumentationProperty
-@ stub GetThemeEnumValue
-@ stub GetThemeFilename
-@ stub GetThemeFont
-@ stub GetThemeInt
-@ stub GetThemeIntList
-@ stub GetThemeMargins
-@ stub GetThemeMetric
-@ stub GetThemePartSize
-@ stub GetThemePosition
-@ stub GetThemePropertyOrigin
-@ stub GetThemeRect
-@ stub GetThemeString
-@ stub GetThemeSysBool
-@ stub GetThemeSysColor
-@ stub GetThemeSysColorBrush
-@ stub GetThemeSysFont
-@ stub GetThemeSysInt
-@ stub GetThemeSysSize
-@ stub GetThemeSysString
-@ stub GetThemeTextExtent
-@ stub GetThemeTextMetrics
-@ stub GetWindowTheme
-@ stub HitTestThemeBackground
-@ stdcall IsAppThemed()
-@ stdcall IsThemeActive()
-@ stub IsThemeBackgroundPartiallyTransparent
-@ stub IsThemeDialogTextureEnabled
-@ stub IsThemePartDefined
-@ stdcall OpenThemeData(ptr wstr)
-@ stub SetThemeAppProperties
-@ stdcall SetWindowTheme(ptr wstr wstr)
+5  stdcall CloseThemeData(ptr)
+6  stdcall DrawThemeBackground(ptr ptr long long ptr ptr)
+12 stdcall DrawThemeEdge(ptr ptr long long ptr long long ptr)
+37 stdcall DrawThemeIcon(ptr ptr long long ptr ptr long)
+38 stdcall DrawThemeParentBackground(ptr ptr ptr)
+39 stdcall DrawThemeText(ptr ptr long long wstr long long long ptr)
+40 stdcall EnableThemeDialogTexture(ptr long)
+41 stdcall EnableTheming(long)
+42 stdcall GetCurrentThemeName(wstr long wstr long wstr long)
+47 stdcall DrawThemeBackgroundEx(ptr ptr long long ptr ptr)
+49 stdcall GetThemeAppProperties()
+50 stdcall GetThemeBackgroundContentRect(ptr ptr long long ptr ptr)
+51 stdcall GetThemeBackgroundExtent(ptr ptr long long ptr ptr)
+52 stdcall GetThemeBackgroundRegion(ptr ptr long long ptr ptr)
+53 stdcall GetThemeBool(ptr long long long ptr)
+54 stdcall GetThemeColor(ptr long long long ptr)
+55 stdcall GetThemeDocumentationProperty(wstr wstr wstr long)
+56 stdcall GetThemeEnumValue(ptr long long long ptr)
+57 stdcall GetThemeFilename(ptr long long long wstr long)
+58 stdcall GetThemeFont(ptr ptr long long long ptr)
+59 stdcall GetThemeInt(ptr long long long ptr)
+64 stdcall GetThemeIntList(ptr long long long ptr)
+65 stdcall GetThemeMargins(ptr ptr long long long ptr ptr)
+66 stdcall GetThemeMetric(ptr ptr long long long ptr)
+67 stdcall GetThemePartSize(ptr ptr long long ptr long ptr)
+68 stdcall GetThemePosition(ptr long long long ptr)
+69 stdcall GetThemePropertyOrigin(ptr long long long ptr)
+70 stdcall GetThemeRect(ptr long long long ptr)
+71 stdcall GetThemeString(ptr long long long wstr long)
+72 stdcall GetThemeSysBool(ptr long)
+73 stdcall GetThemeSysColor(ptr long)
+74 stdcall GetThemeSysColorBrush(ptr long)
+75 stdcall GetThemeSysFont(ptr long ptr)
+76 stdcall GetThemeSysInt(ptr long ptr)
+77 stdcall GetThemeSysSize(ptr long)
+78 stdcall GetThemeSysString(ptr long wstr long)
+79 stdcall GetThemeTextExtent(ptr ptr long long wstr long long ptr ptr)
+80 stdcall GetThemeTextMetrics(ptr ptr long long ptr)
+81 stdcall GetWindowTheme(ptr)
+82 stdcall HitTestThemeBackground(ptr ptr long long long ptr ptr long ptr)
+83 stdcall IsAppThemed()
+84 stdcall IsThemeActive()
+85 stdcall IsThemeBackgroundPartiallyTransparent(ptr long long)
+86 stdcall IsThemeDialogTextureEnabled()
+87 stdcall IsThemePartDefined(ptr long long)
+88 stdcall OpenThemeData(ptr wstr)
+89 stdcall SetThemeAppProperties(long)
+90 stdcall SetWindowTheme(ptr wstr wstr)
--- /dev/null	1969-12-31 19:00:00.000000000 -0500
+++ dlls/uxtheme/msstyles.c	2003-11-19 20:22:59.000000000 -0500
@@ -0,0 +1,234 @@
+/*
+ * Windows XP msstyles theme
+ *
+ * Copyright (C) 2003 Kevin Koltzau
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include "config.h"
+
+#include <stdarg.h>
+#include <assert.h>
+
+#include "windef.h"
+#include "winbase.h"
+#include "winuser.h"
+#include "wingdi.h"
+#include "winreg.h"
+#include "uxtheme.h"
+#include "tmschema.h"
+
+#include "uxthemedll.h"
+#include "msstyles.h"
+
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(uxtheme);
+
+/***********************************************************************
+ * Defines and global variables
+ */
+
+LPCWSTR SubAppNameProperty = (const WCHAR[]){'u','x','S','u','b','A','p','p','N','a','m','e'};
+LPCWSTR SubIdListProperty  = (const WCHAR[]){'u','x','S','u','b','I','d','L','i','s','t'};
+
+DWORD dwThemeAppProperties = STAP_ALLOW_NONCLIENT | STAP_ALLOW_CONTROLS;
+
+
+PUXTHEME_HANDLE MSSTYLES_OpenThemeData(HWND hwnd, LPCWSTR pszClassList);
+PUXTHEME_HANDLE MSSTYLES_GetWindowTheme(HWND hWnd);
+HRESULT MSSTYLES_EnableTheming(BOOL fEnable);
+BOOL MSSTYLES_IsThemeActive(void);
+BOOL MSSTYLES_IsAppThemed(void);
+HRESULT MSSTYLES_EnableThemeDialogTexture(HWND hwnd, DWORD dwFlags);
+HRESULT MSSTYLES_SetWindowTheme(HWND hwnd, LPCWSTR pszSubAppName,
+                                        LPCWSTR pszSubIdList);
+HRESULT MSSTYLES_GetCurrentThemeName(LPWSTR pszThemeFileName, int dwMaxNameChars,
+                                     LPWSTR pszColorBuff, int cchMaxColorChars,
+                                     LPWSTR pszSizeBuff, int cchMaxSizeChars);
+DWORD MSSTYLES_GetThemeAppProperties(void);
+void MSSTYLES_SetThemeAppProperties(DWORD dwFlags);
+HRESULT MSSTYLES_DrawThemeParentBackground(HWND hwnd, HDC hdc, RECT *prc);
+BOOL MSSTYLES_IsThemeDialogTextureEnabled(void);
+
+UXTHEME_ENGINE MSSTYLES_Engine = {
+    (void*)MSSTYLES_OpenThemeData,
+    (void*)MSSTYLES_GetWindowTheme,
+    (void*)MSSTYLES_EnableTheming,
+    (void*)MSSTYLES_IsThemeActive,
+    (void*)MSSTYLES_IsAppThemed,
+    (void*)MSSTYLES_EnableThemeDialogTexture,
+    (void*)MSSTYLES_SetWindowTheme,
+    (void*)MSSTYLES_GetCurrentThemeName,
+    (void*)MSSTYLES_GetThemeAppProperties,
+    (void*)MSSTYLES_SetThemeAppProperties,
+    (void*)MSSTYLES_DrawThemeParentBackground,
+    (void*)MSSTYLES_IsThemeDialogTextureEnabled
+};
+
+/***********************************************************************/
+
+LPWSTR MSSTYLES_GetWindowProperty(HWND hwnd, LPCWSTR pszProp)
+{
+    return GetPropW(hwnd, pszProp);
+}
+
+HRESULT MSSTYLES_SetWindowProperty(HWND hwnd, LPCWSTR pszProp, LPCWSTR pszValue)
+{
+    LPWSTR pszNewValue, pszOldValue;
+    int len;
+
+    assert(hwnd && pszProp);
+
+    pszOldValue = MSSTYLES_GetWindowProperty(hwnd, pszProp);
+    if(pszOldValue)
+        HeapFree(GetProcessHeap(), 0, pszOldValue);
+
+    if(!pszValue) {
+        RemovePropW(hwnd, pszProp);
+        return S_OK;
+    }
+
+    len = lstrlenW(pszValue)+1;
+    pszNewValue = HeapAlloc(GetProcessHeap(), 0, len);
+    if(!pszNewValue)
+        return E_OUTOFMEMORY;
+
+    lstrcpyW(pszNewValue, pszValue);
+
+    if(!SetPropW(hwnd, pszProp, pszNewValue)) {
+        HeapFree(GetProcessHeap(), 0, pszNewValue);
+        return HRESULT_FROM_WIN32(GetLastError());
+    }
+    return S_OK;
+}
+
+PUXTHEME_ENGINE MSSTYLES_Initialize()
+{
+    return &MSSTYLES_Engine;
+}
+
+PUXTHEME_HANDLE MSSTYLES_OpenThemeData(HWND hwnd, LPCWSTR pszClassList)
+{
+    if(!pszClassList)
+        return NULL;
+    if(!MSSTYLES_IsAppThemed())
+        return NULL;
+    FIXME("%p,%s\n", hwnd, debugstr_w(pszClassList));
+    return NULL;
+}
+
+PUXTHEME_HANDLE MSSTYLES_GetWindowTheme(HWND hWnd)
+{
+    FIXME("%p\n", hWnd);
+    if(!IsWindow(hWnd))
+        return NULL;
+    return NULL;
+}
+
+HRESULT MSSTYLES_EnableTheming(BOOL fEnable)
+{
+    /* This is a global & persistant change */
+    FIXME("%d\n", fEnable);
+    return ERROR_CALL_NOT_IMPLEMENTED;
+}
+
+BOOL MSSTYLES_IsThemeActive(void)
+{
+    FIXME("\n");
+    return FALSE;
+}
+
+BOOL MSSTYLES_IsAppThemed(void)
+{
+    /* If IsThemeActive==FALSE this is always FALSE */
+    FIXME("\n");
+    if(!MSSTYLES_IsThemeActive())
+        return FALSE;
+
+    return FALSE;
+}
+
+HRESULT MSSTYLES_EnableThemeDialogTexture(HWND hwnd, DWORD dwFlags)
+{
+    FIXME("%p 0x%08lx\n", hwnd, dwFlags);
+    if(!IsWindow(hwnd))
+        return HRESULT_FROM_WIN32(ERROR_INVALID_WINDOW_HANDLE);
+    return S_OK;
+}
+
+/*
+ * This currently leaks memory, the properties set on the window don't
+ * get freed when the window is destroyed, possible solution would be to subclass
+ * the window and free memory in WM_DESTROY.
+ */
+HRESULT MSSTYLES_SetWindowTheme(HWND hwnd, LPCWSTR pszSubAppName,
+                                        LPCWSTR pszSubIdList)
+{
+    HRESULT res;
+
+    TRACE("(%p,%s,%s)\n", hwnd, debugstr_w(pszSubAppName),
+          debugstr_w(pszSubIdList));
+
+    /* Retain the pszSubAppName and pszSubIdList for the lifetime of the
+     * window, even if visual styles change.
+     */
+    res = MSSTYLES_SetWindowProperty(hwnd, SubAppNameProperty, pszSubAppName);
+    if(SUCCEEDED(res))
+        res = MSSTYLES_SetWindowProperty(hwnd, SubIdListProperty, pszSubIdList);
+
+    if(SUCCEEDED(res))
+    {
+        /* Inform the window its theme just changed */
+        PostMessageW(hwnd, WM_THEMECHANGED, 0, 0);
+    }
+    return res;
+}
+
+HRESULT MSSTYLES_GetCurrentThemeName(LPWSTR pszThemeFileName, int dwMaxNameChars,
+                                     LPWSTR pszColorBuff, int cchMaxColorChars,
+                                     LPWSTR pszSizeBuff, int cchMaxSizeChars)
+{
+    FIXME("\n");
+    return E_PROP_ID_UNSUPPORTED;
+}
+
+DWORD MSSTYLES_GetThemeAppProperties(void)
+{
+    return dwThemeAppProperties;
+}
+
+void MSSTYLES_SetThemeAppProperties(DWORD dwFlags)
+{
+    TRACE("0x%lx\n", dwFlags);
+    dwThemeAppProperties = dwFlags;
+}
+
+HRESULT MSSTYLES_DrawThemeParentBackground(HWND hwnd, HDC hdc, RECT *prc)
+{
+    FIXME("\n");
+    if(!IsWindow(hwnd))
+        return E_HANDLE;
+    if(!hdc)
+        return E_HANDLE;
+    return 0;
+}
+
+BOOL MSSTYLES_IsThemeDialogTextureEnabled(void)
+{
+    FIXME("\n");
+    return FALSE;
+}
--- /dev/null	1969-12-31 19:00:00.000000000 -0500
+++ dlls/uxtheme/msstyles.h	2003-11-12 23:15:31.000000000 -0500
@@ -0,0 +1,28 @@
+/*
+ * Windows XP msstyles theme
+ *
+ * Copyright (C) 2003 Kevin Koltzau
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef __WINE_MSSTYLES_H
+#define __WINE_MSSTYLES_H
+
+//BOOL MSSTYLES_Initialize(HINSTANCE hInst);
+//BOOL MSSTYLES_Cleanup();
+//HTHEME MSSTYLES_OpenThemeData(HWND hwnd, LPCWSTR pszClassList);
+
+#endif
--- /dev/null	1969-12-31 19:00:00.000000000 -0500
+++ dlls/uxtheme/tests/.cvsignore	2003-11-18 00:25:22.000000000 -0500
@@ -0,0 +1,4 @@
+Makefile
+theme.ok
+testlist.c
+theme_test.exe.spec.c
--- /dev/null	1969-12-31 19:00:00.000000000 -0500
+++ dlls/uxtheme/tests/Makefile.in	2003-11-18 23:41:40.000000000 -0500
@@ -0,0 +1,13 @@
+TOPSRCDIR = @top_srcdir@
+TOPOBJDIR = ../../..
+SRCDIR    = @srcdir@
+VPATH     = @srcdir@
+TESTDLL   = uxtheme.dll
+IMPORTS   = uxtheme user32
+
+CTESTS = \
+	theme.c
+
+@MAKE_TEST_RULES@
+
+### Dependencies:
--- /dev/null	1969-12-31 19:00:00.000000000 -0500
+++ dlls/uxtheme/tests/theme.c	2003-11-18 23:33:42.000000000 -0500
@@ -0,0 +1,137 @@
+/*
+ * Unit test suite for uxtheme functions
+ *
+ * Copyright 2003 Kevin Koltzau
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <assert.h>
+#include <stdarg.h>
+
+#include <windows.h>
+#include <uxtheme.h>
+
+#include "wine/test.h"
+
+HWND hwndMain;
+HWND hwndButton;
+
+void test_OpenTheme(HWND hWnd)
+{
+    WCHAR szInvalidClassList1[] = {
+      'D','E','A','D','B','E','E','F','\0'
+    };
+    WCHAR szInvalidClassList2[] = {
+      'D','E','A','D',';','B','E','E','F','\0'
+    };
+    WCHAR szClassList1[] = {
+      'B','U','T','T','O','N','\0'
+    };
+    WCHAR szClassList2[] = {
+      'N','O','N','E',';','B','U','T','T','O','N','\0'
+    };
+    HTHEME hTheme1, hTheme2;
+    HRESULT hr;
+    assert(hWnd);
+
+    hTheme1 = OpenThemeData(NULL,NULL);
+    ok(!hTheme1, "expected hTheme1==NULL, got hTheme1=%p", hTheme1);
+    hTheme1 = OpenThemeData(hWnd,NULL);
+    ok(!hTheme1, "expected hTheme1==NULL, got hTheme1=%p", hTheme1);
+    hTheme1 = OpenThemeData(NULL, szInvalidClassList1);
+    ok(!hTheme1, "expected hTheme1==NULL, got hTheme1=%p", hTheme1);
+    hTheme1 = OpenThemeData(hWnd, szInvalidClassList1);
+    ok(!hTheme1, "expected hTheme1==NULL, got hTheme1=%p", hTheme1);
+    hTheme1 = OpenThemeData(NULL, szInvalidClassList2);
+    ok(!hTheme1, "expected hTheme1==NULL, got hTheme1=%p", hTheme1);
+    hTheme1 = OpenThemeData(hWnd, szInvalidClassList2);
+    ok(!hTheme1, "expected hTheme1==NULL, got hTheme1=%p", hTheme1);
+
+    hTheme1 = GetWindowTheme(NULL);
+    ok(!hTheme1, "expected hTheme1==NULL, got hTheme1=%p", hTheme1);
+
+    todo_wine {
+        hTheme1 = OpenThemeData(hWnd,szClassList1);
+        ok(hTheme1!=NULL, "expected hTheme1!=NULL with hWnd=%p", hWnd);
+        hTheme1 = OpenThemeData(hWnd,szClassList2);
+        ok(hTheme1!=NULL, "expected hTheme1!=NULL with hWnd=%p", hWnd);
+        hTheme2 = GetWindowTheme(hWnd);
+        ok(hTheme1&&hTheme1==hTheme2, "expected hTheme1==hTheme2, got %p==%p with hWnd=%p", hTheme1, hTheme2, hWnd);
+        hr = CloseThemeData(hTheme1);
+        ok(hr == S_OK, "theme didn't close properly: hr=0x%08lx", hr);
+        hr = CloseThemeData(hTheme2);
+        ok(hr == S_OK, "theme didn't close properly: hr=0x%08lx", hr);
+    }
+}
+
+void test_DrawThemeParentBackground(HWND hWnd)
+{
+    HRESULT hr;
+    HDC dc = GetDC(hWnd);
+    RECT rt = {100,100,100,100};
+    assert(dc);
+    hr = DrawThemeParentBackground(NULL,NULL,NULL);
+    ok(hr == E_HANDLE, "expected invalid handle, got 0x%08lx", hr);
+    hr = DrawThemeParentBackground(hWnd,NULL,NULL);
+    ok(hr == E_HANDLE, "expected invalid handle, got 0x%08lx", hr);
+    hr = DrawThemeParentBackground(hWnd,dc,NULL);
+    ok(hr == S_OK, "expected success, got 0x%08lx", hr);
+    hr = DrawThemeParentBackground(hWnd,dc,&rt);
+    ok(hr == S_OK, "expected success, got 0x%08lx", hr);
+    hr = DrawThemeParentBackground(hWnd,NULL,&rt);
+    ok(hr == E_HANDLE, "expected invalid handle, got 0x%08lx", hr);
+    ReleaseDC(hWnd, dc);
+}
+
+static LRESULT WINAPI main_window_procA(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
+{
+    return DefWindowProcA(hwnd, msg, wparam, lparam);
+}
+
+static BOOL RegisterWindowClasses(void)
+{
+    WNDCLASSA cls;
+
+    cls.style = 0;
+    cls.lpfnWndProc = main_window_procA;
+    cls.cbClsExtra = 0;
+    cls.cbWndExtra = 0;
+    cls.hInstance = GetModuleHandleA(0);
+    cls.hIcon = 0;
+    cls.hCursor = LoadCursorA(0, (LPSTR)IDC_ARROW);
+    cls.hbrBackground = 0;
+    cls.lpszMenuName = NULL;
+    cls.lpszClassName = "MainWindowClass";
+    if(!RegisterClassA(&cls)) return FALSE;
+    return TRUE;
+}
+
+START_TEST(theme)
+{
+    if(!RegisterWindowClasses()) assert(0);
+
+    hwndMain = CreateWindowExA(0, "MainWindowClass", "Main window",
+                               WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX |
+                               WS_MAXIMIZEBOX | WS_POPUP,
+                               100, 100, 200, 200,
+                               0, 0, 0, NULL);
+    assert(hwndMain);
+    hwndButton = CreateWindowA("BUTTON", "Test", WS_CHILD, 100,100,100,100, hwndMain, 0, 0, NULL);
+    assert(hwndButton);
+
+    test_OpenTheme(hwndButton);
+    test_DrawThemeParentBackground(hwndButton);
+}
--- /dev/null	1969-12-31 19:00:00.000000000 -0500
+++ dlls/uxtheme/uxthemedll.h	2003-11-13 22:39:27.000000000 -0500
@@ -0,0 +1,140 @@
+/*
+ * Windows XP msstyles theme
+ *
+ * Copyright (C) 2003 Kevin Koltzau
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef __WINE_UXTHEMEDLL_H
+#define __WINE_UXTHEMEDLL_H
+
+typedef struct UXTHEME_VTABLE UXTHEME_VTABLE;
+typedef UXTHEME_VTABLE *PUXTHEME_VTABLE;
+
+typedef struct _UXTHEME_HANDLE {
+    UXTHEME_VTABLE *vtbl;
+} UXTHEME_HANDLE, *PUXTHEME_HANDLE;
+
+struct UXTHEME_VTABLE {
+    HRESULT (*p_CloseThemeData)(PUXTHEME_HANDLE hTheme);
+    HRESULT (*p_DrawThemeBackground)(PUXTHEME_HANDLE hTheme, HDC hdc,
+                                     int iPartId, int iStateId,
+                                     const RECT *pRect, const RECT *pClipRect);
+    HRESULT (*p_DrawThemeBackgroundEx)(PUXTHEME_HANDLE hTheme, HDC hdc,
+                                       int iPartId, int iStateId,
+                                       const RECT *pRect,
+                                       const DTBGOPTS *pOptions);
+    HRESULT (*p_DrawThemeEdge)(PUXTHEME_HANDLE hTheme, HDC hdc, int iPartId,
+                               int iStateId, const RECT *pDestRect, UINT uEdge,
+                               UINT uFlags, RECT *pContentRect);
+    HRESULT (*p_DrawThemeIcon)(PUXTHEME_HANDLE hTheme, HDC hdc, int iPartId,
+                               int iStateId, const RECT *pRect, HIMAGELIST himl,
+                               int iImageIndex);
+    HRESULT (*p_DrawThemeText)(PUXTHEME_HANDLE hTheme, HDC hdc, int iPartId,
+                               int iStateId, LPCWSTR pszText, int iCharCount,
+                               DWORD dwTextFlags, DWORD dwTextFlags2,
+                               const RECT *pRect);
+    HRESULT (*p_GetThemeBackgroundContentRect)(PUXTHEME_HANDLE hTheme, HDC hdc,
+                                               int iPartId, int iStateId,
+                                               const RECT *pBoundingRect,
+                                               RECT *pContentRect);
+    HRESULT (*p_GetThemeBackgroundExtent)(PUXTHEME_HANDLE hTheme, HDC hdc,
+                                          int iPartId, int iStateId,
+                                          const RECT *pContentRect,
+                                          RECT *pExtentRect);
+    HRESULT (*p_GetThemeBackgroundRegion)(PUXTHEME_HANDLE hTheme, HDC hdc,
+                                          int iPartId, int iStateId,
+                                          const RECT *pRect,
+                                          HRGN *pRegion);
+    HRESULT (*p_GetThemeBool)(PUXTHEME_HANDLE hTheme, int iPartId, int iStateId,
+                              int iPropId, BOOL *pfVal);
+    HRESULT (*p_GetThemeColor)(PUXTHEME_HANDLE hTheme, int iPartId, int iStateId,
+                               int iPropId, COLORREF *pColor);
+    HRESULT (*p_GetThemeEnumValue)(PUXTHEME_HANDLE hTheme, int iPartId,
+                                   int iStateId, int iPropId, int *piVal);
+    HRESULT (*p_GetThemeFilename)(PUXTHEME_HANDLE hTheme, int iPartId,
+                                  int iStateId, int iPropId,
+                                  LPWSTR pszThemeFilename, int cchMaxBuffChars);
+    HRESULT (*p_GetThemeFont)(PUXTHEME_HANDLE hTheme, HDC hdc, int iPartId,
+                              int iStateId, int iPropId, LOGFONTW *pFont);
+    HRESULT (*p_GetThemeInt)(PUXTHEME_HANDLE hTheme, int iPartId, int iStateId,
+                             int iPropId, int *piVal);
+    HRESULT (*p_GetThemeIntList)(PUXTHEME_HANDLE hTheme, int iPartId, int iStateId,
+                                 int iPropId, INTLIST *pIntList);
+    HRESULT (*p_GetThemeMargins)(PUXTHEME_HANDLE hTheme, HDC hdc, int iPartId,
+                                 int iStateId, int iPropId, RECT *prc,
+                                 MARGINS *pMargins);
+    HRESULT (*p_GetThemeMetric)(PUXTHEME_HANDLE hTheme, HDC hdc, int iPartId,
+                                int iStateId, int iPropId, int *piVal);
+    HRESULT (*p_GetThemePartSize)(PUXTHEME_HANDLE hTheme, HDC hdc, int iPartId,
+                                  int iStateId, RECT *prc, THEMESIZE eSize,
+                                  SIZE *psz);
+    HRESULT (*p_GetThemePosition)(PUXTHEME_HANDLE hTheme, int iPartId,
+                                  int iStateId, int iPropId, POINT *pPoint);
+    HRESULT (*p_GetThemePropertyOrigin)(PUXTHEME_HANDLE hTheme, int iPartId,
+                                        int iStateId, int iPropId,
+                                        PROPERTYORIGIN *pOrigin);
+    HRESULT (*p_GetThemeRect)(PUXTHEME_HANDLE hTheme, int iPartId, int iStateId,
+                              int iPropId, RECT *pRect);
+    HRESULT (*p_GetThemeString)(PUXTHEME_HANDLE hTheme, int iPartId, int iStateId,
+                                int iPropId, LPWSTR pszBuff, int cchMaxBuffChars);
+    BOOL    (*p_GetThemeSysBool)(PUXTHEME_HANDLE hTheme, int iBoolID);
+    COLORREF (*p_GetThemeSysColor)(PUXTHEME_HANDLE hTheme, int iColorID);
+    HBRUSH   (*p_GetThemeSysColorBrush)(PUXTHEME_HANDLE hTheme, int iColorID);
+    HRESULT  (*p_GetThemeSysFont)(PUXTHEME_HANDLE hTheme, int iFontID, LOGFONTW *plf);
+    HRESULT  (*p_GetThemeSysInt)(PUXTHEME_HANDLE hTheme, int iIntID, int *piValue);
+    int      (*p_GetThemeSysSize)(PUXTHEME_HANDLE hTheme, int iSizeID);
+    HRESULT  (*p_GetThemeSysString)(PUXTHEME_HANDLE hTheme, int iStringID,
+                                    LPWSTR pszStringBuff, int cchMaxStringChars);
+    HRESULT  (*p_GetThemeTextExtent)(PUXTHEME_HANDLE hTheme, HDC hdc, int iPartId,
+                                     int iStateId, LPCWSTR pszText, int iCharCount,
+                                     DWORD dwTextFlags, const RECT *pBoundingRect,
+                                     RECT *pExtentRect);
+    HRESULT  (*p_GetThemeTextMetrics)(PUXTHEME_HANDLE hTheme, HDC hdc, int iPartId,
+                                      int iStateId, TEXTMETRICW *ptm);
+    HRESULT  (*p_HitTestThemeBackground)(PUXTHEME_HANDLE hTheme, HDC hdc,
+                                         int iPartId, int iStateId,
+                                         DWORD dwOptions, const RECT *pRect,
+                                         HRGN hrgn, POINT ptTest,
+                                         WORD *pwHitTestCode);
+    BOOL     (*p_IsThemeBackgroundPartiallyTransparent)(PUXTHEME_HANDLE hTheme,
+                                                        int iPartId, int iStateId);
+    BOOL     (*p_IsThemePartDefined)(PUXTHEME_HANDLE hTheme, int iPartId, int iStateId);
+};
+
+typedef struct _UXTHEME_ENGINE {
+    PUXTHEME_HANDLE (*p_OpenThemeData)(HWND hwnd, LPCWSTR pszClassList);
+    PUXTHEME_HANDLE (*p_GetWindowTheme)(HWND hwnd);
+    HRESULT (*p_EnableTheming)(BOOL fEnable);
+    BOOL    (*p_IsThemeActive)(void);
+    BOOL    (*p_IsAppThemed)(void);
+    HRESULT (*p_EnableThemeDialogTexture)(HWND hwnd, DWORD dwFlags);
+    HRESULT (*p_SetWindowTheme)(HWND hwnd, LPCWSTR pszSubAppName,
+                                LPCWSTR pszSubIdList);
+    HRESULT (*p_GetCurrentThemeName)(LPWSTR pszThemeFileName, int dwMaxNameChars,
+                                     LPWSTR pszColorBuff, int cchMaxColorChars,
+                                     LPWSTR pszSizeBuff, int cchMaxSizeChars);
+    DWORD   (*p_GetThemeAppProperties)(void);
+    void    (*p_SetThemeAppProperties)(DWORD dwFlags);
+    HRESULT (*p_DrawThemeParentBackground)(HWND hwnd, HDC hdc, RECT *prc);
+    HRESULT (*p_GetThemeDocumentationProperty)(LPCWSTR pszThemeName,
+                                               LPCWSTR pszPropertyName,
+                                               LPWSTR pszValueBuff,
+                                               int cchMaxValChars);
+    BOOL    (*p_IsThemeDialogTextureEnabled)(void);
+} UXTHEME_ENGINE, *PUXTHEME_ENGINE;
+
+#endif

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux