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
45b096ab
Commit
45b096ab
authored
Apr 17, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Apr 17, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Move WM_IME_COMPOSITION DefWindowProc handlers in separate helpers.
parent
93e5d7b3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
55 deletions
+55
-55
defwnd.c
dlls/user32/defwnd.c
+55
-55
No files found.
dlls/user32/defwnd.c
View file @
45b096ab
...
...
@@ -25,6 +25,59 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
win
);
static
void
default_ime_compositionW
(
HWND
hwnd
,
WPARAM
wparam
,
LPARAM
lparam
)
{
WCHAR
*
buf
=
NULL
;
LONG
size
,
i
;
HIMC
himc
;
if
(
!
(
lparam
&
GCS_RESULTSTR
)
||
!
(
himc
=
ImmGetContext
(
hwnd
)))
return
;
if
((
size
=
ImmGetCompositionStringW
(
himc
,
GCS_RESULTSTR
,
NULL
,
0
)))
{
if
(
!
(
buf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
*
sizeof
(
WCHAR
)
)))
size
=
0
;
else
size
=
ImmGetCompositionStringW
(
himc
,
GCS_RESULTSTR
,
buf
,
size
*
sizeof
(
WCHAR
)
);
}
ImmReleaseContext
(
hwnd
,
himc
);
for
(
i
=
0
;
i
<
size
/
sizeof
(
WCHAR
);
i
++
)
SendMessageW
(
hwnd
,
WM_IME_CHAR
,
buf
[
i
],
1
);
HeapFree
(
GetProcessHeap
(),
0
,
buf
);
}
static
void
default_ime_compositionA
(
HWND
hwnd
,
WPARAM
wparam
,
LPARAM
lparam
)
{
unsigned
char
lead
=
0
;
char
*
buf
=
NULL
;
LONG
size
,
i
;
HIMC
himc
;
if
(
!
(
lparam
&
GCS_RESULTSTR
)
||
!
(
himc
=
ImmGetContext
(
hwnd
)))
return
;
if
((
size
=
ImmGetCompositionStringA
(
himc
,
GCS_RESULTSTR
,
NULL
,
0
)))
{
if
(
!
(
buf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
)))
size
=
0
;
else
size
=
ImmGetCompositionStringA
(
himc
,
GCS_RESULTSTR
,
buf
,
size
);
}
ImmReleaseContext
(
hwnd
,
himc
);
for
(
i
=
0
;
i
<
size
;
i
++
)
{
unsigned
char
c
=
buf
[
i
];
if
(
!
lead
)
{
if
(
IsDBCSLeadByte
(
c
))
lead
=
c
;
else
SendMessageA
(
hwnd
,
WM_IME_CHAR
,
c
,
1
);
}
else
{
SendMessageA
(
hwnd
,
WM_IME_CHAR
,
MAKEWORD
(
c
,
lead
),
1
);
lead
=
0
;
}
}
HeapFree
(
GetProcessHeap
(),
0
,
buf
);
}
/***********************************************************************
* DefWindowProcA (USER32.@)
...
...
@@ -66,41 +119,7 @@ LRESULT WINAPI DefWindowProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam
break
;
case
WM_IME_COMPOSITION
:
if
(
lParam
&
GCS_RESULTSTR
)
{
LONG
size
,
i
;
unsigned
char
lead
=
0
;
char
*
buf
=
NULL
;
HIMC
himc
=
ImmGetContext
(
hwnd
);
if
(
himc
)
{
if
((
size
=
ImmGetCompositionStringA
(
himc
,
GCS_RESULTSTR
,
NULL
,
0
)))
{
if
(
!
(
buf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
)))
size
=
0
;
else
size
=
ImmGetCompositionStringA
(
himc
,
GCS_RESULTSTR
,
buf
,
size
);
}
ImmReleaseContext
(
hwnd
,
himc
);
for
(
i
=
0
;
i
<
size
;
i
++
)
{
unsigned
char
c
=
buf
[
i
];
if
(
!
lead
)
{
if
(
IsDBCSLeadByte
(
c
))
lead
=
c
;
else
SendMessageA
(
hwnd
,
WM_IME_CHAR
,
c
,
1
);
}
else
{
SendMessageA
(
hwnd
,
WM_IME_CHAR
,
MAKEWORD
(
c
,
lead
),
1
);
lead
=
0
;
}
}
HeapFree
(
GetProcessHeap
(),
0
,
buf
);
}
}
default_ime_compositionA
(
hwnd
,
wParam
,
lParam
);
/* fall through */
default:
...
...
@@ -159,26 +178,7 @@ LRESULT WINAPI DefWindowProcW(
break
;
case
WM_IME_COMPOSITION
:
if
(
lParam
&
GCS_RESULTSTR
)
{
LONG
size
,
i
;
WCHAR
*
buf
=
NULL
;
HIMC
himc
=
ImmGetContext
(
hwnd
);
if
(
himc
)
{
if
((
size
=
ImmGetCompositionStringW
(
himc
,
GCS_RESULTSTR
,
NULL
,
0
)))
{
if
(
!
(
buf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
*
sizeof
(
WCHAR
)
)))
size
=
0
;
else
size
=
ImmGetCompositionStringW
(
himc
,
GCS_RESULTSTR
,
buf
,
size
*
sizeof
(
WCHAR
)
);
}
ImmReleaseContext
(
hwnd
,
himc
);
for
(
i
=
0
;
i
<
size
/
sizeof
(
WCHAR
);
i
++
)
SendMessageW
(
hwnd
,
WM_IME_CHAR
,
buf
[
i
],
1
);
HeapFree
(
GetProcessHeap
(),
0
,
buf
);
}
}
default_ime_compositionW
(
hwnd
,
wParam
,
lParam
);
/* fall through */
default:
...
...
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