2014-02-07 18:02:02 +00:00
|
|
|
#ifndef _UXTHEME_PCH_
|
|
|
|
#define _UXTHEME_PCH_
|
|
|
|
|
2014-01-25 23:07:09 +00:00
|
|
|
#include <stdarg.h>
|
2013-01-24 23:00:42 +00:00
|
|
|
|
|
|
|
#define WIN32_NO_STATUS
|
2014-01-25 23:07:09 +00:00
|
|
|
#define _INC_WINDOWS
|
|
|
|
#define COM_NO_WINDOWS_H
|
|
|
|
|
2013-01-24 23:00:42 +00:00
|
|
|
#include <windef.h>
|
|
|
|
#include <winbase.h>
|
|
|
|
#include <wingdi.h>
|
|
|
|
#include <winuser.h>
|
2014-01-25 23:07:09 +00:00
|
|
|
#include <winnls.h>
|
2011-09-20 13:08:36 +00:00
|
|
|
#include <windowsx.h>
|
|
|
|
#include <undocuser.h>
|
2017-05-03 11:13:23 +00:00
|
|
|
#include <undocgdi.h>
|
2011-09-20 13:08:36 +00:00
|
|
|
#include <uxtheme.h>
|
2014-01-17 17:52:58 +00:00
|
|
|
#include <uxundoc.h>
|
2011-09-20 13:08:36 +00:00
|
|
|
#include <vfwmsgs.h>
|
|
|
|
#include <tmschema.h>
|
2005-07-03 18:32:22 +00:00
|
|
|
|
2017-05-19 11:02:44 +00:00
|
|
|
#define NTOS_MODE_USER
|
|
|
|
#include <ndk/ntndk.h>
|
|
|
|
#include <ndk/rtltypes.h>
|
|
|
|
|
2013-12-28 00:19:58 +00:00
|
|
|
#include <wine/debug.h>
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(uxtheme);
|
|
|
|
|
2005-07-03 18:32:22 +00:00
|
|
|
#define TMT_ENUM 200
|
|
|
|
|
|
|
|
#define MAX_THEME_APP_NAME 60
|
|
|
|
#define MAX_THEME_CLASS_NAME 60
|
|
|
|
#define MAX_THEME_VALUE_NAME 60
|
|
|
|
|
|
|
|
typedef struct _THEME_PROPERTY {
|
|
|
|
int iPrimitiveType;
|
|
|
|
int iPropertyId;
|
|
|
|
PROPERTYORIGIN origin;
|
|
|
|
|
|
|
|
LPCWSTR lpValue;
|
|
|
|
DWORD dwValueLen;
|
|
|
|
|
|
|
|
struct _THEME_PROPERTY *next;
|
|
|
|
} THEME_PROPERTY, *PTHEME_PROPERTY;
|
|
|
|
|
|
|
|
typedef struct _THEME_PARTSTATE {
|
|
|
|
int iPartId;
|
|
|
|
int iStateId;
|
|
|
|
PTHEME_PROPERTY properties;
|
|
|
|
|
|
|
|
struct _THEME_PARTSTATE *next;
|
|
|
|
} THEME_PARTSTATE, *PTHEME_PARTSTATE;
|
|
|
|
|
Sync to Wine-20050725:
Thomas Weidenmueller <wine-patches@reactsoft.com>
- IsThemeDialogTextureEnabled should have one parameter to match the
prototype in the official headers.
Mike McCormack <mike@codeweavers.com>
- gcc 4.0 -Wpointer-sign fixes (Reg* functions).
Stefan Huehner <stefan@huehner.org>
- Make some function static.
- Fix -Wmissing-declarations warnings.
Frank Richter <frank.richter@gmail.com>
- Enable/disable "flat menus" based on the setting from the active
theme.
- Have the theme INI file parsed upon theme activation and not just when
the first theme data is requested; that way, the themed system colors
are set correctly from the start, and not just after some theme data
was requested.
- GetThemeBackgroundContentRect() does not use the content margins
alone, it also falls back to the border size or sizing margins, and if
it can't find any possible margins at all, it returns the original
rectangle.
- Make dialog theme texture setting non-global (ie a per-window
setting).
- Better viewport origin in DrawThemeParentBackground().
- OpenThemeData() now always sets the window theme to the handle
returned (even if that is NULL) - previously, it could happen that
when no theme was active or the theme data could not be opened that
the window theme remained became then-dangling (and hence subsequent
calls to GetWindowTheme() would return that bogus theme).
- Correct border rectangle drawing.
- Don't crash if NULL is passed as the class list to OpenThemeData().
- UXTHEME_LoadImage(): Set default image count to 1 to avoid division by
zero in case image count property is not given. Properly support 0
state IDs.
- Every window needs to receive WM_THEMECHANGED (esp. controls), so also
send it to child windows.
- Changed the default transparent color in case none was explicitly
specified from the upper left pixel color to magenta. Empirically
gives better results.
- Write WCHAR strings to registry with correct size.
- Opening some theme class data now also increases the reference count
of the theme file, so as long as theme class data is still opened
somewhere, the theme file won't get freed. Otherwise, it could happen
that invalid class data was used, which could lead to problems.
svn path=/trunk/; revision=17342
2005-08-12 18:22:47 +00:00
|
|
|
struct _THEME_FILE;
|
|
|
|
|
2005-07-03 18:32:22 +00:00
|
|
|
typedef struct _THEME_CLASS {
|
|
|
|
HMODULE hTheme;
|
Sync to Wine-20050725:
Thomas Weidenmueller <wine-patches@reactsoft.com>
- IsThemeDialogTextureEnabled should have one parameter to match the
prototype in the official headers.
Mike McCormack <mike@codeweavers.com>
- gcc 4.0 -Wpointer-sign fixes (Reg* functions).
Stefan Huehner <stefan@huehner.org>
- Make some function static.
- Fix -Wmissing-declarations warnings.
Frank Richter <frank.richter@gmail.com>
- Enable/disable "flat menus" based on the setting from the active
theme.
- Have the theme INI file parsed upon theme activation and not just when
the first theme data is requested; that way, the themed system colors
are set correctly from the start, and not just after some theme data
was requested.
- GetThemeBackgroundContentRect() does not use the content margins
alone, it also falls back to the border size or sizing margins, and if
it can't find any possible margins at all, it returns the original
rectangle.
- Make dialog theme texture setting non-global (ie a per-window
setting).
- Better viewport origin in DrawThemeParentBackground().
- OpenThemeData() now always sets the window theme to the handle
returned (even if that is NULL) - previously, it could happen that
when no theme was active or the theme data could not be opened that
the window theme remained became then-dangling (and hence subsequent
calls to GetWindowTheme() would return that bogus theme).
- Correct border rectangle drawing.
- Don't crash if NULL is passed as the class list to OpenThemeData().
- UXTHEME_LoadImage(): Set default image count to 1 to avoid division by
zero in case image count property is not given. Properly support 0
state IDs.
- Every window needs to receive WM_THEMECHANGED (esp. controls), so also
send it to child windows.
- Changed the default transparent color in case none was explicitly
specified from the upper left pixel color to magenta. Empirically
gives better results.
- Write WCHAR strings to registry with correct size.
- Opening some theme class data now also increases the reference count
of the theme file, so as long as theme class data is still opened
somewhere, the theme file won't get freed. Otherwise, it could happen
that invalid class data was used, which could lead to problems.
svn path=/trunk/; revision=17342
2005-08-12 18:22:47 +00:00
|
|
|
struct _THEME_FILE* tf;
|
2005-07-03 18:32:22 +00:00
|
|
|
WCHAR szAppName[MAX_THEME_APP_NAME];
|
|
|
|
WCHAR szClassName[MAX_THEME_CLASS_NAME];
|
|
|
|
PTHEME_PARTSTATE partstate;
|
|
|
|
struct _THEME_CLASS *overrides;
|
|
|
|
|
|
|
|
struct _THEME_CLASS *next;
|
|
|
|
} THEME_CLASS, *PTHEME_CLASS;
|
|
|
|
|
Sync to Wine-20050830:
Kevin Koltzau <kevin@plop.org>
- Fix 'cast to pointer from integer of different size' warnings in
64bit.
Frank Richter <frank.richter@gmail.com>
- Add support for the BT_NONE background type.
- Better computations to have uniformly sized parts scaled in both
directions.
- Implement GetThemeBackgroundExtent().
- Implement DrawThemeEdge().
- Implement support for the ST_TILE background stretching mode.
- Implementation for GetThemePartSize() (not entirely equivalent to
native uxtheme, but sensibly useable).
- Enhance uxtheme to store the themed system metrics in the registry and
also backup the old metrics. That way, themed system colors are set
even uxtheme was not loaded and initialized yet, and when a theme is
deactivated, the colors prior to the activation are restored as well.
- Also, not having to set the system colors in uxtheme startup works
around weird problems where SetSystemColors() ended up being called
from inside window creation and this seemingly led to some creation
message being sent twice.
- Make GetThemeMargins() return default values (0 margin) if the
function does not succeed.
- More elaborate IsThemeBackgroundPartiallyTransparent() implementation;
also returns TRUE for theme parts with 32bpp images.
- Since theme images are reused now it's not really a good idea to
delete them in drawing functions.
- Pass around what kind of transparency an image actually needs. Use
alpha-blending for 32bpp images.
- Set some default values for truesize sizing that seem closer to
Windows.
- If a MINSIZEn property is not present, fall back to actual size of nth
image to determine whether it is suitable.
- EnumThemeColors() and EnumThemeSizes() actually do not return a single
string with the color/size name, but rather a struct containing three
strings - name, display name and tooltip.
- The default image layout is HORIZONTAL, not VERTICAL.
- Take a common computation out of two if-branches in
UXTHEME_LoadImage().
- Compare result of RegQueryValueExW() with ERROR_SUCCESS.
- Another fix to use magenta as the default transparent color.
- Implement "manual" image sharing(as opposed to using LoadImage() with
LR_SHARED) by keeping the loaded images in a list. This is needed for
proper alpha support later on since once-per-image preparations will
be needed then.
- Add support for horizontal & vertical alignment when doing truesize
sizing.
- Whatever TrueSizeStretchMark is for - it's not what Wine uxtheme used
it for. Native uxtheme always stretches "truesize" parts when the
destination is smaller than the part image size, but
TrueSizeStretchMark doesn't seem to have an influence.
svn path=/trunk/; revision=17719
2005-09-07 16:22:51 +00:00
|
|
|
typedef struct _THEME_IMAGE {
|
|
|
|
WCHAR name[MAX_PATH];
|
|
|
|
HBITMAP image;
|
|
|
|
BOOL hasAlpha;
|
|
|
|
|
|
|
|
struct _THEME_IMAGE *next;
|
|
|
|
} THEME_IMAGE, *PTHEME_IMAGE;
|
|
|
|
|
2005-07-03 18:32:22 +00:00
|
|
|
typedef struct _THEME_FILE {
|
|
|
|
DWORD dwRefCount;
|
|
|
|
HMODULE hTheme;
|
|
|
|
WCHAR szThemeFile[MAX_PATH];
|
|
|
|
LPWSTR pszAvailColors;
|
|
|
|
LPWSTR pszAvailSizes;
|
|
|
|
|
|
|
|
LPWSTR pszSelectedColor;
|
|
|
|
LPWSTR pszSelectedSize;
|
|
|
|
|
|
|
|
PTHEME_CLASS classes;
|
|
|
|
PTHEME_PROPERTY metrics;
|
Sync to Wine-20050830:
Kevin Koltzau <kevin@plop.org>
- Fix 'cast to pointer from integer of different size' warnings in
64bit.
Frank Richter <frank.richter@gmail.com>
- Add support for the BT_NONE background type.
- Better computations to have uniformly sized parts scaled in both
directions.
- Implement GetThemeBackgroundExtent().
- Implement DrawThemeEdge().
- Implement support for the ST_TILE background stretching mode.
- Implementation for GetThemePartSize() (not entirely equivalent to
native uxtheme, but sensibly useable).
- Enhance uxtheme to store the themed system metrics in the registry and
also backup the old metrics. That way, themed system colors are set
even uxtheme was not loaded and initialized yet, and when a theme is
deactivated, the colors prior to the activation are restored as well.
- Also, not having to set the system colors in uxtheme startup works
around weird problems where SetSystemColors() ended up being called
from inside window creation and this seemingly led to some creation
message being sent twice.
- Make GetThemeMargins() return default values (0 margin) if the
function does not succeed.
- More elaborate IsThemeBackgroundPartiallyTransparent() implementation;
also returns TRUE for theme parts with 32bpp images.
- Since theme images are reused now it's not really a good idea to
delete them in drawing functions.
- Pass around what kind of transparency an image actually needs. Use
alpha-blending for 32bpp images.
- Set some default values for truesize sizing that seem closer to
Windows.
- If a MINSIZEn property is not present, fall back to actual size of nth
image to determine whether it is suitable.
- EnumThemeColors() and EnumThemeSizes() actually do not return a single
string with the color/size name, but rather a struct containing three
strings - name, display name and tooltip.
- The default image layout is HORIZONTAL, not VERTICAL.
- Take a common computation out of two if-branches in
UXTHEME_LoadImage().
- Compare result of RegQueryValueExW() with ERROR_SUCCESS.
- Another fix to use magenta as the default transparent color.
- Implement "manual" image sharing(as opposed to using LoadImage() with
LR_SHARED) by keeping the loaded images in a list. This is needed for
proper alpha support later on since once-per-image preparations will
be needed then.
- Add support for horizontal & vertical alignment when doing truesize
sizing.
- Whatever TrueSizeStretchMark is for - it's not what Wine uxtheme used
it for. Native uxtheme always stretches "truesize" parts when the
destination is smaller than the part image size, but
TrueSizeStretchMark doesn't seem to have an influence.
svn path=/trunk/; revision=17719
2005-09-07 16:22:51 +00:00
|
|
|
PTHEME_IMAGE images;
|
2005-07-03 18:32:22 +00:00
|
|
|
} THEME_FILE, *PTHEME_FILE;
|
|
|
|
|
2007-04-25 08:22:35 +00:00
|
|
|
typedef struct _UXINI_FILE *PUXINI_FILE;
|
2005-07-03 18:32:22 +00:00
|
|
|
|
2017-05-19 11:02:44 +00:00
|
|
|
typedef struct _UXTHEME_HANDLE
|
|
|
|
{
|
|
|
|
RTL_HANDLE_TABLE_ENTRY Handle;
|
|
|
|
PTHEME_CLASS pClass;
|
|
|
|
} UXTHEME_HANDLE, *PUXTHEME_HANDLE;
|
|
|
|
|
|
|
|
PTHEME_CLASS ValidateHandle(HTHEME hTheme);
|
|
|
|
|
2017-04-26 09:28:35 +00:00
|
|
|
HRESULT UXTHEME_LoadImage(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, BOOL glyph,
|
|
|
|
HBITMAP *hBmp, RECT *bmpRect, BOOL* hasImageAlpha);
|
|
|
|
|
2005-07-03 18:32:22 +00:00
|
|
|
BOOL MSSTYLES_LookupProperty(LPCWSTR pszPropertyName, int *dwPrimitive, int *dwId);
|
|
|
|
BOOL MSSTYLES_LookupEnum(LPCWSTR pszValueName, int dwEnum, int *dwValue);
|
|
|
|
BOOL MSSTYLES_LookupPartState(LPCWSTR pszClass, LPCWSTR pszPart, LPCWSTR pszState, int *iPartId, int *iStateId);
|
2013-04-22 16:46:43 +00:00
|
|
|
|
|
|
|
HRESULT MSSTYLES_OpenThemeFile(LPCWSTR lpThemeFile, LPCWSTR pszColorName, LPCWSTR pszSizeName, PTHEME_FILE *tf);
|
|
|
|
HRESULT MSSTYLES_ReferenceTheme(PTHEME_FILE tf);
|
|
|
|
void MSSTYLES_CloseThemeFile(PTHEME_FILE tf);
|
|
|
|
void MSSTYLES_ParseThemeIni(PTHEME_FILE tf);
|
|
|
|
PTHEME_CLASS MSSTYLES_OpenThemeClass(PTHEME_FILE tf, LPCWSTR pszAppName, LPCWSTR pszClassList);
|
|
|
|
HRESULT MSSTYLES_CloseThemeClass(PTHEME_CLASS tc);
|
2005-07-03 18:32:22 +00:00
|
|
|
PUXINI_FILE MSSTYLES_GetThemeIni(PTHEME_FILE tf);
|
|
|
|
PTHEME_PARTSTATE MSSTYLES_FindPartState(PTHEME_CLASS tc, int iPartId, int iStateId, PTHEME_CLASS *tcNext);
|
|
|
|
PTHEME_PROPERTY MSSTYLES_FindProperty(PTHEME_CLASS tc, int iPartId, int iStateId, int iPropertyPrimitive, int iPropertyId);
|
2013-04-22 16:46:43 +00:00
|
|
|
PTHEME_PROPERTY MSSTYLES_FindMetric(PTHEME_FILE tf, int iPropertyPrimitive, int iPropertyId);
|
Sync to Wine-20050830:
Kevin Koltzau <kevin@plop.org>
- Fix 'cast to pointer from integer of different size' warnings in
64bit.
Frank Richter <frank.richter@gmail.com>
- Add support for the BT_NONE background type.
- Better computations to have uniformly sized parts scaled in both
directions.
- Implement GetThemeBackgroundExtent().
- Implement DrawThemeEdge().
- Implement support for the ST_TILE background stretching mode.
- Implementation for GetThemePartSize() (not entirely equivalent to
native uxtheme, but sensibly useable).
- Enhance uxtheme to store the themed system metrics in the registry and
also backup the old metrics. That way, themed system colors are set
even uxtheme was not loaded and initialized yet, and when a theme is
deactivated, the colors prior to the activation are restored as well.
- Also, not having to set the system colors in uxtheme startup works
around weird problems where SetSystemColors() ended up being called
from inside window creation and this seemingly led to some creation
message being sent twice.
- Make GetThemeMargins() return default values (0 margin) if the
function does not succeed.
- More elaborate IsThemeBackgroundPartiallyTransparent() implementation;
also returns TRUE for theme parts with 32bpp images.
- Since theme images are reused now it's not really a good idea to
delete them in drawing functions.
- Pass around what kind of transparency an image actually needs. Use
alpha-blending for 32bpp images.
- Set some default values for truesize sizing that seem closer to
Windows.
- If a MINSIZEn property is not present, fall back to actual size of nth
image to determine whether it is suitable.
- EnumThemeColors() and EnumThemeSizes() actually do not return a single
string with the color/size name, but rather a struct containing three
strings - name, display name and tooltip.
- The default image layout is HORIZONTAL, not VERTICAL.
- Take a common computation out of two if-branches in
UXTHEME_LoadImage().
- Compare result of RegQueryValueExW() with ERROR_SUCCESS.
- Another fix to use magenta as the default transparent color.
- Implement "manual" image sharing(as opposed to using LoadImage() with
LR_SHARED) by keeping the loaded images in a list. This is needed for
proper alpha support later on since once-per-image preparations will
be needed then.
- Add support for horizontal & vertical alignment when doing truesize
sizing.
- Whatever TrueSizeStretchMark is for - it's not what Wine uxtheme used
it for. Native uxtheme always stretches "truesize" parts when the
destination is smaller than the part image size, but
TrueSizeStretchMark doesn't seem to have an influence.
svn path=/trunk/; revision=17719
2005-09-07 16:22:51 +00:00
|
|
|
HBITMAP MSSTYLES_LoadBitmap(PTHEME_CLASS tc, LPCWSTR lpFilename, BOOL* hasAlpha);
|
2005-07-03 18:32:22 +00:00
|
|
|
|
|
|
|
HRESULT MSSTYLES_GetPropertyBool(PTHEME_PROPERTY tp, BOOL *pfVal);
|
|
|
|
HRESULT MSSTYLES_GetPropertyColor(PTHEME_PROPERTY tp, COLORREF *pColor);
|
|
|
|
HRESULT MSSTYLES_GetPropertyFont(PTHEME_PROPERTY tp, HDC hdc, LOGFONTW *pFont);
|
|
|
|
HRESULT MSSTYLES_GetPropertyInt(PTHEME_PROPERTY tp, int *piVal);
|
|
|
|
HRESULT MSSTYLES_GetPropertyIntList(PTHEME_PROPERTY tp, INTLIST *pIntList);
|
|
|
|
HRESULT MSSTYLES_GetPropertyPosition(PTHEME_PROPERTY tp, POINT *pPoint);
|
|
|
|
HRESULT MSSTYLES_GetPropertyString(PTHEME_PROPERTY tp, LPWSTR pszBuff, int cchMaxBuffChars);
|
|
|
|
HRESULT MSSTYLES_GetPropertyRect(PTHEME_PROPERTY tp, RECT *pRect);
|
|
|
|
HRESULT MSSTYLES_GetPropertyMargins(PTHEME_PROPERTY tp, RECT *prc, MARGINS *pMargins);
|
|
|
|
|
|
|
|
PUXINI_FILE UXINI_LoadINI(HMODULE hTheme, LPCWSTR lpName);
|
|
|
|
void UXINI_CloseINI(PUXINI_FILE uf);
|
|
|
|
LPCWSTR UXINI_GetNextSection(PUXINI_FILE uf, DWORD *dwLen);
|
|
|
|
BOOL UXINI_FindSection(PUXINI_FILE uf, LPCWSTR lpName);
|
|
|
|
LPCWSTR UXINI_GetNextValue(PUXINI_FILE uf, DWORD *dwNameLen, LPCWSTR *lpValue, DWORD *dwValueLen);
|
|
|
|
BOOL UXINI_FindValue(PUXINI_FILE uf, LPCWSTR lpName, LPCWSTR *lpValue, DWORD *dwValueLen);
|
|
|
|
|
2017-02-13 18:45:18 +00:00
|
|
|
/* Scroll-bar hit testing */
|
|
|
|
enum SCROLL_HITTEST
|
|
|
|
{
|
|
|
|
SCROLL_NOWHERE, /* Outside the scroll bar */
|
|
|
|
SCROLL_TOP_ARROW, /* Top or left arrow */
|
|
|
|
SCROLL_TOP_RECT, /* Rectangle between the top arrow and the thumb */
|
|
|
|
SCROLL_THUMB, /* Thumb rectangle */
|
|
|
|
SCROLL_BOTTOM_RECT, /* Rectangle between the thumb and the bottom arrow */
|
|
|
|
SCROLL_BOTTOM_ARROW /* Bottom or right arrow */
|
|
|
|
};
|
2011-09-20 13:08:36 +00:00
|
|
|
|
2014-01-17 17:52:58 +00:00
|
|
|
/* The window context stores data for the window needed through the life of the window */
|
2017-05-19 08:45:49 +00:00
|
|
|
typedef struct _WND_DATA
|
2011-09-20 13:08:36 +00:00
|
|
|
{
|
2017-05-19 10:01:50 +00:00
|
|
|
HTHEME hthemeWindow;
|
|
|
|
HTHEME hthemeScrollbar;
|
|
|
|
|
2017-06-08 14:27:52 +00:00
|
|
|
RECT rcCaptionButtons[4];
|
2014-01-17 17:52:58 +00:00
|
|
|
UINT lastHitTest;
|
2011-09-20 13:08:36 +00:00
|
|
|
BOOL HasAppDefinedRgn;
|
|
|
|
BOOL HasThemeRgn;
|
|
|
|
BOOL UpdatingRgn;
|
2014-01-17 17:52:58 +00:00
|
|
|
BOOL DirtyThemeRegion;
|
2017-04-26 09:28:35 +00:00
|
|
|
HBRUSH hTabBackgroundBrush;
|
|
|
|
HBITMAP hTabBackgroundBmp;
|
2017-02-13 18:45:18 +00:00
|
|
|
|
|
|
|
BOOL SCROLL_trackVertical;
|
|
|
|
enum SCROLL_HITTEST SCROLL_trackHitTest;
|
|
|
|
BOOL SCROLL_MovingThumb; /* Is the moving thumb being displayed? */
|
|
|
|
HWND SCROLL_TrackingWin;
|
|
|
|
INT SCROLL_TrackingBar;
|
|
|
|
INT SCROLL_TrackingPos;
|
|
|
|
INT SCROLL_TrackingVal;
|
2017-05-19 08:45:49 +00:00
|
|
|
} WND_DATA, *PWND_DATA;
|
2011-09-20 13:08:36 +00:00
|
|
|
|
2014-01-17 17:52:58 +00:00
|
|
|
/* The draw context stores data that are needed by the drawing operations in the non client area of the window */
|
2011-09-20 13:08:36 +00:00
|
|
|
typedef struct _DRAW_CONTEXT
|
|
|
|
{
|
|
|
|
HWND hWnd;
|
|
|
|
HDC hDC;
|
|
|
|
HTHEME theme;
|
|
|
|
HTHEME scrolltheme;
|
|
|
|
HTHEME hPrevTheme;
|
|
|
|
WINDOWINFO wi;
|
|
|
|
BOOL Active; /* wi.dwWindowStatus isn't correct for mdi child windows */
|
|
|
|
HRGN hRgn;
|
|
|
|
int CaptionHeight;
|
|
|
|
|
|
|
|
/* for double buffering */
|
|
|
|
HDC hDCScreen;
|
|
|
|
HBITMAP hbmpOld;
|
|
|
|
} DRAW_CONTEXT, *PDRAW_CONTEXT;
|
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
CLOSEBUTTON,
|
|
|
|
MAXBUTTON,
|
|
|
|
MINBUTTON,
|
|
|
|
HELPBUTTON
|
|
|
|
} CAPTIONBUTTON;
|
|
|
|
|
|
|
|
/*
|
2014-10-05 11:02:11 +00:00
|
|
|
The following values specify all possible button states
|
2011-09-20 13:08:36 +00:00
|
|
|
Note that not all of them are documented but it is easy to
|
|
|
|
find them by opening a theme file
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
BUTTON_NORMAL = 1 ,
|
|
|
|
BUTTON_HOT ,
|
|
|
|
BUTTON_PRESSED ,
|
|
|
|
BUTTON_DISABLED ,
|
|
|
|
BUTTON_INACTIVE
|
|
|
|
} THEME_BUTTON_STATES;
|
|
|
|
|
2014-01-17 17:52:58 +00:00
|
|
|
#define HT_ISBUTTON(ht) ((ht) == HTMINBUTTON || (ht) == HTMAXBUTTON || (ht) == HTCLOSE || (ht) == HTHELP)
|
|
|
|
|
2011-09-20 13:08:36 +00:00
|
|
|
#define HASSIZEGRIP(Style, ExStyle, ParentStyle, WindowRect, ParentClientRect) \
|
|
|
|
((!(Style & WS_CHILD) && (Style & WS_THICKFRAME) && !(Style & WS_MAXIMIZE)) || \
|
|
|
|
((Style & WS_CHILD) && (ParentStyle & WS_THICKFRAME) && !(ParentStyle & WS_MAXIMIZE) && \
|
|
|
|
(WindowRect.right - WindowRect.left == ParentClientRect.right) && \
|
|
|
|
(WindowRect.bottom - WindowRect.top == ParentClientRect.bottom)))
|
|
|
|
|
|
|
|
#define HAS_MENU(hwnd,style) ((((style) & (WS_CHILD | WS_POPUP)) != WS_CHILD) && GetMenu(hwnd))
|
|
|
|
|
|
|
|
#define BUTTON_GAP_SIZE 2
|
|
|
|
|
|
|
|
#define MENU_BAR_ITEMS_SPACE (12)
|
|
|
|
|
|
|
|
#define SCROLL_TIMER 0 /* Scroll timer id */
|
|
|
|
|
|
|
|
/* Overlap between arrows and thumb */
|
|
|
|
#define SCROLL_ARROW_THUMB_OVERLAP 0
|
|
|
|
|
|
|
|
/* Delay (in ms) before first repetition when holding the button down */
|
|
|
|
#define SCROLL_FIRST_DELAY 200
|
|
|
|
|
|
|
|
/* Delay (in ms) between scroll repetitions */
|
|
|
|
#define SCROLL_REPEAT_DELAY 50
|
|
|
|
|
|
|
|
/* Minimum size of the thumb in pixels */
|
|
|
|
#define SCROLL_MIN_THUMB 6
|
|
|
|
|
|
|
|
/* Minimum size of the rectangle between the arrows */
|
|
|
|
#define SCROLL_MIN_RECT 4
|
|
|
|
|
2013-05-28 19:19:29 +00:00
|
|
|
LRESULT CALLBACK ThemeWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, WNDPROC DefWndProc);
|
2017-06-08 14:27:52 +00:00
|
|
|
void ThemeCalculateCaptionButtonsPos(HWND hWnd, HTHEME htheme);
|
2011-09-20 13:08:36 +00:00
|
|
|
void ThemeDrawScrollBar(PDRAW_CONTEXT pcontext, INT Bar, POINT* pt);
|
|
|
|
VOID NC_TrackScrollBar(HWND Wnd, WPARAM wParam, POINT Pt);
|
|
|
|
void ThemeInitDrawContext(PDRAW_CONTEXT pcontext, HWND hWnd, HRGN hRgn);
|
|
|
|
void ThemeCleanupDrawContext(PDRAW_CONTEXT pcontext);
|
2017-05-19 08:45:49 +00:00
|
|
|
PWND_DATA ThemeGetWndData(HWND hWnd);
|
2017-05-19 10:01:50 +00:00
|
|
|
HTHEME GetNCCaptionTheme(HWND hWnd, DWORD style);
|
|
|
|
HTHEME GetNCScrollbarTheme(HWND hWnd, DWORD style);
|
2011-09-20 13:08:36 +00:00
|
|
|
|
2013-05-28 19:19:29 +00:00
|
|
|
extern HINSTANCE hDllInst;
|
2011-09-20 13:08:36 +00:00
|
|
|
extern ATOM atWindowTheme;
|
2014-09-21 17:54:33 +00:00
|
|
|
extern ATOM atWndContext;
|
2017-06-07 08:28:14 +00:00
|
|
|
extern BOOL g_bThemeHooksActive;
|
2011-09-20 13:08:36 +00:00
|
|
|
|
|
|
|
void UXTHEME_InitSystem(HINSTANCE hInst);
|
|
|
|
void UXTHEME_LoadTheme(BOOL bLoad);
|
|
|
|
BOOL CALLBACK UXTHEME_broadcast_msg (HWND hWnd, LPARAM msg);
|
|
|
|
|
|
|
|
/* No alpha blending */
|
|
|
|
#define ALPHABLEND_NONE 0
|
|
|
|
/* "Cheap" binary alpha blending - but possibly faster */
|
|
|
|
#define ALPHABLEND_BINARY 1
|
|
|
|
/* Full alpha blending */
|
|
|
|
#define ALPHABLEND_FULL 2
|
2014-02-07 18:02:02 +00:00
|
|
|
|
|
|
|
#endif /* _UXTHEME_PCH_ */
|