mCtrl  0.10.0
theme.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 Martin Mitas
3  *
4  * This library is free software; you can redistribute it and/or modify it
5  * under the terms of the GNU Lesser General Public License as published by
6  * the Free Software Foundation; either version 2.1 of the License, or
7  * (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with this library; if not, write to the Free Software Foundation,
16  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18 
19 
20 #ifndef MCTRL_THEME_H
21 #define MCTRL_THEME_H
22 
23 #include <mCtrl/_defs.h>
24 #include <mCtrl/_common.h>
25 
26 #include <vssym32.h>
27 #include <vsstyle.h>
28 #include <uxtheme.h>
29 
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 
120 
130 BOOL MCTRL_API mcTheme_Initialize(void);
131 
136 void MCTRL_API mcTheme_Terminate(void);
137 
145 
146 #if (_WIN32_WINNT >= 0x0600)
147 
163 HANIMATIONBUFFER MCTRL_API mcBeginBufferedAnimation(HWND hwnd, HDC hdcTarget,
164  const RECT* rcTarget, BP_BUFFERFORMAT dwFormat,
165  BP_PAINTPARAMS* pPaintParams, BP_ANIMATIONPARAMS* pAnimationParams,
166  HDC* phdcFrom, HDC* phdcTo);
167 
181 HPAINTBUFFER MCTRL_API mcBeginBufferedPaint(HDC hdcTarget, const RECT* prcTarget,
182  BP_BUFFERFORMAT dwFormat, BP_PAINTPARAMS* pPaintParams, HDC* phdc);
183 
193 BOOL MCTRL_API mcBeginPanningFeedback(HWND hwnd);
194 
205 HRESULT MCTRL_API mcBufferedPaintClear(HPAINTBUFFER hBufferedPaint,
206  const RECT* prc);
207 
216 HRESULT MCTRL_API mcBufferedPaintInit(void);
217 
228 BOOL MCTRL_API mcBufferedPaintRenderAnimation(HWND hwnd, HDC hdcTarget);
229 
241 HRESULT MCTRL_API mcBufferedPaintSetAlpha(HPAINTBUFFER hBufferedPaint,
242  const RECT* prc, BYTE alpha);
243 
254 
263 HRESULT MCTRL_API mcBufferedPaintUnInit(void);
264 #endif /* _WIN32_WINNT >= 0x0600 */
265 
273 HRESULT MCTRL_API mcCloseThemeData(HTHEME hTheme);
274 
287 HRESULT MCTRL_API mcDrawThemeBackground(HTHEME hTheme, HDC hdc,
288  int iPartId, int iStateId, const RECT* prc, const RECT* prcClip);
289 
302 HRESULT MCTRL_API mcDrawThemeBackgroundEx(HTHEME hTheme, HDC hdc,
303  int iPartId, int iStateId, const RECT* prc, const DTBGOPTS* pOptions);
304 
319 HRESULT MCTRL_API mcDrawThemeEdge(HTHEME hTheme, HDC hdc,
320  int iPartId, int iStateId, const RECT* prcDest, UINT uEdge,
321  UINT uFlags, RECT* prcContent);
322 
336 HRESULT MCTRL_API mcDrawThemeIcon(HTHEME hTheme, HDC hdc,
337  int iPartId, int iStateId, const RECT* prc,
338  HIMAGELIST himl, int iImageIndex);
339 
352 HRESULT MCTRL_API mcDrawThemeParentBackground(HWND hwnd, HDC hdc, RECT* prc);
353 
354 
355 #if (_WIN32_WINNT >= 0x0600)
356 
368 HRESULT MCTRL_API mcDrawThemeParentBackgroundEx(HWND hwnd, HDC hdc,
369  DWORD dwFlags, RECT* prc);
370 #endif /* _WIN32_WINNT >= 0x0600 */
371 
387 HRESULT MCTRL_API mcDrawThemeText(HTHEME hTheme, HDC hdc,
388  int iPartId, int iStateId, const WCHAR* pszText, int iCharCount,
389  DWORD dwFlags, DWORD dwFlags2, const RECT* prc);
390 
391 #if (_WIN32_WINNT >= 0x0600)
392 
409 HRESULT MCTRL_API mcDrawThemeTextEx(HTHEME hTheme, HDC hdc,
410  int iPartId, int iStateId, const WCHAR* pszText, int iCharCount,
411  DWORD dwFlags, RECT* prc, const DTTOPTS* pOptions);
412 #endif /* _WIN32_WINNT >= 0x0600 */
413 
422 HRESULT MCTRL_API mcEnableThemeDialogTexture(HWND hwnd, DWORD dwFlags);
423 
424 #if (_WIN32_WINNT >= 0x0600)
425 
435 HRESULT MCTRL_API mcEndBufferedAnimation(HANIMATIONBUFFER hbpAnimation,
436  BOOL fUpdateTarget);
437 
448 HRESULT MCTRL_API mcEndBufferedPaint(HPAINTBUFFER hBufferedPaint,
449  BOOL fUpdateTarget);
450 
461 BOOL MCTRL_API mcEndPanningFeedback(HWND hwnd, BOOL fAnimateBack);
462 
474 HRESULT MCTRL_API mcGetBufferedPaintBits(HPAINTBUFFER hBufferedPaint,
475  RGBQUAD** ppbBuffer, int* pcxRow);
476 
486 HDC MCTRL_API mcGetBufferedPaintDC(HPAINTBUFFER hBufferedPaint);
487 
497 HDC MCTRL_API mcGetBufferedPaintTargetDC(HPAINTBUFFER hBufferedPaint);
498 
509 HRESULT MCTRL_API mcGetBufferedPaintTargetRect(HPAINTBUFFER hBufferedPaint,
510  RECT* prc);
511 #endif /* _WIN32_WINNT >= 0x0600 */
512 
526  WCHAR* pszThemeFilename, int cchMaxFilenameChars,
527  WCHAR* pszColorBuff, int cchMaxColorChars,
528  WCHAR* pszSizeBuff, int cchMaxSizeChars);
529 
537 
550 HRESULT MCTRL_API mcGetThemeBackgroundContentRect(HTHEME hTheme, HDC hdc,
551  int iPartId, int iStateId, const RECT* prcBounding, RECT* prcContent);
552 
565 HRESULT MCTRL_API mcGetThemeBackgroundExtent(HTHEME hTheme, HDC hdc,
566  int iPartId, int iStateId, const RECT* prcContent, RECT* prcExtent);
567 
580 HRESULT MCTRL_API mcGetThemeBackgroundRegion(HTHEME hTheme, HDC hdc,
581  int iPartId, int iStateId, const RECT* prc, HRGN* phRegion);
582 
583 #if (_WIN32_WINNT >= 0x0600)
584 
596 HRESULT MCTRL_API mcGetThemeBitmap(HTHEME hTheme, int iPartId, int iStateId,
597  int iPropId, ULONG uFlags, HBITMAP* phBitmap);
598 #endif /* _WIN32_WINNT >= 0x0600 */
599 
611 HRESULT MCTRL_API mcGetThemeBool(HTHEME hTheme, int iPartId, int iStateId,
612  int iPropId, BOOL* pfValue);
613 
625 HRESULT MCTRL_API mcGetThemeColor(HTHEME hTheme, int iPartId, int iStateId,
626  int iPropId, COLORREF* pColor);
627 
638 HRESULT MCTRL_API mcGetThemeDocumentationProperty(const WCHAR* pszThemeName,
639  const WCHAR* pszPropName, WCHAR* pszValueBuf, int cchMaxValChars);
640 
652 HRESULT MCTRL_API mcGetThemeEnumValue(HTHEME hTheme, int iPartId, int iStateId,
653  int iPropId, int* piValue);
654 
667 HRESULT MCTRL_API mcGetThemeFilename(HTHEME hTheme, int iPartId, int iStateId,
668  int iPropId, WCHAR* pszThemeFilename, int cchMaxBuffChars);
669 
682 HRESULT MCTRL_API mcGetThemeFont(HTHEME hTheme, HDC hdc, int iPartId, int iStateId,
683  int iPropId, LOGFONTW* pLogFont);
684 
696 HRESULT MCTRL_API mcGetThemeInt(HTHEME hTheme, int iPartId, int iStateId,
697  int iPropId, int* piValue);
698 
710 HRESULT MCTRL_API mcGetThemeIntList(HTHEME hTheme, int iPartId, int iStateId,
711  int iPropId, INTLIST* pIntList);
712 
726 HRESULT MCTRL_API mcGetThemeMargins(HTHEME hTheme, HDC hdc, int iPartId,
727  int iStateId, int iPropId, RECT* prc, MARGINS* pMargins);
728 
741 HRESULT MCTRL_API mcGetThemeMetric(HTHEME hTheme, HDC hdc, int iPartId,
742  int iStateId, int iPropId, int* piValue);
743 
757 HRESULT MCTRL_API mcGetThemePartSize(HTHEME hTheme, HDC hdc, int iPartId,
758  int iStateId, const RECT* prc, enum THEMESIZE eSize, SIZE* psz);
759 
771 HRESULT MCTRL_API mcGetThemePosition(HTHEME hTheme, int iPartId, int iStateId,
772  int iPropId, POINT* pPoint);
773 
785 HRESULT MCTRL_API mcGetThemePropertyOrigin(HTHEME hTheme, int iPartId,
786  int iStateId, int iPropId, enum PROPERTYORIGIN* pOrigin);
787 
799 HRESULT MCTRL_API mcGetThemeRect(HTHEME hTheme, int iPartId, int iStateId,
800  int iPropId, RECT* prc);
801 
802 #if (_WIN32_WINNT >= 0x0600)
803 
816 HRESULT MCTRL_API mcGetThemeStream(HTHEME hTheme, int iPartId, int iStateId,
817  int iPropId, void** ppvStream, DWORD* pcbStream, HINSTANCE hInst);
818 #endif /* _WIN32_WINNT >= 0x0600 */
819 
832 HRESULT MCTRL_API mcGetThemeString(HTHEME hTheme, int iPartId, int iStateId,
833  int iPropId, WCHAR* pszBuff, int cchMaxBuffChars);
834 
846 BOOL MCTRL_API mcGetThemeSysBool(HTHEME hTheme, int iBoolId);
847 
856 COLORREF MCTRL_API mcGetThemeSysColor(HTHEME hTheme, int iColorId);
857 
867 HBRUSH MCTRL_API mcGetThemeSysColorBrush(HTHEME hTheme, int iColorId);
868 
880 HRESULT MCTRL_API mcGetThemeSysFont(HTHEME hTheme, int iFontId,
881  LOGFONTW* pLogFont);
882 
892 HRESULT MCTRL_API mcGetThemeSysInt(HTHEME hTheme, int iIntId, int* piValue);
893 
903 int MCTRL_API mcGetThemeSysSize(HTHEME hTheme, int iSizeId);
904 
915 HRESULT MCTRL_API mcGetThemeSysString(HTHEME hTheme, int iStringId,
916  WCHAR* pszBuff, int cchMaxBuffChars);
917 
933 HRESULT MCTRL_API mcGetThemeTextExtent(HTHEME hTheme, HDC hdc, int iPartId,
934  int iStateId, const WCHAR* pszText, int cchTextMax, DWORD dwFlags,
935  const RECT* prcBounding, RECT* prcExtent);
936 
948 HRESULT MCTRL_API mcGetThemeTextMetrics(HTHEME hTheme, HDC hdc, int iPartId,
949  int iStateId, TEXTMETRIC* pTextMetric);
950 
951 #if (_WIN32_WINNT >= 0x0600)
952 
966 HRESULT MCTRL_API mcGetThemeTransitionDuration(HTHEME hTheme, int iPartId,
967  int iStateIdFrom, int iStateIdTo, int iPropId, DWORD* pdwDuration);
968 #endif /* _WIN32_WINNT >= 0x0600 */
969 
977 HTHEME MCTRL_API mcGetWindowTheme(HWND hwnd);
978 
994 HRESULT MCTRL_API mcHitTestThemeBackground(HTHEME hTheme, HDC hdc, int iPartId,
995  int iStateId, DWORD dwOptions, const RECT* prc, HRGN hrgn,
996  POINT ptTest, WORD* pwHitTestCode);
997 
1004 BOOL MCTRL_API mcIsAppThemed(void);
1005 
1006 #if (_WIN32_WINNT >= 0x0600)
1007 
1015 BOOL MCTRL_API mcIsCompositionActive(void);
1016 #endif /* _WIN32_WINNT >= 0x0600 */
1017 
1024 BOOL MCTRL_API mcIsThemeActive(void);
1025 
1037  int iPartId, int iStateId);
1038 
1047 
1057 BOOL MCTRL_API mcIsThemePartDefined(HTHEME hTheme, int iPartId, int iStateId);
1058 
1067 HTHEME MCTRL_API mcOpenThemeData(HWND hwnd, const WCHAR* pszClassList);
1068 
1078 HTHEME MCTRL_API mcOpenThemeDataEx(HWND hwnd, const WCHAR* pszClassList,
1079  DWORD dwFlags);
1080 
1085 void MCTRL_API mcSetThemeAppProperties(DWORD dwFlags);
1086 
1096 HRESULT MCTRL_API mcSetWindowTheme(HWND hwnd, const WCHAR* pszSubAppName,
1097  const WCHAR* pszSubIdList);
1098 
1099  #if (_WIN32_WINNT >= 0x0600)
1100 
1112 HRESULT MCTRL_API mcSetWindowThemeAttribute(HWND hwnd,
1113  enum WINDOWTHEMEATTRIBUTETYPE eAttribute, void* pvAttribute,
1114  DWORD cbAttribute);
1115 #endif /* _WIN32_WINNT >= 0x0600 */
1116 
1127 BOOL MCTRL_API mcUpdatePanningFeedback(HWND hwnd, LONG lTotalOverpanOffsetX,
1128  LONG lTotalOverpanOffsetY, BOOL fInInertia);
1129 
1133 #ifdef __cplusplus
1134 } /* extern "C" */
1135 #endif
1136 
1137 #endif /* MCTRL_THEME_H */
#define MCTRL_API
Definition: _defs.h:46
BOOL mcIsAppThemed(void)
HRESULT mcBufferedPaintInit(void)
HRESULT mcGetThemeDocumentationProperty(const WCHAR *pszThemeName, const WCHAR *pszPropName, WCHAR *pszValueBuf, int cchMaxValChars)
HRESULT mcDrawThemeParentBackgroundEx(HWND hwnd, HDC hdc, DWORD dwFlags, RECT *prc)
void mcSetThemeAppProperties(DWORD dwFlags)
HRESULT mcBufferedPaintStopAllAnimations(HWND hwnd)
HRESULT mcBufferedPaintClear(HPAINTBUFFER hBufferedPaint, const RECT *prc)
HRESULT mcGetThemeBackgroundContentRect(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *prcBounding, RECT *prcContent)
BOOL mcIsThemeBackgroundPartiallyTransparent(HTHEME hTheme, int iPartId, int iStateId)
HTHEME mcOpenThemeData(HWND hwnd, const WCHAR *pszClassList)
HRESULT mcDrawThemeParentBackground(HWND hwnd, HDC hdc, RECT *prc)
COLORREF mcGetThemeSysColor(HTHEME hTheme, int iColorId)
BOOL mcIsCompositionActive(void)
HDC mcGetBufferedPaintDC(HPAINTBUFFER hBufferedPaint)
HRESULT mcGetThemePartSize(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *prc, enum THEMESIZE eSize, SIZE *psz)
HTHEME mcGetWindowTheme(HWND hwnd)
HRESULT mcEnableThemeDialogTexture(HWND hwnd, DWORD dwFlags)
HPAINTBUFFER mcBeginBufferedPaint(HDC hdcTarget, const RECT *prcTarget, BP_BUFFERFORMAT dwFormat, BP_PAINTPARAMS *pPaintParams, HDC *phdc)
BOOL mcIsThemePartDefined(HTHEME hTheme, int iPartId, int iStateId)
HRESULT mcGetThemeEnumValue(HTHEME hTheme, int iPartId, int iStateId, int iPropId, int *piValue)
HRESULT mcSetWindowThemeAttribute(HWND hwnd, enum WINDOWTHEMEATTRIBUTETYPE eAttribute, void *pvAttribute, DWORD cbAttribute)
HRESULT mcGetThemeRect(HTHEME hTheme, int iPartId, int iStateId, int iPropId, RECT *prc)
HRESULT mcDrawThemeText(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const WCHAR *pszText, int iCharCount, DWORD dwFlags, DWORD dwFlags2, const RECT *prc)
HBRUSH mcGetThemeSysColorBrush(HTHEME hTheme, int iColorId)
HRESULT mcGetThemeFilename(HTHEME hTheme, int iPartId, int iStateId, int iPropId, WCHAR *pszThemeFilename, int cchMaxBuffChars)
BOOL mcTheme_Initialize(void)
HRESULT mcGetThemeFont(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, int iPropId, LOGFONTW *pLogFont)
HRESULT mcGetThemeSysInt(HTHEME hTheme, int iIntId, int *piValue)
HRESULT mcSetWindowTheme(HWND hwnd, const WCHAR *pszSubAppName, const WCHAR *pszSubIdList)
HRESULT mcDrawThemeTextEx(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const WCHAR *pszText, int iCharCount, DWORD dwFlags, RECT *prc, const DTTOPTS *pOptions)
HRESULT mcGetThemeString(HTHEME hTheme, int iPartId, int iStateId, int iPropId, WCHAR *pszBuff, int cchMaxBuffChars)
BOOL mcIsThemeDialogTextureEnabled(HWND hwnd)
HRESULT mcGetThemeColor(HTHEME hTheme, int iPartId, int iStateId, int iPropId, COLORREF *pColor)
HRESULT mcDrawThemeBackground(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *prc, const RECT *prcClip)
HRESULT mcGetThemeBitmap(HTHEME hTheme, int iPartId, int iStateId, int iPropId, ULONG uFlags, HBITMAP *phBitmap)
HDC mcGetBufferedPaintTargetDC(HPAINTBUFFER hBufferedPaint)
HRESULT mcGetThemeInt(HTHEME hTheme, int iPartId, int iStateId, int iPropId, int *piValue)
HRESULT mcGetThemeTransitionDuration(HTHEME hTheme, int iPartId, int iStateIdFrom, int iStateIdTo, int iPropId, DWORD *pdwDuration)
HANIMATIONBUFFER mcBeginBufferedAnimation(HWND hwnd, HDC hdcTarget, const RECT *rcTarget, BP_BUFFERFORMAT dwFormat, BP_PAINTPARAMS *pPaintParams, BP_ANIMATIONPARAMS *pAnimationParams, HDC *phdcFrom, HDC *phdcTo)
HRESULT mcGetThemeSysString(HTHEME hTheme, int iStringId, WCHAR *pszBuff, int cchMaxBuffChars)
HRESULT mcGetThemeIntList(HTHEME hTheme, int iPartId, int iStateId, int iPropId, INTLIST *pIntList)
HRESULT mcGetBufferedPaintBits(HPAINTBUFFER hBufferedPaint, RGBQUAD **ppbBuffer, int *pcxRow)
HRESULT mcEndBufferedPaint(HPAINTBUFFER hBufferedPaint, BOOL fUpdateTarget)
HRESULT mcDrawThemeEdge(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *prcDest, UINT uEdge, UINT uFlags, RECT *prcContent)
HRESULT mcGetThemeBackgroundRegion(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *prc, HRGN *phRegion)
HRESULT mcGetCurrentThemeName(WCHAR *pszThemeFilename, int cchMaxFilenameChars, WCHAR *pszColorBuff, int cchMaxColorChars, WCHAR *pszSizeBuff, int cchMaxSizeChars)
DWORD mcGetThemeAppProperties(void)
HRESULT mcDrawThemeBackgroundEx(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *prc, const DTBGOPTS *pOptions)
BOOL mcGetThemeSysBool(HTHEME hTheme, int iBoolId)
HRESULT mcBufferedPaintUnInit(void)
int mcGetThemeSysSize(HTHEME hTheme, int iSizeId)
BOOL mcIsThemeActive(void)
HRESULT mcGetThemeMargins(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, int iPropId, RECT *prc, MARGINS *pMargins)
HRESULT mcGetBufferedPaintTargetRect(HPAINTBUFFER hBufferedPaint, RECT *prc)
HRESULT mcGetThemeTextMetrics(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, TEXTMETRIC *pTextMetric)
HRESULT mcDrawThemeIcon(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *prc, HIMAGELIST himl, int iImageIndex)
HRESULT mcGetThemeTextExtent(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const WCHAR *pszText, int cchTextMax, DWORD dwFlags, const RECT *prcBounding, RECT *prcExtent)
HRESULT mcGetThemeBackgroundExtent(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *prcContent, RECT *prcExtent)
HRESULT mcGetThemeStream(HTHEME hTheme, int iPartId, int iStateId, int iPropId, void **ppvStream, DWORD *pcbStream, HINSTANCE hInst)
HRESULT mcGetThemePosition(HTHEME hTheme, int iPartId, int iStateId, int iPropId, POINT *pPoint)
HRESULT mcCloseThemeData(HTHEME hTheme)
HRESULT mcHitTestThemeBackground(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, DWORD dwOptions, const RECT *prc, HRGN hrgn, POINT ptTest, WORD *pwHitTestCode)
BOOL mcBufferedPaintRenderAnimation(HWND hwnd, HDC hdcTarget)
HRESULT mcGetThemeMetric(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, int iPropId, int *piValue)
BOOL mcBeginPanningFeedback(HWND hwnd)
HRESULT mcGetThemeBool(HTHEME hTheme, int iPartId, int iStateId, int iPropId, BOOL *pfValue)
BOOL mcUpdatePanningFeedback(HWND hwnd, LONG lTotalOverpanOffsetX, LONG lTotalOverpanOffsetY, BOOL fInInertia)
HRESULT mcGetThemePropertyOrigin(HTHEME hTheme, int iPartId, int iStateId, int iPropId, enum PROPERTYORIGIN *pOrigin)
HRESULT mcEndBufferedAnimation(HANIMATIONBUFFER hbpAnimation, BOOL fUpdateTarget)
HRESULT mcBufferedPaintSetAlpha(HPAINTBUFFER hBufferedPaint, const RECT *prc, BYTE alpha)
Common definitions.
void mcTheme_Terminate(void)
HTHEME mcOpenThemeDataEx(HWND hwnd, const WCHAR *pszClassList, DWORD dwFlags)
Common constants and types.
BOOL mcEndPanningFeedback(HWND hwnd, BOOL fAnimateBack)
HRESULT mcGetThemeSysFont(HTHEME hTheme, int iFontId, LOGFONTW *pLogFont)