Alexandre Julliard : user: Make the WINDOWPROCTYPE enum private to
winproc. c.
Alexandre Julliard
julliard at wine.codeweavers.com
Wed May 10 12:56:41 CDT 2006
Module: wine
Branch: refs/heads/master
Commit: c8ce866a8a64afac8d147e3fb7b00034d1b9bb2a
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=c8ce866a8a64afac8d147e3fb7b00034d1b9bb2a
Author: Alexandre Julliard <julliard at winehq.org>
Date: Wed May 10 13:34:45 2006 +0200
user: Make the WINDOWPROCTYPE enum private to winproc.c.
---
dlls/user/class.c | 6 +++---
dlls/user/win.c | 27 +++++++++++----------------
dlls/user/winproc.c | 8 ++++++++
dlls/user/winproc.h | 10 +---------
4 files changed, 23 insertions(+), 28 deletions(-)
diff --git a/dlls/user/class.c b/dlls/user/class.c
index 6639cab..e9aec25 100644
--- a/dlls/user/class.c
+++ b/dlls/user/class.c
@@ -520,9 +520,9 @@ void CLASS_RegisterBuiltinClasses(void)
* Add a new window using this class, and set the necessary
* information inside the window structure.
*/
-void CLASS_AddWindow( CLASS *class, WND *win, WINDOWPROCTYPE type )
+void CLASS_AddWindow( CLASS *class, WND *win, BOOL unicode )
{
- if (type == WIN_PROC_32W)
+ if (unicode)
{
if (!(win->winproc = class->winprocW)) win->winproc = class->winprocA;
}
@@ -532,7 +532,7 @@ void CLASS_AddWindow( CLASS *class, WND
}
win->class = class;
win->clsStyle = class->style;
- if (WINPROC_IsUnicode( win->winproc, (type == WIN_PROC_32W) )) win->flags |= WIN_ISUNICODE;
+ if (WINPROC_IsUnicode( win->winproc, unicode )) win->flags |= WIN_ISUNICODE;
}
diff --git a/dlls/user/win.c b/dlls/user/win.c
index 3b0716a..5a785c5 100644
--- a/dlls/user/win.c
+++ b/dlls/user/win.c
@@ -55,7 +55,7 @@ static void *user_handles[NB_USER_HANDLE
* Create a window handle with the server.
*/
static WND *create_window_handle( HWND parent, HWND owner, ATOM atom,
- HINSTANCE instance, WINDOWPROCTYPE type )
+ HINSTANCE instance, BOOL unicode )
{
WORD index;
WND *win;
@@ -125,7 +125,7 @@ static WND *create_window_handle( HWND p
win->flags = 0;
win->cbWndExtra = extra_bytes;
memset( win->wExtra, 0, extra_bytes );
- CLASS_AddWindow( class, win, type );
+ CLASS_AddWindow( class, win, unicode );
return win;
}
@@ -846,26 +846,21 @@ #undef DUMPED_EX_STYLES
*
* Implementation of CreateWindowEx().
*/
-static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, ATOM classAtom,
- WINDOWPROCTYPE type )
+static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, ATOM classAtom, UINT flags )
{
INT sw = SW_SHOW;
WND *wndPtr;
HWND hwnd, parent, owner, top_child = 0;
- BOOL unicode = (type == WIN_PROC_32W);
+ BOOL unicode = (flags & WIN_ISUNICODE) != 0;
MDICREATESTRUCTA mdi_cs;
TRACE("%s %s ex=%08lx style=%08lx %d,%d %dx%d parent=%p menu=%p inst=%p params=%p\n",
- (type == WIN_PROC_32W) ? debugstr_w((LPCWSTR)cs->lpszName) : debugstr_a(cs->lpszName),
- (type == WIN_PROC_32W) ? debugstr_w((LPCWSTR)cs->lpszClass) : debugstr_a(cs->lpszClass),
+ unicode ? debugstr_w((LPCWSTR)cs->lpszName) : debugstr_a(cs->lpszName),
+ unicode ? debugstr_w((LPCWSTR)cs->lpszClass) : debugstr_a(cs->lpszClass),
cs->dwExStyle, cs->style, cs->x, cs->y, cs->cx, cs->cy,
cs->hwndParent, cs->hMenu, cs->hInstance, cs->lpCreateParams );
-
if(TRACE_ON(win)) dump_window_styles( cs->style, cs->dwExStyle );
- TRACE("winproc type is %d (%s)\n", type, (type == WIN_PROC_16) ? "WIN_PROC_16" :
- ((type == WIN_PROC_32A) ? "WIN_PROC_32A" : "WIN_PROC_32W") );
-
/* Fix the styles for MDI children */
if (cs->dwExStyle & WS_EX_MDICHILD)
{
@@ -976,7 +971,7 @@ static HWND WIN_CreateWindowEx( CREATEST
/* Create the window structure */
- if (!(wndPtr = create_window_handle( parent, owner, classAtom, cs->hInstance, type )))
+ if (!(wndPtr = create_window_handle( parent, owner, classAtom, cs->hInstance, unicode )))
return 0;
hwnd = wndPtr->hwndSelf;
@@ -995,7 +990,7 @@ static HWND WIN_CreateWindowEx( CREATEST
wndPtr->hIcon = 0;
wndPtr->hIconSmall = 0;
wndPtr->hSysMenu = 0;
- if (type != WIN_PROC_16) wndPtr->flags |= WIN_ISWIN32;
+ wndPtr->flags |= (flags & WIN_ISWIN32);
if (wndPtr->dwStyle & WS_SYSMENU) SetSystemMenu( hwnd, 0 );
@@ -1172,7 +1167,7 @@ HWND16 WINAPI CreateWindowEx16( DWORD ex
cs.lpszClass = className;
cs.dwExStyle = exStyle;
- return HWND_16( WIN_CreateWindowEx( &cs, classAtom, WIN_PROC_16 ));
+ return HWND_16( WIN_CreateWindowEx( &cs, classAtom, 0 ));
}
@@ -1225,7 +1220,7 @@ HWND WINAPI CreateWindowExA( DWORD exSty
cs.lpszClass = className;
cs.dwExStyle = exStyle;
- return WIN_CreateWindowEx( &cs, classAtom, WIN_PROC_32A );
+ return WIN_CreateWindowEx( &cs, classAtom, WIN_ISWIN32 );
}
@@ -1280,7 +1275,7 @@ HWND WINAPI CreateWindowExW( DWORD exSty
/* Note: we rely on the fact that CREATESTRUCTA and */
/* CREATESTRUCTW have the same layout. */
- return WIN_CreateWindowEx( (CREATESTRUCTA *)&cs, classAtom, WIN_PROC_32W );
+ return WIN_CreateWindowEx( (CREATESTRUCTA *)&cs, classAtom, WIN_ISWIN32 | WIN_ISUNICODE );
}
diff --git a/dlls/user/winproc.c b/dlls/user/winproc.c
index 56bc035..5cca892 100644
--- a/dlls/user/winproc.c
+++ b/dlls/user/winproc.c
@@ -79,6 +79,14 @@ typedef struct tagWINDOWPROC
WNDPROC16 proc16; /* 16-bit window proc */
} WINDOWPROC;
+typedef enum
+{
+ WIN_PROC_INVALID,
+ WIN_PROC_16,
+ WIN_PROC_32A,
+ WIN_PROC_32W
+} WINDOWPROCTYPE;
+
#define WINPROC_HANDLE (~0UL >> 16)
#define MAX_WINPROCS (0x10000 / sizeof(WINDOWPROC))
diff --git a/dlls/user/winproc.h b/dlls/user/winproc.h
index 14240a6..58943ba 100644
--- a/dlls/user/winproc.h
+++ b/dlls/user/winproc.h
@@ -28,14 +28,6 @@ #include "winbase.h"
#include "wine/winbase16.h"
#include "winnls.h"
-typedef enum
-{
- WIN_PROC_INVALID,
- WIN_PROC_16,
- WIN_PROC_32A,
- WIN_PROC_32W
-} WINDOWPROCTYPE;
-
typedef struct
{
WPARAM16 wParam;
@@ -134,7 +126,7 @@ inline static void unmap_str_16_to_32W(
struct tagCLASS; /* opaque structure */
struct tagWND;
extern void CLASS_RegisterBuiltinClasses(void);
-extern void CLASS_AddWindow( struct tagCLASS *class, struct tagWND *win, WINDOWPROCTYPE type );
+extern void CLASS_AddWindow( struct tagCLASS *class, struct tagWND *win, BOOL unicode );
extern void CLASS_FreeModuleClasses( HMODULE16 hModule );
#endif /* __WINE_WINPROC_H */
More information about the wine-cvs
mailing list