Alexandre Julliard : user32: Simplify window procedure allocation for the builtin classes.

Alexandre Julliard julliard at winehq.org
Fri Dec 18 10:49:09 CST 2009


Module: wine
Branch: master
Commit: d081a7352c53b108da744370dc15b412957f28e4
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=d081a7352c53b108da744370dc15b412957f28e4

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Fri Dec 18 12:39:13 2009 +0100

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 6e68785..cec92e0 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 e8ca0e5..040f3c1 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 948c6a7..1dd4f37 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 ba455ba..f9a17e8 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 e29d72c..df4ac70 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 1309c09..a7040ea 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 3466002..4e86ede 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 b6f2c08..04f0c69 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 4bc9664..03b894a 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 fcfbd27..991ba37 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 4e03651..9205146 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 b544a76..ffe7f76 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 13b5eaf..6c34652 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 0f778bb..2ed3b75 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 */




More information about the wine-cvs mailing list