https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2b5f38295bd1420b55dda…
commit 2b5f38295bd1420b55ddaaab57e539c863fca3b0
Author: Andreas Maier <staubim(a)quantentunnel.de>
AuthorDate: Fri Jun 21 11:58:07 2019 +0200
Commit: Mark Jansen <mark.jansen(a)reactos.org>
CommitDate: Sat Aug 17 12:08:04 2019 +0200
[COMCTL32] remove unused theme_*.c files.
---
dll/win32/comctl32/theme_button.c | 495 -------------------------------------
dll/win32/comctl32/theme_combo.c | 308 -----------------------
dll/win32/comctl32/theme_dialog.c | 141 -----------
dll/win32/comctl32/theme_edit.c | 130 ----------
dll/win32/comctl32/theme_listbox.c | 112 ---------
5 files changed, 1186 deletions(-)
diff --git a/dll/win32/comctl32/theme_button.c b/dll/win32/comctl32/theme_button.c
deleted file mode 100644
index 2864b8b6658..00000000000
--- a/dll/win32/comctl32/theme_button.c
+++ /dev/null
@@ -1,495 +0,0 @@
-/*
- * Theming - Button control
- *
- * Copyright (c) 2008 by Reece H. Dunn
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- *
- */
-
-#include "comctl32.h"
-WINE_DEFAULT_DEBUG_CHANNEL(theme_button);
-
-#define BUTTON_TYPE 0x0f /* bit mask for the available button types */
-
-#if 0
-
-/* These are indices into a states array to determine the theme state for a given theme
part. */
-typedef enum
-{
- STATE_NORMAL,
- STATE_HOT,
- STATE_PRESSED,
- STATE_DISABLED,
- STATE_DEFAULTED
-} ButtonState;
-
-#ifdef __REACTOS__ /* r73885 */
-typedef void (*pfThemedPaint)(HTHEME theme, HWND hwnd, HDC hdc, ButtonState drawState,
UINT dtFlags, BOOL focused, LPARAM prfFlag);
-#else
-typedef void (*pfThemedPaint)(HTHEME theme, HWND hwnd, HDC hdc, ButtonState drawState,
UINT dtFlags, BOOL focused);
-#endif
-
-#ifdef __REACTOS__ /* r73885 & r73907 */
-static inline LONG get_button_state( HWND hwnd )
-{
- return _GetButtonData(hwnd)->state;
-}
-
-static inline HFONT get_button_font( HWND hwnd )
-{
- return (HFONT)_GetButtonData(hwnd)->font;
-}
-
-static inline LONG_PTR get_button_image(HWND hwnd)
-{
- return _GetButtonData(hwnd)->image;
-}
-
-BOOL BUTTON_DrawIml(HDC hdc, BUTTON_IMAGELIST *pimlData, RECT *prc, BOOL bOnlyCalc, int
index);
-DWORD BUTTON_SendCustomDraw(HWND hwnd, HDC hDC, DWORD dwDrawStage, RECT* prc);
-#endif
-
-static UINT get_drawtext_flags(DWORD style, DWORD ex_style)
-{
- UINT flags = 0;
-
- if (style & BS_PUSHLIKE)
- style &= ~BUTTON_TYPE;
-
- if (!(style & BS_MULTILINE))
- flags |= DT_SINGLELINE;
- else
- flags |= DT_WORDBREAK;
-
- switch (style & BS_CENTER)
- {
- case BS_LEFT: flags |= DT_LEFT; break;
- case BS_RIGHT: flags |= DT_RIGHT; break;
- case BS_CENTER: flags |= DT_CENTER; break;
- default:
- flags |= ((style & BUTTON_TYPE) <= BS_DEFPUSHBUTTON)
- ? DT_CENTER : DT_LEFT;
- }
-
- if (ex_style & WS_EX_RIGHT)
- flags = DT_RIGHT | (flags & ~(DT_LEFT | DT_CENTER));
-
- if ((style & BUTTON_TYPE) != BS_GROUPBOX)
- {
- switch (style & BS_VCENTER)
- {
- case BS_TOP: flags |= DT_TOP; break;
- case BS_BOTTOM: flags |= DT_BOTTOM; break;
- case BS_VCENTER: /* fall through */
- default: flags |= DT_VCENTER; break;
- }
- }
- else
- /* GroupBox's text is always single line and is top aligned. */
- flags |= DT_SINGLELINE | DT_TOP;
-
- return flags;
-}
-
-static inline WCHAR *get_button_text(HWND hwnd)
-{
- INT len = 512;
- WCHAR *text;
- text = HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR));
- if (text) InternalGetWindowText(hwnd, text, len + 1);
- return text;
-}
-
-static void PB_draw(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawState, UINT
dtFlags, BOOL focused, LPARAM prfFlag)
-{
- static const int states[] = { PBS_NORMAL, PBS_HOT, PBS_PRESSED, PBS_DISABLED,
PBS_DEFAULTED };
-
- RECT bgRect, textRect;
- HFONT font = get_button_font(hwnd);
- HFONT hPrevFont = font ? SelectObject(hDC, font) : NULL;
- int state = states[ drawState ];
- WCHAR *text;
- PBUTTON_DATA pdata = _GetButtonData(hwnd);
- HWND parent;
- DWORD cdrf;
-
- GetClientRect(hwnd, &bgRect);
- GetThemeBackgroundContentRect(theme, hDC, BP_PUSHBUTTON, state, &bgRect,
&textRect);
-
- if (prfFlag == 0)
- {
- if (IsThemeBackgroundPartiallyTransparent(theme, BP_PUSHBUTTON, state))
- DrawThemeParentBackground(hwnd, hDC, NULL);
- }
-
- parent = GetParent(hwnd);
- if (!parent) parent = hwnd;
- SendMessageW( parent, WM_CTLCOLORBTN, (WPARAM)hDC, (LPARAM)hwnd );
-
- cdrf = BUTTON_SendCustomDraw(hwnd, hDC, CDDS_PREERASE, &bgRect);
- if (cdrf == CDRF_SKIPDEFAULT)
- goto cleanup;
-
- DrawThemeBackground(theme, hDC, BP_PUSHBUTTON, state, &bgRect, NULL);
-
- if (cdrf == CDRF_NOTIFYPOSTERASE)
- BUTTON_SendCustomDraw(hwnd, hDC, CDDS_POSTERASE, &bgRect);
-
- cdrf = BUTTON_SendCustomDraw(hwnd, hDC, CDDS_PREPAINT, &bgRect);
- if (cdrf == CDRF_SKIPDEFAULT)
- goto cleanup;
-
- BUTTON_DrawIml(hDC, &pdata->imlData, &textRect, FALSE, drawState);
-
- text = get_button_text(hwnd);
- if (text)
- {
- DrawThemeText(theme, hDC, BP_PUSHBUTTON, state, text, lstrlenW(text), dtFlags, 0,
&textRect);
- HeapFree(GetProcessHeap(), 0, text);
- }
-
- if (focused)
- {
- MARGINS margins;
- RECT focusRect = bgRect;
-
- GetThemeMargins(theme, hDC, BP_PUSHBUTTON, state, TMT_CONTENTMARGINS, NULL,
&margins);
-
- focusRect.left += margins.cxLeftWidth;
- focusRect.top += margins.cyTopHeight;
- focusRect.right -= margins.cxRightWidth;
- focusRect.bottom -= margins.cyBottomHeight;
-
- DrawFocusRect( hDC, &focusRect );
- }
-
- if (cdrf == CDRF_NOTIFYPOSTPAINT)
- BUTTON_SendCustomDraw(hwnd, hDC, CDDS_POSTPAINT, &bgRect);
-
-cleanup:
- if (hPrevFont) SelectObject(hDC, hPrevFont);
-}
-
-static void CB_draw(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawState, UINT
dtFlags, BOOL focused, LPARAM prfFlag)
-{
- static const int cb_states[3][5] =
- {
- { CBS_UNCHECKEDNORMAL, CBS_UNCHECKEDHOT, CBS_UNCHECKEDPRESSED,
CBS_UNCHECKEDDISABLED, CBS_UNCHECKEDNORMAL },
- { CBS_CHECKEDNORMAL, CBS_CHECKEDHOT, CBS_CHECKEDPRESSED, CBS_CHECKEDDISABLED,
CBS_CHECKEDNORMAL },
- { CBS_MIXEDNORMAL, CBS_MIXEDHOT, CBS_MIXEDPRESSED, CBS_MIXEDDISABLED,
CBS_MIXEDNORMAL }
- };
-
- static const int rb_states[2][5] =
- {
- { RBS_UNCHECKEDNORMAL, RBS_UNCHECKEDHOT, RBS_UNCHECKEDPRESSED,
RBS_UNCHECKEDDISABLED, RBS_UNCHECKEDNORMAL },
- { RBS_CHECKEDNORMAL, RBS_CHECKEDHOT, RBS_CHECKEDPRESSED, RBS_CHECKEDDISABLED,
RBS_CHECKEDNORMAL }
- };
-
- SIZE sz;
- RECT bgRect, textRect;
- HFONT font, hPrevFont = NULL;
- LRESULT checkState = get_button_state(hwnd) & 3;
- DWORD dwStyle = GetWindowLongW(hwnd, GWL_STYLE);
- int part = ((dwStyle & BUTTON_TYPE) == BS_RADIOBUTTON) || ((dwStyle &
BUTTON_TYPE) == BS_AUTORADIOBUTTON)
- ? BP_RADIOBUTTON
- : BP_CHECKBOX;
- int state = (part == BP_CHECKBOX)
- ? cb_states[ checkState ][ drawState ]
- : rb_states[ checkState ][ drawState ];
- WCHAR *text;
- LOGFONTW lf;
- BOOL created_font = FALSE;
- HWND parent;
- HBRUSH hBrush;
- DWORD cdrf;
-
- HRESULT hr = GetThemeFont(theme, hDC, part, state, TMT_FONT, &lf);
- if (SUCCEEDED(hr)) {
- font = CreateFontIndirectW(&lf);
- if (!font)
- TRACE("Failed to create font\n");
- else {
- TRACE("font = %s\n", debugstr_w(lf.lfFaceName));
- hPrevFont = SelectObject(hDC, font);
- created_font = TRUE;
- }
- } else {
- font = get_button_font(hwnd);
- hPrevFont = SelectObject(hDC, font);
- }
-
- if (FAILED(GetThemePartSize(theme, hDC, part, state, NULL, TS_DRAW, &sz)))
- sz.cx = sz.cy = 13;
-
- GetClientRect(hwnd, &bgRect);
-
- if (prfFlag == 0)
- {
- DrawThemeParentBackground(hwnd, hDC, NULL);
- }
-
- parent = GetParent(hwnd);
- if (!parent) parent = hwnd;
- hBrush = (HBRUSH)SendMessageW(parent, WM_CTLCOLORSTATIC,
- (WPARAM)hDC, (LPARAM)hwnd);
- if (!hBrush) /* did the app forget to call defwindowproc ? */
- hBrush = (HBRUSH)DefWindowProcW(parent, WM_CTLCOLORSTATIC,
- (WPARAM)hDC, (LPARAM)hwnd );
- FillRect( hDC, &bgRect, hBrush );
-
- cdrf = BUTTON_SendCustomDraw(hwnd, hDC, CDDS_PREERASE, &bgRect);
- if (cdrf == CDRF_SKIPDEFAULT)
- goto cleanup;
-
- GetThemeBackgroundContentRect(theme, hDC, part, state, &bgRect, &textRect);
-
- if (dtFlags & DT_SINGLELINE) /* Center the checkbox / radio button to the text.
*/
- bgRect.top = bgRect.top + (textRect.bottom - textRect.top - sz.cy) / 2;
-
- /* adjust for the check/radio marker */
- bgRect.bottom = bgRect.top + sz.cy;
- bgRect.right = bgRect.left + sz.cx;
- textRect.left = bgRect.right + 6;
-
- DrawThemeBackground(theme, hDC, part, state, &bgRect, NULL);
-
- if (cdrf == CDRF_NOTIFYPOSTERASE)
- BUTTON_SendCustomDraw(hwnd, hDC, CDDS_POSTERASE, &bgRect);
-
- cdrf = BUTTON_SendCustomDraw(hwnd, hDC, CDDS_PREPAINT, &bgRect);
- if (cdrf == CDRF_SKIPDEFAULT)
- goto cleanup;
-
- text = get_button_text(hwnd);
- if (text)
- {
- DrawThemeText(theme, hDC, part, state, text, lstrlenW(text), dtFlags, 0,
&textRect);
-
- if (focused)
- {
- RECT focusRect;
-
- focusRect = textRect;
-
- DrawTextW(hDC, text, lstrlenW(text), &focusRect, dtFlags | DT_CALCRECT);
-
- if (focusRect.right < textRect.right) focusRect.right++;
- focusRect.bottom = textRect.bottom;
-
- DrawFocusRect( hDC, &focusRect );
- }
-
- HeapFree(GetProcessHeap(), 0, text);
- }
-
- if (cdrf == CDRF_NOTIFYPOSTPAINT)
- BUTTON_SendCustomDraw(hwnd, hDC, CDDS_POSTPAINT, &bgRect);
-
-cleanup:
- if (created_font) DeleteObject(font);
- if (hPrevFont) SelectObject(hDC, hPrevFont);
-}
-
-#ifdef __REACTOS__ /* r73885 */
-static void GB_draw(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawState, UINT
dtFlags, BOOL focused, LPARAM prfFlag)
-#else
-static void GB_draw(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawState, UINT
dtFlags, BOOL focused)
-#endif
-{
- static const int states[] = { GBS_NORMAL, GBS_NORMAL, GBS_NORMAL, GBS_DISABLED,
GBS_NORMAL };
-
- RECT bgRect, textRect, contentRect;
- int state = states[ drawState ];
- WCHAR *text = get_button_text(hwnd);
- LOGFONTW lf;
- HFONT font, hPrevFont = NULL;
- BOOL created_font = FALSE;
-#ifdef __REACTOS__ /* r74406 */
- HWND parent;
- HBRUSH hBrush;
- RECT clientRect;
-#endif
-
- HRESULT hr = GetThemeFont(theme, hDC, BP_GROUPBOX, state, TMT_FONT, &lf);
- if (SUCCEEDED(hr)) {
- font = CreateFontIndirectW(&lf);
- if (!font)
- TRACE("Failed to create font\n");
- else {
- hPrevFont = SelectObject(hDC, font);
- created_font = TRUE;
- }
- } else {
-#ifdef __REACTOS__ /* r73885 */
- font = get_button_font(hwnd);
-#else
- font = (HFONT)SendMessageW(hwnd, WM_GETFONT, 0, 0);
-#endif
- hPrevFont = SelectObject(hDC, font);
- }
-
- GetClientRect(hwnd, &bgRect);
- textRect = bgRect;
-
- if (text)
- {
- SIZE textExtent;
- GetTextExtentPoint32W(hDC, text, lstrlenW(text), &textExtent);
- bgRect.top += (textExtent.cy / 2);
- textRect.left += 10;
- textRect.bottom = textRect.top + textExtent.cy;
- textRect.right = textRect.left + textExtent.cx + 4;
-
- ExcludeClipRect(hDC, textRect.left, textRect.top, textRect.right,
textRect.bottom);
- }
-
- GetThemeBackgroundContentRect(theme, hDC, BP_GROUPBOX, state, &bgRect,
&contentRect);
- ExcludeClipRect(hDC, contentRect.left, contentRect.top, contentRect.right,
contentRect.bottom);
-
-#ifdef __REACTOS__ /* r73885 & r74149 */
- if (prfFlag == 0)
- {
- if (IsThemeBackgroundPartiallyTransparent(theme, BP_GROUPBOX, state))
- DrawThemeParentBackground(hwnd, hDC, NULL);
- }
-#else
- if (IsThemeBackgroundPartiallyTransparent(theme, BP_GROUPBOX, state))
- DrawThemeParentBackground(hwnd, hDC, NULL);
-#endif
-
-#ifdef __REACTOS__ /* r74406 */
- parent = GetParent(hwnd);
- if (!parent) parent = hwnd;
- hBrush = (HBRUSH)SendMessageW(parent, WM_CTLCOLORSTATIC,
- (WPARAM)hDC, (LPARAM)hwnd);
- if (!hBrush) /* did the app forget to call defwindowproc ? */
- hBrush = (HBRUSH)DefWindowProcW(parent, WM_CTLCOLORSTATIC,
- (WPARAM)hDC, (LPARAM)hwnd );
- GetClientRect(hwnd, &clientRect);
- FillRect( hDC, &clientRect, hBrush );
-#endif
-
- DrawThemeBackground(theme, hDC, BP_GROUPBOX, state, &bgRect, NULL);
-
- SelectClipRgn(hDC, NULL);
-
- if (text)
- {
- InflateRect(&textRect, -2, 0);
- DrawThemeText(theme, hDC, BP_GROUPBOX, state, text, lstrlenW(text), 0, 0,
&textRect);
- HeapFree(GetProcessHeap(), 0, text);
- }
-
- if (created_font) DeleteObject(font);
- if (hPrevFont) SelectObject(hDC, hPrevFont);
-}
-
-static const pfThemedPaint btnThemedPaintFunc[BUTTON_TYPE + 1] =
-{
- PB_draw, /* BS_PUSHBUTTON */
- PB_draw, /* BS_DEFPUSHBUTTON */
- CB_draw, /* BS_CHECKBOX */
- CB_draw, /* BS_AUTOCHECKBOX */
- CB_draw, /* BS_RADIOBUTTON */
- CB_draw, /* BS_3STATE */
- CB_draw, /* BS_AUTO3STATE */
- GB_draw, /* BS_GROUPBOX */
- NULL, /* BS_USERBUTTON */
- CB_draw, /* BS_AUTORADIOBUTTON */
- NULL, /* Not defined */
- NULL, /* BS_OWNERDRAW */
- NULL, /* Not defined */
- NULL, /* Not defined */
- NULL, /* Not defined */
- NULL, /* Not defined */
-};
-
-BOOL BUTTON_PaintWithTheme(HTHEME theme, HWND hwnd, HDC hParamDC, LPARAM prfFlag)
-{
- DWORD dwStyle;
- DWORD dwStyleEx;
- DWORD type;
- UINT dtFlags;
- int state;
- ButtonState drawState;
- pfThemedPaint paint;
-
- /* Don't draw with themes on a button with BS_ICON or BS_BITMAP */
- if (get_button_image(hwnd) != 0)
- return FALSE;
-
- dwStyle = GetWindowLongW(hwnd, GWL_STYLE);
- type = dwStyle & BUTTON_TYPE;
-
- if (type != BS_PUSHBUTTON && type != BS_DEFPUSHBUTTON && (dwStyle
& BS_PUSHLIKE))
- type = BS_PUSHBUTTON;
-
- paint = btnThemedPaintFunc[type];
- if (!paint)
- return FALSE;
-
- dwStyleEx = GetWindowLongW(hwnd, GWL_EXSTYLE);
- dtFlags = get_drawtext_flags(dwStyle, dwStyleEx);
- state = get_button_state(hwnd);
-
- if(dwStyle & WS_DISABLED)
- drawState = STATE_DISABLED;
- else if(state & BST_PUSHED)
- drawState = STATE_PRESSED;
- else if ((dwStyle & BS_PUSHLIKE) && (state &
(BST_CHECKED|BST_INDETERMINATE)))
- drawState = STATE_PRESSED;
- else if(state & BST_HOT)
- drawState = STATE_HOT;
- else if((state & BST_FOCUS) || (dwStyle & BS_DEFPUSHBUTTON))
- drawState = STATE_DEFAULTED;
- else
- drawState = STATE_NORMAL;
-
- if (paint == PB_draw || paint == CB_draw)
- {
- HDC hdc;
- HBITMAP hbmp;
- RECT rc;
-
- GetClientRect(hwnd, &rc);
- hdc = CreateCompatibleDC(hParamDC);
- hbmp = CreateCompatibleBitmap(hParamDC, rc.right, rc.bottom);
- if (hdc && hbmp)
- {
- SelectObject(hdc, hbmp);
-
- paint(theme, hwnd, hdc, drawState, dtFlags, state & BST_FOCUS, prfFlag);
-
- BitBlt(hParamDC, 0, 0, rc.right, rc.bottom, hdc, 0, 0, SRCCOPY);
- DeleteObject(hbmp);
- DeleteDC(hdc);
- return TRUE;
- }
- else
- {
- ERR("Failed to create DC and bitmap for double buffering\n");
- if (hbmp)
- DeleteObject(hbmp);
- if (hdc)
- DeleteDC(hdc);
- }
- }
-
- paint(theme, hwnd, hParamDC, drawState, dtFlags, state & BST_FOCUS, prfFlag);
- return TRUE;
-}
-
-#endif
\ No newline at end of file
diff --git a/dll/win32/comctl32/theme_combo.c b/dll/win32/comctl32/theme_combo.c
deleted file mode 100644
index 70442ba704b..00000000000
--- a/dll/win32/comctl32/theme_combo.c
+++ /dev/null
@@ -1,308 +0,0 @@
-/*
- * Theming - Combo box control
- *
- * Copyright (c) 2005 by Frank Richter
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- *
- */
-
-#include "comctl32.h"
-
-WINE_DEFAULT_DEBUG_CHANNEL(themingcombo);
-
-/* Subclass-private state flags */
-#define STATE_NOREDRAW 1
-#define STATE_HOT 2
-
-/* some constants for metrics, same as in user32 */
-#define COMBO_XBORDERSIZE 2
-#define COMBO_YBORDERSIZE 2
-#define COMBO_EDITBUTTONSPACE 0
-#define EDIT_CONTROL_PADDING 1
-
-/* paint text of combobox, needed for read-only drop downs. */
-static void paint_text (HWND hwnd, HDC hdc, DWORD dwStyle, const COMBOBOXINFO *cbi)
-{
- INT id, size = 0;
- LPWSTR pText = NULL;
- UINT itemState = ODS_COMBOBOXEDIT;
- HFONT font = (HFONT)SendMessageW (hwnd, WM_GETFONT, 0, 0);
- HFONT hPrevFont = (font) ? SelectObject(hdc, font) : 0;
- RECT rectEdit;
- BOOL focused = GetFocus () == hwnd;
- BOOL dropped = cbi->stateButton == STATE_SYSTEM_PRESSED;
-
- TRACE("\n");
-
- /* follow Windows combobox that sends a bunch of text
- * inquiries to its listbox while processing WM_PAINT. */
-
- if( (id = SendMessageW (cbi->hwndList, LB_GETCURSEL, 0, 0) ) != LB_ERR )
- {
- size = SendMessageW (cbi->hwndList, LB_GETTEXTLEN, id, 0);
- if (size == LB_ERR)
- FIXME("LB_ERR probably not handled yet\n");
- if( (pText = HeapAlloc( GetProcessHeap(), 0, (size + 1) * sizeof(WCHAR))) )
- {
- /* size from LB_GETTEXTLEN may be too large, from LB_GETTEXT is accurate */
- size = SendMessageW (cbi->hwndList, LB_GETTEXT, id, (LPARAM)pText);
- pText[size] = '\0'; /* just in case */
- } else return;
- }
- else
- if( !(dwStyle & (CBS_OWNERDRAWFIXED | CBS_OWNERDRAWVARIABLE)) )
- return;
-
- /*
- * Give ourselves some space.
- */
- rectEdit = cbi->rcItem;
- InflateRect( &rectEdit, -1, -1 );
-
- if(dwStyle & (CBS_OWNERDRAWFIXED | CBS_OWNERDRAWVARIABLE))
- {
- DRAWITEMSTRUCT dis;
- HRGN clipRegion;
- UINT ctlid = (UINT)GetWindowLongPtrW( hwnd, GWLP_ID );
-
- /* setup state for DRAWITEM message. Owner will highlight */
- if ( focused && !dropped )
- itemState |= ODS_SELECTED | ODS_FOCUS;
-
- /*
- * Save the current clip region.
- * To retrieve the clip region, we need to create one "dummy"
- * clip region.
- */
- clipRegion = CreateRectRgnIndirect(&rectEdit);
-
- if (GetClipRgn(hdc, clipRegion)!=1)
- {
- DeleteObject(clipRegion);
- clipRegion=NULL;
- }
-
- if (!IsWindowEnabled(hwnd)) itemState |= ODS_DISABLED;
-
- dis.CtlType = ODT_COMBOBOX;
- dis.CtlID = ctlid;
- dis.hwndItem = hwnd;
- dis.itemAction = ODA_DRAWENTIRE;
- dis.itemID = id;
- dis.itemState = itemState;
- dis.hDC = hdc;
- dis.rcItem = rectEdit;
- dis.itemData = SendMessageW(cbi->hwndList, LB_GETITEMDATA, id, 0);
-
- /*
- * Clip the DC and have the parent draw the item.
- */
- IntersectClipRect(hdc,
- rectEdit.left, rectEdit.top,
- rectEdit.right, rectEdit.bottom);
-
- SendMessageW(GetParent (hwnd), WM_DRAWITEM, ctlid, (LPARAM)&dis );
-
- /*
- * Reset the clipping region.
- */
- SelectClipRgn(hdc, clipRegion);
- }
- else
- {
- static const WCHAR empty_stringW[] = { 0 };
-
- if ( focused && !dropped ) {
-
- /* highlight */
- FillRect( hdc, &rectEdit, GetSysColorBrush(COLOR_HIGHLIGHT) );
- SetBkColor( hdc, GetSysColor( COLOR_HIGHLIGHT ) );
- SetTextColor( hdc, GetSysColor( COLOR_HIGHLIGHTTEXT ) );
- }
-
- ExtTextOutW( hdc,
- rectEdit.left + 1,
- rectEdit.top + 1,
- ETO_OPAQUE | ETO_CLIPPED,
- &rectEdit,
- pText ? pText : empty_stringW , size, NULL );
-
- if ( focused && !dropped )
- DrawFocusRect( hdc, &rectEdit );
- }
-
- if( hPrevFont )
- SelectObject(hdc, hPrevFont );
-
- HeapFree( GetProcessHeap(), 0, pText );
-}
-
-/* paint the combobox */
-static LRESULT paint (HTHEME theme, HWND hwnd, HDC hParamDC, ULONG state)
-{
- PAINTSTRUCT ps;
- HDC hDC;
- COMBOBOXINFO cbi;
- DWORD dwStyle = GetWindowLongW (hwnd, GWL_STYLE);
-
- hDC = (hParamDC) ? hParamDC
- : BeginPaint( hwnd, &ps);
-
- TRACE("hdc=%p\n", hDC);
-
- if( hDC && !(state & STATE_NOREDRAW) )
- {
- RECT frameRect;
- int buttonState;
-
- cbi.cbSize = sizeof (cbi);
- SendMessageW (hwnd, CB_GETCOMBOBOXINFO, 0, (LPARAM)&cbi);
-
- /* paint border */
- if ((dwStyle & CBS_DROPDOWNLIST) != CBS_SIMPLE)
- GetClientRect (hwnd, &frameRect);
- else
- {
- frameRect = cbi.rcItem;
- InflateRect(&frameRect,
- EDIT_CONTROL_PADDING + COMBO_XBORDERSIZE,
- EDIT_CONTROL_PADDING + COMBO_YBORDERSIZE);
- }
-
- DrawThemeBackground (theme, hDC, 0,
- IsWindowEnabled (hwnd) ? CBXS_NORMAL : CBXS_DISABLED, &frameRect, NULL);
-
- /* paint button */
- if (cbi.stateButton != STATE_SYSTEM_INVISIBLE)
- {
- if (!IsWindowEnabled (hwnd))
- buttonState = CBXS_DISABLED;
- else if (cbi.stateButton == STATE_SYSTEM_PRESSED)
- buttonState = CBXS_PRESSED;
- else if (state & STATE_HOT)
- buttonState = CBXS_HOT;
- else
- buttonState = CBXS_NORMAL;
- DrawThemeBackground (theme, hDC, CP_DROPDOWNBUTTON, buttonState,
- &cbi.rcButton, NULL);
- }
-
- /* paint text, if we need to */
- if ((dwStyle & CBS_DROPDOWNLIST) == CBS_DROPDOWNLIST)
- paint_text (hwnd, hDC, dwStyle, &cbi);
- }
-
- if( !hParamDC )
- EndPaint(hwnd, &ps);
-
- return 0;
-}
-
-
-/**********************************************************************
- * The combo control subclass window proc.
- */
-LRESULT CALLBACK THEMING_ComboSubclassProc (HWND hwnd, UINT msg,
- WPARAM wParam, LPARAM lParam,
- ULONG_PTR dwRefData)
-{
- const WCHAR* themeClass = WC_COMBOBOXW;
- HTHEME theme;
- LRESULT result;
-
- switch (msg)
- {
- case WM_CREATE:
- result = THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
- OpenThemeData( hwnd, themeClass );
- return result;
-
- case WM_DESTROY:
- theme = GetWindowTheme( hwnd );
- CloseThemeData ( theme );
- return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
-
- case WM_THEMECHANGED:
- theme = GetWindowTheme( hwnd );
- CloseThemeData ( theme );
- OpenThemeData( hwnd, themeClass );
- break;
-
- case WM_SYSCOLORCHANGE:
- theme = GetWindowTheme( hwnd );
- if (!theme) return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
- /* Do nothing. When themed, a WM_THEMECHANGED will be received, too,
- * which will do the repaint. */
- break;
-
- case WM_PAINT:
- theme = GetWindowTheme( hwnd );
- if (!theme) return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
- return paint (theme, hwnd, (HDC)wParam, dwRefData);
-
- case WM_SETREDRAW:
- /* Since there doesn't seem to be WM_GETREDRAW, do redraw tracking in
- * the subclass as well. */
- if( wParam )
- dwRefData &= ~STATE_NOREDRAW;
- else
- dwRefData |= STATE_NOREDRAW;
- THEMING_SetSubclassData (hwnd, dwRefData);
- return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
-
- case WM_MOUSEMOVE:
- {
- /* Dropdown button hot-tracking */
- COMBOBOXINFO cbi;
- POINT pt;
-
- pt.x = (short)LOWORD(lParam);
- pt.y = (short)HIWORD(lParam);
- cbi.cbSize = sizeof (cbi);
- SendMessageW (hwnd, CB_GETCOMBOBOXINFO, 0, (LPARAM)&cbi);
-
- if (cbi.stateButton != STATE_SYSTEM_INVISIBLE)
- {
- if (PtInRect (&cbi.rcButton, pt))
- {
- if (!(dwRefData & STATE_HOT))
- {
- dwRefData |= STATE_HOT;
- THEMING_SetSubclassData (hwnd, dwRefData);
- RedrawWindow (hwnd, &cbi.rcButton, 0,
- RDW_INVALIDATE | RDW_UPDATENOW);
- }
- }
- else
- {
- if (dwRefData & STATE_HOT)
- {
- dwRefData &= ~STATE_HOT;
- THEMING_SetSubclassData (hwnd, dwRefData);
- RedrawWindow (hwnd, &cbi.rcButton, 0,
- RDW_INVALIDATE | RDW_UPDATENOW);
- }
- }
- }
- }
- return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
-
- default:
- /* Call old proc */
- return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
- }
- return 0;
-}
diff --git a/dll/win32/comctl32/theme_dialog.c b/dll/win32/comctl32/theme_dialog.c
deleted file mode 100644
index 656e52dbf57..00000000000
--- a/dll/win32/comctl32/theme_dialog.c
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * Theming - Dialogs
- *
- * Copyright (c) 2005 by Frank Richter
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- *
- */
-
-#include <stdarg.h>
-#include <string.h>
-#include <stdlib.h>
-
-#include "windef.h"
-#include "winbase.h"
-#include "wingdi.h"
-#include "winuser.h"
-#include "uxtheme.h"
-#include "vssym32.h"
-#include "comctl32.h"
-#include "wine/debug.h"
-
-/**********************************************************************
- * The dialog subclass window proc.
- */
-LRESULT CALLBACK THEMING_DialogSubclassProc (HWND hWnd, UINT msg,
- WPARAM wParam, LPARAM lParam,
- ULONG_PTR dwRefData)
-{
- HTHEME theme = GetWindowTheme ( hWnd );
- static const WCHAR themeClass[] = {
'W','i','n','d','o','w',0 };
- BOOL themingActive = IsThemeDialogTextureEnabled (hWnd);
- BOOL doTheming = themingActive && (theme != NULL);
- LRESULT result;
-
- switch (msg)
- {
- case WM_CREATE:
- result = THEMING_CallOriginalClass (hWnd, msg, wParam, lParam);
- theme = OpenThemeData( hWnd, themeClass );
- return result;
-
- case WM_DESTROY:
- CloseThemeData ( theme );
- SetWindowTheme( hWnd, NULL, NULL );
- OpenThemeData( hWnd, NULL );
- return THEMING_CallOriginalClass (hWnd, msg, wParam, lParam);
-
- case WM_THEMECHANGED:
- CloseThemeData ( theme );
- OpenThemeData( hWnd, themeClass );
- InvalidateRect( hWnd, NULL, TRUE );
- return 0;
-
- case WM_SYSCOLORCHANGE:
- if (!doTheming) return THEMING_CallOriginalClass (hWnd, msg, wParam, lParam);
- /* Do nothing. When themed, a WM_THEMECHANGED will be received, too,
- * which will do the repaint. */
- break;
-
- case WM_ERASEBKGND:
- if (!doTheming) return THEMING_CallOriginalClass (hWnd, msg, wParam, lParam);
- {
- RECT rc;
- WNDPROC dlgp = (WNDPROC)GetWindowLongPtrW (hWnd, DWLP_DLGPROC);
- if (!CallWindowProcW(dlgp, hWnd, msg, wParam, lParam))
- {
- /* Draw background*/
- GetClientRect (hWnd, &rc);
- if (IsThemePartDefined (theme, WP_DIALOG, 0))
- /* Although there is a theme for the WINDOW class/DIALOG part,
- * but I[res] haven't seen Windows using it yet... Even when
- * dialog theming is activated, the good ol' BTNFACE
- * background seems to be used. */
-#if 0
- DrawThemeBackground (theme, (HDC)wParam, WP_DIALOG, 0, &rc,
- NULL);
-#endif
- return THEMING_CallOriginalClass (hWnd, msg, wParam, lParam);
- else
- /* We might have gotten a TAB theme class, so check if we can
- * draw as a tab page. */
- if (IsThemePartDefined (theme, TABP_BODY, 0))
- DrawThemeBackground (theme, (HDC)wParam, TABP_BODY, 0, &rc,
- NULL);
- else
- return THEMING_CallOriginalClass (hWnd, msg, wParam, lParam);
- }
- return 1;
- }
-
- case WM_CTLCOLORSTATIC:
- if (!doTheming) return THEMING_CallOriginalClass (hWnd, msg, wParam, lParam);
- {
- WNDPROC dlgp = (WNDPROC)GetWindowLongPtrW (hWnd, DWLP_DLGPROC);
- LRESULT result = CallWindowProcW(dlgp, hWnd, msg, wParam, lParam);
- if (!result)
- {
- /* Override defaults with more suitable values when themed */
- HDC controlDC = (HDC)wParam;
- HWND controlWnd = (HWND)lParam;
- WCHAR controlClass[32];
- RECT rc;
-
- GetClassNameW (controlWnd, controlClass, ARRAY_SIZE(controlClass));
- if (lstrcmpiW (controlClass, WC_STATICW) == 0)
- {
- /* Static control - draw parent background and set text to
- * transparent, so it looks right on tab pages. */
- GetClientRect (controlWnd, &rc);
- DrawThemeParentBackground (controlWnd, controlDC, &rc);
- SetBkMode (controlDC, TRANSPARENT);
-
- /* Return NULL brush since we painted the BG already */
- return (LRESULT)GetStockObject (NULL_BRUSH);
- }
- else
- return THEMING_CallOriginalClass (hWnd, msg, wParam, lParam);
-
- }
- return result;
- }
-
- default:
- /* Call old proc */
- return THEMING_CallOriginalClass (hWnd, msg, wParam, lParam);
- }
- return 0;
-}
diff --git a/dll/win32/comctl32/theme_edit.c b/dll/win32/comctl32/theme_edit.c
deleted file mode 100644
index a13cff4c8d3..00000000000
--- a/dll/win32/comctl32/theme_edit.c
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Theming - Edit control
- *
- * Copyright (c) 2005 by Frank Richter
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- *
- */
-
-#include "comctl32.h"
-
-/* Draw themed border */
-static void nc_paint (HTHEME theme, HWND hwnd, HRGN region)
-{
- HRGN cliprgn = region;
- DWORD exStyle = GetWindowLongW (hwnd, GWL_EXSTYLE);
- if (exStyle & WS_EX_CLIENTEDGE)
- {
- HDC dc;
- RECT r;
- int cxEdge = GetSystemMetrics (SM_CXEDGE),
- cyEdge = GetSystemMetrics (SM_CYEDGE);
- int part = EP_EDITTEXT;
- int state = ETS_NORMAL;
- DWORD dwStyle = GetWindowLongW (hwnd, GWL_STYLE);
-
- if (!IsWindowEnabled (hwnd))
- state = ETS_DISABLED;
- else if (dwStyle & ES_READONLY)
- state = ETS_READONLY;
- else if (GetFocus() == hwnd)
- state = ETS_FOCUSED;
-
- GetWindowRect(hwnd, &r);
-
- /* New clipping region passed to default proc to exclude border */
- cliprgn = CreateRectRgn (r.left + cxEdge, r.top + cyEdge,
- r.right - cxEdge, r.bottom - cyEdge);
- if (region != (HRGN)1)
- CombineRgn (cliprgn, cliprgn, region, RGN_AND);
- OffsetRect(&r, -r.left, -r.top);
-
-#ifdef __REACTOS__ /* r73789 */
- dc = GetWindowDC(hwnd);
- /* Exclude client part */
- ExcludeClipRect(dc, r.left + cxEdge, r.top + cyEdge,
- r.right - cxEdge, r.bottom -cyEdge);
-#else
- dc = GetDCEx(hwnd, region, DCX_WINDOW|DCX_INTERSECTRGN);
- OffsetRect(&r, -r.left, -r.top);
-#endif
-
- if (IsThemeBackgroundPartiallyTransparent (theme, part, state))
- DrawThemeParentBackground(hwnd, dc, &r);
- DrawThemeBackground (theme, dc, part, state, &r, 0);
- ReleaseDC(hwnd, dc);
- }
-
- /* Call default proc to get the scrollbars etc. also painted */
- DefWindowProcW (hwnd, WM_NCPAINT, (WPARAM)cliprgn, 0);
-}
-
-/**********************************************************************
- * The edit control subclass window proc.
- */
-LRESULT CALLBACK THEMING_EditSubclassProc (HWND hwnd, UINT msg,
- WPARAM wParam, LPARAM lParam,
- ULONG_PTR dwRefData)
-{
- const WCHAR* themeClass = WC_EDITW;
- HTHEME theme;
- LRESULT result;
-
- switch (msg)
- {
- case WM_CREATE:
- result = THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
- OpenThemeData( hwnd, themeClass );
- return result;
-
- case WM_DESTROY:
- theme = GetWindowTheme( hwnd );
- CloseThemeData ( theme );
- return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
-
- case WM_THEMECHANGED:
- theme = GetWindowTheme( hwnd );
- CloseThemeData ( theme );
- OpenThemeData( hwnd, themeClass );
- break;
-
- case WM_SYSCOLORCHANGE:
- theme = GetWindowTheme( hwnd );
- if (!theme) return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
- /* Do nothing. When themed, a WM_THEMECHANGED will be received, too,
- * which will do the repaint. */
- break;
-
- case WM_NCPAINT:
- theme = GetWindowTheme( hwnd );
- if (!theme) return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
- nc_paint (theme, hwnd, (HRGN)wParam);
- break;
-
- case WM_ENABLE:
- case WM_KILLFOCUS:
- case WM_SETFOCUS:
- theme = GetWindowTheme( hwnd );
- if (theme) RedrawWindow (hwnd, NULL, NULL,
- RDW_FRAME | RDW_INVALIDATE | RDW_UPDATENOW);
- return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
-
- default:
- /* Call old proc */
- return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
- }
- return 0;
-}
diff --git a/dll/win32/comctl32/theme_listbox.c b/dll/win32/comctl32/theme_listbox.c
deleted file mode 100644
index 773701663cf..00000000000
--- a/dll/win32/comctl32/theme_listbox.c
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Theming - List box control
- *
- * Copyright (c) 2005 by Frank Richter
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- *
- */
-
-#include "comctl32.h"
-
-/* Draw themed border */
-static void nc_paint (HTHEME theme, HWND hwnd, HRGN region)
-{
- HRGN cliprgn = region;
- DWORD exStyle = GetWindowLongW (hwnd, GWL_EXSTYLE);
- if (exStyle & WS_EX_CLIENTEDGE)
- {
- HDC dc;
- RECT r;
- int cxEdge = GetSystemMetrics (SM_CXEDGE),
- cyEdge = GetSystemMetrics (SM_CYEDGE);
-
- GetWindowRect(hwnd, &r);
-
- /* New clipping region passed to default proc to exclude border */
- cliprgn = CreateRectRgn (r.left + cxEdge, r.top + cyEdge,
- r.right - cxEdge, r.bottom - cyEdge);
- if (region != (HRGN)1)
- CombineRgn (cliprgn, cliprgn, region, RGN_AND);
- OffsetRect(&r, -r.left, -r.top);
-
-#ifdef __REACTOS__ /* r73789 */
- dc = GetWindowDC(hwnd);
- /* Exclude client part */
- ExcludeClipRect(dc, r.left + cxEdge, r.top + cyEdge,
- r.right - cxEdge, r.bottom -cyEdge);
-#else
- dc = GetDCEx(hwnd, region, DCX_WINDOW|DCX_INTERSECTRGN);
- OffsetRect(&r, -r.left, -r.top);
-#endif
-
- if (IsThemeBackgroundPartiallyTransparent (theme, 0, 0))
- DrawThemeParentBackground(hwnd, dc, &r);
- DrawThemeBackground (theme, dc, 0, 0, &r, 0);
- ReleaseDC(hwnd, dc);
- }
-
- /* Call default proc to get the scrollbars etc. painted */
- DefWindowProcW (hwnd, WM_NCPAINT, (WPARAM)cliprgn, 0);
-}
-
-/**********************************************************************
- * The list control subclass window proc.
- */
-LRESULT CALLBACK THEMING_ListBoxSubclassProc (HWND hwnd, UINT msg,
- WPARAM wParam, LPARAM lParam,
- ULONG_PTR dwRefData)
-{
- const WCHAR* themeClass = WC_LISTBOXW;
- HTHEME theme;
- LRESULT result;
-
- switch (msg)
- {
- case WM_CREATE:
- result = THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
- OpenThemeData( hwnd, themeClass );
- return result;
-
- case WM_DESTROY:
- theme = GetWindowTheme( hwnd );
- CloseThemeData ( theme );
- return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
-
- case WM_THEMECHANGED:
- theme = GetWindowTheme( hwnd );
- CloseThemeData ( theme );
- OpenThemeData( hwnd, themeClass );
- break;
-
- case WM_SYSCOLORCHANGE:
- theme = GetWindowTheme( hwnd );
- if (!theme) return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
- /* Do nothing. When themed, a WM_THEMECHANGED will be received, too,
- * which will do the repaint. */
- break;
-
- case WM_NCPAINT:
- theme = GetWindowTheme( hwnd );
- if (!theme) return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
- nc_paint (theme, hwnd, (HRGN)wParam);
- break;
-
- default:
- /* Call old proc */
- return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
- }
- return 0;
-}