mCtrl  0.9.7
theme.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 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 
72 
82 BOOL MCTRL_API mcTheme_Initialize(void);
83 
88 void MCTRL_API mcTheme_Terminate(void);
89 
97 
98 #if (_WIN32_WINNT >= 0x0600)
99 
115 HANIMATIONBUFFER MCTRL_API mcBeginBufferedAnimation(HWND hwnd, HDC hdcTarget,
116  const RECT* rcTarget, BP_BUFFERFORMAT dwFormat,
117  BP_PAINTPARAMS* pPaintParams, BP_ANIMATIONPARAMS* pAnimationParams,
118  HDC* phdcFrom, HDC* phdcTo);
119 
133 HPAINTBUFFER MCTRL_API mcBeginBufferedPaint(HDC hdcTarget, const RECT* prcTarget,
134  BP_BUFFERFORMAT dwFormat, BP_PAINTPARAMS* pPaintParams, HDC* phdc);
135 
145 BOOL MCTRL_API mcBeginPanningFeedback(HWND hwnd);
146 
157 HRESULT MCTRL_API mcBufferedPaintClear(HPAINTBUFFER hBufferedPaint,
158  const RECT* prc);
159 
168 HRESULT MCTRL_API mcBufferedPaintInit(void);
169 
180 BOOL MCTRL_API mcBufferedPaintRenderAnimation(HWND hwnd, HDC hdcTarget);
181 
193 HRESULT MCTRL_API mcBufferedPaintSetAlpha(HPAINTBUFFER hBufferedPaint,
194  const RECT* prc, BYTE alpha);
195 
205 HRESULT MCTRL_API mcBufferedPaintStopAllAnimations(HWND hwnd);
206 
215 HRESULT MCTRL_API mcBufferedPaintUnInit(void);
216 #endif /* _WIN32_WINNT >= 0x0600 */
217 
225 HRESULT MCTRL_API mcCloseThemeData(HTHEME hTheme);
226 
239 HRESULT MCTRL_API mcDrawThemeBackground(HTHEME hTheme, HDC hdc,
240  int iPartId, int iStateId, const RECT* prc, const RECT* prcClip);
241 
254 HRESULT MCTRL_API mcDrawThemeBackgroundEx(HTHEME hTheme, HDC hdc,
255  int iPartId, int iStateId, const RECT* prc, const DTBGOPTS* pOptions);
256 
271 HRESULT MCTRL_API mcDrawThemeEdge(HTHEME hTheme, HDC hdc,
272  int iPartId, int iStateId, const RECT* prcDest, UINT uEdge,
273  UINT uFlags, RECT* prcContent);
274 
288 HRESULT MCTRL_API mcDrawThemeIcon(HTHEME hTheme, HDC hdc,
289  int iPartId, int iStateId, const RECT* prc,
290  HIMAGELIST himl, int iImageIndex);
291 
304 HRESULT MCTRL_API mcDrawThemeParentBackground(HWND hwnd, HDC hdc, RECT* prc);
305 
306 
307 #if (_WIN32_WINNT >= 0x0600)
308 
320 HRESULT MCTRL_API mcDrawThemeParentBackgroundEx(HWND hwnd, HDC hdc,
321  DWORD dwFlags, RECT* prc);
322 #endif /* _WIN32_WINNT >= 0x0600 */
323 
339 HRESULT MCTRL_API mcDrawThemeText(HTHEME hTheme, HDC hdc,
340  int iPartId, int iStateId, const WCHAR* pszText, int iCharCount,
341  DWORD dwFlags, DWORD dwFlags2, const RECT* prc);
342 
343 #if (_WIN32_WINNT >= 0x0600)
344 
361 HRESULT MCTRL_API mcDrawThemeTextEx(HTHEME hTheme, HDC hdc,
362  int iPartId, int iStateId, const WCHAR* pszText, int iCharCount,
363  DWORD dwFlags, RECT* prc, const DTTOPTS* pOptions);
364 #endif /* _WIN32_WINNT >= 0x0600 */
365 
374 HRESULT MCTRL_API mcEnableThemeDialogTexture(HWND hwnd, DWORD dwFlags);
375 
376 #if (_WIN32_WINNT >= 0x0600)
377 
387 HRESULT MCTRL_API mcEndBufferedAnimation(HANIMATIONBUFFER hbpAnimation,
388  BOOL fUpdateTarget);
389 
400 HRESULT MCTRL_API mcEndBufferedPaint(HPAINTBUFFER hBufferedPaint,
401  BOOL fUpdateTarget);
402 
413 BOOL MCTRL_API mcEndPanningFeedback(HWND hwnd, BOOL fAnimateBack);
414 
426 HRESULT MCTRL_API mcGetBufferedPaintBits(HPAINTBUFFER hBufferedPaint,
427  RGBQUAD** ppbBuffer, int* pcxRow);
428 
438 HDC MCTRL_API mcGetBufferedPaintDC(HPAINTBUFFER hBufferedPaint);
439 
449 HDC MCTRL_API mcGetBufferedPaintTargetDC(HPAINTBUFFER hBufferedPaint);
450 
461 HRESULT MCTRL_API mcGetBufferedPaintTargetRect(HPAINTBUFFER hBufferedPaint,
462  RECT* prc);
463 #endif /* _WIN32_WINNT >= 0x0600 */
464 
478  WCHAR* pszThemeFilename, int cchMaxFilenameChars,
479  WCHAR* pszColorBuff, int cchMaxColorChars,
480  WCHAR* pszSizeBuff, int cchMaxSizeChars);
481 
489 
502 HRESULT MCTRL_API mcGetThemeBackgroundContentRect(HTHEME hTheme, HDC hdc,
503  int iPartId, int iStateId, const RECT* prcBounding, RECT* prcContent);
504 
517 HRESULT MCTRL_API mcGetThemeBackgroundExtent(HTHEME hTheme, HDC hdc,
518  int iPartId, int iStateId, const RECT* prcContent, RECT* prcExtent);
519 
532 HRESULT MCTRL_API mcGetThemeBackgroundRegion(HTHEME hTheme, HDC hdc,
533  int iPartId, int iStateId, const RECT* prc, HRGN* phRegion);
534 
535 #if (_WIN32_WINNT >= 0x0600)
536 
548 HRESULT MCTRL_API mcGetThemeBitmap(HTHEME hTheme, int iPartId, int iStateId,
549  int iPropId, ULONG uFlags, HBITMAP* phBitmap);
550 #endif /* _WIN32_WINNT >= 0x0600 */
551 
563 HRESULT MCTRL_API mcGetThemeBool(HTHEME hTheme, int iPartId, int iStateId,
564  int iPropId, BOOL* pfValue);
565 
577 HRESULT MCTRL_API mcGetThemeColor(HTHEME hTheme, int iPartId, int iStateId,
578  int iPropId, COLORREF* pColor);
579 
590 HRESULT MCTRL_API mcGetThemeDocumentationProperty(const WCHAR* pszThemeName,
591  const WCHAR* pszPropName, WCHAR* pszValueBuf, int cchMaxValChars);
592 
604 HRESULT MCTRL_API mcGetThemeEnumValue(HTHEME hTheme, int iPartId, int iStateId,
605  int iPropId, int* piValue);
606 
619 HRESULT MCTRL_API mcGetThemeFilename(HTHEME hTheme, int iPartId, int iStateId,
620  int iPropId, WCHAR* pszThemeFilename, int cchMaxBuffChars);
621 
634 HRESULT MCTRL_API mcGetThemeFont(HTHEME hTheme, HDC hdc, int iPartId, int iStateId,
635  int iPropId, LOGFONTW* pLogFont);
636 
648 HRESULT MCTRL_API mcGetThemeInt(HTHEME hTheme, int iPartId, int iStateId,
649  int iPropId, int* piValue);
650 
662 HRESULT MCTRL_API mcGetThemeIntList(HTHEME hTheme, int iPartId, int iStateId,
663  int iPropId, INTLIST* pIntList);
664 
678 HRESULT MCTRL_API mcGetThemeMargins(HTHEME hTheme, HDC hdc, int iPartId,
679  int iStateId, int iPropId, RECT* prc, MARGINS* pMargins);
680 
693 HRESULT MCTRL_API mcGetThemeMetric(HTHEME hTheme, HDC hdc, int iPartId,
694  int iStateId, int iPropId, int* piValue);
695 
709 HRESULT MCTRL_API mcGetThemePartSize(HTHEME hTheme, HDC hdc, int iPartId,
710  int iStateId, const RECT* prc, enum THEMESIZE eSize, SIZE* psz);
711 
723 HRESULT MCTRL_API mcGetThemePosition(HTHEME hTheme, int iPartId, int iStateId,
724  int iPropId, POINT* pPoint);
725 
737 HRESULT MCTRL_API mcGetThemePropertyOrigin(HTHEME hTheme, int iPartId,
738  int iStateId, int iPropId, enum PROPERTYORIGIN* pOrigin);
739 
751 HRESULT MCTRL_API mcGetThemeRect(HTHEME hTheme, int iPartId, int iStateId,
752  int iPropId, RECT* prc);
753 
754 #if (_WIN32_WINNT >= 0x0600)
755 
768 HRESULT MCTRL_API mcGetThemeStream(HTHEME hTheme, int iPartId, int iStateId,
769  int iPropId, void** ppvStream, DWORD* pcbStream, HINSTANCE hInst);
770 #endif /* _WIN32_WINNT >= 0x0600 */
771 
784 HRESULT MCTRL_API mcGetThemeString(HTHEME hTheme, int iPartId, int iStateId,
785  int iPropId, WCHAR* pszBuff, int cchMaxBuffChars);
786 
798 BOOL MCTRL_API mcGetThemeSysBool(HTHEME hTheme, int iBoolId);
799 
808 COLORREF MCTRL_API mcGetThemeSysColor(HTHEME hTheme, int iColorId);
809 
819 HBRUSH MCTRL_API mcGetThemeSysColorBrush(HTHEME hTheme, int iColorId);
820 
832 HRESULT MCTRL_API mcGetThemeSysFont(HTHEME hTheme, int iFontId,
833  LOGFONTW* pLogFont);
834 
844 HRESULT MCTRL_API mcGetThemeSysInt(HTHEME hTheme, int iIntId, int* piValue);
845 
855 int MCTRL_API mcGetThemeSysSize(HTHEME hTheme, int iSizeId);
856 
867 HRESULT MCTRL_API mcGetThemeSysString(HTHEME hTheme, int iStringId,
868  WCHAR* pszBuff, int cchMaxBuffChars);
869 
885 HRESULT MCTRL_API mcGetThemeTextExtent(HTHEME hTheme, HDC hdc, int iPartId,
886  int iStateId, const WCHAR* pszText, int cchTextMax, DWORD dwFlags,
887  const RECT* prcBounding, RECT* prcExtent);
888 
900 HRESULT MCTRL_API mcGetThemeTextMetrics(HTHEME hTheme, HDC hdc, int iPartId,
901  int iStateId, TEXTMETRIC* pTextMetric);
902 
903 #if (_WIN32_WINNT >= 0x0600)
904 
917 HRESULT MCTRL_API mcGetThemeTransitionDuration(HTHEME hTheme, int iPartId,
918  int iStateIdFrom, int iStateIdTo, int iPropId, DWORD* pdwDuration);
919 #endif /* _WIN32_WINNT >= 0x0600 */
920 
928 HTHEME MCTRL_API mcGetWindowTheme(HWND hwnd);
929 
945 HRESULT MCTRL_API mcHitTestThemeBackground(HTHEME hTheme, HDC hdc, int iPartId,
946  int iStateId, DWORD dwOptions, const RECT* prc, HRGN hrgn,
947  POINT ptTest, WORD* pwHitTestCode);
948 
955 BOOL MCTRL_API mcIsAppThemed(void);
956 
957 #if (_WIN32_WINNT >= 0x0600)
958 
966 BOOL MCTRL_API mcIsCompositionActive(void);
967 #endif /* _WIN32_WINNT >= 0x0600 */
968 
975 BOOL MCTRL_API mcIsThemeActive(void);
976 
988  int iPartId, int iStateId);
989 
998 
1008 BOOL MCTRL_API mcIsThemePartDefined(HTHEME hTheme, int iPartId, int iStateId);
1009 
1018 HTHEME MCTRL_API mcOpenThemeData(HWND hwnd, const WCHAR* pszClassList);
1019 
1029 HTHEME MCTRL_API mcOpenThemeDataEx(HWND hwnd, const WCHAR* pszClassList,
1030  DWORD dwFlags);
1031 
1036 void MCTRL_API mcSetThemeAppProperties(DWORD dwFlags);
1037 
1047 HRESULT MCTRL_API mcSetWindowTheme(HWND hwnd, const WCHAR* pszSubAppName,
1048  const WCHAR* pszSubIdList);
1049 
1050  #if (_WIN32_WINNT >= 0x0600)
1051 
1063 HRESULT MCTRL_API mcSetWindowThemeAttribute(HWND hwnd,
1064  enum WINDOWTHEMEATTRIBUTETYPE eAttribute, void* pvAttribute,
1065  DWORD cbAttribute);
1066 #endif /* _WIN32_WINNT >= 0x0600 */
1067 
1078 BOOL MCTRL_API mcUpdatePanningFeedback(HWND hwnd, LONG lTotalOverpanOffsetX,
1079  LONG lTotalOverpanOffsetY, BOOL fInInertia);
1080 
1084 #ifdef __cplusplus
1085 } /* extern "C" */
1086 #endif
1087 
1088 #endif /* MCTRL_THEME_H */
#define MCTRL_API
Definition: _defs.h:46
BOOL mcIsAppThemed(void)
HRESULT mcGetThemeDocumentationProperty(const WCHAR *pszThemeName, const WCHAR *pszPropName, WCHAR *pszValueBuf, int cchMaxValChars)
void mcSetThemeAppProperties(DWORD dwFlags)
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)
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)
BOOL mcIsThemePartDefined(HTHEME hTheme, int iPartId, int iStateId)
HRESULT mcGetThemeEnumValue(HTHEME hTheme, int iPartId, int iStateId, int iPropId, int *piValue)
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 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 mcGetThemeInt(HTHEME hTheme, int iPartId, int iStateId, int iPropId, int *piValue)
HRESULT mcGetThemeSysString(HTHEME hTheme, int iStringId, WCHAR *pszBuff, int cchMaxBuffChars)
HRESULT mcGetThemeIntList(HTHEME hTheme, int iPartId, int iStateId, int iPropId, INTLIST *pIntList)
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)
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 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 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)
HRESULT mcGetThemeMetric(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, int iPropId, int *piValue)
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)
Common definitions.
void mcTheme_Terminate(void)
HTHEME mcOpenThemeDataEx(HWND hwnd, const WCHAR *pszClassList, DWORD dwFlags)
Common constants and types.
HRESULT mcGetThemeSysFont(HTHEME hTheme, int iFontId, LOGFONTW *pLogFont)