// get the theme engine or NULL if themes are not available
static wxUxThemeEngine *Get();
+ // get the theme enging or NULL if themes are not available or not used for
+ // this application
+ static wxUxThemeEngine *GetIfActive();
+
// all uxtheme.dll functions
wxUX_THEME_DECLARE(PFNWXUOPENTHEMEDATA, OpenThemeData)
wxUX_THEME_DECLARE(PFNWXUCLOSETHEMEDATA, CloseThemeData)
DECLARE_NO_COPY_CLASS(wxUxThemeEngine)
};
+/* static */ inline wxUxThemeEngine *wxUxThemeEngine::GetIfActive()
+{
+ wxUxThemeEngine *engine = Get();
+ return engine && engine->IsAppThemed() && engine->IsThemeActive()
+ ? engine
+ : NULL;
+}
+
#if !wxUSE_UXTHEME
/* static */ inline wxUxThemeEngine *wxUxThemeEngine::Get()
return NULL;
}
+/* static */ inline wxUxThemeEngine *wxUxThemeEngine::GetIfActive()
+{
+ return NULL;
+}
+
#endif // !wxUSE_UXTHEME
// ----------------------------------------------------------------------------