Commit 9877906b authored by Alexandre Julliard's avatar Alexandre Julliard

Removed dependencies on the internals of the CLASS structure.

Added support for having both ASCII and Unicode window procedures for builtin classes.
parent b83a16c1
......@@ -79,7 +79,7 @@ static WORD checkBoxWidth = 0, checkBoxHeight = 0;
* Called with window lock held.
*/
static inline LRESULT WINAPI ButtonWndProc_locked(WND* wndPtr, UINT uMsg,
WPARAM wParam, LPARAM lParam )
WPARAM wParam, LPARAM lParam, BOOL unicode )
{
RECT rect;
HWND hWnd = wndPtr->hwndSelf;
......@@ -215,12 +215,9 @@ static inline LRESULT WINAPI ButtonWndProc_locked(WND* wndPtr, UINT uMsg,
}
break;
case WM_NCHITTEST:
if(style == BS_GROUPBOX) return HTTRANSPARENT;
return DefWindowProcW( hWnd, uMsg, wParam, lParam );
case WM_SETTEXT:
DEFWND_SetTextW( wndPtr, (LPCWSTR)lParam );
if (unicode) DEFWND_SetTextW( wndPtr, (LPCWSTR)lParam );
else DEFWND_SetTextA( wndPtr, (LPCSTR)lParam );
if( wndPtr->dwStyle & WS_VISIBLE )
PAINT_BUTTON( wndPtr, style, ODA_DRAWENTIRE );
return 1; /* success. FIXME: check text length */
......@@ -352,30 +349,49 @@ static inline LRESULT WINAPI ButtonWndProc_locked(WND* wndPtr, UINT uMsg,
PAINT_BUTTON( wndPtr, style, ODA_SELECT );
break;
case WM_NCHITTEST:
if(style == BS_GROUPBOX) return HTTRANSPARENT;
/* fall through */
default:
return DefWindowProcW(hWnd, uMsg, wParam, lParam);
return unicode ? DefWindowProcW(hWnd, uMsg, wParam, lParam) :
DefWindowProcA(hWnd, uMsg, wParam, lParam);
}
return 0;
}
/***********************************************************************
* ButtonWndProc
* ButtonWndProcW
* The button window procedure. This is just a wrapper which locks
* the passed HWND and calls the real window procedure (with a WND*
* pointer pointing to the locked windowstructure).
*/
LRESULT WINAPI ButtonWndProc( HWND hWnd, UINT uMsg,
WPARAM wParam, LPARAM lParam )
LRESULT WINAPI ButtonWndProcW( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
{
LRESULT res;
WND *wndPtr = WIN_FindWndPtr(hWnd);
res = ButtonWndProc_locked(wndPtr,uMsg,wParam,lParam);
res = ButtonWndProc_locked(wndPtr,uMsg,wParam,lParam,TRUE);
WIN_ReleaseWndPtr(wndPtr);
return res;
}
/***********************************************************************
* ButtonWndProcA
*/
LRESULT WINAPI ButtonWndProcA( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
{
LRESULT res;
WND *wndPtr = WIN_FindWndPtr(hWnd);
res = ButtonWndProc_locked(wndPtr,uMsg,wParam,lParam,FALSE);
WIN_ReleaseWndPtr(wndPtr);
return res;
}
/**********************************************************************
* Push Button Functions
*/
......
......@@ -96,10 +96,12 @@ static LRESULT DESKTOP_DoEraseBkgnd( HWND hwnd, HDC hdc,
(!desktopPtr->fTileWallPaper && ((desktopPtr->bitmapSize.cx < rect.right) ||
(desktopPtr->bitmapSize.cy < rect.bottom))))
{
HBRUSH brush = desktopPtr->hbrushPattern;
if (!brush) brush = GetClassLongA( hwnd, GCL_HBRBACKGROUND );
/* Set colors in case pattern is a monochrome bitmap */
SetBkColor( hdc, RGB(0,0,0) );
SetTextColor( hdc, GetSysColor(COLOR_BACKGROUND) );
FillRect( hdc, &rect, desktopPtr->hbrushPattern );
FillRect( hdc, &rect, brush );
}
/* Paint wall paper */
......@@ -289,7 +291,7 @@ BOOL DESKTOP_SetPattern( LPCSTR pattern )
desktopPtr->hbrushPattern = CreatePatternBrush( hbitmap );
DeleteObject( hbitmap );
}
else desktopPtr->hbrushPattern = CreateSolidBrush( GetSysColor(COLOR_BACKGROUND) );
else desktopPtr->hbrushPattern = 0;
WIN_ReleaseDesktop();
return TRUE;
}
......
......@@ -19,106 +19,49 @@
#include "static.h"
#include "wine/unicode.h"
/* Built-in classes */
static const char bi_class_nameA[BIC32_NB_CLASSES][10] =
{
"Button",
"Edit",
"ListBox",
"ComboBox",
"ComboLBox",
POPUPMENU_CLASS_NAME,
"Static",
"ScrollBar",
"MDIClient",
DESKTOP_CLASS_NAME,
DIALOG_CLASS_NAME,
ICONTITLE_CLASS_NAME
};
static const WCHAR bi_class_nameW[BIC32_NB_CLASSES][10] =
struct builtin_class
{
{'B','u','t','t','o','n',0},
{'E','d','i','t',0},
{'L','i','s','t','B','o','x',0},
{'C','o','m','b','o','B','o','x',0},
{'C','o','m','b','o','L','B','o','x',0},
{'#','3','2','7','6','8',0},
{'S','t','a','t','i','c',0},
{'S','c','r','o','l','l','B','a','r',0},
{'M','D','I','C','l','i','e','n','t',0},
{'#','3','2','7','6','9',0},
{'#','3','2','7','7','0',0},
{'#','3','2','7','7','2',0}
LPCSTR name;
UINT style;
WNDPROC procA;
WNDPROC procW;
INT extra;
LPCSTR cursor;
HBRUSH brush;
};
typedef struct {
BOOL unicode;
union {
WNDCLASSA A;
WNDCLASSW W;
} wnd_class;
} BUILTINCLASS;
static BUILTINCLASS WIDGETS_BuiltinClasses[BIC32_NB_CLASSES] =
/* Under NT all builtin classes have both ASCII and Unicode window
* procedures except ScrollBar, PopupMenu, Desktop, WinSwitch and
* IconTitle which are Unicode-only.
*/
static const struct builtin_class classes[] =
{
/* BIC32_BUTTON */
{ TRUE, {
{ CS_GLOBALCLASS | CS_DBLCLKS | CS_VREDRAW | CS_HREDRAW | CS_PARENTDC,
ButtonWndProc, 0, sizeof(BUTTONINFO), 0, 0,
(HCURSOR)IDC_ARROWW, 0, 0, (LPCSTR)bi_class_nameW[0] }}},
/* BIC32_EDIT */
{ FALSE, {
{ CS_GLOBALCLASS | CS_DBLCLKS /*| CS_PARENTDC*/,
EditWndProc, 0, sizeof(void *), 0, 0,
(HCURSOR)IDC_IBEAMA, 0, 0, bi_class_nameA[1] }}},
/* BIC32_LISTBOX */
{ FALSE, {
{ CS_GLOBALCLASS | CS_DBLCLKS /*| CS_PARENTDC*/,
ListBoxWndProc, 0, sizeof(void *), 0, 0,
(HCURSOR)IDC_ARROWA, 0, 0, bi_class_nameA[2] }}},
/* BIC32_COMBO */
{ FALSE, {
{ CS_GLOBALCLASS | CS_PARENTDC | CS_DBLCLKS,
ComboWndProc, 0, sizeof(void *), 0, 0,
(HCURSOR)IDC_ARROWA, 0, 0, bi_class_nameA[3] }}},
/* BIC32_COMBOLB */
{ FALSE, {
{ CS_GLOBALCLASS | CS_DBLCLKS | CS_SAVEBITS, ComboLBWndProc,
0, sizeof(void *), 0, 0, (HCURSOR)IDC_ARROWA, 0, 0, bi_class_nameA[4] }}},
/* BIC32_POPUPMENU */
{ FALSE, {
{ CS_GLOBALCLASS | CS_SAVEBITS, PopupMenuWndProc, 0, sizeof(HMENU),
0, 0, (HCURSOR)IDC_ARROWA, NULL_BRUSH, 0, bi_class_nameA[5] }}},
/* BIC32_STATIC */
{ FALSE, {
{ CS_GLOBALCLASS | CS_DBLCLKS | CS_PARENTDC, StaticWndProc,
0, sizeof(STATICINFO), 0, 0, (HCURSOR)IDC_ARROWA, 0, 0, bi_class_nameA[6] }}},
/* BIC32_SCROLL */
{ FALSE, {
{ CS_GLOBALCLASS | CS_DBLCLKS | CS_VREDRAW | CS_HREDRAW | CS_PARENTDC,
ScrollBarWndProc, 0, sizeof(SCROLLBAR_INFO), 0, 0,
(HCURSOR)IDC_ARROWA, 0, 0, bi_class_nameA[7] }}},
/* BIC32_MDICLIENT */
{ FALSE, {
{ CS_GLOBALCLASS, MDIClientWndProc,
0, sizeof(MDICLIENTINFO), 0, 0, (HCURSOR)IDC_ARROWA, STOCK_LTGRAY_BRUSH, 0, bi_class_nameA[8] }}},
/* BIC32_DESKTOP */
{ FALSE, {
{ CS_GLOBALCLASS, DesktopWndProc, 0, sizeof(DESKTOP),
0, 0, (HCURSOR)IDC_ARROWA, 0, 0, bi_class_nameA[9] }}},
/* BIC32_DIALOG */
{ FALSE, {
{ CS_GLOBALCLASS | CS_SAVEBITS, DefDlgProcA, 0, DLGWINDOWEXTRA,
0, 0, (HCURSOR)IDC_ARROWA, 0, 0, bi_class_nameA[10] }}},
/* BIC32_ICONTITLE */
{ FALSE, {
{ CS_GLOBALCLASS, IconTitleWndProc, 0, 0,
0, 0, (HCURSOR)IDC_ARROWA, 0, 0, bi_class_nameA[11] }}}
{ "Button", CS_GLOBALCLASS | CS_DBLCLKS | CS_VREDRAW | CS_HREDRAW | CS_PARENTDC,
ButtonWndProcA, ButtonWndProcW, sizeof(BUTTONINFO), IDC_ARROWA, 0 },
{ "Edit", CS_GLOBALCLASS | CS_DBLCLKS /*| CS_PARENTDC*/,
EditWndProc, NULL, sizeof(void *), IDC_IBEAMA, 0 },
{ "ListBox", CS_GLOBALCLASS | CS_DBLCLKS /*| CS_PARENTDC*/,
ListBoxWndProc, NULL, sizeof(void *), IDC_ARROWA, 0 },
{ "ComboBox", CS_GLOBALCLASS | CS_PARENTDC | CS_DBLCLKS,
ComboWndProc, NULL, sizeof(void *), IDC_ARROWA, 0 },
{ "ComboLBox", CS_GLOBALCLASS | CS_DBLCLKS | CS_SAVEBITS,
ComboLBWndProc, NULL, sizeof(void *), IDC_ARROWA, 0 },
{ "Static", CS_GLOBALCLASS | CS_DBLCLKS | CS_PARENTDC,
StaticWndProc, NULL, sizeof(STATICINFO), IDC_ARROWA, 0 },
{ "ScrollBar", CS_GLOBALCLASS | CS_DBLCLKS | CS_VREDRAW | CS_HREDRAW | CS_PARENTDC,
ScrollBarWndProc, NULL, sizeof(SCROLLBAR_INFO), IDC_ARROWA, 0 },
{ "MDIClient", CS_GLOBALCLASS,
MDIClientWndProc, NULL, sizeof(MDICLIENTINFO), IDC_ARROWA, STOCK_LTGRAY_BRUSH },
{ POPUPMENU_CLASS_NAME, CS_GLOBALCLASS | CS_SAVEBITS,
PopupMenuWndProc, NULL, sizeof(HMENU), IDC_ARROWA, COLOR_MENU+1 },
{ DESKTOP_CLASS_NAME, CS_GLOBALCLASS,
DesktopWndProc, NULL, sizeof(DESKTOP), IDC_ARROWA, COLOR_BACKGROUND+1 },
{ DIALOG_CLASS_NAME, CS_GLOBALCLASS | CS_SAVEBITS,
DefDlgProcA, DefDlgProcW, DLGWINDOWEXTRA, IDC_ARROWA, 0 },
{ ICONTITLE_CLASS_NAME, CS_GLOBALCLASS,
IconTitleWndProc, NULL, 0, IDC_ARROWA, 0 }
};
static ATOM bicAtomTable[BIC32_NB_CLASSES];
/***********************************************************************
* WIDGETS_Init
......@@ -127,44 +70,14 @@ static ATOM bicAtomTable[BIC32_NB_CLASSES];
*/
BOOL WIDGETS_Init(void)
{
const struct builtin_class *cls = classes;
int i;
BUILTINCLASS *cls = WIDGETS_BuiltinClasses;
/* Create builtin classes */
for (i = 0; i < BIC32_NB_CLASSES; i++, cls++)
for (i = 0; i < sizeof(classes)/sizeof(classes[0]); i++, cls++)
{
if(cls->unicode)
{
WCHAR nameW[20];
/* Just to make sure the string is > 0x10000 */
strcpyW( nameW, (WCHAR *)cls->wnd_class.W.lpszClassName );
cls->wnd_class.W.lpszClassName = nameW;
cls->wnd_class.W.hCursor = LoadCursorW( 0, (LPCWSTR)cls->wnd_class.W.hCursor );
if (!(bicAtomTable[i] = RegisterClassW( &(cls->wnd_class.W) ))) return FALSE;
}
else
{
char name[20];
/* Just to make sure the string is > 0x10000 */
strcpy( name, (char *)cls->wnd_class.A.lpszClassName );
cls->wnd_class.A.lpszClassName = name;
cls->wnd_class.A.hCursor = LoadCursorA( 0, (LPCSTR)cls->wnd_class.A.hCursor );
if (!(bicAtomTable[i] = RegisterClassA( &(cls->wnd_class.A) ))) return FALSE;
}
if (!CLASS_RegisterBuiltinClass( cls->name, cls->style, cls->extra, cls->cursor,
cls->brush, cls->procA, cls->procW ))
return FALSE;
}
return TRUE;
}
/***********************************************************************
* WIDGETS_IsControl32
*
* Check whether pWnd is a built-in control or not.
*/
BOOL WIDGETS_IsControl( WND* pWnd, BUILTIN_CLASS32 cls )
{
assert( cls < BIC32_NB_CLASSES );
return (GetClassWord(pWnd->hwndSelf, GCW_ATOM) == bicAtomTable[cls]);
}
......@@ -143,8 +143,8 @@ extern HANDLE TTYDRV_LoadOEMResource(WORD resid, WORD type);
extern void TTYDRV_WND_Initialize(struct tagWND *wndPtr);
extern void TTYDRV_WND_Finalize(struct tagWND *wndPtr);
extern BOOL TTYDRV_WND_CreateDesktopWindow(struct tagWND *wndPtr, struct tagCLASS *classPtr, BOOL bUnicode);
extern BOOL TTYDRV_WND_CreateWindow(struct tagWND *wndPtr, struct tagCLASS *classPtr, struct tagCREATESTRUCTA *cs, BOOL bUnicode);
extern BOOL TTYDRV_WND_CreateDesktopWindow(struct tagWND *wndPtr, BOOL bUnicode);
extern BOOL TTYDRV_WND_CreateWindow(struct tagWND *wndPtr, struct tagCREATESTRUCTA *cs, BOOL bUnicode);
extern BOOL TTYDRV_WND_DestroyWindow(struct tagWND *pWnd);
extern struct tagWND *TTYDRV_WND_SetParent(struct tagWND *wndPtr, struct tagWND *pWndParent);
extern void TTYDRV_WND_ForceWindowRaise(struct tagWND *pWnd);
......
......@@ -6,7 +6,6 @@
#include "config.h"
#include "class.h"
#include "gdi.h"
#include "heap.h"
#include "ttydrv.h"
......@@ -89,12 +88,12 @@ void TTYDRV_WND_Finalize(WND *wndPtr)
/**********************************************************************
* TTYDRV_WND_CreateDesktopWindow
*/
BOOL TTYDRV_WND_CreateDesktopWindow(WND *wndPtr, CLASS *classPtr, BOOL bUnicode)
BOOL TTYDRV_WND_CreateDesktopWindow(WND *wndPtr, BOOL bUnicode)
{
TTYDRV_WND_DATA *pWndDriverData =
(TTYDRV_WND_DATA *) wndPtr->pDriverData;
TRACE("(%p, %p, %d)\n", wndPtr, classPtr, bUnicode);
TRACE("(%p, %d)\n", wndPtr, bUnicode);
if(!pWndDriverData) { ERR("WND never initialized\n"); return FALSE; }
......@@ -105,13 +104,13 @@ BOOL TTYDRV_WND_CreateDesktopWindow(WND *wndPtr, CLASS *classPtr, BOOL bUnicode)
/**********************************************************************
* TTYDRV_WND_CreateWindow
*/
BOOL TTYDRV_WND_CreateWindow(WND *wndPtr, CLASS *classPtr, CREATESTRUCTA *cs, BOOL bUnicode)
BOOL TTYDRV_WND_CreateWindow(WND *wndPtr, CREATESTRUCTA *cs, BOOL bUnicode)
{
#ifdef WINE_CURSES
WINDOW *window;
INT cellWidth=8, cellHeight=8; /* FIXME: Hardcoded */
TRACE("(%p, %p, %p, %d)\n", wndPtr, classPtr, cs, bUnicode);
TRACE("(%p, %p, %d)\n", wndPtr, cs, bUnicode);
/* Only create top-level windows */
if(cs->style & WS_CHILD)
......@@ -124,7 +123,7 @@ BOOL TTYDRV_WND_CreateWindow(WND *wndPtr, CLASS *classPtr, CREATESTRUCTA *cs, BO
return TRUE;
#else /* defined(WINE_CURSES) */
FIXME("(%p, %p, %p, %d): stub\n", wndPtr, classPtr, cs, bUnicode);
FIXME("(%p, %p, %p, %d): stub\n", wndPtr, cs, bUnicode);
return TRUE;
#endif /* defined(WINE_CURSES) */
......
......@@ -378,12 +378,12 @@ owner user32
394 pascal16 DrawIconEx(word word word word word word word word word) DrawIconEx16
395 pascal16 GetIconInfo(word ptr) GetIconInfo16
397 pascal16 RegisterClassEx(ptr) RegisterClassEx16
398 pascal16 GetClassInfoEx(word str ptr) GetClassInfoEx16
398 pascal16 GetClassInfoEx(word segstr ptr) GetClassInfoEx16
399 pascal16 ChildWindowFromPointEx(word long word) ChildWindowFromPointEx16
400 pascal16 FinalUserInit() FinalUserInit16
402 pascal16 GetPriorityClipboardFormat(ptr s_word) GetPriorityClipboardFormat16
403 pascal16 UnregisterClass(str word) UnregisterClass16
404 pascal16 GetClassInfo(word str ptr) GetClassInfo16
404 pascal16 GetClassInfo(word segstr ptr) GetClassInfo16
406 pascal16 CreateCursor(word word word word word ptr ptr) CreateCursor16
407 pascal16 CreateIcon(word word word word word ptr ptr) CreateIcon16
408 pascal16 CreateCursorIconIndirect(word ptr ptr ptr)
......
......@@ -35,7 +35,7 @@ typedef struct
#define BUTTON_STATE(hwnd) ((WIN_FindWndPtr(hwnd))->wExtra[0])
extern LRESULT WINAPI ButtonWndProc( HWND hWnd, UINT uMsg,
WPARAM wParam, LPARAM lParam );
extern LRESULT WINAPI ButtonWndProcA( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
extern LRESULT WINAPI ButtonWndProcW( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
#endif /* __WINE_BUTTON_H */
/*
* Window classes definitions
*
* Copyright 1993 Alexandre Julliard
*/
#ifndef __WINE_CLASS_H
#define __WINE_CLASS_H
#include "windef.h"
#include "winproc.h"
#define CLASS_MAGIC ('C' | ('L' << 8) | ('A' << 16) | ('S' << 24))
struct tagDCE;
typedef struct tagCLASS
{
struct tagCLASS *next; /* Next class */
UINT magic; /* Magic number */
UINT cWindows; /* Count of existing windows */
UINT style; /* Class style */
HWINDOWPROC winproc; /* Window procedure */
INT cbClsExtra; /* Class extra bytes */
INT cbWndExtra; /* Window extra bytes */
LPSTR menuNameA; /* Default menu name (ASCII string) */
LPWSTR menuNameW; /* Default menu name (Unicode) */
struct tagDCE *dce; /* Class DCE (if CS_CLASSDC) */
HINSTANCE hInstance; /* Module that created the task */
HICON16 hIcon; /* Default icon */
HICON16 hIconSm; /* Default small icon */
HCURSOR16 hCursor; /* Default cursor */
HBRUSH16 hbrBackground; /* Default background */
ATOM atomName; /* Name of the class */
LPSTR classNameA; /* Class name (ASCII string) */
LPWSTR classNameW; /* Class name (Unicode) */
LONG wExtra[1]; /* Class extra bytes */
} CLASS;
extern void CLASS_DumpClass( CLASS *class );
extern void CLASS_WalkClasses(void);
extern void CLASS_FreeModuleClasses( HMODULE16 hModule );
extern CLASS *CLASS_FindClassByAtom( ATOM atom, HINSTANCE hinstance );
#endif /* __WINE_CLASS_H */
......@@ -28,24 +28,6 @@
#define WINSWITCH_CLASS_ATOM MAKEINTATOM(32771) /* WinSwitch */
#define ICONTITLE_CLASS_ATOM MAKEINTATOM(32772) /* IconTitle */
/* Built-in 32-bit classes */
typedef enum
{
BIC32_BUTTON,
BIC32_EDIT,
BIC32_LISTBOX,
BIC32_COMBO,
BIC32_COMBOLB,
BIC32_POPUPMENU,
BIC32_STATIC,
BIC32_SCROLL,
BIC32_MDICLIENT,
BIC32_DESKTOP,
BIC32_DIALOG,
BIC32_ICONTITLE,
BIC32_NB_CLASSES
} BUILTIN_CLASS32;
/* PAINT_RedrawWindow() control flags */
#define RDW_EX_USEHRGN 0x0001
#define RDW_EX_DELETEHRGN 0x0002
......@@ -79,13 +61,15 @@ typedef struct tagWND
HGLOBAL16 hmemTaskQ; /* Task queue global memory handle */
HRGN16 hrgnUpdate; /* Update region */
HRGN hrgnWnd; /* window's region */
HWND hwndLastActive;/* Last active popup hwnd */
HWND hwndLastActive;/* Last active popup hwnd */
DWORD dwStyle; /* Window style (from CreateWindow) */
DWORD dwExStyle; /* Extended style (from CreateWindowEx) */
UINT wIDmenu; /* ID or hmenu (from CreateWindow) */
DWORD clsStyle; /* Class style at window creation */
UINT wIDmenu; /* ID or hmenu (from CreateWindow) */
DWORD helpContext; /* Help context ID */
WORD flags; /* Misc. flags (see below) */
HMENU16 hSysMenu; /* window's copy of System Menu */
int cbWndExtra; /* class cbWndExtra at window creation */
int irefCount; /* window's reference count*/
DWORD userdata; /* User private data */
struct tagWND_DRIVER *pDriver; /* Window driver */
......@@ -118,8 +102,8 @@ typedef struct tagWND_DRIVER
{
void (*pInitialize)(WND *);
void (*pFinalize)(WND *);
BOOL (*pCreateDesktopWindow)(WND *, struct tagCLASS *, BOOL);
BOOL (*pCreateWindow)(WND *, struct tagCLASS *, CREATESTRUCTA *, BOOL);
BOOL (*pCreateDesktopWindow)(WND *, BOOL);
BOOL (*pCreateWindow)(WND *, CREATESTRUCTA *, BOOL);
BOOL (*pDestroyWindow)(WND *);
WND* (*pSetParent)(WND *, WND *);
void (*pForceWindowRaise)(WND *);
......@@ -215,9 +199,18 @@ extern BOOL PAINT_RedrawWindow( HWND hwnd, const RECT *rectUpdate,
UINT control ); /* windows/painting.c */
extern HRGN WIN_UpdateNCRgn(WND* wnd, HRGN hRgn, UINT flags); /* windows/painting.c */
/* Classes functions */
struct tagCLASS; /* opaque structure */
extern ATOM CLASS_RegisterBuiltinClass( LPCSTR name, DWORD style, INT winExtra, LPCSTR cursor,
HBRUSH brush, WNDPROC wndProcA, WNDPROC wndProcW );
extern struct tagCLASS *CLASS_AddWindow( ATOM atom, HINSTANCE inst, WINDOWPROCTYPE type,
INT *winExtra, WNDPROC *winproc,
DWORD *style, struct tagDCE **dce );
extern void CLASS_RemoveWindow( struct tagCLASS *cls );
extern void CLASS_FreeModuleClasses( HMODULE16 hModule );
/* controls/widgets.c */
extern BOOL WIDGETS_Init( void );
extern BOOL WIDGETS_IsControl( WND* pWnd, BUILTIN_CLASS32 cls );
/* controls/icontitle.c */
extern LRESULT WINAPI IconTitleWndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam );
......
......@@ -710,8 +710,8 @@ WORD WINAPI GetAsyncKeyState16(INT16);
HWND16 WINAPI GetCapture16(void);
UINT16 WINAPI GetCaretBlinkTime16(void);
VOID WINAPI GetCaretPos16(LPPOINT16);
BOOL16 WINAPI GetClassInfo16(HINSTANCE16,LPCSTR,WNDCLASS16 *);
BOOL16 WINAPI GetClassInfoEx16(HINSTANCE16,LPCSTR,WNDCLASSEX16 *);
BOOL16 WINAPI GetClassInfo16(HINSTANCE16,SEGPTR,WNDCLASS16 *);
BOOL16 WINAPI GetClassInfoEx16(HINSTANCE16,SEGPTR,WNDCLASSEX16 *);
LONG WINAPI GetClassLong16(HWND16,INT16);
INT16 WINAPI GetClassName16(HWND16,LPSTR,INT16);
WORD WINAPI GetClassWord16(HWND16,INT16);
......
......@@ -417,8 +417,8 @@ extern Window X11DRV_WND_FindXWindow(struct tagWND *wndPtr);
extern void X11DRV_WND_Initialize(struct tagWND *wndPtr);
extern void X11DRV_WND_Finalize(struct tagWND *wndPtr);
extern BOOL X11DRV_WND_CreateDesktopWindow(struct tagWND *wndPtr, struct tagCLASS *classPtr, BOOL bUnicode);
extern BOOL X11DRV_WND_CreateWindow(struct tagWND *wndPtr, struct tagCLASS *classPtr, struct tagCREATESTRUCTA *cs, BOOL bUnicode);
extern BOOL X11DRV_WND_CreateDesktopWindow(struct tagWND *wndPtr, BOOL bUnicode);
extern BOOL X11DRV_WND_CreateWindow(struct tagWND *wndPtr, struct tagCREATESTRUCTA *cs, BOOL bUnicode);
extern BOOL X11DRV_WND_DestroyWindow(struct tagWND *pWnd);
extern struct tagWND *X11DRV_WND_SetParent(struct tagWND *wndPtr, struct tagWND *pWndParent);
extern void X11DRV_WND_ForceWindowRaise(struct tagWND *pWnd);
......
......@@ -20,7 +20,6 @@
#include <assert.h>
#include "options.h"
#include "dce.h"
#include "class.h"
#include "win.h"
#include "gdi.h"
#include "region.h"
......@@ -161,7 +160,7 @@ void DCE_FreeWindowDCE( WND* pWnd )
{
if( pDCE == pWnd->dce ) /* owned or Class DCE*/
{
if (pWnd->class->style & CS_OWNDC) /* owned DCE*/
if (pWnd->clsStyle & CS_OWNDC) /* owned DCE*/
{
pDCE = DCE_FreeDCE( pDCE );
pWnd->dce = NULL;
......@@ -676,7 +675,7 @@ HDC WINAPI GetDCEx( HWND hwnd, HRGN hrgnClip, DWORD flags )
/* fixup flags */
if (!(wndPtr->class->style & (CS_OWNDC | CS_CLASSDC))) flags |= DCX_CACHE;
if (!wndPtr->dce) flags |= DCX_CACHE;
if (flags & DCX_USESTYLE)
{
......@@ -687,7 +686,7 @@ HDC WINAPI GetDCEx( HWND hwnd, HRGN hrgnClip, DWORD flags )
if ( !(flags & DCX_WINDOW) )
{
if (wndPtr->class->style & CS_PARENTDC) flags |= DCX_PARENTCLIP;
if (wndPtr->clsStyle & CS_PARENTDC) flags |= DCX_PARENTCLIP;
if (wndPtr->dwStyle & WS_CLIPCHILDREN &&
!(wndPtr->dwStyle & WS_MINIMIZE) ) flags |= DCX_CLIPCHILDREN;
......@@ -767,7 +766,7 @@ HDC WINAPI GetDCEx( HWND hwnd, HRGN hrgnClip, DWORD flags )
}
else
{
dce = (wndPtr->class->style & CS_OWNDC) ? wndPtr->dce : wndPtr->class->dce;
dce = wndPtr->dce;
if( dce->hwndCurrent == hwnd )
{
TRACE("\tskipping hVisRgn update\n");
......
......@@ -7,7 +7,6 @@
#include <string.h>
#include "class.h"
#include "win.h"
#include "user.h"
#include "heap.h"
......@@ -324,7 +323,8 @@ static LRESULT DEFWND_DefWinProc( WND *wndPtr, UINT msg, WPARAM wParam,
HDC16 hdc = BeginPaint16( wndPtr->hwndSelf, &ps );
if( hdc )
{
if( (wndPtr->dwStyle & WS_MINIMIZE) && wndPtr->class->hIcon )
HICON hIcon;
if( (wndPtr->dwStyle & WS_MINIMIZE) && ((hIcon = GetClassLongA( wndPtr->hwndSelf, GCL_HICON))) )
{
int x = (wndPtr->rectWindow.right - wndPtr->rectWindow.left -
GetSystemMetrics(SM_CXICON))/2;
......@@ -332,7 +332,7 @@ static LRESULT DEFWND_DefWinProc( WND *wndPtr, UINT msg, WPARAM wParam,
GetSystemMetrics(SM_CYICON))/2;
TRACE("Painting class icon: vis rect=(%i,%i - %i,%i)\n",
ps.rcPaint.left, ps.rcPaint.top, ps.rcPaint.right, ps.rcPaint.bottom );
DrawIcon( hdc, x, y, wndPtr->class->hIcon );
DrawIcon( hdc, x, y, hIcon );
}
EndPaint16( wndPtr->hwndSelf, &ps );
}
......@@ -387,8 +387,8 @@ static LRESULT DEFWND_DefWinProc( WND *wndPtr, UINT msg, WPARAM wParam,
case WM_ICONERASEBKGND:
{
RECT rect;
if (!wndPtr->class->hbrBackground) return 0;
HBRUSH hbr = GetClassLongA( wndPtr->hwndSelf, GCL_HBRBACKGROUND );
if (!hbr) return 0;
/* Since WM_ERASEBKGND may receive either a window dc or a */
/* client dc, the area to be erased has to be retrieved from */
......@@ -400,7 +400,7 @@ static LRESULT DEFWND_DefWinProc( WND *wndPtr, UINT msg, WPARAM wParam,
* supports special background brushes for a window class,
* the Win16 variant of FillRect does not.
*/
FillRect( (HDC) wParam, &rect, wndPtr->class->hbrBackground);
FillRect( (HDC) wParam, &rect, hbr );
return 1;
}
......@@ -457,7 +457,7 @@ static LRESULT DEFWND_DefWinProc( WND *wndPtr, UINT msg, WPARAM wParam,
{
HWND hWnd = WIN_GetTopParent( wndPtr->hwndSelf );
wndPtr = WIN_FindWndPtr( hWnd );
if( wndPtr && !(wndPtr->class->style & CS_NOCLOSE) )
if( wndPtr && !(wndPtr->clsStyle & CS_NOCLOSE) )
PostMessage16( hWnd, WM_SYSCOMMAND, SC_CLOSE, 0 );
WIN_ReleaseWndPtr(wndPtr);
}
......@@ -528,10 +528,10 @@ static LRESULT DEFWND_DefWinProc( WND *wndPtr, UINT msg, WPARAM wParam,
case WM_QUERYDRAGICON:
{
HICON16 hIcon=0;
UINT16 len;
if( (hIcon=wndPtr->class->hCursor) ) return (LRESULT)hIcon;
HICON hIcon = GetClassLongA( wndPtr->hwndSelf, GCL_HICON );
if (hIcon) return hIcon;
for(len=1; len<64; len++)
if((hIcon=LoadIconA(wndPtr->hInstance,MAKEINTRESOURCEA(len))))
return (LRESULT)hIcon;
......
......@@ -75,7 +75,6 @@
#include "winuser.h"
#include "wine/unicode.h"
#include "win.h"
#include "class.h"
#include "heap.h"
#include "nonclient.h"
#include "mdi.h"
......@@ -1647,7 +1646,7 @@ LRESULT WINAPI DefMDIChildProc16( HWND16 hwnd, UINT16 message,
WIN_ReleaseWndPtr(tmpWnd);
/* Sanity check */
if (clientWnd->class->cbWndExtra < sizeof(MDICLIENTINFO))
if (clientWnd->cbWndExtra < sizeof(MDICLIENTINFO))
{
WARN("called on non-MDI child window %x\n", hwnd);
WIN_ReleaseWndPtr(clientWnd);
......@@ -1847,7 +1846,7 @@ LRESULT WINAPI DefMDIChildProcA( HWND hwnd, UINT message,
WIN_ReleaseWndPtr(tmpWnd);
/* Sanity check */
if (clientWnd->class->cbWndExtra < sizeof(MDICLIENTINFO))
if (clientWnd->cbWndExtra < sizeof(MDICLIENTINFO))
{
WARN("called on non-MDI child window %x\n", hwnd);
WIN_ReleaseWndPtr(clientWnd);
......@@ -1925,7 +1924,7 @@ LRESULT WINAPI DefMDIChildProcW( HWND hwnd, UINT message,
WIN_ReleaseWndPtr(tmpWnd);
/* Sanity check */
if (clientWnd->class->cbWndExtra < sizeof(MDICLIENTINFO))
if (clientWnd->cbWndExtra < sizeof(MDICLIENTINFO))
{
WARN("called on non-MDI child window %x\n", hwnd);
WIN_ReleaseWndPtr(clientWnd);
......
......@@ -14,7 +14,6 @@
#include "user.h"
#include "task.h"
#include "queue.h"
#include "class.h"
#include "win.h"
#include "clipboard.h"
#include "menu.h"
......
......@@ -26,7 +26,6 @@
#include "heap.h"
#include "win.h"
#include "windef.h"
#include "class.h"
#include "x11drv.h"
#include "wingdi.h"
#include "winnls.h"
......@@ -174,7 +173,7 @@ void X11DRV_WND_Finalize(WND *wndPtr)
/**********************************************************************
* X11DRV_WND_CreateDesktopWindow
*/
BOOL X11DRV_WND_CreateDesktopWindow(WND *wndPtr, CLASS *classPtr, BOOL bUnicode)
BOOL X11DRV_WND_CreateDesktopWindow(WND *wndPtr, BOOL bUnicode)
{
if (wmProtocols == None)
wmProtocols = TSXInternAtom( display, "WM_PROTOCOLS", True );
......@@ -306,7 +305,7 @@ static void X11DRV_WND_UpdateIconHints(WND *wndPtr)
/**********************************************************************
* X11DRV_WND_CreateWindow
*/
BOOL X11DRV_WND_CreateWindow(WND *wndPtr, CLASS *classPtr, CREATESTRUCTA *cs, BOOL bUnicode)
BOOL X11DRV_WND_CreateWindow(WND *wndPtr, CREATESTRUCTA *cs, BOOL bUnicode)
{
/* Create the X window (only for top-level windows, and then only */
/* when there's no desktop window) */
......@@ -336,10 +335,10 @@ BOOL X11DRV_WND_CreateWindow(WND *wndPtr, CLASS *classPtr, CREATESTRUCTA *cs, BO
}
wndPtr->flags |= WIN_NATIVE;
win_attr.bit_gravity = (classPtr->style & (CS_VREDRAW | CS_HREDRAW)) ? BGForget : BGNorthWest;
win_attr.bit_gravity = (wndPtr->clsStyle & (CS_VREDRAW | CS_HREDRAW)) ? BGForget : BGNorthWest;
win_attr.colormap = X11DRV_PALETTE_PaletteXColormap;
win_attr.backing_store = NotUseful;
win_attr.save_under = ((classPtr->style & CS_SAVEBITS) != 0);
win_attr.save_under = ((wndPtr->clsStyle & CS_SAVEBITS) != 0);
win_attr.cursor = X11DRV_MOUSE_XCursor;
((X11DRV_WND_DATA *) wndPtr->pDriverData)->hWMIconBitmap = 0;
......@@ -520,8 +519,7 @@ WND *X11DRV_WND_SetParent(WND *wndPtr, WND *pWndParent)
cs.lpszName = 0; /* not used in following call */
cs.lpszClass = 0; /*not used in following call */
cs.dwExStyle = wndPtr->dwExStyle;
X11DRV_WND_CreateWindow(wndPtr, wndPtr->class,
&cs, FALSE);
X11DRV_WND_CreateWindow(wndPtr, &cs, FALSE);
}
}
else /* a child window */
......@@ -759,7 +757,7 @@ void X11DRV_WND_SetWindowPos(WND *wndPtr, const WINDOWPOS *winpos, BOOL bChangeP
if (changeMask && X11DRV_WND_GetXWindow(winposPtr))
{
TSXReconfigureWMWindow( display, X11DRV_WND_GetXWindow(winposPtr), 0, changeMask, &winChanges );
if( winposPtr->class->style & (CS_VREDRAW | CS_HREDRAW) )
if( winposPtr->clsStyle & (CS_VREDRAW | CS_HREDRAW) )
X11DRV_WND_SetHostAttr( winposPtr, HAK_BITGRAVITY, BGForget );
}
}
......@@ -937,7 +935,7 @@ void X11DRV_WND_SetDrawable(WND *wndPtr, HDC hdc, WORD flags, BOOL bSetClipOrigi
* modify the origin and reset the clipping. When the clipping is set,
* it is moved according to the new DC origin.
*/
if ( (wndPtr->class->style & (CS_OWNDC | CS_CLASSDC)) && (dc->hClipRgn > 0))
if ( (wndPtr->clsStyle & (CS_OWNDC | CS_CLASSDC)) && (dc->hClipRgn > 0))
{
dcOrgXCopy = dc->DCOrgX;
dcOrgYCopy = dc->DCOrgY;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment