mCtrl  0.9.4
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 
25 #include <vssym32.h>
26 #include <vsstyle.h>
27 #include <uxtheme.h>
28 
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 
71 
81 BOOL MCTRL_API mcTheme_Initialize(void);
82 
87 void MCTRL_API mcTheme_Terminate(void);
88 
96 
97 #if (_WIN32_WINNT >= 0x0600)
98 
114 HANIMATIONBUFFER MCTRL_API mcBeginBufferedAnimation(HWND hwnd, HDC hdcTarget,
115  const RECT* rcTarget, BP_BUFFERFORMAT dwFormat,
116  BP_PAINTPARAMS* pPaintParams, BP_ANIMATIONPARAMS* pAnimationParams,
117  HDC* phdcFrom, HDC* phdcTo);
118 
132 HPAINTBUFFER MCTRL_API mcBeginBufferedPaint(HDC hdcTarget, const RECT* prcTarget,
133  BP_BUFFERFORMAT dwFormat, BP_PAINTPARAMS* pPaintParams, HDC* phdc);
134 
144 BOOL MCTRL_API mcBeginPanningFeedback(HWND hwnd);
145 
156 HRESULT MCTRL_API mcBufferedPaintClear(HPAINTBUFFER hBufferedPaint,
157  const RECT* prc);
158 
167 HRESULT MCTRL_API mcBufferedPaintInit(void);
168 
179 BOOL MCTRL_API mcBufferedPaintRenderAnimation(HWND hwnd, HDC hdcTarget);
180 
192 HRESULT MCTRL_API mcBufferedPaintSetAlpha(HPAINTBUFFER hBufferedPaint,
193  const RECT* prc, BYTE alpha);
194 
204 HRESULT MCTRL_API mcBufferedPaintStopAllAnimations(HWND hwnd);
205 
214 HRESULT MCTRL_API mcBufferedPaintUnInit(void);
215 #endif /* _WIN32_WINNT >= 0x0600 */
216 
224 HRESULT MCTRL_API mcCloseThemeData(HTHEME hTheme);
225 
238 HRESULT MCTRL_API mcDrawThemeBackground(HTHEME hTheme, HDC hdc,
239  int iPartId, int iStateId, const RECT* prc, const RECT* prcClip);
240 
253 HRESULT MCTRL_API mcDrawThemeBackgroundEx(HTHEME hTheme, HDC hdc,
254  int iPartId, int iStateId, const RECT* prc, const DTBGOPTS* pOptions);
255 
270 HRESULT MCTRL_API mcDrawThemeEdge(HTHEME hTheme, HDC hdc,
271  int iPartId, int iStateId, const RECT* prcDest, UINT uEdge,
272  UINT uFlags, RECT* prcContent);
273 
287 HRESULT MCTRL_API mcDrawThemeIcon(HTHEME hTheme, HDC hdc,
288  int iPartId, int iStateId, const RECT* prc,
289  HIMAGELIST himl, int iImageIndex);
290 
303 HRESULT MCTRL_API mcDrawThemeParentBackground(HWND hwnd, HDC hdc, RECT* prc);
304 
305 
306 #if (_WIN32_WINNT >= 0x0600)
307 
319 HRESULT MCTRL_API mcDrawThemeParentBackgroundEx(HWND hwnd, HDC hdc,
320  DWORD dwFlags, RECT* prc);
321 #endif /* _WIN32_WINNT >= 0x0600 */
322 
338 HRESULT MCTRL_API mcDrawThemeText(HTHEME hTheme, HDC hdc,
339  int iPartId, int iStateId, const WCHAR* pszText, int iCharCount,
340  DWORD dwFlags, DWORD dwFlags2, const RECT* prc);
341 
342 #if (_WIN32_WINNT >= 0x0600)
343 
360 HRESULT MCTRL_API mcDrawThemeTextEx(HTHEME hTheme, HDC hdc,
361  int iPartId, int iStateId, const WCHAR* pszText, int iCharCount,
362  DWORD dwFlags, RECT* prc, const DTTOPTS* pOptions);
363 #endif /* _WIN32_WINNT >= 0x0600 */
364 
373 HRESULT MCTRL_API mcEnableThemeDialogTexture(HWND hwnd, DWORD dwFlags);
374 
375 #if (_WIN32_WINNT >= 0x0600)
376 
386 HRESULT MCTRL_API mcEndBufferedAnimation(HANIMATIONBUFFER hbpAnimation,
387  BOOL fUpdateTarget);
388 
399 HRESULT MCTRL_API mcEndBufferedPaint(HPAINTBUFFER hBufferedPaint,
400  BOOL fUpdateTarget);
401 
412 BOOL MCTRL_API mcEndPanningFeedback(HWND hwnd, BOOL fAnimateBack);
413 
425 HRESULT MCTRL_API mcGetBufferedPaintBits(HPAINTBUFFER hBufferedPaint,
426  RGBQUAD** ppbBuffer, int* pcxRow);
427 
437 HDC MCTRL_API mcGetBufferedPaintDC(HPAINTBUFFER hBufferedPaint);
438 
448 HDC MCTRL_API mcGetBufferedPaintTargetDC(HPAINTBUFFER hBufferedPaint);
449 
460 HRESULT MCTRL_API mcGetBufferedPaintTargetRect(HPAINTBUFFER hBufferedPaint,
461  RECT* prc);
462 #endif /* _WIN32_WINNT >= 0x0600 */
463 
477  WCHAR* pszThemeFilename, int cchMaxFilenameChars,
478  WCHAR* pszColorBuff, int cchMaxColorChars,
479  WCHAR* pszSizeBuff, int cchMaxSizeChars);
480 
488 
501 HRESULT MCTRL_API mcGetThemeBackgroundContentRect(HTHEME hTheme, HDC hdc,
502  int iPartId, int iStateId, const RECT* prcBounding, RECT* prcContent);
503 
516 HRESULT MCTRL_API mcGetThemeBackgroundExtent(HTHEME hTheme, HDC hdc,
517  int iPartId, int iStateId, const RECT* prcContent, RECT* prcExtent);
518 
531 HRESULT MCTRL_API mcGetThemeBackgroundRegion(HTHEME hTheme, HDC hdc,
532  int iPartId, int iStateId, const RECT* prc, HRGN* phRegion);
533 
534 #if (_WIN32_WINNT >= 0x0600)
535 
547 HRESULT MCTRL_API mcGetThemeBitmap(HTHEME hTheme, int iPartId, int iStateId,
548  int iPropId, ULONG uFlags, HBITMAP* phBitmap);
549 #endif /* _WIN32_WINNT >= 0x0600 */
550 
562 HRESULT MCTRL_API mcGetThemeBool(HTHEME hTheme, int iPartId, int iStateId,
563  int iPropId, BOOL* pfValue);
564 
576 HRESULT MCTRL_API mcGetThemeColor(HTHEME hTheme, int iPartId, int iStateId,
577  int iPropId, COLORREF* pColor);
578 
589 HRESULT MCTRL_API mcGetThemeDocumentationProperty(const WCHAR* pszThemeName,
590  const WCHAR* pszPropName, WCHAR* pszValueBuf, int cchMaxValChars);
591 
603 HRESULT MCTRL_API mcGetThemeEnumValue(HTHEME hTheme, int iPartId, int iStateId,
604  int iPropId, int* piValue);
605 
618 HRESULT MCTRL_API mcGetThemeFilename(HTHEME hTheme, int iPartId, int iStateId,
619  int iPropId, WCHAR* pszThemeFilename, int cchMaxBuffChars);
620 
633 HRESULT MCTRL_API mcGetThemeFont(HTHEME hTheme, HDC hdc, int iPartId, int iStateId,
634  int iPropId, LOGFONTW* pLogFont);
635 
647 HRESULT MCTRL_API mcGetThemeInt(HTHEME hTheme, int iPartId, int iStateId,
648  int iPropId, int* piValue);
649 
661 HRESULT MCTRL_API mcGetThemeIntList(HTHEME hTheme, int iPartId, int iStateId,
662  int iPropId, INTLIST* pIntList);
663 
677 HRESULT MCTRL_API mcGetThemeMargins(HTHEME hTheme, HDC hdc, int iPartId,
678  int iStateId, int iPropId, RECT* prc, MARGINS* pMargins);
679 
692 HRESULT MCTRL_API mcGetThemeMetric(HTHEME hTheme, HDC hdc, int iPartId,
693  int iStateId, int iPropId, int* piValue);
694 
708 HRESULT MCTRL_API mcGetThemePartSize(HTHEME hTheme, HDC hdc, int iPartId,
709  int iStateId, const RECT* prc, enum THEMESIZE eSize, SIZE* psz);
710 
722 HRESULT MCTRL_API mcGetThemePosition(HTHEME hTheme, int iPartId, int iStateId,
723  int iPropId, POINT* pPoint);
724 
736 HRESULT MCTRL_API mcGetThemePropertyOrigin(HTHEME hTheme, int iPartId,
737  int iStateId, int iPropId, enum PROPERTYORIGIN* pOrigin);
738 
750 HRESULT MCTRL_API mcGetThemeRect(HTHEME hTheme, int iPartId, int iStateId,
751  int iPropId, RECT* prc);
752 
753 #if (_WIN32_WINNT >= 0x0600)
754 
767 HRESULT MCTRL_API mcGetThemeStream(HTHEME hTheme, int iPartId, int iStateId,
768  int iPropId, void** ppvStream, DWORD* pcbStream, HINSTANCE hInst);
769 #endif /* _WIN32_WINNT >= 0x0600 */
770 
783 HRESULT MCTRL_API mcGetThemeString(HTHEME hTheme, int iPartId, int iStateId,
784  int iPropId, WCHAR* pszBuff, int cchMaxBuffChars);
785 
797 BOOL MCTRL_API mcGetThemeSysBool(HTHEME hTheme, int iBoolId);
798 
807 COLORREF MCTRL_API mcGetThemeSysColor(HTHEME hTheme, int iColorId);
808 
818 HBRUSH MCTRL_API mcGetThemeSysColorBrush(HTHEME hTheme, int iColorId);
819 
831 HRESULT MCTRL_API mcGetThemeSysFont(HTHEME hTheme, int iFontId,
832  LOGFONTW* pLogFont);
833 
843 HRESULT MCTRL_API mcGetThemeSysInt(HTHEME hTheme, int iIntId, int* piValue);
844 
854 int MCTRL_API mcGetThemeSysSize(HTHEME hTheme, int iSizeId);
855 
866 HRESULT MCTRL_API mcGetThemeSysString(HTHEME hTheme, int iStringId,
867  WCHAR* pszBuff, int cchMaxBuffChars);
868 
884 HRESULT MCTRL_API mcGetThemeTextExtent(HTHEME hTheme, HDC hdc, int iPartId,
885  int iStateId, const TCHAR* pszText, int cchTextMax, DWORD dwFlags,
886  const RECT* prcBounding, RECT* prcExtent);
887 
899 HRESULT MCTRL_API mcGetThemeTextMetrics(HTHEME hTheme, HDC hdc, int iPartId,
900  int iStateId, TEXTMETRIC* pTextMetric);
901 
902 #if (_WIN32_WINNT >= 0x0600)
903 
916 HRESULT MCTRL_API mcGetThemeTransitionDuration(HTHEME hTheme, int iPartId,
917  int iStateIdFrom, int iStateIdTo, int iPropId, DWORD* pdwDuration);
918 #endif /* _WIN32_WINNT >= 0x0600 */
919 
927 HTHEME MCTRL_API mcGetWindowTheme(HWND hwnd);
928 
944 HRESULT MCTRL_API mcHitTestThemeBackground(HTHEME hTheme, HDC hdc, int iPartId,
945  int iStateId, DWORD dwOptions, const RECT* prc, HRGN hrgn,
946  POINT ptTest, WORD* pwHitTestCode);
947 
954 BOOL MCTRL_API mcIsAppThemed(void);
955 
956 #if (_WIN32_WINNT >= 0x0600)
957 
965 BOOL MCTRL_API mcIsCompositionActive(void);
966 #endif /* _WIN32_WINNT >= 0x0600 */
967 
974 BOOL MCTRL_API mcIsThemeActive(void);
975 
987  int iPartId, int iStateId);
988 
997 
1007 BOOL MCTRL_API mcIsThemePartDefined(HTHEME hTheme, int iPartId, int iStateId);
1008 
1017 HTHEME MCTRL_API mcOpenThemeData(HWND hwnd, const WCHAR* pszClassList);
1018 
1028 HTHEME MCTRL_API mcOpenThemeDataEx(HWND hwnd, const WCHAR* pszClassList,
1029  DWORD dwFlags);
1030 
1035 void MCTRL_API mcSetThemeAppProperties(DWORD dwFlags);
1036 
1046 HRESULT MCTRL_API mcSetWindowTheme(HWND hwnd, const WCHAR* pszSubAppName,
1047  const WCHAR* pszSubIdList);
1048 
1049  #if (_WIN32_WINNT >= 0x0600)
1050 
1062 HRESULT MCTRL_API mcSetWindowThemeAttribute(HWND hwnd,
1063  enum WINDOWTHEMEATTRIBUTETYPE eAttribute, void* pvAttribute,
1064  DWORD cbAttribute);
1065 #endif /* _WIN32_WINNT >= 0x0600 */
1066 
1077 BOOL MCTRL_API mcUpdatePanningFeedback(HWND hwnd, LONG lTotalOverpanOffsetX,
1078  LONG lTotalOverpanOffsetY, BOOL fInInertia);
1079 
1083 #ifdef __cplusplus
1084 } /* extern "C" */
1085 #endif
1086 
1087 #endif /* MCTRL_THEME_H */