From d081a7352c53b108da744370dc15b412957f28e4 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Fri, 18 Dec 2009 12:39:13 +0100 Subject: [PATCH] user32: Simplify window procedure allocation for the builtin classes. --- dlls/user32/button.c | 3 +-- dlls/user32/class.c | 2 +- dlls/user32/combo.c | 3 +-- dlls/user32/controls.h | 3 +-- dlls/user32/desktop.c | 3 +-- dlls/user32/dialog.c | 3 +-- dlls/user32/edit.c | 3 +-- dlls/user32/icontitle.c | 3 +-- dlls/user32/listbox.c | 6 ++---- dlls/user32/mdi.c | 3 +-- dlls/user32/menu.c | 3 +-- dlls/user32/message.c | 3 +-- dlls/user32/scroll.c | 3 +-- dlls/user32/static.c | 3 +-- 14 files changed, 15 insertions(+), 29 deletions(-) diff --git a/dlls/user32/button.c b/dlls/user32/button.c index 6e68785342f..cec92e0c863 100644 --- a/dlls/user32/button.c +++ b/dlls/user32/button.c @@ -162,8 +162,7 @@ const struct builtin_class_descr BUTTON_builtin_class = { buttonW, /* name */ CS_DBLCLKS | CS_VREDRAW | CS_HREDRAW | CS_PARENTDC, /* style */ - NULL, /* procA */ - BUILTIN_WINPROC(WINPROC_BUTTON), /* procW */ + WINPROC_BUTTON, /* proc */ NB_EXTRA_BYTES, /* extra */ IDC_ARROW, /* cursor */ 0 /* brush */ diff --git a/dlls/user32/class.c b/dlls/user32/class.c index e8ca0e555b4..040f3c16f23 100644 --- a/dlls/user32/class.c +++ b/dlls/user32/class.c @@ -400,7 +400,7 @@ static void register_builtin( const struct builtin_class_descr *descr ) classPtr->hCursor = LoadCursorA( 0, (LPSTR)descr->cursor ); classPtr->hbrBackground = descr->brush; - classPtr->winproc = WINPROC_AllocProc( descr->procA, descr->procW ); + classPtr->winproc = BUILTIN_WINPROC( descr->proc ); release_class_ptr( classPtr ); } diff --git a/dlls/user32/combo.c b/dlls/user32/combo.c index 948c6a747a6..1dd4f37b07c 100644 --- a/dlls/user32/combo.c +++ b/dlls/user32/combo.c @@ -94,8 +94,7 @@ const struct builtin_class_descr COMBO_builtin_class = { comboboxW, /* name */ CS_PARENTDC | CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW, /* style */ - NULL, /* procA */ - BUILTIN_WINPROC(WINPROC_COMBO), /* procW */ + WINPROC_COMBO, /* proc */ sizeof(HEADCOMBO *), /* extra */ IDC_ARROW, /* cursor */ 0 /* brush */ diff --git a/dlls/user32/controls.h b/dlls/user32/controls.h index ba455ba16e0..f9a17e863be 100644 --- a/dlls/user32/controls.h +++ b/dlls/user32/controls.h @@ -60,8 +60,7 @@ struct builtin_class_descr { LPCWSTR name; /* class name */ UINT style; /* class style */ - WNDPROC procA; /* ASCII window procedure */ - WNDPROC procW; /* Unicode window procedure */ + enum builtin_winprocs proc; INT extra; /* window extra bytes */ ULONG_PTR cursor; /* cursor id */ HBRUSH brush; /* brush or system color */ diff --git a/dlls/user32/desktop.c b/dlls/user32/desktop.c index e29d72c7df2..df4ac70a185 100644 --- a/dlls/user32/desktop.c +++ b/dlls/user32/desktop.c @@ -46,8 +46,7 @@ const struct builtin_class_descr DESKTOP_builtin_class = { (LPCWSTR)DESKTOP_CLASS_ATOM, /* name */ CS_DBLCLKS, /* style */ - NULL, /* procA (winproc is Unicode only) */ - BUILTIN_WINPROC(WINPROC_DESKTOP), /* procW */ + WINPROC_DESKTOP, /* proc */ 0, /* extra */ IDC_ARROW, /* cursor */ (HBRUSH)(COLOR_BACKGROUND+1) /* brush */ diff --git a/dlls/user32/dialog.c b/dlls/user32/dialog.c index 1309c09f455..a7040eac59b 100644 --- a/dlls/user32/dialog.c +++ b/dlls/user32/dialog.c @@ -97,8 +97,7 @@ const struct builtin_class_descr DIALOG_builtin_class = { (LPCWSTR)DIALOG_CLASS_ATOM, /* name */ CS_SAVEBITS | CS_DBLCLKS, /* style */ - NULL, /* procA */ - BUILTIN_WINPROC(WINPROC_DIALOG), /* procW */ + WINPROC_DIALOG, /* proc */ DLGWINDOWEXTRA, /* extra */ IDC_ARROW, /* cursor */ 0 /* brush */ diff --git a/dlls/user32/edit.c b/dlls/user32/edit.c index 34660028f41..4e86ede13bb 100644 --- a/dlls/user32/edit.c +++ b/dlls/user32/edit.c @@ -4978,8 +4978,7 @@ const struct builtin_class_descr EDIT_builtin_class = { editW, /* name */ CS_DBLCLKS | CS_PARENTDC, /* style */ - NULL, /* procA */ - BUILTIN_WINPROC(WINPROC_EDIT), /* procW */ + WINPROC_EDIT, /* proc */ #ifdef __i386__ sizeof(EDITSTATE *) + sizeof(HLOCAL16), /* extra */ #else diff --git a/dlls/user32/icontitle.c b/dlls/user32/icontitle.c index b6f2c084470..04f0c69ec30 100644 --- a/dlls/user32/icontitle.c +++ b/dlls/user32/icontitle.c @@ -45,8 +45,7 @@ const struct builtin_class_descr ICONTITLE_builtin_class = { (LPCWSTR)ICONTITLE_CLASS_ATOM, /* name */ 0, /* style */ - NULL, /* procA (winproc is Unicode only) */ - BUILTIN_WINPROC(WINPROC_ICONTITLE), /* procW */ + WINPROC_ICONTITLE, /* proc */ 0, /* extra */ IDC_ARROW, /* cursor */ 0 /* brush */ diff --git a/dlls/user32/listbox.c b/dlls/user32/listbox.c index 4bc9664c64a..03b894acdab 100644 --- a/dlls/user32/listbox.c +++ b/dlls/user32/listbox.c @@ -138,8 +138,7 @@ const struct builtin_class_descr LISTBOX_builtin_class = { listboxW, /* name */ CS_DBLCLKS /*| CS_PARENTDC*/, /* style */ - NULL, /* procA */ - BUILTIN_WINPROC(WINPROC_LISTBOX), /* procW */ + WINPROC_LISTBOX, /* proc */ sizeof(LB_DESCR *), /* extra */ IDC_ARROW, /* cursor */ 0 /* brush */ @@ -154,8 +153,7 @@ const struct builtin_class_descr COMBOLBOX_builtin_class = { combolboxW, /* name */ CS_DBLCLKS | CS_SAVEBITS, /* style */ - NULL, /* procA */ - BUILTIN_WINPROC(WINPROC_LISTBOX), /* procW */ + WINPROC_LISTBOX, /* proc */ sizeof(LB_DESCR *), /* extra */ IDC_ARROW, /* cursor */ 0 /* brush */ diff --git a/dlls/user32/mdi.c b/dlls/user32/mdi.c index fcfbd27e001..991ba372bcb 100644 --- a/dlls/user32/mdi.c +++ b/dlls/user32/mdi.c @@ -186,8 +186,7 @@ const struct builtin_class_descr MDICLIENT_builtin_class = { mdiclientW, /* name */ 0, /* style */ - NULL, /* procA */ - BUILTIN_WINPROC(WINPROC_MDICLIENT), /* procW */ + WINPROC_MDICLIENT, /* proc */ sizeof(MDICLIENTINFO), /* extra */ IDC_ARROW, /* cursor */ (HBRUSH)(COLOR_APPWORKSPACE+1) /* brush */ diff --git a/dlls/user32/menu.c b/dlls/user32/menu.c index 4e03651d72a..9205146a0f5 100644 --- a/dlls/user32/menu.c +++ b/dlls/user32/menu.c @@ -194,8 +194,7 @@ const struct builtin_class_descr MENU_builtin_class = { (LPCWSTR)POPUPMENU_CLASS_ATOM, /* name */ CS_DROPSHADOW | CS_SAVEBITS | CS_DBLCLKS, /* style */ - NULL, /* procA (winproc is Unicode only) */ - BUILTIN_WINPROC(WINPROC_MENU), /* procW */ + WINPROC_MENU, /* proc */ sizeof(HMENU), /* extra */ IDC_ARROW, /* cursor */ (HBRUSH)(COLOR_MENU+1) /* brush */ diff --git a/dlls/user32/message.c b/dlls/user32/message.c index b544a760f84..ffe7f76abc9 100644 --- a/dlls/user32/message.c +++ b/dlls/user32/message.c @@ -96,8 +96,7 @@ const struct builtin_class_descr MESSAGE_builtin_class = { messageW, /* name */ 0, /* style */ - NULL, /* procA (winproc is Unicode only) */ - BUILTIN_WINPROC(WINPROC_MESSAGE), /* procW */ + WINPROC_MESSAGE, /* proc */ 0, /* extra */ IDC_ARROW, /* cursor */ 0 /* brush */ diff --git a/dlls/user32/scroll.c b/dlls/user32/scroll.c index 13b5eafb82a..6c346529aea 100644 --- a/dlls/user32/scroll.c +++ b/dlls/user32/scroll.c @@ -124,8 +124,7 @@ const struct builtin_class_descr SCROLL_builtin_class = { scrollbarW, /* name */ CS_DBLCLKS | CS_VREDRAW | CS_HREDRAW | CS_PARENTDC, /* style */ - NULL, /* procA */ - BUILTIN_WINPROC(WINPROC_SCROLLBAR), /* procW */ + WINPROC_SCROLLBAR, /* proc */ sizeof(SCROLLBAR_INFO), /* extra */ IDC_ARROW, /* cursor */ 0 /* brush */ diff --git a/dlls/user32/static.c b/dlls/user32/static.c index 0f778bb1638..2ed3b75ae72 100644 --- a/dlls/user32/static.c +++ b/dlls/user32/static.c @@ -102,8 +102,7 @@ const struct builtin_class_descr STATIC_builtin_class = { staticW, /* name */ CS_DBLCLKS | CS_PARENTDC, /* style */ - NULL, /* procA */ - BUILTIN_WINPROC(WINPROC_STATIC), /* procW */ + WINPROC_STATIC, /* proc */ STATIC_EXTRA_BYTES, /* extra */ IDC_ARROW, /* cursor */ 0 /* brush */