2003-07-30 18:31:20 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: include/wx/msw/uxtheme.h
|
|
|
|
// Purpose: wxUxThemeEngine class: support for XP themes
|
2004-09-07 07:11:05 -04:00
|
|
|
// Author:
|
2003-07-30 18:31:20 -04:00
|
|
|
// Modified by:
|
|
|
|
// Created: 2003
|
|
|
|
// RCS-ID: $Id$
|
2004-05-23 10:56:36 -04:00
|
|
|
// Copyright: (c) 2003 wxWidgets Dev-Team
|
2004-05-23 16:53:33 -04:00
|
|
|
// License: wxWindows licence
|
2003-07-30 18:31:20 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
2003-06-01 11:18:36 -04:00
|
|
|
|
|
|
|
#ifndef _WX_UXTHEME_H_
|
|
|
|
#define _WX_UXTHEME_H_
|
|
|
|
|
2003-08-09 08:38:21 -04:00
|
|
|
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
2003-07-30 18:31:20 -04:00
|
|
|
#pragma interface "uxtheme.h"
|
2003-06-02 06:27:03 -04:00
|
|
|
#endif
|
|
|
|
|
2003-07-30 18:31:20 -04:00
|
|
|
#include "wx/defs.h"
|
2003-06-01 11:18:36 -04:00
|
|
|
|
2003-07-30 20:59:37 -04:00
|
|
|
#include "wx/msw/wrapwin.h"
|
|
|
|
|
2003-06-01 11:18:36 -04:00
|
|
|
#if wxUSE_UNICODE
|
|
|
|
typedef struct _WXUOSVERSIONINFOEXW {
|
|
|
|
WXDWORD dwOSVersionInfoSize;
|
|
|
|
WXDWORD dwMajorVersion;
|
|
|
|
WXDWORD dwMinorVersion;
|
|
|
|
WXDWORD dwBuildNumber;
|
|
|
|
WXDWORD dwPlatformId;
|
|
|
|
wchar_t szCSDVersion[ 128 ]; // Maintenance string for PSS usage
|
|
|
|
unsigned short wServicePackMajor;
|
|
|
|
unsigned short wServicePackMinor;
|
|
|
|
unsigned short wSuiteMask;
|
|
|
|
unsigned char wProductType;
|
|
|
|
unsigned char wReserved;
|
|
|
|
} WXUOSVERSIONINFOEXW, *PWXUOSVERSIONINFOEXW, *LPWXUOSVERSIONINFOEXW;
|
|
|
|
#define WXUOSVERSIONINFOEX WXUOSVERSIONINFOEXW
|
|
|
|
#define PWXUOSVERSIONINFOEX PWXUOSVERSIONINFOEXW
|
|
|
|
#define LPWXUOSVERSIONINFOEX LPWXUOSVERSIONINFOEXW
|
|
|
|
#else
|
|
|
|
typedef struct _WXUOSVERSIONINFOEXA {
|
|
|
|
WXDWORD dwOSVersionInfoSize;
|
|
|
|
WXDWORD dwMajorVersion;
|
|
|
|
WXDWORD dwMinorVersion;
|
|
|
|
WXDWORD dwBuildNumber;
|
|
|
|
WXDWORD dwPlatformId;
|
|
|
|
char szCSDVersion [128]; // Maintenance string for PSS usage
|
|
|
|
unsigned short wServicePackMajor;
|
|
|
|
unsigned short wServicePackMinor;
|
|
|
|
unsigned short wSuiteMask;
|
|
|
|
unsigned char wProductType;
|
|
|
|
unsigned char wReserved;
|
|
|
|
} WXUOSVERSIONINFOEXA, *PWXUOSVERSIONINFOEXA, *LPWXUOSVERSIONINFOEXA;
|
|
|
|
#define WXUOSVERSIONINFOEX WXUOSVERSIONINFOEXA
|
|
|
|
#define PWXUOSVERSIONINFOEX PWXUOSVERSIONINFOEXA
|
|
|
|
#define LPWXUOSVERSIONINFOEX LPWXUOSVERSIONINFOEXA
|
|
|
|
#endif
|
|
|
|
|
|
|
|
typedef void* WXHTHEME;
|
|
|
|
typedef long WXUHRESULT;
|
2004-09-07 07:11:05 -04:00
|
|
|
typedef WXHTHEME (__stdcall *PFNWXUOPENTHEMEDATA)(WXHWND, const wchar_t *);
|
2003-07-30 18:31:20 -04:00
|
|
|
typedef WXUHRESULT (__stdcall *PFNWXUCLOSETHEMEDATA)(WXHTHEME);
|
2004-09-07 07:11:05 -04:00
|
|
|
typedef WXUHRESULT (__stdcall *PFNWXUDRAWTHEMEBACKGROUND)(WXHTHEME, WXHDC,
|
2003-07-30 20:59:37 -04:00
|
|
|
int, int, const RECT *, const RECT *);
|
2003-06-01 11:18:36 -04:00
|
|
|
#define WXU_DTT_GRAYED 0x1
|
2004-09-07 07:11:05 -04:00
|
|
|
typedef WXUHRESULT (__stdcall *PFNWXUDRAWTHEMETEXT)(WXHTHEME, WXHDC, int,
|
|
|
|
int, const wchar_t *, int, DWORD,
|
2003-07-30 20:59:37 -04:00
|
|
|
DWORD, const RECT *);
|
2004-09-07 07:11:05 -04:00
|
|
|
typedef WXUHRESULT (__stdcall *PFNWXUGETTHEMEBACKGROUNDCONTENTRECT)(WXHTHEME, WXHDC,
|
2003-07-30 20:59:37 -04:00
|
|
|
int, int, const RECT *, RECT *);
|
2004-09-07 07:11:05 -04:00
|
|
|
typedef WXUHRESULT (__stdcall *PFNWXUGETTHEMEBACKGROUNDEXTENT)(WXHTHEME, WXHDC, int, int,
|
2003-07-30 20:59:37 -04:00
|
|
|
const RECT *, RECT *);
|
2003-06-01 11:18:36 -04:00
|
|
|
|
2003-06-02 06:27:03 -04:00
|
|
|
enum WXUTHEMESIZE
|
2003-06-01 11:18:36 -04:00
|
|
|
{
|
|
|
|
WXU_TS_MIN, // minimum size
|
|
|
|
WXU_TS_TRUE, // size without stretching
|
2003-06-02 06:27:03 -04:00
|
|
|
WXU_TS_DRAW // size that theme mgr will use to draw part
|
2003-06-01 11:18:36 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct tagWXUSIZE
|
|
|
|
{
|
|
|
|
long cx;
|
|
|
|
long cy;
|
2003-07-30 18:31:20 -04:00
|
|
|
} WXUSIZE;
|
2003-06-01 11:18:36 -04:00
|
|
|
|
|
|
|
typedef struct tagWXUTEXTMETRIC
|
|
|
|
{
|
|
|
|
long tmHeight;
|
|
|
|
long tmAscent;
|
|
|
|
long tmDescent;
|
|
|
|
long tmInternalLeading;
|
|
|
|
long tmExternalLeading;
|
|
|
|
long tmAveCharWidth;
|
|
|
|
long tmMaxCharWidth;
|
|
|
|
long tmWeight;
|
|
|
|
long tmOverhang;
|
|
|
|
long tmDigitizedAspectX;
|
|
|
|
long tmDigitizedAspectY;
|
|
|
|
wchar_t tmFirstChar;
|
|
|
|
wchar_t tmLastChar;
|
|
|
|
wchar_t tmDefaultChar;
|
|
|
|
wchar_t tmBreakChar;
|
|
|
|
unsigned char tmItalic;
|
|
|
|
unsigned char tmUnderlined;
|
|
|
|
unsigned char tmStruckOut;
|
|
|
|
unsigned char tmPitchAndFamily;
|
|
|
|
unsigned char tmCharSet;
|
|
|
|
} WXUTEXTMETRIC;
|
|
|
|
|
2004-09-07 07:11:05 -04:00
|
|
|
typedef WXUHRESULT (__stdcall *PFNWXUGETTHEMEPARTSIZE)(WXHTHEME, WXHDC, int, int, const RECT *,
|
2003-07-30 18:31:20 -04:00
|
|
|
enum WXUTHEMESIZE, WXUSIZE *);
|
2004-09-07 07:11:05 -04:00
|
|
|
typedef WXUHRESULT (__stdcall *PFNWXUGETTHEMETEXTEXTENT)(WXHTHEME, WXHDC, int, int, const wchar_t *,
|
2003-07-30 20:59:37 -04:00
|
|
|
int, WXDWORD, const RECT *, RECT *);
|
2003-06-01 11:18:36 -04:00
|
|
|
typedef WXUHRESULT (__stdcall *PFNWXUGETTHEMETEXTMETRICS)(WXHTHEME, WXHDC,
|
|
|
|
int, int, WXUTEXTMETRIC*);
|
|
|
|
typedef WXUHRESULT (__stdcall *PFNWXUGETTHEMEBACKGROUNDREGION)(WXHTHEME, WXHDC,
|
2003-07-30 20:59:37 -04:00
|
|
|
int, int, const RECT *, WXHRGN *);
|
2003-06-01 11:18:36 -04:00
|
|
|
|
|
|
|
#define WXU_HTTB_BACKGROUNDSEG 0x0000
|
|
|
|
#define WXU_HTTB_FIXEDBORDER 0x0002
|
|
|
|
#define WXU_HTTB_CAPTION 0x0004
|
|
|
|
#define WXU_HTTB_RESIZINGBORDER_LEFT 0x0010
|
|
|
|
#define WXU_HTTB_RESIZINGBORDER_TOP 0x0020
|
|
|
|
#define WXU_HTTB_RESIZINGBORDER_RIGHT 0x0040
|
|
|
|
#define WXU_HTTB_RESIZINGBORDER_BOTTOM 0x0080
|
|
|
|
#define WXU_HTTB_RESIZINGBORDER 0x00F0
|
|
|
|
#define WXU_HTTB_SIZINGTEMPLATE 0x0100
|
|
|
|
#define WXU_HTTB_SYSTEMSIZINGMARGINS 0x0200
|
|
|
|
|
|
|
|
typedef struct tagWXUPOINT
|
|
|
|
{
|
|
|
|
long x;
|
|
|
|
long y;
|
2003-07-30 18:31:20 -04:00
|
|
|
} WXUPOINT;
|
2003-06-01 11:18:36 -04:00
|
|
|
|
|
|
|
typedef WXUHRESULT (__stdcall *PFNWXUHITTESTTHEMEBACKGROUND)(WXHTHEME, WXHDC, int,
|
2003-07-30 20:59:37 -04:00
|
|
|
int, WXDWORD, const RECT *, WXHRGN,
|
2003-07-30 18:31:20 -04:00
|
|
|
WXUPOINT, unsigned short *);
|
2003-06-01 11:18:36 -04:00
|
|
|
typedef WXUHRESULT (__stdcall *PFNWXUDRAWTHEMEEDGE)(WXHTHEME, WXHDC, int, int,
|
2003-07-30 20:59:37 -04:00
|
|
|
const RECT *, unsigned int, unsigned int, RECT *);
|
2003-06-01 11:18:36 -04:00
|
|
|
typedef WXUHRESULT (__stdcall *PFNWXUDRAWTHEMEICON)(WXHTHEME, WXHDC, int, int,
|
2003-07-30 20:59:37 -04:00
|
|
|
const RECT *, WXHIMAGELIST, int);
|
|
|
|
typedef BOOL (__stdcall *PFNWXUISTHEMEPARTDEFINED)(WXHTHEME, int, int);
|
|
|
|
typedef BOOL (__stdcall *PFNWXUISTHEMEBACKGROUNDPARTIALLYTRANSPARENT)(WXHTHEME, int, int);
|
2003-07-30 18:31:20 -04:00
|
|
|
typedef WXUHRESULT (__stdcall *PFNWXUGETTHEMECOLOR)(WXHTHEME, int, int, int, WXCOLORREF*);
|
2003-06-01 11:18:36 -04:00
|
|
|
typedef WXUHRESULT (__stdcall *PFNWXUGETTHEMEMETRIC)(WXHTHEME, WXHDC, int,
|
2003-07-30 18:31:20 -04:00
|
|
|
int, int, int *);
|
2003-06-01 11:18:36 -04:00
|
|
|
typedef WXUHRESULT (__stdcall *PFNWXUGETTHEMESTRING)(WXHTHEME, int,
|
2003-07-30 18:31:20 -04:00
|
|
|
int, int, wchar_t *, int);
|
2003-07-30 20:59:37 -04:00
|
|
|
typedef WXUHRESULT (__stdcall *PFNWXUGETTHEMEBOOL)(WXHTHEME, int, int, int, BOOL *);
|
2003-07-30 18:31:20 -04:00
|
|
|
typedef WXUHRESULT (__stdcall *PFNWXUGETTHEMEINT)(WXHTHEME, int, int, int, int *);
|
|
|
|
typedef WXUHRESULT (__stdcall *PFNWXUGETTHEMEENUMVALUE)(WXHTHEME, int, int, int, int *);
|
|
|
|
typedef WXUHRESULT (__stdcall *PFNWXUGETTHEMEPOSITION)(WXHTHEME, int, int, int, WXUPOINT *);
|
2003-06-01 11:18:36 -04:00
|
|
|
typedef struct tagWXULOGFONT
|
|
|
|
{
|
|
|
|
long lfHeight;
|
|
|
|
long lfWidth;
|
|
|
|
long lfEscapement;
|
|
|
|
long lfOrientation;
|
|
|
|
long lfWeight;
|
|
|
|
unsigned char lfItalic;
|
|
|
|
unsigned char lfUnderline;
|
|
|
|
unsigned char lfStrikeOut;
|
|
|
|
unsigned char lfCharSet;
|
|
|
|
unsigned char lfOutPrecision;
|
|
|
|
unsigned char lfClipPrecision;
|
|
|
|
unsigned char lfQuality;
|
|
|
|
unsigned char lfPitchAndFamily;
|
|
|
|
wchar_t lfFaceName[32];
|
2003-07-30 18:31:20 -04:00
|
|
|
} WXULOGFONT;
|
|
|
|
typedef WXUHRESULT (__stdcall *PFNWXUGETTHEMEFONT)(WXHTHEME, WXHDC, int, int, int, WXULOGFONT *);
|
2003-07-30 20:59:37 -04:00
|
|
|
typedef WXUHRESULT (__stdcall *PFNWXUGETTHEMERECT)(WXHTHEME, int, int, int, RECT *);
|
2003-06-01 11:18:36 -04:00
|
|
|
typedef struct _WXUMARGINS
|
|
|
|
{
|
|
|
|
int cxLeftWidth; // width of left border that retains its size
|
|
|
|
int cxRightWidth; // width of right border that retains its size
|
|
|
|
int cyTopHeight; // height of top border that retains its size
|
|
|
|
int cyBottomHeight; // height of bottom border that retains its size
|
|
|
|
} WXUMARGINS, *PWXUMARGINS;
|
|
|
|
typedef WXUHRESULT (__stdcall *PFNWXUGETTHEMEMARGINS)(WXHTHEME, WXHDC, int,
|
2003-07-30 20:59:37 -04:00
|
|
|
int, int, RECT *, WXUMARGINS *);
|
2003-06-01 11:18:36 -04:00
|
|
|
|
|
|
|
#define WXU_MAX_INTLIST_COUNT 10
|
|
|
|
typedef struct _WXUINTLIST
|
|
|
|
{
|
|
|
|
int iValueCount; // number of values in iValues
|
|
|
|
int iValues[WXU_MAX_INTLIST_COUNT];
|
|
|
|
} WXUINTLIST, *PWXUINTLIST;
|
|
|
|
typedef WXUHRESULT (__stdcall *PFNWXUGETTHEMEINTLIST)(WXHTHEME, int,
|
2004-09-07 07:11:05 -04:00
|
|
|
int, int, WXUINTLIST*);
|
2003-06-02 06:27:03 -04:00
|
|
|
|
|
|
|
enum WXUPROPERTYORIGIN
|
2003-06-01 11:18:36 -04:00
|
|
|
{
|
|
|
|
WXU_PO_STATE, // property was found in the state section
|
|
|
|
WXU_PO_PART, // property was found in the part section
|
|
|
|
WXU_PO_CLASS, // property was found in the class section
|
|
|
|
WXU_PO_GLOBAL, // property was found in [globals] section
|
|
|
|
WXU_PO_NOTFOUND // property was not found
|
|
|
|
};
|
2003-06-02 06:27:03 -04:00
|
|
|
|
2003-06-01 11:18:36 -04:00
|
|
|
typedef WXUHRESULT (__stdcall *PFNWXUGETTHEMEPROPERTYORIGIN)(WXHTHEME, int,
|
2003-07-30 18:31:20 -04:00
|
|
|
int, int, enum WXUPROPERTYORIGIN *);
|
|
|
|
typedef WXUHRESULT (__stdcall *PFNWXUSETWINDOWTHEME)(WXHWND, const wchar_t*, const wchar_t *);
|
|
|
|
typedef WXUHRESULT (__stdcall *PFNWXUGETTHEMEFILENAME)(WXHTHEME, int, int, int, wchar_t *, int);
|
|
|
|
typedef WXCOLORREF (__stdcall *PFNWXUGETTHEMESYSCOLOR)(WXHTHEME, int);
|
|
|
|
typedef WXHBRUSH (__stdcall *PFNWXUGETTHEMESYSCOLORBRUSH)(WXHTHEME, int);
|
2003-07-30 20:59:37 -04:00
|
|
|
typedef BOOL (__stdcall *PFNWXUGETTHEMESYSBOOL)(WXHTHEME, int);
|
2003-07-30 18:31:20 -04:00
|
|
|
typedef int (__stdcall *PFNWXUGETTHEMESYSSIZE)(WXHTHEME, int);
|
|
|
|
typedef WXUHRESULT (__stdcall *PFNWXUGETTHEMESYSFONT)(WXHTHEME, int, WXULOGFONT *);
|
|
|
|
typedef WXUHRESULT (__stdcall *PFNWXUGETTHEMESYSSTRING)(WXHTHEME, int, wchar_t *, int);
|
|
|
|
typedef WXUHRESULT (__stdcall *PFNWXUGETTHEMESYSINT)(WXHTHEME, int, int *);
|
2003-07-30 20:59:37 -04:00
|
|
|
typedef BOOL (__stdcall *PFNWXUISTHEMEACTIVE)();
|
|
|
|
typedef BOOL (__stdcall *PFNWXUISAPPTHEMED)();
|
2003-07-30 18:31:20 -04:00
|
|
|
typedef WXHTHEME (__stdcall *PFNWXUGETWINDOWTHEME)(WXHWND);
|
2003-06-01 11:18:36 -04:00
|
|
|
|
|
|
|
#define WXU_ETDT_DISABLE 0x00000001
|
|
|
|
#define WXU_ETDT_ENABLE 0x00000002
|
|
|
|
#define WXU_ETDT_USETABTEXTURE 0x00000004
|
|
|
|
#define WXU_ETDT_ENABLETAB 0x00000006
|
|
|
|
|
2003-07-30 18:31:20 -04:00
|
|
|
typedef WXUHRESULT (__stdcall *PFNWXUENABLETHEMEDIALOGTEXTURE)(WXHWND, WXDWORD);
|
2003-07-30 20:59:37 -04:00
|
|
|
typedef BOOL (__stdcall *PFNWXUISTHEMEDIALOGTEXTUREENABLED)(WXHWND);
|
2003-06-01 11:18:36 -04:00
|
|
|
|
|
|
|
#define WXU_STAP_ALLOW_NONCLIENT 1
|
|
|
|
#define WXU_STAP_ALLOW_CONTROLS 2
|
|
|
|
#define WXU_STAP_ALLOW_WEBCONTENT 4
|
|
|
|
|
2003-07-30 18:31:20 -04:00
|
|
|
typedef WXDWORD (__stdcall *PFNWXUGETTHEMEAPPPROPERTIES)();
|
|
|
|
typedef void (__stdcall *PFNWXUSETTHEMEAPPPROPERTIES)(WXDWORD);
|
2004-09-07 07:11:05 -04:00
|
|
|
typedef WXUHRESULT (__stdcall *PFNWXUGETCURRENTTHEMENAME)(wchar_t *, int,
|
2003-07-30 18:31:20 -04:00
|
|
|
wchar_t *, int, wchar_t *, int);
|
2003-06-01 11:18:36 -04:00
|
|
|
|
|
|
|
#define WXU_SZ_THDOCPROP_DISPLAYNAME L"DisplayName"
|
|
|
|
#define WXU_SZ_THDOCPROP_CANONICALNAME L"ThemeName"
|
|
|
|
#define WXU_SZ_THDOCPROP_TOOLTIP L"ToolTip"
|
|
|
|
#define WXU_SZ_THDOCPROP_AUTHOR L"author"
|
|
|
|
|
|
|
|
typedef WXUHRESULT (__stdcall *PFNWXUGETTHEMEDOCUMENTATIONPROPERTY)(const wchar_t *,
|
2003-07-30 18:31:20 -04:00
|
|
|
const wchar_t *, wchar_t *, int);
|
2003-07-30 20:59:37 -04:00
|
|
|
typedef WXUHRESULT (__stdcall *PFNWXUDRAWTHEMEPARENTBACKGROUND)(WXHWND, WXHDC, RECT *);
|
|
|
|
typedef WXUHRESULT (__stdcall *PFNWXUENABLETHEMING)(BOOL);
|
2003-07-30 18:31:20 -04:00
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxUxThemeEngine: provides all theme functions from uxtheme.dll
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// we always define this class, even if wxUSE_UXTHEME == 0, but we just make it
|
|
|
|
// empty in this case -- this allows to use it elsewhere without any #ifdefs
|
|
|
|
#if wxUSE_UXTHEME
|
|
|
|
#include "wx/dynload.h"
|
|
|
|
|
|
|
|
#define wxUX_THEME_DECLARE(type, func) type func;
|
|
|
|
#else
|
|
|
|
#define wxUX_THEME_DECLARE(type, func) type func(...) { return 0; }
|
|
|
|
#endif
|
2003-06-01 11:18:36 -04:00
|
|
|
|
2003-06-02 06:27:03 -04:00
|
|
|
class WXDLLEXPORT wxUxThemeEngine
|
2003-06-01 11:18:36 -04:00
|
|
|
{
|
|
|
|
public:
|
2003-07-30 18:31:20 -04:00
|
|
|
// get the theme engine or NULL if themes are not available
|
|
|
|
static wxUxThemeEngine *Get();
|
|
|
|
|
2004-11-19 12:17:00 -05:00
|
|
|
// get the theme enging or NULL if themes are not available or not used for
|
|
|
|
// this application
|
|
|
|
static wxUxThemeEngine *GetIfActive();
|
|
|
|
|
2003-07-30 18:31:20 -04:00
|
|
|
// all uxtheme.dll functions
|
|
|
|
wxUX_THEME_DECLARE(PFNWXUOPENTHEMEDATA, OpenThemeData)
|
|
|
|
wxUX_THEME_DECLARE(PFNWXUCLOSETHEMEDATA, CloseThemeData)
|
|
|
|
wxUX_THEME_DECLARE(PFNWXUDRAWTHEMEBACKGROUND, DrawThemeBackground)
|
|
|
|
wxUX_THEME_DECLARE(PFNWXUDRAWTHEMETEXT, DrawThemeText)
|
|
|
|
wxUX_THEME_DECLARE(PFNWXUGETTHEMEBACKGROUNDCONTENTRECT, GetThemeBackgroundContentRect)
|
|
|
|
wxUX_THEME_DECLARE(PFNWXUGETTHEMEBACKGROUNDEXTENT, GetThemeBackgroundExtent)
|
|
|
|
wxUX_THEME_DECLARE(PFNWXUGETTHEMEPARTSIZE, GetThemePartSize)
|
|
|
|
wxUX_THEME_DECLARE(PFNWXUGETTHEMETEXTEXTENT, GetThemeTextExtent)
|
|
|
|
wxUX_THEME_DECLARE(PFNWXUGETTHEMETEXTMETRICS, GetThemeTextMetrics)
|
|
|
|
wxUX_THEME_DECLARE(PFNWXUGETTHEMEBACKGROUNDREGION, GetThemeBackgroundRegion)
|
|
|
|
wxUX_THEME_DECLARE(PFNWXUHITTESTTHEMEBACKGROUND, HitTestThemeBackground)
|
|
|
|
wxUX_THEME_DECLARE(PFNWXUDRAWTHEMEEDGE, DrawThemeEdge)
|
|
|
|
wxUX_THEME_DECLARE(PFNWXUDRAWTHEMEICON, DrawThemeIcon)
|
|
|
|
wxUX_THEME_DECLARE(PFNWXUISTHEMEPARTDEFINED, IsThemePartDefined)
|
|
|
|
wxUX_THEME_DECLARE(PFNWXUISTHEMEBACKGROUNDPARTIALLYTRANSPARENT, IsThemeBackgroundPartiallyTransparent)
|
|
|
|
wxUX_THEME_DECLARE(PFNWXUGETTHEMECOLOR, GetThemeColor)
|
|
|
|
wxUX_THEME_DECLARE(PFNWXUGETTHEMEMETRIC, GetThemeMetric)
|
|
|
|
wxUX_THEME_DECLARE(PFNWXUGETTHEMESTRING, GetThemeString)
|
|
|
|
wxUX_THEME_DECLARE(PFNWXUGETTHEMEBOOL, GetThemeBool)
|
|
|
|
wxUX_THEME_DECLARE(PFNWXUGETTHEMEINT, GetThemeInt)
|
|
|
|
wxUX_THEME_DECLARE(PFNWXUGETTHEMEENUMVALUE, GetThemeEnumValue)
|
|
|
|
wxUX_THEME_DECLARE(PFNWXUGETTHEMEPOSITION, GetThemePosition)
|
|
|
|
wxUX_THEME_DECLARE(PFNWXUGETTHEMEFONT, GetThemeFont)
|
|
|
|
wxUX_THEME_DECLARE(PFNWXUGETTHEMERECT, GetThemeRect)
|
|
|
|
wxUX_THEME_DECLARE(PFNWXUGETTHEMEMARGINS, GetThemeMargins)
|
|
|
|
wxUX_THEME_DECLARE(PFNWXUGETTHEMEINTLIST, GetThemeIntList)
|
|
|
|
wxUX_THEME_DECLARE(PFNWXUGETTHEMEPROPERTYORIGIN, GetThemePropertyOrigin)
|
|
|
|
wxUX_THEME_DECLARE(PFNWXUSETWINDOWTHEME, SetWindowTheme)
|
|
|
|
wxUX_THEME_DECLARE(PFNWXUGETTHEMEFILENAME, GetThemeFilename)
|
|
|
|
wxUX_THEME_DECLARE(PFNWXUGETTHEMESYSCOLOR, GetThemeSysColor)
|
|
|
|
wxUX_THEME_DECLARE(PFNWXUGETTHEMESYSCOLORBRUSH, GetThemeSysColorBrush)
|
|
|
|
wxUX_THEME_DECLARE(PFNWXUGETTHEMESYSBOOL, GetThemeSysBool)
|
|
|
|
wxUX_THEME_DECLARE(PFNWXUGETTHEMESYSSIZE, GetThemeSysSize)
|
|
|
|
wxUX_THEME_DECLARE(PFNWXUGETTHEMESYSFONT, GetThemeSysFont)
|
|
|
|
wxUX_THEME_DECLARE(PFNWXUGETTHEMESYSSTRING, GetThemeSysString)
|
|
|
|
wxUX_THEME_DECLARE(PFNWXUGETTHEMESYSINT, GetThemeSysInt)
|
|
|
|
wxUX_THEME_DECLARE(PFNWXUISTHEMEACTIVE, IsThemeActive)
|
|
|
|
wxUX_THEME_DECLARE(PFNWXUISAPPTHEMED, IsAppThemed)
|
|
|
|
wxUX_THEME_DECLARE(PFNWXUGETWINDOWTHEME, GetWindowTheme)
|
|
|
|
wxUX_THEME_DECLARE(PFNWXUENABLETHEMEDIALOGTEXTURE, EnableThemeDialogTexture)
|
|
|
|
wxUX_THEME_DECLARE(PFNWXUISTHEMEDIALOGTEXTUREENABLED, IsThemeDialogTextureEnabled)
|
|
|
|
wxUX_THEME_DECLARE(PFNWXUGETTHEMEAPPPROPERTIES, GetThemeAppProperties)
|
|
|
|
wxUX_THEME_DECLARE(PFNWXUSETTHEMEAPPPROPERTIES, SetThemeAppProperties)
|
|
|
|
wxUX_THEME_DECLARE(PFNWXUGETCURRENTTHEMENAME, GetCurrentThemeName)
|
|
|
|
wxUX_THEME_DECLARE(PFNWXUGETTHEMEDOCUMENTATIONPROPERTY, GetThemeDocumentationProperty)
|
|
|
|
wxUX_THEME_DECLARE(PFNWXUDRAWTHEMEPARENTBACKGROUND, DrawThemeParentBackground)
|
|
|
|
wxUX_THEME_DECLARE(PFNWXUENABLETHEMING, EnableTheming)
|
2003-06-01 11:18:36 -04:00
|
|
|
|
|
|
|
private:
|
2003-07-30 18:31:20 -04:00
|
|
|
// construcor is private as only Get() can create us and is also trivial as
|
|
|
|
// everything really happens in Initialize()
|
|
|
|
wxUxThemeEngine() { }
|
2003-06-01 11:18:36 -04:00
|
|
|
|
2003-07-30 18:31:20 -04:00
|
|
|
// destructor is private as only Get() and wxUxThemeModule delete us, it is
|
|
|
|
// not virtual as we're not supposed to be derived from
|
|
|
|
~wxUxThemeEngine() { }
|
|
|
|
|
|
|
|
#if wxUSE_UXTHEME
|
|
|
|
// initialize the theme engine: load the DLL, resolve the functions
|
|
|
|
//
|
|
|
|
// return true if we can be used, false if themes are not available
|
|
|
|
bool Initialize();
|
|
|
|
|
|
|
|
|
|
|
|
// uxtheme.dll
|
|
|
|
wxDynamicLibrary m_dllUxTheme;
|
|
|
|
|
2004-09-07 07:11:05 -04:00
|
|
|
|
2003-07-30 18:31:20 -04:00
|
|
|
// the one and only theme engine, initially NULL
|
|
|
|
static wxUxThemeEngine *ms_themeEngine;
|
|
|
|
|
|
|
|
// this is a bool which initially has the value -1 meaning "unknown"
|
|
|
|
static int ms_isThemeEngineAvailable;
|
|
|
|
|
|
|
|
// it must be able to delete us
|
|
|
|
friend class wxUxThemeModule;
|
|
|
|
#endif // wxUSE_UXTHEME
|
|
|
|
|
2003-08-02 06:47:58 -04:00
|
|
|
DECLARE_NO_COPY_CLASS(wxUxThemeEngine)
|
2003-06-01 11:18:36 -04:00
|
|
|
};
|
|
|
|
|
2004-11-19 12:17:00 -05:00
|
|
|
/* static */ inline wxUxThemeEngine *wxUxThemeEngine::GetIfActive()
|
|
|
|
{
|
|
|
|
wxUxThemeEngine *engine = Get();
|
|
|
|
return engine && engine->IsAppThemed() && engine->IsThemeActive()
|
|
|
|
? engine
|
|
|
|
: NULL;
|
|
|
|
}
|
|
|
|
|
2003-07-30 18:31:20 -04:00
|
|
|
#if !wxUSE_UXTHEME
|
2003-06-01 11:18:36 -04:00
|
|
|
|
2003-07-30 18:31:20 -04:00
|
|
|
/* static */ inline wxUxThemeEngine *wxUxThemeEngine::Get()
|
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
2003-06-01 11:18:36 -04:00
|
|
|
|
2004-11-19 12:17:00 -05:00
|
|
|
/* static */ inline wxUxThemeEngine *wxUxThemeEngine::GetIfActive()
|
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2003-07-30 18:31:20 -04:00
|
|
|
#endif // !wxUSE_UXTHEME
|
2003-06-01 11:18:36 -04:00
|
|
|
|
2003-07-30 20:59:37 -04:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxUxThemeHandle: encapsulates ::Open/CloseThemeData()
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class wxUxThemeHandle
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxUxThemeHandle(wxWindow *win, const wchar_t *classes)
|
|
|
|
{
|
|
|
|
wxUxThemeEngine *engine = wxUxThemeEngine::Get();
|
|
|
|
|
2004-09-07 07:11:05 -04:00
|
|
|
m_hTheme =
|
2003-07-31 06:12:33 -04:00
|
|
|
engine ? (WXHTHEME)engine->OpenThemeData(win->GetHWND(), classes)
|
|
|
|
: NULL;
|
2003-07-30 20:59:37 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
operator WXHTHEME() const { return m_hTheme; }
|
|
|
|
|
|
|
|
~wxUxThemeHandle()
|
|
|
|
{
|
|
|
|
if ( m_hTheme )
|
|
|
|
{
|
|
|
|
wxUxThemeEngine::Get()->CloseThemeData(m_hTheme);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
WXHTHEME m_hTheme;
|
|
|
|
|
|
|
|
DECLARE_NO_COPY_CLASS(wxUxThemeHandle)
|
|
|
|
};
|
|
|
|
|
2003-07-30 18:31:20 -04:00
|
|
|
#endif // _WX_UXTHEME_H_
|
2003-06-01 11:18:36 -04:00
|
|
|
|