diff options
| author | 2007-01-04 19:20:43 +0000 | |
|---|---|---|
| committer | 2007-01-04 19:20:43 +0000 | |
| commit | 0ca19b4e7e17d2fd72d6134358d1bfa2f42fe8e9 (patch) | |
| tree | c9460ad9faa5d0f2e654d17a4df3f8533017b9db | |
| parent | *AUTOMATICALLY* updated KVI_SOURCES_DATE variable (diff) | |
| download | KVIrc-0ca19b4e7e17d2fd72d6134358d1bfa2f42fe8e9.tar.gz KVIrc-0ca19b4e7e17d2fd72d6134358d1bfa2f42fe8e9.tar.bz2 KVIrc-0ca19b4e7e17d2fd72d6134358d1bfa2f42fe8e9.zip | |
removed unused files
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@92 17fca916-40b9-46aa-a4ea-0a15b648b75c
| -rwxr-xr-x | xpstyle/Uxtheme.lib | bin | 82 -> 0 bytes | |||
| -rwxr-xr-x | xpstyle/schemadef.h | 93 | ||||
| -rwxr-xr-x | xpstyle/tmschema.h | 1221 | ||||
| -rwxr-xr-x | xpstyle/uxtheme.h | 884 | ||||
| -rw-r--r-- | xpstyle/xpstyle.cpp | 1753 | ||||
| -rw-r--r-- | xpstyle/xpstyle.dsp | 153 | ||||
| -rw-r--r-- | xpstyle/xpstyle.h | 105 | ||||
| -rw-r--r-- | xpstyle/xpstyle.rc | 97 |
8 files changed, 0 insertions, 4306 deletions
diff --git a/xpstyle/Uxtheme.lib b/xpstyle/Uxtheme.lib Binary files differdeleted file mode 100755 index 6955dd3a0..000000000 --- a/xpstyle/Uxtheme.lib +++ /dev/null diff --git a/xpstyle/schemadef.h b/xpstyle/schemadef.h deleted file mode 100755 index 46fe1836f..000000000 --- a/xpstyle/schemadef.h +++ /dev/null @@ -1,93 +0,0 @@ -//----------------------------------------------------------------- -// SchemaDef.h - defines needed to build a Theme Manager schema -// file -//----------------------------------------------------------------- -#ifndef SCHEMA_STRINGS // FIRST PASS of this hdr file -//----------------------------------------------------------------- -#ifndef SCHEMADEF_H -#define SCHEMADEF_H -//----------------------------------------------------------------- -#define SCHEMADEF_VERSION 1 // defines the exported func(s) implemented -//----------------------------------------------------------------- -struct TMPROPINFO -{ - LPCWSTR pszName; - SHORT sEnumVal; - BYTE bPrimVal; -}; -//----------------------------------------------------------------- -struct TMSCHEMAINFO -{ - DWORD dwSize; // size of this struct - int iSchemaDefVersion; // version number from this file - int iThemeMgrVersion; // version number from "thschema.h" - int iPropCount; // # of entries in prop table - const struct TMPROPINFO *pPropTable; // ptr to prop table -}; -//--------------------------------------------------------------------------- -#define BEGIN_TM_SCHEMA(name) -#define BEGIN_TM_PROPS() enum PropValues { DummyProp = 49, -#define BEGIN_TM_ENUM(name) enum name { -#define BEGIN_TM_CLASS_PARTS(name) enum name##PARTS { name##PartFiller0, -#define BEGIN_TM_PART_STATES(name) enum name##STATES { name##StateFiller0, - -#define TM_PROP(val, prefix, name, primval) prefix##_##name = val, -#define TM_ENUM(val, prefix, name) prefix##_##name = val, -#define TM_PART(val, prefix, name) prefix##_##name = val, -#define TM_STATE(val, prefix, name) prefix##_##name = val, - -#define END_TM_CLASS_PARTS() }; -#define END_TM_PART_STATES() }; -#define END_TM_PROPS() }; -#define END_TM_ENUM() }; -#define END_TM_SCHEMA(name) -//--------------------------------------------------------------------------- -#endif // SCHEMADEF_H -//--------------------------------------------------------------------------- -#else // SECOND PASS of this hdr file -//--------------------------------------------------------------------------- -#undef BEGIN_TM_SCHEMA -#undef BEGIN_TM_PROPS -#undef BEGIN_TM_ENUM -#undef BEGIN_TM_CLASS_PARTS -#undef BEGIN_TM_PART_STATES -#undef TM_PROP -#undef TM_PART -#undef TM_STATE -#undef TM_ENUM -#undef END_TM_CLASS_PARTS -#undef END_TM_PART_STATES -#undef END_TM_PROPS -#undef END_TM_ENUM -#undef END_TM_SCHEMA -//--------------------------------------------------------------------------- -#define BEGIN_TM_SCHEMA(name) static const TMPROPINFO name[] = { -#define BEGIN_TM_PROPS() -#define BEGIN_TM_ENUM(name) {L#name, TMT_ENUMDEF, TMT_ENUMDEF}, -#define BEGIN_TM_CLASS_PARTS(name) {L#name L"PARTS", TMT_ENUMDEF, TMT_ENUMDEF}, -#define BEGIN_TM_PART_STATES(name) {L#name L"STATES", TMT_ENUMDEF, TMT_ENUMDEF}, - -#define TM_PROP(val, prefix, name, primval) {L#name, prefix##_##name, TMT_##primval}, -#define TM_PART(val, prefix, name) {L#name, prefix##_##name, TMT_ENUMVAL}, -#define TM_STATE(val, prefix, name) {L#name, prefix##_##name, TMT_ENUMVAL}, -#define TM_ENUM(val, prefix, name) {L#name, prefix##_##name, TMT_ENUMVAL}, - -#define END_TM_CLASS_PARTS() -#define END_TM_PART_STATES() -#define END_TM_PROPS() -#define END_TM_ENUM() -#define END_TM_SCHEMA(name) }; \ - static const TMSCHEMAINFO *GetSchemaInfo() \ - { \ - static TMSCHEMAINFO si = {sizeof(si)}; \ - si.iSchemaDefVersion = SCHEMADEF_VERSION; \ - si.iThemeMgrVersion = THEMEMGR_VERSION; \ - si.iPropCount = sizeof(name)/sizeof(name[0]); \ - si.pPropTable = name; \ - \ - return &si; \ - } - -//----------------------------------------------------------------- -#endif -//----------------------------------------------------------------- diff --git a/xpstyle/tmschema.h b/xpstyle/tmschema.h deleted file mode 100755 index f70cd7dd5..000000000 --- a/xpstyle/tmschema.h +++ /dev/null @@ -1,1221 +0,0 @@ -//----------------------------------------------------------------- -// TmSchema.h - Theme Manager schema (properties, parts, etc) -//----------------------------------------------------------------- -// Note: this file is normally #include-ed twice a single .cpp -// file. The 2nd time, SCHEME_STRINGS should be defined. -// This allows the enums and strings to be kept in a -// single logical table and ensure they stay in sync with -// each other. -//----------------------------------------------------------------- -#if (defined(SCHEMA_STRINGS)) || (! defined(TMSCHEMA_H)) -//----------------------------------------------------------------- -#define TMSCHEMA_H -//----------------------------------------------------------------- -#include "SchemaDef.h" -//----------------------------------------------------------------- -#define THEMEMGR_VERSION 1 // increment if order of props changes or -// any props are deleted (will prevent loading -// of controlsets that use older version -//----------------------------------------------------------------- -BEGIN_TM_SCHEMA(ThemeMgrSchema) - -//----------------------------------------------------------------- -// TM_ENUM (must also be declared in PROPERTIES section) -// -// these cannot be renumbered (part of uxtheme API) -//----------------------------------------------------------------- -BEGIN_TM_ENUM(BGTYPE) -TM_ENUM(0, BT, IMAGEFILE) -TM_ENUM(1, BT, BORDERFILL) -TM_ENUM(2, BT, NONE) -END_TM_ENUM() - -BEGIN_TM_ENUM(IMAGELAYOUT) -TM_ENUM(0, IL, VERTICAL) -TM_ENUM(1, IL, HORIZONTAL) -END_TM_ENUM() - -BEGIN_TM_ENUM(BORDERTYPE) -TM_ENUM(0, BT, RECT) -TM_ENUM(1, BT, ROUNDRECT) -TM_ENUM(2, BT, ELLIPSE) -END_TM_ENUM() - -BEGIN_TM_ENUM(FILLTYPE) -TM_ENUM(0, FT, SOLID) -TM_ENUM(1, FT, VERTGRADIENT) -TM_ENUM(2, FT, HORZGRADIENT) -TM_ENUM(3, FT, RADIALGRADIENT) -TM_ENUM(4, FT, TILEIMAGE) -END_TM_ENUM() - -BEGIN_TM_ENUM(SIZINGTYPE) -TM_ENUM(0, ST, TRUESIZE) -TM_ENUM(1, ST, STRETCH) -TM_ENUM(2, ST, TILE) -END_TM_ENUM() - -BEGIN_TM_ENUM(HALIGN) -TM_ENUM(0, HA, LEFT) -TM_ENUM(1, HA, CENTER) -TM_ENUM(2, HA, RIGHT) -END_TM_ENUM() - -BEGIN_TM_ENUM(CONTENTALIGNMENT) -TM_ENUM(0, CA, LEFT) -TM_ENUM(1, CA, CENTER) -TM_ENUM(2, CA, RIGHT) -END_TM_ENUM() - -BEGIN_TM_ENUM(VALIGN) -TM_ENUM(0, VA, TOP) -TM_ENUM(1, VA, CENTER) -TM_ENUM(2, VA, BOTTOM) -END_TM_ENUM() - -BEGIN_TM_ENUM(OFFSETTYPE) -TM_ENUM(0, OT, TOPLEFT) -TM_ENUM(1, OT, TOPRIGHT) -TM_ENUM(2, OT, TOPMIDDLE) -TM_ENUM(3, OT, BOTTOMLEFT) -TM_ENUM(4, OT, BOTTOMRIGHT) -TM_ENUM(5, OT, BOTTOMMIDDLE) -TM_ENUM(6, OT, MIDDLELEFT) -TM_ENUM(7, OT, MIDDLERIGHT) -TM_ENUM(8, OT, LEFTOFCAPTION) -TM_ENUM(9, OT, RIGHTOFCAPTION) -TM_ENUM(10, OT, LEFTOFLASTBUTTON) -TM_ENUM(11, OT, RIGHTOFLASTBUTTON) -TM_ENUM(12, OT, ABOVELASTBUTTON) -TM_ENUM(13, OT, BELOWLASTBUTTON) -END_TM_ENUM() - -BEGIN_TM_ENUM(ICONEFFECT) -TM_ENUM(0, ICE, NONE) -TM_ENUM(1, ICE, GLOW) -TM_ENUM(2, ICE, SHADOW) -TM_ENUM(3, ICE, PULSE) -TM_ENUM(4, ICE, ALPHA) -END_TM_ENUM() - -BEGIN_TM_ENUM(TEXTSHADOWTYPE) -TM_ENUM(0, TST, NONE) -TM_ENUM(1, TST, SINGLE) -TM_ENUM(2, TST, CONTINUOUS) -END_TM_ENUM() - -BEGIN_TM_ENUM(GLYPHTYPE) -TM_ENUM(0, GT, NONE) -TM_ENUM(1, GT, IMAGEGLYPH) -TM_ENUM(2, GT, FONTGLYPH) -END_TM_ENUM() - -BEGIN_TM_ENUM(IMAGESELECTTYPE) -TM_ENUM(0, IST, NONE) -TM_ENUM(1, IST, SIZE) -TM_ENUM(2, IST, DPI) -END_TM_ENUM() - -BEGIN_TM_ENUM(TRUESIZESCALINGTYPE) -TM_ENUM(0, TSST, NONE) -TM_ENUM(1, TSST, SIZE) -TM_ENUM(2, TSST, DPI) -END_TM_ENUM() - -BEGIN_TM_ENUM(GLYPHFONTSIZINGTYPE) -TM_ENUM(0, GFST, NONE) -TM_ENUM(1, GFST, SIZE) -TM_ENUM(2, GFST, DPI) -END_TM_ENUM() - -//----------------------------------------------------------------- -// PROPERTIES - used by uxtheme rendering and controls -// -// these cannot be renumbered (part of uxtheme API) -//----------------------------------------------------------------- -BEGIN_TM_PROPS() - -//---- primitive types ---- -TM_PROP(201, TMT, STRING, STRING) -TM_PROP(202, TMT, INT, INT) -TM_PROP(203, TMT, BOOL, BOOL) -TM_PROP(204, TMT, COLOR, COLOR) -TM_PROP(205, TMT, MARGINS, MARGINS) -TM_PROP(206, TMT, FILENAME, FILENAME) -TM_PROP(207, TMT, SIZE, SIZE) -TM_PROP(208, TMT, POSITION, POSITION) -TM_PROP(209, TMT, RECT, RECT) -TM_PROP(210, TMT, FONT, FONT) -TM_PROP(211, TMT, INTLIST, INTLIST) - -//---- special misc. properties ---- -TM_PROP(401, TMT, COLORSCHEMES, STRING) -TM_PROP(402, TMT, SIZES, STRING) -TM_PROP(403, TMT, CHARSET, INT) - -//---- [documentation] properties ---- - -#define TMT_FIRST_RCSTRING_NAME TMT_DISPLAYNAME -#define TMT_LAST_RCSTRING_NAME TMT_DESCRIPTION - -TM_PROP(601, TMT, DISPLAYNAME, STRING) -TM_PROP(602, TMT, TOOLTIP, STRING) -TM_PROP(603, TMT, COMPANY, STRING) -TM_PROP(604, TMT, AUTHOR, STRING) -TM_PROP(605, TMT, COPYRIGHT, STRING) -TM_PROP(606, TMT, URL, STRING) -TM_PROP(607, TMT, VERSION, STRING) -TM_PROP(608, TMT, DESCRIPTION, STRING) - -//---- theme metrics: fonts ---- - -#define TMT_FIRSTFONT TMT_CAPTIONFONT -#define TMT_LASTFONT TMT_ICONTITLEFONT - -TM_PROP(801, TMT, CAPTIONFONT, FONT) -TM_PROP(802, TMT, SMALLCAPTIONFONT, FONT) -TM_PROP(803, TMT, MENUFONT, FONT) -TM_PROP(804, TMT, STATUSFONT, FONT) -TM_PROP(805, TMT, MSGBOXFONT, FONT) -TM_PROP(806, TMT, ICONTITLEFONT, FONT) - -//---- theme metrics: bools ---- - -#define TMT_FIRSTBOOL TMT_FLATMENUS -#define TMT_LASTBOOL TMT_FLATMENUS - -TM_PROP(1001, TMT, FLATMENUS, BOOL) - -//---- theme metrics: sizes ---- - -#define TMT_FIRSTSIZE TMT_SIZINGBORDERWIDTH -#define TMT_LASTSIZE TMT_MENUBARHEIGHT - -TM_PROP(1201, TMT, SIZINGBORDERWIDTH, SIZE) -TM_PROP(1202, TMT, SCROLLBARWIDTH, SIZE) -TM_PROP(1203, TMT, SCROLLBARHEIGHT, SIZE) -TM_PROP(1204, TMT, CAPTIONBARWIDTH, SIZE) -TM_PROP(1205, TMT, CAPTIONBARHEIGHT, SIZE) -TM_PROP(1206, TMT, SMCAPTIONBARWIDTH, SIZE) -TM_PROP(1207, TMT, SMCAPTIONBARHEIGHT, SIZE) -TM_PROP(1208, TMT, MENUBARWIDTH, SIZE) -TM_PROP(1209, TMT, MENUBARHEIGHT, SIZE) - -//---- theme metrics: ints ---- - -#define TMT_FIRSTINT TMT_MINCOLORDEPTH -#define TMT_LASTINT TMT_MINCOLORDEPTH - -TM_PROP(1301, TMT, MINCOLORDEPTH, INT) - -//---- theme metrics: strings ---- - -#define TMT_FIRSTSTRING TMT_CSSNAME -#define TMT_LASTSTRING TMT_XMLNAME - -TM_PROP(1401, TMT, CSSNAME, STRING) -TM_PROP(1402, TMT, XMLNAME, STRING) - -//---- theme metrics: colors ---- - -#define TMT_FIRSTCOLOR TMT_SCROLLBAR -#define TMT_LASTCOLOR TMT_MENUBAR - -TM_PROP(1601, TMT, SCROLLBAR, COLOR) -TM_PROP(1602, TMT, BACKGROUND, COLOR) -TM_PROP(1603, TMT, ACTIVECAPTION, COLOR) -TM_PROP(1604, TMT, INACTIVECAPTION, COLOR) -TM_PROP(1605, TMT, MENU, COLOR) -TM_PROP(1606, TMT, WINDOW, COLOR) -TM_PROP(1607, TMT, WINDOWFRAME, COLOR) -TM_PROP(1608, TMT, MENUTEXT, COLOR) -TM_PROP(1609, TMT, WINDOWTEXT, COLOR) -TM_PROP(1610, TMT, CAPTIONTEXT, COLOR) -TM_PROP(1611, TMT, ACTIVEBORDER, COLOR) -TM_PROP(1612, TMT, INACTIVEBORDER, COLOR) -TM_PROP(1613, TMT, APPWORKSPACE, COLOR) -TM_PROP(1614, TMT, HIGHLIGHT, COLOR) -TM_PROP(1615, TMT, HIGHLIGHTTEXT, COLOR) -TM_PROP(1616, TMT, BTNFACE, COLOR) -TM_PROP(1617, TMT, BTNSHADOW, COLOR) -TM_PROP(1618, TMT, GRAYTEXT, COLOR) -TM_PROP(1619, TMT, BTNTEXT, COLOR) -TM_PROP(1620, TMT, INACTIVECAPTIONTEXT, COLOR) -TM_PROP(1621, TMT, BTNHIGHLIGHT, COLOR) -TM_PROP(1622, TMT, DKSHADOW3D, COLOR) -TM_PROP(1623, TMT, LIGHT3D, COLOR) -TM_PROP(1624, TMT, INFOTEXT, COLOR) -TM_PROP(1625, TMT, INFOBK, COLOR) -TM_PROP(1626, TMT, BUTTONALTERNATEFACE, COLOR) -TM_PROP(1627, TMT, HOTTRACKING, COLOR) -TM_PROP(1628, TMT, GRADIENTACTIVECAPTION, COLOR) -TM_PROP(1629, TMT, GRADIENTINACTIVECAPTION, COLOR) -TM_PROP(1630, TMT, MENUHILIGHT, COLOR) -TM_PROP(1631, TMT, MENUBAR, COLOR) - -//---- hue substitutions ---- -TM_PROP(1801, TMT, FROMHUE1, INT) -TM_PROP(1802, TMT, FROMHUE2, INT) -TM_PROP(1803, TMT, FROMHUE3, INT) -TM_PROP(1804, TMT, FROMHUE4, INT) -TM_PROP(1805, TMT, FROMHUE5, INT) -TM_PROP(1806, TMT, TOHUE1, INT) -TM_PROP(1807, TMT, TOHUE2, INT) -TM_PROP(1808, TMT, TOHUE3, INT) -TM_PROP(1809, TMT, TOHUE4, INT) -TM_PROP(1810, TMT, TOHUE5, INT) - -//---- color substitutions ---- -TM_PROP(2001, TMT, FROMCOLOR1, COLOR) -TM_PROP(2002, TMT, FROMCOLOR2, COLOR) -TM_PROP(2003, TMT, FROMCOLOR3, COLOR) -TM_PROP(2004, TMT, FROMCOLOR4, COLOR) -TM_PROP(2005, TMT, FROMCOLOR5, COLOR) -TM_PROP(2006, TMT, TOCOLOR1, COLOR) -TM_PROP(2007, TMT, TOCOLOR2, COLOR) -TM_PROP(2008, TMT, TOCOLOR3, COLOR) -TM_PROP(2009, TMT, TOCOLOR4, COLOR) -TM_PROP(2010, TMT, TOCOLOR5, COLOR) - -//---- rendering BOOL properties ---- -TM_PROP(2201, TMT, TRANSPARENT, BOOL) // image has transparent areas (see TransparentColor) -TM_PROP(2202, TMT, AUTOSIZE, BOOL) // if TRUE, nonclient caption width varies with text extent -TM_PROP(2203, TMT, BORDERONLY, BOOL) // only draw the border area of the image -TM_PROP(2204, TMT, COMPOSITED, BOOL) // control will handle the composite drawing -TM_PROP(2205, TMT, BGFILL, BOOL) // if TRUE, TRUESIZE images should be drawn on bg fill -TM_PROP(2206, TMT, GLYPHTRANSPARENT, BOOL) // glyph has transparent areas (see GlyphTransparentColor) -TM_PROP(2207, TMT, GLYPHONLY, BOOL) // only draw glyph (not background) -TM_PROP(2208, TMT, ALWAYSSHOWSIZINGBAR, BOOL) -TM_PROP(2209, TMT, MIRRORIMAGE, BOOL) // default=TRUE means image gets mirrored in RTL (Mirror) windows -TM_PROP(2210, TMT, UNIFORMSIZING, BOOL) // if TRUE, height & width must be uniformly sized -TM_PROP(2211, TMT, INTEGRALSIZING, BOOL) // for TRUESIZE and Border sizing; if TRUE, factor must be integer -TM_PROP(2212, TMT, SOURCEGROW, BOOL) // if TRUE, will scale up src image when needed -TM_PROP(2213, TMT, SOURCESHRINK, BOOL) // if TRUE, will scale down src image when needed - -//---- rendering INT properties ---- -TM_PROP(2401, TMT, IMAGECOUNT, INT) // the number of state images in an imagefile -TM_PROP(2402, TMT, ALPHALEVEL, INT) // (0-255) alpha value for an icon (DrawThemeIcon part) -TM_PROP(2403, TMT, BORDERSIZE, INT) // the size of the border line for bgtype=BorderFill -TM_PROP(2404, TMT, ROUNDCORNERWIDTH, INT) // (0-100) % of roundness for rounded rects -TM_PROP(2405, TMT, ROUNDCORNERHEIGHT, INT) // (0-100) % of roundness for rounded rects -TM_PROP(2406, TMT, GRADIENTRATIO1, INT) // (0-255) - amt of gradient color 1 to use (all must total=255) -TM_PROP(2407, TMT, GRADIENTRATIO2, INT) // (0-255) - amt of gradient color 2 to use (all must total=255) -TM_PROP(2408, TMT, GRADIENTRATIO3, INT) // (0-255) - amt of gradient color 3 to use (all must total=255) -TM_PROP(2409, TMT, GRADIENTRATIO4, INT) // (0-255) - amt of gradient color 4 to use (all must total=255) -TM_PROP(2410, TMT, GRADIENTRATIO5, INT) // (0-255) - amt of gradient color 5 to use (all must total=255) -TM_PROP(2411, TMT, PROGRESSCHUNKSIZE, INT) // size of progress control chunks -TM_PROP(2412, TMT, PROGRESSSPACESIZE, INT) // size of progress control spaces -TM_PROP(2413, TMT, SATURATION, INT) // (0-255) amt of saturation for DrawThemeIcon() part -TM_PROP(2414, TMT, TEXTBORDERSIZE, INT) // size of border around text chars -TM_PROP(2415, TMT, ALPHATHRESHOLD, INT) // (0-255) the min. alpha value of a pixel that is solid -TM_PROP(2416, TMT, WIDTH, SIZE) // custom window prop: size of part (min. window) -TM_PROP(2417, TMT, HEIGHT, SIZE) // custom window prop: size of part (min. window) -TM_PROP(2418, TMT, GLYPHINDEX, INT) // for font-based glyphs, the char index into the font -TM_PROP(2419, TMT, TRUESIZESTRETCHMARK, INT) // stretch TrueSize image when target exceeds source by this percent -TM_PROP(2420, TMT, MINDPI1, INT) // min DPI ImageFile1 was designed for -TM_PROP(2421, TMT, MINDPI2, INT) // min DPI ImageFile1 was designed for -TM_PROP(2422, TMT, MINDPI3, INT) // min DPI ImageFile1 was designed for -TM_PROP(2423, TMT, MINDPI4, INT) // min DPI ImageFile1 was designed for -TM_PROP(2424, TMT, MINDPI5, INT) // min DPI ImageFile1 was designed for - -//---- rendering FONT properties ---- -TM_PROP(2601, TMT, GLYPHFONT, FONT) // the font that the glyph is drawn with - -//---- rendering INTLIST properties ---- -// start with 2801 -// (from smallest to largest) -//---- rendering FILENAME properties ---- -TM_PROP(3001, TMT, IMAGEFILE, FILENAME) // the filename of the image (or basename, for mult. images) -TM_PROP(3002, TMT, IMAGEFILE1, FILENAME) // multiresolution image file -TM_PROP(3003, TMT, IMAGEFILE2, FILENAME) // multiresolution image file -TM_PROP(3004, TMT, IMAGEFILE3, FILENAME) // multiresolution image file -TM_PROP(3005, TMT, IMAGEFILE4, FILENAME) // multiresolution image file -TM_PROP(3006, TMT, IMAGEFILE5, FILENAME) // multiresolution image file -TM_PROP(3007, TMT, STOCKIMAGEFILE, FILENAME) // These are the only images that you can call GetThemeBitmap on -TM_PROP(3008, TMT, GLYPHIMAGEFILE, FILENAME) // the filename for the glyph image - -//---- rendering STRING properties ---- -TM_PROP(3201, TMT, TEXT, STRING) - -//---- rendering POSITION (x and y values) properties ---- -TM_PROP(3401, TMT, OFFSET, POSITION) // for window part layout -TM_PROP(3402, TMT, TEXTSHADOWOFFSET, POSITION) // where char shadows are drawn, relative to orig. chars -TM_PROP(3403, TMT, MINSIZE, POSITION) // min dest rect than ImageFile was designed for -TM_PROP(3404, TMT, MINSIZE1, POSITION) // min dest rect than ImageFile1 was designed for -TM_PROP(3405, TMT, MINSIZE2, POSITION) // min dest rect than ImageFile2 was designed for -TM_PROP(3406, TMT, MINSIZE3, POSITION) // min dest rect than ImageFile3 was designed for -TM_PROP(3407, TMT, MINSIZE4, POSITION) // min dest rect than ImageFile4 was designed for -TM_PROP(3408, TMT, MINSIZE5, POSITION) // min dest rect than ImageFile5 was designed for -TM_PROP(3409, TMT, NORMALSIZE, POSITION) // size of dest rect that exactly source - -//---- rendering MARGIN properties ---- -TM_PROP(3601, TMT, SIZINGMARGINS, MARGINS) // margins used for 9-grid sizing -TM_PROP(3602, TMT, CONTENTMARGINS, MARGINS) // margins that define where content can be placed -TM_PROP(3603, TMT, CAPTIONMARGINS, MARGINS) // margins that define where caption text can be placed - -//---- rendering COLOR properties ---- -TM_PROP(3801, TMT, BORDERCOLOR, COLOR) // color of borders for BorderFill -TM_PROP(3802, TMT, FILLCOLOR, COLOR) // color of bg fill -TM_PROP(3803, TMT, TEXTCOLOR, COLOR) // color text is drawn in -TM_PROP(3804, TMT, EDGELIGHTCOLOR, COLOR) // edge color -TM_PROP(3805, TMT, EDGEHIGHLIGHTCOLOR, COLOR) // edge color -TM_PROP(3806, TMT, EDGESHADOWCOLOR, COLOR) // edge color -TM_PROP(3807, TMT, EDGEDKSHADOWCOLOR, COLOR) // edge color -TM_PROP(3808, TMT, EDGEFILLCOLOR, COLOR) // edge color -TM_PROP(3809, TMT, TRANSPARENTCOLOR, COLOR) // color of pixels that are treated as transparent (not drawn) -TM_PROP(3810, TMT, GRADIENTCOLOR1, COLOR) // first color in gradient -TM_PROP(3811, TMT, GRADIENTCOLOR2, COLOR) // second color in gradient -TM_PROP(3812, TMT, GRADIENTCOLOR3, COLOR) // third color in gradient -TM_PROP(3813, TMT, GRADIENTCOLOR4, COLOR) // forth color in gradient -TM_PROP(3814, TMT, GRADIENTCOLOR5, COLOR) // fifth color in gradient -TM_PROP(3815, TMT, SHADOWCOLOR, COLOR) // color of text shadow -TM_PROP(3816, TMT, GLOWCOLOR, COLOR) // color of glow produced by DrawThemeIcon -TM_PROP(3817, TMT, TEXTBORDERCOLOR, COLOR) // color of text border -TM_PROP(3818, TMT, TEXTSHADOWCOLOR, COLOR) // color of text shadow -TM_PROP(3819, TMT, GLYPHTEXTCOLOR, COLOR) // color that font-based glyph is drawn with -TM_PROP(3820, TMT, GLYPHTRANSPARENTCOLOR, COLOR) // color of transparent pixels in GlyphImageFile -TM_PROP(3821, TMT, FILLCOLORHINT, COLOR) // hint about fill color used (for custom controls) -TM_PROP(3822, TMT, BORDERCOLORHINT, COLOR) // hint about border color used (for custom controls) -TM_PROP(3823, TMT, ACCENTCOLORHINT, COLOR) // hint about accent color used (for custom controls) - -//---- rendering enum properties (must be declared in TM_ENUM section above) ---- -TM_PROP(4001, TMT, BGTYPE, ENUM) // basic drawing type for each part -TM_PROP(4002, TMT, BORDERTYPE, ENUM) // type of border for BorderFill parts -TM_PROP(4003, TMT, FILLTYPE, ENUM) // fill shape for BorderFill parts -TM_PROP(4004, TMT, SIZINGTYPE, ENUM) // how to size ImageFile parts -TM_PROP(4005, TMT, HALIGN, ENUM) // horizontal alignment for TRUESIZE parts & glyphs -TM_PROP(4006, TMT, CONTENTALIGNMENT, ENUM) // custom window prop: how text is aligned in caption -TM_PROP(4007, TMT, VALIGN, ENUM) // horizontal alignment for TRUESIZE parts & glyphs -TM_PROP(4008, TMT, OFFSETTYPE, ENUM) // how window part should be placed -TM_PROP(4009, TMT, ICONEFFECT, ENUM) // type of effect to use with DrawThemeIcon -TM_PROP(4010, TMT, TEXTSHADOWTYPE, ENUM) // type of shadow to draw with text -TM_PROP(4011, TMT, IMAGELAYOUT, ENUM) // how multiple images are arranged (horz. or vert.) -TM_PROP(4012, TMT, GLYPHTYPE, ENUM) // controls type of glyph in imagefile objects -TM_PROP(4013, TMT, IMAGESELECTTYPE, ENUM) // controls when to select from IMAGEFILE1...IMAGEFILE5 -TM_PROP(4014, TMT, GLYPHFONTSIZINGTYPE, ENUM) // controls when to select a bigger/small glyph font size -TM_PROP(4015, TMT, TRUESIZESCALINGTYPE, ENUM) // controls how TrueSize image is scaled - -//---- custom properties (used only by controls/shell) ---- -TM_PROP(5001, TMT, USERPICTURE, BOOL) -TM_PROP(5002, TMT, DEFAULTPANESIZE, RECT) -TM_PROP(5003, TMT, BLENDCOLOR, COLOR) - -END_TM_PROPS() - -//--------------------------------------------------------------------------------------- -// "Window" (i.e., non-client) Parts & States -// -// these cannot be renumbered (part of uxtheme API) -//--------------------------------------------------------------------------------------- -BEGIN_TM_CLASS_PARTS(WINDOW) -TM_PART(1, WP, CAPTION) -TM_PART(2, WP, SMALLCAPTION) -TM_PART(3, WP, MINCAPTION) -TM_PART(4, WP, SMALLMINCAPTION) -TM_PART(5, WP, MAXCAPTION) -TM_PART(6, WP, SMALLMAXCAPTION) -TM_PART(7, WP, FRAMELEFT) -TM_PART(8, WP, FRAMERIGHT) -TM_PART(9, WP, FRAMEBOTTOM) -TM_PART(10, WP, SMALLFRAMELEFT) -TM_PART(11, WP, SMALLFRAMERIGHT) -TM_PART(12, WP, SMALLFRAMEBOTTOM) -//---- window frame buttons ---- -TM_PART(13, WP, SYSBUTTON) -TM_PART(14, WP, MDISYSBUTTON) -TM_PART(15, WP, MINBUTTON) -TM_PART(16, WP, MDIMINBUTTON) -TM_PART(17, WP, MAXBUTTON) -TM_PART(18, WP, CLOSEBUTTON) -TM_PART(19, WP, SMALLCLOSEBUTTON) -TM_PART(20, WP, MDICLOSEBUTTON) -TM_PART(21, WP, RESTOREBUTTON) -TM_PART(22, WP, MDIRESTOREBUTTON) -TM_PART(23, WP, HELPBUTTON) -TM_PART(24, WP, MDIHELPBUTTON) -//---- scrollbars -TM_PART(25, WP, HORZSCROLL) -TM_PART(26, WP, HORZTHUMB) -TM_PART(27, WP, VERTSCROLL) -TM_PART(28, WP, VERTTHUMB) -//---- dialog ---- -TM_PART(29, WP, DIALOG) -//---- hit-test templates --- -TM_PART(30, WP, CAPTIONSIZINGTEMPLATE) -TM_PART(31, WP, SMALLCAPTIONSIZINGTEMPLATE) -TM_PART(32, WP, FRAMELEFTSIZINGTEMPLATE) -TM_PART(33, WP, SMALLFRAMELEFTSIZINGTEMPLATE) -TM_PART(34, WP, FRAMERIGHTSIZINGTEMPLATE) -TM_PART(35, WP, SMALLFRAMERIGHTSIZINGTEMPLATE) -TM_PART(36, WP, FRAMEBOTTOMSIZINGTEMPLATE) -TM_PART(37, WP, SMALLFRAMEBOTTOMSIZINGTEMPLATE) -END_TM_CLASS_PARTS() - -BEGIN_TM_PART_STATES(FRAME) -TM_STATE(1, FS, ACTIVE) -TM_STATE(2, FS, INACTIVE) -END_TM_PART_STATES() - -BEGIN_TM_PART_STATES(CAPTION) -TM_STATE(1, CS, ACTIVE) -TM_STATE(2, CS, INACTIVE) -TM_STATE(3, CS, DISABLED) -END_TM_PART_STATES() - -BEGIN_TM_PART_STATES(MAXCAPTION) -TM_STATE(1, MXCS, ACTIVE) -TM_STATE(2, MXCS, INACTIVE) -TM_STATE(3, MXCS, DISABLED) -END_TM_PART_STATES() - -BEGIN_TM_PART_STATES(MINCAPTION) -TM_STATE(1, MNCS, ACTIVE) -TM_STATE(2, MNCS, INACTIVE) -TM_STATE(3, MNCS, DISABLED) -END_TM_PART_STATES() - -BEGIN_TM_PART_STATES(HORZSCROLL) -TM_STATE(1, HSS, NORMAL) -TM_STATE(2, HSS, HOT) -TM_STATE(3, HSS, PUSHED) -TM_STATE(4, HSS, DISABLED) -END_TM_PART_STATES() - -BEGIN_TM_PART_STATES(HORZTHUMB) -TM_STATE(1, HTS, NORMAL) -TM_STATE(2, HTS, HOT) -TM_STATE(3, HTS, PUSHED) -TM_STATE(4, HTS, DISABLED) -END_TM_PART_STATES() - -BEGIN_TM_PART_STATES(VERTSCROLL) -TM_STATE(1, VSS, NORMAL) -TM_STATE(2, VSS, HOT) -TM_STATE(3, VSS, PUSHED) -TM_STATE(4, VSS, DISABLED) -END_TM_PART_STATES() - -BEGIN_TM_PART_STATES(VERTTHUMB) -TM_STATE(1, VTS, NORMAL) -TM_STATE(2, VTS, HOT) -TM_STATE(3, VTS, PUSHED) -TM_STATE(4, VTS, DISABLED) -END_TM_PART_STATES() - -BEGIN_TM_PART_STATES(SYSBUTTON) -TM_STATE(1, SBS, NORMAL) -TM_STATE(2, SBS, HOT) -TM_STATE(3, SBS, PUSHED) -TM_STATE(4, SBS, DISABLED) -END_TM_PART_STATES() - -BEGIN_TM_PART_STATES(MINBUTTON) -TM_STATE(1, MINBS, NORMAL) -TM_STATE(2, MINBS, HOT) -TM_STATE(3, MINBS, PUSHED) -TM_STATE(4, MINBS, DISABLED) -END_TM_PART_STATES() - -BEGIN_TM_PART_STATES(MAXBUTTON) -TM_STATE(1, MAXBS, NORMAL) -TM_STATE(2, MAXBS, HOT) -TM_STATE(3, MAXBS, PUSHED) -TM_STATE(4, MAXBS, DISABLED) -END_TM_PART_STATES() - -BEGIN_TM_PART_STATES(RESTOREBUTTON) -TM_STATE(1, RBS, NORMAL) -TM_STATE(2, RBS, HOT) -TM_STATE(3, RBS, PUSHED) -TM_STATE(4, RBS, DISABLED) -END_TM_PART_STATES() - -BEGIN_TM_PART_STATES(HELPBUTTON) -TM_STATE(1, HBS, NORMAL) -TM_STATE(2, HBS, HOT) -TM_STATE(3, HBS, PUSHED) -TM_STATE(4, HBS, DISABLED) -END_TM_PART_STATES() - -BEGIN_TM_PART_STATES(CLOSEBUTTON) -TM_STATE(1, CBS, NORMAL) -TM_STATE(2, CBS, HOT) -TM_STATE(3, CBS, PUSHED) -TM_STATE(4, CBS, DISABLED) -END_TM_PART_STATES() - -//--------------------------------------------------------------------------------------- -// "Button" Parts & States -//--------------------------------------------------------------------------------------- -BEGIN_TM_CLASS_PARTS(BUTTON) -TM_PART(1, BP, PUSHBUTTON) -TM_PART(2, BP, RADIOBUTTON) -TM_PART(3, BP, CHECKBOX) -TM_PART(4, BP, GROUPBOX) -TM_PART(5, BP, USERBUTTON) -END_TM_CLASS_PARTS() - -BEGIN_TM_PART_STATES(PUSHBUTTON) -TM_STATE(1, PBS, NORMAL) -TM_STATE(2, PBS, HOT) -TM_STATE(3, PBS, PRESSED) -TM_STATE(4, PBS, DISABLED) -TM_STATE(5, PBS, DEFAULTED) -END_TM_PART_STATES() - -BEGIN_TM_PART_STATES(RADIOBUTTON) -TM_STATE(1, RBS, UNCHECKEDNORMAL) -TM_STATE(2, RBS, UNCHECKEDHOT) -TM_STATE(3, RBS, UNCHECKEDPRESSED) -TM_STATE(4, RBS, UNCHECKEDDISABLED) -TM_STATE(5, RBS, CHECKEDNORMAL) -TM_STATE(6, RBS, CHECKEDHOT) -TM_STATE(7, RBS, CHECKEDPRESSED) -TM_STATE(8, RBS, CHECKEDDISABLED) -END_TM_PART_STATES() - -BEGIN_TM_PART_STATES(CHECKBOX) -TM_STATE(1, CBS, UNCHECKEDNORMAL) -TM_STATE(2, CBS, UNCHECKEDHOT) -TM_STATE(3, CBS, UNCHECKEDPRESSED) -TM_STATE(4, CBS, UNCHECKEDDISABLED) -TM_STATE(5, CBS, CHECKEDNORMAL) -TM_STATE(6, CBS, CHECKEDHOT) -TM_STATE(7, CBS, CHECKEDPRESSED) -TM_STATE(8, CBS, CHECKEDDISABLED) -TM_STATE(9, CBS, MIXEDNORMAL) -TM_STATE(10, CBS, MIXEDHOT) -TM_STATE(11, CBS, MIXEDPRESSED) -TM_STATE(12, CBS, MIXEDDISABLED) -END_TM_PART_STATES() - -BEGIN_TM_PART_STATES(GROUPBOX) -TM_STATE(1, GBS, NORMAL) -TM_STATE(2, GBS, DISABLED) -END_TM_PART_STATES() - -//--------------------------------------------------------------------------------------- -// "Rebar" Parts & States -//--------------------------------------------------------------------------------------- -BEGIN_TM_CLASS_PARTS(REBAR) -TM_PART(1, RP, GRIPPER) -TM_PART(2, RP, GRIPPERVERT) -TM_PART(3, RP, BAND) -TM_PART(4, RP, CHEVRON) -TM_PART(5, RP, CHEVRONVERT) -END_TM_CLASS_PARTS() - -BEGIN_TM_PART_STATES(CHEVRON) -TM_STATE(1, CHEVS, NORMAL) -TM_STATE(2, CHEVS, HOT) -TM_STATE(3, CHEVS, PRESSED) -END_TM_PART_STATES() - -//--------------------------------------------------------------------------------------- -// "Toolbar" Parts & States -//--------------------------------------------------------------------------------------- -BEGIN_TM_CLASS_PARTS(TOOLBAR) -TM_PART(1, TP, BUTTON) -TM_PART(2, TP, DROPDOWNBUTTON) -TM_PART(3, TP, SPLITBUTTON) -TM_PART(4, TP, SPLITBUTTONDROPDOWN) -TM_PART(5, TP, SEPARATOR) -TM_PART(6, TP, SEPARATORVERT) -END_TM_CLASS_PARTS() - -BEGIN_TM_PART_STATES(TOOLBAR) -TM_STATE(1, TS, NORMAL) -TM_STATE(2, TS, HOT) -TM_STATE(3, TS, PRESSED) -TM_STATE(4, TS, DISABLED) -TM_STATE(5, TS, CHECKED) -TM_STATE(6, TS, HOTCHECKED) -END_TM_PART_STATES() - -//--------------------------------------------------------------------------------------- -// "Status" Parts & States -//--------------------------------------------------------------------------------------- -BEGIN_TM_CLASS_PARTS(STATUS) -TM_PART(1, SP, PANE) -TM_PART(2, SP, GRIPPERPANE) -TM_PART(3, SP, GRIPPER) -END_TM_CLASS_PARTS() - -//--------------------------------------------------------------------------------------- -// "Menu" Parts & States -//--------------------------------------------------------------------------------------- -BEGIN_TM_CLASS_PARTS(MENU) -TM_PART(1, MP, MENUITEM) -TM_PART(2, MP, MENUDROPDOWN) -TM_PART(3, MP, MENUBARITEM) -TM_PART(4, MP, MENUBARDROPDOWN) -TM_PART(5, MP, CHEVRON) -TM_PART(6, MP, SEPARATOR) -END_TM_CLASS_PARTS() - -BEGIN_TM_PART_STATES(MENU) -TM_STATE(1, MS, NORMAL) -TM_STATE(2, MS, SELECTED) -TM_STATE(3, MS, DEMOTED) -END_TM_PART_STATES() - -//--------------------------------------------------------------------------------------- -// "ListView" Parts & States -//--------------------------------------------------------------------------------------- -BEGIN_TM_CLASS_PARTS(LISTVIEW) -TM_PART(1, LVP, LISTITEM) -TM_PART(2, LVP, LISTGROUP) -TM_PART(3, LVP, LISTDETAIL) -TM_PART(4, LVP, LISTSORTEDDETAIL) -TM_PART(5, LVP, EMPTYTEXT) -END_TM_CLASS_PARTS() - -BEGIN_TM_PART_STATES(LISTITEM) -TM_STATE(1, LIS, NORMAL) -TM_STATE(2, LIS, HOT) -TM_STATE(3, LIS, SELECTED) -TM_STATE(4, LIS, DISABLED) -TM_STATE(5, LIS, SELECTEDNOTFOCUS) -END_TM_PART_STATES() - -//--------------------------------------------------------------------------------------- -// "Header" Parts & States -//--------------------------------------------------------------------------------------- -BEGIN_TM_CLASS_PARTS(HEADER) -TM_PART(1, HP, HEADERITEM) -TM_PART(2, HP, HEADERITEMLEFT) -TM_PART(3, HP, HEADERITEMRIGHT) -TM_PART(4, HP, HEADERSORTARROW) -END_TM_CLASS_PARTS() - -BEGIN_TM_PART_STATES(HEADERITEM) -TM_STATE(1, HIS, NORMAL) -TM_STATE(2, HIS, HOT) -TM_STATE(3, HIS, PRESSED) -END_TM_PART_STATES() - -BEGIN_TM_PART_STATES(HEADERITEMLEFT) -TM_STATE(1, HILS, NORMAL) -TM_STATE(2, HILS, HOT) -TM_STATE(3, HILS, PRESSED) -END_TM_PART_STATES() - -BEGIN_TM_PART_STATES(HEADERITEMRIGHT) -TM_STATE(1, HIRS, NORMAL) -TM_STATE(2, HIRS, HOT) -TM_STATE(3, HIRS, PRESSED) -END_TM_PART_STATES() - -BEGIN_TM_PART_STATES(HEADERSORTARROW) -TM_STATE(1, HSAS, SORTEDUP) -TM_STATE(2, HSAS, SORTEDDOWN) -END_TM_PART_STATES() -//--------------------------------------------------------------------------------------- -// "Progress" Parts & States -//--------------------------------------------------------------------------------------- -BEGIN_TM_CLASS_PARTS(PROGRESS) -TM_PART(1, PP, BAR) -TM_PART(2, PP, BARVERT) -TM_PART(3, PP, CHUNK) -TM_PART(4, PP, CHUNKVERT) -END_TM_CLASS_PARTS() - -//--------------------------------------------------------------------------------------- -// "Tab" Parts & States -//--------------------------------------------------------------------------------------- -BEGIN_TM_CLASS_PARTS(TAB) -TM_PART(1, TABP, TABITEM) -TM_PART(2, TABP, TABITEMLEFTEDGE) -TM_PART(3, TABP, TABITEMRIGHTEDGE) -TM_PART(4, TABP, TABITEMBOTHEDGE) -TM_PART(5, TABP, TOPTABITEM) -TM_PART(6, TABP, TOPTABITEMLEFTEDGE) -TM_PART(7, TABP, TOPTABITEMRIGHTEDGE) -TM_PART(8, TABP, TOPTABITEMBOTHEDGE) -TM_PART(9, TABP, PANE) -TM_PART(10, TABP, BODY) -END_TM_CLASS_PARTS() - -BEGIN_TM_PART_STATES(TABITEM) -TM_STATE(1, TIS, NORMAL) -TM_STATE(2, TIS, HOT) -TM_STATE(3, TIS, SELECTED) -TM_STATE(4, TIS, DISABLED) -TM_STATE(5, TIS, FOCUSED) -END_TM_PART_STATES() - -BEGIN_TM_PART_STATES(TABITEMLEFTEDGE) -TM_STATE(1, TILES, NORMAL) -TM_STATE(2, TILES, HOT) -TM_STATE(3, TILES, SELECTED) -TM_STATE(4, TILES, DISABLED) -TM_STATE(5, TILES, FOCUSED) -END_TM_PART_STATES() - -BEGIN_TM_PART_STATES(TABITEMRIGHTEDGE) -TM_STATE(1, TIRES, NORMAL) -TM_STATE(2, TIRES, HOT) -TM_STATE(3, TIRES, SELECTED) -TM_STATE(4, TIRES, DISABLED) -TM_STATE(5, TIRES, FOCUSED) -END_TM_PART_STATES() - -BEGIN_TM_PART_STATES(TABITEMBOTHEDGES) -TM_STATE(1, TIBES, NORMAL) -TM_STATE(2, TIBES, HOT) -TM_STATE(3, TIBES, SELECTED) -TM_STATE(4, TIBES, DISABLED) -TM_STATE(5, TIBES, FOCUSED) -END_TM_PART_STATES() - -BEGIN_TM_PART_STATES(TOPTABITEM) -TM_STATE(1, TTIS, NORMAL) -TM_STATE(2, TTIS, HOT) -TM_STATE(3, TTIS, SELECTED) -TM_STATE(4, TTIS, DISABLED) -TM_STATE(5, TTIS, FOCUSED) -END_TM_PART_STATES() - -BEGIN_TM_PART_STATES(TOPTABITEMLEFTEDGE) -TM_STATE(1, TTILES, NORMAL) -TM_STATE(2, TTILES, HOT) -TM_STATE(3, TTILES, SELECTED) -TM_STATE(4, TTILES, DISABLED) -TM_STATE(5, TTILES, FOCUSED) -END_TM_PART_STATES() - -BEGIN_TM_PART_STATES(TOPTABITEMRIGHTEDGE) -TM_STATE(1, TTIRES, NORMAL) -TM_STATE(2, TTIRES, HOT) -TM_STATE(3, TTIRES, SELECTED) -TM_STATE(4, TTIRES, DISABLED) -TM_STATE(5, TTIRES, FOCUSED) -END_TM_PART_STATES() - -BEGIN_TM_PART_STATES(TOPTABITEMBOTHEDGES) -TM_STATE(1, TTIBES, NORMAL) -TM_STATE(2, TTIBES, HOT) -TM_STATE(3, TTIBES, SELECTED) -TM_STATE(4, TTIBES, DISABLED) -TM_STATE(5, TTIBES, FOCUSED) -END_TM_PART_STATES() - -//--------------------------------------------------------------------------------------- -// "Trackbar" Parts & States -//--------------------------------------------------------------------------------------- -BEGIN_TM_CLASS_PARTS(TRACKBAR) -TM_PART(1, TKP, TRACK) -TM_PART(2, TKP, TRACKVERT) -TM_PART(3, TKP, THUMB) -TM_PART(4, TKP, THUMBBOTTOM) -TM_PART(5, TKP, THUMBTOP) -TM_PART(6, TKP, THUMBVERT) -TM_PART(7, TKP, THUMBLEFT) -TM_PART(8, TKP, THUMBRIGHT) -TM_PART(9, TKP, TICS) -TM_PART(10, TKP, TICSVERT) -END_TM_CLASS_PARTS() - -BEGIN_TM_PART_STATES(TRACKBAR) -TM_STATE(1, TKS, NORMAL) -END_TM_PART_STATES() - -BEGIN_TM_PART_STATES(TRACK) -TM_STATE(1, TRS, NORMAL) -END_TM_PART_STATES() - -BEGIN_TM_PART_STATES(TRACKVERT) -TM_STATE(1, TRVS, NORMAL) -END_TM_PART_STATES() - -BEGIN_TM_PART_STATES(THUMB) -TM_STATE(1, TUS, NORMAL) -TM_STATE(2, TUS, HOT) -TM_STATE(3, TUS, PRESSED) -TM_STATE(4, TUS, FOCUSED) -TM_STATE(5, TUS, DISABLED) -END_TM_PART_STATES() - -BEGIN_TM_PART_STATES(THUMBBOTTOM) -TM_STATE(1, TUBS, NORMAL) -TM_STATE(2, TUBS, HOT) -TM_STATE(3, TUBS, PRESSED) -TM_STATE(4, TUBS, FOCUSED) -TM_STATE(5, TUBS, DISABLED) -END_TM_PART_STATES() - -BEGIN_TM_PART_STATES(THUMBTOP) -TM_STATE(1, TUTS, NORMAL) -TM_STATE(2, TUTS, HOT) -TM_STATE(3, TUTS, PRESSED) -TM_STATE(4, TUTS, FOCUSED) -TM_STATE(5, TUTS, DISABLED) -END_TM_PART_STATES() - -BEGIN_TM_PART_STATES(THUMBVERT) -TM_STATE(1, TUVS, NORMAL) -TM_STATE(2, TUVS, HOT) -TM_STATE(3, TUVS, PRESSED) -TM_STATE(4, TUVS, FOCUSED) -TM_STATE(5, TUVS, DISABLED) -END_TM_PART_STATES() - -BEGIN_TM_PART_STATES(THUMBLEFT) -TM_STATE(1, TUVLS, NORMAL) -TM_STATE(2, TUVLS, HOT) -TM_STATE(3, TUVLS, PRESSED) -TM_STATE(4, TUVLS, FOCUSED) -TM_STATE(5, TUVLS, DISABLED) -END_TM_PART_STATES() - -BEGIN_TM_PART_STATES(THUMBRIGHT) -TM_STATE(1, TUVRS, NORMAL) -TM_STATE(2, TUVRS, HOT) -TM_STATE(3, TUVRS, PRESSED) -TM_STATE(4, TUVRS, FOCUSED) -TM_STATE(5, TUVRS, DISABLED) -END_TM_PART_STATES() - -BEGIN_TM_PART_STATES(TICS) -TM_STATE(1, TSS, NORMAL) -END_TM_PART_STATES() - -BEGIN_TM_PART_STATES(TICSVERT) -TM_STATE(1, TSVS, NORMAL) -END_TM_PART_STATES() - -//--------------------------------------------------------------------------------------- -// "Tooltips" Parts & States -//--------------------------------------------------------------------------------------- -BEGIN_TM_CLASS_PARTS(TOOLTIP) -TM_PART(1, TTP, STANDARD) -TM_PART(2, TTP, STANDARDTITLE) -TM_PART(3, TTP, BALLOON) -TM_PART(4, TTP, BALLOONTITLE) -TM_PART(5, TTP, CLOSE) -END_TM_CLASS_PARTS() - -BEGIN_TM_PART_STATES(CLOSE) -TM_STATE(1, TTCS, NORMAL) -TM_STATE(2, TTCS, HOT) -TM_STATE(3, TTCS, PRESSED) -END_TM_PART_STATES() - -BEGIN_TM_PART_STATES(STANDARD) -TM_STATE(1, TTSS, NORMAL) -TM_STATE(2, TTSS, LINK) -END_TM_PART_STATES() - -BEGIN_TM_PART_STATES(BALLOON) -TM_STATE(1, TTBS, NORMAL) -TM_STATE(2, TTBS, LINK) -END_TM_PART_STATES() - -//--------------------------------------------------------------------------------------- -// "TreeView" Parts & States -//--------------------------------------------------------------------------------------- -BEGIN_TM_CLASS_PARTS(TREEVIEW) -TM_PART(1, TVP, TREEITEM) -TM_PART(2, TVP, GLYPH) -TM_PART(3, TVP, BRANCH) -END_TM_CLASS_PARTS() - -BEGIN_TM_PART_STATES(TREEITEM) -TM_STATE(1, TREIS, NORMAL) -TM_STATE(2, TREIS, HOT) -TM_STATE(3, TREIS, SELECTED) -TM_STATE(4, TREIS, DISABLED) -TM_STATE(5, TREIS, SELECTEDNOTFOCUS) -END_TM_PART_STATES() - -BEGIN_TM_PART_STATES(GLYPH) -TM_STATE(1, GLPS, CLOSED) -TM_STATE(2, GLPS, OPENED) -END_TM_PART_STATES() - -//--------------------------------------------------------------------------------------- -// "Spin" Parts & States -//--------------------------------------------------------------------------------------- -BEGIN_TM_CLASS_PARTS(SPIN) -TM_PART(1, SPNP, UP) -TM_PART(2, SPNP, DOWN) -TM_PART(3, SPNP, UPHORZ) -TM_PART(4, SPNP, DOWNHORZ) -END_TM_CLASS_PARTS() - -BEGIN_TM_PART_STATES(UP) -TM_STATE(1, UPS, NORMAL) -TM_STATE(2, UPS, HOT) -TM_STATE(3, UPS, PRESSED) -TM_STATE(4, UPS, DISABLED) -END_TM_PART_STATES() - -BEGIN_TM_PART_STATES(DOWN) -TM_STATE(1, DNS, NORMAL) -TM_STATE(2, DNS, HOT) -TM_STATE(3, DNS, PRESSED) -TM_STATE(4, DNS, DISABLED) -END_TM_PART_STATES() - -BEGIN_TM_PART_STATES(UPHORZ) -TM_STATE(1, UPHZS, NORMAL) -TM_STATE(2, UPHZS, HOT) -TM_STATE(3, UPHZS, PRESSED) -TM_STATE(4, UPHZS, DISABLED) -END_TM_PART_STATES() - -BEGIN_TM_PART_STATES(DOWNHORZ) -TM_STATE(1, DNHZS, NORMAL) -TM_STATE(2, DNHZS, HOT) -TM_STATE(3, DNHZS, PRESSED) -TM_STATE(4, DNHZS, DISABLED) -END_TM_PART_STATES() - -//--------------------------------------------------------------------------------------- -// "Page" Parts & States -//--------------------------------------------------------------------------------------- -BEGIN_TM_CLASS_PARTS(PAGE) -TM_PART(1, PGRP, UP) -TM_PART(2, PGRP, DOWN) -TM_PART(3, PGRP, UPHORZ) -TM_PART(4, PGRP, DOWNHORZ) -END_TM_CLASS_PARTS() - -//--- Pager uses same states as Spin --- - -//--------------------------------------------------------------------------------------- -// "Scrollbar" Parts & States -//--------------------------------------------------------------------------------------- -BEGIN_TM_CLASS_PARTS(SCROLLBAR) -TM_PART(1, SBP, ARROWBTN) -TM_PART(2, SBP, THUMBBTNHORZ) -TM_PART(3, SBP, THUMBBTNVERT) -TM_PART(4, SBP, LOWERTRACKHORZ) -TM_PART(5, SBP, UPPERTRACKHORZ) -TM_PART(6, SBP, LOWERTRACKVERT) -TM_PART(7, SBP, UPPERTRACKVERT) -TM_PART(8, SBP, GRIPPERHORZ) -TM_PART(9, SBP, GRIPPERVERT) -TM_PART(10, SBP, SIZEBOX) -END_TM_CLASS_PARTS() - - - -BEGIN_TM_PART_STATES(ARROWBTN) -TM_STATE(1, ABS, UPNORMAL) -TM_STATE(2, ABS, UPHOT) -TM_STATE(3, ABS, UPPRESSED) -TM_STATE(4, ABS, UPDISABLED) -TM_STATE(5, ABS, DOWNNORMAL) -TM_STATE(6, ABS, DOWNHOT) -TM_STATE(7, ABS, DOWNPRESSED) -TM_STATE(8, ABS, DOWNDISABLED) -TM_STATE(9, ABS, LEFTNORMAL) -TM_STATE(10, ABS, LEFTHOT) -TM_STATE(11, ABS, LEFTPRESSED) -TM_STATE(12, ABS, LEFTDISABLED) -TM_STATE(13, ABS, RIGHTNORMAL) -TM_STATE(14, ABS, RIGHTHOT) -TM_STATE(15, ABS, RIGHTPRESSED) -TM_STATE(16, ABS, RIGHTDISABLED) -END_TM_PART_STATES() - -BEGIN_TM_PART_STATES(SCROLLBAR) -TM_STATE(1, SCRBS, NORMAL) -TM_STATE(2, SCRBS, HOT) -TM_STATE(3, SCRBS, PRESSED) -TM_STATE(4, SCRBS, DISABLED) -END_TM_PART_STATES() - -BEGIN_TM_PART_STATES(SIZEBOX) -TM_STATE(1, SZB, RIGHTALIGN) -TM_STATE(2, SZB, LEFTALIGN) -END_TM_PART_STATES() - -//--------------------------------------------------------------------------------------- -// "Edit" Parts & States -//--------------------------------------------------------------------------------------- -BEGIN_TM_CLASS_PARTS(EDIT) -TM_PART(1, EP, EDITTEXT) -TM_PART(2, EP, CARET) -END_TM_CLASS_PARTS() - -BEGIN_TM_PART_STATES(EDITTEXT) -TM_STATE(1, ETS, NORMAL) -TM_STATE(2, ETS, HOT) -TM_STATE(3, ETS, SELECTED) -TM_STATE(4, ETS, DISABLED) -TM_STATE(5, ETS, FOCUSED) -TM_STATE(6, ETS, READONLY) -TM_STATE(7, ETS, ASSIST) -END_TM_PART_STATES() - -//--------------------------------------------------------------------------------------- -// "ComboBox" Parts & States -//--------------------------------------------------------------------------------------- -BEGIN_TM_CLASS_PARTS(COMBOBOX) -TM_PART(1, CP, DROPDOWNBUTTON) -END_TM_CLASS_PARTS() - -BEGIN_TM_PART_STATES(COMBOBOX) -TM_STATE(1, CBXS, NORMAL) -TM_STATE(2, CBXS, HOT) -TM_STATE(3, CBXS, PRESSED) -TM_STATE(4, CBXS, DISABLED) -END_TM_PART_STATES() - -//--------------------------------------------------------------------------------------- -// "Taskbar Clock" Parts & States -//--------------------------------------------------------------------------------------- -BEGIN_TM_CLASS_PARTS(CLOCK) -TM_PART(1, CLP, TIME) -END_TM_CLASS_PARTS() - -BEGIN_TM_PART_STATES(CLOCK) -TM_STATE(1, CLS, NORMAL) -END_TM_PART_STATES() - -//--------------------------------------------------------------------------------------- -// "Tray Notify" Parts & States -//--------------------------------------------------------------------------------------- -BEGIN_TM_CLASS_PARTS(TRAYNOTIFY) -TM_PART(1, TNP, BACKGROUND) -TM_PART(2, TNP, ANIMBACKGROUND) -END_TM_CLASS_PARTS() - -//--------------------------------------------------------------------------------------- -// "TaskBar" Parts & States -//--------------------------------------------------------------------------------------- -BEGIN_TM_CLASS_PARTS(TASKBAR) -TM_PART(1, TBP, BACKGROUNDBOTTOM) -TM_PART(2, TBP, BACKGROUNDRIGHT) -TM_PART(3, TBP, BACKGROUNDTOP) -TM_PART(4, TBP, BACKGROUNDLEFT) -TM_PART(5, TBP, SIZINGBARBOTTOM) -TM_PART(6, TBP, SIZINGBARRIGHT) -TM_PART(7, TBP, SIZINGBARTOP) -TM_PART(8, TBP, SIZINGBARLEFT) -END_TM_CLASS_PARTS() - -//--------------------------------------------------------------------------------------- -// "TaskBand" Parts & States -//--------------------------------------------------------------------------------------- -BEGIN_TM_CLASS_PARTS(TASKBAND) -TM_PART(1, TDP, GROUPCOUNT) -TM_PART(2, TDP, FLASHBUTTON) -TM_PART(3, TDP, FLASHBUTTONGROUPMENU) -END_TM_CLASS_PARTS() - -//--------------------------------------------------------------------------------------- -// "StartPanel" Parts & States -//--------------------------------------------------------------------------------------- -BEGIN_TM_CLASS_PARTS(STARTPANEL) -TM_PART(1, SPP, USERPANE) -TM_PART(2, SPP, MOREPROGRAMS) -TM_PART(3, SPP, MOREPROGRAMSARROW) -TM_PART(4, SPP, PROGLIST) -TM_PART(5, SPP, PROGLISTSEPARATOR) -TM_PART(6, SPP, PLACESLIST) -TM_PART(7, SPP, PLACESLISTSEPARATOR) -TM_PART(8, SPP, LOGOFF) -TM_PART(9, SPP, LOGOFFBUTTONS) -TM_PART(10, SPP, USERPICTURE) -TM_PART(11, SPP, PREVIEW) -END_TM_CLASS_PARTS() - -BEGIN_TM_PART_STATES(MOREPROGRAMSARROW) -TM_STATE(1, SPS, NORMAL) -TM_STATE(2, SPS, HOT) -TM_STATE(3, SPS, PRESSED) -END_TM_PART_STATES() - -BEGIN_TM_PART_STATES(LOGOFFBUTTONS) -TM_STATE(1, SPLS, NORMAL) -TM_STATE(2, SPLS, HOT) -TM_STATE(3, SPLS, PRESSED) -END_TM_PART_STATES() - -//--------------------------------------------------------------------------------------- -// "ExplorerBar" Parts & States -//--------------------------------------------------------------------------------------- -BEGIN_TM_CLASS_PARTS(EXPLORERBAR) -TM_PART(1, EBP, HEADERBACKGROUND) -TM_PART(2, EBP, HEADERCLOSE) -TM_PART(3, EBP, HEADERPIN) -TM_PART(4, EBP, IEBARMENU) -TM_PART(5, EBP, NORMALGROUPBACKGROUND) -TM_PART(6, EBP, NORMALGROUPCOLLAPSE) -TM_PART(7, EBP, NORMALGROUPEXPAND) -TM_PART(8, EBP, NORMALGROUPHEAD) -TM_PART(9, EBP, SPECIALGROUPBACKGROUND) -TM_PART(10, EBP, SPECIALGROUPCOLLAPSE) -TM_PART(11, EBP, SPECIALGROUPEXPAND) -TM_PART(12, EBP, SPECIALGROUPHEAD) -END_TM_CLASS_PARTS() - -BEGIN_TM_PART_STATES(HEADERCLOSE) -TM_STATE(1, EBHC, NORMAL) -TM_STATE(2, EBHC, HOT) -TM_STATE(3, EBHC, PRESSED) -END_TM_PART_STATES() - -BEGIN_TM_PART_STATES(HEADERPIN) -TM_STATE(1, EBHP, NORMAL) -TM_STATE(2, EBHP, HOT) -TM_STATE(3, EBHP, PRESSED) -TM_STATE(4, EBHP, SELECTEDNORMAL) -TM_STATE(5, EBHP, SELECTEDHOT) -TM_STATE(6, EBHP, SELECTEDPRESSED) -END_TM_PART_STATES() - -BEGIN_TM_PART_STATES(IEBARMENU) -TM_STATE(1, EBM, NORMAL) -TM_STATE(2, EBM, HOT) -TM_STATE(3, EBM, PRESSED) -END_TM_PART_STATES() - -BEGIN_TM_PART_STATES(NORMALGROUPCOLLAPSE) -TM_STATE(1, EBNGC, NORMAL) -TM_STATE(2, EBNGC, HOT) -TM_STATE(3, EBNGC, PRESSED) -END_TM_PART_STATES() - -BEGIN_TM_PART_STATES(NORMALGROUPEXPAND) -TM_STATE(1, EBNGE, NORMAL) -TM_STATE(2, EBNGE, HOT) -TM_STATE(3, EBNGE, PRESSED) -END_TM_PART_STATES() - -BEGIN_TM_PART_STATES(SPECIALGROUPCOLLAPSE) -TM_STATE(1, EBSGC, NORMAL) -TM_STATE(2, EBSGC, HOT) -TM_STATE(3, EBSGC, PRESSED) -END_TM_PART_STATES() - -BEGIN_TM_PART_STATES(SPECIALGROUPEXPAND) -TM_STATE(1, EBSGE, NORMAL) -TM_STATE(2, EBSGE, HOT) -TM_STATE(3, EBSGE, PRESSED) -END_TM_PART_STATES() - -//--------------------------------------------------------------------------------------- -// "TaskBand" Parts & States -//--------------------------------------------------------------------------------------- -BEGIN_TM_CLASS_PARTS(MENUBAND) -TM_PART(1, MDP, NEWAPPBUTTON) -TM_PART(2, MDP, SEPERATOR) -END_TM_CLASS_PARTS() - -BEGIN_TM_PART_STATES(MENUBAND) -TM_STATE(1, MDS, NORMAL) -TM_STATE(2, MDS, HOT) -TM_STATE(3, MDS, PRESSED) -TM_STATE(4, MDS, DISABLED) -TM_STATE(5, MDS, CHECKED) -TM_STATE(6, MDS, HOTCHECKED) -END_TM_PART_STATES() -//--------------------------------------------------------------------------- -END_TM_SCHEMA(ThemeMgrSchema) -//--------------------------------------------------------------------------- -#endif // TMSCHEMA_H -//--------------------------------------------------------------------------- diff --git a/xpstyle/uxtheme.h b/xpstyle/uxtheme.h deleted file mode 100755 index 74e1b31df..000000000 --- a/xpstyle/uxtheme.h +++ /dev/null @@ -1,884 +0,0 @@ -//--------------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// File : uxtheme.h -// Version: 1.0 -//--------------------------------------------------------------------------- -#ifndef _UXTHEME_H_ -#define _UXTHEME_H_ -//--------------------------------------------------------------------------- -#include <commctrl.h> -//--------------------------------------------------------------------------- -//#if (_WIN32_WINNT >= 0x0500) // only available on XP -//--------------------------------------------------------------------------- -// Define API decoration for direct importing of DLL references. -#ifndef THEMEAPI -#if !defined(_UXTHEME_) -#define THEMEAPI EXTERN_C DECLSPEC_IMPORT HRESULT STDAPICALLTYPE -#define THEMEAPI_(type) EXTERN_C DECLSPEC_IMPORT type STDAPICALLTYPE -#else -#define THEMEAPI STDAPI -#define THEMEAPI_(type) STDAPI_(type) -#endif -#endif // THEMEAPI -//--------------------------------------------------------------------------- -typedef HANDLE HTHEME; // handle to a section of theme data for class - -//--------------------------------------------------------------------------- -// NOTE: PartId's and StateId's used in the theme API are defined in the -// hdr file <tmschema.h> using the TM_PART and TM_STATE macros. For -// example, "TM_PART(BP, PUSHBUTTON)" defines the PartId "BP_PUSHBUTTON". - -//--------------------------------------------------------------------------- -// OpenThemeData() - Open the theme data for the specified HWND and -// semi-colon separated list of class names. -// -// OpenThemeData() will try each class name, one at -// a time, and use the first matching theme info -// found. If a match is found, a theme handle -// to the data is returned. If no match is found, -// a "NULL" handle is returned. -// -// When the window is destroyed or a WM_THEMECHANGED -// msg is received, "CloseThemeData()" should be -// called to close the theme handle. -// -// hwnd - window handle of the control/window to be themed -// -// pszClassList - class name (or list of names) to match to theme data -// section. if the list contains more than one name, -// the names are tested one at a time for a match. -// If a match is found, OpenThemeData() returns a -// theme handle associated with the matching class. -// This param is a list (instead of just a single -// class name) to provide the class an opportunity -// to get the "best" match between the class and -// the current theme. For example, a button might -// pass L"OkButton, Button" if its ID=ID_OK. If -// the current theme has an entry for OkButton, -// that will be used. Otherwise, we fall back on -// the normal Button entry. -//--------------------------------------------------------------------------- -THEMEAPI_(HTHEME) OpenThemeData(HWND hwnd, LPCWSTR pszClassList); - -//--------------------------------------------------------------------------- -// CloseTHemeData() - closes the theme data handle. This should be done -// when the window being themed is destroyed or -// whenever a WM_THEMECHANGED msg is received -// (followed by an attempt to create a new Theme data -// handle). -// -// hTheme - open theme data handle (returned from prior call -// to OpenThemeData() API). -//--------------------------------------------------------------------------- -THEMEAPI CloseThemeData(HTHEME hTheme); - -//--------------------------------------------------------------------------- -// functions for basic drawing support -//--------------------------------------------------------------------------- -// The following methods are the theme-aware drawing services. -// Controls/Windows are defined in drawable "parts" by their author: a -// parent part and 0 or more child parts. Each of the parts can be -// described in "states" (ex: disabled, hot, pressed). -//--------------------------------------------------------------------------- -// For the list of all themed classes and the definition of all -// parts and states, see the file "tmschmea.h". -//--------------------------------------------------------------------------- -// Each of the below methods takes a "iPartId" param to specify the -// part and a "iStateId" to specify the state of the part. -// "iStateId=0" refers to the root part. "iPartId" = "0" refers to -// the root class. -//----------------------------------------------------------------------- -// Note: draw operations are always scaled to fit (and not to exceed) -// the specified "Rect". -//----------------------------------------------------------------------- - -//------------------------------------------------------------------------ -// DrawThemeBackground() -// - draws the theme-specified border and fill for -// the "iPartId" and "iStateId". This could be -// based on a bitmap file, a border and fill, or -// other image description. -// -// hTheme - theme data handle -// hdc - HDC to draw into -// iPartId - part number to draw -// iStateId - state number (of the part) to draw -// pRect - defines the size/location of the part -// pClipRect - optional clipping rect (don't draw outside it) -//------------------------------------------------------------------------ -THEMEAPI DrawThemeBackground(HTHEME hTheme, HDC hdc, - int iPartId, int iStateId, const RECT *pRect, OPTIONAL const RECT *pClipRect); - -//--------------------------------------------------------------------------- -//----- DrawThemeText() flags ---- - -#define DTT_GRAYED 0x1 // draw a grayed-out string - -//------------------------------------------------------------------------- -// DrawThemeText() - draws the text using the theme-specified -// color and font for the "iPartId" and -// "iStateId". -// -// hTheme - theme data handle -// hdc - HDC to draw into -// iPartId - part number to draw -// iStateId - state number (of the part) to draw -// pszText - actual text to draw -// dwCharCount - number of chars to draw (-1 for all) -// dwTextFlags - same as DrawText() "uFormat" param -// dwTextFlags2 - additional drawing options -// pRect - defines the size/location of the part -//------------------------------------------------------------------------- -THEMEAPI DrawThemeText(HTHEME hTheme, HDC hdc, int iPartId, - int iStateId, LPCWSTR pszText, int iCharCount, DWORD dwTextFlags, - DWORD dwTextFlags2, const RECT *pRect); - -//------------------------------------------------------------------------- -// GetThemeBackgroundContentRect() -// - gets the size of the content for the theme-defined -// background. This is usually the area inside -// the borders or Margins. -// -// hTheme - theme data handle -// hdc - (optional) device content to be used for drawing -// iPartId - part number to draw -// iStateId - state number (of the part) to draw -// pBoundingRect - the outer RECT of the part being drawn -// pContentRect - RECT to receive the content area -//------------------------------------------------------------------------- -THEMEAPI GetThemeBackgroundContentRect(HTHEME hTheme, OPTIONAL HDC hdc, - int iPartId, int iStateId, const RECT *pBoundingRect, - OUT RECT *pContentRect); - -//------------------------------------------------------------------------- -// GetThemeBackgroundExtent() - calculates the size/location of the theme- -// specified background based on the -// "pContentRect". -// -// hTheme - theme data handle -// hdc - (optional) device content to be used for drawing -// iPartId - part number to draw -// iStateId - state number (of the part) to draw -// pContentRect - RECT that defines the content area -// pBoundingRect - RECT to receive the overall size/location of part -//------------------------------------------------------------------------- -THEMEAPI GetThemeBackgroundExtent(HTHEME hTheme, OPTIONAL HDC hdc, - int iPartId, int iStateId, const RECT *pContentRect, - OUT RECT *pExtentRect); - -//------------------------------------------------------------------------- -typedef enum THEMESIZE -{ - TS_MIN, // minimum size - TS_TRUE, // size without stretching - TS_DRAW, // size that theme mgr will use to draw part -}; -//------------------------------------------------------------------------- -// GetThemePartSize() - returns the specified size of the theme part -// -// hTheme - theme data handle -// hdc - HDC to select font into & measure against -// iPartId - part number to retrieve size for -// iStateId - state number (of the part) -// prc - (optional) rect for part drawing destination -// eSize - the type of size to be retreived -// psz - receives the specified size of the part -//------------------------------------------------------------------------- -THEMEAPI GetThemePartSize(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, - OPTIONAL RECT *prc, enum THEMESIZE eSize, OUT SIZE *psz); - -//------------------------------------------------------------------------- -// GetThemeTextExtent() - calculates the size/location of the specified -// text when rendered in the Theme Font. -// -// hTheme - theme data handle -// hdc - HDC to select font & measure into -// iPartId - part number to draw -// iStateId - state number (of the part) -// pszText - the text to be measured -// dwCharCount - number of chars to draw (-1 for all) -// dwTextFlags - same as DrawText() "uFormat" param -// pszBoundingRect - optional: to control layout of text -// pszExtentRect - receives the RECT for text size/location -//------------------------------------------------------------------------- -THEMEAPI GetThemeTextExtent(HTHEME hTheme, HDC hdc, - int iPartId, int iStateId, LPCWSTR pszText, int iCharCount, - DWORD dwTextFlags, OPTIONAL const RECT *pBoundingRect, - OUT RECT *pExtentRect); - -//------------------------------------------------------------------------- -// GetThemeTextMetrics() -// - returns info about the theme-specified font -// for the part/state passed in. -// -// hTheme - theme data handle -// hdc - optional: HDC for screen context -// iPartId - part number to draw -// iStateId - state number (of the part) -// ptm - receives the font info -//------------------------------------------------------------------------- -THEMEAPI GetThemeTextMetrics(HTHEME hTheme, OPTIONAL HDC hdc, - int iPartId, int iStateId, OUT TEXTMETRIC* ptm); - -//------------------------------------------------------------------------- -// GetThemeBackgroundRegion() -// - computes the region for a regular or partially -// transparent theme-specified background that is -// bound by the specified "pRect". -// If the rectangle is empty, sets the HRGN to NULL -// and return S_FALSE. -// -// hTheme - theme data handle -// hdc - optional HDC to draw into (DPI scaling) -// iPartId - part number to draw -// iStateId - state number (of the part) -// pRect - the RECT used to draw the part -// pRegion - receives handle to calculated region -//------------------------------------------------------------------------- -THEMEAPI GetThemeBackgroundRegion(HTHEME hTheme, OPTIONAL HDC hdc, - int iPartId, int iStateId, const RECT *pRect, OUT HRGN *pRegion); - -//------------------------------------------------------------------------- -//----- HitTestThemeBackground, HitTestThemeBackgroundRegion flags ---- - -// Theme background segment hit test flag (default). possible return values are: -// HTCLIENT: hit test succeeded in the middle background segment -// HTTOP, HTLEFT, HTTOPLEFT, etc: // hit test succeeded in the the respective theme background segment. -#define HTTB_BACKGROUNDSEG 0x0000 - -// Fixed border hit test option. possible return values are: -// HTCLIENT: hit test succeeded in the middle background segment -// HTBORDER: hit test succeeded in any other background segment -#define HTTB_FIXEDBORDER 0x0002 // Return code may be either HTCLIENT or HTBORDER. - -// Caption hit test option. Possible return values are: -// HTCAPTION: hit test succeeded in the top, top left, or top right background segments -// HTNOWHERE or another return code, depending on absence or presence of accompanying flags, resp. -#define HTTB_CAPTION 0x0004 - -// Resizing border hit test flags. Possible return values are: -// HTCLIENT: hit test succeeded in middle background segment -// HTTOP, HTTOPLEFT, HTLEFT, HTRIGHT, etc: hit test succeeded in the respective system resizing zone -// HTBORDER: hit test failed in middle segment and resizing zones, but succeeded in a background border segment -#define HTTB_RESIZINGBORDER_LEFT 0x0010 // Hit test left resizing border, -#define HTTB_RESIZINGBORDER_TOP 0x0020 // Hit test top resizing border -#define HTTB_RESIZINGBORDER_RIGHT 0x0040 // Hit test right resizing border -#define HTTB_RESIZINGBORDER_BOTTOM 0x0080 // Hit test bottom resizing border - -#define HTTB_RESIZINGBORDER (HTTB_RESIZINGBORDER_LEFT|HTTB_RESIZINGBORDER_TOP|\ - HTTB_RESIZINGBORDER_RIGHT|HTTB_RESIZINGBORDER_BOTTOM) - -// Resizing border is specified as a template, not just window edges. -// This option is mutually exclusive with HTTB_SYSTEMSIZINGWIDTH; HTTB_SIZINGTEMPLATE takes precedence -#define HTTB_SIZINGTEMPLATE 0x0100 - -// Use system resizing border width rather than theme content margins. -// This option is mutually exclusive with HTTB_SIZINGTEMPLATE, which takes precedence. -#define HTTB_SYSTEMSIZINGMARGINS 0x0200 - -//------------------------------------------------------------------------- -// HitTestThemeBackground() -// - returns a HitTestCode (a subset of the values -// returned by WM_NCHITTEST) for the point "ptTest" -// within the theme-specified background -// (bound by pRect). "pRect" and "ptTest" should -// both be in the same coordinate system -// (client, screen, etc). -// -// hTheme - theme data handle -// hdc - HDC to draw into -// iPartId - part number to test against -// iStateId - state number (of the part) -// pRect - the RECT used to draw the part -// hrgn - optional region to use; must be in same coordinates as -// - pRect and pTest. -// ptTest - the hit point to be tested -// dwOptions - HTTB_xxx constants -// pwHitTestCode - receives the returned hit test code - one of: -// -// HTNOWHERE, HTLEFT, HTTOPLEFT, HTBOTTOMLEFT, -// HTRIGHT, HTTOPRIGHT, HTBOTTOMRIGHT, -// HTTOP, HTBOTTOM, HTCLIENT -//------------------------------------------------------------------------- -THEMEAPI HitTestThemeBackground(HTHEME hTheme, OPTIONAL HDC hdc, int iPartId, - int iStateId, DWORD dwOptions, const RECT *pRect, OPTIONAL HRGN hrgn, - POINT ptTest, OUT WORD *pwHitTestCode); - -//------------------------------------------------------------------------ -// DrawThemeEdge() - Similar to the DrawEdge() API, but uses part colors -// and is high-DPI aware -// hTheme - theme data handle -// hdc - HDC to draw into -// iPartId - part number to draw -// iStateId - state number of part -// pDestRect - the RECT used to draw the line(s) -// uEdge - Same as DrawEdge() API -// uFlags - Same as DrawEdge() API -// pContentRect - Receives the interior rect if (uFlags & BF_ADJUST) -//------------------------------------------------------------------------ -THEMEAPI DrawThemeEdge(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, - const RECT *pDestRect, UINT uEdge, UINT uFlags, OPTIONAL OUT RECT *pContentRect); - -//------------------------------------------------------------------------ -// DrawThemeIcon() - draws an image within an imagelist based on -// a (possible) theme-defined effect. -// -// hTheme - theme data handle -// hdc - HDC to draw into -// iPartId - part number to draw -// iStateId - state number of part -// pRect - the RECT to draw the image within -// himl - handle to IMAGELIST -// iImageIndex - index into IMAGELIST (which icon to draw) -//------------------------------------------------------------------------ -THEMEAPI DrawThemeIcon(HTHEME hTheme, HDC hdc, int iPartId, - int iStateId, const RECT *pRect, HIMAGELIST himl, int iImageIndex); - -//--------------------------------------------------------------------------- -// IsThemePartDefined() - returns TRUE if the theme has defined parameters -// for the specified "iPartId" and "iStateId". -// -// hTheme - theme data handle -// iPartId - part number to find definition for -// iStateId - state number of part -//--------------------------------------------------------------------------- -THEMEAPI_(BOOL) IsThemePartDefined(HTHEME hTheme, int iPartId, - int iStateId); - -//--------------------------------------------------------------------------- -// IsThemeBackgroundPartiallyTransparent() -// - returns TRUE if the theme specified background for -// the part/state has transparent pieces or -// alpha-blended pieces. -// -// hTheme - theme data handle -// iPartId - part number -// iStateId - state number of part -//--------------------------------------------------------------------------- -THEMEAPI_(BOOL) IsThemeBackgroundPartiallyTransparent(HTHEME hTheme, - int iPartId, int iStateId); - -//--------------------------------------------------------------------------- -// lower-level theme information services -//--------------------------------------------------------------------------- -// The following methods are getter routines for each of the Theme Data types. -// Controls/Windows are defined in drawable "parts" by their author: a -// parent part and 0 or more child parts. Each of the parts can be -// described in "states" (ex: disabled, hot, pressed). -//--------------------------------------------------------------------------- -// Each of the below methods takes a "iPartId" param to specify the -// part and a "iStateId" to specify the state of the part. -// "iStateId=0" refers to the root part. "iPartId" = "0" refers to -// the root class. -//----------------------------------------------------------------------- -// Each method also take a "iPropId" param because multiple instances of -// the same primitive type can be defined in the theme schema. -//----------------------------------------------------------------------- - - -//----------------------------------------------------------------------- -// GetThemeColor() - Get the value for the specified COLOR property -// -// hTheme - theme data handle -// iPartId - part number -// iStateId - state number of part -// iPropId - the property number to get the value for -// pColor - receives the value of the property -//----------------------------------------------------------------------- -THEMEAPI GetThemeColor(HTHEME hTheme, int iPartId, - int iStateId, int iPropId, OUT COLORREF *pColor); - -//----------------------------------------------------------------------- -// GetThemeMetric() - Get the value for the specified metric/size -// property -// -// hTheme - theme data handle -// hdc - (optional) hdc to be drawn into (DPI scaling) -// iPartId - part number -// iStateId - state number of part -// iPropId - the property number to get the value for -// piVal - receives the value of the property -//----------------------------------------------------------------------- -THEMEAPI GetThemeMetric(HTHEME hTheme, OPTIONAL HDC hdc, int iPartId, - int iStateId, int iPropId, OUT int *piVal); - -//----------------------------------------------------------------------- -// GetThemeString() - Get the value for the specified string property -// -// hTheme - theme data handle -// iPartId - part number -// iStateId - state number of part -// iPropId - the property number to get the value for -// pszBuff - receives the string property value -// cchMaxBuffChars - max. number of chars allowed in pszBuff -//----------------------------------------------------------------------- -THEMEAPI GetThemeString(HTHEME hTheme, int iPartId, - int iStateId, int iPropId, OUT LPWSTR pszBuff, int cchMaxBuffChars); - -//----------------------------------------------------------------------- -// GetThemeBool() - Get the value for the specified BOOL property -// -// hTheme - theme data handle -// iPartId - part number -// iStateId - state number of part -// iPropId - the property number to get the value for -// pfVal - receives the value of the property -//----------------------------------------------------------------------- -THEMEAPI GetThemeBool(HTHEME hTheme, int iPartId, - int iStateId, int iPropId, OUT BOOL *pfVal); - -//----------------------------------------------------------------------- -// GetThemeInt() - Get the value for the specified int property -// -// hTheme - theme data handle -// iPartId - part number -// iStateId - state number of part -// iPropId - the property number to get the value for -// piVal - receives the value of the property -//----------------------------------------------------------------------- -THEMEAPI GetThemeInt(HTHEME hTheme, int iPartId, - int iStateId, int iPropId, OUT int *piVal); - -//----------------------------------------------------------------------- -// GetThemeEnumValue() - Get the value for the specified ENUM property -// -// hTheme - theme data handle -// iPartId - part number -// iStateId - state number of part -// iPropId - the property number to get the value for -// piVal - receives the value of the enum (cast to int*) -//----------------------------------------------------------------------- -THEMEAPI GetThemeEnumValue(HTHEME hTheme, int iPartId, - int iStateId, int iPropId, OUT int *piVal); - -//----------------------------------------------------------------------- -// GetThemePosition() - Get the value for the specified position -// property -// -// hTheme - theme data handle -// iPartId - part number -// iStateId - state number of part -// iPropId - the property number to get the value for -// pPoint - receives the value of the position property -//----------------------------------------------------------------------- -THEMEAPI GetThemePosition(HTHEME hTheme, int iPartId, - int iStateId, int iPropId, OUT POINT *pPoint); - -//----------------------------------------------------------------------- -// GetThemeFont() - Get the value for the specified font property -// -// hTheme - theme data handle -// hdc - (optional) hdc to be drawn to (DPI scaling) -// iPartId - part number -// iStateId - state number of part -// iPropId - the property number to get the value for -// pFont - receives the value of the LOGFONT property -// (scaled for the current logical screen dpi) -//----------------------------------------------------------------------- -THEMEAPI GetThemeFont(HTHEME hTheme, OPTIONAL HDC hdc, int iPartId, - int iStateId, int iPropId, OUT LOGFONT *pFont); - -//----------------------------------------------------------------------- -// GetThemeRect() - Get the value for the specified RECT property -// -// hTheme - theme data handle -// iPartId - part number -// iStateId - state number of part -// iPropId - the property number to get the value for -// pRect - receives the value of the RECT property -//----------------------------------------------------------------------- -THEMEAPI GetThemeRect(HTHEME hTheme, int iPartId, - int iStateId, int iPropId, OUT RECT *pRect); - -//----------------------------------------------------------------------- -typedef struct _MARGINS -{ - int cxLeftWidth; // width of left border that retains its size - int cxRightWidth; // width of right border that retains its size - int cyTopHeight; // height of top border that retains its size - int cyBottomHeight; // height of bottom border that retains its size -} MARGINS, *PMARGINS; - -//----------------------------------------------------------------------- -// GetThemeMargins() - Get the value for the specified MARGINS property -// -// hTheme - theme data handle -// hdc - (optional) hdc to be used for drawing -// iPartId - part number -// iStateId - state number of part -// iPropId - the property number to get the value for -// prc - RECT for area to be drawn into -// pMargins - receives the value of the MARGINS property -//----------------------------------------------------------------------- -THEMEAPI GetThemeMargins(HTHEME hTheme, OPTIONAL HDC hdc, int iPartId, - int iStateId, int iPropId, OPTIONAL RECT *prc, OUT MARGINS *pMargins); - -//----------------------------------------------------------------------- -#define MAX_INTLIST_COUNT 10 - -typedef struct _INTLIST -{ - int iValueCount; // number of values in iValues - int iValues[MAX_INTLIST_COUNT]; -} INTLIST, *PINTLIST; - -//----------------------------------------------------------------------- -// GetThemeIntList() - Get the value for the specified INTLIST struct -// -// hTheme - theme data handle -// iPartId - part number -// iStateId - state number of part -// iPropId - the property number to get the value for -// pIntList - receives the value of the INTLIST property -//----------------------------------------------------------------------- -THEMEAPI GetThemeIntList(HTHEME hTheme, int iPartId, - int iStateId, int iPropId, OUT INTLIST *pIntList); - -//----------------------------------------------------------------------- -typedef enum PROPERTYORIGIN -{ - PO_STATE, // property was found in the state section - PO_PART, // property was found in the part section - PO_CLASS, // property was found in the class section - PO_GLOBAL, // property was found in [globals] section - PO_NOTFOUND // property was not found -}; - -//----------------------------------------------------------------------- -// GetThemePropertyOrigin() -// - searches for the specified theme property -// and sets "pOrigin" to indicate where it was -// found (or not found) -// -// hTheme - theme data handle -// iPartId - part number -// iStateId - state number of part -// iPropId - the property number to search for -// pOrigin - receives the value of the property origin -//----------------------------------------------------------------------- -THEMEAPI GetThemePropertyOrigin(HTHEME hTheme, int iPartId, - int iStateId, int iPropId, OUT enum PROPERTYORIGIN *pOrigin); - -//--------------------------------------------------------------------------- -// SetWindowTheme() -// - redirects an existing Window to use a different -// section of the current theme information than its -// class normally asks for. -// -// hwnd - the handle of the window (cannot be NULL) -// -// pszSubAppName - app (group) name to use in place of the calling -// app's name. If NULL, the actual calling app -// name will be used. -// -// pszSubIdList - semicolon separated list of class Id names to -// use in place of actual list passed by the -// window's class. if NULL, the id list from the -// calling class is used. -//--------------------------------------------------------------------------- -// The Theme Manager will remember the "pszSubAppName" and the -// "pszSubIdList" associations thru the lifetime of the window (even -// if themes are subsequently changed). The window is sent a -// "WM_THEMECHANGED" msg at the end of this call, so that the new -// theme can be found and applied. -//--------------------------------------------------------------------------- -// When "pszSubAppName" or "pszSubIdList" are NULL, the Theme Manager -// removes the previously remember association. To turn off theme-ing for -// the specified window, you can pass an empty string (L"") so it -// won't match any section entries. -//--------------------------------------------------------------------------- -THEMEAPI SetWindowTheme(HWND hwnd, LPCWSTR pszSubAppName, - LPCWSTR pszSubIdList); - -//--------------------------------------------------------------------------- -// GetThemeFilename() - Get the value for the specified FILENAME property. -// -// hTheme - theme data handle -// iPartId - part number -// iStateId - state number of part -// iPropId - the property number to search for -// pszThemeFileName - output buffer to receive the filename -// cchMaxBuffChars - the size of the return buffer, in chars -//--------------------------------------------------------------------------- -THEMEAPI GetThemeFilename(HTHEME hTheme, int iPartId, - int iStateId, int iPropId, OUT LPWSTR pszThemeFileName, int cchMaxBuffChars); - -//--------------------------------------------------------------------------- -// GetThemeSysColor() - Get the value of the specified System color. -// -// hTheme - the theme data handle. if non-NULL, will return -// color from [SysMetrics] section of theme. -// if NULL, will return the global system color. -// -// iColorId - the system color index defined in winuser.h -//--------------------------------------------------------------------------- -THEMEAPI_(COLORREF) GetThemeSysColor(HTHEME hTheme, int iColorId); - -//--------------------------------------------------------------------------- -// GetThemeSysColorBrush() -// - Get the brush for the specified System color. -// -// hTheme - the theme data handle. if non-NULL, will return -// brush matching color from [SysMetrics] section of -// theme. if NULL, will return the brush matching -// global system color. -// -// iColorId - the system color index defined in winuser.h -//--------------------------------------------------------------------------- -THEMEAPI_(HBRUSH) GetThemeSysColorBrush(HTHEME hTheme, int iColorId); - -//--------------------------------------------------------------------------- -// GetThemeSysBool() - Get the boolean value of specified System metric. -// -// hTheme - the theme data handle. if non-NULL, will return -// BOOL from [SysMetrics] section of theme. -// if NULL, will return the specified system boolean. -// -// iBoolId - the TMT_XXX BOOL number (first BOOL -// is TMT_FLATMENUS) -//--------------------------------------------------------------------------- -THEMEAPI_(BOOL) GetThemeSysBool(HTHEME hTheme, int iBoolId); - -//--------------------------------------------------------------------------- -// GetThemeSysSize() - Get the value of the specified System size metric. -// (scaled for the current logical screen dpi) -// -// hTheme - the theme data handle. if non-NULL, will return -// size from [SysMetrics] section of theme. -// if NULL, will return the global system metric. -// -// iSizeId - the following values are supported when -// hTheme is non-NULL: -// -// SM_CXBORDER (border width) -// SM_CXVSCROLL (scrollbar width) -// SM_CYHSCROLL (scrollbar height) -// SM_CXSIZE (caption width) -// SM_CYSIZE (caption height) -// SM_CXSMSIZE (small caption width) -// SM_CYSMSIZE (small caption height) -// SM_CXMENUSIZE (menubar width) -// SM_CYMENUSIZE (menubar height) -// -// when hTheme is NULL, iSizeId is passed directly -// to the GetSystemMetrics() function -//--------------------------------------------------------------------------- -THEMEAPI_(int) GetThemeSysSize(HTHEME hTheme, int iSizeId); - -//--------------------------------------------------------------------------- -// GetThemeSysFont() - Get the LOGFONT for the specified System font. -// -// hTheme - the theme data handle. if non-NULL, will return -// font from [SysMetrics] section of theme. -// if NULL, will return the specified system font. -// -// iFontId - the TMT_XXX font number (first font -// is TMT_CAPTIONFONT) -// -// plf - ptr to LOGFONT to receive the font value. -// (scaled for the current logical screen dpi) -//--------------------------------------------------------------------------- -THEMEAPI GetThemeSysFont(HTHEME hTheme, int iFontId, OUT LOGFONT *plf); - -//--------------------------------------------------------------------------- -// GetThemeSysString() - Get the value of specified System string metric. -// -// hTheme - the theme data handle (required) -// -// iStringId - must be one of the following values: -// -// TMT_CSSNAME -// TMT_XMLNAME -// -// pszStringBuff - the buffer to receive the string value -// -// cchMaxStringChars - max. number of chars that pszStringBuff can hold -//--------------------------------------------------------------------------- -THEMEAPI GetThemeSysString(HTHEME hTheme, int iStringId, - OUT LPWSTR pszStringBuff, int cchMaxStringChars); - -//--------------------------------------------------------------------------- -// GetThemeSysInt() - Get the value of specified System int. -// -// hTheme - the theme data handle (required) -// -// iIntId - must be one of the following values: -// -// TMT_DPIX -// TMT_DPIY -// TMT_MINCOLORDEPTH -// -// piValue - ptr to int to receive value -//--------------------------------------------------------------------------- -THEMEAPI GetThemeSysInt(HTHEME hTheme, int iIntId, int *piValue); - -//--------------------------------------------------------------------------- -// IsThemeActive() - can be used to test if a system theme is active -// for the current user session. -// -// use the API "IsAppThemed()" to test if a theme is -// active for the calling process. -//--------------------------------------------------------------------------- -THEMEAPI_(BOOL) IsThemeActive(); - -//--------------------------------------------------------------------------- -// IsAppThemed() - returns TRUE if a theme is active and available to -// the current process -//--------------------------------------------------------------------------- -THEMEAPI_(BOOL) IsAppThemed(); - - -//--------------------------------------------------------------------------- -// GetWindowTheme() - if window is themed, returns its most recent -// HTHEME from OpenThemeData() - otherwise, returns -// NULL. -// -// hwnd - the window to get the HTHEME of -//--------------------------------------------------------------------------- -THEMEAPI_(HTHEME) GetWindowTheme(HWND hwnd); - - -//--------------------------------------------------------------------------- -// EnableThemeDialogTexture() -// -// - Enables/disables dialog background theme. This method can be used to -// tailor dialog compatibility with child windows and controls that -// may or may not coordinate the rendering of their client area backgrounds -// with that of their parent dialog in a manner that supports seamless -// background texturing. -// -// hdlg - the window handle of the target dialog -// dwFlags - ETDT_ENABLE to enable the theme-defined dialog background texturing, -// ETDT_DISABLE to disable background texturing, -// ETDT_ENABLETAB to enable the theme-defined background -// texturing using the Tab texture -//--------------------------------------------------------------------------- - -#define ETDT_DISABLE 0x00000001 -#define ETDT_ENABLE 0x00000002 -#define ETDT_USETABTEXTURE 0x00000004 -#define ETDT_ENABLETAB (ETDT_ENABLE | ETDT_USETABTEXTURE) - -THEMEAPI EnableThemeDialogTexture(HWND hwnd, DWORD dwFlags); - - -//--------------------------------------------------------------------------- -// IsThemeDialogTextureEnabled() -// -// - Reports whether the dialog supports background texturing. -// -// hdlg - the window handle of the target dialog -//--------------------------------------------------------------------------- -THEMEAPI_(BOOL) IsThemeDialogTextureEnabled(HWND hwnd); - - -//--------------------------------------------------------------------------- -//---- flags to control theming within an app ---- - -#define STAP_ALLOW_NONCLIENT (1 << 0) -#define STAP_ALLOW_CONTROLS (1 << 1) -#define STAP_ALLOW_WEBCONTENT (1 << 2) - -//--------------------------------------------------------------------------- -// GetThemeAppProperties() -// - returns the app property flags that control theming -//--------------------------------------------------------------------------- -THEMEAPI_(DWORD) GetThemeAppProperties(); - -//--------------------------------------------------------------------------- -// SetThemeAppProperties() -// - sets the flags that control theming within the app -// -// dwFlags - the flag values to be set -//--------------------------------------------------------------------------- -THEMEAPI_(void) SetThemeAppProperties(DWORD dwFlags); - -//--------------------------------------------------------------------------- -// GetCurrentThemeName() -// - Get the name of the current theme in-use. -// Optionally, return the ColorScheme name and the -// Size name of the theme. -// -// pszThemeFileName - receives the theme path & filename -// cchMaxNameChars - max chars allowed in pszNameBuff -// -// pszColorBuff - (optional) receives the canonical color scheme name -// (not the display name) -// cchMaxColorChars - max chars allowed in pszColorBuff -// -// pszSizeBuff - (optional) receives the canonical size name -// (not the display name) -// cchMaxSizeChars - max chars allowed in pszSizeBuff -//--------------------------------------------------------------------------- -THEMEAPI GetCurrentThemeName( - OUT LPWSTR pszThemeFileName, int cchMaxNameChars, - OUT OPTIONAL LPWSTR pszColorBuff, int cchMaxColorChars, - OUT OPTIONAL LPWSTR pszSizeBuff, int cchMaxSizeChars); - -//--------------------------------------------------------------------------- -// GetThemeDocumentationProperty() -// - Get the value for the specified property name from -// the [documentation] section of the themes.ini file -// for the specified theme. If the property has been -// localized in the theme files string table, the -// localized version of the property value is returned. -// -// pszThemeFileName - filename of the theme file to query -// pszPropertyName - name of the string property to retreive a value for -// pszValueBuff - receives the property string value -// cchMaxValChars - max chars allowed in pszValueBuff -//--------------------------------------------------------------------------- -#define SZ_THDOCPROP_DISPLAYNAME L"DisplayName" -#define SZ_THDOCPROP_CANONICALNAME L"ThemeName" -#define SZ_THDOCPROP_TOOLTIP L"ToolTip" -#define SZ_THDOCPROP_AUTHOR L"author" - -THEMEAPI GetThemeDocumentationProperty(LPCWSTR pszThemeName, - LPCWSTR pszPropertyName, OUT LPWSTR pszValueBuff, int cchMaxValChars); - -//--------------------------------------------------------------------------- -// Theme API Error Handling -// -// All functions in the Theme API not returning an HRESULT (THEMEAPI_) -// use the WIN32 function "SetLastError()" to record any call failures. -// -// To retreive the error code of the last failure on the -// current thread for these type of API's, use the WIN32 function -// "GetLastError()". -// -// All Theme API error codes (HRESULT's and GetLastError() values) -// should be normal win32 errors which can be formatted into -// strings using the Win32 API FormatMessage(). -//--------------------------------------------------------------------------- - -//--------------------------------------------------------------------------- -// DrawThemeParentBackground() -// - used by partially-transparent or alpha-blended -// child controls to draw the part of their parent -// that they appear in front of. -// -// hwnd - handle of the child control - -// hdc - hdc of the child control - -// prc - (optional) rect that defines the area to be -// drawn (CHILD coordinates) -//--------------------------------------------------------------------------- -THEMEAPI DrawThemeParentBackground(HWND hwnd, HDC hdc, OPTIONAL RECT* prc); - -//--------------------------------------------------------------------------- -// EnableTheming() - enables or disables themeing for the current user -// in the current and future sessions. -// -// fEnable - if FALSE, disable theming & turn themes off. -// - if TRUE, enable themeing and, if user previously -// had a theme active, make it active now. -//--------------------------------------------------------------------------- -THEMEAPI EnableTheming(BOOL fEnable); - -//--------------------------------------------------------------------------- -//#endif /* (_WIN32_WINNT >= 0x0500) *// -//--------------------------------------------------------------------------- -#endif // _UXTHEME_H_ -//--------------------------------------------------------------------------- diff --git a/xpstyle/xpstyle.cpp b/xpstyle/xpstyle.cpp deleted file mode 100644 index 35d5d00e0..000000000 --- a/xpstyle/xpstyle.cpp +++ /dev/null @@ -1,1753 +0,0 @@ -/*************************************************************************** - xpstyle.cpp - description - ------------------- - begin : Sun Mar 17 2002 - copyright : (C) 2002 by Vladimir Shutoff - email : vovan@shutoff.ru - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#include "simapi.h" -#include "xpstyle.h" -#include "kpopup.h" -#include "icons.h" - -#include <windows.h> -#include <stdio.h> -#include "uxtheme.h" -#include "tmschema.h" - -#include <qmap.h> -#include <qwidget.h> -#include <qpixmap.h> -#include <qapplication.h> -#include <qpainter.h> -#include <qtabbar.h> -#include <qheader.h> -#include <qslider.h> -#include <qpushbutton.h> -#include <qradiobutton.h> -#include <qscrollbar.h> -#include <qbitmap.h> -#include <qimage.h> -#include <qbutton.h> -#include <qtoolbutton.h> -#include <qprogressbar.h> - -#define Q_ASSERT ASSERT - -#ifdef WIN32 - -#ifndef CS_DROPSHADOW -#define CS_DROPSHADOW 0x00020000 -#endif - -bool bInit = false; -#endif - -static QStyle *createXPstyle() -{ - return new QWindowsXPStyle; -} - -static StyleInfo info = - { - I18N_NOOP("Windows XP style"), - createXPstyle - }; - -EXPORT_PROC StyleInfo *GetStyleInfo() -{ - return &info; -} - -static ulong ref = 0; -static bool use_xp = FALSE; -static bool init_xp = FALSE; -static QMap<QString,HTHEME> *handleMap = 0; - -static const unsigned bitmapWidth = 22; -static const unsigned itemVMargin = 4; -static const unsigned rightBorder = 12; -static const unsigned itemFrame = 0; -static const unsigned itemHMargin = 3; -static const unsigned shadowWidth = 3; -static const unsigned arrowHMargin = 6; - -enum GradientOrientation -{ - VerticalGradient, - HorizontalGradient -}; - -static QImage gradient(int w, int h, const QColor &ca, - const QColor &cb, GradientOrientation eff) -{ - QSize size(w, h); - - int rDiff, gDiff, bDiff; - int rca, gca, bca, rcb, gcb, bcb; - - QImage image(size, 32); - - if (size.width() == 0 || size.height() == 0) - return QImage(); - register int x, y; - - rDiff = (rcb = cb.red()) - (rca = ca.red()); - gDiff = (gcb = cb.green()) - (gca = ca.green()); - bDiff = (bcb = cb.blue()) - (bca = ca.blue()); - - uint *p; - uint rgb; - - register int rl = rca << 16; - register int gl = gca << 16; - register int bl = bca << 16; - - if( eff == VerticalGradient ) { - - int rcdelta = ((1<<16) / size.height()) * rDiff; - int gcdelta = ((1<<16) / size.height()) * gDiff; - int bcdelta = ((1<<16) / size.height()) * bDiff; - - for ( y = 0; y < size.height(); y++ ) { - p = (uint *) image.scanLine(y); - - rl += rcdelta; - gl += gcdelta; - bl += bcdelta; - - rgb = qRgb( (rl>>16), (gl>>16), (bl>>16) ); - - for( x = 0; x < size.width(); x++ ) { - *p = rgb; - p++; - } - } - } else { // must be HorizontalGradient - - unsigned int *o_src = (unsigned int *)image.scanLine(0); - unsigned int *src = o_src; - - int rcdelta = ((1<<16) / size.width()) * rDiff; - int gcdelta = ((1<<16) / size.width()) * gDiff; - int bcdelta = ((1<<16) / size.width()) * bDiff; - - for( x = 0; x < size.width(); x++) { - - rl += rcdelta; - gl += gcdelta; - bl += bcdelta; - - *src++ = qRgb( (rl>>16), (gl>>16), (bl>>16)); - } - - src = o_src; - - // Believe it or not, manually copying in a for loop is faster - // than calling memcpy for each scanline (on the order of ms...). - // I think this is due to the function call overhead (mosfet). - - for (y = 1; y < size.height(); ++y) { - - p = (unsigned int *)image.scanLine(y); - src = o_src; - for(x=0; x < size.width(); ++x) - *p++ = *src++; - } - } - return image; -} - -class QWindowsXPStylePrivate -{ -public: - QWindowsXPStylePrivate() -: hotWidget( 0 ), hotTab( 0 ), hotSpot( -1, -1 ) - { - init(); - } - ~QWindowsXPStylePrivate() - { - cleanup(); - } - - void init() - { - if ( !init_xp ) { - init_xp = TRUE; - use_xp = IsThemeActive() && IsAppThemed(); - } - if ( use_xp ) - ref++; - } - - void cleanup() - { - init_xp = FALSE; - if ( use_xp ) { - if ( !--ref ) { - use_xp = FALSE; - delete limboWidget; - limboWidget = 0; - delete tabbody; - tabbody = 0; - if ( handleMap ) { - QMap<QString, HTHEME>::Iterator it; - for ( it = handleMap->begin(); it != handleMap->end(); ++it ) - CloseThemeData( it.data() ); - delete handleMap; - handleMap = 0; - } - } - } - } - - static bool getThemeResult( HRESULT res ) - { - if ( res == S_OK ) - return TRUE; - return FALSE; - } - - static HWND winId( const QWidget *widget ) - { - if ( widget ) - return widget->winId(); - - if ( currentWidget ) - return currentWidget->winId(); - - if ( !limboWidget ) - limboWidget = new QWidget( 0, "xp_limbo_widget" ); - - return limboWidget->winId(); - } - - const QPixmap *tabBody( QWidget *widget ); - - // hot-widget stuff - - const QWidget *hotWidget; - static const QWidget *currentWidget; - - QRgb tabPaneBorderColor; - - QTab *hotTab; - QRect hotHeader; - - QPoint hotSpot; -private: - static QWidget *limboWidget; - static QPixmap *tabbody; -}; - -const QWidget *QWindowsXPStylePrivate::currentWidget = 0; -QWidget *QWindowsXPStylePrivate::limboWidget = 0; -QPixmap *QWindowsXPStylePrivate::tabbody = 0; - -struct XPThemeData -{ - XPThemeData( const QWidget *w = 0, QPainter *p = 0, const QString &theme = QString::null, int part = 0, int state = 0, const QRect &r = QRect() ) - : widget( w ), painter( p ), name( theme ),partId( part ), stateId( state ), rec( r ), htheme( 0 ) - { - } - ~XPThemeData() - { - } - - HTHEME handle() - { - if ( !use_xp ) - return NULL; - - if ( !htheme && handleMap ) - htheme = handleMap->operator[]( name ); - - if ( !htheme ) { - static wchar_t nm[256]; - Q_ASSERT( name.length() < 255 ); - memcpy( nm, (wchar_t*)name.unicode(), sizeof(wchar_t)*name.length() ); - nm[name.length()] = 0; - htheme = OpenThemeData( QWindowsXPStylePrivate::winId( widget ), nm ); - if ( htheme ) { - if ( !handleMap ) - handleMap = new QMap<QString, HTHEME>; - handleMap->operator[]( name ) = htheme; - } - } - - return htheme; - } - - bool isValid() - { - return use_xp && !!name && handle(); - } - - RECT rect() - { - RECT r; - r.left = rec.x(); - r.right = rec.x() + rec.width(); - r.top = rec.y(); - r.bottom = rec.y() + rec.height(); - - return r; - } - - HRGN mask() - { - if ( IsThemeBackgroundPartiallyTransparent( handle(), partId, stateId ) ) { - HRGN hrgn; - GetThemeBackgroundRegion( handle(), painter ? painter->handle() : 0, partId, stateId, &rect(), &hrgn ); - return hrgn; - } - return 0; - } - - void setTransparency() - { - HRGN hrgn = mask(); - if ( hrgn ) - SetWindowRgn( QWindowsXPStylePrivate::winId( widget ), hrgn, FALSE ); - } - - void drawBackground( int pId = 0, int sId = 0 ) - { - if ( pId ) - partId = pId; - if ( sId ) - stateId = sId; - - if ( name && name == "TAB" && ( - partId == TABP_TABITEMLEFTEDGE || - partId == TABP_TABITEMRIGHTEDGE || - partId == TABP_TABITEM ) ) { - QRect oldrec = rec; - rec = QRect( 0, 0, rec.width(), rec.height() ); - QPixmap pm( rec.size() ); - QPainter p( &pm ); - p.eraseRect( 0, 0, rec.width(), rec.height() ); - DrawThemeBackground( handle(), p.handle(), partId, stateId, &rect(), 0 ); - rec = oldrec; - painter->drawPixmap( rec.x(), rec.y(), pm ); - } else { - ulong res = DrawThemeBackground( handle(), painter->handle(), partId, stateId, &rect(), 0 ); - } - } - - int partId; - int stateId; - QRect rec; - -private: - const QWidget *widget; - QPainter *painter; - QString name; - HTHEME htheme; - bool workAround; -}; - -const QPixmap *QWindowsXPStylePrivate::tabBody( QWidget *widget ) -{ - if ( !tabbody ) { - tabbody = new QPixmap( 1, 1 ); - QPainter painter( tabbody ); - XPThemeData theme( widget, &painter, "TAB", TABP_BODY, 0 ); - SIZE sz; - GetThemePartSize( theme.handle(), painter.handle(), TABP_BODY, 0, 0, TS_TRUE, &sz ); - COLORREF cref; - GetThemeColor( theme.handle(), TABP_PANE, 0, TMT_BORDERCOLORHINT, &cref ); - tabPaneBorderColor = qRgb( GetRValue(cref), GetGValue(cref), GetBValue(cref) ); - painter.end(); - tabbody->resize( sz.cx, QApplication::desktop()->height() ); - painter.begin( tabbody ); - theme.rec = QRect( 0, 0, sz.cx, sz.cy ); - theme.drawBackground(); - QPixmap temp( sz.cx, 1 ); - bitBlt( &temp, 0,0, tabbody, 0, sz.cy-1 ); - painter.drawTiledPixmap( 0, sz.cy, sz.cx, tabbody->height()-sz.cy, temp ); - painter.end(); - } - return tabbody; -} - -QWindowsXPStyle::QWindowsXPStyle() - : QWindowsStyle() -{ - d = new QWindowsXPStylePrivate; -} - -QWindowsXPStyle::~QWindowsXPStyle() -{ - delete d; -} - -void QWindowsXPStyle::unPolish( QApplication *app ) -{ - d->cleanup(); - QWindowsStyle::unPolish( app ); -} - -void QWindowsXPStyle::polish( QApplication *app ) -{ - static bool isPolished = FALSE; - if ( !isPolished ) - ref--; - QWindowsStyle::polish( app ); - init_xp = FALSE; - d->init(); - isPolished = TRUE; -} - -void QWindowsXPStyle::polish( QWidget *widget ) -{ - QString className = widget->className(); - if (widget->testWFlags(WStyle_Tool) || widget->testWFlags(WType_Popup)) - SetClassLong(widget->winId(), GCL_STYLE, GetClassLong(widget->winId(), GCL_STYLE) | CS_DROPSHADOW); - QWindowsStyle::polish( widget ); - if ( !use_xp ) - return; - if ( widget->inherits("QButton")) { - widget->installEventFilter( this ); - widget->setMouseTracking( TRUE ); - widget->setBackgroundOrigin( QWidget::ParentOrigin ); - widget->setAutoMask(!widget->inherits("QRadioButton")); - if (widget->inherits("QToolButton")){ - QToolButton *btn = static_cast<QToolButton*>(widget); - btn->setAutoRaise(false); - } - } else if ( widget->inherits("QTabBar")) { - widget->installEventFilter( this ); - widget->setMouseTracking( TRUE ); - connect( widget, SIGNAL(selected(int)), this, SLOT(activeTabChanged()) ); - } else if ( widget->inherits("QHeader")) { - widget->installEventFilter( this ); - widget->setMouseTracking( TRUE ); - } else if ( widget->inherits("QProgressBar")) { - widget->installEventFilter( this ); - widget->setBackgroundMode(QWidget::NoBackground); - } else if ( widget->inherits("QComboBox")) { - widget->installEventFilter( this ); - widget->setMouseTracking( TRUE ); - } else if ( widget->inherits("QLineEdit")) { - widget->installEventFilter( this ); - } else if ( widget->inherits("QScrollView")) { - widget->installEventFilter( this ); - } else if ( widget->inherits("QSpinWidget")) { - widget->installEventFilter( this ); - widget->setMouseTracking( TRUE ); - } else if ( widget->inherits("QScrollBar")) { - widget->installEventFilter( this ); - widget->setMouseTracking( TRUE ); - } else if ( widget->inherits("QTitleBar")) { - widget->installEventFilter( this ); - widget->setMouseTracking( TRUE ); - } else if ( widget->inherits("QWorkspaceChild")) { - widget->installEventFilter( this ); - } else if ( widget->inherits("QSizeGrip")) { - widget->installEventFilter( this ); - } else if ( widget->inherits("QSlider")) { - widget->installEventFilter( this ); - widget->setMouseTracking( TRUE ); - } else if ( widget->inherits("KPopupTitle")) { - widget->installEventFilter( this ); - } else if ( widget->inherits( "QWidgetStack" ) && - widget->parentWidget() && - widget->parentWidget()->inherits( "QTabWidget" ) ) { - widget->setBackgroundPixmap( *d->tabBody( widget ) ); - } else if ( widget->parentWidget() && - widget->parentWidget()->inherits( "QWidgetStack" ) && - widget->parentWidget()->parentWidget() && - widget->parentWidget()->parentWidget()->inherits( "QTabWidget" ) ) { - widget->setBackgroundPixmap( *d->tabBody( widget ) ); - } else if ( widget->inherits( "QMenuBar" ) ) { - QPalette pal = widget->palette(); - XPThemeData theme( widget, 0, "MENUBAR", 0, 0 ); - if ( theme.isValid() ) { - COLORREF cref; - GetThemeColor( theme.handle(), 0, 0, TMT_MENUBAR, &cref ); - QColor menubar( qRgb(GetRValue(cref),GetGValue(cref),GetBValue(cref)) ); - pal.setColor( QColorGroup::Button, menubar ); - } else { - QPalette apal = QApplication::palette(); - pal.setColor( QPalette::Active, QColorGroup::Button, apal.color( QPalette::Active, QColorGroup::Button ) ); - pal.setColor( QPalette::Inactive, QColorGroup::Button, apal.color( QPalette::Inactive, QColorGroup::Button ) ); - pal.setColor( QPalette::Disabled, QColorGroup::Button, apal.color( QPalette::Disabled, QColorGroup::Button ) ); - } - widget->setPalette( pal ); - }else if (widget->inherits("QLabel") || - widget->inherits("QGroupBox")){ - QWidget *p; - for ( p = widget->parentWidget(); p; p = p->parentWidget()){ - if (p->inherits("QWidgetStack") && - p->parentWidget() && - p->parentWidget()->inherits("QTabWidget")) - break; - if (p == widget->topLevelWidget()){ - p = NULL; - break; - } - } - if (p){ - // widget->setBackgroundMode(QWidget::NoBackground); - widget->installEventFilter( this ); - } - } - - updateRegion( widget ); -} - -void QWindowsXPStyle::unPolish( QWidget *widget ) -{ - QString className = widget->className(); - if (widget->testWFlags(WStyle_Tool) || widget->testWFlags(WType_Popup)) - SetClassLong(widget->winId(), GCL_STYLE, GetClassLong(widget->winId(), GCL_STYLE) | CS_DROPSHADOW); - widget->removeEventFilter( this ); - if ( widget->inherits( "QTitleBar" ) && !widget->inherits( "QDockWindowTitleBar" ) ) { - SetWindowRgn( widget->winId(), 0, TRUE ); - if ( widget->isMinimized() ) { - SetWindowRgn( widget->parentWidget()->winId(), 0, TRUE ); - } - } else if ( widget->inherits( "QWorkspaceChild" ) ) { - SetWindowRgn( widget->winId(), 0, TRUE ); - } else if ( widget->inherits( "QWidgetStack" ) && - widget->parentWidget() && - widget->parentWidget()->inherits( "QTabWidget" ) ) { - widget->setBackgroundPixmap( QPixmap() ); - } else if ( widget->inherits( "QTabBar" ) ) { - disconnect( widget, SIGNAL(selected(int)), this, SLOT(activeTabChanged()) ); - } - QWindowsStyle::unPolish( widget ); -} - -void QWindowsXPStyle::updateRegion( QWidget *widget ) -{ - if ( !use_xp ) - return; - - if ( widget->inherits( "QTitleBar" ) && !widget->inherits( "QDockWindowTitleBar" ) ) { - if ( widget->isMinimized() ) { - XPThemeData theme( widget, 0, "WINDOW", WP_MINCAPTION, CS_ACTIVE, widget->rect() ); - theme.setTransparency(); - XPThemeData theme2( widget->parentWidget(), 0, "WINDOW", WP_MINCAPTION, CS_ACTIVE, widget->rect() ); - theme2.setTransparency(); - } else { - int partId = WP_CAPTION; - if ( widget->inherits( "QDockWindowTitleBar" ) ) - partId = WP_SMALLCAPTION; - XPThemeData theme( widget, 0, "WINDOW", partId, CS_ACTIVE, widget->rect() ); - theme.setTransparency(); - } - } else if ( widget->inherits( "QWorkspaceChild" ) ) { - XPThemeData theme( widget, 0, "WINDOW", WP_CAPTION, CS_ACTIVE, widget->rect() ); - theme.setTransparency(); - theme.rec = widget->parentWidget()->rect(); - RECT r = theme.rect(); - InvalidateRect( widget->parentWidget()->winId(), &r, TRUE ); - } -} - -class QMyTabBar : public QTabBar -{ -public: - virtual QTab* selectTab ( const QPoint & p ) const; - int indexOf(QTab *t); - int currentIndex(); - void setCurrentIndex(int i); -private: - QMyTabBar(); -}; - -int QMyTabBar::indexOf(QTab *t) -{ - QList<QTab> *l = tabList(); - if (l == NULL) return -1; - return l->findRef(t); -} - -int QMyTabBar::currentIndex() -{ - QList<QTab> *l = tabList(); - if (l == NULL) return -1; - return l->at(); -} - -void QMyTabBar::setCurrentIndex(int n) -{ - QList<QTab> *l = tabList(); - if (l == NULL) return; - if (n == -1){ - l->last(); - l->next(); - return; - } - l->at(n); -} - -QTab *QMyTabBar::selectTab(const QPoint &p) const -{ - return QTabBar::selectTab(p); -}; - -class QMyHeader : public QHeader -{ -public: - QRect sectionRect ( int index ); -private: - QMyHeader(); -}; - -QRect QMyHeader::sectionRect(int index) -{ - return QHeader::sRect(index); -} - -class MyRadioButton : public QRadioButton -{ -public: - void drawButtonLabel(QPainter *p) { QRadioButton::drawButtonLabel(p); } -}; - - -// HotSpot magic -/*! \reimp */ -bool QWindowsXPStyle::eventFilter( QObject *o, QEvent *e ) -{ - if ( !o || !o->isWidgetType() || !use_xp) - return QWindowsStyle::eventFilter( o, e ); - - QWidget *widget = (QWidget*)o; - - switch ( e->type() ) { - case QEvent::MouseMove: - { - if ( !widget->isActiveWindow() ) - break; - - QMouseEvent *me = (QMouseEvent*)e; - - d->hotWidget = widget; - d->hotSpot = me->pos(); - - if ( o->inherits( "QTabBar" ) ) { - QMyTabBar* bar = (QMyTabBar*)o; - QTab * t = bar->selectTab( me->pos() ); - if ( d->hotTab != t ) { - d->hotTab = t; - widget->repaint( FALSE ); - } - } else if ( o->inherits( "QHeader" ) ) { - QMyHeader *header = (QMyHeader*)o; - QRect oldHeader = d->hotHeader; - - if ( header->orientation() == Horizontal ) - d->hotHeader = header->sectionRect( header->sectionAt( d->hotSpot.x() ) ); - else - d->hotHeader = header->sectionRect( header->sectionAt( d->hotSpot.y() ) ); - - char b[512]; - sprintf(b, "hotspot: %u %u: %X %X\n", d->hotSpot.x(), d->hotSpot.y(), oldHeader, d->hotHeader); - - if ( oldHeader != d->hotHeader ) { - if ( oldHeader.isValid() ) - header->update( oldHeader ); - if ( d->hotHeader.isValid() ) - header->update( d->hotHeader ); - } - } else if ( o->inherits( "QSlider" ) ) { - static clearSlider = FALSE; - QSlider *slider = (QSlider*)o; - const QRect rect = slider->sliderRect(); - const bool inSlider = rect.contains( d->hotSpot ); - if ( ( inSlider && !clearSlider ) || ( !inSlider && clearSlider ) ) { - clearSlider = inSlider; - slider->repaint( rect, FALSE ); - } - } else if ( o->inherits( "QComboBox" ) ) { - static clearCombo = FALSE; - - int x = 0, y = 0, wi = widget->width(), he = widget->height(); - int xpos = x; - xpos += wi - 2 - 16; - QRect rect(xpos, y+2, 16, he-4); - - const bool inArrow = rect.contains( d->hotSpot ); - if ( ( inArrow && !clearCombo ) || ( !inArrow && clearCombo ) ) { - clearCombo = inArrow; - widget->repaint( rect, FALSE ); - } - } else { - widget->repaint( FALSE ); - } - } - break; - - case QEvent::Enter: - if ( !widget->isActiveWindow() ) - break; - d->hotWidget = widget; - widget->repaint( TRUE ); - break; - - case QEvent::Leave: - if ( widget == d->hotWidget) { - d->hotWidget = 0; - d->hotHeader = QRect(); - d->hotTab = 0; - widget->repaint(TRUE); - } - break; - - case QEvent::FocusOut: - case QEvent::FocusIn: - widget->repaint( FALSE ); - break; - - case QEvent::Resize: - updateRegion( widget ); - break; - - case QEvent::Paint: - if (o->inherits("QSizeGrip")){ - QPainter p(widget); - XPThemeData theme(widget, &p, "STATUS", SP_GRIPPER, - 0, QRect(-4, -8, widget->width()+4, widget->height()+8)); - if ( !theme.isValid() ) - return false; - theme.drawBackground(); - return true; - } - if (o->inherits("QRadioButton")){ - MyRadioButton *btn = static_cast<MyRadioButton*>(widget); - QWidget *parent; - for (parent = btn->parentWidget(); parent; parent = parent->parentWidget()){ - if (parent->backgroundPixmap()) - break; - if (parent == btn->topLevelWidget()){ - parent = NULL; - break; - } - } - if (parent){ - QPixmap pict(btn->width(), btn->height()); - QPainter p(&pict); - QPoint pos = btn->mapToGlobal(QPoint(0, 0)); - pos = parent->mapFromGlobal(pos); - p.drawTiledPixmap(0, 0, btn->width(), btn->height(), *parent->backgroundPixmap(), pos.x(), pos.y()); - const QColorGroup &g = btn->colorGroup(); - int x, y; - QFontMetrics fm = btn->fontMetrics(); - QSize lsz = fm.size(ShowPrefix, btn->text()); - QSize sz = exclusiveIndicatorSize(); - x = btn->text().isEmpty() ? 1 : 0; - y = (btn->height() - lsz.height() + fm.height() - sz.height())/2; - const QWidget *w = d->currentWidget; - d->currentWidget = widget; - drawExclusiveIndicator(&p, x, y, sz.width(), sz.height(), g, btn->isOn(), btn->isDown(), btn->isEnabled() ); - d->currentWidget = w; - btn->drawButtonLabel(&p); - p.end(); - p.begin(btn); - p.drawPixmap(0, 0, pict); - return true; - } - return false; - } - if (o->inherits("QProgressBar")){ - QProgressBar *bar = static_cast<QProgressBar*>(widget); - QPixmap pm(bar->size()); - QPainter paint(&pm); - QBrush fbrush = bar->backgroundPixmap() - ? QBrush(bar->backgroundColor(), *bar->backgroundPixmap()) - : QBrush(bar->backgroundColor()); - paint.fillRect(bar->rect(), fbrush); - paint.setFont(bar->font()); - XPThemeData theme(widget, &paint, "PROGRESS", PP_BAR, 1, bar->rect()); - if (!theme.isValid()) return false; - theme.drawBackground(); - if (!bar->totalSteps()){ - int w = bar->width() - 4; - int x = bar->progress() % (w * 2); - if (x > w) - x = 2 * w - x; - paint.setPen( QPen(bar->colorGroup().highlight(), 4) ); - paint.drawLine(x, 1, x, bar->height() - 2); - } else { - int unit_width = 1; - XPThemeData theme( widget, 0, "PROGRESS", PP_CHUNK ); - if ( theme.isValid() ) { - SIZE size; - GetThemePartSize(theme.handle(), NULL, theme.partId, theme.stateId, 0, TS_TRUE, &size ); - unit_width = size.cx; - } - int u = (bar->width() - 4) / unit_width; - int p_v = bar->progress(); - int t_s = bar->totalSteps(); - if ( u > 0 && p_v >= INT_MAX / u && t_s >= u ) { - p_v /= u; - t_s /= u; - } - int nu = ( u * p_v + t_s / 2 ) / t_s; - if (nu * unit_width > bar->width() - 4) - nu--; - int x = 0; - int x0 = 2; - for (int i=0; i<nu; i++) { - QRect rect = QRect( x0 + x, 3, unit_width, bar->height() - 5); - XPThemeData theme(widget, &paint, "PROGRESS", PP_CHUNK, 1, rect); - if ( !theme.isValid() ) continue; - theme.drawBackground(); - x += unit_width; - } - } - - paint.end(); - paint.begin(bar); - paint.drawPixmap(0, 0, pm); - paint.end(); - return true; - } - if (o->inherits("KPopupTitle")){ - KPopupTitle *w = (KPopupTitle*)widget; - QImage img = - gradient(widget->width(), w->height(), - darkXp(colorBitmap(w->colorGroup())), - colorMenu(w->colorGroup()), - HorizontalGradient); - int x = 2; - if (!w->icon().isNull()){ - int picty = (w->height() - w->icon().height()) / 2; - QImage *image = NULL; - QImage ii; - PictDef *def = getIcons()->getPict(w->icon()); - if (def) - image = def->image; - if (image == NULL){ - ii = w->icon().convertToImage(); - image = ⅈ - } - unsigned int *f = (unsigned int*)image->bits(); - unsigned int *t = (unsigned int*)img.bits(); - t += (picty + 1) * widget->width() + x + 1; - unsigned i; - QColor c = darkXp(colorSel(w->colorGroup())); - unsigned char cr = c.red(); - unsigned char cg = c.green(); - unsigned char cb = c.blue(); - for (i = 0; i < image->height(); i++){ - for (unsigned j = 0; j < image->width(); j++){ - unsigned char a = qAlpha(*f); - *t = qRgba((cr * a + qRed(*t) * (0xFF - a)) >> 8, - (cg * a + qGreen(*t) * (0xFF - a)) >> 8, - (cb * a + qBlue(*t) * (0xFF - a)) >> 8, 0xFF); - f++; - t++; - } - t += (widget->width() - image->width()); - } - f = (unsigned int*)image->bits(); - t = (unsigned int*)img.bits(); - t += picty * widget->width() + x; - for (i = 0; i < image->height(); i++){ - for (unsigned j = 0; j < image->width(); j++){ - unsigned char a = qAlpha(*f); - *t = qRgba((qRed(*f) * a + qRed(*t) * (0xFF - a)) >> 8, - (qGreen(*f) * a + qGreen(*t) * (0xFF - a)) >> 8, - (qBlue(*f) * a + qBlue(*t) * (0xFF - a)) >> 8, 0xFF); - f++; - t++; - } - t += (widget->width() - image->width()); - } - x += w->icon().width() + 2; - } - QPixmap pict(widget->width(), w->height()); - QPainter p(&pict); - p.drawImage(0, 0, img); - QFont f(w->font()); - f.setBold(true); - p.setFont(f); - p.setPen(darkXp(colorSel(w->colorGroup()))); - QRect rc(x, 1, w->width(), w->height()); - p.drawText(rc, AlignVCenter | AlignLeft, w->title()); - rc.moveBy(-1, -1); - p.setPen(w->colorGroup().highlightedText()); - p.drawText(rc, AlignVCenter | AlignLeft, w->title()); - p.end(); - p.begin(w); - p.drawPixmap(0, 0, pict); - p.setPen(w->colorGroup().highlight()); - p.drawLine(0, 0, w->width(), 0); - p.drawLine(0, w->height()-1, w->width(), w->height()-1); - p.end(); - return true; - } - if (o->inherits("QLabel") || - o->inherits("QGroupBox")){ - QWidget *w = static_cast<QWidget*>(o); - for (QWidget *p = w->parentWidget(); p; p = p->parentWidget()){ - const QPixmap *bg = p->backgroundPixmap(); - if (bg){ - QPoint pos = w->mapToGlobal(QPoint(0, 0)); - pos = p->mapFromGlobal(pos); - QPainter pp(w); - pp.drawTiledPixmap(0, 0, w->width(), w->height(), *bg, pos.x(), pos.y()); - pp.setClipRect(static_cast<QPaintEvent*>(e)->rect()); - break; - } - } - return false; - } - if (d->currentWidget != widget){ - const QWidget *w = d->currentWidget; - d->currentWidget = widget; - o->event(e); - d->currentWidget = w; - return true; - } - return false; - default: - break; - } - - return QWindowsStyle::eventFilter( o, e ); -} - -void QWindowsXPStyle::drawButton( QPainter *p, int x, int y, int w, int h, - const QColorGroup &g, bool sunken, const QBrush *fill) -{ - int stateId = PBS_NORMAL; - if (sunken) stateId = PBS_PRESSED; - if (d->currentWidget){ - if (!d->currentWidget->isEnabled()) - stateId = PBS_DISABLED; - if (d->currentWidget->inherits("QHeader") && - (d->currentWidget == d->hotWidget) && - QRect(x, y, w, h).contains(d->hotSpot)) - stateId = PBS_HOT; - } - XPThemeData theme( 0, p, "BUTTON", BP_PUSHBUTTON, - stateId, QRect(x, y, w, h)); - if ( !theme.isValid() ) { - QWindowsStyle::drawButton(p, x, y, w, h, g, sunken, fill); - return; - } - theme.drawBackground(); -} - -void QWindowsXPStyle::drawBevelButton( QPainter *p, int x, int y, int w, int h, - const QColorGroup &g, bool sunken, const QBrush *fill) -{ - drawButton(p, x, y, w, h, g, sunken, fill); -} - -void QWindowsXPStyle::drawButtonMask( QPainter *p, int x, int y, int w, int h) -{ - QRect rect = QRect(x, y, w+1, h+1); - - XPThemeData theme(0, p, "BUTTON", BP_PUSHBUTTON, 0, rect); - HRGN rgn = theme.mask(); - - if ( !rgn ) { - QWindowsStyle::drawButtonMask( p, x, y, w, h); - return; - } - - p->save(); - p->setBrush( color1 ); - PaintRgn( p->handle(), rgn ); - p->restore(); -} - -void QWindowsXPStyle::drawToolButton( QPainter *p, int x, int y, int w, int h, - const QColorGroup &g, bool sunken, const QBrush *fill) -{ - int stateId = TS_NORMAL; - if (sunken) stateId = TS_PRESSED; - bool isChecked = false; - if (d->currentWidget){ - if (d->currentWidget->inherits("QButton")){ - const QButton *b = static_cast<const QButton*>(d->currentWidget); - if (b->isOn()) isChecked = true; - } - if (d->currentWidget == d->hotWidget) - stateId = isChecked ? TS_HOTCHECKED : TS_HOT; - if (!d->currentWidget->isEnabled()) - stateId = TS_DISABLED; - } - XPThemeData theme( 0, p, "TOOLBAR", TP_BUTTON, - stateId, QRect(x, y, w, h)); - if ( !theme.isValid() ) { - QWindowsStyle::drawToolButton(p, x, y, w, h, g, sunken, fill); - return; - } - theme.drawBackground(); -} - -void QWindowsXPStyle::drawPushButton( QPushButton* btn, QPainter *p) -{ - int stateId = PBS_NORMAL; - if (!btn->isEnabled()){ - stateId = PBS_DISABLED; - }else if ((btn->isToggleButton() && btn->isOn()) || btn->isDown()){ - stateId = PBS_PRESSED; - }else if (btn == d->hotWidget){ - stateId = PBS_HOT; - }else if (btn->isDefault()){ - stateId = PBS_DEFAULTED; - } - - XPThemeData theme( 0, p, "BUTTON", BP_PUSHBUTTON, - stateId, QRect(btn->rect())); - if ( !theme.isValid() ) { - QWindowsStyle::drawPushButton(btn, p); - return; - } - theme.drawBackground(); -} - -class QMyScrollBar : public QScrollBar -{ -public: - int sliderStart() const { return QScrollBar::sliderStart(); } -private: - QMyScrollBar(); -}; - -void QWindowsXPStyle::drawScrollBarControls( QPainter *p, const QScrollBar *sbar, - int sliderStart, uint controls, - uint activeControl ) -{ - QMyScrollBar *bar = (QMyScrollBar*)sbar; - int sliderstart = 0; - - int s = bar->orientation() == Qt::Horizontal ? - QApplication::globalStrut().height() - : QApplication::globalStrut().width(); - int sbextent = QMAX( 16, s ); - int maxlen = ((bar->orientation() == Qt::Horizontal) ? - bar->width() : bar->height()) - (sbextent * 2); - int sliderlen; - - sliderstart = bar->sliderStart(); - - // calculate slider length - if (bar->maxValue() != bar->minValue()) { - uint range = bar->maxValue() - bar->minValue(); - sliderlen = (bar->pageStep() * maxlen) / - (range + bar->pageStep()); - - int slidermin = 9; - if ( sliderlen < slidermin || range > INT_MAX / 2 ) - sliderlen = slidermin; - if ( sliderlen > maxlen ) - sliderlen = maxlen; - } else - sliderlen = maxlen; - - int partId = 0; - int stateId = 0; - XPThemeData theme( bar, p, "SCROLLBAR" ); - - if ( !theme.isValid() ){ - QWindowsStyle::drawScrollBarControls(p, sbar, sliderStart, controls, activeControl); - return; - } - - bool maxedOut = ( bar->maxValue() == bar->minValue() ); - if ( controls & AddLine ) { - QRect rc; - if (bar->orientation() == Qt::Horizontal) - rc = QRect(bar->width() - sbextent, 0, sbextent, sbextent); - else - rc = QRect(0, bar->height() - sbextent, sbextent, sbextent); - theme.rec = rc; - partId = SBP_ARROWBTN; - if ( maxedOut ) - stateId = ABS_DOWNDISABLED; - else if ( activeControl == AddLine ) - stateId = ABS_DOWNPRESSED; - else if ( theme.rec.contains( d->hotSpot ) ) - stateId = ABS_DOWNHOT; - else - stateId = ABS_DOWNNORMAL; - if ( bar->orientation() == Qt::Horizontal ) - stateId += 8; - theme.drawBackground( partId, stateId ); - } - if ( controls & SubLine ) { - QRect rc(0, 0, sbextent, sbextent); - theme.rec = rc; - partId = SBP_ARROWBTN; - if ( maxedOut ) - stateId = ABS_UPDISABLED; - else if ( activeControl == SubLine ) - stateId = ABS_UPPRESSED; - else if ( theme.rec.contains( d->hotSpot ) ) - stateId = ABS_UPHOT; - else - stateId = ABS_UPNORMAL; - if ( bar->orientation() == Qt::Horizontal ) - stateId += 8; - theme.drawBackground( partId, stateId ); - } - if ( maxedOut ) { - if (bar->orientation() == Qt::Horizontal){ - theme.rec = QRect(sliderstart, 0, sliderlen, sbextent); - theme.rec = theme.rec.unite(QRect(sbextent, 0, sliderstart - sbextent, sbextent)); - theme.rec = theme.rec.unite(QRect(sliderstart + sliderlen, 0, maxlen - sliderstart - sliderlen + sbextent, sbextent)); - partId = SBP_LOWERTRACKHORZ; - }else{ - theme.rec = QRect(0, sliderstart, sbextent, sliderlen); - theme.rec = theme.rec.unite(QRect(0, sbextent, sbextent, sliderstart - sbextent)); - theme.rec = theme.rec.unite(QRect(0, sliderstart + sliderlen, sbextent, maxlen - sliderstart - sliderlen + sbextent)); - partId = SBP_LOWERTRACKVERT; - } - stateId = SCRBS_DISABLED; - theme.drawBackground( partId, stateId ); - } else { - if ( controls & AddPage ) { - if (bar->orientation() == Qt::Horizontal){ - theme.rec = QRect(sliderstart + sliderlen, 0, - maxlen - sliderstart - sliderlen + sbextent, sbextent); - partId = SBP_LOWERTRACKHORZ; - }else{ - theme.rec = QRect(0, sliderstart + sliderlen, - sbextent, maxlen - sliderstart - sliderlen + sbextent); - partId = SBP_LOWERTRACKVERT; - } - if ( !bar->isEnabled() ) - stateId = SCRBS_DISABLED; - else if ( activeControl == AddPage ) - stateId = SCRBS_PRESSED; - else if ( theme.rec.contains( d->hotSpot ) ) - stateId = SCRBS_HOT; - else - stateId = SCRBS_NORMAL; - theme.drawBackground( partId, stateId ); - } - if ( controls & SubPage ) { - if (bar->orientation() == Qt::Horizontal){ - theme.rec = QRect(sbextent, 0, sliderstart - sbextent, sbextent); - partId = SBP_UPPERTRACKHORZ; - }else{ - theme.rec = QRect(0, sbextent, sbextent, sliderstart - sbextent); - partId = SBP_UPPERTRACKVERT; - } - if ( !bar->isEnabled() ) - stateId = SCRBS_DISABLED; - else if ( activeControl == AddPage ) - stateId = SCRBS_PRESSED; - else if ( theme.rec.contains( d->hotSpot ) ) - stateId = SCRBS_HOT; - else - stateId = SCRBS_NORMAL; - theme.drawBackground( partId, stateId ); - } - if ( controls & Slider ) { - if (bar->orientation() == Qt::Horizontal) - theme.rec = QRect(sliderstart, 0, sliderlen, sbextent); - else - theme.rec = QRect(0, sliderstart, sbextent, sliderlen); - if ( !bar->isEnabled() ) - stateId = SCRBS_DISABLED; - else if ( activeControl == Slider ) - stateId = SCRBS_PRESSED; - else if ( theme.rec.contains( d->hotSpot ) ) - stateId = SCRBS_HOT; - else - stateId = SCRBS_NORMAL; - const int swidth = theme.rec.width(); - const int sheight = theme.rec.height(); - theme.drawBackground((bar->orientation() == Qt::Horizontal) ? SBP_THUMBBTNHORZ : SBP_THUMBBTNVERT, stateId ); - QRect gr; - if ( bar->orientation() == Qt::Horizontal ) { - gr.setLeft( theme.rec.left() + swidth/2 - 5 ); - gr.setRight( gr.left() + 10 ); - gr.setTop( theme.rec.top() + sheight/2 - 3 ); - gr.setBottom( gr.top() + 6 ); - } else { - gr.setLeft( theme.rec.left() + swidth/2 - 3 ); - gr.setRight( gr.left() + 6 ); - gr.setTop( theme.rec.top() + sheight/2 - 5 ); - gr.setBottom( gr.top() + 10 ); - } - theme.rec = gr; - theme.drawBackground( (bar->orientation() == Qt::Horizontal ) ? SBP_GRIPPERHORZ : SBP_GRIPPERVERT, 1 ); - } - } -} - -QSize QWindowsXPStyle::exclusiveIndicatorSize() const -{ - XPThemeData theme( 0, 0, "BUTTON", BP_RADIOBUTTON, RBS_UNCHECKEDNORMAL ); - if ( theme.isValid() ) { - SIZE size; - GetThemePartSize( theme.handle(), NULL, theme.partId, theme.stateId, 0, TS_TRUE, &size ); - return QSize(size.cx+2, size.cy+2); - } - return QWindowsStyle::indicatorSize(); -} - -void QWindowsXPStyle::drawExclusiveIndicator( QPainter* p, int x, int y, int w, int h, - const QColorGroup &g, bool on, bool down, bool enabled) -{ - int stateId = 0; - if ( !enabled ) - stateId = RBS_UNCHECKEDDISABLED; - else if ( down ) - stateId = RBS_UNCHECKEDPRESSED; - else if ( d->currentWidget && (d->currentWidget == d->hotWidget) && d->currentWidget->inherits("QRadioButton") ) - stateId = RBS_UNCHECKEDHOT; - else - stateId = RBS_UNCHECKEDNORMAL; - if ( on ) - stateId += RBS_CHECKEDNORMAL-1; - - QPixmap pict(w, h); - QPainter pp(&pict); - pp.setBackgroundColor(qApp->palette().active().background()); - pp.eraseRect(0, 0, w, h); - if (d->currentWidget){ - QWidget *parent; - for (parent = d->currentWidget->parentWidget(); parent; parent = parent->parentWidget()){ - if (parent->backgroundPixmap()) - break; - if (parent == d->currentWidget->topLevelWidget()){ - parent = NULL; - break; - } - } - if (parent){ - QPoint pos = d->currentWidget->mapToGlobal(QPoint(0, 0)); - pos = parent->mapFromGlobal(pos); - pp.drawTiledPixmap(0, 0, w, h, *parent->backgroundPixmap(), pos.x(), pos.y()); - } - } - XPThemeData theme( 0, &pp, "BUTTON", BP_RADIOBUTTON, stateId, QRect(0, 0, w, h)); - if ( !theme.isValid() ) { - QWindowsStyle::drawExclusiveIndicator( p, x, y, w, h, g, on, down, enabled); - return; - } - theme.drawBackground(); - pp.end(); - p->drawPixmap(x, y, pict); -} - -void QWindowsXPStyle::drawExclusiveIndicatorMask( QPainter *p, int x, int y, int w, int h, bool on) -{ - QRect rect = QRect(x, y, w - 1, h - 2); - XPThemeData theme(0, p, "BUTTON", BP_RADIOBUTTON, RBS_UNCHECKEDNORMAL, rect); - HRGN rgn = theme.mask(); - - if ( !rgn ) { - p->save(); - p->setBrush( color1 ); - p->setPen( QPen( NoPen ) ); - p->drawEllipse( x, y, w, h); - p->restore(); - return; - } - p->save(); - p->setBrush( color1 ); - PaintRgn( p->handle(), rgn ); - p->restore(); -} - -QSize QWindowsXPStyle::indicatorSize() const -{ - XPThemeData theme( 0, 0, "BUTTON", BP_CHECKBOX, CBS_UNCHECKEDNORMAL); - if ( theme.isValid() ) { - SIZE size; - GetThemePartSize( theme.handle(), NULL, theme.partId, theme.stateId, 0, TS_TRUE, &size ); - return QSize(size.cx+2, size.cy+2); - } - return QWindowsStyle::indicatorSize(); -} - -void QWindowsXPStyle::drawIndicator( QPainter* p, int x, int y, int w, int h, const QColorGroup &g, - int state, bool down, bool enabled) -{ - int stateId = 0; - if ( !enabled ) - stateId = CBS_UNCHECKEDDISABLED; - else if ( down ) - stateId = CBS_UNCHECKEDPRESSED; - else if ( d->currentWidget && (d->currentWidget == d->hotWidget)) - stateId = CBS_UNCHECKEDHOT; - else - stateId = CBS_UNCHECKEDNORMAL; - if ( state == QButton::On ) - stateId += CBS_CHECKEDNORMAL-1; - else if ( state == QButton::NoChange ) - stateId += CBS_MIXEDNORMAL-1; - - XPThemeData theme( 0, p, "BUTTON", BP_CHECKBOX, stateId, QRect(x, y, w, h)); - if ( !theme.isValid() ) { - QWindowsStyle::drawIndicator( p, x, y, w, h, g, state, down, enabled); - return; - } - theme.drawBackground(); -} - -void QWindowsXPStyle::drawIndicatorMask( QPainter *p, int x, int y, int w, int h, int state) -{ - QRect rect = QRect(x, y, w, h); - XPThemeData theme(0, p, "BUTTON", BP_CHECKBOX, CBS_UNCHECKEDNORMAL, rect); - HRGN rgn = theme.mask(); - - if ( !rgn ) { - QWindowsStyle::drawButtonMask( p, x + 1, y + 1, w - 2, h - 2); - return; - } - p->save(); - p->setBrush( color1 ); - PaintRgn( p->handle(), rgn ); - p->restore(); -} - -void QWindowsXPStyle::drawComboButton( QPainter *p, int x, int y, int w, int h, - const QColorGroup &g, bool sunken, bool editable, - bool enabled, const QBrush *fill) -{ - int partId = 0; - int stateId = 0; - partId = EP_EDITTEXT; - if ( !enabled ) - stateId = ETS_DISABLED; - else - stateId = ETS_NORMAL; - XPThemeData theme1( 0, p, "EDIT", partId, stateId, QRect(x, y, w, h) ); - if (!theme1.isValid()){ - QWindowsStyle::drawComboButton(p, x, y, w, h, g, sunken, editable, enabled, fill); - return; - } - - theme1.drawBackground(); - XPThemeData theme( 0, p, "COMBOBOX" ); - int xpos = x; - xpos += w - 2 - 16; - theme.rec = QRect(xpos, y+2, 16, h-4); - partId = CP_DROPDOWNBUTTON; - - if ( !enabled ) - stateId = CBXS_DISABLED; - else if ( sunken ) - stateId = CBXS_PRESSED; - else if ((d->currentWidget == d->hotWidget) && theme.rec.contains( d->hotSpot ) ) - stateId = CBXS_HOT; - else - stateId = CBXS_NORMAL; - - theme.drawBackground( partId, stateId ); -} - -void QWindowsXPStyle::drawPopupPanel(QPainter *p, int x, int y, int w, int h, - const QColorGroup &cg, int lineWidth, const QBrush* fill) -{ - if (d->currentWidget && - (d->currentWidget->inherits("QLineEdit") || - d->currentWidget->inherits("QScrollView"))) - { - int stateId = ETS_NORMAL; - if (!d->currentWidget->isEnabled()) stateId = ETS_DISABLED; - if (d->currentWidget->hasFocus()) stateId = ETS_FOCUSED; - - XPThemeData theme( 0, p, "EDIT", EP_EDITTEXT, stateId, QRect(x, y, w, h)); - if ( theme.isValid() ) { - theme.drawBackground(); - return; - } - } - QWindowsStyle::drawPopupPanel(p, x, y, w, h, cg, lineWidth, fill); -} - -void QWindowsXPStyle::drawPanel( QPainter *p, int x, int y, int w, int h, - const QColorGroup &cg, bool sunken, int lineWidth, const QBrush *fill) -{ - if (d->currentWidget && - (d->currentWidget->inherits("QLineEdit") || - d->currentWidget->inherits("QScrollView"))) - { - int stateId = ETS_NORMAL; - if (!d->currentWidget->isEnabled()) stateId = ETS_DISABLED; - if (d->currentWidget->hasFocus()) stateId = ETS_FOCUSED; - XPThemeData theme( 0, p, "EDIT", EP_EDITTEXT, stateId, QRect(x, y, w, h)); - if ( theme.isValid() ) { - theme.drawBackground(); - return; - } - } - QWindowsStyle::drawPanel(p, x, y, w, h, cg, sunken, lineWidth, fill); -} - -void QWindowsXPStyle::drawTab( QPainter *p, const QTabBar *tbar, QTab *t, bool selected ) -{ - QRect rect( t->r ); - QMyTabBar *bar = (QMyTabBar*)tbar; - int partId = 0; - int stateId = 0; - int c = bar->currentIndex(); - int idx = bar->indexOf( t ); - int aidx = bar->indexOf( bar->tab(bar->currentTab()) ); - bar->setCurrentIndex(c); - if ( idx == 0 ) - partId = TABP_TABITEMLEFTEDGE; - else if ( idx == bar->count()-1 ) - partId = TABP_TABITEMRIGHTEDGE; - else - partId = TABP_TABITEM; - - bool inFocus = (t->id == tbar->keyboardFocusTab()); - - if ( !bar->isEnabled()) - stateId = TIS_DISABLED; - else if ( inFocus ) - stateId = TIS_FOCUSED; - else if ( selected ) - stateId = TIS_SELECTED; - else if ( t && d->hotTab == t ) - stateId = TIS_HOT; - else - stateId = TIS_NORMAL; - if ( selected || inFocus ){ - rect = QRect( rect.x(), rect.y() - 2, rect.width(), rect.height() + 2); - } else { - rect = QRect( rect.x(), rect.y(), rect.width(), rect.height() - 2); - if ( idx != aidx+1 ) - rect = QRect( rect.x() + 1, rect.y(), rect.width(), rect.height() ); - if ( idx != aidx-1 ) - rect = QRect( rect.x(), rect.y(), rect.width()-1, rect.height() ); - } - XPThemeData theme( bar, p, "TAB", partId, stateId, rect ); - if ( !theme.isValid() ) { - QWindowsStyle::drawTab( p, bar, t, selected ); - return; - } - p->save(); - if ((tbar->shape() == QTabBar::RoundedBelow) || (tbar->shape() == QTabBar::TriangularBelow)){ - p->scale(1, -1); - p->translate(0, -rect.height() - rect.y()); - } - theme.drawBackground(); - p->restore(); -} - -void QWindowsXPStyle::drawTabMask( QPainter*, const QTabBar*, QTab*, bool selected ) -{ -} - -void QWindowsXPStyle::drawSlider ( QPainter * p, int x, int y, int w, int h, const QColorGroup & g, Orientation o, bool tickAbove, bool tickBelow ) -{ - QRect rc(x, y, w, h); - int partId = 0; - int stateId = 0; - if ( o == Horizontal ) { - partId = TKP_THUMB; - if (tickAbove) - partId = TKP_THUMBTOP; - if (tickBelow) - partId = TKP_THUMBBOTTOM; - stateId = TUS_NORMAL; - if (d->currentWidget){ - if (!d->currentWidget->isEnabled()) stateId = TUS_DISABLED; - if (d->currentWidget->hasFocus()) stateId = TUS_FOCUSED; - if ((d->currentWidget == d->hotWidget) && rc.contains(d->hotSpot)) - stateId = TUS_HOT; - } - } else { - partId = TKP_THUMBVERT; - if (tickAbove) - partId = TKP_THUMBLEFT; - if (tickBelow) - partId = TKP_THUMBRIGHT; - stateId = TUVS_NORMAL; - if (d->currentWidget){ - if (!d->currentWidget->isEnabled()) stateId = TUVS_DISABLED; - if (d->currentWidget->hasFocus()) stateId = TUVS_FOCUSED; - if ((d->currentWidget == d->hotWidget) && rc.contains(d->hotSpot)) - stateId = TUVS_HOT; - } - } - XPThemeData theme( NULL, p, "TRACKBAR", partId, stateId, rc); - if (!theme.isValid()){ - QWindowsStyle::drawSlider(p, x, y, w, h, g, o, tickAbove, tickBelow); - return; - } - theme.drawBackground(); -} - -void QWindowsXPStyle::drawSliderGroove ( QPainter * p, int x, int y, int w, int h, const QColorGroup & g, QCOORD c, Orientation o) -{ - QRect rc(x, y, w, h); - int partId = 0; - int stateId = 0; - if ( o == Horizontal ) { - partId = TKP_TRACK; - stateId = TRS_NORMAL; - } else { - partId = TKP_TRACKVERT; - stateId = TRVS_NORMAL; - } - XPThemeData theme( NULL, p, "TRACKBAR", partId, stateId, rc); - if (!theme.isValid()){ - QWindowsStyle::drawSliderGroove(p, x, y, w, h, g, c, o); - return; - } - theme.drawBackground(); -} - -void QWindowsXPStyle::drawPopupMenuItem( QPainter* p, bool checkable, - int maxpmw, int tab, QMenuItem* mi, - const QPalette& pal, - bool act, bool enabled, - int x, int y, int w, int h) -{ - int checkcol = 22; - QRect r(x, y, w, h); - QColorGroup cg = pal.active(); - if (act){ - p->setPen(cg.highlight()); - p->fillRect(x, y, w, h, enabled ? colorSel(cg) : colorMenu(pal.disabled())); - p->drawLine(x+1, y, x+w-2, y); - p->drawLine(x+1, y+h-1, x+w-2, y+h-1); - p->drawLine(x, y+1, x, y+h-2); - p->drawLine(x+w-1, y+1, x+w-1, y+h-2); - }else{ - drawMenuBackground(p, r, cg); - } - - int xpos = x; - int xm = itemFrame + checkcol + itemHMargin; - if (mi->isSeparator()) { - p->setPen(cg.mid()); - if ((int)(x + bitmapWidth + 2) < (int)(x + w - 2)) - p->drawLine(x + bitmapWidth + 2, y + h / 2, - x + w - 2, y + h / 2); - return; - } - - if (mi->iconSet()) { - p->save(); - QIconSet::Mode mode = - enabled ? QIconSet::Normal : QIconSet::Disabled; - QPixmap pixmap = mi->iconSet()->pixmap(QIconSet::Small, mode); - - QImage img; - QImage *image = NULL; - PictDef *def = getIcons()->getPict(pixmap); - if (def) - image = def->image; - if (image == NULL){ - img = pixmap.convertToImage(); - image = &img; - } - - int pixw = image->width(); - int pixh = image->height(); - - QRect cr(xpos, y, 22, h); - QRect pmr(0, 0, pixw, pixh); - if (checkable && mi->isChecked()){ - p->setPen(darkXp(enabled ? colorSel(cg) : colorMenu(pal.disabled()))); - p->drawLine(cr.x(), cr.y(), cr.x() + cr.width()-1, cr.y()); - p->drawLine(cr.x(), cr.y(), cr.x(), cr.y() + cr.height()); - p->setPen(colorMenu(cg)); - p->drawLine(cr.x(), cr.y()+cr.height()-1, - cr.x()+cr.width()-1, cr.y()+cr.height()-1); - cr.moveBy(1, 1); - } - pmr.moveCenter(cr.center()); - QPoint picPoint = pmr.topLeft(); - if (act && enabled){ - QImage img(image->width() + 2, image->height() + 2, 32); - unsigned int *data = (unsigned int*)(img.bits()); - unsigned int *from = (unsigned int*)(image->bits()); - QColor c1 = colorSel(cg); - unsigned char cr1 = c1.red(); - unsigned char cg1 = c1.green(); - unsigned char cb1 = c1.blue(); - QColor c2 = darkXp(colorSel(cg)); - unsigned char cr2 = c2.red(); - unsigned char cg2 = c2.green(); - unsigned char cb2 = c2.blue(); - unsigned i; - for (i = 0; i < (image->width() + 2) * (image->height() + 2); i++) - data[i] = qRgba(cr1, cg1, cb1, 0xFF); - unsigned int *f = from; - unsigned int *t = data + (image->width() + 2) * 2 + 2; - for (i = 0; i < image->height(); i++){ - for (unsigned j = 0; j < image->height(); j++){ - unsigned char a = qAlpha(*f); - *t = qRgba((cr2 * a + cr1 * (0xFF - a)) >> 8, - (cg2 * a + cg1 * (0xFF - a)) >> 8, - (cb2 * a + cb1 * (0xFF - a)) >> 8, 0xFF); - t++; - f++; - } - t += 2; - } - f = from; - t = data; - for (i = 0; i < image->height(); i++){ - for (unsigned j = 0; j < image->height(); j++){ - unsigned char a = qAlpha(*f); - *t = qRgba((qRed(*f) * a + qRed(*t) * (0xFF - a)) >> 8, - (qGreen(*f) * a + qGreen(*t) * (0xFF - a)) >> 8, - (qBlue(*f) * a + qBlue(*t) * (0xFF - a)) >> 8, 0xFF); - f++; - t++; - } - t += 2; - } - picPoint -= QPoint(1, 1); - p->drawImage(picPoint, img); - }else{ - QImage img(image->width(), image->height(), 32); - QColor c = colorBitmap(cg); - unsigned char cr = c.red(); - unsigned char cg = c.green(); - unsigned char cb = c.blue(); - unsigned int *data = (unsigned int*)(img.bits()); - unsigned int *from = (unsigned int*)(image->bits()); - for (unsigned i = 0; i < image->width() * image->height(); i++){ - unsigned char a = qAlpha(from[i]); - data[i] = qRgba((qRed(from[i]) * a + cr * (0xFF - a)) >> 8, - (qGreen(from[i]) * a + cg * (0xFF - a)) >> 8, - (qBlue(from[i]) * a + cb * (0xFF - a)) >> 8, 0xFF); - } - p->drawImage(picPoint, img); - } - p->setPen(cg.highlightedText()); - p->restore(); - - }else if (checkable && mi->isChecked()){ - p->setPen(cg.buttonText()); - drawCheckMark(p, xpos, y, bitmapWidth, h, cg, act, !enabled); - } - - xpos += xm; - if (mi->custom()) { - int m = itemVMargin; - p->save(); - p->setPen(cg.text()); - mi->custom()->paint(p, cg, act, enabled, - x+xm, y+m, w-xm-tab+1, h-2*m); - p->restore(); - return; - }else{ - QString s = mi->text(); - if(!s.isNull()) { - int t = s.find('\t'); - int m = itemVMargin; - - const int text_flags = - AlignVCenter | ShowPrefix | DontClip | SingleLine; - - if (enabled){ - p->setPen(cg.text()); - }else{ - p->setPen(pal.disabled().text()); - } - if (t >= 0) { - int xp; - xp = x + w - tab - rightBorder - itemHMargin - itemFrame + 1; - p->drawText(xp, y+m, tab, h-2*m, text_flags, s.mid(t+1)); - s = s.left(t); - } - p->drawText(xpos, y+m, w-xm-tab+1, h-2*m, text_flags, s); - } - } - if (mi->popup()) { - int dim = (h - 2 * itemFrame) / 2; - xpos = x+w - arrowHMargin - itemFrame - dim; - if (enabled){ - p->setPen(cg.text()); - }else{ - p->setPen(pal.disabled().text()); - } - drawArrow(p, RightArrow, false, xpos, y + h / 4, dim, dim, cg, enabled); - } -} - -QColor QWindowsXPStyle::mix(const QColor &c1, const QColor &c2, int k) const -{ - int r1, g1, b1; - int r2, g2, b2; - c1.rgb(&r1, &g1, &b1); - c2.rgb(&r2, &g2, &b2); - return QColor( - ((r1 * k) + (r2 * (100-k)))/100, - ((g1 * k) + (g2 * (100-k)))/100, - ((b1 * k) + (b2 * (100-k)))/100); -} - -QColor QWindowsXPStyle::colorMenu(const QColorGroup &cg) const -{ - return mix(cg.background(), cg.button(), 86).light(110); -} - -QColor QWindowsXPStyle::colorBitmap(const QColorGroup &cg) const -{ - return mix(cg.background(), cg.button(), 14).dark(120); -} - -QColor QWindowsXPStyle::colorSel(const QColorGroup &cg) const -{ - return mix(cg.background(), cg.highlight(), 70); -} - -QColor QWindowsXPStyle::darkXp(const QColor &c) const -{ - int r, g, b; - c.rgb(&r, &g, &b); - b = QMIN(b + 55, 255); - return mix(QColor(r, g, b), QColor(0, 0, 0), 70); -} - - -void QWindowsXPStyle::drawMenuBackground(QPainter *p, const QRect &rc, const QColorGroup &cg) const -{ - p->fillRect(rc, colorMenu(cg)); - QRect rcBitmap(0, rc.y(), bitmapWidth, rc.height()); - p->fillRect(rcBitmap, colorBitmap(cg)); -} - -void QWindowsXPStyle::activeTabChanged() -{ - const QObject *s = sender(); - if ( !s || !s->inherits( "QTabBar" ) ) - return; - - ((QWidget *)s)->repaint( FALSE ); -} - -/** - * DLL's entry point - **/ -int WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved) -{ - return TRUE; -} - -/** - * This is to prevent the CRT from loading, thus making this a smaller - * and faster dll. - **/ -extern "C" BOOL __stdcall _DllMainCRTStartup( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { - return DllMain( hinstDLL, fdwReason, lpvReserved ); -} - -#include "moc_xpstyle.cpp" - diff --git a/xpstyle/xpstyle.dsp b/xpstyle/xpstyle.dsp deleted file mode 100644 index 012812b07..000000000 --- a/xpstyle/xpstyle.dsp +++ /dev/null @@ -1,153 +0,0 @@ -# Microsoft Developer Studio Project File - Name="xpstyle" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=xpstyle - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "xpstyle.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "xpstyle.mak" CFG="xpstyle - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "xpstyle - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "xpstyle - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "xpstyle - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\Release_Wrk\plugins\style" -# PROP Intermediate_Dir "..\Release_Wrk" -# PROP Ignore_Export_Lib 1 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XPSTYLE_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /O2 /I "$(QTDIR)\include" /I "..\plugins\_core" /I "..\sim" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XPSTYLE_EXPORTS" /D "QT_DLL" /D "UNICODE" /D "QT_THREAD_SUPPORT" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x419 /d "NDEBUG" -# ADD RSC /l 0x417 /i ".." /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib wsock32.lib winspool.lib winmm.lib $(QTDIR)\lib\qt-mt230nc.lib uxtheme.lib ..\Release\sim.lib /nologo /dll /pdb:none /machine:I386 /out:"../Release/plugins/styles/xpstyle.dll" - -!ELSEIF "$(CFG)" == "xpstyle - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\Debug\plugins\styles" -# PROP Intermediate_Dir "..\Debug_Wrk" -# PROP Ignore_Export_Lib 1 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XPSTYLE_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /WX /Gm /ZI /Od /I "$(QTDIR)\include" /I "..\plugins\_core" /I "..\sim" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XPSTYLE_EXPORTS" /D "QT_DLL" /D "UNICODE" /D "QT_THREAD_SUPPORT" /FR /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x419 /d "_DEBUG" -# ADD RSC /l 0x417 /i ".." /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 $(QTDIR)\lib\qt-mt230nc.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib wsock32.lib winspool.lib winmm.lib uxtheme.lib ..\Debug\sim.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# SUBTRACT LINK32 /pdb:none - -!ENDIF - -# Begin Target - -# Name "xpstyle - Win32 Release" -# Name "xpstyle - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\xpstyle.cpp -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\kpopup.h -# End Source File -# Begin Source File - -SOURCE=.\xpstyle.h - -!IF "$(CFG)" == "xpstyle - Win32 Release" - -# PROP Ignore_Default_Tool 1 -# Begin Custom Build - MOCing xpstyle.h... -InputDir=. -InputPath=.\xpstyle.h -InputName=xpstyle - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ELSEIF "$(CFG)" == "xpstyle - Win32 Debug" - -# PROP Ignore_Default_Tool 1 -# Begin Custom Build - MOCing xpstyle.h... -InputDir=. -InputPath=.\xpstyle.h -InputName=xpstyle - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ENDIF - -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# Begin Source File - -SOURCE=.\icq.ico -# End Source File -# Begin Source File - -SOURCE=.\xpstyle.rc -# End Source File -# End Group -# End Target -# End Project diff --git a/xpstyle/xpstyle.h b/xpstyle/xpstyle.h deleted file mode 100644 index 66c206ef5..000000000 --- a/xpstyle/xpstyle.h +++ /dev/null @@ -1,105 +0,0 @@ -/*************************************************************************** - xpstyle.h - description - ------------------- - begin : Sun Mar 17 2002 - copyright : (C) 2002 by Vladimir Shutoff - email : vovan@shutoff.ru - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef _XPSTYLE_H -#define _XPSTYLE_H - -#if defined(_MSC_VER) && defined(_DEBUG) && !defined(NO_CHECK_NEW) -#ifndef _CRTDBG_MAP_ALLOC -#define _CRTDBG_MAP_ALLOC -#endif -#include <stdlib.h> -#include <crtdbg.h> -#define new new(_NORMAL_BLOCK, __FILE__, __LINE__) -#endif - -#include <qwindowsstyle.h> - -class QWindowsXPStylePrivate; - -class QWindowsXPStyle: public QWindowsStyle -{ - Q_OBJECT -public: - QWindowsXPStyle(); - virtual ~QWindowsXPStyle(); - void polish( QApplication *app ); - void unPolish( QApplication *app ); - void polish( QWidget *widget ); - void unPolish( QWidget *widget ); - void updateRegion( QWidget *widget ); - virtual void drawButton( QPainter *p, int x, int y, int w, int h, - const QColorGroup &g, bool sunken = FALSE, - const QBrush *fill = 0 ); - virtual void drawBevelButton( QPainter *p, int x, int y, int w, int h, - const QColorGroup &g, bool sunken = FALSE, - const QBrush *fill = 0 ); - virtual void drawButtonMask( QPainter *p, int x, int y, int w, int h); - virtual void drawPushButton( QPushButton* btn, QPainter *p); - virtual void drawToolButton( QPainter *p, int x, int y, int w, int h, - const QColorGroup &g, bool sunken = FALSE, - const QBrush *fill = 0 ); - virtual QSize exclusiveIndicatorSize() const; - virtual void drawExclusiveIndicator( QPainter* p, int x, int y, int w, int h, - const QColorGroup &g, bool on, bool down = FALSE, bool enabled = TRUE ); - virtual void drawExclusiveIndicatorMask( QPainter *p, int x, int y, int w, int h, bool on); - virtual QSize indicatorSize() const ; - virtual void drawIndicator( QPainter* p, int x, int y, int w, int h, const QColorGroup &g, - int state, bool down = FALSE, bool enabled = TRUE ); - virtual void drawIndicatorMask( QPainter *p, int x, int y, int w, int h, int state); - virtual void drawScrollBarControls( QPainter*, const QScrollBar*, - int sliderStart, uint controls, - uint activeControl ); - virtual void drawComboButton( QPainter *p, int x, int y, int w, int h, - const QColorGroup &g, bool sunken = FALSE, - bool editable = FALSE, - bool enabled = TRUE, - const QBrush *fill = 0 ); - virtual void drawPanel( QPainter *p, int x, int y, int w, int h, - const QColorGroup &, bool sunken=FALSE, - int lineWidth = 1, const QBrush *fill = 0 ); - virtual void drawPopupPanel( QPainter *p, int x, int y, int w, int h, - const QColorGroup &, int lineWidth = 2, - const QBrush *fill = 0 ); - // virtual void tabbarMetrics( const QTabBar*, int&, int&, int& ); - virtual void drawTab( QPainter*, const QTabBar*, QTab*, bool selected ); - virtual void drawTabMask( QPainter*, const QTabBar*, QTab*, bool selected ); - virtual void drawPopupMenuItem( QPainter* p, bool checkable, - int maxpmw, int tab, QMenuItem* mi, - const QPalette& pal, - bool act, bool enabled, - int x, int y, int w, int h); - virtual void drawSlider ( QPainter * p, int x, int y, int w, int h, const QColorGroup & g, Orientation, bool tickAbove, bool tickBelow ); - virtual void drawSliderGroove ( QPainter * p, int x, int y, int w, int h, const QColorGroup & g, QCOORD c, Orientation ); -protected slots: - void activeTabChanged(); -protected: - bool eventFilter( QObject *o, QEvent *e ); - QWindowsXPStylePrivate *d; - QColor colorMenu(const QColorGroup &cg) const; - QColor colorBitmap(const QColorGroup &cg) const; - QColor colorSel(const QColorGroup &cg) const; - QColor darkXp(const QColor &c) const; - QColor shiftColor( const QColor &c, int value, bool bXp=true) const; - QColor mix(const QColor &c1, const QColor &c2, int k) const; - void drawMenuBackground(QPainter *p, - const QRect &rc, - const QColorGroup &cg) const; -}; - -#endif - diff --git a/xpstyle/xpstyle.rc b/xpstyle/xpstyle.rc deleted file mode 100644 index b5c8a2293..000000000 --- a/xpstyle/xpstyle.rc +++ /dev/null @@ -1,97 +0,0 @@ -//Microsoft Developer Studio generated resource script. -// -#include "resource.h" -///////////////////////////////////////////////////////////////////////////// -// Neutral resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU) -#ifdef _WIN32 -LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL -#pragma code_page(1251) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -#ifndef _MAC -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,9,4,0 - PRODUCTVERSION 0,9,4,0 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x40004L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "000004b0" - BEGIN - VALUE "Comments", "\0" - VALUE "CompanyName", "Vladimir Shutoff\0" - VALUE "FileDescription", "xpstyle\0" - VALUE "FileVersion", "0, 9, 4, 0\0" - VALUE "InternalName", "xpstyle\0" - VALUE "LegalCopyright", "Copyright © 2002-2003\0" - VALUE "LegalTrademarks", "\0" - VALUE "OriginalFilename", "xpstyle.dll\0" - VALUE "PrivateBuild", "\0" - VALUE "ProductName", "SIM\0" - VALUE "ProductVersion", "0, 9, 4, 0\0" - VALUE "SpecialBuild", "\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x0, 1200 - END -END - -#endif // !_MAC - -#endif // Neutral resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - |
