Move UXTheme symbol definitions for Vista+ to msw/uxtheme.h

Remove various definitions and symbol declarations from
numerous files using msw/uxtheme.h to a single file.
When possible vssym32.h is included from the Windows SDK.
For older SDKs tmschema.h is included and missing symbols
are defined in msw/uxtheme.h.
This commit is contained in:
Tobias Taschner
2018-01-21 17:04:09 +01:00
parent d9306f127a
commit 2d064ea3b9
11 changed files with 140 additions and 320 deletions

View File

@@ -16,6 +16,145 @@
#include "wx/msw/private.h" // we use GetHwndOf() #include "wx/msw/private.h" // we use GetHwndOf()
#include <uxtheme.h> #include <uxtheme.h>
#if defined(DTPB_WINDOWDC)
// DTPB_WINDOWDC has been added for Vista so it's save to assume that an SDK
// including it has vssym32.h available
#define HAVE_VSSYM32
#endif
#if defined(HAVE_VSSYM32)
#include <vssym32.h>
#else
#include <tmschema.h>
#endif
// ----------------------------------------------------------------------------
// Definitions for legacy Windows SDKs
// ----------------------------------------------------------------------------
// Some defintions introduced with Windows Vista might be missing in older SDKs
// Missing defintions are added here for compatiblity
#ifndef VSCLASS_LISTVIEW
#define LISS_NORMAL 1
#define LISS_HOT 2
#define LISS_SELECTED 3
#define LISS_DISABLED 4
#define LISS_SELECTEDNOTFOCUS 5
#define LISS_HOTSELECTED 6
#endif
#ifndef DTT_TEXTCOLOR
#define DTT_TEXTCOLOR (1UL << 0) // crText has been specified
#define DTT_STATEID (1UL << 8) // IStateId has been specified
#endif
#ifndef DSS_HIDEPREFIX
#define DSS_HIDEPREFIX 0x0200
#define DSS_PREFIXONLY 0x0400
#endif
#ifndef TMT_FONT
#define TMT_FONT 210
#endif
#ifndef HAVE_VSSYM32
enum EXPANDOBUTTONSTATES {
TDLGEBS_NORMAL = 1,
TDLGEBS_HOVER = 2,
TDLGEBS_PRESSED = 3,
TDLGEBS_EXPANDEDNORMAL = 4,
TDLGEBS_EXPANDEDHOVER = 5,
TDLGEBS_EXPANDEDPRESSED = 6,
TDLGEBS_NORMALDISABLED = 7,
TDLGEBS_EXPANDEDDISABLED = 8,
};
enum TASKDIALOGPARTS {
TDLG_PRIMARYPANEL = 1,
TDLG_MAININSTRUCTIONPANE = 2,
TDLG_MAINICON = 3,
TDLG_CONTENTPANE = 4,
TDLG_CONTENTICON = 5,
TDLG_EXPANDEDCONTENT = 6,
TDLG_COMMANDLINKPANE = 7,
TDLG_SECONDARYPANEL = 8,
TDLG_CONTROLPANE = 9,
TDLG_BUTTONSECTION = 10,
TDLG_BUTTONWRAPPER = 11,
TDLG_EXPANDOTEXT = 12,
TDLG_EXPANDOBUTTON = 13,
TDLG_VERIFICATIONTEXT = 14,
TDLG_FOOTNOTEPANE = 15,
TDLG_FOOTNOTEAREA = 16,
TDLG_FOOTNOTESEPARATOR = 17,
TDLG_EXPANDEDFOOTERAREA = 18,
TDLG_PROGRESSBAR = 19,
TDLG_IMAGEALIGNMENT = 20,
TDLG_RADIOBUTTONPANE = 21,
};
#define CP_BACKGROUND 2
#define CP_TRANSPARENTBACKGROUND 3
#define CP_BORDER 4
#define CP_READONLY 5
#define CP_DROPDOWNBUTTONRIGHT 6
#define CP_DROPDOWNBUTTONLEFT 7
#define CP_CUEBANNER 8
#define RP_BACKGROUND 6
#define RP_SPLITTER 7
#define RP_SPLITTERVERT 8
enum BORDERSTATES {
CBB_NORMAL = 1,
CBB_HOT = 2,
CBB_FOCUSED = 3,
CBB_DISABLED = 4,
};
enum MENUPARTS
{
MENU_MENUITEM_TMSCHEMA = 1,
MENU_SEPARATOR_TMSCHEMA = 6,
MENU_POPUPBACKGROUND = 9,
MENU_POPUPBORDERS = 10,
MENU_POPUPCHECK = 11,
MENU_POPUPCHECKBACKGROUND = 12,
MENU_POPUPGUTTER = 13,
MENU_POPUPITEM = 14,
MENU_POPUPSEPARATOR = 15,
MENU_POPUPSUBMENU = 16,
};
enum POPUPITEMSTATES
{
MPI_NORMAL = 1,
MPI_HOT = 2,
MPI_DISABLED = 3,
MPI_DISABLEDHOT = 4,
};
enum POPUPCHECKBACKGROUNDSTATES
{
MCB_DISABLED = 1,
MCB_NORMAL = 2,
MCB_BITMAP = 3,
};
enum POPUPCHECKSTATES
{
MC_CHECKMARKNORMAL = 1,
MC_CHECKMARKDISABLED = 2,
MC_BULLETNORMAL = 3,
MC_BULLETDISABLED = 4,
};
#endif
// ----------------------------------------------------------------------------
// End definitions for legacy Windows SDKs
// ----------------------------------------------------------------------------
// Amazingly, GetThemeFont() and GetThemeSysFont() functions use LOGFONTA under // Amazingly, GetThemeFont() and GetThemeSysFont() functions use LOGFONTA under
// XP but LOGFONTW (even in non-Unicode build) under later versions of Windows. // XP but LOGFONTW (even in non-Unicode build) under later versions of Windows.
// If we declare them as taking LOGFONT below, the code would be able to // If we declare them as taking LOGFONT below, the code would be able to

View File

@@ -27,37 +27,6 @@
#if wxUSE_AUI #if wxUSE_AUI
#define RP_GRIPPER 1
#define RP_GRIPPERVERT 2
#define RP_BAND 3
#define RP_CHEVRON 4
#define RP_CHEVRONVERT 5
#define RP_BACKGROUND 6
#define RP_SPLITTER 7
#define RP_SPLITTERVERT 8
#define CHEVS_NORMAL 1
#define CHEVS_HOT 2
#define CHEVS_PRESSED 3
#define TP_BUTTON 1
#define TP_DROPDOWNBUTTON 2
#define TP_SPLITBUTTON 3
#define TP_SPLITBUTTONDROPDOWN 4
#define TP_SEPARATOR 5
#define TP_SEPARATORVERT 6
#define TP_DROPDOWNBUTTONGLYPH 7
#define TS_NORMAL 1
#define TS_HOT 2
#define TS_PRESSED 3
#define TS_DISABLED 4
#define TS_CHECKED 5
#define TS_HOTCHECKED 6
#define TS_NEARHOT 7
#define TS_OTHERSIDEHOT 8
wxAuiMSWToolBarArt::wxAuiMSWToolBarArt() wxAuiMSWToolBarArt::wxAuiMSWToolBarArt()
{ {
if ( wxUxThemeIsActive() ) if ( wxUxThemeIsActive() )

View File

@@ -25,40 +25,6 @@
#if wxUSE_AUI #if wxUSE_AUI
#ifndef CP_DROPDOWNBUTTON
#define TABP_TABITEM 1
#define TABP_TABITEMLEFTEDGE 2
#define TABP_TABITEMRIGHTEDGE 3
#define TABP_TABITEMBOTHEDGE 4
#define TABP_TOPTABITEM 5
#define TABP_TOPTABITEMLEFTEDGE 6
#define TABP_TOPTABITEMRIGHTEDGE 7
#define TABP_TOPTABITEMBOTHEDGE 8
#define TABP_PANE 9
#define TABP_BODY 10
#define TABP_AEROWIZARDBODY 11
#define TIS_NORMAL 1
#define TIS_HOT 2
#define TIS_SELECTED 3
#define TIS_DISABLED 4
#define TIS_FOCUSED 5
#define TTP_CLOSE 5
#define TTCS_NORMAL 1
#define TTCS_HOT 2
#define TTCS_PRESSED 3
#define SPNP_UPHORZ 3
#define SPNP_DOWNHORZ 4
#define CP_DROPDOWNBUTTON1 1
#define WP_CLOSEBUTTON 18
#endif
wxAuiMSWTabArt::wxAuiMSWTabArt() wxAuiMSWTabArt::wxAuiMSWTabArt()
{ {
m_closeBtnSize = wxDefaultSize; m_closeBtnSize = wxDefaultSize;
@@ -410,7 +376,7 @@ void wxAuiMSWTabArt::DrawButton(wxDC& dc,
break; break;
case wxAUI_BUTTON_WINDOWLIST: case wxAUI_BUTTON_WINDOWLIST:
themeId = L"Combobox"; themeId = L"Combobox";
part = CP_DROPDOWNBUTTON1; part = CP_DROPDOWNBUTTON;
break; break;
} }

View File

@@ -48,12 +48,6 @@
#ifdef __WXMSW__ #ifdef __WXMSW__
#include "wx/msw/uxtheme.h" #include "wx/msw/uxtheme.h"
static const int TTP_BALLOONTITLE = 4;
static const int TMT_TEXTCOLOR = 3803;
static const int TMT_GRADIENTCOLOR1 = 3810;
static const int TMT_GRADIENTCOLOR2 = 3811;
#endif #endif
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@@ -55,19 +55,6 @@
using namespace wxMSWImpl; using namespace wxMSWImpl;
#if wxUSE_UXTHEME #if wxUSE_UXTHEME
// no need to include tmschema.h
#ifndef BP_PUSHBUTTON
#define BP_PUSHBUTTON 1
#define PBS_NORMAL 1
#define PBS_HOT 2
#define PBS_PRESSED 3
#define PBS_DISABLED 4
#define PBS_DEFAULTED 5
#define TMT_CONTENTMARGINS 3602
#endif
// provide the necessary declarations ourselves if they're missing from // provide the necessary declarations ourselves if they're missing from
// headers // headers
#ifndef BCM_SETIMAGELIST #ifndef BCM_SETIMAGELIST

View File

@@ -30,21 +30,6 @@
#include "wx/msw/uxtheme.h" #include "wx/msw/uxtheme.h"
#if wxUSE_UXTHEME
// no need to include tmschema.h
#ifndef BP_PUSHBUTTON
#define BP_PUSHBUTTON 1
#define PBS_NORMAL 1
#define PBS_HOT 2
#define PBS_PRESSED 3
#define PBS_DISABLED 4
#define PBS_DEFAULTED 5
#define TMT_CONTENTMARGINS 3602
#endif
#endif // wxUSE_UXTHEME
#ifndef ODS_NOFOCUSRECT #ifndef ODS_NOFOCUSRECT
#define ODS_NOFOCUSRECT 0x0200 #define ODS_NOFOCUSRECT 0x0200
#endif #endif

View File

@@ -42,77 +42,6 @@
#endif #endif
#include "wx/msw/dc.h" #include "wx/msw/dc.h"
// Change to #if 1 to include tmschema.h for easier testing of theme
// parameters.
#if 0
#include <tmschema.h>
#include <VSStyle.h>
#else
//----------------------------------
#define EP_EDITTEXT 1
#define ETS_NORMAL 1
#define ETS_HOT 2
#define ETS_SELECTED 3
#define ETS_DISABLED 4
#define ETS_FOCUSED 5
#define ETS_READONLY 6
#define ETS_ASSIST 7
#define TMT_FILLCOLOR 3802
#define TMT_TEXTCOLOR 3803
#define TMT_BORDERCOLOR 3801
#define TMT_EDGEFILLCOLOR 3808
#define TMT_BGTYPE 4001
#define BT_IMAGEFILE 0
#define BT_BORDERFILL 1
#define CP_DROPDOWNBUTTON 1
#define CP_BACKGROUND 2 // This and above are Vista and later only
#define CP_TRANSPARENTBACKGROUND 3
#define CP_BORDER 4
#define CP_READONLY 5
#define CP_DROPDOWNBUTTONRIGHT 6
#define CP_DROPDOWNBUTTONLEFT 7
#define CP_CUEBANNER 8
#define CBXS_NORMAL 1
#define CBXS_HOT 2
#define CBXS_PRESSED 3
#define CBXS_DISABLED 4
#define CBXSR_NORMAL 1
#define CBXSR_HOT 2
#define CBXSR_PRESSED 3
#define CBXSR_DISABLED 4
#define CBXSL_NORMAL 1
#define CBXSL_HOT 2
#define CBXSL_PRESSED 3
#define CBXSL_DISABLED 4
#define CBTBS_NORMAL 1
#define CBTBS_HOT 2
#define CBTBS_DISABLED 3
#define CBTBS_FOCUSED 4
#define CBB_NORMAL 1
#define CBB_HOT 2
#define CBB_FOCUSED 3
#define CBB_DISABLED 4
#define CBRO_NORMAL 1
#define CBRO_HOT 2
#define CBRO_PRESSED 3
#define CBRO_DISABLED 4
#define CBCB_NORMAL 1
#define CBCB_HOT 2
#define CBCB_PRESSED 3
#define CBCB_DISABLED 4
#endif
#define NATIVE_TEXT_INDENT_XP 4 #define NATIVE_TEXT_INDENT_XP 4
#define NATIVE_TEXT_INDENT_CLASSIC 2 #define NATIVE_TEXT_INDENT_CLASSIC 2

View File

@@ -143,53 +143,6 @@ inline bool IsGreaterThanStdSize(const wxBitmap& bmp)
#include "wx/fontutil.h" #include "wx/fontutil.h"
#include "wx/msw/private/metrics.h" #include "wx/msw/private/metrics.h"
#if wxUSE_UXTHEME
enum MENUPARTS
{
MENU_MENUITEM_TMSCHEMA = 1,
MENU_SEPARATOR_TMSCHEMA = 6,
MENU_POPUPBACKGROUND = 9,
MENU_POPUPBORDERS = 10,
MENU_POPUPCHECK = 11,
MENU_POPUPCHECKBACKGROUND = 12,
MENU_POPUPGUTTER = 13,
MENU_POPUPITEM = 14,
MENU_POPUPSEPARATOR = 15,
MENU_POPUPSUBMENU = 16,
};
enum POPUPITEMSTATES
{
MPI_NORMAL = 1,
MPI_HOT = 2,
MPI_DISABLED = 3,
MPI_DISABLEDHOT = 4,
};
enum POPUPCHECKBACKGROUNDSTATES
{
MCB_DISABLED = 1,
MCB_NORMAL = 2,
MCB_BITMAP = 3,
};
enum POPUPCHECKSTATES
{
MC_CHECKMARKNORMAL = 1,
MC_CHECKMARKDISABLED = 2,
MC_BULLETNORMAL = 3,
MC_BULLETDISABLED = 4,
};
const int TMT_MENUFONT = 803;
const int TMT_BORDERSIZE = 2403;
const int TMT_CONTENTMARGINS = 3602;
const int TMT_SIZINGMARGINS = 3601;
#endif // wxUSE_UXTHEME
#endif // wxUSE_OWNER_DRAWN #endif // wxUSE_OWNER_DRAWN
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@@ -40,93 +40,6 @@
#include "wx/msw/uxtheme.h" #include "wx/msw/uxtheme.h"
#include "wx/dynlib.h" #include "wx/dynlib.h"
// tmschema.h is in Win32 Platform SDK and might not be available with earlier
// compilers
#ifndef CP_DROPDOWNBUTTON
#define BP_PUSHBUTTON 1
#define BP_RADIOBUTTON 2
#define BP_CHECKBOX 3
#define RBS_UNCHECKEDNORMAL 1
#define RBS_CHECKEDNORMAL (RBS_UNCHECKEDNORMAL + 4)
#define RBS_MIXEDNORMAL (RBS_CHECKEDNORMAL + 4)
#define CBS_UNCHECKEDNORMAL 1
#define CBS_CHECKEDNORMAL (CBS_UNCHECKEDNORMAL + 4)
#define CBS_MIXEDNORMAL (CBS_CHECKEDNORMAL + 4)
#define PBS_NORMAL 1
#define PBS_HOT 2
#define PBS_PRESSED 3
#define PBS_DISABLED 4
#define PBS_DEFAULTED 5
#define CP_DROPDOWNBUTTON 1
#define CBXS_NORMAL 1
#define CBXS_HOT 2
#define CBXS_PRESSED 3
#define CBXS_DISABLED 4
#define TVP_GLYPH 2
#define GLPS_CLOSED 1
#define GLPS_OPENED 2
#define HP_HEADERITEM 1
#define HIS_NORMAL 1
#define HIS_HOT 2
#define HIS_PRESSED 3
#define TMT_HEIGHT 2417
#define HP_HEADERSORTARROW 4
#define HSAS_SORTEDUP 1
#define HSAS_SORTEDDOWN 2
#define EP_EDITTEXT 1
#define ETS_NORMAL 1
#define ETS_HOT 2
#define ETS_SELECTED 3
#define ETS_DISABLED 4
#define ETS_FOCUSED 5
#define ETS_READONLY 6
#define ETS_ASSIST 7
#define TMT_FILLCOLOR 3802
#define TMT_TEXTCOLOR 3803
#define TMT_BORDERCOLOR 3801
#define TMT_EDGEFILLCOLOR 3808
#define WP_MINBUTTON 15
#define WP_MAXBUTTON 17
#define WP_CLOSEBUTTON 18
#define WP_RESTOREBUTTON 21
#define WP_HELPBUTTON 23
#define PP_BAR 1
#define PP_CHUNK 3
#define LISS_NORMAL 1
#define LISS_HOT 2
#define LISS_SELECTED 3
#define LISS_DISABLED 4
#define LISS_SELECTEDNOTFOCUS 5
#define LISS_HOTSELECTED 6
#define LVP_LISTITEM 1
#define DTT_TEXTCOLOR (1UL << 0) // crText has been specified
#define DTT_STATEID (1UL << 8) // IStateId has been specified
#define TDLG_EXPANDOBUTTON 13
#define TDLGEBS_NORMAL 1
#define TDLGEBS_HOVER 2
#define TDLGEBS_PRESSED 3
#define TDLGEBS_EXPANDEDNORMAL 4
#define TDLGEBS_EXPANDEDHOVER 5
#define TDLGEBS_EXPANDEDPRESSED 6
#endif
// These Vista+ only types used by DrawThemeTextEx may not be available in older SDK headers // These Vista+ only types used by DrawThemeTextEx may not be available in older SDK headers
typedef int(__stdcall *WXDTT_CALLBACK_PROC)(HDC hdc, const wchar_t * pszText, typedef int(__stdcall *WXDTT_CALLBACK_PROC)(HDC hdc, const wchar_t * pszText,
int cchText, RECT * prc, unsigned int dwFlags, WXLPARAM lParam); int cchText, RECT * prc, unsigned int dwFlags, WXLPARAM lParam);

View File

@@ -47,13 +47,6 @@
#include "wx/msw/dc.h" #include "wx/msw/dc.h"
#include "wx/msw/private/winstyle.h" #include "wx/msw/private/winstyle.h"
// the values coincide with those in tmschema.h
#define BP_GROUPBOX 4
#define GBS_NORMAL 1
#define TMT_FONT 210
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// wxWin macros // wxWin macros
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@@ -113,14 +113,6 @@
#if wxUSE_UXTHEME #if wxUSE_UXTHEME
#include "wx/msw/uxtheme.h" #include "wx/msw/uxtheme.h"
#define EP_EDITTEXT 1
#define ETS_NORMAL 1
#define ETS_HOT 2
#define ETS_SELECTED 3
#define ETS_DISABLED 4
#define ETS_FOCUSED 5
#define ETS_READONLY 6
#define ETS_ASSIST 7
#endif #endif
#if wxUSE_DYNLIB_CLASS #if wxUSE_DYNLIB_CLASS