user: Make the WINDOWPROCTYPE enum private to winproc.c.

This commit is contained in:
Alexandre Julliard 2006-05-10 13:34:45 +02:00
parent 4cc498f880
commit c8ce866a8a
4 changed files with 23 additions and 28 deletions

View File

@ -520,9 +520,9 @@ void CLASS_RegisterBuiltinClasses(void)
* Add a new window using this class, and set the necessary * Add a new window using this class, and set the necessary
* information inside the window structure. * 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; if (!(win->winproc = class->winprocW)) win->winproc = class->winprocA;
} }
@ -532,7 +532,7 @@ void CLASS_AddWindow( CLASS *class, WND *win, WINDOWPROCTYPE type )
} }
win->class = class; win->class = class;
win->clsStyle = class->style; 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;
} }

View File

@ -55,7 +55,7 @@ static void *user_handles[NB_USER_HANDLES];
* Create a window handle with the server. * Create a window handle with the server.
*/ */
static WND *create_window_handle( HWND parent, HWND owner, ATOM atom, static WND *create_window_handle( HWND parent, HWND owner, ATOM atom,
HINSTANCE instance, WINDOWPROCTYPE type ) HINSTANCE instance, BOOL unicode )
{ {
WORD index; WORD index;
WND *win; WND *win;
@ -125,7 +125,7 @@ static WND *create_window_handle( HWND parent, HWND owner, ATOM atom,
win->flags = 0; win->flags = 0;
win->cbWndExtra = extra_bytes; win->cbWndExtra = extra_bytes;
memset( win->wExtra, 0, extra_bytes ); memset( win->wExtra, 0, extra_bytes );
CLASS_AddWindow( class, win, type ); CLASS_AddWindow( class, win, unicode );
return win; return win;
} }
@ -846,26 +846,21 @@ static void dump_window_styles( DWORD style, DWORD exstyle )
* *
* Implementation of CreateWindowEx(). * Implementation of CreateWindowEx().
*/ */
static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, ATOM classAtom, static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, ATOM classAtom, UINT flags )
WINDOWPROCTYPE type )
{ {
INT sw = SW_SHOW; INT sw = SW_SHOW;
WND *wndPtr; WND *wndPtr;
HWND hwnd, parent, owner, top_child = 0; HWND hwnd, parent, owner, top_child = 0;
BOOL unicode = (type == WIN_PROC_32W); BOOL unicode = (flags & WIN_ISUNICODE) != 0;
MDICREATESTRUCTA mdi_cs; MDICREATESTRUCTA mdi_cs;
TRACE("%s %s ex=%08lx style=%08lx %d,%d %dx%d parent=%p menu=%p inst=%p params=%p\n", 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), unicode ? 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->lpszClass) : debugstr_a(cs->lpszClass),
cs->dwExStyle, cs->style, cs->x, cs->y, cs->cx, cs->cy, cs->dwExStyle, cs->style, cs->x, cs->y, cs->cx, cs->cy,
cs->hwndParent, cs->hMenu, cs->hInstance, cs->lpCreateParams ); cs->hwndParent, cs->hMenu, cs->hInstance, cs->lpCreateParams );
if(TRACE_ON(win)) dump_window_styles( cs->style, cs->dwExStyle ); 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 */ /* Fix the styles for MDI children */
if (cs->dwExStyle & WS_EX_MDICHILD) if (cs->dwExStyle & WS_EX_MDICHILD)
{ {
@ -976,7 +971,7 @@ static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, ATOM classAtom,
/* Create the window structure */ /* 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; return 0;
hwnd = wndPtr->hwndSelf; hwnd = wndPtr->hwndSelf;
@ -995,7 +990,7 @@ static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, ATOM classAtom,
wndPtr->hIcon = 0; wndPtr->hIcon = 0;
wndPtr->hIconSmall = 0; wndPtr->hIconSmall = 0;
wndPtr->hSysMenu = 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 ); if (wndPtr->dwStyle & WS_SYSMENU) SetSystemMenu( hwnd, 0 );
@ -1172,7 +1167,7 @@ HWND16 WINAPI CreateWindowEx16( DWORD exStyle, LPCSTR className,
cs.lpszClass = className; cs.lpszClass = className;
cs.dwExStyle = exStyle; 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 exStyle, LPCSTR className,
cs.lpszClass = className; cs.lpszClass = className;
cs.dwExStyle = exStyle; 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 exStyle, LPCWSTR className,
/* Note: we rely on the fact that CREATESTRUCTA and */ /* Note: we rely on the fact that CREATESTRUCTA and */
/* CREATESTRUCTW have the same layout. */ /* CREATESTRUCTW have the same layout. */
return WIN_CreateWindowEx( (CREATESTRUCTA *)&cs, classAtom, WIN_PROC_32W ); return WIN_CreateWindowEx( (CREATESTRUCTA *)&cs, classAtom, WIN_ISWIN32 | WIN_ISUNICODE );
} }

View File

@ -79,6 +79,14 @@ typedef struct tagWINDOWPROC
WNDPROC16 proc16; /* 16-bit window proc */ WNDPROC16 proc16; /* 16-bit window proc */
} WINDOWPROC; } WINDOWPROC;
typedef enum
{
WIN_PROC_INVALID,
WIN_PROC_16,
WIN_PROC_32A,
WIN_PROC_32W
} WINDOWPROCTYPE;
#define WINPROC_HANDLE (~0UL >> 16) #define WINPROC_HANDLE (~0UL >> 16)
#define MAX_WINPROCS (0x10000 / sizeof(WINDOWPROC)) #define MAX_WINPROCS (0x10000 / sizeof(WINDOWPROC))

View File

@ -28,14 +28,6 @@
#include "wine/winbase16.h" #include "wine/winbase16.h"
#include "winnls.h" #include "winnls.h"
typedef enum
{
WIN_PROC_INVALID,
WIN_PROC_16,
WIN_PROC_32A,
WIN_PROC_32W
} WINDOWPROCTYPE;
typedef struct typedef struct
{ {
WPARAM16 wParam; WPARAM16 wParam;
@ -134,7 +126,7 @@ inline static void unmap_str_16_to_32W( LPCWSTR str )
struct tagCLASS; /* opaque structure */ struct tagCLASS; /* opaque structure */
struct tagWND; struct tagWND;
extern void CLASS_RegisterBuiltinClasses(void); 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 ); extern void CLASS_FreeModuleClasses( HMODULE16 hModule );
#endif /* __WINE_WINPROC_H */ #endif /* __WINE_WINPROC_H */