OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
theme.h
Go to the documentation of this file.
1//----------------------------------------------------------------------------
2// OWLNext
3//
4/// \file
5/// Microsoft UxTheme Library Encapsulation
6//----------------------------------------------------------------------------
7
8#if !defined(OWL_THEME_H)
9#define OWL_THEME_H
10
11#include <owl/private/defs.h>
12#if defined(BI_HAS_PRAGMA_ONCE)
13# pragma once
14#endif
15
16#include <owl/module.h>
17
18#include <uxtheme.h>
19#if defined(_MSC_VER) && _MSC_VER >= 1700
20#include <vssym32.h>
21#else
22#include <tmschema.h>
23#endif
24
25namespace owl {
26
27
28//
29/// This singleton encapsulates the "uxtheme.dll" module.
30//
32{
33public:
34
35 /// Returns the module instance.
36 /// Exceptions are thrown if the module cannot be loaded.
37 //
38 static TThemeModule& GetInstance();
39
40 // API functors - dynamically linked functions
41 // General
42 //
57
58 // API functors (continued)
59 // Theme sys properties
60 //
68
69 // API functors (continued)
70 // Theme parts
71 //
98
99private:
100 TThemeModule();
101};
102
103//
104/// Encapsulates a theme handle.
105/// TODO: Add appropriate member functions from the module API.
106//
108{
109public:
111 virtual ~TTheme();
112
113 // Accessors
114 //
115 HTHEME GetHandle() {return m_handle;}
116 operator HTHEME() {return m_handle;}
117
118private:
119 HTHEME m_handle;
120};
121
122//
123/// Encapsulates a themed part.
124//
126{
127public:
128 TThemePart(HWND, LPCWSTR cls, int part, int state);
129
130 // Accessors and mutators
131 //
132 int GetPart() const {return m_part;}
133 int GetState() const {return m_state;}
134 void SetState(int state) {m_state = state;}
135
136 // UxTheme interface
137 // TODO: Complete the interface.
138 //
139 void DrawBackground(HDC, const TRect& dest);
140 void DrawBackground(HDC, const TRect& dest, const TRect& clip);
141 bool IsBackgroundPartiallyTransparent();
142
143 void DrawTransparentBackground(HWND control, HDC, const TRect& dest);
144
145private:
146 int m_part;
147 int m_state;
148};
149
150//
151// Exception class
152//
153class _OWLCLASS TXTheme : public TXOwl
154{
155public:
157
158 TXTheme(const tstring& = tstring(), HRESULT = 0);
159
160 TXTheme* Clone();
161 void Throw();
162
163 static void Raise(const tstring& name = tstring(), HRESULT = 0);
164};
165
166
167} // OWL namespace
168
169
170#endif // OWL_THEME_H
171
172
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
Definition module.h:75
TRect is a mathematical class derived from tagRect.
Definition geometry.h:308
Encapsulates a theme handle.
Definition theme.h:108
HTHEME GetHandle()
Definition theme.h:115
This singleton encapsulates the "uxtheme.dll" module.
Definition theme.h:32
TModuleProc6< HRESULT, HTHEME, HDC, int, int, int, LOGFONT * > GetThemeFont
Definition theme.h:83
TModuleProc2< BOOL, HTHEME, int > GetThemeSysBool
Definition theme.h:61
TModuleProc2< HTHEME, HWND, LPCWSTR > OpenThemeData
Definition theme.h:54
TModuleProc2< int, HTHEME, int > GetThemeSysSize
Definition theme.h:66
TModuleProc6< HRESULT, HTHEME, int, int, int, LPWSTR, int > GetThemeFilename
Definition theme.h:82
TModuleProc2< HRESULT, HWND, DWORD > EnableThemeDialogTexture
Definition theme.h:45
TModuleProc5< HRESULT, HTHEME, int, int, int, int * > GetThemeEnumValue
Definition theme.h:81
TModuleProc3< BOOL, HTHEME, int, int > IsThemePartDefined
Definition theme.h:97
TModuleProc5< HRESULT, HTHEME, int, int, int, INTLIST * > GetThemeIntList
Definition theme.h:85
TModuleProc4< HRESULT, HTHEME, int, LPWSTR, int > GetThemeSysString
Definition theme.h:67
TModuleProc9< HRESULT, HTHEME, HDC, int, int, DWORD, const RECT *, HRGN, POINT, WORD * > HitTestThemeBackground
Definition theme.h:95
TModuleProc5< HRESULT, HTHEME, HDC, int, int, TEXTMETRIC * > GetThemeTextMetrics
Definition theme.h:94
TModuleProc6< HRESULT, HTHEME, HDC, int, int, const RECT *, const RECT * > DrawThemeBackground
Definition theme.h:72
TModuleProc1< HRESULT, BOOL > EnableTheming
Definition theme.h:46
TModuleProc2< HBRUSH, HTHEME, int > GetThemeSysColorBrush
Definition theme.h:63
TModuleProc7< HRESULT, HTHEME, HDC, int, int, RECT *, THEMESIZE, SIZE * > GetThemePartSize
Definition theme.h:88
TModuleProc6< HRESULT, HTHEME, int, int, int, LPWSTR, int > GetThemeString
Definition theme.h:92
TModuleProc5< HRESULT, HTHEME, int, int, int, PROPERTYORIGIN * > GetThemePropertyOrigin
Definition theme.h:90
TModuleProc7< HRESULT, HTHEME, HDC, int, int, const RECT *, HIMAGELIST, int > DrawThemeIcon
Definition theme.h:74
TModuleProc3< HRESULT, HTHEME, int, int * > GetThemeSysInt
Definition theme.h:65
TModuleProc3< HRESULT, HWND, LPCWSTR, LPCWSTR > SetWindowTheme
Definition theme.h:56
TModuleProc0< BOOL > IsThemeActive
Definition theme.h:52
TModuleProc6< HRESULT, HTHEME, HDC, int, int, const RECT *, RECT * > GetThemeBackgroundContentRect
Definition theme.h:76
TModuleProc5< HRESULT, HTHEME, int, int, int, RECT * > GetThemeRect
Definition theme.h:91
TModuleProc6< HRESULT, LPWSTR, int, LPWSTR, int, LPWSTR, int > GetCurrentThemeName
Definition theme.h:47
TModuleProcV1< DWORD > SetThemeAppProperties
Definition theme.h:55
TModuleProc0< DWORD > GetThemeAppProperties
Definition theme.h:48
TModuleProc6< HRESULT, HTHEME, HDC, int, int, const RECT *, HRGN * > GetThemeBackgroundRegion
Definition theme.h:78
TModuleProc9< HRESULT, HTHEME, HDC, int, int, LPCWSTR, int, DWORD, DWORD, const RECT * > DrawThemeText
Definition theme.h:75
TModuleProc9< HRESULT, HTHEME, HDC, int, int, LPCWSTR, int, DWORD, const RECT *, RECT * > GetThemeTextExtent
Definition theme.h:93
TModuleProc7< HRESULT, HTHEME, HDC, int, int, int, RECT *, MARGINS * > GetThemeMargins
Definition theme.h:86
TModuleProc6< HRESULT, HTHEME, HDC, int, int, int, int * > GetThemeMetric
Definition theme.h:87
TModuleProc1< BOOL, HWND > IsThemeDialogTextureEnabled
Definition theme.h:53
TModuleProc8< HRESULT, HTHEME, HDC, int, int, const RECT *, UINT, UINT, RECT * > DrawThemeEdge
Definition theme.h:73
TModuleProc5< HRESULT, HTHEME, int, int, int, POINT * > GetThemePosition
Definition theme.h:89
TModuleProc5< HRESULT, HTHEME, int, int, int, COLORREF * > GetThemeColor
Definition theme.h:80
TModuleProc5< HRESULT, HTHEME, int, int, int, BOOL * > GetThemeBool
Definition theme.h:79
TModuleProc2< COLORREF, HTHEME, int > GetThemeSysColor
Definition theme.h:62
TModuleProc3< BOOL, HTHEME, int, int > IsThemeBackgroundPartiallyTransparent
Definition theme.h:96
TModuleProc4< HRESULT, LPCWSTR, LPCWSTR, LPWSTR, int > GetThemeDocumentationProperty
Definition theme.h:49
TModuleProc5< HRESULT, HTHEME, int, int, int, int * > GetThemeInt
Definition theme.h:84
TModuleProc0< BOOL > IsAppThemed
Definition theme.h:51
TModuleProc1< HRESULT, HTHEME > CloseThemeData
Definition theme.h:43
TModuleProc3< HRESULT, HWND, HDC, const RECT * > DrawThemeParentBackground
Definition theme.h:44
TModuleProc1< HTHEME, HWND > GetWindowTheme
Definition theme.h:50
TModuleProc3< HRESULT, HTHEME, int, LOGFONT * > GetThemeSysFont
Definition theme.h:64
TModuleProc6< HRESULT, HTHEME, HDC, int, int, const RECT *, RECT * > GetThemeBackgroundExtent
Definition theme.h:77
Encapsulates a themed part.
Definition theme.h:126
int GetState() const
Definition theme.h:133
void SetState(int state)
Definition theme.h:134
int GetPart() const
Definition theme.h:132
TXOwl is root class of the ObjectWindows exception hierarchy.
Definition except.h:38
HRESULT result
Definition theme.h:156
Definition of class TModule.
Object Windows Library (OWLNext Core)
Definition animctrl.h:22
std::string tstring
Definition defs.h:79
#define _OWLCLASS
Definition defs.h:338