Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
ed693f5b
Commit
ed693f5b
authored
Jul 29, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
Aug 08, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32u: Move builtin classes registration from user32.
parent
30209d86
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
107 additions
and
229 deletions
+107
-229
button.c
dlls/user32/button.c
+0
-13
class.c
dlls/user32/class.c
+2
-41
combo.c
dlls/user32/combo.c
+0
-14
controls.h
dlls/user32/controls.h
+0
-24
dialog.c
dlls/user32/dialog.c
+0
-14
edit.c
dlls/user32/edit.c
+0
-14
icontitle.c
dlls/user32/icontitle.c
+0
-13
listbox.c
dlls/user32/listbox.c
+0
-27
mdi.c
dlls/user32/mdi.c
+0
-14
menu.c
dlls/user32/menu.c
+0
-13
misc.c
dlls/user32/misc.c
+0
-10
scroll.c
dlls/user32/scroll.c
+0
-13
static.c
dlls/user32/static.c
+0
-14
user_main.c
dlls/user32/user_main.c
+1
-1
user_private.h
dlls/user32/user_private.h
+1
-1
class.c
dlls/win32u/class.c
+102
-2
ntuser.h
include/ntuser.h
+1
-1
No files found.
dlls/user32/button.c
View file @
ed693f5b
...
...
@@ -118,19 +118,6 @@ static const pfPaint btnPaintFunc[MAX_BTN_TYPE] =
OB_Paint
/* BS_OWNERDRAW */
};
/*********************************************************************
* button class descriptor
*/
const
struct
builtin_class_descr
BUTTON_builtin_class
=
{
L"Button"
,
/* name */
CS_DBLCLKS
|
CS_VREDRAW
|
CS_HREDRAW
|
CS_PARENTDC
,
/* style */
WINPROC_BUTTON
,
/* proc */
NB_EXTRA_BYTES
,
/* extra */
IDC_ARROW
,
/* cursor */
0
/* brush */
};
static
inline
LONG
get_button_state
(
HWND
hwnd
)
{
...
...
dlls/user32/class.c
View file @
ed693f5b
...
...
@@ -264,32 +264,6 @@ static void get_versioned_name( const WCHAR *name, UNICODE_STRING *ret, UNICODE_
}
/***********************************************************************
* register_builtin
*
* Register a builtin control class.
* This allows having both ANSI and Unicode winprocs for the same class.
*/
static
void
register_builtin
(
const
struct
builtin_class_descr
*
descr
)
{
UNICODE_STRING
name
,
version
=
{
.
Length
=
0
};
struct
client_menu_name
menu_name
=
{
0
};
WNDCLASSEXW
class
=
{
.
cbSize
=
sizeof
(
class
),
.
hInstance
=
user32_module
,
.
style
=
descr
->
style
,
.
cbWndExtra
=
descr
->
extra
,
.
hbrBackground
=
descr
->
brush
,
.
lpfnWndProc
=
BUILTIN_WINPROC
(
descr
->
proc
),
};
if
(
descr
->
cursor
)
class
.
hCursor
=
LoadCursorA
(
0
,
(
LPSTR
)
descr
->
cursor
);
init_class_name
(
&
name
,
descr
->
name
);
if
(
!
NtUserRegisterClassExWOW
(
&
class
,
&
name
,
&
version
,
&
menu_name
,
1
,
0
,
NULL
)
&&
class
.
hCursor
)
DestroyCursor
(
class
.
hCursor
);
}
static
void
load_uxtheme
(
void
)
{
BOOL
(
WINAPI
*
pIsThemeActive
)(
void
);
...
...
@@ -305,25 +279,12 @@ static void load_uxtheme(void)
}
/***********************************************************************
* User32
Register
BuiltinClasses
* User32
Init
BuiltinClasses
*/
BOOL
WINAPI
User32
Register
BuiltinClasses
(
const
struct
win_hook_params
*
params
,
ULONG
size
)
BOOL
WINAPI
User32
Init
BuiltinClasses
(
const
struct
win_hook_params
*
params
,
ULONG
size
)
{
DWORD
layout
;
register_builtin
(
&
BUTTON_builtin_class
);
register_builtin
(
&
COMBO_builtin_class
);
register_builtin
(
&
COMBOLBOX_builtin_class
);
register_builtin
(
&
DIALOG_builtin_class
);
register_builtin
(
&
EDIT_builtin_class
);
register_builtin
(
&
ICONTITLE_builtin_class
);
register_builtin
(
&
LISTBOX_builtin_class
);
register_builtin
(
&
MDICLIENT_builtin_class
);
register_builtin
(
&
MENU_builtin_class
);
register_builtin
(
&
SCROLL_builtin_class
);
register_builtin
(
&
STATIC_builtin_class
);
register_builtin
(
&
IME_builtin_class
);
GetProcessDefaultLayout
(
&
layout
);
/* make sure that process layout is initialized */
/* Load uxtheme.dll so that standard scrollbars and dialogs are hooked for theming support */
...
...
dlls/user32/combo.c
View file @
ed693f5b
...
...
@@ -76,20 +76,6 @@ static UINT CBitHeight, CBitWidth;
static
void
CBCalcPlacement
(
HEADCOMBO
*
combo
);
static
void
CBResetPos
(
HEADCOMBO
*
combo
,
BOOL
redraw
);
/*********************************************************************
* combo class descriptor
*/
const
struct
builtin_class_descr
COMBO_builtin_class
=
{
L"ComboBox"
,
/* name */
CS_PARENTDC
|
CS_DBLCLKS
|
CS_HREDRAW
|
CS_VREDRAW
,
/* style */
WINPROC_COMBO
,
/* proc */
sizeof
(
HEADCOMBO
*
),
/* extra */
IDC_ARROW
,
/* cursor */
0
/* brush */
};
/***********************************************************************
* COMBO_Init
*
...
...
dlls/user32/controls.h
View file @
ed693f5b
...
...
@@ -24,30 +24,6 @@
#include "winuser.h"
#include "../win32u/ntuser_private.h"
/* Built-in class descriptor */
struct
builtin_class_descr
{
LPCWSTR
name
;
/* class name */
UINT
style
;
/* class style */
enum
builtin_winprocs
proc
;
INT
extra
;
/* window extra bytes */
ULONG_PTR
cursor
;
/* cursor id */
HBRUSH
brush
;
/* brush or system color */
};
extern
const
struct
builtin_class_descr
BUTTON_builtin_class
DECLSPEC_HIDDEN
;
extern
const
struct
builtin_class_descr
COMBO_builtin_class
DECLSPEC_HIDDEN
;
extern
const
struct
builtin_class_descr
COMBOLBOX_builtin_class
DECLSPEC_HIDDEN
;
extern
const
struct
builtin_class_descr
DIALOG_builtin_class
DECLSPEC_HIDDEN
;
extern
const
struct
builtin_class_descr
EDIT_builtin_class
DECLSPEC_HIDDEN
;
extern
const
struct
builtin_class_descr
ICONTITLE_builtin_class
DECLSPEC_HIDDEN
;
extern
const
struct
builtin_class_descr
LISTBOX_builtin_class
DECLSPEC_HIDDEN
;
extern
const
struct
builtin_class_descr
MDICLIENT_builtin_class
DECLSPEC_HIDDEN
;
extern
const
struct
builtin_class_descr
MENU_builtin_class
DECLSPEC_HIDDEN
;
extern
const
struct
builtin_class_descr
SCROLL_builtin_class
DECLSPEC_HIDDEN
;
extern
const
struct
builtin_class_descr
STATIC_builtin_class
DECLSPEC_HIDDEN
;
extern
const
struct
builtin_class_descr
IME_builtin_class
DECLSPEC_HIDDEN
;
extern
LRESULT
WINAPI
ImeWndProcA
(
HWND
,
UINT
,
WPARAM
,
LPARAM
)
DECLSPEC_HIDDEN
;
extern
LRESULT
WINAPI
ImeWndProcW
(
HWND
,
UINT
,
WPARAM
,
LPARAM
)
DECLSPEC_HIDDEN
;
extern
LRESULT
WINAPI
DesktopWndProc
(
HWND
,
UINT
,
WPARAM
,
LPARAM
)
DECLSPEC_HIDDEN
;
...
...
dlls/user32/dialog.c
View file @
ed693f5b
...
...
@@ -85,20 +85,6 @@ typedef struct
}
RADIOGROUP
;
/*********************************************************************
* dialog class descriptor
*/
const
struct
builtin_class_descr
DIALOG_builtin_class
=
{
(
LPCWSTR
)
DIALOG_CLASS_ATOM
,
/* name */
CS_SAVEBITS
|
CS_DBLCLKS
,
/* style */
WINPROC_DIALOG
,
/* proc */
DLGWINDOWEXTRA
,
/* extra */
IDC_ARROW
,
/* cursor */
0
/* brush */
};
/***********************************************************************
* DIALOG_GetControl32
*
...
...
dlls/user32/edit.c
View file @
ed693f5b
...
...
@@ -5255,17 +5255,3 @@ LRESULT EditWndProc_common( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, B
return
result
;
}
/*********************************************************************
* edit class descriptor
*/
const
struct
builtin_class_descr
EDIT_builtin_class
=
{
L"Edit"
,
/* name */
CS_DBLCLKS
|
CS_PARENTDC
,
/* style */
WINPROC_EDIT
,
/* proc */
sizeof
(
UINT64
),
/* extra */
IDC_IBEAM
,
/* cursor */
0
/* brush */
};
dlls/user32/icontitle.c
View file @
ed693f5b
...
...
@@ -32,19 +32,6 @@
static
BOOL
bMultiLineTitle
;
static
HFONT
hIconTitleFont
;
/*********************************************************************
* icon title class descriptor
*/
const
struct
builtin_class_descr
ICONTITLE_builtin_class
=
{
(
LPCWSTR
)
ICONTITLE_CLASS_ATOM
,
/* name */
0
,
/* style */
WINPROC_ICONTITLE
,
/* proc */
0
,
/* extra */
IDC_ARROW
,
/* cursor */
0
/* brush */
};
/***********************************************************************
* ICONTITLE_SetTitlePos
*/
...
...
dlls/user32/listbox.c
View file @
ed693f5b
...
...
@@ -241,33 +241,6 @@ static void remove_item_data(LB_DESCR *descr, UINT index)
memmove
(
p
,
p
+
size
,
(
descr
->
nb_items
-
index
)
*
size
);
}
/*********************************************************************
* listbox class descriptor
*/
const
struct
builtin_class_descr
LISTBOX_builtin_class
=
{
L"ListBox"
,
/* name */
CS_DBLCLKS
/*| CS_PARENTDC*/
,
/* style */
WINPROC_LISTBOX
,
/* proc */
sizeof
(
LB_DESCR
*
),
/* extra */
IDC_ARROW
,
/* cursor */
0
/* brush */
};
/*********************************************************************
* combolbox class descriptor
*/
const
struct
builtin_class_descr
COMBOLBOX_builtin_class
=
{
L"ComboLBox"
,
/* name */
CS_DBLCLKS
|
CS_SAVEBITS
,
/* style */
WINPROC_LISTBOX
,
/* proc */
sizeof
(
LB_DESCR
*
),
/* extra */
IDC_ARROW
,
/* cursor */
0
/* brush */
};
/***********************************************************************
* LISTBOX_GetCurrentPageSize
...
...
dlls/user32/mdi.c
View file @
ed693f5b
...
...
@@ -178,20 +178,6 @@ static void MDI_PostUpdate(HWND hwnd, MDICLIENTINFO* ci, WORD recalc)
}
/*********************************************************************
* MDIClient class descriptor
*/
const
struct
builtin_class_descr
MDICLIENT_builtin_class
=
{
L"MDIClient"
,
/* name */
0
,
/* style */
WINPROC_MDICLIENT
,
/* proc */
2
*
sizeof
(
void
*
),
/* extra */
IDC_ARROW
,
/* cursor */
(
HBRUSH
)(
COLOR_APPWORKSPACE
+
1
)
/* brush */
};
static
MDICLIENTINFO
*
get_client_info
(
HWND
client
)
{
return
NtUserGetMDIClientInfo
(
client
);
...
...
dlls/user32/menu.c
View file @
ed693f5b
...
...
@@ -68,19 +68,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(menu);
#define STATE_MASK (~TYPE_MASK)
#define MENUITEMINFO_STATE_MASK (STATE_MASK & ~(MF_BYPOSITION | MF_MOUSESELECT))
/*********************************************************************
* menu class descriptor
*/
const
struct
builtin_class_descr
MENU_builtin_class
=
{
(
LPCWSTR
)
POPUPMENU_CLASS_ATOM
,
/* name */
CS_DROPSHADOW
|
CS_SAVEBITS
|
CS_DBLCLKS
,
/* style */
WINPROC_MENU
,
/* proc */
sizeof
(
HMENU
),
/* extra */
IDC_ARROW
,
/* cursor */
(
HBRUSH
)(
COLOR_MENU
+
1
)
/* brush */
};
/**********************************************************************
* MENU_ParseResource
...
...
dlls/user32/misc.c
View file @
ed693f5b
...
...
@@ -530,16 +530,6 @@ BOOL WINAPI GetPointerType(UINT32 id, POINTER_INPUT_TYPE *type)
return
TRUE
;
}
const
struct
builtin_class_descr
IME_builtin_class
=
{
L"IME"
,
/* name */
0
,
/* style */
WINPROC_IME
,
/* proc */
2
*
sizeof
(
LONG_PTR
),
/* extra */
IDC_ARROW
,
/* cursor */
0
/* brush */
};
LRESULT
WINAPI
ImeWndProcA
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
if
(
!
imm_ime_wnd_proc
)
return
DefWindowProcA
(
hwnd
,
msg
,
wParam
,
lParam
);
...
...
dlls/user32/scroll.c
View file @
ed693f5b
...
...
@@ -35,19 +35,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(scroll);
/* Overlap between arrows and thumb */
#define SCROLL_ARROW_THUMB_OVERLAP 0
/*********************************************************************
* scrollbar class descriptor
*/
const
struct
builtin_class_descr
SCROLL_builtin_class
=
{
L"ScrollBar"
,
/* name */
CS_DBLCLKS
|
CS_VREDRAW
|
CS_HREDRAW
|
CS_PARENTDC
,
/* style */
WINPROC_SCROLLBAR
,
/* proc */
sizeof
(
struct
scroll_bar_win_data
),
/* extra */
IDC_ARROW
,
/* cursor */
0
/* brush */
};
/***********************************************************************
* SCROLL_DrawArrows
...
...
dlls/user32/static.c
View file @
ed693f5b
...
...
@@ -52,7 +52,6 @@ static COLORREF color_3dshadow, color_3ddkshadow, color_3dhighlight;
/* offsets for GetWindowLong for static private information */
#define HFONT_GWL_OFFSET 0
#define HICON_GWL_OFFSET (sizeof(HFONT))
#define STATIC_EXTRA_BYTES (HICON_GWL_OFFSET + sizeof(HICON))
typedef
void
(
*
pfPaint
)(
HWND
hwnd
,
HDC
hdc
,
HBRUSH
hbrush
,
DWORD
style
);
...
...
@@ -80,19 +79,6 @@ static const pfPaint staticPaintFunc[SS_TYPEMASK+1] =
};
/*********************************************************************
* static class descriptor
*/
const
struct
builtin_class_descr
STATIC_builtin_class
=
{
L"Static"
,
/* name */
CS_DBLCLKS
|
CS_PARENTDC
,
/* style */
WINPROC_STATIC
,
/* proc */
STATIC_EXTRA_BYTES
,
/* extra */
IDC_ARROW
,
/* cursor */
0
/* brush */
};
/***********************************************************************
* STATIC_SetIcon
*
...
...
dlls/user32/user_main.c
View file @
ed693f5b
...
...
@@ -201,11 +201,11 @@ static const void *kernel_callback_table[NtUserCallCount] =
User32FreeCachedClipboardData
,
User32ImmProcessKey
,
User32ImmTranslateMessage
,
User32InitBuiltinClasses
,
User32LoadDriver
,
User32LoadImage
,
User32LoadSysMenu
,
User32PostDDEMessage
,
User32RegisterBuiltinClasses
,
User32RenderSsynthesizedFormat
,
User32UnpackDDEMessage
,
};
...
...
dlls/user32/user_private.h
View file @
ed693f5b
...
...
@@ -96,7 +96,7 @@ BOOL WINAPI User32CallSendAsyncCallback( const struct send_async_params *params,
BOOL
WINAPI
User32CallWinEventHook
(
const
struct
win_event_hook_params
*
params
,
ULONG
size
);
BOOL
WINAPI
User32CallWindowProc
(
struct
win_proc_params
*
params
,
ULONG
size
);
BOOL
WINAPI
User32CallWindowsHook
(
const
struct
win_hook_params
*
params
,
ULONG
size
);
BOOL
WINAPI
User32
Register
BuiltinClasses
(
const
struct
win_hook_params
*
params
,
ULONG
size
);
BOOL
WINAPI
User32
Init
BuiltinClasses
(
const
struct
win_hook_params
*
params
,
ULONG
size
);
/* message spy definitions */
...
...
dlls/win32u/class.c
View file @
ed693f5b
...
...
@@ -1075,6 +1075,104 @@ static const struct builtin_class_descr message_builtin_class =
.
proc
=
WINPROC_MESSAGE
,
};
static
const
struct
builtin_class_descr
builtin_classes
[]
=
{
/* button */
{
.
name
=
"Button"
,
.
style
=
CS_DBLCLKS
|
CS_VREDRAW
|
CS_HREDRAW
|
CS_PARENTDC
,
.
proc
=
WINPROC_BUTTON
,
.
extra
=
sizeof
(
UINT
)
+
2
*
sizeof
(
HANDLE
),
.
cursor
=
IDC_ARROW
,
},
/* combo */
{
.
name
=
"ComboBox"
,
.
style
=
CS_PARENTDC
|
CS_DBLCLKS
|
CS_HREDRAW
|
CS_VREDRAW
,
.
proc
=
WINPROC_COMBO
,
.
extra
=
sizeof
(
void
*
),
.
cursor
=
IDC_ARROW
,
},
/* combolbox */
{
.
name
=
"ComboLBox"
,
.
style
=
CS_DBLCLKS
|
CS_SAVEBITS
,
.
proc
=
WINPROC_LISTBOX
,
.
extra
=
sizeof
(
void
*
),
.
cursor
=
IDC_ARROW
,
},
/* dialog */
{
.
name
=
MAKEINTRESOURCEA
(
DIALOG_CLASS_ATOM
),
.
style
=
CS_SAVEBITS
|
CS_DBLCLKS
,
.
proc
=
WINPROC_DIALOG
,
.
extra
=
DLGWINDOWEXTRA
,
.
cursor
=
IDC_ARROW
,
},
/* edit */
{
.
name
=
"Edit"
,
.
style
=
CS_DBLCLKS
|
CS_PARENTDC
,
.
proc
=
WINPROC_EDIT
,
.
extra
=
sizeof
(
UINT64
),
.
cursor
=
IDC_IBEAM
,
},
/* icon title */
{
.
name
=
MAKEINTRESOURCEA
(
ICONTITLE_CLASS_ATOM
),
.
proc
=
WINPROC_ICONTITLE
,
.
cursor
=
IDC_ARROW
,
},
/* IME */
{
.
name
=
"IME"
,
.
proc
=
WINPROC_IME
,
.
extra
=
2
*
sizeof
(
LONG_PTR
),
.
cursor
=
IDC_ARROW
,
},
/* listbox */
{
.
name
=
"ListBox"
,
.
style
=
CS_DBLCLKS
,
.
proc
=
WINPROC_LISTBOX
,
.
extra
=
sizeof
(
void
*
),
.
cursor
=
IDC_ARROW
,
},
/* menu */
{
.
name
=
MAKEINTRESOURCEA
(
POPUPMENU_CLASS_ATOM
),
.
style
=
CS_DROPSHADOW
|
CS_SAVEBITS
|
CS_DBLCLKS
,
.
proc
=
WINPROC_MENU
,
.
extra
=
sizeof
(
HMENU
),
.
cursor
=
IDC_ARROW
,
.
brush
=
(
HBRUSH
)(
COLOR_MENU
+
1
),
},
/* MDIClient */
{
.
name
=
"MDIClient"
,
.
proc
=
WINPROC_MDICLIENT
,
.
extra
=
2
*
sizeof
(
void
*
),
.
cursor
=
IDC_ARROW
,
.
brush
=
(
HBRUSH
)(
COLOR_APPWORKSPACE
+
1
),
},
/* scrollbar */
{
.
name
=
"ScrollBar"
,
.
style
=
CS_DBLCLKS
|
CS_VREDRAW
|
CS_HREDRAW
|
CS_PARENTDC
,
.
proc
=
WINPROC_SCROLLBAR
,
.
extra
=
sizeof
(
struct
scroll_bar_win_data
),
.
cursor
=
IDC_ARROW
,
},
/* static */
{
.
name
=
"Static"
,
.
style
=
CS_DBLCLKS
|
CS_PARENTDC
,
.
proc
=
WINPROC_STATIC
,
.
extra
=
2
*
sizeof
(
HANDLE
),
.
cursor
=
IDC_ARROW
,
},
};
/***********************************************************************
* register_builtin
*
...
...
@@ -1116,9 +1214,11 @@ static void register_builtin( const struct builtin_class_descr *descr )
static
void
register_builtins
(
void
)
{
ULONG
ret_len
,
i
;
void
*
ret_ptr
;
ULONG
ret_len
;
KeUserModeCallback
(
NtUserRegisterBuiltinClasses
,
NULL
,
0
,
&
ret_ptr
,
&
ret_len
);
for
(
i
=
0
;
i
<
ARRAYSIZE
(
builtin_classes
);
i
++
)
register_builtin
(
&
builtin_classes
[
i
]
);
KeUserModeCallback
(
NtUserInitBuiltinClasses
,
NULL
,
0
,
&
ret_ptr
,
&
ret_len
);
}
/***********************************************************************
...
...
include/ntuser.h
View file @
ed693f5b
...
...
@@ -39,11 +39,11 @@ enum
NtUserFreeCachedClipboardData
,
NtUserImmProcessKey
,
NtUserImmTranslateMessage
,
NtUserInitBuiltinClasses
,
NtUserLoadDriver
,
NtUserLoadImage
,
NtUserLoadSysMenu
,
NtUserPostDDEMessage
,
NtUserRegisterBuiltinClasses
,
NtUserRenderSynthesizedFormat
,
NtUserUnpackDDEMessage
,
/* win16 hooks */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment