ReactOS 0.4.16-dev-197-g92996da
theme.c
Go to the documentation of this file.
1/*
2 * ReactOS Calc (Theming support)
3 *
4 * Copyright 2007-2017, Carlo Bramini
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#include "calc.h"
22
23#define GET_CB(name) \
24 calc_##name = (type_##name)GetProcAddress(hUxTheme, #name); \
25 if (calc_##name == NULL) calc_##name = dummy_##name;
26
27static HTHEME WINAPI
28dummy_OpenThemeData(HWND hwnd, const WCHAR *pszClassList);
29
30static HRESULT WINAPI
32
33static HRESULT WINAPI
34dummy_DrawThemeBackground(HTHEME hTheme, HDC hdc, int iPartId, int iStateId,
35 const RECT *prc, const RECT *prcClip);
36
37static BOOL WINAPI
39
40static BOOL WINAPI
42
43static BOOL WINAPI
44dummy_IsThemeBackgroundPartiallyTransparent(HTHEME hTheme, int iPartId, int iStateId);
45
46static HRESULT WINAPI
48
49
59
61
62static HTHEME WINAPI
63dummy_OpenThemeData(HWND hwnd, const WCHAR* pszClassList)
64{
65 return NULL;
66}
67
68static HRESULT WINAPI
70{
71 return E_NOTIMPL;
72}
73
74static HRESULT WINAPI
75dummy_DrawThemeBackground(HTHEME hTheme, HDC hdc, int iPartId, int iStateId,
76 const RECT* prc, const RECT* prcClip)
77{
78 return E_NOTIMPL;
79}
80
81static BOOL WINAPI
83{
84 return FALSE;
85}
86
87static BOOL WINAPI
89{
90 return FALSE;
91}
92
93static BOOL WINAPI
94dummy_IsThemeBackgroundPartiallyTransparent(HTHEME hTheme, int iPartId, int iStateId)
95{
96 return FALSE;
97}
98
99static HRESULT WINAPI
101{
102 return E_NOTIMPL;
103}
104
106{
107 hUxTheme = LoadLibrary(_T("UXTHEME"));
108 if (hUxTheme == NULL)
109 return;
110
118}
119
120void Theme_Stop(void)
121{
122 if(hUxTheme == NULL)
123 return;
124
126 hUxTheme = NULL;
127}
static HTHEME WINAPI dummy_OpenThemeData(HWND hwnd, const WCHAR *pszClassList)
Definition: theme.c:63
static BOOL WINAPI dummy_IsThemeBackgroundPartiallyTransparent(HTHEME hTheme, int iPartId, int iStateId)
Definition: theme.c:94
static HMODULE hUxTheme
Definition: theme.c:60
type_DrawThemeParentBackground calc_DrawThemeParentBackground
Definition: theme.c:57
static BOOL WINAPI dummy_IsThemeActive(void)
Definition: theme.c:88
static BOOL WINAPI dummy_IsAppThemed(void)
Definition: theme.c:82
type_OpenThemeData calc_OpenThemeData
Definition: theme.c:50
static HRESULT WINAPI dummy_CloseThemeData(HTHEME hTheme)
Definition: theme.c:69
void Theme_Start(HINSTANCE hInstance)
Definition: theme.c:105
static HRESULT WINAPI dummy_DrawThemeBackground(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *prc, const RECT *prcClip)
Definition: theme.c:75
type_DrawThemeBackground calc_DrawThemeBackground
Definition: theme.c:52
void Theme_Stop(void)
Definition: theme.c:120
#define GET_CB(name)
Definition: theme.c:23
type_IsThemeBackgroundPartiallyTransparent calc_IsThemeBackgroundPartiallyTransparent
Definition: theme.c:55
type_CloseThemeData calc_CloseThemeData
Definition: theme.c:51
static HRESULT WINAPI dummy_DrawThemeParentBackground(HWND hWnd, HDC hdc, RECT *prc)
Definition: theme.c:100
type_IsThemeActive calc_IsThemeActive
Definition: theme.c:54
type_IsAppThemed calc_IsAppThemed
Definition: theme.c:53
HWND hWnd
Definition: settings.c:17
BOOL(WINAPI * type_IsThemeBackgroundPartiallyTransparent)(HTHEME, int, int)
Definition: calc.h:84
HRESULT(WINAPI * type_DrawThemeBackground)(HTHEME, HDC, int, int, const RECT *, const RECT *)
Definition: calc.h:81
HTHEME(WINAPI * type_OpenThemeData)(HWND, const WCHAR *)
Definition: calc.h:79
BOOL(WINAPI * type_IsAppThemed)(void)
Definition: calc.h:82
HRESULT(WINAPI * type_DrawThemeParentBackground)(HWND, HDC, RECT *)
Definition: calc.h:85
HRESULT(WINAPI * type_CloseThemeData)(HTHEME)
Definition: calc.h:80
BOOL(WINAPI * type_IsThemeActive)(void)
Definition: calc.h:83
HINSTANCE hInstance
Definition: charmap.c:19
#define E_NOTIMPL
Definition: ddrawi.h:99
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
#define FreeLibrary(x)
Definition: compat.h:748
HRESULT WINAPI DrawThemeBackground(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, const RECT *pClipRect)
Definition: draw.c:128
BOOL WINAPI IsThemeBackgroundPartiallyTransparent(HTHEME hTheme, int iPartId, int iStateId)
Definition: draw.c:1927
HRESULT WINAPI DrawThemeParentBackground(HWND hwnd, HDC hdc, RECT *prc)
Definition: draw.c:72
HTHEME WINAPI OpenThemeData(HWND hwnd, LPCWSTR classlist)
Definition: system.c:835
BOOL WINAPI IsThemeActive(void)
Definition: system.c:606
HRESULT WINAPI CloseThemeData(HTHEME hTheme)
Definition: system.c:950
BOOL WINAPI IsAppThemed(void)
Definition: system.c:596
unsigned int BOOL
Definition: ntddk_ex.h:94
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:88
static HTHEME(WINAPI *pOpenThemeDataEx)(HWND
_Out_ LPRECT prc
Definition: ntgdi.h:1658
#define _T(x)
Definition: vfdio.h:22
#define LoadLibrary
Definition: winbase.h:3886
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
#define WINAPI
Definition: msvc.h:6
__wchar_t WCHAR
Definition: xmlstorage.h:180