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