5#ifndef QQUICKWINDOWSXPSTYLE_P_P_H
6#define QQUICKWINDOWSXPSTYLE_P_P_H
22#include <QtCore/qmap.h>
23#include <qt_windows.h>
37#if TMT_TEXTSHADOWCOLOR != 3818
38#undef TMT_TEXTSHADOWCOLOR
39#define TMT_TEXTSHADOWCOLOR 3818
48#define MINBS_INACTIVE 5
51#define MAXBS_INACTIVE 5
71 int part = 0,
int state = 0,
const QRect &r = QRect())
86 static QSizeF themeSize(
const QWindow *w =
nullptr,
QPainter *p =
nullptr,
int themeIn = -1,
int part = 0,
int state = 0);
152#ifndef QT_NO_DEBUG_STREAM
160 Q_DECLARE_PUBLIC(QWindowsXPStyle)
194 static HWND winId(
const QWindow *window);
196 void init(
bool force =
false);
197 void cleanup(
bool force =
false);
204 static bool useXP(
bool update =
false);
225 static inline bool hasTheme(
int theme) {
return theme >= 0 && theme < NThemes && m_themes[theme]; }
237 static bool initVistaTreeViewTheming();
238 static void cleanupVistaTreeViewTheming();
240 static QBasicAtomicInt ref;
243 QHash<ThemeMapKey, ThemeMapData> alphaCache;
244 HDC bufferDC =
nullptr;
245 HBITMAP bufferBitmap =
nullptr;
246 HBITMAP nullBitmap =
nullptr;
247 uchar *bufferPixels =
nullptr;
251 static HWND m_vistaTreeViewHelper;
252 static HTHEME m_themes[
NThemes];
260 if (SUCCEEDED(GetThemePartSize(handle(),
nullptr, partId, stateId,
nullptr, TS_TRUE, &size)))
261 result = QSize(size.cx, size.cy);
268 QMarginsF result(0, 0, 0 ,0);
271 RECT rect = XPThemeData::toRECT(qRect);
272 if (SUCCEEDED(GetThemeMargins(handle(),
nullptr, partId, stateId, propId, &rect, &margins)))
273 result = QMargins(margins.cxLeftWidth, margins.cyTopHeight, margins.cxRightWidth, margins.cyBottomHeight);
280 QMarginsF result(0, 0, 0 ,0);
283 if (SUCCEEDED(GetThemeMargins(handle(),
nullptr, partId, stateId, propId,
nullptr, &margins)))
284 result = QMargins(margins.cxLeftWidth, margins.cyTopHeight, margins.cxRightWidth, margins.cyBottomHeight);
296 int part,
int state,
int propId)
299 return theme.margins(rect, propId);
303 int part,
int state,
int propId)
306 return theme.margins(propId);
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
TickPosition tickPosition
QStyleOption & operator=(const QStyleOption &other)
Assign other to this QStyleOption.
static int sliderPositionFromValue(int min, int max, int val, int space, bool upsideDown=false)
Converts the given logicalValue to a pixel position.
The QWindowsStyle class provides a Microsoft Windows-like look and feel.
bool fixAlphaChannel(const QRect &rect)
bool drawBackground(XPThemeData &themeData, qreal correctionFactor=1)
bool drawBackgroundDirectly(HDC dc, XPThemeData &themeData, qreal aditionalDevicePixelRatio)
static bool hasTheme(int theme)
bool hasAlphaChannel(const QRect &rect)
void init(bool force=false)
static HWND winId(const QWindow *window)
QRegion region(XPThemeData &themeData)
static QRect scrollBarGripperBounds(QStyle::State flags, XPThemeData *theme)
HBITMAP buffer(int w=0, int h=0)
static QString themeName(int theme)
static bool isItemViewDelegateLineEdit(const QWidget *widget)
bool drawBackgroundThruNativeBuffer(XPThemeData &themeData, qreal aditionalDevicePixelRatio, qreal correctionFactor)
static int fixedPixelMetric(QStyle::PixelMetric pm, const QStyleOption *option=nullptr, const QWidget *widget=nullptr)
bool isTransparent(XPThemeData &themeData)
static bool useXP(bool update=false)
void cleanup(bool force=false)
~QWindowsXPStylePrivate()
bool swapAlphaChannel(const QRect &rect, bool allPixels=false)
QRgb groupBoxTextColorDisabled
static int pixelMetricFromSystemDp(QStyle::PixelMetric pm, const QStyleOption *option=nullptr)
static bool isLineEditBaseColorSet(const QStyleOption *option, const QWidget *widget)
static HTHEME createTheme(int theme, HWND hwnd)
The QWindowsXPStyle class provides a Microsoft Windows XP-like look and feel.
QPixmap standardPixmap(StandardPixmap standardIcon, const QStyleOption *option) const override
\reimp
void drawPrimitive(PrimitiveElement pe, const QStyleOption *option, QPainter *p) const override
\reimp
QRect subElementRect(SubElement r, const QStyleOption *option) const override
\reimp
QMargins ninePatchMargins(QStyle::ComplexControl cc, const QStyleOptionComplex *opt, const QSize &imageSize) const override
QWindowsXPStyle(QWindowsXPStylePrivate &dd)
int styleHint(StyleHint hint, const QStyleOption *option=nullptr, QStyleHintReturn *returnData=nullptr) const override
\reimp
~QWindowsXPStyle() override
Destroys the style.
QSize sizeFromContents(ContentsType ct, const QStyleOption *option, const QSize &contentsSize) const override
\reimp
QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *option=nullptr) const override
\reimp
void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *option, QPainter *p) const override
\reimp
void drawControl(ControlElement element, const QStyleOption *option, QPainter *p) const override
\reimp
int pixelMetric(PixelMetric pm, const QStyleOption *option=nullptr) const override
\reimp
QPalette standardPalette() const override
\reimp
QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *option, SubControl sc) const override
\reimp
QMarginsF margins(const QRect &rect, int propId=TMT_CONTENTMARGINS)
static RECT toRECT(const QRect &qr)
static QSizeF themeSize(const QWindow *w=nullptr, QPainter *p=nullptr, int themeIn=-1, int part=0, int state=0)
static QMarginsF themeMargins(const QRect &rect, const QWindow *w=nullptr, QPainter *p=nullptr, int themeIn=-1, int part=0, int state=0, int propId=TMT_CONTENTMARGINS)
QMarginsF margins(int propId=TMT_CONTENTMARGINS)
static QMarginsF themeMargins(const QWindow *w=nullptr, QPainter *p=nullptr, int themeIn=-1, int part=0, int state=0, int propId=TMT_CONTENTMARGINS)
XPThemeData(const QWindow *w=nullptr, QPainter *p=nullptr, int themeIn=-1, int part=0, int state=0, const QRect &r=QRect())
static const int windowsItemHMargin
static void populateTitleBarButtonTheme(const QStyle *proxy, const QStyleOptionComplex *option, QStyle::SubControl subControl, bool isTitleBarActive, int part, XPThemeData *theme)
static HRGN qt_hrgn_from_qregion(const QRegion ®ion)
static const int windowsArrowHMargin
static HWND createTreeViewHelperWindow()
static QRegion scaleRegion(const QRegion ®ion, qreal factor)
static const int windowsRightBorder
static void qt_add_rect(HRGN &winRegion, QRect r)
static Qt::Orientation progressBarOrientation(const QStyleOption *option=nullptr)
static const int windowsItemFrame
static const int windowsItemVMargin
static const wchar_t * themeNames[QWindowsXPStylePrivate::NThemes]
static bool buttonVisible(const QStyle::SubControl sc, const QStyleOptionTitleBar *tb)
size_t qHash(const ThemeMapKey &key)
static QRectF scaleRect(const QRectF &r, qreal factor)
bool operator==(const ThemeMapKey &k1, const ThemeMapKey &k2)
#define TMT_TEXTSHADOWCOLOR
AlphaChannelType alphaType
ThemeMapKey(const XPThemeData &data)